sliccy 2.2.0 → 2.2.1

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 (67) hide show
  1. package/dist/ui/assets/__vite-browser-external-BC516C8G.js +1 -0
  2. package/dist/ui/assets/{anthropic-BDXWvzdA.js → anthropic-CMlPlDIk.js} +1 -1
  3. package/dist/ui/assets/{azure-openai-responses-CKLc7IC4.js → azure-openai-responses-D8KcZhBl.js} +1 -1
  4. package/dist/ui/assets/{cdp-CtEFOd-O.js → cdp-CsCvDwW3.js} +3 -3
  5. package/dist/ui/assets/chunk-jRWAZmH_.js +1 -0
  6. package/dist/ui/assets/{cost-command-CGzKvuNW.js → cost-command-DBzah9S9.js} +6 -6
  7. package/dist/ui/assets/{dist-CBC7OjhO.js → dist-C43FKPek.js} +2 -2
  8. package/dist/ui/assets/{dist--SipPaGB.js → dist-CLNuUmSq.js} +2 -2
  9. package/dist/ui/assets/{dist-BQ8A4EPf.js → dist-CWhXzJlW.js} +1 -1
  10. package/dist/ui/assets/dist-CYRMRTTO.js +1 -0
  11. package/dist/ui/assets/{dist-BlyYz71N.js → dist-DJK5C7yO.js} +1 -1
  12. package/dist/ui/assets/{dist-BbDHofFB.js → dist-DhTZTSy5.js} +1 -1
  13. package/dist/ui/assets/{es-DVVaE6zS.js → es-02E0S87Z.js} +2 -2
  14. package/dist/ui/assets/{fs-DUWoGzSN.js → fs-bsu2i7du.js} +1 -1
  15. package/dist/ui/assets/{google-g3eUXCCV.js → google-DO7yvPO4.js} +1 -1
  16. package/dist/ui/assets/{google-gemini-cli-CiaDQBZY.js → google-gemini-cli-DdA3nx6W.js} +1 -1
  17. package/dist/ui/assets/{google-shared-Bc8yrzvw.js → google-shared-BWQFIy8i.js} +2 -2
  18. package/dist/ui/assets/{google-vertex-Cf-hp1s4.js → google-vertex-C5s4LVmo.js} +1 -1
  19. package/dist/ui/assets/{index-DvKgWKET.js → index-COiC6muM.js} +289 -289
  20. package/dist/ui/assets/{json-parse-JW3qhabb.js → json-parse-Dn8fsQhn.js} +1 -1
  21. package/dist/ui/assets/{magick-wasm-D4KIq0y6.js → magick-wasm-DA8eLvGf.js} +1 -1
  22. package/dist/ui/assets/{mistral-CxSnkoPt.js → mistral-BPcBoGoy.js} +1 -1
  23. package/dist/ui/assets/{openai-codex-responses-CX6LCE-l.js → openai-codex-responses-N7fKFsLN.js} +1 -1
  24. package/dist/ui/assets/{openai-completions-CUKgrvVN.js → openai-completions-rv4ohN_x.js} +1 -1
  25. package/dist/ui/assets/{openai-responses-BthT_lNI.js → openai-responses-D4uieQSd.js} +1 -1
  26. package/dist/ui/assets/{openai-responses-shared-ByzYcNN-.js → openai-responses-shared-CUFAAR--.js} +1 -1
  27. package/dist/ui/assets/{pdfjs-Dhk_E7h9.js → pdfjs-kFXy8Q7j.js} +7 -7
  28. package/dist/ui/assets/{provider-settings-lHR3i2bS.js → provider-settings-DUchoI6k.js} +4 -4
  29. package/dist/ui/assets/{pyodide-3iToeyDO.js → pyodide-Doh5i2Gj.js} +3 -3
  30. package/dist/ui/assets/skills-CTCIxQqH.js +9 -0
  31. package/dist/ui/assets/{slicc-editor-LteGL_eD.js → slicc-editor-CWWaxccP.js} +2 -2
  32. package/dist/ui/assets/{sql-wasm-Z190sfbE.js → sql-wasm-Dx6P9mA8.js} +1 -1
  33. package/dist/ui/index.html +16 -17
  34. package/dist/ui/packages/webapp/index.html +16 -17
  35. package/package.json +2 -2
  36. package/dist/ui/assets/__vite-browser-external-CGni-twv.js +0 -1
  37. package/dist/ui/assets/agent-bridge-BQWM5sQP.js +0 -1
  38. package/dist/ui/assets/chunk-zsgVPwQN.js +0 -1
  39. package/dist/ui/assets/dist-CustHeWI.js +0 -1
  40. package/dist/ui/assets/lick-manager-D1bfS_SD.js +0 -1
  41. package/dist/ui/assets/pako-CM3trPL8.js +0 -1
  42. package/dist/ui/assets/provider-settings-CPGfcyq6.js +0 -1
  43. package/dist/ui/assets/providers-CgyG8QfW.js +0 -1
  44. package/dist/ui/assets/secret-env-D4m7q3Dc.js +0 -1
  45. package/dist/ui/assets/shell-DKDHQ8Ux.js +0 -1
  46. package/dist/ui/assets/skills-6ga2RZhv.js +0 -1
  47. package/dist/ui/assets/skills-agEj4Eg8.js +0 -9
  48. package/dist/ui/assets/sprinkle-renderer-Dj8JsQhW.js +0 -1
  49. /package/dist/ui/assets/{addon-fit-Dbzb3n3e.js → addon-fit-CVV7fTw9.js} +0 -0
  50. /package/dist/ui/assets/{bsh-watchdog-XFikI_DX.js → bsh-watchdog-C8qkdGvF.js} +0 -0
  51. /package/dist/ui/assets/{constants-Dqhmtsws.js → constants-DdIXxN9e.js} +0 -0
  52. /package/dist/ui/assets/{db-UiVJ_81p.js → db-CmHnV4DS.js} +0 -0
  53. /package/dist/ui/assets/{dist-zlAHCcD1.js → dist-B3YOuOiy.js} +0 -0
  54. /package/dist/ui/assets/{env-api-keys-qwjmVNjS.js → env-api-keys-7VVTY3n7.js} +0 -0
  55. /package/dist/ui/assets/{github-copilot-headers-Bz8q1fNX.js → github-copilot-headers-C0FOlzjL.js} +0 -0
  56. /package/dist/ui/assets/{hash-D2-j0Bls.js → hash-CQjDwcjR.js} +0 -0
  57. /package/dist/ui/assets/{lick-manager-proxy-_h8oUTsW.js → lick-manager-proxy-B2bMdplq.js} +0 -0
  58. /package/dist/ui/assets/{oauth-service-dTQ65zA2.js → oauth-service-BoyG8vZW.js} +0 -0
  59. /package/dist/ui/assets/{offscreen-client-vFDPYD-S.js → offscreen-client-CD0tozA4.js} +0 -0
  60. /package/dist/ui/assets/{openai-Cn7eGqwa.js → openai-CQsomflW.js} +0 -0
  61. /package/dist/ui/assets/{path-utils-DAY6ORUp.js → path-utils-CNNVZ3-O.js} +0 -0
  62. /package/dist/ui/assets/{sanitize-unicode-DmvZGa56.js → sanitize-unicode-BOCYaWok.js} +0 -0
  63. /package/dist/ui/assets/{secret-masking-B0alBbYk.js → secret-masking-Bqg5RXZg.js} +0 -0
  64. /package/dist/ui/assets/{simple-options-DZXt61Q2.js → simple-options-B6uouUxh.js} +0 -0
  65. /package/dist/ui/assets/{src-DGdmJN2h.js → src-CNgmwAf5.js} +0 -0
  66. /package/dist/ui/assets/{tray-follower-status-LqS6IS1u.js → tray-follower-status-BlQSlF6m.js} +0 -0
  67. /package/dist/ui/assets/{xterm-DDjY5F5A.js → xterm-ucbPh68r.js} +0 -0
@@ -1,9 +1,9 @@
1
1
  import{t as e}from"./preload-helper-D4M6sveU.js";globalThis.DOMMatrix===void 0&&(globalThis.DOMMatrix=class{}),globalThis.FinalizationRegistry===void 0&&(globalThis.FinalizationRegistry=class{register(){}unregister(){}}),globalThis.navigator??={},globalThis.navigator.platform??=``,globalThis.navigator.userAgent??=``,Promise.withResolvers===void 0&&(Promise.withResolvers=function(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}});var t=!(typeof process!=`object`||process+``!=`[object process]`||process.versions.nw||process.versions.electron&&process.type&&process.type!==`browser`),n=[.001,0,0,.001,0,0],r=1.35,i=.35,a=.25925925925925924,o=1,s=2,c=4,l=8,u=16,d=64,f=128,p=256,m=`pdfjs_internal_editor_`,h=3,g=9,_=13,v=15,y=101,b={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},x=0,S=4,C=1,w=2,T=3,E={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},D=`Group`,O=`R`,k=1,ee=2,A=4,j=16,M=32,te=128,ne=512,re=1,ie=2,ae=4096,oe=8192,se=32768,ce=65536,le=131072,ue=1048576,de=2097152,fe=8388608,pe=16777216,me=1,he=2,ge=3,_e=4,ve=5,ye={E:`Mouse Enter`,X:`Mouse Exit`,D:`Mouse Down`,U:`Mouse Up`,Fo:`Focus`,Bl:`Blur`,PO:`PageOpen`,PC:`PageClose`,PV:`PageVisible`,PI:`PageInvisible`,K:`Keystroke`,F:`Format`,V:`Validate`,C:`Calculate`},be={WC:`WillClose`,WS:`WillSave`,DS:`DidSave`,WP:`WillPrint`,DP:`DidPrint`},xe={O:`PageOpen`,C:`PageClose`},Se=1,Ce=5,we=1,Te=2,Ee=3,De=4,Oe=5,ke=6,Ae=7,je=8,Me=9,Ne=10,Pe=11,Fe=12,Ie=13,Le=14,Re=15,ze=16,Be=17,Ve=18,He=19,Ue=20,We=21,Ge=22,Ke=23,qe=24,Je=25,Ye=26,Xe=27,Ze=28,Qe=29,$e=30,et=31,tt=32,nt=33,rt=34,it=35,at=36,ot=37,st=38,ct=39,lt=40,ut=41,dt=42,ft=43,pt=44,mt=45,ht=46,gt=47,_t=48,vt=49,yt=50,bt=51,xt=52,St=53,Ct=54,wt=55,Tt=56,Et=57,Dt=58,Ot=59,kt=60,At=61,jt=62,Mt=63,Nt=64,Pt=65,Ft=66,It=67,Lt=68,Rt=69,zt=70,Bt=71,Vt=72,Ht=73,Ut=74,Wt=75,Gt=76,Kt=77,qt=80,Jt=81,Yt=83,Xt=84,Zt=85,Qt=86,$t=87,en=88,tn=89,nn=90,rn=91,an=92,on=93,sn=94,cn=0,ln=1,un=2,dn=3,fn=1,pn=2,mn=Se;function hn(e){mn>=Ce&&console.info(`Info: ${e}`)}function N(e){mn>=Se&&console.warn(`Warning: ${e}`)}function gn(e){throw Error(e)}function _n(e,t){e||gn(t)}function vn(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=Pn(e)}catch{}let r=t?URL.parse(e,t):URL.parse(e);return function(e){switch(e?.protocol){case`http:`:case`https:`:case`ftp:`:case`mailto:`:case`tel:`:return!0;default:return!1}}(r)?r:null}function P(e,t,n,r=!1){return Object.defineProperty(e,t,{value:n,enumerable:!r,configurable:!0,writable:!1}),n}var yn=function(){function e(e,t){this.message=e,this.name=t}return e.prototype=Error(),e.constructor=e,e}(),bn=class extends yn{constructor(e,t){super(e,`PasswordException`),this.code=t}},xn=class extends yn{constructor(e,t){super(e,`UnknownErrorException`),this.details=t}},Sn=class extends yn{constructor(e){super(e,`InvalidPDFException`)}},Cn=class extends yn{constructor(e,t,n){super(e,`ResponseException`),this.status=t,this.missing=n}},F=class extends yn{constructor(e){super(e,`FormatError`)}},wn=class extends yn{constructor(e){super(e,`AbortException`)}};function Tn(e){typeof e==`object`&&e?.length!==void 0||gn(`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 En(e){typeof e!=`string`&&gn(`Invalid argument for stringToBytes`);let t=e.length,n=new Uint8Array(t);for(let r=0;r<t;++r)n[r]=255&e.charCodeAt(r);return n}function Dn(e){return String.fromCharCode(e>>24&255,e>>16&255,e>>8&255,255&e)}function On(e){return Object.keys(e).length}var kn=class{static get isLittleEndian(){return P(this,`isLittleEndian`,function(){let e=new Uint8Array(4);return e[0]=1,new Uint32Array(e.buffer,0,1)[0]===1}())}static get isEvalSupported(){return P(this,`isEvalSupported`,function(){try{return Function(``),!0}catch{return!1}}())}static get isOffscreenCanvasSupported(){return P(this,`isOffscreenCanvasSupported`,typeof OffscreenCanvas<`u`)}static get isImageDecoderSupported(){return P(this,`isImageDecoderSupported`,typeof ImageDecoder<`u`)}static get platform(){let{platform:e,userAgent:t}=navigator;return P(this,`platform`,{isAndroid:t.includes(`Android`),isLinux:e.includes(`Linux`),isMac:e.includes(`Mac`),isWindows:e.includes(`Win`),isFirefox:t.includes(`Firefox`)})}static get isCSSRoundSupported(){return P(this,`isCSSRoundSupported`,globalThis.CSS?.supports?.(`width: round(1.5px, 1px)`))}},An=Array.from(Array(256).keys(),e=>e.toString(16).padStart(2,`0`)),jn=class{static makeHexColor(e,t,n){return`#${An[e]}${An[t]}${An[n]}`}static domMatrixToTransform(e){return[e.a,e.b,e.c,e.d,e.e,e.f]}static scaleMinMax(e,t){let n;e[0]?(e[0]<0&&(n=t[0],t[0]=t[2],t[2]=n),t[0]*=e[0],t[2]*=e[0],e[3]<0&&(n=t[1],t[1]=t[3],t[3]=n),t[1]*=e[3],t[3]*=e[3]):(n=t[0],t[0]=t[1],t[1]=n,n=t[2],t[2]=t[3],t[3]=n,e[1]<0&&(n=t[1],t[1]=t[3],t[3]=n),t[1]*=e[1],t[3]*=e[1],e[2]<0&&(n=t[0],t[0]=t[2],t[2]=n),t[0]*=e[2],t[2]*=e[2]),t[0]+=e[4],t[1]+=e[5],t[2]+=e[4],t[3]+=e[5]}static transform(e,t){return[e[0]*t[0]+e[2]*t[1],e[1]*t[0]+e[3]*t[1],e[0]*t[2]+e[2]*t[3],e[1]*t[2]+e[3]*t[3],e[0]*t[4]+e[2]*t[5]+e[4],e[1]*t[4]+e[3]*t[5]+e[5]]}static multiplyByDOMMatrix(e,t){return[e[0]*t.a+e[2]*t.b,e[1]*t.a+e[3]*t.b,e[0]*t.c+e[2]*t.d,e[1]*t.c+e[3]*t.d,e[0]*t.e+e[2]*t.f+e[4],e[1]*t.e+e[3]*t.f+e[5]]}static applyTransform(e,t,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)return void(Math.abs(l)>=1e-12&&this.#e(e,t,n,r,i,a,o,s,-u/l,d));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*(3*(n-i)-e+o),6*(e-2*n+i),3*(n-e),c),this.#t(e,n,i,o,t,r,a,s,3*(3*(r-a)-t+s),6*(t-2*r+a),3*(r-t),c)}},Mn=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,728,711,710,729,733,731,730,732,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8226,8224,8225,8230,8212,8211,402,8260,8249,8250,8722,8240,8222,8220,8221,8216,8217,8218,8482,64257,64258,321,338,352,376,381,305,322,339,353,382,0,8364];function Nn(e,t=!1){if(e[0]>=`ï`){let n;if(e[0]===`þ`&&e[1]===`ÿ`?(n=`utf-16be`,e.length%2==1&&(e=e.slice(0,-1))):e[0]===`ÿ`&&e[1]===`þ`?(n=`utf-16le`,e.length%2==1&&(e=e.slice(0,-1))):e[0]===`ï`&&e[1]===`»`&&e[2]===`¿`&&(n=`utf-8`),n)try{let r=new TextDecoder(n,{fatal:!0}),i=En(e),a=r.decode(i);return t||!a.includes(`\x1B`)?a:a.replaceAll(/\x1b[^\x1b]*(?:\x1b|$)/g,``)}catch(e){N(`stringToPDFString: "${e}".`)}}let n=[];for(let r=0,i=e.length;r<i;r++){let a=e.charCodeAt(r);if(!t&&a===27){for(;++r<i&&e.charCodeAt(r)!==27;);continue}let o=Mn[a];n.push(o?String.fromCharCode(o):e.charAt(r))}return n.join(``)}function Pn(e){return decodeURIComponent(escape(e))}function Fn(e){return unescape(encodeURIComponent(e))}function In(e,t){if(e.length!==t.length)return!1;for(let n=0,r=e.length;n<r;n++)if(e[n]!==t[n])return!1;return!0}function Ln(e=new Date){return e instanceof Date||(e=new Date(e)),[e.getUTCFullYear().toString(),(e.getUTCMonth()+1).toString().padStart(2,`0`),e.getUTCDate().toString().padStart(2,`0`),e.getUTCHours().toString().padStart(2,`0`),e.getUTCMinutes().toString().padStart(2,`0`),e.getUTCSeconds().toString().padStart(2,`0`)].join(``)}var Rn=null,zn=null;function Bn(e,t,n){return Math.min(Math.max(e,t),n)}function Vn(e){return Uint8Array.prototype.toHex?e.toHex():Array.from(e,e=>An[e]).join(``)}typeof Promise.try!=`function`&&(Promise.try=function(e,...t){return new Promise(n=>{n(e(...t))})}),typeof Math.sumPrecise!=`function`&&(Math.sumPrecise=function(e){return e.reduce((e,t)=>e+t,0)});var Hn=Symbol(`CIRCULAR_REF`),Un=Symbol(`EOF`),Wn=Object.create(null),Gn=Object.create(null),Kn=Object.create(null),I=class e{constructor(e){this.name=e}static get(t){return Gn[t]||=new e(t)}},qn=class e{constructor(e){this.cmd=e}static get(t){return Wn[t]||=new e(t)}},Jn=function(){return Jn},L=class e{constructor(e=null){this._map=new Map,this.xref=e,this.objId=null,this.suppressEncryption=!1,this.__nonSerializable__=Jn}assignXref(e){this.xref=e}get size(){return this._map.size}get(e,t,n){let r=this._map.get(e);return r===void 0&&t!==void 0&&(r=this._map.get(t),r===void 0&&n!==void 0&&(r=this._map.get(n))),r instanceof R&&this.xref?this.xref.fetch(r,this.suppressEncryption):r}async getAsync(e,t,n){let r=this._map.get(e);return r===void 0&&t!==void 0&&(r=this._map.get(t),r===void 0&&n!==void 0&&(r=this._map.get(n))),r instanceof R&&this.xref?this.xref.fetchAsync(r,this.suppressEncryption):r}getArray(e,t,n){let r=this._map.get(e);if(r===void 0&&t!==void 0&&(r=this._map.get(t),r===void 0&&n!==void 0&&(r=this._map.get(n))),r instanceof R&&this.xref&&(r=this.xref.fetch(r,this.suppressEncryption)),Array.isArray(r)){r=r.slice();for(let e=0,t=r.length;e<t;e++)r[e]instanceof R&&this.xref&&(r[e]=this.xref.fetch(r[e],this.suppressEncryption))}return r}getRaw(e){return this._map.get(e)}getKeys(){return[...this._map.keys()]}getRawValues(){return[...this._map.values()]}set(e,t){this._map.set(e,t)}setIfNotExists(e,t){this.has(e)||this.set(e,t)}setIfNumber(e,t){typeof t==`number`&&this.set(e,t)}setIfArray(e,t){(Array.isArray(t)||ArrayBuffer.isView(t))&&this.set(e,t)}setIfDefined(e,t){t!=null&&this.set(e,t)}setIfName(e,t){typeof t==`string`?this.set(e,I.get(t)):t instanceof I&&this.set(e,t)}has(e){return this._map.has(e)}*[Symbol.iterator](){for(let[e,t]of this._map)yield[e,t instanceof R&&this.xref?this.xref.fetch(t,this.suppressEncryption):t]}static get empty(){let t=new e(null);return t.set=(e,t)=>{gn("Should not call `set` on the empty dictionary.")},P(this,`empty`,t)}static merge({xref:t,dictArray:n,mergeSubDicts:r=!1}){let i=new e(t),a=new Map;for(let t of n)if(t instanceof e)for(let[n,i]of t._map){let t=a.get(n);if(t===void 0)t=[],a.set(n,t);else if(!(r&&i instanceof e))continue;t.push(i)}for(let[n,r]of a){if(r.length===1||!(r[0]instanceof e)){i._map.set(n,r[0]);continue}let a=new e(t);for(let e of r)for(let[t,n]of e._map)a._map.has(t)||a._map.set(t,n);a.size>0&&i._map.set(n,a)}return a.clear(),i.size>0?i:e.empty}clone(){let t=new e(this.xref);for(let e of this.getKeys())t.set(e,this.getRaw(e));return t}delete(e){this._map.delete(e)}},R=class e{constructor(e,t){this.num=e,this.gen=t}toString(){return this.gen===0?`${this.num}R`:`${this.num}R${this.gen}`}static fromString(t){let n=Kn[t];if(n)return n;let r=/^(\d+)R(\d*)$/.exec(t);return r&&r[1]!==`0`?Kn[t]=new e(parseInt(r[1]),r[2]?parseInt(r[2]):0):null}static get(t,n){let r=n===0?`${t}R`:`${t}R${n}`;return Kn[r]||=new e(t,n)}},Yn=class{constructor(e=null){this._set=new Set(e?._set)}has(e){return this._set.has(e.toString())}put(e){this._set.add(e.toString())}remove(e){this._set.delete(e.toString())}[Symbol.iterator](){return this._set.values()}clear(){this._set.clear()}},Xn=class{constructor(){this._map=new Map}get size(){return this._map.size}get(e){return this._map.get(e.toString())}has(e){return this._map.has(e.toString())}put(e,t){this._map.set(e.toString(),t)}putAlias(e,t){this._map.set(e.toString(),this.get(t))}[Symbol.iterator](){return this._map.values()}clear(){this._map.clear()}*values(){yield*this._map.values()}*items(){for(let[e,t]of this._map)yield[R.fromString(e),t]}};function Zn(e,t){return e instanceof I&&(t===void 0||e.name===t)}function Qn(e,t){return e instanceof qn&&(t===void 0||e.cmd===t)}function $n(e,t){return e instanceof L&&(t===void 0||Zn(e.get(`Type`),t))}function er(e,t){return e.num===t.num&&e.gen===t.gen}var tr=class{get length(){gn("Abstract getter `length` accessed")}get isEmpty(){gn("Abstract getter `isEmpty` accessed")}get isDataLoaded(){return P(this,`isDataLoaded`,!0)}getByte(){gn("Abstract method `getByte` called")}getBytes(e){gn("Abstract method `getBytes` called")}async getImageData(e,t){return this.getBytes(e,t)}async asyncGetBytes(){gn("Abstract method `asyncGetBytes` called")}get isAsync(){return!1}get isAsyncDecoder(){return!1}get canAsyncDecodeImageFromBuffer(){return!1}async getTransferableImage(){return null}peekByte(){let e=this.getByte();return e!==-1&&this.pos--,e}peekBytes(e){let t=this.getBytes(e);return this.pos-=t.length,t}getUint16(){let e=this.getByte(),t=this.getByte();return e===-1||t===-1?-1:(e<<8)+t}getInt32(){return(this.getByte()<<24)+(this.getByte()<<16)+(this.getByte()<<8)+this.getByte()}getByteRange(e,t){gn("Abstract method `getByteRange` called")}getString(e){return Tn(this.getBytes(e))}skip(e){this.pos+=e||1}reset(){gn("Abstract method `reset` called")}moveStart(){gn("Abstract method `moveStart` called")}makeSubStream(e,t,n=null){gn("Abstract method `makeSubStream` called")}getBaseStreams(){return null}},nr=/^[1-9]\.\d$/,rr=2**31-1,ir=[1,0,0,1,0,0],ar=[`ColorSpace`,`ExtGState`,`Font`,`Pattern`,`Properties`,`Shading`,`XObject`],or=[`ExtGState`,`Font`,`Properties`,`XObject`];function sr(e){let t;return function(){return e&&=(t=Object.create(null),e(t),null),t}}var cr=class extends yn{constructor(e,t){super(`Missing data [${e}, ${t})`,`MissingDataException`),this.begin=e,this.end=t}},lr=class extends yn{constructor(e){super(e,`ParserEOFException`)}},ur=class extends yn{constructor(e){super(e,`XRefEntryException`)}},dr=class extends yn{constructor(e){super(e,`XRefParseException`)}};function fr(e){let t=e.length;if(t===0)return new Uint8Array;if(t===1)return new Uint8Array(e[0]);let n=0;for(let r=0;r<t;r++)n+=e[r].byteLength;let r=new Uint8Array(n),i=0;for(let n=0;n<t;n++){let t=new Uint8Array(e[n]);r.set(t,i),i+=t.byteLength}return r}async function pr(e){let t=await fetch(e);if(!t.ok)throw Error(`Failed to fetch file "${e}" with "${t.statusText}".`);return new Uint8Array(await t.arrayBuffer())}function mr({dict:e,key:t,getArray:n=!1,stopWhenFound:r=!0}){let i,a=new Yn;for(;e instanceof L&&(!e.objId||!a.has(e.objId));){e.objId&&a.put(e.objId);let o=n?e.getArray(t):e.get(t);if(o!==void 0){if(r)return o;(i||=[]).push(o)}e=e.get(`Parent`)}return i}var hr=`.C.CC.CCC.CD.D.DC.DCC.DCCC.CM..X.XX.XXX.XL.L.LX.LXX.LXXX.XC..I.II.III.IV.V.VI.VII.VIII.IX`.split(`.`);function gr(e,t=!1){_n(Number.isInteger(e)&&e>0,`The number should be a positive integer.`);let n=`M`.repeat(e/1e3|0)+hr[e%1e3/100|0]+hr[10+(e%100/10|0)]+hr[20+e%10];return t?n.toLowerCase():n}function _r(e){return e>0?Math.ceil(Math.log2(e)):0}function vr(e,t){return e[t]<<24>>24}function yr(e,t){return(e[t]<<24|e[t+1]<<16)>>16}function br(e,t){return e[t]<<8|e[t+1]}function xr(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}function Sr(e){return e===32||e===9||e===13||e===10}function Cr(e,t){return Array.isArray(e)?(t===null||e.length===t)&&e.every(e=>typeof e==`number`):ArrayBuffer.isView(e)&&!(e instanceof BigInt64Array||e instanceof BigUint64Array)&&(t===null||e.length===t)}function wr(e,t){return Cr(e,6)?e:t}function Tr(e,t){return Cr(e,4)?e:t}function Er(e,t){return Cr(e,4)?jn.normalizeRect(e):t}function Dr(e){let t=/(.+)\[(\d+)\]$/;return e.split(`.`).map(e=>{let n=e.match(t);return n?{name:n[1],pos:parseInt(n[2],10)}:{name:e,pos:0}})}function Or(e){let t=[],n=0;for(let r=0,i=e.length;r<i;r++){let i=e.charCodeAt(r);(i<33||i>126||i===35||i===40||i===41||i===60||i===62||i===91||i===93||i===123||i===125||i===47||i===37)&&(n<r&&t.push(e.substring(n,r)),t.push(`#${i.toString(16)}`),n=r+1)}return t.length===0?e:(n<e.length&&t.push(e.substring(n,e.length)),t.join(``))}function kr(e){return e.replaceAll(/([()\\\n\r])/g,e=>e===`
2
- `?`\\n`:e===`\r`?`\\r`:`\\${e}`)}function Ar(e,t,n,r){if(!e)return;let i=null;if(e instanceof R){if(r.has(e))return;i=e,r.put(i),e=t.fetch(e)}if(Array.isArray(e))for(let i of e)Ar(i,t,n,r);else if(e instanceof L){if(Zn(e.get(`S`),`JavaScript`)){let t=e.get(`JS`),r;t instanceof tr?r=t.getString():typeof t==`string`&&(r=t),r&&=Nn(r,!0).replaceAll(`\0`,``),r&&n.push(r.trim())}Ar(e.getRaw(`Next`),t,n,r)}i&&r.remove(i)}function jr(e,t,n){let r=Object.create(null),i=mr({dict:t,key:`AA`,stopWhenFound:!1});if(i)for(let t=i.length-1;t>=0;t--){let a=i[t];if(a instanceof L)for(let t of a.getKeys()){let i=n[t];if(!i)continue;let o=[];Ar(a.getRaw(t),e,o,new Yn),o.length>0&&(r[i]=o)}}if(t.has(`A`)){let n=[];Ar(t.get(`A`),e,n,new Yn),n.length>0&&(r.Action=n)}return On(r)>0?r:null}var Mr={60:`&lt;`,62:`&gt;`,38:`&amp;`,34:`&quot;`,39:`&apos;`};function*Nr(e){for(let t=0,n=e.length;t<n;t++){let n=e.codePointAt(t);n>55295&&(n<57344||n>65533)&&t++,yield n}}function Pr(e){let t=[],n=0;for(let r=0,i=e.length;r<i;r++){let i=e.codePointAt(r);if(32<=i&&i<=126){let a=Mr[i];a&&(n<r&&t.push(e.substring(n,r)),t.push(a),n=r+1)}else n<r&&t.push(e.substring(n,r)),t.push(`&#x${i.toString(16).toUpperCase()};`),i>55295&&(i<57344||i>65533)&&r++,n=r+1}return t.length===0?e:(n<e.length&&t.push(e.substring(n,e.length)),t.join(``))}function Fr(e,t=!1){let n=/^("|').*("|')$/.exec(e);if(n&&n[1]===n[2]){if(RegExp(`[^\\\\]${n[1]}`).test(e.slice(1,-1)))return t&&N(`FontFamily contains unescaped ${n[1]}: ${e}.`),!1}else for(let n of e.split(/[ \t]+/))if(/^(\d|(-(\d|-)))/.test(n)||!/^[\w-\\]+$/.test(n))return t&&N(`FontFamily contains invalid <custom-ident>: ${e}.`),!1;return!0}function Ir(e){let t=new Set([`100`,`200`,`300`,`400`,`500`,`600`,`700`,`800`,`900`,`1000`,`normal`,`bold`,`bolder`,`lighter`]),{fontFamily:n,fontWeight:r,italicAngle:i}=e;if(!Fr(n,!0))return!1;let a=r?r.toString():``;e.fontWeight=t.has(a)?a:`400`;let o=parseFloat(i);return e.italicAngle=isNaN(o)||o<-90||o>90?`14`:i.toString(),!0}function Lr(e){let t=RegExp(`^\\s*(`+[`app.launchURL`,`window.open`,`xfa.host.gotoURL`].join(`|`).replaceAll(`.`,`\\.`)+`)\\((?:'|")([^'"]*)(?:'|")(?:,\\s*(\\w+)\\)|\\))`,`i`).exec(e);return t?.[2]?{url:t[2],newWindow:t[1]===`app.launchURL`&&t[3]===`true`}:null}function Rr(e){if(Number.isInteger(e))return e.toString();let t=Math.round(100*e);return t%100==0?(t/100).toString():t%10==0?e.toFixed(1):e.toFixed(2)}function zr(e){if(!e)return null;let t=new Map;for(let[n,r]of e){if(!n.startsWith(m))continue;let e=t.get(r.pageIndex);e||(e=[],t.set(r.pageIndex,e)),e.push(r)}return t.size>0?t:null}function Br(e){return e==null||function(e){return typeof e==`string`?!e||/^[\x00-\x7F]*$/.test(e):!1}(e)?e:Hr(e,!0)}function Vr(e){let t=[];for(let n=0,r=e.length;n<r;n++){let r=e.charCodeAt(n);t.push(An[r>>8&255],An[255&r])}return t.join(``)}function Hr(e,t=!1){let n=[];t&&n.push(`þÿ`);for(let t=0,r=e.length;t<r;t++){let r=e.charCodeAt(t);n.push(String.fromCharCode(r>>8&255),String.fromCharCode(255&r))}return n.join(``)}function Ur(e,t,n){switch(e){case 90:return[0,1,-1,0,t,0];case 180:return[-1,0,0,-1,t,n];case 270:return[0,-1,1,0,0,n];default:throw Error(`Invalid rotation`)}}function Wr(e){return Math.ceil(Math.ceil(Math.log2(1+e))/8)}var Gr=class{static#e=null;static _memory=null;static _mustAddAlpha=!1;static _destBuffer=null;static _destOffset=0;static _destLength=0;static _cssColor=``;static _makeHexColor=null;static get _memoryArray(){let e=this.#e;return e?.byteLength?e:this.#e=new Uint8Array(this._memory.buffer)}},Kr,qr=typeof TextDecoder<`u`?new TextDecoder(`utf-8`,{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error(`TextDecoder not available`)}};typeof TextDecoder<`u`&&qr.decode();var Jr=null;function Yr(){return Jr!==null&&Jr.byteLength!==0||(Jr=new Uint8Array(Kr.memory.buffer)),Jr}var Xr=0;function Zr(e,t){let n=t(1*e.length,1)>>>0;return Yr().set(e,n/1),Xr=e.length,n}var Qr=Object.freeze({RGB8:0,0:`RGB8`,RGBA8:1,1:`RGBA8`,BGRA8:2,2:`BGRA8`,Gray8:3,3:`Gray8`,GrayA8:4,4:`GrayA8`,CMYK:5,5:`CMYK`}),$r=Object.freeze({Perceptual:0,0:`Perceptual`,RelativeColorimetric:1,1:`RelativeColorimetric`,Saturation:2,2:`Saturation`,AbsoluteColorimetric:3,3:`AbsoluteColorimetric`});function ei(){let e={wbg:{}};return e.wbg.__wbg_copyresult_b08ee7d273f295dd=function(e,t){(function(e,t){let{_mustAddAlpha:n,_destBuffer:r,_destOffset:i,_destLength:a,_memoryArray:o}=Gr;if(t!==a)if(n)for(let n=e,a=e+t,s=i;n<a;n+=3,s+=4)r[s]=o[n],r[s+1]=o[n+1],r[s+2]=o[n+2],r[s+3]=255;else for(let n=e,a=e+t,s=i;n<a;n+=3,s+=4)r[s]=o[n],r[s+1]=o[n+1],r[s+2]=o[n+2];else r.set(o.subarray(e,e+t),i)})(e>>>0,t>>>0)},e.wbg.__wbg_copyrgb_d60ce17bb05d9b67=function(e){(function(e){let{_destBuffer:t,_destOffset:n,_memoryArray:r}=Gr;t[n]=r[e],t[n+1]=r[e+1],t[n+2]=r[e+2]})(e>>>0)},e.wbg.__wbg_makecssRGB_893bf0cd9fdb302d=function(e){(function(e){let{_memoryArray:t}=Gr;Gr._cssColor=Gr._makeHexColor(t[e],t[e+1],t[e+2])})(e>>>0)},e.wbg.__wbindgen_init_externref_table=function(){let e=Kr.__wbindgen_export_0,t=e.grow(4);e.set(0,void 0),e.set(t+0,void 0),e.set(t+1,null),e.set(t+2,!0),e.set(t+3,!1)},e.wbg.__wbindgen_throw=function(e,t){throw Error((n=e,r=t,n>>>=0,qr.decode(Yr().subarray(n,n+r))));var n,r},e}function ti(e){if(Kr!==void 0)return Kr;e!==void 0&&(Object.getPrototypeOf(e)===Object.prototype?{module:e}=e:console.warn("using deprecated parameters for `initSync()`; pass a single object instead"));let t=ei();return e instanceof WebAssembly.Module||(e=new WebAssembly.Module(e)),function(e){return Kr=e.exports,Jr=null,Kr.__wbindgen_start(),Kr}(new WebAssembly.Instance(e,t))}var ni=class e{static#e=new Uint8ClampedArray(3);constructor(e,t){this.name=e,this.numComps=t}getRgb(e,t,n=new Uint8ClampedArray(3)){return this.getRgbItem(e,t,n,0),n}getRgbHex(t,n){let r=this.getRgb(t,n,e.#e);return jn.makeHexColor(r[0],r[1],r[2])}getRgbItem(e,t,n,r){gn(`Should not call ColorSpace.getRgbItem`)}getRgbBuffer(e,t,n,r,i,a,o){gn(`Should not call ColorSpace.getRgbBuffer`)}getOutputLength(e,t){gn(`Should not call ColorSpace.getOutputLength`)}isPassthrough(e){return!1}isDefaultDecode(t,n){return e.isDefaultDecode(t,this.numComps)}fillRgb(e,t,n,r,i,a,o,s,c){let l=t*n,u=null,d=1<<o,f=n!==i||t!==r;if(this.isPassthrough(o))u=s;else if(this.numComps===1&&l>d&&this.name!==`DeviceGray`&&this.name!==`DeviceRGB`){let t=o<=8?new Uint8Array(d):new Uint16Array(d);for(let e=0;e<d;e++)t[e]=e;let n=new Uint8ClampedArray(3*d);if(this.getRgbBuffer(t,0,d,n,0,o,0),f){u=new Uint8Array(3*l);let e=0;for(let t=0;t<l;++t){let r=3*s[t];u[e++]=n[r],u[e++]=n[r+1],u[e++]=n[r+2]}}else{let t=0;for(let r=0;r<l;++r){let i=3*s[r];e[t++]=n[i],e[t++]=n[i+1],e[t++]=n[i+2],t+=c}}}else f?(u=new Uint8ClampedArray(3*l),this.getRgbBuffer(s,0,l,u,0,o,0)):this.getRgbBuffer(s,0,r*a,e,0,o,c);if(u)if(f)(function(e,t,n,r,i,a,o){o=o===1?o:0;let s=n/i,c=r/a,l,u=0,d=new Uint16Array(i),f=3*n;for(let e=0;e<i;e++)d[e]=3*Math.floor(e*s);for(let n=0;n<a;n++){let r=Math.floor(n*c)*f;for(let n=0;n<i;n++)l=r+d[n],t[u++]=e[l++],t[u++]=e[l++],t[u++]=e[l++],u+=o}})(u,e,t,n,r,i,c);else{let t=0,n=0;for(let i=0,o=r*a;i<o;i++)e[t++]=u[n++],e[t++]=u[n++],e[t++]=u[n++],t+=c}}get usesZeroToOneRange(){return P(this,`usesZeroToOneRange`,!0)}static isDefaultDecode(e,t){if(!Array.isArray(e))return!0;if(2*t!==e.length)return N(`The decode map is not the correct length`),!0;for(let t=0,n=e.length;t<n;t+=2)if(e[t]!==0||e[t+1]!==1)return!1;return!0}},ri=class extends ni{constructor(e,t,n){super(`Alternate`,e),this.base=t,this.tintFn=n,this.tmpBuf=new Float32Array(t.numComps)}getRgbItem(e,t,n,r){let i=this.tmpBuf;this.tintFn(e,t,i,0),this.base.getRgbItem(i,0,n,r)}getRgbBuffer(e,t,n,r,i,a,o){let s=this.tintFn,c=this.base,l=1/((1<<a)-1),u=c.numComps,d=c.usesZeroToOneRange,f=(c.isPassthrough(8)||!d)&&o===0,p=f?i:0,m=f?r:new Uint8ClampedArray(u*n),h=this.numComps,g=new Float32Array(h),_=new Float32Array(u),v,y;for(v=0;v<n;v++){for(y=0;y<h;y++)g[y]=e[t++]*l;if(s(g,0,_,0),d)for(y=0;y<u;y++)m[p++]=255*_[y];else c.getRgbItem(_,0,m,p),p+=u}f||c.getRgbBuffer(m,0,n,r,i,8,o)}getOutputLength(e,t){return this.base.getOutputLength(e*this.base.numComps/this.numComps,t)}},ii=class extends ni{constructor(e){super(`Pattern`,null),this.base=e}isDefaultDecode(e,t){gn(`Should not call PatternCS.isDefaultDecode`)}},ai=class extends ni{constructor(e,t,n){super(`Indexed`,1),this.base=e,this.highVal=t;let r=e.numComps*(t+1);if(this.lookup=new Uint8Array(r),n instanceof tr){let e=n.getBytes(r);this.lookup.set(e)}else{if(typeof n!=`string`)throw new F(`IndexedCS - unrecognized lookup table: ${n}`);for(let e=0;e<r;++e)this.lookup[e]=255&n.charCodeAt(e)}}getRgbItem(e,t,n,r){let{base:i,highVal:a,lookup:o}=this,s=Bn(Math.round(e[t]),0,a)*i.numComps;i.getRgbBuffer(o,s,1,n,r,8,0)}getRgbBuffer(e,t,n,r,i,a,o){let{base:s,highVal:c,lookup:l}=this,{numComps:u}=s,d=s.getOutputLength(u,o);for(let a=0;a<n;++a){let n=Bn(Math.round(e[t++]),0,c)*u;s.getRgbBuffer(l,n,1,r,i,8,o),i+=d}}getOutputLength(e,t){return this.base.getOutputLength(e*this.base.numComps,t)}isDefaultDecode(e,t){return!Array.isArray(e)||(e.length===2?!Number.isInteger(t)||t<1?(N(`Bits per component is not correct`),!0):e[0]===0&&e[1]===(1<<t)-1:(N(`Decode map length is not correct`),!0))}},oi=class extends ni{constructor(){super(`DeviceGray`,1)}getRgbItem(e,t,n,r){let i=255*e[t];n[r]=n[r+1]=n[r+2]=i}getRgbBuffer(e,t,n,r,i,a,o){let s=255/((1<<a)-1),c=t,l=i;for(let t=0;t<n;++t){let t=s*e[c++];r[l++]=t,r[l++]=t,r[l++]=t,l+=o}}getOutputLength(e,t){return e*(3+t)}},si=class extends ni{constructor(){super(`DeviceRGB`,3)}getRgbItem(e,t,n,r){n[r]=255*e[t],n[r+1]=255*e[t+1],n[r+2]=255*e[t+2]}getRgbBuffer(e,t,n,r,i,a,o){if(a===8&&o===0)return void r.set(e.subarray(t,t+3*n),i);let s=255/((1<<a)-1),c=t,l=i;for(let t=0;t<n;++t)r[l++]=s*e[c++],r[l++]=s*e[c++],r[l++]=s*e[c++],l+=o}getOutputLength(e,t){return e*(3+t)/3|0}isPassthrough(e){return e===8}},ci=class extends ni{constructor(){super(`DeviceRGBA`,4)}getOutputLength(e,t){return 4*e}isPassthrough(e){return e===8}fillRgb(e,t,n,r,i,a,o,s,c){n!==i||t!==r?function(e,t,n,r,i,a,o){let s=n/i,c=r/a,l=0,u=new Uint16Array(i);if(o===1){for(let e=0;e<i;e++)u[e]=Math.floor(e*s);let r=new Uint32Array(e.buffer),o=new Uint32Array(t.buffer),d=kn.isLittleEndian?16777215:4294967040;for(let e=0;e<a;e++){let t=r.subarray(Math.floor(e*c)*n);for(let e=0;e<i;e++)o[l++]|=t[u[e]]&d}}else{let r=n*4;for(let e=0;e<i;e++)u[e]=Math.floor(e*s)*4;for(let n=0;n<a;n++){let a=e.subarray(Math.floor(n*c)*r);for(let e=0;e<i;e++){let n=u[e];t[l++]=a[n],t[l++]=a[n+1],t[l++]=a[n+2]}}}}(s,e,t,n,r,i,c):function(e,t,n){if(n===1){let n=new Uint32Array(e.buffer),r=new Uint32Array(t.buffer),i=kn.isLittleEndian?16777215:4294967040;for(let e=0,t=n.length;e<t;e++)r[e]|=n[e]&i}else{let n=0;for(let r=0,i=e.length;r<i;r+=4)t[n++]=e[r],t[n++]=e[r+1],t[n++]=e[r+2]}}(s,e,c)}},li=class extends ni{constructor(){super(`DeviceCMYK`,4)}#e(e,t,n,r,i){let a=e[t]*n,o=e[t+1]*n,s=e[t+2]*n,c=e[t+3]*n;r[i]=255+a*(-4.387332384609988*a+54.48615194189176*o+18.82290502165302*s+212.25662451639585*c-285.2331026137004)+o*(1.7149763477362134*o-5.6096736904047315*s+-17.873870861415444*c-5.497006427196366)+s*(-2.5217340131683033*s-21.248923337353073*c+17.5119270841813)+c*(-21.86122147463605*c-189.48180835922747),r[i+1]=255+a*(8.841041422036149*a+60.118027045597366*o+6.871425592049007*s+31.159100130055922*c-79.2970844816548)+o*(-15.310361306967817*o+17.575251261109482*s+131.35250912493976*c-190.9453302588951)+s*(4.444339102852739*s+9.8632861493405*c-24.86741582555878)+c*(-20.737325471181034*c-187.80453709719578),r[i+2]=255+a*(.8842522430003296*a+8.078677503112928*o+30.89978309703729*s-.23883238689178934*c-14.183576799673286)+o*(10.49593273432072*o+63.02378494754052*s+50.606957656360734*c-112.23884253719248)+s*(.03296041114873217*s+115.60384449646641*c-193.58209356861505)+c*(-22.33816807309886*c-180.12613974708367)}getRgbItem(e,t,n,r){this.#e(e,t,1,n,r)}getRgbBuffer(e,t,n,r,i,a,o){let s=1/((1<<a)-1);for(let a=0;a<n;a++)this.#e(e,t,s,r,i),t+=4,i+=3+o}getOutputLength(e,t){return e/4*(3+t)|0}},ui=class extends ni{constructor(e,t,n){if(super(`CalGray`,1),!e)throw new F(`WhitePoint missing - required for color space CalGray`);if([this.XW,this.YW,this.ZW]=e,[this.XB,this.YB,this.ZB]=t||[0,0,0],this.G=n||1,this.XW<0||this.ZW<0||this.YW!==1)throw new F(`Invalid WhitePoint components for ${this.name}, no fallback available`);(this.XB<0||this.YB<0||this.ZB<0)&&(hn(`Invalid BlackPoint for ${this.name}, falling back to default.`),this.XB=this.YB=this.ZB=0),this.XB===0&&this.YB===0&&this.ZB===0||N(`${this.name}, BlackPoint: XB: ${this.XB}, YB: ${this.YB}, ZB: ${this.ZB}, only default values are supported.`),this.G<1&&(hn(`Invalid Gamma: ${this.G} for ${this.name}, falling back to default.`),this.G=1)}#e(e,t,n,r,i){let a=(e[t]*i)**this.G,o=this.YW*a,s=Math.max(295.8*o**.3333333333333333-40.8,0);n[r]=s,n[r+1]=s,n[r+2]=s}getRgbItem(e,t,n,r){this.#e(e,t,n,r,1)}getRgbBuffer(e,t,n,r,i,a,o){let s=1/((1<<a)-1);for(let a=0;a<n;++a)this.#e(e,t,r,i,s),t+=1,i+=3+o}getOutputLength(e,t){return e*(3+t)}},di=class e extends ni{static#e=new Float32Array([.8951,.2664,-.1614,-.7502,1.7135,.0367,.0389,-.0685,1.0296]);static#t=new Float32Array([.9869929,-.1470543,.1599627,.4323053,.5183603,.0492912,-.0085287,.0400428,.9684867]);static#n=new Float32Array([3.2404542,-1.5371385,-.4985314,-.969266,1.8760108,.041556,.0556434,-.2040259,1.0572252]);static#r=new Float32Array([1,1,1]);static#i=new Float32Array(3);static#a=new Float32Array(3);static#o=new Float32Array(3);static#s=(24/116)**3/8;constructor(e,t,n,r){if(super(`CalRGB`,3),!e)throw new F(`WhitePoint missing - required for color space CalRGB`);let[i,a,o]=this.whitePoint=e,[s,c,l]=this.blackPoint=t||new Float32Array(3);if([this.GR,this.GG,this.GB]=n||new Float32Array([1,1,1]),[this.MXA,this.MYA,this.MZA,this.MXB,this.MYB,this.MZB,this.MXC,this.MYC,this.MZC]=r||new Float32Array([1,0,0,0,1,0,0,0,1]),i<0||o<0||a!==1)throw new F(`Invalid WhitePoint components for ${this.name}, no fallback available`);(s<0||c<0||l<0)&&(hn(`Invalid BlackPoint for ${this.name} [${s}, ${c}, ${l}], falling back to default.`),this.blackPoint=new Float32Array(3)),(this.GR<0||this.GG<0||this.GB<0)&&(hn(`Invalid Gamma [${this.GR}, ${this.GG}, ${this.GB}] for ${this.name}, falling back to default.`),this.GR=this.GG=this.GB=1)}#c(e,t,n){n[0]=e[0]*t[0]+e[1]*t[1]+e[2]*t[2],n[1]=e[3]*t[0]+e[4]*t[1]+e[5]*t[2],n[2]=e[6]*t[0]+e[7]*t[1]+e[8]*t[2]}#l(e,t,n){n[0]=1*t[0]/e[0],n[1]=1*t[1]/e[1],n[2]=1*t[2]/e[2]}#u(e,t,n){n[0]=.95047*t[0]/e[0],n[1]=1*t[1]/e[1],n[2]=1.08883*t[2]/e[2]}#d(e){return e<=.0031308?Bn(12.92*e,0,1):e>=.99554525?1:Bn(1.055*e**(1/2.4)-.055,0,1)}#f(t){return t<0?-this.#f(-t):t>8?((t+16)/116)**3:t*e.#s}#p(e,t,n){if(e[0]===0&&e[1]===0&&e[2]===0)return n[0]=t[0],n[1]=t[1],void(n[2]=t[2]);let r=this.#f(0),i=(1-r)/(1-this.#f(e[0])),a=1-i,o=(1-r)/(1-this.#f(e[1])),s=1-o,c=(1-r)/(1-this.#f(e[2])),l=1-c;n[0]=t[0]*i+a,n[1]=t[1]*o+s,n[2]=t[2]*c+l}#m(t,n,r){if(t[0]===1&&t[2]===1)return r[0]=n[0],r[1]=n[1],void(r[2]=n[2]);let i=r;this.#c(e.#e,n,i);let a=e.#i;this.#l(t,i,a),this.#c(e.#t,a,r)}#h(t,n,r){let i=r;this.#c(e.#e,n,i);let a=e.#i;this.#u(t,i,a),this.#c(e.#t,a,r)}#g(t,n,r,i,a){let o=Bn(t[n]*a,0,1),s=Bn(t[n+1]*a,0,1),c=Bn(t[n+2]*a,0,1),l=o===1?1:o**this.GR,u=s===1?1:s**this.GG,d=c===1?1:c**this.GB,f=this.MXA*l+this.MXB*u+this.MXC*d,p=this.MYA*l+this.MYB*u+this.MYC*d,m=this.MZA*l+this.MZB*u+this.MZC*d,h=e.#a;h[0]=f,h[1]=p,h[2]=m;let g=e.#o;this.#m(this.whitePoint,h,g);let _=e.#a;this.#p(this.blackPoint,g,_);let v=e.#o;this.#h(e.#r,_,v);let y=e.#a;this.#c(e.#n,v,y),r[i]=255*this.#d(y[0]),r[i+1]=255*this.#d(y[1]),r[i+2]=255*this.#d(y[2])}getRgbItem(e,t,n,r){this.#g(e,t,n,r,1)}getRgbBuffer(e,t,n,r,i,a,o){let s=1/((1<<a)-1);for(let a=0;a<n;++a)this.#g(e,t,r,i,s),t+=3,i+=3+o}getOutputLength(e,t){return e*(3+t)/3|0}},fi=class extends ni{constructor(e,t,n){if(super(`Lab`,3),!e)throw new F(`WhitePoint missing - required for color space Lab`);if([this.XW,this.YW,this.ZW]=e,[this.amin,this.amax,this.bmin,this.bmax]=n||[-100,100,-100,100],[this.XB,this.YB,this.ZB]=t||[0,0,0],this.XW<0||this.ZW<0||this.YW!==1)throw new F(`Invalid WhitePoint components, no fallback available`);(this.XB<0||this.YB<0||this.ZB<0)&&(hn(`Invalid BlackPoint, falling back to default`),this.XB=this.YB=this.ZB=0),(this.amin>this.amax||this.bmin>this.bmax)&&(hn(`Invalid Range, falling back to defaults`),this.amin=-100,this.amax=100,this.bmin=-100,this.bmax=100)}#e(e){return e>=6/29?e**3:108/841*(e-4/29)}#t(e,t,n,r){return n+e*(r-n)/t}#n(e,t,n,r,i){let a=e[t],o=e[t+1],s=e[t+2];!1!==n&&(a=this.#t(a,n,0,100),o=this.#t(o,n,this.amin,this.amax),s=this.#t(s,n,this.bmin,this.bmax)),o>this.amax?o=this.amax:o<this.amin&&(o=this.amin),s>this.bmax?s=this.bmax:s<this.bmin&&(s=this.bmin);let c=(a+16)/116,l=c+o/500,u=c-s/200,d=this.XW*this.#e(l),f=this.YW*this.#e(c),p=this.ZW*this.#e(u),m,h,g;this.ZW<1?(m=3.1339*d+-1.617*f+-.4906*p,h=-.9785*d+1.916*f+.0333*p,g=.072*d+-.229*f+1.4057*p):(m=3.2406*d+-1.5372*f+-.4986*p,h=-.9689*d+1.8758*f+.0415*p,g=.0557*d+-.204*f+1.057*p),r[i]=255*Math.sqrt(m),r[i+1]=255*Math.sqrt(h),r[i+2]=255*Math.sqrt(g)}getRgbItem(e,t,n,r){this.#n(e,t,!1,n,r)}getRgbBuffer(e,t,n,r,i,a,o){let s=(1<<a)-1;for(let a=0;a<n;a++)this.#n(e,t,s,r,i),t+=3,i+=3+o}getOutputLength(e,t){return e*(3+t)/3|0}isDefaultDecode(e,t){return!0}get usesZeroToOneRange(){return P(this,`usesZeroToOneRange`,!1)}};function pi(e){let t=new XMLHttpRequest;return t.open(`GET`,e,!1),t.responseType=`arraybuffer`,t.send(null),t.response}var mi=class e extends ni{#e;#t;static#n=!0;static#r=null;static#i=null;constructor(t,n,r){if(!e.isUsable)throw Error(`No ICC color space support`);let i;switch(super(n,r),r){case 1:i=Qr.Gray8,this.#t=(e,t,n)=>function(e,t,n){Kr.qcms_convert_one(e,t,n)}(this.#e,255*e[t],n);break;case 3:i=Qr.RGB8,this.#t=(e,t,n)=>function(e,t,n,r,i){Kr.qcms_convert_three(e,t,n,r,i)}(this.#e,255*e[t],255*e[t+1],255*e[t+2],n);break;case 4:i=Qr.CMYK,this.#t=(e,t,n)=>function(e,t,n,r,i,a){Kr.qcms_convert_four(e,t,n,r,i,a)}(this.#e,255*e[t],255*e[t+1],255*e[t+2],255*e[t+3],n);break;default:throw Error(`Unsupported number of components: ${r}`)}if(this.#e=function(e,t,n){let r=Zr(e,Kr.__wbindgen_malloc),i=Xr;return Kr.qcms_transformer_from_memory(r,i,t,n)>>>0}(t,i,$r.Perceptual),!this.#e)throw Error(`Failed to create ICC color space`);e.#i||=new FinalizationRegistry(e=>{(function(e){Kr.qcms_drop_transformer(e)})(e)}),e.#i.register(this,this.#e)}getRgbHex(e,t){return this.#t(e,t,!0),Gr._cssColor}getRgbItem(e,t,n,r){Gr._destBuffer=n,Gr._destOffset=r,Gr._destLength=3,this.#t(e,t,!1),Gr._destBuffer=null}getRgbBuffer(e,t,n,r,i,a,o){if(e=e.subarray(t,t+n*this.numComps),a!==8){let t=255/((1<<a)-1);for(let n=0,r=e.length;n<r;n++)e[n]*=t}Gr._mustAddAlpha=o&&r.buffer===e.buffer,Gr._destBuffer=r,Gr._destOffset=i,Gr._destLength=n*(3+o),function(e,t){let n=Zr(t,Kr.__wbindgen_malloc),r=Xr;Kr.qcms_convert_array(e,n,r)}(this.#e,e),Gr._mustAddAlpha=!1,Gr._destBuffer=null}getOutputLength(e,t){return e/this.numComps*(3+t)|0}static setOptions({useWasm:e,useWorkerFetch:t,wasmUrl:n}){t?(this.#n=e,this.#r=n):this.#n=!1}static get isUsable(){let e=!1;if(this.#n)if(this.#r)try{this._module=ti({module:pi(`${this.#r}qcms_bg.wasm`)}),e=!!this._module,Gr._memory=this._module.memory,Gr._makeHexColor=jn.makeHexColor}catch(e){N(`ICCBased color space: "${e}".`)}else N("No ICC color space support due to missing `wasmUrl` API option");return P(this,`isUsable`,e)}},hi=class e extends mi{static#e;constructor(){super(new Uint8Array(pi(`${e.#e}CGATS001Compat-v2-micro.icc`)),`DeviceCMYK`,4)}static setOptions({iccUrl:e}){this.#e=e}static get isUsable(){let e=!1;return mi.isUsable&&(this.#e?e=!0:N("No CMYK ICC profile support due to missing `iccUrl` API option")),P(this,`isUsable`,e)}},gi=class e extends tr{constructor(e,t,n,r){super(),this.bytes=e instanceof Uint8Array?e:new Uint8Array(e),this.start=t||0,this.pos=this.start,this.end=t+n||this.bytes.length,this.dict=r}get length(){return this.end-this.start}get isEmpty(){return this.length===0}getByte(){return this.pos>=this.end?-1:this.bytes[this.pos++]}getBytes(e){let t=this.bytes,n=this.pos,r=this.end;if(!e)return t.subarray(n,r);let i=n+e;return i>r&&(i=r),this.pos=i,t.subarray(n,i)}getByteRange(e,t){return e<0&&(e=0),t>this.end&&(t=this.end),this.bytes.subarray(e,t)}reset(){this.pos=this.start}moveStart(){this.start=this.pos}makeSubStream(t,n,r=null){return new e(this.bytes.buffer,t,n,r)}},_i=class extends gi{constructor(e){super(En(e))}},vi=class extends gi{constructor(){super(new Uint8Array)}},yi=class extends gi{constructor(e,t,n){super(new Uint8Array(e),0,e,null),this.chunkSize=t,this._loadedChunks=new Set,this.numChunks=Math.ceil(e/t),this.manager=n,this.progressiveDataLength=0,this.lastSuccessfulEnsureByteChunk=-1}getMissingChunks(){let e=[];for(let t=0,n=this.numChunks;t<n;++t)this._loadedChunks.has(t)||e.push(t);return e}get numChunksLoaded(){return this._loadedChunks.size}get isDataLoaded(){return this.numChunksLoaded===this.numChunks}onReceiveData(e,t){let n=this.chunkSize;if(e%n!==0)throw Error(`Bad begin offset: ${e}`);let r=e+t.byteLength;if(r%n!==0&&r!==this.bytes.length)throw Error(`Bad end offset: ${r}`);this.bytes.set(new Uint8Array(t),e);let i=Math.floor(e/n),a=Math.floor((r-1)/n)+1;for(let e=i;e<a;++e)this._loadedChunks.add(e)}onReceiveProgressiveData(e){let t=this.progressiveDataLength,n=Math.floor(t/this.chunkSize);this.bytes.set(new Uint8Array(e),t),t+=e.byteLength,this.progressiveDataLength=t;let r=t>=this.end?this.numChunks:Math.floor(t/this.chunkSize);for(let e=n;e<r;++e)this._loadedChunks.add(e)}ensureByte(e){if(e<this.progressiveDataLength)return;let t=Math.floor(e/this.chunkSize);if(!(t>this.numChunks)&&t!==this.lastSuccessfulEnsureByteChunk){if(!this._loadedChunks.has(t))throw new cr(e,e+1);this.lastSuccessfulEnsureByteChunk=t}}ensureRange(e,t){if(e>=t||t<=this.progressiveDataLength)return;let n=Math.floor(e/this.chunkSize);if(n>this.numChunks)return;let r=Math.min(Math.floor((t-1)/this.chunkSize)+1,this.numChunks);for(let i=n;i<r;++i)if(!this._loadedChunks.has(i))throw new cr(e,t)}nextEmptyChunk(e){let t=this.numChunks;for(let n=0;n<t;++n){let r=(e+n)%t;if(!this._loadedChunks.has(r))return r}return null}hasChunk(e){return this._loadedChunks.has(e)}getByte(){let e=this.pos;return e>=this.end?-1:(e>=this.progressiveDataLength&&this.ensureByte(e),this.bytes[this.pos++])}getBytes(e){let t=this.bytes,n=this.pos,r=this.end;if(!e)return r>this.progressiveDataLength&&this.ensureRange(n,r),t.subarray(n,r);let i=n+e;return i>r&&(i=r),i>this.progressiveDataLength&&this.ensureRange(n,i),this.pos=i,t.subarray(n,i)}getByteRange(e,t){return e<0&&(e=0),t>this.end&&(t=this.end),t>this.progressiveDataLength&&this.ensureRange(e,t),this.bytes.subarray(e,t)}makeSubStream(e,t,n=null){function r(){}t?e+t>this.progressiveDataLength&&this.ensureRange(e,e+t):e>=this.progressiveDataLength&&this.ensureByte(e),r.prototype=Object.create(this),r.prototype.getMissingChunks=function(){let e=this.chunkSize,t=Math.floor(this.start/e),n=Math.floor((this.end-1)/e)+1,r=[];for(let e=t;e<n;++e)this._loadedChunks.has(e)||r.push(e);return r},Object.defineProperty(r.prototype,`isDataLoaded`,{get(){return this.numChunksLoaded===this.numChunks||this.getMissingChunks().length===0},configurable:!0});let i=new r;return i.pos=i.start=e,i.end=e+t||this.end,i.dict=n,i}getBaseStreams(){return[this]}},bi=class{constructor(e,t){this.length=t.length,this.chunkSize=t.rangeChunkSize,this.stream=new yi(this.length,this.chunkSize,this),this.pdfNetworkStream=e,this.disableAutoFetch=t.disableAutoFetch,this.msgHandler=t.msgHandler,this.currRequestId=0,this._chunksNeededByRequest=new Map,this._requestsByChunk=new Map,this._promisesByRequest=new Map,this.progressiveDataLength=0,this.aborted=!1,this._loadedStreamCapability=Promise.withResolvers()}sendRequest(e,t){let n=this.pdfNetworkStream.getRangeReader(e,t);n.isStreamingSupported||(n.onProgress=this.onProgress.bind(this));let r=[],i=0;return new Promise((e,t)=>{let a=({value:o,done:s})=>{try{if(s){let t=fr(r);r=null,e(t);return}i+=o.byteLength,n.isStreamingSupported&&this.onProgress({loaded:i}),r.push(o),n.read().then(a,t)}catch(e){t(e)}};n.read().then(a,t)}).then(t=>{this.aborted||this.onReceiveData({chunk:t,begin:e})})}requestAllChunks(e=!1){if(!e){let e=this.stream.getMissingChunks();this._requestChunks(e)}return this._loadedStreamCapability.promise}_requestChunks(e){let t=this.currRequestId++,n=new Set;this._chunksNeededByRequest.set(t,n);for(let t of e)this.stream.hasChunk(t)||n.add(t);if(n.size===0)return Promise.resolve();let r=Promise.withResolvers();this._promisesByRequest.set(t,r);let i=[];for(let e of n){let n=this._requestsByChunk.get(e);n||(n=[],this._requestsByChunk.set(e,n),i.push(e)),n.push(t)}if(i.length>0){let e=this.groupChunks(i);for(let t of e){let e=t.beginChunk*this.chunkSize,n=Math.min(t.endChunk*this.chunkSize,this.length);this.sendRequest(e,n).catch(r.reject)}}return r.promise.catch(e=>{if(!this.aborted)throw e})}getStream(){return this.stream}requestRange(e,t){t=Math.min(t,this.length);let n=this.getBeginChunk(e),r=this.getEndChunk(t),i=[];for(let e=n;e<r;++e)i.push(e);return this._requestChunks(i)}requestRanges(e=[]){let t=[];for(let n of e){let e=this.getBeginChunk(n.begin),r=this.getEndChunk(n.end);for(let n=e;n<r;++n)t.includes(n)||t.push(n)}return t.sort((e,t)=>e-t),this._requestChunks(t)}groupChunks(e){let t=[],n=-1,r=-1;for(let i=0,a=e.length;i<a;++i){let a=e[i];n<0&&(n=a),r>=0&&r+1!==a&&(t.push({beginChunk:n,endChunk:r+1}),n=a),i+1===e.length&&t.push({beginChunk:n,endChunk:a+1}),r=a}return t}onProgress(e){this.msgHandler.send(`DocProgress`,{loaded:this.stream.numChunksLoaded*this.chunkSize+e.loaded,total:this.length})}onReceiveData(e){let t=e.chunk,n=e.begin===void 0,r=n?this.progressiveDataLength:e.begin,i=r+t.byteLength,a=Math.floor(r/this.chunkSize),o=i<this.length?Math.floor(i/this.chunkSize):Math.ceil(i/this.chunkSize);n?(this.stream.onReceiveProgressiveData(t),this.progressiveDataLength=i):this.stream.onReceiveData(r,t),this.stream.isDataLoaded&&this._loadedStreamCapability.resolve(this.stream);let s=[];for(let e=a;e<o;++e){let t=this._requestsByChunk.get(e);if(t){this._requestsByChunk.delete(e);for(let n of t){let t=this._chunksNeededByRequest.get(n);t.has(e)&&t.delete(e),t.size>0||s.push(n)}}}if(!this.disableAutoFetch&&this._requestsByChunk.size===0){let e;if(this.stream.numChunksLoaded===1){let t=this.stream.numChunks-1;this.stream.hasChunk(t)||(e=t)}else e=this.stream.nextEmptyChunk(o);Number.isInteger(e)&&this._requestChunks([e])}for(let e of s){let t=this._promisesByRequest.get(e);this._promisesByRequest.delete(e),t.resolve()}this.msgHandler.send(`DocProgress`,{loaded:this.stream.numChunksLoaded*this.chunkSize,total:this.length})}onError(e){this._loadedStreamCapability.reject(e)}getBeginChunk(e){return Math.floor(e/this.chunkSize)}getEndChunk(e){return Math.floor((e-1)/this.chunkSize)+1}abort(e){this.aborted=!0,this.pdfNetworkStream?.cancelAllRequests(e);for(let t of this._promisesByRequest.values())t.reject(e)}};function xi(e){switch(e.kind){case C:return Si(e);case w:return function({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);if(kn.isLittleEndian){for(;o<c-2;o+=3,r+=4){let e=l[o],t=l[o+1],i=l[o+2];n[r]=4278190080|e,n[r+1]=e>>>24|t<<8|4278190080,n[r+2]=t>>>16|i<<16|4278190080,n[r+3]=i>>>8|4278190080}for(let i=4*o,a=t+s;i<a;i+=3)n[r++]=e[i]|e[i+1]<<8|e[i+2]<<16|4278190080}else{for(;o<c-2;o+=3,r+=4){let e=l[o],t=l[o+1],i=l[o+2];n[r]=255|e,n[r+1]=e<<24|t>>>8|255,n[r+2]=t<<16|i>>>16|255,n[r+3]=i<<8|255}for(let i=4*o,a=t+s;i<a;i+=3)n[r++]=e[i]<<24|e[i+1]<<16|e[i+2]<<8|255}return{srcPos:t+s,destPos:r}}(e)}return null}function Si({src:e,srcPos:t=0,dest:n,width:r,height:i,nonBlackColor:a=4294967295,inverseDecode:o=!1}){let s=kn.isLittleEndian?4278190080:255,[c,l]=o?[a,s]:[s,a],u=r>>3,d=7&r,f=e.length;n=new Uint32Array(n.buffer);let p=0;for(let r=0;r<i;r++){for(let r=t+u;t<r;t++){let r=t<f?e[t]:255;n[p++]=128&r?l:c,n[p++]=64&r?l:c,n[p++]=32&r?l:c,n[p++]=16&r?l:c,n[p++]=8&r?l:c,n[p++]=4&r?l:c,n[p++]=2&r?l:c,n[p++]=1&r?l:c}if(d===0)continue;let r=t<f?e[t++]:255;for(let e=0;e<d;e++)n[p++]=r&1<<7-e?l:c}return{srcPos:t,destPos:p}}var Ci=class e{static#e=2048;static#t=kn.isImageDecoderSupported;constructor(e,t){this._imgData=e,this._isMask=t}static get canUseImageDecoder(){return P(this,`canUseImageDecoder`,this.#t?ImageDecoder.isTypeSupported(`image/bmp`):Promise.resolve(!1))}static needsToBeResized(e,t){if(e<=this.#e&&t<=this.#e)return!1;let{MAX_DIM:n}=this;if(e>n||t>n)return!0;let r=e*t;return this._hasMaxArea?r>this.MAX_AREA:r<this.#e**2?!1:this._areGoodDims(e,t)?(this.#e=Math.max(this.#e,Math.floor(Math.sqrt(e*t))),!1):(this.#e=this._guessMax(this.#e,n,128,0),r>(this.MAX_AREA=this.#e**2))}static getReducePowerForJPX(e,t,n){let r=e*t,i=2**30/(4*n);if(!this.needsToBeResized(e,t))return r>i?Math.ceil(Math.log2(r/i)):0;let{MAX_DIM:a,MAX_AREA:o}=this,s=Math.max(e/a,t/a,Math.sqrt(r/Math.min(i,o)));return Math.ceil(Math.log2(s))}static get MAX_DIM(){return P(this,`MAX_DIM`,this._guessMax(2048,65537,0,1))}static get MAX_AREA(){return this._hasMaxArea=!0,P(this,`MAX_AREA`,this._guessMax(this.#e,this.MAX_DIM,128,0)**2)}static set MAX_AREA(e){e>=0&&(this._hasMaxArea=!0,P(this,`MAX_AREA`,e))}static setOptions({canvasMaxAreaInBytes:e=-1,isImageDecoderSupported:t=!1}){this._hasMaxArea||(this.MAX_AREA=e>>2),this.#t=t}static _areGoodDims(e,t){try{let n=new OffscreenCanvas(e,t),r=n.getContext(`2d`);r.fillRect(0,0,1,1);let i=r.getImageData(0,0,1,1).data[3];return n.width=n.height=1,i!==0}catch{return!1}}static _guessMax(e,t,n,r){for(;e+n+1<t;){let n=Math.floor((e+t)/2),i=r||n;this._areGoodDims(n,i)?e=n:t=n}return e}static async createImage(t,n=!1){return new e(t,n)._createImage()}async _createImage(){let{_imgData:t}=this,{width:n,height:r}=t;if(n*r*4>rr){let e=this.#n();if(e)return e}let i=this._encodeBMP(),a,o;await e.canUseImageDecoder?(a=new ImageDecoder({data:i,type:`image/bmp`,preferAnimation:!1,transfer:[i.buffer]}),o=a.decode().catch(e=>(N(`BMP image decoding failed: ${e}`),createImageBitmap(new Blob([this._encodeBMP().buffer],{type:`image/bmp`})))).finally(()=>{a.close()})):o=createImageBitmap(new Blob([i.buffer],{type:`image/bmp`}));let{MAX_AREA:s,MAX_DIM:c}=e,l=Math.max(n/c,r/c,Math.sqrt(n*r/s)),u=Math.max(l,2),d=Math.round(10*(l+1.25))/10/u,f=Math.floor(Math.log2(d)),p=Array(f+2).fill(2);p[0]=u,p.splice(-1,1,d/(1<<f));let m=n,h=r,g=await o,_=g.image||g;for(let e of p){let t=m,n=h;m=Math.floor(m/e)-1,h=Math.floor(h/e)-1;let r=new OffscreenCanvas(m,h);r.getContext(`2d`).drawImage(_,0,0,t,n,0,0,m,h),_.close(),_=r.transferToImageBitmap()}return t.data=null,t.bitmap=_,t.width=m,t.height=h,t}#n(){let{_imgData:t}=this,{data:n,width:r,height:i,kind:a}=t,o=r*i*4,s=Math.ceil(Math.log2(o/rr)),c=r>>s,l=i>>s,u,d=i;try{u=new Uint8Array(o)}catch{let e=Math.floor(Math.log2(o+1));for(;;)try{u=new Uint8Array(2**e-1);break}catch{--e}d=Math.floor((2**e-1)/(4*r));let t=r*d*4;t<u.length&&(u=new Uint8Array(t))}let f=new Uint32Array(u.buffer),p=new Uint32Array(c*l),m=0,h=0,g=Math.ceil(i/d),_=i%d===0?i:i%d;for(let e=0;e<g;e++){let t=e<g-1?d:_;({srcPos:m}=xi({kind:a,src:n,dest:f,width:r,height:t,inverseDecode:this._isMask,srcPos:m}));for(let e=0,n=t>>s;e<n;e++){let t=f.subarray((e<<s)*r);for(let e=0;e<c;e++)p[h++]=t[e<<s]}}if(e.needsToBeResized(c,l))return t.data=p,t.width=c,t.height=l,t.kind=T,null;let v=new OffscreenCanvas(c,l);return v.getContext(`2d`,{willReadFrequently:!0}).putImageData(new ImageData(new Uint8ClampedArray(p.buffer),c,l),0,0),t.data=null,t.bitmap=v.transferToImageBitmap(),t.width=c,t.height=l,t}_encodeBMP(){let{width:e,height:t,kind:n}=this._imgData,r,i=this._imgData.data,a=new Uint8Array,o=a,s=0;switch(n){case C:{r=1,a=new Uint8Array(this._isMask?[255,255,255,255,0,0,0,0]:[0,0,0,0,255,255,255,255]);let n=e+7>>3,o=n+3&-4;if(n!==o){let e=new Uint8Array(o*t),r=0;for(let a=0,s=t*n;a<s;a+=n,r+=o)e.set(i.subarray(a,a+n),r);i=e}break}case w:if(r=24,3&e){let n=3*e,r=n+3&-4,a=r-n,o=new Uint8Array(r*t),s=0;for(let e=0,r=t*n;e<r;e+=n){let t=i.subarray(e,e+n);for(let e=0;e<n;e+=3)o[s++]=t[e+2],o[s++]=t[e+1],o[s++]=t[e];s+=a}i=o}else for(let e=0,t=i.length;e<t;e+=3){let t=i[e];i[e]=i[e+2],i[e+2]=t}break;case T:r=32,s=3,o=new Uint8Array(68);let n=new DataView(o.buffer);kn.isLittleEndian?(n.setUint32(0,255,!0),n.setUint32(4,65280,!0),n.setUint32(8,16711680,!0),n.setUint32(12,4278190080,!0)):(n.setUint32(0,4278190080,!0),n.setUint32(4,16711680,!0),n.setUint32(8,65280,!0),n.setUint32(12,255,!0));break;default:throw Error(`invalid format`)}let c=0,l=40+o.length,u=14+l+a.length+i.length,d=new Uint8Array(u),f=new DataView(d.buffer);return f.setUint16(c,19778,!0),c+=2,f.setUint32(c,u,!0),c+=4,f.setUint32(c,0,!0),c+=4,f.setUint32(c,14+l+a.length,!0),c+=4,f.setUint32(c,l,!0),c+=4,f.setInt32(c,e,!0),c+=4,f.setInt32(c,-t,!0),c+=4,f.setUint16(c,1,!0),c+=2,f.setUint16(c,r,!0),c+=2,f.setUint32(c,s,!0),c+=4,f.setUint32(c,0,!0),c+=4,f.setInt32(c,0,!0),c+=4,f.setInt32(c,0,!0),c+=4,f.setUint32(c,a.length/4,!0),c+=4,f.setUint32(c,0,!0),c+=4,d.set(o,c),c+=o.length,d.set(a,c),c+=a.length,d.set(i,c),d}},wi=new Uint8Array,Ti=class extends tr{constructor(e){if(super(),this._rawMinBufferLength=e||0,this.pos=0,this.bufferLength=0,this.eof=!1,this.buffer=wi,this.minBufferLength=512,e)for(;this.minBufferLength<e;)this.minBufferLength*=2}get isEmpty(){for(;!this.eof&&this.bufferLength===0;)this.readBlock();return this.bufferLength===0}ensureBuffer(e){let t=this.buffer;if(e<=t.byteLength)return t;let n=this.minBufferLength;for(;n<e;)n*=2;let r=new Uint8Array(n);return r.set(t),this.buffer=r}getByte(){let e=this.pos;for(;this.bufferLength<=e;){if(this.eof)return-1;this.readBlock()}return this.buffer[this.pos++]}getBytes(e,t=null){let n=this.pos,r;if(e){for(this.ensureBuffer(n+e),r=n+e;!this.eof&&this.bufferLength<r;)this.readBlock(t);let i=this.bufferLength;r>i&&(r=i)}else{for(;!this.eof;)this.readBlock(t);r=this.bufferLength}return this.pos=r,this.buffer.subarray(n,r)}async getImageData(e,t){if(!this.canAsyncDecodeImageFromBuffer)return this.isAsyncDecoder?this.decodeImage(null,t):this.getBytes(e,t);let n=await this.stream.asyncGetBytes();return this.decodeImage(n,t)}reset(){this.pos=0}makeSubStream(e,t,n=null){if(t===void 0)for(;!this.eof;)this.readBlock();else{let n=e+t;for(;this.bufferLength<=n&&!this.eof;)this.readBlock()}return new gi(this.buffer,e,t,n)}getBaseStreams(){return this.str?this.str.getBaseStreams():null}},Ei=class extends Ti{constructor(e,t=null){e=e.filter(e=>e instanceof tr);let n=0;for(let t of e)n+=t instanceof Ti?t._rawMinBufferLength:t.length;super(n),this.streams=e,this._onError=t}readBlock(){let e=this.streams;if(e.length===0)return void(this.eof=!0);let t=e.shift(),n;try{n=t.getBytes()}catch(e){if(this._onError)return void this._onError(e,t.dict?.objId);throw e}let r=this.bufferLength,i=r+n.length;this.ensureBuffer(i).set(n,r),this.bufferLength=i}getBaseStreams(){let e=[];for(let t of this.streams){let n=t.getBaseStreams();n&&e.push(...n)}return e.length>0?e:null}},Di=class{static parse({cs:e,xref:t,resources:n=null,pdfFunctionFactory:r,globalColorSpaceCache:i,localColorSpaceCache:a,asyncIfNotCached:o=!1}){let s={xref:t,resources:n,pdfFunctionFactory:r,globalColorSpaceCache:i,localColorSpaceCache:a},c,l,u;if(e instanceof R){l=e;let n=i.getByRef(l)||a.getByRef(l);if(n)return n;e=t.fetch(e)}if(e instanceof I){c=e.name;let t=a.getByName(c);if(t)return t}try{u=this.#t(e,s)}catch(e){if(o&&!(e instanceof cr))return Promise.reject(e);throw e}return(c||l)&&(a.set(c,l,u),l&&i.set(null,l,u)),o?Promise.resolve(u):u}static#e(e,t){let{globalColorSpaceCache:n}=t,r;if(e instanceof R){r=e;let t=n.getByRef(r);if(t)return t}let i=this.#t(e,t);return r&&n.set(null,r,i),i}static#t(e,t){let{xref:n,resources:r,pdfFunctionFactory:i,globalColorSpaceCache:a}=t;if((e=n.fetchIfRef(e))instanceof I)switch(e.name){case`G`:case`DeviceGray`:return this.gray;case`RGB`:case`DeviceRGB`:return this.rgb;case`DeviceRGBA`:return this.rgba;case`CMYK`:case`DeviceCMYK`:return this.cmyk;case`Pattern`:return new ii(null);default:if(r instanceof L){let n=r.get(`ColorSpace`);if(n instanceof L){let r=n.get(e.name);if(r){if(r instanceof I)return this.#t(r,t);e=r;break}}}return N(`Unrecognized ColorSpace: ${e.name}`),this.gray}if(Array.isArray(e)){let r=n.fetchIfRef(e[0]).name,o,s,c,l,u,d;switch(r){case`G`:case`DeviceGray`:return this.gray;case`RGB`:case`DeviceRGB`:return this.rgb;case`CMYK`:case`DeviceCMYK`:return this.cmyk;case`CalGray`:return o=n.fetchIfRef(e[1]),l=o.getArray(`WhitePoint`),u=o.getArray(`BlackPoint`),d=o.get(`Gamma`),new ui(l,u,d);case`CalRGB`:o=n.fetchIfRef(e[1]),l=o.getArray(`WhitePoint`),u=o.getArray(`BlackPoint`),d=o.getArray(`Gamma`);let f=o.getArray(`Matrix`);return new di(l,u,d,f);case`ICCBased`:let p=e[1]instanceof R;if(p){let t=a.getByRef(e[1]);if(t)return t}let m=n.fetchIfRef(e[1]),h=m.dict;if(s=h.get(`N`),mi.isUsable)try{let t=new mi(m.getBytes(),`ICCBased`,s);return p&&a.set(null,e[1],t),t}catch(t){if(t instanceof cr)throw t;N(`ICCBased color space (${e[1]}): "${t}".`)}let g=h.getRaw(`Alternate`);if(g){let e=this.#e(g,t);if(e.numComps===s)return e;N(`ICCBased color space: Ignoring incorrect /Alternate entry.`)}if(s===1)return this.gray;if(s===3)return this.rgb;if(s===4)return this.cmyk;break;case`Pattern`:return c=e[1]||null,c&&=this.#e(c,t),new ii(c);case`I`:case`Indexed`:c=this.#e(e[1],t);let _=Bn(n.fetchIfRef(e[2]),0,255),v=n.fetchIfRef(e[3]);return new ai(c,_,v);case`Separation`:case`DeviceN`:let y=n.fetchIfRef(e[1]);s=Array.isArray(y)?y.length:1,c=this.#e(e[2],t);let b=i.create(e[3]);return new ri(s,c,b);case`Lab`:o=n.fetchIfRef(e[1]),l=o.getArray(`WhitePoint`),u=o.getArray(`BlackPoint`);let x=o.getArray(`Range`);return new fi(l,u,x);default:return N(`Unimplemented ColorSpace object: ${r}`),this.gray}}return N(`Unrecognized ColorSpace object: ${e}`),this.gray}static get gray(){return P(this,`gray`,new oi)}static get rgb(){return P(this,`rgb`,new si)}static get rgba(){return P(this,`rgba`,new ci)}static get cmyk(){if(hi.isUsable)try{return P(this,`cmyk`,new hi)}catch{N(`CMYK fallback: DeviceCMYK`)}return P(this,`cmyk`,new li)}},Oi=class extends yn{constructor(e){super(e,`JpegError`)}},ki=class extends yn{constructor(e,t){super(e,`DNLMarkerError`),this.scanLines=t}},Ai=class extends yn{constructor(e){super(e,`EOIMarkerError`)}},ji=new Uint8Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63]),Mi=4017,Ni=799,Pi=3406,Fi=2276,Ii=1567,Li=3784,Ri=5793,zi=2896;function Bi(e,t){let n,r,i=0,a=16;for(;a>0&&!e[a-1];)a--;let o=[{children:[],index:0}],s,c=o[0];for(n=0;n<a;n++){for(r=0;r<e[n];r++){for(c=o.pop(),c.children[c.index]=t[i];c.index>0;)c=o.pop();for(c.index++,o.push(c);o.length<=n;)o.push(s={children:[],index:0}),c.children[c.index]=s.children,c=s;i++}n+1<a&&(o.push(s={children:[],index:0}),c.children[c.index]=s.children,c=s)}return o[0].children}function Vi(e,t,n){return 64*((e.blocksPerLine+1)*t+n)}function Hi(e,t,n,r,i,a,o,s,c,l=!1){let u=n.mcusPerLine,d=n.progressive,f=t,p=0,m=0;function h(){if(m>0)return m--,p>>m&1;if(p=e[t++],p===255){let r=e[t++];if(r){if(r===220&&l){let r=br(e,t+=2);if(t+=2,r>0&&r!==n.scanLines)throw new ki(`Found DNL marker (0xFFDC) while parsing scan data`,r)}else if(r===217){if(l){let e=S*(n.precision===8?8:0);if(e>0&&Math.round(n.scanLines/e)>=5)throw new ki("Found EOI marker (0xFFD9) while parsing scan data, possibly caused by incorrect `scanLines` parameter",e)}throw new Ai(`Found EOI marker (0xFFD9) while parsing scan data`)}throw new Oi(`unexpected marker ${(p<<8|r).toString(16)}`)}}return m=7,p>>>7}function g(e){let t=e;for(;;){switch(t=t[h()],typeof t){case`number`:return t;case`object`:continue}throw new Oi(`invalid huffman sequence`)}}function _(e){let t=0;for(;e>0;)t=t<<1|h(),e--;return t}function v(e){if(e===1)return h()===1?1:-1;let t=_(e);return t>=1<<e-1?t:t+(-1<<e)+1}let y=0,b,x=0,S=0;function C(e,t,n,r,i){let a=n%u;S=(n/u|0)*e.v+r;let o=a*e.h+i;t(e,Vi(e,S,o))}function w(e,t,n){S=n/e.blocksPerLine|0;let r=n%e.blocksPerLine;t(e,Vi(e,S,r))}let T=r.length,E,D,O,k,ee,A;A=d?a===0?s===0?function(e,t){let n=g(e.huffmanTableDC),r=n===0?0:v(n)<<c;e.blockData[t]=e.pred+=r}:function(e,t){e.blockData[t]|=h()<<c}:s===0?function(e,t){if(y>0)return void y--;let n=a,r=o;for(;n<=r;){let r=g(e.huffmanTableAC),i=15&r,a=r>>4;if(i===0){if(a<15){y=_(a)+(1<<a)-1;break}n+=16;continue}n+=a;let o=ji[n];e.blockData[t+o]=v(i)*(1<<c),n++}}:function(e,t){let n=a,r=o,i,s,l=0;for(;n<=r;){let r=t+ji[n],a=e.blockData[r]<0?-1:1;switch(x){case 0:if(s=g(e.huffmanTableAC),i=15&s,l=s>>4,i===0)l<15?(y=_(l)+(1<<l),x=4):(l=16,x=1);else{if(i!==1)throw new Oi(`invalid ACn encoding`);b=v(i),x=l?2:3}continue;case 1:case 2:e.blockData[r]?e.blockData[r]+=a*(h()<<c):(l--,l===0&&(x=x===2?3:0));break;case 3:e.blockData[r]?e.blockData[r]+=a*(h()<<c):(e.blockData[r]=b<<c,x=0);break;case 4:e.blockData[r]&&(e.blockData[r]+=a*(h()<<c))}n++}x===4&&(y--,y===0&&(x=0))}:function(e,t){let n=g(e.huffmanTableDC),r=n===0?0:v(n);e.blockData[t]=e.pred+=r;let i=1;for(;i<64;){let n=g(e.huffmanTableAC),r=15&n,a=n>>4;if(r===0){if(a<15)break;i+=16;continue}i+=a;let o=ji[i];e.blockData[t+o]=v(r),i++}};let j,M=0,te=T===1?r[0].blocksPerLine*r[0].blocksPerColumn:u*n.mcusPerColumn,ne,re;for(;M<=te;){let n=i?Math.min(te-M,i):te;if(n>0){for(D=0;D<T;D++)r[D].pred=0;if(y=0,T===1)for(E=r[0],ee=0;ee<n;ee++)w(E,A,M),M++;else for(ee=0;ee<n;ee++){for(D=0;D<T;D++)for(E=r[D],ne=E.h,re=E.v,O=0;O<re;O++)for(k=0;k<ne;k++)C(E,A,M,O,k);M++}}if(m=0,j=Gi(e,t),!j||(j.invalid&&(N(`decodeScan - ${n>0?`unexpected`:`excessive`} MCU data, current marker is: ${j.invalid}`),t=j.offset),!(j.marker>=65488&&j.marker<=65495)))break;t+=2}return t-f}function Ui(e,t,n){let r=e.quantizationTable,i=e.blockData,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x;if(!r)throw new Oi(`missing required Quantization Table.`);for(let e=0;e<64;e+=8)p=i[t+e],m=i[t+e+1],h=i[t+e+2],g=i[t+e+3],_=i[t+e+4],v=i[t+e+5],y=i[t+e+6],b=i[t+e+7],p*=r[e],(m|h|g|_|v|y|b)===0?(x=Ri*p+512>>10,n[e]=x,n[e+1]=x,n[e+2]=x,n[e+3]=x,n[e+4]=x,n[e+5]=x,n[e+6]=x,n[e+7]=x):(m*=r[e+1],h*=r[e+2],g*=r[e+3],_*=r[e+4],v*=r[e+5],y*=r[e+6],b*=r[e+7],a=Ri*p+128>>8,o=Ri*_+128>>8,s=h,c=y,l=zi*(m-b)+128>>8,f=zi*(m+b)+128>>8,u=g<<4,d=v<<4,a=a+o+1>>1,o=a-o,x=s*Li+c*Ii+128>>8,s=s*Ii-c*Li+128>>8,c=x,l=l+d+1>>1,d=l-d,f=f+u+1>>1,u=f-u,a=a+c+1>>1,c=a-c,o=o+s+1>>1,s=o-s,x=l*Fi+f*Pi+2048>>12,l=l*Pi-f*Fi+2048>>12,f=x,x=u*Ni+d*Mi+2048>>12,u=u*Mi-d*Ni+2048>>12,d=x,n[e]=a+f,n[e+7]=a-f,n[e+1]=o+d,n[e+6]=o-d,n[e+2]=s+u,n[e+5]=s-u,n[e+3]=c+l,n[e+4]=c-l);for(let e=0;e<8;++e)p=n[e],m=n[e+8],h=n[e+16],g=n[e+24],_=n[e+32],v=n[e+40],y=n[e+48],b=n[e+56],(m|h|g|_|v|y|b)===0?(x=Ri*p+8192>>14,x=x<-2040?0:x>=2024?255:x+2056>>4,i[t+e]=x,i[t+e+8]=x,i[t+e+16]=x,i[t+e+24]=x,i[t+e+32]=x,i[t+e+40]=x,i[t+e+48]=x,i[t+e+56]=x):(a=Ri*p+2048>>12,o=Ri*_+2048>>12,s=h,c=y,l=zi*(m-b)+2048>>12,f=zi*(m+b)+2048>>12,u=g,d=v,a=4112+(a+o+1>>1),o=a-o,x=s*Li+c*Ii+2048>>12,s=s*Ii-c*Li+2048>>12,c=x,l=l+d+1>>1,d=l-d,f=f+u+1>>1,u=f-u,a=a+c+1>>1,c=a-c,o=o+s+1>>1,s=o-s,x=l*Fi+f*Pi+2048>>12,l=l*Pi-f*Fi+2048>>12,f=x,x=u*Ni+d*Mi+2048>>12,u=u*Mi-d*Ni+2048>>12,d=x,p=a+f,b=a-f,m=o+d,y=o-d,h=s+u,v=s-u,g=c+l,_=c-l,p<16?p=0:p>=4080?p=255:p>>=4,m<16?m=0:m>=4080?m=255:m>>=4,h<16?h=0:h>=4080?h=255:h>>=4,g<16?g=0:g>=4080?g=255:g>>=4,_<16?_=0:_>=4080?_=255:_>>=4,v<16?v=0:v>=4080?v=255:v>>=4,y<16?y=0:y>=4080?y=255:y>>=4,b<16?b=0:b>=4080?b=255:b>>=4,i[t+e]=p,i[t+e+8]=m,i[t+e+16]=h,i[t+e+24]=g,i[t+e+32]=_,i[t+e+40]=v,i[t+e+48]=y,i[t+e+56]=b)}function Wi(e,t){let n=t.blocksPerLine,r=t.blocksPerColumn,i=new Int16Array(64);for(let e=0;e<r;e++)for(let r=0;r<n;r++)Ui(t,Vi(t,e,r),i);return t.blockData}function Gi(e,t,n=t){let r=e.length-1,i=n<t?n:t;if(t>=r)return null;let a=br(e,t);if(a>=65472&&a<=65534)return{invalid:null,marker:a,offset:t};let o=br(e,i);for(;!(o>=65472&&o<=65534);){if(++i>=r)return null;o=br(e,i)}return{invalid:a.toString(16),marker:o,offset:i}}function Ki(e){let t=Math.ceil(e.samplesPerLine/8/e.maxH),n=Math.ceil(e.scanLines/8/e.maxV);for(let r of e.components){let i=Math.ceil(Math.ceil(e.samplesPerLine/8)*r.h/e.maxH),a=Math.ceil(Math.ceil(e.scanLines/8)*r.v/e.maxV),o=t*r.h,s=64*(n*r.v)*(o+1);r.blockData=new Int16Array(s),r.blocksPerLine=i,r.blocksPerColumn=a}e.mcusPerLine=t,e.mcusPerColumn=n}function qi(e,t){let n=br(e,t),r=(t+=2)+n-2,i=Gi(e,r,t);i?.invalid&&(N(`readDataBlock - incorrect length, current marker is: `+i.invalid),r=i.offset);let a=e.subarray(t,r);return{appData:a,oldOffset:t,newOffset:t+a.length}}function Ji(e,t){let n=br(e,t),r=(t+=2)+n-2,i=Gi(e,r,t);return i?.invalid?i.offset:r}var Yi=class{constructor({decodeTransform:e=null,colorTransform:t=-1}={}){this._decodeTransform=e,this._colorTransform=t}static canUseImageDecoder(e,t=-1){let n=null,r=0,i=null,a=br(e,r);if(r+=2,a!==65496)throw new Oi(`SOI not found`);a=br(e,r),r+=2;e:for(;a!==65497;){switch(a){case 65505:let{appData:t,oldOffset:o,newOffset:s}=qi(e,r);if(r=s,t[0]===69&&t[1]===120&&t[2]===105&&t[3]===102&&t[4]===0&&t[5]===0){if(n)throw new Oi(`Duplicate EXIF-blocks found.`);n={exifStart:o+6,exifEnd:s}}a=br(e,r),r+=2;continue;case 65472:case 65473:case 65474:i=e[r+7];break e;case 65535:e[r]!==255&&r--}r=Ji(e,r),a=br(e,r),r+=2}return i===4||i===3&&t===0?null:n||{}}parse(e,{dnlScanLines:t=null}={}){let n,r,i=0,a=null,o=null,s=0,c=[],l=[],u=[],d=br(e,i);if(i+=2,d!==65496)throw new Oi(`SOI not found`);d=br(e,i),i+=2;e:for(;d!==65497;){let f,p,m;switch(d){case 65504:case 65505:case 65506:case 65507:case 65508:case 65509:case 65510:case 65511:case 65512:case 65513:case 65514:case 65515:case 65516:case 65517:case 65518:case 65519:case 65534:let{appData:h,newOffset:g}=qi(e,i);i=g,d===65504&&h[0]===74&&h[1]===70&&h[2]===73&&h[3]===70&&h[4]===0&&(a={version:{major:h[5],minor:h[6]},densityUnits:h[7],xDensity:h[8]<<8|h[9],yDensity:h[10]<<8|h[11],thumbWidth:h[12],thumbHeight:h[13],thumbData:h.subarray(14,14+3*h[12]*h[13])}),d===65518&&h[0]===65&&h[1]===100&&h[2]===111&&h[3]===98&&h[4]===101&&(o={version:h[5]<<8|h[6],flags0:h[7]<<8|h[8],flags1:h[9]<<8|h[10],transformCode:h[11]});break;case 65499:let _=br(e,i);i+=2;let v=_+i-2,y;for(;i<v;){let t=e[i++],n=new Uint16Array(64);if(t>>4){if(t>>4!=1)throw new Oi(`DQT - invalid table spec`);for(p=0;p<64;p++)y=ji[p],n[y]=br(e,i),i+=2}else for(p=0;p<64;p++)y=ji[p],n[y]=e[i++];c[15&t]=n}break;case 65472:case 65473:case 65474:if(n)throw new Oi(`Only single frame JPEGs supported`);i+=2,n={},n.extended=d===65473,n.progressive=d===65474,n.precision=e[i++];let b=br(e,i);i+=2,n.scanLines=t||b,n.samplesPerLine=br(e,i),i+=2,n.components=[],n.componentIds={};let x=e[i++],S=0,C=0;for(f=0;f<x;f++){let t=e[i],r=e[i+1]>>4,a=15&e[i+1];S<r&&(S=r),C<a&&(C=a);let o=e[i+2];m=n.components.push({h:r,v:a,quantizationId:o,quantizationTable:null}),n.componentIds[t]=m-1,i+=3}n.maxH=S,n.maxV=C,Ki(n);break;case 65476:let w=br(e,i);for(i+=2,f=2;f<w;){let t=e[i++],n=new Uint8Array(16),r=0;for(p=0;p<16;p++,i++)r+=n[p]=e[i];let a=new Uint8Array(r);for(p=0;p<r;p++,i++)a[p]=e[i];f+=17+r,(t>>4?l:u)[15&t]=Bi(n,a)}break;case 65501:i+=2,r=br(e,i),i+=2;break;case 65498:let T=++s===1&&!t;i+=2;let E=e[i++],D=[];for(f=0;f<E;f++){let t=e[i++],r=n.componentIds[t],a=n.components[r];a.index=t;let o=e[i++];a.huffmanTableDC=u[o>>4],a.huffmanTableAC=l[15&o],D.push(a)}let O=e[i++],k=e[i++],ee=e[i++];try{i+=Hi(e,i,n,D,r,O,k,ee>>4,15&ee,T)}catch(t){if(t instanceof ki)return N(`${t.message} -- attempting to re-parse the JPEG image.`),this.parse(e,{dnlScanLines:t.scanLines});if(t instanceof Ai){N(`${t.message} -- ignoring the rest of the image data.`);break e}throw t}break;case 65500:i+=4;break;case 65535:e[i]!==255&&i--;break;default:let A=Gi(e,i-2,i-3);if(A?.invalid){N(`JpegImage.parse - unexpected data, current marker is: `+A.invalid),i=A.offset;break}if(!A||i>=e.length-1){N(`JpegImage.parse - reached the end of the image data without finding an EOI marker (0xFFD9).`);break e}throw new Oi(`JpegImage.parse - unknown marker: `+d.toString(16))}d=br(e,i),i+=2}if(!n)throw new Oi(`JpegImage.parse - no frame data found.`);this.width=n.samplesPerLine,this.height=n.scanLines,this.jfif=a,this.adobe=o,this.components=[];for(let e of n.components){let t=c[e.quantizationId];t&&(e.quantizationTable=t),this.components.push({index:e.index,output:Wi(0,e),scaleX:e.h/n.maxH,scaleY:e.v/n.maxV,blocksPerLine:e.blocksPerLine,blocksPerColumn:e.blocksPerColumn})}this.numComponents=this.components.length}_getLinearizedBlockData(e,t,n=!1){let r=this.width/e,i=this.height/t,a,o,s,c,l,u,d,f,p,m,h,g=0,_=this.components.length,v=e*t*_,y=new Uint8ClampedArray(v),b=new Uint32Array(e),x=4294967288,S;for(d=0;d<_;d++){if(a=this.components[d],o=a.scaleX*r,s=a.scaleY*i,g=d,h=a.output,c=a.blocksPerLine+1<<3,o!==S){for(l=0;l<e;l++)f=0|l*o,b[l]=(f&x)<<3|7&f;S=o}for(u=0;u<t;u++)for(f=0|u*s,m=c*(f&x)|(7&f)<<3,l=0;l<e;l++)y[g]=h[m+b[l]],g+=_}let C=this._decodeTransform;if(n||_!==4||C||(C=new Int32Array([-256,255,-256,255,-256,255,-256,255])),C)for(d=0;d<v;)for(f=0,p=0;f<_;f++,d++,p+=2)y[d]=(y[d]*C[p]>>8)+C[p+1];return y}get _isColorConversionNeeded(){return this.adobe?!!this.adobe.transformCode:this.numComponents===3?this._colorTransform!==0&&(this.components[0].index!==82||this.components[1].index!==71||this.components[2].index!==66):this._colorTransform===1}_convertYccToRgb(e){let t,n,r;for(let i=0,a=e.length;i<a;i+=3)t=e[i],n=e[i+1],r=e[i+2],e[i]=t-179.456+1.402*r,e[i+1]=t+135.459-.344*n-.714*r,e[i+2]=t-226.816+1.772*n;return e}_convertYccToRgba(e,t){for(let n=0,r=0,i=e.length;n<i;n+=3,r+=4){let i=e[n],a=e[n+1],o=e[n+2];t[r]=i-179.456+1.402*o,t[r+1]=i+135.459-.344*a-.714*o,t[r+2]=i-226.816+1.772*a,t[r+3]=255}return t}_convertYcckToRgb(e){return this._convertYcckToCmyk(e),this._convertCmykToRgb(e)}_convertYcckToRgba(e){return this._convertYcckToCmyk(e),this._convertCmykToRgba(e)}_convertYcckToCmyk(e){let t,n,r;for(let i=0,a=e.length;i<a;i+=4)t=e[i],n=e[i+1],r=e[i+2],e[i]=434.456-t-1.402*r,e[i+1]=119.541-t+.344*n+.714*r,e[i+2]=481.816-t-1.772*n;return e}_convertCmykToRgb(e){let t=e.length/4;return Di.cmyk.getRgbBuffer(e,0,t,e,0,8,0),e.subarray(0,3*t)}_convertCmykToRgba(e){if(Di.cmyk.getRgbBuffer(e,0,e.length/4,e,0,8,1),Di.cmyk instanceof li)for(let t=3,n=e.length;t<n;t+=4)e[t]=255;return e}getData({width:e,height:t,forceRGBA:n=!1,forceRGB:r=!1,isSourcePDF:i=!1}){if(this.numComponents>4)throw new Oi(`Unsupported color mode`);let a=this._getLinearizedBlockData(e,t,i);if(this.numComponents===1&&(n||r)){let e=a.length*(n?4:3),t=new Uint8ClampedArray(e),r=0;if(n)(function(e,t){if(kn.isLittleEndian)for(let n=0,r=e.length;n<r;n++)t[n]=65793*e[n]|4278190080;else for(let n=0,r=e.length;n<r;n++)t[n]=16843008*e[n]|255})(a,new Uint32Array(t.buffer));else for(let e of a)t[r++]=e,t[r++]=e,t[r++]=e;return t}if(this.numComponents===3&&this._isColorConversionNeeded){if(n){let e=new Uint8ClampedArray(a.length/3*4);return this._convertYccToRgba(a,e)}return this._convertYccToRgb(a)}if(this.numComponents===4){if(this._isColorConversionNeeded)return n?this._convertYcckToRgba(a):r?this._convertYcckToRgb(a):this._convertYcckToCmyk(a);if(n)return this._convertCmykToRgba(a);if(r)return this._convertCmykToRgb(a)}return a}},Xi=class e extends Ti{static#e=kn.isImageDecoderSupported;constructor(e,t,n){super(t),this.stream=e,this.dict=e.dict,this.maybeLength=t,this.params=n}static get canUseImageDecoder(){return P(this,`canUseImageDecoder`,this.#e?ImageDecoder.isTypeSupported(`image/jpeg`):Promise.resolve(!1))}static setOptions({isImageDecoderSupported:e=!1}){this.#e=e}get bytes(){return P(this,`bytes`,this.stream.getBytes(this.maybeLength))}ensureBuffer(e){}readBlock(){this.decodeImage()}get jpegOptions(){let e={decodeTransform:void 0,colorTransform:void 0},t=this.dict.getArray(`D`,`Decode`);if((this.forceRGBA||this.forceRGB)&&Array.isArray(t)){let n=this.dict.get(`BPC`,`BitsPerComponent`)||8,r=t.length,i=new Int32Array(r),a=!1,o=(1<<n)-1;for(let e=0;e<r;e+=2)i[e]=256*(t[e+1]-t[e])|0,i[e+1]=t[e]*o|0,i[e]===256&&i[e+1]===0||(a=!0);a&&(e.decodeTransform=i)}if(this.params instanceof L){let t=this.params.get(`ColorTransform`);Number.isInteger(t)&&(e.colorTransform=t)}return P(this,`jpegOptions`,e)}#t(e){for(let t=0,n=e.length-1;t<n;t++)if(e[t]===255&&e[t+1]===216){t>0&&(e=e.subarray(t));break}return e}decodeImage(e){if(this.eof)return this.buffer;e=this.#t(e||this.bytes);let t=new Yi(this.jpegOptions);t.parse(e);let n=t.getData({width:this.drawWidth,height:this.drawHeight,forceRGBA:this.forceRGBA,forceRGB:this.forceRGB,isSourcePDF:!0});return this.buffer=n,this.bufferLength=n.length,this.eof=!0,this.buffer}get canAsyncDecodeImageFromBuffer(){return this.stream.isAsync}async getTransferableImage(){if(!await e.canUseImageDecoder)return null;let t=this.jpegOptions;if(t.decodeTransform)return null;let n;try{let e=this.canAsyncDecodeImageFromBuffer&&await this.stream.asyncGetBytes()||this.bytes;if(!e)return null;let r=this.#t(e),i=Yi.canUseImageDecoder(r,t.colorTransform);return i?(i.exifStart&&(r=r.slice(),r.fill(0,i.exifStart,i.exifEnd)),n=new ImageDecoder({data:r,type:`image/jpeg`,preferAnimation:!1}),(await n.decode()).image):null}catch(e){return N(`getTransferableImage - failed: "${e}".`),null}finally{n?.close()}}},Zi=class extends yn{constructor(e){super(e,`JpxError`)}},Qi=class{static#e=null;static#t=null;static#n=!0;static#r=!0;static#i=null;static setOptions({handler:e,useWasm:t,useWorkerFetch:n,wasmUrl:r}){this.#n=t,this.#r=n,this.#i=r,n||(this.#e=e)}static async decode(e,{numComponents:t=4,isIndexedColormap:n=!1,smaskInData:r=!1,reducePower:i=0}={}){let a=await this.#t;if(!a)throw new Zi(`OpenJPEG failed to initialize`);let o;try{let s=e.length;if(o=a._malloc(s),a.writeArrayToMemory(e,o),a._jp2_decode(o,s,t>0?t:0,!!n,!!r,i)){let{errorMessages:e}=a;throw e?(delete a.errorMessages,new Zi(e)):new Zi(`Unknown error`)}let{imageData:c}=a;return a.imageData=null,c}finally{o&&a._free(o)}}static cleanup(){this.#t=null}static parseImageProperties(e){let t=e.getByte();for(;t>=0;){let n=t;if(t=e.getByte(),(n<<8|t)==65361){e.skip(4);let t=e.getInt32()>>>0,n=e.getInt32()>>>0,r=e.getInt32()>>>0,i=e.getInt32()>>>0;return e.skip(16),{width:t-r,height:n-i,bitsPerComponent:8,componentsCount:e.getUint16()}}}throw new Zi(`No size marker found in JPX stream`)}};function $i(e,t,n,r,i){let a=e;for(let e=0,n=t.length-1;e<n;e++){let n=t[e];a=a[n]||=[]}a[t.at(-1)]={checkFn:n,iterateFn:r,processFn:i}}var ea=[];$i(ea,[Ne,Fe,Qt,Pe],null,function(e,t){let n=e.fnArray,r=(t-(e.iCurr-3))%4;switch(r){case 0:return n[t]===Ne;case 1:return n[t]===Fe;case 2:return n[t]===Qt;case 3:return n[t]===Pe}throw Error(`iterateInlineImageGroup - invalid pos: ${r}`)},function(e,t){let n=e.fnArray,r=e.argsArray,i=e.iCurr,a=i-3,o=i-2,s=i-1,c=Math.min(Math.floor((t-a)/4),200);if(c<10)return t-(t-a)%4;let l=0,u=[],d=0,f=1,p=1;for(let e=0;e<c;e++){let t=r[o+(e<<2)],n=r[s+(e<<2)][0];f+n.width>1e3&&(l=Math.max(l,f),p+=d+2,f=0,d=0),u.push({transform:t,x:f,y:p,w:n.width,h:n.height}),f+=n.width+2,d=Math.max(d,n.height)}let m=Math.max(l,f)+1,h=p+d+1,g=new Uint8Array(m*h*4),_=m<<2;for(let e=0;e<c;e++){let t=r[s+(e<<2)][0].data,n=u[e].w<<2,i=0,a=u[e].x+u[e].y*m<<2;g.set(t.subarray(0,n),a-_);for(let r=0,o=u[e].h;r<o;r++)g.set(t.subarray(i,i+n),a),i+=n,a+=_;for(g.set(t.subarray(i-n,i),a);a>=0;)t[a-4]=t[a],t[a-3]=t[a+1],t[a-2]=t[a+2],t[a-1]=t[a+3],t[a+n]=t[a+n-4],t[a+n+1]=t[a+n-3],t[a+n+2]=t[a+n-2],t[a+n+3]=t[a+n-1],a-=_}let v={width:m,height:h};if(e.isOffscreenCanvasSupported){let e=new OffscreenCanvas(m,h);e.getContext(`2d`).putImageData(new ImageData(new Uint8ClampedArray(g.buffer),m,h),0,0),v.bitmap=e.transferToImageBitmap(),v.data=null}else v.kind=T,v.data=g;return n.splice(a,4*c,$t),r.splice(a,4*c,[v,u]),a+1}),$i(ea,[Ne,Fe,Yt,Pe],null,function(e,t){let n=e.fnArray,r=(t-(e.iCurr-3))%4;switch(r){case 0:return n[t]===Ne;case 1:return n[t]===Fe;case 2:return n[t]===Yt;case 3:return n[t]===Pe}throw Error(`iterateImageMaskGroup - invalid pos: ${r}`)},function(e,t){let n=e.fnArray,r=e.argsArray,i=e.iCurr,a=i-3,o=i-2,s=i-1,c=Math.floor((t-a)/4);if(c<10)return t-(t-a)%4;let l,u,d=!1,f=r[s][0],p=r[o][0],m=r[o][1],h=r[o][2],g=r[o][3];if(m===h){d=!0,l=o+4;let e=s+4;for(let t=1;t<c;t++,l+=4,e+=4)if(u=r[l],r[e][0]!==f||u[0]!==p||u[1]!==m||u[2]!==h||u[3]!==g){t<10?d=!1:c=t;break}}if(d){c=Math.min(c,1e3);let e=new Float32Array(2*c);l=o;for(let t=0;t<c;t++,l+=4)u=r[l],e[t<<1]=u[4],e[1+(t<<1)]=u[5];n.splice(a,4*c,tn),r.splice(a,4*c,[f,p,m,h,g,e])}else{c=Math.min(c,100);let e=[];for(let t=0;t<c;t++){u=r[o+(t<<2)];let n=r[s+(t<<2)][0];e.push({data:n.data,width:n.width,height:n.height,interpolate:n.interpolate,count:n.count,transform:u})}n.splice(a,4*c,Xt),r.splice(a,4*c,[e])}return a+1}),$i(ea,[Ne,Fe,Zt,Pe],function(e){let t=e.argsArray,n=e.iCurr-2;return t[n][1]===0&&t[n][2]===0},function(e,t){let n=e.fnArray,r=e.argsArray,i=(t-(e.iCurr-3))%4;switch(i){case 0:return n[t]===Ne;case 1:if(n[t]!==Fe)return!1;let i=e.iCurr-2,a=r[i][0],o=r[i][3];return r[t][0]===a&&r[t][1]===0&&r[t][2]===0&&r[t][3]===o;case 2:if(n[t]!==Zt)return!1;let s=r[e.iCurr-1][0];return r[t][0]===s;case 3:return n[t]===Pe}throw Error(`iterateImageGroup - invalid pos: ${i}`)},function(e,t){let n=e.fnArray,r=e.argsArray,i=e.iCurr,a=i-3,o=i-2,s=r[i-1][0],c=r[o][0],l=r[o][3],u=Math.min(Math.floor((t-a)/4),1e3);if(u<3)return t-(t-a)%4;let d=new Float32Array(2*u),f=o;for(let e=0;e<u;e++,f+=4){let t=r[f];d[e<<1]=t[4],d[1+(e<<1)]=t[5]}let p=[s,c,l,d];return n.splice(a,4*u,en),r.splice(a,4*u,p),a+1}),$i(ea,[et,ot,dt,pt,tt],null,function(e,t){let n=e.fnArray,r=e.argsArray,i=(t-(e.iCurr-4))%5;switch(i){case 0:return n[t]===et;case 1:return n[t]===ot;case 2:return n[t]===dt;case 3:if(n[t]!==pt)return!1;let i=e.iCurr-3,a=r[i][0],o=r[i][1];return r[t][0]===a&&r[t][1]===o;case 4:return n[t]===tt}throw Error(`iterateShowTextGroup - invalid pos: ${i}`)},function(e,t){let n=e.fnArray,r=e.argsArray,i=e.iCurr,a=i-4,o=i-3,s=i-2,c=i-1,l=i,u=r[o][0],d=r[o][1],f=Math.min(Math.floor((t-a)/5),1e3);if(f<3)return t-(t-a)%5;let p=a;a>=4&&n[a-4]===n[o]&&n[a-3]===n[s]&&n[a-2]===n[c]&&n[a-1]===n[l]&&r[a-4][0]===u&&r[a-4][1]===d&&(f++,p-=5);let m=p+4;for(let e=1;e<f;e++)n.splice(m,3),r.splice(m,3),m+=2;return m+1}),$i(ea,[Ne,Fe,rn,Pe],e=>{let t=e.argsArray,n=t[e.iCurr-1][0];if(n!==Ue&&n!==We&&n!==qe&&n!==Je&&n!==Ye&&n!==Xe)return!0;let r=t[e.iCurr-2];return r[0]===1&&r[1]===0&&r[2]===0&&r[3]===1},()=>!1,(e,t)=>{let{fnArray:n,argsArray:r}=e,i=e.iCurr,a=i-3,o=i-2,s=r[i-1],c=r[o],[,[l],u]=s;if(u){jn.scaleMinMax(c,u);for(let e=0,t=l.length;e<t;)switch(l[e++]){case cn:case ln:jn.applyTransform(l,c,e),e+=2;break;case un:jn.applyTransformToBezier(l,c,e),e+=6}}return n.splice(a,4,rn),r.splice(a,4,s),a+1});var ta=class{constructor(e){this.queue=e}_optimize(){}push(e,t){this.queue.fnArray.push(e),this.queue.argsArray.push(t),this._optimize()}flush(){}reset(){}},na=class extends ta{constructor(e){super(e),this.state=null,this.context={iCurr:0,fnArray:e.fnArray,argsArray:e.argsArray,isOffscreenCanvasSupported:ra.isOffscreenCanvasSupported},this.match=null,this.lastProcessed=0}_optimize(){let e=this.queue.fnArray,t=this.lastProcessed,n=e.length,r=this.state,i=this.match;if(!r&&!i&&t+1===n&&!ea[e[t]])return void(this.lastProcessed=n);let a=this.context;for(;t<n;){if(i){if((0,i.iterateFn)(a,t)){t++;continue}if(t=(0,i.processFn)(a,t+1),n=e.length,i=null,r=null,t>=n)break}r=(r||ea)[e[t]],r&&!Array.isArray(r)?(a.iCurr=t,t++,(!r.checkFn||(0,r.checkFn)(a))&&(i=r),r=null):t++}this.state=r,this.match=i,this.lastProcessed=t}flush(){for(;this.match;){let e=this.queue.fnArray.length;this.lastProcessed=(0,this.match.processFn)(this.context,e),this.match=null,this.state=null,this._optimize()}}reset(){this.state=null,this.match=null,this.lastProcessed=0}},ra=class e{static CHUNK_SIZE=1e3;static CHUNK_SIZE_ABOUT=this.CHUNK_SIZE-5;static isOffscreenCanvasSupported=!1;constructor(e=0,t){this._streamSink=t,this.fnArray=[],this.argsArray=[],this.optimizer=!t||e&p?new ta(this):new na(this),this.dependencies=new Set,this._totalLength=0,this.weight=0,this._resolved=t?null:Promise.resolve()}static setOptions({isOffscreenCanvasSupported:e}){this.isOffscreenCanvasSupported=e}get length(){return this.argsArray.length}get ready(){return this._resolved||this._streamSink.ready}get totalLength(){return this._totalLength+this.length}addOp(t,n){this.optimizer.push(t,n),this.weight++,this._streamSink&&(this.weight>=e.CHUNK_SIZE||this.weight>=e.CHUNK_SIZE_ABOUT&&(t===Pe||t===tt))&&this.flush()}addImageOps(e,t,n,r=!1){r&&(this.addOp(Ne),this.addOp(Me,[[[`SMask`,!1]]])),n!==void 0&&this.addOp(zt,[`OC`,n]),this.addOp(e,t),n!==void 0&&this.addOp(Bt,[]),r&&this.addOp(Pe)}addDependency(e){this.dependencies.has(e)||(this.dependencies.add(e),this.addOp(we,[e]))}addDependencies(e){for(let t of e)this.addDependency(t)}addOpList(t){if(t instanceof e){for(let e of t.dependencies)this.dependencies.add(e);for(let e=0,n=t.length;e<n;e++)this.addOp(t.fnArray[e],t.argsArray[e])}else N(`addOpList - ignoring invalid "opList" parameter.`)}getIR(){return{fnArray:this.fnArray,argsArray:this.argsArray,length:this.length}}get _transfers(){let e=[],{fnArray:t,argsArray:n,length:r}=this;for(let i=0;i<r;i++)switch(t[i]){case Qt:case $t:case Yt:{let{bitmap:t,data:r}=n[i][0];(t||r?.buffer)&&e.push(t||r.buffer);break}case rn:{let[,[t],r]=n[i];t&&e.push(t.buffer,r.buffer);break}case Ut:let[t,r]=n[i];t&&e.push(t.buffer),r&&e.push(r.buffer);break;case dt:e.push(n[i][0].buffer)}return e}flush(e=!1,t=null){this.optimizer.flush();let n=this.length;this._totalLength+=n,this._streamSink.enqueue({fnArray:this.fnArray,argsArray:this.argsArray,lastChunk:e,separateAnnots:t,length:n},1,this._transfers),this.dependencies.clear(),this.fnArray.length=0,this.argsArray.length=0,this.weight=0,this.optimizer.reset()}};function ia(e,t){let n=0;for(let r=0;r<=t;r++)n=n<<8|e[r];return n>>>0}function aa(e,t){return t===1?String.fromCharCode(e[0],e[1]):t===3?String.fromCharCode(e[0],e[1],e[2],e[3]):String.fromCharCode(...e.subarray(0,t+1))}function oa(e,t,n){let r=0;for(let i=n;i>=0;i--)r+=e[i]+t[i],e[i]=255&r,r>>=8}function sa(e,t){let n=1;for(let r=t;r>=0&&n>0;r--)n+=e[r],e[r]=255&n,n>>=8}var ca=16,la=class{constructor(e){this.buffer=e,this.pos=0,this.end=e.length,this.tmpBuf=new Uint8Array(19)}readByte(){return this.pos>=this.end?-1:this.buffer[this.pos++]}readNumber(){let e,t=0;do{let n=this.readByte();if(n<0)throw new F(`unexpected EOF in bcmap`);e=!(128&n),t=t<<7|127&n}while(!e);return t}readSigned(){let e=this.readNumber();return 1&e?~(e>>>1):e>>>1}readHex(e,t){e.set(this.buffer.subarray(this.pos,this.pos+t+1)),this.pos+=t+1}readHexNumber(e,t){let n,r=this.tmpBuf,i=0;do{let e=this.readByte();if(e<0)throw new F(`unexpected EOF in bcmap`);n=!(128&e),r[i++]=127&e}while(!n);let a=t,o=0,s=0;for(;a>=0;){for(;s<8&&r.length>0;)o|=r[--i]<<s,s+=7;e[a]=255&o,a--,o>>=8,s-=8}}readHexSigned(e,t){this.readHexNumber(e,t);let n=1&e[t]?255:0,r=0;for(let i=0;i<=t;i++)r=(1&r)<<8|e[i],e[i]=r>>1^n}readString(){let e=this.readNumber(),t=Array(e);for(let n=0;n<e;n++)t[n]=this.readNumber();return String.fromCharCode(...t)}},ua=class{async process(e,t,n){let r=new la(e);t.vertical=!!(1&r.readByte());let i=null,a=new Uint8Array(ca),o=new Uint8Array(ca),s=new Uint8Array(ca),c=new Uint8Array(ca),l=new Uint8Array(ca),u,d;for(;(d=r.readByte())>=0;){let e=d>>5;if(e===7){switch(31&d){case 0:r.readString();break;case 1:i=r.readString()}continue}let n=!!(16&d),f=15&d;if(f+1>ca)throw Error(`BinaryCMapReader.process: Invalid dataSize.`);let p=r.readNumber();switch(e){case 0:r.readHex(a,f),r.readHexNumber(o,f),oa(o,a,f),t.addCodespaceRange(f+1,ia(a,f),ia(o,f));for(let e=1;e<p;e++)sa(o,f),r.readHexNumber(a,f),oa(a,o,f),r.readHexNumber(o,f),oa(o,a,f),t.addCodespaceRange(f+1,ia(a,f),ia(o,f));break;case 1:r.readHex(a,f),r.readHexNumber(o,f),oa(o,a,f),r.readNumber();for(let e=1;e<p;e++)sa(o,f),r.readHexNumber(a,f),oa(a,o,f),r.readHexNumber(o,f),oa(o,a,f),r.readNumber();break;case 2:r.readHex(s,f),u=r.readNumber(),t.mapOne(ia(s,f),u);for(let e=1;e<p;e++)sa(s,f),n||(r.readHexNumber(l,f),oa(s,l,f)),u=r.readSigned()+(u+1),t.mapOne(ia(s,f),u);break;case 3:r.readHex(a,f),r.readHexNumber(o,f),oa(o,a,f),u=r.readNumber(),t.mapCidRange(ia(a,f),ia(o,f),u);for(let e=1;e<p;e++)sa(o,f),n?a.set(o):(r.readHexNumber(a,f),oa(a,o,f)),r.readHexNumber(o,f),oa(o,a,f),u=r.readNumber(),t.mapCidRange(ia(a,f),ia(o,f),u);break;case 4:r.readHex(s,1),r.readHex(c,f),t.mapOne(ia(s,1),aa(c,f));for(let e=1;e<p;e++)sa(s,1),n||(r.readHexNumber(l,1),oa(s,l,1)),sa(c,f),r.readHexSigned(l,f),oa(c,l,f),t.mapOne(ia(s,1),aa(c,f));break;case 5:r.readHex(a,1),r.readHexNumber(o,1),oa(o,a,1),r.readHex(c,f),t.mapBfRange(ia(a,1),ia(o,1),aa(c,f));for(let e=1;e<p;e++)sa(o,1),n?a.set(o):(r.readHexNumber(a,1),oa(a,o,1)),r.readHexNumber(o,1),oa(o,a,1),r.readHex(c,f),t.mapBfRange(ia(a,1),ia(o,1),aa(c,f));break;default:throw Error(`BinaryCMapReader.process - unknown type: ${e}`)}}return i?n(i):t}},da=class extends Ti{constructor(e,t){t&&(t*=.8),super(t),this.str=e,this.dict=e.dict,this.input=new Uint8Array(5)}readBlock(){let e=this.str,t=e.getByte();for(;Sr(t);)t=e.getByte();if(t===-1||t===126)return void(this.eof=!0);let n=this.bufferLength,r,i;if(t===122){for(r=this.ensureBuffer(n+4),i=0;i<4;++i)r[n+i]=0;this.bufferLength+=4}else{let a=this.input;for(a[0]=t,i=1;i<5;++i){for(t=e.getByte();Sr(t);)t=e.getByte();if(a[i]=t,t===-1||t===126)break}if(r=this.ensureBuffer(n+i-1),this.bufferLength+=i-1,i<5){for(;i<5;++i)a[i]=117;this.eof=!0}let o=0;for(i=0;i<5;++i)o=85*o+(a[i]-33);for(i=3;i>=0;--i)r[n+i]=255&o,o>>=8}}},fa=class extends Ti{constructor(e,t){t&&(t*=.5),super(t),this.str=e,this.dict=e.dict,this.firstDigit=-1}readBlock(){let e=this.str.getBytes(8e3);if(!e.length)return void(this.eof=!0);let t=e.length+1>>1,n=this.ensureBuffer(this.bufferLength+t),r=this.bufferLength,i=this.firstDigit;for(let t of e){let e;if(t>=48&&t<=57)e=15&t;else{if(!(t>=65&&t<=70||t>=97&&t<=102)){if(t===62){this.eof=!0;break}continue}e=9+(15&t)}i<0?i=e:(n[r++]=i<<4|e,i=-1)}i>=0&&this.eof&&(n[r++]=i<<4,i=-1),this.firstDigit=i,this.bufferLength=r}},pa=-1,ma=[[-1,-1],[-1,-1],[7,8],[7,7],[6,6],[6,6],[6,5],[6,5],[4,0],[4,0],[4,0],[4,0],[4,0],[4,0],[4,0],[4,0],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2]],ha=[[-1,-1],[12,-2],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[11,1792],[11,1792],[12,1984],[12,2048],[12,2112],[12,2176],[12,2240],[12,2304],[11,1856],[11,1856],[11,1920],[11,1920],[12,2368],[12,2432],[12,2496],[12,2560]],ga=[[-1,-1],[-1,-1],[-1,-1],[-1,-1],[8,29],[8,29],[8,30],[8,30],[8,45],[8,45],[8,46],[8,46],[7,22],[7,22],[7,22],[7,22],[7,23],[7,23],[7,23],[7,23],[8,47],[8,47],[8,48],[8,48],[6,13],[6,13],[6,13],[6,13],[6,13],[6,13],[6,13],[6,13],[7,20],[7,20],[7,20],[7,20],[8,33],[8,33],[8,34],[8,34],[8,35],[8,35],[8,36],[8,36],[8,37],[8,37],[8,38],[8,38],[7,19],[7,19],[7,19],[7,19],[8,31],[8,31],[8,32],[8,32],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,12],[6,12],[6,12],[6,12],[6,12],[6,12],[6,12],[6,12],[8,53],[8,53],[8,54],[8,54],[7,26],[7,26],[7,26],[7,26],[8,39],[8,39],[8,40],[8,40],[8,41],[8,41],[8,42],[8,42],[8,43],[8,43],[8,44],[8,44],[7,21],[7,21],[7,21],[7,21],[7,28],[7,28],[7,28],[7,28],[8,61],[8,61],[8,62],[8,62],[8,63],[8,63],[8,0],[8,0],[8,320],[8,320],[8,384],[8,384],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[7,27],[7,27],[7,27],[7,27],[8,59],[8,59],[8,60],[8,60],[9,1472],[9,1536],[9,1600],[9,1728],[7,18],[7,18],[7,18],[7,18],[7,24],[7,24],[7,24],[7,24],[8,49],[8,49],[8,50],[8,50],[8,51],[8,51],[8,52],[8,52],[7,25],[7,25],[7,25],[7,25],[8,55],[8,55],[8,56],[8,56],[8,57],[8,57],[8,58],[8,58],[6,192],[6,192],[6,192],[6,192],[6,192],[6,192],[6,192],[6,192],[6,1664],[6,1664],[6,1664],[6,1664],[6,1664],[6,1664],[6,1664],[6,1664],[8,448],[8,448],[8,512],[8,512],[9,704],[9,768],[8,640],[8,640],[8,576],[8,576],[9,832],[9,896],[9,960],[9,1024],[9,1088],[9,1152],[9,1216],[9,1280],[9,1344],[9,1408],[7,256],[7,256],[7,256],[7,256],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[6,16],[6,16],[6,16],[6,16],[6,16],[6,16],[6,16],[6,16],[6,17],[6,17],[6,17],[6,17],[6,17],[6,17],[6,17],[6,17],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[6,14],[6,14],[6,14],[6,14],[6,14],[6,14],[6,14],[6,14],[6,15],[6,15],[6,15],[6,15],[6,15],[6,15],[6,15],[6,15],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7]],_a=[[-1,-1],[-1,-1],[12,-2],[12,-2],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[11,1792],[11,1792],[11,1792],[11,1792],[12,1984],[12,1984],[12,2048],[12,2048],[12,2112],[12,2112],[12,2176],[12,2176],[12,2240],[12,2240],[12,2304],[12,2304],[11,1856],[11,1856],[11,1856],[11,1856],[11,1920],[11,1920],[11,1920],[11,1920],[12,2368],[12,2368],[12,2432],[12,2432],[12,2496],[12,2496],[12,2560],[12,2560],[10,18],[10,18],[10,18],[10,18],[10,18],[10,18],[10,18],[10,18],[12,52],[12,52],[13,640],[13,704],[13,768],[13,832],[12,55],[12,55],[12,56],[12,56],[13,1280],[13,1344],[13,1408],[13,1472],[12,59],[12,59],[12,60],[12,60],[13,1536],[13,1600],[11,24],[11,24],[11,24],[11,24],[11,25],[11,25],[11,25],[11,25],[13,1664],[13,1728],[12,320],[12,320],[12,384],[12,384],[12,448],[12,448],[13,512],[13,576],[12,53],[12,53],[12,54],[12,54],[13,896],[13,960],[13,1024],[13,1088],[13,1152],[13,1216],[10,64],[10,64],[10,64],[10,64],[10,64],[10,64],[10,64],[10,64]],va=[[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[11,23],[11,23],[12,50],[12,51],[12,44],[12,45],[12,46],[12,47],[12,57],[12,58],[12,61],[12,256],[10,16],[10,16],[10,16],[10,16],[10,17],[10,17],[10,17],[10,17],[12,48],[12,49],[12,62],[12,63],[12,30],[12,31],[12,32],[12,33],[12,40],[12,41],[11,22],[11,22],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[9,15],[9,15],[9,15],[9,15],[9,15],[9,15],[9,15],[9,15],[12,128],[12,192],[12,26],[12,27],[12,28],[12,29],[11,19],[11,19],[11,20],[11,20],[12,34],[12,35],[12,36],[12,37],[12,38],[12,39],[11,21],[11,21],[12,42],[12,43],[10,0],[10,0],[10,0],[10,0],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12]],ya=[[-1,-1],[-1,-1],[-1,-1],[-1,-1],[6,9],[6,8],[5,7],[5,7],[4,6],[4,6],[4,6],[4,6],[4,5],[4,5],[4,5],[4,5],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2]],ba=class{constructor(e,t={}){if(typeof e?.next!=`function`)throw Error(`CCITTFaxDecoder - invalid "source" parameter.`);let n;for(this.source=e,this.eof=!1,this.encoding=t.K||0,this.eoline=t.EndOfLine||!1,this.byteAlign=t.EncodedByteAlign||!1,this.columns=t.Columns||1728,this.rows=t.Rows||0,this.eoblock=t.EndOfBlock??!0,this.black=t.BlackIs1||!1,this.codingLine=new Uint32Array(this.columns+1),this.refLine=new Uint32Array(this.columns+2),this.codingLine[0]=this.columns,this.codingPos=0,this.row=0,this.nextLine2D=this.encoding<0,this.inputBits=0,this.inputBuf=0,this.outputBits=0,this.rowsDone=!1;(n=this._lookBits(12))===0;)this._eatBits(1);n===1&&this._eatBits(12),this.encoding>0&&(this.nextLine2D=!this._lookBits(1),this._eatBits(1))}readNextChar(){if(this.eof)return-1;let e=this.refLine,t=this.codingLine,n=this.columns,r,i,a,o,s;if(this.outputBits===0){if(this.rowsDone&&(this.eof=!0),this.eof)return-1;let a,s,c;if(this.err=!1,this.nextLine2D){for(o=0;t[o]<n;++o)e[o]=t[o];for(e[o++]=n,e[o]=n,t[0]=0,this.codingPos=0,r=0,i=0;t[this.codingPos]<n;)switch(a=this._getTwoDimCode(),a){case 0:this._addPixels(e[r+1],i),e[r+1]<n&&(r+=2);break;case 1:if(a=s=0,i){do a+=c=this._getBlackCode();while(c>=64);do s+=c=this._getWhiteCode();while(c>=64)}else{do a+=c=this._getWhiteCode();while(c>=64);do s+=c=this._getBlackCode();while(c>=64)}for(this._addPixels(t[this.codingPos]+a,i),t[this.codingPos]<n&&this._addPixels(t[this.codingPos]+s,1^i);e[r]<=t[this.codingPos]&&e[r]<n;)r+=2;break;case 7:if(this._addPixels(e[r]+3,i),i^=1,t[this.codingPos]<n)for(++r;e[r]<=t[this.codingPos]&&e[r]<n;)r+=2;break;case 5:if(this._addPixels(e[r]+2,i),i^=1,t[this.codingPos]<n)for(++r;e[r]<=t[this.codingPos]&&e[r]<n;)r+=2;break;case 3:if(this._addPixels(e[r]+1,i),i^=1,t[this.codingPos]<n)for(++r;e[r]<=t[this.codingPos]&&e[r]<n;)r+=2;break;case 2:if(this._addPixels(e[r],i),i^=1,t[this.codingPos]<n)for(++r;e[r]<=t[this.codingPos]&&e[r]<n;)r+=2;break;case 8:if(this._addPixelsNeg(e[r]-3,i),i^=1,t[this.codingPos]<n)for(r>0?--r:++r;e[r]<=t[this.codingPos]&&e[r]<n;)r+=2;break;case 6:if(this._addPixelsNeg(e[r]-2,i),i^=1,t[this.codingPos]<n)for(r>0?--r:++r;e[r]<=t[this.codingPos]&&e[r]<n;)r+=2;break;case 4:if(this._addPixelsNeg(e[r]-1,i),i^=1,t[this.codingPos]<n)for(r>0?--r:++r;e[r]<=t[this.codingPos]&&e[r]<n;)r+=2;break;case pa:this._addPixels(n,0),this.eof=!0;break;default:hn(`bad 2d code`),this._addPixels(n,0),this.err=!0}}else for(t[0]=0,this.codingPos=0,i=0;t[this.codingPos]<n;){if(a=0,i)do a+=c=this._getBlackCode();while(c>=64);else do a+=c=this._getWhiteCode();while(c>=64);this._addPixels(t[this.codingPos]+a,i),i^=1}let l=!1;if(this.byteAlign&&(this.inputBits&=-8),this.eoblock||this.row!==this.rows-1){if(a=this._lookBits(12),this.eoline)for(;a!==pa&&a!==1;)this._eatBits(1),a=this._lookBits(12);else for(;a===0;)this._eatBits(1),a=this._lookBits(12);a===1?(this._eatBits(12),l=!0):a===pa&&(this.eof=!0)}else this.rowsDone=!0;if(!this.eof&&this.encoding>0&&!this.rowsDone&&(this.nextLine2D=!this._lookBits(1),this._eatBits(1)),this.eoblock&&l&&this.byteAlign){if(a=this._lookBits(12),a===1){if(this._eatBits(12),this.encoding>0&&(this._lookBits(1),this._eatBits(1)),this.encoding>=0)for(o=0;o<4;++o)a=this._lookBits(12),a!==1&&hn(`bad rtc code: `+a),this._eatBits(12),this.encoding>0&&(this._lookBits(1),this._eatBits(1));this.eof=!0}}else if(this.err&&this.eoline){for(;;){if(a=this._lookBits(13),a===pa)return this.eof=!0,-1;if(a>>1==1)break;this._eatBits(1)}this._eatBits(12),this.encoding>0&&(this._eatBits(1),this.nextLine2D=!(1&a))}this.outputBits=t[0]>0?t[this.codingPos=0]:t[this.codingPos=1],this.row++}if(this.outputBits>=8)s=1&this.codingPos?0:255,this.outputBits-=8,this.outputBits===0&&t[this.codingPos]<n&&(this.codingPos++,this.outputBits=t[this.codingPos]-t[this.codingPos-1]);else{a=8,s=0;do{if(typeof this.outputBits!=`number`)throw new F(`Invalid /CCITTFaxDecode data, "outputBits" must be a number.`);this.outputBits>a?(s<<=a,1&this.codingPos||(s|=255>>8-a),this.outputBits-=a,a=0):(s<<=this.outputBits,1&this.codingPos||(s|=255>>8-this.outputBits),a-=this.outputBits,this.outputBits=0,t[this.codingPos]<n?(this.codingPos++,this.outputBits=t[this.codingPos]-t[this.codingPos-1]):a>0&&(s<<=a,a=0))}while(a)}return this.black&&(s^=255),s}_addPixels(e,t){let n=this.codingLine,r=this.codingPos;e>n[r]&&(e>this.columns&&(hn(`row is wrong length`),this.err=!0,e=this.columns),1&r^t&&++r,n[r]=e),this.codingPos=r}_addPixelsNeg(e,t){let n=this.codingLine,r=this.codingPos;if(e>n[r])e>this.columns&&(hn(`row is wrong length`),this.err=!0,e=this.columns),1&r^t&&++r,n[r]=e;else if(e<n[r]){for(e<0&&(hn(`invalid code`),this.err=!0,e=0);r>0&&e<n[r-1];)--r;n[r]=e}this.codingPos=r}_findTableCode(e,t,n,r){let i=r||0;for(let r=e;r<=t;++r){let e=this._lookBits(r);if(e===pa)return[!0,1,!1];if(r<t&&(e<<=t-r),!i||e>=i){let t=n[e-i];if(t[0]===r)return this._eatBits(r),[!0,t[1],!0]}}return[!1,0,!1]}_getTwoDimCode(){let e,t=0;if(this.eoblock){if(t=this._lookBits(7),e=ma[t],e?.[0]>0)return this._eatBits(e[0]),e[1]}else{let e=this._findTableCode(1,7,ma);if(e[0]&&e[2])return e[1]}return hn(`Bad two dim code`),pa}_getWhiteCode(){let e,t=0;if(this.eoblock){if(t=this._lookBits(12),t===pa)return 1;if(e=t>>5?ga[t>>3]:ha[t],e[0]>0)return this._eatBits(e[0]),e[1]}else{let e=this._findTableCode(1,9,ga);if(e[0]||(e=this._findTableCode(11,12,ha),e[0]))return e[1]}return hn(`bad white code`),this._eatBits(1),1}_getBlackCode(){let e,t;if(this.eoblock){if(e=this._lookBits(13),e===pa)return 1;if(t=e>>7?!(e>>9)&&e>>7?va[(e>>1)-64]:ya[e>>7]:_a[e],t[0]>0)return this._eatBits(t[0]),t[1]}else{let e=this._findTableCode(2,6,ya);if(e[0]||(e=this._findTableCode(7,12,va,64),e[0])||(e=this._findTableCode(10,13,_a),e[0]))return e[1]}return hn(`bad black code`),this._eatBits(1),1}_lookBits(e){let t;for(;this.inputBits<e;){if((t=this.source.next())===-1)return this.inputBits===0?pa:this.inputBuf<<e-this.inputBits&65535>>16-e;this.inputBuf=this.inputBuf<<8|t,this.inputBits+=8}return this.inputBuf>>this.inputBits-e&65535>>16-e}_eatBits(e){(this.inputBits-=e)<0&&(this.inputBits=0)}},xa=class extends Ti{constructor(e,t,n){super(t),this.str=e,this.dict=e.dict,n instanceof L||(n=L.empty),this.ccittFaxDecoder=new ba({next:()=>e.getByte()},{K:n.get(`K`),EndOfLine:n.get(`EndOfLine`),EncodedByteAlign:n.get(`EncodedByteAlign`),Columns:n.get(`Columns`),Rows:n.get(`Rows`),EndOfBlock:n.get(`EndOfBlock`),BlackIs1:n.get(`BlackIs1`)})}readBlock(){for(;!this.eof;){let e=this.ccittFaxDecoder.readNextChar();if(e===-1)return void(this.eof=!0);this.ensureBuffer(this.bufferLength+1),this.buffer[this.bufferLength++]=e}}},Sa=new Int32Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Ca=new Int32Array([3,4,5,6,7,8,9,10,65547,65549,65551,65553,131091,131095,131099,131103,196643,196651,196659,196667,262211,262227,262243,262259,327811,327843,327875,327907,258,258,258]),wa=new Int32Array([1,2,3,4,65541,65543,131081,131085,196625,196633,262177,262193,327745,327777,393345,393409,459009,459137,524801,525057,590849,591361,657409,658433,724993,727041,794625,798721,868353,876545]),Ta=[new Int32Array([459008,524368,524304,524568,459024,524400,524336,590016,459016,524384,524320,589984,524288,524416,524352,590048,459012,524376,524312,589968,459028,524408,524344,590032,459020,524392,524328,59e4,524296,524424,524360,590064,459010,524372,524308,524572,459026,524404,524340,590024,459018,524388,524324,589992,524292,524420,524356,590056,459014,524380,524316,589976,459030,524412,524348,590040,459022,524396,524332,590008,524300,524428,524364,590072,459009,524370,524306,524570,459025,524402,524338,590020,459017,524386,524322,589988,524290,524418,524354,590052,459013,524378,524314,589972,459029,524410,524346,590036,459021,524394,524330,590004,524298,524426,524362,590068,459011,524374,524310,524574,459027,524406,524342,590028,459019,524390,524326,589996,524294,524422,524358,590060,459015,524382,524318,589980,459031,524414,524350,590044,459023,524398,524334,590012,524302,524430,524366,590076,459008,524369,524305,524569,459024,524401,524337,590018,459016,524385,524321,589986,524289,524417,524353,590050,459012,524377,524313,589970,459028,524409,524345,590034,459020,524393,524329,590002,524297,524425,524361,590066,459010,524373,524309,524573,459026,524405,524341,590026,459018,524389,524325,589994,524293,524421,524357,590058,459014,524381,524317,589978,459030,524413,524349,590042,459022,524397,524333,590010,524301,524429,524365,590074,459009,524371,524307,524571,459025,524403,524339,590022,459017,524387,524323,589990,524291,524419,524355,590054,459013,524379,524315,589974,459029,524411,524347,590038,459021,524395,524331,590006,524299,524427,524363,590070,459011,524375,524311,524575,459027,524407,524343,590030,459019,524391,524327,589998,524295,524423,524359,590062,459015,524383,524319,589982,459031,524415,524351,590046,459023,524399,524335,590014,524303,524431,524367,590078,459008,524368,524304,524568,459024,524400,524336,590017,459016,524384,524320,589985,524288,524416,524352,590049,459012,524376,524312,589969,459028,524408,524344,590033,459020,524392,524328,590001,524296,524424,524360,590065,459010,524372,524308,524572,459026,524404,524340,590025,459018,524388,524324,589993,524292,524420,524356,590057,459014,524380,524316,589977,459030,524412,524348,590041,459022,524396,524332,590009,524300,524428,524364,590073,459009,524370,524306,524570,459025,524402,524338,590021,459017,524386,524322,589989,524290,524418,524354,590053,459013,524378,524314,589973,459029,524410,524346,590037,459021,524394,524330,590005,524298,524426,524362,590069,459011,524374,524310,524574,459027,524406,524342,590029,459019,524390,524326,589997,524294,524422,524358,590061,459015,524382,524318,589981,459031,524414,524350,590045,459023,524398,524334,590013,524302,524430,524366,590077,459008,524369,524305,524569,459024,524401,524337,590019,459016,524385,524321,589987,524289,524417,524353,590051,459012,524377,524313,589971,459028,524409,524345,590035,459020,524393,524329,590003,524297,524425,524361,590067,459010,524373,524309,524573,459026,524405,524341,590027,459018,524389,524325,589995,524293,524421,524357,590059,459014,524381,524317,589979,459030,524413,524349,590043,459022,524397,524333,590011,524301,524429,524365,590075,459009,524371,524307,524571,459025,524403,524339,590023,459017,524387,524323,589991,524291,524419,524355,590055,459013,524379,524315,589975,459029,524411,524347,590039,459021,524395,524331,590007,524299,524427,524363,590071,459011,524375,524311,524575,459027,524407,524343,590031,459019,524391,524327,589999,524295,524423,524359,590063,459015,524383,524319,589983,459031,524415,524351,590047,459023,524399,524335,590015,524303,524431,524367,590079]),9],Ea=[new Int32Array([327680,327696,327688,327704,327684,327700,327692,327708,327682,327698,327690,327706,327686,327702,327694,0,327681,327697,327689,327705,327685,327701,327693,327709,327683,327699,327691,327707,327687,327703,327695,0]),5],Da=class extends Ti{constructor(e,t){super(t),this.str=e,this.dict=e.dict;let n=e.getByte(),r=e.getByte();if(n===-1||r===-1)throw new F(`Invalid header in flate stream: ${n}, ${r}`);if((15&n)!=8)throw new F(`Unknown compression method in flate stream: ${n}, ${r}`);if(((n<<8)+r)%31!=0)throw new F(`Bad FCHECK in flate stream: ${n}, ${r}`);if(32&r)throw new F(`FDICT bit set in flate stream: ${n}, ${r}`);this.codeSize=0,this.codeBuf=0}async getImageData(e,t){let n=await this.asyncGetBytes();return n?n.length<=e?n:n.subarray(0,e):this.getBytes(e)}async asyncGetBytes(){this.str.reset();let e=this.str.getBytes();try{let{readable:t,writable:n}=new DecompressionStream(`deflate`),r=n.getWriter();await r.ready,r.write(e).then(async()=>{await r.ready,await r.close()}).catch(()=>{});let i=[],a=0;for await(let e of t)i.push(e),a+=e.byteLength;let o=new Uint8Array(a),s=0;for(let e of i)o.set(e,s),s+=e.byteLength;return o}catch{return this.str=new gi(e,2,e.length,this.str.dict),this.reset(),null}}get isAsync(){return!0}getBits(e){let t=this.str,n,r=this.codeSize,i=this.codeBuf;for(;r<e;){if((n=t.getByte())===-1)throw new F(`Bad encoding in flate stream`);i|=n<<r,r+=8}return n=i&(1<<e)-1,this.codeBuf=i>>e,this.codeSize=r-=e,n}getCode(e){let t=this.str,n=e[0],r=e[1],i,a=this.codeSize,o=this.codeBuf;for(;a<r&&(i=t.getByte())!==-1;)o|=i<<a,a+=8;let s=n[o&(1<<r)-1],c=s>>16,l=65535&s;if(c<1||a<c)throw new F(`Bad encoding in flate stream`);return this.codeBuf=o>>c,this.codeSize=a-c,l}generateHuffmanTable(e){let t=e.length,n,r=0;for(n=0;n<t;++n)e[n]>r&&(r=e[n]);let i=1<<r,a=new Int32Array(i);for(let o=1,s=0,c=2;o<=r;++o,s<<=1,c<<=1)for(let r=0;r<t;++r)if(e[r]===o){let e=0,t=s;for(n=0;n<o;++n)e=e<<1|1&t,t>>=1;for(n=e;n<i;n+=c)a[n]=o<<16|r;++s}return[a,r]}#e(e){hn(e),this.eof=!0}readBlock(){let e,t,n,r=this.str;try{t=this.getBits(3)}catch(e){this.#e(e.message);return}if(1&t&&(this.eof=!0),t>>=1,t===0){let t;if((t=r.getByte())===-1)return void this.#e(`Bad block header in flate stream`);let n=t;if((t=r.getByte())===-1||(n|=t<<8,(t=r.getByte())===-1))return void this.#e(`Bad block header in flate stream`);let i=t;if((t=r.getByte())===-1)return void this.#e(`Bad block header in flate stream`);if(i|=t<<8,i!==(65535&~n)&&(n!==0||i!==0))throw new F(`Bad uncompressed block length in flate stream`);this.codeBuf=0,this.codeSize=0;let a=this.bufferLength,o=a+n;if(e=this.ensureBuffer(o),this.bufferLength=o,n===0)r.peekByte()===-1&&(this.eof=!0);else{let t=r.getBytes(n);e.set(t,a),t.length<n&&(this.eof=!0)}return}let i,a;if(t===1)i=Ta,a=Ea;else{if(t!==2)throw new F(`Unknown block type in flate stream`);{let e=this.getBits(5)+257,t=this.getBits(5)+1,r=this.getBits(4)+4,o=new Uint8Array(Sa.length),s;for(s=0;s<r;++s)o[Sa[s]]=this.getBits(3);let c=this.generateHuffmanTable(o);n=0,s=0;let l=e+t,u=new Uint8Array(l),d,f,p;for(;s<l;){let e=this.getCode(c);if(e===16)d=2,f=3,p=n;else if(e===17)d=3,f=3,p=n=0;else{if(e!==18){u[s++]=n=e;continue}d=7,f=11,p=n=0}let t=this.getBits(d)+f;for(;t-- >0;)u[s++]=p}i=this.generateHuffmanTable(u.subarray(0,e)),a=this.generateHuffmanTable(u.subarray(e,l))}}e=this.buffer;let o=e?e.length:0,s=this.bufferLength;for(;;){let t=this.getCode(i);if(t<256){s+1>=o&&(e=this.ensureBuffer(s+1),o=e.length),e[s++]=t;continue}if(t===256)return void(this.bufferLength=s);t-=257,t=Ca[t];let r=t>>16;r>0&&(r=this.getBits(r)),n=(65535&t)+r,t=this.getCode(a),t=wa[t],r=t>>16,r>0&&(r=this.getBits(r));let c=(65535&t)+r;s+n>=o&&(e=this.ensureBuffer(s+n),o=e.length);for(let t=0;t<n;++t,++s)e[s]=e[s-c]}}},Oa=[{qe:22017,nmps:1,nlps:1,switchFlag:1},{qe:13313,nmps:2,nlps:6,switchFlag:0},{qe:6145,nmps:3,nlps:9,switchFlag:0},{qe:2753,nmps:4,nlps:12,switchFlag:0},{qe:1313,nmps:5,nlps:29,switchFlag:0},{qe:545,nmps:38,nlps:33,switchFlag:0},{qe:22017,nmps:7,nlps:6,switchFlag:1},{qe:21505,nmps:8,nlps:14,switchFlag:0},{qe:18433,nmps:9,nlps:14,switchFlag:0},{qe:14337,nmps:10,nlps:14,switchFlag:0},{qe:12289,nmps:11,nlps:17,switchFlag:0},{qe:9217,nmps:12,nlps:18,switchFlag:0},{qe:7169,nmps:13,nlps:20,switchFlag:0},{qe:5633,nmps:29,nlps:21,switchFlag:0},{qe:22017,nmps:15,nlps:14,switchFlag:1},{qe:21505,nmps:16,nlps:14,switchFlag:0},{qe:20737,nmps:17,nlps:15,switchFlag:0},{qe:18433,nmps:18,nlps:16,switchFlag:0},{qe:14337,nmps:19,nlps:17,switchFlag:0},{qe:13313,nmps:20,nlps:18,switchFlag:0},{qe:12289,nmps:21,nlps:19,switchFlag:0},{qe:10241,nmps:22,nlps:19,switchFlag:0},{qe:9217,nmps:23,nlps:20,switchFlag:0},{qe:8705,nmps:24,nlps:21,switchFlag:0},{qe:7169,nmps:25,nlps:22,switchFlag:0},{qe:6145,nmps:26,nlps:23,switchFlag:0},{qe:5633,nmps:27,nlps:24,switchFlag:0},{qe:5121,nmps:28,nlps:25,switchFlag:0},{qe:4609,nmps:29,nlps:26,switchFlag:0},{qe:4353,nmps:30,nlps:27,switchFlag:0},{qe:2753,nmps:31,nlps:28,switchFlag:0},{qe:2497,nmps:32,nlps:29,switchFlag:0},{qe:2209,nmps:33,nlps:30,switchFlag:0},{qe:1313,nmps:34,nlps:31,switchFlag:0},{qe:1089,nmps:35,nlps:32,switchFlag:0},{qe:673,nmps:36,nlps:33,switchFlag:0},{qe:545,nmps:37,nlps:34,switchFlag:0},{qe:321,nmps:38,nlps:35,switchFlag:0},{qe:273,nmps:39,nlps:36,switchFlag:0},{qe:133,nmps:40,nlps:37,switchFlag:0},{qe:73,nmps:41,nlps:38,switchFlag:0},{qe:37,nmps:42,nlps:39,switchFlag:0},{qe:21,nmps:43,nlps:40,switchFlag:0},{qe:9,nmps:44,nlps:41,switchFlag:0},{qe:5,nmps:45,nlps:42,switchFlag:0},{qe:1,nmps:45,nlps:43,switchFlag:0},{qe:22017,nmps:46,nlps:46,switchFlag:0}],ka=class{constructor(e,t,n){this.data=e,this.bp=t,this.dataEnd=n,this.chigh=e[t],this.clow=0,this.byteIn(),this.chigh=this.chigh<<7&65535|this.clow>>9&127,this.clow=this.clow<<7&65535,this.ct-=7,this.a=32768}byteIn(){let e=this.data,t=this.bp;e[t]===255?e[t+1]>143?(this.clow+=65280,this.ct=8):(t++,this.clow+=e[t]<<9,this.ct=7,this.bp=t):(t++,this.clow+=t<this.dataEnd?e[t]<<8:65280,this.ct=8,this.bp=t),this.clow>65535&&(this.chigh+=this.clow>>16,this.clow&=65535)}readBit(e,t){let n=e[t]>>1,r=1&e[t],i=Oa[n],a=i.qe,o,s=this.a-a;if(this.chigh<a)s<a?(s=a,o=r,n=i.nmps):(s=a,o=1^r,i.switchFlag===1&&(r=o),n=i.nlps);else{if(this.chigh-=a,32768&s)return this.a=s,r;s<a?(o=1^r,i.switchFlag===1&&(r=o),n=i.nlps):(o=r,n=i.nmps)}do this.ct===0&&this.byteIn(),s<<=1,this.chigh=this.chigh<<1&65535|this.clow>>15&1,this.clow=this.clow<<1&65535,this.ct--;while(!(32768&s));return this.a=s,e[t]=n<<1|r,o}},Aa=class extends yn{constructor(e){super(e,`Jbig2Error`)}},ja=class{getContexts(e){return e in this?this[e]:this[e]=new Int8Array(65536)}},Ma=class{constructor(e,t,n){this.data=e,this.start=t,this.end=n}get decoder(){return P(this,`decoder`,new ka(this.data,this.start,this.end))}get contextCache(){return P(this,`contextCache`,new ja)}};function Na(e,t,n){let r=e.getContexts(t),i=1;function a(e){let t=0;for(let a=0;a<e;a++){let e=n.readBit(r,i);i=i<256?i<<1|e:511&(i<<1|e)|256,t=t<<1|e}return t>>>0}let o=a(1),s=a(1)?a(1)?a(1)?a(1)?a(1)?a(32)+4436:a(12)+340:a(8)+84:a(6)+20:a(4)+4:a(2),c;return o===0?c=s:s>0&&(c=-s),c>=-2147483648&&c<=rr?c:null}function Pa(e,t,n){let r=e.getContexts(`IAID`),i=1;for(let e=0;e<n;e++)i=i<<1|t.readBit(r,i);return n<31?i&(1<<n)-1:2147483647&i}var Fa=[`SymbolDictionary`,null,null,null,`IntermediateTextRegion`,null,`ImmediateTextRegion`,`ImmediateLosslessTextRegion`,null,null,null,null,null,null,null,null,`PatternDictionary`,null,null,null,`IntermediateHalftoneRegion`,null,`ImmediateHalftoneRegion`,`ImmediateLosslessHalftoneRegion`,null,null,null,null,null,null,null,null,null,null,null,null,`IntermediateGenericRegion`,null,`ImmediateGenericRegion`,`ImmediateLosslessGenericRegion`,`IntermediateGenericRefinementRegion`,null,`ImmediateGenericRefinementRegion`,`ImmediateLosslessGenericRefinementRegion`,null,null,null,null,`PageInformation`,`EndOfPage`,`EndOfStripe`,`EndOfFile`,`Profiles`,`Tables`,null,null,null,null,null,null,null,null,`Extension`],Ia=[[{x:-1,y:-2},{x:0,y:-2},{x:1,y:-2},{x:-2,y:-1},{x:-1,y:-1},{x:0,y:-1},{x:1,y:-1},{x:2,y:-1},{x:-4,y:0},{x:-3,y:0},{x:-2,y:0},{x:-1,y:0}],[{x:-1,y:-2},{x:0,y:-2},{x:1,y:-2},{x:2,y:-2},{x:-2,y:-1},{x:-1,y:-1},{x:0,y:-1},{x:1,y:-1},{x:2,y:-1},{x:-3,y:0},{x:-2,y:0},{x:-1,y:0}],[{x:-1,y:-2},{x:0,y:-2},{x:1,y:-2},{x:-2,y:-1},{x:-1,y:-1},{x:0,y:-1},{x:1,y:-1},{x:-2,y:0},{x:-1,y:0}],[{x:-3,y:-1},{x:-2,y:-1},{x:-1,y:-1},{x:0,y:-1},{x:1,y:-1},{x:-4,y:0},{x:-3,y:0},{x:-2,y:0},{x:-1,y:0}]],La=[{coding:[{x:0,y:-1},{x:1,y:-1},{x:-1,y:0}],reference:[{x:0,y:-1},{x:1,y:-1},{x:-1,y:0},{x:0,y:0},{x:1,y:0},{x:-1,y:1},{x:0,y:1},{x:1,y:1}]},{coding:[{x:-1,y:-1},{x:0,y:-1},{x:1,y:-1},{x:-1,y:0}],reference:[{x:0,y:-1},{x:-1,y:0},{x:0,y:0},{x:1,y:0},{x:0,y:1},{x:1,y:1}]}],Ra=[39717,1941,229,405];function za(e,t,n,r,i,a,o,s){if(e)return ro(new eo(s.data,s.start,s.end),t,n,!1);if(r===0&&!i&&o.length===4&&o[0].x===3&&o[0].y===-1&&o[1].x===-3&&o[1].y===-1&&o[2].x===2&&o[2].y===-2&&o[3].x===-2&&o[3].y===-2)return function(e,t,n){let r=n.decoder,i=n.contextCache.getContexts(`GB`),a=[],o,s,c,l,u,d,f;for(s=0;s<t;s++)for(u=a[s]=new Uint8Array(e),d=s<1?u:a[s-1],f=s<2?u:a[s-2],o=f[0]<<13|f[1]<<12|f[2]<<11|d[0]<<7|d[1]<<6|d[2]<<5|d[3]<<4,c=0;c<e;c++)u[c]=l=r.readBit(i,o),o=(31735&o)<<1|(c+3<e?f[c+3]<<11:0)|(c+4<e?d[c+4]<<4:0)|l;return a}(t,n,s);let c=Ia[r].concat(o);c.sort((e,t)=>e.y-t.y||e.x-t.x);let l=c.length,u=new Int8Array(l),d=new Int8Array(l),f=[],p,m,h=0,g=0,_=0,v=0;for(m=0;m<l;m++)u[m]=c[m].x,d[m]=c[m].y,g=Math.min(g,c[m].x),_=Math.max(_,c[m].x),v=Math.min(v,c[m].y),m<l-1&&c[m].y===c[m+1].y&&c[m].x===c[m+1].x-1?h|=1<<l-1-m:f.push(m);let y=f.length,b=new Int8Array(y),x=new Int8Array(y),S=new Uint16Array(y);for(p=0;p<y;p++)m=f[p],b[p]=c[m].x,x[p]=c[m].y,S[p]=1<<l-1-m;let C=-g,w=-v,T=t-_,E=Ra[r],D=new Uint8Array(t),O=[],k=s.decoder,ee=s.contextCache.getContexts(`GB`),A,j,M,te,ne,re=0,ie=0;for(let e=0;e<n;e++){if(i&&(re^=k.readBit(ee,E),re)){O.push(D);continue}for(D=new Uint8Array(D),O.push(D),A=0;A<t;A++){if(A>=C&&A<T&&e>=w)for(ie=ie<<1&h,m=0;m<y;m++)j=e+x[m],M=A+b[m],te=O[j][M],te&&(te=S[m],ie|=te);else for(ie=0,ne=l-1,m=0;m<l;m++,ne--)M=A+u[m],M>=0&&M<t&&(j=e+d[m],j>=0&&(te=O[j][M],te&&(ie|=te<<ne)));let n=k.readBit(ee,ie);D[A]=n}}return O}function Ba(e,t,n,r,i,a,o,s,c){let l=La[n].coding;n===0&&(l=l.concat([s[0]]));let u=l.length,d=new Int32Array(u),f=new Int32Array(u),p;for(p=0;p<u;p++)d[p]=l[p].x,f[p]=l[p].y;let m=La[n].reference;n===0&&(m=m.concat([s[1]]));let h=m.length,g=new Int32Array(h),_=new Int32Array(h);for(p=0;p<h;p++)g[p]=m[p].x,_[p]=m[p].y;let v=r[0].length,y=r.length,b=[],x=c.decoder,S=c.contextCache.getContexts(`GR`);for(let n=0;n<t;n++){let t=new Uint8Array(e);b.push(t);for(let o=0;o<e;o++){let s,c,l=0;for(p=0;p<u;p++)s=n+f[p],c=o+d[p],s<0||c<0||c>=e?l<<=1:l=l<<1|b[s][c];for(p=0;p<h;p++)s=n+_[p]-a,c=o+g[p]-i,s<0||s>=y||c<0||c>=v?l<<=1:l=l<<1|r[s][c];t[o]=x.readBit(S,l)}}return b}function Va(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v){if(e&&t)throw new Aa(`refinement with Huffman is not supported`);let y=[],b,x;for(b=0;b<r;b++)x=new Uint8Array(n),i&&x.fill(i),y.push(x);let S=g.decoder,C=g.contextCache,w=e?-p.tableDeltaT.decode(v):-Na(C,`IADT`,S),T=0;for(b=0;b<a;){w+=e?p.tableDeltaT.decode(v):Na(C,`IADT`,S),T+=e?p.tableFirstS.decode(v):Na(C,`IAFS`,S);let r=T;for(;;){let i=0;o>1&&(i=e?v.readBits(_):Na(C,`IAIT`,S));let a=o*w+i,T=e?p.symbolIDTable.decode(v):Pa(C,S,c),E=t&&(e?v.readBit():Na(C,`IARI`,S)),D=s[T],O=D[0].length,k=D.length;if(E){let e=Na(C,`IARDW`,S),t=Na(C,`IARDH`,S);O+=e,k+=t,D=Ba(O,k,m,D,(e>>1)+Na(C,`IARDX`,S),(t>>1)+Na(C,`IARDY`,S),0,h,g)}let ee=0;l?1&d?ee=k-1:r+=k-1:d>1?r+=O-1:ee=O-1;let A=a-(1&d?0:k-1),j=r-(2&d?O-1:0),M,te,ne;if(l)for(M=0;M<k;M++){if(x=y[j+M],!x)continue;ne=D[M];let e=Math.min(n-A,O);switch(f){case 0:for(te=0;te<e;te++)x[A+te]|=ne[te];break;case 2:for(te=0;te<e;te++)x[A+te]^=ne[te];break;default:throw new Aa(`operator ${f} is not supported`)}}else for(te=0;te<k;te++)if(x=y[A+te],x)switch(ne=D[te],f){case 0:for(M=0;M<O;M++)x[j+M]|=ne[M];break;case 2:for(M=0;M<O;M++)x[j+M]^=ne[M];break;default:throw new Aa(`operator ${f} is not supported`)}b++;let re=e?p.tableDeltaS.decode(v):Na(C,`IADS`,S);if(re===null)break;r+=ee+re+u}}return y}function Ha(e,t){let n={};n.number=xr(e,t);let r=e[t+4],i=63&r;if(!Fa[i])throw new Aa(`invalid segment type: `+i);n.type=i,n.typeName=Fa[i],n.deferredNonRetain=!!(128&r);let a=!!(64&r),o=e[t+5],s=o>>5&7,c=[31&o],l=t+6;if(o===7){s=536870911&xr(e,l-1),l+=3;let t=s+7>>3;for(c[0]=e[l++];--t>0;)c.push(e[l++])}else if(o===5||o===6)throw new Aa(`invalid referred-to flags`);n.retainBits=c;let u=4;n.number<=256?u=1:n.number<=65536&&(u=2);let d=[],f,p;for(f=0;f<s;f++){let t;t=u===1?e[l]:u===2?br(e,l):xr(e,l),d.push(t),l+=u}if(n.referredTo=d,a?(n.pageAssociation=xr(e,l),l+=4):n.pageAssociation=e[l++],n.length=xr(e,l),l+=4,n.length===4294967295){if(i!==38)throw new Aa(`invalid unknown segment length`);{let t=Wa(e,l),r=!!(1&e[l+Ga]),i=new Uint8Array(6);for(r||(i[0]=255,i[1]=172),i[2]=t.height>>>24&255,i[3]=t.height>>16&255,i[4]=t.height>>8&255,i[5]=255&t.height,f=l,p=e.length;f<p;f++){let t=0;for(;t<6&&i[t]===e[f+t];)t++;if(t===6){n.length=f+6;break}}if(n.length===4294967295)throw new Aa(`segment end was not found`)}}return n.headerEnd=l,n}function Ua(e,t,n,r){let i=[],a=n;for(;a<r;){let n=Ha(t,a);a=n.headerEnd;let r={header:n,data:t};if(e.randomAccess||(r.start=a,a+=n.length,r.end=a),i.push(r),n.type===51)break}if(e.randomAccess)for(let e=0,t=i.length;e<t;e++)i[e].start=a,a+=i[e].header.length,i[e].end=a;return i}function Wa(e,t){return{width:xr(e,t),height:xr(e,t+4),x:xr(e,t+8),y:xr(e,t+12),combinationOperator:7&e[t+16]}}var Ga=17;function Ka(e,t){let n=e.header,r=e.data,i=e.end,a,o,s,c,l=e.start;switch(n.type){case 0:let e={},t=br(r,l);if(e.huffman=!!(1&t),e.refinement=!!(2&t),e.huffmanDHSelector=t>>2&3,e.huffmanDWSelector=t>>4&3,e.bitmapSizeSelector=t>>6&1,e.aggregationInstancesSelector=t>>7&1,e.bitmapCodingContextUsed=!!(256&t),e.bitmapCodingContextRetained=!!(512&t),e.template=t>>10&3,e.refinementTemplate=t>>12&1,l+=2,!e.huffman){for(c=e.template===0?4:1,o=[],s=0;s<c;s++)o.push({x:vr(r,l),y:vr(r,l+1)}),l+=2;e.at=o}if(e.refinement&&!e.refinementTemplate){for(o=[],s=0;s<2;s++)o.push({x:vr(r,l),y:vr(r,l+1)}),l+=2;e.refinementAt=o}e.numberOfExportedSymbols=xr(r,l),l+=4,e.numberOfNewSymbols=xr(r,l),l+=4,a=[e,n.number,n.referredTo,r,l,i];break;case 6:case 7:let u={};u.info=Wa(r,l),l+=Ga;let d=br(r,l);if(l+=2,u.huffman=!!(1&d),u.refinement=!!(2&d),u.logStripSize=d>>2&3,u.stripSize=1<<u.logStripSize,u.referenceCorner=d>>4&3,u.transposed=!!(64&d),u.combinationOperator=d>>7&3,u.defaultPixelValue=d>>9&1,u.dsOffset=d<<17>>27,u.refinementTemplate=d>>15&1,u.huffman){let e=br(r,l);l+=2,u.huffmanFS=3&e,u.huffmanDS=e>>2&3,u.huffmanDT=e>>4&3,u.huffmanRefinementDW=e>>6&3,u.huffmanRefinementDH=e>>8&3,u.huffmanRefinementDX=e>>10&3,u.huffmanRefinementDY=e>>12&3,u.huffmanRefinementSizeSelector=!!(16384&e)}if(u.refinement&&!u.refinementTemplate){for(o=[],s=0;s<2;s++)o.push({x:vr(r,l),y:vr(r,l+1)}),l+=2;u.refinementAt=o}u.numberOfSymbolInstances=xr(r,l),l+=4,a=[u,n.referredTo,r,l,i];break;case 16:let f={},p=r[l++];f.mmr=!!(1&p),f.template=p>>1&3,f.patternWidth=r[l++],f.patternHeight=r[l++],f.maxPatternIndex=xr(r,l),l+=4,a=[f,n.number,r,l,i];break;case 22:case 23:let m={};m.info=Wa(r,l),l+=Ga;let h=r[l++];m.mmr=!!(1&h),m.template=h>>1&3,m.enableSkip=!!(8&h),m.combinationOperator=h>>4&7,m.defaultPixelValue=h>>7&1,m.gridWidth=xr(r,l),l+=4,m.gridHeight=xr(r,l),l+=4,m.gridOffsetX=4294967295&xr(r,l),l+=4,m.gridOffsetY=4294967295&xr(r,l),l+=4,m.gridVectorX=br(r,l),l+=2,m.gridVectorY=br(r,l),l+=2,a=[m,n.referredTo,r,l,i];break;case 38:case 39:let g={};g.info=Wa(r,l),l+=Ga;let _=r[l++];if(g.mmr=!!(1&_),g.template=_>>1&3,g.prediction=!!(8&_),!g.mmr){for(c=g.template===0?4:1,o=[],s=0;s<c;s++)o.push({x:vr(r,l),y:vr(r,l+1)}),l+=2;g.at=o}a=[g,r,l,i];break;case 48:let v={width:xr(r,l),height:xr(r,l+4),resolutionX:xr(r,l+8),resolutionY:xr(r,l+12)};v.height===4294967295&&delete v.height;let y=r[l+16];br(r,l+17),v.lossless=!!(1&y),v.refinement=!!(2&y),v.defaultPixelValue=y>>2&1,v.combinationOperator=y>>3&3,v.requiresBuffer=!!(32&y),v.combinationOperatorOverride=!!(64&y),a=[v];break;case 49:case 50:case 51:case 62:break;case 53:a=[n.number,r,l,i];break;default:throw new Aa(`segment type ${n.typeName}(${n.type}) is not implemented`)}let u=`on`+n.typeName;u in t&&t[u].apply(t,a)}function qa(e,t){for(let n=0,r=e.length;n<r;n++)Ka(e[n],t)}var Ja=class{onPageInformation(e){this.currentPageInfo=e;let t=e.width+7>>3,n=new Uint8ClampedArray(t*e.height);e.defaultPixelValue&&n.fill(255),this.buffer=n}drawBitmap(e,t){let n=this.currentPageInfo,r=e.width,i=e.height,a=n.width+7>>3,o=n.combinationOperatorOverride?e.combinationOperator:n.combinationOperator,s=this.buffer,c=128>>(7&e.x),l,u,d,f,p=e.y*a+(e.x>>3);switch(o){case 0:for(l=0;l<i;l++){for(d=c,f=p,u=0;u<r;u++)t[l][u]&&(s[f]|=d),d>>=1,d||(d=128,f++);p+=a}break;case 2:for(l=0;l<i;l++){for(d=c,f=p,u=0;u<r;u++)t[l][u]&&(s[f]^=d),d>>=1,d||(d=128,f++);p+=a}break;default:throw new Aa(`operator ${o} is not supported`)}}onImmediateGenericRegion(e,t,n,r){let i=e.info,a=new Ma(t,n,r),o=za(e.mmr,i.width,i.height,e.template,e.prediction,0,e.at,a);this.drawBitmap(i,o)}onImmediateLosslessGenericRegion(){this.onImmediateGenericRegion(...arguments)}onSymbolDictionary(e,t,n,r,i,a){let o,s;e.huffman&&(o=function(e,t,n){let r,i,a,o,s=0;switch(e.huffmanDHSelector){case 0:case 1:r=$a(e.huffmanDHSelector+4);break;case 3:r=to(s,t,n),s++;break;default:throw new Aa(`invalid Huffman DH selector`)}switch(e.huffmanDWSelector){case 0:case 1:i=$a(e.huffmanDWSelector+2);break;case 3:i=to(s,t,n),s++;break;default:throw new Aa(`invalid Huffman DW selector`)}return e.bitmapSizeSelector?(a=to(s,t,n),s++):a=$a(1),o=e.aggregationInstancesSelector?to(s,t,n):$a(1),{tableDeltaHeight:r,tableDeltaWidth:i,tableBitmapSize:a,tableAggregateInstances:o}}(e,n,this.customTables),s=new eo(r,i,a));let c=this.symbols;c||(this.symbols=c={});let l=[];for(let e of n){let t=c[e];t&&l.push(...t)}let u=new Ma(r,i,a);c[t]=function(e,t,n,r,i,a,o,s,c,l,u,d){if(e&&t)throw new Aa(`symbol refinement with Huffman is not supported`);let f=[],p=0,m=_r(n.length+r),h=u.decoder,g=u.contextCache,_,v;for(e&&(_=$a(1),v=[],m=Math.max(m,1));f.length<r;){p+=e?a.tableDeltaHeight.decode(d):Na(g,`IADH`,h);let r=0,i=0,_=e?v.length:0;for(;;){let _=e?a.tableDeltaWidth.decode(d):Na(g,`IADW`,h);if(_===null)break;let y;if(r+=_,i+=r,t){let i=Na(g,`IAAI`,h);if(i>1)y=Va(e,t,r,p,0,i,1,n.concat(f),m,0,0,1,0,a,c,l,u,0,d);else{let e=Pa(g,h,m),t=Na(g,`IARDX`,h),i=Na(g,`IARDY`,h);y=Ba(r,p,c,e<n.length?n[e]:f[e-n.length],t,i,0,l,u)}f.push(y)}else e?v.push(r):(y=za(!1,r,p,o,!1,0,s,u),f.push(y))}if(e&&!t){let e=a.tableBitmapSize.decode(d),t;if(d.byteAlign(),e===0)t=no(d,i,p);else{let n=d.end,r=d.position+e;d.end=r,t=ro(d,i,p,!1),d.end=n,d.position=r}let n=v.length;if(_===n-1)f.push(t);else{let e,r,i,a,o,s=0;for(e=_;e<n;e++){for(a=v[e],i=s+a,o=[],r=0;r<p;r++)o.push(t[r].subarray(s,i));f.push(o),s=i}}}}let y=[],b=[],x,S,C=!1,w=n.length+r;for(;b.length<w;){let t=e?_.decode(d):Na(g,`IAEX`,h);for(;t--;)b.push(C);C=!C}for(x=0,S=n.length;x<S;x++)b[x]&&y.push(n[x]);for(let e=0;e<r;x++,e++)b[x]&&y.push(f[e]);return y}(e.huffman,e.refinement,l,e.numberOfNewSymbols,e.numberOfExportedSymbols,o,e.template,e.at,e.refinementTemplate,e.refinementAt,u,s)}onImmediateTextRegion(e,t,n,r,i){let a=e.info,o,s,c=this.symbols,l=[];for(let e of t){let t=c[e];t&&l.push(...t)}let u=_r(l.length);e.huffman&&(s=new eo(n,r,i),o=function(e,t,n,r,i){let a=[];for(let e=0;e<=34;e++){let t=i.readBits(4);a.push(new Ya([e,t,0,0]))}let o=new Za(a,!1);a.length=0;for(let e=0;e<r;){let t=o.decode(i);if(t>=32){let n,r,o;switch(t){case 32:if(e===0)throw new Aa(`no previous value in symbol ID table`);r=i.readBits(2)+3,n=a[e-1].prefixLength;break;case 33:r=i.readBits(3)+3,n=0;break;case 34:r=i.readBits(7)+11,n=0;break;default:throw new Aa(`invalid code length in symbol ID table`)}for(o=0;o<r;o++)a.push(new Ya([e,n,0,0])),e++}else a.push(new Ya([e,t,0,0])),e++}i.byteAlign();let s=new Za(a,!1),c,l,u,d=0;switch(e.huffmanFS){case 0:case 1:c=$a(e.huffmanFS+6);break;case 3:c=to(d,t,n),d++;break;default:throw new Aa(`invalid Huffman FS selector`)}switch(e.huffmanDS){case 0:case 1:case 2:l=$a(e.huffmanDS+8);break;case 3:l=to(d,t,n),d++;break;default:throw new Aa(`invalid Huffman DS selector`)}switch(e.huffmanDT){case 0:case 1:case 2:u=$a(e.huffmanDT+11);break;case 3:u=to(d,t,n),d++;break;default:throw new Aa(`invalid Huffman DT selector`)}if(e.refinement)throw new Aa(`refinement with Huffman is not supported`);return{symbolIDTable:s,tableFirstS:c,tableDeltaS:l,tableDeltaT:u}}(e,t,this.customTables,l.length,s));let d=new Ma(n,r,i),f=Va(e.huffman,e.refinement,a.width,a.height,e.defaultPixelValue,e.numberOfSymbolInstances,e.stripSize,l,u,e.transposed,e.dsOffset,e.referenceCorner,e.combinationOperator,o,e.refinementTemplate,e.refinementAt,d,e.logStripSize,s);this.drawBitmap(a,f)}onImmediateLosslessTextRegion(){this.onImmediateTextRegion(...arguments)}onPatternDictionary(e,t,n,r,i){let a=this.patterns;a||(this.patterns=a={});let o=new Ma(n,r,i);a[t]=function(e,t,n,r,i,a){let o=[];e||(o.push({x:-t,y:0}),i===0&&o.push({x:-3,y:-1},{x:2,y:-2},{x:-2,y:-2}));let s=za(e,(r+1)*t,n,i,!1,0,o,a),c=[];for(let e=0;e<=r;e++){let r=[],i=t*e,a=i+t;for(let e=0;e<n;e++)r.push(s[e].subarray(i,a));c.push(r)}return c}(e.mmr,e.patternWidth,e.patternHeight,e.maxPatternIndex,e.template,o)}onImmediateHalftoneRegion(e,t,n,r,i){let a=this.patterns[t[0]],o=e.info,s=new Ma(n,r,i),c=function(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m){if(o)throw new Aa(`skip is not supported`);if(s!==0)throw new Aa(`operator "${s}" is not supported in halftone region`);let h=[],g,_,v;for(g=0;g<i;g++)v=new Uint8Array(r),a&&v.fill(a),h.push(v);let y=t.length,b=t[0],x=b[0].length,S=b.length,C=_r(y),w=[];e||(w.push({x:n<=1?3:2,y:-1}),n===0&&w.push({x:-3,y:-1},{x:2,y:-2},{x:-2,y:-2}));let T=[],E,D,O,k,ee,A,j,M,te,ne,re;for(e&&(E=new eo(m.data,m.start,m.end)),g=C-1;g>=0;g--)D=e?ro(E,c,l,!0):za(!1,c,l,n,!1,0,w,m),T[g]=D;for(O=0;O<l;O++)for(k=0;k<c;k++){for(ee=0,A=0,_=C-1;_>=0;_--)ee^=T[_][O][k],A|=ee<<_;if(j=t[A],M=u+O*p+k*f>>8,te=d+O*f-k*p>>8,M>=0&&M+x<=r&&te>=0&&te+S<=i)for(g=0;g<S;g++)for(re=h[te+g],ne=j[g],_=0;_<x;_++)re[M+_]|=ne[_];else{let e,t;for(g=0;g<S;g++)if(t=te+g,!(t<0||t>=i))for(re=h[t],ne=j[g],_=0;_<x;_++)e=M+_,e>=0&&e<r&&(re[e]|=ne[_])}}return h}(e.mmr,a,e.template,o.width,o.height,e.defaultPixelValue,e.enableSkip,e.combinationOperator,e.gridWidth,e.gridHeight,e.gridOffsetX,e.gridOffsetY,e.gridVectorX,e.gridVectorY,s);this.drawBitmap(o,c)}onImmediateLosslessHalftoneRegion(){this.onImmediateHalftoneRegion(...arguments)}onTables(e,t,n,r){let i=this.customTables;i||(this.customTables=i={}),i[e]=function(e,t,n){let r=e[t],i=4294967295&xr(e,t+1),a=4294967295&xr(e,t+5),o=new eo(e,t+9,n),s=1+(r>>1&7),c=1+(r>>4&7),l=[],u,d,f=i;do u=o.readBits(s),d=o.readBits(c),l.push(new Ya([f,u,d,0])),f+=1<<d;while(f<a);return u=o.readBits(s),l.push(new Ya([i-1,u,32,0,`lower`])),u=o.readBits(s),l.push(new Ya([a,u,32,0])),1&r&&(u=o.readBits(s),l.push(new Ya([u,0]))),new Za(l,!1)}(t,n,r)}},Ya=class{constructor(e){e.length===2?(this.isOOB=!0,this.rangeLow=0,this.prefixLength=e[0],this.rangeLength=0,this.prefixCode=e[1],this.isLowerRange=!1):(this.isOOB=!1,this.rangeLow=e[0],this.prefixLength=e[1],this.rangeLength=e[2],this.prefixCode=e[3],this.isLowerRange=e[4]===`lower`)}},Xa=class e{constructor(e){this.children=[],e?(this.isLeaf=!0,this.rangeLength=e.rangeLength,this.rangeLow=e.rangeLow,this.isLowerRange=e.isLowerRange,this.isOOB=e.isOOB):this.isLeaf=!1}buildTree(t,n){let r=t.prefixCode>>n&1;if(n<=0)this.children[r]=new e(t);else{let i=this.children[r];i||(this.children[r]=i=new e(null)),i.buildTree(t,n-1)}}decodeNode(e){if(this.isLeaf){if(this.isOOB)return null;let t=e.readBits(this.rangeLength);return this.rangeLow+(this.isLowerRange?-t:t)}let t=this.children[e.readBit()];if(!t)throw new Aa(`invalid Huffman data`);return t.decodeNode(e)}},Za=class{constructor(e,t){t||this.assignPrefixCodes(e),this.rootNode=new Xa(null);for(let t=0,n=e.length;t<n;t++){let n=e[t];n.prefixLength>0&&this.rootNode.buildTree(n,n.prefixLength-1)}}decode(e){return this.rootNode.decodeNode(e)}assignPrefixCodes(e){let t=e.length,n=0;for(let r=0;r<t;r++)n=Math.max(n,e[r].prefixLength);let r=new Uint32Array(n+1);for(let n=0;n<t;n++)r[e[n].prefixLength]++;let i,a,o,s=1,c=0;for(r[0]=0;s<=n;){for(c=c+r[s-1]<<1,i=c,a=0;a<t;)o=e[a],o.prefixLength===s&&(o.prefixCode=i,i++),a++;s++}}},Qa={};function $a(e){let t,n=Qa[e];if(n)return n;switch(e){case 1:t=[[0,1,4,0],[16,2,8,2],[272,3,16,6],[65808,3,32,7]];break;case 2:t=[[0,1,0,0],[1,2,0,2],[2,3,0,6],[3,4,3,14],[11,5,6,30],[75,6,32,62],[6,63]];break;case 3:t=[[-256,8,8,254],[0,1,0,0],[1,2,0,2],[2,3,0,6],[3,4,3,14],[11,5,6,30],[-257,8,32,255,`lower`],[75,7,32,126],[6,62]];break;case 4:t=[[1,1,0,0],[2,2,0,2],[3,3,0,6],[4,4,3,14],[12,5,6,30],[76,5,32,31]];break;case 5:t=[[-255,7,8,126],[1,1,0,0],[2,2,0,2],[3,3,0,6],[4,4,3,14],[12,5,6,30],[-256,7,32,127,`lower`],[76,6,32,62]];break;case 6:t=[[-2048,5,10,28],[-1024,4,9,8],[-512,4,8,9],[-256,4,7,10],[-128,5,6,29],[-64,5,5,30],[-32,4,5,11],[0,2,7,0],[128,3,7,2],[256,3,8,3],[512,4,9,12],[1024,4,10,13],[-2049,6,32,62,`lower`],[2048,6,32,63]];break;case 7:t=[[-1024,4,9,8],[-512,3,8,0],[-256,4,7,9],[-128,5,6,26],[-64,5,5,27],[-32,4,5,10],[0,4,5,11],[32,5,5,28],[64,5,6,29],[128,4,7,12],[256,3,8,1],[512,3,9,2],[1024,3,10,3],[-1025,5,32,30,`lower`],[2048,5,32,31]];break;case 8:t=[[-15,8,3,252],[-7,9,1,508],[-5,8,1,253],[-3,9,0,509],[-2,7,0,124],[-1,4,0,10],[0,2,1,0],[2,5,0,26],[3,6,0,58],[4,3,4,4],[20,6,1,59],[22,4,4,11],[38,4,5,12],[70,5,6,27],[134,5,7,28],[262,6,7,60],[390,7,8,125],[646,6,10,61],[-16,9,32,510,`lower`],[1670,9,32,511],[2,1]];break;case 9:t=[[-31,8,4,252],[-15,9,2,508],[-11,8,2,253],[-7,9,1,509],[-5,7,1,124],[-3,4,1,10],[-1,3,1,2],[1,3,1,3],[3,5,1,26],[5,6,1,58],[7,3,5,4],[39,6,2,59],[43,4,5,11],[75,4,6,12],[139,5,7,27],[267,5,8,28],[523,6,8,60],[779,7,9,125],[1291,6,11,61],[-32,9,32,510,`lower`],[3339,9,32,511],[2,0]];break;case 10:t=[[-21,7,4,122],[-5,8,0,252],[-4,7,0,123],[-3,5,0,24],[-2,2,2,0],[2,5,0,25],[3,6,0,54],[4,7,0,124],[5,8,0,253],[6,2,6,1],[70,5,5,26],[102,6,5,55],[134,6,6,56],[198,6,7,57],[326,6,8,58],[582,6,9,59],[1094,6,10,60],[2118,7,11,125],[-22,8,32,254,`lower`],[4166,8,32,255],[2,2]];break;case 11:t=[[1,1,0,0],[2,2,1,2],[4,4,0,12],[5,4,1,13],[7,5,1,28],[9,5,2,29],[13,6,2,60],[17,7,2,122],[21,7,3,123],[29,7,4,124],[45,7,5,125],[77,7,6,126],[141,7,32,127]];break;case 12:t=[[1,1,0,0],[2,2,0,2],[3,3,1,6],[5,5,0,28],[6,5,1,29],[8,6,1,60],[10,7,0,122],[11,7,1,123],[13,7,2,124],[17,7,3,125],[25,7,4,126],[41,8,5,254],[73,8,32,255]];break;case 13:t=[[1,1,0,0],[2,3,0,4],[3,4,0,12],[4,5,0,28],[5,4,1,13],[7,3,3,5],[15,6,1,58],[17,6,2,59],[21,6,3,60],[29,6,4,61],[45,6,5,62],[77,7,6,126],[141,7,32,127]];break;case 14:t=[[-2,3,0,4],[-1,3,0,5],[0,1,0,0],[1,3,0,6],[2,3,0,7]];break;case 15:t=[[-24,7,4,124],[-8,6,2,60],[-4,5,1,28],[-2,4,0,12],[-1,3,0,4],[0,1,0,0],[1,3,0,5],[2,4,0,13],[3,5,1,29],[5,6,2,61],[9,7,4,125],[-25,7,32,126,`lower`],[25,7,32,127]];break;default:throw new Aa(`standard table B.${e} does not exist`)}for(let e=0,n=t.length;e<n;e++)t[e]=new Ya(t[e]);return n=new Za(t,!0),Qa[e]=n,n}var eo=class{constructor(e,t,n){this.data=e,this.start=t,this.end=n,this.position=t,this.shift=-1,this.currentByte=0}readBit(){if(this.shift<0){if(this.position>=this.end)throw new Aa(`end of data while reading bit`);this.currentByte=this.data[this.position++],this.shift=7}let e=this.currentByte>>this.shift&1;return this.shift--,e}readBits(e){let t,n=0;for(t=e-1;t>=0;t--)n|=this.readBit()<<t;return n}byteAlign(){this.shift=-1}next(){return this.position>=this.end?-1:this.data[this.position++]}};function to(e,t,n){let r=0;for(let i=0,a=t.length;i<a;i++){let a=n[t[i]];if(a){if(e===r)return a;r++}}throw new Aa(`can't find custom Huffman table`)}function no(e,t,n){let r=[];for(let i=0;i<n;i++){let n=new Uint8Array(t);r.push(n);for(let r=0;r<t;r++)n[r]=e.readBit();e.byteAlign()}return r}function ro(e,t,n,r){let i=new ba(e,{K:-1,Columns:t,Rows:n,BlackIs1:!0,EndOfBlock:r}),a=[],o,s=!1;for(let e=0;e<n;e++){let e=new Uint8Array(t);a.push(e);let n=-1;for(let r=0;r<t;r++)n<0&&(o=i.readNextChar(),o===-1&&(o=0,s=!0),n=7),e[r]=o>>n&1,n--}if(r&&!s)for(let e=0;e<5&&i.readNextChar()!==-1;e++);return a}var io=class{parseChunks(e){return function(e){let t=new Ja;for(let n=0,r=e.length;n<r;n++){let r=e[n];qa(Ua({},r.data,r.start,r.end),t)}return t.buffer}(e)}parse(e){throw Error(`Not implemented: Jbig2Image.parse`)}},ao=class extends Ti{constructor(e,t,n){super(t),this.stream=e,this.dict=e.dict,this.maybeLength=t,this.params=n}get bytes(){return P(this,`bytes`,this.stream.getBytes(this.maybeLength))}ensureBuffer(e){}readBlock(){this.decodeImage()}decodeImage(e){if(this.eof)return this.buffer;e||=this.bytes;let t=new io,n=[];if(this.params instanceof L){let e=this.params.get(`JBIG2Globals`);if(e instanceof tr){let t=e.getBytes();n.push({data:t,start:0,end:t.length})}}n.push({data:e,start:0,end:e.length});let r=t.parseChunks(n),i=r.length;for(let e=0;e<i;e++)r[e]^=255;return this.buffer=r,this.bufferLength=i,this.eof=!0,this.buffer}get canAsyncDecodeImageFromBuffer(){return this.stream.isAsync}},oo=class extends Ti{constructor(e,t,n){super(t),this.stream=e,this.dict=e.dict,this.maybeLength=t,this.params=n}get bytes(){return P(this,`bytes`,this.stream.getBytes(this.maybeLength))}ensureBuffer(e){}readBlock(e){gn(`JpxStream.readBlock`)}get isAsyncDecoder(){return!0}async decodeImage(e,t){return this.eof||=(e||=this.bytes,this.buffer=await Qi.decode(e,t),this.bufferLength=this.buffer.length,!0),this.buffer}get canAsyncDecodeImageFromBuffer(){return this.stream.isAsync}},so=class extends Ti{constructor(e,t,n){super(t),this.str=e,this.dict=e.dict,this.cachedData=0,this.bitsCached=0;let r=4096,i={earlyChange:n,codeLength:9,nextCode:258,dictionaryValues:new Uint8Array(r),dictionaryLengths:new Uint16Array(r),dictionaryPrevCodes:new Uint16Array(r),currentSequence:new Uint8Array(r),currentSequenceLength:0};for(let e=0;e<256;++e)i.dictionaryValues[e]=e,i.dictionaryLengths[e]=1;this.lzwState=i}readBits(e){let t=this.bitsCached,n=this.cachedData;for(;t<e;){let e=this.str.getByte();if(e===-1)return this.eof=!0,null;n=n<<8|e,t+=8}return this.bitsCached=t-=e,this.cachedData=n,this.lastCode=null,n>>>t&(1<<e)-1}readBlock(){let e,t,n,r=1024,i=this.lzwState;if(!i)return;let a=i.earlyChange,o=i.nextCode,s=i.dictionaryValues,c=i.dictionaryLengths,l=i.dictionaryPrevCodes,u=i.codeLength,d=i.prevCode,f=i.currentSequence,p=i.currentSequenceLength,m=0,h=this.bufferLength,g=this.ensureBuffer(this.bufferLength+r);for(e=0;e<512;e++){let e=this.readBits(u),i=p>0;if(e<256)f[0]=e,p=1;else{if(!(e>=258)){if(e===256){u=9,o=258,p=0;continue}this.eof=!0,delete this.lzwState;break}if(e<o)for(p=c[e],t=p-1,n=e;t>=0;t--)f[t]=s[n],n=l[n];else f[p++]=f[0]}if(i&&(l[o]=d,c[o]=c[d]+1,s[o]=f[0],o++,u=o+a&o+a-1?u:0|Math.min(Math.log(o+a)/.6931471805599453+1,12)),d=e,m+=p,r<m){do r+=512;while(r<m);g=this.ensureBuffer(this.bufferLength+r)}for(t=0;t<p;t++)g[h++]=f[t]}i.nextCode=o,i.codeLength=u,i.prevCode=d,i.currentSequenceLength=p,this.bufferLength=h}},co=class extends Ti{constructor(e,t,n){if(super(t),!(n instanceof L))return e;let r=this.predictor=n.get(`Predictor`)||1;if(r<=1)return e;if(r!==2&&(r<10||r>15))throw new F(`Unsupported predictor: ${r}`);this.readBlock=r===2?this.readBlockTiff:this.readBlockPng,this.str=e,this.dict=e.dict;let i=this.colors=n.get(`Colors`)||1,a=this.bits=n.get(`BPC`,`BitsPerComponent`)||8,o=this.columns=n.get(`Columns`)||1;return this.pixBytes=i*a+7>>3,this.rowBytes=o*i*a+7>>3,this}readBlockTiff(){let e=this.rowBytes,t=this.bufferLength,n=this.ensureBuffer(t+e),r=this.bits,i=this.colors,a=this.str.getBytes(e);if(this.eof=!a.length,this.eof)return;let o,s=0,c=0,l=0,u=0,d=t;if(r===1&&i===1)for(o=0;o<e;++o){let e=a[o]^s;e^=e>>1,e^=e>>2,e^=e>>4,s=(1&e)<<7,n[d++]=e}else if(r===8){for(o=0;o<i;++o)n[d++]=a[o];for(;o<e;++o)n[d]=n[d-i]+a[o],d++}else if(r===16){let t=2*i;for(o=0;o<t;++o)n[d++]=a[o];for(;o<e;o+=2){let e=((255&a[o])<<8)+(255&a[o+1])+((255&n[d-t])<<8)+(255&n[d-t+1]);n[d++]=e>>8&255,n[d++]=255&e}}else{let e=new Uint8Array(i+1),d=(1<<r)-1,f=0,p=t,m=this.columns;for(o=0;o<m;++o)for(let t=0;t<i;++t)l<r&&(s=s<<8|255&a[f++],l+=8),e[t]=e[t]+(s>>l-r)&d,l-=r,c=c<<r|e[t],u+=r,u>=8&&(n[p++]=c>>u-8&255,u-=8);u>0&&(n[p++]=(c<<8-u)+(s&(1<<8-u)-1))}this.bufferLength+=e}readBlockPng(){let e=this.rowBytes,t=this.pixBytes,n=this.str.getByte(),r=this.str.getBytes(e);if(this.eof=!r.length,this.eof)return;let i=this.bufferLength,a=this.ensureBuffer(i+e),o=a.subarray(i-e,i);o.length===0&&(o=new Uint8Array(e));let s,c,l,u=i;switch(n){case 0:for(s=0;s<e;++s)a[u++]=r[s];break;case 1:for(s=0;s<t;++s)a[u++]=r[s];for(;s<e;++s)a[u]=a[u-t]+r[s]&255,u++;break;case 2:for(s=0;s<e;++s)a[u++]=o[s]+r[s]&255;break;case 3:for(s=0;s<t;++s)a[u++]=(o[s]>>1)+r[s];for(;s<e;++s)a[u]=(o[s]+a[u-t]>>1)+r[s]&255,u++;break;case 4:for(s=0;s<t;++s)c=o[s],l=r[s],a[u++]=c+l;for(;s<e;++s){c=o[s];let e=o[s-t],n=a[u-t],i=n+c-e,d=i-n;d<0&&(d=-d);let f=i-c;f<0&&(f=-f);let p=i-e;p<0&&(p=-p),l=r[s],a[u++]=d<=f&&d<=p?n+l:f<=p?c+l:e+l}break;default:throw new F(`Unsupported predictor: ${n}`)}this.bufferLength+=e}},lo=class extends Ti{constructor(e,t){super(t),this.str=e,this.dict=e.dict}readBlock(){let e=this.str.getBytes(2);if(!e||e.length<2||e[0]===128)return void(this.eof=!0);let t,n=this.bufferLength,r=e[0];if(r<128){if(t=this.ensureBuffer(n+r+1),t[n++]=e[1],r>0){let e=this.str.getBytes(r);t.set(e,n),n+=r}}else r=257-r,t=this.ensureBuffer(n+r+1),t.fill(e[1],n,n+r),n+=r;this.bufferLength=n}},uo=class{constructor({lexer:e,xref:t,allowStreams:n=!1,recoveryMode:r=!1}){this.lexer=e,this.xref=t,this.allowStreams=n,this.recoveryMode=r,this.imageCache=Object.create(null),this._imageId=0,this.refill()}refill(){this.buf1=this.lexer.getObj(),this.buf2=this.lexer.getObj()}shift(){this.buf2 instanceof qn&&this.buf2.cmd===`ID`?(this.buf1=this.buf2,this.buf2=null):(this.buf1=this.buf2,this.buf2=this.lexer.getObj())}tryShift(){try{return this.shift(),!0}catch(e){if(e instanceof cr)throw e;return!1}}getObj(e=null){let t=this.buf1;if(this.shift(),t instanceof qn)switch(t.cmd){case`BI`:return this.makeInlineImage(e);case`[`:let n=[];for(;!Qn(this.buf1,`]`)&&this.buf1!==Un;)n.push(this.getObj(e));if(this.buf1===Un){if(this.recoveryMode)return n;throw new lr(`End of file inside array.`)}return this.shift(),n;case`<<`:let r=new L(this.xref);for(;!Qn(this.buf1,`>>`)&&this.buf1!==Un;){if(!(this.buf1 instanceof I)){hn(`Malformed dictionary: key must be a name object`),this.shift();continue}let t=this.buf1.name;if(this.shift(),this.buf1===Un)break;r.set(t,this.getObj(e))}if(this.buf1===Un){if(this.recoveryMode)return r;throw new lr(`End of file inside dictionary.`)}return Qn(this.buf2,`stream`)?this.allowStreams?this.makeStream(r,e):r:(this.shift(),r);default:return t}if(Number.isInteger(t)){if(Number.isInteger(this.buf1)&&Qn(this.buf2,`R`)){let e=R.get(t,this.buf1);return this.shift(),this.shift(),e}return t}return typeof t==`string`&&e?e.decryptString(t):t}findDefaultInlineStreamEnd(e){let{knownCommands:t}=this.lexer,n=e.pos,r,i,a=0;for(;(r=e.getByte())!==-1;)if(a===0)a=+(r===69);else if(a===1)a=r===73?2:0;else if(r===32||r===10||r===13){i=e.pos;let n=e.peekBytes(15),o=n.length;if(o===0)break;for(let e=0;e<o;e++)if(r=n[e],(r!==0||n[e+1]===0)&&r!==10&&r!==13&&(r<32||r>127)){a=0;break}if(a!==2)continue;if(!t){N("findDefaultInlineStreamEnd - `lexer.knownCommands` is undefined.");continue}let s=new mo(new gi(e.peekBytes(75)),t);s._hexStringWarn=()=>{};let c=0;for(;;){let e=s.getObj();if(e===Un){a=0;break}if(e instanceof qn){let n=t[e.cmd];if(!n){a=0;break}if(n.variableArgs?c<=n.numArgs:c===n.numArgs)break;c=0;continue}c++}if(a===2)break}else a=0;r===-1&&(N(`findDefaultInlineStreamEnd: Reached the end of the stream without finding a valid EI marker`),i&&(N(`... trying to recover by using the last "EI" occurrence.`),e.skip(-(e.pos-i))));let o=4;return e.skip(-o),r=e.peekByte(),e.skip(o),Sr(r)||o--,e.pos-o-n}findDCTDecodeInlineStreamEnd(e){let t=e.pos,n,r,i=!1;for(;(n=e.getByte())!==-1;)if(n===255){switch(e.getByte()){case 0:break;case 255:e.skip(-1);break;case 217:i=!0;break;case 192:case 193:case 194:case 195:case 197:case 198:case 199:case 201:case 202:case 203:case 205:case 206:case 207:case 196:case 204:case 218:case 219:case 220:case 221:case 222:case 223:case 224:case 225:case 226:case 227:case 228:case 229:case 230:case 231:case 232:case 233:case 234:case 235:case 236:case 237:case 238:case 239:case 254:r=e.getUint16(),r>2?e.skip(r-2):e.skip(-2)}if(i)break}let a=e.pos-t;return n===-1?(N(`Inline DCTDecode image stream: EOI marker not found, searching for /EI/ instead.`),e.skip(-a),this.findDefaultInlineStreamEnd(e)):(this.inlineStreamSkipEI(e),a)}findASCII85DecodeInlineStreamEnd(e){let t=e.pos,n;for(;(n=e.getByte())!==-1;)if(n===126){let t=e.pos;for(n=e.peekByte();Sr(n);)e.skip(),n=e.peekByte();if(n===62){e.skip();break}if(e.pos>t){let t=e.peekBytes(2);if(t[0]===69&&t[1]===73)break}}let r=e.pos-t;return n===-1?(N(`Inline ASCII85Decode image stream: EOD marker not found, searching for /EI/ instead.`),e.skip(-r),this.findDefaultInlineStreamEnd(e)):(this.inlineStreamSkipEI(e),r)}findASCIIHexDecodeInlineStreamEnd(e){let t=e.pos,n;for(;(n=e.getByte())!==-1&&n!==62;);let r=e.pos-t;return n===-1?(N(`Inline ASCIIHexDecode image stream: EOD marker not found, searching for /EI/ instead.`),e.skip(-r),this.findDefaultInlineStreamEnd(e)):(this.inlineStreamSkipEI(e),r)}inlineStreamSkipEI(e){let t,n=0;for(;(t=e.getByte())!==-1;)if(n===0)n=+(t===69);else if(n===1)n=t===73?2:0;else if(n===2)break}makeInlineImage(e){let t=this.lexer,n=t.stream,r=Object.create(null),i;for(;!Qn(this.buf1,`ID`)&&this.buf1!==Un;){if(!(this.buf1 instanceof I))throw new F(`Dictionary key must be a name object`);let t=this.buf1.name;if(this.shift(),this.buf1===Un)break;r[t]=this.getObj(e)}t.beginInlineImagePos!==-1&&(i=n.pos-t.beginInlineImagePos);let a=this.xref.fetchIfRef(r.F||r.Filter),o;if(a instanceof I)o=a.name;else if(Array.isArray(a)){let e=this.xref.fetchIfRef(a[0]);e instanceof I&&(o=e.name)}let s=n.pos,c,l;switch(o){case`DCT`:case`DCTDecode`:c=this.findDCTDecodeInlineStreamEnd(n);break;case`A85`:case`ASCII85Decode`:c=this.findASCII85DecodeInlineStreamEnd(n);break;case`AHx`:case`ASCIIHexDecode`:c=this.findASCIIHexDecodeInlineStreamEnd(n);break;default:c=this.findDefaultInlineStreamEnd(n)}if(c<1e3&&i>0){let e=n.pos;n.pos=t.beginInlineImagePos,l=function(e){let t=[],n=e.length,r=0;for(;r<n-1;)t.push(e[r++]<<8|e[r++]);return r<n&&t.push(e[r]),n+`_`+String.fromCharCode.apply(null,t)}(n.getBytes(i+c)),n.pos=e;let r=this.imageCache[l];if(r!==void 0)return this.buf2=qn.get(`EI`),this.shift(),r.reset(),r}let u=new L(this.xref);for(let e in r)u.set(e,r[e]);let d=n.makeSubStream(s,c,u);return e&&(d=e.createStream(d,c)),d=this.filter(d,u,c),d.dict=u,l!==void 0&&(d.cacheKey=`inline_img_`+ ++this._imageId,this.imageCache[l]=d),this.buf2=qn.get(`EI`),this.shift(),d}#e(e){let{stream:t}=this.lexer;t.pos=e;let n=new Uint8Array([101,110,100]),r=n.length,i=[new Uint8Array([115,116,114,101,97,109]),new Uint8Array([115,116,101,97,109]),new Uint8Array([115,116,114,101,97])],a=9-r;for(;t.pos<t.end;){let o=t.peekBytes(2048),s=o.length-9;if(s<=0)break;let c=0;for(;c<s;){let s=0;for(;s<r&&o[c+s]===n[s];)s++;if(s>=r){let r=!1;for(let e of i){let t=e.length,i=0;for(;i<t&&o[c+s+i]===e[i];)i++;if(i>=a){r=!0;break}if(i>=t){Sr(o[c+s+i])&&(hn(`Found "${Tn([...n,...e])}" when searching for endstream command.`),r=!0);break}}if(r)return t.pos+=c,t.pos-e}c++}t.pos+=s}return-1}makeStream(e,t){let n=this.lexer,r=n.stream;n.skipToNextLine();let i=r.pos-1,a=e.get(`Length`);if(Number.isInteger(a)||(hn(`Bad length "${a&&a.toString()}" in stream.`),a=0),r.pos=i+a,n.nextChar(),this.tryShift()&&Qn(this.buf2,`endstream`))this.shift();else{if(a=this.#e(i),a<0)throw new F(`Missing endstream command.`);n.nextChar(),this.shift(),this.shift()}return this.shift(),r=r.makeSubStream(i,a,e),t&&(r=t.createStream(r,a)),r=this.filter(r,e,a),r.dict=e,r}filter(e,t,n){let r=t.get(`F`,`Filter`),i=t.get(`DP`,`DecodeParms`);if(r instanceof I)return Array.isArray(i)&&N(`/DecodeParms should not be an Array, when /Filter is a Name.`),this.makeFilter(e,r.name,n,i);let a=n;if(Array.isArray(r)){let t=r,n=i;for(let o=0,s=t.length;o<s;++o){if(r=this.xref.fetchIfRef(t[o]),!(r instanceof I))throw new F(`Bad filter name "${r}"`);i=null,Array.isArray(n)&&o in n&&(i=this.xref.fetchIfRef(n[o])),e=this.makeFilter(e,r.name,a,i),a=null}}return e}makeFilter(e,t,n,r){if(n===0)return N(`Empty "${t}" stream.`),new vi;try{switch(t){case`Fl`:case`FlateDecode`:return r?new co(new Da(e,n),n,r):new Da(e,n);case`LZW`:case`LZWDecode`:let t=1;return r?(r.has(`EarlyChange`)&&(t=r.get(`EarlyChange`)),new co(new so(e,n,t),n,r)):new so(e,n,t);case`DCT`:case`DCTDecode`:return new Xi(e,n,r);case`JPX`:case`JPXDecode`:return new oo(e,n,r);case`A85`:case`ASCII85Decode`:return new da(e,n);case`AHx`:case`ASCIIHexDecode`:return new fa(e,n);case`CCF`:case`CCITTFaxDecode`:return new xa(e,n,r);case`RL`:case`RunLengthDecode`:return new lo(e,n);case`JBIG2Decode`:return new ao(e,n,r)}return N(`Filter "${t}" is not supported.`),e}catch(e){if(e instanceof cr)throw e;return N(`Invalid stream: "${e}"`),new vi}}},fo=[1,0,0,0,0,0,0,0,0,1,1,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,2,0,0,2,2,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,2,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];function po(e){return e>=48&&e<=57?15&e:e>=65&&e<=70||e>=97&&e<=102?9+(15&e):-1}var mo=class{constructor(e,t=null){this.stream=e,this.nextChar(),this.strBuf=[],this.knownCommands=t,this._hexStringNumWarn=0,this.beginInlineImagePos=-1}nextChar(){return this.currentChar=this.stream.getByte()}peekChar(){return this.stream.peekByte()}getNumber(){let e=this.currentChar,t=!1,n=0,r=1;if(e===45?(r=-1,e=this.nextChar(),e===45&&(e=this.nextChar())):e===43&&(e=this.nextChar()),e===10||e===13)do e=this.nextChar();while(e===10||e===13);if(e===46&&(n=10,e=this.nextChar()),e<48||e>57){let t=`Invalid number: ${String.fromCharCode(e)} (charCode ${e})`;if(Sr(e)||e===40||e===60||e===-1)return hn(`Lexer.getNumber - "${t}".`),0;throw new F(t)}let i=e-48,a=0,o=1;for(;(e=this.nextChar())>=0;)if(e>=48&&e<=57){let r=e-48;t?a=10*a+r:(n!==0&&(n*=10),i=10*i+r)}else if(e===46){if(n!==0)break;n=1}else if(e===45)N(`Badly formatted number: minus sign in the middle`);else{if(e!==69&&e!==101)break;if(e=this.peekChar(),e===43||e===45)o=e===45?-1:1,this.nextChar();else if(e<48||e>57)break;t=!0}return n!==0&&(i/=n),t&&(i*=10**(o*a)),r*i}getString(){let e=1,t=!1,n=this.strBuf;n.length=0;let r=this.nextChar();for(;;){let i=!1;switch(0|r){case-1:N(`Unterminated string`),t=!0;break;case 40:++e,n.push(`(`);break;case 41:--e===0?(this.nextChar(),t=!0):n.push(`)`);break;case 92:switch(r=this.nextChar(),r){case-1:N(`Unterminated string`),t=!0;break;case 110:n.push(`
3
- `);break;case 114:n.push(`\r`);break;case 116:n.push(` `);break;case 98:n.push(`\b`);break;case 102:n.push(`\f`);break;case 92:case 40:case 41:n.push(String.fromCharCode(r));break;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:let e=15&r;r=this.nextChar(),i=!0,r>=48&&r<=55&&(e=(e<<3)+(15&r),r=this.nextChar(),r>=48&&r<=55&&(i=!1,e=(e<<3)+(15&r))),n.push(String.fromCharCode(e));break;case 13:this.peekChar()===10&&this.nextChar();break;case 10:break;default:n.push(String.fromCharCode(r))}break;default:n.push(String.fromCharCode(r))}if(t)break;i||(r=this.nextChar())}return n.join(``)}getName(){let e,t,n=this.strBuf;for(n.length=0;(e=this.nextChar())>=0&&!fo[e];)if(e===35){if(e=this.nextChar(),fo[e]){N(`Lexer_getName: NUMBER SIGN (#) should be followed by a hexadecimal number.`),n.push(`#`);break}let r=po(e);if(r!==-1){t=e,e=this.nextChar();let i=po(e);if(i===-1){if(N(`Lexer_getName: Illegal digit (${String.fromCharCode(e)}) in hexadecimal number.`),n.push(`#`,String.fromCharCode(t)),fo[e])break;n.push(String.fromCharCode(e));continue}n.push(String.fromCharCode(r<<4|i))}else n.push(`#`,String.fromCharCode(e))}else n.push(String.fromCharCode(e));return n.length>127&&N(`Name token is longer than allowed by the spec: ${n.length}`),I.get(n.join(``))}_hexStringWarn(e){this._hexStringNumWarn++===5?N(`getHexString - ignoring additional invalid characters.`):this._hexStringNumWarn>5||N(`getHexString - ignoring invalid character: ${e}`)}getHexString(){let e=this.strBuf;e.length=0;let t=this.currentChar,n=-1,r=-1;for(this._hexStringNumWarn=0;;){if(t<0){N(`Unterminated hex string`);break}if(t===62){this.nextChar();break}fo[t]===1?t=this.nextChar():(r=po(t),r===-1?this._hexStringWarn(t):n===-1?n=r:(e.push(String.fromCharCode(n<<4|r)),n=-1),t=this.nextChar())}return n!==-1&&e.push(String.fromCharCode(n<<4)),e.join(``)}getObj(){let e=!1,t=this.currentChar;for(;;){if(t<0)return Un;if(e)t!==10&&t!==13||(e=!1);else if(t===37)e=!0;else if(fo[t]!==1)break;t=this.nextChar()}switch(0|t){case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:case 43:case 45:case 46:return this.getNumber();case 40:return this.getString();case 47:return this.getName();case 91:return this.nextChar(),qn.get(`[`);case 93:return this.nextChar(),qn.get(`]`);case 60:return t=this.nextChar(),t===60?(this.nextChar(),qn.get(`<<`)):this.getHexString();case 62:return t=this.nextChar(),t===62?(this.nextChar(),qn.get(`>>`)):qn.get(`>`);case 123:return this.nextChar(),qn.get(`{`);case 125:return this.nextChar(),qn.get(`}`);case 41:throw this.nextChar(),new F(`Illegal character: ${t}`)}let n=String.fromCharCode(t);if(t<32||t>127){let e=this.peekChar();if(e>=32&&e<=127)return this.nextChar(),qn.get(n)}let r=this.knownCommands,i=r?.[n]!==void 0;for(;(t=this.nextChar())>=0&&!fo[t];){let e=n+String.fromCharCode(t);if(i&&r[e]===void 0)break;if(n.length===128)throw new F(`Command token too long: ${n.length}`);n=e,i=r?.[n]!==void 0}return n===`true`||n!==`false`&&(n===`null`?null:(n===`BI`&&(this.beginInlineImagePos=this.stream.pos),qn.get(n)))}skipToNextLine(){let e=this.currentChar;for(;e>=0;){if(e===13){e=this.nextChar(),e===10&&this.nextChar();break}if(e===10){this.nextChar();break}e=this.nextChar()}}},ho=class{static create(e){function t(e,t,n=!1){let r=e.get(t);if(Number.isInteger(r)&&(n?r>=0:r>0))return r;throw Error(`The "${t}" parameter in the linearization dictionary is invalid.`)}let n=new uo({lexer:new mo(e),xref:null}),r=n.getObj(),i=n.getObj(),a=n.getObj(),o=n.getObj(),s,c;if(!(Number.isInteger(r)&&Number.isInteger(i)&&Qn(a,`obj`)&&o instanceof L&&typeof(s=o.get(`Linearized`))==`number`&&s>0))return null;if((c=t(o,`L`))!==e.length)throw Error(`The "L" parameter in the linearization dictionary does not equal the stream length.`);return{length:c,hints:function(e){let t=e.get(`H`),n;if(Array.isArray(t)&&((n=t.length)===2||n===4)){for(let e=0;e<n;e++){let n=t[e];if(!(Number.isInteger(n)&&n>0))throw Error(`Hint (${e}) in the linearization dictionary is invalid.`)}return t}throw Error(`Hint array in the linearization dictionary is invalid.`)}(o),objectNumberFirst:t(o,`O`),endFirst:t(o,`E`),numPages:t(o,`N`),mainXRefEntriesOffset:t(o,`T`),pageFirst:o.has(`P`)?t(o,`P`,!0):0}}},go=`Adobe-GB1-UCS2.Adobe-CNS1-UCS2.Adobe-Japan1-UCS2.Adobe-Korea1-UCS2.78-EUC-H.78-EUC-V.78-H.78-RKSJ-H.78-RKSJ-V.78-V.78ms-RKSJ-H.78ms-RKSJ-V.83pv-RKSJ-H.90ms-RKSJ-H.90ms-RKSJ-V.90msp-RKSJ-H.90msp-RKSJ-V.90pv-RKSJ-H.90pv-RKSJ-V.Add-H.Add-RKSJ-H.Add-RKSJ-V.Add-V.Adobe-CNS1-0.Adobe-CNS1-1.Adobe-CNS1-2.Adobe-CNS1-3.Adobe-CNS1-4.Adobe-CNS1-5.Adobe-CNS1-6.Adobe-GB1-0.Adobe-GB1-1.Adobe-GB1-2.Adobe-GB1-3.Adobe-GB1-4.Adobe-GB1-5.Adobe-Japan1-0.Adobe-Japan1-1.Adobe-Japan1-2.Adobe-Japan1-3.Adobe-Japan1-4.Adobe-Japan1-5.Adobe-Japan1-6.Adobe-Korea1-0.Adobe-Korea1-1.Adobe-Korea1-2.B5-H.B5-V.B5pc-H.B5pc-V.CNS-EUC-H.CNS-EUC-V.CNS1-H.CNS1-V.CNS2-H.CNS2-V.ETHK-B5-H.ETHK-B5-V.ETen-B5-H.ETen-B5-V.ETenms-B5-H.ETenms-B5-V.EUC-H.EUC-V.Ext-H.Ext-RKSJ-H.Ext-RKSJ-V.Ext-V.GB-EUC-H.GB-EUC-V.GB-H.GB-V.GBK-EUC-H.GBK-EUC-V.GBK2K-H.GBK2K-V.GBKp-EUC-H.GBKp-EUC-V.GBT-EUC-H.GBT-EUC-V.GBT-H.GBT-V.GBTpc-EUC-H.GBTpc-EUC-V.GBpc-EUC-H.GBpc-EUC-V.H.HKdla-B5-H.HKdla-B5-V.HKdlb-B5-H.HKdlb-B5-V.HKgccs-B5-H.HKgccs-B5-V.HKm314-B5-H.HKm314-B5-V.HKm471-B5-H.HKm471-B5-V.HKscs-B5-H.HKscs-B5-V.Hankaku.Hiragana.KSC-EUC-H.KSC-EUC-V.KSC-H.KSC-Johab-H.KSC-Johab-V.KSC-V.KSCms-UHC-H.KSCms-UHC-HW-H.KSCms-UHC-HW-V.KSCms-UHC-V.KSCpc-EUC-H.KSCpc-EUC-V.Katakana.NWP-H.NWP-V.RKSJ-H.RKSJ-V.Roman.UniCNS-UCS2-H.UniCNS-UCS2-V.UniCNS-UTF16-H.UniCNS-UTF16-V.UniCNS-UTF32-H.UniCNS-UTF32-V.UniCNS-UTF8-H.UniCNS-UTF8-V.UniGB-UCS2-H.UniGB-UCS2-V.UniGB-UTF16-H.UniGB-UTF16-V.UniGB-UTF32-H.UniGB-UTF32-V.UniGB-UTF8-H.UniGB-UTF8-V.UniJIS-UCS2-H.UniJIS-UCS2-HW-H.UniJIS-UCS2-HW-V.UniJIS-UCS2-V.UniJIS-UTF16-H.UniJIS-UTF16-V.UniJIS-UTF32-H.UniJIS-UTF32-V.UniJIS-UTF8-H.UniJIS-UTF8-V.UniJIS2004-UTF16-H.UniJIS2004-UTF16-V.UniJIS2004-UTF32-H.UniJIS2004-UTF32-V.UniJIS2004-UTF8-H.UniJIS2004-UTF8-V.UniJISPro-UCS2-HW-V.UniJISPro-UCS2-V.UniJISPro-UTF8-V.UniJISX0213-UTF32-H.UniJISX0213-UTF32-V.UniJISX02132004-UTF32-H.UniJISX02132004-UTF32-V.UniKS-UCS2-H.UniKS-UCS2-V.UniKS-UTF16-H.UniKS-UTF16-V.UniKS-UTF32-H.UniKS-UTF32-V.UniKS-UTF8-H.UniKS-UTF8-V.V.WP-Symbol`.split(`.`),_o=2**24-1,vo=class{constructor(e=!1){this.codespaceRanges=[[],[],[],[]],this.numCodespaceRanges=0,this._map=[],this.name=``,this.vertical=!1,this.useCMap=null,this.builtInCMap=e}addCodespaceRange(e,t,n){this.codespaceRanges[e-1].push(t,n),this.numCodespaceRanges++}mapCidRange(e,t,n){if(t-e>_o)throw Error(`mapCidRange - ignoring data above MAX_MAP_RANGE.`);for(;e<=t;)this._map[e++]=n++}mapBfRange(e,t,n){if(t-e>_o)throw Error(`mapBfRange - ignoring data above MAX_MAP_RANGE.`);let r=n.length-1;for(;e<=t;){this._map[e++]=n;let t=n.charCodeAt(r)+1;n=t>255?n.substring(0,r-1)+String.fromCharCode(n.charCodeAt(r-1)+1)+`\0`:n.substring(0,r)+String.fromCharCode(t)}}mapBfRangeToArray(e,t,n){if(t-e>_o)throw Error(`mapBfRangeToArray - ignoring data above MAX_MAP_RANGE.`);let r=n.length,i=0;for(;e<=t&&i<r;)this._map[e]=n[i++],++e}mapOne(e,t){this._map[e]=t}lookup(e){return this._map[e]}contains(e){return this._map[e]!==void 0}forEach(e){let t=this._map,n=t.length;if(n<=65536)for(let r=0;r<n;r++)t[r]!==void 0&&e(r,t[r]);else for(let n in t)e(n,t[n])}charCodeOf(e){let t=this._map;if(t.length<=65536)return t.indexOf(e);for(let n in t)if(t[n]===e)return 0|n;return-1}getMap(){return this._map}readCharCode(e,t,n){let r=0,i=this.codespaceRanges;for(let a=0,o=i.length;a<o;a++){r=(r<<8|e.charCodeAt(t+a))>>>0;let o=i[a];for(let e=0,t=o.length;e<t;){let t=o[e++],i=o[e++];if(r>=t&&r<=i)return n.charcode=r,void(n.length=a+1)}}n.charcode=0,n.length=1}getCharCodeLength(e){let t=this.codespaceRanges;for(let n=0,r=t.length;n<r;n++){let r=t[n];for(let t=0,i=r.length;t<i;){let i=r[t++],a=r[t++];if(e>=i&&e<=a)return n+1}}return 1}get length(){return this._map.length}get isIdentityCMap(){if(this.name!==`Identity-H`&&this.name!==`Identity-V`||this._map.length!==65536)return!1;for(let e=0;e<65536;e++)if(this._map[e]!==e)return!1;return!0}},yo=class extends vo{constructor(e,t){super(),this.vertical=e,this.addCodespaceRange(t,0,65535)}mapCidRange(e,t,n){gn(`should not call mapCidRange`)}mapBfRange(e,t,n){gn(`should not call mapBfRange`)}mapBfRangeToArray(e,t,n){gn(`should not call mapBfRangeToArray`)}mapOne(e,t){gn(`should not call mapCidOne`)}lookup(e){return Number.isInteger(e)&&e<=65535?e:void 0}contains(e){return Number.isInteger(e)&&e<=65535}forEach(e){for(let t=0;t<=65535;t++)e(t,t)}charCodeOf(e){return Number.isInteger(e)&&e<=65535?e:-1}getMap(){let e=Array(65536);for(let t=0;t<=65535;t++)e[t]=t;return e}get length(){return 65536}get isIdentityCMap(){gn(`should not access .isIdentityCMap`)}};function bo(e){let t=0;for(let n=0;n<e.length;n++)t=t<<8|e.charCodeAt(n);return t>>>0}function xo(e){if(typeof e!=`string`)throw new F(`Malformed CMap: expected string.`)}function So(e){if(!Number.isInteger(e))throw new F(`Malformed CMap: expected int.`)}function Co(e,t){for(;;){let n=t.getObj();if(n===Un)break;if(Qn(n,`endbfchar`))return;xo(n);let r=bo(n);n=t.getObj(),xo(n);let i=n;e.mapOne(r,i)}}function wo(e,t){for(;;){let n=t.getObj();if(n===Un)break;if(Qn(n,`endbfrange`))return;xo(n);let r=bo(n);n=t.getObj(),xo(n);let i=bo(n);if(n=t.getObj(),Number.isInteger(n)||typeof n==`string`){let t=Number.isInteger(n)?String.fromCharCode(n):n;e.mapBfRange(r,i,t)}else{if(!Qn(n,`[`))break;{n=t.getObj();let a=[];for(;!Qn(n,`]`)&&n!==Un;)a.push(n),n=t.getObj();e.mapBfRangeToArray(r,i,a)}}}throw new F(`Invalid bf range.`)}function To(e,t){for(;;){let n=t.getObj();if(n===Un)break;if(Qn(n,`endcidchar`))return;xo(n);let r=bo(n);n=t.getObj(),So(n);let i=n;e.mapOne(r,i)}}function Eo(e,t){for(;;){let n=t.getObj();if(n===Un)break;if(Qn(n,`endcidrange`))return;xo(n);let r=bo(n);n=t.getObj(),xo(n);let i=bo(n);n=t.getObj(),So(n);let a=n;e.mapCidRange(r,i,a)}}function Do(e,t){for(;;){let n=t.getObj();if(n===Un)break;if(Qn(n,`endcodespacerange`))return;if(typeof n!=`string`)break;let r=bo(n);if(n=t.getObj(),typeof n!=`string`)break;let i=bo(n);e.addCodespaceRange(n.length,r,i)}throw new F(`Invalid codespace range.`)}function Oo(e,t){let n=t.getObj();Number.isInteger(n)&&(e.vertical=!!n)}function ko(e,t){let n=t.getObj();n instanceof I&&(e.name=n.name)}async function Ao(e,t,n,r){let i,a;e:for(;;)try{let n=t.getObj();if(n===Un)break;if(n instanceof I)n.name===`WMode`?Oo(e,t):n.name===`CMapName`&&ko(e,t),i=n;else if(n instanceof qn)switch(n.cmd){case`endcmap`:break e;case`usecmap`:i instanceof I&&(a=i.name);break;case`begincodespacerange`:Do(e,t);break;case`beginbfchar`:Co(e,t);break;case`begincidchar`:To(e,t);break;case`beginbfrange`:wo(e,t);break;case`begincidrange`:Eo(e,t)}}catch(e){if(e instanceof cr)throw e;N(`Invalid cMap data: `+e);continue}return!r&&a&&(r=a),r?jo(e,n,r):e}async function jo(e,t,n){if(e.useCMap=await Mo(n,t),e.numCodespaceRanges===0){let t=e.useCMap.codespaceRanges;for(let n=0;n<t.length;n++)e.codespaceRanges[n]=t[n].slice();e.numCodespaceRanges=e.useCMap.numCodespaceRanges}return e.useCMap.forEach(function(t,n){e.contains(t)||e.mapOne(t,n)}),e}async function Mo(e,t){if(e===`Identity-H`)return new yo(!1,2);if(e===`Identity-V`)return new yo(!0,2);if(!go.includes(e))throw Error(`Unknown CMap name: `+e);if(!t)throw Error(`Built-in CMap parameters are not provided.`);let{cMapData:n,isCompressed:r}=await t(e),i=new vo(!0);return r?new ua().process(n,i,e=>jo(i,t,e)):Ao(i,new mo(new gi(n)),t,null)}var No=class{static async create({encoding:e,fetchBuiltInCMap:t,useCMap:n}){if(e instanceof I)return Mo(e.name,t);if(e instanceof tr){let r=await Ao(new vo,new mo(e),t,n);return r.isIdentityCMap?Mo(r.name,t):r}throw Error(`Encoding required.`)}},Po=`................................space.exclamsmall.Hungarumlautsmall..dollaroldstyle.dollarsuperior.ampersandsmall.Acutesmall.parenleftsuperior.parenrightsuperior.twodotenleader.onedotenleader.comma.hyphen.period.fraction.zerooldstyle.oneoldstyle.twooldstyle.threeoldstyle.fouroldstyle.fiveoldstyle.sixoldstyle.sevenoldstyle.eightoldstyle.nineoldstyle.colon.semicolon.commasuperior.threequartersemdash.periodsuperior.questionsmall..asuperior.bsuperior.centsuperior.dsuperior.esuperior....isuperior...lsuperior.msuperior.nsuperior.osuperior...rsuperior.ssuperior.tsuperior..ff.fi.fl.ffi.ffl.parenleftinferior..parenrightinferior.Circumflexsmall.hyphensuperior.Gravesmall.Asmall.Bsmall.Csmall.Dsmall.Esmall.Fsmall.Gsmall.Hsmall.Ismall.Jsmall.Ksmall.Lsmall.Msmall.Nsmall.Osmall.Psmall.Qsmall.Rsmall.Ssmall.Tsmall.Usmall.Vsmall.Wsmall.Xsmall.Ysmall.Zsmall.colonmonetary.onefitted.rupiah.Tildesmall...................................exclamdownsmall.centoldstyle.Lslashsmall...Scaronsmall.Zcaronsmall.Dieresissmall.Brevesmall.Caronsmall..Dotaccentsmall...Macronsmall...figuredash.hypheninferior...Ogoneksmall.Ringsmall.Cedillasmall....onequarter.onehalf.threequarters.questiondownsmall.oneeighth.threeeighths.fiveeighths.seveneighths.onethird.twothirds...zerosuperior.onesuperior.twosuperior.threesuperior.foursuperior.fivesuperior.sixsuperior.sevensuperior.eightsuperior.ninesuperior.zeroinferior.oneinferior.twoinferior.threeinferior.fourinferior.fiveinferior.sixinferior.seveninferior.eightinferior.nineinferior.centinferior.dollarinferior.periodinferior.commainferior.Agravesmall.Aacutesmall.Acircumflexsmall.Atildesmall.Adieresissmall.Aringsmall.AEsmall.Ccedillasmall.Egravesmall.Eacutesmall.Ecircumflexsmall.Edieresissmall.Igravesmall.Iacutesmall.Icircumflexsmall.Idieresissmall.Ethsmall.Ntildesmall.Ogravesmall.Oacutesmall.Ocircumflexsmall.Otildesmall.Odieresissmall.OEsmall.Oslashsmall.Ugravesmall.Uacutesmall.Ucircumflexsmall.Udieresissmall.Yacutesmall.Thornsmall.Ydieresissmall`.split(`.`),Fo=`................................space.exclamsmall.Hungarumlautsmall.centoldstyle.dollaroldstyle.dollarsuperior.ampersandsmall.Acutesmall.parenleftsuperior.parenrightsuperior.twodotenleader.onedotenleader.comma.hyphen.period.fraction.zerooldstyle.oneoldstyle.twooldstyle.threeoldstyle.fouroldstyle.fiveoldstyle.sixoldstyle.sevenoldstyle.eightoldstyle.nineoldstyle.colon.semicolon..threequartersemdash..questionsmall.....Ethsmall...onequarter.onehalf.threequarters.oneeighth.threeeighths.fiveeighths.seveneighths.onethird.twothirds.......ff.fi.fl.ffi.ffl.parenleftinferior..parenrightinferior.Circumflexsmall.hypheninferior.Gravesmall.Asmall.Bsmall.Csmall.Dsmall.Esmall.Fsmall.Gsmall.Hsmall.Ismall.Jsmall.Ksmall.Lsmall.Msmall.Nsmall.Osmall.Psmall.Qsmall.Rsmall.Ssmall.Tsmall.Usmall.Vsmall.Wsmall.Xsmall.Ysmall.Zsmall.colonmonetary.onefitted.rupiah.Tildesmall...asuperior.centsuperior.....Aacutesmall.Agravesmall.Acircumflexsmall.Adieresissmall.Atildesmall.Aringsmall.Ccedillasmall.Eacutesmall.Egravesmall.Ecircumflexsmall.Edieresissmall.Iacutesmall.Igravesmall.Icircumflexsmall.Idieresissmall.Ntildesmall.Oacutesmall.Ogravesmall.Ocircumflexsmall.Odieresissmall.Otildesmall.Uacutesmall.Ugravesmall.Ucircumflexsmall.Udieresissmall..eightsuperior.fourinferior.threeinferior.sixinferior.eightinferior.seveninferior.Scaronsmall..centinferior.twoinferior..Dieresissmall..Caronsmall.osuperior.fiveinferior..commainferior.periodinferior.Yacutesmall..dollarinferior...Thornsmall..nineinferior.zeroinferior.Zcaronsmall.AEsmall.Oslashsmall.questiondownsmall.oneinferior.Lslashsmall.......Cedillasmall......OEsmall.figuredash.hyphensuperior.....exclamdownsmall..Ydieresissmall..onesuperior.twosuperior.threesuperior.foursuperior.fivesuperior.sixsuperior.sevensuperior.ninesuperior.zerosuperior..esuperior.rsuperior.tsuperior...isuperior.ssuperior.dsuperior......lsuperior.Ogoneksmall.Brevesmall.Macronsmall.bsuperior.nsuperior.msuperior.commasuperior.periodsuperior.Dotaccentsmall.Ringsmall....`.split(`.`),Io=`................................space.exclam.quotedbl.numbersign.dollar.percent.ampersand.quotesingle.parenleft.parenright.asterisk.plus.comma.hyphen.period.slash.zero.one.two.three.four.five.six.seven.eight.nine.colon.semicolon.less.equal.greater.question.at.A.B.C.D.E.F.G.H.I.J.K.L.M.N.O.P.Q.R.S.T.U.V.W.X.Y.Z.bracketleft.backslash.bracketright.asciicircum.underscore.grave.a.b.c.d.e.f.g.h.i.j.k.l.m.n.o.p.q.r.s.t.u.v.w.x.y.z.braceleft.bar.braceright.asciitilde..Adieresis.Aring.Ccedilla.Eacute.Ntilde.Odieresis.Udieresis.aacute.agrave.acircumflex.adieresis.atilde.aring.ccedilla.eacute.egrave.ecircumflex.edieresis.iacute.igrave.icircumflex.idieresis.ntilde.oacute.ograve.ocircumflex.odieresis.otilde.uacute.ugrave.ucircumflex.udieresis.dagger.degree.cent.sterling.section.bullet.paragraph.germandbls.registered.copyright.trademark.acute.dieresis.notequal.AE.Oslash.infinity.plusminus.lessequal.greaterequal.yen.mu.partialdiff.summation.product.pi.integral.ordfeminine.ordmasculine.Omega.ae.oslash.questiondown.exclamdown.logicalnot.radical.florin.approxequal.Delta.guillemotleft.guillemotright.ellipsis.space.Agrave.Atilde.Otilde.OE.oe.endash.emdash.quotedblleft.quotedblright.quoteleft.quoteright.divide.lozenge.ydieresis.Ydieresis.fraction.currency.guilsinglleft.guilsinglright.fi.fl.daggerdbl.periodcentered.quotesinglbase.quotedblbase.perthousand.Acircumflex.Ecircumflex.Aacute.Edieresis.Egrave.Iacute.Icircumflex.Idieresis.Igrave.Oacute.Ocircumflex.apple.Ograve.Uacute.Ucircumflex.Ugrave.dotlessi.circumflex.tilde.macron.breve.dotaccent.ring.cedilla.hungarumlaut.ogonek.caron`.split(`.`),Lo=`................................space.exclam.quotedbl.numbersign.dollar.percent.ampersand.quoteright.parenleft.parenright.asterisk.plus.comma.hyphen.period.slash.zero.one.two.three.four.five.six.seven.eight.nine.colon.semicolon.less.equal.greater.question.at.A.B.C.D.E.F.G.H.I.J.K.L.M.N.O.P.Q.R.S.T.U.V.W.X.Y.Z.bracketleft.backslash.bracketright.asciicircum.underscore.quoteleft.a.b.c.d.e.f.g.h.i.j.k.l.m.n.o.p.q.r.s.t.u.v.w.x.y.z.braceleft.bar.braceright.asciitilde...................................exclamdown.cent.sterling.fraction.yen.florin.section.currency.quotesingle.quotedblleft.guillemotleft.guilsinglleft.guilsinglright.fi.fl..endash.dagger.daggerdbl.periodcentered..paragraph.bullet.quotesinglbase.quotedblbase.quotedblright.guillemotright.ellipsis.perthousand..questiondown..grave.acute.circumflex.tilde.macron.breve.dotaccent.dieresis..ring.cedilla..hungarumlaut.ogonek.caron.emdash.................AE..ordfeminine.....Lslash.Oslash.OE.ordmasculine......ae....dotlessi...lslash.oslash.oe.germandbls....`.split(`.`),Ro=`................................space.exclam.quotedbl.numbersign.dollar.percent.ampersand.quotesingle.parenleft.parenright.asterisk.plus.comma.hyphen.period.slash.zero.one.two.three.four.five.six.seven.eight.nine.colon.semicolon.less.equal.greater.question.at.A.B.C.D.E.F.G.H.I.J.K.L.M.N.O.P.Q.R.S.T.U.V.W.X.Y.Z.bracketleft.backslash.bracketright.asciicircum.underscore.grave.a.b.c.d.e.f.g.h.i.j.k.l.m.n.o.p.q.r.s.t.u.v.w.x.y.z.braceleft.bar.braceright.asciitilde.bullet.Euro.bullet.quotesinglbase.florin.quotedblbase.ellipsis.dagger.daggerdbl.circumflex.perthousand.Scaron.guilsinglleft.OE.bullet.Zcaron.bullet.bullet.quoteleft.quoteright.quotedblleft.quotedblright.bullet.endash.emdash.tilde.trademark.scaron.guilsinglright.oe.bullet.zcaron.Ydieresis.space.exclamdown.cent.sterling.currency.yen.brokenbar.section.dieresis.copyright.ordfeminine.guillemotleft.logicalnot.hyphen.registered.macron.degree.plusminus.twosuperior.threesuperior.acute.mu.paragraph.periodcentered.cedilla.onesuperior.ordmasculine.guillemotright.onequarter.onehalf.threequarters.questiondown.Agrave.Aacute.Acircumflex.Atilde.Adieresis.Aring.AE.Ccedilla.Egrave.Eacute.Ecircumflex.Edieresis.Igrave.Iacute.Icircumflex.Idieresis.Eth.Ntilde.Ograve.Oacute.Ocircumflex.Otilde.Odieresis.multiply.Oslash.Ugrave.Uacute.Ucircumflex.Udieresis.Yacute.Thorn.germandbls.agrave.aacute.acircumflex.atilde.adieresis.aring.ae.ccedilla.egrave.eacute.ecircumflex.edieresis.igrave.iacute.icircumflex.idieresis.eth.ntilde.ograve.oacute.ocircumflex.otilde.odieresis.divide.oslash.ugrave.uacute.ucircumflex.udieresis.yacute.thorn.ydieresis`.split(`.`),zo=`................................space.exclam.universal.numbersign.existential.percent.ampersand.suchthat.parenleft.parenright.asteriskmath.plus.comma.minus.period.slash.zero.one.two.three.four.five.six.seven.eight.nine.colon.semicolon.less.equal.greater.question.congruent.Alpha.Beta.Chi.Delta.Epsilon.Phi.Gamma.Eta.Iota.theta1.Kappa.Lambda.Mu.Nu.Omicron.Pi.Theta.Rho.Sigma.Tau.Upsilon.sigma1.Omega.Xi.Psi.Zeta.bracketleft.therefore.bracketright.perpendicular.underscore.radicalex.alpha.beta.chi.delta.epsilon.phi.gamma.eta.iota.phi1.kappa.lambda.mu.nu.omicron.pi.theta.rho.sigma.tau.upsilon.omega1.omega.xi.psi.zeta.braceleft.bar.braceright.similar..................................Euro.Upsilon1.minute.lessequal.fraction.infinity.florin.club.diamond.heart.spade.arrowboth.arrowleft.arrowup.arrowright.arrowdown.degree.plusminus.second.greaterequal.multiply.proportional.partialdiff.bullet.divide.notequal.equivalence.approxequal.ellipsis.arrowvertex.arrowhorizex.carriagereturn.aleph.Ifraktur.Rfraktur.weierstrass.circlemultiply.circleplus.emptyset.intersection.union.propersuperset.reflexsuperset.notsubset.propersubset.reflexsubset.element.notelement.angle.gradient.registerserif.copyrightserif.trademarkserif.product.radical.dotmath.logicalnot.logicaland.logicalor.arrowdblboth.arrowdblleft.arrowdblup.arrowdblright.arrowdbldown.lozenge.angleleft.registersans.copyrightsans.trademarksans.summation.parenlefttp.parenleftex.parenleftbt.bracketlefttp.bracketleftex.bracketleftbt.bracelefttp.braceleftmid.braceleftbt.braceex..angleright.integral.integraltp.integralex.integralbt.parenrighttp.parenrightex.parenrightbt.bracketrighttp.bracketrightex.bracketrightbt.bracerighttp.bracerightmid.bracerightbt.`.split(`.`),Bo=`................................space.a1.a2.a202.a3.a4.a5.a119.a118.a117.a11.a12.a13.a14.a15.a16.a105.a17.a18.a19.a20.a21.a22.a23.a24.a25.a26.a27.a28.a6.a7.a8.a9.a10.a29.a30.a31.a32.a33.a34.a35.a36.a37.a38.a39.a40.a41.a42.a43.a44.a45.a46.a47.a48.a49.a50.a51.a52.a53.a54.a55.a56.a57.a58.a59.a60.a61.a62.a63.a64.a65.a66.a67.a68.a69.a70.a71.a72.a73.a74.a203.a75.a204.a76.a77.a78.a79.a81.a82.a83.a84.a97.a98.a99.a100..a89.a90.a93.a94.a91.a92.a205.a85.a206.a86.a87.a88.a95.a96....................a101.a102.a103.a104.a106.a107.a108.a112.a111.a110.a109.a120.a121.a122.a123.a124.a125.a126.a127.a128.a129.a130.a131.a132.a133.a134.a135.a136.a137.a138.a139.a140.a141.a142.a143.a144.a145.a146.a147.a148.a149.a150.a151.a152.a153.a154.a155.a156.a157.a158.a159.a160.a161.a163.a164.a196.a165.a192.a166.a167.a168.a169.a170.a171.a172.a173.a162.a174.a175.a176.a177.a178.a179.a193.a180.a199.a181.a200.a182..a201.a183.a184.a197.a185.a194.a198.a186.a195.a187.a188.a189.a190.a191.`.split(`.`);function Vo(e){switch(e){case`WinAnsiEncoding`:return Ro;case`StandardEncoding`:return Lo;case`MacRomanEncoding`:return Io;case`SymbolSetEncoding`:return zo;case`ZapfDingbatsEncoding`:return Bo;case`ExpertEncoding`:return Po;case`MacExpertEncoding`:return Fo;default:return null}}var Ho=sr(function(e){e.A=65,e.AE=198,e.AEacute=508,e.AEmacron=482,e.AEsmall=63462,e.Aacute=193,e.Aacutesmall=63457,e.Abreve=258,e.Abreveacute=7854,e.Abrevecyrillic=1232,e.Abrevedotbelow=7862,e.Abrevegrave=7856,e.Abrevehookabove=7858,e.Abrevetilde=7860,e.Acaron=461,e.Acircle=9398,e.Acircumflex=194,e.Acircumflexacute=7844,e.Acircumflexdotbelow=7852,e.Acircumflexgrave=7846,e.Acircumflexhookabove=7848,e.Acircumflexsmall=63458,e.Acircumflextilde=7850,e.Acute=63177,e.Acutesmall=63412,e.Acyrillic=1040,e.Adblgrave=512,e.Adieresis=196,e.Adieresiscyrillic=1234,e.Adieresismacron=478,e.Adieresissmall=63460,e.Adotbelow=7840,e.Adotmacron=480,e.Agrave=192,e.Agravesmall=63456,e.Ahookabove=7842,e.Aiecyrillic=1236,e.Ainvertedbreve=514,e.Alpha=913,e.Alphatonos=902,e.Amacron=256,e.Amonospace=65313,e.Aogonek=260,e.Aring=197,e.Aringacute=506,e.Aringbelow=7680,e.Aringsmall=63461,e.Asmall=63329,e.Atilde=195,e.Atildesmall=63459,e.Aybarmenian=1329,e.B=66,e.Bcircle=9399,e.Bdotaccent=7682,e.Bdotbelow=7684,e.Becyrillic=1041,e.Benarmenian=1330,e.Beta=914,e.Bhook=385,e.Blinebelow=7686,e.Bmonospace=65314,e.Brevesmall=63220,e.Bsmall=63330,e.Btopbar=386,e.C=67,e.Caarmenian=1342,e.Cacute=262,e.Caron=63178,e.Caronsmall=63221,e.Ccaron=268,e.Ccedilla=199,e.Ccedillaacute=7688,e.Ccedillasmall=63463,e.Ccircle=9400,e.Ccircumflex=264,e.Cdot=266,e.Cdotaccent=266,e.Cedillasmall=63416,e.Chaarmenian=1353,e.Cheabkhasiancyrillic=1212,e.Checyrillic=1063,e.Chedescenderabkhasiancyrillic=1214,e.Chedescendercyrillic=1206,e.Chedieresiscyrillic=1268,e.Cheharmenian=1347,e.Chekhakassiancyrillic=1227,e.Cheverticalstrokecyrillic=1208,e.Chi=935,e.Chook=391,e.Circumflexsmall=63222,e.Cmonospace=65315,e.Coarmenian=1361,e.Csmall=63331,e.D=68,e.DZ=497,e.DZcaron=452,e.Daarmenian=1332,e.Dafrican=393,e.Dcaron=270,e.Dcedilla=7696,e.Dcircle=9401,e.Dcircumflexbelow=7698,e.Dcroat=272,e.Ddotaccent=7690,e.Ddotbelow=7692,e.Decyrillic=1044,e.Deicoptic=1006,e.Delta=8710,e.Deltagreek=916,e.Dhook=394,e.Dieresis=63179,e.DieresisAcute=63180,e.DieresisGrave=63181,e.Dieresissmall=63400,e.Digammagreek=988,e.Djecyrillic=1026,e.Dlinebelow=7694,e.Dmonospace=65316,e.Dotaccentsmall=63223,e.Dslash=272,e.Dsmall=63332,e.Dtopbar=395,e.Dz=498,e.Dzcaron=453,e.Dzeabkhasiancyrillic=1248,e.Dzecyrillic=1029,e.Dzhecyrillic=1039,e.E=69,e.Eacute=201,e.Eacutesmall=63465,e.Ebreve=276,e.Ecaron=282,e.Ecedillabreve=7708,e.Echarmenian=1333,e.Ecircle=9402,e.Ecircumflex=202,e.Ecircumflexacute=7870,e.Ecircumflexbelow=7704,e.Ecircumflexdotbelow=7878,e.Ecircumflexgrave=7872,e.Ecircumflexhookabove=7874,e.Ecircumflexsmall=63466,e.Ecircumflextilde=7876,e.Ecyrillic=1028,e.Edblgrave=516,e.Edieresis=203,e.Edieresissmall=63467,e.Edot=278,e.Edotaccent=278,e.Edotbelow=7864,e.Efcyrillic=1060,e.Egrave=200,e.Egravesmall=63464,e.Eharmenian=1335,e.Ehookabove=7866,e.Eightroman=8551,e.Einvertedbreve=518,e.Eiotifiedcyrillic=1124,e.Elcyrillic=1051,e.Elevenroman=8554,e.Emacron=274,e.Emacronacute=7702,e.Emacrongrave=7700,e.Emcyrillic=1052,e.Emonospace=65317,e.Encyrillic=1053,e.Endescendercyrillic=1186,e.Eng=330,e.Enghecyrillic=1188,e.Enhookcyrillic=1223,e.Eogonek=280,e.Eopen=400,e.Epsilon=917,e.Epsilontonos=904,e.Ercyrillic=1056,e.Ereversed=398,e.Ereversedcyrillic=1069,e.Escyrillic=1057,e.Esdescendercyrillic=1194,e.Esh=425,e.Esmall=63333,e.Eta=919,e.Etarmenian=1336,e.Etatonos=905,e.Eth=208,e.Ethsmall=63472,e.Etilde=7868,e.Etildebelow=7706,e.Euro=8364,e.Ezh=439,e.Ezhcaron=494,e.Ezhreversed=440,e.F=70,e.Fcircle=9403,e.Fdotaccent=7710,e.Feharmenian=1366,e.Feicoptic=996,e.Fhook=401,e.Fitacyrillic=1138,e.Fiveroman=8548,e.Fmonospace=65318,e.Fourroman=8547,e.Fsmall=63334,e.G=71,e.GBsquare=13191,e.Gacute=500,e.Gamma=915,e.Gammaafrican=404,e.Gangiacoptic=1002,e.Gbreve=286,e.Gcaron=486,e.Gcedilla=290,e.Gcircle=9404,e.Gcircumflex=284,e.Gcommaaccent=290,e.Gdot=288,e.Gdotaccent=288,e.Gecyrillic=1043,e.Ghadarmenian=1346,e.Ghemiddlehookcyrillic=1172,e.Ghestrokecyrillic=1170,e.Gheupturncyrillic=1168,e.Ghook=403,e.Gimarmenian=1331,e.Gjecyrillic=1027,e.Gmacron=7712,e.Gmonospace=65319,e.Grave=63182,e.Gravesmall=63328,e.Gsmall=63335,e.Gsmallhook=667,e.Gstroke=484,e.H=72,e.H18533=9679,e.H18543=9642,e.H18551=9643,e.H22073=9633,e.HPsquare=13259,e.Haabkhasiancyrillic=1192,e.Hadescendercyrillic=1202,e.Hardsigncyrillic=1066,e.Hbar=294,e.Hbrevebelow=7722,e.Hcedilla=7720,e.Hcircle=9405,e.Hcircumflex=292,e.Hdieresis=7718,e.Hdotaccent=7714,e.Hdotbelow=7716,e.Hmonospace=65320,e.Hoarmenian=1344,e.Horicoptic=1e3,e.Hsmall=63336,e.Hungarumlaut=63183,e.Hungarumlautsmall=63224,e.Hzsquare=13200,e.I=73,e.IAcyrillic=1071,e.IJ=306,e.IUcyrillic=1070,e.Iacute=205,e.Iacutesmall=63469,e.Ibreve=300,e.Icaron=463,e.Icircle=9406,e.Icircumflex=206,e.Icircumflexsmall=63470,e.Icyrillic=1030,e.Idblgrave=520,e.Idieresis=207,e.Idieresisacute=7726,e.Idieresiscyrillic=1252,e.Idieresissmall=63471,e.Idot=304,e.Idotaccent=304,e.Idotbelow=7882,e.Iebrevecyrillic=1238,e.Iecyrillic=1045,e.Ifraktur=8465,e.Igrave=204,e.Igravesmall=63468,e.Ihookabove=7880,e.Iicyrillic=1048,e.Iinvertedbreve=522,e.Iishortcyrillic=1049,e.Imacron=298,e.Imacroncyrillic=1250,e.Imonospace=65321,e.Iniarmenian=1339,e.Iocyrillic=1025,e.Iogonek=302,e.Iota=921,e.Iotaafrican=406,e.Iotadieresis=938,e.Iotatonos=906,e.Ismall=63337,e.Istroke=407,e.Itilde=296,e.Itildebelow=7724,e.Izhitsacyrillic=1140,e.Izhitsadblgravecyrillic=1142,e.J=74,e.Jaarmenian=1345,e.Jcircle=9407,e.Jcircumflex=308,e.Jecyrillic=1032,e.Jheharmenian=1355,e.Jmonospace=65322,e.Jsmall=63338,e.K=75,e.KBsquare=13189,e.KKsquare=13261,e.Kabashkircyrillic=1184,e.Kacute=7728,e.Kacyrillic=1050,e.Kadescendercyrillic=1178,e.Kahookcyrillic=1219,e.Kappa=922,e.Kastrokecyrillic=1182,e.Kaverticalstrokecyrillic=1180,e.Kcaron=488,e.Kcedilla=310,e.Kcircle=9408,e.Kcommaaccent=310,e.Kdotbelow=7730,e.Keharmenian=1364,e.Kenarmenian=1343,e.Khacyrillic=1061,e.Kheicoptic=998,e.Khook=408,e.Kjecyrillic=1036,e.Klinebelow=7732,e.Kmonospace=65323,e.Koppacyrillic=1152,e.Koppagreek=990,e.Ksicyrillic=1134,e.Ksmall=63339,e.L=76,e.LJ=455,e.LL=63167,e.Lacute=313,e.Lambda=923,e.Lcaron=317,e.Lcedilla=315,e.Lcircle=9409,e.Lcircumflexbelow=7740,e.Lcommaaccent=315,e.Ldot=319,e.Ldotaccent=319,e.Ldotbelow=7734,e.Ldotbelowmacron=7736,e.Liwnarmenian=1340,e.Lj=456,e.Ljecyrillic=1033,e.Llinebelow=7738,e.Lmonospace=65324,e.Lslash=321,e.Lslashsmall=63225,e.Lsmall=63340,e.M=77,e.MBsquare=13190,e.Macron=63184,e.Macronsmall=63407,e.Macute=7742,e.Mcircle=9410,e.Mdotaccent=7744,e.Mdotbelow=7746,e.Menarmenian=1348,e.Mmonospace=65325,e.Msmall=63341,e.Mturned=412,e.Mu=924,e.N=78,e.NJ=458,e.Nacute=323,e.Ncaron=327,e.Ncedilla=325,e.Ncircle=9411,e.Ncircumflexbelow=7754,e.Ncommaaccent=325,e.Ndotaccent=7748,e.Ndotbelow=7750,e.Nhookleft=413,e.Nineroman=8552,e.Nj=459,e.Njecyrillic=1034,e.Nlinebelow=7752,e.Nmonospace=65326,e.Nowarmenian=1350,e.Nsmall=63342,e.Ntilde=209,e.Ntildesmall=63473,e.Nu=925,e.O=79,e.OE=338,e.OEsmall=63226,e.Oacute=211,e.Oacutesmall=63475,e.Obarredcyrillic=1256,e.Obarreddieresiscyrillic=1258,e.Obreve=334,e.Ocaron=465,e.Ocenteredtilde=415,e.Ocircle=9412,e.Ocircumflex=212,e.Ocircumflexacute=7888,e.Ocircumflexdotbelow=7896,e.Ocircumflexgrave=7890,e.Ocircumflexhookabove=7892,e.Ocircumflexsmall=63476,e.Ocircumflextilde=7894,e.Ocyrillic=1054,e.Odblacute=336,e.Odblgrave=524,e.Odieresis=214,e.Odieresiscyrillic=1254,e.Odieresissmall=63478,e.Odotbelow=7884,e.Ogoneksmall=63227,e.Ograve=210,e.Ogravesmall=63474,e.Oharmenian=1365,e.Ohm=8486,e.Ohookabove=7886,e.Ohorn=416,e.Ohornacute=7898,e.Ohorndotbelow=7906,e.Ohorngrave=7900,e.Ohornhookabove=7902,e.Ohorntilde=7904,e.Ohungarumlaut=336,e.Oi=418,e.Oinvertedbreve=526,e.Omacron=332,e.Omacronacute=7762,e.Omacrongrave=7760,e.Omega=8486,e.Omegacyrillic=1120,e.Omegagreek=937,e.Omegaroundcyrillic=1146,e.Omegatitlocyrillic=1148,e.Omegatonos=911,e.Omicron=927,e.Omicrontonos=908,e.Omonospace=65327,e.Oneroman=8544,e.Oogonek=490,e.Oogonekmacron=492,e.Oopen=390,e.Oslash=216,e.Oslashacute=510,e.Oslashsmall=63480,e.Osmall=63343,e.Ostrokeacute=510,e.Otcyrillic=1150,e.Otilde=213,e.Otildeacute=7756,e.Otildedieresis=7758,e.Otildesmall=63477,e.P=80,e.Pacute=7764,e.Pcircle=9413,e.Pdotaccent=7766,e.Pecyrillic=1055,e.Peharmenian=1354,e.Pemiddlehookcyrillic=1190,e.Phi=934,e.Phook=420,e.Pi=928,e.Piwrarmenian=1363,e.Pmonospace=65328,e.Psi=936,e.Psicyrillic=1136,e.Psmall=63344,e.Q=81,e.Qcircle=9414,e.Qmonospace=65329,e.Qsmall=63345,e.R=82,e.Raarmenian=1356,e.Racute=340,e.Rcaron=344,e.Rcedilla=342,e.Rcircle=9415,e.Rcommaaccent=342,e.Rdblgrave=528,e.Rdotaccent=7768,e.Rdotbelow=7770,e.Rdotbelowmacron=7772,e.Reharmenian=1360,e.Rfraktur=8476,e.Rho=929,e.Ringsmall=63228,e.Rinvertedbreve=530,e.Rlinebelow=7774,e.Rmonospace=65330,e.Rsmall=63346,e.Rsmallinverted=641,e.Rsmallinvertedsuperior=694,e.S=83,e.SF010000=9484,e.SF020000=9492,e.SF030000=9488,e.SF040000=9496,e.SF050000=9532,e.SF060000=9516,e.SF070000=9524,e.SF080000=9500,e.SF090000=9508,e.SF100000=9472,e.SF110000=9474,e.SF190000=9569,e.SF200000=9570,e.SF210000=9558,e.SF220000=9557,e.SF230000=9571,e.SF240000=9553,e.SF250000=9559,e.SF260000=9565,e.SF270000=9564,e.SF280000=9563,e.SF360000=9566,e.SF370000=9567,e.SF380000=9562,e.SF390000=9556,e.SF400000=9577,e.SF410000=9574,e.SF420000=9568,e.SF430000=9552,e.SF440000=9580,e.SF450000=9575,e.SF460000=9576,e.SF470000=9572,e.SF480000=9573,e.SF490000=9561,e.SF500000=9560,e.SF510000=9554,e.SF520000=9555,e.SF530000=9579,e.SF540000=9578,e.Sacute=346,e.Sacutedotaccent=7780,e.Sampigreek=992,e.Scaron=352,e.Scarondotaccent=7782,e.Scaronsmall=63229,e.Scedilla=350,e.Schwa=399,e.Schwacyrillic=1240,e.Schwadieresiscyrillic=1242,e.Scircle=9416,e.Scircumflex=348,e.Scommaaccent=536,e.Sdotaccent=7776,e.Sdotbelow=7778,e.Sdotbelowdotaccent=7784,e.Seharmenian=1357,e.Sevenroman=8550,e.Shaarmenian=1351,e.Shacyrillic=1064,e.Shchacyrillic=1065,e.Sheicoptic=994,e.Shhacyrillic=1210,e.Shimacoptic=1004,e.Sigma=931,e.Sixroman=8549,e.Smonospace=65331,e.Softsigncyrillic=1068,e.Ssmall=63347,e.Stigmagreek=986,e.T=84,e.Tau=932,e.Tbar=358,e.Tcaron=356,e.Tcedilla=354,e.Tcircle=9417,e.Tcircumflexbelow=7792,e.Tcommaaccent=354,e.Tdotaccent=7786,e.Tdotbelow=7788,e.Tecyrillic=1058,e.Tedescendercyrillic=1196,e.Tenroman=8553,e.Tetsecyrillic=1204,e.Theta=920,e.Thook=428,e.Thorn=222,e.Thornsmall=63486,e.Threeroman=8546,e.Tildesmall=63230,e.Tiwnarmenian=1359,e.Tlinebelow=7790,e.Tmonospace=65332,e.Toarmenian=1337,e.Tonefive=444,e.Tonesix=388,e.Tonetwo=423,e.Tretroflexhook=430,e.Tsecyrillic=1062,e.Tshecyrillic=1035,e.Tsmall=63348,e.Twelveroman=8555,e.Tworoman=8545,e.U=85,e.Uacute=218,e.Uacutesmall=63482,e.Ubreve=364,e.Ucaron=467,e.Ucircle=9418,e.Ucircumflex=219,e.Ucircumflexbelow=7798,e.Ucircumflexsmall=63483,e.Ucyrillic=1059,e.Udblacute=368,e.Udblgrave=532,e.Udieresis=220,e.Udieresisacute=471,e.Udieresisbelow=7794,e.Udieresiscaron=473,e.Udieresiscyrillic=1264,e.Udieresisgrave=475,e.Udieresismacron=469,e.Udieresissmall=63484,e.Udotbelow=7908,e.Ugrave=217,e.Ugravesmall=63481,e.Uhookabove=7910,e.Uhorn=431,e.Uhornacute=7912,e.Uhorndotbelow=7920,e.Uhorngrave=7914,e.Uhornhookabove=7916,e.Uhorntilde=7918,e.Uhungarumlaut=368,e.Uhungarumlautcyrillic=1266,e.Uinvertedbreve=534,e.Ukcyrillic=1144,e.Umacron=362,e.Umacroncyrillic=1262,e.Umacrondieresis=7802,e.Umonospace=65333,e.Uogonek=370,e.Upsilon=933,e.Upsilon1=978,e.Upsilonacutehooksymbolgreek=979,e.Upsilonafrican=433,e.Upsilondieresis=939,e.Upsilondieresishooksymbolgreek=980,e.Upsilonhooksymbol=978,e.Upsilontonos=910,e.Uring=366,e.Ushortcyrillic=1038,e.Usmall=63349,e.Ustraightcyrillic=1198,e.Ustraightstrokecyrillic=1200,e.Utilde=360,e.Utildeacute=7800,e.Utildebelow=7796,e.V=86,e.Vcircle=9419,e.Vdotbelow=7806,e.Vecyrillic=1042,e.Vewarmenian=1358,e.Vhook=434,e.Vmonospace=65334,e.Voarmenian=1352,e.Vsmall=63350,e.Vtilde=7804,e.W=87,e.Wacute=7810,e.Wcircle=9420,e.Wcircumflex=372,e.Wdieresis=7812,e.Wdotaccent=7814,e.Wdotbelow=7816,e.Wgrave=7808,e.Wmonospace=65335,e.Wsmall=63351,e.X=88,e.Xcircle=9421,e.Xdieresis=7820,e.Xdotaccent=7818,e.Xeharmenian=1341,e.Xi=926,e.Xmonospace=65336,e.Xsmall=63352,e.Y=89,e.Yacute=221,e.Yacutesmall=63485,e.Yatcyrillic=1122,e.Ycircle=9422,e.Ycircumflex=374,e.Ydieresis=376,e.Ydieresissmall=63487,e.Ydotaccent=7822,e.Ydotbelow=7924,e.Yericyrillic=1067,e.Yerudieresiscyrillic=1272,e.Ygrave=7922,e.Yhook=435,e.Yhookabove=7926,e.Yiarmenian=1349,e.Yicyrillic=1031,e.Yiwnarmenian=1362,e.Ymonospace=65337,e.Ysmall=63353,e.Ytilde=7928,e.Yusbigcyrillic=1130,e.Yusbigiotifiedcyrillic=1132,e.Yuslittlecyrillic=1126,e.Yuslittleiotifiedcyrillic=1128,e.Z=90,e.Zaarmenian=1334,e.Zacute=377,e.Zcaron=381,e.Zcaronsmall=63231,e.Zcircle=9423,e.Zcircumflex=7824,e.Zdot=379,e.Zdotaccent=379,e.Zdotbelow=7826,e.Zecyrillic=1047,e.Zedescendercyrillic=1176,e.Zedieresiscyrillic=1246,e.Zeta=918,e.Zhearmenian=1338,e.Zhebrevecyrillic=1217,e.Zhecyrillic=1046,e.Zhedescendercyrillic=1174,e.Zhedieresiscyrillic=1244,e.Zlinebelow=7828,e.Zmonospace=65338,e.Zsmall=63354,e.Zstroke=437,e.a=97,e.aabengali=2438,e.aacute=225,e.aadeva=2310,e.aagujarati=2694,e.aagurmukhi=2566,e.aamatragurmukhi=2622,e.aarusquare=13059,e.aavowelsignbengali=2494,e.aavowelsigndeva=2366,e.aavowelsigngujarati=2750,e.abbreviationmarkarmenian=1375,e.abbreviationsigndeva=2416,e.abengali=2437,e.abopomofo=12570,e.abreve=259,e.abreveacute=7855,e.abrevecyrillic=1233,e.abrevedotbelow=7863,e.abrevegrave=7857,e.abrevehookabove=7859,e.abrevetilde=7861,e.acaron=462,e.acircle=9424,e.acircumflex=226,e.acircumflexacute=7845,e.acircumflexdotbelow=7853,e.acircumflexgrave=7847,e.acircumflexhookabove=7849,e.acircumflextilde=7851,e.acute=180,e.acutebelowcmb=791,e.acutecmb=769,e.acutecomb=769,e.acutedeva=2388,e.acutelowmod=719,e.acutetonecmb=833,e.acyrillic=1072,e.adblgrave=513,e.addakgurmukhi=2673,e.adeva=2309,e.adieresis=228,e.adieresiscyrillic=1235,e.adieresismacron=479,e.adotbelow=7841,e.adotmacron=481,e.ae=230,e.aeacute=509,e.aekorean=12624,e.aemacron=483,e.afii00208=8213,e.afii08941=8356,e.afii10017=1040,e.afii10018=1041,e.afii10019=1042,e.afii10020=1043,e.afii10021=1044,e.afii10022=1045,e.afii10023=1025,e.afii10024=1046,e.afii10025=1047,e.afii10026=1048,e.afii10027=1049,e.afii10028=1050,e.afii10029=1051,e.afii10030=1052,e.afii10031=1053,e.afii10032=1054,e.afii10033=1055,e.afii10034=1056,e.afii10035=1057,e.afii10036=1058,e.afii10037=1059,e.afii10038=1060,e.afii10039=1061,e.afii10040=1062,e.afii10041=1063,e.afii10042=1064,e.afii10043=1065,e.afii10044=1066,e.afii10045=1067,e.afii10046=1068,e.afii10047=1069,e.afii10048=1070,e.afii10049=1071,e.afii10050=1168,e.afii10051=1026,e.afii10052=1027,e.afii10053=1028,e.afii10054=1029,e.afii10055=1030,e.afii10056=1031,e.afii10057=1032,e.afii10058=1033,e.afii10059=1034,e.afii10060=1035,e.afii10061=1036,e.afii10062=1038,e.afii10063=63172,e.afii10064=63173,e.afii10065=1072,e.afii10066=1073,e.afii10067=1074,e.afii10068=1075,e.afii10069=1076,e.afii10070=1077,e.afii10071=1105,e.afii10072=1078,e.afii10073=1079,e.afii10074=1080,e.afii10075=1081,e.afii10076=1082,e.afii10077=1083,e.afii10078=1084,e.afii10079=1085,e.afii10080=1086,e.afii10081=1087,e.afii10082=1088,e.afii10083=1089,e.afii10084=1090,e.afii10085=1091,e.afii10086=1092,e.afii10087=1093,e.afii10088=1094,e.afii10089=1095,e.afii10090=1096,e.afii10091=1097,e.afii10092=1098,e.afii10093=1099,e.afii10094=1100,e.afii10095=1101,e.afii10096=1102,e.afii10097=1103,e.afii10098=1169,e.afii10099=1106,e.afii10100=1107,e.afii10101=1108,e.afii10102=1109,e.afii10103=1110,e.afii10104=1111,e.afii10105=1112,e.afii10106=1113,e.afii10107=1114,e.afii10108=1115,e.afii10109=1116,e.afii10110=1118,e.afii10145=1039,e.afii10146=1122,e.afii10147=1138,e.afii10148=1140,e.afii10192=63174,e.afii10193=1119,e.afii10194=1123,e.afii10195=1139,e.afii10196=1141,e.afii10831=63175,e.afii10832=63176,e.afii10846=1241,e.afii299=8206,e.afii300=8207,e.afii301=8205,e.afii57381=1642,e.afii57388=1548,e.afii57392=1632,e.afii57393=1633,e.afii57394=1634,e.afii57395=1635,e.afii57396=1636,e.afii57397=1637,e.afii57398=1638,e.afii57399=1639,e.afii57400=1640,e.afii57401=1641,e.afii57403=1563,e.afii57407=1567,e.afii57409=1569,e.afii57410=1570,e.afii57411=1571,e.afii57412=1572,e.afii57413=1573,e.afii57414=1574,e.afii57415=1575,e.afii57416=1576,e.afii57417=1577,e.afii57418=1578,e.afii57419=1579,e.afii57420=1580,e.afii57421=1581,e.afii57422=1582,e.afii57423=1583,e.afii57424=1584,e.afii57425=1585,e.afii57426=1586,e.afii57427=1587,e.afii57428=1588,e.afii57429=1589,e.afii57430=1590,e.afii57431=1591,e.afii57432=1592,e.afii57433=1593,e.afii57434=1594,e.afii57440=1600,e.afii57441=1601,e.afii57442=1602,e.afii57443=1603,e.afii57444=1604,e.afii57445=1605,e.afii57446=1606,e.afii57448=1608,e.afii57449=1609,e.afii57450=1610,e.afii57451=1611,e.afii57452=1612,e.afii57453=1613,e.afii57454=1614,e.afii57455=1615,e.afii57456=1616,e.afii57457=1617,e.afii57458=1618,e.afii57470=1607,e.afii57505=1700,e.afii57506=1662,e.afii57507=1670,e.afii57508=1688,e.afii57509=1711,e.afii57511=1657,e.afii57512=1672,e.afii57513=1681,e.afii57514=1722,e.afii57519=1746,e.afii57534=1749,e.afii57636=8362,e.afii57645=1470,e.afii57658=1475,e.afii57664=1488,e.afii57665=1489,e.afii57666=1490,e.afii57667=1491,e.afii57668=1492,e.afii57669=1493,e.afii57670=1494,e.afii57671=1495,e.afii57672=1496,e.afii57673=1497,e.afii57674=1498,e.afii57675=1499,e.afii57676=1500,e.afii57677=1501,e.afii57678=1502,e.afii57679=1503,e.afii57680=1504,e.afii57681=1505,e.afii57682=1506,e.afii57683=1507,e.afii57684=1508,e.afii57685=1509,e.afii57686=1510,e.afii57687=1511,e.afii57688=1512,e.afii57689=1513,e.afii57690=1514,e.afii57694=64298,e.afii57695=64299,e.afii57700=64331,e.afii57705=64287,e.afii57716=1520,e.afii57717=1521,e.afii57718=1522,e.afii57723=64309,e.afii57793=1460,e.afii57794=1461,e.afii57795=1462,e.afii57796=1467,e.afii57797=1464,e.afii57798=1463,e.afii57799=1456,e.afii57800=1458,e.afii57801=1457,e.afii57802=1459,e.afii57803=1474,e.afii57804=1473,e.afii57806=1465,e.afii57807=1468,e.afii57839=1469,e.afii57841=1471,e.afii57842=1472,e.afii57929=700,e.afii61248=8453,e.afii61289=8467,e.afii61352=8470,e.afii61573=8236,e.afii61574=8237,e.afii61575=8238,e.afii61664=8204,e.afii63167=1645,e.afii64937=701,e.agrave=224,e.agujarati=2693,e.agurmukhi=2565,e.ahiragana=12354,e.ahookabove=7843,e.aibengali=2448,e.aibopomofo=12574,e.aideva=2320,e.aiecyrillic=1237,e.aigujarati=2704,e.aigurmukhi=2576,e.aimatragurmukhi=2632,e.ainarabic=1593,e.ainfinalarabic=65226,e.aininitialarabic=65227,e.ainmedialarabic=65228,e.ainvertedbreve=515,e.aivowelsignbengali=2504,e.aivowelsigndeva=2376,e.aivowelsigngujarati=2760,e.akatakana=12450,e.akatakanahalfwidth=65393,e.akorean=12623,e.alef=1488,e.alefarabic=1575,e.alefdageshhebrew=64304,e.aleffinalarabic=65166,e.alefhamzaabovearabic=1571,e.alefhamzaabovefinalarabic=65156,e.alefhamzabelowarabic=1573,e.alefhamzabelowfinalarabic=65160,e.alefhebrew=1488,e.aleflamedhebrew=64335,e.alefmaddaabovearabic=1570,e.alefmaddaabovefinalarabic=65154,e.alefmaksuraarabic=1609,e.alefmaksurafinalarabic=65264,e.alefmaksurainitialarabic=65267,e.alefmaksuramedialarabic=65268,e.alefpatahhebrew=64302,e.alefqamatshebrew=64303,e.aleph=8501,e.allequal=8780,e.alpha=945,e.alphatonos=940,e.amacron=257,e.amonospace=65345,e.ampersand=38,e.ampersandmonospace=65286,e.ampersandsmall=63270,e.amsquare=13250,e.anbopomofo=12578,e.angbopomofo=12580,e.angbracketleft=12296,e.angbracketright=12297,e.angkhankhuthai=3674,e.angle=8736,e.anglebracketleft=12296,e.anglebracketleftvertical=65087,e.anglebracketright=12297,e.anglebracketrightvertical=65088,e.angleleft=9001,e.angleright=9002,e.angstrom=8491,e.anoteleia=903,e.anudattadeva=2386,e.anusvarabengali=2434,e.anusvaradeva=2306,e.anusvaragujarati=2690,e.aogonek=261,e.apaatosquare=13056,e.aparen=9372,e.apostrophearmenian=1370,e.apostrophemod=700,e.apple=63743,e.approaches=8784,e.approxequal=8776,e.approxequalorimage=8786,e.approximatelyequal=8773,e.araeaekorean=12686,e.araeakorean=12685,e.arc=8978,e.arighthalfring=7834,e.aring=229,e.aringacute=507,e.aringbelow=7681,e.arrowboth=8596,e.arrowdashdown=8675,e.arrowdashleft=8672,e.arrowdashright=8674,e.arrowdashup=8673,e.arrowdblboth=8660,e.arrowdbldown=8659,e.arrowdblleft=8656,e.arrowdblright=8658,e.arrowdblup=8657,e.arrowdown=8595,e.arrowdownleft=8601,e.arrowdownright=8600,e.arrowdownwhite=8681,e.arrowheaddownmod=709,e.arrowheadleftmod=706,e.arrowheadrightmod=707,e.arrowheadupmod=708,e.arrowhorizex=63719,e.arrowleft=8592,e.arrowleftdbl=8656,e.arrowleftdblstroke=8653,e.arrowleftoverright=8646,e.arrowleftwhite=8678,e.arrowright=8594,e.arrowrightdblstroke=8655,e.arrowrightheavy=10142,e.arrowrightoverleft=8644,e.arrowrightwhite=8680,e.arrowtableft=8676,e.arrowtabright=8677,e.arrowup=8593,e.arrowupdn=8597,e.arrowupdnbse=8616,e.arrowupdownbase=8616,e.arrowupleft=8598,e.arrowupleftofdown=8645,e.arrowupright=8599,e.arrowupwhite=8679,e.arrowvertex=63718,e.asciicircum=94,e.asciicircummonospace=65342,e.asciitilde=126,e.asciitildemonospace=65374,e.ascript=593,e.ascriptturned=594,e.asmallhiragana=12353,e.asmallkatakana=12449,e.asmallkatakanahalfwidth=65383,e.asterisk=42,e.asteriskaltonearabic=1645,e.asteriskarabic=1645,e.asteriskmath=8727,e.asteriskmonospace=65290,e.asterisksmall=65121,e.asterism=8258,e.asuperior=63209,e.asymptoticallyequal=8771,e.at=64,e.atilde=227,e.atmonospace=65312,e.atsmall=65131,e.aturned=592,e.aubengali=2452,e.aubopomofo=12576,e.audeva=2324,e.augujarati=2708,e.augurmukhi=2580,e.aulengthmarkbengali=2519,e.aumatragurmukhi=2636,e.auvowelsignbengali=2508,e.auvowelsigndeva=2380,e.auvowelsigngujarati=2764,e.avagrahadeva=2365,e.aybarmenian=1377,e.ayin=1506,e.ayinaltonehebrew=64288,e.ayinhebrew=1506,e.b=98,e.babengali=2476,e.backslash=92,e.backslashmonospace=65340,e.badeva=2348,e.bagujarati=2732,e.bagurmukhi=2604,e.bahiragana=12400,e.bahtthai=3647,e.bakatakana=12496,e.bar=124,e.barmonospace=65372,e.bbopomofo=12549,e.bcircle=9425,e.bdotaccent=7683,e.bdotbelow=7685,e.beamedsixteenthnotes=9836,e.because=8757,e.becyrillic=1073,e.beharabic=1576,e.behfinalarabic=65168,e.behinitialarabic=65169,e.behiragana=12409,e.behmedialarabic=65170,e.behmeeminitialarabic=64671,e.behmeemisolatedarabic=64520,e.behnoonfinalarabic=64621,e.bekatakana=12505,e.benarmenian=1378,e.bet=1489,e.beta=946,e.betasymbolgreek=976,e.betdagesh=64305,e.betdageshhebrew=64305,e.bethebrew=1489,e.betrafehebrew=64332,e.bhabengali=2477,e.bhadeva=2349,e.bhagujarati=2733,e.bhagurmukhi=2605,e.bhook=595,e.bihiragana=12403,e.bikatakana=12499,e.bilabialclick=664,e.bindigurmukhi=2562,e.birusquare=13105,e.blackcircle=9679,e.blackdiamond=9670,e.blackdownpointingtriangle=9660,e.blackleftpointingpointer=9668,e.blackleftpointingtriangle=9664,e.blacklenticularbracketleft=12304,e.blacklenticularbracketleftvertical=65083,e.blacklenticularbracketright=12305,e.blacklenticularbracketrightvertical=65084,e.blacklowerlefttriangle=9699,e.blacklowerrighttriangle=9698,e.blackrectangle=9644,e.blackrightpointingpointer=9658,e.blackrightpointingtriangle=9654,e.blacksmallsquare=9642,e.blacksmilingface=9787,e.blacksquare=9632,e.blackstar=9733,e.blackupperlefttriangle=9700,e.blackupperrighttriangle=9701,e.blackuppointingsmalltriangle=9652,e.blackuppointingtriangle=9650,e.blank=9251,e.blinebelow=7687,e.block=9608,e.bmonospace=65346,e.bobaimaithai=3610,e.bohiragana=12412,e.bokatakana=12508,e.bparen=9373,e.bqsquare=13251,e.braceex=63732,e.braceleft=123,e.braceleftbt=63731,e.braceleftmid=63730,e.braceleftmonospace=65371,e.braceleftsmall=65115,e.bracelefttp=63729,e.braceleftvertical=65079,e.braceright=125,e.bracerightbt=63742,e.bracerightmid=63741,e.bracerightmonospace=65373,e.bracerightsmall=65116,e.bracerighttp=63740,e.bracerightvertical=65080,e.bracketleft=91,e.bracketleftbt=63728,e.bracketleftex=63727,e.bracketleftmonospace=65339,e.bracketlefttp=63726,e.bracketright=93,e.bracketrightbt=63739,e.bracketrightex=63738,e.bracketrightmonospace=65341,e.bracketrighttp=63737,e.breve=728,e.brevebelowcmb=814,e.brevecmb=774,e.breveinvertedbelowcmb=815,e.breveinvertedcmb=785,e.breveinverteddoublecmb=865,e.bridgebelowcmb=810,e.bridgeinvertedbelowcmb=826,e.brokenbar=166,e.bstroke=384,e.bsuperior=63210,e.btopbar=387,e.buhiragana=12406,e.bukatakana=12502,e.bullet=8226,e.bulletinverse=9688,e.bulletoperator=8729,e.bullseye=9678,e.c=99,e.caarmenian=1390,e.cabengali=2458,e.cacute=263,e.cadeva=2330,e.cagujarati=2714,e.cagurmukhi=2586,e.calsquare=13192,e.candrabindubengali=2433,e.candrabinducmb=784,e.candrabindudeva=2305,e.candrabindugujarati=2689,e.capslock=8682,e.careof=8453,e.caron=711,e.caronbelowcmb=812,e.caroncmb=780,e.carriagereturn=8629,e.cbopomofo=12568,e.ccaron=269,e.ccedilla=231,e.ccedillaacute=7689,e.ccircle=9426,e.ccircumflex=265,e.ccurl=597,e.cdot=267,e.cdotaccent=267,e.cdsquare=13253,e.cedilla=184,e.cedillacmb=807,e.cent=162,e.centigrade=8451,e.centinferior=63199,e.centmonospace=65504,e.centoldstyle=63394,e.centsuperior=63200,e.chaarmenian=1401,e.chabengali=2459,e.chadeva=2331,e.chagujarati=2715,e.chagurmukhi=2587,e.chbopomofo=12564,e.cheabkhasiancyrillic=1213,e.checkmark=10003,e.checyrillic=1095,e.chedescenderabkhasiancyrillic=1215,e.chedescendercyrillic=1207,e.chedieresiscyrillic=1269,e.cheharmenian=1395,e.chekhakassiancyrillic=1228,e.cheverticalstrokecyrillic=1209,e.chi=967,e.chieuchacirclekorean=12919,e.chieuchaparenkorean=12823,e.chieuchcirclekorean=12905,e.chieuchkorean=12618,e.chieuchparenkorean=12809,e.chochangthai=3594,e.chochanthai=3592,e.chochingthai=3593,e.chochoethai=3596,e.chook=392,e.cieucacirclekorean=12918,e.cieucaparenkorean=12822,e.cieuccirclekorean=12904,e.cieuckorean=12616,e.cieucparenkorean=12808,e.cieucuparenkorean=12828,e.circle=9675,e.circlecopyrt=169,e.circlemultiply=8855,e.circleot=8857,e.circleplus=8853,e.circlepostalmark=12342,e.circlewithlefthalfblack=9680,e.circlewithrighthalfblack=9681,e.circumflex=710,e.circumflexbelowcmb=813,e.circumflexcmb=770,e.clear=8999,e.clickalveolar=450,e.clickdental=448,e.clicklateral=449,e.clickretroflex=451,e.club=9827,e.clubsuitblack=9827,e.clubsuitwhite=9831,e.cmcubedsquare=13220,e.cmonospace=65347,e.cmsquaredsquare=13216,e.coarmenian=1409,e.colon=58,e.colonmonetary=8353,e.colonmonospace=65306,e.colonsign=8353,e.colonsmall=65109,e.colontriangularhalfmod=721,e.colontriangularmod=720,e.comma=44,e.commaabovecmb=787,e.commaaboverightcmb=789,e.commaaccent=63171,e.commaarabic=1548,e.commaarmenian=1373,e.commainferior=63201,e.commamonospace=65292,e.commareversedabovecmb=788,e.commareversedmod=701,e.commasmall=65104,e.commasuperior=63202,e.commaturnedabovecmb=786,e.commaturnedmod=699,e.compass=9788,e.congruent=8773,e.contourintegral=8750,e.control=8963,e.controlACK=6,e.controlBEL=7,e.controlBS=8,e.controlCAN=24,e.controlCR=13,e.controlDC1=17,e.controlDC2=18,e.controlDC3=19,e.controlDC4=20,e.controlDEL=127,e.controlDLE=16,e.controlEM=25,e.controlENQ=5,e.controlEOT=4,e.controlESC=27,e.controlETB=23,e.controlETX=3,e.controlFF=12,e.controlFS=28,e.controlGS=29,e.controlHT=9,e.controlLF=10,e.controlNAK=21,e.controlNULL=0,e.controlRS=30,e.controlSI=15,e.controlSO=14,e.controlSOT=2,e.controlSTX=1,e.controlSUB=26,e.controlSYN=22,e.controlUS=31,e.controlVT=11,e.copyright=169,e.copyrightsans=63721,e.copyrightserif=63193,e.cornerbracketleft=12300,e.cornerbracketlefthalfwidth=65378,e.cornerbracketleftvertical=65089,e.cornerbracketright=12301,e.cornerbracketrighthalfwidth=65379,e.cornerbracketrightvertical=65090,e.corporationsquare=13183,e.cosquare=13255,e.coverkgsquare=13254,e.cparen=9374,e.cruzeiro=8354,e.cstretched=663,e.curlyand=8911,e.curlyor=8910,e.currency=164,e.cyrBreve=63185,e.cyrFlex=63186,e.cyrbreve=63188,e.cyrflex=63189,e.d=100,e.daarmenian=1380,e.dabengali=2470,e.dadarabic=1590,e.dadeva=2342,e.dadfinalarabic=65214,e.dadinitialarabic=65215,e.dadmedialarabic=65216,e.dagesh=1468,e.dageshhebrew=1468,e.dagger=8224,e.daggerdbl=8225,e.dagujarati=2726,e.dagurmukhi=2598,e.dahiragana=12384,e.dakatakana=12480,e.dalarabic=1583,e.dalet=1491,e.daletdagesh=64307,e.daletdageshhebrew=64307,e.dalethebrew=1491,e.dalfinalarabic=65194,e.dammaarabic=1615,e.dammalowarabic=1615,e.dammatanaltonearabic=1612,e.dammatanarabic=1612,e.danda=2404,e.dargahebrew=1447,e.dargalefthebrew=1447,e.dasiapneumatacyrilliccmb=1157,e.dblGrave=63187,e.dblanglebracketleft=12298,e.dblanglebracketleftvertical=65085,e.dblanglebracketright=12299,e.dblanglebracketrightvertical=65086,e.dblarchinvertedbelowcmb=811,e.dblarrowleft=8660,e.dblarrowright=8658,e.dbldanda=2405,e.dblgrave=63190,e.dblgravecmb=783,e.dblintegral=8748,e.dbllowline=8215,e.dbllowlinecmb=819,e.dbloverlinecmb=831,e.dblprimemod=698,e.dblverticalbar=8214,e.dblverticallineabovecmb=782,e.dbopomofo=12553,e.dbsquare=13256,e.dcaron=271,e.dcedilla=7697,e.dcircle=9427,e.dcircumflexbelow=7699,e.dcroat=273,e.ddabengali=2465,e.ddadeva=2337,e.ddagujarati=2721,e.ddagurmukhi=2593,e.ddalarabic=1672,e.ddalfinalarabic=64393,e.dddhadeva=2396,e.ddhabengali=2466,e.ddhadeva=2338,e.ddhagujarati=2722,e.ddhagurmukhi=2594,e.ddotaccent=7691,e.ddotbelow=7693,e.decimalseparatorarabic=1643,e.decimalseparatorpersian=1643,e.decyrillic=1076,e.degree=176,e.dehihebrew=1453,e.dehiragana=12391,e.deicoptic=1007,e.dekatakana=12487,e.deleteleft=9003,e.deleteright=8998,e.delta=948,e.deltaturned=397,e.denominatorminusonenumeratorbengali=2552,e.dezh=676,e.dhabengali=2471,e.dhadeva=2343,e.dhagujarati=2727,e.dhagurmukhi=2599,e.dhook=599,e.dialytikatonos=901,e.dialytikatonoscmb=836,e.diamond=9830,e.diamondsuitwhite=9826,e.dieresis=168,e.dieresisacute=63191,e.dieresisbelowcmb=804,e.dieresiscmb=776,e.dieresisgrave=63192,e.dieresistonos=901,e.dihiragana=12386,e.dikatakana=12482,e.dittomark=12291,e.divide=247,e.divides=8739,e.divisionslash=8725,e.djecyrillic=1106,e.dkshade=9619,e.dlinebelow=7695,e.dlsquare=13207,e.dmacron=273,e.dmonospace=65348,e.dnblock=9604,e.dochadathai=3598,e.dodekthai=3604,e.dohiragana=12393,e.dokatakana=12489,e.dollar=36,e.dollarinferior=63203,e.dollarmonospace=65284,e.dollaroldstyle=63268,e.dollarsmall=65129,e.dollarsuperior=63204,e.dong=8363,e.dorusquare=13094,e.dotaccent=729,e.dotaccentcmb=775,e.dotbelowcmb=803,e.dotbelowcomb=803,e.dotkatakana=12539,e.dotlessi=305,e.dotlessj=63166,e.dotlessjstrokehook=644,e.dotmath=8901,e.dottedcircle=9676,e.doubleyodpatah=64287,e.doubleyodpatahhebrew=64287,e.downtackbelowcmb=798,e.downtackmod=725,e.dparen=9375,e.dsuperior=63211,e.dtail=598,e.dtopbar=396,e.duhiragana=12389,e.dukatakana=12485,e.dz=499,e.dzaltone=675,e.dzcaron=454,e.dzcurl=677,e.dzeabkhasiancyrillic=1249,e.dzecyrillic=1109,e.dzhecyrillic=1119,e.e=101,e.eacute=233,e.earth=9793,e.ebengali=2447,e.ebopomofo=12572,e.ebreve=277,e.ecandradeva=2317,e.ecandragujarati=2701,e.ecandravowelsigndeva=2373,e.ecandravowelsigngujarati=2757,e.ecaron=283,e.ecedillabreve=7709,e.echarmenian=1381,e.echyiwnarmenian=1415,e.ecircle=9428,e.ecircumflex=234,e.ecircumflexacute=7871,e.ecircumflexbelow=7705,e.ecircumflexdotbelow=7879,e.ecircumflexgrave=7873,e.ecircumflexhookabove=7875,e.ecircumflextilde=7877,e.ecyrillic=1108,e.edblgrave=517,e.edeva=2319,e.edieresis=235,e.edot=279,e.edotaccent=279,e.edotbelow=7865,e.eegurmukhi=2575,e.eematragurmukhi=2631,e.efcyrillic=1092,e.egrave=232,e.egujarati=2703,e.eharmenian=1383,e.ehbopomofo=12573,e.ehiragana=12360,e.ehookabove=7867,e.eibopomofo=12575,e.eight=56,e.eightarabic=1640,e.eightbengali=2542,e.eightcircle=9319,e.eightcircleinversesansserif=10129,e.eightdeva=2414,e.eighteencircle=9329,e.eighteenparen=9349,e.eighteenperiod=9369,e.eightgujarati=2798,e.eightgurmukhi=2670,e.eighthackarabic=1640,e.eighthangzhou=12328,e.eighthnotebeamed=9835,e.eightideographicparen=12839,e.eightinferior=8328,e.eightmonospace=65304,e.eightoldstyle=63288,e.eightparen=9339,e.eightperiod=9359,e.eightpersian=1784,e.eightroman=8567,e.eightsuperior=8312,e.eightthai=3672,e.einvertedbreve=519,e.eiotifiedcyrillic=1125,e.ekatakana=12456,e.ekatakanahalfwidth=65396,e.ekonkargurmukhi=2676,e.ekorean=12628,e.elcyrillic=1083,e.element=8712,e.elevencircle=9322,e.elevenparen=9342,e.elevenperiod=9362,e.elevenroman=8570,e.ellipsis=8230,e.ellipsisvertical=8942,e.emacron=275,e.emacronacute=7703,e.emacrongrave=7701,e.emcyrillic=1084,e.emdash=8212,e.emdashvertical=65073,e.emonospace=65349,e.emphasismarkarmenian=1371,e.emptyset=8709,e.enbopomofo=12579,e.encyrillic=1085,e.endash=8211,e.endashvertical=65074,e.endescendercyrillic=1187,e.eng=331,e.engbopomofo=12581,e.enghecyrillic=1189,e.enhookcyrillic=1224,e.enspace=8194,e.eogonek=281,e.eokorean=12627,e.eopen=603,e.eopenclosed=666,e.eopenreversed=604,e.eopenreversedclosed=606,e.eopenreversedhook=605,e.eparen=9376,e.epsilon=949,e.epsilontonos=941,e.equal=61,e.equalmonospace=65309,e.equalsmall=65126,e.equalsuperior=8316,e.equivalence=8801,e.erbopomofo=12582,e.ercyrillic=1088,e.ereversed=600,e.ereversedcyrillic=1101,e.escyrillic=1089,e.esdescendercyrillic=1195,e.esh=643,e.eshcurl=646,e.eshortdeva=2318,e.eshortvowelsigndeva=2374,e.eshreversedloop=426,e.eshsquatreversed=645,e.esmallhiragana=12359,e.esmallkatakana=12455,e.esmallkatakanahalfwidth=65386,e.estimated=8494,e.esuperior=63212,e.eta=951,e.etarmenian=1384,e.etatonos=942,e.eth=240,e.etilde=7869,e.etildebelow=7707,e.etnahtafoukhhebrew=1425,e.etnahtafoukhlefthebrew=1425,e.etnahtahebrew=1425,e.etnahtalefthebrew=1425,e.eturned=477,e.eukorean=12641,e.euro=8364,e.evowelsignbengali=2503,e.evowelsigndeva=2375,e.evowelsigngujarati=2759,e.exclam=33,e.exclamarmenian=1372,e.exclamdbl=8252,e.exclamdown=161,e.exclamdownsmall=63393,e.exclammonospace=65281,e.exclamsmall=63265,e.existential=8707,e.ezh=658,e.ezhcaron=495,e.ezhcurl=659,e.ezhreversed=441,e.ezhtail=442,e.f=102,e.fadeva=2398,e.fagurmukhi=2654,e.fahrenheit=8457,e.fathaarabic=1614,e.fathalowarabic=1614,e.fathatanarabic=1611,e.fbopomofo=12552,e.fcircle=9429,e.fdotaccent=7711,e.feharabic=1601,e.feharmenian=1414,e.fehfinalarabic=65234,e.fehinitialarabic=65235,e.fehmedialarabic=65236,e.feicoptic=997,e.female=9792,e.ff=64256,e.f_f=64256,e.ffi=64259,e.f_f_i=64259,e.ffl=64260,e.f_f_l=64260,e.fi=64257,e.f_i=64257,e.fifteencircle=9326,e.fifteenparen=9346,e.fifteenperiod=9366,e.figuredash=8210,e.filledbox=9632,e.filledrect=9644,e.finalkaf=1498,e.finalkafdagesh=64314,e.finalkafdageshhebrew=64314,e.finalkafhebrew=1498,e.finalmem=1501,e.finalmemhebrew=1501,e.finalnun=1503,e.finalnunhebrew=1503,e.finalpe=1507,e.finalpehebrew=1507,e.finaltsadi=1509,e.finaltsadihebrew=1509,e.firsttonechinese=713,e.fisheye=9673,e.fitacyrillic=1139,e.five=53,e.fivearabic=1637,e.fivebengali=2539,e.fivecircle=9316,e.fivecircleinversesansserif=10126,e.fivedeva=2411,e.fiveeighths=8541,e.fivegujarati=2795,e.fivegurmukhi=2667,e.fivehackarabic=1637,e.fivehangzhou=12325,e.fiveideographicparen=12836,e.fiveinferior=8325,e.fivemonospace=65301,e.fiveoldstyle=63285,e.fiveparen=9336,e.fiveperiod=9356,e.fivepersian=1781,e.fiveroman=8564,e.fivesuperior=8309,e.fivethai=3669,e.fl=64258,e.f_l=64258,e.florin=402,e.fmonospace=65350,e.fmsquare=13209,e.fofanthai=3615,e.fofathai=3613,e.fongmanthai=3663,e.forall=8704,e.four=52,e.fourarabic=1636,e.fourbengali=2538,e.fourcircle=9315,e.fourcircleinversesansserif=10125,e.fourdeva=2410,e.fourgujarati=2794,e.fourgurmukhi=2666,e.fourhackarabic=1636,e.fourhangzhou=12324,e.fourideographicparen=12835,e.fourinferior=8324,e.fourmonospace=65300,e.fournumeratorbengali=2551,e.fouroldstyle=63284,e.fourparen=9335,e.fourperiod=9355,e.fourpersian=1780,e.fourroman=8563,e.foursuperior=8308,e.fourteencircle=9325,e.fourteenparen=9345,e.fourteenperiod=9365,e.fourthai=3668,e.fourthtonechinese=715,e.fparen=9377,e.fraction=8260,e.franc=8355,e.g=103,e.gabengali=2455,e.gacute=501,e.gadeva=2327,e.gafarabic=1711,e.gaffinalarabic=64403,e.gafinitialarabic=64404,e.gafmedialarabic=64405,e.gagujarati=2711,e.gagurmukhi=2583,e.gahiragana=12364,e.gakatakana=12460,e.gamma=947,e.gammalatinsmall=611,e.gammasuperior=736,e.gangiacoptic=1003,e.gbopomofo=12557,e.gbreve=287,e.gcaron=487,e.gcedilla=291,e.gcircle=9430,e.gcircumflex=285,e.gcommaaccent=291,e.gdot=289,e.gdotaccent=289,e.gecyrillic=1075,e.gehiragana=12370,e.gekatakana=12466,e.geometricallyequal=8785,e.gereshaccenthebrew=1436,e.gereshhebrew=1523,e.gereshmuqdamhebrew=1437,e.germandbls=223,e.gershayimaccenthebrew=1438,e.gershayimhebrew=1524,e.getamark=12307,e.ghabengali=2456,e.ghadarmenian=1394,e.ghadeva=2328,e.ghagujarati=2712,e.ghagurmukhi=2584,e.ghainarabic=1594,e.ghainfinalarabic=65230,e.ghaininitialarabic=65231,e.ghainmedialarabic=65232,e.ghemiddlehookcyrillic=1173,e.ghestrokecyrillic=1171,e.gheupturncyrillic=1169,e.ghhadeva=2394,e.ghhagurmukhi=2650,e.ghook=608,e.ghzsquare=13203,e.gihiragana=12366,e.gikatakana=12462,e.gimarmenian=1379,e.gimel=1490,e.gimeldagesh=64306,e.gimeldageshhebrew=64306,e.gimelhebrew=1490,e.gjecyrillic=1107,e.glottalinvertedstroke=446,e.glottalstop=660,e.glottalstopinverted=662,e.glottalstopmod=704,e.glottalstopreversed=661,e.glottalstopreversedmod=705,e.glottalstopreversedsuperior=740,e.glottalstopstroke=673,e.glottalstopstrokereversed=674,e.gmacron=7713,e.gmonospace=65351,e.gohiragana=12372,e.gokatakana=12468,e.gparen=9378,e.gpasquare=13228,e.gradient=8711,e.grave=96,e.gravebelowcmb=790,e.gravecmb=768,e.gravecomb=768,e.gravedeva=2387,e.gravelowmod=718,e.gravemonospace=65344,e.gravetonecmb=832,e.greater=62,e.greaterequal=8805,e.greaterequalorless=8923,e.greatermonospace=65310,e.greaterorequivalent=8819,e.greaterorless=8823,e.greateroverequal=8807,e.greatersmall=65125,e.gscript=609,e.gstroke=485,e.guhiragana=12368,e.guillemotleft=171,e.guillemotright=187,e.guilsinglleft=8249,e.guilsinglright=8250,e.gukatakana=12464,e.guramusquare=13080,e.gysquare=13257,e.h=104,e.haabkhasiancyrillic=1193,e.haaltonearabic=1729,e.habengali=2489,e.hadescendercyrillic=1203,e.hadeva=2361,e.hagujarati=2745,e.hagurmukhi=2617,e.haharabic=1581,e.hahfinalarabic=65186,e.hahinitialarabic=65187,e.hahiragana=12399,e.hahmedialarabic=65188,e.haitusquare=13098,e.hakatakana=12495,e.hakatakanahalfwidth=65418,e.halantgurmukhi=2637,e.hamzaarabic=1569,e.hamzalowarabic=1569,e.hangulfiller=12644,e.hardsigncyrillic=1098,e.harpoonleftbarbup=8636,e.harpoonrightbarbup=8640,e.hasquare=13258,e.hatafpatah=1458,e.hatafpatah16=1458,e.hatafpatah23=1458,e.hatafpatah2f=1458,e.hatafpatahhebrew=1458,e.hatafpatahnarrowhebrew=1458,e.hatafpatahquarterhebrew=1458,e.hatafpatahwidehebrew=1458,e.hatafqamats=1459,e.hatafqamats1b=1459,e.hatafqamats28=1459,e.hatafqamats34=1459,e.hatafqamatshebrew=1459,e.hatafqamatsnarrowhebrew=1459,e.hatafqamatsquarterhebrew=1459,e.hatafqamatswidehebrew=1459,e.hatafsegol=1457,e.hatafsegol17=1457,e.hatafsegol24=1457,e.hatafsegol30=1457,e.hatafsegolhebrew=1457,e.hatafsegolnarrowhebrew=1457,e.hatafsegolquarterhebrew=1457,e.hatafsegolwidehebrew=1457,e.hbar=295,e.hbopomofo=12559,e.hbrevebelow=7723,e.hcedilla=7721,e.hcircle=9431,e.hcircumflex=293,e.hdieresis=7719,e.hdotaccent=7715,e.hdotbelow=7717,e.he=1492,e.heart=9829,e.heartsuitblack=9829,e.heartsuitwhite=9825,e.hedagesh=64308,e.hedageshhebrew=64308,e.hehaltonearabic=1729,e.heharabic=1607,e.hehebrew=1492,e.hehfinalaltonearabic=64423,e.hehfinalalttwoarabic=65258,e.hehfinalarabic=65258,e.hehhamzaabovefinalarabic=64421,e.hehhamzaaboveisolatedarabic=64420,e.hehinitialaltonearabic=64424,e.hehinitialarabic=65259,e.hehiragana=12408,e.hehmedialaltonearabic=64425,e.hehmedialarabic=65260,e.heiseierasquare=13179,e.hekatakana=12504,e.hekatakanahalfwidth=65421,e.hekutaarusquare=13110,e.henghook=615,e.herutusquare=13113,e.het=1495,e.hethebrew=1495,e.hhook=614,e.hhooksuperior=689,e.hieuhacirclekorean=12923,e.hieuhaparenkorean=12827,e.hieuhcirclekorean=12909,e.hieuhkorean=12622,e.hieuhparenkorean=12813,e.hihiragana=12402,e.hikatakana=12498,e.hikatakanahalfwidth=65419,e.hiriq=1460,e.hiriq14=1460,e.hiriq21=1460,e.hiriq2d=1460,e.hiriqhebrew=1460,e.hiriqnarrowhebrew=1460,e.hiriqquarterhebrew=1460,e.hiriqwidehebrew=1460,e.hlinebelow=7830,e.hmonospace=65352,e.hoarmenian=1392,e.hohipthai=3627,e.hohiragana=12411,e.hokatakana=12507,e.hokatakanahalfwidth=65422,e.holam=1465,e.holam19=1465,e.holam26=1465,e.holam32=1465,e.holamhebrew=1465,e.holamnarrowhebrew=1465,e.holamquarterhebrew=1465,e.holamwidehebrew=1465,e.honokhukthai=3630,e.hookabovecomb=777,e.hookcmb=777,e.hookpalatalizedbelowcmb=801,e.hookretroflexbelowcmb=802,e.hoonsquare=13122,e.horicoptic=1001,e.horizontalbar=8213,e.horncmb=795,e.hotsprings=9832,e.house=8962,e.hparen=9379,e.hsuperior=688,e.hturned=613,e.huhiragana=12405,e.huiitosquare=13107,e.hukatakana=12501,e.hukatakanahalfwidth=65420,e.hungarumlaut=733,e.hungarumlautcmb=779,e.hv=405,e.hyphen=45,e.hypheninferior=63205,e.hyphenmonospace=65293,e.hyphensmall=65123,e.hyphensuperior=63206,e.hyphentwo=8208,e.i=105,e.iacute=237,e.iacyrillic=1103,e.ibengali=2439,e.ibopomofo=12583,e.ibreve=301,e.icaron=464,e.icircle=9432,e.icircumflex=238,e.icyrillic=1110,e.idblgrave=521,e.ideographearthcircle=12943,e.ideographfirecircle=12939,e.ideographicallianceparen=12863,e.ideographiccallparen=12858,e.ideographiccentrecircle=12965,e.ideographicclose=12294,e.ideographiccomma=12289,e.ideographiccommaleft=65380,e.ideographiccongratulationparen=12855,e.ideographiccorrectcircle=12963,e.ideographicearthparen=12847,e.ideographicenterpriseparen=12861,e.ideographicexcellentcircle=12957,e.ideographicfestivalparen=12864,e.ideographicfinancialcircle=12950,e.ideographicfinancialparen=12854,e.ideographicfireparen=12843,e.ideographichaveparen=12850,e.ideographichighcircle=12964,e.ideographiciterationmark=12293,e.ideographiclaborcircle=12952,e.ideographiclaborparen=12856,e.ideographicleftcircle=12967,e.ideographiclowcircle=12966,e.ideographicmedicinecircle=12969,e.ideographicmetalparen=12846,e.ideographicmoonparen=12842,e.ideographicnameparen=12852,e.ideographicperiod=12290,e.ideographicprintcircle=12958,e.ideographicreachparen=12867,e.ideographicrepresentparen=12857,e.ideographicresourceparen=12862,e.ideographicrightcircle=12968,e.ideographicsecretcircle=12953,e.ideographicselfparen=12866,e.ideographicsocietyparen=12851,e.ideographicspace=12288,e.ideographicspecialparen=12853,e.ideographicstockparen=12849,e.ideographicstudyparen=12859,e.ideographicsunparen=12848,e.ideographicsuperviseparen=12860,e.ideographicwaterparen=12844,e.ideographicwoodparen=12845,e.ideographiczero=12295,e.ideographmetalcircle=12942,e.ideographmooncircle=12938,e.ideographnamecircle=12948,e.ideographsuncircle=12944,e.ideographwatercircle=12940,e.ideographwoodcircle=12941,e.ideva=2311,e.idieresis=239,e.idieresisacute=7727,e.idieresiscyrillic=1253,e.idotbelow=7883,e.iebrevecyrillic=1239,e.iecyrillic=1077,e.ieungacirclekorean=12917,e.ieungaparenkorean=12821,e.ieungcirclekorean=12903,e.ieungkorean=12615,e.ieungparenkorean=12807,e.igrave=236,e.igujarati=2695,e.igurmukhi=2567,e.ihiragana=12356,e.ihookabove=7881,e.iibengali=2440,e.iicyrillic=1080,e.iideva=2312,e.iigujarati=2696,e.iigurmukhi=2568,e.iimatragurmukhi=2624,e.iinvertedbreve=523,e.iishortcyrillic=1081,e.iivowelsignbengali=2496,e.iivowelsigndeva=2368,e.iivowelsigngujarati=2752,e.ij=307,e.ikatakana=12452,e.ikatakanahalfwidth=65394,e.ikorean=12643,e.ilde=732,e.iluyhebrew=1452,e.imacron=299,e.imacroncyrillic=1251,e.imageorapproximatelyequal=8787,e.imatragurmukhi=2623,e.imonospace=65353,e.increment=8710,e.infinity=8734,e.iniarmenian=1387,e.integral=8747,e.integralbottom=8993,e.integralbt=8993,e.integralex=63733,e.integraltop=8992,e.integraltp=8992,e.intersection=8745,e.intisquare=13061,e.invbullet=9688,e.invcircle=9689,e.invsmileface=9787,e.iocyrillic=1105,e.iogonek=303,e.iota=953,e.iotadieresis=970,e.iotadieresistonos=912,e.iotalatin=617,e.iotatonos=943,e.iparen=9380,e.irigurmukhi=2674,e.ismallhiragana=12355,e.ismallkatakana=12451,e.ismallkatakanahalfwidth=65384,e.issharbengali=2554,e.istroke=616,e.isuperior=63213,e.iterationhiragana=12445,e.iterationkatakana=12541,e.itilde=297,e.itildebelow=7725,e.iubopomofo=12585,e.iucyrillic=1102,e.ivowelsignbengali=2495,e.ivowelsigndeva=2367,e.ivowelsigngujarati=2751,e.izhitsacyrillic=1141,e.izhitsadblgravecyrillic=1143,e.j=106,e.jaarmenian=1393,e.jabengali=2460,e.jadeva=2332,e.jagujarati=2716,e.jagurmukhi=2588,e.jbopomofo=12560,e.jcaron=496,e.jcircle=9433,e.jcircumflex=309,e.jcrossedtail=669,e.jdotlessstroke=607,e.jecyrillic=1112,e.jeemarabic=1580,e.jeemfinalarabic=65182,e.jeeminitialarabic=65183,e.jeemmedialarabic=65184,e.jeharabic=1688,e.jehfinalarabic=64395,e.jhabengali=2461,e.jhadeva=2333,e.jhagujarati=2717,e.jhagurmukhi=2589,e.jheharmenian=1403,e.jis=12292,e.jmonospace=65354,e.jparen=9381,e.jsuperior=690,e.k=107,e.kabashkircyrillic=1185,e.kabengali=2453,e.kacute=7729,e.kacyrillic=1082,e.kadescendercyrillic=1179,e.kadeva=2325,e.kaf=1499,e.kafarabic=1603,e.kafdagesh=64315,e.kafdageshhebrew=64315,e.kaffinalarabic=65242,e.kafhebrew=1499,e.kafinitialarabic=65243,e.kafmedialarabic=65244,e.kafrafehebrew=64333,e.kagujarati=2709,e.kagurmukhi=2581,e.kahiragana=12363,e.kahookcyrillic=1220,e.kakatakana=12459,e.kakatakanahalfwidth=65398,e.kappa=954,e.kappasymbolgreek=1008,e.kapyeounmieumkorean=12657,e.kapyeounphieuphkorean=12676,e.kapyeounpieupkorean=12664,e.kapyeounssangpieupkorean=12665,e.karoriisquare=13069,e.kashidaautoarabic=1600,e.kashidaautonosidebearingarabic=1600,e.kasmallkatakana=12533,e.kasquare=13188,e.kasraarabic=1616,e.kasratanarabic=1613,e.kastrokecyrillic=1183,e.katahiraprolongmarkhalfwidth=65392,e.kaverticalstrokecyrillic=1181,e.kbopomofo=12558,e.kcalsquare=13193,e.kcaron=489,e.kcedilla=311,e.kcircle=9434,e.kcommaaccent=311,e.kdotbelow=7731,e.keharmenian=1412,e.kehiragana=12369,e.kekatakana=12465,e.kekatakanahalfwidth=65401,e.kenarmenian=1391,e.kesmallkatakana=12534,e.kgreenlandic=312,e.khabengali=2454,e.khacyrillic=1093,e.khadeva=2326,e.khagujarati=2710,e.khagurmukhi=2582,e.khaharabic=1582,e.khahfinalarabic=65190,e.khahinitialarabic=65191,e.khahmedialarabic=65192,e.kheicoptic=999,e.khhadeva=2393,e.khhagurmukhi=2649,e.khieukhacirclekorean=12920,e.khieukhaparenkorean=12824,e.khieukhcirclekorean=12906,e.khieukhkorean=12619,e.khieukhparenkorean=12810,e.khokhaithai=3586,e.khokhonthai=3589,e.khokhuatthai=3587,e.khokhwaithai=3588,e.khomutthai=3675,e.khook=409,e.khorakhangthai=3590,e.khzsquare=13201,e.kihiragana=12365,e.kikatakana=12461,e.kikatakanahalfwidth=65399,e.kiroguramusquare=13077,e.kiromeetorusquare=13078,e.kirosquare=13076,e.kiyeokacirclekorean=12910,e.kiyeokaparenkorean=12814,e.kiyeokcirclekorean=12896,e.kiyeokkorean=12593,e.kiyeokparenkorean=12800,e.kiyeoksioskorean=12595,e.kjecyrillic=1116,e.klinebelow=7733,e.klsquare=13208,e.kmcubedsquare=13222,e.kmonospace=65355,e.kmsquaredsquare=13218,e.kohiragana=12371,e.kohmsquare=13248,e.kokaithai=3585,e.kokatakana=12467,e.kokatakanahalfwidth=65402,e.kooposquare=13086,e.koppacyrillic=1153,e.koreanstandardsymbol=12927,e.koroniscmb=835,e.kparen=9382,e.kpasquare=13226,e.ksicyrillic=1135,e.ktsquare=13263,e.kturned=670,e.kuhiragana=12367,e.kukatakana=12463,e.kukatakanahalfwidth=65400,e.kvsquare=13240,e.kwsquare=13246,e.l=108,e.labengali=2482,e.lacute=314,e.ladeva=2354,e.lagujarati=2738,e.lagurmukhi=2610,e.lakkhangyaothai=3653,e.lamaleffinalarabic=65276,e.lamalefhamzaabovefinalarabic=65272,e.lamalefhamzaaboveisolatedarabic=65271,e.lamalefhamzabelowfinalarabic=65274,e.lamalefhamzabelowisolatedarabic=65273,e.lamalefisolatedarabic=65275,e.lamalefmaddaabovefinalarabic=65270,e.lamalefmaddaaboveisolatedarabic=65269,e.lamarabic=1604,e.lambda=955,e.lambdastroke=411,e.lamed=1500,e.lameddagesh=64316,e.lameddageshhebrew=64316,e.lamedhebrew=1500,e.lamfinalarabic=65246,e.lamhahinitialarabic=64714,e.laminitialarabic=65247,e.lamjeeminitialarabic=64713,e.lamkhahinitialarabic=64715,e.lamlamhehisolatedarabic=65010,e.lammedialarabic=65248,e.lammeemhahinitialarabic=64904,e.lammeeminitialarabic=64716,e.largecircle=9711,e.lbar=410,e.lbelt=620,e.lbopomofo=12556,e.lcaron=318,e.lcedilla=316,e.lcircle=9435,e.lcircumflexbelow=7741,e.lcommaaccent=316,e.ldot=320,e.ldotaccent=320,e.ldotbelow=7735,e.ldotbelowmacron=7737,e.leftangleabovecmb=794,e.lefttackbelowcmb=792,e.less=60,e.lessequal=8804,e.lessequalorgreater=8922,e.lessmonospace=65308,e.lessorequivalent=8818,e.lessorgreater=8822,e.lessoverequal=8806,e.lesssmall=65124,e.lezh=622,e.lfblock=9612,e.lhookretroflex=621,e.lira=8356,e.liwnarmenian=1388,e.lj=457,e.ljecyrillic=1113,e.ll=63168,e.lladeva=2355,e.llagujarati=2739,e.llinebelow=7739,e.llladeva=2356,e.llvocalicbengali=2529,e.llvocalicdeva=2401,e.llvocalicvowelsignbengali=2531,e.llvocalicvowelsigndeva=2403,e.lmiddletilde=619,e.lmonospace=65356,e.lmsquare=13264,e.lochulathai=3628,e.logicaland=8743,e.logicalnot=172,e.logicalnotreversed=8976,e.logicalor=8744,e.lolingthai=3621,e.longs=383,e.lowlinecenterline=65102,e.lowlinecmb=818,e.lowlinedashed=65101,e.lozenge=9674,e.lparen=9383,e.lslash=322,e.lsquare=8467,e.lsuperior=63214,e.ltshade=9617,e.luthai=3622,e.lvocalicbengali=2444,e.lvocalicdeva=2316,e.lvocalicvowelsignbengali=2530,e.lvocalicvowelsigndeva=2402,e.lxsquare=13267,e.m=109,e.mabengali=2478,e.macron=175,e.macronbelowcmb=817,e.macroncmb=772,e.macronlowmod=717,e.macronmonospace=65507,e.macute=7743,e.madeva=2350,e.magujarati=2734,e.magurmukhi=2606,e.mahapakhhebrew=1444,e.mahapakhlefthebrew=1444,e.mahiragana=12414,e.maichattawalowleftthai=63637,e.maichattawalowrightthai=63636,e.maichattawathai=3659,e.maichattawaupperleftthai=63635,e.maieklowleftthai=63628,e.maieklowrightthai=63627,e.maiekthai=3656,e.maiekupperleftthai=63626,e.maihanakatleftthai=63620,e.maihanakatthai=3633,e.maitaikhuleftthai=63625,e.maitaikhuthai=3655,e.maitholowleftthai=63631,e.maitholowrightthai=63630,e.maithothai=3657,e.maithoupperleftthai=63629,e.maitrilowleftthai=63634,e.maitrilowrightthai=63633,e.maitrithai=3658,e.maitriupperleftthai=63632,e.maiyamokthai=3654,e.makatakana=12510,e.makatakanahalfwidth=65423,e.male=9794,e.mansyonsquare=13127,e.maqafhebrew=1470,e.mars=9794,e.masoracirclehebrew=1455,e.masquare=13187,e.mbopomofo=12551,e.mbsquare=13268,e.mcircle=9436,e.mcubedsquare=13221,e.mdotaccent=7745,e.mdotbelow=7747,e.meemarabic=1605,e.meemfinalarabic=65250,e.meeminitialarabic=65251,e.meemmedialarabic=65252,e.meemmeeminitialarabic=64721,e.meemmeemisolatedarabic=64584,e.meetorusquare=13133,e.mehiragana=12417,e.meizierasquare=13182,e.mekatakana=12513,e.mekatakanahalfwidth=65426,e.mem=1502,e.memdagesh=64318,e.memdageshhebrew=64318,e.memhebrew=1502,e.menarmenian=1396,e.merkhahebrew=1445,e.merkhakefulahebrew=1446,e.merkhakefulalefthebrew=1446,e.merkhalefthebrew=1445,e.mhook=625,e.mhzsquare=13202,e.middledotkatakanahalfwidth=65381,e.middot=183,e.mieumacirclekorean=12914,e.mieumaparenkorean=12818,e.mieumcirclekorean=12900,e.mieumkorean=12609,e.mieumpansioskorean=12656,e.mieumparenkorean=12804,e.mieumpieupkorean=12654,e.mieumsioskorean=12655,e.mihiragana=12415,e.mikatakana=12511,e.mikatakanahalfwidth=65424,e.minus=8722,e.minusbelowcmb=800,e.minuscircle=8854,e.minusmod=727,e.minusplus=8723,e.minute=8242,e.miribaarusquare=13130,e.mirisquare=13129,e.mlonglegturned=624,e.mlsquare=13206,e.mmcubedsquare=13219,e.mmonospace=65357,e.mmsquaredsquare=13215,e.mohiragana=12418,e.mohmsquare=13249,e.mokatakana=12514,e.mokatakanahalfwidth=65427,e.molsquare=13270,e.momathai=3617,e.moverssquare=13223,e.moverssquaredsquare=13224,e.mparen=9384,e.mpasquare=13227,e.mssquare=13235,e.msuperior=63215,e.mturned=623,e.mu=181,e.mu1=181,e.muasquare=13186,e.muchgreater=8811,e.muchless=8810,e.mufsquare=13196,e.mugreek=956,e.mugsquare=13197,e.muhiragana=12416,e.mukatakana=12512,e.mukatakanahalfwidth=65425,e.mulsquare=13205,e.multiply=215,e.mumsquare=13211,e.munahhebrew=1443,e.munahlefthebrew=1443,e.musicalnote=9834,e.musicalnotedbl=9835,e.musicflatsign=9837,e.musicsharpsign=9839,e.mussquare=13234,e.muvsquare=13238,e.muwsquare=13244,e.mvmegasquare=13241,e.mvsquare=13239,e.mwmegasquare=13247,e.mwsquare=13245,e.n=110,e.nabengali=2472,e.nabla=8711,e.nacute=324,e.nadeva=2344,e.nagujarati=2728,e.nagurmukhi=2600,e.nahiragana=12394,e.nakatakana=12490,e.nakatakanahalfwidth=65413,e.napostrophe=329,e.nasquare=13185,e.nbopomofo=12555,e.nbspace=160,e.ncaron=328,e.ncedilla=326,e.ncircle=9437,e.ncircumflexbelow=7755,e.ncommaaccent=326,e.ndotaccent=7749,e.ndotbelow=7751,e.nehiragana=12397,e.nekatakana=12493,e.nekatakanahalfwidth=65416,e.newsheqelsign=8362,e.nfsquare=13195,e.ngabengali=2457,e.ngadeva=2329,e.ngagujarati=2713,e.ngagurmukhi=2585,e.ngonguthai=3591,e.nhiragana=12435,e.nhookleft=626,e.nhookretroflex=627,e.nieunacirclekorean=12911,e.nieunaparenkorean=12815,e.nieuncieuckorean=12597,e.nieuncirclekorean=12897,e.nieunhieuhkorean=12598,e.nieunkorean=12596,e.nieunpansioskorean=12648,e.nieunparenkorean=12801,e.nieunsioskorean=12647,e.nieuntikeutkorean=12646,e.nihiragana=12395,e.nikatakana=12491,e.nikatakanahalfwidth=65414,e.nikhahitleftthai=63641,e.nikhahitthai=3661,e.nine=57,e.ninearabic=1641,e.ninebengali=2543,e.ninecircle=9320,e.ninecircleinversesansserif=10130,e.ninedeva=2415,e.ninegujarati=2799,e.ninegurmukhi=2671,e.ninehackarabic=1641,e.ninehangzhou=12329,e.nineideographicparen=12840,e.nineinferior=8329,e.ninemonospace=65305,e.nineoldstyle=63289,e.nineparen=9340,e.nineperiod=9360,e.ninepersian=1785,e.nineroman=8568,e.ninesuperior=8313,e.nineteencircle=9330,e.nineteenparen=9350,e.nineteenperiod=9370,e.ninethai=3673,e.nj=460,e.njecyrillic=1114,e.nkatakana=12531,e.nkatakanahalfwidth=65437,e.nlegrightlong=414,e.nlinebelow=7753,e.nmonospace=65358,e.nmsquare=13210,e.nnabengali=2467,e.nnadeva=2339,e.nnagujarati=2723,e.nnagurmukhi=2595,e.nnnadeva=2345,e.nohiragana=12398,e.nokatakana=12494,e.nokatakanahalfwidth=65417,e.nonbreakingspace=160,e.nonenthai=3603,e.nonuthai=3609,e.noonarabic=1606,e.noonfinalarabic=65254,e.noonghunnaarabic=1722,e.noonghunnafinalarabic=64415,e.nooninitialarabic=65255,e.noonjeeminitialarabic=64722,e.noonjeemisolatedarabic=64587,e.noonmedialarabic=65256,e.noonmeeminitialarabic=64725,e.noonmeemisolatedarabic=64590,e.noonnoonfinalarabic=64653,e.notcontains=8716,e.notelement=8713,e.notelementof=8713,e.notequal=8800,e.notgreater=8815,e.notgreaternorequal=8817,e.notgreaternorless=8825,e.notidentical=8802,e.notless=8814,e.notlessnorequal=8816,e.notparallel=8742,e.notprecedes=8832,e.notsubset=8836,e.notsucceeds=8833,e.notsuperset=8837,e.nowarmenian=1398,e.nparen=9385,e.nssquare=13233,e.nsuperior=8319,e.ntilde=241,e.nu=957,e.nuhiragana=12396,e.nukatakana=12492,e.nukatakanahalfwidth=65415,e.nuktabengali=2492,e.nuktadeva=2364,e.nuktagujarati=2748,e.nuktagurmukhi=2620,e.numbersign=35,e.numbersignmonospace=65283,e.numbersignsmall=65119,e.numeralsigngreek=884,e.numeralsignlowergreek=885,e.numero=8470,e.nun=1504,e.nundagesh=64320,e.nundageshhebrew=64320,e.nunhebrew=1504,e.nvsquare=13237,e.nwsquare=13243,e.nyabengali=2462,e.nyadeva=2334,e.nyagujarati=2718,e.nyagurmukhi=2590,e.o=111,e.oacute=243,e.oangthai=3629,e.obarred=629,e.obarredcyrillic=1257,e.obarreddieresiscyrillic=1259,e.obengali=2451,e.obopomofo=12571,e.obreve=335,e.ocandradeva=2321,e.ocandragujarati=2705,e.ocandravowelsigndeva=2377,e.ocandravowelsigngujarati=2761,e.ocaron=466,e.ocircle=9438,e.ocircumflex=244,e.ocircumflexacute=7889,e.ocircumflexdotbelow=7897,e.ocircumflexgrave=7891,e.ocircumflexhookabove=7893,e.ocircumflextilde=7895,e.ocyrillic=1086,e.odblacute=337,e.odblgrave=525,e.odeva=2323,e.odieresis=246,e.odieresiscyrillic=1255,e.odotbelow=7885,e.oe=339,e.oekorean=12634,e.ogonek=731,e.ogonekcmb=808,e.ograve=242,e.ogujarati=2707,e.oharmenian=1413,e.ohiragana=12362,e.ohookabove=7887,e.ohorn=417,e.ohornacute=7899,e.ohorndotbelow=7907,e.ohorngrave=7901,e.ohornhookabove=7903,e.ohorntilde=7905,e.ohungarumlaut=337,e.oi=419,e.oinvertedbreve=527,e.okatakana=12458,e.okatakanahalfwidth=65397,e.okorean=12631,e.olehebrew=1451,e.omacron=333,e.omacronacute=7763,e.omacrongrave=7761,e.omdeva=2384,e.omega=969,e.omega1=982,e.omegacyrillic=1121,e.omegalatinclosed=631,e.omegaroundcyrillic=1147,e.omegatitlocyrillic=1149,e.omegatonos=974,e.omgujarati=2768,e.omicron=959,e.omicrontonos=972,e.omonospace=65359,e.one=49,e.onearabic=1633,e.onebengali=2535,e.onecircle=9312,e.onecircleinversesansserif=10122,e.onedeva=2407,e.onedotenleader=8228,e.oneeighth=8539,e.onefitted=63196,e.onegujarati=2791,e.onegurmukhi=2663,e.onehackarabic=1633,e.onehalf=189,e.onehangzhou=12321,e.oneideographicparen=12832,e.oneinferior=8321,e.onemonospace=65297,e.onenumeratorbengali=2548,e.oneoldstyle=63281,e.oneparen=9332,e.oneperiod=9352,e.onepersian=1777,e.onequarter=188,e.oneroman=8560,e.onesuperior=185,e.onethai=3665,e.onethird=8531,e.oogonek=491,e.oogonekmacron=493,e.oogurmukhi=2579,e.oomatragurmukhi=2635,e.oopen=596,e.oparen=9386,e.openbullet=9702,e.option=8997,e.ordfeminine=170,e.ordmasculine=186,e.orthogonal=8735,e.oshortdeva=2322,e.oshortvowelsigndeva=2378,e.oslash=248,e.oslashacute=511,e.osmallhiragana=12361,e.osmallkatakana=12457,e.osmallkatakanahalfwidth=65387,e.ostrokeacute=511,e.osuperior=63216,e.otcyrillic=1151,e.otilde=245,e.otildeacute=7757,e.otildedieresis=7759,e.oubopomofo=12577,e.overline=8254,e.overlinecenterline=65098,e.overlinecmb=773,e.overlinedashed=65097,e.overlinedblwavy=65100,e.overlinewavy=65099,e.overscore=175,e.ovowelsignbengali=2507,e.ovowelsigndeva=2379,e.ovowelsigngujarati=2763,e.p=112,e.paampssquare=13184,e.paasentosquare=13099,e.pabengali=2474,e.pacute=7765,e.padeva=2346,e.pagedown=8671,e.pageup=8670,e.pagujarati=2730,e.pagurmukhi=2602,e.pahiragana=12401,e.paiyannoithai=3631,e.pakatakana=12497,e.palatalizationcyrilliccmb=1156,e.palochkacyrillic=1216,e.pansioskorean=12671,e.paragraph=182,e.parallel=8741,e.parenleft=40,e.parenleftaltonearabic=64830,e.parenleftbt=63725,e.parenleftex=63724,e.parenleftinferior=8333,e.parenleftmonospace=65288,e.parenleftsmall=65113,e.parenleftsuperior=8317,e.parenlefttp=63723,e.parenleftvertical=65077,e.parenright=41,e.parenrightaltonearabic=64831,e.parenrightbt=63736,e.parenrightex=63735,e.parenrightinferior=8334,e.parenrightmonospace=65289,e.parenrightsmall=65114,e.parenrightsuperior=8318,e.parenrighttp=63734,e.parenrightvertical=65078,e.partialdiff=8706,e.paseqhebrew=1472,e.pashtahebrew=1433,e.pasquare=13225,e.patah=1463,e.patah11=1463,e.patah1d=1463,e.patah2a=1463,e.patahhebrew=1463,e.patahnarrowhebrew=1463,e.patahquarterhebrew=1463,e.patahwidehebrew=1463,e.pazerhebrew=1441,e.pbopomofo=12550,e.pcircle=9439,e.pdotaccent=7767,e.pe=1508,e.pecyrillic=1087,e.pedagesh=64324,e.pedageshhebrew=64324,e.peezisquare=13115,e.pefinaldageshhebrew=64323,e.peharabic=1662,e.peharmenian=1402,e.pehebrew=1508,e.pehfinalarabic=64343,e.pehinitialarabic=64344,e.pehiragana=12410,e.pehmedialarabic=64345,e.pekatakana=12506,e.pemiddlehookcyrillic=1191,e.perafehebrew=64334,e.percent=37,e.percentarabic=1642,e.percentmonospace=65285,e.percentsmall=65130,e.period=46,e.periodarmenian=1417,e.periodcentered=183,e.periodhalfwidth=65377,e.periodinferior=63207,e.periodmonospace=65294,e.periodsmall=65106,e.periodsuperior=63208,e.perispomenigreekcmb=834,e.perpendicular=8869,e.perthousand=8240,e.peseta=8359,e.pfsquare=13194,e.phabengali=2475,e.phadeva=2347,e.phagujarati=2731,e.phagurmukhi=2603,e.phi=966,e.phi1=981,e.phieuphacirclekorean=12922,e.phieuphaparenkorean=12826,e.phieuphcirclekorean=12908,e.phieuphkorean=12621,e.phieuphparenkorean=12812,e.philatin=632,e.phinthuthai=3642,e.phisymbolgreek=981,e.phook=421,e.phophanthai=3614,e.phophungthai=3612,e.phosamphaothai=3616,e.pi=960,e.pieupacirclekorean=12915,e.pieupaparenkorean=12819,e.pieupcieuckorean=12662,e.pieupcirclekorean=12901,e.pieupkiyeokkorean=12658,e.pieupkorean=12610,e.pieupparenkorean=12805,e.pieupsioskiyeokkorean=12660,e.pieupsioskorean=12612,e.pieupsiostikeutkorean=12661,e.pieupthieuthkorean=12663,e.pieuptikeutkorean=12659,e.pihiragana=12404,e.pikatakana=12500,e.pisymbolgreek=982,e.piwrarmenian=1411,e.planckover2pi=8463,e.planckover2pi1=8463,e.plus=43,e.plusbelowcmb=799,e.pluscircle=8853,e.plusminus=177,e.plusmod=726,e.plusmonospace=65291,e.plussmall=65122,e.plussuperior=8314,e.pmonospace=65360,e.pmsquare=13272,e.pohiragana=12413,e.pointingindexdownwhite=9759,e.pointingindexleftwhite=9756,e.pointingindexrightwhite=9758,e.pointingindexupwhite=9757,e.pokatakana=12509,e.poplathai=3611,e.postalmark=12306,e.postalmarkface=12320,e.pparen=9387,e.precedes=8826,e.prescription=8478,e.primemod=697,e.primereversed=8245,e.product=8719,e.projective=8965,e.prolongedkana=12540,e.propellor=8984,e.propersubset=8834,e.propersuperset=8835,e.proportion=8759,e.proportional=8733,e.psi=968,e.psicyrillic=1137,e.psilipneumatacyrilliccmb=1158,e.pssquare=13232,e.puhiragana=12407,e.pukatakana=12503,e.pvsquare=13236,e.pwsquare=13242,e.q=113,e.qadeva=2392,e.qadmahebrew=1448,e.qafarabic=1602,e.qaffinalarabic=65238,e.qafinitialarabic=65239,e.qafmedialarabic=65240,e.qamats=1464,e.qamats10=1464,e.qamats1a=1464,e.qamats1c=1464,e.qamats27=1464,e.qamats29=1464,e.qamats33=1464,e.qamatsde=1464,e.qamatshebrew=1464,e.qamatsnarrowhebrew=1464,e.qamatsqatanhebrew=1464,e.qamatsqatannarrowhebrew=1464,e.qamatsqatanquarterhebrew=1464,e.qamatsqatanwidehebrew=1464,e.qamatsquarterhebrew=1464,e.qamatswidehebrew=1464,e.qarneyparahebrew=1439,e.qbopomofo=12561,e.qcircle=9440,e.qhook=672,e.qmonospace=65361,e.qof=1511,e.qofdagesh=64327,e.qofdageshhebrew=64327,e.qofhebrew=1511,e.qparen=9388,e.quarternote=9833,e.qubuts=1467,e.qubuts18=1467,e.qubuts25=1467,e.qubuts31=1467,e.qubutshebrew=1467,e.qubutsnarrowhebrew=1467,e.qubutsquarterhebrew=1467,e.qubutswidehebrew=1467,e.question=63,e.questionarabic=1567,e.questionarmenian=1374,e.questiondown=191,e.questiondownsmall=63423,e.questiongreek=894,e.questionmonospace=65311,e.questionsmall=63295,e.quotedbl=34,e.quotedblbase=8222,e.quotedblleft=8220,e.quotedblmonospace=65282,e.quotedblprime=12318,e.quotedblprimereversed=12317,e.quotedblright=8221,e.quoteleft=8216,e.quoteleftreversed=8219,e.quotereversed=8219,e.quoteright=8217,e.quoterightn=329,e.quotesinglbase=8218,e.quotesingle=39,e.quotesinglemonospace=65287,e.r=114,e.raarmenian=1404,e.rabengali=2480,e.racute=341,e.radeva=2352,e.radical=8730,e.radicalex=63717,e.radoverssquare=13230,e.radoverssquaredsquare=13231,e.radsquare=13229,e.rafe=1471,e.rafehebrew=1471,e.ragujarati=2736,e.ragurmukhi=2608,e.rahiragana=12425,e.rakatakana=12521,e.rakatakanahalfwidth=65431,e.ralowerdiagonalbengali=2545,e.ramiddlediagonalbengali=2544,e.ramshorn=612,e.ratio=8758,e.rbopomofo=12566,e.rcaron=345,e.rcedilla=343,e.rcircle=9441,e.rcommaaccent=343,e.rdblgrave=529,e.rdotaccent=7769,e.rdotbelow=7771,e.rdotbelowmacron=7773,e.referencemark=8251,e.reflexsubset=8838,e.reflexsuperset=8839,e.registered=174,e.registersans=63720,e.registerserif=63194,e.reharabic=1585,e.reharmenian=1408,e.rehfinalarabic=65198,e.rehiragana=12428,e.rekatakana=12524,e.rekatakanahalfwidth=65434,e.resh=1512,e.reshdageshhebrew=64328,e.reshhebrew=1512,e.reversedtilde=8765,e.reviahebrew=1431,e.reviamugrashhebrew=1431,e.revlogicalnot=8976,e.rfishhook=638,e.rfishhookreversed=639,e.rhabengali=2525,e.rhadeva=2397,e.rho=961,e.rhook=637,e.rhookturned=635,e.rhookturnedsuperior=693,e.rhosymbolgreek=1009,e.rhotichookmod=734,e.rieulacirclekorean=12913,e.rieulaparenkorean=12817,e.rieulcirclekorean=12899,e.rieulhieuhkorean=12608,e.rieulkiyeokkorean=12602,e.rieulkiyeoksioskorean=12649,e.rieulkorean=12601,e.rieulmieumkorean=12603,e.rieulpansioskorean=12652,e.rieulparenkorean=12803,e.rieulphieuphkorean=12607,e.rieulpieupkorean=12604,e.rieulpieupsioskorean=12651,e.rieulsioskorean=12605,e.rieulthieuthkorean=12606,e.rieultikeutkorean=12650,e.rieulyeorinhieuhkorean=12653,e.rightangle=8735,e.righttackbelowcmb=793,e.righttriangle=8895,e.rihiragana=12426,e.rikatakana=12522,e.rikatakanahalfwidth=65432,e.ring=730,e.ringbelowcmb=805,e.ringcmb=778,e.ringhalfleft=703,e.ringhalfleftarmenian=1369,e.ringhalfleftbelowcmb=796,e.ringhalfleftcentered=723,e.ringhalfright=702,e.ringhalfrightbelowcmb=825,e.ringhalfrightcentered=722,e.rinvertedbreve=531,e.rittorusquare=13137,e.rlinebelow=7775,e.rlongleg=636,e.rlonglegturned=634,e.rmonospace=65362,e.rohiragana=12429,e.rokatakana=12525,e.rokatakanahalfwidth=65435,e.roruathai=3619,e.rparen=9389,e.rrabengali=2524,e.rradeva=2353,e.rragurmukhi=2652,e.rreharabic=1681,e.rrehfinalarabic=64397,e.rrvocalicbengali=2528,e.rrvocalicdeva=2400,e.rrvocalicgujarati=2784,e.rrvocalicvowelsignbengali=2500,e.rrvocalicvowelsigndeva=2372,e.rrvocalicvowelsigngujarati=2756,e.rsuperior=63217,e.rtblock=9616,e.rturned=633,e.rturnedsuperior=692,e.ruhiragana=12427,e.rukatakana=12523,e.rukatakanahalfwidth=65433,e.rupeemarkbengali=2546,e.rupeesignbengali=2547,e.rupiah=63197,e.ruthai=3620,e.rvocalicbengali=2443,e.rvocalicdeva=2315,e.rvocalicgujarati=2699,e.rvocalicvowelsignbengali=2499,e.rvocalicvowelsigndeva=2371,e.rvocalicvowelsigngujarati=2755,e.s=115,e.sabengali=2488,e.sacute=347,e.sacutedotaccent=7781,e.sadarabic=1589,e.sadeva=2360,e.sadfinalarabic=65210,e.sadinitialarabic=65211,e.sadmedialarabic=65212,e.sagujarati=2744,e.sagurmukhi=2616,e.sahiragana=12373,e.sakatakana=12469,e.sakatakanahalfwidth=65403,e.sallallahoualayhewasallamarabic=65018,e.samekh=1505,e.samekhdagesh=64321,e.samekhdageshhebrew=64321,e.samekhhebrew=1505,e.saraaathai=3634,e.saraaethai=3649,e.saraaimaimalaithai=3652,e.saraaimaimuanthai=3651,e.saraamthai=3635,e.saraathai=3632,e.saraethai=3648,e.saraiileftthai=63622,e.saraiithai=3637,e.saraileftthai=63621,e.saraithai=3636,e.saraothai=3650,e.saraueeleftthai=63624,e.saraueethai=3639,e.saraueleftthai=63623,e.sarauethai=3638,e.sarauthai=3640,e.sarauuthai=3641,e.sbopomofo=12569,e.scaron=353,e.scarondotaccent=7783,e.scedilla=351,e.schwa=601,e.schwacyrillic=1241,e.schwadieresiscyrillic=1243,e.schwahook=602,e.scircle=9442,e.scircumflex=349,e.scommaaccent=537,e.sdotaccent=7777,e.sdotbelow=7779,e.sdotbelowdotaccent=7785,e.seagullbelowcmb=828,e.second=8243,e.secondtonechinese=714,e.section=167,e.seenarabic=1587,e.seenfinalarabic=65202,e.seeninitialarabic=65203,e.seenmedialarabic=65204,e.segol=1462,e.segol13=1462,e.segol1f=1462,e.segol2c=1462,e.segolhebrew=1462,e.segolnarrowhebrew=1462,e.segolquarterhebrew=1462,e.segoltahebrew=1426,e.segolwidehebrew=1462,e.seharmenian=1405,e.sehiragana=12379,e.sekatakana=12475,e.sekatakanahalfwidth=65406,e.semicolon=59,e.semicolonarabic=1563,e.semicolonmonospace=65307,e.semicolonsmall=65108,e.semivoicedmarkkana=12444,e.semivoicedmarkkanahalfwidth=65439,e.sentisquare=13090,e.sentosquare=13091,e.seven=55,e.sevenarabic=1639,e.sevenbengali=2541,e.sevencircle=9318,e.sevencircleinversesansserif=10128,e.sevendeva=2413,e.seveneighths=8542,e.sevengujarati=2797,e.sevengurmukhi=2669,e.sevenhackarabic=1639,e.sevenhangzhou=12327,e.sevenideographicparen=12838,e.seveninferior=8327,e.sevenmonospace=65303,e.sevenoldstyle=63287,e.sevenparen=9338,e.sevenperiod=9358,e.sevenpersian=1783,e.sevenroman=8566,e.sevensuperior=8311,e.seventeencircle=9328,e.seventeenparen=9348,e.seventeenperiod=9368,e.seventhai=3671,e.sfthyphen=173,e.shaarmenian=1399,e.shabengali=2486,e.shacyrillic=1096,e.shaddaarabic=1617,e.shaddadammaarabic=64609,e.shaddadammatanarabic=64606,e.shaddafathaarabic=64608,e.shaddakasraarabic=64610,e.shaddakasratanarabic=64607,e.shade=9618,e.shadedark=9619,e.shadelight=9617,e.shademedium=9618,e.shadeva=2358,e.shagujarati=2742,e.shagurmukhi=2614,e.shalshelethebrew=1427,e.shbopomofo=12565,e.shchacyrillic=1097,e.sheenarabic=1588,e.sheenfinalarabic=65206,e.sheeninitialarabic=65207,e.sheenmedialarabic=65208,e.sheicoptic=995,e.sheqel=8362,e.sheqelhebrew=8362,e.sheva=1456,e.sheva115=1456,e.sheva15=1456,e.sheva22=1456,e.sheva2e=1456,e.shevahebrew=1456,e.shevanarrowhebrew=1456,e.shevaquarterhebrew=1456,e.shevawidehebrew=1456,e.shhacyrillic=1211,e.shimacoptic=1005,e.shin=1513,e.shindagesh=64329,e.shindageshhebrew=64329,e.shindageshshindot=64300,e.shindageshshindothebrew=64300,e.shindageshsindot=64301,e.shindageshsindothebrew=64301,e.shindothebrew=1473,e.shinhebrew=1513,e.shinshindot=64298,e.shinshindothebrew=64298,e.shinsindot=64299,e.shinsindothebrew=64299,e.shook=642,e.sigma=963,e.sigma1=962,e.sigmafinal=962,e.sigmalunatesymbolgreek=1010,e.sihiragana=12375,e.sikatakana=12471,e.sikatakanahalfwidth=65404,e.siluqhebrew=1469,e.siluqlefthebrew=1469,e.similar=8764,e.sindothebrew=1474,e.siosacirclekorean=12916,e.siosaparenkorean=12820,e.sioscieuckorean=12670,e.sioscirclekorean=12902,e.sioskiyeokkorean=12666,e.sioskorean=12613,e.siosnieunkorean=12667,e.siosparenkorean=12806,e.siospieupkorean=12669,e.siostikeutkorean=12668,e.six=54,e.sixarabic=1638,e.sixbengali=2540,e.sixcircle=9317,e.sixcircleinversesansserif=10127,e.sixdeva=2412,e.sixgujarati=2796,e.sixgurmukhi=2668,e.sixhackarabic=1638,e.sixhangzhou=12326,e.sixideographicparen=12837,e.sixinferior=8326,e.sixmonospace=65302,e.sixoldstyle=63286,e.sixparen=9337,e.sixperiod=9357,e.sixpersian=1782,e.sixroman=8565,e.sixsuperior=8310,e.sixteencircle=9327,e.sixteencurrencydenominatorbengali=2553,e.sixteenparen=9347,e.sixteenperiod=9367,e.sixthai=3670,e.slash=47,e.slashmonospace=65295,e.slong=383,e.slongdotaccent=7835,e.smileface=9786,e.smonospace=65363,e.sofpasuqhebrew=1475,e.softhyphen=173,e.softsigncyrillic=1100,e.sohiragana=12381,e.sokatakana=12477,e.sokatakanahalfwidth=65407,e.soliduslongoverlaycmb=824,e.solidusshortoverlaycmb=823,e.sorusithai=3625,e.sosalathai=3624,e.sosothai=3595,e.sosuathai=3626,e.space=32,e.spacehackarabic=32,e.spade=9824,e.spadesuitblack=9824,e.spadesuitwhite=9828,e.sparen=9390,e.squarebelowcmb=827,e.squarecc=13252,e.squarecm=13213,e.squarediagonalcrosshatchfill=9641,e.squarehorizontalfill=9636,e.squarekg=13199,e.squarekm=13214,e.squarekmcapital=13262,e.squareln=13265,e.squarelog=13266,e.squaremg=13198,e.squaremil=13269,e.squaremm=13212,e.squaremsquared=13217,e.squareorthogonalcrosshatchfill=9638,e.squareupperlefttolowerrightfill=9639,e.squareupperrighttolowerleftfill=9640,e.squareverticalfill=9637,e.squarewhitewithsmallblack=9635,e.srsquare=13275,e.ssabengali=2487,e.ssadeva=2359,e.ssagujarati=2743,e.ssangcieuckorean=12617,e.ssanghieuhkorean=12677,e.ssangieungkorean=12672,e.ssangkiyeokkorean=12594,e.ssangnieunkorean=12645,e.ssangpieupkorean=12611,e.ssangsioskorean=12614,e.ssangtikeutkorean=12600,e.ssuperior=63218,e.sterling=163,e.sterlingmonospace=65505,e.strokelongoverlaycmb=822,e.strokeshortoverlaycmb=821,e.subset=8834,e.subsetnotequal=8842,e.subsetorequal=8838,e.succeeds=8827,e.suchthat=8715,e.suhiragana=12377,e.sukatakana=12473,e.sukatakanahalfwidth=65405,e.sukunarabic=1618,e.summation=8721,e.sun=9788,e.superset=8835,e.supersetnotequal=8843,e.supersetorequal=8839,e.svsquare=13276,e.syouwaerasquare=13180,e.t=116,e.tabengali=2468,e.tackdown=8868,e.tackleft=8867,e.tadeva=2340,e.tagujarati=2724,e.tagurmukhi=2596,e.taharabic=1591,e.tahfinalarabic=65218,e.tahinitialarabic=65219,e.tahiragana=12383,e.tahmedialarabic=65220,e.taisyouerasquare=13181,e.takatakana=12479,e.takatakanahalfwidth=65408,e.tatweelarabic=1600,e.tau=964,e.tav=1514,e.tavdages=64330,e.tavdagesh=64330,e.tavdageshhebrew=64330,e.tavhebrew=1514,e.tbar=359,e.tbopomofo=12554,e.tcaron=357,e.tccurl=680,e.tcedilla=355,e.tcheharabic=1670,e.tchehfinalarabic=64379,e.tchehinitialarabic=64380,e.tchehmedialarabic=64381,e.tcircle=9443,e.tcircumflexbelow=7793,e.tcommaaccent=355,e.tdieresis=7831,e.tdotaccent=7787,e.tdotbelow=7789,e.tecyrillic=1090,e.tedescendercyrillic=1197,e.teharabic=1578,e.tehfinalarabic=65174,e.tehhahinitialarabic=64674,e.tehhahisolatedarabic=64524,e.tehinitialarabic=65175,e.tehiragana=12390,e.tehjeeminitialarabic=64673,e.tehjeemisolatedarabic=64523,e.tehmarbutaarabic=1577,e.tehmarbutafinalarabic=65172,e.tehmedialarabic=65176,e.tehmeeminitialarabic=64676,e.tehmeemisolatedarabic=64526,e.tehnoonfinalarabic=64627,e.tekatakana=12486,e.tekatakanahalfwidth=65411,e.telephone=8481,e.telephoneblack=9742,e.telishagedolahebrew=1440,e.telishaqetanahebrew=1449,e.tencircle=9321,e.tenideographicparen=12841,e.tenparen=9341,e.tenperiod=9361,e.tenroman=8569,e.tesh=679,e.tet=1496,e.tetdagesh=64312,e.tetdageshhebrew=64312,e.tethebrew=1496,e.tetsecyrillic=1205,e.tevirhebrew=1435,e.tevirlefthebrew=1435,e.thabengali=2469,e.thadeva=2341,e.thagujarati=2725,e.thagurmukhi=2597,e.thalarabic=1584,e.thalfinalarabic=65196,e.thanthakhatlowleftthai=63640,e.thanthakhatlowrightthai=63639,e.thanthakhatthai=3660,e.thanthakhatupperleftthai=63638,e.theharabic=1579,e.thehfinalarabic=65178,e.thehinitialarabic=65179,e.thehmedialarabic=65180,e.thereexists=8707,e.therefore=8756,e.theta=952,e.theta1=977,e.thetasymbolgreek=977,e.thieuthacirclekorean=12921,e.thieuthaparenkorean=12825,e.thieuthcirclekorean=12907,e.thieuthkorean=12620,e.thieuthparenkorean=12811,e.thirteencircle=9324,e.thirteenparen=9344,e.thirteenperiod=9364,e.thonangmonthothai=3601,e.thook=429,e.thophuthaothai=3602,e.thorn=254,e.thothahanthai=3607,e.thothanthai=3600,e.thothongthai=3608,e.thothungthai=3606,e.thousandcyrillic=1154,e.thousandsseparatorarabic=1644,e.thousandsseparatorpersian=1644,e.three=51,e.threearabic=1635,e.threebengali=2537,e.threecircle=9314,e.threecircleinversesansserif=10124,e.threedeva=2409,e.threeeighths=8540,e.threegujarati=2793,e.threegurmukhi=2665,e.threehackarabic=1635,e.threehangzhou=12323,e.threeideographicparen=12834,e.threeinferior=8323,e.threemonospace=65299,e.threenumeratorbengali=2550,e.threeoldstyle=63283,e.threeparen=9334,e.threeperiod=9354,e.threepersian=1779,e.threequarters=190,e.threequartersemdash=63198,e.threeroman=8562,e.threesuperior=179,e.threethai=3667,e.thzsquare=13204,e.tihiragana=12385,e.tikatakana=12481,e.tikatakanahalfwidth=65409,e.tikeutacirclekorean=12912,e.tikeutaparenkorean=12816,e.tikeutcirclekorean=12898,e.tikeutkorean=12599,e.tikeutparenkorean=12802,e.tilde=732,e.tildebelowcmb=816,e.tildecmb=771,e.tildecomb=771,e.tildedoublecmb=864,e.tildeoperator=8764,e.tildeoverlaycmb=820,e.tildeverticalcmb=830,e.timescircle=8855,e.tipehahebrew=1430,e.tipehalefthebrew=1430,e.tippigurmukhi=2672,e.titlocyrilliccmb=1155,e.tiwnarmenian=1407,e.tlinebelow=7791,e.tmonospace=65364,e.toarmenian=1385,e.tohiragana=12392,e.tokatakana=12488,e.tokatakanahalfwidth=65412,e.tonebarextrahighmod=741,e.tonebarextralowmod=745,e.tonebarhighmod=742,e.tonebarlowmod=744,e.tonebarmidmod=743,e.tonefive=445,e.tonesix=389,e.tonetwo=424,e.tonos=900,e.tonsquare=13095,e.topatakthai=3599,e.tortoiseshellbracketleft=12308,e.tortoiseshellbracketleftsmall=65117,e.tortoiseshellbracketleftvertical=65081,e.tortoiseshellbracketright=12309,e.tortoiseshellbracketrightsmall=65118,e.tortoiseshellbracketrightvertical=65082,e.totaothai=3605,e.tpalatalhook=427,e.tparen=9391,e.trademark=8482,e.trademarksans=63722,e.trademarkserif=63195,e.tretroflexhook=648,e.triagdn=9660,e.triaglf=9668,e.triagrt=9658,e.triagup=9650,e.ts=678,e.tsadi=1510,e.tsadidagesh=64326,e.tsadidageshhebrew=64326,e.tsadihebrew=1510,e.tsecyrillic=1094,e.tsere=1461,e.tsere12=1461,e.tsere1e=1461,e.tsere2b=1461,e.tserehebrew=1461,e.tserenarrowhebrew=1461,e.tserequarterhebrew=1461,e.tserewidehebrew=1461,e.tshecyrillic=1115,e.tsuperior=63219,e.ttabengali=2463,e.ttadeva=2335,e.ttagujarati=2719,e.ttagurmukhi=2591,e.tteharabic=1657,e.ttehfinalarabic=64359,e.ttehinitialarabic=64360,e.ttehmedialarabic=64361,e.tthabengali=2464,e.tthadeva=2336,e.tthagujarati=2720,e.tthagurmukhi=2592,e.tturned=647,e.tuhiragana=12388,e.tukatakana=12484,e.tukatakanahalfwidth=65410,e.tusmallhiragana=12387,e.tusmallkatakana=12483,e.tusmallkatakanahalfwidth=65391,e.twelvecircle=9323,e.twelveparen=9343,e.twelveperiod=9363,e.twelveroman=8571,e.twentycircle=9331,e.twentyhangzhou=21316,e.twentyparen=9351,e.twentyperiod=9371,e.two=50,e.twoarabic=1634,e.twobengali=2536,e.twocircle=9313,e.twocircleinversesansserif=10123,e.twodeva=2408,e.twodotenleader=8229,e.twodotleader=8229,e.twodotleadervertical=65072,e.twogujarati=2792,e.twogurmukhi=2664,e.twohackarabic=1634,e.twohangzhou=12322,e.twoideographicparen=12833,e.twoinferior=8322,e.twomonospace=65298,e.twonumeratorbengali=2549,e.twooldstyle=63282,e.twoparen=9333,e.twoperiod=9353,e.twopersian=1778,e.tworoman=8561,e.twostroke=443,e.twosuperior=178,e.twothai=3666,e.twothirds=8532,e.u=117,e.uacute=250,e.ubar=649,e.ubengali=2441,e.ubopomofo=12584,e.ubreve=365,e.ucaron=468,e.ucircle=9444,e.ucircumflex=251,e.ucircumflexbelow=7799,e.ucyrillic=1091,e.udattadeva=2385,e.udblacute=369,e.udblgrave=533,e.udeva=2313,e.udieresis=252,e.udieresisacute=472,e.udieresisbelow=7795,e.udieresiscaron=474,e.udieresiscyrillic=1265,e.udieresisgrave=476,e.udieresismacron=470,e.udotbelow=7909,e.ugrave=249,e.ugujarati=2697,e.ugurmukhi=2569,e.uhiragana=12358,e.uhookabove=7911,e.uhorn=432,e.uhornacute=7913,e.uhorndotbelow=7921,e.uhorngrave=7915,e.uhornhookabove=7917,e.uhorntilde=7919,e.uhungarumlaut=369,e.uhungarumlautcyrillic=1267,e.uinvertedbreve=535,e.ukatakana=12454,e.ukatakanahalfwidth=65395,e.ukcyrillic=1145,e.ukorean=12636,e.umacron=363,e.umacroncyrillic=1263,e.umacrondieresis=7803,e.umatragurmukhi=2625,e.umonospace=65365,e.underscore=95,e.underscoredbl=8215,e.underscoremonospace=65343,e.underscorevertical=65075,e.underscorewavy=65103,e.union=8746,e.universal=8704,e.uogonek=371,e.uparen=9392,e.upblock=9600,e.upperdothebrew=1476,e.upsilon=965,e.upsilondieresis=971,e.upsilondieresistonos=944,e.upsilonlatin=650,e.upsilontonos=973,e.uptackbelowcmb=797,e.uptackmod=724,e.uragurmukhi=2675,e.uring=367,e.ushortcyrillic=1118,e.usmallhiragana=12357,e.usmallkatakana=12453,e.usmallkatakanahalfwidth=65385,e.ustraightcyrillic=1199,e.ustraightstrokecyrillic=1201,e.utilde=361,e.utildeacute=7801,e.utildebelow=7797,e.uubengali=2442,e.uudeva=2314,e.uugujarati=2698,e.uugurmukhi=2570,e.uumatragurmukhi=2626,e.uuvowelsignbengali=2498,e.uuvowelsigndeva=2370,e.uuvowelsigngujarati=2754,e.uvowelsignbengali=2497,e.uvowelsigndeva=2369,e.uvowelsigngujarati=2753,e.v=118,e.vadeva=2357,e.vagujarati=2741,e.vagurmukhi=2613,e.vakatakana=12535,e.vav=1493,e.vavdagesh=64309,e.vavdagesh65=64309,e.vavdageshhebrew=64309,e.vavhebrew=1493,e.vavholam=64331,e.vavholamhebrew=64331,e.vavvavhebrew=1520,e.vavyodhebrew=1521,e.vcircle=9445,e.vdotbelow=7807,e.vecyrillic=1074,e.veharabic=1700,e.vehfinalarabic=64363,e.vehinitialarabic=64364,e.vehmedialarabic=64365,e.vekatakana=12537,e.venus=9792,e.verticalbar=124,e.verticallineabovecmb=781,e.verticallinebelowcmb=809,e.verticallinelowmod=716,e.verticallinemod=712,e.vewarmenian=1406,e.vhook=651,e.vikatakana=12536,e.viramabengali=2509,e.viramadeva=2381,e.viramagujarati=2765,e.visargabengali=2435,e.visargadeva=2307,e.visargagujarati=2691,e.vmonospace=65366,e.voarmenian=1400,e.voicediterationhiragana=12446,e.voicediterationkatakana=12542,e.voicedmarkkana=12443,e.voicedmarkkanahalfwidth=65438,e.vokatakana=12538,e.vparen=9393,e.vtilde=7805,e.vturned=652,e.vuhiragana=12436,e.vukatakana=12532,e.w=119,e.wacute=7811,e.waekorean=12633,e.wahiragana=12431,e.wakatakana=12527,e.wakatakanahalfwidth=65436,e.wakorean=12632,e.wasmallhiragana=12430,e.wasmallkatakana=12526,e.wattosquare=13143,e.wavedash=12316,e.wavyunderscorevertical=65076,e.wawarabic=1608,e.wawfinalarabic=65262,e.wawhamzaabovearabic=1572,e.wawhamzaabovefinalarabic=65158,e.wbsquare=13277,e.wcircle=9446,e.wcircumflex=373,e.wdieresis=7813,e.wdotaccent=7815,e.wdotbelow=7817,e.wehiragana=12433,e.weierstrass=8472,e.wekatakana=12529,e.wekorean=12638,e.weokorean=12637,e.wgrave=7809,e.whitebullet=9702,e.whitecircle=9675,e.whitecircleinverse=9689,e.whitecornerbracketleft=12302,e.whitecornerbracketleftvertical=65091,e.whitecornerbracketright=12303,e.whitecornerbracketrightvertical=65092,e.whitediamond=9671,e.whitediamondcontainingblacksmalldiamond=9672,e.whitedownpointingsmalltriangle=9663,e.whitedownpointingtriangle=9661,e.whiteleftpointingsmalltriangle=9667,e.whiteleftpointingtriangle=9665,e.whitelenticularbracketleft=12310,e.whitelenticularbracketright=12311,e.whiterightpointingsmalltriangle=9657,e.whiterightpointingtriangle=9655,e.whitesmallsquare=9643,e.whitesmilingface=9786,e.whitesquare=9633,e.whitestar=9734,e.whitetelephone=9743,e.whitetortoiseshellbracketleft=12312,e.whitetortoiseshellbracketright=12313,e.whiteuppointingsmalltriangle=9653,e.whiteuppointingtriangle=9651,e.wihiragana=12432,e.wikatakana=12528,e.wikorean=12639,e.wmonospace=65367,e.wohiragana=12434,e.wokatakana=12530,e.wokatakanahalfwidth=65382,e.won=8361,e.wonmonospace=65510,e.wowaenthai=3623,e.wparen=9394,e.wring=7832,e.wsuperior=695,e.wturned=653,e.wynn=447,e.x=120,e.xabovecmb=829,e.xbopomofo=12562,e.xcircle=9447,e.xdieresis=7821,e.xdotaccent=7819,e.xeharmenian=1389,e.xi=958,e.xmonospace=65368,e.xparen=9395,e.xsuperior=739,e.y=121,e.yaadosquare=13134,e.yabengali=2479,e.yacute=253,e.yadeva=2351,e.yaekorean=12626,e.yagujarati=2735,e.yagurmukhi=2607,e.yahiragana=12420,e.yakatakana=12516,e.yakatakanahalfwidth=65428,e.yakorean=12625,e.yamakkanthai=3662,e.yasmallhiragana=12419,e.yasmallkatakana=12515,e.yasmallkatakanahalfwidth=65388,e.yatcyrillic=1123,e.ycircle=9448,e.ycircumflex=375,e.ydieresis=255,e.ydotaccent=7823,e.ydotbelow=7925,e.yeharabic=1610,e.yehbarreearabic=1746,e.yehbarreefinalarabic=64431,e.yehfinalarabic=65266,e.yehhamzaabovearabic=1574,e.yehhamzaabovefinalarabic=65162,e.yehhamzaaboveinitialarabic=65163,e.yehhamzaabovemedialarabic=65164,e.yehinitialarabic=65267,e.yehmedialarabic=65268,e.yehmeeminitialarabic=64733,e.yehmeemisolatedarabic=64600,e.yehnoonfinalarabic=64660,e.yehthreedotsbelowarabic=1745,e.yekorean=12630,e.yen=165,e.yenmonospace=65509,e.yeokorean=12629,e.yeorinhieuhkorean=12678,e.yerahbenyomohebrew=1450,e.yerahbenyomolefthebrew=1450,e.yericyrillic=1099,e.yerudieresiscyrillic=1273,e.yesieungkorean=12673,e.yesieungpansioskorean=12675,e.yesieungsioskorean=12674,e.yetivhebrew=1434,e.ygrave=7923,e.yhook=436,e.yhookabove=7927,e.yiarmenian=1397,e.yicyrillic=1111,e.yikorean=12642,e.yinyang=9775,e.yiwnarmenian=1410,e.ymonospace=65369,e.yod=1497,e.yoddagesh=64313,e.yoddageshhebrew=64313,e.yodhebrew=1497,e.yodyodhebrew=1522,e.yodyodpatahhebrew=64287,e.yohiragana=12424,e.yoikorean=12681,e.yokatakana=12520,e.yokatakanahalfwidth=65430,e.yokorean=12635,e.yosmallhiragana=12423,e.yosmallkatakana=12519,e.yosmallkatakanahalfwidth=65390,e.yotgreek=1011,e.yoyaekorean=12680,e.yoyakorean=12679,e.yoyakthai=3618,e.yoyingthai=3597,e.yparen=9396,e.ypogegrammeni=890,e.ypogegrammenigreekcmb=837,e.yr=422,e.yring=7833,e.ysuperior=696,e.ytilde=7929,e.yturned=654,e.yuhiragana=12422,e.yuikorean=12684,e.yukatakana=12518,e.yukatakanahalfwidth=65429,e.yukorean=12640,e.yusbigcyrillic=1131,e.yusbigiotifiedcyrillic=1133,e.yuslittlecyrillic=1127,e.yuslittleiotifiedcyrillic=1129,e.yusmallhiragana=12421,e.yusmallkatakana=12517,e.yusmallkatakanahalfwidth=65389,e.yuyekorean=12683,e.yuyeokorean=12682,e.yyabengali=2527,e.yyadeva=2399,e.z=122,e.zaarmenian=1382,e.zacute=378,e.zadeva=2395,e.zagurmukhi=2651,e.zaharabic=1592,e.zahfinalarabic=65222,e.zahinitialarabic=65223,e.zahiragana=12374,e.zahmedialarabic=65224,e.zainarabic=1586,e.zainfinalarabic=65200,e.zakatakana=12470,e.zaqefgadolhebrew=1429,e.zaqefqatanhebrew=1428,e.zarqahebrew=1432,e.zayin=1494,e.zayindagesh=64310,e.zayindageshhebrew=64310,e.zayinhebrew=1494,e.zbopomofo=12567,e.zcaron=382,e.zcircle=9449,e.zcircumflex=7825,e.zcurl=657,e.zdot=380,e.zdotaccent=380,e.zdotbelow=7827,e.zecyrillic=1079,e.zedescendercyrillic=1177,e.zedieresiscyrillic=1247,e.zehiragana=12380,e.zekatakana=12476,e.zero=48,e.zeroarabic=1632,e.zerobengali=2534,e.zerodeva=2406,e.zerogujarati=2790,e.zerogurmukhi=2662,e.zerohackarabic=1632,e.zeroinferior=8320,e.zeromonospace=65296,e.zerooldstyle=63280,e.zeropersian=1776,e.zerosuperior=8304,e.zerothai=3664,e.zerowidthjoiner=65279,e.zerowidthnonjoiner=8204,e.zerowidthspace=8203,e.zeta=950,e.zhbopomofo=12563,e.zhearmenian=1386,e.zhebrevecyrillic=1218,e.zhecyrillic=1078,e.zhedescendercyrillic=1175,e.zhedieresiscyrillic=1245,e.zihiragana=12376,e.zikatakana=12472,e.zinorhebrew=1454,e.zlinebelow=7829,e.zmonospace=65370,e.zohiragana=12382,e.zokatakana=12478,e.zparen=9397,e.zretroflexhook=656,e.zstroke=438,e.zuhiragana=12378,e.zukatakana=12474,e[`.notdef`]=0,e.angbracketleftbig=9001,e.angbracketleftBig=9001,e.angbracketleftbigg=9001,e.angbracketleftBigg=9001,e.angbracketrightBig=9002,e.angbracketrightbig=9002,e.angbracketrightBigg=9002,e.angbracketrightbigg=9002,e.arrowhookleft=8618,e.arrowhookright=8617,e.arrowlefttophalf=8636,e.arrowleftbothalf=8637,e.arrownortheast=8599,e.arrownorthwest=8598,e.arrowrighttophalf=8640,e.arrowrightbothalf=8641,e.arrowsoutheast=8600,e.arrowsouthwest=8601,e.backslashbig=8726,e.backslashBig=8726,e.backslashBigg=8726,e.backslashbigg=8726,e.bardbl=8214,e.bracehtipdownleft=65079,e.bracehtipdownright=65079,e.bracehtipupleft=65080,e.bracehtipupright=65080,e.braceleftBig=123,e.braceleftbig=123,e.braceleftbigg=123,e.braceleftBigg=123,e.bracerightBig=125,e.bracerightbig=125,e.bracerightbigg=125,e.bracerightBigg=125,e.bracketleftbig=91,e.bracketleftBig=91,e.bracketleftbigg=91,e.bracketleftBigg=91,e.bracketrightBig=93,e.bracketrightbig=93,e.bracketrightbigg=93,e.bracketrightBigg=93,e.ceilingleftbig=8968,e.ceilingleftBig=8968,e.ceilingleftBigg=8968,e.ceilingleftbigg=8968,e.ceilingrightbig=8969,e.ceilingrightBig=8969,e.ceilingrightbigg=8969,e.ceilingrightBigg=8969,e.circledotdisplay=8857,e.circledottext=8857,e.circlemultiplydisplay=8855,e.circlemultiplytext=8855,e.circleplusdisplay=8853,e.circleplustext=8853,e.contintegraldisplay=8750,e.contintegraltext=8750,e.coproductdisplay=8720,e.coproducttext=8720,e.floorleftBig=8970,e.floorleftbig=8970,e.floorleftbigg=8970,e.floorleftBigg=8970,e.floorrightbig=8971,e.floorrightBig=8971,e.floorrightBigg=8971,e.floorrightbigg=8971,e.hatwide=770,e.hatwider=770,e.hatwidest=770,e.intercal=7488,e.integraldisplay=8747,e.integraltext=8747,e.intersectiondisplay=8898,e.intersectiontext=8898,e.logicalanddisplay=8743,e.logicalandtext=8743,e.logicalordisplay=8744,e.logicalortext=8744,e.parenleftBig=40,e.parenleftbig=40,e.parenleftBigg=40,e.parenleftbigg=40,e.parenrightBig=41,e.parenrightbig=41,e.parenrightBigg=41,e.parenrightbigg=41,e.prime=8242,e.productdisplay=8719,e.producttext=8719,e.radicalbig=8730,e.radicalBig=8730,e.radicalBigg=8730,e.radicalbigg=8730,e.radicalbt=8730,e.radicaltp=8730,e.radicalvertex=8730,e.slashbig=47,e.slashBig=47,e.slashBigg=47,e.slashbigg=47,e.summationdisplay=8721,e.summationtext=8721,e.tildewide=732,e.tildewider=732,e.tildewidest=732,e.uniondisplay=8899,e.unionmultidisplay=8846,e.unionmultitext=8846,e.unionsqdisplay=8852,e.unionsqtext=8852,e.uniontext=8899,e.vextenddouble=8741,e.vextendsingle=8739}),Uo=sr(function(e){e.space=32,e.a1=9985,e.a2=9986,e.a202=9987,e.a3=9988,e.a4=9742,e.a5=9990,e.a119=9991,e.a118=9992,e.a117=9993,e.a11=9755,e.a12=9758,e.a13=9996,e.a14=9997,e.a15=9998,e.a16=9999,e.a105=1e4,e.a17=10001,e.a18=10002,e.a19=10003,e.a20=10004,e.a21=10005,e.a22=10006,e.a23=10007,e.a24=10008,e.a25=10009,e.a26=10010,e.a27=10011,e.a28=10012,e.a6=10013,e.a7=10014,e.a8=10015,e.a9=10016,e.a10=10017,e.a29=10018,e.a30=10019,e.a31=10020,e.a32=10021,e.a33=10022,e.a34=10023,e.a35=9733,e.a36=10025,e.a37=10026,e.a38=10027,e.a39=10028,e.a40=10029,e.a41=10030,e.a42=10031,e.a43=10032,e.a44=10033,e.a45=10034,e.a46=10035,e.a47=10036,e.a48=10037,e.a49=10038,e.a50=10039,e.a51=10040,e.a52=10041,e.a53=10042,e.a54=10043,e.a55=10044,e.a56=10045,e.a57=10046,e.a58=10047,e.a59=10048,e.a60=10049,e.a61=10050,e.a62=10051,e.a63=10052,e.a64=10053,e.a65=10054,e.a66=10055,e.a67=10056,e.a68=10057,e.a69=10058,e.a70=10059,e.a71=9679,e.a72=10061,e.a73=9632,e.a74=10063,e.a203=10064,e.a75=10065,e.a204=10066,e.a76=9650,e.a77=9660,e.a78=9670,e.a79=10070,e.a81=9687,e.a82=10072,e.a83=10073,e.a84=10074,e.a97=10075,e.a98=10076,e.a99=10077,e.a100=10078,e.a101=10081,e.a102=10082,e.a103=10083,e.a104=10084,e.a106=10085,e.a107=10086,e.a108=10087,e.a112=9827,e.a111=9830,e.a110=9829,e.a109=9824,e.a120=9312,e.a121=9313,e.a122=9314,e.a123=9315,e.a124=9316,e.a125=9317,e.a126=9318,e.a127=9319,e.a128=9320,e.a129=9321,e.a130=10102,e.a131=10103,e.a132=10104,e.a133=10105,e.a134=10106,e.a135=10107,e.a136=10108,e.a137=10109,e.a138=10110,e.a139=10111,e.a140=10112,e.a141=10113,e.a142=10114,e.a143=10115,e.a144=10116,e.a145=10117,e.a146=10118,e.a147=10119,e.a148=10120,e.a149=10121,e.a150=10122,e.a151=10123,e.a152=10124,e.a153=10125,e.a154=10126,e.a155=10127,e.a156=10128,e.a157=10129,e.a158=10130,e.a159=10131,e.a160=10132,e.a161=8594,e.a163=8596,e.a164=8597,e.a196=10136,e.a165=10137,e.a192=10138,e.a166=10139,e.a167=10140,e.a168=10141,e.a169=10142,e.a170=10143,e.a171=10144,e.a172=10145,e.a173=10146,e.a162=10147,e.a174=10148,e.a175=10149,e.a176=10150,e.a177=10151,e.a178=10152,e.a179=10153,e.a193=10154,e.a180=10155,e.a199=10156,e.a181=10157,e.a200=10158,e.a182=10159,e.a201=10161,e.a183=10162,e.a184=10163,e.a197=10164,e.a185=10165,e.a194=10166,e.a198=10167,e.a186=10168,e.a195=10169,e.a187=10170,e.a188=10171,e.a189=10172,e.a190=10173,e.a191=10174,e.a89=10088,e.a90=10089,e.a93=10090,e.a94=10091,e.a91=10092,e.a92=10093,e.a205=10094,e.a85=10095,e.a206=10096,e.a86=10097,e.a87=10098,e.a88=10099,e.a95=10100,e.a96=10101,e[`.notdef`]=0}),Wo=sr(function(e){e[63721]=169,e[63193]=169,e[63720]=174,e[63194]=174,e[63722]=8482,e[63195]=8482,e[63729]=9127,e[63730]=9128,e[63731]=9129,e[63740]=9131,e[63741]=9132,e[63742]=9133,e[63726]=9121,e[63727]=9122,e[63728]=9123,e[63737]=9124,e[63738]=9125,e[63739]=9126,e[63723]=9115,e[63724]=9116,e[63725]=9117,e[63734]=9118,e[63735]=9119,e[63736]=9120});function Go(e,t){let n=t[e];if(n!==void 0)return n;if(!e)return-1;if(e[0]===`u`){let t=e.length,r;if(t===7&&e[1]===`n`&&e[2]===`i`)r=e.substring(3);else{if(!(t>=5&&t<=7))return-1;r=e.substring(1)}if(r===r.toUpperCase()&&(n=parseInt(r,16),n>=0))return n}return-1}var Ko=[[0,127],[128,255],[256,383],[384,591],[592,687,7424,7551,7552,7615],[688,767,42752,42783],[768,879,7616,7679],[880,1023],[11392,11519],[1024,1279,1280,1327,11744,11775,42560,42655],[1328,1423],[1424,1535],[42240,42559],[1536,1791,1872,1919],[1984,2047],[2304,2431],[2432,2559],[2560,2687],[2688,2815],[2816,2943],[2944,3071],[3072,3199],[3200,3327],[3328,3455],[3584,3711],[3712,3839],[4256,4351,11520,11567],[6912,7039],[4352,4607],[7680,7935,11360,11391,42784,43007],[7936,8191],[8192,8303,11776,11903],[8304,8351],[8352,8399],[8400,8447],[8448,8527],[8528,8591],[8592,8703,10224,10239,10496,10623,11008,11263],[8704,8959,10752,11007,10176,10223,10624,10751],[8960,9215],[9216,9279],[9280,9311],[9312,9471],[9472,9599],[9600,9631],[9632,9727],[9728,9983],[9984,10175],[12288,12351],[12352,12447],[12448,12543,12784,12799],[12544,12591,12704,12735],[12592,12687],[43072,43135],[12800,13055],[13056,13311],[44032,55215],[55296,57343],[67840,67871],[19968,40959,11904,12031,12032,12255,12272,12287,13312,19903,131072,173791,12688,12703],[57344,63743],[12736,12783,63744,64255,194560,195103],[64256,64335],[64336,65023],[65056,65071],[65040,65055],[65104,65135],[65136,65279],[65280,65519],[65520,65535],[3840,4095],[1792,1871],[1920,1983],[3456,3583],[4096,4255],[4608,4991,4992,5023,11648,11743],[5024,5119],[5120,5759],[5760,5791],[5792,5887],[6016,6143],[6144,6319],[10240,10495],[40960,42127],[5888,5919,5920,5951,5952,5983,5984,6015],[66304,66351],[66352,66383],[66560,66639],[118784,119039,119040,119295,119296,119375],[119808,120831],[1044480,1048573],[65024,65039,917760,917999],[917504,917631],[6400,6479],[6480,6527],[6528,6623],[6656,6687],[11264,11359],[11568,11647],[19904,19967],[43008,43055],[65536,65663,65664,65791,65792,65855],[65856,65935],[66432,66463],[66464,66527],[66640,66687],[66688,66735],[67584,67647],[68096,68191],[119552,119647],[73728,74751,74752,74879],[119648,119679],[7040,7103],[7168,7247],[7248,7295],[43136,43231],[43264,43311],[43312,43359],[43520,43615],[65936,65999],[66e3,66047],[66208,66271,66176,66207,67872,67903],[127024,127135,126976,127023]];function qo(e,t=-1){if(t!==-1){let n=Ko[t];for(let r=0,i=n.length;r<i;r+=2)if(e>=n[r]&&e<=n[r+1])return t}for(let t=0,n=Ko.length;t<n;t++){let n=Ko[t];for(let r=0,i=n.length;r<i;r+=2)if(e>=n[r]&&e<=n[r+1])return t}return-1}var Jo=RegExp(`^(\\s)|(\\p{Mn})|(\\p{Cf})$`,`u`),Yo=new Map,Xo=!0,Zo=1,Qo=2,$o=4,es=32,ts=`.notdef,.null,nonmarkingreturn,space,exclam,quotedbl,numbersign,dollar,percent,ampersand,quotesingle,parenleft,parenright,asterisk,plus,comma,hyphen,period,slash,zero,one,two,three,four,five,six,seven,eight,nine,colon,semicolon,less,equal,greater,question,at,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,bracketleft,backslash,bracketright,asciicircum,underscore,grave,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,braceleft,bar,braceright,asciitilde,Adieresis,Aring,Ccedilla,Eacute,Ntilde,Odieresis,Udieresis,aacute,agrave,acircumflex,adieresis,atilde,aring,ccedilla,eacute,egrave,ecircumflex,edieresis,iacute,igrave,icircumflex,idieresis,ntilde,oacute,ograve,ocircumflex,odieresis,otilde,uacute,ugrave,ucircumflex,udieresis,dagger,degree,cent,sterling,section,bullet,paragraph,germandbls,registered,copyright,trademark,acute,dieresis,notequal,AE,Oslash,infinity,plusminus,lessequal,greaterequal,yen,mu,partialdiff,summation,product,pi,integral,ordfeminine,ordmasculine,Omega,ae,oslash,questiondown,exclamdown,logicalnot,radical,florin,approxequal,Delta,guillemotleft,guillemotright,ellipsis,nonbreakingspace,Agrave,Atilde,Otilde,OE,oe,endash,emdash,quotedblleft,quotedblright,quoteleft,quoteright,divide,lozenge,ydieresis,Ydieresis,fraction,currency,guilsinglleft,guilsinglright,fi,fl,daggerdbl,periodcentered,quotesinglbase,quotedblbase,perthousand,Acircumflex,Ecircumflex,Aacute,Edieresis,Egrave,Iacute,Icircumflex,Idieresis,Igrave,Oacute,Ocircumflex,apple,Ograve,Uacute,Ucircumflex,Ugrave,dotlessi,circumflex,tilde,macron,breve,dotaccent,ring,cedilla,hungarumlaut,ogonek,caron,Lslash,lslash,Scaron,scaron,Zcaron,zcaron,brokenbar,Eth,eth,Yacute,yacute,Thorn,thorn,minus,multiply,onesuperior,twosuperior,threesuperior,onehalf,onequarter,threequarters,franc,Gbreve,gbreve,Idotaccent,Scedilla,scedilla,Cacute,cacute,Ccaron,ccaron,dcroat`.split(`,`);function ns(e,t){if(t[e]!==void 0)return e;let n=Go(e,t);if(n!==-1){for(let e in t)if(t[e]===n)return e}return hn(`Unable to recover a standard glyph name for: `+e),e}function rs(e,t,n){let r=Object.create(null),i,a,o,s=!!(e.flags&$o);if(e.isInternalFont)for(o=t,a=0;a<o.length;a++)i=n.indexOf(o[a]),r[a]=i>=0?i:0;else if(e.baseEncodingName)for(o=Vo(e.baseEncodingName),a=0;a<o.length;a++)i=n.indexOf(o[a]),r[a]=i>=0?i:0;else if(s)for(a in t)r[a]=t[a];else for(o=Lo,a=0;a<o.length;a++)i=n.indexOf(o[a]),r[a]=i>=0?i:0;let c=e.differences,l;if(c)for(a in c){let e=c[a];if(i=n.indexOf(e),i===-1){l||=Ho();let t=ns(e,l);t!==e&&(i=n.indexOf(t))}r[a]=i>=0?i:0}return r}function is(e){return e.replaceAll(/[,_]/g,`-`).replaceAll(/\s/g,``)}var as=sr(e=>{e[8211]=65074,e[8212]=65073,e[8229]=65072,e[8230]=65049,e[12289]=65041,e[12290]=65042,e[12296]=65087,e[12297]=65088,e[12298]=65085,e[12299]=65086,e[12300]=65089,e[12301]=65090,e[12302]=65091,e[12303]=65092,e[12304]=65083,e[12305]=65084,e[12308]=65081,e[12309]=65082,e[12310]=65047,e[12311]=65048,e[65103]=65076,e[65281]=65045,e[65288]=65077,e[65289]=65078,e[65292]=65040,e[65306]=65043,e[65307]=65044,e[65311]=65046,e[65339]=65095,e[65341]=65096,e[65343]=65075,e[65371]=65079,e[65373]=65080}),os=`.notdef,space,exclam,quotedbl,numbersign,dollar,percent,ampersand,quoteright,parenleft,parenright,asterisk,plus,comma,hyphen,period,slash,zero,one,two,three,four,five,six,seven,eight,nine,colon,semicolon,less,equal,greater,question,at,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,bracketleft,backslash,bracketright,asciicircum,underscore,quoteleft,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,braceleft,bar,braceright,asciitilde,exclamdown,cent,sterling,fraction,yen,florin,section,currency,quotesingle,quotedblleft,guillemotleft,guilsinglleft,guilsinglright,fi,fl,endash,dagger,daggerdbl,periodcentered,paragraph,bullet,quotesinglbase,quotedblbase,quotedblright,guillemotright,ellipsis,perthousand,questiondown,grave,acute,circumflex,tilde,macron,breve,dotaccent,dieresis,ring,cedilla,hungarumlaut,ogonek,caron,emdash,AE,ordfeminine,Lslash,Oslash,OE,ordmasculine,ae,dotlessi,lslash,oslash,oe,germandbls,onesuperior,logicalnot,mu,trademark,Eth,onehalf,plusminus,Thorn,onequarter,divide,brokenbar,degree,thorn,threequarters,twosuperior,registered,minus,eth,multiply,threesuperior,copyright,Aacute,Acircumflex,Adieresis,Agrave,Aring,Atilde,Ccedilla,Eacute,Ecircumflex,Edieresis,Egrave,Iacute,Icircumflex,Idieresis,Igrave,Ntilde,Oacute,Ocircumflex,Odieresis,Ograve,Otilde,Scaron,Uacute,Ucircumflex,Udieresis,Ugrave,Yacute,Ydieresis,Zcaron,aacute,acircumflex,adieresis,agrave,aring,atilde,ccedilla,eacute,ecircumflex,edieresis,egrave,iacute,icircumflex,idieresis,igrave,ntilde,oacute,ocircumflex,odieresis,ograve,otilde,scaron,uacute,ucircumflex,udieresis,ugrave,yacute,ydieresis,zcaron`.split(`,`),ss=`.notdef,space,exclamsmall,Hungarumlautsmall,dollaroldstyle,dollarsuperior,ampersandsmall,Acutesmall,parenleftsuperior,parenrightsuperior,twodotenleader,onedotenleader,comma,hyphen,period,fraction,zerooldstyle,oneoldstyle,twooldstyle,threeoldstyle,fouroldstyle,fiveoldstyle,sixoldstyle,sevenoldstyle,eightoldstyle,nineoldstyle,colon,semicolon,commasuperior,threequartersemdash,periodsuperior,questionsmall,asuperior,bsuperior,centsuperior,dsuperior,esuperior,isuperior,lsuperior,msuperior,nsuperior,osuperior,rsuperior,ssuperior,tsuperior,ff,fi,fl,ffi,ffl,parenleftinferior,parenrightinferior,Circumflexsmall,hyphensuperior,Gravesmall,Asmall,Bsmall,Csmall,Dsmall,Esmall,Fsmall,Gsmall,Hsmall,Ismall,Jsmall,Ksmall,Lsmall,Msmall,Nsmall,Osmall,Psmall,Qsmall,Rsmall,Ssmall,Tsmall,Usmall,Vsmall,Wsmall,Xsmall,Ysmall,Zsmall,colonmonetary,onefitted,rupiah,Tildesmall,exclamdownsmall,centoldstyle,Lslashsmall,Scaronsmall,Zcaronsmall,Dieresissmall,Brevesmall,Caronsmall,Dotaccentsmall,Macronsmall,figuredash,hypheninferior,Ogoneksmall,Ringsmall,Cedillasmall,onequarter,onehalf,threequarters,questiondownsmall,oneeighth,threeeighths,fiveeighths,seveneighths,onethird,twothirds,zerosuperior,onesuperior,twosuperior,threesuperior,foursuperior,fivesuperior,sixsuperior,sevensuperior,eightsuperior,ninesuperior,zeroinferior,oneinferior,twoinferior,threeinferior,fourinferior,fiveinferior,sixinferior,seveninferior,eightinferior,nineinferior,centinferior,dollarinferior,periodinferior,commainferior,Agravesmall,Aacutesmall,Acircumflexsmall,Atildesmall,Adieresissmall,Aringsmall,AEsmall,Ccedillasmall,Egravesmall,Eacutesmall,Ecircumflexsmall,Edieresissmall,Igravesmall,Iacutesmall,Icircumflexsmall,Idieresissmall,Ethsmall,Ntildesmall,Ogravesmall,Oacutesmall,Ocircumflexsmall,Otildesmall,Odieresissmall,OEsmall,Oslashsmall,Ugravesmall,Uacutesmall,Ucircumflexsmall,Udieresissmall,Yacutesmall,Thornsmall,Ydieresissmall`.split(`,`),cs=`.notdef,space,dollaroldstyle,dollarsuperior,parenleftsuperior,parenrightsuperior,twodotenleader,onedotenleader,comma,hyphen,period,fraction,zerooldstyle,oneoldstyle,twooldstyle,threeoldstyle,fouroldstyle,fiveoldstyle,sixoldstyle,sevenoldstyle,eightoldstyle,nineoldstyle,colon,semicolon,commasuperior,threequartersemdash,periodsuperior,asuperior,bsuperior,centsuperior,dsuperior,esuperior,isuperior,lsuperior,msuperior,nsuperior,osuperior,rsuperior,ssuperior,tsuperior,ff,fi,fl,ffi,ffl,parenleftinferior,parenrightinferior,hyphensuperior,colonmonetary,onefitted,rupiah,centoldstyle,figuredash,hypheninferior,onequarter,onehalf,threequarters,oneeighth,threeeighths,fiveeighths,seveneighths,onethird,twothirds,zerosuperior,onesuperior,twosuperior,threesuperior,foursuperior,fivesuperior,sixsuperior,sevensuperior,eightsuperior,ninesuperior,zeroinferior,oneinferior,twoinferior,threeinferior,fourinferior,fiveinferior,sixinferior,seveninferior,eightinferior,nineinferior,centinferior,dollarinferior,periodinferior,commainferior`.split(`,`),ls=`.notdef,space,exclam,quotedbl,numbersign,dollar,percent,ampersand,quoteright,parenleft,parenright,asterisk,plus,comma,hyphen,period,slash,zero,one,two,three,four,five,six,seven,eight,nine,colon,semicolon,less,equal,greater,question,at,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,bracketleft,backslash,bracketright,asciicircum,underscore,quoteleft,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,braceleft,bar,braceright,asciitilde,exclamdown,cent,sterling,fraction,yen,florin,section,currency,quotesingle,quotedblleft,guillemotleft,guilsinglleft,guilsinglright,fi,fl,endash,dagger,daggerdbl,periodcentered,paragraph,bullet,quotesinglbase,quotedblbase,quotedblright,guillemotright,ellipsis,perthousand,questiondown,grave,acute,circumflex,tilde,macron,breve,dotaccent,dieresis,ring,cedilla,hungarumlaut,ogonek,caron,emdash,AE,ordfeminine,Lslash,Oslash,OE,ordmasculine,ae,dotlessi,lslash,oslash,oe,germandbls,onesuperior,logicalnot,mu,trademark,Eth,onehalf,plusminus,Thorn,onequarter,divide,brokenbar,degree,thorn,threequarters,twosuperior,registered,minus,eth,multiply,threesuperior,copyright,Aacute,Acircumflex,Adieresis,Agrave,Aring,Atilde,Ccedilla,Eacute,Ecircumflex,Edieresis,Egrave,Iacute,Icircumflex,Idieresis,Igrave,Ntilde,Oacute,Ocircumflex,Odieresis,Ograve,Otilde,Scaron,Uacute,Ucircumflex,Udieresis,Ugrave,Yacute,Ydieresis,Zcaron,aacute,acircumflex,adieresis,agrave,aring,atilde,ccedilla,eacute,ecircumflex,edieresis,egrave,iacute,icircumflex,idieresis,igrave,ntilde,oacute,ocircumflex,odieresis,ograve,otilde,scaron,uacute,ucircumflex,udieresis,ugrave,yacute,ydieresis,zcaron,exclamsmall,Hungarumlautsmall,dollaroldstyle,dollarsuperior,ampersandsmall,Acutesmall,parenleftsuperior,parenrightsuperior,twodotenleader,onedotenleader,zerooldstyle,oneoldstyle,twooldstyle,threeoldstyle,fouroldstyle,fiveoldstyle,sixoldstyle,sevenoldstyle,eightoldstyle,nineoldstyle,commasuperior,threequartersemdash,periodsuperior,questionsmall,asuperior,bsuperior,centsuperior,dsuperior,esuperior,isuperior,lsuperior,msuperior,nsuperior,osuperior,rsuperior,ssuperior,tsuperior,ff,ffi,ffl,parenleftinferior,parenrightinferior,Circumflexsmall,hyphensuperior,Gravesmall,Asmall,Bsmall,Csmall,Dsmall,Esmall,Fsmall,Gsmall,Hsmall,Ismall,Jsmall,Ksmall,Lsmall,Msmall,Nsmall,Osmall,Psmall,Qsmall,Rsmall,Ssmall,Tsmall,Usmall,Vsmall,Wsmall,Xsmall,Ysmall,Zsmall,colonmonetary,onefitted,rupiah,Tildesmall,exclamdownsmall,centoldstyle,Lslashsmall,Scaronsmall,Zcaronsmall,Dieresissmall,Brevesmall,Caronsmall,Dotaccentsmall,Macronsmall,figuredash,hypheninferior,Ogoneksmall,Ringsmall,Cedillasmall,questiondownsmall,oneeighth,threeeighths,fiveeighths,seveneighths,onethird,twothirds,zerosuperior,foursuperior,fivesuperior,sixsuperior,sevensuperior,eightsuperior,ninesuperior,zeroinferior,oneinferior,twoinferior,threeinferior,fourinferior,fiveinferior,sixinferior,seveninferior,eightinferior,nineinferior,centinferior,dollarinferior,periodinferior,commainferior,Agravesmall,Aacutesmall,Acircumflexsmall,Atildesmall,Adieresissmall,Aringsmall,AEsmall,Ccedillasmall,Egravesmall,Eacutesmall,Ecircumflexsmall,Edieresissmall,Igravesmall,Iacutesmall,Icircumflexsmall,Idieresissmall,Ethsmall,Ntildesmall,Ogravesmall,Oacutesmall,Ocircumflexsmall,Otildesmall,Odieresissmall,OEsmall,Oslashsmall,Ugravesmall,Uacutesmall,Ucircumflexsmall,Udieresissmall,Yacutesmall,Thornsmall,Ydieresissmall,001.000,001.001,001.002,001.003,Black,Bold,Book,Light,Medium,Regular,Roman,Semibold`.split(`,`),us=391,ds=[null,{id:`hstem`,min:2,stackClearing:!0,stem:!0},null,{id:`vstem`,min:2,stackClearing:!0,stem:!0},{id:`vmoveto`,min:1,stackClearing:!0},{id:`rlineto`,min:2,resetStack:!0},{id:`hlineto`,min:1,resetStack:!0},{id:`vlineto`,min:1,resetStack:!0},{id:`rrcurveto`,min:6,resetStack:!0},null,{id:`callsubr`,min:1,undefStack:!0},{id:`return`,min:0,undefStack:!0},null,null,{id:`endchar`,min:0,stackClearing:!0},null,null,null,{id:`hstemhm`,min:2,stackClearing:!0,stem:!0},{id:`hintmask`,min:0,stackClearing:!0},{id:`cntrmask`,min:0,stackClearing:!0},{id:`rmoveto`,min:2,stackClearing:!0},{id:`hmoveto`,min:1,stackClearing:!0},{id:`vstemhm`,min:2,stackClearing:!0,stem:!0},{id:`rcurveline`,min:8,resetStack:!0},{id:`rlinecurve`,min:8,resetStack:!0},{id:`vvcurveto`,min:4,resetStack:!0},{id:`hhcurveto`,min:4,resetStack:!0},null,{id:`callgsubr`,min:1,undefStack:!0},{id:`vhcurveto`,min:4,resetStack:!0},{id:`hvcurveto`,min:4,resetStack:!0}],fs=[null,null,null,{id:`and`,min:2,stackDelta:-1},{id:`or`,min:2,stackDelta:-1},{id:`not`,min:1,stackDelta:0},null,null,null,{id:`abs`,min:1,stackDelta:0},{id:`add`,min:2,stackDelta:-1,stackFn(e,t){e[t-2]=e[t-2]+e[t-1]}},{id:`sub`,min:2,stackDelta:-1,stackFn(e,t){e[t-2]=e[t-2]-e[t-1]}},{id:`div`,min:2,stackDelta:-1,stackFn(e,t){e[t-2]=e[t-2]/e[t-1]}},null,{id:`neg`,min:1,stackDelta:0,stackFn(e,t){e[t-1]=-e[t-1]}},{id:`eq`,min:2,stackDelta:-1},null,null,{id:`drop`,min:1,stackDelta:-1},null,{id:`put`,min:2,stackDelta:-2},{id:`get`,min:1,stackDelta:0},{id:`ifelse`,min:4,stackDelta:-3},{id:`random`,min:0,stackDelta:1},{id:`mul`,min:2,stackDelta:-1,stackFn(e,t){e[t-2]=e[t-2]*e[t-1]}},null,{id:`sqrt`,min:1,stackDelta:0},{id:`dup`,min:1,stackDelta:1},{id:`exch`,min:2,stackDelta:0},{id:`index`,min:2,stackDelta:0},{id:`roll`,min:3,stackDelta:-2},null,null,null,{id:`hflex`,min:7,resetStack:!0},{id:`flex`,min:13,resetStack:!0},{id:`hflex1`,min:9,resetStack:!0},{id:`flex1`,min:11,resetStack:!0}],ps=class{constructor(e,t,n){this.bytes=e.getBytes(),this.properties=t,this.seacAnalysisEnabled=!!n}parse(){let e=this.properties,t=new ms;this.cff=t;let n=this.parseHeader(),r=this.parseIndex(n.endPos),i=this.parseIndex(r.endPos),a=this.parseIndex(i.endPos),o=this.parseIndex(a.endPos),s=this.parseDict(i.obj.get(0)),c=this.createDict(bs,s,t.strings);t.header=n.obj,t.names=this.parseNameIndex(r.obj),t.strings=this.parseStringIndex(a.obj),t.topDict=c,t.globalSubrIndex=o.obj,this.parsePrivateDict(t.topDict),t.isCIDFont=c.hasName(`ROS`);let l=c.getByName(`CharStrings`),u=this.parseIndex(l).obj,d=c.getByName(`FontMatrix`);d&&(e.fontMatrix=d);let f=c.getByName(`FontBBox`),p,m;if(f&&(e.ascent=Math.max(f[3],f[1]),e.descent=Math.min(f[1],f[3]),e.ascentScaled=!0),t.isCIDFont){let e=this.parseIndex(c.getByName(`FDArray`)).obj;for(let n=0,r=e.count;n<r;++n){let r=e.get(n),i=this.createDict(bs,this.parseDict(r),t.strings);this.parsePrivateDict(i),t.fdArray.push(i)}m=null,p=this.parseCharsets(c.getByName(`charset`),u.count,t.strings,!0),t.fdSelect=this.parseFDSelect(c.getByName(`FDSelect`),u.count)}else p=this.parseCharsets(c.getByName(`charset`),u.count,t.strings,!1),m=this.parseEncoding(c.getByName(`Encoding`),e,t.strings,p.charset);t.charset=p,t.encoding=m;let h=this.parseCharStrings({charStrings:u,localSubrIndex:c.privateDict.subrsIndex,globalSubrIndex:o.obj,fdSelect:t.fdSelect,fdArray:t.fdArray,privateDict:c.privateDict});return t.charStrings=h.charStrings,t.seacs=h.seacs,t.widths=h.widths,t}parseHeader(){let e=this.bytes,t=e.length,n=0;for(;n<t&&e[n]!==1;)++n;if(n>=t)throw new F(`Invalid CFF header`);n!==0&&(hn(`cff data is shifted`),e=e.subarray(n),this.bytes=e);let r=e[0],i=e[1],a=e[2],o=e[3];return{obj:new hs(r,i,a,o),endPos:a}}parseDict(e){let t=0;function n(){let n=e[t++];return n===30?function(){let n=``,r=[`0`,`1`,`2`,`3`,`4`,`5`,`6`,`7`,`8`,`9`,`.`,`E`,`E-`,null,`-`],i=e.length;for(;t<i;){let i=e[t++],a=i>>4,o=15&i;if(a===15||(n+=r[a],o===15))break;n+=r[o]}return parseFloat(n)}():n===28?(n=yr(e,t),t+=2,n):n===29?(n=e[t++],n=n<<8|e[t++],n=n<<8|e[t++],n=n<<8|e[t++],n):n>=32&&n<=246?n-139:n>=247&&n<=250?256*(n-247)+e[t++]+108:n>=251&&n<=254?-256*(n-251)-e[t++]-108:(N(`CFFParser_parseDict: "`+n+`" is a reserved command.`),NaN)}let r=[],i=[];t=0;let a=e.length;for(;t<a;){let a=e[t];a<=21?(a===12&&(a=a<<8|e[++t]),i.push([a,r]),r=[],++t):r.push(n())}return i}parseIndex(e){let t=new _s,n=this.bytes,r=n[e++]<<8|n[e++],i=[],a,o,s=e;if(r!==0){let t=n[e++],c=e+(r+1)*t-1;for(a=0,o=r+1;a<o;++a){let r=0;for(let i=0;i<t;++i)r<<=8,r+=n[e++];i.push(c+r)}s=i[r]}for(a=0,o=i.length-1;a<o;++a){let e=i[a],r=i[a+1];t.add(n.subarray(e,r))}return{obj:t,endPos:s}}parseNameIndex(e){let t=[];for(let n=0,r=e.count;n<r;++n){let r=e.get(n);t.push(Tn(r))}return t}parseStringIndex(e){let t=new gs;for(let n=0,r=e.count;n<r;++n){let r=e.get(n);t.add(Tn(r))}return t}createDict(e,t,n){let r=new e(n);for(let[e,n]of t)r.setByKey(e,n);return r}parseCharString(e,t,n,r){if(!t||e.callDepth>10)return!1;let i=e.stackSize,a=e.stack,o=t.length;for(let s=0;s<o;){let c=t[s++],l=null;if(c===12){let e=t[s++];e===0?(t[s-2]=139,t[s-1]=22,i=0):l=fs[e]}else if(c===28)a[i]=yr(t,s),s+=2,i++;else if(c===14){if(i>=4&&(i-=4,this.seacAnalysisEnabled))return e.seac=a.slice(i,i+4),!1;l=ds[c]}else if(c>=32&&c<=246)a[i]=c-139,i++;else if(c>=247&&c<=254)a[i]=c<251?(c-247<<8)+t[s]+108:-(c-251<<8)-t[s]-108,s++,i++;else if(c===255)a[i]=(t[s]<<24|t[s+1]<<16|t[s+2]<<8|t[s+3])/65536,s+=4,i++;else if(c===19||c===20){if(e.hints+=i>>1,e.hints===0){t.copyWithin(s-1,s,-1),--s,--o;continue}s+=e.hints+7>>3,i%=2,l=ds[c]}else{if(c===10||c===29){let t=c===10?n:r;if(!t)return l=ds[c],N(`Missing subrsIndex for `+l.id),!1;let o=32768;t.count<1240?o=107:t.count<33900&&(o=1131);let s=a[--i]+o;if(s<0||s>=t.count||isNaN(s))return l=ds[c],N(`Out of bounds subrIndex for `+l.id),!1;if(e.stackSize=i,e.callDepth++,!this.parseCharString(e,t.get(s),n,r))return!1;e.callDepth--,i=e.stackSize;continue}if(c===11)return e.stackSize=i,!0;if(c===0&&s===t.length)t[s-1]=14,l=ds[14];else{if(c===9){t.copyWithin(s-1,s,-1),--s,--o;continue}l=ds[c]}}if(l){if(l.stem&&(e.hints+=i>>1,c===3||c===23?e.hasVStems=!0:!e.hasVStems||c!==1&&c!==18||(N(`CFF stem hints are in wrong order`),t[s-1]=c===1?3:23)),`min`in l&&!e.undefStack&&i<l.min)return N(`Not enough parameters for `+l.id+`; actual: `+i+`, expected: `+l.min),i===0&&(t[s-1]=14,!0);e.firstStackClearing&&l.stackClearing&&(e.firstStackClearing=!1,i-=l.min,i>=2&&l.stem?i%=2:i>1&&N(`Found too many parameters for stack-clearing command`),i>0&&(e.width=a[i-1])),`stackDelta`in l?(`stackFn`in l&&l.stackFn(a,i),i+=l.stackDelta):l.stackClearing?i=0:l.resetStack?(i=0,e.undefStack=!1):l.undefStack&&(i=0,e.undefStack=!0,e.firstStackClearing=!1)}}return o<t.length&&t.fill(14,o),e.stackSize=i,!0}parseCharStrings({charStrings:e,localSubrIndex:t,globalSubrIndex:n,fdSelect:r,fdArray:i,privateDict:a}){let o=[],s=[],c=e.count;for(let l=0;l<c;l++){let c=e.get(l),u={callDepth:0,stackSize:0,stack:[],undefStack:!0,hints:0,firstStackClearing:!0,seac:null,width:null,hasVStems:!1},d=!0,f=null,p=a;if(r&&i.length){let e=r.getFDIndex(l);e===-1&&(N(`Glyph index is not in fd select.`),d=!1),e>=i.length&&(N(`Invalid fd index for glyph index.`),d=!1),d&&(p=i[e].privateDict,f=p.subrsIndex)}else t&&(f=t);d&&=this.parseCharString(u,c,f,n),u.width===null?s[l]=p.getByName(`defaultWidthX`):s[l]=p.getByName(`nominalWidthX`)+u.width,u.seac!==null&&(o[l]=u.seac),d||e.set(l,new Uint8Array([14]))}return{charStrings:e,seacs:o,widths:s}}emptyPrivateDictionary(e){let t=this.createDict(Ss,[],e.strings);e.setByKey(18,[0,0]),e.privateDict=t}parsePrivateDict(e){if(!e.hasName(`Private`))return void this.emptyPrivateDictionary(e);let t=e.getByName(`Private`);if(!Array.isArray(t)||t.length!==2)return void e.removeByName(`Private`);let n=t[0],r=t[1];if(n===0||r>=this.bytes.length)return void this.emptyPrivateDictionary(e);let i=r+n,a=this.bytes.subarray(r,i),o=this.parseDict(a),s=this.createDict(Ss,o,e.strings);if(e.privateDict=s,s.getByName(`ExpansionFactor`)===0&&s.setByName(`ExpansionFactor`,.06),!s.getByName(`Subrs`))return;let c=s.getByName(`Subrs`),l=r+c;if(c===0||l>=this.bytes.length)return void this.emptyPrivateDictionary(e);s.subrsIndex=this.parseIndex(l).obj}parseCharsets(e,t,n,r){if(e===0)return new ws(!0,Cs.ISO_ADOBE,os);if(e===1)return new ws(!0,Cs.EXPERT,ss);if(e===2)return new ws(!0,Cs.EXPERT_SUBSET,cs);let i=this.bytes,a=e,o=i[e++],s=[r?0:`.notdef`],c,l,u;switch(--t,o){case 0:for(u=0;u<t;u++)c=i[e++]<<8|i[e++],s.push(r?c:n.get(c));break;case 1:for(;s.length<=t;)for(c=i[e++]<<8|i[e++],l=i[e++],u=0;u<=l;u++)s.push(r?c++:n.get(c++));break;case 2:for(;s.length<=t;)for(c=i[e++]<<8|i[e++],l=i[e++]<<8|i[e++],u=0;u<=l;u++)s.push(r?c++:n.get(c++));break;default:throw new F(`Unknown charset format`)}let d=e;return new ws(!1,o,s,i.subarray(a,d))}parseEncoding(e,t,n,r){let i=Object.create(null),a=this.bytes,o,s,c,l=!1,u=null;if(e===0||e===1){l=!0,o=e;let t=e?Po:Lo;for(s=0,c=r.length;s<c;s++){let e=t.indexOf(r[s]);e!==-1&&(i[e]=s)}}else{let t=e;switch(o=a[e++],127&o){case 0:let t=a[e++];for(s=1;s<=t;s++)i[a[e++]]=s;break;case 1:let n=a[e++],r=1;for(s=0;s<n;s++){let t=a[e++],n=a[e++];for(let e=t;e<=t+n;e++)i[e]=r++}break;default:throw new F(`Unknown encoding format: ${o} in CFF`)}let c=e;128&o&&(a[t]&=127,function(){let t=a[e++];for(s=0;s<t;s++){let t=a[e++],o=(a[e++]<<8)+(255&a[e++]);i[t]=r.indexOf(n.get(o))}}()),u=a.subarray(t,c)}return o&=127,new Ts(l,o,i,u)}parseFDSelect(e,t){let n=this.bytes,r=n[e++],i=[],a;switch(r){case 0:for(a=0;a<t;++a){let t=n[e++];i.push(t)}break;case 3:let o=n[e++]<<8|n[e++];for(a=0;a<o;++a){let t=n[e++]<<8|n[e++];a===0&&t!==0&&(N(`parseFDSelect: The first range must have a first GID of 0 -- trying to recover.`),t=0);let r=n[e++],o=n[e]<<8|n[e+1];for(let e=t;e<o;++e)i.push(r)}e+=2;break;default:throw new F(`parseFDSelect: Unknown format "${r}".`)}if(i.length!==t)throw new F(`parseFDSelect: Invalid font data.`);return new Es(r,i)}},ms=class{constructor(){this.header=null,this.names=[],this.topDict=null,this.strings=new gs,this.globalSubrIndex=null,this.encoding=null,this.charset=null,this.charStrings=null,this.fdArray=[],this.fdSelect=null,this.isCIDFont=!1}duplicateFirstGlyph(){if(this.charStrings.count>=65535)return void N(`Not enough space in charstrings to duplicate first glyph.`);let e=this.charStrings.get(0);this.charStrings.add(e),this.isCIDFont&&this.fdSelect.fdSelect.push(this.fdSelect.fdSelect[0])}hasGlyphId(e){return e<0||e>=this.charStrings.count?!1:this.charStrings.get(e).length>0}},hs=class{constructor(e,t,n,r){this.major=e,this.minor=t,this.hdrSize=n,this.offSize=r}},gs=class{constructor(){this.strings=[]}get(e){return e>=0&&e<=390?ls[e]:e-us<=this.strings.length?this.strings[e-us]:ls[0]}getSID(e){let t=ls.indexOf(e);return t===-1?(t=this.strings.indexOf(e),t===-1?-1:t+us):t}add(e){this.strings.push(e)}get count(){return this.strings.length}},_s=class{constructor(){this.objects=[],this.length=0}add(e){this.length+=e.length,this.objects.push(e)}set(e,t){this.length+=t.length-this.objects[e].length,this.objects[e]=t}get(e){return this.objects[e]}get count(){return this.objects.length}},vs=class{constructor(e,t){this.keyToNameMap=e.keyToNameMap,this.nameToKeyMap=e.nameToKeyMap,this.defaults=e.defaults,this.types=e.types,this.opcodes=e.opcodes,this.order=e.order,this.strings=t,this.values=Object.create(null)}setByKey(e,t){if(!(e in this.keyToNameMap))return!1;if(t.length===0)return!0;for(let n of t)if(isNaN(n))return N(`Invalid CFFDict value: "${t}" for key "${e}".`),!0;let n=this.types[e];return n!==`num`&&n!==`sid`&&n!==`offset`||(t=t[0]),this.values[e]=t,!0}setByName(e,t){if(!(e in this.nameToKeyMap))throw new F(`Invalid dictionary name "${e}"`);this.values[this.nameToKeyMap[e]]=t}hasName(e){return this.nameToKeyMap[e]in this.values}getByName(e){if(!(e in this.nameToKeyMap))throw new F(`Invalid dictionary name ${e}"`);let t=this.nameToKeyMap[e];return t in this.values?this.values[t]:this.defaults[t]}removeByName(e){delete this.values[this.nameToKeyMap[e]]}static createTables(e){let t={keyToNameMap:{},nameToKeyMap:{},defaults:{},types:{},opcodes:{},order:[]};for(let n of e){let e=Array.isArray(n[0])?(n[0][0]<<8)+n[0][1]:n[0];t.keyToNameMap[e]=n[1],t.nameToKeyMap[n[1]]=e,t.types[e]=n[2],t.defaults[e]=n[3],t.opcodes[e]=Array.isArray(n[0])?n[0]:[n[0]],t.order.push(e)}return t}},ys=[[[12,30],`ROS`,[`sid`,`sid`,`num`],null],[[12,20],`SyntheticBase`,`num`,null],[0,`version`,`sid`,null],[1,`Notice`,`sid`,null],[[12,0],`Copyright`,`sid`,null],[2,`FullName`,`sid`,null],[3,`FamilyName`,`sid`,null],[4,`Weight`,`sid`,null],[[12,1],`isFixedPitch`,`num`,0],[[12,2],`ItalicAngle`,`num`,0],[[12,3],`UnderlinePosition`,`num`,-100],[[12,4],`UnderlineThickness`,`num`,50],[[12,5],`PaintType`,`num`,0],[[12,6],`CharstringType`,`num`,2],[[12,7],`FontMatrix`,[`num`,`num`,`num`,`num`,`num`,`num`],[.001,0,0,.001,0,0]],[13,`UniqueID`,`num`,null],[5,`FontBBox`,[`num`,`num`,`num`,`num`],[0,0,0,0]],[[12,8],`StrokeWidth`,`num`,0],[14,`XUID`,`array`,null],[15,`charset`,`offset`,0],[16,`Encoding`,`offset`,0],[17,`CharStrings`,`offset`,0],[18,`Private`,[`offset`,`offset`],null],[[12,21],`PostScript`,`sid`,null],[[12,22],`BaseFontName`,`sid`,null],[[12,23],`BaseFontBlend`,`delta`,null],[[12,31],`CIDFontVersion`,`num`,0],[[12,32],`CIDFontRevision`,`num`,0],[[12,33],`CIDFontType`,`num`,0],[[12,34],`CIDCount`,`num`,8720],[[12,35],`UIDBase`,`num`,null],[[12,37],`FDSelect`,`offset`,null],[[12,36],`FDArray`,`offset`,null],[[12,38],`FontName`,`sid`,null]],bs=class e extends vs{static get tables(){return P(this,`tables`,this.createTables(ys))}constructor(t){super(e.tables,t),this.privateDict=null}},xs=[[6,`BlueValues`,`delta`,null],[7,`OtherBlues`,`delta`,null],[8,`FamilyBlues`,`delta`,null],[9,`FamilyOtherBlues`,`delta`,null],[[12,9],`BlueScale`,`num`,.039625],[[12,10],`BlueShift`,`num`,7],[[12,11],`BlueFuzz`,`num`,1],[10,`StdHW`,`num`,null],[11,`StdVW`,`num`,null],[[12,12],`StemSnapH`,`delta`,null],[[12,13],`StemSnapV`,`delta`,null],[[12,14],`ForceBold`,`num`,0],[[12,17],`LanguageGroup`,`num`,0],[[12,18],`ExpansionFactor`,`num`,.06],[[12,19],`initialRandomSeed`,`num`,0],[20,`defaultWidthX`,`num`,0],[21,`nominalWidthX`,`num`,0],[19,`Subrs`,`offset`,null]],Ss=class e extends vs{static get tables(){return P(this,`tables`,this.createTables(xs))}constructor(t){super(e.tables,t),this.subrsIndex=null}},Cs={ISO_ADOBE:0,EXPERT:1,EXPERT_SUBSET:2},ws=class{constructor(e,t,n,r){this.predefined=e,this.format=t,this.charset=n,this.raw=r}},Ts=class{constructor(e,t,n,r){this.predefined=e,this.format=t,this.encoding=n,this.raw=r}},Es=class{constructor(e,t){this.format=e,this.fdSelect=t}getFDIndex(e){return e<0||e>=this.fdSelect.length?-1:this.fdSelect[e]}},Ds=class{constructor(){this.offsets=Object.create(null)}isTracking(e){return e in this.offsets}track(e,t){if(e in this.offsets)throw new F(`Already tracking location of ${e}`);this.offsets[e]=t}offset(e){for(let t in this.offsets)this.offsets[t]+=e}setEntryLocation(e,t,n){if(!(e in this.offsets))throw new F(`Not tracking location of ${e}`);let r=n.data,i=this.offsets[e];for(let e=0,n=t.length;e<n;++e){let n=5*e+i,a=n+1,o=n+2,s=n+3,c=n+4;if(r[n]!==29||r[a]!==0||r[o]!==0||r[s]!==0||r[c]!==0)throw new F(`writing to an offset that is not empty`);let l=t[e];r[n]=29,r[a]=l>>24&255,r[o]=l>>16&255,r[s]=l>>8&255,r[c]=255&l}}},Os=class e{constructor(e){this.cff=e}compile(){let e=this.cff,t={data:[],length:0,add(e){try{this.data.push(...e)}catch{this.data=this.data.concat(e)}this.length=this.data.length}},n=this.compileHeader(e.header);t.add(n);let r=this.compileNameIndex(e.names);if(t.add(r),e.isCIDFont&&e.topDict.hasName(`FontMatrix`)){let t=e.topDict.getByName(`FontMatrix`);e.topDict.removeByName(`FontMatrix`);for(let n of e.fdArray){let e=t.slice(0);n.hasName(`FontMatrix`)&&(e=jn.transform(e,n.getByName(`FontMatrix`))),n.setByName(`FontMatrix`,e)}}e.topDict.getByName(`XUID`)?.length>16&&e.topDict.removeByName(`XUID`),e.topDict.setByName(`charset`,0);let i=this.compileTopDicts([e.topDict],t.length,e.isCIDFont);t.add(i.output);let a=i.trackers[0],o=this.compileStringIndex(e.strings.strings);t.add(o);let s=this.compileIndex(e.globalSubrIndex);if(t.add(s),e.encoding&&e.topDict.hasName(`Encoding`))if(e.encoding.predefined)a.setEntryLocation(`Encoding`,[e.encoding.format],t);else{let n=this.compileEncoding(e.encoding);a.setEntryLocation(`Encoding`,[t.length],t),t.add(n)}let c=this.compileCharset(e.charset,e.charStrings.count,e.strings,e.isCIDFont);a.setEntryLocation(`charset`,[t.length],t),t.add(c);let l=this.compileCharStrings(e.charStrings);if(a.setEntryLocation(`CharStrings`,[t.length],t),t.add(l),e.isCIDFont){a.setEntryLocation(`FDSelect`,[t.length],t);let n=this.compileFDSelect(e.fdSelect);t.add(n),i=this.compileTopDicts(e.fdArray,t.length,!0),a.setEntryLocation(`FDArray`,[t.length],t),t.add(i.output);let r=i.trackers;this.compilePrivateDicts(e.fdArray,r,t)}return this.compilePrivateDicts([e.topDict],[a],t),t.add([0]),t.data}encodeNumber(e){return Number.isInteger(e)?this.encodeInteger(e):this.encodeFloat(e)}static get EncodeFloatRegExp(){return P(this,`EncodeFloatRegExp`,/\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/)}encodeFloat(t){let n=t.toString(),r=e.EncodeFloatRegExp.exec(n);if(r){let e=parseFloat(`1e`+((r[2]?+r[2]:0)+r[1].length));n=(Math.round(t*e)/e).toString()}let i,a,o=``;for(i=0,a=n.length;i<a;++i){let e=n[i];o+=e===`e`?n[++i]===`-`?`c`:`b`:e===`.`?`a`:e===`-`?`e`:e}o+=1&o.length?`f`:`ff`;let s=[30];for(i=0,a=o.length;i<a;i+=2)s.push(parseInt(o.substring(i,i+2),16));return s}encodeInteger(e){let t;return t=e>=-107&&e<=107?[e+139]:e>=108&&e<=1131?[247+((e-=108)>>8),255&e]:e>=-1131&&e<=-108?[251+((e=-e-108)>>8),255&e]:e>=-32768&&e<=32767?[28,e>>8&255,255&e]:[29,e>>24&255,e>>16&255,e>>8&255,255&e],t}compileHeader(e){return[e.major,e.minor,4,e.offSize]}compileNameIndex(e){let t=new _s;for(let n of e){let e=Math.min(n.length,127),r=Array(e);for(let t=0;t<e;t++){let e=n[t];(e<`!`||e>`~`||e===`[`||e===`]`||e===`(`||e===`)`||e===`{`||e===`}`||e===`<`||e===`>`||e===`/`||e===`%`)&&(e=`_`),r[t]=e}r=r.join(``),r===``&&(r=`Bad_Font_Name`),t.add(En(r))}return this.compileIndex(t)}compileTopDicts(e,t,n){let r=[],i=new _s;for(let a of e){n&&(a.removeByName(`CIDFontVersion`),a.removeByName(`CIDFontRevision`),a.removeByName(`CIDFontType`),a.removeByName(`CIDCount`),a.removeByName(`UIDBase`));let e=new Ds,o=this.compileDict(a,e);r.push(e),i.add(o),e.offset(t)}return i=this.compileIndex(i,r),{trackers:r,output:i}}compilePrivateDicts(e,t,n){for(let r=0,i=e.length;r<i;++r){let i=e[r],a=i.privateDict;if(!a||!i.hasName(`Private`))throw new F(`There must be a private dictionary.`);let o=new Ds,s=this.compileDict(a,o),c=n.length;if(o.offset(c),s.length||(c=0),t[r].setEntryLocation(`Private`,[s.length,c],n),n.add(s),a.subrsIndex&&a.hasName(`Subrs`)){let e=this.compileIndex(a.subrsIndex);o.setEntryLocation(`Subrs`,[s.length],n),n.add(e)}}}compileDict(e,t){let n=[];for(let r of e.order){if(!(r in e.values))continue;let i=e.values[r],a=e.types[r];if(Array.isArray(a)||(a=[a]),Array.isArray(i)||(i=[i]),i.length!==0){for(let o=0,s=a.length;o<s;++o){let s=a[o],c=i[o];switch(s){case`num`:case`sid`:n.push(...this.encodeNumber(c));break;case`offset`:let a=e.keyToNameMap[r];t.isTracking(a)||t.track(a,n.length),n.push(29,0,0,0,0);break;case`array`:case`delta`:n.push(...this.encodeNumber(c));for(let e=1,t=i.length;e<t;++e)n.push(...this.encodeNumber(i[e]));break;default:throw new F(`Unknown data type of ${s}`)}}n.push(...e.opcodes[r])}}return n}compileStringIndex(e){let t=new _s;for(let n of e)t.add(En(n));return this.compileIndex(t)}compileCharStrings(e){let t=new _s;for(let n=0;n<e.count;n++){let r=e.get(n);r.length===0?t.add(new Uint8Array([139,14])):t.add(r)}return this.compileIndex(t)}compileCharset(e,t,n,r){let i,a=t-1;if(r){let e=a-1;i=new Uint8Array([2,0,1,e>>8&255,255&e])}else{i=new Uint8Array(1+2*a),i[0]=0;let t=0,r=e.charset.length,o=!1;for(let a=1;a<i.length;a+=2){let s=0;if(t<r){let r=e.charset[t++];s=n.getSID(r),s===-1&&(s=0,o||(o=!0,N(`Couldn't find ${r} in CFF strings`)))}i[a]=s>>8&255,i[a+1]=255&s}}return this.compileTypedArray(i)}compileEncoding(e){return this.compileTypedArray(e.raw)}compileFDSelect(e){let t=e.format,n,r;switch(t){case 0:for(n=new Uint8Array(1+e.fdSelect.length),n[0]=t,r=0;r<e.fdSelect.length;r++)n[r+1]=e.fdSelect[r];break;case 3:let i=e.fdSelect[0],a=[t,0,0,0,0,i];for(r=1;r<e.fdSelect.length;r++){let t=e.fdSelect[r];t!==i&&(a.push(r>>8&255,255&r,t),i=t)}let o=(a.length-3)/3;a[1]=o>>8&255,a[2]=255&o,a.push(r>>8&255,255&r),n=new Uint8Array(a)}return this.compileTypedArray(n)}compileTypedArray(e){return Array.from(e)}compileIndex(e,t=[]){let n=e.objects,r=n.length;if(r===0)return[0,0];let i=[r>>8&255,255&r],a,o,s=1;for(a=0;a<r;++a)s+=n[a].length;o=s<256?1:s<65536?2:s<16777216?3:4,i.push(o);let c=1;for(a=0;a<r+1;a++)o===1?i.push(255&c):o===2?i.push(c>>8&255,255&c):o===3?i.push(c>>16&255,c>>8&255,255&c):i.push(c>>>24&255,c>>16&255,c>>8&255,255&c),n[a]&&(c+=n[a].length);for(a=0;a<r;a++)t[a]&&t[a].offset(i.length),i.push(...n[a]);return i}},ks=sr(function(e){e[`Times-Roman`]=`Times-Roman`,e.Helvetica=`Helvetica`,e.Courier=`Courier`,e.Symbol=`Symbol`,e[`Times-Bold`]=`Times-Bold`,e[`Helvetica-Bold`]=`Helvetica-Bold`,e[`Courier-Bold`]=`Courier-Bold`,e.ZapfDingbats=`ZapfDingbats`,e[`Times-Italic`]=`Times-Italic`,e[`Helvetica-Oblique`]=`Helvetica-Oblique`,e[`Courier-Oblique`]=`Courier-Oblique`,e[`Times-BoldItalic`]=`Times-BoldItalic`,e[`Helvetica-BoldOblique`]=`Helvetica-BoldOblique`,e[`Courier-BoldOblique`]=`Courier-BoldOblique`,e.ArialNarrow=`Helvetica`,e[`ArialNarrow-Bold`]=`Helvetica-Bold`,e[`ArialNarrow-BoldItalic`]=`Helvetica-BoldOblique`,e[`ArialNarrow-Italic`]=`Helvetica-Oblique`,e.ArialBlack=`Helvetica`,e[`ArialBlack-Bold`]=`Helvetica-Bold`,e[`ArialBlack-BoldItalic`]=`Helvetica-BoldOblique`,e[`ArialBlack-Italic`]=`Helvetica-Oblique`,e[`Arial-Black`]=`Helvetica`,e[`Arial-Black-Bold`]=`Helvetica-Bold`,e[`Arial-Black-BoldItalic`]=`Helvetica-BoldOblique`,e[`Arial-Black-Italic`]=`Helvetica-Oblique`,e.Arial=`Helvetica`,e[`Arial-Bold`]=`Helvetica-Bold`,e[`Arial-BoldItalic`]=`Helvetica-BoldOblique`,e[`Arial-Italic`]=`Helvetica-Oblique`,e.ArialMT=`Helvetica`,e[`Arial-BoldItalicMT`]=`Helvetica-BoldOblique`,e[`Arial-BoldMT`]=`Helvetica-Bold`,e[`Arial-ItalicMT`]=`Helvetica-Oblique`,e[`Arial-BoldItalicMT-BoldItalic`]=`Helvetica-BoldOblique`,e[`Arial-BoldMT-Bold`]=`Helvetica-Bold`,e[`Arial-ItalicMT-Italic`]=`Helvetica-Oblique`,e.ArialUnicodeMS=`Helvetica`,e[`ArialUnicodeMS-Bold`]=`Helvetica-Bold`,e[`ArialUnicodeMS-BoldItalic`]=`Helvetica-BoldOblique`,e[`ArialUnicodeMS-Italic`]=`Helvetica-Oblique`,e[`Courier-BoldItalic`]=`Courier-BoldOblique`,e[`Courier-Italic`]=`Courier-Oblique`,e.CourierNew=`Courier`,e[`CourierNew-Bold`]=`Courier-Bold`,e[`CourierNew-BoldItalic`]=`Courier-BoldOblique`,e[`CourierNew-Italic`]=`Courier-Oblique`,e[`CourierNewPS-BoldItalicMT`]=`Courier-BoldOblique`,e[`CourierNewPS-BoldMT`]=`Courier-Bold`,e[`CourierNewPS-ItalicMT`]=`Courier-Oblique`,e.CourierNewPSMT=`Courier`,e[`Helvetica-BoldItalic`]=`Helvetica-BoldOblique`,e[`Helvetica-Italic`]=`Helvetica-Oblique`,e[`HelveticaLTStd-Bold`]=`Helvetica-Bold`,e[`Symbol-Bold`]=`Symbol`,e[`Symbol-BoldItalic`]=`Symbol`,e[`Symbol-Italic`]=`Symbol`,e.TimesNewRoman=`Times-Roman`,e[`TimesNewRoman-Bold`]=`Times-Bold`,e[`TimesNewRoman-BoldItalic`]=`Times-BoldItalic`,e[`TimesNewRoman-Italic`]=`Times-Italic`,e.TimesNewRomanPS=`Times-Roman`,e[`TimesNewRomanPS-Bold`]=`Times-Bold`,e[`TimesNewRomanPS-BoldItalic`]=`Times-BoldItalic`,e[`TimesNewRomanPS-BoldItalicMT`]=`Times-BoldItalic`,e[`TimesNewRomanPS-BoldMT`]=`Times-Bold`,e[`TimesNewRomanPS-Italic`]=`Times-Italic`,e[`TimesNewRomanPS-ItalicMT`]=`Times-Italic`,e.TimesNewRomanPSMT=`Times-Roman`,e[`TimesNewRomanPSMT-Bold`]=`Times-Bold`,e[`TimesNewRomanPSMT-BoldItalic`]=`Times-BoldItalic`,e[`TimesNewRomanPSMT-Italic`]=`Times-Italic`}),As=sr(function(e){e.Courier=`FoxitFixed.pfb`,e[`Courier-Bold`]=`FoxitFixedBold.pfb`,e[`Courier-BoldOblique`]=`FoxitFixedBoldItalic.pfb`,e[`Courier-Oblique`]=`FoxitFixedItalic.pfb`,e.Helvetica=`LiberationSans-Regular.ttf`,e[`Helvetica-Bold`]=`LiberationSans-Bold.ttf`,e[`Helvetica-BoldOblique`]=`LiberationSans-BoldItalic.ttf`,e[`Helvetica-Oblique`]=`LiberationSans-Italic.ttf`,e[`Times-Roman`]=`FoxitSerif.pfb`,e[`Times-Bold`]=`FoxitSerifBold.pfb`,e[`Times-BoldItalic`]=`FoxitSerifBoldItalic.pfb`,e[`Times-Italic`]=`FoxitSerifItalic.pfb`,e.Symbol=`FoxitSymbol.pfb`,e.ZapfDingbats=`FoxitDingbats.pfb`,e[`LiberationSans-Regular`]=`LiberationSans-Regular.ttf`,e[`LiberationSans-Bold`]=`LiberationSans-Bold.ttf`,e[`LiberationSans-Italic`]=`LiberationSans-Italic.ttf`,e[`LiberationSans-BoldItalic`]=`LiberationSans-BoldItalic.ttf`}),js=sr(function(e){e.Calibri=`Helvetica`,e[`Calibri-Bold`]=`Helvetica-Bold`,e[`Calibri-BoldItalic`]=`Helvetica-BoldOblique`,e[`Calibri-Italic`]=`Helvetica-Oblique`,e.CenturyGothic=`Helvetica`,e[`CenturyGothic-Bold`]=`Helvetica-Bold`,e[`CenturyGothic-BoldItalic`]=`Helvetica-BoldOblique`,e[`CenturyGothic-Italic`]=`Helvetica-Oblique`,e.ComicSansMS=`Comic Sans MS`,e[`ComicSansMS-Bold`]=`Comic Sans MS-Bold`,e[`ComicSansMS-BoldItalic`]=`Comic Sans MS-BoldItalic`,e[`ComicSansMS-Italic`]=`Comic Sans MS-Italic`,e.GillSansMT=`Helvetica`,e[`GillSansMT-Bold`]=`Helvetica-Bold`,e[`GillSansMT-BoldItalic`]=`Helvetica-BoldOblique`,e[`GillSansMT-Italic`]=`Helvetica-Oblique`,e.Impact=`Helvetica`,e[`ItcSymbol-Bold`]=`Helvetica-Bold`,e[`ItcSymbol-BoldItalic`]=`Helvetica-BoldOblique`,e[`ItcSymbol-Book`]=`Helvetica`,e[`ItcSymbol-BookItalic`]=`Helvetica-Oblique`,e[`ItcSymbol-Medium`]=`Helvetica`,e[`ItcSymbol-MediumItalic`]=`Helvetica-Oblique`,e.LucidaConsole=`Courier`,e[`LucidaConsole-Bold`]=`Courier-Bold`,e[`LucidaConsole-BoldItalic`]=`Courier-BoldOblique`,e[`LucidaConsole-Italic`]=`Courier-Oblique`,e[`LucidaSans-Demi`]=`Helvetica-Bold`,e[`MS-Gothic`]=`MS Gothic`,e[`MS-Gothic-Bold`]=`MS Gothic-Bold`,e[`MS-Gothic-BoldItalic`]=`MS Gothic-BoldItalic`,e[`MS-Gothic-Italic`]=`MS Gothic-Italic`,e[`MS-Mincho`]=`MS Mincho`,e[`MS-Mincho-Bold`]=`MS Mincho-Bold`,e[`MS-Mincho-BoldItalic`]=`MS Mincho-BoldItalic`,e[`MS-Mincho-Italic`]=`MS Mincho-Italic`,e[`MS-PGothic`]=`MS PGothic`,e[`MS-PGothic-Bold`]=`MS PGothic-Bold`,e[`MS-PGothic-BoldItalic`]=`MS PGothic-BoldItalic`,e[`MS-PGothic-Italic`]=`MS PGothic-Italic`,e[`MS-PMincho`]=`MS PMincho`,e[`MS-PMincho-Bold`]=`MS PMincho-Bold`,e[`MS-PMincho-BoldItalic`]=`MS PMincho-BoldItalic`,e[`MS-PMincho-Italic`]=`MS PMincho-Italic`,e.NuptialScript=`Times-Italic`,e.SegoeUISymbol=`Helvetica`}),Ms=sr(function(e){e[`Adobe Jenson`]=!0,e[`Adobe Text`]=!0,e.Albertus=!0,e.Aldus=!0,e.Alexandria=!0,e.Algerian=!0,e[`American Typewriter`]=!0,e.Antiqua=!0,e.Apex=!0,e.Arno=!0,e.Aster=!0,e.Aurora=!0,e.Baskerville=!0,e.Bell=!0,e.Bembo=!0,e[`Bembo Schoolbook`]=!0,e.Benguiat=!0,e[`Berkeley Old Style`]=!0,e[`Bernhard Modern`]=!0,e[`Berthold City`]=!0,e.Bodoni=!0,e[`Bauer Bodoni`]=!0,e[`Book Antiqua`]=!0,e.Bookman=!0,e[`Bordeaux Roman`]=!0,e[`Californian FB`]=!0,e.Calisto=!0,e.Calvert=!0,e.Capitals=!0,e.Cambria=!0,e.Cartier=!0,e.Caslon=!0,e.Catull=!0,e.Centaur=!0,e[`Century Old Style`]=!0,e[`Century Schoolbook`]=!0,e.Chaparral=!0,e[`Charis SIL`]=!0,e.Cheltenham=!0,e[`Cholla Slab`]=!0,e.Clarendon=!0,e.Clearface=!0,e.Cochin=!0,e.Colonna=!0,e[`Computer Modern`]=!0,e[`Concrete Roman`]=!0,e.Constantia=!0,e[`Cooper Black`]=!0,e.Corona=!0,e.Ecotype=!0,e.Egyptienne=!0,e.Elephant=!0,e.Excelsior=!0,e.Fairfield=!0,e[`FF Scala`]=!0,e.Folkard=!0,e.Footlight=!0,e.FreeSerif=!0,e[`Friz Quadrata`]=!0,e.Garamond=!0,e.Gentium=!0,e.Georgia=!0,e.Gloucester=!0,e[`Goudy Old Style`]=!0,e[`Goudy Schoolbook`]=!0,e[`Goudy Pro Font`]=!0,e.Granjon=!0,e[`Guardian Egyptian`]=!0,e.Heather=!0,e.Hercules=!0,e[`High Tower Text`]=!0,e.Hiroshige=!0,e[`Hoefler Text`]=!0,e[`Humana Serif`]=!0,e.Imprint=!0,e[`Ionic No. 5`]=!0,e.Janson=!0,e.Joanna=!0,e.Korinna=!0,e.Lexicon=!0,e.LiberationSerif=!0,e[`Liberation Serif`]=!0,e[`Linux Libertine`]=!0,e.Literaturnaya=!0,e.Lucida=!0,e[`Lucida Bright`]=!0,e.Melior=!0,e.Memphis=!0,e.Miller=!0,e.Minion=!0,e.Modern=!0,e[`Mona Lisa`]=!0,e[`Mrs Eaves`]=!0,e[`MS Serif`]=!0,e[`Museo Slab`]=!0,e[`New York`]=!0,e[`Nimbus Roman`]=!0,e[`NPS Rawlinson Roadway`]=!0,e.NuptialScript=!0,e.Palatino=!0,e.Perpetua=!0,e.Plantin=!0,e[`Plantin Schoolbook`]=!0,e.Playbill=!0,e[`Poor Richard`]=!0,e[`Rawlinson Roadway`]=!0,e.Renault=!0,e.Requiem=!0,e.Rockwell=!0,e.Roman=!0,e[`Rotis Serif`]=!0,e.Sabon=!0,e.Scala=!0,e.Seagull=!0,e.Sistina=!0,e.Souvenir=!0,e.STIX=!0,e[`Stone Informal`]=!0,e[`Stone Serif`]=!0,e.Sylfaen=!0,e.Times=!0,e.Trajan=!0,e.Trinité=!0,e[`Trump Mediaeval`]=!0,e.Utopia=!0,e[`Vale Type`]=!0,e[`Bitstream Vera`]=!0,e[`Vera Serif`]=!0,e.Versailles=!0,e.Wanted=!0,e.Weiss=!0,e[`Wide Latin`]=!0,e.Windsor=!0,e.XITS=!0}),Ns=sr(function(e){e.Dingbats=!0,e.Symbol=!0,e.ZapfDingbats=!0,e.Wingdings=!0,e[`Wingdings-Bold`]=!0,e[`Wingdings-Regular`]=!0}),Ps=sr(function(e){e[2]=10,e[3]=32,e[4]=33,e[5]=34,e[6]=35,e[7]=36,e[8]=37,e[9]=38,e[10]=39,e[11]=40,e[12]=41,e[13]=42,e[14]=43,e[15]=44,e[16]=45,e[17]=46,e[18]=47,e[19]=48,e[20]=49,e[21]=50,e[22]=51,e[23]=52,e[24]=53,e[25]=54,e[26]=55,e[27]=56,e[28]=57,e[29]=58,e[30]=894,e[31]=60,e[32]=61,e[33]=62,e[34]=63,e[35]=64,e[36]=65,e[37]=66,e[38]=67,e[39]=68,e[40]=69,e[41]=70,e[42]=71,e[43]=72,e[44]=73,e[45]=74,e[46]=75,e[47]=76,e[48]=77,e[49]=78,e[50]=79,e[51]=80,e[52]=81,e[53]=82,e[54]=83,e[55]=84,e[56]=85,e[57]=86,e[58]=87,e[59]=88,e[60]=89,e[61]=90,e[62]=91,e[63]=92,e[64]=93,e[65]=94,e[66]=95,e[67]=96,e[68]=97,e[69]=98,e[70]=99,e[71]=100,e[72]=101,e[73]=102,e[74]=103,e[75]=104,e[76]=105,e[77]=106,e[78]=107,e[79]=108,e[80]=109,e[81]=110,e[82]=111,e[83]=112,e[84]=113,e[85]=114,e[86]=115,e[87]=116,e[88]=117,e[89]=118,e[90]=119,e[91]=120,e[92]=121,e[93]=122,e[94]=123,e[95]=124,e[96]=125,e[97]=126,e[98]=196,e[99]=197,e[100]=199,e[101]=201,e[102]=209,e[103]=214,e[104]=220,e[105]=225,e[106]=224,e[107]=226,e[108]=228,e[109]=227,e[110]=229,e[111]=231,e[112]=233,e[113]=232,e[114]=234,e[115]=235,e[116]=237,e[117]=236,e[118]=238,e[119]=239,e[120]=241,e[121]=243,e[122]=242,e[123]=244,e[124]=246,e[125]=245,e[126]=250,e[127]=249,e[128]=251,e[129]=252,e[130]=8224,e[131]=176,e[132]=162,e[133]=163,e[134]=167,e[135]=8226,e[136]=182,e[137]=223,e[138]=174,e[139]=169,e[140]=8482,e[141]=180,e[142]=168,e[143]=8800,e[144]=198,e[145]=216,e[146]=8734,e[147]=177,e[148]=8804,e[149]=8805,e[150]=165,e[151]=181,e[152]=8706,e[153]=8721,e[154]=8719,e[156]=8747,e[157]=170,e[158]=186,e[159]=8486,e[160]=230,e[161]=248,e[162]=191,e[163]=161,e[164]=172,e[165]=8730,e[166]=402,e[167]=8776,e[168]=8710,e[169]=171,e[170]=187,e[171]=8230,e[179]=8220,e[180]=8221,e[181]=8216,e[182]=8217,e[200]=193,e[203]=205,e[207]=211,e[210]=218,e[223]=711,e[224]=321,e[225]=322,e[226]=352,e[227]=353,e[228]=381,e[229]=382,e[233]=221,e[234]=253,e[252]=263,e[253]=268,e[254]=269,e[258]=258,e[260]=260,e[261]=261,e[265]=280,e[266]=281,e[267]=282,e[268]=283,e[269]=313,e[275]=323,e[276]=324,e[278]=328,e[283]=344,e[284]=345,e[285]=346,e[286]=347,e[292]=367,e[295]=377,e[296]=378,e[298]=380,e[305]=963,e[306]=964,e[307]=966,e[308]=8215,e[309]=8252,e[310]=8319,e[311]=8359,e[312]=8592,e[313]=8593,e[337]=9552,e[493]=1039,e[494]=1040,e[570]=1040,e[571]=1041,e[572]=1042,e[573]=1043,e[574]=1044,e[575]=1045,e[576]=1046,e[577]=1047,e[578]=1048,e[579]=1049,e[580]=1050,e[581]=1051,e[582]=1052,e[583]=1053,e[584]=1054,e[585]=1055,e[586]=1056,e[587]=1057,e[588]=1058,e[589]=1059,e[590]=1060,e[591]=1061,e[592]=1062,e[593]=1063,e[594]=1064,e[595]=1065,e[596]=1066,e[597]=1067,e[598]=1068,e[599]=1069,e[600]=1070,e[672]=1488,e[673]=1489,e[674]=1490,e[675]=1491,e[676]=1492,e[677]=1493,e[678]=1494,e[679]=1495,e[680]=1496,e[681]=1497,e[682]=1498,e[683]=1499,e[684]=1500,e[685]=1501,e[686]=1502,e[687]=1503,e[688]=1504,e[689]=1505,e[690]=1506,e[691]=1507,e[692]=1508,e[693]=1509,e[694]=1510,e[695]=1511,e[696]=1512,e[697]=1513,e[698]=1514,e[705]=1524,e[706]=8362,e[710]=64288,e[711]=64298,e[759]=1617,e[761]=1776,e[763]=1778,e[775]=1652,e[777]=1764,e[778]=1780,e[779]=1781,e[780]=1782,e[782]=771,e[783]=64726,e[786]=8363,e[788]=8532,e[790]=768,e[791]=769,e[792]=768,e[795]=803,e[797]=64336,e[798]=64337,e[799]=64342,e[800]=64343,e[801]=64344,e[802]=64345,e[803]=64362,e[804]=64363,e[805]=64364,e[2424]=7821,e[2425]=7822,e[2426]=7823,e[2427]=7824,e[2428]=7825,e[2429]=7826,e[2430]=7827,e[2433]=7682,e[2678]=8045,e[2679]=8046,e[2830]=1552,e[2838]=686,e[2840]=751,e[2842]=753,e[2843]=754,e[2844]=755,e[2846]=757,e[2856]=767,e[2857]=848,e[2858]=849,e[2862]=853,e[2863]=854,e[2864]=855,e[2865]=861,e[2866]=862,e[2906]=7460,e[2908]=7462,e[2909]=7463,e[2910]=7464,e[2912]=7466,e[2913]=7467,e[2914]=7468,e[2916]=7470,e[2917]=7471,e[2918]=7472,e[2920]=7474,e[2921]=7475,e[2922]=7476,e[2924]=7478,e[2925]=7479,e[2926]=7480,e[2928]=7482,e[2929]=7483,e[2930]=7484,e[2932]=7486,e[2933]=7487,e[2934]=7488,e[2936]=7490,e[2937]=7491,e[2938]=7492,e[2940]=7494,e[2941]=7495,e[2942]=7496,e[2944]=7498,e[2946]=7500,e[2948]=7502,e[2950]=7504,e[2951]=7505,e[2952]=7506,e[2954]=7508,e[2955]=7509,e[2956]=7510,e[2958]=7512,e[2959]=7513,e[2960]=7514,e[2962]=7516,e[2963]=7517,e[2964]=7518,e[2966]=7520,e[2967]=7521,e[2968]=7522,e[2970]=7524,e[2971]=7525,e[2972]=7526,e[2974]=7528,e[2975]=7529,e[2976]=7530,e[2978]=1537,e[2979]=1538,e[2980]=1539,e[2982]=1549,e[2983]=1551,e[2984]=1552,e[2986]=1554,e[2987]=1555,e[2988]=1556,e[2990]=1623,e[2991]=1624,e[2995]=1775,e[2999]=1791,e[3002]=64290,e[3003]=64291,e[3004]=64292,e[3006]=64294,e[3007]=64295,e[3008]=64296,e[3011]=1900,e[3014]=8223,e[3015]=8244,e[3017]=7532,e[3018]=7533,e[3019]=7534,e[3075]=7590,e[3076]=7591,e[3079]=7594,e[3080]=7595,e[3083]=7598,e[3084]=7599,e[3087]=7602,e[3088]=7603,e[3091]=7606,e[3092]=7607,e[3095]=7610,e[3096]=7611,e[3099]=7614,e[3100]=7615,e[3103]=7618,e[3104]=7619,e[3107]=8337,e[3108]=8338,e[3116]=1884,e[3119]=1885,e[3120]=1885,e[3123]=1886,e[3124]=1886,e[3127]=1887,e[3128]=1887,e[3131]=1888,e[3132]=1888,e[3135]=1889,e[3136]=1889,e[3139]=1890,e[3140]=1890,e[3143]=1891,e[3144]=1891,e[3147]=1892,e[3148]=1892,e[3153]=580,e[3154]=581,e[3157]=584,e[3158]=585,e[3161]=588,e[3162]=589,e[3165]=891,e[3166]=892,e[3169]=1274,e[3170]=1275,e[3173]=1278,e[3174]=1279,e[3181]=7622,e[3182]=7623,e[3282]=11799,e[3316]=578,e[3379]=42785,e[3393]=1159,e[3416]=8377}),Fs=sr(function(e){e[227]=322,e[264]=261,e[291]=346}),Is=sr(function(e){e[1]=32,e[4]=65,e[5]=192,e[6]=193,e[9]=196,e[17]=66,e[18]=67,e[21]=268,e[24]=68,e[28]=69,e[29]=200,e[30]=201,e[32]=282,e[38]=70,e[39]=71,e[44]=72,e[47]=73,e[48]=204,e[49]=205,e[58]=74,e[60]=75,e[62]=76,e[68]=77,e[69]=78,e[75]=79,e[76]=210,e[80]=214,e[87]=80,e[89]=81,e[90]=82,e[92]=344,e[94]=83,e[97]=352,e[100]=84,e[104]=85,e[109]=220,e[115]=86,e[116]=87,e[121]=88,e[122]=89,e[124]=221,e[127]=90,e[129]=381,e[258]=97,e[259]=224,e[260]=225,e[263]=228,e[268]=261,e[271]=98,e[272]=99,e[273]=263,e[275]=269,e[282]=100,e[286]=101,e[287]=232,e[288]=233,e[290]=283,e[295]=281,e[296]=102,e[336]=103,e[346]=104,e[349]=105,e[350]=236,e[351]=237,e[361]=106,e[364]=107,e[367]=108,e[371]=322,e[373]=109,e[374]=110,e[381]=111,e[382]=242,e[383]=243,e[386]=246,e[393]=112,e[395]=113,e[396]=114,e[398]=345,e[400]=115,e[401]=347,e[403]=353,e[410]=116,e[437]=117,e[442]=252,e[448]=118,e[449]=119,e[454]=120,e[455]=121,e[457]=253,e[460]=122,e[462]=382,e[463]=380,e[853]=44,e[855]=58,e[856]=46,e[876]=47,e[878]=45,e[882]=45,e[894]=40,e[895]=41,e[896]=91,e[897]=93,e[923]=64,e[940]=163,e[1004]=48,e[1005]=49,e[1006]=50,e[1007]=51,e[1008]=52,e[1009]=53,e[1010]=54,e[1011]=55,e[1012]=56,e[1013]=57,e[1081]=37,e[1085]=43,e[1086]=45});function Ls(e){let t=is(e);return ks()[t]}function Rs(e){let t=is(e);return!!(ks()[t]||js()[t]||Ms()[t]||Ns()[t])}var zs=class{constructor(e=[]){this._map=e}get length(){return this._map.length}forEach(e){for(let t in this._map)e(t,this._map[t].codePointAt(0))}has(e){return this._map[e]!==void 0}get(e){return this._map[e]}charCodeOf(e){let t=this._map;if(t.length<=65536)return t.indexOf(e);for(let n in t)if(t[n]===e)return 0|n;return-1}amend(e){for(let t in e)this._map[t]=e[t]}},Bs=class{constructor(e,t){this.firstChar=e,this.lastChar=t}get length(){return this.lastChar+1-this.firstChar}forEach(e){for(let t=this.firstChar,n=this.lastChar;t<=n;t++)e(t,t)}has(e){return this.firstChar<=e&&e<=this.lastChar}get(e){if(this.firstChar<=e&&e<=this.lastChar)return String.fromCharCode(e)}charCodeOf(e){return Number.isInteger(e)&&e>=this.firstChar&&e<=this.lastChar?e:-1}amend(e){gn(`Should not call amend()`)}},Vs=class{constructor(e,t){this.properties=t,this.cff=new ps(e,t,Xo).parse(),this.cff.duplicateFirstGlyph();let n=new Os(this.cff);this.seacs=this.cff.seacs;try{this.data=n.compile()}catch{N(`Failed to compile font `+t.loadedName),this.data=e}this._createBuiltInEncoding()}get numGlyphs(){return this.cff.charStrings.count}getCharset(){return this.cff.charset.charset}getGlyphMapping(){let e=this.cff,t=this.properties,{cidToGidMap:n,cMap:r}=t,i=e.charset.charset,a,o;if(t.composite){let t,s;if(n?.length>0){t=Object.create(null);for(let e=0,r=n.length;e<r;e++){let r=n[e];r!==void 0&&(t[r]=e)}}if(a=Object.create(null),e.isCIDFont)for(o=0;o<i.length;o++){let e=i[o];s=r.charCodeOf(e),t?.[s]!==void 0&&(s=t[s]),a[s]=o}else for(o=0;o<e.charStrings.count;o++)s=r.charCodeOf(o),a[s]=o;return a}let s=e.encoding?e.encoding.encoding:null;return t.isInternalFont&&(s=t.defaultEncoding),a=rs(t,s,i),a}hasGlyphId(e){return this.cff.hasGlyphId(e)}_createBuiltInEncoding(){let{charset:e,encoding:t}=this.cff;if(!e||!t)return;let n=e.charset,r=t.encoding,i=[];for(let e in r){let t=r[e];if(t>=0){let r=n[t];r&&(i[e]=r)}}i.length>0&&(this.properties.builtInEncoding=i)}};function Hs(e,t){return yr(e,t)/16384}function Us(e){let t=e.length,n=32768;return t<1240?n=107:t<33900&&(n=1131),n}function Ws(e,t,n){let r=br(e,t+2)===1?xr(e,t+8):xr(e,t+16),i=br(e,t+r),a,o,s;if(i===4){br(e,t+r+2);let n=br(e,t+r+6)>>1;for(o=t+r+14,a=[],s=0;s<n;s++,o+=2)a[s]={end:br(e,o)};for(o+=2,s=0;s<n;s++,o+=2)a[s].start=br(e,o);for(s=0;s<n;s++,o+=2)a[s].idDelta=br(e,o);for(s=0;s<n;s++,o+=2){let t=br(e,o);if(t!==0){a[s].ids=[];for(let n=0,r=a[s].end-a[s].start+1;n<r;n++)a[s].ids[n]=br(e,o+t),t+=2}}return a}if(i===12){let n=xr(e,t+r+12);for(o=t+r+16,a=[],s=0;s<n;s++)t=xr(e,o),a.push({start:t,end:xr(e,o+4),idDelta:xr(e,o+8)-t}),o+=12;return a}throw new F(`unsupported cmap: ${i}`)}function Gs(e,t,n,r){let i=new ps(new gi(e,t,n-t),{},r).parse();return{glyphs:i.charStrings.objects,subrs:i.topDict.privateDict?.subrsIndex?.objects,gsubrs:i.globalSubrIndex?.objects,isCFFCIDFont:i.isCIDFont,fdSelect:i.fdSelect,fdArray:i.fdArray}}function Ks(e,t){let n=t.codePointAt(0),r=0,i=0,a=e.length-1;for(;i<a;){let t=i+a+1>>1;n<e[t].start?a=t-1:i=t}return e[i].start<=n&&n<=e[i].end&&(r=e[i].idDelta+(e[i].ids?e[i].ids[n-e[i].start]:n)&65535),{charCode:n,glyphId:r}}function qs(e,t,n){function r(e,n){l&&t.add(`L`,l),l=[e,n],t.add(`M`,[e,n])}function i(e,n){t.add(`L`,[e,n])}function a(e,n,r,i){t.add(`Q`,[e,n,r,i])}let o=0,s=yr(e,o),c,l=null,u=0,d=0;if(o+=10,s<0)do{c=br(e,o);let r=br(e,o+2),i,a;o+=4,1&c?(2&c?(i=yr(e,o),a=yr(e,o+2)):(i=br(e,o),a=br(e,o+2)),o+=4):2&c?(i=vr(e,o++),a=vr(e,o++)):(i=e[o++],a=e[o++]),2&c?(u=i,d=a):(u=0,d=0);let s=1,l=1,f=0,p=0;8&c?(s=l=Hs(e,o),o+=2):64&c?(s=Hs(e,o),l=Hs(e,o+2),o+=4):128&c&&(s=Hs(e,o),f=Hs(e,o+2),p=Hs(e,o+4),l=Hs(e,o+6),o+=8);let m=n.glyphs[r];m&&(t.save(),t.transform([s,f,p,l,u,d]),qs(m,t,n),t.restore())}while(32&c);else{let t=[],n,l;for(n=0;n<s;n++)t.push(br(e,o)),o+=2;o+=2+br(e,o);let f=t.at(-1)+1,p=[];for(;p.length<f;){c=e[o++];let t=1;for(8&c&&(t+=e[o++]);t-- >0;)p.push({flags:c})}for(n=0;n<f;n++){switch(18&p[n].flags){case 0:u+=yr(e,o),o+=2;break;case 2:u-=e[o++];break;case 18:u+=e[o++]}p[n].x=u}for(n=0;n<f;n++){switch(36&p[n].flags){case 0:d+=yr(e,o),o+=2;break;case 4:d-=e[o++];break;case 36:d+=e[o++]}p[n].y=d}let m=0;for(o=0;o<s;o++){let e=t[o],s=p.slice(m,e+1);if(1&s[0].flags)s.push(s[0]);else if(1&s.at(-1).flags)s.unshift(s.at(-1));else{let e={flags:1,x:(s[0].x+s.at(-1).x)/2,y:(s[0].y+s.at(-1).y)/2};s.unshift(e),s.push(e)}for(r(s[0].x,s[0].y),n=1,l=s.length;n<l;n++)1&s[n].flags?i(s[n].x,s[n].y):1&s[n+1].flags?(a(s[n].x,s[n].y,s[n+1].x,s[n+1].y),n++):a(s[n].x,s[n].y,(s[n].x+s[n+1].x)/2,(s[n].y+s[n+1].y)/2);m=e+1}}}function Js(e,t,n,r){function i(e,n){d&&t.add(`L`,d),d=[e,n],t.add(`M`,[e,n])}function a(e,n){t.add(`L`,[e,n])}function o(e,n,r,i,a,o){t.add(`C`,[e,n,r,i,a,o])}let s=[],c=0,l=0,u=0,d=null;(function e(d){let f=0;for(;f<d.length;){let p,m,h,g,_,v,y,b,x,S=!1,C=d[f++];switch(C){case 1:case 3:case 18:case 23:u+=s.length>>1,S=!0;break;case 4:l+=s.pop(),i(c,l),S=!0;break;case 5:for(;s.length>0;)c+=s.shift(),l+=s.shift(),a(c,l);break;case 6:for(;s.length>0&&(c+=s.shift(),a(c,l),s.length!==0);)l+=s.shift(),a(c,l);break;case 7:for(;s.length>0&&(l+=s.shift(),a(c,l),s.length!==0);)c+=s.shift(),a(c,l);break;case 8:for(;s.length>0;)p=c+s.shift(),h=l+s.shift(),m=p+s.shift(),g=h+s.shift(),c=m+s.shift(),l=g+s.shift(),o(p,h,m,g,c,l);break;case 10:if(b=s.pop(),x=null,n.isCFFCIDFont){let e=n.fdSelect.getFDIndex(r);if(e>=0&&e<n.fdArray.length){let t=n.fdArray[e],r;t.privateDict?.subrsIndex&&(r=t.privateDict.subrsIndex.objects),r&&(b+=Us(r),x=r[b])}else N(`Invalid fd index for glyph index.`)}else x=n.subrs[b+n.subrsBias];x&&e(x);break;case 11:return;case 12:switch(C=d[f++],C){case 34:p=c+s.shift(),m=p+s.shift(),_=l+s.shift(),c=m+s.shift(),o(p,l,m,_,c,_),p=c+s.shift(),m=p+s.shift(),c=m+s.shift(),o(p,_,m,l,c,l);break;case 35:p=c+s.shift(),h=l+s.shift(),m=p+s.shift(),g=h+s.shift(),c=m+s.shift(),l=g+s.shift(),o(p,h,m,g,c,l),p=c+s.shift(),h=l+s.shift(),m=p+s.shift(),g=h+s.shift(),c=m+s.shift(),l=g+s.shift(),o(p,h,m,g,c,l),s.pop();break;case 36:p=c+s.shift(),_=l+s.shift(),m=p+s.shift(),v=_+s.shift(),c=m+s.shift(),o(p,_,m,v,c,v),p=c+s.shift(),m=p+s.shift(),y=v+s.shift(),c=m+s.shift(),o(p,v,m,y,c,l);break;case 37:let e=c,t=l;p=c+s.shift(),h=l+s.shift(),m=p+s.shift(),g=h+s.shift(),c=m+s.shift(),l=g+s.shift(),o(p,h,m,g,c,l),p=c+s.shift(),h=l+s.shift(),m=p+s.shift(),g=h+s.shift(),c=m,l=g,Math.abs(c-e)>Math.abs(l-t)?c+=s.shift():l+=s.shift(),o(p,h,m,g,c,l);break;default:throw new F(`unknown operator: 12 ${C}`)}break;case 14:if(s.length>=4){let e=s.pop(),r=s.pop();l=s.pop(),c=s.pop(),t.save(),t.translate(c,l);let i=Ks(n.cmap,String.fromCharCode(n.glyphNameMap[Lo[e]]));Js(n.glyphs[i.glyphId],t,n,i.glyphId),t.restore(),i=Ks(n.cmap,String.fromCharCode(n.glyphNameMap[Lo[r]])),Js(n.glyphs[i.glyphId],t,n,i.glyphId)}return;case 19:case 20:u+=s.length>>1,f+=u+7>>3,S=!0;break;case 21:l+=s.pop(),c+=s.pop(),i(c,l),S=!0;break;case 22:c+=s.pop(),i(c,l),S=!0;break;case 24:for(;s.length>2;)p=c+s.shift(),h=l+s.shift(),m=p+s.shift(),g=h+s.shift(),c=m+s.shift(),l=g+s.shift(),o(p,h,m,g,c,l);c+=s.shift(),l+=s.shift(),a(c,l);break;case 25:for(;s.length>6;)c+=s.shift(),l+=s.shift(),a(c,l);p=c+s.shift(),h=l+s.shift(),m=p+s.shift(),g=h+s.shift(),c=m+s.shift(),l=g+s.shift(),o(p,h,m,g,c,l);break;case 26:for(s.length%2&&(c+=s.shift());s.length>0;)p=c,h=l+s.shift(),m=p+s.shift(),g=h+s.shift(),c=m,l=g+s.shift(),o(p,h,m,g,c,l);break;case 27:for(s.length%2&&(l+=s.shift());s.length>0;)p=c+s.shift(),h=l,m=p+s.shift(),g=h+s.shift(),c=m+s.shift(),l=g,o(p,h,m,g,c,l);break;case 28:s.push(yr(d,f)),f+=2;break;case 29:b=s.pop()+n.gsubrsBias,x=n.gsubrs[b],x&&e(x);break;case 30:for(;s.length>0&&(p=c,h=l+s.shift(),m=p+s.shift(),g=h+s.shift(),c=m+s.shift(),l=g+(s.length===1?s.shift():0),o(p,h,m,g,c,l),s.length!==0);)p=c+s.shift(),h=l,m=p+s.shift(),g=h+s.shift(),l=g+s.shift(),c=m+(s.length===1?s.shift():0),o(p,h,m,g,c,l);break;case 31:for(;s.length>0&&(p=c+s.shift(),h=l,m=p+s.shift(),g=h+s.shift(),l=g+s.shift(),c=m+(s.length===1?s.shift():0),o(p,h,m,g,c,l),s.length!==0);)p=c,h=l+s.shift(),m=p+s.shift(),g=h+s.shift(),c=m+s.shift(),l=g+(s.length===1?s.shift():0),o(p,h,m,g,c,l);break;default:if(C<32)throw new F(`unknown operator: ${C}`);C<247?s.push(C-139):C<251?s.push(256*(C-247)+d[f++]+108):C<255?s.push(256*-(C-251)-d[f++]-108):(s.push((d[f]<<24|d[f+1]<<16|d[f+2]<<8|d[f+3])/65536),f+=4)}S&&(s.length=0)}})(e)}var Ys=class{cmds=[];transformStack=[];currentTransform=[1,0,0,1,0,0];add(e,t){if(t){let{currentTransform:n}=this;for(let e=0,r=t.length;e<r;e+=2)jn.applyTransform(t,n,e);this.cmds.push(`${e}${t.join(` `)}`)}else this.cmds.push(e)}transform(e){this.currentTransform=jn.transform(this.currentTransform,e)}translate(e,t){this.transform([1,0,0,1,e,t])}save(){this.transformStack.push(this.currentTransform.slice())}restore(){this.currentTransform=this.transformStack.pop()||[1,0,0,1,0,0]}getSVG(){return this.cmds.join(``)}},Xs=class{constructor(e){this.fontMatrix=e,this.compiledGlyphs=Object.create(null),this.compiledCharCodeToGlyphId=Object.create(null)}getPathJs(e){let{charCode:t,glyphId:n}=Ks(this.cmap,e),r,i=this.compiledGlyphs[n];if(i===void 0){try{i=this.compileGlyph(this.glyphs[n],n)}catch(e){i=``,r=e}this.compiledGlyphs[n]=i}if(this.compiledCharCodeToGlyphId[t]??=n,r)throw r;return i}compileGlyph(e,t){if(!e?.length||e[0]===14)return``;let r=this.fontMatrix;if(this.isCFFCIDFont){let e=this.fdSelect.getFDIndex(t);e>=0&&e<this.fdArray.length?r=this.fdArray[e].getByName(`FontMatrix`)||n:N(`Invalid fd index for glyph index.`)}_n(Cr(r,6),`Expected a valid fontMatrix.`);let i=new Ys;return i.transform(r.slice()),this.compileGlyphImpl(e,i,t),i.add(`Z`),i.getSVG()}compileGlyphImpl(){gn(`Children classes should implement this.`)}hasBuiltPath(e){let{charCode:t,glyphId:n}=Ks(this.cmap,e);return this.compiledGlyphs[n]!==void 0&&this.compiledCharCodeToGlyphId[t]!==void 0}},Zs=class extends Xs{constructor(e,t,n){super(n||[488e-6,0,0,488e-6,0,0]),this.glyphs=e,this.cmap=t}compileGlyphImpl(e,t){qs(e,t,this)}},Qs=class extends Xs{constructor(e,t,n){super(n||[.001,0,0,.001,0,0]),this.glyphs=e.glyphs,this.gsubrs=e.gsubrs||[],this.subrs=e.subrs||[],this.cmap=t,this.glyphNameMap=Ho(),this.gsubrsBias=Us(this.gsubrs),this.subrsBias=Us(this.subrs),this.isCFFCIDFont=e.isCFFCIDFont,this.fdSelect=e.fdSelect,this.fdArray=e.fdArray}compileGlyphImpl(e,t,n){Js(e,t,this,n)}},$s=class{static create(e,t){let n=new Uint8Array(e.data),r,i,a,o,s,c,l=br(n,4);for(let e=0,u=12;e<l;e++,u+=16){let e=Tn(n.subarray(u,u+4)),l=xr(n,u+8),d=xr(n,u+12);switch(e){case`cmap`:r=Ws(n,l);break;case`glyf`:i=n.subarray(l,l+d);break;case`loca`:a=n.subarray(l,l+d);break;case`head`:c=br(n,l+18),s=br(n,l+50);break;case`CFF `:o=Gs(n,l,l+d,t)}}if(i){let t=c?[1/c,0,0,1/c,0,0]:e.fontMatrix;return new Zs(function(e,t,n){let r,i;n?(r=4,i=xr):(r=2,i=(e,t)=>2*br(e,t));let a=[],o=i(t,0);for(let n=r;n<t.length;n+=r){let r=i(t,n);a.push(e.subarray(o,r)),o=r}return a}(i,a,s),r,t)}return new Qs(o,r,e.fontMatrix)}},ec=sr(function(e){e.Courier=600,e[`Courier-Bold`]=600,e[`Courier-BoldOblique`]=600,e[`Courier-Oblique`]=600,e.Helvetica=sr(function(e){e.space=278,e.exclam=278,e.quotedbl=355,e.numbersign=556,e.dollar=556,e.percent=889,e.ampersand=667,e.quoteright=222,e.parenleft=333,e.parenright=333,e.asterisk=389,e.plus=584,e.comma=278,e.hyphen=333,e.period=278,e.slash=278,e.zero=556,e.one=556,e.two=556,e.three=556,e.four=556,e.five=556,e.six=556,e.seven=556,e.eight=556,e.nine=556,e.colon=278,e.semicolon=278,e.less=584,e.equal=584,e.greater=584,e.question=556,e.at=1015,e.A=667,e.B=667,e.C=722,e.D=722,e.E=667,e.F=611,e.G=778,e.H=722,e.I=278,e.J=500,e.K=667,e.L=556,e.M=833,e.N=722,e.O=778,e.P=667,e.Q=778,e.R=722,e.S=667,e.T=611,e.U=722,e.V=667,e.W=944,e.X=667,e.Y=667,e.Z=611,e.bracketleft=278,e.backslash=278,e.bracketright=278,e.asciicircum=469,e.underscore=556,e.quoteleft=222,e.a=556,e.b=556,e.c=500,e.d=556,e.e=556,e.f=278,e.g=556,e.h=556,e.i=222,e.j=222,e.k=500,e.l=222,e.m=833,e.n=556,e.o=556,e.p=556,e.q=556,e.r=333,e.s=500,e.t=278,e.u=556,e.v=500,e.w=722,e.x=500,e.y=500,e.z=500,e.braceleft=334,e.bar=260,e.braceright=334,e.asciitilde=584,e.exclamdown=333,e.cent=556,e.sterling=556,e.fraction=167,e.yen=556,e.florin=556,e.section=556,e.currency=556,e.quotesingle=191,e.quotedblleft=333,e.guillemotleft=556,e.guilsinglleft=333,e.guilsinglright=333,e.fi=500,e.fl=500,e.endash=556,e.dagger=556,e.daggerdbl=556,e.periodcentered=278,e.paragraph=537,e.bullet=350,e.quotesinglbase=222,e.quotedblbase=333,e.quotedblright=333,e.guillemotright=556,e.ellipsis=1e3,e.perthousand=1e3,e.questiondown=611,e.grave=333,e.acute=333,e.circumflex=333,e.tilde=333,e.macron=333,e.breve=333,e.dotaccent=333,e.dieresis=333,e.ring=333,e.cedilla=333,e.hungarumlaut=333,e.ogonek=333,e.caron=333,e.emdash=1e3,e.AE=1e3,e.ordfeminine=370,e.Lslash=556,e.Oslash=778,e.OE=1e3,e.ordmasculine=365,e.ae=889,e.dotlessi=278,e.lslash=222,e.oslash=611,e.oe=944,e.germandbls=611,e.Idieresis=278,e.eacute=556,e.abreve=556,e.uhungarumlaut=556,e.ecaron=556,e.Ydieresis=667,e.divide=584,e.Yacute=667,e.Acircumflex=667,e.aacute=556,e.Ucircumflex=722,e.yacute=500,e.scommaaccent=500,e.ecircumflex=556,e.Uring=722,e.Udieresis=722,e.aogonek=556,e.Uacute=722,e.uogonek=556,e.Edieresis=667,e.Dcroat=722,e.commaaccent=250,e.copyright=737,e.Emacron=667,e.ccaron=500,e.aring=556,e.Ncommaaccent=722,e.lacute=222,e.agrave=556,e.Tcommaaccent=611,e.Cacute=722,e.atilde=556,e.Edotaccent=667,e.scaron=500,e.scedilla=500,e.iacute=278,e.lozenge=471,e.Rcaron=722,e.Gcommaaccent=778,e.ucircumflex=556,e.acircumflex=556,e.Amacron=667,e.rcaron=333,e.ccedilla=500,e.Zdotaccent=611,e.Thorn=667,e.Omacron=778,e.Racute=722,e.Sacute=667,e.dcaron=643,e.Umacron=722,e.uring=556,e.threesuperior=333,e.Ograve=778,e.Agrave=667,e.Abreve=667,e.multiply=584,e.uacute=556,e.Tcaron=611,e.partialdiff=476,e.ydieresis=500,e.Nacute=722,e.icircumflex=278,e.Ecircumflex=667,e.adieresis=556,e.edieresis=556,e.cacute=500,e.nacute=556,e.umacron=556,e.Ncaron=722,e.Iacute=278,e.plusminus=584,e.brokenbar=260,e.registered=737,e.Gbreve=778,e.Idotaccent=278,e.summation=600,e.Egrave=667,e.racute=333,e.omacron=556,e.Zacute=611,e.Zcaron=611,e.greaterequal=549,e.Eth=722,e.Ccedilla=722,e.lcommaaccent=222,e.tcaron=317,e.eogonek=556,e.Uogonek=722,e.Aacute=667,e.Adieresis=667,e.egrave=556,e.zacute=500,e.iogonek=222,e.Oacute=778,e.oacute=556,e.amacron=556,e.sacute=500,e.idieresis=278,e.Ocircumflex=778,e.Ugrave=722,e.Delta=612,e.thorn=556,e.twosuperior=333,e.Odieresis=778,e.mu=556,e.igrave=278,e.ohungarumlaut=556,e.Eogonek=667,e.dcroat=556,e.threequarters=834,e.Scedilla=667,e.lcaron=299,e.Kcommaaccent=667,e.Lacute=556,e.trademark=1e3,e.edotaccent=556,e.Igrave=278,e.Imacron=278,e.Lcaron=556,e.onehalf=834,e.lessequal=549,e.ocircumflex=556,e.ntilde=556,e.Uhungarumlaut=722,e.Eacute=667,e.emacron=556,e.gbreve=556,e.onequarter=834,e.Scaron=667,e.Scommaaccent=667,e.Ohungarumlaut=778,e.degree=400,e.ograve=556,e.Ccaron=722,e.ugrave=556,e.radical=453,e.Dcaron=722,e.rcommaaccent=333,e.Ntilde=722,e.otilde=556,e.Rcommaaccent=722,e.Lcommaaccent=556,e.Atilde=667,e.Aogonek=667,e.Aring=667,e.Otilde=778,e.zdotaccent=500,e.Ecaron=667,e.Iogonek=278,e.kcommaaccent=500,e.minus=584,e.Icircumflex=278,e.ncaron=556,e.tcommaaccent=278,e.logicalnot=584,e.odieresis=556,e.udieresis=556,e.notequal=549,e.gcommaaccent=556,e.eth=556,e.zcaron=500,e.ncommaaccent=556,e.onesuperior=333,e.imacron=278,e.Euro=556}),e[`Helvetica-Bold`]=sr(function(e){e.space=278,e.exclam=333,e.quotedbl=474,e.numbersign=556,e.dollar=556,e.percent=889,e.ampersand=722,e.quoteright=278,e.parenleft=333,e.parenright=333,e.asterisk=389,e.plus=584,e.comma=278,e.hyphen=333,e.period=278,e.slash=278,e.zero=556,e.one=556,e.two=556,e.three=556,e.four=556,e.five=556,e.six=556,e.seven=556,e.eight=556,e.nine=556,e.colon=333,e.semicolon=333,e.less=584,e.equal=584,e.greater=584,e.question=611,e.at=975,e.A=722,e.B=722,e.C=722,e.D=722,e.E=667,e.F=611,e.G=778,e.H=722,e.I=278,e.J=556,e.K=722,e.L=611,e.M=833,e.N=722,e.O=778,e.P=667,e.Q=778,e.R=722,e.S=667,e.T=611,e.U=722,e.V=667,e.W=944,e.X=667,e.Y=667,e.Z=611,e.bracketleft=333,e.backslash=278,e.bracketright=333,e.asciicircum=584,e.underscore=556,e.quoteleft=278,e.a=556,e.b=611,e.c=556,e.d=611,e.e=556,e.f=333,e.g=611,e.h=611,e.i=278,e.j=278,e.k=556,e.l=278,e.m=889,e.n=611,e.o=611,e.p=611,e.q=611,e.r=389,e.s=556,e.t=333,e.u=611,e.v=556,e.w=778,e.x=556,e.y=556,e.z=500,e.braceleft=389,e.bar=280,e.braceright=389,e.asciitilde=584,e.exclamdown=333,e.cent=556,e.sterling=556,e.fraction=167,e.yen=556,e.florin=556,e.section=556,e.currency=556,e.quotesingle=238,e.quotedblleft=500,e.guillemotleft=556,e.guilsinglleft=333,e.guilsinglright=333,e.fi=611,e.fl=611,e.endash=556,e.dagger=556,e.daggerdbl=556,e.periodcentered=278,e.paragraph=556,e.bullet=350,e.quotesinglbase=278,e.quotedblbase=500,e.quotedblright=500,e.guillemotright=556,e.ellipsis=1e3,e.perthousand=1e3,e.questiondown=611,e.grave=333,e.acute=333,e.circumflex=333,e.tilde=333,e.macron=333,e.breve=333,e.dotaccent=333,e.dieresis=333,e.ring=333,e.cedilla=333,e.hungarumlaut=333,e.ogonek=333,e.caron=333,e.emdash=1e3,e.AE=1e3,e.ordfeminine=370,e.Lslash=611,e.Oslash=778,e.OE=1e3,e.ordmasculine=365,e.ae=889,e.dotlessi=278,e.lslash=278,e.oslash=611,e.oe=944,e.germandbls=611,e.Idieresis=278,e.eacute=556,e.abreve=556,e.uhungarumlaut=611,e.ecaron=556,e.Ydieresis=667,e.divide=584,e.Yacute=667,e.Acircumflex=722,e.aacute=556,e.Ucircumflex=722,e.yacute=556,e.scommaaccent=556,e.ecircumflex=556,e.Uring=722,e.Udieresis=722,e.aogonek=556,e.Uacute=722,e.uogonek=611,e.Edieresis=667,e.Dcroat=722,e.commaaccent=250,e.copyright=737,e.Emacron=667,e.ccaron=556,e.aring=556,e.Ncommaaccent=722,e.lacute=278,e.agrave=556,e.Tcommaaccent=611,e.Cacute=722,e.atilde=556,e.Edotaccent=667,e.scaron=556,e.scedilla=556,e.iacute=278,e.lozenge=494,e.Rcaron=722,e.Gcommaaccent=778,e.ucircumflex=611,e.acircumflex=556,e.Amacron=722,e.rcaron=389,e.ccedilla=556,e.Zdotaccent=611,e.Thorn=667,e.Omacron=778,e.Racute=722,e.Sacute=667,e.dcaron=743,e.Umacron=722,e.uring=611,e.threesuperior=333,e.Ograve=778,e.Agrave=722,e.Abreve=722,e.multiply=584,e.uacute=611,e.Tcaron=611,e.partialdiff=494,e.ydieresis=556,e.Nacute=722,e.icircumflex=278,e.Ecircumflex=667,e.adieresis=556,e.edieresis=556,e.cacute=556,e.nacute=611,e.umacron=611,e.Ncaron=722,e.Iacute=278,e.plusminus=584,e.brokenbar=280,e.registered=737,e.Gbreve=778,e.Idotaccent=278,e.summation=600,e.Egrave=667,e.racute=389,e.omacron=611,e.Zacute=611,e.Zcaron=611,e.greaterequal=549,e.Eth=722,e.Ccedilla=722,e.lcommaaccent=278,e.tcaron=389,e.eogonek=556,e.Uogonek=722,e.Aacute=722,e.Adieresis=722,e.egrave=556,e.zacute=500,e.iogonek=278,e.Oacute=778,e.oacute=611,e.amacron=556,e.sacute=556,e.idieresis=278,e.Ocircumflex=778,e.Ugrave=722,e.Delta=612,e.thorn=611,e.twosuperior=333,e.Odieresis=778,e.mu=611,e.igrave=278,e.ohungarumlaut=611,e.Eogonek=667,e.dcroat=611,e.threequarters=834,e.Scedilla=667,e.lcaron=400,e.Kcommaaccent=722,e.Lacute=611,e.trademark=1e3,e.edotaccent=556,e.Igrave=278,e.Imacron=278,e.Lcaron=611,e.onehalf=834,e.lessequal=549,e.ocircumflex=611,e.ntilde=611,e.Uhungarumlaut=722,e.Eacute=667,e.emacron=556,e.gbreve=611,e.onequarter=834,e.Scaron=667,e.Scommaaccent=667,e.Ohungarumlaut=778,e.degree=400,e.ograve=611,e.Ccaron=722,e.ugrave=611,e.radical=549,e.Dcaron=722,e.rcommaaccent=389,e.Ntilde=722,e.otilde=611,e.Rcommaaccent=722,e.Lcommaaccent=611,e.Atilde=722,e.Aogonek=722,e.Aring=722,e.Otilde=778,e.zdotaccent=500,e.Ecaron=667,e.Iogonek=278,e.kcommaaccent=556,e.minus=584,e.Icircumflex=278,e.ncaron=611,e.tcommaaccent=333,e.logicalnot=584,e.odieresis=611,e.udieresis=611,e.notequal=549,e.gcommaaccent=611,e.eth=611,e.zcaron=500,e.ncommaaccent=611,e.onesuperior=333,e.imacron=278,e.Euro=556}),e[`Helvetica-BoldOblique`]=sr(function(e){e.space=278,e.exclam=333,e.quotedbl=474,e.numbersign=556,e.dollar=556,e.percent=889,e.ampersand=722,e.quoteright=278,e.parenleft=333,e.parenright=333,e.asterisk=389,e.plus=584,e.comma=278,e.hyphen=333,e.period=278,e.slash=278,e.zero=556,e.one=556,e.two=556,e.three=556,e.four=556,e.five=556,e.six=556,e.seven=556,e.eight=556,e.nine=556,e.colon=333,e.semicolon=333,e.less=584,e.equal=584,e.greater=584,e.question=611,e.at=975,e.A=722,e.B=722,e.C=722,e.D=722,e.E=667,e.F=611,e.G=778,e.H=722,e.I=278,e.J=556,e.K=722,e.L=611,e.M=833,e.N=722,e.O=778,e.P=667,e.Q=778,e.R=722,e.S=667,e.T=611,e.U=722,e.V=667,e.W=944,e.X=667,e.Y=667,e.Z=611,e.bracketleft=333,e.backslash=278,e.bracketright=333,e.asciicircum=584,e.underscore=556,e.quoteleft=278,e.a=556,e.b=611,e.c=556,e.d=611,e.e=556,e.f=333,e.g=611,e.h=611,e.i=278,e.j=278,e.k=556,e.l=278,e.m=889,e.n=611,e.o=611,e.p=611,e.q=611,e.r=389,e.s=556,e.t=333,e.u=611,e.v=556,e.w=778,e.x=556,e.y=556,e.z=500,e.braceleft=389,e.bar=280,e.braceright=389,e.asciitilde=584,e.exclamdown=333,e.cent=556,e.sterling=556,e.fraction=167,e.yen=556,e.florin=556,e.section=556,e.currency=556,e.quotesingle=238,e.quotedblleft=500,e.guillemotleft=556,e.guilsinglleft=333,e.guilsinglright=333,e.fi=611,e.fl=611,e.endash=556,e.dagger=556,e.daggerdbl=556,e.periodcentered=278,e.paragraph=556,e.bullet=350,e.quotesinglbase=278,e.quotedblbase=500,e.quotedblright=500,e.guillemotright=556,e.ellipsis=1e3,e.perthousand=1e3,e.questiondown=611,e.grave=333,e.acute=333,e.circumflex=333,e.tilde=333,e.macron=333,e.breve=333,e.dotaccent=333,e.dieresis=333,e.ring=333,e.cedilla=333,e.hungarumlaut=333,e.ogonek=333,e.caron=333,e.emdash=1e3,e.AE=1e3,e.ordfeminine=370,e.Lslash=611,e.Oslash=778,e.OE=1e3,e.ordmasculine=365,e.ae=889,e.dotlessi=278,e.lslash=278,e.oslash=611,e.oe=944,e.germandbls=611,e.Idieresis=278,e.eacute=556,e.abreve=556,e.uhungarumlaut=611,e.ecaron=556,e.Ydieresis=667,e.divide=584,e.Yacute=667,e.Acircumflex=722,e.aacute=556,e.Ucircumflex=722,e.yacute=556,e.scommaaccent=556,e.ecircumflex=556,e.Uring=722,e.Udieresis=722,e.aogonek=556,e.Uacute=722,e.uogonek=611,e.Edieresis=667,e.Dcroat=722,e.commaaccent=250,e.copyright=737,e.Emacron=667,e.ccaron=556,e.aring=556,e.Ncommaaccent=722,e.lacute=278,e.agrave=556,e.Tcommaaccent=611,e.Cacute=722,e.atilde=556,e.Edotaccent=667,e.scaron=556,e.scedilla=556,e.iacute=278,e.lozenge=494,e.Rcaron=722,e.Gcommaaccent=778,e.ucircumflex=611,e.acircumflex=556,e.Amacron=722,e.rcaron=389,e.ccedilla=556,e.Zdotaccent=611,e.Thorn=667,e.Omacron=778,e.Racute=722,e.Sacute=667,e.dcaron=743,e.Umacron=722,e.uring=611,e.threesuperior=333,e.Ograve=778,e.Agrave=722,e.Abreve=722,e.multiply=584,e.uacute=611,e.Tcaron=611,e.partialdiff=494,e.ydieresis=556,e.Nacute=722,e.icircumflex=278,e.Ecircumflex=667,e.adieresis=556,e.edieresis=556,e.cacute=556,e.nacute=611,e.umacron=611,e.Ncaron=722,e.Iacute=278,e.plusminus=584,e.brokenbar=280,e.registered=737,e.Gbreve=778,e.Idotaccent=278,e.summation=600,e.Egrave=667,e.racute=389,e.omacron=611,e.Zacute=611,e.Zcaron=611,e.greaterequal=549,e.Eth=722,e.Ccedilla=722,e.lcommaaccent=278,e.tcaron=389,e.eogonek=556,e.Uogonek=722,e.Aacute=722,e.Adieresis=722,e.egrave=556,e.zacute=500,e.iogonek=278,e.Oacute=778,e.oacute=611,e.amacron=556,e.sacute=556,e.idieresis=278,e.Ocircumflex=778,e.Ugrave=722,e.Delta=612,e.thorn=611,e.twosuperior=333,e.Odieresis=778,e.mu=611,e.igrave=278,e.ohungarumlaut=611,e.Eogonek=667,e.dcroat=611,e.threequarters=834,e.Scedilla=667,e.lcaron=400,e.Kcommaaccent=722,e.Lacute=611,e.trademark=1e3,e.edotaccent=556,e.Igrave=278,e.Imacron=278,e.Lcaron=611,e.onehalf=834,e.lessequal=549,e.ocircumflex=611,e.ntilde=611,e.Uhungarumlaut=722,e.Eacute=667,e.emacron=556,e.gbreve=611,e.onequarter=834,e.Scaron=667,e.Scommaaccent=667,e.Ohungarumlaut=778,e.degree=400,e.ograve=611,e.Ccaron=722,e.ugrave=611,e.radical=549,e.Dcaron=722,e.rcommaaccent=389,e.Ntilde=722,e.otilde=611,e.Rcommaaccent=722,e.Lcommaaccent=611,e.Atilde=722,e.Aogonek=722,e.Aring=722,e.Otilde=778,e.zdotaccent=500,e.Ecaron=667,e.Iogonek=278,e.kcommaaccent=556,e.minus=584,e.Icircumflex=278,e.ncaron=611,e.tcommaaccent=333,e.logicalnot=584,e.odieresis=611,e.udieresis=611,e.notequal=549,e.gcommaaccent=611,e.eth=611,e.zcaron=500,e.ncommaaccent=611,e.onesuperior=333,e.imacron=278,e.Euro=556}),e[`Helvetica-Oblique`]=sr(function(e){e.space=278,e.exclam=278,e.quotedbl=355,e.numbersign=556,e.dollar=556,e.percent=889,e.ampersand=667,e.quoteright=222,e.parenleft=333,e.parenright=333,e.asterisk=389,e.plus=584,e.comma=278,e.hyphen=333,e.period=278,e.slash=278,e.zero=556,e.one=556,e.two=556,e.three=556,e.four=556,e.five=556,e.six=556,e.seven=556,e.eight=556,e.nine=556,e.colon=278,e.semicolon=278,e.less=584,e.equal=584,e.greater=584,e.question=556,e.at=1015,e.A=667,e.B=667,e.C=722,e.D=722,e.E=667,e.F=611,e.G=778,e.H=722,e.I=278,e.J=500,e.K=667,e.L=556,e.M=833,e.N=722,e.O=778,e.P=667,e.Q=778,e.R=722,e.S=667,e.T=611,e.U=722,e.V=667,e.W=944,e.X=667,e.Y=667,e.Z=611,e.bracketleft=278,e.backslash=278,e.bracketright=278,e.asciicircum=469,e.underscore=556,e.quoteleft=222,e.a=556,e.b=556,e.c=500,e.d=556,e.e=556,e.f=278,e.g=556,e.h=556,e.i=222,e.j=222,e.k=500,e.l=222,e.m=833,e.n=556,e.o=556,e.p=556,e.q=556,e.r=333,e.s=500,e.t=278,e.u=556,e.v=500,e.w=722,e.x=500,e.y=500,e.z=500,e.braceleft=334,e.bar=260,e.braceright=334,e.asciitilde=584,e.exclamdown=333,e.cent=556,e.sterling=556,e.fraction=167,e.yen=556,e.florin=556,e.section=556,e.currency=556,e.quotesingle=191,e.quotedblleft=333,e.guillemotleft=556,e.guilsinglleft=333,e.guilsinglright=333,e.fi=500,e.fl=500,e.endash=556,e.dagger=556,e.daggerdbl=556,e.periodcentered=278,e.paragraph=537,e.bullet=350,e.quotesinglbase=222,e.quotedblbase=333,e.quotedblright=333,e.guillemotright=556,e.ellipsis=1e3,e.perthousand=1e3,e.questiondown=611,e.grave=333,e.acute=333,e.circumflex=333,e.tilde=333,e.macron=333,e.breve=333,e.dotaccent=333,e.dieresis=333,e.ring=333,e.cedilla=333,e.hungarumlaut=333,e.ogonek=333,e.caron=333,e.emdash=1e3,e.AE=1e3,e.ordfeminine=370,e.Lslash=556,e.Oslash=778,e.OE=1e3,e.ordmasculine=365,e.ae=889,e.dotlessi=278,e.lslash=222,e.oslash=611,e.oe=944,e.germandbls=611,e.Idieresis=278,e.eacute=556,e.abreve=556,e.uhungarumlaut=556,e.ecaron=556,e.Ydieresis=667,e.divide=584,e.Yacute=667,e.Acircumflex=667,e.aacute=556,e.Ucircumflex=722,e.yacute=500,e.scommaaccent=500,e.ecircumflex=556,e.Uring=722,e.Udieresis=722,e.aogonek=556,e.Uacute=722,e.uogonek=556,e.Edieresis=667,e.Dcroat=722,e.commaaccent=250,e.copyright=737,e.Emacron=667,e.ccaron=500,e.aring=556,e.Ncommaaccent=722,e.lacute=222,e.agrave=556,e.Tcommaaccent=611,e.Cacute=722,e.atilde=556,e.Edotaccent=667,e.scaron=500,e.scedilla=500,e.iacute=278,e.lozenge=471,e.Rcaron=722,e.Gcommaaccent=778,e.ucircumflex=556,e.acircumflex=556,e.Amacron=667,e.rcaron=333,e.ccedilla=500,e.Zdotaccent=611,e.Thorn=667,e.Omacron=778,e.Racute=722,e.Sacute=667,e.dcaron=643,e.Umacron=722,e.uring=556,e.threesuperior=333,e.Ograve=778,e.Agrave=667,e.Abreve=667,e.multiply=584,e.uacute=556,e.Tcaron=611,e.partialdiff=476,e.ydieresis=500,e.Nacute=722,e.icircumflex=278,e.Ecircumflex=667,e.adieresis=556,e.edieresis=556,e.cacute=500,e.nacute=556,e.umacron=556,e.Ncaron=722,e.Iacute=278,e.plusminus=584,e.brokenbar=260,e.registered=737,e.Gbreve=778,e.Idotaccent=278,e.summation=600,e.Egrave=667,e.racute=333,e.omacron=556,e.Zacute=611,e.Zcaron=611,e.greaterequal=549,e.Eth=722,e.Ccedilla=722,e.lcommaaccent=222,e.tcaron=317,e.eogonek=556,e.Uogonek=722,e.Aacute=667,e.Adieresis=667,e.egrave=556,e.zacute=500,e.iogonek=222,e.Oacute=778,e.oacute=556,e.amacron=556,e.sacute=500,e.idieresis=278,e.Ocircumflex=778,e.Ugrave=722,e.Delta=612,e.thorn=556,e.twosuperior=333,e.Odieresis=778,e.mu=556,e.igrave=278,e.ohungarumlaut=556,e.Eogonek=667,e.dcroat=556,e.threequarters=834,e.Scedilla=667,e.lcaron=299,e.Kcommaaccent=667,e.Lacute=556,e.trademark=1e3,e.edotaccent=556,e.Igrave=278,e.Imacron=278,e.Lcaron=556,e.onehalf=834,e.lessequal=549,e.ocircumflex=556,e.ntilde=556,e.Uhungarumlaut=722,e.Eacute=667,e.emacron=556,e.gbreve=556,e.onequarter=834,e.Scaron=667,e.Scommaaccent=667,e.Ohungarumlaut=778,e.degree=400,e.ograve=556,e.Ccaron=722,e.ugrave=556,e.radical=453,e.Dcaron=722,e.rcommaaccent=333,e.Ntilde=722,e.otilde=556,e.Rcommaaccent=722,e.Lcommaaccent=556,e.Atilde=667,e.Aogonek=667,e.Aring=667,e.Otilde=778,e.zdotaccent=500,e.Ecaron=667,e.Iogonek=278,e.kcommaaccent=500,e.minus=584,e.Icircumflex=278,e.ncaron=556,e.tcommaaccent=278,e.logicalnot=584,e.odieresis=556,e.udieresis=556,e.notequal=549,e.gcommaaccent=556,e.eth=556,e.zcaron=500,e.ncommaaccent=556,e.onesuperior=333,e.imacron=278,e.Euro=556}),e.Symbol=sr(function(e){e.space=250,e.exclam=333,e.universal=713,e.numbersign=500,e.existential=549,e.percent=833,e.ampersand=778,e.suchthat=439,e.parenleft=333,e.parenright=333,e.asteriskmath=500,e.plus=549,e.comma=250,e.minus=549,e.period=250,e.slash=278,e.zero=500,e.one=500,e.two=500,e.three=500,e.four=500,e.five=500,e.six=500,e.seven=500,e.eight=500,e.nine=500,e.colon=278,e.semicolon=278,e.less=549,e.equal=549,e.greater=549,e.question=444,e.congruent=549,e.Alpha=722,e.Beta=667,e.Chi=722,e.Delta=612,e.Epsilon=611,e.Phi=763,e.Gamma=603,e.Eta=722,e.Iota=333,e.theta1=631,e.Kappa=722,e.Lambda=686,e.Mu=889,e.Nu=722,e.Omicron=722,e.Pi=768,e.Theta=741,e.Rho=556,e.Sigma=592,e.Tau=611,e.Upsilon=690,e.sigma1=439,e.Omega=768,e.Xi=645,e.Psi=795,e.Zeta=611,e.bracketleft=333,e.therefore=863,e.bracketright=333,e.perpendicular=658,e.underscore=500,e.radicalex=500,e.alpha=631,e.beta=549,e.chi=549,e.delta=494,e.epsilon=439,e.phi=521,e.gamma=411,e.eta=603,e.iota=329,e.phi1=603,e.kappa=549,e.lambda=549,e.mu=576,e.nu=521,e.omicron=549,e.pi=549,e.theta=521,e.rho=549,e.sigma=603,e.tau=439,e.upsilon=576,e.omega1=713,e.omega=686,e.xi=493,e.psi=686,e.zeta=494,e.braceleft=480,e.bar=200,e.braceright=480,e.similar=549,e.Euro=750,e.Upsilon1=620,e.minute=247,e.lessequal=549,e.fraction=167,e.infinity=713,e.florin=500,e.club=753,e.diamond=753,e.heart=753,e.spade=753,e.arrowboth=1042,e.arrowleft=987,e.arrowup=603,e.arrowright=987,e.arrowdown=603,e.degree=400,e.plusminus=549,e.second=411,e.greaterequal=549,e.multiply=549,e.proportional=713,e.partialdiff=494,e.bullet=460,e.divide=549,e.notequal=549,e.equivalence=549,e.approxequal=549,e.ellipsis=1e3,e.arrowvertex=603,e.arrowhorizex=1e3,e.carriagereturn=658,e.aleph=823,e.Ifraktur=686,e.Rfraktur=795,e.weierstrass=987,e.circlemultiply=768,e.circleplus=768,e.emptyset=823,e.intersection=768,e.union=768,e.propersuperset=713,e.reflexsuperset=713,e.notsubset=713,e.propersubset=713,e.reflexsubset=713,e.element=713,e.notelement=713,e.angle=768,e.gradient=713,e.registerserif=790,e.copyrightserif=790,e.trademarkserif=890,e.product=823,e.radical=549,e.dotmath=250,e.logicalnot=713,e.logicaland=603,e.logicalor=603,e.arrowdblboth=1042,e.arrowdblleft=987,e.arrowdblup=603,e.arrowdblright=987,e.arrowdbldown=603,e.lozenge=494,e.angleleft=329,e.registersans=790,e.copyrightsans=790,e.trademarksans=786,e.summation=713,e.parenlefttp=384,e.parenleftex=384,e.parenleftbt=384,e.bracketlefttp=384,e.bracketleftex=384,e.bracketleftbt=384,e.bracelefttp=494,e.braceleftmid=494,e.braceleftbt=494,e.braceex=494,e.angleright=329,e.integral=274,e.integraltp=686,e.integralex=686,e.integralbt=686,e.parenrighttp=384,e.parenrightex=384,e.parenrightbt=384,e.bracketrighttp=384,e.bracketrightex=384,e.bracketrightbt=384,e.bracerighttp=494,e.bracerightmid=494,e.bracerightbt=494,e.apple=790}),e[`Times-Roman`]=sr(function(e){e.space=250,e.exclam=333,e.quotedbl=408,e.numbersign=500,e.dollar=500,e.percent=833,e.ampersand=778,e.quoteright=333,e.parenleft=333,e.parenright=333,e.asterisk=500,e.plus=564,e.comma=250,e.hyphen=333,e.period=250,e.slash=278,e.zero=500,e.one=500,e.two=500,e.three=500,e.four=500,e.five=500,e.six=500,e.seven=500,e.eight=500,e.nine=500,e.colon=278,e.semicolon=278,e.less=564,e.equal=564,e.greater=564,e.question=444,e.at=921,e.A=722,e.B=667,e.C=667,e.D=722,e.E=611,e.F=556,e.G=722,e.H=722,e.I=333,e.J=389,e.K=722,e.L=611,e.M=889,e.N=722,e.O=722,e.P=556,e.Q=722,e.R=667,e.S=556,e.T=611,e.U=722,e.V=722,e.W=944,e.X=722,e.Y=722,e.Z=611,e.bracketleft=333,e.backslash=278,e.bracketright=333,e.asciicircum=469,e.underscore=500,e.quoteleft=333,e.a=444,e.b=500,e.c=444,e.d=500,e.e=444,e.f=333,e.g=500,e.h=500,e.i=278,e.j=278,e.k=500,e.l=278,e.m=778,e.n=500,e.o=500,e.p=500,e.q=500,e.r=333,e.s=389,e.t=278,e.u=500,e.v=500,e.w=722,e.x=500,e.y=500,e.z=444,e.braceleft=480,e.bar=200,e.braceright=480,e.asciitilde=541,e.exclamdown=333,e.cent=500,e.sterling=500,e.fraction=167,e.yen=500,e.florin=500,e.section=500,e.currency=500,e.quotesingle=180,e.quotedblleft=444,e.guillemotleft=500,e.guilsinglleft=333,e.guilsinglright=333,e.fi=556,e.fl=556,e.endash=500,e.dagger=500,e.daggerdbl=500,e.periodcentered=250,e.paragraph=453,e.bullet=350,e.quotesinglbase=333,e.quotedblbase=444,e.quotedblright=444,e.guillemotright=500,e.ellipsis=1e3,e.perthousand=1e3,e.questiondown=444,e.grave=333,e.acute=333,e.circumflex=333,e.tilde=333,e.macron=333,e.breve=333,e.dotaccent=333,e.dieresis=333,e.ring=333,e.cedilla=333,e.hungarumlaut=333,e.ogonek=333,e.caron=333,e.emdash=1e3,e.AE=889,e.ordfeminine=276,e.Lslash=611,e.Oslash=722,e.OE=889,e.ordmasculine=310,e.ae=667,e.dotlessi=278,e.lslash=278,e.oslash=500,e.oe=722,e.germandbls=500,e.Idieresis=333,e.eacute=444,e.abreve=444,e.uhungarumlaut=500,e.ecaron=444,e.Ydieresis=722,e.divide=564,e.Yacute=722,e.Acircumflex=722,e.aacute=444,e.Ucircumflex=722,e.yacute=500,e.scommaaccent=389,e.ecircumflex=444,e.Uring=722,e.Udieresis=722,e.aogonek=444,e.Uacute=722,e.uogonek=500,e.Edieresis=611,e.Dcroat=722,e.commaaccent=250,e.copyright=760,e.Emacron=611,e.ccaron=444,e.aring=444,e.Ncommaaccent=722,e.lacute=278,e.agrave=444,e.Tcommaaccent=611,e.Cacute=667,e.atilde=444,e.Edotaccent=611,e.scaron=389,e.scedilla=389,e.iacute=278,e.lozenge=471,e.Rcaron=667,e.Gcommaaccent=722,e.ucircumflex=500,e.acircumflex=444,e.Amacron=722,e.rcaron=333,e.ccedilla=444,e.Zdotaccent=611,e.Thorn=556,e.Omacron=722,e.Racute=667,e.Sacute=556,e.dcaron=588,e.Umacron=722,e.uring=500,e.threesuperior=300,e.Ograve=722,e.Agrave=722,e.Abreve=722,e.multiply=564,e.uacute=500,e.Tcaron=611,e.partialdiff=476,e.ydieresis=500,e.Nacute=722,e.icircumflex=278,e.Ecircumflex=611,e.adieresis=444,e.edieresis=444,e.cacute=444,e.nacute=500,e.umacron=500,e.Ncaron=722,e.Iacute=333,e.plusminus=564,e.brokenbar=200,e.registered=760,e.Gbreve=722,e.Idotaccent=333,e.summation=600,e.Egrave=611,e.racute=333,e.omacron=500,e.Zacute=611,e.Zcaron=611,e.greaterequal=549,e.Eth=722,e.Ccedilla=667,e.lcommaaccent=278,e.tcaron=326,e.eogonek=444,e.Uogonek=722,e.Aacute=722,e.Adieresis=722,e.egrave=444,e.zacute=444,e.iogonek=278,e.Oacute=722,e.oacute=500,e.amacron=444,e.sacute=389,e.idieresis=278,e.Ocircumflex=722,e.Ugrave=722,e.Delta=612,e.thorn=500,e.twosuperior=300,e.Odieresis=722,e.mu=500,e.igrave=278,e.ohungarumlaut=500,e.Eogonek=611,e.dcroat=500,e.threequarters=750,e.Scedilla=556,e.lcaron=344,e.Kcommaaccent=722,e.Lacute=611,e.trademark=980,e.edotaccent=444,e.Igrave=333,e.Imacron=333,e.Lcaron=611,e.onehalf=750,e.lessequal=549,e.ocircumflex=500,e.ntilde=500,e.Uhungarumlaut=722,e.Eacute=611,e.emacron=444,e.gbreve=500,e.onequarter=750,e.Scaron=556,e.Scommaaccent=556,e.Ohungarumlaut=722,e.degree=400,e.ograve=500,e.Ccaron=667,e.ugrave=500,e.radical=453,e.Dcaron=722,e.rcommaaccent=333,e.Ntilde=722,e.otilde=500,e.Rcommaaccent=667,e.Lcommaaccent=611,e.Atilde=722,e.Aogonek=722,e.Aring=722,e.Otilde=722,e.zdotaccent=444,e.Ecaron=611,e.Iogonek=333,e.kcommaaccent=500,e.minus=564,e.Icircumflex=333,e.ncaron=500,e.tcommaaccent=278,e.logicalnot=564,e.odieresis=500,e.udieresis=500,e.notequal=549,e.gcommaaccent=500,e.eth=500,e.zcaron=444,e.ncommaaccent=500,e.onesuperior=300,e.imacron=278,e.Euro=500}),e[`Times-Bold`]=sr(function(e){e.space=250,e.exclam=333,e.quotedbl=555,e.numbersign=500,e.dollar=500,e.percent=1e3,e.ampersand=833,e.quoteright=333,e.parenleft=333,e.parenright=333,e.asterisk=500,e.plus=570,e.comma=250,e.hyphen=333,e.period=250,e.slash=278,e.zero=500,e.one=500,e.two=500,e.three=500,e.four=500,e.five=500,e.six=500,e.seven=500,e.eight=500,e.nine=500,e.colon=333,e.semicolon=333,e.less=570,e.equal=570,e.greater=570,e.question=500,e.at=930,e.A=722,e.B=667,e.C=722,e.D=722,e.E=667,e.F=611,e.G=778,e.H=778,e.I=389,e.J=500,e.K=778,e.L=667,e.M=944,e.N=722,e.O=778,e.P=611,e.Q=778,e.R=722,e.S=556,e.T=667,e.U=722,e.V=722,e.W=1e3,e.X=722,e.Y=722,e.Z=667,e.bracketleft=333,e.backslash=278,e.bracketright=333,e.asciicircum=581,e.underscore=500,e.quoteleft=333,e.a=500,e.b=556,e.c=444,e.d=556,e.e=444,e.f=333,e.g=500,e.h=556,e.i=278,e.j=333,e.k=556,e.l=278,e.m=833,e.n=556,e.o=500,e.p=556,e.q=556,e.r=444,e.s=389,e.t=333,e.u=556,e.v=500,e.w=722,e.x=500,e.y=500,e.z=444,e.braceleft=394,e.bar=220,e.braceright=394,e.asciitilde=520,e.exclamdown=333,e.cent=500,e.sterling=500,e.fraction=167,e.yen=500,e.florin=500,e.section=500,e.currency=500,e.quotesingle=278,e.quotedblleft=500,e.guillemotleft=500,e.guilsinglleft=333,e.guilsinglright=333,e.fi=556,e.fl=556,e.endash=500,e.dagger=500,e.daggerdbl=500,e.periodcentered=250,e.paragraph=540,e.bullet=350,e.quotesinglbase=333,e.quotedblbase=500,e.quotedblright=500,e.guillemotright=500,e.ellipsis=1e3,e.perthousand=1e3,e.questiondown=500,e.grave=333,e.acute=333,e.circumflex=333,e.tilde=333,e.macron=333,e.breve=333,e.dotaccent=333,e.dieresis=333,e.ring=333,e.cedilla=333,e.hungarumlaut=333,e.ogonek=333,e.caron=333,e.emdash=1e3,e.AE=1e3,e.ordfeminine=300,e.Lslash=667,e.Oslash=778,e.OE=1e3,e.ordmasculine=330,e.ae=722,e.dotlessi=278,e.lslash=278,e.oslash=500,e.oe=722,e.germandbls=556,e.Idieresis=389,e.eacute=444,e.abreve=500,e.uhungarumlaut=556,e.ecaron=444,e.Ydieresis=722,e.divide=570,e.Yacute=722,e.Acircumflex=722,e.aacute=500,e.Ucircumflex=722,e.yacute=500,e.scommaaccent=389,e.ecircumflex=444,e.Uring=722,e.Udieresis=722,e.aogonek=500,e.Uacute=722,e.uogonek=556,e.Edieresis=667,e.Dcroat=722,e.commaaccent=250,e.copyright=747,e.Emacron=667,e.ccaron=444,e.aring=500,e.Ncommaaccent=722,e.lacute=278,e.agrave=500,e.Tcommaaccent=667,e.Cacute=722,e.atilde=500,e.Edotaccent=667,e.scaron=389,e.scedilla=389,e.iacute=278,e.lozenge=494,e.Rcaron=722,e.Gcommaaccent=778,e.ucircumflex=556,e.acircumflex=500,e.Amacron=722,e.rcaron=444,e.ccedilla=444,e.Zdotaccent=667,e.Thorn=611,e.Omacron=778,e.Racute=722,e.Sacute=556,e.dcaron=672,e.Umacron=722,e.uring=556,e.threesuperior=300,e.Ograve=778,e.Agrave=722,e.Abreve=722,e.multiply=570,e.uacute=556,e.Tcaron=667,e.partialdiff=494,e.ydieresis=500,e.Nacute=722,e.icircumflex=278,e.Ecircumflex=667,e.adieresis=500,e.edieresis=444,e.cacute=444,e.nacute=556,e.umacron=556,e.Ncaron=722,e.Iacute=389,e.plusminus=570,e.brokenbar=220,e.registered=747,e.Gbreve=778,e.Idotaccent=389,e.summation=600,e.Egrave=667,e.racute=444,e.omacron=500,e.Zacute=667,e.Zcaron=667,e.greaterequal=549,e.Eth=722,e.Ccedilla=722,e.lcommaaccent=278,e.tcaron=416,e.eogonek=444,e.Uogonek=722,e.Aacute=722,e.Adieresis=722,e.egrave=444,e.zacute=444,e.iogonek=278,e.Oacute=778,e.oacute=500,e.amacron=500,e.sacute=389,e.idieresis=278,e.Ocircumflex=778,e.Ugrave=722,e.Delta=612,e.thorn=556,e.twosuperior=300,e.Odieresis=778,e.mu=556,e.igrave=278,e.ohungarumlaut=500,e.Eogonek=667,e.dcroat=556,e.threequarters=750,e.Scedilla=556,e.lcaron=394,e.Kcommaaccent=778,e.Lacute=667,e.trademark=1e3,e.edotaccent=444,e.Igrave=389,e.Imacron=389,e.Lcaron=667,e.onehalf=750,e.lessequal=549,e.ocircumflex=500,e.ntilde=556,e.Uhungarumlaut=722,e.Eacute=667,e.emacron=444,e.gbreve=500,e.onequarter=750,e.Scaron=556,e.Scommaaccent=556,e.Ohungarumlaut=778,e.degree=400,e.ograve=500,e.Ccaron=722,e.ugrave=556,e.radical=549,e.Dcaron=722,e.rcommaaccent=444,e.Ntilde=722,e.otilde=500,e.Rcommaaccent=722,e.Lcommaaccent=667,e.Atilde=722,e.Aogonek=722,e.Aring=722,e.Otilde=778,e.zdotaccent=444,e.Ecaron=667,e.Iogonek=389,e.kcommaaccent=556,e.minus=570,e.Icircumflex=389,e.ncaron=556,e.tcommaaccent=333,e.logicalnot=570,e.odieresis=500,e.udieresis=556,e.notequal=549,e.gcommaaccent=500,e.eth=500,e.zcaron=444,e.ncommaaccent=556,e.onesuperior=300,e.imacron=278,e.Euro=500}),e[`Times-BoldItalic`]=sr(function(e){e.space=250,e.exclam=389,e.quotedbl=555,e.numbersign=500,e.dollar=500,e.percent=833,e.ampersand=778,e.quoteright=333,e.parenleft=333,e.parenright=333,e.asterisk=500,e.plus=570,e.comma=250,e.hyphen=333,e.period=250,e.slash=278,e.zero=500,e.one=500,e.two=500,e.three=500,e.four=500,e.five=500,e.six=500,e.seven=500,e.eight=500,e.nine=500,e.colon=333,e.semicolon=333,e.less=570,e.equal=570,e.greater=570,e.question=500,e.at=832,e.A=667,e.B=667,e.C=667,e.D=722,e.E=667,e.F=667,e.G=722,e.H=778,e.I=389,e.J=500,e.K=667,e.L=611,e.M=889,e.N=722,e.O=722,e.P=611,e.Q=722,e.R=667,e.S=556,e.T=611,e.U=722,e.V=667,e.W=889,e.X=667,e.Y=611,e.Z=611,e.bracketleft=333,e.backslash=278,e.bracketright=333,e.asciicircum=570,e.underscore=500,e.quoteleft=333,e.a=500,e.b=500,e.c=444,e.d=500,e.e=444,e.f=333,e.g=500,e.h=556,e.i=278,e.j=278,e.k=500,e.l=278,e.m=778,e.n=556,e.o=500,e.p=500,e.q=500,e.r=389,e.s=389,e.t=278,e.u=556,e.v=444,e.w=667,e.x=500,e.y=444,e.z=389,e.braceleft=348,e.bar=220,e.braceright=348,e.asciitilde=570,e.exclamdown=389,e.cent=500,e.sterling=500,e.fraction=167,e.yen=500,e.florin=500,e.section=500,e.currency=500,e.quotesingle=278,e.quotedblleft=500,e.guillemotleft=500,e.guilsinglleft=333,e.guilsinglright=333,e.fi=556,e.fl=556,e.endash=500,e.dagger=500,e.daggerdbl=500,e.periodcentered=250,e.paragraph=500,e.bullet=350,e.quotesinglbase=333,e.quotedblbase=500,e.quotedblright=500,e.guillemotright=500,e.ellipsis=1e3,e.perthousand=1e3,e.questiondown=500,e.grave=333,e.acute=333,e.circumflex=333,e.tilde=333,e.macron=333,e.breve=333,e.dotaccent=333,e.dieresis=333,e.ring=333,e.cedilla=333,e.hungarumlaut=333,e.ogonek=333,e.caron=333,e.emdash=1e3,e.AE=944,e.ordfeminine=266,e.Lslash=611,e.Oslash=722,e.OE=944,e.ordmasculine=300,e.ae=722,e.dotlessi=278,e.lslash=278,e.oslash=500,e.oe=722,e.germandbls=500,e.Idieresis=389,e.eacute=444,e.abreve=500,e.uhungarumlaut=556,e.ecaron=444,e.Ydieresis=611,e.divide=570,e.Yacute=611,e.Acircumflex=667,e.aacute=500,e.Ucircumflex=722,e.yacute=444,e.scommaaccent=389,e.ecircumflex=444,e.Uring=722,e.Udieresis=722,e.aogonek=500,e.Uacute=722,e.uogonek=556,e.Edieresis=667,e.Dcroat=722,e.commaaccent=250,e.copyright=747,e.Emacron=667,e.ccaron=444,e.aring=500,e.Ncommaaccent=722,e.lacute=278,e.agrave=500,e.Tcommaaccent=611,e.Cacute=667,e.atilde=500,e.Edotaccent=667,e.scaron=389,e.scedilla=389,e.iacute=278,e.lozenge=494,e.Rcaron=667,e.Gcommaaccent=722,e.ucircumflex=556,e.acircumflex=500,e.Amacron=667,e.rcaron=389,e.ccedilla=444,e.Zdotaccent=611,e.Thorn=611,e.Omacron=722,e.Racute=667,e.Sacute=556,e.dcaron=608,e.Umacron=722,e.uring=556,e.threesuperior=300,e.Ograve=722,e.Agrave=667,e.Abreve=667,e.multiply=570,e.uacute=556,e.Tcaron=611,e.partialdiff=494,e.ydieresis=444,e.Nacute=722,e.icircumflex=278,e.Ecircumflex=667,e.adieresis=500,e.edieresis=444,e.cacute=444,e.nacute=556,e.umacron=556,e.Ncaron=722,e.Iacute=389,e.plusminus=570,e.brokenbar=220,e.registered=747,e.Gbreve=722,e.Idotaccent=389,e.summation=600,e.Egrave=667,e.racute=389,e.omacron=500,e.Zacute=611,e.Zcaron=611,e.greaterequal=549,e.Eth=722,e.Ccedilla=667,e.lcommaaccent=278,e.tcaron=366,e.eogonek=444,e.Uogonek=722,e.Aacute=667,e.Adieresis=667,e.egrave=444,e.zacute=389,e.iogonek=278,e.Oacute=722,e.oacute=500,e.amacron=500,e.sacute=389,e.idieresis=278,e.Ocircumflex=722,e.Ugrave=722,e.Delta=612,e.thorn=500,e.twosuperior=300,e.Odieresis=722,e.mu=576,e.igrave=278,e.ohungarumlaut=500,e.Eogonek=667,e.dcroat=500,e.threequarters=750,e.Scedilla=556,e.lcaron=382,e.Kcommaaccent=667,e.Lacute=611,e.trademark=1e3,e.edotaccent=444,e.Igrave=389,e.Imacron=389,e.Lcaron=611,e.onehalf=750,e.lessequal=549,e.ocircumflex=500,e.ntilde=556,e.Uhungarumlaut=722,e.Eacute=667,e.emacron=444,e.gbreve=500,e.onequarter=750,e.Scaron=556,e.Scommaaccent=556,e.Ohungarumlaut=722,e.degree=400,e.ograve=500,e.Ccaron=667,e.ugrave=556,e.radical=549,e.Dcaron=722,e.rcommaaccent=389,e.Ntilde=722,e.otilde=500,e.Rcommaaccent=667,e.Lcommaaccent=611,e.Atilde=667,e.Aogonek=667,e.Aring=667,e.Otilde=722,e.zdotaccent=389,e.Ecaron=667,e.Iogonek=389,e.kcommaaccent=500,e.minus=606,e.Icircumflex=389,e.ncaron=556,e.tcommaaccent=278,e.logicalnot=606,e.odieresis=500,e.udieresis=556,e.notequal=549,e.gcommaaccent=500,e.eth=500,e.zcaron=389,e.ncommaaccent=556,e.onesuperior=300,e.imacron=278,e.Euro=500}),e[`Times-Italic`]=sr(function(e){e.space=250,e.exclam=333,e.quotedbl=420,e.numbersign=500,e.dollar=500,e.percent=833,e.ampersand=778,e.quoteright=333,e.parenleft=333,e.parenright=333,e.asterisk=500,e.plus=675,e.comma=250,e.hyphen=333,e.period=250,e.slash=278,e.zero=500,e.one=500,e.two=500,e.three=500,e.four=500,e.five=500,e.six=500,e.seven=500,e.eight=500,e.nine=500,e.colon=333,e.semicolon=333,e.less=675,e.equal=675,e.greater=675,e.question=500,e.at=920,e.A=611,e.B=611,e.C=667,e.D=722,e.E=611,e.F=611,e.G=722,e.H=722,e.I=333,e.J=444,e.K=667,e.L=556,e.M=833,e.N=667,e.O=722,e.P=611,e.Q=722,e.R=611,e.S=500,e.T=556,e.U=722,e.V=611,e.W=833,e.X=611,e.Y=556,e.Z=556,e.bracketleft=389,e.backslash=278,e.bracketright=389,e.asciicircum=422,e.underscore=500,e.quoteleft=333,e.a=500,e.b=500,e.c=444,e.d=500,e.e=444,e.f=278,e.g=500,e.h=500,e.i=278,e.j=278,e.k=444,e.l=278,e.m=722,e.n=500,e.o=500,e.p=500,e.q=500,e.r=389,e.s=389,e.t=278,e.u=500,e.v=444,e.w=667,e.x=444,e.y=444,e.z=389,e.braceleft=400,e.bar=275,e.braceright=400,e.asciitilde=541,e.exclamdown=389,e.cent=500,e.sterling=500,e.fraction=167,e.yen=500,e.florin=500,e.section=500,e.currency=500,e.quotesingle=214,e.quotedblleft=556,e.guillemotleft=500,e.guilsinglleft=333,e.guilsinglright=333,e.fi=500,e.fl=500,e.endash=500,e.dagger=500,e.daggerdbl=500,e.periodcentered=250,e.paragraph=523,e.bullet=350,e.quotesinglbase=333,e.quotedblbase=556,e.quotedblright=556,e.guillemotright=500,e.ellipsis=889,e.perthousand=1e3,e.questiondown=500,e.grave=333,e.acute=333,e.circumflex=333,e.tilde=333,e.macron=333,e.breve=333,e.dotaccent=333,e.dieresis=333,e.ring=333,e.cedilla=333,e.hungarumlaut=333,e.ogonek=333,e.caron=333,e.emdash=889,e.AE=889,e.ordfeminine=276,e.Lslash=556,e.Oslash=722,e.OE=944,e.ordmasculine=310,e.ae=667,e.dotlessi=278,e.lslash=278,e.oslash=500,e.oe=667,e.germandbls=500,e.Idieresis=333,e.eacute=444,e.abreve=500,e.uhungarumlaut=500,e.ecaron=444,e.Ydieresis=556,e.divide=675,e.Yacute=556,e.Acircumflex=611,e.aacute=500,e.Ucircumflex=722,e.yacute=444,e.scommaaccent=389,e.ecircumflex=444,e.Uring=722,e.Udieresis=722,e.aogonek=500,e.Uacute=722,e.uogonek=500,e.Edieresis=611,e.Dcroat=722,e.commaaccent=250,e.copyright=760,e.Emacron=611,e.ccaron=444,e.aring=500,e.Ncommaaccent=667,e.lacute=278,e.agrave=500,e.Tcommaaccent=556,e.Cacute=667,e.atilde=500,e.Edotaccent=611,e.scaron=389,e.scedilla=389,e.iacute=278,e.lozenge=471,e.Rcaron=611,e.Gcommaaccent=722,e.ucircumflex=500,e.acircumflex=500,e.Amacron=611,e.rcaron=389,e.ccedilla=444,e.Zdotaccent=556,e.Thorn=611,e.Omacron=722,e.Racute=611,e.Sacute=500,e.dcaron=544,e.Umacron=722,e.uring=500,e.threesuperior=300,e.Ograve=722,e.Agrave=611,e.Abreve=611,e.multiply=675,e.uacute=500,e.Tcaron=556,e.partialdiff=476,e.ydieresis=444,e.Nacute=667,e.icircumflex=278,e.Ecircumflex=611,e.adieresis=500,e.edieresis=444,e.cacute=444,e.nacute=500,e.umacron=500,e.Ncaron=667,e.Iacute=333,e.plusminus=675,e.brokenbar=275,e.registered=760,e.Gbreve=722,e.Idotaccent=333,e.summation=600,e.Egrave=611,e.racute=389,e.omacron=500,e.Zacute=556,e.Zcaron=556,e.greaterequal=549,e.Eth=722,e.Ccedilla=667,e.lcommaaccent=278,e.tcaron=300,e.eogonek=444,e.Uogonek=722,e.Aacute=611,e.Adieresis=611,e.egrave=444,e.zacute=389,e.iogonek=278,e.Oacute=722,e.oacute=500,e.amacron=500,e.sacute=389,e.idieresis=278,e.Ocircumflex=722,e.Ugrave=722,e.Delta=612,e.thorn=500,e.twosuperior=300,e.Odieresis=722,e.mu=500,e.igrave=278,e.ohungarumlaut=500,e.Eogonek=611,e.dcroat=500,e.threequarters=750,e.Scedilla=500,e.lcaron=300,e.Kcommaaccent=667,e.Lacute=556,e.trademark=980,e.edotaccent=444,e.Igrave=333,e.Imacron=333,e.Lcaron=611,e.onehalf=750,e.lessequal=549,e.ocircumflex=500,e.ntilde=500,e.Uhungarumlaut=722,e.Eacute=611,e.emacron=444,e.gbreve=500,e.onequarter=750,e.Scaron=500,e.Scommaaccent=500,e.Ohungarumlaut=722,e.degree=400,e.ograve=500,e.Ccaron=667,e.ugrave=500,e.radical=453,e.Dcaron=722,e.rcommaaccent=389,e.Ntilde=667,e.otilde=500,e.Rcommaaccent=611,e.Lcommaaccent=556,e.Atilde=611,e.Aogonek=611,e.Aring=611,e.Otilde=722,e.zdotaccent=389,e.Ecaron=611,e.Iogonek=333,e.kcommaaccent=444,e.minus=675,e.Icircumflex=333,e.ncaron=500,e.tcommaaccent=278,e.logicalnot=675,e.odieresis=500,e.udieresis=500,e.notequal=549,e.gcommaaccent=500,e.eth=500,e.zcaron=389,e.ncommaaccent=500,e.onesuperior=300,e.imacron=278,e.Euro=500}),e.ZapfDingbats=sr(function(e){e.space=278,e.a1=974,e.a2=961,e.a202=974,e.a3=980,e.a4=719,e.a5=789,e.a119=790,e.a118=791,e.a117=690,e.a11=960,e.a12=939,e.a13=549,e.a14=855,e.a15=911,e.a16=933,e.a105=911,e.a17=945,e.a18=974,e.a19=755,e.a20=846,e.a21=762,e.a22=761,e.a23=571,e.a24=677,e.a25=763,e.a26=760,e.a27=759,e.a28=754,e.a6=494,e.a7=552,e.a8=537,e.a9=577,e.a10=692,e.a29=786,e.a30=788,e.a31=788,e.a32=790,e.a33=793,e.a34=794,e.a35=816,e.a36=823,e.a37=789,e.a38=841,e.a39=823,e.a40=833,e.a41=816,e.a42=831,e.a43=923,e.a44=744,e.a45=723,e.a46=749,e.a47=790,e.a48=792,e.a49=695,e.a50=776,e.a51=768,e.a52=792,e.a53=759,e.a54=707,e.a55=708,e.a56=682,e.a57=701,e.a58=826,e.a59=815,e.a60=789,e.a61=789,e.a62=707,e.a63=687,e.a64=696,e.a65=689,e.a66=786,e.a67=787,e.a68=713,e.a69=791,e.a70=785,e.a71=791,e.a72=873,e.a73=761,e.a74=762,e.a203=762,e.a75=759,e.a204=759,e.a76=892,e.a77=892,e.a78=788,e.a79=784,e.a81=438,e.a82=138,e.a83=277,e.a84=415,e.a97=392,e.a98=392,e.a99=668,e.a100=668,e.a89=390,e.a90=390,e.a93=317,e.a94=317,e.a91=276,e.a92=276,e.a205=509,e.a85=509,e.a206=410,e.a86=410,e.a87=234,e.a88=234,e.a95=334,e.a96=334,e.a101=732,e.a102=544,e.a103=544,e.a104=910,e.a106=667,e.a107=760,e.a108=760,e.a112=776,e.a111=595,e.a110=694,e.a109=626,e.a120=788,e.a121=788,e.a122=788,e.a123=788,e.a124=788,e.a125=788,e.a126=788,e.a127=788,e.a128=788,e.a129=788,e.a130=788,e.a131=788,e.a132=788,e.a133=788,e.a134=788,e.a135=788,e.a136=788,e.a137=788,e.a138=788,e.a139=788,e.a140=788,e.a141=788,e.a142=788,e.a143=788,e.a144=788,e.a145=788,e.a146=788,e.a147=788,e.a148=788,e.a149=788,e.a150=788,e.a151=788,e.a152=788,e.a153=788,e.a154=788,e.a155=788,e.a156=788,e.a157=788,e.a158=788,e.a159=788,e.a160=894,e.a161=838,e.a163=1016,e.a164=458,e.a196=748,e.a165=924,e.a192=748,e.a166=918,e.a167=927,e.a168=928,e.a169=928,e.a170=834,e.a171=873,e.a172=828,e.a173=924,e.a162=924,e.a174=917,e.a175=930,e.a176=931,e.a177=463,e.a178=883,e.a179=836,e.a193=836,e.a180=867,e.a199=867,e.a181=696,e.a200=696,e.a182=874,e.a201=874,e.a183=760,e.a184=946,e.a197=771,e.a185=865,e.a194=771,e.a198=888,e.a186=967,e.a195=888,e.a187=831,e.a188=873,e.a189=927,e.a190=970,e.a191=918})}),tc=sr(function(e){e.Courier={ascent:629,descent:-157,capHeight:562,xHeight:-426},e[`Courier-Bold`]={ascent:629,descent:-157,capHeight:562,xHeight:439},e[`Courier-Oblique`]={ascent:629,descent:-157,capHeight:562,xHeight:426},e[`Courier-BoldOblique`]={ascent:629,descent:-157,capHeight:562,xHeight:426},e.Helvetica={ascent:718,descent:-207,capHeight:718,xHeight:523},e[`Helvetica-Bold`]={ascent:718,descent:-207,capHeight:718,xHeight:532},e[`Helvetica-Oblique`]={ascent:718,descent:-207,capHeight:718,xHeight:523},e[`Helvetica-BoldOblique`]={ascent:718,descent:-207,capHeight:718,xHeight:532},e[`Times-Roman`]={ascent:683,descent:-217,capHeight:662,xHeight:450},e[`Times-Bold`]={ascent:683,descent:-217,capHeight:676,xHeight:461},e[`Times-Italic`]={ascent:683,descent:-217,capHeight:653,xHeight:441},e[`Times-BoldItalic`]={ascent:683,descent:-217,capHeight:669,xHeight:462},e.Symbol={ascent:Math.NaN,descent:Math.NaN,capHeight:Math.NaN,xHeight:Math.NaN},e.ZapfDingbats={ascent:Math.NaN,descent:Math.NaN,capHeight:Math.NaN,xHeight:Math.NaN}}),nc=class{constructor({glyfTable:e,isGlyphLocationsLong:t,locaTable:n,numGlyphs:r}){this.glyphs=[];let i=new DataView(n.buffer,n.byteOffset,n.byteLength),a=new DataView(e.buffer,e.byteOffset,e.byteLength),o=t?4:2,s=t?i.getUint32(0):2*i.getUint16(0),c=0;for(let e=0;e<r;e++){c+=o;let e=t?i.getUint32(c):2*i.getUint16(c);if(e===s){this.glyphs.push(new rc({}));continue}let n=rc.parse(s,a);this.glyphs.push(n),s=e}}getSize(){return Math.sumPrecise(this.glyphs.map(e=>e.getSize()+3&-4))}write(){let e=this.getSize(),t=new DataView(new ArrayBuffer(e)),n=e>131070,r=n?4:2,i=new DataView(new ArrayBuffer((this.glyphs.length+1)*r));n?i.setUint32(0,0):i.setUint16(0,0);let a=0,o=0;for(let e of this.glyphs)a+=e.write(a,t),a=a+3&-4,o+=r,n?i.setUint32(o,a):i.setUint16(o,a>>1);return{isLocationLong:n,loca:new Uint8Array(i.buffer),glyf:new Uint8Array(t.buffer)}}scale(e){for(let t=0,n=this.glyphs.length;t<n;t++)this.glyphs[t].scale(e[t])}},rc=class e{constructor({header:e=null,simple:t=null,composites:n=null}){this.header=e,this.simple=t,this.composites=n}static parse(t,n){let[r,i]=ic.parse(t,n);if(t+=r,i.numberOfContours<0){let r=[];for(;;){let[e,i]=sc.parse(t,n);if(t+=e,r.push(i),!(32&i.flags))break}return new e({header:i,composites:r})}return new e({header:i,simple:oc.parse(t,n,i.numberOfContours)})}getSize(){if(!this.header)return 0;let e=this.simple?this.simple.getSize():Math.sumPrecise(this.composites.map(e=>e.getSize()));return this.header.getSize()+e}write(e,t){if(!this.header)return 0;let n=e;if(e+=this.header.write(e,t),this.simple)e+=this.simple.write(e,t);else for(let n of this.composites)e+=n.write(e,t);return e-n}scale(e){if(!this.header)return;let t=(this.header.xMin+this.header.xMax)/2;if(this.header.scale(t,e),this.simple)this.simple.scale(t,e);else for(let n of this.composites)n.scale(t,e)}},ic=class e{constructor({numberOfContours:e,xMin:t,yMin:n,xMax:r,yMax:i}){this.numberOfContours=e,this.xMin=t,this.yMin=n,this.xMax=r,this.yMax=i}static parse(t,n){return[10,new e({numberOfContours:n.getInt16(t),xMin:n.getInt16(t+2),yMin:n.getInt16(t+4),xMax:n.getInt16(t+6),yMax:n.getInt16(t+8)})]}getSize(){return 10}write(e,t){return t.setInt16(e,this.numberOfContours),t.setInt16(e+2,this.xMin),t.setInt16(e+4,this.yMin),t.setInt16(e+6,this.xMax),t.setInt16(e+8,this.yMax),10}scale(e,t){this.xMin=Math.round(e+(this.xMin-e)*t),this.xMax=Math.round(e+(this.xMax-e)*t)}},ac=class{constructor({flags:e,xCoordinates:t,yCoordinates:n}){this.xCoordinates=t,this.yCoordinates=n,this.flags=e}},oc=class e{constructor({contours:e,instructions:t}){this.contours=e,this.instructions=t}static parse(t,n,r){let i=[];for(let e=0;e<r;e++){let e=n.getUint16(t);t+=2,i.push(e)}let a=i[r-1]+1,o=n.getUint16(t);t+=2;let s=new Uint8Array(n).slice(t,t+o);t+=o;let c=[];for(let e=0;e<a;t++,e++){let r=n.getUint8(t);if(c.push(r),8&r){let i=n.getUint8(++t);r^=8;for(let e=0;e<i;e++)c.push(r);e+=i}}let l=[],u=[],d=[],f=[],p=[],m=0,h=0;for(let e=0;e<a;e++){let r=c[e];if(2&r){let e=n.getUint8(t++);h+=16&r?e:-e,u.push(h)}else 16&r||(h+=n.getInt16(t),t+=2),u.push(h);i[m]===e&&(m++,l.push(u),u=[])}h=0,m=0;for(let e=0;e<a;e++){let r=c[e];if(4&r){let e=n.getUint8(t++);h+=32&r?e:-e,d.push(h)}else 32&r||(h+=n.getInt16(t),t+=2),d.push(h);f.push(1&r|64&r),i[m]===e&&(u=l[m],m++,p.push(new ac({flags:f,xCoordinates:u,yCoordinates:d})),d=[],f=[])}return new e({contours:p,instructions:s})}getSize(){let e=2*this.contours.length+2+this.instructions.length,t=0,n=0;for(let r of this.contours){e+=r.flags.length;for(let i=0,a=r.xCoordinates.length;i<a;i++){let a=r.xCoordinates[i],o=r.yCoordinates[i],s=Math.abs(a-t);s>255?e+=2:s>0&&(e+=1),t=a,s=Math.abs(o-n),s>255?e+=2:s>0&&(e+=1),n=o}}return e}write(e,t){let n=e,r=[],i=[],a=[],o=0,s=0;for(let n of this.contours){for(let e=0,t=n.xCoordinates.length;e<t;e++){let t=n.flags[e],c=n.xCoordinates[e],l=c-o;if(l===0)t|=16,r.push(0);else{let e=Math.abs(l);e<=255?(t|=l>=0?18:2,r.push(e)):r.push(l)}o=c;let u=n.yCoordinates[e];if(l=u-s,l===0)t|=32,i.push(0);else{let e=Math.abs(l);e<=255?(t|=l>=0?36:4,i.push(e)):i.push(l)}s=u,a.push(t)}t.setUint16(e,r.length-1),e+=2}t.setUint16(e,this.instructions.length),e+=2,this.instructions.length&&(new Uint8Array(t.buffer,0,t.buffer.byteLength).set(this.instructions,e),e+=this.instructions.length);for(let n of a)t.setUint8(e++,n);for(let n=0,i=r.length;n<i;n++){let i=r[n],o=a[n];2&o?t.setUint8(e++,i):16&o||(t.setInt16(e,i),e+=2)}for(let n=0,r=i.length;n<r;n++){let r=i[n],o=a[n];4&o?t.setUint8(e++,r):32&o||(t.setInt16(e,r),e+=2)}return e-n}scale(e,t){for(let n of this.contours)if(n.xCoordinates.length!==0)for(let r=0,i=n.xCoordinates.length;r<i;r++)n.xCoordinates[r]=Math.round(e+(n.xCoordinates[r]-e)*t)}},sc=class e{constructor({flags:e,glyphIndex:t,argument1:n,argument2:r,transf:i,instructions:a}){this.flags=e,this.glyphIndex=t,this.argument1=n,this.argument2=r,this.transf=i,this.instructions=a}static parse(t,n){let r=t,i=[],a=n.getUint16(t),o=n.getUint16(t+2),s,c;t+=4,1&a?(2&a?(s=n.getInt16(t),c=n.getInt16(t+2)):(s=n.getUint16(t),c=n.getUint16(t+2)),t+=4,a^=1):(2&a?(s=n.getInt8(t),c=n.getInt8(t+1)):(s=n.getUint8(t),c=n.getUint8(t+1)),t+=2),8&a?(i.push(n.getUint16(t)),t+=2):64&a?(i.push(n.getUint16(t),n.getUint16(t+2)),t+=4):128&a&&(i.push(n.getUint16(t),n.getUint16(t+2),n.getUint16(t+4),n.getUint16(t+6)),t+=8);let l=null;if(256&a){let e=n.getUint16(t);t+=2,l=new Uint8Array(n).slice(t,t+e),t+=e}return[t-r,new e({flags:a,glyphIndex:o,argument1:s,argument2:c,transf:i,instructions:l})]}getSize(){let e=4+2*this.transf.length;return 256&this.flags&&(e+=2+this.instructions.length),e+=2,2&this.flags?this.argument1>=-128&&this.argument1<=127&&this.argument2>=-128&&this.argument2<=127||(e+=2):this.argument1>=0&&this.argument1<=255&&this.argument2>=0&&this.argument2<=255||(e+=2),e}write(e,t){let n=e;return 2&this.flags?this.argument1>=-128&&this.argument1<=127&&this.argument2>=-128&&this.argument2<=127||(this.flags|=1):this.argument1>=0&&this.argument1<=255&&this.argument2>=0&&this.argument2<=255||(this.flags|=1),t.setUint16(e,this.flags),t.setUint16(e+2,this.glyphIndex),e+=4,1&this.flags?(2&this.flags?(t.setInt16(e,this.argument1),t.setInt16(e+2,this.argument2)):(t.setUint16(e,this.argument1),t.setUint16(e+2,this.argument2)),e+=4):(t.setUint8(e,this.argument1),t.setUint8(e+1,this.argument2),e+=2),256&this.flags&&(t.setUint16(e,this.instructions.length),e+=2,this.instructions.length&&(new Uint8Array(t.buffer,0,t.buffer.byteLength).set(this.instructions,e),e+=this.instructions.length)),e-n}scale(e,t){}};function cc(e,t,n){e[t]=n>>8&255,e[t+1]=255&n}function lc(e,t,n){e[t]=n>>24&255,e[t+1]=n>>16&255,e[t+2]=n>>8&255,e[t+3]=255&n}function uc(e,t,n){if(n instanceof Uint8Array)e.set(n,t);else if(typeof n==`string`)for(let r=0,i=n.length;r<i;r++)e[t++]=255&n.charCodeAt(r);else for(let r of n)e[t++]=255&r}var dc=class e{constructor(e){this.sfnt=e,this.tables=Object.create(null)}static getSearchParams(e,t){let n=1,r=0;for(;(n^e)>n;)n<<=1,r++;let i=n*t;return{range:i,entry:r,rangeShift:t*e-i}}toArray(){let t=this.sfnt,n=this.tables,r=Object.keys(n);r.sort();let i=r.length,a,o,s,c,l,u=12+16*i,d=[u];for(a=0;a<i;a++)c=n[r[a]],u+=(c.length+3&-4)>>>0,d.push(u);let f=new Uint8Array(u);for(a=0;a<i;a++)c=n[r[a]],uc(f,d[a],c);t===`true`&&(t=Dn(65536)),f[0]=255&t.charCodeAt(0),f[1]=255&t.charCodeAt(1),f[2]=255&t.charCodeAt(2),f[3]=255&t.charCodeAt(3),cc(f,4,i);let p=e.getSearchParams(i,16);for(cc(f,6,p.range),cc(f,8,p.entry),cc(f,10,p.rangeShift),u=12,a=0;a<i;a++){l=r[a],f[u]=255&l.charCodeAt(0),f[u+1]=255&l.charCodeAt(1),f[u+2]=255&l.charCodeAt(2),f[u+3]=255&l.charCodeAt(3);let e=0;for(o=d[a],s=d[a+1];o<s;o+=4)e=e+xr(f,o)>>>0;lc(f,u+4,e),lc(f,u+8,d[a]),lc(f,u+12,n[l].length),u+=16}return f}addTable(e,t){if(e in this.tables)throw Error(`Table `+e+` already exists`);this.tables[e]=t}},fc=[4],pc=[5],mc=[6],hc=[7],gc=[8],_c=[12,35],vc=[14],yc=[21],bc=[22],xc=[30],Sc=[31],Cc=class{constructor(){this.width=0,this.lsb=0,this.flexing=!1,this.output=[],this.stack=[]}convert(e,t,n){let r=e.length,i,a,o,s=!1;for(let c=0;c<r;c++){let r=e[c];if(r<32){switch(r===12&&(r=(r<<8)+e[++c]),r){case 1:case 3:case 9:case 3072:case 3073:case 3074:case 3105:this.stack=[];break;case 4:if(this.flexing){if(this.stack.length<1){s=!0;break}let e=this.stack.pop();this.stack.push(0,e);break}s=this.executeCommand(1,fc);break;case 5:s=this.executeCommand(2,pc);break;case 6:s=this.executeCommand(1,mc);break;case 7:s=this.executeCommand(1,hc);break;case 8:s=this.executeCommand(6,gc);break;case 10:if(this.stack.length<1){s=!0;break}if(o=this.stack.pop(),!t[o]){s=!0;break}s=this.convert(t[o],t,n);break;case 11:return s;case 13:if(this.stack.length<2){s=!0;break}i=this.stack.pop(),a=this.stack.pop(),this.lsb=a,this.width=i,this.stack.push(i,a),s=this.executeCommand(2,bc);break;case 14:this.output.push(vc[0]);break;case 21:if(this.flexing)break;s=this.executeCommand(2,yc);break;case 22:if(this.flexing){this.stack.push(0);break}s=this.executeCommand(1,bc);break;case 30:s=this.executeCommand(4,xc);break;case 31:s=this.executeCommand(4,Sc);break;case 3078:if(n){let e=this.stack.at(-5);this.seac=this.stack.splice(-4,4),this.seac[0]+=this.lsb-e,s=this.executeCommand(0,vc)}else s=this.executeCommand(4,vc);break;case 3079:if(this.stack.length<4){s=!0;break}this.stack.pop(),i=this.stack.pop();let e=this.stack.pop();a=this.stack.pop(),this.lsb=a,this.width=i,this.stack.push(i,a,e),s=this.executeCommand(3,yc);break;case 3084:if(this.stack.length<2){s=!0;break}let c=this.stack.pop(),l=this.stack.pop();this.stack.push(l/c);break;case 3088:if(this.stack.length<2){s=!0;break}o=this.stack.pop();let u=this.stack.pop();if(o===0&&u===3){let e=this.stack.splice(-17,17);this.stack.push(e[2]+e[0],e[3]+e[1],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14]),s=this.executeCommand(13,_c,!0),this.flexing=!1,this.stack.push(e[15],e[16])}else o===1&&u===0&&(this.flexing=!0);break;case 3089:break;default:N(`Unknown type 1 charstring command of "`+r+`"`)}if(s)break}else r<=246?r-=139:r=r<=250?256*(r-247)+e[++c]+108:r<=254?-256*(r-251)-e[++c]-108:(255&e[++c])<<24|(255&e[++c])<<16|(255&e[++c])<<8|255&e[++c],this.stack.push(r)}return s}executeCommand(e,t,n){let r=this.stack.length;if(e>r)return!0;let i=r-e;for(let e=i;e<r;e++){let t=this.stack[e];Number.isInteger(t)?this.output.push(28,t>>8&255,255&t):(t=65536*t|0,this.output.push(255,t>>24&255,t>>16&255,t>>8&255,255&t))}return this.output.push(...t),n?this.stack.splice(i,e):this.stack.length=0,!1}};function wc(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function Tc(e,t,n){if(n>=e.length)return new Uint8Array;let r,i,a=0|t;for(r=0;r<n;r++)a=52845*(e[r]+a)+22719&65535;let o=e.length-n,s=new Uint8Array(o);for(r=n,i=0;i<o;r++,i++){let t=e[r];s[i]=t^a>>8,a=52845*(t+a)+22719&65535}return s}function Ec(e){return e===47||e===91||e===93||e===123||e===125||e===40||e===41}var Dc=class{constructor(e,t,n){if(t){let t=e.getBytes();e=new gi((wc(t[0])||Sr(t[0]))&&wc(t[1])&&wc(t[2])&&wc(t[3])&&wc(t[4])&&wc(t[5])&&wc(t[6])&&wc(t[7])?function(e,t,n){let r=0|t,i=e.length,a=new Uint8Array(i>>>1),o,s;for(o=0,s=0;o<i;o++){let t=e[o];if(!wc(t))continue;let n;for(o++;o<i&&!wc(n=e[o]);)o++;if(o<i){let e=parseInt(String.fromCharCode(t,n),16);a[s++]=e^r>>8,r=52845*(e+r)+22719&65535}}return a.slice(n,s)}(t,55665,4):Tc(t,55665,4))}this.seacAnalysisEnabled=!!n,this.stream=e,this.nextChar()}readNumberArray(){this.getToken();let e=[];for(;;){let t=this.getToken();if(t===null||t===`]`||t===`}`)break;e.push(parseFloat(t||0))}return e}readNumber(){let e=this.getToken();return parseFloat(e||0)}readInt(){let e=this.getToken();return 0|parseInt(e||0,10)}readBoolean(){return+(this.getToken()===`true`)}nextChar(){return this.currentChar=this.stream.getByte()}prevChar(){return this.stream.skip(-2),this.currentChar=this.stream.getByte()}getToken(){let e=!1,t=this.currentChar;for(;;){if(t===-1)return null;if(e)t!==10&&t!==13||(e=!1);else if(t===37)e=!0;else if(!Sr(t))break;t=this.nextChar()}if(Ec(t))return this.nextChar(),String.fromCharCode(t);let n=``;do n+=String.fromCharCode(t),t=this.nextChar();while(t>=0&&!Sr(t)&&!Ec(t));return n}readCharStrings(e,t){return t===-1?e:Tc(e,4330,t)}extractFontProgram(e){let t=this.stream,n=[],r=[],i=Object.create(null);i.lenIV=4;let a={subrs:[],charstrings:[],properties:{privateData:i}},o,s,c,l;for(;(o=this.getToken())!==null;)if(o===`/`)switch(o=this.getToken(),o){case`CharStrings`:for(this.getToken(),this.getToken(),this.getToken(),this.getToken();o=this.getToken(),o!==null&&o!==`end`;){if(o!==`/`)continue;let e=this.getToken();s=this.readInt(),this.getToken(),c=s>0?t.getBytes(s):new Uint8Array,l=a.properties.privateData.lenIV;let n=this.readCharStrings(c,l);this.nextChar(),o=this.getToken(),o===`noaccess`?this.getToken():o===`/`&&this.prevChar(),r.push({glyph:e,encoded:n})}break;case`Subrs`:for(this.readInt(),this.getToken();this.getToken()===`dup`;){let e=this.readInt();s=this.readInt(),this.getToken(),c=s>0?t.getBytes(s):new Uint8Array,l=a.properties.privateData.lenIV;let r=this.readCharStrings(c,l);this.nextChar(),o=this.getToken(),o===`noaccess`&&this.getToken(),n[e]=r}break;case`BlueValues`:case`OtherBlues`:case`FamilyBlues`:case`FamilyOtherBlues`:let e=this.readNumberArray();e.length>0&&e.length;break;case`StemSnapH`:case`StemSnapV`:a.properties.privateData[o]=this.readNumberArray();break;case`StdHW`:case`StdVW`:a.properties.privateData[o]=this.readNumberArray()[0];break;case`BlueShift`:case`lenIV`:case`BlueFuzz`:case`BlueScale`:case`LanguageGroup`:a.properties.privateData[o]=this.readNumber();break;case`ExpansionFactor`:a.properties.privateData[o]=this.readNumber()||.06;break;case`ForceBold`:a.properties.privateData[o]=this.readBoolean()}for(let{encoded:t,glyph:i}of r){let r=new Cc,o=r.convert(t,n,this.seacAnalysisEnabled),s=r.output;o&&(s=[14]);let c={glyphName:i,charstring:s,width:r.width,lsb:r.lsb,seac:r.seac};if(i===`.notdef`?a.charstrings.unshift(c):a.charstrings.push(c),e.builtInEncoding){let t=e.builtInEncoding.indexOf(i);t>-1&&e.widths[t]===void 0&&t>=e.firstChar&&t<=e.lastChar&&(e.widths[t]=r.width)}}return a}extractFontHeader(e){let t;for(;(t=this.getToken())!==null;)if(t===`/`)switch(t=this.getToken(),t){case`FontMatrix`:e.fontMatrix=this.readNumberArray();break;case`Encoding`:let n=this.getToken(),r;if(/^\d+$/.test(n)){r=[];let e=0|parseInt(n,10);this.getToken();for(let n=0;n<e;n++){for(t=this.getToken();t!==`dup`&&t!==`def`;)if(t=this.getToken(),t===null)return;if(t===`def`)break;let e=this.readInt();this.getToken();let n=this.getToken();r[e]=n,this.getToken()}}else r=Vo(n);e.builtInEncoding=r;break;case`FontBBox`:let i=this.readNumberArray();e.ascent=Math.max(i[3],i[1]),e.descent=Math.min(i[1],i[3]),e.ascentScaled=!0}}};function Oc(e,t,n){let r=e.length,i=t.length,a=r-i,o=n,s=!1;for(;o<a;){let n=0;for(;n<i&&e[o+n]===t[n];)n++;if(n>=i){for(o+=n;o<r&&Sr(e[o]);)o++;s=!0;break}o++}return{found:s,length:o}}var kc=class{constructor(e,t,n){let r=n.length1;n.length2;let i=t.peekBytes(6),a=i[0]===128&&i[1]===1;a&&(t.skip(6),r=i[5]<<24|i[4]<<16|i[3]<<8|i[2]),new Dc(function(e,t){let n=[101,101,120,101,99],r=e.pos,i,a,o,s;try{i=e.getBytes(t),a=i.length}catch{}if(a===t&&(o=Oc(i,n,t-2*n.length),o.found&&o.length===t))return{stream:new gi(i),length:t};for(N(`Invalid "Length1" property in Type1 font -- trying to recover.`),e.pos=r;o=Oc(e.peekBytes(2048),n,0),o.length!==0;)if(e.pos+=o.length,o.found){s=e.pos-r;break}return e.pos=r,s?{stream:new gi(e.getBytes(s)),length:s}:(N(`Unable to recover "Length1" property in Type1 font -- using as is.`),{stream:new gi(e.getBytes(t)),length:t})}(t,r).stream,!1,Xo).extractFontHeader(n),a&&(i=t.getBytes(6),i[5],i[4],i[3],i[2]);let o=new Dc(function(e){let t=e.getBytes();if(t.length===0)throw new F(`getEexecBlock - no font program found.`);return{stream:new gi(t),length:t.length}}(t).stream,!0,Xo).extractFontProgram(n);for(let e in o.properties)n[e]=o.properties[e];let s=o.charstrings,c=this.getType2Charstrings(s),l=this.getType2Subrs(o.subrs);this.charstrings=s,this.data=this.wrap(e,c,this.charstrings,l,n),this.seacs=this.getSeacs(o.charstrings)}get numGlyphs(){return this.charstrings.length+1}getCharset(){let e=[`.notdef`];for(let{glyphName:t}of this.charstrings)e.push(t);return e}getGlyphMapping(e){let t=this.charstrings;if(e.composite){let n=Object.create(null);for(let r=0,i=t.length;r<i;r++)n[e.cMap.charCodeOf(r)]=r+1;return n}let n=[`.notdef`],r,i;for(i=0;i<t.length;i++)n.push(t[i].glyphName);let a=e.builtInEncoding;if(a){r=Object.create(null);for(let e in a)i=n.indexOf(a[e]),i>=0&&(r[e]=i)}return rs(e,r,n)}hasGlyphId(e){return e<0||e>=this.numGlyphs?!1:e===0?!0:this.charstrings[e-1].charstring.length>0}getSeacs(e){let t=[];for(let n=0,r=e.length;n<r;n++){let r=e[n];r.seac&&(t[n+1]=r.seac)}return t}getType2Charstrings(e){let t=[];for(let n of e)t.push(n.charstring);return t}getType2Subrs(e){let t=0,n=e.length;t=n<1133?107:n<33769?1131:32768;let r=[],i;for(i=0;i<t;i++)r.push([11]);for(i=0;i<n;i++)r.push(e[i]);return r}wrap(e,t,n,r,i){let a=new ms;a.header=new hs(1,0,4,4),a.names=[e];let o=new bs;o.setByName(`version`,391),o.setByName(`Notice`,392),o.setByName(`FullName`,393),o.setByName(`FamilyName`,394),o.setByName(`Weight`,395),o.setByName(`Encoding`,null),o.setByName(`FontMatrix`,i.fontMatrix),o.setByName(`FontBBox`,i.bbox),o.setByName(`charset`,null),o.setByName(`CharStrings`,null),o.setByName(`Private`,null),a.topDict=o;let s=new gs;s.add(`Version 0.11`),s.add(`See original notice`),s.add(e),s.add(e),s.add(`Medium`),a.strings=s,a.globalSubrIndex=new _s;let c=t.length,l=[`.notdef`],u,d;for(u=0;u<c;u++){let e=n[u].glyphName;ls.indexOf(e)===-1&&s.add(e),l.push(e)}a.charset=new ws(!1,0,l);let f=new _s;for(f.add([139,14]),u=0;u<c;u++)f.add(t[u]);a.charStrings=f;let p=new Ss;p.setByName(`Subrs`,null);let m=[`BlueValues`,`OtherBlues`,`FamilyBlues`,`FamilyOtherBlues`,`StemSnapH`,`StemSnapV`,`BlueShift`,`BlueFuzz`,`BlueScale`,`LanguageGroup`,`ExpansionFactor`,`ForceBold`,`StdHW`,`StdVW`];for(u=0,d=m.length;u<d;u++){let e=m[u];if(!(e in i.privateData))continue;let t=i.privateData[e];if(Array.isArray(t))for(let e=t.length-1;e>0;e--)t[e]-=t[e-1];p.setByName(e,t)}a.topDict.privateDict=p;let h=new _s;for(u=0,d=r.length;u<d;u++)h.add(r[u]);return p.subrsIndex=h,new Os(a).compile()}},Ac=[[57344,63743],[1048576,1114109]],jc=1e3,Mc=[`ascent`,`bbox`,`black`,`bold`,`charProcOperatorList`,`cssFontInfo`,`data`,`defaultVMetrics`,`defaultWidth`,`descent`,`disableFontFace`,`fallbackName`,`fontExtraProperties`,`fontMatrix`,`isInvalidPDFjsFont`,`isType3Font`,`italic`,`loadedName`,`mimetype`,`missingFile`,`name`,`remeasure`,`systemFontInfo`,`vertical`],Nc=[`cMap`,`composite`,`defaultEncoding`,`differences`,`isMonospace`,`isSerifFont`,`isSymbolicFont`,`seacMap`,`subtype`,`toFontChar`,`toUnicode`,`type`,`vmetrics`,`widths`];function Pc(e){if(!e.fontMatrix||e.fontMatrix[0]===n[0])return;let t=.001/e.fontMatrix[0],r=e.widths;for(let e in r)r[e]*=t;e.defaultWidth*=t}function Fc(e){if(!e.fallbackToUnicode||e.toUnicode instanceof Bs)return;let t=[];for(let n in e.fallbackToUnicode)e.toUnicode.has(n)||(t[n]=e.fallbackToUnicode[n]);t.length>0&&e.toUnicode.amend(t)}var Ic=class{constructor(e,t,n,r,i,a,o,s,c){this.originalCharCode=e,this.fontChar=t,this.unicode=n,this.accent=r,this.width=i,this.vmetric=a,this.operatorListId=o,this.isSpace=s,this.isInFont=c}get category(){return P(this,`category`,function(e){let t=Yo.get(e);if(t)return t;let n=e.match(Jo),r={isWhitespace:!!n?.[1],isZeroWidthDiacritic:!!n?.[2],isInvisibleFormatMark:!!n?.[3]};return Yo.set(e,r),r}(this.unicode),!0)}};function Lc(e,t){return(e<<8)+t}function Rc(e,t,n){e[t+1]=n,e[t]=n>>>8}function zc(e,t){let n=(e<<8)+t;return 32768&n?n-65536:n}function Bc(e){return String.fromCharCode(e>>8&255,255&e)}function Vc(e){return e>32767?e=32767:e<-32768&&(e=-32768),String.fromCharCode(e>>8&255,255&e)}function Hc(e){return Tn(e.peekBytes(4))===`ttcf`}function Uc(e,{type:t,subtype:n,composite:r}){let i,a;return function(e){let t=e.peekBytes(4);return xr(t,0)===65536||Tn(t)===`true`}(e)||Hc(e)?i=r?`CIDFontType2`:`TrueType`:function(e){return Tn(e.peekBytes(4))===`OTTO`}(e)?i=r?`CIDFontType2`:`OpenType`:function(e){let t=e.peekBytes(2);return t[0]===37&&t[1]===33||t[0]===128&&t[1]===1}(e)?i=r?`CIDFontType0`:t===`MMType1`?`MMType1`:`Type1`:function(e){let t=e.peekBytes(4);return t[0]>=1&&t[3]>=1&&t[3]<=4}(e)?r?(i=`CIDFontType0`,a=`CIDFontType0C`):(i=t===`MMType1`?`MMType1`:`Type1`,a=`Type1C`):(N(`getFontFileType: Unable to detect correct font file Type/Subtype.`),i=t,a=n),[i,a]}function Wc(e,t){for(let n in t)e[+n]=t[n]}function Gc(e,t,n){let r=[],i;for(let n=0,a=e.length;n<a;n++)i=Go(e[n],t),i!==-1&&(r[n]=i);for(let e in n)i=Go(n[e],t),i!==-1&&(r[+e]=i);return r}function Kc(e){return e.platform===1&&e.encoding===0&&e.language===0}function qc(e){return e.platform===3&&e.encoding===1&&e.language===1033}function Jc(e,t,n=!1){switch(t.length){case 1:return t.charCodeAt(0);case 2:return t.charCodeAt(0)<<8|t.charCodeAt(1)}let r=`Unsupported CID string (charCode ${e}): "${t}".`;if(n)throw new F(r);return N(r),t}function Yc(e,t,n,r){let i=Object.create(null),a=new Map,o=[],s=new Set,c=0,l=Ac[c][0],u=Ac[c][1],d=e=>Ac[0][0]<=e&&e<=Ac[0][1]||Ac[1][0]<=e&&e<=Ac[1][1],f=null;for(let p in e){let m=e[p];if(!t(m))continue;if(l>u){if(c++,c>=Ac.length){N(`Ran out of space in font private use area.`);break}l=Ac[c][0],u=Ac[c][1]}let h=l++;m===0&&(m=n);let g=r.get(p);if(typeof g==`string`)if(g.length===1)g=g.codePointAt(0);else{if(!f){f=new Map;for(let e=64256;e<=64335;e++){let t=String.fromCharCode(e).normalize(`NFKD`);t.length>1&&f.set(t,e)}}g=f.get(g)||g.codePointAt(0)}!g||d(g)||s.has(m)||(a.set(g,m),s.add(m)),i[h]=m,o[p]=h}return{toFontChar:o,charCodeToGlyphId:i,toUnicodeExtraMap:a,nextAvailableFontCharCode:l}}function Xc(e,t,n){let r=function(e,t,n){let r=[];for(let t in e)e[t]>=n||r.push({fontCharCode:0|t,glyphId:e[t]});if(t)for(let[e,i]of t)i>=n||r.push({fontCharCode:e,glyphId:i});r.length===0&&r.push({fontCharCode:0,glyphId:0}),r.sort((e,t)=>e.fontCharCode-t.fontCharCode);let i=[],a=r.length;for(let e=0;e<a;){let t=r[e].fontCharCode,n=[r[e].glyphId];++e;let o=t;for(;e<a&&o+1===r[e].fontCharCode&&(n.push(r[e].glyphId),++o,++e,o!==65535););i.push([t,o,n])}return i}(e,t,n),i=r.at(-1)[1]>65535?2:1,a,o,s,c,l=`\0\0`+Bc(i)+`\0\0`+Dn(4+8*i);for(a=r.length-1;a>=0&&!(r[a][0]<=65535);--a);let u=a+1;r[a][0]<65535&&r[a][1]===65535&&(r[a][1]=65534);let d=+(r[a][1]<65535),f=u+d,p=dc.getSearchParams(f,2),m,h,g,_,v=``,y=``,b=``,x=``,S=``,C=0;for(a=0,o=u;a<o;a++){m=r[a],h=m[0],g=m[1],v+=Bc(h),y+=Bc(g),_=m[2];let e=!0;for(s=1,c=_.length;s<c;++s)if(_[s]!==_[s-1]+1){e=!1;break}if(e)b+=Bc(_[0]-h&65535),x+=Bc(0);else{let e=2*(f-a)+2*C;for(C+=g-h+1,b+=Bc(0),x+=Bc(e),s=0,c=_.length;s<c;++s)S+=Bc(_[s])}}d>0&&(y+=`ÿÿ`,v+=`ÿÿ`,b+=`\0`,x+=`\0\0`);let w=`\0\0`+Bc(2*f)+Bc(p.range)+Bc(p.entry)+Bc(p.rangeShift)+y+`\0\0`+v+b+x+S,T=``,E=``;if(i>1){for(l+=`\0\0
2
+ `?`\\n`:e===`\r`?`\\r`:`\\${e}`)}function Ar(e,t,n,r){if(!e)return;let i=null;if(e instanceof R){if(r.has(e))return;i=e,r.put(i),e=t.fetch(e)}if(Array.isArray(e))for(let i of e)Ar(i,t,n,r);else if(e instanceof L){if(Zn(e.get(`S`),`JavaScript`)){let t=e.get(`JS`),r;t instanceof tr?r=t.getString():typeof t==`string`&&(r=t),r&&=Nn(r,!0).replaceAll(`\0`,``),r&&n.push(r.trim())}Ar(e.getRaw(`Next`),t,n,r)}i&&r.remove(i)}function jr(e,t,n){let r=Object.create(null),i=mr({dict:t,key:`AA`,stopWhenFound:!1});if(i)for(let t=i.length-1;t>=0;t--){let a=i[t];if(a instanceof L)for(let t of a.getKeys()){let i=n[t];if(!i)continue;let o=[];Ar(a.getRaw(t),e,o,new Yn),o.length>0&&(r[i]=o)}}if(t.has(`A`)){let n=[];Ar(t.get(`A`),e,n,new Yn),n.length>0&&(r.Action=n)}return On(r)>0?r:null}var Mr={60:`&lt;`,62:`&gt;`,38:`&amp;`,34:`&quot;`,39:`&apos;`};function*Nr(e){for(let t=0,n=e.length;t<n;t++){let n=e.codePointAt(t);n>55295&&(n<57344||n>65533)&&t++,yield n}}function Pr(e){let t=[],n=0;for(let r=0,i=e.length;r<i;r++){let i=e.codePointAt(r);if(32<=i&&i<=126){let a=Mr[i];a&&(n<r&&t.push(e.substring(n,r)),t.push(a),n=r+1)}else n<r&&t.push(e.substring(n,r)),t.push(`&#x${i.toString(16).toUpperCase()};`),i>55295&&(i<57344||i>65533)&&r++,n=r+1}return t.length===0?e:(n<e.length&&t.push(e.substring(n,e.length)),t.join(``))}function Fr(e,t=!1){let n=/^("|').*("|')$/.exec(e);if(n&&n[1]===n[2]){if(RegExp(`[^\\\\]${n[1]}`).test(e.slice(1,-1)))return t&&N(`FontFamily contains unescaped ${n[1]}: ${e}.`),!1}else for(let n of e.split(/[ \t]+/))if(/^(\d|(-(\d|-)))/.test(n)||!/^[\w-\\]+$/.test(n))return t&&N(`FontFamily contains invalid <custom-ident>: ${e}.`),!1;return!0}function Ir(e){let t=new Set([`100`,`200`,`300`,`400`,`500`,`600`,`700`,`800`,`900`,`1000`,`normal`,`bold`,`bolder`,`lighter`]),{fontFamily:n,fontWeight:r,italicAngle:i}=e;if(!Fr(n,!0))return!1;let a=r?r.toString():``;e.fontWeight=t.has(a)?a:`400`;let o=parseFloat(i);return e.italicAngle=isNaN(o)||o<-90||o>90?`14`:i.toString(),!0}function Lr(e){let t=RegExp(`^\\s*(`+[`app.launchURL`,`window.open`,`xfa.host.gotoURL`].join(`|`).replaceAll(`.`,`\\.`)+`)\\((?:'|")([^'"]*)(?:'|")(?:,\\s*(\\w+)\\)|\\))`,`i`).exec(e);return t?.[2]?{url:t[2],newWindow:t[1]===`app.launchURL`&&t[3]===`true`}:null}function Rr(e){if(Number.isInteger(e))return e.toString();let t=Math.round(100*e);return t%100==0?(t/100).toString():t%10==0?e.toFixed(1):e.toFixed(2)}function zr(e){if(!e)return null;let t=new Map;for(let[n,r]of e){if(!n.startsWith(m))continue;let e=t.get(r.pageIndex);e||(e=[],t.set(r.pageIndex,e)),e.push(r)}return t.size>0?t:null}function Br(e){return e==null||function(e){return typeof e==`string`?!e||/^[\x00-\x7F]*$/.test(e):!1}(e)?e:Hr(e,!0)}function Vr(e){let t=[];for(let n=0,r=e.length;n<r;n++){let r=e.charCodeAt(n);t.push(An[r>>8&255],An[255&r])}return t.join(``)}function Hr(e,t=!1){let n=[];t&&n.push(`þÿ`);for(let t=0,r=e.length;t<r;t++){let r=e.charCodeAt(t);n.push(String.fromCharCode(r>>8&255),String.fromCharCode(255&r))}return n.join(``)}function Ur(e,t,n){switch(e){case 90:return[0,1,-1,0,t,0];case 180:return[-1,0,0,-1,t,n];case 270:return[0,-1,1,0,0,n];default:throw Error(`Invalid rotation`)}}function Wr(e){return Math.ceil(Math.ceil(Math.log2(1+e))/8)}var Gr=class{static#e=null;static _memory=null;static _mustAddAlpha=!1;static _destBuffer=null;static _destOffset=0;static _destLength=0;static _cssColor=``;static _makeHexColor=null;static get _memoryArray(){let e=this.#e;return e?.byteLength?e:this.#e=new Uint8Array(this._memory.buffer)}},Kr,qr=typeof TextDecoder<`u`?new TextDecoder(`utf-8`,{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error(`TextDecoder not available`)}};typeof TextDecoder<`u`&&qr.decode();var Jr=null;function Yr(){return Jr!==null&&Jr.byteLength!==0||(Jr=new Uint8Array(Kr.memory.buffer)),Jr}var Xr=0;function Zr(e,t){let n=t(1*e.length,1)>>>0;return Yr().set(e,n/1),Xr=e.length,n}var Qr=Object.freeze({RGB8:0,0:`RGB8`,RGBA8:1,1:`RGBA8`,BGRA8:2,2:`BGRA8`,Gray8:3,3:`Gray8`,GrayA8:4,4:`GrayA8`,CMYK:5,5:`CMYK`}),$r=Object.freeze({Perceptual:0,0:`Perceptual`,RelativeColorimetric:1,1:`RelativeColorimetric`,Saturation:2,2:`Saturation`,AbsoluteColorimetric:3,3:`AbsoluteColorimetric`});function ei(){let e={wbg:{}};return e.wbg.__wbg_copyresult_b08ee7d273f295dd=function(e,t){(function(e,t){let{_mustAddAlpha:n,_destBuffer:r,_destOffset:i,_destLength:a,_memoryArray:o}=Gr;if(t!==a)if(n)for(let n=e,a=e+t,s=i;n<a;n+=3,s+=4)r[s]=o[n],r[s+1]=o[n+1],r[s+2]=o[n+2],r[s+3]=255;else for(let n=e,a=e+t,s=i;n<a;n+=3,s+=4)r[s]=o[n],r[s+1]=o[n+1],r[s+2]=o[n+2];else r.set(o.subarray(e,e+t),i)})(e>>>0,t>>>0)},e.wbg.__wbg_copyrgb_d60ce17bb05d9b67=function(e){(function(e){let{_destBuffer:t,_destOffset:n,_memoryArray:r}=Gr;t[n]=r[e],t[n+1]=r[e+1],t[n+2]=r[e+2]})(e>>>0)},e.wbg.__wbg_makecssRGB_893bf0cd9fdb302d=function(e){(function(e){let{_memoryArray:t}=Gr;Gr._cssColor=Gr._makeHexColor(t[e],t[e+1],t[e+2])})(e>>>0)},e.wbg.__wbindgen_init_externref_table=function(){let e=Kr.__wbindgen_export_0,t=e.grow(4);e.set(0,void 0),e.set(t+0,void 0),e.set(t+1,null),e.set(t+2,!0),e.set(t+3,!1)},e.wbg.__wbindgen_throw=function(e,t){throw Error((n=e,r=t,n>>>=0,qr.decode(Yr().subarray(n,n+r))));var n,r},e}function ti(e){if(Kr!==void 0)return Kr;e!==void 0&&(Object.getPrototypeOf(e)===Object.prototype?{module:e}=e:console.warn("using deprecated parameters for `initSync()`; pass a single object instead"));let t=ei();return e instanceof WebAssembly.Module||(e=new WebAssembly.Module(e)),function(e){return Kr=e.exports,Jr=null,Kr.__wbindgen_start(),Kr}(new WebAssembly.Instance(e,t))}var ni=class e{static#e=new Uint8ClampedArray(3);constructor(e,t){this.name=e,this.numComps=t}getRgb(e,t,n=new Uint8ClampedArray(3)){return this.getRgbItem(e,t,n,0),n}getRgbHex(t,n){let r=this.getRgb(t,n,e.#e);return jn.makeHexColor(r[0],r[1],r[2])}getRgbItem(e,t,n,r){gn(`Should not call ColorSpace.getRgbItem`)}getRgbBuffer(e,t,n,r,i,a,o){gn(`Should not call ColorSpace.getRgbBuffer`)}getOutputLength(e,t){gn(`Should not call ColorSpace.getOutputLength`)}isPassthrough(e){return!1}isDefaultDecode(t,n){return e.isDefaultDecode(t,this.numComps)}fillRgb(e,t,n,r,i,a,o,s,c){let l=t*n,u=null,d=1<<o,f=n!==i||t!==r;if(this.isPassthrough(o))u=s;else if(this.numComps===1&&l>d&&this.name!==`DeviceGray`&&this.name!==`DeviceRGB`){let t=o<=8?new Uint8Array(d):new Uint16Array(d);for(let e=0;e<d;e++)t[e]=e;let n=new Uint8ClampedArray(3*d);if(this.getRgbBuffer(t,0,d,n,0,o,0),f){u=new Uint8Array(3*l);let e=0;for(let t=0;t<l;++t){let r=3*s[t];u[e++]=n[r],u[e++]=n[r+1],u[e++]=n[r+2]}}else{let t=0;for(let r=0;r<l;++r){let i=3*s[r];e[t++]=n[i],e[t++]=n[i+1],e[t++]=n[i+2],t+=c}}}else f?(u=new Uint8ClampedArray(3*l),this.getRgbBuffer(s,0,l,u,0,o,0)):this.getRgbBuffer(s,0,r*a,e,0,o,c);if(u)if(f)(function(e,t,n,r,i,a,o){o=o===1?o:0;let s=n/i,c=r/a,l,u=0,d=new Uint16Array(i),f=3*n;for(let e=0;e<i;e++)d[e]=3*Math.floor(e*s);for(let n=0;n<a;n++){let r=Math.floor(n*c)*f;for(let n=0;n<i;n++)l=r+d[n],t[u++]=e[l++],t[u++]=e[l++],t[u++]=e[l++],u+=o}})(u,e,t,n,r,i,c);else{let t=0,n=0;for(let i=0,o=r*a;i<o;i++)e[t++]=u[n++],e[t++]=u[n++],e[t++]=u[n++],t+=c}}get usesZeroToOneRange(){return P(this,`usesZeroToOneRange`,!0)}static isDefaultDecode(e,t){if(!Array.isArray(e))return!0;if(2*t!==e.length)return N(`The decode map is not the correct length`),!0;for(let t=0,n=e.length;t<n;t+=2)if(e[t]!==0||e[t+1]!==1)return!1;return!0}},ri=class extends ni{constructor(e,t,n){super(`Alternate`,e),this.base=t,this.tintFn=n,this.tmpBuf=new Float32Array(t.numComps)}getRgbItem(e,t,n,r){let i=this.tmpBuf;this.tintFn(e,t,i,0),this.base.getRgbItem(i,0,n,r)}getRgbBuffer(e,t,n,r,i,a,o){let s=this.tintFn,c=this.base,l=1/((1<<a)-1),u=c.numComps,d=c.usesZeroToOneRange,f=(c.isPassthrough(8)||!d)&&o===0,p=f?i:0,m=f?r:new Uint8ClampedArray(u*n),h=this.numComps,g=new Float32Array(h),_=new Float32Array(u),v,y;for(v=0;v<n;v++){for(y=0;y<h;y++)g[y]=e[t++]*l;if(s(g,0,_,0),d)for(y=0;y<u;y++)m[p++]=255*_[y];else c.getRgbItem(_,0,m,p),p+=u}f||c.getRgbBuffer(m,0,n,r,i,8,o)}getOutputLength(e,t){return this.base.getOutputLength(e*this.base.numComps/this.numComps,t)}},ii=class extends ni{constructor(e){super(`Pattern`,null),this.base=e}isDefaultDecode(e,t){gn(`Should not call PatternCS.isDefaultDecode`)}},ai=class extends ni{constructor(e,t,n){super(`Indexed`,1),this.base=e,this.highVal=t;let r=e.numComps*(t+1);if(this.lookup=new Uint8Array(r),n instanceof tr){let e=n.getBytes(r);this.lookup.set(e)}else{if(typeof n!=`string`)throw new F(`IndexedCS - unrecognized lookup table: ${n}`);for(let e=0;e<r;++e)this.lookup[e]=255&n.charCodeAt(e)}}getRgbItem(e,t,n,r){let{base:i,highVal:a,lookup:o}=this,s=Bn(Math.round(e[t]),0,a)*i.numComps;i.getRgbBuffer(o,s,1,n,r,8,0)}getRgbBuffer(e,t,n,r,i,a,o){let{base:s,highVal:c,lookup:l}=this,{numComps:u}=s,d=s.getOutputLength(u,o);for(let a=0;a<n;++a){let n=Bn(Math.round(e[t++]),0,c)*u;s.getRgbBuffer(l,n,1,r,i,8,o),i+=d}}getOutputLength(e,t){return this.base.getOutputLength(e*this.base.numComps,t)}isDefaultDecode(e,t){return!Array.isArray(e)||(e.length===2?!Number.isInteger(t)||t<1?(N(`Bits per component is not correct`),!0):e[0]===0&&e[1]===(1<<t)-1:(N(`Decode map length is not correct`),!0))}},oi=class extends ni{constructor(){super(`DeviceGray`,1)}getRgbItem(e,t,n,r){let i=255*e[t];n[r]=n[r+1]=n[r+2]=i}getRgbBuffer(e,t,n,r,i,a,o){let s=255/((1<<a)-1),c=t,l=i;for(let t=0;t<n;++t){let t=s*e[c++];r[l++]=t,r[l++]=t,r[l++]=t,l+=o}}getOutputLength(e,t){return e*(3+t)}},si=class extends ni{constructor(){super(`DeviceRGB`,3)}getRgbItem(e,t,n,r){n[r]=255*e[t],n[r+1]=255*e[t+1],n[r+2]=255*e[t+2]}getRgbBuffer(e,t,n,r,i,a,o){if(a===8&&o===0)return void r.set(e.subarray(t,t+3*n),i);let s=255/((1<<a)-1),c=t,l=i;for(let t=0;t<n;++t)r[l++]=s*e[c++],r[l++]=s*e[c++],r[l++]=s*e[c++],l+=o}getOutputLength(e,t){return e*(3+t)/3|0}isPassthrough(e){return e===8}},ci=class extends ni{constructor(){super(`DeviceRGBA`,4)}getOutputLength(e,t){return 4*e}isPassthrough(e){return e===8}fillRgb(e,t,n,r,i,a,o,s,c){n!==i||t!==r?function(e,t,n,r,i,a,o){let s=n/i,c=r/a,l=0,u=new Uint16Array(i);if(o===1){for(let e=0;e<i;e++)u[e]=Math.floor(e*s);let r=new Uint32Array(e.buffer),o=new Uint32Array(t.buffer),d=kn.isLittleEndian?16777215:4294967040;for(let e=0;e<a;e++){let t=r.subarray(Math.floor(e*c)*n);for(let e=0;e<i;e++)o[l++]|=t[u[e]]&d}}else{let r=n*4;for(let e=0;e<i;e++)u[e]=Math.floor(e*s)*4;for(let n=0;n<a;n++){let a=e.subarray(Math.floor(n*c)*r);for(let e=0;e<i;e++){let n=u[e];t[l++]=a[n],t[l++]=a[n+1],t[l++]=a[n+2]}}}}(s,e,t,n,r,i,c):function(e,t,n){if(n===1){let n=new Uint32Array(e.buffer),r=new Uint32Array(t.buffer),i=kn.isLittleEndian?16777215:4294967040;for(let e=0,t=n.length;e<t;e++)r[e]|=n[e]&i}else{let n=0;for(let r=0,i=e.length;r<i;r+=4)t[n++]=e[r],t[n++]=e[r+1],t[n++]=e[r+2]}}(s,e,c)}},li=class extends ni{constructor(){super(`DeviceCMYK`,4)}#e(e,t,n,r,i){let a=e[t]*n,o=e[t+1]*n,s=e[t+2]*n,c=e[t+3]*n;r[i]=255+a*(-4.387332384609988*a+54.48615194189176*o+18.82290502165302*s+212.25662451639585*c-285.2331026137004)+o*(1.7149763477362134*o-5.6096736904047315*s+-17.873870861415444*c-5.497006427196366)+s*(-2.5217340131683033*s-21.248923337353073*c+17.5119270841813)+c*(-21.86122147463605*c-189.48180835922747),r[i+1]=255+a*(8.841041422036149*a+60.118027045597366*o+6.871425592049007*s+31.159100130055922*c-79.2970844816548)+o*(-15.310361306967817*o+17.575251261109482*s+131.35250912493976*c-190.9453302588951)+s*(4.444339102852739*s+9.8632861493405*c-24.86741582555878)+c*(-20.737325471181034*c-187.80453709719578),r[i+2]=255+a*(.8842522430003296*a+8.078677503112928*o+30.89978309703729*s-.23883238689178934*c-14.183576799673286)+o*(10.49593273432072*o+63.02378494754052*s+50.606957656360734*c-112.23884253719248)+s*(.03296041114873217*s+115.60384449646641*c-193.58209356861505)+c*(-22.33816807309886*c-180.12613974708367)}getRgbItem(e,t,n,r){this.#e(e,t,1,n,r)}getRgbBuffer(e,t,n,r,i,a,o){let s=1/((1<<a)-1);for(let a=0;a<n;a++)this.#e(e,t,s,r,i),t+=4,i+=3+o}getOutputLength(e,t){return e/4*(3+t)|0}},ui=class extends ni{constructor(e,t,n){if(super(`CalGray`,1),!e)throw new F(`WhitePoint missing - required for color space CalGray`);if([this.XW,this.YW,this.ZW]=e,[this.XB,this.YB,this.ZB]=t||[0,0,0],this.G=n||1,this.XW<0||this.ZW<0||this.YW!==1)throw new F(`Invalid WhitePoint components for ${this.name}, no fallback available`);(this.XB<0||this.YB<0||this.ZB<0)&&(hn(`Invalid BlackPoint for ${this.name}, falling back to default.`),this.XB=this.YB=this.ZB=0),this.XB===0&&this.YB===0&&this.ZB===0||N(`${this.name}, BlackPoint: XB: ${this.XB}, YB: ${this.YB}, ZB: ${this.ZB}, only default values are supported.`),this.G<1&&(hn(`Invalid Gamma: ${this.G} for ${this.name}, falling back to default.`),this.G=1)}#e(e,t,n,r,i){let a=(e[t]*i)**this.G,o=this.YW*a,s=Math.max(295.8*o**.3333333333333333-40.8,0);n[r]=s,n[r+1]=s,n[r+2]=s}getRgbItem(e,t,n,r){this.#e(e,t,n,r,1)}getRgbBuffer(e,t,n,r,i,a,o){let s=1/((1<<a)-1);for(let a=0;a<n;++a)this.#e(e,t,r,i,s),t+=1,i+=3+o}getOutputLength(e,t){return e*(3+t)}},di=class e extends ni{static#e=new Float32Array([.8951,.2664,-.1614,-.7502,1.7135,.0367,.0389,-.0685,1.0296]);static#t=new Float32Array([.9869929,-.1470543,.1599627,.4323053,.5183603,.0492912,-.0085287,.0400428,.9684867]);static#n=new Float32Array([3.2404542,-1.5371385,-.4985314,-.969266,1.8760108,.041556,.0556434,-.2040259,1.0572252]);static#r=new Float32Array([1,1,1]);static#i=new Float32Array(3);static#a=new Float32Array(3);static#o=new Float32Array(3);static#s=(24/116)**3/8;constructor(e,t,n,r){if(super(`CalRGB`,3),!e)throw new F(`WhitePoint missing - required for color space CalRGB`);let[i,a,o]=this.whitePoint=e,[s,c,l]=this.blackPoint=t||new Float32Array(3);if([this.GR,this.GG,this.GB]=n||new Float32Array([1,1,1]),[this.MXA,this.MYA,this.MZA,this.MXB,this.MYB,this.MZB,this.MXC,this.MYC,this.MZC]=r||new Float32Array([1,0,0,0,1,0,0,0,1]),i<0||o<0||a!==1)throw new F(`Invalid WhitePoint components for ${this.name}, no fallback available`);(s<0||c<0||l<0)&&(hn(`Invalid BlackPoint for ${this.name} [${s}, ${c}, ${l}], falling back to default.`),this.blackPoint=new Float32Array(3)),(this.GR<0||this.GG<0||this.GB<0)&&(hn(`Invalid Gamma [${this.GR}, ${this.GG}, ${this.GB}] for ${this.name}, falling back to default.`),this.GR=this.GG=this.GB=1)}#c(e,t,n){n[0]=e[0]*t[0]+e[1]*t[1]+e[2]*t[2],n[1]=e[3]*t[0]+e[4]*t[1]+e[5]*t[2],n[2]=e[6]*t[0]+e[7]*t[1]+e[8]*t[2]}#l(e,t,n){n[0]=1*t[0]/e[0],n[1]=1*t[1]/e[1],n[2]=1*t[2]/e[2]}#u(e,t,n){n[0]=.95047*t[0]/e[0],n[1]=1*t[1]/e[1],n[2]=1.08883*t[2]/e[2]}#d(e){return e<=.0031308?Bn(12.92*e,0,1):e>=.99554525?1:Bn(1.055*e**(1/2.4)-.055,0,1)}#f(t){return t<0?-this.#f(-t):t>8?((t+16)/116)**3:t*e.#s}#p(e,t,n){if(e[0]===0&&e[1]===0&&e[2]===0)return n[0]=t[0],n[1]=t[1],void(n[2]=t[2]);let r=this.#f(0),i=(1-r)/(1-this.#f(e[0])),a=1-i,o=(1-r)/(1-this.#f(e[1])),s=1-o,c=(1-r)/(1-this.#f(e[2])),l=1-c;n[0]=t[0]*i+a,n[1]=t[1]*o+s,n[2]=t[2]*c+l}#m(t,n,r){if(t[0]===1&&t[2]===1)return r[0]=n[0],r[1]=n[1],void(r[2]=n[2]);let i=r;this.#c(e.#e,n,i);let a=e.#i;this.#l(t,i,a),this.#c(e.#t,a,r)}#h(t,n,r){let i=r;this.#c(e.#e,n,i);let a=e.#i;this.#u(t,i,a),this.#c(e.#t,a,r)}#g(t,n,r,i,a){let o=Bn(t[n]*a,0,1),s=Bn(t[n+1]*a,0,1),c=Bn(t[n+2]*a,0,1),l=o===1?1:o**this.GR,u=s===1?1:s**this.GG,d=c===1?1:c**this.GB,f=this.MXA*l+this.MXB*u+this.MXC*d,p=this.MYA*l+this.MYB*u+this.MYC*d,m=this.MZA*l+this.MZB*u+this.MZC*d,h=e.#a;h[0]=f,h[1]=p,h[2]=m;let g=e.#o;this.#m(this.whitePoint,h,g);let _=e.#a;this.#p(this.blackPoint,g,_);let v=e.#o;this.#h(e.#r,_,v);let y=e.#a;this.#c(e.#n,v,y),r[i]=255*this.#d(y[0]),r[i+1]=255*this.#d(y[1]),r[i+2]=255*this.#d(y[2])}getRgbItem(e,t,n,r){this.#g(e,t,n,r,1)}getRgbBuffer(e,t,n,r,i,a,o){let s=1/((1<<a)-1);for(let a=0;a<n;++a)this.#g(e,t,r,i,s),t+=3,i+=3+o}getOutputLength(e,t){return e*(3+t)/3|0}},fi=class extends ni{constructor(e,t,n){if(super(`Lab`,3),!e)throw new F(`WhitePoint missing - required for color space Lab`);if([this.XW,this.YW,this.ZW]=e,[this.amin,this.amax,this.bmin,this.bmax]=n||[-100,100,-100,100],[this.XB,this.YB,this.ZB]=t||[0,0,0],this.XW<0||this.ZW<0||this.YW!==1)throw new F(`Invalid WhitePoint components, no fallback available`);(this.XB<0||this.YB<0||this.ZB<0)&&(hn(`Invalid BlackPoint, falling back to default`),this.XB=this.YB=this.ZB=0),(this.amin>this.amax||this.bmin>this.bmax)&&(hn(`Invalid Range, falling back to defaults`),this.amin=-100,this.amax=100,this.bmin=-100,this.bmax=100)}#e(e){return e>=6/29?e**3:108/841*(e-4/29)}#t(e,t,n,r){return n+e*(r-n)/t}#n(e,t,n,r,i){let a=e[t],o=e[t+1],s=e[t+2];!1!==n&&(a=this.#t(a,n,0,100),o=this.#t(o,n,this.amin,this.amax),s=this.#t(s,n,this.bmin,this.bmax)),o>this.amax?o=this.amax:o<this.amin&&(o=this.amin),s>this.bmax?s=this.bmax:s<this.bmin&&(s=this.bmin);let c=(a+16)/116,l=c+o/500,u=c-s/200,d=this.XW*this.#e(l),f=this.YW*this.#e(c),p=this.ZW*this.#e(u),m,h,g;this.ZW<1?(m=3.1339*d+-1.617*f+-.4906*p,h=-.9785*d+1.916*f+.0333*p,g=.072*d+-.229*f+1.4057*p):(m=3.2406*d+-1.5372*f+-.4986*p,h=-.9689*d+1.8758*f+.0415*p,g=.0557*d+-.204*f+1.057*p),r[i]=255*Math.sqrt(m),r[i+1]=255*Math.sqrt(h),r[i+2]=255*Math.sqrt(g)}getRgbItem(e,t,n,r){this.#n(e,t,!1,n,r)}getRgbBuffer(e,t,n,r,i,a,o){let s=(1<<a)-1;for(let a=0;a<n;a++)this.#n(e,t,s,r,i),t+=3,i+=3+o}getOutputLength(e,t){return e*(3+t)/3|0}isDefaultDecode(e,t){return!0}get usesZeroToOneRange(){return P(this,`usesZeroToOneRange`,!1)}};function pi(e){let t=new XMLHttpRequest;return t.open(`GET`,e,!1),t.responseType=`arraybuffer`,t.send(null),t.response}var mi=class e extends ni{#e;#t;static#n=!0;static#r=null;static#i=null;constructor(t,n,r){if(!e.isUsable)throw Error(`No ICC color space support`);let i;switch(super(n,r),r){case 1:i=Qr.Gray8,this.#t=(e,t,n)=>function(e,t,n){Kr.qcms_convert_one(e,t,n)}(this.#e,255*e[t],n);break;case 3:i=Qr.RGB8,this.#t=(e,t,n)=>function(e,t,n,r,i){Kr.qcms_convert_three(e,t,n,r,i)}(this.#e,255*e[t],255*e[t+1],255*e[t+2],n);break;case 4:i=Qr.CMYK,this.#t=(e,t,n)=>function(e,t,n,r,i,a){Kr.qcms_convert_four(e,t,n,r,i,a)}(this.#e,255*e[t],255*e[t+1],255*e[t+2],255*e[t+3],n);break;default:throw Error(`Unsupported number of components: ${r}`)}if(this.#e=function(e,t,n){let r=Zr(e,Kr.__wbindgen_malloc),i=Xr;return Kr.qcms_transformer_from_memory(r,i,t,n)>>>0}(t,i,$r.Perceptual),!this.#e)throw Error(`Failed to create ICC color space`);e.#i||=new FinalizationRegistry(e=>{(function(e){Kr.qcms_drop_transformer(e)})(e)}),e.#i.register(this,this.#e)}getRgbHex(e,t){return this.#t(e,t,!0),Gr._cssColor}getRgbItem(e,t,n,r){Gr._destBuffer=n,Gr._destOffset=r,Gr._destLength=3,this.#t(e,t,!1),Gr._destBuffer=null}getRgbBuffer(e,t,n,r,i,a,o){if(e=e.subarray(t,t+n*this.numComps),a!==8){let t=255/((1<<a)-1);for(let n=0,r=e.length;n<r;n++)e[n]*=t}Gr._mustAddAlpha=o&&r.buffer===e.buffer,Gr._destBuffer=r,Gr._destOffset=i,Gr._destLength=n*(3+o),function(e,t){let n=Zr(t,Kr.__wbindgen_malloc),r=Xr;Kr.qcms_convert_array(e,n,r)}(this.#e,e),Gr._mustAddAlpha=!1,Gr._destBuffer=null}getOutputLength(e,t){return e/this.numComps*(3+t)|0}static setOptions({useWasm:e,useWorkerFetch:t,wasmUrl:n}){t?(this.#n=e,this.#r=n):this.#n=!1}static get isUsable(){let e=!1;if(this.#n)if(this.#r)try{this._module=ti({module:pi(`${this.#r}qcms_bg.wasm`)}),e=!!this._module,Gr._memory=this._module.memory,Gr._makeHexColor=jn.makeHexColor}catch(e){N(`ICCBased color space: "${e}".`)}else N("No ICC color space support due to missing `wasmUrl` API option");return P(this,`isUsable`,e)}},hi=class e extends mi{static#e;constructor(){super(new Uint8Array(pi(`${e.#e}CGATS001Compat-v2-micro.icc`)),`DeviceCMYK`,4)}static setOptions({iccUrl:e}){this.#e=e}static get isUsable(){let e=!1;return mi.isUsable&&(this.#e?e=!0:N("No CMYK ICC profile support due to missing `iccUrl` API option")),P(this,`isUsable`,e)}},gi=class e extends tr{constructor(e,t,n,r){super(),this.bytes=e instanceof Uint8Array?e:new Uint8Array(e),this.start=t||0,this.pos=this.start,this.end=t+n||this.bytes.length,this.dict=r}get length(){return this.end-this.start}get isEmpty(){return this.length===0}getByte(){return this.pos>=this.end?-1:this.bytes[this.pos++]}getBytes(e){let t=this.bytes,n=this.pos,r=this.end;if(!e)return t.subarray(n,r);let i=n+e;return i>r&&(i=r),this.pos=i,t.subarray(n,i)}getByteRange(e,t){return e<0&&(e=0),t>this.end&&(t=this.end),this.bytes.subarray(e,t)}reset(){this.pos=this.start}moveStart(){this.start=this.pos}makeSubStream(t,n,r=null){return new e(this.bytes.buffer,t,n,r)}},_i=class extends gi{constructor(e){super(En(e))}},vi=class extends gi{constructor(){super(new Uint8Array)}},yi=class extends gi{constructor(e,t,n){super(new Uint8Array(e),0,e,null),this.chunkSize=t,this._loadedChunks=new Set,this.numChunks=Math.ceil(e/t),this.manager=n,this.progressiveDataLength=0,this.lastSuccessfulEnsureByteChunk=-1}getMissingChunks(){let e=[];for(let t=0,n=this.numChunks;t<n;++t)this._loadedChunks.has(t)||e.push(t);return e}get numChunksLoaded(){return this._loadedChunks.size}get isDataLoaded(){return this.numChunksLoaded===this.numChunks}onReceiveData(e,t){let n=this.chunkSize;if(e%n!==0)throw Error(`Bad begin offset: ${e}`);let r=e+t.byteLength;if(r%n!==0&&r!==this.bytes.length)throw Error(`Bad end offset: ${r}`);this.bytes.set(new Uint8Array(t),e);let i=Math.floor(e/n),a=Math.floor((r-1)/n)+1;for(let e=i;e<a;++e)this._loadedChunks.add(e)}onReceiveProgressiveData(e){let t=this.progressiveDataLength,n=Math.floor(t/this.chunkSize);this.bytes.set(new Uint8Array(e),t),t+=e.byteLength,this.progressiveDataLength=t;let r=t>=this.end?this.numChunks:Math.floor(t/this.chunkSize);for(let e=n;e<r;++e)this._loadedChunks.add(e)}ensureByte(e){if(e<this.progressiveDataLength)return;let t=Math.floor(e/this.chunkSize);if(!(t>this.numChunks)&&t!==this.lastSuccessfulEnsureByteChunk){if(!this._loadedChunks.has(t))throw new cr(e,e+1);this.lastSuccessfulEnsureByteChunk=t}}ensureRange(e,t){if(e>=t||t<=this.progressiveDataLength)return;let n=Math.floor(e/this.chunkSize);if(n>this.numChunks)return;let r=Math.min(Math.floor((t-1)/this.chunkSize)+1,this.numChunks);for(let i=n;i<r;++i)if(!this._loadedChunks.has(i))throw new cr(e,t)}nextEmptyChunk(e){let t=this.numChunks;for(let n=0;n<t;++n){let r=(e+n)%t;if(!this._loadedChunks.has(r))return r}return null}hasChunk(e){return this._loadedChunks.has(e)}getByte(){let e=this.pos;return e>=this.end?-1:(e>=this.progressiveDataLength&&this.ensureByte(e),this.bytes[this.pos++])}getBytes(e){let t=this.bytes,n=this.pos,r=this.end;if(!e)return r>this.progressiveDataLength&&this.ensureRange(n,r),t.subarray(n,r);let i=n+e;return i>r&&(i=r),i>this.progressiveDataLength&&this.ensureRange(n,i),this.pos=i,t.subarray(n,i)}getByteRange(e,t){return e<0&&(e=0),t>this.end&&(t=this.end),t>this.progressiveDataLength&&this.ensureRange(e,t),this.bytes.subarray(e,t)}makeSubStream(e,t,n=null){function r(){}t?e+t>this.progressiveDataLength&&this.ensureRange(e,e+t):e>=this.progressiveDataLength&&this.ensureByte(e),r.prototype=Object.create(this),r.prototype.getMissingChunks=function(){let e=this.chunkSize,t=Math.floor(this.start/e),n=Math.floor((this.end-1)/e)+1,r=[];for(let e=t;e<n;++e)this._loadedChunks.has(e)||r.push(e);return r},Object.defineProperty(r.prototype,`isDataLoaded`,{get(){return this.numChunksLoaded===this.numChunks||this.getMissingChunks().length===0},configurable:!0});let i=new r;return i.pos=i.start=e,i.end=e+t||this.end,i.dict=n,i}getBaseStreams(){return[this]}},bi=class{constructor(e,t){this.length=t.length,this.chunkSize=t.rangeChunkSize,this.stream=new yi(this.length,this.chunkSize,this),this.pdfNetworkStream=e,this.disableAutoFetch=t.disableAutoFetch,this.msgHandler=t.msgHandler,this.currRequestId=0,this._chunksNeededByRequest=new Map,this._requestsByChunk=new Map,this._promisesByRequest=new Map,this.progressiveDataLength=0,this.aborted=!1,this._loadedStreamCapability=Promise.withResolvers()}sendRequest(e,t){let n=this.pdfNetworkStream.getRangeReader(e,t);n.isStreamingSupported||(n.onProgress=this.onProgress.bind(this));let r=[],i=0;return new Promise((e,t)=>{let a=({value:o,done:s})=>{try{if(s){let t=fr(r);r=null,e(t);return}i+=o.byteLength,n.isStreamingSupported&&this.onProgress({loaded:i}),r.push(o),n.read().then(a,t)}catch(e){t(e)}};n.read().then(a,t)}).then(t=>{this.aborted||this.onReceiveData({chunk:t,begin:e})})}requestAllChunks(e=!1){if(!e){let e=this.stream.getMissingChunks();this._requestChunks(e)}return this._loadedStreamCapability.promise}_requestChunks(e){let t=this.currRequestId++,n=new Set;this._chunksNeededByRequest.set(t,n);for(let t of e)this.stream.hasChunk(t)||n.add(t);if(n.size===0)return Promise.resolve();let r=Promise.withResolvers();this._promisesByRequest.set(t,r);let i=[];for(let e of n){let n=this._requestsByChunk.get(e);n||(n=[],this._requestsByChunk.set(e,n),i.push(e)),n.push(t)}if(i.length>0){let e=this.groupChunks(i);for(let t of e){let e=t.beginChunk*this.chunkSize,n=Math.min(t.endChunk*this.chunkSize,this.length);this.sendRequest(e,n).catch(r.reject)}}return r.promise.catch(e=>{if(!this.aborted)throw e})}getStream(){return this.stream}requestRange(e,t){t=Math.min(t,this.length);let n=this.getBeginChunk(e),r=this.getEndChunk(t),i=[];for(let e=n;e<r;++e)i.push(e);return this._requestChunks(i)}requestRanges(e=[]){let t=[];for(let n of e){let e=this.getBeginChunk(n.begin),r=this.getEndChunk(n.end);for(let n=e;n<r;++n)t.includes(n)||t.push(n)}return t.sort((e,t)=>e-t),this._requestChunks(t)}groupChunks(e){let t=[],n=-1,r=-1;for(let i=0,a=e.length;i<a;++i){let a=e[i];n<0&&(n=a),r>=0&&r+1!==a&&(t.push({beginChunk:n,endChunk:r+1}),n=a),i+1===e.length&&t.push({beginChunk:n,endChunk:a+1}),r=a}return t}onProgress(e){this.msgHandler.send(`DocProgress`,{loaded:this.stream.numChunksLoaded*this.chunkSize+e.loaded,total:this.length})}onReceiveData(e){let t=e.chunk,n=e.begin===void 0,r=n?this.progressiveDataLength:e.begin,i=r+t.byteLength,a=Math.floor(r/this.chunkSize),o=i<this.length?Math.floor(i/this.chunkSize):Math.ceil(i/this.chunkSize);n?(this.stream.onReceiveProgressiveData(t),this.progressiveDataLength=i):this.stream.onReceiveData(r,t),this.stream.isDataLoaded&&this._loadedStreamCapability.resolve(this.stream);let s=[];for(let e=a;e<o;++e){let t=this._requestsByChunk.get(e);if(t){this._requestsByChunk.delete(e);for(let n of t){let t=this._chunksNeededByRequest.get(n);t.has(e)&&t.delete(e),t.size>0||s.push(n)}}}if(!this.disableAutoFetch&&this._requestsByChunk.size===0){let e;if(this.stream.numChunksLoaded===1){let t=this.stream.numChunks-1;this.stream.hasChunk(t)||(e=t)}else e=this.stream.nextEmptyChunk(o);Number.isInteger(e)&&this._requestChunks([e])}for(let e of s){let t=this._promisesByRequest.get(e);this._promisesByRequest.delete(e),t.resolve()}this.msgHandler.send(`DocProgress`,{loaded:this.stream.numChunksLoaded*this.chunkSize,total:this.length})}onError(e){this._loadedStreamCapability.reject(e)}getBeginChunk(e){return Math.floor(e/this.chunkSize)}getEndChunk(e){return Math.floor((e-1)/this.chunkSize)+1}abort(e){this.aborted=!0,this.pdfNetworkStream?.cancelAllRequests(e);for(let t of this._promisesByRequest.values())t.reject(e)}};function xi(e){switch(e.kind){case C:return Si(e);case w:return function({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);if(kn.isLittleEndian){for(;o<c-2;o+=3,r+=4){let e=l[o],t=l[o+1],i=l[o+2];n[r]=4278190080|e,n[r+1]=e>>>24|t<<8|4278190080,n[r+2]=t>>>16|i<<16|4278190080,n[r+3]=i>>>8|4278190080}for(let i=4*o,a=t+s;i<a;i+=3)n[r++]=e[i]|e[i+1]<<8|e[i+2]<<16|4278190080}else{for(;o<c-2;o+=3,r+=4){let e=l[o],t=l[o+1],i=l[o+2];n[r]=255|e,n[r+1]=e<<24|t>>>8|255,n[r+2]=t<<16|i>>>16|255,n[r+3]=i<<8|255}for(let i=4*o,a=t+s;i<a;i+=3)n[r++]=e[i]<<24|e[i+1]<<16|e[i+2]<<8|255}return{srcPos:t+s,destPos:r}}(e)}return null}function Si({src:e,srcPos:t=0,dest:n,width:r,height:i,nonBlackColor:a=4294967295,inverseDecode:o=!1}){let s=kn.isLittleEndian?4278190080:255,[c,l]=o?[a,s]:[s,a],u=r>>3,d=7&r,f=e.length;n=new Uint32Array(n.buffer);let p=0;for(let r=0;r<i;r++){for(let r=t+u;t<r;t++){let r=t<f?e[t]:255;n[p++]=128&r?l:c,n[p++]=64&r?l:c,n[p++]=32&r?l:c,n[p++]=16&r?l:c,n[p++]=8&r?l:c,n[p++]=4&r?l:c,n[p++]=2&r?l:c,n[p++]=1&r?l:c}if(d===0)continue;let r=t<f?e[t++]:255;for(let e=0;e<d;e++)n[p++]=r&1<<7-e?l:c}return{srcPos:t,destPos:p}}var Ci=class e{static#e=2048;static#t=kn.isImageDecoderSupported;constructor(e,t){this._imgData=e,this._isMask=t}static get canUseImageDecoder(){return P(this,`canUseImageDecoder`,this.#t?ImageDecoder.isTypeSupported(`image/bmp`):Promise.resolve(!1))}static needsToBeResized(e,t){if(e<=this.#e&&t<=this.#e)return!1;let{MAX_DIM:n}=this;if(e>n||t>n)return!0;let r=e*t;return this._hasMaxArea?r>this.MAX_AREA:r<this.#e**2?!1:this._areGoodDims(e,t)?(this.#e=Math.max(this.#e,Math.floor(Math.sqrt(e*t))),!1):(this.#e=this._guessMax(this.#e,n,128,0),r>(this.MAX_AREA=this.#e**2))}static getReducePowerForJPX(e,t,n){let r=e*t,i=2**30/(4*n);if(!this.needsToBeResized(e,t))return r>i?Math.ceil(Math.log2(r/i)):0;let{MAX_DIM:a,MAX_AREA:o}=this,s=Math.max(e/a,t/a,Math.sqrt(r/Math.min(i,o)));return Math.ceil(Math.log2(s))}static get MAX_DIM(){return P(this,`MAX_DIM`,this._guessMax(2048,65537,0,1))}static get MAX_AREA(){return this._hasMaxArea=!0,P(this,`MAX_AREA`,this._guessMax(this.#e,this.MAX_DIM,128,0)**2)}static set MAX_AREA(e){e>=0&&(this._hasMaxArea=!0,P(this,`MAX_AREA`,e))}static setOptions({canvasMaxAreaInBytes:e=-1,isImageDecoderSupported:t=!1}){this._hasMaxArea||(this.MAX_AREA=e>>2),this.#t=t}static _areGoodDims(e,t){try{let n=new OffscreenCanvas(e,t),r=n.getContext(`2d`);r.fillRect(0,0,1,1);let i=r.getImageData(0,0,1,1).data[3];return n.width=n.height=1,i!==0}catch{return!1}}static _guessMax(e,t,n,r){for(;e+n+1<t;){let n=Math.floor((e+t)/2),i=r||n;this._areGoodDims(n,i)?e=n:t=n}return e}static async createImage(t,n=!1){return new e(t,n)._createImage()}async _createImage(){let{_imgData:t}=this,{width:n,height:r}=t;if(n*r*4>rr){let e=this.#n();if(e)return e}let i=this._encodeBMP(),a,o;await e.canUseImageDecoder?(a=new ImageDecoder({data:i,type:`image/bmp`,preferAnimation:!1,transfer:[i.buffer]}),o=a.decode().catch(e=>(N(`BMP image decoding failed: ${e}`),createImageBitmap(new Blob([this._encodeBMP().buffer],{type:`image/bmp`})))).finally(()=>{a.close()})):o=createImageBitmap(new Blob([i.buffer],{type:`image/bmp`}));let{MAX_AREA:s,MAX_DIM:c}=e,l=Math.max(n/c,r/c,Math.sqrt(n*r/s)),u=Math.max(l,2),d=Math.round(10*(l+1.25))/10/u,f=Math.floor(Math.log2(d)),p=Array(f+2).fill(2);p[0]=u,p.splice(-1,1,d/(1<<f));let m=n,h=r,g=await o,_=g.image||g;for(let e of p){let t=m,n=h;m=Math.floor(m/e)-1,h=Math.floor(h/e)-1;let r=new OffscreenCanvas(m,h);r.getContext(`2d`).drawImage(_,0,0,t,n,0,0,m,h),_.close(),_=r.transferToImageBitmap()}return t.data=null,t.bitmap=_,t.width=m,t.height=h,t}#n(){let{_imgData:t}=this,{data:n,width:r,height:i,kind:a}=t,o=r*i*4,s=Math.ceil(Math.log2(o/rr)),c=r>>s,l=i>>s,u,d=i;try{u=new Uint8Array(o)}catch{let e=Math.floor(Math.log2(o+1));for(;;)try{u=new Uint8Array(2**e-1);break}catch{--e}d=Math.floor((2**e-1)/(4*r));let t=r*d*4;t<u.length&&(u=new Uint8Array(t))}let f=new Uint32Array(u.buffer),p=new Uint32Array(c*l),m=0,h=0,g=Math.ceil(i/d),_=i%d===0?i:i%d;for(let e=0;e<g;e++){let t=e<g-1?d:_;({srcPos:m}=xi({kind:a,src:n,dest:f,width:r,height:t,inverseDecode:this._isMask,srcPos:m}));for(let e=0,n=t>>s;e<n;e++){let t=f.subarray((e<<s)*r);for(let e=0;e<c;e++)p[h++]=t[e<<s]}}if(e.needsToBeResized(c,l))return t.data=p,t.width=c,t.height=l,t.kind=T,null;let v=new OffscreenCanvas(c,l);return v.getContext(`2d`,{willReadFrequently:!0}).putImageData(new ImageData(new Uint8ClampedArray(p.buffer),c,l),0,0),t.data=null,t.bitmap=v.transferToImageBitmap(),t.width=c,t.height=l,t}_encodeBMP(){let{width:e,height:t,kind:n}=this._imgData,r,i=this._imgData.data,a=new Uint8Array,o=a,s=0;switch(n){case C:{r=1,a=new Uint8Array(this._isMask?[255,255,255,255,0,0,0,0]:[0,0,0,0,255,255,255,255]);let n=e+7>>3,o=n+3&-4;if(n!==o){let e=new Uint8Array(o*t),r=0;for(let a=0,s=t*n;a<s;a+=n,r+=o)e.set(i.subarray(a,a+n),r);i=e}break}case w:if(r=24,3&e){let n=3*e,r=n+3&-4,a=r-n,o=new Uint8Array(r*t),s=0;for(let e=0,r=t*n;e<r;e+=n){let t=i.subarray(e,e+n);for(let e=0;e<n;e+=3)o[s++]=t[e+2],o[s++]=t[e+1],o[s++]=t[e];s+=a}i=o}else for(let e=0,t=i.length;e<t;e+=3){let t=i[e];i[e]=i[e+2],i[e+2]=t}break;case T:r=32,s=3,o=new Uint8Array(68);let n=new DataView(o.buffer);kn.isLittleEndian?(n.setUint32(0,255,!0),n.setUint32(4,65280,!0),n.setUint32(8,16711680,!0),n.setUint32(12,4278190080,!0)):(n.setUint32(0,4278190080,!0),n.setUint32(4,16711680,!0),n.setUint32(8,65280,!0),n.setUint32(12,255,!0));break;default:throw Error(`invalid format`)}let c=0,l=40+o.length,u=14+l+a.length+i.length,d=new Uint8Array(u),f=new DataView(d.buffer);return f.setUint16(c,19778,!0),c+=2,f.setUint32(c,u,!0),c+=4,f.setUint32(c,0,!0),c+=4,f.setUint32(c,14+l+a.length,!0),c+=4,f.setUint32(c,l,!0),c+=4,f.setInt32(c,e,!0),c+=4,f.setInt32(c,-t,!0),c+=4,f.setUint16(c,1,!0),c+=2,f.setUint16(c,r,!0),c+=2,f.setUint32(c,s,!0),c+=4,f.setUint32(c,0,!0),c+=4,f.setInt32(c,0,!0),c+=4,f.setInt32(c,0,!0),c+=4,f.setUint32(c,a.length/4,!0),c+=4,f.setUint32(c,0,!0),c+=4,d.set(o,c),c+=o.length,d.set(a,c),c+=a.length,d.set(i,c),d}},wi=new Uint8Array,Ti=class extends tr{constructor(e){if(super(),this._rawMinBufferLength=e||0,this.pos=0,this.bufferLength=0,this.eof=!1,this.buffer=wi,this.minBufferLength=512,e)for(;this.minBufferLength<e;)this.minBufferLength*=2}get isEmpty(){for(;!this.eof&&this.bufferLength===0;)this.readBlock();return this.bufferLength===0}ensureBuffer(e){let t=this.buffer;if(e<=t.byteLength)return t;let n=this.minBufferLength;for(;n<e;)n*=2;let r=new Uint8Array(n);return r.set(t),this.buffer=r}getByte(){let e=this.pos;for(;this.bufferLength<=e;){if(this.eof)return-1;this.readBlock()}return this.buffer[this.pos++]}getBytes(e,t=null){let n=this.pos,r;if(e){for(this.ensureBuffer(n+e),r=n+e;!this.eof&&this.bufferLength<r;)this.readBlock(t);let i=this.bufferLength;r>i&&(r=i)}else{for(;!this.eof;)this.readBlock(t);r=this.bufferLength}return this.pos=r,this.buffer.subarray(n,r)}async getImageData(e,t){if(!this.canAsyncDecodeImageFromBuffer)return this.isAsyncDecoder?this.decodeImage(null,t):this.getBytes(e,t);let n=await this.stream.asyncGetBytes();return this.decodeImage(n,t)}reset(){this.pos=0}makeSubStream(e,t,n=null){if(t===void 0)for(;!this.eof;)this.readBlock();else{let n=e+t;for(;this.bufferLength<=n&&!this.eof;)this.readBlock()}return new gi(this.buffer,e,t,n)}getBaseStreams(){return this.str?this.str.getBaseStreams():null}},Ei=class extends Ti{constructor(e,t=null){e=e.filter(e=>e instanceof tr);let n=0;for(let t of e)n+=t instanceof Ti?t._rawMinBufferLength:t.length;super(n),this.streams=e,this._onError=t}readBlock(){let e=this.streams;if(e.length===0)return void(this.eof=!0);let t=e.shift(),n;try{n=t.getBytes()}catch(e){if(this._onError)return void this._onError(e,t.dict?.objId);throw e}let r=this.bufferLength,i=r+n.length;this.ensureBuffer(i).set(n,r),this.bufferLength=i}getBaseStreams(){let e=[];for(let t of this.streams){let n=t.getBaseStreams();n&&e.push(...n)}return e.length>0?e:null}},Di=class{static parse({cs:e,xref:t,resources:n=null,pdfFunctionFactory:r,globalColorSpaceCache:i,localColorSpaceCache:a,asyncIfNotCached:o=!1}){let s={xref:t,resources:n,pdfFunctionFactory:r,globalColorSpaceCache:i,localColorSpaceCache:a},c,l,u;if(e instanceof R){l=e;let n=i.getByRef(l)||a.getByRef(l);if(n)return n;e=t.fetch(e)}if(e instanceof I){c=e.name;let t=a.getByName(c);if(t)return t}try{u=this.#t(e,s)}catch(e){if(o&&!(e instanceof cr))return Promise.reject(e);throw e}return(c||l)&&(a.set(c,l,u),l&&i.set(null,l,u)),o?Promise.resolve(u):u}static#e(e,t){let{globalColorSpaceCache:n}=t,r;if(e instanceof R){r=e;let t=n.getByRef(r);if(t)return t}let i=this.#t(e,t);return r&&n.set(null,r,i),i}static#t(e,t){let{xref:n,resources:r,pdfFunctionFactory:i,globalColorSpaceCache:a}=t;if((e=n.fetchIfRef(e))instanceof I)switch(e.name){case`G`:case`DeviceGray`:return this.gray;case`RGB`:case`DeviceRGB`:return this.rgb;case`DeviceRGBA`:return this.rgba;case`CMYK`:case`DeviceCMYK`:return this.cmyk;case`Pattern`:return new ii(null);default:if(r instanceof L){let n=r.get(`ColorSpace`);if(n instanceof L){let r=n.get(e.name);if(r){if(r instanceof I)return this.#t(r,t);e=r;break}}}return N(`Unrecognized ColorSpace: ${e.name}`),this.gray}if(Array.isArray(e)){let r=n.fetchIfRef(e[0]).name,o,s,c,l,u,d;switch(r){case`G`:case`DeviceGray`:return this.gray;case`RGB`:case`DeviceRGB`:return this.rgb;case`CMYK`:case`DeviceCMYK`:return this.cmyk;case`CalGray`:return o=n.fetchIfRef(e[1]),l=o.getArray(`WhitePoint`),u=o.getArray(`BlackPoint`),d=o.get(`Gamma`),new ui(l,u,d);case`CalRGB`:o=n.fetchIfRef(e[1]),l=o.getArray(`WhitePoint`),u=o.getArray(`BlackPoint`),d=o.getArray(`Gamma`);let f=o.getArray(`Matrix`);return new di(l,u,d,f);case`ICCBased`:let p=e[1]instanceof R;if(p){let t=a.getByRef(e[1]);if(t)return t}let m=n.fetchIfRef(e[1]),h=m.dict;if(s=h.get(`N`),mi.isUsable)try{let t=new mi(m.getBytes(),`ICCBased`,s);return p&&a.set(null,e[1],t),t}catch(t){if(t instanceof cr)throw t;N(`ICCBased color space (${e[1]}): "${t}".`)}let g=h.getRaw(`Alternate`);if(g){let e=this.#e(g,t);if(e.numComps===s)return e;N(`ICCBased color space: Ignoring incorrect /Alternate entry.`)}if(s===1)return this.gray;if(s===3)return this.rgb;if(s===4)return this.cmyk;break;case`Pattern`:return c=e[1]||null,c&&=this.#e(c,t),new ii(c);case`I`:case`Indexed`:c=this.#e(e[1],t);let _=Bn(n.fetchIfRef(e[2]),0,255),v=n.fetchIfRef(e[3]);return new ai(c,_,v);case`Separation`:case`DeviceN`:let y=n.fetchIfRef(e[1]);s=Array.isArray(y)?y.length:1,c=this.#e(e[2],t);let b=i.create(e[3]);return new ri(s,c,b);case`Lab`:o=n.fetchIfRef(e[1]),l=o.getArray(`WhitePoint`),u=o.getArray(`BlackPoint`);let x=o.getArray(`Range`);return new fi(l,u,x);default:return N(`Unimplemented ColorSpace object: ${r}`),this.gray}}return N(`Unrecognized ColorSpace object: ${e}`),this.gray}static get gray(){return P(this,`gray`,new oi)}static get rgb(){return P(this,`rgb`,new si)}static get rgba(){return P(this,`rgba`,new ci)}static get cmyk(){if(hi.isUsable)try{return P(this,`cmyk`,new hi)}catch{N(`CMYK fallback: DeviceCMYK`)}return P(this,`cmyk`,new li)}},Oi=class extends yn{constructor(e){super(e,`JpegError`)}},ki=class extends yn{constructor(e,t){super(e,`DNLMarkerError`),this.scanLines=t}},Ai=class extends yn{constructor(e){super(e,`EOIMarkerError`)}},ji=new Uint8Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63]),Mi=4017,Ni=799,Pi=3406,Fi=2276,Ii=1567,Li=3784,Ri=5793,zi=2896;function Bi(e,t){let n,r,i=0,a=16;for(;a>0&&!e[a-1];)a--;let o=[{children:[],index:0}],s,c=o[0];for(n=0;n<a;n++){for(r=0;r<e[n];r++){for(c=o.pop(),c.children[c.index]=t[i];c.index>0;)c=o.pop();for(c.index++,o.push(c);o.length<=n;)o.push(s={children:[],index:0}),c.children[c.index]=s.children,c=s;i++}n+1<a&&(o.push(s={children:[],index:0}),c.children[c.index]=s.children,c=s)}return o[0].children}function Vi(e,t,n){return 64*((e.blocksPerLine+1)*t+n)}function Hi(e,t,n,r,i,a,o,s,c,l=!1){let u=n.mcusPerLine,d=n.progressive,f=t,p=0,m=0;function h(){if(m>0)return m--,p>>m&1;if(p=e[t++],p===255){let r=e[t++];if(r){if(r===220&&l){let r=br(e,t+=2);if(t+=2,r>0&&r!==n.scanLines)throw new ki(`Found DNL marker (0xFFDC) while parsing scan data`,r)}else if(r===217){if(l){let e=S*(n.precision===8?8:0);if(e>0&&Math.round(n.scanLines/e)>=5)throw new ki("Found EOI marker (0xFFD9) while parsing scan data, possibly caused by incorrect `scanLines` parameter",e)}throw new Ai(`Found EOI marker (0xFFD9) while parsing scan data`)}throw new Oi(`unexpected marker ${(p<<8|r).toString(16)}`)}}return m=7,p>>>7}function g(e){let t=e;for(;;){switch(t=t[h()],typeof t){case`number`:return t;case`object`:continue}throw new Oi(`invalid huffman sequence`)}}function _(e){let t=0;for(;e>0;)t=t<<1|h(),e--;return t}function v(e){if(e===1)return h()===1?1:-1;let t=_(e);return t>=1<<e-1?t:t+(-1<<e)+1}let y=0,b,x=0,S=0;function C(e,t,n,r,i){let a=n%u;S=(n/u|0)*e.v+r;let o=a*e.h+i;t(e,Vi(e,S,o))}function w(e,t,n){S=n/e.blocksPerLine|0;let r=n%e.blocksPerLine;t(e,Vi(e,S,r))}let T=r.length,E,D,O,k,ee,A;A=d?a===0?s===0?function(e,t){let n=g(e.huffmanTableDC),r=n===0?0:v(n)<<c;e.blockData[t]=e.pred+=r}:function(e,t){e.blockData[t]|=h()<<c}:s===0?function(e,t){if(y>0)return void y--;let n=a,r=o;for(;n<=r;){let r=g(e.huffmanTableAC),i=15&r,a=r>>4;if(i===0){if(a<15){y=_(a)+(1<<a)-1;break}n+=16;continue}n+=a;let o=ji[n];e.blockData[t+o]=v(i)*(1<<c),n++}}:function(e,t){let n=a,r=o,i,s,l=0;for(;n<=r;){let r=t+ji[n],a=e.blockData[r]<0?-1:1;switch(x){case 0:if(s=g(e.huffmanTableAC),i=15&s,l=s>>4,i===0)l<15?(y=_(l)+(1<<l),x=4):(l=16,x=1);else{if(i!==1)throw new Oi(`invalid ACn encoding`);b=v(i),x=l?2:3}continue;case 1:case 2:e.blockData[r]?e.blockData[r]+=a*(h()<<c):(l--,l===0&&(x=x===2?3:0));break;case 3:e.blockData[r]?e.blockData[r]+=a*(h()<<c):(e.blockData[r]=b<<c,x=0);break;case 4:e.blockData[r]&&(e.blockData[r]+=a*(h()<<c))}n++}x===4&&(y--,y===0&&(x=0))}:function(e,t){let n=g(e.huffmanTableDC),r=n===0?0:v(n);e.blockData[t]=e.pred+=r;let i=1;for(;i<64;){let n=g(e.huffmanTableAC),r=15&n,a=n>>4;if(r===0){if(a<15)break;i+=16;continue}i+=a;let o=ji[i];e.blockData[t+o]=v(r),i++}};let j,M=0,te=T===1?r[0].blocksPerLine*r[0].blocksPerColumn:u*n.mcusPerColumn,ne,re;for(;M<=te;){let n=i?Math.min(te-M,i):te;if(n>0){for(D=0;D<T;D++)r[D].pred=0;if(y=0,T===1)for(E=r[0],ee=0;ee<n;ee++)w(E,A,M),M++;else for(ee=0;ee<n;ee++){for(D=0;D<T;D++)for(E=r[D],ne=E.h,re=E.v,O=0;O<re;O++)for(k=0;k<ne;k++)C(E,A,M,O,k);M++}}if(m=0,j=Gi(e,t),!j||(j.invalid&&(N(`decodeScan - ${n>0?`unexpected`:`excessive`} MCU data, current marker is: ${j.invalid}`),t=j.offset),!(j.marker>=65488&&j.marker<=65495)))break;t+=2}return t-f}function Ui(e,t,n){let r=e.quantizationTable,i=e.blockData,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x;if(!r)throw new Oi(`missing required Quantization Table.`);for(let e=0;e<64;e+=8)p=i[t+e],m=i[t+e+1],h=i[t+e+2],g=i[t+e+3],_=i[t+e+4],v=i[t+e+5],y=i[t+e+6],b=i[t+e+7],p*=r[e],(m|h|g|_|v|y|b)===0?(x=Ri*p+512>>10,n[e]=x,n[e+1]=x,n[e+2]=x,n[e+3]=x,n[e+4]=x,n[e+5]=x,n[e+6]=x,n[e+7]=x):(m*=r[e+1],h*=r[e+2],g*=r[e+3],_*=r[e+4],v*=r[e+5],y*=r[e+6],b*=r[e+7],a=Ri*p+128>>8,o=Ri*_+128>>8,s=h,c=y,l=zi*(m-b)+128>>8,f=zi*(m+b)+128>>8,u=g<<4,d=v<<4,a=a+o+1>>1,o=a-o,x=s*Li+c*Ii+128>>8,s=s*Ii-c*Li+128>>8,c=x,l=l+d+1>>1,d=l-d,f=f+u+1>>1,u=f-u,a=a+c+1>>1,c=a-c,o=o+s+1>>1,s=o-s,x=l*Fi+f*Pi+2048>>12,l=l*Pi-f*Fi+2048>>12,f=x,x=u*Ni+d*Mi+2048>>12,u=u*Mi-d*Ni+2048>>12,d=x,n[e]=a+f,n[e+7]=a-f,n[e+1]=o+d,n[e+6]=o-d,n[e+2]=s+u,n[e+5]=s-u,n[e+3]=c+l,n[e+4]=c-l);for(let e=0;e<8;++e)p=n[e],m=n[e+8],h=n[e+16],g=n[e+24],_=n[e+32],v=n[e+40],y=n[e+48],b=n[e+56],(m|h|g|_|v|y|b)===0?(x=Ri*p+8192>>14,x=x<-2040?0:x>=2024?255:x+2056>>4,i[t+e]=x,i[t+e+8]=x,i[t+e+16]=x,i[t+e+24]=x,i[t+e+32]=x,i[t+e+40]=x,i[t+e+48]=x,i[t+e+56]=x):(a=Ri*p+2048>>12,o=Ri*_+2048>>12,s=h,c=y,l=zi*(m-b)+2048>>12,f=zi*(m+b)+2048>>12,u=g,d=v,a=4112+(a+o+1>>1),o=a-o,x=s*Li+c*Ii+2048>>12,s=s*Ii-c*Li+2048>>12,c=x,l=l+d+1>>1,d=l-d,f=f+u+1>>1,u=f-u,a=a+c+1>>1,c=a-c,o=o+s+1>>1,s=o-s,x=l*Fi+f*Pi+2048>>12,l=l*Pi-f*Fi+2048>>12,f=x,x=u*Ni+d*Mi+2048>>12,u=u*Mi-d*Ni+2048>>12,d=x,p=a+f,b=a-f,m=o+d,y=o-d,h=s+u,v=s-u,g=c+l,_=c-l,p<16?p=0:p>=4080?p=255:p>>=4,m<16?m=0:m>=4080?m=255:m>>=4,h<16?h=0:h>=4080?h=255:h>>=4,g<16?g=0:g>=4080?g=255:g>>=4,_<16?_=0:_>=4080?_=255:_>>=4,v<16?v=0:v>=4080?v=255:v>>=4,y<16?y=0:y>=4080?y=255:y>>=4,b<16?b=0:b>=4080?b=255:b>>=4,i[t+e]=p,i[t+e+8]=m,i[t+e+16]=h,i[t+e+24]=g,i[t+e+32]=_,i[t+e+40]=v,i[t+e+48]=y,i[t+e+56]=b)}function Wi(e,t){let n=t.blocksPerLine,r=t.blocksPerColumn,i=new Int16Array(64);for(let e=0;e<r;e++)for(let r=0;r<n;r++)Ui(t,Vi(t,e,r),i);return t.blockData}function Gi(e,t,n=t){let r=e.length-1,i=n<t?n:t;if(t>=r)return null;let a=br(e,t);if(a>=65472&&a<=65534)return{invalid:null,marker:a,offset:t};let o=br(e,i);for(;!(o>=65472&&o<=65534);){if(++i>=r)return null;o=br(e,i)}return{invalid:a.toString(16),marker:o,offset:i}}function Ki(e){let t=Math.ceil(e.samplesPerLine/8/e.maxH),n=Math.ceil(e.scanLines/8/e.maxV);for(let r of e.components){let i=Math.ceil(Math.ceil(e.samplesPerLine/8)*r.h/e.maxH),a=Math.ceil(Math.ceil(e.scanLines/8)*r.v/e.maxV),o=t*r.h,s=64*(n*r.v)*(o+1);r.blockData=new Int16Array(s),r.blocksPerLine=i,r.blocksPerColumn=a}e.mcusPerLine=t,e.mcusPerColumn=n}function qi(e,t){let n=br(e,t),r=(t+=2)+n-2,i=Gi(e,r,t);i?.invalid&&(N(`readDataBlock - incorrect length, current marker is: `+i.invalid),r=i.offset);let a=e.subarray(t,r);return{appData:a,oldOffset:t,newOffset:t+a.length}}function Ji(e,t){let n=br(e,t),r=(t+=2)+n-2,i=Gi(e,r,t);return i?.invalid?i.offset:r}var Yi=class{constructor({decodeTransform:e=null,colorTransform:t=-1}={}){this._decodeTransform=e,this._colorTransform=t}static canUseImageDecoder(e,t=-1){let n=null,r=0,i=null,a=br(e,r);if(r+=2,a!==65496)throw new Oi(`SOI not found`);a=br(e,r),r+=2;e:for(;a!==65497;){switch(a){case 65505:let{appData:t,oldOffset:o,newOffset:s}=qi(e,r);if(r=s,t[0]===69&&t[1]===120&&t[2]===105&&t[3]===102&&t[4]===0&&t[5]===0){if(n)throw new Oi(`Duplicate EXIF-blocks found.`);n={exifStart:o+6,exifEnd:s}}a=br(e,r),r+=2;continue;case 65472:case 65473:case 65474:i=e[r+7];break e;case 65535:e[r]!==255&&r--}r=Ji(e,r),a=br(e,r),r+=2}return i===4||i===3&&t===0?null:n||{}}parse(e,{dnlScanLines:t=null}={}){let n,r,i=0,a=null,o=null,s=0,c=[],l=[],u=[],d=br(e,i);if(i+=2,d!==65496)throw new Oi(`SOI not found`);d=br(e,i),i+=2;e:for(;d!==65497;){let f,p,m;switch(d){case 65504:case 65505:case 65506:case 65507:case 65508:case 65509:case 65510:case 65511:case 65512:case 65513:case 65514:case 65515:case 65516:case 65517:case 65518:case 65519:case 65534:let{appData:h,newOffset:g}=qi(e,i);i=g,d===65504&&h[0]===74&&h[1]===70&&h[2]===73&&h[3]===70&&h[4]===0&&(a={version:{major:h[5],minor:h[6]},densityUnits:h[7],xDensity:h[8]<<8|h[9],yDensity:h[10]<<8|h[11],thumbWidth:h[12],thumbHeight:h[13],thumbData:h.subarray(14,14+3*h[12]*h[13])}),d===65518&&h[0]===65&&h[1]===100&&h[2]===111&&h[3]===98&&h[4]===101&&(o={version:h[5]<<8|h[6],flags0:h[7]<<8|h[8],flags1:h[9]<<8|h[10],transformCode:h[11]});break;case 65499:let _=br(e,i);i+=2;let v=_+i-2,y;for(;i<v;){let t=e[i++],n=new Uint16Array(64);if(t>>4){if(t>>4!=1)throw new Oi(`DQT - invalid table spec`);for(p=0;p<64;p++)y=ji[p],n[y]=br(e,i),i+=2}else for(p=0;p<64;p++)y=ji[p],n[y]=e[i++];c[15&t]=n}break;case 65472:case 65473:case 65474:if(n)throw new Oi(`Only single frame JPEGs supported`);i+=2,n={},n.extended=d===65473,n.progressive=d===65474,n.precision=e[i++];let b=br(e,i);i+=2,n.scanLines=t||b,n.samplesPerLine=br(e,i),i+=2,n.components=[],n.componentIds={};let x=e[i++],S=0,C=0;for(f=0;f<x;f++){let t=e[i],r=e[i+1]>>4,a=15&e[i+1];S<r&&(S=r),C<a&&(C=a);let o=e[i+2];m=n.components.push({h:r,v:a,quantizationId:o,quantizationTable:null}),n.componentIds[t]=m-1,i+=3}n.maxH=S,n.maxV=C,Ki(n);break;case 65476:let w=br(e,i);for(i+=2,f=2;f<w;){let t=e[i++],n=new Uint8Array(16),r=0;for(p=0;p<16;p++,i++)r+=n[p]=e[i];let a=new Uint8Array(r);for(p=0;p<r;p++,i++)a[p]=e[i];f+=17+r,(t>>4?l:u)[15&t]=Bi(n,a)}break;case 65501:i+=2,r=br(e,i),i+=2;break;case 65498:let T=++s===1&&!t;i+=2;let E=e[i++],D=[];for(f=0;f<E;f++){let t=e[i++],r=n.componentIds[t],a=n.components[r];a.index=t;let o=e[i++];a.huffmanTableDC=u[o>>4],a.huffmanTableAC=l[15&o],D.push(a)}let O=e[i++],k=e[i++],ee=e[i++];try{i+=Hi(e,i,n,D,r,O,k,ee>>4,15&ee,T)}catch(t){if(t instanceof ki)return N(`${t.message} -- attempting to re-parse the JPEG image.`),this.parse(e,{dnlScanLines:t.scanLines});if(t instanceof Ai){N(`${t.message} -- ignoring the rest of the image data.`);break e}throw t}break;case 65500:i+=4;break;case 65535:e[i]!==255&&i--;break;default:let A=Gi(e,i-2,i-3);if(A?.invalid){N(`JpegImage.parse - unexpected data, current marker is: `+A.invalid),i=A.offset;break}if(!A||i>=e.length-1){N(`JpegImage.parse - reached the end of the image data without finding an EOI marker (0xFFD9).`);break e}throw new Oi(`JpegImage.parse - unknown marker: `+d.toString(16))}d=br(e,i),i+=2}if(!n)throw new Oi(`JpegImage.parse - no frame data found.`);this.width=n.samplesPerLine,this.height=n.scanLines,this.jfif=a,this.adobe=o,this.components=[];for(let e of n.components){let t=c[e.quantizationId];t&&(e.quantizationTable=t),this.components.push({index:e.index,output:Wi(0,e),scaleX:e.h/n.maxH,scaleY:e.v/n.maxV,blocksPerLine:e.blocksPerLine,blocksPerColumn:e.blocksPerColumn})}this.numComponents=this.components.length}_getLinearizedBlockData(e,t,n=!1){let r=this.width/e,i=this.height/t,a,o,s,c,l,u,d,f,p,m,h,g=0,_=this.components.length,v=e*t*_,y=new Uint8ClampedArray(v),b=new Uint32Array(e),x=4294967288,S;for(d=0;d<_;d++){if(a=this.components[d],o=a.scaleX*r,s=a.scaleY*i,g=d,h=a.output,c=a.blocksPerLine+1<<3,o!==S){for(l=0;l<e;l++)f=0|l*o,b[l]=(f&x)<<3|7&f;S=o}for(u=0;u<t;u++)for(f=0|u*s,m=c*(f&x)|(7&f)<<3,l=0;l<e;l++)y[g]=h[m+b[l]],g+=_}let C=this._decodeTransform;if(n||_!==4||C||(C=new Int32Array([-256,255,-256,255,-256,255,-256,255])),C)for(d=0;d<v;)for(f=0,p=0;f<_;f++,d++,p+=2)y[d]=(y[d]*C[p]>>8)+C[p+1];return y}get _isColorConversionNeeded(){return this.adobe?!!this.adobe.transformCode:this.numComponents===3?this._colorTransform!==0&&(this.components[0].index!==82||this.components[1].index!==71||this.components[2].index!==66):this._colorTransform===1}_convertYccToRgb(e){let t,n,r;for(let i=0,a=e.length;i<a;i+=3)t=e[i],n=e[i+1],r=e[i+2],e[i]=t-179.456+1.402*r,e[i+1]=t+135.459-.344*n-.714*r,e[i+2]=t-226.816+1.772*n;return e}_convertYccToRgba(e,t){for(let n=0,r=0,i=e.length;n<i;n+=3,r+=4){let i=e[n],a=e[n+1],o=e[n+2];t[r]=i-179.456+1.402*o,t[r+1]=i+135.459-.344*a-.714*o,t[r+2]=i-226.816+1.772*a,t[r+3]=255}return t}_convertYcckToRgb(e){return this._convertYcckToCmyk(e),this._convertCmykToRgb(e)}_convertYcckToRgba(e){return this._convertYcckToCmyk(e),this._convertCmykToRgba(e)}_convertYcckToCmyk(e){let t,n,r;for(let i=0,a=e.length;i<a;i+=4)t=e[i],n=e[i+1],r=e[i+2],e[i]=434.456-t-1.402*r,e[i+1]=119.541-t+.344*n+.714*r,e[i+2]=481.816-t-1.772*n;return e}_convertCmykToRgb(e){let t=e.length/4;return Di.cmyk.getRgbBuffer(e,0,t,e,0,8,0),e.subarray(0,3*t)}_convertCmykToRgba(e){if(Di.cmyk.getRgbBuffer(e,0,e.length/4,e,0,8,1),Di.cmyk instanceof li)for(let t=3,n=e.length;t<n;t+=4)e[t]=255;return e}getData({width:e,height:t,forceRGBA:n=!1,forceRGB:r=!1,isSourcePDF:i=!1}){if(this.numComponents>4)throw new Oi(`Unsupported color mode`);let a=this._getLinearizedBlockData(e,t,i);if(this.numComponents===1&&(n||r)){let e=a.length*(n?4:3),t=new Uint8ClampedArray(e),r=0;if(n)(function(e,t){if(kn.isLittleEndian)for(let n=0,r=e.length;n<r;n++)t[n]=65793*e[n]|4278190080;else for(let n=0,r=e.length;n<r;n++)t[n]=16843008*e[n]|255})(a,new Uint32Array(t.buffer));else for(let e of a)t[r++]=e,t[r++]=e,t[r++]=e;return t}if(this.numComponents===3&&this._isColorConversionNeeded){if(n){let e=new Uint8ClampedArray(a.length/3*4);return this._convertYccToRgba(a,e)}return this._convertYccToRgb(a)}if(this.numComponents===4){if(this._isColorConversionNeeded)return n?this._convertYcckToRgba(a):r?this._convertYcckToRgb(a):this._convertYcckToCmyk(a);if(n)return this._convertCmykToRgba(a);if(r)return this._convertCmykToRgb(a)}return a}},Xi=class e extends Ti{static#e=kn.isImageDecoderSupported;constructor(e,t,n){super(t),this.stream=e,this.dict=e.dict,this.maybeLength=t,this.params=n}static get canUseImageDecoder(){return P(this,`canUseImageDecoder`,this.#e?ImageDecoder.isTypeSupported(`image/jpeg`):Promise.resolve(!1))}static setOptions({isImageDecoderSupported:e=!1}){this.#e=e}get bytes(){return P(this,`bytes`,this.stream.getBytes(this.maybeLength))}ensureBuffer(e){}readBlock(){this.decodeImage()}get jpegOptions(){let e={decodeTransform:void 0,colorTransform:void 0},t=this.dict.getArray(`D`,`Decode`);if((this.forceRGBA||this.forceRGB)&&Array.isArray(t)){let n=this.dict.get(`BPC`,`BitsPerComponent`)||8,r=t.length,i=new Int32Array(r),a=!1,o=(1<<n)-1;for(let e=0;e<r;e+=2)i[e]=256*(t[e+1]-t[e])|0,i[e+1]=t[e]*o|0,i[e]===256&&i[e+1]===0||(a=!0);a&&(e.decodeTransform=i)}if(this.params instanceof L){let t=this.params.get(`ColorTransform`);Number.isInteger(t)&&(e.colorTransform=t)}return P(this,`jpegOptions`,e)}#t(e){for(let t=0,n=e.length-1;t<n;t++)if(e[t]===255&&e[t+1]===216){t>0&&(e=e.subarray(t));break}return e}decodeImage(e){if(this.eof)return this.buffer;e=this.#t(e||this.bytes);let t=new Yi(this.jpegOptions);t.parse(e);let n=t.getData({width:this.drawWidth,height:this.drawHeight,forceRGBA:this.forceRGBA,forceRGB:this.forceRGB,isSourcePDF:!0});return this.buffer=n,this.bufferLength=n.length,this.eof=!0,this.buffer}get canAsyncDecodeImageFromBuffer(){return this.stream.isAsync}async getTransferableImage(){if(!await e.canUseImageDecoder)return null;let t=this.jpegOptions;if(t.decodeTransform)return null;let n;try{let e=this.canAsyncDecodeImageFromBuffer&&await this.stream.asyncGetBytes()||this.bytes;if(!e)return null;let r=this.#t(e),i=Yi.canUseImageDecoder(r,t.colorTransform);return i?(i.exifStart&&(r=r.slice(),r.fill(0,i.exifStart,i.exifEnd)),n=new ImageDecoder({data:r,type:`image/jpeg`,preferAnimation:!1}),(await n.decode()).image):null}catch(e){return N(`getTransferableImage - failed: "${e}".`),null}finally{n?.close()}}},Zi=class extends yn{constructor(e){super(e,`JpxError`)}},Qi=class{static#e=null;static#t=null;static#n=!0;static#r=!0;static#i=null;static setOptions({handler:e,useWasm:t,useWorkerFetch:n,wasmUrl:r}){this.#n=t,this.#r=n,this.#i=r,n||(this.#e=e)}static async decode(e,{numComponents:t=4,isIndexedColormap:n=!1,smaskInData:r=!1,reducePower:i=0}={}){let a=await this.#t;if(!a)throw new Zi(`OpenJPEG failed to initialize`);let o;try{let s=e.length;if(o=a._malloc(s),a.writeArrayToMemory(e,o),a._jp2_decode(o,s,t>0?t:0,!!n,!!r,i)){let{errorMessages:e}=a;throw e?(delete a.errorMessages,new Zi(e)):new Zi(`Unknown error`)}let{imageData:c}=a;return a.imageData=null,c}finally{o&&a._free(o)}}static cleanup(){this.#t=null}static parseImageProperties(e){let t=e.getByte();for(;t>=0;){let n=t;if(t=e.getByte(),(n<<8|t)==65361){e.skip(4);let t=e.getInt32()>>>0,n=e.getInt32()>>>0,r=e.getInt32()>>>0,i=e.getInt32()>>>0;return e.skip(16),{width:t-r,height:n-i,bitsPerComponent:8,componentsCount:e.getUint16()}}}throw new Zi(`No size marker found in JPX stream`)}};function $i(e,t,n,r,i){let a=e;for(let e=0,n=t.length-1;e<n;e++){let n=t[e];a=a[n]||=[]}a[t.at(-1)]={checkFn:n,iterateFn:r,processFn:i}}var ea=[];$i(ea,[Ne,Fe,Qt,Pe],null,function(e,t){let n=e.fnArray,r=(t-(e.iCurr-3))%4;switch(r){case 0:return n[t]===Ne;case 1:return n[t]===Fe;case 2:return n[t]===Qt;case 3:return n[t]===Pe}throw Error(`iterateInlineImageGroup - invalid pos: ${r}`)},function(e,t){let n=e.fnArray,r=e.argsArray,i=e.iCurr,a=i-3,o=i-2,s=i-1,c=Math.min(Math.floor((t-a)/4),200);if(c<10)return t-(t-a)%4;let l=0,u=[],d=0,f=1,p=1;for(let e=0;e<c;e++){let t=r[o+(e<<2)],n=r[s+(e<<2)][0];f+n.width>1e3&&(l=Math.max(l,f),p+=d+2,f=0,d=0),u.push({transform:t,x:f,y:p,w:n.width,h:n.height}),f+=n.width+2,d=Math.max(d,n.height)}let m=Math.max(l,f)+1,h=p+d+1,g=new Uint8Array(m*h*4),_=m<<2;for(let e=0;e<c;e++){let t=r[s+(e<<2)][0].data,n=u[e].w<<2,i=0,a=u[e].x+u[e].y*m<<2;g.set(t.subarray(0,n),a-_);for(let r=0,o=u[e].h;r<o;r++)g.set(t.subarray(i,i+n),a),i+=n,a+=_;for(g.set(t.subarray(i-n,i),a);a>=0;)t[a-4]=t[a],t[a-3]=t[a+1],t[a-2]=t[a+2],t[a-1]=t[a+3],t[a+n]=t[a+n-4],t[a+n+1]=t[a+n-3],t[a+n+2]=t[a+n-2],t[a+n+3]=t[a+n-1],a-=_}let v={width:m,height:h};if(e.isOffscreenCanvasSupported){let e=new OffscreenCanvas(m,h);e.getContext(`2d`).putImageData(new ImageData(new Uint8ClampedArray(g.buffer),m,h),0,0),v.bitmap=e.transferToImageBitmap(),v.data=null}else v.kind=T,v.data=g;return n.splice(a,4*c,$t),r.splice(a,4*c,[v,u]),a+1}),$i(ea,[Ne,Fe,Yt,Pe],null,function(e,t){let n=e.fnArray,r=(t-(e.iCurr-3))%4;switch(r){case 0:return n[t]===Ne;case 1:return n[t]===Fe;case 2:return n[t]===Yt;case 3:return n[t]===Pe}throw Error(`iterateImageMaskGroup - invalid pos: ${r}`)},function(e,t){let n=e.fnArray,r=e.argsArray,i=e.iCurr,a=i-3,o=i-2,s=i-1,c=Math.floor((t-a)/4);if(c<10)return t-(t-a)%4;let l,u,d=!1,f=r[s][0],p=r[o][0],m=r[o][1],h=r[o][2],g=r[o][3];if(m===h){d=!0,l=o+4;let e=s+4;for(let t=1;t<c;t++,l+=4,e+=4)if(u=r[l],r[e][0]!==f||u[0]!==p||u[1]!==m||u[2]!==h||u[3]!==g){t<10?d=!1:c=t;break}}if(d){c=Math.min(c,1e3);let e=new Float32Array(2*c);l=o;for(let t=0;t<c;t++,l+=4)u=r[l],e[t<<1]=u[4],e[1+(t<<1)]=u[5];n.splice(a,4*c,tn),r.splice(a,4*c,[f,p,m,h,g,e])}else{c=Math.min(c,100);let e=[];for(let t=0;t<c;t++){u=r[o+(t<<2)];let n=r[s+(t<<2)][0];e.push({data:n.data,width:n.width,height:n.height,interpolate:n.interpolate,count:n.count,transform:u})}n.splice(a,4*c,Xt),r.splice(a,4*c,[e])}return a+1}),$i(ea,[Ne,Fe,Zt,Pe],function(e){let t=e.argsArray,n=e.iCurr-2;return t[n][1]===0&&t[n][2]===0},function(e,t){let n=e.fnArray,r=e.argsArray,i=(t-(e.iCurr-3))%4;switch(i){case 0:return n[t]===Ne;case 1:if(n[t]!==Fe)return!1;let i=e.iCurr-2,a=r[i][0],o=r[i][3];return r[t][0]===a&&r[t][1]===0&&r[t][2]===0&&r[t][3]===o;case 2:if(n[t]!==Zt)return!1;let s=r[e.iCurr-1][0];return r[t][0]===s;case 3:return n[t]===Pe}throw Error(`iterateImageGroup - invalid pos: ${i}`)},function(e,t){let n=e.fnArray,r=e.argsArray,i=e.iCurr,a=i-3,o=i-2,s=r[i-1][0],c=r[o][0],l=r[o][3],u=Math.min(Math.floor((t-a)/4),1e3);if(u<3)return t-(t-a)%4;let d=new Float32Array(2*u),f=o;for(let e=0;e<u;e++,f+=4){let t=r[f];d[e<<1]=t[4],d[1+(e<<1)]=t[5]}let p=[s,c,l,d];return n.splice(a,4*u,en),r.splice(a,4*u,p),a+1}),$i(ea,[et,ot,dt,pt,tt],null,function(e,t){let n=e.fnArray,r=e.argsArray,i=(t-(e.iCurr-4))%5;switch(i){case 0:return n[t]===et;case 1:return n[t]===ot;case 2:return n[t]===dt;case 3:if(n[t]!==pt)return!1;let i=e.iCurr-3,a=r[i][0],o=r[i][1];return r[t][0]===a&&r[t][1]===o;case 4:return n[t]===tt}throw Error(`iterateShowTextGroup - invalid pos: ${i}`)},function(e,t){let n=e.fnArray,r=e.argsArray,i=e.iCurr,a=i-4,o=i-3,s=i-2,c=i-1,l=i,u=r[o][0],d=r[o][1],f=Math.min(Math.floor((t-a)/5),1e3);if(f<3)return t-(t-a)%5;let p=a;a>=4&&n[a-4]===n[o]&&n[a-3]===n[s]&&n[a-2]===n[c]&&n[a-1]===n[l]&&r[a-4][0]===u&&r[a-4][1]===d&&(f++,p-=5);let m=p+4;for(let e=1;e<f;e++)n.splice(m,3),r.splice(m,3),m+=2;return m+1}),$i(ea,[Ne,Fe,rn,Pe],e=>{let t=e.argsArray,n=t[e.iCurr-1][0];if(n!==Ue&&n!==We&&n!==qe&&n!==Je&&n!==Ye&&n!==Xe)return!0;let r=t[e.iCurr-2];return r[0]===1&&r[1]===0&&r[2]===0&&r[3]===1},()=>!1,(e,t)=>{let{fnArray:n,argsArray:r}=e,i=e.iCurr,a=i-3,o=i-2,s=r[i-1],c=r[o],[,[l],u]=s;if(u){jn.scaleMinMax(c,u);for(let e=0,t=l.length;e<t;)switch(l[e++]){case cn:case ln:jn.applyTransform(l,c,e),e+=2;break;case un:jn.applyTransformToBezier(l,c,e),e+=6}}return n.splice(a,4,rn),r.splice(a,4,s),a+1});var ta=class{constructor(e){this.queue=e}_optimize(){}push(e,t){this.queue.fnArray.push(e),this.queue.argsArray.push(t),this._optimize()}flush(){}reset(){}},na=class extends ta{constructor(e){super(e),this.state=null,this.context={iCurr:0,fnArray:e.fnArray,argsArray:e.argsArray,isOffscreenCanvasSupported:ra.isOffscreenCanvasSupported},this.match=null,this.lastProcessed=0}_optimize(){let e=this.queue.fnArray,t=this.lastProcessed,n=e.length,r=this.state,i=this.match;if(!r&&!i&&t+1===n&&!ea[e[t]])return void(this.lastProcessed=n);let a=this.context;for(;t<n;){if(i){if((0,i.iterateFn)(a,t)){t++;continue}if(t=(0,i.processFn)(a,t+1),n=e.length,i=null,r=null,t>=n)break}r=(r||ea)[e[t]],r&&!Array.isArray(r)?(a.iCurr=t,t++,(!r.checkFn||(0,r.checkFn)(a))&&(i=r),r=null):t++}this.state=r,this.match=i,this.lastProcessed=t}flush(){for(;this.match;){let e=this.queue.fnArray.length;this.lastProcessed=(0,this.match.processFn)(this.context,e),this.match=null,this.state=null,this._optimize()}}reset(){this.state=null,this.match=null,this.lastProcessed=0}},ra=class e{static CHUNK_SIZE=1e3;static CHUNK_SIZE_ABOUT=this.CHUNK_SIZE-5;static isOffscreenCanvasSupported=!1;constructor(e=0,t){this._streamSink=t,this.fnArray=[],this.argsArray=[],this.optimizer=!t||e&p?new ta(this):new na(this),this.dependencies=new Set,this._totalLength=0,this.weight=0,this._resolved=t?null:Promise.resolve()}static setOptions({isOffscreenCanvasSupported:e}){this.isOffscreenCanvasSupported=e}get length(){return this.argsArray.length}get ready(){return this._resolved||this._streamSink.ready}get totalLength(){return this._totalLength+this.length}addOp(t,n){this.optimizer.push(t,n),this.weight++,this._streamSink&&(this.weight>=e.CHUNK_SIZE||this.weight>=e.CHUNK_SIZE_ABOUT&&(t===Pe||t===tt))&&this.flush()}addImageOps(e,t,n,r=!1){r&&(this.addOp(Ne),this.addOp(Me,[[[`SMask`,!1]]])),n!==void 0&&this.addOp(zt,[`OC`,n]),this.addOp(e,t),n!==void 0&&this.addOp(Bt,[]),r&&this.addOp(Pe)}addDependency(e){this.dependencies.has(e)||(this.dependencies.add(e),this.addOp(we,[e]))}addDependencies(e){for(let t of e)this.addDependency(t)}addOpList(t){if(t instanceof e){for(let e of t.dependencies)this.dependencies.add(e);for(let e=0,n=t.length;e<n;e++)this.addOp(t.fnArray[e],t.argsArray[e])}else N(`addOpList - ignoring invalid "opList" parameter.`)}getIR(){return{fnArray:this.fnArray,argsArray:this.argsArray,length:this.length}}get _transfers(){let e=[],{fnArray:t,argsArray:n,length:r}=this;for(let i=0;i<r;i++)switch(t[i]){case Qt:case $t:case Yt:{let{bitmap:t,data:r}=n[i][0];(t||r?.buffer)&&e.push(t||r.buffer);break}case rn:{let[,[t],r]=n[i];t&&e.push(t.buffer,r.buffer);break}case Ut:let[t,r]=n[i];t&&e.push(t.buffer),r&&e.push(r.buffer);break;case dt:e.push(n[i][0].buffer)}return e}flush(e=!1,t=null){this.optimizer.flush();let n=this.length;this._totalLength+=n,this._streamSink.enqueue({fnArray:this.fnArray,argsArray:this.argsArray,lastChunk:e,separateAnnots:t,length:n},1,this._transfers),this.dependencies.clear(),this.fnArray.length=0,this.argsArray.length=0,this.weight=0,this.optimizer.reset()}};function ia(e,t){let n=0;for(let r=0;r<=t;r++)n=n<<8|e[r];return n>>>0}function aa(e,t){return t===1?String.fromCharCode(e[0],e[1]):t===3?String.fromCharCode(e[0],e[1],e[2],e[3]):String.fromCharCode(...e.subarray(0,t+1))}function oa(e,t,n){let r=0;for(let i=n;i>=0;i--)r+=e[i]+t[i],e[i]=255&r,r>>=8}function sa(e,t){let n=1;for(let r=t;r>=0&&n>0;r--)n+=e[r],e[r]=255&n,n>>=8}var ca=16,la=class{constructor(e){this.buffer=e,this.pos=0,this.end=e.length,this.tmpBuf=new Uint8Array(19)}readByte(){return this.pos>=this.end?-1:this.buffer[this.pos++]}readNumber(){let e,t=0;do{let n=this.readByte();if(n<0)throw new F(`unexpected EOF in bcmap`);e=!(128&n),t=t<<7|127&n}while(!e);return t}readSigned(){let e=this.readNumber();return 1&e?~(e>>>1):e>>>1}readHex(e,t){e.set(this.buffer.subarray(this.pos,this.pos+t+1)),this.pos+=t+1}readHexNumber(e,t){let n,r=this.tmpBuf,i=0;do{let e=this.readByte();if(e<0)throw new F(`unexpected EOF in bcmap`);n=!(128&e),r[i++]=127&e}while(!n);let a=t,o=0,s=0;for(;a>=0;){for(;s<8&&r.length>0;)o|=r[--i]<<s,s+=7;e[a]=255&o,a--,o>>=8,s-=8}}readHexSigned(e,t){this.readHexNumber(e,t);let n=1&e[t]?255:0,r=0;for(let i=0;i<=t;i++)r=(1&r)<<8|e[i],e[i]=r>>1^n}readString(){let e=this.readNumber(),t=Array(e);for(let n=0;n<e;n++)t[n]=this.readNumber();return String.fromCharCode(...t)}},ua=class{async process(e,t,n){let r=new la(e);t.vertical=!!(1&r.readByte());let i=null,a=new Uint8Array(ca),o=new Uint8Array(ca),s=new Uint8Array(ca),c=new Uint8Array(ca),l=new Uint8Array(ca),u,d;for(;(d=r.readByte())>=0;){let e=d>>5;if(e===7){switch(31&d){case 0:r.readString();break;case 1:i=r.readString()}continue}let n=!!(16&d),f=15&d;if(f+1>ca)throw Error(`BinaryCMapReader.process: Invalid dataSize.`);let p=r.readNumber();switch(e){case 0:r.readHex(a,f),r.readHexNumber(o,f),oa(o,a,f),t.addCodespaceRange(f+1,ia(a,f),ia(o,f));for(let e=1;e<p;e++)sa(o,f),r.readHexNumber(a,f),oa(a,o,f),r.readHexNumber(o,f),oa(o,a,f),t.addCodespaceRange(f+1,ia(a,f),ia(o,f));break;case 1:r.readHex(a,f),r.readHexNumber(o,f),oa(o,a,f),r.readNumber();for(let e=1;e<p;e++)sa(o,f),r.readHexNumber(a,f),oa(a,o,f),r.readHexNumber(o,f),oa(o,a,f),r.readNumber();break;case 2:r.readHex(s,f),u=r.readNumber(),t.mapOne(ia(s,f),u);for(let e=1;e<p;e++)sa(s,f),n||(r.readHexNumber(l,f),oa(s,l,f)),u=r.readSigned()+(u+1),t.mapOne(ia(s,f),u);break;case 3:r.readHex(a,f),r.readHexNumber(o,f),oa(o,a,f),u=r.readNumber(),t.mapCidRange(ia(a,f),ia(o,f),u);for(let e=1;e<p;e++)sa(o,f),n?a.set(o):(r.readHexNumber(a,f),oa(a,o,f)),r.readHexNumber(o,f),oa(o,a,f),u=r.readNumber(),t.mapCidRange(ia(a,f),ia(o,f),u);break;case 4:r.readHex(s,1),r.readHex(c,f),t.mapOne(ia(s,1),aa(c,f));for(let e=1;e<p;e++)sa(s,1),n||(r.readHexNumber(l,1),oa(s,l,1)),sa(c,f),r.readHexSigned(l,f),oa(c,l,f),t.mapOne(ia(s,1),aa(c,f));break;case 5:r.readHex(a,1),r.readHexNumber(o,1),oa(o,a,1),r.readHex(c,f),t.mapBfRange(ia(a,1),ia(o,1),aa(c,f));for(let e=1;e<p;e++)sa(o,1),n?a.set(o):(r.readHexNumber(a,1),oa(a,o,1)),r.readHexNumber(o,1),oa(o,a,1),r.readHex(c,f),t.mapBfRange(ia(a,1),ia(o,1),aa(c,f));break;default:throw Error(`BinaryCMapReader.process - unknown type: ${e}`)}}return i?n(i):t}},da=class extends Ti{constructor(e,t){t&&(t*=.8),super(t),this.str=e,this.dict=e.dict,this.input=new Uint8Array(5)}readBlock(){let e=this.str,t=e.getByte();for(;Sr(t);)t=e.getByte();if(t===-1||t===126)return void(this.eof=!0);let n=this.bufferLength,r,i;if(t===122){for(r=this.ensureBuffer(n+4),i=0;i<4;++i)r[n+i]=0;this.bufferLength+=4}else{let a=this.input;for(a[0]=t,i=1;i<5;++i){for(t=e.getByte();Sr(t);)t=e.getByte();if(a[i]=t,t===-1||t===126)break}if(r=this.ensureBuffer(n+i-1),this.bufferLength+=i-1,i<5){for(;i<5;++i)a[i]=117;this.eof=!0}let o=0;for(i=0;i<5;++i)o=85*o+(a[i]-33);for(i=3;i>=0;--i)r[n+i]=255&o,o>>=8}}},fa=class extends Ti{constructor(e,t){t&&(t*=.5),super(t),this.str=e,this.dict=e.dict,this.firstDigit=-1}readBlock(){let e=this.str.getBytes(8e3);if(!e.length)return void(this.eof=!0);let t=e.length+1>>1,n=this.ensureBuffer(this.bufferLength+t),r=this.bufferLength,i=this.firstDigit;for(let t of e){let e;if(t>=48&&t<=57)e=15&t;else{if(!(t>=65&&t<=70||t>=97&&t<=102)){if(t===62){this.eof=!0;break}continue}e=9+(15&t)}i<0?i=e:(n[r++]=i<<4|e,i=-1)}i>=0&&this.eof&&(n[r++]=i<<4,i=-1),this.firstDigit=i,this.bufferLength=r}},pa=-1,ma=[[-1,-1],[-1,-1],[7,8],[7,7],[6,6],[6,6],[6,5],[6,5],[4,0],[4,0],[4,0],[4,0],[4,0],[4,0],[4,0],[4,0],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2]],ha=[[-1,-1],[12,-2],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[11,1792],[11,1792],[12,1984],[12,2048],[12,2112],[12,2176],[12,2240],[12,2304],[11,1856],[11,1856],[11,1920],[11,1920],[12,2368],[12,2432],[12,2496],[12,2560]],ga=[[-1,-1],[-1,-1],[-1,-1],[-1,-1],[8,29],[8,29],[8,30],[8,30],[8,45],[8,45],[8,46],[8,46],[7,22],[7,22],[7,22],[7,22],[7,23],[7,23],[7,23],[7,23],[8,47],[8,47],[8,48],[8,48],[6,13],[6,13],[6,13],[6,13],[6,13],[6,13],[6,13],[6,13],[7,20],[7,20],[7,20],[7,20],[8,33],[8,33],[8,34],[8,34],[8,35],[8,35],[8,36],[8,36],[8,37],[8,37],[8,38],[8,38],[7,19],[7,19],[7,19],[7,19],[8,31],[8,31],[8,32],[8,32],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,12],[6,12],[6,12],[6,12],[6,12],[6,12],[6,12],[6,12],[8,53],[8,53],[8,54],[8,54],[7,26],[7,26],[7,26],[7,26],[8,39],[8,39],[8,40],[8,40],[8,41],[8,41],[8,42],[8,42],[8,43],[8,43],[8,44],[8,44],[7,21],[7,21],[7,21],[7,21],[7,28],[7,28],[7,28],[7,28],[8,61],[8,61],[8,62],[8,62],[8,63],[8,63],[8,0],[8,0],[8,320],[8,320],[8,384],[8,384],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[7,27],[7,27],[7,27],[7,27],[8,59],[8,59],[8,60],[8,60],[9,1472],[9,1536],[9,1600],[9,1728],[7,18],[7,18],[7,18],[7,18],[7,24],[7,24],[7,24],[7,24],[8,49],[8,49],[8,50],[8,50],[8,51],[8,51],[8,52],[8,52],[7,25],[7,25],[7,25],[7,25],[8,55],[8,55],[8,56],[8,56],[8,57],[8,57],[8,58],[8,58],[6,192],[6,192],[6,192],[6,192],[6,192],[6,192],[6,192],[6,192],[6,1664],[6,1664],[6,1664],[6,1664],[6,1664],[6,1664],[6,1664],[6,1664],[8,448],[8,448],[8,512],[8,512],[9,704],[9,768],[8,640],[8,640],[8,576],[8,576],[9,832],[9,896],[9,960],[9,1024],[9,1088],[9,1152],[9,1216],[9,1280],[9,1344],[9,1408],[7,256],[7,256],[7,256],[7,256],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[6,16],[6,16],[6,16],[6,16],[6,16],[6,16],[6,16],[6,16],[6,17],[6,17],[6,17],[6,17],[6,17],[6,17],[6,17],[6,17],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[6,14],[6,14],[6,14],[6,14],[6,14],[6,14],[6,14],[6,14],[6,15],[6,15],[6,15],[6,15],[6,15],[6,15],[6,15],[6,15],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7]],_a=[[-1,-1],[-1,-1],[12,-2],[12,-2],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[11,1792],[11,1792],[11,1792],[11,1792],[12,1984],[12,1984],[12,2048],[12,2048],[12,2112],[12,2112],[12,2176],[12,2176],[12,2240],[12,2240],[12,2304],[12,2304],[11,1856],[11,1856],[11,1856],[11,1856],[11,1920],[11,1920],[11,1920],[11,1920],[12,2368],[12,2368],[12,2432],[12,2432],[12,2496],[12,2496],[12,2560],[12,2560],[10,18],[10,18],[10,18],[10,18],[10,18],[10,18],[10,18],[10,18],[12,52],[12,52],[13,640],[13,704],[13,768],[13,832],[12,55],[12,55],[12,56],[12,56],[13,1280],[13,1344],[13,1408],[13,1472],[12,59],[12,59],[12,60],[12,60],[13,1536],[13,1600],[11,24],[11,24],[11,24],[11,24],[11,25],[11,25],[11,25],[11,25],[13,1664],[13,1728],[12,320],[12,320],[12,384],[12,384],[12,448],[12,448],[13,512],[13,576],[12,53],[12,53],[12,54],[12,54],[13,896],[13,960],[13,1024],[13,1088],[13,1152],[13,1216],[10,64],[10,64],[10,64],[10,64],[10,64],[10,64],[10,64],[10,64]],va=[[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[11,23],[11,23],[12,50],[12,51],[12,44],[12,45],[12,46],[12,47],[12,57],[12,58],[12,61],[12,256],[10,16],[10,16],[10,16],[10,16],[10,17],[10,17],[10,17],[10,17],[12,48],[12,49],[12,62],[12,63],[12,30],[12,31],[12,32],[12,33],[12,40],[12,41],[11,22],[11,22],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[9,15],[9,15],[9,15],[9,15],[9,15],[9,15],[9,15],[9,15],[12,128],[12,192],[12,26],[12,27],[12,28],[12,29],[11,19],[11,19],[11,20],[11,20],[12,34],[12,35],[12,36],[12,37],[12,38],[12,39],[11,21],[11,21],[12,42],[12,43],[10,0],[10,0],[10,0],[10,0],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12]],ya=[[-1,-1],[-1,-1],[-1,-1],[-1,-1],[6,9],[6,8],[5,7],[5,7],[4,6],[4,6],[4,6],[4,6],[4,5],[4,5],[4,5],[4,5],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2]],ba=class{constructor(e,t={}){if(typeof e?.next!=`function`)throw Error(`CCITTFaxDecoder - invalid "source" parameter.`);let n;for(this.source=e,this.eof=!1,this.encoding=t.K||0,this.eoline=t.EndOfLine||!1,this.byteAlign=t.EncodedByteAlign||!1,this.columns=t.Columns||1728,this.rows=t.Rows||0,this.eoblock=t.EndOfBlock??!0,this.black=t.BlackIs1||!1,this.codingLine=new Uint32Array(this.columns+1),this.refLine=new Uint32Array(this.columns+2),this.codingLine[0]=this.columns,this.codingPos=0,this.row=0,this.nextLine2D=this.encoding<0,this.inputBits=0,this.inputBuf=0,this.outputBits=0,this.rowsDone=!1;(n=this._lookBits(12))===0;)this._eatBits(1);n===1&&this._eatBits(12),this.encoding>0&&(this.nextLine2D=!this._lookBits(1),this._eatBits(1))}readNextChar(){if(this.eof)return-1;let e=this.refLine,t=this.codingLine,n=this.columns,r,i,a,o,s;if(this.outputBits===0){if(this.rowsDone&&(this.eof=!0),this.eof)return-1;let a,s,c;if(this.err=!1,this.nextLine2D){for(o=0;t[o]<n;++o)e[o]=t[o];for(e[o++]=n,e[o]=n,t[0]=0,this.codingPos=0,r=0,i=0;t[this.codingPos]<n;)switch(a=this._getTwoDimCode(),a){case 0:this._addPixels(e[r+1],i),e[r+1]<n&&(r+=2);break;case 1:if(a=s=0,i){do a+=c=this._getBlackCode();while(c>=64);do s+=c=this._getWhiteCode();while(c>=64)}else{do a+=c=this._getWhiteCode();while(c>=64);do s+=c=this._getBlackCode();while(c>=64)}for(this._addPixels(t[this.codingPos]+a,i),t[this.codingPos]<n&&this._addPixels(t[this.codingPos]+s,1^i);e[r]<=t[this.codingPos]&&e[r]<n;)r+=2;break;case 7:if(this._addPixels(e[r]+3,i),i^=1,t[this.codingPos]<n)for(++r;e[r]<=t[this.codingPos]&&e[r]<n;)r+=2;break;case 5:if(this._addPixels(e[r]+2,i),i^=1,t[this.codingPos]<n)for(++r;e[r]<=t[this.codingPos]&&e[r]<n;)r+=2;break;case 3:if(this._addPixels(e[r]+1,i),i^=1,t[this.codingPos]<n)for(++r;e[r]<=t[this.codingPos]&&e[r]<n;)r+=2;break;case 2:if(this._addPixels(e[r],i),i^=1,t[this.codingPos]<n)for(++r;e[r]<=t[this.codingPos]&&e[r]<n;)r+=2;break;case 8:if(this._addPixelsNeg(e[r]-3,i),i^=1,t[this.codingPos]<n)for(r>0?--r:++r;e[r]<=t[this.codingPos]&&e[r]<n;)r+=2;break;case 6:if(this._addPixelsNeg(e[r]-2,i),i^=1,t[this.codingPos]<n)for(r>0?--r:++r;e[r]<=t[this.codingPos]&&e[r]<n;)r+=2;break;case 4:if(this._addPixelsNeg(e[r]-1,i),i^=1,t[this.codingPos]<n)for(r>0?--r:++r;e[r]<=t[this.codingPos]&&e[r]<n;)r+=2;break;case pa:this._addPixels(n,0),this.eof=!0;break;default:hn(`bad 2d code`),this._addPixels(n,0),this.err=!0}}else for(t[0]=0,this.codingPos=0,i=0;t[this.codingPos]<n;){if(a=0,i)do a+=c=this._getBlackCode();while(c>=64);else do a+=c=this._getWhiteCode();while(c>=64);this._addPixels(t[this.codingPos]+a,i),i^=1}let l=!1;if(this.byteAlign&&(this.inputBits&=-8),this.eoblock||this.row!==this.rows-1){if(a=this._lookBits(12),this.eoline)for(;a!==pa&&a!==1;)this._eatBits(1),a=this._lookBits(12);else for(;a===0;)this._eatBits(1),a=this._lookBits(12);a===1?(this._eatBits(12),l=!0):a===pa&&(this.eof=!0)}else this.rowsDone=!0;if(!this.eof&&this.encoding>0&&!this.rowsDone&&(this.nextLine2D=!this._lookBits(1),this._eatBits(1)),this.eoblock&&l&&this.byteAlign){if(a=this._lookBits(12),a===1){if(this._eatBits(12),this.encoding>0&&(this._lookBits(1),this._eatBits(1)),this.encoding>=0)for(o=0;o<4;++o)a=this._lookBits(12),a!==1&&hn(`bad rtc code: `+a),this._eatBits(12),this.encoding>0&&(this._lookBits(1),this._eatBits(1));this.eof=!0}}else if(this.err&&this.eoline){for(;;){if(a=this._lookBits(13),a===pa)return this.eof=!0,-1;if(a>>1==1)break;this._eatBits(1)}this._eatBits(12),this.encoding>0&&(this._eatBits(1),this.nextLine2D=!(1&a))}this.outputBits=t[0]>0?t[this.codingPos=0]:t[this.codingPos=1],this.row++}if(this.outputBits>=8)s=1&this.codingPos?0:255,this.outputBits-=8,this.outputBits===0&&t[this.codingPos]<n&&(this.codingPos++,this.outputBits=t[this.codingPos]-t[this.codingPos-1]);else{a=8,s=0;do{if(typeof this.outputBits!=`number`)throw new F(`Invalid /CCITTFaxDecode data, "outputBits" must be a number.`);this.outputBits>a?(s<<=a,1&this.codingPos||(s|=255>>8-a),this.outputBits-=a,a=0):(s<<=this.outputBits,1&this.codingPos||(s|=255>>8-this.outputBits),a-=this.outputBits,this.outputBits=0,t[this.codingPos]<n?(this.codingPos++,this.outputBits=t[this.codingPos]-t[this.codingPos-1]):a>0&&(s<<=a,a=0))}while(a)}return this.black&&(s^=255),s}_addPixels(e,t){let n=this.codingLine,r=this.codingPos;e>n[r]&&(e>this.columns&&(hn(`row is wrong length`),this.err=!0,e=this.columns),1&r^t&&++r,n[r]=e),this.codingPos=r}_addPixelsNeg(e,t){let n=this.codingLine,r=this.codingPos;if(e>n[r])e>this.columns&&(hn(`row is wrong length`),this.err=!0,e=this.columns),1&r^t&&++r,n[r]=e;else if(e<n[r]){for(e<0&&(hn(`invalid code`),this.err=!0,e=0);r>0&&e<n[r-1];)--r;n[r]=e}this.codingPos=r}_findTableCode(e,t,n,r){let i=r||0;for(let r=e;r<=t;++r){let e=this._lookBits(r);if(e===pa)return[!0,1,!1];if(r<t&&(e<<=t-r),!i||e>=i){let t=n[e-i];if(t[0]===r)return this._eatBits(r),[!0,t[1],!0]}}return[!1,0,!1]}_getTwoDimCode(){let e,t=0;if(this.eoblock){if(t=this._lookBits(7),e=ma[t],e?.[0]>0)return this._eatBits(e[0]),e[1]}else{let e=this._findTableCode(1,7,ma);if(e[0]&&e[2])return e[1]}return hn(`Bad two dim code`),pa}_getWhiteCode(){let e,t=0;if(this.eoblock){if(t=this._lookBits(12),t===pa)return 1;if(e=t>>5?ga[t>>3]:ha[t],e[0]>0)return this._eatBits(e[0]),e[1]}else{let e=this._findTableCode(1,9,ga);if(e[0]||(e=this._findTableCode(11,12,ha),e[0]))return e[1]}return hn(`bad white code`),this._eatBits(1),1}_getBlackCode(){let e,t;if(this.eoblock){if(e=this._lookBits(13),e===pa)return 1;if(t=e>>7?!(e>>9)&&e>>7?va[(e>>1)-64]:ya[e>>7]:_a[e],t[0]>0)return this._eatBits(t[0]),t[1]}else{let e=this._findTableCode(2,6,ya);if(e[0]||(e=this._findTableCode(7,12,va,64),e[0])||(e=this._findTableCode(10,13,_a),e[0]))return e[1]}return hn(`bad black code`),this._eatBits(1),1}_lookBits(e){let t;for(;this.inputBits<e;){if((t=this.source.next())===-1)return this.inputBits===0?pa:this.inputBuf<<e-this.inputBits&65535>>16-e;this.inputBuf=this.inputBuf<<8|t,this.inputBits+=8}return this.inputBuf>>this.inputBits-e&65535>>16-e}_eatBits(e){(this.inputBits-=e)<0&&(this.inputBits=0)}},xa=class extends Ti{constructor(e,t,n){super(t),this.str=e,this.dict=e.dict,n instanceof L||(n=L.empty);let r={next:()=>e.getByte()};this.ccittFaxDecoder=new ba(r,{K:n.get(`K`),EndOfLine:n.get(`EndOfLine`),EncodedByteAlign:n.get(`EncodedByteAlign`),Columns:n.get(`Columns`),Rows:n.get(`Rows`),EndOfBlock:n.get(`EndOfBlock`),BlackIs1:n.get(`BlackIs1`)})}readBlock(){for(;!this.eof;){let e=this.ccittFaxDecoder.readNextChar();if(e===-1)return void(this.eof=!0);this.ensureBuffer(this.bufferLength+1),this.buffer[this.bufferLength++]=e}}},Sa=new Int32Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Ca=new Int32Array([3,4,5,6,7,8,9,10,65547,65549,65551,65553,131091,131095,131099,131103,196643,196651,196659,196667,262211,262227,262243,262259,327811,327843,327875,327907,258,258,258]),wa=new Int32Array([1,2,3,4,65541,65543,131081,131085,196625,196633,262177,262193,327745,327777,393345,393409,459009,459137,524801,525057,590849,591361,657409,658433,724993,727041,794625,798721,868353,876545]),Ta=[new Int32Array([459008,524368,524304,524568,459024,524400,524336,590016,459016,524384,524320,589984,524288,524416,524352,590048,459012,524376,524312,589968,459028,524408,524344,590032,459020,524392,524328,59e4,524296,524424,524360,590064,459010,524372,524308,524572,459026,524404,524340,590024,459018,524388,524324,589992,524292,524420,524356,590056,459014,524380,524316,589976,459030,524412,524348,590040,459022,524396,524332,590008,524300,524428,524364,590072,459009,524370,524306,524570,459025,524402,524338,590020,459017,524386,524322,589988,524290,524418,524354,590052,459013,524378,524314,589972,459029,524410,524346,590036,459021,524394,524330,590004,524298,524426,524362,590068,459011,524374,524310,524574,459027,524406,524342,590028,459019,524390,524326,589996,524294,524422,524358,590060,459015,524382,524318,589980,459031,524414,524350,590044,459023,524398,524334,590012,524302,524430,524366,590076,459008,524369,524305,524569,459024,524401,524337,590018,459016,524385,524321,589986,524289,524417,524353,590050,459012,524377,524313,589970,459028,524409,524345,590034,459020,524393,524329,590002,524297,524425,524361,590066,459010,524373,524309,524573,459026,524405,524341,590026,459018,524389,524325,589994,524293,524421,524357,590058,459014,524381,524317,589978,459030,524413,524349,590042,459022,524397,524333,590010,524301,524429,524365,590074,459009,524371,524307,524571,459025,524403,524339,590022,459017,524387,524323,589990,524291,524419,524355,590054,459013,524379,524315,589974,459029,524411,524347,590038,459021,524395,524331,590006,524299,524427,524363,590070,459011,524375,524311,524575,459027,524407,524343,590030,459019,524391,524327,589998,524295,524423,524359,590062,459015,524383,524319,589982,459031,524415,524351,590046,459023,524399,524335,590014,524303,524431,524367,590078,459008,524368,524304,524568,459024,524400,524336,590017,459016,524384,524320,589985,524288,524416,524352,590049,459012,524376,524312,589969,459028,524408,524344,590033,459020,524392,524328,590001,524296,524424,524360,590065,459010,524372,524308,524572,459026,524404,524340,590025,459018,524388,524324,589993,524292,524420,524356,590057,459014,524380,524316,589977,459030,524412,524348,590041,459022,524396,524332,590009,524300,524428,524364,590073,459009,524370,524306,524570,459025,524402,524338,590021,459017,524386,524322,589989,524290,524418,524354,590053,459013,524378,524314,589973,459029,524410,524346,590037,459021,524394,524330,590005,524298,524426,524362,590069,459011,524374,524310,524574,459027,524406,524342,590029,459019,524390,524326,589997,524294,524422,524358,590061,459015,524382,524318,589981,459031,524414,524350,590045,459023,524398,524334,590013,524302,524430,524366,590077,459008,524369,524305,524569,459024,524401,524337,590019,459016,524385,524321,589987,524289,524417,524353,590051,459012,524377,524313,589971,459028,524409,524345,590035,459020,524393,524329,590003,524297,524425,524361,590067,459010,524373,524309,524573,459026,524405,524341,590027,459018,524389,524325,589995,524293,524421,524357,590059,459014,524381,524317,589979,459030,524413,524349,590043,459022,524397,524333,590011,524301,524429,524365,590075,459009,524371,524307,524571,459025,524403,524339,590023,459017,524387,524323,589991,524291,524419,524355,590055,459013,524379,524315,589975,459029,524411,524347,590039,459021,524395,524331,590007,524299,524427,524363,590071,459011,524375,524311,524575,459027,524407,524343,590031,459019,524391,524327,589999,524295,524423,524359,590063,459015,524383,524319,589983,459031,524415,524351,590047,459023,524399,524335,590015,524303,524431,524367,590079]),9],Ea=[new Int32Array([327680,327696,327688,327704,327684,327700,327692,327708,327682,327698,327690,327706,327686,327702,327694,0,327681,327697,327689,327705,327685,327701,327693,327709,327683,327699,327691,327707,327687,327703,327695,0]),5],Da=class extends Ti{constructor(e,t){super(t),this.str=e,this.dict=e.dict;let n=e.getByte(),r=e.getByte();if(n===-1||r===-1)throw new F(`Invalid header in flate stream: ${n}, ${r}`);if((15&n)!=8)throw new F(`Unknown compression method in flate stream: ${n}, ${r}`);if(((n<<8)+r)%31!=0)throw new F(`Bad FCHECK in flate stream: ${n}, ${r}`);if(32&r)throw new F(`FDICT bit set in flate stream: ${n}, ${r}`);this.codeSize=0,this.codeBuf=0}async getImageData(e,t){let n=await this.asyncGetBytes();return n?n.length<=e?n:n.subarray(0,e):this.getBytes(e)}async asyncGetBytes(){this.str.reset();let e=this.str.getBytes();try{let{readable:t,writable:n}=new DecompressionStream(`deflate`),r=n.getWriter();await r.ready,r.write(e).then(async()=>{await r.ready,await r.close()}).catch(()=>{});let i=[],a=0;for await(let e of t)i.push(e),a+=e.byteLength;let o=new Uint8Array(a),s=0;for(let e of i)o.set(e,s),s+=e.byteLength;return o}catch{return this.str=new gi(e,2,e.length,this.str.dict),this.reset(),null}}get isAsync(){return!0}getBits(e){let t=this.str,n,r=this.codeSize,i=this.codeBuf;for(;r<e;){if((n=t.getByte())===-1)throw new F(`Bad encoding in flate stream`);i|=n<<r,r+=8}return n=i&(1<<e)-1,this.codeBuf=i>>e,this.codeSize=r-=e,n}getCode(e){let t=this.str,n=e[0],r=e[1],i,a=this.codeSize,o=this.codeBuf;for(;a<r&&(i=t.getByte())!==-1;)o|=i<<a,a+=8;let s=n[o&(1<<r)-1],c=s>>16,l=65535&s;if(c<1||a<c)throw new F(`Bad encoding in flate stream`);return this.codeBuf=o>>c,this.codeSize=a-c,l}generateHuffmanTable(e){let t=e.length,n,r=0;for(n=0;n<t;++n)e[n]>r&&(r=e[n]);let i=1<<r,a=new Int32Array(i);for(let o=1,s=0,c=2;o<=r;++o,s<<=1,c<<=1)for(let r=0;r<t;++r)if(e[r]===o){let e=0,t=s;for(n=0;n<o;++n)e=e<<1|1&t,t>>=1;for(n=e;n<i;n+=c)a[n]=o<<16|r;++s}return[a,r]}#e(e){hn(e),this.eof=!0}readBlock(){let e,t,n,r=this.str;try{t=this.getBits(3)}catch(e){this.#e(e.message);return}if(1&t&&(this.eof=!0),t>>=1,t===0){let t;if((t=r.getByte())===-1)return void this.#e(`Bad block header in flate stream`);let n=t;if((t=r.getByte())===-1||(n|=t<<8,(t=r.getByte())===-1))return void this.#e(`Bad block header in flate stream`);let i=t;if((t=r.getByte())===-1)return void this.#e(`Bad block header in flate stream`);if(i|=t<<8,i!==(65535&~n)&&(n!==0||i!==0))throw new F(`Bad uncompressed block length in flate stream`);this.codeBuf=0,this.codeSize=0;let a=this.bufferLength,o=a+n;if(e=this.ensureBuffer(o),this.bufferLength=o,n===0)r.peekByte()===-1&&(this.eof=!0);else{let t=r.getBytes(n);e.set(t,a),t.length<n&&(this.eof=!0)}return}let i,a;if(t===1)i=Ta,a=Ea;else{if(t!==2)throw new F(`Unknown block type in flate stream`);{let e=this.getBits(5)+257,t=this.getBits(5)+1,r=this.getBits(4)+4,o=new Uint8Array(Sa.length),s;for(s=0;s<r;++s)o[Sa[s]]=this.getBits(3);let c=this.generateHuffmanTable(o);n=0,s=0;let l=e+t,u=new Uint8Array(l),d,f,p;for(;s<l;){let e=this.getCode(c);if(e===16)d=2,f=3,p=n;else if(e===17)d=3,f=3,p=n=0;else{if(e!==18){u[s++]=n=e;continue}d=7,f=11,p=n=0}let t=this.getBits(d)+f;for(;t-- >0;)u[s++]=p}i=this.generateHuffmanTable(u.subarray(0,e)),a=this.generateHuffmanTable(u.subarray(e,l))}}e=this.buffer;let o=e?e.length:0,s=this.bufferLength;for(;;){let t=this.getCode(i);if(t<256){s+1>=o&&(e=this.ensureBuffer(s+1),o=e.length),e[s++]=t;continue}if(t===256)return void(this.bufferLength=s);t-=257,t=Ca[t];let r=t>>16;r>0&&(r=this.getBits(r)),n=(65535&t)+r,t=this.getCode(a),t=wa[t],r=t>>16,r>0&&(r=this.getBits(r));let c=(65535&t)+r;s+n>=o&&(e=this.ensureBuffer(s+n),o=e.length);for(let t=0;t<n;++t,++s)e[s]=e[s-c]}}},Oa=[{qe:22017,nmps:1,nlps:1,switchFlag:1},{qe:13313,nmps:2,nlps:6,switchFlag:0},{qe:6145,nmps:3,nlps:9,switchFlag:0},{qe:2753,nmps:4,nlps:12,switchFlag:0},{qe:1313,nmps:5,nlps:29,switchFlag:0},{qe:545,nmps:38,nlps:33,switchFlag:0},{qe:22017,nmps:7,nlps:6,switchFlag:1},{qe:21505,nmps:8,nlps:14,switchFlag:0},{qe:18433,nmps:9,nlps:14,switchFlag:0},{qe:14337,nmps:10,nlps:14,switchFlag:0},{qe:12289,nmps:11,nlps:17,switchFlag:0},{qe:9217,nmps:12,nlps:18,switchFlag:0},{qe:7169,nmps:13,nlps:20,switchFlag:0},{qe:5633,nmps:29,nlps:21,switchFlag:0},{qe:22017,nmps:15,nlps:14,switchFlag:1},{qe:21505,nmps:16,nlps:14,switchFlag:0},{qe:20737,nmps:17,nlps:15,switchFlag:0},{qe:18433,nmps:18,nlps:16,switchFlag:0},{qe:14337,nmps:19,nlps:17,switchFlag:0},{qe:13313,nmps:20,nlps:18,switchFlag:0},{qe:12289,nmps:21,nlps:19,switchFlag:0},{qe:10241,nmps:22,nlps:19,switchFlag:0},{qe:9217,nmps:23,nlps:20,switchFlag:0},{qe:8705,nmps:24,nlps:21,switchFlag:0},{qe:7169,nmps:25,nlps:22,switchFlag:0},{qe:6145,nmps:26,nlps:23,switchFlag:0},{qe:5633,nmps:27,nlps:24,switchFlag:0},{qe:5121,nmps:28,nlps:25,switchFlag:0},{qe:4609,nmps:29,nlps:26,switchFlag:0},{qe:4353,nmps:30,nlps:27,switchFlag:0},{qe:2753,nmps:31,nlps:28,switchFlag:0},{qe:2497,nmps:32,nlps:29,switchFlag:0},{qe:2209,nmps:33,nlps:30,switchFlag:0},{qe:1313,nmps:34,nlps:31,switchFlag:0},{qe:1089,nmps:35,nlps:32,switchFlag:0},{qe:673,nmps:36,nlps:33,switchFlag:0},{qe:545,nmps:37,nlps:34,switchFlag:0},{qe:321,nmps:38,nlps:35,switchFlag:0},{qe:273,nmps:39,nlps:36,switchFlag:0},{qe:133,nmps:40,nlps:37,switchFlag:0},{qe:73,nmps:41,nlps:38,switchFlag:0},{qe:37,nmps:42,nlps:39,switchFlag:0},{qe:21,nmps:43,nlps:40,switchFlag:0},{qe:9,nmps:44,nlps:41,switchFlag:0},{qe:5,nmps:45,nlps:42,switchFlag:0},{qe:1,nmps:45,nlps:43,switchFlag:0},{qe:22017,nmps:46,nlps:46,switchFlag:0}],ka=class{constructor(e,t,n){this.data=e,this.bp=t,this.dataEnd=n,this.chigh=e[t],this.clow=0,this.byteIn(),this.chigh=this.chigh<<7&65535|this.clow>>9&127,this.clow=this.clow<<7&65535,this.ct-=7,this.a=32768}byteIn(){let e=this.data,t=this.bp;e[t]===255?e[t+1]>143?(this.clow+=65280,this.ct=8):(t++,this.clow+=e[t]<<9,this.ct=7,this.bp=t):(t++,this.clow+=t<this.dataEnd?e[t]<<8:65280,this.ct=8,this.bp=t),this.clow>65535&&(this.chigh+=this.clow>>16,this.clow&=65535)}readBit(e,t){let n=e[t]>>1,r=1&e[t],i=Oa[n],a=i.qe,o,s=this.a-a;if(this.chigh<a)s<a?(s=a,o=r,n=i.nmps):(s=a,o=1^r,i.switchFlag===1&&(r=o),n=i.nlps);else{if(this.chigh-=a,32768&s)return this.a=s,r;s<a?(o=1^r,i.switchFlag===1&&(r=o),n=i.nlps):(o=r,n=i.nmps)}do this.ct===0&&this.byteIn(),s<<=1,this.chigh=this.chigh<<1&65535|this.clow>>15&1,this.clow=this.clow<<1&65535,this.ct--;while(!(32768&s));return this.a=s,e[t]=n<<1|r,o}},Aa=class extends yn{constructor(e){super(e,`Jbig2Error`)}},ja=class{getContexts(e){return e in this?this[e]:this[e]=new Int8Array(65536)}},Ma=class{constructor(e,t,n){this.data=e,this.start=t,this.end=n}get decoder(){return P(this,`decoder`,new ka(this.data,this.start,this.end))}get contextCache(){return P(this,`contextCache`,new ja)}};function Na(e,t,n){let r=e.getContexts(t),i=1;function a(e){let t=0;for(let a=0;a<e;a++){let e=n.readBit(r,i);i=i<256?i<<1|e:511&(i<<1|e)|256,t=t<<1|e}return t>>>0}let o=a(1),s=a(1)?a(1)?a(1)?a(1)?a(1)?a(32)+4436:a(12)+340:a(8)+84:a(6)+20:a(4)+4:a(2),c;return o===0?c=s:s>0&&(c=-s),c>=-2147483648&&c<=rr?c:null}function Pa(e,t,n){let r=e.getContexts(`IAID`),i=1;for(let e=0;e<n;e++)i=i<<1|t.readBit(r,i);return n<31?i&(1<<n)-1:2147483647&i}var Fa=[`SymbolDictionary`,null,null,null,`IntermediateTextRegion`,null,`ImmediateTextRegion`,`ImmediateLosslessTextRegion`,null,null,null,null,null,null,null,null,`PatternDictionary`,null,null,null,`IntermediateHalftoneRegion`,null,`ImmediateHalftoneRegion`,`ImmediateLosslessHalftoneRegion`,null,null,null,null,null,null,null,null,null,null,null,null,`IntermediateGenericRegion`,null,`ImmediateGenericRegion`,`ImmediateLosslessGenericRegion`,`IntermediateGenericRefinementRegion`,null,`ImmediateGenericRefinementRegion`,`ImmediateLosslessGenericRefinementRegion`,null,null,null,null,`PageInformation`,`EndOfPage`,`EndOfStripe`,`EndOfFile`,`Profiles`,`Tables`,null,null,null,null,null,null,null,null,`Extension`],Ia=[[{x:-1,y:-2},{x:0,y:-2},{x:1,y:-2},{x:-2,y:-1},{x:-1,y:-1},{x:0,y:-1},{x:1,y:-1},{x:2,y:-1},{x:-4,y:0},{x:-3,y:0},{x:-2,y:0},{x:-1,y:0}],[{x:-1,y:-2},{x:0,y:-2},{x:1,y:-2},{x:2,y:-2},{x:-2,y:-1},{x:-1,y:-1},{x:0,y:-1},{x:1,y:-1},{x:2,y:-1},{x:-3,y:0},{x:-2,y:0},{x:-1,y:0}],[{x:-1,y:-2},{x:0,y:-2},{x:1,y:-2},{x:-2,y:-1},{x:-1,y:-1},{x:0,y:-1},{x:1,y:-1},{x:-2,y:0},{x:-1,y:0}],[{x:-3,y:-1},{x:-2,y:-1},{x:-1,y:-1},{x:0,y:-1},{x:1,y:-1},{x:-4,y:0},{x:-3,y:0},{x:-2,y:0},{x:-1,y:0}]],La=[{coding:[{x:0,y:-1},{x:1,y:-1},{x:-1,y:0}],reference:[{x:0,y:-1},{x:1,y:-1},{x:-1,y:0},{x:0,y:0},{x:1,y:0},{x:-1,y:1},{x:0,y:1},{x:1,y:1}]},{coding:[{x:-1,y:-1},{x:0,y:-1},{x:1,y:-1},{x:-1,y:0}],reference:[{x:0,y:-1},{x:-1,y:0},{x:0,y:0},{x:1,y:0},{x:0,y:1},{x:1,y:1}]}],Ra=[39717,1941,229,405];function za(e,t,n,r,i,a,o,s){if(e)return ro(new eo(s.data,s.start,s.end),t,n,!1);if(r===0&&!i&&o.length===4&&o[0].x===3&&o[0].y===-1&&o[1].x===-3&&o[1].y===-1&&o[2].x===2&&o[2].y===-2&&o[3].x===-2&&o[3].y===-2)return function(e,t,n){let r=n.decoder,i=n.contextCache.getContexts(`GB`),a=[],o,s,c,l,u,d,f;for(s=0;s<t;s++)for(u=a[s]=new Uint8Array(e),d=s<1?u:a[s-1],f=s<2?u:a[s-2],o=f[0]<<13|f[1]<<12|f[2]<<11|d[0]<<7|d[1]<<6|d[2]<<5|d[3]<<4,c=0;c<e;c++)u[c]=l=r.readBit(i,o),o=(31735&o)<<1|(c+3<e?f[c+3]<<11:0)|(c+4<e?d[c+4]<<4:0)|l;return a}(t,n,s);let c=Ia[r].concat(o);c.sort((e,t)=>e.y-t.y||e.x-t.x);let l=c.length,u=new Int8Array(l),d=new Int8Array(l),f=[],p,m,h=0,g=0,_=0,v=0;for(m=0;m<l;m++)u[m]=c[m].x,d[m]=c[m].y,g=Math.min(g,c[m].x),_=Math.max(_,c[m].x),v=Math.min(v,c[m].y),m<l-1&&c[m].y===c[m+1].y&&c[m].x===c[m+1].x-1?h|=1<<l-1-m:f.push(m);let y=f.length,b=new Int8Array(y),x=new Int8Array(y),S=new Uint16Array(y);for(p=0;p<y;p++)m=f[p],b[p]=c[m].x,x[p]=c[m].y,S[p]=1<<l-1-m;let C=-g,w=-v,T=t-_,E=Ra[r],D=new Uint8Array(t),O=[],k=s.decoder,ee=s.contextCache.getContexts(`GB`),A,j,M,te,ne,re=0,ie=0;for(let e=0;e<n;e++){if(i&&(re^=k.readBit(ee,E),re)){O.push(D);continue}for(D=new Uint8Array(D),O.push(D),A=0;A<t;A++){if(A>=C&&A<T&&e>=w)for(ie=ie<<1&h,m=0;m<y;m++)j=e+x[m],M=A+b[m],te=O[j][M],te&&(te=S[m],ie|=te);else for(ie=0,ne=l-1,m=0;m<l;m++,ne--)M=A+u[m],M>=0&&M<t&&(j=e+d[m],j>=0&&(te=O[j][M],te&&(ie|=te<<ne)));let n=k.readBit(ee,ie);D[A]=n}}return O}function Ba(e,t,n,r,i,a,o,s,c){let l=La[n].coding;n===0&&(l=l.concat([s[0]]));let u=l.length,d=new Int32Array(u),f=new Int32Array(u),p;for(p=0;p<u;p++)d[p]=l[p].x,f[p]=l[p].y;let m=La[n].reference;n===0&&(m=m.concat([s[1]]));let h=m.length,g=new Int32Array(h),_=new Int32Array(h);for(p=0;p<h;p++)g[p]=m[p].x,_[p]=m[p].y;let v=r[0].length,y=r.length,b=[],x=c.decoder,S=c.contextCache.getContexts(`GR`);for(let n=0;n<t;n++){let t=new Uint8Array(e);b.push(t);for(let o=0;o<e;o++){let s,c,l=0;for(p=0;p<u;p++)s=n+f[p],c=o+d[p],s<0||c<0||c>=e?l<<=1:l=l<<1|b[s][c];for(p=0;p<h;p++)s=n+_[p]-a,c=o+g[p]-i,s<0||s>=y||c<0||c>=v?l<<=1:l=l<<1|r[s][c];t[o]=x.readBit(S,l)}}return b}function Va(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v){if(e&&t)throw new Aa(`refinement with Huffman is not supported`);let y=[],b,x;for(b=0;b<r;b++)x=new Uint8Array(n),i&&x.fill(i),y.push(x);let S=g.decoder,C=g.contextCache,w=e?-p.tableDeltaT.decode(v):-Na(C,`IADT`,S),T=0;for(b=0;b<a;){w+=e?p.tableDeltaT.decode(v):Na(C,`IADT`,S),T+=e?p.tableFirstS.decode(v):Na(C,`IAFS`,S);let r=T;for(;;){let i=0;o>1&&(i=e?v.readBits(_):Na(C,`IAIT`,S));let a=o*w+i,T=e?p.symbolIDTable.decode(v):Pa(C,S,c),E=t&&(e?v.readBit():Na(C,`IARI`,S)),D=s[T],O=D[0].length,k=D.length;if(E){let e=Na(C,`IARDW`,S),t=Na(C,`IARDH`,S);O+=e,k+=t,D=Ba(O,k,m,D,(e>>1)+Na(C,`IARDX`,S),(t>>1)+Na(C,`IARDY`,S),0,h,g)}let ee=0;l?1&d?ee=k-1:r+=k-1:d>1?r+=O-1:ee=O-1;let A=a-(1&d?0:k-1),j=r-(2&d?O-1:0),M,te,ne;if(l)for(M=0;M<k;M++){if(x=y[j+M],!x)continue;ne=D[M];let e=Math.min(n-A,O);switch(f){case 0:for(te=0;te<e;te++)x[A+te]|=ne[te];break;case 2:for(te=0;te<e;te++)x[A+te]^=ne[te];break;default:throw new Aa(`operator ${f} is not supported`)}}else for(te=0;te<k;te++)if(x=y[A+te],x)switch(ne=D[te],f){case 0:for(M=0;M<O;M++)x[j+M]|=ne[M];break;case 2:for(M=0;M<O;M++)x[j+M]^=ne[M];break;default:throw new Aa(`operator ${f} is not supported`)}b++;let re=e?p.tableDeltaS.decode(v):Na(C,`IADS`,S);if(re===null)break;r+=ee+re+u}}return y}function Ha(e,t){let n={};n.number=xr(e,t);let r=e[t+4],i=63&r;if(!Fa[i])throw new Aa(`invalid segment type: `+i);n.type=i,n.typeName=Fa[i],n.deferredNonRetain=!!(128&r);let a=!!(64&r),o=e[t+5],s=o>>5&7,c=[31&o],l=t+6;if(o===7){s=536870911&xr(e,l-1),l+=3;let t=s+7>>3;for(c[0]=e[l++];--t>0;)c.push(e[l++])}else if(o===5||o===6)throw new Aa(`invalid referred-to flags`);n.retainBits=c;let u=4;n.number<=256?u=1:n.number<=65536&&(u=2);let d=[],f,p;for(f=0;f<s;f++){let t;t=u===1?e[l]:u===2?br(e,l):xr(e,l),d.push(t),l+=u}if(n.referredTo=d,a?(n.pageAssociation=xr(e,l),l+=4):n.pageAssociation=e[l++],n.length=xr(e,l),l+=4,n.length===4294967295){if(i!==38)throw new Aa(`invalid unknown segment length`);{let t=Wa(e,l),r=!!(1&e[l+Ga]),i=new Uint8Array(6);for(r||(i[0]=255,i[1]=172),i[2]=t.height>>>24&255,i[3]=t.height>>16&255,i[4]=t.height>>8&255,i[5]=255&t.height,f=l,p=e.length;f<p;f++){let t=0;for(;t<6&&i[t]===e[f+t];)t++;if(t===6){n.length=f+6;break}}if(n.length===4294967295)throw new Aa(`segment end was not found`)}}return n.headerEnd=l,n}function Ua(e,t,n,r){let i=[],a=n;for(;a<r;){let n=Ha(t,a);a=n.headerEnd;let r={header:n,data:t};if(e.randomAccess||(r.start=a,a+=n.length,r.end=a),i.push(r),n.type===51)break}if(e.randomAccess)for(let e=0,t=i.length;e<t;e++)i[e].start=a,a+=i[e].header.length,i[e].end=a;return i}function Wa(e,t){return{width:xr(e,t),height:xr(e,t+4),x:xr(e,t+8),y:xr(e,t+12),combinationOperator:7&e[t+16]}}var Ga=17;function Ka(e,t){let n=e.header,r=e.data,i=e.end,a,o,s,c,l=e.start;switch(n.type){case 0:let e={},t=br(r,l);if(e.huffman=!!(1&t),e.refinement=!!(2&t),e.huffmanDHSelector=t>>2&3,e.huffmanDWSelector=t>>4&3,e.bitmapSizeSelector=t>>6&1,e.aggregationInstancesSelector=t>>7&1,e.bitmapCodingContextUsed=!!(256&t),e.bitmapCodingContextRetained=!!(512&t),e.template=t>>10&3,e.refinementTemplate=t>>12&1,l+=2,!e.huffman){for(c=e.template===0?4:1,o=[],s=0;s<c;s++)o.push({x:vr(r,l),y:vr(r,l+1)}),l+=2;e.at=o}if(e.refinement&&!e.refinementTemplate){for(o=[],s=0;s<2;s++)o.push({x:vr(r,l),y:vr(r,l+1)}),l+=2;e.refinementAt=o}e.numberOfExportedSymbols=xr(r,l),l+=4,e.numberOfNewSymbols=xr(r,l),l+=4,a=[e,n.number,n.referredTo,r,l,i];break;case 6:case 7:let u={};u.info=Wa(r,l),l+=Ga;let d=br(r,l);if(l+=2,u.huffman=!!(1&d),u.refinement=!!(2&d),u.logStripSize=d>>2&3,u.stripSize=1<<u.logStripSize,u.referenceCorner=d>>4&3,u.transposed=!!(64&d),u.combinationOperator=d>>7&3,u.defaultPixelValue=d>>9&1,u.dsOffset=d<<17>>27,u.refinementTemplate=d>>15&1,u.huffman){let e=br(r,l);l+=2,u.huffmanFS=3&e,u.huffmanDS=e>>2&3,u.huffmanDT=e>>4&3,u.huffmanRefinementDW=e>>6&3,u.huffmanRefinementDH=e>>8&3,u.huffmanRefinementDX=e>>10&3,u.huffmanRefinementDY=e>>12&3,u.huffmanRefinementSizeSelector=!!(16384&e)}if(u.refinement&&!u.refinementTemplate){for(o=[],s=0;s<2;s++)o.push({x:vr(r,l),y:vr(r,l+1)}),l+=2;u.refinementAt=o}u.numberOfSymbolInstances=xr(r,l),l+=4,a=[u,n.referredTo,r,l,i];break;case 16:let f={},p=r[l++];f.mmr=!!(1&p),f.template=p>>1&3,f.patternWidth=r[l++],f.patternHeight=r[l++],f.maxPatternIndex=xr(r,l),l+=4,a=[f,n.number,r,l,i];break;case 22:case 23:let m={};m.info=Wa(r,l),l+=Ga;let h=r[l++];m.mmr=!!(1&h),m.template=h>>1&3,m.enableSkip=!!(8&h),m.combinationOperator=h>>4&7,m.defaultPixelValue=h>>7&1,m.gridWidth=xr(r,l),l+=4,m.gridHeight=xr(r,l),l+=4,m.gridOffsetX=4294967295&xr(r,l),l+=4,m.gridOffsetY=4294967295&xr(r,l),l+=4,m.gridVectorX=br(r,l),l+=2,m.gridVectorY=br(r,l),l+=2,a=[m,n.referredTo,r,l,i];break;case 38:case 39:let g={};g.info=Wa(r,l),l+=Ga;let _=r[l++];if(g.mmr=!!(1&_),g.template=_>>1&3,g.prediction=!!(8&_),!g.mmr){for(c=g.template===0?4:1,o=[],s=0;s<c;s++)o.push({x:vr(r,l),y:vr(r,l+1)}),l+=2;g.at=o}a=[g,r,l,i];break;case 48:let v={width:xr(r,l),height:xr(r,l+4),resolutionX:xr(r,l+8),resolutionY:xr(r,l+12)};v.height===4294967295&&delete v.height;let y=r[l+16];br(r,l+17),v.lossless=!!(1&y),v.refinement=!!(2&y),v.defaultPixelValue=y>>2&1,v.combinationOperator=y>>3&3,v.requiresBuffer=!!(32&y),v.combinationOperatorOverride=!!(64&y),a=[v];break;case 49:case 50:case 51:case 62:break;case 53:a=[n.number,r,l,i];break;default:throw new Aa(`segment type ${n.typeName}(${n.type}) is not implemented`)}let u=`on`+n.typeName;u in t&&t[u].apply(t,a)}function qa(e,t){for(let n=0,r=e.length;n<r;n++)Ka(e[n],t)}var Ja=class{onPageInformation(e){this.currentPageInfo=e;let t=e.width+7>>3,n=new Uint8ClampedArray(t*e.height);e.defaultPixelValue&&n.fill(255),this.buffer=n}drawBitmap(e,t){let n=this.currentPageInfo,r=e.width,i=e.height,a=n.width+7>>3,o=n.combinationOperatorOverride?e.combinationOperator:n.combinationOperator,s=this.buffer,c=128>>(7&e.x),l,u,d,f,p=e.y*a+(e.x>>3);switch(o){case 0:for(l=0;l<i;l++){for(d=c,f=p,u=0;u<r;u++)t[l][u]&&(s[f]|=d),d>>=1,d||(d=128,f++);p+=a}break;case 2:for(l=0;l<i;l++){for(d=c,f=p,u=0;u<r;u++)t[l][u]&&(s[f]^=d),d>>=1,d||(d=128,f++);p+=a}break;default:throw new Aa(`operator ${o} is not supported`)}}onImmediateGenericRegion(e,t,n,r){let i=e.info,a=new Ma(t,n,r),o=za(e.mmr,i.width,i.height,e.template,e.prediction,0,e.at,a);this.drawBitmap(i,o)}onImmediateLosslessGenericRegion(){this.onImmediateGenericRegion(...arguments)}onSymbolDictionary(e,t,n,r,i,a){let o,s;e.huffman&&(o=function(e,t,n){let r,i,a,o,s=0;switch(e.huffmanDHSelector){case 0:case 1:r=$a(e.huffmanDHSelector+4);break;case 3:r=to(s,t,n),s++;break;default:throw new Aa(`invalid Huffman DH selector`)}switch(e.huffmanDWSelector){case 0:case 1:i=$a(e.huffmanDWSelector+2);break;case 3:i=to(s,t,n),s++;break;default:throw new Aa(`invalid Huffman DW selector`)}return e.bitmapSizeSelector?(a=to(s,t,n),s++):a=$a(1),o=e.aggregationInstancesSelector?to(s,t,n):$a(1),{tableDeltaHeight:r,tableDeltaWidth:i,tableBitmapSize:a,tableAggregateInstances:o}}(e,n,this.customTables),s=new eo(r,i,a));let c=this.symbols;c||(this.symbols=c={});let l=[];for(let e of n){let t=c[e];t&&l.push(...t)}let u=new Ma(r,i,a);c[t]=function(e,t,n,r,i,a,o,s,c,l,u,d){if(e&&t)throw new Aa(`symbol refinement with Huffman is not supported`);let f=[],p=0,m=_r(n.length+r),h=u.decoder,g=u.contextCache,_,v;for(e&&(_=$a(1),v=[],m=Math.max(m,1));f.length<r;){p+=e?a.tableDeltaHeight.decode(d):Na(g,`IADH`,h);let r=0,i=0,_=e?v.length:0;for(;;){let _=e?a.tableDeltaWidth.decode(d):Na(g,`IADW`,h);if(_===null)break;let y;if(r+=_,i+=r,t){let i=Na(g,`IAAI`,h);if(i>1)y=Va(e,t,r,p,0,i,1,n.concat(f),m,0,0,1,0,a,c,l,u,0,d);else{let e=Pa(g,h,m),t=Na(g,`IARDX`,h),i=Na(g,`IARDY`,h);y=Ba(r,p,c,e<n.length?n[e]:f[e-n.length],t,i,0,l,u)}f.push(y)}else e?v.push(r):(y=za(!1,r,p,o,!1,0,s,u),f.push(y))}if(e&&!t){let e=a.tableBitmapSize.decode(d),t;if(d.byteAlign(),e===0)t=no(d,i,p);else{let n=d.end,r=d.position+e;d.end=r,t=ro(d,i,p,!1),d.end=n,d.position=r}let n=v.length;if(_===n-1)f.push(t);else{let e,r,i,a,o,s=0;for(e=_;e<n;e++){for(a=v[e],i=s+a,o=[],r=0;r<p;r++)o.push(t[r].subarray(s,i));f.push(o),s=i}}}}let y=[],b=[],x,S,C=!1,w=n.length+r;for(;b.length<w;){let t=e?_.decode(d):Na(g,`IAEX`,h);for(;t--;)b.push(C);C=!C}for(x=0,S=n.length;x<S;x++)b[x]&&y.push(n[x]);for(let e=0;e<r;x++,e++)b[x]&&y.push(f[e]);return y}(e.huffman,e.refinement,l,e.numberOfNewSymbols,e.numberOfExportedSymbols,o,e.template,e.at,e.refinementTemplate,e.refinementAt,u,s)}onImmediateTextRegion(e,t,n,r,i){let a=e.info,o,s,c=this.symbols,l=[];for(let e of t){let t=c[e];t&&l.push(...t)}let u=_r(l.length);e.huffman&&(s=new eo(n,r,i),o=function(e,t,n,r,i){let a=[];for(let e=0;e<=34;e++){let t=i.readBits(4);a.push(new Ya([e,t,0,0]))}let o=new Za(a,!1);a.length=0;for(let e=0;e<r;){let t=o.decode(i);if(t>=32){let n,r,o;switch(t){case 32:if(e===0)throw new Aa(`no previous value in symbol ID table`);r=i.readBits(2)+3,n=a[e-1].prefixLength;break;case 33:r=i.readBits(3)+3,n=0;break;case 34:r=i.readBits(7)+11,n=0;break;default:throw new Aa(`invalid code length in symbol ID table`)}for(o=0;o<r;o++)a.push(new Ya([e,n,0,0])),e++}else a.push(new Ya([e,t,0,0])),e++}i.byteAlign();let s=new Za(a,!1),c,l,u,d=0;switch(e.huffmanFS){case 0:case 1:c=$a(e.huffmanFS+6);break;case 3:c=to(d,t,n),d++;break;default:throw new Aa(`invalid Huffman FS selector`)}switch(e.huffmanDS){case 0:case 1:case 2:l=$a(e.huffmanDS+8);break;case 3:l=to(d,t,n),d++;break;default:throw new Aa(`invalid Huffman DS selector`)}switch(e.huffmanDT){case 0:case 1:case 2:u=$a(e.huffmanDT+11);break;case 3:u=to(d,t,n),d++;break;default:throw new Aa(`invalid Huffman DT selector`)}if(e.refinement)throw new Aa(`refinement with Huffman is not supported`);return{symbolIDTable:s,tableFirstS:c,tableDeltaS:l,tableDeltaT:u}}(e,t,this.customTables,l.length,s));let d=new Ma(n,r,i),f=Va(e.huffman,e.refinement,a.width,a.height,e.defaultPixelValue,e.numberOfSymbolInstances,e.stripSize,l,u,e.transposed,e.dsOffset,e.referenceCorner,e.combinationOperator,o,e.refinementTemplate,e.refinementAt,d,e.logStripSize,s);this.drawBitmap(a,f)}onImmediateLosslessTextRegion(){this.onImmediateTextRegion(...arguments)}onPatternDictionary(e,t,n,r,i){let a=this.patterns;a||(this.patterns=a={});let o=new Ma(n,r,i);a[t]=function(e,t,n,r,i,a){let o=[];e||(o.push({x:-t,y:0}),i===0&&o.push({x:-3,y:-1},{x:2,y:-2},{x:-2,y:-2}));let s=za(e,(r+1)*t,n,i,!1,0,o,a),c=[];for(let e=0;e<=r;e++){let r=[],i=t*e,a=i+t;for(let e=0;e<n;e++)r.push(s[e].subarray(i,a));c.push(r)}return c}(e.mmr,e.patternWidth,e.patternHeight,e.maxPatternIndex,e.template,o)}onImmediateHalftoneRegion(e,t,n,r,i){let a=this.patterns[t[0]],o=e.info,s=new Ma(n,r,i),c=function(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m){if(o)throw new Aa(`skip is not supported`);if(s!==0)throw new Aa(`operator "${s}" is not supported in halftone region`);let h=[],g,_,v;for(g=0;g<i;g++)v=new Uint8Array(r),a&&v.fill(a),h.push(v);let y=t.length,b=t[0],x=b[0].length,S=b.length,C=_r(y),w=[];e||(w.push({x:n<=1?3:2,y:-1}),n===0&&w.push({x:-3,y:-1},{x:2,y:-2},{x:-2,y:-2}));let T=[],E,D,O,k,ee,A,j,M,te,ne,re;for(e&&(E=new eo(m.data,m.start,m.end)),g=C-1;g>=0;g--)D=e?ro(E,c,l,!0):za(!1,c,l,n,!1,0,w,m),T[g]=D;for(O=0;O<l;O++)for(k=0;k<c;k++){for(ee=0,A=0,_=C-1;_>=0;_--)ee^=T[_][O][k],A|=ee<<_;if(j=t[A],M=u+O*p+k*f>>8,te=d+O*f-k*p>>8,M>=0&&M+x<=r&&te>=0&&te+S<=i)for(g=0;g<S;g++)for(re=h[te+g],ne=j[g],_=0;_<x;_++)re[M+_]|=ne[_];else{let e,t;for(g=0;g<S;g++)if(t=te+g,!(t<0||t>=i))for(re=h[t],ne=j[g],_=0;_<x;_++)e=M+_,e>=0&&e<r&&(re[e]|=ne[_])}}return h}(e.mmr,a,e.template,o.width,o.height,e.defaultPixelValue,e.enableSkip,e.combinationOperator,e.gridWidth,e.gridHeight,e.gridOffsetX,e.gridOffsetY,e.gridVectorX,e.gridVectorY,s);this.drawBitmap(o,c)}onImmediateLosslessHalftoneRegion(){this.onImmediateHalftoneRegion(...arguments)}onTables(e,t,n,r){let i=this.customTables;i||(this.customTables=i={}),i[e]=function(e,t,n){let r=e[t],i=4294967295&xr(e,t+1),a=4294967295&xr(e,t+5),o=new eo(e,t+9,n),s=1+(r>>1&7),c=1+(r>>4&7),l=[],u,d,f=i;do u=o.readBits(s),d=o.readBits(c),l.push(new Ya([f,u,d,0])),f+=1<<d;while(f<a);return u=o.readBits(s),l.push(new Ya([i-1,u,32,0,`lower`])),u=o.readBits(s),l.push(new Ya([a,u,32,0])),1&r&&(u=o.readBits(s),l.push(new Ya([u,0]))),new Za(l,!1)}(t,n,r)}},Ya=class{constructor(e){e.length===2?(this.isOOB=!0,this.rangeLow=0,this.prefixLength=e[0],this.rangeLength=0,this.prefixCode=e[1],this.isLowerRange=!1):(this.isOOB=!1,this.rangeLow=e[0],this.prefixLength=e[1],this.rangeLength=e[2],this.prefixCode=e[3],this.isLowerRange=e[4]===`lower`)}},Xa=class e{constructor(e){this.children=[],e?(this.isLeaf=!0,this.rangeLength=e.rangeLength,this.rangeLow=e.rangeLow,this.isLowerRange=e.isLowerRange,this.isOOB=e.isOOB):this.isLeaf=!1}buildTree(t,n){let r=t.prefixCode>>n&1;if(n<=0)this.children[r]=new e(t);else{let i=this.children[r];i||(this.children[r]=i=new e(null)),i.buildTree(t,n-1)}}decodeNode(e){if(this.isLeaf){if(this.isOOB)return null;let t=e.readBits(this.rangeLength);return this.rangeLow+(this.isLowerRange?-t:t)}let t=this.children[e.readBit()];if(!t)throw new Aa(`invalid Huffman data`);return t.decodeNode(e)}},Za=class{constructor(e,t){t||this.assignPrefixCodes(e),this.rootNode=new Xa(null);for(let t=0,n=e.length;t<n;t++){let n=e[t];n.prefixLength>0&&this.rootNode.buildTree(n,n.prefixLength-1)}}decode(e){return this.rootNode.decodeNode(e)}assignPrefixCodes(e){let t=e.length,n=0;for(let r=0;r<t;r++)n=Math.max(n,e[r].prefixLength);let r=new Uint32Array(n+1);for(let n=0;n<t;n++)r[e[n].prefixLength]++;let i,a,o,s=1,c=0;for(r[0]=0;s<=n;){for(c=c+r[s-1]<<1,i=c,a=0;a<t;)o=e[a],o.prefixLength===s&&(o.prefixCode=i,i++),a++;s++}}},Qa={};function $a(e){let t,n=Qa[e];if(n)return n;switch(e){case 1:t=[[0,1,4,0],[16,2,8,2],[272,3,16,6],[65808,3,32,7]];break;case 2:t=[[0,1,0,0],[1,2,0,2],[2,3,0,6],[3,4,3,14],[11,5,6,30],[75,6,32,62],[6,63]];break;case 3:t=[[-256,8,8,254],[0,1,0,0],[1,2,0,2],[2,3,0,6],[3,4,3,14],[11,5,6,30],[-257,8,32,255,`lower`],[75,7,32,126],[6,62]];break;case 4:t=[[1,1,0,0],[2,2,0,2],[3,3,0,6],[4,4,3,14],[12,5,6,30],[76,5,32,31]];break;case 5:t=[[-255,7,8,126],[1,1,0,0],[2,2,0,2],[3,3,0,6],[4,4,3,14],[12,5,6,30],[-256,7,32,127,`lower`],[76,6,32,62]];break;case 6:t=[[-2048,5,10,28],[-1024,4,9,8],[-512,4,8,9],[-256,4,7,10],[-128,5,6,29],[-64,5,5,30],[-32,4,5,11],[0,2,7,0],[128,3,7,2],[256,3,8,3],[512,4,9,12],[1024,4,10,13],[-2049,6,32,62,`lower`],[2048,6,32,63]];break;case 7:t=[[-1024,4,9,8],[-512,3,8,0],[-256,4,7,9],[-128,5,6,26],[-64,5,5,27],[-32,4,5,10],[0,4,5,11],[32,5,5,28],[64,5,6,29],[128,4,7,12],[256,3,8,1],[512,3,9,2],[1024,3,10,3],[-1025,5,32,30,`lower`],[2048,5,32,31]];break;case 8:t=[[-15,8,3,252],[-7,9,1,508],[-5,8,1,253],[-3,9,0,509],[-2,7,0,124],[-1,4,0,10],[0,2,1,0],[2,5,0,26],[3,6,0,58],[4,3,4,4],[20,6,1,59],[22,4,4,11],[38,4,5,12],[70,5,6,27],[134,5,7,28],[262,6,7,60],[390,7,8,125],[646,6,10,61],[-16,9,32,510,`lower`],[1670,9,32,511],[2,1]];break;case 9:t=[[-31,8,4,252],[-15,9,2,508],[-11,8,2,253],[-7,9,1,509],[-5,7,1,124],[-3,4,1,10],[-1,3,1,2],[1,3,1,3],[3,5,1,26],[5,6,1,58],[7,3,5,4],[39,6,2,59],[43,4,5,11],[75,4,6,12],[139,5,7,27],[267,5,8,28],[523,6,8,60],[779,7,9,125],[1291,6,11,61],[-32,9,32,510,`lower`],[3339,9,32,511],[2,0]];break;case 10:t=[[-21,7,4,122],[-5,8,0,252],[-4,7,0,123],[-3,5,0,24],[-2,2,2,0],[2,5,0,25],[3,6,0,54],[4,7,0,124],[5,8,0,253],[6,2,6,1],[70,5,5,26],[102,6,5,55],[134,6,6,56],[198,6,7,57],[326,6,8,58],[582,6,9,59],[1094,6,10,60],[2118,7,11,125],[-22,8,32,254,`lower`],[4166,8,32,255],[2,2]];break;case 11:t=[[1,1,0,0],[2,2,1,2],[4,4,0,12],[5,4,1,13],[7,5,1,28],[9,5,2,29],[13,6,2,60],[17,7,2,122],[21,7,3,123],[29,7,4,124],[45,7,5,125],[77,7,6,126],[141,7,32,127]];break;case 12:t=[[1,1,0,0],[2,2,0,2],[3,3,1,6],[5,5,0,28],[6,5,1,29],[8,6,1,60],[10,7,0,122],[11,7,1,123],[13,7,2,124],[17,7,3,125],[25,7,4,126],[41,8,5,254],[73,8,32,255]];break;case 13:t=[[1,1,0,0],[2,3,0,4],[3,4,0,12],[4,5,0,28],[5,4,1,13],[7,3,3,5],[15,6,1,58],[17,6,2,59],[21,6,3,60],[29,6,4,61],[45,6,5,62],[77,7,6,126],[141,7,32,127]];break;case 14:t=[[-2,3,0,4],[-1,3,0,5],[0,1,0,0],[1,3,0,6],[2,3,0,7]];break;case 15:t=[[-24,7,4,124],[-8,6,2,60],[-4,5,1,28],[-2,4,0,12],[-1,3,0,4],[0,1,0,0],[1,3,0,5],[2,4,0,13],[3,5,1,29],[5,6,2,61],[9,7,4,125],[-25,7,32,126,`lower`],[25,7,32,127]];break;default:throw new Aa(`standard table B.${e} does not exist`)}for(let e=0,n=t.length;e<n;e++)t[e]=new Ya(t[e]);return n=new Za(t,!0),Qa[e]=n,n}var eo=class{constructor(e,t,n){this.data=e,this.start=t,this.end=n,this.position=t,this.shift=-1,this.currentByte=0}readBit(){if(this.shift<0){if(this.position>=this.end)throw new Aa(`end of data while reading bit`);this.currentByte=this.data[this.position++],this.shift=7}let e=this.currentByte>>this.shift&1;return this.shift--,e}readBits(e){let t,n=0;for(t=e-1;t>=0;t--)n|=this.readBit()<<t;return n}byteAlign(){this.shift=-1}next(){return this.position>=this.end?-1:this.data[this.position++]}};function to(e,t,n){let r=0;for(let i=0,a=t.length;i<a;i++){let a=n[t[i]];if(a){if(e===r)return a;r++}}throw new Aa(`can't find custom Huffman table`)}function no(e,t,n){let r=[];for(let i=0;i<n;i++){let n=new Uint8Array(t);r.push(n);for(let r=0;r<t;r++)n[r]=e.readBit();e.byteAlign()}return r}function ro(e,t,n,r){let i=new ba(e,{K:-1,Columns:t,Rows:n,BlackIs1:!0,EndOfBlock:r}),a=[],o,s=!1;for(let e=0;e<n;e++){let e=new Uint8Array(t);a.push(e);let n=-1;for(let r=0;r<t;r++)n<0&&(o=i.readNextChar(),o===-1&&(o=0,s=!0),n=7),e[r]=o>>n&1,n--}if(r&&!s)for(let e=0;e<5&&i.readNextChar()!==-1;e++);return a}var io=class{parseChunks(e){return function(e){let t=new Ja;for(let n=0,r=e.length;n<r;n++){let r=e[n];qa(Ua({},r.data,r.start,r.end),t)}return t.buffer}(e)}parse(e){throw Error(`Not implemented: Jbig2Image.parse`)}},ao=class extends Ti{constructor(e,t,n){super(t),this.stream=e,this.dict=e.dict,this.maybeLength=t,this.params=n}get bytes(){return P(this,`bytes`,this.stream.getBytes(this.maybeLength))}ensureBuffer(e){}readBlock(){this.decodeImage()}decodeImage(e){if(this.eof)return this.buffer;e||=this.bytes;let t=new io,n=[];if(this.params instanceof L){let e=this.params.get(`JBIG2Globals`);if(e instanceof tr){let t=e.getBytes();n.push({data:t,start:0,end:t.length})}}n.push({data:e,start:0,end:e.length});let r=t.parseChunks(n),i=r.length;for(let e=0;e<i;e++)r[e]^=255;return this.buffer=r,this.bufferLength=i,this.eof=!0,this.buffer}get canAsyncDecodeImageFromBuffer(){return this.stream.isAsync}},oo=class extends Ti{constructor(e,t,n){super(t),this.stream=e,this.dict=e.dict,this.maybeLength=t,this.params=n}get bytes(){return P(this,`bytes`,this.stream.getBytes(this.maybeLength))}ensureBuffer(e){}readBlock(e){gn(`JpxStream.readBlock`)}get isAsyncDecoder(){return!0}async decodeImage(e,t){return this.eof||=(e||=this.bytes,this.buffer=await Qi.decode(e,t),this.bufferLength=this.buffer.length,!0),this.buffer}get canAsyncDecodeImageFromBuffer(){return this.stream.isAsync}},so=class extends Ti{constructor(e,t,n){super(t),this.str=e,this.dict=e.dict,this.cachedData=0,this.bitsCached=0;let r=4096,i={earlyChange:n,codeLength:9,nextCode:258,dictionaryValues:new Uint8Array(r),dictionaryLengths:new Uint16Array(r),dictionaryPrevCodes:new Uint16Array(r),currentSequence:new Uint8Array(r),currentSequenceLength:0};for(let e=0;e<256;++e)i.dictionaryValues[e]=e,i.dictionaryLengths[e]=1;this.lzwState=i}readBits(e){let t=this.bitsCached,n=this.cachedData;for(;t<e;){let e=this.str.getByte();if(e===-1)return this.eof=!0,null;n=n<<8|e,t+=8}return this.bitsCached=t-=e,this.cachedData=n,this.lastCode=null,n>>>t&(1<<e)-1}readBlock(){let e,t,n,r=1024,i=this.lzwState;if(!i)return;let a=i.earlyChange,o=i.nextCode,s=i.dictionaryValues,c=i.dictionaryLengths,l=i.dictionaryPrevCodes,u=i.codeLength,d=i.prevCode,f=i.currentSequence,p=i.currentSequenceLength,m=0,h=this.bufferLength,g=this.ensureBuffer(this.bufferLength+r);for(e=0;e<512;e++){let e=this.readBits(u),i=p>0;if(e<256)f[0]=e,p=1;else{if(!(e>=258)){if(e===256){u=9,o=258,p=0;continue}this.eof=!0,delete this.lzwState;break}if(e<o)for(p=c[e],t=p-1,n=e;t>=0;t--)f[t]=s[n],n=l[n];else f[p++]=f[0]}if(i&&(l[o]=d,c[o]=c[d]+1,s[o]=f[0],o++,u=o+a&o+a-1?u:0|Math.min(Math.log(o+a)/.6931471805599453+1,12)),d=e,m+=p,r<m){do r+=512;while(r<m);g=this.ensureBuffer(this.bufferLength+r)}for(t=0;t<p;t++)g[h++]=f[t]}i.nextCode=o,i.codeLength=u,i.prevCode=d,i.currentSequenceLength=p,this.bufferLength=h}},co=class extends Ti{constructor(e,t,n){if(super(t),!(n instanceof L))return e;let r=this.predictor=n.get(`Predictor`)||1;if(r<=1)return e;if(r!==2&&(r<10||r>15))throw new F(`Unsupported predictor: ${r}`);this.readBlock=r===2?this.readBlockTiff:this.readBlockPng,this.str=e,this.dict=e.dict;let i=this.colors=n.get(`Colors`)||1,a=this.bits=n.get(`BPC`,`BitsPerComponent`)||8,o=this.columns=n.get(`Columns`)||1;return this.pixBytes=i*a+7>>3,this.rowBytes=o*i*a+7>>3,this}readBlockTiff(){let e=this.rowBytes,t=this.bufferLength,n=this.ensureBuffer(t+e),r=this.bits,i=this.colors,a=this.str.getBytes(e);if(this.eof=!a.length,this.eof)return;let o,s=0,c=0,l=0,u=0,d=t;if(r===1&&i===1)for(o=0;o<e;++o){let e=a[o]^s;e^=e>>1,e^=e>>2,e^=e>>4,s=(1&e)<<7,n[d++]=e}else if(r===8){for(o=0;o<i;++o)n[d++]=a[o];for(;o<e;++o)n[d]=n[d-i]+a[o],d++}else if(r===16){let t=2*i;for(o=0;o<t;++o)n[d++]=a[o];for(;o<e;o+=2){let e=((255&a[o])<<8)+(255&a[o+1])+((255&n[d-t])<<8)+(255&n[d-t+1]);n[d++]=e>>8&255,n[d++]=255&e}}else{let e=new Uint8Array(i+1),d=(1<<r)-1,f=0,p=t,m=this.columns;for(o=0;o<m;++o)for(let t=0;t<i;++t)l<r&&(s=s<<8|255&a[f++],l+=8),e[t]=e[t]+(s>>l-r)&d,l-=r,c=c<<r|e[t],u+=r,u>=8&&(n[p++]=c>>u-8&255,u-=8);u>0&&(n[p++]=(c<<8-u)+(s&(1<<8-u)-1))}this.bufferLength+=e}readBlockPng(){let e=this.rowBytes,t=this.pixBytes,n=this.str.getByte(),r=this.str.getBytes(e);if(this.eof=!r.length,this.eof)return;let i=this.bufferLength,a=this.ensureBuffer(i+e),o=a.subarray(i-e,i);o.length===0&&(o=new Uint8Array(e));let s,c,l,u=i;switch(n){case 0:for(s=0;s<e;++s)a[u++]=r[s];break;case 1:for(s=0;s<t;++s)a[u++]=r[s];for(;s<e;++s)a[u]=a[u-t]+r[s]&255,u++;break;case 2:for(s=0;s<e;++s)a[u++]=o[s]+r[s]&255;break;case 3:for(s=0;s<t;++s)a[u++]=(o[s]>>1)+r[s];for(;s<e;++s)a[u]=(o[s]+a[u-t]>>1)+r[s]&255,u++;break;case 4:for(s=0;s<t;++s)c=o[s],l=r[s],a[u++]=c+l;for(;s<e;++s){c=o[s];let e=o[s-t],n=a[u-t],i=n+c-e,d=i-n;d<0&&(d=-d);let f=i-c;f<0&&(f=-f);let p=i-e;p<0&&(p=-p),l=r[s],a[u++]=d<=f&&d<=p?n+l:f<=p?c+l:e+l}break;default:throw new F(`Unsupported predictor: ${n}`)}this.bufferLength+=e}},lo=class extends Ti{constructor(e,t){super(t),this.str=e,this.dict=e.dict}readBlock(){let e=this.str.getBytes(2);if(!e||e.length<2||e[0]===128)return void(this.eof=!0);let t,n=this.bufferLength,r=e[0];if(r<128){if(t=this.ensureBuffer(n+r+1),t[n++]=e[1],r>0){let e=this.str.getBytes(r);t.set(e,n),n+=r}}else r=257-r,t=this.ensureBuffer(n+r+1),t.fill(e[1],n,n+r),n+=r;this.bufferLength=n}},uo=class{constructor({lexer:e,xref:t,allowStreams:n=!1,recoveryMode:r=!1}){this.lexer=e,this.xref=t,this.allowStreams=n,this.recoveryMode=r,this.imageCache=Object.create(null),this._imageId=0,this.refill()}refill(){this.buf1=this.lexer.getObj(),this.buf2=this.lexer.getObj()}shift(){this.buf2 instanceof qn&&this.buf2.cmd===`ID`?(this.buf1=this.buf2,this.buf2=null):(this.buf1=this.buf2,this.buf2=this.lexer.getObj())}tryShift(){try{return this.shift(),!0}catch(e){if(e instanceof cr)throw e;return!1}}getObj(e=null){let t=this.buf1;if(this.shift(),t instanceof qn)switch(t.cmd){case`BI`:return this.makeInlineImage(e);case`[`:let n=[];for(;!Qn(this.buf1,`]`)&&this.buf1!==Un;)n.push(this.getObj(e));if(this.buf1===Un){if(this.recoveryMode)return n;throw new lr(`End of file inside array.`)}return this.shift(),n;case`<<`:let r=new L(this.xref);for(;!Qn(this.buf1,`>>`)&&this.buf1!==Un;){if(!(this.buf1 instanceof I)){hn(`Malformed dictionary: key must be a name object`),this.shift();continue}let t=this.buf1.name;if(this.shift(),this.buf1===Un)break;r.set(t,this.getObj(e))}if(this.buf1===Un){if(this.recoveryMode)return r;throw new lr(`End of file inside dictionary.`)}return Qn(this.buf2,`stream`)?this.allowStreams?this.makeStream(r,e):r:(this.shift(),r);default:return t}if(Number.isInteger(t)){if(Number.isInteger(this.buf1)&&Qn(this.buf2,`R`)){let e=R.get(t,this.buf1);return this.shift(),this.shift(),e}return t}return typeof t==`string`&&e?e.decryptString(t):t}findDefaultInlineStreamEnd(e){let{knownCommands:t}=this.lexer,n=e.pos,r,i,a=0;for(;(r=e.getByte())!==-1;)if(a===0)a=+(r===69);else if(a===1)a=r===73?2:0;else if(r===32||r===10||r===13){i=e.pos;let n=e.peekBytes(15),o=n.length;if(o===0)break;for(let e=0;e<o;e++)if(r=n[e],(r!==0||n[e+1]===0)&&r!==10&&r!==13&&(r<32||r>127)){a=0;break}if(a!==2)continue;if(!t){N("findDefaultInlineStreamEnd - `lexer.knownCommands` is undefined.");continue}let s=new mo(new gi(e.peekBytes(75)),t);s._hexStringWarn=()=>{};let c=0;for(;;){let e=s.getObj();if(e===Un){a=0;break}if(e instanceof qn){let n=t[e.cmd];if(!n){a=0;break}if(n.variableArgs?c<=n.numArgs:c===n.numArgs)break;c=0;continue}c++}if(a===2)break}else a=0;r===-1&&(N(`findDefaultInlineStreamEnd: Reached the end of the stream without finding a valid EI marker`),i&&(N(`... trying to recover by using the last "EI" occurrence.`),e.skip(-(e.pos-i))));let o=4;return e.skip(-o),r=e.peekByte(),e.skip(o),Sr(r)||o--,e.pos-o-n}findDCTDecodeInlineStreamEnd(e){let t=e.pos,n,r,i=!1;for(;(n=e.getByte())!==-1;)if(n===255){switch(e.getByte()){case 0:break;case 255:e.skip(-1);break;case 217:i=!0;break;case 192:case 193:case 194:case 195:case 197:case 198:case 199:case 201:case 202:case 203:case 205:case 206:case 207:case 196:case 204:case 218:case 219:case 220:case 221:case 222:case 223:case 224:case 225:case 226:case 227:case 228:case 229:case 230:case 231:case 232:case 233:case 234:case 235:case 236:case 237:case 238:case 239:case 254:r=e.getUint16(),r>2?e.skip(r-2):e.skip(-2)}if(i)break}let a=e.pos-t;return n===-1?(N(`Inline DCTDecode image stream: EOI marker not found, searching for /EI/ instead.`),e.skip(-a),this.findDefaultInlineStreamEnd(e)):(this.inlineStreamSkipEI(e),a)}findASCII85DecodeInlineStreamEnd(e){let t=e.pos,n;for(;(n=e.getByte())!==-1;)if(n===126){let t=e.pos;for(n=e.peekByte();Sr(n);)e.skip(),n=e.peekByte();if(n===62){e.skip();break}if(e.pos>t){let t=e.peekBytes(2);if(t[0]===69&&t[1]===73)break}}let r=e.pos-t;return n===-1?(N(`Inline ASCII85Decode image stream: EOD marker not found, searching for /EI/ instead.`),e.skip(-r),this.findDefaultInlineStreamEnd(e)):(this.inlineStreamSkipEI(e),r)}findASCIIHexDecodeInlineStreamEnd(e){let t=e.pos,n;for(;(n=e.getByte())!==-1&&n!==62;);let r=e.pos-t;return n===-1?(N(`Inline ASCIIHexDecode image stream: EOD marker not found, searching for /EI/ instead.`),e.skip(-r),this.findDefaultInlineStreamEnd(e)):(this.inlineStreamSkipEI(e),r)}inlineStreamSkipEI(e){let t,n=0;for(;(t=e.getByte())!==-1;)if(n===0)n=+(t===69);else if(n===1)n=t===73?2:0;else if(n===2)break}makeInlineImage(e){let t=this.lexer,n=t.stream,r=Object.create(null),i;for(;!Qn(this.buf1,`ID`)&&this.buf1!==Un;){if(!(this.buf1 instanceof I))throw new F(`Dictionary key must be a name object`);let t=this.buf1.name;if(this.shift(),this.buf1===Un)break;r[t]=this.getObj(e)}t.beginInlineImagePos!==-1&&(i=n.pos-t.beginInlineImagePos);let a=this.xref.fetchIfRef(r.F||r.Filter),o;if(a instanceof I)o=a.name;else if(Array.isArray(a)){let e=this.xref.fetchIfRef(a[0]);e instanceof I&&(o=e.name)}let s=n.pos,c,l;switch(o){case`DCT`:case`DCTDecode`:c=this.findDCTDecodeInlineStreamEnd(n);break;case`A85`:case`ASCII85Decode`:c=this.findASCII85DecodeInlineStreamEnd(n);break;case`AHx`:case`ASCIIHexDecode`:c=this.findASCIIHexDecodeInlineStreamEnd(n);break;default:c=this.findDefaultInlineStreamEnd(n)}if(c<1e3&&i>0){let e=n.pos;n.pos=t.beginInlineImagePos,l=function(e){let t=[],n=e.length,r=0;for(;r<n-1;)t.push(e[r++]<<8|e[r++]);return r<n&&t.push(e[r]),n+`_`+String.fromCharCode.apply(null,t)}(n.getBytes(i+c)),n.pos=e;let r=this.imageCache[l];if(r!==void 0)return this.buf2=qn.get(`EI`),this.shift(),r.reset(),r}let u=new L(this.xref);for(let e in r)u.set(e,r[e]);let d=n.makeSubStream(s,c,u);return e&&(d=e.createStream(d,c)),d=this.filter(d,u,c),d.dict=u,l!==void 0&&(d.cacheKey=`inline_img_`+ ++this._imageId,this.imageCache[l]=d),this.buf2=qn.get(`EI`),this.shift(),d}#e(e){let{stream:t}=this.lexer;t.pos=e;let n=new Uint8Array([101,110,100]),r=n.length,i=[new Uint8Array([115,116,114,101,97,109]),new Uint8Array([115,116,101,97,109]),new Uint8Array([115,116,114,101,97])],a=9-r;for(;t.pos<t.end;){let o=t.peekBytes(2048),s=o.length-9;if(s<=0)break;let c=0;for(;c<s;){let s=0;for(;s<r&&o[c+s]===n[s];)s++;if(s>=r){let r=!1;for(let e of i){let t=e.length,i=0;for(;i<t&&o[c+s+i]===e[i];)i++;if(i>=a){r=!0;break}if(i>=t){Sr(o[c+s+i])&&(hn(`Found "${Tn([...n,...e])}" when searching for endstream command.`),r=!0);break}}if(r)return t.pos+=c,t.pos-e}c++}t.pos+=s}return-1}makeStream(e,t){let n=this.lexer,r=n.stream;n.skipToNextLine();let i=r.pos-1,a=e.get(`Length`);if(Number.isInteger(a)||(hn(`Bad length "${a&&a.toString()}" in stream.`),a=0),r.pos=i+a,n.nextChar(),this.tryShift()&&Qn(this.buf2,`endstream`))this.shift();else{if(a=this.#e(i),a<0)throw new F(`Missing endstream command.`);n.nextChar(),this.shift(),this.shift()}return this.shift(),r=r.makeSubStream(i,a,e),t&&(r=t.createStream(r,a)),r=this.filter(r,e,a),r.dict=e,r}filter(e,t,n){let r=t.get(`F`,`Filter`),i=t.get(`DP`,`DecodeParms`);if(r instanceof I)return Array.isArray(i)&&N(`/DecodeParms should not be an Array, when /Filter is a Name.`),this.makeFilter(e,r.name,n,i);let a=n;if(Array.isArray(r)){let t=r,n=i;for(let o=0,s=t.length;o<s;++o){if(r=this.xref.fetchIfRef(t[o]),!(r instanceof I))throw new F(`Bad filter name "${r}"`);i=null,Array.isArray(n)&&o in n&&(i=this.xref.fetchIfRef(n[o])),e=this.makeFilter(e,r.name,a,i),a=null}}return e}makeFilter(e,t,n,r){if(n===0)return N(`Empty "${t}" stream.`),new vi;try{switch(t){case`Fl`:case`FlateDecode`:return r?new co(new Da(e,n),n,r):new Da(e,n);case`LZW`:case`LZWDecode`:let t=1;return r?(r.has(`EarlyChange`)&&(t=r.get(`EarlyChange`)),new co(new so(e,n,t),n,r)):new so(e,n,t);case`DCT`:case`DCTDecode`:return new Xi(e,n,r);case`JPX`:case`JPXDecode`:return new oo(e,n,r);case`A85`:case`ASCII85Decode`:return new da(e,n);case`AHx`:case`ASCIIHexDecode`:return new fa(e,n);case`CCF`:case`CCITTFaxDecode`:return new xa(e,n,r);case`RL`:case`RunLengthDecode`:return new lo(e,n);case`JBIG2Decode`:return new ao(e,n,r)}return N(`Filter "${t}" is not supported.`),e}catch(e){if(e instanceof cr)throw e;return N(`Invalid stream: "${e}"`),new vi}}},fo=[1,0,0,0,0,0,0,0,0,1,1,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,2,0,0,2,2,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,2,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];function po(e){return e>=48&&e<=57?15&e:e>=65&&e<=70||e>=97&&e<=102?9+(15&e):-1}var mo=class{constructor(e,t=null){this.stream=e,this.nextChar(),this.strBuf=[],this.knownCommands=t,this._hexStringNumWarn=0,this.beginInlineImagePos=-1}nextChar(){return this.currentChar=this.stream.getByte()}peekChar(){return this.stream.peekByte()}getNumber(){let e=this.currentChar,t=!1,n=0,r=1;if(e===45?(r=-1,e=this.nextChar(),e===45&&(e=this.nextChar())):e===43&&(e=this.nextChar()),e===10||e===13)do e=this.nextChar();while(e===10||e===13);if(e===46&&(n=10,e=this.nextChar()),e<48||e>57){let t=`Invalid number: ${String.fromCharCode(e)} (charCode ${e})`;if(Sr(e)||e===40||e===60||e===-1)return hn(`Lexer.getNumber - "${t}".`),0;throw new F(t)}let i=e-48,a=0,o=1;for(;(e=this.nextChar())>=0;)if(e>=48&&e<=57){let r=e-48;t?a=10*a+r:(n!==0&&(n*=10),i=10*i+r)}else if(e===46){if(n!==0)break;n=1}else if(e===45)N(`Badly formatted number: minus sign in the middle`);else{if(e!==69&&e!==101)break;if(e=this.peekChar(),e===43||e===45)o=e===45?-1:1,this.nextChar();else if(e<48||e>57)break;t=!0}return n!==0&&(i/=n),t&&(i*=10**(o*a)),r*i}getString(){let e=1,t=!1,n=this.strBuf;n.length=0;let r=this.nextChar();for(;;){let i=!1;switch(0|r){case-1:N(`Unterminated string`),t=!0;break;case 40:++e,n.push(`(`);break;case 41:--e===0?(this.nextChar(),t=!0):n.push(`)`);break;case 92:switch(r=this.nextChar(),r){case-1:N(`Unterminated string`),t=!0;break;case 110:n.push(`
3
+ `);break;case 114:n.push(`\r`);break;case 116:n.push(` `);break;case 98:n.push(`\b`);break;case 102:n.push(`\f`);break;case 92:case 40:case 41:n.push(String.fromCharCode(r));break;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:let e=15&r;r=this.nextChar(),i=!0,r>=48&&r<=55&&(e=(e<<3)+(15&r),r=this.nextChar(),r>=48&&r<=55&&(i=!1,e=(e<<3)+(15&r))),n.push(String.fromCharCode(e));break;case 13:this.peekChar()===10&&this.nextChar();break;case 10:break;default:n.push(String.fromCharCode(r))}break;default:n.push(String.fromCharCode(r))}if(t)break;i||(r=this.nextChar())}return n.join(``)}getName(){let e,t,n=this.strBuf;for(n.length=0;(e=this.nextChar())>=0&&!fo[e];)if(e===35){if(e=this.nextChar(),fo[e]){N(`Lexer_getName: NUMBER SIGN (#) should be followed by a hexadecimal number.`),n.push(`#`);break}let r=po(e);if(r!==-1){t=e,e=this.nextChar();let i=po(e);if(i===-1){if(N(`Lexer_getName: Illegal digit (${String.fromCharCode(e)}) in hexadecimal number.`),n.push(`#`,String.fromCharCode(t)),fo[e])break;n.push(String.fromCharCode(e));continue}n.push(String.fromCharCode(r<<4|i))}else n.push(`#`,String.fromCharCode(e))}else n.push(String.fromCharCode(e));return n.length>127&&N(`Name token is longer than allowed by the spec: ${n.length}`),I.get(n.join(``))}_hexStringWarn(e){this._hexStringNumWarn++===5?N(`getHexString - ignoring additional invalid characters.`):this._hexStringNumWarn>5||N(`getHexString - ignoring invalid character: ${e}`)}getHexString(){let e=this.strBuf;e.length=0;let t=this.currentChar,n=-1,r=-1;for(this._hexStringNumWarn=0;;){if(t<0){N(`Unterminated hex string`);break}if(t===62){this.nextChar();break}fo[t]===1?t=this.nextChar():(r=po(t),r===-1?this._hexStringWarn(t):n===-1?n=r:(e.push(String.fromCharCode(n<<4|r)),n=-1),t=this.nextChar())}return n!==-1&&e.push(String.fromCharCode(n<<4)),e.join(``)}getObj(){let e=!1,t=this.currentChar;for(;;){if(t<0)return Un;if(e)t!==10&&t!==13||(e=!1);else if(t===37)e=!0;else if(fo[t]!==1)break;t=this.nextChar()}switch(0|t){case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:case 43:case 45:case 46:return this.getNumber();case 40:return this.getString();case 47:return this.getName();case 91:return this.nextChar(),qn.get(`[`);case 93:return this.nextChar(),qn.get(`]`);case 60:return t=this.nextChar(),t===60?(this.nextChar(),qn.get(`<<`)):this.getHexString();case 62:return t=this.nextChar(),t===62?(this.nextChar(),qn.get(`>>`)):qn.get(`>`);case 123:return this.nextChar(),qn.get(`{`);case 125:return this.nextChar(),qn.get(`}`);case 41:throw this.nextChar(),new F(`Illegal character: ${t}`)}let n=String.fromCharCode(t);if(t<32||t>127){let e=this.peekChar();if(e>=32&&e<=127)return this.nextChar(),qn.get(n)}let r=this.knownCommands,i=r?.[n]!==void 0;for(;(t=this.nextChar())>=0&&!fo[t];){let e=n+String.fromCharCode(t);if(i&&r[e]===void 0)break;if(n.length===128)throw new F(`Command token too long: ${n.length}`);n=e,i=r?.[n]!==void 0}return n===`true`||n!==`false`&&(n===`null`?null:(n===`BI`&&(this.beginInlineImagePos=this.stream.pos),qn.get(n)))}skipToNextLine(){let e=this.currentChar;for(;e>=0;){if(e===13){e=this.nextChar(),e===10&&this.nextChar();break}if(e===10){this.nextChar();break}e=this.nextChar()}}},ho=class{static create(e){function t(e,t,n=!1){let r=e.get(t);if(Number.isInteger(r)&&(n?r>=0:r>0))return r;throw Error(`The "${t}" parameter in the linearization dictionary is invalid.`)}let n=new uo({lexer:new mo(e),xref:null}),r=n.getObj(),i=n.getObj(),a=n.getObj(),o=n.getObj(),s,c;if(!(Number.isInteger(r)&&Number.isInteger(i)&&Qn(a,`obj`)&&o instanceof L&&typeof(s=o.get(`Linearized`))==`number`&&s>0))return null;if((c=t(o,`L`))!==e.length)throw Error(`The "L" parameter in the linearization dictionary does not equal the stream length.`);return{length:c,hints:function(e){let t=e.get(`H`),n;if(Array.isArray(t)&&((n=t.length)===2||n===4)){for(let e=0;e<n;e++){let n=t[e];if(!(Number.isInteger(n)&&n>0))throw Error(`Hint (${e}) in the linearization dictionary is invalid.`)}return t}throw Error(`Hint array in the linearization dictionary is invalid.`)}(o),objectNumberFirst:t(o,`O`),endFirst:t(o,`E`),numPages:t(o,`N`),mainXRefEntriesOffset:t(o,`T`),pageFirst:o.has(`P`)?t(o,`P`,!0):0}}},go=`Adobe-GB1-UCS2.Adobe-CNS1-UCS2.Adobe-Japan1-UCS2.Adobe-Korea1-UCS2.78-EUC-H.78-EUC-V.78-H.78-RKSJ-H.78-RKSJ-V.78-V.78ms-RKSJ-H.78ms-RKSJ-V.83pv-RKSJ-H.90ms-RKSJ-H.90ms-RKSJ-V.90msp-RKSJ-H.90msp-RKSJ-V.90pv-RKSJ-H.90pv-RKSJ-V.Add-H.Add-RKSJ-H.Add-RKSJ-V.Add-V.Adobe-CNS1-0.Adobe-CNS1-1.Adobe-CNS1-2.Adobe-CNS1-3.Adobe-CNS1-4.Adobe-CNS1-5.Adobe-CNS1-6.Adobe-GB1-0.Adobe-GB1-1.Adobe-GB1-2.Adobe-GB1-3.Adobe-GB1-4.Adobe-GB1-5.Adobe-Japan1-0.Adobe-Japan1-1.Adobe-Japan1-2.Adobe-Japan1-3.Adobe-Japan1-4.Adobe-Japan1-5.Adobe-Japan1-6.Adobe-Korea1-0.Adobe-Korea1-1.Adobe-Korea1-2.B5-H.B5-V.B5pc-H.B5pc-V.CNS-EUC-H.CNS-EUC-V.CNS1-H.CNS1-V.CNS2-H.CNS2-V.ETHK-B5-H.ETHK-B5-V.ETen-B5-H.ETen-B5-V.ETenms-B5-H.ETenms-B5-V.EUC-H.EUC-V.Ext-H.Ext-RKSJ-H.Ext-RKSJ-V.Ext-V.GB-EUC-H.GB-EUC-V.GB-H.GB-V.GBK-EUC-H.GBK-EUC-V.GBK2K-H.GBK2K-V.GBKp-EUC-H.GBKp-EUC-V.GBT-EUC-H.GBT-EUC-V.GBT-H.GBT-V.GBTpc-EUC-H.GBTpc-EUC-V.GBpc-EUC-H.GBpc-EUC-V.H.HKdla-B5-H.HKdla-B5-V.HKdlb-B5-H.HKdlb-B5-V.HKgccs-B5-H.HKgccs-B5-V.HKm314-B5-H.HKm314-B5-V.HKm471-B5-H.HKm471-B5-V.HKscs-B5-H.HKscs-B5-V.Hankaku.Hiragana.KSC-EUC-H.KSC-EUC-V.KSC-H.KSC-Johab-H.KSC-Johab-V.KSC-V.KSCms-UHC-H.KSCms-UHC-HW-H.KSCms-UHC-HW-V.KSCms-UHC-V.KSCpc-EUC-H.KSCpc-EUC-V.Katakana.NWP-H.NWP-V.RKSJ-H.RKSJ-V.Roman.UniCNS-UCS2-H.UniCNS-UCS2-V.UniCNS-UTF16-H.UniCNS-UTF16-V.UniCNS-UTF32-H.UniCNS-UTF32-V.UniCNS-UTF8-H.UniCNS-UTF8-V.UniGB-UCS2-H.UniGB-UCS2-V.UniGB-UTF16-H.UniGB-UTF16-V.UniGB-UTF32-H.UniGB-UTF32-V.UniGB-UTF8-H.UniGB-UTF8-V.UniJIS-UCS2-H.UniJIS-UCS2-HW-H.UniJIS-UCS2-HW-V.UniJIS-UCS2-V.UniJIS-UTF16-H.UniJIS-UTF16-V.UniJIS-UTF32-H.UniJIS-UTF32-V.UniJIS-UTF8-H.UniJIS-UTF8-V.UniJIS2004-UTF16-H.UniJIS2004-UTF16-V.UniJIS2004-UTF32-H.UniJIS2004-UTF32-V.UniJIS2004-UTF8-H.UniJIS2004-UTF8-V.UniJISPro-UCS2-HW-V.UniJISPro-UCS2-V.UniJISPro-UTF8-V.UniJISX0213-UTF32-H.UniJISX0213-UTF32-V.UniJISX02132004-UTF32-H.UniJISX02132004-UTF32-V.UniKS-UCS2-H.UniKS-UCS2-V.UniKS-UTF16-H.UniKS-UTF16-V.UniKS-UTF32-H.UniKS-UTF32-V.UniKS-UTF8-H.UniKS-UTF8-V.V.WP-Symbol`.split(`.`),_o=2**24-1,vo=class{constructor(e=!1){this.codespaceRanges=[[],[],[],[]],this.numCodespaceRanges=0,this._map=[],this.name=``,this.vertical=!1,this.useCMap=null,this.builtInCMap=e}addCodespaceRange(e,t,n){this.codespaceRanges[e-1].push(t,n),this.numCodespaceRanges++}mapCidRange(e,t,n){if(t-e>_o)throw Error(`mapCidRange - ignoring data above MAX_MAP_RANGE.`);for(;e<=t;)this._map[e++]=n++}mapBfRange(e,t,n){if(t-e>_o)throw Error(`mapBfRange - ignoring data above MAX_MAP_RANGE.`);let r=n.length-1;for(;e<=t;){this._map[e++]=n;let t=n.charCodeAt(r)+1;n=t>255?n.substring(0,r-1)+String.fromCharCode(n.charCodeAt(r-1)+1)+`\0`:n.substring(0,r)+String.fromCharCode(t)}}mapBfRangeToArray(e,t,n){if(t-e>_o)throw Error(`mapBfRangeToArray - ignoring data above MAX_MAP_RANGE.`);let r=n.length,i=0;for(;e<=t&&i<r;)this._map[e]=n[i++],++e}mapOne(e,t){this._map[e]=t}lookup(e){return this._map[e]}contains(e){return this._map[e]!==void 0}forEach(e){let t=this._map,n=t.length;if(n<=65536)for(let r=0;r<n;r++)t[r]!==void 0&&e(r,t[r]);else for(let n in t)e(n,t[n])}charCodeOf(e){let t=this._map;if(t.length<=65536)return t.indexOf(e);for(let n in t)if(t[n]===e)return 0|n;return-1}getMap(){return this._map}readCharCode(e,t,n){let r=0,i=this.codespaceRanges;for(let a=0,o=i.length;a<o;a++){r=(r<<8|e.charCodeAt(t+a))>>>0;let o=i[a];for(let e=0,t=o.length;e<t;){let t=o[e++],i=o[e++];if(r>=t&&r<=i)return n.charcode=r,void(n.length=a+1)}}n.charcode=0,n.length=1}getCharCodeLength(e){let t=this.codespaceRanges;for(let n=0,r=t.length;n<r;n++){let r=t[n];for(let t=0,i=r.length;t<i;){let i=r[t++],a=r[t++];if(e>=i&&e<=a)return n+1}}return 1}get length(){return this._map.length}get isIdentityCMap(){if(this.name!==`Identity-H`&&this.name!==`Identity-V`||this._map.length!==65536)return!1;for(let e=0;e<65536;e++)if(this._map[e]!==e)return!1;return!0}},yo=class extends vo{constructor(e,t){super(),this.vertical=e,this.addCodespaceRange(t,0,65535)}mapCidRange(e,t,n){gn(`should not call mapCidRange`)}mapBfRange(e,t,n){gn(`should not call mapBfRange`)}mapBfRangeToArray(e,t,n){gn(`should not call mapBfRangeToArray`)}mapOne(e,t){gn(`should not call mapCidOne`)}lookup(e){return Number.isInteger(e)&&e<=65535?e:void 0}contains(e){return Number.isInteger(e)&&e<=65535}forEach(e){for(let t=0;t<=65535;t++)e(t,t)}charCodeOf(e){return Number.isInteger(e)&&e<=65535?e:-1}getMap(){let e=Array(65536);for(let t=0;t<=65535;t++)e[t]=t;return e}get length(){return 65536}get isIdentityCMap(){gn(`should not access .isIdentityCMap`)}};function bo(e){let t=0;for(let n=0;n<e.length;n++)t=t<<8|e.charCodeAt(n);return t>>>0}function xo(e){if(typeof e!=`string`)throw new F(`Malformed CMap: expected string.`)}function So(e){if(!Number.isInteger(e))throw new F(`Malformed CMap: expected int.`)}function Co(e,t){for(;;){let n=t.getObj();if(n===Un)break;if(Qn(n,`endbfchar`))return;xo(n);let r=bo(n);n=t.getObj(),xo(n);let i=n;e.mapOne(r,i)}}function wo(e,t){for(;;){let n=t.getObj();if(n===Un)break;if(Qn(n,`endbfrange`))return;xo(n);let r=bo(n);n=t.getObj(),xo(n);let i=bo(n);if(n=t.getObj(),Number.isInteger(n)||typeof n==`string`){let t=Number.isInteger(n)?String.fromCharCode(n):n;e.mapBfRange(r,i,t)}else{if(!Qn(n,`[`))break;{n=t.getObj();let a=[];for(;!Qn(n,`]`)&&n!==Un;)a.push(n),n=t.getObj();e.mapBfRangeToArray(r,i,a)}}}throw new F(`Invalid bf range.`)}function To(e,t){for(;;){let n=t.getObj();if(n===Un)break;if(Qn(n,`endcidchar`))return;xo(n);let r=bo(n);n=t.getObj(),So(n);let i=n;e.mapOne(r,i)}}function Eo(e,t){for(;;){let n=t.getObj();if(n===Un)break;if(Qn(n,`endcidrange`))return;xo(n);let r=bo(n);n=t.getObj(),xo(n);let i=bo(n);n=t.getObj(),So(n);let a=n;e.mapCidRange(r,i,a)}}function Do(e,t){for(;;){let n=t.getObj();if(n===Un)break;if(Qn(n,`endcodespacerange`))return;if(typeof n!=`string`)break;let r=bo(n);if(n=t.getObj(),typeof n!=`string`)break;let i=bo(n);e.addCodespaceRange(n.length,r,i)}throw new F(`Invalid codespace range.`)}function Oo(e,t){let n=t.getObj();Number.isInteger(n)&&(e.vertical=!!n)}function ko(e,t){let n=t.getObj();n instanceof I&&(e.name=n.name)}async function Ao(e,t,n,r){let i,a;e:for(;;)try{let n=t.getObj();if(n===Un)break;if(n instanceof I)n.name===`WMode`?Oo(e,t):n.name===`CMapName`&&ko(e,t),i=n;else if(n instanceof qn)switch(n.cmd){case`endcmap`:break e;case`usecmap`:i instanceof I&&(a=i.name);break;case`begincodespacerange`:Do(e,t);break;case`beginbfchar`:Co(e,t);break;case`begincidchar`:To(e,t);break;case`beginbfrange`:wo(e,t);break;case`begincidrange`:Eo(e,t)}}catch(e){if(e instanceof cr)throw e;N(`Invalid cMap data: `+e);continue}return!r&&a&&(r=a),r?jo(e,n,r):e}async function jo(e,t,n){if(e.useCMap=await Mo(n,t),e.numCodespaceRanges===0){let t=e.useCMap.codespaceRanges;for(let n=0;n<t.length;n++)e.codespaceRanges[n]=t[n].slice();e.numCodespaceRanges=e.useCMap.numCodespaceRanges}return e.useCMap.forEach(function(t,n){e.contains(t)||e.mapOne(t,n)}),e}async function Mo(e,t){if(e===`Identity-H`)return new yo(!1,2);if(e===`Identity-V`)return new yo(!0,2);if(!go.includes(e))throw Error(`Unknown CMap name: `+e);if(!t)throw Error(`Built-in CMap parameters are not provided.`);let{cMapData:n,isCompressed:r}=await t(e),i=new vo(!0);return r?new ua().process(n,i,e=>jo(i,t,e)):Ao(i,new mo(new gi(n)),t,null)}var No=class{static async create({encoding:e,fetchBuiltInCMap:t,useCMap:n}){if(e instanceof I)return Mo(e.name,t);if(e instanceof tr){let r=await Ao(new vo,new mo(e),t,n);return r.isIdentityCMap?Mo(r.name,t):r}throw Error(`Encoding required.`)}},Po=`................................space.exclamsmall.Hungarumlautsmall..dollaroldstyle.dollarsuperior.ampersandsmall.Acutesmall.parenleftsuperior.parenrightsuperior.twodotenleader.onedotenleader.comma.hyphen.period.fraction.zerooldstyle.oneoldstyle.twooldstyle.threeoldstyle.fouroldstyle.fiveoldstyle.sixoldstyle.sevenoldstyle.eightoldstyle.nineoldstyle.colon.semicolon.commasuperior.threequartersemdash.periodsuperior.questionsmall..asuperior.bsuperior.centsuperior.dsuperior.esuperior....isuperior...lsuperior.msuperior.nsuperior.osuperior...rsuperior.ssuperior.tsuperior..ff.fi.fl.ffi.ffl.parenleftinferior..parenrightinferior.Circumflexsmall.hyphensuperior.Gravesmall.Asmall.Bsmall.Csmall.Dsmall.Esmall.Fsmall.Gsmall.Hsmall.Ismall.Jsmall.Ksmall.Lsmall.Msmall.Nsmall.Osmall.Psmall.Qsmall.Rsmall.Ssmall.Tsmall.Usmall.Vsmall.Wsmall.Xsmall.Ysmall.Zsmall.colonmonetary.onefitted.rupiah.Tildesmall...................................exclamdownsmall.centoldstyle.Lslashsmall...Scaronsmall.Zcaronsmall.Dieresissmall.Brevesmall.Caronsmall..Dotaccentsmall...Macronsmall...figuredash.hypheninferior...Ogoneksmall.Ringsmall.Cedillasmall....onequarter.onehalf.threequarters.questiondownsmall.oneeighth.threeeighths.fiveeighths.seveneighths.onethird.twothirds...zerosuperior.onesuperior.twosuperior.threesuperior.foursuperior.fivesuperior.sixsuperior.sevensuperior.eightsuperior.ninesuperior.zeroinferior.oneinferior.twoinferior.threeinferior.fourinferior.fiveinferior.sixinferior.seveninferior.eightinferior.nineinferior.centinferior.dollarinferior.periodinferior.commainferior.Agravesmall.Aacutesmall.Acircumflexsmall.Atildesmall.Adieresissmall.Aringsmall.AEsmall.Ccedillasmall.Egravesmall.Eacutesmall.Ecircumflexsmall.Edieresissmall.Igravesmall.Iacutesmall.Icircumflexsmall.Idieresissmall.Ethsmall.Ntildesmall.Ogravesmall.Oacutesmall.Ocircumflexsmall.Otildesmall.Odieresissmall.OEsmall.Oslashsmall.Ugravesmall.Uacutesmall.Ucircumflexsmall.Udieresissmall.Yacutesmall.Thornsmall.Ydieresissmall`.split(`.`),Fo=`................................space.exclamsmall.Hungarumlautsmall.centoldstyle.dollaroldstyle.dollarsuperior.ampersandsmall.Acutesmall.parenleftsuperior.parenrightsuperior.twodotenleader.onedotenleader.comma.hyphen.period.fraction.zerooldstyle.oneoldstyle.twooldstyle.threeoldstyle.fouroldstyle.fiveoldstyle.sixoldstyle.sevenoldstyle.eightoldstyle.nineoldstyle.colon.semicolon..threequartersemdash..questionsmall.....Ethsmall...onequarter.onehalf.threequarters.oneeighth.threeeighths.fiveeighths.seveneighths.onethird.twothirds.......ff.fi.fl.ffi.ffl.parenleftinferior..parenrightinferior.Circumflexsmall.hypheninferior.Gravesmall.Asmall.Bsmall.Csmall.Dsmall.Esmall.Fsmall.Gsmall.Hsmall.Ismall.Jsmall.Ksmall.Lsmall.Msmall.Nsmall.Osmall.Psmall.Qsmall.Rsmall.Ssmall.Tsmall.Usmall.Vsmall.Wsmall.Xsmall.Ysmall.Zsmall.colonmonetary.onefitted.rupiah.Tildesmall...asuperior.centsuperior.....Aacutesmall.Agravesmall.Acircumflexsmall.Adieresissmall.Atildesmall.Aringsmall.Ccedillasmall.Eacutesmall.Egravesmall.Ecircumflexsmall.Edieresissmall.Iacutesmall.Igravesmall.Icircumflexsmall.Idieresissmall.Ntildesmall.Oacutesmall.Ogravesmall.Ocircumflexsmall.Odieresissmall.Otildesmall.Uacutesmall.Ugravesmall.Ucircumflexsmall.Udieresissmall..eightsuperior.fourinferior.threeinferior.sixinferior.eightinferior.seveninferior.Scaronsmall..centinferior.twoinferior..Dieresissmall..Caronsmall.osuperior.fiveinferior..commainferior.periodinferior.Yacutesmall..dollarinferior...Thornsmall..nineinferior.zeroinferior.Zcaronsmall.AEsmall.Oslashsmall.questiondownsmall.oneinferior.Lslashsmall.......Cedillasmall......OEsmall.figuredash.hyphensuperior.....exclamdownsmall..Ydieresissmall..onesuperior.twosuperior.threesuperior.foursuperior.fivesuperior.sixsuperior.sevensuperior.ninesuperior.zerosuperior..esuperior.rsuperior.tsuperior...isuperior.ssuperior.dsuperior......lsuperior.Ogoneksmall.Brevesmall.Macronsmall.bsuperior.nsuperior.msuperior.commasuperior.periodsuperior.Dotaccentsmall.Ringsmall....`.split(`.`),Io=`................................space.exclam.quotedbl.numbersign.dollar.percent.ampersand.quotesingle.parenleft.parenright.asterisk.plus.comma.hyphen.period.slash.zero.one.two.three.four.five.six.seven.eight.nine.colon.semicolon.less.equal.greater.question.at.A.B.C.D.E.F.G.H.I.J.K.L.M.N.O.P.Q.R.S.T.U.V.W.X.Y.Z.bracketleft.backslash.bracketright.asciicircum.underscore.grave.a.b.c.d.e.f.g.h.i.j.k.l.m.n.o.p.q.r.s.t.u.v.w.x.y.z.braceleft.bar.braceright.asciitilde..Adieresis.Aring.Ccedilla.Eacute.Ntilde.Odieresis.Udieresis.aacute.agrave.acircumflex.adieresis.atilde.aring.ccedilla.eacute.egrave.ecircumflex.edieresis.iacute.igrave.icircumflex.idieresis.ntilde.oacute.ograve.ocircumflex.odieresis.otilde.uacute.ugrave.ucircumflex.udieresis.dagger.degree.cent.sterling.section.bullet.paragraph.germandbls.registered.copyright.trademark.acute.dieresis.notequal.AE.Oslash.infinity.plusminus.lessequal.greaterequal.yen.mu.partialdiff.summation.product.pi.integral.ordfeminine.ordmasculine.Omega.ae.oslash.questiondown.exclamdown.logicalnot.radical.florin.approxequal.Delta.guillemotleft.guillemotright.ellipsis.space.Agrave.Atilde.Otilde.OE.oe.endash.emdash.quotedblleft.quotedblright.quoteleft.quoteright.divide.lozenge.ydieresis.Ydieresis.fraction.currency.guilsinglleft.guilsinglright.fi.fl.daggerdbl.periodcentered.quotesinglbase.quotedblbase.perthousand.Acircumflex.Ecircumflex.Aacute.Edieresis.Egrave.Iacute.Icircumflex.Idieresis.Igrave.Oacute.Ocircumflex.apple.Ograve.Uacute.Ucircumflex.Ugrave.dotlessi.circumflex.tilde.macron.breve.dotaccent.ring.cedilla.hungarumlaut.ogonek.caron`.split(`.`),Lo=`................................space.exclam.quotedbl.numbersign.dollar.percent.ampersand.quoteright.parenleft.parenright.asterisk.plus.comma.hyphen.period.slash.zero.one.two.three.four.five.six.seven.eight.nine.colon.semicolon.less.equal.greater.question.at.A.B.C.D.E.F.G.H.I.J.K.L.M.N.O.P.Q.R.S.T.U.V.W.X.Y.Z.bracketleft.backslash.bracketright.asciicircum.underscore.quoteleft.a.b.c.d.e.f.g.h.i.j.k.l.m.n.o.p.q.r.s.t.u.v.w.x.y.z.braceleft.bar.braceright.asciitilde...................................exclamdown.cent.sterling.fraction.yen.florin.section.currency.quotesingle.quotedblleft.guillemotleft.guilsinglleft.guilsinglright.fi.fl..endash.dagger.daggerdbl.periodcentered..paragraph.bullet.quotesinglbase.quotedblbase.quotedblright.guillemotright.ellipsis.perthousand..questiondown..grave.acute.circumflex.tilde.macron.breve.dotaccent.dieresis..ring.cedilla..hungarumlaut.ogonek.caron.emdash.................AE..ordfeminine.....Lslash.Oslash.OE.ordmasculine......ae....dotlessi...lslash.oslash.oe.germandbls....`.split(`.`),Ro=`................................space.exclam.quotedbl.numbersign.dollar.percent.ampersand.quotesingle.parenleft.parenright.asterisk.plus.comma.hyphen.period.slash.zero.one.two.three.four.five.six.seven.eight.nine.colon.semicolon.less.equal.greater.question.at.A.B.C.D.E.F.G.H.I.J.K.L.M.N.O.P.Q.R.S.T.U.V.W.X.Y.Z.bracketleft.backslash.bracketright.asciicircum.underscore.grave.a.b.c.d.e.f.g.h.i.j.k.l.m.n.o.p.q.r.s.t.u.v.w.x.y.z.braceleft.bar.braceright.asciitilde.bullet.Euro.bullet.quotesinglbase.florin.quotedblbase.ellipsis.dagger.daggerdbl.circumflex.perthousand.Scaron.guilsinglleft.OE.bullet.Zcaron.bullet.bullet.quoteleft.quoteright.quotedblleft.quotedblright.bullet.endash.emdash.tilde.trademark.scaron.guilsinglright.oe.bullet.zcaron.Ydieresis.space.exclamdown.cent.sterling.currency.yen.brokenbar.section.dieresis.copyright.ordfeminine.guillemotleft.logicalnot.hyphen.registered.macron.degree.plusminus.twosuperior.threesuperior.acute.mu.paragraph.periodcentered.cedilla.onesuperior.ordmasculine.guillemotright.onequarter.onehalf.threequarters.questiondown.Agrave.Aacute.Acircumflex.Atilde.Adieresis.Aring.AE.Ccedilla.Egrave.Eacute.Ecircumflex.Edieresis.Igrave.Iacute.Icircumflex.Idieresis.Eth.Ntilde.Ograve.Oacute.Ocircumflex.Otilde.Odieresis.multiply.Oslash.Ugrave.Uacute.Ucircumflex.Udieresis.Yacute.Thorn.germandbls.agrave.aacute.acircumflex.atilde.adieresis.aring.ae.ccedilla.egrave.eacute.ecircumflex.edieresis.igrave.iacute.icircumflex.idieresis.eth.ntilde.ograve.oacute.ocircumflex.otilde.odieresis.divide.oslash.ugrave.uacute.ucircumflex.udieresis.yacute.thorn.ydieresis`.split(`.`),zo=`................................space.exclam.universal.numbersign.existential.percent.ampersand.suchthat.parenleft.parenright.asteriskmath.plus.comma.minus.period.slash.zero.one.two.three.four.five.six.seven.eight.nine.colon.semicolon.less.equal.greater.question.congruent.Alpha.Beta.Chi.Delta.Epsilon.Phi.Gamma.Eta.Iota.theta1.Kappa.Lambda.Mu.Nu.Omicron.Pi.Theta.Rho.Sigma.Tau.Upsilon.sigma1.Omega.Xi.Psi.Zeta.bracketleft.therefore.bracketright.perpendicular.underscore.radicalex.alpha.beta.chi.delta.epsilon.phi.gamma.eta.iota.phi1.kappa.lambda.mu.nu.omicron.pi.theta.rho.sigma.tau.upsilon.omega1.omega.xi.psi.zeta.braceleft.bar.braceright.similar..................................Euro.Upsilon1.minute.lessequal.fraction.infinity.florin.club.diamond.heart.spade.arrowboth.arrowleft.arrowup.arrowright.arrowdown.degree.plusminus.second.greaterequal.multiply.proportional.partialdiff.bullet.divide.notequal.equivalence.approxequal.ellipsis.arrowvertex.arrowhorizex.carriagereturn.aleph.Ifraktur.Rfraktur.weierstrass.circlemultiply.circleplus.emptyset.intersection.union.propersuperset.reflexsuperset.notsubset.propersubset.reflexsubset.element.notelement.angle.gradient.registerserif.copyrightserif.trademarkserif.product.radical.dotmath.logicalnot.logicaland.logicalor.arrowdblboth.arrowdblleft.arrowdblup.arrowdblright.arrowdbldown.lozenge.angleleft.registersans.copyrightsans.trademarksans.summation.parenlefttp.parenleftex.parenleftbt.bracketlefttp.bracketleftex.bracketleftbt.bracelefttp.braceleftmid.braceleftbt.braceex..angleright.integral.integraltp.integralex.integralbt.parenrighttp.parenrightex.parenrightbt.bracketrighttp.bracketrightex.bracketrightbt.bracerighttp.bracerightmid.bracerightbt.`.split(`.`),Bo=`................................space.a1.a2.a202.a3.a4.a5.a119.a118.a117.a11.a12.a13.a14.a15.a16.a105.a17.a18.a19.a20.a21.a22.a23.a24.a25.a26.a27.a28.a6.a7.a8.a9.a10.a29.a30.a31.a32.a33.a34.a35.a36.a37.a38.a39.a40.a41.a42.a43.a44.a45.a46.a47.a48.a49.a50.a51.a52.a53.a54.a55.a56.a57.a58.a59.a60.a61.a62.a63.a64.a65.a66.a67.a68.a69.a70.a71.a72.a73.a74.a203.a75.a204.a76.a77.a78.a79.a81.a82.a83.a84.a97.a98.a99.a100..a89.a90.a93.a94.a91.a92.a205.a85.a206.a86.a87.a88.a95.a96....................a101.a102.a103.a104.a106.a107.a108.a112.a111.a110.a109.a120.a121.a122.a123.a124.a125.a126.a127.a128.a129.a130.a131.a132.a133.a134.a135.a136.a137.a138.a139.a140.a141.a142.a143.a144.a145.a146.a147.a148.a149.a150.a151.a152.a153.a154.a155.a156.a157.a158.a159.a160.a161.a163.a164.a196.a165.a192.a166.a167.a168.a169.a170.a171.a172.a173.a162.a174.a175.a176.a177.a178.a179.a193.a180.a199.a181.a200.a182..a201.a183.a184.a197.a185.a194.a198.a186.a195.a187.a188.a189.a190.a191.`.split(`.`);function Vo(e){switch(e){case`WinAnsiEncoding`:return Ro;case`StandardEncoding`:return Lo;case`MacRomanEncoding`:return Io;case`SymbolSetEncoding`:return zo;case`ZapfDingbatsEncoding`:return Bo;case`ExpertEncoding`:return Po;case`MacExpertEncoding`:return Fo;default:return null}}var Ho=sr(function(e){e.A=65,e.AE=198,e.AEacute=508,e.AEmacron=482,e.AEsmall=63462,e.Aacute=193,e.Aacutesmall=63457,e.Abreve=258,e.Abreveacute=7854,e.Abrevecyrillic=1232,e.Abrevedotbelow=7862,e.Abrevegrave=7856,e.Abrevehookabove=7858,e.Abrevetilde=7860,e.Acaron=461,e.Acircle=9398,e.Acircumflex=194,e.Acircumflexacute=7844,e.Acircumflexdotbelow=7852,e.Acircumflexgrave=7846,e.Acircumflexhookabove=7848,e.Acircumflexsmall=63458,e.Acircumflextilde=7850,e.Acute=63177,e.Acutesmall=63412,e.Acyrillic=1040,e.Adblgrave=512,e.Adieresis=196,e.Adieresiscyrillic=1234,e.Adieresismacron=478,e.Adieresissmall=63460,e.Adotbelow=7840,e.Adotmacron=480,e.Agrave=192,e.Agravesmall=63456,e.Ahookabove=7842,e.Aiecyrillic=1236,e.Ainvertedbreve=514,e.Alpha=913,e.Alphatonos=902,e.Amacron=256,e.Amonospace=65313,e.Aogonek=260,e.Aring=197,e.Aringacute=506,e.Aringbelow=7680,e.Aringsmall=63461,e.Asmall=63329,e.Atilde=195,e.Atildesmall=63459,e.Aybarmenian=1329,e.B=66,e.Bcircle=9399,e.Bdotaccent=7682,e.Bdotbelow=7684,e.Becyrillic=1041,e.Benarmenian=1330,e.Beta=914,e.Bhook=385,e.Blinebelow=7686,e.Bmonospace=65314,e.Brevesmall=63220,e.Bsmall=63330,e.Btopbar=386,e.C=67,e.Caarmenian=1342,e.Cacute=262,e.Caron=63178,e.Caronsmall=63221,e.Ccaron=268,e.Ccedilla=199,e.Ccedillaacute=7688,e.Ccedillasmall=63463,e.Ccircle=9400,e.Ccircumflex=264,e.Cdot=266,e.Cdotaccent=266,e.Cedillasmall=63416,e.Chaarmenian=1353,e.Cheabkhasiancyrillic=1212,e.Checyrillic=1063,e.Chedescenderabkhasiancyrillic=1214,e.Chedescendercyrillic=1206,e.Chedieresiscyrillic=1268,e.Cheharmenian=1347,e.Chekhakassiancyrillic=1227,e.Cheverticalstrokecyrillic=1208,e.Chi=935,e.Chook=391,e.Circumflexsmall=63222,e.Cmonospace=65315,e.Coarmenian=1361,e.Csmall=63331,e.D=68,e.DZ=497,e.DZcaron=452,e.Daarmenian=1332,e.Dafrican=393,e.Dcaron=270,e.Dcedilla=7696,e.Dcircle=9401,e.Dcircumflexbelow=7698,e.Dcroat=272,e.Ddotaccent=7690,e.Ddotbelow=7692,e.Decyrillic=1044,e.Deicoptic=1006,e.Delta=8710,e.Deltagreek=916,e.Dhook=394,e.Dieresis=63179,e.DieresisAcute=63180,e.DieresisGrave=63181,e.Dieresissmall=63400,e.Digammagreek=988,e.Djecyrillic=1026,e.Dlinebelow=7694,e.Dmonospace=65316,e.Dotaccentsmall=63223,e.Dslash=272,e.Dsmall=63332,e.Dtopbar=395,e.Dz=498,e.Dzcaron=453,e.Dzeabkhasiancyrillic=1248,e.Dzecyrillic=1029,e.Dzhecyrillic=1039,e.E=69,e.Eacute=201,e.Eacutesmall=63465,e.Ebreve=276,e.Ecaron=282,e.Ecedillabreve=7708,e.Echarmenian=1333,e.Ecircle=9402,e.Ecircumflex=202,e.Ecircumflexacute=7870,e.Ecircumflexbelow=7704,e.Ecircumflexdotbelow=7878,e.Ecircumflexgrave=7872,e.Ecircumflexhookabove=7874,e.Ecircumflexsmall=63466,e.Ecircumflextilde=7876,e.Ecyrillic=1028,e.Edblgrave=516,e.Edieresis=203,e.Edieresissmall=63467,e.Edot=278,e.Edotaccent=278,e.Edotbelow=7864,e.Efcyrillic=1060,e.Egrave=200,e.Egravesmall=63464,e.Eharmenian=1335,e.Ehookabove=7866,e.Eightroman=8551,e.Einvertedbreve=518,e.Eiotifiedcyrillic=1124,e.Elcyrillic=1051,e.Elevenroman=8554,e.Emacron=274,e.Emacronacute=7702,e.Emacrongrave=7700,e.Emcyrillic=1052,e.Emonospace=65317,e.Encyrillic=1053,e.Endescendercyrillic=1186,e.Eng=330,e.Enghecyrillic=1188,e.Enhookcyrillic=1223,e.Eogonek=280,e.Eopen=400,e.Epsilon=917,e.Epsilontonos=904,e.Ercyrillic=1056,e.Ereversed=398,e.Ereversedcyrillic=1069,e.Escyrillic=1057,e.Esdescendercyrillic=1194,e.Esh=425,e.Esmall=63333,e.Eta=919,e.Etarmenian=1336,e.Etatonos=905,e.Eth=208,e.Ethsmall=63472,e.Etilde=7868,e.Etildebelow=7706,e.Euro=8364,e.Ezh=439,e.Ezhcaron=494,e.Ezhreversed=440,e.F=70,e.Fcircle=9403,e.Fdotaccent=7710,e.Feharmenian=1366,e.Feicoptic=996,e.Fhook=401,e.Fitacyrillic=1138,e.Fiveroman=8548,e.Fmonospace=65318,e.Fourroman=8547,e.Fsmall=63334,e.G=71,e.GBsquare=13191,e.Gacute=500,e.Gamma=915,e.Gammaafrican=404,e.Gangiacoptic=1002,e.Gbreve=286,e.Gcaron=486,e.Gcedilla=290,e.Gcircle=9404,e.Gcircumflex=284,e.Gcommaaccent=290,e.Gdot=288,e.Gdotaccent=288,e.Gecyrillic=1043,e.Ghadarmenian=1346,e.Ghemiddlehookcyrillic=1172,e.Ghestrokecyrillic=1170,e.Gheupturncyrillic=1168,e.Ghook=403,e.Gimarmenian=1331,e.Gjecyrillic=1027,e.Gmacron=7712,e.Gmonospace=65319,e.Grave=63182,e.Gravesmall=63328,e.Gsmall=63335,e.Gsmallhook=667,e.Gstroke=484,e.H=72,e.H18533=9679,e.H18543=9642,e.H18551=9643,e.H22073=9633,e.HPsquare=13259,e.Haabkhasiancyrillic=1192,e.Hadescendercyrillic=1202,e.Hardsigncyrillic=1066,e.Hbar=294,e.Hbrevebelow=7722,e.Hcedilla=7720,e.Hcircle=9405,e.Hcircumflex=292,e.Hdieresis=7718,e.Hdotaccent=7714,e.Hdotbelow=7716,e.Hmonospace=65320,e.Hoarmenian=1344,e.Horicoptic=1e3,e.Hsmall=63336,e.Hungarumlaut=63183,e.Hungarumlautsmall=63224,e.Hzsquare=13200,e.I=73,e.IAcyrillic=1071,e.IJ=306,e.IUcyrillic=1070,e.Iacute=205,e.Iacutesmall=63469,e.Ibreve=300,e.Icaron=463,e.Icircle=9406,e.Icircumflex=206,e.Icircumflexsmall=63470,e.Icyrillic=1030,e.Idblgrave=520,e.Idieresis=207,e.Idieresisacute=7726,e.Idieresiscyrillic=1252,e.Idieresissmall=63471,e.Idot=304,e.Idotaccent=304,e.Idotbelow=7882,e.Iebrevecyrillic=1238,e.Iecyrillic=1045,e.Ifraktur=8465,e.Igrave=204,e.Igravesmall=63468,e.Ihookabove=7880,e.Iicyrillic=1048,e.Iinvertedbreve=522,e.Iishortcyrillic=1049,e.Imacron=298,e.Imacroncyrillic=1250,e.Imonospace=65321,e.Iniarmenian=1339,e.Iocyrillic=1025,e.Iogonek=302,e.Iota=921,e.Iotaafrican=406,e.Iotadieresis=938,e.Iotatonos=906,e.Ismall=63337,e.Istroke=407,e.Itilde=296,e.Itildebelow=7724,e.Izhitsacyrillic=1140,e.Izhitsadblgravecyrillic=1142,e.J=74,e.Jaarmenian=1345,e.Jcircle=9407,e.Jcircumflex=308,e.Jecyrillic=1032,e.Jheharmenian=1355,e.Jmonospace=65322,e.Jsmall=63338,e.K=75,e.KBsquare=13189,e.KKsquare=13261,e.Kabashkircyrillic=1184,e.Kacute=7728,e.Kacyrillic=1050,e.Kadescendercyrillic=1178,e.Kahookcyrillic=1219,e.Kappa=922,e.Kastrokecyrillic=1182,e.Kaverticalstrokecyrillic=1180,e.Kcaron=488,e.Kcedilla=310,e.Kcircle=9408,e.Kcommaaccent=310,e.Kdotbelow=7730,e.Keharmenian=1364,e.Kenarmenian=1343,e.Khacyrillic=1061,e.Kheicoptic=998,e.Khook=408,e.Kjecyrillic=1036,e.Klinebelow=7732,e.Kmonospace=65323,e.Koppacyrillic=1152,e.Koppagreek=990,e.Ksicyrillic=1134,e.Ksmall=63339,e.L=76,e.LJ=455,e.LL=63167,e.Lacute=313,e.Lambda=923,e.Lcaron=317,e.Lcedilla=315,e.Lcircle=9409,e.Lcircumflexbelow=7740,e.Lcommaaccent=315,e.Ldot=319,e.Ldotaccent=319,e.Ldotbelow=7734,e.Ldotbelowmacron=7736,e.Liwnarmenian=1340,e.Lj=456,e.Ljecyrillic=1033,e.Llinebelow=7738,e.Lmonospace=65324,e.Lslash=321,e.Lslashsmall=63225,e.Lsmall=63340,e.M=77,e.MBsquare=13190,e.Macron=63184,e.Macronsmall=63407,e.Macute=7742,e.Mcircle=9410,e.Mdotaccent=7744,e.Mdotbelow=7746,e.Menarmenian=1348,e.Mmonospace=65325,e.Msmall=63341,e.Mturned=412,e.Mu=924,e.N=78,e.NJ=458,e.Nacute=323,e.Ncaron=327,e.Ncedilla=325,e.Ncircle=9411,e.Ncircumflexbelow=7754,e.Ncommaaccent=325,e.Ndotaccent=7748,e.Ndotbelow=7750,e.Nhookleft=413,e.Nineroman=8552,e.Nj=459,e.Njecyrillic=1034,e.Nlinebelow=7752,e.Nmonospace=65326,e.Nowarmenian=1350,e.Nsmall=63342,e.Ntilde=209,e.Ntildesmall=63473,e.Nu=925,e.O=79,e.OE=338,e.OEsmall=63226,e.Oacute=211,e.Oacutesmall=63475,e.Obarredcyrillic=1256,e.Obarreddieresiscyrillic=1258,e.Obreve=334,e.Ocaron=465,e.Ocenteredtilde=415,e.Ocircle=9412,e.Ocircumflex=212,e.Ocircumflexacute=7888,e.Ocircumflexdotbelow=7896,e.Ocircumflexgrave=7890,e.Ocircumflexhookabove=7892,e.Ocircumflexsmall=63476,e.Ocircumflextilde=7894,e.Ocyrillic=1054,e.Odblacute=336,e.Odblgrave=524,e.Odieresis=214,e.Odieresiscyrillic=1254,e.Odieresissmall=63478,e.Odotbelow=7884,e.Ogoneksmall=63227,e.Ograve=210,e.Ogravesmall=63474,e.Oharmenian=1365,e.Ohm=8486,e.Ohookabove=7886,e.Ohorn=416,e.Ohornacute=7898,e.Ohorndotbelow=7906,e.Ohorngrave=7900,e.Ohornhookabove=7902,e.Ohorntilde=7904,e.Ohungarumlaut=336,e.Oi=418,e.Oinvertedbreve=526,e.Omacron=332,e.Omacronacute=7762,e.Omacrongrave=7760,e.Omega=8486,e.Omegacyrillic=1120,e.Omegagreek=937,e.Omegaroundcyrillic=1146,e.Omegatitlocyrillic=1148,e.Omegatonos=911,e.Omicron=927,e.Omicrontonos=908,e.Omonospace=65327,e.Oneroman=8544,e.Oogonek=490,e.Oogonekmacron=492,e.Oopen=390,e.Oslash=216,e.Oslashacute=510,e.Oslashsmall=63480,e.Osmall=63343,e.Ostrokeacute=510,e.Otcyrillic=1150,e.Otilde=213,e.Otildeacute=7756,e.Otildedieresis=7758,e.Otildesmall=63477,e.P=80,e.Pacute=7764,e.Pcircle=9413,e.Pdotaccent=7766,e.Pecyrillic=1055,e.Peharmenian=1354,e.Pemiddlehookcyrillic=1190,e.Phi=934,e.Phook=420,e.Pi=928,e.Piwrarmenian=1363,e.Pmonospace=65328,e.Psi=936,e.Psicyrillic=1136,e.Psmall=63344,e.Q=81,e.Qcircle=9414,e.Qmonospace=65329,e.Qsmall=63345,e.R=82,e.Raarmenian=1356,e.Racute=340,e.Rcaron=344,e.Rcedilla=342,e.Rcircle=9415,e.Rcommaaccent=342,e.Rdblgrave=528,e.Rdotaccent=7768,e.Rdotbelow=7770,e.Rdotbelowmacron=7772,e.Reharmenian=1360,e.Rfraktur=8476,e.Rho=929,e.Ringsmall=63228,e.Rinvertedbreve=530,e.Rlinebelow=7774,e.Rmonospace=65330,e.Rsmall=63346,e.Rsmallinverted=641,e.Rsmallinvertedsuperior=694,e.S=83,e.SF010000=9484,e.SF020000=9492,e.SF030000=9488,e.SF040000=9496,e.SF050000=9532,e.SF060000=9516,e.SF070000=9524,e.SF080000=9500,e.SF090000=9508,e.SF100000=9472,e.SF110000=9474,e.SF190000=9569,e.SF200000=9570,e.SF210000=9558,e.SF220000=9557,e.SF230000=9571,e.SF240000=9553,e.SF250000=9559,e.SF260000=9565,e.SF270000=9564,e.SF280000=9563,e.SF360000=9566,e.SF370000=9567,e.SF380000=9562,e.SF390000=9556,e.SF400000=9577,e.SF410000=9574,e.SF420000=9568,e.SF430000=9552,e.SF440000=9580,e.SF450000=9575,e.SF460000=9576,e.SF470000=9572,e.SF480000=9573,e.SF490000=9561,e.SF500000=9560,e.SF510000=9554,e.SF520000=9555,e.SF530000=9579,e.SF540000=9578,e.Sacute=346,e.Sacutedotaccent=7780,e.Sampigreek=992,e.Scaron=352,e.Scarondotaccent=7782,e.Scaronsmall=63229,e.Scedilla=350,e.Schwa=399,e.Schwacyrillic=1240,e.Schwadieresiscyrillic=1242,e.Scircle=9416,e.Scircumflex=348,e.Scommaaccent=536,e.Sdotaccent=7776,e.Sdotbelow=7778,e.Sdotbelowdotaccent=7784,e.Seharmenian=1357,e.Sevenroman=8550,e.Shaarmenian=1351,e.Shacyrillic=1064,e.Shchacyrillic=1065,e.Sheicoptic=994,e.Shhacyrillic=1210,e.Shimacoptic=1004,e.Sigma=931,e.Sixroman=8549,e.Smonospace=65331,e.Softsigncyrillic=1068,e.Ssmall=63347,e.Stigmagreek=986,e.T=84,e.Tau=932,e.Tbar=358,e.Tcaron=356,e.Tcedilla=354,e.Tcircle=9417,e.Tcircumflexbelow=7792,e.Tcommaaccent=354,e.Tdotaccent=7786,e.Tdotbelow=7788,e.Tecyrillic=1058,e.Tedescendercyrillic=1196,e.Tenroman=8553,e.Tetsecyrillic=1204,e.Theta=920,e.Thook=428,e.Thorn=222,e.Thornsmall=63486,e.Threeroman=8546,e.Tildesmall=63230,e.Tiwnarmenian=1359,e.Tlinebelow=7790,e.Tmonospace=65332,e.Toarmenian=1337,e.Tonefive=444,e.Tonesix=388,e.Tonetwo=423,e.Tretroflexhook=430,e.Tsecyrillic=1062,e.Tshecyrillic=1035,e.Tsmall=63348,e.Twelveroman=8555,e.Tworoman=8545,e.U=85,e.Uacute=218,e.Uacutesmall=63482,e.Ubreve=364,e.Ucaron=467,e.Ucircle=9418,e.Ucircumflex=219,e.Ucircumflexbelow=7798,e.Ucircumflexsmall=63483,e.Ucyrillic=1059,e.Udblacute=368,e.Udblgrave=532,e.Udieresis=220,e.Udieresisacute=471,e.Udieresisbelow=7794,e.Udieresiscaron=473,e.Udieresiscyrillic=1264,e.Udieresisgrave=475,e.Udieresismacron=469,e.Udieresissmall=63484,e.Udotbelow=7908,e.Ugrave=217,e.Ugravesmall=63481,e.Uhookabove=7910,e.Uhorn=431,e.Uhornacute=7912,e.Uhorndotbelow=7920,e.Uhorngrave=7914,e.Uhornhookabove=7916,e.Uhorntilde=7918,e.Uhungarumlaut=368,e.Uhungarumlautcyrillic=1266,e.Uinvertedbreve=534,e.Ukcyrillic=1144,e.Umacron=362,e.Umacroncyrillic=1262,e.Umacrondieresis=7802,e.Umonospace=65333,e.Uogonek=370,e.Upsilon=933,e.Upsilon1=978,e.Upsilonacutehooksymbolgreek=979,e.Upsilonafrican=433,e.Upsilondieresis=939,e.Upsilondieresishooksymbolgreek=980,e.Upsilonhooksymbol=978,e.Upsilontonos=910,e.Uring=366,e.Ushortcyrillic=1038,e.Usmall=63349,e.Ustraightcyrillic=1198,e.Ustraightstrokecyrillic=1200,e.Utilde=360,e.Utildeacute=7800,e.Utildebelow=7796,e.V=86,e.Vcircle=9419,e.Vdotbelow=7806,e.Vecyrillic=1042,e.Vewarmenian=1358,e.Vhook=434,e.Vmonospace=65334,e.Voarmenian=1352,e.Vsmall=63350,e.Vtilde=7804,e.W=87,e.Wacute=7810,e.Wcircle=9420,e.Wcircumflex=372,e.Wdieresis=7812,e.Wdotaccent=7814,e.Wdotbelow=7816,e.Wgrave=7808,e.Wmonospace=65335,e.Wsmall=63351,e.X=88,e.Xcircle=9421,e.Xdieresis=7820,e.Xdotaccent=7818,e.Xeharmenian=1341,e.Xi=926,e.Xmonospace=65336,e.Xsmall=63352,e.Y=89,e.Yacute=221,e.Yacutesmall=63485,e.Yatcyrillic=1122,e.Ycircle=9422,e.Ycircumflex=374,e.Ydieresis=376,e.Ydieresissmall=63487,e.Ydotaccent=7822,e.Ydotbelow=7924,e.Yericyrillic=1067,e.Yerudieresiscyrillic=1272,e.Ygrave=7922,e.Yhook=435,e.Yhookabove=7926,e.Yiarmenian=1349,e.Yicyrillic=1031,e.Yiwnarmenian=1362,e.Ymonospace=65337,e.Ysmall=63353,e.Ytilde=7928,e.Yusbigcyrillic=1130,e.Yusbigiotifiedcyrillic=1132,e.Yuslittlecyrillic=1126,e.Yuslittleiotifiedcyrillic=1128,e.Z=90,e.Zaarmenian=1334,e.Zacute=377,e.Zcaron=381,e.Zcaronsmall=63231,e.Zcircle=9423,e.Zcircumflex=7824,e.Zdot=379,e.Zdotaccent=379,e.Zdotbelow=7826,e.Zecyrillic=1047,e.Zedescendercyrillic=1176,e.Zedieresiscyrillic=1246,e.Zeta=918,e.Zhearmenian=1338,e.Zhebrevecyrillic=1217,e.Zhecyrillic=1046,e.Zhedescendercyrillic=1174,e.Zhedieresiscyrillic=1244,e.Zlinebelow=7828,e.Zmonospace=65338,e.Zsmall=63354,e.Zstroke=437,e.a=97,e.aabengali=2438,e.aacute=225,e.aadeva=2310,e.aagujarati=2694,e.aagurmukhi=2566,e.aamatragurmukhi=2622,e.aarusquare=13059,e.aavowelsignbengali=2494,e.aavowelsigndeva=2366,e.aavowelsigngujarati=2750,e.abbreviationmarkarmenian=1375,e.abbreviationsigndeva=2416,e.abengali=2437,e.abopomofo=12570,e.abreve=259,e.abreveacute=7855,e.abrevecyrillic=1233,e.abrevedotbelow=7863,e.abrevegrave=7857,e.abrevehookabove=7859,e.abrevetilde=7861,e.acaron=462,e.acircle=9424,e.acircumflex=226,e.acircumflexacute=7845,e.acircumflexdotbelow=7853,e.acircumflexgrave=7847,e.acircumflexhookabove=7849,e.acircumflextilde=7851,e.acute=180,e.acutebelowcmb=791,e.acutecmb=769,e.acutecomb=769,e.acutedeva=2388,e.acutelowmod=719,e.acutetonecmb=833,e.acyrillic=1072,e.adblgrave=513,e.addakgurmukhi=2673,e.adeva=2309,e.adieresis=228,e.adieresiscyrillic=1235,e.adieresismacron=479,e.adotbelow=7841,e.adotmacron=481,e.ae=230,e.aeacute=509,e.aekorean=12624,e.aemacron=483,e.afii00208=8213,e.afii08941=8356,e.afii10017=1040,e.afii10018=1041,e.afii10019=1042,e.afii10020=1043,e.afii10021=1044,e.afii10022=1045,e.afii10023=1025,e.afii10024=1046,e.afii10025=1047,e.afii10026=1048,e.afii10027=1049,e.afii10028=1050,e.afii10029=1051,e.afii10030=1052,e.afii10031=1053,e.afii10032=1054,e.afii10033=1055,e.afii10034=1056,e.afii10035=1057,e.afii10036=1058,e.afii10037=1059,e.afii10038=1060,e.afii10039=1061,e.afii10040=1062,e.afii10041=1063,e.afii10042=1064,e.afii10043=1065,e.afii10044=1066,e.afii10045=1067,e.afii10046=1068,e.afii10047=1069,e.afii10048=1070,e.afii10049=1071,e.afii10050=1168,e.afii10051=1026,e.afii10052=1027,e.afii10053=1028,e.afii10054=1029,e.afii10055=1030,e.afii10056=1031,e.afii10057=1032,e.afii10058=1033,e.afii10059=1034,e.afii10060=1035,e.afii10061=1036,e.afii10062=1038,e.afii10063=63172,e.afii10064=63173,e.afii10065=1072,e.afii10066=1073,e.afii10067=1074,e.afii10068=1075,e.afii10069=1076,e.afii10070=1077,e.afii10071=1105,e.afii10072=1078,e.afii10073=1079,e.afii10074=1080,e.afii10075=1081,e.afii10076=1082,e.afii10077=1083,e.afii10078=1084,e.afii10079=1085,e.afii10080=1086,e.afii10081=1087,e.afii10082=1088,e.afii10083=1089,e.afii10084=1090,e.afii10085=1091,e.afii10086=1092,e.afii10087=1093,e.afii10088=1094,e.afii10089=1095,e.afii10090=1096,e.afii10091=1097,e.afii10092=1098,e.afii10093=1099,e.afii10094=1100,e.afii10095=1101,e.afii10096=1102,e.afii10097=1103,e.afii10098=1169,e.afii10099=1106,e.afii10100=1107,e.afii10101=1108,e.afii10102=1109,e.afii10103=1110,e.afii10104=1111,e.afii10105=1112,e.afii10106=1113,e.afii10107=1114,e.afii10108=1115,e.afii10109=1116,e.afii10110=1118,e.afii10145=1039,e.afii10146=1122,e.afii10147=1138,e.afii10148=1140,e.afii10192=63174,e.afii10193=1119,e.afii10194=1123,e.afii10195=1139,e.afii10196=1141,e.afii10831=63175,e.afii10832=63176,e.afii10846=1241,e.afii299=8206,e.afii300=8207,e.afii301=8205,e.afii57381=1642,e.afii57388=1548,e.afii57392=1632,e.afii57393=1633,e.afii57394=1634,e.afii57395=1635,e.afii57396=1636,e.afii57397=1637,e.afii57398=1638,e.afii57399=1639,e.afii57400=1640,e.afii57401=1641,e.afii57403=1563,e.afii57407=1567,e.afii57409=1569,e.afii57410=1570,e.afii57411=1571,e.afii57412=1572,e.afii57413=1573,e.afii57414=1574,e.afii57415=1575,e.afii57416=1576,e.afii57417=1577,e.afii57418=1578,e.afii57419=1579,e.afii57420=1580,e.afii57421=1581,e.afii57422=1582,e.afii57423=1583,e.afii57424=1584,e.afii57425=1585,e.afii57426=1586,e.afii57427=1587,e.afii57428=1588,e.afii57429=1589,e.afii57430=1590,e.afii57431=1591,e.afii57432=1592,e.afii57433=1593,e.afii57434=1594,e.afii57440=1600,e.afii57441=1601,e.afii57442=1602,e.afii57443=1603,e.afii57444=1604,e.afii57445=1605,e.afii57446=1606,e.afii57448=1608,e.afii57449=1609,e.afii57450=1610,e.afii57451=1611,e.afii57452=1612,e.afii57453=1613,e.afii57454=1614,e.afii57455=1615,e.afii57456=1616,e.afii57457=1617,e.afii57458=1618,e.afii57470=1607,e.afii57505=1700,e.afii57506=1662,e.afii57507=1670,e.afii57508=1688,e.afii57509=1711,e.afii57511=1657,e.afii57512=1672,e.afii57513=1681,e.afii57514=1722,e.afii57519=1746,e.afii57534=1749,e.afii57636=8362,e.afii57645=1470,e.afii57658=1475,e.afii57664=1488,e.afii57665=1489,e.afii57666=1490,e.afii57667=1491,e.afii57668=1492,e.afii57669=1493,e.afii57670=1494,e.afii57671=1495,e.afii57672=1496,e.afii57673=1497,e.afii57674=1498,e.afii57675=1499,e.afii57676=1500,e.afii57677=1501,e.afii57678=1502,e.afii57679=1503,e.afii57680=1504,e.afii57681=1505,e.afii57682=1506,e.afii57683=1507,e.afii57684=1508,e.afii57685=1509,e.afii57686=1510,e.afii57687=1511,e.afii57688=1512,e.afii57689=1513,e.afii57690=1514,e.afii57694=64298,e.afii57695=64299,e.afii57700=64331,e.afii57705=64287,e.afii57716=1520,e.afii57717=1521,e.afii57718=1522,e.afii57723=64309,e.afii57793=1460,e.afii57794=1461,e.afii57795=1462,e.afii57796=1467,e.afii57797=1464,e.afii57798=1463,e.afii57799=1456,e.afii57800=1458,e.afii57801=1457,e.afii57802=1459,e.afii57803=1474,e.afii57804=1473,e.afii57806=1465,e.afii57807=1468,e.afii57839=1469,e.afii57841=1471,e.afii57842=1472,e.afii57929=700,e.afii61248=8453,e.afii61289=8467,e.afii61352=8470,e.afii61573=8236,e.afii61574=8237,e.afii61575=8238,e.afii61664=8204,e.afii63167=1645,e.afii64937=701,e.agrave=224,e.agujarati=2693,e.agurmukhi=2565,e.ahiragana=12354,e.ahookabove=7843,e.aibengali=2448,e.aibopomofo=12574,e.aideva=2320,e.aiecyrillic=1237,e.aigujarati=2704,e.aigurmukhi=2576,e.aimatragurmukhi=2632,e.ainarabic=1593,e.ainfinalarabic=65226,e.aininitialarabic=65227,e.ainmedialarabic=65228,e.ainvertedbreve=515,e.aivowelsignbengali=2504,e.aivowelsigndeva=2376,e.aivowelsigngujarati=2760,e.akatakana=12450,e.akatakanahalfwidth=65393,e.akorean=12623,e.alef=1488,e.alefarabic=1575,e.alefdageshhebrew=64304,e.aleffinalarabic=65166,e.alefhamzaabovearabic=1571,e.alefhamzaabovefinalarabic=65156,e.alefhamzabelowarabic=1573,e.alefhamzabelowfinalarabic=65160,e.alefhebrew=1488,e.aleflamedhebrew=64335,e.alefmaddaabovearabic=1570,e.alefmaddaabovefinalarabic=65154,e.alefmaksuraarabic=1609,e.alefmaksurafinalarabic=65264,e.alefmaksurainitialarabic=65267,e.alefmaksuramedialarabic=65268,e.alefpatahhebrew=64302,e.alefqamatshebrew=64303,e.aleph=8501,e.allequal=8780,e.alpha=945,e.alphatonos=940,e.amacron=257,e.amonospace=65345,e.ampersand=38,e.ampersandmonospace=65286,e.ampersandsmall=63270,e.amsquare=13250,e.anbopomofo=12578,e.angbopomofo=12580,e.angbracketleft=12296,e.angbracketright=12297,e.angkhankhuthai=3674,e.angle=8736,e.anglebracketleft=12296,e.anglebracketleftvertical=65087,e.anglebracketright=12297,e.anglebracketrightvertical=65088,e.angleleft=9001,e.angleright=9002,e.angstrom=8491,e.anoteleia=903,e.anudattadeva=2386,e.anusvarabengali=2434,e.anusvaradeva=2306,e.anusvaragujarati=2690,e.aogonek=261,e.apaatosquare=13056,e.aparen=9372,e.apostrophearmenian=1370,e.apostrophemod=700,e.apple=63743,e.approaches=8784,e.approxequal=8776,e.approxequalorimage=8786,e.approximatelyequal=8773,e.araeaekorean=12686,e.araeakorean=12685,e.arc=8978,e.arighthalfring=7834,e.aring=229,e.aringacute=507,e.aringbelow=7681,e.arrowboth=8596,e.arrowdashdown=8675,e.arrowdashleft=8672,e.arrowdashright=8674,e.arrowdashup=8673,e.arrowdblboth=8660,e.arrowdbldown=8659,e.arrowdblleft=8656,e.arrowdblright=8658,e.arrowdblup=8657,e.arrowdown=8595,e.arrowdownleft=8601,e.arrowdownright=8600,e.arrowdownwhite=8681,e.arrowheaddownmod=709,e.arrowheadleftmod=706,e.arrowheadrightmod=707,e.arrowheadupmod=708,e.arrowhorizex=63719,e.arrowleft=8592,e.arrowleftdbl=8656,e.arrowleftdblstroke=8653,e.arrowleftoverright=8646,e.arrowleftwhite=8678,e.arrowright=8594,e.arrowrightdblstroke=8655,e.arrowrightheavy=10142,e.arrowrightoverleft=8644,e.arrowrightwhite=8680,e.arrowtableft=8676,e.arrowtabright=8677,e.arrowup=8593,e.arrowupdn=8597,e.arrowupdnbse=8616,e.arrowupdownbase=8616,e.arrowupleft=8598,e.arrowupleftofdown=8645,e.arrowupright=8599,e.arrowupwhite=8679,e.arrowvertex=63718,e.asciicircum=94,e.asciicircummonospace=65342,e.asciitilde=126,e.asciitildemonospace=65374,e.ascript=593,e.ascriptturned=594,e.asmallhiragana=12353,e.asmallkatakana=12449,e.asmallkatakanahalfwidth=65383,e.asterisk=42,e.asteriskaltonearabic=1645,e.asteriskarabic=1645,e.asteriskmath=8727,e.asteriskmonospace=65290,e.asterisksmall=65121,e.asterism=8258,e.asuperior=63209,e.asymptoticallyequal=8771,e.at=64,e.atilde=227,e.atmonospace=65312,e.atsmall=65131,e.aturned=592,e.aubengali=2452,e.aubopomofo=12576,e.audeva=2324,e.augujarati=2708,e.augurmukhi=2580,e.aulengthmarkbengali=2519,e.aumatragurmukhi=2636,e.auvowelsignbengali=2508,e.auvowelsigndeva=2380,e.auvowelsigngujarati=2764,e.avagrahadeva=2365,e.aybarmenian=1377,e.ayin=1506,e.ayinaltonehebrew=64288,e.ayinhebrew=1506,e.b=98,e.babengali=2476,e.backslash=92,e.backslashmonospace=65340,e.badeva=2348,e.bagujarati=2732,e.bagurmukhi=2604,e.bahiragana=12400,e.bahtthai=3647,e.bakatakana=12496,e.bar=124,e.barmonospace=65372,e.bbopomofo=12549,e.bcircle=9425,e.bdotaccent=7683,e.bdotbelow=7685,e.beamedsixteenthnotes=9836,e.because=8757,e.becyrillic=1073,e.beharabic=1576,e.behfinalarabic=65168,e.behinitialarabic=65169,e.behiragana=12409,e.behmedialarabic=65170,e.behmeeminitialarabic=64671,e.behmeemisolatedarabic=64520,e.behnoonfinalarabic=64621,e.bekatakana=12505,e.benarmenian=1378,e.bet=1489,e.beta=946,e.betasymbolgreek=976,e.betdagesh=64305,e.betdageshhebrew=64305,e.bethebrew=1489,e.betrafehebrew=64332,e.bhabengali=2477,e.bhadeva=2349,e.bhagujarati=2733,e.bhagurmukhi=2605,e.bhook=595,e.bihiragana=12403,e.bikatakana=12499,e.bilabialclick=664,e.bindigurmukhi=2562,e.birusquare=13105,e.blackcircle=9679,e.blackdiamond=9670,e.blackdownpointingtriangle=9660,e.blackleftpointingpointer=9668,e.blackleftpointingtriangle=9664,e.blacklenticularbracketleft=12304,e.blacklenticularbracketleftvertical=65083,e.blacklenticularbracketright=12305,e.blacklenticularbracketrightvertical=65084,e.blacklowerlefttriangle=9699,e.blacklowerrighttriangle=9698,e.blackrectangle=9644,e.blackrightpointingpointer=9658,e.blackrightpointingtriangle=9654,e.blacksmallsquare=9642,e.blacksmilingface=9787,e.blacksquare=9632,e.blackstar=9733,e.blackupperlefttriangle=9700,e.blackupperrighttriangle=9701,e.blackuppointingsmalltriangle=9652,e.blackuppointingtriangle=9650,e.blank=9251,e.blinebelow=7687,e.block=9608,e.bmonospace=65346,e.bobaimaithai=3610,e.bohiragana=12412,e.bokatakana=12508,e.bparen=9373,e.bqsquare=13251,e.braceex=63732,e.braceleft=123,e.braceleftbt=63731,e.braceleftmid=63730,e.braceleftmonospace=65371,e.braceleftsmall=65115,e.bracelefttp=63729,e.braceleftvertical=65079,e.braceright=125,e.bracerightbt=63742,e.bracerightmid=63741,e.bracerightmonospace=65373,e.bracerightsmall=65116,e.bracerighttp=63740,e.bracerightvertical=65080,e.bracketleft=91,e.bracketleftbt=63728,e.bracketleftex=63727,e.bracketleftmonospace=65339,e.bracketlefttp=63726,e.bracketright=93,e.bracketrightbt=63739,e.bracketrightex=63738,e.bracketrightmonospace=65341,e.bracketrighttp=63737,e.breve=728,e.brevebelowcmb=814,e.brevecmb=774,e.breveinvertedbelowcmb=815,e.breveinvertedcmb=785,e.breveinverteddoublecmb=865,e.bridgebelowcmb=810,e.bridgeinvertedbelowcmb=826,e.brokenbar=166,e.bstroke=384,e.bsuperior=63210,e.btopbar=387,e.buhiragana=12406,e.bukatakana=12502,e.bullet=8226,e.bulletinverse=9688,e.bulletoperator=8729,e.bullseye=9678,e.c=99,e.caarmenian=1390,e.cabengali=2458,e.cacute=263,e.cadeva=2330,e.cagujarati=2714,e.cagurmukhi=2586,e.calsquare=13192,e.candrabindubengali=2433,e.candrabinducmb=784,e.candrabindudeva=2305,e.candrabindugujarati=2689,e.capslock=8682,e.careof=8453,e.caron=711,e.caronbelowcmb=812,e.caroncmb=780,e.carriagereturn=8629,e.cbopomofo=12568,e.ccaron=269,e.ccedilla=231,e.ccedillaacute=7689,e.ccircle=9426,e.ccircumflex=265,e.ccurl=597,e.cdot=267,e.cdotaccent=267,e.cdsquare=13253,e.cedilla=184,e.cedillacmb=807,e.cent=162,e.centigrade=8451,e.centinferior=63199,e.centmonospace=65504,e.centoldstyle=63394,e.centsuperior=63200,e.chaarmenian=1401,e.chabengali=2459,e.chadeva=2331,e.chagujarati=2715,e.chagurmukhi=2587,e.chbopomofo=12564,e.cheabkhasiancyrillic=1213,e.checkmark=10003,e.checyrillic=1095,e.chedescenderabkhasiancyrillic=1215,e.chedescendercyrillic=1207,e.chedieresiscyrillic=1269,e.cheharmenian=1395,e.chekhakassiancyrillic=1228,e.cheverticalstrokecyrillic=1209,e.chi=967,e.chieuchacirclekorean=12919,e.chieuchaparenkorean=12823,e.chieuchcirclekorean=12905,e.chieuchkorean=12618,e.chieuchparenkorean=12809,e.chochangthai=3594,e.chochanthai=3592,e.chochingthai=3593,e.chochoethai=3596,e.chook=392,e.cieucacirclekorean=12918,e.cieucaparenkorean=12822,e.cieuccirclekorean=12904,e.cieuckorean=12616,e.cieucparenkorean=12808,e.cieucuparenkorean=12828,e.circle=9675,e.circlecopyrt=169,e.circlemultiply=8855,e.circleot=8857,e.circleplus=8853,e.circlepostalmark=12342,e.circlewithlefthalfblack=9680,e.circlewithrighthalfblack=9681,e.circumflex=710,e.circumflexbelowcmb=813,e.circumflexcmb=770,e.clear=8999,e.clickalveolar=450,e.clickdental=448,e.clicklateral=449,e.clickretroflex=451,e.club=9827,e.clubsuitblack=9827,e.clubsuitwhite=9831,e.cmcubedsquare=13220,e.cmonospace=65347,e.cmsquaredsquare=13216,e.coarmenian=1409,e.colon=58,e.colonmonetary=8353,e.colonmonospace=65306,e.colonsign=8353,e.colonsmall=65109,e.colontriangularhalfmod=721,e.colontriangularmod=720,e.comma=44,e.commaabovecmb=787,e.commaaboverightcmb=789,e.commaaccent=63171,e.commaarabic=1548,e.commaarmenian=1373,e.commainferior=63201,e.commamonospace=65292,e.commareversedabovecmb=788,e.commareversedmod=701,e.commasmall=65104,e.commasuperior=63202,e.commaturnedabovecmb=786,e.commaturnedmod=699,e.compass=9788,e.congruent=8773,e.contourintegral=8750,e.control=8963,e.controlACK=6,e.controlBEL=7,e.controlBS=8,e.controlCAN=24,e.controlCR=13,e.controlDC1=17,e.controlDC2=18,e.controlDC3=19,e.controlDC4=20,e.controlDEL=127,e.controlDLE=16,e.controlEM=25,e.controlENQ=5,e.controlEOT=4,e.controlESC=27,e.controlETB=23,e.controlETX=3,e.controlFF=12,e.controlFS=28,e.controlGS=29,e.controlHT=9,e.controlLF=10,e.controlNAK=21,e.controlNULL=0,e.controlRS=30,e.controlSI=15,e.controlSO=14,e.controlSOT=2,e.controlSTX=1,e.controlSUB=26,e.controlSYN=22,e.controlUS=31,e.controlVT=11,e.copyright=169,e.copyrightsans=63721,e.copyrightserif=63193,e.cornerbracketleft=12300,e.cornerbracketlefthalfwidth=65378,e.cornerbracketleftvertical=65089,e.cornerbracketright=12301,e.cornerbracketrighthalfwidth=65379,e.cornerbracketrightvertical=65090,e.corporationsquare=13183,e.cosquare=13255,e.coverkgsquare=13254,e.cparen=9374,e.cruzeiro=8354,e.cstretched=663,e.curlyand=8911,e.curlyor=8910,e.currency=164,e.cyrBreve=63185,e.cyrFlex=63186,e.cyrbreve=63188,e.cyrflex=63189,e.d=100,e.daarmenian=1380,e.dabengali=2470,e.dadarabic=1590,e.dadeva=2342,e.dadfinalarabic=65214,e.dadinitialarabic=65215,e.dadmedialarabic=65216,e.dagesh=1468,e.dageshhebrew=1468,e.dagger=8224,e.daggerdbl=8225,e.dagujarati=2726,e.dagurmukhi=2598,e.dahiragana=12384,e.dakatakana=12480,e.dalarabic=1583,e.dalet=1491,e.daletdagesh=64307,e.daletdageshhebrew=64307,e.dalethebrew=1491,e.dalfinalarabic=65194,e.dammaarabic=1615,e.dammalowarabic=1615,e.dammatanaltonearabic=1612,e.dammatanarabic=1612,e.danda=2404,e.dargahebrew=1447,e.dargalefthebrew=1447,e.dasiapneumatacyrilliccmb=1157,e.dblGrave=63187,e.dblanglebracketleft=12298,e.dblanglebracketleftvertical=65085,e.dblanglebracketright=12299,e.dblanglebracketrightvertical=65086,e.dblarchinvertedbelowcmb=811,e.dblarrowleft=8660,e.dblarrowright=8658,e.dbldanda=2405,e.dblgrave=63190,e.dblgravecmb=783,e.dblintegral=8748,e.dbllowline=8215,e.dbllowlinecmb=819,e.dbloverlinecmb=831,e.dblprimemod=698,e.dblverticalbar=8214,e.dblverticallineabovecmb=782,e.dbopomofo=12553,e.dbsquare=13256,e.dcaron=271,e.dcedilla=7697,e.dcircle=9427,e.dcircumflexbelow=7699,e.dcroat=273,e.ddabengali=2465,e.ddadeva=2337,e.ddagujarati=2721,e.ddagurmukhi=2593,e.ddalarabic=1672,e.ddalfinalarabic=64393,e.dddhadeva=2396,e.ddhabengali=2466,e.ddhadeva=2338,e.ddhagujarati=2722,e.ddhagurmukhi=2594,e.ddotaccent=7691,e.ddotbelow=7693,e.decimalseparatorarabic=1643,e.decimalseparatorpersian=1643,e.decyrillic=1076,e.degree=176,e.dehihebrew=1453,e.dehiragana=12391,e.deicoptic=1007,e.dekatakana=12487,e.deleteleft=9003,e.deleteright=8998,e.delta=948,e.deltaturned=397,e.denominatorminusonenumeratorbengali=2552,e.dezh=676,e.dhabengali=2471,e.dhadeva=2343,e.dhagujarati=2727,e.dhagurmukhi=2599,e.dhook=599,e.dialytikatonos=901,e.dialytikatonoscmb=836,e.diamond=9830,e.diamondsuitwhite=9826,e.dieresis=168,e.dieresisacute=63191,e.dieresisbelowcmb=804,e.dieresiscmb=776,e.dieresisgrave=63192,e.dieresistonos=901,e.dihiragana=12386,e.dikatakana=12482,e.dittomark=12291,e.divide=247,e.divides=8739,e.divisionslash=8725,e.djecyrillic=1106,e.dkshade=9619,e.dlinebelow=7695,e.dlsquare=13207,e.dmacron=273,e.dmonospace=65348,e.dnblock=9604,e.dochadathai=3598,e.dodekthai=3604,e.dohiragana=12393,e.dokatakana=12489,e.dollar=36,e.dollarinferior=63203,e.dollarmonospace=65284,e.dollaroldstyle=63268,e.dollarsmall=65129,e.dollarsuperior=63204,e.dong=8363,e.dorusquare=13094,e.dotaccent=729,e.dotaccentcmb=775,e.dotbelowcmb=803,e.dotbelowcomb=803,e.dotkatakana=12539,e.dotlessi=305,e.dotlessj=63166,e.dotlessjstrokehook=644,e.dotmath=8901,e.dottedcircle=9676,e.doubleyodpatah=64287,e.doubleyodpatahhebrew=64287,e.downtackbelowcmb=798,e.downtackmod=725,e.dparen=9375,e.dsuperior=63211,e.dtail=598,e.dtopbar=396,e.duhiragana=12389,e.dukatakana=12485,e.dz=499,e.dzaltone=675,e.dzcaron=454,e.dzcurl=677,e.dzeabkhasiancyrillic=1249,e.dzecyrillic=1109,e.dzhecyrillic=1119,e.e=101,e.eacute=233,e.earth=9793,e.ebengali=2447,e.ebopomofo=12572,e.ebreve=277,e.ecandradeva=2317,e.ecandragujarati=2701,e.ecandravowelsigndeva=2373,e.ecandravowelsigngujarati=2757,e.ecaron=283,e.ecedillabreve=7709,e.echarmenian=1381,e.echyiwnarmenian=1415,e.ecircle=9428,e.ecircumflex=234,e.ecircumflexacute=7871,e.ecircumflexbelow=7705,e.ecircumflexdotbelow=7879,e.ecircumflexgrave=7873,e.ecircumflexhookabove=7875,e.ecircumflextilde=7877,e.ecyrillic=1108,e.edblgrave=517,e.edeva=2319,e.edieresis=235,e.edot=279,e.edotaccent=279,e.edotbelow=7865,e.eegurmukhi=2575,e.eematragurmukhi=2631,e.efcyrillic=1092,e.egrave=232,e.egujarati=2703,e.eharmenian=1383,e.ehbopomofo=12573,e.ehiragana=12360,e.ehookabove=7867,e.eibopomofo=12575,e.eight=56,e.eightarabic=1640,e.eightbengali=2542,e.eightcircle=9319,e.eightcircleinversesansserif=10129,e.eightdeva=2414,e.eighteencircle=9329,e.eighteenparen=9349,e.eighteenperiod=9369,e.eightgujarati=2798,e.eightgurmukhi=2670,e.eighthackarabic=1640,e.eighthangzhou=12328,e.eighthnotebeamed=9835,e.eightideographicparen=12839,e.eightinferior=8328,e.eightmonospace=65304,e.eightoldstyle=63288,e.eightparen=9339,e.eightperiod=9359,e.eightpersian=1784,e.eightroman=8567,e.eightsuperior=8312,e.eightthai=3672,e.einvertedbreve=519,e.eiotifiedcyrillic=1125,e.ekatakana=12456,e.ekatakanahalfwidth=65396,e.ekonkargurmukhi=2676,e.ekorean=12628,e.elcyrillic=1083,e.element=8712,e.elevencircle=9322,e.elevenparen=9342,e.elevenperiod=9362,e.elevenroman=8570,e.ellipsis=8230,e.ellipsisvertical=8942,e.emacron=275,e.emacronacute=7703,e.emacrongrave=7701,e.emcyrillic=1084,e.emdash=8212,e.emdashvertical=65073,e.emonospace=65349,e.emphasismarkarmenian=1371,e.emptyset=8709,e.enbopomofo=12579,e.encyrillic=1085,e.endash=8211,e.endashvertical=65074,e.endescendercyrillic=1187,e.eng=331,e.engbopomofo=12581,e.enghecyrillic=1189,e.enhookcyrillic=1224,e.enspace=8194,e.eogonek=281,e.eokorean=12627,e.eopen=603,e.eopenclosed=666,e.eopenreversed=604,e.eopenreversedclosed=606,e.eopenreversedhook=605,e.eparen=9376,e.epsilon=949,e.epsilontonos=941,e.equal=61,e.equalmonospace=65309,e.equalsmall=65126,e.equalsuperior=8316,e.equivalence=8801,e.erbopomofo=12582,e.ercyrillic=1088,e.ereversed=600,e.ereversedcyrillic=1101,e.escyrillic=1089,e.esdescendercyrillic=1195,e.esh=643,e.eshcurl=646,e.eshortdeva=2318,e.eshortvowelsigndeva=2374,e.eshreversedloop=426,e.eshsquatreversed=645,e.esmallhiragana=12359,e.esmallkatakana=12455,e.esmallkatakanahalfwidth=65386,e.estimated=8494,e.esuperior=63212,e.eta=951,e.etarmenian=1384,e.etatonos=942,e.eth=240,e.etilde=7869,e.etildebelow=7707,e.etnahtafoukhhebrew=1425,e.etnahtafoukhlefthebrew=1425,e.etnahtahebrew=1425,e.etnahtalefthebrew=1425,e.eturned=477,e.eukorean=12641,e.euro=8364,e.evowelsignbengali=2503,e.evowelsigndeva=2375,e.evowelsigngujarati=2759,e.exclam=33,e.exclamarmenian=1372,e.exclamdbl=8252,e.exclamdown=161,e.exclamdownsmall=63393,e.exclammonospace=65281,e.exclamsmall=63265,e.existential=8707,e.ezh=658,e.ezhcaron=495,e.ezhcurl=659,e.ezhreversed=441,e.ezhtail=442,e.f=102,e.fadeva=2398,e.fagurmukhi=2654,e.fahrenheit=8457,e.fathaarabic=1614,e.fathalowarabic=1614,e.fathatanarabic=1611,e.fbopomofo=12552,e.fcircle=9429,e.fdotaccent=7711,e.feharabic=1601,e.feharmenian=1414,e.fehfinalarabic=65234,e.fehinitialarabic=65235,e.fehmedialarabic=65236,e.feicoptic=997,e.female=9792,e.ff=64256,e.f_f=64256,e.ffi=64259,e.f_f_i=64259,e.ffl=64260,e.f_f_l=64260,e.fi=64257,e.f_i=64257,e.fifteencircle=9326,e.fifteenparen=9346,e.fifteenperiod=9366,e.figuredash=8210,e.filledbox=9632,e.filledrect=9644,e.finalkaf=1498,e.finalkafdagesh=64314,e.finalkafdageshhebrew=64314,e.finalkafhebrew=1498,e.finalmem=1501,e.finalmemhebrew=1501,e.finalnun=1503,e.finalnunhebrew=1503,e.finalpe=1507,e.finalpehebrew=1507,e.finaltsadi=1509,e.finaltsadihebrew=1509,e.firsttonechinese=713,e.fisheye=9673,e.fitacyrillic=1139,e.five=53,e.fivearabic=1637,e.fivebengali=2539,e.fivecircle=9316,e.fivecircleinversesansserif=10126,e.fivedeva=2411,e.fiveeighths=8541,e.fivegujarati=2795,e.fivegurmukhi=2667,e.fivehackarabic=1637,e.fivehangzhou=12325,e.fiveideographicparen=12836,e.fiveinferior=8325,e.fivemonospace=65301,e.fiveoldstyle=63285,e.fiveparen=9336,e.fiveperiod=9356,e.fivepersian=1781,e.fiveroman=8564,e.fivesuperior=8309,e.fivethai=3669,e.fl=64258,e.f_l=64258,e.florin=402,e.fmonospace=65350,e.fmsquare=13209,e.fofanthai=3615,e.fofathai=3613,e.fongmanthai=3663,e.forall=8704,e.four=52,e.fourarabic=1636,e.fourbengali=2538,e.fourcircle=9315,e.fourcircleinversesansserif=10125,e.fourdeva=2410,e.fourgujarati=2794,e.fourgurmukhi=2666,e.fourhackarabic=1636,e.fourhangzhou=12324,e.fourideographicparen=12835,e.fourinferior=8324,e.fourmonospace=65300,e.fournumeratorbengali=2551,e.fouroldstyle=63284,e.fourparen=9335,e.fourperiod=9355,e.fourpersian=1780,e.fourroman=8563,e.foursuperior=8308,e.fourteencircle=9325,e.fourteenparen=9345,e.fourteenperiod=9365,e.fourthai=3668,e.fourthtonechinese=715,e.fparen=9377,e.fraction=8260,e.franc=8355,e.g=103,e.gabengali=2455,e.gacute=501,e.gadeva=2327,e.gafarabic=1711,e.gaffinalarabic=64403,e.gafinitialarabic=64404,e.gafmedialarabic=64405,e.gagujarati=2711,e.gagurmukhi=2583,e.gahiragana=12364,e.gakatakana=12460,e.gamma=947,e.gammalatinsmall=611,e.gammasuperior=736,e.gangiacoptic=1003,e.gbopomofo=12557,e.gbreve=287,e.gcaron=487,e.gcedilla=291,e.gcircle=9430,e.gcircumflex=285,e.gcommaaccent=291,e.gdot=289,e.gdotaccent=289,e.gecyrillic=1075,e.gehiragana=12370,e.gekatakana=12466,e.geometricallyequal=8785,e.gereshaccenthebrew=1436,e.gereshhebrew=1523,e.gereshmuqdamhebrew=1437,e.germandbls=223,e.gershayimaccenthebrew=1438,e.gershayimhebrew=1524,e.getamark=12307,e.ghabengali=2456,e.ghadarmenian=1394,e.ghadeva=2328,e.ghagujarati=2712,e.ghagurmukhi=2584,e.ghainarabic=1594,e.ghainfinalarabic=65230,e.ghaininitialarabic=65231,e.ghainmedialarabic=65232,e.ghemiddlehookcyrillic=1173,e.ghestrokecyrillic=1171,e.gheupturncyrillic=1169,e.ghhadeva=2394,e.ghhagurmukhi=2650,e.ghook=608,e.ghzsquare=13203,e.gihiragana=12366,e.gikatakana=12462,e.gimarmenian=1379,e.gimel=1490,e.gimeldagesh=64306,e.gimeldageshhebrew=64306,e.gimelhebrew=1490,e.gjecyrillic=1107,e.glottalinvertedstroke=446,e.glottalstop=660,e.glottalstopinverted=662,e.glottalstopmod=704,e.glottalstopreversed=661,e.glottalstopreversedmod=705,e.glottalstopreversedsuperior=740,e.glottalstopstroke=673,e.glottalstopstrokereversed=674,e.gmacron=7713,e.gmonospace=65351,e.gohiragana=12372,e.gokatakana=12468,e.gparen=9378,e.gpasquare=13228,e.gradient=8711,e.grave=96,e.gravebelowcmb=790,e.gravecmb=768,e.gravecomb=768,e.gravedeva=2387,e.gravelowmod=718,e.gravemonospace=65344,e.gravetonecmb=832,e.greater=62,e.greaterequal=8805,e.greaterequalorless=8923,e.greatermonospace=65310,e.greaterorequivalent=8819,e.greaterorless=8823,e.greateroverequal=8807,e.greatersmall=65125,e.gscript=609,e.gstroke=485,e.guhiragana=12368,e.guillemotleft=171,e.guillemotright=187,e.guilsinglleft=8249,e.guilsinglright=8250,e.gukatakana=12464,e.guramusquare=13080,e.gysquare=13257,e.h=104,e.haabkhasiancyrillic=1193,e.haaltonearabic=1729,e.habengali=2489,e.hadescendercyrillic=1203,e.hadeva=2361,e.hagujarati=2745,e.hagurmukhi=2617,e.haharabic=1581,e.hahfinalarabic=65186,e.hahinitialarabic=65187,e.hahiragana=12399,e.hahmedialarabic=65188,e.haitusquare=13098,e.hakatakana=12495,e.hakatakanahalfwidth=65418,e.halantgurmukhi=2637,e.hamzaarabic=1569,e.hamzalowarabic=1569,e.hangulfiller=12644,e.hardsigncyrillic=1098,e.harpoonleftbarbup=8636,e.harpoonrightbarbup=8640,e.hasquare=13258,e.hatafpatah=1458,e.hatafpatah16=1458,e.hatafpatah23=1458,e.hatafpatah2f=1458,e.hatafpatahhebrew=1458,e.hatafpatahnarrowhebrew=1458,e.hatafpatahquarterhebrew=1458,e.hatafpatahwidehebrew=1458,e.hatafqamats=1459,e.hatafqamats1b=1459,e.hatafqamats28=1459,e.hatafqamats34=1459,e.hatafqamatshebrew=1459,e.hatafqamatsnarrowhebrew=1459,e.hatafqamatsquarterhebrew=1459,e.hatafqamatswidehebrew=1459,e.hatafsegol=1457,e.hatafsegol17=1457,e.hatafsegol24=1457,e.hatafsegol30=1457,e.hatafsegolhebrew=1457,e.hatafsegolnarrowhebrew=1457,e.hatafsegolquarterhebrew=1457,e.hatafsegolwidehebrew=1457,e.hbar=295,e.hbopomofo=12559,e.hbrevebelow=7723,e.hcedilla=7721,e.hcircle=9431,e.hcircumflex=293,e.hdieresis=7719,e.hdotaccent=7715,e.hdotbelow=7717,e.he=1492,e.heart=9829,e.heartsuitblack=9829,e.heartsuitwhite=9825,e.hedagesh=64308,e.hedageshhebrew=64308,e.hehaltonearabic=1729,e.heharabic=1607,e.hehebrew=1492,e.hehfinalaltonearabic=64423,e.hehfinalalttwoarabic=65258,e.hehfinalarabic=65258,e.hehhamzaabovefinalarabic=64421,e.hehhamzaaboveisolatedarabic=64420,e.hehinitialaltonearabic=64424,e.hehinitialarabic=65259,e.hehiragana=12408,e.hehmedialaltonearabic=64425,e.hehmedialarabic=65260,e.heiseierasquare=13179,e.hekatakana=12504,e.hekatakanahalfwidth=65421,e.hekutaarusquare=13110,e.henghook=615,e.herutusquare=13113,e.het=1495,e.hethebrew=1495,e.hhook=614,e.hhooksuperior=689,e.hieuhacirclekorean=12923,e.hieuhaparenkorean=12827,e.hieuhcirclekorean=12909,e.hieuhkorean=12622,e.hieuhparenkorean=12813,e.hihiragana=12402,e.hikatakana=12498,e.hikatakanahalfwidth=65419,e.hiriq=1460,e.hiriq14=1460,e.hiriq21=1460,e.hiriq2d=1460,e.hiriqhebrew=1460,e.hiriqnarrowhebrew=1460,e.hiriqquarterhebrew=1460,e.hiriqwidehebrew=1460,e.hlinebelow=7830,e.hmonospace=65352,e.hoarmenian=1392,e.hohipthai=3627,e.hohiragana=12411,e.hokatakana=12507,e.hokatakanahalfwidth=65422,e.holam=1465,e.holam19=1465,e.holam26=1465,e.holam32=1465,e.holamhebrew=1465,e.holamnarrowhebrew=1465,e.holamquarterhebrew=1465,e.holamwidehebrew=1465,e.honokhukthai=3630,e.hookabovecomb=777,e.hookcmb=777,e.hookpalatalizedbelowcmb=801,e.hookretroflexbelowcmb=802,e.hoonsquare=13122,e.horicoptic=1001,e.horizontalbar=8213,e.horncmb=795,e.hotsprings=9832,e.house=8962,e.hparen=9379,e.hsuperior=688,e.hturned=613,e.huhiragana=12405,e.huiitosquare=13107,e.hukatakana=12501,e.hukatakanahalfwidth=65420,e.hungarumlaut=733,e.hungarumlautcmb=779,e.hv=405,e.hyphen=45,e.hypheninferior=63205,e.hyphenmonospace=65293,e.hyphensmall=65123,e.hyphensuperior=63206,e.hyphentwo=8208,e.i=105,e.iacute=237,e.iacyrillic=1103,e.ibengali=2439,e.ibopomofo=12583,e.ibreve=301,e.icaron=464,e.icircle=9432,e.icircumflex=238,e.icyrillic=1110,e.idblgrave=521,e.ideographearthcircle=12943,e.ideographfirecircle=12939,e.ideographicallianceparen=12863,e.ideographiccallparen=12858,e.ideographiccentrecircle=12965,e.ideographicclose=12294,e.ideographiccomma=12289,e.ideographiccommaleft=65380,e.ideographiccongratulationparen=12855,e.ideographiccorrectcircle=12963,e.ideographicearthparen=12847,e.ideographicenterpriseparen=12861,e.ideographicexcellentcircle=12957,e.ideographicfestivalparen=12864,e.ideographicfinancialcircle=12950,e.ideographicfinancialparen=12854,e.ideographicfireparen=12843,e.ideographichaveparen=12850,e.ideographichighcircle=12964,e.ideographiciterationmark=12293,e.ideographiclaborcircle=12952,e.ideographiclaborparen=12856,e.ideographicleftcircle=12967,e.ideographiclowcircle=12966,e.ideographicmedicinecircle=12969,e.ideographicmetalparen=12846,e.ideographicmoonparen=12842,e.ideographicnameparen=12852,e.ideographicperiod=12290,e.ideographicprintcircle=12958,e.ideographicreachparen=12867,e.ideographicrepresentparen=12857,e.ideographicresourceparen=12862,e.ideographicrightcircle=12968,e.ideographicsecretcircle=12953,e.ideographicselfparen=12866,e.ideographicsocietyparen=12851,e.ideographicspace=12288,e.ideographicspecialparen=12853,e.ideographicstockparen=12849,e.ideographicstudyparen=12859,e.ideographicsunparen=12848,e.ideographicsuperviseparen=12860,e.ideographicwaterparen=12844,e.ideographicwoodparen=12845,e.ideographiczero=12295,e.ideographmetalcircle=12942,e.ideographmooncircle=12938,e.ideographnamecircle=12948,e.ideographsuncircle=12944,e.ideographwatercircle=12940,e.ideographwoodcircle=12941,e.ideva=2311,e.idieresis=239,e.idieresisacute=7727,e.idieresiscyrillic=1253,e.idotbelow=7883,e.iebrevecyrillic=1239,e.iecyrillic=1077,e.ieungacirclekorean=12917,e.ieungaparenkorean=12821,e.ieungcirclekorean=12903,e.ieungkorean=12615,e.ieungparenkorean=12807,e.igrave=236,e.igujarati=2695,e.igurmukhi=2567,e.ihiragana=12356,e.ihookabove=7881,e.iibengali=2440,e.iicyrillic=1080,e.iideva=2312,e.iigujarati=2696,e.iigurmukhi=2568,e.iimatragurmukhi=2624,e.iinvertedbreve=523,e.iishortcyrillic=1081,e.iivowelsignbengali=2496,e.iivowelsigndeva=2368,e.iivowelsigngujarati=2752,e.ij=307,e.ikatakana=12452,e.ikatakanahalfwidth=65394,e.ikorean=12643,e.ilde=732,e.iluyhebrew=1452,e.imacron=299,e.imacroncyrillic=1251,e.imageorapproximatelyequal=8787,e.imatragurmukhi=2623,e.imonospace=65353,e.increment=8710,e.infinity=8734,e.iniarmenian=1387,e.integral=8747,e.integralbottom=8993,e.integralbt=8993,e.integralex=63733,e.integraltop=8992,e.integraltp=8992,e.intersection=8745,e.intisquare=13061,e.invbullet=9688,e.invcircle=9689,e.invsmileface=9787,e.iocyrillic=1105,e.iogonek=303,e.iota=953,e.iotadieresis=970,e.iotadieresistonos=912,e.iotalatin=617,e.iotatonos=943,e.iparen=9380,e.irigurmukhi=2674,e.ismallhiragana=12355,e.ismallkatakana=12451,e.ismallkatakanahalfwidth=65384,e.issharbengali=2554,e.istroke=616,e.isuperior=63213,e.iterationhiragana=12445,e.iterationkatakana=12541,e.itilde=297,e.itildebelow=7725,e.iubopomofo=12585,e.iucyrillic=1102,e.ivowelsignbengali=2495,e.ivowelsigndeva=2367,e.ivowelsigngujarati=2751,e.izhitsacyrillic=1141,e.izhitsadblgravecyrillic=1143,e.j=106,e.jaarmenian=1393,e.jabengali=2460,e.jadeva=2332,e.jagujarati=2716,e.jagurmukhi=2588,e.jbopomofo=12560,e.jcaron=496,e.jcircle=9433,e.jcircumflex=309,e.jcrossedtail=669,e.jdotlessstroke=607,e.jecyrillic=1112,e.jeemarabic=1580,e.jeemfinalarabic=65182,e.jeeminitialarabic=65183,e.jeemmedialarabic=65184,e.jeharabic=1688,e.jehfinalarabic=64395,e.jhabengali=2461,e.jhadeva=2333,e.jhagujarati=2717,e.jhagurmukhi=2589,e.jheharmenian=1403,e.jis=12292,e.jmonospace=65354,e.jparen=9381,e.jsuperior=690,e.k=107,e.kabashkircyrillic=1185,e.kabengali=2453,e.kacute=7729,e.kacyrillic=1082,e.kadescendercyrillic=1179,e.kadeva=2325,e.kaf=1499,e.kafarabic=1603,e.kafdagesh=64315,e.kafdageshhebrew=64315,e.kaffinalarabic=65242,e.kafhebrew=1499,e.kafinitialarabic=65243,e.kafmedialarabic=65244,e.kafrafehebrew=64333,e.kagujarati=2709,e.kagurmukhi=2581,e.kahiragana=12363,e.kahookcyrillic=1220,e.kakatakana=12459,e.kakatakanahalfwidth=65398,e.kappa=954,e.kappasymbolgreek=1008,e.kapyeounmieumkorean=12657,e.kapyeounphieuphkorean=12676,e.kapyeounpieupkorean=12664,e.kapyeounssangpieupkorean=12665,e.karoriisquare=13069,e.kashidaautoarabic=1600,e.kashidaautonosidebearingarabic=1600,e.kasmallkatakana=12533,e.kasquare=13188,e.kasraarabic=1616,e.kasratanarabic=1613,e.kastrokecyrillic=1183,e.katahiraprolongmarkhalfwidth=65392,e.kaverticalstrokecyrillic=1181,e.kbopomofo=12558,e.kcalsquare=13193,e.kcaron=489,e.kcedilla=311,e.kcircle=9434,e.kcommaaccent=311,e.kdotbelow=7731,e.keharmenian=1412,e.kehiragana=12369,e.kekatakana=12465,e.kekatakanahalfwidth=65401,e.kenarmenian=1391,e.kesmallkatakana=12534,e.kgreenlandic=312,e.khabengali=2454,e.khacyrillic=1093,e.khadeva=2326,e.khagujarati=2710,e.khagurmukhi=2582,e.khaharabic=1582,e.khahfinalarabic=65190,e.khahinitialarabic=65191,e.khahmedialarabic=65192,e.kheicoptic=999,e.khhadeva=2393,e.khhagurmukhi=2649,e.khieukhacirclekorean=12920,e.khieukhaparenkorean=12824,e.khieukhcirclekorean=12906,e.khieukhkorean=12619,e.khieukhparenkorean=12810,e.khokhaithai=3586,e.khokhonthai=3589,e.khokhuatthai=3587,e.khokhwaithai=3588,e.khomutthai=3675,e.khook=409,e.khorakhangthai=3590,e.khzsquare=13201,e.kihiragana=12365,e.kikatakana=12461,e.kikatakanahalfwidth=65399,e.kiroguramusquare=13077,e.kiromeetorusquare=13078,e.kirosquare=13076,e.kiyeokacirclekorean=12910,e.kiyeokaparenkorean=12814,e.kiyeokcirclekorean=12896,e.kiyeokkorean=12593,e.kiyeokparenkorean=12800,e.kiyeoksioskorean=12595,e.kjecyrillic=1116,e.klinebelow=7733,e.klsquare=13208,e.kmcubedsquare=13222,e.kmonospace=65355,e.kmsquaredsquare=13218,e.kohiragana=12371,e.kohmsquare=13248,e.kokaithai=3585,e.kokatakana=12467,e.kokatakanahalfwidth=65402,e.kooposquare=13086,e.koppacyrillic=1153,e.koreanstandardsymbol=12927,e.koroniscmb=835,e.kparen=9382,e.kpasquare=13226,e.ksicyrillic=1135,e.ktsquare=13263,e.kturned=670,e.kuhiragana=12367,e.kukatakana=12463,e.kukatakanahalfwidth=65400,e.kvsquare=13240,e.kwsquare=13246,e.l=108,e.labengali=2482,e.lacute=314,e.ladeva=2354,e.lagujarati=2738,e.lagurmukhi=2610,e.lakkhangyaothai=3653,e.lamaleffinalarabic=65276,e.lamalefhamzaabovefinalarabic=65272,e.lamalefhamzaaboveisolatedarabic=65271,e.lamalefhamzabelowfinalarabic=65274,e.lamalefhamzabelowisolatedarabic=65273,e.lamalefisolatedarabic=65275,e.lamalefmaddaabovefinalarabic=65270,e.lamalefmaddaaboveisolatedarabic=65269,e.lamarabic=1604,e.lambda=955,e.lambdastroke=411,e.lamed=1500,e.lameddagesh=64316,e.lameddageshhebrew=64316,e.lamedhebrew=1500,e.lamfinalarabic=65246,e.lamhahinitialarabic=64714,e.laminitialarabic=65247,e.lamjeeminitialarabic=64713,e.lamkhahinitialarabic=64715,e.lamlamhehisolatedarabic=65010,e.lammedialarabic=65248,e.lammeemhahinitialarabic=64904,e.lammeeminitialarabic=64716,e.largecircle=9711,e.lbar=410,e.lbelt=620,e.lbopomofo=12556,e.lcaron=318,e.lcedilla=316,e.lcircle=9435,e.lcircumflexbelow=7741,e.lcommaaccent=316,e.ldot=320,e.ldotaccent=320,e.ldotbelow=7735,e.ldotbelowmacron=7737,e.leftangleabovecmb=794,e.lefttackbelowcmb=792,e.less=60,e.lessequal=8804,e.lessequalorgreater=8922,e.lessmonospace=65308,e.lessorequivalent=8818,e.lessorgreater=8822,e.lessoverequal=8806,e.lesssmall=65124,e.lezh=622,e.lfblock=9612,e.lhookretroflex=621,e.lira=8356,e.liwnarmenian=1388,e.lj=457,e.ljecyrillic=1113,e.ll=63168,e.lladeva=2355,e.llagujarati=2739,e.llinebelow=7739,e.llladeva=2356,e.llvocalicbengali=2529,e.llvocalicdeva=2401,e.llvocalicvowelsignbengali=2531,e.llvocalicvowelsigndeva=2403,e.lmiddletilde=619,e.lmonospace=65356,e.lmsquare=13264,e.lochulathai=3628,e.logicaland=8743,e.logicalnot=172,e.logicalnotreversed=8976,e.logicalor=8744,e.lolingthai=3621,e.longs=383,e.lowlinecenterline=65102,e.lowlinecmb=818,e.lowlinedashed=65101,e.lozenge=9674,e.lparen=9383,e.lslash=322,e.lsquare=8467,e.lsuperior=63214,e.ltshade=9617,e.luthai=3622,e.lvocalicbengali=2444,e.lvocalicdeva=2316,e.lvocalicvowelsignbengali=2530,e.lvocalicvowelsigndeva=2402,e.lxsquare=13267,e.m=109,e.mabengali=2478,e.macron=175,e.macronbelowcmb=817,e.macroncmb=772,e.macronlowmod=717,e.macronmonospace=65507,e.macute=7743,e.madeva=2350,e.magujarati=2734,e.magurmukhi=2606,e.mahapakhhebrew=1444,e.mahapakhlefthebrew=1444,e.mahiragana=12414,e.maichattawalowleftthai=63637,e.maichattawalowrightthai=63636,e.maichattawathai=3659,e.maichattawaupperleftthai=63635,e.maieklowleftthai=63628,e.maieklowrightthai=63627,e.maiekthai=3656,e.maiekupperleftthai=63626,e.maihanakatleftthai=63620,e.maihanakatthai=3633,e.maitaikhuleftthai=63625,e.maitaikhuthai=3655,e.maitholowleftthai=63631,e.maitholowrightthai=63630,e.maithothai=3657,e.maithoupperleftthai=63629,e.maitrilowleftthai=63634,e.maitrilowrightthai=63633,e.maitrithai=3658,e.maitriupperleftthai=63632,e.maiyamokthai=3654,e.makatakana=12510,e.makatakanahalfwidth=65423,e.male=9794,e.mansyonsquare=13127,e.maqafhebrew=1470,e.mars=9794,e.masoracirclehebrew=1455,e.masquare=13187,e.mbopomofo=12551,e.mbsquare=13268,e.mcircle=9436,e.mcubedsquare=13221,e.mdotaccent=7745,e.mdotbelow=7747,e.meemarabic=1605,e.meemfinalarabic=65250,e.meeminitialarabic=65251,e.meemmedialarabic=65252,e.meemmeeminitialarabic=64721,e.meemmeemisolatedarabic=64584,e.meetorusquare=13133,e.mehiragana=12417,e.meizierasquare=13182,e.mekatakana=12513,e.mekatakanahalfwidth=65426,e.mem=1502,e.memdagesh=64318,e.memdageshhebrew=64318,e.memhebrew=1502,e.menarmenian=1396,e.merkhahebrew=1445,e.merkhakefulahebrew=1446,e.merkhakefulalefthebrew=1446,e.merkhalefthebrew=1445,e.mhook=625,e.mhzsquare=13202,e.middledotkatakanahalfwidth=65381,e.middot=183,e.mieumacirclekorean=12914,e.mieumaparenkorean=12818,e.mieumcirclekorean=12900,e.mieumkorean=12609,e.mieumpansioskorean=12656,e.mieumparenkorean=12804,e.mieumpieupkorean=12654,e.mieumsioskorean=12655,e.mihiragana=12415,e.mikatakana=12511,e.mikatakanahalfwidth=65424,e.minus=8722,e.minusbelowcmb=800,e.minuscircle=8854,e.minusmod=727,e.minusplus=8723,e.minute=8242,e.miribaarusquare=13130,e.mirisquare=13129,e.mlonglegturned=624,e.mlsquare=13206,e.mmcubedsquare=13219,e.mmonospace=65357,e.mmsquaredsquare=13215,e.mohiragana=12418,e.mohmsquare=13249,e.mokatakana=12514,e.mokatakanahalfwidth=65427,e.molsquare=13270,e.momathai=3617,e.moverssquare=13223,e.moverssquaredsquare=13224,e.mparen=9384,e.mpasquare=13227,e.mssquare=13235,e.msuperior=63215,e.mturned=623,e.mu=181,e.mu1=181,e.muasquare=13186,e.muchgreater=8811,e.muchless=8810,e.mufsquare=13196,e.mugreek=956,e.mugsquare=13197,e.muhiragana=12416,e.mukatakana=12512,e.mukatakanahalfwidth=65425,e.mulsquare=13205,e.multiply=215,e.mumsquare=13211,e.munahhebrew=1443,e.munahlefthebrew=1443,e.musicalnote=9834,e.musicalnotedbl=9835,e.musicflatsign=9837,e.musicsharpsign=9839,e.mussquare=13234,e.muvsquare=13238,e.muwsquare=13244,e.mvmegasquare=13241,e.mvsquare=13239,e.mwmegasquare=13247,e.mwsquare=13245,e.n=110,e.nabengali=2472,e.nabla=8711,e.nacute=324,e.nadeva=2344,e.nagujarati=2728,e.nagurmukhi=2600,e.nahiragana=12394,e.nakatakana=12490,e.nakatakanahalfwidth=65413,e.napostrophe=329,e.nasquare=13185,e.nbopomofo=12555,e.nbspace=160,e.ncaron=328,e.ncedilla=326,e.ncircle=9437,e.ncircumflexbelow=7755,e.ncommaaccent=326,e.ndotaccent=7749,e.ndotbelow=7751,e.nehiragana=12397,e.nekatakana=12493,e.nekatakanahalfwidth=65416,e.newsheqelsign=8362,e.nfsquare=13195,e.ngabengali=2457,e.ngadeva=2329,e.ngagujarati=2713,e.ngagurmukhi=2585,e.ngonguthai=3591,e.nhiragana=12435,e.nhookleft=626,e.nhookretroflex=627,e.nieunacirclekorean=12911,e.nieunaparenkorean=12815,e.nieuncieuckorean=12597,e.nieuncirclekorean=12897,e.nieunhieuhkorean=12598,e.nieunkorean=12596,e.nieunpansioskorean=12648,e.nieunparenkorean=12801,e.nieunsioskorean=12647,e.nieuntikeutkorean=12646,e.nihiragana=12395,e.nikatakana=12491,e.nikatakanahalfwidth=65414,e.nikhahitleftthai=63641,e.nikhahitthai=3661,e.nine=57,e.ninearabic=1641,e.ninebengali=2543,e.ninecircle=9320,e.ninecircleinversesansserif=10130,e.ninedeva=2415,e.ninegujarati=2799,e.ninegurmukhi=2671,e.ninehackarabic=1641,e.ninehangzhou=12329,e.nineideographicparen=12840,e.nineinferior=8329,e.ninemonospace=65305,e.nineoldstyle=63289,e.nineparen=9340,e.nineperiod=9360,e.ninepersian=1785,e.nineroman=8568,e.ninesuperior=8313,e.nineteencircle=9330,e.nineteenparen=9350,e.nineteenperiod=9370,e.ninethai=3673,e.nj=460,e.njecyrillic=1114,e.nkatakana=12531,e.nkatakanahalfwidth=65437,e.nlegrightlong=414,e.nlinebelow=7753,e.nmonospace=65358,e.nmsquare=13210,e.nnabengali=2467,e.nnadeva=2339,e.nnagujarati=2723,e.nnagurmukhi=2595,e.nnnadeva=2345,e.nohiragana=12398,e.nokatakana=12494,e.nokatakanahalfwidth=65417,e.nonbreakingspace=160,e.nonenthai=3603,e.nonuthai=3609,e.noonarabic=1606,e.noonfinalarabic=65254,e.noonghunnaarabic=1722,e.noonghunnafinalarabic=64415,e.nooninitialarabic=65255,e.noonjeeminitialarabic=64722,e.noonjeemisolatedarabic=64587,e.noonmedialarabic=65256,e.noonmeeminitialarabic=64725,e.noonmeemisolatedarabic=64590,e.noonnoonfinalarabic=64653,e.notcontains=8716,e.notelement=8713,e.notelementof=8713,e.notequal=8800,e.notgreater=8815,e.notgreaternorequal=8817,e.notgreaternorless=8825,e.notidentical=8802,e.notless=8814,e.notlessnorequal=8816,e.notparallel=8742,e.notprecedes=8832,e.notsubset=8836,e.notsucceeds=8833,e.notsuperset=8837,e.nowarmenian=1398,e.nparen=9385,e.nssquare=13233,e.nsuperior=8319,e.ntilde=241,e.nu=957,e.nuhiragana=12396,e.nukatakana=12492,e.nukatakanahalfwidth=65415,e.nuktabengali=2492,e.nuktadeva=2364,e.nuktagujarati=2748,e.nuktagurmukhi=2620,e.numbersign=35,e.numbersignmonospace=65283,e.numbersignsmall=65119,e.numeralsigngreek=884,e.numeralsignlowergreek=885,e.numero=8470,e.nun=1504,e.nundagesh=64320,e.nundageshhebrew=64320,e.nunhebrew=1504,e.nvsquare=13237,e.nwsquare=13243,e.nyabengali=2462,e.nyadeva=2334,e.nyagujarati=2718,e.nyagurmukhi=2590,e.o=111,e.oacute=243,e.oangthai=3629,e.obarred=629,e.obarredcyrillic=1257,e.obarreddieresiscyrillic=1259,e.obengali=2451,e.obopomofo=12571,e.obreve=335,e.ocandradeva=2321,e.ocandragujarati=2705,e.ocandravowelsigndeva=2377,e.ocandravowelsigngujarati=2761,e.ocaron=466,e.ocircle=9438,e.ocircumflex=244,e.ocircumflexacute=7889,e.ocircumflexdotbelow=7897,e.ocircumflexgrave=7891,e.ocircumflexhookabove=7893,e.ocircumflextilde=7895,e.ocyrillic=1086,e.odblacute=337,e.odblgrave=525,e.odeva=2323,e.odieresis=246,e.odieresiscyrillic=1255,e.odotbelow=7885,e.oe=339,e.oekorean=12634,e.ogonek=731,e.ogonekcmb=808,e.ograve=242,e.ogujarati=2707,e.oharmenian=1413,e.ohiragana=12362,e.ohookabove=7887,e.ohorn=417,e.ohornacute=7899,e.ohorndotbelow=7907,e.ohorngrave=7901,e.ohornhookabove=7903,e.ohorntilde=7905,e.ohungarumlaut=337,e.oi=419,e.oinvertedbreve=527,e.okatakana=12458,e.okatakanahalfwidth=65397,e.okorean=12631,e.olehebrew=1451,e.omacron=333,e.omacronacute=7763,e.omacrongrave=7761,e.omdeva=2384,e.omega=969,e.omega1=982,e.omegacyrillic=1121,e.omegalatinclosed=631,e.omegaroundcyrillic=1147,e.omegatitlocyrillic=1149,e.omegatonos=974,e.omgujarati=2768,e.omicron=959,e.omicrontonos=972,e.omonospace=65359,e.one=49,e.onearabic=1633,e.onebengali=2535,e.onecircle=9312,e.onecircleinversesansserif=10122,e.onedeva=2407,e.onedotenleader=8228,e.oneeighth=8539,e.onefitted=63196,e.onegujarati=2791,e.onegurmukhi=2663,e.onehackarabic=1633,e.onehalf=189,e.onehangzhou=12321,e.oneideographicparen=12832,e.oneinferior=8321,e.onemonospace=65297,e.onenumeratorbengali=2548,e.oneoldstyle=63281,e.oneparen=9332,e.oneperiod=9352,e.onepersian=1777,e.onequarter=188,e.oneroman=8560,e.onesuperior=185,e.onethai=3665,e.onethird=8531,e.oogonek=491,e.oogonekmacron=493,e.oogurmukhi=2579,e.oomatragurmukhi=2635,e.oopen=596,e.oparen=9386,e.openbullet=9702,e.option=8997,e.ordfeminine=170,e.ordmasculine=186,e.orthogonal=8735,e.oshortdeva=2322,e.oshortvowelsigndeva=2378,e.oslash=248,e.oslashacute=511,e.osmallhiragana=12361,e.osmallkatakana=12457,e.osmallkatakanahalfwidth=65387,e.ostrokeacute=511,e.osuperior=63216,e.otcyrillic=1151,e.otilde=245,e.otildeacute=7757,e.otildedieresis=7759,e.oubopomofo=12577,e.overline=8254,e.overlinecenterline=65098,e.overlinecmb=773,e.overlinedashed=65097,e.overlinedblwavy=65100,e.overlinewavy=65099,e.overscore=175,e.ovowelsignbengali=2507,e.ovowelsigndeva=2379,e.ovowelsigngujarati=2763,e.p=112,e.paampssquare=13184,e.paasentosquare=13099,e.pabengali=2474,e.pacute=7765,e.padeva=2346,e.pagedown=8671,e.pageup=8670,e.pagujarati=2730,e.pagurmukhi=2602,e.pahiragana=12401,e.paiyannoithai=3631,e.pakatakana=12497,e.palatalizationcyrilliccmb=1156,e.palochkacyrillic=1216,e.pansioskorean=12671,e.paragraph=182,e.parallel=8741,e.parenleft=40,e.parenleftaltonearabic=64830,e.parenleftbt=63725,e.parenleftex=63724,e.parenleftinferior=8333,e.parenleftmonospace=65288,e.parenleftsmall=65113,e.parenleftsuperior=8317,e.parenlefttp=63723,e.parenleftvertical=65077,e.parenright=41,e.parenrightaltonearabic=64831,e.parenrightbt=63736,e.parenrightex=63735,e.parenrightinferior=8334,e.parenrightmonospace=65289,e.parenrightsmall=65114,e.parenrightsuperior=8318,e.parenrighttp=63734,e.parenrightvertical=65078,e.partialdiff=8706,e.paseqhebrew=1472,e.pashtahebrew=1433,e.pasquare=13225,e.patah=1463,e.patah11=1463,e.patah1d=1463,e.patah2a=1463,e.patahhebrew=1463,e.patahnarrowhebrew=1463,e.patahquarterhebrew=1463,e.patahwidehebrew=1463,e.pazerhebrew=1441,e.pbopomofo=12550,e.pcircle=9439,e.pdotaccent=7767,e.pe=1508,e.pecyrillic=1087,e.pedagesh=64324,e.pedageshhebrew=64324,e.peezisquare=13115,e.pefinaldageshhebrew=64323,e.peharabic=1662,e.peharmenian=1402,e.pehebrew=1508,e.pehfinalarabic=64343,e.pehinitialarabic=64344,e.pehiragana=12410,e.pehmedialarabic=64345,e.pekatakana=12506,e.pemiddlehookcyrillic=1191,e.perafehebrew=64334,e.percent=37,e.percentarabic=1642,e.percentmonospace=65285,e.percentsmall=65130,e.period=46,e.periodarmenian=1417,e.periodcentered=183,e.periodhalfwidth=65377,e.periodinferior=63207,e.periodmonospace=65294,e.periodsmall=65106,e.periodsuperior=63208,e.perispomenigreekcmb=834,e.perpendicular=8869,e.perthousand=8240,e.peseta=8359,e.pfsquare=13194,e.phabengali=2475,e.phadeva=2347,e.phagujarati=2731,e.phagurmukhi=2603,e.phi=966,e.phi1=981,e.phieuphacirclekorean=12922,e.phieuphaparenkorean=12826,e.phieuphcirclekorean=12908,e.phieuphkorean=12621,e.phieuphparenkorean=12812,e.philatin=632,e.phinthuthai=3642,e.phisymbolgreek=981,e.phook=421,e.phophanthai=3614,e.phophungthai=3612,e.phosamphaothai=3616,e.pi=960,e.pieupacirclekorean=12915,e.pieupaparenkorean=12819,e.pieupcieuckorean=12662,e.pieupcirclekorean=12901,e.pieupkiyeokkorean=12658,e.pieupkorean=12610,e.pieupparenkorean=12805,e.pieupsioskiyeokkorean=12660,e.pieupsioskorean=12612,e.pieupsiostikeutkorean=12661,e.pieupthieuthkorean=12663,e.pieuptikeutkorean=12659,e.pihiragana=12404,e.pikatakana=12500,e.pisymbolgreek=982,e.piwrarmenian=1411,e.planckover2pi=8463,e.planckover2pi1=8463,e.plus=43,e.plusbelowcmb=799,e.pluscircle=8853,e.plusminus=177,e.plusmod=726,e.plusmonospace=65291,e.plussmall=65122,e.plussuperior=8314,e.pmonospace=65360,e.pmsquare=13272,e.pohiragana=12413,e.pointingindexdownwhite=9759,e.pointingindexleftwhite=9756,e.pointingindexrightwhite=9758,e.pointingindexupwhite=9757,e.pokatakana=12509,e.poplathai=3611,e.postalmark=12306,e.postalmarkface=12320,e.pparen=9387,e.precedes=8826,e.prescription=8478,e.primemod=697,e.primereversed=8245,e.product=8719,e.projective=8965,e.prolongedkana=12540,e.propellor=8984,e.propersubset=8834,e.propersuperset=8835,e.proportion=8759,e.proportional=8733,e.psi=968,e.psicyrillic=1137,e.psilipneumatacyrilliccmb=1158,e.pssquare=13232,e.puhiragana=12407,e.pukatakana=12503,e.pvsquare=13236,e.pwsquare=13242,e.q=113,e.qadeva=2392,e.qadmahebrew=1448,e.qafarabic=1602,e.qaffinalarabic=65238,e.qafinitialarabic=65239,e.qafmedialarabic=65240,e.qamats=1464,e.qamats10=1464,e.qamats1a=1464,e.qamats1c=1464,e.qamats27=1464,e.qamats29=1464,e.qamats33=1464,e.qamatsde=1464,e.qamatshebrew=1464,e.qamatsnarrowhebrew=1464,e.qamatsqatanhebrew=1464,e.qamatsqatannarrowhebrew=1464,e.qamatsqatanquarterhebrew=1464,e.qamatsqatanwidehebrew=1464,e.qamatsquarterhebrew=1464,e.qamatswidehebrew=1464,e.qarneyparahebrew=1439,e.qbopomofo=12561,e.qcircle=9440,e.qhook=672,e.qmonospace=65361,e.qof=1511,e.qofdagesh=64327,e.qofdageshhebrew=64327,e.qofhebrew=1511,e.qparen=9388,e.quarternote=9833,e.qubuts=1467,e.qubuts18=1467,e.qubuts25=1467,e.qubuts31=1467,e.qubutshebrew=1467,e.qubutsnarrowhebrew=1467,e.qubutsquarterhebrew=1467,e.qubutswidehebrew=1467,e.question=63,e.questionarabic=1567,e.questionarmenian=1374,e.questiondown=191,e.questiondownsmall=63423,e.questiongreek=894,e.questionmonospace=65311,e.questionsmall=63295,e.quotedbl=34,e.quotedblbase=8222,e.quotedblleft=8220,e.quotedblmonospace=65282,e.quotedblprime=12318,e.quotedblprimereversed=12317,e.quotedblright=8221,e.quoteleft=8216,e.quoteleftreversed=8219,e.quotereversed=8219,e.quoteright=8217,e.quoterightn=329,e.quotesinglbase=8218,e.quotesingle=39,e.quotesinglemonospace=65287,e.r=114,e.raarmenian=1404,e.rabengali=2480,e.racute=341,e.radeva=2352,e.radical=8730,e.radicalex=63717,e.radoverssquare=13230,e.radoverssquaredsquare=13231,e.radsquare=13229,e.rafe=1471,e.rafehebrew=1471,e.ragujarati=2736,e.ragurmukhi=2608,e.rahiragana=12425,e.rakatakana=12521,e.rakatakanahalfwidth=65431,e.ralowerdiagonalbengali=2545,e.ramiddlediagonalbengali=2544,e.ramshorn=612,e.ratio=8758,e.rbopomofo=12566,e.rcaron=345,e.rcedilla=343,e.rcircle=9441,e.rcommaaccent=343,e.rdblgrave=529,e.rdotaccent=7769,e.rdotbelow=7771,e.rdotbelowmacron=7773,e.referencemark=8251,e.reflexsubset=8838,e.reflexsuperset=8839,e.registered=174,e.registersans=63720,e.registerserif=63194,e.reharabic=1585,e.reharmenian=1408,e.rehfinalarabic=65198,e.rehiragana=12428,e.rekatakana=12524,e.rekatakanahalfwidth=65434,e.resh=1512,e.reshdageshhebrew=64328,e.reshhebrew=1512,e.reversedtilde=8765,e.reviahebrew=1431,e.reviamugrashhebrew=1431,e.revlogicalnot=8976,e.rfishhook=638,e.rfishhookreversed=639,e.rhabengali=2525,e.rhadeva=2397,e.rho=961,e.rhook=637,e.rhookturned=635,e.rhookturnedsuperior=693,e.rhosymbolgreek=1009,e.rhotichookmod=734,e.rieulacirclekorean=12913,e.rieulaparenkorean=12817,e.rieulcirclekorean=12899,e.rieulhieuhkorean=12608,e.rieulkiyeokkorean=12602,e.rieulkiyeoksioskorean=12649,e.rieulkorean=12601,e.rieulmieumkorean=12603,e.rieulpansioskorean=12652,e.rieulparenkorean=12803,e.rieulphieuphkorean=12607,e.rieulpieupkorean=12604,e.rieulpieupsioskorean=12651,e.rieulsioskorean=12605,e.rieulthieuthkorean=12606,e.rieultikeutkorean=12650,e.rieulyeorinhieuhkorean=12653,e.rightangle=8735,e.righttackbelowcmb=793,e.righttriangle=8895,e.rihiragana=12426,e.rikatakana=12522,e.rikatakanahalfwidth=65432,e.ring=730,e.ringbelowcmb=805,e.ringcmb=778,e.ringhalfleft=703,e.ringhalfleftarmenian=1369,e.ringhalfleftbelowcmb=796,e.ringhalfleftcentered=723,e.ringhalfright=702,e.ringhalfrightbelowcmb=825,e.ringhalfrightcentered=722,e.rinvertedbreve=531,e.rittorusquare=13137,e.rlinebelow=7775,e.rlongleg=636,e.rlonglegturned=634,e.rmonospace=65362,e.rohiragana=12429,e.rokatakana=12525,e.rokatakanahalfwidth=65435,e.roruathai=3619,e.rparen=9389,e.rrabengali=2524,e.rradeva=2353,e.rragurmukhi=2652,e.rreharabic=1681,e.rrehfinalarabic=64397,e.rrvocalicbengali=2528,e.rrvocalicdeva=2400,e.rrvocalicgujarati=2784,e.rrvocalicvowelsignbengali=2500,e.rrvocalicvowelsigndeva=2372,e.rrvocalicvowelsigngujarati=2756,e.rsuperior=63217,e.rtblock=9616,e.rturned=633,e.rturnedsuperior=692,e.ruhiragana=12427,e.rukatakana=12523,e.rukatakanahalfwidth=65433,e.rupeemarkbengali=2546,e.rupeesignbengali=2547,e.rupiah=63197,e.ruthai=3620,e.rvocalicbengali=2443,e.rvocalicdeva=2315,e.rvocalicgujarati=2699,e.rvocalicvowelsignbengali=2499,e.rvocalicvowelsigndeva=2371,e.rvocalicvowelsigngujarati=2755,e.s=115,e.sabengali=2488,e.sacute=347,e.sacutedotaccent=7781,e.sadarabic=1589,e.sadeva=2360,e.sadfinalarabic=65210,e.sadinitialarabic=65211,e.sadmedialarabic=65212,e.sagujarati=2744,e.sagurmukhi=2616,e.sahiragana=12373,e.sakatakana=12469,e.sakatakanahalfwidth=65403,e.sallallahoualayhewasallamarabic=65018,e.samekh=1505,e.samekhdagesh=64321,e.samekhdageshhebrew=64321,e.samekhhebrew=1505,e.saraaathai=3634,e.saraaethai=3649,e.saraaimaimalaithai=3652,e.saraaimaimuanthai=3651,e.saraamthai=3635,e.saraathai=3632,e.saraethai=3648,e.saraiileftthai=63622,e.saraiithai=3637,e.saraileftthai=63621,e.saraithai=3636,e.saraothai=3650,e.saraueeleftthai=63624,e.saraueethai=3639,e.saraueleftthai=63623,e.sarauethai=3638,e.sarauthai=3640,e.sarauuthai=3641,e.sbopomofo=12569,e.scaron=353,e.scarondotaccent=7783,e.scedilla=351,e.schwa=601,e.schwacyrillic=1241,e.schwadieresiscyrillic=1243,e.schwahook=602,e.scircle=9442,e.scircumflex=349,e.scommaaccent=537,e.sdotaccent=7777,e.sdotbelow=7779,e.sdotbelowdotaccent=7785,e.seagullbelowcmb=828,e.second=8243,e.secondtonechinese=714,e.section=167,e.seenarabic=1587,e.seenfinalarabic=65202,e.seeninitialarabic=65203,e.seenmedialarabic=65204,e.segol=1462,e.segol13=1462,e.segol1f=1462,e.segol2c=1462,e.segolhebrew=1462,e.segolnarrowhebrew=1462,e.segolquarterhebrew=1462,e.segoltahebrew=1426,e.segolwidehebrew=1462,e.seharmenian=1405,e.sehiragana=12379,e.sekatakana=12475,e.sekatakanahalfwidth=65406,e.semicolon=59,e.semicolonarabic=1563,e.semicolonmonospace=65307,e.semicolonsmall=65108,e.semivoicedmarkkana=12444,e.semivoicedmarkkanahalfwidth=65439,e.sentisquare=13090,e.sentosquare=13091,e.seven=55,e.sevenarabic=1639,e.sevenbengali=2541,e.sevencircle=9318,e.sevencircleinversesansserif=10128,e.sevendeva=2413,e.seveneighths=8542,e.sevengujarati=2797,e.sevengurmukhi=2669,e.sevenhackarabic=1639,e.sevenhangzhou=12327,e.sevenideographicparen=12838,e.seveninferior=8327,e.sevenmonospace=65303,e.sevenoldstyle=63287,e.sevenparen=9338,e.sevenperiod=9358,e.sevenpersian=1783,e.sevenroman=8566,e.sevensuperior=8311,e.seventeencircle=9328,e.seventeenparen=9348,e.seventeenperiod=9368,e.seventhai=3671,e.sfthyphen=173,e.shaarmenian=1399,e.shabengali=2486,e.shacyrillic=1096,e.shaddaarabic=1617,e.shaddadammaarabic=64609,e.shaddadammatanarabic=64606,e.shaddafathaarabic=64608,e.shaddakasraarabic=64610,e.shaddakasratanarabic=64607,e.shade=9618,e.shadedark=9619,e.shadelight=9617,e.shademedium=9618,e.shadeva=2358,e.shagujarati=2742,e.shagurmukhi=2614,e.shalshelethebrew=1427,e.shbopomofo=12565,e.shchacyrillic=1097,e.sheenarabic=1588,e.sheenfinalarabic=65206,e.sheeninitialarabic=65207,e.sheenmedialarabic=65208,e.sheicoptic=995,e.sheqel=8362,e.sheqelhebrew=8362,e.sheva=1456,e.sheva115=1456,e.sheva15=1456,e.sheva22=1456,e.sheva2e=1456,e.shevahebrew=1456,e.shevanarrowhebrew=1456,e.shevaquarterhebrew=1456,e.shevawidehebrew=1456,e.shhacyrillic=1211,e.shimacoptic=1005,e.shin=1513,e.shindagesh=64329,e.shindageshhebrew=64329,e.shindageshshindot=64300,e.shindageshshindothebrew=64300,e.shindageshsindot=64301,e.shindageshsindothebrew=64301,e.shindothebrew=1473,e.shinhebrew=1513,e.shinshindot=64298,e.shinshindothebrew=64298,e.shinsindot=64299,e.shinsindothebrew=64299,e.shook=642,e.sigma=963,e.sigma1=962,e.sigmafinal=962,e.sigmalunatesymbolgreek=1010,e.sihiragana=12375,e.sikatakana=12471,e.sikatakanahalfwidth=65404,e.siluqhebrew=1469,e.siluqlefthebrew=1469,e.similar=8764,e.sindothebrew=1474,e.siosacirclekorean=12916,e.siosaparenkorean=12820,e.sioscieuckorean=12670,e.sioscirclekorean=12902,e.sioskiyeokkorean=12666,e.sioskorean=12613,e.siosnieunkorean=12667,e.siosparenkorean=12806,e.siospieupkorean=12669,e.siostikeutkorean=12668,e.six=54,e.sixarabic=1638,e.sixbengali=2540,e.sixcircle=9317,e.sixcircleinversesansserif=10127,e.sixdeva=2412,e.sixgujarati=2796,e.sixgurmukhi=2668,e.sixhackarabic=1638,e.sixhangzhou=12326,e.sixideographicparen=12837,e.sixinferior=8326,e.sixmonospace=65302,e.sixoldstyle=63286,e.sixparen=9337,e.sixperiod=9357,e.sixpersian=1782,e.sixroman=8565,e.sixsuperior=8310,e.sixteencircle=9327,e.sixteencurrencydenominatorbengali=2553,e.sixteenparen=9347,e.sixteenperiod=9367,e.sixthai=3670,e.slash=47,e.slashmonospace=65295,e.slong=383,e.slongdotaccent=7835,e.smileface=9786,e.smonospace=65363,e.sofpasuqhebrew=1475,e.softhyphen=173,e.softsigncyrillic=1100,e.sohiragana=12381,e.sokatakana=12477,e.sokatakanahalfwidth=65407,e.soliduslongoverlaycmb=824,e.solidusshortoverlaycmb=823,e.sorusithai=3625,e.sosalathai=3624,e.sosothai=3595,e.sosuathai=3626,e.space=32,e.spacehackarabic=32,e.spade=9824,e.spadesuitblack=9824,e.spadesuitwhite=9828,e.sparen=9390,e.squarebelowcmb=827,e.squarecc=13252,e.squarecm=13213,e.squarediagonalcrosshatchfill=9641,e.squarehorizontalfill=9636,e.squarekg=13199,e.squarekm=13214,e.squarekmcapital=13262,e.squareln=13265,e.squarelog=13266,e.squaremg=13198,e.squaremil=13269,e.squaremm=13212,e.squaremsquared=13217,e.squareorthogonalcrosshatchfill=9638,e.squareupperlefttolowerrightfill=9639,e.squareupperrighttolowerleftfill=9640,e.squareverticalfill=9637,e.squarewhitewithsmallblack=9635,e.srsquare=13275,e.ssabengali=2487,e.ssadeva=2359,e.ssagujarati=2743,e.ssangcieuckorean=12617,e.ssanghieuhkorean=12677,e.ssangieungkorean=12672,e.ssangkiyeokkorean=12594,e.ssangnieunkorean=12645,e.ssangpieupkorean=12611,e.ssangsioskorean=12614,e.ssangtikeutkorean=12600,e.ssuperior=63218,e.sterling=163,e.sterlingmonospace=65505,e.strokelongoverlaycmb=822,e.strokeshortoverlaycmb=821,e.subset=8834,e.subsetnotequal=8842,e.subsetorequal=8838,e.succeeds=8827,e.suchthat=8715,e.suhiragana=12377,e.sukatakana=12473,e.sukatakanahalfwidth=65405,e.sukunarabic=1618,e.summation=8721,e.sun=9788,e.superset=8835,e.supersetnotequal=8843,e.supersetorequal=8839,e.svsquare=13276,e.syouwaerasquare=13180,e.t=116,e.tabengali=2468,e.tackdown=8868,e.tackleft=8867,e.tadeva=2340,e.tagujarati=2724,e.tagurmukhi=2596,e.taharabic=1591,e.tahfinalarabic=65218,e.tahinitialarabic=65219,e.tahiragana=12383,e.tahmedialarabic=65220,e.taisyouerasquare=13181,e.takatakana=12479,e.takatakanahalfwidth=65408,e.tatweelarabic=1600,e.tau=964,e.tav=1514,e.tavdages=64330,e.tavdagesh=64330,e.tavdageshhebrew=64330,e.tavhebrew=1514,e.tbar=359,e.tbopomofo=12554,e.tcaron=357,e.tccurl=680,e.tcedilla=355,e.tcheharabic=1670,e.tchehfinalarabic=64379,e.tchehinitialarabic=64380,e.tchehmedialarabic=64381,e.tcircle=9443,e.tcircumflexbelow=7793,e.tcommaaccent=355,e.tdieresis=7831,e.tdotaccent=7787,e.tdotbelow=7789,e.tecyrillic=1090,e.tedescendercyrillic=1197,e.teharabic=1578,e.tehfinalarabic=65174,e.tehhahinitialarabic=64674,e.tehhahisolatedarabic=64524,e.tehinitialarabic=65175,e.tehiragana=12390,e.tehjeeminitialarabic=64673,e.tehjeemisolatedarabic=64523,e.tehmarbutaarabic=1577,e.tehmarbutafinalarabic=65172,e.tehmedialarabic=65176,e.tehmeeminitialarabic=64676,e.tehmeemisolatedarabic=64526,e.tehnoonfinalarabic=64627,e.tekatakana=12486,e.tekatakanahalfwidth=65411,e.telephone=8481,e.telephoneblack=9742,e.telishagedolahebrew=1440,e.telishaqetanahebrew=1449,e.tencircle=9321,e.tenideographicparen=12841,e.tenparen=9341,e.tenperiod=9361,e.tenroman=8569,e.tesh=679,e.tet=1496,e.tetdagesh=64312,e.tetdageshhebrew=64312,e.tethebrew=1496,e.tetsecyrillic=1205,e.tevirhebrew=1435,e.tevirlefthebrew=1435,e.thabengali=2469,e.thadeva=2341,e.thagujarati=2725,e.thagurmukhi=2597,e.thalarabic=1584,e.thalfinalarabic=65196,e.thanthakhatlowleftthai=63640,e.thanthakhatlowrightthai=63639,e.thanthakhatthai=3660,e.thanthakhatupperleftthai=63638,e.theharabic=1579,e.thehfinalarabic=65178,e.thehinitialarabic=65179,e.thehmedialarabic=65180,e.thereexists=8707,e.therefore=8756,e.theta=952,e.theta1=977,e.thetasymbolgreek=977,e.thieuthacirclekorean=12921,e.thieuthaparenkorean=12825,e.thieuthcirclekorean=12907,e.thieuthkorean=12620,e.thieuthparenkorean=12811,e.thirteencircle=9324,e.thirteenparen=9344,e.thirteenperiod=9364,e.thonangmonthothai=3601,e.thook=429,e.thophuthaothai=3602,e.thorn=254,e.thothahanthai=3607,e.thothanthai=3600,e.thothongthai=3608,e.thothungthai=3606,e.thousandcyrillic=1154,e.thousandsseparatorarabic=1644,e.thousandsseparatorpersian=1644,e.three=51,e.threearabic=1635,e.threebengali=2537,e.threecircle=9314,e.threecircleinversesansserif=10124,e.threedeva=2409,e.threeeighths=8540,e.threegujarati=2793,e.threegurmukhi=2665,e.threehackarabic=1635,e.threehangzhou=12323,e.threeideographicparen=12834,e.threeinferior=8323,e.threemonospace=65299,e.threenumeratorbengali=2550,e.threeoldstyle=63283,e.threeparen=9334,e.threeperiod=9354,e.threepersian=1779,e.threequarters=190,e.threequartersemdash=63198,e.threeroman=8562,e.threesuperior=179,e.threethai=3667,e.thzsquare=13204,e.tihiragana=12385,e.tikatakana=12481,e.tikatakanahalfwidth=65409,e.tikeutacirclekorean=12912,e.tikeutaparenkorean=12816,e.tikeutcirclekorean=12898,e.tikeutkorean=12599,e.tikeutparenkorean=12802,e.tilde=732,e.tildebelowcmb=816,e.tildecmb=771,e.tildecomb=771,e.tildedoublecmb=864,e.tildeoperator=8764,e.tildeoverlaycmb=820,e.tildeverticalcmb=830,e.timescircle=8855,e.tipehahebrew=1430,e.tipehalefthebrew=1430,e.tippigurmukhi=2672,e.titlocyrilliccmb=1155,e.tiwnarmenian=1407,e.tlinebelow=7791,e.tmonospace=65364,e.toarmenian=1385,e.tohiragana=12392,e.tokatakana=12488,e.tokatakanahalfwidth=65412,e.tonebarextrahighmod=741,e.tonebarextralowmod=745,e.tonebarhighmod=742,e.tonebarlowmod=744,e.tonebarmidmod=743,e.tonefive=445,e.tonesix=389,e.tonetwo=424,e.tonos=900,e.tonsquare=13095,e.topatakthai=3599,e.tortoiseshellbracketleft=12308,e.tortoiseshellbracketleftsmall=65117,e.tortoiseshellbracketleftvertical=65081,e.tortoiseshellbracketright=12309,e.tortoiseshellbracketrightsmall=65118,e.tortoiseshellbracketrightvertical=65082,e.totaothai=3605,e.tpalatalhook=427,e.tparen=9391,e.trademark=8482,e.trademarksans=63722,e.trademarkserif=63195,e.tretroflexhook=648,e.triagdn=9660,e.triaglf=9668,e.triagrt=9658,e.triagup=9650,e.ts=678,e.tsadi=1510,e.tsadidagesh=64326,e.tsadidageshhebrew=64326,e.tsadihebrew=1510,e.tsecyrillic=1094,e.tsere=1461,e.tsere12=1461,e.tsere1e=1461,e.tsere2b=1461,e.tserehebrew=1461,e.tserenarrowhebrew=1461,e.tserequarterhebrew=1461,e.tserewidehebrew=1461,e.tshecyrillic=1115,e.tsuperior=63219,e.ttabengali=2463,e.ttadeva=2335,e.ttagujarati=2719,e.ttagurmukhi=2591,e.tteharabic=1657,e.ttehfinalarabic=64359,e.ttehinitialarabic=64360,e.ttehmedialarabic=64361,e.tthabengali=2464,e.tthadeva=2336,e.tthagujarati=2720,e.tthagurmukhi=2592,e.tturned=647,e.tuhiragana=12388,e.tukatakana=12484,e.tukatakanahalfwidth=65410,e.tusmallhiragana=12387,e.tusmallkatakana=12483,e.tusmallkatakanahalfwidth=65391,e.twelvecircle=9323,e.twelveparen=9343,e.twelveperiod=9363,e.twelveroman=8571,e.twentycircle=9331,e.twentyhangzhou=21316,e.twentyparen=9351,e.twentyperiod=9371,e.two=50,e.twoarabic=1634,e.twobengali=2536,e.twocircle=9313,e.twocircleinversesansserif=10123,e.twodeva=2408,e.twodotenleader=8229,e.twodotleader=8229,e.twodotleadervertical=65072,e.twogujarati=2792,e.twogurmukhi=2664,e.twohackarabic=1634,e.twohangzhou=12322,e.twoideographicparen=12833,e.twoinferior=8322,e.twomonospace=65298,e.twonumeratorbengali=2549,e.twooldstyle=63282,e.twoparen=9333,e.twoperiod=9353,e.twopersian=1778,e.tworoman=8561,e.twostroke=443,e.twosuperior=178,e.twothai=3666,e.twothirds=8532,e.u=117,e.uacute=250,e.ubar=649,e.ubengali=2441,e.ubopomofo=12584,e.ubreve=365,e.ucaron=468,e.ucircle=9444,e.ucircumflex=251,e.ucircumflexbelow=7799,e.ucyrillic=1091,e.udattadeva=2385,e.udblacute=369,e.udblgrave=533,e.udeva=2313,e.udieresis=252,e.udieresisacute=472,e.udieresisbelow=7795,e.udieresiscaron=474,e.udieresiscyrillic=1265,e.udieresisgrave=476,e.udieresismacron=470,e.udotbelow=7909,e.ugrave=249,e.ugujarati=2697,e.ugurmukhi=2569,e.uhiragana=12358,e.uhookabove=7911,e.uhorn=432,e.uhornacute=7913,e.uhorndotbelow=7921,e.uhorngrave=7915,e.uhornhookabove=7917,e.uhorntilde=7919,e.uhungarumlaut=369,e.uhungarumlautcyrillic=1267,e.uinvertedbreve=535,e.ukatakana=12454,e.ukatakanahalfwidth=65395,e.ukcyrillic=1145,e.ukorean=12636,e.umacron=363,e.umacroncyrillic=1263,e.umacrondieresis=7803,e.umatragurmukhi=2625,e.umonospace=65365,e.underscore=95,e.underscoredbl=8215,e.underscoremonospace=65343,e.underscorevertical=65075,e.underscorewavy=65103,e.union=8746,e.universal=8704,e.uogonek=371,e.uparen=9392,e.upblock=9600,e.upperdothebrew=1476,e.upsilon=965,e.upsilondieresis=971,e.upsilondieresistonos=944,e.upsilonlatin=650,e.upsilontonos=973,e.uptackbelowcmb=797,e.uptackmod=724,e.uragurmukhi=2675,e.uring=367,e.ushortcyrillic=1118,e.usmallhiragana=12357,e.usmallkatakana=12453,e.usmallkatakanahalfwidth=65385,e.ustraightcyrillic=1199,e.ustraightstrokecyrillic=1201,e.utilde=361,e.utildeacute=7801,e.utildebelow=7797,e.uubengali=2442,e.uudeva=2314,e.uugujarati=2698,e.uugurmukhi=2570,e.uumatragurmukhi=2626,e.uuvowelsignbengali=2498,e.uuvowelsigndeva=2370,e.uuvowelsigngujarati=2754,e.uvowelsignbengali=2497,e.uvowelsigndeva=2369,e.uvowelsigngujarati=2753,e.v=118,e.vadeva=2357,e.vagujarati=2741,e.vagurmukhi=2613,e.vakatakana=12535,e.vav=1493,e.vavdagesh=64309,e.vavdagesh65=64309,e.vavdageshhebrew=64309,e.vavhebrew=1493,e.vavholam=64331,e.vavholamhebrew=64331,e.vavvavhebrew=1520,e.vavyodhebrew=1521,e.vcircle=9445,e.vdotbelow=7807,e.vecyrillic=1074,e.veharabic=1700,e.vehfinalarabic=64363,e.vehinitialarabic=64364,e.vehmedialarabic=64365,e.vekatakana=12537,e.venus=9792,e.verticalbar=124,e.verticallineabovecmb=781,e.verticallinebelowcmb=809,e.verticallinelowmod=716,e.verticallinemod=712,e.vewarmenian=1406,e.vhook=651,e.vikatakana=12536,e.viramabengali=2509,e.viramadeva=2381,e.viramagujarati=2765,e.visargabengali=2435,e.visargadeva=2307,e.visargagujarati=2691,e.vmonospace=65366,e.voarmenian=1400,e.voicediterationhiragana=12446,e.voicediterationkatakana=12542,e.voicedmarkkana=12443,e.voicedmarkkanahalfwidth=65438,e.vokatakana=12538,e.vparen=9393,e.vtilde=7805,e.vturned=652,e.vuhiragana=12436,e.vukatakana=12532,e.w=119,e.wacute=7811,e.waekorean=12633,e.wahiragana=12431,e.wakatakana=12527,e.wakatakanahalfwidth=65436,e.wakorean=12632,e.wasmallhiragana=12430,e.wasmallkatakana=12526,e.wattosquare=13143,e.wavedash=12316,e.wavyunderscorevertical=65076,e.wawarabic=1608,e.wawfinalarabic=65262,e.wawhamzaabovearabic=1572,e.wawhamzaabovefinalarabic=65158,e.wbsquare=13277,e.wcircle=9446,e.wcircumflex=373,e.wdieresis=7813,e.wdotaccent=7815,e.wdotbelow=7817,e.wehiragana=12433,e.weierstrass=8472,e.wekatakana=12529,e.wekorean=12638,e.weokorean=12637,e.wgrave=7809,e.whitebullet=9702,e.whitecircle=9675,e.whitecircleinverse=9689,e.whitecornerbracketleft=12302,e.whitecornerbracketleftvertical=65091,e.whitecornerbracketright=12303,e.whitecornerbracketrightvertical=65092,e.whitediamond=9671,e.whitediamondcontainingblacksmalldiamond=9672,e.whitedownpointingsmalltriangle=9663,e.whitedownpointingtriangle=9661,e.whiteleftpointingsmalltriangle=9667,e.whiteleftpointingtriangle=9665,e.whitelenticularbracketleft=12310,e.whitelenticularbracketright=12311,e.whiterightpointingsmalltriangle=9657,e.whiterightpointingtriangle=9655,e.whitesmallsquare=9643,e.whitesmilingface=9786,e.whitesquare=9633,e.whitestar=9734,e.whitetelephone=9743,e.whitetortoiseshellbracketleft=12312,e.whitetortoiseshellbracketright=12313,e.whiteuppointingsmalltriangle=9653,e.whiteuppointingtriangle=9651,e.wihiragana=12432,e.wikatakana=12528,e.wikorean=12639,e.wmonospace=65367,e.wohiragana=12434,e.wokatakana=12530,e.wokatakanahalfwidth=65382,e.won=8361,e.wonmonospace=65510,e.wowaenthai=3623,e.wparen=9394,e.wring=7832,e.wsuperior=695,e.wturned=653,e.wynn=447,e.x=120,e.xabovecmb=829,e.xbopomofo=12562,e.xcircle=9447,e.xdieresis=7821,e.xdotaccent=7819,e.xeharmenian=1389,e.xi=958,e.xmonospace=65368,e.xparen=9395,e.xsuperior=739,e.y=121,e.yaadosquare=13134,e.yabengali=2479,e.yacute=253,e.yadeva=2351,e.yaekorean=12626,e.yagujarati=2735,e.yagurmukhi=2607,e.yahiragana=12420,e.yakatakana=12516,e.yakatakanahalfwidth=65428,e.yakorean=12625,e.yamakkanthai=3662,e.yasmallhiragana=12419,e.yasmallkatakana=12515,e.yasmallkatakanahalfwidth=65388,e.yatcyrillic=1123,e.ycircle=9448,e.ycircumflex=375,e.ydieresis=255,e.ydotaccent=7823,e.ydotbelow=7925,e.yeharabic=1610,e.yehbarreearabic=1746,e.yehbarreefinalarabic=64431,e.yehfinalarabic=65266,e.yehhamzaabovearabic=1574,e.yehhamzaabovefinalarabic=65162,e.yehhamzaaboveinitialarabic=65163,e.yehhamzaabovemedialarabic=65164,e.yehinitialarabic=65267,e.yehmedialarabic=65268,e.yehmeeminitialarabic=64733,e.yehmeemisolatedarabic=64600,e.yehnoonfinalarabic=64660,e.yehthreedotsbelowarabic=1745,e.yekorean=12630,e.yen=165,e.yenmonospace=65509,e.yeokorean=12629,e.yeorinhieuhkorean=12678,e.yerahbenyomohebrew=1450,e.yerahbenyomolefthebrew=1450,e.yericyrillic=1099,e.yerudieresiscyrillic=1273,e.yesieungkorean=12673,e.yesieungpansioskorean=12675,e.yesieungsioskorean=12674,e.yetivhebrew=1434,e.ygrave=7923,e.yhook=436,e.yhookabove=7927,e.yiarmenian=1397,e.yicyrillic=1111,e.yikorean=12642,e.yinyang=9775,e.yiwnarmenian=1410,e.ymonospace=65369,e.yod=1497,e.yoddagesh=64313,e.yoddageshhebrew=64313,e.yodhebrew=1497,e.yodyodhebrew=1522,e.yodyodpatahhebrew=64287,e.yohiragana=12424,e.yoikorean=12681,e.yokatakana=12520,e.yokatakanahalfwidth=65430,e.yokorean=12635,e.yosmallhiragana=12423,e.yosmallkatakana=12519,e.yosmallkatakanahalfwidth=65390,e.yotgreek=1011,e.yoyaekorean=12680,e.yoyakorean=12679,e.yoyakthai=3618,e.yoyingthai=3597,e.yparen=9396,e.ypogegrammeni=890,e.ypogegrammenigreekcmb=837,e.yr=422,e.yring=7833,e.ysuperior=696,e.ytilde=7929,e.yturned=654,e.yuhiragana=12422,e.yuikorean=12684,e.yukatakana=12518,e.yukatakanahalfwidth=65429,e.yukorean=12640,e.yusbigcyrillic=1131,e.yusbigiotifiedcyrillic=1133,e.yuslittlecyrillic=1127,e.yuslittleiotifiedcyrillic=1129,e.yusmallhiragana=12421,e.yusmallkatakana=12517,e.yusmallkatakanahalfwidth=65389,e.yuyekorean=12683,e.yuyeokorean=12682,e.yyabengali=2527,e.yyadeva=2399,e.z=122,e.zaarmenian=1382,e.zacute=378,e.zadeva=2395,e.zagurmukhi=2651,e.zaharabic=1592,e.zahfinalarabic=65222,e.zahinitialarabic=65223,e.zahiragana=12374,e.zahmedialarabic=65224,e.zainarabic=1586,e.zainfinalarabic=65200,e.zakatakana=12470,e.zaqefgadolhebrew=1429,e.zaqefqatanhebrew=1428,e.zarqahebrew=1432,e.zayin=1494,e.zayindagesh=64310,e.zayindageshhebrew=64310,e.zayinhebrew=1494,e.zbopomofo=12567,e.zcaron=382,e.zcircle=9449,e.zcircumflex=7825,e.zcurl=657,e.zdot=380,e.zdotaccent=380,e.zdotbelow=7827,e.zecyrillic=1079,e.zedescendercyrillic=1177,e.zedieresiscyrillic=1247,e.zehiragana=12380,e.zekatakana=12476,e.zero=48,e.zeroarabic=1632,e.zerobengali=2534,e.zerodeva=2406,e.zerogujarati=2790,e.zerogurmukhi=2662,e.zerohackarabic=1632,e.zeroinferior=8320,e.zeromonospace=65296,e.zerooldstyle=63280,e.zeropersian=1776,e.zerosuperior=8304,e.zerothai=3664,e.zerowidthjoiner=65279,e.zerowidthnonjoiner=8204,e.zerowidthspace=8203,e.zeta=950,e.zhbopomofo=12563,e.zhearmenian=1386,e.zhebrevecyrillic=1218,e.zhecyrillic=1078,e.zhedescendercyrillic=1175,e.zhedieresiscyrillic=1245,e.zihiragana=12376,e.zikatakana=12472,e.zinorhebrew=1454,e.zlinebelow=7829,e.zmonospace=65370,e.zohiragana=12382,e.zokatakana=12478,e.zparen=9397,e.zretroflexhook=656,e.zstroke=438,e.zuhiragana=12378,e.zukatakana=12474,e[`.notdef`]=0,e.angbracketleftbig=9001,e.angbracketleftBig=9001,e.angbracketleftbigg=9001,e.angbracketleftBigg=9001,e.angbracketrightBig=9002,e.angbracketrightbig=9002,e.angbracketrightBigg=9002,e.angbracketrightbigg=9002,e.arrowhookleft=8618,e.arrowhookright=8617,e.arrowlefttophalf=8636,e.arrowleftbothalf=8637,e.arrownortheast=8599,e.arrownorthwest=8598,e.arrowrighttophalf=8640,e.arrowrightbothalf=8641,e.arrowsoutheast=8600,e.arrowsouthwest=8601,e.backslashbig=8726,e.backslashBig=8726,e.backslashBigg=8726,e.backslashbigg=8726,e.bardbl=8214,e.bracehtipdownleft=65079,e.bracehtipdownright=65079,e.bracehtipupleft=65080,e.bracehtipupright=65080,e.braceleftBig=123,e.braceleftbig=123,e.braceleftbigg=123,e.braceleftBigg=123,e.bracerightBig=125,e.bracerightbig=125,e.bracerightbigg=125,e.bracerightBigg=125,e.bracketleftbig=91,e.bracketleftBig=91,e.bracketleftbigg=91,e.bracketleftBigg=91,e.bracketrightBig=93,e.bracketrightbig=93,e.bracketrightbigg=93,e.bracketrightBigg=93,e.ceilingleftbig=8968,e.ceilingleftBig=8968,e.ceilingleftBigg=8968,e.ceilingleftbigg=8968,e.ceilingrightbig=8969,e.ceilingrightBig=8969,e.ceilingrightbigg=8969,e.ceilingrightBigg=8969,e.circledotdisplay=8857,e.circledottext=8857,e.circlemultiplydisplay=8855,e.circlemultiplytext=8855,e.circleplusdisplay=8853,e.circleplustext=8853,e.contintegraldisplay=8750,e.contintegraltext=8750,e.coproductdisplay=8720,e.coproducttext=8720,e.floorleftBig=8970,e.floorleftbig=8970,e.floorleftbigg=8970,e.floorleftBigg=8970,e.floorrightbig=8971,e.floorrightBig=8971,e.floorrightBigg=8971,e.floorrightbigg=8971,e.hatwide=770,e.hatwider=770,e.hatwidest=770,e.intercal=7488,e.integraldisplay=8747,e.integraltext=8747,e.intersectiondisplay=8898,e.intersectiontext=8898,e.logicalanddisplay=8743,e.logicalandtext=8743,e.logicalordisplay=8744,e.logicalortext=8744,e.parenleftBig=40,e.parenleftbig=40,e.parenleftBigg=40,e.parenleftbigg=40,e.parenrightBig=41,e.parenrightbig=41,e.parenrightBigg=41,e.parenrightbigg=41,e.prime=8242,e.productdisplay=8719,e.producttext=8719,e.radicalbig=8730,e.radicalBig=8730,e.radicalBigg=8730,e.radicalbigg=8730,e.radicalbt=8730,e.radicaltp=8730,e.radicalvertex=8730,e.slashbig=47,e.slashBig=47,e.slashBigg=47,e.slashbigg=47,e.summationdisplay=8721,e.summationtext=8721,e.tildewide=732,e.tildewider=732,e.tildewidest=732,e.uniondisplay=8899,e.unionmultidisplay=8846,e.unionmultitext=8846,e.unionsqdisplay=8852,e.unionsqtext=8852,e.uniontext=8899,e.vextenddouble=8741,e.vextendsingle=8739}),Uo=sr(function(e){e.space=32,e.a1=9985,e.a2=9986,e.a202=9987,e.a3=9988,e.a4=9742,e.a5=9990,e.a119=9991,e.a118=9992,e.a117=9993,e.a11=9755,e.a12=9758,e.a13=9996,e.a14=9997,e.a15=9998,e.a16=9999,e.a105=1e4,e.a17=10001,e.a18=10002,e.a19=10003,e.a20=10004,e.a21=10005,e.a22=10006,e.a23=10007,e.a24=10008,e.a25=10009,e.a26=10010,e.a27=10011,e.a28=10012,e.a6=10013,e.a7=10014,e.a8=10015,e.a9=10016,e.a10=10017,e.a29=10018,e.a30=10019,e.a31=10020,e.a32=10021,e.a33=10022,e.a34=10023,e.a35=9733,e.a36=10025,e.a37=10026,e.a38=10027,e.a39=10028,e.a40=10029,e.a41=10030,e.a42=10031,e.a43=10032,e.a44=10033,e.a45=10034,e.a46=10035,e.a47=10036,e.a48=10037,e.a49=10038,e.a50=10039,e.a51=10040,e.a52=10041,e.a53=10042,e.a54=10043,e.a55=10044,e.a56=10045,e.a57=10046,e.a58=10047,e.a59=10048,e.a60=10049,e.a61=10050,e.a62=10051,e.a63=10052,e.a64=10053,e.a65=10054,e.a66=10055,e.a67=10056,e.a68=10057,e.a69=10058,e.a70=10059,e.a71=9679,e.a72=10061,e.a73=9632,e.a74=10063,e.a203=10064,e.a75=10065,e.a204=10066,e.a76=9650,e.a77=9660,e.a78=9670,e.a79=10070,e.a81=9687,e.a82=10072,e.a83=10073,e.a84=10074,e.a97=10075,e.a98=10076,e.a99=10077,e.a100=10078,e.a101=10081,e.a102=10082,e.a103=10083,e.a104=10084,e.a106=10085,e.a107=10086,e.a108=10087,e.a112=9827,e.a111=9830,e.a110=9829,e.a109=9824,e.a120=9312,e.a121=9313,e.a122=9314,e.a123=9315,e.a124=9316,e.a125=9317,e.a126=9318,e.a127=9319,e.a128=9320,e.a129=9321,e.a130=10102,e.a131=10103,e.a132=10104,e.a133=10105,e.a134=10106,e.a135=10107,e.a136=10108,e.a137=10109,e.a138=10110,e.a139=10111,e.a140=10112,e.a141=10113,e.a142=10114,e.a143=10115,e.a144=10116,e.a145=10117,e.a146=10118,e.a147=10119,e.a148=10120,e.a149=10121,e.a150=10122,e.a151=10123,e.a152=10124,e.a153=10125,e.a154=10126,e.a155=10127,e.a156=10128,e.a157=10129,e.a158=10130,e.a159=10131,e.a160=10132,e.a161=8594,e.a163=8596,e.a164=8597,e.a196=10136,e.a165=10137,e.a192=10138,e.a166=10139,e.a167=10140,e.a168=10141,e.a169=10142,e.a170=10143,e.a171=10144,e.a172=10145,e.a173=10146,e.a162=10147,e.a174=10148,e.a175=10149,e.a176=10150,e.a177=10151,e.a178=10152,e.a179=10153,e.a193=10154,e.a180=10155,e.a199=10156,e.a181=10157,e.a200=10158,e.a182=10159,e.a201=10161,e.a183=10162,e.a184=10163,e.a197=10164,e.a185=10165,e.a194=10166,e.a198=10167,e.a186=10168,e.a195=10169,e.a187=10170,e.a188=10171,e.a189=10172,e.a190=10173,e.a191=10174,e.a89=10088,e.a90=10089,e.a93=10090,e.a94=10091,e.a91=10092,e.a92=10093,e.a205=10094,e.a85=10095,e.a206=10096,e.a86=10097,e.a87=10098,e.a88=10099,e.a95=10100,e.a96=10101,e[`.notdef`]=0}),Wo=sr(function(e){e[63721]=169,e[63193]=169,e[63720]=174,e[63194]=174,e[63722]=8482,e[63195]=8482,e[63729]=9127,e[63730]=9128,e[63731]=9129,e[63740]=9131,e[63741]=9132,e[63742]=9133,e[63726]=9121,e[63727]=9122,e[63728]=9123,e[63737]=9124,e[63738]=9125,e[63739]=9126,e[63723]=9115,e[63724]=9116,e[63725]=9117,e[63734]=9118,e[63735]=9119,e[63736]=9120});function Go(e,t){let n=t[e];if(n!==void 0)return n;if(!e)return-1;if(e[0]===`u`){let t=e.length,r;if(t===7&&e[1]===`n`&&e[2]===`i`)r=e.substring(3);else{if(!(t>=5&&t<=7))return-1;r=e.substring(1)}if(r===r.toUpperCase()&&(n=parseInt(r,16),n>=0))return n}return-1}var Ko=[[0,127],[128,255],[256,383],[384,591],[592,687,7424,7551,7552,7615],[688,767,42752,42783],[768,879,7616,7679],[880,1023],[11392,11519],[1024,1279,1280,1327,11744,11775,42560,42655],[1328,1423],[1424,1535],[42240,42559],[1536,1791,1872,1919],[1984,2047],[2304,2431],[2432,2559],[2560,2687],[2688,2815],[2816,2943],[2944,3071],[3072,3199],[3200,3327],[3328,3455],[3584,3711],[3712,3839],[4256,4351,11520,11567],[6912,7039],[4352,4607],[7680,7935,11360,11391,42784,43007],[7936,8191],[8192,8303,11776,11903],[8304,8351],[8352,8399],[8400,8447],[8448,8527],[8528,8591],[8592,8703,10224,10239,10496,10623,11008,11263],[8704,8959,10752,11007,10176,10223,10624,10751],[8960,9215],[9216,9279],[9280,9311],[9312,9471],[9472,9599],[9600,9631],[9632,9727],[9728,9983],[9984,10175],[12288,12351],[12352,12447],[12448,12543,12784,12799],[12544,12591,12704,12735],[12592,12687],[43072,43135],[12800,13055],[13056,13311],[44032,55215],[55296,57343],[67840,67871],[19968,40959,11904,12031,12032,12255,12272,12287,13312,19903,131072,173791,12688,12703],[57344,63743],[12736,12783,63744,64255,194560,195103],[64256,64335],[64336,65023],[65056,65071],[65040,65055],[65104,65135],[65136,65279],[65280,65519],[65520,65535],[3840,4095],[1792,1871],[1920,1983],[3456,3583],[4096,4255],[4608,4991,4992,5023,11648,11743],[5024,5119],[5120,5759],[5760,5791],[5792,5887],[6016,6143],[6144,6319],[10240,10495],[40960,42127],[5888,5919,5920,5951,5952,5983,5984,6015],[66304,66351],[66352,66383],[66560,66639],[118784,119039,119040,119295,119296,119375],[119808,120831],[1044480,1048573],[65024,65039,917760,917999],[917504,917631],[6400,6479],[6480,6527],[6528,6623],[6656,6687],[11264,11359],[11568,11647],[19904,19967],[43008,43055],[65536,65663,65664,65791,65792,65855],[65856,65935],[66432,66463],[66464,66527],[66640,66687],[66688,66735],[67584,67647],[68096,68191],[119552,119647],[73728,74751,74752,74879],[119648,119679],[7040,7103],[7168,7247],[7248,7295],[43136,43231],[43264,43311],[43312,43359],[43520,43615],[65936,65999],[66e3,66047],[66208,66271,66176,66207,67872,67903],[127024,127135,126976,127023]];function qo(e,t=-1){if(t!==-1){let n=Ko[t];for(let r=0,i=n.length;r<i;r+=2)if(e>=n[r]&&e<=n[r+1])return t}for(let t=0,n=Ko.length;t<n;t++){let n=Ko[t];for(let r=0,i=n.length;r<i;r+=2)if(e>=n[r]&&e<=n[r+1])return t}return-1}var Jo=RegExp(`^(\\s)|(\\p{Mn})|(\\p{Cf})$`,`u`),Yo=new Map,Xo=!0,Zo=1,Qo=2,$o=4,es=32,ts=`.notdef,.null,nonmarkingreturn,space,exclam,quotedbl,numbersign,dollar,percent,ampersand,quotesingle,parenleft,parenright,asterisk,plus,comma,hyphen,period,slash,zero,one,two,three,four,five,six,seven,eight,nine,colon,semicolon,less,equal,greater,question,at,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,bracketleft,backslash,bracketright,asciicircum,underscore,grave,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,braceleft,bar,braceright,asciitilde,Adieresis,Aring,Ccedilla,Eacute,Ntilde,Odieresis,Udieresis,aacute,agrave,acircumflex,adieresis,atilde,aring,ccedilla,eacute,egrave,ecircumflex,edieresis,iacute,igrave,icircumflex,idieresis,ntilde,oacute,ograve,ocircumflex,odieresis,otilde,uacute,ugrave,ucircumflex,udieresis,dagger,degree,cent,sterling,section,bullet,paragraph,germandbls,registered,copyright,trademark,acute,dieresis,notequal,AE,Oslash,infinity,plusminus,lessequal,greaterequal,yen,mu,partialdiff,summation,product,pi,integral,ordfeminine,ordmasculine,Omega,ae,oslash,questiondown,exclamdown,logicalnot,radical,florin,approxequal,Delta,guillemotleft,guillemotright,ellipsis,nonbreakingspace,Agrave,Atilde,Otilde,OE,oe,endash,emdash,quotedblleft,quotedblright,quoteleft,quoteright,divide,lozenge,ydieresis,Ydieresis,fraction,currency,guilsinglleft,guilsinglright,fi,fl,daggerdbl,periodcentered,quotesinglbase,quotedblbase,perthousand,Acircumflex,Ecircumflex,Aacute,Edieresis,Egrave,Iacute,Icircumflex,Idieresis,Igrave,Oacute,Ocircumflex,apple,Ograve,Uacute,Ucircumflex,Ugrave,dotlessi,circumflex,tilde,macron,breve,dotaccent,ring,cedilla,hungarumlaut,ogonek,caron,Lslash,lslash,Scaron,scaron,Zcaron,zcaron,brokenbar,Eth,eth,Yacute,yacute,Thorn,thorn,minus,multiply,onesuperior,twosuperior,threesuperior,onehalf,onequarter,threequarters,franc,Gbreve,gbreve,Idotaccent,Scedilla,scedilla,Cacute,cacute,Ccaron,ccaron,dcroat`.split(`,`);function ns(e,t){if(t[e]!==void 0)return e;let n=Go(e,t);if(n!==-1){for(let e in t)if(t[e]===n)return e}return hn(`Unable to recover a standard glyph name for: `+e),e}function rs(e,t,n){let r=Object.create(null),i,a,o,s=!!(e.flags&$o);if(e.isInternalFont)for(o=t,a=0;a<o.length;a++)i=n.indexOf(o[a]),r[a]=i>=0?i:0;else if(e.baseEncodingName)for(o=Vo(e.baseEncodingName),a=0;a<o.length;a++)i=n.indexOf(o[a]),r[a]=i>=0?i:0;else if(s)for(a in t)r[a]=t[a];else for(o=Lo,a=0;a<o.length;a++)i=n.indexOf(o[a]),r[a]=i>=0?i:0;let c=e.differences,l;if(c)for(a in c){let e=c[a];if(i=n.indexOf(e),i===-1){l||=Ho();let t=ns(e,l);t!==e&&(i=n.indexOf(t))}r[a]=i>=0?i:0}return r}function is(e){return e.replaceAll(/[,_]/g,`-`).replaceAll(/\s/g,``)}var as=sr(e=>{e[8211]=65074,e[8212]=65073,e[8229]=65072,e[8230]=65049,e[12289]=65041,e[12290]=65042,e[12296]=65087,e[12297]=65088,e[12298]=65085,e[12299]=65086,e[12300]=65089,e[12301]=65090,e[12302]=65091,e[12303]=65092,e[12304]=65083,e[12305]=65084,e[12308]=65081,e[12309]=65082,e[12310]=65047,e[12311]=65048,e[65103]=65076,e[65281]=65045,e[65288]=65077,e[65289]=65078,e[65292]=65040,e[65306]=65043,e[65307]=65044,e[65311]=65046,e[65339]=65095,e[65341]=65096,e[65343]=65075,e[65371]=65079,e[65373]=65080}),os=`.notdef,space,exclam,quotedbl,numbersign,dollar,percent,ampersand,quoteright,parenleft,parenright,asterisk,plus,comma,hyphen,period,slash,zero,one,two,three,four,five,six,seven,eight,nine,colon,semicolon,less,equal,greater,question,at,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,bracketleft,backslash,bracketright,asciicircum,underscore,quoteleft,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,braceleft,bar,braceright,asciitilde,exclamdown,cent,sterling,fraction,yen,florin,section,currency,quotesingle,quotedblleft,guillemotleft,guilsinglleft,guilsinglright,fi,fl,endash,dagger,daggerdbl,periodcentered,paragraph,bullet,quotesinglbase,quotedblbase,quotedblright,guillemotright,ellipsis,perthousand,questiondown,grave,acute,circumflex,tilde,macron,breve,dotaccent,dieresis,ring,cedilla,hungarumlaut,ogonek,caron,emdash,AE,ordfeminine,Lslash,Oslash,OE,ordmasculine,ae,dotlessi,lslash,oslash,oe,germandbls,onesuperior,logicalnot,mu,trademark,Eth,onehalf,plusminus,Thorn,onequarter,divide,brokenbar,degree,thorn,threequarters,twosuperior,registered,minus,eth,multiply,threesuperior,copyright,Aacute,Acircumflex,Adieresis,Agrave,Aring,Atilde,Ccedilla,Eacute,Ecircumflex,Edieresis,Egrave,Iacute,Icircumflex,Idieresis,Igrave,Ntilde,Oacute,Ocircumflex,Odieresis,Ograve,Otilde,Scaron,Uacute,Ucircumflex,Udieresis,Ugrave,Yacute,Ydieresis,Zcaron,aacute,acircumflex,adieresis,agrave,aring,atilde,ccedilla,eacute,ecircumflex,edieresis,egrave,iacute,icircumflex,idieresis,igrave,ntilde,oacute,ocircumflex,odieresis,ograve,otilde,scaron,uacute,ucircumflex,udieresis,ugrave,yacute,ydieresis,zcaron`.split(`,`),ss=`.notdef,space,exclamsmall,Hungarumlautsmall,dollaroldstyle,dollarsuperior,ampersandsmall,Acutesmall,parenleftsuperior,parenrightsuperior,twodotenleader,onedotenleader,comma,hyphen,period,fraction,zerooldstyle,oneoldstyle,twooldstyle,threeoldstyle,fouroldstyle,fiveoldstyle,sixoldstyle,sevenoldstyle,eightoldstyle,nineoldstyle,colon,semicolon,commasuperior,threequartersemdash,periodsuperior,questionsmall,asuperior,bsuperior,centsuperior,dsuperior,esuperior,isuperior,lsuperior,msuperior,nsuperior,osuperior,rsuperior,ssuperior,tsuperior,ff,fi,fl,ffi,ffl,parenleftinferior,parenrightinferior,Circumflexsmall,hyphensuperior,Gravesmall,Asmall,Bsmall,Csmall,Dsmall,Esmall,Fsmall,Gsmall,Hsmall,Ismall,Jsmall,Ksmall,Lsmall,Msmall,Nsmall,Osmall,Psmall,Qsmall,Rsmall,Ssmall,Tsmall,Usmall,Vsmall,Wsmall,Xsmall,Ysmall,Zsmall,colonmonetary,onefitted,rupiah,Tildesmall,exclamdownsmall,centoldstyle,Lslashsmall,Scaronsmall,Zcaronsmall,Dieresissmall,Brevesmall,Caronsmall,Dotaccentsmall,Macronsmall,figuredash,hypheninferior,Ogoneksmall,Ringsmall,Cedillasmall,onequarter,onehalf,threequarters,questiondownsmall,oneeighth,threeeighths,fiveeighths,seveneighths,onethird,twothirds,zerosuperior,onesuperior,twosuperior,threesuperior,foursuperior,fivesuperior,sixsuperior,sevensuperior,eightsuperior,ninesuperior,zeroinferior,oneinferior,twoinferior,threeinferior,fourinferior,fiveinferior,sixinferior,seveninferior,eightinferior,nineinferior,centinferior,dollarinferior,periodinferior,commainferior,Agravesmall,Aacutesmall,Acircumflexsmall,Atildesmall,Adieresissmall,Aringsmall,AEsmall,Ccedillasmall,Egravesmall,Eacutesmall,Ecircumflexsmall,Edieresissmall,Igravesmall,Iacutesmall,Icircumflexsmall,Idieresissmall,Ethsmall,Ntildesmall,Ogravesmall,Oacutesmall,Ocircumflexsmall,Otildesmall,Odieresissmall,OEsmall,Oslashsmall,Ugravesmall,Uacutesmall,Ucircumflexsmall,Udieresissmall,Yacutesmall,Thornsmall,Ydieresissmall`.split(`,`),cs=`.notdef,space,dollaroldstyle,dollarsuperior,parenleftsuperior,parenrightsuperior,twodotenleader,onedotenleader,comma,hyphen,period,fraction,zerooldstyle,oneoldstyle,twooldstyle,threeoldstyle,fouroldstyle,fiveoldstyle,sixoldstyle,sevenoldstyle,eightoldstyle,nineoldstyle,colon,semicolon,commasuperior,threequartersemdash,periodsuperior,asuperior,bsuperior,centsuperior,dsuperior,esuperior,isuperior,lsuperior,msuperior,nsuperior,osuperior,rsuperior,ssuperior,tsuperior,ff,fi,fl,ffi,ffl,parenleftinferior,parenrightinferior,hyphensuperior,colonmonetary,onefitted,rupiah,centoldstyle,figuredash,hypheninferior,onequarter,onehalf,threequarters,oneeighth,threeeighths,fiveeighths,seveneighths,onethird,twothirds,zerosuperior,onesuperior,twosuperior,threesuperior,foursuperior,fivesuperior,sixsuperior,sevensuperior,eightsuperior,ninesuperior,zeroinferior,oneinferior,twoinferior,threeinferior,fourinferior,fiveinferior,sixinferior,seveninferior,eightinferior,nineinferior,centinferior,dollarinferior,periodinferior,commainferior`.split(`,`),ls=`.notdef,space,exclam,quotedbl,numbersign,dollar,percent,ampersand,quoteright,parenleft,parenright,asterisk,plus,comma,hyphen,period,slash,zero,one,two,three,four,five,six,seven,eight,nine,colon,semicolon,less,equal,greater,question,at,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,bracketleft,backslash,bracketright,asciicircum,underscore,quoteleft,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,braceleft,bar,braceright,asciitilde,exclamdown,cent,sterling,fraction,yen,florin,section,currency,quotesingle,quotedblleft,guillemotleft,guilsinglleft,guilsinglright,fi,fl,endash,dagger,daggerdbl,periodcentered,paragraph,bullet,quotesinglbase,quotedblbase,quotedblright,guillemotright,ellipsis,perthousand,questiondown,grave,acute,circumflex,tilde,macron,breve,dotaccent,dieresis,ring,cedilla,hungarumlaut,ogonek,caron,emdash,AE,ordfeminine,Lslash,Oslash,OE,ordmasculine,ae,dotlessi,lslash,oslash,oe,germandbls,onesuperior,logicalnot,mu,trademark,Eth,onehalf,plusminus,Thorn,onequarter,divide,brokenbar,degree,thorn,threequarters,twosuperior,registered,minus,eth,multiply,threesuperior,copyright,Aacute,Acircumflex,Adieresis,Agrave,Aring,Atilde,Ccedilla,Eacute,Ecircumflex,Edieresis,Egrave,Iacute,Icircumflex,Idieresis,Igrave,Ntilde,Oacute,Ocircumflex,Odieresis,Ograve,Otilde,Scaron,Uacute,Ucircumflex,Udieresis,Ugrave,Yacute,Ydieresis,Zcaron,aacute,acircumflex,adieresis,agrave,aring,atilde,ccedilla,eacute,ecircumflex,edieresis,egrave,iacute,icircumflex,idieresis,igrave,ntilde,oacute,ocircumflex,odieresis,ograve,otilde,scaron,uacute,ucircumflex,udieresis,ugrave,yacute,ydieresis,zcaron,exclamsmall,Hungarumlautsmall,dollaroldstyle,dollarsuperior,ampersandsmall,Acutesmall,parenleftsuperior,parenrightsuperior,twodotenleader,onedotenleader,zerooldstyle,oneoldstyle,twooldstyle,threeoldstyle,fouroldstyle,fiveoldstyle,sixoldstyle,sevenoldstyle,eightoldstyle,nineoldstyle,commasuperior,threequartersemdash,periodsuperior,questionsmall,asuperior,bsuperior,centsuperior,dsuperior,esuperior,isuperior,lsuperior,msuperior,nsuperior,osuperior,rsuperior,ssuperior,tsuperior,ff,ffi,ffl,parenleftinferior,parenrightinferior,Circumflexsmall,hyphensuperior,Gravesmall,Asmall,Bsmall,Csmall,Dsmall,Esmall,Fsmall,Gsmall,Hsmall,Ismall,Jsmall,Ksmall,Lsmall,Msmall,Nsmall,Osmall,Psmall,Qsmall,Rsmall,Ssmall,Tsmall,Usmall,Vsmall,Wsmall,Xsmall,Ysmall,Zsmall,colonmonetary,onefitted,rupiah,Tildesmall,exclamdownsmall,centoldstyle,Lslashsmall,Scaronsmall,Zcaronsmall,Dieresissmall,Brevesmall,Caronsmall,Dotaccentsmall,Macronsmall,figuredash,hypheninferior,Ogoneksmall,Ringsmall,Cedillasmall,questiondownsmall,oneeighth,threeeighths,fiveeighths,seveneighths,onethird,twothirds,zerosuperior,foursuperior,fivesuperior,sixsuperior,sevensuperior,eightsuperior,ninesuperior,zeroinferior,oneinferior,twoinferior,threeinferior,fourinferior,fiveinferior,sixinferior,seveninferior,eightinferior,nineinferior,centinferior,dollarinferior,periodinferior,commainferior,Agravesmall,Aacutesmall,Acircumflexsmall,Atildesmall,Adieresissmall,Aringsmall,AEsmall,Ccedillasmall,Egravesmall,Eacutesmall,Ecircumflexsmall,Edieresissmall,Igravesmall,Iacutesmall,Icircumflexsmall,Idieresissmall,Ethsmall,Ntildesmall,Ogravesmall,Oacutesmall,Ocircumflexsmall,Otildesmall,Odieresissmall,OEsmall,Oslashsmall,Ugravesmall,Uacutesmall,Ucircumflexsmall,Udieresissmall,Yacutesmall,Thornsmall,Ydieresissmall,001.000,001.001,001.002,001.003,Black,Bold,Book,Light,Medium,Regular,Roman,Semibold`.split(`,`),us=391,ds=[null,{id:`hstem`,min:2,stackClearing:!0,stem:!0},null,{id:`vstem`,min:2,stackClearing:!0,stem:!0},{id:`vmoveto`,min:1,stackClearing:!0},{id:`rlineto`,min:2,resetStack:!0},{id:`hlineto`,min:1,resetStack:!0},{id:`vlineto`,min:1,resetStack:!0},{id:`rrcurveto`,min:6,resetStack:!0},null,{id:`callsubr`,min:1,undefStack:!0},{id:`return`,min:0,undefStack:!0},null,null,{id:`endchar`,min:0,stackClearing:!0},null,null,null,{id:`hstemhm`,min:2,stackClearing:!0,stem:!0},{id:`hintmask`,min:0,stackClearing:!0},{id:`cntrmask`,min:0,stackClearing:!0},{id:`rmoveto`,min:2,stackClearing:!0},{id:`hmoveto`,min:1,stackClearing:!0},{id:`vstemhm`,min:2,stackClearing:!0,stem:!0},{id:`rcurveline`,min:8,resetStack:!0},{id:`rlinecurve`,min:8,resetStack:!0},{id:`vvcurveto`,min:4,resetStack:!0},{id:`hhcurveto`,min:4,resetStack:!0},null,{id:`callgsubr`,min:1,undefStack:!0},{id:`vhcurveto`,min:4,resetStack:!0},{id:`hvcurveto`,min:4,resetStack:!0}],fs=[null,null,null,{id:`and`,min:2,stackDelta:-1},{id:`or`,min:2,stackDelta:-1},{id:`not`,min:1,stackDelta:0},null,null,null,{id:`abs`,min:1,stackDelta:0},{id:`add`,min:2,stackDelta:-1,stackFn(e,t){e[t-2]=e[t-2]+e[t-1]}},{id:`sub`,min:2,stackDelta:-1,stackFn(e,t){e[t-2]=e[t-2]-e[t-1]}},{id:`div`,min:2,stackDelta:-1,stackFn(e,t){e[t-2]=e[t-2]/e[t-1]}},null,{id:`neg`,min:1,stackDelta:0,stackFn(e,t){e[t-1]=-e[t-1]}},{id:`eq`,min:2,stackDelta:-1},null,null,{id:`drop`,min:1,stackDelta:-1},null,{id:`put`,min:2,stackDelta:-2},{id:`get`,min:1,stackDelta:0},{id:`ifelse`,min:4,stackDelta:-3},{id:`random`,min:0,stackDelta:1},{id:`mul`,min:2,stackDelta:-1,stackFn(e,t){e[t-2]=e[t-2]*e[t-1]}},null,{id:`sqrt`,min:1,stackDelta:0},{id:`dup`,min:1,stackDelta:1},{id:`exch`,min:2,stackDelta:0},{id:`index`,min:2,stackDelta:0},{id:`roll`,min:3,stackDelta:-2},null,null,null,{id:`hflex`,min:7,resetStack:!0},{id:`flex`,min:13,resetStack:!0},{id:`hflex1`,min:9,resetStack:!0},{id:`flex1`,min:11,resetStack:!0}],ps=class{constructor(e,t,n){this.bytes=e.getBytes(),this.properties=t,this.seacAnalysisEnabled=!!n}parse(){let e=this.properties,t=new ms;this.cff=t;let n=this.parseHeader(),r=this.parseIndex(n.endPos),i=this.parseIndex(r.endPos),a=this.parseIndex(i.endPos),o=this.parseIndex(a.endPos),s=this.parseDict(i.obj.get(0)),c=this.createDict(bs,s,t.strings);t.header=n.obj,t.names=this.parseNameIndex(r.obj),t.strings=this.parseStringIndex(a.obj),t.topDict=c,t.globalSubrIndex=o.obj,this.parsePrivateDict(t.topDict),t.isCIDFont=c.hasName(`ROS`);let l=c.getByName(`CharStrings`),u=this.parseIndex(l).obj,d=c.getByName(`FontMatrix`);d&&(e.fontMatrix=d);let f=c.getByName(`FontBBox`),p,m;if(f&&(e.ascent=Math.max(f[3],f[1]),e.descent=Math.min(f[1],f[3]),e.ascentScaled=!0),t.isCIDFont){let e=this.parseIndex(c.getByName(`FDArray`)).obj;for(let n=0,r=e.count;n<r;++n){let r=e.get(n),i=this.createDict(bs,this.parseDict(r),t.strings);this.parsePrivateDict(i),t.fdArray.push(i)}m=null,p=this.parseCharsets(c.getByName(`charset`),u.count,t.strings,!0),t.fdSelect=this.parseFDSelect(c.getByName(`FDSelect`),u.count)}else p=this.parseCharsets(c.getByName(`charset`),u.count,t.strings,!1),m=this.parseEncoding(c.getByName(`Encoding`),e,t.strings,p.charset);t.charset=p,t.encoding=m;let h=this.parseCharStrings({charStrings:u,localSubrIndex:c.privateDict.subrsIndex,globalSubrIndex:o.obj,fdSelect:t.fdSelect,fdArray:t.fdArray,privateDict:c.privateDict});return t.charStrings=h.charStrings,t.seacs=h.seacs,t.widths=h.widths,t}parseHeader(){let e=this.bytes,t=e.length,n=0;for(;n<t&&e[n]!==1;)++n;if(n>=t)throw new F(`Invalid CFF header`);n!==0&&(hn(`cff data is shifted`),e=e.subarray(n),this.bytes=e);let r=e[0],i=e[1],a=e[2],o=e[3];return{obj:new hs(r,i,a,o),endPos:a}}parseDict(e){let t=0;function n(){let n=e[t++];return n===30?function(){let n=``,r=[`0`,`1`,`2`,`3`,`4`,`5`,`6`,`7`,`8`,`9`,`.`,`E`,`E-`,null,`-`],i=e.length;for(;t<i;){let i=e[t++],a=i>>4,o=15&i;if(a===15||(n+=r[a],o===15))break;n+=r[o]}return parseFloat(n)}():n===28?(n=yr(e,t),t+=2,n):n===29?(n=e[t++],n=n<<8|e[t++],n=n<<8|e[t++],n=n<<8|e[t++],n):n>=32&&n<=246?n-139:n>=247&&n<=250?256*(n-247)+e[t++]+108:n>=251&&n<=254?-256*(n-251)-e[t++]-108:(N(`CFFParser_parseDict: "`+n+`" is a reserved command.`),NaN)}let r=[],i=[];t=0;let a=e.length;for(;t<a;){let a=e[t];a<=21?(a===12&&(a=a<<8|e[++t]),i.push([a,r]),r=[],++t):r.push(n())}return i}parseIndex(e){let t=new _s,n=this.bytes,r=n[e++]<<8|n[e++],i=[],a,o,s=e;if(r!==0){let t=n[e++],c=e+(r+1)*t-1;for(a=0,o=r+1;a<o;++a){let r=0;for(let i=0;i<t;++i)r<<=8,r+=n[e++];i.push(c+r)}s=i[r]}for(a=0,o=i.length-1;a<o;++a){let e=i[a],r=i[a+1];t.add(n.subarray(e,r))}return{obj:t,endPos:s}}parseNameIndex(e){let t=[];for(let n=0,r=e.count;n<r;++n){let r=e.get(n);t.push(Tn(r))}return t}parseStringIndex(e){let t=new gs;for(let n=0,r=e.count;n<r;++n){let r=e.get(n);t.add(Tn(r))}return t}createDict(e,t,n){let r=new e(n);for(let[e,n]of t)r.setByKey(e,n);return r}parseCharString(e,t,n,r){if(!t||e.callDepth>10)return!1;let i=e.stackSize,a=e.stack,o=t.length;for(let s=0;s<o;){let c=t[s++],l=null;if(c===12){let e=t[s++];e===0?(t[s-2]=139,t[s-1]=22,i=0):l=fs[e]}else if(c===28)a[i]=yr(t,s),s+=2,i++;else if(c===14){if(i>=4&&(i-=4,this.seacAnalysisEnabled))return e.seac=a.slice(i,i+4),!1;l=ds[c]}else if(c>=32&&c<=246)a[i]=c-139,i++;else if(c>=247&&c<=254)a[i]=c<251?(c-247<<8)+t[s]+108:-(c-251<<8)-t[s]-108,s++,i++;else if(c===255)a[i]=(t[s]<<24|t[s+1]<<16|t[s+2]<<8|t[s+3])/65536,s+=4,i++;else if(c===19||c===20){if(e.hints+=i>>1,e.hints===0){t.copyWithin(s-1,s,-1),--s,--o;continue}s+=e.hints+7>>3,i%=2,l=ds[c]}else{if(c===10||c===29){let t=c===10?n:r;if(!t)return l=ds[c],N(`Missing subrsIndex for `+l.id),!1;let o=32768;t.count<1240?o=107:t.count<33900&&(o=1131);let s=a[--i]+o;if(s<0||s>=t.count||isNaN(s))return l=ds[c],N(`Out of bounds subrIndex for `+l.id),!1;if(e.stackSize=i,e.callDepth++,!this.parseCharString(e,t.get(s),n,r))return!1;e.callDepth--,i=e.stackSize;continue}if(c===11)return e.stackSize=i,!0;if(c===0&&s===t.length)t[s-1]=14,l=ds[14];else{if(c===9){t.copyWithin(s-1,s,-1),--s,--o;continue}l=ds[c]}}if(l){if(l.stem&&(e.hints+=i>>1,c===3||c===23?e.hasVStems=!0:!e.hasVStems||c!==1&&c!==18||(N(`CFF stem hints are in wrong order`),t[s-1]=c===1?3:23)),`min`in l&&!e.undefStack&&i<l.min)return N(`Not enough parameters for `+l.id+`; actual: `+i+`, expected: `+l.min),i===0&&(t[s-1]=14,!0);e.firstStackClearing&&l.stackClearing&&(e.firstStackClearing=!1,i-=l.min,i>=2&&l.stem?i%=2:i>1&&N(`Found too many parameters for stack-clearing command`),i>0&&(e.width=a[i-1])),`stackDelta`in l?(`stackFn`in l&&l.stackFn(a,i),i+=l.stackDelta):l.stackClearing?i=0:l.resetStack?(i=0,e.undefStack=!1):l.undefStack&&(i=0,e.undefStack=!0,e.firstStackClearing=!1)}}return o<t.length&&t.fill(14,o),e.stackSize=i,!0}parseCharStrings({charStrings:e,localSubrIndex:t,globalSubrIndex:n,fdSelect:r,fdArray:i,privateDict:a}){let o=[],s=[],c=e.count;for(let l=0;l<c;l++){let c=e.get(l),u={callDepth:0,stackSize:0,stack:[],undefStack:!0,hints:0,firstStackClearing:!0,seac:null,width:null,hasVStems:!1},d=!0,f=null,p=a;if(r&&i.length){let e=r.getFDIndex(l);e===-1&&(N(`Glyph index is not in fd select.`),d=!1),e>=i.length&&(N(`Invalid fd index for glyph index.`),d=!1),d&&(p=i[e].privateDict,f=p.subrsIndex)}else t&&(f=t);d&&=this.parseCharString(u,c,f,n),u.width===null?s[l]=p.getByName(`defaultWidthX`):s[l]=p.getByName(`nominalWidthX`)+u.width,u.seac!==null&&(o[l]=u.seac),d||e.set(l,new Uint8Array([14]))}return{charStrings:e,seacs:o,widths:s}}emptyPrivateDictionary(e){let t=this.createDict(Ss,[],e.strings);e.setByKey(18,[0,0]),e.privateDict=t}parsePrivateDict(e){if(!e.hasName(`Private`))return void this.emptyPrivateDictionary(e);let t=e.getByName(`Private`);if(!Array.isArray(t)||t.length!==2)return void e.removeByName(`Private`);let n=t[0],r=t[1];if(n===0||r>=this.bytes.length)return void this.emptyPrivateDictionary(e);let i=r+n,a=this.bytes.subarray(r,i),o=this.parseDict(a),s=this.createDict(Ss,o,e.strings);if(e.privateDict=s,s.getByName(`ExpansionFactor`)===0&&s.setByName(`ExpansionFactor`,.06),!s.getByName(`Subrs`))return;let c=s.getByName(`Subrs`),l=r+c;if(c===0||l>=this.bytes.length)return void this.emptyPrivateDictionary(e);s.subrsIndex=this.parseIndex(l).obj}parseCharsets(e,t,n,r){if(e===0)return new ws(!0,Cs.ISO_ADOBE,os);if(e===1)return new ws(!0,Cs.EXPERT,ss);if(e===2)return new ws(!0,Cs.EXPERT_SUBSET,cs);let i=this.bytes,a=e,o=i[e++],s=[r?0:`.notdef`],c,l,u;switch(--t,o){case 0:for(u=0;u<t;u++)c=i[e++]<<8|i[e++],s.push(r?c:n.get(c));break;case 1:for(;s.length<=t;)for(c=i[e++]<<8|i[e++],l=i[e++],u=0;u<=l;u++)s.push(r?c++:n.get(c++));break;case 2:for(;s.length<=t;)for(c=i[e++]<<8|i[e++],l=i[e++]<<8|i[e++],u=0;u<=l;u++)s.push(r?c++:n.get(c++));break;default:throw new F(`Unknown charset format`)}let d=e;return new ws(!1,o,s,i.subarray(a,d))}parseEncoding(e,t,n,r){let i=Object.create(null),a=this.bytes,o,s,c,l=!1,u=null;if(e===0||e===1){l=!0,o=e;let t=e?Po:Lo;for(s=0,c=r.length;s<c;s++){let e=t.indexOf(r[s]);e!==-1&&(i[e]=s)}}else{let t=e;switch(o=a[e++],127&o){case 0:let t=a[e++];for(s=1;s<=t;s++)i[a[e++]]=s;break;case 1:let n=a[e++],r=1;for(s=0;s<n;s++){let t=a[e++],n=a[e++];for(let e=t;e<=t+n;e++)i[e]=r++}break;default:throw new F(`Unknown encoding format: ${o} in CFF`)}let c=e;128&o&&(a[t]&=127,function(){let t=a[e++];for(s=0;s<t;s++){let t=a[e++],o=(a[e++]<<8)+(255&a[e++]);i[t]=r.indexOf(n.get(o))}}()),u=a.subarray(t,c)}return o&=127,new Ts(l,o,i,u)}parseFDSelect(e,t){let n=this.bytes,r=n[e++],i=[],a;switch(r){case 0:for(a=0;a<t;++a){let t=n[e++];i.push(t)}break;case 3:let o=n[e++]<<8|n[e++];for(a=0;a<o;++a){let t=n[e++]<<8|n[e++];a===0&&t!==0&&(N(`parseFDSelect: The first range must have a first GID of 0 -- trying to recover.`),t=0);let r=n[e++],o=n[e]<<8|n[e+1];for(let e=t;e<o;++e)i.push(r)}e+=2;break;default:throw new F(`parseFDSelect: Unknown format "${r}".`)}if(i.length!==t)throw new F(`parseFDSelect: Invalid font data.`);return new Es(r,i)}},ms=class{constructor(){this.header=null,this.names=[],this.topDict=null,this.strings=new gs,this.globalSubrIndex=null,this.encoding=null,this.charset=null,this.charStrings=null,this.fdArray=[],this.fdSelect=null,this.isCIDFont=!1}duplicateFirstGlyph(){if(this.charStrings.count>=65535)return void N(`Not enough space in charstrings to duplicate first glyph.`);let e=this.charStrings.get(0);this.charStrings.add(e),this.isCIDFont&&this.fdSelect.fdSelect.push(this.fdSelect.fdSelect[0])}hasGlyphId(e){return e<0||e>=this.charStrings.count?!1:this.charStrings.get(e).length>0}},hs=class{constructor(e,t,n,r){this.major=e,this.minor=t,this.hdrSize=n,this.offSize=r}},gs=class{constructor(){this.strings=[]}get(e){return e>=0&&e<=390?ls[e]:e-us<=this.strings.length?this.strings[e-us]:ls[0]}getSID(e){let t=ls.indexOf(e);return t===-1?(t=this.strings.indexOf(e),t===-1?-1:t+us):t}add(e){this.strings.push(e)}get count(){return this.strings.length}},_s=class{constructor(){this.objects=[],this.length=0}add(e){this.length+=e.length,this.objects.push(e)}set(e,t){this.length+=t.length-this.objects[e].length,this.objects[e]=t}get(e){return this.objects[e]}get count(){return this.objects.length}},vs=class{constructor(e,t){this.keyToNameMap=e.keyToNameMap,this.nameToKeyMap=e.nameToKeyMap,this.defaults=e.defaults,this.types=e.types,this.opcodes=e.opcodes,this.order=e.order,this.strings=t,this.values=Object.create(null)}setByKey(e,t){if(!(e in this.keyToNameMap))return!1;if(t.length===0)return!0;for(let n of t)if(isNaN(n))return N(`Invalid CFFDict value: "${t}" for key "${e}".`),!0;let n=this.types[e];return n!==`num`&&n!==`sid`&&n!==`offset`||(t=t[0]),this.values[e]=t,!0}setByName(e,t){if(!(e in this.nameToKeyMap))throw new F(`Invalid dictionary name "${e}"`);this.values[this.nameToKeyMap[e]]=t}hasName(e){return this.nameToKeyMap[e]in this.values}getByName(e){if(!(e in this.nameToKeyMap))throw new F(`Invalid dictionary name ${e}"`);let t=this.nameToKeyMap[e];return t in this.values?this.values[t]:this.defaults[t]}removeByName(e){delete this.values[this.nameToKeyMap[e]]}static createTables(e){let t={keyToNameMap:{},nameToKeyMap:{},defaults:{},types:{},opcodes:{},order:[]};for(let n of e){let e=Array.isArray(n[0])?(n[0][0]<<8)+n[0][1]:n[0];t.keyToNameMap[e]=n[1],t.nameToKeyMap[n[1]]=e,t.types[e]=n[2],t.defaults[e]=n[3],t.opcodes[e]=Array.isArray(n[0])?n[0]:[n[0]],t.order.push(e)}return t}},ys=[[[12,30],`ROS`,[`sid`,`sid`,`num`],null],[[12,20],`SyntheticBase`,`num`,null],[0,`version`,`sid`,null],[1,`Notice`,`sid`,null],[[12,0],`Copyright`,`sid`,null],[2,`FullName`,`sid`,null],[3,`FamilyName`,`sid`,null],[4,`Weight`,`sid`,null],[[12,1],`isFixedPitch`,`num`,0],[[12,2],`ItalicAngle`,`num`,0],[[12,3],`UnderlinePosition`,`num`,-100],[[12,4],`UnderlineThickness`,`num`,50],[[12,5],`PaintType`,`num`,0],[[12,6],`CharstringType`,`num`,2],[[12,7],`FontMatrix`,[`num`,`num`,`num`,`num`,`num`,`num`],[.001,0,0,.001,0,0]],[13,`UniqueID`,`num`,null],[5,`FontBBox`,[`num`,`num`,`num`,`num`],[0,0,0,0]],[[12,8],`StrokeWidth`,`num`,0],[14,`XUID`,`array`,null],[15,`charset`,`offset`,0],[16,`Encoding`,`offset`,0],[17,`CharStrings`,`offset`,0],[18,`Private`,[`offset`,`offset`],null],[[12,21],`PostScript`,`sid`,null],[[12,22],`BaseFontName`,`sid`,null],[[12,23],`BaseFontBlend`,`delta`,null],[[12,31],`CIDFontVersion`,`num`,0],[[12,32],`CIDFontRevision`,`num`,0],[[12,33],`CIDFontType`,`num`,0],[[12,34],`CIDCount`,`num`,8720],[[12,35],`UIDBase`,`num`,null],[[12,37],`FDSelect`,`offset`,null],[[12,36],`FDArray`,`offset`,null],[[12,38],`FontName`,`sid`,null]],bs=class e extends vs{static get tables(){return P(this,`tables`,this.createTables(ys))}constructor(t){super(e.tables,t),this.privateDict=null}},xs=[[6,`BlueValues`,`delta`,null],[7,`OtherBlues`,`delta`,null],[8,`FamilyBlues`,`delta`,null],[9,`FamilyOtherBlues`,`delta`,null],[[12,9],`BlueScale`,`num`,.039625],[[12,10],`BlueShift`,`num`,7],[[12,11],`BlueFuzz`,`num`,1],[10,`StdHW`,`num`,null],[11,`StdVW`,`num`,null],[[12,12],`StemSnapH`,`delta`,null],[[12,13],`StemSnapV`,`delta`,null],[[12,14],`ForceBold`,`num`,0],[[12,17],`LanguageGroup`,`num`,0],[[12,18],`ExpansionFactor`,`num`,.06],[[12,19],`initialRandomSeed`,`num`,0],[20,`defaultWidthX`,`num`,0],[21,`nominalWidthX`,`num`,0],[19,`Subrs`,`offset`,null]],Ss=class e extends vs{static get tables(){return P(this,`tables`,this.createTables(xs))}constructor(t){super(e.tables,t),this.subrsIndex=null}},Cs={ISO_ADOBE:0,EXPERT:1,EXPERT_SUBSET:2},ws=class{constructor(e,t,n,r){this.predefined=e,this.format=t,this.charset=n,this.raw=r}},Ts=class{constructor(e,t,n,r){this.predefined=e,this.format=t,this.encoding=n,this.raw=r}},Es=class{constructor(e,t){this.format=e,this.fdSelect=t}getFDIndex(e){return e<0||e>=this.fdSelect.length?-1:this.fdSelect[e]}},Ds=class{constructor(){this.offsets=Object.create(null)}isTracking(e){return e in this.offsets}track(e,t){if(e in this.offsets)throw new F(`Already tracking location of ${e}`);this.offsets[e]=t}offset(e){for(let t in this.offsets)this.offsets[t]+=e}setEntryLocation(e,t,n){if(!(e in this.offsets))throw new F(`Not tracking location of ${e}`);let r=n.data,i=this.offsets[e];for(let e=0,n=t.length;e<n;++e){let n=5*e+i,a=n+1,o=n+2,s=n+3,c=n+4;if(r[n]!==29||r[a]!==0||r[o]!==0||r[s]!==0||r[c]!==0)throw new F(`writing to an offset that is not empty`);let l=t[e];r[n]=29,r[a]=l>>24&255,r[o]=l>>16&255,r[s]=l>>8&255,r[c]=255&l}}},Os=class e{constructor(e){this.cff=e}compile(){let e=this.cff,t={data:[],length:0,add(e){try{this.data.push(...e)}catch{this.data=this.data.concat(e)}this.length=this.data.length}},n=this.compileHeader(e.header);t.add(n);let r=this.compileNameIndex(e.names);if(t.add(r),e.isCIDFont&&e.topDict.hasName(`FontMatrix`)){let t=e.topDict.getByName(`FontMatrix`);e.topDict.removeByName(`FontMatrix`);for(let n of e.fdArray){let e=t.slice(0);n.hasName(`FontMatrix`)&&(e=jn.transform(e,n.getByName(`FontMatrix`))),n.setByName(`FontMatrix`,e)}}e.topDict.getByName(`XUID`)?.length>16&&e.topDict.removeByName(`XUID`),e.topDict.setByName(`charset`,0);let i=this.compileTopDicts([e.topDict],t.length,e.isCIDFont);t.add(i.output);let a=i.trackers[0],o=this.compileStringIndex(e.strings.strings);t.add(o);let s=this.compileIndex(e.globalSubrIndex);if(t.add(s),e.encoding&&e.topDict.hasName(`Encoding`))if(e.encoding.predefined)a.setEntryLocation(`Encoding`,[e.encoding.format],t);else{let n=this.compileEncoding(e.encoding);a.setEntryLocation(`Encoding`,[t.length],t),t.add(n)}let c=this.compileCharset(e.charset,e.charStrings.count,e.strings,e.isCIDFont);a.setEntryLocation(`charset`,[t.length],t),t.add(c);let l=this.compileCharStrings(e.charStrings);if(a.setEntryLocation(`CharStrings`,[t.length],t),t.add(l),e.isCIDFont){a.setEntryLocation(`FDSelect`,[t.length],t);let n=this.compileFDSelect(e.fdSelect);t.add(n),i=this.compileTopDicts(e.fdArray,t.length,!0),a.setEntryLocation(`FDArray`,[t.length],t),t.add(i.output);let r=i.trackers;this.compilePrivateDicts(e.fdArray,r,t)}return this.compilePrivateDicts([e.topDict],[a],t),t.add([0]),t.data}encodeNumber(e){return Number.isInteger(e)?this.encodeInteger(e):this.encodeFloat(e)}static get EncodeFloatRegExp(){return P(this,`EncodeFloatRegExp`,/\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/)}encodeFloat(t){let n=t.toString(),r=e.EncodeFloatRegExp.exec(n);if(r){let e=parseFloat(`1e`+((r[2]?+r[2]:0)+r[1].length));n=(Math.round(t*e)/e).toString()}let i,a,o=``;for(i=0,a=n.length;i<a;++i){let e=n[i];o+=e===`e`?n[++i]===`-`?`c`:`b`:e===`.`?`a`:e===`-`?`e`:e}o+=1&o.length?`f`:`ff`;let s=[30];for(i=0,a=o.length;i<a;i+=2)s.push(parseInt(o.substring(i,i+2),16));return s}encodeInteger(e){let t;return t=e>=-107&&e<=107?[e+139]:e>=108&&e<=1131?[247+((e-=108)>>8),255&e]:e>=-1131&&e<=-108?[251+((e=-e-108)>>8),255&e]:e>=-32768&&e<=32767?[28,e>>8&255,255&e]:[29,e>>24&255,e>>16&255,e>>8&255,255&e],t}compileHeader(e){return[e.major,e.minor,4,e.offSize]}compileNameIndex(e){let t=new _s;for(let n of e){let e=Math.min(n.length,127),r=Array(e);for(let t=0;t<e;t++){let e=n[t];(e<`!`||e>`~`||e===`[`||e===`]`||e===`(`||e===`)`||e===`{`||e===`}`||e===`<`||e===`>`||e===`/`||e===`%`)&&(e=`_`),r[t]=e}r=r.join(``),r===``&&(r=`Bad_Font_Name`),t.add(En(r))}return this.compileIndex(t)}compileTopDicts(e,t,n){let r=[],i=new _s;for(let a of e){n&&(a.removeByName(`CIDFontVersion`),a.removeByName(`CIDFontRevision`),a.removeByName(`CIDFontType`),a.removeByName(`CIDCount`),a.removeByName(`UIDBase`));let e=new Ds,o=this.compileDict(a,e);r.push(e),i.add(o),e.offset(t)}return i=this.compileIndex(i,r),{trackers:r,output:i}}compilePrivateDicts(e,t,n){for(let r=0,i=e.length;r<i;++r){let i=e[r],a=i.privateDict;if(!a||!i.hasName(`Private`))throw new F(`There must be a private dictionary.`);let o=new Ds,s=this.compileDict(a,o),c=n.length;if(o.offset(c),s.length||(c=0),t[r].setEntryLocation(`Private`,[s.length,c],n),n.add(s),a.subrsIndex&&a.hasName(`Subrs`)){let e=this.compileIndex(a.subrsIndex);o.setEntryLocation(`Subrs`,[s.length],n),n.add(e)}}}compileDict(e,t){let n=[];for(let r of e.order){if(!(r in e.values))continue;let i=e.values[r],a=e.types[r];if(Array.isArray(a)||(a=[a]),Array.isArray(i)||(i=[i]),i.length!==0){for(let o=0,s=a.length;o<s;++o){let s=a[o],c=i[o];switch(s){case`num`:case`sid`:n.push(...this.encodeNumber(c));break;case`offset`:let a=e.keyToNameMap[r];t.isTracking(a)||t.track(a,n.length),n.push(29,0,0,0,0);break;case`array`:case`delta`:n.push(...this.encodeNumber(c));for(let e=1,t=i.length;e<t;++e)n.push(...this.encodeNumber(i[e]));break;default:throw new F(`Unknown data type of ${s}`)}}n.push(...e.opcodes[r])}}return n}compileStringIndex(e){let t=new _s;for(let n of e)t.add(En(n));return this.compileIndex(t)}compileCharStrings(e){let t=new _s;for(let n=0;n<e.count;n++){let r=e.get(n);r.length===0?t.add(new Uint8Array([139,14])):t.add(r)}return this.compileIndex(t)}compileCharset(e,t,n,r){let i,a=t-1;if(r){let e=a-1;i=new Uint8Array([2,0,1,e>>8&255,255&e])}else{i=new Uint8Array(1+2*a),i[0]=0;let t=0,r=e.charset.length,o=!1;for(let a=1;a<i.length;a+=2){let s=0;if(t<r){let r=e.charset[t++];s=n.getSID(r),s===-1&&(s=0,o||(o=!0,N(`Couldn't find ${r} in CFF strings`)))}i[a]=s>>8&255,i[a+1]=255&s}}return this.compileTypedArray(i)}compileEncoding(e){return this.compileTypedArray(e.raw)}compileFDSelect(e){let t=e.format,n,r;switch(t){case 0:for(n=new Uint8Array(1+e.fdSelect.length),n[0]=t,r=0;r<e.fdSelect.length;r++)n[r+1]=e.fdSelect[r];break;case 3:let i=e.fdSelect[0],a=[t,0,0,0,0,i];for(r=1;r<e.fdSelect.length;r++){let t=e.fdSelect[r];t!==i&&(a.push(r>>8&255,255&r,t),i=t)}let o=(a.length-3)/3;a[1]=o>>8&255,a[2]=255&o,a.push(r>>8&255,255&r),n=new Uint8Array(a)}return this.compileTypedArray(n)}compileTypedArray(e){return Array.from(e)}compileIndex(e,t=[]){let n=e.objects,r=n.length;if(r===0)return[0,0];let i=[r>>8&255,255&r],a,o,s=1;for(a=0;a<r;++a)s+=n[a].length;o=s<256?1:s<65536?2:s<16777216?3:4,i.push(o);let c=1;for(a=0;a<r+1;a++)o===1?i.push(255&c):o===2?i.push(c>>8&255,255&c):o===3?i.push(c>>16&255,c>>8&255,255&c):i.push(c>>>24&255,c>>16&255,c>>8&255,255&c),n[a]&&(c+=n[a].length);for(a=0;a<r;a++)t[a]&&t[a].offset(i.length),i.push(...n[a]);return i}},ks=sr(function(e){e[`Times-Roman`]=`Times-Roman`,e.Helvetica=`Helvetica`,e.Courier=`Courier`,e.Symbol=`Symbol`,e[`Times-Bold`]=`Times-Bold`,e[`Helvetica-Bold`]=`Helvetica-Bold`,e[`Courier-Bold`]=`Courier-Bold`,e.ZapfDingbats=`ZapfDingbats`,e[`Times-Italic`]=`Times-Italic`,e[`Helvetica-Oblique`]=`Helvetica-Oblique`,e[`Courier-Oblique`]=`Courier-Oblique`,e[`Times-BoldItalic`]=`Times-BoldItalic`,e[`Helvetica-BoldOblique`]=`Helvetica-BoldOblique`,e[`Courier-BoldOblique`]=`Courier-BoldOblique`,e.ArialNarrow=`Helvetica`,e[`ArialNarrow-Bold`]=`Helvetica-Bold`,e[`ArialNarrow-BoldItalic`]=`Helvetica-BoldOblique`,e[`ArialNarrow-Italic`]=`Helvetica-Oblique`,e.ArialBlack=`Helvetica`,e[`ArialBlack-Bold`]=`Helvetica-Bold`,e[`ArialBlack-BoldItalic`]=`Helvetica-BoldOblique`,e[`ArialBlack-Italic`]=`Helvetica-Oblique`,e[`Arial-Black`]=`Helvetica`,e[`Arial-Black-Bold`]=`Helvetica-Bold`,e[`Arial-Black-BoldItalic`]=`Helvetica-BoldOblique`,e[`Arial-Black-Italic`]=`Helvetica-Oblique`,e.Arial=`Helvetica`,e[`Arial-Bold`]=`Helvetica-Bold`,e[`Arial-BoldItalic`]=`Helvetica-BoldOblique`,e[`Arial-Italic`]=`Helvetica-Oblique`,e.ArialMT=`Helvetica`,e[`Arial-BoldItalicMT`]=`Helvetica-BoldOblique`,e[`Arial-BoldMT`]=`Helvetica-Bold`,e[`Arial-ItalicMT`]=`Helvetica-Oblique`,e[`Arial-BoldItalicMT-BoldItalic`]=`Helvetica-BoldOblique`,e[`Arial-BoldMT-Bold`]=`Helvetica-Bold`,e[`Arial-ItalicMT-Italic`]=`Helvetica-Oblique`,e.ArialUnicodeMS=`Helvetica`,e[`ArialUnicodeMS-Bold`]=`Helvetica-Bold`,e[`ArialUnicodeMS-BoldItalic`]=`Helvetica-BoldOblique`,e[`ArialUnicodeMS-Italic`]=`Helvetica-Oblique`,e[`Courier-BoldItalic`]=`Courier-BoldOblique`,e[`Courier-Italic`]=`Courier-Oblique`,e.CourierNew=`Courier`,e[`CourierNew-Bold`]=`Courier-Bold`,e[`CourierNew-BoldItalic`]=`Courier-BoldOblique`,e[`CourierNew-Italic`]=`Courier-Oblique`,e[`CourierNewPS-BoldItalicMT`]=`Courier-BoldOblique`,e[`CourierNewPS-BoldMT`]=`Courier-Bold`,e[`CourierNewPS-ItalicMT`]=`Courier-Oblique`,e.CourierNewPSMT=`Courier`,e[`Helvetica-BoldItalic`]=`Helvetica-BoldOblique`,e[`Helvetica-Italic`]=`Helvetica-Oblique`,e[`HelveticaLTStd-Bold`]=`Helvetica-Bold`,e[`Symbol-Bold`]=`Symbol`,e[`Symbol-BoldItalic`]=`Symbol`,e[`Symbol-Italic`]=`Symbol`,e.TimesNewRoman=`Times-Roman`,e[`TimesNewRoman-Bold`]=`Times-Bold`,e[`TimesNewRoman-BoldItalic`]=`Times-BoldItalic`,e[`TimesNewRoman-Italic`]=`Times-Italic`,e.TimesNewRomanPS=`Times-Roman`,e[`TimesNewRomanPS-Bold`]=`Times-Bold`,e[`TimesNewRomanPS-BoldItalic`]=`Times-BoldItalic`,e[`TimesNewRomanPS-BoldItalicMT`]=`Times-BoldItalic`,e[`TimesNewRomanPS-BoldMT`]=`Times-Bold`,e[`TimesNewRomanPS-Italic`]=`Times-Italic`,e[`TimesNewRomanPS-ItalicMT`]=`Times-Italic`,e.TimesNewRomanPSMT=`Times-Roman`,e[`TimesNewRomanPSMT-Bold`]=`Times-Bold`,e[`TimesNewRomanPSMT-BoldItalic`]=`Times-BoldItalic`,e[`TimesNewRomanPSMT-Italic`]=`Times-Italic`}),As=sr(function(e){e.Courier=`FoxitFixed.pfb`,e[`Courier-Bold`]=`FoxitFixedBold.pfb`,e[`Courier-BoldOblique`]=`FoxitFixedBoldItalic.pfb`,e[`Courier-Oblique`]=`FoxitFixedItalic.pfb`,e.Helvetica=`LiberationSans-Regular.ttf`,e[`Helvetica-Bold`]=`LiberationSans-Bold.ttf`,e[`Helvetica-BoldOblique`]=`LiberationSans-BoldItalic.ttf`,e[`Helvetica-Oblique`]=`LiberationSans-Italic.ttf`,e[`Times-Roman`]=`FoxitSerif.pfb`,e[`Times-Bold`]=`FoxitSerifBold.pfb`,e[`Times-BoldItalic`]=`FoxitSerifBoldItalic.pfb`,e[`Times-Italic`]=`FoxitSerifItalic.pfb`,e.Symbol=`FoxitSymbol.pfb`,e.ZapfDingbats=`FoxitDingbats.pfb`,e[`LiberationSans-Regular`]=`LiberationSans-Regular.ttf`,e[`LiberationSans-Bold`]=`LiberationSans-Bold.ttf`,e[`LiberationSans-Italic`]=`LiberationSans-Italic.ttf`,e[`LiberationSans-BoldItalic`]=`LiberationSans-BoldItalic.ttf`}),js=sr(function(e){e.Calibri=`Helvetica`,e[`Calibri-Bold`]=`Helvetica-Bold`,e[`Calibri-BoldItalic`]=`Helvetica-BoldOblique`,e[`Calibri-Italic`]=`Helvetica-Oblique`,e.CenturyGothic=`Helvetica`,e[`CenturyGothic-Bold`]=`Helvetica-Bold`,e[`CenturyGothic-BoldItalic`]=`Helvetica-BoldOblique`,e[`CenturyGothic-Italic`]=`Helvetica-Oblique`,e.ComicSansMS=`Comic Sans MS`,e[`ComicSansMS-Bold`]=`Comic Sans MS-Bold`,e[`ComicSansMS-BoldItalic`]=`Comic Sans MS-BoldItalic`,e[`ComicSansMS-Italic`]=`Comic Sans MS-Italic`,e.GillSansMT=`Helvetica`,e[`GillSansMT-Bold`]=`Helvetica-Bold`,e[`GillSansMT-BoldItalic`]=`Helvetica-BoldOblique`,e[`GillSansMT-Italic`]=`Helvetica-Oblique`,e.Impact=`Helvetica`,e[`ItcSymbol-Bold`]=`Helvetica-Bold`,e[`ItcSymbol-BoldItalic`]=`Helvetica-BoldOblique`,e[`ItcSymbol-Book`]=`Helvetica`,e[`ItcSymbol-BookItalic`]=`Helvetica-Oblique`,e[`ItcSymbol-Medium`]=`Helvetica`,e[`ItcSymbol-MediumItalic`]=`Helvetica-Oblique`,e.LucidaConsole=`Courier`,e[`LucidaConsole-Bold`]=`Courier-Bold`,e[`LucidaConsole-BoldItalic`]=`Courier-BoldOblique`,e[`LucidaConsole-Italic`]=`Courier-Oblique`,e[`LucidaSans-Demi`]=`Helvetica-Bold`,e[`MS-Gothic`]=`MS Gothic`,e[`MS-Gothic-Bold`]=`MS Gothic-Bold`,e[`MS-Gothic-BoldItalic`]=`MS Gothic-BoldItalic`,e[`MS-Gothic-Italic`]=`MS Gothic-Italic`,e[`MS-Mincho`]=`MS Mincho`,e[`MS-Mincho-Bold`]=`MS Mincho-Bold`,e[`MS-Mincho-BoldItalic`]=`MS Mincho-BoldItalic`,e[`MS-Mincho-Italic`]=`MS Mincho-Italic`,e[`MS-PGothic`]=`MS PGothic`,e[`MS-PGothic-Bold`]=`MS PGothic-Bold`,e[`MS-PGothic-BoldItalic`]=`MS PGothic-BoldItalic`,e[`MS-PGothic-Italic`]=`MS PGothic-Italic`,e[`MS-PMincho`]=`MS PMincho`,e[`MS-PMincho-Bold`]=`MS PMincho-Bold`,e[`MS-PMincho-BoldItalic`]=`MS PMincho-BoldItalic`,e[`MS-PMincho-Italic`]=`MS PMincho-Italic`,e.NuptialScript=`Times-Italic`,e.SegoeUISymbol=`Helvetica`}),Ms=sr(function(e){e[`Adobe Jenson`]=!0,e[`Adobe Text`]=!0,e.Albertus=!0,e.Aldus=!0,e.Alexandria=!0,e.Algerian=!0,e[`American Typewriter`]=!0,e.Antiqua=!0,e.Apex=!0,e.Arno=!0,e.Aster=!0,e.Aurora=!0,e.Baskerville=!0,e.Bell=!0,e.Bembo=!0,e[`Bembo Schoolbook`]=!0,e.Benguiat=!0,e[`Berkeley Old Style`]=!0,e[`Bernhard Modern`]=!0,e[`Berthold City`]=!0,e.Bodoni=!0,e[`Bauer Bodoni`]=!0,e[`Book Antiqua`]=!0,e.Bookman=!0,e[`Bordeaux Roman`]=!0,e[`Californian FB`]=!0,e.Calisto=!0,e.Calvert=!0,e.Capitals=!0,e.Cambria=!0,e.Cartier=!0,e.Caslon=!0,e.Catull=!0,e.Centaur=!0,e[`Century Old Style`]=!0,e[`Century Schoolbook`]=!0,e.Chaparral=!0,e[`Charis SIL`]=!0,e.Cheltenham=!0,e[`Cholla Slab`]=!0,e.Clarendon=!0,e.Clearface=!0,e.Cochin=!0,e.Colonna=!0,e[`Computer Modern`]=!0,e[`Concrete Roman`]=!0,e.Constantia=!0,e[`Cooper Black`]=!0,e.Corona=!0,e.Ecotype=!0,e.Egyptienne=!0,e.Elephant=!0,e.Excelsior=!0,e.Fairfield=!0,e[`FF Scala`]=!0,e.Folkard=!0,e.Footlight=!0,e.FreeSerif=!0,e[`Friz Quadrata`]=!0,e.Garamond=!0,e.Gentium=!0,e.Georgia=!0,e.Gloucester=!0,e[`Goudy Old Style`]=!0,e[`Goudy Schoolbook`]=!0,e[`Goudy Pro Font`]=!0,e.Granjon=!0,e[`Guardian Egyptian`]=!0,e.Heather=!0,e.Hercules=!0,e[`High Tower Text`]=!0,e.Hiroshige=!0,e[`Hoefler Text`]=!0,e[`Humana Serif`]=!0,e.Imprint=!0,e[`Ionic No. 5`]=!0,e.Janson=!0,e.Joanna=!0,e.Korinna=!0,e.Lexicon=!0,e.LiberationSerif=!0,e[`Liberation Serif`]=!0,e[`Linux Libertine`]=!0,e.Literaturnaya=!0,e.Lucida=!0,e[`Lucida Bright`]=!0,e.Melior=!0,e.Memphis=!0,e.Miller=!0,e.Minion=!0,e.Modern=!0,e[`Mona Lisa`]=!0,e[`Mrs Eaves`]=!0,e[`MS Serif`]=!0,e[`Museo Slab`]=!0,e[`New York`]=!0,e[`Nimbus Roman`]=!0,e[`NPS Rawlinson Roadway`]=!0,e.NuptialScript=!0,e.Palatino=!0,e.Perpetua=!0,e.Plantin=!0,e[`Plantin Schoolbook`]=!0,e.Playbill=!0,e[`Poor Richard`]=!0,e[`Rawlinson Roadway`]=!0,e.Renault=!0,e.Requiem=!0,e.Rockwell=!0,e.Roman=!0,e[`Rotis Serif`]=!0,e.Sabon=!0,e.Scala=!0,e.Seagull=!0,e.Sistina=!0,e.Souvenir=!0,e.STIX=!0,e[`Stone Informal`]=!0,e[`Stone Serif`]=!0,e.Sylfaen=!0,e.Times=!0,e.Trajan=!0,e.Trinité=!0,e[`Trump Mediaeval`]=!0,e.Utopia=!0,e[`Vale Type`]=!0,e[`Bitstream Vera`]=!0,e[`Vera Serif`]=!0,e.Versailles=!0,e.Wanted=!0,e.Weiss=!0,e[`Wide Latin`]=!0,e.Windsor=!0,e.XITS=!0}),Ns=sr(function(e){e.Dingbats=!0,e.Symbol=!0,e.ZapfDingbats=!0,e.Wingdings=!0,e[`Wingdings-Bold`]=!0,e[`Wingdings-Regular`]=!0}),Ps=sr(function(e){e[2]=10,e[3]=32,e[4]=33,e[5]=34,e[6]=35,e[7]=36,e[8]=37,e[9]=38,e[10]=39,e[11]=40,e[12]=41,e[13]=42,e[14]=43,e[15]=44,e[16]=45,e[17]=46,e[18]=47,e[19]=48,e[20]=49,e[21]=50,e[22]=51,e[23]=52,e[24]=53,e[25]=54,e[26]=55,e[27]=56,e[28]=57,e[29]=58,e[30]=894,e[31]=60,e[32]=61,e[33]=62,e[34]=63,e[35]=64,e[36]=65,e[37]=66,e[38]=67,e[39]=68,e[40]=69,e[41]=70,e[42]=71,e[43]=72,e[44]=73,e[45]=74,e[46]=75,e[47]=76,e[48]=77,e[49]=78,e[50]=79,e[51]=80,e[52]=81,e[53]=82,e[54]=83,e[55]=84,e[56]=85,e[57]=86,e[58]=87,e[59]=88,e[60]=89,e[61]=90,e[62]=91,e[63]=92,e[64]=93,e[65]=94,e[66]=95,e[67]=96,e[68]=97,e[69]=98,e[70]=99,e[71]=100,e[72]=101,e[73]=102,e[74]=103,e[75]=104,e[76]=105,e[77]=106,e[78]=107,e[79]=108,e[80]=109,e[81]=110,e[82]=111,e[83]=112,e[84]=113,e[85]=114,e[86]=115,e[87]=116,e[88]=117,e[89]=118,e[90]=119,e[91]=120,e[92]=121,e[93]=122,e[94]=123,e[95]=124,e[96]=125,e[97]=126,e[98]=196,e[99]=197,e[100]=199,e[101]=201,e[102]=209,e[103]=214,e[104]=220,e[105]=225,e[106]=224,e[107]=226,e[108]=228,e[109]=227,e[110]=229,e[111]=231,e[112]=233,e[113]=232,e[114]=234,e[115]=235,e[116]=237,e[117]=236,e[118]=238,e[119]=239,e[120]=241,e[121]=243,e[122]=242,e[123]=244,e[124]=246,e[125]=245,e[126]=250,e[127]=249,e[128]=251,e[129]=252,e[130]=8224,e[131]=176,e[132]=162,e[133]=163,e[134]=167,e[135]=8226,e[136]=182,e[137]=223,e[138]=174,e[139]=169,e[140]=8482,e[141]=180,e[142]=168,e[143]=8800,e[144]=198,e[145]=216,e[146]=8734,e[147]=177,e[148]=8804,e[149]=8805,e[150]=165,e[151]=181,e[152]=8706,e[153]=8721,e[154]=8719,e[156]=8747,e[157]=170,e[158]=186,e[159]=8486,e[160]=230,e[161]=248,e[162]=191,e[163]=161,e[164]=172,e[165]=8730,e[166]=402,e[167]=8776,e[168]=8710,e[169]=171,e[170]=187,e[171]=8230,e[179]=8220,e[180]=8221,e[181]=8216,e[182]=8217,e[200]=193,e[203]=205,e[207]=211,e[210]=218,e[223]=711,e[224]=321,e[225]=322,e[226]=352,e[227]=353,e[228]=381,e[229]=382,e[233]=221,e[234]=253,e[252]=263,e[253]=268,e[254]=269,e[258]=258,e[260]=260,e[261]=261,e[265]=280,e[266]=281,e[267]=282,e[268]=283,e[269]=313,e[275]=323,e[276]=324,e[278]=328,e[283]=344,e[284]=345,e[285]=346,e[286]=347,e[292]=367,e[295]=377,e[296]=378,e[298]=380,e[305]=963,e[306]=964,e[307]=966,e[308]=8215,e[309]=8252,e[310]=8319,e[311]=8359,e[312]=8592,e[313]=8593,e[337]=9552,e[493]=1039,e[494]=1040,e[570]=1040,e[571]=1041,e[572]=1042,e[573]=1043,e[574]=1044,e[575]=1045,e[576]=1046,e[577]=1047,e[578]=1048,e[579]=1049,e[580]=1050,e[581]=1051,e[582]=1052,e[583]=1053,e[584]=1054,e[585]=1055,e[586]=1056,e[587]=1057,e[588]=1058,e[589]=1059,e[590]=1060,e[591]=1061,e[592]=1062,e[593]=1063,e[594]=1064,e[595]=1065,e[596]=1066,e[597]=1067,e[598]=1068,e[599]=1069,e[600]=1070,e[672]=1488,e[673]=1489,e[674]=1490,e[675]=1491,e[676]=1492,e[677]=1493,e[678]=1494,e[679]=1495,e[680]=1496,e[681]=1497,e[682]=1498,e[683]=1499,e[684]=1500,e[685]=1501,e[686]=1502,e[687]=1503,e[688]=1504,e[689]=1505,e[690]=1506,e[691]=1507,e[692]=1508,e[693]=1509,e[694]=1510,e[695]=1511,e[696]=1512,e[697]=1513,e[698]=1514,e[705]=1524,e[706]=8362,e[710]=64288,e[711]=64298,e[759]=1617,e[761]=1776,e[763]=1778,e[775]=1652,e[777]=1764,e[778]=1780,e[779]=1781,e[780]=1782,e[782]=771,e[783]=64726,e[786]=8363,e[788]=8532,e[790]=768,e[791]=769,e[792]=768,e[795]=803,e[797]=64336,e[798]=64337,e[799]=64342,e[800]=64343,e[801]=64344,e[802]=64345,e[803]=64362,e[804]=64363,e[805]=64364,e[2424]=7821,e[2425]=7822,e[2426]=7823,e[2427]=7824,e[2428]=7825,e[2429]=7826,e[2430]=7827,e[2433]=7682,e[2678]=8045,e[2679]=8046,e[2830]=1552,e[2838]=686,e[2840]=751,e[2842]=753,e[2843]=754,e[2844]=755,e[2846]=757,e[2856]=767,e[2857]=848,e[2858]=849,e[2862]=853,e[2863]=854,e[2864]=855,e[2865]=861,e[2866]=862,e[2906]=7460,e[2908]=7462,e[2909]=7463,e[2910]=7464,e[2912]=7466,e[2913]=7467,e[2914]=7468,e[2916]=7470,e[2917]=7471,e[2918]=7472,e[2920]=7474,e[2921]=7475,e[2922]=7476,e[2924]=7478,e[2925]=7479,e[2926]=7480,e[2928]=7482,e[2929]=7483,e[2930]=7484,e[2932]=7486,e[2933]=7487,e[2934]=7488,e[2936]=7490,e[2937]=7491,e[2938]=7492,e[2940]=7494,e[2941]=7495,e[2942]=7496,e[2944]=7498,e[2946]=7500,e[2948]=7502,e[2950]=7504,e[2951]=7505,e[2952]=7506,e[2954]=7508,e[2955]=7509,e[2956]=7510,e[2958]=7512,e[2959]=7513,e[2960]=7514,e[2962]=7516,e[2963]=7517,e[2964]=7518,e[2966]=7520,e[2967]=7521,e[2968]=7522,e[2970]=7524,e[2971]=7525,e[2972]=7526,e[2974]=7528,e[2975]=7529,e[2976]=7530,e[2978]=1537,e[2979]=1538,e[2980]=1539,e[2982]=1549,e[2983]=1551,e[2984]=1552,e[2986]=1554,e[2987]=1555,e[2988]=1556,e[2990]=1623,e[2991]=1624,e[2995]=1775,e[2999]=1791,e[3002]=64290,e[3003]=64291,e[3004]=64292,e[3006]=64294,e[3007]=64295,e[3008]=64296,e[3011]=1900,e[3014]=8223,e[3015]=8244,e[3017]=7532,e[3018]=7533,e[3019]=7534,e[3075]=7590,e[3076]=7591,e[3079]=7594,e[3080]=7595,e[3083]=7598,e[3084]=7599,e[3087]=7602,e[3088]=7603,e[3091]=7606,e[3092]=7607,e[3095]=7610,e[3096]=7611,e[3099]=7614,e[3100]=7615,e[3103]=7618,e[3104]=7619,e[3107]=8337,e[3108]=8338,e[3116]=1884,e[3119]=1885,e[3120]=1885,e[3123]=1886,e[3124]=1886,e[3127]=1887,e[3128]=1887,e[3131]=1888,e[3132]=1888,e[3135]=1889,e[3136]=1889,e[3139]=1890,e[3140]=1890,e[3143]=1891,e[3144]=1891,e[3147]=1892,e[3148]=1892,e[3153]=580,e[3154]=581,e[3157]=584,e[3158]=585,e[3161]=588,e[3162]=589,e[3165]=891,e[3166]=892,e[3169]=1274,e[3170]=1275,e[3173]=1278,e[3174]=1279,e[3181]=7622,e[3182]=7623,e[3282]=11799,e[3316]=578,e[3379]=42785,e[3393]=1159,e[3416]=8377}),Fs=sr(function(e){e[227]=322,e[264]=261,e[291]=346}),Is=sr(function(e){e[1]=32,e[4]=65,e[5]=192,e[6]=193,e[9]=196,e[17]=66,e[18]=67,e[21]=268,e[24]=68,e[28]=69,e[29]=200,e[30]=201,e[32]=282,e[38]=70,e[39]=71,e[44]=72,e[47]=73,e[48]=204,e[49]=205,e[58]=74,e[60]=75,e[62]=76,e[68]=77,e[69]=78,e[75]=79,e[76]=210,e[80]=214,e[87]=80,e[89]=81,e[90]=82,e[92]=344,e[94]=83,e[97]=352,e[100]=84,e[104]=85,e[109]=220,e[115]=86,e[116]=87,e[121]=88,e[122]=89,e[124]=221,e[127]=90,e[129]=381,e[258]=97,e[259]=224,e[260]=225,e[263]=228,e[268]=261,e[271]=98,e[272]=99,e[273]=263,e[275]=269,e[282]=100,e[286]=101,e[287]=232,e[288]=233,e[290]=283,e[295]=281,e[296]=102,e[336]=103,e[346]=104,e[349]=105,e[350]=236,e[351]=237,e[361]=106,e[364]=107,e[367]=108,e[371]=322,e[373]=109,e[374]=110,e[381]=111,e[382]=242,e[383]=243,e[386]=246,e[393]=112,e[395]=113,e[396]=114,e[398]=345,e[400]=115,e[401]=347,e[403]=353,e[410]=116,e[437]=117,e[442]=252,e[448]=118,e[449]=119,e[454]=120,e[455]=121,e[457]=253,e[460]=122,e[462]=382,e[463]=380,e[853]=44,e[855]=58,e[856]=46,e[876]=47,e[878]=45,e[882]=45,e[894]=40,e[895]=41,e[896]=91,e[897]=93,e[923]=64,e[940]=163,e[1004]=48,e[1005]=49,e[1006]=50,e[1007]=51,e[1008]=52,e[1009]=53,e[1010]=54,e[1011]=55,e[1012]=56,e[1013]=57,e[1081]=37,e[1085]=43,e[1086]=45});function Ls(e){let t=is(e);return ks()[t]}function Rs(e){let t=is(e);return!!(ks()[t]||js()[t]||Ms()[t]||Ns()[t])}var zs=class{constructor(e=[]){this._map=e}get length(){return this._map.length}forEach(e){for(let t in this._map)e(t,this._map[t].codePointAt(0))}has(e){return this._map[e]!==void 0}get(e){return this._map[e]}charCodeOf(e){let t=this._map;if(t.length<=65536)return t.indexOf(e);for(let n in t)if(t[n]===e)return 0|n;return-1}amend(e){for(let t in e)this._map[t]=e[t]}},Bs=class{constructor(e,t){this.firstChar=e,this.lastChar=t}get length(){return this.lastChar+1-this.firstChar}forEach(e){for(let t=this.firstChar,n=this.lastChar;t<=n;t++)e(t,t)}has(e){return this.firstChar<=e&&e<=this.lastChar}get(e){if(this.firstChar<=e&&e<=this.lastChar)return String.fromCharCode(e)}charCodeOf(e){return Number.isInteger(e)&&e>=this.firstChar&&e<=this.lastChar?e:-1}amend(e){gn(`Should not call amend()`)}},Vs=class{constructor(e,t){this.properties=t;let n=new ps(e,t,Xo);this.cff=n.parse(),this.cff.duplicateFirstGlyph();let r=new Os(this.cff);this.seacs=this.cff.seacs;try{this.data=r.compile()}catch{N(`Failed to compile font `+t.loadedName),this.data=e}this._createBuiltInEncoding()}get numGlyphs(){return this.cff.charStrings.count}getCharset(){return this.cff.charset.charset}getGlyphMapping(){let e=this.cff,t=this.properties,{cidToGidMap:n,cMap:r}=t,i=e.charset.charset,a,o;if(t.composite){let t,s;if(n?.length>0){t=Object.create(null);for(let e=0,r=n.length;e<r;e++){let r=n[e];r!==void 0&&(t[r]=e)}}if(a=Object.create(null),e.isCIDFont)for(o=0;o<i.length;o++){let e=i[o];s=r.charCodeOf(e),t?.[s]!==void 0&&(s=t[s]),a[s]=o}else for(o=0;o<e.charStrings.count;o++)s=r.charCodeOf(o),a[s]=o;return a}let s=e.encoding?e.encoding.encoding:null;return t.isInternalFont&&(s=t.defaultEncoding),a=rs(t,s,i),a}hasGlyphId(e){return this.cff.hasGlyphId(e)}_createBuiltInEncoding(){let{charset:e,encoding:t}=this.cff;if(!e||!t)return;let n=e.charset,r=t.encoding,i=[];for(let e in r){let t=r[e];if(t>=0){let r=n[t];r&&(i[e]=r)}}i.length>0&&(this.properties.builtInEncoding=i)}};function Hs(e,t){return yr(e,t)/16384}function Us(e){let t=e.length,n=32768;return t<1240?n=107:t<33900&&(n=1131),n}function Ws(e,t,n){let r=br(e,t+2)===1?xr(e,t+8):xr(e,t+16),i=br(e,t+r),a,o,s;if(i===4){br(e,t+r+2);let n=br(e,t+r+6)>>1;for(o=t+r+14,a=[],s=0;s<n;s++,o+=2)a[s]={end:br(e,o)};for(o+=2,s=0;s<n;s++,o+=2)a[s].start=br(e,o);for(s=0;s<n;s++,o+=2)a[s].idDelta=br(e,o);for(s=0;s<n;s++,o+=2){let t=br(e,o);if(t!==0){a[s].ids=[];for(let n=0,r=a[s].end-a[s].start+1;n<r;n++)a[s].ids[n]=br(e,o+t),t+=2}}return a}if(i===12){let n=xr(e,t+r+12);for(o=t+r+16,a=[],s=0;s<n;s++)t=xr(e,o),a.push({start:t,end:xr(e,o+4),idDelta:xr(e,o+8)-t}),o+=12;return a}throw new F(`unsupported cmap: ${i}`)}function Gs(e,t,n,r){let i=new ps(new gi(e,t,n-t),{},r).parse();return{glyphs:i.charStrings.objects,subrs:i.topDict.privateDict?.subrsIndex?.objects,gsubrs:i.globalSubrIndex?.objects,isCFFCIDFont:i.isCIDFont,fdSelect:i.fdSelect,fdArray:i.fdArray}}function Ks(e,t){let n=t.codePointAt(0),r=0,i=0,a=e.length-1;for(;i<a;){let t=i+a+1>>1;n<e[t].start?a=t-1:i=t}return e[i].start<=n&&n<=e[i].end&&(r=e[i].idDelta+(e[i].ids?e[i].ids[n-e[i].start]:n)&65535),{charCode:n,glyphId:r}}function qs(e,t,n){function r(e,n){l&&t.add(`L`,l),l=[e,n],t.add(`M`,[e,n])}function i(e,n){t.add(`L`,[e,n])}function a(e,n,r,i){t.add(`Q`,[e,n,r,i])}let o=0,s=yr(e,o),c,l=null,u=0,d=0;if(o+=10,s<0)do{c=br(e,o);let r=br(e,o+2),i,a;o+=4,1&c?(2&c?(i=yr(e,o),a=yr(e,o+2)):(i=br(e,o),a=br(e,o+2)),o+=4):2&c?(i=vr(e,o++),a=vr(e,o++)):(i=e[o++],a=e[o++]),2&c?(u=i,d=a):(u=0,d=0);let s=1,l=1,f=0,p=0;8&c?(s=l=Hs(e,o),o+=2):64&c?(s=Hs(e,o),l=Hs(e,o+2),o+=4):128&c&&(s=Hs(e,o),f=Hs(e,o+2),p=Hs(e,o+4),l=Hs(e,o+6),o+=8);let m=n.glyphs[r];m&&(t.save(),t.transform([s,f,p,l,u,d]),qs(m,t,n),t.restore())}while(32&c);else{let t=[],n,l;for(n=0;n<s;n++)t.push(br(e,o)),o+=2;o+=2+br(e,o);let f=t.at(-1)+1,p=[];for(;p.length<f;){c=e[o++];let t=1;for(8&c&&(t+=e[o++]);t-- >0;)p.push({flags:c})}for(n=0;n<f;n++){switch(18&p[n].flags){case 0:u+=yr(e,o),o+=2;break;case 2:u-=e[o++];break;case 18:u+=e[o++]}p[n].x=u}for(n=0;n<f;n++){switch(36&p[n].flags){case 0:d+=yr(e,o),o+=2;break;case 4:d-=e[o++];break;case 36:d+=e[o++]}p[n].y=d}let m=0;for(o=0;o<s;o++){let e=t[o],s=p.slice(m,e+1);if(1&s[0].flags)s.push(s[0]);else if(1&s.at(-1).flags)s.unshift(s.at(-1));else{let e={flags:1,x:(s[0].x+s.at(-1).x)/2,y:(s[0].y+s.at(-1).y)/2};s.unshift(e),s.push(e)}for(r(s[0].x,s[0].y),n=1,l=s.length;n<l;n++)1&s[n].flags?i(s[n].x,s[n].y):1&s[n+1].flags?(a(s[n].x,s[n].y,s[n+1].x,s[n+1].y),n++):a(s[n].x,s[n].y,(s[n].x+s[n+1].x)/2,(s[n].y+s[n+1].y)/2);m=e+1}}}function Js(e,t,n,r){function i(e,n){d&&t.add(`L`,d),d=[e,n],t.add(`M`,[e,n])}function a(e,n){t.add(`L`,[e,n])}function o(e,n,r,i,a,o){t.add(`C`,[e,n,r,i,a,o])}let s=[],c=0,l=0,u=0,d=null;(function e(d){let f=0;for(;f<d.length;){let p,m,h,g,_,v,y,b,x,S=!1,C=d[f++];switch(C){case 1:case 3:case 18:case 23:u+=s.length>>1,S=!0;break;case 4:l+=s.pop(),i(c,l),S=!0;break;case 5:for(;s.length>0;)c+=s.shift(),l+=s.shift(),a(c,l);break;case 6:for(;s.length>0&&(c+=s.shift(),a(c,l),s.length!==0);)l+=s.shift(),a(c,l);break;case 7:for(;s.length>0&&(l+=s.shift(),a(c,l),s.length!==0);)c+=s.shift(),a(c,l);break;case 8:for(;s.length>0;)p=c+s.shift(),h=l+s.shift(),m=p+s.shift(),g=h+s.shift(),c=m+s.shift(),l=g+s.shift(),o(p,h,m,g,c,l);break;case 10:if(b=s.pop(),x=null,n.isCFFCIDFont){let e=n.fdSelect.getFDIndex(r);if(e>=0&&e<n.fdArray.length){let t=n.fdArray[e],r;t.privateDict?.subrsIndex&&(r=t.privateDict.subrsIndex.objects),r&&(b+=Us(r),x=r[b])}else N(`Invalid fd index for glyph index.`)}else x=n.subrs[b+n.subrsBias];x&&e(x);break;case 11:return;case 12:switch(C=d[f++],C){case 34:p=c+s.shift(),m=p+s.shift(),_=l+s.shift(),c=m+s.shift(),o(p,l,m,_,c,_),p=c+s.shift(),m=p+s.shift(),c=m+s.shift(),o(p,_,m,l,c,l);break;case 35:p=c+s.shift(),h=l+s.shift(),m=p+s.shift(),g=h+s.shift(),c=m+s.shift(),l=g+s.shift(),o(p,h,m,g,c,l),p=c+s.shift(),h=l+s.shift(),m=p+s.shift(),g=h+s.shift(),c=m+s.shift(),l=g+s.shift(),o(p,h,m,g,c,l),s.pop();break;case 36:p=c+s.shift(),_=l+s.shift(),m=p+s.shift(),v=_+s.shift(),c=m+s.shift(),o(p,_,m,v,c,v),p=c+s.shift(),m=p+s.shift(),y=v+s.shift(),c=m+s.shift(),o(p,v,m,y,c,l);break;case 37:let e=c,t=l;p=c+s.shift(),h=l+s.shift(),m=p+s.shift(),g=h+s.shift(),c=m+s.shift(),l=g+s.shift(),o(p,h,m,g,c,l),p=c+s.shift(),h=l+s.shift(),m=p+s.shift(),g=h+s.shift(),c=m,l=g,Math.abs(c-e)>Math.abs(l-t)?c+=s.shift():l+=s.shift(),o(p,h,m,g,c,l);break;default:throw new F(`unknown operator: 12 ${C}`)}break;case 14:if(s.length>=4){let e=s.pop(),r=s.pop();l=s.pop(),c=s.pop(),t.save(),t.translate(c,l);let i=Ks(n.cmap,String.fromCharCode(n.glyphNameMap[Lo[e]]));Js(n.glyphs[i.glyphId],t,n,i.glyphId),t.restore(),i=Ks(n.cmap,String.fromCharCode(n.glyphNameMap[Lo[r]])),Js(n.glyphs[i.glyphId],t,n,i.glyphId)}return;case 19:case 20:u+=s.length>>1,f+=u+7>>3,S=!0;break;case 21:l+=s.pop(),c+=s.pop(),i(c,l),S=!0;break;case 22:c+=s.pop(),i(c,l),S=!0;break;case 24:for(;s.length>2;)p=c+s.shift(),h=l+s.shift(),m=p+s.shift(),g=h+s.shift(),c=m+s.shift(),l=g+s.shift(),o(p,h,m,g,c,l);c+=s.shift(),l+=s.shift(),a(c,l);break;case 25:for(;s.length>6;)c+=s.shift(),l+=s.shift(),a(c,l);p=c+s.shift(),h=l+s.shift(),m=p+s.shift(),g=h+s.shift(),c=m+s.shift(),l=g+s.shift(),o(p,h,m,g,c,l);break;case 26:for(s.length%2&&(c+=s.shift());s.length>0;)p=c,h=l+s.shift(),m=p+s.shift(),g=h+s.shift(),c=m,l=g+s.shift(),o(p,h,m,g,c,l);break;case 27:for(s.length%2&&(l+=s.shift());s.length>0;)p=c+s.shift(),h=l,m=p+s.shift(),g=h+s.shift(),c=m+s.shift(),l=g,o(p,h,m,g,c,l);break;case 28:s.push(yr(d,f)),f+=2;break;case 29:b=s.pop()+n.gsubrsBias,x=n.gsubrs[b],x&&e(x);break;case 30:for(;s.length>0&&(p=c,h=l+s.shift(),m=p+s.shift(),g=h+s.shift(),c=m+s.shift(),l=g+(s.length===1?s.shift():0),o(p,h,m,g,c,l),s.length!==0);)p=c+s.shift(),h=l,m=p+s.shift(),g=h+s.shift(),l=g+s.shift(),c=m+(s.length===1?s.shift():0),o(p,h,m,g,c,l);break;case 31:for(;s.length>0&&(p=c+s.shift(),h=l,m=p+s.shift(),g=h+s.shift(),l=g+s.shift(),c=m+(s.length===1?s.shift():0),o(p,h,m,g,c,l),s.length!==0);)p=c,h=l+s.shift(),m=p+s.shift(),g=h+s.shift(),c=m+s.shift(),l=g+(s.length===1?s.shift():0),o(p,h,m,g,c,l);break;default:if(C<32)throw new F(`unknown operator: ${C}`);C<247?s.push(C-139):C<251?s.push(256*(C-247)+d[f++]+108):C<255?s.push(256*-(C-251)-d[f++]-108):(s.push((d[f]<<24|d[f+1]<<16|d[f+2]<<8|d[f+3])/65536),f+=4)}S&&(s.length=0)}})(e)}var Ys=class{cmds=[];transformStack=[];currentTransform=[1,0,0,1,0,0];add(e,t){if(t){let{currentTransform:n}=this;for(let e=0,r=t.length;e<r;e+=2)jn.applyTransform(t,n,e);this.cmds.push(`${e}${t.join(` `)}`)}else this.cmds.push(e)}transform(e){this.currentTransform=jn.transform(this.currentTransform,e)}translate(e,t){this.transform([1,0,0,1,e,t])}save(){this.transformStack.push(this.currentTransform.slice())}restore(){this.currentTransform=this.transformStack.pop()||[1,0,0,1,0,0]}getSVG(){return this.cmds.join(``)}},Xs=class{constructor(e){this.fontMatrix=e,this.compiledGlyphs=Object.create(null),this.compiledCharCodeToGlyphId=Object.create(null)}getPathJs(e){let{charCode:t,glyphId:n}=Ks(this.cmap,e),r,i=this.compiledGlyphs[n];if(i===void 0){try{i=this.compileGlyph(this.glyphs[n],n)}catch(e){i=``,r=e}this.compiledGlyphs[n]=i}if(this.compiledCharCodeToGlyphId[t]??=n,r)throw r;return i}compileGlyph(e,t){if(!e?.length||e[0]===14)return``;let r=this.fontMatrix;if(this.isCFFCIDFont){let e=this.fdSelect.getFDIndex(t);e>=0&&e<this.fdArray.length?r=this.fdArray[e].getByName(`FontMatrix`)||n:N(`Invalid fd index for glyph index.`)}_n(Cr(r,6),`Expected a valid fontMatrix.`);let i=new Ys;return i.transform(r.slice()),this.compileGlyphImpl(e,i,t),i.add(`Z`),i.getSVG()}compileGlyphImpl(){gn(`Children classes should implement this.`)}hasBuiltPath(e){let{charCode:t,glyphId:n}=Ks(this.cmap,e);return this.compiledGlyphs[n]!==void 0&&this.compiledCharCodeToGlyphId[t]!==void 0}},Zs=class extends Xs{constructor(e,t,n){super(n||[488e-6,0,0,488e-6,0,0]),this.glyphs=e,this.cmap=t}compileGlyphImpl(e,t){qs(e,t,this)}},Qs=class extends Xs{constructor(e,t,n){super(n||[.001,0,0,.001,0,0]),this.glyphs=e.glyphs,this.gsubrs=e.gsubrs||[],this.subrs=e.subrs||[],this.cmap=t,this.glyphNameMap=Ho(),this.gsubrsBias=Us(this.gsubrs),this.subrsBias=Us(this.subrs),this.isCFFCIDFont=e.isCFFCIDFont,this.fdSelect=e.fdSelect,this.fdArray=e.fdArray}compileGlyphImpl(e,t,n){Js(e,t,this,n)}},$s=class{static create(e,t){let n=new Uint8Array(e.data),r,i,a,o,s,c,l=br(n,4);for(let e=0,u=12;e<l;e++,u+=16){let e=Tn(n.subarray(u,u+4)),l=xr(n,u+8),d=xr(n,u+12);switch(e){case`cmap`:r=Ws(n,l);break;case`glyf`:i=n.subarray(l,l+d);break;case`loca`:a=n.subarray(l,l+d);break;case`head`:c=br(n,l+18),s=br(n,l+50);break;case`CFF `:o=Gs(n,l,l+d,t)}}if(i){let t=c?[1/c,0,0,1/c,0,0]:e.fontMatrix;return new Zs(function(e,t,n){let r,i;n?(r=4,i=xr):(r=2,i=(e,t)=>2*br(e,t));let a=[],o=i(t,0);for(let n=r;n<t.length;n+=r){let r=i(t,n);a.push(e.subarray(o,r)),o=r}return a}(i,a,s),r,t)}return new Qs(o,r,e.fontMatrix)}},ec=sr(function(e){e.Courier=600,e[`Courier-Bold`]=600,e[`Courier-BoldOblique`]=600,e[`Courier-Oblique`]=600,e.Helvetica=sr(function(e){e.space=278,e.exclam=278,e.quotedbl=355,e.numbersign=556,e.dollar=556,e.percent=889,e.ampersand=667,e.quoteright=222,e.parenleft=333,e.parenright=333,e.asterisk=389,e.plus=584,e.comma=278,e.hyphen=333,e.period=278,e.slash=278,e.zero=556,e.one=556,e.two=556,e.three=556,e.four=556,e.five=556,e.six=556,e.seven=556,e.eight=556,e.nine=556,e.colon=278,e.semicolon=278,e.less=584,e.equal=584,e.greater=584,e.question=556,e.at=1015,e.A=667,e.B=667,e.C=722,e.D=722,e.E=667,e.F=611,e.G=778,e.H=722,e.I=278,e.J=500,e.K=667,e.L=556,e.M=833,e.N=722,e.O=778,e.P=667,e.Q=778,e.R=722,e.S=667,e.T=611,e.U=722,e.V=667,e.W=944,e.X=667,e.Y=667,e.Z=611,e.bracketleft=278,e.backslash=278,e.bracketright=278,e.asciicircum=469,e.underscore=556,e.quoteleft=222,e.a=556,e.b=556,e.c=500,e.d=556,e.e=556,e.f=278,e.g=556,e.h=556,e.i=222,e.j=222,e.k=500,e.l=222,e.m=833,e.n=556,e.o=556,e.p=556,e.q=556,e.r=333,e.s=500,e.t=278,e.u=556,e.v=500,e.w=722,e.x=500,e.y=500,e.z=500,e.braceleft=334,e.bar=260,e.braceright=334,e.asciitilde=584,e.exclamdown=333,e.cent=556,e.sterling=556,e.fraction=167,e.yen=556,e.florin=556,e.section=556,e.currency=556,e.quotesingle=191,e.quotedblleft=333,e.guillemotleft=556,e.guilsinglleft=333,e.guilsinglright=333,e.fi=500,e.fl=500,e.endash=556,e.dagger=556,e.daggerdbl=556,e.periodcentered=278,e.paragraph=537,e.bullet=350,e.quotesinglbase=222,e.quotedblbase=333,e.quotedblright=333,e.guillemotright=556,e.ellipsis=1e3,e.perthousand=1e3,e.questiondown=611,e.grave=333,e.acute=333,e.circumflex=333,e.tilde=333,e.macron=333,e.breve=333,e.dotaccent=333,e.dieresis=333,e.ring=333,e.cedilla=333,e.hungarumlaut=333,e.ogonek=333,e.caron=333,e.emdash=1e3,e.AE=1e3,e.ordfeminine=370,e.Lslash=556,e.Oslash=778,e.OE=1e3,e.ordmasculine=365,e.ae=889,e.dotlessi=278,e.lslash=222,e.oslash=611,e.oe=944,e.germandbls=611,e.Idieresis=278,e.eacute=556,e.abreve=556,e.uhungarumlaut=556,e.ecaron=556,e.Ydieresis=667,e.divide=584,e.Yacute=667,e.Acircumflex=667,e.aacute=556,e.Ucircumflex=722,e.yacute=500,e.scommaaccent=500,e.ecircumflex=556,e.Uring=722,e.Udieresis=722,e.aogonek=556,e.Uacute=722,e.uogonek=556,e.Edieresis=667,e.Dcroat=722,e.commaaccent=250,e.copyright=737,e.Emacron=667,e.ccaron=500,e.aring=556,e.Ncommaaccent=722,e.lacute=222,e.agrave=556,e.Tcommaaccent=611,e.Cacute=722,e.atilde=556,e.Edotaccent=667,e.scaron=500,e.scedilla=500,e.iacute=278,e.lozenge=471,e.Rcaron=722,e.Gcommaaccent=778,e.ucircumflex=556,e.acircumflex=556,e.Amacron=667,e.rcaron=333,e.ccedilla=500,e.Zdotaccent=611,e.Thorn=667,e.Omacron=778,e.Racute=722,e.Sacute=667,e.dcaron=643,e.Umacron=722,e.uring=556,e.threesuperior=333,e.Ograve=778,e.Agrave=667,e.Abreve=667,e.multiply=584,e.uacute=556,e.Tcaron=611,e.partialdiff=476,e.ydieresis=500,e.Nacute=722,e.icircumflex=278,e.Ecircumflex=667,e.adieresis=556,e.edieresis=556,e.cacute=500,e.nacute=556,e.umacron=556,e.Ncaron=722,e.Iacute=278,e.plusminus=584,e.brokenbar=260,e.registered=737,e.Gbreve=778,e.Idotaccent=278,e.summation=600,e.Egrave=667,e.racute=333,e.omacron=556,e.Zacute=611,e.Zcaron=611,e.greaterequal=549,e.Eth=722,e.Ccedilla=722,e.lcommaaccent=222,e.tcaron=317,e.eogonek=556,e.Uogonek=722,e.Aacute=667,e.Adieresis=667,e.egrave=556,e.zacute=500,e.iogonek=222,e.Oacute=778,e.oacute=556,e.amacron=556,e.sacute=500,e.idieresis=278,e.Ocircumflex=778,e.Ugrave=722,e.Delta=612,e.thorn=556,e.twosuperior=333,e.Odieresis=778,e.mu=556,e.igrave=278,e.ohungarumlaut=556,e.Eogonek=667,e.dcroat=556,e.threequarters=834,e.Scedilla=667,e.lcaron=299,e.Kcommaaccent=667,e.Lacute=556,e.trademark=1e3,e.edotaccent=556,e.Igrave=278,e.Imacron=278,e.Lcaron=556,e.onehalf=834,e.lessequal=549,e.ocircumflex=556,e.ntilde=556,e.Uhungarumlaut=722,e.Eacute=667,e.emacron=556,e.gbreve=556,e.onequarter=834,e.Scaron=667,e.Scommaaccent=667,e.Ohungarumlaut=778,e.degree=400,e.ograve=556,e.Ccaron=722,e.ugrave=556,e.radical=453,e.Dcaron=722,e.rcommaaccent=333,e.Ntilde=722,e.otilde=556,e.Rcommaaccent=722,e.Lcommaaccent=556,e.Atilde=667,e.Aogonek=667,e.Aring=667,e.Otilde=778,e.zdotaccent=500,e.Ecaron=667,e.Iogonek=278,e.kcommaaccent=500,e.minus=584,e.Icircumflex=278,e.ncaron=556,e.tcommaaccent=278,e.logicalnot=584,e.odieresis=556,e.udieresis=556,e.notequal=549,e.gcommaaccent=556,e.eth=556,e.zcaron=500,e.ncommaaccent=556,e.onesuperior=333,e.imacron=278,e.Euro=556}),e[`Helvetica-Bold`]=sr(function(e){e.space=278,e.exclam=333,e.quotedbl=474,e.numbersign=556,e.dollar=556,e.percent=889,e.ampersand=722,e.quoteright=278,e.parenleft=333,e.parenright=333,e.asterisk=389,e.plus=584,e.comma=278,e.hyphen=333,e.period=278,e.slash=278,e.zero=556,e.one=556,e.two=556,e.three=556,e.four=556,e.five=556,e.six=556,e.seven=556,e.eight=556,e.nine=556,e.colon=333,e.semicolon=333,e.less=584,e.equal=584,e.greater=584,e.question=611,e.at=975,e.A=722,e.B=722,e.C=722,e.D=722,e.E=667,e.F=611,e.G=778,e.H=722,e.I=278,e.J=556,e.K=722,e.L=611,e.M=833,e.N=722,e.O=778,e.P=667,e.Q=778,e.R=722,e.S=667,e.T=611,e.U=722,e.V=667,e.W=944,e.X=667,e.Y=667,e.Z=611,e.bracketleft=333,e.backslash=278,e.bracketright=333,e.asciicircum=584,e.underscore=556,e.quoteleft=278,e.a=556,e.b=611,e.c=556,e.d=611,e.e=556,e.f=333,e.g=611,e.h=611,e.i=278,e.j=278,e.k=556,e.l=278,e.m=889,e.n=611,e.o=611,e.p=611,e.q=611,e.r=389,e.s=556,e.t=333,e.u=611,e.v=556,e.w=778,e.x=556,e.y=556,e.z=500,e.braceleft=389,e.bar=280,e.braceright=389,e.asciitilde=584,e.exclamdown=333,e.cent=556,e.sterling=556,e.fraction=167,e.yen=556,e.florin=556,e.section=556,e.currency=556,e.quotesingle=238,e.quotedblleft=500,e.guillemotleft=556,e.guilsinglleft=333,e.guilsinglright=333,e.fi=611,e.fl=611,e.endash=556,e.dagger=556,e.daggerdbl=556,e.periodcentered=278,e.paragraph=556,e.bullet=350,e.quotesinglbase=278,e.quotedblbase=500,e.quotedblright=500,e.guillemotright=556,e.ellipsis=1e3,e.perthousand=1e3,e.questiondown=611,e.grave=333,e.acute=333,e.circumflex=333,e.tilde=333,e.macron=333,e.breve=333,e.dotaccent=333,e.dieresis=333,e.ring=333,e.cedilla=333,e.hungarumlaut=333,e.ogonek=333,e.caron=333,e.emdash=1e3,e.AE=1e3,e.ordfeminine=370,e.Lslash=611,e.Oslash=778,e.OE=1e3,e.ordmasculine=365,e.ae=889,e.dotlessi=278,e.lslash=278,e.oslash=611,e.oe=944,e.germandbls=611,e.Idieresis=278,e.eacute=556,e.abreve=556,e.uhungarumlaut=611,e.ecaron=556,e.Ydieresis=667,e.divide=584,e.Yacute=667,e.Acircumflex=722,e.aacute=556,e.Ucircumflex=722,e.yacute=556,e.scommaaccent=556,e.ecircumflex=556,e.Uring=722,e.Udieresis=722,e.aogonek=556,e.Uacute=722,e.uogonek=611,e.Edieresis=667,e.Dcroat=722,e.commaaccent=250,e.copyright=737,e.Emacron=667,e.ccaron=556,e.aring=556,e.Ncommaaccent=722,e.lacute=278,e.agrave=556,e.Tcommaaccent=611,e.Cacute=722,e.atilde=556,e.Edotaccent=667,e.scaron=556,e.scedilla=556,e.iacute=278,e.lozenge=494,e.Rcaron=722,e.Gcommaaccent=778,e.ucircumflex=611,e.acircumflex=556,e.Amacron=722,e.rcaron=389,e.ccedilla=556,e.Zdotaccent=611,e.Thorn=667,e.Omacron=778,e.Racute=722,e.Sacute=667,e.dcaron=743,e.Umacron=722,e.uring=611,e.threesuperior=333,e.Ograve=778,e.Agrave=722,e.Abreve=722,e.multiply=584,e.uacute=611,e.Tcaron=611,e.partialdiff=494,e.ydieresis=556,e.Nacute=722,e.icircumflex=278,e.Ecircumflex=667,e.adieresis=556,e.edieresis=556,e.cacute=556,e.nacute=611,e.umacron=611,e.Ncaron=722,e.Iacute=278,e.plusminus=584,e.brokenbar=280,e.registered=737,e.Gbreve=778,e.Idotaccent=278,e.summation=600,e.Egrave=667,e.racute=389,e.omacron=611,e.Zacute=611,e.Zcaron=611,e.greaterequal=549,e.Eth=722,e.Ccedilla=722,e.lcommaaccent=278,e.tcaron=389,e.eogonek=556,e.Uogonek=722,e.Aacute=722,e.Adieresis=722,e.egrave=556,e.zacute=500,e.iogonek=278,e.Oacute=778,e.oacute=611,e.amacron=556,e.sacute=556,e.idieresis=278,e.Ocircumflex=778,e.Ugrave=722,e.Delta=612,e.thorn=611,e.twosuperior=333,e.Odieresis=778,e.mu=611,e.igrave=278,e.ohungarumlaut=611,e.Eogonek=667,e.dcroat=611,e.threequarters=834,e.Scedilla=667,e.lcaron=400,e.Kcommaaccent=722,e.Lacute=611,e.trademark=1e3,e.edotaccent=556,e.Igrave=278,e.Imacron=278,e.Lcaron=611,e.onehalf=834,e.lessequal=549,e.ocircumflex=611,e.ntilde=611,e.Uhungarumlaut=722,e.Eacute=667,e.emacron=556,e.gbreve=611,e.onequarter=834,e.Scaron=667,e.Scommaaccent=667,e.Ohungarumlaut=778,e.degree=400,e.ograve=611,e.Ccaron=722,e.ugrave=611,e.radical=549,e.Dcaron=722,e.rcommaaccent=389,e.Ntilde=722,e.otilde=611,e.Rcommaaccent=722,e.Lcommaaccent=611,e.Atilde=722,e.Aogonek=722,e.Aring=722,e.Otilde=778,e.zdotaccent=500,e.Ecaron=667,e.Iogonek=278,e.kcommaaccent=556,e.minus=584,e.Icircumflex=278,e.ncaron=611,e.tcommaaccent=333,e.logicalnot=584,e.odieresis=611,e.udieresis=611,e.notequal=549,e.gcommaaccent=611,e.eth=611,e.zcaron=500,e.ncommaaccent=611,e.onesuperior=333,e.imacron=278,e.Euro=556}),e[`Helvetica-BoldOblique`]=sr(function(e){e.space=278,e.exclam=333,e.quotedbl=474,e.numbersign=556,e.dollar=556,e.percent=889,e.ampersand=722,e.quoteright=278,e.parenleft=333,e.parenright=333,e.asterisk=389,e.plus=584,e.comma=278,e.hyphen=333,e.period=278,e.slash=278,e.zero=556,e.one=556,e.two=556,e.three=556,e.four=556,e.five=556,e.six=556,e.seven=556,e.eight=556,e.nine=556,e.colon=333,e.semicolon=333,e.less=584,e.equal=584,e.greater=584,e.question=611,e.at=975,e.A=722,e.B=722,e.C=722,e.D=722,e.E=667,e.F=611,e.G=778,e.H=722,e.I=278,e.J=556,e.K=722,e.L=611,e.M=833,e.N=722,e.O=778,e.P=667,e.Q=778,e.R=722,e.S=667,e.T=611,e.U=722,e.V=667,e.W=944,e.X=667,e.Y=667,e.Z=611,e.bracketleft=333,e.backslash=278,e.bracketright=333,e.asciicircum=584,e.underscore=556,e.quoteleft=278,e.a=556,e.b=611,e.c=556,e.d=611,e.e=556,e.f=333,e.g=611,e.h=611,e.i=278,e.j=278,e.k=556,e.l=278,e.m=889,e.n=611,e.o=611,e.p=611,e.q=611,e.r=389,e.s=556,e.t=333,e.u=611,e.v=556,e.w=778,e.x=556,e.y=556,e.z=500,e.braceleft=389,e.bar=280,e.braceright=389,e.asciitilde=584,e.exclamdown=333,e.cent=556,e.sterling=556,e.fraction=167,e.yen=556,e.florin=556,e.section=556,e.currency=556,e.quotesingle=238,e.quotedblleft=500,e.guillemotleft=556,e.guilsinglleft=333,e.guilsinglright=333,e.fi=611,e.fl=611,e.endash=556,e.dagger=556,e.daggerdbl=556,e.periodcentered=278,e.paragraph=556,e.bullet=350,e.quotesinglbase=278,e.quotedblbase=500,e.quotedblright=500,e.guillemotright=556,e.ellipsis=1e3,e.perthousand=1e3,e.questiondown=611,e.grave=333,e.acute=333,e.circumflex=333,e.tilde=333,e.macron=333,e.breve=333,e.dotaccent=333,e.dieresis=333,e.ring=333,e.cedilla=333,e.hungarumlaut=333,e.ogonek=333,e.caron=333,e.emdash=1e3,e.AE=1e3,e.ordfeminine=370,e.Lslash=611,e.Oslash=778,e.OE=1e3,e.ordmasculine=365,e.ae=889,e.dotlessi=278,e.lslash=278,e.oslash=611,e.oe=944,e.germandbls=611,e.Idieresis=278,e.eacute=556,e.abreve=556,e.uhungarumlaut=611,e.ecaron=556,e.Ydieresis=667,e.divide=584,e.Yacute=667,e.Acircumflex=722,e.aacute=556,e.Ucircumflex=722,e.yacute=556,e.scommaaccent=556,e.ecircumflex=556,e.Uring=722,e.Udieresis=722,e.aogonek=556,e.Uacute=722,e.uogonek=611,e.Edieresis=667,e.Dcroat=722,e.commaaccent=250,e.copyright=737,e.Emacron=667,e.ccaron=556,e.aring=556,e.Ncommaaccent=722,e.lacute=278,e.agrave=556,e.Tcommaaccent=611,e.Cacute=722,e.atilde=556,e.Edotaccent=667,e.scaron=556,e.scedilla=556,e.iacute=278,e.lozenge=494,e.Rcaron=722,e.Gcommaaccent=778,e.ucircumflex=611,e.acircumflex=556,e.Amacron=722,e.rcaron=389,e.ccedilla=556,e.Zdotaccent=611,e.Thorn=667,e.Omacron=778,e.Racute=722,e.Sacute=667,e.dcaron=743,e.Umacron=722,e.uring=611,e.threesuperior=333,e.Ograve=778,e.Agrave=722,e.Abreve=722,e.multiply=584,e.uacute=611,e.Tcaron=611,e.partialdiff=494,e.ydieresis=556,e.Nacute=722,e.icircumflex=278,e.Ecircumflex=667,e.adieresis=556,e.edieresis=556,e.cacute=556,e.nacute=611,e.umacron=611,e.Ncaron=722,e.Iacute=278,e.plusminus=584,e.brokenbar=280,e.registered=737,e.Gbreve=778,e.Idotaccent=278,e.summation=600,e.Egrave=667,e.racute=389,e.omacron=611,e.Zacute=611,e.Zcaron=611,e.greaterequal=549,e.Eth=722,e.Ccedilla=722,e.lcommaaccent=278,e.tcaron=389,e.eogonek=556,e.Uogonek=722,e.Aacute=722,e.Adieresis=722,e.egrave=556,e.zacute=500,e.iogonek=278,e.Oacute=778,e.oacute=611,e.amacron=556,e.sacute=556,e.idieresis=278,e.Ocircumflex=778,e.Ugrave=722,e.Delta=612,e.thorn=611,e.twosuperior=333,e.Odieresis=778,e.mu=611,e.igrave=278,e.ohungarumlaut=611,e.Eogonek=667,e.dcroat=611,e.threequarters=834,e.Scedilla=667,e.lcaron=400,e.Kcommaaccent=722,e.Lacute=611,e.trademark=1e3,e.edotaccent=556,e.Igrave=278,e.Imacron=278,e.Lcaron=611,e.onehalf=834,e.lessequal=549,e.ocircumflex=611,e.ntilde=611,e.Uhungarumlaut=722,e.Eacute=667,e.emacron=556,e.gbreve=611,e.onequarter=834,e.Scaron=667,e.Scommaaccent=667,e.Ohungarumlaut=778,e.degree=400,e.ograve=611,e.Ccaron=722,e.ugrave=611,e.radical=549,e.Dcaron=722,e.rcommaaccent=389,e.Ntilde=722,e.otilde=611,e.Rcommaaccent=722,e.Lcommaaccent=611,e.Atilde=722,e.Aogonek=722,e.Aring=722,e.Otilde=778,e.zdotaccent=500,e.Ecaron=667,e.Iogonek=278,e.kcommaaccent=556,e.minus=584,e.Icircumflex=278,e.ncaron=611,e.tcommaaccent=333,e.logicalnot=584,e.odieresis=611,e.udieresis=611,e.notequal=549,e.gcommaaccent=611,e.eth=611,e.zcaron=500,e.ncommaaccent=611,e.onesuperior=333,e.imacron=278,e.Euro=556}),e[`Helvetica-Oblique`]=sr(function(e){e.space=278,e.exclam=278,e.quotedbl=355,e.numbersign=556,e.dollar=556,e.percent=889,e.ampersand=667,e.quoteright=222,e.parenleft=333,e.parenright=333,e.asterisk=389,e.plus=584,e.comma=278,e.hyphen=333,e.period=278,e.slash=278,e.zero=556,e.one=556,e.two=556,e.three=556,e.four=556,e.five=556,e.six=556,e.seven=556,e.eight=556,e.nine=556,e.colon=278,e.semicolon=278,e.less=584,e.equal=584,e.greater=584,e.question=556,e.at=1015,e.A=667,e.B=667,e.C=722,e.D=722,e.E=667,e.F=611,e.G=778,e.H=722,e.I=278,e.J=500,e.K=667,e.L=556,e.M=833,e.N=722,e.O=778,e.P=667,e.Q=778,e.R=722,e.S=667,e.T=611,e.U=722,e.V=667,e.W=944,e.X=667,e.Y=667,e.Z=611,e.bracketleft=278,e.backslash=278,e.bracketright=278,e.asciicircum=469,e.underscore=556,e.quoteleft=222,e.a=556,e.b=556,e.c=500,e.d=556,e.e=556,e.f=278,e.g=556,e.h=556,e.i=222,e.j=222,e.k=500,e.l=222,e.m=833,e.n=556,e.o=556,e.p=556,e.q=556,e.r=333,e.s=500,e.t=278,e.u=556,e.v=500,e.w=722,e.x=500,e.y=500,e.z=500,e.braceleft=334,e.bar=260,e.braceright=334,e.asciitilde=584,e.exclamdown=333,e.cent=556,e.sterling=556,e.fraction=167,e.yen=556,e.florin=556,e.section=556,e.currency=556,e.quotesingle=191,e.quotedblleft=333,e.guillemotleft=556,e.guilsinglleft=333,e.guilsinglright=333,e.fi=500,e.fl=500,e.endash=556,e.dagger=556,e.daggerdbl=556,e.periodcentered=278,e.paragraph=537,e.bullet=350,e.quotesinglbase=222,e.quotedblbase=333,e.quotedblright=333,e.guillemotright=556,e.ellipsis=1e3,e.perthousand=1e3,e.questiondown=611,e.grave=333,e.acute=333,e.circumflex=333,e.tilde=333,e.macron=333,e.breve=333,e.dotaccent=333,e.dieresis=333,e.ring=333,e.cedilla=333,e.hungarumlaut=333,e.ogonek=333,e.caron=333,e.emdash=1e3,e.AE=1e3,e.ordfeminine=370,e.Lslash=556,e.Oslash=778,e.OE=1e3,e.ordmasculine=365,e.ae=889,e.dotlessi=278,e.lslash=222,e.oslash=611,e.oe=944,e.germandbls=611,e.Idieresis=278,e.eacute=556,e.abreve=556,e.uhungarumlaut=556,e.ecaron=556,e.Ydieresis=667,e.divide=584,e.Yacute=667,e.Acircumflex=667,e.aacute=556,e.Ucircumflex=722,e.yacute=500,e.scommaaccent=500,e.ecircumflex=556,e.Uring=722,e.Udieresis=722,e.aogonek=556,e.Uacute=722,e.uogonek=556,e.Edieresis=667,e.Dcroat=722,e.commaaccent=250,e.copyright=737,e.Emacron=667,e.ccaron=500,e.aring=556,e.Ncommaaccent=722,e.lacute=222,e.agrave=556,e.Tcommaaccent=611,e.Cacute=722,e.atilde=556,e.Edotaccent=667,e.scaron=500,e.scedilla=500,e.iacute=278,e.lozenge=471,e.Rcaron=722,e.Gcommaaccent=778,e.ucircumflex=556,e.acircumflex=556,e.Amacron=667,e.rcaron=333,e.ccedilla=500,e.Zdotaccent=611,e.Thorn=667,e.Omacron=778,e.Racute=722,e.Sacute=667,e.dcaron=643,e.Umacron=722,e.uring=556,e.threesuperior=333,e.Ograve=778,e.Agrave=667,e.Abreve=667,e.multiply=584,e.uacute=556,e.Tcaron=611,e.partialdiff=476,e.ydieresis=500,e.Nacute=722,e.icircumflex=278,e.Ecircumflex=667,e.adieresis=556,e.edieresis=556,e.cacute=500,e.nacute=556,e.umacron=556,e.Ncaron=722,e.Iacute=278,e.plusminus=584,e.brokenbar=260,e.registered=737,e.Gbreve=778,e.Idotaccent=278,e.summation=600,e.Egrave=667,e.racute=333,e.omacron=556,e.Zacute=611,e.Zcaron=611,e.greaterequal=549,e.Eth=722,e.Ccedilla=722,e.lcommaaccent=222,e.tcaron=317,e.eogonek=556,e.Uogonek=722,e.Aacute=667,e.Adieresis=667,e.egrave=556,e.zacute=500,e.iogonek=222,e.Oacute=778,e.oacute=556,e.amacron=556,e.sacute=500,e.idieresis=278,e.Ocircumflex=778,e.Ugrave=722,e.Delta=612,e.thorn=556,e.twosuperior=333,e.Odieresis=778,e.mu=556,e.igrave=278,e.ohungarumlaut=556,e.Eogonek=667,e.dcroat=556,e.threequarters=834,e.Scedilla=667,e.lcaron=299,e.Kcommaaccent=667,e.Lacute=556,e.trademark=1e3,e.edotaccent=556,e.Igrave=278,e.Imacron=278,e.Lcaron=556,e.onehalf=834,e.lessequal=549,e.ocircumflex=556,e.ntilde=556,e.Uhungarumlaut=722,e.Eacute=667,e.emacron=556,e.gbreve=556,e.onequarter=834,e.Scaron=667,e.Scommaaccent=667,e.Ohungarumlaut=778,e.degree=400,e.ograve=556,e.Ccaron=722,e.ugrave=556,e.radical=453,e.Dcaron=722,e.rcommaaccent=333,e.Ntilde=722,e.otilde=556,e.Rcommaaccent=722,e.Lcommaaccent=556,e.Atilde=667,e.Aogonek=667,e.Aring=667,e.Otilde=778,e.zdotaccent=500,e.Ecaron=667,e.Iogonek=278,e.kcommaaccent=500,e.minus=584,e.Icircumflex=278,e.ncaron=556,e.tcommaaccent=278,e.logicalnot=584,e.odieresis=556,e.udieresis=556,e.notequal=549,e.gcommaaccent=556,e.eth=556,e.zcaron=500,e.ncommaaccent=556,e.onesuperior=333,e.imacron=278,e.Euro=556}),e.Symbol=sr(function(e){e.space=250,e.exclam=333,e.universal=713,e.numbersign=500,e.existential=549,e.percent=833,e.ampersand=778,e.suchthat=439,e.parenleft=333,e.parenright=333,e.asteriskmath=500,e.plus=549,e.comma=250,e.minus=549,e.period=250,e.slash=278,e.zero=500,e.one=500,e.two=500,e.three=500,e.four=500,e.five=500,e.six=500,e.seven=500,e.eight=500,e.nine=500,e.colon=278,e.semicolon=278,e.less=549,e.equal=549,e.greater=549,e.question=444,e.congruent=549,e.Alpha=722,e.Beta=667,e.Chi=722,e.Delta=612,e.Epsilon=611,e.Phi=763,e.Gamma=603,e.Eta=722,e.Iota=333,e.theta1=631,e.Kappa=722,e.Lambda=686,e.Mu=889,e.Nu=722,e.Omicron=722,e.Pi=768,e.Theta=741,e.Rho=556,e.Sigma=592,e.Tau=611,e.Upsilon=690,e.sigma1=439,e.Omega=768,e.Xi=645,e.Psi=795,e.Zeta=611,e.bracketleft=333,e.therefore=863,e.bracketright=333,e.perpendicular=658,e.underscore=500,e.radicalex=500,e.alpha=631,e.beta=549,e.chi=549,e.delta=494,e.epsilon=439,e.phi=521,e.gamma=411,e.eta=603,e.iota=329,e.phi1=603,e.kappa=549,e.lambda=549,e.mu=576,e.nu=521,e.omicron=549,e.pi=549,e.theta=521,e.rho=549,e.sigma=603,e.tau=439,e.upsilon=576,e.omega1=713,e.omega=686,e.xi=493,e.psi=686,e.zeta=494,e.braceleft=480,e.bar=200,e.braceright=480,e.similar=549,e.Euro=750,e.Upsilon1=620,e.minute=247,e.lessequal=549,e.fraction=167,e.infinity=713,e.florin=500,e.club=753,e.diamond=753,e.heart=753,e.spade=753,e.arrowboth=1042,e.arrowleft=987,e.arrowup=603,e.arrowright=987,e.arrowdown=603,e.degree=400,e.plusminus=549,e.second=411,e.greaterequal=549,e.multiply=549,e.proportional=713,e.partialdiff=494,e.bullet=460,e.divide=549,e.notequal=549,e.equivalence=549,e.approxequal=549,e.ellipsis=1e3,e.arrowvertex=603,e.arrowhorizex=1e3,e.carriagereturn=658,e.aleph=823,e.Ifraktur=686,e.Rfraktur=795,e.weierstrass=987,e.circlemultiply=768,e.circleplus=768,e.emptyset=823,e.intersection=768,e.union=768,e.propersuperset=713,e.reflexsuperset=713,e.notsubset=713,e.propersubset=713,e.reflexsubset=713,e.element=713,e.notelement=713,e.angle=768,e.gradient=713,e.registerserif=790,e.copyrightserif=790,e.trademarkserif=890,e.product=823,e.radical=549,e.dotmath=250,e.logicalnot=713,e.logicaland=603,e.logicalor=603,e.arrowdblboth=1042,e.arrowdblleft=987,e.arrowdblup=603,e.arrowdblright=987,e.arrowdbldown=603,e.lozenge=494,e.angleleft=329,e.registersans=790,e.copyrightsans=790,e.trademarksans=786,e.summation=713,e.parenlefttp=384,e.parenleftex=384,e.parenleftbt=384,e.bracketlefttp=384,e.bracketleftex=384,e.bracketleftbt=384,e.bracelefttp=494,e.braceleftmid=494,e.braceleftbt=494,e.braceex=494,e.angleright=329,e.integral=274,e.integraltp=686,e.integralex=686,e.integralbt=686,e.parenrighttp=384,e.parenrightex=384,e.parenrightbt=384,e.bracketrighttp=384,e.bracketrightex=384,e.bracketrightbt=384,e.bracerighttp=494,e.bracerightmid=494,e.bracerightbt=494,e.apple=790}),e[`Times-Roman`]=sr(function(e){e.space=250,e.exclam=333,e.quotedbl=408,e.numbersign=500,e.dollar=500,e.percent=833,e.ampersand=778,e.quoteright=333,e.parenleft=333,e.parenright=333,e.asterisk=500,e.plus=564,e.comma=250,e.hyphen=333,e.period=250,e.slash=278,e.zero=500,e.one=500,e.two=500,e.three=500,e.four=500,e.five=500,e.six=500,e.seven=500,e.eight=500,e.nine=500,e.colon=278,e.semicolon=278,e.less=564,e.equal=564,e.greater=564,e.question=444,e.at=921,e.A=722,e.B=667,e.C=667,e.D=722,e.E=611,e.F=556,e.G=722,e.H=722,e.I=333,e.J=389,e.K=722,e.L=611,e.M=889,e.N=722,e.O=722,e.P=556,e.Q=722,e.R=667,e.S=556,e.T=611,e.U=722,e.V=722,e.W=944,e.X=722,e.Y=722,e.Z=611,e.bracketleft=333,e.backslash=278,e.bracketright=333,e.asciicircum=469,e.underscore=500,e.quoteleft=333,e.a=444,e.b=500,e.c=444,e.d=500,e.e=444,e.f=333,e.g=500,e.h=500,e.i=278,e.j=278,e.k=500,e.l=278,e.m=778,e.n=500,e.o=500,e.p=500,e.q=500,e.r=333,e.s=389,e.t=278,e.u=500,e.v=500,e.w=722,e.x=500,e.y=500,e.z=444,e.braceleft=480,e.bar=200,e.braceright=480,e.asciitilde=541,e.exclamdown=333,e.cent=500,e.sterling=500,e.fraction=167,e.yen=500,e.florin=500,e.section=500,e.currency=500,e.quotesingle=180,e.quotedblleft=444,e.guillemotleft=500,e.guilsinglleft=333,e.guilsinglright=333,e.fi=556,e.fl=556,e.endash=500,e.dagger=500,e.daggerdbl=500,e.periodcentered=250,e.paragraph=453,e.bullet=350,e.quotesinglbase=333,e.quotedblbase=444,e.quotedblright=444,e.guillemotright=500,e.ellipsis=1e3,e.perthousand=1e3,e.questiondown=444,e.grave=333,e.acute=333,e.circumflex=333,e.tilde=333,e.macron=333,e.breve=333,e.dotaccent=333,e.dieresis=333,e.ring=333,e.cedilla=333,e.hungarumlaut=333,e.ogonek=333,e.caron=333,e.emdash=1e3,e.AE=889,e.ordfeminine=276,e.Lslash=611,e.Oslash=722,e.OE=889,e.ordmasculine=310,e.ae=667,e.dotlessi=278,e.lslash=278,e.oslash=500,e.oe=722,e.germandbls=500,e.Idieresis=333,e.eacute=444,e.abreve=444,e.uhungarumlaut=500,e.ecaron=444,e.Ydieresis=722,e.divide=564,e.Yacute=722,e.Acircumflex=722,e.aacute=444,e.Ucircumflex=722,e.yacute=500,e.scommaaccent=389,e.ecircumflex=444,e.Uring=722,e.Udieresis=722,e.aogonek=444,e.Uacute=722,e.uogonek=500,e.Edieresis=611,e.Dcroat=722,e.commaaccent=250,e.copyright=760,e.Emacron=611,e.ccaron=444,e.aring=444,e.Ncommaaccent=722,e.lacute=278,e.agrave=444,e.Tcommaaccent=611,e.Cacute=667,e.atilde=444,e.Edotaccent=611,e.scaron=389,e.scedilla=389,e.iacute=278,e.lozenge=471,e.Rcaron=667,e.Gcommaaccent=722,e.ucircumflex=500,e.acircumflex=444,e.Amacron=722,e.rcaron=333,e.ccedilla=444,e.Zdotaccent=611,e.Thorn=556,e.Omacron=722,e.Racute=667,e.Sacute=556,e.dcaron=588,e.Umacron=722,e.uring=500,e.threesuperior=300,e.Ograve=722,e.Agrave=722,e.Abreve=722,e.multiply=564,e.uacute=500,e.Tcaron=611,e.partialdiff=476,e.ydieresis=500,e.Nacute=722,e.icircumflex=278,e.Ecircumflex=611,e.adieresis=444,e.edieresis=444,e.cacute=444,e.nacute=500,e.umacron=500,e.Ncaron=722,e.Iacute=333,e.plusminus=564,e.brokenbar=200,e.registered=760,e.Gbreve=722,e.Idotaccent=333,e.summation=600,e.Egrave=611,e.racute=333,e.omacron=500,e.Zacute=611,e.Zcaron=611,e.greaterequal=549,e.Eth=722,e.Ccedilla=667,e.lcommaaccent=278,e.tcaron=326,e.eogonek=444,e.Uogonek=722,e.Aacute=722,e.Adieresis=722,e.egrave=444,e.zacute=444,e.iogonek=278,e.Oacute=722,e.oacute=500,e.amacron=444,e.sacute=389,e.idieresis=278,e.Ocircumflex=722,e.Ugrave=722,e.Delta=612,e.thorn=500,e.twosuperior=300,e.Odieresis=722,e.mu=500,e.igrave=278,e.ohungarumlaut=500,e.Eogonek=611,e.dcroat=500,e.threequarters=750,e.Scedilla=556,e.lcaron=344,e.Kcommaaccent=722,e.Lacute=611,e.trademark=980,e.edotaccent=444,e.Igrave=333,e.Imacron=333,e.Lcaron=611,e.onehalf=750,e.lessequal=549,e.ocircumflex=500,e.ntilde=500,e.Uhungarumlaut=722,e.Eacute=611,e.emacron=444,e.gbreve=500,e.onequarter=750,e.Scaron=556,e.Scommaaccent=556,e.Ohungarumlaut=722,e.degree=400,e.ograve=500,e.Ccaron=667,e.ugrave=500,e.radical=453,e.Dcaron=722,e.rcommaaccent=333,e.Ntilde=722,e.otilde=500,e.Rcommaaccent=667,e.Lcommaaccent=611,e.Atilde=722,e.Aogonek=722,e.Aring=722,e.Otilde=722,e.zdotaccent=444,e.Ecaron=611,e.Iogonek=333,e.kcommaaccent=500,e.minus=564,e.Icircumflex=333,e.ncaron=500,e.tcommaaccent=278,e.logicalnot=564,e.odieresis=500,e.udieresis=500,e.notequal=549,e.gcommaaccent=500,e.eth=500,e.zcaron=444,e.ncommaaccent=500,e.onesuperior=300,e.imacron=278,e.Euro=500}),e[`Times-Bold`]=sr(function(e){e.space=250,e.exclam=333,e.quotedbl=555,e.numbersign=500,e.dollar=500,e.percent=1e3,e.ampersand=833,e.quoteright=333,e.parenleft=333,e.parenright=333,e.asterisk=500,e.plus=570,e.comma=250,e.hyphen=333,e.period=250,e.slash=278,e.zero=500,e.one=500,e.two=500,e.three=500,e.four=500,e.five=500,e.six=500,e.seven=500,e.eight=500,e.nine=500,e.colon=333,e.semicolon=333,e.less=570,e.equal=570,e.greater=570,e.question=500,e.at=930,e.A=722,e.B=667,e.C=722,e.D=722,e.E=667,e.F=611,e.G=778,e.H=778,e.I=389,e.J=500,e.K=778,e.L=667,e.M=944,e.N=722,e.O=778,e.P=611,e.Q=778,e.R=722,e.S=556,e.T=667,e.U=722,e.V=722,e.W=1e3,e.X=722,e.Y=722,e.Z=667,e.bracketleft=333,e.backslash=278,e.bracketright=333,e.asciicircum=581,e.underscore=500,e.quoteleft=333,e.a=500,e.b=556,e.c=444,e.d=556,e.e=444,e.f=333,e.g=500,e.h=556,e.i=278,e.j=333,e.k=556,e.l=278,e.m=833,e.n=556,e.o=500,e.p=556,e.q=556,e.r=444,e.s=389,e.t=333,e.u=556,e.v=500,e.w=722,e.x=500,e.y=500,e.z=444,e.braceleft=394,e.bar=220,e.braceright=394,e.asciitilde=520,e.exclamdown=333,e.cent=500,e.sterling=500,e.fraction=167,e.yen=500,e.florin=500,e.section=500,e.currency=500,e.quotesingle=278,e.quotedblleft=500,e.guillemotleft=500,e.guilsinglleft=333,e.guilsinglright=333,e.fi=556,e.fl=556,e.endash=500,e.dagger=500,e.daggerdbl=500,e.periodcentered=250,e.paragraph=540,e.bullet=350,e.quotesinglbase=333,e.quotedblbase=500,e.quotedblright=500,e.guillemotright=500,e.ellipsis=1e3,e.perthousand=1e3,e.questiondown=500,e.grave=333,e.acute=333,e.circumflex=333,e.tilde=333,e.macron=333,e.breve=333,e.dotaccent=333,e.dieresis=333,e.ring=333,e.cedilla=333,e.hungarumlaut=333,e.ogonek=333,e.caron=333,e.emdash=1e3,e.AE=1e3,e.ordfeminine=300,e.Lslash=667,e.Oslash=778,e.OE=1e3,e.ordmasculine=330,e.ae=722,e.dotlessi=278,e.lslash=278,e.oslash=500,e.oe=722,e.germandbls=556,e.Idieresis=389,e.eacute=444,e.abreve=500,e.uhungarumlaut=556,e.ecaron=444,e.Ydieresis=722,e.divide=570,e.Yacute=722,e.Acircumflex=722,e.aacute=500,e.Ucircumflex=722,e.yacute=500,e.scommaaccent=389,e.ecircumflex=444,e.Uring=722,e.Udieresis=722,e.aogonek=500,e.Uacute=722,e.uogonek=556,e.Edieresis=667,e.Dcroat=722,e.commaaccent=250,e.copyright=747,e.Emacron=667,e.ccaron=444,e.aring=500,e.Ncommaaccent=722,e.lacute=278,e.agrave=500,e.Tcommaaccent=667,e.Cacute=722,e.atilde=500,e.Edotaccent=667,e.scaron=389,e.scedilla=389,e.iacute=278,e.lozenge=494,e.Rcaron=722,e.Gcommaaccent=778,e.ucircumflex=556,e.acircumflex=500,e.Amacron=722,e.rcaron=444,e.ccedilla=444,e.Zdotaccent=667,e.Thorn=611,e.Omacron=778,e.Racute=722,e.Sacute=556,e.dcaron=672,e.Umacron=722,e.uring=556,e.threesuperior=300,e.Ograve=778,e.Agrave=722,e.Abreve=722,e.multiply=570,e.uacute=556,e.Tcaron=667,e.partialdiff=494,e.ydieresis=500,e.Nacute=722,e.icircumflex=278,e.Ecircumflex=667,e.adieresis=500,e.edieresis=444,e.cacute=444,e.nacute=556,e.umacron=556,e.Ncaron=722,e.Iacute=389,e.plusminus=570,e.brokenbar=220,e.registered=747,e.Gbreve=778,e.Idotaccent=389,e.summation=600,e.Egrave=667,e.racute=444,e.omacron=500,e.Zacute=667,e.Zcaron=667,e.greaterequal=549,e.Eth=722,e.Ccedilla=722,e.lcommaaccent=278,e.tcaron=416,e.eogonek=444,e.Uogonek=722,e.Aacute=722,e.Adieresis=722,e.egrave=444,e.zacute=444,e.iogonek=278,e.Oacute=778,e.oacute=500,e.amacron=500,e.sacute=389,e.idieresis=278,e.Ocircumflex=778,e.Ugrave=722,e.Delta=612,e.thorn=556,e.twosuperior=300,e.Odieresis=778,e.mu=556,e.igrave=278,e.ohungarumlaut=500,e.Eogonek=667,e.dcroat=556,e.threequarters=750,e.Scedilla=556,e.lcaron=394,e.Kcommaaccent=778,e.Lacute=667,e.trademark=1e3,e.edotaccent=444,e.Igrave=389,e.Imacron=389,e.Lcaron=667,e.onehalf=750,e.lessequal=549,e.ocircumflex=500,e.ntilde=556,e.Uhungarumlaut=722,e.Eacute=667,e.emacron=444,e.gbreve=500,e.onequarter=750,e.Scaron=556,e.Scommaaccent=556,e.Ohungarumlaut=778,e.degree=400,e.ograve=500,e.Ccaron=722,e.ugrave=556,e.radical=549,e.Dcaron=722,e.rcommaaccent=444,e.Ntilde=722,e.otilde=500,e.Rcommaaccent=722,e.Lcommaaccent=667,e.Atilde=722,e.Aogonek=722,e.Aring=722,e.Otilde=778,e.zdotaccent=444,e.Ecaron=667,e.Iogonek=389,e.kcommaaccent=556,e.minus=570,e.Icircumflex=389,e.ncaron=556,e.tcommaaccent=333,e.logicalnot=570,e.odieresis=500,e.udieresis=556,e.notequal=549,e.gcommaaccent=500,e.eth=500,e.zcaron=444,e.ncommaaccent=556,e.onesuperior=300,e.imacron=278,e.Euro=500}),e[`Times-BoldItalic`]=sr(function(e){e.space=250,e.exclam=389,e.quotedbl=555,e.numbersign=500,e.dollar=500,e.percent=833,e.ampersand=778,e.quoteright=333,e.parenleft=333,e.parenright=333,e.asterisk=500,e.plus=570,e.comma=250,e.hyphen=333,e.period=250,e.slash=278,e.zero=500,e.one=500,e.two=500,e.three=500,e.four=500,e.five=500,e.six=500,e.seven=500,e.eight=500,e.nine=500,e.colon=333,e.semicolon=333,e.less=570,e.equal=570,e.greater=570,e.question=500,e.at=832,e.A=667,e.B=667,e.C=667,e.D=722,e.E=667,e.F=667,e.G=722,e.H=778,e.I=389,e.J=500,e.K=667,e.L=611,e.M=889,e.N=722,e.O=722,e.P=611,e.Q=722,e.R=667,e.S=556,e.T=611,e.U=722,e.V=667,e.W=889,e.X=667,e.Y=611,e.Z=611,e.bracketleft=333,e.backslash=278,e.bracketright=333,e.asciicircum=570,e.underscore=500,e.quoteleft=333,e.a=500,e.b=500,e.c=444,e.d=500,e.e=444,e.f=333,e.g=500,e.h=556,e.i=278,e.j=278,e.k=500,e.l=278,e.m=778,e.n=556,e.o=500,e.p=500,e.q=500,e.r=389,e.s=389,e.t=278,e.u=556,e.v=444,e.w=667,e.x=500,e.y=444,e.z=389,e.braceleft=348,e.bar=220,e.braceright=348,e.asciitilde=570,e.exclamdown=389,e.cent=500,e.sterling=500,e.fraction=167,e.yen=500,e.florin=500,e.section=500,e.currency=500,e.quotesingle=278,e.quotedblleft=500,e.guillemotleft=500,e.guilsinglleft=333,e.guilsinglright=333,e.fi=556,e.fl=556,e.endash=500,e.dagger=500,e.daggerdbl=500,e.periodcentered=250,e.paragraph=500,e.bullet=350,e.quotesinglbase=333,e.quotedblbase=500,e.quotedblright=500,e.guillemotright=500,e.ellipsis=1e3,e.perthousand=1e3,e.questiondown=500,e.grave=333,e.acute=333,e.circumflex=333,e.tilde=333,e.macron=333,e.breve=333,e.dotaccent=333,e.dieresis=333,e.ring=333,e.cedilla=333,e.hungarumlaut=333,e.ogonek=333,e.caron=333,e.emdash=1e3,e.AE=944,e.ordfeminine=266,e.Lslash=611,e.Oslash=722,e.OE=944,e.ordmasculine=300,e.ae=722,e.dotlessi=278,e.lslash=278,e.oslash=500,e.oe=722,e.germandbls=500,e.Idieresis=389,e.eacute=444,e.abreve=500,e.uhungarumlaut=556,e.ecaron=444,e.Ydieresis=611,e.divide=570,e.Yacute=611,e.Acircumflex=667,e.aacute=500,e.Ucircumflex=722,e.yacute=444,e.scommaaccent=389,e.ecircumflex=444,e.Uring=722,e.Udieresis=722,e.aogonek=500,e.Uacute=722,e.uogonek=556,e.Edieresis=667,e.Dcroat=722,e.commaaccent=250,e.copyright=747,e.Emacron=667,e.ccaron=444,e.aring=500,e.Ncommaaccent=722,e.lacute=278,e.agrave=500,e.Tcommaaccent=611,e.Cacute=667,e.atilde=500,e.Edotaccent=667,e.scaron=389,e.scedilla=389,e.iacute=278,e.lozenge=494,e.Rcaron=667,e.Gcommaaccent=722,e.ucircumflex=556,e.acircumflex=500,e.Amacron=667,e.rcaron=389,e.ccedilla=444,e.Zdotaccent=611,e.Thorn=611,e.Omacron=722,e.Racute=667,e.Sacute=556,e.dcaron=608,e.Umacron=722,e.uring=556,e.threesuperior=300,e.Ograve=722,e.Agrave=667,e.Abreve=667,e.multiply=570,e.uacute=556,e.Tcaron=611,e.partialdiff=494,e.ydieresis=444,e.Nacute=722,e.icircumflex=278,e.Ecircumflex=667,e.adieresis=500,e.edieresis=444,e.cacute=444,e.nacute=556,e.umacron=556,e.Ncaron=722,e.Iacute=389,e.plusminus=570,e.brokenbar=220,e.registered=747,e.Gbreve=722,e.Idotaccent=389,e.summation=600,e.Egrave=667,e.racute=389,e.omacron=500,e.Zacute=611,e.Zcaron=611,e.greaterequal=549,e.Eth=722,e.Ccedilla=667,e.lcommaaccent=278,e.tcaron=366,e.eogonek=444,e.Uogonek=722,e.Aacute=667,e.Adieresis=667,e.egrave=444,e.zacute=389,e.iogonek=278,e.Oacute=722,e.oacute=500,e.amacron=500,e.sacute=389,e.idieresis=278,e.Ocircumflex=722,e.Ugrave=722,e.Delta=612,e.thorn=500,e.twosuperior=300,e.Odieresis=722,e.mu=576,e.igrave=278,e.ohungarumlaut=500,e.Eogonek=667,e.dcroat=500,e.threequarters=750,e.Scedilla=556,e.lcaron=382,e.Kcommaaccent=667,e.Lacute=611,e.trademark=1e3,e.edotaccent=444,e.Igrave=389,e.Imacron=389,e.Lcaron=611,e.onehalf=750,e.lessequal=549,e.ocircumflex=500,e.ntilde=556,e.Uhungarumlaut=722,e.Eacute=667,e.emacron=444,e.gbreve=500,e.onequarter=750,e.Scaron=556,e.Scommaaccent=556,e.Ohungarumlaut=722,e.degree=400,e.ograve=500,e.Ccaron=667,e.ugrave=556,e.radical=549,e.Dcaron=722,e.rcommaaccent=389,e.Ntilde=722,e.otilde=500,e.Rcommaaccent=667,e.Lcommaaccent=611,e.Atilde=667,e.Aogonek=667,e.Aring=667,e.Otilde=722,e.zdotaccent=389,e.Ecaron=667,e.Iogonek=389,e.kcommaaccent=500,e.minus=606,e.Icircumflex=389,e.ncaron=556,e.tcommaaccent=278,e.logicalnot=606,e.odieresis=500,e.udieresis=556,e.notequal=549,e.gcommaaccent=500,e.eth=500,e.zcaron=389,e.ncommaaccent=556,e.onesuperior=300,e.imacron=278,e.Euro=500}),e[`Times-Italic`]=sr(function(e){e.space=250,e.exclam=333,e.quotedbl=420,e.numbersign=500,e.dollar=500,e.percent=833,e.ampersand=778,e.quoteright=333,e.parenleft=333,e.parenright=333,e.asterisk=500,e.plus=675,e.comma=250,e.hyphen=333,e.period=250,e.slash=278,e.zero=500,e.one=500,e.two=500,e.three=500,e.four=500,e.five=500,e.six=500,e.seven=500,e.eight=500,e.nine=500,e.colon=333,e.semicolon=333,e.less=675,e.equal=675,e.greater=675,e.question=500,e.at=920,e.A=611,e.B=611,e.C=667,e.D=722,e.E=611,e.F=611,e.G=722,e.H=722,e.I=333,e.J=444,e.K=667,e.L=556,e.M=833,e.N=667,e.O=722,e.P=611,e.Q=722,e.R=611,e.S=500,e.T=556,e.U=722,e.V=611,e.W=833,e.X=611,e.Y=556,e.Z=556,e.bracketleft=389,e.backslash=278,e.bracketright=389,e.asciicircum=422,e.underscore=500,e.quoteleft=333,e.a=500,e.b=500,e.c=444,e.d=500,e.e=444,e.f=278,e.g=500,e.h=500,e.i=278,e.j=278,e.k=444,e.l=278,e.m=722,e.n=500,e.o=500,e.p=500,e.q=500,e.r=389,e.s=389,e.t=278,e.u=500,e.v=444,e.w=667,e.x=444,e.y=444,e.z=389,e.braceleft=400,e.bar=275,e.braceright=400,e.asciitilde=541,e.exclamdown=389,e.cent=500,e.sterling=500,e.fraction=167,e.yen=500,e.florin=500,e.section=500,e.currency=500,e.quotesingle=214,e.quotedblleft=556,e.guillemotleft=500,e.guilsinglleft=333,e.guilsinglright=333,e.fi=500,e.fl=500,e.endash=500,e.dagger=500,e.daggerdbl=500,e.periodcentered=250,e.paragraph=523,e.bullet=350,e.quotesinglbase=333,e.quotedblbase=556,e.quotedblright=556,e.guillemotright=500,e.ellipsis=889,e.perthousand=1e3,e.questiondown=500,e.grave=333,e.acute=333,e.circumflex=333,e.tilde=333,e.macron=333,e.breve=333,e.dotaccent=333,e.dieresis=333,e.ring=333,e.cedilla=333,e.hungarumlaut=333,e.ogonek=333,e.caron=333,e.emdash=889,e.AE=889,e.ordfeminine=276,e.Lslash=556,e.Oslash=722,e.OE=944,e.ordmasculine=310,e.ae=667,e.dotlessi=278,e.lslash=278,e.oslash=500,e.oe=667,e.germandbls=500,e.Idieresis=333,e.eacute=444,e.abreve=500,e.uhungarumlaut=500,e.ecaron=444,e.Ydieresis=556,e.divide=675,e.Yacute=556,e.Acircumflex=611,e.aacute=500,e.Ucircumflex=722,e.yacute=444,e.scommaaccent=389,e.ecircumflex=444,e.Uring=722,e.Udieresis=722,e.aogonek=500,e.Uacute=722,e.uogonek=500,e.Edieresis=611,e.Dcroat=722,e.commaaccent=250,e.copyright=760,e.Emacron=611,e.ccaron=444,e.aring=500,e.Ncommaaccent=667,e.lacute=278,e.agrave=500,e.Tcommaaccent=556,e.Cacute=667,e.atilde=500,e.Edotaccent=611,e.scaron=389,e.scedilla=389,e.iacute=278,e.lozenge=471,e.Rcaron=611,e.Gcommaaccent=722,e.ucircumflex=500,e.acircumflex=500,e.Amacron=611,e.rcaron=389,e.ccedilla=444,e.Zdotaccent=556,e.Thorn=611,e.Omacron=722,e.Racute=611,e.Sacute=500,e.dcaron=544,e.Umacron=722,e.uring=500,e.threesuperior=300,e.Ograve=722,e.Agrave=611,e.Abreve=611,e.multiply=675,e.uacute=500,e.Tcaron=556,e.partialdiff=476,e.ydieresis=444,e.Nacute=667,e.icircumflex=278,e.Ecircumflex=611,e.adieresis=500,e.edieresis=444,e.cacute=444,e.nacute=500,e.umacron=500,e.Ncaron=667,e.Iacute=333,e.plusminus=675,e.brokenbar=275,e.registered=760,e.Gbreve=722,e.Idotaccent=333,e.summation=600,e.Egrave=611,e.racute=389,e.omacron=500,e.Zacute=556,e.Zcaron=556,e.greaterequal=549,e.Eth=722,e.Ccedilla=667,e.lcommaaccent=278,e.tcaron=300,e.eogonek=444,e.Uogonek=722,e.Aacute=611,e.Adieresis=611,e.egrave=444,e.zacute=389,e.iogonek=278,e.Oacute=722,e.oacute=500,e.amacron=500,e.sacute=389,e.idieresis=278,e.Ocircumflex=722,e.Ugrave=722,e.Delta=612,e.thorn=500,e.twosuperior=300,e.Odieresis=722,e.mu=500,e.igrave=278,e.ohungarumlaut=500,e.Eogonek=611,e.dcroat=500,e.threequarters=750,e.Scedilla=500,e.lcaron=300,e.Kcommaaccent=667,e.Lacute=556,e.trademark=980,e.edotaccent=444,e.Igrave=333,e.Imacron=333,e.Lcaron=611,e.onehalf=750,e.lessequal=549,e.ocircumflex=500,e.ntilde=500,e.Uhungarumlaut=722,e.Eacute=611,e.emacron=444,e.gbreve=500,e.onequarter=750,e.Scaron=500,e.Scommaaccent=500,e.Ohungarumlaut=722,e.degree=400,e.ograve=500,e.Ccaron=667,e.ugrave=500,e.radical=453,e.Dcaron=722,e.rcommaaccent=389,e.Ntilde=667,e.otilde=500,e.Rcommaaccent=611,e.Lcommaaccent=556,e.Atilde=611,e.Aogonek=611,e.Aring=611,e.Otilde=722,e.zdotaccent=389,e.Ecaron=611,e.Iogonek=333,e.kcommaaccent=444,e.minus=675,e.Icircumflex=333,e.ncaron=500,e.tcommaaccent=278,e.logicalnot=675,e.odieresis=500,e.udieresis=500,e.notequal=549,e.gcommaaccent=500,e.eth=500,e.zcaron=389,e.ncommaaccent=500,e.onesuperior=300,e.imacron=278,e.Euro=500}),e.ZapfDingbats=sr(function(e){e.space=278,e.a1=974,e.a2=961,e.a202=974,e.a3=980,e.a4=719,e.a5=789,e.a119=790,e.a118=791,e.a117=690,e.a11=960,e.a12=939,e.a13=549,e.a14=855,e.a15=911,e.a16=933,e.a105=911,e.a17=945,e.a18=974,e.a19=755,e.a20=846,e.a21=762,e.a22=761,e.a23=571,e.a24=677,e.a25=763,e.a26=760,e.a27=759,e.a28=754,e.a6=494,e.a7=552,e.a8=537,e.a9=577,e.a10=692,e.a29=786,e.a30=788,e.a31=788,e.a32=790,e.a33=793,e.a34=794,e.a35=816,e.a36=823,e.a37=789,e.a38=841,e.a39=823,e.a40=833,e.a41=816,e.a42=831,e.a43=923,e.a44=744,e.a45=723,e.a46=749,e.a47=790,e.a48=792,e.a49=695,e.a50=776,e.a51=768,e.a52=792,e.a53=759,e.a54=707,e.a55=708,e.a56=682,e.a57=701,e.a58=826,e.a59=815,e.a60=789,e.a61=789,e.a62=707,e.a63=687,e.a64=696,e.a65=689,e.a66=786,e.a67=787,e.a68=713,e.a69=791,e.a70=785,e.a71=791,e.a72=873,e.a73=761,e.a74=762,e.a203=762,e.a75=759,e.a204=759,e.a76=892,e.a77=892,e.a78=788,e.a79=784,e.a81=438,e.a82=138,e.a83=277,e.a84=415,e.a97=392,e.a98=392,e.a99=668,e.a100=668,e.a89=390,e.a90=390,e.a93=317,e.a94=317,e.a91=276,e.a92=276,e.a205=509,e.a85=509,e.a206=410,e.a86=410,e.a87=234,e.a88=234,e.a95=334,e.a96=334,e.a101=732,e.a102=544,e.a103=544,e.a104=910,e.a106=667,e.a107=760,e.a108=760,e.a112=776,e.a111=595,e.a110=694,e.a109=626,e.a120=788,e.a121=788,e.a122=788,e.a123=788,e.a124=788,e.a125=788,e.a126=788,e.a127=788,e.a128=788,e.a129=788,e.a130=788,e.a131=788,e.a132=788,e.a133=788,e.a134=788,e.a135=788,e.a136=788,e.a137=788,e.a138=788,e.a139=788,e.a140=788,e.a141=788,e.a142=788,e.a143=788,e.a144=788,e.a145=788,e.a146=788,e.a147=788,e.a148=788,e.a149=788,e.a150=788,e.a151=788,e.a152=788,e.a153=788,e.a154=788,e.a155=788,e.a156=788,e.a157=788,e.a158=788,e.a159=788,e.a160=894,e.a161=838,e.a163=1016,e.a164=458,e.a196=748,e.a165=924,e.a192=748,e.a166=918,e.a167=927,e.a168=928,e.a169=928,e.a170=834,e.a171=873,e.a172=828,e.a173=924,e.a162=924,e.a174=917,e.a175=930,e.a176=931,e.a177=463,e.a178=883,e.a179=836,e.a193=836,e.a180=867,e.a199=867,e.a181=696,e.a200=696,e.a182=874,e.a201=874,e.a183=760,e.a184=946,e.a197=771,e.a185=865,e.a194=771,e.a198=888,e.a186=967,e.a195=888,e.a187=831,e.a188=873,e.a189=927,e.a190=970,e.a191=918})}),tc=sr(function(e){e.Courier={ascent:629,descent:-157,capHeight:562,xHeight:-426},e[`Courier-Bold`]={ascent:629,descent:-157,capHeight:562,xHeight:439},e[`Courier-Oblique`]={ascent:629,descent:-157,capHeight:562,xHeight:426},e[`Courier-BoldOblique`]={ascent:629,descent:-157,capHeight:562,xHeight:426},e.Helvetica={ascent:718,descent:-207,capHeight:718,xHeight:523},e[`Helvetica-Bold`]={ascent:718,descent:-207,capHeight:718,xHeight:532},e[`Helvetica-Oblique`]={ascent:718,descent:-207,capHeight:718,xHeight:523},e[`Helvetica-BoldOblique`]={ascent:718,descent:-207,capHeight:718,xHeight:532},e[`Times-Roman`]={ascent:683,descent:-217,capHeight:662,xHeight:450},e[`Times-Bold`]={ascent:683,descent:-217,capHeight:676,xHeight:461},e[`Times-Italic`]={ascent:683,descent:-217,capHeight:653,xHeight:441},e[`Times-BoldItalic`]={ascent:683,descent:-217,capHeight:669,xHeight:462},e.Symbol={ascent:Math.NaN,descent:Math.NaN,capHeight:Math.NaN,xHeight:Math.NaN},e.ZapfDingbats={ascent:Math.NaN,descent:Math.NaN,capHeight:Math.NaN,xHeight:Math.NaN}}),nc=class{constructor({glyfTable:e,isGlyphLocationsLong:t,locaTable:n,numGlyphs:r}){this.glyphs=[];let i=new DataView(n.buffer,n.byteOffset,n.byteLength),a=new DataView(e.buffer,e.byteOffset,e.byteLength),o=t?4:2,s=t?i.getUint32(0):2*i.getUint16(0),c=0;for(let e=0;e<r;e++){c+=o;let e=t?i.getUint32(c):2*i.getUint16(c);if(e===s){this.glyphs.push(new rc({}));continue}let n=rc.parse(s,a);this.glyphs.push(n),s=e}}getSize(){return Math.sumPrecise(this.glyphs.map(e=>e.getSize()+3&-4))}write(){let e=this.getSize(),t=new DataView(new ArrayBuffer(e)),n=e>131070,r=n?4:2,i=new DataView(new ArrayBuffer((this.glyphs.length+1)*r));n?i.setUint32(0,0):i.setUint16(0,0);let a=0,o=0;for(let e of this.glyphs)a+=e.write(a,t),a=a+3&-4,o+=r,n?i.setUint32(o,a):i.setUint16(o,a>>1);return{isLocationLong:n,loca:new Uint8Array(i.buffer),glyf:new Uint8Array(t.buffer)}}scale(e){for(let t=0,n=this.glyphs.length;t<n;t++)this.glyphs[t].scale(e[t])}},rc=class e{constructor({header:e=null,simple:t=null,composites:n=null}){this.header=e,this.simple=t,this.composites=n}static parse(t,n){let[r,i]=ic.parse(t,n);if(t+=r,i.numberOfContours<0){let r=[];for(;;){let[e,i]=sc.parse(t,n);if(t+=e,r.push(i),!(32&i.flags))break}return new e({header:i,composites:r})}return new e({header:i,simple:oc.parse(t,n,i.numberOfContours)})}getSize(){if(!this.header)return 0;let e=this.simple?this.simple.getSize():Math.sumPrecise(this.composites.map(e=>e.getSize()));return this.header.getSize()+e}write(e,t){if(!this.header)return 0;let n=e;if(e+=this.header.write(e,t),this.simple)e+=this.simple.write(e,t);else for(let n of this.composites)e+=n.write(e,t);return e-n}scale(e){if(!this.header)return;let t=(this.header.xMin+this.header.xMax)/2;if(this.header.scale(t,e),this.simple)this.simple.scale(t,e);else for(let n of this.composites)n.scale(t,e)}},ic=class e{constructor({numberOfContours:e,xMin:t,yMin:n,xMax:r,yMax:i}){this.numberOfContours=e,this.xMin=t,this.yMin=n,this.xMax=r,this.yMax=i}static parse(t,n){return[10,new e({numberOfContours:n.getInt16(t),xMin:n.getInt16(t+2),yMin:n.getInt16(t+4),xMax:n.getInt16(t+6),yMax:n.getInt16(t+8)})]}getSize(){return 10}write(e,t){return t.setInt16(e,this.numberOfContours),t.setInt16(e+2,this.xMin),t.setInt16(e+4,this.yMin),t.setInt16(e+6,this.xMax),t.setInt16(e+8,this.yMax),10}scale(e,t){this.xMin=Math.round(e+(this.xMin-e)*t),this.xMax=Math.round(e+(this.xMax-e)*t)}},ac=class{constructor({flags:e,xCoordinates:t,yCoordinates:n}){this.xCoordinates=t,this.yCoordinates=n,this.flags=e}},oc=class e{constructor({contours:e,instructions:t}){this.contours=e,this.instructions=t}static parse(t,n,r){let i=[];for(let e=0;e<r;e++){let e=n.getUint16(t);t+=2,i.push(e)}let a=i[r-1]+1,o=n.getUint16(t);t+=2;let s=new Uint8Array(n).slice(t,t+o);t+=o;let c=[];for(let e=0;e<a;t++,e++){let r=n.getUint8(t);if(c.push(r),8&r){let i=n.getUint8(++t);r^=8;for(let e=0;e<i;e++)c.push(r);e+=i}}let l=[],u=[],d=[],f=[],p=[],m=0,h=0;for(let e=0;e<a;e++){let r=c[e];if(2&r){let e=n.getUint8(t++);h+=16&r?e:-e,u.push(h)}else 16&r||(h+=n.getInt16(t),t+=2),u.push(h);i[m]===e&&(m++,l.push(u),u=[])}h=0,m=0;for(let e=0;e<a;e++){let r=c[e];if(4&r){let e=n.getUint8(t++);h+=32&r?e:-e,d.push(h)}else 32&r||(h+=n.getInt16(t),t+=2),d.push(h);f.push(1&r|64&r),i[m]===e&&(u=l[m],m++,p.push(new ac({flags:f,xCoordinates:u,yCoordinates:d})),d=[],f=[])}return new e({contours:p,instructions:s})}getSize(){let e=2*this.contours.length+2+this.instructions.length,t=0,n=0;for(let r of this.contours){e+=r.flags.length;for(let i=0,a=r.xCoordinates.length;i<a;i++){let a=r.xCoordinates[i],o=r.yCoordinates[i],s=Math.abs(a-t);s>255?e+=2:s>0&&(e+=1),t=a,s=Math.abs(o-n),s>255?e+=2:s>0&&(e+=1),n=o}}return e}write(e,t){let n=e,r=[],i=[],a=[],o=0,s=0;for(let n of this.contours){for(let e=0,t=n.xCoordinates.length;e<t;e++){let t=n.flags[e],c=n.xCoordinates[e],l=c-o;if(l===0)t|=16,r.push(0);else{let e=Math.abs(l);e<=255?(t|=l>=0?18:2,r.push(e)):r.push(l)}o=c;let u=n.yCoordinates[e];if(l=u-s,l===0)t|=32,i.push(0);else{let e=Math.abs(l);e<=255?(t|=l>=0?36:4,i.push(e)):i.push(l)}s=u,a.push(t)}t.setUint16(e,r.length-1),e+=2}t.setUint16(e,this.instructions.length),e+=2,this.instructions.length&&(new Uint8Array(t.buffer,0,t.buffer.byteLength).set(this.instructions,e),e+=this.instructions.length);for(let n of a)t.setUint8(e++,n);for(let n=0,i=r.length;n<i;n++){let i=r[n],o=a[n];2&o?t.setUint8(e++,i):16&o||(t.setInt16(e,i),e+=2)}for(let n=0,r=i.length;n<r;n++){let r=i[n],o=a[n];4&o?t.setUint8(e++,r):32&o||(t.setInt16(e,r),e+=2)}return e-n}scale(e,t){for(let n of this.contours)if(n.xCoordinates.length!==0)for(let r=0,i=n.xCoordinates.length;r<i;r++)n.xCoordinates[r]=Math.round(e+(n.xCoordinates[r]-e)*t)}},sc=class e{constructor({flags:e,glyphIndex:t,argument1:n,argument2:r,transf:i,instructions:a}){this.flags=e,this.glyphIndex=t,this.argument1=n,this.argument2=r,this.transf=i,this.instructions=a}static parse(t,n){let r=t,i=[],a=n.getUint16(t),o=n.getUint16(t+2),s,c;t+=4,1&a?(2&a?(s=n.getInt16(t),c=n.getInt16(t+2)):(s=n.getUint16(t),c=n.getUint16(t+2)),t+=4,a^=1):(2&a?(s=n.getInt8(t),c=n.getInt8(t+1)):(s=n.getUint8(t),c=n.getUint8(t+1)),t+=2),8&a?(i.push(n.getUint16(t)),t+=2):64&a?(i.push(n.getUint16(t),n.getUint16(t+2)),t+=4):128&a&&(i.push(n.getUint16(t),n.getUint16(t+2),n.getUint16(t+4),n.getUint16(t+6)),t+=8);let l=null;if(256&a){let e=n.getUint16(t);t+=2,l=new Uint8Array(n).slice(t,t+e),t+=e}return[t-r,new e({flags:a,glyphIndex:o,argument1:s,argument2:c,transf:i,instructions:l})]}getSize(){let e=4+2*this.transf.length;return 256&this.flags&&(e+=2+this.instructions.length),e+=2,2&this.flags?this.argument1>=-128&&this.argument1<=127&&this.argument2>=-128&&this.argument2<=127||(e+=2):this.argument1>=0&&this.argument1<=255&&this.argument2>=0&&this.argument2<=255||(e+=2),e}write(e,t){let n=e;return 2&this.flags?this.argument1>=-128&&this.argument1<=127&&this.argument2>=-128&&this.argument2<=127||(this.flags|=1):this.argument1>=0&&this.argument1<=255&&this.argument2>=0&&this.argument2<=255||(this.flags|=1),t.setUint16(e,this.flags),t.setUint16(e+2,this.glyphIndex),e+=4,1&this.flags?(2&this.flags?(t.setInt16(e,this.argument1),t.setInt16(e+2,this.argument2)):(t.setUint16(e,this.argument1),t.setUint16(e+2,this.argument2)),e+=4):(t.setUint8(e,this.argument1),t.setUint8(e+1,this.argument2),e+=2),256&this.flags&&(t.setUint16(e,this.instructions.length),e+=2,this.instructions.length&&(new Uint8Array(t.buffer,0,t.buffer.byteLength).set(this.instructions,e),e+=this.instructions.length)),e-n}scale(e,t){}};function cc(e,t,n){e[t]=n>>8&255,e[t+1]=255&n}function lc(e,t,n){e[t]=n>>24&255,e[t+1]=n>>16&255,e[t+2]=n>>8&255,e[t+3]=255&n}function uc(e,t,n){if(n instanceof Uint8Array)e.set(n,t);else if(typeof n==`string`)for(let r=0,i=n.length;r<i;r++)e[t++]=255&n.charCodeAt(r);else for(let r of n)e[t++]=255&r}var dc=class e{constructor(e){this.sfnt=e,this.tables=Object.create(null)}static getSearchParams(e,t){let n=1,r=0;for(;(n^e)>n;)n<<=1,r++;let i=n*t;return{range:i,entry:r,rangeShift:t*e-i}}toArray(){let t=this.sfnt,n=this.tables,r=Object.keys(n);r.sort();let i=r.length,a,o,s,c,l,u=12+16*i,d=[u];for(a=0;a<i;a++)c=n[r[a]],u+=(c.length+3&-4)>>>0,d.push(u);let f=new Uint8Array(u);for(a=0;a<i;a++)c=n[r[a]],uc(f,d[a],c);t===`true`&&(t=Dn(65536)),f[0]=255&t.charCodeAt(0),f[1]=255&t.charCodeAt(1),f[2]=255&t.charCodeAt(2),f[3]=255&t.charCodeAt(3),cc(f,4,i);let p=e.getSearchParams(i,16);for(cc(f,6,p.range),cc(f,8,p.entry),cc(f,10,p.rangeShift),u=12,a=0;a<i;a++){l=r[a],f[u]=255&l.charCodeAt(0),f[u+1]=255&l.charCodeAt(1),f[u+2]=255&l.charCodeAt(2),f[u+3]=255&l.charCodeAt(3);let e=0;for(o=d[a],s=d[a+1];o<s;o+=4)e=e+xr(f,o)>>>0;lc(f,u+4,e),lc(f,u+8,d[a]),lc(f,u+12,n[l].length),u+=16}return f}addTable(e,t){if(e in this.tables)throw Error(`Table `+e+` already exists`);this.tables[e]=t}},fc=[4],pc=[5],mc=[6],hc=[7],gc=[8],_c=[12,35],vc=[14],yc=[21],bc=[22],xc=[30],Sc=[31],Cc=class{constructor(){this.width=0,this.lsb=0,this.flexing=!1,this.output=[],this.stack=[]}convert(e,t,n){let r=e.length,i,a,o,s=!1;for(let c=0;c<r;c++){let r=e[c];if(r<32){switch(r===12&&(r=(r<<8)+e[++c]),r){case 1:case 3:case 9:case 3072:case 3073:case 3074:case 3105:this.stack=[];break;case 4:if(this.flexing){if(this.stack.length<1){s=!0;break}let e=this.stack.pop();this.stack.push(0,e);break}s=this.executeCommand(1,fc);break;case 5:s=this.executeCommand(2,pc);break;case 6:s=this.executeCommand(1,mc);break;case 7:s=this.executeCommand(1,hc);break;case 8:s=this.executeCommand(6,gc);break;case 10:if(this.stack.length<1){s=!0;break}if(o=this.stack.pop(),!t[o]){s=!0;break}s=this.convert(t[o],t,n);break;case 11:return s;case 13:if(this.stack.length<2){s=!0;break}i=this.stack.pop(),a=this.stack.pop(),this.lsb=a,this.width=i,this.stack.push(i,a),s=this.executeCommand(2,bc);break;case 14:this.output.push(vc[0]);break;case 21:if(this.flexing)break;s=this.executeCommand(2,yc);break;case 22:if(this.flexing){this.stack.push(0);break}s=this.executeCommand(1,bc);break;case 30:s=this.executeCommand(4,xc);break;case 31:s=this.executeCommand(4,Sc);break;case 3078:if(n){let e=this.stack.at(-5);this.seac=this.stack.splice(-4,4),this.seac[0]+=this.lsb-e,s=this.executeCommand(0,vc)}else s=this.executeCommand(4,vc);break;case 3079:if(this.stack.length<4){s=!0;break}this.stack.pop(),i=this.stack.pop();let e=this.stack.pop();a=this.stack.pop(),this.lsb=a,this.width=i,this.stack.push(i,a,e),s=this.executeCommand(3,yc);break;case 3084:if(this.stack.length<2){s=!0;break}let c=this.stack.pop(),l=this.stack.pop();this.stack.push(l/c);break;case 3088:if(this.stack.length<2){s=!0;break}o=this.stack.pop();let u=this.stack.pop();if(o===0&&u===3){let e=this.stack.splice(-17,17);this.stack.push(e[2]+e[0],e[3]+e[1],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14]),s=this.executeCommand(13,_c,!0),this.flexing=!1,this.stack.push(e[15],e[16])}else o===1&&u===0&&(this.flexing=!0);break;case 3089:break;default:N(`Unknown type 1 charstring command of "`+r+`"`)}if(s)break}else r<=246?r-=139:r=r<=250?256*(r-247)+e[++c]+108:r<=254?-256*(r-251)-e[++c]-108:(255&e[++c])<<24|(255&e[++c])<<16|(255&e[++c])<<8|255&e[++c],this.stack.push(r)}return s}executeCommand(e,t,n){let r=this.stack.length;if(e>r)return!0;let i=r-e;for(let e=i;e<r;e++){let t=this.stack[e];Number.isInteger(t)?this.output.push(28,t>>8&255,255&t):(t=65536*t|0,this.output.push(255,t>>24&255,t>>16&255,t>>8&255,255&t))}return this.output.push(...t),n?this.stack.splice(i,e):this.stack.length=0,!1}};function wc(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function Tc(e,t,n){if(n>=e.length)return new Uint8Array;let r,i,a=0|t;for(r=0;r<n;r++)a=52845*(e[r]+a)+22719&65535;let o=e.length-n,s=new Uint8Array(o);for(r=n,i=0;i<o;r++,i++){let t=e[r];s[i]=t^a>>8,a=52845*(t+a)+22719&65535}return s}function Ec(e){return e===47||e===91||e===93||e===123||e===125||e===40||e===41}var Dc=class{constructor(e,t,n){if(t){let t=e.getBytes();e=new gi((wc(t[0])||Sr(t[0]))&&wc(t[1])&&wc(t[2])&&wc(t[3])&&wc(t[4])&&wc(t[5])&&wc(t[6])&&wc(t[7])?function(e,t,n){let r=0|t,i=e.length,a=new Uint8Array(i>>>1),o,s;for(o=0,s=0;o<i;o++){let t=e[o];if(!wc(t))continue;let n;for(o++;o<i&&!wc(n=e[o]);)o++;if(o<i){let e=parseInt(String.fromCharCode(t,n),16);a[s++]=e^r>>8,r=52845*(e+r)+22719&65535}}return a.slice(n,s)}(t,55665,4):Tc(t,55665,4))}this.seacAnalysisEnabled=!!n,this.stream=e,this.nextChar()}readNumberArray(){this.getToken();let e=[];for(;;){let t=this.getToken();if(t===null||t===`]`||t===`}`)break;e.push(parseFloat(t||0))}return e}readNumber(){let e=this.getToken();return parseFloat(e||0)}readInt(){let e=this.getToken();return 0|parseInt(e||0,10)}readBoolean(){return+(this.getToken()===`true`)}nextChar(){return this.currentChar=this.stream.getByte()}prevChar(){return this.stream.skip(-2),this.currentChar=this.stream.getByte()}getToken(){let e=!1,t=this.currentChar;for(;;){if(t===-1)return null;if(e)t!==10&&t!==13||(e=!1);else if(t===37)e=!0;else if(!Sr(t))break;t=this.nextChar()}if(Ec(t))return this.nextChar(),String.fromCharCode(t);let n=``;do n+=String.fromCharCode(t),t=this.nextChar();while(t>=0&&!Sr(t)&&!Ec(t));return n}readCharStrings(e,t){return t===-1?e:Tc(e,4330,t)}extractFontProgram(e){let t=this.stream,n=[],r=[],i=Object.create(null);i.lenIV=4;let a={subrs:[],charstrings:[],properties:{privateData:i}},o,s,c,l;for(;(o=this.getToken())!==null;)if(o===`/`)switch(o=this.getToken(),o){case`CharStrings`:for(this.getToken(),this.getToken(),this.getToken(),this.getToken();o=this.getToken(),o!==null&&o!==`end`;){if(o!==`/`)continue;let e=this.getToken();s=this.readInt(),this.getToken(),c=s>0?t.getBytes(s):new Uint8Array,l=a.properties.privateData.lenIV;let n=this.readCharStrings(c,l);this.nextChar(),o=this.getToken(),o===`noaccess`?this.getToken():o===`/`&&this.prevChar(),r.push({glyph:e,encoded:n})}break;case`Subrs`:for(this.readInt(),this.getToken();this.getToken()===`dup`;){let e=this.readInt();s=this.readInt(),this.getToken(),c=s>0?t.getBytes(s):new Uint8Array,l=a.properties.privateData.lenIV;let r=this.readCharStrings(c,l);this.nextChar(),o=this.getToken(),o===`noaccess`&&this.getToken(),n[e]=r}break;case`BlueValues`:case`OtherBlues`:case`FamilyBlues`:case`FamilyOtherBlues`:let e=this.readNumberArray();e.length>0&&e.length;break;case`StemSnapH`:case`StemSnapV`:a.properties.privateData[o]=this.readNumberArray();break;case`StdHW`:case`StdVW`:a.properties.privateData[o]=this.readNumberArray()[0];break;case`BlueShift`:case`lenIV`:case`BlueFuzz`:case`BlueScale`:case`LanguageGroup`:a.properties.privateData[o]=this.readNumber();break;case`ExpansionFactor`:a.properties.privateData[o]=this.readNumber()||.06;break;case`ForceBold`:a.properties.privateData[o]=this.readBoolean()}for(let{encoded:t,glyph:i}of r){let r=new Cc,o=r.convert(t,n,this.seacAnalysisEnabled),s=r.output;o&&(s=[14]);let c={glyphName:i,charstring:s,width:r.width,lsb:r.lsb,seac:r.seac};if(i===`.notdef`?a.charstrings.unshift(c):a.charstrings.push(c),e.builtInEncoding){let t=e.builtInEncoding.indexOf(i);t>-1&&e.widths[t]===void 0&&t>=e.firstChar&&t<=e.lastChar&&(e.widths[t]=r.width)}}return a}extractFontHeader(e){let t;for(;(t=this.getToken())!==null;)if(t===`/`)switch(t=this.getToken(),t){case`FontMatrix`:e.fontMatrix=this.readNumberArray();break;case`Encoding`:let n=this.getToken(),r;if(/^\d+$/.test(n)){r=[];let e=0|parseInt(n,10);this.getToken();for(let n=0;n<e;n++){for(t=this.getToken();t!==`dup`&&t!==`def`;)if(t=this.getToken(),t===null)return;if(t===`def`)break;let e=this.readInt();this.getToken();let n=this.getToken();r[e]=n,this.getToken()}}else r=Vo(n);e.builtInEncoding=r;break;case`FontBBox`:let i=this.readNumberArray();e.ascent=Math.max(i[3],i[1]),e.descent=Math.min(i[1],i[3]),e.ascentScaled=!0}}};function Oc(e,t,n){let r=e.length,i=t.length,a=r-i,o=n,s=!1;for(;o<a;){let n=0;for(;n<i&&e[o+n]===t[n];)n++;if(n>=i){for(o+=n;o<r&&Sr(e[o]);)o++;s=!0;break}o++}return{found:s,length:o}}var kc=class{constructor(e,t,n){let r=n.length1;n.length2;let i=t.peekBytes(6),a=i[0]===128&&i[1]===1;a&&(t.skip(6),r=i[5]<<24|i[4]<<16|i[3]<<8|i[2]),new Dc(function(e,t){let n=[101,101,120,101,99],r=e.pos,i,a,o,s;try{i=e.getBytes(t),a=i.length}catch{}if(a===t&&(o=Oc(i,n,t-2*n.length),o.found&&o.length===t))return{stream:new gi(i),length:t};for(N(`Invalid "Length1" property in Type1 font -- trying to recover.`),e.pos=r;o=Oc(e.peekBytes(2048),n,0),o.length!==0;)if(e.pos+=o.length,o.found){s=e.pos-r;break}return e.pos=r,s?{stream:new gi(e.getBytes(s)),length:s}:(N(`Unable to recover "Length1" property in Type1 font -- using as is.`),{stream:new gi(e.getBytes(t)),length:t})}(t,r).stream,!1,Xo).extractFontHeader(n),a&&(i=t.getBytes(6),i[5],i[4],i[3],i[2]);let o=new Dc(function(e){let t=e.getBytes();if(t.length===0)throw new F(`getEexecBlock - no font program found.`);return{stream:new gi(t),length:t.length}}(t).stream,!0,Xo).extractFontProgram(n);for(let e in o.properties)n[e]=o.properties[e];let s=o.charstrings,c=this.getType2Charstrings(s),l=this.getType2Subrs(o.subrs);this.charstrings=s,this.data=this.wrap(e,c,this.charstrings,l,n),this.seacs=this.getSeacs(o.charstrings)}get numGlyphs(){return this.charstrings.length+1}getCharset(){let e=[`.notdef`];for(let{glyphName:t}of this.charstrings)e.push(t);return e}getGlyphMapping(e){let t=this.charstrings;if(e.composite){let n=Object.create(null);for(let r=0,i=t.length;r<i;r++)n[e.cMap.charCodeOf(r)]=r+1;return n}let n=[`.notdef`],r,i;for(i=0;i<t.length;i++)n.push(t[i].glyphName);let a=e.builtInEncoding;if(a){r=Object.create(null);for(let e in a)i=n.indexOf(a[e]),i>=0&&(r[e]=i)}return rs(e,r,n)}hasGlyphId(e){return e<0||e>=this.numGlyphs?!1:e===0?!0:this.charstrings[e-1].charstring.length>0}getSeacs(e){let t=[];for(let n=0,r=e.length;n<r;n++){let r=e[n];r.seac&&(t[n+1]=r.seac)}return t}getType2Charstrings(e){let t=[];for(let n of e)t.push(n.charstring);return t}getType2Subrs(e){let t=0,n=e.length;t=n<1133?107:n<33769?1131:32768;let r=[],i;for(i=0;i<t;i++)r.push([11]);for(i=0;i<n;i++)r.push(e[i]);return r}wrap(e,t,n,r,i){let a=new ms;a.header=new hs(1,0,4,4),a.names=[e];let o=new bs;o.setByName(`version`,391),o.setByName(`Notice`,392),o.setByName(`FullName`,393),o.setByName(`FamilyName`,394),o.setByName(`Weight`,395),o.setByName(`Encoding`,null),o.setByName(`FontMatrix`,i.fontMatrix),o.setByName(`FontBBox`,i.bbox),o.setByName(`charset`,null),o.setByName(`CharStrings`,null),o.setByName(`Private`,null),a.topDict=o;let s=new gs;s.add(`Version 0.11`),s.add(`See original notice`),s.add(e),s.add(e),s.add(`Medium`),a.strings=s,a.globalSubrIndex=new _s;let c=t.length,l=[`.notdef`],u,d;for(u=0;u<c;u++){let e=n[u].glyphName;ls.indexOf(e)===-1&&s.add(e),l.push(e)}a.charset=new ws(!1,0,l);let f=new _s;for(f.add([139,14]),u=0;u<c;u++)f.add(t[u]);a.charStrings=f;let p=new Ss;p.setByName(`Subrs`,null);let m=[`BlueValues`,`OtherBlues`,`FamilyBlues`,`FamilyOtherBlues`,`StemSnapH`,`StemSnapV`,`BlueShift`,`BlueFuzz`,`BlueScale`,`LanguageGroup`,`ExpansionFactor`,`ForceBold`,`StdHW`,`StdVW`];for(u=0,d=m.length;u<d;u++){let e=m[u];if(!(e in i.privateData))continue;let t=i.privateData[e];if(Array.isArray(t))for(let e=t.length-1;e>0;e--)t[e]-=t[e-1];p.setByName(e,t)}a.topDict.privateDict=p;let h=new _s;for(u=0,d=r.length;u<d;u++)h.add(r[u]);return p.subrsIndex=h,new Os(a).compile()}},Ac=[[57344,63743],[1048576,1114109]],jc=1e3,Mc=[`ascent`,`bbox`,`black`,`bold`,`charProcOperatorList`,`cssFontInfo`,`data`,`defaultVMetrics`,`defaultWidth`,`descent`,`disableFontFace`,`fallbackName`,`fontExtraProperties`,`fontMatrix`,`isInvalidPDFjsFont`,`isType3Font`,`italic`,`loadedName`,`mimetype`,`missingFile`,`name`,`remeasure`,`systemFontInfo`,`vertical`],Nc=[`cMap`,`composite`,`defaultEncoding`,`differences`,`isMonospace`,`isSerifFont`,`isSymbolicFont`,`seacMap`,`subtype`,`toFontChar`,`toUnicode`,`type`,`vmetrics`,`widths`];function Pc(e){if(!e.fontMatrix||e.fontMatrix[0]===n[0])return;let t=.001/e.fontMatrix[0],r=e.widths;for(let e in r)r[e]*=t;e.defaultWidth*=t}function Fc(e){if(!e.fallbackToUnicode||e.toUnicode instanceof Bs)return;let t=[];for(let n in e.fallbackToUnicode)e.toUnicode.has(n)||(t[n]=e.fallbackToUnicode[n]);t.length>0&&e.toUnicode.amend(t)}var Ic=class{constructor(e,t,n,r,i,a,o,s,c){this.originalCharCode=e,this.fontChar=t,this.unicode=n,this.accent=r,this.width=i,this.vmetric=a,this.operatorListId=o,this.isSpace=s,this.isInFont=c}get category(){return P(this,`category`,function(e){let t=Yo.get(e);if(t)return t;let n=e.match(Jo),r={isWhitespace:!!n?.[1],isZeroWidthDiacritic:!!n?.[2],isInvisibleFormatMark:!!n?.[3]};return Yo.set(e,r),r}(this.unicode),!0)}};function Lc(e,t){return(e<<8)+t}function Rc(e,t,n){e[t+1]=n,e[t]=n>>>8}function zc(e,t){let n=(e<<8)+t;return 32768&n?n-65536:n}function Bc(e){return String.fromCharCode(e>>8&255,255&e)}function Vc(e){return e>32767?e=32767:e<-32768&&(e=-32768),String.fromCharCode(e>>8&255,255&e)}function Hc(e){return Tn(e.peekBytes(4))===`ttcf`}function Uc(e,{type:t,subtype:n,composite:r}){let i,a;return function(e){let t=e.peekBytes(4);return xr(t,0)===65536||Tn(t)===`true`}(e)||Hc(e)?i=r?`CIDFontType2`:`TrueType`:function(e){return Tn(e.peekBytes(4))===`OTTO`}(e)?i=r?`CIDFontType2`:`OpenType`:function(e){let t=e.peekBytes(2);return t[0]===37&&t[1]===33||t[0]===128&&t[1]===1}(e)?i=r?`CIDFontType0`:t===`MMType1`?`MMType1`:`Type1`:function(e){let t=e.peekBytes(4);return t[0]>=1&&t[3]>=1&&t[3]<=4}(e)?r?(i=`CIDFontType0`,a=`CIDFontType0C`):(i=t===`MMType1`?`MMType1`:`Type1`,a=`Type1C`):(N(`getFontFileType: Unable to detect correct font file Type/Subtype.`),i=t,a=n),[i,a]}function Wc(e,t){for(let n in t)e[+n]=t[n]}function Gc(e,t,n){let r=[],i;for(let n=0,a=e.length;n<a;n++)i=Go(e[n],t),i!==-1&&(r[n]=i);for(let e in n)i=Go(n[e],t),i!==-1&&(r[+e]=i);return r}function Kc(e){return e.platform===1&&e.encoding===0&&e.language===0}function qc(e){return e.platform===3&&e.encoding===1&&e.language===1033}function Jc(e,t,n=!1){switch(t.length){case 1:return t.charCodeAt(0);case 2:return t.charCodeAt(0)<<8|t.charCodeAt(1)}let r=`Unsupported CID string (charCode ${e}): "${t}".`;if(n)throw new F(r);return N(r),t}function Yc(e,t,n,r){let i=Object.create(null),a=new Map,o=[],s=new Set,c=0,l=Ac[c][0],u=Ac[c][1],d=e=>Ac[0][0]<=e&&e<=Ac[0][1]||Ac[1][0]<=e&&e<=Ac[1][1],f=null;for(let p in e){let m=e[p];if(!t(m))continue;if(l>u){if(c++,c>=Ac.length){N(`Ran out of space in font private use area.`);break}l=Ac[c][0],u=Ac[c][1]}let h=l++;m===0&&(m=n);let g=r.get(p);if(typeof g==`string`)if(g.length===1)g=g.codePointAt(0);else{if(!f){f=new Map;for(let e=64256;e<=64335;e++){let t=String.fromCharCode(e).normalize(`NFKD`);t.length>1&&f.set(t,e)}}g=f.get(g)||g.codePointAt(0)}!g||d(g)||s.has(m)||(a.set(g,m),s.add(m)),i[h]=m,o[p]=h}return{toFontChar:o,charCodeToGlyphId:i,toUnicodeExtraMap:a,nextAvailableFontCharCode:l}}function Xc(e,t,n){let r=function(e,t,n){let r=[];for(let t in e)e[t]>=n||r.push({fontCharCode:0|t,glyphId:e[t]});if(t)for(let[e,i]of t)i>=n||r.push({fontCharCode:e,glyphId:i});r.length===0&&r.push({fontCharCode:0,glyphId:0}),r.sort((e,t)=>e.fontCharCode-t.fontCharCode);let i=[],a=r.length;for(let e=0;e<a;){let t=r[e].fontCharCode,n=[r[e].glyphId];++e;let o=t;for(;e<a&&o+1===r[e].fontCharCode&&(n.push(r[e].glyphId),++o,++e,o!==65535););i.push([t,o,n])}return i}(e,t,n),i=r.at(-1)[1]>65535?2:1,a,o,s,c,l=`\0\0`+Bc(i)+`\0\0`+Dn(4+8*i);for(a=r.length-1;a>=0&&!(r[a][0]<=65535);--a);let u=a+1;r[a][0]<65535&&r[a][1]===65535&&(r[a][1]=65534);let d=+(r[a][1]<65535),f=u+d,p=dc.getSearchParams(f,2),m,h,g,_,v=``,y=``,b=``,x=``,S=``,C=0;for(a=0,o=u;a<o;a++){m=r[a],h=m[0],g=m[1],v+=Bc(h),y+=Bc(g),_=m[2];let e=!0;for(s=1,c=_.length;s<c;++s)if(_[s]!==_[s-1]+1){e=!1;break}if(e)b+=Bc(_[0]-h&65535),x+=Bc(0);else{let e=2*(f-a)+2*C;for(C+=g-h+1,b+=Bc(0),x+=Bc(e),s=0,c=_.length;s<c;++s)S+=Bc(_[s])}}d>0&&(y+=`ÿÿ`,v+=`ÿÿ`,b+=`\0`,x+=`\0\0`);let w=`\0\0`+Bc(2*f)+Bc(p.range)+Bc(p.entry)+Bc(p.rangeShift)+y+`\0\0`+v+b+x+S,T=``,E=``;if(i>1){for(l+=`\0\0
4
4
  `+Dn(4+8*i+4+w.length),T=``,a=0,o=r.length;a<o;a++){m=r[a],h=m[0],_=m[2];let e=_[0];for(s=1,c=_.length;s<c;++s)_[s]!==_[s-1]+1&&(g=m[0]+s-1,T+=Dn(h)+Dn(g)+Dn(e),h=g+1,e=_[s]);T+=Dn(h)+Dn(m[1])+Dn(e)}E=`\0\f\0\0`+Dn(T.length+16)+`\0\0\0\0`+Dn(T.length/12)}return l+`\0`+Bc(w.length+4)+w+E+T}function Zc(e,t,n){n||={unitsPerEm:0,yMax:0,yMin:0,ascent:0,descent:0};let r=0,i=0,a=0,o=0,s=null,c=0,l=-1;if(t){for(let e in t)if(e|=0,(s>e||!s)&&(s=e),c<e&&(c=e),l=qo(e,l),l<32)r|=1<<l;else if(l<64)i|=1<<l-32;else if(l<96)a|=1<<l-64;else{if(!(l<123))throw new F(`Unicode ranges Bits > 123 are reserved for internal usage`);o|=1<<l-96}c>65535&&(c=65535)}else s=0,c=255;let u=e.bbox||[0,0,0,0],d=n.unitsPerEm||(e.fontMatrix?1/Math.max(...e.fontMatrix.slice(0,4).map(Math.abs)):1e3),f=e.ascentScaled?1:d/jc,p=n.ascent||Math.round(f*(e.ascent||u[3])),m=n.descent||Math.round(f*(e.descent||u[1]));m>0&&e.descent>0&&u[1]<0&&(m=-m);let h=n.yMax||p,g=-n.yMin||-m;return`\0$ô\0\0\0Š»\0\0\0ŒŠ»\0\0ß\x001\0\0\0\0`+String.fromCharCode(e.fixedPitch?9:0)+`\0\0\0\0\0\0`+Dn(r)+Dn(i)+Dn(a)+Dn(o)+`*21*`+Bc(+!!e.italicAngle)+Bc(s||e.firstChar)+Bc(c||e.lastChar)+Bc(p)+Bc(m)+`\0d`+Bc(h)+Bc(g)+`\0\0\0\0\0\0\0\0`+Bc(e.xHeight)+Bc(e.capHeight)+Bc(0)+Bc(s||e.firstChar)+`\0`}function Qc(e){return`\0\0\0`+Dn(Math.floor(65536*e.italicAngle))+`\0\0\0\0`+Dn(+!!e.fixedPitch)+`\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0`}function $c(e){return e.replaceAll(/[^\x21-\x7E]|[[\](){}<>/%]/g,``).slice(0,63)}function el(e,t){t||=[[],[]];let n=[t[0][0]||`Original licence`,t[0][1]||e,t[0][2]||`Unknown`,t[0][3]||`uniqueID`,t[0][4]||e,t[0][5]||`Version 0.11`,t[0][6]||$c(e),t[0][7]||`Unknown`,t[0][8]||`Unknown`,t[0][9]||`Unknown`],r=[],i,a,o,s,c;for(i=0,a=n.length;i<a;i++){c=t[1][i]||n[i];let e=[];for(o=0,s=c.length;o<s;o++)e.push(Bc(c.charCodeAt(o)));r.push(e.join(``))}let l=[n,r],u=[`\0`,`\0`],d=[`\0\0`,`\0`],f=[`\0\0`,` `],p=n.length*u.length,m=`\0\0`+Bc(p)+Bc(12*p+6),h=0;for(i=0,a=u.length;i<a;i++){let e=l[i];for(o=0,s=e.length;o<s;o++)c=e[o],m+=u[i]+d[i]+f[i]+Bc(o)+Bc(c.length)+Bc(h),h+=c.length}return m+=n.join(``)+r.join(``),m}var tl=class{constructor(e,t,n,r){this.name=e,this.psName=null,this.mimetype=null,this.disableFontFace=r.disableFontFace,this.fontExtraProperties=r.fontExtraProperties,this.loadedName=n.loadedName,this.isType3Font=n.isType3Font,this.missingFile=!1,this.cssFontInfo=n.cssFontInfo,this._charsCache=Object.create(null),this._glyphCache=Object.create(null);let i=!!(n.flags&Qo);if(!i&&!n.isSimulatedFlags){let t=ks(),n=js(),r=Ms();for(let a of e.split(`+`)){let e=a.replaceAll(/[,_]/g,`-`);if(e=t[e]||n[e]||e,e=e.split(`-`,1)[0],r[e]){i=!0;break}}}this.isSerifFont=i,this.isSymbolicFont=!!(n.flags&$o),this.isMonospace=!!(n.flags&Zo);let{type:a,subtype:o}=n;this.type=a,this.subtype=o,this.systemFontInfo=n.systemFontInfo;let s=e.match(/^InvalidPDFjsFont_(.*)_\d+$/);if(this.isInvalidPDFjsFont=!!s,this.isInvalidPDFjsFont?this.fallbackName=s[1]:this.isMonospace?this.fallbackName=`monospace`:this.isSerifFont?this.fallbackName=`serif`:this.fallbackName=`sans-serif`,this.systemFontInfo?.guessFallback&&(this.systemFontInfo.guessFallback=!1,this.systemFontInfo.css+=`,${this.fallbackName}`),this.differences=n.differences,this.widths=n.widths,this.defaultWidth=n.defaultWidth,this.composite=n.composite,this.cMap=n.cMap,this.capHeight=n.capHeight/jc,this.ascent=n.ascent/jc,this.descent=n.descent/jc,this.lineHeight=this.ascent-this.descent,this.fontMatrix=n.fontMatrix,this.bbox=n.bbox,this.defaultEncoding=n.defaultEncoding,this.toUnicode=n.toUnicode,this.toFontChar=[],n.type===`Type3`){for(let e=0;e<256;e++)this.toFontChar[e]=this.differences[e]||n.defaultEncoding[e];return}if(this.cidEncoding=n.cidEncoding||``,this.vertical=!!n.vertical,this.vertical&&(this.vmetrics=n.vmetrics,this.defaultVMetrics=n.defaultVMetrics),!t||t.isEmpty)return t&&N(`Font file is empty in "`+e+`" (`+this.loadedName+`)`),void this.fallbackToSystemFont(n);let c;[a,o]=Uc(t,n),a===this.type&&o===this.subtype||hn(`Inconsistent font file Type/SubType, expected: ${this.type}/${this.subtype} but found: ${a}/${o}.`);try{switch(a){case`MMType1`:hn(`MMType1 font (`+e+`), falling back to Type1.`);case`Type1`:case`CIDFontType0`:this.mimetype=`font/opentype`;let r=o===`Type1C`||o===`CIDFontType0C`?new Vs(t,n):new kc(e,t,n);Pc(n),c=this.convert(e,r,n);break;case`OpenType`:case`TrueType`:case`CIDFontType2`:this.mimetype=`font/opentype`,c=this.checkAndRepair(e,t,n),Pc(n),this.isOpenType&&(a=`OpenType`);break;default:throw new F(`Font ${a} is not supported`)}}catch(e){N(e),this.fallbackToSystemFont(n);return}Fc(n),this.data=c,this.type=a,this.subtype=o,this.fontMatrix=n.fontMatrix,this.widths=n.widths,this.defaultWidth=n.defaultWidth,this.toUnicode=n.toUnicode,this.seacMap=n.seacMap}get renderer(){return P(this,`renderer`,$s.create(this,Xo))}exportData(){let e=Object.create(null);for(let t of Mc){let n=this[t];n!==void 0&&(e[t]=n)}if(!this.fontExtraProperties)return{data:e};let t=Object.create(null);for(let e of Nc){let n=this[e];n!==void 0&&(t[e]=n)}return{data:e,extra:t}}fallbackToSystemFont(e){this.missingFile=!0;let{name:t,type:n}=this,r=is(t),i=ks(),a=js(),o=!!i[r],s=!(!a[r]||!i[a[r]]);r=i[r]||a[r]||r;let c=tc()[r];c&&(isNaN(this.ascent)&&(this.ascent=c.ascent/jc),isNaN(this.descent)&&(this.descent=c.descent/jc),isNaN(this.capHeight)&&(this.capHeight=c.capHeight/jc)),this.bold=/bold/gi.test(r),this.italic=/oblique|italic/gi.test(r),this.black=/Black/g.test(t);let l=/Narrow/g.test(t);if(this.remeasure=(!o||l)&&Object.keys(this.widths).length>0,(o||s)&&n===`CIDFontType2`&&this.cidEncoding.startsWith(`Identity-`)){let n=e.cidToGidMap,r=[];if(Wc(r,Ps()),/Arial-?Black/i.test(t)?Wc(r,Fs()):/Calibri/i.test(t)&&Wc(r,Is()),n){for(let e in r){let t=r[e];n[t]!==void 0&&(r[+e]=n[t])}n.length!==this.toUnicode.length&&e.hasIncludedToUnicodeMap&&this.toUnicode instanceof Bs&&this.toUnicode.forEach(function(e,t){n[r[e]]===void 0&&(r[+e]=t)})}this.toUnicode instanceof Bs||this.toUnicode.forEach(function(e,t){r[+e]=t}),this.toFontChar=r,this.toUnicode=new zs(r)}else if(/Symbol/i.test(r))this.toFontChar=Gc(zo,Ho(),this.differences);else if(/Dingbats/i.test(r))this.toFontChar=Gc(Bo,Uo(),this.differences);else if(o||s){let e=Gc(this.defaultEncoding,Ho(),this.differences);n!==`CIDFontType2`||this.cidEncoding.startsWith(`Identity-`)||this.toUnicode instanceof Bs||this.toUnicode.forEach(function(t,n){e[+t]=n}),this.toFontChar=e}else{let e=Ho(),n=[];this.toUnicode.forEach((t,r)=>{if(!this.composite){let n=Go(this.differences[t]||this.defaultEncoding[t],e);n!==-1&&(r=n)}n[+t]=r}),this.composite&&this.toUnicode instanceof Bs&&/Tahoma|Verdana/i.test(t)&&Wc(n,Ps()),this.toFontChar=n}Fc(e),this.loadedName=r.split(`-`,1)[0]}checkAndRepair(e,t,n){let r=[`OS/2`,`cmap`,`head`,`hhea`,`hmtx`,`maxp`,`name`,`post`,`loca`,`glyf`,`fpgm`,`prep`,`cvt `,`CFF `];function i(e,t){let n=Object.create(null);n[`OS/2`]=null,n.cmap=null,n.head=null,n.hhea=null,n.hmtx=null,n.maxp=null,n.name=null,n.post=null;for(let i=0;i<t;i++){let t=a(e);r.includes(t.tag)&&t.length!==0&&(n[t.tag]=t)}return n}function a(e){let t=e.getString(4),n=e.getInt32()>>>0,r=e.getInt32()>>>0,i=e.getInt32()>>>0,a=e.pos;e.pos=e.start||0,e.skip(r);let o=e.getBytes(i);return e.pos=a,t===`head`&&(o[8]=o[9]=o[10]=o[11]=0,o[17]|=32),{tag:t,checksum:n,length:i,offset:r,data:o}}function o(e){return{version:e.getString(4),numTables:e.getUint16(),searchRange:e.getUint16(),entrySelector:e.getUint16(),rangeShift:e.getUint16()}}function s(e,t,n,r,i,a){let o={length:0,sizeOfInstructions:0};if(t<0||t>=e.length||n>e.length||n-t<=12)return o;let s=e.subarray(t,n),c=zc(s[2],s[3]),l=zc(s[4],s[5]),u=zc(s[6],s[7]),d=zc(s[8],s[9]);c>u&&(Rc(s,2,u),Rc(s,6,c)),l>d&&(Rc(s,4,d),Rc(s,8,l));let f=zc(s[0],s[1]);if(f<0)return f<-1||(r.set(s,i),o.length=s.length),o;let p,m=10,h=0;for(p=0;p<f;p++)h=(s[m]<<8|s[m+1])+1,m+=2;let g=m,_=s[m]<<8|s[m+1];o.sizeOfInstructions=_,m+=2+_;let v=m,y=0;for(p=0;p<h;p++){let e=s[m++];192&e&&(s[m-1]=63&e);let t=2;2&e?t=1:16&e&&(t=0);let n=2;4&e?n=1:32&e&&(n=0);let r=t+n;if(y+=r,8&e){let e=s[m++];e===0&&(s[m-1]^=8),p+=e,y+=e*r}}if(y===0)return o;let b=m+y;return b>s.length?o:!a&&_>0?(r.set(s.subarray(0,g),i),r.set([0,0],i+g),r.set(s.subarray(v,b),i+g+2),b-=_,s.length-b>3&&(b=b+3&-4),o.length=b,o):s.length-b>3?(b=b+3&-4,r.set(s.subarray(0,b),i),o.length=b,o):(r.set(s,i),o.length=s.length,o)}function c(e){let n=(t.start||0)+e.offset;t.pos=n;let r=[[],[]],i=[],a=e.length,o=n+a;if(t.getUint16()!==0||a<6)return[r,i];let s=t.getUint16(),c=t.getUint16(),l,u;for(l=0;l<s&&t.pos+12<=o;l++){let e={platform:t.getUint16(),encoding:t.getUint16(),language:t.getUint16(),name:t.getUint16(),length:t.getUint16(),offset:t.getUint16()};(Kc(e)||qc(e))&&i.push(e)}for(l=0,u=i.length;l<u;l++){let e=i[l];if(e.length<=0)continue;let a=n+c+e.offset;if(a+e.length>o)continue;t.pos=a;let s=e.name;if(e.encoding){let n=``;for(let r=0,i=e.length;r<i;r+=2)n+=String.fromCharCode(t.getUint16());r[1][s]=n}else r[0][s]=t.getString(e.length)}return[r,i]}let l=[0,0,0,0,0,0,0,0,-2,-2,-2,-2,0,0,-2,-5,-1,-1,-1,-1,-1,-1,-1,-1,0,0,-1,0,-1,-1,-1,-1,1,-1,-999,0,1,0,-1,-2,0,-1,-2,-1,-1,0,-1,-1,0,0,-999,-999,-1,-1,-1,-1,-2,-999,-2,-2,-999,0,-2,-2,0,0,-2,0,-2,0,0,0,-2,-1,-1,1,1,0,0,-1,-1,-1,-1,-1,-1,-1,0,0,-1,0,-1,-1,0,-999,-1,-1,-1,-1,-1,-1,0,0,0,0,0,0,0,0,0,0,0,0,-2,-999,-999,-999,-999,-999,-1,-1,-2,-2,0,0,0,0,-1,-1,-999,-2,-2,0,0,-1,-2,-2,0,0,0,-1,-1,-1,-2];function u(e,t){let n,r,i,a,o,s=e.data,c=0,u=0,d=0,f=[],p=[],m=[],h=t.tooComplexToFollowFunctions,g=!1,_=0,v=0;for(let e=s.length;c<e;){let e=s[c++];if(e===64)if(r=s[c++],g||v)c+=r;else for(n=0;n<r;n++)f.push(s[c++]);else if(e===65)if(r=s[c++],g||v)c+=2*r;else for(n=0;n<r;n++)i=s[c++],f.push(i<<8|s[c++]);else if((248&e)==176)if(r=e-176+1,g||v)c+=r;else for(n=0;n<r;n++)f.push(s[c++]);else if((248&e)==184)if(r=e-184+1,g||v)c+=2*r;else for(n=0;n<r;n++)i=s[c++],f.push(zc(i,s[c++]));else if(e!==43||h)if(e!==44||h){if(e===45)if(g)g=!1,u=c;else{if(o=p.pop(),!o)return N(`TT: ENDF bad stack`),void(t.hintsValid=!1);a=m.pop(),s=o.data,c=o.i,t.functionsStackDeltas[a]=f.length-o.stackTop}else if(e===137)(g||v)&&(N(`TT: nested IDEFs not allowed`),h=!0),g=!0,d=c;else if(e===88)++_;else if(e===27)v=_;else if(e===89)v===_&&(v=0),--_;else if(e===28&&!g&&!v){let e=f.at(-1);e>0&&(c+=e-1)}}else (g||v)&&(N(`TT: nested FDEFs not allowed`),h=!0),g=!0,d=c,a=f.pop(),t.functionsDefined[a]={data:s,i:c};else if(!g&&!v){if(a=f.at(-1),isNaN(a))hn(`TT: CALL empty stack (or invalid entry).`);else if(t.functionsUsed[a]=!0,a in t.functionsStackDeltas){let e=f.length+t.functionsStackDeltas[a];if(e<0)return N(`TT: CALL invalid functions stack delta.`),void(t.hintsValid=!1);f.length=e}else if(a in t.functionsDefined&&!m.includes(a)){if(p.push({data:s,i:c,stackTop:f.length-1}),m.push(a),o=t.functionsDefined[a],!o)return N(`TT: CALL non-existent function`),void(t.hintsValid=!1);s=o.data,c=o.i}}if(!g&&!v){let t=0;for(e<=142?t=l[e]:e>=192&&e<=223?t=-1:e>=224&&(t=-2),e>=113&&e<=117&&(r=f.pop(),isNaN(r)||(t=2*-r));t<0&&f.length>0;)f.pop(),t++;for(;t>0;)f.push(NaN),t--}}t.tooComplexToFollowFunctions=h;let y=[s];c>s.length&&y.push(new Uint8Array(c-s.length)),d>u&&(N(`TT: complementing a missing function tail`),y.push(new Uint8Array([34,45]))),function(e,t){if(t.length>1){let n,r,i=0;for(n=0,r=t.length;n<r;n++)i+=t[n].length;i=i+3&-4;let a=new Uint8Array(i),o=0;for(n=0,r=t.length;n<r;n++)a.set(t[n],o),o+=t[n].length;e.data=a,e.length=i}}(e,y)}let d,f,p,m;if(Hc(t=new gi(new Uint8Array(t.getBytes())))){let e=function(e,t){let{numFonts:n,offsetTable:r}=function(e){let t=e.getString(4);_n(t===`ttcf`,`Must be a TrueType Collection font.`);let n=e.getUint16(),r=e.getUint16(),i=e.getInt32()>>>0,a=[];for(let t=0;t<i;t++)a.push(e.getInt32()>>>0);let o={ttcTag:t,majorVersion:n,minorVersion:r,numFonts:i,offsetTable:a};switch(n){case 1:return o;case 2:return o.dsigTag=e.getInt32()>>>0,o.dsigLength=e.getInt32()>>>0,o.dsigOffset=e.getInt32()>>>0,o}throw new F(`Invalid TrueType Collection majorVersion: ${n}.`)}(e),a=t.split(`+`),s;for(let l=0;l<n;l++){e.pos=(e.start||0)+r[l];let n=o(e),u=i(e,n.numTables);if(!u.name)throw new F(`TrueType Collection font must contain a "name" table.`);let[d]=c(u.name);for(let e=0,r=d.length;e<r;e++)for(let r=0,i=d[e].length;r<i;r++){let i=d[e][r]?.replaceAll(/\s/g,``);if(i){if(i===t)return{header:n,tables:u};if(!(a.length<2))for(let e of a)i===e&&(s={name:e,header:n,tables:u})}}}if(s)return N(`TrueType Collection does not contain "${t}" font, falling back to "${s.name}" font instead.`),{header:s.header,tables:s.tables};throw new F(`TrueType Collection does not contain "${t}" font.`)}(t,this.name);d=e.header,f=e.tables}else d=o(t),f=i(t,d.numTables);let h=!f[`CFF `];if(h){if(!f.loca)throw new F(`Required "loca" table is not found`);f.glyf||(N(`Required "glyf" table is not found -- trying to recover.`),f.glyf={tag:`glyf`,data:new Uint8Array}),this.isOpenType=!1}else{let t=n.composite&&(n.cidToGidMap?.length>0||!(n.cMap instanceof yo));if(d.version===`OTTO`&&!t||!f.head||!f.hhea||!f.maxp||!f.post)return m=new gi(f[`CFF `].data),p=new Vs(m,n),this.convert(e,p,n);delete f.glyf,delete f.loca,delete f.fpgm,delete f.prep,delete f[`cvt `],this.isOpenType=!0}if(!f.maxp)throw new F(`Required "maxp" table is not found`);t.pos=(t.start||0)+f.maxp.offset;let g=t.getInt32(),_=t.getUint16();if(g!==65536&&g!==20480){if(f.maxp.length===6)g=20480;else{if(!(f.maxp.length>=32))throw new F(`"maxp" table has a wrong version number`);g=65536}v=f.maxp.data,b=g,v[(y=0)+3]=255&b,v[y+2]=b>>>8,v[y+1]=b>>>16,v[y]=b>>>24}var v,y,b;if(n.scaleFactors?.length===_&&h){let{scaleFactors:e}=n,t=Lc(f.head.data[50],f.head.data[51]),r=new nc({glyfTable:f.glyf.data,isGlyphLocationsLong:t,locaTable:f.loca.data,numGlyphs:_});r.scale(e);let{glyf:i,loca:a,isLocationLong:o}=r.write();f.glyf.data=i,f.loca.data=a,o!==!!t&&(f.head.data[50]=0,f.head.data[51]=+!!o);let s=f.hmtx.data;for(let t=0;t<_;t++){let n=4*t,r=Math.round(e[t]*Lc(s[n],s[n+1]));s[n]=r>>8&255,s[n+1]=255&r,Rc(s,n+2,Math.round(e[t]*zc(s[n+2],s[n+3])))}}let x=_+1,S=!0;x>65535&&(S=!1,x=_,N(`Not enough space in glyfs to duplicate first glyph.`));let C=0,w=0;g>=65536&&f.maxp.length>=32&&(t.pos+=8,t.getUint16()>2&&(f.maxp.data[14]=0,f.maxp.data[15]=2),t.pos+=4,C=t.getUint16(),t.pos+=4,w=t.getUint16()),f.maxp.data[4]=x>>8,f.maxp.data[5]=255&x;let T=function(e,t,n,r){let i={functionsDefined:[],functionsUsed:[],functionsStackDeltas:[],tooComplexToFollowFunctions:!1,hintsValid:!0};if(e&&u(e,i),t&&u(t,i),e&&function(e,t){if(!e.tooComplexToFollowFunctions){if(e.functionsDefined.length>t)return N(`TT: more functions defined than expected`),void(e.hintsValid=!1);for(let n=0,r=e.functionsUsed.length;n<r;n++){if(n>t)return N(`TT: invalid function id: `+n),void(e.hintsValid=!1);if(e.functionsUsed[n]&&!e.functionsDefined[n])return N(`TT: undefined function: `+n),void(e.hintsValid=!1)}}}(i,r),n&&1&n.length){let e=new Uint8Array(n.length+1);e.set(n.data),n.data=e}return i.hintsValid}(f.fpgm,f.prep,f[`cvt `],C);if(T||(delete f.fpgm,delete f.prep,delete f[`cvt `]),function(e,t,n,r,i,a){if(!t)return void(n&&(n.data=null));e.pos=(e.start||0)+t.offset,e.pos+=4,e.pos+=2,e.pos+=2,e.pos+=2,e.pos+=2,e.pos+=2,e.pos+=2,e.pos+=2,e.pos+=2,e.pos+=2;let o=e.getUint16();e.pos+=8,e.pos+=2;let s=e.getUint16();o!==0&&(2&Lc(r.data[44],r.data[45])||(t.data[22]=0,t.data[23]=0)),s>i&&(hn(`The numOfMetrics (${s}) should not be greater than the numGlyphs (${i}).`),s=i,t.data[34]=(65280&s)>>8,t.data[35]=255&s);let c=i-s-(n.length-4*s>>1);if(c>0){let e=new Uint8Array(n.length+2*c);e.set(n.data),a&&(e[n.length]=n.data[2],e[n.length+1]=n.data[3]),n.data=e}}(t,f.hhea,f.hmtx,f.head,x,S),!f.head)throw new F(`Required "head" table is not found`);(function(e,t,n){let r=e.data,i=(a=r[0],o=r[1],s=r[2],c=r[3],(a<<24)+(o<<16)+(s<<8)+c);var a,o,s,c;i>>16!=1&&(hn(`Attempting to fix invalid version in head table: `+i),r[0]=0,r[1]=1,r[2]=0,r[3]=0);let l=Lc(r[50],r[51]);if(l<0||l>1){hn(`Attempting to fix invalid indexToLocFormat in head table: `+l);let e=t+1;if(n===e<<1)r[50]=0,r[51]=0;else{if(n!==e<<2)throw new F(`Could not fix indexToLocFormat: `+l);r[50]=0,r[51]=1}}})(f.head,_,h?f.loca.length:0);let E=Object.create(null);if(h){let e=Lc(f.head.data[50],f.head.data[51]),t=function(e,t,n,r,i,a,o){let c,l,u;r?(c=4,l=function(e,t){return e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3]},u=function(e,t,n){e[t]=n>>>24&255,e[t+1]=n>>16&255,e[t+2]=n>>8&255,e[t+3]=255&n}):(c=2,l=function(e,t){return e[t]<<9|e[t+1]<<1},u=function(e,t,n){e[t]=n>>9&255,e[t+1]=n>>1&255});let d=a?n+1:n,f=c*(1+d),p=new Uint8Array(f);p.set(e.data.subarray(0,f)),e.data=p;let m=t.data,h=m.length,g=new Uint8Array(h),_,v,y=[];for(_=0,v=0;_<n+1;_++,v+=c){let e=l(p,v);e>h&&(e=h),y.push({index:_,offset:e,endOffset:0})}for(y.sort((e,t)=>e.offset-t.offset),_=0;_<n;_++)y[_].endOffset=y[_+1].offset;for(y.sort((e,t)=>e.index-t.index),_=0;_<n;_++){let{offset:e,endOffset:t}=y[_];if(e!==0||t!==0)break;let n=y[_+1].offset;if(n!==0){y[_].endOffset=n;break}}let b=y.at(-2);b.offset!==0&&b.endOffset===0&&(b.endOffset=h);let x=Object.create(null),S=0;for(u(p,0,S),_=0,v=c;_<n;_++,v+=c){let e=s(m,y[_].offset,y[_].endOffset,g,S,i),t=e.length;t===0&&(x[_]=!0),e.sizeOfInstructions>o&&(o=e.sizeOfInstructions),S+=t,u(p,v,S)}if(S===0){let e=new Uint8Array([0,1,0,0,0,0,0,0,0,0,0,0,0,0,49,0]);for(_=0,v=c;_<d;_++,v+=c)u(p,v,e.length);t.data=e}else if(a){let n=l(p,c);g.length>n+S?t.data=g.subarray(0,n+S):(t.data=new Uint8Array(n+S),t.data.set(g.subarray(0,S))),t.data.set(g.subarray(0,n),S),u(e.data,p.length-c,S+n)}else t.data=g.subarray(0,S);return{missingGlyphs:x,maxSizeOfInstructions:o}}(f.loca,f.glyf,_,e,T,S,w);E=t.missingGlyphs,g>=65536&&f.maxp.length>=32&&(f.maxp.data[26]=t.maxSizeOfInstructions>>8,f.maxp.data[27]=255&t.maxSizeOfInstructions)}if(!f.hhea)throw new F(`Required "hhea" table is not found`);f.hhea.data[10]===0&&f.hhea.data[11]===0&&(f.hhea.data[10]=255,f.hhea.data[11]=255);let D={unitsPerEm:Lc(f.head.data[18],f.head.data[19]),yMax:zc(f.head.data[42],f.head.data[43]),yMin:zc(f.head.data[38],f.head.data[39]),ascent:zc(f.hhea.data[4],f.hhea.data[5]),descent:zc(f.hhea.data[6],f.hhea.data[7]),lineGap:zc(f.hhea.data[8],f.hhea.data[9])};this.ascent=D.ascent/D.unitsPerEm,this.descent=D.descent/D.unitsPerEm,this.lineGap=D.lineGap/D.unitsPerEm,this.cssFontInfo?.lineHeight?(this.lineHeight=this.cssFontInfo.metrics.lineHeight,this.lineGap=this.cssFontInfo.metrics.lineGap):this.lineHeight=this.ascent-this.descent+this.lineGap,f.post&&function(e,n,r){let i=(t.start||0)+e.offset;t.pos=i;let a=i+e.length,o=t.getInt32(),s;t.skip(28);let c,l=!0;switch(o){case 65536:s=ts;break;case 131072:let e=t.getUint16();if(e!==r){l=!1;break}let i=[];for(c=0;c<e;++c){let e=t.getUint16();if(e>=32768){l=!1;break}i.push(e)}if(!l)break;let u=[],d=[];for(;t.pos<a;){let e=t.getByte();for(d.length=e,c=0;c<e;++c)d[c]=String.fromCharCode(t.getByte());u.push(d.join(``))}for(s=[],c=0;c<e;++c){let e=i[c];e<258?s.push(ts[e]):s.push(u[e-258])}break;case 196608:break;default:N(`Unknown/unsupported post table version `+o),l=!1,n.defaultEncoding&&(s=n.defaultEncoding)}n.glyphNames=s}(f.post,n,_),f.post={tag:`post`,data:Qc(n)};let O=Object.create(null);function k(e){return!E[e]}if(n.composite){let e=n.cidToGidMap||[],t=e.length===0;n.cMap.forEach(function(n,r){if(typeof r==`string`&&(r=Jc(n,r,!0)),r>65535)throw new F(`Max size of CID is 65,535`);let i=-1;t?i=r:e[r]!==void 0&&(i=e[r]),i>=0&&i<_&&k(i)&&(O[n]=i)})}else{let e=function(e,t,n,r){if(!e)return N(`No cmap table available.`),{platformId:-1,encodingId:-1,mappings:[],hasShortCmap:!1};let i,a=(t.start||0)+e.offset;t.pos=a,t.skip(2);let o=t.getUint16(),s,c=!1;for(let e=0;e<o;e++){let i=t.getUint16(),a=t.getUint16(),l=t.getInt32()>>>0,u=!1;if(s?.platformId!==i||s?.encodingId!==a){if(i!==0||a!==0&&a!==1&&a!==3)if(i===1&&a===0)u=!0;else if(i!==3||a!==1||!r&&s){if(n&&i===3&&a===0){u=!0;let n=!0;if(e<o-1){let e=t.peekBytes(2);Lc(e[0],e[1])<i&&(n=!1)}n&&(c=!0)}}else u=!0,n||(c=!0);else u=!0;if(u&&(s={platformId:i,encodingId:a,offset:l}),c)break}}if(s&&(t.pos=a+s.offset),!s||t.peekByte()===-1)return N(`Could not find a preferred cmap table.`),{platformId:-1,encodingId:-1,mappings:[],hasShortCmap:!1};let l=t.getUint16(),u=!1,d=[],f,p;if(l===0){for(t.skip(4),f=0;f<256;f++){let e=t.getByte();e&&d.push({charCode:f,glyphId:e})}u=!0}else if(l===2){t.skip(4);let e=[],n=0;for(let r=0;r<256;r++){let r=t.getUint16()>>3;e.push(r),n=Math.max(r,n)}let r=[];for(let e=0;e<=n;e++)r.push({firstCode:t.getUint16(),entryCount:t.getUint16(),idDelta:zc(t.getByte(),t.getByte()),idRangePos:t.pos+t.getUint16()});for(let n=0;n<256;n++)if(e[n]===0)t.pos=r[0].idRangePos+2*n,p=t.getUint16(),d.push({charCode:n,glyphId:p});else{let i=r[e[n]];for(f=0;f<i.entryCount;f++){let e=(n<<8)+f+i.firstCode;t.pos=i.idRangePos+2*f,p=t.getUint16(),p!==0&&(p=(p+i.idDelta)%65536),d.push({charCode:e,glyphId:p})}}}else if(l===4){t.skip(4);let e=t.getUint16()>>1;t.skip(6);let n=[],r;for(r=0;r<e;r++)n.push({end:t.getUint16()});for(t.skip(2),r=0;r<e;r++)n[r].start=t.getUint16();for(r=0;r<e;r++)n[r].delta=t.getUint16();let o,s=0;for(r=0;r<e;r++){i=n[r];let a=t.getUint16();a?(o=(a>>1)-(e-r),i.offsetIndex=o,s=Math.max(s,o+i.end-i.start+1)):i.offsetIndex=-1}let c=[];for(f=0;f<s;f++)c.push(t.getUint16());for(r=0;r<e;r++){i=n[r],a=i.start;let e=i.end,t=i.delta;for(o=i.offsetIndex,f=a;f<=e;f++)f!==65535&&(p=o<0?f:c[o+f-a],p=p+t&65535,d.push({charCode:f,glyphId:p}))}}else if(l===6){t.skip(4);let e=t.getUint16(),n=t.getUint16();for(f=0;f<n;f++){p=t.getUint16();let n=e+f;d.push({charCode:n,glyphId:p})}}else{if(l!==12)return N(`cmap table has unsupported format: `+l),{platformId:-1,encodingId:-1,mappings:[],hasShortCmap:!1};{t.skip(10);let e=t.getInt32()>>>0;for(f=0;f<e;f++){let e=t.getInt32()>>>0,n=t.getInt32()>>>0,r=t.getInt32()>>>0;for(let t=e;t<=n;t++)d.push({charCode:t,glyphId:r++})}}}d.sort((e,t)=>e.charCode-t.charCode);let m=[],h=new Set;for(let e of d){let{charCode:t}=e;h.has(t)||(h.add(t),m.push(e))}return{platformId:s.platformId,encodingId:s.encodingId,mappings:m,hasShortCmap:u}}(f.cmap,t,this.isSymbolicFont,n.hasEncoding),r=e.platformId,i=e.encodingId,a=e.mappings,o=[],s=!1;if(!n.hasEncoding||n.baseEncodingName!==`MacRomanEncoding`&&n.baseEncodingName!==`WinAnsiEncoding`||(o=Vo(n.baseEncodingName)),n.hasEncoding&&!this.isSymbolicFont&&(r===3&&i===1||r===1&&i===0)){let e=Ho();for(let t=0;t<256;t++){let s;if(s=this.differences[t]===void 0?o.length&&o[t]!==``?o[t]:Lo[t]:this.differences[t],!s)continue;let c=ns(s,e),l;if(r===3&&i===1?l=e[c]:r===1&&i===0&&(l=Io.indexOf(c)),l===void 0){if(!n.glyphNames&&n.hasIncludedToUnicodeMap&&!(this.toUnicode instanceof Bs)){let e=this.toUnicode.get(t);e&&(l=e.codePointAt(0))}if(l===void 0)continue}for(let e of a)if(e.charCode===l){O[t]=e.glyphId;break}}}else if(r===0){for(let e of a)O[e.charCode]=e.glyphId;s=!0}else if(r===3&&i===0)for(let e of a){let t=e.charCode;t>=61440&&t<=61695&&(t&=255),O[t]=e.glyphId}else for(let e of a)O[e.charCode]=e.glyphId;if(n.glyphNames&&(o.length||this.differences.length))for(let e=0;e<256;++e){if(!s&&O[e]!==void 0)continue;let t=this.differences[e]||o[e];if(!t)continue;let r=n.glyphNames.indexOf(t);r>0&&k(r)&&(O[e]=r)}}O.length===0&&(O[0]=0);let ee=x-1;if(S||(ee=0),!n.cssFontInfo){let e=Yc(O,k,ee,this.toUnicode);this.toFontChar=e.toFontChar,f.cmap={tag:`cmap`,data:Xc(e.charCodeToGlyphId,e.toUnicodeExtraMap,x)},f[`OS/2`]&&function(e,t){t.pos=(t.start||0)+e.offset;let n=t.getUint16();t.skip(60);let r=t.getUint16();return!(n<4&&768&r)&&!(t.getUint16()>t.getUint16())&&(t.skip(6),t.getUint16()!==0&&(e.data[8]=e.data[9]=0,!0))}(f[`OS/2`],t)||(f[`OS/2`]={tag:`OS/2`,data:Zc(n,e.charCodeToGlyphId,D)})}if(!h)try{m=new gi(f[`CFF `].data),p=new ps(m,n,Xo).parse(),p.duplicateFirstGlyph();let e=new Os(p);f[`CFF `].data=e.compile()}catch{N(`Failed to compile font `+n.loadedName)}if(f.name){let[t,r]=c(f.name);f.name.data=el(e,t),this.psName=t[0][6]||null,n.composite||function(e,t,n){if(e.isInternalFont||e.hasIncludedToUnicodeMap||e.hasEncoding||e.toUnicode instanceof Bs||!t||n.length===0||e.defaultEncoding===Ro)return;for(let e of n)if(!qc(e))return;let r=Ro,i=[],a=Ho();for(let e in r){let t=r[e];if(t===``)continue;let n=a[t];n!==void 0&&(i[e]=String.fromCharCode(n))}i.length>0&&e.toUnicode.amend(i)}(n,this.isSymbolicFont,r)}else f.name={tag:`name`,data:el(this.name)};let A=new dc(d.version);for(let e in f)A.addTable(e,f[e].data);return A.toArray()}convert(e,t,r){r.fixedPitch=!1,r.builtInEncoding&&function(e,t){if(e.isInternalFont||e.hasIncludedToUnicodeMap||t===e.defaultEncoding||e.toUnicode instanceof Bs)return;let n=[],r=Ho();for(let i in t){if(e.hasEncoding&&(e.baseEncodingName||e.differences[i]!==void 0))continue;let a=Go(t[i],r);a!==-1&&(n[i]=String.fromCharCode(a))}n.length>0&&e.toUnicode.amend(n)}(r,r.builtInEncoding);let i=1;t instanceof Vs&&(i=t.numGlyphs-1);let a=t.getGlyphMapping(r),o=null,s=a,c=null;r.cssFontInfo||(o=Yc(a,t.hasGlyphId.bind(t),i,this.toUnicode),this.toFontChar=o.toFontChar,s=o.charCodeToGlyphId,c=o.toUnicodeExtraMap);let l=t.numGlyphs;function u(e,t){let n=null;for(let r in e)t===e[r]&&(n||=[]).push(0|r);return n}function d(e,t){for(let n in e)if(t===e[n])return 0|n;return o.charCodeToGlyphId[o.nextAvailableFontCharCode]=t,o.nextAvailableFontCharCode++}let f=t.seacs;if(o&&f?.length){let e=r.fontMatrix||n,i=t.getCharset(),s=Object.create(null);for(let t in f){t|=0;let n=f[t],r=Lo[n[2]],c=Lo[n[3]],l=i.indexOf(r),p=i.indexOf(c);if(l<0||p<0)continue;let m={x:n[0]*e[0]+n[1]*e[2]+e[4],y:n[0]*e[1]+n[1]*e[3]+e[5]},h=u(a,t);if(h)for(let e of h){let t=o.charCodeToGlyphId;s[e]={baseFontCharCode:d(t,l),accentFontCharCode:d(t,p),accentOffset:m}}}r.seacMap=s}let p=r.fontMatrix?1/Math.max(...r.fontMatrix.slice(0,4).map(Math.abs)):1e3,m=new dc(`OTTO`);return m.addTable(`CFF `,t.data),m.addTable(`OS/2`,Zc(r,s)),m.addTable(`cmap`,Xc(s,c,l)),m.addTable(`head`,`\0\0\0\0\0\0\0\0\0\0_<õ\0\0`+Vc(p)+`\0\0\0\0ž\v~'\0\0\0\0ž\v~'\0\0`+Vc(r.descent)+`ÿ`+Vc(r.ascent)+Bc(r.italicAngle?2:0)+`\0\0\0\0\0\0\0`),m.addTable(`hhea`,`\0\0\0`+Vc(r.ascent)+Vc(r.descent)+`\0\0ÿÿ\0\0\0\0\0\0`+Vc(r.capHeight)+Vc(Math.tan(r.italicAngle)*r.xHeight)+`\0\0\0\0\0\0\0\0\0\0\0\0`+Bc(l)),m.addTable(`hmtx`,function(){let e=t.charstrings,n=t.cff?t.cff.widths:null,r=`\0\0\0\0`;for(let t=1,i=l;t<i;t++){let i=0;if(e){let n=e[t-1];i=`width`in n?n.width:0}else n&&(i=Math.ceil(n[t]||0));r+=Bc(i)+Bc(0)}return r}()),m.addTable(`maxp`,`\0\0P\0`+Bc(l)),m.addTable(`name`,el(e)),m.addTable(`post`,Qc(r)),m.toArray()}get _spaceWidth(){let e=[`space`,`minus`,`one`,`i`,`I`],t;for(let n of e){if(n in this.widths){t=this.widths[n];break}let e=Ho()[n],r=0;if(this.composite&&this.cMap.contains(e)&&(r=this.cMap.lookup(e),typeof r==`string`&&(r=Jc(e,r))),!r&&this.toUnicode&&(r=this.toUnicode.charCodeOf(e)),r<=0&&(r=e),t=this.widths[r],t)break}return P(this,`_spaceWidth`,t||this.defaultWidth)}_charToGlyph(e,t=!1){let n,r,i,a=this._glyphCache[e];if(a?.isSpace===t)return a;let o=e;this.cMap?.contains(e)&&(o=this.cMap.lookup(e),typeof o==`string`&&(o=Jc(e,o))),r=this.widths[o],typeof r!=`number`&&(r=this.defaultWidth);let s=this.vmetrics?.[o],c=this.toUnicode.get(e)||e;typeof c==`number`&&(c=String.fromCharCode(c));let l=this.toFontChar[e]!==void 0;if(n=this.toFontChar[e]||e,this.missingFile){let t=this.differences[e]||this.defaultEncoding[e];t!==`.notdef`&&t!==``||this.type!==`Type1`||(n=32,t===``&&(r||=this._spaceWidth,c=String.fromCharCode(n))),n=(u=n)>=65520&&u<=65535?0:u>=62976&&u<=63743?Wo()[u]||u:u===173?45:u}var u;this.isType3Font&&(i=n);let d=null;if(this.seacMap?.[e]){l=!0;let t=this.seacMap[e];n=t.baseFontCharCode,d={fontChar:String.fromCodePoint(t.accentFontCharCode),offset:t.accentOffset}}let f=``;if(typeof n==`number`&&(n<=1114111?f=String.fromCodePoint(n):N(`charToGlyph - invalid fontCharCode: ${n}`)),this.missingFile&&this.vertical&&f.length===1){let e=as()[f.charCodeAt(0)];e&&(f=c=String.fromCharCode(e))}return a=new Ic(e,f,c,d,r,s,i,t,l),this._glyphCache[e]=a}charsToGlyphs(e){let t=this._charsCache[e];if(t)return t;if(t=[],this.cMap){let n=Object.create(null),r=e.length,i=0;for(;i<r;){this.cMap.readCharCode(e,i,n);let{charcode:r,length:a}=n;i+=a;let o=this._charToGlyph(r,a===1&&e.charCodeAt(i-1)===32);t.push(o)}}else for(let n=0,r=e.length;n<r;++n){let r=e.charCodeAt(n),i=this._charToGlyph(r,r===32);t.push(i)}return this._charsCache[e]=t}getCharPositions(e){let t=[];if(this.cMap){let n=Object.create(null),r=0;for(;r<e.length;){this.cMap.readCharCode(e,r,n);let i=n.length;t.push([r,r+i]),r+=i}}else for(let n=0,r=e.length;n<r;++n)t.push([n,n+1]);return t}get glyphCacheValues(){return Object.values(this._glyphCache)}encodeString(e){let t=[],n=[],r=()=>t.length%2==1,i=this.toUnicode instanceof Bs?e=>this.toUnicode.charCodeOf(e):e=>this.toUnicode.charCodeOf(String.fromCodePoint(e));for(let a=0,o=e.length;a<o;a++){let o=e.codePointAt(a);if(o>55295&&(o<57344||o>65533)&&a++,this.toUnicode){let e=i(o);if(e!==-1){r()&&(t.push(n.join(``)),n.length=0);for(let t=(this.cMap?this.cMap.getCharCodeLength(e):1)-1;t>=0;t--)n.push(String.fromCharCode(e>>8*t&255));continue}}r()||(t.push(n.join(``)),n.length=0),n.push(String.fromCodePoint(o))}return t.push(n.join(``)),t}},nl=class{constructor(e){this.error=e,this.loadedName=`g_font_error`,this.missingFile=!0}charsToGlyphs(){return[]}encodeString(e){return[e]}exportData(){return{error:this.error}}},rl=2,il=3,al=4,ol=5,sl=6,cl=7,ll=class{constructor(){gn(`Cannot initialize Pattern.`)}static parseShading(e,t,n,r,i,a){let o=e instanceof tr?e.dict:e,s=o.get(`ShadingType`);try{switch(s){case rl:case il:return new dl(o,t,n,r,i,a);case al:case ol:case sl:case cl:return new hl(e,t,n,r,i,a);default:throw new F(`Unsupported ShadingType: `+s)}}catch(e){if(e instanceof cr)throw e;return N(e),new gl}}},ul=class{static SMALL_NUMBER=1e-6;getIR(){gn("Abstract method `getIR` called.")}},dl=class extends ul{constructor(e,t,n,r,i,a){super(),this.shadingType=e.get(`ShadingType`);let o=0;if(this.shadingType===rl?o=4:this.shadingType===il&&(o=6),this.coordsArr=e.getArray(`Coords`),!Cr(this.coordsArr,o))throw new F(`RadialAxialShading: Invalid /Coords array.`);let s=Di.parse({cs:e.getRaw(`CS`)||e.getRaw(`ColorSpace`),xref:t,resources:n,pdfFunctionFactory:r,globalColorSpaceCache:i,localColorSpaceCache:a});this.bbox=Er(e.getArray(`BBox`),null);let c=0,l=1,u=e.getArray(`Domain`);Cr(u,2)&&([c,l]=u);let d=!1,f=!1,p=e.getArray(`Extend`);var m,h;if(m=p,h=2,Array.isArray(m)&&m.length===h&&m.every(e=>typeof e==`boolean`)&&([d,f]=p),!(this.shadingType!==il||d&&f)){let[e,t,n,r,i,a]=this.coordsArr,o=Math.hypot(e-r,t-i);n<=a+o&&a<=n+o&&N(`Unsupported radial gradient.`)}this.extendStart=d,this.extendEnd=f;let g=e.getRaw(`Function`),_=r.create(g,!0),v=(l-c)/840,y=this.colorStops=[];if(c>=l||v<=0)return void hn(`Bad shading domain.`);let b=new Float32Array(s.numComps),x=new Float32Array(1),S=0;x[0]=c,_(x,0,b,0);let C=new Uint8ClampedArray(3);s.getRgb(b,0,C);let[w,T,E]=C;y.push([0,jn.makeHexColor(w,T,E)]);let D=1;x[0]=c+v,_(x,0,b,0),s.getRgb(b,0,C);let[O,k,ee]=C,A=O-w+1,j=k-T+1,M=ee-E+1,te=O-w-1,ne=k-T-1,re=ee-E-1;for(let e=2;e<840;e++){x[0]=c+e*v,_(x,0,b,0),s.getRgb(b,0,C);let[t,n,r]=C,i=e-S;if(A=Math.min(A,(t-w+1)/i),j=Math.min(j,(n-T+1)/i),M=Math.min(M,(r-E+1)/i),te=Math.max(te,(t-w-1)/i),ne=Math.max(ne,(n-T-1)/i),re=Math.max(re,(r-E-1)/i),!(te<=A&&ne<=j&&re<=M)){let e=jn.makeHexColor(O,k,ee);y.push([D/840,e]),A=t-O+1,j=n-k+1,M=r-ee+1,te=t-O-1,ne=n-k-1,re=r-ee-1,S=D,w=O,T=k,E=ee}D=e,O=t,k=n,ee=r}y.push([1,jn.makeHexColor(O,k,ee)]);let ie=`transparent`;e.has(`Background`)&&(ie=s.getRgbHex(e.get(`Background`),0)),d||(y.unshift([0,ie]),y[1][0]+=ul.SMALL_NUMBER),f||(y.at(-1)[0]-=ul.SMALL_NUMBER,y.push([1,ie])),this.colorStops=y}getIR(){let{coordsArr:e,shadingType:t}=this,n,r,i,a,o;return t===rl?(r=[e[0],e[1]],i=[e[2],e[3]],a=null,o=null,n=`axial`):t===il?(r=[e[0],e[1]],i=[e[3],e[4]],a=e[2],o=e[5],n=`radial`):gn(`getPattern type unknown: ${t}`),[`RadialAxial`,n,this.bbox,this.colorStops,r,i,a,o]}},fl=class{constructor(e,t){this.stream=e,this.context=t,this.buffer=0,this.bufferLength=0;let n=t.numComps;this.tmpCompsBuf=new Float32Array(n);let r=t.colorSpace.numComps;this.tmpCsCompsBuf=t.colorFn?new Float32Array(r):this.tmpCompsBuf}get hasData(){if(this.stream.end)return this.stream.pos<this.stream.end;if(this.bufferLength>0)return!0;let e=this.stream.getByte();return!(e<0)&&(this.buffer=e,this.bufferLength=8,!0)}readBits(e){let{stream:t}=this,{buffer:n,bufferLength:r}=this;if(e===32){if(r===0)return t.getInt32()>>>0;n=n<<24|t.getByte()<<16|t.getByte()<<8|t.getByte();let e=t.getByte();return this.buffer=e&(1<<r)-1,(n<<8-r|(255&e)>>r)>>>0}if(e===8&&r===0)return t.getByte();for(;r<e;)n=n<<8|t.getByte(),r+=8;return r-=e,this.bufferLength=r,this.buffer=n&(1<<r)-1,n>>r}align(){this.buffer=0,this.bufferLength=0}readFlag(){return this.readBits(this.context.bitsPerFlag)}readCoordinate(){let{bitsPerCoordinate:e,decode:t}=this.context,n=this.readBits(e),r=this.readBits(e),i=e<32?1/((1<<e)-1):23283064365386963e-26;return[n*i*(t[1]-t[0])+t[0],r*i*(t[3]-t[2])+t[2]]}readComponents(){let{bitsPerComponent:e,colorFn:t,colorSpace:n,decode:r,numComps:i}=this.context,a=e<32?1/((1<<e)-1):23283064365386963e-26,o=this.tmpCompsBuf;for(let t=0,n=4;t<i;t++,n+=2)o[t]=this.readBits(e)*a*(r[n+1]-r[n])+r[n];let s=this.tmpCsCompsBuf;return t?.(o,0,s,0),n.getRgb(s,0)}},pl=Object.create(null);function ml(e){return pl[e]||=function(e){let t=[];for(let n=0;n<=e;n++){let r=n/e,i=1-r;t.push(new Float32Array([i**3,3*r*i**2,3*r**2*i,r**3]))}return t}(e)}var hl=class e extends ul{static MIN_SPLIT_PATCH_CHUNKS_AMOUNT=3;static MAX_SPLIT_PATCH_CHUNKS_AMOUNT=20;static TRIANGLE_DENSITY=20;constructor(e,t,n,r,i,a){if(super(),!(e instanceof tr))throw new F(`Mesh data is not a stream`);let o=e.dict;this.shadingType=o.get(`ShadingType`),this.bbox=Er(o.getArray(`BBox`),null);let s=Di.parse({cs:o.getRaw(`CS`)||o.getRaw(`ColorSpace`),xref:t,resources:n,pdfFunctionFactory:r,globalColorSpaceCache:i,localColorSpaceCache:a});this.background=o.has(`Background`)?s.getRgb(o.get(`Background`),0):null;let c=o.getRaw(`Function`),l=c?r.create(c,!0):null;this.coords=[],this.colors=[],this.figures=[];let u=new fl(e,{bitsPerCoordinate:o.get(`BitsPerCoordinate`),bitsPerComponent:o.get(`BitsPerComponent`),bitsPerFlag:o.get(`BitsPerFlag`),decode:o.getArray(`Decode`),colorFn:l,colorSpace:s,numComps:l?1:s.numComps}),d=!1;switch(this.shadingType){case al:this._decodeType4Shading(u);break;case ol:let e=0|o.get(`VerticesPerRow`);if(e<2)throw new F(`Invalid VerticesPerRow`);this._decodeType5Shading(u,e);break;case sl:this._decodeType6Shading(u),d=!0;break;case cl:this._decodeType7Shading(u),d=!0;break;default:gn(`Unsupported mesh type.`)}if(d){this._updateBounds();for(let e=0,t=this.figures.length;e<t;e++)this._buildFigureFromPatch(e)}this._updateBounds(),this._packData()}_decodeType4Shading(e){let t=this.coords,n=this.colors,r=[],i=0;for(;e.hasData;){let a=e.readFlag(),o=e.readCoordinate(),s=e.readComponents();if(i===0){if(!(0<=a&&a<=2))throw new F(`Unknown type4 flag`);switch(a){case 0:i=3;break;case 1:r.push(r.at(-2),r.at(-1)),i=1;break;case 2:r.push(r.at(-3),r.at(-1)),i=1}}r.push(t.length),t.push(o),n.push(s),i--,e.align()}this.figures.push({type:`triangles`,coords:new Int32Array(r),colors:new Int32Array(r)})}_decodeType5Shading(e,t){let n=this.coords,r=this.colors,i=[];for(;e.hasData;){let t=e.readCoordinate(),a=e.readComponents();i.push(n.length),n.push(t),r.push(a)}this.figures.push({type:`lattice`,coords:new Int32Array(i),colors:new Int32Array(i),verticesPerRow:t})}_decodeType6Shading(e){let t=this.coords,n=this.colors,r=new Int32Array(16),i=new Int32Array(4);for(;e.hasData;){let a=e.readFlag();if(!(0<=a&&a<=3))throw new F(`Unknown type6 flag`);let o=t.length;for(let n=0,r=a===0?12:8;n<r;n++)t.push(e.readCoordinate());let s=n.length;for(let t=0,r=a===0?4:2;t<r;t++)n.push(e.readComponents());let c,l,u,d;switch(a){case 0:r[12]=o+3,r[13]=o+4,r[14]=o+5,r[15]=o+6,r[8]=o+2,r[11]=o+7,r[4]=o+1,r[7]=o+8,r[0]=o,r[1]=o+11,r[2]=o+10,r[3]=o+9,i[2]=s+1,i[3]=s+2,i[0]=s,i[1]=s+3;break;case 1:c=r[12],l=r[13],u=r[14],d=r[15],r[12]=d,r[13]=o+0,r[14]=o+1,r[15]=o+2,r[8]=u,r[11]=o+3,r[4]=l,r[7]=o+4,r[0]=c,r[1]=o+7,r[2]=o+6,r[3]=o+5,c=i[2],l=i[3],i[2]=l,i[3]=s,i[0]=c,i[1]=s+1;break;case 2:c=r[15],l=r[11],r[12]=r[3],r[13]=o+0,r[14]=o+1,r[15]=o+2,r[8]=r[7],r[11]=o+3,r[4]=l,r[7]=o+4,r[0]=c,r[1]=o+7,r[2]=o+6,r[3]=o+5,c=i[3],i[2]=i[1],i[3]=s,i[0]=c,i[1]=s+1;break;case 3:r[12]=r[0],r[13]=o+0,r[14]=o+1,r[15]=o+2,r[8]=r[1],r[11]=o+3,r[4]=r[2],r[7]=o+4,r[0]=r[3],r[1]=o+7,r[2]=o+6,r[3]=o+5,i[2]=i[0],i[3]=s,i[0]=i[1],i[1]=s+1}r[5]=t.length,t.push([(-4*t[r[0]][0]-t[r[15]][0]+6*(t[r[4]][0]+t[r[1]][0])-2*(t[r[12]][0]+t[r[3]][0])+3*(t[r[13]][0]+t[r[7]][0]))/9,(-4*t[r[0]][1]-t[r[15]][1]+6*(t[r[4]][1]+t[r[1]][1])-2*(t[r[12]][1]+t[r[3]][1])+3*(t[r[13]][1]+t[r[7]][1]))/9]),r[6]=t.length,t.push([(-4*t[r[3]][0]-t[r[12]][0]+6*(t[r[2]][0]+t[r[7]][0])-2*(t[r[0]][0]+t[r[15]][0])+3*(t[r[4]][0]+t[r[14]][0]))/9,(-4*t[r[3]][1]-t[r[12]][1]+6*(t[r[2]][1]+t[r[7]][1])-2*(t[r[0]][1]+t[r[15]][1])+3*(t[r[4]][1]+t[r[14]][1]))/9]),r[9]=t.length,t.push([(-4*t[r[12]][0]-t[r[3]][0]+6*(t[r[8]][0]+t[r[13]][0])-2*(t[r[0]][0]+t[r[15]][0])+3*(t[r[11]][0]+t[r[1]][0]))/9,(-4*t[r[12]][1]-t[r[3]][1]+6*(t[r[8]][1]+t[r[13]][1])-2*(t[r[0]][1]+t[r[15]][1])+3*(t[r[11]][1]+t[r[1]][1]))/9]),r[10]=t.length,t.push([(-4*t[r[15]][0]-t[r[0]][0]+6*(t[r[11]][0]+t[r[14]][0])-2*(t[r[12]][0]+t[r[3]][0])+3*(t[r[2]][0]+t[r[8]][0]))/9,(-4*t[r[15]][1]-t[r[0]][1]+6*(t[r[11]][1]+t[r[14]][1])-2*(t[r[12]][1]+t[r[3]][1])+3*(t[r[2]][1]+t[r[8]][1]))/9]),this.figures.push({type:`patch`,coords:new Int32Array(r),colors:new Int32Array(i)})}}_decodeType7Shading(e){let t=this.coords,n=this.colors,r=new Int32Array(16),i=new Int32Array(4);for(;e.hasData;){let a=e.readFlag();if(!(0<=a&&a<=3))throw new F(`Unknown type7 flag`);let o=t.length;for(let n=0,r=a===0?16:12;n<r;n++)t.push(e.readCoordinate());let s=n.length;for(let t=0,r=a===0?4:2;t<r;t++)n.push(e.readComponents());let c,l,u,d;switch(a){case 0:r[12]=o+3,r[13]=o+4,r[14]=o+5,r[15]=o+6,r[8]=o+2,r[9]=o+13,r[10]=o+14,r[11]=o+7,r[4]=o+1,r[5]=o+12,r[6]=o+15,r[7]=o+8,r[0]=o,r[1]=o+11,r[2]=o+10,r[3]=o+9,i[2]=s+1,i[3]=s+2,i[0]=s,i[1]=s+3;break;case 1:c=r[12],l=r[13],u=r[14],d=r[15],r[12]=d,r[13]=o+0,r[14]=o+1,r[15]=o+2,r[8]=u,r[9]=o+9,r[10]=o+10,r[11]=o+3,r[4]=l,r[5]=o+8,r[6]=o+11,r[7]=o+4,r[0]=c,r[1]=o+7,r[2]=o+6,r[3]=o+5,c=i[2],l=i[3],i[2]=l,i[3]=s,i[0]=c,i[1]=s+1;break;case 2:c=r[15],l=r[11],r[12]=r[3],r[13]=o+0,r[14]=o+1,r[15]=o+2,r[8]=r[7],r[9]=o+9,r[10]=o+10,r[11]=o+3,r[4]=l,r[5]=o+8,r[6]=o+11,r[7]=o+4,r[0]=c,r[1]=o+7,r[2]=o+6,r[3]=o+5,c=i[3],i[2]=i[1],i[3]=s,i[0]=c,i[1]=s+1;break;case 3:r[12]=r[0],r[13]=o+0,r[14]=o+1,r[15]=o+2,r[8]=r[1],r[9]=o+9,r[10]=o+10,r[11]=o+3,r[4]=r[2],r[5]=o+8,r[6]=o+11,r[7]=o+4,r[0]=r[3],r[1]=o+7,r[2]=o+6,r[3]=o+5,i[2]=i[0],i[3]=s,i[0]=i[1],i[1]=s+1}this.figures.push({type:`patch`,coords:new Int32Array(r),colors:new Int32Array(i)})}}_buildFigureFromPatch(t){let n=this.figures[t];_n(n.type===`patch`,`Unexpected patch mesh figure`);let r=this.coords,i=this.colors,a=n.coords,o=n.colors,s=Math.min(r[a[0]][0],r[a[3]][0],r[a[12]][0],r[a[15]][0]),c=Math.min(r[a[0]][1],r[a[3]][1],r[a[12]][1],r[a[15]][1]),l=Math.max(r[a[0]][0],r[a[3]][0],r[a[12]][0],r[a[15]][0]),u=Math.max(r[a[0]][1],r[a[3]][1],r[a[12]][1],r[a[15]][1]),d=Math.ceil((l-s)*e.TRIANGLE_DENSITY/(this.bounds[2]-this.bounds[0]));d=Bn(d,e.MIN_SPLIT_PATCH_CHUNKS_AMOUNT,e.MAX_SPLIT_PATCH_CHUNKS_AMOUNT);let f=Math.ceil((u-c)*e.TRIANGLE_DENSITY/(this.bounds[3]-this.bounds[1]));f=Bn(f,e.MIN_SPLIT_PATCH_CHUNKS_AMOUNT,e.MAX_SPLIT_PATCH_CHUNKS_AMOUNT);let p=d+1,m=new Int32Array((f+1)*p),h=new Int32Array((f+1)*p),g=0,_=new Uint8Array(3),v=new Uint8Array(3),y=i[o[0]],b=i[o[1]],x=i[o[2]],S=i[o[3]],C=ml(f),w=ml(d);for(let e=0;e<=f;e++){_[0]=(y[0]*(f-e)+x[0]*e)/f|0,_[1]=(y[1]*(f-e)+x[1]*e)/f|0,_[2]=(y[2]*(f-e)+x[2]*e)/f|0,v[0]=(b[0]*(f-e)+S[0]*e)/f|0,v[1]=(b[1]*(f-e)+S[1]*e)/f|0,v[2]=(b[2]*(f-e)+S[2]*e)/f|0;for(let t=0;t<=d;t++,g++){if(!(e!==0&&e!==f||t!==0&&t!==d))continue;let n=0,o=0,s=0;for(let i=0;i<=3;i++)for(let c=0;c<=3;c++,s++){let l=C[e][i]*w[t][c];n+=r[a[s]][0]*l,o+=r[a[s]][1]*l}m[g]=r.length,r.push([n,o]),h[g]=i.length;let c=new Uint8Array(3);c[0]=(_[0]*(d-t)+v[0]*t)/d|0,c[1]=(_[1]*(d-t)+v[1]*t)/d|0,c[2]=(_[2]*(d-t)+v[2]*t)/d|0,i.push(c)}}m[0]=a[0],h[0]=o[0],m[d]=a[3],h[d]=o[1],m[p*f]=a[12],h[p*f]=o[2],m[p*f+d]=a[15],h[p*f+d]=o[3],this.figures[t]={type:`lattice`,coords:m,colors:h,verticesPerRow:p}}_updateBounds(){let e=this.coords[0][0],t=this.coords[0][1],n=e,r=t;for(let i=1,a=this.coords.length;i<a;i++){let a=this.coords[i][0],o=this.coords[i][1];e=e>a?a:e,t=t>o?o:t,n=n<a?a:n,r=r<o?o:r}this.bounds=[e,t,n,r]}_packData(){let e,t,n,r,i=this.coords,a=new Float32Array(2*i.length);for(e=0,n=0,t=i.length;e<t;e++){let t=i[e];a[n++]=t[0],a[n++]=t[1]}this.coords=a;let o=this.colors,s=new Uint8Array(3*o.length);for(e=0,n=0,t=o.length;e<t;e++){let t=o[e];s[n++]=t[0],s[n++]=t[1],s[n++]=t[2]}this.colors=s;let c=this.figures;for(e=0,t=c.length;e<t;e++){let t=c[e],i=t.coords,a=t.colors;for(n=0,r=i.length;n<r;n++)i[n]*=2,a[n]*=3}}getIR(){let{bounds:e}=this;if(e[2]-e[0]===0||e[3]-e[1]===0)throw new F(`Invalid MeshShading bounds: [${e}].`);return[`Mesh`,this.shadingType,this.coords,this.colors,this.figures,e,this.bbox,this.background]}},gl=class extends ul{getIR(){return[`Dummy`]}};function _l(e,t,n){let r=wr(t.getArray(`Matrix`),ir),i=Er(t.getArray(`BBox`),null);if(!i||i[2]-i[0]===0||i[3]-i[1]===0)throw new F(`Invalid getTilingPatternIR /BBox array.`);let a=t.get(`XStep`);if(typeof a!=`number`)throw new F(`Invalid getTilingPatternIR /XStep value.`);let o=t.get(`YStep`);if(typeof o!=`number`)throw new F(`Invalid getTilingPatternIR /YStep value.`);let s=t.get(`PaintType`);if(!Number.isInteger(s))throw new F(`Invalid getTilingPatternIR /PaintType value.`);let c=t.get(`TilingType`);if(!Number.isInteger(c))throw new F(`Invalid getTilingPatternIR /TilingType value.`);return[`TilingPattern`,n,e,r,i,a,o,s,c]}var vl=[1.3877,1,1,1,.97801,.92482,.89552,.91133,.81988,.97566,.98152,.93548,.93548,1.2798,.85284,.92794,1,.96134,1.54657,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.82845,.82845,.85284,.85284,.85284,.75859,.92138,.83908,.7762,.73293,.87289,.73133,.7514,.81921,.87356,.95958,.59526,.75727,.69225,1.04924,.9121,.86943,.79795,.88198,.77958,.70864,.81055,.90399,.88653,.96017,.82577,.77892,.78257,.97507,1.54657,.97507,.85284,.89552,.90176,.88762,.8785,.75241,.8785,.90518,.95015,.77618,.8785,.88401,.91916,.86304,.88401,.91488,.8785,.8801,.8785,.8785,.91343,.7173,1.04106,.8785,.85075,.95794,.82616,.85162,.79492,.88331,1.69808,.88331,.85284,.97801,.89552,.91133,.89552,.91133,1.7801,.89552,1.24487,1.13254,1.12401,.96839,.85284,.68787,.70645,.85592,.90747,1.01466,1.0088,.90323,1,1.07463,1,.91056,.75806,1.19118,.96839,.78864,.82845,.84133,.75859,.83908,.83908,.83908,.83908,.83908,.83908,.77539,.73293,.73133,.73133,.73133,.73133,.95958,.95958,.95958,.95958,.88506,.9121,.86943,.86943,.86943,.86943,.86943,.85284,.87508,.90399,.90399,.90399,.90399,.77892,.79795,.90807,.88762,.88762,.88762,.88762,.88762,.88762,.8715,.75241,.90518,.90518,.90518,.90518,.88401,.88401,.88401,.88401,.8785,.8785,.8801,.8801,.8801,.8801,.8801,.90747,.89049,.8785,.8785,.8785,.8785,.85162,.8785,.85162,.83908,.88762,.83908,.88762,.83908,.88762,.73293,.75241,.73293,.75241,.73293,.75241,.73293,.75241,.87289,.83016,.88506,.93125,.73133,.90518,.73133,.90518,.73133,.90518,.73133,.90518,.73133,.90518,.81921,.77618,.81921,.77618,.81921,.77618,1,1,.87356,.8785,.91075,.89608,.95958,.88401,.95958,.88401,.95958,.88401,.95958,.88401,.95958,.88401,.76229,.90167,.59526,.91916,1,1,.86304,.69225,.88401,1,1,.70424,.79468,.91926,.88175,.70823,.94903,.9121,.8785,1,1,.9121,.8785,.87802,.88656,.8785,.86943,.8801,.86943,.8801,.86943,.8801,.87402,.89291,.77958,.91343,1,1,.77958,.91343,.70864,.7173,.70864,.7173,.70864,.7173,.70864,.7173,1,1,.81055,.75841,.81055,1.06452,.90399,.8785,.90399,.8785,.90399,.8785,.90399,.8785,.90399,.8785,.90399,.8785,.96017,.95794,.77892,.85162,.77892,.78257,.79492,.78257,.79492,.78257,.79492,.9297,.56892,.83908,.88762,.77539,.8715,.87508,.89049,1,1,.81055,1.04106,1.20528,1.20528,1,1.15543,.70674,.98387,.94721,1.33431,1.45894,.95161,1.06303,.83908,.80352,.57184,.6965,.56289,.82001,.56029,.81235,1.02988,.83908,.7762,.68156,.80367,.73133,.78257,.87356,.86943,.95958,.75727,.89019,1.04924,.9121,.7648,.86943,.87356,.79795,.78275,.81055,.77892,.9762,.82577,.99819,.84896,.95958,.77892,.96108,1.01407,.89049,1.02988,.94211,.96108,.8936,.84021,.87842,.96399,.79109,.89049,1.00813,1.02988,.86077,.87445,.92099,.84723,.86513,.8801,.75638,.85714,.78216,.79586,.87965,.94211,.97747,.78287,.97926,.84971,1.02988,.94211,.8801,.94211,.84971,.73133,1,1,1,1,1,1,1,1,1,1,1,1,.90264,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.90518,1,1,1,1,1,1,1,1,1,1,1,1,.90548,1,1,1,1,1,1,.96017,.95794,.96017,.95794,.96017,.95794,.77892,.85162,1,1,.89552,.90527,1,.90363,.92794,.92794,.92794,.92794,.87012,.87012,.87012,.89552,.89552,1.42259,.71143,1.06152,1,1,1.03372,1.03372,.97171,1.4956,2.2807,.93835,.83406,.91133,.84107,.91133,1,1,1,.72021,1,1.23108,.83489,.88525,.88525,.81499,.90527,1.81055,.90527,1.81055,1.31006,1.53711,.94434,1.08696,1,.95018,.77192,.85284,.90747,1.17534,.69825,.9716,1.37077,.90747,.90747,.85356,.90747,.90747,1.44947,.85284,.8941,.8941,.70572,.8,.70572,.70572,.70572,.70572,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.99862,.99862,1,1,1,1,1,1.08004,.91027,1,1,1,.99862,1,1,1,1,1,1,1,1,1,1,1,1,.90727,.90727,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],yl={lineHeight:1.2207,lineGap:.2207},bl=[1.3877,1,1,1,.97801,.92482,.89552,.91133,.81988,.97566,.98152,.93548,.93548,1.2798,.85284,.92794,1,.96134,1.56239,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.82845,.82845,.85284,.85284,.85284,.75859,.92138,.83908,.7762,.71805,.87289,.73133,.7514,.81921,.87356,.95958,.59526,.75727,.69225,1.04924,.90872,.85938,.79795,.87068,.77958,.69766,.81055,.90399,.88653,.96068,.82577,.77892,.78257,.97507,1.529,.97507,.85284,.89552,.90176,.94908,.86411,.74012,.86411,.88323,.95015,.86411,.86331,.88401,.91916,.86304,.88401,.9039,.86331,.86331,.86411,.86411,.90464,.70852,1.04106,.86331,.84372,.95794,.82616,.84548,.79492,.88331,1.69808,.88331,.85284,.97801,.89552,.91133,.89552,.91133,1.7801,.89552,1.24487,1.13254,1.19129,.96839,.85284,.68787,.70645,.85592,.90747,1.01466,1.0088,.90323,1,1.07463,1,.91056,.75806,1.19118,.96839,.78864,.82845,.84133,.75859,.83908,.83908,.83908,.83908,.83908,.83908,.77539,.71805,.73133,.73133,.73133,.73133,.95958,.95958,.95958,.95958,.88506,.90872,.85938,.85938,.85938,.85938,.85938,.85284,.87068,.90399,.90399,.90399,.90399,.77892,.79795,.90807,.94908,.94908,.94908,.94908,.94908,.94908,.85887,.74012,.88323,.88323,.88323,.88323,.88401,.88401,.88401,.88401,.8785,.86331,.86331,.86331,.86331,.86331,.86331,.90747,.89049,.86331,.86331,.86331,.86331,.84548,.86411,.84548,.83908,.94908,.83908,.94908,.83908,.94908,.71805,.74012,.71805,.74012,.71805,.74012,.71805,.74012,.87289,.79538,.88506,.92726,.73133,.88323,.73133,.88323,.73133,.88323,.73133,.88323,.73133,.88323,.81921,.86411,.81921,.86411,.81921,.86411,1,1,.87356,.86331,.91075,.8777,.95958,.88401,.95958,.88401,.95958,.88401,.95958,.88401,.95958,.88401,.76467,.90167,.59526,.91916,1,1,.86304,.69225,.88401,1,1,.70424,.77312,.91926,.88175,.70823,.94903,.90872,.86331,1,1,.90872,.86331,.86906,.88116,.86331,.85938,.86331,.85938,.86331,.85938,.86331,.87402,.86549,.77958,.90464,1,1,.77958,.90464,.69766,.70852,.69766,.70852,.69766,.70852,.69766,.70852,1,1,.81055,.75841,.81055,1.06452,.90399,.86331,.90399,.86331,.90399,.86331,.90399,.86331,.90399,.86331,.90399,.86331,.96068,.95794,.77892,.84548,.77892,.78257,.79492,.78257,.79492,.78257,.79492,.9297,.56892,.83908,.94908,.77539,.85887,.87068,.89049,1,1,.81055,1.04106,1.20528,1.20528,1,1.15543,.70088,.98387,.94721,1.33431,1.45894,.95161,1.48387,.83908,.80352,.57118,.6965,.56347,.79179,.55853,.80346,1.02988,.83908,.7762,.67174,.86036,.73133,.78257,.87356,.86441,.95958,.75727,.89019,1.04924,.90872,.74889,.85938,.87891,.79795,.7957,.81055,.77892,.97447,.82577,.97466,.87179,.95958,.77892,.94252,.95612,.8753,1.02988,.92733,.94252,.87411,.84021,.8728,.95612,.74081,.8753,1.02189,1.02988,.84814,.87445,.91822,.84723,.85668,.86331,.81344,.87581,.76422,.82046,.96057,.92733,.99375,.78022,.95452,.86015,1.02988,.92733,.86331,.92733,.86015,.73133,1,1,1,1,1,1,1,1,1,1,1,1,.90631,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.88323,1,1,1,1,1,1,1,1,1,1,1,1,.85174,1,1,1,1,1,1,.96068,.95794,.96068,.95794,.96068,.95794,.77892,.84548,1,1,.89552,.90527,1,.90363,.92794,.92794,.92794,.89807,.87012,.87012,.87012,.89552,.89552,1.42259,.71094,1.06152,1,1,1.03372,1.03372,.97171,1.4956,2.2807,.92972,.83406,.91133,.83326,.91133,1,1,1,.72021,1,1.23108,.83489,.88525,.88525,.81499,.90616,1.81055,.90527,1.81055,1.3107,1.53711,.94434,1.08696,1,.95018,.77192,.85284,.90747,1.17534,.69825,.9716,1.37077,.90747,.90747,.85356,.90747,.90747,1.44947,.85284,.8941,.8941,.70572,.8,.70572,.70572,.70572,.70572,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.99862,.99862,1,1,1,1,1,1.08004,.91027,1,1,1,.99862,1,1,1,1,1,1,1,1,1,1,1,1,.90727,.90727,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],xl={lineHeight:1.2207,lineGap:.2207},Sl=[1.3877,1,1,1,1.17223,1.1293,.89552,.91133,.80395,1.02269,1.15601,.91056,.91056,1.2798,.85284,.89807,1,.90861,1.39543,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.96309,.96309,.85284,.85284,.85284,.83319,.88071,.8675,.81552,.72346,.85193,.73206,.7522,.81105,.86275,.90685,.6377,.77892,.75593,1.02638,.89249,.84118,.77452,.85374,.75186,.67789,.79776,.88844,.85066,.94309,.77818,.7306,.76659,1.10369,1.38313,1.10369,1.06139,.89552,.8739,.9245,.9245,.83203,.9245,.85865,1.09842,.9245,.9245,1.03297,1.07692,.90918,1.03297,.94959,.9245,.92274,.9245,.9245,1.02933,.77832,1.20562,.9245,.8916,.98986,.86621,.89453,.79004,.94152,1.77256,.94152,.85284,.97801,.89552,.91133,.89552,.91133,1.91729,.89552,1.17889,1.13254,1.16359,.92098,.85284,.68787,.71353,.84737,.90747,1.0088,1.0044,.87683,1,1.09091,1,.92229,.739,1.15642,.92098,.76288,.80504,.80972,.75859,.8675,.8675,.8675,.8675,.8675,.8675,.76318,.72346,.73206,.73206,.73206,.73206,.90685,.90685,.90685,.90685,.86477,.89249,.84118,.84118,.84118,.84118,.84118,.85284,.84557,.88844,.88844,.88844,.88844,.7306,.77452,.86331,.9245,.9245,.9245,.9245,.9245,.9245,.84843,.83203,.85865,.85865,.85865,.85865,.82601,.82601,.82601,.82601,.94469,.9245,.92274,.92274,.92274,.92274,.92274,.90747,.86651,.9245,.9245,.9245,.9245,.89453,.9245,.89453,.8675,.9245,.8675,.9245,.8675,.9245,.72346,.83203,.72346,.83203,.72346,.83203,.72346,.83203,.85193,.8875,.86477,.99034,.73206,.85865,.73206,.85865,.73206,.85865,.73206,.85865,.73206,.85865,.81105,.9245,.81105,.9245,.81105,.9245,1,1,.86275,.9245,.90872,.93591,.90685,.82601,.90685,.82601,.90685,.82601,.90685,1.03297,.90685,.82601,.77896,1.05611,.6377,1.07692,1,1,.90918,.75593,1.03297,1,1,.76032,.9375,.98156,.93407,.77261,1.11429,.89249,.9245,1,1,.89249,.9245,.92534,.86698,.9245,.84118,.92274,.84118,.92274,.84118,.92274,.8667,.86291,.75186,1.02933,1,1,.75186,1.02933,.67789,.77832,.67789,.77832,.67789,.77832,.67789,.77832,1,1,.79776,.97655,.79776,1.23023,.88844,.9245,.88844,.9245,.88844,.9245,.88844,.9245,.88844,.9245,.88844,.9245,.94309,.98986,.7306,.89453,.7306,.76659,.79004,.76659,.79004,.76659,.79004,1.09231,.54873,.8675,.9245,.76318,.84843,.84557,.86651,1,1,.79776,1.20562,1.18622,1.18622,1,1.1437,.67009,.96334,.93695,1.35191,1.40909,.95161,1.48387,.8675,.90861,.6192,.7363,.64824,.82411,.56321,.85696,1.23516,.8675,.81552,.7286,.84134,.73206,.76659,.86275,.84369,.90685,.77892,.85871,1.02638,.89249,.75828,.84118,.85984,.77452,.76466,.79776,.7306,.90782,.77818,.903,.87291,.90685,.7306,.99058,1.03667,.94635,1.23516,.9849,.99058,.92393,.8916,.942,1.03667,.75026,.94635,1.0297,1.23516,.90918,.94048,.98217,.89746,.84153,.92274,.82507,.88832,.84438,.88178,1.03525,.9849,1.00225,.78086,.97248,.89404,1.23516,.9849,.92274,.9849,.89404,.73206,1,1,1,1,1,1,1,1,1,1,1,1,.89693,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.85865,1,1,1,1,1,1,1,1,1,1,1,1,.90933,1,1,1,1,1,1,.94309,.98986,.94309,.98986,.94309,.98986,.7306,.89453,1,1,.89552,.90527,1,.90186,1.12308,1.12308,1.12308,1.12308,1.2566,1.2566,1.2566,.89552,.89552,1.42259,.68994,1.03809,1,1,1.0176,1.0176,1.11523,1.4956,2.01462,.97858,.82616,.91133,.83437,.91133,1,1,1,.70508,1,1.23108,.79801,.84426,.84426,.774,.90572,1.81055,.90749,1.81055,1.28809,1.55469,.94434,1.07806,1,.97094,.7589,.85284,.90747,1.19658,.69825,.97622,1.33512,.90747,.90747,.85284,.90747,.90747,1.44947,.85284,.8941,.8941,.70572,.8,.70572,.70572,.70572,.70572,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.99862,.99862,1,1,1,1,1,1.0336,.91027,1,1,1,.99862,1,1,1,1,1,1,1,1,1,1,1,1,1.05859,1.05859,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],Cl={lineHeight:1.2207,lineGap:.2207},wl=[1.3877,1,1,1,1.17223,1.1293,.89552,.91133,.80395,1.02269,1.15601,.91056,.91056,1.2798,.85284,.89807,1,.90861,1.39016,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.96309,.96309,.85284,.85284,.85284,.83319,.88071,.8675,.81552,.73834,.85193,.73206,.7522,.81105,.86275,.90685,.6377,.77892,.75593,1.02638,.89385,.85122,.77452,.86503,.75186,.68887,.79776,.88844,.85066,.94258,.77818,.7306,.76659,1.10369,1.39016,1.10369,1.06139,.89552,.8739,.86128,.94469,.8457,.94469,.89464,1.09842,.84636,.94469,1.03297,1.07692,.90918,1.03297,.95897,.94469,.9482,.94469,.94469,1.04692,.78223,1.20562,.94469,.90332,.98986,.86621,.90527,.79004,.94152,1.77256,.94152,.85284,.97801,.89552,.91133,.89552,.91133,1.91729,.89552,1.17889,1.13254,1.08707,.92098,.85284,.68787,.71353,.84737,.90747,1.0088,1.0044,.87683,1,1.09091,1,.92229,.739,1.15642,.92098,.76288,.80504,.80972,.75859,.8675,.8675,.8675,.8675,.8675,.8675,.76318,.73834,.73206,.73206,.73206,.73206,.90685,.90685,.90685,.90685,.86477,.89385,.85122,.85122,.85122,.85122,.85122,.85284,.85311,.88844,.88844,.88844,.88844,.7306,.77452,.86331,.86128,.86128,.86128,.86128,.86128,.86128,.8693,.8457,.89464,.89464,.89464,.89464,.82601,.82601,.82601,.82601,.94469,.94469,.9482,.9482,.9482,.9482,.9482,.90747,.86651,.94469,.94469,.94469,.94469,.90527,.94469,.90527,.8675,.86128,.8675,.86128,.8675,.86128,.73834,.8457,.73834,.8457,.73834,.8457,.73834,.8457,.85193,.92454,.86477,.9921,.73206,.89464,.73206,.89464,.73206,.89464,.73206,.89464,.73206,.89464,.81105,.84636,.81105,.84636,.81105,.84636,1,1,.86275,.94469,.90872,.95786,.90685,.82601,.90685,.82601,.90685,.82601,.90685,1.03297,.90685,.82601,.77741,1.05611,.6377,1.07692,1,1,.90918,.75593,1.03297,1,1,.76032,.90452,.98156,1.11842,.77261,1.11429,.89385,.94469,1,1,.89385,.94469,.95877,.86901,.94469,.85122,.9482,.85122,.9482,.85122,.9482,.8667,.90016,.75186,1.04692,1,1,.75186,1.04692,.68887,.78223,.68887,.78223,.68887,.78223,.68887,.78223,1,1,.79776,.92188,.79776,1.23023,.88844,.94469,.88844,.94469,.88844,.94469,.88844,.94469,.88844,.94469,.88844,.94469,.94258,.98986,.7306,.90527,.7306,.76659,.79004,.76659,.79004,.76659,.79004,1.09231,.54873,.8675,.86128,.76318,.8693,.85311,.86651,1,1,.79776,1.20562,1.18622,1.18622,1,1.1437,.67742,.96334,.93695,1.35191,1.40909,.95161,1.48387,.86686,.90861,.62267,.74359,.65649,.85498,.56963,.88254,1.23516,.8675,.81552,.75443,.84503,.73206,.76659,.86275,.85122,.90685,.77892,.85746,1.02638,.89385,.75657,.85122,.86275,.77452,.74171,.79776,.7306,.95165,.77818,.89772,.88831,.90685,.7306,.98142,1.02191,.96576,1.23516,.99018,.98142,.9236,.89258,.94035,1.02191,.78848,.96576,.9561,1.23516,.90918,.92578,.95424,.89746,.83969,.9482,.80113,.89442,.85208,.86155,.98022,.99018,1.00452,.81209,.99247,.89181,1.23516,.99018,.9482,.99018,.89181,.73206,1,1,1,1,1,1,1,1,1,1,1,1,.88844,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.89464,1,1,1,1,1,1,1,1,1,1,1,1,.96766,1,1,1,1,1,1,.94258,.98986,.94258,.98986,.94258,.98986,.7306,.90527,1,1,.89552,.90527,1,.90186,1.12308,1.12308,1.12308,1.12308,1.2566,1.2566,1.2566,.89552,.89552,1.42259,.69043,1.03809,1,1,1.0176,1.0176,1.11523,1.4956,2.01462,.99331,.82616,.91133,.84286,.91133,1,1,1,.70508,1,1.23108,.79801,.84426,.84426,.774,.90527,1.81055,.90527,1.81055,1.28809,1.55469,.94434,1.07806,1,.97094,.7589,.85284,.90747,1.19658,.69825,.97622,1.33512,.90747,.90747,.85356,.90747,.90747,1.44947,.85284,.8941,.8941,.70572,.8,.70572,.70572,.70572,.70572,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.99862,.99862,1,1,1,1,1,1.0336,.91027,1,1,1,.99862,1,1,1,1,1,1,1,1,1,1,1,1,1.05859,1.05859,1,1,1,1.07185,.99413,.96334,1.08065,1,1,1,1,1,1,1,1,1,1,1],Tl={lineHeight:1.2207,lineGap:.2207},El=[.76116,1,1,1.0006,.99998,.99974,.99973,.99973,.99982,.99977,1.00087,.99998,.99998,.99959,1.00003,1.0006,.99998,1.0006,1.0006,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99998,1,1.00003,1.00003,1.00003,1.00026,.9999,.99977,.99977,.99977,.99977,1.00001,1.00026,1.00022,.99977,1.0006,.99973,.99977,1.00026,.99999,.99977,1.00022,1.00001,1.00022,.99977,1.00001,1.00026,.99977,1.00001,1.00016,1.00001,1.00001,1.00026,.99998,1.0006,.99998,1.00003,.99973,.99998,.99973,1.00026,.99973,1.00026,.99973,.99998,1.00026,1.00026,1.0006,1.0006,.99973,1.0006,.99982,1.00026,1.00026,1.00026,1.00026,.99959,.99973,.99998,1.00026,.99973,1.00022,.99973,.99973,1,.99959,1.00077,.99959,1.00003,.99998,.99973,.99973,.99973,.99973,1.00077,.99973,.99998,1.00025,.99968,.99973,1.00003,1.00025,.60299,1.00024,1.06409,1,1,.99998,1,.99973,1.0006,.99998,1,.99936,.99973,1.00002,1.00002,1.00002,1.00026,.99977,.99977,.99977,.99977,.99977,.99977,1,.99977,1.00001,1.00001,1.00001,1.00001,1.0006,1.0006,1.0006,1.0006,.99977,.99977,1.00022,1.00022,1.00022,1.00022,1.00022,1.00003,1.00022,.99977,.99977,.99977,.99977,1.00001,1.00001,1.00026,.99973,.99973,.99973,.99973,.99973,.99973,.99982,.99973,.99973,.99973,.99973,.99973,1.0006,1.0006,1.0006,1.0006,1.00026,1.00026,1.00026,1.00026,1.00026,1.00026,1.00026,1.06409,1.00026,1.00026,1.00026,1.00026,1.00026,.99973,1.00026,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,1.03374,.99977,1.00026,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00022,1.00026,1.00022,1.00026,1.00022,1.00026,1.00022,1.00026,.99977,1.00026,.99977,1.00026,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,1.00042,.99973,.99973,1.0006,.99977,.99973,.99973,1.00026,1.0006,1.00026,1.0006,1.00026,1.03828,1.00026,.99999,1.00026,1.0006,.99977,1.00026,.99977,1.00026,.99977,1.00026,.9993,.9998,1.00026,1.00022,1.00026,1.00022,1.00026,1.00022,1.00026,1,1.00016,.99977,.99959,.99977,.99959,.99977,.99959,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00026,.99998,1.00026,.8121,1.00026,.99998,.99977,1.00026,.99977,1.00026,.99977,1.00026,.99977,1.00026,.99977,1.00026,.99977,1.00026,1.00016,1.00022,1.00001,.99973,1.00001,1.00026,1,1.00026,1,1.00026,1,1.0006,.99973,.99977,.99973,1,.99982,1.00022,1.00026,1.00001,.99973,1.00026,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,1.00034,.99977,1,.99997,1.00026,1.00078,1.00036,.99973,1.00013,1.0006,.99977,.99977,.99988,.85148,1.00001,1.00026,.99977,1.00022,1.0006,.99977,1.00001,.99999,.99977,1.00069,1.00022,.99977,1.00001,.99984,1.00026,1.00001,1.00024,1.00001,.9999,1,1.0006,1.00001,1.00041,.99962,1.00026,1.0006,.99995,1.00041,.99942,.99973,.99927,1.00082,.99902,1.00026,1.00087,1.0006,1.00069,.99973,.99867,.99973,.9993,1.00026,1.00049,1.00056,1,.99988,.99935,.99995,.99954,1.00055,.99945,1.00032,1.0006,.99995,1.00026,.99995,1.00032,1.00001,1.00008,.99971,1.00019,.9994,1.00001,1.0006,1.00044,.99973,1.00023,1.00047,1,.99942,.99561,.99989,1.00035,.99977,1.00035,.99977,1.00019,.99944,1.00001,1.00021,.99926,1.00035,1.00035,.99942,1.00048,.99999,.99977,1.00022,1.00035,1.00001,.99977,1.00026,.99989,1.00057,1.00001,.99936,1.00052,1.00012,.99996,1.00043,1,1.00035,.9994,.99976,1.00035,.99973,1.00052,1.00041,1.00119,1.00037,.99973,1.00002,.99986,1.00041,1.00041,.99902,.9996,1.00034,.99999,1.00026,.99999,1.00026,.99973,1.00052,.99973,1,.99973,1.00041,1.00075,.9994,1.0003,.99999,1,1.00041,.99955,1,.99915,.99973,.99973,1.00026,1.00119,.99955,.99973,1.0006,.99911,1.0006,1.00026,.99972,1.00026,.99902,1.00041,.99973,.99999,1,1,1.00038,1.0005,1.00016,1.00022,1.00016,1.00022,1.00016,1.00022,1.00001,.99973,1,1,.99973,1,1,.99955,1.0006,1.0006,1.0006,1.0006,1,1,1,.99973,.99973,.99972,1,1,1.00106,.99999,.99998,.99998,.99999,.99998,1.66475,1,.99973,.99973,1.00023,.99973,.99971,1.00047,1.00023,1,.99991,.99984,1.00002,1.00002,1.00002,1.00002,1,1,1,1,1,1,1,.99972,1,1.20985,1.39713,1.00003,1.00031,1.00015,1,.99561,1.00027,1.00031,1.00031,.99915,1.00031,1.00031,.99999,1.00003,.99999,.99999,1.41144,1.6,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.40579,1.40579,1.36625,.99999,1,.99861,.99861,1,1.00026,1.00026,1.00026,1.00026,.99972,.99999,.99999,.99999,.99999,1.40483,1,.99977,1.00054,1,1,.99953,.99962,1.00042,.9995,1,1,1,1,1,1,1,1,.99998,.99998,.99998,.99998,1,1,1,1,1,1,1,1,1,1,1],Dl={lineHeight:1.2,lineGap:.2},Ol=[.76116,1,1,1.0006,.99998,.99974,.99973,.99973,.99982,.99977,1.00087,.99998,.99998,.99959,1.00003,1.0006,.99998,1.0006,1.0006,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99998,1,1.00003,1.00003,1.00003,1.00026,.9999,.99977,.99977,.99977,.99977,1.00001,1.00026,1.00022,.99977,1.0006,.99973,.99977,1.00026,.99999,.99977,1.00022,1.00001,1.00022,.99977,1.00001,1.00026,.99977,1.00001,1.00016,1.00001,1.00001,1.00026,.99998,1.0006,.99998,1.00003,.99973,.99998,.99973,1.00026,.99973,1.00026,.99973,.99998,1.00026,1.00026,1.0006,1.0006,.99973,1.0006,.99982,1.00026,1.00026,1.00026,1.00026,.99959,.99973,.99998,1.00026,.99973,1.00022,.99973,.99973,1,.99959,1.00077,.99959,1.00003,.99998,.99973,.99973,.99973,.99973,1.00077,.99973,.99998,1.00025,.99968,.99973,1.00003,1.00025,.60299,1.00024,1.06409,1,1,.99998,1,.99973,1.0006,.99998,1,.99936,.99973,1.00002,1.00002,1.00002,1.00026,.99977,.99977,.99977,.99977,.99977,.99977,1,.99977,1.00001,1.00001,1.00001,1.00001,1.0006,1.0006,1.0006,1.0006,.99977,.99977,1.00022,1.00022,1.00022,1.00022,1.00022,1.00003,1.00022,.99977,.99977,.99977,.99977,1.00001,1.00001,1.00026,.99973,.99973,.99973,.99973,.99973,.99973,.99982,.99973,.99973,.99973,.99973,.99973,1.0006,1.0006,1.0006,1.0006,1.00026,1.00026,1.00026,1.00026,1.00026,1.00026,1.00026,1.06409,1.00026,1.00026,1.00026,1.00026,1.00026,.99973,1.00026,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,1.0044,.99977,1.00026,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00022,1.00026,1.00022,1.00026,1.00022,1.00026,1.00022,1.00026,.99977,1.00026,.99977,1.00026,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,.99971,.99973,.99973,1.0006,.99977,.99973,.99973,1.00026,1.0006,1.00026,1.0006,1.00026,1.01011,1.00026,.99999,1.00026,1.0006,.99977,1.00026,.99977,1.00026,.99977,1.00026,.9993,.9998,1.00026,1.00022,1.00026,1.00022,1.00026,1.00022,1.00026,1,1.00016,.99977,.99959,.99977,.99959,.99977,.99959,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00026,.99998,1.00026,.8121,1.00026,.99998,.99977,1.00026,.99977,1.00026,.99977,1.00026,.99977,1.00026,.99977,1.00026,.99977,1.00026,1.00016,1.00022,1.00001,.99973,1.00001,1.00026,1,1.00026,1,1.00026,1,1.0006,.99973,.99977,.99973,1,.99982,1.00022,1.00026,1.00001,.99973,1.00026,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99977,1,1,1.00026,.99969,.99972,.99981,.9998,1.0006,.99977,.99977,1.00022,.91155,1.00001,1.00026,.99977,1.00022,1.0006,.99977,1.00001,.99999,.99977,.99966,1.00022,1.00032,1.00001,.99944,1.00026,1.00001,.99968,1.00001,1.00047,1,1.0006,1.00001,.99981,1.00101,1.00026,1.0006,.99948,.99981,1.00064,.99973,.99942,1.00101,1.00061,1.00026,1.00069,1.0006,1.00014,.99973,1.01322,.99973,1.00065,1.00026,1.00012,.99923,1,1.00064,1.00076,.99948,1.00055,1.00063,1.00007,.99943,1.0006,.99948,1.00026,.99948,.99943,1.00001,1.00001,1.00029,1.00038,1.00035,1.00001,1.0006,1.0006,.99973,.99978,1.00001,1.00057,.99989,.99967,.99964,.99967,.99977,.99999,.99977,1.00038,.99977,1.00001,.99973,1.00066,.99967,.99967,1.00041,.99998,.99999,.99977,1.00022,.99967,1.00001,.99977,1.00026,.99964,1.00031,1.00001,.99999,.99999,1,1.00023,1,1,.99999,1.00035,1.00001,.99999,.99973,.99977,.99999,1.00058,.99973,.99973,.99955,.9995,1.00026,1.00026,1.00032,.99989,1.00034,.99999,1.00026,1.00026,1.00026,.99973,.45998,.99973,1.00026,.99973,1.00001,.99999,.99982,.99994,.99996,1,1.00042,1.00044,1.00029,1.00023,.99973,.99973,1.00026,.99949,1.00002,.99973,1.0006,1.0006,1.0006,.99975,1.00026,1.00026,1.00032,.98685,.99973,1.00026,1,1,.99966,1.00044,1.00016,1.00022,1.00016,1.00022,1.00016,1.00022,1.00001,.99973,1,1,.99973,1,1,.99955,1.0006,1.0006,1.0006,1.0006,1,1,1,.99973,.99973,.99972,1,1,1.00106,.99999,.99998,.99998,.99999,.99998,1.66475,1,.99973,.99973,1,.99973,.99971,.99978,1,1,.99991,.99984,1.00002,1.00002,1.00002,1.00002,1.00098,1,1,1,1.00049,1,1,.99972,1,1.20985,1.39713,1.00003,1.00031,1.00015,1,.99561,1.00027,1.00031,1.00031,.99915,1.00031,1.00031,.99999,1.00003,.99999,.99999,1.41144,1.6,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.40579,1.40579,1.36625,.99999,1,.99861,.99861,1,1.00026,1.00026,1.00026,1.00026,.99972,.99999,.99999,.99999,.99999,1.40483,1,.99977,1.00054,1,1,.99953,.99962,1.00042,.9995,1,1,1,1,1,1,1,1,.99998,.99998,.99998,.99998,1,1,1,1,1,1,1,1,1,1,1],kl={lineHeight:1.35,lineGap:.2},Al=[.76116,1,1,1.0006,1.0006,1.00006,.99973,.99973,.99982,1.00001,1.00043,.99998,.99998,.99959,1.00003,1.0006,.99998,1.0006,1.0006,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,1.0006,1,1.00003,1.00003,1.00003,.99973,.99987,1.00001,1.00001,.99977,.99977,1.00001,1.00026,1.00022,.99977,1.0006,1,1.00001,.99973,.99999,.99977,1.00022,1.00001,1.00022,.99977,1.00001,1.00026,.99977,1.00001,1.00016,1.00001,1.00001,1.00026,1.0006,1.0006,1.0006,.99949,.99973,.99998,.99973,.99973,1,.99973,.99973,1.0006,.99973,.99973,.99924,.99924,1,.99924,.99999,.99973,.99973,.99973,.99973,.99998,1,1.0006,.99973,1,.99977,1,1,1,1.00005,1.0009,1.00005,1.00003,.99998,.99973,.99973,.99973,.99973,1.0009,.99973,.99998,1.00025,.99968,.99973,1.00003,1.00025,.60299,1.00024,1.06409,1,1,.99998,1,.9998,1.0006,.99998,1,.99936,.99973,1.00002,1.00002,1.00002,1.00026,1.00001,1.00001,1.00001,1.00001,1.00001,1.00001,1,.99977,1.00001,1.00001,1.00001,1.00001,1.0006,1.0006,1.0006,1.0006,.99977,.99977,1.00022,1.00022,1.00022,1.00022,1.00022,1.00003,1.00022,.99977,.99977,.99977,.99977,1.00001,1.00001,1.00026,.99973,.99973,.99973,.99973,.99973,.99973,.99982,1,.99973,.99973,.99973,.99973,1.0006,1.0006,1.0006,1.0006,.99973,.99973,.99973,.99973,.99973,.99973,.99973,1.06409,1.00026,.99973,.99973,.99973,.99973,1,.99973,1,1.00001,.99973,1.00001,.99973,1.00001,.99973,.99977,1,.99977,1,.99977,1,.99977,1,.99977,1.0288,.99977,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00022,.99973,1.00022,.99973,1.00022,.99973,1.00022,.99973,.99977,.99973,.99977,.99973,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,.99924,1.0006,1.0006,.99946,1.00034,1,.99924,1.00001,1,1,.99973,.99924,.99973,.99924,.99973,1.06311,.99973,1.00024,.99973,.99924,.99977,.99973,.99977,.99973,.99977,.99973,1.00041,.9998,.99973,1.00022,.99973,1.00022,.99973,1.00022,.99973,1,1.00016,.99977,.99998,.99977,.99998,.99977,.99998,1.00001,1,1.00001,1,1.00001,1,1.00001,1,1.00026,1.0006,1.00026,.89547,1.00026,1.0006,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,1.00016,.99977,1.00001,1,1.00001,1.00026,1,1.00026,1,1.00026,1,.99924,.99973,1.00001,.99973,1,.99982,1.00022,1.00026,1.00001,1,1.00026,1.0006,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,1.00001,1,1.00054,.99977,1.00084,1.00007,.99973,1.00013,.99924,1.00001,1.00001,.99945,.91221,1.00001,1.00026,.99977,1.00022,1.0006,1.00001,1.00001,.99999,.99977,.99933,1.00022,1.00054,1.00001,1.00065,1.00026,1.00001,1.0001,1.00001,1.00052,1,1.0006,1.00001,.99945,.99897,.99968,.99924,1.00036,.99945,.99949,1,1.0006,.99897,.99918,.99968,.99911,.99924,1,.99962,1.01487,1,1.0005,.99973,1.00012,1.00043,1,.99995,.99994,1.00036,.99947,1.00019,1.00063,1.00025,.99924,1.00036,.99973,1.00036,1.00025,1.00001,1.00001,1.00027,1.0001,1.00068,1.00001,1.0006,1.0006,1,1.00008,.99957,.99972,.9994,.99954,.99975,1.00051,1.00001,1.00019,1.00001,1.0001,.99986,1.00001,1.00001,1.00038,.99954,.99954,.9994,1.00066,.99999,.99977,1.00022,1.00054,1.00001,.99977,1.00026,.99975,1.0001,1.00001,.99993,.9995,.99955,1.00016,.99978,.99974,1.00019,1.00022,.99955,1.00053,.99973,1.00089,1.00005,.99967,1.00048,.99973,1.00002,1.00034,.99973,.99973,.99964,1.00006,1.00066,.99947,.99973,.98894,.99973,1,.44898,1,.99946,1,1.00039,1.00082,.99991,.99991,.99985,1.00022,1.00023,1.00061,1.00006,.99966,.99973,.99973,.99973,1.00019,1.0008,1,.99924,.99924,.99924,.99983,1.00044,.99973,.99964,.98332,1,.99973,1,1,.99962,.99895,1.00016,.99977,1.00016,.99977,1.00016,.99977,1.00001,1,1,1,.99973,1,1,.99955,.99924,.99924,.99924,.99924,.99998,.99998,.99998,.99973,.99973,.99972,1,1,1.00267,.99999,.99998,.99998,1,.99998,1.66475,1,.99973,.99973,1.00023,.99973,1.00423,.99925,.99999,1,.99991,.99984,1.00002,1.00002,1.00002,1.00002,1.00049,1,1.00245,1,1,1,1,.96329,1,1.20985,1.39713,1.00003,.8254,1.00015,1,1.00035,1.00027,1.00031,1.00031,1.00003,1.00031,1.00031,.99999,1.00003,.99999,.99999,1.41144,1.6,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.40579,1.40579,1.36625,.99999,1,.99861,.99861,1,1.00026,1.00026,1.00026,1.00026,.95317,.99999,.99999,.99999,.99999,1.40483,1,.99977,1.00054,1,1,.99953,.99962,1.00042,.9995,1,1,1,1,1,1,1,1,.99998,.99998,.99998,.99998,1,1,1,1,1,1,1,1,1,1,1],jl={lineHeight:1.35,lineGap:.2},Ml=[.76116,1,1,1.0006,1.0006,1.00006,.99973,.99973,.99982,1.00001,1.00043,.99998,.99998,.99959,1.00003,1.0006,.99998,1.0006,1.0006,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,1.0006,1,1.00003,1.00003,1.00003,.99973,.99987,1.00001,1.00001,.99977,.99977,1.00001,1.00026,1.00022,.99977,1.0006,1,1.00001,.99973,.99999,.99977,1.00022,1.00001,1.00022,.99977,1.00001,1.00026,.99977,1.00001,1.00016,1.00001,1.00001,1.00026,1.0006,1.0006,1.0006,.99949,.99973,.99998,.99973,.99973,1,.99973,.99973,1.0006,.99973,.99973,.99924,.99924,1,.99924,.99999,.99973,.99973,.99973,.99973,.99998,1,1.0006,.99973,1,.99977,1,1,1,1.00005,1.0009,1.00005,1.00003,.99998,.99973,.99973,.99973,.99973,1.0009,.99973,.99998,1.00025,.99968,.99973,1.00003,1.00025,.60299,1.00024,1.06409,1,1,.99998,1,.9998,1.0006,.99998,1,.99936,.99973,1.00002,1.00002,1.00002,1.00026,1.00001,1.00001,1.00001,1.00001,1.00001,1.00001,1,.99977,1.00001,1.00001,1.00001,1.00001,1.0006,1.0006,1.0006,1.0006,.99977,.99977,1.00022,1.00022,1.00022,1.00022,1.00022,1.00003,1.00022,.99977,.99977,.99977,.99977,1.00001,1.00001,1.00026,.99973,.99973,.99973,.99973,.99973,.99973,.99982,1,.99973,.99973,.99973,.99973,1.0006,1.0006,1.0006,1.0006,.99973,.99973,.99973,.99973,.99973,.99973,.99973,1.06409,1.00026,.99973,.99973,.99973,.99973,1,.99973,1,1.00001,.99973,1.00001,.99973,1.00001,.99973,.99977,1,.99977,1,.99977,1,.99977,1,.99977,1.04596,.99977,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00022,.99973,1.00022,.99973,1.00022,.99973,1.00022,.99973,.99977,.99973,.99977,.99973,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,.99924,1.0006,1.0006,1.00019,1.00034,1,.99924,1.00001,1,1,.99973,.99924,.99973,.99924,.99973,1.02572,.99973,1.00005,.99973,.99924,.99977,.99973,.99977,.99973,.99977,.99973,.99999,.9998,.99973,1.00022,.99973,1.00022,.99973,1.00022,.99973,1,1.00016,.99977,.99998,.99977,.99998,.99977,.99998,1.00001,1,1.00001,1,1.00001,1,1.00001,1,1.00026,1.0006,1.00026,.84533,1.00026,1.0006,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,1.00016,.99977,1.00001,1,1.00001,1.00026,1,1.00026,1,1.00026,1,.99924,.99973,1.00001,.99973,1,.99982,1.00022,1.00026,1.00001,1,1.00026,1.0006,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99928,1,.99977,1.00013,1.00055,.99947,.99945,.99941,.99924,1.00001,1.00001,1.0004,.91621,1.00001,1.00026,.99977,1.00022,1.0006,1.00001,1.00005,.99999,.99977,1.00015,1.00022,.99977,1.00001,.99973,1.00026,1.00001,1.00019,1.00001,.99946,1,1.0006,1.00001,.99978,1.00045,.99973,.99924,1.00023,.99978,.99966,1,1.00065,1.00045,1.00019,.99973,.99973,.99924,1,1,.96499,1,1.00055,.99973,1.00008,1.00027,1,.9997,.99995,1.00023,.99933,1.00019,1.00015,1.00031,.99924,1.00023,.99973,1.00023,1.00031,1.00001,.99928,1.00029,1.00092,1.00035,1.00001,1.0006,1.0006,1,.99988,.99975,1,1.00082,.99561,.9996,1.00035,1.00001,.99962,1.00001,1.00092,.99964,1.00001,.99963,.99999,1.00035,1.00035,1.00082,.99962,.99999,.99977,1.00022,1.00035,1.00001,.99977,1.00026,.9996,.99967,1.00001,1.00034,1.00074,1.00054,1.00053,1.00063,.99971,.99962,1.00035,.99975,.99977,.99973,1.00043,.99953,1.0007,.99915,.99973,1.00008,.99892,1.00073,1.00073,1.00114,.99915,1.00073,.99955,.99973,1.00092,.99973,1,.99998,1,1.0003,1,1.00043,1.00001,.99969,1.0003,1,1.00035,1.00001,.9995,1,1.00092,.99973,.99973,.99973,1.0007,.9995,1,.99924,1.0006,.99924,.99972,1.00062,.99973,1.00114,1.00073,1,.99955,1,1,1.00047,.99968,1.00016,.99977,1.00016,.99977,1.00016,.99977,1.00001,1,1,1,.99973,1,1,.99955,.99924,.99924,.99924,.99924,.99998,.99998,.99998,.99973,.99973,.99972,1,1,1.00267,.99999,.99998,.99998,1,.99998,1.66475,1,.99973,.99973,1.00023,.99973,.99971,.99925,1.00023,1,.99991,.99984,1.00002,1.00002,1.00002,1.00002,1,1,1,1,1,1,1,.96329,1,1.20985,1.39713,1.00003,.8254,1.00015,1,1.00035,1.00027,1.00031,1.00031,.99915,1.00031,1.00031,.99999,1.00003,.99999,.99999,1.41144,1.6,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.40579,1.40579,1.36625,.99999,1,.99861,.99861,1,1.00026,1.00026,1.00026,1.00026,.95317,.99999,.99999,.99999,.99999,1.40483,1,.99977,1.00054,1,1,.99953,.99962,1.00042,.9995,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],Nl={lineHeight:1.2,lineGap:.2},Pl=[365,0,333,278,333,474,556,556,889,722,238,333,333,389,584,278,333,278,278,556,556,556,556,556,556,556,556,556,556,333,333,584,584,584,611,975,722,722,722,722,667,611,778,722,278,556,722,611,833,722,778,667,778,722,667,611,722,667,944,667,667,611,333,278,333,584,556,333,556,611,556,611,556,333,611,611,278,278,556,278,889,611,611,611,611,389,556,333,611,556,778,556,556,500,389,280,389,584,333,556,556,556,556,280,556,333,737,370,556,584,737,552,400,549,333,333,333,576,556,278,333,333,365,556,834,834,834,611,722,722,722,722,722,722,1e3,722,667,667,667,667,278,278,278,278,722,722,778,778,778,778,778,584,778,722,722,722,722,667,667,611,556,556,556,556,556,556,889,556,556,556,556,556,278,278,278,278,611,611,611,611,611,611,611,549,611,611,611,611,611,556,611,556,722,556,722,556,722,556,722,556,722,556,722,556,722,556,722,719,722,611,667,556,667,556,667,556,667,556,667,556,778,611,778,611,778,611,778,611,722,611,722,611,278,278,278,278,278,278,278,278,278,278,785,556,556,278,722,556,556,611,278,611,278,611,385,611,479,611,278,722,611,722,611,722,611,708,723,611,778,611,778,611,778,611,1e3,944,722,389,722,389,722,389,667,556,667,556,667,556,667,556,611,333,611,479,611,333,722,611,722,611,722,611,722,611,722,611,722,611,944,778,667,556,667,611,500,611,500,611,500,278,556,722,556,1e3,889,778,611,667,556,611,333,333,333,333,333,333,333,333,333,333,333,465,722,333,853,906,474,825,927,838,278,722,722,601,719,667,611,722,778,278,722,667,833,722,644,778,722,667,600,611,667,821,667,809,802,278,667,615,451,611,278,582,615,610,556,606,475,460,611,541,278,558,556,612,556,445,611,766,619,520,684,446,582,715,576,753,845,278,582,611,582,845,667,669,885,567,711,667,278,276,556,1094,1062,875,610,722,622,719,722,719,722,567,712,667,904,626,719,719,610,702,833,722,778,719,667,722,611,622,854,667,730,703,1005,1019,870,979,719,711,1031,719,556,618,615,417,635,556,709,497,615,615,500,635,740,604,611,604,611,556,490,556,875,556,615,581,833,844,729,854,615,552,854,583,556,556,611,417,552,556,278,281,278,969,906,611,500,615,556,604,778,611,487,447,944,778,944,778,944,778,667,556,333,333,556,1e3,1e3,552,278,278,278,278,500,500,500,556,556,350,1e3,1e3,240,479,333,333,604,333,167,396,556,556,1094,556,885,489,1115,1e3,768,600,834,834,834,834,1e3,500,1e3,500,1e3,500,500,494,612,823,713,584,549,713,979,722,274,549,549,583,549,549,604,584,604,604,708,625,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,729,604,604,354,354,1e3,990,990,990,990,494,604,604,604,604,354,1021,1052,917,750,750,531,656,594,510,500,750,750,611,611,333,333,333,333,333,333,333,333,222,222,333,333,333,333,333,333,333,333],Fl=[-1,-1,-1,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,161,162,163,164,165,166,167,168,169,170,171,172,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,402,506,507,508,509,510,511,536,537,538,539,710,711,713,728,729,730,731,732,733,900,901,902,903,904,905,906,908,910,911,912,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,931,932,933,934,935,936,937,938,939,940,941,942,943,944,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,962,963,964,965,966,967,968,969,970,971,972,973,974,1024,1025,1026,1027,1028,1029,1030,1031,1032,1033,1034,1035,1036,1037,1038,1039,1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,1104,1105,1106,1107,1108,1109,1110,1111,1112,1113,1114,1115,1116,1117,1118,1119,1138,1139,1168,1169,7808,7809,7810,7811,7812,7813,7922,7923,8208,8209,8211,8212,8213,8215,8216,8217,8218,8219,8220,8221,8222,8224,8225,8226,8230,8240,8242,8243,8249,8250,8252,8254,8260,8319,8355,8356,8359,8364,8453,8467,8470,8482,8486,8494,8539,8540,8541,8542,8592,8593,8594,8595,8596,8597,8616,8706,8710,8719,8721,8722,8730,8734,8735,8745,8747,8776,8800,8801,8804,8805,8962,8976,8992,8993,9472,9474,9484,9488,9492,9496,9500,9508,9516,9524,9532,9552,9553,9554,9555,9556,9557,9558,9559,9560,9561,9562,9563,9564,9565,9566,9567,9568,9569,9570,9571,9572,9573,9574,9575,9576,9577,9578,9579,9580,9600,9604,9608,9612,9616,9617,9618,9619,9632,9633,9642,9643,9644,9650,9658,9660,9668,9674,9675,9679,9688,9689,9702,9786,9787,9788,9792,9794,9824,9827,9829,9830,9834,9835,9836,61441,61442,61445,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],Il=[365,0,333,278,333,474,556,556,889,722,238,333,333,389,584,278,333,278,278,556,556,556,556,556,556,556,556,556,556,333,333,584,584,584,611,975,722,722,722,722,667,611,778,722,278,556,722,611,833,722,778,667,778,722,667,611,722,667,944,667,667,611,333,278,333,584,556,333,556,611,556,611,556,333,611,611,278,278,556,278,889,611,611,611,611,389,556,333,611,556,778,556,556,500,389,280,389,584,333,556,556,556,556,280,556,333,737,370,556,584,737,552,400,549,333,333,333,576,556,278,333,333,365,556,834,834,834,611,722,722,722,722,722,722,1e3,722,667,667,667,667,278,278,278,278,722,722,778,778,778,778,778,584,778,722,722,722,722,667,667,611,556,556,556,556,556,556,889,556,556,556,556,556,278,278,278,278,611,611,611,611,611,611,611,549,611,611,611,611,611,556,611,556,722,556,722,556,722,556,722,556,722,556,722,556,722,556,722,740,722,611,667,556,667,556,667,556,667,556,667,556,778,611,778,611,778,611,778,611,722,611,722,611,278,278,278,278,278,278,278,278,278,278,782,556,556,278,722,556,556,611,278,611,278,611,396,611,479,611,278,722,611,722,611,722,611,708,723,611,778,611,778,611,778,611,1e3,944,722,389,722,389,722,389,667,556,667,556,667,556,667,556,611,333,611,479,611,333,722,611,722,611,722,611,722,611,722,611,722,611,944,778,667,556,667,611,500,611,500,611,500,278,556,722,556,1e3,889,778,611,667,556,611,333,333,333,333,333,333,333,333,333,333,333,333,722,333,854,906,473,844,930,847,278,722,722,610,671,667,611,722,778,278,722,667,833,722,657,778,718,667,590,611,667,822,667,829,781,278,667,620,479,611,278,591,620,621,556,610,479,492,611,558,278,566,556,603,556,450,611,712,605,532,664,409,591,704,578,773,834,278,591,611,591,834,667,667,886,614,719,667,278,278,556,1094,1042,854,622,719,677,719,722,708,722,614,722,667,927,643,719,719,615,687,833,722,778,719,667,722,611,677,781,667,729,708,979,989,854,1e3,708,719,1042,729,556,619,604,534,618,556,736,510,611,611,507,622,740,604,611,611,611,556,889,556,885,556,646,583,889,935,707,854,594,552,865,589,556,556,611,469,563,556,278,278,278,969,906,611,507,619,556,611,778,611,575,467,944,778,944,778,944,778,667,556,333,333,556,1e3,1e3,552,278,278,278,278,500,500,500,556,556,350,1e3,1e3,240,479,333,333,604,333,167,396,556,556,1104,556,885,516,1146,1e3,768,600,834,834,834,834,999,500,1e3,500,1e3,500,500,494,612,823,713,584,549,713,979,722,274,549,549,583,549,549,604,584,604,604,708,625,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,729,604,604,354,354,1e3,990,990,990,990,494,604,604,604,604,354,1021,1052,917,750,750,531,656,594,510,500,750,750,611,611,333,333,333,333,333,333,333,333,222,222,333,333,333,333,333,333,333,333],Ll=[-1,-1,-1,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,161,162,163,164,165,166,167,168,169,170,171,172,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,402,506,507,508,509,510,511,536,537,538,539,710,711,713,728,729,730,731,732,733,900,901,902,903,904,905,906,908,910,911,912,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,931,932,933,934,935,936,937,938,939,940,941,942,943,944,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,962,963,964,965,966,967,968,969,970,971,972,973,974,1024,1025,1026,1027,1028,1029,1030,1031,1032,1033,1034,1035,1036,1037,1038,1039,1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,1104,1105,1106,1107,1108,1109,1110,1111,1112,1113,1114,1115,1116,1117,1118,1119,1138,1139,1168,1169,7808,7809,7810,7811,7812,7813,7922,7923,8208,8209,8211,8212,8213,8215,8216,8217,8218,8219,8220,8221,8222,8224,8225,8226,8230,8240,8242,8243,8249,8250,8252,8254,8260,8319,8355,8356,8359,8364,8453,8467,8470,8482,8486,8494,8539,8540,8541,8542,8592,8593,8594,8595,8596,8597,8616,8706,8710,8719,8721,8722,8730,8734,8735,8745,8747,8776,8800,8801,8804,8805,8962,8976,8992,8993,9472,9474,9484,9488,9492,9496,9500,9508,9516,9524,9532,9552,9553,9554,9555,9556,9557,9558,9559,9560,9561,9562,9563,9564,9565,9566,9567,9568,9569,9570,9571,9572,9573,9574,9575,9576,9577,9578,9579,9580,9600,9604,9608,9612,9616,9617,9618,9619,9632,9633,9642,9643,9644,9650,9658,9660,9668,9674,9675,9679,9688,9689,9702,9786,9787,9788,9792,9794,9824,9827,9829,9830,9834,9835,9836,61441,61442,61445,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],Rl=[365,0,333,278,278,355,556,556,889,667,191,333,333,389,584,278,333,278,278,556,556,556,556,556,556,556,556,556,556,278,278,584,584,584,556,1015,667,667,722,722,667,611,778,722,278,500,667,556,833,722,778,667,778,722,667,611,722,667,944,667,667,611,278,278,278,469,556,333,556,556,500,556,556,278,556,556,222,222,500,222,833,556,556,556,556,333,500,278,556,500,722,500,500,500,334,260,334,584,333,556,556,556,556,260,556,333,737,370,556,584,737,552,400,549,333,333,333,576,537,278,333,333,365,556,834,834,834,611,667,667,667,667,667,667,1e3,722,667,667,667,667,278,278,278,278,722,722,778,778,778,778,778,584,778,722,722,722,722,667,667,611,556,556,556,556,556,556,889,500,556,556,556,556,278,278,278,278,556,556,556,556,556,556,556,549,611,556,556,556,556,500,556,500,667,556,667,556,667,556,722,500,722,500,722,500,722,500,722,625,722,556,667,556,667,556,667,556,667,556,667,556,778,556,778,556,778,556,778,556,722,556,722,556,278,278,278,278,278,278,278,222,278,278,733,444,500,222,667,500,500,556,222,556,222,556,281,556,400,556,222,722,556,722,556,722,556,615,723,556,778,556,778,556,778,556,1e3,944,722,333,722,333,722,333,667,500,667,500,667,500,667,500,611,278,611,354,611,278,722,556,722,556,722,556,722,556,722,556,722,556,944,722,667,500,667,611,500,611,500,611,500,222,556,667,556,1e3,889,778,611,667,500,611,278,333,333,333,333,333,333,333,333,333,333,333,667,278,789,846,389,794,865,775,222,667,667,570,671,667,611,722,778,278,667,667,833,722,648,778,725,667,600,611,667,837,667,831,761,278,667,570,439,555,222,550,570,571,500,556,439,463,555,542,222,500,492,548,500,447,556,670,573,486,603,374,550,652,546,728,779,222,550,556,550,779,667,667,843,544,708,667,278,278,500,1066,982,844,589,715,639,724,667,651,667,544,704,667,917,614,715,715,589,686,833,722,778,725,667,722,611,639,795,667,727,673,920,923,805,886,651,694,1022,682,556,562,522,493,553,556,688,465,556,556,472,564,686,550,556,556,556,500,833,500,835,500,572,518,830,851,621,736,526,492,752,534,556,556,556,378,496,500,222,222,222,910,828,556,472,565,500,556,778,556,492,339,944,722,944,722,944,722,667,500,333,333,556,1e3,1e3,552,222,222,222,222,333,333,333,556,556,350,1e3,1e3,188,354,333,333,500,333,167,365,556,556,1094,556,885,323,1083,1e3,768,600,834,834,834,834,1e3,500,998,500,1e3,500,500,494,612,823,713,584,549,713,979,719,274,549,549,584,549,549,604,584,604,604,708,625,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,729,604,604,354,354,1e3,990,990,990,990,494,604,604,604,604,354,1021,1052,917,750,750,531,656,594,510,500,750,750,500,500,333,333,333,333,333,333,333,333,222,222,294,294,324,324,316,328,398,285],zl=[-1,-1,-1,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,161,162,163,164,165,166,167,168,169,170,171,172,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,402,506,507,508,509,510,511,536,537,538,539,710,711,713,728,729,730,731,732,733,900,901,902,903,904,905,906,908,910,911,912,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,931,932,933,934,935,936,937,938,939,940,941,942,943,944,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,962,963,964,965,966,967,968,969,970,971,972,973,974,1024,1025,1026,1027,1028,1029,1030,1031,1032,1033,1034,1035,1036,1037,1038,1039,1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,1104,1105,1106,1107,1108,1109,1110,1111,1112,1113,1114,1115,1116,1117,1118,1119,1138,1139,1168,1169,7808,7809,7810,7811,7812,7813,7922,7923,8208,8209,8211,8212,8213,8215,8216,8217,8218,8219,8220,8221,8222,8224,8225,8226,8230,8240,8242,8243,8249,8250,8252,8254,8260,8319,8355,8356,8359,8364,8453,8467,8470,8482,8486,8494,8539,8540,8541,8542,8592,8593,8594,8595,8596,8597,8616,8706,8710,8719,8721,8722,8730,8734,8735,8745,8747,8776,8800,8801,8804,8805,8962,8976,8992,8993,9472,9474,9484,9488,9492,9496,9500,9508,9516,9524,9532,9552,9553,9554,9555,9556,9557,9558,9559,9560,9561,9562,9563,9564,9565,9566,9567,9568,9569,9570,9571,9572,9573,9574,9575,9576,9577,9578,9579,9580,9600,9604,9608,9612,9616,9617,9618,9619,9632,9633,9642,9643,9644,9650,9658,9660,9668,9674,9675,9679,9688,9689,9702,9786,9787,9788,9792,9794,9824,9827,9829,9830,9834,9835,9836,61441,61442,61445,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],Bl=[365,0,333,278,278,355,556,556,889,667,191,333,333,389,584,278,333,278,278,556,556,556,556,556,556,556,556,556,556,278,278,584,584,584,556,1015,667,667,722,722,667,611,778,722,278,500,667,556,833,722,778,667,778,722,667,611,722,667,944,667,667,611,278,278,278,469,556,333,556,556,500,556,556,278,556,556,222,222,500,222,833,556,556,556,556,333,500,278,556,500,722,500,500,500,334,260,334,584,333,556,556,556,556,260,556,333,737,370,556,584,737,552,400,549,333,333,333,576,537,278,333,333,365,556,834,834,834,611,667,667,667,667,667,667,1e3,722,667,667,667,667,278,278,278,278,722,722,778,778,778,778,778,584,778,722,722,722,722,667,667,611,556,556,556,556,556,556,889,500,556,556,556,556,278,278,278,278,556,556,556,556,556,556,556,549,611,556,556,556,556,500,556,500,667,556,667,556,667,556,722,500,722,500,722,500,722,500,722,615,722,556,667,556,667,556,667,556,667,556,667,556,778,556,778,556,778,556,778,556,722,556,722,556,278,278,278,278,278,278,278,222,278,278,735,444,500,222,667,500,500,556,222,556,222,556,292,556,334,556,222,722,556,722,556,722,556,604,723,556,778,556,778,556,778,556,1e3,944,722,333,722,333,722,333,667,500,667,500,667,500,667,500,611,278,611,375,611,278,722,556,722,556,722,556,722,556,722,556,722,556,944,722,667,500,667,611,500,611,500,611,500,222,556,667,556,1e3,889,778,611,667,500,611,278,333,333,333,333,333,333,333,333,333,333,333,667,278,784,838,384,774,855,752,222,667,667,551,668,667,611,722,778,278,667,668,833,722,650,778,722,667,618,611,667,798,667,835,748,278,667,578,446,556,222,547,578,575,500,557,446,441,556,556,222,500,500,576,500,448,556,690,569,482,617,395,547,648,525,713,781,222,547,556,547,781,667,667,865,542,719,667,278,278,500,1057,1010,854,583,722,635,719,667,656,667,542,677,667,923,604,719,719,583,656,833,722,778,719,667,722,611,635,760,667,740,667,917,938,792,885,656,719,1010,722,556,573,531,365,583,556,669,458,559,559,438,583,688,552,556,542,556,500,458,500,823,500,573,521,802,823,625,719,521,510,750,542,556,556,556,365,510,500,222,278,222,906,812,556,438,559,500,552,778,556,489,411,944,722,944,722,944,722,667,500,333,333,556,1e3,1e3,552,222,222,222,222,333,333,333,556,556,350,1e3,1e3,188,354,333,333,500,333,167,365,556,556,1094,556,885,323,1073,1e3,768,600,834,834,834,834,1e3,500,1e3,500,1e3,500,500,494,612,823,713,584,549,713,979,719,274,549,549,583,549,549,604,584,604,604,708,625,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,729,604,604,354,354,1e3,990,990,990,990,494,604,604,604,604,354,1021,1052,917,750,750,531,656,594,510,500,750,750,500,500,333,333,333,333,333,333,333,333,222,222,294,294,324,324,316,328,398,285],Vl=[-1,-1,-1,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,161,162,163,164,165,166,167,168,169,170,171,172,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,402,506,507,508,509,510,511,536,537,538,539,710,711,713,728,729,730,731,732,733,900,901,902,903,904,905,906,908,910,911,912,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,931,932,933,934,935,936,937,938,939,940,941,942,943,944,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,962,963,964,965,966,967,968,969,970,971,972,973,974,1024,1025,1026,1027,1028,1029,1030,1031,1032,1033,1034,1035,1036,1037,1038,1039,1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,1104,1105,1106,1107,1108,1109,1110,1111,1112,1113,1114,1115,1116,1117,1118,1119,1138,1139,1168,1169,7808,7809,7810,7811,7812,7813,7922,7923,8208,8209,8211,8212,8213,8215,8216,8217,8218,8219,8220,8221,8222,8224,8225,8226,8230,8240,8242,8243,8249,8250,8252,8254,8260,8319,8355,8356,8359,8364,8453,8467,8470,8482,8486,8494,8539,8540,8541,8542,8592,8593,8594,8595,8596,8597,8616,8706,8710,8719,8721,8722,8730,8734,8735,8745,8747,8776,8800,8801,8804,8805,8962,8976,8992,8993,9472,9474,9484,9488,9492,9496,9500,9508,9516,9524,9532,9552,9553,9554,9555,9556,9557,9558,9559,9560,9561,9562,9563,9564,9565,9566,9567,9568,9569,9570,9571,9572,9573,9574,9575,9576,9577,9578,9579,9580,9600,9604,9608,9612,9616,9617,9618,9619,9632,9633,9642,9643,9644,9650,9658,9660,9668,9674,9675,9679,9688,9689,9702,9786,9787,9788,9792,9794,9824,9827,9829,9830,9834,9835,9836,61441,61442,61445,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],Hl=[1.36898,1,1,.72706,.80479,.83734,.98894,.99793,.9897,.93884,.86209,.94292,.94292,1.16661,1.02058,.93582,.96694,.93582,1.19137,.99793,.99793,.99793,.99793,.99793,.99793,.99793,.99793,.99793,.99793,.78076,.78076,1.02058,1.02058,1.02058,.72851,.78966,.90838,.83637,.82391,.96376,.80061,.86275,.8768,.95407,1.0258,.73901,.85022,.83655,1.0156,.95546,.92179,.87107,.92179,.82114,.8096,.89713,.94438,.95353,.94083,.91905,.90406,.9446,.94292,1.18777,.94292,1.02058,.89903,.90088,.94938,.97898,.81093,.97571,.94938,1.024,.9577,.95933,.98621,1.0474,.97455,.98981,.9672,.95933,.9446,.97898,.97407,.97646,.78036,1.10208,.95442,.95298,.97579,.9332,.94039,.938,.80687,1.01149,.80687,1.02058,.80479,.99793,.99793,.99793,.99793,1.01149,1.00872,.90088,.91882,1.0213,.8361,1.02058,.62295,.54324,.89022,1.08595,1,1,.90088,1,.97455,.93582,.90088,1,1.05686,.8361,.99642,.99642,.99642,.72851,.90838,.90838,.90838,.90838,.90838,.90838,.868,.82391,.80061,.80061,.80061,.80061,1.0258,1.0258,1.0258,1.0258,.97484,.95546,.92179,.92179,.92179,.92179,.92179,1.02058,.92179,.94438,.94438,.94438,.94438,.90406,.86958,.98225,.94938,.94938,.94938,.94938,.94938,.94938,.9031,.81093,.94938,.94938,.94938,.94938,.98621,.98621,.98621,.98621,.93969,.95933,.9446,.9446,.9446,.9446,.9446,1.08595,.9446,.95442,.95442,.95442,.95442,.94039,.97898,.94039,.90838,.94938,.90838,.94938,.90838,.94938,.82391,.81093,.82391,.81093,.82391,.81093,.82391,.81093,.96376,.84313,.97484,.97571,.80061,.94938,.80061,.94938,.80061,.94938,.80061,.94938,.80061,.94938,.8768,.9577,.8768,.9577,.8768,.9577,1,1,.95407,.95933,.97069,.95933,1.0258,.98621,1.0258,.98621,1.0258,.98621,1.0258,.98621,1.0258,.98621,.887,1.01591,.73901,1.0474,1,1,.97455,.83655,.98981,1,1,.83655,.73977,.83655,.73903,.84638,1.033,.95546,.95933,1,1,.95546,.95933,.8271,.95417,.95933,.92179,.9446,.92179,.9446,.92179,.9446,.936,.91964,.82114,.97646,1,1,.82114,.97646,.8096,.78036,.8096,.78036,1,1,.8096,.78036,1,1,.89713,.77452,.89713,1.10208,.94438,.95442,.94438,.95442,.94438,.95442,.94438,.95442,.94438,.95442,.94438,.95442,.94083,.97579,.90406,.94039,.90406,.9446,.938,.9446,.938,.9446,.938,1,.99793,.90838,.94938,.868,.9031,.92179,.9446,1,1,.89713,1.10208,.90088,.90088,.90088,.90088,.90088,.90088,.90088,.90088,.90088,.90989,.9358,.91945,.83181,.75261,.87992,.82976,.96034,.83689,.97268,1.0078,.90838,.83637,.8019,.90157,.80061,.9446,.95407,.92436,1.0258,.85022,.97153,1.0156,.95546,.89192,.92179,.92361,.87107,.96318,.89713,.93704,.95638,.91905,.91709,.92796,1.0258,.93704,.94836,1.0373,.95933,1.0078,.95871,.94836,.96174,.92601,.9498,.98607,.95776,.95933,1.05453,1.0078,.98275,.9314,.95617,.91701,1.05993,.9446,.78367,.9553,1,.86832,1.0128,.95871,.99394,.87548,.96361,.86774,1.0078,.95871,.9446,.95871,.86774,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.94083,.97579,.94083,.97579,.94083,.97579,.90406,.94039,.96694,1,.89903,1,1,1,.93582,.93582,.93582,1,.908,.908,.918,.94219,.94219,.96544,1,1.285,1,1,.81079,.81079,1,1,.74854,1,1,1,1,.99793,1,1,1,.65,1,1.36145,1,1,1,1,1,1,1,1,1,1,1,1.17173,1,.80535,.76169,1.02058,1.0732,1.05486,1,1,1.30692,1.08595,1.08595,1,1.08595,1.08595,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.16161,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],Ul={lineHeight:1.2,lineGap:.2},Wl=[1.36898,1,1,.66227,.80779,.81625,.97276,.97276,.97733,.92222,.83266,.94292,.94292,1.16148,1.02058,.93582,.96694,.93582,1.17337,.97276,.97276,.97276,.97276,.97276,.97276,.97276,.97276,.97276,.97276,.78076,.78076,1.02058,1.02058,1.02058,.71541,.76813,.85576,.80591,.80729,.94299,.77512,.83655,.86523,.92222,.98621,.71743,.81698,.79726,.98558,.92222,.90637,.83809,.90637,.80729,.76463,.86275,.90699,.91605,.9154,.85308,.85458,.90531,.94292,1.21296,.94292,1.02058,.89903,1.18616,.99613,.91677,.78216,.91677,.90083,.98796,.9135,.92168,.95381,.98981,.95298,.95381,.93459,.92168,.91513,.92004,.91677,.95077,.748,1.04502,.91677,.92061,.94236,.89544,.89364,.9,.80687,.8578,.80687,1.02058,.80779,.97276,.97276,.97276,.97276,.8578,.99973,1.18616,.91339,1.08074,.82891,1.02058,.55509,.71526,.89022,1.08595,1,1,1.18616,1,.96736,.93582,1.18616,1,1.04864,.82711,.99043,.99043,.99043,.71541,.85576,.85576,.85576,.85576,.85576,.85576,.845,.80729,.77512,.77512,.77512,.77512,.98621,.98621,.98621,.98621,.95961,.92222,.90637,.90637,.90637,.90637,.90637,1.02058,.90251,.90699,.90699,.90699,.90699,.85458,.83659,.94951,.99613,.99613,.99613,.99613,.99613,.99613,.85811,.78216,.90083,.90083,.90083,.90083,.95381,.95381,.95381,.95381,.9135,.92168,.91513,.91513,.91513,.91513,.91513,1.08595,.91677,.91677,.91677,.91677,.91677,.89364,.92332,.89364,.85576,.99613,.85576,.99613,.85576,.99613,.80729,.78216,.80729,.78216,.80729,.78216,.80729,.78216,.94299,.76783,.95961,.91677,.77512,.90083,.77512,.90083,.77512,.90083,.77512,.90083,.77512,.90083,.86523,.9135,.86523,.9135,.86523,.9135,1,1,.92222,.92168,.92222,.92168,.98621,.95381,.98621,.95381,.98621,.95381,.98621,.95381,.98621,.95381,.86036,.97096,.71743,.98981,1,1,.95298,.79726,.95381,1,1,.79726,.6894,.79726,.74321,.81691,1.0006,.92222,.92168,1,1,.92222,.92168,.79464,.92098,.92168,.90637,.91513,.90637,.91513,.90637,.91513,.909,.87514,.80729,.95077,1,1,.80729,.95077,.76463,.748,.76463,.748,1,1,.76463,.748,1,1,.86275,.72651,.86275,1.04502,.90699,.91677,.90699,.91677,.90699,.91677,.90699,.91677,.90699,.91677,.90699,.91677,.9154,.94236,.85458,.89364,.85458,.90531,.9,.90531,.9,.90531,.9,1,.97276,.85576,.99613,.845,.85811,.90251,.91677,1,1,.86275,1.04502,1.18616,1.18616,1.18616,1.18616,1.18616,1.18616,1.18616,1.18616,1.18616,1.00899,1.30628,.85576,.80178,.66862,.7927,.69323,.88127,.72459,.89711,.95381,.85576,.80591,.7805,.94729,.77512,.90531,.92222,.90637,.98621,.81698,.92655,.98558,.92222,.85359,.90637,.90976,.83809,.94523,.86275,.83509,.93157,.85308,.83392,.92346,.98621,.83509,.92886,.91324,.92168,.95381,.90646,.92886,.90557,.86847,.90276,.91324,.86842,.92168,.99531,.95381,.9224,.85408,.92699,.86847,1.0051,.91513,.80487,.93481,1,.88159,1.05214,.90646,.97355,.81539,.89398,.85923,.95381,.90646,.91513,.90646,.85923,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.9154,.94236,.9154,.94236,.9154,.94236,.85458,.89364,.96694,1,.89903,1,1,1,.91782,.91782,.91782,1,.896,.896,.896,.9332,.9332,.95973,1,1.26,1,1,.80479,.80178,1,1,.85633,1,1,1,1,.97276,1,1,1,.698,1,1.36145,1,1,1,1,1,1,1,1,1,1,1,1.14542,1,.79199,.78694,1.02058,1.03493,1.05486,1,1,1.23026,1.08595,1.08595,1,1.08595,1.08595,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.20006,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],Gl={lineHeight:1.2,lineGap:.2},Kl=[1.36898,1,1,.65507,.84943,.85639,.88465,.88465,.86936,.88307,.86948,.85283,.85283,1.06383,1.02058,.75945,.9219,.75945,1.17337,.88465,.88465,.88465,.88465,.88465,.88465,.88465,.88465,.88465,.88465,.75945,.75945,1.02058,1.02058,1.02058,.69046,.70926,.85158,.77812,.76852,.89591,.70466,.76125,.80094,.86822,.83864,.728,.77212,.79475,.93637,.87514,.8588,.76013,.8588,.72421,.69866,.77598,.85991,.80811,.87832,.78112,.77512,.8562,1.0222,1.18417,1.0222,1.27014,.89903,1.15012,.93859,.94399,.846,.94399,.81453,1.0186,.94219,.96017,1.03075,1.02175,.912,1.03075,.96998,.96017,.93859,.94399,.94399,.95493,.746,1.12658,.94578,.91,.979,.882,.882,.83,.85034,.83537,.85034,1.02058,.70869,.88465,.88465,.88465,.88465,.83537,.90083,1.15012,.9161,.94565,.73541,1.02058,.53609,.69353,.79519,1.08595,1,1,1.15012,1,.91974,.75945,1.15012,1,.9446,.73361,.9005,.9005,.9005,.62864,.85158,.85158,.85158,.85158,.85158,.85158,.773,.76852,.70466,.70466,.70466,.70466,.83864,.83864,.83864,.83864,.90561,.87514,.8588,.8588,.8588,.8588,.8588,1.02058,.85751,.85991,.85991,.85991,.85991,.77512,.76013,.88075,.93859,.93859,.93859,.93859,.93859,.93859,.8075,.846,.81453,.81453,.81453,.81453,.82424,.82424,.82424,.82424,.9278,.96017,.93859,.93859,.93859,.93859,.93859,1.08595,.8562,.94578,.94578,.94578,.94578,.882,.94578,.882,.85158,.93859,.85158,.93859,.85158,.93859,.76852,.846,.76852,.846,.76852,.846,.76852,.846,.89591,.8544,.90561,.94399,.70466,.81453,.70466,.81453,.70466,.81453,.70466,.81453,.70466,.81453,.80094,.94219,.80094,.94219,.80094,.94219,1,1,.86822,.96017,.86822,.96017,.83864,.82424,.83864,.82424,.83864,.82424,.83864,1.03075,.83864,.82424,.81402,1.02738,.728,1.02175,1,1,.912,.79475,1.03075,1,1,.79475,.83911,.79475,.66266,.80553,1.06676,.87514,.96017,1,1,.87514,.96017,.86865,.87396,.96017,.8588,.93859,.8588,.93859,.8588,.93859,.867,.84759,.72421,.95493,1,1,.72421,.95493,.69866,.746,.69866,.746,1,1,.69866,.746,1,1,.77598,.88417,.77598,1.12658,.85991,.94578,.85991,.94578,.85991,.94578,.85991,.94578,.85991,.94578,.85991,.94578,.87832,.979,.77512,.882,.77512,.8562,.83,.8562,.83,.8562,.83,1,.88465,.85158,.93859,.773,.8075,.85751,.8562,1,1,.77598,1.12658,1.15012,1.15012,1.15012,1.15012,1.15012,1.15313,1.15012,1.15012,1.15012,1.08106,1.03901,.85158,.77025,.62264,.7646,.65351,.86026,.69461,.89947,1.03075,.85158,.77812,.76449,.88836,.70466,.8562,.86822,.8588,.83864,.77212,.85308,.93637,.87514,.82352,.8588,.85701,.76013,.89058,.77598,.8156,.82565,.78112,.77899,.89386,.83864,.8156,.9486,.92388,.96186,1.03075,.91123,.9486,.93298,.878,.93942,.92388,.84596,.96186,.95119,1.03075,.922,.88787,.95829,.88,.93559,.93859,.78815,.93758,1,.89217,1.03737,.91123,.93969,.77487,.85769,.86799,1.03075,.91123,.93859,.91123,.86799,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.87832,.979,.87832,.979,.87832,.979,.77512,.882,.9219,1,.89903,1,1,1,.87321,.87321,.87321,1,1.027,1.027,1.027,.86847,.86847,.79121,1,1.124,1,1,.73572,.73572,1,1,.85034,1,1,1,1,.88465,1,1,1,.669,1,1.36145,1,1,1,1,1,1,1,1,1,1,1,1.04828,1,.74948,.75187,1.02058,.98391,1.02119,1,1,1.06233,1.08595,1.08595,1,1.08595,1.08595,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.05233,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],ql={lineHeight:1.2,lineGap:.2},Jl=[1.36898,1,1,.76305,.82784,.94935,.89364,.92241,.89073,.90706,.98472,.85283,.85283,1.0664,1.02058,.74505,.9219,.74505,1.23456,.92241,.92241,.92241,.92241,.92241,.92241,.92241,.92241,.92241,.92241,.74505,.74505,1.02058,1.02058,1.02058,.73002,.72601,.91755,.8126,.80314,.92222,.73764,.79726,.83051,.90284,.86023,.74,.8126,.84869,.96518,.91115,.8858,.79761,.8858,.74498,.73914,.81363,.89591,.83659,.89633,.85608,.8111,.90531,1.0222,1.22736,1.0222,1.27014,.89903,.90088,.86667,1.0231,.896,1.01411,.90083,1.05099,1.00512,.99793,1.05326,1.09377,.938,1.06226,1.00119,.99793,.98714,1.0231,1.01231,.98196,.792,1.19137,.99074,.962,1.01915,.926,.942,.856,.85034,.92006,.85034,1.02058,.69067,.92241,.92241,.92241,.92241,.92006,.9332,.90088,.91882,.93484,.75339,1.02058,.56866,.54324,.79519,1.08595,1,1,.90088,1,.95325,.74505,.90088,1,.97198,.75339,.91009,.91009,.91009,.66466,.91755,.91755,.91755,.91755,.91755,.91755,.788,.80314,.73764,.73764,.73764,.73764,.86023,.86023,.86023,.86023,.92915,.91115,.8858,.8858,.8858,.8858,.8858,1.02058,.8858,.89591,.89591,.89591,.89591,.8111,.79611,.89713,.86667,.86667,.86667,.86667,.86667,.86667,.86936,.896,.90083,.90083,.90083,.90083,.84224,.84224,.84224,.84224,.97276,.99793,.98714,.98714,.98714,.98714,.98714,1.08595,.89876,.99074,.99074,.99074,.99074,.942,1.0231,.942,.91755,.86667,.91755,.86667,.91755,.86667,.80314,.896,.80314,.896,.80314,.896,.80314,.896,.92222,.93372,.92915,1.01411,.73764,.90083,.73764,.90083,.73764,.90083,.73764,.90083,.73764,.90083,.83051,1.00512,.83051,1.00512,.83051,1.00512,1,1,.90284,.99793,.90976,.99793,.86023,.84224,.86023,.84224,.86023,.84224,.86023,1.05326,.86023,.84224,.82873,1.07469,.74,1.09377,1,1,.938,.84869,1.06226,1,1,.84869,.83704,.84869,.81441,.85588,1.08927,.91115,.99793,1,1,.91115,.99793,.91887,.90991,.99793,.8858,.98714,.8858,.98714,.8858,.98714,.894,.91434,.74498,.98196,1,1,.74498,.98196,.73914,.792,.73914,.792,1,1,.73914,.792,1,1,.81363,.904,.81363,1.19137,.89591,.99074,.89591,.99074,.89591,.99074,.89591,.99074,.89591,.99074,.89591,.99074,.89633,1.01915,.8111,.942,.8111,.90531,.856,.90531,.856,.90531,.856,1,.92241,.91755,.86667,.788,.86936,.8858,.89876,1,1,.81363,1.19137,.90088,.90088,.90088,.90088,.90088,.90088,.90088,.90088,.90088,.90388,1.03901,.92138,.78105,.7154,.86169,.80513,.94007,.82528,.98612,1.06226,.91755,.8126,.81884,.92819,.73764,.90531,.90284,.8858,.86023,.8126,.91172,.96518,.91115,.83089,.8858,.87791,.79761,.89297,.81363,.88157,.89992,.85608,.81992,.94307,.86023,.88157,.95308,.98699,.99793,1.06226,.95817,.95308,.97358,.928,.98088,.98699,.92761,.99793,.96017,1.06226,.986,.944,.95978,.938,.96705,.98714,.80442,.98972,1,.89762,1.04552,.95817,.99007,.87064,.91879,.88888,1.06226,.95817,.98714,.95817,.88888,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.89633,1.01915,.89633,1.01915,.89633,1.01915,.8111,.942,.9219,1,.89903,1,1,1,.93173,.93173,.93173,1,1.06304,1.06304,1.06904,.89903,.89903,.80549,1,1.156,1,1,.76575,.76575,1,1,.72458,1,1,1,1,.92241,1,1,1,.619,1,1.36145,1,1,1,1,1,1,1,1,1,1,1,1.07257,1,.74705,.71119,1.02058,1.024,1.02119,1,1,1.1536,1.08595,1.08595,1,1.08595,1.08595,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.05638,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],Yl={lineHeight:1.2,lineGap:.2},Xl=[1.76738,1,1,.99297,.9824,1.04016,1.06497,1.03424,.97529,1.17647,1.23203,1.1085,1.1085,1.16939,1.2107,.9754,1.21408,.9754,1.59578,1.03424,1.03424,1.03424,1.03424,1.03424,1.03424,1.03424,1.03424,1.03424,1.03424,.81378,.81378,1.2107,1.2107,1.2107,.71703,.97847,.97363,.88776,.8641,1.02096,.79795,.85132,.914,1.06085,1.1406,.8007,.89858,.83693,1.14889,1.09398,.97489,.92094,.97489,.90399,.84041,.95923,1.00135,1,1.06467,.98243,.90996,.99361,1.1085,1.56942,1.1085,1.2107,.74627,.94282,.96752,1.01519,.86304,1.01359,.97278,1.15103,1.01359,.98561,1.02285,1.02285,1.00527,1.02285,1.0302,.99041,1.0008,1.01519,1.01359,1.02258,.79104,1.16862,.99041,.97454,1.02511,.99298,.96752,.95801,.94856,1.16579,.94856,1.2107,.9824,1.03424,1.03424,1,1.03424,1.16579,.8727,1.3871,1.18622,1.10818,1.04478,1.2107,1.18622,.75155,.94994,1.28826,1.21408,1.21408,.91056,1,.91572,.9754,.64663,1.18328,1.24866,1.04478,1.14169,1.15749,1.17389,.71703,.97363,.97363,.97363,.97363,.97363,.97363,.93506,.8641,.79795,.79795,.79795,.79795,1.1406,1.1406,1.1406,1.1406,1.02096,1.09398,.97426,.97426,.97426,.97426,.97426,1.2107,.97489,1.00135,1.00135,1.00135,1.00135,.90996,.92094,1.02798,.96752,.96752,.96752,.96752,.96752,.96752,.93136,.86304,.97278,.97278,.97278,.97278,1.02285,1.02285,1.02285,1.02285,.97122,.99041,1,1,1,1,1,1.28826,1.0008,.99041,.99041,.99041,.99041,.96752,1.01519,.96752,.97363,.96752,.97363,.96752,.97363,.96752,.8641,.86304,.8641,.86304,.8641,.86304,.8641,.86304,1.02096,1.03057,1.02096,1.03517,.79795,.97278,.79795,.97278,.79795,.97278,.79795,.97278,.79795,.97278,.914,1.01359,.914,1.01359,.914,1.01359,1,1,1.06085,.98561,1.06085,1.00879,1.1406,1.02285,1.1406,1.02285,1.1406,1.02285,1.1406,1.02285,1.1406,1.02285,.97138,1.08692,.8007,1.02285,1,1,1.00527,.83693,1.02285,1,1,.83693,.9455,.83693,.90418,.83693,1.13005,1.09398,.99041,1,1,1.09398,.99041,.96692,1.09251,.99041,.97489,1.0008,.97489,1.0008,.97489,1.0008,.93994,.97931,.90399,1.02258,1,1,.90399,1.02258,.84041,.79104,.84041,.79104,.84041,.79104,.84041,.79104,1,1,.95923,1.07034,.95923,1.16862,1.00135,.99041,1.00135,.99041,1.00135,.99041,1.00135,.99041,1.00135,.99041,1.00135,.99041,1.06467,1.02511,.90996,.96752,.90996,.99361,.95801,.99361,.95801,.99361,.95801,1.07733,1.03424,.97363,.96752,.93506,.93136,.97489,1.0008,1,1,.95923,1.16862,1.15103,1.15103,1.01173,1.03959,.75953,.81378,.79912,1.15103,1.21994,.95161,.87815,1.01149,.81525,.7676,.98167,1.01134,1.02546,.84097,1.03089,1.18102,.97363,.88776,.85134,.97826,.79795,.99361,1.06085,.97489,1.1406,.89858,1.0388,1.14889,1.09398,.86039,.97489,1.0595,.92094,.94793,.95923,.90996,.99346,.98243,1.02112,.95493,1.1406,.90996,1.03574,1.02597,1.0008,1.18102,1.06628,1.03574,1.0192,1.01932,1.00886,.97531,1.0106,1.0008,1.13189,1.18102,1.02277,.98683,1.0016,.99561,1.07237,1.0008,.90434,.99921,.93803,.8965,1.23085,1.06628,1.04983,.96268,1.0499,.98439,1.18102,1.06628,1.0008,1.06628,.98439,.79795,1,1,1,1,1,1,1,1,1,1,1,1,1.09466,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.97278,1,1,1,1,1,1,1,1,1,1,1,1,1.02065,1,1,1,1,1,1,1.06467,1.02511,1.06467,1.02511,1.06467,1.02511,.90996,.96752,1,1.21408,.89903,1,1,.75155,1.04394,1.04394,1.04394,1.04394,.98633,.98633,.98633,.73047,.73047,1.20642,.91211,1.25635,1.222,1.02956,1.03372,1.03372,.96039,1.24633,1,1.12454,.93503,1.03424,1.19687,1.03424,1,1,1,.771,1,1,1.15749,1.15749,1.15749,1.10948,.86279,.94434,.86279,.94434,.86182,1,1,1.16897,1,.96085,.90137,1.2107,1.18416,1.13973,.69825,.9716,2.10339,1.29004,1.29004,1.21172,1.29004,1.29004,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.42603,1,.99862,.99862,1,.87025,.87025,.87025,.87025,1.18874,1.42603,1,1.42603,1.42603,.99862,1,1,1,1,1,1.2886,1.04315,1.15296,1.34163,1,1,1,1.09193,1.09193,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],Zl={lineHeight:1.33008,lineGap:0},Ql=[1.76738,1,1,.98946,1.03959,1.04016,1.02809,1.036,.97639,1.10953,1.23203,1.11144,1.11144,1.16939,1.21237,.9754,1.21261,.9754,1.59754,1.036,1.036,1.036,1.036,1.036,1.036,1.036,1.036,1.036,1.036,.81378,.81378,1.21237,1.21237,1.21237,.73541,.97847,.97363,.89723,.87897,1.0426,.79429,.85292,.91149,1.05815,1.1406,.79631,.90128,.83853,1.04396,1.10615,.97552,.94436,.97552,.88641,.80527,.96083,1.00135,1,1.06777,.9817,.91142,.99361,1.11144,1.57293,1.11144,1.21237,.74627,1.31818,1.06585,.97042,.83055,.97042,.93503,1.1261,.97042,.97922,1.14236,.94552,1.01054,1.14236,1.02471,.97922,.94165,.97042,.97042,1.0276,.78929,1.1261,.97922,.95874,1.02197,.98507,.96752,.97168,.95107,1.16579,.95107,1.21237,1.03959,1.036,1.036,1,1.036,1.16579,.87357,1.31818,1.18754,1.26781,1.05356,1.21237,1.18622,.79487,.94994,1.29004,1.24047,1.24047,1.31818,1,.91484,.9754,1.31818,1.1349,1.24866,1.05356,1.13934,1.15574,1.17389,.73541,.97363,.97363,.97363,.97363,.97363,.97363,.94385,.87897,.79429,.79429,.79429,.79429,1.1406,1.1406,1.1406,1.1406,1.0426,1.10615,.97552,.97552,.97552,.97552,.97552,1.21237,.97552,1.00135,1.00135,1.00135,1.00135,.91142,.94436,.98721,1.06585,1.06585,1.06585,1.06585,1.06585,1.06585,.96705,.83055,.93503,.93503,.93503,.93503,1.14236,1.14236,1.14236,1.14236,.93125,.97922,.94165,.94165,.94165,.94165,.94165,1.29004,.94165,.97922,.97922,.97922,.97922,.96752,.97042,.96752,.97363,1.06585,.97363,1.06585,.97363,1.06585,.87897,.83055,.87897,.83055,.87897,.83055,.87897,.83055,1.0426,1.0033,1.0426,.97042,.79429,.93503,.79429,.93503,.79429,.93503,.79429,.93503,.79429,.93503,.91149,.97042,.91149,.97042,.91149,.97042,1,1,1.05815,.97922,1.05815,.97922,1.1406,1.14236,1.1406,1.14236,1.1406,1.14236,1.1406,1.14236,1.1406,1.14236,.97441,1.04302,.79631,1.01582,1,1,1.01054,.83853,1.14236,1,1,.83853,1.09125,.83853,.90418,.83853,1.19508,1.10615,.97922,1,1,1.10615,.97922,1.01034,1.10466,.97922,.97552,.94165,.97552,.94165,.97552,.94165,.91602,.91981,.88641,1.0276,1,1,.88641,1.0276,.80527,.78929,.80527,.78929,.80527,.78929,.80527,.78929,1,1,.96083,1.05403,.95923,1.16862,1.00135,.97922,1.00135,.97922,1.00135,.97922,1.00135,.97922,1.00135,.97922,1.00135,.97922,1.06777,1.02197,.91142,.96752,.91142,.99361,.97168,.99361,.97168,.99361,.97168,1.23199,1.036,.97363,1.06585,.94385,.96705,.97552,.94165,1,1,.96083,1.1261,1.31818,1.31818,1.31818,1.31818,1.31818,1.31818,1.31818,1.31818,1.31818,.95161,1.27126,1.00811,.83284,.77702,.99137,.95253,1.0347,.86142,1.07205,1.14236,.97363,.89723,.86869,1.09818,.79429,.99361,1.05815,.97552,1.1406,.90128,1.06662,1.04396,1.10615,.84918,.97552,1.04694,.94436,.98015,.96083,.91142,1.00356,.9817,1.01945,.98999,1.1406,.91142,1.04961,.9898,1.00639,1.14236,1.07514,1.04961,.99607,1.02897,1.008,.9898,.95134,1.00639,1.11121,1.14236,1.00518,.97981,1.02186,1,1.08578,.94165,.99314,.98387,.93028,.93377,1.35125,1.07514,1.10687,.93491,1.04232,1.00351,1.14236,1.07514,.94165,1.07514,1.00351,.79429,1,1,1,1,1,1,1,1,1,1,1,1,1.09097,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.93503,1,1,1,1,1,1,1,1,1,1,1,1,.96609,1,1,1,1,1,1,1.06777,1.02197,1.06777,1.02197,1.06777,1.02197,.91142,.96752,1,1.21261,.89903,1,1,.75155,1.04745,1.04745,1.04745,1.04394,.98633,.98633,.98633,.72959,.72959,1.20502,.91406,1.26514,1.222,1.02956,1.03372,1.03372,.96039,1.24633,1,1.09125,.93327,1.03336,1.16541,1.036,1,1,1,.771,1,1,1.15574,1.15574,1.15574,1.15574,.86364,.94434,.86279,.94434,.86224,1,1,1.16798,1,.96085,.90068,1.21237,1.18416,1.13904,.69825,.9716,2.10339,1.29004,1.29004,1.21339,1.29004,1.29004,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.42603,1,.99862,.99862,1,.87025,.87025,.87025,.87025,1.18775,1.42603,1,1.42603,1.42603,.99862,1,1,1,1,1,1.2886,1.04315,1.15296,1.34163,1,1,1,1.13269,1.13269,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],$l={lineHeight:1.33008,lineGap:0},eu=[1.76738,1,1,.98946,1.14763,1.05365,1.06234,.96927,.92586,1.15373,1.18414,.91349,.91349,1.07403,1.17308,.78383,1.20088,.78383,1.42531,.96927,.96927,.96927,.96927,.96927,.96927,.96927,.96927,.96927,.96927,.78383,.78383,1.17308,1.17308,1.17308,.77349,.94565,.94729,.85944,.88506,.9858,.74817,.80016,.88449,.98039,.95782,.69238,.89898,.83231,.98183,1.03989,.96924,.86237,.96924,.80595,.74524,.86091,.95402,.94143,.98448,.8858,.83089,.93285,1.0949,1.39016,1.0949,1.45994,.74627,1.04839,.97454,.97454,.87207,.97454,.87533,1.06151,.97454,1.00176,1.16484,1.08132,.98047,1.16484,1.02989,1.01054,.96225,.97454,.97454,1.06598,.79004,1.16344,1.00351,.94629,.9973,.91016,.96777,.9043,.91082,.92481,.91082,1.17308,.95748,.96927,.96927,1,.96927,.92481,.80597,1.04839,1.23393,1.1781,.9245,1.17308,1.20808,.63218,.94261,1.24822,1.09971,1.09971,1.04839,1,.85273,.78032,1.04839,1.09971,1.22326,.9245,1.09836,1.13525,1.15222,.70424,.94729,.94729,.94729,.94729,.94729,.94729,.85498,.88506,.74817,.74817,.74817,.74817,.95782,.95782,.95782,.95782,.9858,1.03989,.96924,.96924,.96924,.96924,.96924,1.17308,.96924,.95402,.95402,.95402,.95402,.83089,.86237,.88409,.97454,.97454,.97454,.97454,.97454,.97454,.92916,.87207,.87533,.87533,.87533,.87533,.93146,.93146,.93146,.93146,.93854,1.01054,.96225,.96225,.96225,.96225,.96225,1.24822,.8761,1.00351,1.00351,1.00351,1.00351,.96777,.97454,.96777,.94729,.97454,.94729,.97454,.94729,.97454,.88506,.87207,.88506,.87207,.88506,.87207,.88506,.87207,.9858,.95391,.9858,.97454,.74817,.87533,.74817,.87533,.74817,.87533,.74817,.87533,.74817,.87533,.88449,.97454,.88449,.97454,.88449,.97454,1,1,.98039,1.00176,.98039,1.00176,.95782,.93146,.95782,.93146,.95782,.93146,.95782,1.16484,.95782,.93146,.84421,1.12761,.69238,1.08132,1,1,.98047,.83231,1.16484,1,1,.84723,1.04861,.84723,.78755,.83231,1.23736,1.03989,1.01054,1,1,1.03989,1.01054,.9857,1.03849,1.01054,.96924,.96225,.96924,.96225,.96924,.96225,.92383,.90171,.80595,1.06598,1,1,.80595,1.06598,.74524,.79004,.74524,.79004,.74524,.79004,.74524,.79004,1,1,.86091,1.02759,.85771,1.16344,.95402,1.00351,.95402,1.00351,.95402,1.00351,.95402,1.00351,.95402,1.00351,.95402,1.00351,.98448,.9973,.83089,.96777,.83089,.93285,.9043,.93285,.9043,.93285,.9043,1.31868,.96927,.94729,.97454,.85498,.92916,.96924,.8761,1,1,.86091,1.16344,1.04839,1.04839,1.04839,1.04839,1.04839,1.04839,1.04839,1.04839,1.04839,.81965,.81965,.94729,.78032,.71022,.90883,.84171,.99877,.77596,1.05734,1.2,.94729,.85944,.82791,.9607,.74817,.93285,.98039,.96924,.95782,.89898,.98316,.98183,1.03989,.78614,.96924,.97642,.86237,.86075,.86091,.83089,.90082,.8858,.97296,1.01284,.95782,.83089,1.0976,1.04,1.03342,1.2,1.0675,1.0976,.98205,1.03809,1.05097,1.04,.95364,1.03342,1.05401,1.2,1.02148,1.0119,1.04724,1.0127,1.02732,.96225,.8965,.97783,.93574,.94818,1.30679,1.0675,1.11826,.99821,1.0557,1.0326,1.2,1.0675,.96225,1.0675,1.0326,.74817,1,1,1,1,1,1,1,1,1,1,1,1,1.03754,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.87533,1,1,1,1,1,1,1,1,1,1,1,1,.98705,1,1,1,1,1,1,.98448,.9973,.98448,.9973,.98448,.9973,.83089,.96777,1,1.20088,.89903,1,1,.75155,.94945,.94945,.94945,.94945,1.12317,1.12317,1.12317,.67603,.67603,1.15621,.73584,1.21191,1.22135,1.06483,.94868,.94868,.95996,1.24633,1,1.07497,.87709,.96927,1.01473,.96927,1,1,1,.77295,1,1,1.09836,1.09836,1.09836,1.01522,.86321,.94434,.8649,.94434,.86182,1,1,1.083,1,.91578,.86438,1.17308,1.18416,1.14589,.69825,.97622,1.96791,1.24822,1.24822,1.17308,1.24822,1.24822,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.42603,1,.99862,.99862,1,.87025,.87025,.87025,.87025,1.17984,1.42603,1,1.42603,1.42603,.99862,1,1,1,1,1,1.2886,1.04315,1.15296,1.34163,1,1,1,1.10742,1.10742,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],tu={lineHeight:1.33008,lineGap:0},nu=[1.76738,1,1,.98594,1.02285,1.10454,1.06234,.96927,.92037,1.19985,1.2046,.90616,.90616,1.07152,1.1714,.78032,1.20088,.78032,1.40246,.96927,.96927,.96927,.96927,.96927,.96927,.96927,.96927,.96927,.96927,.78032,.78032,1.1714,1.1714,1.1714,.80597,.94084,.96706,.85944,.85734,.97093,.75842,.79936,.88198,.9831,.95782,.71387,.86969,.84636,1.07796,1.03584,.96924,.83968,.96924,.82826,.79649,.85771,.95132,.93119,.98965,.88433,.8287,.93365,1.08612,1.3638,1.08612,1.45786,.74627,.80499,.91484,1.05707,.92383,1.05882,.9403,1.12654,1.05882,1.01756,1.09011,1.09011,.99414,1.09011,1.034,1.01756,1.05356,1.05707,1.05882,1.04399,.84863,1.21968,1.01756,.95801,1.00068,.91797,.96777,.9043,.90351,.92105,.90351,1.1714,.85337,.96927,.96927,.99912,.96927,.92105,.80597,1.2434,1.20808,1.05937,.90957,1.1714,1.20808,.75155,.94261,1.24644,1.09971,1.09971,.84751,1,.85273,.78032,.61584,1.05425,1.17914,.90957,1.08665,1.11593,1.14169,.73381,.96706,.96706,.96706,.96706,.96706,.96706,.86035,.85734,.75842,.75842,.75842,.75842,.95782,.95782,.95782,.95782,.97093,1.03584,.96924,.96924,.96924,.96924,.96924,1.1714,.96924,.95132,.95132,.95132,.95132,.8287,.83968,.89049,.91484,.91484,.91484,.91484,.91484,.91484,.93575,.92383,.9403,.9403,.9403,.9403,.8717,.8717,.8717,.8717,1.00527,1.01756,1.05356,1.05356,1.05356,1.05356,1.05356,1.24644,.95923,1.01756,1.01756,1.01756,1.01756,.96777,1.05707,.96777,.96706,.91484,.96706,.91484,.96706,.91484,.85734,.92383,.85734,.92383,.85734,.92383,.85734,.92383,.97093,1.0969,.97093,1.05882,.75842,.9403,.75842,.9403,.75842,.9403,.75842,.9403,.75842,.9403,.88198,1.05882,.88198,1.05882,.88198,1.05882,1,1,.9831,1.01756,.9831,1.01756,.95782,.8717,.95782,.8717,.95782,.8717,.95782,1.09011,.95782,.8717,.84784,1.11551,.71387,1.09011,1,1,.99414,.84636,1.09011,1,1,.84636,1.0536,.84636,.94298,.84636,1.23297,1.03584,1.01756,1,1,1.03584,1.01756,1.00323,1.03444,1.01756,.96924,1.05356,.96924,1.05356,.96924,1.05356,.93066,.98293,.82826,1.04399,1,1,.82826,1.04399,.79649,.84863,.79649,.84863,.79649,.84863,.79649,.84863,1,1,.85771,1.17318,.85771,1.21968,.95132,1.01756,.95132,1.01756,.95132,1.01756,.95132,1.01756,.95132,1.01756,.95132,1.01756,.98965,1.00068,.8287,.96777,.8287,.93365,.9043,.93365,.9043,.93365,.9043,1.08571,.96927,.96706,.91484,.86035,.93575,.96924,.95923,1,1,.85771,1.21968,1.11437,1.11437,.93109,.91202,.60411,.84164,.55572,1.01173,.97361,.81818,.81818,.96635,.78032,.72727,.92366,.98601,1.03405,.77968,1.09799,1.2,.96706,.85944,.85638,.96491,.75842,.93365,.9831,.96924,.95782,.86969,.94152,1.07796,1.03584,.78437,.96924,.98715,.83968,.83491,.85771,.8287,.94492,.88433,.9287,1.0098,.95782,.8287,1.0625,.98248,1.03424,1.2,1.01071,1.0625,.95246,1.03809,1.04912,.98248,1.00221,1.03424,1.05443,1.2,1.04785,.99609,1.00169,1.05176,.99346,1.05356,.9087,1.03004,.95542,.93117,1.23362,1.01071,1.07831,1.02512,1.05205,1.03502,1.2,1.01071,1.05356,1.01071,1.03502,.75842,1,1,1,1,1,1,1,1,1,1,1,1,1.03719,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.9403,1,1,1,1,1,1,1,1,1,1,1,1,1.04021,1,1,1,1,1,1,.98965,1.00068,.98965,1.00068,.98965,1.00068,.8287,.96777,1,1.20088,.89903,1,1,.75155,1.03077,1.03077,1.03077,1.03077,1.13196,1.13196,1.13196,.67428,.67428,1.16039,.73291,1.20996,1.22135,1.06483,.94868,.94868,.95996,1.24633,1,1.07497,.87796,.96927,1.01518,.96927,1,1,1,.77295,1,1,1.10539,1.10539,1.11358,1.06967,.86279,.94434,.86279,.94434,.86182,1,1,1.083,1,.91578,.86507,1.1714,1.18416,1.14589,.69825,.97622,1.9697,1.24822,1.24822,1.17238,1.24822,1.24822,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.42603,1,.99862,.99862,1,.87025,.87025,.87025,.87025,1.18083,1.42603,1,1.42603,1.42603,.99862,1,1,1,1,1,1.2886,1.04315,1.15296,1.34163,1,1,1,1.10938,1.10938,1,1,1,1.05425,1.09971,1.09971,1.09971,1,1,1,1,1,1,1,1,1,1,1],ru={lineHeight:1.33008,lineGap:0},iu=sr(function(e){e[`MyriadPro-Regular`]=e[`PdfJS-Fallback-Regular`]={name:`LiberationSans-Regular`,factors:Jl,baseWidths:Bl,baseMapping:Vl,metrics:Yl},e[`MyriadPro-Bold`]=e[`PdfJS-Fallback-Bold`]={name:`LiberationSans-Bold`,factors:Hl,baseWidths:Pl,baseMapping:Fl,metrics:Ul},e[`MyriadPro-It`]=e[`MyriadPro-Italic`]=e[`PdfJS-Fallback-Italic`]={name:`LiberationSans-Italic`,factors:Kl,baseWidths:Rl,baseMapping:zl,metrics:ql},e[`MyriadPro-BoldIt`]=e[`MyriadPro-BoldItalic`]=e[`PdfJS-Fallback-BoldItalic`]={name:`LiberationSans-BoldItalic`,factors:Wl,baseWidths:Il,baseMapping:Ll,metrics:Gl},e.ArialMT=e.Arial=e[`Arial-Regular`]={name:`LiberationSans-Regular`,baseWidths:Bl,baseMapping:Vl},e[`Arial-BoldMT`]=e[`Arial-Bold`]={name:`LiberationSans-Bold`,baseWidths:Pl,baseMapping:Fl},e[`Arial-ItalicMT`]=e[`Arial-Italic`]={name:`LiberationSans-Italic`,baseWidths:Rl,baseMapping:zl},e[`Arial-BoldItalicMT`]=e[`Arial-BoldItalic`]={name:`LiberationSans-BoldItalic`,baseWidths:Il,baseMapping:Ll},e[`Calibri-Regular`]={name:`LiberationSans-Regular`,factors:wl,baseWidths:Bl,baseMapping:Vl,metrics:Tl},e[`Calibri-Bold`]={name:`LiberationSans-Bold`,factors:vl,baseWidths:Pl,baseMapping:Fl,metrics:yl},e[`Calibri-Italic`]={name:`LiberationSans-Italic`,factors:Sl,baseWidths:Rl,baseMapping:zl,metrics:Cl},e[`Calibri-BoldItalic`]={name:`LiberationSans-BoldItalic`,factors:bl,baseWidths:Il,baseMapping:Ll,metrics:xl},e[`Segoeui-Regular`]={name:`LiberationSans-Regular`,factors:nu,baseWidths:Bl,baseMapping:Vl,metrics:ru},e[`Segoeui-Bold`]={name:`LiberationSans-Bold`,factors:Xl,baseWidths:Pl,baseMapping:Fl,metrics:Zl},e[`Segoeui-Italic`]={name:`LiberationSans-Italic`,factors:eu,baseWidths:Rl,baseMapping:zl,metrics:tu},e[`Segoeui-BoldItalic`]={name:`LiberationSans-BoldItalic`,factors:Ql,baseWidths:Il,baseMapping:Ll,metrics:$l},e[`Helvetica-Regular`]=e.Helvetica={name:`LiberationSans-Regular`,factors:Ml,baseWidths:Bl,baseMapping:Vl,metrics:Nl},e[`Helvetica-Bold`]={name:`LiberationSans-Bold`,factors:El,baseWidths:Pl,baseMapping:Fl,metrics:Dl},e[`Helvetica-Italic`]={name:`LiberationSans-Italic`,factors:Al,baseWidths:Rl,baseMapping:zl,metrics:jl},e[`Helvetica-BoldItalic`]={name:`LiberationSans-BoldItalic`,factors:Ol,baseWidths:Il,baseMapping:Ll,metrics:kl}});function au(e){let t=is(e);return iu()[t]}function ou(e){let t=function(e){let t=au(e);if(!t)return null;let{baseWidths:n,baseMapping:r,factors:i}=t,a=i?n.map((e,t)=>e*i[t]):n,o,s=-2,c=[];for(let[e,t]of r.map((e,t)=>[e,t]).sort(([e],[t])=>e-t))e!==-1&&(e===s+1?(o.push(a[t]),s+=1):(s=e,o=[a[t]],c.push(e,o)));return c}(e),n=new L(null);n.set(`BaseFont`,I.get(e)),n.set(`Type`,I.get(`Font`)),n.set(`Subtype`,I.get(`CIDFontType2`)),n.set(`Encoding`,I.get(`Identity-H`)),n.set(`CIDToGIDMap`,I.get(`Identity`)),n.set(`W`,t),n.set(`FirstChar`,t[0]),n.set(`LastChar`,t.at(-2)+t.at(-1).length-1);let r=new L(null);n.set(`FontDescriptor`,r);let i=new L(null);return i.set(`Ordering`,`Identity`),i.set(`Registry`,`Adobe`),i.set(`Supplement`,0),n.set(`CIDSystemInfo`,i),n}var su=class{constructor(e){this.lexer=e,this.operators=[],this.token=null,this.prev=null}nextToken(){this.prev=this.token,this.token=this.lexer.getToken()}accept(e){return this.token.type===e&&(this.nextToken(),!0)}expect(e){if(this.accept(e))return!0;throw new F(`Unexpected symbol: found ${this.token.type} expected ${e}.`)}parse(){return this.nextToken(),this.expect(cu.LBRACE),this.parseBlock(),this.expect(cu.RBRACE),this.operators}parseBlock(){for(;;)if(this.accept(cu.NUMBER))this.operators.push(this.prev.value);else if(this.accept(cu.OPERATOR))this.operators.push(this.prev.value);else{if(!this.accept(cu.LBRACE))return;this.parseCondition()}}parseCondition(){let e=this.operators.length;if(this.operators.push(null,null),this.parseBlock(),this.expect(cu.RBRACE),this.accept(cu.IF))this.operators[e]=this.operators.length,this.operators[e+1]=`jz`;else{if(!this.accept(cu.LBRACE))throw new F(`PS Function: error parsing conditional.`);{let t=this.operators.length;this.operators.push(null,null);let n=this.operators.length;this.parseBlock(),this.expect(cu.RBRACE),this.expect(cu.IFELSE),this.operators[t]=this.operators.length,this.operators[t+1]=`j`,this.operators[e]=n,this.operators[e+1]=`jz`}}}},cu={LBRACE:0,RBRACE:1,NUMBER:2,OPERATOR:3,IF:4,IFELSE:5},lu=class e{static get opCache(){return P(this,`opCache`,Object.create(null))}constructor(e,t){this.type=e,this.value=t}static getOperator(t){return e.opCache[t]||=new e(cu.OPERATOR,t)}static get LBRACE(){return P(this,`LBRACE`,new e(cu.LBRACE,`{`))}static get RBRACE(){return P(this,`RBRACE`,new e(cu.RBRACE,`}`))}static get IF(){return P(this,`IF`,new e(cu.IF,`IF`))}static get IFELSE(){return P(this,`IFELSE`,new e(cu.IFELSE,`IFELSE`))}},uu=class{constructor(e){this.stream=e,this.nextChar(),this.strBuf=[]}nextChar(){return this.currentChar=this.stream.getByte()}getToken(){let e=!1,t=this.currentChar;for(;;){if(t<0)return Un;if(e)t!==10&&t!==13||(e=!1);else if(t===37)e=!0;else if(!Sr(t))break;t=this.nextChar()}switch(0|t){case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:case 43:case 45:case 46:return new lu(cu.NUMBER,this.getNumber());case 123:return this.nextChar(),lu.LBRACE;case 125:return this.nextChar(),lu.RBRACE}let n=this.strBuf;for(n.length=0,n[0]=String.fromCharCode(t);(t=this.nextChar())>=0&&(t>=65&&t<=90||t>=97&&t<=122);)n.push(String.fromCharCode(t));let r=n.join(``);switch(r.toLowerCase()){case`if`:return lu.IF;case`ifelse`:return lu.IFELSE;default:return lu.getOperator(r)}}getNumber(){let e=this.currentChar,t=this.strBuf;for(t.length=0,t[0]=String.fromCharCode(e);(e=this.nextChar())>=0&&(e>=48&&e<=57||e===45||e===46);)t.push(String.fromCharCode(e));let n=parseFloat(t.join(``));if(isNaN(n))throw new F(`Invalid floating point number: ${n}`);return n}},du=class{constructor(e){this._onlyRefs=!0===e?.onlyRefs,this._onlyRefs||(this._nameRefMap=new Map,this._imageMap=new Map),this._imageCache=new Xn}getByName(e){this._onlyRefs&&gn("Should not call `getByName` method.");let t=this._nameRefMap.get(e);return t?this.getByRef(t):this._imageMap.get(e)||null}getByRef(e){return this._imageCache.get(e)||null}set(e,t,n){gn("Abstract method `set` called.")}},fu=class extends du{set(e,t=null,n){if(typeof e!=`string`)throw Error(`LocalImageCache.set - expected "name" argument.`);if(t){if(this._imageCache.has(t))return;this._nameRefMap.set(e,t),this._imageCache.put(t,n);return}this._imageMap.has(e)||this._imageMap.set(e,n)}},pu=class extends du{set(e=null,t=null,n){if(typeof e!=`string`&&!t)throw Error(`LocalColorSpaceCache.set - expected "name" and/or "ref" argument.`);if(t){if(this._imageCache.has(t))return;e!==null&&this._nameRefMap.set(e,t),this._imageCache.put(t,n);return}this._imageMap.has(e)||this._imageMap.set(e,n)}},mu=class extends du{constructor(e){super({onlyRefs:!0})}set(e=null,t,n){if(!t)throw Error(`LocalFunctionCache.set - expected "ref" argument.`);this._imageCache.has(t)||this._imageCache.put(t,n)}},hu=class extends du{set(e,t=null,n){if(typeof e!=`string`)throw Error(`LocalGStateCache.set - expected "name" argument.`);if(t){if(this._imageCache.has(t))return;this._nameRefMap.set(e,t),this._imageCache.put(t,n);return}this._imageMap.has(e)||this._imageMap.set(e,n)}},gu=class extends du{constructor(e){super({onlyRefs:!0})}set(e=null,t,n){if(!t)throw Error(`LocalTilingPatternCache.set - expected "ref" argument.`);this._imageCache.has(t)||this._imageCache.put(t,n)}},_u=class extends du{constructor(e){super({onlyRefs:!0})}set(e=null,t,n){if(!t)throw Error(`RegionalImageCache.set - expected "ref" argument.`);this._imageCache.has(t)||this._imageCache.put(t,n)}},vu=class extends du{constructor(e){super({onlyRefs:!0})}set(e=null,t,n){if(!t)throw Error(`GlobalColorSpaceCache.set - expected "ref" argument.`);this._imageCache.has(t)||this._imageCache.put(t,n)}clear(){this._imageCache.clear()}},yu=class e{static NUM_PAGES_THRESHOLD=2;static MIN_IMAGES_TO_CACHE=10;static MAX_BYTE_SIZE=5e7;#e=new Yn;constructor(){this._refCache=new Xn,this._imageCache=new Xn}get#t(){let e=0;for(let t of this._imageCache)e+=t.byteSize;return e}get#n(){return!(this._imageCache.size<e.MIN_IMAGES_TO_CACHE)&&!(this.#t<e.MAX_BYTE_SIZE)}shouldCache(t,n){let r=this._refCache.get(t);return r||(r=new Set,this._refCache.put(t,r)),r.add(n),!(r.size<e.NUM_PAGES_THRESHOLD)&&!(!this._imageCache.has(t)&&this.#n)}addDecodeFailed(e){this.#e.put(e)}hasDecodeFailed(e){return this.#e.has(e)}addByteSize(e,t){let n=this._imageCache.get(e);n&&(n.byteSize||=t)}getData(t,n){let r=this._refCache.get(t);if(!r||r.size<e.NUM_PAGES_THRESHOLD)return null;let i=this._imageCache.get(t);return i?(r.add(n),i):null}setData(e,t){if(!this._refCache.has(e))throw Error(`GlobalImageCache.setData - expected "shouldCache" to have been called.`);this._imageCache.has(e)||(this.#n?N(`GlobalImageCache.setData - cache limit reached.`):this._imageCache.put(e,t))}clear(e=!1){e||(this.#e.clear(),this._refCache.clear()),this._imageCache.clear()}},bu=class{constructor({xref:e,isEvalSupported:t=!0}){this.xref=e,this.isEvalSupported=!1!==t}create(e,t=!1){let n,r;if(e instanceof R?n=e:e instanceof L?n=e.objId:e instanceof tr&&(n=e.dict?.objId),n){let e=this._localFunctionCache.getByRef(n);if(e)return e}let i=this.xref.fetchIfRef(e);if(Array.isArray(i)){if(!t)throw Error(`PDFFunctionFactory.create - expected "parseArray" argument.`);r=Su.parseArray(this,i)}else r=Su.parse(this,i);return n&&this._localFunctionCache.set(null,n,r),r}get _localFunctionCache(){return P(this,`_localFunctionCache`,new mu)}};function xu(e){return Array.isArray(e)?Cr(e,null)?e:e.map(e=>+e):null}var Su=class{static getSampleArray(e,t,n,r){let i,a,o=1;for(i=0,a=e.length;i<a;i++)o*=e[i];o*=t;let s=Array(o),c=0,l=0,u=1/(2**n-1),d=r.getBytes((o*n+7)/8),f=0;for(i=0;i<o;i++){for(;c<n;)l<<=8,l|=d[f++],c+=8;c-=n,s[i]=(l>>c)*u,l&=(1<<c)-1}return s}static parse(e,t){let n=t.dict||t;switch(n.get(`FunctionType`)){case 0:return this.constructSampled(e,t,n);case 1:break;case 2:return this.constructInterpolated(e,n);case 3:return this.constructStiched(e,n);case 4:return this.constructPostScript(e,t,n)}throw new F(`Unknown type of function`)}static parseArray(e,t){let{xref:n}=e,r=[];for(let i of t)r.push(this.parse(e,n.fetchIfRef(i)));return function(e,t,n,i){for(let a=0,o=r.length;a<o;a++)r[a](e,t,n,i+a)}}static constructSampled(e,t,n){function r(e){let t=e.length,n=[],r=0;for(let i=0;i<t;i+=2)n[r++]=[e[i],e[i+1]];return n}function i(e,t,n,r,i){return r+(i-r)/(n-t)*(e-t)}let a=xu(n.getArray(`Domain`)),o=xu(n.getArray(`Range`));if(!a||!o)throw new F(`No domain or range`);let s=a.length/2,c=o.length/2;a=r(a),o=r(o);let l=xu(n.getArray(`Size`)),u=n.get(`BitsPerSample`),d=n.get(`Order`)||1;d!==1&&hn(`No support for cubic spline interpolation: `+d);let f=xu(n.getArray(`Encode`));if(f)f=r(f);else{f=[];for(let e=0;e<s;++e)f.push([0,l[e]-1])}let p=xu(n.getArray(`Decode`));p=p?r(p):o;let m=this.getSampleArray(l,c,u,t);return function(e,t,n,r){let u=1<<s,d=new Float64Array(u).fill(1),h=new Uint32Array(u),g,_,v=c,y=1;for(g=0;g<s;++g){let n=a[g][0],r=a[g][1],o=i(Bn(e[t+g],n,r),n,r,f[g][0],f[g][1]),s=l[g];o=Bn(o,0,s-1);let c=o<s-1?Math.floor(o):o-1,p=c+1-o,m=o-c,b=c*v,x=b+v;for(_=0;_<u;_++)_&y?(d[_]*=m,h[_]+=x):(d[_]*=p,h[_]+=b);v*=s,y<<=1}for(_=0;_<c;++_){let e=0;for(g=0;g<u;g++)e+=m[h[g]+_]*d[g];e=i(e,0,1,p[_][0],p[_][1]),n[r+_]=Bn(e,o[_][0],o[_][1])}}}static constructInterpolated(e,t){let n=xu(t.getArray(`C0`))||[0],r=xu(t.getArray(`C1`))||[1],i=t.get(`N`),a=[];for(let e=0,t=n.length;e<t;++e)a.push(r[e]-n[e]);let o=a.length;return function(e,t,r,s){let c=i===1?e[t]:e[t]**i;for(let e=0;e<o;++e)r[s+e]=n[e]+c*a[e]}}static constructStiched(e,t){let n=xu(t.getArray(`Domain`));if(!n)throw new F(`No domain`);if(n.length/2!=1)throw new F(`Bad domain for stiched function`);let{xref:r}=e,i=[];for(let n of t.get(`Functions`))i.push(this.parse(e,r.fetchIfRef(n)));let a=xu(t.getArray(`Bounds`)),o=xu(t.getArray(`Encode`)),s=new Float32Array(1);return function(e,t,r,c){let l=Bn(e[t],n[0],n[1]),u=a.length,d;for(d=0;d<u&&!(l<a[d]);++d);let f=n[0];d>0&&(f=a[d-1]);let p=n[1];d<a.length&&(p=a[d]);let m=o[2*d],h=o[2*d+1];s[0]=f===p?m:m+(l-f)*(h-m)/(p-f),i[d](s,0,r,c)}}static constructPostScript(e,t,n){let r=xu(n.getArray(`Domain`)),i=xu(n.getArray(`Range`));if(!r)throw new F(`No domain.`);if(!i)throw new F(`No range.`);let a=new su(new uu(t)).parse();if(e.isEvalSupported&&kn.isEvalSupported){let e=new Ru().compile(a,r,i);if(e)return Function(`src`,`srcOffset`,`dest`,`destOffset`,e)}hn(`Unable to compile PS function`);let o=i.length>>1,s=r.length>>1,c=new Tu(a),l=Object.create(null),u=8192,d=new Float32Array(s);return function(e,t,n,r){let a,f,p=``,m=d;for(a=0;a<s;a++)f=e[t+a],m[a]=f,p+=f+`_`;let h=l[p];if(h!==void 0)return void n.set(h,r);let g=new Float32Array(o),_=c.execute(m),v=_.length-o;for(a=0;a<o;a++){f=_[v+a];let e=i[2*a];f<e?f=e:(e=i[2*a+1],f>e&&(f=e)),g[a]=f}u>0&&(u--,l[p]=g),n.set(g,r)}}};function Cu(e){let t;if(e instanceof L)t=e;else{if(!(e instanceof tr))return!1;t=e.dict}return t.has(`FunctionType`)}var wu=class e{static MAX_STACK_SIZE=100;constructor(e){this.stack=e?Array.from(e):[]}push(t){if(this.stack.length>=e.MAX_STACK_SIZE)throw Error(`PostScript function stack overflow.`);this.stack.push(t)}pop(){if(this.stack.length<=0)throw Error(`PostScript function stack underflow.`);return this.stack.pop()}copy(t){if(this.stack.length+t>=e.MAX_STACK_SIZE)throw Error(`PostScript function stack overflow.`);let n=this.stack;for(let e=n.length-t,r=t-1;r>=0;r--,e++)n.push(n[e])}index(e){this.push(this.stack[this.stack.length-e-1])}roll(e,t){let n=this.stack,r=n.length-e,i=n.length-1,a=r+(t-Math.floor(t/e)*e);for(let e=r,t=i;e<t;e++,t--){let r=n[e];n[e]=n[t],n[t]=r}for(let e=r,t=a-1;e<t;e++,t--){let r=n[e];n[e]=n[t],n[t]=r}for(let e=a,t=i;e<t;e++,t--){let r=n[e];n[e]=n[t],n[t]=r}}},Tu=class{constructor(e){this.operators=e}execute(e){let t=new wu(e),n=0,r=this.operators,i=r.length,a,o,s;for(;n<i;)if(a=r[n++],typeof a!=`number`)switch(a){case`jz`:s=t.pop(),o=t.pop(),o||(n=s);break;case`j`:o=t.pop(),n=o;break;case`abs`:o=t.pop(),t.push(Math.abs(o));break;case`add`:s=t.pop(),o=t.pop(),t.push(o+s);break;case`and`:s=t.pop(),o=t.pop(),typeof o==`boolean`&&typeof s==`boolean`?t.push(o&&s):t.push(o&s);break;case`atan`:s=t.pop(),o=t.pop(),o=Math.atan2(o,s)/Math.PI*180,o<0&&(o+=360),t.push(o);break;case`bitshift`:s=t.pop(),o=t.pop(),o>0?t.push(o<<s):t.push(o>>s);break;case`ceiling`:o=t.pop(),t.push(Math.ceil(o));break;case`copy`:o=t.pop(),t.copy(o);break;case`cos`:o=t.pop(),t.push(Math.cos(o%360/180*Math.PI));break;case`cvi`:o=0|t.pop(),t.push(o);break;case`cvr`:break;case`div`:s=t.pop(),o=t.pop(),t.push(o/s);break;case`dup`:t.copy(1);break;case`eq`:s=t.pop(),o=t.pop(),t.push(o===s);break;case`exch`:t.roll(2,1);break;case`exp`:s=t.pop(),o=t.pop(),t.push(o**s);break;case`false`:t.push(!1);break;case`floor`:o=t.pop(),t.push(Math.floor(o));break;case`ge`:s=t.pop(),o=t.pop(),t.push(o>=s);break;case`gt`:s=t.pop(),o=t.pop(),t.push(o>s);break;case`idiv`:s=t.pop(),o=t.pop(),t.push(o/s|0);break;case`index`:o=t.pop(),t.index(o);break;case`le`:s=t.pop(),o=t.pop(),t.push(o<=s);break;case`ln`:o=t.pop(),t.push(Math.log(o));break;case`log`:o=t.pop(),t.push(Math.log10(o));break;case`lt`:s=t.pop(),o=t.pop(),t.push(o<s);break;case`mod`:s=t.pop(),o=t.pop(),t.push(o%s);break;case`mul`:s=t.pop(),o=t.pop(),t.push(o*s);break;case`ne`:s=t.pop(),o=t.pop(),t.push(o!==s);break;case`neg`:o=t.pop(),t.push(-o);break;case`not`:o=t.pop(),typeof o==`boolean`?t.push(!o):t.push(~o);break;case`or`:s=t.pop(),o=t.pop(),typeof o==`boolean`&&typeof s==`boolean`?t.push(o||s):t.push(o|s);break;case`pop`:t.pop();break;case`roll`:s=t.pop(),o=t.pop(),t.roll(o,s);break;case`round`:o=t.pop(),t.push(Math.round(o));break;case`sin`:o=t.pop(),t.push(Math.sin(o%360/180*Math.PI));break;case`sqrt`:o=t.pop(),t.push(Math.sqrt(o));break;case`sub`:s=t.pop(),o=t.pop(),t.push(o-s);break;case`true`:t.push(!0);break;case`truncate`:o=t.pop(),o=o<0?Math.ceil(o):Math.floor(o),t.push(o);break;case`xor`:s=t.pop(),o=t.pop(),typeof o==`boolean`&&typeof s==`boolean`?t.push(o!==s):t.push(o^s);break;default:throw new F(`Unknown operator ${a}`)}else t.push(a);return t.stack}},Eu=class{constructor(e){this.type=e}visit(e){gn(`abstract method`)}},Du=class extends Eu{constructor(e,t,n){super(`args`),this.index=e,this.min=t,this.max=n}visit(e){e.visitArgument(this)}},Ou=class extends Eu{constructor(e){super(`literal`),this.number=e,this.min=e,this.max=e}visit(e){e.visitLiteral(this)}},ku=class extends Eu{constructor(e,t,n,r,i){super(`binary`),this.op=e,this.arg1=t,this.arg2=n,this.min=r,this.max=i}visit(e){e.visitBinaryOperation(this)}},Au=class extends Eu{constructor(e,t){super(`max`),this.arg=e,this.min=e.min,this.max=t}visit(e){e.visitMin(this)}},ju=class extends Eu{constructor(e,t,n){super(`var`),this.index=e,this.min=t,this.max=n}visit(e){e.visitVariable(this)}},Mu=class extends Eu{constructor(e,t){super(`definition`),this.variable=e,this.arg=t}visit(e){e.visitVariableDefinition(this)}},Nu=class{constructor(){this.parts=[]}visitArgument(e){this.parts.push(`Math.max(`,e.min,`, Math.min(`,e.max,`, src[srcOffset + `,e.index,`]))`)}visitVariable(e){this.parts.push(`v`,e.index)}visitLiteral(e){this.parts.push(e.number)}visitBinaryOperation(e){this.parts.push(`(`),e.arg1.visit(this),this.parts.push(` `,e.op,` `),e.arg2.visit(this),this.parts.push(`)`)}visitVariableDefinition(e){this.parts.push(`var `),e.variable.visit(this),this.parts.push(` = `),e.arg.visit(this),this.parts.push(`;`)}visitMin(e){this.parts.push(`Math.min(`),e.arg.visit(this),this.parts.push(`, `,e.max,`)`)}toString(){return this.parts.join(``)}};function Pu(e,t){return t.type===`literal`&&t.number===0?e:e.type===`literal`&&e.number===0?t:t.type===`literal`&&e.type===`literal`?new Ou(e.number+t.number):new ku(`+`,e,t,e.min+t.min,e.max+t.max)}function Fu(e,t){if(t.type===`literal`){if(t.number===0)return new Ou(0);if(t.number===1)return e;if(e.type===`literal`)return new Ou(e.number*t.number)}if(e.type===`literal`){if(e.number===0)return new Ou(0);if(e.number===1)return t}return new ku(`*`,e,t,Math.min(e.min*t.min,e.min*t.max,e.max*t.min,e.max*t.max),Math.max(e.min*t.min,e.min*t.max,e.max*t.min,e.max*t.max))}function Iu(e,t){if(t.type===`literal`){if(t.number===0)return e;if(e.type===`literal`)return new Ou(e.number-t.number)}return t.type===`binary`&&t.op===`-`&&e.type===`literal`&&e.number===1&&t.arg1.type===`literal`&&t.arg1.number===1?t.arg2:new ku(`-`,e,t,e.min-t.max,e.max-t.min)}function Lu(e,t){return e.min>=t?new Ou(t):e.max<=t?e:new Au(e,t)}var Ru=class{compile(e,t,n){let r=[],i=[],a=t.length>>1,o=n.length>>1,s,c,l,u,d,f,p,m,h=0;for(let e=0;e<a;e++)r.push(new Du(e,t[2*e],t[2*e+1]));for(let t=0,n=e.length;t<n;t++)if(m=e[t],typeof m!=`number`)switch(m){case`add`:if(r.length<2)return null;u=r.pop(),l=r.pop(),r.push(Pu(l,u));break;case`cvr`:if(r.length<1)return null;break;case`mul`:if(r.length<2)return null;u=r.pop(),l=r.pop(),r.push(Fu(l,u));break;case`sub`:if(r.length<2)return null;u=r.pop(),l=r.pop(),r.push(Iu(l,u));break;case`exch`:if(r.length<2)return null;d=r.pop(),f=r.pop(),r.push(d,f);break;case`pop`:if(r.length<1)return null;r.pop();break;case`index`:if(r.length<1||(l=r.pop(),l.type!==`literal`)||(s=l.number,s<0||!Number.isInteger(s)||r.length<s))return null;if(d=r[r.length-s-1],d.type===`literal`||d.type===`var`){r.push(d);break}p=new ju(h++,d.min,d.max),r[r.length-s-1]=p,r.push(p),i.push(new Mu(p,d));break;case`dup`:if(r.length<1)return null;if(typeof e[t+1]==`number`&&e[t+2]===`gt`&&e[t+3]===t+7&&e[t+4]===`jz`&&e[t+5]===`pop`&&e[t+6]===e[t+1]){l=r.pop(),r.push(Lu(l,e[t+1])),t+=6;break}if(d=r.at(-1),d.type===`literal`||d.type===`var`){r.push(d);break}p=new ju(h++,d.min,d.max),r[r.length-1]=p,r.push(p),i.push(new Mu(p,d));break;case`roll`:if(r.length<2||(u=r.pop(),l=r.pop(),u.type!==`literal`||l.type!==`literal`)||(c=u.number,s=l.number,s<=0||!Number.isInteger(s)||!Number.isInteger(c)||r.length<s))return null;if(c=(c%s+s)%s,c===0)break;r.push(...r.splice(r.length-s,s-c));break;default:return null}else r.push(new Ou(m));if(r.length!==o)return null;let g=[];for(let e of i){let t=new Nu;e.visit(t),g.push(t.toString())}for(let e=0,t=r.length;e<t;e++){let t=r[e],i=new Nu;t.visit(i);let a=n[2*e],o=n[2*e+1],s=[i.toString()];a>t.min&&(s.unshift(`Math.max(`,a,`, `),s.push(`)`)),o<t.max&&(s.unshift(`Math.min(`,o,`, `),s.push(`)`)),s.unshift(`dest[destOffset + `,e,`] = `),s.push(`;`),g.push(s.join(``))}return g.join(`
5
5
  `)}},zu=`BN.BN.BN.BN.BN.BN.BN.BN.BN.S.B.S.WS.B.BN.BN.BN.BN.BN.BN.BN.BN.BN.BN.BN.BN.BN.BN.B.B.B.S.WS.ON.ON.ET.ET.ET.ON.ON.ON.ON.ON.ES.CS.ES.CS.CS.EN.EN.EN.EN.EN.EN.EN.EN.EN.EN.CS.ON.ON.ON.ON.ON.ON.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.ON.ON.ON.ON.ON.ON.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.ON.ON.ON.ON.BN.BN.BN.BN.BN.BN.B.BN.BN.BN.BN.BN.BN.BN.BN.BN.BN.BN.BN.BN.BN.BN.BN.BN.BN.BN.BN.BN.BN.BN.BN.BN.BN.CS.ON.ET.ET.ET.ET.ON.ON.ON.ON.L.ON.ON.BN.ON.ON.ET.ET.EN.EN.ON.L.ON.ON.ON.EN.L.ON.ON.ON.ON.ON.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.ON.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.ON.L.L.L.L.L.L.L.L`.split(`.`),Bu=`AN.AN.AN.AN.AN.AN.ON.ON.AL.ET.ET.AL.CS.AL.ON.ON.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.AL.AL..AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.AN.AN.AN.AN.AN.AN.AN.AN.AN.AN.ET.AN.AN.AL.AL.AL.NSM.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.NSM.NSM.NSM.NSM.NSM.NSM.NSM.AN.ON.NSM.NSM.NSM.NSM.NSM.NSM.AL.AL.NSM.NSM.ON.NSM.NSM.NSM.NSM.AL.AL.EN.EN.EN.EN.EN.EN.EN.EN.EN.EN.AL.AL.AL.AL.AL.AL`.split(`.`);function Vu(e){return!!(1&e)}function Hu(e){return!(1&e)}function Uu(e,t,n){let r,i;for(r=t,i=e.length;r<i;++r)if(e[r]!==n)return r;return r}function Wu(e,t,n){for(let r=t,i=n-1;r<i;++r,--i){let t=e[r];e[r]=e[i],e[i]=t}}function Gu(e,t,n=!1){let r=`ltr`;return n?r=`ttb`:t||(r=`rtl`),{str:e,dir:r}}var Ku=[],qu=[];function Ju(e,t=-1,n=!1){let r=!0,i=e.length;if(i===0||n)return Gu(e,r,n);Ku.length=i,qu.length=i;let a,o,s=0;for(a=0;a<i;++a){Ku[a]=e.charAt(a);let t=e.charCodeAt(a),n=`L`;t<=255?n=zu[t]:1424<=t&&t<=1524?n=`R`:1536<=t&&t<=1791?(n=Bu[255&t],n||N(`Bidi: invalid Unicode character `+t.toString(16))):(1792<=t&&t<=2220||64336<=t&&t<=65023||65136<=t&&t<=65279)&&(n=`AL`),n!==`R`&&n!==`AL`&&n!==`AN`||s++,qu[a]=n}if(s===0)return r=!0,Gu(e,r);t===-1&&(s/i<.3&&i>4?(r=!0,t=0):(r=!1,t=1));let c=[];for(a=0;a<i;++a)c[a]=t;let l=Vu(t)?`R`:`L`,u=l,d=u,f,p=u;for(a=0;a<i;++a)qu[a]===`NSM`?qu[a]=p:p=qu[a];for(p=u,a=0;a<i;++a)f=qu[a],f===`EN`?qu[a]=p===`AL`?`AN`:`EN`:f!==`R`&&f!==`L`&&f!==`AL`||(p=f);for(a=0;a<i;++a)f=qu[a],f===`AL`&&(qu[a]=`R`);for(a=1;a<i-1;++a)qu[a]===`ES`&&qu[a-1]===`EN`&&qu[a+1]===`EN`&&(qu[a]=`EN`),qu[a]!==`CS`||qu[a-1]!==`EN`&&qu[a-1]!==`AN`||qu[a+1]!==qu[a-1]||(qu[a]=qu[a-1]);for(a=0;a<i;++a)if(qu[a]===`EN`){for(let e=a-1;e>=0&&qu[e]===`ET`;--e)qu[e]=`EN`;for(let e=a+1;e<i&&qu[e]===`ET`;++e)qu[e]=`EN`}for(a=0;a<i;++a)f=qu[a],f!==`WS`&&f!==`ES`&&f!==`ET`&&f!==`CS`||(qu[a]=`ON`);for(p=u,a=0;a<i;++a)f=qu[a],f===`EN`?qu[a]=p===`L`?`L`:`EN`:f!==`R`&&f!==`L`||(p=f);for(a=0;a<i;++a)if(qu[a]===`ON`){let e=Uu(qu,a+1,`ON`),t=u;a>0&&(t=qu[a-1]);let n=d;e+1<i&&(n=qu[e+1]),t!==`L`&&(t=`R`),n!==`L`&&(n=`R`),t===n&&qu.fill(t,a,e),a=e-1}for(a=0;a<i;++a)qu[a]===`ON`&&(qu[a]=l);for(a=0;a<i;++a)f=qu[a],Hu(c[a])?f===`R`?c[a]+=1:f!==`AN`&&f!==`EN`||(c[a]+=2):f!==`L`&&f!==`AN`&&f!==`EN`||(c[a]+=1);let m,h=-1,g=99;for(a=0,o=c.length;a<o;++a)m=c[a],h<m&&(h=m),g>m&&Vu(m)&&(g=m);for(m=h;m>=g;--m){let e=-1;for(a=0,o=c.length;a<o;++a)c[a]<m?e>=0&&(Wu(Ku,e,a),e=-1):e<0&&(e=a);e>=0&&Wu(Ku,e,c.length)}for(a=0,o=Ku.length;a<o;++a){let e=Ku[a];e!==`<`&&e!==`>`||(Ku[a]=``)}return Gu(Ku.join(``),r)}var Yu=class e{#e;#t;#n;static strings=[`fontFamily`,`fontWeight`,`italicAngle`];static write(t){let n=new TextEncoder,r={},i=0;for(let a of e.strings){let e=n.encode(t[a]);r[a]=e,i+=4+e.length}let a=new ArrayBuffer(i),o=new Uint8Array(a),s=new DataView(a),c=0;for(let t of e.strings){let e=r[t],n=e.length;s.setUint32(c,n),o.set(e,c+4),c+=4+n}return _n(c===a.byteLength,`CssFontInfo.write: Buffer overflow`),a}constructor(e){this.#e=e,this.#t=new DataView(this.#e),this.#n=new TextDecoder}#r(t){_n(t<e.strings.length,`Invalid string index`);let n=0;for(let e=0;e<t;e++)n+=this.#t.getUint32(n)+4;let r=this.#t.getUint32(n);return this.#n.decode(new Uint8Array(this.#e,n+4,r))}get fontFamily(){return this.#r(0)}get fontWeight(){return this.#r(1)}get italicAngle(){return this.#r(2)}},Xu=class e{#e;#t;#n;static strings=[`css`,`loadedName`,`baseFontName`,`src`];static write(t){let n=new TextEncoder,r={},i=0;for(let a of e.strings){let e=n.encode(t[a]);r[a]=e,i+=4+e.length}i+=4;let a,o,s=1+i;t.style&&(a=n.encode(t.style.style),o=n.encode(t.style.weight),s+=4+a.length+4+o.length);let c=new ArrayBuffer(s),l=new Uint8Array(c),u=new DataView(c),d=0;u.setUint8(d++,+!!t.guessFallback),u.setUint32(d,0),d+=4,i=0;for(let t of e.strings){let e=r[t],n=e.length;i+=4+n,u.setUint32(d,n),l.set(e,d+4),d+=4+n}return u.setUint32(d-i-4,i),t.style&&(u.setUint32(d,a.length),l.set(a,d+4),d+=4+a.length,u.setUint32(d,o.length),l.set(o,d+4),d+=4+o.length),_n(d<=c.byteLength,`SubstitionInfo.write: Buffer overflow`),c.transferToFixedLength(d)}constructor(e){this.#e=e,this.#t=new DataView(this.#e),this.#n=new TextDecoder}get guessFallback(){return this.#t.getUint8(0)!==0}#r(t){_n(t<e.strings.length,`Invalid string index`);let n=5;for(let e=0;e<t;e++)n+=this.#t.getUint32(n)+4;let r=this.#t.getUint32(n);return this.#n.decode(new Uint8Array(this.#e,n+4,r))}get css(){return this.#r(0)}get loadedName(){return this.#r(1)}get baseFontName(){return this.#r(2)}get src(){return this.#r(3)}get style(){let e=1;e+=4+this.#t.getUint32(e);let t=this.#t.getUint32(e),n=this.#n.decode(new Uint8Array(this.#e,e+4,t));e+=4+t;let r=this.#t.getUint32(e);return{style:n,weight:this.#n.decode(new Uint8Array(this.#e,e+4,r))}}},Zu=class e{static bools=[`black`,`bold`,`disableFontFace`,`fontExtraProperties`,`isInvalidPDFjsFont`,`isType3Font`,`italic`,`missingFile`,`remeasure`,`vertical`];static numbers=[`ascent`,`defaultWidth`,`descent`];static strings=[`fallbackName`,`loadedName`,`mimetype`,`name`];static#e=Math.ceil(2*this.bools.length/8);static#t=this.#e+8*this.numbers.length;static#n=this.#t+1+8;static#r=this.#n+1+48;static#i=this.#r+1+6;#a;#o;#s;constructor({data:e,extra:t}){this.#a=e,this.#o=new TextDecoder,this.#s=new DataView(this.#a),t&&Object.assign(this,t)}#c(t){_n(t<e.bools.length,`Invalid boolean index`);let n=Math.floor(t/4),r=2*t%8,i=this.#s.getUint8(n)>>r&3;return i===0?void 0:i===2}get black(){return this.#c(0)}get bold(){return this.#c(1)}get disableFontFace(){return this.#c(2)}get fontExtraProperties(){return this.#c(3)}get isInvalidPDFjsFont(){return this.#c(4)}get isType3Font(){return this.#c(5)}get italic(){return this.#c(6)}get missingFile(){return this.#c(7)}get remeasure(){return this.#c(8)}get vertical(){return this.#c(9)}#l(t){return _n(t<e.numbers.length,`Invalid number index`),this.#s.getFloat64(e.#e+8*t)}get ascent(){return this.#l(0)}get defaultWidth(){return this.#l(1)}get descent(){return this.#l(2)}get bbox(){let t=e.#t;if(this.#s.getUint8(t)===0)return;t+=1;let n=[];for(let e=0;e<4;e++)n.push(this.#s.getInt16(t,!0)),t+=2;return n}get fontMatrix(){let t=e.#n;if(this.#s.getUint8(t)===0)return;t+=1;let n=[];for(let e=0;e<6;e++)n.push(this.#s.getFloat64(t,!0)),t+=8;return n}get defaultVMetrics(){let t=e.#r;if(this.#s.getUint8(t)===0)return;t+=1;let n=[];for(let e=0;e<3;e++)n.push(this.#s.getInt16(t,!0)),t+=2;return n}#u(t){_n(t<e.strings.length,`Invalid string index`);let n=e.#i+4;for(let e=0;e<t;e++)n+=this.#s.getUint32(n)+4;let r=this.#s.getUint32(n),i=new Uint8Array(r);return i.set(new Uint8Array(this.#a,n+4,r)),this.#o.decode(i)}get fallbackName(){return this.#u(0)}get loadedName(){return this.#u(1)}get mimetype(){return this.#u(2)}get name(){return this.#u(3)}get data(){let t=e.#i;t+=4+this.#s.getUint32(t),t+=4+this.#s.getUint32(t),t+=4+this.#s.getUint32(t);let n=this.#s.getUint32(t);if(n!==0)return new Uint8Array(this.#a,t+4,n)}clearData(){let t=e.#i;t+=4+this.#s.getUint32(t),t+=4+this.#s.getUint32(t),t+=4+this.#s.getUint32(t);let n=this.#s.getUint32(t);new Uint8Array(this.#a,t+4,n).fill(0),this.#s.setUint32(t,0)}get cssFontInfo(){let t=e.#i;t+=4+this.#s.getUint32(t),t+=4+this.#s.getUint32(t);let n=this.#s.getUint32(t);if(n===0)return null;let r=new Uint8Array(n);return r.set(new Uint8Array(this.#a,t+4,n)),new Yu(r.buffer)}get systemFontInfo(){let t=e.#i;t+=4+this.#s.getUint32(t);let n=this.#s.getUint32(t);if(n===0)return null;let r=new Uint8Array(n);return r.set(new Uint8Array(this.#a,t+4,n)),new Xu(r.buffer)}static write(t){let n=t.systemFontInfo?Xu.write(t.systemFontInfo):null,r=t.cssFontInfo?Yu.write(t.cssFontInfo):null,i=new TextEncoder,a={},o=0;for(let n of e.strings)a[n]=i.encode(t[n]),o+=4+a[n].length;let s=e.#i+4+o+4+(n?n.byteLength:0)+4+(r?r.byteLength:0)+4+(t.data?t.data.length:0),c=new ArrayBuffer(s),l=new Uint8Array(c),u=new DataView(c),d=0,f=e.bools.length,p=0,m=0;for(let n=0;n<f;n++){let r=t[e.bools[n]];p|=(r===void 0?0:r?2:1)<<m,m+=2,m!==8&&n!==f-1||(u.setUint8(d++,p),p=0,m=0)}_n(d===e.#e,`FontInfo.write: Boolean properties offset mismatch`);for(let n of e.numbers)u.setFloat64(d,t[n]),d+=8;if(_n(d===e.#t,`FontInfo.write: Number properties offset mismatch`),t.bbox){u.setUint8(d++,4);for(let e of t.bbox)u.setInt16(d,e,!0),d+=2}else u.setUint8(d++,0),d+=8;if(_n(d===e.#n,`FontInfo.write: BBox properties offset mismatch`),t.fontMatrix){u.setUint8(d++,6);for(let e of t.fontMatrix)u.setFloat64(d,e,!0),d+=8}else u.setUint8(d++,0),d+=48;if(_n(d===e.#r,`FontInfo.write: FontMatrix properties offset mismatch`),t.defaultVMetrics){u.setUint8(d++,1);for(let e of t.defaultVMetrics)u.setInt16(d,e,!0),d+=2}else u.setUint8(d++,0),d+=6;_n(d===e.#i,`FontInfo.write: DefaultVMetrics properties offset mismatch`),u.setUint32(e.#i,0),d+=4;for(let t of e.strings){let e=a[t],n=e.length;u.setUint32(d,n),l.set(e,d+4),d+=4+n}if(u.setUint32(e.#i,d-e.#i-4),n){let e=n.byteLength;u.setUint32(d,e),_n(d+4+e<=c.byteLength,`FontInfo.write: Buffer overflow at systemFontInfo`),l.set(new Uint8Array(n),d+4),d+=4+e}else u.setUint32(d,0),d+=4;if(r){let e=r.byteLength;u.setUint32(d,e),_n(d+4+e<=c.byteLength,`FontInfo.write: Buffer overflow at cssFontInfo`),l.set(new Uint8Array(r),d+4),d+=4+e}else u.setUint32(d,0),d+=4;return t.data===void 0?(u.setUint32(d,0),d+=4):(u.setUint32(d,t.data.length),l.set(t.data,d+4),d+=4+t.data.length),_n(d<=c.byteLength,`FontInfo.write: Buffer overflow`),c.transferToFixedLength(d)}},Qu={style:`normal`,weight:`normal`},$u={style:`normal`,weight:`bold`},ed={style:`italic`,weight:`normal`},td={style:`italic`,weight:`bold`},nd=new Map([[`Times-Roman`,{local:[`Times New Roman`,`Times-Roman`,`Times`,`Liberation Serif`,`Nimbus Roman`,`Nimbus Roman L`,`Tinos`,`Thorndale`,`TeX Gyre Termes`,`FreeSerif`,`Linux Libertine O`,`Libertinus Serif`,`DejaVu Serif`,`Bitstream Vera Serif`,`Ubuntu`],style:Qu,ultimate:`serif`}],[`Times-Bold`,{alias:`Times-Roman`,style:$u,ultimate:`serif`}],[`Times-Italic`,{alias:`Times-Roman`,style:ed,ultimate:`serif`}],[`Times-BoldItalic`,{alias:`Times-Roman`,style:td,ultimate:`serif`}],[`Helvetica`,{local:[`Helvetica`,`Helvetica Neue`,`Arial`,`Arial Nova`,`Liberation Sans`,`Arimo`,`Nimbus Sans`,`Nimbus Sans L`,`A030`,`TeX Gyre Heros`,`FreeSans`,`DejaVu Sans`,`Albany`,`Bitstream Vera Sans`,`Arial Unicode MS`,`Microsoft Sans Serif`,`Apple Symbols`,`Cantarell`],path:`LiberationSans-Regular.ttf`,style:Qu,ultimate:`sans-serif`}],[`Helvetica-Bold`,{alias:`Helvetica`,path:`LiberationSans-Bold.ttf`,style:$u,ultimate:`sans-serif`}],[`Helvetica-Oblique`,{alias:`Helvetica`,path:`LiberationSans-Italic.ttf`,style:ed,ultimate:`sans-serif`}],[`Helvetica-BoldOblique`,{alias:`Helvetica`,path:`LiberationSans-BoldItalic.ttf`,style:td,ultimate:`sans-serif`}],[`Courier`,{local:[`Courier`,`Courier New`,`Liberation Mono`,`Nimbus Mono`,`Nimbus Mono L`,`Cousine`,`Cumberland`,`TeX Gyre Cursor`,`FreeMono`,`Linux Libertine Mono O`,`Libertinus Mono`],style:Qu,ultimate:`monospace`}],[`Courier-Bold`,{alias:`Courier`,style:$u,ultimate:`monospace`}],[`Courier-Oblique`,{alias:`Courier`,style:ed,ultimate:`monospace`}],[`Courier-BoldOblique`,{alias:`Courier`,style:td,ultimate:`monospace`}],[`ArialBlack`,{local:[`Arial Black`],style:{style:`normal`,weight:`900`},fallback:`Helvetica-Bold`}],[`ArialBlack-Bold`,{alias:`ArialBlack`}],[`ArialBlack-Italic`,{alias:`ArialBlack`,style:{style:`italic`,weight:`900`},fallback:`Helvetica-BoldOblique`}],[`ArialBlack-BoldItalic`,{alias:`ArialBlack-Italic`}],[`ArialNarrow`,{local:[`Arial Narrow`,`Liberation Sans Narrow`,`Helvetica Condensed`,`Nimbus Sans Narrow`,`TeX Gyre Heros Cn`],style:Qu,fallback:`Helvetica`}],[`ArialNarrow-Bold`,{alias:`ArialNarrow`,style:$u,fallback:`Helvetica-Bold`}],[`ArialNarrow-Italic`,{alias:`ArialNarrow`,style:ed,fallback:`Helvetica-Oblique`}],[`ArialNarrow-BoldItalic`,{alias:`ArialNarrow`,style:td,fallback:`Helvetica-BoldOblique`}],[`Calibri`,{local:[`Calibri`,`Carlito`],style:Qu,fallback:`Helvetica`}],[`Calibri-Bold`,{alias:`Calibri`,style:$u,fallback:`Helvetica-Bold`}],[`Calibri-Italic`,{alias:`Calibri`,style:ed,fallback:`Helvetica-Oblique`}],[`Calibri-BoldItalic`,{alias:`Calibri`,style:td,fallback:`Helvetica-BoldOblique`}],[`Wingdings`,{local:[`Wingdings`,`URW Dingbats`],style:Qu}],[`Wingdings-Regular`,{alias:`Wingdings`}],[`Wingdings-Bold`,{alias:`Wingdings`}]]),rd=new Map([[`Arial-Black`,`ArialBlack`]]);function id(e){let t=new Set(`thin.extralight.ultralight.demilight.semilight.light.book.regular.normal.medium.demibold.semibold.bold.extrabold.ultrabold.black.heavy.extrablack.ultrablack.roman.italic.oblique.ultracondensed.extracondensed.condensed.semicondensed.normal.semiexpanded.expanded.extraexpanded.ultraexpanded.bolditalic`.split(`.`));return e.split(/[- ,+]+/g).filter(e=>!t.has(e.toLowerCase())).join(` `)}function ad({alias:e,local:t,path:n,fallback:r,style:i,ultimate:a},o,s,c=!0,l=!0,u=``){let d={style:null,ultimate:null};if(t){let e=u?` ${u}`:``;for(let n of t)o.push(`local(${n}${e})`)}if(e){let t=nd.get(e),a=u||function(e){switch(e){case $u:return`Bold`;case ed:return`Italic`;case td:return`Bold Italic`;default:if(e?.weight===`bold`)return`Bold`;if(e?.style===`italic`)return`Italic`}return``}(i);Object.assign(d,ad(t,o,s,c&&!r,l&&!n,a))}if(i&&(d.style=i),a&&(d.ultimate=a),c&&r){let{ultimate:e}=ad(nd.get(r),o,s,c,l&&!n,u);d.ultimate||=e}return l&&n&&s&&o.push(`url(${s}${n})`),d}function od(e,t,n,r,i,a){if(r.startsWith(`InvalidPDFjsFont_`))return null;a!==`TrueType`&&a!==`Type1`||!/^[A-Z]{6}\+/.test(r)||(r=r.slice(7));let o=r=is(r),s=e.get(o);if(s)return s;let c=nd.get(r);if(!c){for(let[e,t]of rd)if(r.startsWith(e)){r=`${t}${r.substring(e.length)}`,c=nd.get(r);break}}let l=!1;c||(c=nd.get(i),l=!0);let u=`${t.getDocId()}_s${t.createFontId()}`;if(!c){if(!Fr(r))return N(`Cannot substitute the font because of its name: ${r}`),e.set(o,null),null;let t=/bold/gi.test(r),n=/oblique|italic/gi.test(r),i=t&&n&&td||t&&$u||n&&ed||Qu;return s={css:`"${id(r)}",${u}`,guessFallback:!0,loadedName:u,baseFontName:r,src:`local(${r})`,style:i},e.set(o,s),s}let d=[];l&&Fr(r)&&d.push(`local(${r})`);let{style:f,ultimate:p}=ad(c,d,n),m=p===null,h=m?``:`,${p}`;return s={css:`"${id(r)}",${u}${h}`,guessFallback:m,loadedName:u,baseFontName:r,src:d.join(`,`),style:f},e.set(o,s),s}var sd=3285377520,cd=4294901760,ld=65535,ud=class{constructor(e){this.h1=e?4294967295&e:sd,this.h2=e?4294967295&e:sd}update(e){let t,n;if(typeof e==`string`){t=new Uint8Array(2*e.length),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++]=255&i)}}else{if(!ArrayBuffer.isView(e))throw Error(`Invalid data format, must be a string or TypedArray.`);t=e.slice(),n=t.byteLength}let r=n>>2,i=n-4*r,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++)1&e?(o=a[e],o=o*u&cd|o*f&ld,o=o<<15|o>>>17,o=o*d&cd|o*p&ld,c^=o,c=c<<13|c>>>19,c=5*c+3864292196):(s=a[e],s=s*u&cd|s*f&ld,s=s<<15|s>>>17,s=s*d&cd|s*p&ld,l^=s,l=l<<13|l>>>19,l=5*l+3864292196);switch(o=0,i){case 3:o^=t[4*r+2]<<16;case 2:o^=t[4*r+1]<<8;case 1:o^=t[4*r],o=o*u&cd|o*f&ld,o=o<<15|o>>>17,o=o*d&cd|o*p&ld,1&r?c^=o:l^=o}this.h1=c,this.h2=l}hexdigest(){let e=this.h1,t=this.h2;return e^=t>>>1,e=3981806797*e&cd|36045*e&ld,t=4283543511*t&cd|(2950163797*(t<<16|e>>>16)&cd)>>>16,e^=t>>>1,e=444984403*e&cd|60499*e&ld,t=3301882366*t&cd|(3120437893*(t<<16|e>>>16)&cd)>>>16,e^=t>>>1,(e>>>0).toString(16).padStart(8,`0`)+(t>>>0).toString(16).padStart(8,`0`)}};function dd(e,t,n,r,i,a){let o=i*a,s;s=t<=8?new Uint8Array(o):t<=16?new Uint16Array(o):new Uint32Array(o);let c=n/i,l=r/a,u,d,f,p,m=0,h=new Uint16Array(i),g=n;for(u=0;u<i;u++)h[u]=Math.floor(u*c);for(u=0;u<a;u++)for(f=Math.floor(u*l)*g,d=0;d<i;d++)p=f+h[d],s[m++]=e[p];return s}var fd=class e{constructor({xref:t,res:n,image:r,isInline:i=!1,smask:a=null,mask:o=null,isMask:s=!1,pdfFunctionFactory:c,globalColorSpaceCache:l,localColorSpaceCache:u}){this.image=r;let d=r.dict,f=d.get(`F`,`Filter`),p;if(f instanceof I)p=f.name;else if(Array.isArray(f)){let e=t.fetchIfRef(f[0]);e instanceof I&&(p=e.name)}switch(p){case`JPXDecode`:({width:r.width,height:r.height,componentsCount:r.numComps,bitsPerComponent:r.bitsPerComponent}=Qi.parseImageProperties(r.stream)),r.stream.reset();let e=Ci.getReducePowerForJPX(r.width,r.height,r.numComps);if(this.jpxDecoderOptions={numComponents:0,isIndexedColormap:!1,smaskInData:d.has(`SMaskInData`),reducePower:e},e){let t=2**e;r.width=Math.ceil(r.width/t),r.height=Math.ceil(r.height/t)}break;case`JBIG2Decode`:r.bitsPerComponent=1,r.numComps=1}let m=d.get(`W`,`Width`),h=d.get(`H`,`Height`);if(Number.isInteger(r.width)&&r.width>0&&Number.isInteger(r.height)&&r.height>0&&(r.width!==m||r.height!==h))N(`PDFImage - using the Width/Height of the image data, rather than the image dictionary.`),m=r.width,h=r.height;else{let e=typeof m==`number`&&m>0,t=typeof h==`number`&&h>0;if(!e||!t){if(!r.fallbackDims)throw new F(`Invalid image width: ${m} or height: ${h}`);N(`PDFImage - using the Width/Height of the parent image, for SMask/Mask data.`),e||(m=r.fallbackDims.width),t||(h=r.fallbackDims.height)}}this.width=m,this.height=h,this.interpolate=d.get(`I`,`Interpolate`),this.imageMask=d.get(`IM`,`ImageMask`)||!1,this.matte=d.get(`Matte`)||!1;let g=r.bitsPerComponent;if(!g&&(g=d.get(`BPC`,`BitsPerComponent`),!g)){if(!this.imageMask)throw new F(`Bits per component missing in image: ${this.imageMask}`);g=1}if(this.bpc=g,!this.imageMask){let e=d.getRaw(`CS`)||d.getRaw(`ColorSpace`),a=!!e;if(a)this.jpxDecoderOptions?.smaskInData&&(e=I.get(`DeviceRGBA`));else if(this.jpxDecoderOptions)e=I.get(`DeviceRGBA`);else switch(r.numComps){case 1:e=I.get(`DeviceGray`);break;case 3:e=I.get(`DeviceRGB`);break;case 4:e=I.get(`DeviceCMYK`);break;default:throw Error(`Images with ${r.numComps} color components not supported.`)}this.colorSpace=Di.parse({cs:e,xref:t,resources:i?n:null,pdfFunctionFactory:c,globalColorSpaceCache:l,localColorSpaceCache:u}),this.numComps=this.colorSpace.numComps,this.jpxDecoderOptions&&(this.jpxDecoderOptions.numComponents=a?this.numComps:0,this.jpxDecoderOptions.isIndexedColormap=this.colorSpace.name===`Indexed`)}if(this.decode=d.getArray(`D`,`Decode`),this.needsDecode=!1,this.decode&&(this.colorSpace&&!this.colorSpace.isDefaultDecode(this.decode,g)||s&&!ni.isDefaultDecode(this.decode,1))){this.needsDecode=!0;let e=(1<<g)-1;this.decodeCoefficients=[],this.decodeAddends=[];let t=this.colorSpace?.name===`Indexed`;for(let n=0,r=0;n<this.decode.length;n+=2,++r){let i=this.decode[n],a=this.decode[n+1];this.decodeCoefficients[r]=t?(a-i)/e:a-i,this.decodeAddends[r]=t?i:e*i}}a?(a.fallbackDims??={width:m,height:h},this.smask=new e({xref:t,res:n,image:a,isInline:i,pdfFunctionFactory:c,globalColorSpaceCache:l,localColorSpaceCache:u})):o&&(o instanceof tr?o.dict.get(`IM`,`ImageMask`)?(o.fallbackDims??={width:m,height:h},this.mask=new e({xref:t,res:n,image:o,isInline:i,isMask:!0,pdfFunctionFactory:c,globalColorSpaceCache:l,localColorSpaceCache:u})):N(`Ignoring /Mask in image without /ImageMask.`):this.mask=o)}static async buildImage({xref:t,res:n,image:r,isInline:i=!1,pdfFunctionFactory:a,globalColorSpaceCache:o,localColorSpaceCache:s}){let c=r,l=null,u=null,d=r.dict.get(`SMask`),f=r.dict.get(`Mask`);return d?d instanceof tr?l=d:N(`Unsupported /SMask format.`):f&&(f instanceof tr||Array.isArray(f)?u=f:N(`Unsupported /Mask format.`)),new e({xref:t,res:n,image:c,isInline:i,smask:l,mask:u,pdfFunctionFactory:a,globalColorSpaceCache:o,localColorSpaceCache:s})}static async createMask({image:e,isOffscreenCanvasSupported:t=!1}){let{dict:n}=e,r=n.get(`W`,`Width`),i=n.get(`H`,`Height`),a=n.get(`I`,`Interpolate`),o=n.getArray(`D`,`Decode`)?.[0]>0,s=(r+7>>3)*i,c=e.getBytes(s),l=r===1&&i===1&&o===(c.length===0||!!(128&c[0]));if(l)return{isSingleOpaquePixel:l};if(t){if(Ci.needsToBeResized(r,i)){let e=new Uint8ClampedArray(r*i*4);return Si({src:c,dest:e,width:r,height:i,nonBlackColor:0,inverseDecode:o}),Ci.createImage({kind:T,data:e,width:r,height:i,interpolate:a})}let e=new OffscreenCanvas(r,i),t=e.getContext(`2d`),n=t.createImageData(r,i);return Si({src:c,dest:n.data,width:r,height:i,nonBlackColor:0,inverseDecode:o}),t.putImageData(n,0,0),{data:null,width:r,height:i,interpolate:a,bitmap:e.transferToImageBitmap()}}let u=c.byteLength,d;if(e instanceof Ti&&(!o||s===u)?d=c:o?(d=new Uint8Array(s),d.set(c),d.fill(255,u)):d=new Uint8Array(c),o)for(let e=0;e<u;e++)d[e]^=255;return{data:d,width:r,height:i,interpolate:a}}get drawWidth(){return Math.max(this.width,this.smask?.width||0,this.mask?.width||0)}get drawHeight(){return Math.max(this.height,this.smask?.height||0,this.mask?.height||0)}decodeBuffer(e){let t=this.bpc,n=this.numComps,r=this.decodeAddends,i=this.decodeCoefficients,a=(1<<t)-1,o,s;if(t===1){for(o=0,s=e.length;o<s;o++)e[o]=+!e[o];return}let c=0;for(o=0,s=this.width*this.height;o<s;o++)for(let t=0;t<n;t++)e[c]=Bn(r[t]+e[c]*i[t],0,a),c++}getComponents(e){let t=this.bpc;if(t===8)return e;let n=this.width,r=this.height,i=this.numComps,a=n*r*i,o,s=0;o=t<=8?new Uint8Array(a):t<=16?new Uint16Array(a):new Uint32Array(a);let c=n*i,l=(1<<t)-1,u,d,f=0;if(t===1){let t,n,i;for(let a=0;a<r;a++){for(n=f+(-8&c),i=f+c;f<n;)d=e[s++],o[f]=d>>7&1,o[f+1]=d>>6&1,o[f+2]=d>>5&1,o[f+3]=d>>4&1,o[f+4]=d>>3&1,o[f+5]=d>>2&1,o[f+6]=d>>1&1,o[f+7]=1&d,f+=8;if(f<i)for(d=e[s++],t=128;f<i;)o[f++]=+!!(d&t),t>>=1}}else{let n=0;for(d=0,f=0,u=a;f<u;++f){for(f%c===0&&(d=0,n=0);n<t;)d=d<<8|e[s++],n+=8;let r=n-t,i=d>>r;i<0?i=0:i>l&&(i=l),o[f]=i,d&=(1<<r)-1,n=r}}return o}async fillOpacity(t,n,r,i,a){let o=this.smask,s=this.mask,c,l,u,d,f,p;if(o)l=o.width,u=o.height,c=new Uint8ClampedArray(l*u),await o.fillGrayBuffer(c),l===n&&u===r||(c=dd(c,o.bpc,l,u,n,r));else if(s)if(s instanceof e){for(l=s.width,u=s.height,c=new Uint8ClampedArray(l*u),s.numComps=1,await s.fillGrayBuffer(c),d=0,f=l*u;d<f;++d)c[d]=255-c[d];l===n&&u===r||(c=dd(c,s.bpc,l,u,n,r))}else{if(!Array.isArray(s))throw new F(`Unknown mask format.`);{c=new Uint8ClampedArray(n*r);let e=this.numComps;for(d=0,f=n*r;d<f;++d){let t=0,n=d*e;for(p=0;p<e;++p){let e=a[n+p],r=2*p;if(e<s[r]||e>s[r+1]){t=255;break}}c[d]=t}}}if(c)for(d=0,p=3,f=n*i;d<f;++d,p+=4)t[p]=c[d];else for(d=0,p=3,f=n*i;d<f;++d,p+=4)t[p]=255}undoPreblend(e,t,n){let r=this.smask?.matte;if(!r)return;let i=this.colorSpace.getRgb(r,0),a=i[0],o=i[1],s=i[2],c=t*n*4;for(let t=0;t<c;t+=4){let n=e[t+3];if(n===0){e[t]=255,e[t+1]=255,e[t+2]=255;continue}let r=255/n;e[t]=(e[t]-a)*r+a,e[t+1]=(e[t+1]-o)*r+o,e[t+2]=(e[t+2]-s)*r+s}}async createImageData(e=!1,t=!1){let n=this.drawWidth,r=this.drawHeight,i={width:n,height:r,interpolate:this.interpolate,kind:0,data:null},a=this.numComps,o=this.width,s=this.height,c=this.bpc,l=o*a*c+7>>3,u=t&&Ci.needsToBeResized(n,r);if(!this.smask&&!this.mask&&this.colorSpace.name===`DeviceRGBA`){i.kind=T;let e=i.data=await this.getImageBytes(s*o*4,{});return t?u?Ci.createImage(i,!1):this.createBitmap(T,n,r,e):i}if(!e){let e;if(this.colorSpace.name===`DeviceGray`&&c===1?e=C:this.colorSpace.name!==`DeviceRGB`||c!==8||this.needsDecode||(e=w),e&&!this.smask&&!this.mask&&n===o&&r===s){let a=await this.#e(o,s);if(a)return a;let c=await this.getImageBytes(s*l,{});if(t)return u?Ci.createImage({data:c,kind:e,width:n,height:r,interpolate:this.interpolate},this.needsDecode):this.createBitmap(e,o,s,c);if(i.kind=e,i.data=c,this.needsDecode){_n(e===C,`PDFImage.createImageData: The image must be grayscale.`);let t=i.data;for(let e=0,n=t.length;e<n;e++)t[e]^=255}return i}if(this.image instanceof Xi&&!this.smask&&!this.mask&&!this.needsDecode){let e=s*l;if(t&&!u){let t=!1;switch(this.colorSpace.name){case`DeviceGray`:e*=4,t=!0;break;case`DeviceRGB`:e=e/3*4,t=!0;break;case`DeviceCMYK`:t=!0}if(t){let t=await this.#e(n,r);if(t)return t;let i=await this.getImageBytes(e,{drawWidth:n,drawHeight:r,forceRGBA:!0});return this.createBitmap(T,n,r,i)}}else switch(this.colorSpace.name){case`DeviceGray`:e*=3;case`DeviceRGB`:case`DeviceCMYK`:return i.kind=w,i.data=await this.getImageBytes(e,{drawWidth:n,drawHeight:r,forceRGB:!0}),u?Ci.createImage(i):i}}}let d=await this.getImageBytes(s*l,{internal:!0}),f=0|d.length/l*r/s,p=this.getComponents(d),m,h,g,_,v,y;return t&&!u&&(g=new OffscreenCanvas(n,r),_=g.getContext(`2d`),v=_.createImageData(n,r),y=v.data),i.kind=T,e||this.smask||this.mask?(t&&!u||(y=new Uint8ClampedArray(n*r*4)),m=1,h=!0,await this.fillOpacity(y,n,r,f,p)):(!t||u?(i.kind=w,y=new Uint8ClampedArray(n*r*3),m=0):(new Uint32Array(y.buffer).fill(kn.isLittleEndian?4278190080:255),m=1),h=!1),this.needsDecode&&this.decodeBuffer(p),this.colorSpace.fillRgb(y,o,s,n,r,f,c,p,m),h&&this.undoPreblend(y,n,f),t&&!u?(_.putImageData(v,0,0),{data:null,width:n,height:r,bitmap:g.transferToImageBitmap(),interpolate:this.interpolate}):(i.data=y,u?Ci.createImage(i):i)}async fillGrayBuffer(e){let t=this.numComps;if(t!==1)throw new F(`Reading gray scale from a color image: ${t}`);let n=this.width,r=this.height,i=this.bpc,a=n*t*i+7>>3,o=await this.getImageBytes(r*a,{internal:!0}),s=this.getComponents(o),c,l;if(i===1){if(l=n*r,this.needsDecode)for(c=0;c<l;++c)e[c]=s[c]-1&255;else for(c=0;c<l;++c)e[c]=255&-s[c];return}this.needsDecode&&this.decodeBuffer(s),l=n*r;let u=255/((1<<i)-1);for(c=0;c<l;++c)e[c]=u*s[c]}createBitmap(e,t,n,r){let i=new OffscreenCanvas(t,n),a=i.getContext(`2d`),o;return e===T?o=new ImageData(r,t,n):(o=a.createImageData(t,n),xi({kind:e,src:r,dest:new Uint32Array(o.data.buffer),width:t,height:n,inverseDecode:this.needsDecode})),a.putImageData(o,0,0),{data:null,width:t,height:n,bitmap:i.transferToImageBitmap(),interpolate:this.interpolate}}async#e(e,t){let n=await this.image.getTransferableImage();return n?{data:null,width:e,height:t,bitmap:n,interpolate:this.interpolate}:null}async getImageBytes(e,{drawWidth:t,drawHeight:n,forceRGBA:r=!1,forceRGB:i=!1,internal:a=!1}){this.image.reset(),this.image.drawWidth=t||this.width,this.image.drawHeight=n||this.height,this.image.forceRGBA=!!r,this.image.forceRGB=!!i;let o=await this.image.getImageData(e,this.jpxDecoderOptions);return a||this.image instanceof Ti?o:(_n(o instanceof Uint8Array,`PDFImage.getImageBytes: Unsupported "imageBytes" type.`),new Uint8Array(o))}},pd=Object.freeze({maxImageSize:-1,disableFontFace:!1,ignoreErrors:!1,isEvalSupported:!0,isOffscreenCanvasSupported:!1,isImageDecoderSupported:!1,canvasMaxAreaInBytes:-1,fontExtraProperties:!1,useSystemFonts:!0,useWasm:!0,useWorkerFetch:!0,cMapUrl:null,iccUrl:null,standardFontDataUrl:null,wasmUrl:null}),md=1,hd=2,gd=Promise.resolve();function _d(e,t=!1){if(Array.isArray(e)){for(let t of e){let e=_d(t,!0);if(e)return e}return N(`Unsupported blend mode Array: ${e}`),`source-over`}if(!(e instanceof I))return t?null:`source-over`;switch(e.name){case`Normal`:case`Compatible`:return`source-over`;case`Multiply`:return`multiply`;case`Screen`:return`screen`;case`Overlay`:return`overlay`;case`Darken`:return`darken`;case`Lighten`:return`lighten`;case`ColorDodge`:return`color-dodge`;case`ColorBurn`:return`color-burn`;case`HardLight`:return`hard-light`;case`SoftLight`:return`soft-light`;case`Difference`:return`difference`;case`Exclusion`:return`exclusion`;case`Hue`:return`hue`;case`Saturation`:return`saturation`;case`Color`:return`color`;case`Luminosity`:return`luminosity`}return t?null:(N(`Unsupported blend mode: ${e.name}`),`source-over`)}function vd(e,{objId:t,fn:n,args:r,optionalContent:i,hasMask:a}){t&&e.addDependency(t),e.addImageOps(n,r,i,a),n===Yt&&r[0]?.count>0&&r[0].count++}var yd=class e{static TIME_SLOT_DURATION_MS=20;static CHECK_TIME_EVERY=100;constructor(){this.reset()}check(){return!(++this.checked<e.CHECK_TIME_EVERY)&&(this.checked=0,this.endTime<=Date.now())}reset(){this.endTime=Date.now()+e.TIME_SLOT_DURATION_MS,this.checked=0}},bd=class e{constructor({xref:e,handler:t,pageIndex:n,idFactory:r,fontCache:i,builtInCMapCache:a,standardFontDataCache:o,globalColorSpaceCache:s,globalImageCache:c,systemFontCache:l,options:u=null}){this.xref=e,this.handler=t,this.pageIndex=n,this.idFactory=r,this.fontCache=i,this.builtInCMapCache=a,this.standardFontDataCache=o,this.globalColorSpaceCache=s,this.globalImageCache=c,this.systemFontCache=l,this.options=u||pd,this.type3FontRefs=null,this._regionalImageCache=new _u,this._fetchBuiltInCMapBound=this.fetchBuiltInCMap.bind(this)}get _pdfFunctionFactory(){return P(this,`_pdfFunctionFactory`,new bu({xref:this.xref,isEvalSupported:this.options.isEvalSupported}))}get parsingType3Font(){return!!this.type3FontRefs}clone(e=null){let t=Object.create(this);return t.options=Object.assign(Object.create(null),this.options,e),t}hasBlendModes(e,t){if(!(e instanceof L)||e.objId&&t.has(e.objId))return!1;let n=new Yn(t);e.objId&&n.put(e.objId);let r=[e],i=this.xref;for(;r.length;){let e=r.shift(),t=e.get(`ExtGState`);if(t instanceof L)for(let e of t.getRawValues()){if(e instanceof R){if(n.has(e))continue;try{e=i.fetch(e)}catch(t){n.put(e),hn(`hasBlendModes - ignoring ExtGState: "${t}".`);continue}}if(!(e instanceof L))continue;e.objId&&n.put(e.objId);let t=e.get(`BM`);if(t instanceof I){if(t.name!==`Normal`)return!0}else if(t!==void 0&&Array.isArray(t)){for(let e of t)if(e instanceof I&&e.name!==`Normal`)return!0}}let a=e.get(`XObject`);if(a instanceof L)for(let e of a.getRawValues()){if(e instanceof R){if(n.has(e))continue;try{e=i.fetch(e)}catch(t){n.put(e),hn(`hasBlendModes - ignoring XObject: "${t}".`);continue}}if(!(e instanceof tr))continue;e.dict.objId&&n.put(e.dict.objId);let t=e.dict.get(`Resources`);t instanceof L&&(t.objId&&n.has(t.objId)||(r.push(t),t.objId&&n.put(t.objId)))}}for(let e of n)t.put(e);return!1}async fetchBuiltInCMap(e){let t=this.builtInCMapCache.get(e);if(t)return t;let n;return n=this.options.useWorkerFetch?{cMapData:await pr(`${this.options.cMapUrl}${e}.bcmap`),isCompressed:!0}:await this.handler.sendWithPromise(`FetchBinaryData`,{type:`cMapReaderFactory`,name:e}),this.builtInCMapCache.set(e,n),n}async fetchStandardFontData(e){let t=this.standardFontDataCache.get(e);if(t)return new gi(t);if(this.options.useSystemFonts&&e!==`Symbol`&&e!==`ZapfDingbats`)return null;let n=As()[e],r;try{r=this.options.useWorkerFetch?await pr(`${this.options.standardFontDataUrl}${n}`):await this.handler.sendWithPromise(`FetchBinaryData`,{type:`standardFontDataFactory`,filename:n})}catch(e){return N(e),null}return this.standardFontDataCache.set(e,r),new gi(r)}async buildFormXObject(e,t,n,r,i,a,o,s){let{dict:c}=t,l=wr(c.getArray(`Matrix`),null),u=Er(c.getArray(`BBox`),null),d,f;c.has(`OC`)&&(d=await this.parseMarkedContentProps(c.get(`OC`),e)),d!==void 0&&r.addOp(zt,[`OC`,d]);let p=c.get(`Group`);if(p){f={matrix:l,bbox:u,smask:n,isolated:!1,knockout:!1};let t=null;if(Zn(p.get(`S`),`Transparency`)&&(f.isolated=p.get(`I`)||!1,f.knockout=p.get(`K`)||!1,p.has(`CS`))){let n=this._getColorSpace(p.getRaw(`CS`),e,o);t=n instanceof ni?n:await this._handleColorSpace(n)}n?.backdrop&&(t||=Di.rgb,n.backdrop=t.getRgbHex(n.backdrop,0)),r.addOp(Gt,[f])}let m=[l&&new Float32Array(l),!p&&u&&new Float32Array(u)||null];r.addOp(Ut,m);let h=c.get(`Resources`);await this.getOperatorList({stream:t,task:i,resources:h instanceof L?h:e,operatorList:r,initialState:a,prevRefs:s}),r.addOp(Wt,[]),p&&r.addOp(Kt,[f]),d!==void 0&&r.addOp(Bt,[])}_sendImgData(e,t,n=!1){let r=t?[t.bitmap||t.data.buffer]:null;return this.parsingType3Font||n?this.handler.send(`commonobj`,[e,`Image`,t],r):this.handler.send(`obj`,[e,this.pageIndex,`Image`,t],r)}async buildPaintImageXObject({resources:e,image:t,isInline:n=!1,operatorList:r,cacheKey:i,localImageCache:a,localColorSpaceCache:o}){let{maxImageSize:s,ignoreErrors:c,isOffscreenCanvasSupported:l}=this.options,{dict:u}=t,d=u.objId,f=u.get(`W`,`Width`),p=u.get(`H`,`Height`);if(!f||typeof f!=`number`||!p||typeof p!=`number`)return void N(`Image dimensions are missing, or not numbers.`);if(s!==-1&&f*p>s){let e=`Image exceeded maximum allowed size and was removed.`;if(!c)throw Error(e);N(e);return}let m;u.has(`OC`)&&(m=await this.parseMarkedContentProps(u.get(`OC`),e));let h,g,_;if(u.get(`IM`,`ImageMask`)){if(h=await fd.createMask({image:t,isOffscreenCanvasSupported:l&&!this.parsingType3Font}),h.isSingleOpaquePixel){if(g=nn,_=[],r.addImageOps(g,_,m),i){let e={fn:g,args:_,optionalContent:m};a.set(i,d,e),d&&this._regionalImageCache.set(null,d,e)}return}if(this.parsingType3Font)return _=function({data:e,width:t,height:n}){if(t>1e3||n>1e3)return null;let r=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),i=t+1,a=new Uint8Array(i*(n+1)),o,s,c,l=t+7&-8,u=new Uint8Array(l*n),d=0;for(let t of e){let e=128;for(;e>0;)u[d++]=t&e?0:255,e>>=1}let f=0;for(d=0,u[d]!==0&&(a[0]=1,++f),s=1;s<t;s++)u[d]!==u[d+1]&&(a[s]=u[d]?2:1,++f),d++;for(u[d]!==0&&(a[s]=2,++f),o=1;o<n;o++){d=o*l,c=o*i,u[d-l]!==u[d]&&(a[c]=u[d]?1:8,++f);let e=(u[d]?4:0)+(u[d-l]?8:0);for(s=1;s<t;s++)e=(e>>2)+(u[d+1]?4:0)+(u[d-l+1]?8:0),r[e]&&(a[c+s]=r[e],++f),d++;if(u[d-l]!==u[d]&&(a[c+s]=u[d]?2:4,++f),f>1e3)return null}for(d=l*(n-1),c=o*i,u[d]!==0&&(a[c]=8,++f),s=1;s<t;s++)u[d]!==u[d+1]&&(a[c+s]=u[d]?4:8,++f),d++;if(u[d]!==0&&(a[c+s]=4,++f),f>1e3)return null;let p=new Int32Array([0,i,-1,0,-i,0,0,0,1]),m=[],{a:h,b:g,c:_,d:v,e:y,f:b}=new DOMMatrix().scaleSelf(1/t,-1/n).translateSelf(0,-n);for(o=0;f&&o<=n;o++){let e=o*i,n=e+t;for(;e<n&&!a[e];)e++;if(e===n)continue;let r=e%i,s=o;m.push(cn,h*r+_*s+y,g*r+v*s+b);let c=e,l=a[e];do{let t=p[l];do e+=t;while(!a[e]);let n=a[e];n!==5&&n!==10?(l=n,a[e]=0):(l=n&51*l>>4,a[e]&=l>>2|l<<2),r=e%i,s=e/i|0,m.push(ln,h*r+_*s+y,g*r+v*s+b),a[e]||--f}while(c!==e);--o}return[sn,[new Float32Array(m)],new Float32Array([0,0,t,n])]}(h),_?void r.addImageOps(rn,_,m):(N(`Cannot compile Type3 glyph.`),void r.addImageOps(Yt,[h],m));let e=`mask_${this.idFactory.createObjId()}`;if(r.addDependency(e),h.dataLen=h.bitmap?h.width*h.height*4:h.data.length,this._sendImgData(e,h),g=Yt,_=[{data:e,width:h.width,height:h.height,interpolate:h.interpolate,count:1}],r.addImageOps(g,_,m),i){let t={objId:e,fn:g,args:_,optionalContent:m};a.set(i,d,t),d&&this._regionalImageCache.set(null,d,t)}return}let v=u.has(`SMask`)||u.has(`Mask`);if(n&&f+p<200&&!v){try{h=await new fd({xref:this.xref,res:e,image:t,isInline:n,pdfFunctionFactory:this._pdfFunctionFactory,globalColorSpaceCache:this.globalColorSpaceCache,localColorSpaceCache:o}).createImageData(!0,!1),r.addImageOps(Qt,[h],m)}catch(e){let t=`Unable to decode inline image: "${e}".`;if(!c)throw Error(t);N(t)}return}let y=`img_${this.idFactory.createObjId()}`,b=!1,x=null;if(this.parsingType3Font?y=`${this.idFactory.getDocId()}_type3_${y}`:i&&d&&(b=this.globalImageCache.shouldCache(d,this.pageIndex),b&&(_n(!n,`Cannot cache an inline image globally.`),y=`${this.idFactory.getDocId()}_${y}`)),r.addDependency(y),g=Zt,_=[y,f,p],r.addImageOps(g,_,m,v),b){if(x={objId:y,fn:g,args:_,optionalContent:m,hasMask:v,byteSize:0},this.globalImageCache.hasDecodeFailed(d))return this.globalImageCache.setData(d,x),void this._sendImgData(y,null,b);if(f*p>25e4||v){let e=await this.handler.sendWithPromise(`commonobj`,[y,`CopyLocalImage`,{imageRef:d}]);if(e)return this.globalImageCache.setData(d,x),void this.globalImageCache.addByteSize(d,e)}}if(fd.buildImage({xref:this.xref,res:e,image:t,isInline:n,pdfFunctionFactory:this._pdfFunctionFactory,globalColorSpaceCache:this.globalColorSpaceCache,localColorSpaceCache:o}).then(async e=>(h=await e.createImageData(!1,l),h.dataLen=h.bitmap?h.width*h.height*4:h.data.length,h.ref=d,b&&this.globalImageCache.addByteSize(d,h.dataLen),this._sendImgData(y,h,b))).catch(e=>(N(`Unable to decode image "${y}": "${e}".`),d&&this.globalImageCache.addDecodeFailed(d),this._sendImgData(y,null,b))),i){let e={objId:y,fn:g,args:_,optionalContent:m,hasMask:v};a.set(i,d,e),d&&(this._regionalImageCache.set(null,d,e),b&&(_n(x,`The global cache-data must be available.`),this.globalImageCache.setData(d,x)))}}handleSMask(e,t,n,r,i,a,o){let s=e.get(`G`),c={subtype:e.get(`S`).name,backdrop:e.get(`BC`)},l=e.get(`TR`);if(Cu(l)){let e=this._pdfFunctionFactory.create(l),t=new Uint8Array(256),n=new Float32Array(1);for(let r=0;r<256;r++)n[0]=r/255,e(n,0,n,0),t[r]=255*n[0]|0;c.transferMap=t}return this.buildFormXObject(t,s,c,n,r,i.state.clone({newPath:!0}),a,o)}handleTransferFunction(e){let t;if(Array.isArray(e))t=e;else{if(!Cu(e))return null;t=[e]}let n=[],r=0,i=0;for(let e of t){let t=this.xref.fetchIfRef(e);if(r++,Zn(t,`Identity`)){n.push(null);continue}if(!Cu(t))return null;let a=this._pdfFunctionFactory.create(t),o=new Uint8Array(256),s=new Float32Array(1);for(let e=0;e<256;e++)s[0]=e/255,a(s,0,s,0),o[e]=255*s[0]|0;n.push(o),i++}return r!==1&&r!==4||i===0?null:n}handleTilingType(e,t,n,r,i,a,o,s){let c=new ra,l=L.merge({xref:this.xref,dictArray:[i.get(`Resources`),n]});return this.getOperatorList({stream:r,task:o,resources:l,operatorList:c}).then(function(){let n=c.getIR(),r=_l(n,i,t);a.addDependencies(c.dependencies),a.addOp(e,r),i.objId&&s.set(null,i.objId,{operatorListIR:n,dict:i})}).catch(e=>{if(!(e instanceof wn)){if(!this.options.ignoreErrors)throw e;N(`handleTilingType - ignoring pattern: "${e}".`)}})}async handleSetFont(e,t,n,r,i,a,o=null,s=null){let c=t?.[0]instanceof I?t[0].name:null,l=await this.loadFont(c,n,e,i,o,s);return l.font.isType3Font&&r.addDependencies(l.type3Dependencies),a.font=l.font,l.send(this.handler),l.loadedName}handleText(t,n){let r=n.font,i=r.charsToGlyphs(t);return r.data&&(n.textRenderingMode&S||n.fillColorSpace.name===`Pattern`||r.disableFontFace)&&e.buildFontPaths(r,i,this.handler,this.options),i}ensureStateFont(e){if(e.font)return;let t=new F(`Missing setFont (Tf) operator before text rendering operator.`);if(!this.options.ignoreErrors)throw t;N(`ensureStateFont: "${t}".`)}async setGState({resources:e,gState:t,operatorList:n,cacheKey:r,task:i,stateManager:a,localGStateCache:o,localColorSpaceCache:s,seenRefs:c}){let l=t.objId,u=!0,d=[],f=Promise.resolve();for(let[r,o]of t)switch(r){case`Type`:break;case`LW`:if(typeof o!=`number`){N(`Invalid LW (line width): ${o}`);break}d.push([r,Math.abs(o)]);break;case`LC`:case`LJ`:case`ML`:case`D`:case`RI`:case`FL`:case`CA`:case`ca`:d.push([r,o]);break;case`Font`:u=!1,f=f.then(()=>this.handleSetFont(e,null,o[0],n,i,a.state).then(function(e){n.addDependency(e),d.push([r,[e,o[1]]])}));break;case`BM`:d.push([r,_d(o)]);break;case`SMask`:if(Zn(o,`None`)){d.push([r,!1]);break}o instanceof L?(u=!1,f=f.then(()=>this.handleSMask(o,e,n,i,a,s,c)),d.push([r,!0])):N(`Unsupported SMask type`);break;case`TR`:let t=this.handleTransferFunction(o);d.push([r,t]);break;case`OP`:case`op`:case`OPM`:case`BG`:case`BG2`:case`UCR`:case`UCR2`:case`TR2`:case`HT`:case`SM`:case`SA`:case`AIS`:case`TK`:hn(`graphic state operator `+r);break;default:hn(`Unknown graphic state operator `+r)}await f,d.length>0&&n.addOp(Me,[d]),u&&o.set(r,l,d)}loadFont(t,n,r,i,a=null,o=null){let s=async()=>new xd({loadedName:`g_font_error`,font:new nl(`Font "${t}" is not available.`),dict:n}),c;if(n)n instanceof R&&(c=n);else{let e=r.get(`Font`);e&&(c=e.getRaw(t))}if(c){if(this.type3FontRefs?.has(c))return s();if(this.fontCache.has(c))return this.fontCache.get(c);try{n=this.xref.fetchIfRef(c)}catch(e){N(`loadFont - lookup failed: "${e}".`)}}if(!(n instanceof L)){if(!this.options.ignoreErrors&&!this.parsingType3Font)return N(`Font "${t}" is not available.`),s();N(`Font "${t}" is not available -- attempting to fallback to a default font.`),n=a||e.fallbackFontDict}if(n.cacheKey&&this.fontCache.has(n.cacheKey))return this.fontCache.get(n.cacheKey);let{promise:l,resolve:u}=Promise.withResolvers(),d;try{d=this.preEvaluateFont(n),d.cssFontInfo=o}catch(e){return N(`loadFont - preEvaluateFont failed: "${e}".`),s()}let{descriptor:f,hash:p}=d,m=c instanceof R,h;if(p&&f instanceof L){let e=f.fontAliases||=Object.create(null);if(e[p]){let t=e[p].aliasRef;if(m&&t&&this.fontCache.has(t))return this.fontCache.putAlias(c,t),this.fontCache.get(c)}else e[p]={fontID:this.idFactory.createFontId()};m&&(e[p].aliasRef=c),h=e[p].fontID}else h=this.idFactory.createFontId();return _n(h?.startsWith(`f`),`The "fontID" must be (correctly) defined.`),m?this.fontCache.put(c,l):(n.cacheKey=`cacheKey_${h}`,this.fontCache.put(n.cacheKey,l)),n.loadedName=`${this.idFactory.getDocId()}_${h}`,this.translateFont(d).then(async e=>{let t=new xd({loadedName:n.loadedName,font:e,dict:n});if(e.isType3Font)try{await t.loadType3Data(this,r,i)}catch(e){throw Error(`Type3 font load error: ${e}`)}u(t)}).catch(e=>{N(`loadFont - translateFont failed: "${e}".`),u(new xd({loadedName:n.loadedName,font:new nl(e?.message),dict:n}))}),l}buildPath(e,t,n){let{pathMinMax:r,pathBuffer:i}=n;switch(0|e){case He:{let e=n.currentPointX=t[0],a=n.currentPointY=t[1],o=t[2],s=t[3],c=e+o,l=a+s;o===0||s===0?i.push(cn,e,a,ln,c,l,dn):i.push(cn,e,a,ln,c,a,ln,c,l,ln,e,l,dn),jn.rectBoundingBox(e,a,c,l,r);break}case Ie:{let e=n.currentPointX=t[0],a=n.currentPointY=t[1];i.push(cn,e,a),jn.pointBoundingBox(e,a,r);break}case Le:{let e=n.currentPointX=t[0],a=n.currentPointY=t[1];i.push(ln,e,a),jn.pointBoundingBox(e,a,r);break}case Re:{let e=n.currentPointX,a=n.currentPointY,[o,s,c,l,u,d]=t;n.currentPointX=u,n.currentPointY=d,i.push(un,o,s,c,l,u,d),jn.bezierBoundingBox(e,a,o,s,c,l,u,d,r);break}case ze:{let e=n.currentPointX,a=n.currentPointY,[o,s,c,l]=t;n.currentPointX=c,n.currentPointY=l,i.push(un,e,a,o,s,c,l),jn.bezierBoundingBox(e,a,e,a,o,s,c,l,r);break}case Be:{let e=n.currentPointX,a=n.currentPointY,[o,s,c,l]=t;n.currentPointX=c,n.currentPointY=l,i.push(un,o,s,c,l,c,l),jn.bezierBoundingBox(e,a,o,s,c,l,c,l,r);break}case Ve:i.push(dn)}}_getColorSpace(e,t,n){return Di.parse({cs:e,xref:this.xref,resources:t,pdfFunctionFactory:this._pdfFunctionFactory,globalColorSpaceCache:this.globalColorSpaceCache,localColorSpaceCache:n,asyncIfNotCached:!0})}async _handleColorSpace(e){try{return await e}catch(e){if(e instanceof wn)return null;if(this.options.ignoreErrors)return N(`_handleColorSpace - ignoring ColorSpace: "${e}".`),null;throw e}}parseShading({shading:e,resources:t,localColorSpaceCache:n,localShadingPatternCache:r}){let i,a=r.get(e);if(a)return a;try{i=ll.parseShading(e,this.xref,t,this._pdfFunctionFactory,this.globalColorSpaceCache,n).getIR()}catch(t){if(t instanceof wn)return null;if(this.options.ignoreErrors)return N(`parseShading - ignoring shading: "${t}".`),r.set(e,null),null;throw t}return a=`pattern_${this.idFactory.createObjId()}`,this.parsingType3Font&&(a=`${this.idFactory.getDocId()}_type3_${a}`),r.set(e,a),this.parsingType3Font?this.handler.send(`commonobj`,[a,`Pattern`,i]):this.handler.send(`obj`,[a,this.pageIndex,`Pattern`,i]),a}handleColorN(e,t,n,r,i,a,o,s,c,l){let u=n.pop();if(u instanceof I){let d=i.getRaw(u.name),f=d instanceof R&&c.getByRef(d);if(f)try{let i=r.base?r.base.getRgbHex(n,0):null,a=_l(f.operatorListIR,f.dict,i);e.addOp(t,a);return}catch{}let p=this.xref.fetchIfRef(d);if(p){let i=p instanceof tr?p.dict:p,u=i.get(`PatternType`);if(u===md){let s=r.base?r.base.getRgbHex(n,0):null;return this.handleTilingType(t,s,a,p,i,e,o,c)}if(u===hd){let n=i.get(`Shading`),r=this.parseShading({shading:n,resources:a,localColorSpaceCache:s,localShadingPatternCache:l});if(r){let n=wr(i.getArray(`Matrix`),null);e.addOp(t,[`Shading`,r,n])}return}throw new F(`Unknown PatternType: ${u}`)}}throw new F(`Unknown PatternName: ${u}`)}_parseVisibilityExpression(e,t,n){if(++t>10)return void N(`Visibility expression is too deeply nested`);let r=e.length,i=this.xref.fetchIfRef(e[0]);if(!(r<2)&&i instanceof I){switch(i.name){case`And`:case`Or`:case`Not`:n.push(i.name);break;default:N(`Invalid operator ${i.name} in visibility expression`);return}for(let i=1;i<r;i++){let r=e[i],a=this.xref.fetchIfRef(r);if(Array.isArray(a)){let e=[];n.push(e),this._parseVisibilityExpression(a,t,e)}else r instanceof R&&n.push(r.toString())}}else N(`Invalid visibility expression`)}async parseMarkedContentProps(e,t){let n;if(e instanceof I)n=t.get(`Properties`).get(e.name);else{if(!(e instanceof L))throw new F(`Optional content properties malformed.`);n=e}let r=n.get(`Type`)?.name;if(r===`OCG`)return{type:r,id:n.objId};if(r===`OCMD`){let e=n.get(`VE`);if(Array.isArray(e)){let t=[];if(this._parseVisibilityExpression(e,0,t),t.length>0)return{type:`OCMD`,expression:t}}let t=n.get(`OCGs`);if(Array.isArray(t)||t instanceof L){let e=[];if(Array.isArray(t))for(let n of t)e.push(n.toString());else e.push(t.objId);return{type:r,ids:e,policy:n.get(`P`)instanceof I?n.get(`P`).name:null,expression:null}}if(t instanceof R)return{type:r,id:t.toString()}}return null}getOperatorList({stream:e,task:t,resources:n,operatorList:r,initialState:i=null,fallbackFontDict:a=null,prevRefs:o=null}){let s=e.dict?.objId,c=new Yn(o);if(s){if(o?.has(s))throw Error(`getOperatorList - ignoring circular reference: ${s}`);c.put(s)}if(n||=L.empty,i||=new wd,!r)throw Error(`getOperatorList: missing "operatorList" parameter`);let l=this,u=this.xref,d=new fu,f=new pu,p=new hu,m=new gu,h=new Map,g=n.get(`XObject`)||L.empty,_=n.get(`Pattern`)||L.empty,v=new Sd(i),y=new Td(e,u,v),b=new yd;function x(e){for(let e=0,t=y.savedStatesDepth;e<t;e++)r.addOp(Pe,[])}return new Promise(function e(i,o){let s=function(t){Promise.all([t,r.ready]).then(function(){try{e(i,o)}catch(e){o(e)}},o)};t.ensureNotTerminated(),b.reset();let S={},C,w,T,E,D,O;for(;!(C=b.check())&&(S.args=null,y.read(S));){let e=S.args,i=S.fn;switch(0|i){case Ft:if(O=e[0]instanceof I,D=e[0].name,O){let t=d.getByName(D);if(t){vd(r,t),e=null;continue}}s(new Promise(function(e,i){if(!O)throw new F(`XObject must be referred to by name.`);let a=g.getRaw(D);if(a instanceof R){let t=d.getByRef(a)||l._regionalImageCache.getByRef(a)||l.globalImageCache.getData(a,l.pageIndex);if(t)return vd(r,t),void e();a=u.fetch(a)}if(!(a instanceof tr))throw new F(`XObject should be a stream`);let o=a.dict.get(`Subtype`);if(!(o instanceof I))throw new F(`XObject should have a Name subtype`);if(o.name===`Form`)return v.save(),void l.buildFormXObject(n,a,null,r,t,v.state.clone({newPath:!0}),f,c).then(function(){v.restore(),e()},i);if(o.name!==`Image`){if(o.name!==`PS`)throw new F(`Unhandled XObject subtype ${o.name}`);hn(`Ignored XObject subtype PS`),e()}else l.buildPaintImageXObject({resources:n,image:a,operatorList:r,cacheKey:D,localImageCache:d,localColorSpaceCache:f}).then(e,i)}).catch(function(e){if(!(e instanceof wn)){if(!l.options.ignoreErrors)throw e;N(`getOperatorList - ignoring XObject: "${e}".`)}}));return;case ot:let o=e[1];s(l.handleSetFont(n,e,null,r,t,v.state,a).then(function(e){r.addDependency(e),r.addOp(ot,[e,o])}));return;case Pt:let y=e[0].cacheKey;if(y){let t=d.getByName(y);if(t){vd(r,t),e=null;continue}}s(l.buildPaintImageXObject({resources:n,image:e[0],isInline:!0,operatorList:r,cacheKey:y,localImageCache:d,localColorSpaceCache:f}));return;case pt:if(!v.state.font){l.ensureStateFont(v.state);continue}e[0]=l.handleText(e[0],v.state);break;case mt:if(!v.state.font){l.ensureStateFont(v.state);continue}let b=[],x=v.state;for(let t of e[0])typeof t==`string`?b.push(...l.handleText(t,x)):typeof t==`number`&&b.push(t);e[0]=b,i=pt;break;case ht:if(!v.state.font){l.ensureStateFont(v.state);continue}r.addOp(ft),e[0]=l.handleText(e[0],v.state),i=pt;break;case gt:if(!v.state.font){l.ensureStateFont(v.state);continue}r.addOp(ft),r.addOp(rt,[e.shift()]),r.addOp(nt,[e.shift()]),e[0]=l.handleText(e[0],v.state),i=pt;break;case st:v.state.textRenderingMode=e[0];break;case bt:{let t=l._getColorSpace(e[0],n,f);if(t instanceof ni){v.state.fillColorSpace=t;continue}s(l._handleColorSpace(t).then(e=>{v.state.fillColorSpace=e||Di.gray}));return}case yt:{let t=l._getColorSpace(e[0],n,f);if(t instanceof ni){v.state.strokeColorSpace=t;continue}s(l._handleColorSpace(t).then(e=>{v.state.strokeColorSpace=e||Di.gray}));return}case Ct:E=v.state.fillColorSpace,e=[E.getRgbHex(e,0)],i=Ot;break;case xt:E=v.state.strokeColorSpace,e=[E.getRgbHex(e,0)],i=Dt;break;case Et:v.state.fillColorSpace=Di.gray,e=[Di.gray.getRgbHex(e,0)],i=Ot;break;case Tt:v.state.strokeColorSpace=Di.gray,e=[Di.gray.getRgbHex(e,0)],i=Dt;break;case At:v.state.fillColorSpace=Di.cmyk,e=[Di.cmyk.getRgbHex(e,0)],i=Ot;break;case kt:v.state.strokeColorSpace=Di.cmyk,e=[Di.cmyk.getRgbHex(e,0)],i=Dt;break;case Ot:v.state.fillColorSpace=Di.rgb,e=[Di.rgb.getRgbHex(e,0)];break;case Dt:v.state.strokeColorSpace=Di.rgb,e=[Di.rgb.getRgbHex(e,0)];break;case wt:if(E=v.state.patternFillColorSpace,!E){if(Cr(e,null)){e=[Di.gray.getRgbHex(e,0)],i=Ot;break}e=[],i=on;break}if(E.name===`Pattern`)return void s(l.handleColorN(r,wt,e,E,_,n,t,f,m,h));e=[E.getRgbHex(e,0)],i=Ot;break;case St:if(E=v.state.patternStrokeColorSpace,!E){if(Cr(e,null)){e=[Di.gray.getRgbHex(e,0)],i=Dt;break}e=[],i=an;break}if(E.name===`Pattern`)return void s(l.handleColorN(r,St,e,E,_,n,t,f,m,h));e=[E.getRgbHex(e,0)],i=Dt;break;case jt:let S;try{let t=n.get(`Shading`);if(!t)throw new F(`No shading resource found`);if(S=t.get(e[0].name),!S)throw new F(`No shading object found`)}catch(e){if(e instanceof wn)continue;if(l.options.ignoreErrors){N(`getOperatorList - ignoring Shading: "${e}".`);continue}throw e}let C=l.parseShading({shading:S,resources:n,localColorSpaceCache:f,localShadingPatternCache:h});if(!C)continue;e=[C],i=jt;break;case Me:if(O=e[0]instanceof I,D=e[0].name,O){let t=p.getByName(D);if(t){t.length>0&&r.addOp(Me,[t]),e=null;continue}}s(new Promise(function(e,i){if(!O)throw new F(`GState must be referred to by name.`);let a=n.get(`ExtGState`);if(!(a instanceof L))throw new F(`ExtGState should be a dictionary.`);let o=a.get(D);if(!(o instanceof L))throw new F(`GState should be a dictionary.`);l.setGState({resources:n,gState:o,operatorList:r,cacheKey:D,task:t,stateManager:v,localGStateCache:p,localColorSpaceCache:f,seenRefs:c}).then(e,i)}).catch(function(e){if(!(e instanceof wn)){if(!l.options.ignoreErrors)throw e;N(`getOperatorList - ignoring ExtGState: "${e}".`)}}));return;case Te:{let[t]=e;if(typeof t!=`number`){N(`Invalid setLineWidth: ${t}`);continue}e[0]=Math.abs(t);break}case ke:{let t=e[1];if(typeof t!=`number`){N(`Invalid setDash: ${t}`);continue}let n=e[0];if(!Array.isArray(n)){N(`Invalid setDash: ${n}`);continue}n.some(e=>typeof e!=`number`)&&(e[0]=n.filter(e=>typeof e==`number`));break}case Ie:case Le:case Re:case ze:case Be:case Ve:case He:l.buildPath(i,e,v.state);continue;case Ue:case We:case Ge:case Ke:case qe:case Je:case Ye:case Xe:case Ze:{let{state:{pathBuffer:e,pathMinMax:t}}=v;i!==We&&i!==Ye&&i!==Xe||e.push(dn),e.length===0?r.addOp(rn,[i,[null],null]):(r.addOp(rn,[i,[new Float32Array(e)],t.slice()]),e.length=0,t.set([1/0,1/0,-1/0,-1/0],0));continue}case dt:r.addOp(i,[new Float32Array(e)]);continue;case It:case Lt:case Vt:case Ht:continue;case zt:if(!(e[0]instanceof I)){N(`Expected name for beginMarkedContentProps arg0=${e[0]}`),r.addOp(zt,[`OC`,null]);continue}if(e[0].name===`OC`)return void s(l.parseMarkedContentProps(e[1],n).then(e=>{r.addOp(zt,[`OC`,e])}).catch(e=>{if(!(e instanceof wn)){if(l.options.ignoreErrors)return N(`getOperatorList - ignoring beginMarkedContentProps: "${e}".`),void r.addOp(zt,[`OC`,null]);throw e}}));e=[e[0].name,e[1]instanceof L?e[1].get(`MCID`):null];break;default:if(e!==null){for(w=0,T=e.length;w<T&&!(e[w]instanceof L);w++);if(w<T){N(`getOperatorList - ignoring operator: `+i);continue}}}r.addOp(i,e)}C?s(gd):(x(),i())}).catch(e=>{if(!(e instanceof wn)){if(this.options.ignoreErrors)return N(`getOperatorList - ignoring errors during "${t.name}" task: "${e}".`),void x();throw e}})}getTextContent({stream:e,task:t,resources:r,stateManager:i=null,includeMarkedContent:a=!1,sink:o,seenStyles:s=new Set,viewBox:c,lang:l=null,markedContentData:u=null,disableNormalization:d=!1,keepWhiteSpace:f=!1,prevRefs:p=null,intersector:m=null}){let h=e.dict?.objId,g=new Yn(p);if(h){if(p?.has(h))throw Error(`getTextContent - ignoring circular reference: ${h}`);g.put(h)}r||=L.empty,i||=new Sd(new Cd),a&&(u||={level:0});let _={items:[],styles:Object.create(null),lang:l},v={initialized:!1,str:[],totalWidth:0,totalHeight:0,width:0,height:0,vertical:!1,prevTransform:null,textAdvanceScale:0,spaceInFlowMin:0,spaceInFlowMax:0,trackingSpaceMin:1/0,negativeSpaceMax:-1/0,notASpace:-1/0,transform:null,fontName:null,hasEOL:!1},y=[` `,` `],b=0;function x(e){let t=(b+1)%2,n=y[b]!==` `&&y[t]===` `;return y[b]=e,b=t,!f&&n}function S(){return!f&&y[b]!==` `&&y[(b+1)%2]===` `}function C(){y[0]=y[1]=` `,b=0}let w=this,T=this.xref,E=[],D=null,O=new fu,k=new hu,ee=new Td(e,T,i),A;function j({width:e=0,height:t=0,transform:n=v.prevTransform,fontName:r=v.fontName}){m?.addExtraChar(` `),_.items.push({str:` `,dir:`ltr`,width:e,height:t,transform:n,fontName:r,hasEOL:!1})}function M(){let e=A.font,t=[A.fontSize*A.textHScale,0,0,A.fontSize,0,A.textRise];if(e.isType3Font&&(A.fontSize<=1||e.isCharBBox)&&!In(A.fontMatrix,n)){let n=e.bbox[3]-e.bbox[1];n>0&&(t[3]*=n*A.fontMatrix[3])}return jn.transform(A.ctm,jn.transform(A.textMatrix,t))}function te(){if(v.initialized)return v;let{font:e,loadedName:t}=A;if(!s.has(t)&&(s.add(t),_.styles[t]={fontFamily:e.fallbackName,ascent:e.ascent,descent:e.descent,vertical:e.vertical},w.options.fontExtraProperties&&e.systemFontInfo)){let n=_.styles[t];n.fontSubstitution=e.systemFontInfo.css,n.fontSubstitutionLoadedName=e.systemFontInfo.loadedName}v.fontName=t;let n=v.transform=M();e.vertical?(v.width=v.totalWidth=Math.hypot(n[0],n[1]),v.height=v.totalHeight=0,v.vertical=!0):(v.width=v.totalWidth=0,v.height=v.totalHeight=Math.hypot(n[2],n[3]),v.vertical=!1);let r=Math.hypot(A.textLineMatrix[0],A.textLineMatrix[1]);v.textAdvanceScale=Math.hypot(A.ctm[0],A.ctm[1])*r;let{fontSize:i}=A;return v.trackingSpaceMin=.102*i,v.notASpace=.03*i,v.negativeSpaceMax=-.2*i,v.spaceInFlowMin=.102*i,v.spaceInFlowMax=.6*i,v.hasEOL=!1,v.initialized=!0,v}function ne(){if(!v.initialized)return;let e=Math.hypot(A.textLineMatrix[0],A.textLineMatrix[1]),t=Math.hypot(A.ctm[0],A.ctm[1])*e;t!==v.textAdvanceScale&&(v.vertical?(v.totalHeight+=v.height*v.textAdvanceScale,v.height=0):(v.totalWidth+=v.width*v.textAdvanceScale,v.width=0),v.textAdvanceScale=t)}function re(e){let t=e.str.join(``);var n;d||(n=t,Rn||(Rn=/([\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,zn=new Map([[`ſt`,`ſt`]])),t=n.replaceAll(Rn,(e,t,n)=>t?t.normalize(`NFKC`):zn.get(n)));let r=Ju(t,-1,e.vertical);return{str:r.str,dir:r.dir,width:Math.abs(e.totalWidth),height:Math.abs(e.totalHeight),transform:e.transform,fontName:e.fontName,hasEOL:e.hasEOL}}async function ie(e,i){let a=await w.loadFont(e,i,r,t);A.loadedName=a.loadedName,A.font=a.font,A.fontMatrix=a.font.fontMatrix||n}function ae(e,t,n){let r=Math.hypot(n[0],n[1]);return[(n[0]*e+n[1]*t)/r,(n[2]*e+n[3]*t)/r]}function oe(e){let t=M(),n=t[4],r=t[5];if(A.font?.vertical){if(n<c[0]||n>c[2]||r+e<c[1]||r>c[3])return!1}else if(n+e<c[0]||n>c[2]||r<c[1]||r>c[3])return!1;if(!A.font||!v.prevTransform)return!0;let i=v.prevTransform[4],a=v.prevTransform[5];if(i===n&&a===r)return!0;let o=-1;switch(t[0]&&t[1]===0&&t[2]===0?o=t[0]>0?0:180:t[1]&&t[0]===0&&t[3]===0&&(o=t[1]>0?90:270),o){case 0:break;case 90:[n,r]=[r,n],[i,a]=[a,i];break;case 180:[n,r,i,a]=[-n,-r,-i,-a];break;case 270:[n,r]=[-r,-n],[i,a]=[-a,-i];break;default:[n,r]=ae(n,r,t),[i,a]=ae(i,a,v.prevTransform)}if(A.font.vertical){let e=(a-r)/v.textAdvanceScale,t=n-i,o=Math.sign(v.height);return e<o*v.negativeSpaceMax?Math.abs(t)>.5*v.width?(ce(),!0):(C(),ue(),!0):Math.abs(t)>v.width?(ce(),!0):(e<=o*v.notASpace&&C(),e<=o*v.trackingSpaceMin?S()?(C(),ue(),j({height:Math.abs(e)})):v.height+=e:le(e,v.prevTransform,o)||(v.str.length===0?(C(),j({height:Math.abs(e)})):v.height+=e),Math.abs(t)>.25*v.width&&ue(),!0)}let s=(n-i)/v.textAdvanceScale,l=r-a,u=Math.sign(v.width);return s<u*v.negativeSpaceMax?Math.abs(l)>.5*v.height?(ce(),!0):(C(),ue(),!0):Math.abs(l)>v.height?(ce(),!0):(s<=u*v.notASpace&&C(),s<=u*v.trackingSpaceMin?S()?(C(),ue(),j({width:Math.abs(s)})):v.width+=s:le(s,v.prevTransform,u)||(v.str.length===0?(C(),j({width:Math.abs(s)})):v.width+=s),Math.abs(l)>.25*v.height&&ue(),!0)}function se({chars:e,extraSpacing:t}){let n=A.font;if(!e){let e=A.charSpacing+t;e&&(n.vertical?A.translateTextMatrix(0,-e):A.translateTextMatrix(e*A.textHScale,0)),f&&oe(0);return}let r=n.charsToGlyphs(e),i=A.fontMatrix[0]*A.fontSize;for(let e=0,a=r.length;e<a;e++){let o=r[e],{category:s,originalCharCode:c}=o;if(s.isInvisibleFormatMark)continue;let l=A.charSpacing+(e+1===a?t:0),u=o.width;n.vertical&&(u=o.vmetric?o.vmetric[0]:-u);let d=u*i;if(c===32&&(l+=A.wordSpacing),!f&&s.isWhitespace){n.vertical?(l+=-d,A.translateTextMatrix(0,-l)):(l+=d,A.translateTextMatrix(l*A.textHScale,0)),x(` `);continue}if(!s.isZeroWidthDiacritic&&!oe(d)){n.vertical?A.translateTextMatrix(0,d):A.translateTextMatrix(d*A.textHScale,0);continue}let p=te();s.isZeroWidthDiacritic&&(d=0),n.vertical?(m?.addGlyph(M(),0,d,o.unicode),A.translateTextMatrix(0,d),d=Math.abs(d),p.height+=d):(d*=A.textHScale,m?.addGlyph(M(),d,0,o.unicode),A.translateTextMatrix(d,0),p.width+=d),d&&(p.prevTransform=M());let h=o.unicode;x(h)&&(p.str.push(` `),m?.addExtraChar(` `)),m||p.str.push(h),l&&(n.vertical?A.translateTextMatrix(0,-l):A.translateTextMatrix(l*A.textHScale,0))}}function ce(){m?.addExtraChar(`
6
- `),C(),v.initialized?(v.hasEOL=!0,ue()):_.items.push({str:``,dir:`ltr`,width:0,height:0,transform:M(),fontName:A.loadedName,hasEOL:!0})}function le(e,t,n){if(n*v.spaceInFlowMin<=e&&e<=n*v.spaceInFlowMax)return v.initialized&&(C(),v.str.push(` `),m?.addExtraChar(` `)),!1;let r=v.fontName,i=0;return v.vertical&&(i=e,e=0),ue(),C(),j({width:Math.abs(e),height:Math.abs(i),transform:t||M(),fontName:r}),!0}function ue(){v.initialized&&v.str&&(v.vertical?v.totalHeight+=v.height*v.textAdvanceScale:v.totalWidth+=v.width*v.textAdvanceScale,_.items.push(re(v)),v.initialized=!1,v.str.length=0)}function de(e=!1){let t=_.items.length;t!==0&&(e&&t<10||(o?.enqueue(_,t),_.items=[],_.styles=Object.create(null)))}let fe=new yd;return new Promise(function e(n,p){let m=function(t){de(!0),Promise.all([t,o?.ready]).then(function(){try{e(n,p)}catch(e){p(e)}},p)};t.ensureNotTerminated(),fe.reset();let h={},v,y,b,x=[];for(;!(v=fe.check())&&(x.length=0,h.args=x,ee.read(h));){let e=A;A=i.state;let n=h.fn;switch(x=h.args,0|n){case ot:let n=x[0].name,p=x[1];if(A.font&&n===A.fontName&&p===A.fontSize)break;ue(),A.fontName=n,A.fontSize=p,m(ie(n,null));return;case ct:A.textRise=x[0];break;case it:A.textHScale=x[0]/100;break;case at:A.leading=x[0];break;case lt:A.translateTextLineMatrix(x[0],x[1]),A.textMatrix=A.textLineMatrix.slice();break;case ut:A.leading=-x[1],A.translateTextLineMatrix(x[0],x[1]),A.textMatrix=A.textLineMatrix.slice();break;case ft:A.carriageReturn();break;case dt:A.setTextMatrix(x[0],x[1],x[2],x[3],x[4],x[5]),A.setTextLineMatrix(x[0],x[1],x[2],x[3],x[4],x[5]),ne();break;case nt:A.charSpacing=x[0];break;case rt:A.wordSpacing=x[0];break;case et:A.textMatrix=ir.slice(),A.textLineMatrix=ir.slice();break;case mt:if(!i.state.font){w.ensureStateFont(i.state);continue}let h=(A.font.vertical?1:-1)*A.fontSize/1e3,v=x[0];for(let e=0,t=v.length;e<t;e++){let t=v[e];if(typeof t==`string`)E.push(t);else if(typeof t==`number`&&t!==0){let e=E.join(``);E.length=0,se({chars:e,extraSpacing:t*h})}}if(E.length>0){let e=E.join(``);E.length=0,se({chars:e,extraSpacing:0})}break;case pt:if(!i.state.font){w.ensureStateFont(i.state);continue}se({chars:x[0],extraSpacing:0});break;case ht:if(!i.state.font){w.ensureStateFont(i.state);continue}A.carriageReturn(),se({chars:x[0],extraSpacing:0});break;case gt:if(!i.state.font){w.ensureStateFont(i.state);continue}A.wordSpacing=x[0],A.charSpacing=x[1],A.carriageReturn(),se({chars:x[2],extraSpacing:0});break;case Ft:if(ue(),D??=r.get(`XObject`)||L.empty,b=x[0]instanceof I,y=x[0].name,b&&O.getByName(y))break;m(new Promise(function(e,n){if(!b)throw new F(`XObject must be referred to by name.`);let p=D.getRaw(y);if(p instanceof R){if(O.getByRef(p)||w.globalImageCache.getData(p,w.pageIndex))return void e();p=T.fetch(p)}if(!(p instanceof tr))throw new F(`XObject should be a stream`);let{dict:m}=p,h=m.get(`Subtype`);if(!(h instanceof I))throw new F(`XObject should have a Name subtype`);if(h.name!==`Form`)return O.set(y,m.objId,!0),void e();let _=new Sd(i.state.clone()),v=wr(m.getArray(`Matrix`),null);v&&_.transform(v);let x=m.get(`Resources`);de();let S={enqueueInvoked:!1,enqueue(e,t){this.enqueueInvoked=!0,o.enqueue(e,t)},get desiredSize(){return o.desiredSize??0},get ready(){return o.ready}};w.getTextContent({stream:p,task:t,resources:x instanceof L?x:r,stateManager:_,includeMarkedContent:a,sink:o&&S,seenStyles:s,viewBox:c,lang:l,markedContentData:u,disableNormalization:d,keepWhiteSpace:f,prevRefs:g}).then(function(){S.enqueueInvoked||O.set(y,m.objId,!0),e()},n)}).catch(function(e){if(!(e instanceof wn)){if(!w.options.ignoreErrors)throw e;N(`getTextContent - ignoring XObject: "${e}".`)}}));return;case Me:if(b=x[0]instanceof I,y=x[0].name,b&&k.getByName(y))break;m(new Promise(function(e,t){if(!b)throw new F(`GState must be referred to by name.`);let n=r.get(`ExtGState`);if(!(n instanceof L))throw new F(`ExtGState should be a dictionary.`);let i=n.get(y);if(!(i instanceof L))throw new F(`GState should be a dictionary.`);let a=i.get(`Font`);if(!a)return k.set(y,i.objId,!0),void e();ue(),A.fontName=null,A.fontSize=a[1],ie(null,a[0]).then(e,t)}).catch(function(e){if(!(e instanceof wn)){if(!w.options.ignoreErrors)throw e;N(`getTextContent - ignoring ExtGState: "${e}".`)}}));return;case Rt:ue(),a&&(u.level++,_.items.push({type:`beginMarkedContent`,tag:x[0]instanceof I?x[0].name:null}));break;case zt:if(ue(),a){u.level++;let e=null;x[1]instanceof L&&(e=x[1].get(`MCID`)),_.items.push({type:`beginMarkedContentProps`,id:Number.isInteger(e)?`${w.idFactory.getPageObjId()}_mc${e}`:null,tag:x[0]instanceof I?x[0].name:null})}break;case Bt:if(ue(),a){if(u.level===0)break;u.level--,_.items.push({type:`endMarkedContent`})}break;case Pe:!e||e.font===A.font&&e.fontSize===A.fontSize&&e.fontName===A.fontName||ue()}if(_.items.length>=(o?.desiredSize??1)){v=!0;break}}v?m(gd):(ue(),de(),n())}).catch(e=>{if(!(e instanceof wn)){if(this.options.ignoreErrors)return N(`getTextContent - ignoring errors during "${t.name}" task: "${e}".`),ue(),void de();throw e}})}async extractDataStructures(e,t){let n=this.xref,r,i=this.readToUnicode(t.toUnicode);if(t.composite){let n=e.get(`CIDSystemInfo`);n instanceof L&&(t.cidSystemInfo={registry:Nn(n.get(`Registry`)),ordering:Nn(n.get(`Ordering`)),supplement:n.get(`Supplement`)});try{let t=e.get(`CIDToGIDMap`);t instanceof tr&&(r=t.getBytes())}catch(e){if(!this.options.ignoreErrors)throw e;N(`extractDataStructures - ignoring CIDToGIDMap data: "${e}".`)}}let a=[],o,s=null;if(e.has(`Encoding`)){if(o=e.get(`Encoding`),o instanceof L){if(s=o.get(`BaseEncoding`),s=s instanceof I?s.name:null,o.has(`Differences`)){let e=o.get(`Differences`),t=0;for(let r of e){let e=n.fetchIfRef(r);if(typeof e==`number`)t=e;else{if(!(e instanceof I))throw new F(`Invalid entry in 'Differences' array: ${e}`);a[t++]=e.name}}}}else if(o instanceof I)s=o.name;else{let e=`Encoding is not a Name nor a Dict`;if(!this.options.ignoreErrors)throw new F(e);N(e)}s!==`MacRomanEncoding`&&s!==`MacExpertEncoding`&&s!==`WinAnsiEncoding`&&(s=null)}let c=!t.file||t.isInternalFont,l=Ns()[t.name];if(s&&c&&l&&(s=null),s)t.defaultEncoding=Vo(s);else{let e=!!(t.flags&$o),n=!!(t.flags&es);t.type===`TrueType`&&e&&n&&a.length!==0&&(t.flags&=-5,e=!1),o=Lo,t.type!==`TrueType`||n||(o=Ro),(e||l)&&(o=Io,c&&(/Symbol/i.test(t.name)?o=zo:/Dingbats/i.test(t.name)?o=Bo:/Wingdings/i.test(t.name)&&(o=Ro))),t.defaultEncoding=o}t.differences=a,t.baseEncodingName=s,t.hasEncoding=!!s||a.length>0,t.dict=e,t.toUnicode=await i;let u=await this.buildToUnicode(t);return t.toUnicode=u,r&&(t.cidToGidMap=this.readCidToGidMap(r,u)),t}_simpleFontToUnicode(e,t=!1){_n(!e.composite,`Must be a simple font.`);let n=[],r=e.defaultEncoding.slice(),i=e.baseEncodingName,a=e.differences;for(let e in a){let t=a[e];t!==`.notdef`&&(r[e]=t)}let o=Ho();for(let a in r){let s=r[a];if(s===``)continue;let c=o[s];if(c!==void 0){n[a]=String.fromCharCode(c);continue}let l=0;switch(s[0]){case`G`:s.length===3&&(l=parseInt(s.substring(1),16));break;case`g`:s.length===5&&(l=parseInt(s.substring(1),16));break;case`C`:case`c`:if(s.length>=3&&s.length<=4){let n=s.substring(1);if(t){l=parseInt(n,16);break}if(l=+n,Number.isNaN(l)&&Number.isInteger(parseInt(n,16)))return this._simpleFontToUnicode(e,!0)}break;case`u`:c=Go(s,o),c!==-1&&(l=c);break;default:switch(s){case`f_h`:case`f_t`:case`T_h`:n[a]=s.replaceAll(`_`,``);continue}}if(l>0&&l<=1114111&&Number.isInteger(l)){if(i&&l===+a){let e=Vo(i);if(e&&(s=e[a])){n[a]=String.fromCharCode(o[s]);continue}}n[a]=String.fromCodePoint(l)}}return n}async buildToUnicode(e){if(e.hasIncludedToUnicodeMap=e.toUnicode?.length>0,e.hasIncludedToUnicodeMap)return!e.composite&&e.hasEncoding&&(e.fallbackToUnicode=this._simpleFontToUnicode(e)),e.toUnicode;if(!e.composite)return new zs(this._simpleFontToUnicode(e));if(e.composite&&(e.cMap.builtInCMap&&!(e.cMap instanceof yo)||e.cidSystemInfo?.registry===`Adobe`&&(e.cidSystemInfo.ordering===`GB1`||e.cidSystemInfo.ordering===`CNS1`||e.cidSystemInfo.ordering===`Japan1`||e.cidSystemInfo.ordering===`Korea1`))){let{registry:t,ordering:n}=e.cidSystemInfo,r=I.get(`${t}-${n}-UCS2`),i=await No.create({encoding:r,fetchBuiltInCMap:this._fetchBuiltInCMapBound,useCMap:null}),a=[],o=[];return e.cMap.forEach(function(e,t){if(t>65535)throw new F(`Max size of CID is 65,535`);let n=i.lookup(t);if(n){o.length=0;for(let e=0,t=n.length;e<t;e+=2)o.push((n.charCodeAt(e)<<8)+n.charCodeAt(e+1));a[e]=String.fromCharCode(...o)}}),new zs(a)}return new Bs(e.firstChar,e.lastChar)}async readToUnicode(e){if(!e)return null;if(e instanceof I){let t=await No.create({encoding:e,fetchBuiltInCMap:this._fetchBuiltInCMapBound,useCMap:null});return t instanceof yo?new Bs(0,65535):new zs(t.getMap())}if(e instanceof tr)try{let t=await No.create({encoding:e,fetchBuiltInCMap:this._fetchBuiltInCMapBound,useCMap:null});if(t instanceof yo)return new Bs(0,65535);let n=Array(t.length);return t.forEach(function(e,t){if(typeof t==`number`)return void(n[e]=String.fromCodePoint(t));t.length%2!=0&&(t=`\0`+t);let r=[];for(let e=0;e<t.length;e+=2){let n=t.charCodeAt(e)<<8|t.charCodeAt(e+1);if((63488&n)!=55296){r.push(n);continue}e+=2;let i=t.charCodeAt(e)<<8|t.charCodeAt(e+1);r.push(((1023&n)<<10)+(1023&i)+65536)}n[e]=String.fromCodePoint(...r)}),new zs(n)}catch(e){if(e instanceof wn)return null;if(this.options.ignoreErrors)return N(`readToUnicode - ignoring ToUnicode data: "${e}".`),null;throw e}return null}readCidToGidMap(e,t){let n=[];for(let r=0,i=e.length;r<i;r++){let i=e[r++]<<8|e[r],a=r>>1;(i!==0||t.has(a))&&(n[a]=i)}return n}extractWidths(e,t,n){let r=this.xref,i=[],a=0,o=[],s;if(n.composite){let t=e.get(`DW`);a=typeof t==`number`?Math.ceil(t):1e3;let c=e.get(`W`);if(Array.isArray(c))for(let e=0,t=c.length;e<t;e++){let t=r.fetchIfRef(c[e++]);if(!Number.isInteger(t))break;let n=r.fetchIfRef(c[e]);if(Array.isArray(n))for(let e of n){let n=r.fetchIfRef(e);typeof n==`number`&&(i[t]=n),t++}else{if(!Number.isInteger(n))break;{let a=r.fetchIfRef(c[++e]);if(typeof a!=`number`)continue;for(let e=t;e<=n;e++)i[e]=a}}}if(n.vertical){let t=e.getArray(`DW2`),n=Cr(t,2)?t:[880,-1e3];if(s=[n[1],.5*a,n[0]],n=e.get(`W2`),Array.isArray(n))for(let e=0,t=n.length;e<t;e++){let t=r.fetchIfRef(n[e++]);if(!Number.isInteger(t))break;let i=r.fetchIfRef(n[e]);if(Array.isArray(i))for(let e=0,n=i.length;e<n;e++){let n=[r.fetchIfRef(i[e++]),r.fetchIfRef(i[e++]),r.fetchIfRef(i[e])];Cr(n,null)&&(o[t]=n),t++}else{if(!Number.isInteger(i))break;{let a=[r.fetchIfRef(n[++e]),r.fetchIfRef(n[++e]),r.fetchIfRef(n[++e])];if(!Cr(a,null))continue;for(let e=t;e<=i;e++)o[e]=a}}}}}else{let o=e.get(`Widths`);if(Array.isArray(o)){let e=n.firstChar;for(let t of o){let n=r.fetchIfRef(t);typeof n==`number`&&(i[e]=n),e++}let s=t.get(`MissingWidth`);a=typeof s==`number`?s:0}else{let t=e.get(`BaseFont`);if(t instanceof I){let e=this.getBaseFontMetrics(t.name);i=this.buildCharCodeToWidth(e.widths,n),a=e.defaultWidth}}}let c=!0,l=a;for(let e in i){let t=i[e];if(t)if(l){if(l!==t){c=!1;break}}else l=t}c?n.flags|=Zo:n.flags&=-2,n.defaultWidth=a,n.widths=i,n.defaultVMetrics=s,n.vmetrics=o}isSerifFont(e){let t=e.split(`-`,1)[0];return t in Ms()||/serif/gi.test(t)}getBaseFontMetrics(e){let t=0,n=Object.create(null),r=!1,i=ks()[e]||e,a=ec();i in a||(i=this.isSerifFont(e)?`Times-Roman`:`Helvetica`);let o=a[i];return typeof o==`number`?(t=o,r=!0):n=o(),{defaultWidth:t,monospace:r,widths:n}}buildCharCodeToWidth(e,t){let n=Object.create(null),r=t.differences,i=t.defaultEncoding;for(let t=0;t<256;t++)t in r&&e[r[t]]?n[t]=e[r[t]]:t in i&&e[i[t]]&&(n[t]=e[i[t]]);return n}preEvaluateFont(e){let t=e,n=e.get(`Subtype`);if(!(n instanceof I))throw new F(`invalid font Subtype`);let r,i=!1;if(n.name===`Type0`){let t=e.get(`DescendantFonts`);if(!t)throw new F(`Descendant fonts are not specified`);if(!((e=Array.isArray(t)?this.xref.fetchIfRef(t[0]):t)instanceof L))throw new F(`Descendant font is not a dictionary.`);if(n=e.get(`Subtype`),!(n instanceof I))throw new F(`invalid font Subtype`);i=!0}let a=e.get(`FirstChar`);Number.isInteger(a)||(a=0);let o=e.get(`LastChar`);Number.isInteger(o)||(o=i?65535:255);let s=e.get(`FontDescriptor`),c=e.get(`ToUnicode`)||t.get(`ToUnicode`);if(s){r=new ud;let n=t.getRaw(`Encoding`);if(n instanceof I)r.update(n.name);else if(n instanceof R)r.update(n.toString());else if(n instanceof L){for(let e of n.getRawValues())if(e instanceof I)r.update(e.name);else if(e instanceof R)r.update(e.toString());else if(Array.isArray(e)){let t=e.length,n=Array(t);for(let r=0;r<t;r++){let t=e[r];t instanceof I?n[r]=t.name:(typeof t==`number`||t instanceof R)&&(n[r]=t.toString())}r.update(n.join())}}if(r.update(`${a}-${o}`),c instanceof tr){let e=c.str||c,t=e.buffer?new Uint8Array(e.buffer.buffer,0,e.bufferLength):new Uint8Array(e.bytes.buffer,e.start,e.end-e.start);r.update(t)}else c instanceof I&&r.update(c.name);let s=e.get(`Widths`)||t.get(`Widths`);if(Array.isArray(s)){let e=[];for(let t of s)(typeof t==`number`||t instanceof R)&&e.push(t.toString());r.update(e.join())}if(i){r.update(`compositeFont`);let n=e.get(`W`)||t.get(`W`);if(Array.isArray(n)){let e=[];for(let t of n)if(typeof t==`number`||t instanceof R)e.push(t.toString());else if(Array.isArray(t)){let n=[];for(let e of t)(typeof e==`number`||e instanceof R)&&n.push(e.toString());e.push(`[${n.join()}]`)}r.update(e.join())}let i=e.getRaw(`CIDToGIDMap`)||t.getRaw(`CIDToGIDMap`);i instanceof I?r.update(i.name):i instanceof R?r.update(i.toString()):i instanceof tr&&r.update(i.peekBytes())}}return{descriptor:s,dict:e,baseDict:t,composite:i,type:n.name,firstChar:a,lastChar:o,toUnicode:c,hash:r?r.hexdigest():``}}async translateFont({descriptor:e,dict:t,baseDict:r,composite:i,type:a,firstChar:o,lastChar:s,toUnicode:c,cssFontInfo:l}){let u=a===`Type3`;if(!e){if(!u){let e=t.get(`BaseFont`);if(!(e instanceof I))throw new F(`Base font is not specified`);e=e.name.replaceAll(/[,_]/g,`-`);let n=this.getBaseFontMetrics(e),i=e.split(`-`,1)[0],l=(this.isSerifFont(i)?Qo:0)|(n.monospace?Zo:0)|(Ns()[i]?$o:es),d={type:a,name:e,loadedName:r.loadedName,systemFontInfo:null,widths:n.widths,defaultWidth:n.defaultWidth,isSimulatedFlags:!0,flags:l,firstChar:o,lastChar:s,toUnicode:c,xHeight:0,capHeight:0,italicAngle:0,isType3Font:u},f=t.get(`Widths`),p=Ls(e),m=null;p&&(m=await this.fetchStandardFontData(p),d.isInternalFont=!!m),!d.isInternalFont&&this.options.useSystemFonts&&(d.systemFontInfo=od(this.systemFontCache,this.idFactory,this.options.standardFontDataUrl,e,p,a));let h=await this.extractDataStructures(t,d);if(Array.isArray(f)){let e=[],t=o;for(let n of f){let r=this.xref.fetchIfRef(n);typeof r==`number`&&(e[t]=r),t++}h.widths=e}else h.widths=this.buildCharCodeToWidth(n.widths,h);return new tl(e,m,h,this.options)}e=L.empty}let d=e.get(`FontName`),f=t.get(`BaseFont`);typeof d==`string`&&(d=I.get(d)),typeof f==`string`&&(f=I.get(f));let p=d?.name,m=f?.name;if(u?p||(d=I.get(a)):p!==m&&(hn(`The FontDescriptor's FontName is "${p}" but should be the same as the Font's BaseFont "${m}".`),p&&m&&(m.startsWith(p)||!Rs(p)&&Rs(m))&&(d=null),d||=f),!(d instanceof I))throw new F(`invalid font name`);let h,g,_,v,y;try{if(h=e.get(`FontFile`,`FontFile2`,`FontFile3`),h){if(!(h instanceof tr))throw new F(`FontFile should be a stream`);if(h.isEmpty)throw new F(`FontFile is empty`)}}catch(e){if(!this.options.ignoreErrors)throw e;N(`translateFont - fetching "${d.name}" font file: "${e}".`),h=null}let b=!1,x=null,S=null;if(h){if(h.dict){let e=h.dict.get(`Subtype`);e instanceof I&&(g=e.name),_=h.dict.get(`Length1`),v=h.dict.get(`Length2`),y=h.dict.get(`Length3`)}}else if(l){let e=au(d.name);e&&(l.fontFamily=`${l.fontFamily}-PdfJS-XFA`,l.metrics=e.metrics||null,x=e.factors||null,h=await this.fetchStandardFontData(e.name),b=!!h,r=t=ou(d.name),i=!0)}else if(!u){let e=Ls(d.name);e&&(h=await this.fetchStandardFontData(e),b=!!h),!b&&this.options.useSystemFonts&&(S=od(this.systemFontCache,this.idFactory,this.options.standardFontDataUrl,d.name,e,a))}let C=wr(t.getArray(`FontMatrix`),n),w=Er(e.getArray(`FontBBox`)||t.getArray(`FontBBox`),u?[0,0,0,0]:void 0),T=e.get(`Ascent`);typeof T!=`number`&&(T=void 0);let E=e.get(`Descent`);typeof E!=`number`&&(E=void 0);let D=e.get(`XHeight`);typeof D!=`number`&&(D=0);let O=e.get(`CapHeight`);typeof O!=`number`&&(O=0);let k=e.get(`Flags`);Number.isInteger(k)||(k=0);let ee=e.get(`ItalicAngle`);typeof ee!=`number`&&(ee=0);let A={type:a,name:d.name,subtype:g,file:h,length1:_,length2:v,length3:y,isInternalFont:b,loadedName:r.loadedName,composite:i,fixedPitch:!1,fontMatrix:C,firstChar:o,lastChar:s,toUnicode:c,bbox:w,ascent:T,descent:E,xHeight:D,capHeight:O,flags:k,italicAngle:ee,isType3Font:u,cssFontInfo:l,scaleFactors:x,systemFontInfo:S};if(i){let e=r.get(`Encoding`);e instanceof I&&(A.cidEncoding=e.name),A.cMap=await No.create({encoding:e,fetchBuiltInCMap:this._fetchBuiltInCMapBound,useCMap:null}),A.vertical=A.cMap.vertical}let j=await this.extractDataStructures(t,A);return this.extractWidths(t,e,j),new tl(d.name,h,j,this.options)}static buildFontPaths(e,t,n,r){function i(t){let i=`${e.loadedName}_path_${t}`;try{if(e.renderer.hasBuiltPath(t))return;n.send(`commonobj`,[i,`FontPath`,e.renderer.getPathJs(t)])}catch(e){if(r.ignoreErrors)return void N(`buildFontPaths - ignoring ${i} glyph: "${e}".`);throw e}}for(let e of t){i(e.fontChar);let t=e.accent;t?.fontChar&&i(t.fontChar)}}static get fallbackFontDict(){let e=new L;return e.set(`BaseFont`,I.get(`Helvetica`)),e.set(`Type`,I.get(`FallbackType`)),e.set(`Subtype`,I.get(`FallbackType`)),e.set(`Encoding`,I.get(`WinAnsiEncoding`)),P(this,`fallbackFontDict`,e)}},xd=class{#e=!1;#t=null;constructor({loadedName:e,font:t,dict:n}){this.loadedName=e,this.font=t,this.dict=n,this.type3Dependencies=t.isType3Font?new Set:null}send(e){if(this.#e)return;this.#e=!0;let t=this.font.exportData(),n=[];t.data&&(t.data.charProcOperatorList&&(t.charProcOperatorList=t.data.charProcOperatorList),t.data=Zu.write(t.data),n.push(t.data)),e.send(`commonobj`,[this.loadedName,`Font`,t],n)}fallback(e,t){this.font.data&&(this.font.disableFontFace=!0,bd.buildFontPaths(this.font,this.font.glyphCacheValues,e,t))}loadType3Data(e,t,n){if(this.#t)return this.#t;let{font:r,type3Dependencies:i}=this;_n(r.isType3Font,`Must be a Type3 font.`);let a=e.clone({ignoreErrors:!1}),o=new Yn(e.type3FontRefs);this.dict.objId&&!o.has(this.dict.objId)&&o.put(this.dict.objId),a.type3FontRefs=o;let s=Promise.resolve(),c=this.dict.get(`CharProcs`),l=this.dict.get(`Resources`)||t,u=Object.create(null),[d,f,p,m]=r.bbox,h=p-d,g=m-f,_=Math.hypot(h,g);for(let e of c.getKeys())s=s.then(()=>{let t=c.get(e),r=new ra;return a.getOperatorList({stream:t,task:n,resources:l,operatorList:r}).then(()=>{switch(r.fnArray[0]){case vt:this.#n(r,_);break;case _t:_||this.#r(r)}u[e]=r.getIR();for(let e of r.dependencies)i.add(e)}).catch(function(t){N(`Type3 font resource "${e}" is not available.`),u[e]=new ra().getIR()})});return this.#t=s.then(()=>{r.charProcOperatorList=u,this._bbox&&(r.isCharBBox=!0,r.bbox=this._bbox)}),this.#t}#n(e,t=NaN){let n=jn.normalizeRect(e.argsArray[0].slice(2)),r=n[2]-n[0],i=n[3]-n[1];r===0||i===0?(e.fnArray.splice(0,1),e.argsArray.splice(0,1)):(t===0||Math.round(Math.hypot(r,i)/t)>=10)&&(this._bbox??=[1/0,1/0,-1/0,-1/0],jn.rectBoundingBox(...n,this._bbox));let a=0,o=e.length;for(;a<o;){switch(e.fnArray[a]){case vt:break;case yt:case bt:case xt:case St:case Ct:case wt:case Tt:case Et:case Dt:case Ot:case kt:case At:case jt:case Ae:e.fnArray.splice(a,1),e.argsArray.splice(a,1),o--;continue;case Me:let[t]=e.argsArray[a],n=0,r=t.length;for(;n<r;){let[e]=t[n];switch(e){case`TR`:case`TR2`:case`HT`:case`BG`:case`BG2`:case`UCR`:case`UCR2`:t.splice(n,1),r--;continue}n++}}a++}}#r(e){let t=1,n=e.length;for(;t<n;){if(e.fnArray[t]===rn){let n=e.argsArray[t][2];this._bbox??=[1/0,1/0,-1/0,-1/0],jn.rectBoundingBox(...n,this._bbox)}t++}}},Sd=class{constructor(e=new wd){this.state=e,this.stateStack=[]}save(){let e=this.state;this.stateStack.push(this.state),this.state=e.clone()}restore(){let e=this.stateStack.pop();e&&(this.state=e)}transform(e){this.state.ctm=jn.transform(this.state.ctm,e)}},Cd=class{constructor(){this.ctm=new Float32Array(ir),this.fontName=null,this.fontSize=0,this.loadedName=null,this.font=null,this.fontMatrix=n,this.textMatrix=ir.slice(),this.textLineMatrix=ir.slice(),this.charSpacing=0,this.wordSpacing=0,this.leading=0,this.textHScale=1,this.textRise=0}setTextMatrix(e,t,n,r,i,a){let o=this.textMatrix;o[0]=e,o[1]=t,o[2]=n,o[3]=r,o[4]=i,o[5]=a}setTextLineMatrix(e,t,n,r,i,a){let o=this.textLineMatrix;o[0]=e,o[1]=t,o[2]=n,o[3]=r,o[4]=i,o[5]=a}translateTextMatrix(e,t){let n=this.textMatrix;n[4]=n[0]*e+n[2]*t+n[4],n[5]=n[1]*e+n[3]*t+n[5]}translateTextLineMatrix(e,t){let n=this.textLineMatrix;n[4]=n[0]*e+n[2]*t+n[4],n[5]=n[1]*e+n[3]*t+n[5]}carriageReturn(){this.translateTextLineMatrix(0,-this.leading),this.textMatrix=this.textLineMatrix.slice()}clone(){let e=Object.create(this);return e.textMatrix=this.textMatrix.slice(),e.textLineMatrix=this.textLineMatrix.slice(),e.fontMatrix=this.fontMatrix.slice(),e}},wd=class{constructor(){this.ctm=new Float32Array(ir),this.font=null,this.textRenderingMode=x,this._fillColorSpace=this._strokeColorSpace=Di.gray,this.patternFillColorSpace=null,this.patternStrokeColorSpace=null,this.currentPointX=this.currentPointY=0,this.pathMinMax=new Float32Array([1/0,1/0,-1/0,-1/0]),this.pathBuffer=[]}get fillColorSpace(){return this._fillColorSpace}set fillColorSpace(e){this._fillColorSpace=this.patternFillColorSpace=e}get strokeColorSpace(){return this._strokeColorSpace}set strokeColorSpace(e){this._strokeColorSpace=this.patternStrokeColorSpace=e}clone({newPath:e=!1}={}){let t=Object.create(this);return e&&(t.pathBuffer=[],t.pathMinMax=new Float32Array([1/0,1/0,-1/0,-1/0])),t}},Td=class e{static get opMap(){return P(this,`opMap`,Object.assign(Object.create(null),{w:{id:Te,numArgs:1,variableArgs:!1},J:{id:Ee,numArgs:1,variableArgs:!1},j:{id:De,numArgs:1,variableArgs:!1},M:{id:Oe,numArgs:1,variableArgs:!1},d:{id:ke,numArgs:2,variableArgs:!1},ri:{id:Ae,numArgs:1,variableArgs:!1},i:{id:je,numArgs:1,variableArgs:!1},gs:{id:Me,numArgs:1,variableArgs:!1},q:{id:Ne,numArgs:0,variableArgs:!1},Q:{id:Pe,numArgs:0,variableArgs:!1},cm:{id:Fe,numArgs:6,variableArgs:!1},m:{id:Ie,numArgs:2,variableArgs:!1},l:{id:Le,numArgs:2,variableArgs:!1},c:{id:Re,numArgs:6,variableArgs:!1},v:{id:ze,numArgs:4,variableArgs:!1},y:{id:Be,numArgs:4,variableArgs:!1},h:{id:Ve,numArgs:0,variableArgs:!1},re:{id:He,numArgs:4,variableArgs:!1},S:{id:Ue,numArgs:0,variableArgs:!1},s:{id:We,numArgs:0,variableArgs:!1},f:{id:Ge,numArgs:0,variableArgs:!1},F:{id:Ge,numArgs:0,variableArgs:!1},"f*":{id:Ke,numArgs:0,variableArgs:!1},B:{id:qe,numArgs:0,variableArgs:!1},"B*":{id:Je,numArgs:0,variableArgs:!1},b:{id:Ye,numArgs:0,variableArgs:!1},"b*":{id:Xe,numArgs:0,variableArgs:!1},n:{id:Ze,numArgs:0,variableArgs:!1},W:{id:Qe,numArgs:0,variableArgs:!1},"W*":{id:$e,numArgs:0,variableArgs:!1},BT:{id:et,numArgs:0,variableArgs:!1},ET:{id:tt,numArgs:0,variableArgs:!1},Tc:{id:nt,numArgs:1,variableArgs:!1},Tw:{id:rt,numArgs:1,variableArgs:!1},Tz:{id:it,numArgs:1,variableArgs:!1},TL:{id:at,numArgs:1,variableArgs:!1},Tf:{id:ot,numArgs:2,variableArgs:!1},Tr:{id:st,numArgs:1,variableArgs:!1},Ts:{id:ct,numArgs:1,variableArgs:!1},Td:{id:lt,numArgs:2,variableArgs:!1},TD:{id:ut,numArgs:2,variableArgs:!1},Tm:{id:dt,numArgs:6,variableArgs:!1},"T*":{id:ft,numArgs:0,variableArgs:!1},Tj:{id:pt,numArgs:1,variableArgs:!1},TJ:{id:mt,numArgs:1,variableArgs:!1},"'":{id:ht,numArgs:1,variableArgs:!1},'"':{id:gt,numArgs:3,variableArgs:!1},d0:{id:_t,numArgs:2,variableArgs:!1},d1:{id:vt,numArgs:6,variableArgs:!1},CS:{id:yt,numArgs:1,variableArgs:!1},cs:{id:bt,numArgs:1,variableArgs:!1},SC:{id:xt,numArgs:4,variableArgs:!0},SCN:{id:St,numArgs:33,variableArgs:!0},sc:{id:Ct,numArgs:4,variableArgs:!0},scn:{id:wt,numArgs:33,variableArgs:!0},G:{id:Tt,numArgs:1,variableArgs:!1},g:{id:Et,numArgs:1,variableArgs:!1},RG:{id:Dt,numArgs:3,variableArgs:!1},rg:{id:Ot,numArgs:3,variableArgs:!1},K:{id:kt,numArgs:4,variableArgs:!1},k:{id:At,numArgs:4,variableArgs:!1},sh:{id:jt,numArgs:1,variableArgs:!1},BI:{id:Mt,numArgs:0,variableArgs:!1},ID:{id:Nt,numArgs:0,variableArgs:!1},EI:{id:Pt,numArgs:1,variableArgs:!1},Do:{id:Ft,numArgs:1,variableArgs:!1},MP:{id:It,numArgs:1,variableArgs:!1},DP:{id:Lt,numArgs:2,variableArgs:!1},BMC:{id:Rt,numArgs:1,variableArgs:!1},BDC:{id:zt,numArgs:2,variableArgs:!1},EMC:{id:Bt,numArgs:0,variableArgs:!1},BX:{id:Vt,numArgs:0,variableArgs:!1},EX:{id:Ht,numArgs:0,variableArgs:!1},BM:null,BD:null,true:null,fa:null,fal:null,fals:null,false:null,nu:null,nul:null,null:null}))}static MAX_INVALID_PATH_OPS=10;constructor(t,n,r=new Sd){this.parser=new uo({lexer:new mo(t,e.opMap),xref:n}),this.stateManager=r,this.nonProcessedArgs=[],this._isPathOp=!1,this._numInvalidPathOPS=0}get savedStatesDepth(){return this.stateManager.stateStack.length}read(t){let n=t.args;for(;;){let r=this.parser.getObj();if(r instanceof qn){let i=r.cmd,a=e.opMap[i];if(!a){N(`Unknown command "${i}".`);continue}let o=a.id,s=a.numArgs,c=n===null?0:n.length;if(this._isPathOp||(this._numInvalidPathOPS=0),this._isPathOp=o>=Ie&&o<=Ze,a.variableArgs)c>s&&hn(`Command ${i}: expected [0, ${s}] args, but received ${c} args.`);else{if(c!==s){let e=this.nonProcessedArgs;for(;c>s;)e.push(n.shift()),c--;for(;c<s&&e.length!==0;)n===null&&(n=[]),n.unshift(e.pop()),c++}if(c<s){let t=`command ${i}: expected ${s} args, but received ${c} args.`;if(this._isPathOp&&++this._numInvalidPathOPS>e.MAX_INVALID_PATH_OPS)throw new F(`Invalid ${t}`);N(`Skipping ${t}`),n!==null&&(n.length=0);continue}}return this.preprocessCommand(o,n),t.fn=o,t.args=n,!0}if(r===Un)return!1;if(r!==null&&(n===null&&(n=[]),n.push(r),n.length>33))throw new F(`Too many arguments`)}}preprocessCommand(e,t){switch(0|e){case Ne:this.stateManager.save();break;case Pe:this.stateManager.restore();break;case Fe:this.stateManager.transform(t)}}},Ed=class extends Td{constructor(e){super(new _i(e))}parse(){let e={fn:0,args:[]},t={fontSize:0,fontName:``,fontColor:new Uint8ClampedArray(3)};try{for(;e.args.length=0,this.read(e);){if(this.savedStatesDepth!==0)continue;let{fn:n,args:r}=e;switch(0|n){case ot:let[e,n]=r;e instanceof I&&(t.fontName=e.name),typeof n==`number`&&n>0&&(t.fontSize=n);break;case Ot:Di.rgb.getRgbItem(r,0,t.fontColor,0);break;case Et:Di.gray.getRgbItem(r,0,t.fontColor,0);break;case At:Di.cmyk.getRgbItem(r,0,t.fontColor,0)}}}catch(e){N(`parseDefaultAppearance - ignoring errors: "${e}".`)}return t}};function Dd(e){return new Ed(e).parse()}var Od=class extends Td{constructor(e,t,n,r){super(e),this.stream=e,this.evaluatorOptions=t,this.xref=n,this.globalColorSpaceCache=r,this.resources=e.dict?.get(`Resources`)}parse(){let e={fn:0,args:[]},t={scaleFactor:1,fontSize:0,fontName:``,fontColor:new Uint8ClampedArray(3),fillColorSpace:Di.gray},n=!1,r=[];try{for(;e.args.length=0,!n&&this.read(e);){let{fn:i,args:a}=e;switch(0|i){case Ne:r.push({scaleFactor:t.scaleFactor,fontSize:t.fontSize,fontName:t.fontName,fontColor:t.fontColor.slice(),fillColorSpace:t.fillColorSpace});break;case Pe:t=r.pop()||t;break;case dt:t.scaleFactor*=Math.hypot(a[0],a[1]);break;case ot:let[e,i]=a;e instanceof I&&(t.fontName=e.name),typeof i==`number`&&i>0&&(t.fontSize=i*t.scaleFactor);break;case bt:t.fillColorSpace=Di.parse({cs:a[0],xref:this.xref,resources:this.resources,pdfFunctionFactory:this._pdfFunctionFactory,globalColorSpaceCache:this.globalColorSpaceCache,localColorSpaceCache:this._localColorSpaceCache});break;case Ct:t.fillColorSpace.getRgbItem(a,0,t.fontColor,0);break;case Ot:Di.rgb.getRgbItem(a,0,t.fontColor,0);break;case Et:Di.gray.getRgbItem(a,0,t.fontColor,0);break;case At:Di.cmyk.getRgbItem(a,0,t.fontColor,0);break;case pt:case mt:case ht:case gt:n=!0}}}catch(e){N(`parseAppearanceStream - ignoring errors: "${e}".`)}return this.stream.reset(),delete t.scaleFactor,delete t.fillColorSpace,t}get _localColorSpaceCache(){return P(this,`_localColorSpaceCache`,new pu)}get _pdfFunctionFactory(){return P(this,`_pdfFunctionFactory`,new bu({xref:this.xref,isEvalSupported:this.evaluatorOptions.isEvalSupported}))}};function kd(e,t){return e[0]===e[1]&&e[1]===e[2]?`${Rr(e[0]/255)} ${t?`g`:`G`}`:Array.from(e,e=>Rr(e/255)).join(` `)+` `+(t?`rg`:`RG`)}var Ad=class e{constructor(t,n){this.xref=t,this.widths=null,this.firstChar=1/0,this.lastChar=-1/0,this.fontFamily=n,this.ctxMeasure=new OffscreenCanvas(1,1).getContext(`2d`,{willReadFrequently:!0}),e._fontNameId||=1,this.fontName=I.get(`InvalidPDFjsFont_${n}_${e._fontNameId++}`)}get fontDescriptorRef(){if(!e._fontDescriptorRef){let t=new L(this.xref);t.setIfName(`Type`,`FontDescriptor`),t.set(`FontName`,this.fontName),t.set(`FontFamily`,`MyriadPro Regular`),t.set(`FontBBox`,[0,0,0,0]),t.setIfName(`FontStretch`,`Normal`),t.set(`FontWeight`,400),t.set(`ItalicAngle`,0),e._fontDescriptorRef=this.xref.getNewPersistentRef(t)}return e._fontDescriptorRef}get descendantFontRef(){let e=new L(this.xref);e.set(`BaseFont`,this.fontName),e.setIfName(`Type`,`Font`),e.setIfName(`Subtype`,`CIDFontType0`),e.setIfName(`CIDToGIDMap`,`Identity`),e.set(`FirstChar`,this.firstChar),e.set(`LastChar`,this.lastChar),e.set(`FontDescriptor`,this.fontDescriptorRef),e.set(`DW`,1e3);let t=[],n=[...this.widths.entries()].sort(),r=null,i=null;for(let[e,a]of n)r?e===r+i.length?i.push(a):(t.push(r,i),r=e,i=[a]):(r=e,i=[a]);r&&t.push(r,i),e.set(`W`,t);let a=new L(this.xref);return a.set(`Ordering`,`Identity`),a.set(`Registry`,`Adobe`),a.set(`Supplement`,0),e.set(`CIDSystemInfo`,a),this.xref.getNewPersistentRef(e)}get baseFontRef(){let e=new L(this.xref);return e.set(`BaseFont`,this.fontName),e.setIfName(`Type`,`Font`),e.setIfName(`Subtype`,`Type0`),e.setIfName(`Encoding`,`Identity-H`),e.set(`DescendantFonts`,[this.descendantFontRef]),e.setIfName(`ToUnicode`,`Identity-H`),this.xref.getNewPersistentRef(e)}get resources(){let e=new L(this.xref),t=new L(this.xref);return t.set(this.fontName.name,this.baseFontRef),e.set(`Font`,t),e}_createContext(){return this.widths=new Map,this.ctxMeasure.font=`1000px ${this.fontFamily}`,this.ctxMeasure}createFontResources(e){let t=this._createContext();for(let n of e.split(/\r\n?|\n/))for(let e of n.split(``)){let n=e.charCodeAt(0);if(this.widths.has(n))continue;let r=t.measureText(e),i=Math.ceil(r.width);this.widths.set(n,i),this.firstChar=Math.min(n,this.firstChar),this.lastChar=Math.max(n,this.lastChar)}return this.resources}static getFirstPositionInfo(e,t,n){let[a,o,s,c]=e,l=s-a,u=c-o;t%180!=0&&([l,u]=[u,l]);let d=r*n;return{coords:[0,u+i*n-d],bbox:[0,0,l,u],matrix:t===0?void 0:Ur(t,u,d)}}createAppearance(e,t,n,a,o,s){let c=this._createContext(),l=[],u=-1/0;for(let t of e.split(/\r\n?|\n/)){l.push(t);let e=c.measureText(t).width;u=Math.max(u,e);for(let e of Nr(t)){let t=String.fromCodePoint(e),n=this.widths.get(e);if(n===void 0){let r=c.measureText(t);n=Math.ceil(r.width),this.widths.set(e,n),this.firstChar=Math.min(e,this.firstChar),this.lastChar=Math.max(e,this.lastChar)}}}u*=a/1e3;let[d,f,p,m]=t,h=p-d,g=m-f;n%180!=0&&([h,g]=[g,h]);let _=1;u>h&&(_=h/u);let v=1,y=r*a,b=i*a,x=y*l.length;x>g&&(v=g/x);let S=a*Math.min(_,v),C=[`q`,`0 0 ${Rr(h)} ${Rr(g)} re W n`,`BT`,`1 0 0 1 0 ${Rr(g+b)} Tm 0 Tc ${kd(o,!0)}`,`/${this.fontName.name} ${Rr(S)} Tf`],{resources:w}=this;if((s=typeof s==`number`&&s>=0&&s<=1?s:1)!==1){C.push(`/R0 gs`);let e=new L(this.xref),t=new L(this.xref);t.set(`ca`,s),t.set(`CA`,s),t.setIfName(`Type`,`ExtGState`),e.set(`R0`,t),w.set(`ExtGState`,e)}let T=Rr(y);for(let e of l)C.push(`0 -${T} Td <${Vr(e)}> Tj`);C.push(`ET`,`Q`);let E=C.join(`
6
+ `),C(),v.initialized?(v.hasEOL=!0,ue()):_.items.push({str:``,dir:`ltr`,width:0,height:0,transform:M(),fontName:A.loadedName,hasEOL:!0})}function le(e,t,n){if(n*v.spaceInFlowMin<=e&&e<=n*v.spaceInFlowMax)return v.initialized&&(C(),v.str.push(` `),m?.addExtraChar(` `)),!1;let r=v.fontName,i=0;return v.vertical&&(i=e,e=0),ue(),C(),j({width:Math.abs(e),height:Math.abs(i),transform:t||M(),fontName:r}),!0}function ue(){v.initialized&&v.str&&(v.vertical?v.totalHeight+=v.height*v.textAdvanceScale:v.totalWidth+=v.width*v.textAdvanceScale,_.items.push(re(v)),v.initialized=!1,v.str.length=0)}function de(e=!1){let t=_.items.length;t!==0&&(e&&t<10||(o?.enqueue(_,t),_.items=[],_.styles=Object.create(null)))}let fe=new yd;return new Promise(function e(n,p){let m=function(t){de(!0),Promise.all([t,o?.ready]).then(function(){try{e(n,p)}catch(e){p(e)}},p)};t.ensureNotTerminated(),fe.reset();let h={},v,y,b,x=[];for(;!(v=fe.check())&&(x.length=0,h.args=x,ee.read(h));){let e=A;A=i.state;let n=h.fn;switch(x=h.args,0|n){case ot:let n=x[0].name,p=x[1];if(A.font&&n===A.fontName&&p===A.fontSize)break;ue(),A.fontName=n,A.fontSize=p,m(ie(n,null));return;case ct:A.textRise=x[0];break;case it:A.textHScale=x[0]/100;break;case at:A.leading=x[0];break;case lt:A.translateTextLineMatrix(x[0],x[1]),A.textMatrix=A.textLineMatrix.slice();break;case ut:A.leading=-x[1],A.translateTextLineMatrix(x[0],x[1]),A.textMatrix=A.textLineMatrix.slice();break;case ft:A.carriageReturn();break;case dt:A.setTextMatrix(x[0],x[1],x[2],x[3],x[4],x[5]),A.setTextLineMatrix(x[0],x[1],x[2],x[3],x[4],x[5]),ne();break;case nt:A.charSpacing=x[0];break;case rt:A.wordSpacing=x[0];break;case et:A.textMatrix=ir.slice(),A.textLineMatrix=ir.slice();break;case mt:if(!i.state.font){w.ensureStateFont(i.state);continue}let h=(A.font.vertical?1:-1)*A.fontSize/1e3,v=x[0];for(let e=0,t=v.length;e<t;e++){let t=v[e];if(typeof t==`string`)E.push(t);else if(typeof t==`number`&&t!==0){let e=E.join(``);E.length=0,se({chars:e,extraSpacing:t*h})}}if(E.length>0){let e=E.join(``);E.length=0,se({chars:e,extraSpacing:0})}break;case pt:if(!i.state.font){w.ensureStateFont(i.state);continue}se({chars:x[0],extraSpacing:0});break;case ht:if(!i.state.font){w.ensureStateFont(i.state);continue}A.carriageReturn(),se({chars:x[0],extraSpacing:0});break;case gt:if(!i.state.font){w.ensureStateFont(i.state);continue}A.wordSpacing=x[0],A.charSpacing=x[1],A.carriageReturn(),se({chars:x[2],extraSpacing:0});break;case Ft:if(ue(),D??=r.get(`XObject`)||L.empty,b=x[0]instanceof I,y=x[0].name,b&&O.getByName(y))break;m(new Promise(function(e,n){if(!b)throw new F(`XObject must be referred to by name.`);let p=D.getRaw(y);if(p instanceof R){if(O.getByRef(p)||w.globalImageCache.getData(p,w.pageIndex))return void e();p=T.fetch(p)}if(!(p instanceof tr))throw new F(`XObject should be a stream`);let{dict:m}=p,h=m.get(`Subtype`);if(!(h instanceof I))throw new F(`XObject should have a Name subtype`);if(h.name!==`Form`)return O.set(y,m.objId,!0),void e();let _=new Sd(i.state.clone()),v=wr(m.getArray(`Matrix`),null);v&&_.transform(v);let x=m.get(`Resources`);de();let S={enqueueInvoked:!1,enqueue(e,t){this.enqueueInvoked=!0,o.enqueue(e,t)},get desiredSize(){return o.desiredSize??0},get ready(){return o.ready}};w.getTextContent({stream:p,task:t,resources:x instanceof L?x:r,stateManager:_,includeMarkedContent:a,sink:o&&S,seenStyles:s,viewBox:c,lang:l,markedContentData:u,disableNormalization:d,keepWhiteSpace:f,prevRefs:g}).then(function(){S.enqueueInvoked||O.set(y,m.objId,!0),e()},n)}).catch(function(e){if(!(e instanceof wn)){if(!w.options.ignoreErrors)throw e;N(`getTextContent - ignoring XObject: "${e}".`)}}));return;case Me:if(b=x[0]instanceof I,y=x[0].name,b&&k.getByName(y))break;m(new Promise(function(e,t){if(!b)throw new F(`GState must be referred to by name.`);let n=r.get(`ExtGState`);if(!(n instanceof L))throw new F(`ExtGState should be a dictionary.`);let i=n.get(y);if(!(i instanceof L))throw new F(`GState should be a dictionary.`);let a=i.get(`Font`);if(!a)return k.set(y,i.objId,!0),void e();ue(),A.fontName=null,A.fontSize=a[1],ie(null,a[0]).then(e,t)}).catch(function(e){if(!(e instanceof wn)){if(!w.options.ignoreErrors)throw e;N(`getTextContent - ignoring ExtGState: "${e}".`)}}));return;case Rt:ue(),a&&(u.level++,_.items.push({type:`beginMarkedContent`,tag:x[0]instanceof I?x[0].name:null}));break;case zt:if(ue(),a){u.level++;let e=null;x[1]instanceof L&&(e=x[1].get(`MCID`)),_.items.push({type:`beginMarkedContentProps`,id:Number.isInteger(e)?`${w.idFactory.getPageObjId()}_mc${e}`:null,tag:x[0]instanceof I?x[0].name:null})}break;case Bt:if(ue(),a){if(u.level===0)break;u.level--,_.items.push({type:`endMarkedContent`})}break;case Pe:!e||e.font===A.font&&e.fontSize===A.fontSize&&e.fontName===A.fontName||ue()}if(_.items.length>=(o?.desiredSize??1)){v=!0;break}}v?m(gd):(ue(),de(),n())}).catch(e=>{if(!(e instanceof wn)){if(this.options.ignoreErrors)return N(`getTextContent - ignoring errors during "${t.name}" task: "${e}".`),ue(),void de();throw e}})}async extractDataStructures(e,t){let n=this.xref,r,i=this.readToUnicode(t.toUnicode);if(t.composite){let n=e.get(`CIDSystemInfo`);n instanceof L&&(t.cidSystemInfo={registry:Nn(n.get(`Registry`)),ordering:Nn(n.get(`Ordering`)),supplement:n.get(`Supplement`)});try{let t=e.get(`CIDToGIDMap`);t instanceof tr&&(r=t.getBytes())}catch(e){if(!this.options.ignoreErrors)throw e;N(`extractDataStructures - ignoring CIDToGIDMap data: "${e}".`)}}let a=[],o,s=null;if(e.has(`Encoding`)){if(o=e.get(`Encoding`),o instanceof L){if(s=o.get(`BaseEncoding`),s=s instanceof I?s.name:null,o.has(`Differences`)){let e=o.get(`Differences`),t=0;for(let r of e){let e=n.fetchIfRef(r);if(typeof e==`number`)t=e;else{if(!(e instanceof I))throw new F(`Invalid entry in 'Differences' array: ${e}`);a[t++]=e.name}}}}else if(o instanceof I)s=o.name;else{let e=`Encoding is not a Name nor a Dict`;if(!this.options.ignoreErrors)throw new F(e);N(e)}s!==`MacRomanEncoding`&&s!==`MacExpertEncoding`&&s!==`WinAnsiEncoding`&&(s=null)}let c=!t.file||t.isInternalFont,l=Ns()[t.name];if(s&&c&&l&&(s=null),s)t.defaultEncoding=Vo(s);else{let e=!!(t.flags&$o),n=!!(t.flags&es);t.type===`TrueType`&&e&&n&&a.length!==0&&(t.flags&=-5,e=!1),o=Lo,t.type!==`TrueType`||n||(o=Ro),(e||l)&&(o=Io,c&&(/Symbol/i.test(t.name)?o=zo:/Dingbats/i.test(t.name)?o=Bo:/Wingdings/i.test(t.name)&&(o=Ro))),t.defaultEncoding=o}t.differences=a,t.baseEncodingName=s,t.hasEncoding=!!s||a.length>0,t.dict=e,t.toUnicode=await i;let u=await this.buildToUnicode(t);return t.toUnicode=u,r&&(t.cidToGidMap=this.readCidToGidMap(r,u)),t}_simpleFontToUnicode(e,t=!1){_n(!e.composite,`Must be a simple font.`);let n=[],r=e.defaultEncoding.slice(),i=e.baseEncodingName,a=e.differences;for(let e in a){let t=a[e];t!==`.notdef`&&(r[e]=t)}let o=Ho();for(let a in r){let s=r[a];if(s===``)continue;let c=o[s];if(c!==void 0){n[a]=String.fromCharCode(c);continue}let l=0;switch(s[0]){case`G`:s.length===3&&(l=parseInt(s.substring(1),16));break;case`g`:s.length===5&&(l=parseInt(s.substring(1),16));break;case`C`:case`c`:if(s.length>=3&&s.length<=4){let n=s.substring(1);if(t){l=parseInt(n,16);break}if(l=+n,Number.isNaN(l)&&Number.isInteger(parseInt(n,16)))return this._simpleFontToUnicode(e,!0)}break;case`u`:c=Go(s,o),c!==-1&&(l=c);break;default:switch(s){case`f_h`:case`f_t`:case`T_h`:n[a]=s.replaceAll(`_`,``);continue}}if(l>0&&l<=1114111&&Number.isInteger(l)){if(i&&l===+a){let e=Vo(i);if(e&&(s=e[a])){n[a]=String.fromCharCode(o[s]);continue}}n[a]=String.fromCodePoint(l)}}return n}async buildToUnicode(e){if(e.hasIncludedToUnicodeMap=e.toUnicode?.length>0,e.hasIncludedToUnicodeMap)return!e.composite&&e.hasEncoding&&(e.fallbackToUnicode=this._simpleFontToUnicode(e)),e.toUnicode;if(!e.composite)return new zs(this._simpleFontToUnicode(e));if(e.composite&&(e.cMap.builtInCMap&&!(e.cMap instanceof yo)||e.cidSystemInfo?.registry===`Adobe`&&(e.cidSystemInfo.ordering===`GB1`||e.cidSystemInfo.ordering===`CNS1`||e.cidSystemInfo.ordering===`Japan1`||e.cidSystemInfo.ordering===`Korea1`))){let{registry:t,ordering:n}=e.cidSystemInfo,r=I.get(`${t}-${n}-UCS2`),i=await No.create({encoding:r,fetchBuiltInCMap:this._fetchBuiltInCMapBound,useCMap:null}),a=[],o=[];return e.cMap.forEach(function(e,t){if(t>65535)throw new F(`Max size of CID is 65,535`);let n=i.lookup(t);if(n){o.length=0;for(let e=0,t=n.length;e<t;e+=2)o.push((n.charCodeAt(e)<<8)+n.charCodeAt(e+1));a[e]=String.fromCharCode(...o)}}),new zs(a)}return new Bs(e.firstChar,e.lastChar)}async readToUnicode(e){if(!e)return null;if(e instanceof I){let t=await No.create({encoding:e,fetchBuiltInCMap:this._fetchBuiltInCMapBound,useCMap:null});return t instanceof yo?new Bs(0,65535):new zs(t.getMap())}if(e instanceof tr)try{let t=await No.create({encoding:e,fetchBuiltInCMap:this._fetchBuiltInCMapBound,useCMap:null});if(t instanceof yo)return new Bs(0,65535);let n=Array(t.length);return t.forEach(function(e,t){if(typeof t==`number`)return void(n[e]=String.fromCodePoint(t));t.length%2!=0&&(t=`\0`+t);let r=[];for(let e=0;e<t.length;e+=2){let n=t.charCodeAt(e)<<8|t.charCodeAt(e+1);if((63488&n)!=55296){r.push(n);continue}e+=2;let i=t.charCodeAt(e)<<8|t.charCodeAt(e+1);r.push(((1023&n)<<10)+(1023&i)+65536)}n[e]=String.fromCodePoint(...r)}),new zs(n)}catch(e){if(e instanceof wn)return null;if(this.options.ignoreErrors)return N(`readToUnicode - ignoring ToUnicode data: "${e}".`),null;throw e}return null}readCidToGidMap(e,t){let n=[];for(let r=0,i=e.length;r<i;r++){let i=e[r++]<<8|e[r],a=r>>1;(i!==0||t.has(a))&&(n[a]=i)}return n}extractWidths(e,t,n){let r=this.xref,i=[],a=0,o=[],s;if(n.composite){let t=e.get(`DW`);a=typeof t==`number`?Math.ceil(t):1e3;let c=e.get(`W`);if(Array.isArray(c))for(let e=0,t=c.length;e<t;e++){let t=r.fetchIfRef(c[e++]);if(!Number.isInteger(t))break;let n=r.fetchIfRef(c[e]);if(Array.isArray(n))for(let e of n){let n=r.fetchIfRef(e);typeof n==`number`&&(i[t]=n),t++}else{if(!Number.isInteger(n))break;{let a=r.fetchIfRef(c[++e]);if(typeof a!=`number`)continue;for(let e=t;e<=n;e++)i[e]=a}}}if(n.vertical){let t=e.getArray(`DW2`),n=Cr(t,2)?t:[880,-1e3];if(s=[n[1],.5*a,n[0]],n=e.get(`W2`),Array.isArray(n))for(let e=0,t=n.length;e<t;e++){let t=r.fetchIfRef(n[e++]);if(!Number.isInteger(t))break;let i=r.fetchIfRef(n[e]);if(Array.isArray(i))for(let e=0,n=i.length;e<n;e++){let n=[r.fetchIfRef(i[e++]),r.fetchIfRef(i[e++]),r.fetchIfRef(i[e])];Cr(n,null)&&(o[t]=n),t++}else{if(!Number.isInteger(i))break;{let a=[r.fetchIfRef(n[++e]),r.fetchIfRef(n[++e]),r.fetchIfRef(n[++e])];if(!Cr(a,null))continue;for(let e=t;e<=i;e++)o[e]=a}}}}}else{let o=e.get(`Widths`);if(Array.isArray(o)){let e=n.firstChar;for(let t of o){let n=r.fetchIfRef(t);typeof n==`number`&&(i[e]=n),e++}let s=t.get(`MissingWidth`);a=typeof s==`number`?s:0}else{let t=e.get(`BaseFont`);if(t instanceof I){let e=this.getBaseFontMetrics(t.name);i=this.buildCharCodeToWidth(e.widths,n),a=e.defaultWidth}}}let c=!0,l=a;for(let e in i){let t=i[e];if(t)if(l){if(l!==t){c=!1;break}}else l=t}c?n.flags|=Zo:n.flags&=-2,n.defaultWidth=a,n.widths=i,n.defaultVMetrics=s,n.vmetrics=o}isSerifFont(e){let t=e.split(`-`,1)[0];return t in Ms()||/serif/gi.test(t)}getBaseFontMetrics(e){let t=0,n=Object.create(null),r=!1,i=ks()[e]||e,a=ec();i in a||(i=this.isSerifFont(e)?`Times-Roman`:`Helvetica`);let o=a[i];return typeof o==`number`?(t=o,r=!0):n=o(),{defaultWidth:t,monospace:r,widths:n}}buildCharCodeToWidth(e,t){let n=Object.create(null),r=t.differences,i=t.defaultEncoding;for(let t=0;t<256;t++)t in r&&e[r[t]]?n[t]=e[r[t]]:t in i&&e[i[t]]&&(n[t]=e[i[t]]);return n}preEvaluateFont(e){let t=e,n=e.get(`Subtype`);if(!(n instanceof I))throw new F(`invalid font Subtype`);let r,i=!1;if(n.name===`Type0`){let t=e.get(`DescendantFonts`);if(!t)throw new F(`Descendant fonts are not specified`);if(!((e=Array.isArray(t)?this.xref.fetchIfRef(t[0]):t)instanceof L))throw new F(`Descendant font is not a dictionary.`);if(n=e.get(`Subtype`),!(n instanceof I))throw new F(`invalid font Subtype`);i=!0}let a=e.get(`FirstChar`);Number.isInteger(a)||(a=0);let o=e.get(`LastChar`);Number.isInteger(o)||(o=i?65535:255);let s=e.get(`FontDescriptor`),c=e.get(`ToUnicode`)||t.get(`ToUnicode`);if(s){r=new ud;let n=t.getRaw(`Encoding`);if(n instanceof I)r.update(n.name);else if(n instanceof R)r.update(n.toString());else if(n instanceof L){for(let e of n.getRawValues())if(e instanceof I)r.update(e.name);else if(e instanceof R)r.update(e.toString());else if(Array.isArray(e)){let t=e.length,n=Array(t);for(let r=0;r<t;r++){let t=e[r];t instanceof I?n[r]=t.name:(typeof t==`number`||t instanceof R)&&(n[r]=t.toString())}r.update(n.join())}}if(r.update(`${a}-${o}`),c instanceof tr){let e=c.str||c,t=e.buffer?new Uint8Array(e.buffer.buffer,0,e.bufferLength):new Uint8Array(e.bytes.buffer,e.start,e.end-e.start);r.update(t)}else c instanceof I&&r.update(c.name);let s=e.get(`Widths`)||t.get(`Widths`);if(Array.isArray(s)){let e=[];for(let t of s)(typeof t==`number`||t instanceof R)&&e.push(t.toString());r.update(e.join())}if(i){r.update(`compositeFont`);let n=e.get(`W`)||t.get(`W`);if(Array.isArray(n)){let e=[];for(let t of n)if(typeof t==`number`||t instanceof R)e.push(t.toString());else if(Array.isArray(t)){let n=[];for(let e of t)(typeof e==`number`||e instanceof R)&&n.push(e.toString());e.push(`[${n.join()}]`)}r.update(e.join())}let i=e.getRaw(`CIDToGIDMap`)||t.getRaw(`CIDToGIDMap`);i instanceof I?r.update(i.name):i instanceof R?r.update(i.toString()):i instanceof tr&&r.update(i.peekBytes())}}return{descriptor:s,dict:e,baseDict:t,composite:i,type:n.name,firstChar:a,lastChar:o,toUnicode:c,hash:r?r.hexdigest():``}}async translateFont({descriptor:e,dict:t,baseDict:r,composite:i,type:a,firstChar:o,lastChar:s,toUnicode:c,cssFontInfo:l}){let u=a===`Type3`;if(!e){if(!u){let e=t.get(`BaseFont`);if(!(e instanceof I))throw new F(`Base font is not specified`);e=e.name.replaceAll(/[,_]/g,`-`);let n=this.getBaseFontMetrics(e),i=e.split(`-`,1)[0],l=(this.isSerifFont(i)?Qo:0)|(n.monospace?Zo:0)|(Ns()[i]?$o:es),d={type:a,name:e,loadedName:r.loadedName,systemFontInfo:null,widths:n.widths,defaultWidth:n.defaultWidth,isSimulatedFlags:!0,flags:l,firstChar:o,lastChar:s,toUnicode:c,xHeight:0,capHeight:0,italicAngle:0,isType3Font:u},f=t.get(`Widths`),p=Ls(e),m=null;p&&(m=await this.fetchStandardFontData(p),d.isInternalFont=!!m),!d.isInternalFont&&this.options.useSystemFonts&&(d.systemFontInfo=od(this.systemFontCache,this.idFactory,this.options.standardFontDataUrl,e,p,a));let h=await this.extractDataStructures(t,d);if(Array.isArray(f)){let e=[],t=o;for(let n of f){let r=this.xref.fetchIfRef(n);typeof r==`number`&&(e[t]=r),t++}h.widths=e}else h.widths=this.buildCharCodeToWidth(n.widths,h);return new tl(e,m,h,this.options)}e=L.empty}let d=e.get(`FontName`),f=t.get(`BaseFont`);typeof d==`string`&&(d=I.get(d)),typeof f==`string`&&(f=I.get(f));let p=d?.name,m=f?.name;if(u?p||(d=I.get(a)):p!==m&&(hn(`The FontDescriptor's FontName is "${p}" but should be the same as the Font's BaseFont "${m}".`),p&&m&&(m.startsWith(p)||!Rs(p)&&Rs(m))&&(d=null),d||=f),!(d instanceof I))throw new F(`invalid font name`);let h,g,_,v,y;try{if(h=e.get(`FontFile`,`FontFile2`,`FontFile3`),h){if(!(h instanceof tr))throw new F(`FontFile should be a stream`);if(h.isEmpty)throw new F(`FontFile is empty`)}}catch(e){if(!this.options.ignoreErrors)throw e;N(`translateFont - fetching "${d.name}" font file: "${e}".`),h=null}let b=!1,x=null,S=null;if(h){if(h.dict){let e=h.dict.get(`Subtype`);e instanceof I&&(g=e.name),_=h.dict.get(`Length1`),v=h.dict.get(`Length2`),y=h.dict.get(`Length3`)}}else if(l){let e=au(d.name);e&&(l.fontFamily=`${l.fontFamily}-PdfJS-XFA`,l.metrics=e.metrics||null,x=e.factors||null,h=await this.fetchStandardFontData(e.name),b=!!h,r=t=ou(d.name),i=!0)}else if(!u){let e=Ls(d.name);e&&(h=await this.fetchStandardFontData(e),b=!!h),!b&&this.options.useSystemFonts&&(S=od(this.systemFontCache,this.idFactory,this.options.standardFontDataUrl,d.name,e,a))}let C=wr(t.getArray(`FontMatrix`),n),w=Er(e.getArray(`FontBBox`)||t.getArray(`FontBBox`),u?[0,0,0,0]:void 0),T=e.get(`Ascent`);typeof T!=`number`&&(T=void 0);let E=e.get(`Descent`);typeof E!=`number`&&(E=void 0);let D=e.get(`XHeight`);typeof D!=`number`&&(D=0);let O=e.get(`CapHeight`);typeof O!=`number`&&(O=0);let k=e.get(`Flags`);Number.isInteger(k)||(k=0);let ee=e.get(`ItalicAngle`);typeof ee!=`number`&&(ee=0);let A={type:a,name:d.name,subtype:g,file:h,length1:_,length2:v,length3:y,isInternalFont:b,loadedName:r.loadedName,composite:i,fixedPitch:!1,fontMatrix:C,firstChar:o,lastChar:s,toUnicode:c,bbox:w,ascent:T,descent:E,xHeight:D,capHeight:O,flags:k,italicAngle:ee,isType3Font:u,cssFontInfo:l,scaleFactors:x,systemFontInfo:S};if(i){let e=r.get(`Encoding`);e instanceof I&&(A.cidEncoding=e.name),A.cMap=await No.create({encoding:e,fetchBuiltInCMap:this._fetchBuiltInCMapBound,useCMap:null}),A.vertical=A.cMap.vertical}let j=await this.extractDataStructures(t,A);return this.extractWidths(t,e,j),new tl(d.name,h,j,this.options)}static buildFontPaths(e,t,n,r){function i(t){let i=`${e.loadedName}_path_${t}`;try{if(e.renderer.hasBuiltPath(t))return;n.send(`commonobj`,[i,`FontPath`,e.renderer.getPathJs(t)])}catch(e){if(r.ignoreErrors)return void N(`buildFontPaths - ignoring ${i} glyph: "${e}".`);throw e}}for(let e of t){i(e.fontChar);let t=e.accent;t?.fontChar&&i(t.fontChar)}}static get fallbackFontDict(){let e=new L;return e.set(`BaseFont`,I.get(`Helvetica`)),e.set(`Type`,I.get(`FallbackType`)),e.set(`Subtype`,I.get(`FallbackType`)),e.set(`Encoding`,I.get(`WinAnsiEncoding`)),P(this,`fallbackFontDict`,e)}},xd=class{#e=!1;#t=null;constructor({loadedName:e,font:t,dict:n}){this.loadedName=e,this.font=t,this.dict=n,this.type3Dependencies=t.isType3Font?new Set:null}send(e){if(this.#e)return;this.#e=!0;let t=this.font.exportData(),n=[];t.data&&(t.data.charProcOperatorList&&(t.charProcOperatorList=t.data.charProcOperatorList),t.data=Zu.write(t.data),n.push(t.data)),e.send(`commonobj`,[this.loadedName,`Font`,t],n)}fallback(e,t){this.font.data&&(this.font.disableFontFace=!0,bd.buildFontPaths(this.font,this.font.glyphCacheValues,e,t))}loadType3Data(e,t,n){if(this.#t)return this.#t;let{font:r,type3Dependencies:i}=this;_n(r.isType3Font,`Must be a Type3 font.`);let a=e.clone({ignoreErrors:!1}),o=new Yn(e.type3FontRefs);this.dict.objId&&!o.has(this.dict.objId)&&o.put(this.dict.objId),a.type3FontRefs=o;let s=Promise.resolve(),c=this.dict.get(`CharProcs`),l=this.dict.get(`Resources`)||t,u=Object.create(null),[d,f,p,m]=r.bbox,h=p-d,g=m-f,_=Math.hypot(h,g);for(let e of c.getKeys())s=s.then(()=>{let t=c.get(e),r=new ra;return a.getOperatorList({stream:t,task:n,resources:l,operatorList:r}).then(()=>{switch(r.fnArray[0]){case vt:this.#n(r,_);break;case _t:_||this.#r(r)}u[e]=r.getIR();for(let e of r.dependencies)i.add(e)}).catch(function(t){N(`Type3 font resource "${e}" is not available.`),u[e]=new ra().getIR()})});return this.#t=s.then(()=>{r.charProcOperatorList=u,this._bbox&&(r.isCharBBox=!0,r.bbox=this._bbox)}),this.#t}#n(e,t=NaN){let n=jn.normalizeRect(e.argsArray[0].slice(2)),r=n[2]-n[0],i=n[3]-n[1];r===0||i===0?(e.fnArray.splice(0,1),e.argsArray.splice(0,1)):(t===0||Math.round(Math.hypot(r,i)/t)>=10)&&(this._bbox??=[1/0,1/0,-1/0,-1/0],jn.rectBoundingBox(...n,this._bbox));let a=0,o=e.length;for(;a<o;){switch(e.fnArray[a]){case vt:break;case yt:case bt:case xt:case St:case Ct:case wt:case Tt:case Et:case Dt:case Ot:case kt:case At:case jt:case Ae:e.fnArray.splice(a,1),e.argsArray.splice(a,1),o--;continue;case Me:let[t]=e.argsArray[a],n=0,r=t.length;for(;n<r;){let[e]=t[n];switch(e){case`TR`:case`TR2`:case`HT`:case`BG`:case`BG2`:case`UCR`:case`UCR2`:t.splice(n,1),r--;continue}n++}}a++}}#r(e){let t=1,n=e.length;for(;t<n;){if(e.fnArray[t]===rn){let n=e.argsArray[t][2];this._bbox??=[1/0,1/0,-1/0,-1/0],jn.rectBoundingBox(...n,this._bbox)}t++}}},Sd=class{constructor(e=new wd){this.state=e,this.stateStack=[]}save(){let e=this.state;this.stateStack.push(this.state),this.state=e.clone()}restore(){let e=this.stateStack.pop();e&&(this.state=e)}transform(e){this.state.ctm=jn.transform(this.state.ctm,e)}},Cd=class{constructor(){this.ctm=new Float32Array(ir),this.fontName=null,this.fontSize=0,this.loadedName=null,this.font=null,this.fontMatrix=n,this.textMatrix=ir.slice(),this.textLineMatrix=ir.slice(),this.charSpacing=0,this.wordSpacing=0,this.leading=0,this.textHScale=1,this.textRise=0}setTextMatrix(e,t,n,r,i,a){let o=this.textMatrix;o[0]=e,o[1]=t,o[2]=n,o[3]=r,o[4]=i,o[5]=a}setTextLineMatrix(e,t,n,r,i,a){let o=this.textLineMatrix;o[0]=e,o[1]=t,o[2]=n,o[3]=r,o[4]=i,o[5]=a}translateTextMatrix(e,t){let n=this.textMatrix;n[4]=n[0]*e+n[2]*t+n[4],n[5]=n[1]*e+n[3]*t+n[5]}translateTextLineMatrix(e,t){let n=this.textLineMatrix;n[4]=n[0]*e+n[2]*t+n[4],n[5]=n[1]*e+n[3]*t+n[5]}carriageReturn(){this.translateTextLineMatrix(0,-this.leading),this.textMatrix=this.textLineMatrix.slice()}clone(){let e=Object.create(this);return e.textMatrix=this.textMatrix.slice(),e.textLineMatrix=this.textLineMatrix.slice(),e.fontMatrix=this.fontMatrix.slice(),e}},wd=class{constructor(){this.ctm=new Float32Array(ir),this.font=null,this.textRenderingMode=x,this._fillColorSpace=this._strokeColorSpace=Di.gray,this.patternFillColorSpace=null,this.patternStrokeColorSpace=null,this.currentPointX=this.currentPointY=0,this.pathMinMax=new Float32Array([1/0,1/0,-1/0,-1/0]),this.pathBuffer=[]}get fillColorSpace(){return this._fillColorSpace}set fillColorSpace(e){this._fillColorSpace=this.patternFillColorSpace=e}get strokeColorSpace(){return this._strokeColorSpace}set strokeColorSpace(e){this._strokeColorSpace=this.patternStrokeColorSpace=e}clone({newPath:e=!1}={}){let t=Object.create(this);return e&&(t.pathBuffer=[],t.pathMinMax=new Float32Array([1/0,1/0,-1/0,-1/0])),t}},Td=class e{static get opMap(){return P(this,`opMap`,Object.assign(Object.create(null),{w:{id:Te,numArgs:1,variableArgs:!1},J:{id:Ee,numArgs:1,variableArgs:!1},j:{id:De,numArgs:1,variableArgs:!1},M:{id:Oe,numArgs:1,variableArgs:!1},d:{id:ke,numArgs:2,variableArgs:!1},ri:{id:Ae,numArgs:1,variableArgs:!1},i:{id:je,numArgs:1,variableArgs:!1},gs:{id:Me,numArgs:1,variableArgs:!1},q:{id:Ne,numArgs:0,variableArgs:!1},Q:{id:Pe,numArgs:0,variableArgs:!1},cm:{id:Fe,numArgs:6,variableArgs:!1},m:{id:Ie,numArgs:2,variableArgs:!1},l:{id:Le,numArgs:2,variableArgs:!1},c:{id:Re,numArgs:6,variableArgs:!1},v:{id:ze,numArgs:4,variableArgs:!1},y:{id:Be,numArgs:4,variableArgs:!1},h:{id:Ve,numArgs:0,variableArgs:!1},re:{id:He,numArgs:4,variableArgs:!1},S:{id:Ue,numArgs:0,variableArgs:!1},s:{id:We,numArgs:0,variableArgs:!1},f:{id:Ge,numArgs:0,variableArgs:!1},F:{id:Ge,numArgs:0,variableArgs:!1},"f*":{id:Ke,numArgs:0,variableArgs:!1},B:{id:qe,numArgs:0,variableArgs:!1},"B*":{id:Je,numArgs:0,variableArgs:!1},b:{id:Ye,numArgs:0,variableArgs:!1},"b*":{id:Xe,numArgs:0,variableArgs:!1},n:{id:Ze,numArgs:0,variableArgs:!1},W:{id:Qe,numArgs:0,variableArgs:!1},"W*":{id:$e,numArgs:0,variableArgs:!1},BT:{id:et,numArgs:0,variableArgs:!1},ET:{id:tt,numArgs:0,variableArgs:!1},Tc:{id:nt,numArgs:1,variableArgs:!1},Tw:{id:rt,numArgs:1,variableArgs:!1},Tz:{id:it,numArgs:1,variableArgs:!1},TL:{id:at,numArgs:1,variableArgs:!1},Tf:{id:ot,numArgs:2,variableArgs:!1},Tr:{id:st,numArgs:1,variableArgs:!1},Ts:{id:ct,numArgs:1,variableArgs:!1},Td:{id:lt,numArgs:2,variableArgs:!1},TD:{id:ut,numArgs:2,variableArgs:!1},Tm:{id:dt,numArgs:6,variableArgs:!1},"T*":{id:ft,numArgs:0,variableArgs:!1},Tj:{id:pt,numArgs:1,variableArgs:!1},TJ:{id:mt,numArgs:1,variableArgs:!1},"'":{id:ht,numArgs:1,variableArgs:!1},'"':{id:gt,numArgs:3,variableArgs:!1},d0:{id:_t,numArgs:2,variableArgs:!1},d1:{id:vt,numArgs:6,variableArgs:!1},CS:{id:yt,numArgs:1,variableArgs:!1},cs:{id:bt,numArgs:1,variableArgs:!1},SC:{id:xt,numArgs:4,variableArgs:!0},SCN:{id:St,numArgs:33,variableArgs:!0},sc:{id:Ct,numArgs:4,variableArgs:!0},scn:{id:wt,numArgs:33,variableArgs:!0},G:{id:Tt,numArgs:1,variableArgs:!1},g:{id:Et,numArgs:1,variableArgs:!1},RG:{id:Dt,numArgs:3,variableArgs:!1},rg:{id:Ot,numArgs:3,variableArgs:!1},K:{id:kt,numArgs:4,variableArgs:!1},k:{id:At,numArgs:4,variableArgs:!1},sh:{id:jt,numArgs:1,variableArgs:!1},BI:{id:Mt,numArgs:0,variableArgs:!1},ID:{id:Nt,numArgs:0,variableArgs:!1},EI:{id:Pt,numArgs:1,variableArgs:!1},Do:{id:Ft,numArgs:1,variableArgs:!1},MP:{id:It,numArgs:1,variableArgs:!1},DP:{id:Lt,numArgs:2,variableArgs:!1},BMC:{id:Rt,numArgs:1,variableArgs:!1},BDC:{id:zt,numArgs:2,variableArgs:!1},EMC:{id:Bt,numArgs:0,variableArgs:!1},BX:{id:Vt,numArgs:0,variableArgs:!1},EX:{id:Ht,numArgs:0,variableArgs:!1},BM:null,BD:null,true:null,fa:null,fal:null,fals:null,false:null,nu:null,nul:null,null:null}))}static MAX_INVALID_PATH_OPS=10;constructor(t,n,r=new Sd){this.parser=new uo({lexer:new mo(t,e.opMap),xref:n}),this.stateManager=r,this.nonProcessedArgs=[],this._isPathOp=!1,this._numInvalidPathOPS=0}get savedStatesDepth(){return this.stateManager.stateStack.length}read(t){let n=t.args;for(;;){let r=this.parser.getObj();if(r instanceof qn){let i=r.cmd,a=e.opMap[i];if(!a){N(`Unknown command "${i}".`);continue}let o=a.id,s=a.numArgs,c=n===null?0:n.length;if(this._isPathOp||(this._numInvalidPathOPS=0),this._isPathOp=o>=Ie&&o<=Ze,a.variableArgs)c>s&&hn(`Command ${i}: expected [0, ${s}] args, but received ${c} args.`);else{if(c!==s){let e=this.nonProcessedArgs;for(;c>s;)e.push(n.shift()),c--;for(;c<s&&e.length!==0;)n===null&&(n=[]),n.unshift(e.pop()),c++}if(c<s){let t=`command ${i}: expected ${s} args, but received ${c} args.`;if(this._isPathOp&&++this._numInvalidPathOPS>e.MAX_INVALID_PATH_OPS)throw new F(`Invalid ${t}`);N(`Skipping ${t}`),n!==null&&(n.length=0);continue}}return this.preprocessCommand(o,n),t.fn=o,t.args=n,!0}if(r===Un)return!1;if(r!==null&&(n===null&&(n=[]),n.push(r),n.length>33))throw new F(`Too many arguments`)}}preprocessCommand(e,t){switch(0|e){case Ne:this.stateManager.save();break;case Pe:this.stateManager.restore();break;case Fe:this.stateManager.transform(t)}}},Ed=class extends Td{constructor(e){super(new _i(e))}parse(){let e={fn:0,args:[]},t={fontSize:0,fontName:``,fontColor:new Uint8ClampedArray(3)};try{for(;e.args.length=0,this.read(e);){if(this.savedStatesDepth!==0)continue;let{fn:n,args:r}=e;switch(0|n){case ot:let[e,n]=r;e instanceof I&&(t.fontName=e.name),typeof n==`number`&&n>0&&(t.fontSize=n);break;case Ot:Di.rgb.getRgbItem(r,0,t.fontColor,0);break;case Et:Di.gray.getRgbItem(r,0,t.fontColor,0);break;case At:Di.cmyk.getRgbItem(r,0,t.fontColor,0)}}}catch(e){N(`parseDefaultAppearance - ignoring errors: "${e}".`)}return t}};function Dd(e){return new Ed(e).parse()}var Od=class extends Td{constructor(e,t,n,r){super(e),this.stream=e,this.evaluatorOptions=t,this.xref=n,this.globalColorSpaceCache=r,this.resources=e.dict?.get(`Resources`)}parse(){let e={fn:0,args:[]},t={scaleFactor:1,fontSize:0,fontName:``,fontColor:new Uint8ClampedArray(3),fillColorSpace:Di.gray},n=!1,r=[];try{for(;e.args.length=0,!n&&this.read(e);){let{fn:i,args:a}=e;switch(0|i){case Ne:r.push({scaleFactor:t.scaleFactor,fontSize:t.fontSize,fontName:t.fontName,fontColor:t.fontColor.slice(),fillColorSpace:t.fillColorSpace});break;case Pe:t=r.pop()||t;break;case dt:t.scaleFactor*=Math.hypot(a[0],a[1]);break;case ot:let[e,i]=a;e instanceof I&&(t.fontName=e.name),typeof i==`number`&&i>0&&(t.fontSize=i*t.scaleFactor);break;case bt:t.fillColorSpace=Di.parse({cs:a[0],xref:this.xref,resources:this.resources,pdfFunctionFactory:this._pdfFunctionFactory,globalColorSpaceCache:this.globalColorSpaceCache,localColorSpaceCache:this._localColorSpaceCache});break;case Ct:t.fillColorSpace.getRgbItem(a,0,t.fontColor,0);break;case Ot:Di.rgb.getRgbItem(a,0,t.fontColor,0);break;case Et:Di.gray.getRgbItem(a,0,t.fontColor,0);break;case At:Di.cmyk.getRgbItem(a,0,t.fontColor,0);break;case pt:case mt:case ht:case gt:n=!0}}}catch(e){N(`parseAppearanceStream - ignoring errors: "${e}".`)}return this.stream.reset(),delete t.scaleFactor,delete t.fillColorSpace,t}get _localColorSpaceCache(){return P(this,`_localColorSpaceCache`,new pu)}get _pdfFunctionFactory(){return P(this,`_pdfFunctionFactory`,new bu({xref:this.xref,isEvalSupported:this.evaluatorOptions.isEvalSupported}))}};function kd(e,t){return e[0]===e[1]&&e[1]===e[2]?`${Rr(e[0]/255)} ${t?`g`:`G`}`:Array.from(e,e=>Rr(e/255)).join(` `)+` `+(t?`rg`:`RG`)}var Ad=class e{constructor(t,n){this.xref=t,this.widths=null,this.firstChar=1/0,this.lastChar=-1/0,this.fontFamily=n;let r=new OffscreenCanvas(1,1);this.ctxMeasure=r.getContext(`2d`,{willReadFrequently:!0}),e._fontNameId||=1,this.fontName=I.get(`InvalidPDFjsFont_${n}_${e._fontNameId++}`)}get fontDescriptorRef(){if(!e._fontDescriptorRef){let t=new L(this.xref);t.setIfName(`Type`,`FontDescriptor`),t.set(`FontName`,this.fontName),t.set(`FontFamily`,`MyriadPro Regular`),t.set(`FontBBox`,[0,0,0,0]),t.setIfName(`FontStretch`,`Normal`),t.set(`FontWeight`,400),t.set(`ItalicAngle`,0),e._fontDescriptorRef=this.xref.getNewPersistentRef(t)}return e._fontDescriptorRef}get descendantFontRef(){let e=new L(this.xref);e.set(`BaseFont`,this.fontName),e.setIfName(`Type`,`Font`),e.setIfName(`Subtype`,`CIDFontType0`),e.setIfName(`CIDToGIDMap`,`Identity`),e.set(`FirstChar`,this.firstChar),e.set(`LastChar`,this.lastChar),e.set(`FontDescriptor`,this.fontDescriptorRef),e.set(`DW`,1e3);let t=[],n=[...this.widths.entries()].sort(),r=null,i=null;for(let[e,a]of n)r?e===r+i.length?i.push(a):(t.push(r,i),r=e,i=[a]):(r=e,i=[a]);r&&t.push(r,i),e.set(`W`,t);let a=new L(this.xref);return a.set(`Ordering`,`Identity`),a.set(`Registry`,`Adobe`),a.set(`Supplement`,0),e.set(`CIDSystemInfo`,a),this.xref.getNewPersistentRef(e)}get baseFontRef(){let e=new L(this.xref);return e.set(`BaseFont`,this.fontName),e.setIfName(`Type`,`Font`),e.setIfName(`Subtype`,`Type0`),e.setIfName(`Encoding`,`Identity-H`),e.set(`DescendantFonts`,[this.descendantFontRef]),e.setIfName(`ToUnicode`,`Identity-H`),this.xref.getNewPersistentRef(e)}get resources(){let e=new L(this.xref),t=new L(this.xref);return t.set(this.fontName.name,this.baseFontRef),e.set(`Font`,t),e}_createContext(){return this.widths=new Map,this.ctxMeasure.font=`1000px ${this.fontFamily}`,this.ctxMeasure}createFontResources(e){let t=this._createContext();for(let n of e.split(/\r\n?|\n/))for(let e of n.split(``)){let n=e.charCodeAt(0);if(this.widths.has(n))continue;let r=t.measureText(e),i=Math.ceil(r.width);this.widths.set(n,i),this.firstChar=Math.min(n,this.firstChar),this.lastChar=Math.max(n,this.lastChar)}return this.resources}static getFirstPositionInfo(e,t,n){let[a,o,s,c]=e,l=s-a,u=c-o;t%180!=0&&([l,u]=[u,l]);let d=r*n;return{coords:[0,u+i*n-d],bbox:[0,0,l,u],matrix:t===0?void 0:Ur(t,u,d)}}createAppearance(e,t,n,a,o,s){let c=this._createContext(),l=[],u=-1/0;for(let t of e.split(/\r\n?|\n/)){l.push(t);let e=c.measureText(t).width;u=Math.max(u,e);for(let e of Nr(t)){let t=String.fromCodePoint(e),n=this.widths.get(e);if(n===void 0){let r=c.measureText(t);n=Math.ceil(r.width),this.widths.set(e,n),this.firstChar=Math.min(e,this.firstChar),this.lastChar=Math.max(e,this.lastChar)}}}u*=a/1e3;let[d,f,p,m]=t,h=p-d,g=m-f;n%180!=0&&([h,g]=[g,h]);let _=1;u>h&&(_=h/u);let v=1,y=r*a,b=i*a,x=y*l.length;x>g&&(v=g/x);let S=a*Math.min(_,v),C=[`q`,`0 0 ${Rr(h)} ${Rr(g)} re W n`,`BT`,`1 0 0 1 0 ${Rr(g+b)} Tm 0 Tc ${kd(o,!0)}`,`/${this.fontName.name} ${Rr(S)} Tf`],{resources:w}=this;if((s=typeof s==`number`&&s>=0&&s<=1?s:1)!==1){C.push(`/R0 gs`);let e=new L(this.xref),t=new L(this.xref);t.set(`ca`,s),t.set(`CA`,s),t.setIfName(`Type`,`ExtGState`),e.set(`R0`,t),w.set(`ExtGState`,e)}let T=Rr(y);for(let e of l)C.push(`0 -${T} Td <${Vr(e)}> Tj`);C.push(`ET`,`Q`);let E=C.join(`
7
7
  `),D=new L(this.xref);if(D.setIfName(`Subtype`,`Form`),D.setIfName(`Type`,`XObject`),D.set(`BBox`,[0,0,h,g]),D.set(`Length`,E.length),D.set(`Resources`,w),n){let e=Ur(n,h,g);D.set(`Matrix`,e)}let O=new _i(E);return O.dict=D,O}},jd=[`m/d`,`m/d/yy`,`mm/dd/yy`,`mm/yy`,`d-mmm`,`d-mmm-yy`,`dd-mmm-yy`,`yy-mm-dd`,`mmm-yy`,`mmmm-yy`,`mmm d, yyyy`,`mmmm d, yyyy`,`m/d/yy h:MM tt`,`m/d/yy HH:MM`],Md=[`HH:MM`,`h:MM tt`,`HH:MM:ss`,`h:MM:ss tt`],Nd=class{constructor(e,t,n){this.root=e,this.xref=t,this._type=n}getAll(){let e=new Map;if(!this.root)return e;let t=this.xref,n=new Yn;n.put(this.root);let r=[this.root];for(;r.length>0;){let i=t.fetchIfRef(r.shift());if(!(i instanceof L))continue;if(i.has(`Kids`)){let e=i.get(`Kids`);if(!Array.isArray(e))continue;for(let t of e){if(n.has(t))throw new F(`Duplicate entry in "${this._type}" tree.`);r.push(t),n.put(t)}continue}let a=i.get(this._type);if(Array.isArray(a))for(let n=0,r=a.length;n<r;n+=2)e.set(t.fetchIfRef(a[n]),t.fetchIfRef(a[n+1]))}return e}getRaw(e){if(!this.root)return null;let t=this.xref,n=t.fetchIfRef(this.root),r=0;for(;n.has(`Kids`);){if(++r>10)return N(`Search depth limit reached for "${this._type}" tree.`),null;let i=n.get(`Kids`);if(!Array.isArray(i))return null;let a=0,o=i.length-1;for(;a<=o;){let r=a+o>>1,s=t.fetchIfRef(i[r]),c=s.get(`Limits`);if(e<t.fetchIfRef(c[0]))o=r-1;else{if(!(e>t.fetchIfRef(c[1]))){n=s;break}a=r+1}}if(a>o)return null}let i=n.get(this._type);if(Array.isArray(i)){let n=0,r=i.length-2;for(;n<=r;){let a=n+r>>1,o=a+(1&a),s=t.fetchIfRef(i[o]);if(e<s)r=o-2;else{if(!(e>s))return i[o+1];n=o+2}}}return null}get(e){return this.xref.fetchIfRef(this.getRaw(e))}},Pd=class extends Nd{constructor(e,t){super(e,t,`Names`)}},Fd=class extends Nd{constructor(e,t){super(e,t,`Nums`)}};function Id(){pl=Object.create(null),Wn=Object.create(null),Gn=Object.create(null),Kn=Object.create(null),Yo.clear(),Qi.cleanup()}function Ld(e){return e instanceof L?e.has(`UF`)?e.get(`UF`):e.has(`F`)?e.get(`F`):e.has(`Unix`)?e.get(`Unix`):e.has(`Mac`)?e.get(`Mac`):e.has(`DOS`)?e.get(`DOS`):null:null}var Rd=class{#e=!1;constructor(e,t,n=!1){e instanceof L&&(this.xref=t,this.root=e,e.has(`FS`)&&(this.fs=e.get(`FS`)),e.has(`RF`)&&N(`Related file specifications are not supported`),n||(e.has(`EF`)?this.#e=!0:N(`Non-embedded file specifications are not supported`)))}get filename(){let e=``,t=Ld(this.root);return t&&typeof t==`string`&&(e=Nn(t,!0).replaceAll(`\\\\`,`\\`).replaceAll(`\\/`,`/`).replaceAll(`\\`,`/`)),P(this,`filename`,e||`unnamed`)}get content(){if(!this.#e)return null;this._contentRef||=Ld(this.root?.get(`EF`));let e=null;if(this._contentRef){let t=this.xref.fetchIfRef(this._contentRef);t instanceof tr?e=t.getBytes():N(`Embedded file specification points to non-existing/invalid content`)}else N(`Embedded file specification does not have any content`);return e}get description(){let e=``,t=this.root?.get(`Desc`);return t&&typeof t==`string`&&(e=Nn(t)),P(this,`description`,e)}get serializable(){return{rawFilename:this.filename,filename:(e=this.filename,e.substring(e.lastIndexOf(`/`)+1)),content:this.content,description:this.description};var e}},zd=0,Bd=-2,Vd=-3,Hd=-4,Ud=-5,Wd=-6,Gd=-9;function Kd(e,t){let n=e[t];return n===` `||n===`
8
8
  `||n===`\r`||n===` `}var qd=class{_resolveEntities(e){return e.replaceAll(/&([^;]+);/g,(e,t)=>{if(t.substring(0,2)===`#x`)return String.fromCodePoint(parseInt(t.substring(2),16));if(t.substring(0,1)===`#`)return String.fromCodePoint(parseInt(t.substring(1),10));switch(t){case`lt`:return`<`;case`gt`:return`>`;case`amp`:return`&`;case`quot`:return`"`;case`apos`:return`'`}return this.onResolveEntity(t)})}_parseContent(e,t){let n=[],r=t;function i(){for(;r<e.length&&Kd(e,r);)++r}for(;r<e.length&&!Kd(e,r)&&e[r]!==`>`&&e[r]!==`/`;)++r;let a=e.substring(t,r);for(i();r<e.length&&e[r]!==`>`&&e[r]!==`/`&&e[r]!==`?`;){i();let t=``,a=``;for(;r<e.length&&!Kd(e,r)&&e[r]!==`=`;)t+=e[r],++r;if(i(),e[r]!==`=`)return null;++r,i();let o=e[r];if(o!==`"`&&o!==`'`)return null;let s=e.indexOf(o,++r);if(s<0)return null;a=e.substring(r,s),n.push({name:t,value:this._resolveEntities(a)}),r=s+1,i()}return{name:a,attributes:n,parsed:r-t}}_parseProcessingInstruction(e,t){let n=t;for(;n<e.length&&!Kd(e,n)&&e[n]!==`>`&&e[n]!==`?`&&e[n]!==`/`;)++n;let r=e.substring(t,n);(function(){for(;n<e.length&&Kd(e,n);)++n})();let i=n;for(;n<e.length&&(e[n]!==`?`||e[n+1]!==`>`);)++n;return{name:r,value:e.substring(i,n),parsed:n-t}}parseXml(e){let t=0;for(;t<e.length;){let n=t;if(e[t]===`<`){++n;let t;switch(e[n]){case`/`:if(++n,t=e.indexOf(`>`,n),t<0)return void this.onError(Gd);this.onEndElement(e.substring(n,t)),n=t+1;break;case`?`:++n;let r=this._parseProcessingInstruction(e,n);if(e.substring(n+r.parsed,n+r.parsed+2)!==`?>`)return void this.onError(Vd);this.onPi(r.name,r.value),n+=r.parsed+2;break;case`!`:if(e.substring(n+1,n+3)===`--`){if(t=e.indexOf(`-->`,n+3),t<0)return void this.onError(Ud);this.onComment(e.substring(n+3,t)),n=t+3}else if(e.substring(n+1,n+8)===`[CDATA[`){if(t=e.indexOf(`]]>`,n+8),t<0)return void this.onError(Bd);this.onCdata(e.substring(n+8,t)),n=t+3}else{if(e.substring(n+1,n+8)!==`DOCTYPE`)return void this.onError(Wd);{let r=e.indexOf(`[`,n+8),i=!1;if(t=e.indexOf(`>`,n+8),t<0)return void this.onError(Hd);if(r>0&&t>r){if(t=e.indexOf(`]>`,n+8),t<0)return void this.onError(Hd);i=!0}let a=e.substring(n+8,t+ +!!i);this.onDoctype(a),n=t+(i?2:1)}}break;default:let i=this._parseContent(e,n);if(i===null)return void this.onError(Wd);let a=!1;if(e.substring(n+i.parsed,n+i.parsed+2)===`/>`)a=!0;else if(e.substring(n+i.parsed,n+i.parsed+1)!==`>`)return void this.onError(Gd);this.onBeginElement(i.name,i.attributes,a),n+=i.parsed+(a?2:1)}}else{for(;n<e.length&&e[n]!==`<`;)n++;let r=e.substring(t,n);this.onText(this._resolveEntities(r))}t=n}}onResolveEntity(e){return`&${e};`}onPi(e,t){}onComment(e){}onCdata(e){}onDoctype(e){}onText(e){}onBeginElement(e,t,n){}onEndElement(e){}onError(e){}},Jd=class{constructor(e,t){this.nodeName=e,this.nodeValue=t,Object.defineProperty(this,`parentNode`,{value:null,writable:!0})}get firstChild(){return this.childNodes?.[0]}get nextSibling(){let e=this.parentNode.childNodes;if(!e)return;let t=e.indexOf(this);return t===-1?void 0:e[t+1]}get textContent(){return this.childNodes?this.childNodes.map(e=>e.textContent).join(``):this.nodeValue||``}get children(){return this.childNodes||[]}hasChildNodes(){return this.childNodes?.length>0}searchNode(e,t){if(t>=e.length)return this;let n=e[t];if(n.name.startsWith(`#`)&&t<e.length-1)return this.searchNode(e,t+1);let r=[],i=this;for(;;){if(n.name===i.nodeName){if(n.pos!==0){if(r.length===0)return null;{let[a]=r.pop(),o=0;for(let r of a.childNodes)if(n.name===r.nodeName){if(o===n.pos)return r.searchNode(e,t+1);o++}return i.searchNode(e,t+1)}}{let n=i.searchNode(e,t+1);if(n!==null)return n}}if(i.childNodes?.length>0)r.push([i,0]),i=i.childNodes[0];else{if(r.length===0)return null;for(;r.length!==0;){let[e,t]=r.pop(),n=t+1;if(n<e.childNodes.length){r.push([e,n]),i=e.childNodes[n];break}}if(r.length===0)return null}}}dump(e){if(this.nodeName!==`#text`){if(e.push(`<${this.nodeName}`),this.attributes)for(let t of this.attributes)e.push(` ${t.name}="${Pr(t.value)}"`);if(this.hasChildNodes()){e.push(`>`);for(let t of this.childNodes)t.dump(e);e.push(`</${this.nodeName}>`)}else this.nodeValue?e.push(`>${Pr(this.nodeValue)}</${this.nodeName}>`):e.push(`/>`)}else e.push(Pr(this.nodeValue))}},Yd=class extends qd{constructor({hasAttributes:e=!1,lowerCaseName:t=!1}){super(),this._currentFragment=null,this._stack=null,this._errorCode=zd,this._hasAttributes=e,this._lowerCaseName=t}parseFromString(e){if(this._currentFragment=[],this._stack=[],this._errorCode=zd,this.parseXml(e),this._errorCode!==zd)return;let[t]=this._currentFragment;return t?{documentElement:t}:void 0}onText(e){if(function(e){for(let t=0,n=e.length;t<n;t++)if(!Kd(e,t))return!1;return!0}(e))return;let t=new Jd(`#text`,e);this._currentFragment.push(t)}onCdata(e){let t=new Jd(`#text`,e);this._currentFragment.push(t)}onBeginElement(e,t,n){this._lowerCaseName&&(e=e.toLowerCase());let r=new Jd(e);r.childNodes=[],this._hasAttributes&&(r.attributes=t),this._currentFragment.push(r),n||(this._stack.push(this._currentFragment),this._currentFragment=r.childNodes)}onEndElement(e){this._currentFragment=this._stack.pop()||[];let t=this._currentFragment.at(-1);if(!t)return null;for(let e of t.childNodes)e.parentNode=t;return t}onError(e){this._errorCode=e}},Xd=class{constructor(e){e=this._repair(e);let t=new Yd({lowerCaseName:!0}).parseFromString(e);this._metadataMap=new Map,this._data=e,t&&this._parse(t)}_repair(e){return e.replace(/^[^<]+/,``).replaceAll(/>\\376\\377([^<]+)/g,function(e,t){let n=t.replaceAll(/\\([0-3])([0-7])([0-7])/g,function(e,t,n,r){return String.fromCharCode(64*t+8*n+1*r)}).replaceAll(/&(amp|apos|gt|lt|quot);/g,function(e,t){switch(t){case`amp`:return`&`;case`apos`:return`'`;case`gt`:return`>`;case`lt`:return`<`;case`quot`:return`"`}throw Error(`_repair: ${t} isn't defined.`)}),r=[`>`];for(let e=0,t=n.length;e<t;e+=2){let t=256*n.charCodeAt(e)+n.charCodeAt(e+1);t>=32&&t<127&&t!==60&&t!==62&&t!==38?r.push(String.fromCharCode(t)):r.push(`&#x`+(65536+t).toString(16).substring(1)+`;`)}return r.join(``)})}_getSequence(e){let t=e.nodeName;return t!==`rdf:bag`&&t!==`rdf:seq`&&t!==`rdf:alt`?null:e.childNodes.filter(e=>e.nodeName===`rdf:li`)}_parseArray(e){if(!e.hasChildNodes())return;let[t]=e.childNodes,n=this._getSequence(t)||[];this._metadataMap.set(e.nodeName,n.map(e=>e.textContent.trim()))}_parse(e){let t=e.documentElement;if(t.nodeName!==`rdf:rdf`)for(t=t.firstChild;t&&t.nodeName!==`rdf:rdf`;)t=t.nextSibling;if(t&&t.nodeName===`rdf:rdf`&&t.hasChildNodes()){for(let e of t.childNodes)if(e.nodeName===`rdf:description`)for(let t of e.childNodes){let e=t.nodeName;switch(e){case`#text`:continue;case`dc:creator`:case`dc:subject`:this._parseArray(t);continue}this._metadataMap.set(e,t.textContent.trim())}}}get serializable(){return{parsedData:this._metadataMap,rawData:this._data}}},Zd=1,Qd=2,$d=3,ef=4,tf=5,nf=class e{constructor(e,t,n){this.xref=e,this.dict=t,this.ref=n instanceof R?n:null,this.roleMap=new Map,this.structParentIds=null}init(){this.readRoleMap()}#e(e,t,n){if(!(e instanceof R)||t<0)return;this.structParentIds||=new Xn;let r=this.structParentIds.get(e);r||(r=[],this.structParentIds.put(e,r)),r.push([t,n])}addAnnotationIdToPage(e,t){this.#e(e,t,ef)}readRoleMap(){let e=this.dict.get(`RoleMap`);if(e instanceof L)for(let[t,n]of e)n instanceof I&&this.roleMap.set(t,n.name)}static async canCreateStructureTree({catalogRef:e,pdfManager:t,newAnnotationsByPage:n}){if(!(e instanceof R))return N(`Cannot save the struct tree: no catalog reference.`),!1;let r=0,i=!0;for(let[e,a]of n){let{ref:n}=await t.getPage(e);if(!(n instanceof R)){N(`Cannot save the struct tree: page ${e} has no ref.`),i=!0;break}for(let e of a)e.accessibilityData?.type&&(e.parentTreeId=r++,i=!1)}if(i){for(let e of n.values())for(let t of e)delete t.parentTreeId;return!1}return!0}static async createStructureTree({newAnnotationsByPage:e,xref:t,catalogRef:n,pdfManager:r,changes:i}){let a=await r.ensureCatalog(`cloneDict`),o=new Xn;o.put(n,a);let s=t.getNewTemporaryRef();a.set(`StructTreeRoot`,s);let c=new L(t);c.set(`Type`,I.get(`StructTreeRoot`));let l=t.getNewTemporaryRef();c.set(`ParentTree`,l);let u=[];c.set(`K`,u),o.put(s,c);let d=new L(t),f=[];d.set(`Nums`,f);let p=await this.#t({newAnnotationsByPage:e,structTreeRootRef:s,structTreeRoot:null,kids:u,nums:f,xref:t,pdfManager:r,changes:i,cache:o});c.set(`ParentTreeNextKey`,p),o.put(l,d);for(let[e,t]of o.items())i.put(e,{data:t})}async canUpdateStructTree({pdfManager:t,newAnnotationsByPage:n}){if(!this.ref)return N(`Cannot update the struct tree: no root reference.`),!1;let r=this.dict.get(`ParentTreeNextKey`);if(!Number.isInteger(r)||r<0)return N(`Cannot update the struct tree: invalid next key.`),!1;let i=this.dict.get(`ParentTree`);if(!(i instanceof L))return N(`Cannot update the struct tree: ParentTree isn't a dict.`),!1;let a=i.get(`Nums`);if(!Array.isArray(a))return N(`Cannot update the struct tree: nums isn't an array.`),!1;let o=new Fd(i,this.xref);for(let e of n.keys()){let{pageDict:n}=await t.getPage(e);if(!n.has(`StructParents`))continue;let r=n.get(`StructParents`);if(!Number.isInteger(r)||!Array.isArray(o.get(r)))return N(`Cannot save the struct tree: page ${e} has a wrong id.`),!1}let s=!0;for(let[i,a]of n){let{pageDict:n}=await t.getPage(i);e.#r({elements:a,xref:this.xref,pageDict:n,numberTree:o});for(let e of a)e.accessibilityData?.type&&(e.accessibilityData.structParent>=0||(e.parentTreeId=r++),s=!1)}if(s){for(let e of n.values())for(let t of e)delete t.parentTreeId,delete t.structTreeParent;return!1}return!0}async updateStructureTree({newAnnotationsByPage:t,pdfManager:n,changes:r}){let{ref:i,xref:a}=this,o=this.dict.clone(),s=new Xn;s.put(i,o);let c,l=o.getRaw(`ParentTree`);l instanceof R?c=a.fetch(l):(c=l,l=a.getNewTemporaryRef(),o.set(`ParentTree`,l)),c=c.clone(),s.put(l,c);let u=c.getRaw(`Nums`),d=null;u instanceof R&&(d=u,u=a.fetch(d)),u=u.slice(),d||c.set(`Nums`,u);let f=await e.#t({newAnnotationsByPage:t,structTreeRootRef:i,structTreeRoot:this,kids:null,nums:u,xref:a,pdfManager:n,changes:r,cache:s});if(f!==-1){o.set(`ParentTreeNextKey`,f),d&&s.put(d,u);for(let[e,t]of s.items())r.put(e,{data:t})}}static async#t({newAnnotationsByPage:t,structTreeRootRef:n,structTreeRoot:r,kids:i,nums:a,xref:o,pdfManager:s,changes:c,cache:l}){let u=I.get(`OBJR`),d,f=-1;for(let[p,m]of t){let t=await s.getPage(p),{ref:h}=t,g=h instanceof R;for(let{accessibilityData:s,ref:_,parentTreeId:v,structTreeParent:y}of m){if(!s?.type)continue;let{structParent:m}=s;if(r&&Number.isInteger(m)&&m>=0){let n=(d||=new Map).get(p);n===void 0&&(n=new of(r,t.pageDict).collectObjects(h),d.set(p,n));let i=n?.get(m);if(i){let t=o.fetch(i).clone();e.#n(t,s),c.put(i,{data:t});continue}}f=Math.max(f,v);let b=o.getNewTemporaryRef(),x=new L(o);e.#n(x,s),await this.#i({structTreeParent:y,tagDict:x,newTagRef:b,structTreeRootRef:n,fallbackKids:i,xref:o,cache:l});let S=new L(o);x.set(`K`,S),S.set(`Type`,u),g&&S.set(`Pg`,h),S.set(`Obj`,_),l.put(b,x),a.push(v,b)}}return f+1}static#n(e,{type:t,title:n,lang:r,alt:i,expanded:a,actualText:o}){e.set(`S`,I.get(t)),n&&e.set(`T`,Br(n)),r&&e.set(`Lang`,Br(r)),i&&e.set(`Alt`,Br(i)),a&&e.set(`E`,Br(a)),o&&e.set(`ActualText`,Br(o))}static#r({elements:e,xref:t,pageDict:n,numberTree:r}){let i=new Map;for(let t of e)if(t.structTreeParentId){let e=parseInt(t.structTreeParentId.split(`_mc`)[1],10),n=i.get(e);n||(n=[],i.set(e,n)),n.push(t)}let a=n.get(`StructParents`);if(!Number.isInteger(a))return;let o=r.get(a),s=(e,n,r)=>{let a=i.get(e);if(a){let e=n.getRaw(`P`),i=t.fetchIfRef(e);if(e instanceof R&&i instanceof L){let e={ref:r,dict:n};for(let t of a)t.structTreeParent=e}return!0}return!1};for(let e of o){if(!(e instanceof R))continue;let n=t.fetch(e),r=n.get(`K`);if(Number.isInteger(r))s(r,n,e);else if(Array.isArray(r))for(let i of r){if(i=t.fetchIfRef(i),Number.isInteger(i)&&s(i,n,e))break;if(!(i instanceof L))continue;if(!Zn(i.get(`Type`),`MCR`))break;let r=i.get(`MCID`);if(Number.isInteger(r)&&s(r,n,e))break}}}static async#i({structTreeParent:e,tagDict:t,newTagRef:n,structTreeRootRef:r,fallbackKids:i,xref:a,cache:o}){let s,c=null;e?({ref:c}=e,s=e.dict.getRaw(`P`)||r):s=r,t.set(`P`,s);let l=a.fetchIfRef(s);if(!l)return void i.push(n);let u=o.get(s);u||(u=l.clone(),o.put(s,u));let d=u.getRaw(`K`),f=d instanceof R?o.get(d):null;if(!f){f=a.fetchIfRef(d),f=Array.isArray(f)?f.slice():[d];let e=a.getNewTemporaryRef();u.set(`K`,e),o.put(e,f)}let p=f.indexOf(c);f.splice(p>=0?p+1:f.length,0,n)}},rf=class{constructor(e,t){this.tree=e,this.xref=e.xref,this.dict=t,this.kids=[],this.parseKids()}get role(){let e=this.dict.get(`S`),t=e instanceof I?e.name:``,{root:n}=this.tree;return n.roleMap.get(t)??t}parseKids(){let e=null,t=this.dict.getRaw(`Pg`);t instanceof R&&(e=t.toString());let n=this.dict.get(`K`);if(Array.isArray(n))for(let t of n){let n=this.parseKid(e,this.xref.fetchIfRef(t));n&&this.kids.push(n)}else{let t=this.parseKid(e,n);t&&this.kids.push(t)}}parseKid(e,t){if(Number.isInteger(t))return this.tree.pageDict.objId===e?new af({type:Zd,mcid:t,pageObjId:e}):null;if(!(t instanceof L))return null;let n=t.getRaw(`Pg`);n instanceof R&&(e=n.toString());let r=t.get(`Type`)instanceof I?t.get(`Type`).name:null;if(r===`MCR`){if(this.tree.pageDict.objId!==e)return null;let n=t.getRaw(`Stm`);return new af({type:Qd,refObjId:n instanceof R?n.toString():null,pageObjId:e,mcid:t.get(`MCID`)})}if(r===`OBJR`){if(this.tree.pageDict.objId!==e)return null;let n=t.getRaw(`Obj`);return new af({type:$d,refObjId:n instanceof R?n.toString():null,pageObjId:e})}return new af({type:tf,dict:t})}},af=class{constructor({type:e,dict:t=null,mcid:n=null,pageObjId:r=null,refObjId:i=null}){this.type=e,this.dict=t,this.mcid=n,this.pageObjId=r,this.refObjId=i,this.parentNode=null}},of=class{constructor(e,t){this.root=e,this.xref=e?.xref??null,this.rootDict=e?.dict??null,this.pageDict=t,this.nodes=[]}collectObjects(e){if(!(this.root&&this.rootDict&&e instanceof R))return null;let t=this.rootDict.get(`ParentTree`);if(!t)return null;let n=this.root.structParentIds?.get(e);if(!n)return null;let r=new Map,i=new Fd(t,this.xref);for(let[e]of n){let t=i.getRaw(e);t instanceof R&&r.set(e,t)}return r}parse(e){if(!(this.root&&this.rootDict&&e instanceof R))return;let t=this.rootDict.get(`ParentTree`);if(!t)return;let n=this.pageDict.get(`StructParents`),r=this.root.structParentIds?.get(e);if(!Number.isInteger(n)&&!r)return;let i=new Map,a=new Fd(t,this.xref);if(Number.isInteger(n)){let e=a.get(n);if(Array.isArray(e))for(let t of e)t instanceof R&&this.addNode(this.xref.fetch(t),i)}if(r)for(let[e,t]of r){let n=a.get(e);if(n){let e=this.addNode(this.xref.fetchIfRef(n),i);e?.kids?.length===1&&e.kids[0].type===$d&&(e.kids[0].type=t)}}}addNode(e,t,n=0){if(n>40)return N(`StructTree MAX_DEPTH reached.`),null;if(!(e instanceof L))return null;if(t.has(e))return t.get(e);let r=new rf(this,e);t.set(e,r);let i=e.get(`P`);if(!(i instanceof L)||Zn(i.get(`Type`),`StructTreeRoot`))return this.addTopLevelNode(e,r)||t.delete(e),r;let a=this.addNode(i,t,n+1);if(!a)return r;let o=!1;for(let t of a.kids)t.type===tf&&t.dict===e&&(t.parentNode=r,o=!0);return o||t.delete(e),r}addTopLevelNode(e,t){let n=this.rootDict.get(`K`);if(!n)return!1;if(n instanceof L)return n.objId===e.objId&&(this.nodes[0]=t,!0);if(!Array.isArray(n))return!0;let r=!1;for(let i=0;i<n.length;i++)n[i]?.toString()===e.objId&&(this.nodes[i]=t,r=!0);return r}get serializable(){function e(t,n,r=0){if(r>40)return void N(`StructTree too deep to be fully serialized.`);let i=Object.create(null);i.role=t.role,i.children=[],n.children.push(i);let a=t.dict.get(`Alt`);typeof a!=`string`&&(a=t.dict.get(`ActualText`)),typeof a==`string`&&(i.alt=Nn(a));let o=t.dict.get(`A`);if(o instanceof L){let e=Er(o.getArray(`BBox`),null);if(e)i.bbox=e;else{let e=o.get(`Width`),t=o.get(`Height`);typeof e==`number`&&e>0&&typeof t==`number`&&t>0&&(i.bbox=[0,0,e,t])}}let s=t.dict.get(`Lang`);typeof s==`string`&&(i.lang=Nn(s));for(let n of t.kids){let t=n.type===tf?n.parentNode:null;t?e(t,i,r+1):n.type===Zd||n.type===Qd?i.children.push({type:`content`,id:`p${n.pageObjId}_mc${n.mcid}`}):n.type===$d?i.children.push({type:`object`,id:n.refObjId}):n.type===ef&&i.children.push({type:`annotation`,id:`pdfjs_internal_id_${n.refObjId}`})}}let t=Object.create(null);t.children=[],t.role=`Root`;for(let n of this.nodes)n&&e(n,t);return t}},sf=function(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}.bind(null,e=>e instanceof R,Zn);function cf(e){return e instanceof L&&(e=e.get(`D`)),sf(e)?e:null}function lf(e){let t=e.get(`D`);if(t){if(t instanceof I&&(t=t.name),typeof t==`string`)return Nn(t,!0);if(sf(t))return JSON.stringify(t)}return null}var uf=class e{#e=null;#t=null;builtInCMapCache=new Map;fontCache=new Xn;globalColorSpaceCache=new vu;globalImageCache=new yu;nonBlendModesSet=new Yn;pageDictCache=new Xn;pageIndexCache=new Xn;pageKidsCountCache=new Xn;standardFontDataCache=new Map;systemFontCache=new Map;constructor(e,t){if(this.pdfManager=e,this.xref=t,this.#t=t.getCatalogObj(),!(this.#t instanceof L))throw new F(`Catalog object is not a dictionary.`);this.toplevelPagesDict}cloneDict(){return this.#t.clone()}get version(){let e=this.#t.get(`Version`);if(e instanceof I){if(nr.test(e.name))return P(this,`version`,e.name);N(`Invalid PDF catalog version: ${e.name}`)}return P(this,`version`,null)}get lang(){let e=this.#t.get(`Lang`);return P(this,`lang`,e&&typeof e==`string`?Nn(e):null)}get needsRendering(){let e=this.#t.get(`NeedsRendering`);return P(this,`needsRendering`,typeof e==`boolean`&&e)}get collection(){let e=null;try{let t=this.#t.get(`Collection`);t instanceof L&&t.size>0&&(e=t)}catch(e){if(e instanceof cr)throw e;hn(`Cannot fetch Collection entry; assuming no collection is present.`)}return P(this,`collection`,e)}get acroForm(){let e=null;try{let t=this.#t.get(`AcroForm`);t instanceof L&&t.size>0&&(e=t)}catch(e){if(e instanceof cr)throw e;hn(`Cannot fetch AcroForm entry; assuming no forms are present.`)}return P(this,`acroForm`,e)}get acroFormRef(){let e=this.#t.getRaw(`AcroForm`);return P(this,`acroFormRef`,e instanceof R?e:null)}get metadata(){let e=this.#t.getRaw(`Metadata`);if(!(e instanceof R))return P(this,`metadata`,null);let t=null;try{let n=this.xref.fetch(e,!this.xref.encrypt?.encryptMetadata);if(n instanceof tr&&n.dict instanceof L){let e=n.dict.get(`Type`),r=n.dict.get(`Subtype`);if(Zn(e,`Metadata`)&&Zn(r,`XML`)){let e=Pn(n.getString());e&&(t=new Xd(e).serializable)}}}catch(e){if(e instanceof cr)throw e;hn(`Skipping invalid Metadata: "${e}".`)}return P(this,`metadata`,t)}get markInfo(){let e=null;try{e=this.#n()}catch(e){if(e instanceof cr)throw e;N(`Unable to read mark info.`)}return P(this,`markInfo`,e)}#n(){let e=this.#t.get(`MarkInfo`);if(!(e instanceof L))return null;let t={Marked:!1,UserProperties:!1,Suspects:!1};for(let n in t){let r=e.get(n);typeof r==`boolean`&&(t[n]=r)}return t}get structTreeRoot(){let e=null;try{e=this.#r()}catch(e){if(e instanceof cr)throw e;N(`Unable read to structTreeRoot info.`)}return P(this,`structTreeRoot`,e)}#r(){let e=this.#t.getRaw(`StructTreeRoot`),t=this.xref.fetchIfRef(e);if(!(t instanceof L))return null;let n=new nf(this.xref,t,e);return n.init(),n}get toplevelPagesDict(){let e=this.#t.get(`Pages`);if(!(e instanceof L))throw new F(`Invalid top-level pages dictionary.`);return P(this,`toplevelPagesDict`,e)}get documentOutline(){let e=null;try{e=this.#i()}catch(e){if(e instanceof cr)throw e;N(`Unable to read document outline.`)}return P(this,`documentOutline`,e)}#i(){let t=this.#t.get(`Outlines`);if(!(t instanceof L)||(t=t.getRaw(`First`),!(t instanceof R)))return null;let n={items:[]},r=[{obj:t,parent:n}],i=new Yn;i.put(t);let a=this.xref,o=new Uint8ClampedArray(3);for(;r.length>0;){let n=r.shift(),s=a.fetchIfRef(n.obj);if(s===null)continue;s.has(`Title`)||N(`Invalid outline item encountered.`);let c={url:null,dest:null,action:null};e.parseDestDictionary({destDict:s,resultObj:c,docBaseUrl:this.baseUrl,docAttachments:this.attachments});let l=s.get(`Title`),u=s.get(`F`)||0,d=s.getArray(`C`),f=s.get(`Count`),p=o;!Cr(d,3)||d[0]===0&&d[1]===0&&d[2]===0||(p=Di.rgb.getRgb(d,0));let m={action:c.action,attachment:c.attachment,dest:c.dest,url:c.url,unsafeUrl:c.unsafeUrl,newWindow:c.newWindow,setOCGState:c.setOCGState,title:typeof l==`string`?Nn(l):``,color:p,count:Number.isInteger(f)?f:void 0,bold:!!(2&u),italic:!!(1&u),items:[]};n.parent.items.push(m),t=s.getRaw(`First`),t instanceof R&&!i.has(t)&&(r.push({obj:t,parent:m}),i.put(t)),t=s.getRaw(`Next`),t instanceof R&&!i.has(t)&&(r.push({obj:t,parent:n.parent}),i.put(t))}return n.items.length>0?n.items:null}get permissions(){let e=null;try{e=this.#a()}catch(e){if(e instanceof cr)throw e;N(`Unable to read permissions.`)}return P(this,`permissions`,e)}#a(){let e=this.xref.trailer.get(`Encrypt`);if(!(e instanceof L))return null;let t=e.get(`P`);if(typeof t!=`number`)return null;t+=2**32;let n=[];for(let e in b){let r=b[e];t&r&&n.push(r)}return n}get optionalContentConfig(){let e=null;try{let t=this.#t.get(`OCProperties`);if(!t)return P(this,`optionalContentConfig`,null);let n=t.get(`D`);if(!n)return P(this,`optionalContentConfig`,null);let r=t.get(`OCGs`);if(!Array.isArray(r))return P(this,`optionalContentConfig`,null);let i=new Xn;for(let e of r)e instanceof R&&!i.has(e)&&i.put(e,this.#o(e));e=this.#s(n,i)}catch(e){if(e instanceof cr)throw e;N(`Unable to read optional content config: ${e}`)}return P(this,`optionalContentConfig`,e)}#o(e){let t=this.xref.fetch(e),n={id:e.toString(),name:null,intent:null,usage:{print:null,view:null},rbGroups:[]},r=t.get(`Name`);typeof r==`string`&&(n.name=Nn(r));let i=t.getArray(`Intent`);Array.isArray(i)||(i=[i]),i.every(e=>e instanceof I)&&(n.intent=i.map(e=>e.name));let a=t.get(`Usage`);if(!(a instanceof L))return n;let o=n.usage,s=a.get(`Print`);if(s instanceof L){let e=s.get(`PrintState`);if(e instanceof I)switch(e.name){case`ON`:case`OFF`:o.print={printState:e.name}}}let c=a.get(`View`);if(c instanceof L){let e=c.get(`ViewState`);if(e instanceof I)switch(e.name){case`ON`:case`OFF`:o.view={viewState:e.name}}}return n}#s(e,t){function n(e){let n=[];if(Array.isArray(e))for(let r of e)r instanceof R&&t.has(r)&&n.push(r.toString());return n}function r(e,n=0){if(!Array.isArray(e))return null;let r=[];for(let a of e){if(a instanceof R&&t.has(a)){o.put(a),r.push(a.toString());continue}let e=i(a,n);e&&r.push(e)}if(n>0)return r;let a=[];for(let[e]of t.items())o.has(e)||a.push(e.toString());return a.length&&r.push({name:null,order:a}),r}function i(e,t){if(++t>s)return N(`parseNestedOrder - reached MAX_NESTED_LEVELS.`),null;let n=a.fetchIfRef(e);if(!Array.isArray(n))return null;let i=a.fetchIfRef(n[0]);if(typeof i!=`string`)return null;let o=r(n.slice(1),t);return o?.length?{name:Nn(i),order:o}:null}let a=this.xref,o=new Yn,s=10;return function(e){if(Array.isArray(e))for(let n of e){let e=a.fetchIfRef(n);if(!Array.isArray(e)||!e.length)continue;let r=new Set;for(let n of e)n instanceof R&&t.has(n)&&!r.has(n.toString())&&(r.add(n.toString()),t.get(n).rbGroups.push(r))}}(e.get(`RBGroups`)),{name:typeof e.get(`Name`)==`string`?Nn(e.get(`Name`)):null,creator:typeof e.get(`Creator`)==`string`?Nn(e.get(`Creator`)):null,baseState:e.get(`BaseState`)instanceof I?e.get(`BaseState`).name:null,on:n(e.get(`ON`)),off:n(e.get(`OFF`)),order:r(e.get(`Order`)),groups:[...t]}}setActualNumPages(e=null){this.#e=e}get hasActualNumPages(){return this.#e!==null}get _pagesCount(){let e=this.toplevelPagesDict.get(`Count`);if(!Number.isInteger(e))throw new F(`Page count in top-level pages dictionary is not an integer.`);return P(this,`_pagesCount`,e)}get numPages(){return this.#e??this._pagesCount}get destinations(){let e=this.#c(),t=Object.create(null);for(let n of e)if(n instanceof Pd)for(let[e,r]of n.getAll()){let n=cf(r);n&&(t[Nn(e,!0)]=n)}else if(n instanceof L)for(let[e,r]of n){let n=cf(r);n&&(t[Nn(e,!0)]||=n)}return P(this,`destinations`,t)}getDestination(e){if(this.hasOwnProperty(`destinations`))return this.destinations[e]??null;let t=this.#c();for(let n of t)if(n instanceof Pd||n instanceof L){let t=cf(n.get(e));if(t)return t}if(t.length){let t=this.destinations[e];if(t)return t}return null}#c(){let e=this.#t.get(`Names`),t=[];return e?.has(`Dests`)&&t.push(new Pd(e.getRaw(`Dests`),this.xref)),this.#t.has(`Dests`)&&t.push(this.#t.get(`Dests`)),t}get pageLabels(){let e=null;try{e=this.#l()}catch(e){if(e instanceof cr)throw e;N(`Unable to read page labels.`)}return P(this,`pageLabels`,e)}#l(){let e=this.#t.getRaw(`PageLabels`);if(!e)return null;let t=Array(this.numPages),n=null,r=``,i=new Fd(e,this.xref).getAll(),a=``,o=1;for(let e=0,s=this.numPages;e<s;e++){let s=i.get(e);if(s!==void 0){if(!(s instanceof L))throw new F(`PageLabel is not a dictionary.`);if(s.has(`Type`)&&!Zn(s.get(`Type`),`PageLabel`))throw new F(`Invalid type in PageLabel dictionary.`);if(s.has(`S`)){let e=s.get(`S`);if(!(e instanceof I))throw new F(`Invalid style in PageLabel dictionary.`);n=e.name}else n=null;if(s.has(`P`)){let e=s.get(`P`);if(typeof e!=`string`)throw new F(`Invalid prefix in PageLabel dictionary.`);r=Nn(e)}else r=``;if(s.has(`St`)){let e=s.get(`St`);if(!(Number.isInteger(e)&&e>=1))throw new F(`Invalid start in PageLabel dictionary.`);o=e}else o=1}switch(n){case`D`:a=o;break;case`R`:case`r`:a=gr(o,n===`r`);break;case`A`:case`a`:let e=n===`a`?97:65,t=o-1;a=String.fromCharCode(e+t%26).repeat(Math.floor(t/26)+1);break;default:if(n)throw new F(`Invalid style "${n}" in PageLabel dictionary.`);a=``}t[e]=r+a,o++}return t}get pageLayout(){let e=this.#t.get(`PageLayout`),t=``;if(e instanceof I)switch(e.name){case`SinglePage`:case`OneColumn`:case`TwoColumnLeft`:case`TwoColumnRight`:case`TwoPageLeft`:case`TwoPageRight`:t=e.name}return P(this,`pageLayout`,t)}get pageMode(){let e=this.#t.get(`PageMode`),t=`UseNone`;if(e instanceof I)switch(e.name){case`UseNone`:case`UseOutlines`:case`UseThumbs`:case`FullScreen`:case`UseOC`:case`UseAttachments`:t=e.name}return P(this,`pageMode`,t)}get viewerPreferences(){let e=this.#t.get(`ViewerPreferences`);if(!(e instanceof L))return P(this,`viewerPreferences`,null);let t=null;for(let[n,r]of e){let e;switch(n){case`HideToolbar`:case`HideMenubar`:case`HideWindowUI`:case`FitWindow`:case`CenterWindow`:case`DisplayDocTitle`:case`PickTrayByPDFSize`:typeof r==`boolean`&&(e=r);break;case`NonFullScreenPageMode`:if(r instanceof I)switch(r.name){case`UseNone`:case`UseOutlines`:case`UseThumbs`:case`UseOC`:e=r.name;break;default:e=`UseNone`}break;case`Direction`:if(r instanceof I)switch(r.name){case`L2R`:case`R2L`:e=r.name;break;default:e=`L2R`}break;case`ViewArea`:case`ViewClip`:case`PrintArea`:case`PrintClip`:if(r instanceof I)switch(r.name){case`MediaBox`:case`CropBox`:case`BleedBox`:case`TrimBox`:case`ArtBox`:e=r.name;break;default:e=`CropBox`}break;case`PrintScaling`:if(r instanceof I)switch(r.name){case`None`:case`AppDefault`:e=r.name;break;default:e=`AppDefault`}break;case`Duplex`:if(r instanceof I)switch(r.name){case`Simplex`:case`DuplexFlipShortEdge`:case`DuplexFlipLongEdge`:e=r.name;break;default:e=`None`}break;case`PrintPageRange`:Array.isArray(r)&&r.length%2==0&&r.every((e,t,n)=>Number.isInteger(e)&&e>0&&(t===0||e>=n[t-1])&&e<=this.numPages)&&(e=r);break;case`NumCopies`:Number.isInteger(r)&&r>0&&(e=r);break;default:N(`Ignoring non-standard key in ViewerPreferences: ${n}.`);continue}e===void 0?N(`Bad value, for key "${n}", in ViewerPreferences: ${r}.`):(t??=Object.create(null),t[n]=e)}return P(this,`viewerPreferences`,t)}get openAction(){let t=this.#t.get(`OpenAction`),n=Object.create(null);if(t instanceof L){let r=new L(this.xref);r.set(`A`,t);let i={url:null,dest:null,action:null};e.parseDestDictionary({destDict:r,resultObj:i}),Array.isArray(i.dest)?n.dest=i.dest:i.action&&(n.action=i.action)}else sf(t)&&(n.dest=t);return P(this,`openAction`,On(n)>0?n:null)}get attachments(){let e=this.#t.get(`Names`),t=null;if(e instanceof L&&e.has(`EmbeddedFiles`)){let n=new Pd(e.getRaw(`EmbeddedFiles`),this.xref);for(let[e,r]of n.getAll()){let n=new Rd(r,this.xref);t??=Object.create(null),t[Nn(e,!0)]=n.serializable}}return P(this,`attachments`,t)}get xfaImages(){let e=this.#t.get(`Names`),t=null;if(e instanceof L&&e.has(`XFAImages`)){let n=new Pd(e.getRaw(`XFAImages`),this.xref);for(let[e,r]of n.getAll())r instanceof tr&&(t??=new Map,t.set(Nn(e,!0),r.getBytes()))}return P(this,`xfaImages`,t)}#u(){let e=this.#t.get(`Names`),t=null;function n(e,n){if(!(n instanceof L)||!Zn(n.get(`S`),`JavaScript`))return;let r=n.get(`JS`);if(r instanceof tr)r=r.getString();else if(typeof r!=`string`)return;r=Nn(r,!0).replaceAll(`\0`,``),r&&(t||=new Map).set(e,r)}if(e instanceof L&&e.has(`JavaScript`)){let t=new Pd(e.getRaw(`JavaScript`),this.xref);for(let[e,r]of t.getAll())n(Nn(e,!0),r)}let r=this.#t.get(`OpenAction`);return r&&n(`OpenAction`,r),t}get jsActions(){let e=this.#u(),t=jr(this.xref,this.#t,be);if(e){t||=Object.create(null);for(let[n,r]of e)n in t?t[n].push(r):t[n]=[r]}return P(this,`jsActions`,t)}async cleanup(e=!1){Id(),this.globalColorSpaceCache.clear(),this.globalImageCache.clear(e),this.pageKidsCountCache.clear(),this.pageIndexCache.clear(),this.pageDictCache.clear(),this.nonBlendModesSet.clear();for(let{dict:e}of await Promise.all(this.fontCache))delete e.cacheKey;this.fontCache.clear(),this.builtInCMapCache.clear(),this.standardFontDataCache.clear(),this.systemFontCache.clear()}async getPageDict(e){let t=[this.toplevelPagesDict],n=new Yn,r=this.#t.getRaw(`Pages`);r instanceof R&&n.put(r);let i=this.xref,a=this.pageKidsCountCache,o=this.pageIndexCache,s=this.pageDictCache,c=0;for(;t.length;){let r=t.pop();if(r instanceof R){let l=a.get(r);if(l>=0&&c+l<=e){c+=l;continue}if(n.has(r))throw new F(`Pages tree contains circular reference.`);n.put(r);let u=await(s.get(r)||i.fetchAsync(r));if(u instanceof L){let t=u.getRaw(`Type`);if(t instanceof R&&(t=await i.fetchAsync(t)),Zn(t,`Page`)||!u.has(`Kids`)){if(a.has(r)||a.put(r,1),o.has(r)||o.put(r,c),c===e)return[u,r];c++;continue}}t.push(u);continue}if(!(r instanceof L))throw new F(`Page dictionary kid reference points to wrong type of object.`);let{objId:l}=r,u=r.getRaw(`Count`);if(u instanceof R&&(u=await i.fetchAsync(u)),Number.isInteger(u)&&u>=0&&(l&&!a.has(l)&&a.put(l,u),c+u<=e)){c+=u;continue}let d=r.getRaw(`Kids`);if(d instanceof R&&(d=await i.fetchAsync(d)),!Array.isArray(d)){let t=r.getRaw(`Type`);if(t instanceof R&&(t=await i.fetchAsync(t)),Zn(t,`Page`)||!r.has(`Kids`)){if(c===e)return[r,null];c++;continue}throw new F(`Page dictionary kids object is not an array.`)}for(let e=d.length-1;e>=0;e--){let n=d[e];t.push(n),r===this.toplevelPagesDict&&n instanceof R&&!s.has(n)&&s.put(n,i.fetchAsync(n))}}throw Error(`Page index ${e} not found.`)}async getAllPageDicts(e=!1){let{ignoreErrors:t}=this.pdfManager.evaluatorOptions,n=[{currentNode:this.toplevelPagesDict,posInKids:0}],r=new Yn,i=this.#t.getRaw(`Pages`);i instanceof R&&r.put(i);let a=new Map,o=this.xref,s=this.pageIndexCache,c=0;function l(e,t){t&&!s.has(t)&&s.put(t,c),a.set(c++,[e,t])}function u(n){if(n instanceof ur&&!e)throw n;e&&t&&c===0&&(N(`getAllPageDicts - Skipping invalid first page: "${n}".`),n=L.empty),a.set(c++,[n,null])}for(;n.length>0;){let e=n.at(-1),{currentNode:t,posInKids:i}=e,a=t.getRaw(`Kids`);if(a instanceof R)try{a=await o.fetchAsync(a)}catch(e){u(e);break}if(!Array.isArray(a)){u(new F(`Page dictionary kids object is not an array.`));break}if(i>=a.length){n.pop();continue}let s=a[i],c;if(s instanceof R){if(r.has(s)){u(new F(`Pages tree contains circular reference.`));break}r.put(s);try{c=await o.fetchAsync(s)}catch(e){u(e);break}}else c=s;if(!(c instanceof L)){u(new F(`Page dictionary kid reference points to wrong type of object.`));break}let d=c.getRaw(`Type`);if(d instanceof R)try{d=await o.fetchAsync(d)}catch(e){u(e);break}Zn(d,`Page`)||!c.has(`Kids`)?l(c,s instanceof R?s:null):n.push({currentNode:c,posInKids:0}),e.posInKids++}return a}getPageIndex(e){let t=this.pageIndexCache.get(e);if(t!==void 0)return Promise.resolve(t);let n=this.xref,r=0,i=t=>function(t){let r,i=0;return n.fetchAsync(t).then(function(n){if(er(t,e)&&!$n(n,`Page`)&&!(n instanceof L&&!n.has(`Type`)&&n.has(`Contents`)))throw new F(`The reference does not point to a /Page dictionary.`);if(!n)return null;if(!(n instanceof L))throw new F(`Node must be a dictionary.`);return r=n.getRaw(`Parent`),n.getAsync(`Parent`)}).then(function(e){if(!e)return null;if(!(e instanceof L))throw new F(`Parent must be a dictionary.`);return e.getAsync(`Kids`)}).then(function(e){if(!e)return null;let a=[],o=!1;for(let r of e){if(!(r instanceof R))throw new F(`Kid must be a reference.`);if(er(r,t)){o=!0;break}a.push(n.fetchAsync(r).then(function(e){if(!(e instanceof L))throw new F(`Kid node must be a dictionary.`);e.has(`Count`)?i+=e.get(`Count`):i++}))}if(!o)throw new F(`Kid reference not found in parent's kids.`);return Promise.all(a).then(()=>[i,r])})}(t).then(t=>{if(!t)return this.pageIndexCache.put(e,r),r;let[n,a]=t;return r+=n,i(a)});return i(e)}get baseUrl(){let e=this.#t.get(`URI`);if(e instanceof L){let t=e.get(`Base`);if(typeof t==`string`){let e=vn(t,null,{tryConvertEncoding:!0});if(e)return P(this,`baseUrl`,e.href)}}return P(this,`baseUrl`,this.pdfManager.docBaseUrl)}static parseDestDictionary({destDict:e,resultObj:t,docBaseUrl:n=null,docAttachments:r=null}){if(!(e instanceof L))return void N("parseDestDictionary: `destDict` must be a dictionary.");let i,a,o=e.get(`A`);if(o instanceof L||(e.has(`Dest`)?o=e.get(`Dest`):(o=e.get(`AA`),o instanceof L&&(o.has(`D`)?o=o.get(`D`):o.has(`U`)&&(o=o.get(`U`))))),o instanceof L){let e=o.get(`S`);if(!(e instanceof I))return void N(`parseDestDictionary: Invalid type in Action dictionary.`);let n=e.name;switch(n){case`ResetForm`:let e=o.get(`Flags`),s=!(1&(typeof e==`number`?e:0)),c=[],l=[];for(let e of o.get(`Fields`)||[])e instanceof R?l.push(e.toString()):typeof e==`string`&&c.push(Nn(e));t.resetForm={fields:c,refs:l,include:s};break;case`URI`:i=o.get(`URI`),i instanceof I&&(i=`/`+i.name);break;case`GoTo`:a=o.get(`D`);break;case`Launch`:case`GoToR`:let u=o.get(`F`);if(u instanceof L){let{rawFilename:e}=new Rd(u,null,!0).serializable;i=e}else typeof u==`string`&&(i=u);let d=lf(o);d&&typeof i==`string`&&(i=i.split(`#`,1)[0]+`#`+d);let f=o.get(`NewWindow`);typeof f==`boolean`&&(t.newWindow=f);break;case`GoToE`:let p=o.get(`T`),m;if(r&&p instanceof L){let e=p.get(`R`),t=p.get(`N`);Zn(e,`C`)&&typeof t==`string`&&(m=r[Nn(t,!0)])}if(m){t.attachment=m;let e=lf(o);e&&(t.attachmentDest=e)}else N(`parseDestDictionary - unimplemented "GoToE" action.`);break;case`Named`:let h=o.get(`N`);h instanceof I&&(t.action=h.name);break;case`SetOCGState`:let g=o.get(`State`),_=o.get(`PreserveRB`);if(!Array.isArray(g)||g.length===0)break;let v=[];for(let e of g)if(e instanceof I)switch(e.name){case`ON`:case`OFF`:case`Toggle`:v.push(e.name)}else e instanceof R&&v.push(e.toString());if(v.length!==g.length)break;t.setOCGState={state:v,preserveRB:typeof _!=`boolean`||_};break;case`JavaScript`:let y=o.get(`JS`),b;y instanceof tr?b=y.getString():typeof y==`string`&&(b=y);let x=b&&Lr(Nn(b,!0));if(x){i=x.url,t.newWindow=x.newWindow;break}default:if(n===`JavaScript`||n===`SubmitForm`)break;N(`parseDestDictionary - unsupported action: "${n}".`)}}else e.has(`Dest`)&&(a=e.get(`Dest`));if(typeof i==`string`){let e=vn(i,n,{addDefaultProtocol:!0,tryConvertEncoding:!0});e&&(t.url=e.href),t.unsafeUrl=i}a&&(a instanceof I&&(a=a.name),typeof a==`string`?t.dest=Nn(a,!0):sf(a)&&(t.dest=a))}};function df(e){return e instanceof R||e instanceof L||e instanceof tr||Array.isArray(e)}function ff(e,t){if(e instanceof L)e=e.getRawValues();else if(e instanceof tr)e=e.dict.getRawValues();else if(!Array.isArray(e))return;for(let n of e)df(n)&&t.push(n)}var pf=class e{refSet=new Yn;constructor(e,t,n){this.dict=e,this.keys=t,this.xref=n}async load(){let{keys:e,dict:t}=this,n=[];for(let r of e){let e=t.getRaw(r);e!==void 0&&n.push(e)}await this.#e(n),this.refSet=null}async#e(e){let t=[],n=[];for(;e.length;){let r=e.pop();if(r instanceof R){if(this.refSet.has(r))continue;try{this.refSet.put(r),r=this.xref.fetch(r)}catch(e){if(!(e instanceof cr))return N(`ObjectLoader.#walk - requesting all data: "${e}".`),void await this.xref.stream.manager.requestAllChunks();t.push(r),n.push({begin:e.begin,end:e.end})}}if(r instanceof tr){let e=r.getBaseStreams();if(e){let i=!1;for(let t of e)t.isDataLoaded||(i=!0,n.push({begin:t.start,end:t.end}));i&&t.push(r)}}ff(r,e)}if(n.length){await this.xref.stream.manager.requestRanges(n);for(let e of t)e instanceof R&&this.refSet.remove(e);await this.#e(t)}}static async load(t,n,r){r.stream.isDataLoaded||await new e(t,n,r).load()}},mf=Symbol(),hf=Symbol(),gf=Symbol(),_f=Symbol(),vf=Symbol(),yf=Symbol(),bf=Symbol(),xf=Symbol(),Sf=Symbol(),z=Symbol(`content`),Cf=Symbol(`data`),wf=Symbol(),B=Symbol(`extra`),Tf=Symbol(),Ef=Symbol(),Df=Symbol(),Of=Symbol(),kf=Symbol(),Af=Symbol(),jf=Symbol(),Mf=Symbol(),Nf=Symbol(),Pf=Symbol(),Ff=Symbol(),If=Symbol(),Lf=Symbol(),Rf=Symbol(),zf=Symbol(),Bf=Symbol(),Vf=Symbol(),Hf=Symbol(),Uf=Symbol(),Wf=Symbol(),Gf=Symbol(),Kf=Symbol(),qf=Symbol(),Jf=Symbol(),Yf=Symbol(),Xf=Symbol(),Zf=Symbol(),Qf=Symbol(),$f=Symbol(),ep=Symbol(),tp=Symbol(),np=Symbol(),rp=Symbol(`namespaceId`),ip=Symbol(`nodeName`),ap=Symbol(),op=Symbol(),sp=Symbol(),cp=Symbol(),lp=Symbol(),up=Symbol(),dp=Symbol(),fp=Symbol(),pp=Symbol(`root`),mp=Symbol(),hp=Symbol(),gp=Symbol(),_p=Symbol(),vp=Symbol(),yp=Symbol(),bp=Symbol(),xp=Symbol(),V=Symbol(),Sp=Symbol(),Cp=Symbol(),wp=Symbol(`uid`),Tp=Symbol(),Ep={config:{id:0,check:e=>e.startsWith(`http://www.xfa.org/schema/xci/`)},connectionSet:{id:1,check:e=>e.startsWith(`http://www.xfa.org/schema/xfa-connection-set/`)},datasets:{id:2,check:e=>e.startsWith(`http://www.xfa.org/schema/xfa-data/`)},form:{id:3,check:e=>e.startsWith(`http://www.xfa.org/schema/xfa-form/`)},localeSet:{id:4,check:e=>e.startsWith(`http://www.xfa.org/schema/xfa-locale-set/`)},pdf:{id:5,check:e=>e===`http://ns.adobe.com/xdp/pdf/`},signature:{id:6,check:e=>e===`http://www.w3.org/2000/09/xmldsig#`},sourceSet:{id:7,check:e=>e.startsWith(`http://www.xfa.org/schema/xfa-source-set/`)},stylesheet:{id:8,check:e=>e===`http://www.w3.org/1999/XSL/Transform`},template:{id:9,check:e=>e.startsWith(`http://www.xfa.org/schema/xfa-template/`)},xdc:{id:10,check:e=>e.startsWith(`http://www.xfa.org/schema/xdc/`)},xdp:{id:11,check:e=>e===`http://ns.adobe.com/xdp/`},xfdf:{id:12,check:e=>e===`http://ns.adobe.com/xfdf/`},xhtml:{id:13,check:e=>e===`http://www.w3.org/1999/xhtml`},xmpmeta:{id:14,check:e=>e===`http://ns.adobe.com/xmpmeta/`}},Dp={pt:e=>e,cm:e=>e/2.54*72,mm:e=>e/25.4*72,in:e=>72*e,px:e=>e},Op=/([+-]?\d+\.?\d*)(.*)/;function kp(e){return e.startsWith(`'`)||e.startsWith(`"`)?e.slice(1,-1):e}function H({data:e,defaultValue:t,validate:n}){if(!e)return t;e=e.trim();let r=parseInt(e,10);return!isNaN(r)&&n(r)?r:t}function Ap({data:e,defaultValue:t,validate:n}){if(!e)return t;e=e.trim();let r=parseFloat(e);return!isNaN(r)&&n(r)?r:t}function jp({data:e,defaultValue:t,validate:n}){return e&&n(e=e.trim())?e:t}function U(e,t){return jp({data:e,defaultValue:t[0],validate:e=>t.includes(e)})}function W(e,t=`0`){if(t||=`0`,!e)return W(t);let n=e.trim().match(Op);if(!n)return W(t);let[,r,i]=n,a=parseFloat(r);if(isNaN(a))return W(t);if(a===0)return 0;let o=Dp[i];return o?o(a):a}function Mp(e){if(!e)return{num:1,den:1};let t=e.split(`:`,2).map(e=>parseFloat(e.trim())).filter(e=>!isNaN(e));if(t.length===1&&t.push(1),t.length===0)return{num:1,den:1};let[n,r]=t;return{num:n,den:r}}function Np(e){return e?e.trim().split(/\s+/).map(e=>({excluded:e[0]===`-`,viewname:e.substring(1)})):[]}var G=class e{static get FAILURE(){return P(this,`FAILURE`,new e(!1,null,null,null))}static get EMPTY(){return P(this,`EMPTY`,new e(!0,null,null,null))}constructor(e,t,n,r){this.success=e,this.html=t,this.bbox=n,this.breakNode=r}isBreak(){return!!this.breakNode}static breakNode(t){return new e(!1,null,null,t)}static success(t,n=null){return new e(!0,t,n,null)}},Pp=class{constructor(e){this.fonts=new Map,this.cache=new Map,this.warned=new Set,this.defaultFont=null,this.add(e)}add(e,t=null){for(let t of e)this.addPdfFont(t);for(let e of this.fonts.values())e.regular||=e.italic||e.bold||e.bolditalic;if(!t||t.size===0)return;let n=this.fonts.get(`PdfJS-Fallback-PdfJS-XFA`);for(let e of t)this.fonts.set(e,n)}addPdfFont(e){let t=e.cssFontInfo,n=t.fontFamily,r=this.fonts.get(n);r||(r=Object.create(null),this.fonts.set(n,r),this.defaultFont||=r);let i=``,a=parseFloat(t.fontWeight);parseFloat(t.italicAngle)===0?a>=700&&(i=`bold`):i=a>=700?`bolditalic`:`italic`,i||((e.name.includes(`Bold`)||e.psName?.includes(`Bold`))&&(i=`bold`),(e.name.includes(`Italic`)||e.name.endsWith(`It`)||e.psName?.includes(`Italic`)||e.psName?.endsWith(`It`))&&(i+=`italic`)),i||=`regular`,r[i]=e}getDefault(){return this.defaultFont}find(e,t=!0){let n=this.fonts.get(e)||this.cache.get(e);if(n)return n;let r=/,|-|_| |bolditalic|bold|italic|regular|it/gi,i=e.replaceAll(r,``);if(n=this.fonts.get(i),n)return this.cache.set(e,n),n;i=i.toLowerCase();let a=[];for(let[e,t]of this.fonts.entries())e.replaceAll(r,``).toLowerCase().startsWith(i)&&a.push(t);if(a.length===0)for(let[,e]of this.fonts.entries())e.regular.name?.replaceAll(r,``).toLowerCase().startsWith(i)&&a.push(e);if(a.length===0){i=i.replaceAll(/psmt|mt/gi,``);for(let[e,t]of this.fonts.entries())e.replaceAll(r,``).toLowerCase().startsWith(i)&&a.push(t)}if(a.length===0)for(let e of this.fonts.values())e.regular.name?.replaceAll(r,``).toLowerCase().startsWith(i)&&a.push(e);return a.length>=1?(a.length!==1&&t&&N(`XFA - Too many choices to guess the correct font: ${e}`),this.cache.set(e,a[0]),a[0]):(t&&!this.warned.has(e)&&(this.warned.add(e),N(`XFA - Cannot find the font: ${e}`)),null)}};function Fp(e,t){return e.posture===`italic`?e.weight===`bold`?t.bolditalic:t.italic:e.weight===`bold`?t.bold:t.regular}var Ip=class{constructor(e,t,n,r){if(this.lineHeight=n,this.paraMargin=t||{top:0,bottom:0,left:0,right:0},!e)return void([this.pdfFont,this.xfaFont]=this.defaultFont(r));this.xfaFont={typeface:e.typeface,posture:e.posture,weight:e.weight,size:e.size,letterSpacing:e.letterSpacing};let i=r.find(e.typeface);i?(this.pdfFont=Fp(e,i),this.pdfFont||([this.pdfFont,this.xfaFont]=this.defaultFont(r))):[this.pdfFont,this.xfaFont]=this.defaultFont(r)}defaultFont(e){let t=e.find(`Helvetica`,!1)||e.find(`Myriad Pro`,!1)||e.find(`Arial`,!1)||e.getDefault();if(t?.regular){let e=t.regular;return[e,{typeface:e.cssFontInfo.fontFamily,posture:`normal`,weight:`normal`,size:10,letterSpacing:0}]}return[null,{typeface:`Courier`,posture:`normal`,weight:`normal`,size:10,letterSpacing:0}]}},Lp=class{constructor(e,t,n,r){this.fontFinder=r,this.stack=[new Ip(e,t,n,r)]}pushData(e,t,n){let r=this.stack.at(-1);for(let t of[`typeface`,`posture`,`weight`,`size`,`letterSpacing`])e[t]||(e[t]=r.xfaFont[t]);for(let e of[`top`,`bottom`,`left`,`right`])isNaN(t[e])&&(t[e]=r.paraMargin[e]);let i=new Ip(e,t,n||r.lineHeight,this.fontFinder);i.pdfFont||=r.pdfFont,this.stack.push(i)}popFont(){this.stack.pop()}topFont(){return this.stack.at(-1)}},Rp=class{constructor(e,t,n,r){this.glyphs=[],this.fontSelector=new Lp(e,t,n,r),this.extraHeight=0}pushData(e,t,n){this.fontSelector.pushData(e,t,n)}popFont(e){return this.fontSelector.popFont()}addPara(){let e=this.fontSelector.topFont();this.extraHeight+=e.paraMargin.top+e.paraMargin.bottom}addString(e){if(!e)return;let t=this.fontSelector.topFont(),n=t.xfaFont.size;if(t.pdfFont){let r=t.xfaFont.letterSpacing,i=t.pdfFont,a=i.lineHeight||1.2,o=t.lineHeight||Math.max(1.2,a)*n,s=a-(i.lineGap===void 0?.2:i.lineGap),c=Math.max(1,s)*n,l=n/1e3,u=i.defaultWidth||i.charsToGlyphs(` `)[0].width;for(let t of e.split(/[\u2029\n]/)){let e=i.encodeString(t).join(``),n=i.charsToGlyphs(e);for(let e of n){let t=e.width||u;this.glyphs.push([t*l+r,o,c,e.unicode,!1])}this.glyphs.push([0,0,0,`
9
9
  `,!0])}this.glyphs.pop();return}for(let t of e.split(/[\u2029\n]/)){for(let e of t.split(``))this.glyphs.push([n,1.2*n,n,e,!1]);this.glyphs.push([0,0,0,`
@@ -20,14 +20,14 @@ import{t as e}from"./preload-helper-D4M6sveU.js";globalThis.DOMMatrix===void 0&&
20
20
  `);return`/Tx BMC q ${h}BT `+e+` 1 0 0 1 0 ${Rr(a)} Tm ${g} ET Q EMC`}_splitLine(e,t,n,r,i={}){e=i.line||e;let a=i.glyphs||t.charsToGlyphs(e);if(a.length<=1)return[e];let o=i.positions||t.getCharPositions(e),s=n/1e3,c=[],l=-1,u=-1,d=-1,f=0,p=0;for(let t=0,n=a.length;t<n;t++){let[n,i]=o[t],m=a[t],h=m.width*s;m.unicode===` `?p+h>r?(c.push(e.substring(f,n)),f=n,p=h,l=-1,d=-1):(p+=h,l=n,u=i,d=t):p+h>r?l===-1?(c.push(e.substring(f,n)),f=n,p=h):(c.push(e.substring(f,u)),f=u,t=d+1,l=-1,p=0):p+=h}return f<e.length&&c.push(e.substring(f,e.length)),c}async extractTextContent(e,t,n){await super.extractTextContent(e,t,n);let r=this.data.textContent;if(!r)return;let i=r.join(`
21
21
  `);if(i===this.data.fieldValue)return;let a=i.replaceAll(/([.*+?^${}()|[\]\\])|(\s+)/g,(e,t)=>t?`\\${t}`:`\\s+`);RegExp(`^\\s*${a}\\s*$`).test(this.data.fieldValue)&&(this.data.textContent=this.data.fieldValue.split(`
22
22
  `))}getFieldObject(){return{id:this.data.id,value:this.data.fieldValue,defaultValue:this.data.defaultFieldValue||``,multiline:this.data.multiLine,password:this.data.password,charLimit:this.data.maxLen,comb:this.data.comb,editable:!this.data.readOnly,hidden:this.data.hidden,name:this.data.fieldName,rect:this.data.rect,actions:this.data.actions,page:this.data.pageIndex,strokeColor:this.data.borderColor,fillColor:this.data.backgroundColor,rotation:this.rotation,datetimeFormat:this.data.datetimeFormat,hasDatetimeHTML:!!this.data.datetimeType,type:`text`}}},Lx=class extends Fx{constructor(e){super(e),this.checkedAppearance=null,this.uncheckedAppearance=null;let t=this.hasFieldFlag(se),n=this.hasFieldFlag(ce);this.data.checkBox=!t&&!n,this.data.radioButton=t&&!n,this.data.pushButton=n,this.data.isTooltipOnly=!1,this.data.checkBox?this._processCheckBox(e):this.data.radioButton?this._processRadioButton(e):this.data.pushButton?(this.data.hasOwnCanvas=!0,this.data.noHTML=!1,this._processPushButton(e)):N(`Invalid field flags for button widget annotation`)}async getOperatorList(e,t,n,r){if(this.data.pushButton)return super.getOperatorList(e,t,n,!1,r);let i=null,a=null;if(r){let e=r.get(this.data.id);i=e?e.value:null,a=e?e.rotation:null}if(i===null&&this.appearance)return super.getOperatorList(e,t,n,r);i??=this.data.checkBox?this.data.fieldValue===this.data.exportValue:this.data.fieldValue===this.data.buttonValue;let o=i?this.checkedAppearance:this.uncheckedAppearance;if(o){let i=this.appearance,s=wr(o.dict.getArray(`Matrix`),ir);a&&o.dict.set(`Matrix`,this.getRotationMatrix(r)),this.appearance=o;let c=super.getOperatorList(e,t,n,r);return this.appearance=i,o.dict.set(`Matrix`,s),c}return{opList:new ra,separateForm:!1,separateCanvas:!1}}async save(e,t,n,r){this.data.checkBox?this._saveCheckbox(e,t,n,r):this.data.radioButton&&this._saveRadioButton(e,t,n,r)}async _saveCheckbox(e,t,n,r){if(!n)return;let i=n.get(this.data.id),a=this._buildFlags(i?.noView,i?.noPrint),o=i?.rotation,s=i?.value;if(o===void 0&&a===void 0&&(s===void 0||this.data.fieldValue===this.data.exportValue===s))return;let c=e.xref.fetchIfRef(this.ref);if(!(c instanceof L))return;c=c.clone(),o===void 0&&(o=this.rotation),s===void 0&&(s=this.data.fieldValue===this.data.exportValue);let l={path:this.data.fieldName,value:s?this.data.exportValue:``},u=I.get(s?this.data.exportValue:`Off`);this.setValue(c,u,e.xref,r),c.set(`AS`,u),c.set(`M`,`D:${Ln()}`),a!==void 0&&c.set(`F`,a);let d=this._getMKDict(o);d&&c.set(`MK`,d),r.put(this.ref,{data:c,xfa:l,needAppearances:!1})}async _saveRadioButton(e,t,n,r){if(!n)return;let i=n.get(this.data.id),a=this._buildFlags(i?.noView,i?.noPrint),o=i?.rotation,s=i?.value;if(o===void 0&&a===void 0&&(s===void 0||this.data.fieldValue===this.data.buttonValue===s))return;let c=e.xref.fetchIfRef(this.ref);if(!(c instanceof L))return;c=c.clone(),s===void 0&&(s=this.data.fieldValue===this.data.buttonValue),o===void 0&&(o=this.rotation);let l={path:this.data.fieldName,value:s?this.data.buttonValue:``},u=I.get(s?this.data.buttonValue:`Off`);s&&this.setValue(c,u,e.xref,r),c.set(`AS`,u),c.set(`M`,`D:${Ln()}`),a!==void 0&&c.set(`F`,a);let d=this._getMKDict(o);d&&c.set(`MK`,d),r.put(this.ref,{data:c,xfa:l,needAppearances:!1})}_getDefaultCheckedAppearance(e,t){let{width:n,height:r}=this,i=[0,0,n,r],a=.8*Math.min(n,r),o,s;t===`check`?(o={width:.755*a,height:.705*a},s=`3`):t===`disc`?(o={width:.791*a,height:.705*a},s=`l`):gn(`_getDefaultCheckedAppearance - unsupported type: ${t}`);let c=`q BT /PdfJsZaDb ${a} Tf 0 g ${Rr((n-o.width)/2)} ${Rr((r-o.height)/2)} Td (${s}) Tj ET Q`,l=new L(e.xref);l.set(`FormType`,1),l.setIfName(`Subtype`,`Form`),l.setIfName(`Type`,`XObject`),l.set(`BBox`,i),l.set(`Matrix`,[1,0,0,1,0,0]),l.set(`Length`,c.length);let u=new L(e.xref),d=new L(e.xref);d.set(`PdfJsZaDb`,this.fallbackFontDict),u.set(`Font`,d),l.set(`Resources`,u),this.checkedAppearance=new _i(c),this.checkedAppearance.dict=l,this._streams.push(this.checkedAppearance)}_processCheckBox(e){let t=e.dict.get(`AP`);if(!(t instanceof L))return;let n=t.get(`N`);if(!(n instanceof L))return;let r=this._decodeFormValue(e.dict.get(`AS`));typeof r==`string`&&(this.data.fieldValue=r);let i=this.data.fieldValue!==null&&this.data.fieldValue!==`Off`?this.data.fieldValue:`Yes`,a=this._decodeFormValue(n.getKeys());if(a.length===0)a.push(`Off`,i);else if(a.length===1)a[0]===`Off`?a.push(i):a.unshift(`Off`);else if(a.includes(i))a.length=0,a.push(`Off`,i);else{let e=a.find(e=>e!==`Off`);a.length=0,a.push(`Off`,e)}a.includes(this.data.fieldValue)||(this.data.fieldValue=`Off`),this.data.exportValue=a[1];let o=n.get(this.data.exportValue);this.checkedAppearance=o instanceof tr?o:null;let s=n.get(`Off`);this.uncheckedAppearance=s instanceof tr?s:null,this.checkedAppearance?this._streams.push(this.checkedAppearance):this._getDefaultCheckedAppearance(e,`check`),this.uncheckedAppearance&&this._streams.push(this.uncheckedAppearance),this._fallbackFontDict=this.fallbackFontDict,this.data.defaultFieldValue===null&&(this.data.defaultFieldValue=`Off`)}_processRadioButton(e){this.data.buttonValue=null;let t=e.dict.get(`Parent`);if(t instanceof L){this.parent=e.dict.getRaw(`Parent`);let n=t.get(`V`);n instanceof I&&(this.data.fieldValue=this._decodeFormValue(n))}let n=e.dict.get(`AP`);if(!(n instanceof L))return;let r=n.get(`N`);if(!(r instanceof L))return;for(let e of r.getKeys())if(e!==`Off`){this.data.buttonValue=this._decodeFormValue(e);break}let i=r.get(this.data.buttonValue);this.checkedAppearance=i instanceof tr?i:null;let a=r.get(`Off`);this.uncheckedAppearance=a instanceof tr?a:null,this.checkedAppearance?this._streams.push(this.checkedAppearance):this._getDefaultCheckedAppearance(e,`disc`),this.uncheckedAppearance&&this._streams.push(this.uncheckedAppearance),this._fallbackFontDict=this.fallbackFontDict,this.data.defaultFieldValue===null&&(this.data.defaultFieldValue=`Off`)}_processPushButton(e){let{dict:t,annotationGlobals:n}=e;t.has(`A`)||t.has(`AA`)||this.data.alternativeText?(this.data.isTooltipOnly=!t.has(`A`)&&!t.has(`AA`),uf.parseDestDictionary({destDict:t,resultObj:this.data,docBaseUrl:n.baseUrl,docAttachments:n.attachments})):N(`Push buttons without action dictionaries are not supported`)}getFieldObject(){let e,t=`button`;return this.data.checkBox?(t=`checkbox`,e=this.data.exportValue):this.data.radioButton&&(t=`radiobutton`,e=this.data.buttonValue),{id:this.data.id,value:this.data.fieldValue||`Off`,defaultValue:this.data.defaultFieldValue,exportValues:e,editable:!this.data.readOnly,name:this.data.fieldName,rect:this.data.rect,hidden:this.data.hidden,actions:this.data.actions,page:this.data.pageIndex,strokeColor:this.data.borderColor,fillColor:this.data.backgroundColor,rotation:this.rotation,type:t}}get fallbackFontDict(){let e=new L;return e.setIfName(`BaseFont`,`ZapfDingbats`),e.setIfName(`Type`,`FallbackType`),e.setIfName(`Subtype`,`FallbackType`),e.setIfName(`Encoding`,`ZapfDingbatsEncoding`),P(this,`fallbackFontDict`,e)}},Rx=class extends Fx{constructor(e){super(e);let{dict:t,xref:n}=e;this.indices=t.getArray(`I`),this.hasIndices=Array.isArray(this.indices)&&this.indices.length>0,this.data.options=[];let r=mr({dict:t,key:`Opt`});if(Array.isArray(r))for(let e=0,t=r.length;e<t;e++){let t=n.fetchIfRef(r[e]),i=Array.isArray(t);this.data.options[e]={exportValue:this._decodeFormValue(i?n.fetchIfRef(t[0]):t),displayValue:this._decodeFormValue(i?n.fetchIfRef(t[1]):t)}}if(this.hasIndices){this.data.fieldValue=[];let e=this.data.options.length;for(let t of this.indices)Number.isInteger(t)&&t>=0&&t<e&&this.data.fieldValue.push(this.data.options[t].exportValue)}else typeof this.data.fieldValue==`string`?this.data.fieldValue=[this.data.fieldValue]:this.data.fieldValue||=[];this.data.options.length===0&&this.data.fieldValue.length>0&&(this.data.options=this.data.fieldValue.map(e=>({exportValue:e,displayValue:e}))),this.data.combo=this.hasFieldFlag(le),this.data.multiSelect=this.hasFieldFlag(de),this._hasText=!0}getFieldObject(){let e=this.data.combo?`combobox`:`listbox`,t=this.data.fieldValue.length>0?this.data.fieldValue[0]:null;return{id:this.data.id,value:t,defaultValue:this.data.defaultFieldValue,editable:!this.data.readOnly,name:this.data.fieldName,rect:this.data.rect,numItems:this.data.fieldValue.length,multipleSelection:this.data.multiSelect,hidden:this.data.hidden,actions:this.data.actions,items:this.data.options,page:this.data.pageIndex,strokeColor:this.data.borderColor,fillColor:this.data.backgroundColor,rotation:this.rotation,type:e}}amendSavedDict(e,t){if(!this.hasIndices)return;let n=e?.get(this.data.id)?.value;Array.isArray(n)||(n=[n]);let r=[],{options:i}=this.data;for(let e=0,t=0,a=i.length;e<a;e++)i[e].exportValue===n[t]&&(r.push(e),t+=1);t.set(`I`,r)}async _getAppearance(e,t,n,i){if(this.data.combo)return super._getAppearance(e,t,n,i);let a,o,s=i?.get(this.data.id);if(s&&(o=s.rotation,a=s.value),o===void 0&&a===void 0&&!this._needAppearances)return null;a===void 0?a=this.data.fieldValue:Array.isArray(a)||(a=[a]);let{width:c,height:l}=this;o!==90&&o!==270||([c,l]=[l,c]);let u=this.data.options.length,d=[];for(let e=0;e<u;e++){let{exportValue:t}=this.data.options[e];a.includes(t)&&d.push(e)}this._defaultAppearance||(this.data.defaultAppearanceData=Dd(this._defaultAppearance=`/Helvetica 0 Tf 0 g`));let f=await Fx._getFontData(e,t,this.data.defaultAppearanceData,this._fieldResources.mergedResources),p,{fontSize:m}=this.data.defaultAppearanceData;if(m)p=this._defaultAppearance;else{let e=(l-1)/u,t,n=-1;for(let{displayValue:e}of this.data.options){let r=this._getTextWidth(e,f);r>n&&(n=r,t=e)}[p,m]=this._computeFontSize(e,c-4,t,f,-1)}let h=m*r,g=(h-m)/2,_=Math.floor(l/h),v=0;if(d.length>0){let e=Math.min(...d),t=Math.max(...d);v=Math.max(0,t-_+1),v>e&&(v=e)}let y=Math.min(v+_+1,u),b=[`/Tx BMC q`,`1 1 ${c} ${l} re W n`];if(d.length){b.push(`0.600006 0.756866 0.854904 rg`);for(let e of d)v<=e&&e<y&&b.push(`1 ${l-(e-v+1)*h} ${c} ${h} re f`)}b.push(`BT`,p,`1 0 0 1 0 ${l} Tm`);let x={shift:0};for(let e=v;e<y;e++){let{displayValue:t}=this.data.options[e],n=e===v?g:0;b.push(this._renderText(t,f,m,c,0,x,2,-h+n))}return b.push(`ET Q EMC`),b.join(`
23
- `)}},zx=class extends Fx{constructor(e){super(e),this.data.fieldValue=null,this.data.hasOwnCanvas=this.data.noRotate,this.data.noHTML=!this.data.hasOwnCanvas}getFieldObject(){return{id:this.data.id,value:null,page:this.data.pageIndex,type:`signature`}}},Bx=class extends Px{constructor(e){super(e),this.data.noRotate=!0,this.data.hasOwnCanvas=this.data.noRotate,this.data.noHTML=!1;let{dict:t}=e;this.data.annotationType=E.TEXT,this.data.hasAppearance?this.data.name=`NoIcon`:(this.data.rect[1]=this.data.rect[3]-22,this.data.rect[2]=this.data.rect[0]+22,this.data.name=t.has(`Name`)?t.get(`Name`).name:`Note`),t.has(`State`)?(this.data.state=t.get(`State`)||null,this.data.stateModel=t.get(`StateModel`)||null):(this.data.state=null,this.data.stateModel=null)}},Vx=class extends Mx{constructor(e){super(e);let{dict:t,annotationGlobals:n}=e;this.data.annotationType=E.LINK,this.data.noHTML=!1;let r=Ax(t,this.rectangle);r&&(this.data.quadPoints=r),this.data.borderColor||=this.data.color,uf.parseDestDictionary({destDict:t,resultObj:this.data,docBaseUrl:n.baseUrl,docAttachments:n.attachments})}get overlaysTextContent(){return!0}},Hx=class extends Mx{constructor(e){super(e);let{dict:t}=e;this.data.annotationType=E.POPUP,this.data.noHTML=!1,this.width!==0&&this.height!==0||(this.data.rect=null);let n=t.get(`Parent`);if(!n)return void N(`Popup annotation has a missing or invalid parent annotation.`);if(this.data.parentRect=Er(n.getArray(`Rect`),null),this.data.creationDate=n.get(`CreationDate`)||``,Zn(n.get(`RT`),D)&&(n=n.get(`IRT`)),n.has(`M`)?(this.setModificationDate(n.get(`M`)),this.data.modificationDate=this.modificationDate):this.data.modificationDate=null,n.has(`C`)?(this.setColor(n.getArray(`C`)),this.data.color=this.color):this.data.color=null,!this.viewable){let e=n.get(`F`);this._isViewable(e)&&this.setFlags(e)}this.setTitle(n.get(`T`)),this.data.titleObj=this._title,this.setContents(n.get(`Contents`)),this.data.contentsObj=this._contents,n.has(`RC`)&&(this.data.richText=Ex.getRichTextAsHtml(n.get(`RC`))),this.data.open=!!t.get(`Open`)}static createNewDict(e,t,n){let{oldAnnotation:r,rect:i,parent:a}=e,o=r||new L(t);return o.setIfNotExists(`Type`,I.get(`Annot`)),o.setIfNotExists(`Subtype`,I.get(`Popup`)),o.setIfNotExists(`Open`,!1),o.setIfArray(`Rect`,i),o.set(`Parent`,a),o}static async createNewAppearanceStream(e,t,n){return null}},Ux=class extends Px{constructor(e){super(e),this.data.hasOwnCanvas=this.data.noRotate,this.data.isEditable=!this.data.noHTML,this.data.noHTML=!1;let{annotationGlobals:t,evaluatorOptions:n,xref:r}=e;if(this.data.annotationType=E.FREETEXT,this.setDefaultAppearance(e),this._hasAppearance=!!this.appearance,this._hasAppearance){let{fontColor:e,fontSize:i}=function(e,t,n,r){return new Od(e,t,n,r).parse()}(this.appearance,n,r,t.globalColorSpaceCache);this.data.defaultAppearanceData.fontColor=e,this.data.defaultAppearanceData.fontSize=i||10}else{this.data.defaultAppearanceData.fontSize||=10;let{fontColor:t,fontSize:n}=this.data.defaultAppearanceData;if(this._contents.str){this.data.textContent=this._contents.str.split(/\r\n?|\n/).map(e=>e.trimEnd());let{coords:e,bbox:t,matrix:r}=Ad.getFirstPositionInfo(this.rectangle,this.rotation,n);this.data.textPosition=this._transformPoint(e,t,r)}if(this._isOffscreenCanvasSupported){let i=e.dict.get(`CA`);this.appearance=new Ad(r,`sans-serif`).createAppearance(this._contents.str,this.rectangle,this.rotation,n,t,i),this._streams.push(this.appearance)}else N(`FreeTextAnnotation: OffscreenCanvas is not supported, annotation may not render correctly.`)}}get hasTextContent(){return this._hasAppearance}static createNewDict(e,t,{apRef:n,ap:r}){let{color:i,date:a,fontSize:o,oldAnnotation:s,rect:c,rotation:l,user:u,value:d}=e,f=s||new L(t);f.setIfNotExists(`Type`,I.get(`Annot`)),f.setIfNotExists(`Subtype`,I.get(`FreeText`)),f.set(s?`M`:`CreationDate`,`D:${Ln(a)}`),s&&f.delete(`RC`),f.setIfArray(`Rect`,c);let p=`/Helv ${o} Tf ${kd(i,!0)}`;if(f.set(`DA`,p),f.setIfDefined(`Contents`,Br(d)),f.setIfNotExists(`F`,4),f.setIfNotExists(`Border`,[0,0,0]),f.setIfNumber(`Rotate`,l),f.setIfDefined(`T`,Br(u)),n||r){let e=new L(t);f.set(`AP`,e),e.set(`N`,n||r)}return f}static async createNewAppearanceStream(e,t,n){let{baseFontRef:i,evaluator:a,task:o}=n,{color:s,fontSize:c,rect:l,rotation:u,value:d}=e;if(!s)return null;let f=new L(t),p=new L(t);if(i)p.set(`Helv`,i);else{let e=new L(t);e.setIfName(`BaseFont`,`Helvetica`),e.setIfName(`Type`,`Font`),e.setIfName(`Subtype`,`Type1`),e.setIfName(`Encoding`,`WinAnsiEncoding`),p.set(`Helv`,e)}f.set(`Font`,p);let m=await Fx._getFontData(a,o,{fontName:`Helv`,fontSize:c},f),[h,g,_,v]=l,y=_-h,b=v-g;u%180!=0&&([y,b]=[b,y]);let x=d.split(`
23
+ `)}},zx=class extends Fx{constructor(e){super(e),this.data.fieldValue=null,this.data.hasOwnCanvas=this.data.noRotate,this.data.noHTML=!this.data.hasOwnCanvas}getFieldObject(){return{id:this.data.id,value:null,page:this.data.pageIndex,type:`signature`}}},Bx=class extends Px{constructor(e){super(e),this.data.noRotate=!0,this.data.hasOwnCanvas=this.data.noRotate,this.data.noHTML=!1;let{dict:t}=e;this.data.annotationType=E.TEXT,this.data.hasAppearance?this.data.name=`NoIcon`:(this.data.rect[1]=this.data.rect[3]-22,this.data.rect[2]=this.data.rect[0]+22,this.data.name=t.has(`Name`)?t.get(`Name`).name:`Note`),t.has(`State`)?(this.data.state=t.get(`State`)||null,this.data.stateModel=t.get(`StateModel`)||null):(this.data.state=null,this.data.stateModel=null)}},Vx=class extends Mx{constructor(e){super(e);let{dict:t,annotationGlobals:n}=e;this.data.annotationType=E.LINK,this.data.noHTML=!1;let r=Ax(t,this.rectangle);r&&(this.data.quadPoints=r),this.data.borderColor||=this.data.color,uf.parseDestDictionary({destDict:t,resultObj:this.data,docBaseUrl:n.baseUrl,docAttachments:n.attachments})}get overlaysTextContent(){return!0}},Hx=class extends Mx{constructor(e){super(e);let{dict:t}=e;this.data.annotationType=E.POPUP,this.data.noHTML=!1,this.width!==0&&this.height!==0||(this.data.rect=null);let n=t.get(`Parent`);if(!n)return void N(`Popup annotation has a missing or invalid parent annotation.`);if(this.data.parentRect=Er(n.getArray(`Rect`),null),this.data.creationDate=n.get(`CreationDate`)||``,Zn(n.get(`RT`),D)&&(n=n.get(`IRT`)),n.has(`M`)?(this.setModificationDate(n.get(`M`)),this.data.modificationDate=this.modificationDate):this.data.modificationDate=null,n.has(`C`)?(this.setColor(n.getArray(`C`)),this.data.color=this.color):this.data.color=null,!this.viewable){let e=n.get(`F`);this._isViewable(e)&&this.setFlags(e)}this.setTitle(n.get(`T`)),this.data.titleObj=this._title,this.setContents(n.get(`Contents`)),this.data.contentsObj=this._contents,n.has(`RC`)&&(this.data.richText=Ex.getRichTextAsHtml(n.get(`RC`))),this.data.open=!!t.get(`Open`)}static createNewDict(e,t,n){let{oldAnnotation:r,rect:i,parent:a}=e,o=r||new L(t);return o.setIfNotExists(`Type`,I.get(`Annot`)),o.setIfNotExists(`Subtype`,I.get(`Popup`)),o.setIfNotExists(`Open`,!1),o.setIfArray(`Rect`,i),o.set(`Parent`,a),o}static async createNewAppearanceStream(e,t,n){return null}},Ux=class extends Px{constructor(e){super(e),this.data.hasOwnCanvas=this.data.noRotate,this.data.isEditable=!this.data.noHTML,this.data.noHTML=!1;let{annotationGlobals:t,evaluatorOptions:n,xref:r}=e;if(this.data.annotationType=E.FREETEXT,this.setDefaultAppearance(e),this._hasAppearance=!!this.appearance,this._hasAppearance){let{fontColor:e,fontSize:i}=function(e,t,n,r){return new Od(e,t,n,r).parse()}(this.appearance,n,r,t.globalColorSpaceCache);this.data.defaultAppearanceData.fontColor=e,this.data.defaultAppearanceData.fontSize=i||10}else{this.data.defaultAppearanceData.fontSize||=10;let{fontColor:t,fontSize:n}=this.data.defaultAppearanceData;if(this._contents.str){this.data.textContent=this._contents.str.split(/\r\n?|\n/).map(e=>e.trimEnd());let{coords:e,bbox:t,matrix:r}=Ad.getFirstPositionInfo(this.rectangle,this.rotation,n);this.data.textPosition=this._transformPoint(e,t,r)}if(this._isOffscreenCanvasSupported){let i=e.dict.get(`CA`),a=new Ad(r,`sans-serif`);this.appearance=a.createAppearance(this._contents.str,this.rectangle,this.rotation,n,t,i),this._streams.push(this.appearance)}else N(`FreeTextAnnotation: OffscreenCanvas is not supported, annotation may not render correctly.`)}}get hasTextContent(){return this._hasAppearance}static createNewDict(e,t,{apRef:n,ap:r}){let{color:i,date:a,fontSize:o,oldAnnotation:s,rect:c,rotation:l,user:u,value:d}=e,f=s||new L(t);f.setIfNotExists(`Type`,I.get(`Annot`)),f.setIfNotExists(`Subtype`,I.get(`FreeText`)),f.set(s?`M`:`CreationDate`,`D:${Ln(a)}`),s&&f.delete(`RC`),f.setIfArray(`Rect`,c);let p=`/Helv ${o} Tf ${kd(i,!0)}`;if(f.set(`DA`,p),f.setIfDefined(`Contents`,Br(d)),f.setIfNotExists(`F`,4),f.setIfNotExists(`Border`,[0,0,0]),f.setIfNumber(`Rotate`,l),f.setIfDefined(`T`,Br(u)),n||r){let e=new L(t);f.set(`AP`,e),e.set(`N`,n||r)}return f}static async createNewAppearanceStream(e,t,n){let{baseFontRef:i,evaluator:a,task:o}=n,{color:s,fontSize:c,rect:l,rotation:u,value:d}=e;if(!s)return null;let f=new L(t),p=new L(t);if(i)p.set(`Helv`,i);else{let e=new L(t);e.setIfName(`BaseFont`,`Helvetica`),e.setIfName(`Type`,`Font`),e.setIfName(`Subtype`,`Type1`),e.setIfName(`Encoding`,`WinAnsiEncoding`),p.set(`Helv`,e)}f.set(`Font`,p);let m=await Fx._getFontData(a,o,{fontName:`Helv`,fontSize:c},f),[h,g,_,v]=l,y=_-h,b=v-g;u%180!=0&&([y,b]=[b,y]);let x=d.split(`
24
24
  `),S=c/1e3,C=-1/0,w=[];for(let e of x){let t=m.encodeString(e);if(t.length>1)return null;e=t.join(``),w.push(e);let n=0,r=m.charsToGlyphs(e);for(let e of r)n+=e.width*S;C=Math.max(C,n)}let T=1;C>y&&(T=y/C);let E=1,D=r*c,O=1*c,k=D*x.length;k>b&&(E=b/k);let ee=c*Math.min(T,E),A,j,M;switch(u){case 0:M=[1,0,0,1],j=[l[0],l[1],y,b],A=[l[0],l[3]-O];break;case 90:M=[0,1,-1,0],j=[l[1],-l[2],y,b],A=[l[1],-l[0]-O];break;case 180:M=[-1,0,0,-1],j=[-l[2],-l[3],y,b],A=[-l[2],-l[1]-O];break;case 270:M=[0,-1,1,0],j=[-l[3],l[0],y,b],A=[-l[3],l[2]-O]}let te=[`q`,`${M.join(` `)} 0 0 cm`,`${j.join(` `)} re W n`,`BT`,`${kd(s,!0)}`,`0 Tc /Helv ${Rr(ee)} Tf`];te.push(`${A.join(` `)} Td (${kr(w[0])}) Tj`);let ne=Rr(D);for(let e=1,t=w.length;e<t;e++){let t=w[e];te.push(`0 -${ne} Td (${kr(t)}) Tj`)}te.push(`ET`,`Q`);let re=te.join(`
25
25
  `),ie=new L(t);ie.set(`FormType`,1),ie.setIfName(`Subtype`,`Form`),ie.setIfName(`Type`,`XObject`),ie.set(`BBox`,l),ie.set(`Resources`,f),ie.set(`Matrix`,[1,0,0,1,-l[0],-l[1]]);let ae=new _i(re);return ae.dict=ie,ae}},Wx=class extends Px{constructor(e){super(e);let{dict:t,xref:n}=e;this.data.annotationType=E.LINE,this.data.hasOwnCanvas=this.data.noRotate,this.data.noHTML=!1;let r=Tr(t.getArray(`L`),[0,0,0,0]);if(this.data.lineCoordinates=jn.normalizeRect(r),this.setLineEndings(t.getArray(`LE`)),this.data.lineEndings=this.lineEndings,!this.appearance){let e=kx(this.color,[0,0,0]),i=t.get(`CA`),a=kx(Ox(t.getArray(`IC`),null)),o=a?i:null,s=this.borderStyle.width||1,c=2*s,l=[this.data.lineCoordinates[0]-c,this.data.lineCoordinates[1]-c,this.data.lineCoordinates[2]+c,this.data.lineCoordinates[3]+c];jn.intersect(this.rectangle,l)||(this.rectangle=l),this._setDefaultAppearance({xref:n,extra:`${s} w`,strokeColor:e,fillColor:a,strokeAlpha:i,fillAlpha:o,pointsCallback:(e,t)=>(e.push(`${r[0]} ${r[1]} m`,`${r[2]} ${r[3]} l`,`S`),[t[0]-s,t[7]-s,t[2]+s,t[3]+s])})}}},Gx=class extends Px{constructor(e){super(e);let{dict:t,xref:n}=e;if(this.data.annotationType=E.SQUARE,this.data.hasOwnCanvas=this.data.noRotate,this.data.noHTML=!1,!this.appearance){let e=kx(this.color,[0,0,0]),r=t.get(`CA`),i=kx(Ox(t.getArray(`IC`),null)),a=i?r:null;if(this.borderStyle.width===0&&!i)return;this._setDefaultAppearance({xref:n,extra:`${this.borderStyle.width} w`,strokeColor:e,fillColor:i,strokeAlpha:r,fillAlpha:a,pointsCallback:(e,t)=>{let n=t[4]+this.borderStyle.width/2,r=t[5]+this.borderStyle.width/2,a=t[6]-t[4]-this.borderStyle.width,o=t[3]-t[7]-this.borderStyle.width;return e.push(`${n} ${r} ${a} ${o} re`),i?e.push(`B`):e.push(`S`),[t[0],t[7],t[2],t[3]]}})}}},Kx=class extends Px{constructor(e){super(e);let{dict:t,xref:n}=e;if(this.data.annotationType=E.CIRCLE,!this.appearance){let e=kx(this.color,[0,0,0]),r=t.get(`CA`),i=kx(Ox(t.getArray(`IC`),null)),a=i?r:null;if(this.borderStyle.width===0&&!i)return;let o=4/3*Math.tan(Math.PI/8);this._setDefaultAppearance({xref:n,extra:`${this.borderStyle.width} w`,strokeColor:e,fillColor:i,strokeAlpha:r,fillAlpha:a,pointsCallback:(e,t)=>{let n=t[0]+this.borderStyle.width/2,r=t[1]-this.borderStyle.width/2,a=t[6]-this.borderStyle.width/2,s=t[7]+this.borderStyle.width/2,c=n+(a-n)/2,l=r+(s-r)/2,u=(a-n)/2*o,d=(s-r)/2*o;return e.push(`${c} ${s} m`,`${c+u} ${s} ${a} ${l+d} ${a} ${l} c`,`${a} ${l-d} ${c+u} ${r} ${c} ${r} c`,`${c-u} ${r} ${n} ${l-d} ${n} ${l} c`,`${n} ${l+d} ${c-u} ${s} ${c} ${s} c`,`h`),i?e.push(`B`):e.push(`S`),[t[0],t[7],t[2],t[3]]}})}}},qx=class extends Px{constructor(e){super(e);let{dict:t,xref:n}=e;this.data.annotationType=E.POLYLINE,this.data.hasOwnCanvas=this.data.noRotate,this.data.noHTML=!1,this.data.vertices=null,this instanceof Jx||(this.setLineEndings(t.getArray(`LE`)),this.data.lineEndings=this.lineEndings);let r=t.getArray(`Vertices`);if(!Cr(r,null))return;let i=this.data.vertices=Float32Array.from(r);if(!this.appearance){let e=kx(this.color,[0,0,0]),r=t.get(`CA`),a,o=Ox(t.getArray(`IC`),null);o&&=kx(o),a=o?this.color?o.every((t,n)=>t===e[n])?`f`:`B`:`f`:`S`;let s=this.borderStyle.width||1,c=2*s,l=[1/0,1/0,-1/0,-1/0];for(let e=0,t=i.length;e<t;e+=2)jn.rectBoundingBox(i[e]-c,i[e+1]-c,i[e]+c,i[e+1]+c,l);jn.intersect(this.rectangle,l)||(this.rectangle=l),this._setDefaultAppearance({xref:n,extra:`${s} w`,strokeColor:e,strokeAlpha:r,fillColor:o,fillAlpha:o?r:null,pointsCallback:(e,t)=>{for(let t=0,n=i.length;t<n;t+=2)e.push(`${i[t]} ${i[t+1]} ${t===0?`m`:`l`}`);return e.push(a),[t[0],t[7],t[2],t[3]]}})}}},Jx=class extends qx{constructor(e){super(e),this.data.annotationType=E.POLYGON}},Yx=class extends Px{constructor(e){super(e),this.data.annotationType=E.CARET}},Xx=class extends Px{constructor(e){super(e),this.data.hasOwnCanvas=this.data.noRotate,this.data.noHTML=!1;let{dict:t,xref:n}=e;this.data.annotationType=E.INK,this.data.inkLists=[],this.data.isEditable=!this.data.noHTML,this.data.noHTML=!1,this.data.opacity=t.get(`CA`)||1;let r=t.getArray(`InkList`);if(Array.isArray(r)){for(let e=0,t=r.length;e<t;++e){if(!Array.isArray(r[e]))continue;let t=new Float32Array(r[e].length);this.data.inkLists.push(t);for(let i=0,a=r[e].length;i<a;i+=2){let a=n.fetchIfRef(r[e][i]),o=n.fetchIfRef(r[e][i+1]);typeof a==`number`&&typeof o==`number`&&(t[i]=a,t[i+1]=o)}}if(!this.appearance){let e=kx(this.color,[0,0,0]),r=t.get(`CA`),i=this.borderStyle.width||1,a=2*i,o=[1/0,1/0,-1/0,-1/0];for(let e of this.data.inkLists)for(let t=0,n=e.length;t<n;t+=2)jn.rectBoundingBox(e[t]-a,e[t+1]-a,e[t]+a,e[t+1]+a,o);jn.intersect(this.rectangle,o)||(this.rectangle=o),this._setDefaultAppearance({xref:n,extra:`${i} w`,strokeColor:e,strokeAlpha:r,pointsCallback:(e,t)=>{for(let t of this.data.inkLists){for(let n=0,r=t.length;n<r;n+=2)e.push(`${t[n]} ${t[n+1]} ${n===0?`m`:`l`}`);e.push(`S`)}return[t[0],t[7],t[2],t[3]]}})}}}static createNewDict(e,t,{apRef:n,ap:r}){let{oldAnnotation:i,color:a,date:o,opacity:s,paths:c,outlines:l,rect:u,rotation:d,thickness:f,user:p}=e,m=i||new L(t);if(m.setIfNotExists(`Type`,I.get(`Annot`)),m.setIfNotExists(`Subtype`,I.get(`Ink`)),m.set(i?`M`:`CreationDate`,`D:${Ln(o)}`),m.setIfArray(`Rect`,u),m.setIfArray(`InkList`,l?.points||c?.points),m.setIfNotExists(`F`,4),m.setIfNumber(`Rotate`,d),m.setIfDefined(`T`,Br(p)),l&&m.setIfName(`IT`,`InkHighlight`),f>0){let e=new L(t);m.set(`BS`,e),e.set(`W`,f)}if(m.setIfArray(`C`,kx(a)),m.setIfNumber(`CA`,s),r||n){let e=new L(t);m.set(`AP`,e),e.set(`N`,n||r)}return m}static async createNewAppearanceStream(e,t,n){if(e.outlines)return this.createNewAppearanceStreamForHighlight(e,t,n);let{color:r,rect:i,paths:a,thickness:o,opacity:s}=e;if(!r)return null;let c=[`${o} w 1 J 1 j`,`${kd(r,!1)}`];s!==1&&c.push(`/R0 gs`);for(let e of a.lines){c.push(`${Rr(e[4])} ${Rr(e[5])} m`);for(let t=6,n=e.length;t<n;t+=6)if(isNaN(e[t]))c.push(`${Rr(e[t+4])} ${Rr(e[t+5])} l`);else{let[n,r,i,a,o,s]=e.slice(t,t+6);c.push([n,r,i,a,o,s].map(Rr).join(` `)+` c`)}e.length===6&&c.push(`${Rr(e[4])} ${Rr(e[5])} l`)}c.push(`S`);let l=c.join(`
26
26
  `),u=new L(t);if(u.set(`FormType`,1),u.setIfName(`Subtype`,`Form`),u.setIfName(`Type`,`XObject`),u.set(`BBox`,i),u.set(`Length`,l.length),s!==1){let e=new L(t),n=new L(t),r=new L(t);r.set(`CA`,s),r.setIfName(`Type`,`ExtGState`),n.set(`R0`,r),e.set(`ExtGState`,n),u.set(`Resources`,e)}let d=new _i(l);return d.dict=u,d}static async createNewAppearanceStreamForHighlight(e,t,n){let{color:r,rect:i,outlines:{outline:a},opacity:o}=e;if(!r)return null;let s=[`${kd(r,!0)}`,`/R0 gs`];s.push(`${Rr(a[4])} ${Rr(a[5])} m`);for(let e=6,t=a.length;e<t;e+=6)if(isNaN(a[e]))s.push(`${Rr(a[e+4])} ${Rr(a[e+5])} l`);else{let[t,n,r,i,o,c]=a.slice(e,e+6);s.push([t,n,r,i,o,c].map(Rr).join(` `)+` c`)}s.push(`h f`);let c=s.join(`
27
27
  `),l=new L(t);l.set(`FormType`,1),l.setIfName(`Subtype`,`Form`),l.setIfName(`Type`,`XObject`),l.set(`BBox`,i),l.set(`Length`,c.length);let u=new L(t),d=new L(t);u.set(`ExtGState`,d),l.set(`Resources`,u);let f=new L(t);d.set(`R0`,f),f.setIfName(`BM`,`Multiply`),o!==1&&(f.set(`ca`,o),f.setIfName(`Type`,`ExtGState`));let p=new _i(c);return p.dict=l,p}},Zx=class extends Px{constructor(e){super(e);let{dict:t,xref:n}=e;if(this.data.annotationType=E.HIGHLIGHT,this.data.isEditable=!this.data.noHTML,this.data.noHTML=!1,this.data.opacity=t.get(`CA`)||1,this.data.quadPoints=Ax(t,null)){let e=this.appearance?.dict.get(`Resources`);if(!this.appearance||!e?.has(`ExtGState`)){this.appearance&&N(`HighlightAnnotation - ignoring built-in appearance stream.`);let e=kx(this.color,[1,1,0]),r=t.get(`CA`);this._setDefaultAppearance({xref:n,fillColor:e,blendMode:`Multiply`,fillAlpha:r,pointsCallback:(e,t)=>(e.push(`${t[0]} ${t[1]} m`,`${t[2]} ${t[3]} l`,`${t[6]} ${t[7]} l`,`${t[4]} ${t[5]} l`,`f`),[t[0],t[7],t[2],t[3]])})}}else this.data.popupRef=null}get overlaysTextContent(){return!0}static createNewDict(e,t,{apRef:n,ap:r}){let{color:i,date:a,oldAnnotation:o,opacity:s,rect:c,rotation:l,user:u,quadPoints:d}=e,f=o||new L(t);if(f.setIfNotExists(`Type`,I.get(`Annot`)),f.setIfNotExists(`Subtype`,I.get(`Highlight`)),f.set(o?`M`:`CreationDate`,`D:${Ln(a)}`),f.setIfArray(`Rect`,c),f.setIfNotExists(`F`,4),f.setIfNotExists(`Border`,[0,0,0]),f.setIfNumber(`Rotate`,l),f.setIfArray(`QuadPoints`,d),f.setIfArray(`C`,kx(i)),f.setIfNumber(`CA`,s),f.setIfDefined(`T`,Br(u)),n||r){let e=new L(t);f.set(`AP`,e),e.set(`N`,n||r)}return f}static async createNewAppearanceStream(e,t,n){let{color:r,rect:i,outlines:a,opacity:o}=e;if(!r)return null;let s=[`${kd(r,!0)}`,`/R0 gs`],c=[];for(let e of a){c.length=0,c.push(`${Rr(e[0])} ${Rr(e[1])} m`);for(let t=2,n=e.length;t<n;t+=2)c.push(`${Rr(e[t])} ${Rr(e[t+1])} l`);c.push(`h`),s.push(c.join(`
28
28
  `))}s.push(`f*`);let l=s.join(`
29
29
  `),u=new L(t);u.set(`FormType`,1),u.setIfName(`Subtype`,`Form`),u.setIfName(`Type`,`XObject`),u.set(`BBox`,i),u.set(`Length`,l.length);let d=new L(t),f=new L(t);d.set(`ExtGState`,f),u.set(`Resources`,d);let p=new L(t);f.set(`R0`,p),p.setIfName(`BM`,`Multiply`),o!==1&&(p.set(`ca`,o),p.setIfName(`Type`,`ExtGState`));let m=new _i(l);return m.dict=u,m}},Qx=class extends Px{constructor(e){super(e);let{dict:t,xref:n}=e;if(this.data.annotationType=E.UNDERLINE,this.data.quadPoints=Ax(t,null)){if(!this.appearance){let e=kx(this.color,[0,0,0]),r=t.get(`CA`);this._setDefaultAppearance({xref:n,extra:`[] 0 d 0.571 w`,strokeColor:e,strokeAlpha:r,pointsCallback:(e,t)=>(e.push(`${t[4]} ${t[5]+1.3} m`,`${t[6]} ${t[7]+1.3} l`,`S`),[t[0],t[7],t[2],t[3]])})}}else this.data.popupRef=null}get overlaysTextContent(){return!0}},$x=class extends Px{constructor(e){super(e);let{dict:t,xref:n}=e;if(this.data.annotationType=E.SQUIGGLY,this.data.quadPoints=Ax(t,null)){if(!this.appearance){let e=kx(this.color,[0,0,0]),r=t.get(`CA`);this._setDefaultAppearance({xref:n,extra:`[] 0 d 1 w`,strokeColor:e,strokeAlpha:r,pointsCallback:(e,t)=>{let n=(t[1]-t[5])/6,r=n,i=t[4],a=t[5],o=t[6];e.push(`${i} ${a+r} m`);do i+=2,r=r===0?n:0,e.push(`${i} ${a+r} l`);while(i<o);return e.push(`S`),[t[4],a-2*n,o,a+2*n]}})}}else this.data.popupRef=null}get overlaysTextContent(){return!0}},eS=class extends Px{constructor(e){super(e);let{dict:t,xref:n}=e;if(this.data.annotationType=E.STRIKEOUT,this.data.quadPoints=Ax(t,null)){if(!this.appearance){let e=kx(this.color,[0,0,0]),r=t.get(`CA`);this._setDefaultAppearance({xref:n,extra:`[] 0 d 1 w`,strokeColor:e,strokeAlpha:r,pointsCallback:(e,t)=>(e.push((t[0]+t[4])/2+` `+(t[1]+t[5])/2+` m`,(t[2]+t[6])/2+` `+(t[3]+t[7])/2+` l`,`S`),[t[0],t[7],t[2],t[3]])})}}else this.data.popupRef=null}get overlaysTextContent(){return!0}},tS=class extends Px{#e=null;constructor(e){super(e),this.data.annotationType=E.STAMP,this.data.hasOwnCanvas=this.data.noRotate,this.data.isEditable=!this.data.noHTML,this.data.noHTML=!1}mustBeViewedWhenEditing(e,t=null){return e?!this.data.isEditable||(this.#e??=this.data.hasOwnCanvas,this.data.hasOwnCanvas=!0,!0):(this.#e!==null&&(this.data.hasOwnCanvas=this.#e,this.#e=null),!t?.has(this.data.id))}static async createImage(e,t){let{width:n,height:r}=e,i=new OffscreenCanvas(n,r),a=i.getContext(`2d`,{alpha:!0});a.drawImage(e,0,0);let o=a.getImageData(0,0,n,r).data,s=new Uint32Array(o.buffer),c=s.some(kn.isLittleEndian?e=>e>>>24!=255:e=>!!(255&~e));c&&(a.fillStyle=`white`,a.fillRect(0,0,n,r),a.drawImage(e,0,0));let l=i.convertToBlob({type:`image/jpeg`,quality:1}).then(e=>e.arrayBuffer()),u=I.get(`XObject`),d=I.get(`Image`),f=new L(t);f.set(`Type`,u),f.set(`Subtype`,d),f.set(`BitsPerComponent`,8),f.setIfName(`ColorSpace`,`DeviceRGB`),f.setIfName(`Filter`,`DCTDecode`),f.set(`BBox`,[0,0,n,r]),f.set(`Width`,n),f.set(`Height`,r);let p=null;if(c){let e=new Uint8Array(s.length);if(kn.isLittleEndian)for(let t=0,n=s.length;t<n;t++)e[t]=s[t]>>>24;else for(let t=0,n=s.length;t<n;t++)e[t]=255&s[t];let i=new L(t);i.set(`Type`,u),i.set(`Subtype`,d),i.set(`BitsPerComponent`,8),i.setIfName(`ColorSpace`,`DeviceGray`),i.set(`Width`,n),i.set(`Height`,r),p=new gi(e,0,0,i)}return{imageStream:new gi(await l,0,0,f),smaskStream:p,width:n,height:r}}static createNewDict(e,t,{apRef:n,ap:r}){let{date:i,oldAnnotation:a,rect:o,rotation:s,user:c}=e,l=a||new L(t);if(l.setIfNotExists(`Type`,I.get(`Annot`)),l.setIfNotExists(`Subtype`,I.get(`Stamp`)),l.set(a?`M`:`CreationDate`,`D:${Ln(i)}`),l.setIfArray(`Rect`,o),l.setIfNotExists(`F`,4),l.setIfNotExists(`Border`,[0,0,0]),l.setIfNumber(`Rotate`,s),l.setIfDefined(`T`,Br(c)),n||r){let e=new L(t);l.set(`AP`,e),e.set(`N`,n||r)}return l}static async#t(e,t){let{areContours:n,color:r,rect:i,lines:a,thickness:o}=e;if(!r)return null;let s=[`${o} w 1 J 1 j`,`${kd(r,n)}`];for(let e of a){s.push(`${Rr(e[4])} ${Rr(e[5])} m`);for(let t=6,n=e.length;t<n;t+=6)if(isNaN(e[t]))s.push(`${Rr(e[t+4])} ${Rr(e[t+5])} l`);else{let[n,r,i,a,o,c]=e.slice(t,t+6);s.push([n,r,i,a,o,c].map(Rr).join(` `)+` c`)}e.length===6&&s.push(`${Rr(e[4])} ${Rr(e[5])} l`)}s.push(n?`F`:`S`);let c=s.join(`
30
- `),l=new L(t);l.set(`FormType`,1),l.setIfName(`Subtype`,`Form`),l.setIfName(`Type`,`XObject`),l.set(`BBox`,i),l.set(`Length`,c.length);let u=new _i(c);return u.dict=l,u}static async createNewAppearanceStream(e,t,n){if(e.oldAnnotation)return null;if(e.isSignature)return this.#t(e,t);let{rotation:r}=e,{imageRef:i,width:a,height:o}=n.image,s=new L(t),c=new L(t);s.set(`XObject`,c),c.set(`Im0`,i);let l=`q ${a} 0 0 ${o} 0 0 cm /Im0 Do Q`,u=new L(t);if(u.set(`FormType`,1),u.setIfName(`Subtype`,`Form`),u.setIfName(`Type`,`XObject`),u.set(`BBox`,[0,0,a,o]),u.set(`Resources`,s),r){let e=Ur(r,a,o);u.set(`Matrix`,e)}let d=new _i(l);return d.dict=u,d}},nS=class extends Px{constructor(e){super(e);let{dict:t,xref:n}=e,r=new Rd(t.get(`FS`),n);this.data.annotationType=E.FILEATTACHMENT,this.data.hasOwnCanvas=this.data.noRotate,this.data.noHTML=!1,this.data.file=r.serializable;let i=t.get(`Name`);this.data.name=i instanceof I?Nn(i.name):`PushPin`;let a=t.get(`ca`);this.data.fillAlpha=typeof a==`number`&&a>=0&&a<=1?a:null}},rS={get r(){return P(this,`r`,new Uint8Array([7,12,17,22,7,12,17,22,7,12,17,22,7,12,17,22,5,9,14,20,5,9,14,20,5,9,14,20,5,9,14,20,4,11,16,23,4,11,16,23,4,11,16,23,4,11,16,23,6,10,15,21,6,10,15,21,6,10,15,21,6,10,15,21]))},get k(){return P(this,`k`,new Int32Array([-680876936,-389564586,606105819,-1044525330,-176418897,1200080426,-1473231341,-45705983,1770035416,-1958414417,-42063,-1990404162,1804603682,-40341101,-1502002290,1236535329,-165796510,-1069501632,643717713,-373897302,-701558691,38016083,-660478335,-405537848,568446438,-1019803690,-187363961,1163531501,-1444681467,-51403784,1735328473,-1926607734,-378558,-2022574463,1839030562,-35309556,-1530992060,1272893353,-155497632,-1094730640,681279174,-358537222,-722521979,76029189,-640364487,-421815835,530742520,-995338651,-198630844,1126891415,-1416354905,-57434055,1700485571,-1894986606,-1051523,-2054922799,1873313359,-30611744,-1560198380,1309151649,-145523070,-1120210379,718787259,-343485551]))}};function iS(e,t,n){let r=1732584193,i=-271733879,a=-1732584194,o=271733878,s=n+72&-64,c=new Uint8Array(s),l,u;for(l=0;l<n;++l)c[l]=e[t++];c[l++]=128;let d=s-8;l<d&&(l=d),c[l++]=n<<3&255,c[l++]=n>>5&255,c[l++]=n>>13&255,c[l++]=n>>21&255,c[l++]=n>>>29&255,l+=3;let f=new Int32Array(16),{k:p,r:m}=rS;for(l=0;l<s;){for(u=0;u<16;++u,l+=4)f[u]=c[l]|c[l+1]<<8|c[l+2]<<16|c[l+3]<<24;let e,t,n=r,s=i,d=a,h=o;for(u=0;u<64;++u){u<16?(e=s&d|~s&h,t=u):u<32?(e=h&s|~h&d,t=5*u+1&15):u<48?(e=s^d^h,t=3*u+5&15):(e=d^(s|~h),t=7*u&15);let r=h,i=n+e+p[u]+f[t]|0,a=m[u];h=d,d=s,s=s+(i<<a|i>>>32-a)|0,n=r}r=r+n|0,i=i+s|0,a=a+d|0,o=o+h|0}return new Uint8Array([255&r,r>>8&255,r>>16&255,r>>>24&255,255&i,i>>8&255,i>>16&255,i>>>24&255,255&a,a>>8&255,a>>16&255,a>>>24&255,255&o,o>>8&255,o>>16&255,o>>>24&255])}function aS(e){try{return Pn(e)}catch(t){return N(`UTF-8 decoding failed: "${t}".`),e}}var oS=class extends Yd{constructor(e){super(e),this.node=null}onEndElement(e){let t=super.onEndElement(e);if(t&&e===`xfa:datasets`)throw this.node=t,Error(`Aborting DatasetXMLParser.`)}},sS=class{constructor(e){if(e.datasets)this.node=new Yd({hasAttributes:!0}).parseFromString(e.datasets).documentElement;else{let t=new oS({hasAttributes:!0});try{t.parseFromString(e[`xdp:xdp`])}catch{}this.node=t.node}}getValue(e){if(!this.node||!e)return``;let t=this.node.searchNode(Dr(e),0);return t?t.firstChild?.nodeName===`value`?t.children.map(e=>aS(e.textContent)):aS(t.textContent):``}},cS=class{#e;#t=1/0;#n=1/0;#r=-1/0;#i=-1/0;#a=null;#o=[];#s=[];#c=-1;#l=!1;constructor(e){this.#e=e;let t=e.data.quadPoints;if(t){for(let e=0,n=t.length;e<n;e+=8)this.#t=Math.min(this.#t,t[e]),this.#r=Math.max(this.#r,t[e+2]),this.#n=Math.min(this.#n,t[e+5]),this.#i=Math.max(this.#i,t[e+1]);t.length>8&&(this.#a=t)}else [this.#t,this.#n,this.#r,this.#i]=e.data.rect}overlaps(e){return!(this.#t>=e.#r||this.#r<=e.#t||this.#n>=e.#i||this.#i<=e.#n)}#u(e,t){if(this.#t>=e||this.#r<=e||this.#n>=t||this.#i<=t)return!1;let n=this.#a;if(!n)return!0;if(this.#c>=0){let r=this.#c;if(!(n[r]>=e||n[r+2]<=e||n[r+5]>=t||n[r+1]<=t))return!0;this.#c=-1}for(let r=0,i=n.length;r<i;r+=8)if(!(n[r]>=e||n[r+2]<=e||n[r+5]>=t||n[r+1]<=t))return this.#c=r,!0;return!1}addGlyph(e,t,n){return this.#u(e,t)?(this.#s.length>0&&(this.#o.push(this.#s.join(``)),this.#s.length=0),this.#o.push(n),this.#l=!0,!0):(this.disableExtraChars(),!1)}addExtraChar(e){this.#l&&this.#s.push(e)}disableExtraChars(){this.#l&&(this.#l=!1,this.#s.length=0)}setText(){this.#e.data.overlaidText=this.#o.join(``)}},lS=class{#e=new Map;constructor(e){for(let t of e){if(!t.data.quadPoints&&!t.data.rect)continue;let e=new cS(t);for(let[t,n]of this.#e)t.overlaps(e)&&(n?n.add(e):this.#e.set(t,new Set([e])));this.#e.set(e,null)}}addGlyph(e,t,n,r){let i=e[4]+t/2,a=e[5]+n/2,o;for(let[e,t]of this.#e)o?o.has(e)?e.addGlyph(i,a,r):e.disableExtraChars():e.addGlyph(i,a,r)&&(o=t)}addExtraChar(e){for(let t of this.#e.keys())t.addExtraChar(e)}setText(){for(let e of this.#e.keys())e.setText()}},Z=class{constructor(e,t){this.high=0|e,this.low=0|t}and(e){this.high&=e.high,this.low&=e.low}xor(e){this.high^=e.high,this.low^=e.low}shiftRight(e){e>=32?(this.low=this.high>>>e-32|0,this.high=0):(this.low=this.low>>>e|this.high<<32-e,this.high=this.high>>>e|0)}rotateRight(e){let t,n;32&e?(n=this.low,t=this.high):(t=this.low,n=this.high),e&=31,this.low=t>>>e|n<<32-e,this.high=n>>>e|t<<32-e}not(){this.high=~this.high,this.low=~this.low}add(e){let t=(this.low>>>0)+(e.low>>>0),n=(this.high>>>0)+(e.high>>>0);t>4294967295&&(n+=1),this.low=0|t,this.high=0|n}copyTo(e,t){e[t]=this.high>>>24&255,e[t+1]=this.high>>16&255,e[t+2]=this.high>>8&255,e[t+3]=255&this.high,e[t+4]=this.low>>>24&255,e[t+5]=this.low>>16&255,e[t+6]=this.low>>8&255,e[t+7]=255&this.low}assign(e){this.high=e.high,this.low=e.low}},uS={get k(){return P(this,`k`,[new Z(1116352408,3609767458),new Z(1899447441,602891725),new Z(3049323471,3964484399),new Z(3921009573,2173295548),new Z(961987163,4081628472),new Z(1508970993,3053834265),new Z(2453635748,2937671579),new Z(2870763221,3664609560),new Z(3624381080,2734883394),new Z(310598401,1164996542),new Z(607225278,1323610764),new Z(1426881987,3590304994),new Z(1925078388,4068182383),new Z(2162078206,991336113),new Z(2614888103,633803317),new Z(3248222580,3479774868),new Z(3835390401,2666613458),new Z(4022224774,944711139),new Z(264347078,2341262773),new Z(604807628,2007800933),new Z(770255983,1495990901),new Z(1249150122,1856431235),new Z(1555081692,3175218132),new Z(1996064986,2198950837),new Z(2554220882,3999719339),new Z(2821834349,766784016),new Z(2952996808,2566594879),new Z(3210313671,3203337956),new Z(3336571891,1034457026),new Z(3584528711,2466948901),new Z(113926993,3758326383),new Z(338241895,168717936),new Z(666307205,1188179964),new Z(773529912,1546045734),new Z(1294757372,1522805485),new Z(1396182291,2643833823),new Z(1695183700,2343527390),new Z(1986661051,1014477480),new Z(2177026350,1206759142),new Z(2456956037,344077627),new Z(2730485921,1290863460),new Z(2820302411,3158454273),new Z(3259730800,3505952657),new Z(3345764771,106217008),new Z(3516065817,3606008344),new Z(3600352804,1432725776),new Z(4094571909,1467031594),new Z(275423344,851169720),new Z(430227734,3100823752),new Z(506948616,1363258195),new Z(659060556,3750685593),new Z(883997877,3785050280),new Z(958139571,3318307427),new Z(1322822218,3812723403),new Z(1537002063,2003034995),new Z(1747873779,3602036899),new Z(1955562222,1575990012),new Z(2024104815,1125592928),new Z(2227730452,2716904306),new Z(2361852424,442776044),new Z(2428436474,593698344),new Z(2756734187,3733110249),new Z(3204031479,2999351573),new Z(3329325298,3815920427),new Z(3391569614,3928383900),new Z(3515267271,566280711),new Z(3940187606,3454069534),new Z(4118630271,4000239992),new Z(116418474,1914138554),new Z(174292421,2731055270),new Z(289380356,3203993006),new Z(460393269,320620315),new Z(685471733,587496836),new Z(852142971,1086792851),new Z(1017036298,365543100),new Z(1126000580,2618297676),new Z(1288033470,3409855158),new Z(1501505948,4234509866),new Z(1607167915,987167468),new Z(1816402316,1246189591)])}};function dS(e,t,n,r,i){e.assign(t),e.and(n),i.assign(t),i.not(),i.and(r),e.xor(i)}function fS(e,t,n,r,i){e.assign(t),e.and(n),i.assign(t),i.and(r),e.xor(i),i.assign(n),i.and(r),e.xor(i)}function pS(e,t,n){e.assign(t),e.rotateRight(28),n.assign(t),n.rotateRight(34),e.xor(n),n.assign(t),n.rotateRight(39),e.xor(n)}function mS(e,t,n){e.assign(t),e.rotateRight(14),n.assign(t),n.rotateRight(18),e.xor(n),n.assign(t),n.rotateRight(41),e.xor(n)}function hS(e,t,n){e.assign(t),e.rotateRight(1),n.assign(t),n.rotateRight(8),e.xor(n),n.assign(t),n.shiftRight(7),e.xor(n)}function gS(e,t,n){e.assign(t),e.rotateRight(19),n.assign(t),n.rotateRight(61),e.xor(n),n.assign(t),n.shiftRight(6),e.xor(n)}function _S(e,t,n,r=!1){let i,a,o,s,c,l,u,d;r?(i=new Z(3418070365,3238371032),a=new Z(1654270250,914150663),o=new Z(2438529370,812702999),s=new Z(355462360,4144912697),c=new Z(1731405415,4290775857),l=new Z(2394180231,1750603025),u=new Z(3675008525,1694076839),d=new Z(1203062813,3204075428)):(i=new Z(1779033703,4089235720),a=new Z(3144134277,2227873595),o=new Z(1013904242,4271175723),s=new Z(2773480762,1595750129),c=new Z(1359893119,2917565137),l=new Z(2600822924,725511199),u=new Z(528734635,4215389547),d=new Z(1541459225,327033209));let f=128*Math.ceil((n+17)/128),p=new Uint8Array(f),m,h;for(m=0;m<n;++m)p[m]=e[t++];p[m++]=128;let g=f-16;m<g&&(m=g),m+=11,p[m++]=n>>>29&255,p[m++]=n>>21&255,p[m++]=n>>13&255,p[m++]=n>>5&255,p[m++]=n<<3&255;let _=Array(80);for(m=0;m<80;m++)_[m]=new Z(0,0);let{k:v}=uS,y=new Z(0,0),b=new Z(0,0),x=new Z(0,0),S=new Z(0,0),C=new Z(0,0),w=new Z(0,0),T=new Z(0,0),E=new Z(0,0),D=new Z(0,0),O=new Z(0,0),k=new Z(0,0),ee=new Z(0,0),A,j;for(m=0;m<f;){for(h=0;h<16;++h)_[h].high=p[m]<<24|p[m+1]<<16|p[m+2]<<8|p[m+3],_[h].low=p[m+4]<<24|p[m+5]<<16|p[m+6]<<8|p[m+7],m+=8;for(h=16;h<80;++h)A=_[h],gS(A,_[h-2],ee),A.add(_[h-7]),hS(k,_[h-15],ee),A.add(k),A.add(_[h-16]);for(y.assign(i),b.assign(a),x.assign(o),S.assign(s),C.assign(c),w.assign(l),T.assign(u),E.assign(d),h=0;h<80;++h)D.assign(E),mS(k,C,ee),D.add(k),dS(k,C,w,T,ee),D.add(k),D.add(v[h]),D.add(_[h]),pS(O,y,ee),fS(k,y,b,x,ee),O.add(k),A=E,E=T,T=w,w=C,S.add(D),C=S,S=x,x=b,b=y,A.assign(D),A.add(O),y=A;i.add(y),a.add(b),o.add(x),s.add(S),c.add(C),l.add(w),u.add(T),d.add(E)}return r?(j=new Uint8Array(48),i.copyTo(j,0),a.copyTo(j,8),o.copyTo(j,16),s.copyTo(j,24),c.copyTo(j,32),l.copyTo(j,40)):(j=new Uint8Array(64),i.copyTo(j,0),a.copyTo(j,8),o.copyTo(j,16),s.copyTo(j,24),c.copyTo(j,32),l.copyTo(j,40),u.copyTo(j,48),d.copyTo(j,56)),j}function vS(e,t,n){return _S(e,t,n,!0)}var yS={get k(){return P(this,`k`,[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298])}};function bS(e,t){return e>>>t|e<<32-t}function xS(e,t,n){return e&t^~e&n}function SS(e,t,n){return e&t^e&n^t&n}function CS(e){return bS(e,2)^bS(e,13)^bS(e,22)}function wS(e){return bS(e,6)^bS(e,11)^bS(e,25)}function TS(e){return bS(e,7)^bS(e,18)^e>>>3}function ES(e){return bS(e,17)^bS(e,19)^e>>>10}function DS(e,t,n){let r=1779033703,i=3144134277,a=1013904242,o=2773480762,s=1359893119,c=2600822924,l=528734635,u=1541459225,d=64*Math.ceil((n+9)/64),f=new Uint8Array(d),p,m;for(p=0;p<n;++p)f[p]=e[t++];f[p++]=128;let h=d-8;p<h&&(p=h),p+=3,f[p++]=n>>>29&255,f[p++]=n>>21&255,f[p++]=n>>13&255,f[p++]=n>>5&255,f[p++]=n<<3&255;let g=new Uint32Array(64),{k:_}=yS;for(p=0;p<d;){for(m=0;m<16;++m)g[m]=f[p]<<24|f[p+1]<<16|f[p+2]<<8|f[p+3],p+=4;for(m=16;m<64;++m)g[m]=ES(g[m-2])+g[m-7]+TS(g[m-15])+g[m-16]|0;let e,t,n=r,d=i,h=a,v=o,y=s,b=c,x=l,S=u;for(m=0;m<64;++m)e=S+wS(y)+xS(y,b,x)+_[m]+g[m],t=CS(n)+SS(n,d,h),S=x,x=b,b=y,y=v+e|0,v=h,h=d,d=n,n=e+t|0;r=r+n|0,i=i+d|0,a=a+h|0,o=o+v|0,s=s+y|0,c=c+b|0,l=l+x|0,u=u+S|0}return new Uint8Array([r>>24&255,r>>16&255,r>>8&255,255&r,i>>24&255,i>>16&255,i>>8&255,255&i,a>>24&255,a>>16&255,a>>8&255,255&a,o>>24&255,o>>16&255,o>>8&255,255&o,s>>24&255,s>>16&255,s>>8&255,255&s,c>>24&255,c>>16&255,c>>8&255,255&c,l>>24&255,l>>16&255,l>>8&255,255&l,u>>24&255,u>>16&255,u>>8&255,255&u])}var OS=class extends Ti{constructor(e,t,n){super(t),this.str=e,this.dict=e.dict,this.decrypt=n,this.nextChunk=null,this.initialized=!1}readBlock(){let e;if(this.initialized?e=this.nextChunk:(e=this.str.getBytes(512),this.initialized=!0),!e?.length)return void(this.eof=!0);this.nextChunk=this.str.getBytes(512);let t=this.nextChunk?.length>0;e=(0,this.decrypt)(e,!t);let n=this.bufferLength,r=n+e.length;this.ensureBuffer(r).set(e,n),this.bufferLength=r}},kS=class{constructor(e){this.a=0,this.b=0;let t=new Uint8Array(256),n=e.length;for(let e=0;e<256;++e)t[e]=e;for(let r=0,i=0;r<256;++r){let a=t[r];i=i+a+e[r%n]&255,t[r]=t[i],t[i]=a}this.s=t}encryptBlock(e){let t=this.a,n=this.b,r=this.s,i=e.length,a=new Uint8Array(i);for(let o=0;o<i;++o){t=t+1&255;let i=r[t];n=n+i&255;let s=r[n];r[t]=s,r[n]=i,a[o]=e[o]^r[i+s&255]}return this.a=t,this.b=n,a}decryptBlock(e){return this.encryptBlock(e)}encrypt(e){return this.encryptBlock(e)}},AS=class{decryptBlock(e){return e}encrypt(e){return e}},jS=class{_s=new Uint8Array([99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22]);_inv_s=new Uint8Array([82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125]);_mix=new Uint32Array([0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795]);_mixCol=new Uint8Array(256).map((e,t)=>t<128?t<<1:t<<1^27);constructor(){this.buffer=new Uint8Array(16),this.bufferPosition=0}_expandKey(e){gn("Cannot call `_expandKey` on the base class")}_decrypt(e,t){let n,r,i,a=new Uint8Array(16);a.set(e);for(let e=0,n=this._keySize;e<16;++e,++n)a[e]^=t[n];for(let e=this._cyclesOfRepetition-1;e>=1;--e){n=a[13],a[13]=a[9],a[9]=a[5],a[5]=a[1],a[1]=n,n=a[14],r=a[10],a[14]=a[6],a[10]=a[2],a[6]=n,a[2]=r,n=a[15],r=a[11],i=a[7],a[15]=a[3],a[11]=n,a[7]=r,a[3]=i;for(let e=0;e<16;++e)a[e]=this._inv_s[a[e]];for(let n=0,r=16*e;n<16;++n,++r)a[n]^=t[r];for(let e=0;e<16;e+=4){let t=this._mix[a[e]],r=this._mix[a[e+1]],i=this._mix[a[e+2]],o=this._mix[a[e+3]];n=t^r>>>8^r<<24^i>>>16^i<<16^o>>>24^o<<8,a[e]=n>>>24&255,a[e+1]=n>>16&255,a[e+2]=n>>8&255,a[e+3]=255&n}}n=a[13],a[13]=a[9],a[9]=a[5],a[5]=a[1],a[1]=n,n=a[14],r=a[10],a[14]=a[6],a[10]=a[2],a[6]=n,a[2]=r,n=a[15],r=a[11],i=a[7],a[15]=a[3],a[11]=n,a[7]=r,a[3]=i;for(let e=0;e<16;++e)a[e]=this._inv_s[a[e]],a[e]^=t[e];return a}_encrypt(e,t){let n=this._s,r,i,a,o=new Uint8Array(16);o.set(e);for(let e=0;e<16;++e)o[e]^=t[e];for(let e=1;e<this._cyclesOfRepetition;e++){for(let e=0;e<16;++e)o[e]=n[o[e]];a=o[1],o[1]=o[5],o[5]=o[9],o[9]=o[13],o[13]=a,a=o[2],i=o[6],o[2]=o[10],o[6]=o[14],o[10]=a,o[14]=i,a=o[3],i=o[7],r=o[11],o[3]=o[15],o[7]=a,o[11]=i,o[15]=r;for(let e=0;e<16;e+=4){let t=o[e],n=o[e+1],i=o[e+2],a=o[e+3];r=t^n^i^a,o[e]^=r^this._mixCol[t^n],o[e+1]^=r^this._mixCol[n^i],o[e+2]^=r^this._mixCol[i^a],o[e+3]^=r^this._mixCol[a^t]}for(let n=0,r=16*e;n<16;++n,++r)o[n]^=t[r]}for(let e=0;e<16;++e)o[e]=n[o[e]];a=o[1],o[1]=o[5],o[5]=o[9],o[9]=o[13],o[13]=a,a=o[2],i=o[6],o[2]=o[10],o[6]=o[14],o[10]=a,o[14]=i,a=o[3],i=o[7],r=o[11],o[3]=o[15],o[7]=a,o[11]=i,o[15]=r;for(let e=0,n=this._keySize;e<16;++e,++n)o[e]^=t[n];return o}_decryptBlock2(e,t){let n=e.length,r=this.buffer,i=this.bufferPosition,a=[],o=this.iv;for(let t=0;t<n;++t){if(r[i]=e[t],++i,i<16)continue;let n=this._decrypt(r,this._key);for(let e=0;e<16;++e)n[e]^=o[e];o=r,a.push(n),r=new Uint8Array(16),i=0}if(this.buffer=r,this.bufferLength=i,this.iv=o,a.length===0)return new Uint8Array;let s=16*a.length;if(t){let e=a.at(-1),t=e[15];if(t<=16){for(let n=15,r=16-t;n>=r;--n)if(e[n]!==t){t=0;break}s-=t,a[a.length-1]=e.subarray(0,16-t)}}let c=new Uint8Array(s);for(let e=0,t=0,n=a.length;e<n;++e,t+=16)c.set(a[e],t);return c}decryptBlock(e,t,n=null){let r=e.length,i=this.buffer,a=this.bufferPosition;if(n)this.iv=n;else{for(let t=0;a<16&&t<r;++t,++a)i[a]=e[t];if(a<16)return this.bufferLength=a,new Uint8Array;this.iv=i,e=e.subarray(16)}return this.buffer=new Uint8Array(16),this.bufferLength=0,this.decryptBlock=this._decryptBlock2,this.decryptBlock(e,t)}encrypt(e,t){let n=e.length,r=this.buffer,i=this.bufferPosition,a=[];t||=new Uint8Array(16);for(let o=0;o<n;++o){if(r[i]=e[o],++i,i<16)continue;for(let e=0;e<16;++e)r[e]^=t[e];let n=this._encrypt(r,this._key);t=n,a.push(n),r=new Uint8Array(16),i=0}if(this.buffer=r,this.bufferLength=i,this.iv=t,a.length===0)return new Uint8Array;let o=16*a.length,s=new Uint8Array(o);for(let e=0,t=0,n=a.length;e<n;++e,t+=16)s.set(a[e],t);return s}},MS=class extends jS{_rcon=new Uint8Array([141,1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145,57,114,228,211,189,97,194,159,37,74,148,51,102,204,131,29,58,116,232,203,141,1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145,57,114,228,211,189,97,194,159,37,74,148,51,102,204,131,29,58,116,232,203,141,1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145,57,114,228,211,189,97,194,159,37,74,148,51,102,204,131,29,58,116,232,203,141,1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145,57,114,228,211,189,97,194,159,37,74,148,51,102,204,131,29,58,116,232,203,141,1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145,57,114,228,211,189,97,194,159,37,74,148,51,102,204,131,29,58,116,232,203,141]);constructor(e){super(),this._cyclesOfRepetition=10,this._keySize=160,this._key=this._expandKey(e)}_expandKey(e){let t=this._s,n=this._rcon,r=new Uint8Array(176);r.set(e);for(let e=16,i=1;e<176;++i){let a=r[e-3],o=r[e-2],s=r[e-1],c=r[e-4];a=t[a],o=t[o],s=t[s],c=t[c],a^=n[i];for(let t=0;t<4;++t)r[e]=a^=r[e-16],e++,r[e]=o^=r[e-16],e++,r[e]=s^=r[e-16],e++,r[e]=c^=r[e-16],e++}return r}},NS=class extends jS{constructor(e){super(),this._cyclesOfRepetition=14,this._keySize=224,this._key=this._expandKey(e)}_expandKey(e){let t=this._s,n=new Uint8Array(240);n.set(e);let r,i,a,o,s=1;for(let e=32,c=1;e<240;++c){e%32==16?(r=t[r],i=t[i],a=t[a],o=t[o]):e%32==0&&(r=n[e-3],i=n[e-2],a=n[e-1],o=n[e-4],r=t[r],i=t[i],a=t[a],o=t[o],r^=s,(s<<=1)>=256&&(s=255&(27^s)));for(let t=0;t<4;++t)n[e]=r^=n[e-32],e++,n[e]=i^=n[e-32],e++,n[e]=a^=n[e-32],e++,n[e]=o^=n[e-32],e++}return n}},PS=class{_hash(e,t,n){gn("Abstract method `_hash` called")}checkOwnerPassword(e,t,n,r){let i=new Uint8Array(e.length+56);return i.set(e,0),i.set(t,e.length),i.set(n,e.length+t.length),In(this._hash(e,i,n),r)}checkUserPassword(e,t,n){let r=new Uint8Array(e.length+8);return r.set(e,0),r.set(t,e.length),In(this._hash(e,r,[]),n)}getOwnerKey(e,t,n,r){let i=new Uint8Array(e.length+56);return i.set(e,0),i.set(t,e.length),i.set(n,e.length+t.length),new NS(this._hash(e,i,n)).decryptBlock(r,!1,new Uint8Array(16))}getUserKey(e,t,n){let r=new Uint8Array(e.length+8);return r.set(e,0),r.set(t,e.length),new NS(this._hash(e,r,[])).decryptBlock(n,!1,new Uint8Array(16))}},FS=class extends PS{_hash(e,t,n){return DS(t,0,t.length)}},IS=class extends PS{_hash(e,t,n){let r=DS(t,0,t.length).subarray(0,32),i=[0],a=0;for(;a<64||i.at(-1)>a-32;){let t=e.length+r.length+n.length,o=new Uint8Array(t),s=0;o.set(e,s),s+=e.length,o.set(r,s),s+=r.length,o.set(n,s);let c=new Uint8Array(64*t);for(let e=0,n=0;e<64;e++,n+=t)c.set(o,n);i=new MS(r.subarray(0,16)).encrypt(c,r.subarray(16,32));let l=Math.sumPrecise(i.slice(0,16))%3;l===0?r=DS(i,0,i.length):l===1?r=vS(i,0,i.length):l===2&&(r=_S(i,0,i.length)),a++}return r.subarray(0,32)}},LS=class{constructor(e,t){this.StringCipherConstructor=e,this.StreamCipherConstructor=t}createStream(e,t){let n=new this.StreamCipherConstructor;return new OS(e,t,function(e,t){return n.decryptBlock(e,t)})}decryptString(e){let t=new this.StringCipherConstructor,n=En(e);return n=t.decryptBlock(n,!0),Tn(n)}encryptString(e){let t=new this.StringCipherConstructor;if(t instanceof jS){let n=16-e.length%16;e+=String.fromCharCode(n).repeat(n);let r=new Uint8Array(16);crypto.getRandomValues(r);let i=En(e);i=t.encrypt(i,r);let a=new Uint8Array(16+i.length);return a.set(r),a.set(i,16),Tn(a)}let n=En(e);return n=t.encrypt(n),Tn(n)}},RS=class e{static get _defaultPasswordBytes(){return P(this,`_defaultPasswordBytes`,new Uint8Array([40,191,78,94,78,117,138,65,100,0,78,86,255,250,1,8,46,46,0,182,208,104,62,128,47,12,169,254,100,83,105,122]))}#e(e,t,n,r,i,a,o,s,c,l,u,d){if(t){let e=Math.min(127,t.length);t=t.subarray(0,e)}else t=[];let f=e===6?new IS:new FS;return f.checkUserPassword(t,s,o)?f.getUserKey(t,c,u):t.length&&f.checkOwnerPassword(t,r,a,n)?f.getOwnerKey(t,i,a,l):null}#t(t,n,r,i,a,o,s,c){let l=40+r.length+t.length,u=new Uint8Array(l),d,f,p=0;if(n)for(f=Math.min(32,n.length);p<f;++p)u[p]=n[p];for(d=0;p<32;)u[p++]=e._defaultPasswordBytes[d++];u.set(r,p),p+=r.length,u[p++]=255&a,u[p++]=a>>8&255,u[p++]=a>>16&255,u[p++]=a>>>24&255,u.set(t,p),p+=t.length,o>=4&&!c&&(u.fill(255,p,p+4),p+=4);let m=iS(u,0,p),h=s>>3;if(o>=3)for(d=0;d<50;++d)m=iS(m,0,h);let g=m.subarray(0,h),_,v;if(o>=3){p=0,u.set(e._defaultPasswordBytes,p),p+=32,u.set(t,p),p+=t.length,_=new kS(g),v=_.encryptBlock(iS(u,0,p)),f=g.length;let n=new Uint8Array(f);for(d=1;d<=19;++d){for(let e=0;e<f;++e)n[e]=g[e]^d;_=new kS(n),v=_.encryptBlock(v)}}else _=new kS(g),v=_.encryptBlock(e._defaultPasswordBytes);return v.every((e,t)=>i[t]===e)?g:null}#n(t,n,r,i){let a=new Uint8Array(32),o=0,s=Math.min(32,t.length);for(;o<s;++o)a[o]=t[o];let c=0;for(;o<32;)a[o++]=e._defaultPasswordBytes[c++];let l=iS(a,0,o),u=i>>3;if(r>=3)for(c=0;c<50;++c)l=iS(l,0,l.length);let d,f;if(r>=3){f=n;let e=new Uint8Array(u);for(c=19;c>=0;c--){for(let t=0;t<u;++t)e[t]=l[t]^c;d=new kS(e),f=d.encryptBlock(f)}}else d=new kS(l.subarray(0,u)),f=d.encryptBlock(n);return f}#r(e,t,n,r=!1){let i=n.length,a=new Uint8Array(i+9);a.set(n);let o=i;return a[o++]=255&e,a[o++]=e>>8&255,a[o++]=e>>16&255,a[o++]=255&t,a[o++]=t>>8&255,r&&(a[o++]=115,a[o++]=65,a[o++]=108,a[o++]=84),iS(a,0,o).subarray(0,Math.min(i+5,16))}#i(e,t,n,r,i){if(!(t instanceof I))throw new F(`Invalid crypt filter name.`);let a=this,o=e.get(t.name)?.get(`CFM`);if(!o||o.name===`None`)return function(){return new AS};if(o.name===`V2`)return function(){return new kS(a.#r(n,r,i,!1))};if(o.name===`AESV2`)return function(){return new MS(a.#r(n,r,i,!0))};if(o.name===`AESV3`)return function(){return new NS(i)};throw new F(`Unknown crypto method`)}constructor(e,t,n){let r=e.get(`Filter`);if(!Zn(r,`Standard`))throw new F(`unknown encryption method`);this.filterName=r.name,this.dict=e;let i=e.get(`V`);if(!Number.isInteger(i)||i!==1&&i!==2&&i!==4&&i!==5)throw new F(`unsupported encryption algorithm`);this.algorithm=i;let a=e.get(`Length`);if(!a)if(i<=3)a=40;else{let t=e.get(`CF`),n=e.get(`StmF`);t instanceof L&&n instanceof I&&(t.suppressEncryption=!0,a=t.get(n.name)?.get(`Length`)||128,a<40&&(a<<=3))}if(!Number.isInteger(a)||a<40||a%8!=0)throw new F(`invalid key length`);let o=En(e.get(`O`)),s=En(e.get(`U`)),c=o.subarray(0,32),l=s.subarray(0,32),u=e.get(`P`),d=e.get(`R`),f=(i===4||i===5)&&!1!==e.get(`EncryptMetadata`);this.encryptMetadata=f;let p=En(t),m,h;if(n){if(d===6)try{n=Fn(n)}catch{N(`CipherTransformFactory: Unable to convert UTF8 encoded password.`)}m=En(n)}if(i!==5)h=this.#t(p,m,c,l,u,d,a,f);else{let t=o.subarray(32,40),n=o.subarray(40,48),r=s.subarray(0,48),i=s.subarray(32,40),a=s.subarray(40,48),u=En(e.get(`OE`)),f=En(e.get(`UE`)),p=En(e.get(`Perms`));h=this.#e(d,m,c,t,n,r,l,i,a,u,f,p)}if(!h){if(!n)throw new bn(`No password given`,fn);let e=this.#n(m,c,d,a);h=this.#t(p,e,c,l,u,d,a,f)}if(!h)throw new bn(`Incorrect Password`,pn);if(i===4&&h.length<16?(this.encryptionKey=new Uint8Array(16),this.encryptionKey.set(h)):this.encryptionKey=h,i>=4){let t=e.get(`CF`);t instanceof L&&(t.suppressEncryption=!0),this.cf=t,this.stmf=e.get(`StmF`)||I.get(`Identity`),this.strf=e.get(`StrF`)||I.get(`Identity`),this.eff=e.get(`EFF`)||this.stmf}}createCipherTransform(e,t){if(this.algorithm===4||this.algorithm===5)return new LS(this.#i(this.cf,this.strf,e,t,this.encryptionKey),this.#i(this.cf,this.stmf,e,t,this.encryptionKey));let n=this.#r(e,t,this.encryptionKey,!1),r=function(){return new kS(n)};return new LS(r,r)}},zS=class{constructor(e,t){this.stream=e,this.pdfManager=t,this.entries=[],this._xrefStms=new Set,this._cacheMap=new Map,this._pendingRefs=new Yn,this._newPersistentRefNum=null,this._newTemporaryRefNum=null,this._persistentRefsCache=null}getNewPersistentRef(e){this._newPersistentRefNum===null&&(this._newPersistentRefNum=this.entries.length||1);let t=this._newPersistentRefNum++;return this._cacheMap.set(t,e),R.get(t,0)}getNewTemporaryRef(){if(this._newTemporaryRefNum===null&&(this._newTemporaryRefNum=this.entries.length||1,this._newPersistentRefNum)){this._persistentRefsCache=new Map;for(let e=this._newTemporaryRefNum;e<this._newPersistentRefNum;e++)this._persistentRefsCache.set(e,this._cacheMap.get(e)),this._cacheMap.delete(e)}return R.get(this._newTemporaryRefNum++,0)}resetNewTemporaryRef(){if(this._newTemporaryRefNum=null,this._persistentRefsCache)for(let[e,t]of this._persistentRefsCache)this._cacheMap.set(e,t);this._persistentRefsCache=null}setStartXRef(e){this.startXRefQueue=[e]}parse(e=!1){let t,n,r;e?(N(`Indexing all PDF objects`),t=this.indexObjects()):t=this.readXRef(),t.assignXref(this),this.trailer=t;try{n=t.get(`Encrypt`)}catch(e){if(e instanceof cr)throw e;N(`XRef.parse - Invalid "Encrypt" reference: "${e}".`)}if(n instanceof L){let e=t.get(`ID`),r=e?.length?e[0]:``;n.suppressEncryption=!0,this.encrypt=new RS(n,r,this.pdfManager.password)}try{r=t.get(`Root`)}catch(e){if(e instanceof cr)throw e;N(`XRef.parse - Invalid "Root" reference: "${e}".`)}if(r instanceof L)try{if(r.get(`Pages`)instanceof L)return void(this.root=r)}catch(e){if(e instanceof cr)throw e;N(`XRef.parse - Invalid "Pages" reference: "${e}".`)}throw e?new Sn(`Invalid Root reference.`):new dr}processXRefTable(e){if(`tableState`in this||(this.tableState={entryNum:0,streamPos:e.lexer.stream.pos,parserBuf1:e.buf1,parserBuf2:e.buf2}),!Qn(this.readXRefTable(e),`trailer`))throw new F(`Invalid XRef table: could not find trailer dictionary`);let t=e.getObj();if(t instanceof L||!t.dict||(t=t.dict),!(t instanceof L))throw new F(`Invalid XRef table: could not parse trailer dictionary`);return delete this.tableState,t}readXRefTable(e){let t=e.lexer.stream,n=this.tableState,r;for(t.pos=n.streamPos,e.buf1=n.parserBuf1,e.buf2=n.parserBuf2;;){if(!(`firstEntryNum`in n)||!(`entryCount`in n)){if(Qn(r=e.getObj(),`trailer`))break;n.firstEntryNum=r,n.entryCount=e.getObj()}let i=n.firstEntryNum,a=n.entryCount;if(!Number.isInteger(i)||!Number.isInteger(a))throw new F(`Invalid XRef table: wrong types in subsection header`);for(let r=n.entryNum;r<a;r++){n.streamPos=t.pos,n.entryNum=r,n.parserBuf1=e.buf1,n.parserBuf2=e.buf2;let o={};o.offset=e.getObj(),o.gen=e.getObj();let s=e.getObj();if(s instanceof qn)switch(s.cmd){case`f`:o.free=!0;break;case`n`:o.uncompressed=!0}if(!Number.isInteger(o.offset)||!Number.isInteger(o.gen)||!o.free&&!o.uncompressed)throw new F(`Invalid entry in XRef subsection: ${i}, ${a}`);r===0&&o.free&&i===1&&(i=0),this.entries[r+i]||(this.entries[r+i]=o)}n.entryNum=0,n.streamPos=t.pos,n.parserBuf1=e.buf1,n.parserBuf2=e.buf2,delete n.firstEntryNum,delete n.entryCount}if(this.entries[0]&&!this.entries[0].free)throw new F(`Invalid XRef table: unexpected first object`);return r}processXRefStream(e){if(!(`streamState`in this)){let{dict:t,pos:n}=e,r=t.get(`W`);this.streamState={entryRanges:t.get(`Index`)||[0,t.get(`Size`)],byteWidths:r,entryNum:0,streamPos:n}}return this.readXRefStream(e),delete this.streamState,e.dict}readXRefStream(e){let t=this.streamState;e.pos=t.streamPos;let[n,r,i]=t.byteWidths,a=t.entryRanges;for(;a.length>0;){let[o,s]=a;if(!Number.isInteger(o)||!Number.isInteger(s))throw new F(`Invalid XRef range fields: ${o}, ${s}`);if(!Number.isInteger(n)||!Number.isInteger(r)||!Number.isInteger(i))throw new F(`Invalid XRef entry fields length: ${o}, ${s}`);for(let a=t.entryNum;a<s;++a){t.entryNum=a,t.streamPos=e.pos;let s=0,c=0,l=0;for(let t=0;t<n;++t){let t=e.getByte();if(t===-1)throw new F(`Invalid XRef byteWidths 'type'.`);s=s<<8|t}n===0&&(s=1);for(let t=0;t<r;++t){let t=e.getByte();if(t===-1)throw new F(`Invalid XRef byteWidths 'offset'.`);c=c<<8|t}for(let t=0;t<i;++t){let t=e.getByte();if(t===-1)throw new F(`Invalid XRef byteWidths 'generation'.`);l=l<<8|t}let u={};switch(u.offset=c,u.gen=l,s){case 0:u.free=!0;break;case 1:u.uncompressed=!0;break;case 2:break;default:throw new F(`Invalid XRef entry type: ${s}`)}this.entries[o+a]||(this.entries[o+a]=u)}t.entryNum=0,t.streamPos=e.pos,a.splice(0,2)}}indexObjects(){function e(e,t){let n=``,r=e[t];for(;r!==10&&r!==13&&r!==60&&!(++t>=e.length);)n+=String.fromCharCode(r),r=e[t];return n}function t(e,t,n){let r=n.length,i=e.length,a=0;for(;t<i;){let i=0;for(;i<r&&e[t+i]===n[i];)++i;if(i>=r)break;t++,a++}return a}let n=/\b(endobj|\d+\s+\d+\s+obj|xref|trailer\s*<<)\b/g,r=/\b(startxref|\d+\s+\d+\s+obj)\b/g,i=/^(\d+)\s+(\d+)\s+obj\b/,a=new Uint8Array([116,114,97,105,108,101,114]),o=new Uint8Array([115,116,97,114,116,120,114,101,102]),s=new Uint8Array([47,88,82,101,102]);this.entries.length=0,this._cacheMap.clear();let c=this.stream;c.pos=0;let l=c.getBytes(),u=Tn(l),d=l.length,f=c.start,p=[],m=[];for(;f<d;){let h=l[f];if(h===9||h===10||h===13||h===32){++f;continue}if(h===37){do{if(++f,f>=d)break;h=l[f]}while(h!==10&&h!==13);continue}let g=e(l,f),_;if(g.startsWith(`xref`)&&(g.length===4||/\s/.test(g[4])))f+=t(l,f,a),p.push(f),f+=t(l,f,o);else if(_=i.exec(g)){let e=0|_[1],r=0|_[2],i=f+g.length,a,o=!1;if(this.entries[e]){if(this.entries[e].gen===r)try{new uo({lexer:new mo(c.makeSubStream(i))}).getObj(),o=!0}catch(e){e instanceof lr?N(`indexObjects -- checking object (${g}): "${e}".`):o=!0}}else o=!0;o&&(this.entries[e]={offset:f-c.start,gen:r,uncompressed:!0}),n.lastIndex=i;let p=n.exec(u);p?(a=n.lastIndex+1-f,p[1]!==`endobj`&&(N(`indexObjects: Found "${p[1]}" inside of another "obj", caused by missing "endobj" -- trying to recover.`),a-=p[1].length+1)):a=d-f;let h=l.subarray(f,f+a),v=t(h,0,s);v<a&&h[v+5]<64&&(m.push(f-c.start),this._xrefStms.add(f-c.start)),f+=a}else if(g.startsWith(`trailer`)&&(g.length===7||/\s/.test(g[7]))){p.push(f);let e=f+g.length,t;r.lastIndex=e;let n=r.exec(u);n?(t=r.lastIndex+1-f,n[1]!==`startxref`&&(N(`indexObjects: Found "${n[1]}" after "trailer", caused by missing "startxref" -- trying to recover.`),t-=n[1].length+1)):t=d-f,f+=t}else f+=g.length+1}for(let e of m)this.startXRefQueue.push(e),this.readXRef(!0);let h=[],g,_,v=!1;for(let e of p){c.pos=e;let t=new uo({lexer:new mo(c),xref:this,allowStreams:!0,recoveryMode:!0});if(!Qn(t.getObj(),`trailer`))continue;let n=t.getObj();n instanceof L&&(h.push(n),n.has(`Encrypt`)&&(v=!0))}for(let e of[...h,`genFallback`,...h]){if(e===`genFallback`){if(!_)break;this._generationFallback=!0;continue}let t=!1;try{let n=e.get(`Root`);if(!(n instanceof L))continue;let r=n.get(`Pages`);if(!(r instanceof L))continue;let i=r.get(`Count`);Number.isInteger(i)&&(t=!0)}catch(e){_=e;continue}if(t&&(!v||e.has(`Encrypt`))&&e.has(`ID`))return e;g=e}if(g)return g;if(this.topDict)return this.topDict;if(!h.length)for(let e in this.entries){if(!Object.hasOwn(this.entries,e))continue;let t=this.entries[e],n=R.get(parseInt(e),t.gen),r;try{r=this.fetch(n)}catch{continue}if(r instanceof tr&&(r=r.dict),r instanceof L&&r.has(`Root`))return r}throw new Sn(`Invalid PDF structure.`)}readXRef(e=!1){let t=this.stream,n=new Set;for(;this.startXRefQueue.length;){try{let e=this.startXRefQueue[0];if(n.has(e)){N(`readXRef - skipping XRef table since it was already parsed.`),this.startXRefQueue.shift();continue}n.add(e),t.pos=e+t.start;let r=new uo({lexer:new mo(t),xref:this,allowStreams:!0}),i,a=r.getObj();if(Qn(a,`xref`))i=this.processXRefTable(r),this.topDict||=i,a=i.get(`XRefStm`),Number.isInteger(a)&&!this._xrefStms.has(a)&&(this._xrefStms.add(a),this.startXRefQueue.push(a));else{if(!Number.isInteger(a))throw new F(`Invalid XRef stream header`);if(!(Number.isInteger(r.getObj())&&Qn(r.getObj(),`obj`)&&(a=r.getObj())instanceof tr))throw new F(`Invalid XRef stream`);if(i=this.processXRefStream(a),this.topDict||=i,!i)throw new F(`Failed to read XRef stream`)}a=i.get(`Prev`),Number.isInteger(a)?this.startXRefQueue.push(a):a instanceof R&&this.startXRefQueue.push(a.num)}catch(e){if(e instanceof cr)throw e;hn(`(while reading XRef): `+e)}this.startXRefQueue.shift()}if(this.topDict)return this.topDict;if(!e)throw new dr}getEntry(e){let t=this.entries[e];return t&&!t.free&&t.offset?t:null}fetchIfRef(e,t=!1){return e instanceof R?this.fetch(e,t):e}fetch(e,t=!1){if(!(e instanceof R))throw Error(`ref object is not a reference`);let n=e.num,r=this._cacheMap.get(n);if(r!==void 0)return r instanceof L&&!r.objId&&(r.objId=e.toString()),r;let i=this.getEntry(n);if(i===null)return i;if(this._pendingRefs.has(e))return this._pendingRefs.remove(e),N(`Ignoring circular reference: ${e}.`),Hn;this._pendingRefs.put(e);try{i=i.uncompressed?this.fetchUncompressed(e,i,t):this.fetchCompressed(e,i,t),this._pendingRefs.remove(e)}catch(t){throw this._pendingRefs.remove(e),t}return i instanceof L?i.objId=e.toString():i instanceof tr&&(i.dict.objId=e.toString()),i}fetchUncompressed(e,t,n=!1){let r=e.gen,i=e.num;if(t.gen!==r){let a=`Inconsistent generation in XRef: ${e}`;if(this._generationFallback&&t.gen<r)return N(a),this.fetchUncompressed(R.get(i,t.gen),t,n);throw new ur(a)}let a=new uo({lexer:new mo(this.stream.makeSubStream(t.offset+this.stream.start)),xref:this,allowStreams:!0}),o=a.getObj(),s=a.getObj(),c=a.getObj();if(o!==i||s!==r||!(c instanceof qn))throw new ur(`Bad (uncompressed) XRef entry: ${e}`);if(c.cmd!==`obj`){if(c.cmd.startsWith(`obj`)&&(i=parseInt(c.cmd.substring(3),10),!Number.isNaN(i)))return i;throw new ur(`Bad (uncompressed) XRef entry: ${e}`)}return(t=this.encrypt&&!n?a.getObj(this.encrypt.createCipherTransform(i,r)):a.getObj())instanceof tr||this._cacheMap.set(i,t),t}fetchCompressed(e,t,n=!1){let r=t.offset,i=this.fetch(R.get(r,0));if(!(i instanceof tr))throw new F(`bad ObjStm stream`);let a=i.dict.get(`First`),o=i.dict.get(`N`);if(!Number.isInteger(a)||!Number.isInteger(o))throw new F(`invalid first and n parameters for ObjStm stream`);let s=new uo({lexer:new mo(i),xref:this,allowStreams:!0}),c=Array(o),l=Array(o);for(let e=0;e<o;++e){let t=s.getObj();if(!Number.isInteger(t))throw new F(`invalid object number in the ObjStm stream: ${t}`);let n=s.getObj();if(!Number.isInteger(n))throw new F(`invalid object offset in the ObjStm stream: ${n}`);c[e]=t;let i=this.getEntry(t);i?.offset===r&&i.gen!==e&&(i.gen=e),l[e]=n}let u=(i.start||0)+a,d=Array(o);for(let e=0;e<o;++e){let t=e<o-1?l[e+1]-l[e]:void 0;if(t<0)throw new F(`Invalid offset in the ObjStm stream.`);s=new uo({lexer:new mo(i.makeSubStream(u+l[e],t,i.dict)),xref:this,allowStreams:!0});let n=s.getObj();if(d[e]=n,n instanceof tr)continue;let a=c[e],f=this.entries[a];f&&f.offset===r&&f.gen===e&&this._cacheMap.set(a,n)}if((t=d[t.gen])===void 0)throw new ur(`Bad (compressed) XRef entry: ${e}`);return t}async fetchIfRefAsync(e,t){return e instanceof R?this.fetchAsync(e,t):e}async fetchAsync(e,t){try{return this.fetch(e,t)}catch(n){if(!(n instanceof cr))throw n;return await this.pdfManager.requestRange(n.begin,n.end),this.fetchAsync(e,t)}}getCatalogObj(){return this.root}},BS=[0,0,612,792],VS=class{#e=!1;#t=null;constructor({pdfManager:e,xref:t,pageIndex:n,pageDict:r,ref:i,globalIdFactory:a,fontCache:o,builtInCMapCache:s,standardFontDataCache:c,globalColorSpaceCache:l,globalImageCache:u,systemFontCache:d,nonBlendModesSet:f,xfaFactory:p}){this.pdfManager=e,this.pageIndex=n,this.pageDict=r,this.xref=t,this.ref=i,this.fontCache=o,this.builtInCMapCache=s,this.standardFontDataCache=c,this.globalColorSpaceCache=l,this.globalImageCache=u,this.systemFontCache=d,this.nonBlendModesSet=f,this.evaluatorOptions=e.evaluatorOptions,this.xfaFactory=p;let m={obj:0};this._localIdFactory=class extends a{static createObjId(){return`p${n}_${++m.obj}`}static getPageObjId(){return`p${i.toString()}`}}}#n(e){return new bd({xref:this.xref,handler:e,pageIndex:this.pageIndex,idFactory:this._localIdFactory,fontCache:this.fontCache,builtInCMapCache:this.builtInCMapCache,standardFontDataCache:this.standardFontDataCache,globalColorSpaceCache:this.globalColorSpaceCache,globalImageCache:this.globalImageCache,systemFontCache:this.systemFontCache,options:this.evaluatorOptions})}#r(e,t=!1){let n=mr({dict:this.pageDict,key:e,getArray:t,stopWhenFound:!1});return Array.isArray(n)?n.length!==1&&n[0]instanceof L?L.merge({xref:this.xref,dictArray:n}):n[0]:n}get content(){return this.pageDict.getArray(`Contents`)}get resources(){let e=this.#r(`Resources`);return P(this,`resources`,e instanceof L?e:L.empty)}#i(e){if(this.xfaData)return this.xfaData.bbox;let t=Er(this.#r(e,!0),null);if(t){if(t[2]-t[0]>0&&t[3]-t[1]>0)return t;N(`Empty, or invalid, /${e} entry.`)}return null}get mediaBox(){return P(this,`mediaBox`,this.#i(`MediaBox`)||BS)}get cropBox(){return P(this,`cropBox`,this.#i(`CropBox`)||this.mediaBox)}get userUnit(){let e=this.pageDict.get(`UserUnit`);return P(this,`userUnit`,typeof e==`number`&&e>0?e:1)}get view(){let{cropBox:e,mediaBox:t}=this;if(e!==t&&!In(e,t)){let n=jn.intersect(e,t);if(n&&n[2]-n[0]>0&&n[3]-n[1]>0)return P(this,`view`,n);N(`Empty /CropBox and /MediaBox intersection.`)}return P(this,`view`,t)}get rotate(){let e=this.#r(`Rotate`)||0;return e%90==0?e>=360?e%=360:e<0&&(e=(e%360+360)%360):e=0,P(this,`rotate`,e)}#a(e,t){if(!this.evaluatorOptions.ignoreErrors)throw e;N(`getContentStream - ignoring sub-stream (${t}): "${e}".`)}async getContentStream(){let e=await this.pdfManager.ensure(this,`content`);return e instanceof tr?e:Array.isArray(e)?new Ei(e,this.#a.bind(this)):new vi}get xfaData(){return P(this,`xfaData`,this.xfaFactory?{bbox:this.xfaFactory.getBoundingBox(this.pageIndex)}:null)}async#o(e,t,n){let r=[];for(let i of e)if(i.id){let e=R.fromString(i.id);if(!e){N(`A non-linked annotation cannot be modified: ${i.id}`);continue}if(i.deleted){if(t.put(e,e),i.popupRef){let e=R.fromString(i.popupRef);e&&t.put(e,e)}continue}if(i.popup?.deleted){let e=R.fromString(i.popupRef);e&&t.put(e,e)}n?.put(e),i.ref=e,r.push(this.xref.fetchAsync(e).then(e=>{e instanceof L&&(i.oldAnnotation=e.clone())},()=>{N(`Cannot fetch \`oldAnnotation\` for: ${e}.`)})),delete i.id}await Promise.all(r)}async saveNewAnnotations(e,t,n,r,i){if(this.xfaFactory)throw Error(`XFA: Cannot save new annotations.`);let a=this.#n(e),o=new Xn,s=new Yn;await this.#o(n,o,s);let c=this.pageDict,l=this.annotations.filter(e=>!(e instanceof R&&o.has(e))),u=await Dx.saveNewAnnotations(a,t,n,r,i);for(let{ref:e}of u.annotations)e instanceof R&&!s.has(e)&&l.push(e);let d=c.clone();d.set(`Annots`,l),i.put(this.ref,{data:d});for(let e of o)i.put(e,{data:null})}async save(e,t,n,r){let i=this.#n(e),a=await this._parsedAnnotations,o=[];for(let e of a)o.push(e.save(i,t,n,r).catch(function(e){return N(`save - ignoring annotation data during "${t.name}" task: "${e}".`),null}));return Promise.all(o)}async loadResources(e){await(this.#t??=this.pdfManager.ensure(this,`resources`)),await pf.load(this.resources,e,this.xref)}async#s(e,t){let n=e?.get(`Resources`);return n instanceof L&&n.size?(await pf.load(n,t,this.xref),L.merge({xref:this.xref,dictArray:[n,this.resources],mergeSubDicts:!0})):this.resources}async getOperatorList({handler:e,sink:t,task:n,intent:r,cacheKey:i,annotationStorage:a=null,modifiedIds:l=null}){let p=this.getContentStream(),h=this.loadResources(ar),g=this.#n(e),_=(this.xfaFactory?null:zr(a))?.get(this.pageIndex),v=Promise.resolve(null),y=null;if(_){let e=this.pdfManager.ensureDoc(`annotationGlobals`),t,r=new Set;for(let{bitmapId:e,bitmap:t}of _)!e||t||r.has(e)||r.add(e);let{isOffscreenCanvasSupported:i}=this.evaluatorOptions;if(r.size>0){let e=_.slice();for(let[t,n]of a)t.startsWith(m)&&n.bitmap&&r.has(n.bitmapId)&&e.push(n);t=Dx.generateImages(e,this.xref,i)}else t=Dx.generateImages(_,this.xref,i);y=new Yn,v=Promise.all([e,this.#o(_,y,null)]).then(([e])=>e?Dx.printNewAnnotations(e,g,n,_,t):null)}let b=Promise.all([p,h]).then(async([a])=>{let o=await this.#s(a.dict,ar),s=new ra(r,t);return e.send(`StartRenderPage`,{transparency:g.hasBlendModes(o,this.nonBlendModesSet),pageIndex:this.pageIndex,cacheKey:i}),await g.getOperatorList({stream:a,task:n,resources:o,operatorList:s}),s}),[x,S,C]=await Promise.all([b,this._parsedAnnotations,v]);if(C){S=S.filter(e=>!(e.ref&&y.has(e.ref)));for(let e=0,t=C.length;e<t;e++){let n=C[e];if(n.refToReplace){let r=S.findIndex(e=>e.ref&&er(e.ref,n.refToReplace));r>=0&&(S.splice(r,1,n),C.splice(e--,1),t--)}}S=S.concat(C)}if(S.length===0||r&d)return x.flush(!0),{length:x.totalLength};let w=!!(r&u),T=!!(r&f),E=!!(r&o),D=!!(r&s),O=!!(r&c),k=[];for(let e of S)(E||D&&e.mustBeViewed(a,w)&&e.mustBeViewedWhenEditing(T,l)||O&&e.mustBePrinted(a))&&k.push(e.getOperatorList(g,n,r,a).catch(function(e){return N(`getOperatorList - ignoring annotation data during "${n.name}" task: "${e}".`),{opList:null,separateForm:!1,separateCanvas:!1}}));let ee=await Promise.all(k),A=!1,j=!1;for(let{opList:e,separateForm:t,separateCanvas:n}of ee)x.addOpList(e),A||=t,j||=n;return x.flush(!0,{form:A,canvas:j}),{length:x.totalLength}}async extractTextContent({handler:e,task:t,includeMarkedContent:n,disableNormalization:r,sink:i,intersector:a=null}){let o=this.getContentStream(),s=this.loadResources(or),c=this.pdfManager.ensureCatalog(`lang`),[l,,u]=await Promise.all([o,s,c]),d=await this.#s(l.dict,or);return this.#n(e).getTextContent({stream:l,task:t,resources:d,includeMarkedContent:n,disableNormalization:r,sink:i,viewBox:this.view,lang:u,intersector:a})}async getStructTree(){let e=await this.pdfManager.ensureCatalog(`structTreeRoot`);if(!e)return null;await this._parsedAnnotations;try{let t=await this.pdfManager.ensure(this,`_parseStructTree`,[e]);return await this.pdfManager.ensure(t,`serializable`)}catch(e){return N(`getStructTree: "${e}".`),null}}_parseStructTree(e){let t=new of(e,this.pageDict);return t.parse(this.ref),t}async getAnnotationsData(e,t,n){let r=await this._parsedAnnotations;if(r.length===0)return r;let i=[],a=[],l,u=!!(n&o),d=!!(n&s),f=!!(n&c),p=[];for(let n of r){let r=u||d&&n.viewable;(r||f&&n.printable)&&i.push(n.data),n.hasTextContent&&r?(l??=this.#n(e),a.push(n.extractTextContent(l,t,[-1/0,-1/0,1/0,1/0]).catch(function(e){N(`getAnnotationsData - ignoring textContent during "${t.name}" task: "${e}".`)}))):n.overlaysTextContent&&r&&p.push(n)}if(p.length>0){let n=new lS(p);a.push(this.extractTextContent({handler:e,task:t,includeMarkedContent:!1,disableNormalization:!1,sink:null,viewBox:this.view,lang:null,intersector:n}).then(()=>{n.setText()}))}return await Promise.all(a),i}get annotations(){let e=this.#r(`Annots`);return P(this,`annotations`,Array.isArray(e)?e:[])}get _parsedAnnotations(){let e=this.pdfManager.ensure(this,`annotations`).then(async e=>{if(e.length===0)return e;let[t,n]=await Promise.all([this.pdfManager.ensureDoc(`annotationGlobals`),this.pdfManager.ensureDoc(`fieldObjects`)]);if(!t)return[];let r=n?.orphanFields,i=[];for(let n of e)i.push(Dx.create(this.xref,n,t,this._localIdFactory,!1,r,null,this.ref).catch(function(e){return N(`_parsedAnnotations: "${e}".`),null}));let a=[],o,s;for(let e of await Promise.all(i))e&&(e instanceof Fx?(s||=[]).push(e):e instanceof Hx?(o||=[]).push(e):a.push(e));return s&&a.push(...s),o&&a.push(...o),a});return this.#e=!0,P(this,`_parsedAnnotations`,e)}get jsActions(){return P(this,`jsActions`,jr(this.xref,this.pageDict,xe))}async collectAnnotationsByType(e,t,n,r,i){let{pageIndex:a}=this;if(this.#e){let e=await this._parsedAnnotations;for(let{data:t}of e)n&&!n.has(t.annotationType)||(t.pageIndex=a,r.push(Promise.resolve(t)));return}let o=await this.pdfManager.ensure(this,`annotations`);for(let s of o)r.push(Dx.create(this.xref,s,i,this._localIdFactory,!1,null,n,this.ref).then(async n=>{if(!n)return null;if(n.data.pageIndex=a,n.hasTextContent&&n.viewable){let r=this.#n(e);await n.extractTextContent(r,t,[-1/0,-1/0,1/0,1/0])}return n.data}).catch(function(e){return N(`collectAnnotationsByType: "${e}".`),null}))}},HS=new Uint8Array([37,80,68,70,45]),US=new Uint8Array([115,116,97,114,116,120,114,101,102]),WS=new Uint8Array([101,110,100,111,98,106]);function GS(e,t,n=1024,r=!1){let i=t.length,a=e.peekBytes(n),o=a.length-i;if(o<=0)return!1;if(r){let n=i-1,r=a.length-1;for(;r>=n;){let o=0;for(;o<i&&a[r-o]===t[n-o];)o++;if(o>=i)return e.pos+=r-n,!0;r--}}else{let n=0;for(;n<=o;){let r=0;for(;r<i&&a[n+r]===t[r];)r++;if(r>=i)return e.pos+=n,!0;n++}}return!1}var KS=class{#e=new Map;#t=null;constructor(e,t){if(t.length<=0)throw new Sn(`The PDF file is empty, i.e. its size is zero bytes.`);this.pdfManager=e,this.stream=t,this.xref=new zS(t,e);let n={font:0};this._globalIdFactory=class{static getDocId(){return`g_${e.docId}`}static createFontId(){return`f`+ ++n.font}static createObjId(){gn("Abstract method `createObjId` called.")}static getPageObjId(){gn("Abstract method `getPageObjId` called.")}}}parse(e){this.xref.parse(e),this.catalog=new uf(this.pdfManager,this.xref)}get linearization(){let e=null;try{e=ho.create(this.stream)}catch(e){if(e instanceof cr)throw e;hn(e)}return P(this,`linearization`,e)}get startXRef(){let e=this.stream,t=0;if(this.linearization){if(e.reset(),GS(e,WS)){e.skip(6);let n=e.peekByte();for(;Sr(n);)e.pos++,n=e.peekByte();t=e.pos-e.start}}else{let n=1024,r=US.length,i=!1,a=e.end;for(;!i&&a>0;)a-=n-r,a<0&&(a=0),e.pos=a,i=GS(e,US,n,!0);if(i){let n;e.skip(9);do n=e.getByte();while(Sr(n));let r=``;for(;n>=32&&n<=57;)r+=String.fromCharCode(n),n=e.getByte();t=parseInt(r,10),isNaN(t)&&(t=0)}}return P(this,`startXRef`,t)}checkHeader(){let e=this.stream;if(e.reset(),!GS(e,HS))return;e.moveStart(),e.skip(HS.length);let t,n=``;for(;(t=e.getByte())>32&&n.length<7;)n+=String.fromCharCode(t);nr.test(n)?this.#t=n:N(`Invalid PDF header version: ${n}`)}parseStartXRef(){this.xref.setStartXRef(this.startXRef)}get numPages(){let e=0;return e=this.catalog.hasActualNumPages?this.catalog.numPages:this.xfaFactory?this.xfaFactory.getNumPages():this.linearization?this.linearization.numPages:this.catalog.numPages,P(this,`numPages`,e)}#n(e,t=0){return!!Array.isArray(e)&&e.every(e=>{if(!((e=this.xref.fetchIfRef(e))instanceof L))return!1;if(e.has(`Kids`))return++t>10?(N(`#hasOnlyDocumentSignatures: maximum recursion depth reached`),!1):this.#n(e.get(`Kids`),t);let n=Zn(e.get(`FT`),`Sig`),r=e.get(`Rect`),i=Array.isArray(r)&&r.every(e=>e===0);return n&&i})}#r(e,t,n=new Yn){if(Array.isArray(e))for(let r of e){if(r instanceof R){if(n.has(r))continue;n.put(r)}if(r=this.xref.fetchIfRef(r),!(r instanceof L))continue;if(r.has(`Kids`)){this.#r(r.get(`Kids`),t,n);continue}if(!Zn(r.get(`FT`),`Sig`))continue;let e=r.get(`V`);if(!(e instanceof L))continue;let i=e.get(`SubFilter`);i instanceof I&&t.add(i.name)}}get _xfaStreams(){let{acroForm:e}=this.catalog;if(!e)return null;let t=e.get(`XFA`),n=new Map([`xdp:xdp`,`template`,`datasets`,`config`,`connectionSet`,`localeSet`,`stylesheet`,`/xdp:xdp`].map(e=>[e,null]));if(t instanceof tr&&!t.isEmpty)return n.set(`xdp:xdp`,t),n;if(!Array.isArray(t)||t.length===0)return null;for(let e=0,r=t.length;e<r;e+=2){let i;if(i=e===0?`xdp:xdp`:e===r-2?`/xdp:xdp`:t[e],!n.has(i))continue;let a=this.xref.fetchIfRef(t[e+1]);a instanceof tr&&!a.isEmpty&&n.set(i,a)}return n}get xfaDatasets(){let e=this._xfaStreams;if(!e)return P(this,`xfaDatasets`,null);for(let t of[`datasets`,`xdp:xdp`]){let n=e.get(t);if(n)try{let e=Pn(n.getString());return P(this,`xfaDatasets`,new sS({[t]:e}))}catch{N(`XFA - Invalid utf-8 string.`);break}}return P(this,`xfaDatasets`,null)}get xfaData(){let e=this._xfaStreams;if(!e)return null;let t=Object.create(null);for(let[n,r]of e)if(r)try{t[n]=Pn(r.getString())}catch{return N(`XFA - Invalid utf-8 string.`),null}return t}get xfaFactory(){let e;return this.pdfManager.enableXfa&&this.catalog.needsRendering&&this.formInfo.hasXfa&&!this.formInfo.hasAcroForm&&(e=this.xfaData),P(this,`xfaFactory`,e?new Ex(e):null)}get isPureXfa(){return!!this.xfaFactory&&this.xfaFactory.isValid()}get htmlForXfa(){return this.xfaFactory?this.xfaFactory.getPages():null}async#i(){let e=await this.pdfManager.ensureCatalog(`xfaImages`);e&&this.xfaFactory.setImages(e)}async#a(e,t){let n=await this.pdfManager.ensureCatalog(`acroForm`);if(!n)return;let r=await n.getAsync(`DR`);if(!(r instanceof L))return;await pf.load(r,[`Font`],this.xref);let i=r.get(`Font`);if(!(i instanceof L))return;let a=Object.assign(Object.create(null),this.pdfManager.evaluatorOptions,{useSystemFonts:!1}),{builtInCMapCache:o,fontCache:s,standardFontDataCache:c}=this.catalog,l=new bd({xref:this.xref,handler:e,pageIndex:-1,idFactory:this._globalIdFactory,fontCache:s,builtInCMapCache:o,standardFontDataCache:c,options:a}),u=new ra,d=[],f={get font(){return d.at(-1)},set font(e){d.push(e)},clone(){return this}},p=(e,n,i)=>l.handleSetFont(r,[I.get(e),1],null,u,t,f,n,i).catch(e=>(N(`loadXfaFonts: "${e}".`),null)),m=[];for(let[e,t]of i){let n=t.get(`FontDescriptor`);if(!(n instanceof L))continue;let r=n.get(`FontFamily`);r=r.replaceAll(/[ ]+(\d)/g,`$1`);let i={fontFamily:r,fontWeight:n.get(`FontWeight`),italicAngle:-n.get(`ItalicAngle`)};Ir(i)&&m.push(p(e,null,i))}await Promise.all(m);let h=this.xfaFactory.setFonts(d);if(!h)return;a.ignoreErrors=!0,m.length=0,d.length=0;let g=new Set;for(let e of h)au(`${e}-Regular`)||g.add(e);g.size&&h.push(`PdfJS-Fallback`);for(let e of h)if(!g.has(e))for(let t of[{name:`Regular`,fontWeight:400,italicAngle:0},{name:`Bold`,fontWeight:700,italicAngle:0},{name:`Italic`,fontWeight:400,italicAngle:12},{name:`BoldItalic`,fontWeight:700,italicAngle:12}]){let n=`${e}-${t.name}`;m.push(p(n,ou(n),{fontFamily:e,fontWeight:t.fontWeight,italicAngle:t.italicAngle}))}await Promise.all(m),this.xfaFactory.appendFonts(d,g)}loadXfaResources(e,t){return Promise.all([this.#a(e,t).catch(()=>{}),this.#i()])}serializeXfaData(e){return this.xfaFactory?this.xfaFactory.serializeData(e):null}get version(){return this.catalog.version||this.#t}get formInfo(){let e={hasFields:!1,hasAcroForm:!1,hasXfa:!1,hasSignatures:!1},{acroForm:t}=this.catalog;if(!t)return P(this,`formInfo`,e);try{let n=t.get(`Fields`),r=Array.isArray(n)&&n.length>0;e.hasFields=r;let i=t.get(`XFA`);e.hasXfa=Array.isArray(i)&&i.length>0||i instanceof tr&&!i.isEmpty;let a=!!(1&t.get(`SigFlags`)),o=a&&this.#n(n);e.hasAcroForm=r&&!o,e.hasSignatures=a}catch(e){if(e instanceof cr)throw e;N(`Cannot fetch form information: "${e}".`)}return P(this,`formInfo`,e)}get documentInfo(){let{catalog:e,formInfo:t,xref:n}=this,r={PDFFormatVersion:this.version,Language:e.lang,EncryptFilterName:n.encrypt?.filterName??null,IsLinearized:!!this.linearization,IsAcroFormPresent:t.hasAcroForm,IsXFAPresent:t.hasXfa,IsCollectionPresent:!!e.collection,IsSignaturesPresent:t.hasSignatures},i;try{i=n.trailer.get(`Info`)}catch(e){if(e instanceof cr)throw e;hn(`The document information dictionary is invalid.`)}if(!(i instanceof L))return P(this,`documentInfo`,r);for(let[e,t]of i){switch(e){case`Title`:case`Author`:case`Subject`:case`Keywords`:case`Creator`:case`Producer`:case`CreationDate`:case`ModDate`:if(typeof t==`string`){r[e]=Nn(t);continue}break;case`Trapped`:if(t instanceof I){r[e]=t;continue}break;default:let n;switch(typeof t){case`string`:n=Nn(t);break;case`number`:case`boolean`:n=t;break;default:t instanceof I&&(n=t)}if(n===void 0){N(`Bad value, for custom key "${e}", in Info: ${t}.`);continue}r.Custom??=Object.create(null),r.Custom[e]=n;continue}N(`Bad value, for key "${e}", in Info: ${t}.`)}return P(this,`documentInfo`,r)}get fingerprints(){let e=`\0`.repeat(16);function t(t){return typeof t==`string`&&t.length===16&&t!==e}let n=this.xref.trailer.get(`ID`),r,i;return Array.isArray(n)&&t(n[0])?(r=En(n[0]),n[1]!==n[0]&&t(n[1])&&(i=En(n[1]))):r=iS(this.stream.getByteRange(0,1024),0,1024),P(this,`fingerprints`,[Vn(r),i?Vn(i):null])}async#o(e){let{catalog:t,linearization:n,xref:r}=this,i=R.get(n.objectNumberFirst,0);try{let e=await r.fetchAsync(i);if(e instanceof L){let n=e.getRaw(`Type`);if(n instanceof R&&(n=await r.fetchAsync(n)),Zn(n,`Page`)||!e.has(`Type`)&&!e.has(`Kids`)&&e.has(`Contents`))return t.pageKidsCountCache.has(i)||t.pageKidsCountCache.put(i,1),t.pageIndexCache.has(i)||t.pageIndexCache.put(i,0),[e,i]}throw new F(`The Linearization dictionary doesn't point to a valid Page dictionary.`)}catch(n){return N(`_getLinearizationPage: "${n.message}".`),t.getPageDict(e)}}getPage(e){let t=this.#e.get(e);if(t)return t;let{catalog:n,linearization:r,xfaFactory:i}=this,a;return a=i?Promise.resolve([L.empty,null]):r?.pageFirst===e?this.#o(e):n.getPageDict(e),a=a.then(([t,r])=>new VS({pdfManager:this.pdfManager,xref:this.xref,pageIndex:e,pageDict:t,ref:r,globalIdFactory:this._globalIdFactory,fontCache:n.fontCache,builtInCMapCache:n.builtInCMapCache,standardFontDataCache:n.standardFontDataCache,globalColorSpaceCache:n.globalColorSpaceCache,globalImageCache:n.globalImageCache,systemFontCache:n.systemFontCache,nonBlendModesSet:n.nonBlendModesSet,xfaFactory:i})),this.#e.set(e,a),a}async checkFirstPage(e=!1){if(!e)try{await this.getPage(0)}catch(e){if(e instanceof ur)throw this.#e.delete(0),await this.cleanup(),new dr}}async checkLastPage(e=!1){let{catalog:t,pdfManager:n}=this,r;t.setActualNumPages();try{if(await Promise.all([n.ensureDoc(`xfaFactory`),n.ensureDoc(`linearization`),n.ensureCatalog(`numPages`)]),this.xfaFactory)return;if(r=this.linearization?this.linearization.numPages:t.numPages,!Number.isInteger(r))throw new F(`Page count is not an integer.`);if(r<=1)return;await this.getPage(r-1)}catch(i){if(this.#e.delete(r-1),await this.cleanup(),i instanceof ur&&!e)throw new dr;let a;N(`checkLastPage - invalid /Pages tree /Count: ${r}.`);try{a=await t.getAllPageDicts(e)}catch(n){if(n instanceof ur&&!e)throw new dr;t.setActualNumPages(1);return}for(let[e,[r,i]]of a){let a;r instanceof Error?(a=Promise.reject(r),a.catch(()=>{})):a=Promise.resolve(new VS({pdfManager:n,xref:this.xref,pageIndex:e,pageDict:r,ref:i,globalIdFactory:this._globalIdFactory,fontCache:t.fontCache,builtInCMapCache:t.builtInCMapCache,standardFontDataCache:t.standardFontDataCache,globalColorSpaceCache:this.globalColorSpaceCache,globalImageCache:t.globalImageCache,systemFontCache:t.systemFontCache,nonBlendModesSet:t.nonBlendModesSet,xfaFactory:null})),this.#e.set(e,a)}t.setActualNumPages(a.size)}}async fontFallback(e,t){let{catalog:n,pdfManager:r}=this;for(let i of await Promise.all(n.fontCache))if(i.loadedName===e)return void i.fallback(t,r.evaluatorOptions)}async cleanup(e=!1){return this.catalog?this.catalog.cleanup(e):Id()}async#s(e,t,n,r,i,a,o){let{xref:s}=this;if(!(n instanceof R)||a.has(n))return;a.put(n);let c=await s.fetchAsync(n);if(!(c instanceof L))return;let l=await c.getAsync(`Subtype`);if(l=l instanceof I?l.name:null,l===`Link`)return;if(c.has(`T`)){let t=Nn(await c.getAsync(`T`));e=e===``?t:`${e}.${t}`}else{let n=c;for(;;){if(n=n.getRaw(`Parent`)||t,n instanceof R){if(a.has(n))break;n=await s.fetchAsync(n)}if(!(n instanceof L))break;if(n.has(`T`)){let t=Nn(await n.getAsync(`T`));e=e===``?t:`${e}.${t}`;break}}}if(t&&!c.has(`Parent`)&&Zn(c.get(`Subtype`),`Widget`)&&o.put(n,t),r.has(e)||r.set(e,[]),r.get(e).push(Dx.create(s,n,i,null,!0,o,null,null).then(e=>e?.getFieldObject()).catch(function(e){return N(`#collectFieldObjects: "${e}".`),null})),!c.has(`Kids`))return;let u=await c.getAsync(`Kids`);if(Array.isArray(u))for(let t of u)await this.#s(e,n,t,r,i,a,o)}get fieldObjects(){return P(this,`fieldObjects`,this.pdfManager.ensureDoc(`formInfo`).then(async e=>{if(!e.hasFields)return null;let t=await this.annotationGlobals;if(!t)return null;let{acroForm:n}=t,r=new Yn,i=Object.create(null),a=new Map,o=new Xn;for(let e of n.get(`Fields`))await this.#s(``,null,e,a,t,r,o);let s=[];for(let[e,t]of a)s.push(Promise.all(t).then(t=>{(t=t.filter(e=>!!e)).length>0&&(i[e]=t)}));return await Promise.all(s),{allFields:On(i)>0?i:null,orphanFields:o}}))}get hasJSActions(){return P(this,`hasJSActions`,this.pdfManager.ensureDoc(`_parseHasJSActions`))}async _parseHasJSActions(){let[e,t]=await Promise.all([this.pdfManager.ensureCatalog(`jsActions`),this.pdfManager.ensureDoc(`fieldObjects`)]);return!!e||!!t?.allFields&&Object.values(t.allFields).some(e=>e.some(e=>e.actions!==null))}get calculationOrderIds(){let e=this.catalog.acroForm?.get(`CO`);if(!Array.isArray(e)||e.length===0)return P(this,`calculationOrderIds`,null);let t=[];for(let n of e)n instanceof R&&t.push(n.toString());return P(this,`calculationOrderIds`,t.length?t:null)}get annotationGlobals(){return P(this,`annotationGlobals`,Dx.createGlobals(this.pdfManager))}},qS=class{constructor({docBaseUrl:e,docId:t,enableXfa:n,evaluatorOptions:r,handler:i,password:a}){this._docBaseUrl=function(e){if(e){let t=vn(e);if(t)return t.href;N(`Invalid absolute docBaseUrl: "${e}".`)}return null}(e),this._docId=t,this._password=a,this.enableXfa=n,r.isOffscreenCanvasSupported&&=kn.isOffscreenCanvasSupported,r.isImageDecoderSupported&&=kn.isImageDecoderSupported,this.evaluatorOptions=Object.freeze(r),Ci.setOptions(r),Xi.setOptions(r),ra.setOptions(r);let o={...r,handler:i};Qi.setOptions(o),mi.setOptions(o),hi.setOptions(o)}get docId(){return this._docId}get password(){return this._password}get docBaseUrl(){return this._docBaseUrl}ensureDoc(e,t){return this.ensure(this.pdfDocument,e,t)}ensureXRef(e,t){return this.ensure(this.pdfDocument.xref,e,t)}ensureCatalog(e,t){return this.ensure(this.pdfDocument.catalog,e,t)}getPage(e){return this.pdfDocument.getPage(e)}fontFallback(e,t){return this.pdfDocument.fontFallback(e,t)}cleanup(e=!1){return this.pdfDocument.cleanup(e)}async ensure(e,t,n){gn("Abstract method `ensure` called")}requestRange(e,t){gn("Abstract method `requestRange` called")}requestLoadedStream(e=!1){gn("Abstract method `requestLoadedStream` called")}sendProgressiveData(e){gn("Abstract method `sendProgressiveData` called")}updatePassword(e){this._password=e}terminate(e){gn("Abstract method `terminate` called")}},JS=class extends qS{constructor(e){super(e);let t=new gi(e.source);this.pdfDocument=new KS(this,t),this._loadedStreamPromise=Promise.resolve(t)}async ensure(e,t,n){let r=e[t];return typeof r==`function`?r.apply(e,n):r}requestRange(e,t){return Promise.resolve()}requestLoadedStream(e=!1){return this._loadedStreamPromise}terminate(e){}},YS=class extends qS{constructor(e){super(e),this.streamManager=new bi(e.source,{msgHandler:e.handler,length:e.length,disableAutoFetch:e.disableAutoFetch,rangeChunkSize:e.rangeChunkSize}),this.pdfDocument=new KS(this,this.streamManager.getStream())}async ensure(e,t,n){try{let r=e[t];return typeof r==`function`?r.apply(e,n):r}catch(r){if(!(r instanceof cr))throw r;return await this.requestRange(r.begin,r.end),this.ensure(e,t,n)}}requestRange(e,t){return this.streamManager.requestRange(e,t)}requestLoadedStream(e=!1){return this.streamManager.requestAllChunks(e)}sendProgressiveData(e){this.streamManager.onReceiveData({chunk:e})}terminate(e){this.streamManager.abort(e)}},XS=1,ZS=2,QS=1,$S=2,eC=3,tC=4,nC=5,rC=6,iC=7,aC=8;function oC(){}function sC(e){if(e instanceof wn||e instanceof Sn||e instanceof bn||e instanceof Cn||e instanceof xn)return e;switch(e instanceof Error||typeof e==`object`&&e||gn(`wrapReason: Expected "reason" to be a (possibly cloned) Error.`),e.name){case`AbortException`:return new wn(e.message);case`InvalidPDFException`:return new Sn(e.message);case`PasswordException`:return new bn(e.message,e.code);case`ResponseException`:return new Cn(e.message,e.status,e.missing);case`UnknownErrorException`:return new xn(e.message,e.details)}return new xn(e.message,e.toString())}var cC=class{#e=new AbortController;constructor(e,t,n){this.sourceName=e,this.targetName=t,this.comObj=n,this.callbackId=1,this.streamId=1,this.streamSinks=Object.create(null),this.streamControllers=Object.create(null),this.callbackCapabilities=Object.create(null),this.actionHandler=Object.create(null),n.addEventListener(`message`,this.#t.bind(this),{signal:this.#e.signal})}#t({data:e}){if(e.targetName!==this.sourceName)return;if(e.stream)return void this.#r(e);if(e.callback){let t=e.callbackId,n=this.callbackCapabilities[t];if(!n)throw Error(`Cannot resolve callback ${t}`);if(delete this.callbackCapabilities[t],e.callback===XS)n.resolve(e.data);else{if(e.callback!==ZS)throw Error(`Unexpected callback case`);n.reject(sC(e.reason))}return}let t=this.actionHandler[e.action];if(!t)throw Error(`Unknown action from worker: ${e.action}`);if(e.callbackId){let n=this.sourceName,r=e.sourceName,i=this.comObj;Promise.try(t,e.data).then(function(t){i.postMessage({sourceName:n,targetName:r,callback:XS,callbackId:e.callbackId,data:t})},function(t){i.postMessage({sourceName:n,targetName:r,callback:ZS,callbackId:e.callbackId,reason:sC(t)})});return}e.streamId?this.#n(e):t(e.data)}on(e,t){let n=this.actionHandler;if(n[e])throw Error(`There is already an actionName called "${e}"`);n[e]=t}send(e,t,n){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,data:t},n)}sendWithPromise(e,t,n){let r=this.callbackId++,i=Promise.withResolvers();this.callbackCapabilities[r]=i;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,callbackId:r,data:t},n)}catch(e){i.reject(e)}return i.promise}sendWithStream(e,t,n,r){let i=this.streamId++,a=this.sourceName,o=this.targetName,s=this.comObj;return new ReadableStream({start:n=>{let c=Promise.withResolvers();return this.streamControllers[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.streamControllers[i].pullCall=t,s.postMessage({sourceName:a,targetName:o,stream:rC,streamId:i,desiredSize:e.desiredSize}),t.promise},cancel:e=>{_n(e instanceof Error,`cancel must have a valid reason`);let t=Promise.withResolvers();return this.streamControllers[i].cancelCall=t,this.streamControllers[i].isClosed=!0,s.postMessage({sourceName:a,targetName:o,stream:QS,streamId:i,reason:sC(e)}),t.promise}},n)}#n(e){let t=e.streamId,n=this.sourceName,r=e.sourceName,i=this.comObj,a=this,o=this.actionHandler[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:tC,streamId:t,chunk:e},o)},close(){this.isCancelled||(this.isCancelled=!0,i.postMessage({sourceName:n,targetName:r,stream:eC,streamId:t}),delete a.streamSinks[t])},error(e){_n(e instanceof Error,`error must have a valid reason`),this.isCancelled||(this.isCancelled=!0,i.postMessage({sourceName:n,targetName:r,stream:nC,streamId:t,reason:sC(e)}))},sinkCapability:Promise.withResolvers(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:e.desiredSize,ready:null};s.sinkCapability.resolve(),s.ready=s.sinkCapability.promise,this.streamSinks[t]=s,Promise.try(o,e.data,s).then(function(){i.postMessage({sourceName:n,targetName:r,stream:aC,streamId:t,success:!0})},function(e){i.postMessage({sourceName:n,targetName:r,stream:aC,streamId:t,reason:sC(e)})})}#r(e){let t=e.streamId,n=this.sourceName,r=e.sourceName,i=this.comObj,a=this.streamControllers[t],o=this.streamSinks[t];switch(e.stream){case aC:e.success?a.startCall.resolve():a.startCall.reject(sC(e.reason));break;case iC:e.success?a.pullCall.resolve():a.pullCall.reject(sC(e.reason));break;case rC:if(!o){i.postMessage({sourceName:n,targetName:r,stream:iC,streamId:t,success:!0});break}o.desiredSize<=0&&e.desiredSize>0&&o.sinkCapability.resolve(),o.desiredSize=e.desiredSize,Promise.try(o.onPull||oC).then(function(){i.postMessage({sourceName:n,targetName:r,stream:iC,streamId:t,success:!0})},function(e){i.postMessage({sourceName:n,targetName:r,stream:iC,streamId:t,reason:sC(e)})});break;case tC:if(_n(a,`enqueue should have stream controller`),a.isClosed)break;a.controller.enqueue(e.chunk);break;case eC:if(_n(a,`close should have stream controller`),a.isClosed)break;a.isClosed=!0,a.controller.close(),this.#i(a,t);break;case nC:_n(a,`error should have stream controller`),a.controller.error(sC(e.reason)),this.#i(a,t);break;case $S:e.success?a.cancelCall.resolve():a.cancelCall.reject(sC(e.reason)),this.#i(a,t);break;case QS:if(!o)break;let s=sC(e.reason);Promise.try(o.onCancel||oC,s).then(function(){i.postMessage({sourceName:n,targetName:r,stream:$S,streamId:t,success:!0})},function(e){i.postMessage({sourceName:n,targetName:r,stream:$S,streamId:t,reason:sC(e)})}),o.sinkCapability.reject(s),o.isCancelled=!0,delete this.streamSinks[t];break;default:throw Error(`Unexpected stream case`)}}async#i(e,t){await Promise.allSettled([e.startCall?.promise,e.pullCall?.promise,e.cancelCall?.promise]),delete this.streamControllers[t]}destroy(){this.#e?.abort(),this.#e=null}};async function lC(e,t,n,{encrypt:r=null}){let i=r?.createCipherTransform(e.num,e.gen);n.push(`${e.num} ${e.gen} obj\n`),t instanceof L?await uC(t,n,i):t instanceof tr?await dC(t,n,i):(Array.isArray(t)||ArrayBuffer.isView(t))&&await fC(t,n,i),n.push(`
30
+ `),l=new L(t);l.set(`FormType`,1),l.setIfName(`Subtype`,`Form`),l.setIfName(`Type`,`XObject`),l.set(`BBox`,i),l.set(`Length`,c.length);let u=new _i(c);return u.dict=l,u}static async createNewAppearanceStream(e,t,n){if(e.oldAnnotation)return null;if(e.isSignature)return this.#t(e,t);let{rotation:r}=e,{imageRef:i,width:a,height:o}=n.image,s=new L(t),c=new L(t);s.set(`XObject`,c),c.set(`Im0`,i);let l=`q ${a} 0 0 ${o} 0 0 cm /Im0 Do Q`,u=new L(t);if(u.set(`FormType`,1),u.setIfName(`Subtype`,`Form`),u.setIfName(`Type`,`XObject`),u.set(`BBox`,[0,0,a,o]),u.set(`Resources`,s),r){let e=Ur(r,a,o);u.set(`Matrix`,e)}let d=new _i(l);return d.dict=u,d}},nS=class extends Px{constructor(e){super(e);let{dict:t,xref:n}=e,r=new Rd(t.get(`FS`),n);this.data.annotationType=E.FILEATTACHMENT,this.data.hasOwnCanvas=this.data.noRotate,this.data.noHTML=!1,this.data.file=r.serializable;let i=t.get(`Name`);this.data.name=i instanceof I?Nn(i.name):`PushPin`;let a=t.get(`ca`);this.data.fillAlpha=typeof a==`number`&&a>=0&&a<=1?a:null}},rS={get r(){return P(this,`r`,new Uint8Array([7,12,17,22,7,12,17,22,7,12,17,22,7,12,17,22,5,9,14,20,5,9,14,20,5,9,14,20,5,9,14,20,4,11,16,23,4,11,16,23,4,11,16,23,4,11,16,23,6,10,15,21,6,10,15,21,6,10,15,21,6,10,15,21]))},get k(){return P(this,`k`,new Int32Array([-680876936,-389564586,606105819,-1044525330,-176418897,1200080426,-1473231341,-45705983,1770035416,-1958414417,-42063,-1990404162,1804603682,-40341101,-1502002290,1236535329,-165796510,-1069501632,643717713,-373897302,-701558691,38016083,-660478335,-405537848,568446438,-1019803690,-187363961,1163531501,-1444681467,-51403784,1735328473,-1926607734,-378558,-2022574463,1839030562,-35309556,-1530992060,1272893353,-155497632,-1094730640,681279174,-358537222,-722521979,76029189,-640364487,-421815835,530742520,-995338651,-198630844,1126891415,-1416354905,-57434055,1700485571,-1894986606,-1051523,-2054922799,1873313359,-30611744,-1560198380,1309151649,-145523070,-1120210379,718787259,-343485551]))}};function iS(e,t,n){let r=1732584193,i=-271733879,a=-1732584194,o=271733878,s=n+72&-64,c=new Uint8Array(s),l,u;for(l=0;l<n;++l)c[l]=e[t++];c[l++]=128;let d=s-8;l<d&&(l=d),c[l++]=n<<3&255,c[l++]=n>>5&255,c[l++]=n>>13&255,c[l++]=n>>21&255,c[l++]=n>>>29&255,l+=3;let f=new Int32Array(16),{k:p,r:m}=rS;for(l=0;l<s;){for(u=0;u<16;++u,l+=4)f[u]=c[l]|c[l+1]<<8|c[l+2]<<16|c[l+3]<<24;let e,t,n=r,s=i,d=a,h=o;for(u=0;u<64;++u){u<16?(e=s&d|~s&h,t=u):u<32?(e=h&s|~h&d,t=5*u+1&15):u<48?(e=s^d^h,t=3*u+5&15):(e=d^(s|~h),t=7*u&15);let r=h,i=n+e+p[u]+f[t]|0,a=m[u];h=d,d=s,s=s+(i<<a|i>>>32-a)|0,n=r}r=r+n|0,i=i+s|0,a=a+d|0,o=o+h|0}return new Uint8Array([255&r,r>>8&255,r>>16&255,r>>>24&255,255&i,i>>8&255,i>>16&255,i>>>24&255,255&a,a>>8&255,a>>16&255,a>>>24&255,255&o,o>>8&255,o>>16&255,o>>>24&255])}function aS(e){try{return Pn(e)}catch(t){return N(`UTF-8 decoding failed: "${t}".`),e}}var oS=class extends Yd{constructor(e){super(e),this.node=null}onEndElement(e){let t=super.onEndElement(e);if(t&&e===`xfa:datasets`)throw this.node=t,Error(`Aborting DatasetXMLParser.`)}},sS=class{constructor(e){if(e.datasets)this.node=new Yd({hasAttributes:!0}).parseFromString(e.datasets).documentElement;else{let t=new oS({hasAttributes:!0});try{t.parseFromString(e[`xdp:xdp`])}catch{}this.node=t.node}}getValue(e){if(!this.node||!e)return``;let t=this.node.searchNode(Dr(e),0);return t?t.firstChild?.nodeName===`value`?t.children.map(e=>aS(e.textContent)):aS(t.textContent):``}},cS=class{#e;#t=1/0;#n=1/0;#r=-1/0;#i=-1/0;#a=null;#o=[];#s=[];#c=-1;#l=!1;constructor(e){this.#e=e;let t=e.data.quadPoints;if(t){for(let e=0,n=t.length;e<n;e+=8)this.#t=Math.min(this.#t,t[e]),this.#r=Math.max(this.#r,t[e+2]),this.#n=Math.min(this.#n,t[e+5]),this.#i=Math.max(this.#i,t[e+1]);t.length>8&&(this.#a=t)}else [this.#t,this.#n,this.#r,this.#i]=e.data.rect}overlaps(e){return!(this.#t>=e.#r||this.#r<=e.#t||this.#n>=e.#i||this.#i<=e.#n)}#u(e,t){if(this.#t>=e||this.#r<=e||this.#n>=t||this.#i<=t)return!1;let n=this.#a;if(!n)return!0;if(this.#c>=0){let r=this.#c;if(!(n[r]>=e||n[r+2]<=e||n[r+5]>=t||n[r+1]<=t))return!0;this.#c=-1}for(let r=0,i=n.length;r<i;r+=8)if(!(n[r]>=e||n[r+2]<=e||n[r+5]>=t||n[r+1]<=t))return this.#c=r,!0;return!1}addGlyph(e,t,n){return this.#u(e,t)?(this.#s.length>0&&(this.#o.push(this.#s.join(``)),this.#s.length=0),this.#o.push(n),this.#l=!0,!0):(this.disableExtraChars(),!1)}addExtraChar(e){this.#l&&this.#s.push(e)}disableExtraChars(){this.#l&&(this.#l=!1,this.#s.length=0)}setText(){this.#e.data.overlaidText=this.#o.join(``)}},lS=class{#e=new Map;constructor(e){for(let t of e){if(!t.data.quadPoints&&!t.data.rect)continue;let e=new cS(t);for(let[t,n]of this.#e)t.overlaps(e)&&(n?n.add(e):this.#e.set(t,new Set([e])));this.#e.set(e,null)}}addGlyph(e,t,n,r){let i=e[4]+t/2,a=e[5]+n/2,o;for(let[e,t]of this.#e)o?o.has(e)?e.addGlyph(i,a,r):e.disableExtraChars():e.addGlyph(i,a,r)&&(o=t)}addExtraChar(e){for(let t of this.#e.keys())t.addExtraChar(e)}setText(){for(let e of this.#e.keys())e.setText()}},Z=class{constructor(e,t){this.high=0|e,this.low=0|t}and(e){this.high&=e.high,this.low&=e.low}xor(e){this.high^=e.high,this.low^=e.low}shiftRight(e){e>=32?(this.low=this.high>>>e-32|0,this.high=0):(this.low=this.low>>>e|this.high<<32-e,this.high=this.high>>>e|0)}rotateRight(e){let t,n;32&e?(n=this.low,t=this.high):(t=this.low,n=this.high),e&=31,this.low=t>>>e|n<<32-e,this.high=n>>>e|t<<32-e}not(){this.high=~this.high,this.low=~this.low}add(e){let t=(this.low>>>0)+(e.low>>>0),n=(this.high>>>0)+(e.high>>>0);t>4294967295&&(n+=1),this.low=0|t,this.high=0|n}copyTo(e,t){e[t]=this.high>>>24&255,e[t+1]=this.high>>16&255,e[t+2]=this.high>>8&255,e[t+3]=255&this.high,e[t+4]=this.low>>>24&255,e[t+5]=this.low>>16&255,e[t+6]=this.low>>8&255,e[t+7]=255&this.low}assign(e){this.high=e.high,this.low=e.low}},uS={get k(){return P(this,`k`,[new Z(1116352408,3609767458),new Z(1899447441,602891725),new Z(3049323471,3964484399),new Z(3921009573,2173295548),new Z(961987163,4081628472),new Z(1508970993,3053834265),new Z(2453635748,2937671579),new Z(2870763221,3664609560),new Z(3624381080,2734883394),new Z(310598401,1164996542),new Z(607225278,1323610764),new Z(1426881987,3590304994),new Z(1925078388,4068182383),new Z(2162078206,991336113),new Z(2614888103,633803317),new Z(3248222580,3479774868),new Z(3835390401,2666613458),new Z(4022224774,944711139),new Z(264347078,2341262773),new Z(604807628,2007800933),new Z(770255983,1495990901),new Z(1249150122,1856431235),new Z(1555081692,3175218132),new Z(1996064986,2198950837),new Z(2554220882,3999719339),new Z(2821834349,766784016),new Z(2952996808,2566594879),new Z(3210313671,3203337956),new Z(3336571891,1034457026),new Z(3584528711,2466948901),new Z(113926993,3758326383),new Z(338241895,168717936),new Z(666307205,1188179964),new Z(773529912,1546045734),new Z(1294757372,1522805485),new Z(1396182291,2643833823),new Z(1695183700,2343527390),new Z(1986661051,1014477480),new Z(2177026350,1206759142),new Z(2456956037,344077627),new Z(2730485921,1290863460),new Z(2820302411,3158454273),new Z(3259730800,3505952657),new Z(3345764771,106217008),new Z(3516065817,3606008344),new Z(3600352804,1432725776),new Z(4094571909,1467031594),new Z(275423344,851169720),new Z(430227734,3100823752),new Z(506948616,1363258195),new Z(659060556,3750685593),new Z(883997877,3785050280),new Z(958139571,3318307427),new Z(1322822218,3812723403),new Z(1537002063,2003034995),new Z(1747873779,3602036899),new Z(1955562222,1575990012),new Z(2024104815,1125592928),new Z(2227730452,2716904306),new Z(2361852424,442776044),new Z(2428436474,593698344),new Z(2756734187,3733110249),new Z(3204031479,2999351573),new Z(3329325298,3815920427),new Z(3391569614,3928383900),new Z(3515267271,566280711),new Z(3940187606,3454069534),new Z(4118630271,4000239992),new Z(116418474,1914138554),new Z(174292421,2731055270),new Z(289380356,3203993006),new Z(460393269,320620315),new Z(685471733,587496836),new Z(852142971,1086792851),new Z(1017036298,365543100),new Z(1126000580,2618297676),new Z(1288033470,3409855158),new Z(1501505948,4234509866),new Z(1607167915,987167468),new Z(1816402316,1246189591)])}};function dS(e,t,n,r,i){e.assign(t),e.and(n),i.assign(t),i.not(),i.and(r),e.xor(i)}function fS(e,t,n,r,i){e.assign(t),e.and(n),i.assign(t),i.and(r),e.xor(i),i.assign(n),i.and(r),e.xor(i)}function pS(e,t,n){e.assign(t),e.rotateRight(28),n.assign(t),n.rotateRight(34),e.xor(n),n.assign(t),n.rotateRight(39),e.xor(n)}function mS(e,t,n){e.assign(t),e.rotateRight(14),n.assign(t),n.rotateRight(18),e.xor(n),n.assign(t),n.rotateRight(41),e.xor(n)}function hS(e,t,n){e.assign(t),e.rotateRight(1),n.assign(t),n.rotateRight(8),e.xor(n),n.assign(t),n.shiftRight(7),e.xor(n)}function gS(e,t,n){e.assign(t),e.rotateRight(19),n.assign(t),n.rotateRight(61),e.xor(n),n.assign(t),n.shiftRight(6),e.xor(n)}function _S(e,t,n,r=!1){let i,a,o,s,c,l,u,d;r?(i=new Z(3418070365,3238371032),a=new Z(1654270250,914150663),o=new Z(2438529370,812702999),s=new Z(355462360,4144912697),c=new Z(1731405415,4290775857),l=new Z(2394180231,1750603025),u=new Z(3675008525,1694076839),d=new Z(1203062813,3204075428)):(i=new Z(1779033703,4089235720),a=new Z(3144134277,2227873595),o=new Z(1013904242,4271175723),s=new Z(2773480762,1595750129),c=new Z(1359893119,2917565137),l=new Z(2600822924,725511199),u=new Z(528734635,4215389547),d=new Z(1541459225,327033209));let f=128*Math.ceil((n+17)/128),p=new Uint8Array(f),m,h;for(m=0;m<n;++m)p[m]=e[t++];p[m++]=128;let g=f-16;m<g&&(m=g),m+=11,p[m++]=n>>>29&255,p[m++]=n>>21&255,p[m++]=n>>13&255,p[m++]=n>>5&255,p[m++]=n<<3&255;let _=Array(80);for(m=0;m<80;m++)_[m]=new Z(0,0);let{k:v}=uS,y=new Z(0,0),b=new Z(0,0),x=new Z(0,0),S=new Z(0,0),C=new Z(0,0),w=new Z(0,0),T=new Z(0,0),E=new Z(0,0),D=new Z(0,0),O=new Z(0,0),k=new Z(0,0),ee=new Z(0,0),A,j;for(m=0;m<f;){for(h=0;h<16;++h)_[h].high=p[m]<<24|p[m+1]<<16|p[m+2]<<8|p[m+3],_[h].low=p[m+4]<<24|p[m+5]<<16|p[m+6]<<8|p[m+7],m+=8;for(h=16;h<80;++h)A=_[h],gS(A,_[h-2],ee),A.add(_[h-7]),hS(k,_[h-15],ee),A.add(k),A.add(_[h-16]);for(y.assign(i),b.assign(a),x.assign(o),S.assign(s),C.assign(c),w.assign(l),T.assign(u),E.assign(d),h=0;h<80;++h)D.assign(E),mS(k,C,ee),D.add(k),dS(k,C,w,T,ee),D.add(k),D.add(v[h]),D.add(_[h]),pS(O,y,ee),fS(k,y,b,x,ee),O.add(k),A=E,E=T,T=w,w=C,S.add(D),C=S,S=x,x=b,b=y,A.assign(D),A.add(O),y=A;i.add(y),a.add(b),o.add(x),s.add(S),c.add(C),l.add(w),u.add(T),d.add(E)}return r?(j=new Uint8Array(48),i.copyTo(j,0),a.copyTo(j,8),o.copyTo(j,16),s.copyTo(j,24),c.copyTo(j,32),l.copyTo(j,40)):(j=new Uint8Array(64),i.copyTo(j,0),a.copyTo(j,8),o.copyTo(j,16),s.copyTo(j,24),c.copyTo(j,32),l.copyTo(j,40),u.copyTo(j,48),d.copyTo(j,56)),j}function vS(e,t,n){return _S(e,t,n,!0)}var yS={get k(){return P(this,`k`,[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298])}};function bS(e,t){return e>>>t|e<<32-t}function xS(e,t,n){return e&t^~e&n}function SS(e,t,n){return e&t^e&n^t&n}function CS(e){return bS(e,2)^bS(e,13)^bS(e,22)}function wS(e){return bS(e,6)^bS(e,11)^bS(e,25)}function TS(e){return bS(e,7)^bS(e,18)^e>>>3}function ES(e){return bS(e,17)^bS(e,19)^e>>>10}function DS(e,t,n){let r=1779033703,i=3144134277,a=1013904242,o=2773480762,s=1359893119,c=2600822924,l=528734635,u=1541459225,d=64*Math.ceil((n+9)/64),f=new Uint8Array(d),p,m;for(p=0;p<n;++p)f[p]=e[t++];f[p++]=128;let h=d-8;p<h&&(p=h),p+=3,f[p++]=n>>>29&255,f[p++]=n>>21&255,f[p++]=n>>13&255,f[p++]=n>>5&255,f[p++]=n<<3&255;let g=new Uint32Array(64),{k:_}=yS;for(p=0;p<d;){for(m=0;m<16;++m)g[m]=f[p]<<24|f[p+1]<<16|f[p+2]<<8|f[p+3],p+=4;for(m=16;m<64;++m)g[m]=ES(g[m-2])+g[m-7]+TS(g[m-15])+g[m-16]|0;let e,t,n=r,d=i,h=a,v=o,y=s,b=c,x=l,S=u;for(m=0;m<64;++m)e=S+wS(y)+xS(y,b,x)+_[m]+g[m],t=CS(n)+SS(n,d,h),S=x,x=b,b=y,y=v+e|0,v=h,h=d,d=n,n=e+t|0;r=r+n|0,i=i+d|0,a=a+h|0,o=o+v|0,s=s+y|0,c=c+b|0,l=l+x|0,u=u+S|0}return new Uint8Array([r>>24&255,r>>16&255,r>>8&255,255&r,i>>24&255,i>>16&255,i>>8&255,255&i,a>>24&255,a>>16&255,a>>8&255,255&a,o>>24&255,o>>16&255,o>>8&255,255&o,s>>24&255,s>>16&255,s>>8&255,255&s,c>>24&255,c>>16&255,c>>8&255,255&c,l>>24&255,l>>16&255,l>>8&255,255&l,u>>24&255,u>>16&255,u>>8&255,255&u])}var OS=class extends Ti{constructor(e,t,n){super(t),this.str=e,this.dict=e.dict,this.decrypt=n,this.nextChunk=null,this.initialized=!1}readBlock(){let e;if(this.initialized?e=this.nextChunk:(e=this.str.getBytes(512),this.initialized=!0),!e?.length)return void(this.eof=!0);this.nextChunk=this.str.getBytes(512);let t=this.nextChunk?.length>0;e=(0,this.decrypt)(e,!t);let n=this.bufferLength,r=n+e.length;this.ensureBuffer(r).set(e,n),this.bufferLength=r}},kS=class{constructor(e){this.a=0,this.b=0;let t=new Uint8Array(256),n=e.length;for(let e=0;e<256;++e)t[e]=e;for(let r=0,i=0;r<256;++r){let a=t[r];i=i+a+e[r%n]&255,t[r]=t[i],t[i]=a}this.s=t}encryptBlock(e){let t=this.a,n=this.b,r=this.s,i=e.length,a=new Uint8Array(i);for(let o=0;o<i;++o){t=t+1&255;let i=r[t];n=n+i&255;let s=r[n];r[t]=s,r[n]=i,a[o]=e[o]^r[i+s&255]}return this.a=t,this.b=n,a}decryptBlock(e){return this.encryptBlock(e)}encrypt(e){return this.encryptBlock(e)}},AS=class{decryptBlock(e){return e}encrypt(e){return e}},jS=class{_s=new Uint8Array([99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22]);_inv_s=new Uint8Array([82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125]);_mix=new Uint32Array([0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795]);_mixCol=new Uint8Array(256).map((e,t)=>t<128?t<<1:t<<1^27);constructor(){this.buffer=new Uint8Array(16),this.bufferPosition=0}_expandKey(e){gn("Cannot call `_expandKey` on the base class")}_decrypt(e,t){let n,r,i,a=new Uint8Array(16);a.set(e);for(let e=0,n=this._keySize;e<16;++e,++n)a[e]^=t[n];for(let e=this._cyclesOfRepetition-1;e>=1;--e){n=a[13],a[13]=a[9],a[9]=a[5],a[5]=a[1],a[1]=n,n=a[14],r=a[10],a[14]=a[6],a[10]=a[2],a[6]=n,a[2]=r,n=a[15],r=a[11],i=a[7],a[15]=a[3],a[11]=n,a[7]=r,a[3]=i;for(let e=0;e<16;++e)a[e]=this._inv_s[a[e]];for(let n=0,r=16*e;n<16;++n,++r)a[n]^=t[r];for(let e=0;e<16;e+=4){let t=this._mix[a[e]],r=this._mix[a[e+1]],i=this._mix[a[e+2]],o=this._mix[a[e+3]];n=t^r>>>8^r<<24^i>>>16^i<<16^o>>>24^o<<8,a[e]=n>>>24&255,a[e+1]=n>>16&255,a[e+2]=n>>8&255,a[e+3]=255&n}}n=a[13],a[13]=a[9],a[9]=a[5],a[5]=a[1],a[1]=n,n=a[14],r=a[10],a[14]=a[6],a[10]=a[2],a[6]=n,a[2]=r,n=a[15],r=a[11],i=a[7],a[15]=a[3],a[11]=n,a[7]=r,a[3]=i;for(let e=0;e<16;++e)a[e]=this._inv_s[a[e]],a[e]^=t[e];return a}_encrypt(e,t){let n=this._s,r,i,a,o=new Uint8Array(16);o.set(e);for(let e=0;e<16;++e)o[e]^=t[e];for(let e=1;e<this._cyclesOfRepetition;e++){for(let e=0;e<16;++e)o[e]=n[o[e]];a=o[1],o[1]=o[5],o[5]=o[9],o[9]=o[13],o[13]=a,a=o[2],i=o[6],o[2]=o[10],o[6]=o[14],o[10]=a,o[14]=i,a=o[3],i=o[7],r=o[11],o[3]=o[15],o[7]=a,o[11]=i,o[15]=r;for(let e=0;e<16;e+=4){let t=o[e],n=o[e+1],i=o[e+2],a=o[e+3];r=t^n^i^a,o[e]^=r^this._mixCol[t^n],o[e+1]^=r^this._mixCol[n^i],o[e+2]^=r^this._mixCol[i^a],o[e+3]^=r^this._mixCol[a^t]}for(let n=0,r=16*e;n<16;++n,++r)o[n]^=t[r]}for(let e=0;e<16;++e)o[e]=n[o[e]];a=o[1],o[1]=o[5],o[5]=o[9],o[9]=o[13],o[13]=a,a=o[2],i=o[6],o[2]=o[10],o[6]=o[14],o[10]=a,o[14]=i,a=o[3],i=o[7],r=o[11],o[3]=o[15],o[7]=a,o[11]=i,o[15]=r;for(let e=0,n=this._keySize;e<16;++e,++n)o[e]^=t[n];return o}_decryptBlock2(e,t){let n=e.length,r=this.buffer,i=this.bufferPosition,a=[],o=this.iv;for(let t=0;t<n;++t){if(r[i]=e[t],++i,i<16)continue;let n=this._decrypt(r,this._key);for(let e=0;e<16;++e)n[e]^=o[e];o=r,a.push(n),r=new Uint8Array(16),i=0}if(this.buffer=r,this.bufferLength=i,this.iv=o,a.length===0)return new Uint8Array;let s=16*a.length;if(t){let e=a.at(-1),t=e[15];if(t<=16){for(let n=15,r=16-t;n>=r;--n)if(e[n]!==t){t=0;break}s-=t,a[a.length-1]=e.subarray(0,16-t)}}let c=new Uint8Array(s);for(let e=0,t=0,n=a.length;e<n;++e,t+=16)c.set(a[e],t);return c}decryptBlock(e,t,n=null){let r=e.length,i=this.buffer,a=this.bufferPosition;if(n)this.iv=n;else{for(let t=0;a<16&&t<r;++t,++a)i[a]=e[t];if(a<16)return this.bufferLength=a,new Uint8Array;this.iv=i,e=e.subarray(16)}return this.buffer=new Uint8Array(16),this.bufferLength=0,this.decryptBlock=this._decryptBlock2,this.decryptBlock(e,t)}encrypt(e,t){let n=e.length,r=this.buffer,i=this.bufferPosition,a=[];t||=new Uint8Array(16);for(let o=0;o<n;++o){if(r[i]=e[o],++i,i<16)continue;for(let e=0;e<16;++e)r[e]^=t[e];let n=this._encrypt(r,this._key);t=n,a.push(n),r=new Uint8Array(16),i=0}if(this.buffer=r,this.bufferLength=i,this.iv=t,a.length===0)return new Uint8Array;let o=16*a.length,s=new Uint8Array(o);for(let e=0,t=0,n=a.length;e<n;++e,t+=16)s.set(a[e],t);return s}},MS=class extends jS{_rcon=new Uint8Array([141,1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145,57,114,228,211,189,97,194,159,37,74,148,51,102,204,131,29,58,116,232,203,141,1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145,57,114,228,211,189,97,194,159,37,74,148,51,102,204,131,29,58,116,232,203,141,1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145,57,114,228,211,189,97,194,159,37,74,148,51,102,204,131,29,58,116,232,203,141,1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145,57,114,228,211,189,97,194,159,37,74,148,51,102,204,131,29,58,116,232,203,141,1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145,57,114,228,211,189,97,194,159,37,74,148,51,102,204,131,29,58,116,232,203,141]);constructor(e){super(),this._cyclesOfRepetition=10,this._keySize=160,this._key=this._expandKey(e)}_expandKey(e){let t=this._s,n=this._rcon,r=new Uint8Array(176);r.set(e);for(let e=16,i=1;e<176;++i){let a=r[e-3],o=r[e-2],s=r[e-1],c=r[e-4];a=t[a],o=t[o],s=t[s],c=t[c],a^=n[i];for(let t=0;t<4;++t)r[e]=a^=r[e-16],e++,r[e]=o^=r[e-16],e++,r[e]=s^=r[e-16],e++,r[e]=c^=r[e-16],e++}return r}},NS=class extends jS{constructor(e){super(),this._cyclesOfRepetition=14,this._keySize=224,this._key=this._expandKey(e)}_expandKey(e){let t=this._s,n=new Uint8Array(240);n.set(e);let r,i,a,o,s=1;for(let e=32,c=1;e<240;++c){e%32==16?(r=t[r],i=t[i],a=t[a],o=t[o]):e%32==0&&(r=n[e-3],i=n[e-2],a=n[e-1],o=n[e-4],r=t[r],i=t[i],a=t[a],o=t[o],r^=s,(s<<=1)>=256&&(s=255&(27^s)));for(let t=0;t<4;++t)n[e]=r^=n[e-32],e++,n[e]=i^=n[e-32],e++,n[e]=a^=n[e-32],e++,n[e]=o^=n[e-32],e++}return n}},PS=class{_hash(e,t,n){gn("Abstract method `_hash` called")}checkOwnerPassword(e,t,n,r){let i=new Uint8Array(e.length+56);return i.set(e,0),i.set(t,e.length),i.set(n,e.length+t.length),In(this._hash(e,i,n),r)}checkUserPassword(e,t,n){let r=new Uint8Array(e.length+8);return r.set(e,0),r.set(t,e.length),In(this._hash(e,r,[]),n)}getOwnerKey(e,t,n,r){let i=new Uint8Array(e.length+56);return i.set(e,0),i.set(t,e.length),i.set(n,e.length+t.length),new NS(this._hash(e,i,n)).decryptBlock(r,!1,new Uint8Array(16))}getUserKey(e,t,n){let r=new Uint8Array(e.length+8);return r.set(e,0),r.set(t,e.length),new NS(this._hash(e,r,[])).decryptBlock(n,!1,new Uint8Array(16))}},FS=class extends PS{_hash(e,t,n){return DS(t,0,t.length)}},IS=class extends PS{_hash(e,t,n){let r=DS(t,0,t.length).subarray(0,32),i=[0],a=0;for(;a<64||i.at(-1)>a-32;){let t=e.length+r.length+n.length,o=new Uint8Array(t),s=0;o.set(e,s),s+=e.length,o.set(r,s),s+=r.length,o.set(n,s);let c=new Uint8Array(64*t);for(let e=0,n=0;e<64;e++,n+=t)c.set(o,n);i=new MS(r.subarray(0,16)).encrypt(c,r.subarray(16,32));let l=Math.sumPrecise(i.slice(0,16))%3;l===0?r=DS(i,0,i.length):l===1?r=vS(i,0,i.length):l===2&&(r=_S(i,0,i.length)),a++}return r.subarray(0,32)}},LS=class{constructor(e,t){this.StringCipherConstructor=e,this.StreamCipherConstructor=t}createStream(e,t){let n=new this.StreamCipherConstructor;return new OS(e,t,function(e,t){return n.decryptBlock(e,t)})}decryptString(e){let t=new this.StringCipherConstructor,n=En(e);return n=t.decryptBlock(n,!0),Tn(n)}encryptString(e){let t=new this.StringCipherConstructor;if(t instanceof jS){let n=16-e.length%16;e+=String.fromCharCode(n).repeat(n);let r=new Uint8Array(16);crypto.getRandomValues(r);let i=En(e);i=t.encrypt(i,r);let a=new Uint8Array(16+i.length);return a.set(r),a.set(i,16),Tn(a)}let n=En(e);return n=t.encrypt(n),Tn(n)}},RS=class e{static get _defaultPasswordBytes(){return P(this,`_defaultPasswordBytes`,new Uint8Array([40,191,78,94,78,117,138,65,100,0,78,86,255,250,1,8,46,46,0,182,208,104,62,128,47,12,169,254,100,83,105,122]))}#e(e,t,n,r,i,a,o,s,c,l,u,d){if(t){let e=Math.min(127,t.length);t=t.subarray(0,e)}else t=[];let f=e===6?new IS:new FS;return f.checkUserPassword(t,s,o)?f.getUserKey(t,c,u):t.length&&f.checkOwnerPassword(t,r,a,n)?f.getOwnerKey(t,i,a,l):null}#t(t,n,r,i,a,o,s,c){let l=40+r.length+t.length,u=new Uint8Array(l),d,f,p=0;if(n)for(f=Math.min(32,n.length);p<f;++p)u[p]=n[p];for(d=0;p<32;)u[p++]=e._defaultPasswordBytes[d++];u.set(r,p),p+=r.length,u[p++]=255&a,u[p++]=a>>8&255,u[p++]=a>>16&255,u[p++]=a>>>24&255,u.set(t,p),p+=t.length,o>=4&&!c&&(u.fill(255,p,p+4),p+=4);let m=iS(u,0,p),h=s>>3;if(o>=3)for(d=0;d<50;++d)m=iS(m,0,h);let g=m.subarray(0,h),_,v;if(o>=3){p=0,u.set(e._defaultPasswordBytes,p),p+=32,u.set(t,p),p+=t.length,_=new kS(g),v=_.encryptBlock(iS(u,0,p)),f=g.length;let n=new Uint8Array(f);for(d=1;d<=19;++d){for(let e=0;e<f;++e)n[e]=g[e]^d;_=new kS(n),v=_.encryptBlock(v)}}else _=new kS(g),v=_.encryptBlock(e._defaultPasswordBytes);return v.every((e,t)=>i[t]===e)?g:null}#n(t,n,r,i){let a=new Uint8Array(32),o=0,s=Math.min(32,t.length);for(;o<s;++o)a[o]=t[o];let c=0;for(;o<32;)a[o++]=e._defaultPasswordBytes[c++];let l=iS(a,0,o),u=i>>3;if(r>=3)for(c=0;c<50;++c)l=iS(l,0,l.length);let d,f;if(r>=3){f=n;let e=new Uint8Array(u);for(c=19;c>=0;c--){for(let t=0;t<u;++t)e[t]=l[t]^c;d=new kS(e),f=d.encryptBlock(f)}}else d=new kS(l.subarray(0,u)),f=d.encryptBlock(n);return f}#r(e,t,n,r=!1){let i=n.length,a=new Uint8Array(i+9);a.set(n);let o=i;return a[o++]=255&e,a[o++]=e>>8&255,a[o++]=e>>16&255,a[o++]=255&t,a[o++]=t>>8&255,r&&(a[o++]=115,a[o++]=65,a[o++]=108,a[o++]=84),iS(a,0,o).subarray(0,Math.min(i+5,16))}#i(e,t,n,r,i){if(!(t instanceof I))throw new F(`Invalid crypt filter name.`);let a=this,o=e.get(t.name)?.get(`CFM`);if(!o||o.name===`None`)return function(){return new AS};if(o.name===`V2`)return function(){return new kS(a.#r(n,r,i,!1))};if(o.name===`AESV2`)return function(){return new MS(a.#r(n,r,i,!0))};if(o.name===`AESV3`)return function(){return new NS(i)};throw new F(`Unknown crypto method`)}constructor(e,t,n){let r=e.get(`Filter`);if(!Zn(r,`Standard`))throw new F(`unknown encryption method`);this.filterName=r.name,this.dict=e;let i=e.get(`V`);if(!Number.isInteger(i)||i!==1&&i!==2&&i!==4&&i!==5)throw new F(`unsupported encryption algorithm`);this.algorithm=i;let a=e.get(`Length`);if(!a)if(i<=3)a=40;else{let t=e.get(`CF`),n=e.get(`StmF`);t instanceof L&&n instanceof I&&(t.suppressEncryption=!0,a=t.get(n.name)?.get(`Length`)||128,a<40&&(a<<=3))}if(!Number.isInteger(a)||a<40||a%8!=0)throw new F(`invalid key length`);let o=En(e.get(`O`)),s=En(e.get(`U`)),c=o.subarray(0,32),l=s.subarray(0,32),u=e.get(`P`),d=e.get(`R`),f=(i===4||i===5)&&!1!==e.get(`EncryptMetadata`);this.encryptMetadata=f;let p=En(t),m,h;if(n){if(d===6)try{n=Fn(n)}catch{N(`CipherTransformFactory: Unable to convert UTF8 encoded password.`)}m=En(n)}if(i!==5)h=this.#t(p,m,c,l,u,d,a,f);else{let t=o.subarray(32,40),n=o.subarray(40,48),r=s.subarray(0,48),i=s.subarray(32,40),a=s.subarray(40,48),u=En(e.get(`OE`)),f=En(e.get(`UE`)),p=En(e.get(`Perms`));h=this.#e(d,m,c,t,n,r,l,i,a,u,f,p)}if(!h){if(!n)throw new bn(`No password given`,fn);let e=this.#n(m,c,d,a);h=this.#t(p,e,c,l,u,d,a,f)}if(!h)throw new bn(`Incorrect Password`,pn);if(i===4&&h.length<16?(this.encryptionKey=new Uint8Array(16),this.encryptionKey.set(h)):this.encryptionKey=h,i>=4){let t=e.get(`CF`);t instanceof L&&(t.suppressEncryption=!0),this.cf=t,this.stmf=e.get(`StmF`)||I.get(`Identity`),this.strf=e.get(`StrF`)||I.get(`Identity`),this.eff=e.get(`EFF`)||this.stmf}}createCipherTransform(e,t){if(this.algorithm===4||this.algorithm===5)return new LS(this.#i(this.cf,this.strf,e,t,this.encryptionKey),this.#i(this.cf,this.stmf,e,t,this.encryptionKey));let n=this.#r(e,t,this.encryptionKey,!1),r=function(){return new kS(n)};return new LS(r,r)}},zS=class{constructor(e,t){this.stream=e,this.pdfManager=t,this.entries=[],this._xrefStms=new Set,this._cacheMap=new Map,this._pendingRefs=new Yn,this._newPersistentRefNum=null,this._newTemporaryRefNum=null,this._persistentRefsCache=null}getNewPersistentRef(e){this._newPersistentRefNum===null&&(this._newPersistentRefNum=this.entries.length||1);let t=this._newPersistentRefNum++;return this._cacheMap.set(t,e),R.get(t,0)}getNewTemporaryRef(){if(this._newTemporaryRefNum===null&&(this._newTemporaryRefNum=this.entries.length||1,this._newPersistentRefNum)){this._persistentRefsCache=new Map;for(let e=this._newTemporaryRefNum;e<this._newPersistentRefNum;e++)this._persistentRefsCache.set(e,this._cacheMap.get(e)),this._cacheMap.delete(e)}return R.get(this._newTemporaryRefNum++,0)}resetNewTemporaryRef(){if(this._newTemporaryRefNum=null,this._persistentRefsCache)for(let[e,t]of this._persistentRefsCache)this._cacheMap.set(e,t);this._persistentRefsCache=null}setStartXRef(e){this.startXRefQueue=[e]}parse(e=!1){let t,n,r;e?(N(`Indexing all PDF objects`),t=this.indexObjects()):t=this.readXRef(),t.assignXref(this),this.trailer=t;try{n=t.get(`Encrypt`)}catch(e){if(e instanceof cr)throw e;N(`XRef.parse - Invalid "Encrypt" reference: "${e}".`)}if(n instanceof L){let e=t.get(`ID`),r=e?.length?e[0]:``;n.suppressEncryption=!0,this.encrypt=new RS(n,r,this.pdfManager.password)}try{r=t.get(`Root`)}catch(e){if(e instanceof cr)throw e;N(`XRef.parse - Invalid "Root" reference: "${e}".`)}if(r instanceof L)try{if(r.get(`Pages`)instanceof L)return void(this.root=r)}catch(e){if(e instanceof cr)throw e;N(`XRef.parse - Invalid "Pages" reference: "${e}".`)}throw e?new Sn(`Invalid Root reference.`):new dr}processXRefTable(e){if(`tableState`in this||(this.tableState={entryNum:0,streamPos:e.lexer.stream.pos,parserBuf1:e.buf1,parserBuf2:e.buf2}),!Qn(this.readXRefTable(e),`trailer`))throw new F(`Invalid XRef table: could not find trailer dictionary`);let t=e.getObj();if(t instanceof L||!t.dict||(t=t.dict),!(t instanceof L))throw new F(`Invalid XRef table: could not parse trailer dictionary`);return delete this.tableState,t}readXRefTable(e){let t=e.lexer.stream,n=this.tableState,r;for(t.pos=n.streamPos,e.buf1=n.parserBuf1,e.buf2=n.parserBuf2;;){if(!(`firstEntryNum`in n)||!(`entryCount`in n)){if(Qn(r=e.getObj(),`trailer`))break;n.firstEntryNum=r,n.entryCount=e.getObj()}let i=n.firstEntryNum,a=n.entryCount;if(!Number.isInteger(i)||!Number.isInteger(a))throw new F(`Invalid XRef table: wrong types in subsection header`);for(let r=n.entryNum;r<a;r++){n.streamPos=t.pos,n.entryNum=r,n.parserBuf1=e.buf1,n.parserBuf2=e.buf2;let o={};o.offset=e.getObj(),o.gen=e.getObj();let s=e.getObj();if(s instanceof qn)switch(s.cmd){case`f`:o.free=!0;break;case`n`:o.uncompressed=!0}if(!Number.isInteger(o.offset)||!Number.isInteger(o.gen)||!o.free&&!o.uncompressed)throw new F(`Invalid entry in XRef subsection: ${i}, ${a}`);r===0&&o.free&&i===1&&(i=0),this.entries[r+i]||(this.entries[r+i]=o)}n.entryNum=0,n.streamPos=t.pos,n.parserBuf1=e.buf1,n.parserBuf2=e.buf2,delete n.firstEntryNum,delete n.entryCount}if(this.entries[0]&&!this.entries[0].free)throw new F(`Invalid XRef table: unexpected first object`);return r}processXRefStream(e){if(!(`streamState`in this)){let{dict:t,pos:n}=e,r=t.get(`W`),i=t.get(`Index`)||[0,t.get(`Size`)];this.streamState={entryRanges:i,byteWidths:r,entryNum:0,streamPos:n}}return this.readXRefStream(e),delete this.streamState,e.dict}readXRefStream(e){let t=this.streamState;e.pos=t.streamPos;let[n,r,i]=t.byteWidths,a=t.entryRanges;for(;a.length>0;){let[o,s]=a;if(!Number.isInteger(o)||!Number.isInteger(s))throw new F(`Invalid XRef range fields: ${o}, ${s}`);if(!Number.isInteger(n)||!Number.isInteger(r)||!Number.isInteger(i))throw new F(`Invalid XRef entry fields length: ${o}, ${s}`);for(let a=t.entryNum;a<s;++a){t.entryNum=a,t.streamPos=e.pos;let s=0,c=0,l=0;for(let t=0;t<n;++t){let t=e.getByte();if(t===-1)throw new F(`Invalid XRef byteWidths 'type'.`);s=s<<8|t}n===0&&(s=1);for(let t=0;t<r;++t){let t=e.getByte();if(t===-1)throw new F(`Invalid XRef byteWidths 'offset'.`);c=c<<8|t}for(let t=0;t<i;++t){let t=e.getByte();if(t===-1)throw new F(`Invalid XRef byteWidths 'generation'.`);l=l<<8|t}let u={};switch(u.offset=c,u.gen=l,s){case 0:u.free=!0;break;case 1:u.uncompressed=!0;break;case 2:break;default:throw new F(`Invalid XRef entry type: ${s}`)}this.entries[o+a]||(this.entries[o+a]=u)}t.entryNum=0,t.streamPos=e.pos,a.splice(0,2)}}indexObjects(){function e(e,t){let n=``,r=e[t];for(;r!==10&&r!==13&&r!==60&&!(++t>=e.length);)n+=String.fromCharCode(r),r=e[t];return n}function t(e,t,n){let r=n.length,i=e.length,a=0;for(;t<i;){let i=0;for(;i<r&&e[t+i]===n[i];)++i;if(i>=r)break;t++,a++}return a}let n=/\b(endobj|\d+\s+\d+\s+obj|xref|trailer\s*<<)\b/g,r=/\b(startxref|\d+\s+\d+\s+obj)\b/g,i=/^(\d+)\s+(\d+)\s+obj\b/,a=new Uint8Array([116,114,97,105,108,101,114]),o=new Uint8Array([115,116,97,114,116,120,114,101,102]),s=new Uint8Array([47,88,82,101,102]);this.entries.length=0,this._cacheMap.clear();let c=this.stream;c.pos=0;let l=c.getBytes(),u=Tn(l),d=l.length,f=c.start,p=[],m=[];for(;f<d;){let h=l[f];if(h===9||h===10||h===13||h===32){++f;continue}if(h===37){do{if(++f,f>=d)break;h=l[f]}while(h!==10&&h!==13);continue}let g=e(l,f),_;if(g.startsWith(`xref`)&&(g.length===4||/\s/.test(g[4])))f+=t(l,f,a),p.push(f),f+=t(l,f,o);else if(_=i.exec(g)){let e=0|_[1],r=0|_[2],i=f+g.length,a,o=!1;if(this.entries[e]){if(this.entries[e].gen===r)try{new uo({lexer:new mo(c.makeSubStream(i))}).getObj(),o=!0}catch(e){e instanceof lr?N(`indexObjects -- checking object (${g}): "${e}".`):o=!0}}else o=!0;o&&(this.entries[e]={offset:f-c.start,gen:r,uncompressed:!0}),n.lastIndex=i;let p=n.exec(u);p?(a=n.lastIndex+1-f,p[1]!==`endobj`&&(N(`indexObjects: Found "${p[1]}" inside of another "obj", caused by missing "endobj" -- trying to recover.`),a-=p[1].length+1)):a=d-f;let h=l.subarray(f,f+a),v=t(h,0,s);v<a&&h[v+5]<64&&(m.push(f-c.start),this._xrefStms.add(f-c.start)),f+=a}else if(g.startsWith(`trailer`)&&(g.length===7||/\s/.test(g[7]))){p.push(f);let e=f+g.length,t;r.lastIndex=e;let n=r.exec(u);n?(t=r.lastIndex+1-f,n[1]!==`startxref`&&(N(`indexObjects: Found "${n[1]}" after "trailer", caused by missing "startxref" -- trying to recover.`),t-=n[1].length+1)):t=d-f,f+=t}else f+=g.length+1}for(let e of m)this.startXRefQueue.push(e),this.readXRef(!0);let h=[],g,_,v=!1;for(let e of p){c.pos=e;let t=new uo({lexer:new mo(c),xref:this,allowStreams:!0,recoveryMode:!0});if(!Qn(t.getObj(),`trailer`))continue;let n=t.getObj();n instanceof L&&(h.push(n),n.has(`Encrypt`)&&(v=!0))}for(let e of[...h,`genFallback`,...h]){if(e===`genFallback`){if(!_)break;this._generationFallback=!0;continue}let t=!1;try{let n=e.get(`Root`);if(!(n instanceof L))continue;let r=n.get(`Pages`);if(!(r instanceof L))continue;let i=r.get(`Count`);Number.isInteger(i)&&(t=!0)}catch(e){_=e;continue}if(t&&(!v||e.has(`Encrypt`))&&e.has(`ID`))return e;g=e}if(g)return g;if(this.topDict)return this.topDict;if(!h.length)for(let e in this.entries){if(!Object.hasOwn(this.entries,e))continue;let t=this.entries[e],n=R.get(parseInt(e),t.gen),r;try{r=this.fetch(n)}catch{continue}if(r instanceof tr&&(r=r.dict),r instanceof L&&r.has(`Root`))return r}throw new Sn(`Invalid PDF structure.`)}readXRef(e=!1){let t=this.stream,n=new Set;for(;this.startXRefQueue.length;){try{let e=this.startXRefQueue[0];if(n.has(e)){N(`readXRef - skipping XRef table since it was already parsed.`),this.startXRefQueue.shift();continue}n.add(e),t.pos=e+t.start;let r=new uo({lexer:new mo(t),xref:this,allowStreams:!0}),i,a=r.getObj();if(Qn(a,`xref`))i=this.processXRefTable(r),this.topDict||=i,a=i.get(`XRefStm`),Number.isInteger(a)&&!this._xrefStms.has(a)&&(this._xrefStms.add(a),this.startXRefQueue.push(a));else{if(!Number.isInteger(a))throw new F(`Invalid XRef stream header`);if(!(Number.isInteger(r.getObj())&&Qn(r.getObj(),`obj`)&&(a=r.getObj())instanceof tr))throw new F(`Invalid XRef stream`);if(i=this.processXRefStream(a),this.topDict||=i,!i)throw new F(`Failed to read XRef stream`)}a=i.get(`Prev`),Number.isInteger(a)?this.startXRefQueue.push(a):a instanceof R&&this.startXRefQueue.push(a.num)}catch(e){if(e instanceof cr)throw e;hn(`(while reading XRef): `+e)}this.startXRefQueue.shift()}if(this.topDict)return this.topDict;if(!e)throw new dr}getEntry(e){let t=this.entries[e];return t&&!t.free&&t.offset?t:null}fetchIfRef(e,t=!1){return e instanceof R?this.fetch(e,t):e}fetch(e,t=!1){if(!(e instanceof R))throw Error(`ref object is not a reference`);let n=e.num,r=this._cacheMap.get(n);if(r!==void 0)return r instanceof L&&!r.objId&&(r.objId=e.toString()),r;let i=this.getEntry(n);if(i===null)return i;if(this._pendingRefs.has(e))return this._pendingRefs.remove(e),N(`Ignoring circular reference: ${e}.`),Hn;this._pendingRefs.put(e);try{i=i.uncompressed?this.fetchUncompressed(e,i,t):this.fetchCompressed(e,i,t),this._pendingRefs.remove(e)}catch(t){throw this._pendingRefs.remove(e),t}return i instanceof L?i.objId=e.toString():i instanceof tr&&(i.dict.objId=e.toString()),i}fetchUncompressed(e,t,n=!1){let r=e.gen,i=e.num;if(t.gen!==r){let a=`Inconsistent generation in XRef: ${e}`;if(this._generationFallback&&t.gen<r)return N(a),this.fetchUncompressed(R.get(i,t.gen),t,n);throw new ur(a)}let a=new uo({lexer:new mo(this.stream.makeSubStream(t.offset+this.stream.start)),xref:this,allowStreams:!0}),o=a.getObj(),s=a.getObj(),c=a.getObj();if(o!==i||s!==r||!(c instanceof qn))throw new ur(`Bad (uncompressed) XRef entry: ${e}`);if(c.cmd!==`obj`){if(c.cmd.startsWith(`obj`)&&(i=parseInt(c.cmd.substring(3),10),!Number.isNaN(i)))return i;throw new ur(`Bad (uncompressed) XRef entry: ${e}`)}return(t=this.encrypt&&!n?a.getObj(this.encrypt.createCipherTransform(i,r)):a.getObj())instanceof tr||this._cacheMap.set(i,t),t}fetchCompressed(e,t,n=!1){let r=t.offset,i=this.fetch(R.get(r,0));if(!(i instanceof tr))throw new F(`bad ObjStm stream`);let a=i.dict.get(`First`),o=i.dict.get(`N`);if(!Number.isInteger(a)||!Number.isInteger(o))throw new F(`invalid first and n parameters for ObjStm stream`);let s=new uo({lexer:new mo(i),xref:this,allowStreams:!0}),c=Array(o),l=Array(o);for(let e=0;e<o;++e){let t=s.getObj();if(!Number.isInteger(t))throw new F(`invalid object number in the ObjStm stream: ${t}`);let n=s.getObj();if(!Number.isInteger(n))throw new F(`invalid object offset in the ObjStm stream: ${n}`);c[e]=t;let i=this.getEntry(t);i?.offset===r&&i.gen!==e&&(i.gen=e),l[e]=n}let u=(i.start||0)+a,d=Array(o);for(let e=0;e<o;++e){let t=e<o-1?l[e+1]-l[e]:void 0;if(t<0)throw new F(`Invalid offset in the ObjStm stream.`);s=new uo({lexer:new mo(i.makeSubStream(u+l[e],t,i.dict)),xref:this,allowStreams:!0});let n=s.getObj();if(d[e]=n,n instanceof tr)continue;let a=c[e],f=this.entries[a];f&&f.offset===r&&f.gen===e&&this._cacheMap.set(a,n)}if((t=d[t.gen])===void 0)throw new ur(`Bad (compressed) XRef entry: ${e}`);return t}async fetchIfRefAsync(e,t){return e instanceof R?this.fetchAsync(e,t):e}async fetchAsync(e,t){try{return this.fetch(e,t)}catch(n){if(!(n instanceof cr))throw n;return await this.pdfManager.requestRange(n.begin,n.end),this.fetchAsync(e,t)}}getCatalogObj(){return this.root}},BS=[0,0,612,792],VS=class{#e=!1;#t=null;constructor({pdfManager:e,xref:t,pageIndex:n,pageDict:r,ref:i,globalIdFactory:a,fontCache:o,builtInCMapCache:s,standardFontDataCache:c,globalColorSpaceCache:l,globalImageCache:u,systemFontCache:d,nonBlendModesSet:f,xfaFactory:p}){this.pdfManager=e,this.pageIndex=n,this.pageDict=r,this.xref=t,this.ref=i,this.fontCache=o,this.builtInCMapCache=s,this.standardFontDataCache=c,this.globalColorSpaceCache=l,this.globalImageCache=u,this.systemFontCache=d,this.nonBlendModesSet=f,this.evaluatorOptions=e.evaluatorOptions,this.xfaFactory=p;let m={obj:0};this._localIdFactory=class extends a{static createObjId(){return`p${n}_${++m.obj}`}static getPageObjId(){return`p${i.toString()}`}}}#n(e){return new bd({xref:this.xref,handler:e,pageIndex:this.pageIndex,idFactory:this._localIdFactory,fontCache:this.fontCache,builtInCMapCache:this.builtInCMapCache,standardFontDataCache:this.standardFontDataCache,globalColorSpaceCache:this.globalColorSpaceCache,globalImageCache:this.globalImageCache,systemFontCache:this.systemFontCache,options:this.evaluatorOptions})}#r(e,t=!1){let n=mr({dict:this.pageDict,key:e,getArray:t,stopWhenFound:!1});return Array.isArray(n)?n.length!==1&&n[0]instanceof L?L.merge({xref:this.xref,dictArray:n}):n[0]:n}get content(){return this.pageDict.getArray(`Contents`)}get resources(){let e=this.#r(`Resources`);return P(this,`resources`,e instanceof L?e:L.empty)}#i(e){if(this.xfaData)return this.xfaData.bbox;let t=Er(this.#r(e,!0),null);if(t){if(t[2]-t[0]>0&&t[3]-t[1]>0)return t;N(`Empty, or invalid, /${e} entry.`)}return null}get mediaBox(){return P(this,`mediaBox`,this.#i(`MediaBox`)||BS)}get cropBox(){return P(this,`cropBox`,this.#i(`CropBox`)||this.mediaBox)}get userUnit(){let e=this.pageDict.get(`UserUnit`);return P(this,`userUnit`,typeof e==`number`&&e>0?e:1)}get view(){let{cropBox:e,mediaBox:t}=this;if(e!==t&&!In(e,t)){let n=jn.intersect(e,t);if(n&&n[2]-n[0]>0&&n[3]-n[1]>0)return P(this,`view`,n);N(`Empty /CropBox and /MediaBox intersection.`)}return P(this,`view`,t)}get rotate(){let e=this.#r(`Rotate`)||0;return e%90==0?e>=360?e%=360:e<0&&(e=(e%360+360)%360):e=0,P(this,`rotate`,e)}#a(e,t){if(!this.evaluatorOptions.ignoreErrors)throw e;N(`getContentStream - ignoring sub-stream (${t}): "${e}".`)}async getContentStream(){let e=await this.pdfManager.ensure(this,`content`);return e instanceof tr?e:Array.isArray(e)?new Ei(e,this.#a.bind(this)):new vi}get xfaData(){return P(this,`xfaData`,this.xfaFactory?{bbox:this.xfaFactory.getBoundingBox(this.pageIndex)}:null)}async#o(e,t,n){let r=[];for(let i of e)if(i.id){let e=R.fromString(i.id);if(!e){N(`A non-linked annotation cannot be modified: ${i.id}`);continue}if(i.deleted){if(t.put(e,e),i.popupRef){let e=R.fromString(i.popupRef);e&&t.put(e,e)}continue}if(i.popup?.deleted){let e=R.fromString(i.popupRef);e&&t.put(e,e)}n?.put(e),i.ref=e,r.push(this.xref.fetchAsync(e).then(e=>{e instanceof L&&(i.oldAnnotation=e.clone())},()=>{N(`Cannot fetch \`oldAnnotation\` for: ${e}.`)})),delete i.id}await Promise.all(r)}async saveNewAnnotations(e,t,n,r,i){if(this.xfaFactory)throw Error(`XFA: Cannot save new annotations.`);let a=this.#n(e),o=new Xn,s=new Yn;await this.#o(n,o,s);let c=this.pageDict,l=this.annotations.filter(e=>!(e instanceof R&&o.has(e))),u=await Dx.saveNewAnnotations(a,t,n,r,i);for(let{ref:e}of u.annotations)e instanceof R&&!s.has(e)&&l.push(e);let d=c.clone();d.set(`Annots`,l),i.put(this.ref,{data:d});for(let e of o)i.put(e,{data:null})}async save(e,t,n,r){let i=this.#n(e),a=await this._parsedAnnotations,o=[];for(let e of a)o.push(e.save(i,t,n,r).catch(function(e){return N(`save - ignoring annotation data during "${t.name}" task: "${e}".`),null}));return Promise.all(o)}async loadResources(e){await(this.#t??=this.pdfManager.ensure(this,`resources`)),await pf.load(this.resources,e,this.xref)}async#s(e,t){let n=e?.get(`Resources`);return n instanceof L&&n.size?(await pf.load(n,t,this.xref),L.merge({xref:this.xref,dictArray:[n,this.resources],mergeSubDicts:!0})):this.resources}async getOperatorList({handler:e,sink:t,task:n,intent:r,cacheKey:i,annotationStorage:a=null,modifiedIds:l=null}){let p=this.getContentStream(),h=this.loadResources(ar),g=this.#n(e),_=(this.xfaFactory?null:zr(a))?.get(this.pageIndex),v=Promise.resolve(null),y=null;if(_){let e=this.pdfManager.ensureDoc(`annotationGlobals`),t,r=new Set;for(let{bitmapId:e,bitmap:t}of _)!e||t||r.has(e)||r.add(e);let{isOffscreenCanvasSupported:i}=this.evaluatorOptions;if(r.size>0){let e=_.slice();for(let[t,n]of a)t.startsWith(m)&&n.bitmap&&r.has(n.bitmapId)&&e.push(n);t=Dx.generateImages(e,this.xref,i)}else t=Dx.generateImages(_,this.xref,i);y=new Yn,v=Promise.all([e,this.#o(_,y,null)]).then(([e])=>e?Dx.printNewAnnotations(e,g,n,_,t):null)}let b=Promise.all([p,h]).then(async([a])=>{let o=await this.#s(a.dict,ar),s=new ra(r,t);return e.send(`StartRenderPage`,{transparency:g.hasBlendModes(o,this.nonBlendModesSet),pageIndex:this.pageIndex,cacheKey:i}),await g.getOperatorList({stream:a,task:n,resources:o,operatorList:s}),s}),[x,S,C]=await Promise.all([b,this._parsedAnnotations,v]);if(C){S=S.filter(e=>!(e.ref&&y.has(e.ref)));for(let e=0,t=C.length;e<t;e++){let n=C[e];if(n.refToReplace){let r=S.findIndex(e=>e.ref&&er(e.ref,n.refToReplace));r>=0&&(S.splice(r,1,n),C.splice(e--,1),t--)}}S=S.concat(C)}if(S.length===0||r&d)return x.flush(!0),{length:x.totalLength};let w=!!(r&u),T=!!(r&f),E=!!(r&o),D=!!(r&s),O=!!(r&c),k=[];for(let e of S)(E||D&&e.mustBeViewed(a,w)&&e.mustBeViewedWhenEditing(T,l)||O&&e.mustBePrinted(a))&&k.push(e.getOperatorList(g,n,r,a).catch(function(e){return N(`getOperatorList - ignoring annotation data during "${n.name}" task: "${e}".`),{opList:null,separateForm:!1,separateCanvas:!1}}));let ee=await Promise.all(k),A=!1,j=!1;for(let{opList:e,separateForm:t,separateCanvas:n}of ee)x.addOpList(e),A||=t,j||=n;return x.flush(!0,{form:A,canvas:j}),{length:x.totalLength}}async extractTextContent({handler:e,task:t,includeMarkedContent:n,disableNormalization:r,sink:i,intersector:a=null}){let o=this.getContentStream(),s=this.loadResources(or),c=this.pdfManager.ensureCatalog(`lang`),[l,,u]=await Promise.all([o,s,c]),d=await this.#s(l.dict,or);return this.#n(e).getTextContent({stream:l,task:t,resources:d,includeMarkedContent:n,disableNormalization:r,sink:i,viewBox:this.view,lang:u,intersector:a})}async getStructTree(){let e=await this.pdfManager.ensureCatalog(`structTreeRoot`);if(!e)return null;await this._parsedAnnotations;try{let t=await this.pdfManager.ensure(this,`_parseStructTree`,[e]);return await this.pdfManager.ensure(t,`serializable`)}catch(e){return N(`getStructTree: "${e}".`),null}}_parseStructTree(e){let t=new of(e,this.pageDict);return t.parse(this.ref),t}async getAnnotationsData(e,t,n){let r=await this._parsedAnnotations;if(r.length===0)return r;let i=[],a=[],l,u=!!(n&o),d=!!(n&s),f=!!(n&c),p=[];for(let n of r){let r=u||d&&n.viewable;(r||f&&n.printable)&&i.push(n.data),n.hasTextContent&&r?(l??=this.#n(e),a.push(n.extractTextContent(l,t,[-1/0,-1/0,1/0,1/0]).catch(function(e){N(`getAnnotationsData - ignoring textContent during "${t.name}" task: "${e}".`)}))):n.overlaysTextContent&&r&&p.push(n)}if(p.length>0){let n=new lS(p);a.push(this.extractTextContent({handler:e,task:t,includeMarkedContent:!1,disableNormalization:!1,sink:null,viewBox:this.view,lang:null,intersector:n}).then(()=>{n.setText()}))}return await Promise.all(a),i}get annotations(){let e=this.#r(`Annots`);return P(this,`annotations`,Array.isArray(e)?e:[])}get _parsedAnnotations(){let e=this.pdfManager.ensure(this,`annotations`).then(async e=>{if(e.length===0)return e;let[t,n]=await Promise.all([this.pdfManager.ensureDoc(`annotationGlobals`),this.pdfManager.ensureDoc(`fieldObjects`)]);if(!t)return[];let r=n?.orphanFields,i=[];for(let n of e)i.push(Dx.create(this.xref,n,t,this._localIdFactory,!1,r,null,this.ref).catch(function(e){return N(`_parsedAnnotations: "${e}".`),null}));let a=[],o,s;for(let e of await Promise.all(i))e&&(e instanceof Fx?(s||=[]).push(e):e instanceof Hx?(o||=[]).push(e):a.push(e));return s&&a.push(...s),o&&a.push(...o),a});return this.#e=!0,P(this,`_parsedAnnotations`,e)}get jsActions(){return P(this,`jsActions`,jr(this.xref,this.pageDict,xe))}async collectAnnotationsByType(e,t,n,r,i){let{pageIndex:a}=this;if(this.#e){let e=await this._parsedAnnotations;for(let{data:t}of e)n&&!n.has(t.annotationType)||(t.pageIndex=a,r.push(Promise.resolve(t)));return}let o=await this.pdfManager.ensure(this,`annotations`);for(let s of o)r.push(Dx.create(this.xref,s,i,this._localIdFactory,!1,null,n,this.ref).then(async n=>{if(!n)return null;if(n.data.pageIndex=a,n.hasTextContent&&n.viewable){let r=this.#n(e);await n.extractTextContent(r,t,[-1/0,-1/0,1/0,1/0])}return n.data}).catch(function(e){return N(`collectAnnotationsByType: "${e}".`),null}))}},HS=new Uint8Array([37,80,68,70,45]),US=new Uint8Array([115,116,97,114,116,120,114,101,102]),WS=new Uint8Array([101,110,100,111,98,106]);function GS(e,t,n=1024,r=!1){let i=t.length,a=e.peekBytes(n),o=a.length-i;if(o<=0)return!1;if(r){let n=i-1,r=a.length-1;for(;r>=n;){let o=0;for(;o<i&&a[r-o]===t[n-o];)o++;if(o>=i)return e.pos+=r-n,!0;r--}}else{let n=0;for(;n<=o;){let r=0;for(;r<i&&a[n+r]===t[r];)r++;if(r>=i)return e.pos+=n,!0;n++}}return!1}var KS=class{#e=new Map;#t=null;constructor(e,t){if(t.length<=0)throw new Sn(`The PDF file is empty, i.e. its size is zero bytes.`);this.pdfManager=e,this.stream=t,this.xref=new zS(t,e);let n={font:0};this._globalIdFactory=class{static getDocId(){return`g_${e.docId}`}static createFontId(){return`f`+ ++n.font}static createObjId(){gn("Abstract method `createObjId` called.")}static getPageObjId(){gn("Abstract method `getPageObjId` called.")}}}parse(e){this.xref.parse(e),this.catalog=new uf(this.pdfManager,this.xref)}get linearization(){let e=null;try{e=ho.create(this.stream)}catch(e){if(e instanceof cr)throw e;hn(e)}return P(this,`linearization`,e)}get startXRef(){let e=this.stream,t=0;if(this.linearization){if(e.reset(),GS(e,WS)){e.skip(6);let n=e.peekByte();for(;Sr(n);)e.pos++,n=e.peekByte();t=e.pos-e.start}}else{let n=1024,r=US.length,i=!1,a=e.end;for(;!i&&a>0;)a-=n-r,a<0&&(a=0),e.pos=a,i=GS(e,US,n,!0);if(i){let n;e.skip(9);do n=e.getByte();while(Sr(n));let r=``;for(;n>=32&&n<=57;)r+=String.fromCharCode(n),n=e.getByte();t=parseInt(r,10),isNaN(t)&&(t=0)}}return P(this,`startXRef`,t)}checkHeader(){let e=this.stream;if(e.reset(),!GS(e,HS))return;e.moveStart(),e.skip(HS.length);let t,n=``;for(;(t=e.getByte())>32&&n.length<7;)n+=String.fromCharCode(t);nr.test(n)?this.#t=n:N(`Invalid PDF header version: ${n}`)}parseStartXRef(){this.xref.setStartXRef(this.startXRef)}get numPages(){let e=0;return e=this.catalog.hasActualNumPages?this.catalog.numPages:this.xfaFactory?this.xfaFactory.getNumPages():this.linearization?this.linearization.numPages:this.catalog.numPages,P(this,`numPages`,e)}#n(e,t=0){return!!Array.isArray(e)&&e.every(e=>{if(!((e=this.xref.fetchIfRef(e))instanceof L))return!1;if(e.has(`Kids`))return++t>10?(N(`#hasOnlyDocumentSignatures: maximum recursion depth reached`),!1):this.#n(e.get(`Kids`),t);let n=Zn(e.get(`FT`),`Sig`),r=e.get(`Rect`),i=Array.isArray(r)&&r.every(e=>e===0);return n&&i})}#r(e,t,n=new Yn){if(Array.isArray(e))for(let r of e){if(r instanceof R){if(n.has(r))continue;n.put(r)}if(r=this.xref.fetchIfRef(r),!(r instanceof L))continue;if(r.has(`Kids`)){this.#r(r.get(`Kids`),t,n);continue}if(!Zn(r.get(`FT`),`Sig`))continue;let e=r.get(`V`);if(!(e instanceof L))continue;let i=e.get(`SubFilter`);i instanceof I&&t.add(i.name)}}get _xfaStreams(){let{acroForm:e}=this.catalog;if(!e)return null;let t=e.get(`XFA`),n=new Map([`xdp:xdp`,`template`,`datasets`,`config`,`connectionSet`,`localeSet`,`stylesheet`,`/xdp:xdp`].map(e=>[e,null]));if(t instanceof tr&&!t.isEmpty)return n.set(`xdp:xdp`,t),n;if(!Array.isArray(t)||t.length===0)return null;for(let e=0,r=t.length;e<r;e+=2){let i;if(i=e===0?`xdp:xdp`:e===r-2?`/xdp:xdp`:t[e],!n.has(i))continue;let a=this.xref.fetchIfRef(t[e+1]);a instanceof tr&&!a.isEmpty&&n.set(i,a)}return n}get xfaDatasets(){let e=this._xfaStreams;if(!e)return P(this,`xfaDatasets`,null);for(let t of[`datasets`,`xdp:xdp`]){let n=e.get(t);if(n)try{let e=Pn(n.getString());return P(this,`xfaDatasets`,new sS({[t]:e}))}catch{N(`XFA - Invalid utf-8 string.`);break}}return P(this,`xfaDatasets`,null)}get xfaData(){let e=this._xfaStreams;if(!e)return null;let t=Object.create(null);for(let[n,r]of e)if(r)try{t[n]=Pn(r.getString())}catch{return N(`XFA - Invalid utf-8 string.`),null}return t}get xfaFactory(){let e;return this.pdfManager.enableXfa&&this.catalog.needsRendering&&this.formInfo.hasXfa&&!this.formInfo.hasAcroForm&&(e=this.xfaData),P(this,`xfaFactory`,e?new Ex(e):null)}get isPureXfa(){return!!this.xfaFactory&&this.xfaFactory.isValid()}get htmlForXfa(){return this.xfaFactory?this.xfaFactory.getPages():null}async#i(){let e=await this.pdfManager.ensureCatalog(`xfaImages`);e&&this.xfaFactory.setImages(e)}async#a(e,t){let n=await this.pdfManager.ensureCatalog(`acroForm`);if(!n)return;let r=await n.getAsync(`DR`);if(!(r instanceof L))return;await pf.load(r,[`Font`],this.xref);let i=r.get(`Font`);if(!(i instanceof L))return;let a=Object.assign(Object.create(null),this.pdfManager.evaluatorOptions,{useSystemFonts:!1}),{builtInCMapCache:o,fontCache:s,standardFontDataCache:c}=this.catalog,l=new bd({xref:this.xref,handler:e,pageIndex:-1,idFactory:this._globalIdFactory,fontCache:s,builtInCMapCache:o,standardFontDataCache:c,options:a}),u=new ra,d=[],f={get font(){return d.at(-1)},set font(e){d.push(e)},clone(){return this}},p=(e,n,i)=>l.handleSetFont(r,[I.get(e),1],null,u,t,f,n,i).catch(e=>(N(`loadXfaFonts: "${e}".`),null)),m=[];for(let[e,t]of i){let n=t.get(`FontDescriptor`);if(!(n instanceof L))continue;let r=n.get(`FontFamily`);r=r.replaceAll(/[ ]+(\d)/g,`$1`);let i={fontFamily:r,fontWeight:n.get(`FontWeight`),italicAngle:-n.get(`ItalicAngle`)};Ir(i)&&m.push(p(e,null,i))}await Promise.all(m);let h=this.xfaFactory.setFonts(d);if(!h)return;a.ignoreErrors=!0,m.length=0,d.length=0;let g=new Set;for(let e of h)au(`${e}-Regular`)||g.add(e);g.size&&h.push(`PdfJS-Fallback`);for(let e of h)if(!g.has(e))for(let t of[{name:`Regular`,fontWeight:400,italicAngle:0},{name:`Bold`,fontWeight:700,italicAngle:0},{name:`Italic`,fontWeight:400,italicAngle:12},{name:`BoldItalic`,fontWeight:700,italicAngle:12}]){let n=`${e}-${t.name}`;m.push(p(n,ou(n),{fontFamily:e,fontWeight:t.fontWeight,italicAngle:t.italicAngle}))}await Promise.all(m),this.xfaFactory.appendFonts(d,g)}loadXfaResources(e,t){return Promise.all([this.#a(e,t).catch(()=>{}),this.#i()])}serializeXfaData(e){return this.xfaFactory?this.xfaFactory.serializeData(e):null}get version(){return this.catalog.version||this.#t}get formInfo(){let e={hasFields:!1,hasAcroForm:!1,hasXfa:!1,hasSignatures:!1},{acroForm:t}=this.catalog;if(!t)return P(this,`formInfo`,e);try{let n=t.get(`Fields`),r=Array.isArray(n)&&n.length>0;e.hasFields=r;let i=t.get(`XFA`);e.hasXfa=Array.isArray(i)&&i.length>0||i instanceof tr&&!i.isEmpty;let a=!!(1&t.get(`SigFlags`)),o=a&&this.#n(n);e.hasAcroForm=r&&!o,e.hasSignatures=a}catch(e){if(e instanceof cr)throw e;N(`Cannot fetch form information: "${e}".`)}return P(this,`formInfo`,e)}get documentInfo(){let{catalog:e,formInfo:t,xref:n}=this,r={PDFFormatVersion:this.version,Language:e.lang,EncryptFilterName:n.encrypt?.filterName??null,IsLinearized:!!this.linearization,IsAcroFormPresent:t.hasAcroForm,IsXFAPresent:t.hasXfa,IsCollectionPresent:!!e.collection,IsSignaturesPresent:t.hasSignatures},i;try{i=n.trailer.get(`Info`)}catch(e){if(e instanceof cr)throw e;hn(`The document information dictionary is invalid.`)}if(!(i instanceof L))return P(this,`documentInfo`,r);for(let[e,t]of i){switch(e){case`Title`:case`Author`:case`Subject`:case`Keywords`:case`Creator`:case`Producer`:case`CreationDate`:case`ModDate`:if(typeof t==`string`){r[e]=Nn(t);continue}break;case`Trapped`:if(t instanceof I){r[e]=t;continue}break;default:let n;switch(typeof t){case`string`:n=Nn(t);break;case`number`:case`boolean`:n=t;break;default:t instanceof I&&(n=t)}if(n===void 0){N(`Bad value, for custom key "${e}", in Info: ${t}.`);continue}r.Custom??=Object.create(null),r.Custom[e]=n;continue}N(`Bad value, for key "${e}", in Info: ${t}.`)}return P(this,`documentInfo`,r)}get fingerprints(){let e=`\0`.repeat(16);function t(t){return typeof t==`string`&&t.length===16&&t!==e}let n=this.xref.trailer.get(`ID`),r,i;return Array.isArray(n)&&t(n[0])?(r=En(n[0]),n[1]!==n[0]&&t(n[1])&&(i=En(n[1]))):r=iS(this.stream.getByteRange(0,1024),0,1024),P(this,`fingerprints`,[Vn(r),i?Vn(i):null])}async#o(e){let{catalog:t,linearization:n,xref:r}=this,i=R.get(n.objectNumberFirst,0);try{let e=await r.fetchAsync(i);if(e instanceof L){let n=e.getRaw(`Type`);if(n instanceof R&&(n=await r.fetchAsync(n)),Zn(n,`Page`)||!e.has(`Type`)&&!e.has(`Kids`)&&e.has(`Contents`))return t.pageKidsCountCache.has(i)||t.pageKidsCountCache.put(i,1),t.pageIndexCache.has(i)||t.pageIndexCache.put(i,0),[e,i]}throw new F(`The Linearization dictionary doesn't point to a valid Page dictionary.`)}catch(n){return N(`_getLinearizationPage: "${n.message}".`),t.getPageDict(e)}}getPage(e){let t=this.#e.get(e);if(t)return t;let{catalog:n,linearization:r,xfaFactory:i}=this,a;return a=i?Promise.resolve([L.empty,null]):r?.pageFirst===e?this.#o(e):n.getPageDict(e),a=a.then(([t,r])=>new VS({pdfManager:this.pdfManager,xref:this.xref,pageIndex:e,pageDict:t,ref:r,globalIdFactory:this._globalIdFactory,fontCache:n.fontCache,builtInCMapCache:n.builtInCMapCache,standardFontDataCache:n.standardFontDataCache,globalColorSpaceCache:n.globalColorSpaceCache,globalImageCache:n.globalImageCache,systemFontCache:n.systemFontCache,nonBlendModesSet:n.nonBlendModesSet,xfaFactory:i})),this.#e.set(e,a),a}async checkFirstPage(e=!1){if(!e)try{await this.getPage(0)}catch(e){if(e instanceof ur)throw this.#e.delete(0),await this.cleanup(),new dr}}async checkLastPage(e=!1){let{catalog:t,pdfManager:n}=this,r;t.setActualNumPages();try{if(await Promise.all([n.ensureDoc(`xfaFactory`),n.ensureDoc(`linearization`),n.ensureCatalog(`numPages`)]),this.xfaFactory)return;if(r=this.linearization?this.linearization.numPages:t.numPages,!Number.isInteger(r))throw new F(`Page count is not an integer.`);if(r<=1)return;await this.getPage(r-1)}catch(i){if(this.#e.delete(r-1),await this.cleanup(),i instanceof ur&&!e)throw new dr;let a;N(`checkLastPage - invalid /Pages tree /Count: ${r}.`);try{a=await t.getAllPageDicts(e)}catch(n){if(n instanceof ur&&!e)throw new dr;t.setActualNumPages(1);return}for(let[e,[r,i]]of a){let a;r instanceof Error?(a=Promise.reject(r),a.catch(()=>{})):a=Promise.resolve(new VS({pdfManager:n,xref:this.xref,pageIndex:e,pageDict:r,ref:i,globalIdFactory:this._globalIdFactory,fontCache:t.fontCache,builtInCMapCache:t.builtInCMapCache,standardFontDataCache:t.standardFontDataCache,globalColorSpaceCache:this.globalColorSpaceCache,globalImageCache:t.globalImageCache,systemFontCache:t.systemFontCache,nonBlendModesSet:t.nonBlendModesSet,xfaFactory:null})),this.#e.set(e,a)}t.setActualNumPages(a.size)}}async fontFallback(e,t){let{catalog:n,pdfManager:r}=this;for(let i of await Promise.all(n.fontCache))if(i.loadedName===e)return void i.fallback(t,r.evaluatorOptions)}async cleanup(e=!1){return this.catalog?this.catalog.cleanup(e):Id()}async#s(e,t,n,r,i,a,o){let{xref:s}=this;if(!(n instanceof R)||a.has(n))return;a.put(n);let c=await s.fetchAsync(n);if(!(c instanceof L))return;let l=await c.getAsync(`Subtype`);if(l=l instanceof I?l.name:null,l===`Link`)return;if(c.has(`T`)){let t=Nn(await c.getAsync(`T`));e=e===``?t:`${e}.${t}`}else{let n=c;for(;;){if(n=n.getRaw(`Parent`)||t,n instanceof R){if(a.has(n))break;n=await s.fetchAsync(n)}if(!(n instanceof L))break;if(n.has(`T`)){let t=Nn(await n.getAsync(`T`));e=e===``?t:`${e}.${t}`;break}}}if(t&&!c.has(`Parent`)&&Zn(c.get(`Subtype`),`Widget`)&&o.put(n,t),r.has(e)||r.set(e,[]),r.get(e).push(Dx.create(s,n,i,null,!0,o,null,null).then(e=>e?.getFieldObject()).catch(function(e){return N(`#collectFieldObjects: "${e}".`),null})),!c.has(`Kids`))return;let u=await c.getAsync(`Kids`);if(Array.isArray(u))for(let t of u)await this.#s(e,n,t,r,i,a,o)}get fieldObjects(){return P(this,`fieldObjects`,this.pdfManager.ensureDoc(`formInfo`).then(async e=>{if(!e.hasFields)return null;let t=await this.annotationGlobals;if(!t)return null;let{acroForm:n}=t,r=new Yn,i=Object.create(null),a=new Map,o=new Xn;for(let e of n.get(`Fields`))await this.#s(``,null,e,a,t,r,o);let s=[];for(let[e,t]of a)s.push(Promise.all(t).then(t=>{(t=t.filter(e=>!!e)).length>0&&(i[e]=t)}));return await Promise.all(s),{allFields:On(i)>0?i:null,orphanFields:o}}))}get hasJSActions(){return P(this,`hasJSActions`,this.pdfManager.ensureDoc(`_parseHasJSActions`))}async _parseHasJSActions(){let[e,t]=await Promise.all([this.pdfManager.ensureCatalog(`jsActions`),this.pdfManager.ensureDoc(`fieldObjects`)]);return!!e||!!t?.allFields&&Object.values(t.allFields).some(e=>e.some(e=>e.actions!==null))}get calculationOrderIds(){let e=this.catalog.acroForm?.get(`CO`);if(!Array.isArray(e)||e.length===0)return P(this,`calculationOrderIds`,null);let t=[];for(let n of e)n instanceof R&&t.push(n.toString());return P(this,`calculationOrderIds`,t.length?t:null)}get annotationGlobals(){return P(this,`annotationGlobals`,Dx.createGlobals(this.pdfManager))}},qS=class{constructor({docBaseUrl:e,docId:t,enableXfa:n,evaluatorOptions:r,handler:i,password:a}){this._docBaseUrl=function(e){if(e){let t=vn(e);if(t)return t.href;N(`Invalid absolute docBaseUrl: "${e}".`)}return null}(e),this._docId=t,this._password=a,this.enableXfa=n,r.isOffscreenCanvasSupported&&=kn.isOffscreenCanvasSupported,r.isImageDecoderSupported&&=kn.isImageDecoderSupported,this.evaluatorOptions=Object.freeze(r),Ci.setOptions(r),Xi.setOptions(r),ra.setOptions(r);let o={...r,handler:i};Qi.setOptions(o),mi.setOptions(o),hi.setOptions(o)}get docId(){return this._docId}get password(){return this._password}get docBaseUrl(){return this._docBaseUrl}ensureDoc(e,t){return this.ensure(this.pdfDocument,e,t)}ensureXRef(e,t){return this.ensure(this.pdfDocument.xref,e,t)}ensureCatalog(e,t){return this.ensure(this.pdfDocument.catalog,e,t)}getPage(e){return this.pdfDocument.getPage(e)}fontFallback(e,t){return this.pdfDocument.fontFallback(e,t)}cleanup(e=!1){return this.pdfDocument.cleanup(e)}async ensure(e,t,n){gn("Abstract method `ensure` called")}requestRange(e,t){gn("Abstract method `requestRange` called")}requestLoadedStream(e=!1){gn("Abstract method `requestLoadedStream` called")}sendProgressiveData(e){gn("Abstract method `sendProgressiveData` called")}updatePassword(e){this._password=e}terminate(e){gn("Abstract method `terminate` called")}},JS=class extends qS{constructor(e){super(e);let t=new gi(e.source);this.pdfDocument=new KS(this,t),this._loadedStreamPromise=Promise.resolve(t)}async ensure(e,t,n){let r=e[t];return typeof r==`function`?r.apply(e,n):r}requestRange(e,t){return Promise.resolve()}requestLoadedStream(e=!1){return this._loadedStreamPromise}terminate(e){}},YS=class extends qS{constructor(e){super(e),this.streamManager=new bi(e.source,{msgHandler:e.handler,length:e.length,disableAutoFetch:e.disableAutoFetch,rangeChunkSize:e.rangeChunkSize}),this.pdfDocument=new KS(this,this.streamManager.getStream())}async ensure(e,t,n){try{let r=e[t];return typeof r==`function`?r.apply(e,n):r}catch(r){if(!(r instanceof cr))throw r;return await this.requestRange(r.begin,r.end),this.ensure(e,t,n)}}requestRange(e,t){return this.streamManager.requestRange(e,t)}requestLoadedStream(e=!1){return this.streamManager.requestAllChunks(e)}sendProgressiveData(e){this.streamManager.onReceiveData({chunk:e})}terminate(e){this.streamManager.abort(e)}},XS=1,ZS=2,QS=1,$S=2,eC=3,tC=4,nC=5,rC=6,iC=7,aC=8;function oC(){}function sC(e){if(e instanceof wn||e instanceof Sn||e instanceof bn||e instanceof Cn||e instanceof xn)return e;switch(e instanceof Error||typeof e==`object`&&e||gn(`wrapReason: Expected "reason" to be a (possibly cloned) Error.`),e.name){case`AbortException`:return new wn(e.message);case`InvalidPDFException`:return new Sn(e.message);case`PasswordException`:return new bn(e.message,e.code);case`ResponseException`:return new Cn(e.message,e.status,e.missing);case`UnknownErrorException`:return new xn(e.message,e.details)}return new xn(e.message,e.toString())}var cC=class{#e=new AbortController;constructor(e,t,n){this.sourceName=e,this.targetName=t,this.comObj=n,this.callbackId=1,this.streamId=1,this.streamSinks=Object.create(null),this.streamControllers=Object.create(null),this.callbackCapabilities=Object.create(null),this.actionHandler=Object.create(null),n.addEventListener(`message`,this.#t.bind(this),{signal:this.#e.signal})}#t({data:e}){if(e.targetName!==this.sourceName)return;if(e.stream)return void this.#r(e);if(e.callback){let t=e.callbackId,n=this.callbackCapabilities[t];if(!n)throw Error(`Cannot resolve callback ${t}`);if(delete this.callbackCapabilities[t],e.callback===XS)n.resolve(e.data);else{if(e.callback!==ZS)throw Error(`Unexpected callback case`);n.reject(sC(e.reason))}return}let t=this.actionHandler[e.action];if(!t)throw Error(`Unknown action from worker: ${e.action}`);if(e.callbackId){let n=this.sourceName,r=e.sourceName,i=this.comObj;Promise.try(t,e.data).then(function(t){i.postMessage({sourceName:n,targetName:r,callback:XS,callbackId:e.callbackId,data:t})},function(t){i.postMessage({sourceName:n,targetName:r,callback:ZS,callbackId:e.callbackId,reason:sC(t)})});return}e.streamId?this.#n(e):t(e.data)}on(e,t){let n=this.actionHandler;if(n[e])throw Error(`There is already an actionName called "${e}"`);n[e]=t}send(e,t,n){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,data:t},n)}sendWithPromise(e,t,n){let r=this.callbackId++,i=Promise.withResolvers();this.callbackCapabilities[r]=i;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,callbackId:r,data:t},n)}catch(e){i.reject(e)}return i.promise}sendWithStream(e,t,n,r){let i=this.streamId++,a=this.sourceName,o=this.targetName,s=this.comObj;return new ReadableStream({start:n=>{let c=Promise.withResolvers();return this.streamControllers[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.streamControllers[i].pullCall=t,s.postMessage({sourceName:a,targetName:o,stream:rC,streamId:i,desiredSize:e.desiredSize}),t.promise},cancel:e=>{_n(e instanceof Error,`cancel must have a valid reason`);let t=Promise.withResolvers();return this.streamControllers[i].cancelCall=t,this.streamControllers[i].isClosed=!0,s.postMessage({sourceName:a,targetName:o,stream:QS,streamId:i,reason:sC(e)}),t.promise}},n)}#n(e){let t=e.streamId,n=this.sourceName,r=e.sourceName,i=this.comObj,a=this,o=this.actionHandler[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:tC,streamId:t,chunk:e},o)},close(){this.isCancelled||(this.isCancelled=!0,i.postMessage({sourceName:n,targetName:r,stream:eC,streamId:t}),delete a.streamSinks[t])},error(e){_n(e instanceof Error,`error must have a valid reason`),this.isCancelled||(this.isCancelled=!0,i.postMessage({sourceName:n,targetName:r,stream:nC,streamId:t,reason:sC(e)}))},sinkCapability:Promise.withResolvers(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:e.desiredSize,ready:null};s.sinkCapability.resolve(),s.ready=s.sinkCapability.promise,this.streamSinks[t]=s,Promise.try(o,e.data,s).then(function(){i.postMessage({sourceName:n,targetName:r,stream:aC,streamId:t,success:!0})},function(e){i.postMessage({sourceName:n,targetName:r,stream:aC,streamId:t,reason:sC(e)})})}#r(e){let t=e.streamId,n=this.sourceName,r=e.sourceName,i=this.comObj,a=this.streamControllers[t],o=this.streamSinks[t];switch(e.stream){case aC:e.success?a.startCall.resolve():a.startCall.reject(sC(e.reason));break;case iC:e.success?a.pullCall.resolve():a.pullCall.reject(sC(e.reason));break;case rC:if(!o){i.postMessage({sourceName:n,targetName:r,stream:iC,streamId:t,success:!0});break}o.desiredSize<=0&&e.desiredSize>0&&o.sinkCapability.resolve(),o.desiredSize=e.desiredSize,Promise.try(o.onPull||oC).then(function(){i.postMessage({sourceName:n,targetName:r,stream:iC,streamId:t,success:!0})},function(e){i.postMessage({sourceName:n,targetName:r,stream:iC,streamId:t,reason:sC(e)})});break;case tC:if(_n(a,`enqueue should have stream controller`),a.isClosed)break;a.controller.enqueue(e.chunk);break;case eC:if(_n(a,`close should have stream controller`),a.isClosed)break;a.isClosed=!0,a.controller.close(),this.#i(a,t);break;case nC:_n(a,`error should have stream controller`),a.controller.error(sC(e.reason)),this.#i(a,t);break;case $S:e.success?a.cancelCall.resolve():a.cancelCall.reject(sC(e.reason)),this.#i(a,t);break;case QS:if(!o)break;let s=sC(e.reason);Promise.try(o.onCancel||oC,s).then(function(){i.postMessage({sourceName:n,targetName:r,stream:$S,streamId:t,success:!0})},function(e){i.postMessage({sourceName:n,targetName:r,stream:$S,streamId:t,reason:sC(e)})}),o.sinkCapability.reject(s),o.isCancelled=!0,delete this.streamSinks[t];break;default:throw Error(`Unexpected stream case`)}}async#i(e,t){await Promise.allSettled([e.startCall?.promise,e.pullCall?.promise,e.cancelCall?.promise]),delete this.streamControllers[t]}destroy(){this.#e?.abort(),this.#e=null}};async function lC(e,t,n,{encrypt:r=null}){let i=r?.createCipherTransform(e.num,e.gen);n.push(`${e.num} ${e.gen} obj\n`),t instanceof L?await uC(t,n,i):t instanceof tr?await dC(t,n,i):(Array.isArray(t)||ArrayBuffer.isView(t))&&await fC(t,n,i),n.push(`
31
31
  endobj
32
32
  `)}async function uC(e,t,n){t.push(`<<`);for(let r of e.getKeys())t.push(` /${Or(r)} `),await pC(e.getRaw(r),t,n);t.push(`>>`)}async function dC(e,t,n){let r=e.getBytes(),{dict:i}=e,[a,o]=await Promise.all([i.getAsync(`Filter`),i.getAsync(`DecodeParms`)]),s=Zn(Array.isArray(a)?await i.xref.fetchIfRefAsync(a[0]):a,`FlateDecode`);if(r.length>=256||s)try{let e=new CompressionStream(`deflate`),t=e.writable.getWriter();await t.ready,t.write(r).then(async()=>{await t.ready,await t.close()}).catch(()=>{});let n=await new Response(e.readable).arrayBuffer(),c,l;r=new Uint8Array(n),a?s||(c=Array.isArray(a)?[I.get(`FlateDecode`),...a]:[I.get(`FlateDecode`),a],o&&(l=Array.isArray(o)?[null,...o]:[null,o])):c=I.get(`FlateDecode`),c&&i.set(`Filter`,c),l&&i.set(`DecodeParms`,l)}catch(e){hn(`writeStream - cannot compress data: "${e}".`)}let c=Tn(r);n&&(c=n.encryptString(c)),i.set(`Length`,c.length),await uC(i,t,n),t.push(` stream
33
33
  `,c,`
@@ -41,7 +41,7 @@ endstream`)}async function fC(e,t,n){t.push(`[`);let r=!0;for(let i of e)r?r=!1:
41
41
  startxref
42
42
  `,t.toString(),`
43
43
  %%EOF
44
- `)}(t,h,m,f,p));let _=e.length+Math.sumPrecise(p.map(e=>e.length)),v=new Uint8Array(_);v.set(e);let y=e.length;for(let e of p)y=hC(e,y,v);return v}var bC=class{constructor(e){this._msgHandler=e,this._contentLength=null,this._fullRequestReader=null,this._rangeRequestReaders=[]}getFullReader(){return _n(!this._fullRequestReader,`PDFWorkerStream.getFullReader can only be called once.`),this._fullRequestReader=new xC(this._msgHandler),this._fullRequestReader}getRangeReader(e,t){let n=new SC(e,t,this._msgHandler);return this._rangeRequestReaders.push(n),n}cancelAllRequests(e){this._fullRequestReader?.cancel(e);for(let t of this._rangeRequestReaders.slice(0))t.cancel(e)}},xC=class{constructor(e){this._msgHandler=e,this.onProgress=null,this._contentLength=null,this._isRangeSupported=!1,this._isStreamingSupported=!1,this._reader=this._msgHandler.sendWithStream(`GetReader`).getReader(),this._headersReady=this._msgHandler.sendWithPromise(`ReaderHeadersReady`).then(e=>{this._isStreamingSupported=e.isStreamingSupported,this._isRangeSupported=e.isRangeSupported,this._contentLength=e.contentLength})}get headersReady(){return this._headersReady}get contentLength(){return this._contentLength}get isStreamingSupported(){return this._isStreamingSupported}get isRangeSupported(){return this._isRangeSupported}async read(){let{value:e,done:t}=await this._reader.read();return t?{value:void 0,done:!0}:{value:e.buffer,done:!1}}cancel(e){this._reader.cancel(e)}},SC=class{constructor(e,t,n){this._msgHandler=n,this.onProgress=null,this._reader=this._msgHandler.sendWithStream(`GetRangeReader`,{begin:e,end:t}).getReader()}get isStreamingSupported(){return!1}async read(){let{value:e,done:t}=await this._reader.read();return t?{value:void 0,done:!0}:{value:e.buffer,done:!1}}cancel(e){this._reader.cancel(e)}},CC=class{constructor(e){this.name=e,this.terminated=!1,this._capability=Promise.withResolvers()}get finished(){return this._capability.promise}finish(){this._capability.resolve()}terminate(){this.terminated=!0}ensureNotTerminated(){if(this.terminated)throw Error(`Worker task was terminated`)}},wC=class{static{typeof window>`u`&&!t&&typeof self<`u`&&typeof self.postMessage==`function`&&`onmessage`in self&&this.initializeFromPort(self)}static setup(e,t){let n=!1;e.on(`test`,t=>{n||(n=!0,e.send(`test`,t instanceof Uint8Array))}),e.on(`configure`,e=>{var t=e.verbosity;Number.isInteger(t)&&(mn=t)}),e.on(`GetDocRequest`,e=>this.createDocumentHandler(e,t))}static createDocumentHandler(e,t){let n,r=!1,i=null,a=new Set,o=mn,{docId:s,apiVersion:c}=e,l=`5.4.296`;if(c!==l)throw Error(`The API version "${c}" does not match the Worker version "${l}".`);let u=(e,t)=>`The \`${e}.prototype\` contains unexpected enumerable property "${t}", thus breaking e.g. \`for...in\` iteration of ${e}s.`;for(let e in{})throw Error(u(`Object`,e));for(let e in[])throw Error(u(`Array`,e));let d=s+`_worker`,f=new cC(d,s,t);function p(){if(r)throw Error(`Worker was terminated`)}function m(e){a.add(e)}function h(e){e.finish(),a.delete(e)}async function g(e){await n.ensureDoc(`checkHeader`),await n.ensureDoc(`parseStartXRef`),await n.ensureDoc(`parse`,[e]),await n.ensureDoc(`checkFirstPage`,[e]),await n.ensureDoc(`checkLastPage`,[e]);let t=await n.ensureDoc(`isPureXfa`);if(t){let e=new CC(`loadXfaResources`);m(e),await n.ensureDoc(`loadXfaResources`,[f,e]),h(e)}let[r,i]=await Promise.all([n.ensureDoc(`numPages`),n.ensureDoc(`fingerprints`)]);return{numPages:r,fingerprints:i,htmlForXfa:t?await n.ensureDoc(`htmlForXfa`):null}}function _(e){function t(e){p(),f.send(`GetDoc`,{pdfInfo:e})}function a(e){if(p(),e instanceof bn){let t=new CC(`PasswordException: response ${e.code}`);m(t),f.sendWithPromise(`PasswordRequest`,e).then(function({password:e}){h(t),n.updatePassword(e),o()}).catch(function(){h(t),f.send(`DocException`,e)})}else f.send(`DocException`,sC(e))}function o(){p(),g(!1).then(t,function(e){p(),e instanceof dr?n.requestLoadedStream().then(function(){p(),g(!0).then(t,a)}):a(e)})}p(),async function({data:e,password:t,disableAutoFetch:n,rangeChunkSize:r,length:a,docBaseUrl:o,enableXfa:c,evaluatorOptions:l}){let u={source:null,disableAutoFetch:n,docBaseUrl:o,docId:s,enableXfa:c,evaluatorOptions:l,handler:f,length:a,password:t,rangeChunkSize:r};if(e)return u.source=e,new JS(u);let d=new bC(f),m=d.getFullReader(),h=Promise.withResolvers(),g,_=[],v=0;return m.headersReady.then(function(){if(m.isRangeSupported){u.source=d,u.length=m.contentLength,u.disableAutoFetch||=m.isStreamingSupported,g=new YS(u);for(let e of _)g.sendProgressiveData(e);_=[],h.resolve(g),i=null}}).catch(function(e){h.reject(e),i=null}),new Promise(function(e,t){let n=function({value:e,done:r}){try{if(p(),r){if(!g){let e=fr(_);_=[],a&&e.length!==a&&N(`reported HTTP length is different from actual`),u.source=e,g=new JS(u),h.resolve(g)}i=null;return}v+=e.byteLength,m.isStreamingSupported||f.send(`DocProgress`,{loaded:v,total:Math.max(v,m.contentLength||0)}),g?g.sendProgressiveData(e):_.push(e),m.read().then(n,t)}catch(e){t(e)}};m.read().then(n,t)}).catch(function(e){h.reject(e),i=null}),i=e=>{d.cancelAllRequests(e)},h.promise}(e).then(function(e){if(r)throw e.terminate(new wn(`Worker was terminated.`)),Error(`Worker was terminated`);n=e,n.requestLoadedStream(!0).then(e=>{f.send(`DataLoaded`,{length:e.bytes.byteLength})})}).then(o,a)}return f.on(`GetPage`,function(e){return n.getPage(e.pageIndex).then(function(e){return Promise.all([n.ensure(e,`rotate`),n.ensure(e,`ref`),n.ensure(e,`userUnit`),n.ensure(e,`view`)]).then(function([e,t,n,r]){return{rotate:e,ref:t,refStr:t?.toString()??null,userUnit:n,view:r}})})}),f.on(`GetPageIndex`,function(e){let t=R.get(e.num,e.gen);return n.ensureCatalog(`getPageIndex`,[t])}),f.on(`GetDestinations`,function(e){return n.ensureCatalog(`destinations`)}),f.on(`GetDestination`,function(e){return n.ensureCatalog(`getDestination`,[e.id])}),f.on(`GetPageLabels`,function(e){return n.ensureCatalog(`pageLabels`)}),f.on(`GetPageLayout`,function(e){return n.ensureCatalog(`pageLayout`)}),f.on(`GetPageMode`,function(e){return n.ensureCatalog(`pageMode`)}),f.on(`GetViewerPreferences`,function(e){return n.ensureCatalog(`viewerPreferences`)}),f.on(`GetOpenAction`,function(e){return n.ensureCatalog(`openAction`)}),f.on(`GetAttachments`,function(e){return n.ensureCatalog(`attachments`)}),f.on(`GetDocJSActions`,function(e){return n.ensureCatalog(`jsActions`)}),f.on(`GetPageJSActions`,function({pageIndex:e}){return n.getPage(e).then(e=>n.ensure(e,`jsActions`))}),f.on(`GetAnnotationsByType`,async function({types:e,pageIndexesToSkip:t}){let[r,i]=await Promise.all([n.ensureDoc(`numPages`),n.ensureDoc(`annotationGlobals`)]);if(!i)return null;let a=[],o=[],s=null;try{for(let c=0,l=r;c<l;c++)t?.has(c)||(s||(s=new CC(`GetAnnotationsByType`),m(s)),a.push(n.getPage(c).then(async t=>t&&t.collectAnnotationsByType(f,s,e,o,i)||[])));return await Promise.all(a),(await Promise.all(o)).filter(e=>!!e)}finally{s&&h(s)}}),f.on(`GetOutline`,function(e){return n.ensureCatalog(`documentOutline`)}),f.on(`GetOptionalContentConfig`,function(e){return n.ensureCatalog(`optionalContentConfig`)}),f.on(`GetPermissions`,function(e){return n.ensureCatalog(`permissions`)}),f.on(`GetMetadata`,function(e){return Promise.all([n.ensureDoc(`documentInfo`),n.ensureCatalog(`metadata`)])}),f.on(`GetMarkInfo`,function(e){return n.ensureCatalog(`markInfo`)}),f.on(`GetData`,function(e){return n.requestLoadedStream().then(e=>e.bytes)}),f.on(`GetAnnotations`,function({pageIndex:e,intent:t}){return n.getPage(e).then(function(n){let r=new CC(`GetAnnotations: page ${e}`);return m(r),n.getAnnotationsData(f,r,t).then(e=>(h(r),e),e=>{throw h(r),e})})}),f.on(`GetFieldObjects`,function(e){return n.ensureDoc(`fieldObjects`).then(e=>e?.allFields||null)}),f.on(`HasJSActions`,function(e){return n.ensureDoc(`hasJSActions`)}),f.on(`GetCalculationOrderIds`,function(e){return n.ensureDoc(`calculationOrderIds`)}),f.on(`SaveDocument`,async function({isPureXfa:e,numPages:t,annotationStorage:r,filename:i}){let a=[n.requestLoadedStream(),n.ensureCatalog(`acroForm`),n.ensureCatalog(`acroFormRef`),n.ensureDoc(`startXRef`),n.ensureDoc(`xref`),n.ensureCatalog(`structTreeRoot`)],o=new Xn,s=[],c=e?null:zr(r),[l,u,d,p,g,_]=await Promise.all(a),v=g.trailer.getRaw(`Root`)||null,y;if(c){_?await _.canUpdateStructTree({pdfManager:n,newAnnotationsByPage:c})&&(y=_):await nf.canCreateStructureTree({catalogRef:v,pdfManager:n,newAnnotationsByPage:c})&&(y=null);let e=Dx.generateImages(r.values(),g,n.evaluatorOptions.isOffscreenCanvasSupported),t=y===void 0?s:[];for(let[r,i]of c)t.push(n.getPage(r).then(t=>{let n=new CC(`Save (editor): page ${r}`);return m(n),t.saveNewAnnotations(f,n,i,e,o).finally(function(){h(n)})}));y===null?s.push(Promise.all(t).then(async()=>{await nf.createStructureTree({newAnnotationsByPage:c,xref:g,catalogRef:v,pdfManager:n,changes:o})})):y&&s.push(Promise.all(t).then(async()=>{await y.updateStructureTree({newAnnotationsByPage:c,pdfManager:n,changes:o})}))}if(e)s.push(n.ensureDoc(`serializeXfaData`,[r]));else for(let e=0;e<t;e++)s.push(n.getPage(e).then(function(t){let n=new CC(`Save: page ${e}`);return m(n),t.save(f,n,r,o).finally(function(){h(n)})}));let b=await Promise.all(s),x=null;if(e){if(x=b[0],!x)return l.bytes}else if(o.size===0)return l.bytes;let S=d&&u instanceof L&&o.values().some(e=>e.needAppearances),C=u instanceof L&&u.get(`XFA`)||null,w=null,T=!1;if(Array.isArray(C)){for(let e=0,t=C.length;e<t;e+=2)C[e]===`datasets`&&(w=C[e+1],T=!0);w===null&&(w=g.getNewTemporaryRef())}else C&&N(`Unsupported XFA type.`);let E=Object.create(null);if(g.trailer){let e=new Map,t=g.trailer.get(`Info`)||null;if(t instanceof L)for(let[n,r]of t)typeof r==`string`&&e.set(n,Nn(r));E={rootRef:v,encryptRef:g.trailer.getRaw(`Encrypt`)||null,newRef:g.getNewTemporaryRef(),infoRef:g.trailer.getRaw(`Info`)||null,infoMap:e,fileIds:g.trailer.get(`ID`)||null,startXRef:p,filename:i}}return yC({originalData:l.bytes,xrefInfo:E,changes:o,xref:g,hasXfa:!!C,xfaDatasetsRef:w,hasXfaDatasetsEntry:T,needAppearances:S,acroFormRef:d,acroForm:u,xfaData:x,useXrefStream:$n(g.topDict,`XRef`)}).finally(()=>{g.resetNewTemporaryRef()})}),f.on(`GetOperatorList`,function(e,t){let r=e.pageIndex;n.getPage(r).then(function(n){let i=new CC(`GetOperatorList: page ${r}`);m(i);let a=o>=Ce?Date.now():0;n.getOperatorList({handler:f,sink:t,task:i,intent:e.intent,cacheKey:e.cacheKey,annotationStorage:e.annotationStorage,modifiedIds:e.modifiedIds}).then(function(e){h(i),a&&hn(`page=${r+1} - getOperatorList: time=${Date.now()-a}ms, len=${e.length}`),t.close()},function(e){h(i),i.terminated||t.error(e)})})}),f.on(`GetTextContent`,function(e,t){let{pageIndex:r,includeMarkedContent:i,disableNormalization:a}=e;n.getPage(r).then(function(e){let n=new CC(`GetTextContent: page `+r);m(n);let s=o>=Ce?Date.now():0;e.extractTextContent({handler:f,task:n,sink:t,includeMarkedContent:i,disableNormalization:a}).then(function(){h(n),s&&hn(`page=${r+1} - getTextContent: time=`+(Date.now()-s)+`ms`),t.close()},function(e){h(n),n.terminated||t.error(e)})})}),f.on(`GetStructTree`,function(e){return n.getPage(e.pageIndex).then(e=>n.ensure(e,`getStructTree`))}),f.on(`FontFallback`,function(e){return n.fontFallback(e.id,f)}),f.on(`Cleanup`,function(e){return n.cleanup(!0)}),f.on(`Terminate`,function(e){r=!0;let t=[];if(n){n.terminate(new wn(`Worker was terminated.`));let e=n.cleanup();t.push(e),n=null}else Id();i?.(new wn(`Worker was terminated.`));for(let e of a)t.push(e.finished),e.terminate();return Promise.all(t).then(function(){f.destroy(),f=null})}),f.on(`Ready`,function(t){_(e),e=null}),d}static initializeFromPort(e){let t=new cC(`worker`,`main`,e);this.setup(t,e),t.send(`ready`,null)}};globalThis.pdfjsWorker={WorkerMessageHandler:wC};var TC=!(typeof process!=`object`||process+``!=`[object process]`||process.versions.nw||process.versions.electron&&process.type&&process.type!==`browser`),EC=[.001,0,0,.001,0,0],DC=1.35,OC=1,kC=2,AC=4,jC=16,MC=32,NC=64,PC=128,FC=256,IC={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3},LC=`pdfjs_internal_editor_`,RC={DISABLE:-1,NONE:0,FREETEXT:3,HIGHLIGHT:9,STAMP:13,INK:15,POPUP:16,SIGNATURE:101,COMMENT:102},zC={RESIZE:1,CREATE:2,FREETEXT_SIZE:11,FREETEXT_COLOR:12,FREETEXT_OPACITY:13,INK_COLOR:21,INK_THICKNESS:22,INK_OPACITY:23,HIGHLIGHT_COLOR:31,HIGHLIGHT_THICKNESS:32,HIGHLIGHT_FREE:33,HIGHLIGHT_SHOW_ALL:34,DRAW_STEP:41},BC={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},VC=0,HC=1,UC=2,WC=3,GC=3,KC=4,qC={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},JC={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},YC=1,XC=2,ZC=3,QC=4,$C=5,ew={ERRORS:0,WARNINGS:1,INFOS:5},tw={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},nw=0,rw=1,iw=2,aw=3,ow={NEED_PASSWORD:1,INCORRECT_PASSWORD:2},sw=ew.WARNINGS;function cw(e){Number.isInteger(e)&&(sw=e)}function lw(){return sw}function uw(e){sw>=ew.INFOS&&console.info(`Info: ${e}`)}function dw(e){sw>=ew.WARNINGS&&console.warn(`Warning: ${e}`)}function fw(e){throw Error(e)}function pw(e,t){e||fw(t)}function mw(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=decodeURIComponent(escape(e))}catch{}let r=t?URL.parse(e,t):URL.parse(e);return function(e){switch(e?.protocol){case`http:`:case`https:`:case`ftp:`:case`mailto:`:case`tel:`:return!0;default:return!1}}(r)?r:null}function hw(e,t,n=!1){let r=URL.parse(e);return r?(r.hash=t,r.href):n&&mw(e,`http://example.com`)?e.split(`#`,1)[0]+(t?`#${t}`:``):``}function gw(e,t,n,r=!1){return Object.defineProperty(e,t,{value:n,enumerable:!r,configurable:!0,writable:!1}),n}var _w=function(){function e(e,t){this.message=e,this.name=t}return e.prototype=Error(),e.constructor=e,e}(),vw=class extends _w{constructor(e,t){super(e,`PasswordException`),this.code=t}},yw=class extends _w{constructor(e,t){super(e,`UnknownErrorException`),this.details=t}},bw=class extends _w{constructor(e){super(e,`InvalidPDFException`)}},xw=class extends _w{constructor(e,t,n){super(e,`ResponseException`),this.status=t,this.missing=n}},Sw=class extends _w{constructor(e){super(e,`FormatError`)}},Cw=class extends _w{constructor(e){super(e,`AbortException`)}};function ww(e){typeof e==`object`&&e?.length!==void 0||fw(`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 Tw(e){typeof e!=`string`&&fw(`Invalid argument for stringToBytes`);let t=e.length,n=new Uint8Array(t);for(let r=0;r<t;++r)n[r]=255&e.charCodeAt(r);return n}var Ew=class{static get isLittleEndian(){return gw(this,`isLittleEndian`,function(){let e=new Uint8Array(4);return e[0]=1,new Uint32Array(e.buffer,0,1)[0]===1}())}static get isEvalSupported(){return gw(this,`isEvalSupported`,function(){try{return Function(``),!0}catch{return!1}}())}static get isOffscreenCanvasSupported(){return gw(this,`isOffscreenCanvasSupported`,typeof OffscreenCanvas<`u`)}static get isImageDecoderSupported(){return gw(this,`isImageDecoderSupported`,typeof ImageDecoder<`u`)}static get platform(){let{platform:e,userAgent:t}=navigator;return gw(this,`platform`,{isAndroid:t.includes(`Android`),isLinux:e.includes(`Linux`),isMac:e.includes(`Mac`),isWindows:e.includes(`Win`),isFirefox:t.includes(`Firefox`)})}static get isCSSRoundSupported(){return gw(this,`isCSSRoundSupported`,globalThis.CSS?.supports?.(`width: round(1.5px, 1px)`))}},Dw=Array.from(Array(256).keys(),e=>e.toString(16).padStart(2,`0`)),Q=class{static makeHexColor(e,t,n){return`#${Dw[e]}${Dw[t]}${Dw[n]}`}static domMatrixToTransform(e){return[e.a,e.b,e.c,e.d,e.e,e.f]}static scaleMinMax(e,t){let n;e[0]?(e[0]<0&&(n=t[0],t[0]=t[2],t[2]=n),t[0]*=e[0],t[2]*=e[0],e[3]<0&&(n=t[1],t[1]=t[3],t[3]=n),t[1]*=e[3],t[3]*=e[3]):(n=t[0],t[0]=t[1],t[1]=n,n=t[2],t[2]=t[3],t[3]=n,e[1]<0&&(n=t[1],t[1]=t[3],t[3]=n),t[1]*=e[1],t[3]*=e[1],e[2]<0&&(n=t[0],t[0]=t[2],t[2]=n),t[0]*=e[2],t[2]*=e[2]),t[0]+=e[4],t[1]+=e[5],t[2]+=e[4],t[3]+=e[5]}static transform(e,t){return[e[0]*t[0]+e[2]*t[1],e[1]*t[0]+e[3]*t[1],e[0]*t[2]+e[2]*t[3],e[1]*t[2]+e[3]*t[3],e[0]*t[4]+e[2]*t[5]+e[4],e[1]*t[4]+e[3]*t[5]+e[5]]}static multiplyByDOMMatrix(e,t){return[e[0]*t.a+e[2]*t.b,e[1]*t.a+e[3]*t.b,e[0]*t.c+e[2]*t.d,e[1]*t.c+e[3]*t.d,e[0]*t.e+e[2]*t.f+e[4],e[1]*t.e+e[3]*t.f+e[5]]}static applyTransform(e,t,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)return void(Math.abs(l)>=1e-12&&this.#e(e,t,n,r,i,a,o,s,-u/l,d));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*(3*(n-i)-e+o),6*(e-2*n+i),3*(n-e),c),this.#t(e,n,i,o,t,r,a,s,3*(3*(r-a)-t+s),6*(t-2*r+a),3*(r-t),c)}},Ow=null,kw=null;function Aw(e){return Ow||(Ow=/([\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,kw=new Map([[`ſt`,`ſt`]])),e.replaceAll(Ow,(e,t,n)=>t?t.normalize(`NFKC`):kw.get(n))}function jw(){if(typeof crypto.randomUUID==`function`)return crypto.randomUUID();let e=new Uint8Array(32);return crypto.getRandomValues(e),ww(e)}var Mw=`pdfjs_internal_id_`;function Nw(e,t,n){return Math.min(Math.max(e,t),n)}function Pw(e){return Uint8Array.prototype.toBase64?e.toBase64():btoa(ww(e))}typeof Promise.try!=`function`&&(Promise.try=function(e,...t){return new Promise(n=>{n(e(...t))})}),typeof Math.sumPrecise!=`function`&&(Math.sumPrecise=function(e){return e.reduce((e,t)=>e+t,0)});var Fw=class e{static textContent(t){let n=[],r={items:n,styles:Object.create(null)};return function t(r){if(!r)return;let i=null,a=r.name;if(a===`#text`)i=r.value;else{if(!e.shouldBuildText(a))return;r?.attributes?.textContent?i=r.attributes.textContent:r.value&&(i=r.value)}if(i!==null&&n.push({str:i}),r.children)for(let e of r.children)t(e)}(t),r}static shouldBuildText(e){return!(e===`textarea`||e===`input`||e===`option`||e===`select`)}},Iw=class{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:e.attributes.hasOwnProperty(`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)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`: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 render(e){let t=e.annotationStorage,n=e.linkService,r=e.xfaHtml,i=e.intent||`display`,a=document.createElement(r.name);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&&Fw.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=s?.attributes?.xmlns?document.createElementNS(s.attributes.xmlns,u):document.createElement(u);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&&Fw.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}},Lw=`http://www.w3.org/2000/svg`,Rw=class{static CSS=96;static PDF=72;static PDF_TO_CSS_UNITS=this.CSS/this.PDF};async function zw(e,t=`text`){if(qw(e,document.baseURI)){let n=await fetch(e);if(!n.ok)throw Error(n.statusText);switch(t){case`arraybuffer`:return n.arrayBuffer();case`blob`:return n.blob();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,i.onreadystatechange=()=>{if(i.readyState===XMLHttpRequest.DONE)if(i.status!==200&&i.status!==0)r(Error(i.statusText));else{switch(t){case`arraybuffer`:case`blob`:case`json`:n(i.response);return}n(i.responseText)}},i.send(null)})}var Bw=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,p,m,h,g;switch((r%=360)<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),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 gw(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 Q.applyTransform(n,this.transform),n}convertToViewportRectangle(e){let t=[e[0],e[1]];Q.applyTransform(t,this.transform);let n=[e[2],e[3]];return Q.applyTransform(n,this.transform),[t[0],t[1],n[0],n[1]]}convertToPdfPoint(e,t){let n=[e,t];return Q.applyInverseTransform(n,this.transform),n}},Vw=class extends _w{constructor(e,t=0){super(e,`RenderingCancelledException`),this.extraDelay=t}};function Hw(e){let t=e.length,n=0;for(;n<t&&e[n].trim()===``;)n++;return e.substring(n,n+5).toLowerCase()===`data:`}function Uw(e){return typeof e==`string`&&/\.pdf$/i.test(e)}function Ww(e){return[e]=e.split(/[#?]/,1),e.substring(e.lastIndexOf(`/`)+1)}function Gw(e,t=`document.pdf`){if(typeof e!=`string`)return t;if(Hw(e))return dw(`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=t.split(`/`).at(-1),t.test(/^\.pdf$/i)?t:e):t}catch{return e}},i=/\.pdf$/i,a=n.pathname.split(`/`).at(-1);if(i.test(a))return r(a);if(n.searchParams.size>0){let e=Array.from(n.searchParams.values()).reverse();for(let t of e)if(i.test(t))return r(t);let t=Array.from(n.searchParams.keys()).reverse();for(let e of t)if(i.test(e))return r(e)}if(n.hash){let e=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i.exec(n.hash);if(e)return r(e[0])}return t}var Kw=class{started=Object.create(null);times=[];time(e){e in this.started&&dw(`Timer is already running for ${e}`),this.started[e]=Date.now()}timeEnd(e){e in this.started||dw(`Timer has not been started for ${e}`),this.times.push({name:e,start:this.started[e],end:Date.now()}),delete this.started[e]}toString(){let e=[],t=0;for(let{name:e}of this.times)t=Math.max(e.length,t);for(let{name:n,start:r,end:i}of this.times)e.push(`${n.padEnd(t)} ${i-r}ms\n`);return e.join(``)}};function qw(e,t){let n=t?URL.parse(e,t):URL.parse(e);return n?.protocol===`http:`||n?.protocol===`https:`}function Jw(e){e.preventDefault()}function Yw(e){e.preventDefault(),e.stopPropagation()}var Xw=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 Zw(e,{scale:t=1,rotation:n=0}){let{width:r,height:i}=e.attributes.style;return new Bw({viewBox:[0,0,parseInt(r),parseInt(i)],userUnit:1,scale:t,rotation:n})}function Qw(e){if(e.startsWith(`#`)){let t=parseInt(e.slice(1),16);return[(16711680&t)>>16,(65280&t)>>8,255&t]}return e.startsWith(`rgb(`)?e.slice(4,-1).split(`,`).map(e=>parseInt(e)):e.startsWith(`rgba(`)?e.slice(5,-1).split(`,`).map(e=>parseInt(e)).slice(0,3):(dw(`Not a valid color format: "${e}"`),[0,0,0])}function $w(e){let{a:t,b:n,c:r,d:i,e:a,f:o}=e.getTransform();return[t,n,r,i,a,o]}function eT(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 tT(e,t,n=!1,r=!0){if(t instanceof Bw){let{pageWidth:r,pageHeight:i}=t.rawDims,{style:a}=e,o=Ew.isCSSRoundSupported,s=`var(--total-scale-factor) * ${r}px`,c=`var(--total-scale-factor) * ${i}px`,l=o?`round(down, ${s}, var(--scale-round-x))`:`calc(${s})`,u=o?`round(down, ${c}, var(--scale-round-y))`:`calc(${c})`;n&&t.rotation%180!=0?(a.width=u,a.height=l):(a.width=l,a.height=u)}r&&e.setAttribute(`data-main-rotation`,t.rotation)}var nT=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))>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)}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}},rT=[`image/apng`,`image/avif`,`image/bmp`,`image/gif`,`image/jpeg`,`image/png`,`image/svg+xml`,`image/webp`,`image/x-icon`],iT=class{static get isDarkMode(){return gw(this,`isDarkMode`,!!window?.matchMedia?.(`(prefers-color-scheme: dark)`).matches)}},aT=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(),gw(this,`commentForegroundColor`,Qw(n))}};function oT(e,t,n,r){let i=255*(1-(r=Math.min(Math.max(r??1,0),1)));return[e=Math.round(e*r+i),t=Math.round(t*r+i),n=Math.round(n*r+i)]}function sT(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]=60*((r-i)/e+(r<i?6:0));break;case r:t[0]=60*((i-n)/e+2);break;case i:t[0]=60*((n-r)/e+4)}}t[2]=s}function cT(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 lT(e){return e<=.03928?e/12.92:((e+.055)/1.055)**2.4}function uT(e,t,n){cT(e,n),n.map(lT);let r=.2126*n[0]+.7152*n[1]+.0722*n[2];cT(t,n),n.map(lT);let i=.2126*n[0]+.7152*n[1]+.0722*n[2];return r>i?(r+.05)/(i+.05):(i+.05)/(r+.05)}var dT=new Map;function fT(e,t){let n=e[0]+256*e[1]+65536*e[2]+16777216*t[0]+4294967296*t[1]+1099511627776*t[2],r=dT.get(n);if(r)return r;let i=new Float32Array(9),a=i.subarray(0,3),o=i.subarray(3,6);sT(e,o);let s=i.subarray(6,9);sT(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]),uT(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===uT(o,s,a)<l?e=n:t=n}o[2]=c?t:e}return cT(o,a),r=Q.makeHexColor(Math.round(255*a[0]),Math.round(255*a[1]),Math.round(255*a[2])),dT.set(n,r),r}function pT({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 Iw.render({xfaHtml:e,div:i,intent:`richText`});i.firstChild.classList.add(`richText`,n),r.append(i)}var mT=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`,Jw,{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,Yw(e)}#d(e){this.#n._focusEventsAllowed=!0,Yw(e)}#f(e){let t=this.#n._uiManager._signal;return t instanceof AbortSignal&&!t.aborted&&(e.addEventListener(`focusin`,this.#u.bind(this),{capture:!0,signal:t}),e.addEventListener(`focusout`,this.#d.bind(this),{capture:!0,signal:t}),e.addEventListener(`contextmenu`,Jw,{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);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`:this.addColorPicker(t);break;case`altText`:await this.addAltText(t);break;case`editSignature`:await this.addEditSignatureButton(t);break;case`delete`:this.addDeleteButton();break;case`comment`:this.addComment(t)}}async addButtonBefore(e,t,n){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}},hT=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`);let t=this.#n._signal;t instanceof AbortSignal&&!t.aborted&&e.addEventListener(`contextmenu`,Jw,{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`,Jw,{signal:o}),i.addEventListener(`click`,r,{signal:o})),this.#e.append(i)}};function gT(e,t,n){for(let r of n)t.addEventListener(r,e[r].bind(e))}var _T=class{#e=0;get id(){return`${LC}${this.#e++}`}},vT=class e{#e=jw();#t=0;#n=null;static get _isSVGFittingCanvas(){let e=new OffscreenCanvas(1,3).getContext(`2d`,{willReadFrequently:!0}),t=new Image;return t.src=`data:image/svg+xml;charset=UTF-8,<svg viewBox="0 0 1 1" width="1" height="1" xmlns="http://www.w3.org/2000/svg"><rect width="1" height="1" style="fill:red;"/></svg>`,gw(this,`_isSVGFittingCanvas`,t.decode().then(()=>(e.drawImage(t,0,0,1,1,0,0,1,3),new Uint32Array(e.getImageData(0,0,1,1).data.buffer)[0]===0)))}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{let t;if(r||={bitmap:null,id:`image_${this.#e}_${this.#t++}`,refCounter:0,isSvg:!1},typeof n==`string`?(r.url=n,t=await zw(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){dw(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}_`)}},yT=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)return this.#e.length>0&&(this.#e.length=0),this.#r=0,void this.#e.push(s);if(a&&this.#e[this.#r].type===i)return o&&(s.undo=this.#e[this.#r].undo),void(this.#e[this.#r]=s);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)return this.#e.splice(t+1,this.#r-t),void(this.#r=t);this.#e.length=0,this.#r=-1}}destroy(){this.#e=null}},bT=class{constructor(e){this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;let{isMac:t}=Ew.platform;for(let[n,r,i={}]of e)for(let e of n){let n=e.startsWith(`mac+`);t&&n?(this.callbacks.set(e.slice(4),{callback:r,options:i}),this.allKeys.add(e.split(`+`).at(-1))):t||n||(this.callbacks.set(e,{callback:r,options:i}),this.allKeys.add(e.split(`+`).at(-1)))}}#e(e){e.altKey&&this.buffer.push(`alt`),e.ctrlKey&&this.buffer.push(`ctrl`),e.metaKey&&this.buffer.push(`meta`),e.shiftKey&&this.buffer.push(`shift`),this.buffer.push(e.key);let t=this.buffer.join(`+`);return this.buffer.length=0,t}exec(e,t){if(!this.allKeys.has(t.key))return;let n=this.callbacks.get(this.#e(t));if(!n)return;let{callback:r,options:{bubbles:i=!1,args:a=[],checker:o=null}}=n;o&&!o(e,t)||(r.bind(e,...a,t)(),i||Yw(t))}},xT=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 function(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,Qw(r))}t.remove()}(e),gw(this,`_colors`,e)}convert(t){let n=Qw(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?Q.makeHexColor(...t):e}},ST=class e{#e=new AbortController;#t=null;#n=null;#r=new Map;#i=new Map;#a=null;#o=null;#s=null;#c=new yT;#l=null;#u=null;#d=null;#f=0;#p=new Set;#m=null;#h=null;#g=new Set;_editorUndoBar=null;#_=!1;#v=!1;#y=!1;#b=null;#x=null;#S=null;#C=null;#w=!1;#T=null;#E=new _T;#D=!1;#O=!1;#k=!1;#A=null;#j=null;#M=null;#N=null;#P=null;#F=RC.NONE;#I=new Set;#L=null;#R=null;#z=null;#B=null;#V=null;#H={isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1,hasSelectedText:!1};#U=[0,0];#W=null;#G=null;#K=null;#q=null;#J=null;static TRANSLATE_SMALL=1;static TRANSLATE_BIG=10;static get _keyboardManager(){let t=e.prototype,n=e=>e.#G.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 gw(this,`_keyboardManager`,new bT([[[`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`,`mac+Enter`],t.addNewEditorFromKeyboard,{checker:(e,{target:t})=>!(t instanceof HTMLButtonElement)&&e.#G.contains(t)&&!e.isEnterHandled}],[[` `,`mac+ `],t.addNewEditorFromKeyboard,{checker:(e,{target:t})=>!(t instanceof HTMLButtonElement)&&e.#G.contains(document.activeElement)}],[[`Escape`,`mac+Escape`],t.unselectAll],[[`ArrowLeft`,`mac+ArrowLeft`],t.translateSelectedEditors,{args:[-i,0],checker:n}],[[`ctrl+ArrowLeft`,`mac+shift+ArrowLeft`],t.translateSelectedEditors,{args:[-a,0],checker:n}],[[`ArrowRight`,`mac+ArrowRight`],t.translateSelectedEditors,{args:[i,0],checker:n}],[[`ctrl+ArrowRight`,`mac+shift+ArrowRight`],t.translateSelectedEditors,{args:[a,0],checker:n}],[[`ArrowUp`,`mac+ArrowUp`],t.translateSelectedEditors,{args:[0,-i],checker:n}],[[`ctrl+ArrowUp`,`mac+shift+ArrowUp`],t.translateSelectedEditors,{args:[0,-a],checker:n}],[[`ArrowDown`,`mac+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.#G=e,this.#K=t,this.#q=n,this.#a=r,this.#l=i,this.#R=a,this.#V=s,this._eventBus=o,o._on(`editingaction`,this.onEditingAction.bind(this),{signal:g}),o._on(`pagechanging`,this.onPageChanging.bind(this),{signal:g}),o._on(`scalechanging`,this.onScaleChanging.bind(this),{signal:g}),o._on(`rotationchanging`,this.onRotationChanging.bind(this),{signal:g}),o._on(`setpreference`,this.onSetPreference.bind(this),{signal:g}),o._on(`switchannotationeditorparams`,e=>this.updateParams(e.type,e.value),{signal:g}),window.addEventListener(`pointerdown`,()=>{this.#O=!0},{capture:!0,signal:g}),window.addEventListener(`pointerup`,()=>{this.#O=!1},{capture:!0,signal:g}),this.#ee(),this.#se(),this.#re(),this.#o=s.annotationStorage,this.#b=s.filterFactory,this.#z=c,this.#C=l||null,this.#_=u,this.#v=d,this.#y=f,this.#P=p||null,this.viewParameters={realScale:Rw.PDF_TO_CSS_UNITS,rotation:0},this.isShiftKeyDown=!1,this._editorUndoBar=m||null,this._supportsPinchToZoom=!1!==h,i?.setSidebarUiManager(this)}destroy(){this.#J?.resolve(),this.#J=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.#g.clear(),this.#N?.clear(),this.#t=null,this.#I.clear(),this.#c.destroy(),this.#a?.destroy(),this.#l?.destroy(),this.#R?.destroy(),this.#T?.hide(),this.#T=null,this.#M?.destroy(),this.#M=null,this.#n=null,this.#x&&=(clearTimeout(this.#x),null),this.#W&&=(clearTimeout(this.#W),null),this._editorUndoBar?.destroy(),this.#V=null}combinedSignal(e){return AbortSignal.any([this._signal,e.signal])}get mlManager(){return this.#P}get useNewAltTextFlow(){return this.#v}get useNewAltTextWhenAddingImage(){return this.#y}get hcmFilter(){return gw(this,`hcmFilter`,this.#z?this.#b.addHCMFilter(this.#z.foreground,this.#z.background):`none`)}get direction(){return gw(this,`direction`,getComputedStyle(this.#G).direction)}get _highlightColors(){return gw(this,`_highlightColors`,this.#C?new Map(this.#C.split(`,`).map(e=>((e=e.split(`=`).map(e=>e.trim()))[1]=e[1].toUpperCase(),e))):null)}get highlightColors(){let{_highlightColors:e}=this;if(!e)return gw(this,`highlightColors`,null);let t=new Map,n=!!this.#z;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 gw(this,`highlightColors`,t)}get highlightColorNames(){return gw(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.#d=e}setMainHighlightColorPicker(e){this.#M=e}editAltText(e,t=!1){this.#a?.editAltText(this,e,t)}hasCommentManager(){return!!this.#l}editComment(e,t,n,r){this.#l?.showDialog(this,e,t,n,r)}selectComment(e,t){(this.#i.get(e)?.getEditorByUID(t))?.toggleComment(!0,!0)}updateComment(e){this.#l?.updateComment(e.getData())}updatePopupColor(e){this.#l?.updatePopupColor(e)}removeComment(e){this.#l?.removeComments([e.uid])}toggleComment(e,t,n=void 0){this.#l?.toggleCommentPopup(e,t,n)}makeCommentColor(e,t){return e&&this.#l?.makeCommentColor(e,t)||null}getCommentDialogElement(){return this.#l?.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),await n}getSignature(e){this.#R?.getSignature({uiManager:this,editor:e})}get signatureManager(){return this.#R}switchToMode(e,t){this._eventBus.on(`annotationeditormodechanged`,t,{once:!0,signal:this._signal}),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.#y=t)}onPageChanging({pageNumber:e}){this.#f=e-1}focusMainContainer(){this.#G.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.#K.classList.toggle(`noUserSelect`,e)}addShouldRescale(e){this.#g.add(e)}removeShouldRescale(e){this.#g.delete(e)}onScaleChanging({scale:e}){this.commitOrRemove(),this.viewParameters.realScale=e*Rw.PDF_TO_CSS_UNITS;for(let e of this.#g)e.onScaleChanging();this.#d?.onScaleChanging()}onRotationChanging({pagesRotation:e}){this.commitOrRemove(),this.viewParameters.rotation=e}#Y({anchorNode:e}){return e.nodeType===Node.TEXT_NODE?e.parentElement:e}#X(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.#Y(n).closest(`.textLayer`),l=this.getSelectionBoxes(c);if(!l)return;n.empty();let u=this.#X(c),d=this.#F===RC.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(RC.HIGHLIGHT,f):f()}commentSelection(e=``){this.highlightSelection(e,!0)}#Z(){let e=document.getSelection();if(!e||e.isCollapsed)return;let t=this.#Y(e).closest(`.textLayer`),n=this.getSelectionBoxes(t);n&&(this.#T||=new hT(this),this.#T.show(t,n,this.direction===`ltr`))}getAndRemoveDataFromAnnotationStorage(e){if(!this.#o)return null;let t=`${LC}${e}`,n=this.#o.getRawValue(t);return n&&this.#o.remove(t),n}addToAnnotationStorage(e){e.isEmpty()||!this.#o||this.#o.has(e.id)||this.#o.setValue(e.id,e)}a11yAlert(e,t=null){let n=this.#q;n&&(n.setAttribute(`data-l10n-id`,e),t?n.setAttribute(`data-l10n-args`,JSON.stringify(t)):n.removeAttribute(`data-l10n-args`))}#Q(){let e=document.getSelection();if(!e||e.isCollapsed)return void(this.#L&&(this.#T?.hide(),this.#L=null,this.#ce({hasSelectedText:!1})));let{anchorNode:t}=e;if(t===this.#L)return;let n=this.#Y(e).closest(`.textLayer`);if(n){if(this.#T?.hide(),this.#L=t,this.#ce({hasSelectedText:!0}),(this.#F===RC.HIGHLIGHT||this.#F===RC.NONE)&&(this.#F===RC.HIGHLIGHT&&this.showAllEditors(`highlight`,!0,!0),this.#w=this.isShiftKeyDown,!this.isShiftKeyDown)){let e=this.#F===RC.HIGHLIGHT?this.#X(n):null;if(e?.toggleDrawing(),this.#O){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.#$(`main_toolbar`))};window.addEventListener(`pointerup`,r,{signal:n}),window.addEventListener(`blur`,r,{signal:n})}else e?.toggleDrawing(!0),this.#$(`main_toolbar`)}}else this.#L&&(this.#T?.hide(),this.#L=null,this.#ce({hasSelectedText:!1}))}#$(e=``){this.#F===RC.HIGHLIGHT?this.highlightSelection(e):this.#_&&this.#Z()}#ee(){document.addEventListener(`selectionchange`,this.#Q.bind(this),{signal:this._signal})}#te(){if(this.#S)return;this.#S=new AbortController;let e=this.combinedSignal(this.#S);window.addEventListener(`focus`,this.focus.bind(this),{signal:e}),window.addEventListener(`blur`,this.blur.bind(this),{signal:e})}#ne(){this.#S?.abort(),this.#S=null}blur(){if(this.isShiftKeyDown=!1,this.#w&&(this.#w=!1,this.#$(`main_toolbar`)),!this.hasSelection)return;let{activeElement:e}=document;for(let t of this.#I)if(t.div.contains(e)){this.#j=[t,e],t._focusEventsAllowed=!1;break}}focus(){if(!this.#j)return;let[e,t]=this.#j;this.#j=null,t.addEventListener(`focusin`,()=>{e._focusEventsAllowed=!0},{once:!0,signal:this._signal}),t.focus()}#re(){if(this.#A)return;this.#A=new AbortController;let e=this.combinedSignal(this.#A);window.addEventListener(`keydown`,this.keydown.bind(this),{signal:e}),window.addEventListener(`keyup`,this.keyup.bind(this),{signal:e})}#ie(){this.#A?.abort(),this.#A=null}#ae(){if(this.#u)return;this.#u=new AbortController;let e=this.combinedSignal(this.#u);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})}#oe(){this.#u?.abort(),this.#u=null}#se(){let e=this._signal;document.addEventListener(`dragover`,this.dragOver.bind(this),{signal:e}),document.addEventListener(`drop`,this.drop.bind(this),{signal:e})}addEditListeners(){this.#re(),this.#ae()}removeEditListeners(){this.#ie(),this.#oe()}dragOver(e){for(let{type:t}of e.dataTransfer.items)for(let n of this.#h)if(n.isHandlingMimeForPasting(t))return e.dataTransfer.dropEffect=`copy`,void e.preventDefault()}drop(e){for(let t of e.dataTransfer.items)for(let n of this.#h)if(n.isHandlingMimeForPasting(t.type))return n.paste(t,this.currentLayer),void e.preventDefault()}copy(e){if(e.preventDefault(),this.#t?.commitOrRemove(),!this.hasSelection)return;let t=[];for(let e of this.#I){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.#h)if(t.isHandlingMimeForPasting(e.type))return void t.paste(e,this.currentLayer);let n=t.getData(`application/pdfjs`);if(!n)return;try{n=JSON.parse(n)}catch(e){dw(`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.#fe(t);this.#he(e)},undo:()=>{for(let t of e)t.remove()},mustExec:!0})}catch(e){dw(`paste: "${e.message}".`)}}keydown(t){this.isShiftKeyDown||t.key!==`Shift`||(this.isShiftKeyDown=!0),this.#F===RC.NONE||this.isEditorHandlingKeyboard||e._keyboardManager.exec(this,t)}keyup(e){this.isShiftKeyDown&&e.key===`Shift`&&(this.isShiftKeyDown=!1,this.#w&&(this.#w=!1,this.#$(`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`)}}#ce(e){Object.entries(e).some(([e,t])=>this.#H[e]!==t)&&(this._eventBus.dispatch(`annotationeditorstateschanged`,{source:this,details:Object.assign(this.#H,e)}),this.#F===RC.HIGHLIGHT&&!1===e.hasSelectedEditor&&this.#le([[zC.HIGHLIGHT_FREE,!0]]))}#le(e){this._eventBus.dispatch(`annotationeditorparamschanged`,{source:this,details:e})}setEditingState(e){e?(this.#te(),this.#ae(),this.#ce({isEditing:this.#F!==RC.NONE,isEmpty:this.#me(),hasSomethingToUndo:this.#c.hasSomethingToUndo(),hasSomethingToRedo:this.#c.hasSomethingToRedo(),hasSelectedEditor:!1})):(this.#ne(),this.#oe(),this.#ce({isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(e){if(!this.#h){this.#h=e;for(let e of this.#h)this.#le(e.defaultPropertiesToUpdate)}}getId(){return this.#E.id}get currentLayer(){return this.#i.get(this.#f)}getLayer(e){return this.#i.get(e)}get currentPageIndex(){return this.#f}addLayer(e){this.#i.set(e.pageIndex,e),this.#D?e.enable():e.disable()}removeLayer(e){this.#i.delete(e.pageIndex)}async updateMode(e,t=null,n=!1,r=!1,i=!1){if(this.#F!==e&&(!this.#J||(await this.#J.promise,this.#J))){if(this.#J=Promise.withResolvers(),this.#d?.commitOrRemove(),this.#F===RC.POPUP&&this.#l?.hideSidebar(),this.#l?.destroyPopup(),this.#F=e,e===RC.NONE){this.setEditingState(!1),this.#de();for(let e of this.#r.values())e.hideStandaloneCommentButton();this._editorUndoBar?.hide(),this.toggleComment(null),this.#J.resolve();return}for(let e of this.#r.values())e.addStandaloneCommentButton();e===RC.SIGNATURE&&await this.#R?.loadSignatures(),this.setEditingState(!0),await this.#ue(),this.unselectAll();for(let t of this.#i.values())t.updateMode(e);if(e===RC.POPUP){this.#n||=await this.#V.getAnnotationsByType(new Set(this.#h.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.#p.has(r)&&t.push(n)}this.#l?.showSidebar(t)}if(!t)return n&&this.addNewEditorFromKeyboard(),void this.#J.resolve();for(let e of this.#r.values())e.uid===t?(this.setSelected(e),i?e.editComment():r?e.enterInEditMode():e.focus()):e.unselect();this.#J.resolve()}}addNewEditorFromKeyboard(){this.currentLayer.canCreateNewEmptyEditor()&&this.currentLayer.addNewEditor()}updateToolbar(e){e.mode!==this.#F&&this._eventBus.dispatch(`switchannotationeditormode`,{source:this,...e})}updateParams(e,t){if(this.#h){switch(e){case zC.CREATE:this.currentLayer.addNewEditor(t);return;case zC.HIGHLIGHT_SHOW_ALL:this._eventBus.dispatch(`reporttelemetry`,{source:this,details:{type:`editing`,data:{type:`highlight`,action:`toggle_visibility`}}}),(this.#B||=new Map).set(e,t),this.showAllEditors(`highlight`,t)}if(this.hasSelection)for(let n of this.#I)n.updateParams(e,t);else for(let n of this.#h)n.updateDefaultParams(e,t)}}showAllEditors(e,t,n=!1){for(let n of this.#r.values())n.editorType===e&&n.show(t);(this.#B?.get(zC.HIGHLIGHT_SHOW_ALL)??!0)!==t&&this.#le([[zC.HIGHLIGHT_SHOW_ALL,t]])}enableWaiting(e=!1){if(this.#k!==e){this.#k=e;for(let t of this.#i.values())e?t.disableClick():t.enableClick(),t.div.classList.toggle(`waiting`,e)}}async#ue(){if(!this.#D){this.#D=!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()}}#de(){if(this.unselectAll(),this.#D){this.#D=!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.#x&&clearTimeout(this.#x),this.#x=setTimeout(()=>{this.focusMainContainer(),this.#x=null},0)),this.#r.delete(e.id),e.annotationElementId&&this.#N?.delete(e.annotationElementId),this.unselect(e),e.annotationElementId&&this.#p.has(e.annotationElementId)||this.#o?.remove(e.id)}addDeletedAnnotationElement(e){this.#p.add(e.annotationElementId),this.addChangedExistingAnnotation(e),e.deleted=!0}isDeletedAnnotationElement(e){return this.#p.has(e)}removeDeletedAnnotationElement(e){this.#p.delete(e.annotationElementId),this.removeChangedExistingAnnotation(e),e.deleted=!1}#fe(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.#le(e.propertiesToUpdate))}get#pe(){let e=null;for(e of this.#I);return e}updateUI(e){this.#pe===e&&this.#le(e.propertiesToUpdate)}updateUIForDefaultProperties(e){this.#le(e.defaultPropertiesToUpdate)}toggleSelected(e){if(this.#I.has(e))return this.#I.delete(e),e.unselect(),void this.#ce({hasSelectedEditor:this.hasSelection});this.#I.add(e),e.select(),this.#le(e.propertiesToUpdate),this.#ce({hasSelectedEditor:!0})}setSelected(e){this.updateToolbar({mode:e.mode,editId:e.id}),this.#d?.commitOrRemove();for(let t of this.#I)t!==e&&t.unselect();this.#I.clear(),this.#I.add(e),e.select(),this.#le(e.propertiesToUpdate),this.#ce({hasSelectedEditor:!0})}isSelected(e){return this.#I.has(e)}get firstSelectedEditor(){return this.#I.values().next().value}unselect(e){e.unselect(),this.#I.delete(e),this.#ce({hasSelectedEditor:this.hasSelection})}get hasSelection(){return this.#I.size!==0}get isEnterHandled(){return this.#I.size===1&&this.firstSelectedEditor.isEnterHandled}undo(){this.#c.undo(),this.#ce({hasSomethingToUndo:this.#c.hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:this.#me()}),this._editorUndoBar?.hide()}redo(){this.#c.redo(),this.#ce({hasSomethingToUndo:!0,hasSomethingToRedo:this.#c.hasSomethingToRedo(),isEmpty:this.#me()})}addCommands(e){this.#c.add(e),this.#ce({hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:this.#me()})}cleanUndoStack(e){this.#c.cleanType(e)}#me(){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.#I],n=()=>{for(let e of t)this.#fe(e)};this.addCommands({cmd:()=>{this._editorUndoBar?.show(n,t.length===1?t[0].editorType:t.length);for(let e of t)e.remove()},undo:n,mustExec:!0})}commitOrRemove(){this.#t?.commitOrRemove()}hasSomethingToControl(){return this.#t||this.hasSelection}#he(e){for(let e of this.#I)e.unselect();this.#I.clear();for(let t of e)t.isEmpty()||(this.#I.add(t),t.select());this.#ce({hasSelectedEditor:this.hasSelection})}selectAll(){for(let e of this.#I)e.commit();this.#he(this.#r.values())}unselectAll(){if((!this.#t||(this.#t.commitOrRemove(),this.#F===RC.NONE))&&!this.#d?.commitOrRemove()&&this.hasSelection){for(let e of this.#I)e.unselect();this.#I.clear(),this.#ce({hasSelectedEditor:!1})}}translateSelectedEditors(e,t,n=!1){if(n||this.commitOrRemove(),!this.hasSelection)return;this.#U[0]+=e,this.#U[1]+=t;let[r,i]=this.#U,a=[...this.#I];this.#W&&clearTimeout(this.#W),this.#W=setTimeout(()=>{this.#W=null,this.#U[0]=this.#U[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.#m=new Map;for(let e of this.#I)this.#m.set(e,{savedX:e.x,savedY:e.y,savedPageIndex:e.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!this.#m)return!1;this.disableUserSelect(!1);let e=this.#m;this.#m=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.#m)for(let n of this.#m.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.#I.size===1&&this.firstSelectedEditor.shouldGetKeyboardEvents()}isActive(e){return this.#t===e}getActive(){return this.#t}getMode(){return this.#F}isEditingMode(){return this.#F!==RC.NONE}get imageManager(){return gw(this,`imageManager`,new vT)}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.#s||=new Map).set(e,t)}removeChangedExistingAnnotation({annotationElementId:e}){this.#s?.delete(e)}renderAnnotationElement(e){let t=this.#s?.get(e.data.id);if(!t)return;let n=this.#o.getRawValue(t);n&&(this.#F!==RC.NONE||n.hasBeenModified)&&n.renderAnnotationElement(e)}setMissingCanvas(e,t,n){let r=this.#N?.get(e);r&&(r.setCanvas(t,n),this.#N.delete(e))}addMissingCanvas(e,t){(this.#N||=new Map).set(e,t)}},CT=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`,Jw,{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)return this.#s?.remove(),void(this.#s=null);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)return void this.#i?.remove()}else{if(!this.#e&&!this.#t)return t.classList.remove(`done`),void this.#i?.remove();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)}},wT=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-edit-comment-button`));let n=this.#r._uiManager._signal;if(!(n instanceof AbortSignal)||n.aborted)return e;e.addEventListener(`contextmenu`,Jw,{signal:n}),t&&(e.addEventListener(`focusin`,e=>{this.#r._focusEventsAllowed=!1,Yw(e)},{capture:!0,signal:n}),e.addEventListener(`focusout`,e=>{this.#r._focusEventsAllowed=!0,Yw(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){if(e!==this.#o&&(this.#a=null),e===null)return this.#o=``,void(this.#c=!0);this.#o=e,this.#s=new Date,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}},TT=class e{#e;#t=!1;#n=null;#r;#i;#a;#o;#s=null;#c;#l=null;#u;#d=null;constructor({container:e,isPinchingDisabled:t=null,isPinchingStopped:n=null,onPinchStart:r=null,onPinching:i=null,onPinchEnd:a=null,signal:o}){this.#e=e,this.#n=n,this.#r=t,this.#i=r,this.#a=i,this.#o=a,this.#u=new AbortController,this.#c=AbortSignal.any([o,this.#u.signal]),e.addEventListener(`touchstart`,this.#f.bind(this),{passive:!1,signal:this.#c})}get MIN_TOUCH_DISTANCE_TO_PINCH(){return 35/nT.pixelRatio}#f(e){if(this.#r?.())return;if(e.touches.length===1){if(this.#s)return;let e=this.#s=new AbortController,t=AbortSignal.any([this.#c,e.signal]),n=this.#e,r={capture:!0,signal:t,passive:!1},i=e=>{e.pointerType===`touch`&&(this.#s?.abort(),this.#s=null)};n.addEventListener(`pointerdown`,e=>{e.pointerType===`touch`&&(Yw(e),i(e))},r),n.addEventListener(`pointerup`,i,r),n.addEventListener(`pointercancel`,i,r);return}if(!this.#d){this.#d=new AbortController;let e=AbortSignal.any([this.#c,this.#d.signal]),t=this.#e,n={signal:e,capture:!1,passive:!1};t.addEventListener(`touchmove`,this.#p.bind(this),n);let r=this.#m.bind(this);t.addEventListener(`touchend`,r,n),t.addEventListener(`touchcancel`,r,n),n.capture=!0,t.addEventListener(`pointerdown`,Yw,n),t.addEventListener(`pointermove`,Yw,n),t.addEventListener(`pointercancel`,Yw,n),t.addEventListener(`pointerup`,Yw,n),this.#i?.()}if(Yw(e),e.touches.length!==2||this.#n?.())return void(this.#l=null);let[t,n]=e.touches;t.identifier>n.identifier&&([t,n]=[n,t]),this.#l={touch0X:t.screenX,touch0Y:t.screenY,touch1X:n.screenX,touch1Y:n.screenY}}#p(t){if(!this.#l||t.touches.length!==2)return;Yw(t);let[n,r]=t.touches;n.identifier>r.identifier&&([n,r]=[r,n]);let{screenX:i,screenY:a}=n,{screenX:o,screenY:s}=r,c=this.#l,{touch0X:l,touch0Y:u,touch1X:d,touch1Y:f}=c,p=d-l,m=f-u,h=o-i,g=s-a,_=Math.hypot(h,g)||1,v=Math.hypot(p,m)||1;if(!this.#t&&Math.abs(v-_)<=e.MIN_TOUCH_DISTANCE_TO_PINCH)return;if(c.touch0X=i,c.touch0Y=a,c.touch1X=o,c.touch1Y=s,!this.#t)return void(this.#t=!0);let y=[(i+o)/2,(a+s)/2];this.#a?.(y,v,_)}#m(e){e.touches.length>=2||(this.#d&&(this.#d.abort(),this.#d=null,this.#o?.()),this.#l&&(Yw(e),this.#l=null,this.#t=!1))}destroy(){this.#u?.abort(),this.#u=null,this.#s?.abort(),this.#s=null}},ET=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 _l10nResizer=null;#w=!1;#T=e._zIndex++;static _borderLineWidth=-1;static _colorManager=new xT;static _zIndex=1;static _telemetryTimeout=1e3;static get _resizerKeyboardManager(){let t=e.prototype._resizeWithKeyboard,n=ST.TRANSLATE_SMALL,r=ST.TRANSLATE_BIG;return gw(this,`_resizerKeyboardManager`,new bT([[[`ArrowLeft`,`mac+ArrowLeft`],t,{args:[-n,0]}],[[`ctrl+ArrowLeft`,`mac+shift+ArrowLeft`],t,{args:[-r,0]}],[[`ArrowRight`,`mac+ArrowRight`],t,{args:[n,0]}],[[`ctrl+ArrowRight`,`mac+shift+ArrowRight`],t,{args:[r,0]}],[[`ArrowUp`,`mac+ArrowUp`],t,{args:[0,-n]}],[[`ctrl+ArrowUp`,`mac+shift+ArrowUp`],t,{args:[0,-r]}],[[`ArrowDown`,`mac+ArrowDown`],t,{args:[0,n]}],[[`ctrl+ArrowDown`,`mac+shift+ArrowDown`],t,{args:[0,r]}],[[`Escape`,`mac+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;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}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 gw(this,`_defaultLineColor`,this._colorManager.getHexCode(`CanvasText`))}static deleteAnnotationElement(e){let t=new DT({id:e.parent.getNextId(),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._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){fw(`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/(2*e),this.y+=this.width*e/(2*t);break;case 180:this.x+=this.width/2,this.y+=this.height/2;break;case 270:this.x+=this.height*t/(2*e),this.y-=this.width*e/(2*t);break;default:this.x-=this.width/2,this.y-=this.height/2}this.fixAndSetPosition()}addCommands(e){this._uiManager.addCommands(e)}get currentLayer(){return this._uiManager.currentLayer}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=this.#T}setParent(e){e===null?(this.#W(),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){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),n.scrollIntoView({block:`nearest`})}_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=Nw(i,0,n-o),a=Nw(a,0,r-s);break;case 90:i=Nw(i,0,n-s),a=Nw(a,o,r);break;case 180:i=Nw(i,o,n),a=Nw(a,s,r);break;case 270:i=Nw(i,s,n),a=Nw(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`,Jw,{signal:t}),e.tabIndex=-1}this.div.prepend(this.#c)}#A(e,t){t.preventDefault();let{isMac:n}=Ew.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`,Yw,{passive:!1,signal:a}),window.addEventListener(`contextmenu`,Jw,{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(1e4*e)/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,h,g=!1,_=!1;switch(t){case`topLeft`:g=!0,m=(e,t)=>[0,0],h=(e,t)=>[e,t];break;case`topMiddle`:m=(e,t)=>[e/2,0],h=(e,t)=>[e/2,t];break;case`topRight`:g=!0,m=(e,t)=>[e,0],h=(e,t)=>[0,t];break;case`middleRight`:_=!0,m=(e,t)=>[e,t/2],h=(e,t)=>[0,t/2];break;case`bottomRight`:g=!0,m=(e,t)=>[e,t],h=(e,t)=>[0,0];break;case`bottomMiddle`:m=(e,t)=>[e/2,t],h=(e,t)=>[e/2,0];break;case`bottomLeft`:g=!0,m=(e,t)=>[0,t],h=(e,t)=>[e,0];break;case`middleLeft`:_=!0,m=(e,t)=>[0,t/2],h=(e,t)=>[e,t/2]}let v=m(s,c),y=h(s,c),b=f(...y),x=e._round(a+b[0]),S=e._round(o+b[1]),C,w,T=1,E=1;if(n.fromKeyboard)({deltaX:C,deltaY:w}=n);else{let{screenX:e,screenY:t}=n,[r,i]=this.#l;[C,w]=this.screenToPageTranslation(e-r,t-i),this.#l[0]=e,this.#l[1]=t}var D,O;if([C,w]=(D=C/r,O=w/i,[p[0]*D+p[2]*O,p[1]*D+p[3]*O]),g){let e=Math.hypot(s,c);T=E=Math.max(Math.min(Math.hypot(y[0]-v[0]-C,y[1]-v[1]-w)/e,1/s,1/c),l/s,u/c)}else _?T=Nw(Math.abs(y[0]-v[0]-C),l,1)/s:E=Nw(Math.abs(y[1]-v[1]-w),u,1)/c;let k=e._round(s*T),ee=e._round(c*E);b=f(...h(k,ee));let A=x-b[0],j=S-b[1];this.#h||=[this.x,this.y,this.width,this.height],this.width=k,this.height=ee,this.x=A,this.y=j,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 mT(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||(CT.initialize(e._l10n),this.#n=new CT(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.#r||=new wT(this)}addStandaloneCommentButton(){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(){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 wT(this),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 wT(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 wT(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),gT(this,e,[`keydown`,`pointerdown`,`dblclick`]),this.isResizable&&this._uiManager._supportsPinchToZoom&&(this.#C||=new TT({container:e,isPinchingDisabled:()=>!this.isSelected,onPinchStart:this.#P.bind(this),onPinching:this.#F.bind(this),onPinchEnd:this.#I.bind(this),signal:this._uiManager._signal})),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=r/n*.7+1-.7;if(i===1)return;let a=this.#O(this.rotation),o=(e,t)=>[a[0]*e+a[2]*t,a[1]*e+a[3]*t],[s,c]=this.parentDimensions,l=this.x,u=this.y,d=this.width,f=this.height,p=e.MIN_SIZE/s,m=e.MIN_SIZE/c;i=Math.max(Math.min(i,1/d,1/f),p/d,m/f);let h=e._round(d*i),g=e._round(f*i);if(h===d&&g===f)return;this.#h||=[l,u,d,f];let _=o(d/2,f/2),v=e._round(l+_[0]),y=e._round(u+_[1]),b=o(h/2,g/2);this.x=v-b[0],this.y=y-b[1],this.width=h,this.height=g,this.setDims(),this.fixAndSetPosition(),this._onResizing()}#I(){this.#n?.toggle(!0),this.parent.togglePointerEvents(!0),this.#M()}pointerdown(e){let{isMac:t}=Ew.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}=Ew.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)return void Yw(e);let[a,o]=this.screenToPageTranslation(t-this.#b,r-this.#x);this.#b=t,this.#x=r,this._uiManager.dragSelectedEditors(a,o)},a),window.addEventListener(`touchmove`,Yw,a),window.addEventListener(`pointerdown`,e=>{e.pointerType===this.#s&&(this.#C||e.isPrimary)&&o(e),Yw(e)},a));let s=e=>{this.#o&&this.#o!==e.pointerId?Yw(e):o(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)}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})}rebuild(){this.#z()}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:t.getNextId(),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.parent?this.parent.remove(this):this._uiManager.removeEditor(this),this.#y&&=(clearTimeout(this.#y),null),this.#W(),this.removeEditToolbar(),this.#S){for(let e of this.#S.values())clearTimeout(e);this.#S=null}this.parent=null,this.#C?.destroy(),this.#C=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.#B.bind(this),r=this.#V.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.#H.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.firstChild);else if(a>i)for(let e=0;e<a-i;e++)this.#c.firstChild.before(this.#c.lastChild);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.#U(0),this.#v=!0,this.#c.firstChild.focus({focusVisible:!0}),t.preventDefault(),t.stopImmediatePropagation()}#B(t){e._resizerKeyboardManager.exec(this,t)}#V(e){this.#v&&e.relatedTarget?.parentNode!==this.#c&&this.#W()}#H(e){this.#p=this.#v?e:``}#U(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})}#W(){this.#v=!1,this.#U(-1),this.#M()}_stopResizingWithKeyboard(){this.#W(),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.hasComment&&this._uiManager.toggleComment(this,!1,!1))}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.id}))}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);return}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){if(this.#d||this.deleted)return this.deleted?(this.#d.remove(),void(this.#d=null)):void((this.hasEditedComment||this._hasBeenMoved||this._hasBeenResized)&&this.#d.updateEdited({rect:this.getPDFRect(),popup:this.comment}));this.#d=e.addFakeAnnotation(this)}renderAnnotationElement(e){if(this.deleted)return e.hide(),null;let t=e.container.querySelector(`.annotationContent`);if(t){if(t.nodeName===`CANVAS`){let e=t;t=document.createElement(`div`),t.classList.add(`annotationContent`,this.editorType),e.before(t)}}else t=document.createElement(`div`),t.classList.add(`annotationContent`,this.editorType),e.container.prepend(t);return t}resetAnnotationElement(e){let{firstChild:t}=e.container;t?.nodeName===`DIV`&&t.classList.contains(`annotationContent`)&&t.remove()}},DT=class extends ET{constructor(e){super(e),this.annotationElementId=e.annotationElementId,this.deleted=!0}serialize(){return this.serializeDeleted()}},OT=3285377520,kT=4294901760,AT=65535,jT=class{constructor(e){this.h1=e?4294967295&e:OT,this.h2=e?4294967295&e:OT}update(e){let t,n;if(typeof e==`string`){t=new Uint8Array(2*e.length),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++]=255&i)}}else{if(!ArrayBuffer.isView(e))throw Error(`Invalid data format, must be a string or TypedArray.`);t=e.slice(),n=t.byteLength}let r=n>>2,i=n-4*r,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++)1&e?(o=a[e],o=o*u&kT|o*f&AT,o=o<<15|o>>>17,o=o*d&kT|o*p&AT,c^=o,c=c<<13|c>>>19,c=5*c+3864292196):(s=a[e],s=s*u&kT|s*f&AT,s=s<<15|s>>>17,s=s*d&kT|s*p&AT,l^=s,l=l<<13|l>>>19,l=5*l+3864292196);switch(o=0,i){case 3:o^=t[4*r+2]<<16;case 2:o^=t[4*r+1]<<8;case 1:o^=t[4*r],o=o*u&kT|o*f&AT,o=o<<15|o>>>17,o=o*d&kT|o*p&AT,1&r?c^=o:l^=o}this.h1=c,this.h2=l}hexdigest(){let e=this.h1,t=this.h2;return e^=t>>>1,e=3981806797*e&kT|36045*e&AT,t=4283543511*t&kT|(2950163797*(t<<16|e>>>16)&kT)>>>16,e^=t>>>1,e=444984403*e&kT|60499*e&AT,t=3301882366*t&kT|(3120437893*(t<<16|e>>>16)&kT)>>>16,e^=t>>>1,(e>>>0).toString(16).padStart(8,`0`)+(t>>>0).toString(16).padStart(8,`0`)}},MT=Object.freeze({map:null,hash:``,transfer:void 0}),NT=class{#e=!1;#t=null;#n=null;#r=new Map;constructor(){this.onSetModified=null,this.onResetModified=null,this.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);if(t!==void 0&&(t instanceof ET&&this.#n.delete(t.annotationElementId),this.#r.delete(e),this.#r.size===0&&this.resetModified(),typeof this.onAnnotationEditor==`function`)){for(let e of this.#r.values())if(e instanceof ET)return;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 ET&&((this.#n||=new Map).set(t.annotationElementId,t),typeof this.onAnnotationEditor==`function`&&this.onAnnotationEditor(t.constructor._type))}has(e){return this.#r.has(e)}get size(){return this.#r.size}#i(){this.#e||(this.#e=!0,typeof this.onSetModified==`function`&&this.onSetModified())}resetModified(){this.#e&&(this.#e=!1,typeof this.onResetModified==`function`&&this.onResetModified())}get print(){return new PT(this)}get serializable(){if(this.#r.size===0)return MT;let e=new Map,t=new jT,n=[],r=Object.create(null),i=!1;for(let[n,a]of this.#r){let o=a instanceof ET?a.serialize(!1,r):a;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}:MT}get editorStats(){let e=null,t=new Map,n=0,r=0;for(let i of this.#r.values()){if(!(i instanceof ET)){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.has(o)||t.set(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.get(e);n||(n=new Map,s.set(e,n));let r=n.get(t)??0;n.set(t,r+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)}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);return this.#t={ids:new Set(e),hash:e.join(`,`)}}[Symbol.iterator](){return this.#r.entries()}},PT=class extends NT{#e;constructor(e){super();let{map:t,hash:n,transfer:r}=e.serializable;this.#e={map:structuredClone(t,r?{transfer:r}:null),hash:n,transfer:r}}get print(){fw(`Should not call PrintAnnotationStorage.print`)}get serializable(){return this.#e}get modifiedIds(){return gw(this,`modifiedIds`,{ids:new Set,hash:``})}},FT=class{#e=new Set;constructor({ownerDocument:e=globalThis.document,styleElement:t=null}){this._document=e,this.nativeFontFaces=new Set,this.styleElement=null,this.loadingRequests=[],this.loadTestFontId=0}addNativeFontFace(e){this.nativeFontFaces.add(e),this._document.fonts.add(e)}removeNativeFontFace(e){this.nativeFontFaces.delete(e),this._document.fonts.delete(e)}insertRule(e){this.styleElement||(this.styleElement=this._document.createElement(`style`),this._document.documentElement.getElementsByTagName(`head`)[0].append(this.styleElement));let t=this.styleElement.sheet;t.insertRule(e,t.cssRules.length)}clear(){for(let e of this.nativeFontFaces)this._document.fonts.delete(e);this.nativeFontFaces.clear(),this.#e.clear(),this.styleElement&&=(this.styleElement.remove(),null)}async loadSystemFont({systemFontInfo:e,disableFontFace:t,_inspectFont:n}){if(e&&!this.#e.has(e.loadedName)){if(pw(!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.#e.add(t),n?.(e)}catch{dw(`Cannot load system font: ${e.baseFontName}, installing it could help to improve PDF rendering.`),this.removeNativeFontFace(a)}return}fw(`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)return void await this.loadSystemFont(e);if(this.isFontLoadingAPISupported){let t=e.createNativeFontFace();if(t){this.addNativeFontFace(t);try{await t.loaded}catch(n){throw dw(`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 new Promise(t=>{let n=this._queueLoadingCallback(t);this._prepareFontLoadEvent(e,n)})}}get isFontLoadingAPISupported(){return gw(this,`isFontLoadingAPISupported`,!!this._document?.fonts)}get isSyncFontLoadingSupported(){return gw(this,`isSyncFontLoadingSupported`,TC||Ew.platform.isFirefox)}_queueLoadingCallback(e){let{loadingRequests:t}=this,n={done:!1,complete:function(){for(pw(!n.done,`completeRequest() cannot be called twice.`),n.done=!0;t.length>0&&t[0].done;){let e=t.shift();setTimeout(e.callback,0)}},callback:e};return t.push(n),n}get _loadTestFont(){return gw(this,`_loadTestFont`,atob(`T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==`))}_prepareFontLoadEvent(e,t){function n(e,t){return e.charCodeAt(t)<<24|e.charCodeAt(t+1)<<16|e.charCodeAt(t+2)<<8|255&e.charCodeAt(t+3)}function r(e,t,n,r){return e.substring(0,t)+r+e.substring(t+n)}let i,a,o=this._document.createElement(`canvas`);o.width=1,o.height=1;let s=o.getContext(`2d`),c=0,l=`lt${Date.now()}${this.loadTestFontId++}`,u=this._loadTestFont;u=r(u,976,l.length,l);let d=1482184792,f=n(u,16);for(i=0,a=l.length-3;i<a;i+=4)f=f-d+n(l,i)|0;var p;i<l.length&&(f=f-d+n(l+`XXX`,i)|0),u=r(u,16,4,(p=f,String.fromCharCode(p>>24&255,p>>16&255,p>>8&255,255&p)));let m=`@font-face {font-family:"${l}";src:${`url(data:font/opentype;base64,${btoa(u)});`}}`;this.insertRule(m);let h=this._document.createElement(`div`);h.style.visibility=`hidden`,h.style.width=h.style.height=`10px`,h.style.position=`absolute`,h.style.top=h.style.left=`0px`;for(let t of[e.loadedName,l]){let e=this._document.createElement(`span`);e.textContent=`Hi`,e.style.fontFamily=t,h.append(e)}this._document.body.append(h),function e(t,n){if(++c>30)return dw(`Load test font never loaded.`),void n();s.font=`30px `+t,s.fillText(`.`,0,20),s.getImageData(0,0,1,1).data[3]>0?n():setTimeout(e.bind(null,t,n))}(l,()=>{h.remove(),t.complete()})}},IT=class{#e;constructor(e,t=null,n,r){this.compiledGlyphs=Object.create(null),this.#e=e,this._inspectFont=t,n&&Object.assign(this,n),r&&(this.charProcOperatorList=r)}createNativeFontFace(){if(!this.data||this.disableFontFace)return null;let e;if(this.cssFontInfo){let t={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(t.style=`oblique ${this.cssFontInfo.italicAngle}deg`),e=new FontFace(this.cssFontInfo.fontFamily,this.data,t)}else e=new FontFace(this.loadedName,this.data,{});return this._inspectFont?.(this),e}createFontFaceRule(){if(!this.data||this.disableFontFace)return null;let e=`url(data:${this.mimetype};base64,${Pw(this.data)});`,t;if(this.cssFontInfo){let n=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(n+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`),t=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${n}src:${e}}`}else t=`@font-face {font-family:"${this.loadedName}";src:${e}}`;return this._inspectFont?.(this,e),t}getPathGenerator(e,t){if(this.compiledGlyphs[t]!==void 0)return this.compiledGlyphs[t];let n=this.loadedName+`_path_`+t,r;try{r=e.get(n)}catch(e){dw(`getPathGenerator - ignoring character: "${e}".`)}let i=new Path2D(r||``);return this.fontExtraProperties||e.delete(n),this.compiledGlyphs[t]=i}get black(){return this.#e.black}get bold(){return this.#e.bold}get disableFontFace(){return this.#e.disableFontFace??!1}get fontExtraProperties(){return this.#e.fontExtraProperties??!1}get isInvalidPDFjsFont(){return this.#e.isInvalidPDFjsFont}get isType3Font(){return this.#e.isType3Font}get italic(){return this.#e.italic}get missingFile(){return this.#e.missingFile}get remeasure(){return this.#e.remeasure}get vertical(){return this.#e.vertical}get ascent(){return this.#e.ascent}get defaultWidth(){return this.#e.defaultWidth}get descent(){return this.#e.descent}get bbox(){return this.#e.bbox}get fontMatrix(){return this.#e.fontMatrix}get fallbackName(){return this.#e.fallbackName}get loadedName(){return this.#e.loadedName}get mimetype(){return this.#e.mimetype}get name(){return this.#e.name}get data(){return this.#e.data}clearData(){this.#e.clearData()}get cssFontInfo(){return this.#e.cssFontInfo}get systemFontInfo(){return this.#e.systemFontInfo}get defaultVMetrics(){return this.#e.defaultVMetrics}};function LT(e){if(typeof e!=`string`)return null;if(e.endsWith(`/`))return e;throw Error(`Invalid factory url: "${e}" must include trailing slash.`)}var RT=e=>typeof e==`object`&&Number.isInteger(e?.num)&&e.num>=0&&Number.isInteger(e?.gen)&&e.gen>=0,zT=function(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}.bind(null,RT,e=>typeof e==`object`&&typeof e?.name==`string`),BT=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)return void dw("LoopbackPort - cannot use an `aborted` signal.");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()}},VT=1,HT=2,UT=1,WT=2,GT=3,KT=4,qT=5,JT=6,YT=7,XT=8;function ZT(){}function QT(e){if(e instanceof Cw||e instanceof bw||e instanceof vw||e instanceof xw||e instanceof yw)return e;switch(e instanceof Error||typeof e==`object`&&e||fw(`wrapReason: Expected "reason" to be a (possibly cloned) Error.`),e.name){case`AbortException`:return new Cw(e.message);case`InvalidPDFException`:return new bw(e.message);case`PasswordException`:return new vw(e.message,e.code);case`ResponseException`:return new xw(e.message,e.status,e.missing);case`UnknownErrorException`:return new yw(e.message,e.details)}return new yw(e.message,e.toString())}var $T=class{#e=new AbortController;constructor(e,t,n){this.sourceName=e,this.targetName=t,this.comObj=n,this.callbackId=1,this.streamId=1,this.streamSinks=Object.create(null),this.streamControllers=Object.create(null),this.callbackCapabilities=Object.create(null),this.actionHandler=Object.create(null),n.addEventListener(`message`,this.#t.bind(this),{signal:this.#e.signal})}#t({data:e}){if(e.targetName!==this.sourceName)return;if(e.stream)return void this.#r(e);if(e.callback){let t=e.callbackId,n=this.callbackCapabilities[t];if(!n)throw Error(`Cannot resolve callback ${t}`);if(delete this.callbackCapabilities[t],e.callback===VT)n.resolve(e.data);else{if(e.callback!==HT)throw Error(`Unexpected callback case`);n.reject(QT(e.reason))}return}let t=this.actionHandler[e.action];if(!t)throw Error(`Unknown action from worker: ${e.action}`);if(e.callbackId){let n=this.sourceName,r=e.sourceName,i=this.comObj;Promise.try(t,e.data).then(function(t){i.postMessage({sourceName:n,targetName:r,callback:VT,callbackId:e.callbackId,data:t})},function(t){i.postMessage({sourceName:n,targetName:r,callback:HT,callbackId:e.callbackId,reason:QT(t)})});return}e.streamId?this.#n(e):t(e.data)}on(e,t){let n=this.actionHandler;if(n[e])throw Error(`There is already an actionName called "${e}"`);n[e]=t}send(e,t,n){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,data:t},n)}sendWithPromise(e,t,n){let r=this.callbackId++,i=Promise.withResolvers();this.callbackCapabilities[r]=i;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,callbackId:r,data:t},n)}catch(e){i.reject(e)}return i.promise}sendWithStream(e,t,n,r){let i=this.streamId++,a=this.sourceName,o=this.targetName,s=this.comObj;return new ReadableStream({start:n=>{let c=Promise.withResolvers();return this.streamControllers[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.streamControllers[i].pullCall=t,s.postMessage({sourceName:a,targetName:o,stream:JT,streamId:i,desiredSize:e.desiredSize}),t.promise},cancel:e=>{pw(e instanceof Error,`cancel must have a valid reason`);let t=Promise.withResolvers();return this.streamControllers[i].cancelCall=t,this.streamControllers[i].isClosed=!0,s.postMessage({sourceName:a,targetName:o,stream:UT,streamId:i,reason:QT(e)}),t.promise}},n)}#n(e){let t=e.streamId,n=this.sourceName,r=e.sourceName,i=this.comObj,a=this,o=this.actionHandler[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:KT,streamId:t,chunk:e},o)},close(){this.isCancelled||(this.isCancelled=!0,i.postMessage({sourceName:n,targetName:r,stream:GT,streamId:t}),delete a.streamSinks[t])},error(e){pw(e instanceof Error,`error must have a valid reason`),this.isCancelled||(this.isCancelled=!0,i.postMessage({sourceName:n,targetName:r,stream:qT,streamId:t,reason:QT(e)}))},sinkCapability:Promise.withResolvers(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:e.desiredSize,ready:null};s.sinkCapability.resolve(),s.ready=s.sinkCapability.promise,this.streamSinks[t]=s,Promise.try(o,e.data,s).then(function(){i.postMessage({sourceName:n,targetName:r,stream:XT,streamId:t,success:!0})},function(e){i.postMessage({sourceName:n,targetName:r,stream:XT,streamId:t,reason:QT(e)})})}#r(e){let t=e.streamId,n=this.sourceName,r=e.sourceName,i=this.comObj,a=this.streamControllers[t],o=this.streamSinks[t];switch(e.stream){case XT:e.success?a.startCall.resolve():a.startCall.reject(QT(e.reason));break;case YT:e.success?a.pullCall.resolve():a.pullCall.reject(QT(e.reason));break;case JT:if(!o){i.postMessage({sourceName:n,targetName:r,stream:YT,streamId:t,success:!0});break}o.desiredSize<=0&&e.desiredSize>0&&o.sinkCapability.resolve(),o.desiredSize=e.desiredSize,Promise.try(o.onPull||ZT).then(function(){i.postMessage({sourceName:n,targetName:r,stream:YT,streamId:t,success:!0})},function(e){i.postMessage({sourceName:n,targetName:r,stream:YT,streamId:t,reason:QT(e)})});break;case KT:if(pw(a,`enqueue should have stream controller`),a.isClosed)break;a.controller.enqueue(e.chunk);break;case GT:if(pw(a,`close should have stream controller`),a.isClosed)break;a.isClosed=!0,a.controller.close(),this.#i(a,t);break;case qT:pw(a,`error should have stream controller`),a.controller.error(QT(e.reason)),this.#i(a,t);break;case WT:e.success?a.cancelCall.resolve():a.cancelCall.reject(QT(e.reason)),this.#i(a,t);break;case UT:if(!o)break;let s=QT(e.reason);Promise.try(o.onCancel||ZT,s).then(function(){i.postMessage({sourceName:n,targetName:r,stream:WT,streamId:t,success:!0})},function(e){i.postMessage({sourceName:n,targetName:r,stream:WT,streamId:t,reason:QT(e)})}),o.sinkCapability.reject(s),o.isCancelled=!0,delete this.streamSinks[t];break;default:throw Error(`Unexpected stream case`)}}async#i(e,t){await Promise.allSettled([e.startCall?.promise,e.pullCall?.promise,e.cancelCall?.promise]),delete this.streamControllers[t]}destroy(){this.#e?.abort(),this.#e=null}},eE=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(e,t,n){if(!e.canvas)throw Error(`Canvas is not specified`);if(t<=0||n<=0)throw Error(`Invalid canvas size`);e.canvas.width=t,e.canvas.height=n}destroy(e){if(!e.canvas)throw Error(`Canvas is not specified`);e.canvas.width=0,e.canvas.height=0,e.canvas=null,e.context=null}_createCanvas(e,t){fw("Abstract method `_createCanvas` called.")}},tE=class extends eE{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}},nE=class{constructor({baseUrl:e=null,isCompressed:t=!0}){this.baseUrl=e,this.isCompressed=t}async fetch({name:e}){if(!this.baseUrl)throw Error("Ensure that the `cMapUrl` and `cMapPacked` API parameters are provided.");if(!e)throw Error(`CMap name must be specified.`);let t=this.baseUrl+e+(this.isCompressed?`.bcmap`:``);return this._fetch(t).then(e=>({cMapData:e,isCompressed:this.isCompressed})).catch(e=>{throw Error(`Unable to load ${this.isCompressed?`binary `:``}CMap at: ${t}`)})}async _fetch(e){fw("Abstract method `_fetch` called.")}},rE=class extends nE{async _fetch(e){let t=await zw(e,this.isCompressed?`arraybuffer`:`text`);return t instanceof ArrayBuffer?new Uint8Array(t):Tw(t)}},iE=class{addFilter(e){return`none`}addHCMFilter(e,t){return`none`}addAlphaFilter(e){return`none`}addLuminosityFilter(e){return`none`}addHighlightHCMFilter(e,t,n,r,i){return`none`}destroy(e=!1){}},aE=class extends iE{#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.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(Lw,`svg`);n.setAttribute(`width`,0),n.setAttribute(`height`,0),this.#n=this.#i.createElementNS(Lw,`defs`),e.append(n),n.append(this.#n),this.#i.body.append(e)}return this.#n}#u(e){if(e.length===1){let t=e[0],n=Array(256);for(let e=0;e<256;e++)n[e]=t[e]/255;let r=n.join(`,`);return[r,r,r]}let[t,n,r]=e,i=Array(256),a=Array(256),o=Array(256);for(let e=0;e<256;e++)i[e]=t[e]/255,a[e]=n[e]/255,o[e]=r[e]/255;return[i.join(`,`),a.join(`,`),o.join(`,`)]}#d(e){if(this.#e===void 0){this.#e=``;let e=this.#i.URL;e!==this.#i.baseURI&&(Hw(e)?dw(`#createUrl: ignore "data:"-URL for performance reasons.`):this.#e=hw(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=Q.makeHexColor(...a);let o=this.#v(t);if(t=Q.makeHexColor(...o),this.#l.style.color=``,e===`#000000`&&t===`#ffffff`||e===t)return i.url;let s=Array(256);for(let e=0;e<=255;e++){let t=e/255;s[e]=t<=.03928?t/12.92:((t+.055)/1.055)**2.4}let c=s.join(`,`),l=`g_${this.#r}_hcm_filter`,u=i.filter=this.#m(l);this.#g(c,c,c,u),this.#p(u);let d=(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(d(0,5),d(1,5),d(2,5),u),i.url=this.#d(l),i.url}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,n,r=this.#s.get(e||`luminosity`);if(r)return r;if(e?([t]=this.#u([e]),n=`luminosity_${t}`):n=`luminosity`,r=this.#s.get(n),r)return this.#s.set(e,r),r;let i=`g_${this.#r}_luminosity_map_${this.#o++}`,a=this.#d(i);this.#s.set(e,a),this.#s.set(n,a);let o=this.#m(i);return this.#f(o),e&&this.#_(t,o),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.#v.bind(this));u<l&&([l,u,d,f]=[u,l,f,d]),this.#l.style.color=``;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(Lw,`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(Lw,`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(Lw,`filter`);return t.setAttribute(`color-interpolation-filters`,`sRGB`),t.setAttribute(`id`,e),this.#l.append(t),t}#h(e,t,n){let r=this.#i.createElementNS(Lw,t);r.setAttribute(`type`,`discrete`),r.setAttribute(`tableValues`,n),e.append(r)}#g(e,t,n,r){let i=this.#i.createElementNS(Lw,`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(Lw,`feComponentTransfer`);t.append(n),this.#h(n,`feFuncA`,e)}#v(e){return this.#l.style.color=e,Qw(getComputedStyle(this.#l).getPropertyValue(`color`))}},oE=class{constructor({baseUrl:e=null}){this.baseUrl=e}async fetch({filename:e}){if(!this.baseUrl)throw Error("Ensure that the `standardFontDataUrl` API parameter is provided.");if(!e)throw Error(`Font filename must be specified.`);let t=`${this.baseUrl}${e}`;return this._fetch(t).catch(e=>{throw Error(`Unable to load font data at: ${t}`)})}async _fetch(e){fw("Abstract method `_fetch` called.")}},sE=class extends oE{async _fetch(e){let t=await zw(e,`arraybuffer`);return new Uint8Array(t)}},cE=class{constructor({baseUrl:e=null}){this.baseUrl=e}async fetch({filename:e}){if(!this.baseUrl)throw Error("Ensure that the `wasmUrl` API parameter is provided.");if(!e)throw Error(`Wasm filename must be specified.`);let t=`${this.baseUrl}${e}`;return this._fetch(t).catch(e=>{throw Error(`Unable to load wasm data at: ${t}`)})}async _fetch(e){fw("Abstract method `_fetch` called.")}},lE=class extends cE{async _fetch(e){let t=await zw(e,`arraybuffer`);return new Uint8Array(t)}};async function uE(e){let t=await process.getBuiltinModule(`fs`).promises.readFile(e);return new Uint8Array(t)}var dE=class extends iE{},fE=class extends eE{_createCanvas(e,t){return process.getBuiltinModule(`module`).createRequire(import.meta.url),new Proxy({},{get:(e,t)=>()=>{throw Error(`@napi-rs/canvas is not available in this environment`)}}).createCanvas(e,t)}},pE=class extends nE{async _fetch(e){return uE(e)}},mE=class extends oE{async _fetch(e){return uE(e)}},hE=class extends cE{async _fetch(e){return uE(e)}},gE=`__forcedDependency`,{floor:_E,ceil:vE}=Math;function yE(e,t,n,r,i,a){e[4*t+0]=Math.min(e[4*t+0],n),e[4*t+1]=Math.min(e[4*t+1],r),e[4*t+2]=Math.max(e[4*t+2],i),e[4*t+3]=Math.max(e[4*t+3],a)}var bE=new Uint32Array(new Uint8Array([255,255,0,0]).buffer)[0],xE=class{#e;#t;constructor(e,t){this.#e=e,this.#t=t}get length(){return this.#e.length}isEmpty(e){return this.#e[e]===bE}minX(e){return this.#t[4*e+0]/256}minY(e){return this.#t[4*e+1]/256}maxX(e){return(this.#t[4*e+2]+1)/256}maxY(e){return(this.#t[4*e+3]+1)/256}},SE=(e,t)=>{if(!e)return;let n=e.get(t);return n||(n={dependencies:new Set,isRenderingOperation:!1},e.set(t,n)),n},CE=class{#e={__proto__:null};#t={__proto__:null,transform:[],moveText:[],sameLineText:[],[gE]:[]};#n=new Map;#r=[];#i=[];#a=[[1,0,0,1,0,0]];#o=[-1/0,-1/0,1/0,1/0];#s=new Float64Array([1/0,1/0,-1/0,-1/0]);#c=-1;#l=new Set;#u=new Map;#d=new Map;#f;#p;#m;#h;#g;constructor(e,t,n=!1){this.#f=e.width,this.#p=e.height,this.#_(t),n&&(this.#g=new Map)}growOperationsCount(e){e>=this.#h.length&&this.#_(e,this.#h)}#_(e,t){let n=new ArrayBuffer(4*e);this.#m=new Uint8ClampedArray(n),this.#h=new Uint32Array(n),t&&t.length>0?(this.#h.set(t),this.#h.fill(bE,t.length)):this.#h.fill(bE)}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},[gE]:{__proto__:this.#t[gE]}},this.#o={__proto__:this.#o},this.#r.push(e),this}restore(e){let t=Object.getPrototypeOf(this.#e);if(t===null)return this;this.#e=t,this.#t=Object.getPrototypeOf(this.#t),this.#o=Object.getPrototypeOf(this.#o);let n=this.#r.pop();return n!==void 0&&(SE(this.#g,e)?.dependencies.add(n),this.#h[e]=this.#h[n]),this}recordOpenMarker(e){return this.#r.push(e),this}getOpenMarker(){return this.#r.length===0?null:this.#r.at(-1)}recordCloseMarker(e){let t=this.#r.pop();return t!==void 0&&(SE(this.#g,e)?.dependencies.add(t),this.#h[e]=this.#h[t]),this}beginMarkedContent(e){return this.#i.push(e),this}endMarkedContent(e){let t=this.#i.pop();return t!==void 0&&(SE(this.#g,e)?.dependencies.add(t),this.#h[e]=this.#h[t]),this}pushBaseTransform(e){return this.#a.push(Q.multiplyByDOMMatrix(this.#a.at(-1),e.getTransform())),this}popBaseTransform(){return this.#a.length>1&&this.#a.pop(),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(gE,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.#l)this.recordFutureForcedDependency(gE,e);return this}resetBBox(e){return this.#c!==e&&(this.#c=e,this.#s[0]=1/0,this.#s[1]=1/0,this.#s[2]=-1/0,this.#s[3]=-1/0),this}recordClipBox(e,t,n,r,i,a){let o=Q.multiplyByDOMMatrix(this.#a.at(-1),t.getTransform()),s=[1/0,1/0,-1/0,-1/0];Q.axialAlignedBoundingBox([n,i,r,a],o,s);let c=Q.intersect(this.#o,s);return c?(this.#o[0]=c[0],this.#o[1]=c[1],this.#o[2]=c[2],this.#o[3]=c[3]):(this.#o[0]=this.#o[1]=1/0,this.#o[2]=this.#o[3]=-1/0),this}recordBBox(e,t,n,r,i,a){let o=this.#o;if(o[0]===1/0)return this;let s=Q.multiplyByDOMMatrix(this.#a.at(-1),t.getTransform());if(o[0]===-1/0)return Q.axialAlignedBoundingBox([n,i,r,a],s,this.#s),this;let c=[1/0,1/0,-1/0,-1/0];return Q.axialAlignedBoundingBox([n,i,r,a],s,c),this.#s[0]=Math.min(this.#s[0],Math.max(c[0],o[0])),this.#s[1]=Math.min(this.#s[1],Math.max(c[1],o[1])),this.#s[2]=Math.max(this.#s[2],Math.min(c[2],o[2])),this.#s[3]=Math.max(this.#s[3],Math.min(c[3],o[3])),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.#d.get(n),!1!==c&&(l=[0,0,0,0],Q.axialAlignedBoundingBox(s,n.fontMatrix,l),r===1&&i===0&&a===0||Q.scaleMinMax([r,0,0,-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.#d.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[0]=Math.max(0,this.#o[0]),this.#s[1]=Math.max(0,this.#o[1]),this.#s[2]=Math.min(this.#f,this.#o[2]),this.#s[3]=Math.min(this.#p,this.#o[3]),this}getSimpleIndex(e){return this.#e[e]}recordDependencies(e,t){let n=this.#l,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.#l.add(this.#n.get(t)),this}recordOperation(e,t=!1){if(this.recordDependencies(e,[gE]),this.#g){let t=SE(this.#g,e),{dependencies:n}=t;this.#l.forEach(n.add,n),this.#r.forEach(n.add,n),this.#i.forEach(n.add,n),n.delete(e),t.isRenderingOperation=!0}if(this.#c===e){let n=_E(256*this.#s[0]/this.#f),r=_E(256*this.#s[1]/this.#p),i=vE(256*this.#s[2]/this.#f),a=vE(256*this.#s[3]/this.#p);yE(this.#m,e,n,r,i,a);for(let t of this.#l)t!==e&&yE(this.#m,t,n,r,i,a);for(let t of this.#r)t!==e&&yE(this.#m,t,n,r,i,a);for(let t of this.#i)t!==e&&yE(this.#m,t,n,r,i,a);t||(this.#l.clear(),this.#c=-1)}return this}recordShowTextOperation(e,t=!1){let n=Array.from(this.#l);this.recordOperation(e,t),this.recordIncrementalData(`sameLineText`,e);for(let e of n)this.recordIncrementalData(`sameLineText`,e);return this}bboxToClipBoxDropOperation(e,t=!1){return this.#c===e&&(this.#c=-1,this.#o[0]=Math.max(this.#o[0],this.#s[0]),this.#o[1]=Math.max(this.#o[1],this.#s[1]),this.#o[2]=Math.min(this.#o[2],this.#s[2]),this.#o[3]=Math.min(this.#o[3],this.#s[3]),t||this.#l.clear()),this}_takePendingDependencies(){let e=this.#l;return this.#l=new Set,e}_extractOperation(e){let t=this.#u.get(e);return this.#u.delete(e),t}_pushPendingDependencies(e){for(let t of e)this.#l.add(t)}take(){return this.#d.clear(),new xE(this.#h,this.#m)}takeDebugMetadata(){return this.#g}},wE=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}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`)}},TE=[`path`,`transform`,`filter`,`strokeColor`,`strokeAlpha`,`lineWidth`,`lineCap`,`lineJoin`,`miterLimit`,`dash`],EE=[`path`,`transform`,`filter`,`fillColor`,`fillAlpha`,`globalCompositeOperation`,`SMask`],DE=[`transform`,`SMask`,`filter`,`fillAlpha`,`strokeAlpha`,`globalCompositeOperation`],OE=[`filter`,`fillColor`,`fillAlpha`],kE=[`transform`,`leading`,`charSpacing`,`wordSpacing`,`hScale`,`textRise`,`moveText`,`textMatrix`,`font`,`fontObj`,`filter`,`fillColor`,`textRenderingMode`,`SMask`,`fillAlpha`,`strokeAlpha`,`globalCompositeOperation`,`sameLineText`],AE=[`transform`],jE=[`transform`,`fillColor`],ME=`Fill`,NE=`Stroke`,PE=`Shading`;function FE(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 IE=class{isModifyingCurrentTransform(){return!1}getPattern(){fw("Abstract method `getPattern` called.")}},LE=class extends IE{constructor(e){super(),this._type=e[1],this._bbox=e[2],this._colorStops=e[3],this._p0=e[4],this._p1=e[5],this._r0=e[6],this._r1=e[7],this.matrix=null}_createGradient(e){let t;this._type===`axial`?t=e.createLinearGradient(this._p0[0],this._p0[1],this._p1[0],this._p1[1]):this._type===`radial`&&(t=e.createRadialGradient(this._p0[0],this._p0[1],this._r0,this._p1[0],this._p1[1],this._r1));for(let e of this._colorStops)t.addColorStop(e[0],e[1]);return t}getPattern(e,t,n,r){let i;if(r===NE||r===ME){let a=t.current.getClippedPathBoundingBox(r,$w(e))||[0,0,0,0],o=Math.ceil(a[2]-a[0])||1,s=Math.ceil(a[3]-a[1])||1,c=t.cachedCanvases.getCanvas(`pattern`,o,s),l=c.context;l.clearRect(0,0,l.canvas.width,l.canvas.height),l.beginPath(),l.rect(0,0,l.canvas.width,l.canvas.height),l.translate(-a[0],-a[1]),n=Q.transform(n,[1,0,0,1,a[0],a[1]]),l.transform(...t.baseTransform),this.matrix&&l.transform(...this.matrix),FE(l,this._bbox),l.fillStyle=this._createGradient(l),l.fill(),i=e.createPattern(c.canvas,`no-repeat`);let u=new DOMMatrix(n);i.setTransform(u)}else FE(e,this._bbox),i=this._createGradient(e);return i}};function RE(e,t,n,r,i,a,o,s){let c=t.coords,l=t.colors,u=e.data,d=4*e.width,f;c[n+1]>c[r+1]&&(f=n,n=r,r=f,f=a,a=o,o=f),c[r+1]>c[i+1]&&(f=r,r=i,i=f,f=o,o=s,s=f),c[n+1]>c[r+1]&&(f=n,n=r,r=f,f=a,a=o,o=f);let p=(c[n]+t.offsetX)*t.scaleX,m=(c[n+1]+t.offsetY)*t.scaleY,h=(c[r]+t.offsetX)*t.scaleX,g=(c[r+1]+t.offsetY)*t.scaleY,_=(c[i]+t.offsetX)*t.scaleX,v=(c[i+1]+t.offsetY)*t.scaleY;if(m>=v)return;let y=l[a],b=l[a+1],x=l[a+2],S=l[o],C=l[o+1],w=l[o+2],T=l[s],E=l[s+1],D=l[s+2],O=Math.round(m),k=Math.round(v),ee,A,j,M,te,ne,re,ie;for(let e=O;e<=k;e++){if(e<g){let t=e<m?0:(m-e)/(m-g);ee=p-(p-h)*t,A=y-(y-S)*t,j=b-(b-C)*t,M=x-(x-w)*t}else{let t;t=e>v?1:g===v?0:(g-e)/(g-v),ee=h-(h-_)*t,A=S-(S-T)*t,j=C-(C-E)*t,M=w-(w-D)*t}let t;t=e<m?0:e>v?1:(m-e)/(m-v),te=p-(p-_)*t,ne=y-(y-T)*t,re=b-(b-E)*t,ie=x-(x-D)*t;let n=Math.round(Math.min(ee,te)),r=Math.round(Math.max(ee,te)),i=d*e+4*n;for(let e=n;e<=r;e++)t=(ee-e)/(ee-te),t<0?t=0:t>1&&(t=1),u[i++]=A-(A-ne)*t|0,u[i++]=j-(j-re)*t|0,u[i++]=M-(M-ie)*t|0,u[i++]=255}}function zE(e,t,n){let r=t.coords,i=t.colors,a,o;switch(t.type){case`lattice`:let s=t.verticesPerRow,c=Math.floor(r.length/s)-1,l=s-1;for(a=0;a<c;a++){let t=a*s;for(let a=0;a<l;a++,t++)RE(e,n,r[t],r[t+1],r[t+s],i[t],i[t+1],i[t+s]),RE(e,n,r[t+s+1],r[t+1],r[t+s],i[t+s+1],i[t+1],i[t+s])}break;case`triangles`:for(a=0,o=r.length;a<o;a+=3)RE(e,n,r[a],r[a+1],r[a+2],i[a],i[a+1],i[a+2]);break;default:throw Error(`illegal figure`)}}var BE=class extends IE{constructor(e){super(),this._coords=e[2],this._colors=e[3],this._figures=e[4],this._bounds=e[5],this._bbox=e[6],this._background=e[7],this.matrix=null}_createMeshCanvas(e,t,n){let r=Math.floor(this._bounds[0]),i=Math.floor(this._bounds[1]),a=Math.ceil(this._bounds[2])-r,o=Math.ceil(this._bounds[3])-i,s=Math.min(Math.ceil(Math.abs(a*e[0]*1.1)),3e3),c=Math.min(Math.ceil(Math.abs(o*e[1]*1.1)),3e3),l=a/s,u=o/c,d={coords:this._coords,colors:this._colors,offsetX:-r,offsetY:-i,scaleX:1/l,scaleY:1/u},f=s+4,p=c+4,m=n.getCanvas(`mesh`,f,p),h=m.context,g=h.createImageData(s,c);if(t){let e=g.data;for(let n=0,r=e.length;n<r;n+=4)e[n]=t[0],e[n+1]=t[1],e[n+2]=t[2],e[n+3]=255}for(let e of this._figures)zE(g,e,d);return h.putImageData(g,2,2),{canvas:m.canvas,offsetX:r-2*l,offsetY:i-2*u,scaleX:l,scaleY:u}}isModifyingCurrentTransform(){return!0}getPattern(e,t,n,r){FE(e,this._bbox);let i=new Float32Array(2);if(r===PE)Q.singularValueDecompose2dScale($w(e),i);else if(this.matrix){Q.singularValueDecompose2dScale(this.matrix,i);let[e,n]=i;Q.singularValueDecompose2dScale(t.baseTransform,i),i[0]*=e,i[1]*=n}else Q.singularValueDecompose2dScale(t.baseTransform,i);let a=this._createMeshCanvas(i,r===PE?null:this._background,t.cachedCanvases);return r!==PE&&(e.setTransform(...t.baseTransform),this.matrix&&e.transform(...this.matrix)),e.translate(a.offsetX,a.offsetY),e.scale(a.scaleX,a.scaleY),e.createPattern(a.canvas,`no-repeat`)}},VE=class extends IE{getPattern(){return`hotpink`}},HE=1,UE=2,WE=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.ctx=t,this.canvasGraphicsFactory=n,this.baseTransform=r}createPatternCanvas(e,t){let{bbox:n,operatorList:r,paintType:i,tilingType:a,color:o,canvasGraphicsFactory:s}=this,{xstep:c,ystep:l}=this;c=Math.abs(c),l=Math.abs(l),uw(`TilingType: `+a);let u=n[0],d=n[1],f=n[2],p=n[3],m=f-u,h=p-d,g=new Float32Array(2);Q.singularValueDecompose2dScale(this.matrix,g);let[_,v]=g;Q.singularValueDecompose2dScale(this.baseTransform,g);let y=_*g[0],b=v*g[1],x=m,S=h,C=!1,w=!1,T=Math.ceil(c*y),E=Math.ceil(l*b);T>=Math.ceil(m*y)?x=c:C=!0,E>=Math.ceil(h*b)?S=l:w=!0;let D=this.getSizeAndScale(x,this.ctx.canvas.width,y),O=this.getSizeAndScale(S,this.ctx.canvas.height,b),k=e.cachedCanvases.getCanvas(`pattern`,D.size,O.size),ee=k.context,A=s.createCanvasGraphics(ee,t);if(A.groupLevel=e.groupLevel,this.setFillAndStrokeStyleToContext(A,i,o),ee.translate(-D.scale*u,-O.scale*d),A.transform(0,D.scale,0,0,O.scale,0,0),ee.save(),A.dependencyTracker?.save(),this.clipBbox(A,u,d,f,p),A.baseTransform=$w(A.ctx),A.executeOperatorList(r),A.endDrawing(),A.dependencyTracker?.restore(),ee.restore(),C||w){let t=k.canvas;C&&(x=c),w&&(S=l);let n=this.getSizeAndScale(x,this.ctx.canvas.width,y),r=this.getSizeAndScale(S,this.ctx.canvas.height,b),i=n.size,a=r.size,o=e.cachedCanvases.getCanvas(`pattern-workaround`,i,a),s=o.context,f=C?Math.floor(m/c):0,p=w?Math.floor(h/l):0;for(let e=0;e<=f;e++)for(let n=0;n<=p;n++)s.drawImage(t,i*e,a*n,i,a,0,0,i,a);return{canvas:o.canvas,scaleX:n.scale,scaleY:r.scale,offsetX:u,offsetY:d}}return{canvas:k.canvas,scaleX:D.scale,scaleY:O.scale,offsetX:u,offsetY:d}}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;e.ctx.rect(t,n,a,o),Q.axialAlignedBoundingBox([t,n,r,i],$w(e.ctx),e.current.minMax),e.clip(),e.endPath()}setFillAndStrokeStyleToContext(e,t,n){let r=e.ctx,i=e.current;switch(t){case HE:let{fillStyle:e,strokeStyle:a}=this.ctx;r.fillStyle=i.fillColor=e,r.strokeStyle=i.strokeColor=a;break;case UE:r.fillStyle=r.strokeStyle=n,i.fillColor=i.strokeColor=n;break;default:throw new Sw(`Unsupported paint type: ${t}`)}}isModifyingCurrentTransform(){return!1}getPattern(e,t,n,r,i){let a=n;r!==PE&&(a=Q.transform(a,t.baseTransform),this.matrix&&(a=Q.transform(a,this.matrix)));let 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 c.setTransform(s),c}};function GE({src:e,srcPos:t=0,dest:n,width:r,height:i,nonBlackColor:a=4294967295,inverseDecode:o=!1}){let s=Ew.isLittleEndian?4278190080:255,[c,l]=o?[a,s]:[s,a],u=r>>3,d=7&r,f=e.length;n=new Uint32Array(n.buffer);let p=0;for(let r=0;r<i;r++){for(let r=t+u;t<r;t++){let r=t<f?e[t]:255;n[p++]=128&r?l:c,n[p++]=64&r?l:c,n[p++]=32&r?l:c,n[p++]=16&r?l:c,n[p++]=8&r?l:c,n[p++]=4&r?l:c,n[p++]=2&r?l:c,n[p++]=1&r?l:c}if(d===0)continue;let r=t<f?e[t++]:255;for(let e=0;e<d;e++)n[p++]=r&1<<7-e?l:c}return{srcPos:t,destPos:p}}var KE=16,qE=new DOMMatrix,JE=new Float32Array(2),YE=new Float32Array([1/0,1/0,-1/0,-1/0]),XE=class{constructor(e){this.canvasFactory=e,this.cache=Object.create(null)}getCanvas(e,t,n){let r;return this.cache[e]===void 0?(r=this.canvasFactory.create(t,n),this.cache[e]=r):(r=this.cache[e],this.canvasFactory.reset(r,t,n)),r}delete(e){delete this.cache[e]}clear(){for(let e in this.cache){let t=this.cache[e];this.canvasFactory.destroy(t),delete this.cache[e]}}};function ZE(e,t,n,r,i,a,o,s,c,l){let[u,d,f,p,m,h]=$w(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]}return e.drawImage(t,n,r,i,a,o,s,c,l),[Math.hypot(u,d)*c,Math.hypot(f,p)*l]}var QE=class{alphaIsShape=!1;fontSize=0;fontSizeScale=1;textMatrix=null;textMatrixScale=1;fontMatrix=EC;leading=0;x=0;y=0;lineX=0;lineY=0;charSpacing=0;wordSpacing=0;textHScale=1;textRenderingMode=VC;textRise=0;fillColor=`#000000`;strokeColor=`#000000`;patternFill=!1;patternStroke=!1;fillAlpha=1;strokeAlpha=1;lineWidth=1;activeSMask=null;transferMaps=`none`;constructor(e,t,n){n?.(this),this.clipBox=new Float32Array([0,0,e,t]),this.minMax=YE.slice()}clone(){let e=Object.create(this);return e.clipBox=this.clipBox.slice(),e.minMax=this.minMax.slice(),e}getPathBoundingBox(e=ME,t=null){let n=this.minMax.slice();if(e===NE){t||fw(`Stroke bounding box must include transform.`),Q.singularValueDecompose2dScale(t,JE);let e=JE[0]*this.lineWidth/2,r=JE[1]*this.lineWidth/2;n[0]-=e,n[1]-=r,n[2]+=e,n[3]+=r}return n}updateClipFromPath(){let e=Q.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(YE,0)}getClippedPathBoundingBox(e=ME,t=null){return Q.intersect(this.clipBox,this.getPathBoundingBox(e,t))}};function $E(e,t){if(t instanceof ImageData)return void e.putImageData(t,0,0);let n=t.height,r=t.width,i=n%KE,a=(n-i)/KE,o=i===0?a:a+1,s=e.createImageData(r,KE),c,l=0,u=t.data,d=s.data,f,p,m,h;if(t.kind===qC.GRAYSCALE_1BPP){let t=u.byteLength,n=new Uint32Array(d.buffer,0,d.byteLength>>2),h=n.length,g=r+7>>3,_=4294967295,v=Ew.isLittleEndian?4278190080:255;for(f=0;f<o;f++){for(m=f<a?KE:i,c=0,p=0;p<m;p++){let e=t-l,i=0,a=e>g?r:8*e-7,o=-8&a,s=0,d=0;for(;i<o;i+=8)d=u[l++],n[c++]=128&d?_:v,n[c++]=64&d?_:v,n[c++]=32&d?_:v,n[c++]=16&d?_:v,n[c++]=8&d?_:v,n[c++]=4&d?_:v,n[c++]=2&d?_:v,n[c++]=1&d?_:v;for(;i<a;i++)s===0&&(d=u[l++],s=128),n[c++]=d&s?_:v,s>>=1}for(;c<h;)n[c++]=0;e.putImageData(s,0,f*KE)}}else if(t.kind===qC.RGBA_32BPP){for(p=0,h=r*KE*4,f=0;f<a;f++)d.set(u.subarray(l,l+h)),l+=h,e.putImageData(s,0,p),p+=KE;f<o&&(h=r*i*4,d.set(u.subarray(l,l+h)),e.putImageData(s,0,p))}else{if(t.kind!==qC.RGB_24BPP)throw Error(`bad image kind: ${t.kind}`);for(m=KE,h=r*m,f=0;f<o;f++){for(f>=a&&(m=i,h=r*m),c=0,p=h;p--;)d[c++]=u[l++],d[c++]=u[l++],d[c++]=u[l++],d[c++]=255;e.putImageData(s,0,f*KE)}}}function eD(e,t){if(t.bitmap)return void e.drawImage(t.bitmap,0,0);let n=t.height,r=t.width,i=n%KE,a=(n-i)/KE,o=i===0?a:a+1,s=e.createImageData(r,KE),c=0,l=t.data,u=s.data;for(let t=0;t<o;t++){let n=t<a?KE:i;({srcPos:c}=GE({src:l,srcPos:c,dest:u,width:r,height:n,nonBlackColor:0})),e.putImageData(s,0,t*KE)}}function tD(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 nD(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`)}function rD(e,t){if(t)return!0;Q.singularValueDecompose2dScale(e,JE);let n=Math.fround(nT.pixelRatio*Rw.PDF_TO_CSS_UNITS);return JE[0]<=n&&JE[1]<=n}var iD=[`butt`,`round`,`square`],aD=[`miter`,`round`,`bevel`],oD={},sD={},cD=class e{constructor(e,t,n,r,i,{optionalContentConfig:a,markedContentStack:o=null},s,c,l){this.ctx=e,this.current=new QE(this.ctx.canvas.width,this.ctx.canvas.height),this.stateStack=[],this.pendingClip=null,this.pendingEOFill=!1,this.res=null,this.xobjs=null,this.commonObjs=t,this.objs=n,this.canvasFactory=r,this.filterFactory=i,this.groupStack=[],this.baseTransform=null,this.baseTransformStack=[],this.groupLevel=0,this.smaskStack=[],this.smaskCounter=0,this.tempSMask=null,this.suspendedCtx=null,this.contentVisible=!0,this.markedContentStack=o||[],this.optionalContentConfig=a,this.cachedCanvases=new XE(this.canvasFactory),this.cachedPatterns=new Map,this.annotationCanvasMap=s,this.viewportScale=1,this.outputScaleX=1,this.outputScaleY=1,this.pageColors=c,this._cachedScaleForStroking=[-1,0],this._cachedGetSinglePixelWidth=null,this._cachedBitmapsMap=new Map,this.dependencyTracker=l??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.cachedCanvases.getCanvas(`transparent`,i,a);this.compositeCtx=this.ctx,this.transparentCanvas=e.canvas,this.ctx=e.context,this.ctx.save(),this.ctx.transform(...$w(this.compositeCtx))}this.ctx.save(),nD(this.ctx),e&&(this.ctx.transform(...e),this.outputScaleX=e[0],this.outputScaleY=e[0]),this.ctx.transform(...t.transform),this.viewportScale=t.scale,this.baseTransform=$w(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>10&&typeof n==`function`,u=l?Date.now()+15:0,d=0,f=this.commonObjs,p=this.objs,m,h;for(;;){if(r!==void 0&&s===r.nextBreakPoint)return r.breakIt(s,n),s;if(!i||i(s))if(m=o[s],h=a[s]??null,m!==tw.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>10){if(Date.now()>u)return n(),s;d=0}}}#e(){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(),null)}endDrawing(){this.#e(),this.cachedCanvases.clear(),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.#t()}#t(){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,a,o=Math.max(Math.hypot(t[0],t[1]),1),s=Math.max(Math.hypot(t[2],t[3]),1),c=n,l=r,u=`prescale1`;for(;o>2&&c>1||s>2&&l>1;){let t=c,n=l;o>2&&c>1&&(t=c>=16384?Math.floor(c/2)-1||1:Math.ceil(c/2),o/=c/t),s>2&&l>1&&(n=l>=16384?Math.floor(l/2)-1||1:Math.ceil(l)/2,s/=l/n),i=this.cachedCanvases.getCanvas(u,t,n),a=i.context,a.clearRect(0,0,t,n),a.drawImage(e,0,0,c,l,0,0,t,n),e=i.canvas,c=t,l=n,u=u===`prescale1`?`prescale2`:`prescale1`}return{img:e,paintWidth:c,paintHeight:l}}_createMaskCanvas(e,t){let n=this.ctx,{width:r,height:i}=t,a=this.current.fillColor,o=this.current.patternFill,s=$w(n),c,l,u,d;if((t.bitmap||t.data)&&t.count>1){let n=t.bitmap||t.data.buffer;l=JSON.stringify(o?s:[s.slice(0,4),a]),c=this._cachedBitmapsMap.get(n),c||(c=new Map,this._cachedBitmapsMap.set(n,c));let r=c.get(l);if(r&&!o){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,jE),{canvas:r,offsetX:t,offsetY:n}}u=r}u||(d=this.cachedCanvases.getCanvas(`maskCanvas`,r,i),eD(d.context,t));let f=Q.transform(s,[1/r,0,0,-1/i,0,0]);f=Q.transform(f,[1,0,0,1,0,-i]);let p=YE.slice();Q.axialAlignedBoundingBox([0,0,r,i],f,p);let[m,h,g,_]=p,v=Math.round(g-m)||1,y=Math.round(_-h)||1,b=this.cachedCanvases.getCanvas(`fillCanvas`,v,y),x=b.context,S=m,C=h;x.translate(-S,-C),x.transform(...f),u||(u=this._scaleImage(d.canvas,eT(x)),u=u.img,c&&o&&c.set(l,u)),x.imageSmoothingEnabled=rD($w(x),t.interpolate),ZE(x,u,0,0,u.width,u.height,0,0,r,i),x.globalCompositeOperation=`source-in`;let w=Q.transform(eT(x),[1,0,0,1,-S,-C]);return x.fillStyle=o?a.getPattern(n,this,w,ME,e):a,x.fillRect(0,0,r,i),c&&!o&&(this.cachedCanvases.delete(`fillCanvas`),c.set(l,b.canvas)),this.dependencyTracker?.recordDependencies(e,jE),{canvas:b.canvas,offsetX:Math.round(S),offsetY:Math.round(C)}}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=iD[t]}setLineJoin(e,t){this.dependencyTracker?.recordSimpleData(`lineJoin`,e),this.ctx.lineJoin=aD[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.tempSMask=null,this.checkSMaskState();break;case`TR`:this.dependencyTracker?.recordSimpleData(`filter`,e),this.ctx.filter=this.current.transferMaps=this.filterFactory.addFilter(r)}}get inSMaskMode(){return!!this.suspendedCtx}checkSMaskState(){let e=this.inSMaskMode;this.current.activeSMask&&!e?this.beginSMaskMode():!this.current.activeSMask&&e&&this.endSMaskMode()}beginSMaskMode(e){if(this.inSMaskMode)throw Error(`beginSMaskMode called while already in smask mode`);let t=this.ctx.canvas.width,n=this.ctx.canvas.height,r=`smaskGroupAt`+this.groupLevel,i=this.cachedCanvases.getCanvas(r,t,n);this.suspendedCtx=this.ctx;let a=this.ctx=i.context;a.setTransform(this.suspendedCtx.getTransform()),tD(this.suspendedCtx,a),function(e,t){if(e._removeMirroring)throw Error(`Context is already forwarding operations.`);e.__originalSave=e.save,e.__originalRestore=e.restore,e.__originalRotate=e.rotate,e.__originalScale=e.scale,e.__originalTranslate=e.translate,e.__originalTransform=e.transform,e.__originalSetTransform=e.setTransform,e.__originalResetTransform=e.resetTransform,e.__originalClip=e.clip,e.__originalMoveTo=e.moveTo,e.__originalLineTo=e.lineTo,e.__originalBezierCurveTo=e.bezierCurveTo,e.__originalRect=e.rect,e.__originalClosePath=e.closePath,e.__originalBeginPath=e.beginPath,e._removeMirroring=()=>{e.save=e.__originalSave,e.restore=e.__originalRestore,e.rotate=e.__originalRotate,e.scale=e.__originalScale,e.translate=e.__originalTranslate,e.transform=e.__originalTransform,e.setTransform=e.__originalSetTransform,e.resetTransform=e.__originalResetTransform,e.clip=e.__originalClip,e.moveTo=e.__originalMoveTo,e.lineTo=e.__originalLineTo,e.bezierCurveTo=e.__originalBezierCurveTo,e.rect=e.__originalRect,e.closePath=e.__originalClosePath,e.beginPath=e.__originalBeginPath,delete e._removeMirroring},e.save=function(){t.save(),this.__originalSave()},e.restore=function(){t.restore(),this.__originalRestore()},e.translate=function(e,n){t.translate(e,n),this.__originalTranslate(e,n)},e.scale=function(e,n){t.scale(e,n),this.__originalScale(e,n)},e.transform=function(e,n,r,i,a,o){t.transform(e,n,r,i,a,o),this.__originalTransform(e,n,r,i,a,o)},e.setTransform=function(e,n,r,i,a,o){t.setTransform(e,n,r,i,a,o),this.__originalSetTransform(e,n,r,i,a,o)},e.resetTransform=function(){t.resetTransform(),this.__originalResetTransform()},e.rotate=function(e){t.rotate(e),this.__originalRotate(e)},e.clip=function(e){t.clip(e),this.__originalClip(e)},e.moveTo=function(e,n){t.moveTo(e,n),this.__originalMoveTo(e,n)},e.lineTo=function(e,n){t.lineTo(e,n),this.__originalLineTo(e,n)},e.bezierCurveTo=function(e,n,r,i,a,o){t.bezierCurveTo(e,n,r,i,a,o),this.__originalBezierCurveTo(e,n,r,i,a,o)},e.rect=function(e,n,r,i){t.rect(e,n,r,i),this.__originalRect(e,n,r,i)},e.closePath=function(){t.closePath(),this.__originalClosePath()},e.beginPath=function(){t.beginPath(),this.__originalBeginPath()}}(a,this.suspendedCtx),this.setGState(e,[[`BM`,`source-over`]])}endSMaskMode(){if(!this.inSMaskMode)throw Error(`endSMaskMode called while not in smask mode`);this.ctx._removeMirroring(),tD(this.ctx,this.suspendedCtx),this.ctx=this.suspendedCtx,this.suspendedCtx=null}compose(e){if(!this.current.activeSMask)return;e?(e[0]=Math.floor(e[0]),e[1]=Math.floor(e[1]),e[2]=Math.ceil(e[2]),e[3]=Math.ceil(e[3])):e=[0,0,this.ctx.canvas.width,this.ctx.canvas.height];let t=this.current.activeSMask,n=this.suspendedCtx;this.composeSMask(n,t,this.ctx,e),this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.clearRect(0,0,this.ctx.canvas.width,this.ctx.canvas.height),this.ctx.restore()}composeSMask(e,t,n,r){let i=r[0],a=r[1],o=r[2]-i,s=r[3]-a;o!==0&&s!==0&&(this.genericComposeSMask(t.context,n,o,s,t.subtype,t.backdrop,t.transferMap,i,a,t.offsetX,t.offsetY),e.save(),e.globalAlpha=1,e.globalCompositeOperation=`source-over`,e.setTransform(1,0,0,1,0,0),e.drawImage(n.canvas,0,0),e.restore())}genericComposeSMask(e,t,n,r,i,a,o,s,c,l,u){let d=e.canvas,f=s-l,p=c-u;if(a)if(f<0||p<0||f+n>d.width||p+r>d.height){let e=this.cachedCanvases.getCanvas(`maskExtension`,n,r),t=e.context;t.drawImage(d,-f,-p),t.globalCompositeOperation=`destination-atop`,t.fillStyle=a,t.fillRect(0,0,n,r),t.globalCompositeOperation=`source-over`,d=e.canvas,f=p=0}else{e.save(),e.globalAlpha=1,e.setTransform(1,0,0,1,0,0);let t=new Path2D;t.rect(f,p,n,r),e.clip(t),e.globalCompositeOperation=`destination-atop`,e.fillStyle=a,e.fillRect(f,p,n,r),e.restore()}t.save(),t.globalAlpha=1,t.setTransform(1,0,0,1,0,0),i===`Alpha`&&o?t.filter=this.filterFactory.addAlphaFilter(o):i===`Luminosity`&&(t.filter=this.filterFactory.addLuminosityFilter(o));let m=new Path2D;m.rect(s,c,n,r),t.clip(m),t.globalCompositeOperation=`destination-in`,t.drawImage(d,f,p,n,r,s,c,n,r),t.restore()}save(e){this.inSMaskMode&&tD(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&&tD(this.suspendedCtx,this.ctx),this.checkSMaskState(),this.pendingClip=null,this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null)}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,this._cachedGetSinglePixelWidth=null}constructPath(e,t,n,r){let[i]=n;if(!r)return i||=n[0]=new Path2D,void this[t](e,i);if(this.dependencyTracker!==null){let n=t===tw.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`])}if(!(i instanceof Path2D)){let e=n[0]=new Path2D;for(let t=0,n=i.length;t<n;)switch(i[t++]){case nw:e.moveTo(i[t++],i[t++]);break;case rw:e.lineTo(i[t++],i[t++]);break;case iw:e.bezierCurveTo(i[t++],i[t++],i[t++],i[t++],i[t++],i[t++]);break;case aw:e.closePath();break;default:dw(`Unrecognized drawing path operator: ${i[t-1]}`)}i=e}Q.axialAlignedBoundingBox(r,$w(this.ctx),this.current.minMax),this[t](e,i),this._pathStartIdx=e}closePath(e){this.ctx.closePath()}stroke(e,t,n=!0){let r=this.ctx,i=this.current.strokeColor;if(r.globalAlpha=this.current.strokeAlpha,this.contentVisible)if(typeof i==`object`&&i?.getPattern){let n=i.isModifyingCurrentTransform()?r.getTransform():null;if(r.save(),r.strokeStyle=i.getPattern(r,this,eT(r),NE,e),n){let e=new Path2D;e.addPath(t,r.getTransform().invertSelf().multiplySelf(n)),t=e}this.rescaleAndStroke(t,!1),r.restore()}else this.rescaleAndStroke(t,!0);this.dependencyTracker?.recordDependencies(e,TE),n&&this.consumePath(e,t,this.current.getClippedPathBoundingBox(NE,$w(this.ctx))),r.globalAlpha=this.current.fillAlpha}closeStroke(e,t){this.stroke(e,t)}fill(e,t,n=!0){let r=this.ctx,i=this.current.fillColor,a=!1;if(this.current.patternFill){let n=i.isModifyingCurrentTransform()?r.getTransform():null;if(this.dependencyTracker?.save(e),r.save(),r.fillStyle=i.getPattern(r,this,eT(r),ME,e),n){let e=new Path2D;e.addPath(t,r.getTransform().invertSelf().multiplySelf(n)),t=e}a=!0}let o=this.current.getClippedPathBoundingBox();this.contentVisible&&o!==null&&(this.pendingEOFill?(r.fill(t,`evenodd`),this.pendingEOFill=!1):r.fill(t)),this.dependencyTracker?.recordDependencies(e,EE),a&&(r.restore(),this.dependencyTracker?.restore(e)),n&&this.consumePath(e,t,o)}eoFill(e,t){this.pendingEOFill=!0,this.fill(e,t)}fillStroke(e,t){this.fill(e,t,!1),this.stroke(e,t,!1),this.consumePath(e,t)}eoFillStroke(e,t){this.pendingEOFill=!0,this.fillStroke(e,t)}closeFillStroke(e,t){this.fillStroke(e,t)}closeEOFillStroke(e,t){this.pendingEOFill=!0,this.fillStroke(e,t)}endPath(e,t){this.consumePath(e,t)}rawFillPath(e,t){this.ctx.fill(t),this.dependencyTracker?.recordDependencies(e,OE).recordOperation(e)}clip(e){this.dependencyTracker?.recordFutureForcedDependency(`clipMode`,e),this.pendingClip=oD}eoClip(e){this.dependencyTracker?.recordFutureForcedDependency(`clipMode`,e),this.pendingClip=sD}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||EC,i.fontMatrix[0]!==0&&i.fontMatrix[3]!==0||dw(`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=n;n<16?l=16:n>100&&(l=100),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?.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)}#n(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&GC,f=!!(l&KC),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)){let t;if(o.save(),o.translate(n,r),o.scale(u,-u),this.dependencyTracker?.recordCharacterBBox(e,o,c),d===VC||d===UC)if(i){t=o.getTransform(),o.setTransform(...i);let e=this.#n(h,t,i);o.fill(e)}else o.fill(h);if(d===HC||d===UC)if(a){t||=o.getTransform(),o.setTransform(...a);let{a:e,b:n,c:r,d:i}=t,s=Q.inverseTransform(a),c=Q.transform([e,n,r,i,0,0],s);Q.singularValueDecompose2dScale(c,JE),o.lineWidth*=Math.max(JE[0],JE[1])/u,o.stroke(this.#n(h,t,a))}else o.lineWidth/=u,o.stroke(h);o.restore()}else d!==VC&&d!==UC||(o.fillText(t,n,r),this.dependencyTracker?.recordCharacterBBox(e,o,c,u,n,r,()=>o.measureText(t))),d!==HC&&d!==UC||(this.dependencyTracker&&this.dependencyTracker?.recordCharacterBBox(e,o,c,u,n,r,()=>o.measureText(t)).recordDependencies(e,TE),o.strokeText(t,n,r));f&&((this.pendingTextPaths||=[]).push({transform:$w(o),x:n,y:r,fontSize:u,path:h}),this.dependencyTracker?.recordCharacterBBox(e,o,c,u,n,r))}get isFontSubpixelAAEnabled(){let{context:e}=this.cachedCanvases.getCanvas(`isFontSubpixelAAEnabled`,10,10);e.scale(1.5,1),e.fillText(`I`,0,10);let t=e.getImageData(0,0,10,10).data,n=!1;for(let e=3;e<t.length;e+=4)if(t[e]>0&&t[e]<255){n=!0;break}return gw(this,`isFontSubpixelAAEnabled`,n)}showText(e,t){this.dependencyTracker&&(this.dependencyTracker.recordDependencies(e,kE).resetBBox(e),this.current.textRenderingMode&KC&&this.dependencyTracker.recordFutureForcedDependency(`textClip`,e).inheritPendingDependenciesAsFutureForcedDependencies());let n=this.current,r=n.font;if(r.isType3Font)return this.showType3Text(e,t),void this.dependencyTracker?.recordShowTextOperation(e);let i=n.fontSize;if(i===0)return void this.dependencyTracker?.recordOperation(e);let a=this.ctx,o=n.fontSizeScale,s=n.charSpacing,c=n.wordSpacing,l=n.fontDirection,u=n.textHScale*l,d=t.length,f=r.vertical,p=f?1:-1,m=r.defaultVMetrics,h=i*n.fontMatrix[0],g=n.textRenderingMode===VC&&!r.disableFontFace&&!n.patternFill,_,v;if(a.save(),n.textMatrix&&a.transform(...n.textMatrix),a.translate(n.x,n.y+n.textRise),l>0?a.scale(u,-1):a.scale(u,1),n.patternFill){a.save();let t=n.fillColor.getPattern(a,this,eT(a),ME,e);_=$w(a),a.restore(),a.fillStyle=t}if(n.patternStroke){a.save();let t=n.strokeColor.getPattern(a,this,eT(a),NE,e);v=$w(a),a.restore(),a.strokeStyle=t}let y=n.lineWidth,b=n.textMatrixScale;if(b===0||y===0){let e=n.textRenderingMode&GC;e!==HC&&e!==UC||(y=this.getSinglePixelWidth())}else y/=b;if(o!==1&&(a.scale(o,o),y/=o),a.lineWidth=y,r.isInvalidPDFjsFont){let r=[],i=0;for(let e of t)r.push(e.unicode),i+=e.width;let o=r.join(``);if(a.fillText(o,0,0),this.dependencyTracker!==null){let t=a.measureText(o);this.dependencyTracker.recordBBox(e,this.ctx,-t.actualBoundingBoxLeft,t.actualBoundingBoxRight,-t.actualBoundingBoxAscent,t.actualBoundingBoxDescent).recordShowTextOperation(e)}n.x+=i*h*u,a.restore(),this.compose();return}let x,S=0;for(x=0;x<d;++x){let n=t[x];if(typeof n==`number`){S+=p*n*i/1e3;continue}let u=!1,d=(n.isSpace?c:0)+s,y=n.fontChar,b=n.accent,C,w,T,E=n.width;if(f){let e=n.vmetric||m,t=-(n.vmetric?e[1]:.5*E)*h,r=e[2]*h;E=e?-e[0]:E,C=t/o,w=(S+r)/o}else C=S/o,w=0;if(r.remeasure&&E>0){T=a.measureText(y);let e=1e3*T.width/i*o;if(E<e&&this.isFontSubpixelAAEnabled){let t=E/e;u=!0,a.save(),a.scale(t,1),C/=t}else E!==e&&(C+=(E-e)/2e3*i/o)}if(this.contentVisible&&(n.isInFont||r.missingFile)){if(g&&!b)a.fillText(y,C,w),this.dependencyTracker?.recordCharacterBBox(e,a,T?{bbox:null}:r,i/o,C,w,()=>T??a.measureText(y));else if(this.paintChar(e,y,C,w,_,v),b){let t=C+i*b.offset.x/o,n=w-i*b.offset.y/o;this.paintChar(e,b.fontChar,t,n,_,v)}}S+=f?E*h-d*l:E*h+d*l,u&&a.restore()}f?n.y-=S:n.x+=S*u,a.restore(),this.compose(),this.dependencyTracker?.recordShowTextOperation(e)}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||EC,f=t.length,p,m,h,g;if(r.textRenderingMode===WC||a===0)return;this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null,n.save(),r.textMatrix&&n.transform(...r.textMatrix),n.translate(r.x,r.y+r.textRise),n.scale(u,o);let _=this.dependencyTracker;for(this.dependencyTracker=_?new wE(_,e):null,p=0;p<f;++p){if(m=t[p],typeof m==`number`){g=s*m*a/1e3,this.ctx.translate(g,0),r.x+=g*u;continue}let e=(m.isSpace?l:0)+c,o=i.charProcOperatorList[m.operatorListId];o?this.contentVisible&&(this.save(),n.scale(a,a),n.transform(...d),this.executeOperatorList(o),this.restore()):dw(`Type3 character "${m.operatorListId}" is not available.`);let f=[m.width,0];Q.applyTransform(f,d),h=f[0]*a+e,n.translate(h,0),r.x+=h*u}n.restore(),_&&(this.dependencyTracker=_)}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||$w(this.ctx);r=new WE(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 wE(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),this.current.fillColor=this.getColorN_Pattern(e,t),this.current.patternFill=!0}setStrokeRGBColor(e,t){this.dependencyTracker?.recordSimpleData(`strokeColor`,e),this.ctx.strokeStyle=this.current.strokeColor=t,this.current.patternStroke=!1}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.ctx.fillStyle=this.current.fillColor=t,this.current.patternFill=!1}setFillTransparent(e){this.dependencyTracker?.recordSimpleData(`fillColor`,e),this.ctx.fillStyle=this.current.fillColor=`transparent`,this.current.patternFill=!1}_getPattern(e,t,n=null){let r;return this.cachedPatterns.has(t)?r=this.cachedPatterns.get(t):(r=function(e){switch(e[0]){case`RadialAxial`:return new LE(e);case`Mesh`:return new BE(e);case`Dummy`:return new VE}throw Error(`Unknown IR type: ${e[0]}`)}(this.getObject(e,t)),this.cachedPatterns.set(t,r)),n&&(r.matrix=n),r}shadingFill(e,t){if(!this.contentVisible)return;let n=this.ctx;this.save(e),n.fillStyle=this._getPattern(e,t).getPattern(n,this,eT(n),PE,e);let r=eT(n);if(r){let{width:e,height:t}=n.canvas,i=YE.slice();Q.axialAlignedBoundingBox([0,0,e,t],r,i);let[a,o,s,c]=i;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,AE).recordDependencies(e,EE).recordOperation(e),this.compose(this.current.getClippedPathBoundingBox()),this.restore(e)}beginInlineImage(){fw(`Should not call beginInlineImage`)}beginImageData(){fw(`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=$w(this.ctx),n)){Q.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),this.inSMaskMode&&(this.endSMaskMode(),this.current.activeSMask=null);let n=this.ctx;t.isolated||uw(`TODO: Support non-isolated groups.`),t.knockout&&dw(`Knockout groups not supported.`);let r=$w(n);if(t.matrix&&n.transform(...t.matrix),!t.bbox)throw Error(`Bounding box is required.`);let i=YE.slice();Q.axialAlignedBoundingBox(t.bbox,$w(n),i);let a=[0,0,n.canvas.width,n.canvas.height];i=Q.intersect(i,a)||[0,0,0,0];let o=Math.floor(i[0]),s=Math.floor(i[1]),c=Math.max(Math.ceil(i[2])-o,1),l=Math.max(Math.ceil(i[3])-s,1);this.current.startNewPathAndClipBox([0,0,c,l]);let u=`groupAt`+this.groupLevel;t.smask&&(u+=`_smask_`+ this.smaskCounter++%2);let d=this.cachedCanvases.getCanvas(u,c,l),f=d.context;f.translate(-o,-s),f.transform(...r);let p=new Path2D,[m,h,g,_]=t.bbox;if(p.rect(m,h,g-m,_-h),t.matrix){let e=new Path2D;e.addPath(p,new DOMMatrix(t.matrix)),p=e}f.clip(p),t.smask&&this.smaskStack.push({canvas:d.canvas,context:f,offsetX:o,offsetY:s,subtype:t.smask.subtype,backdrop:t.smask.backdrop,transferMap:t.smask.transferMap||null,startTransformInverse:null}),t.smask&&!this.dependencyTracker||(n.setTransform(1,0,0,1,0,0),n.translate(o,s),n.save()),tD(n,f),this.ctx=f,this.dependencyTracker?.inheritSimpleDataAsFutureForcedDependencies([`fillAlpha`,`strokeAlpha`,`globalCompositeOperation`]).pushBaseTransform(n),this.setGState(e,[[`BM`,`source-over`],[`ca`,1],[`CA`,1]]),this.groupStack.push(n),this.groupLevel++}endGroup(e,t){if(!this.contentVisible)return;this.groupLevel--;let n=this.ctx;if(this.ctx=this.groupStack.pop(),this.ctx.imageSmoothingEnabled=!1,this.dependencyTracker?.popBaseTransform(),t.smask)this.tempSMask=this.smaskStack.pop(),this.restore(e),this.dependencyTracker&&this.ctx.restore();else{this.ctx.restore();let t=$w(this.ctx);this.restore(e),this.ctx.save(),this.ctx.setTransform(...t);let r=YE.slice();Q.axialAlignedBoundingBox([0,0,n.canvas.width,n.canvas.height],t,r),this.ctx.drawImage(n.canvas,0,0),this.ctx.restore(),this.compose(r)}}beginAnnotation(e,t,n,r,i,a){if(this.#e(),nD(this.ctx),this.ctx.save(),this.save(e),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),n){let i=n[2]-n[0],o=n[3]-n[1];if(a&&this.annotationCanvasMap){(r=r.slice())[4]-=n[0],r[5]-=n[1],(n=n.slice())[0]=n[1]=0,n[2]=i,n[3]=o,Q.singularValueDecompose2dScale($w(this.ctx),JE);let{viewportScale:e}=this,a=Math.ceil(i*this.outputScaleX*e),s=Math.ceil(o*this.outputScaleY*e);this.annotationCanvas=this.canvasFactory.create(a,s);let{canvas:c,context:l}=this.annotationCanvas;this.annotationCanvasMap.set(t,c),this.annotationCanvas.savedCtx=this.ctx,this.ctx=l,this.ctx.save(),this.ctx.setTransform(JE[0],0,0,-JE[1],0,o*JE[1]),nD(this.ctx)}else{nD(this.ctx),this.endPath(e);let t=new Path2D;t.rect(n[0],n[1],i,o),this.ctx.clip(t)}}this.current=new QE(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(e,...r),this.transform(e,...i)}endAnnotation(e){this.annotationCanvas&&(this.ctx.restore(),this.#t(),this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas)}paintImageMaskXObject(e,t){if(!this.contentVisible)return;let n=t.count;(t=this.getObject(e,t.data,t)).count=n;let r=this.ctx,i=this._createMaskCanvas(e,t),a=i.canvas;r.save(),r.setTransform(1,0,0,1,0,0),r.drawImage(a,i.offsetX,i.offsetY),this.dependencyTracker?.resetBBox(e).recordBBox(e,this.ctx,i.offsetX,i.offsetX+a.width,i.offsetY,i.offsetY+a.height).recordOperation(e),r.restore(),this.compose()}paintImageMaskXObjectRepeat(e,t,n,r=0,i=0,a,o){if(!this.contentVisible)return;t=this.getObject(e,t.data,t);let s=this.ctx;s.save();let c=$w(s);s.transform(n,r,i,a,0,0);let l=this._createMaskCanvas(e,t);s.setTransform(1,0,0,1,l.offsetX-c[4],l.offsetY-c[5]),this.dependencyTracker?.resetBBox(e);for(let t=0,u=o.length;t<u;t+=2){let u=Q.transform(c,[n,r,i,a,o[t],o[t+1]]);s.drawImage(l.canvas,u[4],u[5]),this.dependencyTracker?.recordBBox(e,this.ctx,u[4],u[4]+l.canvas.width,u[5],u[5]+l.canvas.height)}s.restore(),this.compose(),this.dependencyTracker?.recordOperation(e)}paintImageMaskXObjectGroup(e,t){if(!this.contentVisible)return;let n=this.ctx,r=this.current.fillColor,i=this.current.patternFill;this.dependencyTracker?.resetBBox(e).recordDependencies(e,jE);for(let a of t){let{data:t,width:o,height:s,transform:c}=a,l=this.cachedCanvases.getCanvas(`maskCanvas`,o,s),u=l.context;u.save(),eD(u,this.getObject(e,t,a)),u.globalCompositeOperation=`source-in`,u.fillStyle=i?r.getPattern(u,this,eT(n),ME,e):r,u.fillRect(0,0,o,s),u.restore(),n.save(),n.transform(...c),n.scale(1,-1),ZE(n,l.canvas,0,0,o,s,0,-1,1,1),this.dependencyTracker?.recordBBox(e,n,0,o,0,s),n.restore()}this.compose(),this.dependencyTracker?.recordOperation(e)}paintImageXObject(e,t){if(!this.contentVisible)return;let n=this.getObject(e,t);n?this.paintInlineImageXObject(e,n):dw(`Dependent image isn't ready yet`)}paintImageXObjectRepeat(e,t,n,r,i){if(!this.contentVisible)return;let a=this.getObject(e,t);if(!a)return void dw(`Dependent image isn't ready yet`);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`&&(e.filter=this.current.transferMaps,e.drawImage(e.canvas,0,0),e.filter=`none`),e.canvas}applyTransferMapsToBitmap(e){if(this.current.transferMaps===`none`)return e.bitmap;let{bitmap:t,width:n,height:r}=e,i=this.cachedCanvases.getCanvas(`inlineImage`,n,r),a=i.context;return a.filter=this.current.transferMaps,a.drawImage(t,0,0),a.filter=`none`,i.canvas}paintInlineImageXObject(e,t){if(!this.contentVisible)return;let n=t.width,r=t.height,i=this.ctx;this.save(e);let{filter:a}=i,o;if(a!==`none`&&a!==``&&(i.filter=`none`),i.scale(1/n,-1/r),t.bitmap)o=this.applyTransferMapsToBitmap(t);else if(typeof HTMLElement==`function`&&t instanceof HTMLElement||!t.data)o=t;else{let e=this.cachedCanvases.getCanvas(`inlineImage`,n,r).context;$E(e,t),o=this.applyTransferMapsToCanvas(e)}let s=this._scaleImage(o,eT(i));i.imageSmoothingEnabled=rD($w(i),t.interpolate),this.dependencyTracker?.resetBBox(e).recordBBox(e,i,0,n,-r,0).recordDependencies(e,DE).recordOperation(e),ZE(i,s.img,0,0,s.paintWidth,s.paintHeight,0,-r,n,r),this.compose(),this.restore(e)}paintInlineImageXObjectGroup(e,t,n){if(!this.contentVisible)return;let r=this.ctx,i;if(t.bitmap)i=t.bitmap;else{let e=t.width,n=t.height,r=this.cachedCanvases.getCanvas(`inlineImage`,e,n).context;$E(r,t),i=this.applyTransferMapsToCanvas(r)}this.dependencyTracker?.resetBBox(e);for(let t of n)r.save(),r.transform(...t.transform),r.scale(1,-1),ZE(r,i,t.x,t.y,t.w,t.h,0,-1,1,1),this.dependencyTracker?.recordBBox(e,r,0,1,-1,0),r.restore();this.dependencyTracker?.recordOperation(e),this.compose()}paintSolidColorImageMask(e){this.contentVisible&&(this.dependencyTracker?.resetBBox(e).recordBBox(e,this.ctx,0,1,0,1).recordDependencies(e,EE).recordOperation(e),this.ctx.fillRect(0,0,1,1),this.compose())}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===sD?i.clip(t,`evenodd`):i.clip(t)),this.pendingClip=null,this.dependencyTracker?.bboxToClipBoxDropOperation(e).recordFutureForcedDependency(`clipPath`,e)):this.dependencyTracker?.recordOperation(e),this.current.startNewPathAndClipBox(this.current.clipBox)}getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){let e=$w(this.ctx);if(e[1]===0&&e[2]===0)this._cachedGetSinglePixelWidth=1/Math.min(Math.abs(e[0]),Math.abs(e[3]));else{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]);this._cachedGetSinglePixelWidth=Math.max(n,r)/t}}return this._cachedGetSinglePixelWidth}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(e,t){let{ctx:n,current:{lineWidth:r}}=this,[i,a]=this.getScaleForStroking();if(i===a)return n.lineWidth=(r||1)*i,void n.stroke(e);let o=n.getLineDash();t&&n.save(),n.scale(i,a),qE.a=1/i,qE.d=1/a;let s=new Path2D;if(s.addPath(e,qE),o.length>0){let e=Math.max(i,a);n.setLineDash(o.map(t=>t/e)),n.lineDashOffset/=e}n.lineWidth=r||1,n.stroke(s),t&&n.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 tw)cD.prototype[e]!==void 0&&(cD.prototype[tw[e]]=cD.prototype[e]);var lD=class e{#e;#t;#n;static strings=[`fontFamily`,`fontWeight`,`italicAngle`];static write(t){let n=new TextEncoder,r={},i=0;for(let a of e.strings){let e=n.encode(t[a]);r[a]=e,i+=4+e.length}let a=new ArrayBuffer(i),o=new Uint8Array(a),s=new DataView(a),c=0;for(let t of e.strings){let e=r[t],n=e.length;s.setUint32(c,n),o.set(e,c+4),c+=4+n}return pw(c===a.byteLength,`CssFontInfo.write: Buffer overflow`),a}constructor(e){this.#e=e,this.#t=new DataView(this.#e),this.#n=new TextDecoder}#r(t){pw(t<e.strings.length,`Invalid string index`);let n=0;for(let e=0;e<t;e++)n+=this.#t.getUint32(n)+4;let r=this.#t.getUint32(n);return this.#n.decode(new Uint8Array(this.#e,n+4,r))}get fontFamily(){return this.#r(0)}get fontWeight(){return this.#r(1)}get italicAngle(){return this.#r(2)}},uD=class e{#e;#t;#n;static strings=[`css`,`loadedName`,`baseFontName`,`src`];static write(t){let n=new TextEncoder,r={},i=0;for(let a of e.strings){let e=n.encode(t[a]);r[a]=e,i+=4+e.length}i+=4;let a,o,s=1+i;t.style&&(a=n.encode(t.style.style),o=n.encode(t.style.weight),s+=4+a.length+4+o.length);let c=new ArrayBuffer(s),l=new Uint8Array(c),u=new DataView(c),d=0;u.setUint8(d++,+!!t.guessFallback),u.setUint32(d,0),d+=4,i=0;for(let t of e.strings){let e=r[t],n=e.length;i+=4+n,u.setUint32(d,n),l.set(e,d+4),d+=4+n}return u.setUint32(d-i-4,i),t.style&&(u.setUint32(d,a.length),l.set(a,d+4),d+=4+a.length,u.setUint32(d,o.length),l.set(o,d+4),d+=4+o.length),pw(d<=c.byteLength,`SubstitionInfo.write: Buffer overflow`),c.transferToFixedLength(d)}constructor(e){this.#e=e,this.#t=new DataView(this.#e),this.#n=new TextDecoder}get guessFallback(){return this.#t.getUint8(0)!==0}#r(t){pw(t<e.strings.length,`Invalid string index`);let n=5;for(let e=0;e<t;e++)n+=this.#t.getUint32(n)+4;let r=this.#t.getUint32(n);return this.#n.decode(new Uint8Array(this.#e,n+4,r))}get css(){return this.#r(0)}get loadedName(){return this.#r(1)}get baseFontName(){return this.#r(2)}get src(){return this.#r(3)}get style(){let e=1;e+=4+this.#t.getUint32(e);let t=this.#t.getUint32(e),n=this.#n.decode(new Uint8Array(this.#e,e+4,t));e+=4+t;let r=this.#t.getUint32(e);return{style:n,weight:this.#n.decode(new Uint8Array(this.#e,e+4,r))}}},dD=class e{static bools=[`black`,`bold`,`disableFontFace`,`fontExtraProperties`,`isInvalidPDFjsFont`,`isType3Font`,`italic`,`missingFile`,`remeasure`,`vertical`];static numbers=[`ascent`,`defaultWidth`,`descent`];static strings=[`fallbackName`,`loadedName`,`mimetype`,`name`];static#e=Math.ceil(2*this.bools.length/8);static#t=this.#e+8*this.numbers.length;static#n=this.#t+1+8;static#r=this.#n+1+48;static#i=this.#r+1+6;#a;#o;#s;constructor({data:e,extra:t}){this.#a=e,this.#o=new TextDecoder,this.#s=new DataView(this.#a),t&&Object.assign(this,t)}#c(t){pw(t<e.bools.length,`Invalid boolean index`);let n=Math.floor(t/4),r=2*t%8,i=this.#s.getUint8(n)>>r&3;return i===0?void 0:i===2}get black(){return this.#c(0)}get bold(){return this.#c(1)}get disableFontFace(){return this.#c(2)}get fontExtraProperties(){return this.#c(3)}get isInvalidPDFjsFont(){return this.#c(4)}get isType3Font(){return this.#c(5)}get italic(){return this.#c(6)}get missingFile(){return this.#c(7)}get remeasure(){return this.#c(8)}get vertical(){return this.#c(9)}#l(t){return pw(t<e.numbers.length,`Invalid number index`),this.#s.getFloat64(e.#e+8*t)}get ascent(){return this.#l(0)}get defaultWidth(){return this.#l(1)}get descent(){return this.#l(2)}get bbox(){let t=e.#t;if(this.#s.getUint8(t)===0)return;t+=1;let n=[];for(let e=0;e<4;e++)n.push(this.#s.getInt16(t,!0)),t+=2;return n}get fontMatrix(){let t=e.#n;if(this.#s.getUint8(t)===0)return;t+=1;let n=[];for(let e=0;e<6;e++)n.push(this.#s.getFloat64(t,!0)),t+=8;return n}get defaultVMetrics(){let t=e.#r;if(this.#s.getUint8(t)===0)return;t+=1;let n=[];for(let e=0;e<3;e++)n.push(this.#s.getInt16(t,!0)),t+=2;return n}#u(t){pw(t<e.strings.length,`Invalid string index`);let n=e.#i+4;for(let e=0;e<t;e++)n+=this.#s.getUint32(n)+4;let r=this.#s.getUint32(n),i=new Uint8Array(r);return i.set(new Uint8Array(this.#a,n+4,r)),this.#o.decode(i)}get fallbackName(){return this.#u(0)}get loadedName(){return this.#u(1)}get mimetype(){return this.#u(2)}get name(){return this.#u(3)}get data(){let t=e.#i;t+=4+this.#s.getUint32(t),t+=4+this.#s.getUint32(t),t+=4+this.#s.getUint32(t);let n=this.#s.getUint32(t);if(n!==0)return new Uint8Array(this.#a,t+4,n)}clearData(){let t=e.#i;t+=4+this.#s.getUint32(t),t+=4+this.#s.getUint32(t),t+=4+this.#s.getUint32(t);let n=this.#s.getUint32(t);new Uint8Array(this.#a,t+4,n).fill(0),this.#s.setUint32(t,0)}get cssFontInfo(){let t=e.#i;t+=4+this.#s.getUint32(t),t+=4+this.#s.getUint32(t);let n=this.#s.getUint32(t);if(n===0)return null;let r=new Uint8Array(n);return r.set(new Uint8Array(this.#a,t+4,n)),new lD(r.buffer)}get systemFontInfo(){let t=e.#i;t+=4+this.#s.getUint32(t);let n=this.#s.getUint32(t);if(n===0)return null;let r=new Uint8Array(n);return r.set(new Uint8Array(this.#a,t+4,n)),new uD(r.buffer)}static write(t){let n=t.systemFontInfo?uD.write(t.systemFontInfo):null,r=t.cssFontInfo?lD.write(t.cssFontInfo):null,i=new TextEncoder,a={},o=0;for(let n of e.strings)a[n]=i.encode(t[n]),o+=4+a[n].length;let s=e.#i+4+o+4+(n?n.byteLength:0)+4+(r?r.byteLength:0)+4+(t.data?t.data.length:0),c=new ArrayBuffer(s),l=new Uint8Array(c),u=new DataView(c),d=0,f=e.bools.length,p=0,m=0;for(let n=0;n<f;n++){let r=t[e.bools[n]];p|=(r===void 0?0:r?2:1)<<m,m+=2,m!==8&&n!==f-1||(u.setUint8(d++,p),p=0,m=0)}pw(d===e.#e,`FontInfo.write: Boolean properties offset mismatch`);for(let n of e.numbers)u.setFloat64(d,t[n]),d+=8;if(pw(d===e.#t,`FontInfo.write: Number properties offset mismatch`),t.bbox){u.setUint8(d++,4);for(let e of t.bbox)u.setInt16(d,e,!0),d+=2}else u.setUint8(d++,0),d+=8;if(pw(d===e.#n,`FontInfo.write: BBox properties offset mismatch`),t.fontMatrix){u.setUint8(d++,6);for(let e of t.fontMatrix)u.setFloat64(d,e,!0),d+=8}else u.setUint8(d++,0),d+=48;if(pw(d===e.#r,`FontInfo.write: FontMatrix properties offset mismatch`),t.defaultVMetrics){u.setUint8(d++,1);for(let e of t.defaultVMetrics)u.setInt16(d,e,!0),d+=2}else u.setUint8(d++,0),d+=6;pw(d===e.#i,`FontInfo.write: DefaultVMetrics properties offset mismatch`),u.setUint32(e.#i,0),d+=4;for(let t of e.strings){let e=a[t],n=e.length;u.setUint32(d,n),l.set(e,d+4),d+=4+n}if(u.setUint32(e.#i,d-e.#i-4),n){let e=n.byteLength;u.setUint32(d,e),pw(d+4+e<=c.byteLength,`FontInfo.write: Buffer overflow at systemFontInfo`),l.set(new Uint8Array(n),d+4),d+=4+e}else u.setUint32(d,0),d+=4;if(r){let e=r.byteLength;u.setUint32(d,e),pw(d+4+e<=c.byteLength,`FontInfo.write: Buffer overflow at cssFontInfo`),l.set(new Uint8Array(r),d+4),d+=4+e}else u.setUint32(d,0),d+=4;return t.data===void 0?(u.setUint32(d,0),d+=4):(u.setUint32(d,t.data.length),l.set(t.data,d+4),d+=4+t.data.length),pw(d<=c.byteLength,`FontInfo.write: Buffer overflow`),c.transferToFixedLength(d)}},fD=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}},pD=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()}},mD=Symbol(`INTERNAL`),hD=class{#e=!1;#t=!1;#n=!1;#r=!0;constructor(e,{name:t,intent:n,usage:r,rbGroups:i}){this.#e=!!(e&kC),this.#t=!!(e&AC),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!==mD&&fw("Internal method `_setVisible` called."),this.#n=n,this.#r=t}},gD=class{#e=null;#t=new Map;#n=null;#r=null;constructor(e,t=kC){if(this.renderingIntent=t,this.name=null,this.creator=null,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 hD(t,n));if(e.baseState===`OFF`)for(let e of this.#t.values())e._setVisible(mD,!1);for(let t of e.on)this.#t.get(t)._setVisible(mD,!0);for(let t of e.off)this.#t.get(t)._setVisible(mD,!1);this.#n=this.getHash()}}#i(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.#i(t);else{if(!this.#t.has(t))return dw(`Optional content group not found: ${t}`),!0;i=this.#t.get(t).visible}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 uw(`Optional content group not defined.`),!0;if(e.type===`OCG`)return this.#t.has(e.id)?this.#t.get(e.id).visible:(dw(`Optional content group not found: ${e.id}`),!0);if(e.type===`OCMD`){if(e.expression)return this.#i(e.expression);if(!e.policy||e.policy===`AnyOn`){for(let t of e.ids){if(!this.#t.has(t))return dw(`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 dw(`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 dw(`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 dw(`Optional content group not found: ${t}`),!0;if(this.#t.get(t).visible)return!1}return!0}return dw(`Unknown optional content policy ${e.policy}.`),!0}return dw(`Unknown group type ${e.type}.`),!0}setVisibility(e,t=!0,n=!0){let r=this.#t.get(e);if(r){if(n&&t&&r.rbGroups.length)for(let t of r.rbGroups)for(let n of t)n!==e&&this.#t.get(n)?._setVisible(mD,!1,!0);r._setVisible(mD,!!t,!0),this.#e=null}else dw(`Optional content group not found: ${e}`)}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 jT;for(let[t,n]of this.#t)e.update(`${t}:${n.visible}`);return this.#e=e.hexdigest()}[Symbol.iterator](){return this.#t.entries()}},_D=class{constructor(e,{disableRange:t=!1,disableStream:n=!1}){pw(e,`PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.`);let{length:r,initialData:i,progressiveDone:a,contentDispositionFilename:o}=e;if(this._queuedChunks=[],this._progressiveDone=a,this._contentDispositionFilename=o,i?.length>0){let e=i instanceof Uint8Array&&i.byteLength===i.buffer.byteLength?i.buffer:new Uint8Array(i).buffer;this._queuedChunks.push(e)}this._pdfDataRangeTransport=e,this._isStreamingSupported=!n,this._isRangeSupported=!t,this._contentLength=r,this._fullRequestReader=null,this._rangeReaders=[],e.addRangeListener((e,t)=>{this._onReceiveData({begin:e,chunk:t})}),e.addProgressListener((e,t)=>{this._onProgress({loaded:e,total:t})}),e.addProgressiveReadListener(e=>{this._onReceiveData({chunk:e})}),e.addProgressiveDoneListener(()=>{this._onProgressiveDone()}),e.transportReady()}_onReceiveData({begin:e,chunk:t}){let n=t instanceof Uint8Array&&t.byteLength===t.buffer.byteLength?t.buffer:new Uint8Array(t).buffer;e===void 0?this._fullRequestReader?this._fullRequestReader._enqueue(n):this._queuedChunks.push(n):pw(this._rangeReaders.some(function(t){return t._begin===e&&(t._enqueue(n),!0)}),"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}_onProgress(e){e.total===void 0?this._rangeReaders[0]?.onProgress?.({loaded:e.loaded}):this._fullRequestReader?.onProgress?.({loaded:e.loaded,total:e.total})}_onProgressiveDone(){this._fullRequestReader?.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(e){let t=this._rangeReaders.indexOf(e);t>=0&&this._rangeReaders.splice(t,1)}getFullReader(){pw(!this._fullRequestReader,`PDFDataTransportStream.getFullReader can only be called once.`);let e=this._queuedChunks;return this._queuedChunks=null,new vD(this,e,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(e,t){if(t<=this._progressiveDataLength)return null;let n=new yD(this,e,t);return this._pdfDataRangeTransport.requestDataRange(e,t),this._rangeReaders.push(n),n}cancelAllRequests(e){this._fullRequestReader?.cancel(e);for(let t of this._rangeReaders.slice(0))t.cancel(e);this._pdfDataRangeTransport.abort()}},vD=class{constructor(e,t,n=!1,r=null){this._stream=e,this._done=n||!1,this._filename=Uw(r)?r:null,this._queuedChunks=t||[],this._loaded=0;for(let e of this._queuedChunks)this._loaded+=e.byteLength;this._requests=[],this._headersReady=Promise.resolve(),e._fullRequestReader=this,this.onProgress=null}_enqueue(e){this._done||(this._requests.length>0?this._requests.shift().resolve({value:e,done:!1}):this._queuedChunks.push(e),this._loaded+=e.byteLength)}get headersReady(){return this._headersReady}get filename(){return this._filename}get isRangeSupported(){return this._stream._isRangeSupported}get isStreamingSupported(){return this._stream._isStreamingSupported}get contentLength(){return this._stream._contentLength}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;for(let e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0}progressiveDone(){this._done||=!0}},yD=class{constructor(e,t,n){this._stream=e,this._begin=t,this._end=n,this._queuedChunk=null,this._requests=[],this._done=!1,this.onProgress=null}_enqueue(e){if(!this._done){if(this._requests.length===0)this._queuedChunk=e;else{this._requests.shift().resolve({value:e,done:!1});for(let e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0}this._done=!0,this._stream._removeRangeReader(this)}}get isStreamingSupported(){return!1}async read(){if(this._queuedChunk){let 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;for(let e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0,this._stream._removeRangeReader(this)}};function bD(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 xD(e){return URL.parse(e)?.origin??null}function SD({responseHeaders:e,isHttp:t,rangeChunkSize:n,disableRange:r}){let i={allowRangeRequests:!1,suggestedLength:void 0},a=parseInt(e.get(`Content-Length`),10);return!Number.isInteger(a)||(i.suggestedLength=a,a<=2*n)||r||!t||e.get(`Accept-Ranges`)!==`bytes`||(e.get(`Content-Encoding`)||`identity`)!==`identity`||(i.allowRangeRequests=!0),i}function CD(e){let t=e.get(`Content-Disposition`);if(t){let e=function(e){let t=!0,n=r(`filename\\*`,`i`).exec(e);if(n){n=n[1];let e=o(n);return e=unescape(e),e=s(e),e=c(e),a(e)}if(n=function(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=o(r),n&&(r=unescape(r),e===0&&(r=s(r))),a.push(r)}return a.join(``)}(e),n)return a(c(n));if(n=r(`filename`,`i`).exec(e),n){n=n[1];let e=o(n);return e=c(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=Tw(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){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 s(e){let t=e.indexOf(`'`);return t===-1?e:i(e.slice(0,t),e.slice(t+1).replace(/^[^']*'/,``))}function c(e){return!e.startsWith(`=?`)||/[\x00-\x19\x80-\xff]/.test(e)?e:e.replaceAll(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,function(e,t,n,r){if(n===`q`||n===`Q`)return i(t,r=(r=r.replaceAll(`_`,` `)).replaceAll(/=([0-9a-fA-F]{2})/g,function(e,t){return String.fromCharCode(parseInt(t,16))}));try{r=atob(r)}catch{}return i(t,r)})}return``}(t);if(e.includes(`%`))try{e=decodeURIComponent(e)}catch{}if(Uw(e))return e}return null}function wD(e,t){return new xw(`Unexpected server response (${e}) while retrieving PDF "${t}".`,e,e===404||e===0&&t.startsWith(`file:`))}function TD(e){return e===200||e===206}function ED(e,t,n){return{method:`GET`,headers:e,signal:n.signal,mode:`cors`,credentials:t?`include`:`same-origin`,redirect:`follow`}}function DD(e){return e instanceof Uint8Array?e.buffer:e instanceof ArrayBuffer?e:(dw(`getArrayBuffer - unexpected data format: ${e}`),new Uint8Array(e).buffer)}var OD=class{_responseOrigin=null;constructor(e){this.source=e,this.isHttp=/^https?:/i.test(e.url),this.headers=bD(this.isHttp,e.httpHeaders),this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}getFullReader(){return pw(!this._fullRequestReader,`PDFFetchStream.getFullReader can only be called once.`),this._fullRequestReader=new kD(this),this._fullRequestReader}getRangeReader(e,t){if(t<=this._progressiveDataLength)return null;let n=new AD(this,e,t);return this._rangeRequestReaders.push(n),n}cancelAllRequests(e){this._fullRequestReader?.cancel(e);for(let t of this._rangeRequestReaders.slice(0))t.cancel(e)}},kD=class{constructor(e){this._stream=e,this._reader=null,this._loaded=0,this._filename=null;let t=e.source;this._withCredentials=t.withCredentials||!1,this._contentLength=t.length,this._headersCapability=Promise.withResolvers(),this._disableRange=t.disableRange||!1,this._rangeChunkSize=t.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._abortController=new AbortController,this._isStreamingSupported=!t.disableStream,this._isRangeSupported=!t.disableRange;let n=new Headers(e.headers),r=t.url;fetch(r,ED(n,this._withCredentials,this._abortController)).then(t=>{if(e._responseOrigin=xD(t.url),!TD(t.status))throw wD(t.status,r);this._reader=t.body.getReader(),this._headersCapability.resolve();let n=t.headers,{allowRangeRequests:i,suggestedLength:a}=SD({responseHeaders:n,isHttp:e.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=i,this._contentLength=a||this._contentLength,this._filename=CD(n),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new Cw(`Streaming is disabled.`))}).catch(this._headersCapability.reject),this.onProgress=null}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._headersCapability.promise;let{value:e,done:t}=await this._reader.read();return t?{value:e,done:t}:(this._loaded+=e.byteLength,this.onProgress?.({loaded:this._loaded,total:this._contentLength}),{value:DD(e),done:!1})}cancel(e){this._reader?.cancel(e),this._abortController.abort()}},AD=class{constructor(e,t,n){this._stream=e,this._reader=null,this._loaded=0;let r=e.source;this._withCredentials=r.withCredentials||!1,this._readCapability=Promise.withResolvers(),this._isStreamingSupported=!r.disableStream,this._abortController=new AbortController;let i=new Headers(e.headers);i.append(`Range`,`bytes=${t}-${n-1}`);let a=r.url;fetch(a,ED(i,this._withCredentials,this._abortController)).then(t=>{let n=xD(t.url);if(n!==e._responseOrigin)throw Error(`Expected range response-origin "${n}" to match "${e._responseOrigin}".`);if(!TD(t.status))throw wD(t.status,a);this._readCapability.resolve(),this._reader=t.body.getReader()}).catch(this._readCapability.reject),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._readCapability.promise;let{value:e,done:t}=await this._reader.read();return t?{value:e,done:t}:(this._loaded+=e.byteLength,this.onProgress?.({loaded:this._loaded}),{value:DD(e),done:!1})}cancel(e){this._reader?.cancel(e),this._abortController.abort()}},jD=class{_responseOrigin=null;constructor({url:e,httpHeaders:t,withCredentials:n}){this.url=e,this.isHttp=/^https?:/i.test(e),this.headers=bD(this.isHttp,t),this.withCredentials=n||!1,this.currXhrId=0,this.pendingRequests=Object.create(null)}request(e){let t=new XMLHttpRequest,n=this.currXhrId++,r=this.pendingRequests[n]={xhr:t};t.open(`GET`,this.url),t.withCredentials=this.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}`),r.expectedStatus=206):r.expectedStatus=200,t.responseType=`arraybuffer`,pw(e.onError,"Expected `onError` callback to be provided."),t.onerror=()=>{e.onError(t.status)},t.onreadystatechange=this.onStateChange.bind(this,n),t.onprogress=this.onProgress.bind(this,n),r.onHeadersReceived=e.onHeadersReceived,r.onDone=e.onDone,r.onError=e.onError,r.onProgress=e.onProgress,t.send(null),n}onProgress(e,t){let n=this.pendingRequests[e];n&&n.onProgress?.(t)}onStateChange(e,t){let n=this.pendingRequests[e];if(!n)return;let r=n.xhr;if(r.readyState>=2&&n.onHeadersReceived&&(n.onHeadersReceived(),delete n.onHeadersReceived),r.readyState!==4||!(e in this.pendingRequests))return;if(delete this.pendingRequests[e],r.status===0&&this.isHttp)return void n.onError(r.status);let i=r.status||200;if(!(i===200&&n.expectedStatus===206)&&i!==n.expectedStatus)return void n.onError(r.status);let a=function(e){let t=e.response;return typeof t==`string`?Tw(t).buffer:t}(r);if(i===206){let e=r.getResponseHeader(`Content-Range`),t=/bytes (\d+)-(\d+)\/(\d+)/.exec(e);t?n.onDone({begin:parseInt(t[1],10),chunk:a}):(dw(`Missing or invalid "Content-Range" header.`),n.onError(0))}else a?n.onDone({begin:0,chunk:a}):n.onError(r.status)}getRequestXhr(e){return this.pendingRequests[e].xhr}isPendingRequest(e){return e in this.pendingRequests}abortRequest(e){let t=this.pendingRequests[e].xhr;delete this.pendingRequests[e],t.abort()}},MD=class{constructor(e){this._source=e,this._manager=new jD(e),this._rangeChunkSize=e.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(e){let t=this._rangeRequestReaders.indexOf(e);t>=0&&this._rangeRequestReaders.splice(t,1)}getFullReader(){return pw(!this._fullRequestReader,`PDFNetworkStream.getFullReader can only be called once.`),this._fullRequestReader=new ND(this._manager,this._source),this._fullRequestReader}getRangeReader(e,t){let n=new PD(this._manager,e,t);return n.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(n),n}cancelAllRequests(e){this._fullRequestReader?.cancel(e);for(let t of this._rangeRequestReaders.slice(0))t.cancel(e)}},ND=class{constructor(e,t){this._manager=e,this._url=t.url,this._fullRequestId=e.request({onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)}),this._headersCapability=Promise.withResolvers(),this._disableRange=t.disableRange||!1,this._contentLength=t.length,this._rangeChunkSize=t.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._isStreamingSupported=!1,this._isRangeSupported=!1,this._cachedChunks=[],this._requests=[],this._done=!1,this._storedError=void 0,this._filename=null,this.onProgress=null}_onHeadersReceived(){let e=this._fullRequestId,t=this._manager.getRequestXhr(e);this._manager._responseOrigin=xD(t.responseURL);let n=t.getAllResponseHeaders(),r=new Headers(n?n.trimStart().replace(/[^\S ]+$/,``).split(/[\r\n]+/).map(e=>{let[t,...n]=e.split(`: `);return[t,n.join(`: `)]}):[]),{allowRangeRequests:i,suggestedLength:a}=SD({responseHeaders:r,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});i&&(this._isRangeSupported=!0),this._contentLength=a||this._contentLength,this._filename=CD(r),this._isRangeSupported&&this._manager.abortRequest(e),this._headersCapability.resolve()}_onDone(e){if(e&&(this._requests.length>0?this._requests.shift().resolve({value:e.chunk,done:!1}):this._cachedChunks.push(e.chunk)),this._done=!0,!(this._cachedChunks.length>0)){for(let e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0}}_onError(e){this._storedError=wD(e,this._url),this._headersCapability.reject(this._storedError);for(let e of this._requests)e.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0}_onProgress(e){this.onProgress?.({loaded:e.loaded,total:e.lengthComputable?e.total:this._contentLength})}get filename(){return this._filename}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}get contentLength(){return this._contentLength}get headersReady(){return this._headersCapability.promise}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);for(let e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId),this._fullRequestReader=null}},PD=class{constructor(e,t,n){this._manager=e,this._url=e.url,this._requestId=e.request({begin:t,end:n,onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)}),this._requests=[],this._queuedChunk=null,this._done=!1,this._storedError=void 0,this.onProgress=null,this.onClosed=null}_onHeadersReceived(){let e=xD(this._manager.getRequestXhr(this._requestId)?.responseURL);e!==this._manager._responseOrigin&&(this._storedError=Error(`Expected range response-origin "${e}" to match "${this._manager._responseOrigin}".`),this._onError(0))}_close(){this.onClosed?.(this)}_onDone(e){let t=e.chunk;this._requests.length>0?this._requests.shift().resolve({value:t,done:!1}):this._queuedChunk=t,this._done=!0;for(let e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0,this._close()}_onError(e){this._storedError??=wD(e,this._url);for(let e of this._requests)e.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}_onProgress(e){this.isStreamingSupported||this.onProgress?.({loaded:e.loaded})}get isStreamingSupported(){return!1}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;for(let e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId),this._close()}},FD=/^[a-z][a-z0-9\-+.]+:/i,ID=class{constructor(e){this.source=e,this.url=function(e){if(FD.test(e))return new URL(e);let t=process.getBuiltinModule(`url`);return new URL(t.pathToFileURL(e))}(e.url),pw(this.url.protocol===`file:`,`PDFNodeStream only supports file:// URLs.`),this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}getFullReader(){return pw(!this._fullRequestReader,`PDFNodeStream.getFullReader can only be called once.`),this._fullRequestReader=new LD(this),this._fullRequestReader}getRangeReader(e,t){if(t<=this._progressiveDataLength)return null;let n=new RD(this,e,t);return this._rangeRequestReaders.push(n),n}cancelAllRequests(e){this._fullRequestReader?.cancel(e);for(let t of this._rangeRequestReaders.slice(0))t.cancel(e)}},LD=class{constructor(e){this._url=e.url,this._done=!1,this._storedError=null,this.onProgress=null;let t=e.source;this._contentLength=t.length,this._loaded=0,this._filename=null,this._disableRange=t.disableRange||!1,this._rangeChunkSize=t.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._isStreamingSupported=!t.disableStream,this._isRangeSupported=!t.disableRange,this._readableStream=null,this._readCapability=Promise.withResolvers(),this._headersCapability=Promise.withResolvers();let n=process.getBuiltinModule(`fs`);n.promises.lstat(this._url).then(e=>{this._contentLength=e.size,this._setReadableStream(n.createReadStream(this._url)),this._headersCapability.resolve()},e=>{e.code===`ENOENT`&&(e=wD(0,this._url.href)),this._storedError=e,this._headersCapability.reject(e)})}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;let e=this._readableStream.read();return e===null?(this._readCapability=Promise.withResolvers(),this.read()):(this._loaded+=e.length,this.onProgress?.({loaded:this._loaded,total:this._contentLength}),{value:new Uint8Array(e).buffer,done:!1})}cancel(e){this._readableStream?this._readableStream.destroy(e):this._error(e)}_error(e){this._storedError=e,this._readCapability.resolve()}_setReadableStream(e){this._readableStream=e,e.on(`readable`,()=>{this._readCapability.resolve()}),e.on(`end`,()=>{e.destroy(),this._done=!0,this._readCapability.resolve()}),e.on(`error`,e=>{this._error(e)}),!this._isStreamingSupported&&this._isRangeSupported&&this._error(new Cw(`streaming is disabled`)),this._storedError&&this._readableStream.destroy(this._storedError)}},RD=class{constructor(e,t,n){this._url=e.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=Promise.withResolvers(),this._isStreamingSupported=!e.source.disableStream;let r=process.getBuiltinModule(`fs`);this._setReadableStream(r.createReadStream(this._url,{start:t,end:n-1}))}get isStreamingSupported(){return this._isStreamingSupported}async read(){if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;let e=this._readableStream.read();return e===null?(this._readCapability=Promise.withResolvers(),this.read()):(this._loaded+=e.length,this.onProgress?.({loaded:this._loaded}),{value:new Uint8Array(e).buffer,done:!1})}cancel(e){this._readableStream?this._readableStream.destroy(e):this._error(e)}_error(e){this._storedError=e,this._readCapability.resolve()}_setReadableStream(e){this._readableStream=e,e.on(`readable`,()=>{this._readCapability.resolve()}),e.on(`end`,()=>{e.destroy(),this._done=!0,this._readCapability.resolve()}),e.on(`error`,e=>{this._error(e)}),this._storedError&&this._readableStream.destroy(this._storedError)}},zD=Symbol(`INITIAL_DATA`),BD=class{#e=Object.create(null);#t(e){return this.#e[e]||={...Promise.withResolvers(),data:zD}}get(e,t=null){if(t){let n=this.#t(e);return n.promise.then(()=>t(n.data)),null}let n=this.#e[e];if(!n||n.data===zD)throw Error(`Requesting object that isn't resolved yet ${e}.`);return n.data}has(e){let t=this.#e[e];return!!t&&t.data!==zD}delete(e){let t=this.#e[e];return!(!t||t.data===zD)&&(delete this.#e[e],!0)}resolve(e,t=null){let n=this.#t(e);n.data=t,n.resolve()}clear(){for(let e in this.#e){let{data:t}=this.#e[e];t?.bitmap?.close()}this.#e=Object.create(null)}*[Symbol.iterator](){for(let e in this.#e){let{data:t}=this.#e[e];t!==zD&&(yield[e,t])}}},VD=class e{#e=Promise.withResolvers();#t=null;#n=!1;#r=!!globalThis.FontInspector?.enabled;#i=null;#a=null;#o=0;#s=0;#c=null;#l=null;#u=0;#d=0;#f=Object.create(null);#p=[];#m=null;#h=[];#g=new WeakMap;#_=null;static#v=new Map;static#y=new Map;static#b=new WeakMap;static#x=null;static#S=new Set;constructor({textContentSource:t,container:n,viewport:r}){if(t instanceof ReadableStream)this.#m=t;else{if(typeof t!=`object`)throw Error(`No "textContentSource" parameter specified.`);this.#m=new ReadableStream({start(e){e.enqueue(t),e.close()}})}this.#t=this.#l=n,this.#d=r.scale*nT.pixelRatio,this.#u=r.rotation,this.#a={div:null,properties:null,ctx:null};let{pageWidth:i,pageHeight:a,pageX:o,pageY:s}=r.rawDims;this.#_=[1,0,0,-1,-o,s+a],this.#s=i,this.#o=a,e.#O(),tT(n,r),this.#e.promise.finally(()=>{e.#S.delete(this),this.#a=null,this.#f=null}).catch(()=>{})}static get fontFamilyMap(){let{isWindows:e,isFirefox:t}=Ew.platform;return gw(this,`fontFamilyMap`,new Map([[`sans-serif`,(e&&t?`Calibri, `:``)+`sans-serif`],[`monospace`,(e&&t?`Lucida Console, `:``)+`monospace`]]))}render(){let t=()=>{this.#c.read().then(({value:e,done:n})=>{n?this.#e.resolve():(this.#i??=e.lang,Object.assign(this.#f,e.styles),this.#C(e.items),t())},this.#e.reject)};return this.#c=this.#m.getReader(),e.#S.add(this),t(),this.#e.promise}update({viewport:t,onBefore:n=null}){let r=t.scale*nT.pixelRatio,i=t.rotation;if(i!==this.#u&&(n?.(),this.#u=i,tT(this.#l,{rotation:i})),r!==this.#d){n?.(),this.#d=r;let t={div:null,properties:null,ctx:e.#E(this.#i)};for(let e of this.#h)t.properties=this.#g.get(e),t.div=e,this.#T(t)}}cancel(){let e=new Cw(`TextLayer task cancelled.`);this.#c?.cancel(e).catch(()=>{}),this.#c=null,this.#e.reject(e)}get textDivs(){return this.#h}get textContentItemsStr(){return this.#p}#C(t){if(this.#n)return;this.#a.ctx??=e.#E(this.#i);let n=this.#h,r=this.#p;for(let e of t){if(n.length>1e5)return dw(`Ignoring additional textDivs for performance reasons.`),void(this.#n=!0);if(e.str!==void 0)r.push(e.str),this.#w(e);else 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}`),t.append(this.#t)}else e.type===`endMarkedContent`&&(this.#t=this.#t.parentNode)}}#w(t){let n=document.createElement(`span`),r={angle:0,canvasWidth:0,hasText:t.str!==``,hasEOL:t.hasEOL,fontSize:0};this.#h.push(n);let i=Q.transform(this.#_,t.transform),a=Math.atan2(i[1],i[0]),o=this.#f[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.#k(s,o,this.#i),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=`calc(var(--total-scale-factor) *`,p=n.style;this.#t===this.#l?(p.left=`${(100*u/this.#s).toFixed(2)}%`,p.top=`${(100*d/this.#o).toFixed(2)}%`):(p.left=`${f}${u.toFixed(2)}px)`,p.top=`${f}${d.toFixed(2)}px)`),p.fontSize=`${f}${(e.#x*c).toFixed(2)}px)`,p.fontFamily=s,r.fontSize=c,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.#g.set(n,r),this.#a.div=n,this.#a.properties=r,this.#T(this.#a),r.hasText&&this.#t.append(n),r.hasEOL){let e=document.createElement(`br`);e.setAttribute(`role`,`presentation`),this.#t.append(e)}}#T(t){let{div:n,properties:r,ctx:i}=t,{style:a}=n,o=``;if(e.#x>1&&(o=`scale(${1/e.#x})`),r.canvasWidth!==0&&r.hasText){let{fontFamily:t}=a,{canvasWidth:s,fontSize:c}=r;e.#D(i,c*this.#d,t);let{width:l}=i.measureText(n.textContent);l>0&&(o=`scaleX(${s*this.#d/l}) ${o}`)}r.angle!==0&&(o=`rotate(${r.angle}deg) ${o}`),o.length>0&&(a.transform=o)}static cleanup(){if(!(this.#S.size>0)){this.#v.clear();for(let{canvas:e}of this.#y.values())e.remove();this.#y.clear()}}static#E(e=null){let t=this.#y.get(e||=``);if(!t){let n=document.createElement(`canvas`);n.className=`hiddenCanvasElement`,n.lang=e,document.body.append(n),t=n.getContext(`2d`,{alpha:!1,willReadFrequently:!0}),this.#y.set(e,t),this.#b.set(t,{size:0,family:``})}return t}static#D(e,t,n){let r=this.#b.get(e);t===r.size&&n===r.family||(e.font=`${t}px ${n}`,r.size=t,r.family=n)}static#O(){if(this.#x!==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.#x=e.getBoundingClientRect().height,e.remove()}static#k(e,t,n){let r=this.#v.get(e);if(r)return r;let i=this.#E(n);i.canvas.width=i.canvas.height=30,this.#D(i,30,e);let a=i.measureText(``),o=a.fontBoundingBoxAscent,s=Math.abs(a.fontBoundingBoxDescent);i.canvas.width=i.canvas.height=0;let c=.8;return o?c=o/(o+s):(Ew.platform.isFirefox&&dw("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.#v.set(e,c),c}};function HD(e={}){typeof e==`string`||e instanceof URL?e={url:e}:(e instanceof ArrayBuffer||ArrayBuffer.isView(e))&&(e={data:e});let t=new UD,{docId:n}=t,r=e.url?function(e){if(e instanceof URL)return e.href;if(typeof e==`string`){if(TC)return e;let t=URL.parse(e,window.location);if(t)return t.href}throw Error(`Invalid PDF url data: either string or URL-object is expected in the url property.`)}(e.url):null,i=e.data?function(e){if(TC&&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 Tw(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.`)}(e.data):null,a=e.httpHeaders||null,o=!0===e.withCredentials,s=e.password??null,c=e.range instanceof WD?e.range:null,l=Number.isInteger(e.rangeChunkSize)&&e.rangeChunkSize>0?e.rangeChunkSize:65536,u=e.worker instanceof qD?e.worker:null,d=e.verbosity,f=typeof e.docBaseUrl!=`string`||Hw(e.docBaseUrl)?null:e.docBaseUrl,p=LT(e.cMapUrl),m=!1!==e.cMapPacked,h=e.CMapReaderFactory||(TC?pE:rE),g=LT(e.iccUrl),_=LT(e.standardFontDataUrl),v=e.StandardFontDataFactory||(TC?mE:sE),y=LT(e.wasmUrl),b=e.WasmFactory||(TC?hE:lE),x=!0!==e.stopAtErrors,S=Number.isInteger(e.maxImageSize)&&e.maxImageSize>-1?e.maxImageSize:-1,C=!1!==e.isEvalSupported,w=typeof e.isOffscreenCanvasSupported==`boolean`?e.isOffscreenCanvasSupported:!TC,T=typeof e.isImageDecoderSupported==`boolean`?e.isImageDecoderSupported:!TC&&(Ew.platform.isFirefox||!globalThis.chrome),E=Number.isInteger(e.canvasMaxAreaInBytes)?e.canvasMaxAreaInBytes:-1,D=typeof e.disableFontFace==`boolean`?e.disableFontFace:TC,O=!0===e.fontExtraProperties,k=!0===e.enableXfa,ee=e.ownerDocument||globalThis.document,A=!0===e.disableRange,j=!0===e.disableStream,M=!0===e.disableAutoFetch,te=!0===e.pdfBug,ne=e.CanvasFactory||(TC?fE:tE),re=e.FilterFactory||(TC?dE:aE),ie=!0===e.enableHWA,ae=!1!==e.useWasm,oe=c?c.length:e.length??NaN,se=typeof e.useSystemFonts==`boolean`?e.useSystemFonts:!TC&&!D,ce=typeof e.useWorkerFetch==`boolean`?e.useWorkerFetch:!!(h===rE&&v===sE&&b===lE&&p&&_&&y&&qw(p,document.baseURI)&&qw(_,document.baseURI)&&qw(y,document.baseURI));cw(d);let le={canvasFactory:new ne({ownerDocument:ee,enableHWA:ie}),filterFactory:new re({docId:n,ownerDocument:ee}),cMapReaderFactory:ce?null:new h({baseUrl:p,isCompressed:m}),standardFontDataFactory:ce?null:new v({baseUrl:_}),wasmFactory:ce?null:new b({baseUrl:y})};u||(u=qD.create({verbosity:d,port:fD.workerPort}),t._worker=u);let ue={docId:n,apiVersion:`5.4.296`,data:i,password:s,disableAutoFetch:M,rangeChunkSize:l,length:oe,docBaseUrl:f,enableXfa:k,evaluatorOptions:{maxImageSize:S,disableFontFace:D,ignoreErrors:x,isEvalSupported:C,isOffscreenCanvasSupported:w,isImageDecoderSupported:T,canvasMaxAreaInBytes:E,fontExtraProperties:O,useSystemFonts:se,useWasm:ae,useWorkerFetch:ce,cMapUrl:p,iccUrl:g,standardFontDataUrl:_,wasmUrl:y}},de={ownerDocument:ee,pdfBug:te,styleElement:null,loadingParams:{disableAutoFetch:M,enableXfa:k}};return u.promise.then(function(){if(t.destroyed)throw Error(`Loading aborted`);if(u.destroyed)throw Error(`Worker was destroyed`);let e=u.messageHandler.sendWithPromise(`GetDocRequest`,ue,i?[i.buffer]:null),s;if(c)s=new _D(c,{disableRange:A,disableStream:j});else if(!i){if(!r)throw Error("getDocument - no `url` parameter provided.");s=new(qw(r)?OD:TC?ID:MD)({url:r,length:oe,httpHeaders:a,withCredentials:o,rangeChunkSize:l,disableRange:A,disableStream:j})}return e.then(e=>{if(t.destroyed)throw Error(`Loading aborted`);if(u.destroyed)throw Error(`Worker was destroyed`);let r=new $T(n,e,u.port);t._transport=new JD(r,t,s,de,le,ie),r.send(`Ready`,null)})}).catch(t._capability.reject),t}var UD=class e{static#e=0;_capability=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;try{this._worker?.port&&(this._worker._pendingDestroy=!0),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()}},WD=class{#e=Promise.withResolvers();#t=[];#n=[];#r=[];#i=[];constructor(e,t,n=!1,r=null){this.length=e,this.initialData=t,this.progressiveDone=n,this.contentDispositionFilename=r}addRangeListener(e){this.#i.push(e)}addProgressListener(e){this.#r.push(e)}addProgressiveReadListener(e){this.#n.push(e)}addProgressiveDoneListener(e){this.#t.push(e)}onDataRange(e,t){for(let n of this.#i)n(e,t)}onDataProgress(e,t){this.#e.promise.then(()=>{for(let n of this.#r)n(e,t)})}onDataProgressiveRead(e){this.#e.promise.then(()=>{for(let t of this.#n)t(e)})}onDataProgressiveDone(){this.#e.promise.then(()=>{for(let e of this.#t)e()})}transportReady(){this.#e.resolve()}requestDataRange(e,t){fw(`Abstract method PDFDataRangeTransport.requestDataRange`)}abort(){}},GD=class{constructor(e,t){this._pdfInfo=e,this._transport=t}get annotationStorage(){return this._transport.annotationStorage}get canvasFactory(){return this._transport.canvasFactory}get filterFactory(){return this._transport.filterFactory}get numPages(){return this._pdfInfo.numPages}get fingerprints(){return this._pdfInfo.fingerprints}get isPureXfa(){return gw(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()}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(){return this._transport.saveDocument()}getDownloadInfo(){return this._transport.downloadInfoCapability.promise}cleanup(e=!1){return this._transport.startCleanup(e||this.isPureXfa)}destroy(){return this.loadingTask.destroy()}cachedPageNumber(e){return this._transport.cachedPageNumber(e)}get loadingParams(){return this._transport.loadingParams}get loadingTask(){return this._transport.loadingTask}getFieldObjects(){return this._transport.getFieldObjects()}hasJSActions(){return this._transport.hasJSActions()}getCalculationOrderIds(){return this._transport.getCalculationOrderIds()}},KD=class{#e=!1;constructor(e,t,n,r=!1){this._pageIndex=e,this._pageInfo=t,this._transport=n,this._stats=r?new Kw:null,this._pdfBug=r,this.commonObjs=n.commonObjs,this.objs=new BD,this._intentStates=new Map,this.destroyed=!1,this.recordedBBoxes=null}get pageNumber(){return this._pageIndex+1}get rotate(){return this._pageInfo.rotate}get ref(){return this._pageInfo.ref}get userUnit(){return this._pageInfo.userUnit}get view(){return this._pageInfo.view}getViewport({scale:e,rotation:t=this.rotate,offsetX:n=0,offsetY:r=0,dontFlip:i=!1}={}){return new Bw({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 gw(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=IC.ENABLE,transform:a=null,background:o=null,optionalContentConfigPromise:s=null,annotationCanvasMap:c=null,pageColors:l=null,printAnnotationStorage:u=null,isEditing:d=!1,recordOperations:f=!1,operationsFilter:p=null}){this._stats?.time(`Overall`);let m=this._transport.getRenderingIntent(r,i,u,d),{renderingIntent:h,cacheKey:g}=m;this.#e=!1,s||=this._transport.getOptionalContentConfig(h);let _=this._intentStates.get(g);_||(_=Object.create(null),this._intentStates.set(g,_)),_.streamReaderCancelTimeout&&(clearTimeout(_.streamReaderCancelTimeout),_.streamReaderCancelTimeout=null);let v=!!(h&AC);_.displayReadyCapability||(_.displayReadyCapability=Promise.withResolvers(),_.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time(`Page Request`),this._pumpOperatorList(m));let y=!!(this._pdfBug&&globalThis.StepperManager?.enabled),b=!this.recordedBBoxes&&(f||y),x=e=>{if(_.renderTasks.delete(S),b){let e=S.gfx?.dependencyTracker.take();e&&(S.stepper&&S.stepper.setOperatorBBoxes(e,S.gfx.dependencyTracker.takeDebugMetadata()),f&&(this.recordedBBoxes=e))}v&&(this.#e=!0),this.#t(),e?(S.capability.reject(e),this._abortOperatorList({intentState:_,reason:e instanceof Error?e:Error(e)})):S.capability.resolve(),this._stats&&(this._stats.timeEnd(`Rendering`),this._stats.timeEnd(`Overall`),globalThis.Stats?.enabled&&globalThis.Stats.add(this.pageNumber,this._stats))},S=new XD({callback:x,params:{canvas:t,canvasContext:e,dependencyTracker:b?new CE(t,_.operatorList.length,y):null,viewport:n,transform:a,background:o},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:c,operatorList:_.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!v,pdfBug:this._pdfBug,pageColors:l,enableHWA:this._transport.enableHWA,operationsFilter:p});(_.renderTasks||=new Set).add(S);let C=S.task;return Promise.all([_.displayReadyCapability.promise,s]).then(([e,t])=>{if(this.destroyed)x();else{if(this._stats?.time(`Rendering`),!(t.renderingIntent&h))throw Error("Must use the same `intent`-argument when calling the `PDFPageProxy.render` and `PDFDocumentProxy.getOptionalContentConfig` methods.");S.initializeGraphics({transparency:e,optionalContentConfig:t}),S.operatorListChanged()}}).catch(x),C}getOperatorList({intent:e=`display`,annotationMode:t=IC.ENABLE,printAnnotationStorage:n=null,isEditing:r=!1}={}){let i=this._transport.getRenderingIntent(e,t,n,r,!0),a,o=this._intentStates.get(i.cacheKey);return o||(o=Object.create(null),this._intentStates.set(i.cacheKey,o)),o.opListReadCapability||(a=Object.create(null),a.operatorListChanged=function(){o.operatorList.lastChunk&&(o.opListReadCapability.resolve(o.operatorList),o.renderTasks.delete(a))},o.opListReadCapability=Promise.withResolvers(),(o.renderTasks||=new Set).add(a),o.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time(`Page Request`),this._pumpOperatorList(i)),o.opListReadCapability.promise}streamTextContent({includeMarkedContent:e=!1,disableNormalization:t=!1}={}){return this._transport.messageHandler.sendWithStream(`GetTextContent`,{pageIndex:this._pageIndex,includeMarkedContent:!0===e,disableNormalization:!0===t},{highWaterMark:100,size:e=>e.items.length})}getTextContent(e={}){if(this._transport._htmlForXfa)return this.getXfa().then(e=>Fw.textContent(e));let t=this.streamTextContent(e);return new Promise(function(e,n){let r=t.getReader(),i={items:[],styles:Object.create(null),lang:null};(function t(){r.read().then(function({value:n,done:r}){r?e(i):(i.lang??=n.lang,Object.assign(i.styles,n.styles),i.items.push(...n.items),t())},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.#t();return e&&t&&(this._stats&&=new Kw),t}#t(){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.#t()}_pumpOperatorList({renderingIntent:e,cacheKey:t,annotationStorageSerializable:n,modifiedIds:r}){let{map:i,transfer:a}=n,o=this._transport.messageHandler.sendWithStream(`GetOperatorList`,{pageIndex:this._pageIndex,intent:e,cacheKey:t,annotationStorage:i,modifiedIds:r},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.#t()}if(s.displayReadyCapability)s.displayReadyCapability.reject(e);else{if(!s.opListReadCapability)throw e;s.opListReadCapability.reject(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 Vw){let n=100;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 Cw(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}},qD=class t{#e=Promise.withResolvers();#t=null;#n=null;#r=null;static#i=0;static#a=!0;static#o=new WeakMap;static{TC&&(this.#a=!0,fD.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`}))},this.fromPort=e=>{var t;if(t="`PDFWorker.fromPort` - please use `PDFWorker.create` instead.",console.log(`Deprecated API usage: `+t),!e?.port)throw Error(`PDFWorker.fromPort - invalid method signature.`);return this.create(e)}}constructor({name:e=null,port:n=null,verbosity:r=lw()}={}){if(this.name=e,this.destroyed=!1,this.verbosity=r,n){if(t.#o.has(n))throw Error(`Cannot use more than one PDFWorker per port.`);t.#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 $T(`main`,`worker`,e),this.#t.on(`ready`,()=>{}),this.#s()}#l(){if(t.#a||t.#d)return void this.#u();let{workerSrc:e}=t;try{t._isSameOrigin(window.location,e)||(e=t._createCDNWrapper(new URL(e,window.location).href));let n=new Worker(e,{type:`module`}),r=new $T(`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(`test`,e=>{a.abort(),!this.destroyed&&e?(this.#t=r,this.#n=n,this.#r=n,this.#s()):i()}),r.on(`ready`,e=>{if(a.abort(),this.destroyed)i();else try{o()}catch{this.#u()}});let o=()=>{let e=new Uint8Array;r.send(`test`,e,[e.buffer])};o();return}catch{uw(`The worker has been disabled.`)}this.#u()}#u(){t.#a||=(dw(`Setting up fake worker.`),!0),t._setupFakeWorkerGlobal.then(e=>{if(this.destroyed)return void this.#e.reject(Error(`Worker was destroyed`));let n=new BT;this.#n=n;let r=`fake`+ t.#i++,i=new $T(r+`_worker`,r,n);e.setup(i,n),this.#t=new $T(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,t.#o.delete(this.#n),this.#n=null,this.#t?.destroy(),this.#t=null}static create(e){let n=this.#o.get(e?.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 t(e)}static get workerSrc(){if(fD.workerSrc)return fD.workerSrc;throw Error(`No "GlobalWorkerOptions.workerSrc" specified.`)}static get#d(){try{return globalThis.pdfjsWorker?.WorkerMessageHandler||null}catch{return null}}static get _setupFakeWorkerGlobal(){return gw(this,`_setupFakeWorkerGlobal`,(async()=>this.#d?this.#d:(await e(async()=>{let{WorkerMessageHandler:e}=await import(this.workerSrc);return{WorkerMessageHandler:e}},[])).WorkerMessageHandler)())}},JD=class{#e=new Map;#t=new Map;#n=new Map;#r=new Map;#i=null;constructor(e,t,n,r,i,a){this.messageHandler=e,this.loadingTask=t,this.commonObjs=new BD,this.fontLoader=new FT({ownerDocument:r.ownerDocument,styleElement:r.styleElement}),this.loadingParams=r.loadingParams,this._params=r,this.canvasFactory=i.canvasFactory,this.filterFactory=i.filterFactory,this.cMapReaderFactory=i.cMapReaderFactory,this.standardFontDataFactory=i.standardFontDataFactory,this.wasmFactory=i.wasmFactory,this.destroyed=!1,this.destroyCapability=null,this._networkStream=n,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=Promise.withResolvers(),this.enableHWA=a,this.setupMessageHandler()}#a(e,t=null){let n=this.#e.get(e);if(n)return n;let r=this.messageHandler.sendWithPromise(e,t);return this.#e.set(e,r),r}get annotationStorage(){return gw(this,`annotationStorage`,new NT)}getRenderingIntent(e,t=IC.ENABLE,n=null,r=!1,i=!1){let a=kC,o=MT;switch(e){case`any`:a=OC;break;case`display`:break;case`print`:a=AC;break;default:dw(`getRenderingIntent - invalid intent: ${e}`)}let s=a&AC&&n instanceof PT?n:this.annotationStorage;switch(t){case IC.DISABLE:a+=NC;break;case IC.ENABLE:break;case IC.ENABLE_FORMS:a+=jC;break;case IC.ENABLE_STORAGE:a+=MC,o=s.serializable;break;default:dw(`getRenderingIntent - invalid annotationMode: ${t}`)}r&&(a+=PC),i&&(a+=FC);let{ids:c,hash:l}=s.modifiedIds;return{renderingIntent:a,cacheKey:[a,o.hash,l].join(`_`),annotationStorageSerializable:o,modifiedIds:c}}destroy(){if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=Promise.withResolvers(),this.#i?.reject(Error(`Worker was destroyed during onPassword callback`));let e=[];for(let t of this.#t.values())e.push(t._destroy());this.#t.clear(),this.#n.clear(),this.#r.clear(),this.hasOwnProperty(`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.#e.clear(),this.filterFactory.destroy(),VD.cleanup(),this._networkStream?.cancelAllRequests(new Cw(`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)=>{pw(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=e=>{this._lastProgress={loaded:e.loaded,total:e.total}},t.onPull=()=>{this._fullReader.read().then(function({value:e,done:n}){n?t.close():(pw(e instanceof ArrayBuffer,`GetReader - expected an ArrayBuffer.`),t.enqueue(new Uint8Array(e),1,[e]))}).catch(e=>{t.error(e)})},t.onCancel=e=>{this._fullReader.cancel(e),t.ready.catch(e=>{if(!this.destroyed)throw e})}}),e.on(`ReaderHeadersReady`,async e=>{await this._fullReader.headersReady;let{isStreamingSupported:n,isRangeSupported:r,contentLength:i}=this._fullReader;return n&&r||(this._lastProgress&&t.onProgress?.(this._lastProgress),this._fullReader.onProgress=e=>{t.onProgress?.({loaded:e.loaded,total:e.total})}),{isStreamingSupported:n,isRangeSupported:r,contentLength:i}}),e.on(`GetRangeReader`,(e,t)=>{pw(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");let n=this._networkStream.getRangeReader(e.begin,e.end);n?(t.onPull=()=>{n.read().then(function({value:e,done:n}){n?t.close():(pw(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._numPages=e.numPages,this._htmlForXfa=e.htmlForXfa,delete e.htmlForXfa,t._capability.resolve(new GD(e,this))}),e.on(`DocException`,e=>{t._capability.reject(QT(e))}),e.on(`PasswordRequest`,e=>{this.#i=Promise.withResolvers();try{if(!t.onPassword)throw QT(e);t.onPassword(e=>{e instanceof Error?this.#i.reject(e):this.#i.resolve({password:e})},e.code)}catch(e){this.#i.reject(e)}return this.#i.promise}),e.on(`DataLoaded`,e=>{t.onProgress?.({loaded:e.length,total:e.length}),this.downloadInfoCapability.resolve(e)}),e.on(`StartRenderPage`,e=>{this.destroyed||this.#t.get(e.pageIndex)._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;dw(`Error during font loading: ${e}`),this.commonObjs.resolve(t,e);break}let i=new IT(new dD(r),this._params.pdfBug&&globalThis.FontInspector?.enabled?(e,t)=>globalThis.FontInspector.fontAdded(e,t):null,r.extra,r.charProcOperatorList);this.fontLoader.bind(i).catch(()=>e.sendWithPromise(`FontFallback`,{id:t})).finally(()=>{!i.fontExtraProperties&&i.data&&i.clearData(),this.commonObjs.resolve(t,i)});break;case`CopyLocalImage`:let{imageRef:a}=r;pw(a,`The imageRef must be defined.`);for(let e of this.#t.values())for(let[,n]of e.objs)if(n?.ref===a)return n.dataLen?(this.commonObjs.resolve(t,structuredClone(n)),n.dataLen):null;break;case`FontPath`:case`Image`:case`Pattern`:this.commonObjs.resolve(t,r);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.#t.get(t);if(!i.objs.has(e))if(i._intentStates.size!==0)switch(n){case`Image`:case`Pattern`:i.objs.resolve(e,r);break;default:throw Error(`Got unknown object type ${n}`)}else r?.bitmap?.close()}),e.on(`DocProgress`,e=>{this.destroyed||t.onProgress?.({loaded:e.loaded,total:e.total})}),e.on(`FetchBinaryData`,async e=>{if(this.destroyed)throw Error(`Worker was destroyed.`);let t=this[e.type];if(!t)throw Error(`${e.type} not initialized, see the \`useWorkerFetch\` parameter.`);return t.fetch(e)})}getData(){return this.messageHandler.sendWithPromise(`GetData`,null)}saveDocument(){this.annotationStorage.size<=0&&dw("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");let{map:e,transfer:t}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise(`SaveDocument`,{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:e,filename:this._fullReader?.filename??null},t).finally(()=>{this.annotationStorage.resetModified()})}getPage(e){if(!Number.isInteger(e)||e<=0||e>this._numPages)return Promise.reject(Error(`Invalid page request.`));let t=e-1,n=this.#n.get(t);if(n)return n;let r=this.messageHandler.sendWithPromise(`GetPage`,{pageIndex:t}).then(n=>{if(this.destroyed)throw Error(`Transport destroyed`);n.refStr&&this.#r.set(n.refStr,e);let r=new KD(t,n,this,this._params.pdfBug);return this.#t.set(t,r),r});return this.#n.set(t,r),r}getPageIndex(e){return RT(e)?this.messageHandler.sendWithPromise(`GetPageIndex`,{num:e.num,gen:e.gen}):Promise.reject(Error(`Invalid pageIndex request.`))}getAnnotations(e,t){return this.messageHandler.sendWithPromise(`GetAnnotations`,{pageIndex:e,intent:t})}getFieldObjects(){return this.#a(`GetFieldObjects`)}hasJSActions(){return this.#a(`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)}getAnnotationsByType(e,t){return this.messageHandler.sendWithPromise(`GetAnnotationsByType`,{types:e,pageIndexesToSkip:t})}getDocJSActions(){return this.#a(`GetDocJSActions`)}getPageJSActions(e){return this.messageHandler.sendWithPromise(`GetPageJSActions`,{pageIndex:e})}getStructTree(e){return this.messageHandler.sendWithPromise(`GetStructTree`,{pageIndex:e})}getOutline(){return this.messageHandler.sendWithPromise(`GetOutline`,null)}getOptionalContentConfig(e){return this.#a(`GetOptionalContentConfig`).then(t=>new gD(t,e))}getPermissions(){return this.messageHandler.sendWithPromise(`GetPermissions`,null)}getMetadata(){let e=`GetMetadata`,t=this.#e.get(e);if(t)return t;let n=this.messageHandler.sendWithPromise(e,null).then(e=>({info:e[0],metadata:e[1]?new pD(e[1]):null,contentDispositionFilename:this._fullReader?.filename??null,contentLength:this._fullReader?.contentLength??null}));return this.#e.set(e,n),n}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.#t.values())if(!e.cleanup())throw Error(`startCleanup: Page ${e.pageNumber} is currently rendering.`);this.commonObjs.clear(),e||this.fontLoader.clear(),this.#e.clear(),this.filterFactory.destroy(!0),VD.cleanup()}}cachedPageNumber(e){if(!RT(e))return null;let t=e.gen===0?`${e.num}R`:`${e.num}R${e.gen}`;return this.#r.get(t)??null}},YD=class{#e=null;onContinue=null;onError=null;constructor(e){this.#e=e}get promise(){return this.#e.capability.promise}cancel(e=0){this.#e.cancel(null,e)}get separateAnnots(){let{separateAnnots:e}=this.#e.operatorList;if(!e)return!1;let{annotationCanvasMap:t}=this.#e;return e.form||e.canvas&&t?.size>0}},XD=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=!0===l&&typeof window<`u`,this.cancelled=!1,this.capability=Promise.withResolvers(),this.task=new YD(this),this._cancelBound=this.cancel.bind(this),this._continueBound=this._continue.bind(this),this._scheduleNextBound=this._scheduleNext.bind(this),this._nextBound=this._next.bind(this),this._canvas=t.canvas,this._canvasContext=t.canvas?null:t.canvasContext,this._enableHWA=f,this._dependencyTracker=t.dependencyTracker,this._operationsFilter=p}get completed(){return this.capability.promise.catch(function(){})}initializeGraphics({transparency: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}=this.params;this.gfx=new cD(this._canvasContext||this._canvas.getContext(`2d`,{alpha:!1,willReadFrequently:!this._enableHWA}),this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:n},this.annotationCanvasMap,this.pageColors,o),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 Vw(`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())))}},ZD=`5.4.296`,QD=`f56dc8601`,$D=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 gw(this,`_keyboardManager`,new bT([[[`Escape`,`mac+Escape`],e.prototype._hideDropdownFromKeyboard],[[` `,`mac+ `],e.prototype._colorSelectFromKeyboard],[[`ArrowDown`,`ArrowRight`,`mac+ArrowDown`,`mac+ArrowRight`],e.prototype._moveToNext],[[`ArrowUp`,`ArrowLeft`,`mac+ArrowUp`,`mac+ArrowLeft`],e.prototype._moveToPrevious],[[`Home`,`mac+Home`],e.prototype._moveToBeginning],[[`End`,`mac+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`,Jw,{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:zC.HIGHLIGHT_COLOR,value:e}),this.updateColor(e)}_colorSelectFromKeyboard(e){if(e.target===this.#e)return void this.#m(e);let t=e.target.getAttribute(`data-color`);t&&this.#f(t,e)}_moveToNext(e){this.#g?e.target===this.#e?this.#r.firstChild?.focus():e.target.nextSibling?.focus():this.#m(e)}_moveToPrevious(e){e.target!==this.#r?.firstChild&&e.target!==this.#e?(this.#g||this.#m(e),e.target.previousSibling?.focus()):this.#g&&this._hideDropdownFromKeyboard()}_moveToBeginning(e){this.#g?this.#r.firstChild?.focus():this.#m(e)}_moveToEnd(e){this.#g?this.#r.lastChild?.focus():this.#m(e)}#p(t){e._keyboardManager.exec(this,t)}#m(e){if(this.#g)return void this.hideDropdown();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)return void this.#r.classList.remove(`hidden`);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())}updateColor(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}},eO=class e{#e=null;#t=null;#n=null;static#r=null;constructor(t){this.#t=t,this.#n=t._uiManager,e.#r||=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,colorValue:r}=this.#t,i=this.#e=document.createElement(`input`);return i.type=`color`,i.value=r||`#000000`,i.className=`basicColorPicker`,i.tabIndex=0,i.setAttribute(`data-l10n-id`,e.#r[t]),i.addEventListener(`input`,()=>{this.#n.updateParams(n,i.value)},{signal:this.#n._signal}),i}update(e){this.#e&&(this.#e.value=e)}destroy(){this.#e?.remove(),this.#e=null}hideDropdown(){}};function tO(e){return Math.floor(255*Math.max(0,Math.min(1,e))).toString(16).padStart(2,`0`)}function nO(e){return Math.max(0,Math.min(255,255*e))}var rO=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=nO(e),e,e]}static G_HTML([e]){let t=tO(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(nO)}static RGB_HTML(e){return`#${e.map(tO).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[nO(1-Math.min(1,e+r)),nO(1-Math.min(1,n+r)),nO(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)]}},iO=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){fw("Abstract method `_createSVG` called.")}},aO=class extends iO{_createSVG(e){return document.createElementNS(Lw,e)}},oO=new WeakSet,sO=60*new Date().getTimezoneOffset()*1e3,cO=class{static create(e){switch(e.data.annotationType){case JC.LINK:return new dO(e);case JC.TEXT:return new fO(e);case JC.WIDGET:switch(e.data.fieldType){case`Tx`:return new mO(e);case`Btn`:return e.data.radioButton?new _O(e):e.data.checkBox?new gO(e):new vO(e);case`Ch`:return new yO(e);case`Sig`:return new hO(e)}return new pO(e);case JC.POPUP:return new bO(e);case JC.FREETEXT:return new SO(e);case JC.LINE:return new CO(e);case JC.SQUARE:return new wO(e);case JC.CIRCLE:return new TO(e);case JC.POLYLINE:return new EO(e);case JC.CARET:return new OO(e);case JC.INK:return new kO(e);case JC.POLYGON:return new DO(e);case JC.HIGHLIGHT:return new AO(e);case JC.UNDERLINE:return new jO(e);case JC.SQUIGGLY:return new MO(e);case JC.STRIKEOUT:return new NO(e);case JC.STAMP:return new PO(e);case JC.FILEATTACHMENT:return new FO(e);default:return new lO(e)}}},lO=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,t&&(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(`${LC}${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(`${LC}${t.id}`,{id:t.id,annotationType:t.annotationType,pageIndex:this.parent.page._pageIndex,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 pO||this instanceof dO||(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 bO){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))`:this instanceof _O&&(a.borderRadius=`calc(${o}px * var(--total-scale-factor)) / calc(${s}px * var(--total-scale-factor))`),t.borderStyle.style){case YC:a.borderStyle=`solid`;break;case XC:a.borderStyle=`dashed`;break;case ZC:dw(`Unimplemented border style: beveled`);break;case QC:dw(`Unimplemented border style: inset`);break;case $C:a.borderBottomStyle=`solid`}let r=t.borderColor||null;r?(this.#t=!0,a.borderColor=Q.makeHexColor(0|r[0],0|r[1],0|r[2])):a.borderWidth=0}let c=Q.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]=rO[`${i}_HTML`](a),this.annotationStorage.setValue(this.data.id,{[t]:rO[`${i}_rgb`](a)})};return gw(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(e=>Math.fround(e));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="http://www.w3.org/2000/svg"`,` 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);let i=this.#n=new bO({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]});this.parent._commentManager||this.parent.div.append(i.render())}get hasPopupElement(){return!!(this.#n||this.popup||this.data.popupRef)}get extraPopupElement(){return this.#n}render(){fw("Abstract method `AnnotationElement.render` called")}_getElementsByName(e,t=null){let n=[];if(this._fieldObjects){let r=this._fieldObjects[e];if(r)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||oO.has(o)?n.push({id:i,exportValue:r,domElement:o}):dw(`_getElementsByName - element not allowed: ${i}`)}return n}for(let r of document.getElementsByName(e)){let{exportValue:e}=r,i=r.getAttribute(`data-element-id`);i!==t&&oO.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})})}get width(){return this.data.rect[2]-this.data.rect[0]}get height(){return this.data.rect[3]-this.data.rect[1]}},uO=class extends lO{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),this.extraPopupElement.popup.renderCommentButton())}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.container.remove(),this.container=null,this.removePopup()}},dO=class extends lO{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.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.Action||e.actions[`Mouse Up`]||e.actions[`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.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=null){e.href=this.linkService.getAnchorUrl(``),t.description?e.title=t.description:n&&(e.title=n),e.onclick=()=>(this.downloadManager?.openOrDownloadData(t.content,t.filename,r),!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,t){e.href=this.linkService.getAnchorUrl(``);let n=new Map([[`Action`,`onclick`],[`Mouse Up`,`onmouseup`],[`Mouse Down`,`onmousedown`]]);for(let r of Object.keys(t.actions)){let i=n.get(r);i&&(e[i]=()=>(this.linkService.eventBus?.dispatch(`dispatcheventinsandbox`,{source:this,detail:{id:t.id,name:r}}),!1))}t.overlaidText&&(e.title=t.overlaidText),e.onclick||=()=>!1,this.#e()}_bindResetFormAction(e,t){let n=e.onclick;if(n||(e.href=this.linkService.getAnchorUrl(``)),this.#e(),!this._fieldObjects)return dw('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),void(n||(e.onclick=()=>!1));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[n]||[];for(let{id:n}of e)t.add(n)}for(let e of Object.values(this._fieldObjects))for(let n of e)t.has(n.id)===i&&a.push(n)}else for(let e of Object.values(this._fieldObjects))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&&(oO.has(n)?n.dispatchEvent(new Event(`resetform`)):dw(`_bindResetFormAction - element not allowed: ${t}`))}return this.enableScripting&&this.linkService.eventBus?.dispatch(`dispatcheventinsandbox`,{source:this,detail:{id:`app`,ids:s,name:`ResetForm`}}),!1}}},fO=class extends lO{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._createPopup(),this.container.append(e),this.container}},pO=class extends lO{render(){return this.container}showElementAndHideCanvas(e){this.data.hasOwnCanvas&&(e.previousSibling?.nodeName===`CANVAS`&&(e.previousSibling.hidden=!0),e.hidden=!1)}_getKeyModifier(e){return Ew.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){for(let[i,a]of n)(a===`Action`||this.data.actions?.[a])&&(a!==`Focus`&&a!==`Blur`||(t||={focused:!1}),this._setEventListener(e,t,i,a,r),a!==`Focus`||this.data.actions?.Blur?a!==`Blur`||this.data.actions?.Focus||this._setEventListener(e,t,`focus`,`Focus`,null):this._setEventListener(e,t,`blur`,`Blur`,null))}_setBackgroundColor(e){let t=this.data.backgroundColor||null;e.style.backgroundColor=t===null?`transparent`:Q.makeHexColor(t[0],t[1],t[2])}_setTextStyle(e){let t=[`left`,`center`,`right`],{fontColor:n}=this.data.defaultAppearanceData,r=this.data.defaultAppearanceData.fontSize||9,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/(DC*r))||1);a=Math.min(r,o(t/DC))}else{let e=Math.abs(this.data.rect[3]-this.data.rect[1]-2);a=Math.min(r,o(e/DC))}i.fontSize=`calc(${a}px * var(--total-scale-factor))`,i.color=Q.makeHexColor(n[0],n[1],n[2]),this.data.textAlignment!==null&&(i.textAlign=t[this.data.textAlignment])}_setRequired(e,t){t?e.setAttribute(`required`,!0):e.removeAttribute(`required`),e.setAttribute(`aria-required`,t)}},mO=class extends pO{constructor(e){super(e,{isRenderable:e.renderForms||e.data.hasOwnCanvas||!e.data.hasAppearance&&!!e.data.fieldValue})}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(`
44
+ `)}(t,h,m,f,p));let _=e.length+Math.sumPrecise(p.map(e=>e.length)),v=new Uint8Array(_);v.set(e);let y=e.length;for(let e of p)y=hC(e,y,v);return v}var bC=class{constructor(e){this._msgHandler=e,this._contentLength=null,this._fullRequestReader=null,this._rangeRequestReaders=[]}getFullReader(){return _n(!this._fullRequestReader,`PDFWorkerStream.getFullReader can only be called once.`),this._fullRequestReader=new xC(this._msgHandler),this._fullRequestReader}getRangeReader(e,t){let n=new SC(e,t,this._msgHandler);return this._rangeRequestReaders.push(n),n}cancelAllRequests(e){this._fullRequestReader?.cancel(e);for(let t of this._rangeRequestReaders.slice(0))t.cancel(e)}},xC=class{constructor(e){this._msgHandler=e,this.onProgress=null,this._contentLength=null,this._isRangeSupported=!1,this._isStreamingSupported=!1;let t=this._msgHandler.sendWithStream(`GetReader`);this._reader=t.getReader(),this._headersReady=this._msgHandler.sendWithPromise(`ReaderHeadersReady`).then(e=>{this._isStreamingSupported=e.isStreamingSupported,this._isRangeSupported=e.isRangeSupported,this._contentLength=e.contentLength})}get headersReady(){return this._headersReady}get contentLength(){return this._contentLength}get isStreamingSupported(){return this._isStreamingSupported}get isRangeSupported(){return this._isRangeSupported}async read(){let{value:e,done:t}=await this._reader.read();return t?{value:void 0,done:!0}:{value:e.buffer,done:!1}}cancel(e){this._reader.cancel(e)}},SC=class{constructor(e,t,n){this._msgHandler=n,this.onProgress=null;let r=this._msgHandler.sendWithStream(`GetRangeReader`,{begin:e,end:t});this._reader=r.getReader()}get isStreamingSupported(){return!1}async read(){let{value:e,done:t}=await this._reader.read();return t?{value:void 0,done:!0}:{value:e.buffer,done:!1}}cancel(e){this._reader.cancel(e)}},CC=class{constructor(e){this.name=e,this.terminated=!1,this._capability=Promise.withResolvers()}get finished(){return this._capability.promise}finish(){this._capability.resolve()}terminate(){this.terminated=!0}ensureNotTerminated(){if(this.terminated)throw Error(`Worker task was terminated`)}},wC=class{static{typeof window>`u`&&!t&&typeof self<`u`&&typeof self.postMessage==`function`&&`onmessage`in self&&this.initializeFromPort(self)}static setup(e,t){let n=!1;e.on(`test`,t=>{n||(n=!0,e.send(`test`,t instanceof Uint8Array))}),e.on(`configure`,e=>{var t=e.verbosity;Number.isInteger(t)&&(mn=t)}),e.on(`GetDocRequest`,e=>this.createDocumentHandler(e,t))}static createDocumentHandler(e,t){let n,r=!1,i=null,a=new Set,o=mn,{docId:s,apiVersion:c}=e,l=`5.4.296`;if(c!==l)throw Error(`The API version "${c}" does not match the Worker version "${l}".`);let u=(e,t)=>`The \`${e}.prototype\` contains unexpected enumerable property "${t}", thus breaking e.g. \`for...in\` iteration of ${e}s.`;for(let e in{})throw Error(u(`Object`,e));for(let e in[])throw Error(u(`Array`,e));let d=s+`_worker`,f=new cC(d,s,t);function p(){if(r)throw Error(`Worker was terminated`)}function m(e){a.add(e)}function h(e){e.finish(),a.delete(e)}async function g(e){await n.ensureDoc(`checkHeader`),await n.ensureDoc(`parseStartXRef`),await n.ensureDoc(`parse`,[e]),await n.ensureDoc(`checkFirstPage`,[e]),await n.ensureDoc(`checkLastPage`,[e]);let t=await n.ensureDoc(`isPureXfa`);if(t){let e=new CC(`loadXfaResources`);m(e),await n.ensureDoc(`loadXfaResources`,[f,e]),h(e)}let[r,i]=await Promise.all([n.ensureDoc(`numPages`),n.ensureDoc(`fingerprints`)]);return{numPages:r,fingerprints:i,htmlForXfa:t?await n.ensureDoc(`htmlForXfa`):null}}function _(e){function t(e){p(),f.send(`GetDoc`,{pdfInfo:e})}function a(e){if(p(),e instanceof bn){let t=new CC(`PasswordException: response ${e.code}`);m(t),f.sendWithPromise(`PasswordRequest`,e).then(function({password:e}){h(t),n.updatePassword(e),o()}).catch(function(){h(t),f.send(`DocException`,e)})}else f.send(`DocException`,sC(e))}function o(){p(),g(!1).then(t,function(e){p(),e instanceof dr?n.requestLoadedStream().then(function(){p(),g(!0).then(t,a)}):a(e)})}p(),async function({data:e,password:t,disableAutoFetch:n,rangeChunkSize:r,length:a,docBaseUrl:o,enableXfa:c,evaluatorOptions:l}){let u={source:null,disableAutoFetch:n,docBaseUrl:o,docId:s,enableXfa:c,evaluatorOptions:l,handler:f,length:a,password:t,rangeChunkSize:r};if(e)return u.source=e,new JS(u);let d=new bC(f),m=d.getFullReader(),h=Promise.withResolvers(),g,_=[],v=0;return m.headersReady.then(function(){if(m.isRangeSupported){u.source=d,u.length=m.contentLength,u.disableAutoFetch||=m.isStreamingSupported,g=new YS(u);for(let e of _)g.sendProgressiveData(e);_=[],h.resolve(g),i=null}}).catch(function(e){h.reject(e),i=null}),new Promise(function(e,t){let n=function({value:e,done:r}){try{if(p(),r){if(!g){let e=fr(_);_=[],a&&e.length!==a&&N(`reported HTTP length is different from actual`),u.source=e,g=new JS(u),h.resolve(g)}i=null;return}v+=e.byteLength,m.isStreamingSupported||f.send(`DocProgress`,{loaded:v,total:Math.max(v,m.contentLength||0)}),g?g.sendProgressiveData(e):_.push(e),m.read().then(n,t)}catch(e){t(e)}};m.read().then(n,t)}).catch(function(e){h.reject(e),i=null}),i=e=>{d.cancelAllRequests(e)},h.promise}(e).then(function(e){if(r)throw e.terminate(new wn(`Worker was terminated.`)),Error(`Worker was terminated`);n=e,n.requestLoadedStream(!0).then(e=>{f.send(`DataLoaded`,{length:e.bytes.byteLength})})}).then(o,a)}return f.on(`GetPage`,function(e){return n.getPage(e.pageIndex).then(function(e){return Promise.all([n.ensure(e,`rotate`),n.ensure(e,`ref`),n.ensure(e,`userUnit`),n.ensure(e,`view`)]).then(function([e,t,n,r]){return{rotate:e,ref:t,refStr:t?.toString()??null,userUnit:n,view:r}})})}),f.on(`GetPageIndex`,function(e){let t=R.get(e.num,e.gen);return n.ensureCatalog(`getPageIndex`,[t])}),f.on(`GetDestinations`,function(e){return n.ensureCatalog(`destinations`)}),f.on(`GetDestination`,function(e){return n.ensureCatalog(`getDestination`,[e.id])}),f.on(`GetPageLabels`,function(e){return n.ensureCatalog(`pageLabels`)}),f.on(`GetPageLayout`,function(e){return n.ensureCatalog(`pageLayout`)}),f.on(`GetPageMode`,function(e){return n.ensureCatalog(`pageMode`)}),f.on(`GetViewerPreferences`,function(e){return n.ensureCatalog(`viewerPreferences`)}),f.on(`GetOpenAction`,function(e){return n.ensureCatalog(`openAction`)}),f.on(`GetAttachments`,function(e){return n.ensureCatalog(`attachments`)}),f.on(`GetDocJSActions`,function(e){return n.ensureCatalog(`jsActions`)}),f.on(`GetPageJSActions`,function({pageIndex:e}){return n.getPage(e).then(e=>n.ensure(e,`jsActions`))}),f.on(`GetAnnotationsByType`,async function({types:e,pageIndexesToSkip:t}){let[r,i]=await Promise.all([n.ensureDoc(`numPages`),n.ensureDoc(`annotationGlobals`)]);if(!i)return null;let a=[],o=[],s=null;try{for(let c=0,l=r;c<l;c++)t?.has(c)||(s||(s=new CC(`GetAnnotationsByType`),m(s)),a.push(n.getPage(c).then(async t=>t&&t.collectAnnotationsByType(f,s,e,o,i)||[])));return await Promise.all(a),(await Promise.all(o)).filter(e=>!!e)}finally{s&&h(s)}}),f.on(`GetOutline`,function(e){return n.ensureCatalog(`documentOutline`)}),f.on(`GetOptionalContentConfig`,function(e){return n.ensureCatalog(`optionalContentConfig`)}),f.on(`GetPermissions`,function(e){return n.ensureCatalog(`permissions`)}),f.on(`GetMetadata`,function(e){return Promise.all([n.ensureDoc(`documentInfo`),n.ensureCatalog(`metadata`)])}),f.on(`GetMarkInfo`,function(e){return n.ensureCatalog(`markInfo`)}),f.on(`GetData`,function(e){return n.requestLoadedStream().then(e=>e.bytes)}),f.on(`GetAnnotations`,function({pageIndex:e,intent:t}){return n.getPage(e).then(function(n){let r=new CC(`GetAnnotations: page ${e}`);return m(r),n.getAnnotationsData(f,r,t).then(e=>(h(r),e),e=>{throw h(r),e})})}),f.on(`GetFieldObjects`,function(e){return n.ensureDoc(`fieldObjects`).then(e=>e?.allFields||null)}),f.on(`HasJSActions`,function(e){return n.ensureDoc(`hasJSActions`)}),f.on(`GetCalculationOrderIds`,function(e){return n.ensureDoc(`calculationOrderIds`)}),f.on(`SaveDocument`,async function({isPureXfa:e,numPages:t,annotationStorage:r,filename:i}){let a=[n.requestLoadedStream(),n.ensureCatalog(`acroForm`),n.ensureCatalog(`acroFormRef`),n.ensureDoc(`startXRef`),n.ensureDoc(`xref`),n.ensureCatalog(`structTreeRoot`)],o=new Xn,s=[],c=e?null:zr(r),[l,u,d,p,g,_]=await Promise.all(a),v=g.trailer.getRaw(`Root`)||null,y;if(c){_?await _.canUpdateStructTree({pdfManager:n,newAnnotationsByPage:c})&&(y=_):await nf.canCreateStructureTree({catalogRef:v,pdfManager:n,newAnnotationsByPage:c})&&(y=null);let e=Dx.generateImages(r.values(),g,n.evaluatorOptions.isOffscreenCanvasSupported),t=y===void 0?s:[];for(let[r,i]of c)t.push(n.getPage(r).then(t=>{let n=new CC(`Save (editor): page ${r}`);return m(n),t.saveNewAnnotations(f,n,i,e,o).finally(function(){h(n)})}));y===null?s.push(Promise.all(t).then(async()=>{await nf.createStructureTree({newAnnotationsByPage:c,xref:g,catalogRef:v,pdfManager:n,changes:o})})):y&&s.push(Promise.all(t).then(async()=>{await y.updateStructureTree({newAnnotationsByPage:c,pdfManager:n,changes:o})}))}if(e)s.push(n.ensureDoc(`serializeXfaData`,[r]));else for(let e=0;e<t;e++)s.push(n.getPage(e).then(function(t){let n=new CC(`Save: page ${e}`);return m(n),t.save(f,n,r,o).finally(function(){h(n)})}));let b=await Promise.all(s),x=null;if(e){if(x=b[0],!x)return l.bytes}else if(o.size===0)return l.bytes;let S=d&&u instanceof L&&o.values().some(e=>e.needAppearances),C=u instanceof L&&u.get(`XFA`)||null,w=null,T=!1;if(Array.isArray(C)){for(let e=0,t=C.length;e<t;e+=2)C[e]===`datasets`&&(w=C[e+1],T=!0);w===null&&(w=g.getNewTemporaryRef())}else C&&N(`Unsupported XFA type.`);let E=Object.create(null);if(g.trailer){let e=new Map,t=g.trailer.get(`Info`)||null;if(t instanceof L)for(let[n,r]of t)typeof r==`string`&&e.set(n,Nn(r));E={rootRef:v,encryptRef:g.trailer.getRaw(`Encrypt`)||null,newRef:g.getNewTemporaryRef(),infoRef:g.trailer.getRaw(`Info`)||null,infoMap:e,fileIds:g.trailer.get(`ID`)||null,startXRef:p,filename:i}}return yC({originalData:l.bytes,xrefInfo:E,changes:o,xref:g,hasXfa:!!C,xfaDatasetsRef:w,hasXfaDatasetsEntry:T,needAppearances:S,acroFormRef:d,acroForm:u,xfaData:x,useXrefStream:$n(g.topDict,`XRef`)}).finally(()=>{g.resetNewTemporaryRef()})}),f.on(`GetOperatorList`,function(e,t){let r=e.pageIndex;n.getPage(r).then(function(n){let i=new CC(`GetOperatorList: page ${r}`);m(i);let a=o>=Ce?Date.now():0;n.getOperatorList({handler:f,sink:t,task:i,intent:e.intent,cacheKey:e.cacheKey,annotationStorage:e.annotationStorage,modifiedIds:e.modifiedIds}).then(function(e){h(i),a&&hn(`page=${r+1} - getOperatorList: time=${Date.now()-a}ms, len=${e.length}`),t.close()},function(e){h(i),i.terminated||t.error(e)})})}),f.on(`GetTextContent`,function(e,t){let{pageIndex:r,includeMarkedContent:i,disableNormalization:a}=e;n.getPage(r).then(function(e){let n=new CC(`GetTextContent: page `+r);m(n);let s=o>=Ce?Date.now():0;e.extractTextContent({handler:f,task:n,sink:t,includeMarkedContent:i,disableNormalization:a}).then(function(){h(n),s&&hn(`page=${r+1} - getTextContent: time=`+(Date.now()-s)+`ms`),t.close()},function(e){h(n),n.terminated||t.error(e)})})}),f.on(`GetStructTree`,function(e){return n.getPage(e.pageIndex).then(e=>n.ensure(e,`getStructTree`))}),f.on(`FontFallback`,function(e){return n.fontFallback(e.id,f)}),f.on(`Cleanup`,function(e){return n.cleanup(!0)}),f.on(`Terminate`,function(e){r=!0;let t=[];if(n){n.terminate(new wn(`Worker was terminated.`));let e=n.cleanup();t.push(e),n=null}else Id();i?.(new wn(`Worker was terminated.`));for(let e of a)t.push(e.finished),e.terminate();return Promise.all(t).then(function(){f.destroy(),f=null})}),f.on(`Ready`,function(t){_(e),e=null}),d}static initializeFromPort(e){let t=new cC(`worker`,`main`,e);this.setup(t,e),t.send(`ready`,null)}};globalThis.pdfjsWorker={WorkerMessageHandler:wC};var TC=!(typeof process!=`object`||process+``!=`[object process]`||process.versions.nw||process.versions.electron&&process.type&&process.type!==`browser`),EC=[.001,0,0,.001,0,0],DC=1.35,OC=1,kC=2,AC=4,jC=16,MC=32,NC=64,PC=128,FC=256,IC={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3},LC=`pdfjs_internal_editor_`,RC={DISABLE:-1,NONE:0,FREETEXT:3,HIGHLIGHT:9,STAMP:13,INK:15,POPUP:16,SIGNATURE:101,COMMENT:102},zC={RESIZE:1,CREATE:2,FREETEXT_SIZE:11,FREETEXT_COLOR:12,FREETEXT_OPACITY:13,INK_COLOR:21,INK_THICKNESS:22,INK_OPACITY:23,HIGHLIGHT_COLOR:31,HIGHLIGHT_THICKNESS:32,HIGHLIGHT_FREE:33,HIGHLIGHT_SHOW_ALL:34,DRAW_STEP:41},BC={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},VC=0,HC=1,UC=2,WC=3,GC=3,KC=4,qC={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},JC={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},YC=1,XC=2,ZC=3,QC=4,$C=5,ew={ERRORS:0,WARNINGS:1,INFOS:5},tw={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},nw=0,rw=1,iw=2,aw=3,ow={NEED_PASSWORD:1,INCORRECT_PASSWORD:2},sw=ew.WARNINGS;function cw(e){Number.isInteger(e)&&(sw=e)}function lw(){return sw}function uw(e){sw>=ew.INFOS&&console.info(`Info: ${e}`)}function dw(e){sw>=ew.WARNINGS&&console.warn(`Warning: ${e}`)}function fw(e){throw Error(e)}function pw(e,t){e||fw(t)}function mw(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=decodeURIComponent(escape(e))}catch{}let r=t?URL.parse(e,t):URL.parse(e);return function(e){switch(e?.protocol){case`http:`:case`https:`:case`ftp:`:case`mailto:`:case`tel:`:return!0;default:return!1}}(r)?r:null}function hw(e,t,n=!1){let r=URL.parse(e);return r?(r.hash=t,r.href):n&&mw(e,`http://example.com`)?e.split(`#`,1)[0]+(t?`#${t}`:``):``}function gw(e,t,n,r=!1){return Object.defineProperty(e,t,{value:n,enumerable:!r,configurable:!0,writable:!1}),n}var _w=function(){function e(e,t){this.message=e,this.name=t}return e.prototype=Error(),e.constructor=e,e}(),vw=class extends _w{constructor(e,t){super(e,`PasswordException`),this.code=t}},yw=class extends _w{constructor(e,t){super(e,`UnknownErrorException`),this.details=t}},bw=class extends _w{constructor(e){super(e,`InvalidPDFException`)}},xw=class extends _w{constructor(e,t,n){super(e,`ResponseException`),this.status=t,this.missing=n}},Sw=class extends _w{constructor(e){super(e,`FormatError`)}},Cw=class extends _w{constructor(e){super(e,`AbortException`)}};function ww(e){typeof e==`object`&&e?.length!==void 0||fw(`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 Tw(e){typeof e!=`string`&&fw(`Invalid argument for stringToBytes`);let t=e.length,n=new Uint8Array(t);for(let r=0;r<t;++r)n[r]=255&e.charCodeAt(r);return n}var Ew=class{static get isLittleEndian(){return gw(this,`isLittleEndian`,function(){let e=new Uint8Array(4);return e[0]=1,new Uint32Array(e.buffer,0,1)[0]===1}())}static get isEvalSupported(){return gw(this,`isEvalSupported`,function(){try{return Function(``),!0}catch{return!1}}())}static get isOffscreenCanvasSupported(){return gw(this,`isOffscreenCanvasSupported`,typeof OffscreenCanvas<`u`)}static get isImageDecoderSupported(){return gw(this,`isImageDecoderSupported`,typeof ImageDecoder<`u`)}static get platform(){let{platform:e,userAgent:t}=navigator;return gw(this,`platform`,{isAndroid:t.includes(`Android`),isLinux:e.includes(`Linux`),isMac:e.includes(`Mac`),isWindows:e.includes(`Win`),isFirefox:t.includes(`Firefox`)})}static get isCSSRoundSupported(){return gw(this,`isCSSRoundSupported`,globalThis.CSS?.supports?.(`width: round(1.5px, 1px)`))}},Dw=Array.from(Array(256).keys(),e=>e.toString(16).padStart(2,`0`)),Q=class{static makeHexColor(e,t,n){return`#${Dw[e]}${Dw[t]}${Dw[n]}`}static domMatrixToTransform(e){return[e.a,e.b,e.c,e.d,e.e,e.f]}static scaleMinMax(e,t){let n;e[0]?(e[0]<0&&(n=t[0],t[0]=t[2],t[2]=n),t[0]*=e[0],t[2]*=e[0],e[3]<0&&(n=t[1],t[1]=t[3],t[3]=n),t[1]*=e[3],t[3]*=e[3]):(n=t[0],t[0]=t[1],t[1]=n,n=t[2],t[2]=t[3],t[3]=n,e[1]<0&&(n=t[1],t[1]=t[3],t[3]=n),t[1]*=e[1],t[3]*=e[1],e[2]<0&&(n=t[0],t[0]=t[2],t[2]=n),t[0]*=e[2],t[2]*=e[2]),t[0]+=e[4],t[1]+=e[5],t[2]+=e[4],t[3]+=e[5]}static transform(e,t){return[e[0]*t[0]+e[2]*t[1],e[1]*t[0]+e[3]*t[1],e[0]*t[2]+e[2]*t[3],e[1]*t[2]+e[3]*t[3],e[0]*t[4]+e[2]*t[5]+e[4],e[1]*t[4]+e[3]*t[5]+e[5]]}static multiplyByDOMMatrix(e,t){return[e[0]*t.a+e[2]*t.b,e[1]*t.a+e[3]*t.b,e[0]*t.c+e[2]*t.d,e[1]*t.c+e[3]*t.d,e[0]*t.e+e[2]*t.f+e[4],e[1]*t.e+e[3]*t.f+e[5]]}static applyTransform(e,t,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)return void(Math.abs(l)>=1e-12&&this.#e(e,t,n,r,i,a,o,s,-u/l,d));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*(3*(n-i)-e+o),6*(e-2*n+i),3*(n-e),c),this.#t(e,n,i,o,t,r,a,s,3*(3*(r-a)-t+s),6*(t-2*r+a),3*(r-t),c)}},Ow=null,kw=null;function Aw(e){return Ow||(Ow=/([\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,kw=new Map([[`ſt`,`ſt`]])),e.replaceAll(Ow,(e,t,n)=>t?t.normalize(`NFKC`):kw.get(n))}function jw(){if(typeof crypto.randomUUID==`function`)return crypto.randomUUID();let e=new Uint8Array(32);return crypto.getRandomValues(e),ww(e)}var Mw=`pdfjs_internal_id_`;function Nw(e,t,n){return Math.min(Math.max(e,t),n)}function Pw(e){return Uint8Array.prototype.toBase64?e.toBase64():btoa(ww(e))}typeof Promise.try!=`function`&&(Promise.try=function(e,...t){return new Promise(n=>{n(e(...t))})}),typeof Math.sumPrecise!=`function`&&(Math.sumPrecise=function(e){return e.reduce((e,t)=>e+t,0)});var Fw=class e{static textContent(t){let n=[],r={items:n,styles:Object.create(null)};return function t(r){if(!r)return;let i=null,a=r.name;if(a===`#text`)i=r.value;else{if(!e.shouldBuildText(a))return;r?.attributes?.textContent?i=r.attributes.textContent:r.value&&(i=r.value)}if(i!==null&&n.push({str:i}),r.children)for(let e of r.children)t(e)}(t),r}static shouldBuildText(e){return!(e===`textarea`||e===`input`||e===`option`||e===`select`)}},Iw=class{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:e.attributes.hasOwnProperty(`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)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`: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 render(e){let t=e.annotationStorage,n=e.linkService,r=e.xfaHtml,i=e.intent||`display`,a=document.createElement(r.name);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&&Fw.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=s?.attributes?.xmlns?document.createElementNS(s.attributes.xmlns,u):document.createElement(u);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&&Fw.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}},Lw=`http://www.w3.org/2000/svg`,Rw=class{static CSS=96;static PDF=72;static PDF_TO_CSS_UNITS=this.CSS/this.PDF};async function zw(e,t=`text`){if(qw(e,document.baseURI)){let n=await fetch(e);if(!n.ok)throw Error(n.statusText);switch(t){case`arraybuffer`:return n.arrayBuffer();case`blob`:return n.blob();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,i.onreadystatechange=()=>{if(i.readyState===XMLHttpRequest.DONE)if(i.status!==200&&i.status!==0)r(Error(i.statusText));else{switch(t){case`arraybuffer`:case`blob`:case`json`:n(i.response);return}n(i.responseText)}},i.send(null)})}var Bw=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,p,m,h,g;switch((r%=360)<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),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 gw(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 Q.applyTransform(n,this.transform),n}convertToViewportRectangle(e){let t=[e[0],e[1]];Q.applyTransform(t,this.transform);let n=[e[2],e[3]];return Q.applyTransform(n,this.transform),[t[0],t[1],n[0],n[1]]}convertToPdfPoint(e,t){let n=[e,t];return Q.applyInverseTransform(n,this.transform),n}},Vw=class extends _w{constructor(e,t=0){super(e,`RenderingCancelledException`),this.extraDelay=t}};function Hw(e){let t=e.length,n=0;for(;n<t&&e[n].trim()===``;)n++;return e.substring(n,n+5).toLowerCase()===`data:`}function Uw(e){return typeof e==`string`&&/\.pdf$/i.test(e)}function Ww(e){return[e]=e.split(/[#?]/,1),e.substring(e.lastIndexOf(`/`)+1)}function Gw(e,t=`document.pdf`){if(typeof e!=`string`)return t;if(Hw(e))return dw(`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=t.split(`/`).at(-1),t.test(/^\.pdf$/i)?t:e):t}catch{return e}},i=/\.pdf$/i,a=n.pathname.split(`/`).at(-1);if(i.test(a))return r(a);if(n.searchParams.size>0){let e=Array.from(n.searchParams.values()).reverse();for(let t of e)if(i.test(t))return r(t);let t=Array.from(n.searchParams.keys()).reverse();for(let e of t)if(i.test(e))return r(e)}if(n.hash){let e=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i.exec(n.hash);if(e)return r(e[0])}return t}var Kw=class{started=Object.create(null);times=[];time(e){e in this.started&&dw(`Timer is already running for ${e}`),this.started[e]=Date.now()}timeEnd(e){e in this.started||dw(`Timer has not been started for ${e}`),this.times.push({name:e,start:this.started[e],end:Date.now()}),delete this.started[e]}toString(){let e=[],t=0;for(let{name:e}of this.times)t=Math.max(e.length,t);for(let{name:n,start:r,end:i}of this.times)e.push(`${n.padEnd(t)} ${i-r}ms\n`);return e.join(``)}};function qw(e,t){let n=t?URL.parse(e,t):URL.parse(e);return n?.protocol===`http:`||n?.protocol===`https:`}function Jw(e){e.preventDefault()}function Yw(e){e.preventDefault(),e.stopPropagation()}var Xw=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 Zw(e,{scale:t=1,rotation:n=0}){let{width:r,height:i}=e.attributes.style;return new Bw({viewBox:[0,0,parseInt(r),parseInt(i)],userUnit:1,scale:t,rotation:n})}function Qw(e){if(e.startsWith(`#`)){let t=parseInt(e.slice(1),16);return[(16711680&t)>>16,(65280&t)>>8,255&t]}return e.startsWith(`rgb(`)?e.slice(4,-1).split(`,`).map(e=>parseInt(e)):e.startsWith(`rgba(`)?e.slice(5,-1).split(`,`).map(e=>parseInt(e)).slice(0,3):(dw(`Not a valid color format: "${e}"`),[0,0,0])}function $w(e){let{a:t,b:n,c:r,d:i,e:a,f:o}=e.getTransform();return[t,n,r,i,a,o]}function eT(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 tT(e,t,n=!1,r=!0){if(t instanceof Bw){let{pageWidth:r,pageHeight:i}=t.rawDims,{style:a}=e,o=Ew.isCSSRoundSupported,s=`var(--total-scale-factor) * ${r}px`,c=`var(--total-scale-factor) * ${i}px`,l=o?`round(down, ${s}, var(--scale-round-x))`:`calc(${s})`,u=o?`round(down, ${c}, var(--scale-round-y))`:`calc(${c})`;n&&t.rotation%180!=0?(a.width=u,a.height=l):(a.width=l,a.height=u)}r&&e.setAttribute(`data-main-rotation`,t.rotation)}var nT=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))>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)}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}},rT=[`image/apng`,`image/avif`,`image/bmp`,`image/gif`,`image/jpeg`,`image/png`,`image/svg+xml`,`image/webp`,`image/x-icon`],iT=class{static get isDarkMode(){return gw(this,`isDarkMode`,!!window?.matchMedia?.(`(prefers-color-scheme: dark)`).matches)}},aT=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(),gw(this,`commentForegroundColor`,Qw(n))}};function oT(e,t,n,r){let i=255*(1-(r=Math.min(Math.max(r??1,0),1)));return[e=Math.round(e*r+i),t=Math.round(t*r+i),n=Math.round(n*r+i)]}function sT(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]=60*((r-i)/e+(r<i?6:0));break;case r:t[0]=60*((i-n)/e+2);break;case i:t[0]=60*((n-r)/e+4)}}t[2]=s}function cT(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 lT(e){return e<=.03928?e/12.92:((e+.055)/1.055)**2.4}function uT(e,t,n){cT(e,n),n.map(lT);let r=.2126*n[0]+.7152*n[1]+.0722*n[2];cT(t,n),n.map(lT);let i=.2126*n[0]+.7152*n[1]+.0722*n[2];return r>i?(r+.05)/(i+.05):(i+.05)/(r+.05)}var dT=new Map;function fT(e,t){let n=e[0]+256*e[1]+65536*e[2]+16777216*t[0]+4294967296*t[1]+1099511627776*t[2],r=dT.get(n);if(r)return r;let i=new Float32Array(9),a=i.subarray(0,3),o=i.subarray(3,6);sT(e,o);let s=i.subarray(6,9);sT(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]),uT(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===uT(o,s,a)<l?e=n:t=n}o[2]=c?t:e}return cT(o,a),r=Q.makeHexColor(Math.round(255*a[0]),Math.round(255*a[1]),Math.round(255*a[2])),dT.set(n,r),r}function pT({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 Iw.render({xfaHtml:e,div:i,intent:`richText`});i.firstChild.classList.add(`richText`,n),r.append(i)}var mT=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`,Jw,{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,Yw(e)}#d(e){this.#n._focusEventsAllowed=!0,Yw(e)}#f(e){let t=this.#n._uiManager._signal;return t instanceof AbortSignal&&!t.aborted&&(e.addEventListener(`focusin`,this.#u.bind(this),{capture:!0,signal:t}),e.addEventListener(`focusout`,this.#d.bind(this),{capture:!0,signal:t}),e.addEventListener(`contextmenu`,Jw,{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);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`:this.addColorPicker(t);break;case`altText`:await this.addAltText(t);break;case`editSignature`:await this.addEditSignatureButton(t);break;case`delete`:this.addDeleteButton();break;case`comment`:this.addComment(t)}}async addButtonBefore(e,t,n){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}},hT=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`);let t=this.#n._signal;t instanceof AbortSignal&&!t.aborted&&e.addEventListener(`contextmenu`,Jw,{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`,Jw,{signal:o}),i.addEventListener(`click`,r,{signal:o})),this.#e.append(i)}};function gT(e,t,n){for(let r of n)t.addEventListener(r,e[r].bind(e))}var _T=class{#e=0;get id(){return`${LC}${this.#e++}`}},vT=class e{#e=jw();#t=0;#n=null;static get _isSVGFittingCanvas(){let e=new OffscreenCanvas(1,3).getContext(`2d`,{willReadFrequently:!0}),t=new Image;return t.src=`data:image/svg+xml;charset=UTF-8,<svg viewBox="0 0 1 1" width="1" height="1" xmlns="http://www.w3.org/2000/svg"><rect width="1" height="1" style="fill:red;"/></svg>`,gw(this,`_isSVGFittingCanvas`,t.decode().then(()=>(e.drawImage(t,0,0,1,1,0,0,1,3),new Uint32Array(e.getImageData(0,0,1,1).data.buffer)[0]===0)))}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{let t;if(r||={bitmap:null,id:`image_${this.#e}_${this.#t++}`,refCounter:0,isSvg:!1},typeof n==`string`?(r.url=n,t=await zw(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){dw(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}_`)}},yT=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)return this.#e.length>0&&(this.#e.length=0),this.#r=0,void this.#e.push(s);if(a&&this.#e[this.#r].type===i)return o&&(s.undo=this.#e[this.#r].undo),void(this.#e[this.#r]=s);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)return this.#e.splice(t+1,this.#r-t),void(this.#r=t);this.#e.length=0,this.#r=-1}}destroy(){this.#e=null}},bT=class{constructor(e){this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;let{isMac:t}=Ew.platform;for(let[n,r,i={}]of e)for(let e of n){let n=e.startsWith(`mac+`);t&&n?(this.callbacks.set(e.slice(4),{callback:r,options:i}),this.allKeys.add(e.split(`+`).at(-1))):t||n||(this.callbacks.set(e,{callback:r,options:i}),this.allKeys.add(e.split(`+`).at(-1)))}}#e(e){e.altKey&&this.buffer.push(`alt`),e.ctrlKey&&this.buffer.push(`ctrl`),e.metaKey&&this.buffer.push(`meta`),e.shiftKey&&this.buffer.push(`shift`),this.buffer.push(e.key);let t=this.buffer.join(`+`);return this.buffer.length=0,t}exec(e,t){if(!this.allKeys.has(t.key))return;let n=this.callbacks.get(this.#e(t));if(!n)return;let{callback:r,options:{bubbles:i=!1,args:a=[],checker:o=null}}=n;o&&!o(e,t)||(r.bind(e,...a,t)(),i||Yw(t))}},xT=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 function(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,Qw(r))}t.remove()}(e),gw(this,`_colors`,e)}convert(t){let n=Qw(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?Q.makeHexColor(...t):e}},ST=class e{#e=new AbortController;#t=null;#n=null;#r=new Map;#i=new Map;#a=null;#o=null;#s=null;#c=new yT;#l=null;#u=null;#d=null;#f=0;#p=new Set;#m=null;#h=null;#g=new Set;_editorUndoBar=null;#_=!1;#v=!1;#y=!1;#b=null;#x=null;#S=null;#C=null;#w=!1;#T=null;#E=new _T;#D=!1;#O=!1;#k=!1;#A=null;#j=null;#M=null;#N=null;#P=null;#F=RC.NONE;#I=new Set;#L=null;#R=null;#z=null;#B=null;#V=null;#H={isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1,hasSelectedText:!1};#U=[0,0];#W=null;#G=null;#K=null;#q=null;#J=null;static TRANSLATE_SMALL=1;static TRANSLATE_BIG=10;static get _keyboardManager(){let t=e.prototype,n=e=>e.#G.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 gw(this,`_keyboardManager`,new bT([[[`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`,`mac+Enter`],t.addNewEditorFromKeyboard,{checker:(e,{target:t})=>!(t instanceof HTMLButtonElement)&&e.#G.contains(t)&&!e.isEnterHandled}],[[` `,`mac+ `],t.addNewEditorFromKeyboard,{checker:(e,{target:t})=>!(t instanceof HTMLButtonElement)&&e.#G.contains(document.activeElement)}],[[`Escape`,`mac+Escape`],t.unselectAll],[[`ArrowLeft`,`mac+ArrowLeft`],t.translateSelectedEditors,{args:[-i,0],checker:n}],[[`ctrl+ArrowLeft`,`mac+shift+ArrowLeft`],t.translateSelectedEditors,{args:[-a,0],checker:n}],[[`ArrowRight`,`mac+ArrowRight`],t.translateSelectedEditors,{args:[i,0],checker:n}],[[`ctrl+ArrowRight`,`mac+shift+ArrowRight`],t.translateSelectedEditors,{args:[a,0],checker:n}],[[`ArrowUp`,`mac+ArrowUp`],t.translateSelectedEditors,{args:[0,-i],checker:n}],[[`ctrl+ArrowUp`,`mac+shift+ArrowUp`],t.translateSelectedEditors,{args:[0,-a],checker:n}],[[`ArrowDown`,`mac+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.#G=e,this.#K=t,this.#q=n,this.#a=r,this.#l=i,this.#R=a,this.#V=s,this._eventBus=o,o._on(`editingaction`,this.onEditingAction.bind(this),{signal:g}),o._on(`pagechanging`,this.onPageChanging.bind(this),{signal:g}),o._on(`scalechanging`,this.onScaleChanging.bind(this),{signal:g}),o._on(`rotationchanging`,this.onRotationChanging.bind(this),{signal:g}),o._on(`setpreference`,this.onSetPreference.bind(this),{signal:g}),o._on(`switchannotationeditorparams`,e=>this.updateParams(e.type,e.value),{signal:g}),window.addEventListener(`pointerdown`,()=>{this.#O=!0},{capture:!0,signal:g}),window.addEventListener(`pointerup`,()=>{this.#O=!1},{capture:!0,signal:g}),this.#ee(),this.#se(),this.#re(),this.#o=s.annotationStorage,this.#b=s.filterFactory,this.#z=c,this.#C=l||null,this.#_=u,this.#v=d,this.#y=f,this.#P=p||null,this.viewParameters={realScale:Rw.PDF_TO_CSS_UNITS,rotation:0},this.isShiftKeyDown=!1,this._editorUndoBar=m||null,this._supportsPinchToZoom=!1!==h,i?.setSidebarUiManager(this)}destroy(){this.#J?.resolve(),this.#J=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.#g.clear(),this.#N?.clear(),this.#t=null,this.#I.clear(),this.#c.destroy(),this.#a?.destroy(),this.#l?.destroy(),this.#R?.destroy(),this.#T?.hide(),this.#T=null,this.#M?.destroy(),this.#M=null,this.#n=null,this.#x&&=(clearTimeout(this.#x),null),this.#W&&=(clearTimeout(this.#W),null),this._editorUndoBar?.destroy(),this.#V=null}combinedSignal(e){return AbortSignal.any([this._signal,e.signal])}get mlManager(){return this.#P}get useNewAltTextFlow(){return this.#v}get useNewAltTextWhenAddingImage(){return this.#y}get hcmFilter(){return gw(this,`hcmFilter`,this.#z?this.#b.addHCMFilter(this.#z.foreground,this.#z.background):`none`)}get direction(){return gw(this,`direction`,getComputedStyle(this.#G).direction)}get _highlightColors(){return gw(this,`_highlightColors`,this.#C?new Map(this.#C.split(`,`).map(e=>((e=e.split(`=`).map(e=>e.trim()))[1]=e[1].toUpperCase(),e))):null)}get highlightColors(){let{_highlightColors:e}=this;if(!e)return gw(this,`highlightColors`,null);let t=new Map,n=!!this.#z;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 gw(this,`highlightColors`,t)}get highlightColorNames(){return gw(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.#d=e}setMainHighlightColorPicker(e){this.#M=e}editAltText(e,t=!1){this.#a?.editAltText(this,e,t)}hasCommentManager(){return!!this.#l}editComment(e,t,n,r){this.#l?.showDialog(this,e,t,n,r)}selectComment(e,t){(this.#i.get(e)?.getEditorByUID(t))?.toggleComment(!0,!0)}updateComment(e){this.#l?.updateComment(e.getData())}updatePopupColor(e){this.#l?.updatePopupColor(e)}removeComment(e){this.#l?.removeComments([e.uid])}toggleComment(e,t,n=void 0){this.#l?.toggleCommentPopup(e,t,n)}makeCommentColor(e,t){return e&&this.#l?.makeCommentColor(e,t)||null}getCommentDialogElement(){return this.#l?.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),await n}getSignature(e){this.#R?.getSignature({uiManager:this,editor:e})}get signatureManager(){return this.#R}switchToMode(e,t){this._eventBus.on(`annotationeditormodechanged`,t,{once:!0,signal:this._signal}),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.#y=t)}onPageChanging({pageNumber:e}){this.#f=e-1}focusMainContainer(){this.#G.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.#K.classList.toggle(`noUserSelect`,e)}addShouldRescale(e){this.#g.add(e)}removeShouldRescale(e){this.#g.delete(e)}onScaleChanging({scale:e}){this.commitOrRemove(),this.viewParameters.realScale=e*Rw.PDF_TO_CSS_UNITS;for(let e of this.#g)e.onScaleChanging();this.#d?.onScaleChanging()}onRotationChanging({pagesRotation:e}){this.commitOrRemove(),this.viewParameters.rotation=e}#Y({anchorNode:e}){return e.nodeType===Node.TEXT_NODE?e.parentElement:e}#X(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.#Y(n).closest(`.textLayer`),l=this.getSelectionBoxes(c);if(!l)return;n.empty();let u=this.#X(c),d=this.#F===RC.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(RC.HIGHLIGHT,f):f()}commentSelection(e=``){this.highlightSelection(e,!0)}#Z(){let e=document.getSelection();if(!e||e.isCollapsed)return;let t=this.#Y(e).closest(`.textLayer`),n=this.getSelectionBoxes(t);n&&(this.#T||=new hT(this),this.#T.show(t,n,this.direction===`ltr`))}getAndRemoveDataFromAnnotationStorage(e){if(!this.#o)return null;let t=`${LC}${e}`,n=this.#o.getRawValue(t);return n&&this.#o.remove(t),n}addToAnnotationStorage(e){e.isEmpty()||!this.#o||this.#o.has(e.id)||this.#o.setValue(e.id,e)}a11yAlert(e,t=null){let n=this.#q;n&&(n.setAttribute(`data-l10n-id`,e),t?n.setAttribute(`data-l10n-args`,JSON.stringify(t)):n.removeAttribute(`data-l10n-args`))}#Q(){let e=document.getSelection();if(!e||e.isCollapsed)return void(this.#L&&(this.#T?.hide(),this.#L=null,this.#ce({hasSelectedText:!1})));let{anchorNode:t}=e;if(t===this.#L)return;let n=this.#Y(e).closest(`.textLayer`);if(n){if(this.#T?.hide(),this.#L=t,this.#ce({hasSelectedText:!0}),(this.#F===RC.HIGHLIGHT||this.#F===RC.NONE)&&(this.#F===RC.HIGHLIGHT&&this.showAllEditors(`highlight`,!0,!0),this.#w=this.isShiftKeyDown,!this.isShiftKeyDown)){let e=this.#F===RC.HIGHLIGHT?this.#X(n):null;if(e?.toggleDrawing(),this.#O){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.#$(`main_toolbar`))};window.addEventListener(`pointerup`,r,{signal:n}),window.addEventListener(`blur`,r,{signal:n})}else e?.toggleDrawing(!0),this.#$(`main_toolbar`)}}else this.#L&&(this.#T?.hide(),this.#L=null,this.#ce({hasSelectedText:!1}))}#$(e=``){this.#F===RC.HIGHLIGHT?this.highlightSelection(e):this.#_&&this.#Z()}#ee(){document.addEventListener(`selectionchange`,this.#Q.bind(this),{signal:this._signal})}#te(){if(this.#S)return;this.#S=new AbortController;let e=this.combinedSignal(this.#S);window.addEventListener(`focus`,this.focus.bind(this),{signal:e}),window.addEventListener(`blur`,this.blur.bind(this),{signal:e})}#ne(){this.#S?.abort(),this.#S=null}blur(){if(this.isShiftKeyDown=!1,this.#w&&(this.#w=!1,this.#$(`main_toolbar`)),!this.hasSelection)return;let{activeElement:e}=document;for(let t of this.#I)if(t.div.contains(e)){this.#j=[t,e],t._focusEventsAllowed=!1;break}}focus(){if(!this.#j)return;let[e,t]=this.#j;this.#j=null,t.addEventListener(`focusin`,()=>{e._focusEventsAllowed=!0},{once:!0,signal:this._signal}),t.focus()}#re(){if(this.#A)return;this.#A=new AbortController;let e=this.combinedSignal(this.#A);window.addEventListener(`keydown`,this.keydown.bind(this),{signal:e}),window.addEventListener(`keyup`,this.keyup.bind(this),{signal:e})}#ie(){this.#A?.abort(),this.#A=null}#ae(){if(this.#u)return;this.#u=new AbortController;let e=this.combinedSignal(this.#u);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})}#oe(){this.#u?.abort(),this.#u=null}#se(){let e=this._signal;document.addEventListener(`dragover`,this.dragOver.bind(this),{signal:e}),document.addEventListener(`drop`,this.drop.bind(this),{signal:e})}addEditListeners(){this.#re(),this.#ae()}removeEditListeners(){this.#ie(),this.#oe()}dragOver(e){for(let{type:t}of e.dataTransfer.items)for(let n of this.#h)if(n.isHandlingMimeForPasting(t))return e.dataTransfer.dropEffect=`copy`,void e.preventDefault()}drop(e){for(let t of e.dataTransfer.items)for(let n of this.#h)if(n.isHandlingMimeForPasting(t.type))return n.paste(t,this.currentLayer),void e.preventDefault()}copy(e){if(e.preventDefault(),this.#t?.commitOrRemove(),!this.hasSelection)return;let t=[];for(let e of this.#I){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.#h)if(t.isHandlingMimeForPasting(e.type))return void t.paste(e,this.currentLayer);let n=t.getData(`application/pdfjs`);if(!n)return;try{n=JSON.parse(n)}catch(e){dw(`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.#fe(t);this.#he(e)},undo:()=>{for(let t of e)t.remove()},mustExec:!0})}catch(e){dw(`paste: "${e.message}".`)}}keydown(t){this.isShiftKeyDown||t.key!==`Shift`||(this.isShiftKeyDown=!0),this.#F===RC.NONE||this.isEditorHandlingKeyboard||e._keyboardManager.exec(this,t)}keyup(e){this.isShiftKeyDown&&e.key===`Shift`&&(this.isShiftKeyDown=!1,this.#w&&(this.#w=!1,this.#$(`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`)}}#ce(e){Object.entries(e).some(([e,t])=>this.#H[e]!==t)&&(this._eventBus.dispatch(`annotationeditorstateschanged`,{source:this,details:Object.assign(this.#H,e)}),this.#F===RC.HIGHLIGHT&&!1===e.hasSelectedEditor&&this.#le([[zC.HIGHLIGHT_FREE,!0]]))}#le(e){this._eventBus.dispatch(`annotationeditorparamschanged`,{source:this,details:e})}setEditingState(e){e?(this.#te(),this.#ae(),this.#ce({isEditing:this.#F!==RC.NONE,isEmpty:this.#me(),hasSomethingToUndo:this.#c.hasSomethingToUndo(),hasSomethingToRedo:this.#c.hasSomethingToRedo(),hasSelectedEditor:!1})):(this.#ne(),this.#oe(),this.#ce({isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(e){if(!this.#h){this.#h=e;for(let e of this.#h)this.#le(e.defaultPropertiesToUpdate)}}getId(){return this.#E.id}get currentLayer(){return this.#i.get(this.#f)}getLayer(e){return this.#i.get(e)}get currentPageIndex(){return this.#f}addLayer(e){this.#i.set(e.pageIndex,e),this.#D?e.enable():e.disable()}removeLayer(e){this.#i.delete(e.pageIndex)}async updateMode(e,t=null,n=!1,r=!1,i=!1){if(this.#F!==e&&(!this.#J||(await this.#J.promise,this.#J))){if(this.#J=Promise.withResolvers(),this.#d?.commitOrRemove(),this.#F===RC.POPUP&&this.#l?.hideSidebar(),this.#l?.destroyPopup(),this.#F=e,e===RC.NONE){this.setEditingState(!1),this.#de();for(let e of this.#r.values())e.hideStandaloneCommentButton();this._editorUndoBar?.hide(),this.toggleComment(null),this.#J.resolve();return}for(let e of this.#r.values())e.addStandaloneCommentButton();e===RC.SIGNATURE&&await this.#R?.loadSignatures(),this.setEditingState(!0),await this.#ue(),this.unselectAll();for(let t of this.#i.values())t.updateMode(e);if(e===RC.POPUP){this.#n||=await this.#V.getAnnotationsByType(new Set(this.#h.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.#p.has(r)&&t.push(n)}this.#l?.showSidebar(t)}if(!t)return n&&this.addNewEditorFromKeyboard(),void this.#J.resolve();for(let e of this.#r.values())e.uid===t?(this.setSelected(e),i?e.editComment():r?e.enterInEditMode():e.focus()):e.unselect();this.#J.resolve()}}addNewEditorFromKeyboard(){this.currentLayer.canCreateNewEmptyEditor()&&this.currentLayer.addNewEditor()}updateToolbar(e){e.mode!==this.#F&&this._eventBus.dispatch(`switchannotationeditormode`,{source:this,...e})}updateParams(e,t){if(this.#h){switch(e){case zC.CREATE:this.currentLayer.addNewEditor(t);return;case zC.HIGHLIGHT_SHOW_ALL:this._eventBus.dispatch(`reporttelemetry`,{source:this,details:{type:`editing`,data:{type:`highlight`,action:`toggle_visibility`}}}),(this.#B||=new Map).set(e,t),this.showAllEditors(`highlight`,t)}if(this.hasSelection)for(let n of this.#I)n.updateParams(e,t);else for(let n of this.#h)n.updateDefaultParams(e,t)}}showAllEditors(e,t,n=!1){for(let n of this.#r.values())n.editorType===e&&n.show(t);(this.#B?.get(zC.HIGHLIGHT_SHOW_ALL)??!0)!==t&&this.#le([[zC.HIGHLIGHT_SHOW_ALL,t]])}enableWaiting(e=!1){if(this.#k!==e){this.#k=e;for(let t of this.#i.values())e?t.disableClick():t.enableClick(),t.div.classList.toggle(`waiting`,e)}}async#ue(){if(!this.#D){this.#D=!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()}}#de(){if(this.unselectAll(),this.#D){this.#D=!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.#x&&clearTimeout(this.#x),this.#x=setTimeout(()=>{this.focusMainContainer(),this.#x=null},0)),this.#r.delete(e.id),e.annotationElementId&&this.#N?.delete(e.annotationElementId),this.unselect(e),e.annotationElementId&&this.#p.has(e.annotationElementId)||this.#o?.remove(e.id)}addDeletedAnnotationElement(e){this.#p.add(e.annotationElementId),this.addChangedExistingAnnotation(e),e.deleted=!0}isDeletedAnnotationElement(e){return this.#p.has(e)}removeDeletedAnnotationElement(e){this.#p.delete(e.annotationElementId),this.removeChangedExistingAnnotation(e),e.deleted=!1}#fe(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.#le(e.propertiesToUpdate))}get#pe(){let e=null;for(e of this.#I);return e}updateUI(e){this.#pe===e&&this.#le(e.propertiesToUpdate)}updateUIForDefaultProperties(e){this.#le(e.defaultPropertiesToUpdate)}toggleSelected(e){if(this.#I.has(e))return this.#I.delete(e),e.unselect(),void this.#ce({hasSelectedEditor:this.hasSelection});this.#I.add(e),e.select(),this.#le(e.propertiesToUpdate),this.#ce({hasSelectedEditor:!0})}setSelected(e){this.updateToolbar({mode:e.mode,editId:e.id}),this.#d?.commitOrRemove();for(let t of this.#I)t!==e&&t.unselect();this.#I.clear(),this.#I.add(e),e.select(),this.#le(e.propertiesToUpdate),this.#ce({hasSelectedEditor:!0})}isSelected(e){return this.#I.has(e)}get firstSelectedEditor(){return this.#I.values().next().value}unselect(e){e.unselect(),this.#I.delete(e),this.#ce({hasSelectedEditor:this.hasSelection})}get hasSelection(){return this.#I.size!==0}get isEnterHandled(){return this.#I.size===1&&this.firstSelectedEditor.isEnterHandled}undo(){this.#c.undo(),this.#ce({hasSomethingToUndo:this.#c.hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:this.#me()}),this._editorUndoBar?.hide()}redo(){this.#c.redo(),this.#ce({hasSomethingToUndo:!0,hasSomethingToRedo:this.#c.hasSomethingToRedo(),isEmpty:this.#me()})}addCommands(e){this.#c.add(e),this.#ce({hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:this.#me()})}cleanUndoStack(e){this.#c.cleanType(e)}#me(){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.#I],n=()=>{for(let e of t)this.#fe(e)};this.addCommands({cmd:()=>{this._editorUndoBar?.show(n,t.length===1?t[0].editorType:t.length);for(let e of t)e.remove()},undo:n,mustExec:!0})}commitOrRemove(){this.#t?.commitOrRemove()}hasSomethingToControl(){return this.#t||this.hasSelection}#he(e){for(let e of this.#I)e.unselect();this.#I.clear();for(let t of e)t.isEmpty()||(this.#I.add(t),t.select());this.#ce({hasSelectedEditor:this.hasSelection})}selectAll(){for(let e of this.#I)e.commit();this.#he(this.#r.values())}unselectAll(){if((!this.#t||(this.#t.commitOrRemove(),this.#F===RC.NONE))&&!this.#d?.commitOrRemove()&&this.hasSelection){for(let e of this.#I)e.unselect();this.#I.clear(),this.#ce({hasSelectedEditor:!1})}}translateSelectedEditors(e,t,n=!1){if(n||this.commitOrRemove(),!this.hasSelection)return;this.#U[0]+=e,this.#U[1]+=t;let[r,i]=this.#U,a=[...this.#I];this.#W&&clearTimeout(this.#W),this.#W=setTimeout(()=>{this.#W=null,this.#U[0]=this.#U[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.#m=new Map;for(let e of this.#I)this.#m.set(e,{savedX:e.x,savedY:e.y,savedPageIndex:e.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!this.#m)return!1;this.disableUserSelect(!1);let e=this.#m;this.#m=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.#m)for(let n of this.#m.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.#I.size===1&&this.firstSelectedEditor.shouldGetKeyboardEvents()}isActive(e){return this.#t===e}getActive(){return this.#t}getMode(){return this.#F}isEditingMode(){return this.#F!==RC.NONE}get imageManager(){return gw(this,`imageManager`,new vT)}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.#s||=new Map).set(e,t)}removeChangedExistingAnnotation({annotationElementId:e}){this.#s?.delete(e)}renderAnnotationElement(e){let t=this.#s?.get(e.data.id);if(!t)return;let n=this.#o.getRawValue(t);n&&(this.#F!==RC.NONE||n.hasBeenModified)&&n.renderAnnotationElement(e)}setMissingCanvas(e,t,n){let r=this.#N?.get(e);r&&(r.setCanvas(t,n),this.#N.delete(e))}addMissingCanvas(e,t){(this.#N||=new Map).set(e,t)}},CT=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`,Jw,{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)return this.#s?.remove(),void(this.#s=null);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)return void this.#i?.remove()}else{if(!this.#e&&!this.#t)return t.classList.remove(`done`),void this.#i?.remove();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)}},wT=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-edit-comment-button`));let n=this.#r._uiManager._signal;if(!(n instanceof AbortSignal)||n.aborted)return e;e.addEventListener(`contextmenu`,Jw,{signal:n}),t&&(e.addEventListener(`focusin`,e=>{this.#r._focusEventsAllowed=!1,Yw(e)},{capture:!0,signal:n}),e.addEventListener(`focusout`,e=>{this.#r._focusEventsAllowed=!0,Yw(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){if(e!==this.#o&&(this.#a=null),e===null)return this.#o=``,void(this.#c=!0);this.#o=e,this.#s=new Date,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}},TT=class e{#e;#t=!1;#n=null;#r;#i;#a;#o;#s=null;#c;#l=null;#u;#d=null;constructor({container:e,isPinchingDisabled:t=null,isPinchingStopped:n=null,onPinchStart:r=null,onPinching:i=null,onPinchEnd:a=null,signal:o}){this.#e=e,this.#n=n,this.#r=t,this.#i=r,this.#a=i,this.#o=a,this.#u=new AbortController,this.#c=AbortSignal.any([o,this.#u.signal]),e.addEventListener(`touchstart`,this.#f.bind(this),{passive:!1,signal:this.#c})}get MIN_TOUCH_DISTANCE_TO_PINCH(){return 35/nT.pixelRatio}#f(e){if(this.#r?.())return;if(e.touches.length===1){if(this.#s)return;let e=this.#s=new AbortController,t=AbortSignal.any([this.#c,e.signal]),n=this.#e,r={capture:!0,signal:t,passive:!1},i=e=>{e.pointerType===`touch`&&(this.#s?.abort(),this.#s=null)};n.addEventListener(`pointerdown`,e=>{e.pointerType===`touch`&&(Yw(e),i(e))},r),n.addEventListener(`pointerup`,i,r),n.addEventListener(`pointercancel`,i,r);return}if(!this.#d){this.#d=new AbortController;let e=AbortSignal.any([this.#c,this.#d.signal]),t=this.#e,n={signal:e,capture:!1,passive:!1};t.addEventListener(`touchmove`,this.#p.bind(this),n);let r=this.#m.bind(this);t.addEventListener(`touchend`,r,n),t.addEventListener(`touchcancel`,r,n),n.capture=!0,t.addEventListener(`pointerdown`,Yw,n),t.addEventListener(`pointermove`,Yw,n),t.addEventListener(`pointercancel`,Yw,n),t.addEventListener(`pointerup`,Yw,n),this.#i?.()}if(Yw(e),e.touches.length!==2||this.#n?.())return void(this.#l=null);let[t,n]=e.touches;t.identifier>n.identifier&&([t,n]=[n,t]),this.#l={touch0X:t.screenX,touch0Y:t.screenY,touch1X:n.screenX,touch1Y:n.screenY}}#p(t){if(!this.#l||t.touches.length!==2)return;Yw(t);let[n,r]=t.touches;n.identifier>r.identifier&&([n,r]=[r,n]);let{screenX:i,screenY:a}=n,{screenX:o,screenY:s}=r,c=this.#l,{touch0X:l,touch0Y:u,touch1X:d,touch1Y:f}=c,p=d-l,m=f-u,h=o-i,g=s-a,_=Math.hypot(h,g)||1,v=Math.hypot(p,m)||1;if(!this.#t&&Math.abs(v-_)<=e.MIN_TOUCH_DISTANCE_TO_PINCH)return;if(c.touch0X=i,c.touch0Y=a,c.touch1X=o,c.touch1Y=s,!this.#t)return void(this.#t=!0);let y=[(i+o)/2,(a+s)/2];this.#a?.(y,v,_)}#m(e){e.touches.length>=2||(this.#d&&(this.#d.abort(),this.#d=null,this.#o?.()),this.#l&&(Yw(e),this.#l=null,this.#t=!1))}destroy(){this.#u?.abort(),this.#u=null,this.#s?.abort(),this.#s=null}},ET=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 _l10nResizer=null;#w=!1;#T=e._zIndex++;static _borderLineWidth=-1;static _colorManager=new xT;static _zIndex=1;static _telemetryTimeout=1e3;static get _resizerKeyboardManager(){let t=e.prototype._resizeWithKeyboard,n=ST.TRANSLATE_SMALL,r=ST.TRANSLATE_BIG;return gw(this,`_resizerKeyboardManager`,new bT([[[`ArrowLeft`,`mac+ArrowLeft`],t,{args:[-n,0]}],[[`ctrl+ArrowLeft`,`mac+shift+ArrowLeft`],t,{args:[-r,0]}],[[`ArrowRight`,`mac+ArrowRight`],t,{args:[n,0]}],[[`ctrl+ArrowRight`,`mac+shift+ArrowRight`],t,{args:[r,0]}],[[`ArrowUp`,`mac+ArrowUp`],t,{args:[0,-n]}],[[`ctrl+ArrowUp`,`mac+shift+ArrowUp`],t,{args:[0,-r]}],[[`ArrowDown`,`mac+ArrowDown`],t,{args:[0,n]}],[[`ctrl+ArrowDown`,`mac+shift+ArrowDown`],t,{args:[0,r]}],[[`Escape`,`mac+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;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}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 gw(this,`_defaultLineColor`,this._colorManager.getHexCode(`CanvasText`))}static deleteAnnotationElement(e){let t=new DT({id:e.parent.getNextId(),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._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){fw(`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/(2*e),this.y+=this.width*e/(2*t);break;case 180:this.x+=this.width/2,this.y+=this.height/2;break;case 270:this.x+=this.height*t/(2*e),this.y-=this.width*e/(2*t);break;default:this.x-=this.width/2,this.y-=this.height/2}this.fixAndSetPosition()}addCommands(e){this._uiManager.addCommands(e)}get currentLayer(){return this._uiManager.currentLayer}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=this.#T}setParent(e){e===null?(this.#W(),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){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),n.scrollIntoView({block:`nearest`})}_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=Nw(i,0,n-o),a=Nw(a,0,r-s);break;case 90:i=Nw(i,0,n-s),a=Nw(a,o,r);break;case 180:i=Nw(i,o,n),a=Nw(a,s,r);break;case 270:i=Nw(i,s,n),a=Nw(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`,Jw,{signal:t}),e.tabIndex=-1}this.div.prepend(this.#c)}#A(e,t){t.preventDefault();let{isMac:n}=Ew.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`,Yw,{passive:!1,signal:a}),window.addEventListener(`contextmenu`,Jw,{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(1e4*e)/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,h,g=!1,_=!1;switch(t){case`topLeft`:g=!0,m=(e,t)=>[0,0],h=(e,t)=>[e,t];break;case`topMiddle`:m=(e,t)=>[e/2,0],h=(e,t)=>[e/2,t];break;case`topRight`:g=!0,m=(e,t)=>[e,0],h=(e,t)=>[0,t];break;case`middleRight`:_=!0,m=(e,t)=>[e,t/2],h=(e,t)=>[0,t/2];break;case`bottomRight`:g=!0,m=(e,t)=>[e,t],h=(e,t)=>[0,0];break;case`bottomMiddle`:m=(e,t)=>[e/2,t],h=(e,t)=>[e/2,0];break;case`bottomLeft`:g=!0,m=(e,t)=>[0,t],h=(e,t)=>[e,0];break;case`middleLeft`:_=!0,m=(e,t)=>[0,t/2],h=(e,t)=>[e,t/2]}let v=m(s,c),y=h(s,c),b=f(...y),x=e._round(a+b[0]),S=e._round(o+b[1]),C,w,T=1,E=1;if(n.fromKeyboard)({deltaX:C,deltaY:w}=n);else{let{screenX:e,screenY:t}=n,[r,i]=this.#l;[C,w]=this.screenToPageTranslation(e-r,t-i),this.#l[0]=e,this.#l[1]=t}var D,O;if([C,w]=(D=C/r,O=w/i,[p[0]*D+p[2]*O,p[1]*D+p[3]*O]),g){let e=Math.hypot(s,c);T=E=Math.max(Math.min(Math.hypot(y[0]-v[0]-C,y[1]-v[1]-w)/e,1/s,1/c),l/s,u/c)}else _?T=Nw(Math.abs(y[0]-v[0]-C),l,1)/s:E=Nw(Math.abs(y[1]-v[1]-w),u,1)/c;let k=e._round(s*T),ee=e._round(c*E);b=f(...h(k,ee));let A=x-b[0],j=S-b[1];this.#h||=[this.x,this.y,this.width,this.height],this.width=k,this.height=ee,this.x=A,this.y=j,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 mT(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||(CT.initialize(e._l10n),this.#n=new CT(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.#r||=new wT(this)}addStandaloneCommentButton(){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(){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 wT(this),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 wT(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 wT(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),gT(this,e,[`keydown`,`pointerdown`,`dblclick`]),this.isResizable&&this._uiManager._supportsPinchToZoom&&(this.#C||=new TT({container:e,isPinchingDisabled:()=>!this.isSelected,onPinchStart:this.#P.bind(this),onPinching:this.#F.bind(this),onPinchEnd:this.#I.bind(this),signal:this._uiManager._signal})),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=r/n*.7+1-.7;if(i===1)return;let a=this.#O(this.rotation),o=(e,t)=>[a[0]*e+a[2]*t,a[1]*e+a[3]*t],[s,c]=this.parentDimensions,l=this.x,u=this.y,d=this.width,f=this.height,p=e.MIN_SIZE/s,m=e.MIN_SIZE/c;i=Math.max(Math.min(i,1/d,1/f),p/d,m/f);let h=e._round(d*i),g=e._round(f*i);if(h===d&&g===f)return;this.#h||=[l,u,d,f];let _=o(d/2,f/2),v=e._round(l+_[0]),y=e._round(u+_[1]),b=o(h/2,g/2);this.x=v-b[0],this.y=y-b[1],this.width=h,this.height=g,this.setDims(),this.fixAndSetPosition(),this._onResizing()}#I(){this.#n?.toggle(!0),this.parent.togglePointerEvents(!0),this.#M()}pointerdown(e){let{isMac:t}=Ew.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}=Ew.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)return void Yw(e);let[a,o]=this.screenToPageTranslation(t-this.#b,r-this.#x);this.#b=t,this.#x=r,this._uiManager.dragSelectedEditors(a,o)},a),window.addEventListener(`touchmove`,Yw,a),window.addEventListener(`pointerdown`,e=>{e.pointerType===this.#s&&(this.#C||e.isPrimary)&&o(e),Yw(e)},a));let s=e=>{this.#o&&this.#o!==e.pointerId?Yw(e):o(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)}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})}rebuild(){this.#z()}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:t.getNextId(),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.parent?this.parent.remove(this):this._uiManager.removeEditor(this),this.#y&&=(clearTimeout(this.#y),null),this.#W(),this.removeEditToolbar(),this.#S){for(let e of this.#S.values())clearTimeout(e);this.#S=null}this.parent=null,this.#C?.destroy(),this.#C=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.#B.bind(this),r=this.#V.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.#H.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.firstChild);else if(a>i)for(let e=0;e<a-i;e++)this.#c.firstChild.before(this.#c.lastChild);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.#U(0),this.#v=!0,this.#c.firstChild.focus({focusVisible:!0}),t.preventDefault(),t.stopImmediatePropagation()}#B(t){e._resizerKeyboardManager.exec(this,t)}#V(e){this.#v&&e.relatedTarget?.parentNode!==this.#c&&this.#W()}#H(e){this.#p=this.#v?e:``}#U(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})}#W(){this.#v=!1,this.#U(-1),this.#M()}_stopResizingWithKeyboard(){this.#W(),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.hasComment&&this._uiManager.toggleComment(this,!1,!1))}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.id}))}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);return}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){if(this.#d||this.deleted)return this.deleted?(this.#d.remove(),void(this.#d=null)):void((this.hasEditedComment||this._hasBeenMoved||this._hasBeenResized)&&this.#d.updateEdited({rect:this.getPDFRect(),popup:this.comment}));this.#d=e.addFakeAnnotation(this)}renderAnnotationElement(e){if(this.deleted)return e.hide(),null;let t=e.container.querySelector(`.annotationContent`);if(t){if(t.nodeName===`CANVAS`){let e=t;t=document.createElement(`div`),t.classList.add(`annotationContent`,this.editorType),e.before(t)}}else t=document.createElement(`div`),t.classList.add(`annotationContent`,this.editorType),e.container.prepend(t);return t}resetAnnotationElement(e){let{firstChild:t}=e.container;t?.nodeName===`DIV`&&t.classList.contains(`annotationContent`)&&t.remove()}},DT=class extends ET{constructor(e){super(e),this.annotationElementId=e.annotationElementId,this.deleted=!0}serialize(){return this.serializeDeleted()}},OT=3285377520,kT=4294901760,AT=65535,jT=class{constructor(e){this.h1=e?4294967295&e:OT,this.h2=e?4294967295&e:OT}update(e){let t,n;if(typeof e==`string`){t=new Uint8Array(2*e.length),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++]=255&i)}}else{if(!ArrayBuffer.isView(e))throw Error(`Invalid data format, must be a string or TypedArray.`);t=e.slice(),n=t.byteLength}let r=n>>2,i=n-4*r,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++)1&e?(o=a[e],o=o*u&kT|o*f&AT,o=o<<15|o>>>17,o=o*d&kT|o*p&AT,c^=o,c=c<<13|c>>>19,c=5*c+3864292196):(s=a[e],s=s*u&kT|s*f&AT,s=s<<15|s>>>17,s=s*d&kT|s*p&AT,l^=s,l=l<<13|l>>>19,l=5*l+3864292196);switch(o=0,i){case 3:o^=t[4*r+2]<<16;case 2:o^=t[4*r+1]<<8;case 1:o^=t[4*r],o=o*u&kT|o*f&AT,o=o<<15|o>>>17,o=o*d&kT|o*p&AT,1&r?c^=o:l^=o}this.h1=c,this.h2=l}hexdigest(){let e=this.h1,t=this.h2;return e^=t>>>1,e=3981806797*e&kT|36045*e&AT,t=4283543511*t&kT|(2950163797*(t<<16|e>>>16)&kT)>>>16,e^=t>>>1,e=444984403*e&kT|60499*e&AT,t=3301882366*t&kT|(3120437893*(t<<16|e>>>16)&kT)>>>16,e^=t>>>1,(e>>>0).toString(16).padStart(8,`0`)+(t>>>0).toString(16).padStart(8,`0`)}},MT=Object.freeze({map:null,hash:``,transfer:void 0}),NT=class{#e=!1;#t=null;#n=null;#r=new Map;constructor(){this.onSetModified=null,this.onResetModified=null,this.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);if(t!==void 0&&(t instanceof ET&&this.#n.delete(t.annotationElementId),this.#r.delete(e),this.#r.size===0&&this.resetModified(),typeof this.onAnnotationEditor==`function`)){for(let e of this.#r.values())if(e instanceof ET)return;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 ET&&((this.#n||=new Map).set(t.annotationElementId,t),typeof this.onAnnotationEditor==`function`&&this.onAnnotationEditor(t.constructor._type))}has(e){return this.#r.has(e)}get size(){return this.#r.size}#i(){this.#e||(this.#e=!0,typeof this.onSetModified==`function`&&this.onSetModified())}resetModified(){this.#e&&(this.#e=!1,typeof this.onResetModified==`function`&&this.onResetModified())}get print(){return new PT(this)}get serializable(){if(this.#r.size===0)return MT;let e=new Map,t=new jT,n=[],r=Object.create(null),i=!1;for(let[n,a]of this.#r){let o=a instanceof ET?a.serialize(!1,r):a;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}:MT}get editorStats(){let e=null,t=new Map,n=0,r=0;for(let i of this.#r.values()){if(!(i instanceof ET)){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.has(o)||t.set(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.get(e);n||(n=new Map,s.set(e,n));let r=n.get(t)??0;n.set(t,r+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)}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);return this.#t={ids:new Set(e),hash:e.join(`,`)}}[Symbol.iterator](){return this.#r.entries()}},PT=class extends NT{#e;constructor(e){super();let{map:t,hash:n,transfer:r}=e.serializable,i=structuredClone(t,r?{transfer:r}:null);this.#e={map:i,hash:n,transfer:r}}get print(){fw(`Should not call PrintAnnotationStorage.print`)}get serializable(){return this.#e}get modifiedIds(){return gw(this,`modifiedIds`,{ids:new Set,hash:``})}},FT=class{#e=new Set;constructor({ownerDocument:e=globalThis.document,styleElement:t=null}){this._document=e,this.nativeFontFaces=new Set,this.styleElement=null,this.loadingRequests=[],this.loadTestFontId=0}addNativeFontFace(e){this.nativeFontFaces.add(e),this._document.fonts.add(e)}removeNativeFontFace(e){this.nativeFontFaces.delete(e),this._document.fonts.delete(e)}insertRule(e){this.styleElement||(this.styleElement=this._document.createElement(`style`),this._document.documentElement.getElementsByTagName(`head`)[0].append(this.styleElement));let t=this.styleElement.sheet;t.insertRule(e,t.cssRules.length)}clear(){for(let e of this.nativeFontFaces)this._document.fonts.delete(e);this.nativeFontFaces.clear(),this.#e.clear(),this.styleElement&&=(this.styleElement.remove(),null)}async loadSystemFont({systemFontInfo:e,disableFontFace:t,_inspectFont:n}){if(e&&!this.#e.has(e.loadedName)){if(pw(!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.#e.add(t),n?.(e)}catch{dw(`Cannot load system font: ${e.baseFontName}, installing it could help to improve PDF rendering.`),this.removeNativeFontFace(a)}return}fw(`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)return void await this.loadSystemFont(e);if(this.isFontLoadingAPISupported){let t=e.createNativeFontFace();if(t){this.addNativeFontFace(t);try{await t.loaded}catch(n){throw dw(`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 new Promise(t=>{let n=this._queueLoadingCallback(t);this._prepareFontLoadEvent(e,n)})}}get isFontLoadingAPISupported(){return gw(this,`isFontLoadingAPISupported`,!!this._document?.fonts)}get isSyncFontLoadingSupported(){return gw(this,`isSyncFontLoadingSupported`,TC||Ew.platform.isFirefox)}_queueLoadingCallback(e){let{loadingRequests:t}=this,n={done:!1,complete:function(){for(pw(!n.done,`completeRequest() cannot be called twice.`),n.done=!0;t.length>0&&t[0].done;){let e=t.shift();setTimeout(e.callback,0)}},callback:e};return t.push(n),n}get _loadTestFont(){return gw(this,`_loadTestFont`,atob(`T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==`))}_prepareFontLoadEvent(e,t){function n(e,t){return e.charCodeAt(t)<<24|e.charCodeAt(t+1)<<16|e.charCodeAt(t+2)<<8|255&e.charCodeAt(t+3)}function r(e,t,n,r){return e.substring(0,t)+r+e.substring(t+n)}let i,a,o=this._document.createElement(`canvas`);o.width=1,o.height=1;let s=o.getContext(`2d`),c=0,l=`lt${Date.now()}${this.loadTestFontId++}`,u=this._loadTestFont;u=r(u,976,l.length,l);let d=1482184792,f=n(u,16);for(i=0,a=l.length-3;i<a;i+=4)f=f-d+n(l,i)|0;var p;i<l.length&&(f=f-d+n(l+`XXX`,i)|0),u=r(u,16,4,(p=f,String.fromCharCode(p>>24&255,p>>16&255,p>>8&255,255&p)));let m=`@font-face {font-family:"${l}";src:${`url(data:font/opentype;base64,${btoa(u)});`}}`;this.insertRule(m);let h=this._document.createElement(`div`);h.style.visibility=`hidden`,h.style.width=h.style.height=`10px`,h.style.position=`absolute`,h.style.top=h.style.left=`0px`;for(let t of[e.loadedName,l]){let e=this._document.createElement(`span`);e.textContent=`Hi`,e.style.fontFamily=t,h.append(e)}this._document.body.append(h),function e(t,n){if(++c>30)return dw(`Load test font never loaded.`),void n();s.font=`30px `+t,s.fillText(`.`,0,20),s.getImageData(0,0,1,1).data[3]>0?n():setTimeout(e.bind(null,t,n))}(l,()=>{h.remove(),t.complete()})}},IT=class{#e;constructor(e,t=null,n,r){this.compiledGlyphs=Object.create(null),this.#e=e,this._inspectFont=t,n&&Object.assign(this,n),r&&(this.charProcOperatorList=r)}createNativeFontFace(){if(!this.data||this.disableFontFace)return null;let e;if(this.cssFontInfo){let t={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(t.style=`oblique ${this.cssFontInfo.italicAngle}deg`),e=new FontFace(this.cssFontInfo.fontFamily,this.data,t)}else e=new FontFace(this.loadedName,this.data,{});return this._inspectFont?.(this),e}createFontFaceRule(){if(!this.data||this.disableFontFace)return null;let e=`url(data:${this.mimetype};base64,${Pw(this.data)});`,t;if(this.cssFontInfo){let n=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(n+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`),t=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${n}src:${e}}`}else t=`@font-face {font-family:"${this.loadedName}";src:${e}}`;return this._inspectFont?.(this,e),t}getPathGenerator(e,t){if(this.compiledGlyphs[t]!==void 0)return this.compiledGlyphs[t];let n=this.loadedName+`_path_`+t,r;try{r=e.get(n)}catch(e){dw(`getPathGenerator - ignoring character: "${e}".`)}let i=new Path2D(r||``);return this.fontExtraProperties||e.delete(n),this.compiledGlyphs[t]=i}get black(){return this.#e.black}get bold(){return this.#e.bold}get disableFontFace(){return this.#e.disableFontFace??!1}get fontExtraProperties(){return this.#e.fontExtraProperties??!1}get isInvalidPDFjsFont(){return this.#e.isInvalidPDFjsFont}get isType3Font(){return this.#e.isType3Font}get italic(){return this.#e.italic}get missingFile(){return this.#e.missingFile}get remeasure(){return this.#e.remeasure}get vertical(){return this.#e.vertical}get ascent(){return this.#e.ascent}get defaultWidth(){return this.#e.defaultWidth}get descent(){return this.#e.descent}get bbox(){return this.#e.bbox}get fontMatrix(){return this.#e.fontMatrix}get fallbackName(){return this.#e.fallbackName}get loadedName(){return this.#e.loadedName}get mimetype(){return this.#e.mimetype}get name(){return this.#e.name}get data(){return this.#e.data}clearData(){this.#e.clearData()}get cssFontInfo(){return this.#e.cssFontInfo}get systemFontInfo(){return this.#e.systemFontInfo}get defaultVMetrics(){return this.#e.defaultVMetrics}};function LT(e){if(typeof e!=`string`)return null;if(e.endsWith(`/`))return e;throw Error(`Invalid factory url: "${e}" must include trailing slash.`)}var RT=e=>typeof e==`object`&&Number.isInteger(e?.num)&&e.num>=0&&Number.isInteger(e?.gen)&&e.gen>=0,zT=function(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}.bind(null,RT,e=>typeof e==`object`&&typeof e?.name==`string`),BT=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)return void dw("LoopbackPort - cannot use an `aborted` signal.");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()}},VT=1,HT=2,UT=1,WT=2,GT=3,KT=4,qT=5,JT=6,YT=7,XT=8;function ZT(){}function QT(e){if(e instanceof Cw||e instanceof bw||e instanceof vw||e instanceof xw||e instanceof yw)return e;switch(e instanceof Error||typeof e==`object`&&e||fw(`wrapReason: Expected "reason" to be a (possibly cloned) Error.`),e.name){case`AbortException`:return new Cw(e.message);case`InvalidPDFException`:return new bw(e.message);case`PasswordException`:return new vw(e.message,e.code);case`ResponseException`:return new xw(e.message,e.status,e.missing);case`UnknownErrorException`:return new yw(e.message,e.details)}return new yw(e.message,e.toString())}var $T=class{#e=new AbortController;constructor(e,t,n){this.sourceName=e,this.targetName=t,this.comObj=n,this.callbackId=1,this.streamId=1,this.streamSinks=Object.create(null),this.streamControllers=Object.create(null),this.callbackCapabilities=Object.create(null),this.actionHandler=Object.create(null),n.addEventListener(`message`,this.#t.bind(this),{signal:this.#e.signal})}#t({data:e}){if(e.targetName!==this.sourceName)return;if(e.stream)return void this.#r(e);if(e.callback){let t=e.callbackId,n=this.callbackCapabilities[t];if(!n)throw Error(`Cannot resolve callback ${t}`);if(delete this.callbackCapabilities[t],e.callback===VT)n.resolve(e.data);else{if(e.callback!==HT)throw Error(`Unexpected callback case`);n.reject(QT(e.reason))}return}let t=this.actionHandler[e.action];if(!t)throw Error(`Unknown action from worker: ${e.action}`);if(e.callbackId){let n=this.sourceName,r=e.sourceName,i=this.comObj;Promise.try(t,e.data).then(function(t){i.postMessage({sourceName:n,targetName:r,callback:VT,callbackId:e.callbackId,data:t})},function(t){i.postMessage({sourceName:n,targetName:r,callback:HT,callbackId:e.callbackId,reason:QT(t)})});return}e.streamId?this.#n(e):t(e.data)}on(e,t){let n=this.actionHandler;if(n[e])throw Error(`There is already an actionName called "${e}"`);n[e]=t}send(e,t,n){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,data:t},n)}sendWithPromise(e,t,n){let r=this.callbackId++,i=Promise.withResolvers();this.callbackCapabilities[r]=i;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,callbackId:r,data:t},n)}catch(e){i.reject(e)}return i.promise}sendWithStream(e,t,n,r){let i=this.streamId++,a=this.sourceName,o=this.targetName,s=this.comObj;return new ReadableStream({start:n=>{let c=Promise.withResolvers();return this.streamControllers[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.streamControllers[i].pullCall=t,s.postMessage({sourceName:a,targetName:o,stream:JT,streamId:i,desiredSize:e.desiredSize}),t.promise},cancel:e=>{pw(e instanceof Error,`cancel must have a valid reason`);let t=Promise.withResolvers();return this.streamControllers[i].cancelCall=t,this.streamControllers[i].isClosed=!0,s.postMessage({sourceName:a,targetName:o,stream:UT,streamId:i,reason:QT(e)}),t.promise}},n)}#n(e){let t=e.streamId,n=this.sourceName,r=e.sourceName,i=this.comObj,a=this,o=this.actionHandler[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:KT,streamId:t,chunk:e},o)},close(){this.isCancelled||(this.isCancelled=!0,i.postMessage({sourceName:n,targetName:r,stream:GT,streamId:t}),delete a.streamSinks[t])},error(e){pw(e instanceof Error,`error must have a valid reason`),this.isCancelled||(this.isCancelled=!0,i.postMessage({sourceName:n,targetName:r,stream:qT,streamId:t,reason:QT(e)}))},sinkCapability:Promise.withResolvers(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:e.desiredSize,ready:null};s.sinkCapability.resolve(),s.ready=s.sinkCapability.promise,this.streamSinks[t]=s,Promise.try(o,e.data,s).then(function(){i.postMessage({sourceName:n,targetName:r,stream:XT,streamId:t,success:!0})},function(e){i.postMessage({sourceName:n,targetName:r,stream:XT,streamId:t,reason:QT(e)})})}#r(e){let t=e.streamId,n=this.sourceName,r=e.sourceName,i=this.comObj,a=this.streamControllers[t],o=this.streamSinks[t];switch(e.stream){case XT:e.success?a.startCall.resolve():a.startCall.reject(QT(e.reason));break;case YT:e.success?a.pullCall.resolve():a.pullCall.reject(QT(e.reason));break;case JT:if(!o){i.postMessage({sourceName:n,targetName:r,stream:YT,streamId:t,success:!0});break}o.desiredSize<=0&&e.desiredSize>0&&o.sinkCapability.resolve(),o.desiredSize=e.desiredSize,Promise.try(o.onPull||ZT).then(function(){i.postMessage({sourceName:n,targetName:r,stream:YT,streamId:t,success:!0})},function(e){i.postMessage({sourceName:n,targetName:r,stream:YT,streamId:t,reason:QT(e)})});break;case KT:if(pw(a,`enqueue should have stream controller`),a.isClosed)break;a.controller.enqueue(e.chunk);break;case GT:if(pw(a,`close should have stream controller`),a.isClosed)break;a.isClosed=!0,a.controller.close(),this.#i(a,t);break;case qT:pw(a,`error should have stream controller`),a.controller.error(QT(e.reason)),this.#i(a,t);break;case WT:e.success?a.cancelCall.resolve():a.cancelCall.reject(QT(e.reason)),this.#i(a,t);break;case UT:if(!o)break;let s=QT(e.reason);Promise.try(o.onCancel||ZT,s).then(function(){i.postMessage({sourceName:n,targetName:r,stream:WT,streamId:t,success:!0})},function(e){i.postMessage({sourceName:n,targetName:r,stream:WT,streamId:t,reason:QT(e)})}),o.sinkCapability.reject(s),o.isCancelled=!0,delete this.streamSinks[t];break;default:throw Error(`Unexpected stream case`)}}async#i(e,t){await Promise.allSettled([e.startCall?.promise,e.pullCall?.promise,e.cancelCall?.promise]),delete this.streamControllers[t]}destroy(){this.#e?.abort(),this.#e=null}},eE=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(e,t,n){if(!e.canvas)throw Error(`Canvas is not specified`);if(t<=0||n<=0)throw Error(`Invalid canvas size`);e.canvas.width=t,e.canvas.height=n}destroy(e){if(!e.canvas)throw Error(`Canvas is not specified`);e.canvas.width=0,e.canvas.height=0,e.canvas=null,e.context=null}_createCanvas(e,t){fw("Abstract method `_createCanvas` called.")}},tE=class extends eE{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}},nE=class{constructor({baseUrl:e=null,isCompressed:t=!0}){this.baseUrl=e,this.isCompressed=t}async fetch({name:e}){if(!this.baseUrl)throw Error("Ensure that the `cMapUrl` and `cMapPacked` API parameters are provided.");if(!e)throw Error(`CMap name must be specified.`);let t=this.baseUrl+e+(this.isCompressed?`.bcmap`:``);return this._fetch(t).then(e=>({cMapData:e,isCompressed:this.isCompressed})).catch(e=>{throw Error(`Unable to load ${this.isCompressed?`binary `:``}CMap at: ${t}`)})}async _fetch(e){fw("Abstract method `_fetch` called.")}},rE=class extends nE{async _fetch(e){let t=await zw(e,this.isCompressed?`arraybuffer`:`text`);return t instanceof ArrayBuffer?new Uint8Array(t):Tw(t)}},iE=class{addFilter(e){return`none`}addHCMFilter(e,t){return`none`}addAlphaFilter(e){return`none`}addLuminosityFilter(e){return`none`}addHighlightHCMFilter(e,t,n,r,i){return`none`}destroy(e=!1){}},aE=class extends iE{#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.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(Lw,`svg`);n.setAttribute(`width`,0),n.setAttribute(`height`,0),this.#n=this.#i.createElementNS(Lw,`defs`),e.append(n),n.append(this.#n),this.#i.body.append(e)}return this.#n}#u(e){if(e.length===1){let t=e[0],n=Array(256);for(let e=0;e<256;e++)n[e]=t[e]/255;let r=n.join(`,`);return[r,r,r]}let[t,n,r]=e,i=Array(256),a=Array(256),o=Array(256);for(let e=0;e<256;e++)i[e]=t[e]/255,a[e]=n[e]/255,o[e]=r[e]/255;return[i.join(`,`),a.join(`,`),o.join(`,`)]}#d(e){if(this.#e===void 0){this.#e=``;let e=this.#i.URL;e!==this.#i.baseURI&&(Hw(e)?dw(`#createUrl: ignore "data:"-URL for performance reasons.`):this.#e=hw(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=Q.makeHexColor(...a);let o=this.#v(t);if(t=Q.makeHexColor(...o),this.#l.style.color=``,e===`#000000`&&t===`#ffffff`||e===t)return i.url;let s=Array(256);for(let e=0;e<=255;e++){let t=e/255;s[e]=t<=.03928?t/12.92:((t+.055)/1.055)**2.4}let c=s.join(`,`),l=`g_${this.#r}_hcm_filter`,u=i.filter=this.#m(l);this.#g(c,c,c,u),this.#p(u);let d=(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(d(0,5),d(1,5),d(2,5),u),i.url=this.#d(l),i.url}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,n,r=this.#s.get(e||`luminosity`);if(r)return r;if(e?([t]=this.#u([e]),n=`luminosity_${t}`):n=`luminosity`,r=this.#s.get(n),r)return this.#s.set(e,r),r;let i=`g_${this.#r}_luminosity_map_${this.#o++}`,a=this.#d(i);this.#s.set(e,a),this.#s.set(n,a);let o=this.#m(i);return this.#f(o),e&&this.#_(t,o),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.#v.bind(this));u<l&&([l,u,d,f]=[u,l,f,d]),this.#l.style.color=``;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(Lw,`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(Lw,`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(Lw,`filter`);return t.setAttribute(`color-interpolation-filters`,`sRGB`),t.setAttribute(`id`,e),this.#l.append(t),t}#h(e,t,n){let r=this.#i.createElementNS(Lw,t);r.setAttribute(`type`,`discrete`),r.setAttribute(`tableValues`,n),e.append(r)}#g(e,t,n,r){let i=this.#i.createElementNS(Lw,`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(Lw,`feComponentTransfer`);t.append(n),this.#h(n,`feFuncA`,e)}#v(e){return this.#l.style.color=e,Qw(getComputedStyle(this.#l).getPropertyValue(`color`))}},oE=class{constructor({baseUrl:e=null}){this.baseUrl=e}async fetch({filename:e}){if(!this.baseUrl)throw Error("Ensure that the `standardFontDataUrl` API parameter is provided.");if(!e)throw Error(`Font filename must be specified.`);let t=`${this.baseUrl}${e}`;return this._fetch(t).catch(e=>{throw Error(`Unable to load font data at: ${t}`)})}async _fetch(e){fw("Abstract method `_fetch` called.")}},sE=class extends oE{async _fetch(e){let t=await zw(e,`arraybuffer`);return new Uint8Array(t)}},cE=class{constructor({baseUrl:e=null}){this.baseUrl=e}async fetch({filename:e}){if(!this.baseUrl)throw Error("Ensure that the `wasmUrl` API parameter is provided.");if(!e)throw Error(`Wasm filename must be specified.`);let t=`${this.baseUrl}${e}`;return this._fetch(t).catch(e=>{throw Error(`Unable to load wasm data at: ${t}`)})}async _fetch(e){fw("Abstract method `_fetch` called.")}},lE=class extends cE{async _fetch(e){let t=await zw(e,`arraybuffer`);return new Uint8Array(t)}};async function uE(e){let t=await process.getBuiltinModule(`fs`).promises.readFile(e);return new Uint8Array(t)}var dE=class extends iE{},fE=class extends eE{_createCanvas(e,t){return process.getBuiltinModule(`module`).createRequire(import.meta.url),new Proxy({},{get:(e,t)=>()=>{throw Error(`@napi-rs/canvas is not available in this environment`)}}).createCanvas(e,t)}},pE=class extends nE{async _fetch(e){return uE(e)}},mE=class extends oE{async _fetch(e){return uE(e)}},hE=class extends cE{async _fetch(e){return uE(e)}},gE=`__forcedDependency`,{floor:_E,ceil:vE}=Math;function yE(e,t,n,r,i,a){e[4*t+0]=Math.min(e[4*t+0],n),e[4*t+1]=Math.min(e[4*t+1],r),e[4*t+2]=Math.max(e[4*t+2],i),e[4*t+3]=Math.max(e[4*t+3],a)}var bE=new Uint32Array(new Uint8Array([255,255,0,0]).buffer)[0],xE=class{#e;#t;constructor(e,t){this.#e=e,this.#t=t}get length(){return this.#e.length}isEmpty(e){return this.#e[e]===bE}minX(e){return this.#t[4*e+0]/256}minY(e){return this.#t[4*e+1]/256}maxX(e){return(this.#t[4*e+2]+1)/256}maxY(e){return(this.#t[4*e+3]+1)/256}},SE=(e,t)=>{if(!e)return;let n=e.get(t);return n||(n={dependencies:new Set,isRenderingOperation:!1},e.set(t,n)),n},CE=class{#e={__proto__:null};#t={__proto__:null,transform:[],moveText:[],sameLineText:[],[gE]:[]};#n=new Map;#r=[];#i=[];#a=[[1,0,0,1,0,0]];#o=[-1/0,-1/0,1/0,1/0];#s=new Float64Array([1/0,1/0,-1/0,-1/0]);#c=-1;#l=new Set;#u=new Map;#d=new Map;#f;#p;#m;#h;#g;constructor(e,t,n=!1){this.#f=e.width,this.#p=e.height,this.#_(t),n&&(this.#g=new Map)}growOperationsCount(e){e>=this.#h.length&&this.#_(e,this.#h)}#_(e,t){let n=new ArrayBuffer(4*e);this.#m=new Uint8ClampedArray(n),this.#h=new Uint32Array(n),t&&t.length>0?(this.#h.set(t),this.#h.fill(bE,t.length)):this.#h.fill(bE)}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},[gE]:{__proto__:this.#t[gE]}},this.#o={__proto__:this.#o},this.#r.push(e),this}restore(e){let t=Object.getPrototypeOf(this.#e);if(t===null)return this;this.#e=t,this.#t=Object.getPrototypeOf(this.#t),this.#o=Object.getPrototypeOf(this.#o);let n=this.#r.pop();return n!==void 0&&(SE(this.#g,e)?.dependencies.add(n),this.#h[e]=this.#h[n]),this}recordOpenMarker(e){return this.#r.push(e),this}getOpenMarker(){return this.#r.length===0?null:this.#r.at(-1)}recordCloseMarker(e){let t=this.#r.pop();return t!==void 0&&(SE(this.#g,e)?.dependencies.add(t),this.#h[e]=this.#h[t]),this}beginMarkedContent(e){return this.#i.push(e),this}endMarkedContent(e){let t=this.#i.pop();return t!==void 0&&(SE(this.#g,e)?.dependencies.add(t),this.#h[e]=this.#h[t]),this}pushBaseTransform(e){return this.#a.push(Q.multiplyByDOMMatrix(this.#a.at(-1),e.getTransform())),this}popBaseTransform(){return this.#a.length>1&&this.#a.pop(),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(gE,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.#l)this.recordFutureForcedDependency(gE,e);return this}resetBBox(e){return this.#c!==e&&(this.#c=e,this.#s[0]=1/0,this.#s[1]=1/0,this.#s[2]=-1/0,this.#s[3]=-1/0),this}recordClipBox(e,t,n,r,i,a){let o=Q.multiplyByDOMMatrix(this.#a.at(-1),t.getTransform()),s=[1/0,1/0,-1/0,-1/0];Q.axialAlignedBoundingBox([n,i,r,a],o,s);let c=Q.intersect(this.#o,s);return c?(this.#o[0]=c[0],this.#o[1]=c[1],this.#o[2]=c[2],this.#o[3]=c[3]):(this.#o[0]=this.#o[1]=1/0,this.#o[2]=this.#o[3]=-1/0),this}recordBBox(e,t,n,r,i,a){let o=this.#o;if(o[0]===1/0)return this;let s=Q.multiplyByDOMMatrix(this.#a.at(-1),t.getTransform());if(o[0]===-1/0)return Q.axialAlignedBoundingBox([n,i,r,a],s,this.#s),this;let c=[1/0,1/0,-1/0,-1/0];return Q.axialAlignedBoundingBox([n,i,r,a],s,c),this.#s[0]=Math.min(this.#s[0],Math.max(c[0],o[0])),this.#s[1]=Math.min(this.#s[1],Math.max(c[1],o[1])),this.#s[2]=Math.max(this.#s[2],Math.min(c[2],o[2])),this.#s[3]=Math.max(this.#s[3],Math.min(c[3],o[3])),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.#d.get(n),!1!==c&&(l=[0,0,0,0],Q.axialAlignedBoundingBox(s,n.fontMatrix,l),r===1&&i===0&&a===0||Q.scaleMinMax([r,0,0,-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.#d.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[0]=Math.max(0,this.#o[0]),this.#s[1]=Math.max(0,this.#o[1]),this.#s[2]=Math.min(this.#f,this.#o[2]),this.#s[3]=Math.min(this.#p,this.#o[3]),this}getSimpleIndex(e){return this.#e[e]}recordDependencies(e,t){let n=this.#l,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.#l.add(this.#n.get(t)),this}recordOperation(e,t=!1){if(this.recordDependencies(e,[gE]),this.#g){let t=SE(this.#g,e),{dependencies:n}=t;this.#l.forEach(n.add,n),this.#r.forEach(n.add,n),this.#i.forEach(n.add,n),n.delete(e),t.isRenderingOperation=!0}if(this.#c===e){let n=_E(256*this.#s[0]/this.#f),r=_E(256*this.#s[1]/this.#p),i=vE(256*this.#s[2]/this.#f),a=vE(256*this.#s[3]/this.#p);yE(this.#m,e,n,r,i,a);for(let t of this.#l)t!==e&&yE(this.#m,t,n,r,i,a);for(let t of this.#r)t!==e&&yE(this.#m,t,n,r,i,a);for(let t of this.#i)t!==e&&yE(this.#m,t,n,r,i,a);t||(this.#l.clear(),this.#c=-1)}return this}recordShowTextOperation(e,t=!1){let n=Array.from(this.#l);this.recordOperation(e,t),this.recordIncrementalData(`sameLineText`,e);for(let e of n)this.recordIncrementalData(`sameLineText`,e);return this}bboxToClipBoxDropOperation(e,t=!1){return this.#c===e&&(this.#c=-1,this.#o[0]=Math.max(this.#o[0],this.#s[0]),this.#o[1]=Math.max(this.#o[1],this.#s[1]),this.#o[2]=Math.min(this.#o[2],this.#s[2]),this.#o[3]=Math.min(this.#o[3],this.#s[3]),t||this.#l.clear()),this}_takePendingDependencies(){let e=this.#l;return this.#l=new Set,e}_extractOperation(e){let t=this.#u.get(e);return this.#u.delete(e),t}_pushPendingDependencies(e){for(let t of e)this.#l.add(t)}take(){return this.#d.clear(),new xE(this.#h,this.#m)}takeDebugMetadata(){return this.#g}},wE=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}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`)}},TE=[`path`,`transform`,`filter`,`strokeColor`,`strokeAlpha`,`lineWidth`,`lineCap`,`lineJoin`,`miterLimit`,`dash`],EE=[`path`,`transform`,`filter`,`fillColor`,`fillAlpha`,`globalCompositeOperation`,`SMask`],DE=[`transform`,`SMask`,`filter`,`fillAlpha`,`strokeAlpha`,`globalCompositeOperation`],OE=[`filter`,`fillColor`,`fillAlpha`],kE=[`transform`,`leading`,`charSpacing`,`wordSpacing`,`hScale`,`textRise`,`moveText`,`textMatrix`,`font`,`fontObj`,`filter`,`fillColor`,`textRenderingMode`,`SMask`,`fillAlpha`,`strokeAlpha`,`globalCompositeOperation`,`sameLineText`],AE=[`transform`],jE=[`transform`,`fillColor`],ME=`Fill`,NE=`Stroke`,PE=`Shading`;function FE(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 IE=class{isModifyingCurrentTransform(){return!1}getPattern(){fw("Abstract method `getPattern` called.")}},LE=class extends IE{constructor(e){super(),this._type=e[1],this._bbox=e[2],this._colorStops=e[3],this._p0=e[4],this._p1=e[5],this._r0=e[6],this._r1=e[7],this.matrix=null}_createGradient(e){let t;this._type===`axial`?t=e.createLinearGradient(this._p0[0],this._p0[1],this._p1[0],this._p1[1]):this._type===`radial`&&(t=e.createRadialGradient(this._p0[0],this._p0[1],this._r0,this._p1[0],this._p1[1],this._r1));for(let e of this._colorStops)t.addColorStop(e[0],e[1]);return t}getPattern(e,t,n,r){let i;if(r===NE||r===ME){let a=t.current.getClippedPathBoundingBox(r,$w(e))||[0,0,0,0],o=Math.ceil(a[2]-a[0])||1,s=Math.ceil(a[3]-a[1])||1,c=t.cachedCanvases.getCanvas(`pattern`,o,s),l=c.context;l.clearRect(0,0,l.canvas.width,l.canvas.height),l.beginPath(),l.rect(0,0,l.canvas.width,l.canvas.height),l.translate(-a[0],-a[1]),n=Q.transform(n,[1,0,0,1,a[0],a[1]]),l.transform(...t.baseTransform),this.matrix&&l.transform(...this.matrix),FE(l,this._bbox),l.fillStyle=this._createGradient(l),l.fill(),i=e.createPattern(c.canvas,`no-repeat`);let u=new DOMMatrix(n);i.setTransform(u)}else FE(e,this._bbox),i=this._createGradient(e);return i}};function RE(e,t,n,r,i,a,o,s){let c=t.coords,l=t.colors,u=e.data,d=4*e.width,f;c[n+1]>c[r+1]&&(f=n,n=r,r=f,f=a,a=o,o=f),c[r+1]>c[i+1]&&(f=r,r=i,i=f,f=o,o=s,s=f),c[n+1]>c[r+1]&&(f=n,n=r,r=f,f=a,a=o,o=f);let p=(c[n]+t.offsetX)*t.scaleX,m=(c[n+1]+t.offsetY)*t.scaleY,h=(c[r]+t.offsetX)*t.scaleX,g=(c[r+1]+t.offsetY)*t.scaleY,_=(c[i]+t.offsetX)*t.scaleX,v=(c[i+1]+t.offsetY)*t.scaleY;if(m>=v)return;let y=l[a],b=l[a+1],x=l[a+2],S=l[o],C=l[o+1],w=l[o+2],T=l[s],E=l[s+1],D=l[s+2],O=Math.round(m),k=Math.round(v),ee,A,j,M,te,ne,re,ie;for(let e=O;e<=k;e++){if(e<g){let t=e<m?0:(m-e)/(m-g);ee=p-(p-h)*t,A=y-(y-S)*t,j=b-(b-C)*t,M=x-(x-w)*t}else{let t;t=e>v?1:g===v?0:(g-e)/(g-v),ee=h-(h-_)*t,A=S-(S-T)*t,j=C-(C-E)*t,M=w-(w-D)*t}let t;t=e<m?0:e>v?1:(m-e)/(m-v),te=p-(p-_)*t,ne=y-(y-T)*t,re=b-(b-E)*t,ie=x-(x-D)*t;let n=Math.round(Math.min(ee,te)),r=Math.round(Math.max(ee,te)),i=d*e+4*n;for(let e=n;e<=r;e++)t=(ee-e)/(ee-te),t<0?t=0:t>1&&(t=1),u[i++]=A-(A-ne)*t|0,u[i++]=j-(j-re)*t|0,u[i++]=M-(M-ie)*t|0,u[i++]=255}}function zE(e,t,n){let r=t.coords,i=t.colors,a,o;switch(t.type){case`lattice`:let s=t.verticesPerRow,c=Math.floor(r.length/s)-1,l=s-1;for(a=0;a<c;a++){let t=a*s;for(let a=0;a<l;a++,t++)RE(e,n,r[t],r[t+1],r[t+s],i[t],i[t+1],i[t+s]),RE(e,n,r[t+s+1],r[t+1],r[t+s],i[t+s+1],i[t+1],i[t+s])}break;case`triangles`:for(a=0,o=r.length;a<o;a+=3)RE(e,n,r[a],r[a+1],r[a+2],i[a],i[a+1],i[a+2]);break;default:throw Error(`illegal figure`)}}var BE=class extends IE{constructor(e){super(),this._coords=e[2],this._colors=e[3],this._figures=e[4],this._bounds=e[5],this._bbox=e[6],this._background=e[7],this.matrix=null}_createMeshCanvas(e,t,n){let r=Math.floor(this._bounds[0]),i=Math.floor(this._bounds[1]),a=Math.ceil(this._bounds[2])-r,o=Math.ceil(this._bounds[3])-i,s=Math.min(Math.ceil(Math.abs(a*e[0]*1.1)),3e3),c=Math.min(Math.ceil(Math.abs(o*e[1]*1.1)),3e3),l=a/s,u=o/c,d={coords:this._coords,colors:this._colors,offsetX:-r,offsetY:-i,scaleX:1/l,scaleY:1/u},f=s+4,p=c+4,m=n.getCanvas(`mesh`,f,p),h=m.context,g=h.createImageData(s,c);if(t){let e=g.data;for(let n=0,r=e.length;n<r;n+=4)e[n]=t[0],e[n+1]=t[1],e[n+2]=t[2],e[n+3]=255}for(let e of this._figures)zE(g,e,d);return h.putImageData(g,2,2),{canvas:m.canvas,offsetX:r-2*l,offsetY:i-2*u,scaleX:l,scaleY:u}}isModifyingCurrentTransform(){return!0}getPattern(e,t,n,r){FE(e,this._bbox);let i=new Float32Array(2);if(r===PE)Q.singularValueDecompose2dScale($w(e),i);else if(this.matrix){Q.singularValueDecompose2dScale(this.matrix,i);let[e,n]=i;Q.singularValueDecompose2dScale(t.baseTransform,i),i[0]*=e,i[1]*=n}else Q.singularValueDecompose2dScale(t.baseTransform,i);let a=this._createMeshCanvas(i,r===PE?null:this._background,t.cachedCanvases);return r!==PE&&(e.setTransform(...t.baseTransform),this.matrix&&e.transform(...this.matrix)),e.translate(a.offsetX,a.offsetY),e.scale(a.scaleX,a.scaleY),e.createPattern(a.canvas,`no-repeat`)}},VE=class extends IE{getPattern(){return`hotpink`}},HE=1,UE=2,WE=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.ctx=t,this.canvasGraphicsFactory=n,this.baseTransform=r}createPatternCanvas(e,t){let{bbox:n,operatorList:r,paintType:i,tilingType:a,color:o,canvasGraphicsFactory:s}=this,{xstep:c,ystep:l}=this;c=Math.abs(c),l=Math.abs(l),uw(`TilingType: `+a);let u=n[0],d=n[1],f=n[2],p=n[3],m=f-u,h=p-d,g=new Float32Array(2);Q.singularValueDecompose2dScale(this.matrix,g);let[_,v]=g;Q.singularValueDecompose2dScale(this.baseTransform,g);let y=_*g[0],b=v*g[1],x=m,S=h,C=!1,w=!1,T=Math.ceil(c*y),E=Math.ceil(l*b);T>=Math.ceil(m*y)?x=c:C=!0,E>=Math.ceil(h*b)?S=l:w=!0;let D=this.getSizeAndScale(x,this.ctx.canvas.width,y),O=this.getSizeAndScale(S,this.ctx.canvas.height,b),k=e.cachedCanvases.getCanvas(`pattern`,D.size,O.size),ee=k.context,A=s.createCanvasGraphics(ee,t);if(A.groupLevel=e.groupLevel,this.setFillAndStrokeStyleToContext(A,i,o),ee.translate(-D.scale*u,-O.scale*d),A.transform(0,D.scale,0,0,O.scale,0,0),ee.save(),A.dependencyTracker?.save(),this.clipBbox(A,u,d,f,p),A.baseTransform=$w(A.ctx),A.executeOperatorList(r),A.endDrawing(),A.dependencyTracker?.restore(),ee.restore(),C||w){let t=k.canvas;C&&(x=c),w&&(S=l);let n=this.getSizeAndScale(x,this.ctx.canvas.width,y),r=this.getSizeAndScale(S,this.ctx.canvas.height,b),i=n.size,a=r.size,o=e.cachedCanvases.getCanvas(`pattern-workaround`,i,a),s=o.context,f=C?Math.floor(m/c):0,p=w?Math.floor(h/l):0;for(let e=0;e<=f;e++)for(let n=0;n<=p;n++)s.drawImage(t,i*e,a*n,i,a,0,0,i,a);return{canvas:o.canvas,scaleX:n.scale,scaleY:r.scale,offsetX:u,offsetY:d}}return{canvas:k.canvas,scaleX:D.scale,scaleY:O.scale,offsetX:u,offsetY:d}}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;e.ctx.rect(t,n,a,o),Q.axialAlignedBoundingBox([t,n,r,i],$w(e.ctx),e.current.minMax),e.clip(),e.endPath()}setFillAndStrokeStyleToContext(e,t,n){let r=e.ctx,i=e.current;switch(t){case HE:let{fillStyle:e,strokeStyle:a}=this.ctx;r.fillStyle=i.fillColor=e,r.strokeStyle=i.strokeColor=a;break;case UE:r.fillStyle=r.strokeStyle=n,i.fillColor=i.strokeColor=n;break;default:throw new Sw(`Unsupported paint type: ${t}`)}}isModifyingCurrentTransform(){return!1}getPattern(e,t,n,r,i){let a=n;r!==PE&&(a=Q.transform(a,t.baseTransform),this.matrix&&(a=Q.transform(a,this.matrix)));let 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 c.setTransform(s),c}};function GE({src:e,srcPos:t=0,dest:n,width:r,height:i,nonBlackColor:a=4294967295,inverseDecode:o=!1}){let s=Ew.isLittleEndian?4278190080:255,[c,l]=o?[a,s]:[s,a],u=r>>3,d=7&r,f=e.length;n=new Uint32Array(n.buffer);let p=0;for(let r=0;r<i;r++){for(let r=t+u;t<r;t++){let r=t<f?e[t]:255;n[p++]=128&r?l:c,n[p++]=64&r?l:c,n[p++]=32&r?l:c,n[p++]=16&r?l:c,n[p++]=8&r?l:c,n[p++]=4&r?l:c,n[p++]=2&r?l:c,n[p++]=1&r?l:c}if(d===0)continue;let r=t<f?e[t++]:255;for(let e=0;e<d;e++)n[p++]=r&1<<7-e?l:c}return{srcPos:t,destPos:p}}var KE=16,qE=new DOMMatrix,JE=new Float32Array(2),YE=new Float32Array([1/0,1/0,-1/0,-1/0]),XE=class{constructor(e){this.canvasFactory=e,this.cache=Object.create(null)}getCanvas(e,t,n){let r;return this.cache[e]===void 0?(r=this.canvasFactory.create(t,n),this.cache[e]=r):(r=this.cache[e],this.canvasFactory.reset(r,t,n)),r}delete(e){delete this.cache[e]}clear(){for(let e in this.cache){let t=this.cache[e];this.canvasFactory.destroy(t),delete this.cache[e]}}};function ZE(e,t,n,r,i,a,o,s,c,l){let[u,d,f,p,m,h]=$w(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]}return e.drawImage(t,n,r,i,a,o,s,c,l),[Math.hypot(u,d)*c,Math.hypot(f,p)*l]}var QE=class{alphaIsShape=!1;fontSize=0;fontSizeScale=1;textMatrix=null;textMatrixScale=1;fontMatrix=EC;leading=0;x=0;y=0;lineX=0;lineY=0;charSpacing=0;wordSpacing=0;textHScale=1;textRenderingMode=VC;textRise=0;fillColor=`#000000`;strokeColor=`#000000`;patternFill=!1;patternStroke=!1;fillAlpha=1;strokeAlpha=1;lineWidth=1;activeSMask=null;transferMaps=`none`;constructor(e,t,n){n?.(this),this.clipBox=new Float32Array([0,0,e,t]),this.minMax=YE.slice()}clone(){let e=Object.create(this);return e.clipBox=this.clipBox.slice(),e.minMax=this.minMax.slice(),e}getPathBoundingBox(e=ME,t=null){let n=this.minMax.slice();if(e===NE){t||fw(`Stroke bounding box must include transform.`),Q.singularValueDecompose2dScale(t,JE);let e=JE[0]*this.lineWidth/2,r=JE[1]*this.lineWidth/2;n[0]-=e,n[1]-=r,n[2]+=e,n[3]+=r}return n}updateClipFromPath(){let e=Q.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(YE,0)}getClippedPathBoundingBox(e=ME,t=null){return Q.intersect(this.clipBox,this.getPathBoundingBox(e,t))}};function $E(e,t){if(t instanceof ImageData)return void e.putImageData(t,0,0);let n=t.height,r=t.width,i=n%KE,a=(n-i)/KE,o=i===0?a:a+1,s=e.createImageData(r,KE),c,l=0,u=t.data,d=s.data,f,p,m,h;if(t.kind===qC.GRAYSCALE_1BPP){let t=u.byteLength,n=new Uint32Array(d.buffer,0,d.byteLength>>2),h=n.length,g=r+7>>3,_=4294967295,v=Ew.isLittleEndian?4278190080:255;for(f=0;f<o;f++){for(m=f<a?KE:i,c=0,p=0;p<m;p++){let e=t-l,i=0,a=e>g?r:8*e-7,o=-8&a,s=0,d=0;for(;i<o;i+=8)d=u[l++],n[c++]=128&d?_:v,n[c++]=64&d?_:v,n[c++]=32&d?_:v,n[c++]=16&d?_:v,n[c++]=8&d?_:v,n[c++]=4&d?_:v,n[c++]=2&d?_:v,n[c++]=1&d?_:v;for(;i<a;i++)s===0&&(d=u[l++],s=128),n[c++]=d&s?_:v,s>>=1}for(;c<h;)n[c++]=0;e.putImageData(s,0,f*KE)}}else if(t.kind===qC.RGBA_32BPP){for(p=0,h=r*KE*4,f=0;f<a;f++)d.set(u.subarray(l,l+h)),l+=h,e.putImageData(s,0,p),p+=KE;f<o&&(h=r*i*4,d.set(u.subarray(l,l+h)),e.putImageData(s,0,p))}else{if(t.kind!==qC.RGB_24BPP)throw Error(`bad image kind: ${t.kind}`);for(m=KE,h=r*m,f=0;f<o;f++){for(f>=a&&(m=i,h=r*m),c=0,p=h;p--;)d[c++]=u[l++],d[c++]=u[l++],d[c++]=u[l++],d[c++]=255;e.putImageData(s,0,f*KE)}}}function eD(e,t){if(t.bitmap)return void e.drawImage(t.bitmap,0,0);let n=t.height,r=t.width,i=n%KE,a=(n-i)/KE,o=i===0?a:a+1,s=e.createImageData(r,KE),c=0,l=t.data,u=s.data;for(let t=0;t<o;t++){let n=t<a?KE:i;({srcPos:c}=GE({src:l,srcPos:c,dest:u,width:r,height:n,nonBlackColor:0})),e.putImageData(s,0,t*KE)}}function tD(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 nD(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`)}function rD(e,t){if(t)return!0;Q.singularValueDecompose2dScale(e,JE);let n=Math.fround(nT.pixelRatio*Rw.PDF_TO_CSS_UNITS);return JE[0]<=n&&JE[1]<=n}var iD=[`butt`,`round`,`square`],aD=[`miter`,`round`,`bevel`],oD={},sD={},cD=class e{constructor(e,t,n,r,i,{optionalContentConfig:a,markedContentStack:o=null},s,c,l){this.ctx=e,this.current=new QE(this.ctx.canvas.width,this.ctx.canvas.height),this.stateStack=[],this.pendingClip=null,this.pendingEOFill=!1,this.res=null,this.xobjs=null,this.commonObjs=t,this.objs=n,this.canvasFactory=r,this.filterFactory=i,this.groupStack=[],this.baseTransform=null,this.baseTransformStack=[],this.groupLevel=0,this.smaskStack=[],this.smaskCounter=0,this.tempSMask=null,this.suspendedCtx=null,this.contentVisible=!0,this.markedContentStack=o||[],this.optionalContentConfig=a,this.cachedCanvases=new XE(this.canvasFactory),this.cachedPatterns=new Map,this.annotationCanvasMap=s,this.viewportScale=1,this.outputScaleX=1,this.outputScaleY=1,this.pageColors=c,this._cachedScaleForStroking=[-1,0],this._cachedGetSinglePixelWidth=null,this._cachedBitmapsMap=new Map,this.dependencyTracker=l??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.cachedCanvases.getCanvas(`transparent`,i,a);this.compositeCtx=this.ctx,this.transparentCanvas=e.canvas,this.ctx=e.context,this.ctx.save(),this.ctx.transform(...$w(this.compositeCtx))}this.ctx.save(),nD(this.ctx),e&&(this.ctx.transform(...e),this.outputScaleX=e[0],this.outputScaleY=e[0]),this.ctx.transform(...t.transform),this.viewportScale=t.scale,this.baseTransform=$w(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>10&&typeof n==`function`,u=l?Date.now()+15:0,d=0,f=this.commonObjs,p=this.objs,m,h;for(;;){if(r!==void 0&&s===r.nextBreakPoint)return r.breakIt(s,n),s;if(!i||i(s))if(m=o[s],h=a[s]??null,m!==tw.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>10){if(Date.now()>u)return n(),s;d=0}}}#e(){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(),null)}endDrawing(){this.#e(),this.cachedCanvases.clear(),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.#t()}#t(){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,a,o=Math.max(Math.hypot(t[0],t[1]),1),s=Math.max(Math.hypot(t[2],t[3]),1),c=n,l=r,u=`prescale1`;for(;o>2&&c>1||s>2&&l>1;){let t=c,n=l;o>2&&c>1&&(t=c>=16384?Math.floor(c/2)-1||1:Math.ceil(c/2),o/=c/t),s>2&&l>1&&(n=l>=16384?Math.floor(l/2)-1||1:Math.ceil(l)/2,s/=l/n),i=this.cachedCanvases.getCanvas(u,t,n),a=i.context,a.clearRect(0,0,t,n),a.drawImage(e,0,0,c,l,0,0,t,n),e=i.canvas,c=t,l=n,u=u===`prescale1`?`prescale2`:`prescale1`}return{img:e,paintWidth:c,paintHeight:l}}_createMaskCanvas(e,t){let n=this.ctx,{width:r,height:i}=t,a=this.current.fillColor,o=this.current.patternFill,s=$w(n),c,l,u,d;if((t.bitmap||t.data)&&t.count>1){let n=t.bitmap||t.data.buffer;l=JSON.stringify(o?s:[s.slice(0,4),a]),c=this._cachedBitmapsMap.get(n),c||(c=new Map,this._cachedBitmapsMap.set(n,c));let r=c.get(l);if(r&&!o){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,jE),{canvas:r,offsetX:t,offsetY:n}}u=r}u||(d=this.cachedCanvases.getCanvas(`maskCanvas`,r,i),eD(d.context,t));let f=Q.transform(s,[1/r,0,0,-1/i,0,0]);f=Q.transform(f,[1,0,0,1,0,-i]);let p=YE.slice();Q.axialAlignedBoundingBox([0,0,r,i],f,p);let[m,h,g,_]=p,v=Math.round(g-m)||1,y=Math.round(_-h)||1,b=this.cachedCanvases.getCanvas(`fillCanvas`,v,y),x=b.context,S=m,C=h;x.translate(-S,-C),x.transform(...f),u||(u=this._scaleImage(d.canvas,eT(x)),u=u.img,c&&o&&c.set(l,u)),x.imageSmoothingEnabled=rD($w(x),t.interpolate),ZE(x,u,0,0,u.width,u.height,0,0,r,i),x.globalCompositeOperation=`source-in`;let w=Q.transform(eT(x),[1,0,0,1,-S,-C]);return x.fillStyle=o?a.getPattern(n,this,w,ME,e):a,x.fillRect(0,0,r,i),c&&!o&&(this.cachedCanvases.delete(`fillCanvas`),c.set(l,b.canvas)),this.dependencyTracker?.recordDependencies(e,jE),{canvas:b.canvas,offsetX:Math.round(S),offsetY:Math.round(C)}}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=iD[t]}setLineJoin(e,t){this.dependencyTracker?.recordSimpleData(`lineJoin`,e),this.ctx.lineJoin=aD[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.tempSMask=null,this.checkSMaskState();break;case`TR`:this.dependencyTracker?.recordSimpleData(`filter`,e),this.ctx.filter=this.current.transferMaps=this.filterFactory.addFilter(r)}}get inSMaskMode(){return!!this.suspendedCtx}checkSMaskState(){let e=this.inSMaskMode;this.current.activeSMask&&!e?this.beginSMaskMode():!this.current.activeSMask&&e&&this.endSMaskMode()}beginSMaskMode(e){if(this.inSMaskMode)throw Error(`beginSMaskMode called while already in smask mode`);let t=this.ctx.canvas.width,n=this.ctx.canvas.height,r=`smaskGroupAt`+this.groupLevel,i=this.cachedCanvases.getCanvas(r,t,n);this.suspendedCtx=this.ctx;let a=this.ctx=i.context;a.setTransform(this.suspendedCtx.getTransform()),tD(this.suspendedCtx,a),function(e,t){if(e._removeMirroring)throw Error(`Context is already forwarding operations.`);e.__originalSave=e.save,e.__originalRestore=e.restore,e.__originalRotate=e.rotate,e.__originalScale=e.scale,e.__originalTranslate=e.translate,e.__originalTransform=e.transform,e.__originalSetTransform=e.setTransform,e.__originalResetTransform=e.resetTransform,e.__originalClip=e.clip,e.__originalMoveTo=e.moveTo,e.__originalLineTo=e.lineTo,e.__originalBezierCurveTo=e.bezierCurveTo,e.__originalRect=e.rect,e.__originalClosePath=e.closePath,e.__originalBeginPath=e.beginPath,e._removeMirroring=()=>{e.save=e.__originalSave,e.restore=e.__originalRestore,e.rotate=e.__originalRotate,e.scale=e.__originalScale,e.translate=e.__originalTranslate,e.transform=e.__originalTransform,e.setTransform=e.__originalSetTransform,e.resetTransform=e.__originalResetTransform,e.clip=e.__originalClip,e.moveTo=e.__originalMoveTo,e.lineTo=e.__originalLineTo,e.bezierCurveTo=e.__originalBezierCurveTo,e.rect=e.__originalRect,e.closePath=e.__originalClosePath,e.beginPath=e.__originalBeginPath,delete e._removeMirroring},e.save=function(){t.save(),this.__originalSave()},e.restore=function(){t.restore(),this.__originalRestore()},e.translate=function(e,n){t.translate(e,n),this.__originalTranslate(e,n)},e.scale=function(e,n){t.scale(e,n),this.__originalScale(e,n)},e.transform=function(e,n,r,i,a,o){t.transform(e,n,r,i,a,o),this.__originalTransform(e,n,r,i,a,o)},e.setTransform=function(e,n,r,i,a,o){t.setTransform(e,n,r,i,a,o),this.__originalSetTransform(e,n,r,i,a,o)},e.resetTransform=function(){t.resetTransform(),this.__originalResetTransform()},e.rotate=function(e){t.rotate(e),this.__originalRotate(e)},e.clip=function(e){t.clip(e),this.__originalClip(e)},e.moveTo=function(e,n){t.moveTo(e,n),this.__originalMoveTo(e,n)},e.lineTo=function(e,n){t.lineTo(e,n),this.__originalLineTo(e,n)},e.bezierCurveTo=function(e,n,r,i,a,o){t.bezierCurveTo(e,n,r,i,a,o),this.__originalBezierCurveTo(e,n,r,i,a,o)},e.rect=function(e,n,r,i){t.rect(e,n,r,i),this.__originalRect(e,n,r,i)},e.closePath=function(){t.closePath(),this.__originalClosePath()},e.beginPath=function(){t.beginPath(),this.__originalBeginPath()}}(a,this.suspendedCtx),this.setGState(e,[[`BM`,`source-over`]])}endSMaskMode(){if(!this.inSMaskMode)throw Error(`endSMaskMode called while not in smask mode`);this.ctx._removeMirroring(),tD(this.ctx,this.suspendedCtx),this.ctx=this.suspendedCtx,this.suspendedCtx=null}compose(e){if(!this.current.activeSMask)return;e?(e[0]=Math.floor(e[0]),e[1]=Math.floor(e[1]),e[2]=Math.ceil(e[2]),e[3]=Math.ceil(e[3])):e=[0,0,this.ctx.canvas.width,this.ctx.canvas.height];let t=this.current.activeSMask,n=this.suspendedCtx;this.composeSMask(n,t,this.ctx,e),this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.clearRect(0,0,this.ctx.canvas.width,this.ctx.canvas.height),this.ctx.restore()}composeSMask(e,t,n,r){let i=r[0],a=r[1],o=r[2]-i,s=r[3]-a;o!==0&&s!==0&&(this.genericComposeSMask(t.context,n,o,s,t.subtype,t.backdrop,t.transferMap,i,a,t.offsetX,t.offsetY),e.save(),e.globalAlpha=1,e.globalCompositeOperation=`source-over`,e.setTransform(1,0,0,1,0,0),e.drawImage(n.canvas,0,0),e.restore())}genericComposeSMask(e,t,n,r,i,a,o,s,c,l,u){let d=e.canvas,f=s-l,p=c-u;if(a)if(f<0||p<0||f+n>d.width||p+r>d.height){let e=this.cachedCanvases.getCanvas(`maskExtension`,n,r),t=e.context;t.drawImage(d,-f,-p),t.globalCompositeOperation=`destination-atop`,t.fillStyle=a,t.fillRect(0,0,n,r),t.globalCompositeOperation=`source-over`,d=e.canvas,f=p=0}else{e.save(),e.globalAlpha=1,e.setTransform(1,0,0,1,0,0);let t=new Path2D;t.rect(f,p,n,r),e.clip(t),e.globalCompositeOperation=`destination-atop`,e.fillStyle=a,e.fillRect(f,p,n,r),e.restore()}t.save(),t.globalAlpha=1,t.setTransform(1,0,0,1,0,0),i===`Alpha`&&o?t.filter=this.filterFactory.addAlphaFilter(o):i===`Luminosity`&&(t.filter=this.filterFactory.addLuminosityFilter(o));let m=new Path2D;m.rect(s,c,n,r),t.clip(m),t.globalCompositeOperation=`destination-in`,t.drawImage(d,f,p,n,r,s,c,n,r),t.restore()}save(e){this.inSMaskMode&&tD(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&&tD(this.suspendedCtx,this.ctx),this.checkSMaskState(),this.pendingClip=null,this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null)}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,this._cachedGetSinglePixelWidth=null}constructPath(e,t,n,r){let[i]=n;if(!r)return i||=n[0]=new Path2D,void this[t](e,i);if(this.dependencyTracker!==null){let n=t===tw.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`])}if(!(i instanceof Path2D)){let e=n[0]=new Path2D;for(let t=0,n=i.length;t<n;)switch(i[t++]){case nw:e.moveTo(i[t++],i[t++]);break;case rw:e.lineTo(i[t++],i[t++]);break;case iw:e.bezierCurveTo(i[t++],i[t++],i[t++],i[t++],i[t++],i[t++]);break;case aw:e.closePath();break;default:dw(`Unrecognized drawing path operator: ${i[t-1]}`)}i=e}Q.axialAlignedBoundingBox(r,$w(this.ctx),this.current.minMax),this[t](e,i),this._pathStartIdx=e}closePath(e){this.ctx.closePath()}stroke(e,t,n=!0){let r=this.ctx,i=this.current.strokeColor;if(r.globalAlpha=this.current.strokeAlpha,this.contentVisible)if(typeof i==`object`&&i?.getPattern){let n=i.isModifyingCurrentTransform()?r.getTransform():null;if(r.save(),r.strokeStyle=i.getPattern(r,this,eT(r),NE,e),n){let e=new Path2D;e.addPath(t,r.getTransform().invertSelf().multiplySelf(n)),t=e}this.rescaleAndStroke(t,!1),r.restore()}else this.rescaleAndStroke(t,!0);this.dependencyTracker?.recordDependencies(e,TE),n&&this.consumePath(e,t,this.current.getClippedPathBoundingBox(NE,$w(this.ctx))),r.globalAlpha=this.current.fillAlpha}closeStroke(e,t){this.stroke(e,t)}fill(e,t,n=!0){let r=this.ctx,i=this.current.fillColor,a=!1;if(this.current.patternFill){let n=i.isModifyingCurrentTransform()?r.getTransform():null;if(this.dependencyTracker?.save(e),r.save(),r.fillStyle=i.getPattern(r,this,eT(r),ME,e),n){let e=new Path2D;e.addPath(t,r.getTransform().invertSelf().multiplySelf(n)),t=e}a=!0}let o=this.current.getClippedPathBoundingBox();this.contentVisible&&o!==null&&(this.pendingEOFill?(r.fill(t,`evenodd`),this.pendingEOFill=!1):r.fill(t)),this.dependencyTracker?.recordDependencies(e,EE),a&&(r.restore(),this.dependencyTracker?.restore(e)),n&&this.consumePath(e,t,o)}eoFill(e,t){this.pendingEOFill=!0,this.fill(e,t)}fillStroke(e,t){this.fill(e,t,!1),this.stroke(e,t,!1),this.consumePath(e,t)}eoFillStroke(e,t){this.pendingEOFill=!0,this.fillStroke(e,t)}closeFillStroke(e,t){this.fillStroke(e,t)}closeEOFillStroke(e,t){this.pendingEOFill=!0,this.fillStroke(e,t)}endPath(e,t){this.consumePath(e,t)}rawFillPath(e,t){this.ctx.fill(t),this.dependencyTracker?.recordDependencies(e,OE).recordOperation(e)}clip(e){this.dependencyTracker?.recordFutureForcedDependency(`clipMode`,e),this.pendingClip=oD}eoClip(e){this.dependencyTracker?.recordFutureForcedDependency(`clipMode`,e),this.pendingClip=sD}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||EC,i.fontMatrix[0]!==0&&i.fontMatrix[3]!==0||dw(`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=n;n<16?l=16:n>100&&(l=100),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?.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)}#n(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&GC,f=!!(l&KC),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)){let t;if(o.save(),o.translate(n,r),o.scale(u,-u),this.dependencyTracker?.recordCharacterBBox(e,o,c),d===VC||d===UC)if(i){t=o.getTransform(),o.setTransform(...i);let e=this.#n(h,t,i);o.fill(e)}else o.fill(h);if(d===HC||d===UC)if(a){t||=o.getTransform(),o.setTransform(...a);let{a:e,b:n,c:r,d:i}=t,s=Q.inverseTransform(a),c=Q.transform([e,n,r,i,0,0],s);Q.singularValueDecompose2dScale(c,JE),o.lineWidth*=Math.max(JE[0],JE[1])/u,o.stroke(this.#n(h,t,a))}else o.lineWidth/=u,o.stroke(h);o.restore()}else d!==VC&&d!==UC||(o.fillText(t,n,r),this.dependencyTracker?.recordCharacterBBox(e,o,c,u,n,r,()=>o.measureText(t))),d!==HC&&d!==UC||(this.dependencyTracker&&this.dependencyTracker?.recordCharacterBBox(e,o,c,u,n,r,()=>o.measureText(t)).recordDependencies(e,TE),o.strokeText(t,n,r));f&&((this.pendingTextPaths||=[]).push({transform:$w(o),x:n,y:r,fontSize:u,path:h}),this.dependencyTracker?.recordCharacterBBox(e,o,c,u,n,r))}get isFontSubpixelAAEnabled(){let{context:e}=this.cachedCanvases.getCanvas(`isFontSubpixelAAEnabled`,10,10);e.scale(1.5,1),e.fillText(`I`,0,10);let t=e.getImageData(0,0,10,10).data,n=!1;for(let e=3;e<t.length;e+=4)if(t[e]>0&&t[e]<255){n=!0;break}return gw(this,`isFontSubpixelAAEnabled`,n)}showText(e,t){this.dependencyTracker&&(this.dependencyTracker.recordDependencies(e,kE).resetBBox(e),this.current.textRenderingMode&KC&&this.dependencyTracker.recordFutureForcedDependency(`textClip`,e).inheritPendingDependenciesAsFutureForcedDependencies());let n=this.current,r=n.font;if(r.isType3Font)return this.showType3Text(e,t),void this.dependencyTracker?.recordShowTextOperation(e);let i=n.fontSize;if(i===0)return void this.dependencyTracker?.recordOperation(e);let a=this.ctx,o=n.fontSizeScale,s=n.charSpacing,c=n.wordSpacing,l=n.fontDirection,u=n.textHScale*l,d=t.length,f=r.vertical,p=f?1:-1,m=r.defaultVMetrics,h=i*n.fontMatrix[0],g=n.textRenderingMode===VC&&!r.disableFontFace&&!n.patternFill,_,v;if(a.save(),n.textMatrix&&a.transform(...n.textMatrix),a.translate(n.x,n.y+n.textRise),l>0?a.scale(u,-1):a.scale(u,1),n.patternFill){a.save();let t=n.fillColor.getPattern(a,this,eT(a),ME,e);_=$w(a),a.restore(),a.fillStyle=t}if(n.patternStroke){a.save();let t=n.strokeColor.getPattern(a,this,eT(a),NE,e);v=$w(a),a.restore(),a.strokeStyle=t}let y=n.lineWidth,b=n.textMatrixScale;if(b===0||y===0){let e=n.textRenderingMode&GC;e!==HC&&e!==UC||(y=this.getSinglePixelWidth())}else y/=b;if(o!==1&&(a.scale(o,o),y/=o),a.lineWidth=y,r.isInvalidPDFjsFont){let r=[],i=0;for(let e of t)r.push(e.unicode),i+=e.width;let o=r.join(``);if(a.fillText(o,0,0),this.dependencyTracker!==null){let t=a.measureText(o);this.dependencyTracker.recordBBox(e,this.ctx,-t.actualBoundingBoxLeft,t.actualBoundingBoxRight,-t.actualBoundingBoxAscent,t.actualBoundingBoxDescent).recordShowTextOperation(e)}n.x+=i*h*u,a.restore(),this.compose();return}let x,S=0;for(x=0;x<d;++x){let n=t[x];if(typeof n==`number`){S+=p*n*i/1e3;continue}let u=!1,d=(n.isSpace?c:0)+s,y=n.fontChar,b=n.accent,C,w,T,E=n.width;if(f){let e=n.vmetric||m,t=-(n.vmetric?e[1]:.5*E)*h,r=e[2]*h;E=e?-e[0]:E,C=t/o,w=(S+r)/o}else C=S/o,w=0;if(r.remeasure&&E>0){T=a.measureText(y);let e=1e3*T.width/i*o;if(E<e&&this.isFontSubpixelAAEnabled){let t=E/e;u=!0,a.save(),a.scale(t,1),C/=t}else E!==e&&(C+=(E-e)/2e3*i/o)}if(this.contentVisible&&(n.isInFont||r.missingFile)){if(g&&!b)a.fillText(y,C,w),this.dependencyTracker?.recordCharacterBBox(e,a,T?{bbox:null}:r,i/o,C,w,()=>T??a.measureText(y));else if(this.paintChar(e,y,C,w,_,v),b){let t=C+i*b.offset.x/o,n=w-i*b.offset.y/o;this.paintChar(e,b.fontChar,t,n,_,v)}}S+=f?E*h-d*l:E*h+d*l,u&&a.restore()}f?n.y-=S:n.x+=S*u,a.restore(),this.compose(),this.dependencyTracker?.recordShowTextOperation(e)}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||EC,f=t.length,p,m,h,g;if(r.textRenderingMode===WC||a===0)return;this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null,n.save(),r.textMatrix&&n.transform(...r.textMatrix),n.translate(r.x,r.y+r.textRise),n.scale(u,o);let _=this.dependencyTracker;for(this.dependencyTracker=_?new wE(_,e):null,p=0;p<f;++p){if(m=t[p],typeof m==`number`){g=s*m*a/1e3,this.ctx.translate(g,0),r.x+=g*u;continue}let e=(m.isSpace?l:0)+c,o=i.charProcOperatorList[m.operatorListId];o?this.contentVisible&&(this.save(),n.scale(a,a),n.transform(...d),this.executeOperatorList(o),this.restore()):dw(`Type3 character "${m.operatorListId}" is not available.`);let f=[m.width,0];Q.applyTransform(f,d),h=f[0]*a+e,n.translate(h,0),r.x+=h*u}n.restore(),_&&(this.dependencyTracker=_)}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||$w(this.ctx);r=new WE(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 wE(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),this.current.fillColor=this.getColorN_Pattern(e,t),this.current.patternFill=!0}setStrokeRGBColor(e,t){this.dependencyTracker?.recordSimpleData(`strokeColor`,e),this.ctx.strokeStyle=this.current.strokeColor=t,this.current.patternStroke=!1}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.ctx.fillStyle=this.current.fillColor=t,this.current.patternFill=!1}setFillTransparent(e){this.dependencyTracker?.recordSimpleData(`fillColor`,e),this.ctx.fillStyle=this.current.fillColor=`transparent`,this.current.patternFill=!1}_getPattern(e,t,n=null){let r;return this.cachedPatterns.has(t)?r=this.cachedPatterns.get(t):(r=function(e){switch(e[0]){case`RadialAxial`:return new LE(e);case`Mesh`:return new BE(e);case`Dummy`:return new VE}throw Error(`Unknown IR type: ${e[0]}`)}(this.getObject(e,t)),this.cachedPatterns.set(t,r)),n&&(r.matrix=n),r}shadingFill(e,t){if(!this.contentVisible)return;let n=this.ctx;this.save(e),n.fillStyle=this._getPattern(e,t).getPattern(n,this,eT(n),PE,e);let r=eT(n);if(r){let{width:e,height:t}=n.canvas,i=YE.slice();Q.axialAlignedBoundingBox([0,0,e,t],r,i);let[a,o,s,c]=i;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,AE).recordDependencies(e,EE).recordOperation(e),this.compose(this.current.getClippedPathBoundingBox()),this.restore(e)}beginInlineImage(){fw(`Should not call beginInlineImage`)}beginImageData(){fw(`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=$w(this.ctx),n)){Q.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),this.inSMaskMode&&(this.endSMaskMode(),this.current.activeSMask=null);let n=this.ctx;t.isolated||uw(`TODO: Support non-isolated groups.`),t.knockout&&dw(`Knockout groups not supported.`);let r=$w(n);if(t.matrix&&n.transform(...t.matrix),!t.bbox)throw Error(`Bounding box is required.`);let i=YE.slice();Q.axialAlignedBoundingBox(t.bbox,$w(n),i);let a=[0,0,n.canvas.width,n.canvas.height];i=Q.intersect(i,a)||[0,0,0,0];let o=Math.floor(i[0]),s=Math.floor(i[1]),c=Math.max(Math.ceil(i[2])-o,1),l=Math.max(Math.ceil(i[3])-s,1);this.current.startNewPathAndClipBox([0,0,c,l]);let u=`groupAt`+this.groupLevel;t.smask&&(u+=`_smask_`+ this.smaskCounter++%2);let d=this.cachedCanvases.getCanvas(u,c,l),f=d.context;f.translate(-o,-s),f.transform(...r);let p=new Path2D,[m,h,g,_]=t.bbox;if(p.rect(m,h,g-m,_-h),t.matrix){let e=new Path2D;e.addPath(p,new DOMMatrix(t.matrix)),p=e}f.clip(p),t.smask&&this.smaskStack.push({canvas:d.canvas,context:f,offsetX:o,offsetY:s,subtype:t.smask.subtype,backdrop:t.smask.backdrop,transferMap:t.smask.transferMap||null,startTransformInverse:null}),t.smask&&!this.dependencyTracker||(n.setTransform(1,0,0,1,0,0),n.translate(o,s),n.save()),tD(n,f),this.ctx=f,this.dependencyTracker?.inheritSimpleDataAsFutureForcedDependencies([`fillAlpha`,`strokeAlpha`,`globalCompositeOperation`]).pushBaseTransform(n),this.setGState(e,[[`BM`,`source-over`],[`ca`,1],[`CA`,1]]),this.groupStack.push(n),this.groupLevel++}endGroup(e,t){if(!this.contentVisible)return;this.groupLevel--;let n=this.ctx,r=this.groupStack.pop();if(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();else{this.ctx.restore();let t=$w(this.ctx);this.restore(e),this.ctx.save(),this.ctx.setTransform(...t);let r=YE.slice();Q.axialAlignedBoundingBox([0,0,n.canvas.width,n.canvas.height],t,r),this.ctx.drawImage(n.canvas,0,0),this.ctx.restore(),this.compose(r)}}beginAnnotation(e,t,n,r,i,a){if(this.#e(),nD(this.ctx),this.ctx.save(),this.save(e),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),n){let i=n[2]-n[0],o=n[3]-n[1];if(a&&this.annotationCanvasMap){(r=r.slice())[4]-=n[0],r[5]-=n[1],(n=n.slice())[0]=n[1]=0,n[2]=i,n[3]=o,Q.singularValueDecompose2dScale($w(this.ctx),JE);let{viewportScale:e}=this,a=Math.ceil(i*this.outputScaleX*e),s=Math.ceil(o*this.outputScaleY*e);this.annotationCanvas=this.canvasFactory.create(a,s);let{canvas:c,context:l}=this.annotationCanvas;this.annotationCanvasMap.set(t,c),this.annotationCanvas.savedCtx=this.ctx,this.ctx=l,this.ctx.save(),this.ctx.setTransform(JE[0],0,0,-JE[1],0,o*JE[1]),nD(this.ctx)}else{nD(this.ctx),this.endPath(e);let t=new Path2D;t.rect(n[0],n[1],i,o),this.ctx.clip(t)}}this.current=new QE(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(e,...r),this.transform(e,...i)}endAnnotation(e){this.annotationCanvas&&(this.ctx.restore(),this.#t(),this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas)}paintImageMaskXObject(e,t){if(!this.contentVisible)return;let n=t.count;(t=this.getObject(e,t.data,t)).count=n;let r=this.ctx,i=this._createMaskCanvas(e,t),a=i.canvas;r.save(),r.setTransform(1,0,0,1,0,0),r.drawImage(a,i.offsetX,i.offsetY),this.dependencyTracker?.resetBBox(e).recordBBox(e,this.ctx,i.offsetX,i.offsetX+a.width,i.offsetY,i.offsetY+a.height).recordOperation(e),r.restore(),this.compose()}paintImageMaskXObjectRepeat(e,t,n,r=0,i=0,a,o){if(!this.contentVisible)return;t=this.getObject(e,t.data,t);let s=this.ctx;s.save();let c=$w(s);s.transform(n,r,i,a,0,0);let l=this._createMaskCanvas(e,t);s.setTransform(1,0,0,1,l.offsetX-c[4],l.offsetY-c[5]),this.dependencyTracker?.resetBBox(e);for(let t=0,u=o.length;t<u;t+=2){let u=Q.transform(c,[n,r,i,a,o[t],o[t+1]]);s.drawImage(l.canvas,u[4],u[5]),this.dependencyTracker?.recordBBox(e,this.ctx,u[4],u[4]+l.canvas.width,u[5],u[5]+l.canvas.height)}s.restore(),this.compose(),this.dependencyTracker?.recordOperation(e)}paintImageMaskXObjectGroup(e,t){if(!this.contentVisible)return;let n=this.ctx,r=this.current.fillColor,i=this.current.patternFill;this.dependencyTracker?.resetBBox(e).recordDependencies(e,jE);for(let a of t){let{data:t,width:o,height:s,transform:c}=a,l=this.cachedCanvases.getCanvas(`maskCanvas`,o,s),u=l.context;u.save(),eD(u,this.getObject(e,t,a)),u.globalCompositeOperation=`source-in`,u.fillStyle=i?r.getPattern(u,this,eT(n),ME,e):r,u.fillRect(0,0,o,s),u.restore(),n.save(),n.transform(...c),n.scale(1,-1),ZE(n,l.canvas,0,0,o,s,0,-1,1,1),this.dependencyTracker?.recordBBox(e,n,0,o,0,s),n.restore()}this.compose(),this.dependencyTracker?.recordOperation(e)}paintImageXObject(e,t){if(!this.contentVisible)return;let n=this.getObject(e,t);n?this.paintInlineImageXObject(e,n):dw(`Dependent image isn't ready yet`)}paintImageXObjectRepeat(e,t,n,r,i){if(!this.contentVisible)return;let a=this.getObject(e,t);if(!a)return void dw(`Dependent image isn't ready yet`);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`&&(e.filter=this.current.transferMaps,e.drawImage(e.canvas,0,0),e.filter=`none`),e.canvas}applyTransferMapsToBitmap(e){if(this.current.transferMaps===`none`)return e.bitmap;let{bitmap:t,width:n,height:r}=e,i=this.cachedCanvases.getCanvas(`inlineImage`,n,r),a=i.context;return a.filter=this.current.transferMaps,a.drawImage(t,0,0),a.filter=`none`,i.canvas}paintInlineImageXObject(e,t){if(!this.contentVisible)return;let n=t.width,r=t.height,i=this.ctx;this.save(e);let{filter:a}=i,o;if(a!==`none`&&a!==``&&(i.filter=`none`),i.scale(1/n,-1/r),t.bitmap)o=this.applyTransferMapsToBitmap(t);else if(typeof HTMLElement==`function`&&t instanceof HTMLElement||!t.data)o=t;else{let e=this.cachedCanvases.getCanvas(`inlineImage`,n,r).context;$E(e,t),o=this.applyTransferMapsToCanvas(e)}let s=this._scaleImage(o,eT(i));i.imageSmoothingEnabled=rD($w(i),t.interpolate),this.dependencyTracker?.resetBBox(e).recordBBox(e,i,0,n,-r,0).recordDependencies(e,DE).recordOperation(e),ZE(i,s.img,0,0,s.paintWidth,s.paintHeight,0,-r,n,r),this.compose(),this.restore(e)}paintInlineImageXObjectGroup(e,t,n){if(!this.contentVisible)return;let r=this.ctx,i;if(t.bitmap)i=t.bitmap;else{let e=t.width,n=t.height,r=this.cachedCanvases.getCanvas(`inlineImage`,e,n).context;$E(r,t),i=this.applyTransferMapsToCanvas(r)}this.dependencyTracker?.resetBBox(e);for(let t of n)r.save(),r.transform(...t.transform),r.scale(1,-1),ZE(r,i,t.x,t.y,t.w,t.h,0,-1,1,1),this.dependencyTracker?.recordBBox(e,r,0,1,-1,0),r.restore();this.dependencyTracker?.recordOperation(e),this.compose()}paintSolidColorImageMask(e){this.contentVisible&&(this.dependencyTracker?.resetBBox(e).recordBBox(e,this.ctx,0,1,0,1).recordDependencies(e,EE).recordOperation(e),this.ctx.fillRect(0,0,1,1),this.compose())}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===sD?i.clip(t,`evenodd`):i.clip(t)),this.pendingClip=null,this.dependencyTracker?.bboxToClipBoxDropOperation(e).recordFutureForcedDependency(`clipPath`,e)):this.dependencyTracker?.recordOperation(e),this.current.startNewPathAndClipBox(this.current.clipBox)}getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){let e=$w(this.ctx);if(e[1]===0&&e[2]===0)this._cachedGetSinglePixelWidth=1/Math.min(Math.abs(e[0]),Math.abs(e[3]));else{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]);this._cachedGetSinglePixelWidth=Math.max(n,r)/t}}return this._cachedGetSinglePixelWidth}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(e,t){let{ctx:n,current:{lineWidth:r}}=this,[i,a]=this.getScaleForStroking();if(i===a)return n.lineWidth=(r||1)*i,void n.stroke(e);let o=n.getLineDash();t&&n.save(),n.scale(i,a),qE.a=1/i,qE.d=1/a;let s=new Path2D;if(s.addPath(e,qE),o.length>0){let e=Math.max(i,a);n.setLineDash(o.map(t=>t/e)),n.lineDashOffset/=e}n.lineWidth=r||1,n.stroke(s),t&&n.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 tw)cD.prototype[e]!==void 0&&(cD.prototype[tw[e]]=cD.prototype[e]);var lD=class e{#e;#t;#n;static strings=[`fontFamily`,`fontWeight`,`italicAngle`];static write(t){let n=new TextEncoder,r={},i=0;for(let a of e.strings){let e=n.encode(t[a]);r[a]=e,i+=4+e.length}let a=new ArrayBuffer(i),o=new Uint8Array(a),s=new DataView(a),c=0;for(let t of e.strings){let e=r[t],n=e.length;s.setUint32(c,n),o.set(e,c+4),c+=4+n}return pw(c===a.byteLength,`CssFontInfo.write: Buffer overflow`),a}constructor(e){this.#e=e,this.#t=new DataView(this.#e),this.#n=new TextDecoder}#r(t){pw(t<e.strings.length,`Invalid string index`);let n=0;for(let e=0;e<t;e++)n+=this.#t.getUint32(n)+4;let r=this.#t.getUint32(n);return this.#n.decode(new Uint8Array(this.#e,n+4,r))}get fontFamily(){return this.#r(0)}get fontWeight(){return this.#r(1)}get italicAngle(){return this.#r(2)}},uD=class e{#e;#t;#n;static strings=[`css`,`loadedName`,`baseFontName`,`src`];static write(t){let n=new TextEncoder,r={},i=0;for(let a of e.strings){let e=n.encode(t[a]);r[a]=e,i+=4+e.length}i+=4;let a,o,s=1+i;t.style&&(a=n.encode(t.style.style),o=n.encode(t.style.weight),s+=4+a.length+4+o.length);let c=new ArrayBuffer(s),l=new Uint8Array(c),u=new DataView(c),d=0;u.setUint8(d++,+!!t.guessFallback),u.setUint32(d,0),d+=4,i=0;for(let t of e.strings){let e=r[t],n=e.length;i+=4+n,u.setUint32(d,n),l.set(e,d+4),d+=4+n}return u.setUint32(d-i-4,i),t.style&&(u.setUint32(d,a.length),l.set(a,d+4),d+=4+a.length,u.setUint32(d,o.length),l.set(o,d+4),d+=4+o.length),pw(d<=c.byteLength,`SubstitionInfo.write: Buffer overflow`),c.transferToFixedLength(d)}constructor(e){this.#e=e,this.#t=new DataView(this.#e),this.#n=new TextDecoder}get guessFallback(){return this.#t.getUint8(0)!==0}#r(t){pw(t<e.strings.length,`Invalid string index`);let n=5;for(let e=0;e<t;e++)n+=this.#t.getUint32(n)+4;let r=this.#t.getUint32(n);return this.#n.decode(new Uint8Array(this.#e,n+4,r))}get css(){return this.#r(0)}get loadedName(){return this.#r(1)}get baseFontName(){return this.#r(2)}get src(){return this.#r(3)}get style(){let e=1;e+=4+this.#t.getUint32(e);let t=this.#t.getUint32(e),n=this.#n.decode(new Uint8Array(this.#e,e+4,t));e+=4+t;let r=this.#t.getUint32(e);return{style:n,weight:this.#n.decode(new Uint8Array(this.#e,e+4,r))}}},dD=class e{static bools=[`black`,`bold`,`disableFontFace`,`fontExtraProperties`,`isInvalidPDFjsFont`,`isType3Font`,`italic`,`missingFile`,`remeasure`,`vertical`];static numbers=[`ascent`,`defaultWidth`,`descent`];static strings=[`fallbackName`,`loadedName`,`mimetype`,`name`];static#e=Math.ceil(2*this.bools.length/8);static#t=this.#e+8*this.numbers.length;static#n=this.#t+1+8;static#r=this.#n+1+48;static#i=this.#r+1+6;#a;#o;#s;constructor({data:e,extra:t}){this.#a=e,this.#o=new TextDecoder,this.#s=new DataView(this.#a),t&&Object.assign(this,t)}#c(t){pw(t<e.bools.length,`Invalid boolean index`);let n=Math.floor(t/4),r=2*t%8,i=this.#s.getUint8(n)>>r&3;return i===0?void 0:i===2}get black(){return this.#c(0)}get bold(){return this.#c(1)}get disableFontFace(){return this.#c(2)}get fontExtraProperties(){return this.#c(3)}get isInvalidPDFjsFont(){return this.#c(4)}get isType3Font(){return this.#c(5)}get italic(){return this.#c(6)}get missingFile(){return this.#c(7)}get remeasure(){return this.#c(8)}get vertical(){return this.#c(9)}#l(t){return pw(t<e.numbers.length,`Invalid number index`),this.#s.getFloat64(e.#e+8*t)}get ascent(){return this.#l(0)}get defaultWidth(){return this.#l(1)}get descent(){return this.#l(2)}get bbox(){let t=e.#t;if(this.#s.getUint8(t)===0)return;t+=1;let n=[];for(let e=0;e<4;e++)n.push(this.#s.getInt16(t,!0)),t+=2;return n}get fontMatrix(){let t=e.#n;if(this.#s.getUint8(t)===0)return;t+=1;let n=[];for(let e=0;e<6;e++)n.push(this.#s.getFloat64(t,!0)),t+=8;return n}get defaultVMetrics(){let t=e.#r;if(this.#s.getUint8(t)===0)return;t+=1;let n=[];for(let e=0;e<3;e++)n.push(this.#s.getInt16(t,!0)),t+=2;return n}#u(t){pw(t<e.strings.length,`Invalid string index`);let n=e.#i+4;for(let e=0;e<t;e++)n+=this.#s.getUint32(n)+4;let r=this.#s.getUint32(n),i=new Uint8Array(r);return i.set(new Uint8Array(this.#a,n+4,r)),this.#o.decode(i)}get fallbackName(){return this.#u(0)}get loadedName(){return this.#u(1)}get mimetype(){return this.#u(2)}get name(){return this.#u(3)}get data(){let t=e.#i;t+=4+this.#s.getUint32(t),t+=4+this.#s.getUint32(t),t+=4+this.#s.getUint32(t);let n=this.#s.getUint32(t);if(n!==0)return new Uint8Array(this.#a,t+4,n)}clearData(){let t=e.#i;t+=4+this.#s.getUint32(t),t+=4+this.#s.getUint32(t),t+=4+this.#s.getUint32(t);let n=this.#s.getUint32(t);new Uint8Array(this.#a,t+4,n).fill(0),this.#s.setUint32(t,0)}get cssFontInfo(){let t=e.#i;t+=4+this.#s.getUint32(t),t+=4+this.#s.getUint32(t);let n=this.#s.getUint32(t);if(n===0)return null;let r=new Uint8Array(n);return r.set(new Uint8Array(this.#a,t+4,n)),new lD(r.buffer)}get systemFontInfo(){let t=e.#i;t+=4+this.#s.getUint32(t);let n=this.#s.getUint32(t);if(n===0)return null;let r=new Uint8Array(n);return r.set(new Uint8Array(this.#a,t+4,n)),new uD(r.buffer)}static write(t){let n=t.systemFontInfo?uD.write(t.systemFontInfo):null,r=t.cssFontInfo?lD.write(t.cssFontInfo):null,i=new TextEncoder,a={},o=0;for(let n of e.strings)a[n]=i.encode(t[n]),o+=4+a[n].length;let s=e.#i+4+o+4+(n?n.byteLength:0)+4+(r?r.byteLength:0)+4+(t.data?t.data.length:0),c=new ArrayBuffer(s),l=new Uint8Array(c),u=new DataView(c),d=0,f=e.bools.length,p=0,m=0;for(let n=0;n<f;n++){let r=t[e.bools[n]];p|=(r===void 0?0:r?2:1)<<m,m+=2,m!==8&&n!==f-1||(u.setUint8(d++,p),p=0,m=0)}pw(d===e.#e,`FontInfo.write: Boolean properties offset mismatch`);for(let n of e.numbers)u.setFloat64(d,t[n]),d+=8;if(pw(d===e.#t,`FontInfo.write: Number properties offset mismatch`),t.bbox){u.setUint8(d++,4);for(let e of t.bbox)u.setInt16(d,e,!0),d+=2}else u.setUint8(d++,0),d+=8;if(pw(d===e.#n,`FontInfo.write: BBox properties offset mismatch`),t.fontMatrix){u.setUint8(d++,6);for(let e of t.fontMatrix)u.setFloat64(d,e,!0),d+=8}else u.setUint8(d++,0),d+=48;if(pw(d===e.#r,`FontInfo.write: FontMatrix properties offset mismatch`),t.defaultVMetrics){u.setUint8(d++,1);for(let e of t.defaultVMetrics)u.setInt16(d,e,!0),d+=2}else u.setUint8(d++,0),d+=6;pw(d===e.#i,`FontInfo.write: DefaultVMetrics properties offset mismatch`),u.setUint32(e.#i,0),d+=4;for(let t of e.strings){let e=a[t],n=e.length;u.setUint32(d,n),l.set(e,d+4),d+=4+n}if(u.setUint32(e.#i,d-e.#i-4),n){let e=n.byteLength;u.setUint32(d,e),pw(d+4+e<=c.byteLength,`FontInfo.write: Buffer overflow at systemFontInfo`),l.set(new Uint8Array(n),d+4),d+=4+e}else u.setUint32(d,0),d+=4;if(r){let e=r.byteLength;u.setUint32(d,e),pw(d+4+e<=c.byteLength,`FontInfo.write: Buffer overflow at cssFontInfo`),l.set(new Uint8Array(r),d+4),d+=4+e}else u.setUint32(d,0),d+=4;return t.data===void 0?(u.setUint32(d,0),d+=4):(u.setUint32(d,t.data.length),l.set(t.data,d+4),d+=4+t.data.length),pw(d<=c.byteLength,`FontInfo.write: Buffer overflow`),c.transferToFixedLength(d)}},fD=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}},pD=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()}},mD=Symbol(`INTERNAL`),hD=class{#e=!1;#t=!1;#n=!1;#r=!0;constructor(e,{name:t,intent:n,usage:r,rbGroups:i}){this.#e=!!(e&kC),this.#t=!!(e&AC),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!==mD&&fw("Internal method `_setVisible` called."),this.#n=n,this.#r=t}},gD=class{#e=null;#t=new Map;#n=null;#r=null;constructor(e,t=kC){if(this.renderingIntent=t,this.name=null,this.creator=null,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 hD(t,n));if(e.baseState===`OFF`)for(let e of this.#t.values())e._setVisible(mD,!1);for(let t of e.on)this.#t.get(t)._setVisible(mD,!0);for(let t of e.off)this.#t.get(t)._setVisible(mD,!1);this.#n=this.getHash()}}#i(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.#i(t);else{if(!this.#t.has(t))return dw(`Optional content group not found: ${t}`),!0;i=this.#t.get(t).visible}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 uw(`Optional content group not defined.`),!0;if(e.type===`OCG`)return this.#t.has(e.id)?this.#t.get(e.id).visible:(dw(`Optional content group not found: ${e.id}`),!0);if(e.type===`OCMD`){if(e.expression)return this.#i(e.expression);if(!e.policy||e.policy===`AnyOn`){for(let t of e.ids){if(!this.#t.has(t))return dw(`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 dw(`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 dw(`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 dw(`Optional content group not found: ${t}`),!0;if(this.#t.get(t).visible)return!1}return!0}return dw(`Unknown optional content policy ${e.policy}.`),!0}return dw(`Unknown group type ${e.type}.`),!0}setVisibility(e,t=!0,n=!0){let r=this.#t.get(e);if(r){if(n&&t&&r.rbGroups.length)for(let t of r.rbGroups)for(let n of t)n!==e&&this.#t.get(n)?._setVisible(mD,!1,!0);r._setVisible(mD,!!t,!0),this.#e=null}else dw(`Optional content group not found: ${e}`)}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 jT;for(let[t,n]of this.#t)e.update(`${t}:${n.visible}`);return this.#e=e.hexdigest()}[Symbol.iterator](){return this.#t.entries()}},_D=class{constructor(e,{disableRange:t=!1,disableStream:n=!1}){pw(e,`PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.`);let{length:r,initialData:i,progressiveDone:a,contentDispositionFilename:o}=e;if(this._queuedChunks=[],this._progressiveDone=a,this._contentDispositionFilename=o,i?.length>0){let e=i instanceof Uint8Array&&i.byteLength===i.buffer.byteLength?i.buffer:new Uint8Array(i).buffer;this._queuedChunks.push(e)}this._pdfDataRangeTransport=e,this._isStreamingSupported=!n,this._isRangeSupported=!t,this._contentLength=r,this._fullRequestReader=null,this._rangeReaders=[],e.addRangeListener((e,t)=>{this._onReceiveData({begin:e,chunk:t})}),e.addProgressListener((e,t)=>{this._onProgress({loaded:e,total:t})}),e.addProgressiveReadListener(e=>{this._onReceiveData({chunk:e})}),e.addProgressiveDoneListener(()=>{this._onProgressiveDone()}),e.transportReady()}_onReceiveData({begin:e,chunk:t}){let n=t instanceof Uint8Array&&t.byteLength===t.buffer.byteLength?t.buffer:new Uint8Array(t).buffer;e===void 0?this._fullRequestReader?this._fullRequestReader._enqueue(n):this._queuedChunks.push(n):pw(this._rangeReaders.some(function(t){return t._begin===e&&(t._enqueue(n),!0)}),"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}_onProgress(e){e.total===void 0?this._rangeReaders[0]?.onProgress?.({loaded:e.loaded}):this._fullRequestReader?.onProgress?.({loaded:e.loaded,total:e.total})}_onProgressiveDone(){this._fullRequestReader?.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(e){let t=this._rangeReaders.indexOf(e);t>=0&&this._rangeReaders.splice(t,1)}getFullReader(){pw(!this._fullRequestReader,`PDFDataTransportStream.getFullReader can only be called once.`);let e=this._queuedChunks;return this._queuedChunks=null,new vD(this,e,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(e,t){if(t<=this._progressiveDataLength)return null;let n=new yD(this,e,t);return this._pdfDataRangeTransport.requestDataRange(e,t),this._rangeReaders.push(n),n}cancelAllRequests(e){this._fullRequestReader?.cancel(e);for(let t of this._rangeReaders.slice(0))t.cancel(e);this._pdfDataRangeTransport.abort()}},vD=class{constructor(e,t,n=!1,r=null){this._stream=e,this._done=n||!1,this._filename=Uw(r)?r:null,this._queuedChunks=t||[],this._loaded=0;for(let e of this._queuedChunks)this._loaded+=e.byteLength;this._requests=[],this._headersReady=Promise.resolve(),e._fullRequestReader=this,this.onProgress=null}_enqueue(e){this._done||(this._requests.length>0?this._requests.shift().resolve({value:e,done:!1}):this._queuedChunks.push(e),this._loaded+=e.byteLength)}get headersReady(){return this._headersReady}get filename(){return this._filename}get isRangeSupported(){return this._stream._isRangeSupported}get isStreamingSupported(){return this._stream._isStreamingSupported}get contentLength(){return this._stream._contentLength}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;for(let e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0}progressiveDone(){this._done||=!0}},yD=class{constructor(e,t,n){this._stream=e,this._begin=t,this._end=n,this._queuedChunk=null,this._requests=[],this._done=!1,this.onProgress=null}_enqueue(e){if(!this._done){if(this._requests.length===0)this._queuedChunk=e;else{this._requests.shift().resolve({value:e,done:!1});for(let e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0}this._done=!0,this._stream._removeRangeReader(this)}}get isStreamingSupported(){return!1}async read(){if(this._queuedChunk){let 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;for(let e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0,this._stream._removeRangeReader(this)}};function bD(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 xD(e){return URL.parse(e)?.origin??null}function SD({responseHeaders:e,isHttp:t,rangeChunkSize:n,disableRange:r}){let i={allowRangeRequests:!1,suggestedLength:void 0},a=parseInt(e.get(`Content-Length`),10);return!Number.isInteger(a)||(i.suggestedLength=a,a<=2*n)||r||!t||e.get(`Accept-Ranges`)!==`bytes`||(e.get(`Content-Encoding`)||`identity`)!==`identity`||(i.allowRangeRequests=!0),i}function CD(e){let t=e.get(`Content-Disposition`);if(t){let e=function(e){let t=!0,n=r(`filename\\*`,`i`).exec(e);if(n){n=n[1];let e=o(n);return e=unescape(e),e=s(e),e=c(e),a(e)}if(n=function(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=o(r),n&&(r=unescape(r),e===0&&(r=s(r))),a.push(r)}return a.join(``)}(e),n)return a(c(n));if(n=r(`filename`,`i`).exec(e),n){n=n[1];let e=o(n);return e=c(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=Tw(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){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 s(e){let t=e.indexOf(`'`);return t===-1?e:i(e.slice(0,t),e.slice(t+1).replace(/^[^']*'/,``))}function c(e){return!e.startsWith(`=?`)||/[\x00-\x19\x80-\xff]/.test(e)?e:e.replaceAll(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,function(e,t,n,r){if(n===`q`||n===`Q`)return i(t,r=(r=r.replaceAll(`_`,` `)).replaceAll(/=([0-9a-fA-F]{2})/g,function(e,t){return String.fromCharCode(parseInt(t,16))}));try{r=atob(r)}catch{}return i(t,r)})}return``}(t);if(e.includes(`%`))try{e=decodeURIComponent(e)}catch{}if(Uw(e))return e}return null}function wD(e,t){return new xw(`Unexpected server response (${e}) while retrieving PDF "${t}".`,e,e===404||e===0&&t.startsWith(`file:`))}function TD(e){return e===200||e===206}function ED(e,t,n){return{method:`GET`,headers:e,signal:n.signal,mode:`cors`,credentials:t?`include`:`same-origin`,redirect:`follow`}}function DD(e){return e instanceof Uint8Array?e.buffer:e instanceof ArrayBuffer?e:(dw(`getArrayBuffer - unexpected data format: ${e}`),new Uint8Array(e).buffer)}var OD=class{_responseOrigin=null;constructor(e){this.source=e,this.isHttp=/^https?:/i.test(e.url),this.headers=bD(this.isHttp,e.httpHeaders),this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}getFullReader(){return pw(!this._fullRequestReader,`PDFFetchStream.getFullReader can only be called once.`),this._fullRequestReader=new kD(this),this._fullRequestReader}getRangeReader(e,t){if(t<=this._progressiveDataLength)return null;let n=new AD(this,e,t);return this._rangeRequestReaders.push(n),n}cancelAllRequests(e){this._fullRequestReader?.cancel(e);for(let t of this._rangeRequestReaders.slice(0))t.cancel(e)}},kD=class{constructor(e){this._stream=e,this._reader=null,this._loaded=0,this._filename=null;let t=e.source;this._withCredentials=t.withCredentials||!1,this._contentLength=t.length,this._headersCapability=Promise.withResolvers(),this._disableRange=t.disableRange||!1,this._rangeChunkSize=t.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._abortController=new AbortController,this._isStreamingSupported=!t.disableStream,this._isRangeSupported=!t.disableRange;let n=new Headers(e.headers),r=t.url;fetch(r,ED(n,this._withCredentials,this._abortController)).then(t=>{if(e._responseOrigin=xD(t.url),!TD(t.status))throw wD(t.status,r);this._reader=t.body.getReader(),this._headersCapability.resolve();let n=t.headers,{allowRangeRequests:i,suggestedLength:a}=SD({responseHeaders:n,isHttp:e.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=i,this._contentLength=a||this._contentLength,this._filename=CD(n),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new Cw(`Streaming is disabled.`))}).catch(this._headersCapability.reject),this.onProgress=null}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._headersCapability.promise;let{value:e,done:t}=await this._reader.read();return t?{value:e,done:t}:(this._loaded+=e.byteLength,this.onProgress?.({loaded:this._loaded,total:this._contentLength}),{value:DD(e),done:!1})}cancel(e){this._reader?.cancel(e),this._abortController.abort()}},AD=class{constructor(e,t,n){this._stream=e,this._reader=null,this._loaded=0;let r=e.source;this._withCredentials=r.withCredentials||!1,this._readCapability=Promise.withResolvers(),this._isStreamingSupported=!r.disableStream,this._abortController=new AbortController;let i=new Headers(e.headers);i.append(`Range`,`bytes=${t}-${n-1}`);let a=r.url;fetch(a,ED(i,this._withCredentials,this._abortController)).then(t=>{let n=xD(t.url);if(n!==e._responseOrigin)throw Error(`Expected range response-origin "${n}" to match "${e._responseOrigin}".`);if(!TD(t.status))throw wD(t.status,a);this._readCapability.resolve(),this._reader=t.body.getReader()}).catch(this._readCapability.reject),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._readCapability.promise;let{value:e,done:t}=await this._reader.read();return t?{value:e,done:t}:(this._loaded+=e.byteLength,this.onProgress?.({loaded:this._loaded}),{value:DD(e),done:!1})}cancel(e){this._reader?.cancel(e),this._abortController.abort()}},jD=class{_responseOrigin=null;constructor({url:e,httpHeaders:t,withCredentials:n}){this.url=e,this.isHttp=/^https?:/i.test(e),this.headers=bD(this.isHttp,t),this.withCredentials=n||!1,this.currXhrId=0,this.pendingRequests=Object.create(null)}request(e){let t=new XMLHttpRequest,n=this.currXhrId++,r=this.pendingRequests[n]={xhr:t};t.open(`GET`,this.url),t.withCredentials=this.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}`),r.expectedStatus=206):r.expectedStatus=200,t.responseType=`arraybuffer`,pw(e.onError,"Expected `onError` callback to be provided."),t.onerror=()=>{e.onError(t.status)},t.onreadystatechange=this.onStateChange.bind(this,n),t.onprogress=this.onProgress.bind(this,n),r.onHeadersReceived=e.onHeadersReceived,r.onDone=e.onDone,r.onError=e.onError,r.onProgress=e.onProgress,t.send(null),n}onProgress(e,t){let n=this.pendingRequests[e];n&&n.onProgress?.(t)}onStateChange(e,t){let n=this.pendingRequests[e];if(!n)return;let r=n.xhr;if(r.readyState>=2&&n.onHeadersReceived&&(n.onHeadersReceived(),delete n.onHeadersReceived),r.readyState!==4||!(e in this.pendingRequests))return;if(delete this.pendingRequests[e],r.status===0&&this.isHttp)return void n.onError(r.status);let i=r.status||200;if(!(i===200&&n.expectedStatus===206)&&i!==n.expectedStatus)return void n.onError(r.status);let a=function(e){let t=e.response;return typeof t==`string`?Tw(t).buffer:t}(r);if(i===206){let e=r.getResponseHeader(`Content-Range`),t=/bytes (\d+)-(\d+)\/(\d+)/.exec(e);t?n.onDone({begin:parseInt(t[1],10),chunk:a}):(dw(`Missing or invalid "Content-Range" header.`),n.onError(0))}else a?n.onDone({begin:0,chunk:a}):n.onError(r.status)}getRequestXhr(e){return this.pendingRequests[e].xhr}isPendingRequest(e){return e in this.pendingRequests}abortRequest(e){let t=this.pendingRequests[e].xhr;delete this.pendingRequests[e],t.abort()}},MD=class{constructor(e){this._source=e,this._manager=new jD(e),this._rangeChunkSize=e.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(e){let t=this._rangeRequestReaders.indexOf(e);t>=0&&this._rangeRequestReaders.splice(t,1)}getFullReader(){return pw(!this._fullRequestReader,`PDFNetworkStream.getFullReader can only be called once.`),this._fullRequestReader=new ND(this._manager,this._source),this._fullRequestReader}getRangeReader(e,t){let n=new PD(this._manager,e,t);return n.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(n),n}cancelAllRequests(e){this._fullRequestReader?.cancel(e);for(let t of this._rangeRequestReaders.slice(0))t.cancel(e)}},ND=class{constructor(e,t){this._manager=e,this._url=t.url,this._fullRequestId=e.request({onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)}),this._headersCapability=Promise.withResolvers(),this._disableRange=t.disableRange||!1,this._contentLength=t.length,this._rangeChunkSize=t.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._isStreamingSupported=!1,this._isRangeSupported=!1,this._cachedChunks=[],this._requests=[],this._done=!1,this._storedError=void 0,this._filename=null,this.onProgress=null}_onHeadersReceived(){let e=this._fullRequestId,t=this._manager.getRequestXhr(e);this._manager._responseOrigin=xD(t.responseURL);let n=t.getAllResponseHeaders(),r=new Headers(n?n.trimStart().replace(/[^\S ]+$/,``).split(/[\r\n]+/).map(e=>{let[t,...n]=e.split(`: `);return[t,n.join(`: `)]}):[]),{allowRangeRequests:i,suggestedLength:a}=SD({responseHeaders:r,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});i&&(this._isRangeSupported=!0),this._contentLength=a||this._contentLength,this._filename=CD(r),this._isRangeSupported&&this._manager.abortRequest(e),this._headersCapability.resolve()}_onDone(e){if(e&&(this._requests.length>0?this._requests.shift().resolve({value:e.chunk,done:!1}):this._cachedChunks.push(e.chunk)),this._done=!0,!(this._cachedChunks.length>0)){for(let e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0}}_onError(e){this._storedError=wD(e,this._url),this._headersCapability.reject(this._storedError);for(let e of this._requests)e.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0}_onProgress(e){this.onProgress?.({loaded:e.loaded,total:e.lengthComputable?e.total:this._contentLength})}get filename(){return this._filename}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}get contentLength(){return this._contentLength}get headersReady(){return this._headersCapability.promise}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);for(let e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId),this._fullRequestReader=null}},PD=class{constructor(e,t,n){this._manager=e,this._url=e.url,this._requestId=e.request({begin:t,end:n,onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)}),this._requests=[],this._queuedChunk=null,this._done=!1,this._storedError=void 0,this.onProgress=null,this.onClosed=null}_onHeadersReceived(){let e=xD(this._manager.getRequestXhr(this._requestId)?.responseURL);e!==this._manager._responseOrigin&&(this._storedError=Error(`Expected range response-origin "${e}" to match "${this._manager._responseOrigin}".`),this._onError(0))}_close(){this.onClosed?.(this)}_onDone(e){let t=e.chunk;this._requests.length>0?this._requests.shift().resolve({value:t,done:!1}):this._queuedChunk=t,this._done=!0;for(let e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0,this._close()}_onError(e){this._storedError??=wD(e,this._url);for(let e of this._requests)e.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}_onProgress(e){this.isStreamingSupported||this.onProgress?.({loaded:e.loaded})}get isStreamingSupported(){return!1}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;for(let e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId),this._close()}},FD=/^[a-z][a-z0-9\-+.]+:/i,ID=class{constructor(e){this.source=e,this.url=function(e){if(FD.test(e))return new URL(e);let t=process.getBuiltinModule(`url`);return new URL(t.pathToFileURL(e))}(e.url),pw(this.url.protocol===`file:`,`PDFNodeStream only supports file:// URLs.`),this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}getFullReader(){return pw(!this._fullRequestReader,`PDFNodeStream.getFullReader can only be called once.`),this._fullRequestReader=new LD(this),this._fullRequestReader}getRangeReader(e,t){if(t<=this._progressiveDataLength)return null;let n=new RD(this,e,t);return this._rangeRequestReaders.push(n),n}cancelAllRequests(e){this._fullRequestReader?.cancel(e);for(let t of this._rangeRequestReaders.slice(0))t.cancel(e)}},LD=class{constructor(e){this._url=e.url,this._done=!1,this._storedError=null,this.onProgress=null;let t=e.source;this._contentLength=t.length,this._loaded=0,this._filename=null,this._disableRange=t.disableRange||!1,this._rangeChunkSize=t.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._isStreamingSupported=!t.disableStream,this._isRangeSupported=!t.disableRange,this._readableStream=null,this._readCapability=Promise.withResolvers(),this._headersCapability=Promise.withResolvers();let n=process.getBuiltinModule(`fs`);n.promises.lstat(this._url).then(e=>{this._contentLength=e.size,this._setReadableStream(n.createReadStream(this._url)),this._headersCapability.resolve()},e=>{e.code===`ENOENT`&&(e=wD(0,this._url.href)),this._storedError=e,this._headersCapability.reject(e)})}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;let e=this._readableStream.read();return e===null?(this._readCapability=Promise.withResolvers(),this.read()):(this._loaded+=e.length,this.onProgress?.({loaded:this._loaded,total:this._contentLength}),{value:new Uint8Array(e).buffer,done:!1})}cancel(e){this._readableStream?this._readableStream.destroy(e):this._error(e)}_error(e){this._storedError=e,this._readCapability.resolve()}_setReadableStream(e){this._readableStream=e,e.on(`readable`,()=>{this._readCapability.resolve()}),e.on(`end`,()=>{e.destroy(),this._done=!0,this._readCapability.resolve()}),e.on(`error`,e=>{this._error(e)}),!this._isStreamingSupported&&this._isRangeSupported&&this._error(new Cw(`streaming is disabled`)),this._storedError&&this._readableStream.destroy(this._storedError)}},RD=class{constructor(e,t,n){this._url=e.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=Promise.withResolvers();let r=e.source;this._isStreamingSupported=!r.disableStream;let i=process.getBuiltinModule(`fs`);this._setReadableStream(i.createReadStream(this._url,{start:t,end:n-1}))}get isStreamingSupported(){return this._isStreamingSupported}async read(){if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;let e=this._readableStream.read();return e===null?(this._readCapability=Promise.withResolvers(),this.read()):(this._loaded+=e.length,this.onProgress?.({loaded:this._loaded}),{value:new Uint8Array(e).buffer,done:!1})}cancel(e){this._readableStream?this._readableStream.destroy(e):this._error(e)}_error(e){this._storedError=e,this._readCapability.resolve()}_setReadableStream(e){this._readableStream=e,e.on(`readable`,()=>{this._readCapability.resolve()}),e.on(`end`,()=>{e.destroy(),this._done=!0,this._readCapability.resolve()}),e.on(`error`,e=>{this._error(e)}),this._storedError&&this._readableStream.destroy(this._storedError)}},zD=Symbol(`INITIAL_DATA`),BD=class{#e=Object.create(null);#t(e){return this.#e[e]||={...Promise.withResolvers(),data:zD}}get(e,t=null){if(t){let n=this.#t(e);return n.promise.then(()=>t(n.data)),null}let n=this.#e[e];if(!n||n.data===zD)throw Error(`Requesting object that isn't resolved yet ${e}.`);return n.data}has(e){let t=this.#e[e];return!!t&&t.data!==zD}delete(e){let t=this.#e[e];return!(!t||t.data===zD)&&(delete this.#e[e],!0)}resolve(e,t=null){let n=this.#t(e);n.data=t,n.resolve()}clear(){for(let e in this.#e){let{data:t}=this.#e[e];t?.bitmap?.close()}this.#e=Object.create(null)}*[Symbol.iterator](){for(let e in this.#e){let{data:t}=this.#e[e];t!==zD&&(yield[e,t])}}},VD=class e{#e=Promise.withResolvers();#t=null;#n=!1;#r=!!globalThis.FontInspector?.enabled;#i=null;#a=null;#o=0;#s=0;#c=null;#l=null;#u=0;#d=0;#f=Object.create(null);#p=[];#m=null;#h=[];#g=new WeakMap;#_=null;static#v=new Map;static#y=new Map;static#b=new WeakMap;static#x=null;static#S=new Set;constructor({textContentSource:t,container:n,viewport:r}){if(t instanceof ReadableStream)this.#m=t;else{if(typeof t!=`object`)throw Error(`No "textContentSource" parameter specified.`);this.#m=new ReadableStream({start(e){e.enqueue(t),e.close()}})}this.#t=this.#l=n,this.#d=r.scale*nT.pixelRatio,this.#u=r.rotation,this.#a={div:null,properties:null,ctx:null};let{pageWidth:i,pageHeight:a,pageX:o,pageY:s}=r.rawDims;this.#_=[1,0,0,-1,-o,s+a],this.#s=i,this.#o=a,e.#O(),tT(n,r),this.#e.promise.finally(()=>{e.#S.delete(this),this.#a=null,this.#f=null}).catch(()=>{})}static get fontFamilyMap(){let{isWindows:e,isFirefox:t}=Ew.platform;return gw(this,`fontFamilyMap`,new Map([[`sans-serif`,(e&&t?`Calibri, `:``)+`sans-serif`],[`monospace`,(e&&t?`Lucida Console, `:``)+`monospace`]]))}render(){let t=()=>{this.#c.read().then(({value:e,done:n})=>{n?this.#e.resolve():(this.#i??=e.lang,Object.assign(this.#f,e.styles),this.#C(e.items),t())},this.#e.reject)};return this.#c=this.#m.getReader(),e.#S.add(this),t(),this.#e.promise}update({viewport:t,onBefore:n=null}){let r=t.scale*nT.pixelRatio,i=t.rotation;if(i!==this.#u&&(n?.(),this.#u=i,tT(this.#l,{rotation:i})),r!==this.#d){n?.(),this.#d=r;let t={div:null,properties:null,ctx:e.#E(this.#i)};for(let e of this.#h)t.properties=this.#g.get(e),t.div=e,this.#T(t)}}cancel(){let e=new Cw(`TextLayer task cancelled.`);this.#c?.cancel(e).catch(()=>{}),this.#c=null,this.#e.reject(e)}get textDivs(){return this.#h}get textContentItemsStr(){return this.#p}#C(t){if(this.#n)return;this.#a.ctx??=e.#E(this.#i);let n=this.#h,r=this.#p;for(let e of t){if(n.length>1e5)return dw(`Ignoring additional textDivs for performance reasons.`),void(this.#n=!0);if(e.str!==void 0)r.push(e.str),this.#w(e);else 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}`),t.append(this.#t)}else e.type===`endMarkedContent`&&(this.#t=this.#t.parentNode)}}#w(t){let n=document.createElement(`span`),r={angle:0,canvasWidth:0,hasText:t.str!==``,hasEOL:t.hasEOL,fontSize:0};this.#h.push(n);let i=Q.transform(this.#_,t.transform),a=Math.atan2(i[1],i[0]),o=this.#f[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.#k(s,o,this.#i),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=`calc(var(--total-scale-factor) *`,p=n.style;this.#t===this.#l?(p.left=`${(100*u/this.#s).toFixed(2)}%`,p.top=`${(100*d/this.#o).toFixed(2)}%`):(p.left=`${f}${u.toFixed(2)}px)`,p.top=`${f}${d.toFixed(2)}px)`),p.fontSize=`${f}${(e.#x*c).toFixed(2)}px)`,p.fontFamily=s,r.fontSize=c,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.#g.set(n,r),this.#a.div=n,this.#a.properties=r,this.#T(this.#a),r.hasText&&this.#t.append(n),r.hasEOL){let e=document.createElement(`br`);e.setAttribute(`role`,`presentation`),this.#t.append(e)}}#T(t){let{div:n,properties:r,ctx:i}=t,{style:a}=n,o=``;if(e.#x>1&&(o=`scale(${1/e.#x})`),r.canvasWidth!==0&&r.hasText){let{fontFamily:t}=a,{canvasWidth:s,fontSize:c}=r;e.#D(i,c*this.#d,t);let{width:l}=i.measureText(n.textContent);l>0&&(o=`scaleX(${s*this.#d/l}) ${o}`)}r.angle!==0&&(o=`rotate(${r.angle}deg) ${o}`),o.length>0&&(a.transform=o)}static cleanup(){if(!(this.#S.size>0)){this.#v.clear();for(let{canvas:e}of this.#y.values())e.remove();this.#y.clear()}}static#E(e=null){let t=this.#y.get(e||=``);if(!t){let n=document.createElement(`canvas`);n.className=`hiddenCanvasElement`,n.lang=e,document.body.append(n),t=n.getContext(`2d`,{alpha:!1,willReadFrequently:!0}),this.#y.set(e,t),this.#b.set(t,{size:0,family:``})}return t}static#D(e,t,n){let r=this.#b.get(e);t===r.size&&n===r.family||(e.font=`${t}px ${n}`,r.size=t,r.family=n)}static#O(){if(this.#x!==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.#x=e.getBoundingClientRect().height,e.remove()}static#k(e,t,n){let r=this.#v.get(e);if(r)return r;let i=this.#E(n);i.canvas.width=i.canvas.height=30,this.#D(i,30,e);let a=i.measureText(``),o=a.fontBoundingBoxAscent,s=Math.abs(a.fontBoundingBoxDescent);i.canvas.width=i.canvas.height=0;let c=.8;return o?c=o/(o+s):(Ew.platform.isFirefox&&dw("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.#v.set(e,c),c}};function HD(e={}){typeof e==`string`||e instanceof URL?e={url:e}:(e instanceof ArrayBuffer||ArrayBuffer.isView(e))&&(e={data:e});let t=new UD,{docId:n}=t,r=e.url?function(e){if(e instanceof URL)return e.href;if(typeof e==`string`){if(TC)return e;let t=URL.parse(e,window.location);if(t)return t.href}throw Error(`Invalid PDF url data: either string or URL-object is expected in the url property.`)}(e.url):null,i=e.data?function(e){if(TC&&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 Tw(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.`)}(e.data):null,a=e.httpHeaders||null,o=!0===e.withCredentials,s=e.password??null,c=e.range instanceof WD?e.range:null,l=Number.isInteger(e.rangeChunkSize)&&e.rangeChunkSize>0?e.rangeChunkSize:65536,u=e.worker instanceof qD?e.worker:null,d=e.verbosity,f=typeof e.docBaseUrl!=`string`||Hw(e.docBaseUrl)?null:e.docBaseUrl,p=LT(e.cMapUrl),m=!1!==e.cMapPacked,h=e.CMapReaderFactory||(TC?pE:rE),g=LT(e.iccUrl),_=LT(e.standardFontDataUrl),v=e.StandardFontDataFactory||(TC?mE:sE),y=LT(e.wasmUrl),b=e.WasmFactory||(TC?hE:lE),x=!0!==e.stopAtErrors,S=Number.isInteger(e.maxImageSize)&&e.maxImageSize>-1?e.maxImageSize:-1,C=!1!==e.isEvalSupported,w=typeof e.isOffscreenCanvasSupported==`boolean`?e.isOffscreenCanvasSupported:!TC,T=typeof e.isImageDecoderSupported==`boolean`?e.isImageDecoderSupported:!TC&&(Ew.platform.isFirefox||!globalThis.chrome),E=Number.isInteger(e.canvasMaxAreaInBytes)?e.canvasMaxAreaInBytes:-1,D=typeof e.disableFontFace==`boolean`?e.disableFontFace:TC,O=!0===e.fontExtraProperties,k=!0===e.enableXfa,ee=e.ownerDocument||globalThis.document,A=!0===e.disableRange,j=!0===e.disableStream,M=!0===e.disableAutoFetch,te=!0===e.pdfBug,ne=e.CanvasFactory||(TC?fE:tE),re=e.FilterFactory||(TC?dE:aE),ie=!0===e.enableHWA,ae=!1!==e.useWasm,oe=c?c.length:e.length??NaN,se=typeof e.useSystemFonts==`boolean`?e.useSystemFonts:!TC&&!D,ce=typeof e.useWorkerFetch==`boolean`?e.useWorkerFetch:!!(h===rE&&v===sE&&b===lE&&p&&_&&y&&qw(p,document.baseURI)&&qw(_,document.baseURI)&&qw(y,document.baseURI));cw(d);let le={canvasFactory:new ne({ownerDocument:ee,enableHWA:ie}),filterFactory:new re({docId:n,ownerDocument:ee}),cMapReaderFactory:ce?null:new h({baseUrl:p,isCompressed:m}),standardFontDataFactory:ce?null:new v({baseUrl:_}),wasmFactory:ce?null:new b({baseUrl:y})};u||(u=qD.create({verbosity:d,port:fD.workerPort}),t._worker=u);let ue={docId:n,apiVersion:`5.4.296`,data:i,password:s,disableAutoFetch:M,rangeChunkSize:l,length:oe,docBaseUrl:f,enableXfa:k,evaluatorOptions:{maxImageSize:S,disableFontFace:D,ignoreErrors:x,isEvalSupported:C,isOffscreenCanvasSupported:w,isImageDecoderSupported:T,canvasMaxAreaInBytes:E,fontExtraProperties:O,useSystemFonts:se,useWasm:ae,useWorkerFetch:ce,cMapUrl:p,iccUrl:g,standardFontDataUrl:_,wasmUrl:y}},de={ownerDocument:ee,pdfBug:te,styleElement:null,loadingParams:{disableAutoFetch:M,enableXfa:k}};return u.promise.then(function(){if(t.destroyed)throw Error(`Loading aborted`);if(u.destroyed)throw Error(`Worker was destroyed`);let e=u.messageHandler.sendWithPromise(`GetDocRequest`,ue,i?[i.buffer]:null),s;if(c)s=new _D(c,{disableRange:A,disableStream:j});else if(!i){if(!r)throw Error("getDocument - no `url` parameter provided.");s=new(qw(r)?OD:TC?ID:MD)({url:r,length:oe,httpHeaders:a,withCredentials:o,rangeChunkSize:l,disableRange:A,disableStream:j})}return e.then(e=>{if(t.destroyed)throw Error(`Loading aborted`);if(u.destroyed)throw Error(`Worker was destroyed`);let r=new $T(n,e,u.port);t._transport=new JD(r,t,s,de,le,ie),r.send(`Ready`,null)})}).catch(t._capability.reject),t}var UD=class e{static#e=0;_capability=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;try{this._worker?.port&&(this._worker._pendingDestroy=!0),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()}},WD=class{#e=Promise.withResolvers();#t=[];#n=[];#r=[];#i=[];constructor(e,t,n=!1,r=null){this.length=e,this.initialData=t,this.progressiveDone=n,this.contentDispositionFilename=r}addRangeListener(e){this.#i.push(e)}addProgressListener(e){this.#r.push(e)}addProgressiveReadListener(e){this.#n.push(e)}addProgressiveDoneListener(e){this.#t.push(e)}onDataRange(e,t){for(let n of this.#i)n(e,t)}onDataProgress(e,t){this.#e.promise.then(()=>{for(let n of this.#r)n(e,t)})}onDataProgressiveRead(e){this.#e.promise.then(()=>{for(let t of this.#n)t(e)})}onDataProgressiveDone(){this.#e.promise.then(()=>{for(let e of this.#t)e()})}transportReady(){this.#e.resolve()}requestDataRange(e,t){fw(`Abstract method PDFDataRangeTransport.requestDataRange`)}abort(){}},GD=class{constructor(e,t){this._pdfInfo=e,this._transport=t}get annotationStorage(){return this._transport.annotationStorage}get canvasFactory(){return this._transport.canvasFactory}get filterFactory(){return this._transport.filterFactory}get numPages(){return this._pdfInfo.numPages}get fingerprints(){return this._pdfInfo.fingerprints}get isPureXfa(){return gw(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()}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(){return this._transport.saveDocument()}getDownloadInfo(){return this._transport.downloadInfoCapability.promise}cleanup(e=!1){return this._transport.startCleanup(e||this.isPureXfa)}destroy(){return this.loadingTask.destroy()}cachedPageNumber(e){return this._transport.cachedPageNumber(e)}get loadingParams(){return this._transport.loadingParams}get loadingTask(){return this._transport.loadingTask}getFieldObjects(){return this._transport.getFieldObjects()}hasJSActions(){return this._transport.hasJSActions()}getCalculationOrderIds(){return this._transport.getCalculationOrderIds()}},KD=class{#e=!1;constructor(e,t,n,r=!1){this._pageIndex=e,this._pageInfo=t,this._transport=n,this._stats=r?new Kw:null,this._pdfBug=r,this.commonObjs=n.commonObjs,this.objs=new BD,this._intentStates=new Map,this.destroyed=!1,this.recordedBBoxes=null}get pageNumber(){return this._pageIndex+1}get rotate(){return this._pageInfo.rotate}get ref(){return this._pageInfo.ref}get userUnit(){return this._pageInfo.userUnit}get view(){return this._pageInfo.view}getViewport({scale:e,rotation:t=this.rotate,offsetX:n=0,offsetY:r=0,dontFlip:i=!1}={}){return new Bw({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 gw(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=IC.ENABLE,transform:a=null,background:o=null,optionalContentConfigPromise:s=null,annotationCanvasMap:c=null,pageColors:l=null,printAnnotationStorage:u=null,isEditing:d=!1,recordOperations:f=!1,operationsFilter:p=null}){this._stats?.time(`Overall`);let m=this._transport.getRenderingIntent(r,i,u,d),{renderingIntent:h,cacheKey:g}=m;this.#e=!1,s||=this._transport.getOptionalContentConfig(h);let _=this._intentStates.get(g);_||(_=Object.create(null),this._intentStates.set(g,_)),_.streamReaderCancelTimeout&&(clearTimeout(_.streamReaderCancelTimeout),_.streamReaderCancelTimeout=null);let v=!!(h&AC);_.displayReadyCapability||(_.displayReadyCapability=Promise.withResolvers(),_.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time(`Page Request`),this._pumpOperatorList(m));let y=!!(this._pdfBug&&globalThis.StepperManager?.enabled),b=!this.recordedBBoxes&&(f||y),x=e=>{if(_.renderTasks.delete(S),b){let e=S.gfx?.dependencyTracker.take();e&&(S.stepper&&S.stepper.setOperatorBBoxes(e,S.gfx.dependencyTracker.takeDebugMetadata()),f&&(this.recordedBBoxes=e))}v&&(this.#e=!0),this.#t(),e?(S.capability.reject(e),this._abortOperatorList({intentState:_,reason:e instanceof Error?e:Error(e)})):S.capability.resolve(),this._stats&&(this._stats.timeEnd(`Rendering`),this._stats.timeEnd(`Overall`),globalThis.Stats?.enabled&&globalThis.Stats.add(this.pageNumber,this._stats))},S=new XD({callback:x,params:{canvas:t,canvasContext:e,dependencyTracker:b?new CE(t,_.operatorList.length,y):null,viewport:n,transform:a,background:o},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:c,operatorList:_.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!v,pdfBug:this._pdfBug,pageColors:l,enableHWA:this._transport.enableHWA,operationsFilter:p});(_.renderTasks||=new Set).add(S);let C=S.task;return Promise.all([_.displayReadyCapability.promise,s]).then(([e,t])=>{if(this.destroyed)x();else{if(this._stats?.time(`Rendering`),!(t.renderingIntent&h))throw Error("Must use the same `intent`-argument when calling the `PDFPageProxy.render` and `PDFDocumentProxy.getOptionalContentConfig` methods.");S.initializeGraphics({transparency:e,optionalContentConfig:t}),S.operatorListChanged()}}).catch(x),C}getOperatorList({intent:e=`display`,annotationMode:t=IC.ENABLE,printAnnotationStorage:n=null,isEditing:r=!1}={}){let i=this._transport.getRenderingIntent(e,t,n,r,!0),a,o=this._intentStates.get(i.cacheKey);return o||(o=Object.create(null),this._intentStates.set(i.cacheKey,o)),o.opListReadCapability||(a=Object.create(null),a.operatorListChanged=function(){o.operatorList.lastChunk&&(o.opListReadCapability.resolve(o.operatorList),o.renderTasks.delete(a))},o.opListReadCapability=Promise.withResolvers(),(o.renderTasks||=new Set).add(a),o.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time(`Page Request`),this._pumpOperatorList(i)),o.opListReadCapability.promise}streamTextContent({includeMarkedContent:e=!1,disableNormalization:t=!1}={}){return this._transport.messageHandler.sendWithStream(`GetTextContent`,{pageIndex:this._pageIndex,includeMarkedContent:!0===e,disableNormalization:!0===t},{highWaterMark:100,size:e=>e.items.length})}getTextContent(e={}){if(this._transport._htmlForXfa)return this.getXfa().then(e=>Fw.textContent(e));let t=this.streamTextContent(e);return new Promise(function(e,n){let r=t.getReader(),i={items:[],styles:Object.create(null),lang:null};(function t(){r.read().then(function({value:n,done:r}){r?e(i):(i.lang??=n.lang,Object.assign(i.styles,n.styles),i.items.push(...n.items),t())},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.#t();return e&&t&&(this._stats&&=new Kw),t}#t(){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.#t()}_pumpOperatorList({renderingIntent:e,cacheKey:t,annotationStorageSerializable:n,modifiedIds:r}){let{map:i,transfer:a}=n,o=this._transport.messageHandler.sendWithStream(`GetOperatorList`,{pageIndex:this._pageIndex,intent:e,cacheKey:t,annotationStorage:i,modifiedIds:r},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.#t()}if(s.displayReadyCapability)s.displayReadyCapability.reject(e);else{if(!s.opListReadCapability)throw e;s.opListReadCapability.reject(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 Vw){let n=100;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 Cw(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}},qD=class t{#e=Promise.withResolvers();#t=null;#n=null;#r=null;static#i=0;static#a=!0;static#o=new WeakMap;static{TC&&(this.#a=!0,fD.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`}))},this.fromPort=e=>{var t;if(t="`PDFWorker.fromPort` - please use `PDFWorker.create` instead.",console.log(`Deprecated API usage: `+t),!e?.port)throw Error(`PDFWorker.fromPort - invalid method signature.`);return this.create(e)}}constructor({name:e=null,port:n=null,verbosity:r=lw()}={}){if(this.name=e,this.destroyed=!1,this.verbosity=r,n){if(t.#o.has(n))throw Error(`Cannot use more than one PDFWorker per port.`);t.#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 $T(`main`,`worker`,e),this.#t.on(`ready`,()=>{}),this.#s()}#l(){if(t.#a||t.#d)return void this.#u();let{workerSrc:e}=t;try{t._isSameOrigin(window.location,e)||(e=t._createCDNWrapper(new URL(e,window.location).href));let n=new Worker(e,{type:`module`}),r=new $T(`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(`test`,e=>{a.abort(),!this.destroyed&&e?(this.#t=r,this.#n=n,this.#r=n,this.#s()):i()}),r.on(`ready`,e=>{if(a.abort(),this.destroyed)i();else try{o()}catch{this.#u()}});let o=()=>{let e=new Uint8Array;r.send(`test`,e,[e.buffer])};o();return}catch{uw(`The worker has been disabled.`)}this.#u()}#u(){t.#a||=(dw(`Setting up fake worker.`),!0),t._setupFakeWorkerGlobal.then(e=>{if(this.destroyed)return void this.#e.reject(Error(`Worker was destroyed`));let n=new BT;this.#n=n;let r=`fake`+ t.#i++,i=new $T(r+`_worker`,r,n);e.setup(i,n),this.#t=new $T(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,t.#o.delete(this.#n),this.#n=null,this.#t?.destroy(),this.#t=null}static create(e){let n=this.#o.get(e?.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 t(e)}static get workerSrc(){if(fD.workerSrc)return fD.workerSrc;throw Error(`No "GlobalWorkerOptions.workerSrc" specified.`)}static get#d(){try{return globalThis.pdfjsWorker?.WorkerMessageHandler||null}catch{return null}}static get _setupFakeWorkerGlobal(){return gw(this,`_setupFakeWorkerGlobal`,(async()=>this.#d?this.#d:(await e(async()=>{let{WorkerMessageHandler:e}=await import(this.workerSrc);return{WorkerMessageHandler:e}},[])).WorkerMessageHandler)())}},JD=class{#e=new Map;#t=new Map;#n=new Map;#r=new Map;#i=null;constructor(e,t,n,r,i,a){this.messageHandler=e,this.loadingTask=t,this.commonObjs=new BD,this.fontLoader=new FT({ownerDocument:r.ownerDocument,styleElement:r.styleElement}),this.loadingParams=r.loadingParams,this._params=r,this.canvasFactory=i.canvasFactory,this.filterFactory=i.filterFactory,this.cMapReaderFactory=i.cMapReaderFactory,this.standardFontDataFactory=i.standardFontDataFactory,this.wasmFactory=i.wasmFactory,this.destroyed=!1,this.destroyCapability=null,this._networkStream=n,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=Promise.withResolvers(),this.enableHWA=a,this.setupMessageHandler()}#a(e,t=null){let n=this.#e.get(e);if(n)return n;let r=this.messageHandler.sendWithPromise(e,t);return this.#e.set(e,r),r}get annotationStorage(){return gw(this,`annotationStorage`,new NT)}getRenderingIntent(e,t=IC.ENABLE,n=null,r=!1,i=!1){let a=kC,o=MT;switch(e){case`any`:a=OC;break;case`display`:break;case`print`:a=AC;break;default:dw(`getRenderingIntent - invalid intent: ${e}`)}let s=a&AC&&n instanceof PT?n:this.annotationStorage;switch(t){case IC.DISABLE:a+=NC;break;case IC.ENABLE:break;case IC.ENABLE_FORMS:a+=jC;break;case IC.ENABLE_STORAGE:a+=MC,o=s.serializable;break;default:dw(`getRenderingIntent - invalid annotationMode: ${t}`)}r&&(a+=PC),i&&(a+=FC);let{ids:c,hash:l}=s.modifiedIds;return{renderingIntent:a,cacheKey:[a,o.hash,l].join(`_`),annotationStorageSerializable:o,modifiedIds:c}}destroy(){if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=Promise.withResolvers(),this.#i?.reject(Error(`Worker was destroyed during onPassword callback`));let e=[];for(let t of this.#t.values())e.push(t._destroy());this.#t.clear(),this.#n.clear(),this.#r.clear(),this.hasOwnProperty(`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.#e.clear(),this.filterFactory.destroy(),VD.cleanup(),this._networkStream?.cancelAllRequests(new Cw(`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)=>{pw(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=e=>{this._lastProgress={loaded:e.loaded,total:e.total}},t.onPull=()=>{this._fullReader.read().then(function({value:e,done:n}){n?t.close():(pw(e instanceof ArrayBuffer,`GetReader - expected an ArrayBuffer.`),t.enqueue(new Uint8Array(e),1,[e]))}).catch(e=>{t.error(e)})},t.onCancel=e=>{this._fullReader.cancel(e),t.ready.catch(e=>{if(!this.destroyed)throw e})}}),e.on(`ReaderHeadersReady`,async e=>{await this._fullReader.headersReady;let{isStreamingSupported:n,isRangeSupported:r,contentLength:i}=this._fullReader;return n&&r||(this._lastProgress&&t.onProgress?.(this._lastProgress),this._fullReader.onProgress=e=>{t.onProgress?.({loaded:e.loaded,total:e.total})}),{isStreamingSupported:n,isRangeSupported:r,contentLength:i}}),e.on(`GetRangeReader`,(e,t)=>{pw(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");let n=this._networkStream.getRangeReader(e.begin,e.end);n?(t.onPull=()=>{n.read().then(function({value:e,done:n}){n?t.close():(pw(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._numPages=e.numPages,this._htmlForXfa=e.htmlForXfa,delete e.htmlForXfa,t._capability.resolve(new GD(e,this))}),e.on(`DocException`,e=>{t._capability.reject(QT(e))}),e.on(`PasswordRequest`,e=>{this.#i=Promise.withResolvers();try{if(!t.onPassword)throw QT(e);t.onPassword(e=>{e instanceof Error?this.#i.reject(e):this.#i.resolve({password:e})},e.code)}catch(e){this.#i.reject(e)}return this.#i.promise}),e.on(`DataLoaded`,e=>{t.onProgress?.({loaded:e.length,total:e.length}),this.downloadInfoCapability.resolve(e)}),e.on(`StartRenderPage`,e=>{this.destroyed||this.#t.get(e.pageIndex)._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;dw(`Error during font loading: ${e}`),this.commonObjs.resolve(t,e);break}let i=new IT(new dD(r),this._params.pdfBug&&globalThis.FontInspector?.enabled?(e,t)=>globalThis.FontInspector.fontAdded(e,t):null,r.extra,r.charProcOperatorList);this.fontLoader.bind(i).catch(()=>e.sendWithPromise(`FontFallback`,{id:t})).finally(()=>{!i.fontExtraProperties&&i.data&&i.clearData(),this.commonObjs.resolve(t,i)});break;case`CopyLocalImage`:let{imageRef:a}=r;pw(a,`The imageRef must be defined.`);for(let e of this.#t.values())for(let[,n]of e.objs)if(n?.ref===a)return n.dataLen?(this.commonObjs.resolve(t,structuredClone(n)),n.dataLen):null;break;case`FontPath`:case`Image`:case`Pattern`:this.commonObjs.resolve(t,r);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.#t.get(t);if(!i.objs.has(e))if(i._intentStates.size!==0)switch(n){case`Image`:case`Pattern`:i.objs.resolve(e,r);break;default:throw Error(`Got unknown object type ${n}`)}else r?.bitmap?.close()}),e.on(`DocProgress`,e=>{this.destroyed||t.onProgress?.({loaded:e.loaded,total:e.total})}),e.on(`FetchBinaryData`,async e=>{if(this.destroyed)throw Error(`Worker was destroyed.`);let t=this[e.type];if(!t)throw Error(`${e.type} not initialized, see the \`useWorkerFetch\` parameter.`);return t.fetch(e)})}getData(){return this.messageHandler.sendWithPromise(`GetData`,null)}saveDocument(){this.annotationStorage.size<=0&&dw("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");let{map:e,transfer:t}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise(`SaveDocument`,{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:e,filename:this._fullReader?.filename??null},t).finally(()=>{this.annotationStorage.resetModified()})}getPage(e){if(!Number.isInteger(e)||e<=0||e>this._numPages)return Promise.reject(Error(`Invalid page request.`));let t=e-1,n=this.#n.get(t);if(n)return n;let r=this.messageHandler.sendWithPromise(`GetPage`,{pageIndex:t}).then(n=>{if(this.destroyed)throw Error(`Transport destroyed`);n.refStr&&this.#r.set(n.refStr,e);let r=new KD(t,n,this,this._params.pdfBug);return this.#t.set(t,r),r});return this.#n.set(t,r),r}getPageIndex(e){return RT(e)?this.messageHandler.sendWithPromise(`GetPageIndex`,{num:e.num,gen:e.gen}):Promise.reject(Error(`Invalid pageIndex request.`))}getAnnotations(e,t){return this.messageHandler.sendWithPromise(`GetAnnotations`,{pageIndex:e,intent:t})}getFieldObjects(){return this.#a(`GetFieldObjects`)}hasJSActions(){return this.#a(`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)}getAnnotationsByType(e,t){return this.messageHandler.sendWithPromise(`GetAnnotationsByType`,{types:e,pageIndexesToSkip:t})}getDocJSActions(){return this.#a(`GetDocJSActions`)}getPageJSActions(e){return this.messageHandler.sendWithPromise(`GetPageJSActions`,{pageIndex:e})}getStructTree(e){return this.messageHandler.sendWithPromise(`GetStructTree`,{pageIndex:e})}getOutline(){return this.messageHandler.sendWithPromise(`GetOutline`,null)}getOptionalContentConfig(e){return this.#a(`GetOptionalContentConfig`).then(t=>new gD(t,e))}getPermissions(){return this.messageHandler.sendWithPromise(`GetPermissions`,null)}getMetadata(){let e=`GetMetadata`,t=this.#e.get(e);if(t)return t;let n=this.messageHandler.sendWithPromise(e,null).then(e=>({info:e[0],metadata:e[1]?new pD(e[1]):null,contentDispositionFilename:this._fullReader?.filename??null,contentLength:this._fullReader?.contentLength??null}));return this.#e.set(e,n),n}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.#t.values())if(!e.cleanup())throw Error(`startCleanup: Page ${e.pageNumber} is currently rendering.`);this.commonObjs.clear(),e||this.fontLoader.clear(),this.#e.clear(),this.filterFactory.destroy(!0),VD.cleanup()}}cachedPageNumber(e){if(!RT(e))return null;let t=e.gen===0?`${e.num}R`:`${e.num}R${e.gen}`;return this.#r.get(t)??null}},YD=class{#e=null;onContinue=null;onError=null;constructor(e){this.#e=e}get promise(){return this.#e.capability.promise}cancel(e=0){this.#e.cancel(null,e)}get separateAnnots(){let{separateAnnots:e}=this.#e.operatorList;if(!e)return!1;let{annotationCanvasMap:t}=this.#e;return e.form||e.canvas&&t?.size>0}},XD=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=!0===l&&typeof window<`u`,this.cancelled=!1,this.capability=Promise.withResolvers(),this.task=new YD(this),this._cancelBound=this.cancel.bind(this),this._continueBound=this._continue.bind(this),this._scheduleNextBound=this._scheduleNext.bind(this),this._nextBound=this._next.bind(this),this._canvas=t.canvas,this._canvasContext=t.canvas?null:t.canvasContext,this._enableHWA=f,this._dependencyTracker=t.dependencyTracker,this._operationsFilter=p}get completed(){return this.capability.promise.catch(function(){})}initializeGraphics({transparency: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}=this.params,s=this._canvasContext||this._canvas.getContext(`2d`,{alpha:!1,willReadFrequently:!this._enableHWA});this.gfx=new cD(s,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:n},this.annotationCanvasMap,this.pageColors,o),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 Vw(`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())))}},ZD=`5.4.296`,QD=`f56dc8601`,$D=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 gw(this,`_keyboardManager`,new bT([[[`Escape`,`mac+Escape`],e.prototype._hideDropdownFromKeyboard],[[` `,`mac+ `],e.prototype._colorSelectFromKeyboard],[[`ArrowDown`,`ArrowRight`,`mac+ArrowDown`,`mac+ArrowRight`],e.prototype._moveToNext],[[`ArrowUp`,`ArrowLeft`,`mac+ArrowUp`,`mac+ArrowLeft`],e.prototype._moveToPrevious],[[`Home`,`mac+Home`],e.prototype._moveToBeginning],[[`End`,`mac+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`,Jw,{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:zC.HIGHLIGHT_COLOR,value:e}),this.updateColor(e)}_colorSelectFromKeyboard(e){if(e.target===this.#e)return void this.#m(e);let t=e.target.getAttribute(`data-color`);t&&this.#f(t,e)}_moveToNext(e){this.#g?e.target===this.#e?this.#r.firstChild?.focus():e.target.nextSibling?.focus():this.#m(e)}_moveToPrevious(e){e.target!==this.#r?.firstChild&&e.target!==this.#e?(this.#g||this.#m(e),e.target.previousSibling?.focus()):this.#g&&this._hideDropdownFromKeyboard()}_moveToBeginning(e){this.#g?this.#r.firstChild?.focus():this.#m(e)}_moveToEnd(e){this.#g?this.#r.lastChild?.focus():this.#m(e)}#p(t){e._keyboardManager.exec(this,t)}#m(e){if(this.#g)return void this.hideDropdown();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)return void this.#r.classList.remove(`hidden`);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())}updateColor(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}},eO=class e{#e=null;#t=null;#n=null;static#r=null;constructor(t){this.#t=t,this.#n=t._uiManager,e.#r||=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,colorValue:r}=this.#t,i=this.#e=document.createElement(`input`);return i.type=`color`,i.value=r||`#000000`,i.className=`basicColorPicker`,i.tabIndex=0,i.setAttribute(`data-l10n-id`,e.#r[t]),i.addEventListener(`input`,()=>{this.#n.updateParams(n,i.value)},{signal:this.#n._signal}),i}update(e){this.#e&&(this.#e.value=e)}destroy(){this.#e?.remove(),this.#e=null}hideDropdown(){}};function tO(e){return Math.floor(255*Math.max(0,Math.min(1,e))).toString(16).padStart(2,`0`)}function nO(e){return Math.max(0,Math.min(255,255*e))}var rO=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=nO(e),e,e]}static G_HTML([e]){let t=tO(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(nO)}static RGB_HTML(e){return`#${e.map(tO).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[nO(1-Math.min(1,e+r)),nO(1-Math.min(1,n+r)),nO(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)]}},iO=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){fw("Abstract method `_createSVG` called.")}},aO=class extends iO{_createSVG(e){return document.createElementNS(Lw,e)}},oO=new WeakSet,sO=60*new Date().getTimezoneOffset()*1e3,cO=class{static create(e){switch(e.data.annotationType){case JC.LINK:return new dO(e);case JC.TEXT:return new fO(e);case JC.WIDGET:switch(e.data.fieldType){case`Tx`:return new mO(e);case`Btn`:return e.data.radioButton?new _O(e):e.data.checkBox?new gO(e):new vO(e);case`Ch`:return new yO(e);case`Sig`:return new hO(e)}return new pO(e);case JC.POPUP:return new bO(e);case JC.FREETEXT:return new SO(e);case JC.LINE:return new CO(e);case JC.SQUARE:return new wO(e);case JC.CIRCLE:return new TO(e);case JC.POLYLINE:return new EO(e);case JC.CARET:return new OO(e);case JC.INK:return new kO(e);case JC.POLYGON:return new DO(e);case JC.HIGHLIGHT:return new AO(e);case JC.UNDERLINE:return new jO(e);case JC.SQUIGGLY:return new MO(e);case JC.STRIKEOUT:return new NO(e);case JC.STAMP:return new PO(e);case JC.FILEATTACHMENT:return new FO(e);default:return new lO(e)}}},lO=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,t&&(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(`${LC}${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(`${LC}${t.id}`,{id:t.id,annotationType:t.annotationType,pageIndex:this.parent.page._pageIndex,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 pO||this instanceof dO||(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 bO){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))`:this instanceof _O&&(a.borderRadius=`calc(${o}px * var(--total-scale-factor)) / calc(${s}px * var(--total-scale-factor))`),t.borderStyle.style){case YC:a.borderStyle=`solid`;break;case XC:a.borderStyle=`dashed`;break;case ZC:dw(`Unimplemented border style: beveled`);break;case QC:dw(`Unimplemented border style: inset`);break;case $C:a.borderBottomStyle=`solid`}let r=t.borderColor||null;r?(this.#t=!0,a.borderColor=Q.makeHexColor(0|r[0],0|r[1],0|r[2])):a.borderWidth=0}let c=Q.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]=rO[`${i}_HTML`](a),this.annotationStorage.setValue(this.data.id,{[t]:rO[`${i}_rgb`](a)})};return gw(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(e=>Math.fround(e));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="http://www.w3.org/2000/svg"`,` 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);let i=this.#n=new bO({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]});this.parent._commentManager||this.parent.div.append(i.render())}get hasPopupElement(){return!!(this.#n||this.popup||this.data.popupRef)}get extraPopupElement(){return this.#n}render(){fw("Abstract method `AnnotationElement.render` called")}_getElementsByName(e,t=null){let n=[];if(this._fieldObjects){let r=this._fieldObjects[e];if(r)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||oO.has(o)?n.push({id:i,exportValue:r,domElement:o}):dw(`_getElementsByName - element not allowed: ${i}`)}return n}for(let r of document.getElementsByName(e)){let{exportValue:e}=r,i=r.getAttribute(`data-element-id`);i!==t&&oO.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})})}get width(){return this.data.rect[2]-this.data.rect[0]}get height(){return this.data.rect[3]-this.data.rect[1]}},uO=class extends lO{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),this.extraPopupElement.popup.renderCommentButton())}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.container.remove(),this.container=null,this.removePopup()}},dO=class extends lO{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.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.Action||e.actions[`Mouse Up`]||e.actions[`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.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=null){e.href=this.linkService.getAnchorUrl(``),t.description?e.title=t.description:n&&(e.title=n),e.onclick=()=>(this.downloadManager?.openOrDownloadData(t.content,t.filename,r),!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,t){e.href=this.linkService.getAnchorUrl(``);let n=new Map([[`Action`,`onclick`],[`Mouse Up`,`onmouseup`],[`Mouse Down`,`onmousedown`]]);for(let r of Object.keys(t.actions)){let i=n.get(r);i&&(e[i]=()=>(this.linkService.eventBus?.dispatch(`dispatcheventinsandbox`,{source:this,detail:{id:t.id,name:r}}),!1))}t.overlaidText&&(e.title=t.overlaidText),e.onclick||=()=>!1,this.#e()}_bindResetFormAction(e,t){let n=e.onclick;if(n||(e.href=this.linkService.getAnchorUrl(``)),this.#e(),!this._fieldObjects)return dw('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),void(n||(e.onclick=()=>!1));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[n]||[];for(let{id:n}of e)t.add(n)}for(let e of Object.values(this._fieldObjects))for(let n of e)t.has(n.id)===i&&a.push(n)}else for(let e of Object.values(this._fieldObjects))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&&(oO.has(n)?n.dispatchEvent(new Event(`resetform`)):dw(`_bindResetFormAction - element not allowed: ${t}`))}return this.enableScripting&&this.linkService.eventBus?.dispatch(`dispatcheventinsandbox`,{source:this,detail:{id:`app`,ids:s,name:`ResetForm`}}),!1}}},fO=class extends lO{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._createPopup(),this.container.append(e),this.container}},pO=class extends lO{render(){return this.container}showElementAndHideCanvas(e){this.data.hasOwnCanvas&&(e.previousSibling?.nodeName===`CANVAS`&&(e.previousSibling.hidden=!0),e.hidden=!1)}_getKeyModifier(e){return Ew.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){for(let[i,a]of n)(a===`Action`||this.data.actions?.[a])&&(a!==`Focus`&&a!==`Blur`||(t||={focused:!1}),this._setEventListener(e,t,i,a,r),a!==`Focus`||this.data.actions?.Blur?a!==`Blur`||this.data.actions?.Focus||this._setEventListener(e,t,`focus`,`Focus`,null):this._setEventListener(e,t,`blur`,`Blur`,null))}_setBackgroundColor(e){let t=this.data.backgroundColor||null;e.style.backgroundColor=t===null?`transparent`:Q.makeHexColor(t[0],t[1],t[2])}_setTextStyle(e){let t=[`left`,`center`,`right`],{fontColor:n}=this.data.defaultAppearanceData,r=this.data.defaultAppearanceData.fontSize||9,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/(DC*r))||1);a=Math.min(r,o(t/DC))}else{let e=Math.abs(this.data.rect[3]-this.data.rect[1]-2);a=Math.min(r,o(e/DC))}i.fontSize=`calc(${a}px * var(--total-scale-factor))`,i.color=Q.makeHexColor(n[0],n[1],n[2]),this.data.textAlignment!==null&&(i.textAlign=t[this.data.textAlignment])}_setRequired(e,t){t?e.setAttribute(`required`,!0):e.removeAttribute(`required`),e.setAttribute(`aria-required`,t)}},mO=class extends pO{constructor(e){super(e,{isRenderable:e.renderForms||e.data.hasOwnCanvas||!e.data.hasAppearance&&!!e.data.fieldValue})}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
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&&(n.hidden=!0),oO.add(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-sO).toISOString().split(l===`date`?`T`:`.`,1)[0];else t.value=e}s.lastCommittedValue=t.value,s.commitKey=1,this.data.actions?.Focus||(s.focused=!0)}),n.addEventListener(`updatefromsandbox`,n=>{this.showElementAndHideCanvas(n.target),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)return void i.removeAttribute(`maxLength`);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?e.key===`Tab`&&(s.commitKey=3):n=2,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?.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?.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=i.substring(0,a).match(/\w*[^\w]*$/);e&&(c-=e[0].length);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.letterSpacing=`calc(${e}px * var(--total-scale-factor) - 1ch)`}}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}},hO=class extends pO{constructor(e){super(e,{isRenderable:!!e.data.hasOwnCanvas})}},gO=class extends pO{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 oO.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._setBackgroundColor(i),this._setDefaultPropertiesFromJS(i),this.container.append(i),this.container}},_O=class extends pO{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.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(oO.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._setBackgroundColor(i),this._setDefaultPropertiesFromJS(i),this.container.append(i),this.container}},vO=class extends dO{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}},yO=class extends pO{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`);oO.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});for(let e of this.data.options){let t=document.createElement(`option`);t.textContent=e.displayValue,t.value=e.exportValue,n.value.includes(e.exportValue)&&(t.setAttribute(`selected`,!0),i=!1),r.append(t)}let a=null;if(i){let e=document.createElement(`option`);e.value=` `,e.setAttribute(`hidden`,!0),e.setAttribute(`selected`,!0),r.prepend(e),a=()=>{e.remove(),r.removeEventListener(`input`,a),a=null},r.addEventListener(`input`,a)}let o=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]},s=o(!1),c=e=>{let t=e.target.options;return Array.prototype.map.call(t,e=>({displayValue:e.textContent,exportValue:e.value}))};return this.enableScripting&&this.hasJSActions?(r.addEventListener(`updatefromsandbox`,n=>{this._dispatchEventFromSandbox({value(n){a?.();let i=n.detail.value,c=new Set(Array.isArray(i)?i:[i]);for(let e of r.options)e.selected=c.has(e.value);e.setValue(t,{value:o(!0)}),s=o(!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:o(!0),items:c(n)}),s=o(!1)},clear(n){for(;r.length!==0;)r.remove(0);e.setValue(t,{value:null,items:[]}),s=o(!1)},insert(n){let{index:i,displayValue:a,exportValue:l}=n.detail.insert,u=r.children[i],d=document.createElement(`option`);d.textContent=a,d.value=l,u?u.before(d):r.append(d),e.setValue(t,{value:o(!0),items:c(n)}),s=o(!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`);i.textContent=t,i.value=n,r.append(i)}r.options.length>0&&(r.options[0].selected=!0),e.setValue(t,{value:o(!0),items:c(n)}),s=o(!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:o(!0)}),s=o(!1)},editable(e){e.target.disabled=!e.detail.editable}},n)}),r.addEventListener(`input`,n=>{let r=o(!0),i=o(!1);e.setValue(t,{value:r}),n.preventDefault(),this.linkService.eventBus?.dispatch(`dispatcheventinsandbox`,{source:this,detail:{id:t,name:`Keystroke`,value:s,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:o(!0)})}),this.data.combo&&this._setTextStyle(r),this._setBackgroundColor(r),this._setDefaultPropertiesFromJS(r),this.container.append(r),this.container}},bO=class extends lO{constructor(e){let{data:t,elements:n,parent:r}=e,i=!!r._commentManager;if(super(e,{isRenderable:!i&&lO._hasPopupData(t)}),this.elements=n,i&&lO._hasPopupData(t)){let e=this.popup=this.#e();for(let t of n)t.popup=e}else this.popup=null}#e(){return new xO({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=>`${Mw}${e}`).join(`,`)),this.container}},xO=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=Xw.toDateObject(i),this.trigger=n.flatMap(e=>e.getElementsToTriggerPopup()),d?this.renderCommentButton():(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.#_||this.#D(),!this.#_))return;let{signal:e}=this.#m=new AbortController,t=!!this.#w.extraPopupElement,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=a.style.zIndex+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.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.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)}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=Q.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)}pT({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?null: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
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}){if(this.#e)return n?(this.remove(),this.#T=null):t&&(t.deleted?this.remove():(this.#k(),this.#T=t.text)),void(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=Xw.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||Q.intersect(e.data.rect,o)!==null){o=e.data.rect,a=!0;break}let s=Q.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)+1e3)}#R(){this.#o.classList.remove(`focused`),!this.#f&&this.isVisible&&(this.#o.hidden=!0,this.#o.style.zIndex=parseInt(this.#o.style.zIndex)-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&&!1===this.#o.hidden}},SO=class extends lO{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0}),this.textContent=e.data.textContent,this.textPosition=e.data.textPosition,this.annotationEditorType=RC.FREETEXT}render(){if(this.container.classList.add(`freeTextAnnotation`),this.textContent){let e=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._createPopup(),this._editOnDoubleClick(),this.container}},CO=class extends lO{#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._createPopup(),this.container}getElementsToTriggerPopup(){return this.#e}addHighlightArea(){this.container.classList.add(`highlightArea`)}},wO=class extends lO{#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._createPopup(),this.container}getElementsToTriggerPopup(){return this.#e}addHighlightArea(){this.container.classList.add(`highlightArea`)}},TO=class extends lO{#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._createPopup(),this.container}getElementsToTriggerPopup(){return this.#e}addHighlightArea(){this.container.classList.add(`highlightArea`)}},EO=class extends lO{#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._createPopup(),this.container}getElementsToTriggerPopup(){return this.#e}addHighlightArea(){this.container.classList.add(`highlightArea`)}},DO=class extends EO{constructor(e){super(e),this.containerClassName=`polygonAnnotation`,this.svgElementName=`svg:polygon`}},OO=class extends lO{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0})}render(){return this.container.classList.add(`caretAnnotation`),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container}},kO=class extends lO{#e=null;#t=[];constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0}),this.containerClassName=`inkAnnotation`,this.svgElementName=`svg:polyline`,this.annotationEditorType=this.data.it===`InkHighlight`?RC.HIGHLIGHT:RC.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=0,t=n.length;e<t;e++){let t=this.svgFactory.createElement(this.svgElementName);this.#t.push(t),t.setAttribute(`points`,n[e].join(`,`)),l.append(t)}return!i&&this.hasPopupData&&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`)}},AO=class extends lO{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0}),this.annotationEditorType=RC.HIGHLIGHT}render(){let{data:{overlaidText:e,popupRef:t}}=this;if(!t&&this.hasPopupData&&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}},jO=class extends lO{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){let{data:{overlaidText:e,popupRef:t}}=this;if(!t&&this.hasPopupData&&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}},MO=class extends lO{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){let{data:{overlaidText:e,popupRef:t}}=this;if(!t&&this.hasPopupData&&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}},NO=class extends lO{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){let{data:{overlaidText:e,popupRef:t}}=this;if(!t&&this.hasPopupData&&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}},PO=class extends lO{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0}),this.annotationEditorType=RC.STAMP}render(){return this.container.classList.add(`stampAnnotation`),this.container.setAttribute(`role`,`img`),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this._editOnDoubleClick(),this.container}},FO=class extends lO{#e=null;constructor(e){super(e,{isRenderable:!0});let{file:t}=this.data;this.filename=t.filename,this.content=t.content,this.linkService.eventBus?.dispatch(`fileattachmentannotation`,{source:this,...t})}render(){this.container.classList.add(`fileAttachmentAnnotation`);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(100*t.fillAlpha)}%);`)),n.addEventListener(`dblclick`,this.#t.bind(this)),this.#e=n;let{isMac:r}=Ew.platform;return e.addEventListener(`keydown`,e=>{e.key===`Enter`&&(r?e.metaKey:e.ctrlKey)&&this.#t()}),!t.popupRef&&this.hasPopupData?this._createPopup():n.classList.add(`popupTriggerArea`),e.append(n),e}getElementsToTriggerPopup(){return this.#e}addHighlightArea(){this.container.classList.add(`highlightArea`)}#t(){this.downloadManager?.openOrDownloadData(this.content,this.filename)}},IO=class e{#e=null;#t=null;#n=null;#r=new Map;#i=null;#a=null;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 NT,this.page=i,this.viewport=a,this.zIndex=0,this._annotationEditorUIManager=r,this._commentManager=s||null}hasEditableAnnotations(){return this.#r.size>0}async#o(e,t,n){let r=e.firstChild||e,i=r.id=`${Mw}${t}`,a=await this.#i?.getAriaAttributes(i);if(a)for(let[e,t]of a)r.setAttribute(e,t);n?n.at(-1).container.after(e):(this.div.append(e),this.#e?.moveElementInDOM(this.div,e,r,!1))}async render(e){let{annotations:t}=e,n=this.div;tT(n,this.viewport);let r=new Map,i={data:null,layer:n,linkService:this.#a,downloadManager:e.downloadManager,imageResourcesPath:e.imageResourcesPath||``,renderForms:!1!==e.renderForms,svgFactory:new aO,annotationStorage:this.#n,enableComment:!0===e.enableComment,enableScripting:!0===e.enableScripting,hasJSActions:e.hasJSActions,fieldObjects:e.fieldObjects,parent:this,elements:null};for(let e of t){if(e.noHTML)continue;let t=e.annotationType===JC.POPUP;if(t){let t=r.get(e.id);if(!t)continue;i.elements=t}else if(e.rect[2]===e.rect[0]||e.rect[3]===e.rect[1])continue;i.data=e;let n=cO.create(i);if(!n.isRenderable)continue;if(!t&&e.popupRef){let t=r.get(e.popupRef);t?t.push(n):r.set(e.popupRef,[n])}let a=n.render();e.hidden&&(a.style.visibility=`hidden`),await this.#o(a,e.id,i.elements),n.extraPopupElement?.popup?.renderCommentButton(),n._isEditable&&(this.#r.set(n.data.id,n),this._annotationEditorUIManager?.renderAnnotationElement(n))}this.#s()}async addLinkAnnotations(t){let n={data:null,layer:this.div,linkService:this.#a,svgFactory:new aO,parent:this};for(let r of t){r.borderStyle||=e._defaultBorderStyle,n.data=r;let t=cO.create(n);if(!t.isRenderable)continue;let i=t.render();await this.#o(i,r.id,null)}}update({viewport:e}){let t=this.div;this.viewport=e,tT(t,{rotation:e.rotation}),this.#s(),t.hidden=!1}#s(){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;n.className=`annotationContent`;let{firstChild:i}=r;i?i.nodeName===`CANVAS`?i.replaceWith(n):i.classList.contains(`annotationContent`)?i.after(n):i.before(n):r.append(n);let a=this.#r.get(t);a&&(a._hasNoCanvas?(this._annotationEditorUIManager?.setMissingCanvas(t,r.id,n),a._hasNoCanvas=!1):a.canvas=n)}this.#t.clear()}getEditableAnnotations(){return Array.from(this.#r.values())}getEditableAnnotation(e){return this.#r.get(e)}addFakeAnnotation(e){let{div:t}=this,{id:n,rotation:r}=e,i=new uO({data:{id:n,rect:e.getPDFRect(),rotation:r},editor:e,layer:t,parent:this,enableComment:!!this._commentManager,linkService:this.#a,annotationStorage:this.#n}),a=i.render();return t.append(a),this.#e?.moveElementInDOM(t,a,a,!1),i.createOrUpdatePopup(),i}static get _defaultBorderStyle(){return gw(this,`_defaultBorderStyle`,Object.freeze({width:1,rawWidth:1,style:YC,dashArray:[3],horizontalCornerRadius:0,verticalCornerRadius:0}))}},LO=/\r\n?|\n/g,RO=class e extends ET{#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=ST.TRANSLATE_SMALL,i=ST.TRANSLATE_BIG;return gw(this,`_keyboardManager`,new bT([[[`ctrl+s`,`mac+meta+s`,`ctrl+p`,`mac+meta+p`],t.commitOrRemove,{bubbles:!0}],[[`ctrl+Enter`,`mac+meta+Enter`,`Escape`,`mac+Escape`],t.commitOrRemove],[[`ArrowLeft`,`mac+ArrowLeft`],t._translateEmpty,{args:[-r,0],checker:n}],[[`ctrl+ArrowLeft`,`mac+shift+ArrowLeft`],t._translateEmpty,{args:[-i,0],checker:n}],[[`ArrowRight`,`mac+ArrowRight`],t._translateEmpty,{args:[r,0],checker:n}],[[`ctrl+ArrowRight`,`mac+shift+ArrowRight`],t._translateEmpty,{args:[i,0],checker:n}],[[`ArrowUp`,`mac+ArrowUp`],t._translateEmpty,{args:[0,-r],checker:n}],[[`ctrl+ArrowUp`,`mac+shift+ArrowUp`],t._translateEmpty,{args:[0,-i],checker:n}],[[`ArrowDown`,`mac+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=RC.FREETEXT;constructor(t){super({...t,name:`freeTextEditor`}),this.color=t.color||e._defaultColor||ET._defaultLineColor,this.#r=t.fontSize||e._defaultFontSize,this.annotationElementId||this._uiManager.a11yAlert(`pdfjs-editor-freetext-added-alert`)}static initialize(e,t){ET.initialize(e,t);let n=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(n.getPropertyValue(`--freetext-padding`))}static updateDefaultParams(t,n){switch(t){case zC.FREETEXT_SIZE:e._defaultFontSize=n;break;case zC.FREETEXT_COLOR:e._defaultColor=n}}updateParams(e,t){switch(e){case zC.FREETEXT_SIZE:this.#i(t);break;case zC.FREETEXT_COLOR:this.#a(t)}}static get defaultPropertiesToUpdate(){return[[zC.FREETEXT_SIZE,e._defaultFontSize],[zC.FREETEXT_COLOR,e._defaultColor||ET._defaultLineColor]]}get propertiesToUpdate(){return[[zC.FREETEXT_SIZE,this.#r],[zC.FREETEXT_COLOR,this.color]]}get toolbarButtons(){return this._colorPicker||=new eO(this),[[`colorPicker`,this._colorPicker]]}get colorType(){return zC.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:zC.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:zC.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)}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
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(LO,``)}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(LO,`
@@ -51,4 +51,4 @@ startxref
51
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
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 SO){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||f.length===0)return null;i=t={annotationType:RC.FREETEXT,color:Array.from(n),fontSize:e,value:f.join(`
53
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=Q.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=ET._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()}},$=class{static PRECISION=1e-4;toSVGPath(){fw("Abstract method `toSVGPath` must be implemented.")}get box(){fw("Abstract getter `box` must be implemented.")}serialize(e,t){fw("Abstract method `serialize` must be implemented.")}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(1e4*e)}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 _normalizePagePoint(e,t,n){switch(n){case 90:return[1-t,e];case 180:return[1-e,1-t];case 270:return[t,1-e];default:return[e,t]}}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]}},zO=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({x:t,y: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])}#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({x:e,y: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=h/p,b=-g/p*this.#d,x=y*this.#d;return this.#a.set(this.#a.subarray(2,8),0),this.#a.set([c+b,l+x],4),this.#a.set(this.#a.subarray(14,18),12),this.#a.set([c-b,l-x],16),isNaN(this.#a[6])?(this.#i.length===0&&(this.#a.set([o+b,s+x],2),this.#i.push(NaN,NaN,NaN,NaN,(o+b-n)/i,(s+x-r)/a),this.#a.set([o-b,s-x],14),this.#t.push(NaN,NaN,NaN,NaN,(o-b-n)/i,(s-x-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 BO(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}},BO=class extends ${#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=$._rescale(this.#o,e,r,a,-o),c=$._rescale(this.#i,e,r,a,-o);break;case 90:s=$._rescaleAndSwap(this.#o,e,t,a,o),c=$._rescaleAndSwap(this.#i,e,t,a,o);break;case 180:s=$._rescale(this.#o,n,t,-a,o),c=$._rescale(this.#i,n,t,-a,o);break;case 270:s=$._rescaleAndSwap(this.#o,n,r,-a,-o),c=$._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])?(Q.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[0]=u[1]=1/0,u[2]=u[3]=-1/0,Q.bezierBoundingBox(n,r,...t.slice(e,e+6),u),Q.rectBoundingBox(u[0],u[1],u[2],u[3],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=0){return new zO(e,t,n,r,i,a)}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.newOutliner({x:this.#i[0]*u+f,y:this.#i[1]*d+p},this.#e,this.#a,e,this.#r,t??this.#n);for(let e=2;e<this.#i.length;e+=2)m.add({x:this.#i[e]*u+f,y:this.#i[e+1]*d+p});return m.getOutlines()}},VO=class{#e;#t;#n;#r=[];#i=[];constructor(e,t=0,n=0,r=!0){let i=[1/0,1/0,-1/0,-1/0],a=1e-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),Q.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=[],i;for(;n.size>0;){let e=n.values().next().value,[t,a,o,s,c]=e;n.delete(e);let l=t,u=a;for(i=[t,o],r.push(i);;){let e;if(n.has(s))e=s;else{if(!n.has(c))break;e=c}n.delete(e),[t,a,o,s,c]=e,l!==t&&(i.push(l,u,t,u===a?a:o),l=t),u=u===a?o:a}i.push(l,u)}return new HO(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)return void this.#i.splice(r,1)}for(let r=n-1;r>=0;r--){let[n,i]=this.#i[r];if(n!==e)break;if(n===e&&i===t)return void this.#i.splice(r,1)}}#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}},HO=class extends ${#e;#t;constructor(e,t,n,r){super(),this.#t=e,this.#e=t,this.firstPoint=n,this.lastPoint=r}toSVGPath(){let e=[];for(let t of this.#t){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.#t){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}get classNamesForOutlining(){return[`highlightOutline`]}},UO=class extends zO{newFreeDrawOutline(e,t,n,r,i,a){return new WO(e,t,n,r,i,a)}},WO=class extends BO{newOutliner(e,t,n,r,i,a=0){return new UO(e,t,n,r,i,a)}},GO=class e extends ET{#e=null;#t=0;#n;#r=null;#i=null;#a=null;#o=null;#s=0;#c=null;#l=null;#u=null;#d=!1;#f=null;#p=null;#m=null;#h=``;#g;#_=``;static _defaultColor=null;static _defaultOpacity=1;static _defaultThickness=12;static _type=`highlight`;static _editorType=RC.HIGHLIGHT;static _freeHighlightId=-1;static _freeHighlight=null;static _freeHighlightClipId=``;static get _keyboardManager(){let t=e.prototype;return gw(this,`_keyboardManager`,new bT([[[`ArrowLeft`,`mac+ArrowLeft`],t._moveCaret,{args:[0]}],[[`ArrowRight`,`mac+ArrowRight`],t._moveCaret,{args:[1]}],[[`ArrowUp`,`mac+ArrowUp`],t._moveCaret,{args:[2]}],[[`ArrowDown`,`mac+ArrowDown`],t._moveCaret,{args:[3]}]]))}constructor(t){super({...t,name:`highlightEditor`}),this.color=t.color||e._defaultColor,this.#g=t.thickness||e._defaultThickness,this.opacity=t.opacity||e._defaultOpacity,this.#n=t.boxes||null,this.#_=t.methodOfCreation||``,this.#h=t.text||``,this._isDraggable=!1,this.defaultL10nId=`pdfjs-editor-highlight-editor`,t.highlightId>-1?(this.#d=!0,this.#y(t),this.#w()):this.#n&&(this.#e=t.anchorNode,this.#t=t.anchorOffset,this.#o=t.focusNode,this.#s=t.focusOffset,this.#v(),this.#w(),this.rotate(this.rotation)),this.annotationElementId||this._uiManager.a11yAlert(`pdfjs-editor-highlight-added-alert`)}get telemetryInitialData(){return{action:`added`,type:this.#d?`free_highlight`:`highlight`,color:this._uiManager.getNonHCMColorName(this.color),thickness:this.#g,methodOfCreation:this.#_}}get telemetryFinalData(){return{type:`highlight`,color:this._uiManager.getNonHCMColorName(this.color)}}static computeTelemetryFinalData(e){return{numberOfColors:e.get(`color`).size}}#v(){this.#l=new VO(this.#n,.001).getOutlines(),[this.x,this.y,this.width,this.height]=this.#l.box,this.#a=new VO(this.#n,.0025,.001,this._uiManager.direction===`ltr`).getOutlines();let{firstPoint:e}=this.#l;this.#f=[(e[0]-this.x)/this.width,(e[1]-this.y)/this.height];let{lastPoint:t}=this.#a;this.#p=[(t[0]-this.x)/this.width,(t[1]-this.y)/this.height]}#y({highlightOutlines:t,highlightId:n,clipPathId:r}){if(this.#l=t,this.#a=t.getNewOutline(this.#g/2+1.5,.0025),n>=0)this.#u=n,this.#r=r,this.parent.drawLayer.finalizeDraw(n,{bbox:t.box,path:{d:t.toSVGPath()}}),this.#m=this.parent.drawLayer.drawOutline({rootClass:{highlightOutline:!0,free:!0},bbox:this.#a.box,path:{d:this.#a.toSVGPath()}},!0);else if(this.parent){let n=this.parent.viewport.rotation;this.parent.drawLayer.updateProperties(this.#u,{bbox:e.#T(this.#l.box,(n-this.rotation+360)%360),path:{d:t.toSVGPath()}}),this.parent.drawLayer.updateProperties(this.#m,{bbox:e.#T(this.#a.box,n),path:{d:this.#a.toSVGPath()}})}let[i,a,o,s]=t.box;switch(this.rotation){case 0:this.x=i,this.y=a,this.width=o,this.height=s;break;case 90:{let[e,t]=this.parentDimensions;this.x=a,this.y=1-i,this.width=o*t/e,this.height=s*e/t;break}case 180:this.x=1-i,this.y=1-a,this.width=o,this.height=s;break;case 270:{let[e,t]=this.parentDimensions;this.x=1-a,this.y=i,this.width=o*t/e,this.height=s*e/t;break}}let{firstPoint:c}=t;this.#f=[(c[0]-i)/o,(c[1]-a)/s];let{lastPoint:l}=this.#a;this.#p=[(l[0]-i)/o,(l[1]-a)/s]}static initialize(t,n){ET.initialize(t,n),e._defaultColor||=n.highlightColors?.values().next().value||`#fff066`}static updateDefaultParams(t,n){switch(t){case zC.HIGHLIGHT_COLOR:e._defaultColor=n;break;case zC.HIGHLIGHT_THICKNESS:e._defaultThickness=n}}translateInPage(e,t){}get toolbarPosition(){return this.#p}get commentButtonPosition(){return this.#f}updateParams(e,t){switch(e){case zC.HIGHLIGHT_COLOR:this.#b(t);break;case zC.HIGHLIGHT_THICKNESS:this.#x(t)}}static get defaultPropertiesToUpdate(){return[[zC.HIGHLIGHT_COLOR,e._defaultColor],[zC.HIGHLIGHT_THICKNESS,e._defaultThickness]]}get propertiesToUpdate(){return[[zC.HIGHLIGHT_COLOR,this.color||e._defaultColor],[zC.HIGHLIGHT_THICKNESS,this.#g||e._defaultThickness],[zC.HIGHLIGHT_FREE,this.#d]]}onUpdatedColor(){this.parent?.drawLayer.updateProperties(this.#u,{root:{fill:this.color,"fill-opacity":this.opacity}}),this.#i?.updateColor(this.color),super.onUpdatedColor()}#b(t){let n=(e,t)=>{this.color=e,this.opacity=t,this.onUpdatedColor()},r=this.color,i=this.opacity;this.addCommands({cmd:n.bind(this,t,e._defaultOpacity),undo:n.bind(this,r,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:zC.HIGHLIGHT_COLOR,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:`color_changed`,color:this._uiManager.getNonHCMColorName(t)},!0)}#x(e){let t=this.#g,n=e=>{this.#g=e,this.#S(e)};this.addCommands({cmd:n.bind(this,e),undo:n.bind(this,t),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:zC.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:`thickness_changed`,thickness:e},!0)}get toolbarButtons(){return this._uiManager.highlightColors?[[`colorPicker`,this.#i=new $D({editor:this})]]:super.toolbarButtons}disableEditing(){super.disableEditing(),this.div.classList.toggle(`disabled`,!0)}enableEditing(){super.enableEditing(),this.div.classList.toggle(`disabled`,!1)}fixAndSetPosition(){return super.fixAndSetPosition(this.#O())}getBaseTranslation(){return[0,0]}getRect(e,t){return super.getRect(e,t,this.#O())}onceAdded(e){this.annotationElementId||this.parent.addUndoableEditor(this),e&&this.div.focus()}remove(){this.#C(),this._reportTelemetry({action:`deleted`}),super.remove()}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(this.#w(),this.isAttachedToDOM||this.parent.add(this)))}setParent(e){let t=!1;this.parent&&!e?this.#C():e&&(this.#w(e),t=!this.parent&&this.div?.classList.contains(`selectedEditor`)),super.setParent(e),this.show(this._isVisible),t&&this.select()}#S(e){this.#d&&(this.#y({highlightOutlines:this.#l.getNewOutline(e/2)}),this.fixAndSetPosition(),this.setDims(this.width,this.height))}#C(){this.#u!==null&&this.parent&&(this.parent.drawLayer.remove(this.#u),this.#u=null,this.parent.drawLayer.remove(this.#m),this.#m=null)}#w(e=this.parent){this.#u===null&&({id:this.#u,clipPathId:this.#r}=e.drawLayer.draw({bbox:this.#l.box,root:{viewBox:`0 0 1 1`,fill:this.color,"fill-opacity":this.opacity},rootClass:{highlight:!0,free:this.#d},path:{d:this.#l.toSVGPath()}},!1,!0),this.#m=e.drawLayer.drawOutline({rootClass:{highlightOutline:!0,free:this.#d},bbox:this.#a.box,path:{d:this.#a.toSVGPath()}},this.#d),this.#c&&(this.#c.style.clipPath=this.#r))}static#T([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]}rotate(t){let{drawLayer:n}=this.parent,r;this.#d?(t=(t-this.rotation+360)%360,r=e.#T(this.#l.box,t)):r=e.#T([this.x,this.y,this.width,this.height],t),n.updateProperties(this.#u,{bbox:r,root:{"data-main-rotation":t}}),n.updateProperties(this.#m,{bbox:e.#T(this.#a.box,t),root:{"data-main-rotation":t}})}render(){if(this.div)return this.div;let e=super.render();this.#h&&(e.setAttribute(`aria-label`,this.#h),e.setAttribute(`role`,`mark`)),this.#d?e.classList.add(`free`):this.div.addEventListener(`keydown`,this.#E.bind(this),{signal:this._uiManager._signal});let t=this.#c=document.createElement(`div`);return e.append(t),t.setAttribute(`aria-hidden`,`true`),t.className=`internal`,t.style.clipPath=this.#r,this.setDims(this.width,this.height),gT(this,this.#c,[`pointerover`,`pointerleave`]),this.enableEditing(),e}pointerover(){this.isSelected||this.parent?.drawLayer.updateProperties(this.#m,{rootClass:{hovered:!0}})}pointerleave(){this.isSelected||this.parent?.drawLayer.updateProperties(this.#m,{rootClass:{hovered:!1}})}#E(t){e._keyboardManager.exec(this,t)}_moveCaret(e){switch(this.parent.unselect(this),e){case 0:case 2:this.#D(!0);break;case 1:case 3:this.#D(!1)}}#D(e){if(!this.#e)return;let t=window.getSelection();e?t.setPosition(this.#e,this.#t):t.setPosition(this.#o,this.#s)}select(){super.select(),this.#m&&this.parent?.drawLayer.updateProperties(this.#m,{rootClass:{hovered:!1,selected:!0}})}unselect(){super.unselect(),this.#m&&(this.parent?.drawLayer.updateProperties(this.#m,{rootClass:{selected:!1}}),this.#d||this.#D(!1))}get _mustFixPosition(){return!this.#d}show(e=this._isVisible){super.show(e),this.parent&&(this.parent.drawLayer.updateProperties(this.#u,{rootClass:{hidden:!e}}),this.parent.drawLayer.updateProperties(this.#m,{rootClass:{hidden:!e}}))}#O(){return this.#d?this.rotation:0}#k(){if(this.#d)return null;let[e,t]=this.pageDimensions,[n,r]=this.pageTranslation,i=this.#n,a=new Float32Array(8*i.length),o=0;for(let{x:s,y:c,width:l,height:u}of i){let i=s*e+n,d=(1-c)*t+r;a[o]=a[o+4]=i,a[o+1]=a[o+3]=d,a[o+2]=a[o+6]=i+l*e,a[o+5]=a[o+7]=d-u*t,o+=8}return a}#A(e){return this.#l.serialize(e,this.#O())}static startHighlighting(e,t,{target:n,x:r,y:i}){let{x:a,y:o,width:s,height:c}=n.getBoundingClientRect(),l=new AbortController,u=e.combinedSignal(l),d=t=>{l.abort(),this.#M(e,t)};window.addEventListener(`blur`,d,{signal:u}),window.addEventListener(`pointerup`,d,{signal:u}),window.addEventListener(`pointerdown`,Yw,{capture:!0,passive:!1,signal:u}),window.addEventListener(`contextmenu`,Jw,{signal:u}),n.addEventListener(`pointermove`,this.#j.bind(this,e),{signal:u}),this._freeHighlight=new UO({x:r,y:i},[a,o,s,c],e.scale,this._defaultThickness/2,t,.001),{id:this._freeHighlightId,clipPathId:this._freeHighlightClipId}=e.drawLayer.draw({bbox:[0,0,1,1],root:{viewBox:`0 0 1 1`,fill:this._defaultColor,"fill-opacity":this._defaultOpacity},rootClass:{highlight:!0,free:!0},path:{d:this._freeHighlight.toSVGPath()}},!0,!0)}static#j(e,t){this._freeHighlight.add(t)&&e.drawLayer.updateProperties(this._freeHighlightId,{path:{d:this._freeHighlight.toSVGPath()}})}static#M(e,t){this._freeHighlight.isEmpty()?e.drawLayer.remove(this._freeHighlightId):e.createAndAddNewEditor(t,!1,{highlightId:this._freeHighlightId,highlightOutlines:this._freeHighlight.getOutlines(),clipPathId:this._freeHighlightClipId,methodOfCreation:`main_toolbar`}),this._freeHighlightId=-1,this._freeHighlight=null,this._freeHighlightClipId=``}static async deserialize(e,t,n){let r=null;if(e instanceof AO){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:RC.HIGHLIGHT,color:Array.from(o),opacity:s,quadPoints:t,boxes:null,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 kO){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:RC.HIGHLIGHT,color:Array.from(o),thickness:s,inkLists:t,boxes:null,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{color:i,quadPoints:a,inkLists:o,opacity:s}=e,c=await super.deserialize(e,t,n);c.color=Q.makeHexColor(...i),c.opacity=s||1,o&&(c.#g=e.thickness),c._initialData=r,e.comment&&c.setCommentData(e);let[l,u]=c.pageDimensions,[d,f]=c.pageTranslation;if(a){let e=c.#n=[];for(let t=0;t<a.length;t+=8)e.push({x:(a[t]-d)/l,y:1-(a[t+1]-f)/u,width:(a[t+2]-a[t])/l,height:(a[t+1]-a[t+5])/u});c.#v(),c.#w(),c.rotate(c.rotation)}else if(o){c.#d=!0;let e=o[0],n={x:e[0]-d,y:u-(e[1]-f)},r=new UO(n,[0,0,l,u],1,c.#g/2,!0,.001);for(let t=0,i=e.length;t<i;t+=2)n.x=e[t]-d,n.y=u-(e[t+1]-f),r.add(n);let{id:i,clipPathId:a}=t.drawLayer.draw({bbox:[0,0,1,1],root:{viewBox:`0 0 1 1`,fill:c.color,"fill-opacity":c._defaultOpacity},rootClass:{highlight:!0,free:!0},path:{d:r.toSVGPath()}},!0,!0);c.#y({highlightOutlines:r.getOutlines(),highlightId:i,clipPathId:a}),c.#w(),c.rotate(c.parentRotation)}return c}serialize(e=!1){if(this.isEmpty()||e)return null;if(this.deleted)return this.serializeDeleted();let t=ET._colorManager.convert(this._uiManager.getNonHCMColor(this.color)),n=super.serialize(e);return Object.assign(n,{color:t,opacity:this.opacity,thickness:this.#g,quadPoints:this.#k(),outlines:this.#A(n.rect)}),this.addComment(n),this.annotationElementId&&!this.#N(n)?null:(n.id=this.annotationElementId,n)}#N(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)}static canCreateNewEmptyEditor(){return!1}},KO=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(){fw(`Not implemented`)}},qO=class e extends ET{#e=null;#t;_colorPicker=null;_drawId=null;static _currentDrawId=-1;static _currentParent=null;static#n=null;static#r=null;static#i=null;static#a=NaN;static#o=null;static#s=null;static#c=NaN;static _INNER_MARGIN=3;constructor(e){super(e),this.#t=e.mustBeCommitted||!1,this._addOutlines(e)}onUpdatedColor(){this._colorPicker?.update(this.color),super.onUpdatedColor()}_addOutlines(e){e.drawOutlines&&(this.#l(e),this.#f())}#l({drawOutlines:e,drawId:t,drawingOptions:n}){this.#e=e,this._drawingOptions||=n,this.annotationElementId||this._uiManager.a11yAlert(`pdfjs-editor-${this.editorType}-added-alert`),t>=0?(this._drawId=t,this.parent.drawLayer.finalizeDraw(t,e.defaultProperties)):this._drawId=this.#u(e,this.parent),this.#h(e.box)}#u(t,n){let{id:r}=n.drawLayer.draw(e._mergeSVGProperties(this._drawingOptions.toSVGProperties(),t.defaultSVGProperties),!1,!1);return r}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){fw(`Not implemented`)}static get typesMap(){fw(`Not implemented`)}static get isDrawer(){return!0}static get supportMultipleDrawings(){return!1}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.#e.updateProperty(t,n);i&&this.#h(i),this.parent?.drawLayer.updateProperties(this._drawId,r.toSVGProperties()),e===this.colorType&&this.onUpdatedColor()};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})}_onResizing(){this.parent?.drawLayer.updateProperties(this._drawId,e._mergeSVGProperties(this.#e.getPathResizingSVGProperties(this.#m()),{bbox:this.#g()}))}_onResized(){this.parent?.drawLayer.updateProperties(this._drawId,e._mergeSVGProperties(this.#e.getPathResizedSVGProperties(this.#m()),{bbox:this.#g()}))}_onTranslating(e,t){this.parent?.drawLayer.updateProperties(this._drawId,{bbox:this.#g()})}_onTranslated(){this.parent?.drawLayer.updateProperties(this._drawId,e._mergeSVGProperties(this.#e.getPathTranslatedSVGProperties(this.#m(),this.parentDimensions),{bbox:this.#g()}))}_onStartDragging(){this.parent?.drawLayer.updateProperties(this._drawId,{rootClass:{moving:!0}})}_onStopDragging(){this.parent?.drawLayer.updateProperties(this._drawId,{rootClass:{moving:!1}})}commit(){super.commit(),this.disableEditMode(),this.disableEditing()}disableEditing(){super.disableEditing(),this.div.classList.toggle(`disabled`,!0)}enableEditing(){super.enableEditing(),this.div.classList.toggle(`disabled`,!1)}getBaseTranslation(){return[0,0]}get isResizable(){return!0}onceAdded(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.#d(),super.remove()}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(this.#f(),this.#h(this.#e.box),this.isAttachedToDOM||this.parent.add(this)))}setParent(e){let t=!1;this.parent&&!e?(this._uiManager.removeShouldRescale(this),this.#d()):e&&(this._uiManager.addShouldRescale(this),this.#f(e),t=!this.parent&&this.div?.classList.contains(`selectedEditor`)),super.setParent(e),t&&this.select()}#d(){this._drawId!==null&&this.parent&&(this.parent.drawLayer.remove(this._drawId),this._drawId=null,this._drawingOptions.reset())}#f(e=this.parent){this._drawId!==null&&this.parent===e||(this._drawId===null?(this._drawingOptions.updateAll(),this._drawId=this.#u(this.#e,e)):this.parent.drawLayer.updateParent(this._drawId,e.drawLayer))}#p([e,t,n,r]){let{parentDimensions:[i,a],rotation: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]}}#m(){let{x:e,y:t,width:n,height:r,parentDimensions:[i,a],rotation: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]}}#h(e){[this.x,this.y,this.width,this.height]=this.#p(e),this.div&&(this.fixAndSetPosition(),this.setDims()),this._onResized()}#g(){let{x:e,y:t,width:n,height:r,rotation:i,parentRotation:a,parentDimensions:[o,s]}=this;switch((4*i+a)/90){case 1:return[1-t-r,e,r,n];case 2:return[1-e-n,1-t-r,n,r];case 3:return[t,1-e-n,r,n];case 4:return[e,t-o/s*n,s/o*r,o/s*n];case 5:return[1-t,e,o/s*n,s/o*r];case 6:return[1-e-s/o*r,1-t,s/o*r,o/s*n];case 7:return[t-o/s*n,1-e-s/o*r,o/s*n,s/o*r];case 8:return[e-n,t-r,n,r];case 9:return[1-t,e-n,r,n];case 10:return[1-e,1-t,n,r];case 11:return[t-r,1-e,r,n];case 12:return[e-s/o*r,t,s/o*r,o/s*n];case 13:return[1-t-o/s*n,e-s/o*r,o/s*n,s/o*r];case 14:return[1-e,1-t-o/s*n,s/o*r,o/s*n];case 15:return[t,1-e,o/s*n,s/o*r];default:return[e,t,n,r]}}rotate(){this.parent&&this.parent.drawLayer.updateProperties(this._drawId,e._mergeSVGProperties({bbox:this.#g()},this.#e.updateRotation((this.parentRotation-this.rotation+360)%360)))}onScaleChanging(){this.parent&&this.#h(this.#e.updateParentDimensions(this.parentDimensions,this.parent.scale))}static onScaleChangingWhenDrawing(){}render(){if(this.div)return this.div;let e,t;this._isCopy&&(e=this.x,t=this.y);let n=super.render();n.classList.add(`draw`);let r=document.createElement(`div`);return n.append(r),r.setAttribute(`aria-hidden`,`true`),r.className=`internal`,this.setDims(),this._uiManager.addShouldRescale(this),this.disableEditing(),this._isCopy&&this._moveAfterPaste(e,t),n}static createDrawerInstance(e,t,n,r,i){fw(`Not implemented`)}static startDrawing(t,n,r,i){let{target:a,offsetX:o,offsetY:s,pointerId:c,pointerType:l}=i;if(e.#o&&e.#o!==l)return;let{viewport:{rotation:u}}=t,{width:d,height:f}=a.getBoundingClientRect(),p=e.#r=new AbortController,m=t.combinedSignal(p);e.#a||=c,e.#o??=l,window.addEventListener(`pointerup`,t=>{e.#a===t.pointerId?this._endDraw(t):e.#s?.delete(t.pointerId)},{signal:m}),window.addEventListener(`pointercancel`,t=>{e.#a===t.pointerId?this._currentParent.endDrawingSession():e.#s?.delete(t.pointerId)},{signal:m}),window.addEventListener(`pointerdown`,t=>{e.#o===t.pointerType&&((e.#s||=new Set).add(t.pointerId),e.#n.isCancellable()&&(e.#n.removeLastElement(),e.#n.isEmpty()?this._currentParent.endDrawingSession(!0):this._endDraw(null)))},{capture:!0,passive:!1,signal:m}),window.addEventListener(`contextmenu`,Jw,{signal:m}),a.addEventListener(`pointermove`,this._drawMove.bind(this),{signal:m}),a.addEventListener(`touchmove`,t=>{t.timeStamp===e.#c&&Yw(t)},{signal:m}),t.toggleDrawing(),n._editorUndoBar?.hide(),e.#n?t.drawLayer.updateProperties(this._currentDrawId,e.#n.startNew(o,s,d,f,u)):(n.updateUIForDefaultProperties(this),e.#n=this.createDrawerInstance(o,s,d,f,u),e.#i=this.getDefaultDrawingOptions(),this._currentParent=t,{id:this._currentDrawId}=t.drawLayer.draw(this._mergeSVGProperties(e.#i.toSVGProperties(),e.#n.defaultSVGProperties),!0,!1))}static _drawMove(t){if(e.#c=-1,!e.#n)return;let{offsetX:n,offsetY:r,pointerId:i}=t;e.#a===i&&(e.#s?.size>=1?this._endDraw(t):(this._currentParent.drawLayer.updateProperties(this._currentDrawId,e.#n.add(n,r)),e.#c=t.timeStamp,Yw(t)))}static _cleanup(t){t&&(this._currentDrawId=-1,this._currentParent=null,e.#n=null,e.#i=null,e.#o=null,e.#c=NaN),e.#r&&(e.#r.abort(),e.#r=null,e.#a=NaN,e.#s=null)}static _endDraw(t){let n=this._currentParent;if(n){if(n.toggleDrawing(!0),this._cleanup(!1),t?.target===n.div&&n.drawLayer.updateProperties(this._currentDrawId,e.#n.end(t.offsetX,t.offsetY)),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:zC.DRAW_STEP});return}this.endDrawing(!1)}}static endDrawing(t){let n=this._currentParent;if(!n)return null;if(n.toggleDrawing(!0),n.cleanUndoStack(zC.DRAW_STEP),!e.#n.isEmpty()){let{pageDimensions:[r,i],scale:a}=n,o=n.createAndAddNewEditor({offsetX:0,offsetY:0},!1,{drawId:this._currentDrawId,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){fw(`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),c=await super.deserialize(e,t,n);return c.createDrawingOptions(e),c.#l({drawOutlines:s}),c.#f(),c.onScaleChanging(),c.rotate(),c}serializeDraw(e){let[t,n]=this.pageTranslation,[r,i]=this.pageDimensions;return this.#e.serialize([t,n,r,i],e)}renderAnnotationElement(e){return e.updateEdited({rect:this.getPDFRect()}),null}static canCreateNewEmptyEditor(){return!1}},JO=class{#e=new Float64Array(6);#t;#n;#r;#i;#a;#o=``;#s=0;#c=new YO;#l;#u;constructor(e,t,n,r,i,a){this.#l=n,this.#u=r,this.#r=i,this.#i=a,[e,t]=this.#d(e,t);let o=this.#t=[NaN,NaN,NaN,NaN,e,t];this.#a=[e,t],this.#n=[{line:o,points:this.#a}],this.#e.set(o,0)}updateProperty(e,t){e===`stroke-width`&&(this.#i=t)}#d(e,t){return $._normalizePoint(e,t,this.#l,this.#u,this.#r)}isEmpty(){return!this.#n||this.#n.length===0}isCancellable(){return this.#a.length<=10}add(e,t){[e,t]=this.#d(e,t);let[n,r,i,a]=this.#e.subarray(2,6),o=e-i,s=t-a;return Math.hypot(this.#l*o,this.#u*s)<=2?null:(this.#a.push(e,t),isNaN(n)?(this.#e.set([i,a,e,t],2),this.#t.push(NaN,NaN,NaN,NaN,e,t),{path:{d:this.toSVGPath()}}):(isNaN(this.#e[0])&&this.#t.splice(6,6),this.#e.set([n,r,i,a,e,t],0),this.#t.push(...$.createBezierPoints(n,r,i,a,e,t)),{path:{d:this.toSVGPath()}}))}end(e,t){return this.add(e,t)||(this.#a.length===2?{path:{d:this.toSVGPath()}}:null)}startNew(e,t,n,r,i){this.#l=n,this.#u=r,this.#r=i,[e,t]=this.#d(e,t);let a=this.#t=[NaN,NaN,NaN,NaN,e,t];this.#a=[e,t];let o=this.#n.at(-1);return o&&(o.line=new Float32Array(o.line),o.points=new Float32Array(o.points)),this.#n.push({line:a,points:this.#a}),this.#e.set(a,0),this.#s=0,this.toSVGPath(),null}getLastElement(){return this.#n.at(-1)}setLastElement(e){return this.#n?(this.#n.push(e),this.#t=e.line,this.#a=e.points,this.#s=0,{path:{d:this.toSVGPath()}}):this.#c.setLastElement(e)}removeLastElement(){if(!this.#n)return this.#c.removeLastElement();this.#n.pop(),this.#o=``;for(let e=0,t=this.#n.length;e<t;e++){let{line:t,points:n}=this.#n[e];this.#t=t,this.#a=n,this.#s=0,this.toSVGPath()}return{path:{d:this.#o}}}toSVGPath(){let e=$.svgRound(this.#t[4]),t=$.svgRound(this.#t[5]);if(this.#a.length===2)return this.#o=`${this.#o} M ${e} ${t} Z`,this.#o;if(this.#a.length<=6){let n=this.#o.lastIndexOf(`M`);this.#o=`${this.#o.slice(0,n)} M ${e} ${t}`,this.#s=6}if(this.#a.length===4){let e=$.svgRound(this.#t[10]),t=$.svgRound(this.#t[11]);return this.#o=`${this.#o} L ${e} ${t}`,this.#s=12,this.#o}let n=[];this.#s===0&&(n.push(`M ${e} ${t}`),this.#s=6);for(let e=this.#s,t=this.#t.length;e<t;e+=6){let[t,r,i,a,o,s]=this.#t.slice(e,e+6).map($.svgRound);n.push(`C${t} ${r} ${i} ${a} ${o} ${s}`)}return this.#o+=n.join(` `),this.#s=this.#t.length,this.#o}getOutlines(e,t,n,r){let i=this.#n.at(-1);return i.line=new Float32Array(i.line),i.points=new Float32Array(i.points),this.#c.build(this.#n,e,t,n,this.#r,this.#i,r),this.#e=null,this.#t=null,this.#n=null,this.#o=null,this.#c}get defaultSVGProperties(){return{root:{viewBox:`0 0 10000 10000`},rootClass:{draw:!0},bbox:[0,0,1,1]}}},YO=class extends ${#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${$.svgRound(t[4])} ${$.svgRound(t[5])}`),t.length!==6)if(t.length===12&&isNaN(t[6]))e.push(`L${$.svgRound(t[10])} ${$.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($.svgRound);e.push(`C${r} ${i} ${a} ${o} ${s} ${c}`)}else e.push(`Z`);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=$._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=$._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=$._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=$._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=$._rescale,u=-e/n,d=t/r+1,f=1/n,p=-1/r;break;case 90:m=$._rescaleAndSwap,u=-t/r,d=-e/n,f=1/r,p=1/n;break;case 180:m=$._rescale,u=e/n+1,d=-t/r,f=-1/n,p=1/r;break;case 270:m=$._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($.createBezierPoints(r,i,o,s,t,c),3*(a-2)),[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=new Float32Array([1/0,1/0,-1/0,-1/0]);for(let{line:t}of this.#r){if(t.length<=12){for(let n=4,r=t.length;n<r;n+=6)Q.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);Q.bezierBoundingBox(n,r,a,o,s,c,l,u,e),n=l,r=u}}let[t,n]=this.#l();e[0]=Nw(e[0]-t,0,1),e[1]=Nw(e[1]-n,0,1),e[2]=Nw(e[2]+t,0,1),e[3]=Nw(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($.svgRound).join(` `)}get defaultProperties(){let[e,t]=this.#e;return{root:{viewBox:this.viewBox},path:{"transform-origin":`${$.svgRound(e)} ${$.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} ${$.svgRound(o)} ${$.svgRound(s)})`}getPathResizingSVGProperties([e,t,n,r]){let[i,a]=this.#l(),[o,s,c,l]=this.#e;if(Math.abs(c-i)<=$.PRECISION||Math.abs(l-a)<=$.PRECISION){let i=e+n/2-(o+c/2),a=t+r/2-(s+l/2);return{path:{"transform-origin":`${$.svgRound(e)} ${$.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":`${$.svgRound(o)} ${$.svgRound(s)}`,transform:`${this.rotationTransform} scale(${f} ${p}) translate(${$.svgRound(i)} ${$.svgRound(a)}) scale(${u} ${d}) translate(${$.svgRound(-i)} ${$.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)<=$.PRECISION||Math.abs(u-a)<=$.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)$._translate(e,i,a,e),$._translate(t,i,a,t);return{root:{viewBox:this.viewBox},path:{"transform-origin":`${$.svgRound(e)} ${$.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)$._rescale(e,p,m,d,f,e),$._rescale(t,p,m,d,f,t);return{root:{viewBox:this.viewBox},path:{"transform-origin":`${$.svgRound(e)} ${$.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)$._translate(e,o,s,e),$._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)$._rescale(n,o,s,e,t,n),$._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":`${$.svgRound(e)} ${$.svgRound(t)}`}}}get defaultSVGProperties(){let e=this.#e;return{root:{viewBox:this.viewBox},rootClass:{draw:!0},path:{d:this.toSVGPath(),"transform-origin":`${$.svgRound(e[0])} ${$.svgRound(e[1])}`,transform:this.rotationTransform||null},bbox:e}}},XO=class e extends KO{constructor(e){super(),this._viewParameters=e,super.updateProperties({fill:`none`,stroke:ET._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}},ZO=class e extends qO{static _type=`ink`;static _editorType=RC.INK;static _defaultDrawingOptions=null;constructor(e){super({...e,name:`inkEditor`}),this._willKeepAspectRatio=!0,this.defaultL10nId=`pdfjs-editor-ink-editor`}static initialize(e,t){ET.initialize(e,t),this._defaultDrawingOptions=new XO(t.viewParameters)}static getDefaultDrawingOptions(e){let t=this._defaultDrawingOptions.clone();return t.updateProperties(e),t}static get supportMultipleDrawings(){return!0}static get typesMap(){return gw(this,`typesMap`,new Map([[zC.INK_THICKNESS,`stroke-width`],[zC.INK_COLOR,`stroke`],[zC.INK_OPACITY,`stroke-opacity`]]))}static createDrawerInstance(e,t,n,r,i){return new JO(e,t,n,r,i,this._defaultDrawingOptions[`stroke-width`])}static deserializeDraw(e,t,n,r,i,a){return YO.deserialize(e,t,n,r,i,a)}static async deserialize(e,t,n){let r=null;if(e instanceof kO){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:RC.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 eO(this),[[`colorPicker`,this._colorPicker]]}get colorType(){return zC.INK_COLOR}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:Q.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:ET._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}},QO=class extends YO{toSVGPath(){let e=super.toSVGPath();return e.endsWith(`Z`)||(e+=`Z`),e}},$O=class{static#e={maxDim:512,sigmaSFactor:.02,sigmaR:25,kernelSize:16};static#t(e,t,n,r){return r-=t,(n-=e)===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;if(e[(n+this.#n[2*a])*t+(r+this.#n[2*a+1])]!==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;if(e[(n+this.#n[2*a])*t+(r+this.#n[2*a+1])]!==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,s=1,c=[];for(let e=1;e<n-1;e++){o=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)s+=1,--u;else{if(!(i>=1&&a[r+1]===0)){i!==1&&(o=Math.abs(i));continue}s+=1,u+=1,i>1&&(o=i)}let d=[n,e],f=u===n+1,p={isHole:f,points:d,id:s,parent:0},m;c.push(p);for(let e of c)if(e.id===o){m=e;break}m?m.isHole?p.parent=f?m.parent:o:p.parent=f?o:m.parent:p.parent=f?o:0;let h=this.#r(a,t,e,n,l,u,0);if(h===-1){a[r]=-s,a[r]!==1&&(o=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]=-s:a[p]===1&&(a[p]=s),c===e&&f===n&&b===v&&x===y){a[r]!==1&&(o=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}}p[f[s]=Math.round(d/m)]++}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,.5*y/2,1.5*b/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($.createBezierPoints(o,s,c,l,n,a),3*(e-2)),[o,s,c,l]=[c,l,n,a]}}if(d.length===0)return null;let g=o?new QO:new YO;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,o=1/0,s=-1/0,c=0;for(let t of e){c+=t.length;for(let e=2,n=t.length;e<n;e++){let n=t[e]-t[e-2];o=Math.min(o,n),s=Math.max(s,n)}}a=o>=-128&&s<=127?Int8Array:o>=-32768&&s<=32767?Int16Array:Int32Array;let l=e.length,u=8+3*l,d=new Uint32Array(u),f=0;d[f++]=u*Uint32Array.BYTES_PER_ELEMENT+(c-2*l)*a.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++]=a.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=a.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)}m.close();let g=await new Response(p.readable).arrayBuffer();return Pw(new Uint8Array(g))}static async decompressSignature(e){try{let n=(t=e,Uint8Array.fromBase64?Uint8Array.fromBase64(t):Tw(atob(t))),{readable:r,writable:i}=new DecompressionStream(`deflate-raw`),a=i.getWriter();await a.ready,a.write(n).then(async()=>{await a.ready,await a.close()}).catch(()=>{});let o=null,s=0;for await(let e of r)o||=new Uint8Array(new Uint32Array(e.buffer,0,4)[0]),o.set(e,s),s+=e.length;let c=new Uint32Array(o.buffer,0,o.length>>2),l=c[1];if(l!==0)throw Error(`Invalid version: ${l}`);let u=c[2],d=c[3],f=c[4]===0,p=c[5],m=c[6],h=c[7],g=[],_=(8+3*m)*Uint32Array.BYTES_PER_ELEMENT,v;switch(h){case Int8Array.BYTES_PER_ELEMENT:v=new Int8Array(o.buffer,_);break;case Int16Array.BYTES_PER_ELEMENT:v=new Int16Array(o.buffer,_);break;case Int32Array.BYTES_PER_ELEMENT:v=new Int32Array(o.buffer,_)}s=0;for(let e=0;e<m;e++){let t=c[3*e+8],n=new Float32Array(t+2);g.push(n);for(let t=0;t<2;t++)n[t]=c[3*e+8+t+1];for(let e=0;e<t;e++)n[e+2]=n[e]+v[s++]}return{areContours:f,thickness:p,outlines:g,width:u,height:d}}catch(e){return dw(`decompressSignature: ${e}`),null}var t}},ek=class e extends KO{constructor(){super(),super.updateProperties({fill:ET._defaultLineColor,"stroke-width":0})}clone(){let t=new e;return t.updateAll(this),t}},tk=class e extends XO{constructor(e){super(e),super.updateProperties({stroke:ET._defaultLineColor,"stroke-width":1})}clone(){let t=new e(this._viewParameters);return t.updateAll(this),t}},nk=class e extends qO{#e=!1;#t=null;#n=null;#r=null;static _type=`signature`;static _editorType=RC.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){ET.initialize(e,t),this._defaultDrawingOptions=new ek,this._defaultDrawnSignatureOptions=new tk(t.viewParameters)}static getDefaultDrawingOptions(e){let t=this._defaultDrawingOptions.clone();return t.updateProperties(e),t}static get supportMultipleDrawings(){return!1}static get typesMap(){return gw(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=$O.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:$O.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,c;this.#e=s instanceof QO,this.description=r,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 $O.process(t,n,r,i,e._INNER_MARGIN)}getFromText(t,n){let{rawDims:{pageWidth:r,pageHeight:i},rotation:a}=this.parent.viewport;return $O.extractContoursFromText(t,n,r,i,a,e._INNER_MARGIN)}getDrawnSignature(t){let{rawDims:{pageWidth:n,pageHeight:r},rotation:i}=this.parent.viewport;return $O.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?QO.deserialize(e,t,n,r,i,a):YO.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}},rk=class extends ET{#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=RC.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){ET.initialize(e,t)}static isHandlingMimeForPasting(e){return rT.includes(e)}static paste(e,t){t.pasteEditor({mode:RC.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)return this._uiManager.enableWaiting(!0),void this._uiManager.imageManager.getFromId(this.#t).then(e=>this.#d(e,!0)).finally(()=>this.#f());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=rT.join(`,`);let t=this._uiManager._signal;this.#n=new Promise(n=>{e.addEventListener(`change`,async()=>{if(e.files&&e.files.length!==0){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)}else this.remove();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(`pdfjs-editor-stamp-added-alert`)}copyCanvas(e,t,n=!1){e||=224;let{width:r,height:i}=this.#e,a=new nT,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`?iT.isDarkMode&&(d=`#8f8f9d`,f=`#42414d`):f=`black`;let p=15*a.sx,m=15*a.sy,h=new OffscreenCanvas(2*p,2*m),g=h.getContext(`2d`);g.fillStyle=d,g.fillRect(0,0,2*p,2*m),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=i>=16384?Math.floor(i/2)-1:Math.ceil(i/2)),a>2*t&&(a=a>=16384?Math.floor(a/2)-1: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 nT,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*Rw.PDF_TO_CSS_UNITS),r=Math.round(this.height*t*Rw.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 PO){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(`${Mw}${s}`))?.get(`aria-label`)||``;r=e={annotationType:RC.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)){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))}}else t.stamps.set(this.#t,{area:a,serialized:n}),n.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)}},ik=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([RO,ZO,rk,GO,nk].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()===RC.NONE}updateToolbar(e){this.#h.updateToolbar(e)}updateMode(t=this.#h.getMode()){switch(this.#S(),t){case RC.NONE:this.div.classList.toggle(`nonEditing`,!0),this.disableTextSelection(),this.togglePointerEvents(!1),this.toggleAnnotationLayerPointerEvents(!0),this.disableClick();return;case RC.INK:this.disableTextSelection(),this.togglePointerEvents(!0),this.enableClick();break;case RC.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===RC.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?.div.classList.toggle(`disabled`,!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)return void(this.#m=r);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(`^${LC}[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&&(e.stopPropagation(),e.preventDefault(),c.dblclick(e))},{signal:e,capture:!0})}let t=this.#n;if(t){let e=new Map,n=new Map;for(let r of this.#_)r.disableEditing(),r.annotationElementId?r.serialize()===null?(n.set(r.annotationElementId,r),this.getEditableAnnotation(r.annotationElementId)?.show(),r.remove()):e.set(r.annotationElementId,r):r.updateFakeAnnotationElement(t);let r=t.getEditableAnnotations();for(let t of r){let{id:r}=t.data;if(this.#h.isDeletedAnnotationElement(r)){t.updateEdited({deleted:!0});continue}let i=n.get(r);i?(i.resetAnnotationElement(t),i.show(!1),t.show()):(i=e.get(r),i&&(this.#h.addChangedExistingAnnotation(i),i.renderAnnotationElement(t)&&i.show(!1)),t.show())}}this.#S(),this.isEmpty&&(this.div.hidden=!0);let{classList:n}=this.div;for(let t of e.#g.values())n.remove(`${t._type}Editing`);this.disableTextSelection(),this.toggleAnnotationLayerPointerEvents(!0),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`))&&this.#d.div.contains(t)){let{isMac:t}=Ew.platform;if(e.button!==0||e.ctrlKey&&t)return;this.#h.showAllEditors(`highlight`,!0,!0),this.#d.div.classList.add(`free`),this.toggleDrawing(),GO.startHighlighting(this,this.#h.direction===`ltr`,{target:this.#d.div,x:e.x,y:e.y}),this.#d.div.addEventListener(`pointerup`,()=>{this.#d.div.classList.remove(`free`),this.toggleDrawing(!0)},{once:!0,signal:this.#h._signal}),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.annotationElementId),ET.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}getNextId(){return this.#h.getId()}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.getNextId(),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.getNextId(),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=(i+Math.min(window.innerWidth,e+n))/2-e,s=(a+Math.min(window.innerHeight,t+r))/2-t,[c,l]=this.viewport.rotation%180==0?[o,s]:[s,o];return{offsetX:c,offsetY:l}}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}=Ew.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)return void(this.#t=!0);let n=this.#h.getMode();n!==RC.STAMP&&n!==RC.SIGNATURE?this.createAndAddNewEditor(e,!1):this.#h.unselectAll()}pointerdown(e){if(this.#h.getMode()===RC.HIGHLIGHT&&this.enableTextSelection(),this.#o)return void(this.#o=!1);let{isMac:t}=Ew.platform;if(e.button!==0||e.ctrlKey&&t||e.target!==this.div)return;if(this.#o=!0,this.#y?.isDrawer)return void this.startDrawingSession(e);let n=this.#h.getActive();this.#t=!n||n.isEmpty()}startDrawingSession(e){if(this.div.focus({preventScroll:!0}),this.#l)return void this.#y.startDrawing(this,this.#h,!1,e);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);return}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&&(r.changeParent(e),!0)}commitOrRemove(){return!!this.#l&&(this.endDrawingSession(),!0)}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()}render({viewport:e}){this.viewport=e,tT(this.div,e);for(let e of this.#h.getEditors(this.pageIndex))this.add(e),e.rebuild();this.updateMode()}update({viewport:e}){this.#h.commitOrRemove(),this.#S();let t=this.viewport.rotation,n=e.rotation;if(this.viewport=e,tT(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}},ak=class e{#e=null;#t=new Map;#n=new Map;static#r=0;constructor({pageIndex:e}){this.pageIndex=e}setParent(e){if(this.#e){if(this.#e!==e){if(this.#t.size>0)for(let t of this.#t.values())t.remove(),e.append(t);this.#e=e}}else this.#e=e}static get _svgFactory(){return gw(this,`_svgFactory`,new aO)}static#i(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+`%`}#a(){let t=e._svgFactory.create(1,1,!0);return this.#e.append(t),t.setAttribute(`aria-hidden`,!0),t}#o(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}#s(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.#r++,a=this.#a(),o=e._svgFactory.createElement(`defs`);a.append(o);let s=e._svgFactory.createElement(`path`);o.append(s);let c=`path_p${this.pageIndex}_${i}`;s.setAttribute(`id`,c),s.setAttribute(`vector-effect`,`non-scaling-stroke`),n&&this.#n.set(i,s);let l=r?this.#o(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.#r++,i=this.#a(),a=e._svgFactory.createElement(`defs`);i.append(a);let o=e._svgFactory.createElement(`path`);a.append(o);let s=`path_p${this.pageIndex}_${r}`,c;if(o.setAttribute(`id`,s),o.setAttribute(`vector-effect`,`non-scaling-stroke`),n){let t=e._svgFactory.createElement(`mask`);a.append(t),c=`mask_p${this.pageIndex}_${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.#n.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.#s(s,r),i&&e.#i(s,i),a){let{classList:e}=s;for(let[t,n]of Object.entries(a))e.toggle(t,n)}if(o){let e=s.firstChild.firstChild;this.#s(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.#n.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.#n.clear()}};globalThis._pdfjsTestingUtils={HighlightOutliner:VO},globalThis.pdfjsLib={AbortException:Cw,AnnotationEditorLayer:ik,AnnotationEditorParamsType:zC,AnnotationEditorType:RC,AnnotationEditorUIManager:ST,AnnotationLayer:IO,AnnotationMode:IC,AnnotationType:JC,applyOpacity:oT,build:QD,ColorPicker:$D,createValidAbsoluteUrl:mw,CSSConstants:aT,DOMSVGFactory:aO,DrawLayer:ak,FeatureTest:Ew,fetchData:zw,findContrastColor:fT,getDocument:HD,getFilenameFromUrl:Ww,getPdfFilenameFromUrl:Gw,getRGB:Qw,getUuid:jw,getXfaPageViewport:Zw,GlobalWorkerOptions:fD,ImageKind:qC,InvalidPDFException:bw,isDataScheme:Hw,isPdfFile:Uw,isValidExplicitDest:zT,MathClamp:Nw,noContextMenu:Jw,normalizeUnicode:Aw,OPS:tw,OutputScale:nT,PasswordResponses:ow,PDFDataRangeTransport:WD,PDFDateString:Xw,PDFWorker:qD,PermissionFlag:BC,PixelsPerInch:Rw,RenderingCancelledException:Vw,renderRichText:pT,ResponseException:xw,setLayerDimensions:tT,shadow:gw,SignatureExtractor:$O,stopEvent:Yw,SupportedImageMimeTypes:rT,TextLayer:VD,TouchManager:TT,updateUrlHash:hw,Util:Q,VerbosityLevel:ew,version:ZD,XfaLayer:Iw};export{Cw as AbortException,ik as AnnotationEditorLayer,zC as AnnotationEditorParamsType,RC as AnnotationEditorType,ST as AnnotationEditorUIManager,IO as AnnotationLayer,IC as AnnotationMode,JC as AnnotationType,aT as CSSConstants,$D as ColorPicker,aO as DOMSVGFactory,ak as DrawLayer,Ew as FeatureTest,fD as GlobalWorkerOptions,qC as ImageKind,bw as InvalidPDFException,Nw as MathClamp,tw as OPS,nT as OutputScale,WD as PDFDataRangeTransport,Xw as PDFDateString,qD as PDFWorker,ow as PasswordResponses,BC as PermissionFlag,Rw as PixelsPerInch,Vw as RenderingCancelledException,xw as ResponseException,$O as SignatureExtractor,rT as SupportedImageMimeTypes,VD as TextLayer,TT as TouchManager,Q as Util,ew as VerbosityLevel,Iw as XfaLayer,oT as applyOpacity,QD as build,mw as createValidAbsoluteUrl,zw as fetchData,fT as findContrastColor,HD as getDocument,Ww as getFilenameFromUrl,Gw as getPdfFilenameFromUrl,Qw as getRGB,jw as getUuid,Zw as getXfaPageViewport,Hw as isDataScheme,Uw as isPdfFile,zT as isValidExplicitDest,Jw as noContextMenu,Aw as normalizeUnicode,pT as renderRichText,tT as setLayerDimensions,gw as shadow,Yw as stopEvent,hw as updateUrlHash,ZD as version};
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()}},$=class{static PRECISION=1e-4;toSVGPath(){fw("Abstract method `toSVGPath` must be implemented.")}get box(){fw("Abstract getter `box` must be implemented.")}serialize(e,t){fw("Abstract method `serialize` must be implemented.")}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(1e4*e)}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 _normalizePagePoint(e,t,n){switch(n){case 90:return[1-t,e];case 180:return[1-e,1-t];case 270:return[t,1-e];default:return[e,t]}}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]}},zO=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({x:t,y: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])}#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({x:e,y: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=h/p,b=-g/p*this.#d,x=y*this.#d;return this.#a.set(this.#a.subarray(2,8),0),this.#a.set([c+b,l+x],4),this.#a.set(this.#a.subarray(14,18),12),this.#a.set([c-b,l-x],16),isNaN(this.#a[6])?(this.#i.length===0&&(this.#a.set([o+b,s+x],2),this.#i.push(NaN,NaN,NaN,NaN,(o+b-n)/i,(s+x-r)/a),this.#a.set([o-b,s-x],14),this.#t.push(NaN,NaN,NaN,NaN,(o-b-n)/i,(s-x-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 BO(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}},BO=class extends ${#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=$._rescale(this.#o,e,r,a,-o),c=$._rescale(this.#i,e,r,a,-o);break;case 90:s=$._rescaleAndSwap(this.#o,e,t,a,o),c=$._rescaleAndSwap(this.#i,e,t,a,o);break;case 180:s=$._rescale(this.#o,n,t,-a,o),c=$._rescale(this.#i,n,t,-a,o);break;case 270:s=$._rescaleAndSwap(this.#o,n,r,-a,-o),c=$._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])?(Q.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[0]=u[1]=1/0,u[2]=u[3]=-1/0,Q.bezierBoundingBox(n,r,...t.slice(e,e+6),u),Q.rectBoundingBox(u[0],u[1],u[2],u[3],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=0){return new zO(e,t,n,r,i,a)}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.newOutliner({x:this.#i[0]*u+f,y:this.#i[1]*d+p},this.#e,this.#a,e,this.#r,t??this.#n);for(let e=2;e<this.#i.length;e+=2)m.add({x:this.#i[e]*u+f,y:this.#i[e+1]*d+p});return m.getOutlines()}},VO=class{#e;#t;#n;#r=[];#i=[];constructor(e,t=0,n=0,r=!0){let i=[1/0,1/0,-1/0,-1/0],a=1e-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),Q.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=[],i;for(;n.size>0;){let e=n.values().next().value,[t,a,o,s,c]=e;n.delete(e);let l=t,u=a;for(i=[t,o],r.push(i);;){let e;if(n.has(s))e=s;else{if(!n.has(c))break;e=c}n.delete(e),[t,a,o,s,c]=e,l!==t&&(i.push(l,u,t,u===a?a:o),l=t),u=u===a?o:a}i.push(l,u)}return new HO(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)return void this.#i.splice(r,1)}for(let r=n-1;r>=0;r--){let[n,i]=this.#i[r];if(n!==e)break;if(n===e&&i===t)return void this.#i.splice(r,1)}}#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}},HO=class extends ${#e;#t;constructor(e,t,n,r){super(),this.#t=e,this.#e=t,this.firstPoint=n,this.lastPoint=r}toSVGPath(){let e=[];for(let t of this.#t){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.#t){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}get classNamesForOutlining(){return[`highlightOutline`]}},UO=class extends zO{newFreeDrawOutline(e,t,n,r,i,a){return new WO(e,t,n,r,i,a)}},WO=class extends BO{newOutliner(e,t,n,r,i,a=0){return new UO(e,t,n,r,i,a)}},GO=class e extends ET{#e=null;#t=0;#n;#r=null;#i=null;#a=null;#o=null;#s=0;#c=null;#l=null;#u=null;#d=!1;#f=null;#p=null;#m=null;#h=``;#g;#_=``;static _defaultColor=null;static _defaultOpacity=1;static _defaultThickness=12;static _type=`highlight`;static _editorType=RC.HIGHLIGHT;static _freeHighlightId=-1;static _freeHighlight=null;static _freeHighlightClipId=``;static get _keyboardManager(){let t=e.prototype;return gw(this,`_keyboardManager`,new bT([[[`ArrowLeft`,`mac+ArrowLeft`],t._moveCaret,{args:[0]}],[[`ArrowRight`,`mac+ArrowRight`],t._moveCaret,{args:[1]}],[[`ArrowUp`,`mac+ArrowUp`],t._moveCaret,{args:[2]}],[[`ArrowDown`,`mac+ArrowDown`],t._moveCaret,{args:[3]}]]))}constructor(t){super({...t,name:`highlightEditor`}),this.color=t.color||e._defaultColor,this.#g=t.thickness||e._defaultThickness,this.opacity=t.opacity||e._defaultOpacity,this.#n=t.boxes||null,this.#_=t.methodOfCreation||``,this.#h=t.text||``,this._isDraggable=!1,this.defaultL10nId=`pdfjs-editor-highlight-editor`,t.highlightId>-1?(this.#d=!0,this.#y(t),this.#w()):this.#n&&(this.#e=t.anchorNode,this.#t=t.anchorOffset,this.#o=t.focusNode,this.#s=t.focusOffset,this.#v(),this.#w(),this.rotate(this.rotation)),this.annotationElementId||this._uiManager.a11yAlert(`pdfjs-editor-highlight-added-alert`)}get telemetryInitialData(){return{action:`added`,type:this.#d?`free_highlight`:`highlight`,color:this._uiManager.getNonHCMColorName(this.color),thickness:this.#g,methodOfCreation:this.#_}}get telemetryFinalData(){return{type:`highlight`,color:this._uiManager.getNonHCMColorName(this.color)}}static computeTelemetryFinalData(e){return{numberOfColors:e.get(`color`).size}}#v(){let e=new VO(this.#n,.001);this.#l=e.getOutlines(),[this.x,this.y,this.width,this.height]=this.#l.box;let t=new VO(this.#n,.0025,.001,this._uiManager.direction===`ltr`);this.#a=t.getOutlines();let{firstPoint:n}=this.#l;this.#f=[(n[0]-this.x)/this.width,(n[1]-this.y)/this.height];let{lastPoint:r}=this.#a;this.#p=[(r[0]-this.x)/this.width,(r[1]-this.y)/this.height]}#y({highlightOutlines:t,highlightId:n,clipPathId:r}){if(this.#l=t,this.#a=t.getNewOutline(this.#g/2+1.5,.0025),n>=0)this.#u=n,this.#r=r,this.parent.drawLayer.finalizeDraw(n,{bbox:t.box,path:{d:t.toSVGPath()}}),this.#m=this.parent.drawLayer.drawOutline({rootClass:{highlightOutline:!0,free:!0},bbox:this.#a.box,path:{d:this.#a.toSVGPath()}},!0);else if(this.parent){let n=this.parent.viewport.rotation;this.parent.drawLayer.updateProperties(this.#u,{bbox:e.#T(this.#l.box,(n-this.rotation+360)%360),path:{d:t.toSVGPath()}}),this.parent.drawLayer.updateProperties(this.#m,{bbox:e.#T(this.#a.box,n),path:{d:this.#a.toSVGPath()}})}let[i,a,o,s]=t.box;switch(this.rotation){case 0:this.x=i,this.y=a,this.width=o,this.height=s;break;case 90:{let[e,t]=this.parentDimensions;this.x=a,this.y=1-i,this.width=o*t/e,this.height=s*e/t;break}case 180:this.x=1-i,this.y=1-a,this.width=o,this.height=s;break;case 270:{let[e,t]=this.parentDimensions;this.x=1-a,this.y=i,this.width=o*t/e,this.height=s*e/t;break}}let{firstPoint:c}=t;this.#f=[(c[0]-i)/o,(c[1]-a)/s];let{lastPoint:l}=this.#a;this.#p=[(l[0]-i)/o,(l[1]-a)/s]}static initialize(t,n){ET.initialize(t,n),e._defaultColor||=n.highlightColors?.values().next().value||`#fff066`}static updateDefaultParams(t,n){switch(t){case zC.HIGHLIGHT_COLOR:e._defaultColor=n;break;case zC.HIGHLIGHT_THICKNESS:e._defaultThickness=n}}translateInPage(e,t){}get toolbarPosition(){return this.#p}get commentButtonPosition(){return this.#f}updateParams(e,t){switch(e){case zC.HIGHLIGHT_COLOR:this.#b(t);break;case zC.HIGHLIGHT_THICKNESS:this.#x(t)}}static get defaultPropertiesToUpdate(){return[[zC.HIGHLIGHT_COLOR,e._defaultColor],[zC.HIGHLIGHT_THICKNESS,e._defaultThickness]]}get propertiesToUpdate(){return[[zC.HIGHLIGHT_COLOR,this.color||e._defaultColor],[zC.HIGHLIGHT_THICKNESS,this.#g||e._defaultThickness],[zC.HIGHLIGHT_FREE,this.#d]]}onUpdatedColor(){this.parent?.drawLayer.updateProperties(this.#u,{root:{fill:this.color,"fill-opacity":this.opacity}}),this.#i?.updateColor(this.color),super.onUpdatedColor()}#b(t){let n=(e,t)=>{this.color=e,this.opacity=t,this.onUpdatedColor()},r=this.color,i=this.opacity;this.addCommands({cmd:n.bind(this,t,e._defaultOpacity),undo:n.bind(this,r,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:zC.HIGHLIGHT_COLOR,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:`color_changed`,color:this._uiManager.getNonHCMColorName(t)},!0)}#x(e){let t=this.#g,n=e=>{this.#g=e,this.#S(e)};this.addCommands({cmd:n.bind(this,e),undo:n.bind(this,t),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:zC.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:`thickness_changed`,thickness:e},!0)}get toolbarButtons(){return this._uiManager.highlightColors?[[`colorPicker`,this.#i=new $D({editor:this})]]:super.toolbarButtons}disableEditing(){super.disableEditing(),this.div.classList.toggle(`disabled`,!0)}enableEditing(){super.enableEditing(),this.div.classList.toggle(`disabled`,!1)}fixAndSetPosition(){return super.fixAndSetPosition(this.#O())}getBaseTranslation(){return[0,0]}getRect(e,t){return super.getRect(e,t,this.#O())}onceAdded(e){this.annotationElementId||this.parent.addUndoableEditor(this),e&&this.div.focus()}remove(){this.#C(),this._reportTelemetry({action:`deleted`}),super.remove()}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(this.#w(),this.isAttachedToDOM||this.parent.add(this)))}setParent(e){let t=!1;this.parent&&!e?this.#C():e&&(this.#w(e),t=!this.parent&&this.div?.classList.contains(`selectedEditor`)),super.setParent(e),this.show(this._isVisible),t&&this.select()}#S(e){this.#d&&(this.#y({highlightOutlines:this.#l.getNewOutline(e/2)}),this.fixAndSetPosition(),this.setDims(this.width,this.height))}#C(){this.#u!==null&&this.parent&&(this.parent.drawLayer.remove(this.#u),this.#u=null,this.parent.drawLayer.remove(this.#m),this.#m=null)}#w(e=this.parent){this.#u===null&&({id:this.#u,clipPathId:this.#r}=e.drawLayer.draw({bbox:this.#l.box,root:{viewBox:`0 0 1 1`,fill:this.color,"fill-opacity":this.opacity},rootClass:{highlight:!0,free:this.#d},path:{d:this.#l.toSVGPath()}},!1,!0),this.#m=e.drawLayer.drawOutline({rootClass:{highlightOutline:!0,free:this.#d},bbox:this.#a.box,path:{d:this.#a.toSVGPath()}},this.#d),this.#c&&(this.#c.style.clipPath=this.#r))}static#T([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]}rotate(t){let{drawLayer:n}=this.parent,r;this.#d?(t=(t-this.rotation+360)%360,r=e.#T(this.#l.box,t)):r=e.#T([this.x,this.y,this.width,this.height],t),n.updateProperties(this.#u,{bbox:r,root:{"data-main-rotation":t}}),n.updateProperties(this.#m,{bbox:e.#T(this.#a.box,t),root:{"data-main-rotation":t}})}render(){if(this.div)return this.div;let e=super.render();this.#h&&(e.setAttribute(`aria-label`,this.#h),e.setAttribute(`role`,`mark`)),this.#d?e.classList.add(`free`):this.div.addEventListener(`keydown`,this.#E.bind(this),{signal:this._uiManager._signal});let t=this.#c=document.createElement(`div`);return e.append(t),t.setAttribute(`aria-hidden`,`true`),t.className=`internal`,t.style.clipPath=this.#r,this.setDims(this.width,this.height),gT(this,this.#c,[`pointerover`,`pointerleave`]),this.enableEditing(),e}pointerover(){this.isSelected||this.parent?.drawLayer.updateProperties(this.#m,{rootClass:{hovered:!0}})}pointerleave(){this.isSelected||this.parent?.drawLayer.updateProperties(this.#m,{rootClass:{hovered:!1}})}#E(t){e._keyboardManager.exec(this,t)}_moveCaret(e){switch(this.parent.unselect(this),e){case 0:case 2:this.#D(!0);break;case 1:case 3:this.#D(!1)}}#D(e){if(!this.#e)return;let t=window.getSelection();e?t.setPosition(this.#e,this.#t):t.setPosition(this.#o,this.#s)}select(){super.select(),this.#m&&this.parent?.drawLayer.updateProperties(this.#m,{rootClass:{hovered:!1,selected:!0}})}unselect(){super.unselect(),this.#m&&(this.parent?.drawLayer.updateProperties(this.#m,{rootClass:{selected:!1}}),this.#d||this.#D(!1))}get _mustFixPosition(){return!this.#d}show(e=this._isVisible){super.show(e),this.parent&&(this.parent.drawLayer.updateProperties(this.#u,{rootClass:{hidden:!e}}),this.parent.drawLayer.updateProperties(this.#m,{rootClass:{hidden:!e}}))}#O(){return this.#d?this.rotation:0}#k(){if(this.#d)return null;let[e,t]=this.pageDimensions,[n,r]=this.pageTranslation,i=this.#n,a=new Float32Array(8*i.length),o=0;for(let{x:s,y:c,width:l,height:u}of i){let i=s*e+n,d=(1-c)*t+r;a[o]=a[o+4]=i,a[o+1]=a[o+3]=d,a[o+2]=a[o+6]=i+l*e,a[o+5]=a[o+7]=d-u*t,o+=8}return a}#A(e){return this.#l.serialize(e,this.#O())}static startHighlighting(e,t,{target:n,x:r,y:i}){let{x:a,y:o,width:s,height:c}=n.getBoundingClientRect(),l=new AbortController,u=e.combinedSignal(l),d=t=>{l.abort(),this.#M(e,t)};window.addEventListener(`blur`,d,{signal:u}),window.addEventListener(`pointerup`,d,{signal:u}),window.addEventListener(`pointerdown`,Yw,{capture:!0,passive:!1,signal:u}),window.addEventListener(`contextmenu`,Jw,{signal:u}),n.addEventListener(`pointermove`,this.#j.bind(this,e),{signal:u}),this._freeHighlight=new UO({x:r,y:i},[a,o,s,c],e.scale,this._defaultThickness/2,t,.001),{id:this._freeHighlightId,clipPathId:this._freeHighlightClipId}=e.drawLayer.draw({bbox:[0,0,1,1],root:{viewBox:`0 0 1 1`,fill:this._defaultColor,"fill-opacity":this._defaultOpacity},rootClass:{highlight:!0,free:!0},path:{d:this._freeHighlight.toSVGPath()}},!0,!0)}static#j(e,t){this._freeHighlight.add(t)&&e.drawLayer.updateProperties(this._freeHighlightId,{path:{d:this._freeHighlight.toSVGPath()}})}static#M(e,t){this._freeHighlight.isEmpty()?e.drawLayer.remove(this._freeHighlightId):e.createAndAddNewEditor(t,!1,{highlightId:this._freeHighlightId,highlightOutlines:this._freeHighlight.getOutlines(),clipPathId:this._freeHighlightClipId,methodOfCreation:`main_toolbar`}),this._freeHighlightId=-1,this._freeHighlight=null,this._freeHighlightClipId=``}static async deserialize(e,t,n){let r=null;if(e instanceof AO){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:RC.HIGHLIGHT,color:Array.from(o),opacity:s,quadPoints:t,boxes:null,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 kO){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:RC.HIGHLIGHT,color:Array.from(o),thickness:s,inkLists:t,boxes:null,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{color:i,quadPoints:a,inkLists:o,opacity:s}=e,c=await super.deserialize(e,t,n);c.color=Q.makeHexColor(...i),c.opacity=s||1,o&&(c.#g=e.thickness),c._initialData=r,e.comment&&c.setCommentData(e);let[l,u]=c.pageDimensions,[d,f]=c.pageTranslation;if(a){let e=c.#n=[];for(let t=0;t<a.length;t+=8)e.push({x:(a[t]-d)/l,y:1-(a[t+1]-f)/u,width:(a[t+2]-a[t])/l,height:(a[t+1]-a[t+5])/u});c.#v(),c.#w(),c.rotate(c.rotation)}else if(o){c.#d=!0;let e=o[0],n={x:e[0]-d,y:u-(e[1]-f)},r=new UO(n,[0,0,l,u],1,c.#g/2,!0,.001);for(let t=0,i=e.length;t<i;t+=2)n.x=e[t]-d,n.y=u-(e[t+1]-f),r.add(n);let{id:i,clipPathId:a}=t.drawLayer.draw({bbox:[0,0,1,1],root:{viewBox:`0 0 1 1`,fill:c.color,"fill-opacity":c._defaultOpacity},rootClass:{highlight:!0,free:!0},path:{d:r.toSVGPath()}},!0,!0);c.#y({highlightOutlines:r.getOutlines(),highlightId:i,clipPathId:a}),c.#w(),c.rotate(c.parentRotation)}return c}serialize(e=!1){if(this.isEmpty()||e)return null;if(this.deleted)return this.serializeDeleted();let t=ET._colorManager.convert(this._uiManager.getNonHCMColor(this.color)),n=super.serialize(e);return Object.assign(n,{color:t,opacity:this.opacity,thickness:this.#g,quadPoints:this.#k(),outlines:this.#A(n.rect)}),this.addComment(n),this.annotationElementId&&!this.#N(n)?null:(n.id=this.annotationElementId,n)}#N(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)}static canCreateNewEmptyEditor(){return!1}},KO=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(){fw(`Not implemented`)}},qO=class e extends ET{#e=null;#t;_colorPicker=null;_drawId=null;static _currentDrawId=-1;static _currentParent=null;static#n=null;static#r=null;static#i=null;static#a=NaN;static#o=null;static#s=null;static#c=NaN;static _INNER_MARGIN=3;constructor(e){super(e),this.#t=e.mustBeCommitted||!1,this._addOutlines(e)}onUpdatedColor(){this._colorPicker?.update(this.color),super.onUpdatedColor()}_addOutlines(e){e.drawOutlines&&(this.#l(e),this.#f())}#l({drawOutlines:e,drawId:t,drawingOptions:n}){this.#e=e,this._drawingOptions||=n,this.annotationElementId||this._uiManager.a11yAlert(`pdfjs-editor-${this.editorType}-added-alert`),t>=0?(this._drawId=t,this.parent.drawLayer.finalizeDraw(t,e.defaultProperties)):this._drawId=this.#u(e,this.parent),this.#h(e.box)}#u(t,n){let{id:r}=n.drawLayer.draw(e._mergeSVGProperties(this._drawingOptions.toSVGProperties(),t.defaultSVGProperties),!1,!1);return r}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){fw(`Not implemented`)}static get typesMap(){fw(`Not implemented`)}static get isDrawer(){return!0}static get supportMultipleDrawings(){return!1}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.#e.updateProperty(t,n);i&&this.#h(i),this.parent?.drawLayer.updateProperties(this._drawId,r.toSVGProperties()),e===this.colorType&&this.onUpdatedColor()};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})}_onResizing(){this.parent?.drawLayer.updateProperties(this._drawId,e._mergeSVGProperties(this.#e.getPathResizingSVGProperties(this.#m()),{bbox:this.#g()}))}_onResized(){this.parent?.drawLayer.updateProperties(this._drawId,e._mergeSVGProperties(this.#e.getPathResizedSVGProperties(this.#m()),{bbox:this.#g()}))}_onTranslating(e,t){this.parent?.drawLayer.updateProperties(this._drawId,{bbox:this.#g()})}_onTranslated(){this.parent?.drawLayer.updateProperties(this._drawId,e._mergeSVGProperties(this.#e.getPathTranslatedSVGProperties(this.#m(),this.parentDimensions),{bbox:this.#g()}))}_onStartDragging(){this.parent?.drawLayer.updateProperties(this._drawId,{rootClass:{moving:!0}})}_onStopDragging(){this.parent?.drawLayer.updateProperties(this._drawId,{rootClass:{moving:!1}})}commit(){super.commit(),this.disableEditMode(),this.disableEditing()}disableEditing(){super.disableEditing(),this.div.classList.toggle(`disabled`,!0)}enableEditing(){super.enableEditing(),this.div.classList.toggle(`disabled`,!1)}getBaseTranslation(){return[0,0]}get isResizable(){return!0}onceAdded(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.#d(),super.remove()}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(this.#f(),this.#h(this.#e.box),this.isAttachedToDOM||this.parent.add(this)))}setParent(e){let t=!1;this.parent&&!e?(this._uiManager.removeShouldRescale(this),this.#d()):e&&(this._uiManager.addShouldRescale(this),this.#f(e),t=!this.parent&&this.div?.classList.contains(`selectedEditor`)),super.setParent(e),t&&this.select()}#d(){this._drawId!==null&&this.parent&&(this.parent.drawLayer.remove(this._drawId),this._drawId=null,this._drawingOptions.reset())}#f(e=this.parent){this._drawId!==null&&this.parent===e||(this._drawId===null?(this._drawingOptions.updateAll(),this._drawId=this.#u(this.#e,e)):this.parent.drawLayer.updateParent(this._drawId,e.drawLayer))}#p([e,t,n,r]){let{parentDimensions:[i,a],rotation: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]}}#m(){let{x:e,y:t,width:n,height:r,parentDimensions:[i,a],rotation: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]}}#h(e){[this.x,this.y,this.width,this.height]=this.#p(e),this.div&&(this.fixAndSetPosition(),this.setDims()),this._onResized()}#g(){let{x:e,y:t,width:n,height:r,rotation:i,parentRotation:a,parentDimensions:[o,s]}=this;switch((4*i+a)/90){case 1:return[1-t-r,e,r,n];case 2:return[1-e-n,1-t-r,n,r];case 3:return[t,1-e-n,r,n];case 4:return[e,t-o/s*n,s/o*r,o/s*n];case 5:return[1-t,e,o/s*n,s/o*r];case 6:return[1-e-s/o*r,1-t,s/o*r,o/s*n];case 7:return[t-o/s*n,1-e-s/o*r,o/s*n,s/o*r];case 8:return[e-n,t-r,n,r];case 9:return[1-t,e-n,r,n];case 10:return[1-e,1-t,n,r];case 11:return[t-r,1-e,r,n];case 12:return[e-s/o*r,t,s/o*r,o/s*n];case 13:return[1-t-o/s*n,e-s/o*r,o/s*n,s/o*r];case 14:return[1-e,1-t-o/s*n,s/o*r,o/s*n];case 15:return[t,1-e,o/s*n,s/o*r];default:return[e,t,n,r]}}rotate(){this.parent&&this.parent.drawLayer.updateProperties(this._drawId,e._mergeSVGProperties({bbox:this.#g()},this.#e.updateRotation((this.parentRotation-this.rotation+360)%360)))}onScaleChanging(){this.parent&&this.#h(this.#e.updateParentDimensions(this.parentDimensions,this.parent.scale))}static onScaleChangingWhenDrawing(){}render(){if(this.div)return this.div;let e,t;this._isCopy&&(e=this.x,t=this.y);let n=super.render();n.classList.add(`draw`);let r=document.createElement(`div`);return n.append(r),r.setAttribute(`aria-hidden`,`true`),r.className=`internal`,this.setDims(),this._uiManager.addShouldRescale(this),this.disableEditing(),this._isCopy&&this._moveAfterPaste(e,t),n}static createDrawerInstance(e,t,n,r,i){fw(`Not implemented`)}static startDrawing(t,n,r,i){let{target:a,offsetX:o,offsetY:s,pointerId:c,pointerType:l}=i;if(e.#o&&e.#o!==l)return;let{viewport:{rotation:u}}=t,{width:d,height:f}=a.getBoundingClientRect(),p=e.#r=new AbortController,m=t.combinedSignal(p);e.#a||=c,e.#o??=l,window.addEventListener(`pointerup`,t=>{e.#a===t.pointerId?this._endDraw(t):e.#s?.delete(t.pointerId)},{signal:m}),window.addEventListener(`pointercancel`,t=>{e.#a===t.pointerId?this._currentParent.endDrawingSession():e.#s?.delete(t.pointerId)},{signal:m}),window.addEventListener(`pointerdown`,t=>{e.#o===t.pointerType&&((e.#s||=new Set).add(t.pointerId),e.#n.isCancellable()&&(e.#n.removeLastElement(),e.#n.isEmpty()?this._currentParent.endDrawingSession(!0):this._endDraw(null)))},{capture:!0,passive:!1,signal:m}),window.addEventListener(`contextmenu`,Jw,{signal:m}),a.addEventListener(`pointermove`,this._drawMove.bind(this),{signal:m}),a.addEventListener(`touchmove`,t=>{t.timeStamp===e.#c&&Yw(t)},{signal:m}),t.toggleDrawing(),n._editorUndoBar?.hide(),e.#n?t.drawLayer.updateProperties(this._currentDrawId,e.#n.startNew(o,s,d,f,u)):(n.updateUIForDefaultProperties(this),e.#n=this.createDrawerInstance(o,s,d,f,u),e.#i=this.getDefaultDrawingOptions(),this._currentParent=t,{id:this._currentDrawId}=t.drawLayer.draw(this._mergeSVGProperties(e.#i.toSVGProperties(),e.#n.defaultSVGProperties),!0,!1))}static _drawMove(t){if(e.#c=-1,!e.#n)return;let{offsetX:n,offsetY:r,pointerId:i}=t;e.#a===i&&(e.#s?.size>=1?this._endDraw(t):(this._currentParent.drawLayer.updateProperties(this._currentDrawId,e.#n.add(n,r)),e.#c=t.timeStamp,Yw(t)))}static _cleanup(t){t&&(this._currentDrawId=-1,this._currentParent=null,e.#n=null,e.#i=null,e.#o=null,e.#c=NaN),e.#r&&(e.#r.abort(),e.#r=null,e.#a=NaN,e.#s=null)}static _endDraw(t){let n=this._currentParent;if(n){if(n.toggleDrawing(!0),this._cleanup(!1),t?.target===n.div&&n.drawLayer.updateProperties(this._currentDrawId,e.#n.end(t.offsetX,t.offsetY)),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:zC.DRAW_STEP});return}this.endDrawing(!1)}}static endDrawing(t){let n=this._currentParent;if(!n)return null;if(n.toggleDrawing(!0),n.cleanUndoStack(zC.DRAW_STEP),!e.#n.isEmpty()){let{pageDimensions:[r,i],scale:a}=n,o=n.createAndAddNewEditor({offsetX:0,offsetY:0},!1,{drawId:this._currentDrawId,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){fw(`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),c=await super.deserialize(e,t,n);return c.createDrawingOptions(e),c.#l({drawOutlines:s}),c.#f(),c.onScaleChanging(),c.rotate(),c}serializeDraw(e){let[t,n]=this.pageTranslation,[r,i]=this.pageDimensions;return this.#e.serialize([t,n,r,i],e)}renderAnnotationElement(e){return e.updateEdited({rect:this.getPDFRect()}),null}static canCreateNewEmptyEditor(){return!1}},JO=class{#e=new Float64Array(6);#t;#n;#r;#i;#a;#o=``;#s=0;#c=new YO;#l;#u;constructor(e,t,n,r,i,a){this.#l=n,this.#u=r,this.#r=i,this.#i=a,[e,t]=this.#d(e,t);let o=this.#t=[NaN,NaN,NaN,NaN,e,t];this.#a=[e,t],this.#n=[{line:o,points:this.#a}],this.#e.set(o,0)}updateProperty(e,t){e===`stroke-width`&&(this.#i=t)}#d(e,t){return $._normalizePoint(e,t,this.#l,this.#u,this.#r)}isEmpty(){return!this.#n||this.#n.length===0}isCancellable(){return this.#a.length<=10}add(e,t){[e,t]=this.#d(e,t);let[n,r,i,a]=this.#e.subarray(2,6),o=e-i,s=t-a;return Math.hypot(this.#l*o,this.#u*s)<=2?null:(this.#a.push(e,t),isNaN(n)?(this.#e.set([i,a,e,t],2),this.#t.push(NaN,NaN,NaN,NaN,e,t),{path:{d:this.toSVGPath()}}):(isNaN(this.#e[0])&&this.#t.splice(6,6),this.#e.set([n,r,i,a,e,t],0),this.#t.push(...$.createBezierPoints(n,r,i,a,e,t)),{path:{d:this.toSVGPath()}}))}end(e,t){return this.add(e,t)||(this.#a.length===2?{path:{d:this.toSVGPath()}}:null)}startNew(e,t,n,r,i){this.#l=n,this.#u=r,this.#r=i,[e,t]=this.#d(e,t);let a=this.#t=[NaN,NaN,NaN,NaN,e,t];this.#a=[e,t];let o=this.#n.at(-1);return o&&(o.line=new Float32Array(o.line),o.points=new Float32Array(o.points)),this.#n.push({line:a,points:this.#a}),this.#e.set(a,0),this.#s=0,this.toSVGPath(),null}getLastElement(){return this.#n.at(-1)}setLastElement(e){return this.#n?(this.#n.push(e),this.#t=e.line,this.#a=e.points,this.#s=0,{path:{d:this.toSVGPath()}}):this.#c.setLastElement(e)}removeLastElement(){if(!this.#n)return this.#c.removeLastElement();this.#n.pop(),this.#o=``;for(let e=0,t=this.#n.length;e<t;e++){let{line:t,points:n}=this.#n[e];this.#t=t,this.#a=n,this.#s=0,this.toSVGPath()}return{path:{d:this.#o}}}toSVGPath(){let e=$.svgRound(this.#t[4]),t=$.svgRound(this.#t[5]);if(this.#a.length===2)return this.#o=`${this.#o} M ${e} ${t} Z`,this.#o;if(this.#a.length<=6){let n=this.#o.lastIndexOf(`M`);this.#o=`${this.#o.slice(0,n)} M ${e} ${t}`,this.#s=6}if(this.#a.length===4){let e=$.svgRound(this.#t[10]),t=$.svgRound(this.#t[11]);return this.#o=`${this.#o} L ${e} ${t}`,this.#s=12,this.#o}let n=[];this.#s===0&&(n.push(`M ${e} ${t}`),this.#s=6);for(let e=this.#s,t=this.#t.length;e<t;e+=6){let[t,r,i,a,o,s]=this.#t.slice(e,e+6).map($.svgRound);n.push(`C${t} ${r} ${i} ${a} ${o} ${s}`)}return this.#o+=n.join(` `),this.#s=this.#t.length,this.#o}getOutlines(e,t,n,r){let i=this.#n.at(-1);return i.line=new Float32Array(i.line),i.points=new Float32Array(i.points),this.#c.build(this.#n,e,t,n,this.#r,this.#i,r),this.#e=null,this.#t=null,this.#n=null,this.#o=null,this.#c}get defaultSVGProperties(){return{root:{viewBox:`0 0 10000 10000`},rootClass:{draw:!0},bbox:[0,0,1,1]}}},YO=class extends ${#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${$.svgRound(t[4])} ${$.svgRound(t[5])}`),t.length!==6)if(t.length===12&&isNaN(t[6]))e.push(`L${$.svgRound(t[10])} ${$.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($.svgRound);e.push(`C${r} ${i} ${a} ${o} ${s} ${c}`)}else e.push(`Z`);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=$._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=$._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=$._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=$._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=$._rescale,u=-e/n,d=t/r+1,f=1/n,p=-1/r;break;case 90:m=$._rescaleAndSwap,u=-t/r,d=-e/n,f=1/r,p=1/n;break;case 180:m=$._rescale,u=e/n+1,d=-t/r,f=-1/n,p=1/r;break;case 270:m=$._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($.createBezierPoints(r,i,o,s,t,c),3*(a-2)),[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=new Float32Array([1/0,1/0,-1/0,-1/0]);for(let{line:t}of this.#r){if(t.length<=12){for(let n=4,r=t.length;n<r;n+=6)Q.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);Q.bezierBoundingBox(n,r,a,o,s,c,l,u,e),n=l,r=u}}let[t,n]=this.#l();e[0]=Nw(e[0]-t,0,1),e[1]=Nw(e[1]-n,0,1),e[2]=Nw(e[2]+t,0,1),e[3]=Nw(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($.svgRound).join(` `)}get defaultProperties(){let[e,t]=this.#e;return{root:{viewBox:this.viewBox},path:{"transform-origin":`${$.svgRound(e)} ${$.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} ${$.svgRound(o)} ${$.svgRound(s)})`}getPathResizingSVGProperties([e,t,n,r]){let[i,a]=this.#l(),[o,s,c,l]=this.#e;if(Math.abs(c-i)<=$.PRECISION||Math.abs(l-a)<=$.PRECISION){let i=e+n/2-(o+c/2),a=t+r/2-(s+l/2);return{path:{"transform-origin":`${$.svgRound(e)} ${$.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":`${$.svgRound(o)} ${$.svgRound(s)}`,transform:`${this.rotationTransform} scale(${f} ${p}) translate(${$.svgRound(i)} ${$.svgRound(a)}) scale(${u} ${d}) translate(${$.svgRound(-i)} ${$.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)<=$.PRECISION||Math.abs(u-a)<=$.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)$._translate(e,i,a,e),$._translate(t,i,a,t);return{root:{viewBox:this.viewBox},path:{"transform-origin":`${$.svgRound(e)} ${$.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)$._rescale(e,p,m,d,f,e),$._rescale(t,p,m,d,f,t);return{root:{viewBox:this.viewBox},path:{"transform-origin":`${$.svgRound(e)} ${$.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)$._translate(e,o,s,e),$._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)$._rescale(n,o,s,e,t,n),$._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":`${$.svgRound(e)} ${$.svgRound(t)}`}}}get defaultSVGProperties(){let e=this.#e;return{root:{viewBox:this.viewBox},rootClass:{draw:!0},path:{d:this.toSVGPath(),"transform-origin":`${$.svgRound(e[0])} ${$.svgRound(e[1])}`,transform:this.rotationTransform||null},bbox:e}}},XO=class e extends KO{constructor(e){super(),this._viewParameters=e,super.updateProperties({fill:`none`,stroke:ET._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}},ZO=class e extends qO{static _type=`ink`;static _editorType=RC.INK;static _defaultDrawingOptions=null;constructor(e){super({...e,name:`inkEditor`}),this._willKeepAspectRatio=!0,this.defaultL10nId=`pdfjs-editor-ink-editor`}static initialize(e,t){ET.initialize(e,t),this._defaultDrawingOptions=new XO(t.viewParameters)}static getDefaultDrawingOptions(e){let t=this._defaultDrawingOptions.clone();return t.updateProperties(e),t}static get supportMultipleDrawings(){return!0}static get typesMap(){return gw(this,`typesMap`,new Map([[zC.INK_THICKNESS,`stroke-width`],[zC.INK_COLOR,`stroke`],[zC.INK_OPACITY,`stroke-opacity`]]))}static createDrawerInstance(e,t,n,r,i){return new JO(e,t,n,r,i,this._defaultDrawingOptions[`stroke-width`])}static deserializeDraw(e,t,n,r,i,a){return YO.deserialize(e,t,n,r,i,a)}static async deserialize(e,t,n){let r=null;if(e instanceof kO){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:RC.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 eO(this),[[`colorPicker`,this._colorPicker]]}get colorType(){return zC.INK_COLOR}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:Q.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:ET._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}},QO=class extends YO{toSVGPath(){let e=super.toSVGPath();return e.endsWith(`Z`)||(e+=`Z`),e}},$O=class{static#e={maxDim:512,sigmaSFactor:.02,sigmaR:25,kernelSize:16};static#t(e,t,n,r){return r-=t,(n-=e)===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;if(e[(n+this.#n[2*a])*t+(r+this.#n[2*a+1])]!==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;if(e[(n+this.#n[2*a])*t+(r+this.#n[2*a+1])]!==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,s=1,c=[];for(let e=1;e<n-1;e++){o=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)s+=1,--u;else{if(!(i>=1&&a[r+1]===0)){i!==1&&(o=Math.abs(i));continue}s+=1,u+=1,i>1&&(o=i)}let d=[n,e],f=u===n+1,p={isHole:f,points:d,id:s,parent:0},m;c.push(p);for(let e of c)if(e.id===o){m=e;break}m?m.isHole?p.parent=f?m.parent:o:p.parent=f?o:m.parent:p.parent=f?o:0;let h=this.#r(a,t,e,n,l,u,0);if(h===-1){a[r]=-s,a[r]!==1&&(o=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]=-s:a[p]===1&&(a[p]=s),c===e&&f===n&&b===v&&x===y){a[r]!==1&&(o=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}}p[f[s]=Math.round(d/m)]++}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,.5*y/2,1.5*b/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($.createBezierPoints(o,s,c,l,n,a),3*(e-2)),[o,s,c,l]=[c,l,n,a]}}if(d.length===0)return null;let g=o?new QO:new YO;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,o=1/0,s=-1/0,c=0;for(let t of e){c+=t.length;for(let e=2,n=t.length;e<n;e++){let n=t[e]-t[e-2];o=Math.min(o,n),s=Math.max(s,n)}}a=o>=-128&&s<=127?Int8Array:o>=-32768&&s<=32767?Int16Array:Int32Array;let l=e.length,u=8+3*l,d=new Uint32Array(u),f=0;d[f++]=u*Uint32Array.BYTES_PER_ELEMENT+(c-2*l)*a.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++]=a.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=a.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)}m.close();let g=await new Response(p.readable).arrayBuffer();return Pw(new Uint8Array(g))}static async decompressSignature(e){try{let n=(t=e,Uint8Array.fromBase64?Uint8Array.fromBase64(t):Tw(atob(t))),{readable:r,writable:i}=new DecompressionStream(`deflate-raw`),a=i.getWriter();await a.ready,a.write(n).then(async()=>{await a.ready,await a.close()}).catch(()=>{});let o=null,s=0;for await(let e of r)o||=new Uint8Array(new Uint32Array(e.buffer,0,4)[0]),o.set(e,s),s+=e.length;let c=new Uint32Array(o.buffer,0,o.length>>2),l=c[1];if(l!==0)throw Error(`Invalid version: ${l}`);let u=c[2],d=c[3],f=c[4]===0,p=c[5],m=c[6],h=c[7],g=[],_=(8+3*m)*Uint32Array.BYTES_PER_ELEMENT,v;switch(h){case Int8Array.BYTES_PER_ELEMENT:v=new Int8Array(o.buffer,_);break;case Int16Array.BYTES_PER_ELEMENT:v=new Int16Array(o.buffer,_);break;case Int32Array.BYTES_PER_ELEMENT:v=new Int32Array(o.buffer,_)}s=0;for(let e=0;e<m;e++){let t=c[3*e+8],n=new Float32Array(t+2);g.push(n);for(let t=0;t<2;t++)n[t]=c[3*e+8+t+1];for(let e=0;e<t;e++)n[e+2]=n[e]+v[s++]}return{areContours:f,thickness:p,outlines:g,width:u,height:d}}catch(e){return dw(`decompressSignature: ${e}`),null}var t}},ek=class e extends KO{constructor(){super(),super.updateProperties({fill:ET._defaultLineColor,"stroke-width":0})}clone(){let t=new e;return t.updateAll(this),t}},tk=class e extends XO{constructor(e){super(e),super.updateProperties({stroke:ET._defaultLineColor,"stroke-width":1})}clone(){let t=new e(this._viewParameters);return t.updateAll(this),t}},nk=class e extends qO{#e=!1;#t=null;#n=null;#r=null;static _type=`signature`;static _editorType=RC.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){ET.initialize(e,t),this._defaultDrawingOptions=new ek,this._defaultDrawnSignatureOptions=new tk(t.viewParameters)}static getDefaultDrawingOptions(e){let t=this._defaultDrawingOptions.clone();return t.updateProperties(e),t}static get supportMultipleDrawings(){return!1}static get typesMap(){return gw(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=$O.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:$O.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,c;this.#e=s instanceof QO,this.description=r,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 $O.process(t,n,r,i,e._INNER_MARGIN)}getFromText(t,n){let{rawDims:{pageWidth:r,pageHeight:i},rotation:a}=this.parent.viewport;return $O.extractContoursFromText(t,n,r,i,a,e._INNER_MARGIN)}getDrawnSignature(t){let{rawDims:{pageWidth:n,pageHeight:r},rotation:i}=this.parent.viewport;return $O.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?QO.deserialize(e,t,n,r,i,a):YO.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}},rk=class extends ET{#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=RC.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){ET.initialize(e,t)}static isHandlingMimeForPasting(e){return rT.includes(e)}static paste(e,t){t.pasteEditor({mode:RC.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)return this._uiManager.enableWaiting(!0),void this._uiManager.imageManager.getFromId(this.#t).then(e=>this.#d(e,!0)).finally(()=>this.#f());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=rT.join(`,`);let t=this._uiManager._signal;this.#n=new Promise(n=>{e.addEventListener(`change`,async()=>{if(e.files&&e.files.length!==0){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)}else this.remove();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(`pdfjs-editor-stamp-added-alert`)}copyCanvas(e,t,n=!1){e||=224;let{width:r,height:i}=this.#e,a=new nT,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`?iT.isDarkMode&&(d=`#8f8f9d`,f=`#42414d`):f=`black`;let p=15*a.sx,m=15*a.sy,h=new OffscreenCanvas(2*p,2*m),g=h.getContext(`2d`);g.fillStyle=d,g.fillRect(0,0,2*p,2*m),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=i>=16384?Math.floor(i/2)-1:Math.ceil(i/2)),a>2*t&&(a=a>=16384?Math.floor(a/2)-1: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 nT,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*Rw.PDF_TO_CSS_UNITS),r=Math.round(this.height*t*Rw.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 PO){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(`${Mw}${s}`))?.get(`aria-label`)||``;r=e={annotationType:RC.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)){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))}}else t.stamps.set(this.#t,{area:a,serialized:n}),n.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)}},ik=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([RO,ZO,rk,GO,nk].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()===RC.NONE}updateToolbar(e){this.#h.updateToolbar(e)}updateMode(t=this.#h.getMode()){switch(this.#S(),t){case RC.NONE:this.div.classList.toggle(`nonEditing`,!0),this.disableTextSelection(),this.togglePointerEvents(!1),this.toggleAnnotationLayerPointerEvents(!0),this.disableClick();return;case RC.INK:this.disableTextSelection(),this.togglePointerEvents(!0),this.enableClick();break;case RC.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===RC.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?.div.classList.toggle(`disabled`,!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)return void(this.#m=r);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(`^${LC}[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&&(e.stopPropagation(),e.preventDefault(),c.dblclick(e))},{signal:e,capture:!0})}let t=this.#n;if(t){let e=new Map,n=new Map;for(let r of this.#_)r.disableEditing(),r.annotationElementId?r.serialize()===null?(n.set(r.annotationElementId,r),this.getEditableAnnotation(r.annotationElementId)?.show(),r.remove()):e.set(r.annotationElementId,r):r.updateFakeAnnotationElement(t);let r=t.getEditableAnnotations();for(let t of r){let{id:r}=t.data;if(this.#h.isDeletedAnnotationElement(r)){t.updateEdited({deleted:!0});continue}let i=n.get(r);i?(i.resetAnnotationElement(t),i.show(!1),t.show()):(i=e.get(r),i&&(this.#h.addChangedExistingAnnotation(i),i.renderAnnotationElement(t)&&i.show(!1)),t.show())}}this.#S(),this.isEmpty&&(this.div.hidden=!0);let{classList:n}=this.div;for(let t of e.#g.values())n.remove(`${t._type}Editing`);this.disableTextSelection(),this.toggleAnnotationLayerPointerEvents(!0),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`))&&this.#d.div.contains(t)){let{isMac:t}=Ew.platform;if(e.button!==0||e.ctrlKey&&t)return;this.#h.showAllEditors(`highlight`,!0,!0),this.#d.div.classList.add(`free`),this.toggleDrawing(),GO.startHighlighting(this,this.#h.direction===`ltr`,{target:this.#d.div,x:e.x,y:e.y}),this.#d.div.addEventListener(`pointerup`,()=>{this.#d.div.classList.remove(`free`),this.toggleDrawing(!0)},{once:!0,signal:this.#h._signal}),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.annotationElementId),ET.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}getNextId(){return this.#h.getId()}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.getNextId(),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.getNextId(),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=(i+Math.min(window.innerWidth,e+n))/2-e,s=(a+Math.min(window.innerHeight,t+r))/2-t,[c,l]=this.viewport.rotation%180==0?[o,s]:[s,o];return{offsetX:c,offsetY:l}}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}=Ew.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)return void(this.#t=!0);let n=this.#h.getMode();n!==RC.STAMP&&n!==RC.SIGNATURE?this.createAndAddNewEditor(e,!1):this.#h.unselectAll()}pointerdown(e){if(this.#h.getMode()===RC.HIGHLIGHT&&this.enableTextSelection(),this.#o)return void(this.#o=!1);let{isMac:t}=Ew.platform;if(e.button!==0||e.ctrlKey&&t||e.target!==this.div)return;if(this.#o=!0,this.#y?.isDrawer)return void this.startDrawingSession(e);let n=this.#h.getActive();this.#t=!n||n.isEmpty()}startDrawingSession(e){if(this.div.focus({preventScroll:!0}),this.#l)return void this.#y.startDrawing(this,this.#h,!1,e);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);return}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&&(r.changeParent(e),!0)}commitOrRemove(){return!!this.#l&&(this.endDrawingSession(),!0)}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()}render({viewport:e}){this.viewport=e,tT(this.div,e);for(let e of this.#h.getEditors(this.pageIndex))this.add(e),e.rebuild();this.updateMode()}update({viewport:e}){this.#h.commitOrRemove(),this.#S();let t=this.viewport.rotation,n=e.rotation;if(this.viewport=e,tT(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}},ak=class e{#e=null;#t=new Map;#n=new Map;static#r=0;constructor({pageIndex:e}){this.pageIndex=e}setParent(e){if(this.#e){if(this.#e!==e){if(this.#t.size>0)for(let t of this.#t.values())t.remove(),e.append(t);this.#e=e}}else this.#e=e}static get _svgFactory(){return gw(this,`_svgFactory`,new aO)}static#i(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+`%`}#a(){let t=e._svgFactory.create(1,1,!0);return this.#e.append(t),t.setAttribute(`aria-hidden`,!0),t}#o(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}#s(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.#r++,a=this.#a(),o=e._svgFactory.createElement(`defs`);a.append(o);let s=e._svgFactory.createElement(`path`);o.append(s);let c=`path_p${this.pageIndex}_${i}`;s.setAttribute(`id`,c),s.setAttribute(`vector-effect`,`non-scaling-stroke`),n&&this.#n.set(i,s);let l=r?this.#o(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.#r++,i=this.#a(),a=e._svgFactory.createElement(`defs`);i.append(a);let o=e._svgFactory.createElement(`path`);a.append(o);let s=`path_p${this.pageIndex}_${r}`,c;if(o.setAttribute(`id`,s),o.setAttribute(`vector-effect`,`non-scaling-stroke`),n){let t=e._svgFactory.createElement(`mask`);a.append(t),c=`mask_p${this.pageIndex}_${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.#n.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.#s(s,r),i&&e.#i(s,i),a){let{classList:e}=s;for(let[t,n]of Object.entries(a))e.toggle(t,n)}if(o){let e=s.firstChild.firstChild;this.#s(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.#n.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.#n.clear()}};globalThis._pdfjsTestingUtils={HighlightOutliner:VO},globalThis.pdfjsLib={AbortException:Cw,AnnotationEditorLayer:ik,AnnotationEditorParamsType:zC,AnnotationEditorType:RC,AnnotationEditorUIManager:ST,AnnotationLayer:IO,AnnotationMode:IC,AnnotationType:JC,applyOpacity:oT,build:QD,ColorPicker:$D,createValidAbsoluteUrl:mw,CSSConstants:aT,DOMSVGFactory:aO,DrawLayer:ak,FeatureTest:Ew,fetchData:zw,findContrastColor:fT,getDocument:HD,getFilenameFromUrl:Ww,getPdfFilenameFromUrl:Gw,getRGB:Qw,getUuid:jw,getXfaPageViewport:Zw,GlobalWorkerOptions:fD,ImageKind:qC,InvalidPDFException:bw,isDataScheme:Hw,isPdfFile:Uw,isValidExplicitDest:zT,MathClamp:Nw,noContextMenu:Jw,normalizeUnicode:Aw,OPS:tw,OutputScale:nT,PasswordResponses:ow,PDFDataRangeTransport:WD,PDFDateString:Xw,PDFWorker:qD,PermissionFlag:BC,PixelsPerInch:Rw,RenderingCancelledException:Vw,renderRichText:pT,ResponseException:xw,setLayerDimensions:tT,shadow:gw,SignatureExtractor:$O,stopEvent:Yw,SupportedImageMimeTypes:rT,TextLayer:VD,TouchManager:TT,updateUrlHash:hw,Util:Q,VerbosityLevel:ew,version:ZD,XfaLayer:Iw};export{Cw as AbortException,ik as AnnotationEditorLayer,zC as AnnotationEditorParamsType,RC as AnnotationEditorType,ST as AnnotationEditorUIManager,IO as AnnotationLayer,IC as AnnotationMode,JC as AnnotationType,aT as CSSConstants,$D as ColorPicker,aO as DOMSVGFactory,ak as DrawLayer,Ew as FeatureTest,fD as GlobalWorkerOptions,qC as ImageKind,bw as InvalidPDFException,Nw as MathClamp,tw as OPS,nT as OutputScale,WD as PDFDataRangeTransport,Xw as PDFDateString,qD as PDFWorker,ow as PasswordResponses,BC as PermissionFlag,Rw as PixelsPerInch,Vw as RenderingCancelledException,xw as ResponseException,$O as SignatureExtractor,rT as SupportedImageMimeTypes,VD as TextLayer,TT as TouchManager,Q as Util,ew as VerbosityLevel,Iw as XfaLayer,oT as applyOpacity,QD as build,mw as createValidAbsoluteUrl,zw as fetchData,fT as findContrastColor,HD as getDocument,Ww as getFilenameFromUrl,Gw as getPdfFilenameFromUrl,Qw as getRGB,jw as getUuid,Zw as getXfaPageViewport,Hw as isDataScheme,Uw as isPdfFile,zT as isValidExplicitDest,Jw as noContextMenu,Aw as normalizeUnicode,pT as renderRichText,tT as setLayerDimensions,gw as shadow,Yw as stopEvent,hw as updateUrlHash,ZD as version};