diff --git a/README.md b/README.md index 347858d..5104bb2 100644 --- a/README.md +++ b/README.md @@ -64,7 +64,7 @@ The element needs an explicit height. Most attributes apply as soon as they chan ## Status -Actively maintained. The package bundles PDF.js 6.4.299 and follows PDF.js releases. +Actively maintained. The package bundles PDF.js 6.5.438 and follows PDF.js releases. ## Contributing diff --git a/demo/asset-attributes.html b/demo/asset-attributes.html index 815b01b..8bcb05c 100644 --- a/demo/asset-attributes.html +++ b/demo/asset-attributes.html @@ -30,11 +30,14 @@ pdfjs-lib-src="{% static 'pdfjs/pdf.mjs' %}" viewer-src="{% static 'pdfjs/viewer.mjs' %}" worker-src="{% static 'pdfjs/pdf.worker.min.mjs' %}" + renderer-src="{% static 'pdfjs/pdf.renderer.min.mjs' %}" viewer-css-src="{% static 'pdfjs/viewer.css' %}" theme-css-src="{% static 'pdfjs/paper-and-ink.css' %}" style="height: 100dvh"> + renderer-src is only used when worker rendering is turned on (see worker-rendering.html). + Resources loaded by directory and filename, such as annotation icons, CMaps, fonts, WASM and the scripting sandbox, default to the folders next to viewer-src and pdfjs-lib-src. Keep their original filenames available there, @@ -46,6 +49,7 @@ pdfjs-lib-src="../dist/pdf.mjs" viewer-src="../dist/viewer.mjs" worker-src="../dist/pdf.worker.min.mjs" + renderer-src="../dist/pdf.renderer.min.mjs" viewer-css-src="../dist/viewer.css" theme-css-src="../dist/paper-and-ink.css" style="height: 100dvh"> diff --git a/demo/assets-base.html b/demo/assets-base.html index 86f2e68..eebba93 100644 --- a/demo/assets-base.html +++ b/demo/assets-base.html @@ -16,7 +16,7 @@ + + + + + + diff --git a/package.json b/package.json index ff582b9..f71b444 100644 --- a/package.json +++ b/package.json @@ -75,6 +75,6 @@ "vitest": "^5.1.0" }, "dependencies": { - "pdfjs-dist": "^6.4.299" + "pdfjs-dist": "^6.5.438" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 411f9b0..09dd0ab 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -9,8 +9,8 @@ importers: .: dependencies: pdfjs-dist: - specifier: ^6.4.299 - version: 6.4.299 + specifier: ^6.5.438 + version: 6.5.438 devDependencies: '@rollup/plugin-terser': specifier: ^1.0.2 @@ -334,79 +334,74 @@ packages: resolution: {integrity: sha512-wK+5pLK5XFmgtH3aQ2YVvA3HohS3xqV/OxuVOdNx9Wpnz7VE/fnC+e1A7ln6LFYeck7gOJ/dsZV6OLplOtAJ2w==} engines: {node: '>=18'} - '@napi-rs/canvas-android-arm64@1.0.10': - resolution: {integrity: sha512-0sDMvme+7fj6bHERUaBs5SvEyWaORc91VUkaB4RrtG7p6dBrBNGy1of8cyEKDxygd1FlHtW+Thunj8lSixzY7A==} + '@napi-rs/canvas-android-arm64@1.1.0': + resolution: {integrity: sha512-mKrSmRyhWK4q699Q1xthbZIZi7JBvLtsRNnOZAeFaLPOFT1yo8y82aRC2nNZbXTGJXU7fVDONgGQPr0vo3kerw==} engines: {node: '>= 10'} cpu: [arm64] os: [android] - '@napi-rs/canvas-darwin-arm64@1.0.10': - resolution: {integrity: sha512-pdHL1TEfFMrnchRYqmPWXKN7hR4XtOYmzJqnh4XhpfWD4/eeSokOGVzrdFP/iQ3sfr2rf0939gOGq9uCp8BGmg==} + '@napi-rs/canvas-darwin-arm64@1.1.0': + resolution: {integrity: sha512-iqwST4g0oH+x8VCpBIYh+MYokv/mVvkM+v9oJGB0d9A3P2qBh42ogJlVyWq9SpPCrAjS7tplMb1D3OIfxl+utw==} engines: {node: '>= 10'} cpu: [arm64] os: [darwin] - '@napi-rs/canvas-darwin-x64@1.0.10': - resolution: {integrity: sha512-iuuk5plGxAcxurxv2ycF2yR20y5zvaBZ4heQdhPpg3EMFD21PhlY1V+YwSRmYRWzbvKL474UYdw3WIg2qfafyw==} + '@napi-rs/canvas-darwin-x64@1.1.0': + resolution: {integrity: sha512-jkeA8eVTxDum03LTvc32YJ28F6KB1U0gYwnWMfOAUQZvWWEh/kvONby4iWGJx3+Tw45UqMGMXjtw2GKNVZDhVg==} engines: {node: '>= 10'} cpu: [x64] os: [darwin] - '@napi-rs/canvas-linux-arm-gnueabihf@1.0.10': - resolution: {integrity: sha512-kH7GFR5Unpm77pKSEsmkqvzeQCRD7/MQ7upmeLLjg4XpQ62dX/R6THFsp6vkF1Pkco2aKUq9KhoLM4W5twdk7g==} + '@napi-rs/canvas-linux-arm-gnueabihf@1.1.0': + resolution: {integrity: sha512-Y4YkKG1ijoqkgUdTEEBNG4k+2BK5bR5jGL6S56YxCXYPwGfUd5nED8/74xyc7z+bpixPasCjSYoP3xYPOIGNxw==} engines: {node: '>= 10'} cpu: [arm] os: [linux] - '@napi-rs/canvas-linux-arm64-gnu@1.0.10': - resolution: {integrity: sha512-0/Hj7IwM9pmzdwxiqkp4YLJ8dKqASBrWQ3Y7dWUSU/4dgvCL9O6YNvX7xVUJjonQvdD3IE9ESS/nXa5srQqoVw==} + '@napi-rs/canvas-linux-arm64-gnu@1.1.0': + resolution: {integrity: sha512-dE/XthqYkiWcBVtKFlZbUXwAYfDuQGqDWixznipJNmevLGpprNnTVQZyftm1RZJudkIOn2EkzYZDMMETM08Row==} engines: {node: '>= 10'} cpu: [arm64] os: [linux] - libc: [glibc] - '@napi-rs/canvas-linux-arm64-musl@1.0.10': - resolution: {integrity: sha512-fmjKM0P2MLF9O6XzCQsRjhB+jlLzaf6tFQU36hMPMsYup+VThYvpjjhqNLOc/Ee3tHUE3r13H2BSJx/yXz4pFA==} + '@napi-rs/canvas-linux-arm64-musl@1.1.0': + resolution: {integrity: sha512-DqZ/CMcHlhU56pPjv9AP0h3U7MFQ5LzC1HzMyRMotL+PFsJmZJA/ziApPYVyyz78DaVLhI8t3So3ztqtijbYpg==} engines: {node: '>= 10'} cpu: [arm64] os: [linux] - libc: [musl] - '@napi-rs/canvas-linux-riscv64-gnu@1.0.10': - resolution: {integrity: sha512-O/BUrGwrs3pVP9PpD/3++ZiOpjHMJlmiB7aBgswP8rbe4egPfiFkFxmcCczoLvZa72TaQX5lJ8Udedb6rc/Hvg==} + '@napi-rs/canvas-linux-riscv64-gnu@1.1.0': + resolution: {integrity: sha512-kJ7m5n2VffxWXM5QGa5lfq8ZN4LdOJEoz3aAJAmIqYvKiZw1gRdXqpucnRXsF6D9nLYiiIlevaAtAclR7c5ilg==} engines: {node: '>= 10'} cpu: [riscv64] os: [linux] - libc: [glibc] - '@napi-rs/canvas-linux-x64-gnu@1.0.10': - resolution: {integrity: sha512-48HkZPQeAN/R+9NPpY64tceoyCUW5xYYtHKZnC+BG11qiihXJCbH+xfbgGU+OdYp1Q4s84HDl9ILU0KBK6SBOQ==} + '@napi-rs/canvas-linux-x64-gnu@1.1.0': + resolution: {integrity: sha512-uQ9JuJlRhQdHyttcMWOiwLkfIqkqaB0YFUVe835LUe12THt2b51HXkTItq0fxWT1jdhUPX2ylWZ1walkJyD6GQ==} engines: {node: '>= 10'} cpu: [x64] os: [linux] - libc: [glibc] - '@napi-rs/canvas-linux-x64-musl@1.0.10': - resolution: {integrity: sha512-QYHVi7WZ9v+Wm9OQyHLMTnJ8QiBPVX94BgbCHFJC/4bCFMfvX7fRzo4FJPgkRP0ISz3ulYNow/FCbQOPjzhYjg==} + '@napi-rs/canvas-linux-x64-musl@1.1.0': + resolution: {integrity: sha512-has4CPPAkkCac/LZ13VAw5p+MJLdaKVoyrhumN/A7uJd6960xYkJNDZgUebyxiha82AFzXx6RV+QJg5qGG079g==} engines: {node: '>= 10'} cpu: [x64] os: [linux] - libc: [musl] - '@napi-rs/canvas-win32-arm64-msvc@1.0.10': - resolution: {integrity: sha512-bWK+YajM/8sL0mMgLtug2s063FVBPzFV4QAn987CQomMKlmzrBY6Trz43KY+24hq7IOa3qNhUAgP/XMEF50ZEQ==} + '@napi-rs/canvas-win32-arm64-msvc@1.1.0': + resolution: {integrity: sha512-MJnktLKNijmXqdjTughHDZ9TDLZ9uUm2hvFXqaOqn0+w7lphXFnft6bpSgQAc9U1exc20UGIBlzGu9+kiCj9Ag==} engines: {node: '>= 10'} cpu: [arm64] os: [win32] - '@napi-rs/canvas-win32-x64-msvc@1.0.10': - resolution: {integrity: sha512-9WtzW85PaIhtB27iXaR/9RrLCqHLbqD3Z8Q+kh17NjFxwQXFXU5vWbYH4vEH+drM307TTyK3hidZgpt09G5T3g==} + '@napi-rs/canvas-win32-x64-msvc@1.1.0': + resolution: {integrity: sha512-08575bFk7iiadxap4h+JxgGut9xDCHAGum6wh0eInN53zEMImkmEHi5MushX2FOmNO7qRNX7BPiDC5ZYBwHeEg==} engines: {node: '>= 10'} cpu: [x64] os: [win32] - '@napi-rs/canvas@1.0.10': - resolution: {integrity: sha512-V+qptzsGnPMFxEbhwc6eDNMe5eDrfiBIp8qGpuRjAVIX4Kn2zxvwQ1Xco6Fwe+3tYIe3iLW8LM9D+SvjyJhqbQ==} + '@napi-rs/canvas@1.1.0': + resolution: {integrity: sha512-k+ph/D8H9GS8ZZ48okvHrKeJynkqAA1kMUZRuzRWNlQUDHXngq7oRaWMZBdmSfd9ZhVy9bwNKei/7wMboI/uMg==} engines: {node: '>= 10'} '@open-draft/deferred-promise@2.2.0': @@ -465,42 +460,36 @@ packages: engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [linux] - libc: [glibc] '@rolldown/binding-linux-arm64-musl@1.2.15': resolution: {integrity: sha512-uN26XOnVR7rqQupG3V9oAG2EGGatWjcJHOeDOHUFCh4TBWmP2tHTFoVN13aYbwfm0aHqJAEmcwhAu6sooIjfqQ==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [linux] - libc: [musl] '@rolldown/binding-linux-ppc64-gnu@1.2.15': resolution: {integrity: sha512-9nWkcdd+H+XhaA3fQIwpHnKIrfx/PQ6rO0pivr78Og07tXlUlctBBJoEYLPfhTmCR/QxEVdn6uPjHV5SymPhdw==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [ppc64] os: [linux] - libc: [glibc] '@rolldown/binding-linux-s390x-gnu@1.2.15': resolution: {integrity: sha512-Ggh0ciFjLwIusLSLz7LZYEaGdxOAUJXI+Qu5JCbhPJJHEt8vP+IjRATTJheiJsdzzTYgUiHUiw3X1Ea3ZpMBdA==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [s390x] os: [linux] - libc: [glibc] '@rolldown/binding-linux-x64-gnu@1.2.15': resolution: {integrity: sha512-FHg60rS6DBePAYZ9X9F67x+JObFdmgn6tupA1C/a3B+CufFmTD4mX+e8M75tCiAO3foR/6xwVBI0KQiI7sn/rw==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [linux] - libc: [glibc] '@rolldown/binding-linux-x64-musl@1.2.15': resolution: {integrity: sha512-/cvV/7v5VGz/moiz0XKRj2dE8DzsKyhIu1KpOvJGPjRywg3yscON889UGvAe8zfiJLHup7VLjBduoGWi3HusWQ==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [linux] - libc: [musl] '@rolldown/binding-openharmony-arm64@1.2.15': resolution: {integrity: sha512-MyzC5Hrv/sm+Z7TSGKP/j8001RO2xQm1zOpCNVL4j0cY/VhBZviludA2YFQ7i4lH6ZAXxQm0lcMdBzM+99mE7w==} @@ -566,79 +555,66 @@ packages: resolution: {integrity: sha512-t4ONHboXi/3E0rT6OZl1pKbl2Vgxf9vJfWgmUoCEVQVxhW6Cw/c8I6hbbu7DAvgp82RKiH7TpLwxnJeKv2pbsw==} cpu: [arm] os: [linux] - libc: [glibc] '@rollup/rollup-linux-arm-musleabihf@4.59.0': resolution: {integrity: sha512-CikFT7aYPA2ufMD086cVORBYGHffBo4K8MQ4uPS/ZnY54GKj36i196u8U+aDVT2LX4eSMbyHtyOh7D7Zvk2VvA==} cpu: [arm] os: [linux] - libc: [musl] '@rollup/rollup-linux-arm64-gnu@4.59.0': resolution: {integrity: sha512-jYgUGk5aLd1nUb1CtQ8E+t5JhLc9x5WdBKew9ZgAXg7DBk0ZHErLHdXM24rfX+bKrFe+Xp5YuJo54I5HFjGDAA==} cpu: [arm64] os: [linux] - libc: [glibc] '@rollup/rollup-linux-arm64-musl@4.59.0': resolution: {integrity: sha512-peZRVEdnFWZ5Bh2KeumKG9ty7aCXzzEsHShOZEFiCQlDEepP1dpUl/SrUNXNg13UmZl+gzVDPsiCwnV1uI0RUA==} cpu: [arm64] os: [linux] - libc: [musl] '@rollup/rollup-linux-loong64-gnu@4.59.0': resolution: {integrity: sha512-gbUSW/97f7+r4gHy3Jlup8zDG190AuodsWnNiXErp9mT90iCy9NKKU0Xwx5k8VlRAIV2uU9CsMnEFg/xXaOfXg==} cpu: [loong64] os: [linux] - libc: [glibc] '@rollup/rollup-linux-loong64-musl@4.59.0': resolution: {integrity: sha512-yTRONe79E+o0FWFijasoTjtzG9EBedFXJMl888NBEDCDV9I2wGbFFfJQQe63OijbFCUZqxpHz1GzpbtSFikJ4Q==} cpu: [loong64] os: [linux] - libc: [musl] '@rollup/rollup-linux-ppc64-gnu@4.59.0': resolution: {integrity: sha512-sw1o3tfyk12k3OEpRddF68a1unZ5VCN7zoTNtSn2KndUE+ea3m3ROOKRCZxEpmT9nsGnogpFP9x6mnLTCaoLkA==} cpu: [ppc64] os: [linux] - libc: [glibc] '@rollup/rollup-linux-ppc64-musl@4.59.0': resolution: {integrity: sha512-+2kLtQ4xT3AiIxkzFVFXfsmlZiG5FXYW7ZyIIvGA7Bdeuh9Z0aN4hVyXS/G1E9bTP/vqszNIN/pUKCk/BTHsKA==} cpu: [ppc64] os: [linux] - libc: [musl] '@rollup/rollup-linux-riscv64-gnu@4.59.0': resolution: {integrity: sha512-NDYMpsXYJJaj+I7UdwIuHHNxXZ/b/N2hR15NyH3m2qAtb/hHPA4g4SuuvrdxetTdndfj9b1WOmy73kcPRoERUg==} cpu: [riscv64] os: [linux] - libc: [glibc] '@rollup/rollup-linux-riscv64-musl@4.59.0': resolution: {integrity: sha512-nLckB8WOqHIf1bhymk+oHxvM9D3tyPndZH8i8+35p/1YiVoVswPid2yLzgX7ZJP0KQvnkhM4H6QZ5m0LzbyIAg==} cpu: [riscv64] os: [linux] - libc: [musl] '@rollup/rollup-linux-s390x-gnu@4.59.0': resolution: {integrity: sha512-oF87Ie3uAIvORFBpwnCvUzdeYUqi2wY6jRFWJAy1qus/udHFYIkplYRW+wo+GRUP4sKzYdmE1Y3+rY5Gc4ZO+w==} cpu: [s390x] os: [linux] - libc: [glibc] '@rollup/rollup-linux-x64-gnu@4.59.0': resolution: {integrity: sha512-3AHmtQq/ppNuUspKAlvA8HtLybkDflkMuLK4DPo77DfthRb71V84/c4MlWJXixZz4uruIH4uaa07IqoAkG64fg==} cpu: [x64] os: [linux] - libc: [glibc] '@rollup/rollup-linux-x64-musl@4.59.0': resolution: {integrity: sha512-2UdiwS/9cTAx7qIUZB/fWtToJwvt0Vbo0zmnYt7ED35KPg13Q0ym1g442THLC7VyI6JfYTP4PiSOWyoMdV2/xg==} cpu: [x64] os: [linux] - libc: [musl] '@rollup/rollup-openbsd-x64@4.59.0': resolution: {integrity: sha512-M3bLRAVk6GOwFlPTIxVBSYKUaqfLrn8l0psKinkCFxl4lQvOSz8ZrKDz2gxcBwHFpci0B6rttydI4IpS4IS/jQ==} @@ -1062,28 +1038,24 @@ packages: engines: {node: '>= 12.0.0'} cpu: [arm64] os: [linux] - libc: [glibc] lightningcss-linux-arm64-musl@1.33.0: resolution: {integrity: sha512-yiO5ROMuYQgXbC60yjZU5CYSFZGKXL0HFATXt9mHJn1+zW55oCtMI9NfcVhYLMFDL7gV7oBPon/EmMMGg2OvtQ==} engines: {node: '>= 12.0.0'} cpu: [arm64] os: [linux] - libc: [musl] lightningcss-linux-x64-gnu@1.33.0: resolution: {integrity: sha512-ar+Ju7LmcN0Jo4FpL4hpFybwNG9/3A/Br5KW2n2jyODg3MEZXaDYADdemoNS+BDNfMgKvylJLj4S5tyRActuAg==} engines: {node: '>= 12.0.0'} cpu: [x64] os: [linux] - libc: [glibc] lightningcss-linux-x64-musl@1.33.0: resolution: {integrity: sha512-RYiYbkokw0trfKqqzfF55lginwEPrD3OJDfTuJzFs1MK6iFnDenaz1fqLLtX4ITG3OktJQXOeTaw1awrBAlZPw==} engines: {node: '>= 12.0.0'} cpu: [x64] os: [linux] - libc: [musl] lightningcss-win32-arm64-msvc@1.33.0: resolution: {integrity: sha512-1K+MPfLSFVpphzpdbfkhlWk6wBrTObBzS2T6db10PNOZgR9GoVsAWzwNyuhUYYbTp23j+4RrncfujZ4uAzXvwA==} @@ -1162,8 +1134,8 @@ packages: pathe@2.0.3: resolution: {integrity: sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==} - pdfjs-dist@6.4.299: - resolution: {integrity: sha512-AVl138zALtfaAPvADulE0PZThbYzCBS79nL4pOSL/6Sm/4AH5A21BD9VHt97OlCuzJuCpmeZtAtkinisF4Vb1g==} + pdfjs-dist@6.5.438: + resolution: {integrity: sha512-vg8Pw1x+AFKy4AMDvhuWl5cOYV8d698UoEANoFFhc79hqXDnZQqnOXoxw3HG907WHOg1JYOvLhP756boddFxpA==} engines: {node: '>=22.13.0 || >=24'} picocolors@1.1.1: @@ -1698,52 +1670,52 @@ snapshots: strict-event-emitter: 0.5.1 optional: true - '@napi-rs/canvas-android-arm64@1.0.10': + '@napi-rs/canvas-android-arm64@1.1.0': optional: true - '@napi-rs/canvas-darwin-arm64@1.0.10': + '@napi-rs/canvas-darwin-arm64@1.1.0': optional: true - '@napi-rs/canvas-darwin-x64@1.0.10': + '@napi-rs/canvas-darwin-x64@1.1.0': optional: true - '@napi-rs/canvas-linux-arm-gnueabihf@1.0.10': + '@napi-rs/canvas-linux-arm-gnueabihf@1.1.0': optional: true - '@napi-rs/canvas-linux-arm64-gnu@1.0.10': + '@napi-rs/canvas-linux-arm64-gnu@1.1.0': optional: true - '@napi-rs/canvas-linux-arm64-musl@1.0.10': + '@napi-rs/canvas-linux-arm64-musl@1.1.0': optional: true - '@napi-rs/canvas-linux-riscv64-gnu@1.0.10': + '@napi-rs/canvas-linux-riscv64-gnu@1.1.0': optional: true - '@napi-rs/canvas-linux-x64-gnu@1.0.10': + '@napi-rs/canvas-linux-x64-gnu@1.1.0': optional: true - '@napi-rs/canvas-linux-x64-musl@1.0.10': + '@napi-rs/canvas-linux-x64-musl@1.1.0': optional: true - '@napi-rs/canvas-win32-arm64-msvc@1.0.10': + '@napi-rs/canvas-win32-arm64-msvc@1.1.0': optional: true - '@napi-rs/canvas-win32-x64-msvc@1.0.10': + '@napi-rs/canvas-win32-x64-msvc@1.1.0': optional: true - '@napi-rs/canvas@1.0.10': + '@napi-rs/canvas@1.1.0': optionalDependencies: - '@napi-rs/canvas-android-arm64': 1.0.10 - '@napi-rs/canvas-darwin-arm64': 1.0.10 - '@napi-rs/canvas-darwin-x64': 1.0.10 - '@napi-rs/canvas-linux-arm-gnueabihf': 1.0.10 - '@napi-rs/canvas-linux-arm64-gnu': 1.0.10 - '@napi-rs/canvas-linux-arm64-musl': 1.0.10 - '@napi-rs/canvas-linux-riscv64-gnu': 1.0.10 - '@napi-rs/canvas-linux-x64-gnu': 1.0.10 - '@napi-rs/canvas-linux-x64-musl': 1.0.10 - '@napi-rs/canvas-win32-arm64-msvc': 1.0.10 - '@napi-rs/canvas-win32-x64-msvc': 1.0.10 + '@napi-rs/canvas-android-arm64': 1.1.0 + '@napi-rs/canvas-darwin-arm64': 1.1.0 + '@napi-rs/canvas-darwin-x64': 1.1.0 + '@napi-rs/canvas-linux-arm-gnueabihf': 1.1.0 + '@napi-rs/canvas-linux-arm64-gnu': 1.1.0 + '@napi-rs/canvas-linux-arm64-musl': 1.1.0 + '@napi-rs/canvas-linux-riscv64-gnu': 1.1.0 + '@napi-rs/canvas-linux-x64-gnu': 1.1.0 + '@napi-rs/canvas-linux-x64-musl': 1.1.0 + '@napi-rs/canvas-win32-arm64-msvc': 1.1.0 + '@napi-rs/canvas-win32-x64-msvc': 1.1.0 optional: true '@open-draft/deferred-promise@2.2.0': @@ -2361,9 +2333,9 @@ snapshots: pathe@2.0.3: {} - pdfjs-dist@6.4.299: + pdfjs-dist@6.5.438: optionalDependencies: - '@napi-rs/canvas': 1.0.10 + '@napi-rs/canvas': 1.1.0 picocolors@1.1.1: {} diff --git a/scripts/copy-worker.mjs b/scripts/copy-worker.mjs index e200985..e4f3d0e 100644 --- a/scripts/copy-worker.mjs +++ b/scripts/copy-worker.mjs @@ -5,6 +5,7 @@ import { bundleCss } from './bundle-css.mjs' const rootDir = resolve(import.meta.dirname, '..') const sourceFile = resolve(rootDir, 'src', 'build', 'pdf.worker.min.mjs') +const sourceRendererFile = resolve(rootDir, 'src', 'build', 'pdf.renderer.min.mjs') const sourcePdfFile = resolve(rootDir, 'src', 'build', 'pdf.min.mjs') const sourceViewerFile = resolve(rootDir, 'src', 'web', 'viewer.mjs') const sourceViewerCssFile = resolve(rootDir, 'src', 'web', 'viewer.css') @@ -13,6 +14,7 @@ const sourcePaperAndInkCssFile = resolve(rootDir, 'src', 'themes', 'paper-and-in const sourceSandboxFile = resolve(rootDir, 'src', 'build', 'pdf.sandbox.min.mjs') const distDir = resolve(rootDir, 'dist') const targetFile = resolve(distDir, 'pdf.worker.min.mjs') +const targetRendererFile = resolve(distDir, 'pdf.renderer.min.mjs') const targetSandboxFile = resolve(distDir, 'pdf.sandbox.mjs') // Resources PDF.js loads only for documents that need them. The element defaults their URLs to // these folders next to viewer.mjs. @@ -51,6 +53,7 @@ const bundleCssFile = async (sourcePath, targetPath) => { await Promise.all([ copyFile(sourceFile, targetFile), + copyFile(sourceRendererFile, targetRendererFile), copyFile(sourcePdfFile, targetPdfFile), minifyModuleFile(sourceViewerFile, targetViewerFile), bundleCssFile(sourceViewerCssFile, targetViewerCssFile), diff --git a/scripts/sync-pdfjs-assets.mjs b/scripts/sync-pdfjs-assets.mjs index 736451c..554f237 100644 --- a/scripts/sync-pdfjs-assets.mjs +++ b/scripts/sync-pdfjs-assets.mjs @@ -116,7 +116,10 @@ for (const fileName of [ 'pdf.sandbox.mjs.map', 'pdf.worker.mjs', 'pdf.worker.min.mjs', - 'pdf.worker.mjs.map' + 'pdf.worker.mjs.map', + 'pdf.renderer.mjs', + 'pdf.renderer.min.mjs', + 'pdf.renderer.mjs.map' ]) { await copyRequiredFile( resolve(selectedBuildDir, fileName), diff --git a/src/build/pdf.min.mjs b/src/build/pdf.min.mjs index a052e93..58e7bd3 100644 --- a/src/build/pdf.min.mjs +++ b/src/build/pdf.min.mjs @@ -19,9 +19,9 @@ * JavaScript code in this page */ /** - * pdfjsVersion = 6.4.299 - * pdfjsBuild = d0991a0d5 - */var t={463(t){var e=TypeError;t.exports=function(t){if("string"==typeof t)return t;throw new e("Argument is not a string")}},804(t){var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",i=e+"+/",n=e+"-_",inverse=function(t){for(var e={},i=0;i<64;i++)e[t.charAt(i)]=i;return e};t.exports={i2c:i,c2i:inverse(i),i2cUrl:n,c2iUrl:inverse(n)}},529(t){t.exports=function(t,e){return{value:t,done:e}}},837(t){var e=TypeError;t.exports=function(t){if(t>9007199254740991)throw new e("Maximum allowed index exceeded");return t}},2(t){t.exports={IndexSizeError:{s:"INDEX_SIZE_ERR",c:1,m:1},DOMStringSizeError:{s:"DOMSTRING_SIZE_ERR",c:2,m:0},HierarchyRequestError:{s:"HIERARCHY_REQUEST_ERR",c:3,m:1},WrongDocumentError:{s:"WRONG_DOCUMENT_ERR",c:4,m:1},InvalidCharacterError:{s:"INVALID_CHARACTER_ERR",c:5,m:1},NoDataAllowedError:{s:"NO_DATA_ALLOWED_ERR",c:6,m:0},NoModificationAllowedError:{s:"NO_MODIFICATION_ALLOWED_ERR",c:7,m:1},NotFoundError:{s:"NOT_FOUND_ERR",c:8,m:1},NotSupportedError:{s:"NOT_SUPPORTED_ERR",c:9,m:1},InUseAttributeError:{s:"INUSE_ATTRIBUTE_ERR",c:10,m:1},InvalidStateError:{s:"INVALID_STATE_ERR",c:11,m:1},SyntaxError:{s:"SYNTAX_ERR",c:12,m:1},InvalidModificationError:{s:"INVALID_MODIFICATION_ERR",c:13,m:1},NamespaceError:{s:"NAMESPACE_ERR",c:14,m:1},InvalidAccessError:{s:"INVALID_ACCESS_ERR",c:15,m:1},ValidationError:{s:"VALIDATION_ERR",c:16,m:0},TypeMismatchError:{s:"TYPE_MISMATCH_ERR",c:17,m:1},SecurityError:{s:"SECURITY_ERR",c:18,m:1},NetworkError:{s:"NETWORK_ERR",c:19,m:1},AbortError:{s:"ABORT_ERR",c:20,m:1},URLMismatchError:{s:"URL_MISMATCH_ERR",c:21,m:1},QuotaExceededError:{s:"QUOTA_EXCEEDED_ERR",c:22,m:1},TimeoutError:{s:"TIMEOUT_ERR",c:23,m:1},InvalidNodeTypeError:{s:"INVALID_NODE_TYPE_ERR",c:24,m:1},DataCloneError:{s:"DATA_CLONE_ERR",c:25,m:1}}},944(t){var e=TypeError;t.exports=function(t){var i=t&&t.alphabet;if(void 0===i||"base64"===i||"base64url"===i)return i||"base64";throw new e("Incorrect `alphabet` option")}},767(t){t.exports=function(t){return{iterator:t,next:t.next,done:!1}}},117(t){t.exports=function(t){return null==t}},859(t){t.exports=function(t){t.iterator=t.next=t.nextHandler=t.mapper=t.predicate=t.inner=t.iterables=t.iters=t.openIters=t.padding=t.finishResults=t.buffer=null}},684(t){t.exports=function(t,e){var i="function"==typeof Iterator&&Iterator.prototype[t];if(i)try{i.call({next:null},e).next()}catch(t){return!0}}},269(t){t.exports=Object.create?Object.create(null):{}},741(t){var e=Math.ceil,i=Math.floor;t.exports=Math.trunc||function trunc(t){var n=+t;return(n>0?i:e)(n)}},149(t){var e=RangeError;t.exports=function(t){if(t==t)return t;throw new e("NaN is not allowed")}},717(t,e){e.f=Object.getOwnPropertySymbols},103(t){t.exports=function(t){try{return{error:!1,value:t()}}catch(t){return{error:!0,value:t}}}},750(t,e,i){var n=i(117),r=TypeError;t.exports=function(t){if(n(t))throw new r("Can't call method on "+t);return t}},835(t){t.exports=function(t){try{var e=new Set,i={size:0,has:function(){return!0},keys:function(){return Object.defineProperty({},"next",{get:function(){e.clear();e.add(4);return function(){return{done:!0}}}})}},n=e[t](i);return 1===n.size&&4===n.values().next().value}catch(t){return!1}}},291(t,e,i){var n=i(741);t.exports=function(t){var e=+t;return e!=e||0===e?0:n(e)}},14(t,e,i){var n=i(291),r=Math.min;t.exports=function(t){var e=n(t);return e>0?r(e,9007199254740991):0}},981(t,e,i){var n=i(750),r=Object;t.exports=function(t){return r(n(t))}},590(t,e,i){var n=i(291),r=RangeError;t.exports=function(t){var e=n(t);if(e<0)throw new r("The argument can't be less than 0");return e}},812(t){var e=TypeError;t.exports=function(t,i){if(t{var e;return()=>{if(t){var i=t;t=0;e={exports:{}};i.call(e.exports,e,e.exports)}return e.exports}};__webpack_require__.d=(t,e)=>{for(var i in e)__webpack_require__.o(e,i)&&!__webpack_require__.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})};__webpack_require__.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var i=__webpack_require__.cw(function(t,e){var i=ft(),n=ve(),r=TypeError;t.exports=function(t){if(i(t))return t;throw new r(n(t)+" is not a function")}}),n=__webpack_require__.cw(function(t,e){var i=yt(),n=String,r=TypeError;t.exports=function(t){if(i(t))return t;throw new r("Can't set "+n(t)+" as a prototype")}}),r=__webpack_require__.cw(function(t,e){var i=Qt().has;t.exports=function(t){i(t);return t}}),a_string_namespaceFn=()=>__webpack_require__(463),s=__webpack_require__.cw(function(t,e){var i=ke(),n=new i.WeakMap,r=i.set,s=i.remove;t.exports=function(t){r(n,t,1);s(n,t);return t}}),a=__webpack_require__.cw(function(t,e){var i=ke().has;t.exports=function(t){i(t);return t}}),o=__webpack_require__.cw(function(t,e){var i=De(),n=Rt(),r=Lt().f,s=i("unscopables"),a=Array.prototype;void 0===a[s]&&r(a,s,{configurable:!0,value:n(null)});t.exports=function(t){a[s][t]=!0}}),l=__webpack_require__.cw(function(t,e){var i=zt(),n=TypeError;t.exports=function(t,e){if(i(e,t))return t;throw new n("Incorrect invocation")}}),c=__webpack_require__.cw(function(t,e){var i=bt(),n=String,r=TypeError;t.exports=function(t){if(void 0===t||i(t))return t;throw new r(n(t)+" is not an object or undefined")}}),h=__webpack_require__.cw(function(t,e){var i=bt(),n=String,r=TypeError;t.exports=function(t){if(i(t))return t;throw new r(n(t)+" is not an object")}}),d=__webpack_require__.cw(function(t,e){var i=x(),n=TypeError;t.exports=function(t){if("Uint8Array"===i(t))return t;throw new n("Argument is not an Uint8Array")}}),u=__webpack_require__.cw(function(t,e){t.exports="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView}),p=__webpack_require__.cw(function(t,e){var i=it(),n=q(),r=A(),s=i.ArrayBuffer,a=i.TypeError;t.exports=s&&n(s.prototype,"byteLength","get")||function(t){if("ArrayBuffer"!==r(t))throw new a("ArrayBuffer expected");return t.byteLength}}),g=__webpack_require__.cw(function(t,e){var i=it(),n=u(),r=p(),s=i.DataView;t.exports=function(t){if(!n||0!==r(t))return!1;try{new s(t);return!1}catch(t){return!0}}}),f=__webpack_require__.cw(function(t,e){var i=g(),n=TypeError;t.exports=function(t){if(i(t))throw new n("ArrayBuffer is detached");return t}}),m=__webpack_require__.cw(function(t,e){var i,n,r,s=u(),a=O(),o=it(),l=ft(),c=bt(),h=nt(),d=x(),p=ve(),g=S(),f=P(),m=D(),b=zt(),y=Ht(),w=Vt(),v=De(),_=_e(),A=dt(),E=A.enforce,C=A.get,T=o.Int8Array,k=T&&T.prototype,M=o.Uint8ClampedArray,I=M&&M.prototype,R=T&&y(T),B=k&&y(k),L=Object.prototype,N=o.TypeError,U=v("toStringTag"),H=_("TYPED_ARRAY_TAG"),z="TypedArrayConstructor",G=s&&!!w&&"Opera"!==d(o.opera),j=!1,W={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},V={BigInt64Array:8,BigUint64Array:8},getTypedArrayConstructor=function(t){var e=y(t);if(c(e)){var i=C(e);return i&&h(i,z)?i[z]:getTypedArrayConstructor(e)}},isTypedArray=function(t){if(!c(t))return!1;var e=d(t);return h(W,e)||h(V,e)};for(i in W)(r=(n=o[i])&&n.prototype)?E(r)[z]=n:G=!1;for(i in V)(r=(n=o[i])&&n.prototype)&&(E(r)[z]=n);if(!G||!l(R)||R===Function.prototype){R=function TypedArray(){throw new N("Incorrect invocation")};if(G)for(i in W)o[i]&&w(o[i],R)}if(!G||!B||B===L){B=R.prototype;if(G)for(i in W)o[i]&&w(o[i].prototype,B)}G&&y(I)!==B&&w(I,B);if(a&&!h(B,U)){j=!0;m(B,U,{configurable:!0,get:function(){return c(this)?this[H]:void 0}});for(i in W)o[i]&&g(o[i].prototype,H,i)}t.exports={NATIVE_ARRAY_BUFFER_VIEWS:G,TYPED_ARRAY_TAG:j&&H,aTypedArray:function(t){if(isTypedArray(t))return t;throw new N("Target is not a typed array")},aTypedArrayConstructor:function(t){if(l(t)&&(!w||b(R,t)))return t;throw new N(p(t)+" is not a typed array constructor")},exportTypedArrayMethod:function(t,e,i,n){if(a){if(i)for(var r in W){var s=o[r];if(s&&h(s.prototype,t))try{delete s.prototype[t]}catch(i){try{s.prototype[t]=e}catch(t){}}}B[t]&&!i||f(B,t,i?e:G&&k[t]||e,n)}},exportTypedArrayStaticMethod:function(t,e,i){var n,r;if(a){if(w){if(i)for(n in W)if((r=o[n])&&h(r,t))try{delete r[t]}catch(t){}if(R[t]&&!i)return;try{return f(R,t,i?e:G&&R[t]||e)}catch(t){}}for(n in W)!(r=o[n])||r[t]&&!i||f(r,t,e)}},getTypedArrayConstructor,isView:function isView(t){if(!c(t))return!1;var e=d(t);return"DataView"===e||h(W,e)||h(V,e)},isTypedArray,TypedArray:R,TypedArrayPrototype:B}}),b=__webpack_require__.cw(function(t,e){var i=Dt();t.exports=function(t,e,n){for(var r=0,s=arguments.length>2?n:i(e),a=new t(s);s>r;)a[r]=e[r++];return a}}),y=__webpack_require__.cw(function(t,e){var i=fe(),n=pe(),r=Dt(),createMethod=function(t){return function(e,s,a){var o=i(e),l=r(o);if(0===l)return!t&&-1;var c,h=n(a,l);if(t&&s!=s){for(;l>h;)if((c=o[h++])!=c)return!0}else for(;l>h;h++)if((t||h in o)&&o[h]===s)return t||h||0;return!t&&-1}};t.exports={includes:createMethod(!0),indexOf:createMethod(!1)}}),w=__webpack_require__.cw(function(t,e){var i=O(),n=pt(),r=TypeError,s=Object.getOwnPropertyDescriptor,a=i&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(t){return t instanceof TypeError}}();t.exports=a?function(t,e){if(n(t)&&!s(t,"length").writable)throw new r("Cannot set read only .length");return t.length=e}:function(t,e){return t.length=e}}),v=__webpack_require__.cw(function(t,e){var i=K();t.exports=i([].slice)}),base64_map_namespaceFn=()=>__webpack_require__(804),_=__webpack_require__.cw(function(t,e){var i=h(),n=Ct();t.exports=function(t,e,r,s){try{return s?e(i(r)[0],r[1]):e(r)}catch(e){n(t,"throw",e)}}}),A=__webpack_require__.cw(function(t,e){var i=K(),n=i({}.toString),r=i("".slice);t.exports=function(t){return r(n(t),8,-1)}}),x=__webpack_require__.cw(function(t,e){var i=ye(),n=ft(),r=A(),s=De()("toStringTag"),a=Object,o="Arguments"===r(function(){return arguments}());t.exports=i?r:function(t){var e,i,l;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(i=function(t,e){try{return t[e]}catch(t){}}(e=a(t),s))?i:o?r(e):"Object"===(l=r(e))&&n(e.callee)?"Arguments":l}}),E=__webpack_require__.cw(function(t,e){var i=nt(),n=qt(),r=Nt(),s=Lt();t.exports=function(t,e,a){for(var o=n(e),l=s.f,c=r.f,h=0;h0&&i[0]<4?1:+(i[0]+i[1]));!n&&s&&(!(i=s.match(/Edge\/(\d+)/))||i[1]>=74)&&(i=s.match(/Chrome\/(\d+)/))&&(n=+i[1]);t.exports=n}),U=__webpack_require__.cw(function(t,e){var i=K(),n=Error,r=i("".replace),s=String(new n("zxcasd").stack),a=/\n\s*at [^:]*:[^\n]*/,o=a.test(s);t.exports=function(t,e){if(o&&"string"==typeof t&&!n.prepareStackTrace)for(;e--;)t=r(t,a,"");return t}}),H=__webpack_require__.cw(function(t,e){var i=it(),n=Nt().f,r=S(),s=P(),a=I(),o=E(),l=mt();t.exports=function(t,e){var c,h,d,u,p,g=t.target,f=t.global,m=t.stat;if(c=f?i:m?i[g]||a(g,{}):i[g]&&i[g].prototype)for(h in e){u=e[h];d=t.dontCallGetSet?(p=n(c,h))&&p.value:c[h];if(!l(f?h:g+(m?".":"#")+h,t.forced)&&void 0!==d){if(typeof u==typeof d)continue;o(u,d)}(t.sham||d&&d.sham)&&r(u,"sham",!0);s(c,h,u,t)}}}),z=__webpack_require__.cw(function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}}),G=__webpack_require__.cw(function(t,e){var i=W(),n=Function.prototype,r=n.apply,s=n.call;t.exports="object"==typeof Reflect&&Reflect.apply||(i?s.bind(r):function(){return s.apply(r,arguments)})}),j=__webpack_require__.cw(function(t,e){var n=X(),r=i(),s=W(),a=n(n.bind);t.exports=function(t,e){r(t);return void 0===e?t:s?a(t,e):function(){return t.apply(e,arguments)}}}),W=__webpack_require__.cw(function(t,e){var i=z();t.exports=!i(function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")})}),V=__webpack_require__.cw(function(t,e){var i=W(),n=Function.prototype.call;t.exports=i?n.bind(n):function(){return n.apply(n,arguments)}}),$=__webpack_require__.cw(function(t,e){var i=O(),n=nt(),r=Function.prototype,s=i&&Object.getOwnPropertyDescriptor,a=n(r,"name"),o=a&&(!i||i&&s(r,"name").configurable);t.exports={CONFIGURABLE:o}}),q=__webpack_require__.cw(function(t,e){var n=K(),r=i();t.exports=function(t,e,i){try{return n(r(Object.getOwnPropertyDescriptor(t,e)[i]))}catch(t){}}}),X=__webpack_require__.cw(function(t,e){var i=A(),n=K();t.exports=function(t){if("Function"===i(t))return n(t)}}),K=__webpack_require__.cw(function(t,e){var i=W(),n=Function.prototype,r=n.call,s=i&&n.bind.bind(r,r);t.exports=i?s:function(t){return function(){return r.apply(t,arguments)}}}),get_alphabet_option_namespaceFn=()=>__webpack_require__(944),Y=__webpack_require__.cw(function(t,e){var i=it(),n=ft();t.exports=function(t,e){return arguments.length<2?(r=i[t],n(r)?r:void 0):i[t]&&i[t][e];var r}}),get_iterator_direct_namespaceFn=()=>__webpack_require__(767),J=__webpack_require__.cw(function(t,e){var i=V(),n=h(),r=get_iterator_direct_namespaceFn(),s=Z();t.exports=function(t,e){e&&"string"==typeof t||n(t);var a=s(t);return r(n(void 0!==a?i(a,t):t))}}),Q=__webpack_require__.cw(function(t,e){var i=V(),n=ft(),r=h(),s=ve(),a=Z(),o=TypeError;t.exports=function(t,e){var l=arguments.length<2?a(t):e;if(n(l))return r(i(l,t));throw new o(s(t)+" is not iterable")}}),Z=__webpack_require__.cw(function(t,e){var i=A(),n=is_null_or_undefined_namespaceFn(),r=tt(),s=De()("iterator"),a=Array.prototype;t.exports=function(t){if(!n(t))return r(t,s)||r(t,"@@iterator")||("Arguments"===i(t)?a[s]:void 0)}}),tt=__webpack_require__.cw(function(t,e){var n=i(),r=is_null_or_undefined_namespaceFn();t.exports=function(t,e){var i=t[e];return r(i)?void 0:n(i)}}),et=__webpack_require__.cw(function(t,e){var n=i(),r=h(),s=V(),a=to_integer_or_infinity_namespaceFn(),o=get_iterator_direct_namespaceFn(),l="Invalid size",c=RangeError,d=TypeError,u=Math.max,SetRecord=function(t,e){this.set=t;this.size=u(e,0);this.has=n(t.has);this.keys=n(t.keys)};SetRecord.prototype={getIterator:function(){return o(r(s(this.keys,this.set)))},includes:function(t){return s(this.has,this.set,t)}};t.exports=function(t){r(t);var e=+t.size;if(e!=e)throw new d(l);var i=a(e);if(i<0)throw new c(l);return new SetRecord(t,i)}}),it=__webpack_require__.cw(function(t,e){var check=function(t){return t&&t.Math===Math&&t};t.exports=check("object"==typeof globalThis&&globalThis)||check("object"==typeof window&&window)||check("object"==typeof self&&self)||check("object"==typeof global&&global)||check("object"==typeof this&&this)||function(){return this}()||Function("return this")()}),nt=__webpack_require__.cw(function(t,e){var i=K(),n=to_object_namespaceFn(),r=i({}.hasOwnProperty);t.exports=Object.hasOwn||function hasOwn(t,e){return r(n(t),e)}}),rt=__webpack_require__.cw(function(t,e){t.exports={}}),st=__webpack_require__.cw(function(t,e){var i=Y();t.exports=i("document","documentElement")}),ot=__webpack_require__.cw(function(t,e){var i=O(),n=z(),r=R();t.exports=!i&&!n(function(){return 7!==Object.defineProperty(r("div"),"a",{get:function(){return 7}}).a})}),lt=__webpack_require__.cw(function(t,e){var i=K(),n=z(),r=A(),s=Object,a=i("".split);t.exports=n(function(){return!s("z").propertyIsEnumerable(0)})?function(t){return"String"===r(t)?a(t,""):s(t)}:s}),ct=__webpack_require__.cw(function(t,e){var i=ft(),n=bt(),r=Vt();t.exports=function(t,e,s){var a,o;r&&i(a=e.constructor)&&a!==s&&n(o=a.prototype)&&o!==s.prototype&&r(t,o);return t}}),ht=__webpack_require__.cw(function(t,e){var i=K(),n=ft(),r=ce(),s=i(Function.toString);n(r.inspectSource)||(r.inspectSource=function(t){return s(t)});t.exports=r.inspectSource}),dt=__webpack_require__.cw(function(t,e){var i,n,r,s=Te(),a=it(),o=bt(),l=S(),c=nt(),h=ce(),d=le(),u=rt(),p="Object already initialized",g=a.TypeError,f=a.WeakMap;if(s||h.state){var m=h.state||(h.state=new f);m.get=m.get;m.has=m.has;m.set=m.set;i=function(t,e){if(m.has(t))throw new g(p);e.facade=t;m.set(t,e);return e};n=function(t){return m.get(t)||{}};r=function(t){return m.has(t)}}else{var b=d("state");u[b]=!0;i=function(t,e){if(c(t,b))throw new g(p);e.facade=t;l(t,b,e);return e};n=function(t){return c(t,b)?t[b]:{}};r=function(t){return c(t,b)}}t.exports={set:i,get:n,has:r,enforce:function(t){return r(t)?n(t):i(t,{})},getterFor:function(t){return function(e){var i;if(!o(e)||(i=n(e)).type!==t)throw new g("Incompatible receiver, "+t+" required");return i}}}}),ut=__webpack_require__.cw(function(t,e){var i=De(),n=iterators_namespaceFn(),r=i("iterator"),s=Array.prototype;t.exports=function(t){return void 0!==t&&(n.Array===t||s[r]===t)}}),pt=__webpack_require__.cw(function(t,e){var i=A();t.exports=Array.isArray||function isArray(t){return"Array"===i(t)}}),gt=__webpack_require__.cw(function(t,e){var i=x();t.exports=function(t){var e=i(t);return"BigInt64Array"===e||"BigUint64Array"===e}}),ft=__webpack_require__.cw(function(t,e){var i="object"==typeof document&&document.all;t.exports=void 0===i&&void 0!==i?function(t){return"function"==typeof t||t===i}:function(t){return"function"==typeof t}}),mt=__webpack_require__.cw(function(t,e){var i=z(),n=ft(),r=/#|\.prototype\./,isForced=function(t,e){var r=a[s(t)];return r===l||r!==o&&(n(e)?i(e):!!e)},s=isForced.normalize=function(t){return String(t).replace(r,".").toLowerCase()},a=isForced.data={},o=isForced.NATIVE="N",l=isForced.POLYFILL="P";t.exports=isForced}),is_null_or_undefined_namespaceFn=()=>__webpack_require__(117),bt=__webpack_require__.cw(function(t,e){var i=ft();t.exports=function(t){return"object"==typeof t?null!==t:i(t)}}),yt=__webpack_require__.cw(function(t,e){var i=bt();t.exports=function(t){return i(t)||null===t}}),wt=__webpack_require__.cw(function(t,e){t.exports=!1}),vt=__webpack_require__.cw(function(t,e){var i=bt(),n=dt().get;t.exports=function isRawJSON(t){if(!i(t))return!1;var e=n(t);return!!e&&"RawJSON"===e.type}}),_t=__webpack_require__.cw(function(t,e){var i=Y(),n=ft(),r=zt(),s=Ce(),a=Object;t.exports=s?function(t){return"symbol"==typeof t}:function(t){var e=i("Symbol");return n(e)&&r(e.prototype,a(t))}}),At=__webpack_require__.cw(function(t,e){var i=V();t.exports=function(t,e,n){for(var r,s,a=n?t:t.iterator,o=t.next;!(r=i(o,a)).done;)if(void 0!==(s=e(r.value)))return s}}),xt=__webpack_require__.cw(function(t,e){var i=j(),n=V(),r=h(),s=ve(),a=ut(),o=Dt(),l=zt(),c=Q(),d=Z(),u=Ct(),p=TypeError,Result=function(t,e){this.stopped=t;this.result=e},g=Result.prototype;t.exports=function(t,e,h){var f,m,b,y,w,v,_,A=h&&h.that,x=!(!h||!h.AS_ENTRIES),E=!(!h||!h.IS_RECORD),C=!(!h||!h.IS_ITERATOR),S=!(!h||!h.INTERRUPTED),T=i(e,A),stop=function(t){var e=f;f=void 0;e&&u(e,"normal");return new Result(!0,t)},callFn=function(t){if(x){r(t);return S?T(t[0],t[1],stop):T(t[0],t[1])}return S?T(t,stop):T(t)};if(E)f=t.iterator;else if(C)f=t;else{if(!(m=d(t)))throw new p(s(t)+" is not iterable");if(a(m)){for(b=0,y=o(t);y>b;b++)if((w=callFn(t[b]))&&l(g,w))return w;return new Result(!1)}f=c(t,m)}v=E?t.next:f.next;for(;!(_=n(v,f)).done;){var k=_.value;try{w=callFn(k)}catch(t){if(!f)throw t;u(f,"throw",t)}if("object"==typeof w&&w&&l(g,w))return w}return new Result(!1)}}),Et=__webpack_require__.cw(function(t,e){var i=Ct();t.exports=function(t,e,n){for(var r=t.length-1;r>=0;r--)if(void 0!==t[r])try{n=i(t[r].iterator,e,n)}catch(t){e="throw";n=t}if("throw"===e)throw n;return n}}),Ct=__webpack_require__.cw(function(t,e){var i=V(),n=h(),r=tt();t.exports=function(t,e,s){var a,o;n(t);try{if(!(a=r(t,"return"))){if("throw"===e)throw s;return s}a=i(a,t)}catch(t){o=!0;a=t}if("throw"===e)throw s;if(o)throw a;n(a);return s}}),St=__webpack_require__.cw(function(t,e){var i=V(),n=Rt(),r=S(),s=M(),a=De(),o=dt(),l=tt(),c=kt().IteratorPrototype,h=__webpack_require__(529),d=Ct(),u=Et(),p=__webpack_require__(859),g=a("toStringTag"),f="IteratorHelper",m="WrapForValidIterator",b="normal",y="throw",w=o.set,createIteratorProxyPrototype=function(t){var e=o.getterFor(t?m:f);return s(n(c),{next:function next(){var i=e(this);if(t)return i.nextHandler();if(i.done)return h(void 0,!0);try{var n=i.nextHandler();i.done&&p(i);return i.returnHandlerResult?n:h(n,i.done)}catch(t){i.done=!0;p(i);throw t}},return:function(){var n=e(this),r=n.iterator,s=n.inner,a=n.openIters,o=n.done;n.done=!0;if(t){var c=l(r,"return");return c?i(c,r):h(void 0,!0)}p(n);if(o)return h(void 0,!0);if(s)try{d(s.iterator,b)}catch(t){return d(r,y,t)}if(a)try{u(a,b)}catch(t){if(r)return d(r,y,t);throw t}r&&d(r,b);return h(void 0,!0)}})},v=createIteratorProxyPrototype(!0),_=createIteratorProxyPrototype(!1);r(_,g,"Iterator Helper");t.exports=function(t,e,i){var n=function Iterator(n,r){if(r){r.iterator=n.iterator;r.next=n.next}else r=n;r.type=e?m:f;r.returnHandlerResult=!!i;r.nextHandler=t;r.counter=0;r.done=!1;w(this,r)};n.prototype=e?v:_;return n}}),iterator_helper_throws_on_invalid_iterator_namespaceFn=()=>__webpack_require__(684),Tt=__webpack_require__.cw(function(t,e){var i=it();t.exports=function(t,e){var n=i.Iterator,r=n&&n.prototype,s=r&&r[t],a=!1;if(s)try{s.call({next:function(){return{done:!0}},return:function(){a=!0}},-1)}catch(t){t instanceof e||(a=!1)}if(!a)return s}}),kt=__webpack_require__.cw(function(t,e){var i,n,r,s=z(),a=ft(),o=bt(),l=Rt(),c=Ht(),h=P(),d=De(),u=wt(),p=d("iterator");[].keys&&("next"in(r=[].keys())?(n=c(c(r)))!==Object.prototype&&(i=n):!0);!o(i)||s(function(){var t={};return i[p].call(t)!==t})?i={}:u&&(i=l(i));a(i[p])||h(i,p,function(){return this});t.exports={IteratorPrototype:i}}),iterators_namespaceFn=()=>__webpack_require__(269),Dt=__webpack_require__.cw(function(t,e){var i=to_length_namespaceFn();t.exports=function(t){return i(t.length)}}),Pt=__webpack_require__.cw(function(t,e){var i=K(),n=z(),r=ft(),s=nt(),a=O(),o=$().CONFIGURABLE,l=ht(),c=dt(),h=c.enforce,d=c.get,u=String,p=Object.defineProperty,g=i("".slice),f=i("".replace),m=i([].join),b=a&&!n(function(){return 8!==p(function(){},"length",{value:8}).length}),y=String(String).split("String"),w=t.exports=function(t,e,i){"Symbol("===g(u(e),0,7)&&(e="["+f(u(e),/^Symbol\(([^)]*)\).*$/,"$1")+"]");i&&i.getter&&(e="get "+e);i&&i.setter&&(e="set "+e);(!s(t,"name")||o&&t.name!==e)&&(a?p(t,"name",{value:e,configurable:!0}):t.name=e);b&&i&&s(i,"arity")&&t.length!==i.arity&&p(t,"length",{value:i.arity});try{i&&s(i,"constructor")&&i.constructor?a&&p(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var n=h(t);s(n,"source")||(n.source=m(y,"string"==typeof e?e:""));return t};Function.prototype.toString=w(function toString(){return r(this)&&d(this).source||l(this)},"toString")}),Mt=__webpack_require__.cw(function(t,e){var i=K(),n=Map.prototype;t.exports={Map,set:i(n.set),get:i(n.get),has:i(n.has),remove:i(n.delete),proto:n}}),It=__webpack_require__.cw(function(t,e){var i=z();t.exports=!i(function(){var t="9007199254740993",e=JSON.rawJSON(t);return!JSON.isRawJSON(e)||JSON.stringify(e)!==t})}),Ft=__webpack_require__.cw(function(t,e){var n=i(),r=TypeError,PromiseCapability=function(t){var e,i;this.promise=new t(function(t,n){if(void 0!==e||void 0!==i)throw new r("Bad Promise constructor");e=t;i=n});this.resolve=n(e);this.reject=n(i)};t.exports.f=function(t){return new PromiseCapability(t)}}),Ot=__webpack_require__.cw(function(t,e){var i=we();t.exports=function(t,e){return void 0===t?arguments.length<2?"":e:i(t)}}),not_a_nan_namespaceFn=()=>__webpack_require__(149),Rt=__webpack_require__.cw(function(t,e){var i,n=h(),r=Bt(),s=B(),a=rt(),o=st(),l=R(),c=le(),d="prototype",u="script",p=c("IE_PROTO"),EmptyConstructor=function(){},scriptTag=function(t){return"<"+u+">"+t+""},NullProtoObjectViaActiveX=function(t){t.write(scriptTag(""));t.close();var e=t.parentWindow.Object;t=null;return e},NullProtoObject=function(){try{i=new ActiveXObject("htmlfile")}catch(t){}NullProtoObject="undefined"!=typeof document?document.domain&&i?NullProtoObjectViaActiveX(i):function(){var t,e=l("iframe"),i="java"+u+":";e.style.display="none";o.appendChild(e);e.src=String(i);(t=e.contentWindow.document).open();t.write(scriptTag("document.F=Object"));t.close();return t.F}():NullProtoObjectViaActiveX(i);for(var t=s.length;t--;)delete NullProtoObject[d][s[t]];return NullProtoObject()};a[p]=!0;t.exports=Object.create||function create(t,e){var i;if(null!==t){EmptyConstructor[d]=n(t);i=new EmptyConstructor;EmptyConstructor[d]=null;i[p]=t}else i=NullProtoObject();return void 0===e?i:r.f(i,e)}}),Bt=__webpack_require__.cw(function(t,e){var i=O(),n=Se(),r=Lt(),s=h(),a=fe(),o=jt();e.f=i&&!n?Object.defineProperties:function defineProperties(t,e){s(t);for(var i,n=a(e),l=o(e),c=l.length,h=0;c>h;)r.f(t,i=l[h++],n[i]);return t}}),Lt=__webpack_require__.cw(function(t,e){var i=O(),n=ot(),r=Se(),s=h(),a=be(),o=TypeError,l=Object.defineProperty,c=Object.getOwnPropertyDescriptor,d="enumerable",u="configurable",p="writable";e.f=i?r?function defineProperty(t,e,i){s(t);e=a(e);s(i);if("function"==typeof t&&"prototype"===e&&"value"in i&&p in i&&!i[p]){var n=c(t,e);if(n&&n[p]){t[e]=i.value;i={configurable:u in i?i[u]:n[u],enumerable:d in i?i[d]:n[d],writable:!1}}}return l(t,e,i)}:l:function defineProperty(t,e,i){s(t);e=a(e);s(i);if(n)try{return l(t,e,i)}catch(t){}if("get"in i||"set"in i)throw new o("Accessors not supported");"value"in i&&(t[e]=i.value);return t}}),Nt=__webpack_require__.cw(function(t,e){var i=O(),n=V(),r=Wt(),s=T(),a=fe(),o=be(),l=nt(),c=ot(),h=Object.getOwnPropertyDescriptor;e.f=i?h:function getOwnPropertyDescriptor(t,e){t=a(t);e=o(e);if(c)try{return h(t,e)}catch(t){}if(l(t,e))return s(!n(r.f,t,e),t[e])}}),Ut=__webpack_require__.cw(function(t,e){var i=Gt(),n=B().concat("length","prototype");e.f=Object.getOwnPropertyNames||function getOwnPropertyNames(t){return i(t,n)}}),Ht=__webpack_require__.cw(function(t,e){var i=nt(),n=ft(),r=to_object_namespaceFn(),s=le(),a=C(),o=s("IE_PROTO"),l=Object,c=l.prototype;t.exports=a?l.getPrototypeOf:function(t){var e=r(t);if(i(e,o))return e[o];var s=e.constructor;return n(s)&&e instanceof s?s.prototype:e instanceof l?c:null}}),zt=__webpack_require__.cw(function(t,e){var i=K();t.exports=i({}.isPrototypeOf)}),Gt=__webpack_require__.cw(function(t,e){var i=K(),n=nt(),r=fe(),s=y().indexOf,a=rt(),o=i([].push);t.exports=function(t,e){var i,l=r(t),c=0,h=[];for(i in l)!n(a,i)&&n(l,i)&&o(h,i);for(;e.length>c;)n(l,i=e[c++])&&(~s(h,i)||o(h,i));return h}}),jt=__webpack_require__.cw(function(t,e){var i=Gt(),n=B();t.exports=Object.keys||function keys(t){return i(t,n)}}),Wt=__webpack_require__.cw(function(t,e){var i={}.propertyIsEnumerable,n=Object.getOwnPropertyDescriptor,r=n&&!i.call({1:2},1);e.f=r?function propertyIsEnumerable(t){var e=n(this,t);return!!e&&e.enumerable}:i}),Vt=__webpack_require__.cw(function(t,e){var i=q(),r=bt(),s=require_object_coercible_namespaceFn(),a=n();t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,n={};try{(t=i(Object.prototype,"__proto__","set"))(n,[]);e=n instanceof Array}catch(t){}return function setPrototypeOf(i,n){s(i);a(n);if(!r(i))return i;e?t(i,n):i.__proto__=n;return i}}():void 0)}),$t=__webpack_require__.cw(function(t,e){var i=V(),n=ft(),r=bt(),s=TypeError;t.exports=function(t,e){var a,o;if("string"===e&&n(a=t.toString)&&!r(o=i(a,t)))return o;if(n(a=t.valueOf)&&!r(o=i(a,t)))return o;if("string"!==e&&n(a=t.toString)&&!r(o=i(a,t)))return o;throw new s("Can't convert object to primitive value")}}),qt=__webpack_require__.cw(function(t,e){var i=Y(),n=K(),r=Ut(),s=__webpack_require__(717),a=h(),o=n([].concat);t.exports=i("Reflect","ownKeys")||function ownKeys(t){var e=r.f(a(t)),i=s.f;return i?o(e,i(t)):e}}),Xt=__webpack_require__.cw(function(t,e){var i=K(),n=nt(),r=SyntaxError,s=parseInt,a=String.fromCharCode,o=i("".charAt),l=i("".slice),c=i(/./.exec),h={'\\"':'"',"\\\\":"\\","\\/":"/","\\b":"\b","\\f":"\f","\\n":"\n","\\r":"\r","\\t":"\t"},d=/^[\da-f]{4}$/i,u=/^[\u0000-\u001F]$/;t.exports=function(t,e){for(var i=!0,p="";e__webpack_require__(750),Yt=__webpack_require__.cw(function(t,e){var i=Qt(),n=ne(),r=i.Set,s=i.add;t.exports=function(t){var e=new r;n(t,function(t){s(e,t)});return e}}),Jt=__webpack_require__.cw(function(t,e){var i=r(),n=Qt(),s=Yt(),a=se(),o=et(),l=ne(),c=At(),h=n.has,d=n.remove;t.exports=function difference(t){var e=i(this),n=o(t),r=s(e);a(r)<=n.size?l(r,function(t){n.includes(t)&&d(r,t)}):c(n.getIterator(),function(t){h(r,t)&&d(r,t)});return r}}),Qt=__webpack_require__.cw(function(t,e){var i=K(),n=Set.prototype;t.exports={Set,add:i(n.add),has:i(n.has),remove:i(n.delete),proto:n}}),Zt=__webpack_require__.cw(function(t,e){var i=r(),n=Qt(),s=se(),a=et(),o=ne(),l=At(),c=n.Set,h=n.add,d=n.has;t.exports=function intersection(t){var e=i(this),n=a(t),r=new c;s(e)>n.size?l(n.getIterator(),function(t){d(e,t)&&h(r,t)}):o(e,function(t){n.includes(t)&&h(r,t)});return r}}),te=__webpack_require__.cw(function(t,e){var i=r(),n=Qt().has,s=se(),a=et(),o=ne(),l=At(),c=Ct();t.exports=function isDisjointFrom(t){var e=i(this),r=a(t);if(s(e)<=r.size)return!1!==o(e,function(t){if(r.includes(t))return!1},!0);var h=r.getIterator();return!1!==l(h,function(t){if(n(e,t))return c(h.iterator,"normal",!1)})}}),ee=__webpack_require__.cw(function(t,e){var i=r(),n=se(),s=ne(),a=et();t.exports=function isSubsetOf(t){var e=i(this),r=a(t);return!(n(e)>r.size)&&!1!==s(e,function(t){if(!r.includes(t))return!1},!0)}}),ie=__webpack_require__.cw(function(t,e){var i=r(),n=Qt().has,s=se(),a=et(),o=At(),l=Ct();t.exports=function isSupersetOf(t){var e=i(this),r=a(t);if(s(e)__webpack_require__(835),se=__webpack_require__.cw(function(t,e){var i=q(),n=Qt();t.exports=i(n.proto,"size","get")||function(t){return t.size}}),ae=__webpack_require__.cw(function(t,e){var i=r(),n=Qt(),s=Yt(),a=et(),o=At(),l=n.add,c=n.has,h=n.remove;t.exports=function symmetricDifference(t){var e=i(this),n=a(t).getIterator(),r=s(e);o(n,function(t){c(e,t)?h(r,t):l(r,t)});return r}}),oe=__webpack_require__.cw(function(t,e){var i=r(),n=Qt().add,s=Yt(),a=et(),o=At();t.exports=function union(t){var e=i(this),r=a(t).getIterator(),l=s(e);o(r,function(t){n(l,t)});return l}}),le=__webpack_require__.cw(function(t,e){var i=he(),n=_e(),r=i("keys");t.exports=function(t){return r[t]||(r[t]=n(t))}}),ce=__webpack_require__.cw(function(t,e){var i=wt(),n=it(),r=I(),s="__core-js_shared__",a=t.exports=n[s]||r(s,{});(a.versions||(a.versions=[])).push({version:"3.50.0",mode:i?"pure":"global",copyright:"© 2013–2025 Denis Pushkarev (zloirock.ru), 2025–2026 CoreJS Company (core-js.io). All rights reserved.",license:"https://github.com/zloirock/core-js/blob/v3.50.0/LICENSE",source:"https://github.com/zloirock/core-js"})}),he=__webpack_require__.cw(function(t,e){var i=ce(),n=Object.create||Object;t.exports=function(t,e){return i[t]||(i[t]=e||n(null))}}),de=__webpack_require__.cw(function(t,e){var i=N(),n=z(),r=it().String;t.exports=!!Object.getOwnPropertySymbols&&!n(function(){var t=Symbol("symbol detection");return!r(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&i&&i<41})}),ue=__webpack_require__.cw(function(t,e){var i=K();t.exports=i(1.1.valueOf)}),pe=__webpack_require__.cw(function(t,e){var i=to_integer_or_infinity_namespaceFn(),n=Math.max,r=Math.min;t.exports=function(t,e){var s=i(t);return s<0?n(s+e,0):r(s,e)}}),ge=__webpack_require__.cw(function(t,e){var i=me(),n=TypeError;t.exports=function(t){var e=i(t,"number");if("number"==typeof e)throw new n("Can't convert number to bigint");return BigInt(e)}}),fe=__webpack_require__.cw(function(t,e){var i=lt(),n=require_object_coercible_namespaceFn();t.exports=function(t){return i(n(t))}}),to_integer_or_infinity_namespaceFn=()=>__webpack_require__(291),to_length_namespaceFn=()=>__webpack_require__(14),to_object_namespaceFn=()=>__webpack_require__(981),to_positive_integer_namespaceFn=()=>__webpack_require__(590),me=__webpack_require__.cw(function(t,e){var i=V(),n=bt(),r=_t(),s=tt(),a=$t(),o=De(),l=TypeError,c=o("toPrimitive");t.exports=function(t,e){if(!n(t)||r(t))return t;var o,h=s(t,c);if(h){void 0===e&&(e="default");o=i(h,t,e);if(!n(o)||r(o))return o;throw new l("Can't convert object to primitive value")}void 0===e&&(e="number");return a(t,e)}}),be=__webpack_require__.cw(function(t,e){var i=me(),n=_t();t.exports=function(t){var e=i(t,"string");return n(e)?e:e+""}}),ye=__webpack_require__.cw(function(t,e){var i={};i[De()("toStringTag")]="z";t.exports="[object z]"===String(i)}),we=__webpack_require__.cw(function(t,e){var i=x(),n=String;t.exports=function(t){if("Symbol"===i(t))throw new TypeError("Cannot convert a Symbol value to a string");return n(t)}}),ve=__webpack_require__.cw(function(t,e){var i=String;t.exports=function(t){try{return i(t)}catch(t){return"Object"}}}),_e=__webpack_require__.cw(function(t,e){var i=K(),n=0,r=Math.random(),s=i(1.1.toString);t.exports=function(t){return"Symbol("+(void 0===t?"":t)+")_"+s(++n+r,36)}}),Ae=__webpack_require__.cw(function(t,e){var i=it(),n=K(),r=c(),s=a_string_namespaceFn(),a=nt(),o=base64_map_namespaceFn(),l=get_alphabet_option_namespaceFn(),h=f(),d=o.c2i,u=o.c2iUrl,p=i.SyntaxError,g=i.TypeError,m=i.Array,b=n("".charAt),y=Math.floor,skipAsciiWhitespace=function(t,e){for(var i=t.length;e>16&255,r>>8&255,255&r];if(2===n){if(i&&0!==s[1])throw new p("Extra bits");return[s[0]]}if(3===n){if(i&&0!==s[2])throw new p("Extra bits");return[s[0],s[1]]}return s},writeBytes=function(t,e,i){for(var n=e.length,r=0;r0){if("stop-before-partial"===c)break;if("loose"!==c)throw new p("Missing padding");if(1===A.length)throw new p("Malformed padding: exactly one additional character");v=writeBytes(w,decodeBase64Chunk(A,o,!1),v)}_=f;break}var E=b(t,x);++x;if("="===E){if(A.length<2)throw new p("Padding is too early");x=skipAsciiWhitespace(t,x);if(2===A.length){if(x===f){if("stop-before-partial"===c)break;throw new p("Malformed padding: only one =")}if("="===b(t,x)){++x;x=skipAsciiWhitespace(t,x)}}if(x>4}return{bytes:l,read:h<<1}}}),Ee=__webpack_require__.cw(function(t,e){var i=z(),n=De(),r=O(),s=wt(),a=n("iterator");t.exports=!i(function(){var t=new URL("b?a=1&b=2&c=3","https://a"),e=t.searchParams,i=new URLSearchParams("a=1&a=2&b=3"),n="";t.pathname="c%20d";e.forEach(function(t,i){e.delete("b");n+=i+t});i.delete("a",2);i.delete("b",void 0);return s&&(!t.toJSON||!i.has("a",1)||i.has("a",2)||!i.has("a",void 0)||i.has("b"))||!e.size&&(s||!r)||!e.sort||"https://a/c%20d?a=1&c=3"!==t.href||"3"!==e.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!e[a]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("https://тест").host||"#%D0%B1"!==new URL("https://a#б").hash||"a1c3"!==n||"x"!==new URL("https://x",void 0).host})}),Ce=__webpack_require__.cw(function(t,e){var i=de();t.exports=i&&!Symbol.sham&&"symbol"==typeof Symbol.iterator}),Se=__webpack_require__.cw(function(t,e){var i=O(),n=z();t.exports=i&&n(function(){return 42!==Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype})}),Te=__webpack_require__.cw(function(t,e){var i=it(),n=ft(),r=i.WeakMap;t.exports=n(r)&&/native code/.test(String(r))}),ke=__webpack_require__.cw(function(t,e){var i=K(),n=WeakMap.prototype;t.exports={WeakMap,set:i(n.set),get:i(n.get),has:i(n.has),remove:i(n.delete)}}),De=__webpack_require__.cw(function(t,e){var i=it(),n=he(),r=nt(),s=_e(),a=de(),o=Ce(),l=i.Symbol,c=n("wks"),h=o?l.for||l:l&&l.withoutSetter||s;t.exports=function(t){r(c,t)||(c[t]=a&&r(l,t)?l[t]:h("Symbol."+t));return c[t]}}),Pe=__webpack_require__.cw(function(t,e){var i=H(),n=y().includes,r=z(),s=o(),a=r(function(){return!Array(1).includes()}),l=r(function(){return[,1].includes(void 0,1)});i({target:"Array",proto:!0,forced:a||l},{includes:function includes(t){return n(this,t,arguments.length>1?arguments[1]:void 0)}});s("includes")}),Me=__webpack_require__.cw(function(t,e){var i=H(),n=to_object_namespaceFn(),r=Dt(),s=w(),a=__webpack_require__(837);i({target:"Array",proto:!0,arity:1,forced:z()(function(){return 4294967297!==[].push.call({length:4294967296},1)})||!function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(t){return t instanceof TypeError}}()},{push:function push(t){var e=n(this),i=r(e),o=arguments.length;a(i+o);for(var l=0;l9007199254740991&&e!==f)throw new g("The argument should be a safe integer")}catch(t){l(this,"throw",t)}return b?n(b,this,e):new w(s(this),{remaining:e})}})}),Oe=__webpack_require__.cw(function(t,e){var n=H(),r=V(),s=xt(),a=i(),o=h(),l=get_iterator_direct_namespaceFn(),c=Ct(),d=Tt()("every",TypeError);n({target:"Iterator",proto:!0,real:!0,forced:d},{every:function every(t){o(this);try{a(t)}catch(t){c(this,"throw",t)}if(d)return r(d,this,t);var e=l(this),i=0;return!s(e,function(e,n){if(!t(e,i++))return n()},{IS_RECORD:!0,INTERRUPTED:!0}).stopped}})}),Re=__webpack_require__.cw(function(t,e){var n=H(),r=V(),s=i(),a=h(),o=get_iterator_direct_namespaceFn(),l=St(),c=_(),d=wt(),u=Ct(),p=iterator_helper_throws_on_invalid_iterator_namespaceFn(),g=Tt(),f=!d&&!p("filter",function(){}),m=!d&&!f&&g("filter",TypeError),b=d||f||m,y=l(function(){for(var t,e,i=this.iterator,n=this.predicate,s=this.next;;){t=a(r(s,i));if(this.done=!!t.done)return;e=t.value;if(c(i,n,[e,this.counter++],!0))return e}});n({target:"Iterator",proto:!0,real:!0,forced:b},{filter:function filter(t){a(this);try{s(t)}catch(t){u(this,"throw",t)}return m?r(m,this,t):new y(o(this),{predicate:t})}})}),Be=__webpack_require__.cw(function(t,e){var n=H(),r=V(),s=xt(),a=i(),o=h(),l=get_iterator_direct_namespaceFn(),c=Ct(),d=Tt()("find",TypeError);n({target:"Iterator",proto:!0,real:!0,forced:d},{find:function find(t){o(this);try{a(t)}catch(t){c(this,"throw",t)}if(d)return r(d,this,t);var e=l(this),i=0;return s(e,function(e,n){if(t(e,i++))return n(e)},{IS_RECORD:!0,INTERRUPTED:!0}).result}})}),Le=__webpack_require__.cw(function(t,e){var n=H(),r=V(),s=i(),a=h(),o=get_iterator_direct_namespaceFn(),l=J(),c=St(),d=Ct(),u=z(),p=wt(),g=iterator_helper_throws_on_invalid_iterator_namespaceFn(),f=Tt(),m=!p&&u(function(){return 1!==[1].values().flatMap(function(){return[1]}).find(function(){return!0})}),b=!p&&!m&&!g("flatMap",function(){}),y=!p&&!m&&!b&&f("flatMap",TypeError),w=p||m||b||y,v=c(function(){for(var t,e,i=this.iterator,n=this.mapper;;){if(e=this.inner)try{if(!(t=a(r(e.next,e.iterator))).done)return t.value;this.inner=null}catch(t){d(i,"throw",t)}t=a(r(this.next,i));if(this.done=!!t.done)return;try{this.inner=l(n(t.value,this.counter++),!1)}catch(t){d(i,"throw",t)}}});n({target:"Iterator",proto:!0,real:!0,forced:w},{flatMap:function flatMap(t){a(this);try{s(t)}catch(t){d(this,"throw",t)}return y?r(y,this,t):new v(o(this),{mapper:t,inner:null})}})}),Ne=__webpack_require__.cw(function(t,e){var n=H(),r=V(),s=xt(),a=i(),o=h(),l=get_iterator_direct_namespaceFn(),c=Ct(),d=Tt()("forEach",TypeError);n({target:"Iterator",proto:!0,real:!0,forced:d},{forEach:function forEach(t){o(this);try{a(t)}catch(t){c(this,"throw",t)}if(d)return r(d,this,t);var e=l(this),i=0;s(e,function(e){t(e,i++)},{IS_RECORD:!0})}})}),Ue=__webpack_require__.cw(function(t,e){var n=H(),r=V(),s=i(),a=h(),o=get_iterator_direct_namespaceFn(),l=St(),c=_(),d=Ct(),u=iterator_helper_throws_on_invalid_iterator_namespaceFn(),p=Tt(),g=wt(),f=!g&&!u("map",function(){}),m=!g&&!f&&p("map",TypeError),b=g||f||m,y=l(function(){var t=this.iterator,e=a(r(this.next,t));if(!(this.done=!!e.done))return c(t,this.mapper,[e.value,this.counter++],!0)});n({target:"Iterator",proto:!0,real:!0,forced:b},{map:function map(t){a(this);try{s(t)}catch(t){d(this,"throw",t)}return m?r(m,this,t):new y(o(this),{mapper:t})}})}),He=__webpack_require__.cw(function(t,e){var n=H(),r=V(),s=xt(),a=i(),o=h(),l=get_iterator_direct_namespaceFn(),c=Ct(),d=Tt()("some",TypeError);n({target:"Iterator",proto:!0,real:!0,forced:d},{some:function some(t){o(this);try{a(t)}catch(t){c(this,"throw",t)}if(d)return r(d,this,t);var e=l(this),i=0;return s(e,function(e,n){if(t(e,i++))return n()},{IS_RECORD:!0,INTERRUPTED:!0}).stopped}})}),ze=__webpack_require__.cw(function(t,e){var i=H(),n=V(),r=h(),s=get_iterator_direct_namespaceFn(),a=not_a_nan_namespaceFn(),o=to_positive_integer_namespaceFn(),l=St(),c=Ct(),d=iterator_helper_throws_on_invalid_iterator_namespaceFn(),u=Tt(),p=wt(),g=RangeError,f=1/0,m=!p&&!d("take",1),b=!p&&!m&&u("take",RangeError),y=p||m||b||!function(){try{Iterator.prototype.take.call({next:function(){return{done:!0}}},9007199254740992)}catch(t){return t instanceof g}}(),w=l(function(){var t=this.iterator;if(!this.remaining--){this.done=!0;return c(t,"normal",void 0)}var e=r(n(this.next,t));if(!(this.done=!!e.done))return e.value});i({target:"Iterator",proto:!0,real:!0,forced:y},{take:function take(t){r(this);var e;try{if((e=o(a(+t)))>9007199254740991&&e!==f)throw new g("The argument should be a safe integer")}catch(t){c(this,"throw",t)}return b?n(b,this,e):new w(s(this),{remaining:e})}})}),Ge=__webpack_require__.cw(function(t,e){var i=H(),n=h(),r=k(),s=xt(),a=get_iterator_direct_namespaceFn();i({target:"Iterator",proto:!0,real:!0},{toArray:function toArray(){var t=[],e=0;s(a(n(this)),function(i){r(t,e++,i)},{IS_RECORD:!0});return t}})}),je=__webpack_require__.cw(function(t,e){var i=H(),n=O(),r=it(),s=Y(),a=K(),o=V(),l=ft(),c=bt(),h=pt(),d=nt(),u=we(),p=Dt(),g=k(),f=z(),m=Xt(),b=de(),y=r.JSON,w=r.Number,v=r.SyntaxError,_=y&&y.parse,A=s("Object","keys"),x=Object.getOwnPropertyDescriptor,E=a("".charAt),C=a("".slice),S=a(/./.exec),T=a([].push),D=/^\d$/,P=/^[1-9]$/,M=/^[\d-]$/,I=/^[\t\n\r ]$/,internalize=function(t,e,i,n){var r,s,a,l,u,g=t[e],f=n&&g===n.value,m=f&&"string"==typeof n.source?{source:n.source}:{};if(c(g)){var b=h(g),y=f?n.nodes:b?[]:{};if(b){r=y.length;a=p(g);for(l=0;lu)throw new s("Maximum allowed index exceeded");if("number"!=typeof t)throw new a("Value is not a number");if(n!==f)if(t!=t)n=f;else if(t===o)n=n===m?f:b;else if(t===-1/0)n=n===b?f:m;else if(!(0===t&&1/t!==o||n!==y&&n!==w)){n=w;h(e,t)}});switch(n){case f:return NaN;case m:return-1/0;case b:return o;case y:return-0}for(var c,v,_,A,x,E,C=[],S=0,T=0;T=0?C[M]:0;M--;if(l(S)>1||S>0&&I>0||S<0&&I<0)return S>0?o:-1/0;A=(_=twosum(S*d,I/2)).hi;x=_.lo;x*=2;if(l(2*A)===o)return A>0?A===d&&x===-g/2&&M>=0&&C[M]<0?p:o:A===-d&&x===g/2&&M>=0&&C[M]>0?-p:-1/0;if(0!==x){C[++M]=x;x=0}A*=2}for(;M>=0;){A=(_=twosum(A,C[M--])).hi;if(0!==(x=_.lo))break}M>=0&&(x<0&&C[M]<0||x>0&&C[M]>0)&&(v=2*x)===(c=A+v)-A&&(A=c);return A}})}),Xe=__webpack_require__.cw(function(t,e){var n=H(),r=it(),s=G(),a=v(),o=Kt(),l=Ft(),c=i(),h=__webpack_require__(103),d=z(),u=r.Promise,p=!1;n({target:"Promise",stat:!0,forced:!u||!u.try||d(function(){var t=u.resolve();return u.try(function(e){p=8===e;return t},8)!==t})||!p},{try:function(t){var e=arguments.length>1?a(arguments,1):[],i=h(function(){return s(c(t),void 0,e)});if(!i.error)return o(this,i.value);var n=l.f(this);(0,n.reject)(i.value);return n.promise}})}),Ke=__webpack_require__.cw(function(t,e){var i=H(),n=Jt(),r=z();i({target:"Set",proto:!0,real:!0,forced:!re()("difference",function(t){return 0===t.size})||r(function(){var t={size:1,has:function(){return!0},keys:function(){var t=0;return{next:function(){var i=t++>1;e.has(1)&&e.clear();return{done:i,value:2}}}}},e=new Set([1,2,3,4]);return 3!==e.difference(t).size})},{difference:n})}),Ye=__webpack_require__.cw(function(t,e){var i=H(),n=z(),r=Zt();i({target:"Set",proto:!0,real:!0,forced:!re()("intersection",function(t){return 2===t.size&&t.has(1)&&t.has(2)})||n(function(){return"3,2"!==String(Array.from(new Set([1,2,3]).intersection(new Set([3,2]))))})},{intersection:r})}),Je=__webpack_require__.cw(function(t,e){var i=H(),n=te();i({target:"Set",proto:!0,real:!0,forced:!re()("isDisjointFrom",function(t){return!t})},{isDisjointFrom:n})}),Qe=__webpack_require__.cw(function(t,e){var i=H(),n=ee();i({target:"Set",proto:!0,real:!0,forced:!re()("isSubsetOf",function(t){return t})},{isSubsetOf:n})}),Ze=__webpack_require__.cw(function(t,e){var i=H(),n=ie();i({target:"Set",proto:!0,real:!0,forced:!re()("isSupersetOf",function(t){return!t})},{isSupersetOf:n})}),ti=__webpack_require__.cw(function(t,e){var i=H(),n=ae(),r=set_method_get_keys_before_cloning_detection_namespaceFn();i({target:"Set",proto:!0,real:!0,forced:!re()("symmetricDifference")||!r("symmetricDifference")},{symmetricDifference:n})}),ei=__webpack_require__.cw(function(t,e){var i=H(),n=oe(),r=set_method_get_keys_before_cloning_detection_namespaceFn();i({target:"Set",proto:!0,real:!0,forced:!re()("union")||!r("union")},{union:n})}),ii=__webpack_require__.cw(function(t,e){var i=m(),n=gt(),r=Dt(),s=to_integer_or_infinity_namespaceFn(),a=ge(),o=i.aTypedArray,l=i.getTypedArrayConstructor,c=i.exportTypedArrayMethod,h=RangeError,d=function(){try{new Int8Array(1).with(2,{valueOf:function(){throw 8}})}catch(t){return 8===t}}(),u=d&&function(){try{new Int8Array(1).with(-.5,1)}catch(t){return!0}}();c("with",{with:function(t,e){var i=o(this),c=r(i),d=s(t),u=d<0?c+d:d,p=n(i)?a(e):+e;if(u>=c||u<0)throw new h("Incorrect index");for(var g=new(l(i))(c),f=0;f1?arguments[1]:void 0,null,9007199254740991);return r(a,e.bytes)}})}),ri=__webpack_require__.cw(function(t,e){var i=H(),n=it(),r=Ae(),s=d(),a=n.Uint8Array,o=!a||!a.prototype.setFromBase64||!function(){var t=new a([255,255,255,255,255]);try{t.setFromBase64("",null);return}catch(t){}try{t.setFromBase64("a");return}catch(t){}try{t.setFromBase64("MjYyZg===")}catch(e){return 50===t[0]&&54===t[1]&&50===t[2]&&255===t[3]&&255===t[4]}}();a&&i({target:"Uint8Array",proto:!0,forced:o},{setFromBase64:function setFromBase64(t){s(this);var e=r(t,arguments.length>1?arguments[1]:void 0,this,this.length);return{read:e.read,written:e.written}}})}),si=__webpack_require__.cw(function(t,e){var i=H(),n=it(),r=a_string_namespaceFn(),s=d(),a=f(),o=xe();n.Uint8Array&&i({target:"Uint8Array",proto:!0,forced:function throwsOnLengthTrackingView(){try{var t=new ArrayBuffer(16,{maxByteLength:1024});new Uint8Array(t).setFromHex("cafed00d")}catch(t){return!0}}()},{setFromHex:function setFromHex(t){s(this);r(t);a(this.buffer);var e=o(t,this).read;return{read:e,written:e/2}}})}),ai=__webpack_require__.cw(function(t,e){var i=H(),n=it(),r=K(),s=c(),a=d(),o=f(),l=base64_map_namespaceFn(),h=get_alphabet_option_namespaceFn(),u=l.i2c,p=l.i2cUrl,g=Math.floor,m=Math.ceil,b=r("".charAt),y=n.Uint8Array,w=n.Array,v=r([].join),_=!y||!y.prototype.toBase64||!function(){try{(new y).toBase64(null)}catch(t){return!0}}();y&&i({target:"Uint8Array",proto:!0,forced:_},{toBase64:function toBase64(){var t=a(this),e=arguments.length?s(arguments[0]):void 0,i="base64"===h(e)?u:p,n=!!e&&!!e.omitPadding;o(this.buffer);for(var r,l=0,c=t.length,d=w(n?4*g(c/3)+(c%3?c%3+1:0):4*m(c/3)),f=0,at=function(t){return b(i,r>>6*t&63)};l+2=Wi.INFOS&&console.info(`Info: ${t}`)}function warn(t){Qi>=Wi.WARNINGS&&console.warn(`Warning: ${t}`)}function unreachable(t){throw new Error(t)}function util_assert(t,e){t||unreachable(e)}function createValidAbsoluteUrl(t,e=null,i=null){if(!t)return null;if(i&&"string"==typeof t){if(i.addDefaultProtocol&&t.startsWith("www.")){const e=t.match(/\./g);e?.length>=2&&(t=`http://${t}`)}if(i.tryConvertEncoding)try{t=function stringToUTF8String(t){return decodeURIComponent(escape(t))}(t)}catch{}}const n=e?URL.parse(t,e):URL.parse(t);return function _isValidProtocol(t){switch(t?.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}(n)?n:null}function updateUrlHash(t,e,i=!1){const n=URL.parse(t);if(n){n.hash=e;return n.href}return i&&createValidAbsoluteUrl(t,"http://example.com")?t.split("#",1)[0]+""+(e?`#${e}`:""):""}function stripPath(t){return t.substring(t.lastIndexOf("/")+1)}function util_shadow(t,e,i,n=!1){Object.defineProperty(t,e,{value:i,enumerable:!n,configurable:!0,writable:!1});return i}const Zi=function BaseExceptionClosure(){function BaseException(t,e){this.message=t;this.name=e}BaseException.prototype=new Error;BaseException.constructor=BaseException;return BaseException}();class PasswordException extends Zi{constructor(t,e){super(t,"PasswordException");this.code=e}}class UnknownErrorException extends Zi{constructor(t,e){super(t,"UnknownErrorException");this.details=e}}class InvalidPDFException extends Zi{constructor(t){super(t,"InvalidPDFException")}}class ResponseException extends Zi{constructor(t,e,i){super(t,"ResponseException");this.status=e;this.missing=i}}class FormatError extends Zi{constructor(t){super(t,"FormatError")}}class AbortException extends Zi{constructor(t){super(t,"AbortException")}}function stringToBytes(t){"string"!=typeof t&&unreachable("Invalid argument for stringToBytes");const e=t.length,i=new Uint8Array(e);for(let n=0;ne.toString(16).padStart(2,"0")))}static makeHexColor(t,e,i){return`#${this.hexNums[t]}${this.hexNums[e]}${this.hexNums[i]}`}static transform(t,e){return[t[0]*e[0]+t[2]*e[1],t[1]*e[0]+t[3]*e[1],t[0]*e[2]+t[2]*e[3],t[1]*e[2]+t[3]*e[3],t[0]*e[4]+t[2]*e[5]+t[4],t[1]*e[4]+t[3]*e[5]+t[5]]}static multiplyByDOMMatrix(t,e){return[t[0]*e.a+t[2]*e.b,t[1]*e.a+t[3]*e.b,t[0]*e.c+t[2]*e.d,t[1]*e.c+t[3]*e.d,t[0]*e.e+t[2]*e.f+t[4],t[1]*e.e+t[3]*e.f+t[5]]}static applyTransform(t,e,i=0){const n=t[i],r=t[i+1];t[i]=n*e[0]+r*e[2]+e[4];t[i+1]=n*e[1]+r*e[3]+e[5]}static applyTransformToBezier(t,e,i=0){const n=e[0],r=e[1],s=e[2],a=e[3],o=e[4],l=e[5];for(let e=0;e<6;e+=2){const c=t[i+e],h=t[i+e+1];t[i+e]=c*n+h*s+o;t[i+e+1]=c*r+h*a+l}}static applyInverseTransform(t,e){const i=t[0],n=t[1],r=e[0]*e[3]-e[1]*e[2];t[0]=(i*e[3]-n*e[2]+e[2]*e[5]-e[4]*e[3])/r;t[1]=(-i*e[1]+n*e[0]+e[4]*e[1]-e[5]*e[0])/r}static axialAlignedBoundingBox(t,e,i){const n=e[0],r=e[1],s=e[2],a=e[3],o=e[4],l=e[5],c=t[0],h=t[1],d=t[2],u=t[3];let p=n*c+o,g=p,f=n*d+o,m=f,b=a*h+l,y=b,w=a*u+l,v=w;if(0!==r||0!==s){const t=r*c,e=r*d,i=s*h,n=s*u;p+=i;m+=i;f+=n;g+=n;b+=t;v+=t;w+=e;y+=e}i[0]=Math.min(i[0],p,f,g,m);i[1]=Math.min(i[1],b,w,y,v);i[2]=Math.max(i[2],p,f,g,m);i[3]=Math.max(i[3],b,w,y,v)}static inverseTransform(t){const e=t[0]*t[3]-t[1]*t[2];return[t[3]/e,-t[1]/e,-t[2]/e,t[0]/e,(t[2]*t[5]-t[4]*t[3])/e,(t[4]*t[1]-t[5]*t[0])/e]}static singularValueDecompose2dScale(t,e){const i=t[0],n=t[1],r=t[2],s=t[3],a=i**2+n**2,o=i*r+n*s,l=r**2+s**2,c=(a+l)/2,h=Math.sqrt(c**2-(a*l-o**2));e[0]=Math.sqrt(c+h||1);e[1]=Math.sqrt(c-h||1)}static normalizeRect(t){const e=t.slice(0);if(t[0]>t[2]){e[0]=t[2];e[2]=t[0]}if(t[1]>t[3]){e[1]=t[3];e[3]=t[1]}return e}static intersect(t,e){const i=Math.max(Math.min(t[0],t[2]),Math.min(e[0],e[2])),n=Math.min(Math.max(t[0],t[2]),Math.max(e[0],e[2]));if(i>n)return null;const r=Math.max(Math.min(t[1],t[3]),Math.min(e[1],e[3])),s=Math.min(Math.max(t[1],t[3]),Math.max(e[1],e[3]));return r>s?null:[i,r,n,s]}static pointBoundingBox(t,e,i){i[0]=Math.min(i[0],t);i[1]=Math.min(i[1],e);i[2]=Math.max(i[2],t);i[3]=Math.max(i[3],e)}static rectBoundingBox(t,e,i,n,r){r[0]=Math.min(r[0],t,i);r[1]=Math.min(r[1],e,n);r[2]=Math.max(r[2],t,i);r[3]=Math.max(r[3],e,n)}static#t(t,e,i,n,r,s,a,o,l,c){if(l<=0||l>=1)return;const h=1-l,d=l*l,u=d*l,p=h*(h*(h*t+3*l*e)+3*d*i)+u*n,g=h*(h*(h*r+3*l*s)+3*d*a)+u*o;c[0]=Math.min(c[0],p);c[1]=Math.min(c[1],g);c[2]=Math.max(c[2],p);c[3]=Math.max(c[3],g)}static#e(t,e,i,n,r,s,a,o,l,c,h,d){if(Math.abs(l)<1e-12){Math.abs(c)>=1e-12&&this.#t(t,e,i,n,r,s,a,o,-h/c,d);return}const u=c**2-4*h*l;if(u<0)return;const p=Math.sqrt(u),g=2*l;this.#t(t,e,i,n,r,s,a,o,(-c+p)/g,d);this.#t(t,e,i,n,r,s,a,o,(-c-p)/g,d)}static bezierBoundingBox(t,e,i,n,r,s,a,o,l){l[0]=Math.min(l[0],t,a);l[1]=Math.min(l[1],e,o);l[2]=Math.max(l[2],t,a);l[3]=Math.max(l[3],e,o);this.#e(t,i,r,a,e,n,s,o,3*(3*(i-r)-t+a),6*(t-2*i+r),3*(i-t),l);this.#e(t,i,r,a,e,n,s,o,3*(3*(n-s)-e+o),6*(e-2*n+s),3*(n-e),l)}}let tn=null,en=null;function normalizeUnicode(t){if(!tn){tn=/([\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;en=new Map([["ſt","ſt"]])}return t.replaceAll(tn,(t,e,i)=>e?e.normalize("NFKC"):en.get(i))}function getUuid(){if("function"==typeof crypto.randomUUID)return crypto.randomUUID();const t=new Uint8Array(32);crypto.getRandomValues(t);return function bytesToString(t){"object"==typeof t&&void 0!==t?.length||unreachable("Invalid argument for bytesToString");const e=t.length,i=8192;if(e[],makeMap=()=>new Map,makeObj=()=>Object.create(null),makeSet=()=>new Set;"function"!=typeof Blob.prototype.bytes&&(Blob.prototype.bytes=async function(){return new Uint8Array(await this.arrayBuffer())});"function"!=typeof Response.prototype.bytes&&(Response.prototype.bytes=async function(){return new Uint8Array(await this.arrayBuffer())});"function"!=typeof Iterator.prototype.join&&(Iterator.prototype.join=function(t){return[...this].join(t)});Ue();function MathClamp(t,e,i){return Math.min(Math.max(t,e),i)}class PageViewport{constructor({viewBox:t,userUnit:e,scale:i,rotation:n,offsetX:r=0,offsetY:s=0,dontFlip:a=!1}){this.viewBox=t;this.userUnit=e;this.scale=i;this.rotation=n;this.offsetX=r;this.offsetY=s;i*=e;const o=(t[2]+t[0])/2,l=(t[3]+t[1])/2;let c,h,d,u,p,g,f,m;(n%=360)<0&&(n+=360);switch(n){case 180:c=-1;h=0;d=0;u=1;break;case 90:c=0;h=1;d=1;u=0;break;case 270:c=0;h=-1;d=-1;u=0;break;case 0:c=1;h=0;d=0;u=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}if(a){d=-d;u=-u}if(0===c){p=Math.abs(l-t[1])*i+r;g=Math.abs(o-t[0])*i+s;f=(t[3]-t[1])*i;m=(t[2]-t[0])*i}else{p=Math.abs(o-t[0])*i+r;g=Math.abs(l-t[1])*i+s;f=(t[2]-t[0])*i;m=(t[3]-t[1])*i}this.transform=[c*i,h*i,d*i,u*i,p-c*i*o-d*i*l,g-h*i*o-u*i*l];this.width=f;this.height=m}get rawDims(){const t=this.viewBox;return util_shadow(this,"rawDims",{pageWidth:t[2]-t[0],pageHeight:t[3]-t[1],pageX:t[0],pageY:t[1]})}clone({scale:t=this.scale,rotation:e=this.rotation,offsetX:i=this.offsetX,offsetY:n=this.offsetY,dontFlip:r=!1}={}){return new PageViewport({viewBox:this.viewBox.slice(),userUnit:this.userUnit,scale:t,rotation:e,offsetX:i,offsetY:n,dontFlip:r})}convertToViewportPoint(t,e){const i=[t,e];Util.applyTransform(i,this.transform);return i}convertToPdfPoint(t,e){const i=[t,e];Util.applyInverseTransform(i,this.transform);return i}}class XfaText{static textContent(t){const e=[],i={items:e,styles:Object.create(null)};!function walk(t){if(!t)return;let i=null;const n=t.name;if("#text"===n)i=t.value;else{if(!XfaText.shouldBuildText(n))return;t?.attributes?.textContent?i=t.attributes.textContent:t.value&&(i=t.value)}null!==i&&e.push({str:i});if(t.children)for(const e of t.children)walk(e)}(t);return i}static shouldBuildText(t){return!("textarea"===t||"input"===t||"option"===t||"select"===t)}}const nn=/url\(|image-set\(/i,rn=/^on/i;class XfaLayer{static get _allowedHtmlElements(){return util_shadow(this,"_allowedHtmlElements",new Set(["a","b","br","button","div","i","img","input","label","li","ol","option","p","select","span","sub","sup","textarea","ul"]))}static get _allowedSvgElements(){return util_shadow(this,"_allowedSvgElements",new Set(["ellipse","line","path","rect","svg"]))}static get _allowedRichTextElements(){return util_shadow(this,"_allowedRichTextElements",new Set(["a","b","br","div","i","li","ol","p","span","sub","sup","ul"]))}static get _allowedRichTextAttributes(){return util_shadow(this,"_allowedRichTextAttributes",new Set(["class","dir","style"]))}static get _allowedRichTextStyles(){return util_shadow(this,"_allowedRichTextStyles",new Set(["color","font","fontFamily","fontSize","fontStretch","fontStyle","fontWeight","kerningMode","letterSpacing","lineHeight","margin","marginBottom","marginLeft","marginRight","marginTop","orphans","paddingLeft","paddingRight","breakAfter","breakBefore","breakInside","tabInterval","tabStop","textAlign","textDecoration","textIndent","transform","verticalAlign","widows"]))}static setupStorage(t,e,i,n,r){const s=n.getValue(e,{value:null});switch(i.name){case"textarea":null!==s.value&&(t.textContent=s.value);if("print"===r)break;t.addEventListener("input",t=>{n.setValue(e,{value:t.target.value})});break;case"input":if("radio"===i.attributes.type||"checkbox"===i.attributes.type){s.value===i.attributes.xfaOn?t.setAttribute("checked",!0):s.value===i.attributes.xfaOff&&t.removeAttribute("checked");if("print"===r)break;t.addEventListener("change",t=>{n.setValue(e,{value:t.target.checked?t.target.getAttribute("xfaOn"):t.target.getAttribute("xfaOff")})})}else{null!==s.value&&t.setAttribute("value",s.value);if("print"===r)break;t.addEventListener("input",t=>{n.setValue(e,{value:t.target.value})})}break;case"select":if(null!==s.value){t.setAttribute("value",s.value);for(const t of i.children)t.attributes.value===s.value?t.attributes.selected=!0:Object.hasOwn(t.attributes,"selected")&&delete t.attributes.selected}t.addEventListener("input",t=>{const i=t.target.options,r=-1===i.selectedIndex?"":i[i.selectedIndex].value;n.setValue(e,{value:r})})}}static setAttributes({html:t,element:e,storage:i=null,intent:n,linkService:r}){const{attributes:s}=e,a=t instanceof HTMLAnchorElement;"radio"===s.type&&(s.name=`${s.name}-${n}`);for(const[e,i]of Object.entries(s))if(null!=i&&!rn.test(e)&&("richText"!==n||this._allowedRichTextAttributes.has(e)))switch(e){case"class":i.length&&t.setAttribute(e,i.join(" "));break;case"dataId":break;case"id":t.setAttribute("data-element-id",i);break;case"style":if("richText"===n){const e=this._allowedRichTextStyles;for(const[n,r]of Object.entries(i))e.has(n)&&!nn.test(r)&&(t.style[n]=r)}else Object.assign(t.style,i);break;case"textContent":t.textContent=i;break;default:(!a||"href"!==e&&"newWindow"!==e)&&t.setAttribute(e,i)}a&&r?.addLinkAttributes(t,s.href,s.newWindow);i&&s.dataId&&this.setupStorage(t,s.dataId,e,i)}static#i(t,e,i){return"richText"===i?!e&&this._allowedRichTextElements.has(t)?document.createElement(t):null:e?e===mi&&this._allowedSvgElements.has(t)?document.createElementNS(mi,t):null:this._allowedHtmlElements.has(t)?document.createElement(t):null}static render(t){const e=t.annotationStorage,i=t.linkService,n=t.xfaHtml,r=t.intent||"display",s=this.#i(n.name,n.attributes?.xmlns,r)??document.createElement("div");n.attributes&&this.setAttributes({html:s,element:n,intent:r,linkService:i});const a="richText"!==r,o=t.div;o.append(s);if(t.viewport){const e=`matrix(${t.viewport.transform.join(",")})`;o.style.transform=e}a&&o.setAttribute("class","xfaLayer xfaFont");const l=[];if(0===n.children.length){if(n.value){const t=document.createTextNode(n.value);s.append(t);a&&XfaText.shouldBuildText(n.name)&&l.push(t)}return{textDivs:l}}const c=[[n,-1,s]];for(;c.length>0;){const[t,n,s]=c.at(-1);if(n+1===t.children.length){c.pop();continue}const o=t.children[++c.at(-1)[1]];if(null===o)continue;const{name:h}=o;if("#text"===h){const t=document.createTextNode(o.value);l.push(t);s.append(t);continue}const d=this.#i(h,o.attributes?.xmlns,r);if(d){s.append(d);o.attributes&&this.setAttributes({html:d,element:o,storage:e,intent:r,linkService:i});if(o.children?.length>0)c.push([o,-1,d]);else if(o.value){const t=document.createTextNode(o.value);a&&XfaText.shouldBuildText(h)&&l.push(t);d.append(t)}}}for(const t of o.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))t.setAttribute("readOnly",!0);return{textDivs:l}}static update(t){const e=`matrix(${t.viewport.transform.join(",")})`;t.div.style.transform=e;t.div.hidden=!1}static getPageViewport(t,{scale:e=1,rotation:i=0}){const{width:n,height:r}=t.attributes.style;return new PageViewport({viewBox:[0,0,parseInt(n,10),parseInt(r,10)],userUnit:1,scale:e,rotation:i})}}class PixelsPerInch{static CSS=96;static PDF=72;static PDF_TO_CSS_UNITS=this.CSS/this.PDF}async function fetchData(t,e="text"){if(isValidFetchUrl(t,document.baseURI)){const i=await fetch(t);if(!i.ok)throw new Error(i.statusText);switch(e){case"blob":return i.blob();case"bytes":return i.bytes();case"json":return i.json()}return i.text()}return new Promise((i,n)=>{const r=new XMLHttpRequest;r.open("GET",t,!0);r.responseType="bytes"===e?"arraybuffer":e;r.onreadystatechange=()=>{if(r.readyState===XMLHttpRequest.DONE)if(200!==r.status&&0!==r.status)n(new Error(r.statusText));else{switch(e){case"bytes":i(new Uint8Array(r.response));return;case"blob":case"json":i(r.response);return}i(r.responseText)}};r.send(null)})}class RenderingCancelledException extends Zi{constructor(t,e=0){super(t,"RenderingCancelledException");this.extraDelay=e}}function isDataScheme(t){const e=t.length;let i=0;for(;i{try{return new URL(t)}catch{}try{return new URL(decodeURIComponent(t))}catch{}try{return new URL(t,"https://foo.bar")}catch{}try{return new URL(decodeURIComponent(t),"https://foo.bar")}catch{}return null})(t);if(!i)return e;const decode=t=>{try{let e=decodeURIComponent(t);if(e.includes("/")){e=stripPath(e);if(4===e.length&&n.test(e))return t}return e}catch{return t}},n=/\.pdf$/i,r=stripPath(i.pathname);if(n.test(r))return decode(r);if(i.searchParams.size>0){const getLast=t=>[...t].findLast(t=>n.test(t)),t=getLast(i.searchParams.values())??getLast(i.searchParams.keys());if(t)return decode(t)}if(i.hash){const{hash:t}=i;let e=-1;for(const{index:i}of t.matchAll(/\.pdf\b/gi))e=i;if(e>0){let i=e;for(;i>0&&!"/?#=".includes(t[i-1]);)i--;if(it.name.length));return this.times.map(e=>`${e.name.padEnd(t)} ${e.end-e.start}ms\n`).join("")}}function isValidFetchUrl(t,e){const i=e?URL.parse(t,e):URL.parse(t);return/https?:/.test(i?.protocol??"")}function noContextMenu(t){t.preventDefault()}function stopEvent(t){t.preventDefault();t.stopPropagation()}class PDFDateString{static#r;static toDateObject(t){if(t instanceof Date)return t;if(!t||"string"!=typeof t)return null;this.#r||=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+\\-])?(\\d{2})?'?(\\d{2})?'?");const e=this.#r.exec(t);if(!e)return null;const i=parseInt(e[1],10);let n=parseInt(e[2],10);n=n>=1&&n<=12?n-1:0;let r=parseInt(e[3],10);r=r>=1&&r<=31?r:1;let s=parseInt(e[4],10);s=s>=0&&s<=23?s:0;let a=parseInt(e[5],10);a=a>=0&&a<=59?a:0;let o=parseInt(e[6],10);o=o>=0&&o<=59?o:0;const l=e[7]||"Z";let c=parseInt(e[8],10);c=c>=0&&c<=23?c:0;let h=parseInt(e[9],10)||0;h=h>=0&&h<=59?h:0;if("-"===l){s+=c;a+=h}else if("+"===l){s-=c;a-=h}return new Date(Date.UTC(i,n,r,s,a,o))}}function getRGBA(t){if(t.startsWith("#")){const e=t.slice(1);return[parseInt(e.slice(0,2),16),parseInt(e.slice(2,4),16),parseInt(e.slice(4,6),16),e.length>=8?parseInt(e.slice(6,8),16)/255:1]}if(t.startsWith("rgb(")){const[e,i,n]=t.slice(4,-1).split(",").map(t=>parseInt(t,10));return[e,i,n,1]}if(t.startsWith("rgba(")){const e=t.slice(5,-1).split(",");return[parseInt(e[0],10),parseInt(e[1],10),parseInt(e[2],10),parseFloat(e[3])]}const e=t.match(/^color\(srgb\s+([\d.]+)\s+([\d.]+)\s+([\d.]+)(?:\s*\/\s*([\d.]+|none))?\)$/);return e?[Math.round(255*parseFloat(e[1])),Math.round(255*parseFloat(e[2])),Math.round(255*parseFloat(e[3])),void 0!==e[4]&&"none"!==e[4]?parseFloat(e[4]):1]:null}function getRGB(t){const e=getRGBA(t);if(!e){warn(`Not a valid color format: "${t}"`);return[0,0,0]}return e.slice(0,3)}function getCurrentTransform(t){const{a:e,b:i,c:n,d:r,e:s,f:a}=t.getTransform();return[e,i,n,r,s,a]}function getCurrentTransformInverse(t){const{a:e,b:i,c:n,d:r,e:s,f:a}=t.getTransform().invertSelf();return[e,i,n,r,s,a]}function setLayerDimensions(t,e,i=!1,n=!0){if(e instanceof PageViewport){const{pageWidth:n,pageHeight:r}=e.rawDims,{style:s}=t,a=`round(down, var(--total-scale-factor) * ${n}px, var(--scale-round-x))`,o=`round(down, var(--total-scale-factor) * ${r}px, var(--scale-round-y))`;if(i&&e.rotation%180!=0){s.width=o;s.height=a}else{s.width=a;s.height=o}}n&&t.setAttribute("data-main-rotation",e.rotation)}class OutputScale{constructor(){const{pixelRatio:t}=OutputScale;this.sx=t;this.sy=t}get scaled(){return 1!==this.sx||1!==this.sy}get symmetric(){return this.sx===this.sy}limitCanvas(t,e,i,n,r=-1){let s=1/0,a=1/0,o=1/0;(i=OutputScale.capPixels(i,r))>0&&(s=Math.sqrt(i/(t*e)));if(-1!==n){a=n/t;o=n/e}const l=Math.min(s,a,o);if(this.sx>l||this.sy>l){this.sx=l;this.sy=l;return!0}return!1}static get pixelRatio(){return globalThis.devicePixelRatio||1}static capPixels(t,e){if(e>=0){const i=Math.ceil(window.screen.availWidth*window.screen.availHeight*this.pixelRatio**2*(1+e/100));return t>0?Math.min(t,i):i}return t}}const sn=new Set(["image/apng","image/avif","image/bmp","image/gif","image/jpeg","image/png","image/svg+xml","image/webp","image/x-icon"]);class ColorScheme{static get isDarkMode(){return util_shadow(this,"isDarkMode",!!window?.matchMedia?.("(prefers-color-scheme: dark)").matches)}}class CSSConstants{static get commentForegroundColor(){const t=document.createElement("span");t.classList.add("comment","sidebar");const{style:e}=t;e.width=e.height="0";e.display="none";e.color="var(--comment-fg-color)";document.body.append(t);const{color:i}=window.getComputedStyle(t);t.remove();return util_shadow(this,"commentForegroundColor",getRGB(i))}}function applyOpacity(t,e){const i=255*(1-(e=MathClamp(e??1,0,1)));return t.map(t=>Math.round(t*e+i))}function RGBToHSL(t,e){const i=t[0]/255,n=t[1]/255,r=t[2]/255,s=Math.max(i,n,r),a=Math.min(i,n,r),o=(s+a)/2;if(s===a)e[0]=e[1]=0;else{const t=s-a;e[1]=o<.5?t/(s+a):t/(2-s-a);switch(s){case i:e[0]=60*((n-r)/t+(nr?(n+.05)/(r+.05):(r+.05)/(n+.05)}const an=new Map;function findContrastColor(t,e){const i=t[0]+256*t[1]+65536*t[2]+16777216*e[0]+4294967296*e[1]+1099511627776*e[2];let n=an.get(i);if(n)return n;const r=new Float32Array(9),s=r.subarray(0,3),a=r.subarray(3,6);RGBToHSL(t,a);const o=r.subarray(6,9);RGBToHSL(e,o);const l=o[2]<.5,c=l?12:4.5;a[2]=l?Math.sqrt(a[2]):1-Math.sqrt(1-a[2]);if(contrastRatio(a,o,s)i;){const i=a[2]=(t+e)/2;l===contrastRatio(a,o,s){e.delete()},{signal:e._signal});this.#l.append(i)}get#y(){const t=document.createElement("div");t.className="divider";return t}async addAltText(t){const e=await t.render();this.#b(e);this.#l.append(e,this.#y);this.#c=t}addComment(t,e=null){if(this.#h)return;const i=t.renderForToolbar();if(!i)return;this.#b(i);const n=this.#d=this.#y;if(e){this.#l.insertBefore(i,e);this.#l.insertBefore(n,e)}else this.#l.append(i,n);this.#h=t;t.toolbar=this}addColorPicker(t){if(this.#a)return;this.#a=t;const e=t.renderButton();this.#b(e);this.#l.append(e,this.#y)}async addEditSignatureButton(t){const e=this.#u=await t.renderEditButton(this.#o);if(e){this.#b(e);this.#l.append(e,this.#y)}}removeButton(t){if("comment"===t){this.#h?.removeToolbarCommentButton();this.#h=null;this.#d?.remove();this.#d=null}}async addButton(t,e){switch(t){case"colorPicker":e&&this.addColorPicker(e);break;case"altText":e&&await this.addAltText(e);break;case"editSignature":e&&await this.addEditSignatureButton(e);break;case"delete":this.addDeleteButton();break;case"comment":e&&this.addComment(e)}}async addButtonBefore(t,e,i){if(!e&&"comment"===t)return;const n=this.#l.querySelector(i);n&&"comment"===t&&this.addComment(e,n)}updateEditSignatureButton(t){this.#u&&(this.#u.title=t)}remove(){this.#s.remove();this.#a?.destroy();this.#a=null}}class FloatingToolbar{#l=null;#s=null;#w;constructor(t){this.#w=t}#v(){const t=this.#s=document.createElement("div");t.className="editToolbar";t.setAttribute("role","toolbar");t.dir=this.#w.direction;const e=this.#w._signal;e instanceof AbortSignal&&!e.aborted&&t.addEventListener("contextmenu",noContextMenu,{signal:e});const i=this.#l=document.createElement("div");i.className="buttons";t.append(i);this.#w.hasCommentManager()&&this.#_("commentButton","pdfjs-comment-floating-button","pdfjs-comment-floating-button-label",()=>{this.#w.commentSelection("floating_button")});this.#_("highlightButton","pdfjs-highlight-floating-button1","pdfjs-highlight-floating-button-label",()=>{this.#w.highlightSelection("floating_button")});return t}#A(t,e){let i=0,n=0;for(const r of t){const t=r.y+r.height;if(ti){n=s;i=t}else e?s>n&&(n=s):s=1}static clearPointerType(){CurrentPointers.#S=null}static clearPointerIds(){CurrentPointers.#x=NaN;CurrentPointers.#E=null}static clearTimeStamp(){CurrentPointers.#C=NaN}}class IdManager{#T=0;get id(){return`${Ti}${this.#T++}`}}class ImageManager{#k=getUuid();#T=0;#D=null;static get _isSVGFittingCanvas(){const t=`data:image/svg+xml;charset=UTF-8,`,e=new OffscreenCanvas(1,3).getContext("2d",{willReadFrequently:!0}),i=new Image;i.src=t;return util_shadow(this,"_isSVGFittingCanvas",i.decode().then(()=>{e.drawImage(i,0,0,1,1,0,0,1,3);return 0===new Uint32Array(e.getImageData(0,0,1,1).data.buffer)[0]}))}async#P(t,e){this.#D||=new Map;let i=this.#D.get(t);if(null===i)return null;if(i?.bitmap){i.refCounter+=1;return i}try{i||={bitmap:null,id:`image_${this.#k}_${this.#T++}`,refCounter:0,isSvg:!1};let t;if("string"==typeof e){i.url=e;t=await fetchData(e,"blob")}else e instanceof File?t=i.file=e:e instanceof Blob&&(t=e);if("image/svg+xml"===t.type){const e=ImageManager._isSVGFittingCanvas,n=new FileReader,r=new Image,s=new Promise((t,s)=>{r.onload=()=>{i.bitmap=r;i.isSvg=!0;t()};n.onload=async()=>{const t=i.svgUrl=n.result;r.src=await e?`${t}#svgView(preserveAspectRatio(none))`:t};r.onerror=n.onerror=s});n.readAsDataURL(t);await s}else i.bitmap=await createImageBitmap(t);i.refCounter=1}catch(t){warn(t);i=null}this.#D.set(t,i);i&&this.#D.set(i.id,i);return i}async getFromFile(t){const{lastModified:e,name:i,size:n,type:r}=t;return this.#P(`${e}_${i}_${n}_${r}`,t)}async getFromUrl(t){return this.#P(t,t)}async getFromBlob(t,e){const i=await e;return this.#P(t,i)}async getFromId(t){this.#D||=new Map;const e=this.#D.get(t);if(!e)return null;if(e.bitmap){e.refCounter+=1;return e}if(e.file)return this.getFromFile(e.file);if(e.blobPromise){const{blobPromise:t}=e;delete e.blobPromise;return this.getFromBlob(e.id,t)}return this.getFromUrl(e.url)}getFromCanvas(t,e){this.#D||=new Map;let i=this.#D.get(t);if(i?.bitmap){i.refCounter+=1;return i}const n=new OffscreenCanvas(e.width,e.height);n.getContext("2d").drawImage(e,0,0);i={bitmap:n.transferToImageBitmap(),id:`image_${this.#k}_${this.#T++}`,refCounter:1,isSvg:!1};this.#D.set(t,i);this.#D.set(i.id,i);return i}getSvgUrl(t){const e=this.#D.get(t);return e?.isSvg?e.svgUrl:null}deleteId(t){this.#D||=new Map;const e=this.#D.get(t);if(!e)return;e.refCounter-=1;if(0!==e.refCounter)return;const{bitmap:i}=e;if(!e.url&&!e.file){const t=new OffscreenCanvas(i.width,i.height);t.getContext("bitmaprenderer").transferFromImageBitmap(i);e.blobPromise=t.convertToBlob()}i.close?.();e.bitmap=null}isValidId(t){return t.startsWith(`image_${this.#k}_`)}}class CommandManager{#M=[];#I=!1;#F;#O=-1;constructor(t=128){this.#F=t}add({cmd:t,undo:e,post:i,mustExec:n,type:r=NaN,overwriteIfSameType:s=!1,keepUndo:a=!1}){n&&t();if(this.#I)return;const o={cmd:t,undo:e,post:i,type:r};if(-1===this.#O){this.#M.length>0&&(this.#M.length=0);this.#O=0;this.#M.push(o);return}if(s&&this.#M[this.#O].type===r){a&&(o.undo=this.#M[this.#O].undo);this.#M[this.#O]=o;return}const l=this.#O+1;if(l===this.#F)this.#M.splice(0,1);else{this.#O=l;l=0;e--)if(this.#M[e].type!==t){this.#M.splice(e+1,this.#O-e);this.#O=e;return}this.#M.length=0;this.#O=-1}}destroy(){this.#M=null}}class KeyboardManager{static ALT=1;static CTRL=2;static META=4;static SHIFT=8;constructor(t){this.callbacks=new Map;const{isMac:e}=FeatureTest.platform;for(const[i,n,r={}]of t){const t=i.some(t=>t.startsWith("mac+"));for(const s of i){let i=s;if(t){const t=s.startsWith("mac+");if(e!==t)continue;t&&(i=s.slice(4))}const[a,o]=KeyboardManager.#R(i);null!==a&&this.callbacks.getOrInsertComputed(a,makeArr).push({callback:n,options:r,modifiers:o})}}}static#R(t){let e=null,i=0;for(let n of t.split("+")){n=n.trim();if(!n)continue;const r=n.toUpperCase(),s=KeyboardManager[r];if(s)i|=s;else{if(null!==e){warn(`KeyboardManager: multiple keys in shortcut "${t}"`);break}e="SPACE"===r?" ":n}}null===e&&warn(`KeyboardManager: no key found in shortcut "${t}"`);return[e,i]}static#B(t){const e=/^(?:Key([A-Z])|(?:Digit|Numpad)(\d))$/.exec(t);return e?e[1]?.toLowerCase()??e[2]:null}exec(t,e){let i=this.callbacks.get(e.key);if(!i){if(/^[a-z]$/i.test(e.key))return;const t=KeyboardManager.#B(e.code);if(null===t||t===e.key)return;i=this.callbacks.get(t);if(!i)return}const n=(e.altKey?KeyboardManager.ALT:0)|(e.ctrlKey?KeyboardManager.CTRL:0)|(e.metaKey?KeyboardManager.META:0)|(e.shiftKey?KeyboardManager.SHIFT:0),r=i.find(t=>t.modifiers===n);if(!r)return;const{callback:s,options:{bubbles:a=!1,args:o=[],checker:l=null}}=r;if(!l||l(t,e)){s.bind(t,...o,e)();a||stopEvent(e)}}}class ColorManager{static _colorsMapping=new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]);get _colors(){const t=new Map([["CanvasText",null],["Canvas",null]]);!function getColorValues(t){const e=document.createElement("span");e.style.visibility="hidden";e.style.colorScheme="only light";document.body.append(e);for(const i of t.keys()){e.style.color=i;const n=window.getComputedStyle(e).color;t.set(i,getRGB(n))}e.remove()}(t);return util_shadow(this,"_colors",t)}convert(t){const e=getRGB(t);if(!window.matchMedia("(forced-colors: active)").matches)return e;for(const[t,i]of this._colors)if(i.every((t,i)=>t===e[i]))return ColorManager._colorsMapping.get(t);return e}getHexCode(t){const e=this._colors.get(t);return e?Util.makeHexColor(...e):t}}class AnnotationEditorUIManager{#L=new AbortController;#N=null;#U=null;#H=new Map;#z=new Map;#G=null;#j=null;#W=null;#V=null;#$=null;#q=new CommandManager;#X=null;#K=null;#Y=null;#J=0;#Q=new Set;#Z=null;#tt=null;#et=new Set;_editorUndoBar=null;#it=!1;#nt=!1;#rt=!1;#st=null;#at=null;#ot=null;#lt=null;#ct=!1;#ht=null;#dt=new IdManager;#ut=!1;#pt=!1;#gt=!1;#ft=null;#mt=null;#bt=null;#yt=null;#wt=null;#vt=ki.NONE;#_t=new Set;#At=null;#xt=null;#Et=null;#Ct=null;#St=null;#Tt={isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1,hasSelectedText:!1};#kt=[0,0];#Dt=null;#Pt=null;#Mt=null;#It=null;#Ft=null;static TRANSLATE_SMALL=1;static TRANSLATE_BIG=10;static get _keyboardManager(){const t=AnnotationEditorUIManager.prototype,arrowChecker=t=>t.#Pt.contains(document.activeElement)&&"BUTTON"!==document.activeElement.tagName&&t.hasSomethingToControl(),textInputChecker=(t,{target:e})=>{if(e instanceof HTMLInputElement){const{type:t}=e;return"text"!==t&&"number"!==t}return!0},e=this.TRANSLATE_SMALL,i=this.TRANSLATE_BIG;return util_shadow(this,"_keyboardManager",new KeyboardManager([[["ctrl+a","mac+meta+a"],t.selectAll,{checker:textInputChecker}],[["ctrl+z","mac+meta+z"],t.undo,{checker:textInputChecker}],[["ctrl+y","ctrl+shift+z","mac+meta+shift+z","ctrl+shift+Z","mac+meta+shift+Z"],t.redo,{checker:textInputChecker}],[["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:textInputChecker}],[["Enter"],t.addNewEditorFromKeyboard,{checker:(t,{target:e})=>!(e instanceof HTMLButtonElement)&&t.#Pt.contains(e)&&!t.isEnterHandled}],[["Space"],t.addNewEditorFromKeyboard,{checker:(t,{target:e})=>!(e instanceof HTMLButtonElement)&&t.#Pt.contains(document.activeElement)}],[["Escape"],t.unselectAll],[["ArrowLeft"],t.translateSelectedEditors,{args:[-e,0],checker:arrowChecker}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t.translateSelectedEditors,{args:[-i,0],checker:arrowChecker}],[["ArrowRight"],t.translateSelectedEditors,{args:[e,0],checker:arrowChecker}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t.translateSelectedEditors,{args:[i,0],checker:arrowChecker}],[["ArrowUp"],t.translateSelectedEditors,{args:[0,-e],checker:arrowChecker}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t.translateSelectedEditors,{args:[0,-i],checker:arrowChecker}],[["ArrowDown"],t.translateSelectedEditors,{args:[0,e],checker:arrowChecker}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t.translateSelectedEditors,{args:[0,i],checker:arrowChecker}]]))}constructor(t,e,i,n,r,s,a,o,l,c,h,d,u,p,g,f){const m=this._signal=this.#L.signal;this.#Pt=t;this.#Mt=e;this.#It=i;this.#W=n;this.#X=r;this.#xt=s;this.#St=o;this._eventBus=a;const b={signal:m,...on};a.on("editingaction",this.onEditingAction.bind(this),b);a.on("pagechanging",this.onPageChanging.bind(this),b);a.on("scalechanging",this.onScaleChanging.bind(this),b);a.on("rotationchanging",this.onRotationChanging.bind(this),b);a.on("setpreference",this.onSetPreference.bind(this),b);a.on("switchannotationeditorparams",t=>this.updateParams(t.type,t.value),b);window.addEventListener("pointerdown",()=>{this.#pt=!0},{capture:!0,signal:m});window.addEventListener("pointerup",()=>{this.#pt=!1},{capture:!0,signal:m});window.addEventListener("beforeunload",this.endCurrentEditing.bind(this),{capture:!0,signal:m});this.#Ot();this.#Rt();this.#Bt();this.#V=o.annotationStorage;this.#st=o.filterFactory;this.#Et=l;this.#lt=c||null;this.#it=h;this.#nt=d;this.#rt=u;this.#wt=p||null;this.viewParameters={realScale:PixelsPerInch.PDF_TO_CSS_UNITS,rotation:0};this.isShiftKeyDown=!1;this._editorUndoBar=g||null;this._supportsPinchToZoom=!1!==f;r?.setSidebarUiManager(this)}destroy(){this.#Ft?.resolve();this.#Ft=null;this.#L?.abort();this.#L=null;this._signal=null;for(const t of this.#z.values())t.destroy();this.#z.clear();this.#H.clear();this.#et.clear();this.#yt?.clear();this.#N=null;this.#_t.clear();this.#q.destroy();this.#W?.destroy();this.#X?.destroy();this.#xt?.destroy();this.#ht?.hide();this.#ht=null;this.#bt?.destroy();this.#bt=null;this.#U=null;if(this.#at){clearTimeout(this.#at);this.#at=null}if(this.#Dt){clearTimeout(this.#Dt);this.#Dt=null}this._editorUndoBar?.destroy();this.#St=null}combinedSignal(t){return AbortSignal.any([this._signal,t.signal])}get mlManager(){return this.#wt}get useNewAltTextFlow(){return this.#nt}get useNewAltTextWhenAddingImage(){return this.#rt}get hcmFilter(){return util_shadow(this,"hcmFilter",this.#Et?this.#st.addHCMFilter(this.#Et.foreground,this.#Et.background):"none")}get direction(){return util_shadow(this,"direction",getComputedStyle(this.#Pt).direction)}get _highlightColors(){return util_shadow(this,"_highlightColors",this.#lt?new Map(this.#lt.split(",").map(t=>{(t=t.split("=").map(t=>t.trim()))[1]=t[1].toUpperCase();return t})):null)}get highlightColors(){const{_highlightColors:t}=this;if(!t)return util_shadow(this,"highlightColors",null);const e=new Map,i=!!this.#Et;for(const[n,r]of t){const t=n.endsWith("_HCM");i&&t?e.set(n.replace("_HCM",""),r):i||t||e.set(n,r)}return util_shadow(this,"highlightColors",e)}get highlightColorNames(){return util_shadow(this,"highlightColorNames",this.highlightColors?new Map(Array.from(this.highlightColors,t=>t.reverse())):null)}getNonHCMColor(t){if(!this._highlightColors)return t;const e=this.highlightColorNames.get(t);return this._highlightColors.get(e)||t}getNonHCMColorName(t){return this.highlightColorNames.get(t)||t}setCurrentDrawingSession(t){if(t){this.unselectAll();this.disableUserSelect(!0)}else this.disableUserSelect(!1);this.#Y=t}setMainHighlightColorPicker(t){this.#bt=t}editAltText(t,e=!1){this.#W?.editAltText(this,t,e)}hasCommentManager(){return!!this.#X}editComment(t,e,i,n){this.#X?.showDialog(this,t,e,i,n)}selectComment(t,e){const i=this.#z.get(t),n=i?.getEditorByUID(e);n?.toggleComment(!0,!0)}updateComment(t){this.#X?.updateComment(t.getData())}updatePopupColor(t){this.#X?.updatePopupColor(t)}removeComment(t){this.#X?.removeComments([t.uid])}deleteComment(t,e){const undo=()=>{t.comment=e};this.addCommands({cmd:()=>{this._editorUndoBar?.show(undo,"comment");this.toggleComment(null);t.comment=null},undo,mustExec:!0})}toggleComment(t,e,i=void 0){this.#X?.toggleCommentPopup(t,e,i)}makeCommentColor(t,e){return t&&this.#X?.makeCommentColor(t,e)||null}getCommentDialogElement(){return this.#X?.dialogElement||null}async waitForEditorsRendered(t){if(this.#z.has(t-1))return;const{resolve:e,promise:i}=Promise.withResolvers(),onEditorsRendered=i=>{if(i.pageNumber===t){this._eventBus.off("editorsrendered",onEditorsRendered);e()}};this._eventBus.on("editorsrendered",onEditorsRendered,on);await i}getSignature(t){this.#xt?.getSignature({uiManager:this,editor:t})}get signatureManager(){return this.#xt}switchToMode(t,e){this._eventBus.on("annotationeditormodechanged",e,{once:!0,signal:this._signal,...on});this._eventBus.dispatch("showannotationeditorui",{source:this,mode:t})}setPreference(t,e){this._eventBus.dispatch("setpreference",{source:this,name:t,value:e})}onSetPreference({name:t,value:e}){if("enableNewAltTextWhenAddingImage"===t)this.#rt=e}onPageChanging({pageNumber:t}){this.#J=t-1}deletePage(t){for(const e of this.getEditors(t))e.remove();this.#z.delete(t);this.#J===t&&(this.#J=0)}focusMainContainer(){this.#Pt.focus()}findParent(t,e){for(const i of this.#z.values()){const{x:n,y:r,width:s,height:a}=i.div.getBoundingClientRect();if(t>=n&&t<=n+s&&e>=r&&e<=r+a)return i}return null}disableUserSelect(t=!1){this.#Mt.classList.toggle("noUserSelect",t)}addShouldRescale(t){this.#et.add(t)}removeShouldRescale(t){this.#et.delete(t)}onScaleChanging({scale:t}){this.commitOrRemove();this.viewParameters.realScale=t*PixelsPerInch.PDF_TO_CSS_UNITS;for(const t of this.#et)t.onScaleChanging();this.#Y?.onScaleChanging()}onRotationChanging({pagesRotation:t}){this.commitOrRemove();this.viewParameters.rotation=t}#Lt({anchorNode:t}){return t.nodeType===Node.TEXT_NODE?t.parentElement:t}#Nt(t){const{currentLayer:e}=this;if(e.hasTextLayer(t))return e;for(const e of this.#z.values())if(e.hasTextLayer(t))return e;return null}highlightSelection(t="",e=!1){const i=document.getSelection();if(!i||i.isCollapsed)return;const{anchorNode:n,anchorOffset:r,focusNode:s,focusOffset:a}=i,o=i.toString(),l=this.#Lt(i).closest(".textLayer"),c=this.getSelectionBoxes(l);if(!c)return;i.empty();const h=this.#Nt(l),d=this.#vt===ki.NONE,callback=()=>{const i=h?.createAndAddNewEditor({x:0,y:0},!1,{methodOfCreation:t,boxes:c,anchorNode:n,anchorOffset:r,focusNode:s,focusOffset:a,text:o});d&&this.showAllEditors("highlight",!0,!0);e&&i?.editComment()};d?this.switchToMode(ki.HIGHLIGHT,callback):callback()}commentSelection(t=""){this.highlightSelection(t,!0)}endCurrentEditing(){this.commitOrRemove();this.currentLayer?.endDrawingSession(!1)}#Ut(){const t=document.getSelection();if(!t||t.isCollapsed)return;const e=this.#Lt(t).closest(".textLayer"),i=this.getSelectionBoxes(e);if(i){this.#ht||=new FloatingToolbar(this);this.#ht.show(e,i,"ltr"===this.direction)}}getAndRemoveDataFromAnnotationStorage(t){if(!this.#V)return null;const e=`${Ti}${t}`,i=this.#V.getRawValue(e);i&&this.#V.remove(e);return i}addToAnnotationStorage(t){t.isEmpty()||!this.#V||this.#V.has(t.id)||this.#V.setValue(t.id,t)}a11yAlert(t,e=null){const i=this.#It;if(i){i.setAttribute("data-l10n-id",t);e?i.setAttribute("data-l10n-args",JSON.stringify(e)):i.removeAttribute("data-l10n-args")}}#Ht(){const t=document.getSelection();if(!t||t.isCollapsed){if(this.#At){this.#ht?.hide();this.#At=null;this.#zt({hasSelectedText:!1})}return}const{anchorNode:e}=t;if(e===this.#At)return;const i=this.#Lt(t).closest(".textLayer");if(i){this.#ht?.hide();this.#At=e;this.#zt({hasSelectedText:!0});if(this.#vt===ki.HIGHLIGHT||this.#vt===ki.NONE){this.#vt===ki.HIGHLIGHT&&this.showAllEditors("highlight",!0,!0);this.#ct=this.isShiftKeyDown;if(!this.isShiftKeyDown){const t=this.#vt===ki.HIGHLIGHT?this.#Nt(i):null;t?.toggleDrawing();if(this.#pt){const e=new AbortController,i=this.combinedSignal(e),pointerup=i=>{if("pointerup"!==i.type||0===i.button){e.abort();t?.toggleDrawing(!0);"pointerup"===i.type&&this.#Gt("main_toolbar")}};window.addEventListener("pointerup",pointerup,{signal:i});window.addEventListener("blur",pointerup,{signal:i})}else{t?.toggleDrawing(!0);this.#Gt("main_toolbar")}}}}else if(this.#At){this.#ht?.hide();this.#At=null;this.#zt({hasSelectedText:!1})}}#Gt(t=""){this.#vt===ki.HIGHLIGHT?this.highlightSelection(t):this.#it&&this.#Ut()}#Ot(){document.addEventListener("selectionchange",this.#Ht.bind(this),{signal:this._signal})}#jt(){if(this.#ot)return;this.#ot=new AbortController;const t=this.combinedSignal(this.#ot);window.addEventListener("focus",this.focus.bind(this),{signal:t});window.addEventListener("blur",this.blur.bind(this),{signal:t})}#Wt(){this.#ot?.abort();this.#ot=null}blur(){this.isShiftKeyDown=!1;if(this.#ct){this.#ct=!1;this.#Gt("main_toolbar")}if(!this.hasSelection)return;const{activeElement:t}=document;for(const e of this.#_t)if(e.div.contains(t)){this.#mt=[e,t];e._focusEventsAllowed=!1;break}}focus(){if(!this.#mt)return;const[t,e]=this.#mt;this.#mt=null;e.addEventListener("focusin",()=>{t._focusEventsAllowed=!0},{once:!0,signal:this._signal});e.focus()}#Bt(){if(this.#ft)return;this.#ft=new AbortController;const t=this.combinedSignal(this.#ft);window.addEventListener("keydown",this.keydown.bind(this),{signal:t});window.addEventListener("keyup",this.keyup.bind(this),{signal:t})}#Vt(){this.#ft?.abort();this.#ft=null}#$t(){if(this.#K)return;this.#K=new AbortController;const t=this.combinedSignal(this.#K);document.addEventListener("copy",this.copy.bind(this),{signal:t});document.addEventListener("cut",this.cut.bind(this),{signal:t});document.addEventListener("paste",this.paste.bind(this),{signal:t})}#qt(){this.#K?.abort();this.#K=null}#Rt(){const t=this._signal;document.addEventListener("dragover",this.dragOver.bind(this),{signal:t});document.addEventListener("drop",this.drop.bind(this),{signal:t})}addEditListeners(){this.#Bt();this.setEditingState(!0)}removeEditListeners(){this.#Vt();this.setEditingState(!1)}dragOver(t){for(const{type:e}of t.dataTransfer.items)for(const i of this.#tt)if(i.isHandlingMimeForPasting(e)){t.dataTransfer.dropEffect="copy";t.preventDefault();return}}drop(t){for(const e of t.dataTransfer.items)for(const i of this.#tt)if(i.isHandlingMimeForPasting(e.type)){i.paste(e,this.currentLayer);t.preventDefault();return}}copy(t){t.preventDefault();this.#N?.commitOrRemove();if(!this.hasSelection)return;const e=[];for(const t of this.#_t){const i=t.serialize(!0);i&&e.push(i)}0!==e.length&&t.clipboardData.setData("application/pdfjs",JSON.stringify(e))}cut(t){this.copy(t);this.delete()}async paste(t){t.preventDefault();const{clipboardData:e}=t;for(const t of e.items)for(const e of this.#tt)if(e.isHandlingMimeForPasting(t.type)){e.paste(t,this.currentLayer);return}let i=e.getData("application/pdfjs");if(!i)return;try{i=JSON.parse(i)}catch(t){warn(`paste: "${t.message}".`);return}if(!Array.isArray(i))return;this.unselectAll();const n=this.currentLayer;try{const t=[];for(const e of i){const i=await n.deserialize(e);if(!i)return;t.push(i)}const cmd=()=>{for(const e of t)this.#Xt(e);this.#Kt(t)},undo=()=>{for(const e of t)e.remove()};this.addCommands({cmd,undo,mustExec:!0})}catch(t){warn(`paste: "${t.message}".`)}}keydown(t){this.isShiftKeyDown||"Shift"!==t.key||(this.isShiftKeyDown=!0);this.#vt===ki.NONE||this.isEditorHandlingKeyboard||AnnotationEditorUIManager._keyboardManager.exec(this,t)}keyup(t){if(this.isShiftKeyDown&&"Shift"===t.key){this.isShiftKeyDown=!1;if(this.#ct){this.#ct=!1;this.#Gt("main_toolbar")}}}onEditingAction({name:t}){switch(t){case"undo":case"redo":case"delete":case"selectAll":this[t]();break;case"highlightSelection":this.highlightSelection("context_menu");break;case"commentSelection":this.commentSelection("context_menu")}}updatePageIndex(t,e){for(const i of this.#j.get(t)||[])i.pageIndex=e;const i=this.#G.get(t);if(i){i.pageIndex=e;this.#z.set(e,i);this.#ut?i.enable():i.disable()}}startUpdatePages(){this.#G=new Map(this.#z);this.#z.clear();const t=this.#j=new Map,saveEditor=e=>{t.getOrInsertComputed(e.pageIndex,makeArr).push(e)};for(const t of this.#H.values())saveEditor(t);for(const[t,e]of this.#V)t.startsWith(Ti)&&!this.#H.has(t)&&Number.isInteger(e?.pageIndex)&&saveEditor(e)}endUpdatePages(){this.#G=null;this.#j=null}clonePage(t,e){for(const i of this.getEditors(t)){const t=i.serialize(i.mode!==ki.HIGHLIGHT);if(t){t.pageIndex=e;t.id=this.getId();t.isClone=!0;delete t.popupRef;this.#V.setValue(t.id,t)}}}findClonesForPage(t){const e=[],{pageIndex:i}=t;for(const[n,r]of this.#V)if(r.pageIndex===i&&r.isClone){this.#V.remove(n);e.push(t.deserialize(r).then(e=>{if(e){e.isClone=!0;t.addOrRebuild(e)}}))}return Promise.all(e)}#zt(t){if(Object.entries(t).some(([t,e])=>this.#Tt[t]!==e)){this._eventBus.dispatch("editingstateschanged",{source:this,details:Object.assign(this.#Tt,t)});this.#vt===ki.HIGHLIGHT&&!1===t.hasSelectedEditor&&this.#Yt([[Di.HIGHLIGHT_FREE,!0]])}}#Yt(t){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:t})}setEditingState(t){if(t){this.#jt();this.#$t();this.#zt({isEditing:this.#vt!==ki.NONE,isEmpty:this.#Jt(),hasSomethingToUndo:this.#q.hasSomethingToUndo(),hasSomethingToRedo:this.#q.hasSomethingToRedo(),hasSelectedEditor:!1})}else{this.#Wt();this.#qt();this.#zt({isEditing:!1});this.disableUserSelect(!1)}}registerEditorTypes(t){if(!this.#tt){this.#tt=t;for(const t of this.#tt)this.#Yt(t.defaultPropertiesToUpdate)}}getId(){return this.#dt.id}get currentLayer(){return this.#z.get(this.#J)}getLayer(t){return this.#z.get(t)}get currentPageIndex(){return this.#J}addLayer(t){this.#z.set(t.pageIndex,t);this.#ut?t.enable():t.disable()}removeLayer(t){this.#z.delete(t.pageIndex)}async updateMode(t,e=null,i=!1,n=!1,r=!1,s=!1){if(this.#vt!==t){if(this.#Ft){await this.#Ft.promise;if(!this.#Ft)return}this.#Ft=Promise.withResolvers();this.#Y?.commitOrRemove();this.#vt===ki.POPUP&&this.#X?.hideSidebar();this.#X?.destroyPopup();this.#vt=t;if(t!==ki.NONE){for(const t of this.#H.values())t.addStandaloneCommentButton();t===ki.SIGNATURE&&await(this.#xt?.loadSignatures());i&&CurrentPointers.clearPointerType();this.setEditingState(!0);await this.#Qt();this.unselectAll();for(const e of this.#z.values())e.updateMode(t);if(t===ki.POPUP){this.#U||=await this.#St.getAnnotationsByType(new Set(this.#tt.map(t=>t._editorType)));const t=new Set,e=[];for(const i of this.#H.values()){const{annotationElementId:n,hasComment:r,deleted:s}=i;n&&t.add(n);r&&!s&&e.push(i.getData())}for(const i of this.#U){const{id:n,popupRef:r,contentsObj:s}=i;r&&s?.str&&!t.has(n)&&!this.#Q.has(n)&&e.push(i)}this.#X?.showSidebar(e)}if(e){for(const t of this.#H.values())if(t.uid===e){this.setSelected(t);s?t.editComment():r?t.enterInEditMode():t.focus()}else t.unselect();this.#Ft.resolve()}else{n&&this.addNewEditorFromKeyboard();this.#Ft.resolve()}}else{this.setEditingState(!1);this.#Zt();for(const t of this.#H.values())t.hideStandaloneCommentButton();this._editorUndoBar?.hide();this.toggleComment(null);this.#Ft.resolve()}}}addNewEditorFromKeyboard(){this.currentLayer.canCreateNewEmptyEditor()&&this.currentLayer.addNewEditor()}updateToolbar(t){t.mode!==this.#vt&&this._eventBus.dispatch("switchannotationeditormode",{source:this,...t})}updateParams(t,e){if(this.#tt){switch(t){case Di.CREATE:this.currentLayer.addNewEditor(e);return;case Di.HIGHLIGHT_SHOW_ALL:this._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:{type:"highlight",action:"toggle_visibility"}}});(this.#Ct||=new Map).set(t,e);this.showAllEditors("highlight",e)}if(this.hasSelection)for(const i of this.#_t)i.updateParams(t,e);else for(const i of this.#tt)i.updateDefaultParams(t,e)}}showAllEditors(t,e,i=!1){for(const i of this.#H.values())i.editorType===t&&i.show(e);(this.#Ct?.get(Di.HIGHLIGHT_SHOW_ALL)??!0)!==e&&this.#Yt([[Di.HIGHLIGHT_SHOW_ALL,e]])}enableWaiting(t=!1){if(this.#gt!==t){this.#gt=t;for(const e of this.#z.values()){t?e.disableClick():e.enableClick();e.div.classList.toggle("waiting",t)}}}async#Qt(){if(!this.#ut){this.#ut=!0;const t=[];for(const e of this.#z.values())t.push(e.enable());await Promise.all(t);for(const t of this.#H.values())t.enable()}}#Zt(){this.unselectAll();if(this.#ut){this.#ut=!1;for(const t of this.#z.values())t.disable();for(const t of this.#H.values())t.disable()}}*getEditors(t){for(const e of this.#H.values())e.pageIndex===t&&(yield e)}getEditor(t){return this.#H.get(t)}addEditor(t){this.#H.set(t.id,t)}removeEditor(t){if(t.div.contains(document.activeElement)){this.#at&&clearTimeout(this.#at);this.#at=setTimeout(()=>{this.focusMainContainer();this.#at=null},0)}this.#H.delete(t.id);t.annotationElementId&&this.#yt?.delete(t.annotationElementId);this.unselect(t);t.annotationElementId&&this.#Q.has(t.annotationElementId)||this.#V?.remove(t.id)}addDeletedAnnotationElement(t){this.#Q.add(t.annotationElementId);this.addChangedExistingAnnotation(t);t.deleted=!0}isDeletedAnnotationElement(t){return this.#Q.has(t)}removeDeletedAnnotationElement(t){this.#Q.delete(t.annotationElementId);this.removeChangedExistingAnnotation(t);t.deleted=!1}#Xt(t){const e=this.#z.get(t.pageIndex);if(e)e.addOrRebuild(t);else{this.addEditor(t);this.addToAnnotationStorage(t)}}setActiveEditor(t){if(this.#N!==t){this.#N=t;t&&this.#Yt(t.propertiesToUpdate)}}get#te(){let t=null;for(t of this.#_t);return t}updateUI(t){this.#te===t&&this.#Yt(t.propertiesToUpdate)}updateUIForDefaultProperties(t){this.#Yt(t.defaultPropertiesToUpdate)}toggleSelected(t){if(this.#_t.has(t)){this.#_t.delete(t);t.unselect();this.#zt({hasSelectedEditor:this.hasSelection})}else{this.#_t.add(t);t.select();this.#Yt(t.propertiesToUpdate);this.#zt({hasSelectedEditor:!0})}}setSelected(t){this.updateToolbar({mode:t.mode,editId:t.uid});this.#Y?.commitOrRemove();for(const e of this.#_t)e!==t&&e.unselect();this.#X?.destroyPopup();this.#_t.clear();this.#_t.add(t);t.select();this.#Yt(t.propertiesToUpdate);this.#zt({hasSelectedEditor:!0})}get firstSelectedEditor(){return this.#_t.values().next().value}unselect(t){t.unselect();this.#_t.delete(t);this.#zt({hasSelectedEditor:this.hasSelection})}get hasSelection(){return 0!==this.#_t.size}get isEnterHandled(){return 1===this.#_t.size&&this.firstSelectedEditor.isEnterHandled}undo(){this.#q.undo();this.#zt({hasSomethingToUndo:this.#q.hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:this.#Jt()});this._editorUndoBar?.hide()}redo(){this.#q.redo();this.#zt({hasSomethingToUndo:!0,hasSomethingToRedo:this.#q.hasSomethingToRedo(),isEmpty:this.#Jt()})}addCommands(t){this.#q.add(t);this.#zt({hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:this.#Jt()})}cleanUndoStack(t){this.#q.cleanType(t)}#Jt(){if(0===this.#H.size)return!0;if(1===this.#H.size)for(const t of this.#H.values())return t.isEmpty();return!1}delete(){this.commitOrRemove();const t=this.currentLayer?.endDrawingSession(!0);if(!this.hasSelection&&!t)return;const e=t?[t]:[...this.#_t],undo=()=>{for(const t of e)this.#Xt(t)};this.addCommands({cmd:()=>{this._editorUndoBar?.show(undo,1===e.length?e[0].editorType:e.length);for(const t of e)t.remove()},undo,mustExec:!0})}commitOrRemove(){this.#N?.commitOrRemove()}hasSomethingToControl(){return this.#N||this.hasSelection}#Kt(t){for(const t of this.#_t)t.unselect();this.#_t.clear();for(const e of t)if(!e.isEmpty()){this.#_t.add(e);e.select()}this.#zt({hasSelectedEditor:this.hasSelection})}selectAll(){for(const t of this.#_t)t.commit();this.#Kt(this.#H.values())}unselectAll(){if(this.#N){this.#N.commitOrRemove();if(this.#vt!==ki.NONE)return}if(!this.#Y?.commitOrRemove()){this.#X?.destroyPopup();if(this.hasSelection){for(const t of this.#_t)t.unselect();this.#_t.clear();this.#zt({hasSelectedEditor:!1})}}}translateSelectedEditors(t,e,i=!1){i||this.commitOrRemove();if(!this.hasSelection)return;this.#kt[0]+=t;this.#kt[1]+=e;const[n,r]=this.#kt,s=[...this.#_t];this.#Dt&&clearTimeout(this.#Dt);this.#Dt=setTimeout(()=>{this.#Dt=null;this.#kt[0]=this.#kt[1]=0;this.addCommands({cmd:()=>{for(const t of s)if(this.#H.has(t.id)){t.translateInPage(n,r);t.translationDone()}},undo:()=>{for(const t of s)if(this.#H.has(t.id)){t.translateInPage(-n,-r);t.translationDone()}},mustExec:!1})},1e3);for(const i of s){i.translateInPage(t,e);i.translationDone()}}setUpDragSession(){if(this.hasSelection){this.disableUserSelect(!0);this.#Z=new Map;for(const t of this.#_t)this.#Z.set(t,{savedX:t.x,savedY:t.y,savedPageIndex:t.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!this.#Z)return!1;this.disableUserSelect(!1);const t=this.#Z;this.#Z=null;let e=!1;for(const[{x:i,y:n,pageIndex:r},s]of t){s.newX=i;s.newY=n;s.newPageIndex=r;e||=i!==s.savedX||n!==s.savedY||r!==s.savedPageIndex}if(!e)return!1;const move=(t,e,i,n)=>{if(this.#H.has(t.id)){const r=this.#z.get(n);if(r)t._setParentAndPosition(r,e,i);else{t.pageIndex=n;t.x=e;t.y=i}}};this.addCommands({cmd:()=>{for(const[e,{newX:i,newY:n,newPageIndex:r}]of t)move(e,i,n,r)},undo:()=>{for(const[e,{savedX:i,savedY:n,savedPageIndex:r}]of t)move(e,i,n,r)},mustExec:!0});return!0}dragSelectedEditors(t,e){if(this.#Z)for(const i of this.#Z.keys())i.drag(t,e)}rebuild(t){if(null===t.parent){const e=this.getLayer(t.pageIndex);if(e){e.changeParent(t);e.addOrRebuild(t)}else{this.addEditor(t);this.addToAnnotationStorage(t);t.rebuild()}}else t.parent.addOrRebuild(t)}get isEditorHandlingKeyboard(){return this.getActive()?.shouldGetKeyboardEvents()||1===this.#_t.size&&this.firstSelectedEditor.shouldGetKeyboardEvents()}isActive(t){return this.#N===t}getActive(){return this.#N}getMode(){return this.#vt}isEditingMode(){return this.#vt!==ki.NONE}get imageManager(){return util_shadow(this,"imageManager",new ImageManager)}getSelectionBoxes(t){if(!t)return null;const e=document.getSelection();for(let i=0,n=e.rangeCount;i({x:(e-n)/s,y:1-(t+a-i)/r,width:o/s,height:a/r});break;case"180":a=(t,e,a,o)=>({x:1-(t+a-i)/r,y:1-(e+o-n)/s,width:a/r,height:o/s});break;case"270":a=(t,e,a,o)=>({x:1-(e+o-n)/s,y:(t-i)/r,width:o/s,height:a/r});break;default:a=(t,e,a,o)=>({x:(t-i)/r,y:(e-n)/s,width:a/r,height:o/s})}const o=[];for(let t=0,i=e.rangeCount;tt.stopPropagation(),{signal:i});const onClick=t=>{t.preventDefault();this.#o._uiManager.editAltText(this.#o);this.#he&&this.#o._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_clicked",data:{label:this.#ue}})};t.addEventListener("click",onClick,{capture:!0,signal:i});t.addEventListener("keydown",e=>{if(e.target===t&&"Enter"===e.key){this.#ae=!0;onClick(e)}},{signal:i});await this.#pe();return t}get#ue(){return(this.#c?"added":null===this.#c&&this.guessedText&&"review")||"missing"}finish(){if(this.#ie){this.#ie.focus({focusVisible:this.#ae});this.#ae=!1}}isEmpty(){return this.#he?null===this.#c:!this.#c&&!this.#ee}hasData(){return this.#he?null!==this.#c||!!this.#le:this.isEmpty()}get guessedText(){return this.#le}async setGuessedText(t){if(null===this.#c){this.#le=t;this.#ce=await AltText._l10n.get("pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer",{generatedAltText:t});this.#pe()}}toggleAltTextBadge(t=!1){if(this.#he&&!this.#c){if(!this.#oe){const t=this.#oe=document.createElement("div");t.className="noAltTextBadge";this.#o.div.append(t)}this.#oe.classList.toggle("hidden",!t)}else{this.#oe?.remove();this.#oe=null}}serialize(t){let e=this.#c;t||this.#le!==e||(e=this.#ce);return{altText:e,decorative:this.#ee,guessedText:this.#le,textWithDisclaimer:this.#ce}}get data(){return{altText:this.#c,decorative:this.#ee}}set data({altText:t,decorative:e,guessedText:i,textWithDisclaimer:n,cancel:r=!1}){if(i){this.#le=i;this.#ce=n}if(this.#c!==t||this.#ee!==e){if(!r){this.#c=t;this.#ee=e}this.#pe()}}toggle(t=!1){if(this.#ie){if(!t&&this.#se){clearTimeout(this.#se);this.#se=null}this.#ie.disabled=!t}}shown(){this.#o._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_displayed",data:{label:this.#ue}})}destroy(){this.#ie?.remove();this.#ie=null;this.#ne=null;this.#re=null;this.#oe?.remove();this.#oe=null}async#pe(){const t=this.#ie;if(!t)return;if(this.#he){t.classList.toggle("done",!!this.#c);t.setAttribute("data-l10n-id",AltText.#de[this.#ue]);this.#ne?.setAttribute("data-l10n-id",AltText.#de[`${this.#ue}-label`]);if(!this.#c){this.#re?.remove();return}}else{if(!this.#c&&!this.#ee){t.classList.remove("done");this.#re?.remove();return}t.classList.add("done");t.setAttribute("data-l10n-id","pdfjs-editor-alt-text-edit-button")}let e=this.#re;if(!e){this.#re=e=document.createElement("span");e.className="tooltip";e.setAttribute("role","tooltip");e.id=`alt-text-tooltip-${this.#o.id}`;const i=100,n=this.#o._uiManager._signal;n.addEventListener("abort",()=>{clearTimeout(this.#se);this.#se=null},{once:!0});t.addEventListener("mouseenter",()=>{this.#se=setTimeout(()=>{this.#se=null;this.#re.classList.add("show");this.#o._reportTelemetry({action:"alt_text_tooltip"})},i)},{signal:n});t.addEventListener("mouseleave",()=>{if(this.#se){clearTimeout(this.#se);this.#se=null}this.#re?.classList.remove("show")},{signal:n})}if(this.#ee)e.setAttribute("data-l10n-id","pdfjs-editor-alt-text-decorative-tooltip");else{e.removeAttribute("data-l10n-id");e.textContent=this.#c}e.parentNode||t.append(e);const i=this.#o.getElementForAltText();i?.setAttribute("aria-describedby",e.id)}}class Comment{#ge=null;#fe=null;#me=!1;#o=null;#be=null;#ye=null;#we=null;#ve=null;#_e=!1;#Ae=null;constructor(t){this.#o=t}renderForToolbar(){const t=this.#fe=document.createElement("button");t.className="comment";return this.#v(t,!1)}renderForStandalone(){const t=this.#ge=document.createElement("button");t.className="annotationCommentButton";const e=this.#o.commentButtonPosition;if(e){const{style:i}=t;i.insetInlineEnd=`calc(${100*("ltr"===this.#o._uiManager.direction?1-e[0]:e[0])}% - var(--comment-button-dim))`;i.top=`calc(${100*e[1]}% - var(--comment-button-dim))`;const n=this.#o.commentButtonColor;n&&(i.backgroundColor=n)}return this.#v(t,!0)}focusButton(){setTimeout(()=>{(this.#ge??this.#fe)?.focus()},0)}onUpdatedColor(){if(!this.#ge)return;const t=this.#o.commentButtonColor;t&&(this.#ge.style.backgroundColor=t);this.#o._uiManager.updatePopupColor(this.#o)}get commentButtonWidth(){return(this.#ge?.getBoundingClientRect().width??0)/this.#o.parent.boundingClientRect.width}get commentPopupPositionInLayer(){if(this.#Ae)return this.#Ae;if(!this.#ge)return null;const{x:t,y:e,height:i}=this.#ge.getBoundingClientRect(),{x:n,y:r,width:s,height:a}=this.#o.parent.boundingClientRect;return[(t-n)/s,(e+i-r)/a]}set commentPopupPositionInLayer(t){this.#Ae=t}hasDefaultPopupPosition(){return null===this.#Ae}removeStandaloneCommentButton(){this.#ge?.remove();this.#ge=null}removeToolbarCommentButton(){this.#fe?.remove();this.#fe=null}setCommentButtonStates({selected:t,hasPopup:e}){if(this.#ge){this.#ge.classList.toggle("selected",t);this.#ge.ariaExpanded=e}}#v(t,e){if(!this.#o._uiManager.hasCommentManager())return null;t.tabIndex="0";t.ariaHasPopup="dialog";if(e){t.ariaControls="commentPopup";t.setAttribute("data-l10n-id","pdfjs-show-comment-button")}else{t.ariaControlsElements=[this.#o._uiManager.getCommentDialogElement()];t.setAttribute("data-l10n-id","pdfjs-editor-add-comment-button")}const i=this.#o._uiManager._signal;if(!(i instanceof AbortSignal)||i.aborted)return t;t.addEventListener("contextmenu",noContextMenu,{signal:i});if(e){t.addEventListener("focusin",t=>{this.#o._focusEventsAllowed=!1;stopEvent(t)},{capture:!0,signal:i});t.addEventListener("focusout",t=>{this.#o._focusEventsAllowed=!0;stopEvent(t)},{capture:!0,signal:i})}t.addEventListener("pointerdown",t=>t.stopPropagation(),{signal:i});const onClick=e=>{e.preventDefault();t===this.#fe?this.edit():this.#o.toggleComment(!0)};t.addEventListener("click",onClick,{capture:!0,signal:i});t.addEventListener("keydown",e=>{if(e.target===t&&"Enter"===e.key){this.#me=!0;onClick(e)}},{signal:i});t.addEventListener("pointerenter",()=>{this.#o.toggleComment(!1,!0)},{signal:i});t.addEventListener("pointerleave",()=>{this.#o.toggleComment(!1,!1)},{signal:i});return t}edit(t){const e=this.commentPopupPositionInLayer;let i,n;if(e)[i,n]=e;else{[i,n]=this.#o.commentButtonPosition;const{width:t,height:e,x:r,y:s}=this.#o;i=r+i*t;n=s+n*e}const r=this.#o.parent.boundingClientRect,{x:s,y:a,width:o,height:l}=r;this.#o._uiManager.editComment(this.#o,s+i*o,a+n*l,{...t,parentDimensions:r})}finish(){if(this.#fe){this.#fe.focus({focusVisible:this.#me});this.#me=!1}}isDeleted(){return this.#_e||""===this.#we}isEmpty(){return null===this.#we}hasBeenEdited(){return this.isDeleted()||this.#we!==this.#be}serialize(){return this.data}get data(){return{text:this.#we,richText:this.#ye,date:this.#ve,deleted:this.isDeleted()}}set data(t){t!==this.#we&&(this.#ye=null);if(null!==t){this.#we=t;this.#ve=new Date;this.#_e=!1}else{this.#we="";this.#_e=!0}}restoreData({text:t,richText:e,date:i}){this.#we=t;this.#ye=e;this.#ve=i;this.#_e=!1}setInitialText(t,e=null){this.#be=t;this.data=t;this.#ve=null;this.#ye=e}shown(){}destroy(){this.#fe?.remove();this.#fe=null;this.#ge?.remove();this.#ge=null;this.#we="";this.#ye=null;this.#ve=null;this.#o=null;this.#me=!1;this.#_e=!1}}function preventDefault(t){t.preventDefault()}const ln=1e-4;function stopTouchEvent(t){if(t.cancelable){stopEvent(t);return!0}t.stopPropagation();return!1}class TouchManager{#Pt;#xe=!1;#Ee=null;#Ce;#Se;#Te;#ke;#De;#Pe=!1;#Me=null;#Ie;#Fe=new Set;#Oe=null;#Re;#Be=null;#Le=0;constructor({container:t,isPinchingDisabled:e=null,isPinchingStopped:i=null,onPinchStart:n=null,onPinching:r=null,onPinchEnd:s=null,onPanning:a=null,signal:o}){this.#Pt=t;this.#Ee=i;this.#Ce=e;this.#Se=n;this.#Te=r;this.#ke=s;this.#De=a;this.#Re=new AbortController;this.#Ie=AbortSignal.any([o,this.#Re.signal]);t.addEventListener("touchstart",this.#Ne.bind(this),{passive:!1,signal:this.#Ie})}get MIN_TOUCH_DISTANCE_TO_PINCH(){return 35/OutputScale.pixelRatio}get MIN_TOUCH_DISTANCE_TO_SCALE(){return 4/OutputScale.pixelRatio}#Ne(t){if(this.#Ce?.())return;this.#Ue(t);const e=this.#Fe;for(const{identifier:i}of t.changedTouches)e.add(i);if(1!==e.size){if(!this.#Be){this.#Be=new AbortController;const t=AbortSignal.any([this.#Ie,this.#Be.signal]),e=this.#Pt,i={signal:t,capture:!1,passive:!1};e.addEventListener("touchmove",this.#He.bind(this),i);const n=this.#ze.bind(this);e.addEventListener("touchend",n,i);e.addEventListener("touchcancel",n,i);i.capture=!0;e.addEventListener("pointerdown",stopEvent,i);e.addEventListener("pointermove",stopEvent,i);e.addEventListener("pointercancel",preventDefault,i);e.addEventListener("pointerup",preventDefault,i);this.#Se?.()}this.#Pe=stopTouchEvent(t);this.#Ge(t)}else this.#je()}#je(){if(this.#Me)return;const t=this.#Me=new AbortController,e=AbortSignal.any([this.#Ie,t.signal]),i=this.#Pt,n={capture:!0,signal:e,passive:!1},cancelPointerDown=t=>{if("touch"===t.pointerType){this.#Me?.abort();this.#Me=null}};i.addEventListener("pointerdown",t=>{if("touch"===t.pointerType){stopEvent(t);cancelPointerDown(t)}},n);i.addEventListener("pointerup",cancelPointerDown,n);i.addEventListener("pointercancel",cancelPointerDown,n)}#Ue(t){const e=this.#Fe;if(0===e.size)return;const i=this.#Fe=new Set;for(const{identifier:n}of t.touches)e.has(n)&&i.add(n)}#We(t){const e=this.#Fe,i=[];for(const n of t.touches)e.has(n.identifier)&&i.push(n);return i}#Ge(t){const e=this.#We(t);if(2!==e.length||this.#Ee?.()){this.#Oe=null;return}const[i,n]=e;this.#Oe={touch0X:i.screenX,touch0Y:i.screenY,touch1X:n.screenX,touch1Y:n.screenY,panX:(i.clientX+n.clientX)/2,panY:(i.clientY+n.clientY)/2,screenPanX:(i.screenX+n.screenX)/2,screenPanY:(i.screenY+n.screenY)/2}}#He(t){if(!this.#Oe)return;const e=this.#We(t);if(2!==e.length)return;const i=this.#Pe;this.#Pe=stopTouchEvent(t);if(!this.#Pe)return;if(!i){this.#Ge(t);return}const[n,r]=e,{screenX:s,screenY:a}=n,{screenX:o,screenY:l}=r,c=this.#Oe,{touch0X:h,touch0Y:d,touch1X:u,touch1Y:p,panX:g,panY:f}=c,m=u-h,b=p-d,y=o-s,w=l-a,v=(n.clientX+r.clientX)/2,_=(n.clientY+r.clientY)/2;c.panX=v;c.panY=_;const A=v-g,x=_-f,E=(s+o)/2,C=(a+l)/2,S=Math.hypot(E-c.screenPanX,C-c.screenPanY);c.screenPanX=E;c.screenPanY=C;const T=Math.hypot(y,w),k=Math.hypot(m,b),D=this.#xe?this.MIN_TOUCH_DISTANCE_TO_SCALE:this.MIN_TOUCH_DISTANCE_TO_PINCH+2*S;if(T=2){this.#Ge(t);return}const e=!!this.#Oe;this.#Ve();1===this.#Fe.size&&this.#je();e&&stopTouchEvent(t)}#Ve(){this.#Oe=null;this.#xe=!1;this.#Le=0;this.#Pe=!1;if(this.#Be){this.#Be.abort();this.#Be=null;this.#ke?.()}}destroy(){this.#Ve();this.#Fe.clear();this.#Re?.abort();this.#Re=null;this.#Me?.abort();this.#Me=null}}class AnnotationEditor{#$e=null;#qe=null;#c=null;#h=null;#ge=null;#Xe=!1;#Ke=null;#Ye="";#Je=null;#Qe=null;#Ze=null;#ti=null;#ei=null;#ii="";#ni=!1;#ri=null;#si=!1;#ai=!1;#oi=!1;#li=null;#ci=0;#hi=0;#di=null;#ui=null;isSelected=!1;_isCopy=!1;_editToolbar=null;_initialOptions=Object.create(null);_initialData=null;_isVisible=!0;_uiManager=null;_focusEventsAllowed=!0;static _l10n=null;static _l10nAlert=null;static _l10nResizer=null;#pi=!1;#gi=AnnotationEditor._zIndex++;static _borderLineWidth=-1;static _colorManager=new ColorManager;static _zIndex=1;static _telemetryTimeout=1e3;static get _resizerKeyboardManager(){const t=AnnotationEditor.prototype._resizeWithKeyboard,e=AnnotationEditorUIManager.TRANSLATE_SMALL,i=AnnotationEditorUIManager.TRANSLATE_BIG;return util_shadow(this,"_resizerKeyboardManager",new KeyboardManager([[["ArrowLeft"],t,{args:[-e,0]}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t,{args:[-i,0]}],[["ArrowRight"],t,{args:[e,0]}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t,{args:[i,0]}],[["ArrowUp"],t,{args:[0,-e]}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t,{args:[0,-i]}],[["ArrowDown"],t,{args:[0,e]}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t,{args:[0,i]}],[["Escape"],AnnotationEditor.prototype._stopResizingWithKeyboard]]))}constructor(t){this.parent=t.parent;this.id=t.id;this.width=this.height=null;this.pageIndex=t.parent.pageIndex;this.name=t.name;this.div=null;this._uiManager=t.uiManager;this.annotationElementId=null;this._willKeepAspectRatio=!1;this._initialOptions.isCentered=t.isCentered;this._structTreeParentId=null;this.annotationElementId=t.annotationElementId||null;this.creationDate=t.creationDate||new Date;this.modificationDate=t.modificationDate||null;this.canAddComment=!0;const{rotation:e,rawDims:{pageWidth:i,pageHeight:n,pageX:r,pageY:s}}=this.parent.viewport;this.rotation=e;this.pageRotation=(360+e-this._uiManager.viewParameters.rotation)%360;this.pageDimensions=[i,n];this.pageTranslation=[r,s];const[a,o]=this.parentDimensions;this.x=t.x/a;this.y=t.y/o;this.isAttachedToDOM=!1;this.deleted=!1}updatePageIndex(t){this.pageIndex=t}get editorType(){return Object.getPrototypeOf(this).constructor._type}get mode(){return Object.getPrototypeOf(this).constructor._editorType}static get isDrawer(){return!1}static get _defaultLineColor(){return util_shadow(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(t){const e=new FakeEditor({id:t._uiManager.getId(),parent:t.parent,uiManager:t._uiManager});e.annotationElementId=t.annotationElementId;e.deleted=!0;e._uiManager.addToAnnotationStorage(e)}static initialize(t,e){AnnotationEditor._l10n??=t;AnnotationEditor._l10nAlert??=Object.freeze({highlight:"pdfjs-editor-highlight-added-alert",freetext:"pdfjs-editor-freetext-added-alert",ink:"pdfjs-editor-ink-added-alert",stamp:"pdfjs-editor-stamp-added-alert",signature:"pdfjs-editor-signature-added-alert"});AnnotationEditor._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"});if(-1!==AnnotationEditor._borderLineWidth)return;const i=getComputedStyle(document.documentElement);AnnotationEditor._borderLineWidth=parseFloat(i.getPropertyValue("--outline-width"))||0}static updateDefaultParams(t,e){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(t){return!1}static paste(t,e){unreachable("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return this.#pi}set _isDraggable(t){this.#pi=t;this.div?.classList.toggle("draggable",t)}get uid(){return this.annotationElementId||this.id}get isEnterHandled(){return!0}center(){const[t,e]=this.pageDimensions;switch(this.parentRotation){case 90:this.x-=this.height*e/(2*t);this.y+=this.width*t/(2*e);break;case 180:this.x+=this.width/2;this.y+=this.height/2;break;case 270:this.x+=this.height*e/(2*t);this.y-=this.width*t/(2*e);break;default:this.x-=this.width/2;this.y-=this.height/2}this.fixAndSetPosition()}addCommands(t){this._uiManager.addCommands(t)}get currentLayer(){return this._uiManager.currentLayer}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=this.#gi}setParent(t){if(null!==t){this.pageIndex=t.pageIndex;this.pageDimensions=t.pageDimensions}else{this.#fi();this.#ti?.remove();this.#ti=null}this.parent=t}focusin(t){this._focusEventsAllowed&&(this.#ni?this.#ni=!1:this.parent.setSelected(this))}focusout(t){if(!this._focusEventsAllowed||!this.isAttachedToDOM)return;const e=t.relatedTarget;if(!e?.closest(`#${this.id}`)){t.preventDefault();this.parent?.isMultipleSelection||this.commitOrRemove()}}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.isInEditMode()&&this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}setAt(t,e,i,n){const[r,s]=this.parentDimensions;[i,n]=this.screenToPageTranslation(i,n);this.x=(t+i)/r;this.y=(e+n)/s;this.fixAndSetPosition()}_moveAfterPaste(t,e){if(this.isClone){delete this.isClone;return}const[i,n]=this.parentDimensions;this.setAt(t*i,e*n,this.width*i,this.height*n);this._onTranslated()}#mi([t,e],i,n){[i,n]=this.screenToPageTranslation(i,n);this.x+=i/t;this.y+=n/e;this._onTranslating(this.x,this.y);this.fixAndSetPosition()}translate(t,e){this.#mi(this.parentDimensions,t,e)}translateInPage(t,e){this.#ri||=[this.x,this.y,this.width,this.height];this.#mi(this.pageDimensions,t,e);this.div.scrollIntoView({block:"nearest"})}translationDone(){this._onTranslated(this.x,this.y)}drag(t,e){this.#ri||=[this.x,this.y,this.width,this.height];const{div:i,parentDimensions:[n,r]}=this;this.x+=t/n;this.y+=e/r;if(this.parent&&(this.x<0||this.x>1||this.y<0||this.y>1)){const{x:t,y:e}=this.div.getBoundingClientRect();if(this.parent.findNewParent(this,t,e)){this.x-=Math.floor(this.x);this.y-=Math.floor(this.y)}}let{x:s,y:a}=this;const[o,l]=this.getBaseTranslation();s+=o;a+=l;const{style:c}=i;c.left=`${(100*s).toFixed(2)}%`;c.top=`${(100*a).toFixed(2)}%`;this._onTranslating(s,a)}_onTranslating(t,e){}_onTranslated(t,e){}get _hasBeenMoved(){return!!this.#ri&&(this.#ri[0]!==this.x||this.#ri[1]!==this.y)}get _hasBeenResized(){return!!this.#ri&&(this.#ri[2]!==this.width||this.#ri[3]!==this.height)}getBaseTranslation(){const[t,e]=this.parentDimensions,{_borderLineWidth:i}=AnnotationEditor,n=i/t,r=i/e;switch(this.rotation){case 90:return[-n,r];case 180:return[n,r];case 270:return[n,-r];default:return[-n,-r]}}get _mustFixPosition(){return!0}fixAndSetPosition(t=this.rotation){const{div:{style:e},pageDimensions:[i,n]}=this;let{x:r,y:s,width:a,height:o}=this;a*=i;o*=n;r*=i;s*=n;if(this._mustFixPosition)switch(t){case 0:r=MathClamp(r,0,i-a);s=MathClamp(s,0,n-o);break;case 90:r=MathClamp(r,0,i-o);s=MathClamp(s,a,n);break;case 180:r=MathClamp(r,a,i);s=MathClamp(s,o,n);break;case 270:r=MathClamp(r,o,i);s=MathClamp(s,0,n-a)}this.x=r/=i;this.y=s/=n;const[l,c]=this.getBaseTranslation();r+=l;s+=c;e.left=`${(100*r).toFixed(2)}%`;e.top=`${(100*s).toFixed(2)}%`;this.moveInDOM()}static#bi(t,e,i){switch(i){case 90:return[e,-t];case 180:return[-t,-e];case 270:return[-e,t];default:return[t,e]}}screenToPageTranslation(t,e){return AnnotationEditor.#bi(t,e,this.parentRotation)}pageTranslationToScreen(t,e){return AnnotationEditor.#bi(t,e,360-this.parentRotation)}#yi(t){switch(t){case 90:{const[t,e]=this.pageDimensions;return[0,-t/e,e/t,0]}case 180:return[-1,0,0,-1];case 270:{const[t,e]=this.pageDimensions;return[0,t/e,-e/t,0]}default:return[1,0,0,1]}}get parentScale(){return this._uiManager.viewParameters.realScale}get parentRotation(){return(this._uiManager.viewParameters.rotation+this.pageRotation)%360}get parentDimensions(){const{parentScale:t,pageDimensions:[e,i]}=this;return[e*t,i*t]}setDims(){const{div:{style:t},width:e,height:i}=this;t.width=`${(100*e).toFixed(2)}%`;t.height=`${(100*i).toFixed(2)}%`}getInitialTranslation(){return[0,0]}#wi(){if(this.#Je)return;this.#Je=document.createElement("div");this.#Je.classList.add("resizers");const t=this._willKeepAspectRatio?["topLeft","topRight","bottomRight","bottomLeft"]:["topLeft","topMiddle","topRight","middleRight","bottomRight","bottomMiddle","bottomLeft","middleLeft"],e=this._uiManager._signal;for(const i of t){const t=document.createElement("div");this.#Je.append(t);t.classList.add("resizer",i);t.setAttribute("data-resizer-name",i);t.addEventListener("pointerdown",this.#vi.bind(this,i),{signal:e});t.addEventListener("contextmenu",noContextMenu,{signal:e});t.tabIndex=-1}this.div.prepend(this.#Je)}#vi(t,e){e.preventDefault();const{isMac:i}=FeatureTest.platform;if(0!==e.button||e.ctrlKey&&i)return;this.#c?.toggle(!1);const n=this._isDraggable;this._isDraggable=!1;this.#Qe=[e.screenX,e.screenY];const r=new AbortController,s=this._uiManager.combinedSignal(r);this.parent.togglePointerEvents(!1);window.addEventListener("pointermove",this.#_i.bind(this,t),{passive:!0,capture:!0,signal:s});window.addEventListener("touchmove",stopEvent,{passive:!1,signal:s});window.addEventListener("contextmenu",noContextMenu,{signal:s});this.#Ze={savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height};const a=this.parent.div.style.cursor,o=this.div.style.cursor;this.div.style.cursor=this.parent.div.style.cursor=window.getComputedStyle(e.target).cursor;const pointerUpCallback=()=>{r.abort();this.parent.togglePointerEvents(!0);this.#c?.toggle(!0);this._isDraggable=n;this.parent.div.style.cursor=a;this.div.style.cursor=o;this.#Ai()};window.addEventListener("pointerup",pointerUpCallback,{signal:s});window.addEventListener("blur",pointerUpCallback,{signal:s})}#xi(t,e,i,n){this.width=i;this.height=n;this.x=t;this.y=e;this.setDims();this.fixAndSetPosition();this._onResized()}_onResized(){}#Ai(){if(!this.#Ze)return;const{savedX:t,savedY:e,savedWidth:i,savedHeight:n}=this.#Ze;this.#Ze=null;const r=this.x,s=this.y,a=this.width,o=this.height;r===t&&s===e&&a===i&&o===n||this.addCommands({cmd:this.#xi.bind(this,r,s,a,o),undo:this.#xi.bind(this,t,e,i,n),mustExec:!0})}static _round(t){return Math.round(1e4*t)/1e4}#_i(t,e){const[i,n]=this.parentDimensions,r=this.x,s=this.y,a=this.width,o=this.height,l=AnnotationEditor.MIN_SIZE/i,c=AnnotationEditor.MIN_SIZE/n,h=this.#yi(this.rotation),transf=(t,e)=>[h[0]*t+h[2]*e,h[1]*t+h[3]*e],d=this.#yi(360-this.rotation);let u,p,g=!1,f=!1;switch(t){case"topLeft":g=!0;u=(t,e)=>[0,0];p=(t,e)=>[t,e];break;case"topMiddle":u=(t,e)=>[t/2,0];p=(t,e)=>[t/2,e];break;case"topRight":g=!0;u=(t,e)=>[t,0];p=(t,e)=>[0,e];break;case"middleRight":f=!0;u=(t,e)=>[t,e/2];p=(t,e)=>[0,e/2];break;case"bottomRight":g=!0;u=(t,e)=>[t,e];p=(t,e)=>[0,0];break;case"bottomMiddle":u=(t,e)=>[t/2,e];p=(t,e)=>[t/2,0];break;case"bottomLeft":g=!0;u=(t,e)=>[0,e];p=(t,e)=>[t,0];break;case"middleLeft":f=!0;u=(t,e)=>[0,e/2];p=(t,e)=>[t,e/2]}const m=u(a,o),b=p(a,o);let y=transf(...b);const w=AnnotationEditor._round(r+y[0]),v=AnnotationEditor._round(s+y[1]);let _,A,x=1,E=1;if(e.fromKeyboard)({deltaX:_,deltaY:A}=e);else{const{screenX:t,screenY:i}=e,[n,r]=this.#Qe;[_,A]=this.screenToPageTranslation(t-n,i-r);this.#Qe[0]=t;this.#Qe[1]=i}[_,A]=(C=_/i,S=A/n,[d[0]*C+d[2]*S,d[1]*C+d[3]*S]);var C,S;if(g){const t=Math.hypot(a,o);x=E=Math.max(Math.min(Math.hypot(b[0]-m[0]-_,b[1]-m[1]-A)/t,1/a,1/o),l/a,c/o)}else f?x=MathClamp(Math.abs(b[0]-m[0]-_),l,1)/a:E=MathClamp(Math.abs(b[1]-m[1]-A),c,1)/o;const T=AnnotationEditor._round(a*x),k=AnnotationEditor._round(o*E);y=transf(...p(T,k));const D=w-y[0],P=v-y[1];this.#ri||=[this.x,this.y,this.width,this.height];this.width=T;this.height=k;this.x=D;this.y=P;this.setDims();this.fixAndSetPosition();this._onResizing()}_onResizing(){}altTextFinish(){this.#c?.finish()}get toolbarButtons(){return null}async addEditToolbar(){if(this._editToolbar||this.#ai)return this._editToolbar;this._editToolbar=new EditorToolbar(this);this.div.append(this._editToolbar.render());const{toolbarButtons:t}=this;if(t)for(const[e,i]of t)await this._editToolbar.addButton(e,i);this.hasComment||this._editToolbar.addButton("comment",this.addCommentButton());this._editToolbar.addButton("delete");return this._editToolbar}addCommentButtonInToolbar(){this._editToolbar?.addButtonBefore("comment",this.addCommentButton(),".deleteButton")}removeCommentButtonFromToolbar(){this._editToolbar?.removeButton("comment")}removeEditToolbar(){this._editToolbar?.remove();this._editToolbar=null;this.#c?.destroy()}addContainer(t){const e=this._editToolbar?.div;e?e.before(t):this.div.append(t)}getClientDimensions(){return this.div.getBoundingClientRect()}createAltText(){if(!this.#c){AltText.initialize(AnnotationEditor._l10n);this.#c=new AltText(this);if(this.#$e){this.#c.data=this.#$e;this.#$e=null}}return this.#c}get altTextData(){return this.#c?.data}set altTextData(t){this.#c&&(this.#c.data=t)}get guessedAltText(){return this.#c?.guessedText}async setGuessedAltText(t){await(this.#c?.setGuessedText(t))}serializeAltText(t){return this.#c?.serialize(t)}hasAltText(){return!!this.#c&&!this.#c.isEmpty()}hasAltTextData(){return this.#c?.hasData()??!1}focusCommentButton(){this.#h?.focusButton()}addCommentButton(){return this.canAddComment?this.#h||=new Comment(this):null}addStandaloneCommentButton(){if(this._uiManager.hasCommentManager())if(this.#ge)this._uiManager.isEditingMode()&&this.#ge.classList.remove("hidden");else if(this.hasComment){this.#ge=this.#h.renderForStandalone();this.div.append(this.#ge)}}removeStandaloneCommentButton(){this.#h.removeStandaloneCommentButton();this.#ge=null}hideStandaloneCommentButton(){this.#ge?.classList.add("hidden")}get comment(){if(!this.#h)return null;const{data:{richText:t,text:e,date:i,deleted:n}}=this.#h;return{text:e,richText:t,date:i,deleted:n,color:this.getNonHCMColor(),opacity:this.opacity??1}}set comment(t){this.#h||=new Comment(this);"object"==typeof t&&null!==t?this.#h.restoreData(t):this.#h.data=t;if(this.hasComment){this.removeCommentButtonFromToolbar();this.addStandaloneCommentButton();this._uiManager.updateComment(this)}else{this.addCommentButtonInToolbar();this.removeStandaloneCommentButton();this._uiManager.removeComment(this)}}setCommentData({comment:t,popupRef:e,richText:i}){if(!e)return;this.#h||=new Comment(this);this.#h.setInitialText(t,i);if(!this.annotationElementId)return;const n=this._uiManager.getAndRemoveDataFromAnnotationStorage(this.annotationElementId);n&&this.updateFromAnnotationLayer(n)}get hasEditedComment(){return this.#h?.hasBeenEdited()}get hasDeletedComment(){return this.#h?.isDeleted()}get hasComment(){return!!this.#h&&!this.#h.isEmpty()&&!this.#h.isDeleted()}async editComment(t){this.#h||=new Comment(this);this.#h.edit(t)}toggleComment(t,e=void 0){this.hasComment&&this._uiManager.toggleComment(this,t,e)}setSelectedCommentButton(t){this.#h.setSelectedButton(t)}addComment(t){if(this.hasEditedComment){const e=180,i=100,[,,,n]=t.rect,[r]=this.pageDimensions,[s]=this.pageTranslation,a=s+r+1,o=n-i,l=a+e;t.popup={contents:this.comment.text,deleted:this.comment.deleted,rect:[a,o,l,n]}}}updateFromAnnotationLayer({popup:{contents:t,deleted:e}}){this.#h.data=e?null:t}get parentBoundingClientRect(){return this.parent.boundingClientRect}render(){const t=this.div=document.createElement("div");t.setAttribute("data-editor-rotation",(360-this.rotation)%360);t.className=this.name;t.setAttribute("id",this.id);t.tabIndex=this.#Xe?-1:0;t.setAttribute("role","application");this.defaultL10nId&&t.setAttribute("data-l10n-id",this.defaultL10nId);this._isVisible||t.classList.add("hidden");this.setInForeground();this.#Ei();const[e,i]=this.parentDimensions;if(this.parentRotation%180!=0){t.style.maxWidth=`${(100*i/e).toFixed(2)}%`;t.style.maxHeight=`${(100*e/i).toFixed(2)}%`}const[n,r]=this.getInitialTranslation();this.translate(n,r);bindEvents(this,t,["keydown","pointerdown","dblclick"]);this.#Ci();this.addStandaloneCommentButton();this._uiManager._editorUndoBar?.hide();return t}#Si(){this.#Ze={savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height};this.#c?.toggle(!1);this.parent.togglePointerEvents(!1)}#Ti(t,e,i){let n=i/e*.7+1-.7;if(1===n)return;const r=this.#yi(this.rotation),transf=(t,e)=>[r[0]*t+r[2]*e,r[1]*t+r[3]*e],[s,a]=this.parentDimensions,o=this.x,l=this.y,c=this.width,h=this.height,d=AnnotationEditor.MIN_SIZE/s,u=AnnotationEditor.MIN_SIZE/a;n=Math.max(Math.min(n,1/c,1/h),d/c,u/h);const p=AnnotationEditor._round(c*n),g=AnnotationEditor._round(h*n);if(p===c&&g===h)return;this.#ri||=[o,l,c,h];const f=transf(c/2,h/2),m=AnnotationEditor._round(o+f[0]),b=AnnotationEditor._round(l+f[1]),y=transf(p/2,g/2);this.x=m-y[0];this.y=b-y[1];this.width=p;this.height=g;this.setDims();this.fixAndSetPosition();this._onResizing()}#ki(){this.#c?.toggle(!0);this.parent.togglePointerEvents(!0);this.#Ai()}pointerdown(t){const{isMac:e}=FeatureTest.platform;if(0!==t.button||t.ctrlKey&&e)t.preventDefault();else{this.#ni=!0;this._isDraggable?this.#Di(t):this.#Pi(t)}}#Pi(t){const{isMac:e}=FeatureTest.platform;t.ctrlKey&&!e||t.shiftKey||t.metaKey&&e?this.parent.toggleSelected(this):this.parent.setSelected(this)}#Di(t){const{isSelected:e}=this;this._uiManager.setUpDragSession();let i=!1;const n=new AbortController,r=this._uiManager.combinedSignal(n),s={capture:!0,passive:!1,signal:r},cancelDrag=t=>{n.abort();this.#Ke=null;this.#ni=!1;this._uiManager.endDragSession()||this.#Pi(t);i&&this._onStopDragging()};if(e){this.#ci=t.clientX;this.#hi=t.clientY;this.#Ke=t.pointerId;this.#Ye=t.pointerType;window.addEventListener("pointermove",t=>{if(!i){i=!0;this._uiManager.toggleComment(this,!0,!1);this._onStartDragging()}const{clientX:e,clientY:n,pointerId:r}=t;if(r!==this.#Ke){stopEvent(t);return}const[s,a]=this.screenToPageTranslation(e-this.#ci,n-this.#hi);this.#ci=e;this.#hi=n;this._uiManager.dragSelectedEditors(s,a);this.div.scrollIntoView({block:"nearest"})},s);window.addEventListener("touchmove",stopEvent,s);window.addEventListener("pointerdown",t=>{t.pointerType===this.#Ye&&(this.#ui||t.isPrimary)&&cancelDrag(t);stopEvent(t)},s)}const pointerUpCallback=t=>{this.#Ke&&this.#Ke!==t.pointerId?stopEvent(t):cancelDrag(t)};window.addEventListener("pointerup",pointerUpCallback,{signal:r});window.addEventListener("blur",pointerUpCallback,{signal:r})}_onStartDragging(){}_onStopDragging(){}moveInDOM(){this.#li&&clearTimeout(this.#li);this.#li=setTimeout(()=>{this.#li=null;this.parent?.moveEditorInDOM(this)},0)}_setParentAndPosition(t,e,i){t.changeParent(this);this.x=e;this.y=i;this.fixAndSetPosition();this._onTranslated()}getRect(t,e,i=this.rotation){const n=this.parentScale,[r,s]=this.pageDimensions,[a,o]=this.pageTranslation,l=t/n,c=e/n,h=this.x*r,d=this.y*s,u=this.width*r,p=this.height*s;switch(i){case 0:return[h+l+a,s-d-c-p+o,h+l+u+a,s-d-c+o];case 90:return[h+c+a,s-d+l+o,h+c+p+a,s-d+l+u+o];case 180:return[h-l-u+a,s-d+c+o,h-l+a,s-d+c+p+o];case 270:return[h-c-p+a,s-d-l-u+o,h-c+a,s-d-l+o];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(t,e){const[i,n,r,s]=t,a=r-i,o=s-n;switch(this.rotation){case 0:return[i,e-s,a,o];case 90:return[i,e-n,o,a];case 180:return[r,e-n,a,o];case 270:return[r,e-s,o,a];default:throw new Error("Invalid rotation")}}getPDFRect(){return this.getRect(0,0)}getNonHCMColor(){return this.color&&AnnotationEditor._colorManager.convert(this._uiManager.getNonHCMColor(this.color))}onUpdatedColor(){this.#h?.onUpdatedColor()}getData(){const{comment:{text:t,color:e,date:i,opacity:n,deleted:r,richText:s},uid:a,pageIndex:o,creationDate:l,modificationDate:c}=this;return{id:a,pageIndex:o,rect:this.getPDFRect(),richText:s,contentsObj:{str:t},creationDate:l,modificationDate:i||c,popupRef:!r,color:e,opacity:n}}onceAdded(t){}isEmpty(){return!1}enableEditMode(){if(this.isInEditMode())return!1;this.parent.setEditingState(!1);this.#ai=!0;return!0}disableEditMode(){if(!this.isInEditMode())return!1;this.parent.setEditingState(!0);this.#ai=!1;return!0}isInEditMode(){return this.#ai}shouldGetKeyboardEvents(){return this.#oi}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}get isOnScreen(){const{top:t,left:e,bottom:i,right:n}=this.getClientDimensions(),{innerHeight:r,innerWidth:s}=window;return e0&&t0}#Ei(){if(this.#ei||!this.div)return;this.#ei=new AbortController;const t=this._uiManager.combinedSignal(this.#ei);this.div.addEventListener("focusin",this.focusin.bind(this),{signal:t});this.div.addEventListener("focusout",this.focusout.bind(this),{signal:t})}#Ci(){!this.#ui&&this.div&&this.isResizable&&this._uiManager._supportsPinchToZoom&&(this.#ui=new TouchManager({container:this.div,isPinchingDisabled:()=>!this.isSelected,onPinchStart:this.#Si.bind(this),onPinching:this.#Ti.bind(this),onPinchEnd:this.#ki.bind(this),signal:this._uiManager._signal}))}rebuild(){this.#Ei();this.#Ci()}rotate(t){}resize(){}serializeDeleted(){return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex,popupRef:this._initialData?.popupRef||""}}serialize(t=!1,e=null){return{annotationType:this.mode,pageIndex:this.pageIndex,rect:this.getPDFRect(),rotation:this.rotation,structTreeParentId:this._structTreeParentId,popupRef:this._initialData?.popupRef||""}}static async deserialize(t,e,i){const n=new this.prototype.constructor({parent:e,id:i.getId(),uiManager:i,annotationElementId:t.annotationElementId,creationDate:t.creationDate,modificationDate:t.modificationDate});n.rotation=t.rotation;n.#$e=t.accessibilityData;n._isCopy=t.isCopy||!1;const[r,s]=n.pageDimensions,[a,o,l,c]=n.getRectInCurrentCoords(t.rect,s);n.x=a/r;n.y=o/s;n.width=l/r;n.height=c/s;return n}get hasBeenModified(){return!!this.annotationElementId&&(this.deleted||null!==this.serialize())}remove(){this.#ei?.abort();this.#ei=null;this.isEmpty()||this.commit();this.#ui?.destroy();this.#ui=null;this.parent?this.parent.remove(this):this._uiManager.removeEditor(this);this.hideCommentPopup();if(this.#li){clearTimeout(this.#li);this.#li=null}this.#fi();this.removeEditToolbar();if(this.#di){for(const t of this.#di.values())clearTimeout(t);this.#di=null}this.parent=null;this.#ti?.remove();this.#ti=null}get isResizable(){return!1}makeResizable(){if(this.isResizable){this.#wi();this.#Je.classList.remove("hidden")}}get toolbarPosition(){return null}get commentButtonPosition(){return"ltr"===this._uiManager.direction?[1,0]:[0,0]}get commentButtonPositionInPage(){const{commentButtonPosition:[t,e]}=this,[i,n,r,s]=this.getPDFRect();return[AnnotationEditor._round(i+(r-i)*t),AnnotationEditor._round(n+(s-n)*(1-e))]}get commentButtonColor(){return this._uiManager.makeCommentColor(this.getNonHCMColor(),this.opacity)}get commentPopupPosition(){return this.#h.commentPopupPositionInLayer}set commentPopupPosition(t){this.#h.commentPopupPositionInLayer=t}hasDefaultPopupPosition(){return this.#h.hasDefaultPopupPosition()}get commentButtonWidth(){return this.#h.commentButtonWidth}get elementBeforePopup(){return this.div}setCommentButtonStates(t){this.#h?.setCommentButtonStates(t)}keydown(t){if(!this.isResizable||t.target!==this.div||"Enter"!==t.key)return;this._uiManager.setSelected(this);this.#Ze={savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height};const e=this.#Je.children;if(!this.#qe){this.#qe=Array.from(e);const t=this.#Mi.bind(this),i=this.#Ii.bind(this),n=this._uiManager._signal;for(const e of this.#qe){const r=e.getAttribute("data-resizer-name");e.setAttribute("role","spinbutton");e.addEventListener("keydown",t,{signal:n});e.addEventListener("blur",i,{signal:n});e.addEventListener("focus",this.#Fi.bind(this,r),{signal:n});e.setAttribute("data-l10n-id",AnnotationEditor._l10nResizer[r])}}const i=this.#qe[0];let n=0;for(const t of e){if(t===i)break;n++}const r=(360-this.rotation+this.parentRotation)%360/90*(this.#qe.length/4);if(r!==n){if(rn)for(let t=0;t{this.div?.classList.contains("selectedEditor")&&this._editToolbar?.show()})}}focus(){this.div&&!this.div.contains(document.activeElement)&&setTimeout(()=>this.div?.focus({preventScroll:!0}),0)}unselect(){if(this.isSelected){this.isSelected=!1;this.#Je?.classList.add("hidden");this.div?.classList.remove("selectedEditor");this.div?.contains(document.activeElement)&&this._uiManager.currentLayer.div.focus({preventScroll:!0});this._editToolbar?.hide();this.#c?.toggleAltTextBadge(!0);this.hideCommentPopup()}}hideCommentPopup(){this.hasComment&&this._uiManager.toggleComment(null)}updateParams(t,e){}disableEditing(){}enableEditing(){}get canChangeContent(){return!1}enterInEditMode(){if(this.canChangeContent){this.enableEditMode();this.div.focus()}}dblclick(t){if("BUTTON"!==t.target.nodeName){this.enterInEditMode();this.parent.updateToolbar({mode:this.constructor._editorType,editId:this.uid})}}getElementForAltText(){return this.div}get contentDiv(){return this.div}get isEditing(){return this.#si}set isEditing(t){this.#si=t;if(this.parent)if(t){this.parent.setSelected(this);this.parent.setActiveEditor(this)}else this.parent.setActiveEditor(null)}static get MIN_SIZE(){return 16}static canCreateNewEmptyEditor(){return!0}get telemetryInitialData(){return{action:"added"}}get telemetryFinalData(){return null}_reportTelemetry(t,e=!1){if(e){this.#di||=new Map;const{action:e}=t;let i=this.#di.get(e);i&&clearTimeout(i);i=setTimeout(()=>{this._reportTelemetry(t);this.#di.delete(e);0===this.#di.size&&(this.#di=null)},AnnotationEditor._telemetryTimeout);this.#di.set(e,i);return}t.type||=this.editorType;this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:t}})}show(t=this._isVisible){this.div.classList.toggle("hidden",!t);this._isVisible=t}enable(){this.div&&(this.div.tabIndex=0);this.#Xe=!1}disable(){this.div&&(this.div.tabIndex=-1);this.#Xe=!0}updateFakeAnnotationElement(t){if(this.#ti||this.deleted)if(this.deleted){this.#ti.remove();this.#ti=null}else(this.hasEditedComment||this._hasBeenMoved||this._hasBeenResized)&&this.#ti.updateEdited({rect:this.getPDFRect(),popup:this.comment});else this.#ti=t.addFakeAnnotation(this)}renderAnnotationElement(t){if(this.deleted){t.hide();return null}let e=t.container.querySelector(".annotationContent");if(e){if("CANVAS"===e.nodeName){const t=e;e=document.createElement("div");e.classList.add("annotationContent",this.editorType);t.before(e)}}else{e=document.createElement("div");e.classList.add("annotationContent",this.editorType);t.container.prepend(e)}return e}resetAnnotationElement(t){const{firstElementChild:e}=t.container;"DIV"===e?.nodeName&&e.classList.contains("annotationContent")&&e.remove()}}class FakeEditor extends AnnotationEditor{constructor(t){super(t);this.annotationElementId=t.annotationElementId;this.deleted=!0}serialize(){return this.serializeDeleted()}}const cn=3285377520,hn=4294901760,dn=65535;class MurmurHash3_64{constructor(t){this.h1=t?4294967295&t:cn;this.h2=t?4294967295&t:cn}update(t){let e,i;if("string"==typeof t){e=new Uint8Array(2*t.length);i=0;for(let n=0,r=t.length;n>>8;e[i++]=255&r}}}else{if(!ArrayBuffer.isView(t))throw new Error("Invalid data format, must be a string or TypedArray.");e=t.slice();i=e.byteLength}const n=i>>2,r=i-4*n,s=new Uint32Array(e.buffer,0,n);let a=0,o=0,l=this.h1,c=this.h2;const h=3432918353,d=461845907,u=11601,p=13715;for(let t=0;t>>17;a=a*d&hn|a*p&dn;l^=a;l=l<<13|l>>>19;l=5*l+3864292196}else{o=s[t];o=o*h&hn|o*u&dn;o=o<<15|o>>>17;o=o*d&hn|o*p&dn;c^=o;c=c<<13|c>>>19;c=5*c+3864292196}a=0;switch(r){case 3:a^=e[4*n+2]<<16;case 2:a^=e[4*n+1]<<8;case 1:a^=e[4*n];a=a*h&hn|a*u&dn;a=a<<15|a>>>17;a=a*d&hn|a*p&dn;1&n?l^=a:c^=a}this.h1=l;this.h2=c}hexdigest(){let t=this.h1,e=this.h2;t^=e>>>1;t=3981806797*t&hn|36045*t&dn;e=4283543511*e&hn|(2950163797*(e<<16|t>>>16)&hn)>>>16;t^=e>>>1;t=444984403*t&hn|60499*t&dn;e=3301882366*e&hn|(3120437893*(e<<16|t>>>16)&hn)>>>16;t^=e>>>1;return(t>>>0).toString(16).padStart(8,"0")+(e>>>0).toString(16).padStart(8,"0")}}const un=Object.freeze({map:null,hash:"",transfer:void 0});class AnnotationStorage{#Ri=!1;#Bi=null;#Li=null;#Ni=new Map;onSetModified=null;onResetModified=null;onAnnotationEditor=null;getValue(t,e){const i=this.#Ni.get(t);return void 0===i?e:Object.assign(e,i)}getRawValue(t){return this.#Ni.get(t)}remove(t){const e=this.#Ni.get(t);if(void 0!==e){e instanceof AnnotationEditor&&this.#Li.delete(e.annotationElementId);this.#Ni.delete(t);0===this.#Ni.size&&this.resetModified();this.#Ni.values().some(t=>t instanceof AnnotationEditor)||this.onAnnotationEditor?.(null)}}setValue(t,e){const i=this.#Ni.get(t);let n=!1;if(void 0!==i){for(const[t,r]of Object.entries(e))if(i[t]!==r){n=!0;i[t]=r}}else{n=!0;this.#Ni.set(t,e)}n&&this.#Ui();if(e instanceof AnnotationEditor){(this.#Li||=new Map).set(e.annotationElementId,e);this.onAnnotationEditor?.(e.constructor._type)}}has(t){return this.#Ni.has(t)}get size(){return this.#Ni.size}#Ui(){if(!this.#Ri){this.#Ri=!0;this.onSetModified?.()}}resetModified(){if(this.#Ri){this.#Ri=!1;this.onResetModified?.()}}get print(){return new PrintAnnotationStorage(this)}get serializable(){if(0===this.#Ni.size)return un;const t=new Map,e=new MurmurHash3_64,i=[],n=Object.create(null);let r=!1;for(const[i,s]of this.#Ni){const a=s instanceof AnnotationEditor?s.serialize(!1,n):s;if(s.page){s.pageIndex=s.page._pageIndex;delete s.page}if(a){t.set(i,a);e.update(`${i}:${JSON.stringify(a)}`);r||=!!a.bitmap}}if(r)for(const e of t.values())e.bitmap&&i.push(e.bitmap);return t.size>0?{map:t,hash:e.hexdigest(),transfer:i}:un}get editorStats(){let t=null;const e=new Map;let i=0,n=0;for(const r of this.#Ni.values()){if(!(r instanceof AnnotationEditor)){r.popup&&(r.popup.deleted?n+=1:i+=1);continue}r.isCommentDeleted?n+=1:r.hasEditedComment&&(i+=1);const s=r.telemetryFinalData;if(!s)continue;const{type:a}=s;e.getOrInsertComputed(a,()=>Object.getPrototypeOf(r).constructor);t||=Object.create(null);const o=t[a]||=new Map;for(const[t,e]of Object.entries(s)){if("type"===t)continue;const i=o.getOrInsertComputed(t,makeMap);i.set(e,(i.get(e)??0)+1)}}if(n>0||i>0){t||=Object.create(null);t.comments={deleted:n,edited:i}}if(!t)return null;for(const[i,n]of e)t[i]=n.computeTelemetryFinalData(t[i]);return t}resetModifiedIds(){this.#Bi=null}updateEditor(t,e){const i=this.#Li?.get(t);if(i){i.updateFromAnnotationLayer(e);return!0}return!1}getEditor(t){return this.#Li?.get(t)||null}get modifiedIds(){if(this.#Bi)return this.#Bi;const t=[];if(this.#Li)for(const e of this.#Li.values())e.serialize()&&t.push(e.annotationElementId);let e="";if(t.length){const i=new MurmurHash3_64;i.update(t.join(","));e=i.hexdigest()}return this.#Bi={ids:new Set(t),hash:e}}[Symbol.iterator](){return this.#Ni.entries()}}class PrintAnnotationStorage extends AnnotationStorage{#Hi=un;constructor(t){super();const{serializable:e}=t;if(e===un)return;const{map:i,hash:n,transfer:r}=e,s=structuredClone(i,r?{transfer:r}:null);this.#Hi={map:s,hash:n,transfer:[]}}get print(){unreachable("Should not call PrintAnnotationStorage.print")}get serializable(){return this.#Hi}get modifiedIds(){return util_shadow(this,"modifiedIds",{ids:new Set,hash:""})}}Ne();const pn="__forcedDependency",{floor:gn,ceil:fn}=Math;function expandBBox(t,e,i,n,r,s){t[4*e+0]=Math.min(t[4*e+0],i);t[4*e+1]=Math.min(t[4*e+1],n);t[4*e+2]=Math.max(t[4*e+2],r);t[4*e+3]=Math.max(t[4*e+3],s)}const mn=new Uint32Array(new Uint8Array([255,255,0,0]).buffer)[0];class BBoxReader{#zi;#Gi;constructor(t,e){this.#zi=t;this.#Gi=e}get length(){return this.#zi.length}isEmpty(t){return this.#zi[t]===mn}minX(t){return this.#Gi[4*t+0]/256}minY(t){return this.#Gi[4*t+1]/256}maxX(t){return(this.#Gi[4*t+2]+1)/256}maxY(t){return(this.#Gi[4*t+3]+1)/256}}const ensureDebugMetadata=(t,e)=>t?.getOrInsertComputed(e,()=>({dependencies:new Set,isRenderingOperation:!1}));class CanvasBBoxTracker{#ji=[[1,0,0,1,0,0]];#Wi=[-1/0,-1/0,1/0,1/0];#Vi=new Float64Array(pi);_pendingBBoxIdx=-1;#$i;#qi;#Xi;#zi;_savesStack=[];_markedContentStack=[];constructor(t,e){this.#$i=t.width;this.#qi=t.height;this.#Ki(e)}growOperationsCount(t){t>=this.#zi.length&&this.#Ki(t,this.#zi)}#Ki(t,e){const i=new ArrayBuffer(4*t);this.#Xi=new Uint8ClampedArray(i);this.#zi=new Uint32Array(i);if(e&&e.length>0){this.#zi.set(e);this.#zi.fill(mn,e.length)}else this.#zi.fill(mn)}get clipBox(){return this.#Wi}save(t){this.#Wi={__proto__:this.#Wi};this._savesStack.push(t);return this}restore(t,e){const i=Object.getPrototypeOf(this.#Wi);if(null===i)return this;this.#Wi=i;const n=this._savesStack.pop();if(void 0!==n){e?.(n,t);this.#zi[t]=this.#zi[n]}return this}recordOpenMarker(t){this._savesStack.push(t);return this}getOpenMarker(){return 0===this._savesStack.length?null:this._savesStack.at(-1)}recordCloseMarker(t,e){const i=this._savesStack.pop();if(void 0!==i){e?.(i,t);this.#zi[t]=this.#zi[i]}return this}beginMarkedContent(t){this._markedContentStack.push(t);return this}endMarkedContent(t,e){const i=this._markedContentStack.pop();if(void 0!==i){e?.(i,t);this.#zi[t]=this.#zi[i]}return this}pushBaseTransform(t){this.#ji.push(Util.multiplyByDOMMatrix(this.#ji.at(-1),t.getTransform()));return this}popBaseTransform(){this.#ji.length>1&&this.#ji.pop();return this}resetBBox(t){if(this._pendingBBoxIdx!==t){this._pendingBBoxIdx=t;this.#Vi.set(pi,0)}return this}recordClipBox(t,e,i,n,r,s){const a=Util.multiplyByDOMMatrix(this.#ji.at(-1),e.getTransform()),o=pi.slice();Util.axialAlignedBoundingBox([i,r,n,s],a,o);const l=Util.intersect(this.#Wi,o);if(l){this.#Wi[0]=l[0];this.#Wi[1]=l[1];this.#Wi[2]=l[2];this.#Wi[3]=l[3]}else{this.#Wi[0]=this.#Wi[1]=1/0;this.#Wi[2]=this.#Wi[3]=-1/0}return this}recordBBox(t,e,i,n,r,s){const a=this.#Wi;if(a[0]===1/0)return this;const o=Util.multiplyByDOMMatrix(this.#ji.at(-1),e.getTransform());if(a[0]===-1/0){Util.axialAlignedBoundingBox([i,r,n,s],o,this.#Vi);return this}const l=pi.slice();Util.axialAlignedBoundingBox([i,r,n,s],o,l);this.#Vi[0]=MathClamp(l[0],a[0],this.#Vi[0]);this.#Vi[1]=MathClamp(l[1],a[1],this.#Vi[1]);this.#Vi[2]=MathClamp(l[2],this.#Vi[2],a[2]);this.#Vi[3]=MathClamp(l[3],this.#Vi[3],a[3]);return this}recordFullPageBBox(t){this.#Vi[0]=Math.max(0,this.#Wi[0]);this.#Vi[1]=Math.max(0,this.#Wi[1]);this.#Vi[2]=Math.min(this.#$i,this.#Wi[2]);this.#Vi[3]=Math.min(this.#qi,this.#Wi[3]);return this}recordOperation(t,e=!1,i){if(this._pendingBBoxIdx!==t)return this;const n=gn(256*this.#Vi[0]/this.#$i),r=gn(256*this.#Vi[1]/this.#qi),s=fn(256*this.#Vi[2]/this.#$i),a=fn(256*this.#Vi[3]/this.#qi);expandBBox(this.#Xi,t,n,r,s,a);if(i)for(const e of i)for(const i of e)i!==t&&expandBBox(this.#Xi,i,n,r,s,a);e||(this._pendingBBoxIdx=-1);return this}bboxToClipBoxDropOperation(t){if(this._pendingBBoxIdx===t){this._pendingBBoxIdx=-1;this.#Wi[0]=Math.max(this.#Wi[0],this.#Vi[0]);this.#Wi[1]=Math.max(this.#Wi[1],this.#Vi[1]);this.#Wi[2]=Math.min(this.#Wi[2],this.#Vi[2]);this.#Wi[3]=Math.min(this.#Wi[3],this.#Vi[3])}return this}take(){return new BBoxReader(this.#zi,this.#Xi)}takeDebugMetadata(){throw new Error("Unreachable")}recordSimpleData(t,e){return this}recordIncrementalData(t,e){return this}resetIncrementalData(t,e){return this}recordNamedData(t,e){return this}recordSimpleDataFromNamed(t,e,i){return this}recordFutureForcedDependency(t,e){return this}inheritSimpleDataAsFutureForcedDependencies(t){return this}inheritPendingDependenciesAsFutureForcedDependencies(){return this}recordCharacterBBox(t,e,i,n=1,r=0,s=0,a){return this}getSimpleIndex(t){}recordDependencies(t,e){return this}recordNamedDependency(t,e){return this}recordShowTextOperation(t,e=!1){return this}}class CanvasDependencyTracker{#Yi={__proto__:null};#Ji={__proto__:null,transform:[],moveText:[],sameLineText:[],[pn]:[]};#Qi=new Map;#Zi=new Set;#tn=new Map;#en;#in;#nn;constructor(t,e=!1){this.#nn=t;if(e){this.#en=new Map;this.#in=(t,e)=>{ensureDebugMetadata(this.#en,e).dependencies.add(t)}}}get clipBox(){return this.#nn.clipBox}growOperationsCount(t){this.#nn.growOperationsCount(t)}save(t){this.#Yi={__proto__:this.#Yi};this.#Ji={__proto__:this.#Ji,transform:{__proto__:this.#Ji.transform},moveText:{__proto__:this.#Ji.moveText},sameLineText:{__proto__:this.#Ji.sameLineText},[pn]:{__proto__:this.#Ji[pn]}};this.#nn.save(t);return this}restore(t){this.#nn.restore(t,this.#in);const e=Object.getPrototypeOf(this.#Yi);if(null===e)return this;this.#Yi=e;this.#Ji=Object.getPrototypeOf(this.#Ji);return this}recordOpenMarker(t){this.#nn.recordOpenMarker(t,this.#in);return this}getOpenMarker(){return this.#nn.getOpenMarker()}recordCloseMarker(t){this.#nn.recordCloseMarker(t,this.#in);return this}beginMarkedContent(t){this.#nn.beginMarkedContent(t);return this}endMarkedContent(t){this.#nn.endMarkedContent(t,this.#in);return this}pushBaseTransform(t){this.#nn.pushBaseTransform(t);return this}popBaseTransform(){this.#nn.popBaseTransform();return this}recordSimpleData(t,e){this.#Yi[t]=e;return this}recordIncrementalData(t,e){this.#Ji[t].push(e);return this}resetIncrementalData(t,e){this.#Ji[t].length=0;return this}recordNamedData(t,e){this.#Qi.set(t,e);return this}recordSimpleDataFromNamed(t,e,i){this.#Yi[t]=this.#Qi.get(e)??i}recordFutureForcedDependency(t,e){this.recordIncrementalData(pn,e);return this}inheritSimpleDataAsFutureForcedDependencies(t){for(const e of t)e in this.#Yi&&this.recordFutureForcedDependency(e,this.#Yi[e]);return this}inheritPendingDependenciesAsFutureForcedDependencies(){for(const t of this.#Zi)this.recordFutureForcedDependency(pn,t);return this}resetBBox(t){this.#nn.resetBBox(t);return this}recordClipBox(t,e,i,n,r,s){this.#nn.recordClipBox(t,e,i,n,r,s);return this}recordBBox(t,e,i,n,r,s){this.#nn.recordBBox(t,e,i,n,r,s);return this}recordCharacterBBox(t,e,i,n=1,r=0,s=0,a){const o=i.bbox;let l,c;if(o){l=o[2]!==o[0]&&o[3]!==o[1]&&this.#tn.get(i);if(!1!==l){c=[0,0,0,0];Util.axialAlignedBoundingBox(o,i.fontMatrix,c);1===n&&0===r&&0===s||function scaleCharBBox(t,e,i,n,r){let s;if(t){if(t<0){s=r[0];r[0]=r[2];r[2]=s}r[0]*=t;r[2]*=t;if(e<0){s=r[1];r[1]=r[3];r[3]=s}r[1]*=e;r[3]*=e}else r.fill(0);r[0]+=i;r[1]+=n;r[2]+=i;r[3]+=n}(n,-n,r,s,c);if(l)return this.recordBBox(t,e,c[0],c[2],c[1],c[3])}}if(!a)return this.recordFullPageBBox(t);const h=a();if(o&&c&&void 0===l){l=c[0]<=r-h.actualBoundingBoxLeft&&c[2]>=r+h.actualBoundingBoxRight&&c[1]<=s-h.actualBoundingBoxAscent&&c[3]>=s+h.actualBoundingBoxDescent;this.#tn.set(i,l);if(l)return this.recordBBox(t,e,c[0],c[2],c[1],c[3])}return this.recordBBox(t,e,r-h.actualBoundingBoxLeft,r+h.actualBoundingBoxRight,s-h.actualBoundingBoxAscent,s+h.actualBoundingBoxDescent)}recordFullPageBBox(t){this.#nn.recordFullPageBBox(t);return this}getSimpleIndex(t){return this.#Yi[t]}recordDependencies(t,e){const i=this.#Zi,n=this.#Yi,r=this.#Ji;for(const t of e)t in this.#Yi?i.add(n[t]):t in r&&r[t].forEach(i.add,i);return this}recordNamedDependency(t,e){this.#Qi.has(e)&&this.#Zi.add(this.#Qi.get(e));return this}recordOperation(t,e=!1){this.recordDependencies(t,[pn]);if(this.#en){const e=ensureDebugMetadata(this.#en,t),{dependencies:i}=e;this.#Zi.forEach(i.add,i);this.#nn._savesStack.forEach(i.add,i);this.#nn._markedContentStack.forEach(i.add,i);i.delete(t);e.isRenderingOperation=!0}const i=!e&&t===this.#nn._pendingBBoxIdx;this.#nn.recordOperation(t,e,[this.#Zi,this.#nn._savesStack,this.#nn._markedContentStack]);i&&this.#Zi.clear();return this}recordShowTextOperation(t,e=!1){const i=Array.from(this.#Zi);this.recordOperation(t,e);this.recordIncrementalData("sameLineText",t);for(const t of i)this.recordIncrementalData("sameLineText",t);return this}bboxToClipBoxDropOperation(t,e=!1){const i=!e&&t===this.#nn._pendingBBoxIdx;this.#nn.bboxToClipBoxDropOperation(t);i&&this.#Zi.clear();return this}take(){this.#tn.clear();return this.#nn.take()}takeDebugMetadata(){return this.#en}}class CanvasNestedDependencyTracker{#rn;#sn;#an;#on=0;#ln=0;constructor(t,e,i){if(t instanceof CanvasNestedDependencyTracker&&t.#an===!!i)return t;this.#rn=t;this.#sn=e;this.#an=!!i}get clipBox(){return this.#rn.clipBox}growOperationsCount(){throw new Error("Unreachable")}save(t){this.#ln++;this.#rn.save(this.#sn);return this}restore(t){if(this.#ln>0){this.#rn.restore(this.#sn);this.#ln--}return this}recordOpenMarker(t){this.#on++;return this}getOpenMarker(){return this.#on>0?this.#sn:this.#rn.getOpenMarker()}recordCloseMarker(t){this.#on--;return this}beginMarkedContent(t){return this}endMarkedContent(t){return this}pushBaseTransform(t){this.#rn.pushBaseTransform(t);return this}popBaseTransform(){this.#rn.popBaseTransform();return this}recordSimpleData(t,e){this.#rn.recordSimpleData(t,this.#sn);return this}recordIncrementalData(t,e){this.#rn.recordIncrementalData(t,this.#sn);return this}resetIncrementalData(t,e){this.#rn.resetIncrementalData(t,this.#sn);return this}recordNamedData(t,e){return this}recordSimpleDataFromNamed(t,e,i){this.#rn.recordSimpleDataFromNamed(t,e,this.#sn);return this}recordFutureForcedDependency(t,e){this.#rn.recordFutureForcedDependency(t,this.#sn);return this}inheritSimpleDataAsFutureForcedDependencies(t){this.#rn.inheritSimpleDataAsFutureForcedDependencies(t);return this}inheritPendingDependenciesAsFutureForcedDependencies(){this.#rn.inheritPendingDependenciesAsFutureForcedDependencies();return this}resetBBox(t){this.#an||this.#rn.resetBBox(this.#sn);return this}recordClipBox(t,e,i,n,r,s){this.#an||this.#rn.recordClipBox(this.#sn,e,i,n,r,s);return this}recordBBox(t,e,i,n,r,s){this.#an||this.#rn.recordBBox(this.#sn,e,i,n,r,s);return this}recordCharacterBBox(t,e,i,n,r,s,a){this.#an||this.#rn.recordCharacterBBox(this.#sn,e,i,n,r,s,a);return this}recordFullPageBBox(t){this.#an||this.#rn.recordFullPageBBox(this.#sn);return this}getSimpleIndex(t){return this.#rn.getSimpleIndex(t)}recordDependencies(t,e){this.#rn.recordDependencies(this.#sn,e);return this}recordNamedDependency(t,e){this.#rn.recordNamedDependency(this.#sn,e);return this}recordOperation(t){this.#rn.recordOperation(this.#sn,!0);return this}recordShowTextOperation(t){this.#rn.recordShowTextOperation(this.#sn,!0);return this}bboxToClipBoxDropOperation(t){this.#an||this.#rn.bboxToClipBoxDropOperation(this.#sn,!0);return this}take(){throw new Error("Unreachable")}takeDebugMetadata(){throw new Error("Unreachable")}}const bn=["path","transform","filter","strokeColor","strokeAlpha","lineWidth","lineCap","lineJoin","miterLimit","dash"],yn=["path","transform","filter","fillColor","fillAlpha","globalCompositeOperation","SMask"],wn=["transform","SMask","filter","fillAlpha","strokeAlpha","globalCompositeOperation"],vn=["filter","fillColor","fillAlpha"],_n=["transform","leading","charSpacing","wordSpacing","hScale","textRise","moveText","textMatrix","font","fontObj","filter","fillColor","textRenderingMode","SMask","fillAlpha","strokeAlpha","globalCompositeOperation","sameLineText"],An=["transform"],xn=["transform","filter","fillColor"];class CanvasImagesTracker{#$i;#qi;#cn=4;#hn=0;#Gi=new CanvasImagesTracker.#dn(6*this.#cn);static#dn=FeatureTest.isFloat16ArraySupported?Float16Array:Float32Array;constructor(t){this.#$i=t.width;this.#qi=t.height}record(t,e,i,n){if(this.#hn===this.#cn){this.#cn*=2;const t=new CanvasImagesTracker.#dn(6*this.#cn);t.set(this.#Gi);this.#Gi=t}const r=getCurrentTransform(t);let s;if(n[0]!==1/0){const t=pi.slice();Util.axialAlignedBoundingBox([0,-i,e,0],r,t);const a=Util.intersect(n,t);if(!a)return;const[o,l,c,h]=a;if(o!==t[0]||l!==t[1]||c!==t[2]||h!==t[3]){const t=Math.atan2(r[1],r[0]),e=Math.abs(Math.sin(t)),i=Math.abs(Math.cos(t));if(e<1e-6||i<1e-6||Math.abs(e-i)<1e-6)s=[o,l,o,h,c,l];else{const t=c-o,n=h-l,r=e*e,a=i*i,d=i*e,u=a-r,p=(n*a-t*d)/u;s=[o+(n*d-t*r)/u,l,o,l+p,c,h-p]}}}if(!s){s=[0,-i,0,0,e,-i];Util.applyTransform(s,r,0);Util.applyTransform(s,r,2);Util.applyTransform(s,r,4)}s[0]/=this.#$i;s[1]/=this.#qi;s[2]/=this.#$i;s[3]/=this.#qi;s[4]/=this.#$i;s[5]/=this.#qi;this.#Gi.set(s,6*this.#hn);this.#hn++}take(){return this.#Gi.subarray(0,6*this.#hn)}}const En=/\p{Cc}/u;function serializeFontFamily(t){if(function isCSSString(t){const e=t[0];if(t.length<2||'"'!==e&&"'"!==e||t.at(-1)!==e)return!1;const i=t.length-1;for(let n=1;n=i||En.test(t[n])))return!1}return!0}(t))return t;return`"${t.replaceAll(/["\\\p{Cc}]/gu,t=>'"'===t||"\\"===t?`\\${t}`:`\\${t.codePointAt(0).toString(16)} `)}"`}class FontLoader{#un=new Set;#pn=new Set;#gn=null;constructor({ownerDocument:t=globalThis.document,styleElement:e=null}){this._document=t;this.styleElement=null;this.loadingRequests=[];this.loadTestFontId=0}addNativeFontFace(t){this.#un.add(t);this._document.fonts.add(t)}removeNativeFontFace(t){this.#un.delete(t);this._document.fonts.delete(t)}insertRule(t){const e=this.#fn();e.insertRule(t,e.cssRules.length)}#fn(){if(this.#gn)return this.#gn;const t=this._document.defaultView?.CSSStyleSheet||globalThis.CSSStyleSheet;if(!this.styleElement&&t){const{adoptedStyleSheets:e}=this._document;if(e){const i=new t;e.push(i);return this.#gn=i}}if(!this.styleElement){this.styleElement=this._document.createElement("style");this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement)}return this.#gn=this.styleElement.sheet}clear(){for(const t of this.#un)this._document.fonts.delete(t);this.#un.clear();this.#pn.clear();if(this.#gn){const{adoptedStyleSheets:t}=this._document;t?.includes(this.#gn)&&(this._document.adoptedStyleSheets=t.filter(t=>t!==this.#gn));this.#gn=null}this.styleElement?.remove();this.styleElement=null}async loadSystemFont({systemFontInfo:t,disableFontFace:e,_inspectFont:i}){if(t&&!this.#pn.has(t.loadedName)){util_assert(!e,"loadSystemFont shouldn't be called when `disableFontFace` is set.");if(this.isFontLoadingAPISupported){const{loadedName:e,src:n,style:r}=t,s=new FontFace(e,n,r);this.addNativeFontFace(s);try{await s.load();this.#pn.add(e);i?.(t)}catch{warn(`Cannot load system font: ${t.baseFontName}, installing it could help to improve PDF rendering.`);this.removeNativeFontFace(s)}return}unreachable("Not implemented: loadSystemFont without the Font Loading API.")}}async bind(t){if(t.attached||t.missingFile&&!t.systemFontInfo)return;t.attached=!0;if(t.systemFontInfo){await this.loadSystemFont(t);return}if(this.isFontLoadingAPISupported){const e=t.createNativeFontFace();if(e){this.addNativeFontFace(e);try{await e.loaded}catch(i){warn(`Failed to load font '${e.family}': '${i}'.`);t.disableFontFace=!0;throw i}}return}const e=t.createFontFaceRule();if(e){this.insertRule(e);if(this.isSyncFontLoadingSupported)return;await this.#mn(t)}}get isFontLoadingAPISupported(){return util_shadow(this,"isFontLoadingAPISupported",!!this._document?.fonts)}get isSyncFontLoadingSupported(){return util_shadow(this,"isSyncFontLoadingSupported",ui||FeatureTest.platform.isFirefox)}#mn(t){const{loadingRequests:e}=this,{promise:i,resolve:n}=Promise.withResolvers(),r={done:!1,resolve:n};e.push(r);this._loadTestFont??=atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAE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String(t,e,i,n){return t.substring(0,e)+n+t.substring(e+i)}let s,a;const o=this._document.createElement("canvas");o.width=1;o.height=1;const l=o.getContext("2d");let c=0;const h=`lt${Date.now()}${this.loadTestFontId++}`;let d=this._loadTestFont;d=spliceString(d,976,h.length,h);const u=1482184792;let p=int32(d,16);for(s=0,a=h.length-3;s>24&255,t>>16&255,t>>8&255,255&t)}(p));const g=`@font-face {font-family:"${h}";src:${`url(data:font/opentype;base64,${btoa(d)});`}}`;this.insertRule(g);const f=this._document.createElement("div");f.style.visibility="hidden";f.style.width=f.style.height="10px";f.style.position="absolute";f.style.top=f.style.left="0px";for(const e of[t.loadedName,h]){const t=this._document.createElement("span");t.textContent="Hi";t.style.fontFamily=e;f.append(t)}this._document.body.append(f);!function isFontReady(t,e){if(++c>30){warn("Load test font never loaded.");e();return}l.font="30px "+t;l.fillText(".",0,20);l.getImageData(0,0,1,1).data[3]>0?e():setTimeout(isFontReady.bind(null,t,e))}(h,()=>{f.remove();!function completeRequest(){util_assert(!r.done,"completeRequest() cannot be called twice.");r.done=!0;for(;e.length>0&&e[0].done;){const t=e.shift();setTimeout(t.resolve,0)}}()});return i}}class FontFaceObject{#bn=new Map;#yn;constructor(t,e=null,i,n){this.#yn=t;this._inspectFont=e;i&&(this.charProcOperatorList=i);n&&Object.assign(this,n)}createNativeFontFace(){const{data:t}=this;if(!t||this.disableFontFace)return null;let e;if(this.cssFontInfo){const i={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(i.style=`oblique ${this.cssFontInfo.italicAngle}deg`);e=new FontFace(serializeFontFamily(this.cssFontInfo.fontFamily),t,i)}else e=new FontFace(this.loadedName,t,{});this._inspectFont?.(this);return e}createFontFaceRule(){const{data:t}=this;if(!t||this.disableFontFace)return null;const e=`url(data:${this.mimetype};base64,${t.toBase64()});`;let i;if(this.cssFontInfo){let t=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(t+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`);i=`@font-face {font-family:${serializeFontFamily(this.cssFontInfo.fontFamily)};${t}src:${e}}`}else i=`@font-face {font-family:"${this.loadedName}";src:${e}}`;this._inspectFont?.(this,e);return i}getPathGenerator(t,e){let i=this.#bn.get(e);if(i)return i;const n=`${this.loadedName}_path_${e}`;let r;try{r=t.get(n)}catch(t){warn(`getPathGenerator - ignoring character: "${t}".`)}i=makePathFromDrawOPS(r?.path);this.fontExtraProperties||t.delete(n);this.#bn.set(e,i);return i}get black(){return this.#yn.black}get bold(){return this.#yn.bold}get disableFontFace(){return this.#yn.disableFontFace}set disableFontFace(t){util_shadow(this,"disableFontFace",!!t)}get fontExtraProperties(){return this.#yn.fontExtraProperties}get isInvalidPDFjsFont(){return this.#yn.isInvalidPDFjsFont}get isType3Font(){return this.#yn.isType3Font}get italic(){return this.#yn.italic}get missingFile(){return this.#yn.missingFile}get remeasure(){return this.#yn.remeasure}get vertical(){return this.#yn.vertical}get bbox(){return this.#yn.bbox}get fontMatrix(){return this.#yn.fontMatrix}get fallbackName(){return this.#yn.fallbackName}get loadedName(){return this.#yn.loadedName}get mimetype(){return this.missingFile?null:"font/opentype"}get data(){return this.#yn.data}clearData(){this.#yn.clearData()}get cssFontInfo(){return this.#yn.cssFontInfo}get systemFontInfo(){return this.#yn.systemFontInfo}}class CSS_FONT_INFO{static strings=["fontFamily","fontWeight","italicAngle"]}class SYSTEM_FONT_INFO{static strings=["css","loadedName","baseFontName","src"]}class FONT_INFO{static bools=["black","bold","disableFontFace","fontExtraProperties","isInvalidPDFjsFont","isType3Font","italic","missingFile","remeasure","vertical"];static strings=["fallbackName","loadedName"];static OFFSET_BBOX=Math.ceil(2*this.bools.length/8);static OFFSET_FONT_MATRIX=this.OFFSET_BBOX+1+8;static OFFSET_STRINGS=this.OFFSET_FONT_MATRIX+1+48}class PATTERN_INFO{static KIND=0;static HAS_BBOX=1;static HAS_BACKGROUND=2;static SHADING_TYPE=3;static N_COORD=4;static N_COLOR=8;static N_STOP=12;static N_FIGURES=16}class InfoUtils{static get decoder(){return util_shadow(this,"decoder",new TextDecoder)}static get encoder(){return util_shadow(this,"encoder",new TextEncoder)}}function readString(t,e,i,n=0){const{decoder:r}=InfoUtils;for(let t=0;t>i&3;return 0===n?void 0:2===n}get black(){return util_shadow(this,"black",this.#An(0))}get bold(){return util_shadow(this,"bold",this.#An(1))}get disableFontFace(){return util_shadow(this,"disableFontFace",this.#An(2))}get fontExtraProperties(){return util_shadow(this,"fontExtraProperties",this.#An(3))}get isInvalidPDFjsFont(){return util_shadow(this,"isInvalidPDFjsFont",this.#An(4))}get isType3Font(){return util_shadow(this,"isType3Font",this.#An(5))}get italic(){return util_shadow(this,"italic",this.#An(6))}get missingFile(){return util_shadow(this,"missingFile",this.#An(7))}get remeasure(){return util_shadow(this,"remeasure",this.#An(8))}get vertical(){return util_shadow(this,"vertical",this.#An(9))}#xn(t,e,i,n){const r=this.#vn.getUint8(t++);if(0===r)return;util_assert(r===e,"Invalid array length.");const s=new Array(r);for(let e=0;e0){e=pi.slice();for(let t=0,i=l.length;t"object"==typeof t&&Number.isInteger(t?.num)&&t.num>=0&&Number.isInteger(t?.gen)&&t.gen>=0,Cn=function _isValidExplicitDest(t,e,i){if(!Array.isArray(i)||i.length<2)return!1;const[n,r,...s]=i;if(!t(n)&&!Number.isInteger(n))return!1;if(!e(r))return!1;const a=s.length;let o=!0;switch(r.name){case"XYZ":if(a<2||a>3)return!1;break;case"Fit":case"FitB":return 0===a;case"FitH":case"FitBH":case"FitV":case"FitBV":if(a>1)return!1;break;case"FitR":if(4!==a)return!1;o=!1;break;default:return!1}for(const t of s)if(!("number"==typeof t||o&&null===t))return!1;return!0}.bind(null,isRefProxy,t=>"object"==typeof t&&"string"==typeof t?.name);class LoopbackPort{#Cn=new Map;#Sn=Promise.resolve();postMessage(t,e){const i={data:structuredClone(t,e?{transfer:e}:null)};this.#Sn.then(()=>{for(const[t]of this.#Cn)t.call(this,i)})}addEventListener(t,e,i=null){let n=null;if(i?.signal instanceof AbortSignal){const{signal:r}=i;if(r.aborted){warn("LoopbackPort - cannot use an `aborted` signal.");return}const onAbort=()=>this.removeEventListener(t,e);n=()=>r.removeEventListener("abort",onAbort);r.addEventListener("abort",onAbort)}this.#Cn.set(e,n)}removeEventListener(t,e){const i=this.#Cn.get(e);i?.();this.#Cn.delete(e)}terminate(){for(const[,t]of this.#Cn)t?.();this.#Cn.clear()}}Xe();const Sn=1,Tn=2,kn=1,Dn=2,Pn=3,Mn=4,In=5,Fn=6,On=7,Rn=8;function onFn(){}function wrapReason(t){if(t instanceof AbortException||t instanceof InvalidPDFException||t instanceof PasswordException||t instanceof ResponseException||t instanceof UnknownErrorException)return t;t instanceof Error||"object"==typeof t&&null!==t||unreachable('wrapReason: Expected "reason" to be a (possibly cloned) Error.');switch(t.name){case"AbortException":return new AbortException(t.message);case"InvalidPDFException":return new InvalidPDFException(t.message);case"PasswordException":return new PasswordException(t.message,t.code);case"ResponseException":return new ResponseException(t.message,t.status,t.missing);case"UnknownErrorException":return new UnknownErrorException(t.message,t.details)}return new UnknownErrorException(t.message,t.toString())}class MessageHandler{#Tn=new Map;#kn=new Map;#Dn=1;#Pn;#Mn=new AbortController;#In;#Fn=new Map;#On=1;#Rn=new Map;#Bn;constructor(t,e,i){this.#In=t;this.#Bn=e;this.#Pn=i;i.addEventListener("message",this.#Ln.bind(this),{signal:this.#Mn.signal})}#Ln({data:t}){if(t.targetName!==this.#In)return;if(t.stream){this.#Nn(t);return}if(t.callback){const{callbackId:e,callback:i}=t,n=this.#kn.get(e);if(!n)throw new Error(`Cannot resolve callback ${e}`);this.#kn.delete(e);if(i===Sn)n.resolve(t.data);else{if(i!==Tn)throw new Error("Unexpected callback case");n.reject(wrapReason(t.reason))}return}const e=this.#Tn.get(t.action);if(!e)throw new Error(`Unknown action from worker: ${t.action}`);if(t.callbackId){const i=this.#In,n=t.sourceName,r=this.#Pn;Promise.try(e,t.data).then(e=>{r.postMessage({sourceName:i,targetName:n,callback:Sn,callbackId:t.callbackId,data:e})},e=>{r.postMessage({sourceName:i,targetName:n,callback:Tn,callbackId:t.callbackId,reason:wrapReason(e)})});return}t.streamId?this.#Un(t):e(t.data)}on(t,e){const i=this.#Tn;if(i.has(t))throw new Error(`There is already a "${t}" handler.`);i.set(t,e)}send(t,e,i){this.#Pn.postMessage({sourceName:this.#In,targetName:this.#Bn,action:t,data:e},i)}sendWithPromise(t,e,i){const n=this.#Dn++,r=Promise.withResolvers();this.#kn.set(n,r);try{this.#Pn.postMessage({sourceName:this.#In,targetName:this.#Bn,action:t,callbackId:n,data:e},i)}catch(t){r.reject(t)}return r.promise}sendWithStream(t,e,i,n){const r=this.#On++,s=this.#In,a=this.#Bn,o=this.#Pn;return new ReadableStream({start:i=>{const l=Promise.withResolvers();this.#Fn.set(r,{controller:i,startCall:l,pullCall:null,cancelCall:null,isClosed:!1});o.postMessage({sourceName:s,targetName:a,action:t,streamId:r,data:e,desiredSize:i.desiredSize},n);return l.promise},pull:t=>{const e=Promise.withResolvers();this.#Fn.get(r).pullCall=e;o.postMessage({sourceName:s,targetName:a,stream:Fn,streamId:r,desiredSize:t.desiredSize});return e.promise},cancel:t=>{util_assert(t instanceof Error,"cancel must have a valid reason");const e=Promise.withResolvers();this.#Fn.get(r).cancelCall=e;this.#Fn.get(r).isClosed=!0;o.postMessage({sourceName:s,targetName:a,stream:kn,streamId:r,reason:wrapReason(t)});return e.promise}},i)}#Un(t){const e=t.streamId,i=this.#In,n=t.sourceName,r=this.#Pn,s=this.#Rn,a=this.#Tn.get(t.action),o={enqueue(t,s=1,a){if(this.isCancelled)return;const o=this.desiredSize;this.desiredSize-=s;if(o>0&&this.desiredSize<=0){this.sinkCapability=Promise.withResolvers();this.ready=this.sinkCapability.promise}r.postMessage({sourceName:i,targetName:n,stream:Mn,streamId:e,chunk:t},a)},close(){if(!this.isCancelled){this.isCancelled=!0;r.postMessage({sourceName:i,targetName:n,stream:Pn,streamId:e});s.delete(e)}},error(t){util_assert(t instanceof Error,"error must have a valid reason");if(!this.isCancelled){this.isCancelled=!0;r.postMessage({sourceName:i,targetName:n,stream:In,streamId:e,reason:wrapReason(t)})}},sinkCapability:Promise.withResolvers(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:t.desiredSize,ready:null};o.sinkCapability.resolve();o.ready=o.sinkCapability.promise;s.set(e,o);Promise.try(a,t.data,o).then(()=>{r.postMessage({sourceName:i,targetName:n,stream:Rn,streamId:e,success:!0})},t=>{r.postMessage({sourceName:i,targetName:n,stream:Rn,streamId:e,reason:wrapReason(t)})})}#Nn(t){const e=t.streamId,i=this.#In,n=t.sourceName,r=this.#Pn,s=this.#Fn.get(e),a=this.#Rn.get(e);switch(t.stream){case Rn:t.success?s.startCall.resolve():s.startCall.reject(wrapReason(t.reason));break;case On:t.success?s.pullCall.resolve():s.pullCall.reject(wrapReason(t.reason));break;case Fn:if(!a){r.postMessage({sourceName:i,targetName:n,stream:On,streamId:e,success:!0});break}a.desiredSize<=0&&t.desiredSize>0&&a.sinkCapability.resolve();a.desiredSize=t.desiredSize;Promise.try(a.onPull||onFn).then(()=>{r.postMessage({sourceName:i,targetName:n,stream:On,streamId:e,success:!0})},t=>{r.postMessage({sourceName:i,targetName:n,stream:On,streamId:e,reason:wrapReason(t)})});break;case Mn:util_assert(s,"enqueue should have stream controller");if(s.isClosed)break;s.controller.enqueue(t.chunk);break;case Pn:util_assert(s,"close should have stream controller");if(s.isClosed)break;s.isClosed=!0;s.controller.close();this.#Hn(s,e);break;case In:util_assert(s,"error should have stream controller");s.controller.error(wrapReason(t.reason));this.#Hn(s,e);break;case Dn:t.success?s.cancelCall.resolve():s.cancelCall.reject(wrapReason(t.reason));this.#Hn(s,e);break;case kn:if(!a)break;const o=wrapReason(t.reason);Promise.try(a.onCancel||onFn,o).then(()=>{r.postMessage({sourceName:i,targetName:n,stream:Dn,streamId:e,success:!0})},t=>{r.postMessage({sourceName:i,targetName:n,stream:Dn,streamId:e,reason:wrapReason(t)})});a.sinkCapability.reject(o);a.isCancelled=!0;this.#Rn.delete(e);break;default:throw new Error("Unexpected stream case")}}async#Hn(t,e){await Promise.allSettled([t.startCall?.promise,t.pullCall?.promise,t.cancelCall?.promise]);this.#Fn.delete(e)}destroy(){this.#Mn?.abort();this.#Mn=null}}class BaseBinaryDataFactory{#zn=Object.freeze({cMapUrl:"CMap",standardFontDataUrl:"font",wasmUrl:"wasm"});constructor({cMapUrl:t=null,standardFontDataUrl:e=null,wasmUrl:i=null}){this.cMapUrl=t;this.standardFontDataUrl=e;this.wasmUrl=i}async fetch({kind:t,filename:e}){switch(t){case"cMapUrl":case"standardFontDataUrl":case"wasmUrl":break;default:unreachable(`Not implemented: ${t}`)}const i=this[t];if(!i)throw new Error(`Ensure that the \`${t}\` API parameter is provided.`);const n=`${i}${e}`;return this._fetch(n,t).catch(e=>{throw new Error(`Unable to load ${this.#zn[t]} data at: ${n}`)})}async _fetch(t,e){unreachable("Abstract method `_fetch` called.")}}class DOMBinaryDataFactory extends BaseBinaryDataFactory{async _fetch(t,e){const i="cMapUrl"!==e||t.endsWith(".bcmap")?"bytes":"text",n=await fetchData(t,i);return n instanceof Uint8Array?n:stringToBytes(n)}}class BaseCanvasFactory{#Gn=!1;constructor({enableHWA:t=!1}){this.#Gn=t}create(t,e){if(t<=0||e<=0)throw new Error("Invalid canvas size");const i=this._createCanvas(t,e);return{canvas:i,context:i.getContext("2d",{willReadFrequently:!this.#Gn})}}reset({canvas:t},e,i){if(!t)throw new Error("Canvas is not specified");if(e<=0||i<=0)throw new Error("Invalid canvas size");t.width=e;t.height=i}destroy(t){const{canvas:e}=t;if(!e)throw new Error("Canvas is not specified");e.width=e.height=0;t.canvas=null;t.context=null}_createCanvas(t,e){unreachable("Abstract method `_createCanvas` called.")}}class DOMCanvasFactory extends BaseCanvasFactory{constructor({ownerDocument:t=globalThis.document,enableHWA:e=!1}){super({enableHWA:e});this._document=t}_createCanvas(t,e){const i=this._document.createElement("canvas");i.width=t;i.height=e;return i}}class BaseFilterFactory{addFilter(t){return"none"}addHCMFilter(t,e){return"none"}addAlphaFilter(t){return"none"}addLuminosityFilter(t){return"none"}addKnockoutFilter(t=0){return"none"}addHighlightHCMFilter(t,e,i,n,r){return"none"}addSelectionHCMFilter(t,e){return"none"}addSelectionFilter(){return"none"}createSelectionStyle(t=null){return null}destroy(t=!1){}}class DOMFilterFactory extends BaseFilterFactory{#jn;#Wn;#Vn;#$n;#qn;#Xn;#T=0;constructor({docId:t,ownerDocument:e=globalThis.document}){super();this.#$n=t;this.#qn=e}get#D(){return this.#Wn||=new Map}get#Kn(){return this.#Xn||=new Map}get#Yn(){if(!this.#Vn){const t=this.#qn.createElement("div"),{style:e}=t;e.colorScheme="only light";e.visibility="hidden";e.contain="strict";e.width=e.height=0;e.position="absolute";e.top=e.left=0;e.zIndex=-1;const i=this.#qn.createElementNS(mi,"svg");i.setAttribute("width",0);i.setAttribute("height",0);this.#Vn=this.#qn.createElementNS(mi,"defs");t.append(i);i.append(this.#Vn);this.#qn.body.append(t)}return this.#Vn}#Jn(t){const toTable=t=>t&&Array.from(t,t=>t/255).join(",");if(1===t.length){const e=toTable(t[0]);return[e,e,e]}const[e,i,n]=t;return[toTable(e),toTable(i),toTable(n)]}#Qn(t){if(void 0===this.#jn){this.#jn="";const t=this.#qn.URL;t!==this.#qn.baseURI&&(isDataScheme(t)?warn('#createUrl: ignore "data:"-URL for performance reasons.'):this.#jn=updateUrlHash(t,""))}return`url(${this.#jn}#${t})`}addFilter(t){if(!t)return"none";let e=this.#D.get(t);if(e)return e;const[i,n,r]=this.#Jn(t),s=1===t.length?i:`${i}${n}${r}`;e=this.#D.get(s);if(e){this.#D.set(t,e);return e}const a=`g_${this.#$n}_transfer_map_${this.#T++}`,o=this.#Qn(a);this.#D.set(t,o);this.#D.set(s,o);const l=this.#Zn(a);this.#tr(i,n,r,l);return o}addHCMFilter(t,e){const i=`${t}-${e}`,n="base";let r=this.#Kn.get(n);if(r?.key===i)return r.url;if(r){r.filter?.remove();r.key=i;r.url="none";r.filter=null}else{r={key:i,url:"none",filter:null};this.#Kn.set(n,r)}if(!t||!e)return r.url;const s=this.#er(t);t=Util.makeHexColor(...s);const a=this.#er(e);e=Util.makeHexColor(...a);this.#ir();if("#000000"===t&&"#ffffff"===e||t===e)return r.url;const o=Array.from({length:256},(t,e)=>computeLuminance(e/255)).join(","),l=`g_${this.#$n}_hcm_filter`,c=r.filter=this.#Zn(l);this.#tr(o,o,o,c);this.#nr(c);const getSteps=(t,e)=>{const i=s[t]/255,n=a[t]/255,r=new Array(e+1);for(let t=0;t<=e;t++)r[t]=i+t/e*(n-i);return r.join(",")};this.#tr(getSteps(0,5),getSteps(1,5),getSteps(2,5),c);r.url=this.#Qn(l);return r.url}addSelectionHCMFilter(t,e){return this.addHighlightHCMFilter("selection",t,e,"HighlightText","Highlight")}addSelectionFilter(){return this.addHighlightHCMFilter("selection_default","black","white","HighlightText","Highlight")}createSelectionStyle(t=null){const e=t?this.addSelectionHCMFilter(t.foreground,t.background):this.addSelectionFilter();return"none"!==e&&FeatureTest.platform.isFirefox?{"backdrop-filter":e,"background-color":"transparent"}:null}addAlphaFilter(t){let e=this.#D.get(t);if(e)return e;const[i]=this.#Jn([t]),n=`alpha_${i}`;e=this.#D.get(n);if(e){this.#D.set(t,e);return e}const r=`g_${this.#$n}_alpha_map_${this.#T++}`,s=this.#Qn(r);this.#D.set(t,s);this.#D.set(n,s);const a=this.#Zn(r);this.#rr(i,a);return s}addLuminosityFilter(t){let e,i,n=this.#D.get(t||"luminosity");if(n)return n;if(t){[e]=this.#Jn([t]);i=`luminosity_${e}`}else i="luminosity";n=this.#D.get(i);if(n){this.#D.set(t,n);return n}const r=`g_${this.#$n}_luminosity_map_${this.#T++}`,s=this.#Qn(r);this.#D.set(t,s);this.#D.set(i,s);const a=this.#Zn(r);this.#sr(a);t&&this.#rr(e,a);return s}addKnockoutFilter(t=0){const e=t>0?Math.min(1/t,1e6):1e6,i=`knockout_${e}`,n=this.#D.get(i);if(n)return n;const r=`g_${this.#$n}_knockout_filter_${this.#T++}`,s=this.#Qn(r);this.#D.set(i,s);const a=this.#Zn(r),o=this.#qn.createElementNS(mi,"feComponentTransfer");a.append(o);const l=this.#qn.createElementNS(mi,"feFuncA");l.setAttribute("type","linear");l.setAttribute("slope",`${e}`);l.setAttribute("intercept","0");o.append(l);return s}addHighlightHCMFilter(t,e,i,n,r){const s=`${e}-${i}-${n}-${r}`;let a=this.#Kn.get(t);if(a?.key===s)return a.url;if(a){a.filter?.remove();a.key=s;a.url="none";a.filter=null}else{a={key:s,url:"none",filter:null};this.#Kn.set(t,a)}if(!e||!i)return a.url;const[o,l]=[e,i].map(this.#er.bind(this));let c=Math.round(.2126*o[0]+.7152*o[1]+.0722*o[2]),h=Math.round(.2126*l[0]+.7152*l[1]+.0722*l[2]),[d,u]=[n,r].map(this.#ar.bind(this));h{const n=new Array(256),r=(h-c)/i,s=t/255,a=(e-t)/(255*i);let o=0;for(let t=0;t<=i;t++){const e=Math.round(c+t*r),i=s+t*a;for(let t=o;t<=e;t++)n[t]=i;o=e+1}for(let t=o;t<256;t++)n[t]=n[o-1];return n.join(",")},p=`g_${this.#$n}_hcm_${t}_filter`,g=a.filter=this.#Zn(p);this.#nr(g);this.#tr(getSteps(d[0],u[0],5),getSteps(d[1],u[1],5),getSteps(d[2],u[2],5),g);a.url=this.#Qn(p);return a.url}destroy(t=!1){if(!t||!this.#Xn?.size){this.#Vn?.parentNode.parentNode.remove();this.#Vn=null;this.#Wn?.clear();this.#Wn=null;this.#Xn?.clear();this.#Xn=null;this.#T=0}}#sr(t){const e=this.#qn.createElementNS(mi,"feColorMatrix");e.setAttribute("type","matrix");e.setAttribute("values","0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.3 0.59 0.11 0 0");t.append(e)}#nr(t){const e=this.#qn.createElementNS(mi,"feColorMatrix");e.setAttribute("type","matrix");e.setAttribute("values","0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0 0 0 1 0");t.append(e)}#Zn(t){const e=this.#qn.createElementNS(mi,"filter");e.setAttribute("color-interpolation-filters","sRGB");e.setAttribute("id",t);this.#Yn.append(e);return e}#or(t,e,i){if(!i)return;const n=this.#qn.createElementNS(mi,e);n.setAttribute("type","discrete");n.setAttribute("tableValues",i);t.append(n)}#tr(t,e,i,n){const r=this.#qn.createElementNS(mi,"feComponentTransfer");n.append(r);this.#or(r,"feFuncR",t);this.#or(r,"feFuncG",e);this.#or(r,"feFuncB",i)}#rr(t,e){const i=this.#qn.createElementNS(mi,"feComponentTransfer");e.append(i);this.#or(i,"feFuncA",t)}#er(t){this.#Yn.style.color="CanvasText";this.#Yn.style.backgroundColor=t;return getRGB(getComputedStyle(this.#Yn).getPropertyValue("background-color"))}#lr(t){this.#Yn.style.color="CanvasText";this.#Yn.style.backgroundColor=t;return getRGBA(getComputedStyle(this.#Yn).getPropertyValue("background-color"))}#ir(){this.#Yn.style.color="";this.#Yn.style.backgroundColor=""}#ar(t){const[e,i,n,r]=this.#lr(t);if(1===r)return[e,i,n];const[s,a,o]=this.#er("Canvas");return[blend(e,s,r),blend(i,a,r),blend(n,o,r)]}}function blend(t,e,i){return Math.round(i*t+(1-i)*e)}if(ui){let t;try{const e=process.getBuiltinModule("module").createRequire(import.meta.url);try{t=e("@napi-rs/canvas")}catch(t){warn(`Cannot load "@napi-rs/canvas" package: "${t}".`)}}catch(t){warn(`Cannot access the \`require\` function: "${t}".`)}globalThis.DOMMatrix||(t?.DOMMatrix?globalThis.DOMMatrix=t.DOMMatrix:warn("Cannot polyfill `DOMMatrix`, rendering may be broken."));globalThis.Path2D||(t?.Path2D?globalThis.Path2D=t.Path2D:warn("Cannot polyfill `Path2D`, rendering may be broken."));globalThis.navigator?.language||(globalThis.navigator={language:"en-US",platform:"",userAgent:""})}class NodeFilterFactory extends BaseFilterFactory{}class NodeCanvasFactory extends BaseCanvasFactory{_createCanvas(t,e){return process.getBuiltinModule("module").createRequire(import.meta.url)("@napi-rs/canvas").createCanvas(t,e)}}class NodeBinaryDataFactory extends BaseBinaryDataFactory{async _fetch(t,e){return async function node_utils_fetchData(t){const e=process.getBuiltinModule("fs/promises"),i=await e.readFile(t);return new Uint8Array(i)}(t)}}function convertBlackAndWhiteToRGBA({src:t,srcPos:e=0,dest:i,width:n,height:r,nonBlackColor:s=4294967295,inverseDecode:a=!1}){const o=FeatureTest.isLittleEndian?4278190080:255,[l,c]=a?[s,o]:[o,s],h=n>>3,d=7&n,u=l^c,p=t.length;i=new Uint32Array(i.buffer);let g=0;for(let n=0;n>7&1)&u;i[g+1]=l^-(n>>6&1)&u;i[g+2]=l^-(n>>5&1)&u;i[g+3]=l^-(n>>4&1)&u;i[g+4]=l^-(n>>3&1)&u;i[g+5]=l^-(n>>2&1)&u;i[g+6]=l^-(n>>1&1)&u;i[g+7]=l^-(1&n)&u}if(0===d)continue;const n=e>7-t&1)&u}return{srcPos:e,destPos:g}}function convertRGBToRGBA({src:t,srcPos:e=0,dest:i,destPos:n=0,width:r,height:s}){let a=0;const o=r*s*3,l=o>>2,c=new Uint32Array(t.buffer,e,l),h=FeatureTest.isLittleEndian?4278190080:255;if(FeatureTest.isLittleEndian){for(;a>>24|e<<8|h;i[n+2]=e>>>16|r<<16|h;i[n+3]=r>>>8|h}for(let r=e+4*a,s=e+o;r>>8|h;i[n+2]=e<<16|r>>>16|h;i[n+3]=r<<8|h}for(let r=e+4*a,s=e+o;r u : Uniforms;\n\nstruct VertexInput {\n @location(0) position : vec2,\n @location(1) color : vec4,\n};\n\nstruct VertexOutput {\n @builtin(position) position : vec4,\n @location(0) color : vec3,\n};\n\n@vertex\nfn vs_main(in : VertexInput) -> VertexOutput {\n var out : VertexOutput;\n let cx = (in.position.x + u.offsetX) * u.scaleX;\n let cy = (in.position.y + u.offsetY) * u.scaleY;\n out.position = vec4(\n ((cx + u.borderSize) / u.paddedWidth) * 2.0 - 1.0,\n 1.0 - ((cy + u.borderSize) / u.paddedHeight) * 2.0,\n 0.0,\n 1.0\n );\n out.color = in.color.rgb;\n return out;\n}\n\n@fragment\nfn fs_main(in : VertexOutput) -> @location(0) vec4 {\n return vec4(in.color, 1.0);\n}\n"});this.#dr=this.#hr.createRenderPipeline({layout:"auto",vertex:{module:t,entryPoint:"vs_main",buffers:[{arrayStride:8,attributes:[{shaderLocation:0,offset:0,format:"float32x2"}]},{arrayStride:4,attributes:[{shaderLocation:1,offset:0,format:"unorm8x4"}]}]},fragment:{module:t,entryPoint:"fs_main",targets:[{format:this.#ur}]},primitive:{topology:"triangle-list"}})}draw(t,e,i,n,r,s,a,o){this.loadMeshShader();const l=this.#hr,{offsetX:c,offsetY:h,scaleX:d,scaleY:u}=n,p=l.createBuffer({size:Math.max(t.byteLength,4),usage:GPUBufferUsage.VERTEX|GPUBufferUsage.COPY_DST});t.byteLength>0&&l.queue.writeBuffer(p,0,t);const g=l.createBuffer({size:Math.max(e.byteLength,4),usage:GPUBufferUsage.VERTEX|GPUBufferUsage.COPY_DST});e.byteLength>0&&l.queue.writeBuffer(g,0,e);const f=l.createBuffer({size:32,usage:GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST});l.queue.writeBuffer(f,0,new Float32Array([c,h,d,u,s,a,o,0]));const m=l.createBindGroup({layout:this.#dr.getBindGroupLayout(0),entries:[{binding:0,resource:{buffer:f}}]}),b=new OffscreenCanvas(s,a),y=b.getContext("webgpu");y.configure({device:l,format:this.#ur,alphaMode:r?"opaque":"premultiplied"});const w=r?{r:r[0]/255,g:r[1]/255,b:r[2]/255,a:1}:{r:0,g:0,b:0,a:0},v=l.createCommandEncoder(),_=v.beginRenderPass({colorAttachments:[{view:y.getCurrentTexture().createView(),clearValue:w,loadOp:"clear",storeOp:"store"}]});if(i>0){_.setPipeline(this.#dr);_.setBindGroup(0,m);_.setVertexBuffer(0,p);_.setVertexBuffer(1,g);_.draw(i)}_.end();l.queue.submit([v.finish()]);p.destroy();g.destroy();f.destroy();return b.transferToImageBitmap()}};const Ln="Fill",Nn="Stroke",Un="Shading";function applyBoundingBox(t,e){if(!e)return;const i=e[2]-e[0],n=e[3]-e[1],r=new Path2D;r.rect(e[0],e[1],i,n);t.clip(r)}class BaseShadingPattern{matrix=null;isModifyingCurrentTransform(){return!1}getPattern(){unreachable("Abstract method `getPattern` called.")}}class RadialAxialShadingPattern extends BaseShadingPattern{constructor(t){super();this._type=t[1];this._bbox=t[2];this._colorStops=t[3];this._p0=t[4];this._p1=t[5];this._r0=t[6];this._r1=t[7]}isOriginBased(){return 0===this._p0[0]&&0===this._p0[1]&&(!this.isRadial()||0===this._p1[0]&&0===this._p1[1])}isRadial(){return"radial"===this._type}areConic(){if(!this.isRadial())return!1;const t=Math.hypot(this._p0[0]-this._p1[0],this._p0[1]-this._p1[1]);return t+this._r1>this._r0&&t+this._r0>this._r1}_createGradient(t,e=null){let i,n=this._p0,r=this._p1;if(e){n=n.slice();r=r.slice();Util.applyTransform(n,e);Util.applyTransform(r,e)}if("axial"===this._type)i=t.createLinearGradient(n[0],n[1],r[0],r[1]);else if("radial"===this._type){let s=this._r0,a=this._r1;if(e){const t=new Float32Array(2);Util.singularValueDecompose2dScale(e,t);s*=t[0];a*=t[0]}i=t.createRadialGradient(n[0],n[1],s,r[0],r[1],a)}for(const t of this._colorStops)i.addColorStop(t[0],t[1]);return i}_createReversedGradient(t,e=null){let i=this._p1,n=this._p0;if(e){i=i.slice();n=n.slice();Util.applyTransform(i,e);Util.applyTransform(n,e)}let r=this._r1,s=this._r0;if(e){const t=new Float32Array(2);Util.singularValueDecompose2dScale(e,t);r*=t[0];s*=t[0]}const a=t.createRadialGradient(i[0],i[1],r,n[0],n[1],s),o=this._colorStops.map(([t,e])=>[1-t,e]).reverse();for(const[t,e]of o)a.addColorStop(t,e);return a}_createRasterPattern(t,e,i,n,r,s){const a=Math.ceil(n[2]-n[0])||1,o=Math.ceil(n[3]-n[1])||1,l=e.canvasFactory.create(a,o),c=l.context;c.clearRect(0,0,a,o);c.beginPath();c.rect(0,0,a,o);c.translate(-n[0],-n[1]);i=Util.transform(i,[1,0,0,1,n[0],n[1]]);c.transform(...r);applyBoundingBox(c,this._bbox);if(this.areConic()){c.fillStyle=this._createReversedGradient(c);c.fill()}c.fillStyle=this._createGradient(c);c.fill();s?.applyToCanvas(c);const h=t.createPattern(l.canvas,"no-repeat");e.canvasFactory.destroy(l);h.setTransform(new DOMMatrix(i));return h}getPattern(t,e,i,n){const r=e.current.transferMapsFallback;if(n===Nn||n===Ln){if(this.isOriginBased()&&!r){let n=Util.transform(i,e.baseTransform);this.matrix&&(n=Util.transform(n,this.matrix));const r=.001,s=Math.hypot(n[0],n[1]),a=Math.hypot(n[2],n[3]),o=(n[0]*n[2]+n[1]*n[3])/(s*a);if(Math.abs(o)l[2*n+1]){u=i;i=n;n=u;u=s;s=a;a=u}if(l[2*n+1]>l[2*r+1]){u=n;n=r;r=u;u=a;a=o;o=u}if(l[2*i+1]>l[2*n+1]){u=i;i=n;n=u;u=s;s=a;a=u}const p=(l[2*i]+e.offsetX)*e.scaleX,g=(l[2*i+1]+e.offsetY)*e.scaleY,f=(l[2*n]+e.offsetX)*e.scaleX,m=(l[2*n+1]+e.offsetY)*e.scaleY,b=(l[2*r]+e.offsetX)*e.scaleX,y=(l[2*r+1]+e.offsetY)*e.scaleY;if(g>=y)return;const w=c[4*s],v=c[4*s+1],_=c[4*s+2],A=c[4*a],x=c[4*a+1],E=c[4*a+2],C=c[4*o],S=c[4*o+1],T=c[4*o+2],k=Math.round(g),D=Math.round(y);let P,M,I,O,R,B,L,N;for(let t=k;t<=D;t++){if(ty?1:m===y?0:(m-t)/(m-y);P=f-(f-b)*e;M=A-(A-C)*e;I=x-(x-S)*e;O=E-(E-T)*e}let e;e=ty?1:(g-t)/(g-y);R=p-(p-b)*e;B=w-(w-C)*e;L=v-(v-S)*e;N=_-(_-T)*e;const i=Math.round(Math.min(P,R)),n=Math.round(Math.max(P,R));let r=d*t+4*i;for(let t=i;t<=n;t++){e=(P-t)/(P-R);e<0?e=0:e>1&&(e=1);h[r++]=M-(M-B)*e|0;h[r++]=I-(I-L)*e|0;h[r++]=O-(O-N)*e|0;h[r++]=255}}}class MeshShadingPattern extends BaseShadingPattern{constructor(t){super();this._posData=t[2];this._colData=t[3];this._vertexCount=t[4];this._bounds=t[5];this._bbox=t[6];this._background=t[7];!function loadMeshShader(){Bn.loadMeshShader()}()}_createMeshCanvas(t,e,i,n=null){const r=Math.floor(this._bounds[0]),s=Math.floor(this._bounds[1]),a=Math.ceil(this._bounds[2])-r,o=Math.ceil(this._bounds[3])-s,l=Math.min(Math.ceil(Math.abs(a*t[0]*1.1)),3e3)||1,c=Math.min(Math.ceil(Math.abs(o*t[1]*1.1)),3e3)||1,h=a?a/l:1,d=o?o/c:1,u={coords:this._posData,colors:this._colData,offsetX:-r,offsetY:-s,scaleX:1/h,scaleY:1/d},p=l+4,g=c+4,f=i.create(p,g);if(function isGPUReady(){return Bn.isReady}()&&this._vertexCount>48)f.context.drawImage(function drawMeshWithGPU(t,e,i,n,r,s,a,o){return Bn.draw(t,e,i,n,r,s,a,o)}(this._posData,this._colData,this._vertexCount,u,e,p,g,2),0,0);else{const t=f.context.createImageData(l,c);if(e){const i=t.data;for(let t=0,n=i.length;tl+1e-6||e>c+1e-6)return null;const h=Math.floor((i-a)/l)+1,d=Math.ceil((i+t-r)/l)-1,u=Math.floor((n-o)/c)+1,p=Math.ceil((n+e-s)/c)-1;return d<=h&&p<=u?[h,u]:null}updatePatternDims(t,e){const i=pi.slice();Util.axialAlignedBoundingBox(t,Util.inverseTransform(this.patternBaseMatrix),i);e[0]=i[2]-i[0];e[1]=i[3]-i[1];e[2]=i[0];e[3]=i[1]}_renderTileCanvas(t,e,i,n){const[r,s,a,o]=this.bbox,l=t.canvasFactory.create(i.size,n.size),c=l.context,h=this.canvasGraphicsFactory.createCanvasGraphics(c,e);h.groupLevel=t.groupLevel;h.current.transferMapsFallback=t.current.transferMapsFallback;this.setFillAndStrokeStyleToContext(h,this.paintType,this.color);c.translate(-i.scale*r,-n.scale*s);h.transform(0,i.scale,0,0,n.scale,0,0);c.save();h.dependencyTracker?.save();this.clipBbox(h,r,s,a,o);h.baseTransform=getCurrentTransform(h.ctx);h.executeOperatorList(this.operatorList);h.endDrawing();h.dependencyTracker?.restore();c.restore();return l}_getCombinedScales(){const t=new Float32Array(2);Util.singularValueDecompose2dScale(this.matrix,t);const[e,i]=t;Util.singularValueDecompose2dScale(this.baseTransform,t);return[e*t[0],i*t[1]]}drawPattern(t,e,i=!1,[n,r],s){const[a,o,l,c]=this.bbox,h=t.dependencyTracker;h&&(t.dependencyTracker=new CanvasNestedDependencyTracker(h,s));t.save();i?t.ctx.clip(e,"evenodd"):t.ctx.clip(e);t.ctx.setTransform(...this.patternBaseMatrix);t.ctx.translate(n*this.xstep,r*this.ystep);if(this.needsIsolation||1!==t.ctx.globalAlpha||"source-over"!==t.ctx.globalCompositeOperation||t.inSMaskMode){const e=l-a,i=c-o,[n,r]=this._getCombinedScales(),h=this.getSizeAndScale(e,this.ctx.canvas.width,n),d=this.getSizeAndScale(i,this.ctx.canvas.height,r),u=this._renderTileCanvas(t,s,h,d);t.ctx.drawImage(u.canvas,a,o,e,i);t.canvasFactory.destroy(u)}else{this.setFillAndStrokeStyleToContext(t,this.paintType,this.color);this.clipBbox(t,a,o,l,c);t.baseTransformStack.push(t.baseTransform);t.baseTransform=getCurrentTransform(t.ctx);t.executeOperatorList(this.operatorList);t.baseTransform=t.baseTransformStack.pop()}t.restore();h&&(t.dependencyTracker=h)}createPatternCanvas(t,e){const[i,n,r,s]=this.bbox,a=r-i,o=s-n;let{xstep:l,ystep:c}=this;l=Math.abs(l);c=Math.abs(c);info("TilingType: "+this.tilingType);const[h,d]=this._getCombinedScales();let u=a,p=o,g=!1,f=!1;Math.ceil(l*h)>=Math.ceil(a*h)?u=l:g=!0;Math.ceil(c*d)>=Math.ceil(o*d)?p=c:f=!0;const m=this.getSizeAndScale(u,this.ctx.canvas.width,h),b=this.getSizeAndScale(p,this.ctx.canvas.height,d),y=this._renderTileCanvas(t,e,m,b);if(g||f){const e=y.canvas;g&&(u=l);f&&(p=c);const r=this.getSizeAndScale(u,this.ctx.canvas.width,h),s=this.getSizeAndScale(p,this.ctx.canvas.height,d),m=r.size,b=s.size,w=t.canvasFactory.create(m,b),v=w.context,_=g?Math.min(Math.floor(a/l),Math.ceil(e.width/m)):0,A=f?Math.min(Math.floor(o/c),Math.ceil(e.height/b)):0;let x=e,E=null;if(f){E=t.canvasFactory.create(e.width,b);const i=E.context;for(let t=A;t>=0;t--)i.drawImage(e,0,b*t,e.width,b,0,0,e.width,b);x=E.canvas}for(let t=_;t>=0;t--)v.drawImage(x,m*t,0,m,b,0,0,m,b);E&&t.canvasFactory.destroy(E);t.canvasFactory.destroy(y);return{canvas:w.canvas,canvasEntry:w,scaleX:r.scale,scaleY:s.scale,offsetX:i,offsetY:n}}return{canvas:y.canvas,canvasEntry:y,scaleX:m.scale,scaleY:b.scale,offsetX:i,offsetY:n}}getSizeAndScale(t,e,i){const n=Math.max(TilingPattern.MAX_PATTERN_SIZE,e);let r=Math.ceil(t*i);r>=n?r=n:i=r/t;return{scale:i,size:r}}clipBbox(t,e,i,n,r){const s=n-e,a=r-i,o=new Path2D;o.rect(e,i,s,a);Util.axialAlignedBoundingBox([e,i,n,r],getCurrentTransform(t.ctx),t.current.minMax);t.ctx.clip(o);t.current.updateClipFromPath()}setFillAndStrokeStyleToContext(t,e,i){switch(e){case Hn:i="#000000";break;case zn:break;default:throw new FormatError(`Unsupported paint type: ${e}`)}const{ctx:n,current:r}=t;r.patternFill=r.patternStroke=!1;n.fillStyle=n.strokeStyle=r.transferMapsFallback?.applyToColor(i)??i;r.fillColor=r.strokeColor=i}isModifyingCurrentTransform(){return!1}getPattern(t,e,i,n,r){const s=n!==Un?Util.transform(i,this.patternBaseMatrix):i,a=this.createPatternCanvas(e,r);let o=new DOMMatrix(s);o=o.translate(a.offsetX,a.offsetY);o=o.scale(1/a.scaleX,1/a.scaleY);const l=t.createPattern(a.canvas,"repeat");e.canvasFactory.destroy(a.canvasEntry);l.setTransform(o);return l}}const Gn=16,jn=new Float32Array(2);function mirrorContextOperations(t,e){if(t._removeMirroring)throw new Error("Context is already forwarding operations.");const i=new Map;for(const n of["save","restore","rotate","scale","translate","transform","setTransform","resetTransform","clip","moveTo","lineTo","bezierCurveTo","quadraticCurveTo","arc","arcTo","ellipse","rect","roundRect","closePath","beginPath"]){const r=t[n];if("function"==typeof r&&"function"==typeof e[n]){i.set(n,r);t[n]=function(...t){e[n](...t);return r.apply(this,t)}}}t._removeMirroring=()=>{for(const[e,n]of i)t[e]=n;delete t._removeMirroring}}function drawImageAtIntegerCoords(t,e,i,n,r,s,a,o,l,c){const[h,d,u,p,g,f]=getCurrentTransform(t);if(0===d&&0===u){const m=a*h+g,b=Math.round(m),y=o*p+f,w=Math.round(y),v=(a+l)*h+g,_=Math.abs(Math.round(v)-b)||1,A=(o+c)*p+f,x=Math.abs(Math.round(A)-w)||1;t.setTransform(Math.sign(h),0,0,Math.sign(p),b,w);t.drawImage(e,i,n,r,s,0,0,_,x);t.setTransform(h,d,u,p,g,f);return[_,x]}if(0===h&&0===p){const m=o*u+g,b=Math.round(m),y=a*d+f,w=Math.round(y),v=(o+c)*u+g,_=Math.abs(Math.round(v)-b)||1,A=(a+l)*d+f,x=Math.abs(Math.round(A)-w)||1;t.setTransform(0,Math.sign(d),Math.sign(u),0,b,w);t.drawImage(e,i,n,r,s,0,0,x,_);t.setTransform(h,d,u,p,g,f);return[x,_]}t.drawImage(e,i,n,r,s,a,o,l,c);return[Math.hypot(h,d)*l,Math.hypot(u,p)*c]}class CanvasExtraState{alphaIsShape=!1;fontSize=0;fontSizeScale=1;textMatrix=null;textMatrixScale=1;fontMatrix=fi;leading=0;x=0;y=0;lineX=0;lineY=0;charSpacing=0;wordSpacing=0;textHScale=1;textRenderingMode=Mi;textRise=0;fillColor="#000000";strokeColor="#000000";tilingPatternDims=null;patternFill=!1;patternStroke=!1;fillAlpha=1;strokeAlpha=1;lineWidth=1;activeSMask=null;transferMaps="none";transferMapsFallback=null;minMax=gi.slice();constructor(t,e){this.clipBox=new Float32Array([0,0,t,e])}clone(){const t=Object.create(this);t.clipBox=this.clipBox.slice();t.minMax=this.minMax.slice();t.tilingPatternDims=this.tilingPatternDims?.slice();return t}getPathBoundingBox(t=Ln,e=null){const i=this.minMax.slice();if(t===Nn){e||unreachable("Stroke bounding box must include transform.");Util.singularValueDecompose2dScale(e,jn);const t=jn[0]*this.lineWidth/2,n=jn[1]*this.lineWidth/2;i[0]-=t;i[1]-=n;i[2]+=t;i[3]+=n}return i}updateClipFromPath(){const t=Util.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(t||[0,0,0,0])}isEmptyClip(){return this.minMax[0]===1/0}startNewPathAndClipBox(t){this.clipBox.set(t,0);this.minMax.set(gi,0)}getClippedPathBoundingBox(t=Ln,e=null){return Util.intersect(this.clipBox,this.getPathBoundingBox(t,e))}}function putBinaryImageData(t,e){const{width:i,height:n,kind:r}=e,s=n%Gn,a=(n-s)/Gn,o=0===s?a:a+1,l=t.createImageData(i,Gn);let c=0;const h=e.data,d=l.data;let u;if(r===Li.GRAYSCALE_1BPP)for(u=0;ue))}applyToColor(t){if("string"!=typeof t||!t.startsWith("#"))return t;const[e,i,n]=getRGBA(t),[r,s,a]=this.#gr;return Util.makeHexColor(r[e],s[i],a[n])}applyToImageData({data:t}){const[e,i,n]=this.#gr;for(let r=0,s=t.length;r10&&"function"==typeof i,h=c?Date.now()+15:0;let d=0;const u=this.commonObjs,p=this.objs;let g,f;for(;;){if(void 0!==n){if(o===n.nextBreakPoint){n.breakIt(o,i);return o}if(n.shouldSkip(o)){if(++o===l)return o;continue}}if(!r||r(o,t)){g=a[o];f=s[o]??null;if(g!==Vi.dependency)null===f?this[g](o):this[g](o,...f);else for(const t of f){this.dependencyTracker?.recordNamedData(t,o);const e=t.startsWith("g_")?u:p;if(!e.has(t)){e.get(t,i);return o}}}o++;if(o===l)return o;if(c&&++d>10){if(Date.now()>h){i();return o}d=0}}}#Sr(){for(;this.stateStack.length||this.inSMaskMode;)this.restore();this.current.activeSMask=null;this.ctx.restore();if(this.transparentCanvas){this.ctx=this.compositeCtx;this.ctx.save();this.ctx.setTransform(1,0,0,1,0,0);this.ctx.drawImage(this.transparentCanvas,0,0);this.ctx.restore();this.canvasFactory.destroy(this.transparentCanvasEntry);this.transparentCanvas=null;this.transparentCanvasEntry=null}}endDrawing(){this.#Sr();for(const t of this.smaskGroupCanvases)this.canvasFactory.destroy(t);this.smaskGroupCanvases.length=0;this._clearPreparedSMask();this.tempSMask=null;this.smaskStack.length=0;for(const t of this.#Cr)this.#Tr(t);this.#Cr.length=0;this.#yr=null;this.#wr=null;this.#vr=null;this.#_r=null;this.#Ar=1;this.#Er=null;this.#br=0;this.#mr=0;this.cachedPatterns.clear();for(const t of this._cachedBitmapsMap.values()){for(const e of t.values())"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement&&(e.width=e.height=0);t.clear()}this._cachedBitmapsMap.clear();this.#kr()}#kr(){if(this.pageColors){const t=this.filterFactory.addHCMFilter(this.pageColors.foreground,this.pageColors.background);if("none"!==t){const e=this.ctx.filter;this.ctx.filter=t;this.ctx.drawImage(this.ctx.canvas,0,0);this.ctx.filter=e}}}_scaleImage(t,e){const i=t.width??t.displayWidth,n=t.height??t.displayHeight,r=[];let s=Math.max(Math.hypot(e[0],e[1]),1),a=Math.max(Math.hypot(e[2],e[3]),1),o=i,l=n;for(;s>2&&o>1||a>2&&l>1;){let t=o,e=l;if(s>2&&o>1){t=Math.ceil(o/2);s/=o/t}if(a>2&&l>1){e=Math.ceil(l/2);a/=l/e}r.push({newWidth:t,newHeight:e});o=t;l=e}if(0===r.length)return{img:t,paintWidth:i,paintHeight:n,tmpCanvas:null};if(1===r.length){const{newWidth:e,newHeight:s}=r[0],a=this.canvasFactory.create(e,s);a.context.drawImage(t,0,0,i,n,0,0,e,s);return{img:a.canvas,paintWidth:e,paintHeight:s,tmpCanvas:a}}let c=this.canvasFactory.create(1,1),h=this.canvasFactory.create(1,1),d=i,u=n,p=t;for(const{newWidth:t,newHeight:e}of r){this.canvasFactory.reset(h,t,e);h.context.drawImage(p,0,0,d,u,0,0,t,e);[c,h]=[h,c];p=c.canvas;d=t;u=e}this.canvasFactory.destroy(h);return{img:c.canvas,paintWidth:d,paintHeight:u,tmpCanvas:c}}_createMaskCanvas(t,e){const i=this.ctx,{width:n,height:r}=e,s=this.current.patternFill,a=s?this.current.fillColor:i.fillStyle,o=getCurrentTransform(i);let l,c,h,d;if((e.bitmap||e.data)&&e.count>1){const i=e.bitmap||e.data.buffer;c=JSON.stringify(s?o:[o.slice(0,4),a]);l=this._cachedBitmapsMap.getOrInsertComputed(i,makeMap);const n=l.get(c);if(n&&!s){const e=Math.round(Math.min(o[0],o[2])+o[4]),i=Math.round(Math.min(o[1],o[3])+o[5]);this.dependencyTracker?.recordDependencies(t,xn);return{canvas:n,offsetX:e,offsetY:i}}h=n}if(!h){d=this.canvasFactory.create(n,r);putBinaryImageMask(d.context,e)}let u=Util.transform(o,[1/n,0,0,-1/r,0,0]);u=Util.transform(u,[1,0,0,1,0,-r]);const p=gi.slice();Util.axialAlignedBoundingBox([0,0,n,r],u,p);const[g,f,m,b]=p,y=Math.round(m-g)||1,w=Math.round(b-f)||1,v=this.canvasFactory.create(y,w),_=v.context,A=g,x=f;_.translate(-A,-x);_.transform(...u);let E=null;if(!h){const t=this._scaleImage(d.canvas,getCurrentTransformInverse(_));h=t.img;E=t.tmpCanvas;if(h!==d.canvas){this.canvasFactory.destroy(d);d=null}if(l&&s){l.set(c,h);E=null;d=null}}_.imageSmoothingEnabled=getImageSmoothingEnabled(getCurrentTransform(_),e.interpolate);drawImageAtIntegerCoords(_,h,0,0,h.width,h.height,0,0,n,r);E&&this.canvasFactory.destroy(E);d&&this.canvasFactory.destroy(d);_.globalCompositeOperation="source-in";const C=Util.transform(getCurrentTransformInverse(_),[1,0,0,1,-A,-x]);_.fillStyle=s?a.getPattern(i,this,C,Ln,t):a;_.fillRect(0,0,n,r);l&&!s&&l.set(c,v.canvas);this.dependencyTracker?.recordDependencies(t,xn);return{canvas:v.canvas,canvasEntry:l&&!s?null:v,offsetX:Math.round(A),offsetY:Math.round(x)}}setLineWidth(t,e){this.dependencyTracker?.recordSimpleData("lineWidth",t);e!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1);this.current.lineWidth=e;this.ctx.lineWidth=e}setLineCap(t,e){this.dependencyTracker?.recordSimpleData("lineCap",t);this.ctx.lineCap=Wn[e]}setLineJoin(t,e){this.dependencyTracker?.recordSimpleData("lineJoin",t);this.ctx.lineJoin=Vn[e]}setMiterLimit(t,e){this.dependencyTracker?.recordSimpleData("miterLimit",t);this.ctx.miterLimit=e}setDash(t,e,i){this.dependencyTracker?.recordSimpleData("dash",t);const n=this.ctx;if(void 0!==n.setLineDash){n.setLineDash(e);n.lineDashOffset=i}}setRenderingIntent(t,e){}setFlatness(t,e){}setGState(t,e){for(const[i,n]of e)switch(i){case"LW":this.setLineWidth(t,n);break;case"LC":this.setLineCap(t,n);break;case"LJ":this.setLineJoin(t,n);break;case"ML":this.setMiterLimit(t,n);break;case"D":this.setDash(t,n[0],n[1]);break;case"RI":this.setRenderingIntent(t,n);break;case"FL":this.setFlatness(t,n);break;case"Font":this.setFont(t,n[0],n[1]);break;case"CA":this.dependencyTracker?.recordSimpleData("strokeAlpha",t);this.current.strokeAlpha=n;break;case"ca":this.dependencyTracker?.recordSimpleData("fillAlpha",t);this.ctx.globalAlpha=this.current.fillAlpha=n;break;case"BM":this.dependencyTracker?.recordSimpleData("globalCompositeOperation",t);this.ctx.globalCompositeOperation=n;break;case"SMask":this.dependencyTracker?.recordSimpleData("SMask",t);this.current.activeSMask=n?this.tempSMask:null;this.current.activeSMask&&(this.current.activeSMask.blendMode=this.ctx.globalCompositeOperation);this.tempSMask=null;this.checkSMaskState(t);break;case"TR":{this.dependencyTracker?.recordSimpleData("filter",t);let e=this.filterFactory.addFilter(n);this.ctx.filter=e;let i=null;if(n&&("none"===e||!FeatureTest.isCanvasFilterSupported||"none"===this.ctx.filter||""===this.ctx.filter)){this.ctx.filter=e="none";i=new TransferMapsFallback(n)}this.current.transferMaps=e;if(i||this.current.transferMapsFallback){this.current.transferMapsFallback=i;this.current.patternFill||(this.ctx.fillStyle=this.#Dr(this.current.fillColor));this.current.patternStroke||(this.ctx.strokeStyle=this.#Dr(this.current.strokeColor))}break}}}get inSMaskMode(){return!!this.suspendedCtx}_clearPreparedSMask(){if(this.smaskPreparedEntry){this.canvasFactory.destroy(this.smaskPreparedEntry);this.smaskPreparedEntry=null}this.smaskPreparedFor=null;this.smaskPreparedOffsetX=0;this.smaskPreparedOffsetY=0;this.smaskPreparedOOBAlpha=null}_ensurePreparedSMask(t){if(t!==this.smaskPreparedFor){this._clearPreparedSMask();this._prepareSMaskCanvas(t)}}checkSMaskState(t){const e=this.inSMaskMode;this.current.activeSMask&&!e?this.beginSMaskMode(t):!this.current.activeSMask&&e?this.endSMaskMode():this.current.activeSMask&&e&&this._ensurePreparedSMask(this.current.activeSMask)}_prepareSMaskCanvas(t){const{canvas:e,subtype:i,backdrop:n,transferMap:r}=t,s="Luminosity"===i||"Alpha"===i&&r;if(!(s||"Luminosity"===i&&n)){this.smaskPreparedFor=t;return}let a;if("Luminosity"===i&&n){const[t,e,i]=getRGBA(n),s=Math.round(.3*t+.59*e+.11*i);a=r?.[s]??s}else a=r?.[0]??0;const{width:o,height:l}=this.ctx.canvas,c=o*l<4*(e.width*e.height),h=s?{url:"Alpha"===i?this.filterFactory.addAlphaFilter(r):this.filterFactory.addLuminosityFilter(r),subtype:i,transferMap:r}:null,d="Luminosity"===i?n:null;let u,p,g;if(c){u=this._bakeSMaskCanvas(e,t.offsetX,t.offsetY,o,l,d,h);p=0;g=0}else{u=this._bakeSMaskCanvas(e,0,0,e.width,e.height,d,h);p=t.offsetX;g=t.offsetY}this.smaskPreparedEntry=u;this.smaskPreparedFor=t;this.smaskPreparedOffsetX=p;this.smaskPreparedOffsetY=g;this.smaskPreparedOOBAlpha=c||0===a?null:a}_bakeSMaskCanvas(t,e,i,n,r,s,a){s||a||unreachable("_bakeSMaskCanvas with neither backdrop nor filter");const o=this.canvasFactory.create(n,r),l=o.context;l.drawImage(t,e,i);if(s){l.globalCompositeOperation="destination-atop";l.fillStyle=s;l.fillRect(0,0,n,r)}if(!a)return o;const c=this.canvasFactory.create(n,r),h=c.context;h.filter=a.url;const d=FeatureTest.isCanvasFilterSupported&&"none"!==h.filter&&""!==h.filter;h.drawImage(o.canvas,0,0);FeatureTest.isCanvasFilterSupported&&(h.filter="none");if(!d){const t=h.getImageData(0,0,n,r),{data:e}=t,{transferMap:i}=a;if("Luminosity"===a.subtype)for(let t=0,n=e.length;tthis.filterFactory.addKnockoutFilter(i)));if(!o||"none"!==l){if(e){a.save();a.setTransform(1,0,0,1,0,0);a.clearRect(0,0,n,r);a.restore()}a.filter=l;a.drawImage(t,0,0);a.filter="none";return s}const c=t.getContext("2d",{willReadFrequently:!0}).getImageData(0,0,n,r),h=a.createImageData(n,r),d=c.data,u=h.data,p=i>0?1/i:1e6;for(let t=3,e=d.length;t0||!this.contentVisible)return!1;this.#br++;this.#Ar=t;const e=this.#Cr.at(-1),{canvas:i}=this.ctx,n=this.#Mr(e,"knockoutTempEntry",i.width,i.height);this.#yr=n;const r=n.context;r.save();r.setTransform(this.ctx.getTransform());copyCtxState(this.ctx,r);this.#_r=r.globalCompositeOperation;r.globalCompositeOperation="source-over";mirrorContextOperations(r,this.ctx);this.#Er=e;this.#wr=this.ctx;this.#vr=this.suspendedCtx;this.ctx=r;this.inSMaskMode&&(this.suspendedCtx=r);return!0}#Or(t){if(!t)return;const e=this.#yr,i=this.#wr,n=this.#vr,r=e.context;this.#yr=null;this.#wr=null;this.#vr=null;this.inSMaskMode&&this.suspendedCtx===r&&this.ctx!==r&&this.endSMaskMode();this.inSMaskMode&&(this.suspendedCtx=n);this.ctx._removeMirroring();this.ctx.globalCompositeOperation=this.#_r;this.#_r=null;copyCtxState(this.ctx,i);this.ctx=i;const s=this.#Er;this.#Er=null;const a=this.#Ar;this.#Ar=1;try{this.#Ir(n??i,e.canvas,{backdropCanvas:s?.backdropCtx?.canvas??null,backdropOffset:s?.backdropCtx?[s.offsetX,s.offsetY]:[0,0],reuseMaskEntry:s?.knockoutMaskEntry??null,poolMeta:s,knockoutAlpha:a})}finally{r.restore();this.#br--;s||this.canvasFactory.destroy(e)}}compose(t){if(!this.current.activeSMask)return;t=t?[Math.floor(t[0]),Math.floor(t[1]),Math.ceil(t[2]),Math.ceil(t[3])]:[0,0,this.ctx.canvas.width,this.ctx.canvas.height];const e=this.current.activeSMask,i=this.suspendedCtx,n=this.#br>0&&i===this.ctx;this.composeSMask(n?null:i,e,this.ctx,t);if(!n){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(t,e,i,n){const r=n[0],s=n[1],a=n[2]-r,o=n[3]-s;if(0===a||0===o)return;const l=this.smaskPreparedEntry;if(l){let t=r,n=s,c=a,h=o;const d=this.smaskPreparedOOBAlpha,u=null!==d;if(u){t=Math.max(r,e.offsetX);n=Math.max(s,e.offsetY);c=Math.min(r+a,e.offsetX+e.canvas.width)-t;h=Math.min(s+o,e.offsetY+e.canvas.height)-n}if(c>0&&h>0){const e=t-this.smaskPreparedOffsetX,r=n-this.smaskPreparedOffsetY;i.save();i.globalAlpha=1;i.setTransform(1,0,0,1,0,0);const s=new Path2D;s.rect(t,n,c,h);i.clip(s);i.globalCompositeOperation="destination-in";i.drawImage(l.canvas,e,r,c,h,t,n,c,h);i.restore()}u&&d<255&&this._applySMaskOOBAlpha(i,r,s,a,o,t,n,t+c,n+h,d)}else this.genericComposeSMask(e,i,a,o,r,s);if(t){t.save();t.globalAlpha=1;t.globalCompositeOperation=e.blendMode||"source-over";t.setTransform(1,0,0,1,0,0);t.drawImage(i.canvas,r,s,a,o,r,s,a,o);t.restore()}}_applySMaskOOBAlpha(t,e,i,n,r,s,a,o,l,c){const h=sa.measureText(e))}if(d===Ii||d===Fi){this.dependencyTracker&&this.dependencyTracker?.recordCharacterBBox(t,a,l,h,i,n,()=>a.measureText(e)).recordDependencies(t,bn);a.strokeText(e,i,n)}}if(u){(this.pendingTextPaths||=[]).push({transform:getCurrentTransform(a),x:i,y:n,fontSize:h,path:f});this.dependencyTracker?.recordCharacterBBox(t,a,l,h,i,n)}}get isFontSubpixelAAEnabled(){const t=this.canvasFactory.create(10,10),e=t.context;e.scale(1.5,1);e.fillText("I",0,10);const i=e.getImageData(0,0,10,10).data;this.canvasFactory.destroy(t);let n=!1;for(let t=3;t0&&i[t]<255){n=!0;break}return util_shadow(this,"isFontSubpixelAAEnabled",n)}showText(t,e){if(this.dependencyTracker){this.dependencyTracker.recordDependencies(t,_n).resetBBox(t);this.current.textRenderingMode&Bi&&this.dependencyTracker.recordFutureForcedDependency("textClip",t).inheritPendingDependenciesAsFutureForcedDependencies()}const i=this.current,n=i.font;if(n.isType3Font){const n=this.#Fr(i.fillAlpha);this.showType3Text(t,e);this.dependencyTracker?.recordShowTextOperation(t);this.#Or(n);return}const r=i.fontSize;if(0===r){this.dependencyTracker?.recordOperation(t);return}const s=this.#Fr(i.fillAlpha),a=this.ctx,o=i.fontSizeScale,l=i.charSpacing,c=i.wordSpacing,h=i.fontDirection,d=i.textHScale*h,u=e.length,p=n.vertical,g=p?1:-1,f=r*i.fontMatrix[0],m=i.textRenderingMode===Mi&&!n.disableFontFace&&!i.patternFill;a.save();i.textMatrix&&a.transform(...i.textMatrix);a.translate(i.x,i.y+i.textRise);h>0?a.scale(d,-1):a.scale(d,1);let b,y;const w=i.textRenderingMode&Ri,v=w===Mi||w===Fi,_=w===Ii||w===Fi;let A=i.lineWidth;const x=i.textMatrixScale;0===x||0===A?_&&(A=this.getSinglePixelWidth()):A/=x;if(1!==o){a.scale(o,o);A/=o}a.lineWidth=A;if(v&&i.patternFill){a.save();const e=i.fillColor.getPattern(a,this,getCurrentTransformInverse(a),Ln,t);b=getCurrentTransform(a);a.restore();a.fillStyle=e}if(_&&i.patternStroke){a.save();const e=i.strokeColor.getPattern(a,this,getCurrentTransformInverse(a),Nn,t);y=getCurrentTransform(a);a.restore();a.strokeStyle=e}if(n.isInvalidPDFjsFont){const n=[];let r=0;for(const t of e){n.push(t.unicode);r+=t.width}const o=n.join("");a.fillText(o,0,0);if(null!==this.dependencyTracker){const e=a.measureText(o);this.dependencyTracker.recordBBox(t,this.ctx,-e.actualBoundingBoxLeft,e.actualBoundingBoxRight,-e.actualBoundingBoxAscent,e.actualBoundingBoxDescent).recordShowTextOperation(t)}i.x+=r*f*d;a.restore();this.compose();this.#Or(s);return}let E,C=0;for(E=0;E0){A=a.measureText(u);const t=1e3*A.width/r*o;if(xA??a.measureText(u))}else{this.paintChar(t,u,v,_,b,y);if(w){const e=v+r*w.offset.x/o,i=_-r*w.offset.y/o;this.paintChar(t,w.fontChar,e,i,b,y)}}C+=p?x*f-d*h:x*f+d*h;s&&a.restore()}p?i.y-=C:i.x+=C*d;a.restore();this.compose();this.dependencyTracker?.recordShowTextOperation(t);this.#Or(s)}showType3Text(t,e){const i=this.ctx,n=this.current,r=n.font,s=n.fontSize,a=n.fontDirection,o=r.vertical?1:-1,l=n.charSpacing,c=n.wordSpacing,h=n.textHScale*a,d=n.fontMatrix||fi,u=e.length;let p,g,f,m;if(n.textRenderingMode===Oi||0===s)return;this._cachedScaleForStroking[0]=-1;i.save();n.textMatrix&&i.transform(...n.textMatrix);i.translate(n.x,n.y+n.textRise);i.scale(h,a);const b=this.dependencyTracker;this.dependencyTracker=b?new CanvasNestedDependencyTracker(b,t):null;for(p=0;pnew CanvasGraphics(t,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack},void 0,void 0,this.dependencyTracker?new CanvasNestedDependencyTracker(this.dependencyTracker,e,!0):null)};i=new TilingPattern(e,this.ctx,n,t)}else i=this._getPattern(t,e[1],e[2]);return i}setStrokeColorN(t,...e){this.dependencyTracker?.recordSimpleData("strokeColor",t);this.current.strokeColor=this.getColorN_Pattern(t,e);this.current.patternStroke=!0}setFillColorN(t,...e){this.dependencyTracker?.recordSimpleData("fillColor",t);const i=this.current.fillColor=this.getColorN_Pattern(t,e);this.current.patternFill=!0;this.current.tilingPatternDims=i instanceof TilingPattern?[0,0,0,0]:null}#Dr(t){return this.current.transferMapsFallback?.applyToColor(t)??t}setStrokeRGBColor(t,e){this.dependencyTracker?.recordSimpleData("strokeColor",t);this.current.strokeColor=e;this.ctx.strokeStyle=this.#Dr(e);this.current.patternStroke=!1}setStrokeTransparent(t){this.dependencyTracker?.recordSimpleData("strokeColor",t);this.ctx.strokeStyle=this.current.strokeColor="transparent";this.current.patternStroke=!1}setFillRGBColor(t,e){this.dependencyTracker?.recordSimpleData("fillColor",t);this.current.fillColor=e;this.ctx.fillStyle=this.#Dr(e);this.current.patternFill=!1;this.current.tilingPatternDims=null}setFillTransparent(t){this.dependencyTracker?.recordSimpleData("fillColor",t);this.ctx.fillStyle=this.current.fillColor="transparent";this.current.patternFill=!1;this.current.tilingPatternDims=null}_getPattern(t,e,i=null){const n=this.cachedPatterns.getOrInsertComputed(e,()=>function getShadingPattern(t){switch(t[0]){case"RadialAxial":return new RadialAxialShadingPattern(t);case"Mesh":return new MeshShadingPattern(t);case"Dummy":return new DummyShadingPattern}throw new Error(`Unknown IR type: ${t[0]}`)}(this.getObject(t,e)));i&&(n.matrix=i);return n}shadingFill(t,e){if(!this.contentVisible)return;const i=this.#Fr(this.current.fillAlpha),n=this.ctx;this.save(t);const r=this._getPattern(t,e);n.fillStyle=r.getPattern(n,this,getCurrentTransformInverse(n),Un,t);const s=getCurrentTransformInverse(n);if(s){const{width:t,height:e}=n.canvas,i=gi.slice();Util.axialAlignedBoundingBox([0,0,t,e],s,i);const[r,a,o,l]=i;this.ctx.fillRect(r,a,o-r,l-a)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.dependencyTracker?.resetBBox(t).recordFullPageBBox(t).recordDependencies(t,An).recordDependencies(t,yn).recordOperation(t);this.compose(this.current.getClippedPathBoundingBox());this.restore(t);this.#Or(i)}beginInlineImage(){unreachable("Should not call beginInlineImage")}beginImageData(){unreachable("Should not call beginImageData")}paintFormXObjectBegin(t,e,i){if(this.contentVisible){this.save(t);this.baseTransformStack.push(this.baseTransform);e&&this.transform(t,...e);this.baseTransform=getCurrentTransform(this.ctx);if(i){Util.axialAlignedBoundingBox(i,this.baseTransform,this.current.minMax);const[e,n,r,s]=i,a=new Path2D;a.rect(e,n,r-e,s-n);this.ctx.clip(a);this.dependencyTracker?.recordClipBox(t,this.ctx,e,r,n,s);this.endPath(t)}}}paintFormXObjectEnd(t){if(this.contentVisible){this.restore(t);this.baseTransform=this.baseTransformStack.pop()}}beginGroup(t,e){if(!this.contentVisible)return;this.save(t);const{inSMaskMode:i}=this;if(i){this.endSMaskMode();this.current.activeSMask=null}const n=this.ctx;if(!(e.needsIsolation&&(e.isolated||e.hasSoftMask)||e.knockout||e.isGray||0!==this.#mr||1!==n.globalAlpha||"source-over"!==n.globalCompositeOperation||i)){if(e.bbox){let t=new Path2D;const[i,r,s,a]=e.bbox;t.rect(i,r,s-i,a-r);if(e.matrix){const i=new Path2D;i.addPath(t,new DOMMatrix(e.matrix));t=i}n.clip(t)}this.groupStack.push(null);this.#Cr.push(null);this.groupLevel++;return}e.isolated||e.knockout||0!==this.#mr||info("TODO: Fully support non-isolated non-knockout groups.");const r=getCurrentTransform(n);e.matrix&&n.transform(...e.matrix);const s=[0,0,n.canvas.width,n.canvas.height];let a;if(e.bbox){a=gi.slice();Util.axialAlignedBoundingBox(e.bbox,getCurrentTransform(n),a);a=Util.intersect(a,s)||[0,0,0,0]}else a=s;const o=Math.floor(a[0]),l=Math.floor(a[1]),c=Math.max(Math.ceil(a[2])-o,1),h=Math.max(Math.ceil(a[3])-l,1);this.current.startNewPathAndClipBox([0,0,c,h]);const d=this.canvasFactory.create(c,h);e.smask&&this.smaskGroupCanvases.push(d);const u=d.context,p=e.knockout&&!e.isolated?n:null,g=!e.isolated&&!e.knockout&&!e.smask&&e.needsIsolation&&this.#mr>0,f=e.knockout?this.canvasFactory.create(c,h):null,m=this.#mr;e.knockout?this.#mr++:this.#mr=0;u.translate(-o,-l);u.transform(...r);const b=!e.isolated&&!e.smask&&e.needsIsolation,y=b&&!i&&0===m&&!e.knockout&&!e.isGray&&e.hasSoftMask&&1===n.globalAlpha&&"source-over"===n.globalCompositeOperation&&"none"===this.current.transferMaps&&!this.current.transferMapsFallback;if(b&&(i||y)){u.save();u.setTransform(1,0,0,1,0,0);u.drawImage(n.canvas,-o,-l);u.restore()}if(e.bbox){let t=new Path2D;const[i,n,r,s]=e.bbox;t.rect(i,n,r-i,s-n);if(e.matrix){const i=new Path2D;i.addPath(t,new DOMMatrix(e.matrix));t=i}u.clip(t)}e.smask&&this.smaskStack.push({canvas:d.canvas,context:u,offsetX:o,offsetY:l,subtype:e.smask.subtype,backdrop:e.smask.backdrop,transferMap:e.smask.transferMap||null});if(!e.smask||this.dependencyTracker){n.setTransform(1,0,0,1,0,0);n.translate(o,l);n.save()}copyCtxState(n,u);this.ctx=u;this.dependencyTracker?.inheritSimpleDataAsFutureForcedDependencies(["fillAlpha","strokeAlpha","globalCompositeOperation"]).pushBaseTransform(n);this.setGState(t,[["BM","source-over"],["ca",1],["CA",1],["TR",null]]);this.groupStack.push(n);this.#Cr.push({backdropCtx:p,savedKnockoutLevel:m,offsetX:o,offsetY:l,hasInnerBackdrop:g,replaceBackdrop:y,knockoutMaskEntry:f,knockoutTempEntry:null,knockoutBackdropEntry:null});this.groupLevel++}endGroup(t,e){if(!this.contentVisible)return;this.groupLevel--;const i=this.ctx,n=this.groupStack.pop(),r=this.#Cr.pop();r&&(this.#mr=r.savedKnockoutLevel);if(null!==n){e.isGray&&this.#Br(i);this.ctx=n;this.ctx.imageSmoothingEnabled=!1;this.dependencyTracker?.popBaseTransform();if(e.smask){this.tempSMask=this.smaskStack.pop();this.restore(t);if(this.dependencyTracker){this.ctx.restore();this.inSMaskMode&&this.ctx.setTransform(this.suspendedCtx.getTransform())}this.#Tr(r)}else{this.ctx.restore();const e=getCurrentTransform(this.ctx);this.restore(t);this.current.transferMapsFallback?.applyToCanvas(i);this.ctx.save();this.ctx.setTransform(...e);const s=gi.slice();Util.axialAlignedBoundingBox([0,0,i.canvas.width,i.canvas.height],e,s);const a=this.#Cr.at(-1);if(this.#mr>0)if(r.hasInnerBackdrop){const{width:t,height:s}=i.canvas,a=this.canvasFactory.create(t,s),o=a.context;o.drawImage(n.canvas,r.offsetX,r.offsetY,t,s,0,0,t,s);o.globalCompositeOperation="source-over";o.drawImage(i.canvas,0,0);const l=this.#Pr(i.canvas);o.globalCompositeOperation="destination-in";o.drawImage(l.canvas,0,0);const c=this.ctx.globalCompositeOperation,h=this.ctx.globalAlpha,d=this.ctx.filter;this.ctx.save();this.ctx.setTransform(...e);this.ctx.globalAlpha=1;FeatureTest.isCanvasFilterSupported&&(this.ctx.filter="none");this.ctx.globalCompositeOperation="destination-out";this.ctx.drawImage(l.canvas,0,0);this.ctx.globalCompositeOperation=c;this.ctx.globalAlpha=h;FeatureTest.isCanvasFilterSupported&&(this.ctx.filter=d??"none");this.ctx.drawImage(a.canvas,0,0);this.ctx.restore();this.canvasFactory.destroy(l);this.canvasFactory.destroy(a)}else{const t=a?.backdropCtx??null;this.#Ir(this.ctx,i.canvas,{backdropCanvas:t?.canvas??null,destTransform:e,backdropOffset:t?[a.offsetX+r.offsetX,a.offsetY+r.offsetY]:[0,0],sourceAlpha:this.ctx.globalAlpha,sourceFilter:this.ctx.filter})}else{if(r.replaceBackdrop){const t=new Path2D;t.rect(0,0,i.canvas.width,i.canvas.height);this.ctx.clip(t);this.ctx.globalCompositeOperation="copy"}this.ctx.drawImage(i.canvas,0,0)}this.ctx.restore();this.canvasFactory.destroy({canvas:i.canvas,context:i});this.#Tr(r);this.compose(s)}}else this.restore(t)}#Br(t){const{canvas:e}=t,{width:i,height:n}=e;if(FeatureTest.isCanvasFilterSupported){t.save();t.setTransform(1,0,0,1,0,0);t.filter="grayscale(1)";t.globalAlpha=1;t.globalCompositeOperation="copy";t.drawImage(e,0,0);t.restore();return}const r=t.getImageData(0,0,i,n),{data:s}=r;for(let t=0,e=s.length;tt.getAttribute("data-canvas-name")===a);-1===i?t.push(c):t[i]=c}else this.annotationCanvasMap.set(e,c);this.annotationCanvas.savedCtx=this.ctx;this.ctx=h;this.ctx.save();this.ctx.setTransform(jn[0],0,0,-jn[1],0,o*jn[1]);resetCtxToDefault(this.ctx)}else{resetCtxToDefault(this.ctx);this.endPath(t);const e=new Path2D;e.rect(i[0],i[1],r,o);this.ctx.clip(e)}}this.current=new CanvasExtraState(this.ctx.canvas.width,this.ctx.canvas.height);this.baseTransformStack.push(this.baseTransform);this.transform(t,...n);this.transform(t,...r);this.baseTransform=getCurrentTransform(this.ctx)}endAnnotation(t){if(this.annotationCanvas){this.ctx.restore();this.#kr();this.ctx=this.annotationCanvas.savedCtx;delete this.annotationCanvas.savedCtx;delete this.annotationCanvas}this.baseTransform=this.baseTransformStack.pop()}paintImageMaskXObject(t,e){if(!this.contentVisible)return;const i=e.count;(e=this.getObject(t,e.data,e)).count=i;const n=this.#Fr(this.current.fillAlpha),r=this.ctx,s=this._createMaskCanvas(t,e),a=s.canvas;r.save();r.setTransform(1,0,0,1,0,0);r.drawImage(a,s.offsetX,s.offsetY);this.dependencyTracker?.resetBBox(t).recordBBox(t,this.ctx,s.offsetX,s.offsetX+a.width,s.offsetY,s.offsetY+a.height).recordOperation(t);r.restore();s.canvasEntry&&this.canvasFactory.destroy(s.canvasEntry);this.compose();this.#Or(n)}paintImageMaskXObjectRepeat(t,e,i,n=0,r=0,s,a){if(!this.contentVisible)return;e=this.getObject(t,e.data,e);const o=this.#Fr(this.current.fillAlpha),l=this.ctx;l.save();const c=getCurrentTransform(l);l.transform(i,n,r,s,0,0);const h=this._createMaskCanvas(t,e);l.setTransform(1,0,0,1,h.offsetX-c[4],h.offsetY-c[5]);this.dependencyTracker?.resetBBox(t);for(let e=0,o=a.length;ee?c/e:1;a=l>e?l/e:1}}this._cachedScaleForStroking[0]=s;this._cachedScaleForStroking[1]=a}return this._cachedScaleForStroking}rescaleAndStroke(t,e){const{ctx:i,current:{lineWidth:n}}=this,[r,s]=this.getScaleForStroking();if(r===s){i.lineWidth=(n||1)*r;i.stroke(t);return}const a=CanvasGraphics.#fr??=new DOMMatrix,o=i.getLineDash();e&&i.save();i.scale(r,s);a.a=1/r;a.d=1/s;const l=new Path2D;l.addPath(t,a);if(o.length>0){const t=Math.max(r,s);i.setLineDash(o.map(e=>e/t));i.lineDashOffset/=t}i.lineWidth=n||1;i.stroke(l);e&&i.restore()}isContentVisible(){for(let t=this.markedContentStack.length-1;t>=0;t--)if(!this.markedContentStack[t].visible)return!1;return!0}}for(const t in Vi)void 0!==CanvasGraphics.prototype[t]&&(CanvasGraphics.prototype[Vi[t]]=CanvasGraphics.prototype[t]);class BasePDFStream{#Lr=null;#Nr=null;_fullReader=null;_rangeReaders=new Set;_source=null;constructor(t,e,i){this._source=t;this.#Lr=e;this.#Nr=i}get _progressiveDataLength(){return this._fullReader?._loaded??0}getFullReader(){util_assert(!this._fullReader,"BasePDFStream.getFullReader can only be called once.");return this._fullReader=new this.#Lr(this)}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;const i=new this.#Nr(this,t,e);this._rangeReaders.add(i);return i}cancelAllRequests(t){this._fullReader?.cancel(t);for(const e of new Set(this._rangeReaders))e.cancel(t)}}class BasePDFStreamReader{onProgress=null;_contentLength=0;_filename=null;_headersCapability=Promise.withResolvers();_isRangeSupported=!1;_isStreamingSupported=!1;_loaded=0;_stream=null;constructor(t){this._stream=t}_callOnProgress(){this.onProgress?.({loaded:this._loaded,total:this._contentLength})}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){unreachable("Abstract method `read` called")}cancel(t){unreachable("Abstract method `cancel` called")}}class BasePDFStreamRangeReader{_stream=null;constructor(t,e,i){this._stream=t}async read(){unreachable("Abstract method `read` called")}cancel(t){unreachable("Abstract method `cancel` called")}}function createHeaders(t,e){const i=new Headers;if(!t||!e||"object"!=typeof e)return i;for(const t in e){const n=e[t];void 0!==n&&i.append(t,n)}return i}function getResponseOrigin(t){return URL.parse(t)?.origin??null}function validateRangeRequestCapabilities({responseHeaders:t,isHttp:e,rangeChunkSize:i,disableRange:n}){const r={contentLength:0,isRangeSupported:!1},s=parseInt(t.get("Content-Length"),10);if(!Number.isInteger(s))return r;r.contentLength=s;if(s<=2*i)return r;if(n||!e||"bytes"!==t.get("Accept-Ranges"))return r;"identity"===(t.get("Content-Encoding")||"identity")&&(r.isRangeSupported=!0);return r}function extractFilenameFromHeader(t){const e=t.get("Content-Disposition");if(e){let t=function getFilenameFromContentDispositionHeader(t){let e=!0,i=toParamRegExp("filename\\*","i").exec(t);if(i){i=i[1];let t=rfc2616unquote(i);t=unescape(t);t=rfc5987decode(t);t=rfc2047decode(t);return fixupEncoding(t)}i=function rfc2231getparam(t){const e=[];let i;const n=toParamRegExp("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;null!==(i=n.exec(t));){let[,t,n,r]=i;t=parseInt(t,10);if(t in e){if(0===t)break}else e[t]=[n,r]}const r=[];for(let t=0;tString.fromCharCode(parseInt(e,16))));try{n=atob(n)}catch{}return textdecode(e,n)})}return""}(e);if(t.includes("%"))try{t=decodeURIComponent(t)}catch{}if(isPdfFile(t))return t}return null}function createResponseError(t,e){return new ResponseException(`Unexpected server response (${t}) while retrieving PDF "${e.href}".`,t,404===t||0===t&&"file:"===e.protocol)}function ensureResponseOrigin(t,e){if(t!==e)throw new Error(`Expected range response-origin "${t}" to match "${e}".`)}function fetchUrl(t,e,i,n){return fetch(t,{method:"GET",headers:e,signal:n.signal,mode:"cors",credentials:i?"include":"same-origin",redirect:"follow"})}function ensureResponseStatus(t,e){if(200!==t&&206!==t)throw createResponseError(t,e)}function getArrayBuffer(t){if(t instanceof Uint8Array)return t.buffer;if(t instanceof ArrayBuffer)return t;throw new Error(`getArrayBuffer - unexpected data: ${t}`)}class PDFFetchStream extends BasePDFStream{_responseOrigin=null;constructor(t){super(t,PDFFetchStreamReader,PDFFetchStreamRangeReader);const{httpHeaders:e,url:i}=t;util_assert(/https?:/.test(i.protocol),"PDFFetchStream only supports http(s):// URLs.");this.headers=createHeaders(!0,e)}}class PDFFetchStreamReader extends BasePDFStreamReader{_abortController=new AbortController;_reader=null;constructor(t){super(t);const{disableRange:e,disableStream:i,rangeChunkSize:n,url:r,withCredentials:s}=t._source;this._isStreamingSupported=!i;const a=new Headers(t.headers);fetchUrl(r,a,s,this._abortController).then(i=>{t._responseOrigin=getResponseOrigin(i.url);ensureResponseStatus(i.status,r);this._reader=i.body.getReader();const s=i.headers,{contentLength:a,isRangeSupported:o}=validateRangeRequestCapabilities({responseHeaders:s,isHttp:!0,rangeChunkSize:n,disableRange:e});this._contentLength=a;this._isRangeSupported=o;this._filename=extractFilenameFromHeader(s);!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new AbortException("Streaming is disabled."));this._headersCapability.resolve()}).catch(this._headersCapability.reject)}async read(){await this._headersCapability.promise;const{value:t,done:e}=await this._reader.read();if(e)return{value:t,done:e};this._loaded+=t.byteLength;this._callOnProgress();return{value:getArrayBuffer(t),done:!1}}cancel(t){this._reader?.cancel(t);this._abortController.abort()}}class PDFFetchStreamRangeReader extends BasePDFStreamRangeReader{_abortController=new AbortController;_readCapability=Promise.withResolvers();_reader=null;constructor(t,e,i){super(t,e,i);const{url:n,withCredentials:r}=t._source,s=new Headers(t.headers);s.append("Range",`bytes=${e}-${i-1}`);fetchUrl(n,s,r,this._abortController).then(e=>{ensureResponseOrigin(getResponseOrigin(e.url),t._responseOrigin);ensureResponseStatus(e.status,n);this._reader=e.body.getReader();this._readCapability.resolve()}).catch(this._readCapability.reject)}async read(){await this._readCapability.promise;const{value:t,done:e}=await this._reader.read();return e?{value:t,done:e}:{value:getArrayBuffer(t),done:!1}}cancel(t){this._reader?.cancel(t);this._abortController.abort()}}function transport_stream_getArrayBuffer(t){return t instanceof Uint8Array&&t.byteLength===t.buffer.byteLength?t.buffer:new Uint8Array(t).buffer}function endRequests(){for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0}class PDFDataTransportStream extends BasePDFStream{_progressiveDone=!1;_queuedChunks=[];constructor(t){super(t,PDFDataTransportStreamReader,PDFDataTransportStreamRangeReader);const{pdfDataRangeTransport:e}=t,{initialData:i,progressiveDone:n}=e;if(i?.length>0){const t=transport_stream_getArrayBuffer(i);this._queuedChunks.push(t)}this._progressiveDone=n;e.transportReady(t=>{switch(t.type){case"range":case"progressiveRead":this.#Ur(t.begin,t.chunk);break;case"progressiveDone":this._fullReader?.progressiveDone();this._progressiveDone=!0}})}#Ur(t,e){const i=transport_stream_getArrayBuffer(e);if(void 0===t)this._fullReader?this._fullReader._enqueue(i):this._queuedChunks.push(i);else{const e=this._rangeReaders.keys().find(e=>e._begin===t);util_assert(e,"#onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.");e._enqueue(i)}}getFullReader(){const t=super.getFullReader();this._queuedChunks=null;return t}getRangeReader(t,e){const i=super.getRangeReader(t,e);if(i){i.onDone=()=>this._rangeReaders.delete(i);this._source.pdfDataRangeTransport.requestDataRange(t,e)}return i}cancelAllRequests(t){super.cancelAllRequests(t);this._source.pdfDataRangeTransport.abort()}}class PDFDataTransportStreamReader extends BasePDFStreamReader{#Hr=endRequests.bind(this);_done=!1;_queuedChunks=null;_requests=[];constructor(t){super(t);const{pdfDataRangeTransport:e,disableRange:i,disableStream:n}=t._source,{length:r,contentDispositionFilename:s}=e;this._queuedChunks=t._queuedChunks||[];for(const t of this._queuedChunks)this._loaded+=t.byteLength;this._done=t._progressiveDone;this._contentLength=r;this._isStreamingSupported=!n;this._isRangeSupported=!i;isPdfFile(s)&&(this._filename=s);this._headersCapability.resolve();const a=this._loaded;Promise.resolve().then(()=>{a>0&&this._loaded===a&&this._callOnProgress()})}_enqueue(t){if(!this._done){if(this._requests.length>0){this._requests.shift().resolve({value:t,done:!1})}else this._queuedChunks.push(t);this._loaded+=t.byteLength;this._callOnProgress()}}async read(){if(this._queuedChunks.length>0){return{value:this._queuedChunks.shift(),done:!1}}if(this._done)return{value:void 0,done:!0};const t=Promise.withResolvers();this._requests.push(t);return t.promise}cancel(t){this._done=!0;this.#Hr()}progressiveDone(){this._done||=!0;0===this._queuedChunks.length&&this.#Hr()}}class PDFDataTransportStreamRangeReader extends BasePDFStreamRangeReader{#Hr=endRequests.bind(this);onDone=null;_begin=-1;_done=!1;_queuedChunk=null;_requests=[];constructor(t,e,i){super(t,e,i);this._begin=e}_enqueue(t){if(!this._done){if(0===this._requests.length)this._queuedChunk=t;else{this._requests.shift().resolve({value:t,done:!1});this.#Hr()}this._done=!0;this.onDone?.()}}async read(){if(this._queuedChunk){const t=this._queuedChunk;this._queuedChunk=null;return{value:t,done:!1}}if(this._done)return{value:void 0,done:!0};const t=Promise.withResolvers();this._requests.push(t);return t.promise}cancel(t){this._done=!0;this.#Hr();this.onDone?.()}}class PDFNetworkStream extends BasePDFStream{#zr=new WeakMap;_responseOrigin=null;constructor(t){super(t,PDFNetworkStreamReader,PDFNetworkStreamRangeReader);const{httpHeaders:e,url:i}=t;this.url=i;this.isHttp=/https?:/.test(i.protocol);this.headers=createHeaders(this.isHttp,e)}_request(t){const e=new XMLHttpRequest,i={validateStatus:null,onHeadersReceived:t.onHeadersReceived,onDone:t.onDone,onError:t.onError,onProgress:t.onProgress};this.#zr.set(e,i);e.open("GET",this.url);e.withCredentials=this._source.withCredentials;for(const[t,i]of this.headers)e.setRequestHeader(t,i);if(this.isHttp&&"begin"in t&&"end"in t){e.setRequestHeader("Range",`bytes=${t.begin}-${t.end-1}`);i.validateStatus=t=>206===t||200===t}else i.validateStatus=t=>200===t;e.responseType="arraybuffer";util_assert(t.onError,"Expected `onError` callback to be provided.");e.onerror=()=>t.onError(e.status);e.onreadystatechange=this.#Gr.bind(this,e);e.onprogress=this.#jr.bind(this,e);e.send(null);return e}#jr(t,e){const i=this.#zr.get(t);i?.onProgress?.(e)}#Gr(t,e){const i=this.#zr.get(t);if(!i)return;if(t.readyState>=2&&i.onHeadersReceived){i.onHeadersReceived();delete i.onHeadersReceived}if(4!==t.readyState)return;if(!this.#zr.has(t))return;this.#zr.delete(t);if(0===t.status&&this.isHttp){i.onError(t.status);return}const n=t.status||200;if(!i.validateStatus(n)){i.onError(t.status);return}const r=function network_getArrayBuffer(t){return"string"!=typeof t?t:stringToBytes(t).buffer}(t.response);if(206===n){const e=t.getResponseHeader("Content-Range");if(/bytes \d+-\d+\/\d+/.test(e))i.onDone(r);else{warn('Missing or invalid "Content-Range" header.');i.onError(0)}}else r?i.onDone(r):i.onError(t.status)}_abortRequest(t){if(this.#zr.has(t)){this.#zr.delete(t);t.abort()}}getRangeReader(t,e){const i=super.getRangeReader(t,e);i&&(i.onClosed=()=>this._rangeReaders.delete(i));return i}}class PDFNetworkStreamReader extends BasePDFStreamReader{#Hr=endRequests.bind(this);_cachedChunks=[];_done=!1;_requests=[];_storedError=null;constructor(t){super(t);this._fullRequestXhr=t._request({onHeadersReceived:this.#Wr.bind(this),onDone:this.#Vr.bind(this),onError:this.#$r.bind(this),onProgress:this.#jr.bind(this)})}#Wr(){const t=this._stream,{disableRange:e,rangeChunkSize:i}=t._source,n=this._fullRequestXhr;t._responseOrigin=getResponseOrigin(n.responseURL);const r=n.getAllResponseHeaders(),s=new Headers(r?function trimHeadersEnd(t){let e=t.length;for(;e>0&&" "!==t[e-1]&&/\s/.test(t[e-1]);)e--;return t.slice(0,e)}(r.trimStart()).split(/[\r\n]+/).map(t=>{const[e,...i]=t.split(": ");return[e,i.join(": ")]}):[]),{contentLength:a,isRangeSupported:o}=validateRangeRequestCapabilities({responseHeaders:s,isHttp:t.isHttp,rangeChunkSize:i,disableRange:e});this._contentLength=a;this._isRangeSupported=o;this._filename=extractFilenameFromHeader(s);this._isRangeSupported&&t._abortRequest(n);this._headersCapability.resolve()}#Vr(t){if(this._requests.length>0){this._requests.shift().resolve({value:t,done:!1})}else this._cachedChunks.push(t);this._done=!0;0===this._cachedChunks.length&&this.#Hr()}#$r(t){this._storedError=createResponseError(t,this._stream.url);this._headersCapability.reject(this._storedError);for(const t of this._requests)t.reject(this._storedError);this._requests.length=0;this._cachedChunks.length=0}#jr(t){this.onProgress?.({loaded:t.loaded,total:t.lengthComputable?t.total:this._contentLength})}async read(){await this._headersCapability.promise;if(this._storedError)throw this._storedError;if(this._cachedChunks.length>0){return{value:this._cachedChunks.shift(),done:!1}}if(this._done)return{value:void 0,done:!0};const t=Promise.withResolvers();this._requests.push(t);return t.promise}cancel(t){this._done=!0;this._headersCapability.reject(t);this.#Hr();this._stream._abortRequest(this._fullRequestXhr);this._fullRequestXhr=null}}class PDFNetworkStreamRangeReader extends BasePDFStreamRangeReader{#Hr=endRequests.bind(this);onClosed=null;_done=!1;_queuedChunk=null;_requests=[];_storedError=null;constructor(t,e,i){super(t,e,i);this._requestXhr=t._request({begin:e,end:i,onHeadersReceived:this.#Wr.bind(this),onDone:this.#Vr.bind(this),onError:this.#$r.bind(this),onProgress:null})}#Wr(){const t=getResponseOrigin(this._requestXhr?.responseURL);try{ensureResponseOrigin(t,this._stream._responseOrigin)}catch(t){this._storedError=t;this.#$r(0)}}#Vr(t){if(this._requests.length>0){this._requests.shift().resolve({value:t,done:!1})}else this._queuedChunk=t;this._done=!0;this.#Hr();this.onClosed?.()}#$r(t){this._storedError??=createResponseError(t,this._stream.url);for(const t of this._requests)t.reject(this._storedError);this._requests.length=0;this._queuedChunk=null}async read(){if(this._storedError)throw this._storedError;if(null!==this._queuedChunk){const t=this._queuedChunk;this._queuedChunk=null;return{value:t,done:!1}}if(this._done)return{value:void 0,done:!0};const t=Promise.withResolvers();this._requests.push(t);return t.promise}cancel(t){this._done=!0;this.#Hr();this._stream._abortRequest(this._requestXhr);this.onClosed?.()}}function getReadableStream(t,e=null){const i=process.getBuiltinModule("fs"),{Readable:n}=process.getBuiltinModule("stream"),r=i.createReadStream(t,e);return n.toWeb(r)}class PDFNodeStream extends BasePDFStream{constructor(t){super(t,PDFNodeStreamReader,PDFNodeStreamRangeReader);const{url:e}=t;util_assert("file:"===e.protocol,"PDFNodeStream only supports file:// URLs.")}}class PDFNodeStreamReader extends BasePDFStreamReader{_reader=null;constructor(t){super(t);const{disableRange:e,disableStream:i,rangeChunkSize:n,url:r}=t._source;this._isStreamingSupported=!i;process.getBuiltinModule("fs/promises").lstat(r).then(t=>{const i=getReadableStream(r);this._reader=i.getReader();const{size:s}=t;this._contentLength=s;this._isRangeSupported=!e&&s>2*n;!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new AbortException("Streaming is disabled."));this._headersCapability.resolve()}).catch(t=>{"ENOENT"===t.code&&(t=createResponseError(0,r));this._headersCapability.reject(t)})}async read(){await this._headersCapability.promise;const{value:t,done:e}=await this._reader.read();if(e)return{value:t,done:e};this._loaded+=t.byteLength;this._callOnProgress();return{value:getArrayBuffer(t),done:!1}}cancel(t){this._reader?.cancel(t)}}class PDFNodeStreamRangeReader extends BasePDFStreamRangeReader{_readCapability=Promise.withResolvers();_reader=null;constructor(t,e,i){super(t,e,i);const{url:n}=t._source;try{const t=getReadableStream(n,{start:e,end:i-1});this._reader=t.getReader();this._readCapability.resolve()}catch(t){this._readCapability.reject(t)}}async read(){await this._readCapability.promise;const{value:t,done:e}=await this._reader.read();return e?{value:t,done:e}:{value:getArrayBuffer(t),done:!1}}cancel(t){this._reader?.cancel(t)}}class GlobalWorkerOptions{static#qr=null;static#Xr="";static get workerPort(){return this.#qr}static set workerPort(t){if(!("undefined"!=typeof Worker&&t instanceof Worker)&&null!==t)throw new Error("Invalid `workerPort` type.");this.#qr=t}static get workerSrc(){return this.#Xr}static set workerSrc(t){if("string"!=typeof t)throw new Error("Invalid `workerSrc` type.");this.#Xr=t}}class Metadata{#Kr;#Yr;constructor({parsedData:t,rawData:e}){this.#Kr=t;this.#Yr=e}getRaw(){return this.#Yr}get(t){return this.#Kr.get(t)??null}[Symbol.iterator](){return this.#Kr.entries()}}const Xn=Symbol("INTERNAL");class OptionalContentGroup{#Jr=!1;#Qr=!1;#Zr=!1;#ts=!0;constructor(t,{name:e,intent:i,usage:n,rbGroups:r}){this.#Jr=!!(t&yi);this.#Qr=!!(t&wi);this.name=e;this.intent=i;this.usage=n;this.rbGroups=r}get visible(){if(this.#Zr)return this.#ts;if(!this.#ts)return!1;const{print:t,view:e}=this.usage;return this.#Jr?"OFF"!==e?.viewState:!this.#Qr||"OFF"!==t?.printState}_setVisible(t,e,i=!1){t!==Xn&&unreachable("Internal method `_setVisible` called.");this.#Zr=i;this.#ts=e}get serializable(){return{userSet:this.#Zr,visible:this.#ts}}}class OptionalContentConfig{#es=null;#is=new Map;#ns=null;#rs=null;#ss;creator=null;name=null;constructor(t,e=yi,i=null){this.#ss=t;this.renderingIntent=e;if(null!==t){this.name=t.name;this.creator=t.creator;this.#rs=t.order;for(const i of t.groups)this.#is.set(i.id,new OptionalContentGroup(e,i));if(i){i.size!==this.#is.size&&unreachable("Incorrect serialized groupState.");for(const[t,e]of i)this.#is.get(t)._setVisible(Xn,e.visible,e.userSet)}else{if("OFF"===t.baseState)for(const t of this.#is.values())t._setVisible(Xn,!1);for(const e of t.on)this.#is.get(e)._setVisible(Xn,!0);for(const e of t.off)this.#is.get(e)._setVisible(Xn,!1)}this.#ns=this.getHash()}}#as(t){const e=t.length;if(e<2)return!0;const i=t[0];for(let n=1;nt===e+1)&&(this.#os=null)}deletePages(t){this.#us();const e=this.#os,i=this.#ps();this.#ds={pageNumberToId:e.slice(),pagesNumber:this.#cs,prevPageNumbers:this.#ls.slice()};const n=this.#cs-t.length;this.#cs=n;const r=this.#os=new Uint32Array(n);this.#ls=new Int32Array(n);let s=0,a=0;for(const i of t){const t=i-1;if(t!==s){r.set(e.subarray(s,t),a);a+=t-s}s=t+1}sthis.#os[t-1])}}cancelCopy(){this.#hs=null}pastePages(t){this.#us();const e=this.#os,i=this.#ps(),{pageNumbers:n,pageIds:r}=this.#hs,s=this.#cs+n.length;this.#cs=s;const a=this.#os=new Uint32Array(s);this.#ls=new Int32Array(s);a.set(e.subarray(0,t),0);a.set(r,t);a.set(e.subarray(t),t+n.length);this.#gs(i,null,t,n);this.#hs=null}#gs(t,e=null,i=-1,n=null){const r=this.#ls,s=this.#os,a=i+(n?.length??0),o=new Map;for(let l=0,c=this.#cs;l=i&&lt[0]-e[0]);for(let i=0,n=t.length;it-e);const e=new Map;for(let i=0,n=t.length;i({...Promise.withResolvers(),data:Kn});class PDFObjects{#ms=new Map;get(t,e=null){if(e){const i=this.#ms.getOrInsertComputed(t,dataObj);i.promise.then(()=>e(i.data));return null}const i=this.#ms.get(t);if(!i||i.data===Kn)throw new Error(`Requesting object that isn't resolved yet ${t}.`);return i.data}has(t){const e=this.#ms.get(t);return!!e&&e.data!==Kn}delete(t){const e=this.#ms.get(t);if(!e||e.data===Kn)return!1;this.#ms.delete(t);return!0}resolve(t,e=null){const i=this.#ms.getOrInsertComputed(t,dataObj);if(i.data!==Kn)throw new Error(`Object already resolved ${t}.`);i.data=e;i.resolve()}clear(){for(const{data:t}of this.#ms.values())t?.bitmap?.close();this.#ms.clear()}*[Symbol.iterator](){for(const[t,{data:e}]of this.#ms)e!==Kn&&(yield[t,e])}}class TextLayer{#bs=Promise.withResolvers();#Pt=null;#ys=!1;#ws=!!globalThis.FontInspector?.enabled;#vs=null;#_s=null;#As=null;#xs=0;#Es=0;#Cs=OutputScale.pixelRatio;#Ss=null;#Ts=null;#ks=0;#Ds=0;#Ps=Object.create(null);#Ms=[];#Is=null;#Fs=[];#Os=new WeakMap;#Rs=null;static#Bs=new Map;static#Ls=new Map;static#Ns=new WeakMap;static#Us=null;static#Hs=new Set;constructor({textContentSource:t,images:e,container:i,viewport:n}){if(t instanceof ReadableStream)this.#Is=t;else{if("object"!=typeof t)throw new Error('No "textContentSource" parameter specified.');this.#Is=new ReadableStream({start(e){e.enqueue(t);e.close()}})}this.#Pt=this.#Ts=i;this.#vs=e;this.#Ds=n.scale*this.#Cs;this.#ks=n.rotation;this.#As={div:null,properties:null,ctx:null};const{pageWidth:r,pageHeight:s,pageX:a,pageY:o}=n.rawDims;this.#Rs=[1,0,0,-1,-a,o+s];this.#Es=r;this.#xs=s;TextLayer.#zs();i.style.setProperty("--min-font-size",TextLayer.#Us);setLayerDimensions(i,n);this.#bs.promise.finally(()=>{TextLayer.#Hs.delete(this);this.#As=null;this.#Ps=null}).catch(()=>{})}static get fontFamilyMap(){const{isWindows:t,isFirefox:e}=FeatureTest.platform;return util_shadow(this,"fontFamilyMap",new Map([["sans-serif",(t&&e?"Calibri, ":"")+"sans-serif"],["monospace",(t&&e?"Lucida Console, ":"")+"monospace"]]))}render(){this.#vs&&this.#Pt.append(this.#vs.render());const pump=()=>{this.#Ss.read().then(({value:t,done:e})=>{if(e)this.#bs.resolve();else{this.#_s??=t.lang;Object.assign(this.#Ps,t.styles);this.#Gs(t.items);pump()}},this.#bs.reject)};this.#Ss=this.#Is.getReader();TextLayer.#Hs.add(this);pump();return this.#bs.promise}update({viewport:t,onBefore:e=null}){const i=t.scale*OutputScale.pixelRatio,n=t.rotation;if(n!==this.#ks){e?.();this.#ks=n;setLayerDimensions(this.#Ts,{rotation:n})}if(i!==this.#Ds){e?.();this.#Ds=i;this.#Cs=OutputScale.pixelRatio;const t={div:null,properties:null,ctx:TextLayer.#js(this.#_s)};for(const e of this.#Fs){t.properties=this.#Os.get(e);t.div=e;this.#Ws(t)}}}cancel(){const t=new AbortException("TextLayer task cancelled.");this.#Ss?.cancel(t).catch(()=>{});this.#Ss=null;this.#bs.reject(t)}get textDivs(){return this.#Fs}get textContentItemsStr(){return this.#Ms}#Gs(t){if(this.#ys)return;this.#As.ctx??=TextLayer.#js(this.#_s);const e=this.#Fs,i=this.#Ms;for(const n of t){if(e.length>1e5){warn("Ignoring additional textDivs for performance reasons.");this.#ys=!0;return}if(void 0!==n.str){i.push(n.str);this.#Vs(n)}else if("beginMarkedContentProps"===n.type||"beginMarkedContent"===n.type){const t=this.#Pt;this.#Pt=document.createElement("span");this.#Pt.classList.add("markedContent");n.id&&this.#Pt.setAttribute("id",n.id);"Artifact"===n.tag&&(this.#Pt.ariaHidden=!0);t.append(this.#Pt)}else"endMarkedContent"===n.type&&(this.#Pt=this.#Pt.parentNode)}}#Vs(t){const e=document.createElement("span"),i={angle:0,canvasWidth:0,hasText:""!==t.str,hasEOL:t.hasEOL,fontSize:0};this.#Fs.push(e);const n=Util.transform(this.#Rs,t.transform);let r=Math.atan2(n[1],n[0]);const s=this.#Ps[t.fontName];s.vertical&&(r+=Math.PI/2);let a=this.#ws&&s.fontSubstitution||s.fontFamily;a=TextLayer.fontFamilyMap.get(a)||a;const o=Math.hypot(n[2],n[3]),l=o*TextLayer.#$s(a,s,this.#_s);let c,h;if(0===r){c=n[4];h=n[5]-l}else{c=n[4]+l*Math.sin(r);h=n[5]-l*Math.cos(r)}const d=e.style;d.left=`${(100*c/this.#Es).toFixed(2)}%`;d.top=`${(100*h/this.#xs).toFixed(2)}%`;const u=Math.round(100*o)/100;d.setProperty("--font-height",`${u}px`);d.fontFamily=a;i.fontSize=u;e.setAttribute("role","presentation");e.textContent=t.str;e.dir=t.dir;this.#ws&&(e.dataset.fontName=s.fontSubstitutionLoadedName||t.fontName);0!==r&&(i.angle=r*(180/Math.PI));let p=!1;if(t.str.length>1)p=!0;else if(" "!==t.str&&t.transform[0]!==t.transform[3]){const e=Math.abs(t.transform[0]),i=Math.abs(t.transform[3]);e!==i&&Math.max(e,i)/Math.min(e,i)>1.5&&(p=!0)}p&&(i.canvasWidth=s.vertical?t.height:t.width);this.#Os.set(e,i);this.#As.div=e;this.#As.properties=i;this.#Ws(this.#As);i.hasText&&this.#Pt.append(e);if(i.hasEOL){const t=document.createElement("br");t.setAttribute("role","presentation");this.#Pt.append(t)}}#Ws(t){const{div:e,properties:i,ctx:n}=t,{style:r}=e,{canvasWidth:s,fontSize:a}=i;if(0!==s&&0!==a&&i.hasText){const{fontFamily:t}=r,i=this.#Cs,o=TextLayer.#qs(a*this.#Ds/i)*i;TextLayer.#Xs(n,o,t);const{width:l}=n.measureText(e.textContent);l>0&&r.setProperty("--scale-x",s*o/(l*a))}0!==i.angle&&r.setProperty("--rotate",`${i.angle}deg`)}static cleanup(){if(!(this.#Hs.size>0)){this.#Bs.clear();for(const{canvas:t}of this.#Ls.values())t.remove();this.#Ls.clear()}}static#js(t=null){let e=this.#Ls.get(t||="");if(!e){const i=document.createElement("canvas");i.style.cssText="position:absolute;top:0;left:0;width:0;height:0;display:none;letter-spacing:normal;word-spacing:normal";i.lang=t;document.body.append(i);e=i.getContext("2d",{alpha:!1,willReadFrequently:!0});this.#Ls.set(t,e);this.#Ns.set(e,{size:0,family:""})}return e}static#qs(t){t=Math.fround(t);const e=Math.fround(131073*t);return Math.fround(e-Math.fround(e-t))}static#Xs(t,e,i){const n=this.#Ns.get(t);if(e!==n.size||i!==n.family){t.font=`${e}px ${i}`;n.size=e;n.family=i}}static#zs(){if(null!==this.#Us)return;const t=document.createElement("div");t.style.opacity=0;t.style.lineHeight=1;t.style.fontSize="1px";t.style.position="absolute";t.textContent="X";document.body.append(t);this.#Us=t.getBoundingClientRect().height;t.remove()}static#$s(t,e,i){const n=this.#Bs.get(t);if(n)return n;const r=this.#js(i);this.#Xs(r,30,t);const s=r.measureText(""),a=s.fontBoundingBoxAscent,o=Math.abs(s.fontBoundingBoxDescent);let l=.8;if(a)l=a/(a+o);else{FeatureTest.platform.isFirefox&&warn("Enable the `dom.textMetrics.fontBoundingBox.enabled` preference in `about:config` to improve TextLayer rendering.");e.ascent?l=e.ascent:e.descent&&(l=1+e.descent)}this.#Bs.set(t,l);return l}}function getDocument(t={}){const e=new PDFDocumentLoadingTask,{docId:i}=e,n=t.url?function getUrlProp(t){if(t instanceof URL)return t;if("string"==typeof t){if(ui){if(/^[a-z][a-z0-9\-+.]+:/i.test(t))return new URL(t);const e=process.getBuiltinModule("url");return new URL(e.pathToFileURL(t))}const e=URL.parse(t,window.location);if(e)return e}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}(t.url):null,r=t.data?function getDataProp(t){if(ui&&"undefined"!=typeof Buffer&&t instanceof Buffer)throw new Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");if(t instanceof Uint8Array&&t.byteLength===t.buffer.byteLength)return t;if("string"==typeof t)return stringToBytes(t);if(t instanceof ArrayBuffer||ArrayBuffer.isView(t)||"object"==typeof t&&!isNaN(t?.length))return new Uint8Array(t);throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")}(t.data):null,s=t.httpHeaders||null,a=!0===t.withCredentials,o=t.password??null,l=t.range instanceof PDFDataRangeTransport?t.range:null,c=Number.isInteger(t.rangeChunkSize)&&t.rangeChunkSize>0?t.rangeChunkSize:65536;let h=t.worker instanceof PDFWorker?t.worker:null;const d=t.verbosity,u="string"!=typeof t.docBaseUrl||isDataScheme(t.docBaseUrl)?null:t.docBaseUrl,p=getFactoryUrlProp(t.cMapUrl),g=!1!==t.cMapPacked,f=getFactoryUrlProp(t.iccUrl),m=getFactoryUrlProp(t.standardFontDataUrl),b=getFactoryUrlProp(t.wasmUrl),y=!0!==t.stopAtErrors,w=Number.isInteger(t.maxImageSize)&&t.maxImageSize>-1?t.maxImageSize:-1,v="boolean"==typeof t.isOffscreenCanvasSupported?t.isOffscreenCanvasSupported:!ui,_="boolean"==typeof t.isImageDecoderSupported?t.isImageDecoderSupported:!ui,A=Number.isInteger(t.canvasMaxAreaInBytes)?t.canvasMaxAreaInBytes:-1,x="boolean"==typeof t.disableFontFace?t.disableFontFace:ui,E=!0===t.fontExtraProperties,C=!0===t.enableXfa,S=t.ownerDocument||globalThis.document,T=!0===t.disableRange,k=!0===t.disableStream,D=!0===t.disableAutoFetch,P=!0===t.pdfBug,M=t.CanvasFactory||(ui?NodeCanvasFactory:DOMCanvasFactory),I=t.FilterFactory||(ui?NodeFilterFactory:DOMFilterFactory),O=t.BinaryDataFactory||(ui?NodeBinaryDataFactory:DOMBinaryDataFactory),R=!0===t.enableHWA,B=!0===t.enableWebGPU?function initGPU(){return Bn.init()}():Promise.resolve(!1),L=!1!==t.useWasm,N=t.pagesMapper||new PagesMapper,U="boolean"==typeof t.useSystemFonts?t.useSystemFonts:!ui&&!x,H="boolean"==typeof t.useWorkerFetch?t.useWorkerFetch:!!(O===DOMBinaryDataFactory&&p&&g&&m&&b&&isValidFetchUrl(p,document.baseURI)&&isValidFetchUrl(m,document.baseURI)&&isValidFetchUrl(b,document.baseURI));setVerbosityLevel(d);const z={canvasFactory:new M({ownerDocument:S,enableHWA:R}),filterFactory:new I({docId:i,ownerDocument:S}),binaryDataFactory:H?null:new O({cMapUrl:p,standardFontDataUrl:m,wasmUrl:b})};if(!h){h=PDFWorker.create({verbosity:d,port:GlobalWorkerOptions.workerPort});e._worker=h}const G={docId:i,apiVersion:"6.4.299",data:r,password:o,disableAutoFetch:D,rangeChunkSize:c,docBaseUrl:u,enableXfa:C,evaluatorOptions:{maxImageSize:w,disableFontFace:x,ignoreErrors:y,isOffscreenCanvasSupported:v,isImageDecoderSupported:_,canvasMaxAreaInBytes:A,fontExtraProperties:E,useSystemFonts:U,useWasm:L,useWorkerFetch:H,cMapUrl:p,cMapPacked:g,iccUrl:f,standardFontDataUrl:m,wasmUrl:b,hasGPU:!1}},j={ownerDocument:S,pdfBug:P,styleElement:null,enableHWA:R,loadingParams:{disableAutoFetch:D,enableXfa:C}};Promise.all([h.promise,B]).then(function([,t]){if(h.destroyed)throw new Error("Worker was destroyed");G.evaluatorOptions.hasGPU=t;const o=h.messageHandler.sendWithPromise("GetDocRequest",G,r?[r.buffer]:null);let d;if(r);else if(l)d=new PDFDataTransportStream({pdfDataRangeTransport:l,disableRange:T,disableStream:k});else{if(!n)throw new Error("getDocument - expected either `data`, `range`, or `url` parameter.");{const t=function getNetworkStream(t){return isValidFetchUrl(t)?PDFFetchStream:ui?PDFNodeStream:PDFNetworkStream}(n);d=new t({url:n,httpHeaders:s,withCredentials:a,rangeChunkSize:c,disableRange:T,disableStream:k})}}return o.then(t=>{if(h.destroyed)throw new Error("Worker was destroyed");const n=new MessageHandler(i,t,h.port),r=new WorkerTransport(n,e,d,j,z,N);e._transport=r;if(e.destroyed)throw new Error("Loading aborted");n.send("Ready",null)})}).catch(e._capability.reject).finally(e._setupCapability.resolve);return e}class PDFDocumentLoadingTask{static#$n=0;_capability=Promise.withResolvers();_setupCapability=Promise.withResolvers();_transport=null;_worker=null;docId="d"+PDFDocumentLoadingTask.#$n++;destroyed=!1;onPassword=null;onProgress=null;get promise(){return this._capability.promise}async destroy(){this.destroyed=!0;this._capability.promise.catch(()=>{});try{this._worker?.port&&(this._worker._pendingDestroy=!0);await this._setupCapability.promise;await(this._transport?.destroy())}catch(t){this._worker?.port&&delete this._worker._pendingDestroy;throw t}this._transport=null;this._worker?.destroy();this._worker=null}async getData(){return this._transport.getData()}}class PDFDataRangeTransport{#bs=Promise.withResolvers();#Ks=null;constructor(t,e,i=!1,n=null){this.length=t;this.initialData=e;this.progressiveDone=i;this.contentDispositionFilename=n}onDataRange(t,e){this.#Ks({type:"range",begin:t,chunk:e})}onDataProgressiveRead(t){this.#bs.promise.then(()=>{this.#Ks({type:"progressiveRead",chunk:t})})}onDataProgressiveDone(){this.#bs.promise.then(()=>{this.#Ks({type:"progressiveDone"})})}transportReady(t){this.#Ks=t;this.#bs.resolve()}requestDataRange(t,e){unreachable("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}}class PDFDocumentProxy{constructor(t,e){this._pdfInfo=t;this._transport=e}get pagesMapper(){return this._transport.pagesMapper}get annotationStorage(){return this._transport.annotationStorage}get canvasFactory(){return this._transport.canvasFactory}get filterFactory(){return this._transport.filterFactory}get numPages(){return this._pdfInfo.numPages}get fingerprints(){return this._pdfInfo.fingerprints}get isPureXfa(){return util_shadow(this,"isPureXfa",!!this._transport._htmlForXfa)}get allXfaHtml(){return this._transport._htmlForXfa}getPage(t){return this._transport.getPage(t)}getPageIndex(t){return this._transport.getPageIndex(t)}getDestinations(){return this._transport.getDestinations()}getDestination(t){return this._transport.getDestination(t)}getPageLabels(){return this._transport.getPageLabels()}getPageLayout(){return this._transport.getPageLayout()}getPageMode(){return this._transport.getPageMode()}getViewerPreferences(){return this._transport.getViewerPreferences()}getOpenAction(){return this._transport.getOpenAction()}getAttachments(){return this._transport.getAttachments()}getAttachmentContent(t){return this._transport.getAttachmentContent(t)}getAnnotationsByType(t,e){return this._transport.getAnnotationsByType(t,e)}getJSActions(){return this._transport.getDocJSActions()}getOutline(){return this._transport.getOutline()}getOptionalContentConfig({intent:t="display"}={}){const{renderingIntent:e}=this._transport.getRenderingIntent(t);return this._transport.getOptionalContentConfig(e)}getPermissions(){return this._transport.getPermissions()}getMetadata(){return this._transport.getMetadata()}getMarkInfo(){return this._transport.getMarkInfo()}getData(){return this._transport.getData()}saveDocument(t){return this._transport.saveDocument(t)}extractPages(t,e=null){return this._transport.extractPages(t,e)}getDownloadInfo(){return this._transport.downloadInfoCapability.promise}cleanup(t=!1){return this._transport.startCleanup(t||this.isPureXfa)}cachedPageNumber(t){return this._transport.cachedPageNumber(t)}get loadingParams(){return this._transport.loadingParams}get loadingTask(){return this._transport.loadingTask}getFieldObjects(){return this._transport.getFieldObjects()}getSignatures(){return this._transport.getSignatures()}getSignatureData(t){return this._transport.getSignatureData(t)}hasJSActions(){return this._transport.hasJSActions()}getCalculationOrderIds(){return this._transport.getCalculationOrderIds()}}class PDFPageProxy{#Ys=!1;#Js=null;static#Qs=0;constructor(t,e,i,n,r=!1){this._pageIndex=t;this._id=PDFPageProxy.#Qs++;this._pageInfo=e;this._transport=i;this._stats=r?new StatTimer:null;this._pdfBug=r;this.commonObjs=i.commonObjs;this.objs=new PDFObjects;this._intentStates=new Map;this.destroyed=!1;this.recordedBBoxes=null;this.#Js=n;this.imageCoordinates=null}clone(t){const e=new PDFPageProxy(t,this._pageInfo,this._transport,this.#Js,this._pdfBug);e.clonedFromIndex=this.clonedFromIndex??this._pageIndex;this._transport.updatePage(e);return e}get pageNumber(){return this._pageIndex+1}set pageNumber(t){this._pageIndex=t-1;this._transport.updatePage(this)}get rotate(){return this._pageInfo.rotate}get ref(){return this._pageInfo.ref}get userUnit(){return this._pageInfo.userUnit}get view(){return this._pageInfo.view}getViewport({scale:t,rotation:e=this.rotate,offsetX:i=0,offsetY:n=0,dontFlip:r=!1}={}){return new PageViewport({viewBox:this.view,userUnit:this.userUnit,scale:t,rotation:e,offsetX:i,offsetY:n,dontFlip:r})}getAnnotations({intent:t="display"}={}){const{renderingIntent:e}=this._transport.getRenderingIntent(t);return this._transport.getAnnotations(this._pageIndex,e)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get filterFactory(){return this._transport.filterFactory}get isPureXfa(){return util_shadow(this,"isPureXfa",!!this._transport._htmlForXfa)}async getXfa(){return this._transport._htmlForXfa?.children[this._pageIndex]||null}render({canvasContext:t,canvas:e=t.canvas,viewport:i,intent:n="display",annotationMode:r=Ci.ENABLE,transform:s=null,background:a=null,optionalContentConfigPromise:o=null,annotationCanvasMap:l=null,pageColors:c=null,printAnnotationStorage:h=null,isEditing:d=!1,recordImages:u=!1,recordOperations:p=!1,operationsFilter:g=null}){this._stats?.time("Overall");const f=this._transport.getRenderingIntent(n,r,h,d),{renderingIntent:m,cacheKey:b}=f;this.#Ys=!1;o||=this._transport.getOptionalContentConfig(m);const y=this._intentStates.getOrInsertComputed(b,makeObj);if(y.streamReaderCancelTimeout){clearTimeout(y.streamReaderCancelTimeout);y.streamReaderCancelTimeout=null}const w=!!(m&wi);if(!y.displayReadyCapability){y.displayReadyCapability=Promise.withResolvers();y.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null};this._stats?.time("Page Request");this._pumpOperatorList(f)}const v=!(!this._pdfBug||!globalThis.StepperManager?.enabled),_=!!e&&!this.recordedBBoxes&&(p||v),A=!!e&&!this.imageCoordinates&&u,complete=t=>{y.renderTasks.delete(C);if(_){const t=C.gfx?.dependencyTracker.take();if(t){C.stepper?.setOperatorBBoxes(t,C.gfx.dependencyTracker.takeDebugMetadata());p&&(this.recordedBBoxes=t)}}A&&!t&&(this.imageCoordinates=C.gfx?.imagesTracker.take());w&&(this.#Ys=!0);this.#Zs();if(t){C.capability.reject(t);this._abortOperatorList({intentState:y,reason:t instanceof Error?t:new Error(t)})}else C.capability.resolve();if(this._stats){this._stats.timeEnd("Rendering");this._stats.timeEnd("Overall");globalThis.Stats?.enabled&&globalThis.Stats.add(this.pageNumber,this._stats)}};let x=null,E=null;(_||A)&&(E=new CanvasBBoxTracker(e,y.operatorList.length));_&&(x=new CanvasDependencyTracker(E,v));const C=new InternalRenderTask({callback:complete,params:{canvas:e,canvasContext:t,dependencyTracker:x??E,imagesTracker:A?new CanvasImagesTracker(e):null,viewport:i,transform:s,background:a},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:l,operatorList:y.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!w,pdfBug:this._pdfBug,pageColors:c,enableHWA:this._transport.enableHWA,operationsFilter:g});(y.renderTasks||=new Set).add(C);const S=C.task;Promise.all([y.displayReadyCapability.promise,o]).then(([t,e])=>{if(this.destroyed)complete();else{this._stats?.time("Rendering");if(!(e.renderingIntent&m))throw new Error("Must use the same `intent`-argument when calling the `PDFPageProxy.render` and `PDFDocumentProxy.getOptionalContentConfig` methods.");C.initializeGraphics({transparency:t,optionalContentConfig:e});C.operatorListChanged()}}).catch(complete);return S}getOperatorList({intent:t="display",annotationMode:e=Ci.ENABLE,printAnnotationStorage:i=null,isEditing:n=!1}={}){const r=this._transport.getRenderingIntent(t,e,i,n,!0),s=this._intentStates.getOrInsertComputed(r.cacheKey,makeObj);let a;if(!s.opListReadCapability){a=Object.create(null);a.operatorListChanged=function operatorListChanged(){if(s.operatorList.lastChunk){s.opListReadCapability.resolve(s.operatorList);s.renderTasks.delete(a)}};s.opListReadCapability=Promise.withResolvers();(s.renderTasks||=new Set).add(a);s.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null};this._stats?.time("Page Request");this._pumpOperatorList(r)}return s.opListReadCapability.promise}streamTextContent({includeMarkedContent:t=!1,disableNormalization:e=!1}={}){return this._transport.messageHandler.sendWithStream("GetTextContent",{pageId:this.#Js.getPageId(this._pageIndex+1)-1,pageIndex:this._pageIndex,includeMarkedContent:!0===t,disableNormalization:!0===e},{highWaterMark:100,size:t=>t.items.length})}async getTextContent(t={}){if(this._transport._htmlForXfa)return this.getXfa().then(t=>XfaText.textContent(t));const e=this.streamTextContent(t),i={items:[],styles:Object.create(null),lang:null};for await(const t of e){i.lang??=t.lang;Object.assign(i.styles,t.styles);i.items.push(...t.items)}return i}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;const t=[];for(const e of this._intentStates.values()){this._abortOperatorList({intentState:e,reason:new Error("Page was destroyed."),force:!0});if(!e.opListReadCapability)for(const i of e.renderTasks){t.push(i.completed);i.cancel()}}this.objs.clear();this.#Ys=!1;return Promise.all(t)}cleanup(t=!1){this.#Ys=!0;const e=this.#Zs();t&&e&&(this._stats&&=new StatTimer);return e}#Zs(){if(!this.#Ys||this.destroyed)return!1;for(const{renderTasks:t,operatorList:e}of this._intentStates.values())if(t.size>0||!e.lastChunk)return!1;this._intentStates.clear();this.objs.clear();this.#Ys=!1;return!0}_startRenderPage(t,e){const i=this._intentStates.get(e);if(i){this._stats?.timeEnd("Page Request");i.displayReadyCapability?.resolve(t)}}_renderPageChunk(t,e){for(let i=0,n=t.length;i{a.read().then(({value:t,done:e})=>{if(e)o.streamReader=null;else if(!this._transport.destroyed){this._renderPageChunk(t,o);pump()}},t=>{o.streamReader=null;if(!this._transport.destroyed){if(o.operatorList){o.operatorList.lastChunk=!0;for(const t of o.renderTasks)t.operatorListChanged();this.#Zs()}if(o.displayReadyCapability)o.displayReadyCapability.reject(t);else{if(!o.opListReadCapability)throw t;o.opListReadCapability.reject(t)}}})};pump()}_abortOperatorList({intentState:t,reason:e,force:i=!1}){if(t.streamReader){if(t.streamReaderCancelTimeout){clearTimeout(t.streamReaderCancelTimeout);t.streamReaderCancelTimeout=null}if(!i){if(t.renderTasks.size>0)return;if(e instanceof RenderingCancelledException){let i=100;e.extraDelay>0&&e.extraDelay<1e3&&(i+=e.extraDelay);t.streamReaderCancelTimeout=setTimeout(()=>{t.streamReaderCancelTimeout=null;this._abortOperatorList({intentState:t,reason:e,force:!0})},i);return}}t.streamReader.cancel(new AbortException(e.message)).catch(()=>{});t.streamReader=null;if(!this._transport.destroyed){for(const[e,i]of this._intentStates)if(i===t){this._intentStates.delete(e);break}this.cleanup()}}}get stats(){return this._stats}}class PDFWorker{#bs=Promise.withResolvers();#ta=null;#qr=null;#ea=null;static#ia=0;static#na=!1;static#ra=new WeakMap;static{if(ui){this.#na=!0;GlobalWorkerOptions.workerSrc||="./pdf.worker.mjs"}this._isSameOrigin=(t,e)=>{const i=URL.parse(t);if(!i?.origin||"null"===i.origin)return!1;const n=new URL(e,i);return i.origin===n.origin};this._createCDNWrapper=t=>{const e=`await import("${t}");`;return URL.createObjectURL(new Blob([e],{type:"text/javascript"}))}}constructor({name:t=null,port:e=null,verbosity:i=getVerbosityLevel()}={}){this.name=t;this.destroyed=!1;this.verbosity=i;if(e){if(PDFWorker.#ra.has(e))throw new Error("Cannot use more than one PDFWorker per port.");PDFWorker.#ra.set(e,this);this.#sa(e)}else this.#aa()}get promise(){return this.#bs.promise}#oa(){this.#bs.resolve();this.#ta.send("configure",{verbosity:this.verbosity})}get port(){return this.#qr}get messageHandler(){return this.#ta}#sa(t){this.#qr=t;this.#ta=new MessageHandler("main","worker",t);this.#ta.on("ready",()=>{});this.#oa()}#aa(){if(PDFWorker.#na||PDFWorker.#la){this.#ca();return}let{workerSrc:t}=PDFWorker;try{PDFWorker._isSameOrigin(window.location,t)||(t=PDFWorker._createCDNWrapper(new URL(t,window.location).href));const e=new Worker(t,{type:"module"}),i=new MessageHandler("main","worker",e),terminateEarly=()=>{n.abort();i.destroy();e.terminate();this.destroyed?this.#bs.reject(new Error("Worker was destroyed")):this.#ca()},n=new AbortController;e.addEventListener("error",()=>{this.#ea||terminateEarly()},{signal:n.signal});i.on("ready",t=>{n.abort();if(!this.destroyed&&t instanceof Uint8Array){this.#ta=i;this.#qr=e;this.#ea=e;this.#oa()}else terminateEarly()})}catch{info("The worker has been disabled.");this.#ca()}}#ca(){if(!PDFWorker.#na){warn("Setting up fake worker.");PDFWorker.#na=!0}PDFWorker._setupFakeWorkerGlobal.then(t=>{if(this.destroyed){this.#bs.reject(new Error("Worker was destroyed"));return}const e=new LoopbackPort;this.#qr=e;const i="fake"+PDFWorker.#ia++,n=new MessageHandler(i+"_worker",i,e);t.setup(n,e);this.#ta=new MessageHandler(i,i+"_worker",e);this.#oa()}).catch(t=>{this.#bs.reject(new Error(`Setting up fake worker failed: "${t.message}".`))})}destroy(){this.destroyed=!0;this.#ea?.terminate();this.#ea=null;PDFWorker.#ra.delete(this.#qr);this.#qr=null;this.#ta?.destroy();this.#ta=null}static create(t){const e=this.#ra.get(t?.port);if(e){if(e._pendingDestroy)throw new Error("PDFWorker.create - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");return e}return new PDFWorker(t)}static get workerSrc(){if(GlobalWorkerOptions.workerSrc)return GlobalWorkerOptions.workerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get#la(){try{return globalThis.pdfjsWorker?.WorkerMessageHandler||null}catch{return null}}static get _setupFakeWorkerGlobal(){return util_shadow(this,"_setupFakeWorkerGlobal",(async()=>{if(this.#la)return this.#la;return(await(import( + * pdfjsVersion = 6.5.438 + * pdfjsBuild = 0a4153349 + */var t={463(t){var e=TypeError;t.exports=function(t){if("string"==typeof t)return t;throw new e("Argument is not a string")}},804(t){var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",i=e+"+/",n=e+"-_",inverse=function(t){for(var e={},i=0;i<64;i++)e[t.charAt(i)]=i;return e};t.exports={i2c:i,c2i:inverse(i),i2cUrl:n,c2iUrl:inverse(n)}},529(t){t.exports=function(t,e){return{value:t,done:e}}},837(t){var e=TypeError;t.exports=function(t){if(t>9007199254740991)throw new e("Maximum allowed index exceeded");return t}},2(t){t.exports={IndexSizeError:{s:"INDEX_SIZE_ERR",c:1,m:1},DOMStringSizeError:{s:"DOMSTRING_SIZE_ERR",c:2,m:0},HierarchyRequestError:{s:"HIERARCHY_REQUEST_ERR",c:3,m:1},WrongDocumentError:{s:"WRONG_DOCUMENT_ERR",c:4,m:1},InvalidCharacterError:{s:"INVALID_CHARACTER_ERR",c:5,m:1},NoDataAllowedError:{s:"NO_DATA_ALLOWED_ERR",c:6,m:0},NoModificationAllowedError:{s:"NO_MODIFICATION_ALLOWED_ERR",c:7,m:1},NotFoundError:{s:"NOT_FOUND_ERR",c:8,m:1},NotSupportedError:{s:"NOT_SUPPORTED_ERR",c:9,m:1},InUseAttributeError:{s:"INUSE_ATTRIBUTE_ERR",c:10,m:1},InvalidStateError:{s:"INVALID_STATE_ERR",c:11,m:1},SyntaxError:{s:"SYNTAX_ERR",c:12,m:1},InvalidModificationError:{s:"INVALID_MODIFICATION_ERR",c:13,m:1},NamespaceError:{s:"NAMESPACE_ERR",c:14,m:1},InvalidAccessError:{s:"INVALID_ACCESS_ERR",c:15,m:1},ValidationError:{s:"VALIDATION_ERR",c:16,m:0},TypeMismatchError:{s:"TYPE_MISMATCH_ERR",c:17,m:1},SecurityError:{s:"SECURITY_ERR",c:18,m:1},NetworkError:{s:"NETWORK_ERR",c:19,m:1},AbortError:{s:"ABORT_ERR",c:20,m:1},URLMismatchError:{s:"URL_MISMATCH_ERR",c:21,m:1},QuotaExceededError:{s:"QUOTA_EXCEEDED_ERR",c:22,m:1},TimeoutError:{s:"TIMEOUT_ERR",c:23,m:1},InvalidNodeTypeError:{s:"INVALID_NODE_TYPE_ERR",c:24,m:1},DataCloneError:{s:"DATA_CLONE_ERR",c:25,m:1}}},944(t){var e=TypeError;t.exports=function(t){var i=t&&t.alphabet;if(void 0===i||"base64"===i||"base64url"===i)return i||"base64";throw new e("Incorrect `alphabet` option")}},767(t){t.exports=function(t){return{iterator:t,next:t.next,done:!1}}},117(t){t.exports=function(t){return null==t}},859(t){t.exports=function(t){t.iterator=t.next=t.nextHandler=t.mapper=t.predicate=t.inner=t.iterables=t.iters=t.openIters=t.padding=t.finishResults=t.buffer=null}},684(t){t.exports=function(t,e){var i="function"==typeof Iterator&&Iterator.prototype[t];if(i)try{i.call({next:null},e).next()}catch(t){return!0}}},269(t){t.exports=Object.create?Object.create(null):{}},741(t){var e=Math.ceil,i=Math.floor;t.exports=Math.trunc||function trunc(t){var n=+t;return(n>0?i:e)(n)}},149(t){var e=RangeError;t.exports=function(t){if(t==t)return t;throw new e("NaN is not allowed")}},717(t,e){e.f=Object.getOwnPropertySymbols},103(t){t.exports=function(t){try{return{error:!1,value:t()}}catch(t){return{error:!0,value:t}}}},750(t,e,i){var n=i(117),r=TypeError;t.exports=function(t){if(n(t))throw new r("Can't call method on "+t);return t}},835(t){t.exports=function(t){try{var e=new Set,i={size:0,has:function(){return!0},keys:function(){return Object.defineProperty({},"next",{get:function(){e.clear();e.add(4);return function(){return{done:!0}}}})}},n=e[t](i);return 1===n.size&&4===n.values().next().value}catch(t){return!1}}},291(t,e,i){var n=i(741);t.exports=function(t){var e=+t;return e!=e||0===e?0:n(e)}},14(t,e,i){var n=i(291),r=Math.min;t.exports=function(t){var e=n(t);return e>0?r(e,9007199254740991):0}},981(t,e,i){var n=i(750),r=Object;t.exports=function(t){return r(n(t))}},590(t,e,i){var n=i(291),r=RangeError;t.exports=function(t){var e=n(t);if(e<0)throw new r("The argument can't be less than 0");return e}},812(t){var e=TypeError;t.exports=function(t,i){if(t{var e;return()=>{if(t){var i=t;t=0;e={exports:{}};i.call(e.exports,e,e.exports)}return e.exports}};__webpack_require__.d=(t,e)=>{for(var i in e)__webpack_require__.o(e,i)&&!__webpack_require__.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})};__webpack_require__.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var i=__webpack_require__.cw(t=>{var e=mt(),i=ve(),n=TypeError;t.exports=function(t){if(e(t))return t;throw new n(i(t)+" is not a function")}}),n=__webpack_require__.cw(t=>{var e=yt(),i=String,n=TypeError;t.exports=function(t){if(e(t))return t;throw new n("Can't set "+i(t)+" as a prototype")}}),r=__webpack_require__.cw(t=>{var e=Qt().has;t.exports=function(t){e(t);return t}}),a_string_namespaceFn=()=>__webpack_require__(463),s=__webpack_require__.cw(t=>{var e=ke(),i=new e.WeakMap,n=e.set,r=e.remove;t.exports=function(t){n(i,t,1);r(i,t);return t}}),a=__webpack_require__.cw(t=>{var e=ke().has;t.exports=function(t){e(t);return t}}),o=__webpack_require__.cw(t=>{var e=Pe(),i=Rt(),n=Lt().f,r=e("unscopables"),s=Array.prototype;void 0===s[r]&&n(s,r,{configurable:!0,value:i(null)});t.exports=function(t){s[r][t]=!0}}),l=__webpack_require__.cw(t=>{var e=zt(),i=TypeError;t.exports=function(t,n){if(e(n,t))return t;throw new i("Incorrect invocation")}}),c=__webpack_require__.cw(t=>{var e=bt(),i=String,n=TypeError;t.exports=function(t){if(void 0===t||e(t))return t;throw new n(i(t)+" is not an object or undefined")}}),h=__webpack_require__.cw(t=>{var e=bt(),i=String,n=TypeError;t.exports=function(t){if(e(t))return t;throw new n(i(t)+" is not an object")}}),d=__webpack_require__.cw(t=>{var e=x(),i=TypeError;t.exports=function(t){if("Uint8Array"===e(t))return t;throw new i("Argument is not an Uint8Array")}}),u=__webpack_require__.cw(t=>{t.exports="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView}),p=__webpack_require__.cw(t=>{var e=it(),i=$(),n=A(),r=e.ArrayBuffer,s=e.TypeError;t.exports=r&&i(r.prototype,"byteLength","get")||function(t){if("ArrayBuffer"!==n(t))throw new s("ArrayBuffer expected");return t.byteLength}}),g=__webpack_require__.cw(t=>{var e=it(),i=u(),n=p(),r=e.DataView;t.exports=function(t){if(!i||0!==n(t))return!1;try{new r(t);return!1}catch(t){return!0}}}),m=__webpack_require__.cw(t=>{var e=g(),i=TypeError;t.exports=function(t){if(e(t))throw new i("ArrayBuffer is detached");return t}}),f=__webpack_require__.cw(t=>{var e,i,n,r=u(),s=O(),a=it(),o=mt(),l=bt(),c=nt(),h=x(),d=ve(),p=S(),g=M(),m=P(),f=zt(),b=Ht(),y=Vt(),w=Pe(),v=_e(),_=dt(),A=_.enforce,C=_.get,E=a.Int8Array,T=E&&E.prototype,k=a.Uint8ClampedArray,D=k&&k.prototype,I=E&&b(E),R=T&&b(T),B=Object.prototype,L=a.TypeError,N=w("toStringTag"),U=v("TYPED_ARRAY_TAG"),H="TypedArrayConstructor",z=r&&!!y&&"Opera"!==h(a.opera),G=!1,W={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},j={BigInt64Array:8,BigUint64Array:8},getTypedArrayConstructor=function(t){var e=b(t);if(l(e)){var i=C(e);return i&&c(i,H)?i[H]:getTypedArrayConstructor(e)}},isTypedArray=function(t){if(!l(t))return!1;var e=h(t);return c(W,e)||c(j,e)};for(e in W)(n=(i=a[e])&&i.prototype)?A(n)[H]=i:z=!1;for(e in j)(n=(i=a[e])&&i.prototype)&&(A(n)[H]=i);if(!z||!o(I)||I===Function.prototype){I=function TypedArray(){throw new L("Incorrect invocation")};if(z)for(e in W)a[e]&&y(a[e],I)}if(!z||!R||R===B){R=I.prototype;if(z)for(e in W)a[e]&&y(a[e].prototype,R)}z&&b(D)!==R&&y(D,R);if(s&&!c(R,N)){G=!0;m(R,N,{configurable:!0,get:function(){return l(this)?this[U]:void 0}});for(e in W)a[e]&&p(a[e].prototype,U,e)}t.exports={NATIVE_ARRAY_BUFFER_VIEWS:z,TYPED_ARRAY_TAG:G&&U,aTypedArray:function(t){if(isTypedArray(t))return t;throw new L("Target is not a typed array")},aTypedArrayConstructor:function(t){if(o(t)&&(!y||f(I,t)))return t;throw new L(d(t)+" is not a typed array constructor")},exportTypedArrayMethod:function(t,e,i,n){if(s){if(i)for(var r in W){var o=a[r];if(o&&c(o.prototype,t))try{delete o.prototype[t]}catch(i){try{o.prototype[t]=e}catch(t){}}}R[t]&&!i||g(R,t,i?e:z&&T[t]||e,n)}},exportTypedArrayStaticMethod:function(t,e,i){var n,r;if(s){if(y){if(i)for(n in W)if((r=a[n])&&c(r,t))try{delete r[t]}catch(t){}if(I[t]&&!i)return;try{return g(I,t,i?e:z&&I[t]||e)}catch(t){}}for(n in W)!(r=a[n])||r[t]&&!i||g(r,t,e)}},getTypedArrayConstructor,isView:function isView(t){if(!l(t))return!1;var e=h(t);return"DataView"===e||c(W,e)||c(j,e)},isTypedArray,TypedArray:I,TypedArrayPrototype:R}}),b=__webpack_require__.cw(t=>{var e=Pt();t.exports=function(t,i,n){for(var r=0,s=arguments.length>2?n:e(i),a=new t(s);s>r;)a[r]=i[r++];return a}}),y=__webpack_require__.cw(t=>{var e=me(),i=pe(),n=Pt(),createMethod=function(t){return function(r,s,a){var o=e(r),l=n(o);if(0===l)return!t&&-1;var c,h=i(a,l);if(t&&s!=s){for(;l>h;)if((c=o[h++])!=c)return!0}else for(;l>h;h++)if((t||h in o)&&o[h]===s)return t||h||0;return!t&&-1}};t.exports={includes:createMethod(!0),indexOf:createMethod(!1)}}),w=__webpack_require__.cw(t=>{var e=O(),i=pt(),n=TypeError,r=Object.getOwnPropertyDescriptor,s=e&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(t){return t instanceof TypeError}}();t.exports=s?function(t,e){if(i(t)&&!r(t,"length").writable)throw new n("Cannot set read only .length");return t.length=e}:function(t,e){return t.length=e}}),v=__webpack_require__.cw(t=>{var e=K();t.exports=e([].slice)}),base64_map_namespaceFn=()=>__webpack_require__(804),_=__webpack_require__.cw(t=>{var e=h(),i=Et();t.exports=function(t,n,r,s){try{return s?n(e(r)[0],r[1]):n(r)}catch(e){i(t,"throw",e)}}}),A=__webpack_require__.cw(t=>{var e=K(),i=e({}.toString),n=e("".slice);t.exports=function(t){return n(i(t),8,-1)}}),x=__webpack_require__.cw(t=>{var e=ye(),i=mt(),n=A(),r=Pe()("toStringTag"),s=Object,a="Arguments"===n(function(){return arguments}());t.exports=e?n:function(t){var e,o,l;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(o=function(t,e){try{return t[e]}catch(t){}}(e=s(t),r))?o:a?n(e):"Object"===(l=n(e))&&i(e.callee)?"Arguments":l}}),C=__webpack_require__.cw(t=>{var e=nt(),i=$t(),n=Nt(),r=Lt();t.exports=function(t,s,a){for(var o=i(s),l=r.f,c=n.f,h=0;h{var e=z();t.exports=!e(function(){function F(){}F.prototype.constructor=null;return Object.getPrototypeOf(new F)!==F.prototype})}),S=__webpack_require__.cw(t=>{var e=O(),i=Lt(),n=T();t.exports=e?function(t,e,r){return i.f(t,e,n(1,r))}:function(t,e,i){t[e]=i;return t}}),T=__webpack_require__.cw(t=>{t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}}),k=__webpack_require__.cw(t=>{var e=O(),i=Lt(),n=T();t.exports=function(t,r,s){e?i.f(t,r,n(0,s)):t[r]=s}}),P=__webpack_require__.cw(t=>{var e=Mt(),i=Lt();t.exports=function(t,n,r){r.get&&e(r.get,n,{getter:!0});r.set&&e(r.set,n,{setter:!0});return i.f(t,n,r)}}),M=__webpack_require__.cw(t=>{var e=mt(),i=Lt(),n=Mt(),r=I();t.exports=function(t,s,a,o){o||(o={});var l=o.enumerable,c=void 0!==o.name?o.name:s;e(a)&&n(a,c,o);if(o.global)l?t[s]=a:r(s,a);else{try{o.unsafe?t[s]&&(l=!0):delete t[s]}catch(t){}l?t[s]=a:i.f(t,s,{value:a,enumerable:!1,configurable:!o.nonConfigurable,writable:!o.nonWritable})}return t}}),D=__webpack_require__.cw(t=>{var e=M();t.exports=function(t,i,n){for(var r in i)e(t,r,i[r],n);return t}}),I=__webpack_require__.cw(t=>{var e=it(),i=Object.defineProperty;t.exports=function(t,n){try{i(e,t,{value:n,configurable:!0,writable:!0})}catch(i){e[t]=n}return n}}),O=__webpack_require__.cw(t=>{var e=z();t.exports=!e(function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]})}),R=__webpack_require__.cw(t=>{var e=it(),i=bt(),n=e.document,r=i(n)&&i(n.createElement);t.exports=function(t){return r?n.createElement(t):{}}}),B=__webpack_require__.cw(t=>{t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]}),L=__webpack_require__.cw(t=>{var e=it().navigator,i=e&&e.userAgent;t.exports=i?String(i):""}),N=__webpack_require__.cw(t=>{var e,i,n=it(),r=L(),s=n.process,a=n.Deno,o=s&&s.versions||a&&a.version,l=o&&o.v8;l&&(i=(e=l.split("."))[0]>0&&e[0]<4?1:+(e[0]+e[1]));!i&&r&&(!(e=r.match(/Edge\/(\d+)/))||e[1]>=74)&&(e=r.match(/Chrome\/(\d+)/))&&(i=+e[1]);t.exports=i}),U=__webpack_require__.cw(t=>{var e=K(),i=Error,n=e("".replace),r=String(new i("zxcasd").stack),s=/\n\s*at [^:]*:[^\n]*/,a=s.test(r);t.exports=function(t,e){if(a&&"string"==typeof t&&!i.prepareStackTrace)for(;e--;)t=n(t,s,"");return t}}),H=__webpack_require__.cw(t=>{var e=it(),i=Nt().f,n=S(),r=M(),s=I(),a=C(),o=ft();t.exports=function(t,l){var c,h,d,u,p,g=t.target,m=t.global,f=t.stat;if(c=m?e:f?e[g]||s(g,{}):e[g]&&e[g].prototype)for(h in l){u=l[h];d=t.dontCallGetSet?(p=i(c,h))&&p.value:c[h];if(!o(m?h:g+(f?".":"#")+h,t.forced)&&void 0!==d){if(typeof u==typeof d)continue;a(u,d)}(t.sham||d&&d.sham)&&n(u,"sham",!0);r(c,h,u,t)}}}),z=__webpack_require__.cw(t=>{t.exports=function(t){try{return!!t()}catch(t){return!0}}}),G=__webpack_require__.cw(t=>{var e=j(),i=Function.prototype,n=i.apply,r=i.call;t.exports="object"==typeof Reflect&&Reflect.apply||(e?r.bind(n):function(){return r.apply(n,arguments)})}),W=__webpack_require__.cw(t=>{var e=X(),n=i(),r=j(),s=e(e.bind);t.exports=function(t,e){n(t);return void 0===e?t:r?s(t,e):function(){return t.apply(e,arguments)}}}),j=__webpack_require__.cw(t=>{var e=z();t.exports=!e(function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")})}),V=__webpack_require__.cw(t=>{var e=j(),i=Function.prototype.call;t.exports=e?i.bind(i):function(){return i.apply(i,arguments)}}),q=__webpack_require__.cw(t=>{var e=O(),i=nt(),n=Function.prototype,r=e&&Object.getOwnPropertyDescriptor,s=i(n,"name"),a=s&&(!e||e&&r(n,"name").configurable);t.exports={CONFIGURABLE:a}}),$=__webpack_require__.cw(t=>{var e=K(),n=i();t.exports=function(t,i,r){try{return e(n(Object.getOwnPropertyDescriptor(t,i)[r]))}catch(t){}}}),X=__webpack_require__.cw(t=>{var e=A(),i=K();t.exports=function(t){if("Function"===e(t))return i(t)}}),K=__webpack_require__.cw(t=>{var e=j(),i=Function.prototype,n=i.call,r=e&&i.bind.bind(n,n);t.exports=e?r:function(t){return function(){return n.apply(t,arguments)}}}),get_alphabet_option_namespaceFn=()=>__webpack_require__(944),Y=__webpack_require__.cw(t=>{var e=it(),i=mt();t.exports=function(t,n){return arguments.length<2?(r=e[t],i(r)?r:void 0):e[t]&&e[t][n];var r}}),get_iterator_direct_namespaceFn=()=>__webpack_require__(767),J=__webpack_require__.cw(t=>{var e=V(),i=h(),n=get_iterator_direct_namespaceFn(),r=Z();t.exports=function(t,s){s&&"string"==typeof t||i(t);var a=r(t);return n(i(void 0!==a?e(a,t):t))}}),Q=__webpack_require__.cw(t=>{var e=V(),i=mt(),n=h(),r=ve(),s=Z(),a=TypeError;t.exports=function(t,o){var l=arguments.length<2?s(t):o;if(i(l))return n(e(l,t));throw new a(r(t)+" is not iterable")}}),Z=__webpack_require__.cw(t=>{var e=A(),i=is_null_or_undefined_namespaceFn(),n=tt(),r=Pe()("iterator"),s=Array.prototype;t.exports=function(t){if(!i(t))return n(t,r)||n(t,"@@iterator")||("Arguments"===e(t)?s[r]:void 0)}}),tt=__webpack_require__.cw(t=>{var e=i(),n=is_null_or_undefined_namespaceFn();t.exports=function(t,i){var r=t[i];return n(r)?void 0:e(r)}}),et=__webpack_require__.cw(t=>{var e=i(),n=h(),r=V(),s=to_integer_or_infinity_namespaceFn(),a=get_iterator_direct_namespaceFn(),o="Invalid size",l=RangeError,c=TypeError,d=Math.max,SetRecord=function(t,i){this.set=t;this.size=d(i,0);this.has=e(t.has);this.keys=e(t.keys)};SetRecord.prototype={getIterator:function(){return a(n(r(this.keys,this.set)))},includes:function(t){return r(this.has,this.set,t)}};t.exports=function(t){n(t);var e=+t.size;if(e!=e)throw new c(o);var i=s(e);if(i<0)throw new l(o);return new SetRecord(t,i)}}),it=__webpack_require__.cw(function(t){var check=function(t){return t&&t.Math===Math&&t};t.exports=check("object"==typeof globalThis&&globalThis)||check("object"==typeof window&&window)||check("object"==typeof self&&self)||check("object"==typeof global&&global)||check("object"==typeof this&&this)||function(){return this}()||Function("return this")()}),nt=__webpack_require__.cw(t=>{var e=K(),i=to_object_namespaceFn(),n=e({}.hasOwnProperty);t.exports=Object.hasOwn||function hasOwn(t,e){return n(i(t),e)}}),rt=__webpack_require__.cw(t=>{t.exports={}}),st=__webpack_require__.cw(t=>{var e=Y();t.exports=e("document","documentElement")}),ot=__webpack_require__.cw(t=>{var e=O(),i=z(),n=R();t.exports=!e&&!i(function(){return 7!==Object.defineProperty(n("div"),"a",{get:function(){return 7}}).a})}),lt=__webpack_require__.cw(t=>{var e=K(),i=z(),n=A(),r=Object,s=e("".split);t.exports=i(function(){return!r("z").propertyIsEnumerable(0)})?function(t){return"String"===n(t)?s(t,""):r(t)}:r}),ct=__webpack_require__.cw(t=>{var e=mt(),i=bt(),n=Vt();t.exports=function(t,r,s){var a,o;n&&e(a=r.constructor)&&a!==s&&i(o=a.prototype)&&o!==s.prototype&&n(t,o);return t}}),ht=__webpack_require__.cw(t=>{var e=K(),i=mt(),n=ce(),r=e(Function.toString);i(n.inspectSource)||(n.inspectSource=function(t){return r(t)});t.exports=n.inspectSource}),dt=__webpack_require__.cw(t=>{var e,i,n,r=Te(),s=it(),a=bt(),o=S(),l=nt(),c=ce(),h=le(),d=rt(),u="Object already initialized",p=s.TypeError,g=s.WeakMap;if(r||c.state){var m=c.state||(c.state=new g);m.get=m.get;m.has=m.has;m.set=m.set;e=function(t,e){if(m.has(t))throw new p(u);e.facade=t;m.set(t,e);return e};i=function(t){return m.get(t)||{}};n=function(t){return m.has(t)}}else{var f=h("state");d[f]=!0;e=function(t,e){if(l(t,f))throw new p(u);e.facade=t;o(t,f,e);return e};i=function(t){return l(t,f)?t[f]:{}};n=function(t){return l(t,f)}}t.exports={set:e,get:i,has:n,enforce:function(t){return n(t)?i(t):e(t,{})},getterFor:function(t){return function(e){var n;if(!a(e)||(n=i(e)).type!==t)throw new p("Incompatible receiver, "+t+" required");return n}}}}),ut=__webpack_require__.cw(t=>{var e=Pe(),i=iterators_namespaceFn(),n=e("iterator"),r=Array.prototype;t.exports=function(t){return void 0!==t&&(i.Array===t||r[n]===t)}}),pt=__webpack_require__.cw(t=>{var e=A();t.exports=Array.isArray||function isArray(t){return"Array"===e(t)}}),gt=__webpack_require__.cw(t=>{var e=x();t.exports=function(t){var i=e(t);return"BigInt64Array"===i||"BigUint64Array"===i}}),mt=__webpack_require__.cw(t=>{var e="object"==typeof document&&document.all;t.exports=void 0===e&&void 0!==e?function(t){return"function"==typeof t||t===e}:function(t){return"function"==typeof t}}),ft=__webpack_require__.cw(t=>{var e=z(),i=mt(),n=/#|\.prototype\./,isForced=function(t,n){var l=s[r(t)];return l===o||l!==a&&(i(n)?e(n):!!n)},r=isForced.normalize=function(t){return String(t).replace(n,".").toLowerCase()},s=isForced.data={},a=isForced.NATIVE="N",o=isForced.POLYFILL="P";t.exports=isForced}),is_null_or_undefined_namespaceFn=()=>__webpack_require__(117),bt=__webpack_require__.cw(t=>{var e=mt();t.exports=function(t){return"object"==typeof t?null!==t:e(t)}}),yt=__webpack_require__.cw(t=>{var e=bt();t.exports=function(t){return e(t)||null===t}}),wt=__webpack_require__.cw(t=>{t.exports=!1}),vt=__webpack_require__.cw(t=>{var e=bt(),i=dt().get;t.exports=function isRawJSON(t){if(!e(t))return!1;var n=i(t);return!!n&&"RawJSON"===n.type}}),_t=__webpack_require__.cw(t=>{var e=Y(),i=mt(),n=zt(),r=Ee(),s=Object;t.exports=r?function(t){return"symbol"==typeof t}:function(t){var r=e("Symbol");return i(r)&&n(r.prototype,s(t))}}),At=__webpack_require__.cw(t=>{var e=V();t.exports=function(t,i,n){for(var r,s,a=n?t:t.iterator,o=t.next;!(r=e(o,a)).done;)if(void 0!==(s=i(r.value)))return s}}),xt=__webpack_require__.cw(t=>{var e=W(),i=V(),n=h(),r=ve(),s=ut(),a=Pt(),o=zt(),l=Q(),c=Z(),d=Et(),u=TypeError,Result=function(t,e){this.stopped=t;this.result=e},p=Result.prototype;t.exports=function(t,h,g){var m,f,b,y,w,v,_,A=g&&g.that,x=!(!g||!g.AS_ENTRIES),C=!(!g||!g.IS_RECORD),E=!(!g||!g.IS_ITERATOR),S=!(!g||!g.INTERRUPTED),T=e(h,A),stop=function(t){var e=m;m=void 0;e&&d(e,"normal");return new Result(!0,t)},callFn=function(t){if(x){n(t);return S?T(t[0],t[1],stop):T(t[0],t[1])}return S?T(t,stop):T(t)};if(C)m=t.iterator;else if(E)m=t;else{if(!(f=c(t)))throw new u(r(t)+" is not iterable");if(s(f)){for(b=0,y=a(t);y>b;b++)if((w=callFn(t[b]))&&o(p,w))return w;return new Result(!1)}m=l(t,f)}v=C?t.next:m.next;for(;!(_=i(v,m)).done;){var k=_.value;try{w=callFn(k)}catch(t){if(!m)throw t;d(m,"throw",t)}if("object"==typeof w&&w&&o(p,w))return w}return new Result(!1)}}),Ct=__webpack_require__.cw(t=>{var e=Et();t.exports=function(t,i,n){for(var r=t.length-1;r>=0;r--)if(void 0!==t[r])try{n=e(t[r].iterator,i,n)}catch(t){i="throw";n=t}if("throw"===i)throw n;return n}}),Et=__webpack_require__.cw(t=>{var e=V(),i=h(),n=tt();t.exports=function(t,r,s){var a,o;i(t);try{if(!(a=n(t,"return"))){if("throw"===r)throw s;return s}a=e(a,t)}catch(t){o=!0;a=t}if("throw"===r)throw s;if(o)throw a;i(a);return s}}),St=__webpack_require__.cw(t=>{var e=V(),i=Rt(),n=S(),r=D(),s=Pe(),a=dt(),o=tt(),l=kt().IteratorPrototype,c=__webpack_require__(529),h=Et(),d=Ct(),u=__webpack_require__(859),p=s("toStringTag"),g="IteratorHelper",m="WrapForValidIterator",f="normal",b="throw",y=a.set,createIteratorProxyPrototype=function(t){var n=a.getterFor(t?m:g);return r(i(l),{next:function next(){var e=n(this);if(t)return e.nextHandler();if(e.done)return c(void 0,!0);try{var i=e.nextHandler();e.done&&u(e);return e.returnHandlerResult?i:c(i,e.done)}catch(t){e.done=!0;u(e);throw t}},return:function(){var i=n(this),r=i.iterator,s=i.inner,a=i.openIters,l=i.done;i.done=!0;if(t){var p=o(r,"return");return p?e(p,r):c(void 0,!0)}u(i);if(l)return c(void 0,!0);if(s)try{h(s.iterator,f)}catch(t){return h(r,b,t)}if(a)try{d(a,f)}catch(t){if(r)return h(r,b,t);throw t}r&&h(r,f);return c(void 0,!0)}})},w=createIteratorProxyPrototype(!0),v=createIteratorProxyPrototype(!1);n(v,p,"Iterator Helper");t.exports=function(t,e,i){var n=function Iterator(n,r){if(r){r.iterator=n.iterator;r.next=n.next}else r=n;r.type=e?m:g;r.returnHandlerResult=!!i;r.nextHandler=t;r.counter=0;r.done=!1;y(this,r)};n.prototype=e?w:v;return n}}),iterator_helper_throws_on_invalid_iterator_namespaceFn=()=>__webpack_require__(684),Tt=__webpack_require__.cw(t=>{var e=it();t.exports=function(t,i){var n=e.Iterator,r=n&&n.prototype,s=r&&r[t],a=!1;if(s)try{s.call({next:function(){return{done:!0}},return:function(){a=!0}},-1)}catch(t){t instanceof i||(a=!1)}if(!a)return s}}),kt=__webpack_require__.cw(t=>{var e,i,n,r=z(),s=mt(),a=bt(),o=Rt(),l=Ht(),c=M(),h=Pe(),d=wt(),u=h("iterator");[].keys&&("next"in(n=[].keys())?(i=l(l(n)))!==Object.prototype&&(e=i):!0);!a(e)||r(function(){var t={};return e[u].call(t)!==t})?e={}:d&&(e=o(e));s(e[u])||c(e,u,function(){return this});t.exports={IteratorPrototype:e}}),iterators_namespaceFn=()=>__webpack_require__(269),Pt=__webpack_require__.cw(t=>{var e=to_length_namespaceFn();t.exports=function(t){return e(t.length)}}),Mt=__webpack_require__.cw(t=>{var e=K(),i=z(),n=mt(),r=nt(),s=O(),a=q().CONFIGURABLE,o=ht(),l=dt(),c=l.enforce,h=l.get,d=String,u=Object.defineProperty,p=e("".slice),g=e("".replace),m=e([].join),f=s&&!i(function(){return 8!==u(function(){},"length",{value:8}).length}),b=String(String).split("String"),y=t.exports=function(t,e,i){"Symbol("===p(d(e),0,7)&&(e="["+g(d(e),/^Symbol\(([^)]*)\).*$/,"$1")+"]");i&&i.getter&&(e="get "+e);i&&i.setter&&(e="set "+e);(!r(t,"name")||a&&t.name!==e)&&(s?u(t,"name",{value:e,configurable:!0}):t.name=e);f&&i&&r(i,"arity")&&t.length!==i.arity&&u(t,"length",{value:i.arity});try{i&&r(i,"constructor")&&i.constructor?s&&u(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var n=c(t);r(n,"source")||(n.source=m(b,"string"==typeof e?e:""));return t};Function.prototype.toString=y(function toString(){return n(this)&&h(this).source||o(this)},"toString")}),Dt=__webpack_require__.cw(t=>{var e=K(),i=Map.prototype;t.exports={Map,set:e(i.set),get:e(i.get),has:e(i.has),remove:e(i.delete),proto:i}}),It=__webpack_require__.cw(t=>{var e=z();t.exports=!e(function(){var t="9007199254740993",e=JSON.rawJSON(t);return!JSON.isRawJSON(e)||JSON.stringify(e)!==t})}),Ft=__webpack_require__.cw(t=>{var e=i(),n=TypeError,PromiseCapability=function(t){var i,r;this.promise=new t(function(t,e){if(void 0!==i||void 0!==r)throw new n("Bad Promise constructor");i=t;r=e});this.resolve=e(i);this.reject=e(r)};t.exports.f=function(t){return new PromiseCapability(t)}}),Ot=__webpack_require__.cw(t=>{var e=we();t.exports=function(t,i){return void 0===t?arguments.length<2?"":i:e(t)}}),not_a_nan_namespaceFn=()=>__webpack_require__(149),Rt=__webpack_require__.cw(t=>{var e,i=h(),n=Bt(),r=B(),s=rt(),a=st(),o=R(),l=le(),c="prototype",d="script",u=l("IE_PROTO"),EmptyConstructor=function(){},scriptTag=function(t){return"<"+d+">"+t+""},NullProtoObjectViaActiveX=function(t){t.write(scriptTag(""));t.close();var e=t.parentWindow.Object;t=null;return e},NullProtoObject=function(){try{e=new ActiveXObject("htmlfile")}catch(t){}NullProtoObject="undefined"!=typeof document?document.domain&&e?NullProtoObjectViaActiveX(e):function(){var t,e=o("iframe"),i="java"+d+":";e.style.display="none";a.appendChild(e);e.src=String(i);(t=e.contentWindow.document).open();t.write(scriptTag("document.F=Object"));t.close();return t.F}():NullProtoObjectViaActiveX(e);for(var t=r.length;t--;)delete NullProtoObject[c][r[t]];return NullProtoObject()};s[u]=!0;t.exports=Object.create||function create(t,e){var r;if(null!==t){EmptyConstructor[c]=i(t);r=new EmptyConstructor;EmptyConstructor[c]=null;r[u]=t}else r=NullProtoObject();return void 0===e?r:n.f(r,e)}}),Bt=__webpack_require__.cw((t,e)=>{var i=O(),n=Se(),r=Lt(),s=h(),a=me(),o=Wt();e.f=i&&!n?Object.defineProperties:function defineProperties(t,e){s(t);for(var i,n=a(e),l=o(e),c=l.length,h=0;c>h;)r.f(t,i=l[h++],n[i]);return t}}),Lt=__webpack_require__.cw((t,e)=>{var i=O(),n=ot(),r=Se(),s=h(),a=be(),o=TypeError,l=Object.defineProperty,c=Object.getOwnPropertyDescriptor,d="enumerable",u="configurable",p="writable";e.f=i?r?function defineProperty(t,e,i){s(t);e=a(e);s(i);if("function"==typeof t&&"prototype"===e&&"value"in i&&p in i&&!i[p]){var n=c(t,e);if(n&&n[p]){t[e]=i.value;i={configurable:u in i?i[u]:n[u],enumerable:d in i?i[d]:n[d],writable:!1}}}return l(t,e,i)}:l:function defineProperty(t,e,i){s(t);e=a(e);s(i);if(n)try{return l(t,e,i)}catch(t){}if("get"in i||"set"in i)throw new o("Accessors not supported");"value"in i&&(t[e]=i.value);return t}}),Nt=__webpack_require__.cw((t,e)=>{var i=O(),n=V(),r=jt(),s=T(),a=me(),o=be(),l=nt(),c=ot(),h=Object.getOwnPropertyDescriptor;e.f=i?h:function getOwnPropertyDescriptor(t,e){t=a(t);e=o(e);if(c)try{return h(t,e)}catch(t){}if(l(t,e))return s(!n(r.f,t,e),t[e])}}),Ut=__webpack_require__.cw((t,e)=>{var i=Gt(),n=B().concat("length","prototype");e.f=Object.getOwnPropertyNames||function getOwnPropertyNames(t){return i(t,n)}}),Ht=__webpack_require__.cw(t=>{var e=nt(),i=mt(),n=to_object_namespaceFn(),r=le(),s=E(),a=r("IE_PROTO"),o=Object,l=o.prototype;t.exports=s?o.getPrototypeOf:function(t){var r=n(t);if(e(r,a))return r[a];var s=r.constructor;return i(s)&&r instanceof s?s.prototype:r instanceof o?l:null}}),zt=__webpack_require__.cw(t=>{var e=K();t.exports=e({}.isPrototypeOf)}),Gt=__webpack_require__.cw(t=>{var e=K(),i=nt(),n=me(),r=y().indexOf,s=rt(),a=e([].push);t.exports=function(t,e){var o,l=n(t),c=0,h=[];for(o in l)!i(s,o)&&i(l,o)&&a(h,o);for(;e.length>c;)i(l,o=e[c++])&&(~r(h,o)||a(h,o));return h}}),Wt=__webpack_require__.cw(t=>{var e=Gt(),i=B();t.exports=Object.keys||function keys(t){return e(t,i)}}),jt=__webpack_require__.cw((t,e)=>{var i={}.propertyIsEnumerable,n=Object.getOwnPropertyDescriptor,r=n&&!i.call({1:2},1);e.f=r?function propertyIsEnumerable(t){var e=n(this,t);return!!e&&e.enumerable}:i}),Vt=__webpack_require__.cw(t=>{var e=$(),i=bt(),r=require_object_coercible_namespaceFn(),s=n();t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var t,n=!1,a={};try{(t=e(Object.prototype,"__proto__","set"))(a,[]);n=a instanceof Array}catch(t){}return function setPrototypeOf(e,a){r(e);s(a);if(!i(e))return e;n?t(e,a):e.__proto__=a;return e}}():void 0)}),qt=__webpack_require__.cw(t=>{var e=V(),i=mt(),n=bt(),r=TypeError;t.exports=function(t,s){var a,o;if("string"===s&&i(a=t.toString)&&!n(o=e(a,t)))return o;if(i(a=t.valueOf)&&!n(o=e(a,t)))return o;if("string"!==s&&i(a=t.toString)&&!n(o=e(a,t)))return o;throw new r("Can't convert object to primitive value")}}),$t=__webpack_require__.cw(t=>{var e=Y(),i=K(),n=Ut(),r=__webpack_require__(717),s=h(),a=i([].concat);t.exports=e("Reflect","ownKeys")||function ownKeys(t){var e=n.f(s(t)),i=r.f;return i?a(e,i(t)):e}}),Xt=__webpack_require__.cw(t=>{var e=K(),i=nt(),n=SyntaxError,r=parseInt,s=String.fromCharCode,a=e("".charAt),o=e("".slice),l=e(/./.exec),c={'\\"':'"',"\\\\":"\\","\\/":"/","\\b":"\b","\\f":"\f","\\n":"\n","\\r":"\r","\\t":"\t"},h=/^[\da-f]{4}$/i,d=/^[\u0000-\u001F]$/;t.exports=function(t,e){for(var u=!0,p="";e{var e=h(),i=bt(),n=Ft();t.exports=function(t,r){e(t);if(i(r)&&r.constructor===t)return r;var s=n.f(t);(0,s.resolve)(r);return s.promise}}),require_object_coercible_namespaceFn=()=>__webpack_require__(750),Yt=__webpack_require__.cw(t=>{var e=Qt(),i=ne(),n=e.Set,r=e.add;t.exports=function(t){var e=new n;i(t,function(t){r(e,t)});return e}}),Jt=__webpack_require__.cw(t=>{var e=r(),i=Qt(),n=Yt(),s=se(),a=et(),o=ne(),l=At(),c=i.has,h=i.remove;t.exports=function difference(t){var i=e(this),r=a(t),d=n(i);s(d)<=r.size?o(d,function(t){r.includes(t)&&h(d,t)}):l(r.getIterator(),function(t){c(d,t)&&h(d,t)});return d}}),Qt=__webpack_require__.cw(t=>{var e=K(),i=Set.prototype;t.exports={Set,add:e(i.add),has:e(i.has),remove:e(i.delete),proto:i}}),Zt=__webpack_require__.cw(t=>{var e=r(),i=Qt(),n=se(),s=et(),a=ne(),o=At(),l=i.Set,c=i.add,h=i.has;t.exports=function intersection(t){var i=e(this),r=s(t),d=new l;n(i)>r.size?o(r.getIterator(),function(t){h(i,t)&&c(d,t)}):a(i,function(t){r.includes(t)&&c(d,t)});return d}}),te=__webpack_require__.cw(t=>{var e=r(),i=Qt().has,n=se(),s=et(),a=ne(),o=At(),l=Et();t.exports=function isDisjointFrom(t){var r=e(this),c=s(t);if(n(r)<=c.size)return!1!==a(r,function(t){if(c.includes(t))return!1},!0);var h=c.getIterator();return!1!==o(h,function(t){if(i(r,t))return l(h.iterator,"normal",!1)})}}),ee=__webpack_require__.cw(t=>{var e=r(),i=se(),n=ne(),s=et();t.exports=function isSubsetOf(t){var r=e(this),a=s(t);return!(i(r)>a.size)&&!1!==n(r,function(t){if(!a.includes(t))return!1},!0)}}),ie=__webpack_require__.cw(t=>{var e=r(),i=Qt().has,n=se(),s=et(),a=At(),o=Et();t.exports=function isSupersetOf(t){var r=e(this),l=s(t);if(n(r){var e=K(),i=At(),n=Qt(),r=n.Set,s=n.proto,a=e(s.forEach),o=e(s.keys),l=o(new r).next;t.exports=function(t,e,n){return n?i({iterator:o(t),next:l},e):a(t,e)}}),re=__webpack_require__.cw(t=>{var e=Y(),createSetLike=function(t){return{size:t,has:function(){return!1},keys:function(){return{next:function(){return{done:!0}}}}}},createSetLikeWithInfinitySize=function(t){return{size:t,has:function(){return!0},keys:function(){throw new Error("e")}}};t.exports=function(t,i){var n=e("Set");try{(new n)[t](createSetLike(0));try{(new n)[t](createSetLike(-1));return!1}catch(e){if(!i)return!0;try{(new n)[t](createSetLikeWithInfinitySize(-1/0));return!1}catch(e){return i(new n([1,2])[t](createSetLikeWithInfinitySize(1/0)))}}}catch(t){return!1}}}),set_method_get_keys_before_cloning_detection_namespaceFn=()=>__webpack_require__(835),se=__webpack_require__.cw(t=>{var e=$(),i=Qt();t.exports=e(i.proto,"size","get")||function(t){return t.size}}),ae=__webpack_require__.cw(t=>{var e=r(),i=Qt(),n=Yt(),s=et(),a=At(),o=i.add,l=i.has,c=i.remove;t.exports=function symmetricDifference(t){var i=e(this),r=s(t).getIterator(),h=n(i);a(r,function(t){l(i,t)?c(h,t):o(h,t)});return h}}),oe=__webpack_require__.cw(t=>{var e=r(),i=Qt().add,n=Yt(),s=et(),a=At();t.exports=function union(t){var r=e(this),o=s(t).getIterator(),l=n(r);a(o,function(t){i(l,t)});return l}}),le=__webpack_require__.cw(t=>{var e=he(),i=_e(),n=e("keys");t.exports=function(t){return n[t]||(n[t]=i(t))}}),ce=__webpack_require__.cw(t=>{var e=wt(),i=it(),n=I(),r="__core-js_shared__",s=t.exports=i[r]||n(r,{});(s.versions||(s.versions=[])).push({version:"3.51.0",mode:e?"pure":"global",copyright:"© 2013–2025 Denis Pushkarev (zloirock.ru), 2025–2026 CoreJS Company (core-js.io). All rights reserved.",license:"https://github.com/zloirock/core-js/blob/v3.51.0/LICENSE",source:"https://github.com/zloirock/core-js"})}),he=__webpack_require__.cw(t=>{var e=ce(),i=Object.create||Object;t.exports=function(t,n){return e[t]||(e[t]=n||i(null))}}),de=__webpack_require__.cw(t=>{var e=N(),i=z(),n=it().String;t.exports=!!Object.getOwnPropertySymbols&&!i(function(){var t=Symbol("symbol detection");return!n(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&e&&e<41})}),ue=__webpack_require__.cw(t=>{var e=K();t.exports=e(1.1.valueOf)}),pe=__webpack_require__.cw(t=>{var e=to_integer_or_infinity_namespaceFn(),i=Math.max,n=Math.min;t.exports=function(t,r){var s=e(t);return s<0?i(s+r,0):n(s,r)}}),ge=__webpack_require__.cw(t=>{var e=fe(),i=TypeError;t.exports=function(t){var n=e(t,"number");if("number"==typeof n)throw new i("Can't convert number to bigint");return BigInt(n)}}),me=__webpack_require__.cw(t=>{var e=lt(),i=require_object_coercible_namespaceFn();t.exports=function(t){return e(i(t))}}),to_integer_or_infinity_namespaceFn=()=>__webpack_require__(291),to_length_namespaceFn=()=>__webpack_require__(14),to_object_namespaceFn=()=>__webpack_require__(981),to_positive_integer_namespaceFn=()=>__webpack_require__(590),fe=__webpack_require__.cw(t=>{var e=V(),i=bt(),n=_t(),r=tt(),s=qt(),a=Pe(),o=TypeError,l=a("toPrimitive");t.exports=function(t,a){if(!i(t)||n(t))return t;var c,h=r(t,l);if(h){void 0===a&&(a="default");c=e(h,t,a);if(!i(c)||n(c))return c;throw new o("Can't convert object to primitive value")}void 0===a&&(a="number");return s(t,a)}}),be=__webpack_require__.cw(t=>{var e=fe(),i=_t();t.exports=function(t){var n=e(t,"string");return i(n)?n:n+""}}),ye=__webpack_require__.cw(t=>{var e={};e[Pe()("toStringTag")]="z";t.exports="[object z]"===String(e)}),we=__webpack_require__.cw(t=>{var e=x(),i=String;t.exports=function(t){if("Symbol"===e(t))throw new TypeError("Cannot convert a Symbol value to a string");return i(t)}}),ve=__webpack_require__.cw(t=>{var e=String;t.exports=function(t){try{return e(t)}catch(t){return"Object"}}}),_e=__webpack_require__.cw(t=>{var e=K(),i=0,n=Math.random(),r=e(1.1.toString);t.exports=function(t){return"Symbol("+(void 0===t?"":t)+")_"+r(++i+n,36)}}),Ae=__webpack_require__.cw(t=>{var e=it(),i=K(),n=c(),r=a_string_namespaceFn(),s=nt(),a=base64_map_namespaceFn(),o=get_alphabet_option_namespaceFn(),l=m(),h=a.c2i,d=a.c2iUrl,u=e.SyntaxError,p=e.TypeError,g=e.Array,f=i("".charAt),b=Math.floor,skipAsciiWhitespace=function(t,e){for(var i=t.length;e>16&255,r>>8&255,255&r];if(2===n){if(i&&0!==s[1])throw new u("Extra bits");return[s[0]]}if(3===n){if(i&&0!==s[2])throw new u("Extra bits");return[s[0],s[1]]}return s},writeBytes=function(t,e,i){for(var n=e.length,r=0;r0){if("stop-before-partial"===m)break;if("loose"!==m)throw new u("Missing padding");if(1===A.length)throw new u("Malformed padding: exactly one additional character");v=writeBytes(w,decodeBase64Chunk(A,c,!1),v)}_=y;break}var C=f(t,x);++x;if("="===C){if(A.length<2)throw new u("Padding is too early");x=skipAsciiWhitespace(t,x);if(2===A.length){if(x===y){if("stop-before-partial"===m)break;throw new u("Malformed padding: only one =")}if("="===f(t,x)){++x;x=skipAsciiWhitespace(t,x)}}if(x{var e=it(),i=K(),n=e.Uint8Array,r=e.SyntaxError,s=Math.min,a=i("".match);t.exports=function(t,e){var i=t.length;if(i%2!=0)throw new r("String should be an even number of characters");for(var o=e?s(e.length,i/2):i/2,l=e||new n(o),c=a(t,/[\S\s]{2}/g),h=0;h>4}return{bytes:l,read:h<<1}}}),Ce=__webpack_require__.cw(t=>{var e=z(),i=Pe(),n=O(),r=wt(),s=i("iterator");t.exports=!e(function(){var t=new URL("b?a=1&b=2&c=3","https://a"),e=t.searchParams,i=new URLSearchParams("a=1&a=2&b=3"),a="";t.pathname="c%20d";e.forEach(function(t,i){e.delete("b");a+=i+t});i.delete("a",2);i.delete("b",void 0);return r&&(!t.toJSON||!i.has("a",1)||i.has("a",2)||!i.has("a",void 0)||i.has("b"))||!e.size&&(r||!n)||!e.sort||"https://a/c%20d?a=1&c=3"!==t.href||"3"!==e.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!e[s]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("https://тест").host||"#%D0%B1"!==new URL("https://a#б").hash||"a1c3"!==a||"x"!==new URL("https://x",void 0).host})}),Ee=__webpack_require__.cw(t=>{var e=de();t.exports=e&&!Symbol.sham&&"symbol"==typeof Symbol.iterator}),Se=__webpack_require__.cw(t=>{var e=O(),i=z();t.exports=e&&i(function(){return 42!==Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype})}),Te=__webpack_require__.cw(t=>{var e=it(),i=mt(),n=e.WeakMap;t.exports=i(n)&&/native code/.test(String(n))}),ke=__webpack_require__.cw(t=>{var e=K(),i=WeakMap.prototype;t.exports={WeakMap,set:e(i.set),get:e(i.get),has:e(i.has),remove:e(i.delete)}}),Pe=__webpack_require__.cw(t=>{var e=it(),i=he(),n=nt(),r=_e(),s=de(),a=Ee(),o=e.Symbol,l=i("wks"),c=a?o.for||o:o&&o.withoutSetter||r;t.exports=function(t){n(l,t)||(l[t]=s&&n(o,t)?o[t]:c("Symbol."+t));return l[t]}}),Me=__webpack_require__.cw(()=>{var t=H(),e=y().includes,i=z(),n=o(),r=i(function(){return!Array(1).includes()}),s=i(function(){return[,1].includes(void 0,1)});t({target:"Array",proto:!0,forced:r||s},{includes:function includes(t){return e(this,t,arguments.length>1?arguments[1]:void 0)}});n("includes")}),De=__webpack_require__.cw(()=>{var t=H(),e=to_object_namespaceFn(),i=Pt(),n=w(),r=__webpack_require__(837);t({target:"Array",proto:!0,arity:1,forced:z()(function(){return 4294967297!==[].push.call({length:4294967296},1)})||!function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(t){return t instanceof TypeError}}()},{push:function push(t){var s=e(this),a=i(s),o=arguments.length;r(a+o);for(var l=0;l{var t=H(),e=it(),i=l(),n=h(),r=mt(),s=Ht(),a=P(),o=k(),c=z(),d=nt(),u=Pe(),p=kt().IteratorPrototype,g=O(),m=wt(),f="constructor",b="Iterator",y=u("toStringTag"),w=TypeError,v=e[b],_=m||!r(v)||v.prototype!==p||!c(function(){v({})}),A=function Iterator(){i(this,p);if(s(this)===p)throw new w("Abstract class Iterator not directly constructable")},defineIteratorPrototypeAccessor=function(t,e){g?a(p,t,{configurable:!0,get:function(){return e},set:function(e){n(this);if(this===p)throw new w("You can't redefine this property");d(this,t)?this[t]=e:o(this,t,e)}}):p[t]=e};d(p,y)||defineIteratorPrototypeAccessor(y,b);!_&&d(p,f)&&p[f]!==Object||defineIteratorPrototypeAccessor(f,A);A.prototype=p;t({global:!0,constructor:!0,forced:_},{Iterator:A})}),Fe=__webpack_require__.cw(()=>{var t=H(),e=V(),i=h(),n=get_iterator_direct_namespaceFn(),r=not_a_nan_namespaceFn(),s=to_positive_integer_namespaceFn(),a=Et(),o=St(),l=iterator_helper_throws_on_invalid_iterator_namespaceFn(),c=Tt(),d=wt(),u=RangeError,p=1/0,g=!d&&!l("drop",0),m=!d&&!g&&c("drop",RangeError),f=d||g||m||!function(){try{Iterator.prototype.drop.call({next:function(){return{done:!0}}},9007199254740992)}catch(t){return t instanceof u}}(),b=o(function(){for(var t,n=this.iterator,r=this.next;this.remaining;){this.remaining--;t=i(e(r,n));if(this.done=!!t.done)return}t=i(e(r,n));if(!(this.done=!!t.done))return t.value});t({target:"Iterator",proto:!0,real:!0,forced:f},{drop:function drop(t){i(this);var o;try{if((o=s(r(+t)))>9007199254740991&&o!==p)throw new u("The argument should be a safe integer")}catch(t){a(this,"throw",t)}return m?e(m,this,o):new b(n(this),{remaining:o})}})}),Oe=__webpack_require__.cw(()=>{var t=H(),e=V(),n=xt(),r=i(),s=h(),a=get_iterator_direct_namespaceFn(),o=Et(),l=Tt()("every",TypeError);t({target:"Iterator",proto:!0,real:!0,forced:l},{every:function every(t){s(this);try{r(t)}catch(t){o(this,"throw",t)}if(l)return e(l,this,t);var i=a(this),c=0;return!n(i,function(e,i){if(!t(e,c++))return i()},{IS_RECORD:!0,INTERRUPTED:!0}).stopped}})}),Re=__webpack_require__.cw(()=>{var t=H(),e=V(),n=i(),r=h(),s=get_iterator_direct_namespaceFn(),a=St(),o=_(),l=wt(),c=Et(),d=iterator_helper_throws_on_invalid_iterator_namespaceFn(),u=Tt(),p=!l&&!d("filter",function(){}),g=!l&&!p&&u("filter",TypeError),m=l||p||g,f=a(function(){for(var t,i,n=this.iterator,s=this.predicate,a=this.next;;){t=r(e(a,n));if(this.done=!!t.done)return;i=t.value;if(o(n,s,[i,this.counter++],!0))return i}});t({target:"Iterator",proto:!0,real:!0,forced:m},{filter:function filter(t){r(this);try{n(t)}catch(t){c(this,"throw",t)}return g?e(g,this,t):new f(s(this),{predicate:t})}})}),Be=__webpack_require__.cw(()=>{var t=H(),e=V(),n=xt(),r=i(),s=h(),a=get_iterator_direct_namespaceFn(),o=Et(),l=Tt()("find",TypeError);t({target:"Iterator",proto:!0,real:!0,forced:l},{find:function find(t){s(this);try{r(t)}catch(t){o(this,"throw",t)}if(l)return e(l,this,t);var i=a(this),c=0;return n(i,function(e,i){if(t(e,c++))return i(e)},{IS_RECORD:!0,INTERRUPTED:!0}).result}})}),Le=__webpack_require__.cw(()=>{var t=H(),e=V(),n=i(),r=h(),s=get_iterator_direct_namespaceFn(),a=J(),o=St(),l=Et(),c=z(),d=wt(),u=iterator_helper_throws_on_invalid_iterator_namespaceFn(),p=Tt(),g=!d&&c(function(){return 1!==[1].values().flatMap(function(){return[1]}).find(function(){return!0})}),m=!d&&!g&&!u("flatMap",function(){}),f=!d&&!g&&!m&&p("flatMap",TypeError),b=d||g||m||f,y=o(function(){for(var t,i,n=this.iterator,s=this.mapper;;){if(i=this.inner)try{if(!(t=r(e(i.next,i.iterator))).done)return t.value;this.inner=null}catch(t){l(n,"throw",t)}t=r(e(this.next,n));if(this.done=!!t.done)return;try{this.inner=a(s(t.value,this.counter++),!1)}catch(t){l(n,"throw",t)}}});t({target:"Iterator",proto:!0,real:!0,forced:b},{flatMap:function flatMap(t){r(this);try{n(t)}catch(t){l(this,"throw",t)}return f?e(f,this,t):new y(s(this),{mapper:t,inner:null})}})}),Ne=__webpack_require__.cw(()=>{var t=H(),e=V(),n=xt(),r=i(),s=h(),a=get_iterator_direct_namespaceFn(),o=Et(),l=Tt()("forEach",TypeError);t({target:"Iterator",proto:!0,real:!0,forced:l},{forEach:function forEach(t){s(this);try{r(t)}catch(t){o(this,"throw",t)}if(l)return e(l,this,t);var i=a(this),c=0;n(i,function(e){t(e,c++)},{IS_RECORD:!0})}})}),Ue=__webpack_require__.cw(()=>{var t=H(),e=V(),n=i(),r=h(),s=get_iterator_direct_namespaceFn(),a=St(),o=_(),l=Et(),c=iterator_helper_throws_on_invalid_iterator_namespaceFn(),d=Tt(),u=wt(),p=!u&&!c("map",function(){}),g=!u&&!p&&d("map",TypeError),m=u||p||g,f=a(function(){var t=this.iterator,i=r(e(this.next,t));if(!(this.done=!!i.done))return o(t,this.mapper,[i.value,this.counter++],!0)});t({target:"Iterator",proto:!0,real:!0,forced:m},{map:function map(t){r(this);try{n(t)}catch(t){l(this,"throw",t)}return g?e(g,this,t):new f(s(this),{mapper:t})}})}),He=__webpack_require__.cw(()=>{var t=H(),e=V(),n=xt(),r=i(),s=h(),a=get_iterator_direct_namespaceFn(),o=Et(),l=Tt()("some",TypeError);t({target:"Iterator",proto:!0,real:!0,forced:l},{some:function some(t){s(this);try{r(t)}catch(t){o(this,"throw",t)}if(l)return e(l,this,t);var i=a(this),c=0;return n(i,function(e,i){if(t(e,c++))return i()},{IS_RECORD:!0,INTERRUPTED:!0}).stopped}})}),ze=__webpack_require__.cw(()=>{var t=H(),e=V(),i=h(),n=get_iterator_direct_namespaceFn(),r=not_a_nan_namespaceFn(),s=to_positive_integer_namespaceFn(),a=St(),o=Et(),l=iterator_helper_throws_on_invalid_iterator_namespaceFn(),c=Tt(),d=wt(),u=RangeError,p=1/0,g=!d&&!l("take",1),m=!d&&!g&&c("take",RangeError),f=d||g||m||!function(){try{Iterator.prototype.take.call({next:function(){return{done:!0}}},9007199254740992)}catch(t){return t instanceof u}}(),b=a(function(){var t=this.iterator;if(!this.remaining--){this.done=!0;return o(t,"normal",void 0)}var n=i(e(this.next,t));if(!(this.done=!!n.done))return n.value});t({target:"Iterator",proto:!0,real:!0,forced:f},{take:function take(t){i(this);var a;try{if((a=s(r(+t)))>9007199254740991&&a!==p)throw new u("The argument should be a safe integer")}catch(t){o(this,"throw",t)}return m?e(m,this,a):new b(n(this),{remaining:a})}})}),Ge=__webpack_require__.cw(()=>{var t=H(),e=h(),i=k(),n=xt(),r=get_iterator_direct_namespaceFn();t({target:"Iterator",proto:!0,real:!0},{toArray:function toArray(){var t=[],s=0;n(r(e(this)),function(e){i(t,s++,e)},{IS_RECORD:!0});return t}})}),We=__webpack_require__.cw(()=>{var t=H(),e=O(),i=it(),n=Y(),r=K(),s=V(),a=mt(),o=bt(),l=pt(),c=nt(),h=we(),d=Pt(),u=k(),p=z(),g=Xt(),m=de(),f=i.JSON,b=i.Number,y=i.SyntaxError,w=f&&f.parse,v=n("Object","keys"),_=Object.getOwnPropertyDescriptor,A=r("".charAt),x=r("".slice),C=r(/./.exec),E=r([].push),S=/^\d$/,T=/^[1-9]$/,P=/^[\d-]$/,M=/^[\t\n\r ]$/,internalize=function(t,e,i,n){var r,a,h,u,p,g=t[e],m=n&&g===n.value,f=m&&"string"==typeof n.source?{source:n.source}:{};if(o(g)){var b=l(g),y=m?n.nodes:b?[]:{};if(b){r=y.length;h=d(g);for(u=0;u{var t=H(),e=Y(),i=V(),n=K(),r=z(),s=pt(),a=mt(),o=bt(),l=Rt(),c=vt(),h=_t(),d=A(),u=ue(),p=y().includes,g=nt(),m=we(),f=Xt(),b=_e(),w=de(),v=It(),_=String,x=TypeError,C=e("JSON","stringify"),E=e("BigInt"),S=n("".valueOf),T=n((!0).valueOf),k=E&&n(E.prototype.valueOf),P=n(/./.exec),M=n("".charAt),D=n("".charCodeAt),I=n("".replace),O=n("".slice),R=n([].push),B=n([].pop),L=n(1.1.toString),N=/[\uD800-\uDFFF]/g,U=/^[\uD800-\uDBFF]$/,G=/^[\uDC00-\uDFFF]$/,W=/^\d+$/,j=b(),q=b(),$=b(),X=j.length,J=q.length,Q=!w||r(function(){var t=e("Symbol")("stringify detection");return"[null]"!==C([t])||"{}"!==C({a:t})||"{}"!==C(Object(t))}),Z=r(function(){return'"\\udf06\\ud834"'!==C("\udf06\ud834")||'"\\udead"'!==C("\udead")}),tt=v?e("JSON","isRawJSON"):c,et=Q?function(t,e,n){return C(t,function(t,n){var r=i(e,this,t,n);if(!h(r))return r},n)}:C,fixIllFormedJSON=function(t,e,i){var n=M(i,e-1),r=M(i,e+1);return P(U,t)&&!P(G,r)||P(G,t)&&!P(U,n)?"\\u"+L(D(t,0),16):t},hasInternalSlot=function(t,e){try{t(e);return!0}catch(t){return!1}},isSerializedAsObject=function(t){if(!o(t)||a(t)||s(t))return!1;try{return!function(t){var e=d(t);return"Number"===e&&hasInternalSlot(u,t)||"String"===e&&hasInternalSlot(S,t)||"Boolean"===e&&hasInternalSlot(T,t)||!!k&&"BigInt"===e&&hasInternalSlot(k,t)}(t)}catch(t){return!0}},createElementHolder=function(t,e){return{toJSON:function(){var n=t[e];if(o(n)||"bigint"==typeof n){var r=n.toJSON;a(r)&&(n=i(r,n,e))}return n}}};C&&t({target:"JSON",stat:!0,arity:3,forced:Q||Z||!v},{stringify:function stringify(t,e,n){var r,o=a(e)?e:void 0,c=o?void 0:function(t){if(s(t)){for(var e=t.length,i=[],n=l(null),r=0;r{var t=H(),e=i(),n=Dt(),r=wt(),s=n.get,a=n.has,o=n.set;t({target:"Map",proto:!0,real:!0,forced:r},{getOrInsertComputed:function getOrInsertComputed(t,i){var n=a(this,t);e(i);if(n)return s(this,t);0===t&&1/t==-1/0&&(t=0);var r=i(t);o(this,t,r);return r}})}),qe=__webpack_require__.cw(()=>{var t=H(),e=Dt(),i=wt(),n=e.get,r=e.has,s=e.set;t({target:"Map",proto:!0,real:!0,forced:i},{getOrInsert:function getOrInsert(t,e){if(r(this,t))return n(this,t);s(this,t,e);return e}})}),$e=__webpack_require__.cw(()=>{var t=H(),e=K(),i=xt(),n=z(),r=Q(),s=Vt(),a=Pe(),o=RangeError,l=TypeError,c=1/0,h=Math.sumPrecise,d=Math.abs,u=Math.pow,p=e([].push),g=a("iterator"),m=u(2,1023),f=u(2,53)-1,b=Number.MAX_VALUE,y=u(2,971),w={},v={},_={},A={},x={},C=n(function(){if(-1!==h([-1])||h([-b])!==-b)return!0;if(!s)return!1;try{h(s([1],{}));return!0}catch(t){}try{var t={};t[g]=function(){return this};h(s(r([1]),t));return!0}catch(t){}}),twosum=function(t,e){var i=t+e;return{hi:i,lo:e-(i-t)}};t({target:"Math",stat:!0,forced:C},{sumPrecise:function sumPrecise(t){var e=[],n=0,r=A;i(t,function(t){if(++n>f)throw new o("Maximum allowed index exceeded");if("number"!=typeof t)throw new l("Value is not a number");if(r!==w)if(t!=t)r=w;else if(t===c)r=r===v?w:_;else if(t===-1/0)r=r===_?w:v;else if(!(0===t&&1/t!==c||r!==A&&r!==x)){r=x;p(e,t)}});switch(r){case w:return NaN;case v:return-1/0;case _:return c;case A:return-0}for(var s,a,h,u,g,C,E=[],S=0,T=0;T=0?E[D]:0;D--;if(d(S)>1||S>0&&I>0||S<0&&I<0)return S>0?c:-1/0;u=(h=twosum(S*m,I/2)).hi;g=h.lo;g*=2;if(d(2*u)===c)return u>0?u===m&&g===-y/2&&D>=0&&E[D]<0?b:c:u===-m&&g===y/2&&D>=0&&E[D]>0?-b:-1/0;if(0!==g){E[++D]=g;g=0}u*=2}for(;D>=0;){u=(h=twosum(u,E[D--])).hi;if(0!==(g=h.lo))break}D>=0&&(g<0&&E[D]<0||g>0&&E[D]>0)&&(a=2*g)===(s=u+a)-u&&(u=s);return u}})}),Xe=__webpack_require__.cw(()=>{var t=H(),e=it(),n=G(),r=v(),s=Kt(),a=Ft(),o=i(),l=__webpack_require__(103),c=z(),h=e.Promise,d=!1;t({target:"Promise",stat:!0,forced:!h||!h.try||c(function(){var t=h.resolve();return h.try(function(e){d=8===e;return t},8)!==t})||!d},{try:function(t){var e=arguments.length>1?r(arguments,1):[],i=l(function(){return n(o(t),void 0,e)});if(!i.error)return s(this,i.value);var c=a.f(this);(0,c.reject)(i.value);return c.promise}})}),Ke=__webpack_require__.cw(()=>{var t=H(),e=Jt(),i=z();t({target:"Set",proto:!0,real:!0,forced:!re()("difference",function(t){return 0===t.size})||i(function(){var t={size:1,has:function(){return!0},keys:function(){var t=0;return{next:function(){var i=t++>1;e.has(1)&&e.clear();return{done:i,value:2}}}}},e=new Set([1,2,3,4]);return 3!==e.difference(t).size})},{difference:e})}),Ye=__webpack_require__.cw(()=>{var t=H(),e=z(),i=Zt();t({target:"Set",proto:!0,real:!0,forced:!re()("intersection",function(t){return 2===t.size&&t.has(1)&&t.has(2)})||e(function(){return"3,2"!==String(Array.from(new Set([1,2,3]).intersection(new Set([3,2]))))})},{intersection:i})}),Je=__webpack_require__.cw(()=>{var t=H(),e=te();t({target:"Set",proto:!0,real:!0,forced:!re()("isDisjointFrom",function(t){return!t})},{isDisjointFrom:e})}),Qe=__webpack_require__.cw(()=>{var t=H(),e=ee();t({target:"Set",proto:!0,real:!0,forced:!re()("isSubsetOf",function(t){return t})},{isSubsetOf:e})}),Ze=__webpack_require__.cw(()=>{var t=H(),e=ie();t({target:"Set",proto:!0,real:!0,forced:!re()("isSupersetOf",function(t){return!t})},{isSupersetOf:e})}),ti=__webpack_require__.cw(()=>{var t=H(),e=ae(),i=set_method_get_keys_before_cloning_detection_namespaceFn();t({target:"Set",proto:!0,real:!0,forced:!re()("symmetricDifference")||!i("symmetricDifference")},{symmetricDifference:e})}),ei=__webpack_require__.cw(()=>{var t=H(),e=oe(),i=set_method_get_keys_before_cloning_detection_namespaceFn();t({target:"Set",proto:!0,real:!0,forced:!re()("union")||!i("union")},{union:e})}),ii=__webpack_require__.cw(()=>{var t=f(),e=gt(),i=Pt(),n=to_integer_or_infinity_namespaceFn(),r=ge(),s=t.aTypedArray,a=t.getTypedArrayConstructor,o=t.exportTypedArrayMethod,l=RangeError,c=function(){try{new Int8Array(1).with(2,{valueOf:function(){throw 8}})}catch(t){return 8===t}}(),h=c&&function(){try{new Int8Array(1).with(-.5,1)}catch(t){return!0}}();o("with",{with:function(t,o){var c=s(this),h=i(c),d=n(t),u=d<0?h+d:d,p=e(c)?r(o):+o;if(u>=h||u<0)throw new l("Incorrect index");for(var g=new(a(c))(h),m=0;m{var t=H(),e=it(),i=b(),n=Ae(),r=e.Uint8Array,s=!r||!r.fromBase64||!function(){try{r.fromBase64("a");return}catch(t){}try{r.fromBase64("",null)}catch(t){return!0}}();r&&t({target:"Uint8Array",stat:!0,forced:s},{fromBase64:function fromBase64(t){var e=n(t,arguments.length>1?arguments[1]:void 0,null,9007199254740991);return i(r,e.bytes)}})}),ri=__webpack_require__.cw(()=>{var t=H(),e=it(),i=Ae(),n=d(),r=e.Uint8Array,s=!r||!r.prototype.setFromBase64||!function(){var t=new r([255,255,255,255,255]);try{t.setFromBase64("",null);return}catch(t){}try{t.setFromBase64("a");return}catch(t){}try{t.setFromBase64("MjYyZg===")}catch(e){return 50===t[0]&&54===t[1]&&50===t[2]&&255===t[3]&&255===t[4]}}();r&&t({target:"Uint8Array",proto:!0,forced:s},{setFromBase64:function setFromBase64(t){n(this);var e=i(t,arguments.length>1?arguments[1]:void 0,this,this.length);return{read:e.read,written:e.written}}})}),si=__webpack_require__.cw(()=>{var t=H(),e=it(),i=a_string_namespaceFn(),n=d(),r=m(),s=xe();e.Uint8Array&&t({target:"Uint8Array",proto:!0,forced:function throwsOnLengthTrackingView(){try{var t=new ArrayBuffer(16,{maxByteLength:1024});new Uint8Array(t).setFromHex("cafed00d")}catch(t){return!0}}()},{setFromHex:function setFromHex(t){n(this);i(t);r(this.buffer);var e=s(t,this).read;return{read:e,written:e/2}}})}),ai=__webpack_require__.cw(()=>{var t=H(),e=it(),i=K(),n=c(),r=d(),s=m(),a=base64_map_namespaceFn(),o=get_alphabet_option_namespaceFn(),l=a.i2c,h=a.i2cUrl,u=Math.floor,p=Math.ceil,g=i("".charAt),f=e.Uint8Array,b=e.Array,y=i([].join),w=!f||!f.prototype.toBase64||!function(){try{(new f).toBase64(null)}catch(t){return!0}}();f&&t({target:"Uint8Array",proto:!0,forced:w},{toBase64:function toBase64(){var t=r(this),e=arguments.length?n(arguments[0]):void 0,i="base64"===o(e)?l:h,a=!!e&&!!e.omitPadding;s(this.buffer);for(var c,d=0,m=t.length,f=b(a?4*u(m/3)+(m%3?m%3+1:0):4*p(m/3)),w=0,at=function(t){return g(i,c>>6*t&63)};d+2{var t=H(),e=it(),i=K(),n=d(),r=m(),s=i(1.1.toString),a=i([].join),o=Array,l=e.Uint8Array,c=!l||!l.prototype.toHex||!function(){try{return"ffffffffffffffff"===new l([255,255,255,255,255,255,255,255]).toHex()}catch(t){return!1}}();l&&t({target:"Uint8Array",proto:!0,forced:c},{toHex:function toHex(){n(this);r(this.buffer);for(var t=o(this.length),e=0,i=this.length;e{var t=H(),e=i(),n=a(),r=s(),o=ke(),l=wt(),c=o.get,h=o.has,d=o.set;t({target:"WeakMap",proto:!0,real:!0,forced:l||!function(){try{WeakMap.prototype.getOrInsertComputed&&(new WeakMap).getOrInsertComputed(1,function(){throw 1})}catch(t){return t instanceof TypeError}}()},{getOrInsertComputed:function getOrInsertComputed(t,i){l||n(this);r(t);e(i);if(h(this,t))return c(this,t);var s=i(t);d(this,t,s);return s}})}),ci=__webpack_require__.cw(()=>{var t=H(),e=ke(),i=wt(),n=e.get,r=e.has,s=e.set;t({target:"WeakMap",proto:!0,real:!0,forced:i},{getOrInsert:function getOrInsert(t,e){if(r(this,t))return n(this,t);s(this,t,e);return e}})}),hi=__webpack_require__.cw(()=>{var t=H(),e=it(),i=Y(),n=T(),r=Lt().f,s=nt(),a=l(),o=ct(),c=Ot(),h=__webpack_require__(2),d=U(),u=O(),p=wt(),g="DOMException",m=i("Error"),f=i(g),b=function DOMException(){a(this,y);var t=arguments.length,e=c(t<1?void 0:arguments[0]),i=c(t<2?void 0:arguments[1],"Error"),s=new f(e,i),l=new m(e);l.name=g;r(s,"stack",n(1,d(l.stack,1)));o(s,this,b);return s},y=b.prototype=f.prototype,w="stack"in new m(g),v="stack"in new f(1,2),_=f&&u&&Object.getOwnPropertyDescriptor(e,g),A=!(!_||_.writable&&_.configurable),x=w&&!A&&!v;t({global:!0,constructor:!0,forced:p||x},{DOMException:x?b:f});var C=i(g),E=C.prototype;if(E.constructor!==C){p||r(E,"constructor",n(1,C));for(var S in h)if(s(h,S)){var k=h[S],P=k.s;s(C,P)||r(C,P,n(6,k.c))}}}),di=__webpack_require__.cw(()=>{var t=H(),e=Y(),i=__webpack_require__(812),n=we(),r=Ce(),s=e("URL");t({target:"URL",stat:!0,forced:!r},{parse:function parse(t){var e=i(arguments.length,1),r=n(t),a=e<2||void 0===arguments[1]?void 0:n(arguments[1]);try{return new s(r,a)}catch(t){return null}}})});Me();De();Ie();Re();qe();Ve();Ke();Ye();Je();Qe();Ze();ti();ei();ii();ri();si();ai();oi();di();const ui=!("object"!=typeof process||process+""!="[object process]"||process.versions.nw||process.versions.electron&&process.type&&"browser"!==process.type),pi=[1/0,1/0,-1/0,-1/0],gi=new Float32Array(pi),mi=[.001,0,0,.001,0,0],fi="http://www.w3.org/2000/svg",bi=1,yi=2,wi=4,vi=16,_i=32,Ai=64,xi=128,Ci=256,Ei={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3},Si="pdfjs_internal_id_",Ti="pdfjs_internal_editor_",ki={DISABLE:-1,NONE:0,FREETEXT:3,HIGHLIGHT:9,STAMP:13,INK:15,POPUP:16,SIGNATURE:101,COMMENT:102},Pi={RESIZE:1,CREATE:2,FREETEXT_SIZE:11,FREETEXT_COLOR:12,FREETEXT_OPACITY:13,INK_COLOR:21,INK_THICKNESS:22,INK_OPACITY:23,INK_COLOR_AND_OPACITY:24,HIGHLIGHT_COLOR:31,HIGHLIGHT_THICKNESS:32,HIGHLIGHT_FREE:33,HIGHLIGHT_SHOW_ALL:34,DRAW_STEP:41},Mi={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},Di=0,Ii=1,Fi=2,Oi=3,Ri=3,Bi=4,Li={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},Ni={TEXT:1,LINK:2,FREETEXT:3,LINE:4,SQUARE:5,CIRCLE:6,POLYGON:7,POLYLINE:8,HIGHLIGHT:9,UNDERLINE:10,SQUIGGLY:11,STRIKEOUT:12,STAMP:13,CARET:14,INK:15,POPUP:16,FILEATTACHMENT:17,SOUND:18,MOVIE:19,WIDGET:20,SCREEN:21,PRINTERMARK:22,TRAPNET:23,WATERMARK:24,THREED:25,REDACT:26,RICHMEDIA:27},Ui=1,Hi=2,zi=3,Gi=4,Wi=5,ji={ERRORS:0,WARNINGS:1,INFOS:5},Vi={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},qi=0,$i=1,Xi=2,Ki=3,Yi=4,Ji={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};let Qi=ji.WARNINGS;function setVerbosityLevel(t){Number.isInteger(t)&&(Qi=t)}function getVerbosityLevel(){return Qi}function info(t){Qi>=ji.INFOS&&console.info(`Info: ${t}`)}function warn(t){Qi>=ji.WARNINGS&&console.warn(`Warning: ${t}`)}function unreachable(t){throw new Error(t)}function util_assert(t,e){t||unreachable(e)}function createValidAbsoluteUrl(t,e=null,i=null){if(!t)return null;if(i&&"string"==typeof t){if(i.addDefaultProtocol&&t.startsWith("www.")){const e=t.match(/\./g);e?.length>=2&&(t=`http://${t}`)}if(i.tryConvertEncoding)try{t=function stringToUTF8String(t){return decodeURIComponent(escape(t))}(t)}catch{}}const n=e?URL.parse(t,e):URL.parse(t);return function _isValidProtocol(t){switch(t?.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}(n)?n:null}function updateUrlHash(t,e,i=!1){const n=URL.parse(t);if(n){n.hash=e;return n.href}return i&&createValidAbsoluteUrl(t,"http://example.com")?t.split("#",1)[0]+""+(e?`#${e}`:""):""}function stripPath(t){return t.substring(t.lastIndexOf("/")+1)}function util_shadow(t,e,i,n=!1){Object.defineProperty(t,e,{value:i,enumerable:!n,configurable:!0,writable:!1});return i}const Zi=function BaseExceptionClosure(){function BaseException(t,e){this.message=t;this.name=e}BaseException.prototype=new Error;BaseException.constructor=BaseException;return BaseException}();class PasswordException extends Zi{constructor(t,e){super(t,"PasswordException");this.code=e}}class UnknownErrorException extends Zi{constructor(t,e){super(t,"UnknownErrorException");this.details=e}}class InvalidPDFException extends Zi{constructor(t){super(t,"InvalidPDFException")}}class ResponseException extends Zi{constructor(t,e,i){super(t,"ResponseException");this.status=e;this.missing=i}}class FormatError extends Zi{constructor(t){super(t,"FormatError")}}class AbortException extends Zi{constructor(t){super(t,"AbortException")}}function stringToBytes(t){"string"!=typeof t&&unreachable("Invalid argument for stringToBytes");const e=t.length,i=new Uint8Array(e);for(let n=0;ne.toString(16).padStart(2,"0")))}static makeHexColor(t,e,i){return`#${this.hexNums[t]}${this.hexNums[e]}${this.hexNums[i]}`}static get identity0to256Map(){return util_shadow(this,"identity0to256Map",Uint8Array.from({length:256},(t,e)=>e))}static transform(t,e){return[t[0]*e[0]+t[2]*e[1],t[1]*e[0]+t[3]*e[1],t[0]*e[2]+t[2]*e[3],t[1]*e[2]+t[3]*e[3],t[0]*e[4]+t[2]*e[5]+t[4],t[1]*e[4]+t[3]*e[5]+t[5]]}static multiplyByDOMMatrix(t,e){return[t[0]*e.a+t[2]*e.b,t[1]*e.a+t[3]*e.b,t[0]*e.c+t[2]*e.d,t[1]*e.c+t[3]*e.d,t[0]*e.e+t[2]*e.f+t[4],t[1]*e.e+t[3]*e.f+t[5]]}static applyTransform(t,e,i=0){const n=t[i],r=t[i+1];t[i]=n*e[0]+r*e[2]+e[4];t[i+1]=n*e[1]+r*e[3]+e[5]}static applyTransformToBezier(t,e,i=0){const n=e[0],r=e[1],s=e[2],a=e[3],o=e[4],l=e[5];for(let e=0;e<6;e+=2){const c=t[i+e],h=t[i+e+1];t[i+e]=c*n+h*s+o;t[i+e+1]=c*r+h*a+l}}static applyInverseTransform(t,e){const i=t[0],n=t[1],r=e[0]*e[3]-e[1]*e[2];t[0]=(i*e[3]-n*e[2]+e[2]*e[5]-e[4]*e[3])/r;t[1]=(-i*e[1]+n*e[0]+e[4]*e[1]-e[5]*e[0])/r}static axialAlignedBoundingBox(t,e,i){const n=e[0],r=e[1],s=e[2],a=e[3],o=e[4],l=e[5],c=t[0],h=t[1],d=t[2],u=t[3];let p=n*c+o,g=p,m=n*d+o,f=m,b=a*h+l,y=b,w=a*u+l,v=w;if(0!==r||0!==s){const t=r*c,e=r*d,i=s*h,n=s*u;p+=i;f+=i;m+=n;g+=n;b+=t;v+=t;w+=e;y+=e}i[0]=Math.min(i[0],p,m,Math.min(g,f));i[1]=Math.min(i[1],b,w,Math.min(y,v));i[2]=Math.max(i[2],p,m,Math.max(g,f));i[3]=Math.max(i[3],b,w,Math.max(y,v))}static inverseTransform(t){const e=t[0]*t[3]-t[1]*t[2];return[t[3]/e,-t[1]/e,-t[2]/e,t[0]/e,(t[2]*t[5]-t[4]*t[3])/e,(t[4]*t[1]-t[5]*t[0])/e]}static singularValueDecompose2dScale(t,e){const i=t[0],n=t[1],r=t[2],s=t[3],a=i**2+n**2,o=i*r+n*s,l=r**2+s**2,c=(a+l)/2,h=Math.sqrt(c**2-(a*l-o**2));e[0]=Math.sqrt(c+h||1);e[1]=Math.sqrt(c-h||1)}static normalizeRect(t){const e=t.slice(0);if(t[0]>t[2]){e[0]=t[2];e[2]=t[0]}if(t[1]>t[3]){e[1]=t[3];e[3]=t[1]}return e}static intersect(t,e){const i=Math.max(Math.min(t[0],t[2]),Math.min(e[0],e[2])),n=Math.min(Math.max(t[0],t[2]),Math.max(e[0],e[2]));if(i>n)return null;const r=Math.max(Math.min(t[1],t[3]),Math.min(e[1],e[3])),s=Math.min(Math.max(t[1],t[3]),Math.max(e[1],e[3]));return r>s?null:[i,r,n,s]}static pointBoundingBox(t,e,i){i[0]=Math.min(i[0],t);i[1]=Math.min(i[1],e);i[2]=Math.max(i[2],t);i[3]=Math.max(i[3],e)}static rectBoundingBox(t,e,i,n,r){r[0]=Math.min(r[0],t,i);r[1]=Math.min(r[1],e,n);r[2]=Math.max(r[2],t,i);r[3]=Math.max(r[3],e,n)}static#t(t,e,i,n,r,s,a,o,l,c){if(l<=0||l>=1)return;const h=1-l,d=l*l,u=d*l,p=h*(h*(h*t+3*l*e)+3*d*i)+u*n,g=h*(h*(h*r+3*l*s)+3*d*a)+u*o;c[0]=Math.min(c[0],p);c[1]=Math.min(c[1],g);c[2]=Math.max(c[2],p);c[3]=Math.max(c[3],g)}static#e(t,e,i,n,r,s,a,o,l,c,h,d){if(Math.abs(l)<1e-12){Math.abs(c)>=1e-12&&this.#t(t,e,i,n,r,s,a,o,-h/c,d);return}const u=c**2-4*h*l;if(u<0)return;const p=Math.sqrt(u),g=2*l;this.#t(t,e,i,n,r,s,a,o,(-c+p)/g,d);this.#t(t,e,i,n,r,s,a,o,(-c-p)/g,d)}static bezierBoundingBox(t,e,i,n,r,s,a,o,l){l[0]=Math.min(l[0],t,a);l[1]=Math.min(l[1],e,o);l[2]=Math.max(l[2],t,a);l[3]=Math.max(l[3],e,o);this.#e(t,i,r,a,e,n,s,o,3*(3*(i-r)-t+a),6*(t-2*i+r),3*(i-t),l);this.#e(t,i,r,a,e,n,s,o,3*(3*(n-s)-e+o),6*(e-2*n+s),3*(n-e),l)}}let tn=null,en=null;function normalizeUnicode(t){if(!tn){tn=/([\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;en=new Map([["ſt","ſt"]])}return t.replaceAll(tn,(t,e,i)=>e?e.normalize("NFKC"):en.get(i))}function getUuid(){if("function"==typeof crypto.randomUUID)return crypto.randomUUID();const t=new Uint8Array(32);crypto.getRandomValues(t);return function bytesToString(t){"object"==typeof t&&void 0!==t?.length||unreachable("Invalid argument for bytesToString");const e=t.length,i=8192;if(e[],makeMap=()=>new Map,makeObj=()=>Object.create(null),makeSet=()=>new Set;"function"!=typeof Blob.prototype.bytes&&(Blob.prototype.bytes=async function(){return new Uint8Array(await this.arrayBuffer())});"function"!=typeof Response.prototype.bytes&&(Response.prototype.bytes=async function(){return new Uint8Array(await this.arrayBuffer())});"function"!=typeof Iterator.prototype.join&&(Iterator.prototype.join=function(t){return[...this].join(t)});Ue();function MathClamp(t,e,i){return Math.min(Math.max(t,e),i)}class PixelsPerInch{static CSS=96;static PDF=72;static PDF_TO_CSS_UNITS=this.CSS/this.PDF}class RenderingCancelledException extends Zi{constructor(t,e=0){super(t,"RenderingCancelledException");this.extraDelay=e}}function getRGBA(t){if(t.startsWith("#")){const e=t.slice(1);return[parseInt(e.slice(0,2),16),parseInt(e.slice(2,4),16),parseInt(e.slice(4,6),16),e.length>=8?parseInt(e.slice(6,8),16)/255:1]}if(t.startsWith("rgb(")){const[e,i,n]=t.slice(4,-1).split(",").map(t=>parseInt(t,10));return[e,i,n,1]}if(t.startsWith("rgba(")){const e=t.slice(5,-1).split(",");return[parseInt(e[0],10),parseInt(e[1],10),parseInt(e[2],10),parseFloat(e[3])]}const e=t.match(/^color\(srgb\s+([\d.]+)\s+([\d.]+)\s+([\d.]+)(?:\s*\/\s*([\d.]+|none))?\)$/);return e?[Math.round(255*parseFloat(e[1])),Math.round(255*parseFloat(e[2])),Math.round(255*parseFloat(e[3])),void 0!==e[4]&&"none"!==e[4]?parseFloat(e[4]):1]:null}function getRGB(t){const e=getRGBA(t);if(!e){warn(`Not a valid color format: "${t}"`);return[0,0,0]}return e.slice(0,3)}function getCurrentTransform(t){const{a:e,b:i,c:n,d:r,e:s,f:a}=t.getTransform();return[e,i,n,r,s,a]}function getCurrentTransformInverse(t){const{a:e,b:i,c:n,d:r,e:s,f:a}=t.getTransform().invertSelf();return[e,i,n,r,s,a]}class OutputScale{constructor(){const{pixelRatio:t}=OutputScale;this.sx=t;this.sy=t}get scaled(){return 1!==this.sx||1!==this.sy}get symmetric(){return this.sx===this.sy}limitCanvas(t,e,i,n,r=-1){let s=1/0,a=1/0,o=1/0;(i=OutputScale.capPixels(i,r))>0&&(s=Math.sqrt(i/(t*e)));if(-1!==n){a=n/t;o=n/e}const l=Math.min(s,a,o);if(this.sx>l||this.sy>l){this.sx=l;this.sy=l;return!0}return!1}static get pixelRatio(){return globalThis.devicePixelRatio||1}static capPixels(t,e){if(e>=0){const i=Math.ceil(window.screen.availWidth*window.screen.availHeight*this.pixelRatio**2*(1+e/100));return t>0?Math.min(t,i):i}return t}}function applyOpacity(t,e){const i=255*(1-(e=MathClamp(e??1,0,1)));return t.map(t=>Math.round(t*e+i))}function RGBToHSL(t,e){const i=t[0]/255,n=t[1]/255,r=t[2]/255,s=Math.max(i,n,r),a=Math.min(i,n,r),o=(s+a)/2;if(s===a)e[0]=e[1]=0;else{const t=s-a;e[1]=o<.5?t/(s+a):t/(2-s-a);switch(s){case i:e[0]=60*((n-r)/t+(nr?(n+.05)/(r+.05):(r+.05)/(n+.05)}const nn=new Map;function findContrastColor(t,e){const i=t[0]+256*t[1]+65536*t[2]+16777216*e[0]+4294967296*e[1]+1099511627776*e[2];let n=nn.get(i);if(n)return n;const r=new Float32Array(9),s=r.subarray(0,3),a=r.subarray(3,6);RGBToHSL(t,a);const o=r.subarray(6,9);RGBToHSL(e,o);const l=o[2]<.5,c=l?12:4.5;a[2]=l?Math.sqrt(a[2]):1-Math.sqrt(1-a[2]);if(contrastRatio(a,o,s)i;){const i=a[2]=(t+e)/2;l===contrastRatio(a,o,s){n.setValue(e,{value:t.target.value})});break;case"input":if("radio"===i.attributes.type||"checkbox"===i.attributes.type){s.value===i.attributes.xfaOn?t.setAttribute("checked",!0):s.value===i.attributes.xfaOff&&t.removeAttribute("checked");if("print"===r)break;t.addEventListener("change",t=>{n.setValue(e,{value:t.target.checked?t.target.getAttribute("xfaOn"):t.target.getAttribute("xfaOff")})})}else{null!==s.value&&t.setAttribute("value",s.value);if("print"===r)break;t.addEventListener("input",t=>{n.setValue(e,{value:t.target.value})})}break;case"select":if(null!==s.value){t.setAttribute("value",s.value);for(const t of i.children)t.attributes.value===s.value?t.attributes.selected=!0:Object.hasOwn(t.attributes,"selected")&&delete t.attributes.selected}t.addEventListener("input",t=>{const i=t.target.options,r=-1===i.selectedIndex?"":i[i.selectedIndex].value;n.setValue(e,{value:r})})}}static setAttributes({html:t,element:e,storage:i=null,intent:n,linkService:r}){const{attributes:s}=e,a=t instanceof HTMLAnchorElement;"radio"===s.type&&(s.name=`${s.name}-${n}`);for(const[e,i]of Object.entries(s))if(null!=i&&!sn.test(e)&&("richText"!==n||this._allowedRichTextAttributes.has(e)))switch(e){case"class":i.length&&t.setAttribute(e,i.join(" "));break;case"dataId":break;case"id":t.setAttribute("data-element-id",i);break;case"style":if("richText"===n){const e=this._allowedRichTextStyles;for(const[n,r]of Object.entries(i))e.has(n)&&!rn.test(r)&&(t.style[n]=r)}else Object.assign(t.style,i);break;case"textContent":t.textContent=i;break;default:(!a||"href"!==e&&"newWindow"!==e)&&t.setAttribute(e,i)}a&&r?.addLinkAttributes(t,s.href,s.newWindow);i&&s.dataId&&this.setupStorage(t,s.dataId,e,i)}static#i(t,e,i){return"richText"===i?!e&&this._allowedRichTextElements.has(t)?document.createElement(t):null:e?e===fi&&this._allowedSvgElements.has(t)?document.createElementNS(fi,t):null:this._allowedHtmlElements.has(t)?document.createElement(t):null}static render(t){const e=t.annotationStorage,i=t.linkService,n=t.xfaHtml,r=t.intent||"display",s=this.#i(n.name,n.attributes?.xmlns,r)??document.createElement("div");n.attributes&&this.setAttributes({html:s,element:n,intent:r,linkService:i});const a="richText"!==r,o=t.div;o.append(s);if(t.viewport){const e=`matrix(${t.viewport.transform.join(",")})`;o.style.transform=e}a&&o.setAttribute("class","xfaLayer xfaFont");const l=[];if(0===n.children.length){if(n.value){const t=document.createTextNode(n.value);s.append(t);a&&XfaText.shouldBuildText(n.name)&&l.push(t)}return{textDivs:l}}const c=[[n,-1,s]];for(;c.length>0;){const[t,n,s]=c.at(-1);if(n+1===t.children.length){c.pop();continue}const o=t.children[++c.at(-1)[1]];if(null===o)continue;const{name:h}=o;if("#text"===h){const t=document.createTextNode(o.value);l.push(t);s.append(t);continue}const d=this.#i(h,o.attributes?.xmlns,r);if(d){s.append(d);o.attributes&&this.setAttributes({html:d,element:o,storage:e,intent:r,linkService:i});if(o.children?.length>0)c.push([o,-1,d]);else if(o.value){const t=document.createTextNode(o.value);a&&XfaText.shouldBuildText(h)&&l.push(t);d.append(t)}}}for(const t of o.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))t.setAttribute("readOnly",!0);return{textDivs:l}}static update(t){const e=`matrix(${t.viewport.transform.join(",")})`;t.div.style.transform=e;t.div.hidden=!1}static getPageViewport(t,{scale:e=1,rotation:i=0}){const{width:n,height:r}=t.attributes.style;return new PageViewport({viewBox:[0,0,parseInt(n,10),parseInt(r,10)],userUnit:1,scale:e,rotation:i})}}async function fetchData(t,e="text"){if(isValidFetchUrl(t,document.baseURI)){const i=await fetch(t);if(!i.ok)throw new Error(i.statusText);switch(e){case"blob":return i.blob();case"bytes":return i.bytes();case"json":return i.json()}return i.text()}return new Promise((i,n)=>{const r=new XMLHttpRequest;r.open("GET",t,!0);r.responseType="bytes"===e?"arraybuffer":e;r.onreadystatechange=()=>{if(r.readyState===XMLHttpRequest.DONE)if(200!==r.status&&0!==r.status)n(new Error(r.statusText));else{switch(e){case"bytes":i(new Uint8Array(r.response));return;case"blob":case"json":i(r.response);return}i(r.responseText)}};r.send(null)})}function isDataScheme(t){const e=t.length;let i=0;for(;i{try{return new URL(t)}catch{}try{return new URL(decodeURIComponent(t))}catch{}try{return new URL(t,"https://foo.bar")}catch{}try{return new URL(decodeURIComponent(t),"https://foo.bar")}catch{}return null})(t);if(!i)return e;const decode=t=>{try{let e=decodeURIComponent(t);if(e.includes("/")){e=stripPath(e);if(4===e.length&&n.test(e))return t}return e}catch{return t}},n=/\.pdf$/i,r=stripPath(i.pathname);if(n.test(r))return decode(r);if(i.searchParams.size>0){const getLast=t=>[...t].findLast(t=>n.test(t)),t=getLast(i.searchParams.values())??getLast(i.searchParams.keys());if(t)return decode(t)}if(i.hash){const{hash:t}=i;let e=-1;for(const{index:i}of t.matchAll(/\.pdf\b/gi))e=i;if(e>0){let i=e;for(;i>0&&!"/?#=".includes(t[i-1]);)i--;if(i=1&&n<=12?n-1:0;let r=parseInt(e[3],10);r=r>=1&&r<=31?r:1;let s=parseInt(e[4],10);s=s>=0&&s<=23?s:0;let a=parseInt(e[5],10);a=a>=0&&a<=59?a:0;let o=parseInt(e[6],10);o=o>=0&&o<=59?o:0;const l=e[7]||"Z";let c=parseInt(e[8],10);c=c>=0&&c<=23?c:0;let h=parseInt(e[9],10)||0;h=h>=0&&h<=59?h:0;if("-"===l){s+=c;a+=h}else if("+"===l){s-=c;a-=h}return new Date(Date.UTC(i,n,r,s,a,o))}}function setLayerDimensions(t,e,i=!1,n=!0){if(e instanceof PageViewport){const{pageWidth:n,pageHeight:r}=e.rawDims,{style:s}=t,a=`round(down, var(--total-scale-factor) * ${n}px, var(--scale-round-x))`,o=`round(down, var(--total-scale-factor) * ${r}px, var(--scale-round-y))`;if(i&&e.rotation%180!=0){s.width=o;s.height=a}else{s.width=a;s.height=o}}n&&t.setAttribute("data-main-rotation",e.rotation)}const an=new Set(["image/apng","image/avif","image/bmp","image/gif","image/jpeg","image/png","image/svg+xml","image/webp","image/x-icon"]);class ColorScheme{static get isDarkMode(){return util_shadow(this,"isDarkMode",!!window?.matchMedia?.("(prefers-color-scheme: dark)").matches)}}class CSSConstants{static get commentForegroundColor(){const t=document.createElement("span");t.classList.add("comment","sidebar");const{style:e}=t;e.width=e.height="0";e.display="none";e.color="var(--comment-fg-color)";document.body.append(t);const{color:i}=window.getComputedStyle(t);t.remove();return util_shadow(this,"commentForegroundColor",getRGB(i))}}function renderRichText({html:t,dir:e,className:i},n){const r=document.createDocumentFragment();if("string"==typeof t){const i=document.createElement("p");i.dir=e||"auto";const n=t.split(/\r\n?|\n/);for(let t=0,e=n.length;t{e.delete()},{signal:e._signal});this.#o.append(i)}get#b(){const t=document.createElement("div");t.className="divider";return t}async addAltText(t){const e=await t.render();this.#f(e);this.#o.append(e,this.#b);this.#l=t}addComment(t,e=null){if(this.#c)return;const i=t.renderForToolbar();if(!i)return;this.#f(i);const n=this.#h=this.#b;if(e){this.#o.insertBefore(i,e);this.#o.insertBefore(n,e)}else this.#o.append(i,n);this.#c=t;t.toolbar=this}addColorPicker(t){if(this.#s)return;this.#s=t;const e=t.renderButton();this.#f(e);this.#o.append(e,this.#b)}async addEditSignatureButton(t){const e=this.#d=await t.renderEditButton(this.#a);if(e){this.#f(e);this.#o.append(e,this.#b)}}removeButton(t){if("comment"===t){this.#c?.removeToolbarCommentButton();this.#c=null;this.#h?.remove();this.#h=null}}async addButton(t,e){switch(t){case"colorPicker":e&&this.addColorPicker(e);break;case"altText":e&&await this.addAltText(e);break;case"editSignature":e&&await this.addEditSignatureButton(e);break;case"delete":this.addDeleteButton();break;case"comment":e&&this.addComment(e)}}async addButtonBefore(t,e,i){if(!e&&"comment"===t)return;const n=this.#o.querySelector(i);n&&"comment"===t&&this.addComment(e,n)}updateEditSignatureButton(t){this.#d&&(this.#d.title=t)}remove(){this.#r.remove();this.#s?.destroy();this.#s=null}}class FloatingToolbar{#o=null;#r=null;#y;constructor(t){this.#y=t}#w(){const t=this.#r=document.createElement("div");t.className="editToolbar";t.setAttribute("role","toolbar");t.dir=this.#y.direction;const e=this.#y._signal;e instanceof AbortSignal&&!e.aborted&&t.addEventListener("contextmenu",noContextMenu,{signal:e});const i=this.#o=document.createElement("div");i.className="buttons";t.append(i);this.#y.hasCommentManager()&&this.#v("commentButton","pdfjs-comment-floating-button","pdfjs-comment-floating-button-label",()=>{this.#y.commentSelection("floating_button")});this.#v("highlightButton","pdfjs-highlight-floating-button1","pdfjs-highlight-floating-button-label",()=>{this.#y.highlightSelection("floating_button")});return t}#_(t,e){let i=0,n=0;for(const r of t){const t=r.y+r.height;if(ti){n=s;i=t}else e?s>n&&(n=s):s=1}static clearPointerType(){CurrentPointers.#E=null}static clearPointerIds(){CurrentPointers.#A=NaN;CurrentPointers.#x=null}static clearTimeStamp(){CurrentPointers.#C=NaN}}class IdManager{#S=0;get id(){return`${Ti}${this.#S++}`}}class ImageManager{#T=getUuid();#S=0;#k=null;static get _isSVGFittingCanvas(){const t=`data:image/svg+xml;charset=UTF-8,`,e=new OffscreenCanvas(1,3).getContext("2d",{willReadFrequently:!0}),i=new Image;i.src=t;return util_shadow(this,"_isSVGFittingCanvas",i.decode().then(()=>{e.drawImage(i,0,0,1,1,0,0,1,3);return 0===new Uint32Array(e.getImageData(0,0,1,1).data.buffer)[0]}))}async#P(t,e){this.#k||=new Map;let i=this.#k.get(t);if(null===i)return null;if(i?.bitmap){i.refCounter+=1;return i}try{i||={bitmap:null,id:`image_${this.#T}_${this.#S++}`,refCounter:0,isSvg:!1};let t;if("string"==typeof e){i.url=e;t=await fetchData(e,"blob")}else e instanceof File?t=i.file=e:e instanceof Blob&&(t=e);if("image/svg+xml"===t.type){const e=ImageManager._isSVGFittingCanvas,n=new FileReader,r=new Image,s=new Promise((t,s)=>{r.onload=()=>{i.bitmap=r;i.isSvg=!0;t()};n.onload=async()=>{const t=i.svgUrl=n.result;r.src=await e?`${t}#svgView(preserveAspectRatio(none))`:t};r.onerror=n.onerror=s});n.readAsDataURL(t);await s}else i.bitmap=await createImageBitmap(t);i.refCounter=1}catch(t){warn(t);i=null}this.#k.set(t,i);i&&this.#k.set(i.id,i);return i}async getFromFile(t){const{lastModified:e,name:i,size:n,type:r}=t;return this.#P(`${e}_${i}_${n}_${r}`,t)}async getFromUrl(t){return this.#P(t,t)}async getFromBlob(t,e){const i=await e;return this.#P(t,i)}async getFromId(t){this.#k||=new Map;const e=this.#k.get(t);if(!e)return null;if(e.bitmap){e.refCounter+=1;return e}if(e.file)return this.getFromFile(e.file);if(e.blobPromise){const{blobPromise:t}=e;delete e.blobPromise;return this.getFromBlob(e.id,t)}return this.getFromUrl(e.url)}getFromCanvas(t,e){this.#k||=new Map;let i=this.#k.get(t);if(i?.bitmap){i.refCounter+=1;return i}const n=new OffscreenCanvas(e.width,e.height);n.getContext("2d").drawImage(e,0,0);i={bitmap:n.transferToImageBitmap(),id:`image_${this.#T}_${this.#S++}`,refCounter:1,isSvg:!1};this.#k.set(t,i);this.#k.set(i.id,i);return i}getSvgUrl(t){const e=this.#k.get(t);return e?.isSvg?e.svgUrl:null}deleteId(t){this.#k||=new Map;const e=this.#k.get(t);if(!e)return;e.refCounter-=1;if(0!==e.refCounter)return;const{bitmap:i}=e;if(!e.url&&!e.file){const t=new OffscreenCanvas(i.width,i.height);t.getContext("bitmaprenderer").transferFromImageBitmap(i);e.blobPromise=t.convertToBlob()}i.close?.();e.bitmap=null}isValidId(t){return t.startsWith(`image_${this.#T}_`)}}class CommandManager{#M=[];#D=!1;#I;#F=-1;constructor(t=128){this.#I=t}add({cmd:t,undo:e,post:i,mustExec:n,type:r=NaN,overwriteIfSameType:s=!1,keepUndo:a=!1}){n&&t();if(this.#D)return;const o={cmd:t,undo:e,post:i,type:r};if(-1===this.#F){this.#M.length>0&&(this.#M.length=0);this.#F=0;this.#M.push(o);return}if(s&&this.#M[this.#F].type===r){a&&(o.undo=this.#M[this.#F].undo);this.#M[this.#F]=o;return}const l=this.#F+1;if(l===this.#I)this.#M.splice(0,1);else{this.#F=l;l=0;e--)if(this.#M[e].type!==t){this.#M.splice(e+1,this.#F-e);this.#F=e;return}this.#M.length=0;this.#F=-1}}destroy(){this.#M=null}}class KeyboardManager{static ALT=1;static CTRL=2;static META=4;static SHIFT=8;constructor(t){this.callbacks=new Map;const{isMac:e}=FeatureTest.platform;for(const[i,n,r={}]of t){const t=i.some(t=>t.startsWith("mac+"));for(const s of i){let i=s;if(t){const t=s.startsWith("mac+");if(e!==t)continue;t&&(i=s.slice(4))}const[a,o]=KeyboardManager.#O(i);null!==a&&this.callbacks.getOrInsertComputed(a,makeArr).push({callback:n,options:r,modifiers:o})}}}static#O(t){let e=null,i=0;for(let n of t.split("+")){n=n.trim();if(!n)continue;const r=n.toUpperCase(),s=KeyboardManager[r];if(s)i|=s;else{if(null!==e){warn(`KeyboardManager: multiple keys in shortcut "${t}"`);break}e="SPACE"===r?" ":n}}null===e&&warn(`KeyboardManager: no key found in shortcut "${t}"`);return[e,i]}static#R(t){const e=/^(?:Key([A-Z])|(?:Digit|Numpad)(\d))$/.exec(t);return e?e[1]?.toLowerCase()??e[2]:null}exec(t,e){let i=this.callbacks.get(e.key);if(!i){if(/^[a-z]$/i.test(e.key))return;const t=KeyboardManager.#R(e.code);if(null===t||t===e.key)return;i=this.callbacks.get(t);if(!i)return}const n=(e.altKey?KeyboardManager.ALT:0)|(e.ctrlKey?KeyboardManager.CTRL:0)|(e.metaKey?KeyboardManager.META:0)|(e.shiftKey?KeyboardManager.SHIFT:0),r=i.find(t=>t.modifiers===n);if(!r)return;const{callback:s,options:{bubbles:a=!1,args:o=[],checker:l=null}}=r;if(!l||l(t,e)){s.bind(t,...o,e)();a||stopEvent(e)}}}class ColorManager{static _colorsMapping=new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]);get _colors(){const t=new Map([["CanvasText",null],["Canvas",null]]);!function getColorValues(t){const e=document.createElement("span");e.style.visibility="hidden";e.style.colorScheme="only light";document.body.append(e);for(const i of t.keys()){e.style.color=i;const n=window.getComputedStyle(e).color;t.set(i,getRGB(n))}e.remove()}(t);return util_shadow(this,"_colors",t)}convert(t){const e=getRGB(t);if(!window.matchMedia("(forced-colors: active)").matches)return e;for(const[t,i]of this._colors)if(i.every((t,i)=>t===e[i]))return ColorManager._colorsMapping.get(t);return e}getHexCode(t){const e=this._colors.get(t);return e?Util.makeHexColor(...e):t}}class AnnotationEditorUIManager{#B=new AbortController;#L=null;#N=null;#U=new Map;#H=new Map;#z=null;#G=null;#W=null;#j=null;#V=null;#q=new CommandManager;#$=null;#X=null;#K=null;#Y=0;#J=new Set;#Q=null;#Z=null;#tt=new Set;_editorUndoBar=null;#et=!1;#it=!1;#nt=!1;#rt=null;#st=null;#at=null;#ot=null;#lt=!1;#ct=null;#ht=new IdManager;#dt=!1;#ut=!1;#pt=!1;#gt=null;#mt=null;#ft=null;#bt=null;#yt=null;#wt=ki.NONE;#vt=new Set;#_t=null;#At=null;#xt=null;#Ct=null;#Et=null;#St={isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1,hasSelectedText:!1};#Tt=[0,0];#kt=null;#Pt=null;#Mt=null;#Dt=null;#It=null;static TRANSLATE_SMALL=1;static TRANSLATE_BIG=10;static get _keyboardManager(){const t=AnnotationEditorUIManager.prototype,arrowChecker=t=>t.#Pt.contains(document.activeElement)&&"BUTTON"!==document.activeElement.tagName&&t.hasSomethingToControl(),textInputChecker=(t,{target:e})=>{if(e instanceof HTMLInputElement){const{type:t}=e;return"text"!==t&&"number"!==t}return!0},e=this.TRANSLATE_SMALL,i=this.TRANSLATE_BIG;return util_shadow(this,"_keyboardManager",new KeyboardManager([[["ctrl+a","mac+meta+a"],t.selectAll,{checker:textInputChecker}],[["ctrl+z","mac+meta+z"],t.undo,{checker:textInputChecker}],[["ctrl+y","ctrl+shift+z","mac+meta+shift+z","ctrl+shift+Z","mac+meta+shift+Z"],t.redo,{checker:textInputChecker}],[["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:textInputChecker}],[["Enter"],t.addNewEditorFromKeyboard,{checker:(t,{target:e})=>!(e instanceof HTMLButtonElement)&&t.#Pt.contains(e)&&!t.isEnterHandled}],[["Space"],t.addNewEditorFromKeyboard,{checker:(t,{target:e})=>!(e instanceof HTMLButtonElement)&&t.#Pt.contains(document.activeElement)}],[["Escape"],t.unselectAll],[["ArrowLeft"],t.translateSelectedEditors,{args:[-e,0],checker:arrowChecker}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t.translateSelectedEditors,{args:[-i,0],checker:arrowChecker}],[["ArrowRight"],t.translateSelectedEditors,{args:[e,0],checker:arrowChecker}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t.translateSelectedEditors,{args:[i,0],checker:arrowChecker}],[["ArrowUp"],t.translateSelectedEditors,{args:[0,-e],checker:arrowChecker}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t.translateSelectedEditors,{args:[0,-i],checker:arrowChecker}],[["ArrowDown"],t.translateSelectedEditors,{args:[0,e],checker:arrowChecker}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t.translateSelectedEditors,{args:[0,i],checker:arrowChecker}]]))}constructor(t,e,i,n,r,s,a,o,l,c,h,d,u,p,g,m,f){const b=this._signal=this.#B.signal;this.#Pt=t;this.#Mt=e;this.#Dt=i;this.#W=n;this.#$=r;this.#At=s;this.#Et=o;this._eventBus=a;const y={signal:b,...on};a.on("editingaction",this.onEditingAction.bind(this),y);a.on("pagechanging",this.onPageChanging.bind(this),y);a.on("scalechanging",this.onScaleChanging.bind(this),y);a.on("rotationchanging",this.onRotationChanging.bind(this),y);a.on("setpreference",this.onSetPreference.bind(this),y);a.on("switchannotationeditorparams",t=>this.updateParams(t.type,t.value),y);window.addEventListener("pointerdown",()=>{this.#ut=!0},{capture:!0,signal:b});window.addEventListener("pointerup",()=>{this.#ut=!1},{capture:!0,signal:b});window.addEventListener("beforeunload",this.endCurrentEditing.bind(this),{capture:!0,signal:b});this.#Ft();this.#Ot();this.#Rt();this.#j=o.annotationStorage;this.#rt=o.filterFactory;this.#xt=l;this.#ot=c||null;this.#et=h;this.#it=d;this.#nt=u;this.#yt=p||null;this.viewParameters={realScale:PixelsPerInch.PDF_TO_CSS_UNITS,rotation:0};this.isShiftKeyDown=!1;this._editorUndoBar=g||null;this._supportsPinchToZoom=!1!==m;this._keepToolbarInPage=!0===f;r?.setSidebarUiManager(this)}destroy(){this.#It?.resolve();this.#It=null;this.#B?.abort();this.#B=null;this._signal=null;for(const t of this.#H.values())t.destroy();this.#H.clear();this.#U.clear();this.#tt.clear();this.#bt?.clear();this.#L=null;this.#vt.clear();this.#q.destroy();this.#W?.destroy();this.#$?.destroy();this.#At?.destroy();this.#ct?.hide();this.#ct=null;this.#ft?.destroy();this.#ft=null;this.#N=null;if(this.#st){clearTimeout(this.#st);this.#st=null}if(this.#kt){clearTimeout(this.#kt);this.#kt=null}this._editorUndoBar?.destroy();this.#Et=null}combinedSignal(t){return AbortSignal.any([this._signal,t.signal])}get mlManager(){return this.#yt}get useNewAltTextFlow(){return this.#it}get useNewAltTextWhenAddingImage(){return this.#nt}get hcmFilter(){return util_shadow(this,"hcmFilter",this.#xt?this.#rt.addHCMFilter(this.#xt.foreground,this.#xt.background):"none")}get direction(){return util_shadow(this,"direction",getComputedStyle(this.#Pt).direction)}get _highlightColors(){return util_shadow(this,"_highlightColors",this.#ot?new Map(this.#ot.split(",").map(t=>{(t=t.split("=").map(t=>t.trim()))[1]=t[1].toUpperCase();return t})):null)}get highlightColors(){const{_highlightColors:t}=this;if(!t)return util_shadow(this,"highlightColors",null);const e=new Map,i=!!this.#xt;for(const[n,r]of t){const t=n.endsWith("_HCM");i&&t?e.set(n.replace("_HCM",""),r):i||t||e.set(n,r)}return util_shadow(this,"highlightColors",e)}get highlightColorNames(){return util_shadow(this,"highlightColorNames",this.highlightColors?new Map(Array.from(this.highlightColors,t=>t.reverse())):null)}getNonHCMColor(t){if(!this._highlightColors)return t;const e=this.highlightColorNames.get(t);return this._highlightColors.get(e)||t}getNonHCMColorName(t){return this.highlightColorNames.get(t)||t}setCurrentDrawingSession(t){if(t){this.unselectAll();this.disableUserSelect(!0)}else this.disableUserSelect(!1);this.#K=t}setMainHighlightColorPicker(t){this.#ft=t}editAltText(t,e=!1){this.#W?.editAltText(this,t,e)}hasCommentManager(){return!!this.#$}editComment(t,e,i,n){this.#$?.showDialog(this,t,e,i,n)}selectComment(t,e){const i=this.#H.get(t),n=i?.getEditorByUID(e);n?.toggleComment(!0,!0)}updateComment(t){this.#$?.updateComment(t.getData())}updatePopupColor(t){this.#$?.updatePopupColor(t)}removeComment(t){this.#$?.removeComments([t.uid])}deleteComment(t,e){const undo=()=>{t.comment=e};this.addCommands({cmd:()=>{this._editorUndoBar?.show(undo,"comment");this.toggleComment(null);t.comment=null},undo,mustExec:!0})}toggleComment(t,e,i=void 0){this.#$?.toggleCommentPopup(t,e,i)}makeCommentColor(t,e){return t&&this.#$?.makeCommentColor(t,e)||null}getCommentDialogElement(){return this.#$?.dialogElement||null}async waitForEditorsRendered(t){if(this.#H.has(t-1))return;const{resolve:e,promise:i}=Promise.withResolvers(),onEditorsRendered=i=>{if(i.pageNumber===t){this._eventBus.off("editorsrendered",onEditorsRendered);e()}};this._eventBus.on("editorsrendered",onEditorsRendered,on);await i}getSignature(t){this.#At?.getSignature({uiManager:this,editor:t})}get signatureManager(){return this.#At}switchToMode(t,e){this._eventBus.on("annotationeditormodechanged",e,{once:!0,signal:this._signal,...on});this._eventBus.dispatch("showannotationeditorui",{source:this,mode:t})}setPreference(t,e){this._eventBus.dispatch("setpreference",{source:this,name:t,value:e})}onSetPreference({name:t,value:e}){if("enableNewAltTextWhenAddingImage"===t)this.#nt=e}onPageChanging({pageNumber:t}){this.#Y=t-1}deletePage(t){for(const e of this.getEditors(t))e.remove();this.#H.delete(t);this.#Y===t&&(this.#Y=0)}focusMainContainer(){this.#Pt.focus()}findParent(t,e){for(const i of this.#H.values()){const{x:n,y:r,width:s,height:a}=i.div.getBoundingClientRect();if(t>=n&&t<=n+s&&e>=r&&e<=r+a)return i}return null}disableUserSelect(t=!1){this.#Mt.classList.toggle("noUserSelect",t)}addShouldRescale(t){this.#tt.add(t)}removeShouldRescale(t){this.#tt.delete(t)}onScaleChanging({scale:t}){this.commitOrRemove();this.viewParameters.realScale=t*PixelsPerInch.PDF_TO_CSS_UNITS;for(const t of this.#tt)t.onScaleChanging();this.#K?.onScaleChanging()}onRotationChanging({pagesRotation:t}){this.commitOrRemove();this.viewParameters.rotation=t}#Bt({anchorNode:t}){return t.nodeType===Node.TEXT_NODE?t.parentElement:t}#Lt(t){const{currentLayer:e}=this;if(e.hasTextLayer(t))return e;for(const e of this.#H.values())if(e.hasTextLayer(t))return e;return null}highlightSelection(t="",e=!1){const i=document.getSelection();if(!i||i.isCollapsed)return;const{anchorNode:n,anchorOffset:r,focusNode:s,focusOffset:a}=i,o=i.toString(),l=this.#Bt(i).closest(".textLayer"),c=this.getSelectionBoxes(l);if(!c)return;i.empty();const h=this.#Lt(l),d=this.#wt===ki.NONE,callback=()=>{const i=h?.createAndAddNewEditor({x:0,y:0},!1,{methodOfCreation:t,boxes:c,anchorNode:n,anchorOffset:r,focusNode:s,focusOffset:a,text:o});d&&this.showAllEditors("highlight",!0,!0);e&&i?.editComment()};d?this.switchToMode(ki.HIGHLIGHT,callback):callback()}commentSelection(t=""){this.highlightSelection(t,!0)}endCurrentEditing(){this.commitOrRemove();this.currentLayer?.endDrawingSession(!1)}#Nt(){const t=document.getSelection();if(!t||t.isCollapsed)return;const e=this.#Bt(t).closest(".textLayer"),i=this.getSelectionBoxes(e);if(i){this.#ct||=new FloatingToolbar(this);this.#ct.show(e,i,"ltr"===this.direction)}}getAndRemoveDataFromAnnotationStorage(t){if(!this.#j)return null;const e=`${Ti}${t}`,i=this.#j.getRawValue(e);i&&this.#j.remove(e);return i}addToAnnotationStorage(t){t.isEmpty()||!this.#j||this.#j.has(t.id)||this.#j.setValue(t.id,t)}a11yAlert(t,e=null){const i=this.#Dt;if(i){i.setAttribute("data-l10n-id",t);e?i.setAttribute("data-l10n-args",JSON.stringify(e)):i.removeAttribute("data-l10n-args")}}#Ut(){const t=document.getSelection();if(!t||t.isCollapsed){if(this.#_t){this.#ct?.hide();this.#_t=null;this.#Ht({hasSelectedText:!1})}return}const{anchorNode:e}=t;if(e===this.#_t)return;const i=this.#Bt(t).closest(".textLayer");if(i){this.#ct?.hide();this.#_t=e;this.#Ht({hasSelectedText:!0});if(this.#wt===ki.HIGHLIGHT||this.#wt===ki.NONE){this.#wt===ki.HIGHLIGHT&&this.showAllEditors("highlight",!0,!0);this.#lt=this.isShiftKeyDown;if(!this.isShiftKeyDown){const t=this.#wt===ki.HIGHLIGHT?this.#Lt(i):null;t?.toggleDrawing();if(this.#ut){const e=new AbortController,i=this.combinedSignal(e),pointerup=i=>{if("pointerup"!==i.type||0===i.button){e.abort();t?.toggleDrawing(!0);"pointerup"===i.type&&this.#zt("main_toolbar")}};window.addEventListener("pointerup",pointerup,{signal:i});window.addEventListener("blur",pointerup,{signal:i})}else{t?.toggleDrawing(!0);this.#zt("main_toolbar")}}}}else if(this.#_t){this.#ct?.hide();this.#_t=null;this.#Ht({hasSelectedText:!1})}}#zt(t=""){this.#wt===ki.HIGHLIGHT?this.highlightSelection(t):this.#et&&this.#Nt()}#Ft(){document.addEventListener("selectionchange",this.#Ut.bind(this),{signal:this._signal})}#Gt(){if(this.#at)return;this.#at=new AbortController;const t=this.combinedSignal(this.#at);window.addEventListener("focus",this.focus.bind(this),{signal:t});window.addEventListener("blur",this.blur.bind(this),{signal:t})}#Wt(){this.#at?.abort();this.#at=null}blur(){this.isShiftKeyDown=!1;if(this.#lt){this.#lt=!1;this.#zt("main_toolbar")}if(!this.hasSelection)return;const{activeElement:t}=document;for(const e of this.#vt)if(e.div.contains(t)){this.#mt=[e,t];e._focusEventsAllowed=!1;break}}focus(){if(!this.#mt)return;const[t,e]=this.#mt;this.#mt=null;e.addEventListener("focusin",()=>{t._focusEventsAllowed=!0},{once:!0,signal:this._signal});e.focus()}#Rt(){if(this.#gt)return;this.#gt=new AbortController;const t=this.combinedSignal(this.#gt);window.addEventListener("keydown",this.keydown.bind(this),{signal:t});window.addEventListener("keyup",this.keyup.bind(this),{signal:t})}#jt(){this.#gt?.abort();this.#gt=null}#Vt(){if(this.#X)return;this.#X=new AbortController;const t=this.combinedSignal(this.#X);document.addEventListener("copy",this.copy.bind(this),{signal:t});document.addEventListener("cut",this.cut.bind(this),{signal:t});document.addEventListener("paste",this.paste.bind(this),{signal:t})}#qt(){this.#X?.abort();this.#X=null}#Ot(){const t=this._signal;document.addEventListener("dragover",this.dragOver.bind(this),{signal:t});document.addEventListener("drop",this.drop.bind(this),{signal:t})}addEditListeners(){this.#Rt();this.setEditingState(!0)}removeEditListeners(){this.#jt();this.setEditingState(!1)}dragOver(t){for(const{type:e}of t.dataTransfer.items)for(const i of this.#Z)if(i.isHandlingMimeForPasting(e)){t.dataTransfer.dropEffect="copy";t.preventDefault();return}}drop(t){for(const e of t.dataTransfer.items)for(const i of this.#Z)if(i.isHandlingMimeForPasting(e.type)){i.paste(e,this.currentLayer);t.preventDefault();return}}copy(t){t.preventDefault();this.#L?.commitOrRemove();if(!this.hasSelection)return;const e=[];for(const t of this.#vt){const i=t.serialize(!0);i&&e.push(i)}0!==e.length&&t.clipboardData.setData("application/pdfjs",JSON.stringify(e))}cut(t){this.copy(t);this.delete()}async paste(t){t.preventDefault();const{clipboardData:e}=t;for(const t of e.items)for(const e of this.#Z)if(e.isHandlingMimeForPasting(t.type)){e.paste(t,this.currentLayer);return}let i=e.getData("application/pdfjs");if(!i)return;try{i=JSON.parse(i)}catch(t){warn(`paste: "${t.message}".`);return}if(!Array.isArray(i))return;this.unselectAll();const n=this.currentLayer;try{const t=[];for(const e of i){const i=await n.deserialize(e);if(!i)return;t.push(i)}const cmd=()=>{for(const e of t)this.#$t(e);this.#Xt(t)},undo=()=>{for(const e of t)e.remove()};this.addCommands({cmd,undo,mustExec:!0})}catch(t){warn(`paste: "${t.message}".`)}}keydown(t){this.isShiftKeyDown||"Shift"!==t.key||(this.isShiftKeyDown=!0);this.#wt===ki.NONE||this.isEditorHandlingKeyboard||AnnotationEditorUIManager._keyboardManager.exec(this,t)}keyup(t){if(this.isShiftKeyDown&&"Shift"===t.key){this.isShiftKeyDown=!1;if(this.#lt){this.#lt=!1;this.#zt("main_toolbar")}}}onEditingAction({name:t}){switch(t){case"undo":case"redo":case"delete":case"selectAll":this[t]();break;case"highlightSelection":this.highlightSelection("context_menu");break;case"commentSelection":this.commentSelection("context_menu")}}updatePageIndex(t,e){for(const i of this.#G.get(t)||[])i.pageIndex=e;const i=this.#z.get(t);if(i){i.pageIndex=e;this.#H.set(e,i);this.#dt?i.enable():i.disable()}}startUpdatePages(){this.#z=new Map(this.#H);this.#H.clear();const t=this.#G=new Map,saveEditor=e=>{t.getOrInsertComputed(e.pageIndex,makeArr).push(e)};for(const t of this.#U.values())saveEditor(t);for(const[t,e]of this.#j)t.startsWith(Ti)&&!this.#U.has(t)&&Number.isInteger(e?.pageIndex)&&saveEditor(e)}endUpdatePages(){this.#z=null;this.#G=null}clonePage(t,e){for(const i of this.getEditors(t)){const t=i.serialize(i.mode!==ki.HIGHLIGHT);if(t){t.pageIndex=e;t.id=this.getId();t.isClone=!0;delete t.popupRef;this.#j.setValue(t.id,t)}}}findClonesForPage(t){const e=[],{pageIndex:i}=t;for(const[n,r]of this.#j)if(r.pageIndex===i&&r.isClone){this.#j.remove(n);e.push(t.deserialize(r).then(e=>{if(e){e.isClone=!0;t.addOrRebuild(e)}}))}return Promise.all(e)}#Ht(t){if(Object.entries(t).some(([t,e])=>this.#St[t]!==e)){this._eventBus.dispatch("editingstateschanged",{source:this,details:Object.assign(this.#St,t)});this.#wt===ki.HIGHLIGHT&&!1===t.hasSelectedEditor&&this.#Kt([[Pi.HIGHLIGHT_FREE,!0]])}}#Kt(t){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:t})}setEditingState(t){if(t){this.#Gt();this.#Vt();this.#Ht({isEditing:this.#wt!==ki.NONE,isEmpty:this.#Yt(),hasSomethingToUndo:this.#q.hasSomethingToUndo(),hasSomethingToRedo:this.#q.hasSomethingToRedo(),hasSelectedEditor:!1})}else{this.#Wt();this.#qt();this.#Ht({isEditing:!1});this.disableUserSelect(!1)}}registerEditorTypes(t){if(!this.#Z){this.#Z=t;for(const t of this.#Z)this.#Kt(t.defaultPropertiesToUpdate)}}getId(){return this.#ht.id}get currentLayer(){return this.#H.get(this.#Y)}getLayer(t){return this.#H.get(t)}get currentPageIndex(){return this.#Y}addLayer(t){this.#H.set(t.pageIndex,t);this.#dt?t.enable():t.disable()}removeLayer(t){this.#H.delete(t.pageIndex)}async updateMode(t,e=null,i=!1,n=!1,r=!1,s=!1){if(this.#wt!==t){if(this.#It){await this.#It.promise;if(!this.#It)return}this.#It=Promise.withResolvers();this.#K?.commitOrRemove();this.#wt===ki.POPUP&&this.#$?.hideSidebar();this.#$?.destroyPopup();this.#wt=t;if(t!==ki.NONE){for(const t of this.#U.values())t.addStandaloneCommentButton();t===ki.SIGNATURE&&await(this.#At?.loadSignatures());i&&CurrentPointers.clearPointerType();this.setEditingState(!0);await this.#Jt();this.unselectAll();for(const e of this.#H.values())e.updateMode(t);if(t===ki.POPUP){this.#N||=await this.#Et.getAnnotationsByType(new Set(this.#Z.map(t=>t._editorType)));const t=new Set,e=[];for(const i of this.#U.values()){const{annotationElementId:n,hasComment:r,deleted:s}=i;n&&t.add(n);r&&!s&&e.push(i.getData())}for(const i of this.#N){const{id:n,popupRef:r,contentsObj:s}=i;r&&s?.str&&!t.has(n)&&!this.#J.has(n)&&e.push(i)}this.#$?.showSidebar(e)}if(e){for(const t of this.#U.values())if(t.uid===e){this.setSelected(t);s?t.editComment():r?t.enterInEditMode():t.focus()}else t.unselect();this.#It.resolve()}else{n&&this.addNewEditorFromKeyboard();this.#It.resolve()}}else{this.setEditingState(!1);this.#Qt();for(const t of this.#U.values())t.hideStandaloneCommentButton();this._editorUndoBar?.hide();this.toggleComment(null);this.#It.resolve()}}}addNewEditorFromKeyboard(){this.currentLayer.canCreateNewEmptyEditor()&&this.currentLayer.addNewEditor()}updateToolbar(t){t.mode!==this.#wt&&this._eventBus.dispatch("switchannotationeditormode",{source:this,...t})}updateParams(t,e){if(this.#Z){switch(t){case Pi.CREATE:this.currentLayer.addNewEditor(e);return;case Pi.HIGHLIGHT_SHOW_ALL:this._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:{type:"highlight",action:"toggle_visibility"}}});(this.#Ct||=new Map).set(t,e);this.showAllEditors("highlight",e)}if(this.hasSelection)for(const i of this.#vt)i.updateParams(t,e);else for(const i of this.#Z)i.updateDefaultParams(t,e)}}showAllEditors(t,e,i=!1){for(const i of this.#U.values())i.editorType===t&&i.show(e);(this.#Ct?.get(Pi.HIGHLIGHT_SHOW_ALL)??!0)!==e&&this.#Kt([[Pi.HIGHLIGHT_SHOW_ALL,e]])}enableWaiting(t=!1){if(this.#pt!==t){this.#pt=t;for(const e of this.#H.values()){t?e.disableClick():e.enableClick();e.div.classList.toggle("waiting",t)}}}async#Jt(){if(!this.#dt){this.#dt=!0;const t=[];for(const e of this.#H.values())t.push(e.enable());await Promise.all(t);for(const t of this.#U.values())t.enable()}}#Qt(){this.unselectAll();if(this.#dt){this.#dt=!1;for(const t of this.#H.values())t.disable();for(const t of this.#U.values())t.disable()}}*getEditors(t){for(const e of this.#U.values())e.pageIndex===t&&(yield e)}getEditor(t){return this.#U.get(t)}addEditor(t){this.#U.set(t.id,t)}removeEditor(t){if(t.div.contains(document.activeElement)){this.#st&&clearTimeout(this.#st);this.#st=setTimeout(()=>{this.focusMainContainer();this.#st=null},0)}this.#U.delete(t.id);t.annotationElementId&&this.#bt?.delete(t.annotationElementId);this.unselect(t);t.annotationElementId&&this.#J.has(t.annotationElementId)||this.#j?.remove(t.id)}addDeletedAnnotationElement(t){this.#J.add(t.annotationElementId);this.addChangedExistingAnnotation(t);t.deleted=!0}isDeletedAnnotationElement(t){return this.#J.has(t)}removeDeletedAnnotationElement(t){this.#J.delete(t.annotationElementId);this.removeChangedExistingAnnotation(t);t.deleted=!1}#$t(t){const e=this.#H.get(t.pageIndex);if(e)e.addOrRebuild(t);else{this.addEditor(t);this.addToAnnotationStorage(t)}}setActiveEditor(t){if(this.#L!==t){this.#L=t;t&&this.#Kt(t.propertiesToUpdate)}}get#Zt(){let t=null;for(t of this.#vt);return t}updateUI(t){this.#Zt===t&&this.#Kt(t.propertiesToUpdate)}updateUIForDefaultProperties(t){this.#Kt(t.defaultPropertiesToUpdate)}toggleSelected(t){if(this.#vt.has(t)){this.#vt.delete(t);t.unselect();this.#Ht({hasSelectedEditor:this.hasSelection})}else{this.#vt.add(t);t.select();this.#Kt(t.propertiesToUpdate);this.#Ht({hasSelectedEditor:!0})}}setSelected(t){this.updateToolbar({mode:t.mode,editId:t.uid});this.#K?.commitOrRemove();for(const e of this.#vt)e!==t&&e.unselect();this.#$?.destroyPopup();this.#vt.clear();this.#vt.add(t);t.select();this.#Kt(t.propertiesToUpdate);this.#Ht({hasSelectedEditor:!0})}get firstSelectedEditor(){return this.#vt.values().next().value}unselect(t){t.unselect();this.#vt.delete(t);this.#Ht({hasSelectedEditor:this.hasSelection})}get hasSelection(){return 0!==this.#vt.size}get isEnterHandled(){return 1===this.#vt.size&&this.firstSelectedEditor.isEnterHandled}undo(){this.#q.undo();this.#Ht({hasSomethingToUndo:this.#q.hasSomethingToUndo(),hasSomethingToRedo:this.#q.hasSomethingToRedo(),isEmpty:this.#Yt()});this._editorUndoBar?.hide()}redo(){this.#q.redo();this.#Ht({hasSomethingToUndo:this.#q.hasSomethingToUndo(),hasSomethingToRedo:this.#q.hasSomethingToRedo(),isEmpty:this.#Yt()})}addCommands(t){this.#q.add(t);this.#Ht({hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:this.#Yt()})}cleanUndoStack(t){this.#q.cleanType(t)}#Yt(){if(0===this.#U.size)return!0;if(1===this.#U.size)for(const t of this.#U.values())return t.isEmpty();return!1}delete(){this.commitOrRemove();const t=this.currentLayer?.endDrawingSession(!0);if(!this.hasSelection&&!t)return;const e=t?[t]:[...this.#vt],undo=()=>{for(const t of e)this.#$t(t)};this.addCommands({cmd:()=>{this._editorUndoBar?.show(undo,1===e.length?e[0].editorType:e.length);for(const t of e)t.remove()},undo,mustExec:!0})}commitOrRemove(){this.#L?.commitOrRemove()}hasSomethingToControl(){return this.#L||this.hasSelection}#Xt(t){for(const t of this.#vt)t.unselect();this.#vt.clear();for(const e of t)if(!e.isEmpty()){this.#vt.add(e);e.select()}this.#Ht({hasSelectedEditor:this.hasSelection})}selectAll(){for(const t of this.#vt)t.commit();this.#Xt(this.#U.values())}unselectAll(){if(this.#L){this.#L.commitOrRemove();if(this.#wt!==ki.NONE)return}if(!this.#K?.commitOrRemove()){this.#$?.destroyPopup();if(this.hasSelection){for(const t of this.#vt)t.unselect();this.#vt.clear();this.#Ht({hasSelectedEditor:!1})}}}translateSelectedEditors(t,e,i=!1){i||this.commitOrRemove();if(!this.hasSelection)return;this.#Tt[0]+=t;this.#Tt[1]+=e;const[n,r]=this.#Tt,s=[...this.#vt];this.#kt&&clearTimeout(this.#kt);this.#kt=setTimeout(()=>{this.#kt=null;this.#Tt[0]=this.#Tt[1]=0;this.addCommands({cmd:()=>{for(const t of s)if(this.#U.has(t.id)){t.translateInPage(n,r);t.translationDone()}},undo:()=>{for(const t of s)if(this.#U.has(t.id)){t.translateInPage(-n,-r);t.translationDone()}},mustExec:!1})},1e3);for(const i of s){i.translateInPage(t,e);i.translationDone()}}setUpDragSession(){if(this.hasSelection){this.disableUserSelect(!0);this.#Q=new Map;for(const t of this.#vt)this.#Q.set(t,{savedX:t.x,savedY:t.y,savedPageIndex:t.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!this.#Q)return!1;this.disableUserSelect(!1);const t=this.#Q;this.#Q=null;let e=!1;for(const[{x:i,y:n,pageIndex:r},s]of t){s.newX=i;s.newY=n;s.newPageIndex=r;e||=i!==s.savedX||n!==s.savedY||r!==s.savedPageIndex}if(!e)return!1;const move=(t,e,i,n)=>{if(this.#U.has(t.id)){const r=this.#H.get(n);if(r)t._setParentAndPosition(r,e,i);else{t.pageIndex=n;t.x=e;t.y=i}}};this.addCommands({cmd:()=>{for(const[e,{newX:i,newY:n,newPageIndex:r}]of t)move(e,i,n,r)},undo:()=>{for(const[e,{savedX:i,savedY:n,savedPageIndex:r}]of t)move(e,i,n,r)},mustExec:!0});return!0}dragSelectedEditors(t,e){if(this.#Q)for(const i of this.#Q.keys())i.drag(t,e)}rebuild(t){if(null===t.parent){const e=this.getLayer(t.pageIndex);if(e){e.changeParent(t);e.addOrRebuild(t)}else{this.addEditor(t);this.addToAnnotationStorage(t);t.rebuild()}}else t.parent.addOrRebuild(t)}get isEditorHandlingKeyboard(){return this.getActive()?.shouldGetKeyboardEvents()||1===this.#vt.size&&this.firstSelectedEditor.shouldGetKeyboardEvents()}isActive(t){return this.#L===t}getActive(){return this.#L}getMode(){return this.#wt}isEditingMode(){return this.#wt!==ki.NONE}get imageManager(){return util_shadow(this,"imageManager",new ImageManager)}getSelectionBoxes(t){if(!t)return null;const e=document.getSelection();for(let i=0,n=e.rangeCount;i({x:(e-n)/s,y:1-(t+a-i)/r,width:o/s,height:a/r});break;case"180":a=(t,e,a,o)=>({x:1-(t+a-i)/r,y:1-(e+o-n)/s,width:a/r,height:o/s});break;case"270":a=(t,e,a,o)=>({x:1-(e+o-n)/s,y:(t-i)/r,width:o/s,height:a/r});break;default:a=(t,e,a,o)=>({x:(t-i)/r,y:(e-n)/s,width:a/r,height:o/s})}const o=[];for(let t=0,i=e.rangeCount;tt.stopPropagation(),{signal:i});const onClick=t=>{t.preventDefault();this.#a._uiManager.editAltText(this.#a);this.#ce&&this.#a._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_clicked",data:{label:this.#de}})};t.addEventListener("click",onClick,{capture:!0,signal:i});t.addEventListener("keydown",e=>{if(e.target===t&&"Enter"===e.key){this.#se=!0;onClick(e)}},{signal:i});await this.#ue();return t}get#de(){return(this.#l?"added":null===this.#l&&this.guessedText&&"review")||"missing"}finish(){if(this.#ee){this.#ee.focus({focusVisible:this.#se});this.#se=!1}}isEmpty(){return this.#ce?null===this.#l:!this.#l&&!this.#te}hasData(){return this.#ce?null!==this.#l||!!this.#oe:this.isEmpty()}get guessedText(){return this.#oe}async setGuessedText(t){if(null===this.#l){this.#oe=t;this.#le=await AltText._l10n.get("pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer",{generatedAltText:t});this.#ue()}}toggleAltTextBadge(t=!1){if(this.#ce&&!this.#l){if(!this.#ae){const t=this.#ae=document.createElement("div");t.className="noAltTextBadge";this.#a.div.append(t)}this.#ae.classList.toggle("hidden",!t)}else{this.#ae?.remove();this.#ae=null}}serialize(t){let e=this.#l;t||this.#oe!==e||(e=this.#le);return{altText:e,decorative:this.#te,guessedText:this.#oe,textWithDisclaimer:this.#le}}get data(){return{altText:this.#l,decorative:this.#te}}set data({altText:t,decorative:e,guessedText:i,textWithDisclaimer:n,cancel:r=!1}){if(i){this.#oe=i;this.#le=n}if(this.#l!==t||this.#te!==e){if(!r){this.#l=t;this.#te=e}this.#ue()}}toggle(t=!1){if(this.#ee){if(!t&&this.#re){clearTimeout(this.#re);this.#re=null}this.#ee.disabled=!t}}shown(){this.#a._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_displayed",data:{label:this.#de}})}destroy(){this.#ee?.remove();this.#ee=null;this.#ie=null;this.#ne=null;this.#ae?.remove();this.#ae=null}async#ue(){const t=this.#ee;if(!t)return;if(this.#ce){t.classList.toggle("done",!!this.#l);t.setAttribute("data-l10n-id",AltText.#he[this.#de]);this.#ie?.setAttribute("data-l10n-id",AltText.#he[`${this.#de}-label`]);if(!this.#l){this.#ne?.remove();return}}else{if(!this.#l&&!this.#te){t.classList.remove("done");this.#ne?.remove();return}t.classList.add("done");t.setAttribute("data-l10n-id","pdfjs-editor-alt-text-edit-button")}let e=this.#ne;if(!e){this.#ne=e=document.createElement("span");e.className="tooltip";e.setAttribute("role","tooltip");e.id=`alt-text-tooltip-${this.#a.id}`;const i=100,n=this.#a._uiManager._signal;n.addEventListener("abort",()=>{clearTimeout(this.#re);this.#re=null},{once:!0});t.addEventListener("mouseenter",()=>{this.#re=setTimeout(()=>{this.#re=null;this.#ne.classList.add("show");this.#a._reportTelemetry({action:"alt_text_tooltip"})},i)},{signal:n});t.addEventListener("mouseleave",()=>{if(this.#re){clearTimeout(this.#re);this.#re=null}this.#ne?.classList.remove("show")},{signal:n})}if(this.#te)e.setAttribute("data-l10n-id","pdfjs-editor-alt-text-decorative-tooltip");else{e.removeAttribute("data-l10n-id");e.textContent=this.#l}e.parentNode||t.append(e);const i=this.#a.getElementForAltText();i?.setAttribute("aria-describedby",e.id)}}class Comment{#pe=null;#ge=null;#me=!1;#a=null;#fe=null;#be=null;#ye=null;#we=null;#ve=!1;#_e=null;constructor(t){this.#a=t}renderForToolbar(){const t=this.#ge=document.createElement("button");t.className="comment";return this.#w(t,!1)}renderForStandalone(){const t=this.#pe=document.createElement("button");t.className="annotationCommentButton";const e=this.#a.commentButtonPosition;if(e){const{style:i}=t;i.insetInlineEnd=`calc(${100*("ltr"===this.#a._uiManager.direction?1-e[0]:e[0])}% - var(--comment-button-dim))`;i.top=`calc(${100*e[1]}% - var(--comment-button-dim))`;const n=this.#a.commentButtonColor;n&&(i.backgroundColor=n)}return this.#w(t,!0)}focusButton(){setTimeout(()=>{(this.#pe??this.#ge)?.focus()},0)}onUpdatedColor(){if(!this.#pe)return;const t=this.#a.commentButtonColor;t&&(this.#pe.style.backgroundColor=t);this.#a._uiManager.updatePopupColor(this.#a)}get commentButtonWidth(){return(this.#pe?.getBoundingClientRect().width??0)/this.#a.parent.boundingClientRect.width}get commentPopupPositionInLayer(){if(this.#_e)return this.#_e;if(!this.#pe)return null;const{x:t,y:e,height:i}=this.#pe.getBoundingClientRect(),{x:n,y:r,width:s,height:a}=this.#a.parent.boundingClientRect;return[(t-n)/s,(e+i-r)/a]}set commentPopupPositionInLayer(t){this.#_e=t}hasDefaultPopupPosition(){return null===this.#_e}removeStandaloneCommentButton(){this.#pe?.remove();this.#pe=null}removeToolbarCommentButton(){this.#ge?.remove();this.#ge=null}setCommentButtonStates({selected:t,hasPopup:e}){if(this.#pe){this.#pe.classList.toggle("selected",t);this.#pe.ariaExpanded=e}}#w(t,e){if(!this.#a._uiManager.hasCommentManager())return null;t.tabIndex="0";t.ariaHasPopup="dialog";if(e){t.ariaControls="commentPopup";t.setAttribute("data-l10n-id","pdfjs-show-comment-button")}else{t.ariaControlsElements=[this.#a._uiManager.getCommentDialogElement()];t.setAttribute("data-l10n-id","pdfjs-editor-add-comment-button")}const i=this.#a._uiManager._signal;if(!(i instanceof AbortSignal)||i.aborted)return t;t.addEventListener("contextmenu",noContextMenu,{signal:i});if(e){t.addEventListener("focusin",t=>{this.#a._focusEventsAllowed=!1;stopEvent(t)},{capture:!0,signal:i});t.addEventListener("focusout",t=>{this.#a._focusEventsAllowed=!0;stopEvent(t)},{capture:!0,signal:i})}t.addEventListener("pointerdown",t=>t.stopPropagation(),{signal:i});const onClick=e=>{e.preventDefault();t===this.#ge?this.edit():this.#a.toggleComment(!0)};t.addEventListener("click",onClick,{capture:!0,signal:i});t.addEventListener("keydown",e=>{if(e.target===t&&"Enter"===e.key){this.#me=!0;onClick(e)}},{signal:i});t.addEventListener("pointerenter",()=>{this.#a.toggleComment(!1,!0)},{signal:i});t.addEventListener("pointerleave",()=>{this.#a.toggleComment(!1,!1)},{signal:i});return t}edit(t){const e=this.commentPopupPositionInLayer;let i,n;if(e)[i,n]=e;else{[i,n]=this.#a.commentButtonPosition;const{width:t,height:e,x:r,y:s}=this.#a;i=r+i*t;n=s+n*e}const r=this.#a.parent.boundingClientRect,{x:s,y:a,width:o,height:l}=r;this.#a._uiManager.editComment(this.#a,s+i*o,a+n*l,{...t,parentDimensions:r})}finish(){if(this.#ge){this.#ge.focus({focusVisible:this.#me});this.#me=!1}}isDeleted(){return this.#ve||""===this.#ye}isEmpty(){return null===this.#ye}hasBeenEdited(){return this.isDeleted()||this.#ye!==this.#fe}serialize(){return this.data}get data(){return{text:this.#ye,richText:this.#be,date:this.#we,deleted:this.isDeleted()}}set data(t){t!==this.#ye&&(this.#be=null);if(null!==t){this.#ye=t;this.#we=new Date;this.#ve=!1}else{this.#ye="";this.#ve=!0}}restoreData({text:t,richText:e,date:i}){this.#ye=t;this.#be=e;this.#we=i;this.#ve=!1}setInitialText(t,e=null){this.#fe=t;this.data=t;this.#we=null;this.#be=e}shown(){}destroy(){this.#ge?.remove();this.#ge=null;this.#pe?.remove();this.#pe=null;this.#ye="";this.#be=null;this.#we=null;this.#a=null;this.#me=!1;this.#ve=!1}}function preventDefault(t){t.preventDefault()}const ln=1e-4;function stopTouchEvent(t){if(t.cancelable){stopEvent(t);return!0}t.stopPropagation();return!1}class TouchManager{#Pt;#Ae=!1;#xe=null;#Ce;#Ee;#Se;#Te;#ke;#Pe=!1;#Me=null;#De;#Ie=new Set;#Fe=null;#Oe;#Re=null;#Be=0;constructor({container:t,isPinchingDisabled:e=null,isPinchingStopped:i=null,onPinchStart:n=null,onPinching:r=null,onPinchEnd:s=null,onPanning:a=null,signal:o}){this.#Pt=t;this.#xe=i;this.#Ce=e;this.#Ee=n;this.#Se=r;this.#Te=s;this.#ke=a;this.#Oe=new AbortController;this.#De=AbortSignal.any([o,this.#Oe.signal]);t.addEventListener("touchstart",this.#Le.bind(this),{passive:!1,signal:this.#De})}get MIN_TOUCH_DISTANCE_TO_PINCH(){return 35/OutputScale.pixelRatio}get MIN_TOUCH_DISTANCE_TO_SCALE(){return 4/OutputScale.pixelRatio}#Le(t){if(this.#Ce?.())return;this.#Ne(t);const e=this.#Ie;for(const{identifier:i}of t.changedTouches)e.add(i);if(1!==e.size){if(!this.#Re){this.#Re=new AbortController;const t=AbortSignal.any([this.#De,this.#Re.signal]),e=this.#Pt,i={signal:t,capture:!1,passive:!1};e.addEventListener("touchmove",this.#Ue.bind(this),i);const n=this.#He.bind(this);e.addEventListener("touchend",n,i);e.addEventListener("touchcancel",n,i);i.capture=!0;e.addEventListener("pointerdown",stopEvent,i);e.addEventListener("pointermove",stopEvent,i);e.addEventListener("pointercancel",preventDefault,i);e.addEventListener("pointerup",preventDefault,i);this.#Ee?.()}this.#Pe=stopTouchEvent(t);this.#ze(t)}else this.#Ge()}#Ge(){if(this.#Me)return;const t=this.#Me=new AbortController,e=AbortSignal.any([this.#De,t.signal]),i=this.#Pt,n={capture:!0,signal:e,passive:!1},cancelPointerDown=t=>{if("touch"===t.pointerType){this.#Me?.abort();this.#Me=null}};i.addEventListener("pointerdown",t=>{if("touch"===t.pointerType){stopEvent(t);cancelPointerDown(t)}},n);i.addEventListener("pointerup",cancelPointerDown,n);i.addEventListener("pointercancel",cancelPointerDown,n)}#Ne(t){const e=this.#Ie;if(0===e.size)return;const i=this.#Ie=new Set;for(const{identifier:n}of t.touches)e.has(n)&&i.add(n)}#We(t){const e=this.#Ie,i=[];for(const n of t.touches)e.has(n.identifier)&&i.push(n);return i}#ze(t){const e=this.#We(t);if(2!==e.length||this.#xe?.()){this.#Fe=null;return}const[i,n]=e;this.#Fe={touch0X:i.screenX,touch0Y:i.screenY,touch1X:n.screenX,touch1Y:n.screenY,panX:(i.clientX+n.clientX)/2,panY:(i.clientY+n.clientY)/2,screenPanX:(i.screenX+n.screenX)/2,screenPanY:(i.screenY+n.screenY)/2}}#Ue(t){if(!this.#Fe)return;const e=this.#We(t);if(2!==e.length)return;const i=this.#Pe;this.#Pe=stopTouchEvent(t);if(!this.#Pe)return;if(!i){this.#ze(t);return}const[n,r]=e,{screenX:s,screenY:a}=n,{screenX:o,screenY:l}=r,c=this.#Fe,{touch0X:h,touch0Y:d,touch1X:u,touch1Y:p,panX:g,panY:m}=c,f=u-h,b=p-d,y=o-s,w=l-a,v=(n.clientX+r.clientX)/2,_=(n.clientY+r.clientY)/2;c.panX=v;c.panY=_;const A=v-g,x=_-m,C=(s+o)/2,E=(a+l)/2,S=Math.hypot(C-c.screenPanX,E-c.screenPanY);c.screenPanX=C;c.screenPanY=E;const T=Math.hypot(y,w),k=Math.hypot(f,b),P=this.#Ae?this.MIN_TOUCH_DISTANCE_TO_SCALE:this.MIN_TOUCH_DISTANCE_TO_PINCH+2*S;if(T=2){this.#ze(t);return}const e=!!this.#Fe;this.#je();1===this.#Ie.size&&this.#Ge();e&&stopTouchEvent(t)}#je(){this.#Fe=null;this.#Ae=!1;this.#Be=0;this.#Pe=!1;if(this.#Re){this.#Re.abort();this.#Re=null;this.#Te?.()}}destroy(){this.#je();this.#Ie.clear();this.#Oe?.abort();this.#Oe=null;this.#Me?.abort();this.#Me=null}}class AnnotationEditor{#Ve=null;#qe=null;#l=null;#c=null;#pe=null;#$e=!1;#Xe=null;#Ke="";#Ye=null;#Je=null;#Qe=null;#Ze=null;#ti=null;#ei="";#ii=!1;#ni=null;#ri=!1;#si=!1;#ai=!1;#oi=null;#li=0;#ci=0;#hi=null;#di=null;isSelected=!1;_isCopy=!1;_editToolbar=null;_initialOptions=Object.create(null);_initialData=null;_isVisible=!0;_uiManager=null;_focusEventsAllowed=!0;static _l10n=null;static _l10nAlert=null;static _l10nResizer=null;#ui=!1;#pi=AnnotationEditor._zIndex++;static _borderLineWidth=-1;static _colorManager=new ColorManager;static _zIndex=1;static _telemetryTimeout=1e3;static get _resizerKeyboardManager(){const t=AnnotationEditor.prototype._resizeWithKeyboard,e=AnnotationEditorUIManager.TRANSLATE_SMALL,i=AnnotationEditorUIManager.TRANSLATE_BIG;return util_shadow(this,"_resizerKeyboardManager",new KeyboardManager([[["ArrowLeft"],t,{args:[-e,0]}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t,{args:[-i,0]}],[["ArrowRight"],t,{args:[e,0]}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t,{args:[i,0]}],[["ArrowUp"],t,{args:[0,-e]}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t,{args:[0,-i]}],[["ArrowDown"],t,{args:[0,e]}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t,{args:[0,i]}],[["Escape"],AnnotationEditor.prototype._stopResizingWithKeyboard]]))}constructor(t){this.parent=t.parent;this.id=t.id;this.width=this.height=null;this.pageIndex=t.parent.pageIndex;this.name=t.name;this.div=null;this._uiManager=t.uiManager;this.annotationElementId=null;this._willKeepAspectRatio=!1;this._initialOptions.isCentered=t.isCentered;this._structTreeParentId=null;this.annotationElementId=t.annotationElementId||null;this.creationDate=t.creationDate||new Date;this.modificationDate=t.modificationDate||null;this.canAddComment=!0;const{rotation:e,rawDims:{pageWidth:i,pageHeight:n,pageX:r,pageY:s}}=this.parent.viewport;this.rotation=e;this.pageRotation=(360+e-this._uiManager.viewParameters.rotation)%360;this.pageDimensions=[i,n];this.pageTranslation=[r,s];const[a,o]=this.parentDimensions;this.x=t.x/a;this.y=t.y/o;this.isAttachedToDOM=!1;this.deleted=!1}updatePageIndex(t){this.pageIndex=t}get editorType(){return Object.getPrototypeOf(this).constructor._type}get mode(){return Object.getPrototypeOf(this).constructor._editorType}static get isDrawer(){return!1}static get _defaultLineColor(){return util_shadow(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(t){const e=new FakeEditor({id:t._uiManager.getId(),parent:t.parent,uiManager:t._uiManager});e.annotationElementId=t.annotationElementId;e.deleted=!0;e._uiManager.addToAnnotationStorage(e)}static initialize(t,e){AnnotationEditor._l10n??=t;AnnotationEditor._l10nAlert??=Object.freeze({highlight:"pdfjs-editor-highlight-added-alert",freetext:"pdfjs-editor-freetext-added-alert",ink:"pdfjs-editor-ink-added-alert",stamp:"pdfjs-editor-stamp-added-alert",signature:"pdfjs-editor-signature-added-alert"});AnnotationEditor._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"});if(-1!==AnnotationEditor._borderLineWidth)return;const i=getComputedStyle(document.documentElement);AnnotationEditor._borderLineWidth=parseFloat(i.getPropertyValue("--outline-width"))||0}static updateDefaultParams(t,e){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(t){return!1}static paste(t,e){unreachable("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return this.#ui}set _isDraggable(t){this.#ui=t;this.div?.classList.toggle("draggable",t)}get uid(){return this.annotationElementId||this.id}get isEnterHandled(){return!0}center(){const[t,e]=this.pageDimensions;switch(this.parentRotation){case 90:this.x-=this.height*e/(2*t);this.y+=this.width*t/(2*e);break;case 180:this.x+=this.width/2;this.y+=this.height/2;break;case 270:this.x+=this.height*e/(2*t);this.y-=this.width*t/(2*e);break;default:this.x-=this.width/2;this.y-=this.height/2}this.fixAndSetPosition()}addCommands(t){this._uiManager.addCommands(t)}get currentLayer(){return this._uiManager.currentLayer}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=this.#pi}setParent(t){if(null!==t){this.pageIndex=t.pageIndex;this.pageDimensions=t.pageDimensions}else{this.#gi();this.#Ze?.remove();this.#Ze=null}this.parent=t}focusin(t){this._focusEventsAllowed&&(this.#ii?this.#ii=!1:this.parent.setSelected(this))}focusout(t){if(!this._focusEventsAllowed||!this.isAttachedToDOM)return;const e=t.relatedTarget;if(!e?.closest(`#${this.id}`)){t.preventDefault();this.parent?.isMultipleSelection||this.commitOrRemove()}}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.isInEditMode()&&this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}setAt(t,e,i,n){const[r,s]=this.parentDimensions;[i,n]=this.screenToPageTranslation(i,n);this.x=(t+i)/r;this.y=(e+n)/s;this.fixAndSetPosition()}_moveAfterPaste(t,e){if(this.isClone){delete this.isClone;return}const[i,n]=this.parentDimensions;this.setAt(t*i,e*n,this.width*i,this.height*n);this._onTranslated()}#mi([t,e],i,n){[i,n]=this.screenToPageTranslation(i,n);this.x+=i/t;this.y+=n/e;this._onTranslating(this.x,this.y);this.fixAndSetPosition()}translate(t,e){this.#mi(this.parentDimensions,t,e)}translateInPage(t,e){this.#ni||=[this.x,this.y,this.width,this.height];this.#mi(this.pageDimensions,t,e);this.div.scrollIntoView({block:"nearest"})}translationDone(){this._onTranslated(this.x,this.y)}drag(t,e){this.#ni||=[this.x,this.y,this.width,this.height];const{div:i,parentDimensions:[n,r]}=this;this.x+=t/n;this.y+=e/r;if(this.parent&&(this.x<0||this.x>1||this.y<0||this.y>1)){const{x:t,y:e}=this.div.getBoundingClientRect();if(this.parent.findNewParent(this,t,e)){this.x-=Math.floor(this.x);this.y-=Math.floor(this.y)}}let{x:s,y:a}=this;const[o,l]=this.getBaseTranslation();s+=o;a+=l;const{style:c}=i;c.left=`${(100*s).toFixed(2)}%`;c.top=`${(100*a).toFixed(2)}%`;this._onTranslating(s,a)}_onTranslating(t,e){}_onTranslated(t,e){}get _hasBeenMoved(){return!!this.#ni&&(this.#ni[0]!==this.x||this.#ni[1]!==this.y)}get _hasBeenResized(){return!!this.#ni&&(this.#ni[2]!==this.width||this.#ni[3]!==this.height)}getBaseTranslation(){const[t,e]=this.parentDimensions,{_borderLineWidth:i}=AnnotationEditor,n=i/t,r=i/e;switch(this.rotation){case 90:return[-n,r];case 180:return[n,r];case 270:return[n,-r];default:return[-n,-r]}}get _mustFixPosition(){return!0}fixAndSetPosition(t=this.rotation){const{div:{style:e},pageDimensions:[i,n]}=this;let{x:r,y:s,width:a,height:o}=this;a*=i;o*=n;r*=i;s*=n;let l=0,c=0;const h=this._uiManager._keepToolbarInPage&&this._editToolbar?.div;if(h?.offsetParent){const e=this.parentScale,d=h.offsetLeft+this.div.clientLeft,u=h.offsetTop+this.div.clientTop,p=Math.min(0,d)/e,g=Math.min(0,u)/e,m=a-p+Math.max(0,d+h.offsetWidth-this.div.offsetWidth)/e,f=o-g+Math.max(0,u+h.offsetHeight-this.div.offsetHeight)/e;if(m<=(t%180?n:i)){a=m;l=p}if(f<=(t%180?i:n)){o=f;c=g}[l,c]=AnnotationEditor.#fi(l,c,t);r+=l;s+=c}if(this._mustFixPosition)switch(t){case 0:r=MathClamp(r,0,i-a);s=MathClamp(s,0,n-o);break;case 90:r=MathClamp(r,0,i-o);s=MathClamp(s,a,n);break;case 180:r=MathClamp(r,a,i);s=MathClamp(s,o,n);break;case 270:r=MathClamp(r,o,i);s=MathClamp(s,0,n-a)}this.x=r=(r-l)/i;this.y=s=(s-c)/n;const[d,u]=this.getBaseTranslation();r+=d;s+=u;e.left=`${(100*r).toFixed(2)}%`;e.top=`${(100*s).toFixed(2)}%`;this.moveInDOM()}static#fi(t,e,i){switch(i){case 90:return[e,-t];case 180:return[-t,-e];case 270:return[-e,t];default:return[t,e]}}screenToPageTranslation(t,e){return AnnotationEditor.#fi(t,e,this.parentRotation)}pageTranslationToScreen(t,e){return AnnotationEditor.#fi(t,e,360-this.parentRotation)}#bi(t){switch(t){case 90:{const[t,e]=this.pageDimensions;return[0,-t/e,e/t,0]}case 180:return[-1,0,0,-1];case 270:{const[t,e]=this.pageDimensions;return[0,t/e,-e/t,0]}default:return[1,0,0,1]}}get parentScale(){return this._uiManager.viewParameters.realScale}get parentRotation(){return(this._uiManager.viewParameters.rotation+this.pageRotation)%360}get parentDimensions(){const{parentScale:t,pageDimensions:[e,i]}=this;return[e*t,i*t]}setDims(){const{div:{style:t},width:e,height:i}=this;t.width=`${(100*e).toFixed(2)}%`;t.height=`${(100*i).toFixed(2)}%`}getInitialTranslation(){return[0,0]}#yi(){if(this.#Ye)return;this.#Ye=document.createElement("div");this.#Ye.classList.add("resizers");const t=this._willKeepAspectRatio?["topLeft","topRight","bottomRight","bottomLeft"]:["topLeft","topMiddle","topRight","middleRight","bottomRight","bottomMiddle","bottomLeft","middleLeft"],e=this._uiManager._signal;for(const i of t){const t=document.createElement("div");this.#Ye.append(t);t.classList.add("resizer",i);t.setAttribute("data-resizer-name",i);t.addEventListener("pointerdown",this.#wi.bind(this,i),{signal:e});t.addEventListener("contextmenu",noContextMenu,{signal:e});t.tabIndex=-1}this.div.prepend(this.#Ye)}#wi(t,e){e.preventDefault();const{isMac:i}=FeatureTest.platform;if(0!==e.button||e.ctrlKey&&i)return;this.#l?.toggle(!1);const n=this._isDraggable;this._isDraggable=!1;this.#Je=[e.screenX,e.screenY];const r=new AbortController,s=this._uiManager.combinedSignal(r);this.parent.togglePointerEvents(!1);window.addEventListener("pointermove",this.#vi.bind(this,t),{passive:!0,capture:!0,signal:s});window.addEventListener("touchmove",stopEvent,{passive:!1,signal:s});window.addEventListener("contextmenu",noContextMenu,{signal:s});this.#Qe={savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height};const a=this.parent.div.style.cursor,o=this.div.style.cursor;this.div.style.cursor=this.parent.div.style.cursor=window.getComputedStyle(e.target).cursor;const pointerUpCallback=()=>{r.abort();this.parent.togglePointerEvents(!0);this.#l?.toggle(!0);this._isDraggable=n;this.parent.div.style.cursor=a;this.div.style.cursor=o;this.#_i()};window.addEventListener("pointerup",pointerUpCallback,{signal:s});window.addEventListener("blur",pointerUpCallback,{signal:s})}#Ai(t,e,i,n){this.width=i;this.height=n;this.x=t;this.y=e;this.setDims();this.fixAndSetPosition();this._onResized()}_onResized(){}#_i(){if(!this.#Qe)return;const{savedX:t,savedY:e,savedWidth:i,savedHeight:n}=this.#Qe;this.#Qe=null;const r=this.x,s=this.y,a=this.width,o=this.height;r===t&&s===e&&a===i&&o===n||this.addCommands({cmd:this.#Ai.bind(this,r,s,a,o),undo:this.#Ai.bind(this,t,e,i,n),mustExec:!0})}static _round(t){return Math.round(1e4*t)/1e4}#vi(t,e){const[i,n]=this.parentDimensions,r=this.x,s=this.y,a=this.width,o=this.height,l=AnnotationEditor.MIN_SIZE/i,c=AnnotationEditor.MIN_SIZE/n,h=this.#bi(this.rotation),transf=(t,e)=>[h[0]*t+h[2]*e,h[1]*t+h[3]*e],d=this.#bi(360-this.rotation);let u,p,g=!1,m=!1;switch(t){case"topLeft":g=!0;u=(t,e)=>[0,0];p=(t,e)=>[t,e];break;case"topMiddle":u=(t,e)=>[t/2,0];p=(t,e)=>[t/2,e];break;case"topRight":g=!0;u=(t,e)=>[t,0];p=(t,e)=>[0,e];break;case"middleRight":m=!0;u=(t,e)=>[t,e/2];p=(t,e)=>[0,e/2];break;case"bottomRight":g=!0;u=(t,e)=>[t,e];p=(t,e)=>[0,0];break;case"bottomMiddle":u=(t,e)=>[t/2,e];p=(t,e)=>[t/2,0];break;case"bottomLeft":g=!0;u=(t,e)=>[0,e];p=(t,e)=>[t,0];break;case"middleLeft":m=!0;u=(t,e)=>[0,e/2];p=(t,e)=>[t,e/2]}const f=u(a,o),b=p(a,o);let y=transf(...b);const w=AnnotationEditor._round(r+y[0]),v=AnnotationEditor._round(s+y[1]);let _,A,x=1,C=1;if(e.fromKeyboard)({deltaX:_,deltaY:A}=e);else{const{screenX:t,screenY:i}=e,[n,r]=this.#Je;[_,A]=this.screenToPageTranslation(t-n,i-r);this.#Je[0]=t;this.#Je[1]=i}[_,A]=(E=_/i,S=A/n,[d[0]*E+d[2]*S,d[1]*E+d[3]*S]);var E,S;if(g){const t=Math.hypot(a,o);x=C=Math.max(Math.min(Math.hypot(b[0]-f[0]-_,b[1]-f[1]-A)/t,1/a,1/o),l/a,c/o)}else m?x=MathClamp(Math.abs(b[0]-f[0]-_),l,1)/a:C=MathClamp(Math.abs(b[1]-f[1]-A),c,1)/o;const T=AnnotationEditor._round(a*x),k=AnnotationEditor._round(o*C);y=transf(...p(T,k));const P=w-y[0],M=v-y[1];this.#ni||=[this.x,this.y,this.width,this.height];this.width=T;this.height=k;this.x=P;this.y=M;this.setDims();this.fixAndSetPosition();this._onResizing()}_onResizing(){}altTextFinish(){this.#l?.finish()}get toolbarButtons(){return null}async addEditToolbar(){if(this._editToolbar||this.#si)return this._editToolbar;this._editToolbar=new EditorToolbar(this);this.div.append(this._editToolbar.render());const{toolbarButtons:t}=this;if(t)for(const[e,i]of t)await this._editToolbar.addButton(e,i);this.hasComment||this._editToolbar.addButton("comment",this.addCommentButton());this._editToolbar.addButton("delete");return this._editToolbar}addCommentButtonInToolbar(){this._editToolbar?.addButtonBefore("comment",this.addCommentButton(),".deleteButton")}removeCommentButtonFromToolbar(){this._editToolbar?.removeButton("comment")}removeEditToolbar(){this._editToolbar?.remove();this._editToolbar=null;this.#l?.destroy()}addContainer(t){const e=this._editToolbar?.div;e?e.before(t):this.div.append(t)}getClientDimensions(){return this.div.getBoundingClientRect()}createAltText(){if(!this.#l){AltText.initialize(AnnotationEditor._l10n);this.#l=new AltText(this);if(this.#Ve){this.#l.data=this.#Ve;this.#Ve=null}}return this.#l}get altTextData(){return this.#l?.data}set altTextData(t){this.#l&&(this.#l.data=t)}get guessedAltText(){return this.#l?.guessedText}async setGuessedAltText(t){await(this.#l?.setGuessedText(t))}serializeAltText(t){return this.#l?.serialize(t)}hasAltText(){return!!this.#l&&!this.#l.isEmpty()}hasAltTextData(){return this.#l?.hasData()??!1}focusCommentButton(){this.#c?.focusButton()}addCommentButton(){return this.canAddComment?this.#c||=new Comment(this):null}addStandaloneCommentButton(){if(this._uiManager.hasCommentManager())if(this.#pe)this._uiManager.isEditingMode()&&this.#pe.classList.remove("hidden");else if(this.hasComment){this.#pe=this.#c.renderForStandalone();this.div.append(this.#pe)}}removeStandaloneCommentButton(){this.#c.removeStandaloneCommentButton();this.#pe=null}hideStandaloneCommentButton(){this.#pe?.classList.add("hidden")}get comment(){if(!this.#c)return null;const{data:{richText:t,text:e,date:i,deleted:n}}=this.#c;return{text:e,richText:t,date:i,deleted:n,color:this.getNonHCMColor(),opacity:this.opacity??1}}set comment(t){this.#c||=new Comment(this);"object"==typeof t&&null!==t?this.#c.restoreData(t):this.#c.data=t;if(this.hasComment){this.removeCommentButtonFromToolbar();this.addStandaloneCommentButton();this._uiManager.updateComment(this)}else{this.addCommentButtonInToolbar();this.removeStandaloneCommentButton();this._uiManager.removeComment(this)}}setCommentData({comment:t,popupRef:e,richText:i}){if(!e)return;this.#c||=new Comment(this);this.#c.setInitialText(t,i);if(!this.annotationElementId)return;const n=this._uiManager.getAndRemoveDataFromAnnotationStorage(this.annotationElementId);n&&this.updateFromAnnotationLayer(n)}get hasEditedComment(){return this.#c?.hasBeenEdited()}get hasDeletedComment(){return this.#c?.isDeleted()}get hasComment(){return!!this.#c&&!this.#c.isEmpty()&&!this.#c.isDeleted()}async editComment(t){this.#c||=new Comment(this);this.#c.edit(t)}toggleComment(t,e=void 0){this.hasComment&&this._uiManager.toggleComment(this,t,e)}setSelectedCommentButton(t){this.#c.setSelectedButton(t)}addComment(t){if(this.hasEditedComment){const e=180,i=100,[,,,n]=t.rect,[r]=this.pageDimensions,[s]=this.pageTranslation,a=s+r+1,o=n-i,l=a+e;t.popup={contents:this.comment.text,deleted:this.comment.deleted,rect:[a,o,l,n]}}}updateFromAnnotationLayer({popup:{contents:t,deleted:e}}){this.#c.data=e?null:t}get parentBoundingClientRect(){return this.parent.boundingClientRect}render(){const t=this.div=document.createElement("div");t.setAttribute("data-editor-rotation",(360-this.rotation)%360);t.className=this.name;t.setAttribute("id",this.id);t.tabIndex=this.#$e?-1:0;t.setAttribute("role","application");this.defaultL10nId&&t.setAttribute("data-l10n-id",this.defaultL10nId);this._isVisible||t.classList.add("hidden");this.setInForeground();this.#xi();const[e,i]=this.parentDimensions;if(this.parentRotation%180!=0){t.style.maxWidth=`${(100*i/e).toFixed(2)}%`;t.style.maxHeight=`${(100*e/i).toFixed(2)}%`}const[n,r]=this.getInitialTranslation();this.translate(n,r);bindEvents(this,t,["keydown","pointerdown","dblclick"]);this.#Ci();this.addStandaloneCommentButton();this._uiManager._editorUndoBar?.hide();return t}#Ei(){this.#Qe={savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height};this.#l?.toggle(!1);this.parent.togglePointerEvents(!1)}#Si(t,e,i){let n=i/e*.7+1-.7;if(1===n)return;const r=this.#bi(this.rotation),transf=(t,e)=>[r[0]*t+r[2]*e,r[1]*t+r[3]*e],[s,a]=this.parentDimensions,o=this.x,l=this.y,c=this.width,h=this.height,d=AnnotationEditor.MIN_SIZE/s,u=AnnotationEditor.MIN_SIZE/a;n=Math.max(Math.min(n,1/c,1/h),d/c,u/h);const p=AnnotationEditor._round(c*n),g=AnnotationEditor._round(h*n);if(p===c&&g===h)return;this.#ni||=[o,l,c,h];const m=transf(c/2,h/2),f=AnnotationEditor._round(o+m[0]),b=AnnotationEditor._round(l+m[1]),y=transf(p/2,g/2);this.x=f-y[0];this.y=b-y[1];this.width=p;this.height=g;this.setDims();this.fixAndSetPosition();this._onResizing()}#Ti(){this.#l?.toggle(!0);this.parent.togglePointerEvents(!0);this.#_i()}pointerdown(t){const{isMac:e}=FeatureTest.platform;if(0!==t.button||t.ctrlKey&&e)t.preventDefault();else{this.#ii=!0;this._isDraggable?this.#ki(t):this.#Pi(t)}}#Pi(t){const{isMac:e}=FeatureTest.platform;t.ctrlKey&&!e||t.shiftKey||t.metaKey&&e?this.parent.toggleSelected(this):this.parent.setSelected(this)}#ki(t){const{isSelected:e}=this;this._uiManager.setUpDragSession();let i=!1;const n=new AbortController,r=this._uiManager.combinedSignal(n),s={capture:!0,passive:!1,signal:r},cancelDrag=t=>{n.abort();this.#Xe=null;this.#ii=!1;this._uiManager.endDragSession()||this.#Pi(t);i&&this._onStopDragging()};if(e){this.#li=t.clientX;this.#ci=t.clientY;this.#Xe=t.pointerId;this.#Ke=t.pointerType;window.addEventListener("pointermove",t=>{if(!i){i=!0;this._uiManager.toggleComment(this,!0,!1);this._onStartDragging()}const{clientX:e,clientY:n,pointerId:r}=t;if(r!==this.#Xe){stopEvent(t);return}const[s,a]=this.screenToPageTranslation(e-this.#li,n-this.#ci);this.#li=e;this.#ci=n;this._uiManager.dragSelectedEditors(s,a);this.div.scrollIntoView({block:"nearest"})},s);window.addEventListener("touchmove",stopEvent,s);window.addEventListener("pointerdown",t=>{t.pointerType===this.#Ke&&(this.#di||t.isPrimary)&&cancelDrag(t);stopEvent(t)},s)}const pointerUpCallback=t=>{this.#Xe&&this.#Xe!==t.pointerId?stopEvent(t):cancelDrag(t)};window.addEventListener("pointerup",pointerUpCallback,{signal:r});window.addEventListener("blur",pointerUpCallback,{signal:r})}_onStartDragging(){}_onStopDragging(){}moveInDOM(){this.#oi&&clearTimeout(this.#oi);this.#oi=setTimeout(()=>{this.#oi=null;this.parent?.moveEditorInDOM(this)},0)}_setParentAndPosition(t,e,i){t.changeParent(this);this.x=e;this.y=i;this.fixAndSetPosition();this._onTranslated()}getRect(t,e,i=this.rotation){const n=this.parentScale,[r,s]=this.pageDimensions,[a,o]=this.pageTranslation,l=t/n,c=e/n,h=this.x*r,d=this.y*s,u=this.width*r,p=this.height*s;switch(i){case 0:return[h+l+a,s-d-c-p+o,h+l+u+a,s-d-c+o];case 90:return[h+c+a,s-d+l+o,h+c+p+a,s-d+l+u+o];case 180:return[h-l-u+a,s-d+c+o,h-l+a,s-d+c+p+o];case 270:return[h-c-p+a,s-d-l-u+o,h-c+a,s-d-l+o];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(t,e){const[i,n,r,s]=t,a=r-i,o=s-n;switch(this.rotation){case 0:return[i,e-s,a,o];case 90:return[i,e-n,o,a];case 180:return[r,e-n,a,o];case 270:return[r,e-s,o,a];default:throw new Error("Invalid rotation")}}getPDFRect(){return this.getRect(0,0)}getNonHCMColor(){return this.color&&AnnotationEditor._colorManager.convert(this._uiManager.getNonHCMColor(this.color))}onUpdatedColor(){this.#c?.onUpdatedColor()}getData(){const{comment:{text:t,color:e,date:i,opacity:n,deleted:r,richText:s},uid:a,pageIndex:o,creationDate:l,modificationDate:c}=this;return{id:a,pageIndex:o,rect:this.getPDFRect(),richText:s,contentsObj:{str:t},creationDate:l,modificationDate:i||c,popupRef:!r,color:e,opacity:n}}onceAdded(t){}isEmpty(){return!1}enableEditMode(){if(this.isInEditMode())return!1;this.parent.setEditingState(!1);this.#si=!0;return!0}disableEditMode(){if(!this.isInEditMode())return!1;this.parent.setEditingState(!0);this.#si=!1;return!0}isInEditMode(){return this.#si}shouldGetKeyboardEvents(){return this.#ai}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}get isOnScreen(){const{top:t,left:e,bottom:i,right:n}=this.getClientDimensions(),{innerHeight:r,innerWidth:s}=window;return e0&&t0}#xi(){if(this.#ti||!this.div)return;this.#ti=new AbortController;const t=this._uiManager.combinedSignal(this.#ti);this.div.addEventListener("focusin",this.focusin.bind(this),{signal:t});this.div.addEventListener("focusout",this.focusout.bind(this),{signal:t})}#Ci(){!this.#di&&this.div&&this.isResizable&&this._uiManager._supportsPinchToZoom&&(this.#di=new TouchManager({container:this.div,isPinchingDisabled:()=>!this.isSelected,onPinchStart:this.#Ei.bind(this),onPinching:this.#Si.bind(this),onPinchEnd:this.#Ti.bind(this),signal:this._uiManager._signal}))}rebuild(){this.#xi();this.#Ci()}rotate(t){}resize(){}serializeDeleted(){return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex,popupRef:this._initialData?.popupRef||""}}serialize(t=!1,e=null){return{annotationType:this.mode,pageIndex:this.pageIndex,rect:this.getPDFRect(),rotation:this.rotation,structTreeParentId:this._structTreeParentId,popupRef:this._initialData?.popupRef||""}}static async deserialize(t,e,i){const n=new this.prototype.constructor({parent:e,id:i.getId(),uiManager:i,annotationElementId:t.annotationElementId,creationDate:t.creationDate,modificationDate:t.modificationDate});n.rotation=t.rotation;n.#Ve=t.accessibilityData;n._isCopy=t.isCopy||!1;const[r,s]=n.pageDimensions,[a,o,l,c]=n.getRectInCurrentCoords(t.rect,s);n.x=a/r;n.y=o/s;n.width=l/r;n.height=c/s;return n}get hasBeenModified(){return!!this.annotationElementId&&(this.deleted||null!==this.serialize())}remove(){this.#ti?.abort();this.#ti=null;this.isEmpty()||this.commit();this.#di?.destroy();this.#di=null;this.parent?this.parent.remove(this):this._uiManager.removeEditor(this);this.hideCommentPopup();if(this.#oi){clearTimeout(this.#oi);this.#oi=null}this.#gi();this.removeEditToolbar();if(this.#hi){for(const t of this.#hi.values())clearTimeout(t);this.#hi=null}this.parent=null;this.#Ze?.remove();this.#Ze=null}get isResizable(){return!1}makeResizable(){if(this.isResizable){this.#yi();this.#Ye.classList.remove("hidden")}}get toolbarPosition(){return null}get commentButtonPosition(){return"ltr"===this._uiManager.direction?[1,0]:[0,0]}get commentButtonPositionInPage(){const{commentButtonPosition:[t,e]}=this,[i,n,r,s]=this.getPDFRect();return[AnnotationEditor._round(i+(r-i)*t),AnnotationEditor._round(n+(s-n)*(1-e))]}get commentButtonColor(){return this._uiManager.makeCommentColor(this.getNonHCMColor(),this.opacity)}get commentPopupPosition(){return this.#c.commentPopupPositionInLayer}set commentPopupPosition(t){this.#c.commentPopupPositionInLayer=t}hasDefaultPopupPosition(){return this.#c.hasDefaultPopupPosition()}get commentButtonWidth(){return this.#c.commentButtonWidth}get elementBeforePopup(){return this.div}setCommentButtonStates(t){this.#c?.setCommentButtonStates(t)}keydown(t){if(!this.isResizable||t.target!==this.div||"Enter"!==t.key)return;this._uiManager.setSelected(this);this.#Qe={savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height};const e=this.#Ye.children;if(!this.#qe){this.#qe=Array.from(e);const t=this.#Mi.bind(this),i=this.#Di.bind(this),n=this._uiManager._signal;for(const e of this.#qe){const r=e.getAttribute("data-resizer-name");e.setAttribute("role","spinbutton");e.addEventListener("keydown",t,{signal:n});e.addEventListener("blur",i,{signal:n});e.addEventListener("focus",this.#Ii.bind(this,r),{signal:n});e.setAttribute("data-l10n-id",AnnotationEditor._l10nResizer[r])}}const i=this.#qe[0];let n=0;for(const t of e){if(t===i)break;n++}const r=(360-this.rotation+this.parentRotation)%360/90*(this.#qe.length/4);if(r!==n){if(rn)for(let t=0;t{this.div?.classList.contains("selectedEditor")&&this.#Oi()})}}#Oi(){this._editToolbar?.show();if(this._uiManager._keepToolbarInPage){this.fixAndSetPosition();this._onTranslated()}}focus(){this.div&&!this.div.contains(document.activeElement)&&setTimeout(()=>this.div?.focus({preventScroll:!0}),0)}unselect(){if(this.isSelected){this.isSelected=!1;this.#Ye?.classList.add("hidden");this.div?.classList.remove("selectedEditor");this.div?.contains(document.activeElement)&&this._uiManager.currentLayer.div.focus({preventScroll:!0});this._editToolbar?.hide();this.#l?.toggleAltTextBadge(!0);this.hideCommentPopup()}}hideCommentPopup(){this.hasComment&&this._uiManager.toggleComment(null)}updateParams(t,e){}disableEditing(){}enableEditing(){}get canChangeContent(){return!1}enterInEditMode(){if(this.canChangeContent){this.enableEditMode();this.div.focus()}}dblclick(t){if("BUTTON"!==t.target.nodeName){this.enterInEditMode();this.parent.updateToolbar({mode:this.constructor._editorType,editId:this.uid})}}getElementForAltText(){return this.div}get contentDiv(){return this.div}get isEditing(){return this.#ri}set isEditing(t){this.#ri=t;if(this.parent)if(t){this.parent.setSelected(this);this.parent.setActiveEditor(this)}else this.parent.setActiveEditor(null)}static get MIN_SIZE(){return 16}static canCreateNewEmptyEditor(){return!0}get telemetryInitialData(){return{action:"added"}}get telemetryFinalData(){return null}_reportTelemetry(t,e=!1){if(e){this.#hi||=new Map;const{action:e}=t;let i=this.#hi.get(e);i&&clearTimeout(i);i=setTimeout(()=>{this._reportTelemetry(t);this.#hi.delete(e);0===this.#hi.size&&(this.#hi=null)},AnnotationEditor._telemetryTimeout);this.#hi.set(e,i);return}t.type||=this.editorType;this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:t}})}show(t=this._isVisible){this.div.classList.toggle("hidden",!t);this._isVisible=t}enable(){this.div&&(this.div.tabIndex=0);this.#$e=!1}disable(){this.div&&(this.div.tabIndex=-1);this.#$e=!0}updateFakeAnnotationElement(t){if(this.#Ze||this.deleted)if(this.deleted){this.#Ze.remove();this.#Ze=null}else(this.hasEditedComment||this._hasBeenMoved||this._hasBeenResized)&&this.#Ze.updateEdited({rect:this.getPDFRect(),popup:this.comment});else this.#Ze=t.addFakeAnnotation(this)}renderAnnotationElement(t){if(this.deleted){t.hide();return null}let e=t.container.querySelector(".annotationContent");if(e){if("CANVAS"===e.nodeName){const t=e;e=document.createElement("div");e.classList.add("annotationContent",this.editorType);t.before(e)}}else{e=document.createElement("div");e.classList.add("annotationContent",this.editorType);t.container.prepend(e)}return e}resetAnnotationElement(t){const{firstElementChild:e}=t.container;"DIV"===e?.nodeName&&e.classList.contains("annotationContent")&&e.remove()}}class FakeEditor extends AnnotationEditor{constructor(t){super(t);this.annotationElementId=t.annotationElementId;this.deleted=!0}serialize(){return this.serializeDeleted()}}const cn=3285377520,hn=4294901760,dn=65535;class MurmurHash3_64{constructor(t){this.h1=t?4294967295&t:cn;this.h2=t?4294967295&t:cn}update(t){let e,i;if("string"==typeof t){e=new Uint8Array(2*t.length);i=0;for(let n=0,r=t.length;n>>8;e[i++]=255&r}}}else{if(!ArrayBuffer.isView(t))throw new Error("Invalid data format, must be a string or TypedArray.");e=t.slice();i=e.byteLength}const n=i>>2,r=i-4*n,s=new Uint32Array(e.buffer,0,n);let a=0,o=0,l=this.h1,c=this.h2;const h=3432918353,d=461845907,u=11601,p=13715;for(let t=0;t>>17;a=a*d&hn|a*p&dn;l^=a;l=l<<13|l>>>19;l=5*l+3864292196}else{o=s[t];o=o*h&hn|o*u&dn;o=o<<15|o>>>17;o=o*d&hn|o*p&dn;c^=o;c=c<<13|c>>>19;c=5*c+3864292196}a=0;switch(r){case 3:a^=e[4*n+2]<<16;case 2:a^=e[4*n+1]<<8;case 1:a^=e[4*n];a=a*h&hn|a*u&dn;a=a<<15|a>>>17;a=a*d&hn|a*p&dn;1&n?l^=a:c^=a}this.h1=l;this.h2=c}hexdigest(){let t=this.h1,e=this.h2;t^=e>>>1;t=3981806797*t&hn|36045*t&dn;e=4283543511*e&hn|(2950163797*(e<<16|t>>>16)&hn)>>>16;t^=e>>>1;t=444984403*t&hn|60499*t&dn;e=3301882366*e&hn|(3120437893*(e<<16|t>>>16)&hn)>>>16;t^=e>>>1;return(t>>>0).toString(16).padStart(8,"0")+(e>>>0).toString(16).padStart(8,"0")}}const un=Object.freeze({map:null,hash:"",transfer:void 0});class AnnotationStorage{#Ri=!1;#Bi=null;#Li=null;#Ni=new Map;onSetModified=null;onResetModified=null;onAnnotationEditor=null;getValue(t,e){const i=this.#Ni.get(t);return void 0===i?e:Object.assign(e,i)}getRawValue(t){return this.#Ni.get(t)}remove(t){const e=this.#Ni.get(t);if(void 0!==e){e instanceof AnnotationEditor&&this.#Li.delete(e.annotationElementId);this.#Ni.delete(t);0===this.#Ni.size&&this.resetModified();this.#Ni.values().some(t=>t instanceof AnnotationEditor)||this.onAnnotationEditor?.(null)}}setValue(t,e){const i=this.#Ni.get(t);let n=!1;if(void 0!==i){for(const[t,r]of Object.entries(e))if(i[t]!==r){n=!0;i[t]=r}}else{n=!0;this.#Ni.set(t,e)}n&&this.#Ui();if(e instanceof AnnotationEditor){(this.#Li||=new Map).set(e.annotationElementId,e);this.onAnnotationEditor?.(e.constructor._type)}}has(t){return this.#Ni.has(t)}get size(){return this.#Ni.size}#Ui(){if(!this.#Ri){this.#Ri=!0;this.onSetModified?.()}}resetModified(){if(this.#Ri){this.#Ri=!1;this.onResetModified?.()}}get print(){return new PrintAnnotationStorage(this)}get serializable(){if(0===this.#Ni.size)return un;const t=new Map,e=new MurmurHash3_64,i=[],n=Object.create(null);let r=!1;for(const[i,s]of this.#Ni){const a=s instanceof AnnotationEditor?s.serialize(!1,n):s;if(s.page){s.pageIndex=s.page._pageIndex;delete s.page}if(a){t.set(i,a);e.update(`${i}:${JSON.stringify(a)}`);r||=!!a.bitmap}}if(r)for(const e of t.values())e.bitmap&&i.push(e.bitmap);return t.size>0?{map:t,hash:e.hexdigest(),transfer:i}:un}get editorStats(){let t=null;const e=new Map;let i=0,n=0;for(const r of this.#Ni.values()){if(!(r instanceof AnnotationEditor)){r.popup&&(r.popup.deleted?n+=1:i+=1);continue}r.isCommentDeleted?n+=1:r.hasEditedComment&&(i+=1);const s=r.telemetryFinalData;if(!s)continue;const{type:a}=s;e.getOrInsertComputed(a,()=>Object.getPrototypeOf(r).constructor);t||=Object.create(null);const o=t[a]||=new Map;for(const[t,e]of Object.entries(s)){if("type"===t)continue;const i=o.getOrInsertComputed(t,makeMap);i.set(e,(i.get(e)??0)+1)}}if(n>0||i>0){t||=Object.create(null);t.comments={deleted:n,edited:i}}if(!t)return null;for(const[i,n]of e)t[i]=n.computeTelemetryFinalData(t[i]);return t}resetModifiedIds(){this.#Bi=null}updateEditor(t,e){const i=this.#Li?.get(t);if(i){i.updateFromAnnotationLayer(e);return!0}return!1}getEditor(t){return this.#Li?.get(t)||null}get modifiedIds(){if(this.#Bi)return this.#Bi;const t=[];if(this.#Li)for(const e of this.#Li.values())e.serialize()&&t.push(e.annotationElementId);let e="";if(t.length){const i=new MurmurHash3_64;i.update(t.join(","));e=i.hexdigest()}return this.#Bi={ids:new Set(t),hash:e}}[Symbol.iterator](){return this.#Ni.entries()}}class PrintAnnotationStorage extends AnnotationStorage{#Hi=un;constructor(t){super();const{serializable:e}=t;if(e===un)return;const{map:i,hash:n,transfer:r}=e,s=structuredClone(i,r?{transfer:r}:null);this.#Hi={map:s,hash:n,transfer:[]}}get print(){unreachable("Should not call PrintAnnotationStorage.print")}get serializable(){return this.#Hi}get modifiedIds(){return util_shadow(this,"modifiedIds",{ids:new Set,hash:""})}}function getFactoryUrlProp(t){if("string"!=typeof t)return null;if(t.endsWith("/"))return t;throw new Error(`Invalid factory url: "${t}" must include trailing slash.`)}const isRefProxy=t=>"object"==typeof t&&Number.isInteger(t?.num)&&t.num>=0&&Number.isInteger(t?.gen)&&t.gen>=0,pn=function _isValidExplicitDest(t,e,i){if(!Array.isArray(i)||i.length<2)return!1;const[n,r,...s]=i;if(!t(n)&&!Number.isInteger(n))return!1;if(!e(r))return!1;const a=s.length;let o=!0;switch(r.name){case"XYZ":if(a<2||a>3)return!1;break;case"Fit":case"FitB":return 0===a;case"FitH":case"FitBH":case"FitV":case"FitBV":if(a>1)return!1;break;case"FitR":if(4!==a)return!1;o=!1;break;default:return!1}for(const t of s)if(!("number"==typeof t||o&&null===t))return!1;return!0}.bind(null,isRefProxy,t=>"object"==typeof t&&"string"==typeof t?.name);function getWorkerSrc(t){if(!function isSameOrigin(t,e){const i=URL.parse(t);if(!i?.origin||"null"===i.origin)return!1;const n=new URL(e,i);return i.origin===n.origin}(window.location,t)){const e=`await import("${new URL(t,window.location).href}");`;return URL.createObjectURL(new Blob([e],{type:"text/javascript"}))}return t}class LoopbackPort{#zi=new Map;#Gi=Promise.resolve();postMessage(t,e){const i={data:structuredClone(t,e?{transfer:e}:null)};this.#Gi.then(()=>{for(const[t]of this.#zi)t.call(this,i)})}addEventListener(t,e,i=null){let n=null;if(i?.signal instanceof AbortSignal){const{signal:r}=i;if(r.aborted){warn("LoopbackPort - cannot use an `aborted` signal.");return}const onAbort=()=>this.removeEventListener(t,e);n=()=>r.removeEventListener("abort",onAbort);r.addEventListener("abort",onAbort)}this.#zi.set(e,n)}removeEventListener(t,e){const i=this.#zi.get(e);i?.();this.#zi.delete(e)}terminate(){for(const[,t]of this.#zi)t?.();this.#zi.clear()}}class StatTimer{#Wi=new Map;times=[];time(t){this.#Wi.has(t)&&warn(`Timer is already running for ${t}`);this.#Wi.set(t,Date.now())}timeEnd(t){this.#Wi.has(t)||warn(`Timer has not been started for ${t}`);this.times.push({name:t,start:this.#Wi.get(t),end:Date.now()});this.#Wi.delete(t)}toString(){const t=Math.max(...this.times.map(t=>t.name.length));return this.times.map(e=>`${e.name.padEnd(t)} ${e.end-e.start}ms\n`).join("")}}const gn=new class WebGPU{#ji=null;#Vi=null;#qi=null;#$i=null;async#Xi(){if(!globalThis.navigator?.gpu)return!1;try{const t=await navigator.gpu.requestAdapter();if(!t)return!1;this.#$i=navigator.gpu.getPreferredCanvasFormat();this.#Vi=await t.requestDevice();return!0}catch{return!1}}init(){return this.#ji||=this.#Xi()}get isReady(){return null!==this.#Vi}loadMeshShader(){if(!this.#Vi||this.#qi)return;const t=this.#Vi.createShaderModule({code:"\nstruct Uniforms {\n offsetX : f32,\n offsetY : f32,\n scaleX : f32,\n scaleY : f32,\n paddedWidth : f32,\n paddedHeight : f32,\n borderSize : f32,\n _pad : f32,\n};\n\n@group(0) @binding(0) var u : Uniforms;\n\nstruct VertexInput {\n @location(0) position : vec2,\n @location(1) color : vec4,\n};\n\nstruct VertexOutput {\n @builtin(position) position : vec4,\n @location(0) color : vec3,\n};\n\n@vertex\nfn vs_main(in : VertexInput) -> VertexOutput {\n var out : VertexOutput;\n let cx = (in.position.x + u.offsetX) * u.scaleX;\n let cy = (in.position.y + u.offsetY) * u.scaleY;\n out.position = vec4(\n ((cx + u.borderSize) / u.paddedWidth) * 2.0 - 1.0,\n 1.0 - ((cy + u.borderSize) / u.paddedHeight) * 2.0,\n 0.0,\n 1.0\n );\n out.color = in.color.rgb;\n return out;\n}\n\n@fragment\nfn fs_main(in : VertexOutput) -> @location(0) vec4 {\n return vec4(in.color, 1.0);\n}\n"});this.#qi=this.#Vi.createRenderPipeline({layout:"auto",vertex:{module:t,entryPoint:"vs_main",buffers:[{arrayStride:8,attributes:[{shaderLocation:0,offset:0,format:"float32x2"}]},{arrayStride:4,attributes:[{shaderLocation:1,offset:0,format:"unorm8x4"}]}]},fragment:{module:t,entryPoint:"fs_main",targets:[{format:this.#$i}]},primitive:{topology:"triangle-list"}})}draw(t,e,i,n,r,s,a,o){this.loadMeshShader();const l=this.#Vi,{offsetX:c,offsetY:h,scaleX:d,scaleY:u}=n,p=l.createBuffer({size:Math.max(t.byteLength,4),usage:GPUBufferUsage.VERTEX|GPUBufferUsage.COPY_DST});t.byteLength>0&&l.queue.writeBuffer(p,0,t);const g=l.createBuffer({size:Math.max(e.byteLength,4),usage:GPUBufferUsage.VERTEX|GPUBufferUsage.COPY_DST});e.byteLength>0&&l.queue.writeBuffer(g,0,e);const m=l.createBuffer({size:32,usage:GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST});l.queue.writeBuffer(m,0,new Float32Array([c,h,d,u,s,a,o,0]));const f=l.createBindGroup({layout:this.#qi.getBindGroupLayout(0),entries:[{binding:0,resource:{buffer:m}}]}),b=new OffscreenCanvas(s,a),y=b.getContext("webgpu");y.configure({device:l,format:this.#$i,alphaMode:r?"opaque":"premultiplied"});const w=r?{r:r[0]/255,g:r[1]/255,b:r[2]/255,a:1}:{r:0,g:0,b:0,a:0},v=l.createCommandEncoder(),_=v.beginRenderPass({colorAttachments:[{view:y.getCurrentTexture().createView(),clearValue:w,loadOp:"clear",storeOp:"store"}]});if(i>0){_.setPipeline(this.#qi);_.setBindGroup(0,f);_.setVertexBuffer(0,p);_.setVertexBuffer(1,g);_.draw(i)}_.end();l.queue.submit([v.finish()]);p.destroy();g.destroy();m.destroy();return b.transferToImageBitmap()}};function initGPU(){return gn.init()}function isGPUReady(){return gn.isReady}Xe();const mn=1,fn=2,bn=1,yn=2,wn=3,vn=4,_n=5,An=6,xn=7,Cn=8;function onFn(){}function wrapReason(t){if(t instanceof AbortException||t instanceof InvalidPDFException||t instanceof PasswordException||t instanceof ResponseException||t instanceof UnknownErrorException)return t;if("object"!=typeof t||null===t)return new UnknownErrorException(String(t),String(t));switch(t.name){case"AbortException":return new AbortException(t.message);case"InvalidPDFException":return new InvalidPDFException(t.message);case"PasswordException":return new PasswordException(t.message,t.code);case"ResponseException":return new ResponseException(t.message,t.status,t.missing);case"UnknownErrorException":return new UnknownErrorException(t.message,t.details)}return new UnknownErrorException(t.message,t.toString())}class MessageHandler{#Ki=new Map;#Yi=new Map;#Ji=1;#Qi;#Zi=new AbortController;#tn;#en=new Map;#in=1;#nn=new Map;#rn;constructor(t,e,i){this.#tn=t;this.#rn=e;this.#Qi=i;i.addEventListener("message",this.#sn.bind(this),{signal:this.#Zi.signal})}#sn({data:t}){if(t.targetName!==this.#tn)return;if(t.stream){this.#an(t);return}if(t.callback){const{callbackId:e,callback:i}=t,n=this.#Yi.get(e);if(!n)throw new Error(`Cannot resolve callback ${e}`);this.#Yi.delete(e);if(i===mn)n.resolve(t.data);else{if(i!==fn)throw new Error("Unexpected callback case");n.reject(wrapReason(t.reason))}return}const e=this.#Ki.get(t.action);if(!e)throw new Error(`Unknown action from worker: ${t.action}`);if(t.callbackId){const i=this.#tn,n=t.sourceName,r=this.#Qi;Promise.try(e,t.data).then(e=>{r.postMessage({sourceName:i,targetName:n,callback:mn,callbackId:t.callbackId,data:e})}).catch(e=>{r.postMessage({sourceName:i,targetName:n,callback:fn,callbackId:t.callbackId,reason:wrapReason(e)})});return}t.streamId?this.#on(t):e(t.data)}on(t,e){const i=this.#Ki;if(i.has(t))throw new Error(`There is already a "${t}" handler.`);i.set(t,e)}send(t,e,i){this.#Qi.postMessage({sourceName:this.#tn,targetName:this.#rn,action:t,data:e},i)}sendWithPromise(t,e,i){const n=this.#Ji++,r=Promise.withResolvers();this.#Yi.set(n,r);try{this.#Qi.postMessage({sourceName:this.#tn,targetName:this.#rn,action:t,callbackId:n,data:e},i)}catch(t){r.reject(t)}return r.promise}sendWithStream(t,e,i,n){const r=this.#in++,s=this.#tn,a=this.#rn,o=this.#Qi;return new ReadableStream({start:i=>{const l=Promise.withResolvers();this.#en.set(r,{controller:i,startCall:l,pullCall:null,cancelCall:null,isClosed:!1});o.postMessage({sourceName:s,targetName:a,action:t,streamId:r,data:e,desiredSize:i.desiredSize},n);return l.promise},pull:t=>{const e=Promise.withResolvers();this.#en.get(r).pullCall=e;o.postMessage({sourceName:s,targetName:a,stream:An,streamId:r,desiredSize:t.desiredSize});return e.promise},cancel:t=>{util_assert(t instanceof Error,"cancel must have a valid reason");const e=Promise.withResolvers();this.#en.get(r).cancelCall=e;this.#en.get(r).isClosed=!0;o.postMessage({sourceName:s,targetName:a,stream:bn,streamId:r,reason:wrapReason(t)});return e.promise}},i)}#on(t){const e=t.streamId,i=this.#tn,n=t.sourceName,r=this.#Qi,s=this.#nn,a=this.#Ki.get(t.action),o={enqueue(t,s=1,a){if(this.isCancelled)return;const o=this.desiredSize;this.desiredSize-=s;if(o>0&&this.desiredSize<=0){this.sinkCapability=Promise.withResolvers();this.ready=this.sinkCapability.promise}r.postMessage({sourceName:i,targetName:n,stream:vn,streamId:e,chunk:t},a)},close(){if(!this.isCancelled){this.isCancelled=!0;r.postMessage({sourceName:i,targetName:n,stream:wn,streamId:e});s.delete(e)}},error(t){if(!this.isCancelled){this.isCancelled=!0;r.postMessage({sourceName:i,targetName:n,stream:_n,streamId:e,reason:wrapReason(t)})}},sinkCapability:Promise.withResolvers(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:t.desiredSize,ready:null};o.sinkCapability.resolve();o.ready=o.sinkCapability.promise;s.set(e,o);Promise.try(a,t.data,o).then(()=>{r.postMessage({sourceName:i,targetName:n,stream:Cn,streamId:e,success:!0})},t=>{r.postMessage({sourceName:i,targetName:n,stream:Cn,streamId:e,reason:wrapReason(t)})})}#an(t){const e=t.streamId,i=this.#tn,n=t.sourceName,r=this.#Qi,s=this.#en.get(e),a=this.#nn.get(e);switch(t.stream){case Cn:t.success?s.startCall.resolve():s.startCall.reject(wrapReason(t.reason));break;case xn:t.success?s.pullCall.resolve():s.pullCall.reject(wrapReason(t.reason));break;case An:if(!a){r.postMessage({sourceName:i,targetName:n,stream:xn,streamId:e,success:!0});break}a.desiredSize<=0&&t.desiredSize>0&&a.sinkCapability.resolve();a.desiredSize=t.desiredSize;Promise.try(a.onPull||onFn).then(()=>{r.postMessage({sourceName:i,targetName:n,stream:xn,streamId:e,success:!0})},t=>{r.postMessage({sourceName:i,targetName:n,stream:xn,streamId:e,reason:wrapReason(t)})});break;case vn:util_assert(s,"enqueue should have stream controller");if(s.isClosed)break;s.controller.enqueue(t.chunk);break;case wn:util_assert(s,"close should have stream controller");if(s.isClosed)break;s.isClosed=!0;s.controller.close();this.#ln(s,e);break;case _n:util_assert(s,"error should have stream controller");s.controller.error(wrapReason(t.reason));this.#ln(s,e);break;case yn:t.success?s.cancelCall.resolve():s.cancelCall.reject(wrapReason(t.reason));this.#ln(s,e);break;case bn:if(!a)break;const o=wrapReason(t.reason);Promise.try(a.onCancel||onFn,o).then(()=>{r.postMessage({sourceName:i,targetName:n,stream:yn,streamId:e,success:!0})},t=>{r.postMessage({sourceName:i,targetName:n,stream:yn,streamId:e,reason:wrapReason(t)})});a.sinkCapability.reject(o);a.isCancelled=!0;this.#nn.delete(e);break;default:throw new Error("Unexpected stream case")}}async#ln(t,e){await Promise.allSettled([t.startCall?.promise,t.pullCall?.promise,t.cancelCall?.promise]);this.#en.delete(e)}destroy(){this.#Zi?.abort();this.#Zi=null}get destroyed(){return!this.#Zi}}class BaseBinaryDataFactory{#cn=Object.freeze({cMapUrl:"CMap",standardFontDataUrl:"font",wasmUrl:"wasm"});constructor({cMapUrl:t=null,standardFontDataUrl:e=null,wasmUrl:i=null}){this.cMapUrl=t;this.standardFontDataUrl=e;this.wasmUrl=i}async fetch({kind:t,filename:e}){switch(t){case"cMapUrl":case"standardFontDataUrl":case"wasmUrl":break;default:unreachable(`Not implemented: ${t}`)}const i=this[t];if(!i)throw new Error(`Ensure that the \`${t}\` API parameter is provided.`);const n=`${i}${e}`;return this._fetch(n,t).catch(e=>{throw new Error(`Unable to load ${this.#cn[t]} data at: ${n}`)})}async _fetch(t,e){unreachable("Abstract method `_fetch` called.")}}class DOMBinaryDataFactory extends BaseBinaryDataFactory{async _fetch(t,e){const i="cMapUrl"!==e||t.endsWith(".bcmap")?"bytes":"text",n=await fetchData(t,i);return n instanceof Uint8Array?n:stringToBytes(n)}}class BaseCanvasFactory{#hn=!1;constructor({enableHWA:t=!1}){this.#hn=t}create(t,e){if(t<=0||e<=0)throw new Error("Invalid canvas size");const i=this._createCanvas(t,e);return{canvas:i,context:i.getContext("2d",{willReadFrequently:!this.#hn})}}reset({canvas:t},e,i){if(!t)throw new Error("Canvas is not specified");if(e<=0||i<=0)throw new Error("Invalid canvas size");t.width=e;t.height=i}destroy(t){const{canvas:e}=t;if(!e)throw new Error("Canvas is not specified");e.width=e.height=0;t.canvas=null;t.context=null}getNoAlphaContext(t){return t.getContext("2d",{alpha:!1,willReadFrequently:!this.#hn})}_createCanvas(t,e){unreachable("Abstract method `_createCanvas` called.")}}class BaseFilterFactory{addFilter(t){return"none"}addHCMFilter(t,e){return"none"}addAlphaFilter(t){return"none"}addLuminosityFilter(t){return"none"}addKnockoutFilter(t=0){return"none"}addHighlightHCMFilter(t,e,i,n,r){return"none"}addSelectionHCMFilter(t,e){return"none"}addSelectionFilter(){return"none"}createSelectionStyle(t=null){return null}destroy(t=!1){}}if(ui){let t;try{const e=process.getBuiltinModule("module").createRequire(import.meta.url);try{t=e("@napi-rs/canvas")}catch(t){warn(`Cannot load "@napi-rs/canvas" package: "${t}".`)}}catch(t){warn(`Cannot access the \`require\` function: "${t}".`)}globalThis.DOMMatrix||(t?.DOMMatrix?globalThis.DOMMatrix=t.DOMMatrix:warn("Cannot polyfill `DOMMatrix`, rendering may be broken."));globalThis.Path2D||(t?.Path2D?globalThis.Path2D=t.Path2D:warn("Cannot polyfill `Path2D`, rendering may be broken."));globalThis.navigator?.language||(globalThis.navigator={language:"en-US",platform:"",userAgent:""})}class NodeFilterFactory extends BaseFilterFactory{}class NodeCanvasFactory extends BaseCanvasFactory{_createCanvas(t,e){return process.getBuiltinModule("module").createRequire(import.meta.url)("@napi-rs/canvas").createCanvas(t,e)}}class NodeBinaryDataFactory extends BaseBinaryDataFactory{async _fetch(t,e){return async function node_utils_fetchData(t){const e=process.getBuiltinModule("fs/promises"),i=await e.readFile(t);return new Uint8Array(i)}(t)}}Ne();const En="__forcedDependency",{floor:Sn,ceil:Tn}=Math;function expandBBox(t,e,i,n,r,s){t[4*e+0]=Math.min(t[4*e+0],i);t[4*e+1]=Math.min(t[4*e+1],n);t[4*e+2]=Math.max(t[4*e+2],r);t[4*e+3]=Math.max(t[4*e+3],s)}const kn=new Uint32Array(new Uint8Array([255,255,0,0]).buffer)[0];class BBoxReader{#dn;#un;constructor(t,e){this.#dn=t;this.#un=e}static fromBuffer(t){return new BBoxReader(new Uint32Array(t),new Uint8ClampedArray(t))}get buffer(){return this.#dn.buffer}get length(){return this.#dn.length}isEmpty(t){return this.#dn[t]===kn}minX(t){return this.#un[4*t+0]/256}minY(t){return this.#un[4*t+1]/256}maxX(t){return(this.#un[4*t+2]+1)/256}maxY(t){return(this.#un[4*t+3]+1)/256}}const ensureDebugMetadata=(t,e)=>t?.getOrInsertComputed(e,()=>({dependencies:new Set,isRenderingOperation:!1}));class CanvasBBoxTracker{#pn=[[1,0,0,1,0,0]];#gn=[-1/0,-1/0,1/0,1/0];#mn=new Float64Array(pi);_pendingBBoxIdx=-1;#fn;#bn;#yn;#dn;_savesStack=[];_markedContentStack=[];constructor(t,e){this.#fn=t.width;this.#bn=t.height;this.#wn(e)}growOperationsCount(t){t>=this.#dn.length&&this.#wn(t,this.#dn)}#wn(t,e){const i=new ArrayBuffer(4*t);this.#yn=new Uint8ClampedArray(i);this.#dn=new Uint32Array(i);if(e&&e.length>0){this.#dn.set(e);this.#dn.fill(kn,e.length)}else this.#dn.fill(kn)}get clipBox(){return this.#gn}save(t){this.#gn={__proto__:this.#gn};this._savesStack.push(t);return this}restore(t,e){const i=Object.getPrototypeOf(this.#gn);if(null===i)return this;this.#gn=i;const n=this._savesStack.pop();if(void 0!==n){e?.(n,t);this.#dn[t]=this.#dn[n]}return this}recordOpenMarker(t){this._savesStack.push(t);return this}getOpenMarker(){return 0===this._savesStack.length?null:this._savesStack.at(-1)}recordCloseMarker(t,e){const i=this._savesStack.pop();if(void 0!==i){e?.(i,t);this.#dn[t]=this.#dn[i]}return this}beginMarkedContent(t){this._markedContentStack.push(t);return this}endMarkedContent(t,e){const i=this._markedContentStack.pop();if(void 0!==i){e?.(i,t);this.#dn[t]=this.#dn[i]}return this}pushBaseTransform(t){this.#pn.push(Util.multiplyByDOMMatrix(this.#pn.at(-1),t.getTransform()));return this}popBaseTransform(){this.#pn.length>1&&this.#pn.pop();return this}resetBBox(t){if(this._pendingBBoxIdx!==t){this._pendingBBoxIdx=t;this.#mn.set(pi,0)}return this}recordClipBox(t,e,i,n,r,s){const a=Util.multiplyByDOMMatrix(this.#pn.at(-1),e.getTransform()),o=pi.slice();Util.axialAlignedBoundingBox([i,r,n,s],a,o);const l=Util.intersect(this.#gn,o);if(l){this.#gn[0]=l[0];this.#gn[1]=l[1];this.#gn[2]=l[2];this.#gn[3]=l[3]}else{this.#gn[0]=this.#gn[1]=1/0;this.#gn[2]=this.#gn[3]=-1/0}return this}recordBBox(t,e,i,n,r,s){const a=this.#gn;if(a[0]===1/0)return this;const o=Util.multiplyByDOMMatrix(this.#pn.at(-1),e.getTransform());if(a[0]===-1/0){Util.axialAlignedBoundingBox([i,r,n,s],o,this.#mn);return this}const l=pi.slice();Util.axialAlignedBoundingBox([i,r,n,s],o,l);this.#mn[0]=MathClamp(l[0],a[0],this.#mn[0]);this.#mn[1]=MathClamp(l[1],a[1],this.#mn[1]);this.#mn[2]=MathClamp(l[2],this.#mn[2],a[2]);this.#mn[3]=MathClamp(l[3],this.#mn[3],a[3]);return this}recordFullPageBBox(t){this.#mn[0]=Math.max(0,this.#gn[0]);this.#mn[1]=Math.max(0,this.#gn[1]);this.#mn[2]=Math.min(this.#fn,this.#gn[2]);this.#mn[3]=Math.min(this.#bn,this.#gn[3]);return this}recordOperation(t,e=!1,i){if(this._pendingBBoxIdx!==t)return this;const n=Sn(256*this.#mn[0]/this.#fn),r=Sn(256*this.#mn[1]/this.#bn),s=Tn(256*this.#mn[2]/this.#fn),a=Tn(256*this.#mn[3]/this.#bn);expandBBox(this.#yn,t,n,r,s,a);if(i)for(const e of i)for(const i of e)i!==t&&expandBBox(this.#yn,i,n,r,s,a);e||(this._pendingBBoxIdx=-1);return this}bboxToClipBoxDropOperation(t){if(this._pendingBBoxIdx===t){this._pendingBBoxIdx=-1;this.#gn[0]=Math.max(this.#gn[0],this.#mn[0]);this.#gn[1]=Math.max(this.#gn[1],this.#mn[1]);this.#gn[2]=Math.min(this.#gn[2],this.#mn[2]);this.#gn[3]=Math.min(this.#gn[3],this.#mn[3])}return this}take(){return new BBoxReader(this.#dn,this.#yn)}takeDebugMetadata(){throw new Error("Unreachable")}recordSimpleData(t,e){return this}recordIncrementalData(t,e){return this}resetIncrementalData(t,e){return this}recordNamedData(t,e){return this}recordSimpleDataFromNamed(t,e,i){return this}recordFutureForcedDependency(t,e){return this}inheritSimpleDataAsFutureForcedDependencies(t){return this}inheritPendingDependenciesAsFutureForcedDependencies(){return this}recordCharacterBBox(t,e,i,n=1,r=0,s=0,a){return this}getSimpleIndex(t){}recordDependencies(t,e){return this}recordNamedDependency(t,e){return this}recordShowTextOperation(t,e=!1){return this}}class CanvasDependencyTracker{#vn={__proto__:null};#_n={__proto__:null,transform:[],moveText:[],sameLineText:[],[En]:[]};#An=new Map;#xn=new Set;#Cn=new Map;#En;#Sn;#Tn;constructor(t,e=!1){this.#Tn=t;if(e){this.#En=new Map;this.#Sn=(t,e)=>{ensureDebugMetadata(this.#En,e).dependencies.add(t)}}}get clipBox(){return this.#Tn.clipBox}growOperationsCount(t){this.#Tn.growOperationsCount(t)}save(t){this.#vn={__proto__:this.#vn};this.#_n={__proto__:this.#_n,transform:{__proto__:this.#_n.transform},moveText:{__proto__:this.#_n.moveText},sameLineText:{__proto__:this.#_n.sameLineText},[En]:{__proto__:this.#_n[En]}};this.#Tn.save(t);return this}restore(t){this.#Tn.restore(t,this.#Sn);const e=Object.getPrototypeOf(this.#vn);if(null===e)return this;this.#vn=e;this.#_n=Object.getPrototypeOf(this.#_n);return this}recordOpenMarker(t){this.#Tn.recordOpenMarker(t,this.#Sn);return this}getOpenMarker(){return this.#Tn.getOpenMarker()}recordCloseMarker(t){this.#Tn.recordCloseMarker(t,this.#Sn);return this}beginMarkedContent(t){this.#Tn.beginMarkedContent(t);return this}endMarkedContent(t){this.#Tn.endMarkedContent(t,this.#Sn);return this}pushBaseTransform(t){this.#Tn.pushBaseTransform(t);return this}popBaseTransform(){this.#Tn.popBaseTransform();return this}recordSimpleData(t,e){this.#vn[t]=e;return this}recordIncrementalData(t,e){this.#_n[t].push(e);return this}resetIncrementalData(t,e){this.#_n[t].length=0;return this}recordNamedData(t,e){this.#An.set(t,e);return this}recordSimpleDataFromNamed(t,e,i){this.#vn[t]=this.#An.get(e)??i}recordFutureForcedDependency(t,e){this.recordIncrementalData(En,e);return this}inheritSimpleDataAsFutureForcedDependencies(t){for(const e of t)e in this.#vn&&this.recordFutureForcedDependency(e,this.#vn[e]);return this}inheritPendingDependenciesAsFutureForcedDependencies(){for(const t of this.#xn)this.recordFutureForcedDependency(En,t);return this}resetBBox(t){this.#Tn.resetBBox(t);return this}recordClipBox(t,e,i,n,r,s){this.#Tn.recordClipBox(t,e,i,n,r,s);return this}recordBBox(t,e,i,n,r,s){this.#Tn.recordBBox(t,e,i,n,r,s);return this}recordCharacterBBox(t,e,i,n=1,r=0,s=0,a){const o=i.bbox;let l,c;if(o){l=o[2]!==o[0]&&o[3]!==o[1]&&this.#Cn.get(i);if(!1!==l){c=[0,0,0,0];Util.axialAlignedBoundingBox(o,i.fontMatrix,c);1===n&&0===r&&0===s||function scaleCharBBox(t,e,i,n,r){let s;if(t){if(t<0){s=r[0];r[0]=r[2];r[2]=s}r[0]*=t;r[2]*=t;if(e<0){s=r[1];r[1]=r[3];r[3]=s}r[1]*=e;r[3]*=e}else r.fill(0);r[0]+=i;r[1]+=n;r[2]+=i;r[3]+=n}(n,-n,r,s,c);if(l)return this.recordBBox(t,e,c[0],c[2],c[1],c[3])}}if(!a)return this.recordFullPageBBox(t);const h=a();if(o&&c&&void 0===l){l=c[0]<=r-h.actualBoundingBoxLeft&&c[2]>=r+h.actualBoundingBoxRight&&c[1]<=s-h.actualBoundingBoxAscent&&c[3]>=s+h.actualBoundingBoxDescent;this.#Cn.set(i,l);if(l)return this.recordBBox(t,e,c[0],c[2],c[1],c[3])}return this.recordBBox(t,e,r-h.actualBoundingBoxLeft,r+h.actualBoundingBoxRight,s-h.actualBoundingBoxAscent,s+h.actualBoundingBoxDescent)}recordFullPageBBox(t){this.#Tn.recordFullPageBBox(t);return this}getSimpleIndex(t){return this.#vn[t]}recordDependencies(t,e){const i=this.#xn,n=this.#vn,r=this.#_n;for(const t of e)t in this.#vn?i.add(n[t]):t in r&&r[t].forEach(i.add,i);return this}recordNamedDependency(t,e){this.#An.has(e)&&this.#xn.add(this.#An.get(e));return this}recordOperation(t,e=!1){this.recordDependencies(t,[En]);if(this.#En){const e=ensureDebugMetadata(this.#En,t),{dependencies:i}=e;this.#xn.forEach(i.add,i);this.#Tn._savesStack.forEach(i.add,i);this.#Tn._markedContentStack.forEach(i.add,i);i.delete(t);e.isRenderingOperation=!0}const i=!e&&t===this.#Tn._pendingBBoxIdx;this.#Tn.recordOperation(t,e,[this.#xn,this.#Tn._savesStack,this.#Tn._markedContentStack]);i&&this.#xn.clear();return this}recordShowTextOperation(t,e=!1){const i=Array.from(this.#xn);this.recordOperation(t,e);this.recordIncrementalData("sameLineText",t);for(const t of i)this.recordIncrementalData("sameLineText",t);return this}bboxToClipBoxDropOperation(t,e=!1){const i=!e&&t===this.#Tn._pendingBBoxIdx;this.#Tn.bboxToClipBoxDropOperation(t);i&&this.#xn.clear();return this}take(){this.#Cn.clear();return this.#Tn.take()}takeDebugMetadata(){return this.#En}}class CanvasNestedDependencyTracker{#kn;#Pn;#Mn;#Dn=0;#In=0;constructor(t,e,i){if(t instanceof CanvasNestedDependencyTracker&&t.#Mn===!!i)return t;this.#kn=t;this.#Pn=e;this.#Mn=!!i}get clipBox(){return this.#kn.clipBox}growOperationsCount(){throw new Error("Unreachable")}save(t){this.#In++;this.#kn.save(this.#Pn);return this}restore(t){if(this.#In>0){this.#kn.restore(this.#Pn);this.#In--}return this}recordOpenMarker(t){this.#Dn++;return this}getOpenMarker(){return this.#Dn>0?this.#Pn:this.#kn.getOpenMarker()}recordCloseMarker(t){this.#Dn--;return this}beginMarkedContent(t){return this}endMarkedContent(t){return this}pushBaseTransform(t){this.#kn.pushBaseTransform(t);return this}popBaseTransform(){this.#kn.popBaseTransform();return this}recordSimpleData(t,e){this.#kn.recordSimpleData(t,this.#Pn);return this}recordIncrementalData(t,e){this.#kn.recordIncrementalData(t,this.#Pn);return this}resetIncrementalData(t,e){this.#kn.resetIncrementalData(t,this.#Pn);return this}recordNamedData(t,e){return this}recordSimpleDataFromNamed(t,e,i){this.#kn.recordSimpleDataFromNamed(t,e,this.#Pn);return this}recordFutureForcedDependency(t,e){this.#kn.recordFutureForcedDependency(t,this.#Pn);return this}inheritSimpleDataAsFutureForcedDependencies(t){this.#kn.inheritSimpleDataAsFutureForcedDependencies(t);return this}inheritPendingDependenciesAsFutureForcedDependencies(){this.#kn.inheritPendingDependenciesAsFutureForcedDependencies();return this}resetBBox(t){this.#Mn||this.#kn.resetBBox(this.#Pn);return this}recordClipBox(t,e,i,n,r,s){this.#Mn||this.#kn.recordClipBox(this.#Pn,e,i,n,r,s);return this}recordBBox(t,e,i,n,r,s){this.#Mn||this.#kn.recordBBox(this.#Pn,e,i,n,r,s);return this}recordCharacterBBox(t,e,i,n,r,s,a){this.#Mn||this.#kn.recordCharacterBBox(this.#Pn,e,i,n,r,s,a);return this}recordFullPageBBox(t){this.#Mn||this.#kn.recordFullPageBBox(this.#Pn);return this}getSimpleIndex(t){return this.#kn.getSimpleIndex(t)}recordDependencies(t,e){this.#kn.recordDependencies(this.#Pn,e);return this}recordNamedDependency(t,e){this.#kn.recordNamedDependency(this.#Pn,e);return this}recordOperation(t){this.#kn.recordOperation(this.#Pn,!0);return this}recordShowTextOperation(t){this.#kn.recordShowTextOperation(this.#Pn,!0);return this}bboxToClipBoxDropOperation(t){this.#Mn||this.#kn.bboxToClipBoxDropOperation(this.#Pn,!0);return this}take(){throw new Error("Unreachable")}takeDebugMetadata(){throw new Error("Unreachable")}}const Pn=["path","transform","filter","strokeColor","strokeAlpha","lineWidth","lineCap","lineJoin","miterLimit","dash"],Mn=["path","transform","filter","fillColor","fillAlpha","globalCompositeOperation","SMask"],Dn=["transform","SMask","filter","fillAlpha","strokeAlpha","globalCompositeOperation"],In=["filter","fillColor","fillAlpha"],Fn=["transform","leading","charSpacing","wordSpacing","hScale","textRise","moveText","textMatrix","font","fontObj","filter","fillColor","textRenderingMode","SMask","fillAlpha","strokeAlpha","globalCompositeOperation","sameLineText"],On=["transform"],Rn=["transform","filter","fillColor"];class CanvasImagesTracker{#fn;#bn;#Fn=4;#On=0;#un=new CanvasImagesTracker.#Rn(6*this.#Fn);static#Rn=FeatureTest.isFloat16ArraySupported?Float16Array:Float32Array;constructor(t){this.#fn=t.width;this.#bn=t.height}record(t,e,i,n){if(this.#On===this.#Fn){this.#Fn*=2;const t=new CanvasImagesTracker.#Rn(6*this.#Fn);t.set(this.#un);this.#un=t}const r=getCurrentTransform(t);let s;if(n[0]!==1/0){const t=pi.slice();Util.axialAlignedBoundingBox([0,-i,e,0],r,t);const a=Util.intersect(n,t);if(!a)return;const[o,l,c,h]=a;if(o!==t[0]||l!==t[1]||c!==t[2]||h!==t[3]){const t=Math.atan2(r[1],r[0]),e=Math.abs(Math.sin(t)),i=Math.abs(Math.cos(t));if(e<1e-6||i<1e-6||Math.abs(e-i)<1e-6)s=[o,l,o,h,c,l];else{const t=c-o,n=h-l,r=e*e,a=i*i,d=i*e,u=a-r,p=(n*a-t*d)/u;s=[o+(n*d-t*r)/u,l,o,l+p,c,h-p]}}}if(!s){s=[0,-i,0,0,e,-i];Util.applyTransform(s,r,0);Util.applyTransform(s,r,2);Util.applyTransform(s,r,4)}s[0]/=this.#fn;s[1]/=this.#bn;s[2]/=this.#fn;s[3]/=this.#bn;s[4]/=this.#fn;s[5]/=this.#bn;this.#un.set(s,6*this.#On);this.#On++}take(){return this.#un.subarray(0,6*this.#On)}}function convertBlackAndWhiteToRGBA({src:t,srcPos:e=0,dest:i,width:n,height:r,nonBlackColor:s=4294967295,inverseDecode:a=!1}){const o=FeatureTest.isLittleEndian?4278190080:255,[l,c]=a?[s,o]:[o,s],h=n>>3,d=7&n,u=l^c,p=t.length;i=new Uint32Array(i.buffer);let g=0;for(let n=0;n>7&1)&u;i[g+1]=l^-(n>>6&1)&u;i[g+2]=l^-(n>>5&1)&u;i[g+3]=l^-(n>>4&1)&u;i[g+4]=l^-(n>>3&1)&u;i[g+5]=l^-(n>>2&1)&u;i[g+6]=l^-(n>>1&1)&u;i[g+7]=l^-(1&n)&u}if(0===d)continue;const n=e>7-t&1)&u}return{srcPos:e,destPos:g}}function convertRGBToRGBA({src:t,srcPos:e=0,dest:i,destPos:n=0,width:r,height:s}){let a=0;const o=r*s*3,l=t.byteOffset+e,c=l%4==0?Math.floor(MathClamp(t.length-e,0,o)/4):0,h=c>0?new Uint32Array(t.buffer,l,c):null,d=FeatureTest.isLittleEndian?4278190080:255;if(FeatureTest.isLittleEndian){for(;a>>24|e<<8|d;i[n+2]=e>>>16|r<<16|d;i[n+3]=r>>>8|d}for(let r=e+4*a,s=e+o;r>>8|d;i[n+2]=e<<16|r>>>16|d;i[n+3]=r<<8|d}for(let r=e+4*a,s=e+o;rthis._r0&&t+this._r0>this._r1}_createGradient(t,e=null){let i,n=this._p0,r=this._p1;if(e){n=n.slice();r=r.slice();Util.applyTransform(n,e);Util.applyTransform(r,e)}if("axial"===this._type)i=t.createLinearGradient(n[0],n[1],r[0],r[1]);else if("radial"===this._type){let s=this._r0,a=this._r1;if(e){const t=new Float32Array(2);Util.singularValueDecompose2dScale(e,t);s*=t[0];a*=t[0]}i=t.createRadialGradient(n[0],n[1],s,r[0],r[1],a)}for(const t of this._colorStops)i.addColorStop(t[0],t[1]);return i}_createReversedGradient(t,e=null){let i=this._p1,n=this._p0;if(e){i=i.slice();n=n.slice();Util.applyTransform(i,e);Util.applyTransform(n,e)}let r=this._r1,s=this._r0;if(e){const t=new Float32Array(2);Util.singularValueDecompose2dScale(e,t);r*=t[0];s*=t[0]}const a=t.createRadialGradient(i[0],i[1],r,n[0],n[1],s),o=this._colorStops.map(([t,e])=>[1-t,e]).reverse();for(const[t,e]of o)a.addColorStop(t,e);return a}_createRasterPattern(t,e,i,n,r,s){const a=Math.ceil(n[2]-n[0])||1,o=Math.ceil(n[3]-n[1])||1,l=e.canvasFactory.create(a,o),c=l.context;c.clearRect(0,0,a,o);c.beginPath();c.rect(0,0,a,o);c.translate(-n[0],-n[1]);i=Util.transform(i,[1,0,0,1,n[0],n[1]]);c.transform(...r);applyBoundingBox(c,this._bbox);if(this.areConic()){c.fillStyle=this._createReversedGradient(c);c.fill()}c.fillStyle=this._createGradient(c);c.fill();s?.applyToCanvas(c);const h=t.createPattern(l.canvas,"no-repeat");e.canvasFactory.destroy(l);h.setTransform(new DOMMatrix(i));return h}getPattern(t,e,i,n){const r=e.current.transferMapsFallback;if(n===Ln||n===Bn){if(this.isOriginBased()&&!r){let n=Util.transform(i,e.baseTransform);this.matrix&&(n=Util.transform(n,this.matrix));const r=.001,s=Math.hypot(n[0],n[1]),a=Math.hypot(n[2],n[3]),o=(n[0]*n[2]+n[1]*n[3])/(s*a);if(Math.abs(o)l[2*n+1]){u=i;i=n;n=u;u=s;s=a;a=u}if(l[2*n+1]>l[2*r+1]){u=n;n=r;r=u;u=a;a=o;o=u}if(l[2*i+1]>l[2*n+1]){u=i;i=n;n=u;u=s;s=a;a=u}const p=(l[2*i]+e.offsetX)*e.scaleX,g=(l[2*i+1]+e.offsetY)*e.scaleY,m=(l[2*n]+e.offsetX)*e.scaleX,f=(l[2*n+1]+e.offsetY)*e.scaleY,b=(l[2*r]+e.offsetX)*e.scaleX,y=(l[2*r+1]+e.offsetY)*e.scaleY;if(g>=y)return;const w=c[4*s],v=c[4*s+1],_=c[4*s+2],A=c[4*a],x=c[4*a+1],C=c[4*a+2],E=c[4*o],S=c[4*o+1],T=c[4*o+2],k=Math.round(g),P=Math.round(y);let M,D,I,O,R,B,L,N;for(let t=k;t<=P;t++){if(ty?1:f===y?0:(f-t)/(f-y);M=m-(m-b)*e;D=A-(A-E)*e;I=x-(x-S)*e;O=C-(C-T)*e}let e;e=ty?1:(g-t)/(g-y);R=p-(p-b)*e;B=w-(w-E)*e;L=v-(v-S)*e;N=_-(_-T)*e;const i=Math.round(Math.min(M,R)),n=Math.round(Math.max(M,R));let r=d*t+4*i;for(let t=i;t<=n;t++){e=(M-t)/(M-R);e<0?e=0:e>1&&(e=1);h[r++]=D-(D-B)*e|0;h[r++]=I-(I-L)*e|0;h[r++]=O-(O-N)*e|0;h[r++]=255}}}class MeshShadingPattern extends BaseShadingPattern{constructor(t){super();this._posData=t[2];this._colData=t[3];this._vertexCount=t[4];this._bounds=t[5];this._bbox=t[6];this._background=t[7];!function loadMeshShader(){gn.loadMeshShader()}()}_createMeshCanvas(t,e,i,n=null){const r=Math.floor(this._bounds[0]),s=Math.floor(this._bounds[1]),a=Math.ceil(this._bounds[2])-r,o=Math.ceil(this._bounds[3])-s,l=Math.min(Math.ceil(Math.abs(a*t[0]*1.1)),3e3)||1,c=Math.min(Math.ceil(Math.abs(o*t[1]*1.1)),3e3)||1,h=a?a/l:1,d=o?o/c:1,u={coords:this._posData,colors:this._colData,offsetX:-r,offsetY:-s,scaleX:1/h,scaleY:1/d},p=l+4,g=c+4,m=i.create(p,g);if(isGPUReady()&&this._vertexCount>48)m.context.drawImage(function drawMeshWithGPU(t,e,i,n,r,s,a,o){return gn.draw(t,e,i,n,r,s,a,o)}(this._posData,this._colData,this._vertexCount,u,e,p,g,2),0,0);else{const t=m.context.createImageData(l,c);if(e){const i=t.data;for(let t=0,n=i.length;tl+1e-6||e>c+1e-6)return null;const h=Math.floor((i-a)/l)+1,d=Math.ceil((i+t-r)/l)-1,u=Math.floor((n-o)/c)+1,p=Math.ceil((n+e-s)/c)-1;return d<=h&&p<=u?[h,u]:null}updatePatternDims(t,e){const i=pi.slice();Util.axialAlignedBoundingBox(t,Util.inverseTransform(this.patternBaseMatrix),i);e[0]=i[2]-i[0];e[1]=i[3]-i[1];e[2]=i[0];e[3]=i[1]}_renderTileCanvas(t,e,i,n){const[r,s,a,o]=this.bbox,l=t.canvasFactory.create(i.size,n.size),c=l.context,h=this.canvasGraphicsFactory.createCanvasGraphics(c,e);h.groupLevel=t.groupLevel;h.current.transferMapsFallback=t.current.transferMapsFallback;this.setFillAndStrokeStyleToContext(h,this.paintType,this.color);c.translate(-i.scale*r,-n.scale*s);h.transform(0,i.scale,0,0,n.scale,0,0);c.save();h.dependencyTracker?.save();this.clipBbox(h,r,s,a,o);h.baseTransform=getCurrentTransform(h.ctx);h.executeOperatorList(this.operatorList);h.endDrawing();h.dependencyTracker?.restore();c.restore();return l}_getCombinedScales(){const t=new Float32Array(2);Util.singularValueDecompose2dScale(this.matrix,t);const[e,i]=t;Util.singularValueDecompose2dScale(this.baseTransform,t);return[e*t[0],i*t[1]]}drawPattern(t,e,i=!1,[n,r],s){const[a,o,l,c]=this.bbox,h=t.dependencyTracker;h&&(t.dependencyTracker=new CanvasNestedDependencyTracker(h,s));try{t.save();i?t.ctx.clip(e,"evenodd"):t.ctx.clip(e);t.ctx.setTransform(...this.patternBaseMatrix);t.ctx.translate(n*this.xstep,r*this.ystep);if(this.needsIsolation||1!==t.ctx.globalAlpha||"source-over"!==t.ctx.globalCompositeOperation||t.inSMaskMode){const e=l-a,i=c-o,[n,r]=this._getCombinedScales(),h=this.getSizeAndScale(e,this.ctx.canvas.width,n),d=this.getSizeAndScale(i,this.ctx.canvas.height,r),u=this._renderTileCanvas(t,s,h,d);t.ctx.drawImage(u.canvas,a,o,e,i);t.canvasFactory.destroy(u)}else{t.resetGraphicsState();this.setFillAndStrokeStyleToContext(t,this.paintType,this.color);this.clipBbox(t,a,o,l,c);t.baseTransformStack.push(t.baseTransform);t.baseTransform=getCurrentTransform(t.ctx);t.executeOperatorList(this.operatorList);t.baseTransform=t.baseTransformStack.pop()}t.restore()}finally{h&&(t.dependencyTracker=h)}}createPatternCanvas(t,e){const[i,n,r,s]=this.bbox,a=r-i,o=s-n;let{xstep:l,ystep:c}=this;l=Math.abs(l);c=Math.abs(c);info("TilingType: "+this.tilingType);const[h,d]=this._getCombinedScales();let u=a,p=o,g=!1,m=!1;Math.ceil(l*h)>=Math.ceil(a*h)?u=l:g=!0;Math.ceil(c*d)>=Math.ceil(o*d)?p=c:m=!0;const f=this.getSizeAndScale(u,this.ctx.canvas.width,h),b=this.getSizeAndScale(p,this.ctx.canvas.height,d),y=this._renderTileCanvas(t,e,f,b);if(g||m){const e=y.canvas;g&&(u=l);m&&(p=c);const r=this.getSizeAndScale(u,this.ctx.canvas.width,h),s=this.getSizeAndScale(p,this.ctx.canvas.height,d),f=r.size,b=s.size,w=t.canvasFactory.create(f,b),v=w.context,_=g?Math.min(Math.floor(a/l),Math.ceil(e.width/f)):0,A=m?Math.min(Math.floor(o/c),Math.ceil(e.height/b)):0;let x=e,C=null;if(m){C=t.canvasFactory.create(e.width,b);const i=C.context;for(let t=A;t>=0;t--)i.drawImage(e,0,b*t,e.width,b,0,0,e.width,b);x=C.canvas}for(let t=_;t>=0;t--)v.drawImage(x,f*t,0,f,b,0,0,f,b);C&&t.canvasFactory.destroy(C);t.canvasFactory.destroy(y);return{canvas:w.canvas,canvasEntry:w,scaleX:r.scale,scaleY:s.scale,offsetX:i,offsetY:n}}return{canvas:y.canvas,canvasEntry:y,scaleX:f.scale,scaleY:b.scale,offsetX:i,offsetY:n}}getSizeAndScale(t,e,i){const n=Math.max(TilingPattern.MAX_PATTERN_SIZE,e);let r=Math.ceil(t*i);r>=n?r=n:i=r/t;return{scale:i,size:r}}clipBbox(t,e,i,n,r){const s=n-e,a=r-i,o=new Path2D;o.rect(e,i,s,a);Util.axialAlignedBoundingBox([e,i,n,r],getCurrentTransform(t.ctx),t.current.minMax);t.ctx.clip(o);t.current.updateClipFromPath()}setFillAndStrokeStyleToContext(t,e,i){switch(e){case Un:i="#000000";break;case Hn:break;default:throw new FormatError(`Unsupported paint type: ${e}`)}const{ctx:n,current:r}=t;r.patternFill=r.patternStroke=!1;n.fillStyle=n.strokeStyle=r.transferMapsFallback?.applyToColor(i)??i;r.fillColor=r.strokeColor=i}isModifyingCurrentTransform(){return!1}getPattern(t,e,i,n,r){const s=n!==Nn?Util.transform(i,this.patternBaseMatrix):i,a=this.createPatternCanvas(e,r);let o=new DOMMatrix(s);o=o.translate(a.offsetX,a.offsetY);o=o.scale(1/a.scaleX,1/a.scaleY);const l=t.createPattern(a.canvas,"repeat");e.canvasFactory.destroy(a.canvasEntry);l.setTransform(o);return l}}const zn=16,Gn=new Float32Array(2);function mirrorContextOperations(t,e){if(t._removeMirroring)throw new Error("Context is already forwarding operations.");const i=new Map;for(const n of["save","restore","rotate","scale","translate","transform","setTransform","resetTransform","clip","moveTo","lineTo","bezierCurveTo","quadraticCurveTo","arc","arcTo","ellipse","rect","roundRect","closePath","beginPath"]){const r=t[n];if("function"==typeof r&&"function"==typeof e[n]){i.set(n,r);t[n]=function(...t){e[n](...t);return r.apply(this,t)}}}t._removeMirroring=()=>{for(const[e,n]of i)t[e]=n;delete t._removeMirroring}}function drawImageAtIntegerCoords(t,e,i,n,r,s,a,o,l,c){const[h,d,u,p,g,m]=getCurrentTransform(t);if(0===d&&0===u){const f=a*h+g,b=Math.round(f),y=o*p+m,w=Math.round(y),v=(a+l)*h+g,_=Math.abs(Math.round(v)-b)||1,A=(o+c)*p+m,x=Math.abs(Math.round(A)-w)||1;t.setTransform(Math.sign(h),0,0,Math.sign(p),b,w);t.drawImage(e,i,n,r,s,0,0,_,x);t.setTransform(h,d,u,p,g,m);return[_,x]}if(0===h&&0===p){const f=o*u+g,b=Math.round(f),y=a*d+m,w=Math.round(y),v=(o+c)*u+g,_=Math.abs(Math.round(v)-b)||1,A=(a+l)*d+m,x=Math.abs(Math.round(A)-w)||1;t.setTransform(0,Math.sign(d),Math.sign(u),0,b,w);t.drawImage(e,i,n,r,s,0,0,x,_);t.setTransform(h,d,u,p,g,m);return[x,_]}t.drawImage(e,i,n,r,s,a,o,l,c);return[Math.hypot(h,d)*l,Math.hypot(u,p)*c]}class CanvasExtraState{alphaIsShape=!1;fontSize=0;fontSizeScale=1;textMatrix=null;textMatrixScale=1;fontMatrix=mi;leading=0;x=0;y=0;lineX=0;lineY=0;charSpacing=0;wordSpacing=0;textHScale=1;textRenderingMode=Di;textRise=0;fillColor="#000000";strokeColor="#000000";tilingPatternDims=null;patternFill=!1;patternStroke=!1;fillAlpha=1;strokeAlpha=1;lineWidth=1;activeSMask=null;transferMaps="none";transferMapsFallback=null;minMax=gi.slice();constructor(t,e){this.clipBox=new Float32Array([0,0,t,e])}clone(){const t=Object.create(this);t.clipBox=this.clipBox.slice();t.minMax=this.minMax.slice();t.tilingPatternDims=this.tilingPatternDims?.slice();return t}getPathBoundingBox(t=Bn,e=null){const i=this.minMax.slice();if(t===Ln){e||unreachable("Stroke bounding box must include transform.");Util.singularValueDecompose2dScale(e,Gn);const t=Gn[0]*this.lineWidth/2,n=Gn[1]*this.lineWidth/2;i[0]-=t;i[1]-=n;i[2]+=t;i[3]+=n}return i}updateClipFromPath(){const t=Util.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(t||[0,0,0,0])}isEmptyClip(){return this.minMax[0]===1/0}startNewPathAndClipBox(t){this.clipBox.set(t,0);this.minMax.set(gi,0)}getClippedPathBoundingBox(t=Bn,e=null){return Util.intersect(this.clipBox,this.getPathBoundingBox(t,e))}}function putBinaryImageData(t,e){const{width:i,height:n,kind:r}=e,s=n%zn,a=(n-s)/zn,o=0===s?a:a+1,l=t.createImageData(i,zn);let c=0;const h=e.data,d=l.data;let u;if(r===Li.GRAYSCALE_1BPP)for(u=0;u10&&"function"==typeof i,d=h?Date.now()+15:0;let u=0;const p=this.commonObjs,g=this.objs;let m,f;for(;;){if(void 0!==r){if(l===r.nextBreakPoint){r.breakIt(l,i);return l}if(r.shouldSkip(l)){if(++l===c)return l;continue}}if(!s||s(l,t)){m=o[l];f=a[l]??null;if(m!==Vi.dependency)null===f?this[m](l):this[m](l,...f);else for(const t of f){this.dependencyTracker?.recordNamedData(t,l);const e=t.startsWith("g_")?p:g;if(!e.has(t)){e.get(t,i,n);return l}}}l++;if(l===c)return l;if(h&&++u>10){if(Date.now()>d){i();return l}u=0}}}finally{this._pathCache=l}}#Kn(){for(;this.stateStack.length||this.inSMaskMode;)this.restore();this.current.activeSMask=null;this.ctx.restore();if(this.transparentCanvas){this.ctx=this.compositeCtx;this.ctx.save();this.ctx.setTransform(1,0,0,1,0,0);this.ctx.drawImage(this.transparentCanvas,0,0);this.ctx.restore();this.canvasFactory.destroy(this.transparentCanvasEntry);this.transparentCanvas=null;this.transparentCanvasEntry=null}}endDrawing(){this.#Kn();for(const t of this.smaskGroupCanvases)this.canvasFactory.destroy(t);this.smaskGroupCanvases.length=0;this._clearPreparedSMask();this.tempSMask=null;this.smaskStack.length=0;for(const t of this.#Xn)this.#Yn(t);this.#Xn.length=0;this.#zn=null;this.#Gn=null;this.#Wn=null;this.#jn=null;this.#Vn=1;this.#$n=null;this.#Hn=0;this.#Un=0;this.cachedPatterns.clear();for(const t of this._cachedBitmapsMap.values()){for(const e of t.values())"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement&&(e.width=e.height=0);t.clear()}this._cachedBitmapsMap.clear();this.#Jn()}#Jn(){if(this.pageColors){const t=this.filterFactory.addHCMFilter(this.pageColors.foreground,this.pageColors.background);if("none"!==t){const e=this.ctx.filter;this.ctx.filter=t;this.ctx.drawImage(this.ctx.canvas,0,0);this.ctx.filter=e}}}_scaleImage(t,e){const i=t.width??t.displayWidth,n=t.height??t.displayHeight,r=[];let s=Math.max(Math.hypot(e[0],e[1]),1),a=Math.max(Math.hypot(e[2],e[3]),1),o=i,l=n;for(;s>2&&o>1||a>2&&l>1;){let t=o,e=l;if(s>2&&o>1){t=Math.ceil(o/2);s/=o/t}if(a>2&&l>1){e=Math.ceil(l/2);a/=l/e}r.push({newWidth:t,newHeight:e});o=t;l=e}if(0===r.length)return{img:t,paintWidth:i,paintHeight:n,tmpCanvas:null};if(1===r.length){const{newWidth:e,newHeight:s}=r[0],a=this.canvasFactory.create(e,s);a.context.drawImage(t,0,0,i,n,0,0,e,s);return{img:a.canvas,paintWidth:e,paintHeight:s,tmpCanvas:a}}let c=this.canvasFactory.create(1,1),h=this.canvasFactory.create(1,1),d=i,u=n,p=t;for(const{newWidth:t,newHeight:e}of r){this.canvasFactory.reset(h,t,e);h.context.drawImage(p,0,0,d,u,0,0,t,e);[c,h]=[h,c];p=c.canvas;d=t;u=e}this.canvasFactory.destroy(h);return{img:c.canvas,paintWidth:d,paintHeight:u,tmpCanvas:c}}_createMaskCanvas(t,e){const i=this.ctx,{width:n,height:r}=e,s=this.current.patternFill,a=s?this.current.fillColor:i.fillStyle,o=getCurrentTransform(i);let l,c,h,d;if((e.bitmap||e.data)&&e.count>1){const i=e.bitmap||e.data.buffer;c=JSON.stringify(s?o:[o.slice(0,4),a]);l=this._cachedBitmapsMap.getOrInsertComputed(i,makeMap);const n=l.get(c);if(n&&!s){const e=Math.round(Math.min(o[0],o[2])+o[4]),i=Math.round(Math.min(o[1],o[3])+o[5]);this.dependencyTracker?.recordDependencies(t,Rn);return{canvas:n,offsetX:e,offsetY:i}}h=n}if(!h){d=this.canvasFactory.create(n,r);putBinaryImageMask(d.context,e)}let u=Util.transform(o,[1/n,0,0,-1/r,0,0]);u=Util.transform(u,[1,0,0,1,0,-r]);const p=gi.slice();Util.axialAlignedBoundingBox([0,0,n,r],u,p);const[g,m,f,b]=p,y=Math.round(f-g)||1,w=Math.round(b-m)||1,v=this.canvasFactory.create(y,w),_=v.context,A=g,x=m;_.translate(-A,-x);_.transform(...u);let C=null;if(!h){const t=this._scaleImage(d.canvas,getCurrentTransformInverse(_));h=t.img;C=t.tmpCanvas;if(h!==d.canvas){this.canvasFactory.destroy(d);d=null}if(l&&s){l.set(c,h);C=null;d=null}}_.imageSmoothingEnabled=getImageSmoothingEnabled(getCurrentTransform(_),e.interpolate,this.pixelRatio);drawImageAtIntegerCoords(_,h,0,0,h.width,h.height,0,0,n,r);C&&this.canvasFactory.destroy(C);d&&this.canvasFactory.destroy(d);_.globalCompositeOperation="source-in";const E=Util.transform(getCurrentTransformInverse(_),[1,0,0,1,-A,-x]);_.fillStyle=s?a.getPattern(i,this,E,Bn,t):a;_.fillRect(0,0,n,r);l&&!s&&l.set(c,v.canvas);this.dependencyTracker?.recordDependencies(t,Rn);return{canvas:v.canvas,canvasEntry:l&&!s?null:v,offsetX:Math.round(A),offsetY:Math.round(x)}}setLineWidth(t,e){this.dependencyTracker?.recordSimpleData("lineWidth",t);e!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1);this.current.lineWidth=e;this.ctx.lineWidth=e}setLineCap(t,e){this.dependencyTracker?.recordSimpleData("lineCap",t);this.ctx.lineCap=Wn[e]}setLineJoin(t,e){this.dependencyTracker?.recordSimpleData("lineJoin",t);this.ctx.lineJoin=jn[e]}setMiterLimit(t,e){this.dependencyTracker?.recordSimpleData("miterLimit",t);this.ctx.miterLimit=e}setDash(t,e,i){this.dependencyTracker?.recordSimpleData("dash",t);const n=this.ctx;if(void 0!==n.setLineDash){n.setLineDash(e);n.lineDashOffset=i}}setRenderingIntent(t,e){}setFlatness(t,e){}setGState(t,e){for(const[i,n]of e)switch(i){case"LW":this.setLineWidth(t,n);break;case"LC":this.setLineCap(t,n);break;case"LJ":this.setLineJoin(t,n);break;case"ML":this.setMiterLimit(t,n);break;case"D":this.setDash(t,n[0],n[1]);break;case"RI":this.setRenderingIntent(t,n);break;case"FL":this.setFlatness(t,n);break;case"Font":this.setFont(t,n[0],n[1]);break;case"CA":this.dependencyTracker?.recordSimpleData("strokeAlpha",t);this.current.strokeAlpha=n;break;case"ca":this.dependencyTracker?.recordSimpleData("fillAlpha",t);this.ctx.globalAlpha=this.current.fillAlpha=n;break;case"BM":this.dependencyTracker?.recordSimpleData("globalCompositeOperation",t);this.ctx.globalCompositeOperation=n;break;case"SMask":this.dependencyTracker?.recordSimpleData("SMask",t);this.current.activeSMask=n?this.tempSMask:null;this.current.activeSMask&&(this.current.activeSMask.blendMode=this.ctx.globalCompositeOperation);this.tempSMask=null;this.checkSMaskState(t);break;case"TR":{this.dependencyTracker?.recordSimpleData("filter",t);let e=this.filterFactory.addFilter(n);this.ctx.filter=e;let i=null;if(n&&("none"===e||!FeatureTest.isCanvasFilterSupported||"none"===this.ctx.filter||""===this.ctx.filter)){this.ctx.filter=e="none";i=new TransferMapsFallback(n)}this.current.transferMaps=e;if(i||this.current.transferMapsFallback){this.current.transferMapsFallback=i;this.current.patternFill||(this.ctx.fillStyle=this.#Qn(this.current.fillColor));this.current.patternStroke||(this.ctx.strokeStyle=this.#Qn(this.current.strokeColor))}break}}}get inSMaskMode(){return!!this.suspendedCtx}_clearPreparedSMask(){if(this.smaskPreparedEntry){this.canvasFactory.destroy(this.smaskPreparedEntry);this.smaskPreparedEntry=null}this.smaskPreparedFor=null;this.smaskPreparedOffsetX=0;this.smaskPreparedOffsetY=0;this.smaskPreparedOOBAlpha=null}_ensurePreparedSMask(t){if(t!==this.smaskPreparedFor){this._clearPreparedSMask();this._prepareSMaskCanvas(t)}}checkSMaskState(t){const e=this.inSMaskMode;this.current.activeSMask&&!e?this.beginSMaskMode(t):!this.current.activeSMask&&e?this.endSMaskMode():this.current.activeSMask&&e&&this._ensurePreparedSMask(this.current.activeSMask)}_prepareSMaskCanvas(t){const{canvas:e,subtype:i,backdrop:n,transferMap:r}=t,s="Luminosity"===i||"Alpha"===i&&r;if(!(s||"Luminosity"===i&&n)){this.smaskPreparedFor=t;return}let a;if("Luminosity"===i&&n){const[t,e,i]=getRGBA(n),s=Math.round(.3*t+.59*e+.11*i);a=r?.[s]??s}else a=r?.[0]??0;const{width:o,height:l}=this.ctx.canvas,c=o*l<4*(e.width*e.height),h=s?{url:"Alpha"===i?this.filterFactory.addAlphaFilter(r):this.filterFactory.addLuminosityFilter(r),subtype:i,transferMap:r}:null,d="Luminosity"===i?n:null;let u,p,g;if(c){u=this._bakeSMaskCanvas(e,t.offsetX,t.offsetY,o,l,d,h);p=0;g=0}else{u=this._bakeSMaskCanvas(e,0,0,e.width,e.height,d,h);p=t.offsetX;g=t.offsetY}this.smaskPreparedEntry=u;this.smaskPreparedFor=t;this.smaskPreparedOffsetX=p;this.smaskPreparedOffsetY=g;this.smaskPreparedOOBAlpha=c||0===a?null:a}_bakeSMaskCanvas(t,e,i,n,r,s,a){s||a||unreachable("_bakeSMaskCanvas with neither backdrop nor filter");const o=this.canvasFactory.create(n,r),l=o.context;l.drawImage(t,e,i);if(s){l.globalCompositeOperation="destination-atop";l.fillStyle=s;l.fillRect(0,0,n,r)}if(!a)return o;const c=this.canvasFactory.create(n,r),h=c.context;h.filter=a.url;const d=FeatureTest.isCanvasFilterSupported&&"none"!==h.filter&&""!==h.filter;h.drawImage(o.canvas,0,0);FeatureTest.isCanvasFilterSupported&&(h.filter="none");if(!d){const t=h.getImageData(0,0,n,r),{data:e}=t,{transferMap:i}=a;if("Luminosity"===a.subtype)for(let t=0,n=e.length;tthis.filterFactory.addKnockoutFilter(i)));if(!o||"none"!==l){if(e){a.save();a.setTransform(1,0,0,1,0,0);a.clearRect(0,0,n,r);a.restore()}a.filter=l;a.drawImage(t,0,0);a.filter="none";return s}const c=t.getContext("2d",{willReadFrequently:!0}).getImageData(0,0,n,r),h=a.createImageData(n,r),d=c.data,u=h.data,p=i>0?1/i:1e6;for(let t=3,e=d.length;t0||!this.contentVisible)return!1;this.#Hn++;this.#Vn=t;const e=this.#Xn.at(-1),{canvas:i}=this.ctx,n=this.#tr(e,"knockoutTempEntry",i.width,i.height);this.#zn=n;const r=n.context;r.save();r.setTransform(this.ctx.getTransform());copyCtxState(this.ctx,r);this.#jn=r.globalCompositeOperation;r.globalCompositeOperation="source-over";mirrorContextOperations(r,this.ctx);this.#$n=e;this.#Gn=this.ctx;this.#Wn=this.suspendedCtx;this.ctx=r;this.inSMaskMode&&(this.suspendedCtx=r);return!0}#nr(t){if(!t)return;const e=this.#zn,i=this.#Gn,n=this.#Wn,r=e.context;this.#zn=null;this.#Gn=null;this.#Wn=null;this.inSMaskMode&&this.suspendedCtx===r&&this.ctx!==r&&this.endSMaskMode();this.inSMaskMode&&(this.suspendedCtx=n);this.ctx._removeMirroring();this.ctx.globalCompositeOperation=this.#jn;this.#jn=null;copyCtxState(this.ctx,i);this.ctx=i;const s=this.#$n;this.#$n=null;const a=this.#Vn;this.#Vn=1;try{this.#er(n??i,e.canvas,{backdropCanvas:s?.backdropCtx?.canvas??null,backdropOffset:s?.backdropCtx?[s.offsetX,s.offsetY]:[0,0],reuseMaskEntry:s?.knockoutMaskEntry??null,poolMeta:s,knockoutAlpha:a})}finally{r.restore();this.#Hn--;s||this.canvasFactory.destroy(e)}}compose(t){if(!this.current.activeSMask)return;t=t?[Math.floor(t[0]),Math.floor(t[1]),Math.ceil(t[2]),Math.ceil(t[3])]:[0,0,this.ctx.canvas.width,this.ctx.canvas.height];const e=this.current.activeSMask,i=this.suspendedCtx,n=this.#Hn>0&&i===this.ctx;this.composeSMask(n?null:i,e,this.ctx,t);if(!n){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(t,e,i,n){const r=n[0],s=n[1],a=n[2]-r,o=n[3]-s;if(0===a||0===o)return;const l=this.smaskPreparedEntry;if(l){let t=r,n=s,c=a,h=o;const d=this.smaskPreparedOOBAlpha,u=null!==d;if(u){t=Math.max(r,e.offsetX);n=Math.max(s,e.offsetY);c=Math.min(r+a,e.offsetX+e.canvas.width)-t;h=Math.min(s+o,e.offsetY+e.canvas.height)-n}if(c>0&&h>0){const e=t-this.smaskPreparedOffsetX,r=n-this.smaskPreparedOffsetY;i.save();i.globalAlpha=1;i.setTransform(1,0,0,1,0,0);const s=new Path2D;s.rect(t,n,c,h);i.clip(s);i.globalCompositeOperation="destination-in";i.drawImage(l.canvas,e,r,c,h,t,n,c,h);i.restore()}u&&d<255&&this._applySMaskOOBAlpha(i,r,s,a,o,t,n,t+c,n+h,d)}else this.genericComposeSMask(e,i,a,o,r,s);if(t){t.save();t.globalAlpha=1;t.globalCompositeOperation=e.blendMode||"source-over";t.setTransform(1,0,0,1,0,0);t.drawImage(i.canvas,r,s,a,o,r,s,a,o);t.restore()}}_applySMaskOOBAlpha(t,e,i,n,r,s,a,o,l,c){const h=sa.measureText(e))}if(d===Ii||d===Fi){this.dependencyTracker&&this.dependencyTracker?.recordCharacterBBox(t,a,l,h,i,n,()=>a.measureText(e)).recordDependencies(t,Pn);a.strokeText(e,i,n)}}if(u){(this.pendingTextPaths||=[]).push({transform:getCurrentTransform(a),x:i,y:n,fontSize:h,path:m});this.dependencyTracker?.recordCharacterBBox(t,a,l,h,i,n)}}get isFontSubpixelAAEnabled(){const t=this.canvasFactory.create(10,10),e=t.context;e.scale(1.5,1);e.fillText("I",0,10);const i=e.getImageData(0,0,10,10).data;this.canvasFactory.destroy(t);let n=!1;for(let t=3;t0&&i[t]<255){n=!0;break}return util_shadow(this,"isFontSubpixelAAEnabled",n)}#sr(t,e,i){const n=this.ctx;n.save();const r=t.getPattern(n,this,getCurrentTransformInverse(n),e,i),s=getCurrentTransform(n);n.restore();return[r,s]}showText(t,e){if(this.dependencyTracker){this.dependencyTracker.recordDependencies(t,Fn).resetBBox(t);this.current.textRenderingMode&Bi&&this.dependencyTracker.recordFutureForcedDependency("textClip",t).inheritPendingDependenciesAsFutureForcedDependencies()}const i=this.current,n=i.font;if(n.isType3Font){const n=this.#ir(i.fillAlpha);this.showType3Text(t,e);this.dependencyTracker?.recordShowTextOperation(t);this.#nr(n);return}const r=i.fontSize;if(0===r){this.dependencyTracker?.recordOperation(t);return}const s=this.#ir(i.fillAlpha),a=this.ctx,o=i.fontSizeScale,l=i.charSpacing,c=i.wordSpacing,h=i.fontDirection,d=i.textHScale*h,u=e.length,p=n.vertical,g=p?1:-1,m=r*i.fontMatrix[0],f=i.textRenderingMode===Di&&!n.disableFontFace&&!i.patternFill;a.save();i.textMatrix&&a.transform(...i.textMatrix);a.translate(i.x,i.y+i.textRise);h>0?a.scale(d,-1):a.scale(d,1);let b,y;const w=i.textRenderingMode&Ri,v=w===Di||w===Fi,_=w===Ii||w===Fi;let A=i.lineWidth;const x=i.textMatrixScale;0===x||0===A?_&&(A=this.getSinglePixelWidth()):A/=x;if(1!==o){a.scale(o,o);A/=o}a.lineWidth=A;v&&i.patternFill&&([a.fillStyle,b]=this.#sr(i.fillColor,Bn,t));_&&i.patternStroke&&([a.strokeStyle,y]=this.#sr(i.strokeColor,Ln,t));if(n.isInvalidPDFjsFont){const n=[];let r=0;for(const t of e){n.push(t.unicode);r+=t.width}const o=n.join("");a.fillText(o,0,0);if(null!==this.dependencyTracker){const e=a.measureText(o);this.dependencyTracker.recordBBox(t,this.ctx,-e.actualBoundingBoxLeft,e.actualBoundingBoxRight,-e.actualBoundingBoxAscent,e.actualBoundingBoxDescent).recordShowTextOperation(t)}i.x+=r*m*d;a.restore();this.compose();this.#nr(s);return}let C,E=0,S=null;for(C=0;C0){x??=a.measureText(w);const t=1e3*x.width/r*o;if(k[b?this.#sr(i.fillColor,Bn,t)[0]:a.fillStyle,y?this.#sr(i.strokeColor,Ln,t)[0]:a.strokeStyle])}if(this.contentVisible&&(s.isInFont||n.missingFile))if(f&&!v){a.fillText(w,_,A);this.dependencyTracker?.recordCharacterBBox(t,a,x?{bbox:null}:n,r/o,_,A,()=>x??a.measureText(w))}else{this.paintChar(t,w,_,A,b,y);if(v){const e=_+r*v.offset.x/o,i=A-r*v.offset.y/o;this.paintChar(t,v.fontChar,e,i,b,y)}}E+=p?T*m-u*h:T*m+u*h;d&&a.restore()}p?i.y-=E:i.x+=E*d;a.restore();this.compose();this.dependencyTracker?.recordShowTextOperation(t);this.#nr(s)}showType3Text(t,e){const i=this.ctx,n=this.current,r=n.font,s=n.fontSize,a=n.fontDirection,o=r.vertical?1:-1,l=n.charSpacing,c=n.wordSpacing,h=n.textHScale*a,d=n.fontMatrix||mi,u=e.length,p=n.textRenderingMode!==Oi;let g,m,f,b;if(0===s)return;this._cachedScaleForStroking[0]=-1;i.save();n.textMatrix&&i.transform(...n.textMatrix);i.translate(n.x,n.y+n.textRise);i.scale(h,a);const y=this.dependencyTracker;this.dependencyTracker=y?new CanvasNestedDependencyTracker(y,t):null;try{for(g=0;gnew CanvasGraphics(t,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack,pixelRatio:this.pixelRatio},void 0,void 0,this.dependencyTracker?new CanvasNestedDependencyTracker(this.dependencyTracker,e,!0):null)};i=new TilingPattern(e,this.ctx,n,t)}else i=this._getPattern(t,e[1],e[2]);return i}setStrokeColorN(t,...e){this.dependencyTracker?.recordSimpleData("strokeColor",t);this.current.strokeColor=this.getColorN_Pattern(t,e);this.current.patternStroke=!0}setFillColorN(t,...e){this.dependencyTracker?.recordSimpleData("fillColor",t);const i=this.current.fillColor=this.getColorN_Pattern(t,e);this.current.patternFill=!0;this.current.tilingPatternDims=i instanceof TilingPattern?[0,0,0,0]:null}#Qn(t){return this.current.transferMapsFallback?.applyToColor(t)??t}setStrokeRGBColor(t,e){this.dependencyTracker?.recordSimpleData("strokeColor",t);this.current.strokeColor=e;this.ctx.strokeStyle=this.#Qn(e);this.current.patternStroke=!1}setStrokeTransparent(t){this.dependencyTracker?.recordSimpleData("strokeColor",t);this.ctx.strokeStyle=this.current.strokeColor="transparent";this.current.patternStroke=!1}setFillRGBColor(t,e){this.dependencyTracker?.recordSimpleData("fillColor",t);this.current.fillColor=e;this.ctx.fillStyle=this.#Qn(e);this.current.patternFill=!1;this.current.tilingPatternDims=null}setFillTransparent(t){this.dependencyTracker?.recordSimpleData("fillColor",t);this.ctx.fillStyle=this.current.fillColor="transparent";this.current.patternFill=!1;this.current.tilingPatternDims=null}_getPattern(t,e,i=null){const n=this.cachedPatterns.getOrInsertComputed(e,()=>function getShadingPattern(t){switch(t[0]){case"RadialAxial":return new RadialAxialShadingPattern(t);case"Mesh":return new MeshShadingPattern(t);case"Dummy":return new DummyShadingPattern}throw new Error(`Unknown IR type: ${t[0]}`)}(this.getObject(t,e)));i&&(n.matrix=i);return n}shadingFill(t,e){if(!this.contentVisible)return;const i=this.#ir(this.current.fillAlpha),n=this.ctx;this.save(t);const r=this._getPattern(t,e);n.fillStyle=r.getPattern(n,this,getCurrentTransformInverse(n),Nn,t);const s=getCurrentTransformInverse(n);if(s){const{width:t,height:e}=n.canvas,i=gi.slice();Util.axialAlignedBoundingBox([0,0,t,e],s,i);const[r,a,o,l]=i;this.ctx.fillRect(r,a,o-r,l-a)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.dependencyTracker?.resetBBox(t).recordFullPageBBox(t).recordDependencies(t,On).recordDependencies(t,Mn).recordOperation(t);this.compose(this.current.getClippedPathBoundingBox());this.restore(t);this.#nr(i)}beginInlineImage(){unreachable("Should not call beginInlineImage")}beginImageData(){unreachable("Should not call beginImageData")}paintFormXObjectBegin(t,e,i){if(this.contentVisible){this.save(t);this.baseTransformStack.push(this.baseTransform);e&&this.transform(t,...e);this.baseTransform=getCurrentTransform(this.ctx);if(i){Util.axialAlignedBoundingBox(i,this.baseTransform,this.current.minMax);const[e,n,r,s]=i,a=new Path2D;a.rect(e,n,r-e,s-n);this.ctx.clip(a);this.dependencyTracker?.recordClipBox(t,this.ctx,e,r,n,s);this.endPath(t)}}}paintFormXObjectEnd(t){if(this.contentVisible){this.restore(t);this.baseTransform=this.baseTransformStack.pop()}}beginGroup(t,e){if(!this.contentVisible)return;this.save(t);const{inSMaskMode:i}=this;if(i){this.endSMaskMode();this.current.activeSMask=null}const n=this.ctx;if(!(e.needsIsolation&&(e.isolated||e.hasSoftMask)||e.knockout||e.isGray||0!==this.#Un||1!==n.globalAlpha||"source-over"!==n.globalCompositeOperation||i)){if(e.bbox){let t=new Path2D;const[i,r,s,a]=e.bbox;t.rect(i,r,s-i,a-r);if(e.matrix){const i=new Path2D;i.addPath(t,new DOMMatrix(e.matrix));t=i}n.clip(t)}this.groupStack.push(null);this.#Xn.push(null);this.groupLevel++;return}e.isolated||e.knockout||0!==this.#Un||info("TODO: Fully support non-isolated non-knockout groups.");const r=getCurrentTransform(n);e.matrix&&n.transform(...e.matrix);const s=[0,0,n.canvas.width,n.canvas.height];let a;if(e.bbox){a=gi.slice();Util.axialAlignedBoundingBox(e.bbox,getCurrentTransform(n),a);a=Util.intersect(a,s)||[0,0,0,0]}else a=s;const o=Math.floor(a[0]),l=Math.floor(a[1]),c=Math.max(Math.ceil(a[2])-o,1),h=Math.max(Math.ceil(a[3])-l,1);this.current.startNewPathAndClipBox([0,0,c,h]);const d=this.canvasFactory.create(c,h);e.smask&&this.smaskGroupCanvases.push(d);const u=d.context,p=e.knockout&&!e.isolated?n:null,g=!e.isolated&&!e.knockout&&!e.smask&&e.needsIsolation&&this.#Un>0,m=e.knockout?this.canvasFactory.create(c,h):null,f=this.#Un;e.knockout?this.#Un++:this.#Un=0;u.translate(-o,-l);u.transform(...r);const b=!e.isolated&&!e.smask&&e.needsIsolation,y=b&&!i&&0===f&&!e.knockout&&!e.isGray&&e.hasSoftMask&&1===n.globalAlpha&&"source-over"===n.globalCompositeOperation&&"none"===this.current.transferMaps&&!this.current.transferMapsFallback;if(b&&(i||y)){u.save();u.setTransform(1,0,0,1,0,0);u.drawImage(n.canvas,-o,-l);u.restore()}if(e.bbox){let t=new Path2D;const[i,n,r,s]=e.bbox;t.rect(i,n,r-i,s-n);if(e.matrix){const i=new Path2D;i.addPath(t,new DOMMatrix(e.matrix));t=i}u.clip(t)}e.smask&&this.smaskStack.push({canvas:d.canvas,context:u,offsetX:o,offsetY:l,subtype:e.smask.subtype,backdrop:e.smask.backdrop,transferMap:e.smask.transferMap||null});if(!e.smask||this.dependencyTracker){n.setTransform(1,0,0,1,0,0);n.translate(o,l);n.save()}copyCtxState(n,u);this.ctx=u;this.dependencyTracker?.inheritSimpleDataAsFutureForcedDependencies(["fillAlpha","strokeAlpha","globalCompositeOperation"]).pushBaseTransform(n);this.setGState(t,[["BM","source-over"],["ca",1],["CA",1],["TR",null]]);this.groupStack.push(n);this.#Xn.push({backdropCtx:p,savedKnockoutLevel:f,offsetX:o,offsetY:l,hasInnerBackdrop:g,replaceBackdrop:y,knockoutMaskEntry:m,knockoutTempEntry:null,knockoutBackdropEntry:null});this.groupLevel++}endGroup(t,e){if(!this.contentVisible)return;this.groupLevel--;const i=this.ctx,n=this.groupStack.pop(),r=this.#Xn.pop();r&&(this.#Un=r.savedKnockoutLevel);if(null!==n){e.isGray&&this.#ar(i);this.ctx=n;this.ctx.imageSmoothingEnabled=!1;this.dependencyTracker?.popBaseTransform();if(e.smask){this.tempSMask=this.smaskStack.pop();this.restore(t);if(this.dependencyTracker){this.ctx.restore();this.inSMaskMode&&this.ctx.setTransform(this.suspendedCtx.getTransform())}this.#Yn(r)}else{this.ctx.restore();const e=getCurrentTransform(this.ctx);this.restore(t);this.current.transferMapsFallback?.applyToCanvas(i);this.ctx.save();this.ctx.setTransform(...e);const s=gi.slice();Util.axialAlignedBoundingBox([0,0,i.canvas.width,i.canvas.height],e,s);const a=this.#Xn.at(-1);if(this.#Un>0)if(r.hasInnerBackdrop){const{width:t,height:s}=i.canvas,a=this.canvasFactory.create(t,s),o=a.context;o.drawImage(n.canvas,r.offsetX,r.offsetY,t,s,0,0,t,s);o.globalCompositeOperation="source-over";o.drawImage(i.canvas,0,0);const l=this.#Zn(i.canvas);o.globalCompositeOperation="destination-in";o.drawImage(l.canvas,0,0);const c=this.ctx.globalCompositeOperation,h=this.ctx.globalAlpha,d=this.ctx.filter;this.ctx.save();this.ctx.setTransform(...e);this.ctx.globalAlpha=1;FeatureTest.isCanvasFilterSupported&&(this.ctx.filter="none");this.ctx.globalCompositeOperation="destination-out";this.ctx.drawImage(l.canvas,0,0);this.ctx.globalCompositeOperation=c;this.ctx.globalAlpha=h;FeatureTest.isCanvasFilterSupported&&(this.ctx.filter=d??"none");this.ctx.drawImage(a.canvas,0,0);this.ctx.restore();this.canvasFactory.destroy(l);this.canvasFactory.destroy(a)}else{const t=a?.backdropCtx??null;this.#er(this.ctx,i.canvas,{backdropCanvas:t?.canvas??null,destTransform:e,backdropOffset:t?[a.offsetX+r.offsetX,a.offsetY+r.offsetY]:[0,0],sourceAlpha:this.ctx.globalAlpha,sourceFilter:this.ctx.filter})}else{if(r.replaceBackdrop){const t=new Path2D;t.rect(0,0,i.canvas.width,i.canvas.height);this.ctx.clip(t);this.ctx.globalCompositeOperation="copy"}this.ctx.drawImage(i.canvas,0,0)}this.ctx.restore();this.canvasFactory.destroy({canvas:i.canvas,context:i});this.#Yn(r);this.compose(s)}}else this.restore(t)}#ar(t){const{canvas:e}=t,{width:i,height:n}=e;if(FeatureTest.isCanvasFilterSupported){t.save();t.setTransform(1,0,0,1,0,0);t.filter="grayscale(1)";t.globalAlpha=1;t.globalCompositeOperation="copy";t.drawImage(e,0,0);t.restore();return}const r=t.getImageData(0,0,i,n),{data:s}=r;for(let t=0,e=s.length;tfunction getAnnotationCanvasName(t){return t._pdfjsCanvasName??null}(t)===a);-1===i?t.push(c):t[i]=c}else this.annotationCanvasMap.set(e,c);this.annotationCanvas.savedCtx=this.ctx;this.ctx=h;this.ctx.save();this.ctx.setTransform(Gn[0],0,0,-Gn[1],0,o*Gn[1]);resetCtxToDefault(this.ctx)}else{resetCtxToDefault(this.ctx);this.endPath(t);const e=new Path2D;e.rect(i[0],i[1],r,o);this.ctx.clip(e)}}this.current=new CanvasExtraState(this.ctx.canvas.width,this.ctx.canvas.height);this.baseTransformStack.push(this.baseTransform);this.transform(t,...n);this.transform(t,...r);this.baseTransform=getCurrentTransform(this.ctx)}endAnnotation(t){if(this.annotationCanvas){this.ctx.restore();this.#Jn();this.ctx=this.annotationCanvas.savedCtx;delete this.annotationCanvas.savedCtx;delete this.annotationCanvas}this.baseTransform=this.baseTransformStack.pop()}paintImageMaskXObject(t,e){if(!this.contentVisible)return;const i=e.count;(e=this.getObject(t,e.data,e)).count=i;const n=this.#ir(this.current.fillAlpha),r=this.ctx,s=this._createMaskCanvas(t,e),a=s.canvas;r.save();r.setTransform(1,0,0,1,0,0);r.drawImage(a,s.offsetX,s.offsetY);this.dependencyTracker?.resetBBox(t).recordBBox(t,this.ctx,s.offsetX,s.offsetX+a.width,s.offsetY,s.offsetY+a.height).recordOperation(t);r.restore();s.canvasEntry&&this.canvasFactory.destroy(s.canvasEntry);this.compose();this.#nr(n)}paintImageMaskXObjectRepeat(t,e,i,n=0,r=0,s,a){if(!this.contentVisible)return;e=this.getObject(t,e.data,e);const o=this.#ir(this.current.fillAlpha),l=this.ctx;l.save();const c=getCurrentTransform(l);l.transform(i,n,r,s,0,0);const h=this._createMaskCanvas(t,e);l.setTransform(1,0,0,1,h.offsetX-c[4],h.offsetY-c[5]);this.dependencyTracker?.resetBBox(t);for(let e=0,o=a.length;ee?c/e:1;a=l>e?l/e:1}}this._cachedScaleForStroking[0]=s;this._cachedScaleForStroking[1]=a}return this._cachedScaleForStroking}rescaleAndStroke(t,e){const{ctx:i,current:{lineWidth:n}}=this,[r,s]=this.getScaleForStroking();if(r===s){i.lineWidth=(n||1)*r;i.stroke(t);return}const a=CanvasGraphics.#Ln??=new DOMMatrix,o=i.getLineDash();e&&i.save();i.scale(r,s);a.a=1/r;a.d=1/s;const l=new Path2D;l.addPath(t,a);if(o.length>0){const t=Math.max(r,s);i.setLineDash(o.map(e=>e/t));i.lineDashOffset/=t}i.lineWidth=n||1;i.stroke(l);e&&i.restore()}isContentVisible(){for(let t=this.markedContentStack.length-1;t>=0;t--)if(!this.markedContentStack[t].visible)return!1;return!0}}for(const t in Vi)void 0!==CanvasGraphics.prototype[t]&&(CanvasGraphics.prototype[Vi[t]]=CanvasGraphics.prototype[t]);class DOMCanvasFactory extends BaseCanvasFactory{constructor({ownerDocument:t=globalThis.document,enableHWA:e=!1}){super({enableHWA:e});this._document=t}_createCanvas(t,e){const i=this._document.createElement("canvas");i.width=t;i.height=e;return i}}class DOMFilterFactory extends BaseFilterFactory{#or;#lr;#cr;#hr;#dr;#ur;#S=0;constructor({docId:t,ownerDocument:e=globalThis.document}){super();this.#hr=t;this.#dr=e}get#k(){return this.#lr||=new Map}get#pr(){return this.#ur||=new Map}get#gr(){if(!this.#cr){const t=this.#dr.createElement("div"),{style:e}=t;e.colorScheme="only light";e.visibility="hidden";e.contain="strict";e.width=e.height=0;e.position="absolute";e.top=e.left=0;e.zIndex=-1;const i=this.#dr.createElementNS(fi,"svg");i.setAttribute("width",0);i.setAttribute("height",0);this.#cr=this.#dr.createElementNS(fi,"defs");t.append(i);i.append(this.#cr);this.#dr.body.append(t)}return this.#cr}#mr(t){const toTable=t=>t&&Array.from(t,t=>t/255).join(",");if(1===t.length){const e=toTable(t[0]);return[e,e,e]}const[e,i,n]=t;return[toTable(e),toTable(i),toTable(n)]}#fr(t){if(void 0===this.#or){this.#or="";const t=this.#dr.URL;t!==this.#dr.baseURI&&(isDataScheme(t)?warn('#createUrl: ignore "data:"-URL for performance reasons.'):this.#or=updateUrlHash(t,""))}return`url(${this.#or}#${t})`}addFilter(t){if(!t)return"none";let e=this.#k.get(t);if(e)return e;const[i,n,r]=this.#mr(t),s=1===t.length?i:`${i}${n}${r}`;e=this.#k.get(s);if(e){this.#k.set(t,e);return e}const a=`g_${this.#hr}_transfer_map_${this.#S++}`,o=this.#fr(a);this.#k.set(t,o);this.#k.set(s,o);const l=this.#br(a);this.#yr(i,n,r,l);return o}addHCMFilter(t,e){const i=`${t}-${e}`,n="base";let r=this.#pr.get(n);if(r?.key===i)return r.url;if(r){r.filter?.remove();r.key=i;r.url="none";r.filter=null}else{r={key:i,url:"none",filter:null};this.#pr.set(n,r)}if(!t||!e)return r.url;const s=this.#wr(t);t=Util.makeHexColor(...s);const a=this.#wr(e);e=Util.makeHexColor(...a);this.#vr();if("#000000"===t&&"#ffffff"===e||t===e)return r.url;const o=Array.from({length:256},(t,e)=>computeLuminance(e/255)).join(","),l=`g_${this.#hr}_hcm_filter`,c=r.filter=this.#br(l);this.#yr(o,o,o,c);this.#_r(c);const getSteps=(t,e)=>{const i=s[t]/255,n=a[t]/255,r=new Array(e+1);for(let t=0;t<=e;t++)r[t]=i+t/e*(n-i);return r.join(",")};this.#yr(getSteps(0,5),getSteps(1,5),getSteps(2,5),c);r.url=this.#fr(l);return r.url}addSelectionHCMFilter(t,e){return this.addHighlightHCMFilter("selection",t,e,"HighlightText","Highlight")}addSelectionFilter(){return this.addHighlightHCMFilter("selection_default","black","white","HighlightText","Highlight")}createSelectionStyle(t=null){const e=t?this.addSelectionHCMFilter(t.foreground,t.background):this.addSelectionFilter();return"none"!==e&&FeatureTest.platform.isFirefox?{"backdrop-filter":e,"background-color":"transparent"}:null}addAlphaFilter(t){let e=this.#k.get(t);if(e)return e;const[i]=this.#mr([t]),n=`alpha_${i}`;e=this.#k.get(n);if(e){this.#k.set(t,e);return e}const r=`g_${this.#hr}_alpha_map_${this.#S++}`,s=this.#fr(r);this.#k.set(t,s);this.#k.set(n,s);const a=this.#br(r);this.#Ar(i,a);return s}addLuminosityFilter(t){let e,i,n=this.#k.get(t||"luminosity");if(n)return n;if(t){[e]=this.#mr([t]);i=`luminosity_${e}`}else i="luminosity";n=this.#k.get(i);if(n){this.#k.set(t,n);return n}const r=`g_${this.#hr}_luminosity_map_${this.#S++}`,s=this.#fr(r);this.#k.set(t,s);this.#k.set(i,s);const a=this.#br(r);this.#xr(a);t&&this.#Ar(e,a);return s}addKnockoutFilter(t=0){const e=t>0?Math.min(1/t,1e6):1e6,i=`knockout_${e}`,n=this.#k.get(i);if(n)return n;const r=`g_${this.#hr}_knockout_filter_${this.#S++}`,s=this.#fr(r);this.#k.set(i,s);const a=this.#br(r),o=this.#dr.createElementNS(fi,"feComponentTransfer");a.append(o);const l=this.#dr.createElementNS(fi,"feFuncA");l.setAttribute("type","linear");l.setAttribute("slope",`${e}`);l.setAttribute("intercept","0");o.append(l);return s}addHighlightHCMFilter(t,e,i,n,r){const s=`${e}-${i}-${n}-${r}`;let a=this.#pr.get(t);if(a?.key===s)return a.url;if(a){a.filter?.remove();a.key=s;a.url="none";a.filter=null}else{a={key:s,url:"none",filter:null};this.#pr.set(t,a)}if(!e||!i)return a.url;const[o,l]=[e,i].map(this.#wr.bind(this));let c=Math.round(.2126*o[0]+.7152*o[1]+.0722*o[2]),h=Math.round(.2126*l[0]+.7152*l[1]+.0722*l[2]),[d,u]=[n,r].map(this.#Cr.bind(this));h{const n=new Array(256),r=(h-c)/i,s=t/255,a=(e-t)/(255*i);let o=0;for(let t=0;t<=i;t++){const e=Math.round(c+t*r),i=s+t*a;for(let t=o;t<=e;t++)n[t]=i;o=e+1}for(let t=o;t<256;t++)n[t]=n[o-1];return n.join(",")},p=`g_${this.#hr}_hcm_${t}_filter`,g=a.filter=this.#br(p);this.#_r(g);this.#yr(getSteps(d[0],u[0],5),getSteps(d[1],u[1],5),getSteps(d[2],u[2],5),g);a.url=this.#fr(p);return a.url}destroy(t=!1){if(!t||!this.#ur?.size){this.#cr?.parentNode.parentNode.remove();this.#cr=null;this.#lr?.clear();this.#lr=null;this.#ur?.clear();this.#ur=null;this.#S=0}}#xr(t){const e=this.#dr.createElementNS(fi,"feColorMatrix");e.setAttribute("type","matrix");e.setAttribute("values","0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.3 0.59 0.11 0 0");t.append(e)}#_r(t){const e=this.#dr.createElementNS(fi,"feColorMatrix");e.setAttribute("type","matrix");e.setAttribute("values","0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0 0 0 1 0");t.append(e)}#br(t){const e=this.#dr.createElementNS(fi,"filter");e.setAttribute("color-interpolation-filters","sRGB");e.setAttribute("id",t);this.#gr.append(e);return e}#Er(t,e,i){if(!i)return;const n=this.#dr.createElementNS(fi,e);n.setAttribute("type","discrete");n.setAttribute("tableValues",i);t.append(n)}#yr(t,e,i,n){const r=this.#dr.createElementNS(fi,"feComponentTransfer");n.append(r);this.#Er(r,"feFuncR",t);this.#Er(r,"feFuncG",e);this.#Er(r,"feFuncB",i)}#Ar(t,e){const i=this.#dr.createElementNS(fi,"feComponentTransfer");e.append(i);this.#Er(i,"feFuncA",t)}#wr(t){this.#gr.style.color="CanvasText";this.#gr.style.backgroundColor=t;return getRGB(getComputedStyle(this.#gr).getPropertyValue("background-color"))}#Sr(t){this.#gr.style.color="CanvasText";this.#gr.style.backgroundColor=t;return getRGBA(getComputedStyle(this.#gr).getPropertyValue("background-color"))}#vr(){this.#gr.style.color="";this.#gr.style.backgroundColor=""}#Cr(t){const[e,i,n,r]=this.#Sr(t);if(1===r)return[e,i,n];const[s,a,o]=this.#wr("Canvas");return[blend(e,s,r),blend(i,a,r),blend(n,o,r)]}}function blend(t,e,i){return Math.round(i*t+(1-i)*e)}const $n=/\p{Cc}/u;function serializeFontFamily(t){if(function isCSSString(t){const e=t[0];if(t.length<2||'"'!==e&&"'"!==e||t.at(-1)!==e)return!1;const i=t.length-1;for(let n=1;n=i||$n.test(t[n])))return!1}return!0}(t))return t;return`"${t.replaceAll(/["\\\p{Cc}]/gu,t=>'"'===t||"\\"===t?`\\${t}`:`\\${t.codePointAt(0).toString(16)} `)}"`}class FontLoader{#Tr=new Set;#kr=new Set;#Pr=null;constructor({ownerDocument:t=globalThis.document,styleElement:e=null}){this._document=t;this.styleElement=null;this.loadingRequests=[];this.loadTestFontId=0}addNativeFontFace(t){this.#Tr.add(t);this._document.fonts.add(t)}removeNativeFontFace(t){this.#Tr.delete(t);this._document.fonts.delete(t)}insertRule(t){const e=this.#Mr();e.insertRule(t,e.cssRules.length)}#Mr(){if(this.#Pr)return this.#Pr;const t=this._document.defaultView?.CSSStyleSheet||globalThis.CSSStyleSheet;if(!this.styleElement&&t){const{adoptedStyleSheets:e}=this._document;if(e){const i=new t;e.push(i);return this.#Pr=i}}if(!this.styleElement){this.styleElement=this._document.createElement("style");this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement)}return this.#Pr=this.styleElement.sheet}clear(){for(const t of this.#Tr)this._document.fonts.delete(t);this.#Tr.clear();this.#kr.clear();if(this.#Pr){const{adoptedStyleSheets:t}=this._document;t?.includes(this.#Pr)&&(this._document.adoptedStyleSheets=t.filter(t=>t!==this.#Pr));this.#Pr=null}this.styleElement?.remove();this.styleElement=null}async loadSystemFont({systemFontInfo:t,disableFontFace:e,_inspectFont:i}){if(t&&!this.#kr.has(t.loadedName)){util_assert(!e,"loadSystemFont shouldn't be called when `disableFontFace` is set.");if(this.isFontLoadingAPISupported){const{loadedName:e,src:n,style:r}=t,s=new FontFace(e,n,r);this.addNativeFontFace(s);try{await s.load();this.#kr.add(e);i?.(t)}catch{warn(`Cannot load system font: ${t.baseFontName}, installing it could help to improve PDF rendering.`);this.removeNativeFontFace(s)}return}unreachable("Not implemented: loadSystemFont without the Font Loading API.")}}async bind(t){if(t.attached||t.missingFile&&!t.systemFontInfo)return;t.attached=!0;if(t.systemFontInfo){await this.loadSystemFont(t);return}if(this.isFontLoadingAPISupported){const e=t.createNativeFontFace();if(e){this.addNativeFontFace(e);try{await e.loaded}catch(i){warn(`Failed to load font '${e.family}': '${i}'.`);t.disableFontFace=!0;throw i}}return}const e=t.createFontFaceRule();if(e){this.insertRule(e);if(this.isSyncFontLoadingSupported)return;await this.#Dr(t)}}get isFontLoadingAPISupported(){return util_shadow(this,"isFontLoadingAPISupported",!!this._document?.fonts)}get isSyncFontLoadingSupported(){return util_shadow(this,"isSyncFontLoadingSupported",ui||FeatureTest.platform.isFirefox)}#Dr(t){const{loadingRequests:e}=this,{promise:i,resolve:n}=Promise.withResolvers(),r={done:!1,resolve:n};e.push(r);this._loadTestFont??=atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHD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E/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==");function int32(t,e){return t.charCodeAt(e)<<24|t.charCodeAt(e+1)<<16|t.charCodeAt(e+2)<<8|255&t.charCodeAt(e+3)}function spliceString(t,e,i,n){return t.substring(0,e)+n+t.substring(e+i)}let s,a;const o=this._document.createElement("canvas");o.width=1;o.height=1;const l=o.getContext("2d");let c=0;const h=`lt${Date.now()}${this.loadTestFontId++}`;let d=this._loadTestFont;d=spliceString(d,976,h.length,h);const u=1482184792;let p=int32(d,16);for(s=0,a=h.length-3;s>24&255,t>>16&255,t>>8&255,255&t)}(p));const g=`@font-face {font-family:"${h}";src:${`url(data:font/opentype;base64,${btoa(d)});`}}`;this.insertRule(g);const m=this._document.createElement("div");m.style.visibility="hidden";m.style.width=m.style.height="10px";m.style.position="absolute";m.style.top=m.style.left="0px";for(const e of[t.loadedName,h]){const t=this._document.createElement("span");t.textContent="Hi";t.style.fontFamily=e;m.append(t)}this._document.body.append(m);!function isFontReady(t,e){if(++c>30){warn("Load test font never loaded.");e();return}l.font="30px "+t;l.fillText(".",0,20);l.getImageData(0,0,1,1).data[3]>0?e():setTimeout(isFontReady.bind(null,t,e))}(h,()=>{m.remove();!function completeRequest(){util_assert(!r.done,"completeRequest() cannot be called twice.");r.done=!0;for(;e.length>0&&e[0].done;){const t=e.shift();setTimeout(t.resolve,0)}}()});return i}}class FontFaceObject{#Ir=new Map;#Fr;constructor(t,e=null,i,n){this.#Fr=t;this._inspectFont=e;i&&(this.charProcOperatorList=i);n&&Object.assign(this,n)}createNativeFontFace(){const{data:t}=this;if(!t||this.disableFontFace)return null;let e;if(this.cssFontInfo){const i={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(i.style=`oblique ${this.cssFontInfo.italicAngle}deg`);e=new FontFace(serializeFontFamily(this.cssFontInfo.fontFamily),t,i)}else e=new FontFace(this.loadedName,t,{});this._inspectFont?.(this);return e}createFontFaceRule(){const{data:t}=this;if(!t||this.disableFontFace)return null;const e=`url(data:${this.mimetype};base64,${t.toBase64()});`;let i;if(this.cssFontInfo){let t=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(t+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`);i=`@font-face {font-family:${serializeFontFamily(this.cssFontInfo.fontFamily)};${t}src:${e}}`}else i=`@font-face {font-family:"${this.loadedName}";src:${e}}`;this._inspectFont?.(this,e);return i}getPathGenerator(t,e){let i=this.#Ir.get(e);if(i)return i;const n=`${this.loadedName}_path_${e}`;let r;try{r=t.get(n)}catch(t){warn(`getPathGenerator - ignoring character: "${t}".`)}i=makePathFromDrawOPS(r?.path);this.fontExtraProperties||t.delete(n);this.#Ir.set(e,i);return i}get black(){return this.#Fr.black}get bold(){return this.#Fr.bold}get disableFontFace(){return this.#Fr.disableFontFace}set disableFontFace(t){util_shadow(this,"disableFontFace",!!t)}get fontExtraProperties(){return this.#Fr.fontExtraProperties}get isInvalidPDFjsFont(){return this.#Fr.isInvalidPDFjsFont}get isType3Font(){return this.#Fr.isType3Font}get italic(){return this.#Fr.italic}get missingFile(){return this.#Fr.missingFile}get remeasure(){return this.#Fr.remeasure}get vertical(){return this.#Fr.vertical}get bbox(){return this.#Fr.bbox}get fontMatrix(){return this.#Fr.fontMatrix}get fallbackName(){return this.#Fr.fallbackName}get loadedName(){return this.#Fr.loadedName}get mimetype(){return this.missingFile?null:"font/opentype"}get data(){return this.#Fr.data}clearData(){this.#Fr.clearData()}get cssFontInfo(){return this.#Fr.cssFontInfo}get systemFontInfo(){return this.#Fr.systemFontInfo}}class BasePDFStream{#Or=null;#Rr=null;_fullReader=null;_rangeReaders=new Set;_source=null;constructor(t,e,i){this._source=t;this.#Or=e;this.#Rr=i}get _progressiveDataLength(){return this._fullReader?._loaded??0}getFullReader(){util_assert(!this._fullReader,"BasePDFStream.getFullReader can only be called once.");return this._fullReader=new this.#Or(this)}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;const i=new this.#Rr(this,t,e);this._rangeReaders.add(i);return i}cancelAllRequests(t){this._fullReader?.cancel(t);for(const e of new Set(this._rangeReaders))e.cancel(t)}}class BasePDFStreamReader{onProgress=null;_contentLength=0;_filename=null;_headersCapability=Promise.withResolvers();_isRangeSupported=!1;_isStreamingSupported=!1;_loaded=0;_stream=null;constructor(t){this._stream=t}_callOnProgress(){this.onProgress?.({loaded:this._loaded,total:this._contentLength})}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){unreachable("Abstract method `read` called")}cancel(t){unreachable("Abstract method `cancel` called")}}class BasePDFStreamRangeReader{_stream=null;constructor(t,e,i){this._stream=t}async read(){unreachable("Abstract method `read` called")}cancel(t){unreachable("Abstract method `cancel` called")}}function createHeaders(t,e){const i=new Headers;if(!t||!e||"object"!=typeof e)return i;for(const t in e){const n=e[t];void 0!==n&&i.append(t,n)}return i}function getResponseOrigin(t){return URL.parse(t)?.origin??null}function validateRangeRequestCapabilities({responseHeaders:t,isHttp:e,rangeChunkSize:i,disableRange:n}){const r={contentLength:0,isRangeSupported:!1},s=parseInt(t.get("Content-Length"),10);if(!Number.isInteger(s))return r;r.contentLength=s;if(s<=2*i)return r;if(n||!e||"bytes"!==t.get("Accept-Ranges"))return r;"identity"===(t.get("Content-Encoding")||"identity")&&(r.isRangeSupported=!0);return r}function extractFilenameFromHeader(t){const e=t.get("Content-Disposition");if(e){let t=function getFilenameFromContentDispositionHeader(t){let e=!0,i=toParamRegExp("filename\\*","i").exec(t);if(i){i=i[1];let t=rfc2616unquote(i);t=unescape(t);t=rfc5987decode(t);t=rfc2047decode(t);return fixupEncoding(t)}i=function rfc2231getparam(t){const e=[];let i;const n=toParamRegExp("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;null!==(i=n.exec(t));){let[,t,n,r]=i;t=parseInt(t,10);if(t in e){if(0===t)break}else e[t]=[n,r]}const r=[];for(let t=0;tString.fromCharCode(parseInt(e,16))));try{n=atob(n)}catch{}return textdecode(e,n)})}return""}(e);if(t.includes("%"))try{t=decodeURIComponent(t)}catch{}if(isPdfFile(t))return t}return null}function createResponseError(t,e){return new ResponseException(`Unexpected server response (${t}) while retrieving PDF "${e.href}".`,t,404===t||0===t&&"file:"===e.protocol)}function ensureResponseOrigin(t,e){if(t!==e)throw new Error(`Expected range response-origin "${t}" to match "${e}".`)}function fetchUrl(t,e,i,n){return fetch(t,{method:"GET",headers:e,signal:n.signal,mode:"cors",credentials:i?"include":"same-origin",redirect:"follow"})}function ensureResponseStatus(t,e){if(200!==t&&206!==t)throw createResponseError(t,e)}function getArrayBuffer(t){if(t instanceof Uint8Array)return t.buffer;if(t instanceof ArrayBuffer)return t;throw new Error(`getArrayBuffer - unexpected data: ${t}`)}class PDFFetchStream extends BasePDFStream{_responseOrigin=null;constructor(t){super(t,PDFFetchStreamReader,PDFFetchStreamRangeReader);const{httpHeaders:e,url:i}=t;util_assert(/https?:/.test(i.protocol),"PDFFetchStream only supports http(s):// URLs.");this.headers=createHeaders(!0,e)}}class PDFFetchStreamReader extends BasePDFStreamReader{_abortController=new AbortController;_reader=null;constructor(t){super(t);const{disableRange:e,disableStream:i,rangeChunkSize:n,url:r,withCredentials:s}=t._source;this._isStreamingSupported=!i;const a=new Headers(t.headers);fetchUrl(r,a,s,this._abortController).then(i=>{t._responseOrigin=getResponseOrigin(i.url);ensureResponseStatus(i.status,r);this._reader=i.body.getReader();const s=i.headers,{contentLength:a,isRangeSupported:o}=validateRangeRequestCapabilities({responseHeaders:s,isHttp:!0,rangeChunkSize:n,disableRange:e});this._contentLength=a;this._isRangeSupported=o;this._filename=extractFilenameFromHeader(s);!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new AbortException("Streaming is disabled."));this._headersCapability.resolve()}).catch(this._headersCapability.reject)}async read(){await this._headersCapability.promise;const{value:t,done:e}=await this._reader.read();if(e)return{value:t,done:e};this._loaded+=t.byteLength;this._callOnProgress();return{value:getArrayBuffer(t),done:!1}}cancel(t){this._reader?.cancel(t).catch(()=>{});this._abortController.abort()}}class PDFFetchStreamRangeReader extends BasePDFStreamRangeReader{_abortController=new AbortController;_readCapability=Promise.withResolvers();_reader=null;constructor(t,e,i){super(t,e,i);const{url:n,withCredentials:r}=t._source,s=new Headers(t.headers);s.append("Range",`bytes=${e}-${i-1}`);fetchUrl(n,s,r,this._abortController).then(e=>{ensureResponseOrigin(getResponseOrigin(e.url),t._responseOrigin);ensureResponseStatus(e.status,n);this._reader=e.body.getReader();this._readCapability.resolve()}).catch(this._readCapability.reject);this._readCapability.promise.catch(()=>{})}async read(){await this._readCapability.promise;const{value:t,done:e}=await this._reader.read();return e?{value:t,done:e}:{value:getArrayBuffer(t),done:!1}}cancel(t){this._reader?.cancel(t).catch(()=>{});this._abortController.abort()}}function transport_stream_getArrayBuffer(t){return t instanceof Uint8Array&&t.byteLength===t.buffer.byteLength?t.buffer:new Uint8Array(t).buffer}function endRequests(){for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0}class PDFDataTransportStream extends BasePDFStream{_progressiveDone=!1;_queuedChunks=[];constructor(t){super(t,PDFDataTransportStreamReader,PDFDataTransportStreamRangeReader);const{pdfDataRangeTransport:e}=t,{initialData:i,progressiveDone:n}=e;if(i?.length>0){const t=transport_stream_getArrayBuffer(i);this._queuedChunks.push(t)}this._progressiveDone=n;e.transportReady(t=>{switch(t.type){case"range":case"progressiveRead":this.#Br(t.begin,t.chunk);break;case"progressiveDone":this._fullReader?.progressiveDone();this._progressiveDone=!0}})}#Br(t,e){const i=transport_stream_getArrayBuffer(e);if(void 0===t)this._fullReader?this._fullReader._enqueue(i):this._queuedChunks.push(i);else{const e=this._rangeReaders.keys().find(e=>e._begin===t);util_assert(e,"#onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.");e._enqueue(i)}}getFullReader(){const t=super.getFullReader();this._queuedChunks=null;return t}getRangeReader(t,e){const i=super.getRangeReader(t,e);if(i){i.onDone=()=>this._rangeReaders.delete(i);this._source.pdfDataRangeTransport.requestDataRange(t,e)}return i}cancelAllRequests(t){super.cancelAllRequests(t);this._source.pdfDataRangeTransport.abort()}}class PDFDataTransportStreamReader extends BasePDFStreamReader{#Lr=endRequests.bind(this);_done=!1;_queuedChunks=null;_requests=[];constructor(t){super(t);const{pdfDataRangeTransport:e,disableRange:i,disableStream:n}=t._source,{length:r,contentDispositionFilename:s}=e;this._queuedChunks=t._queuedChunks||[];for(const t of this._queuedChunks)this._loaded+=t.byteLength;this._done=t._progressiveDone;this._contentLength=r;this._isStreamingSupported=!n;this._isRangeSupported=!i;isPdfFile(s)&&(this._filename=s);this._headersCapability.resolve();const a=this._loaded;Promise.resolve().then(()=>{a>0&&this._loaded===a&&this._callOnProgress()})}_enqueue(t){if(!this._done){if(this._requests.length>0){this._requests.shift().resolve({value:t,done:!1})}else this._queuedChunks.push(t);this._loaded+=t.byteLength;this._callOnProgress()}}async read(){if(this._queuedChunks.length>0){return{value:this._queuedChunks.shift(),done:!1}}if(this._done)return{value:void 0,done:!0};const t=Promise.withResolvers();this._requests.push(t);return t.promise}cancel(t){this._done=!0;this.#Lr()}progressiveDone(){this._done||=!0;0===this._queuedChunks.length&&this.#Lr()}}class PDFDataTransportStreamRangeReader extends BasePDFStreamRangeReader{#Lr=endRequests.bind(this);onDone=null;_begin=-1;_done=!1;_queuedChunk=null;_requests=[];constructor(t,e,i){super(t,e,i);this._begin=e}_enqueue(t){if(!this._done){if(0===this._requests.length)this._queuedChunk=t;else{this._requests.shift().resolve({value:t,done:!1});this.#Lr()}this._done=!0;this.onDone?.()}}async read(){if(this._queuedChunk){const t=this._queuedChunk;this._queuedChunk=null;return{value:t,done:!1}}if(this._done)return{value:void 0,done:!0};const t=Promise.withResolvers();this._requests.push(t);return t.promise}cancel(t){this._done=!0;this.#Lr();this.onDone?.()}}class PDFNetworkStream extends BasePDFStream{#Nr=new WeakMap;_responseOrigin=null;constructor(t){super(t,PDFNetworkStreamReader,PDFNetworkStreamRangeReader);const{httpHeaders:e,url:i}=t;this.url=i;this.isHttp=/https?:/.test(i.protocol);this.headers=createHeaders(this.isHttp,e)}_request(t){const e=new XMLHttpRequest,i={validateStatus:null,onHeadersReceived:t.onHeadersReceived,onDone:t.onDone,onError:t.onError,onProgress:t.onProgress};this.#Nr.set(e,i);e.open("GET",this.url);e.withCredentials=this._source.withCredentials;for(const[t,i]of this.headers)e.setRequestHeader(t,i);if(this.isHttp&&"begin"in t&&"end"in t){e.setRequestHeader("Range",`bytes=${t.begin}-${t.end-1}`);i.validateStatus=t=>206===t||200===t}else i.validateStatus=t=>200===t;e.responseType="arraybuffer";util_assert(t.onError,"Expected `onError` callback to be provided.");e.onerror=()=>t.onError(e.status);e.onreadystatechange=this.#Ur.bind(this,e);e.onprogress=this.#Hr.bind(this,e);e.send(null);return e}#Hr(t,e){const i=this.#Nr.get(t);i?.onProgress?.(e)}#Ur(t,e){const i=this.#Nr.get(t);if(!i)return;if(t.readyState>=2&&i.onHeadersReceived){i.onHeadersReceived();delete i.onHeadersReceived}if(4!==t.readyState)return;if(!this.#Nr.has(t))return;this.#Nr.delete(t);if(0===t.status&&this.isHttp){i.onError(t.status);return}const n=t.status||200;if(!i.validateStatus(n)){i.onError(t.status);return}const r=function network_getArrayBuffer(t){return"string"!=typeof t?t:stringToBytes(t).buffer}(t.response);if(206===n){const e=t.getResponseHeader("Content-Range");if(/bytes \d+-\d+\/\d+/.test(e))i.onDone(r);else{warn('Missing or invalid "Content-Range" header.');i.onError(0)}}else r?i.onDone(r):i.onError(t.status)}_abortRequest(t){if(this.#Nr.has(t)){this.#Nr.delete(t);t.abort()}}getRangeReader(t,e){const i=super.getRangeReader(t,e);i&&(i.onClosed=()=>this._rangeReaders.delete(i));return i}}class PDFNetworkStreamReader extends BasePDFStreamReader{#Lr=endRequests.bind(this);_cachedChunks=[];_done=!1;_requests=[];_storedError=null;constructor(t){super(t);this._fullRequestXhr=t._request({onHeadersReceived:this.#zr.bind(this),onDone:this.#Gr.bind(this),onError:this.#Wr.bind(this),onProgress:this.#Hr.bind(this)})}#zr(){const t=this._stream,{disableRange:e,rangeChunkSize:i}=t._source,n=this._fullRequestXhr;t._responseOrigin=getResponseOrigin(n.responseURL);const r=n.getAllResponseHeaders(),s=new Headers(r?function trimHeadersEnd(t){let e=t.length;for(;e>0&&" "!==t[e-1]&&/\s/.test(t[e-1]);)e--;return t.slice(0,e)}(r.trimStart()).split(/[\r\n]+/).map(t=>{const[e,...i]=t.split(": ");return[e,i.join(": ")]}):[]),{contentLength:a,isRangeSupported:o}=validateRangeRequestCapabilities({responseHeaders:s,isHttp:t.isHttp,rangeChunkSize:i,disableRange:e});this._contentLength=a;this._isRangeSupported=o;this._filename=extractFilenameFromHeader(s);this._isRangeSupported&&t._abortRequest(n);this._headersCapability.resolve()}#Gr(t){if(this._requests.length>0){this._requests.shift().resolve({value:t,done:!1})}else this._cachedChunks.push(t);this._done=!0;0===this._cachedChunks.length&&this.#Lr()}#Wr(t){this._storedError=createResponseError(t,this._stream.url);this._headersCapability.reject(this._storedError);for(const t of this._requests)t.reject(this._storedError);this._requests.length=0;this._cachedChunks.length=0}#Hr(t){this.onProgress?.({loaded:t.loaded,total:t.lengthComputable?t.total:this._contentLength})}async read(){await this._headersCapability.promise;if(this._storedError)throw this._storedError;if(this._cachedChunks.length>0){return{value:this._cachedChunks.shift(),done:!1}}if(this._done)return{value:void 0,done:!0};const t=Promise.withResolvers();this._requests.push(t);return t.promise}cancel(t){this._done=!0;this._headersCapability.reject(t);this.#Lr();this._stream._abortRequest(this._fullRequestXhr);this._fullRequestXhr=null}}class PDFNetworkStreamRangeReader extends BasePDFStreamRangeReader{#Lr=endRequests.bind(this);onClosed=null;_done=!1;_queuedChunk=null;_requests=[];_storedError=null;constructor(t,e,i){super(t,e,i);this._requestXhr=t._request({begin:e,end:i,onHeadersReceived:this.#zr.bind(this),onDone:this.#Gr.bind(this),onError:this.#Wr.bind(this),onProgress:null})}#zr(){const t=getResponseOrigin(this._requestXhr?.responseURL);try{ensureResponseOrigin(t,this._stream._responseOrigin)}catch(t){this._storedError=t;this.#Wr(0)}}#Gr(t){if(this._requests.length>0){this._requests.shift().resolve({value:t,done:!1})}else this._queuedChunk=t;this._done=!0;this.#Lr();this.onClosed?.()}#Wr(t){this._storedError??=createResponseError(t,this._stream.url);for(const t of this._requests)t.reject(this._storedError);this._requests.length=0;this._queuedChunk=null}async read(){if(this._storedError)throw this._storedError;if(null!==this._queuedChunk){const t=this._queuedChunk;this._queuedChunk=null;return{value:t,done:!1}}if(this._done)return{value:void 0,done:!0};const t=Promise.withResolvers();this._requests.push(t);return t.promise}cancel(t){this._done=!0;this.#Lr();this._stream._abortRequest(this._requestXhr);this.onClosed?.()}}function getReadableStream(t,e=null){const i=process.getBuiltinModule("fs"),{Readable:n}=process.getBuiltinModule("stream"),r=i.createReadStream(t,e);return n.toWeb(r)}class PDFNodeStream extends BasePDFStream{constructor(t){super(t,PDFNodeStreamReader,PDFNodeStreamRangeReader);const{url:e}=t;util_assert("file:"===e.protocol,"PDFNodeStream only supports file:// URLs.")}}class PDFNodeStreamReader extends BasePDFStreamReader{_reader=null;constructor(t){super(t);const{disableRange:e,disableStream:i,rangeChunkSize:n,url:r}=t._source;this._isStreamingSupported=!i;process.getBuiltinModule("fs/promises").lstat(r).then(t=>{const i=getReadableStream(r);this._reader=i.getReader();const{size:s}=t;this._contentLength=s;this._isRangeSupported=!e&&s>2*n;!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new AbortException("Streaming is disabled."));this._headersCapability.resolve()}).catch(t=>{"ENOENT"===t.code&&(t=createResponseError(0,r));this._headersCapability.reject(t)})}async read(){await this._headersCapability.promise;const{value:t,done:e}=await this._reader.read();if(e)return{value:t,done:e};this._loaded+=t.byteLength;this._callOnProgress();return{value:getArrayBuffer(t),done:!1}}cancel(t){this._reader?.cancel(t).catch(()=>{})}}class PDFNodeStreamRangeReader extends BasePDFStreamRangeReader{_readCapability=Promise.withResolvers();_reader=null;constructor(t,e,i){super(t,e,i);const{url:n}=t._source;try{const t=getReadableStream(n,{start:e,end:i-1});this._reader=t.getReader();this._readCapability.resolve()}catch(t){this._readCapability.reject(t)}this._readCapability.promise.catch(()=>{})}async read(){await this._readCapability.promise;const{value:t,done:e}=await this._reader.read();return e?{value:t,done:e}:{value:getArrayBuffer(t),done:!1}}cancel(t){this._reader?.cancel(t).catch(()=>{})}}class GlobalWorkerOptions{static#jr=null;static#Vr=[];static#qr="";static#$r="";static get rendererPorts(){return this.#Vr}static set rendererPorts(t){if(!Array.isArray(t)||!t.every(t=>"undefined"!=typeof Worker&&t instanceof Worker))throw new Error("Invalid `rendererPorts` type.");this.#Vr=t}static get rendererSrc(){return this.#qr}static set rendererSrc(t){if("string"!=typeof t)throw new Error("Invalid `rendererSrc` type.");this.#qr=t}static get workerPort(){return this.#jr}static set workerPort(t){if(!("undefined"!=typeof Worker&&t instanceof Worker)&&null!==t)throw new Error("Invalid `workerPort` type.");this.#jr=t}static get workerSrc(){return this.#$r}static set workerSrc(t){if("string"!=typeof t)throw new Error("Invalid `workerSrc` type.");this.#$r=t}}class Metadata{#Xr;#Kr;constructor({parsedData:t,rawData:e}){this.#Xr=t;this.#Kr=e}getRaw(){return this.#Kr}get(t){return this.#Xr.get(t)??null}[Symbol.iterator](){return this.#Xr.entries()}}class CSS_FONT_INFO{static strings=["fontFamily","fontWeight","italicAngle"]}class SYSTEM_FONT_INFO{static strings=["css","loadedName","baseFontName","src"]}class FONT_INFO{static bools=["black","bold","disableFontFace","fontExtraProperties","isInvalidPDFjsFont","isType3Font","italic","missingFile","remeasure","vertical"];static strings=["fallbackName","loadedName"];static OFFSET_BBOX=Math.ceil(2*this.bools.length/8);static OFFSET_FONT_MATRIX=this.OFFSET_BBOX+1+8;static OFFSET_STRINGS=this.OFFSET_FONT_MATRIX+1+48}class PATTERN_INFO{static KIND=0;static HAS_BBOX=1;static HAS_BACKGROUND=2;static SHADING_TYPE=3;static N_COORD=4;static N_COLOR=8;static N_STOP=12;static N_FIGURES=16}class InfoUtils{static get decoder(){return util_shadow(this,"decoder",new TextDecoder)}static get encoder(){return util_shadow(this,"encoder",new TextEncoder)}}function readString(t,e,i,n=0){const{decoder:r}=InfoUtils;for(let t=0;t>i&3;return 0===n?void 0:2===n}get black(){return util_shadow(this,"black",this.#Zr(0))}get bold(){return util_shadow(this,"bold",this.#Zr(1))}get disableFontFace(){return util_shadow(this,"disableFontFace",this.#Zr(2))}get fontExtraProperties(){return util_shadow(this,"fontExtraProperties",this.#Zr(3))}get isInvalidPDFjsFont(){return util_shadow(this,"isInvalidPDFjsFont",this.#Zr(4))}get isType3Font(){return util_shadow(this,"isType3Font",this.#Zr(5))}get italic(){return util_shadow(this,"italic",this.#Zr(6))}get missingFile(){return util_shadow(this,"missingFile",this.#Zr(7))}get remeasure(){return util_shadow(this,"remeasure",this.#Zr(8))}get vertical(){return util_shadow(this,"vertical",this.#Zr(9))}#ts(t,e,i,n){const r=this.#Jr.getUint8(t++);if(0===r)return;util_assert(r===e,"Invalid array length.");const s=new Array(r);for(let e=0;e0){e=pi.slice();for(let t=0,i=l.length;t({...Promise.withResolvers(),data:Xn});class PDFObjects{#is=new Map;get(t,e=null,i=null){if(e){const n=this.#is.getOrInsertComputed(t,dataObj);n.promise.then(()=>e(n.data),i);return null}const n=this.#is.get(t);if(!n||n.data===Xn)throw new Error(`Requesting object that isn't resolved yet ${t}.`);return n.data}has(t){const e=this.#is.get(t);return!!e&&e.data!==Xn}delete(t){const e=this.#is.get(t);if(!e||e.data===Xn)return!1;this.#is.delete(t);return!0}resolve(t,e=null){const i=this.#is.getOrInsertComputed(t,dataObj);if(i.data!==Xn)throw new Error(`Object already resolved ${t}.`);i.data=e;i.resolve()}reject(t,e){const i=this.#is.getOrInsertComputed(t,dataObj);if(i.data===Xn){i.promise.catch(()=>{});i.reject(e)}}clear(){for(const{data:t}of this.#is.values())t?.bitmap?.close();this.#is.clear()}*[Symbol.iterator](){for(const[t,{data:e}]of this.#is)e!==Xn&&(yield[t,e])}}class ObjectHandler{constructor({messageHandler:t,commonObjs:e,fontLoader:i,pageCache:n,pdfBug:r=!1,shouldCreatePageObjs:s=!1}){this.messageHandler=t;this.commonObjs=e;this.fontLoader=i;this.pageCache=n;this.pdfBug=r;this.shouldCreatePageObjs=s}resolveCommonObject(t,e,i){if("CopyLocalImage"===e){const{imageRef:e}=i;util_assert(e,"The imageRef must be defined.");for(const i of this.pageCache.values()){const n=i.objs||i;for(const[,i]of n){if(i?.ref!==e)continue;if(!i.dataLen)return null;const n=structuredClone(i);this.commonObjs.resolve(t,n);return i.dataLen}}return null}switch(e){case"Font":if("error"in i){const e=i.error;warn(`Error during font loading: ${e}`);this.commonObjs.resolve(t,e);break}const n=new FontInfo(i.buffer),r=this.pdfBug&&globalThis.FontInspector?.enabled?(t,e)=>globalThis.FontInspector.fontAdded(t,e):null,s=new FontFaceObject(n,r,i.charProcOperatorList,i.extra);this.fontLoader.bind(s).catch(()=>this.messageHandler.sendWithPromise("FontFallback",{id:t}).catch(e=>{warn(`FontFallback failed for "${t}": ${e}`)})).finally(()=>{s.fontExtraProperties||s.clearData();this.commonObjs.resolve(t,s)});break;case"FontPath":this.commonObjs.resolve(t,new FontPathInfo(i));break;case"Image":this.commonObjs.resolve(t,i);break;case"Pattern":const a=new PatternInfo(i);this.commonObjs.resolve(t,a.getIR());break;default:throw new Error(`Got unknown common object type ${e}`)}return null}resolveObject(t,e,i,n){let r=this.pageCache.get(e);if(!r){if(!this.shouldCreatePageObjs)return!1;r=new PDFObjects;this.pageCache.set(e,r)}const s=r.objs||r;if(s.has(t))return!1;if(0===r._intentStates?.size){n?.bitmap?.close();return!1}switch(i){case"Image":case"Pattern":s.resolve(t,n);return!0;default:throw new Error(`Got unknown object type ${i}`)}}}const Kn=Symbol("INTERNAL");class OptionalContentGroup{#ns=!1;#rs=!1;#ss=!1;#as=!0;constructor(t,{name:e,intent:i,usage:n,rbGroups:r}){this.#ns=!!(t&yi);this.#rs=!!(t&wi);this.name=e;this.intent=i;this.usage=n;this.rbGroups=r}get visible(){if(this.#ss)return this.#as;if(!this.#as)return!1;const{print:t,view:e}=this.usage;return this.#ns?"OFF"!==e?.viewState:!this.#rs||"OFF"!==t?.printState}_setVisible(t,e,i=!1){t!==Kn&&unreachable("Internal method `_setVisible` called.");this.#ss=i;this.#as=e}get serializable(){return{userSet:this.#ss,visible:this.#as}}}class OptionalContentConfig{#os=null;#ls=new Map;#cs=null;#hs=null;#ds;creator=null;name=null;constructor(t,e=yi,i=null){this.#ds=t;this.renderingIntent=e;if(null!==t){this.name=t.name;this.creator=t.creator;this.#hs=t.order;for(const i of t.groups)this.#ls.set(i.id,new OptionalContentGroup(e,i));if(i){i.size!==this.#ls.size&&unreachable("Incorrect serialized groupState.");for(const[t,e]of i)this.#ls.get(t)._setVisible(Kn,e.visible,e.userSet)}else{if("OFF"===t.baseState)for(const t of this.#ls.values())t._setVisible(Kn,!1);for(const e of t.on)this.#ls.get(e)._setVisible(Kn,!0);for(const e of t.off)this.#ls.get(e)._setVisible(Kn,!1)}this.#cs=this.getHash()}}#us(t){const e=t.length;if(e<2)return!0;const i=t[0];for(let n=1;nt===e+1)&&(this.#ps=null)}deletePages(t){this.#ws();const e=this.#ps,i=this.#vs();this.#ys={pageNumberToId:e.slice(),pagesNumber:this.#ms,prevPageNumbers:this.#gs.slice()};const n=this.#ms-t.length;this.#ms=n;const r=this.#ps=new Uint32Array(n);this.#gs=new Int32Array(n);let s=0,a=0;for(const i of t){const t=i-1;if(t!==s){r.set(e.subarray(s,t),a);a+=t-s}s=t+1}sthis.#ps[t-1])}}cancelCopy(){this.#bs=null}pastePages(t){this.#ws();const e=this.#ps,i=this.#vs(),{pageNumbers:n,pageIds:r}=this.#bs,s=this.#ms+n.length;this.#ms=s;const a=this.#ps=new Uint32Array(s);this.#gs=new Int32Array(s);a.set(e.subarray(0,t),0);a.set(r,t);a.set(e.subarray(t),t+n.length);this.#_s(i,null,t,n);this.#bs=null}#_s(t,e=null,i=-1,n=null){const r=this.#gs,s=this.#ps,a=i+(n?.length??0),o=new Map;for(let l=0,c=this.#ms;l=i&&lt[0]-e[0]);for(let i=0,n=t.length;it-e);const e=new Map;for(let i=0,n=t.length;i{if(!this.#Cs)throw t;return{operatorListIdx:e,aborted:!0}});if(l.aborted&&!this.#Cs)throw new Error("Render task was aborted in the renderer worker.");if(r&&l.operatorListIdx===s){this.#Is.delete(this.#S);const{recordedBBoxesBuffer:t,imageCoordinates:e}=l;t&&(this.recordedBBoxes=BBoxReader.fromBuffer(t));this.imageCoordinates=e??null}return l.operatorListIdx}cancel(){this.#Cs=!0;this.#Is.delete(this.#S);this.#Ds.messageHandler?.send("CleanupRenderTask",{renderTaskId:this.#S})}drawFrame(t){try{if(t.bitmap){this.#Ss.getNoAlphaContext(this.#Es).drawImage(t.bitmap,0,0)}t.annotationBitmaps&&this.#Fs(t.annotationBitmaps)}catch(t){this.#Wr(t);return}finally{closeFrame(t)}this.#Ps()}#Fs(t){const e=this.#xs,i=new Set;for(const[n,r,s]of t){const{canvas:t,context:a}=this.#Ss.create(s.width,s.height);a.drawImage(s,0,0);if(r){setAnnotationCanvasName(t,r);if(i.has(n))e.get(n).push(t);else{i.add(n);e.set(n,[t])}}else e.set(n,t)}}}class RendererWorker{#Os=Promise.withResolvers();#hn;#Rs;#Bs=null;#Ls=0;#Ns=new WeakMap;#Us=[];#Nr=new Set;#jr=null;#Hs=null;#zs=0;#Is=new Map;#Gs=null;#Ws=null;#js=null;static#Vs=0;static#qs=new WeakSet;destroyed=!1;constructor({port:t=null,verbosity:e=getVerbosityLevel(),enableHWA:i=!1,enableWebGPU:n=!1}={}){this.verbosity=e;this.#hn=i;this.#Rs=n;t?this.#$s(t):this.#Xs()}static get isAvailable(){return(!!GlobalWorkerOptions.rendererSrc||GlobalWorkerOptions.rendererPorts.length>0)&&"undefined"!=typeof Worker&&FeatureTest.isOffscreenCanvasSupported&&!!globalThis.document?.fonts}get promise(){return this.#Os.promise}get messageHandler(){return this.#Bs}get port(){return this.#jr}#Ks(){this.#Bs.on("RenderFrame",t=>{const e=this.#Is.get(t.renderTaskId);e?e.drawFrame(t):closeFrame(t)});this.#Os.resolve();this.#Bs.send("configure",{verbosity:this.verbosity,enableHWA:this.#hn,enableWebGPU:this.#Rs});const t=this.#Us;this.#Us=null;for(const e of t)e()}#Ys(t){this.#Us=null;this.#Os.reject(t)}#$s(t){RendererWorker.#qs.add(t);this.#jr=t;const e=RendererWorker.#Vs++,i=`main${e}`,n=`renderer${e}`;this.#Hs={sourceName:i,targetName:n};const r=new MessageHandler("main","renderer",t);r.send("Connect",{sourceName:n,targetName:i});r.destroy();this.#Js(t,new MessageHandler(i,n,t),!0)}#Xs(){try{const{rendererSrc:t}=GlobalWorkerOptions;if(!t)throw new Error('No "GlobalWorkerOptions.rendererSrc" specified.');const e=new Worker(getWorkerSrc(t),{type:"module"});this.#Js(e,new MessageHandler("main","renderer",e),!1)}catch(t){this.#Ys(t)}}#Js(t,e,i){let n=null;const terminateEarly=s=>{this.#Gs=null;clearTimeout(n);r.abort();e.destroy();i?this.#jr=null:t.terminate();this.#Ys(new Error(`Renderer worker failed to initialize: "${s?.message??s}".`))};this.#Gs=terminateEarly;const r=new AbortController,onError=(t,e)=>{if(this.#Bs){t.preventDefault();warn(`Renderer worker failed: "${e}". Falling back to main-thread rendering.`);this.destroy()}else terminateEarly(e)};t.addEventListener("error",t=>onError(t,t.error?.message??t.message),{signal:r.signal});t.addEventListener("messageerror",t=>onError(t,"Cannot deserialize a message."),{signal:r.signal});i&&(n=setTimeout(()=>terminateEarly("Connection timed out."),5e3));e.on("ready",s=>{if(!(s?.testObj instanceof Uint8Array)){terminateEarly("TypedArray transfer test failed.");return}const a="6.5.438";if(a===s.workerVersion){this.#Gs=null;clearTimeout(n);this.#Bs=e;i||(this.#Ws=t);this.#js=r;this.#Ks()}else terminateEarly(`The API version "${a}" does not match the Worker version "${s.workerVersion}".`)})}destroy(){this.destroyed=!0;if(this.#jr){if(this.#Bs){this.#Qs(this.#jr);this.#Bs.send("Disconnect",null)}RendererWorker.#qs.delete(this.#jr);this.#jr=null}this.#Gs?.("Worker was destroyed.");this.#js?.abort();this.#js=null;this.#Ws?.terminate();this.#Ws=null;this.#Bs?.destroy();this.#Bs=null;for(const t of this.#Nr)t(new Error("Renderer worker was destroyed."));this.#Nr.clear()}#Qs(t){const{sourceName:e,targetName:i}=this.#Hs,n=new AbortController,r=setTimeout(()=>n.abort(),5e3);t.addEventListener("message",({data:t})=>{if(t?.targetName===e&&t.sourceName===i)if("RenderFrame"===t.action)closeFrame(t.data);else if("Disconnected"===t.action){clearTimeout(r);n.abort()}},{signal:n.signal})}static create({ports:t=[],...e}={}){const i=t.find(t=>!this.#qs.has(t))??null;!i&&t.length>0&&warn("RendererWorker.create - no unused `rendererPorts` available, falling back to `rendererSrc`.");return new RendererWorker({...e,port:i})}sendWithPromise(t,e){const i=this.#Bs;if(!i)return Promise.reject(new Error("Renderer worker was destroyed."));const{promise:n,resolve:r,reject:s}=Promise.withResolvers();this.#Nr.add(s);i.sendWithPromise(t,e).then(r,s);return n.finally(()=>{this.#Nr.delete(s)})}#Zs(t,e){this.#Us?this.#Us.push(()=>this.#Zs(t,e)):this.#Bs?.send(t,e)}#ta(t,e,i,n,r=!1){try{if(this.#Us){const s=r?structuredClone(e):e;this.#Us.push(()=>this.#ta(t,s,i,n));return}this.#Bs?.send(t,e)}catch(e){warn(`RendererWorker - failed to send "${t}": ${e}`);this.#Zs("objFailed",{id:i,pageProxyId:n,reason:e.message})}}sendCommonObj(t,e,i){this.#ta("commonobj",[t,e,i],t,null,"Font"===e)}sendObj(t,e,i,n){this.#ta("obj",[t,e,i,n],t,e)}cleanup(t){this.#Zs("Cleanup",{keepLoadedFonts:t})}cleanupPage(t){this.#Zs("cleanupPage",{pageProxyId:t})}createRenderTask({pageProxyId:t,operatorList:e,params:i,pageColors:n,canvasFactory:r,annotationCanvasMap:s,onFrame:a,onError:o}){const{canvas:l,canvasContext:c,background:h}=i;if(!this.#Bs&&!this.#Us||c||h&&"string"!=typeof h||n||i.recordForDebugger)return null;const d=this.#Ns.getOrInsertComputed(e,()=>({id:this.#Ls++,sentLength:0}));return new WorkerRenderTask({rendererWorker:this,renderTasks:this.#Is,canvas:l,canvasFactory:r,annotationCanvasMap:s,operatorListState:d,initParams:{pageProxyId:t,operatorListId:d.id,renderTaskId:this.#zs++,hasAnnotationCanvasMap:!!s,recordOperations:i.recordOperations,recordImages:i.recordImages,partialFrames:i.partialFrames,transform:i.transform,viewport:i.viewport,background:h,pixelRatio:OutputScale.pixelRatio},onFrame:a,onError:o})}}class TextLayer{#Os=Promise.withResolvers();#Pt=null;#ea=!1;#ia=!!globalThis.FontInspector?.enabled;#na=null;#ra=null;#sa=null;#aa=0;#oa=0;#la=OutputScale.pixelRatio;#ca=null;#ha=null;#da=0;#ua=0;#pa=Object.create(null);#ga=[];#ma=null;#fa=[];#ba=null;static#ya=new Map;static#wa=new Map;static#va=new WeakMap;static#_a=null;static#Aa=new Set;constructor({textContentSource:t,images:e,container:i,viewport:n}){if(t instanceof ReadableStream)this.#ma=t;else{if("object"!=typeof t)throw new Error('No "textContentSource" parameter specified.');this.#ma=new ReadableStream({start(e){e.enqueue(t);e.close()}})}this.#Pt=this.#ha=i;this.#na=e;this.#ua=n.scale*this.#la;this.#da=n.rotation;this.#sa={div:null,properties:null,ctx:null};const{pageWidth:r,pageHeight:s,pageX:a,pageY:o}=n.rawDims;this.#ba=[1,0,0,-1,-a,o+s];this.#oa=r;this.#aa=s;TextLayer.#xa();i.style.setProperty("--min-font-size",TextLayer.#_a);setLayerDimensions(i,n);this.#Os.promise.finally(()=>{TextLayer.#Aa.delete(this);this.#sa=null;this.#pa=null}).catch(()=>{})}static get fontFamilyMap(){const{isWindows:t,isFirefox:e}=FeatureTest.platform;return util_shadow(this,"fontFamilyMap",new Map([["sans-serif",(t&&e?"Calibri, ":"")+"sans-serif"],["monospace",(t&&e?"Lucida Console, ":"")+"monospace"]]))}render(){this.#na&&this.#Pt.append(this.#na.render());const pump=()=>{this.#ca.read().then(({value:t,done:e})=>{if(e)this.#Os.resolve();else{this.#ra??=t.lang;Object.assign(this.#pa,t.styles);this.#Ca(t.items);pump()}},this.#Os.reject)};this.#ca=this.#ma.getReader();TextLayer.#Aa.add(this);pump();return this.#Os.promise}update({viewport:t}){const e=t.scale*OutputScale.pixelRatio,i=t.rotation;if(i!==this.#da){this.#da=i;setLayerDimensions(this.#ha,{rotation:i})}if(e!==this.#ua){this.#ua=e;this.#la=OutputScale.pixelRatio}}cancel(){const t=new AbortException("TextLayer task cancelled.");this.#ca?.cancel(t).catch(()=>{});this.#ca=null;this.#Os.reject(t)}get textDivs(){return this.#fa}get textContentItemsStr(){return this.#ga}#Ca(t){if(this.#ea)return;this.#sa.ctx??=TextLayer.#Ea(this.#ra);const e=this.#fa,i=this.#ga;for(const n of t){if(e.length>1e5){warn("Ignoring additional textDivs for performance reasons.");this.#ea=!0;return}if(void 0!==n.str){i.push(n.str);this.#Sa(n)}else if("beginMarkedContentProps"===n.type||"beginMarkedContent"===n.type){const t=this.#Pt;this.#Pt=document.createElement("span");this.#Pt.classList.add("markedContent");n.id&&this.#Pt.setAttribute("id",n.id);"Artifact"===n.tag&&(this.#Pt.ariaHidden=!0);t.append(this.#Pt)}else"endMarkedContent"===n.type&&(this.#Pt=this.#Pt.parentNode)}}#Sa(t){const e=document.createElement("span"),i={angle:0,canvasWidth:0,hasText:""!==t.str,hasEOL:t.hasEOL,fontSize:0};this.#fa.push(e);const n=Util.transform(this.#ba,t.transform);let r=Math.atan2(n[1],n[0]);const s=this.#pa[t.fontName];s.vertical&&(r+=Math.PI/2);let a=this.#ia&&s.fontSubstitution||s.fontFamily;a=TextLayer.fontFamilyMap.get(a)||a;const o=Math.hypot(n[2],n[3]),l=o*TextLayer.#Ta(a,s,this.#ra);let c,h;if(0===r){c=n[4];h=n[5]-l}else{c=n[4]+l*Math.sin(r);h=n[5]-l*Math.cos(r)}const d=e.style;d.left=`${(100*c/this.#oa).toFixed(2)}%`;d.top=`${(100*h/this.#aa).toFixed(2)}%`;const u=Math.round(100*o)/100;d.setProperty("--font-height",`${u}px`);d.fontFamily=a;i.fontSize=u;e.setAttribute("role","presentation");e.textContent=t.str;e.dir=t.dir;this.#ia&&(e.dataset.fontName=s.fontSubstitutionLoadedName||t.fontName);0!==r&&(i.angle=r*(180/Math.PI));let p=!1;if(t.str.length>1)p=!0;else if(" "!==t.str&&t.transform[0]!==t.transform[3]){const e=Math.abs(t.transform[0]),i=Math.abs(t.transform[3]);e!==i&&Math.max(e,i)/Math.min(e,i)>1.5&&(p=!0)}p&&(i.canvasWidth=s.vertical?t.height:t.width);this.#sa.div=e;this.#sa.properties=i;this.#ka(this.#sa);i.hasText&&this.#Pt.append(e);if(i.hasEOL){const t=document.createElement("br");t.setAttribute("role","presentation");this.#Pt.append(t)}}#ka(t){const{div:e,properties:i,ctx:n}=t,{style:r}=e,{canvasWidth:s,fontSize:a}=i;if(0!==s&&0!==a&&i.hasText){const{fontFamily:t}=r,i=this.#la,o=TextLayer.#Pa(a*this.#ua/i)*i;TextLayer.#Ma(n,o,t);const{width:l}=n.measureText(e.textContent);l>0&&r.setProperty("--scale-x",s*o/(l*a))}0!==i.angle&&r.setProperty("--rotate",`${i.angle}deg`)}static cleanup(){if(!(this.#Aa.size>0)){this.#ya.clear();for(const{canvas:t}of this.#wa.values())t.remove();this.#wa.clear()}}static#Ea(t=null){let e=this.#wa.get(t||="");if(!e){const i=document.createElement("canvas");i.style.cssText="position:absolute;top:0;left:0;width:0;height:0;display:none;letter-spacing:normal;word-spacing:normal";i.lang=t;document.body.append(i);e=i.getContext("2d",{alpha:!1,willReadFrequently:!0});this.#wa.set(t,e);this.#va.set(e,{size:0,family:""})}return e}static#Pa(t){t=Math.fround(t);const e=Math.fround(131073*t);return Math.fround(e-Math.fround(e-t))}static#Ma(t,e,i){const n=this.#va.get(t);if(e!==n.size||i!==n.family){t.font=`${e}px ${i}`;n.size=e;n.family=i}}static#xa(){if(null!==this.#_a)return;const t=document.createElement("div");t.style.opacity=0;t.style.lineHeight=1;t.style.fontSize="1px";t.style.position="absolute";t.textContent="X";document.body.append(t);this.#_a=t.getBoundingClientRect().height;t.remove()}static#Ta(t,e,i){const n=this.#ya.get(t);if(n)return n;const r=this.#Ea(i);this.#Ma(r,30,t);const s=r.measureText(""),a=s.fontBoundingBoxAscent,o=Math.abs(s.fontBoundingBoxDescent);let l=.8;if(a)l=a/(a+o);else{FeatureTest.platform.isFirefox&&warn("Enable the `dom.textMetrics.fontBoundingBox.enabled` preference in `about:config` to improve TextLayer rendering.");e.ascent?l=e.ascent:e.descent&&(l=1+e.descent)}this.#ya.set(t,l);return l}}function getDocument(t={}){const e=new PDFDocumentLoadingTask,{docId:i}=e,n=t.url?function getUrlProp(t){if(t instanceof URL)return t;if("string"==typeof t){if(ui){if(/^[a-z][a-z0-9\-+.]+:/i.test(t))return new URL(t);const e=process.getBuiltinModule("url");return new URL(e.pathToFileURL(t))}const e=URL.parse(t,window.location);if(e)return e}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}(t.url):null,r=t.data?function getDataProp(t){if(ui&&"undefined"!=typeof Buffer&&t instanceof Buffer)throw new Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");if(t instanceof Uint8Array&&t.byteLength===t.buffer.byteLength)return t;if("string"==typeof t)return stringToBytes(t);if(t instanceof ArrayBuffer||ArrayBuffer.isView(t)||"object"==typeof t&&!isNaN(t?.length))return new Uint8Array(t);throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")}(t.data):null,s=t.httpHeaders||null,a=!0===t.withCredentials,o=t.password??null,l=t.range instanceof PDFDataRangeTransport?t.range:null,c=Number.isInteger(t.rangeChunkSize)&&t.rangeChunkSize>0?t.rangeChunkSize:65536;let h=t.worker instanceof PDFWorker?t.worker:null;const d=t.verbosity,u="string"!=typeof t.docBaseUrl||isDataScheme(t.docBaseUrl)?null:t.docBaseUrl,p=getFactoryUrlProp(t.cMapUrl),g=!1!==t.cMapPacked,m=getFactoryUrlProp(t.iccUrl),f=getFactoryUrlProp(t.standardFontDataUrl),b=getFactoryUrlProp(t.wasmUrl),y=!0!==t.stopAtErrors,w=Number.isInteger(t.maxImageSize)&&t.maxImageSize>-1?t.maxImageSize:-1,v="boolean"==typeof t.isOffscreenCanvasSupported?t.isOffscreenCanvasSupported:!ui,_="boolean"==typeof t.isImageDecoderSupported?t.isImageDecoderSupported:!ui,A=Number.isInteger(t.canvasMaxAreaInBytes)?t.canvasMaxAreaInBytes:-1,x="boolean"==typeof t.disableFontFace?t.disableFontFace:ui,C=!0===t.fontExtraProperties,E=!0===t.enableXfa,S=t.ownerDocument||globalThis.document,T=!0===t.disableRange,k=!0===t.disableStream,P=!0===t.disableAutoFetch,M=!0===t.pdfBug,D=t.CanvasFactory||(ui?NodeCanvasFactory:DOMCanvasFactory),I=t.FilterFactory||(ui?NodeFilterFactory:DOMFilterFactory),O=t.BinaryDataFactory||(ui?NodeBinaryDataFactory:DOMBinaryDataFactory),R=!0===t.enableHWA,B=!0===t.enableWebGPU;B&&initGPU();const L=!1!==t.useWasm,N=t.pagesMapper||new PagesMapper,U="boolean"==typeof t.useSystemFonts?t.useSystemFonts:!ui&&!x,H="boolean"==typeof t.useWorkerFetch?t.useWorkerFetch:!!(O===DOMBinaryDataFactory&&p&&g&&f&&b&&isValidFetchUrl(p,document.baseURI)&&isValidFetchUrl(f,document.baseURI)&&isValidFetchUrl(b,document.baseURI)),z=!0===t.disableWorkerRendering||!v||S!==globalThis.document||!RendererWorker.isAvailable;setVerbosityLevel(d);const G={canvasFactory:new D({ownerDocument:S,enableHWA:R}),filterFactory:new I({docId:i,ownerDocument:S}),binaryDataFactory:H?null:new O({cMapUrl:p,standardFontDataUrl:f,wasmUrl:b})};if(!h){h=PDFWorker.create({verbosity:d,port:GlobalWorkerOptions.workerPort});e._worker=h}if(!z){const t=RendererWorker.create({verbosity:d,enableHWA:R,enableWebGPU:B,ports:GlobalWorkerOptions.rendererPorts});t.promise.catch(e=>{if(!t.destroyed){warn(`Renderer worker disabled: ${e.message}`);t.destroy()}});e._rendererWorker=t}const W={docId:i,apiVersion:"6.5.438",data:r,password:o,disableAutoFetch:P,rangeChunkSize:c,docBaseUrl:u,enableXfa:E,evaluatorOptions:{maxImageSize:w,disableFontFace:x,ignoreErrors:y,isOffscreenCanvasSupported:v,isImageDecoderSupported:_,canvasMaxAreaInBytes:A,fontExtraProperties:C,useSystemFonts:U,useWasm:L,useWorkerFetch:H,cMapUrl:p,cMapPacked:g,iccUrl:m,standardFontDataUrl:f,wasmUrl:b}},j={ownerDocument:S,pdfBug:M,styleElement:null,rendererWorker:e._rendererWorker,enableWebGPU:B,loadingParams:{disableAutoFetch:P,enableXfa:E}};h.promise.then(function(){if(h.destroyed)throw new Error("Worker was destroyed");const t=h.messageHandler.sendWithPromise("GetDocRequest",W,r?[r.buffer]:null);let o;if(r);else if(l)o=new PDFDataTransportStream({pdfDataRangeTransport:l,disableRange:T,disableStream:k});else{if(!n)throw new Error("getDocument - expected either `data`, `range`, or `url` parameter.");{const t=function getNetworkStream(t){return isValidFetchUrl(t)?PDFFetchStream:ui?PDFNodeStream:PDFNetworkStream}(n);o=new t({url:n,httpHeaders:s,withCredentials:a,rangeChunkSize:c,disableRange:T,disableStream:k})}}return t.then(t=>{if(h.destroyed)throw new Error("Worker was destroyed");const n=new MessageHandler(i,t,h.port),r=new WorkerTransport(n,e,o,j,G,N);e._transport=r;if(e.destroyed)throw new Error("Loading aborted");n.send("Ready",null)})}).catch(e._capability.reject).finally(e._setupCapability.resolve);return e}class PDFDocumentLoadingTask{static#hr=0;_capability=Promise.withResolvers();_setupCapability=Promise.withResolvers();_transport=null;_worker=null;_rendererWorker=null;docId="d"+PDFDocumentLoadingTask.#hr++;destroyed=!1;onPassword=null;onProgress=null;get promise(){return this._capability.promise}async destroy(){this.destroyed=!0;this._capability.promise.catch(()=>{});try{this._worker?.port&&(this._worker._pendingDestroy=!0);await this._setupCapability.promise;await(this._transport?.destroy())}catch(t){this._worker?.port&&delete this._worker._pendingDestroy;throw t}finally{this._rendererWorker?.destroy();this._rendererWorker=null}this._transport=null;this._worker?.destroy();this._worker=null}async getData(){return this._transport.getData()}}class PDFDataRangeTransport{#Os=Promise.withResolvers();#Da=null;constructor(t,e,i=!1,n=null){this.length=t;this.initialData=e;this.progressiveDone=i;this.contentDispositionFilename=n}onDataRange(t,e){this.#Da({type:"range",begin:t,chunk:e})}onDataProgressiveRead(t){this.#Os.promise.then(()=>{this.#Da({type:"progressiveRead",chunk:t})})}onDataProgressiveDone(){this.#Os.promise.then(()=>{this.#Da({type:"progressiveDone"})})}transportReady(t){this.#Da=t;this.#Os.resolve()}requestDataRange(t,e){unreachable("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}}class PDFDocumentProxy{constructor(t,e){this._pdfInfo=t;this._transport=e}get pagesMapper(){return this._transport.pagesMapper}get annotationStorage(){return this._transport.annotationStorage}get canvasFactory(){return this._transport.canvasFactory}get filterFactory(){return this._transport.filterFactory}get numPages(){return this._pdfInfo.numPages}get fingerprints(){return this._pdfInfo.fingerprints}get isPureXfa(){return util_shadow(this,"isPureXfa",!!this._transport._htmlForXfa)}get allXfaHtml(){return this._transport._htmlForXfa}getPage(t){return this._transport.getPage(t)}getPageIndex(t){return this._transport.getPageIndex(t)}getDestinations(){return this._transport.getDestinations()}getDestination(t){return this._transport.getDestination(t)}getPageLabels(){return this._transport.getPageLabels()}getPageLayout(){return this._transport.getPageLayout()}getPageMode(){return this._transport.getPageMode()}getViewerPreferences(){return this._transport.getViewerPreferences()}getOpenAction(){return this._transport.getOpenAction()}getAttachments(){return this._transport.getAttachments()}getAttachmentContent(t){return this._transport.getAttachmentContent(t)}getAnnotationsByType(t,e){return this._transport.getAnnotationsByType(t,e)}getJSActions(){return this._transport.getDocJSActions()}getOutline(){return this._transport.getOutline()}getOptionalContentConfig({intent:t="display"}={}){const{renderingIntent:e}=this._transport.getRenderingIntent(t);return this._transport.getOptionalContentConfig(e)}getPermissions(){return this._transport.getPermissions()}getMetadata(){return this._transport.getMetadata()}getMarkInfo(){return this._transport.getMarkInfo()}getData(){return this._transport.getData()}saveDocument(t){return this._transport.saveDocument(t)}extractPages(t,e=null){return this._transport.extractPages(t,e)}getDownloadInfo(){return this._transport.downloadInfoCapability.promise}cleanup(t=!1){return this._transport.startCleanup(t||this.isPureXfa)}cachedPageNumber(t){return this._transport.cachedPageNumber(t)}get loadingParams(){return this._transport.loadingParams}get loadingTask(){return this._transport.loadingTask}getFieldObjects(){return this._transport.getFieldObjects()}getSignatures(){return this._transport.getSignatures()}getSignatureData(t){return this._transport.getSignatureData(t)}hasJSActions(){return this._transport.hasJSActions()}getCalculationOrderIds(){return this._transport.getCalculationOrderIds()}}class PDFPageProxy{#Ia=!1;#Fa=null;static#Oa=0;constructor(t,e,i,n,r=!1){this._pageIndex=t;this._id=PDFPageProxy.#Oa++;this._pageInfo=e;this._transport=i;this._stats=r?new StatTimer:null;this._pdfBug=r;this.commonObjs=i.commonObjs;this.objs=new PDFObjects;this._intentStates=new Map;this.destroyed=!1;this.recordedBBoxes=null;this.#Fa=n;this.imageCoordinates=null}clone(t){const e=new PDFPageProxy(t,this._pageInfo,this._transport,this.#Fa,this._pdfBug);e.clonedFromIndex=this.clonedFromIndex??this._pageIndex;this._transport.updatePage(e);return e}get pageNumber(){return this._pageIndex+1}set pageNumber(t){this._pageIndex=t-1;this._transport.updatePage(this)}get rotate(){return this._pageInfo.rotate}get ref(){return this._pageInfo.ref}get userUnit(){return this._pageInfo.userUnit}get view(){return this._pageInfo.view}getViewport({scale:t,rotation:e=this.rotate,offsetX:i=0,offsetY:n=0,dontFlip:r=!1}={}){return new PageViewport({viewBox:this.view,userUnit:this.userUnit,scale:t,rotation:e,offsetX:i,offsetY:n,dontFlip:r})}getAnnotations({intent:t="display"}={}){const{renderingIntent:e}=this._transport.getRenderingIntent(t);return this._transport.getAnnotations(this._pageIndex,e)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get filterFactory(){return this._transport.filterFactory}get isPureXfa(){return util_shadow(this,"isPureXfa",!!this._transport._htmlForXfa)}async getXfa(){return this._transport._htmlForXfa?.children[this._pageIndex]||null}render({canvasContext:t,canvas:e=t.canvas,viewport:i,intent:n="display",annotationMode:r=Ei.ENABLE,transform:s=null,background:a=null,optionalContentConfigPromise:o=null,annotationCanvasMap:l=null,pageColors:c=null,printAnnotationStorage:h=null,isEditing:d=!1,recordImages:u=!1,recordOperations:p=!1,partialFrames:g=!1,operationsFilter:m=null}){this._stats?.time("Overall");const f=this._transport.getRenderingIntent(n,r,h,d),{renderingIntent:b,cacheKey:y}=f;this.#Ia=!1;o||=this._transport.getOptionalContentConfig(b);const w=this._intentStates.getOrInsertComputed(y,makeObj);if(w.streamReaderCancelTimeout){clearTimeout(w.streamReaderCancelTimeout);w.streamReaderCancelTimeout=null}const v=!!(b&wi);if(!w.displayReadyCapability){w.displayReadyCapability=Promise.withResolvers();w.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null};this._stats?.time("Page Request");this._pumpOperatorList(f)}const _=!(!this._pdfBug||!globalThis.StepperManager?.enabled),A=!!e&&!this.recordedBBoxes&&(p||_),x=!!e&&!this.imageCoordinates&&u,complete=t=>{w.renderTasks.delete(C);if(A){const{recordedBBoxes:t}=C;if(t){C.stepper?.setOperatorBBoxes(t,C.debugMetadata);p&&(this.recordedBBoxes=t)}}x&&!t&&(this.imageCoordinates=C.imageCoordinates);v&&(this.#Ia=!0);this.#Ra();if(t){C.capability.reject(t);this._abortOperatorList({intentState:w,reason:t instanceof Error?t:new Error(t)})}else C.capability.resolve();if(this._stats){this._stats.timeEnd("Rendering");this._stats.timeEnd("Overall");globalThis.Stats?.enabled&&globalThis.Stats.add(this.pageNumber,this._stats)}},C=new InternalRenderTask({callback:complete,params:{canvas:e,canvasContext:t,viewport:i,transform:s,background:a,recordOperations:A,recordImages:x,partialFrames:g,recordForDebugger:_},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:l,operatorList:w.operatorList,pageIndex:this._pageIndex,pageProxyId:this._id,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!v,pdfBug:this._pdfBug,pageColors:c,operationsFilter:m,rendererWorker:this._transport.rendererWorker,waitForGPU:()=>this._transport.waitForGPU()});(w.renderTasks||=new Set).add(C);const E=C.task;Promise.all([w.displayReadyCapability.promise,o]).then(async([t,e])=>{if(this.destroyed)complete();else{this._stats?.time("Rendering");if(!(e.renderingIntent&b))throw new Error("Must use the same `intent`-argument when calling the `PDFPageProxy.render` and `PDFDocumentProxy.getOptionalContentConfig` methods.");await C.initializeGraphics({transparency:t,optionalContentConfig:e});C.operatorListChanged()}}).catch(complete);return E}getOperatorList({intent:t="display",annotationMode:e=Ei.ENABLE,printAnnotationStorage:i=null,isEditing:n=!1}={}){const r=this._transport.getRenderingIntent(t,e,i,n,!0),s=this._intentStates.getOrInsertComputed(r.cacheKey,makeObj);let a;if(!s.opListReadCapability){a=Object.create(null);a.operatorListChanged=function operatorListChanged(){if(s.operatorList.lastChunk){s.opListReadCapability.resolve(s.operatorList);s.renderTasks.delete(a)}};s.opListReadCapability=Promise.withResolvers();(s.renderTasks||=new Set).add(a);s.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null};this._stats?.time("Page Request");this._pumpOperatorList(r)}return s.opListReadCapability.promise}streamTextContent({includeMarkedContent:t=!1,disableNormalization:e=!1}={}){return this._transport.messageHandler.sendWithStream("GetTextContent",{pageId:this.#Fa.getPageId(this._pageIndex+1)-1,pageIndex:this._pageIndex,includeMarkedContent:!0===t,disableNormalization:!0===e},{highWaterMark:100,size:t=>t.items.length})}async getTextContent(t={}){if(this._transport._htmlForXfa)return this.getXfa().then(t=>XfaText.textContent(t));const e=this.streamTextContent(t).getReader(),i={items:[],styles:Object.create(null),lang:null};for(;;){const{value:t,done:n}=await e.read();if(n)break;i.lang??=t.lang;Object.assign(i.styles,t.styles);i.items.push(...t.items)}return i}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;const t=[];for(const e of this._intentStates.values()){this._abortOperatorList({intentState:e,reason:new Error("Page was destroyed."),force:!0});if(!e.opListReadCapability)for(const i of e.renderTasks){t.push(i.completed);i.cancel()}}this.objs.clear();this._transport.cleanupPage(this._id);this.#Ia=!1;return Promise.all(t)}cleanup(t=!1){this.#Ia=!0;const e=this.#Ra();t&&e&&(this._stats&&=new StatTimer);return e}#Ra(){if(!this.#Ia||this.destroyed)return!1;for(const{renderTasks:t,operatorList:e}of this._intentStates.values())if(t.size>0||!e.lastChunk)return!1;this._intentStates.clear();this.objs.clear();this._transport.cleanupPage(this._id);this.#Ia=!1;return!0}_startRenderPage(t,e){const i=this._intentStates.get(e);if(i){this._stats?.timeEnd("Page Request");i.displayReadyCapability?.resolve(t)}}_renderPageChunk(t,e){for(let i=0,n=t.length;i{a.read().then(({value:t,done:e})=>{if(e)o.streamReader=null;else if(!this._transport.destroyed){this._renderPageChunk(t,o);pump()}},t=>{o.streamReader=null;if(!this._transport.destroyed){if(o.operatorList){o.operatorList.lastChunk=!0;for(const t of o.renderTasks)t.operatorListChanged();this.#Ra()}if(o.displayReadyCapability)o.displayReadyCapability.reject(t);else{if(!o.opListReadCapability)throw t;o.opListReadCapability.reject(t)}}})};pump()}_abortOperatorList({intentState:t,reason:e,force:i=!1}){if(t.streamReader){if(t.streamReaderCancelTimeout){clearTimeout(t.streamReaderCancelTimeout);t.streamReaderCancelTimeout=null}if(!i){if(t.renderTasks.size>0)return;if(e instanceof RenderingCancelledException){let i=100;e.extraDelay>0&&e.extraDelay<1e3&&(i+=e.extraDelay);t.streamReaderCancelTimeout=setTimeout(()=>{t.streamReaderCancelTimeout=null;this._abortOperatorList({intentState:t,reason:e,force:!0})},i);return}}t.streamReader.cancel(new AbortException(e.message)).catch(()=>{});t.streamReader=null;if(!this._transport.destroyed){for(const[e,i]of this._intentStates)if(i===t){this._intentStates.delete(e);break}this.cleanup()}}}get stats(){return this._stats}}class PDFWorker{#Os=Promise.withResolvers();#Bs=null;#jr=null;#Ws=null;static#Ba=0;static#La=!1;static#Na=new WeakMap;static{if(ui){this.#La=!0;GlobalWorkerOptions.workerSrc||="./pdf.worker.mjs"}}constructor({name:t=null,port:e=null,verbosity:i=getVerbosityLevel()}={}){this.name=t;this.destroyed=!1;this.verbosity=i;if(e){if(PDFWorker.#Na.has(e))throw new Error("Cannot use more than one PDFWorker per port.");PDFWorker.#Na.set(e,this);this.#$s(e)}else this.#Xs()}get promise(){return this.#Os.promise}#Ks(){this.#Os.resolve();this.#Bs.send("configure",{verbosity:this.verbosity})}get port(){return this.#jr}get messageHandler(){return this.#Bs}#$s(t){this.#jr=t;this.#Bs=new MessageHandler("main","worker",t);this.#Bs.on("ready",()=>{});this.#Ks()}#Xs(){if(PDFWorker.#La||PDFWorker.#Ua){this.#Ha();return}const{workerSrc:t}=PDFWorker;try{const e=new Worker(getWorkerSrc(t),{type:"module"}),i=new MessageHandler("main","worker",e),terminateEarly=()=>{n.abort();i.destroy();e.terminate();this.destroyed?this.#Os.reject(new Error("Worker was destroyed")):this.#Ha()},n=new AbortController;e.addEventListener("error",()=>{this.#Ws||terminateEarly()},{signal:n.signal});i.on("ready",t=>{n.abort();if(!this.destroyed&&t instanceof Uint8Array){this.#Bs=i;this.#jr=e;this.#Ws=e;this.#Ks()}else terminateEarly()})}catch{info("The worker has been disabled.");this.#Ha()}}#Ha(){if(!PDFWorker.#La){warn("Setting up fake worker.");PDFWorker.#La=!0}PDFWorker._setupFakeWorkerGlobal.then(t=>{if(this.destroyed){this.#Os.reject(new Error("Worker was destroyed"));return}const e=new LoopbackPort;this.#jr=e;const i="fake"+PDFWorker.#Ba++,n=new MessageHandler(i+"_worker",i,e);t.setup(n,e);this.#Bs=new MessageHandler(i,i+"_worker",e);this.#Ks()}).catch(t=>{this.#Os.reject(new Error(`Setting up fake worker failed: "${t.message}".`))})}destroy(){this.destroyed=!0;this.#Ws?.terminate();this.#Ws=null;PDFWorker.#Na.delete(this.#jr);this.#jr=null;this.#Bs?.destroy();this.#Bs=null}static create(t){const e=this.#Na.get(t?.port);if(e){if(e._pendingDestroy)throw new Error("PDFWorker.create - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");return e}return new PDFWorker(t)}static get workerSrc(){if(GlobalWorkerOptions.workerSrc)return GlobalWorkerOptions.workerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get#Ua(){try{return globalThis.pdfjsWorker?.WorkerMessageHandler||null}catch{return null}}static get _setupFakeWorkerGlobal(){return util_shadow(this,"_setupFakeWorkerGlobal",(async()=>{if(this.#Ua)return this.#Ua;return(await(import( /*webpackIgnore: true*/ /*@vite-ignore*/ -this.workerSrc))).WorkerMessageHandler})())}}class WorkerTransport{downloadInfoCapability=Promise.withResolvers();#ha=null;#da=new Map;#ua=null;#pa=new Map;#ga=new Map;#fa=new Map;#ma=null;#ba=null;constructor(t,e,i,n,r,s){this.messageHandler=t;this.loadingTask=e;this.#ua=i;this.commonObjs=new PDFObjects;this.fontLoader=new FontLoader({ownerDocument:n.ownerDocument,styleElement:n.styleElement});this.enableHWA=n.enableHWA;this.loadingParams=n.loadingParams;this._params=n;this.canvasFactory=r.canvasFactory;this.filterFactory=r.filterFactory;this.binaryDataFactory=r.binaryDataFactory;this.pagesMapper=s;this.destroyed=!1;this.destroyCapability=null;this.setupMessageHandler()}updatePage(t){this.#pa.set(t._id,t);this.#ga.set(t._pageIndex,Promise.resolve(t))}#ya(t,e=null){return this.#da.getOrInsertComputed(t,()=>this.messageHandler.sendWithPromise(t,e))}#jr({loaded:t,total:e}){this.loadingTask.onProgress?.({loaded:t,total:e,percent:e?MathClamp(Math.round(t/e*100),0,100):NaN})}get annotationStorage(){return util_shadow(this,"annotationStorage",new AnnotationStorage)}getRenderingIntent(t,e=Ci.ENABLE,i=null,n=!1,r=!1){let s=yi,a=un;switch(t){case"any":s=bi;break;case"display":break;case"print":s=wi;break;default:warn(`getRenderingIntent - invalid intent: ${t}`)}const o=s&wi&&i instanceof PrintAnnotationStorage?i:this.annotationStorage;switch(e){case Ci.DISABLE:s+=Ai;break;case Ci.ENABLE:break;case Ci.ENABLE_FORMS:s+=vi;break;case Ci.ENABLE_STORAGE:s+=_i;a=o.serializable;break;default:warn(`getRenderingIntent - invalid annotationMode: ${e}`)}n&&(s+=xi);r&&(s+=Ei);const{ids:l,hash:c}=o.modifiedIds;return{renderingIntent:s,cacheKey:[s,a.hash,c].join("_"),annotationStorageSerializable:a,modifiedIds:l}}destroy(){if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0;this.destroyCapability=Promise.withResolvers();this.#ma?.reject(new Error("Worker was destroyed during onPassword callback"));const t=[];for(const e of this.#pa.values())t.push(e._destroy());this.#pa.clear();this.#ga.clear();this.#fa.clear();Object.hasOwn(this,"annotationStorage")&&this.annotationStorage.resetModified();const e=this.messageHandler.sendWithPromise("Terminate",null);t.push(e);Promise.all(t).then(()=>{this.commonObjs.clear();this.fontLoader.clear();this.#da.clear();this.filterFactory.destroy();TextLayer.cleanup();this.#ua?.cancelAllRequests(new AbortException("Worker was terminated."));this.messageHandler?.destroy();this.messageHandler=null;this.destroyCapability.resolve()},this.destroyCapability.reject);return this.destroyCapability.promise}setupMessageHandler(){const{messageHandler:t,loadingTask:e}=this;t.on("GetReader",(t,e)=>{util_assert(this.#ua,"GetReader - no `BasePDFStream` instance available.");this.#ha=this.#ua.getFullReader();this.#ha.onProgress=t=>this.#jr(t);e.onPull=()=>{this.#ha.read().then(function({value:t,done:i}){if(i)e.close();else{util_assert(t instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer.");e.enqueue(new Uint8Array(t),1,[t])}}).catch(t=>{e.error(t)})};e.onCancel=t=>{this.#ha.cancel(t);e.ready.catch(t=>{if(!this.destroyed)throw t})}});t.on("ReaderHeadersReady",async t=>{await this.#ha.headersReady;const{isStreamingSupported:e,isRangeSupported:i,contentLength:n}=this.#ha;e&&i&&(this.#ha.onProgress=null);return{isStreamingSupported:e,isRangeSupported:i,contentLength:n}});t.on("GetRangeReader",(t,e)=>{util_assert(this.#ua,"GetRangeReader - no `BasePDFStream` instance available.");const i=this.#ua.getRangeReader(t.begin,t.end);if(i){e.onPull=()=>{i.read().then(function({value:t,done:i}){if(i)e.close();else{util_assert(t instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer.");e.enqueue(new Uint8Array(t),1,[t])}}).catch(t=>{e.error(t)})};e.onCancel=t=>{i.cancel(t);e.ready.catch(t=>{if(!this.destroyed)throw t})}}else e.close()});t.on("GetDoc",({pdfInfo:t})=>{this.pagesMapper.pagesNumber=t.numPages;this._numPages=t.numPages;this._htmlForXfa=t.htmlForXfa;delete t.htmlForXfa;e._capability.resolve(new PDFDocumentProxy(t,this))});t.on("DocException",t=>{e._capability.reject(wrapReason(t))});t.on("PasswordRequest",t=>{this.#ma=Promise.withResolvers();try{if(!e.onPassword)throw wrapReason(t);const updatePassword=t=>{t instanceof Error?this.#ma.reject(t):this.#ma.resolve({password:t})};e.onPassword(updatePassword,t.code)}catch(t){this.#ma.reject(t)}return this.#ma.promise});t.on("DataLoaded",t=>{this.#jr({loaded:t.length,total:t.length});this.downloadInfoCapability.resolve(t)});t.on("StartRenderPage",t=>{if(this.destroyed)return;this.#pa.get(t.pageProxyId)._startRenderPage(t.transparency,t.cacheKey)});t.on("commonobj",([e,i,n])=>{if(this.destroyed)return null;if(this.commonObjs.has(e))return null;switch(i){case"Font":if("error"in n){const t=n.error;warn(`Error during font loading: ${t}`);this.commonObjs.resolve(e,t);break}const r=new FontInfo(n.buffer),s=this._params.pdfBug&&globalThis.FontInspector?.enabled?(t,e)=>globalThis.FontInspector.fontAdded(t,e):null,a=new FontFaceObject(r,s,n.charProcOperatorList,n.extra);this.fontLoader.bind(a).catch(()=>t.sendWithPromise("FontFallback",{id:e})).finally(()=>{a.fontExtraProperties||a.clearData();this.commonObjs.resolve(e,a)});break;case"CopyLocalImage":const{imageRef:o}=n;util_assert(o,"The imageRef must be defined.");for(const t of this.#pa.values())for(const[,i]of t.objs){if(i?.ref!==o)continue;if(!i.dataLen)return null;const t=structuredClone(i);this.commonObjs.resolve(e,t);return i.dataLen}break;case"FontPath":this.commonObjs.resolve(e,new FontPathInfo(n));break;case"Image":this.commonObjs.resolve(e,n);break;case"Pattern":const l=new PatternInfo(n);this.commonObjs.resolve(e,l.getIR());break;default:throw new Error(`Got unknown common object type ${i}`)}return null});t.on("obj",([t,e,i,n])=>{if(this.destroyed)return;const r=this.#pa.get(e);if(!r.objs.has(t))if(0!==r._intentStates.size)switch(i){case"Image":case"Pattern":r.objs.resolve(t,n);break;default:throw new Error(`Got unknown object type ${i}`)}else n?.bitmap?.close()});t.on("DocProgress",t=>{this.destroyed||this.#jr(t)});t.on("FetchBinaryData",async t=>{if(this.destroyed)throw new Error("Worker was destroyed.");if(!this.binaryDataFactory)throw new Error("`BinaryDataFactory` not initialized, see the `useWorkerFetch` parameter.");return this.binaryDataFactory.fetch(t)})}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(t=null){this.annotationStorage.size<=0&&warn("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");const{map:e,transfer:i}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:e,supportsPrintToPDF:null!==this.#ba,filename:this.#ha?.filename??null},i).finally(()=>{this.#ba=null;this.annotationStorage.resetModified()})}extractPages(t,e=null){const i={pageInfos:t};let n;const r=globalThis.ImageBitmap;if("function"==typeof r){const e=Array.isArray(t)?t:[t];for(const t of e)t?.image instanceof r&&(n||=[]).push(t.image)}if(this.annotationStorage.size>0){const t=this.annotationStorage.serializable;let{map:r}=t;t.transfer?.length&&(n?n.push(...t.transfer):n=t.transfer);const s=this.pagesMapper.getMapping();if(s){const t=new Map;for(const[i,n]of r){if(void 0!==n?.pageIndex&&n.pageIndex>=0&&n.pageIndex{this.annotationStorage.resetModified()})}getPage(t){if(!Number.isInteger(t)||t<=0||t>this.pagesMapper.pagesNumber)return Promise.reject(new Error("Invalid page request."));const e=t-1,i=this.pagesMapper.getPageId(t)-1,n=this.#ga.get(e);if(n)return n;const r=this.messageHandler.sendWithPromise("GetPage",{pageIndex:i}).then(t=>{if(this.destroyed)throw new Error("Transport destroyed");t.refStr&&this.#fa.set(t.refStr,i);const n=new PDFPageProxy(e,t,this,this.pagesMapper,this._params.pdfBug);this.#pa.set(n._id,n);return n});this.#ga.set(e,r);return r}async getPageIndex(t){if(!isRefProxy(t))throw new Error("Invalid pageIndex request.");const e=await this.messageHandler.sendWithPromise("GetPageIndex",{num:t.num,gen:t.gen}),i=this.pagesMapper.getPageNumber(e+1);if(0===i)throw new Error("GetPageIndex: page has been removed.");return i-1}getAnnotations(t,e){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:this.pagesMapper.getPageId(t+1)-1,intent:e})}getFieldObjects(){return this.#ya("GetFieldObjects")}getSignatures(){return this.#ya("GetSignatures")}getSignatureData(t){return this.messageHandler.sendWithPromise("GetSignatureData",t)}hasJSActions(){return this.#ya("HasJSActions")}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(t){return"string"!=typeof t?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:t})}getPageLabels(){return this.messageHandler.sendWithPromise("GetPageLabels",null)}getPageLayout(){return this.messageHandler.sendWithPromise("GetPageLayout",null)}getPageMode(){return this.messageHandler.sendWithPromise("GetPageMode",null)}getViewerPreferences(){return this.messageHandler.sendWithPromise("GetViewerPreferences",null)}getOpenAction(){return this.messageHandler.sendWithPromise("GetOpenAction",null)}getAttachments(){return this.messageHandler.sendWithPromise("GetAttachments",null)}getAttachmentContent(t){return this.messageHandler.sendWithPromise("GetAttachmentContent",t)}getAnnotationsByType(t,e){return this.messageHandler.sendWithPromise("GetAnnotationsByType",{types:t,pageIndexesToSkip:e})}getDocJSActions(){return this.#ya("GetDocJSActions")}getPageJSActions(t){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:this.pagesMapper.getPageId(t+1)-1})}getStructTree(t){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:this.pagesMapper.getPageId(t+1)-1})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(t){return this.#ya("GetOptionalContentConfig").then(e=>new OptionalContentConfig(e,t))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){const t="GetMetadata";return this.#da.getOrInsertComputed(t,()=>this.messageHandler.sendWithPromise(t,null).then(t=>({info:t[0],metadata:t[1]?new Metadata(t[1]):null,contentDispositionFilename:this.#ha?.filename??null,contentLength:this.#ha?.contentLength??null,hasStructTree:t[2]})))}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(t=!1){if(!this.destroyed){await this.messageHandler.sendWithPromise("Cleanup",null);for(const t of this.#pa.values()){if(!t.cleanup())throw new Error(`startCleanup: Page ${t.pageNumber} is currently rendering.`)}this.commonObjs.clear();t||this.fontLoader.clear();this.#da.clear();this.filterFactory.destroy(!0);TextLayer.cleanup()}}cachedPageNumber(t){if(!isRefProxy(t))return null;const e=0===t.gen?`${t.num}R`:`${t.num}R${t.gen}`,i=this.#fa.get(e);if(i>=0){const t=this.pagesMapper.getPageNumber(i+1);if(0!==t)return t}return null}}class RenderTask{_internalRenderTask=null;onContinue=null;onError=null;constructor(t){this._internalRenderTask=t}get promise(){return this._internalRenderTask.capability.promise}cancel(t=0){this._internalRenderTask.cancel(null,t)}get separateAnnots(){const{separateAnnots:t}=this._internalRenderTask.operatorList;if(!t)return!1;const{annotationCanvasMap:e}=this._internalRenderTask;return t.form||t.canvas&&e?.size>0}get imageCoordinates(){return this._internalRenderTask.imageCoordinates||null}}class InternalRenderTask{#wa=null;static#va=new WeakSet;constructor({callback:t,params:e,objs:i,commonObjs:n,annotationCanvasMap:r,operatorList:s,pageIndex:a,canvasFactory:o,filterFactory:l,useRequestAnimationFrame:c=!1,pdfBug:h=!1,pageColors:d=null,enableHWA:u=!1,operationsFilter:p=null}){this.callback=t;this.params=e;this.objs=i;this.commonObjs=n;this.annotationCanvasMap=r;this.operatorListIdx=null;this.operatorList=s;this._pageIndex=a;this.canvasFactory=o;this.filterFactory=l;this._pdfBug=h;this.pageColors=d;this.running=!1;this.graphicsReadyCallback=null;this.graphicsReady=!1;this._useRequestAnimationFrame=!0===c&&"undefined"!=typeof window;this.cancelled=!1;this.capability=Promise.withResolvers();this.task=new RenderTask(this);this._cancelBound=this.cancel.bind(this);this._continueBound=this._continue.bind(this);this._scheduleNextBound=this._scheduleNext.bind(this);this._nextBound=this._next.bind(this);this._canvas=e.canvas;this._canvasContext=e.canvas?null:e.canvasContext;this._enableHWA=u;this._dependencyTracker=e.dependencyTracker;this._imagesTracker=e.imagesTracker;this._operationsFilter=p}get completed(){return this.capability.promise.catch(()=>{})}initializeGraphics({transparency:t=!1,optionalContentConfig:e}){if(this.cancelled)return;if(this._canvas){if(InternalRenderTask.#va.has(this._canvas))throw new Error("Cannot use the same canvas during multiple render() operations. Use different canvas or ensure previous operations were cancelled or completed.");InternalRenderTask.#va.add(this._canvas)}if(this._pdfBug&&globalThis.StepperManager?.enabled){this.stepper=globalThis.StepperManager.create(this._pageIndex);this.stepper.init(this.operatorList);this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint()}const{viewport:i,transform:n,background:r,dependencyTracker:s,imagesTracker:a}=this.params,o=this._canvasContext||this._canvas.getContext("2d",{alpha:!1,willReadFrequently:!this._enableHWA});this.gfx=new CanvasGraphics(o,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:e},this.annotationCanvasMap,this.pageColors,s,a);this.gfx.beginDrawing({transform:n,viewport:i,transparency:t,background:r});this.operatorListIdx=0;this.graphicsReady=!0;this.graphicsReadyCallback?.()}cancel(t=null,e=0){this.running=!1;this.cancelled=!0;this.gfx?.endDrawing();if(this.#wa){window.cancelAnimationFrame(this.#wa);this.#wa=null}InternalRenderTask.#va.delete(this._canvas);t||=new RenderingCancelledException(`Rendering cancelled, page ${this._pageIndex+1}`,e);this.callback(t);this.task.onError?.(t)}operatorListChanged(){if(this.graphicsReady){this.gfx.dependencyTracker?.growOperationsCount(this.operatorList.fnArray.length);this.stepper?.updateOperatorList(this.operatorList);this.running||this._continue()}else this.graphicsReadyCallback||=this._continueBound}_continue(){this.running=!0;this.cancelled||(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())}_scheduleNext(){this._useRequestAnimationFrame?this.#wa=window.requestAnimationFrame(()=>{this.#wa=null;this._nextBound().catch(this._cancelBound)}):Promise.resolve().then(this._nextBound).catch(this._cancelBound)}async _next(){if(!this.cancelled){this.operatorListIdx=this.gfx.executeOperatorList(this.operatorList,this.operatorListIdx,this._continueBound,this.stepper,this._operationsFilter);if(this.operatorListIdx===this.operatorList.argsArray.length){this.running=!1;if(this.operatorList.lastChunk){this.gfx.endDrawing();InternalRenderTask.#va.delete(this._canvas);this.callback()}}}}}const Yn="6.4.299",Jn="d0991a0d5";qe();class ColorPicker{#_a=null;#Aa=null;#xa;#Ea=null;#Ca=!1;#Sa=!1;#o=null;#Ta;#ka=null;#w=null;static#Da=null;static get _keyboardManager(){return util_shadow(this,"_keyboardManager",new KeyboardManager([[["Escape"],ColorPicker.prototype._hideDropdownFromKeyboard],[["Space"],ColorPicker.prototype._colorSelectFromKeyboard],[["ArrowDown","ArrowRight"],ColorPicker.prototype._moveToNext],[["ArrowUp","ArrowLeft"],ColorPicker.prototype._moveToPrevious],[["Home"],ColorPicker.prototype._moveToBeginning],[["End"],ColorPicker.prototype._moveToEnd]]))}constructor({editor:t=null,uiManager:e=null}){if(t){this.#Sa=!1;this.#o=t}else this.#Sa=!0;this.#w=t?._uiManager||e;this.#Ta=this.#w._eventBus;this.#xa=t?.color?.toUpperCase()||this.#w?.highlightColors.values().next().value||"#FFFF98";ColorPicker.#Da||=Object.freeze({blue:"pdfjs-editor-colorpicker-blue",green:"pdfjs-editor-colorpicker-green",pink:"pdfjs-editor-colorpicker-pink",red:"pdfjs-editor-colorpicker-red",yellow:"pdfjs-editor-colorpicker-yellow"})}renderButton(){const t=this.#_a=document.createElement("button");t.className="colorPicker";t.tabIndex="0";t.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-button");t.ariaHasPopup="true";this.#o&&(t.ariaControls=`${this.#o.id}_colorpicker_dropdown`);const e=this.#w._signal;t.addEventListener("click",this.#Pa.bind(this),{signal:e});t.addEventListener("keydown",this.#Ma.bind(this),{signal:e});const i=this.#Aa=document.createElement("span");i.className="swatch";i.ariaHidden="true";i.style.backgroundColor=this.#xa;t.append(i);return t}renderMainDropdown(){const t=this.#Ea=this.#Ia();t.ariaOrientation="horizontal";t.ariaLabelledBy="highlightColorPickerLabel";return t}#Ia(){const t=document.createElement("div"),e=this.#w._signal;t.addEventListener("contextmenu",noContextMenu,{signal:e});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(const[i,n]of this.#w.highlightColors){const r=document.createElement("button");r.tabIndex="0";r.role="option";r.setAttribute("data-color",n);r.title=i;r.setAttribute("data-l10n-id",ColorPicker.#Da[i]);const s=document.createElement("span");r.append(s);s.className="swatch";s.style.backgroundColor=n;r.ariaSelected=n===this.#xa;r.addEventListener("click",this.#Fa.bind(this,n),{signal:e});t.append(r)}t.addEventListener("keydown",this.#Ma.bind(this),{signal:e});return t}#Fa(t,e){e.stopPropagation();this.#Ta.dispatch("switchannotationeditorparams",{source:this,type:Di.HIGHLIGHT_COLOR,value:t});this.update(t)}_colorSelectFromKeyboard(t){if(t.target===this.#_a){this.#Pa(t);return}const e=t.target.getAttribute("data-color");e&&this.#Fa(e,t)}_moveToNext(t){this.#Oa?t.target!==this.#_a?t.target.nextSibling?.focus():this.#Ea.firstElementChild?.focus():this.#Pa(t)}_moveToPrevious(t){if(t.target!==this.#Ea?.firstElementChild&&t.target!==this.#_a){this.#Oa||this.#Pa(t);t.target.previousSibling?.focus()}else this.#Oa&&this._hideDropdownFromKeyboard()}_moveToBeginning(t){this.#Oa?this.#Ea.firstElementChild?.focus():this.#Pa(t)}_moveToEnd(t){this.#Oa?this.#Ea.lastElementChild?.focus():this.#Pa(t)}#Ma(t){ColorPicker._keyboardManager.exec(this,t)}#Pa(t){if(this.#Oa){this.hideDropdown();return}this.#Ca=0===t.detail;if(!this.#ka){this.#ka=new AbortController;window.addEventListener("pointerdown",this.#g.bind(this),{signal:this.#w.combinedSignal(this.#ka)})}this.#_a.ariaExpanded="true";if(this.#Ea){this.#Ea.classList.remove("hidden");return}const e=this.#Ea=this.#Ia();this.#_a.append(e)}#g(t){this.#Ea?.contains(t.target)||this.hideDropdown()}hideDropdown(){this.#Ea?.classList.add("hidden");this.#_a.ariaExpanded="false";this.#ka?.abort();this.#ka=null}get#Oa(){return this.#Ea&&!this.#Ea.classList.contains("hidden")}_hideDropdownFromKeyboard(){if(!this.#Sa)if(this.#Oa){this.hideDropdown();this.#_a.focus({preventScroll:!0,focusVisible:this.#Ca})}else this.#o?.unselect()}update(t){this.#Aa&&(this.#Aa.style.backgroundColor=t);if(!this.#Ea)return;const e=this.#w.highlightColors.values();for(const i of this.#Ea.children)i.ariaSelected=e.next().value===t.toUpperCase()}destroy(){this.#_a?.remove();this.#_a=null;this.#Aa=null;this.#Ea?.remove();this.#Ea=null}}class BasicColorPicker{#Ra=null;#Ba=!1;#o=null;#w=null;static#Da=null;constructor(t){this.#o=t;this.#w=t._uiManager;BasicColorPicker.#Da||=Object.freeze({freetext:"pdfjs-editor-color-picker-free-text-input",ink:"pdfjs-editor-color-picker-ink-input"})}renderButton(){if(this.#Ra)return this.#Ra;const{editorType:t,colorType:e,colorAndOpacityType:i,opacityType:n,color:r,opacity:s}=this.#o,a=this.#Ba=FeatureTest.isAlphaColorInputSupported&&void 0!==n,o=this.#Ra=document.createElement("input");o.type="color";if(a){o.setAttribute("alpha","");const t=Util.hexNums[Math.round(255*(s??1))];o.value=(r||"#000000")+t}else o.value=r||"#000000";o.className="basicColorPicker";o.tabIndex=0;o.setAttribute("data-l10n-id",BasicColorPicker.#Da[t]);o.addEventListener("input",()=>{if(a){const t=getRGBA(o.value);if(!t)return;const[r,s,a,l]=t,c=Util.makeHexColor(r,s,a);if(void 0!==i)this.#w.updateParams(i,{color:c,opacity:l});else{this.#w.updateParams(e,c);this.#w.updateParams(n,l)}}else this.#w.updateParams(e,o.value)},{signal:this.#w._signal});return o}update(t){if(this.#Ra)if(this.#Ba){const e=Util.hexNums[Math.round(255*this.#o.opacity)];this.#Ra.value=t+e}else this.#Ra.value=t}updateOpacity(t){if(!this.#Ra||!this.#Ba)return;const e=Util.hexNums[Math.round(255*t)];this.#Ra.value=this.#o.color+e}destroy(){this.#Ra?.remove();this.#Ra=null}hideDropdown(){}}Le();function makeColorComp(t){return Math.floor(255*MathClamp(t,0,1)).toString(16).padStart(2,"0")}function scaleAndClamp(t){return 255*MathClamp(t,0,1)}class ColorConverters{static CMYK_G([t,e,i,n]){return["G",1-Math.min(1,.3*t+.59*i+.11*e+n)]}static G_CMYK([t]){return["CMYK",0,0,0,1-t]}static G_RGB([t]){return["RGB",t,t,t]}static G_rgb([t]){return[t=scaleAndClamp(t),t,t]}static G_HTML([t]){const e=makeColorComp(t);return`#${e}${e}${e}`}static RGB_G([t,e,i]){return["G",.3*t+.59*e+.11*i]}static RGB_rgb(t){return t.map(scaleAndClamp)}static RGB_HTML(t){return`#${t.map(makeColorComp).join("")}`}static T_HTML(){return"#00000000"}static T_rgb(){return[null]}static CMYK_RGB([t,e,i,n]){return["RGB",1-Math.min(1,t+n),1-Math.min(1,i+n),1-Math.min(1,e+n)]}static CMYK_rgb([t,e,i,n]){return[scaleAndClamp(1-Math.min(1,t+n)),scaleAndClamp(1-Math.min(1,i+n)),scaleAndClamp(1-Math.min(1,e+n))]}static CMYK_HTML(t){const e=this.CMYK_RGB(t).slice(1);return this.RGB_HTML(e)}static RGB_CMYK([t,e,i]){const n=1-t,r=1-e,s=1-i;return["CMYK",n,r,s,Math.min(n,r,s)]}}class BaseSVGFactory{create(t,e,i=!1){if(t<=0||e<=0)throw new Error("Invalid SVG dimensions");const n=this._createSVG("svg:svg");n.setAttribute("version","1.1");if(!i){n.setAttribute("width",`${t}px`);n.setAttribute("height",`${e}px`)}n.setAttribute("preserveAspectRatio","none");n.setAttribute("viewBox",`0 0 ${t} ${e}`);return n}createElement(t){if("string"!=typeof t)throw new Error("Invalid SVG element type");return this._createSVG(t)}_createSVG(t){unreachable("Abstract method `_createSVG` called.")}}class DOMSVGFactory extends BaseSVGFactory{_createSVG(t){return document.createElementNS(mi,t)}}const Qn=new WeakSet,Zn=60*(new Date).getTimezoneOffset()*1e3;class AnnotationElementFactory{static create(t){switch(t.data.annotationType){case Ni.LINK:return new LinkAnnotationElement(t);case Ni.TEXT:return new TextAnnotationElement(t);case Ni.WIDGET:switch(t.data.fieldType){case"Tx":return new TextWidgetAnnotationElement(t);case"Btn":return t.data.radioButton?new RadioButtonWidgetAnnotationElement(t):t.data.checkBox?new CheckboxWidgetAnnotationElement(t):new PushButtonWidgetAnnotationElement(t);case"Ch":return new ChoiceWidgetAnnotationElement(t);case"Sig":return new SignatureWidgetAnnotationElement(t)}return new WidgetAnnotationElement(t);case Ni.POPUP:return new PopupAnnotationElement(t);case Ni.FREETEXT:return new FreeTextAnnotationElement(t);case Ni.LINE:return new LineAnnotationElement(t);case Ni.SQUARE:return new SquareAnnotationElement(t);case Ni.CIRCLE:return new CircleAnnotationElement(t);case Ni.POLYLINE:return new PolylineAnnotationElement(t);case Ni.CARET:return new CaretAnnotationElement(t);case Ni.INK:return new InkAnnotationElement(t);case Ni.POLYGON:return new PolygonAnnotationElement(t);case Ni.HIGHLIGHT:return new HighlightAnnotationElement(t);case Ni.UNDERLINE:return new UnderlineAnnotationElement(t);case Ni.SQUIGGLY:return new SquigglyAnnotationElement(t);case Ni.STRIKEOUT:return new StrikeOutAnnotationElement(t);case Ni.STAMP:return new StampAnnotationElement(t);case Ni.FILEATTACHMENT:return new FileAttachmentAnnotationElement(t);case Ni.RICHMEDIA:case Ni.SCREEN:case Ni.SOUND:return new MediaAnnotationElement(t);default:return new AnnotationElement(t)}}}class AnnotationElement{#La=null;#Na=!1;#Ua=null;constructor(t,{isRenderable:e=!1,ignoreBorder:i=!1,createQuadrilaterals:n=!1}={}){this.isRenderable=e;this.data=t.data;this.layer=t.layer;this.linkService=t.linkService;this.downloadManager=t.downloadManager;this.imageResourcesPath=t.imageResourcesPath;this.renderForms=t.renderForms;this.svgFactory=t.svgFactory;this.annotationStorage=t.annotationStorage;this.enableComment=t.enableComment;this.enableScripting=t.enableScripting;this.hasJSActions=t.hasJSActions;this._fieldObjects=t.fieldObjects;this.parent=t.parent;this.hasOwnCommentButton=!1;e&&(this.contentElement=this.container=this._createContainer(i));n&&this._createQuadrilaterals()}static _hasPopupData({contentsObj:t,richText:e}){return!(!t?.str&&!e?.str)}get _isEditable(){return this.data.isEditable}get hasPopupData(){return AnnotationElement._hasPopupData(this.data)||this.enableComment&&!!this.commentText}get commentData(){const{data:t}=this,e=this.annotationStorage?.getEditor(t.id);return e?e.getData():t}get hasCommentButton(){return this.enableComment&&this.hasPopupElement}get commentButtonPosition(){const t=this.annotationStorage?.getEditor(this.data.id);if(t)return t.commentButtonPositionInPage;const{quadPoints:e,inkLists:i,rect:n}=this.data;let r=-1/0,s=-1/0;if(e?.length>=8){for(let t=0;ts){s=e[t+1];r=e[t+2]}else e[t+1]===s&&(r=Math.max(r,e[t+2]));return[r,s]}if(i?.length>=1){for(const t of i)for(let e=0,i=t.length;es){s=t[e+1];r=t[e]}else t[e+1]===s&&(r=Math.max(r,t[e]));if(r!==1/0)return[r,s]}return n?[n[2],n[3]]:null}_normalizePoint(t){const{page:{view:e},viewport:{rawDims:{pageWidth:i,pageHeight:n,pageX:r,pageY:s}}}=this.parent;t[1]=e[3]-t[1]+e[1];t[0]=100*(t[0]-r)/i;t[1]=100*(t[1]-s)/n;return t}get commentText(){const{data:t}=this;return this.annotationStorage.getRawValue(`${Ti}${t.id}`)?.popup?.contents||t.contentsObj?.str||""}set commentText(t){const{data:e}=this,i={deleted:!t,contents:t||""};this.annotationStorage.updateEditor(e.id,{popup:i})||this.annotationStorage.setValue(`${Ti}${e.id}`,{id:e.id,annotationType:e.annotationType,page:this.parent.page,popup:i,popupRef:e.popupRef,modificationDate:new Date});t||this.removePopup()}removePopup(){(this.#Ua?.popup||this.popup)?.remove();this.#Ua=this.popup=null}updateEdited(t){if(!this.container)return;t.rect&&(this.#La||={rect:this.data.rect.slice(0)});const{rect:e,popup:i}=t;e&&this.#Ha(e);let n=this.#Ua?.popup||this.popup;if(!n&&i?.text){this._createPopup(i);n=this.#Ua.popup}if(n){n.updateEdited(t);if(i?.deleted){n.remove();this.#Ua=null;this.popup=null}}}resetEdited(){if(this.#La){this.#Ha(this.#La.rect);this.#Ua?.popup.resetEdited();this.#La=null}}#Ha(t){const{container:{style:e},data:{rect:i,rotation:n},parent:{viewport:{rawDims:{pageWidth:r,pageHeight:s,pageX:a,pageY:o}}}}=this;i?.splice(0,4,...t);e.left=100*(t[0]-a)/r+"%";e.top=100*(s-t[3]+o)/s+"%";if(0===n){e.width=100*(t[2]-t[0])/r+"%";e.height=100*(t[3]-t[1])/s+"%"}else this.setRotation(n)}_createContainer(t){const{data:e,parent:{page:i,viewport:n}}=this,r=document.createElement("section");r.setAttribute("data-annotation-id",e.id);this instanceof WidgetAnnotationElement||this instanceof LinkAnnotationElement||this instanceof MediaAnnotationElement||(r.tabIndex=0);const{style:s}=r;s.zIndex=this.parent.zIndex;this.parent.zIndex+=2;e.alternativeText&&(r.title=e.alternativeText);e.noRotate&&r.classList.add("norotate");if(!e.rect||this instanceof PopupAnnotationElement){const{rotation:t}=e;e.hasOwnCanvas||0===t||this.setRotation(t,r);return r}const{width:a,height:o}=this;if(!t&&e.borderStyle.width>0){s.borderWidth=`${e.borderStyle.width}px`;const t=e.borderStyle.horizontalCornerRadius,i=e.borderStyle.verticalCornerRadius;if(t>0||i>0){const e=`calc(${t}px * var(--total-scale-factor)) / calc(${i}px * var(--total-scale-factor))`;s.borderRadius=e}switch(e.borderStyle.style){case Ui:s.borderStyle="solid";break;case Hi:s.borderStyle="dashed";break;case zi:warn("Unimplemented border style: beveled");break;case Gi:warn("Unimplemented border style: inset");break;case ji:s.borderBottomStyle="solid"}const n=e.borderColor||null;if(n){this.#Na=!0;s.borderColor=Util.makeHexColor(...n)}else s.borderWidth=0}const l=Util.normalizeRect([e.rect[0],i.view[3]-e.rect[1]+i.view[1],e.rect[2],i.view[3]-e.rect[3]+i.view[1]]),{pageWidth:c,pageHeight:h,pageX:d,pageY:u}=n.rawDims;s.left=100*(l[0]-d)/c+"%";s.top=100*(l[1]-u)/h+"%";const{rotation:p}=e;if(e.hasOwnCanvas||0===p){s.width=100*a/c+"%";s.height=100*o/h+"%"}else this.setRotation(p,r);return r}setRotation(t,e=this.container){if(!this.data.rect)return;const{pageWidth:i,pageHeight:n}=this.parent.viewport.rawDims;let{width:r,height:s}=this;t%180!=0&&([r,s]=[s,r]);e.style.width=100*r/i+"%";e.style.height=100*s/n+"%";e.setAttribute("data-main-rotation",(360-t)%360)}get _commonActions(){const setColor=(t,e,i)=>{const n=i.detail[t],r=n[0],s=n.slice(1);i.target.style[e]=ColorConverters[`${r}_HTML`](s);this.annotationStorage.setValue(this.data.id,{[e]:ColorConverters[`${r}_rgb`](s)})};return util_shadow(this,"_commonActions",{display:t=>{const{display:e}=t.detail,i=e%2==1;this.container.style.visibility=i?"hidden":"visible";this.annotationStorage.setValue(this.data.id,{noView:i,noPrint:1===e||2===e})},print:t=>{this.annotationStorage.setValue(this.data.id,{noPrint:!t.detail.print})},hidden:t=>{const{hidden:e}=t.detail;this.container.style.visibility=e?"hidden":"visible";this.annotationStorage.setValue(this.data.id,{noPrint:e,noView:e})},focus:t=>{setTimeout(()=>t.target.focus({preventScroll:!1}),0)},userName:t=>{t.target.title=t.detail.userName},readonly:t=>{t.target.disabled=t.detail.readonly},required:t=>{this._setRequired(t.target,t.detail.required)},bgColor:t=>{setColor("bgColor","backgroundColor",t)},fillColor:t=>{setColor("fillColor","backgroundColor",t)},fgColor:t=>{setColor("fgColor","color",t)},textColor:t=>{setColor("textColor","color",t)},borderColor:t=>{setColor("borderColor","borderColor",t)},strokeColor:t=>{setColor("strokeColor","borderColor",t)},rotation:t=>{const e=t.detail.rotation;this.setRotation(e);this.annotationStorage.setValue(this.data.id,{rotation:e})}})}_dispatchEventFromSandbox(t,e){const i=this._commonActions;for(const n of Object.keys(e.detail)){const r=t[n]||i[n];r?.(e)}}_setDefaultPropertiesFromJS(t){if(!this.enableScripting)return;const e=this.annotationStorage.getRawValue(this.data.id);if(!e)return;const i=this._commonActions;for(const[n,r]of Object.entries(e)){const s=i[n];if(s){s({detail:{[n]:r},target:t});delete e[n]}}}_createQuadrilaterals(){if(!this.container)return;const{quadPoints:t}=this.data;if(!t)return;const[e,i,n,r]=this.data.rect.map(Math.fround);if(8===t.length){const[s,a,o,l]=t.subarray(2,6);if(n===s&&r===a&&e===o&&i===l)return}const{style:s}=this.container;let a;if(this.#Na){const{borderColor:t,borderWidth:e}=s;s.borderWidth=0;a=["url('data:image/svg+xml;utf8,",``,``];this.container.classList.add("hasBorder")}const o=n-e,l=r-i,{svgFactory:c}=this,h=c.createElement("svg");h.classList.add("quadrilateralsContainer");h.setAttribute("width",0);h.setAttribute("height",0);h.role="none";const d=c.createElement("defs");h.append(d);const u=c.createElement("clipPath"),p=`clippath_${this.data.id}`;u.setAttribute("id",p);u.setAttribute("clipPathUnits","objectBoundingBox");d.append(u);for(let i=2,n=t.length;i`)}if(this.#Na){a.push("')");s.backgroundImage=a.join("")}this.container.append(h);this.container.style.clipPath=`url(#${p})`}_createPopup(t=null){const{data:e}=this;let i,n;if(t){i={str:t.text};n=t.date}else{i=e.contentsObj;n=e.modificationDate}this.#Ua=new PopupAnnotationElement({data:{color:e.color,titleObj:e.titleObj,modificationDate:n,contentsObj:i,richText:e.richText,parentRect:e.rect,borderStyle:0,id:`popup_${e.id}`,rotation:e.rotation,noRotate:!0},linkService:this.linkService,parent:this.parent,elements:[this]})}get hasPopupElement(){return!!(this.#Ua||this.popup||this.data.popupRef)}get extraPopupElement(){return this.#Ua}render(){unreachable("Abstract method `AnnotationElement.render` called")}_getElementsByName(t,e=null){const i=[];if(this._fieldObjects){const n=this._fieldObjects.get(t)||[];for(const{page:t,id:r,exportValues:s}of n){if(-1===t||r===e)continue;const n="string"==typeof s?s:null,a=document.querySelector(`[data-element-id="${r}"]`);!a||Qn.has(a)?i.push({id:r,exportValue:n,domElement:a}):warn(`_getElementsByName - element not allowed: ${r}`)}return i}for(const n of document.getElementsByName(t)){const{exportValue:t}=n,r=n.getAttribute("data-element-id");r!==e&&Qn.has(n)&&i.push({id:r,exportValue:t,domElement:n})}return i}show(){this.container&&(this.container.hidden=!1);this.popup?.maybeShow()}hide(){this.container&&(this.container.hidden=!0);this.popup?.forceHide()}getElementsToTriggerPopup(){return this.container}addHighlightArea(){const t=this.getElementsToTriggerPopup();if(Array.isArray(t))for(const e of t)e.classList.add("highlightArea");else t.classList.add("highlightArea")}_editOnDoubleClick(){if(!this._isEditable)return;const{annotationEditorType:t,data:{id:e}}=this;this.container.addEventListener("dblclick",()=>{this.linkService.eventBus?.dispatch("switchannotationeditormode",{source:this,mode:t,editId:e,mustEnterInEditMode:!0})})}updateOC(t){if(!this.data.oc||!t)return;t.isVisible(this.data.oc)?this.show():this.hide()}get width(){return this.data.rect[2]-this.data.rect[0]}get height(){return this.data.rect[3]-this.data.rect[1]}_setBackgroundColor(t){const e=this.data.backgroundColor||null;t.style.backgroundColor=null===e?"transparent":Util.makeHexColor(...e)}}class EditorAnnotationElement extends AnnotationElement{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0});this.editor=t.editor}render(){this.container.className="editorAnnotation";return this.container}createOrUpdatePopup(){const{editor:t}=this;t.hasComment&&this._createPopup(t.comment)}get hasCommentButton(){return this.enableComment&&this.editor.hasComment}get commentButtonPosition(){return this.editor.commentButtonPositionInPage}get commentText(){return this.editor.comment.text}set commentText(t){this.editor.comment=t;t||this.removePopup()}get commentData(){return this.editor.getData()}remove(){this.parent.removeAnnotation(this.data.id);this.container.remove();this.container=null;this.removePopup()}}class LinkAnnotationElement extends AnnotationElement{constructor(t,e=null){super(t,{isRenderable:!0,ignoreBorder:!!e?.ignoreBorder,createQuadrilaterals:!0});this.isTooltipOnly=t.data.isTooltipOnly}render(){const{data:t,linkService:e}=this,i=document.createElement("a");i.setAttribute("data-element-id",t.id);let n=!1;if(t.url){e.addLinkAttributes(i,t.url,t.newWindow);n=!0}else if(t.action){this._bindNamedAction(i,t.action,t.overlaidText);n=!0}else if(t.attachment){this.#za(i,t.attachmentId,t.attachment,t.overlaidText,t.attachmentDest);n=!0}else if(t.setOCGState){this.#Ga(i,t.setOCGState,t.overlaidText);n=!0}else if(t.dest){this._bindLink(i,t.dest,t.overlaidText);n=!0}else{if(t.actions&&(t.actions.has("Action")||t.actions.has("Mouse Up")||t.actions.has("Mouse Down"))&&this.enableScripting&&this.hasJSActions){this._bindJSAction(i,t);n=!0}if(t.resetForm){this._bindResetFormAction(i,t.resetForm);n=!0}else if(this.isTooltipOnly&&!n){this._bindLink(i,"");n=!0}}this.container.classList.add("linkAnnotation");if(n){this.contentElement=i;this.container.append(i)}return this.container}#ja(){this.container.setAttribute("data-internal-link","")}_bindLink(t,e,i=""){t.href=this.linkService.getDestinationHash(e);t.onclick=()=>{e&&this.linkService.goToDestination(e);return!1};(e||""===e)&&this.#ja();i&&(t.title=i)}_bindNamedAction(t,e,i=""){t.href=this.linkService.getAnchorUrl("");t.onclick=()=>{this.linkService.executeNamedAction(e);return!1};i&&(t.title=i);this.#ja()}#za(t,e,i,n="",r=null){t.href=this.linkService.getAnchorUrl("");i.description?t.title=i.description:n&&(t.title=n);const openAttachment=async()=>{const t=await this.linkService.getAttachmentContent(e);t&&this.downloadManager?.openOrDownloadData(t,i.filename,r)};t.onclick=()=>{openAttachment();return!1};this.#ja()}#Ga(t,e,i=""){t.href=this.linkService.getAnchorUrl("");t.onclick=()=>{this.linkService.executeSetOCGState(e);return!1};i&&(t.title=i);this.#ja()}_bindJSAction(t,{actions:e,id:i,overlaidText:n}){t.href=this.linkService.getAnchorUrl("");const r=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(const n of e.keys()){const e=r.get(n);e&&(t[e]=()=>{this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:i,name:n}});return!1})}n&&(t.title=n);t.onclick||=()=>!1;this.#ja()}_bindResetFormAction(t,e){const i=t.onclick;i||(t.href=this.linkService.getAnchorUrl(""));this.#ja();if(this._fieldObjects)t.onclick=()=>{i?.();const{fields:t,refs:n,include:r}=e,s=[];if(0!==t.length||0!==n.length){const e=new Set(n);for(const i of t){const t=this._fieldObjects.get(i)||[];for(const{id:i}of t)e.add(i)}const i=new Map;for(const t of this._fieldObjects.values())for(const{id:e,kidIds:n}of t)n&&i.set(e,n);for(const t of e)for(const n of i.get(t)||[])e.add(n);for(const t of this._fieldObjects.values())for(const i of t)e.has(i.id)===r&&s.push(i)}else for(const t of this._fieldObjects.values())s.push(...t);const a=this.annotationStorage,o=[];for(const t of s){const{id:e}=t;o.push(e);switch(t.type){case"text":{const i=t.defaultValue||"";a.setValue(e,{value:i});break}case"checkbox":case"radiobutton":{const i=t.defaultValue===t.exportValues;a.setValue(e,{value:i});break}case"combobox":case"listbox":{const i=t.defaultValue||"";a.setValue(e,{value:i});break}default:continue}const i=document.querySelector(`[data-element-id="${e}"]`);i&&(Qn.has(i)?i.dispatchEvent(new Event("resetform")):warn(`_bindResetFormAction - element not allowed: ${e}`))}this.enableScripting&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:o,name:"ResetForm"}});return!1};else{warn('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.');i||(t.onclick=()=>!1)}}}class TextAnnotationElement extends AnnotationElement{constructor(t){super(t,{isRenderable:!0})}render(){this.container.classList.add("textAnnotation");const t=document.createElement("img");t.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg";t.setAttribute("data-l10n-id","pdfjs-text-annotation-type");t.setAttribute("data-l10n-args",JSON.stringify({type:this.data.name}));if(!this.data.popupRef&&this.hasPopupData){this.hasOwnCommentButton=!0;this._createPopup()}this.container.append(t);return this.container}}class WidgetAnnotationElement extends AnnotationElement{render(){return this.container}_getKeyModifier(t){return FeatureTest.platform.isMac?t.metaKey:t.ctrlKey}_setEventListener(t,e,i,n,r){i.includes("mouse")?t.addEventListener(i,t=>{this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:n,value:r(t),shift:t.shiftKey,modifier:this._getKeyModifier(t)}})}):t.addEventListener(i,t=>{if("blur"===i){if(!e.focused||!t.relatedTarget)return;e.focused=!1}else if("focus"===i){if(e.focused)return;e.focused=!0}r&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:n,value:r(t)}})})}_setEventListeners(t,e,i,n){const{actions:r}=this.data;for(const[s,a]of i)if("Action"===a||r?.has(a)){"Focus"!==a&&"Blur"!==a||(e||={focused:!1});this._setEventListener(t,e,s,a,n);"Focus"!==a||r?.has("Blur")?"Blur"!==a||r?.has("Focus")||this._setEventListener(t,e,"focus","Focus",null):this._setEventListener(t,e,"blur","Blur",null)}}_setTextStyle(t){const e=["left","center","right"],{fontColor:i}=this.data.defaultAppearanceData,n=this.data.defaultAppearanceData.fontSize||9,r=t.style;let s;const roundToOneDecimal=t=>Math.round(10*t)/10;if(this.data.multiLine){const t=Math.abs(this.data.rect[3]-this.data.rect[1]-2),e=t/(Math.round(t/(1.35*n))||1);s=Math.min(n,roundToOneDecimal(e/1.35))}else{const t=Math.abs(this.data.rect[3]-this.data.rect[1]-2);s=Math.min(n,roundToOneDecimal(t/1.35))}r.fontSize=`calc(${s}px * var(--total-scale-factor))`;r.color=Util.makeHexColor(...i);null===this.data.textAlignment||this.data.comb||(r.textAlign=e[this.data.textAlignment])}_setRequired(t,e){e?t.setAttribute("required",!0):t.removeAttribute("required");t.setAttribute("aria-required",e)}}class TextWidgetAnnotationElement extends WidgetAnnotationElement{constructor(t){super(t,{isRenderable:t.renderForms||t.data.hasOwnCanvas||!t.data.hasAppearance&&!!t.data.fieldValue})}setPropertyOnSiblings(t,e,i,n){const r=this.annotationStorage;for(const s of this._getElementsByName(t.name,t.id)){s.domElement&&(s.domElement[e]=i);r.setValue(s.id,{[n]:i})}}render(){const t=this.annotationStorage,e=this.data.id;this.container.classList.add("textWidgetAnnotation");let i=null;if(this.renderForms){const n=t.getValue(e,{value:this.data.fieldValue});let r=n.value||"";const s=t.getValue(e,{charLimit:this.data.maxLen}).charLimit;s&&r.length>s&&(r=r.slice(0,s));let a=n.formattedValue||this.data.textContent?.join("\n")||null;a&&this.data.comb&&(a=a.replaceAll(/\s+/g,""));const o={userValue:r,formattedValue:a,lastCommittedValue:null,commitKey:1,focused:!1};if(this.data.multiLine){i=document.createElement("textarea");i.textContent=a??r;this.data.doNotScroll&&(i.style.overflowY="hidden")}else{i=document.createElement("input");i.type=this.data.password?"password":"text";i.setAttribute("value",a??r);this.data.doNotScroll&&(i.style.overflowX="hidden")}if(this.data.hasOwnCanvas){this.container.classList.add("hasOwnCanvas");t.has(e)&&this.container.classList.add("sandboxModified")}Qn.add(i);this.contentElement=i;i.setAttribute("data-element-id",e);i.disabled=this.data.readOnly;i.name=this.data.fieldName;i.tabIndex=0;const{datetimeFormat:l,datetimeType:c,timeStep:h}=this.data,d=!!c&&this.enableScripting;l&&(i.title=l);this._setRequired(i,this.data.required);s&&(i.maxLength=s);i.addEventListener("input",n=>{t.setValue(e,{value:n.target.value});this.setPropertyOnSiblings(i,"value",n.target.value,"value");o.formattedValue=null});i.addEventListener("resetform",t=>{const e=this.data.defaultFieldValue??"";i.value=o.userValue=e;o.formattedValue=null});let blurListener=t=>{const{formattedValue:e}=o;null!=e&&(t.target.value=e);t.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){i.addEventListener("focus",t=>{if(o.focused)return;const{target:e}=t;if(d){e.type=c;h&&(e.step=h)}if(o.userValue){const t=o.userValue;if(d)if("time"===c){const i=new Date(t),n=[i.getHours(),i.getMinutes(),i.getSeconds()];e.value=n.map(t=>t.toString().padStart(2,"0")).join(":")}else e.value=new Date(t-Zn).toISOString().split("date"===c?"T":".",1)[0];else e.value=t}o.lastCommittedValue=e.value;o.commitKey=1;this.data.actions?.has("Focus")||(o.focused=!0)});i.addEventListener("updatefromsandbox",i=>{this.container.classList.add("sandboxModified");const n={value(i){o.userValue=i.detail.value??"";d||t.setValue(e,{value:o.userValue.toString()});i.target.value=o.userValue},formattedValue(i){const{formattedValue:n}=i.detail;o.formattedValue=n;null!=n&&i.target!==document.activeElement&&(i.target.value=n);const r={formattedValue:n};d&&(r.value=n);t.setValue(e,r)},selRange(t){t.target.setSelectionRange(...t.detail.selRange)},charLimit:i=>{const{charLimit:n}=i.detail,{target:r}=i;if(0===n){r.removeAttribute("maxLength");return}r.setAttribute("maxLength",n);let s=o.userValue;if(s&&!(s.length<=n)){s=s.slice(0,n);r.value=o.userValue=s;t.setValue(e,{value:s});this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:s,willCommit:!0,commitKey:1,selStart:r.selectionStart,selEnd:r.selectionEnd}})}}};this._dispatchEventFromSandbox(n,i)});i.addEventListener("keydown",t=>{o.commitKey=1;let i=-1;"Escape"===t.key?i=0:"Enter"!==t.key||this.data.multiLine?"Tab"===t.key&&(o.commitKey=3):i=2;if(-1===i)return;const{value:n}=t.target;if(o.lastCommittedValue!==n){o.lastCommittedValue=n;o.userValue=n;this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:n,willCommit:!0,commitKey:i,selStart:t.target.selectionStart,selEnd:t.target.selectionEnd}})}});const n=blurListener;blurListener=null;i.addEventListener("blur",t=>{if(!o.focused||!t.relatedTarget)return;this.data.actions?.has("Blur")||(o.focused=!1);const{target:i}=t;let{value:r}=i;if(d){if(r&&"time"===c){const t=r.split(":").map(t=>parseInt(t,10));r=new Date(2e3,0,1,t[0],t[1],t[2]||0).valueOf();i.step=""}else{r.includes("T")||(r=`${r}T00:00`);r=new Date(r).valueOf()}i.type="text"}o.userValue=r;o.lastCommittedValue!==r&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:r,willCommit:!0,commitKey:o.commitKey,selStart:t.target.selectionStart,selEnd:t.target.selectionEnd}});n(t)});this.data.actions?.has("Keystroke")&&i.addEventListener("beforeinput",t=>{o.lastCommittedValue=null;const{data:i,target:n}=t,{value:r,selectionStart:s,selectionEnd:a}=n;let l=s,c=a;switch(t.inputType){case"deleteWordBackward":{const t=/\w/;for(;l>0&&!t.test(r[l-1]);)l--;for(;l>0&&t.test(r[l-1]);)l--;break}case"deleteWordForward":{const t=r.substring(s).match(/^\W*\w*/);t&&(c+=t[0].length);break}case"deleteContentBackward":s===a&&(l-=1);break;case"deleteContentForward":s===a&&(c+=1)}t.preventDefault();this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:r,change:i||"",willCommit:!1,selStart:l,selEnd:c}})});this._setEventListeners(i,o,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],t=>t.target.value)}blurListener&&i.addEventListener("blur",blurListener);if(this.data.comb){const t=(this.data.rect[2]-this.data.rect[0])/s;i.classList.add("comb");i.style.setProperty("--comb-width",`calc(${t}px * var(--total-scale-factor))`);const e=this.data.textAlignment;if(1===e||2===e){const setCombOffset=()=>{const t=s-i.value.length;i.style.setProperty("--comb-offset",`${1===e?t>>1:t}`)};setCombOffset();for(const t of["input","blur","resetform","updatefromsandbox"])i.addEventListener(t,setCombOffset)}}}else{i=document.createElement("div");i.textContent=this.data.fieldValue;i.style.verticalAlign="middle";i.style.display="table-cell";this.data.hasOwnCanvas&&(i.hidden=!0)}this._setTextStyle(i);this._setBackgroundColor(i);this._setDefaultPropertiesFromJS(i);this.container.append(i);return this.container}}class SignatureWidgetAnnotationElement extends WidgetAnnotationElement{constructor(t){super(t,{isRenderable:!!t.data.hasOwnCanvas})}}class CheckboxWidgetAnnotationElement extends WidgetAnnotationElement{constructor(t){super(t,{isRenderable:t.renderForms})}render(){const t=this.annotationStorage,e=this.data,i=e.id;let n=t.getValue(i,{value:e.exportValue===e.fieldValue}).value;if("string"==typeof n){n="Off"!==n;t.setValue(i,{value:n})}this.container.classList.add("buttonWidgetAnnotation","checkBox");const r=document.createElement("input");Qn.add(r);r.setAttribute("data-element-id",i);r.disabled=e.readOnly;this._setRequired(r,this.data.required);r.type="checkbox";r.name=e.fieldName;n&&r.setAttribute("checked",!0);r.setAttribute("exportValue",e.exportValue);r.tabIndex=0;r.addEventListener("change",n=>{const{name:r,checked:s}=n.target;for(const n of this._getElementsByName(r,i)){const i=s&&n.exportValue===e.exportValue;n.domElement&&(n.domElement.checked=i);t.setValue(n.id,{value:i})}t.setValue(i,{value:s})});r.addEventListener("resetform",t=>{const i=e.defaultFieldValue||"Off";t.target.checked=i===e.exportValue});if(this.enableScripting&&this.hasJSActions){r.addEventListener("updatefromsandbox",e=>{const n={value(e){e.target.checked="Off"!==e.detail.value;t.setValue(i,{value:e.target.checked})}};this._dispatchEventFromSandbox(n,e)});this._setEventListeners(r,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],t=>t.target.checked)}this._setDefaultPropertiesFromJS(r);this.container.append(r);return this.container}}class RadioButtonWidgetAnnotationElement extends WidgetAnnotationElement{constructor(t){super(t,{isRenderable:t.renderForms})}render(){this.container.classList.add("buttonWidgetAnnotation","radioButton");const t=this.annotationStorage,e=this.data,i=e.id;let n=t.getValue(i,{value:null!==e.buttonValue&&e.fieldValue===e.buttonValue}).value;if("string"==typeof n){n=n!==e.buttonValue;t.setValue(i,{value:n})}if(n)for(const n of this._getElementsByName(e.fieldName,i))t.setValue(n.id,{value:!1});const r=document.createElement("input");Qn.add(r);r.setAttribute("data-element-id",i);r.disabled=e.readOnly;this._setRequired(r,this.data.required);r.type="radio";r.name=e.fieldName;n&&r.setAttribute("checked",!0);r.tabIndex=0;r.addEventListener("change",e=>{const{name:n,checked:r}=e.target;for(const e of this._getElementsByName(n,i))t.setValue(e.id,{value:!1});t.setValue(i,{value:r})});r.addEventListener("resetform",t=>{const i=e.defaultFieldValue;t.target.checked=null!=i&&i===e.buttonValue});if(this.enableScripting&&this.hasJSActions){const n=e.buttonValue;r.addEventListener("updatefromsandbox",e=>{const r={value:e=>{const r=n===e.detail.value;for(const n of this._getElementsByName(e.target.name)){const e=r&&n.id===i;n.domElement&&(n.domElement.checked=e);t.setValue(n.id,{value:e})}}};this._dispatchEventFromSandbox(r,e)});this._setEventListeners(r,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],t=>t.target.checked)}this._setDefaultPropertiesFromJS(r);this.container.append(r);return this.container}}class PushButtonWidgetAnnotationElement extends LinkAnnotationElement{constructor(t){super(t,{ignoreBorder:t.data.hasAppearance})}render(){const t=super.render();t.classList.add("buttonWidgetAnnotation","pushButton");const e=t.lastChild;if(this.enableScripting&&this.hasJSActions&&e){this._setDefaultPropertiesFromJS(e);e.addEventListener("updatefromsandbox",t=>{this._dispatchEventFromSandbox({},t)})}return t}}class ChoiceWidgetAnnotationElement extends WidgetAnnotationElement{constructor(t){super(t,{isRenderable:t.renderForms})}render(){this.container.classList.add("choiceWidgetAnnotation");const t=this.annotationStorage,e=this.data.id,i=t.getValue(e,{value:this.data.fieldValue}),n=document.createElement("select");Qn.add(n);n.setAttribute("data-element-id",e);n.disabled=this.data.readOnly;this._setRequired(n,this.data.required);n.name=this.data.fieldName;n.tabIndex=0;let r=this.data.combo&&this.data.options.length>0;if(!this.data.combo){n.size=this.data.options.length;this.data.multiSelect&&(n.multiple=!0)}n.addEventListener("resetform",t=>{const e=this.data.defaultFieldValue;for(const t of n.options)t.selected=t.value===e});const fixDisplayValue=(t,e)=>{const i=e.replaceAll(" "," ");t.textContent=i;i!==e&&t.setAttribute("display-value",e)};for(const t of this.data.options){const e=document.createElement("option");fixDisplayValue(e,t.displayValue);e.value=t.exportValue;if(i.value.includes(t.exportValue)){e.setAttribute("selected",!0);r=!1}n.append(e)}let s=null;if(r){const t=document.createElement("option");t.value=" ";t.setAttribute("hidden",!0);t.setAttribute("selected",!0);n.prepend(t);s=()=>{t.remove();n.removeEventListener("input",s);s=null};n.addEventListener("input",s)}const getValue=t=>{const e=t?"value":"textContent",{options:i,multiple:r}=n;return r?Array.prototype.filter.call(i,t=>t.selected).map(t=>t[e]):-1===i.selectedIndex?null:i[i.selectedIndex][e]};let a=getValue(!1);const getItems=t=>{const e=t.target.options;return Array.prototype.map.call(e,t=>({displayValue:t.getAttribute("display-value")||t.textContent,exportValue:t.value}))};if(this.enableScripting&&this.hasJSActions){n.addEventListener("updatefromsandbox",i=>{const r={value(i){s?.();const r=i.detail.value,o=new Set(Array.isArray(r)?r:[r]);for(const t of n.options)t.selected=o.has(t.value);t.setValue(e,{value:getValue(!0)});a=getValue(!1)},multipleSelection(t){n.multiple=!0},remove(i){const r=n.options,s=i.detail.remove;r[s].selected=!1;n.remove(s);if(r.length>0){-1===Array.prototype.findIndex.call(r,t=>t.selected)&&(r[0].selected=!0)}t.setValue(e,{value:getValue(!0),items:getItems(i)});a=getValue(!1)},clear(i){for(;0!==n.length;)n.remove(0);t.setValue(e,{value:null,items:[]});a=getValue(!1)},insert(i){const{index:r,displayValue:s,exportValue:o}=i.detail.insert,l=n.children[r],c=document.createElement("option");fixDisplayValue(c,s);c.value=o;l?l.before(c):n.append(c);t.setValue(e,{value:getValue(!0),items:getItems(i)});a=getValue(!1)},items(i){const{items:r}=i.detail;for(;0!==n.length;)n.remove(0);for(const t of r){const{displayValue:e,exportValue:i}=t,r=document.createElement("option");fixDisplayValue(r,e);r.value=i;n.append(r)}n.options.length>0&&(n.options[0].selected=!0);t.setValue(e,{value:getValue(!0),items:getItems(i)});a=getValue(!1)},indices(i){const n=new Set(i.detail.indices);for(const t of i.target.options)t.selected=n.has(t.index);t.setValue(e,{value:getValue(!0)});a=getValue(!1)},editable(t){t.target.disabled=!t.detail.editable}};this._dispatchEventFromSandbox(r,i)});n.addEventListener("input",i=>{const n=getValue(!0),r=getValue(!1);t.setValue(e,{value:n});i.preventDefault();this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:a,change:r,changeEx:n,willCommit:!1,commitKey:1,keyDown:!1}})});this._setEventListeners(n,null,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"],["input","Action"],["input","Validate"]],t=>t.target.value)}else n.addEventListener("input",function(i){t.setValue(e,{value:getValue(!0)})});this.data.combo&&this._setTextStyle(n);this._setBackgroundColor(n);this._setDefaultPropertiesFromJS(n);this.container.append(n);return this.container}}class PopupAnnotationElement extends AnnotationElement{constructor(t){const{data:e,elements:i,parent:n}=t,r=!!n._commentManager;super(t,{isRenderable:!r&&AnnotationElement._hasPopupData(e)});this.elements=i;if(r&&AnnotationElement._hasPopupData(e)){const t=this.popup=this.#Wa();for(const e of i)e.popup=t}else this.popup=null}#Wa(){return new PopupElement({container:this.container,color:this.data.color,titleObj:this.data.titleObj,modificationDate:this.data.modificationDate||this.data.creationDate,contentsObj:this.data.contentsObj,richText:this.data.richText,rect:this.data.rect,parentRect:this.data.parentRect||null,parent:this.parent,elements:this.elements,open:this.data.open,commentManager:this.parent._commentManager})}render(){const{container:t}=this;t.classList.add("popupAnnotation");t.role="comment";const e=this.popup=this.#Wa(),i=[];for(const t of this.elements){t.popup=e;t.container.ariaHasPopup="dialog";i.push(t.data.id);t.addHighlightArea()}this.container.setAttribute("aria-controls",i.map(t=>`${Si}${t}`).join(","));return this.container}}class PopupElement{#X=null;#Va=this.#Ma.bind(this);#$a=this.#qa.bind(this);#Xa=this.#Ka.bind(this);#Ya=this.#Ja.bind(this);#Qa=null;#Pt=null;#Za=null;#to=null;#eo=null;#io=null;#no=null;#ro=!1;#so=null;#ao=null;#O=null;#oo=null;#lo=null;#Ae=null;#co=null;#ye=null;#ho=null;#La=null;#do=!1;#uo=null;#po=null;constructor({container:t,color:e,elements:i,titleObj:n,modificationDate:r,contentsObj:s,richText:a,parent:o,rect:l,parentRect:c,open:h,commentManager:d=null}){this.#Pt=t;this.#ho=n;this.#Za=s;this.#ye=a;this.#io=o;this.#Qa=e;this.#co=l;this.#no=c;this.#eo=i;this.#X=d;this.#uo=i[0];this.#to=PDFDateString.toDateObject(r);this.trigger=i.flatMap(t=>t.getElementsToTriggerPopup());if(!d){this.#go();this.#Pt.hidden=!0;h&&this.#Ja()}}#go(){if(this.#ao)return;this.#ao=new AbortController;const{signal:t}=this.#ao;for(const e of this.trigger){e.addEventListener("click",this.#Ya,{signal:t});e.addEventListener("pointerenter",this.#Xa,{signal:t});e.addEventListener("pointerleave",this.#$a,{signal:t});e.classList.add("popupTriggerArea")}for(const e of this.#eo)e.container?.addEventListener("keydown",this.#Va,{signal:t})}#fo(){const t=this.#eo.find(t=>t.hasCommentButton);t&&(this.#lo=t._normalizePoint(t.commentButtonPosition))}renderCommentButton(){if(this.#oo){this.#oo.parentNode||this.#uo.container.after(this.#oo);return}this.#lo||this.#fo();if(!this.#lo)return;const{signal:t}=this.#ao=new AbortController,e=this.#uo.hasOwnCommentButton,togglePopup=()=>{this.#X.toggleCommentPopup(this,!0,void 0,!e)},showPopup=()=>{this.#X.toggleCommentPopup(this,!1,!0,!e)},hidePopup=()=>{this.#X.toggleCommentPopup(this,!1,!1)};if(e){this.#oo=this.#uo.container;for(const e of this.trigger){e.ariaHasPopup="dialog";e.ariaControls="commentPopup";e.addEventListener("keydown",this.#Va,{signal:t});e.addEventListener("click",togglePopup,{signal:t});e.addEventListener("pointerenter",showPopup,{signal:t});e.addEventListener("pointerleave",hidePopup,{signal:t});e.classList.add("popupTriggerArea")}}else{const e=this.#oo=document.createElement("button");e.className="annotationCommentButton";const i=this.#uo.container;e.style.zIndex=parseInt(i.style.zIndex,10)+1;e.tabIndex=0;e.ariaHasPopup="dialog";e.ariaControls="commentPopup";e.setAttribute("data-l10n-id","pdfjs-show-comment-button");this.#mo();this.#bo();e.addEventListener("keydown",this.#Va,{signal:t});e.addEventListener("click",togglePopup,{signal:t});e.addEventListener("pointerenter",showPopup,{signal:t});e.addEventListener("pointerleave",hidePopup,{signal:t});i.after(e)}}#bo(){if(this.#uo.extraPopupElement&&!this.#uo.editor)return;this.#oo||this.renderCommentButton();const[t,e]=this.#lo,{style:i}=this.#oo;i.left=`calc(${t}%)`;i.top=`calc(${e}% - var(--comment-button-dim))`}#mo(){if(!this.#uo.extraPopupElement){this.#oo||this.renderCommentButton();this.#oo.style.backgroundColor=this.commentButtonColor||""}}get commentButtonColor(){const{color:t,opacity:e}=this.#uo.commentData;return t?this.#io._commentManager.makeCommentColor(t,e):null}focusCommentButton(){setTimeout(()=>{this.#oo?.focus()},0)}getData(){const{richText:t,color:e,opacity:i,creationDate:n,modificationDate:r}=this.#uo.commentData;return{contentsObj:{str:this.comment},richText:t,color:e,opacity:i,creationDate:n,modificationDate:r}}get elementBeforePopup(){return this.#oo}get comment(){this.#po||=this.#uo.commentText;return this.#po}set comment(t){t!==this.comment&&(this.#uo.commentText=this.#po=t)}focus(){this.#uo.container?.focus()}get parentBoundingClientRect(){return this.#uo.layer.getBoundingClientRect()}setCommentButtonStates({selected:t,hasPopup:e}){if(this.#oo){this.#oo.classList.toggle("selected",t);this.#oo.ariaExpanded=e}}setSelectedCommentButton(t){this.#oo.classList.toggle("selected",t)}get commentPopupPosition(){if(this.#Ae)return this.#Ae;const{x:t,y:e,height:i}=this.#oo.getBoundingClientRect(),{x:n,y:r,width:s,height:a}=this.#uo.layer.getBoundingClientRect();return[(t-n)/s,(e+i-r)/a]}set commentPopupPosition(t){this.#Ae=t}hasDefaultPopupPosition(){return null===this.#Ae}get commentButtonPosition(){return this.#lo}get commentButtonWidth(){return this.#oo.getBoundingClientRect().width/this.parentBoundingClientRect.width}editComment(t){const[e,i]=this.#Ae||this.commentButtonPosition.map(t=>t/100),n=this.parentBoundingClientRect,{x:r,y:s,width:a,height:o}=n;this.#X.showDialog(null,this,r+e*a,s+i*o,{...t,parentDimensions:n})}render(){if(this.#so)return;const t=this.#so=document.createElement("div");t.className="popup";if(this.#Qa){const e=t.style.outlineColor=Util.makeHexColor(...this.#Qa);t.style.backgroundColor=`color-mix(in srgb, ${e} 30%, white)`}const e=document.createElement("span");e.className="header";if(this.#ho?.str){const t=document.createElement("span");t.className="title";e.append(t);({dir:t.dir,str:t.textContent}=this.#ho)}t.append(e);if(this.#to){const t=document.createElement("time");t.className="popupDate";t.setAttribute("data-l10n-id","pdfjs-annotation-date-time-string");t.setAttribute("data-l10n-args",JSON.stringify({dateObj:this.#to.valueOf()}));t.dateTime=this.#to.toISOString();e.append(t)}renderRichText({html:this.#yo||this.#Za.str,dir:this.#Za?.dir,className:"popupContent"},t);this.#Pt.append(t)}get#yo(){const t=this.#ye,e=this.#Za;return!t?.str||e?.str&&e.str!==t.str?null:this.#ye.html||null}get#wo(){return this.#yo?.attributes?.style?.fontSize||0}get#vo(){return this.#yo?.attributes?.style?.color||null}#_o(t){const e=[],i={str:t,html:{name:"div",attributes:{dir:"auto"},children:[{name:"p",children:e}]}},n={style:{color:this.#vo,fontSize:this.#wo?`calc(${this.#wo}px * var(--total-scale-factor))`:""}};for(const i of t.split("\n"))e.push({name:"span",value:i,attributes:n});return i}#Ma(t){t.altKey||t.shiftKey||t.ctrlKey||t.metaKey||("Enter"===t.key||"Escape"===t.key&&this.#ro)&&this.#Ja()}updateEdited({rect:t,popup:e,deleted:i}){if(this.#X){if(i){this.remove();this.#po=null}else if(e)if(e.deleted)this.remove();else{this.#mo();this.#po=e.text}if(t){this.#lo=null;this.#fo();this.#bo()}}else if(i||e?.deleted)this.remove();else{this.#go();this.#La||={contentsObj:this.#Za,richText:this.#ye};t&&(this.#O=null);if(e&&e.text){this.#ye=this.#_o(e.text);this.#to=PDFDateString.toDateObject(e.date);this.#Za=null}this.#so?.remove();this.#so=null}}resetEdited(){if(this.#La){({contentsObj:this.#Za,richText:this.#ye}=this.#La);this.#La=null;this.#so?.remove();this.#so=null;this.#O=null}}remove(){this.#ao?.abort();this.#ao=null;this.#so?.remove();this.#so=null;this.#do=!1;this.#ro=!1;this.#oo?.remove();this.#oo=null;if(this.trigger)for(const t of this.trigger)t.classList.remove("popupTriggerArea")}#Ao(){if(null!==this.#O)return;const{page:{view:t},viewport:{rawDims:{pageWidth:e,pageHeight:i,pageX:n,pageY:r}}}=this.#io;let s=!!this.#no,a=s?this.#no:this.#co;for(const t of this.#eo)if(!a||null!==Util.intersect(t.data.rect,a)){a=t.data.rect;s=!0;break}const o=Util.normalizeRect([a[0],t[3]-a[1]+t[1],a[2],t[3]-a[3]+t[1]]),l=s?a[2]-a[0]+5:0,c=o[0]+l,h=o[1];this.#O=[100*(c-n)/e,100*(h-r)/i];const{style:d}=this.#Pt;d.left=`${this.#O[0]}%`;d.top=`${this.#O[1]}%`}#Ja(){if(this.#X)this.#X.toggleCommentPopup(this,!1);else{this.#ro=!this.#ro;if(this.#ro){this.#Ka();this.#Pt.addEventListener("click",this.#Ya);this.#Pt.addEventListener("keydown",this.#Va)}else{this.#qa();this.#Pt.removeEventListener("click",this.#Ya);this.#Pt.removeEventListener("keydown",this.#Va)}}}#Ka(){this.#so||this.render();if(this.isVisible)this.#ro&&this.#Pt.classList.add("focused");else{this.#Ao();this.#Pt.hidden=!1;this.#Pt.style.zIndex=parseInt(this.#Pt.style.zIndex,10)+1e3}}#qa(){this.#Pt.classList.remove("focused");if(!this.#ro&&this.isVisible){this.#Pt.hidden=!0;this.#Pt.style.zIndex=parseInt(this.#Pt.style.zIndex,10)-1e3}}forceHide(){this.#do=this.isVisible;this.#do&&(this.#Pt.hidden=!0)}maybeShow(){if(!this.#X){this.#go();if(this.#do){this.#so||this.#Ka();this.#do=!1;this.#Pt.hidden=!1}}}get isVisible(){return!this.#X&&!1===this.#Pt.hidden}}class FreeTextAnnotationElement extends AnnotationElement{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0});this.textContent=t.data.textContent;this.textPosition=t.data.textPosition;this.annotationEditorType=ki.FREETEXT}render(){this.container.classList.add("freeTextAnnotation");if(this.textContent){const t=this.contentElement=document.createElement("div");t.classList.add("annotationTextContent");t.setAttribute("role","comment");for(const e of this.textContent){const i=document.createElement("span");i.textContent=e;t.append(i)}this.container.append(t)}if(!this.data.popupRef&&this.hasPopupData){this.hasOwnCommentButton=!0;this._createPopup()}this._editOnDoubleClick();return this.container}}class LineAnnotationElement extends AnnotationElement{#xo=null;constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("lineAnnotation");const{data:t,width:e,height:i}=this,n=this.svgFactory.create(e,i,!0),r=this.#xo=this.svgFactory.createElement("svg:line");r.setAttribute("x1",t.rect[2]-t.lineCoordinates[0]);r.setAttribute("y1",t.rect[3]-t.lineCoordinates[1]);r.setAttribute("x2",t.rect[2]-t.lineCoordinates[2]);r.setAttribute("y2",t.rect[3]-t.lineCoordinates[3]);r.setAttribute("stroke-width",t.borderStyle.width||1);r.setAttribute("stroke","transparent");r.setAttribute("fill","transparent");n.append(r);this.container.append(n);if(!t.popupRef&&this.hasPopupData){this.hasOwnCommentButton=!0;this._createPopup()}return this.container}getElementsToTriggerPopup(){return this.#xo}addHighlightArea(){this.container.classList.add("highlightArea")}}class SquareAnnotationElement extends AnnotationElement{#Eo=null;constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("squareAnnotation");const{data:t,width:e,height:i}=this,n=this.svgFactory.create(e,i,!0),r=t.borderStyle.width,s=this.#Eo=this.svgFactory.createElement("svg:rect");s.setAttribute("x",r/2);s.setAttribute("y",r/2);s.setAttribute("width",e-r);s.setAttribute("height",i-r);s.setAttribute("stroke-width",r||1);s.setAttribute("stroke","transparent");s.setAttribute("fill","transparent");n.append(s);this.container.append(n);if(!t.popupRef&&this.hasPopupData){this.hasOwnCommentButton=!0;this._createPopup()}return this.container}getElementsToTriggerPopup(){return this.#Eo}addHighlightArea(){this.container.classList.add("highlightArea")}}class CircleAnnotationElement extends AnnotationElement{#Co=null;constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("circleAnnotation");const{data:t,width:e,height:i}=this,n=this.svgFactory.create(e,i,!0),r=t.borderStyle.width,s=this.#Co=this.svgFactory.createElement("svg:ellipse");s.setAttribute("cx",e/2);s.setAttribute("cy",i/2);s.setAttribute("rx",e/2-r/2);s.setAttribute("ry",i/2-r/2);s.setAttribute("stroke-width",r||1);s.setAttribute("stroke","transparent");s.setAttribute("fill","transparent");n.append(s);this.container.append(n);if(!t.popupRef&&this.hasPopupData){this.hasOwnCommentButton=!0;this._createPopup()}return this.container}getElementsToTriggerPopup(){return this.#Co}addHighlightArea(){this.container.classList.add("highlightArea")}}class PolylineAnnotationElement extends AnnotationElement{#So=null;constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0});this.containerClassName="polylineAnnotation";this.svgElementName="svg:polyline"}render(){this.container.classList.add(this.containerClassName);const{data:{rect:t,vertices:e,borderStyle:i,popupRef:n},width:r,height:s}=this;if(!e)return this.container;const a=this.svgFactory.create(r,s,!0);let o=[];for(let i=0,n=e.length;i=0&&r.setAttribute("stroke-width",e||1);if(i)for(let t=0,e=this.#ko.length;t{"Enter"===t.key&&(n?t.metaKey:t.ctrlKey)&&this.#Mo()});if(!e.popupRef&&this.hasPopupData){this.hasOwnCommentButton=!0;this._createPopup()}else i.classList.add("popupTriggerArea");t.append(i);return t}getElementsToTriggerPopup(){return this.#Po}addHighlightArea(){this.container.classList.add("highlightArea")}async#Mo(){const{fileId:t,filename:e,content:i}=this,n=await this.linkService.getAttachmentContent(t)||i;n&&this.downloadManager?.openOrDownloadData(n,e)}}class MediaAnnotationElement extends AnnotationElement{#L=new AbortController;#Io=null;#Fo=null;constructor(t){super(t,{isRenderable:!!t.data.richMedia})}render(){this.container.classList.add("mediaAnnotation");const{filename:t}=this.data.richMedia,e=document.createElement("button");e.className="mediaPlayButton";e.type="button";e.title=e.ariaLabel=t;e.addEventListener("click",()=>this.#Oo(e),{signal:this.#L.signal});this.container.append(e);return this.container}async#Oo(t){const{fileId:e,filename:i,contentType:n}=this.data.richMedia;t.disabled=!0;let r;try{r=await this.linkService.getAttachmentContent(e)}catch{return}finally{t.disabled=!1}if(!r||!t.isConnected)return;const{signal:s}=this.#L,a=new Blob([r],{type:n});if(!/^(?:video|audio)\//.test(a.type))return;const o=URL.createObjectURL(a);this.#Io=o;const l=a.type.startsWith("audio/"),c=document.createElement(l?"audio":"video");this.#Fo=c;c.className="mediaContent";this._setBackgroundColor(c);c.src=o;c.title=i;c.controls=!0;c.autoplay=!0;c.tabIndex=0;if(l){let t=!1,e=!1;const updateControls=()=>{c.controls=t||e};this.container.addEventListener("pointerenter",()=>{t=!0;updateControls()},{signal:s});this.container.addEventListener("pointerleave",()=>{t=!1;updateControls()},{signal:s});this.container.addEventListener("focusin",()=>{e=!0;updateControls()},{signal:s});this.container.addEventListener("focusout",()=>{e=!1;updateControls()},{signal:s})}c.addEventListener("emptied",()=>this.#Ro(o),{once:!0,signal:s});t.replaceWith(c);c.play().catch(()=>{})}#Ro(t=this.#Io){if(t&&t===this.#Io){URL.revokeObjectURL(t);this.#Io=null}}destroy(){this.#L.abort();if(this.#Fo){this.#Fo.pause();this.#Fo.removeAttribute("src");this.#Fo.load();this.#Fo=null}this.#Ro()}}class AnnotationLayer{#Bo=null;#Lo=null;#V=null;#No=new Map;#Uo=null;#Ho=null;#eo=[];#zo=!1;zIndex=0;constructor({div:t,accessibilityManager:e,annotationCanvasMap:i,annotationEditorUIManager:n,page:r,viewport:s,structTreeLayer:a,commentManager:o,linkService:l,annotationStorage:c}){this.div=t;this.#Bo=e;this.#Lo=i;this.#Uo=a||null;this.#Ho=l||null;this.#V=c||new AnnotationStorage;this.page=r;this.viewport=s;this._annotationEditorUIManager=n;this._commentManager=o||null}hasEditableAnnotations(){return this.#No.size>0}async render(t){const{annotations:e,optionalContentConfig:i}=t,n=this.div;setLayerDimensions(n,this.viewport);const r=new Map,s=[],a={data:null,layer:n,linkService:this.#Ho,downloadManager:t.downloadManager,imageResourcesPath:t.imageResourcesPath||"",renderForms:!1!==t.renderForms,svgFactory:new DOMSVGFactory,annotationStorage:this.#V,enableComment:!0===t.enableComment,enableScripting:!0===t.enableScripting,hasJSActions:t.hasJSActions,fieldObjects:t.fieldObjects,parent:this,elements:null};for(const t of e){if(t.noHTML)continue;const e=t.annotationType===Ni.POPUP;if(e){const e=r.get(t.id);if(!e)continue;if(!this._commentManager){s.push(t);continue}a.elements=e}else if(t.rect[2]===t.rect[0]||t.rect[3]===t.rect[1])continue;a.data=t;const n=AnnotationElementFactory.create(a);if(!n.isRenderable)continue;if(!e){this.#eo.push(n);t.popupRef&&r.getOrInsertComputed(t.popupRef,makeArr).push(n)}const o=n.render();t.hidden&&(o.style.visibility="hidden");n.updateOC(i);if(n._isEditable){this.#No.set(n.data.id,n);this._annotationEditorUIManager?.renderAnnotationElement(n)}}await this.#Go();for(const t of s){const e=a.elements=r.get(t.id);a.data=t;const i=AnnotationElementFactory.create(a);if(!i.isRenderable)continue;const n=i.render();i.contentElement.id=`${Si}${t.id}`;t.hidden&&(n.style.visibility="hidden");e.at(-1).container.after(n)}this.#jo()}async#Go(){if(0===this.#eo.length)return;this.div.replaceChildren();const t=[];if(!this.#zo){this.#zo=!0;for(const{contentElement:e,data:{hidden:i,id:n,oc:r}}of this.#eo){const s=e.id=`${Si}${n}`,a="a"===e.localName&&!i&&!r;t.push(this.#Uo?.getAriaAttributes(s,{enableLinkOwnership:a}).then(t=>{if(t)for(const[i,n]of t)e.setAttribute(i,n)}))}}this.#eo.sort(({data:{rect:[t,e,i,n]}},{data:{rect:[r,s,a,o]}})=>{if(t===i&&e===n)return 1;if(r===a&&s===o)return-1;const l=(e+n)/2,c=(s+o)/2;if(l>=o&&c<=e)return-1;if(c>=n&&l<=s)return 1;return(t+i)/2-(r+a)/2});const e=document.createDocumentFragment();for(const t of this.#eo){e.append(t.container);this._commentManager?(t.extraPopupElement?.popup||t.popup)?.renderCommentButton():t.extraPopupElement&&e.append(t.extraPopupElement.render())}this.div.append(e);await Promise.all(t);if(this.#Bo){const t=await(this.#Uo?.getAnnotationIds());for(const{contentElement:e}of this.#eo)t?.has(e.id)||this.#Bo.addPointerInTextLayer(e,!1)}}async addLinkAnnotations(t){const e={data:null,layer:this.div,linkService:this.#Ho,svgFactory:new DOMSVGFactory,parent:this};for(const i of t){i.borderStyle||=AnnotationLayer._defaultBorderStyle;e.data=i;const t=AnnotationElementFactory.create(e);if(t.isRenderable){t.render();t.contentElement.id=`${Si}${i.id}`;this.#eo.push(t)}}await this.#Go()}update({viewport:t,optionalContentConfig:e}){const i=this.div;this.viewport=t;setLayerDimensions(i,{rotation:t.rotation});for(const t of this.#eo)t.updateOC(e);this.#jo();i.hidden=!1}destroy(){for(const t of this.#eo){t.destroy?.();this.#Bo?.removePointerInTextLayer(t.contentElement)}this.#eo.length=0;this.#No.clear();this.div.replaceChildren()}#jo(){if(!this.#Lo)return;const t=this.div;for(const[e,i]of this.#Lo){const n=t.querySelector(`[data-annotation-id="${e}"]`);if(!n)continue;if(Array.isArray(i))for(const t of i){t.className="annotationContent";t.ariaHidden=!0}else{i.className="annotationContent";i.ariaHidden=!0}const r=[];for(const t of n.children)"CANVAS"===t.nodeName&&r.push(t);for(const t of r)t.remove();const s=Array.isArray(i)?i[0]:i,{firstChild:a}=n;a?a.classList.contains("annotationContent")?a.after(s):a.before(s):n.append(s);if(Array.isArray(i)){let t=s;for(let e=1,n=i.length;ee.data.id===t);if(e<0)return;const[i]=this.#eo.splice(e,1);this.#Bo?.removePointerInTextLayer(i.contentElement)}updateFakeAnnotations(t){if(0!==t.length){for(const e of t)e.updateFakeAnnotationElement(this);this.#Go()}}togglePointerEvents(t=!1){this.div.classList.toggle("disabled",!t)}static get _defaultBorderStyle(){return util_shadow(this,"_defaultBorderStyle",Object.freeze({width:1,rawWidth:1,style:Ui,dashArray:[3],horizontalCornerRadius:0,verticalCornerRadius:0}))}}const tr=/\r\n?|\n/g;class FreeTextEditor extends AnnotationEditor{#Wo="";#Vo=`${this.id}-editor`;#$o=null;#wo;_colorPicker=null;static _freeTextDefaultContent="";static _internalPadding=0;static _defaultColor=null;static _defaultFontSize=10;static get _keyboardManager(){const t=FreeTextEditor.prototype,arrowChecker=t=>t.isEmpty(),e=AnnotationEditorUIManager.TRANSLATE_SMALL,i=AnnotationEditorUIManager.TRANSLATE_BIG;return util_shadow(this,"_keyboardManager",new KeyboardManager([[["ctrl+s","mac+meta+s","ctrl+p","mac+meta+p"],t.commitOrRemove,{bubbles:!0}],[["ctrl+Enter","mac+meta+Enter"],t.commitOrRemove],[["Escape"],t.commitOrRemove],[["ArrowLeft"],t._translateEmpty,{args:[-e,0],checker:arrowChecker}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t._translateEmpty,{args:[-i,0],checker:arrowChecker}],[["ArrowRight"],t._translateEmpty,{args:[e,0],checker:arrowChecker}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t._translateEmpty,{args:[i,0],checker:arrowChecker}],[["ArrowUp"],t._translateEmpty,{args:[0,-e],checker:arrowChecker}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t._translateEmpty,{args:[0,-i],checker:arrowChecker}],[["ArrowDown"],t._translateEmpty,{args:[0,e],checker:arrowChecker}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t._translateEmpty,{args:[0,i],checker:arrowChecker}]]))}static _type="freetext";static _editorType=ki.FREETEXT;constructor(t){super({...t,name:"freeTextEditor"});this.color=t.color||FreeTextEditor._defaultColor||AnnotationEditor._defaultLineColor;this.#wo=t.fontSize||FreeTextEditor._defaultFontSize;this.annotationElementId||this._uiManager.a11yAlert(AnnotationEditor._l10nAlert.freetext);this.canAddComment=!1}static initialize(t,e){AnnotationEditor.initialize(t,e);const i=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(i.getPropertyValue("--freetext-padding"))}static updateDefaultParams(t,e){switch(t){case Di.FREETEXT_SIZE:FreeTextEditor._defaultFontSize=e;break;case Di.FREETEXT_COLOR:FreeTextEditor._defaultColor=e}}updateParams(t,e){switch(t){case Di.FREETEXT_SIZE:this.#qo(e);break;case Di.FREETEXT_COLOR:this.#mo(e)}}static get defaultPropertiesToUpdate(){return[[Di.FREETEXT_SIZE,FreeTextEditor._defaultFontSize],[Di.FREETEXT_COLOR,FreeTextEditor._defaultColor||AnnotationEditor._defaultLineColor]]}get propertiesToUpdate(){return[[Di.FREETEXT_SIZE,this.#wo],[Di.FREETEXT_COLOR,this.color]]}get toolbarButtons(){this._colorPicker||=new BasicColorPicker(this);return[["colorPicker",this._colorPicker]]}get colorType(){return Di.FREETEXT_COLOR}#qo(t){const setFontsize=t=>{this.editorDiv.style.fontSize=`calc(${t}px * var(--total-scale-factor))`;this.translate(0,-(t-this.#wo)*this.parentScale);this.#wo=t;this.#Xo()},e=this.#wo;this.addCommands({cmd:setFontsize.bind(this,t),undo:setFontsize.bind(this,e),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:Di.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})}onUpdatedColor(){this.editorDiv.style.color=this.color;this._colorPicker?.update(this.color);super.onUpdatedColor()}#mo(t){const setColor=t=>{this.color=t;this.onUpdatedColor()},e=this.color;this.addCommands({cmd:setColor.bind(this,t),undo:setColor.bind(this,e),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:Di.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})}_translateEmpty(t,e){this._uiManager.translateSelectedEditors(t,e,!0)}getInitialTranslation(){const t=this.parentScale;return[-FreeTextEditor._internalPadding*t,-(FreeTextEditor._internalPadding+this.#wo)*t]}rebuild(){if(this.parent){super.rebuild();null!==this.div&&(this.isAttachedToDOM||this.parent.add(this))}}enableEditMode(){if(!super.enableEditMode())return!1;this.overlayDiv.classList.remove("enabled");this.editorDiv.contentEditable=!0;this._isDraggable=!1;this.div.removeAttribute("aria-activedescendant");this.#$o=new AbortController;const t=this._uiManager.combinedSignal(this.#$o);this.editorDiv.addEventListener("keydown",this.editorDivKeydown.bind(this),{signal:t});this.editorDiv.addEventListener("focus",this.editorDivFocus.bind(this),{signal:t});this.editorDiv.addEventListener("blur",this.editorDivBlur.bind(this),{signal:t});this.editorDiv.addEventListener("input",this.editorDivInput.bind(this),{signal:t});this.editorDiv.addEventListener("paste",this.editorDivPaste.bind(this),{signal:t});return!0}disableEditMode(){if(!super.disableEditMode())return!1;this.overlayDiv.classList.add("enabled");this.editorDiv.contentEditable=!1;this.div.setAttribute("aria-activedescendant",this.#Vo);this._isDraggable=!0;this.#$o?.abort();this.#$o=null;this.div.focus({preventScroll:!0});this.isEditing=!1;this.parent.div.classList.add("freetextEditing");return!0}focusin(t){if(this._focusEventsAllowed){super.focusin(t);t.target!==this.editorDiv&&this.editorDiv.focus()}}onceAdded(t){if(!this.width){this.enableEditMode();t&&this.editorDiv.focus();this._initialOptions?.isCentered&&this.center();this._initialOptions=null}}isEmpty(){return!this.editorDiv||""===this.editorDiv.innerText.trim()}remove(){this.isEditing=!1;if(this.parent){this.parent.setEditingState(!0);this.parent.div.classList.add("freetextEditing")}super.remove()}#Ko(){const t=[];this.editorDiv.normalize();let e=null;for(const i of this.editorDiv.childNodes)if(e?.nodeType!==Node.TEXT_NODE||"BR"!==i.nodeName){t.push(FreeTextEditor.#Yo(i));e=i}return t.join("\n")}#Xo(){const[t,e]=this.parentDimensions;let i;if(this.isAttachedToDOM)i=this.div.getBoundingClientRect();else{const{currentLayer:t,div:e}=this,n=e.style.display,r=e.classList.contains("hidden");e.classList.remove("hidden");e.style.display="hidden";t.div.append(this.div);i=e.getBoundingClientRect();e.remove();e.style.display=n;e.classList.toggle("hidden",r)}if(this.rotation%180==this.parentRotation%180){this.width=i.width/t;this.height=i.height/e}else{this.width=i.height/t;this.height=i.width/e}this.fixAndSetPosition()}commit(){if(!this.isInEditMode())return;super.commit();this.disableEditMode();const t=this.#Wo,e=this.#Wo=this.#Ko().trimEnd();if(t===e)return;const setText=t=>{this.#Wo=t;if(t){this.#Jo();this._uiManager.rebuild(this);this.#Xo()}else this.remove()};this.addCommands({cmd:()=>{setText(e)},undo:()=>{setText(t)},mustExec:!1});this.#Xo()}shouldGetKeyboardEvents(){return this.isInEditMode()}enterInEditMode(){this.enableEditMode();this.editorDiv.focus()}keydown(t){if(t.target===this.div&&"Enter"===t.key){this.enterInEditMode();t.preventDefault()}}editorDivKeydown(t){FreeTextEditor._keyboardManager.exec(this,t)}editorDivFocus(t){this.isEditing=!0}editorDivBlur(t){this.isEditing=!1}editorDivInput(t){this.parent.div.classList.toggle("freetextEditing",this.isEmpty())}disableEditing(){this.editorDiv.setAttribute("role","comment");this.editorDiv.removeAttribute("aria-multiline")}enableEditing(){this.editorDiv.setAttribute("role","textbox");this.editorDiv.setAttribute("aria-multiline",!0)}get canChangeContent(){return!0}render(){if(this.div)return this.div;let t,e;if(this._isCopy||this.annotationElementId){t=this.x;e=this.y}super.render();this.editorDiv=document.createElement("div");this.editorDiv.className="internal";this.editorDiv.setAttribute("id",this.#Vo);this.editorDiv.setAttribute("data-l10n-id","pdfjs-free-text2");this.editorDiv.setAttribute("data-l10n-attrs","default-content");this.enableEditing();this.editorDiv.contentEditable=!0;const{style:i}=this.editorDiv;i.fontSize=`calc(${this.#wo}px * var(--total-scale-factor))`;i.color=this.color;this.div.append(this.editorDiv);this.overlayDiv=document.createElement("div");this.overlayDiv.classList.add("overlay","enabled");this.div.append(this.overlayDiv);if(this._isCopy||this.annotationElementId){const[i,n]=this.parentDimensions;if(this.annotationElementId){const{position:r}=this._initialData;let[s,a]=this.getInitialTranslation();[s,a]=this.pageTranslationToScreen(s,a);const[o,l]=this.pageDimensions,[c,h]=this.pageTranslation;let d,u;switch(this.rotation){case 0:d=t+(r[0]-c)/o;u=e+this.height-(r[1]-h)/l;break;case 90:d=t+(r[0]-c)/o;u=e-(r[1]-h)/l;[s,a]=[a,-s];break;case 180:d=t-this.width+(r[0]-c)/o;u=e-(r[1]-h)/l;[s,a]=[-s,-a];break;case 270:d=t+(r[0]-c-this.height*l)/o;u=e+(r[1]-h-this.width*o)/l;[s,a]=[-a,s]}this.setAt(d*i,u*n,s,a)}else this._moveAfterPaste(t,e);this.#Jo();this._isDraggable=!0;this.editorDiv.contentEditable=!1}else{this._isDraggable=!1;this.editorDiv.contentEditable=!0}return this.div}static#Yo(t){return(t.nodeType===Node.TEXT_NODE?t.nodeValue:t.innerText).replaceAll(tr,"")}editorDivPaste(t){const e=t.clipboardData||window.clipboardData,{types:i}=e;if(1===i.length&&"text/plain"===i[0])return;t.preventDefault();const n=FreeTextEditor.#Qo(e.getData("text")||"").replaceAll(tr,"\n");if(!n)return;const r=window.getSelection();if(!r.rangeCount)return;this.editorDiv.normalize();r.deleteFromDocument();const s=r.getRangeAt(0);if(!n.includes("\n")){s.insertNode(document.createTextNode(n));this.editorDiv.normalize();r.collapseToStart();return}const{startContainer:a,startOffset:o}=s,l=[],c=[];if(a.nodeType===Node.TEXT_NODE){const t=a.parentElement;c.push(a.nodeValue.slice(o).replaceAll(tr,""));if(t!==this.editorDiv){let e=l;for(const i of this.editorDiv.childNodes)i!==t?e.push(FreeTextEditor.#Yo(i)):e=c}l.push(a.nodeValue.slice(0,o).replaceAll(tr,""))}else if(a===this.editorDiv){let t=l,e=0;for(const i of this.editorDiv.childNodes){e++===o&&(t=c);t.push(FreeTextEditor.#Yo(i))}}this.#Wo=`${l.join("\n")}${n}${c.join("\n")}`;this.#Jo();const h=new Range;let d=Math.sumPrecise(l.map(t=>t.length));for(const{firstChild:t}of this.editorDiv.childNodes)if(t.nodeType===Node.TEXT_NODE){const e=t.nodeValue.length;if(d<=e){h.setStart(t,d);h.setEnd(t,d);break}d-=e}r.removeAllRanges();r.addRange(h)}#Jo(){this.editorDiv.replaceChildren();if(this.#Wo)for(const t of this.#Wo.split("\n")){const e=document.createElement("div");e.append(t?document.createTextNode(t):document.createElement("br"));this.editorDiv.append(e)}}#Zo(){return this.#Wo.replaceAll(" "," ")}static#Qo(t){return t.replaceAll(" "," ")}get contentDiv(){return this.editorDiv}getPDFRect(){const t=FreeTextEditor._internalPadding*this.parentScale;return this.getRect(t,t)}static async deserialize(t,e,i){let n=null;if(t instanceof FreeTextAnnotationElement){const{data:{defaultAppearanceData:{fontSize:e,fontColor:i},rect:r,rotation:s,id:a,popupRef:o,richText:l,contentsObj:c,creationDate:h,modificationDate:d},textContent:u,textPosition:p,parent:{page:{pageNumber:g}}}=t;if(!u?.length)return null;n=t={annotationType:ki.FREETEXT,color:Array.from(i),fontSize:e,value:u.join("\n"),position:p,pageIndex:g-1,rect:r.slice(0),rotation:s,annotationElementId:a,id:a,deleted:!1,popupRef:o,comment:c?.str||null,richText:l,creationDate:h,modificationDate:d}}const r=await super.deserialize(t,e,i);r.#wo=t.fontSize;r.color=Util.makeHexColor(...t.color);r.#Wo=FreeTextEditor.#Qo(t.value);r._initialData=n;t.comment&&r.setCommentData(t);return r}serialize(t=!1){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();const e=AnnotationEditor._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:this.color),i=Object.assign(super.serialize(t),{color:e,fontSize:this.#wo,value:this.#Zo()});this.addComment(i);if(t){i.isCopy=!0;return i}if(this.annotationElementId&&!this.#tl(i))return null;i.id=this.annotationElementId;return i}#tl(t){const{value:e,fontSize:i,color:n,pageIndex:r}=this._initialData;return this.hasEditedComment||this._hasBeenMoved||t.value!==e||t.fontSize!==i||t.color.some((t,e)=>t!==n[e])||t.pageIndex!==r}renderAnnotationElement(t){const e=super.renderAnnotationElement(t);if(!e)return null;const{style:i}=e;i.fontSize=`calc(${this.#wo}px * var(--total-scale-factor))`;i.color=this.color;e.replaceChildren();for(const t of this.#Wo.split("\n")){const i=document.createElement("div");i.append(t?document.createTextNode(t):document.createElement("br"));e.append(i)}t.updateEdited({rect:this.getPDFRect(),popup:this._uiManager.hasCommentManager()||this.hasEditedComment?this.comment:{text:this.#Wo}});return e}resetAnnotationElement(t){super.resetAnnotationElement(t);t.resetEdited()}}class DrawingOptions{#el=Object.create(null);updateProperty(t,e){this[t]=e;this.updateSVGProperty(t,e)}updateProperties(t){if(t)for(const[e,i]of Object.entries(t))e.startsWith("_")||this.updateProperty(e,i)}updateSVGProperty(t,e){this.#el[t]=e}toSVGProperties(){const t=this.#el;this.#el=Object.create(null);return{root:t}}reset(){this.#el=Object.create(null)}updateAll(t=this){this.updateProperties(t)}clone(){unreachable("Not implemented")}}class DrawingEditor extends AnnotationEditor{#il=null;#nl;_clipPathId=null;_colorPicker=null;_drawId=null;_drawOutlines=null;_focusDrawId=null;static _currentDrawId=-1;static _currentParent=null;static#rl=null;static#sl=null;static#al=null;static#ol=null;static _INNER_MARGIN=3;constructor(t){super(t);this.#nl=t.mustBeCommitted||!1;this._addOutlines(t)}onUpdatedColor(){this._colorPicker?.update(this.color);super.onUpdatedColor()}onUpdatedOpacity(){this._colorPicker?.updateOpacity?.(this.opacity)}_addOutlines(t){if(t.drawOutlines){this.#ll(t);this.#cl()}}#ll({drawOutlines:t,drawId:e,drawingOptions:i,clipPathId:n}){this._drawOutlines=t;this._drawingOptions||=i;this.annotationElementId||this._uiManager.a11yAlert(AnnotationEditor._l10nAlert[this.editorType]);if(e>=0){this._drawId=e;this._clipPathId=n??null;this.parent.drawLayer.finalizeDraw(e,t.defaultProperties);this.#hl(this.parent)}else this._drawId=this.#dl(t,this.parent);this.#ul(t.box)}#dl(t,e){const{id:i,clipPathId:n}=e.drawLayer.draw(DrawingEditor._mergeSVGProperties(this._drawingOptions.toSVGProperties(),t.defaultSVGProperties),!1,this.constructor._hasClipPath);this.constructor._hasClipPath&&(this._clipPathId=n);this.#hl(e);return i}#hl(t){const e=this._drawOutlines.getFocusSVGProperties(this.#pl);e&&(this._focusDrawId=t.drawLayer.drawOutline(e,this._drawOutlines.focusMustRemoveSelfIntersections))}#gl(t=this.#pl){null!==this._focusDrawId&&this.parent?.drawLayer.updateProperties(this._focusDrawId,this._drawOutlines.getFocusSVGProperties(t))}#fl(t){null!==this._focusDrawId&&this.parent?.drawLayer.updateProperties(this._focusDrawId,{rootClass:t})}#ml(){const{parent:t,_drawId:e,_focusDrawId:i,_isVisible:n}=this;if(!t||null===e)return;const r={hidden:!n};t.drawLayer.updateProperties(e,{rootClass:r});null!==i&&t.drawLayer.updateProperties(i,{rootClass:r})}static _mergeSVGProperties(t,e){const i=new Set(Object.keys(t));for(const[n,r]of Object.entries(e))i.has(n)?Object.assign(t[n],r):t[n]=r;return t}static getDefaultDrawingOptions(t){unreachable("Not implemented")}static get typesMap(){unreachable("Not implemented")}static get isDrawer(){return!0}static get _hasClipPath(){return!1}static get _hasDrawClass(){return!0}static get supportMultipleDrawings(){return!1}get _drawRotation(){return this.rotation}get _opacityName(){return this.constructor.typesMap.get(this.opacityType)}get#pl(){return(this.parentRotation-this._drawRotation+360)%360}static updateDefaultParams(t,e){const i=this.typesMap.get(t);i&&this._defaultDrawingOptions.updateProperty(i,e);if(this._currentParent){DrawingEditor.#rl.updateProperty(i,e);this._currentParent.drawLayer.updateProperties(this._currentDrawId,this._defaultDrawingOptions.toSVGProperties())}}updateParams(t,e){const i=this.constructor.typesMap.get(t);i&&this._updateProperty(t,i,e)}static get defaultPropertiesToUpdate(){const t=[],e=this._defaultDrawingOptions;for(const[i,n]of this.typesMap)t.push([i,e[n]]);return t}get propertiesToUpdate(){const t=[],{_drawingOptions:e}=this;for(const[i,n]of this.constructor.typesMap)t.push([i,e[n]]);return t}_updateProperty(t,e,i){const n=this._drawingOptions,r=n[e],setter=i=>{n.updateProperty(e,i);const r=this._drawOutlines.updateProperty(e,i);r&&this.#ul(r);this.parent?.drawLayer.updateProperties(this._drawId,n.toSVGProperties());t===this.colorType?this.onUpdatedColor():t===this.opacityType&&this.onUpdatedOpacity()};this.addCommands({cmd:setter.bind(this,i),undo:setter.bind(this,r),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:t,overwriteIfSameType:!0,keepUndo:!0})}_updateColorAndOpacity(t,e,i=this.colorAndOpacityType){const n=this.constructor.typesMap.get(this.colorType),r=this._opacityName,s=this._drawingOptions,a=s[n],o=s[r],setter=(t,e)=>{s.updateProperty(n,t);s.updateProperty(r,e);this._drawOutlines.updateProperty(n,t);this._drawOutlines.updateProperty(r,e);this.parent?.drawLayer.updateProperties(this._drawId,s.toSVGProperties());this.onUpdatedColor();this.onUpdatedOpacity()};this.addCommands({cmd:setter.bind(this,t,e),undo:setter.bind(this,a,o),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:i,overwriteIfSameType:!0,keepUndo:!0})}_onResizing(){this.parent?.drawLayer.updateProperties(this._drawId,DrawingEditor._mergeSVGProperties(this._drawOutlines.getPathResizingSVGProperties(this.#bl()),{bbox:this.#yl()}))}_onResized(){this.parent?.drawLayer.updateProperties(this._drawId,DrawingEditor._mergeSVGProperties(this._drawOutlines.getPathResizedSVGProperties(this.#bl()),{bbox:this.#yl()}));this.#gl()}_onTranslating(t,e){this.parent?.drawLayer.updateProperties(this._drawId,{bbox:this.#yl()})}_onTranslated(){this.parent?.drawLayer.updateProperties(this._drawId,DrawingEditor._mergeSVGProperties(this._drawOutlines.getPathTranslatedSVGProperties(this.#bl(),this.parentDimensions),{bbox:this.#yl()}))}_onStartDragging(){this.parent?.drawLayer.updateProperties(this._drawId,{rootClass:{moving:!0}})}_onStopDragging(){this.parent?.drawLayer.updateProperties(this._drawId,{rootClass:{moving:!1}})}get _mustBeDisabledOnCommit(){return!0}commit(){super.commit();if(this._mustBeDisabledOnCommit){this.disableEditMode();this.disableEditing()}}disableEditing(){super.disableEditing();this.div.classList.toggle("disabled",!0)}enableEditing(){super.enableEditing();this.div.classList.toggle("disabled",!1)}getBaseTranslation(){return[0,0]}get isResizable(){return!0}onceAdded(t){this.annotationElementId||this.parent.addUndoableEditor(this);this._isDraggable=!0;if(this.#nl){this.#nl=!1;this.commit();this.parent.setSelected(this);t&&this.isOnScreen&&this.div.focus()}}remove(){this._uiManager.removeShouldRescale(this);this.#wl();super.remove()}rebuild(){if(this.parent){super.rebuild();if(null!==this.div){this.#cl();this.#ul(this._drawOutlines.box);this.isAttachedToDOM||this.parent.add(this)}}}setParent(t){let e=!1;if(this.parent&&!t){this._uiManager.removeShouldRescale(this);this.#wl()}else if(t){this._uiManager.addShouldRescale(this);this.#cl(t);e=!this.parent&&this.div?.classList.contains("selectedEditor")}super.setParent(t);this.#ml();e&&this.select()}#wl(){if(null===this._drawId||!this.parent)return;const{drawLayer:t}=this.parent;t.remove(this._drawId);this._drawId=null;if(null!==this._focusDrawId){t.remove(this._focusDrawId);this._focusDrawId=null}this._drawingOptions.reset()}#cl(t=this.parent){if(null===this._drawId||this.parent!==t){if(null!==this._drawId){const{drawLayer:e}=this.parent;e.updateParent(this._drawId,t.drawLayer);null!==this._focusDrawId&&e.updateParent(this._focusDrawId,t.drawLayer);return}this._drawingOptions.updateAll();this._drawId=this.#dl(this._drawOutlines,t);this._clipPathId&&this.#il&&(this.#il.style.clipPath=this._clipPathId)}}#vl([t,e,i,n]){const{parentDimensions:[r,s],_drawRotation:a}=this;switch(a){case 90:return[e,1-t,i*(s/r),n*(r/s)];case 180:return[1-t,1-e,i,n];case 270:return[1-e,t,i*(s/r),n*(r/s)];default:return[t,e,i,n]}}#bl(){const{x:t,y:e,width:i,height:n,parentDimensions:[r,s],_drawRotation:a}=this;switch(a){case 90:return[1-e,t,i*(r/s),n*(s/r)];case 180:return[1-t,1-e,i,n];case 270:return[e,1-t,i*(r/s),n*(s/r)];default:return[t,e,i,n]}}#ul(t){[this.x,this.y,this.width,this.height]=this.#vl(t);if(this.div){this.fixAndSetPosition();this.setDims()}this._onResized()}#yl(t=this.parentRotation){const{x:e,y:i,width:n,height:r,_drawRotation:s,parentDimensions:[a,o]}=this;switch((4*s+t)/90){case 1:return[1-i-r,e,r,n];case 2:return[1-e-n,1-i-r,n,r];case 3:return[i,1-e-n,r,n];case 4:return[e,i-n*(a/o),r*(o/a),n*(a/o)];case 5:return[1-i,e,n*(a/o),r*(o/a)];case 6:return[1-e-r*(o/a),1-i,r*(o/a),n*(a/o)];case 7:return[i-n*(a/o),1-e-r*(o/a),n*(a/o),r*(o/a)];case 8:return[e-n,i-r,n,r];case 9:return[1-i,e-n,r,n];case 10:return[1-e,1-i,n,r];case 11:return[i-r,1-e,r,n];case 12:return[e-r*(o/a),i,r*(o/a),n*(a/o)];case 13:return[1-i-n*(a/o),e-r*(o/a),n*(a/o),r*(o/a)];case 14:return[1-e,1-i-n*(a/o),r*(o/a),n*(a/o)];case 15:return[i,1-e,n*(a/o),r*(o/a)];default:return[e,i,n,r]}}rotate(t=this.parentRotation){if(!this.parent||null===this._drawId)return;const e=(t-this._drawRotation+360)%360;this.parent.drawLayer.updateProperties(this._drawId,DrawingEditor._mergeSVGProperties({bbox:this.#yl(t)},this._drawOutlines.updateRotation(e)));this.#gl(e)}show(t=this._isVisible){super.show(t);this.#ml()}select(){super.select();this.#fl({hovered:!1,selected:!0})}unselect(){super.unselect();this.#fl({selected:!1})}pointerover(){this.isSelected||this.#fl({hovered:!0})}pointerleave(){this.isSelected||this.#fl({hovered:!1})}onScaleChanging(){if(!this.parent)return;const t=this._drawOutlines.updateParentDimensions(this.parentDimensions,this.parent.scale);t&&this.#ul(t)}static onScaleChangingWhenDrawing(){}render(){if(this.div)return this.div;let t,e;if(this._isCopy){t=this.x;e=this.y}const i=super.render();this.constructor._hasDrawClass&&i.classList.add("draw");const n=this.#il=document.createElement("div");i.append(n);n.setAttribute("aria-hidden","true");n.className="internal";this._clipPathId&&(n.style.clipPath=this._clipPathId);bindEvents(this,n,["pointerover","pointerleave"]);this.setDims();this._uiManager.addShouldRescale(this);this.disableEditing();this._isCopy&&this._moveAfterPaste(t,e);return i}static createDrawerInstance(t){unreachable("Not implemented")}static _getDrawingTarget(t,{target:e}){return e}static _getPointerCoords({offsetX:t,offsetY:e,clientX:i,clientY:n},r=null){if(!r)return[t,e];let s=i-r.clientX,a=n-r.clientY;switch(this._currentParent.viewport.rotation){case 90:[s,a]=[a,-s];break;case 180:[s,a]=[-s,-a];break;case 270:[s,a]=[-a,s]}return[r.offsetX+s,r.offsetY+a]}static _addDrawingListeners(t,e){}static _endDrawingSession(t=!1){return this._currentParent.endDrawingSession(t)}static startDrawing(t,e,i,n){const{pointerId:r,pointerType:s}=n;if(CurrentPointers.isInitializedAndDifferentPointerType(s))return;const a=this._getDrawingTarget(t,n),[o,l]=this._getPointerCoords(n),{viewport:{rotation:c}}=t,{x:h,y:d,width:u,height:p}=a.getBoundingClientRect(),g=DrawingEditor.#sl=new AbortController,f=t.combinedSignal(g);CurrentPointers.setPointer(s,r);window.addEventListener("pointerup",t=>{CurrentPointers.isSamePointerIdOrRemove(t.pointerId)&&this._endDraw(t)},{signal:f});window.addEventListener("pointercancel",t=>{CurrentPointers.isSamePointerIdOrRemove(t.pointerId)&&this._endDrawingSession()},{signal:f});window.addEventListener("pointerdown",t=>{if(CurrentPointers.isSamePointerType(t.pointerType)){CurrentPointers.initializeAndAddPointerId(t.pointerId);if(DrawingEditor.#rl.isCancellable()){DrawingEditor.#rl.removeLastElement();DrawingEditor.#rl.isEmpty()?this._endDrawingSession(!0):this._endDraw(null)}}},{capture:!0,passive:!1,signal:f});window.addEventListener("contextmenu",noContextMenu,{signal:f});a.addEventListener("pointermove",this._drawMove.bind(this),{signal:f});a.addEventListener("touchmove",t=>{CurrentPointers.isSameTimeStamp(t.timeStamp)&&stopEvent(t)},{signal:f});this._addDrawingListeners(a,f);t.toggleDrawing();e._editorUndoBar?.hide();if(DrawingEditor.#rl){t.drawLayer.updateProperties(this._currentDrawId,DrawingEditor.#rl.startNew(o,l,u,p,c));return}e.updateUIForDefaultProperties(this);DrawingEditor.#rl=this.createDrawerInstance({x:o,y:l,box:[h,d,u,p],rotation:c,parent:t,isLTR:i});DrawingEditor.#al=this.getDefaultDrawingOptions();this._currentParent=t;const{id:m,clipPathId:b}=t.drawLayer.draw(this._mergeSVGProperties(DrawingEditor.#al.toSVGProperties(),DrawingEditor.#rl.defaultSVGProperties),!0,this._hasClipPath);this._currentDrawId=m;DrawingEditor.#ol=this._hasClipPath?b:null}static _drawMove(t){CurrentPointers.isSameTimeStamp(t.timeStamp);if(!DrawingEditor.#rl||!CurrentPointers.isSamePointerId(t.pointerId))return;if(CurrentPointers.isUsingMultiplePointers()){this._endDraw(t);return}let e;const i=t.getCoalescedEvents?.();if(i?.length){const n=[];for(const e of i)n.push(...this._getPointerCoords(e,t));e=DrawingEditor.#rl.addPoints(n)}else e=DrawingEditor.#rl.add(...this._getPointerCoords(t));this._currentParent.drawLayer.updateProperties(this._currentDrawId,e);CurrentPointers.setTimeStamp(t.timeStamp);stopEvent(t)}static _cleanup(t){if(t){this._currentDrawId=-1;this._currentParent=null;DrawingEditor.#rl=null;DrawingEditor.#al=null;DrawingEditor.#ol=null;CurrentPointers.clearTimeStamp()}if(DrawingEditor.#sl){DrawingEditor.#sl.abort();DrawingEditor.#sl=null;CurrentPointers.clearPointerIds()}}static _endDraw(t){const e=this._currentParent;if(e){e.toggleDrawing(!0);this._cleanup(!1);e.drawLayer.updateProperties(this._currentDrawId,t?.target===e.div?DrawingEditor.#rl.end(...this._getPointerCoords(t)):DrawingEditor.#rl.end());if(this.supportMultipleDrawings){const t=DrawingEditor.#rl,i=this._currentDrawId,n=t.getLastElement();e.addCommands({cmd:()=>{e.drawLayer.updateProperties(i,t.setLastElement(n))},undo:()=>{e.drawLayer.updateProperties(i,t.removeLastElement())},mustExec:!1,type:Di.DRAW_STEP});return}this.endDrawing(!1)}}static endDrawing(t){const e=this._currentParent;if(!e)return null;e.toggleDrawing(!0);e.cleanUndoStack(Di.DRAW_STEP);if(!DrawingEditor.#rl.isEmpty()){const{pageDimensions:[i,n],scale:r}=e,s=e.createAndAddNewEditor({offsetX:0,offsetY:0},!1,{drawId:this._currentDrawId,clipPathId:DrawingEditor.#ol,drawOutlines:DrawingEditor.#rl.getOutlines(i*r,n*r,r,this._INNER_MARGIN),drawingOptions:DrawingEditor.#al,mustBeCommitted:!t});this._cleanup(!0);return s}e.drawLayer.remove(this._currentDrawId);this._cleanup(!0);return null}createDrawingOptions(t){}static deserializeDraw(t,e,i,n,r,s,a){unreachable("Not implemented")}static async deserialize(t,e,i){const{rawDims:{pageWidth:n,pageHeight:r,pageX:s,pageY:a}}=e.viewport,o=this.deserializeDraw(s,a,n,r,this._INNER_MARGIN,t,i),l=await super.deserialize(t,e,i);l.createDrawingOptions(t);l.#ll({drawOutlines:o});l.#cl();l.onScaleChanging();l.rotate();return l}serializeDraw(t){const[e,i]=this.pageTranslation,[n,r]=this.pageDimensions;return this._drawOutlines.serialize([e,i,n,r],t)}renderAnnotationElement(t){t.updateEdited({rect:this.getPDFRect()});return null}static canCreateNewEmptyEditor(){return!1}}class Outline{static PRECISION=1e-4;focusOutline=null;toSVGPath(){unreachable("Abstract method `toSVGPath` must be implemented.")}get box(){unreachable("Abstract getter `box` must be implemented.")}serialize(t,e){unreachable("Abstract method `serialize` must be implemented.")}get defaultSVGProperties(){unreachable("Abstract getter `defaultSVGProperties` must be implemented.")}get defaultProperties(){return this.defaultSVGProperties}getFocusSVGProperties(t){return null}get focusMustRemoveSelfIntersections(){return!1}updateProperty(t,e){return null}updateParentDimensions(t,e){return null}serializeQuadPoints(t,e){return null}updateRotation(t){return{}}getPathResizingSVGProperties(t){return{}}getPathResizedSVGProperties(t){return{}}getPathTranslatedSVGProperties(t,e){return{}}static _rotateBox([t,e,i,n],r){switch(r){case 90:return[1-e-n,t,n,i];case 180:return[1-t-i,1-e-n,i,n];case 270:return[e,1-t-i,n,i]}return[t,e,i,n]}static _rescale(t,e,i,n,r,s){s||=new Float32Array(t.length);for(let a=0,o=t.length;a=6;t-=6)isNaN(e[t])?i.push(`L${e[t+4]} ${e[t+5]}`):i.push(`C${e[t]} ${e[t+1]} ${e[t+2]} ${e[t+3]} ${e[t+4]} ${e[t+5]}`);this.#Hl(i);return i.join(" ")}#Nl(){const[t,e,i,n]=this.#_l,[r,s,a,o]=this.#Ll();return`M${(this.#Sl[2]-t)/i} ${(this.#Sl[3]-e)/n} L${(this.#Sl[4]-t)/i} ${(this.#Sl[5]-e)/n} L${r} ${s} L${a} ${o} L${(this.#Sl[16]-t)/i} ${(this.#Sl[17]-e)/n} L${(this.#Sl[14]-t)/i} ${(this.#Sl[15]-e)/n} Z`}#Hl(t){const e=this.#Al;t.push(`L${e[4]} ${e[5]} Z`)}#Ul(t){const[e,i,n,r]=this.#_l,s=this.#Sl.subarray(4,6),a=this.#Sl.subarray(16,18),[o,l,c,h]=this.#Ll();t.push(`L${(s[0]-e)/n} ${(s[1]-i)/r} L${o} ${l} L${c} ${h} L${(a[0]-e)/n} ${(a[1]-i)/r}`)}newFreeDrawOutline(t,e,i,n,r,s){return new FreeDrawOutline(t,e,i,n,r,s)}getOutlines(){const t=this.#Cl,e=this.#Al,i=this.#Sl,[n,r,s,a]=this.#_l,o=new Float32Array((this.#Fl?.length??0)+2);for(let t=0,e=o.length-2;t=6;t-=6)for(let i=0;i<6;i+=2)if(isNaN(e[t+i])){l[c]=l[c+1]=NaN;c+=2}else{l[c]=e[t+i];l[c+1]=e[t+i+1];c+=2}this.#jl(l,c);return this.newFreeDrawOutline(l,o,this.#_l,this.#Ml,this.#xl,this.#El)}#zl(t){const e=this.#Sl,[i,n,r,s]=this.#_l,[a,o,l,c]=this.#Ll(),h=new Float32Array(36);h.set([NaN,NaN,NaN,NaN,(e[2]-i)/r,(e[3]-n)/s,NaN,NaN,NaN,NaN,(e[4]-i)/r,(e[5]-n)/s,NaN,NaN,NaN,NaN,a,o,NaN,NaN,NaN,NaN,l,c,NaN,NaN,NaN,NaN,(e[16]-i)/r,(e[17]-n)/s,NaN,NaN,NaN,NaN,(e[14]-i)/r,(e[15]-n)/s],0);return this.newFreeDrawOutline(h,t,this.#_l,this.#Ml,this.#xl,this.#El)}#jl(t,e){const i=this.#Al;t.set([NaN,NaN,NaN,NaN,i[4],i[5]],e);return e+6}#Gl(t,e){const i=this.#Sl.subarray(4,6),n=this.#Sl.subarray(16,18),[r,s,a,o]=this.#_l,[l,c,h,d]=this.#Ll();t.set([NaN,NaN,NaN,NaN,(i[0]-r)/a,(i[1]-s)/o,NaN,NaN,NaN,NaN,l,c,NaN,NaN,NaN,NaN,h,d,NaN,NaN,NaN,NaN,(n[0]-r)/a,(n[1]-s)/o],e);return e+24}}class FreeDrawOutline extends Outline{#_l;#Wl=new Float32Array(4);#xl;#El;#Fl;#Ml;#Vl;constructor(t,e,i,n,r,s){super();this.#Vl=t;this.#Fl=e;this.#_l=i;this.#Ml=n;this.#xl=r;this.#El=s;this.firstPoint=[NaN,NaN];this.lastPoint=[NaN,NaN];this.#$l(s);const[a,o,l,c]=this.#Wl;for(let e=0,i=t.length;eu){s=d;a=u}else a===u&&(s=c(s,d));if(lh[1]){s=h[0];a=h[1]}else a===h[1]&&(s=c(s,h[0]));if(lt[0]-e[0]||t[1]-e[1]||t[2]-e[2]);const t=[];for(const e of this.#Kl)if(e[3]){t.push(...this.#Jl(e));this.#Ql(e)}else{this.#Zl(e);t.push(...this.#Jl(e))}return this.#tc(t)}#tc(t){const e=[],i=new Set;for(const i of t){const[t,n,r]=i;e.push([t,n,i],[t,r,i])}e.sort((t,e)=>t[1]-e[1]||t[0]-e[0]);for(let t=0,n=e.length;t0;){const t=i.values().next().value;let[e,r,s,a,o]=t;i.delete(t);let l=e,c=r;const h=[e,s];n.push(h);for(;;){let t;if(i.has(a))t=a;else{if(!i.has(o))break;t=o}i.delete(t);[e,r,s,a,o]=t;if(l!==e){h.push(l,c,e,c===r?r:s);l=e}c=c===r?s:r}h.push(l,c)}return new HighlightOutline(n,this.#_l,this.#ql,this.#Xl)}#ec(t){const e=this.#Yl;let i=0,n=e.length-1;for(;i<=n;){const r=i+n>>1,s=e[r][0];if(s===t)return r;s=0;n--){const[i,r]=this.#Yl[n];if(i!==t)break;if(i===t&&r===e){this.#Yl.splice(n,1);return}}}#Jl(t){const[e,i,n]=t,r=[[e,i,n]],s=this.#ec(n);for(let t=0;t=i)if(o>n)r[t][1]=n;else{if(1===s)return[];r.splice(t,1);t--;s--}else{r[t][2]=i;o>n&&r.push([e,n,o])}}}return r}}class HighlightOutline extends Outline{#_l;#ic=null;#nc;constructor(t,e,i,n){super();this.#nc=t;this.#_l=e;this.firstPoint=i;this.lastPoint=n}static build(t,e){const i=new HighlightOutliner(t,.001).getOutlines();i.#ic=t;i.focusOutline=new HighlightOutliner(t,.0025,.001,e).getOutlines();return i}get isFree(){return!1}get defaultSVGProperties(){return getHighlightSVGProperties(this)}getFocusSVGProperties(t){return getHighlightFocusSVGProperties(this,t)}updateRotation(t){return{root:{"data-main-rotation":t}}}serializeQuadPoints([t,e],[i,n]){const r=this.#ic,s=new Float32Array(8*r.length);let a=0;for(const{x:o,y:l,width:c,height:h}of r){const r=o*i+t,d=(1-l)*n+e;s[a]=s[a+4]=r;s[a+1]=s[a+3]=d;s[a+2]=s[a+6]=r+c*i;s[a+5]=s[a+7]=d-h*n;a+=8}return s}toSVGPath(){const t=[];for(const e of this.#nc){let[i,n]=e;t.push(`M${i} ${n}`);for(let r=2;rt.classList.remove("free"),{once:!0});window.addEventListener("blur",()=>this._endDraw(null),{signal:e});window.addEventListener("pointerdown",stopEvent,{capture:!0,passive:!1,signal:e})}static _endDrawingSession(t=!1){return this.endDrawing(t)}createDrawingOptions({color:t,opacity:e,thickness:i}){const{_defaultDrawingOptions:n,_DEFAULT_OPACITY:r}=HighlightEditor;this._drawingOptions=HighlightEditor.getDefaultDrawingOptions({fill:Util.makeHexColor(...t),"fill-opacity":e||r,thickness:i||n.thickness})}static deserializeDraw(t,e,i,n,r,s,a){const{quadPoints:o}=s;if(o){const r=[];for(let s=0,a=o.length;st!==e[i])}renderAnnotationElement(t){if(this.deleted){t.hide();return null}t.updateEdited({rect:this.getPDFRect(),popup:this.comment});return null}}class InkDrawOutliner{#Sl=new Float64Array(6);#gc=new Float64Array(2);#xo;#fc;#ks;#Il;#Fl;#mc="";#bc=0;#nc=new InkDrawOutline;#yc;#wc;constructor(t,e,i,n,r,s){this.#yc=i;this.#wc=n;this.#ks=r;this.#Il=s;[t,e]=this.#vc(t,e);const a=this.#xo=[NaN,NaN,NaN,NaN,t,e];this.#Fl=[t,e];this.#fc=[{line:a,points:this.#Fl}];this.#Sl.set(a,0);this.#gc.set([t,e],0)}updateProperty(t,e){"stroke-width"===t&&(this.#Il=e)}#vc(t,e){return Outline._normalizePoint(t,e,this.#yc,this.#wc,this.#ks)}isEmpty(){return!this.#fc?.length}isCancellable(){return this.#Fl.length<=10}add(t,e){this.#_c(t,e)&&this.toSVGPath();return{path:{d:this.#Ac()}}}addPoints(t){let e=!1;for(let i=0,n=t.length;it??NaN),h,d,u,p),points:g(a[t].map(t=>t??NaN),h,d,u,p)});const f=new this.prototype.constructor;f.build(c,i,n,1,o,l,r);return f}#Tc(t=this.#Il){const e=this.#xl+t/2*this.#Ec;return this.#ks%180==0?[e/this.#yc,e/this.#wc]:[e/this.#wc,e/this.#yc]}#Sc(){const[t,e,i,n]=this.#Wl,[r,s]=this.#Tc(0);return[t+r,e+s,i-2*r,n-2*s]}#Cc(){const t=this.#Wl=gi.slice();for(const{line:e}of this.#fc){if(e.length<=12){for(let i=4,n=e.length;it!==e[i])||t.thickness!==i||t.opacity!==n||t.pageIndex!==r}renderAnnotationElement(t){if(this.deleted){t.hide();return null}const{points:e,rect:i}=this.serializeDraw(!1);t.updateEdited({rect:i,thickness:this._drawingOptions["stroke-width"],points:e,popup:this.comment});return null}}class ContourDrawOutline extends InkDrawOutline{toSVGPath(){let t=super.toSVGPath();t.endsWith("Z")||(t+="Z");return t}}ni();class SignatureExtractor{static#Dc={maxDim:512,sigmaSFactor:.02,sigmaR:25,kernelSize:16};static#Pc(t,e,i,n){n-=e;return 0===(i-=t)?n>0?0:4:1===i?n+6:2-n}static#Mc=new Int32Array([0,1,-1,1,-1,0,-1,-1,0,-1,1,-1,1,0,1,1]);static#Ic(t,e,i,n,r,s,a){const o=this.#Pc(i,n,r,s);for(let r=0;r<8;r++){const s=(-r+o-a+16)%8;if(0!==t[(i+this.#Mc[2*s])*e+(n+this.#Mc[2*s+1])])return s}return-1}static#Fc(t,e,i,n,r,s,a){const o=this.#Pc(i,n,r,s);for(let r=0;r<8;r++){const s=(r+o+a+16)%8;if(0!==t[(i+this.#Mc[2*s])*e+(n+this.#Mc[2*s+1])])return s}return-1}static#Oc(t,e,i,n){const r=t.length,s=new Int32Array(r);for(let e=0;e=1&&0===s[n+1])){1!==r&&(a=Math.abs(r));continue}o+=1;h+=1;r>1&&(a=r)}const d=[i,t],u=h===i+1,p={isHole:u,points:d,id:o,parent:0};l.push(p);let g;for(const t of l)if(t.id===a){g=t;break}g?g.isHole?p.parent=u?g.parent:a:p.parent=u?a:g.parent:p.parent=u?a:0;const f=this.#Ic(s,e,t,i,c,h,0);if(-1===f){s[n]=-o;1!==s[n]&&(a=Math.abs(s[n]));continue}let m=this.#Mc[2*f],b=this.#Mc[2*f+1];const y=t+m,w=i+b;c=y;h=w;let v=t,_=i;for(;;){const r=this.#Fc(s,e,v,_,c,h,1);m=this.#Mc[2*r];b=this.#Mc[2*r+1];const l=v+m,u=_+b;d.push(u,l);const p=v*e+_;0===s[p+1]?s[p]=-o:1===s[p]&&(s[p]=o);if(l===t&&u===i&&v===y&&_===w){1!==s[n]&&(a=Math.abs(s[n]));break}c=v;h=_;v=l;_=u}}}return l}static#Rc(t,e,i,n){if(i-e<=4){for(let r=e;rv){_=n;v=e}}if(v>(l*w)**2){this.#Rc(t,e,_+2,n);this.#Rc(t,_,i,n)}else n.push(r,s)}static#Bc(t){const e=[],i=t.length;this.#Rc(t,0,i,e);e.push(t[i-2],t[i-1]);return e.length<=4?null:e}static#Lc(t,e,i,n,r,s){const a=new Float32Array(s**2),o=-2*n**2,l=s>>1;for(let t=0;t=i))for(let i=0;i=e)continue;const p=t[u*e+n],f=a[o*s+i]*c[Math.abs(p-h)];d+=p*f;g+=f}}p[u[o]=Math.round(d/g)]++}return[u,p]}static#Nc(t){const e=new Uint32Array(256);for(const i of t)e[i]++;return e}static#Uc(t){const e=t.length,i=new Uint8ClampedArray(e>>2);let n=-1/0,r=1/0;for(let e=0,s=i.length;e0!==t);let s=r,a=r;for(e=r;e<256;e++){const r=t[e];if(r>i){if(e-s>n){n=e-s;a=e-1}i=r;s=e}}for(e=a-1;e>=0&&!(t[e]>t[e+1]);e--);return e}static#zc(t){const e=t,{width:i,height:n}=t,{maxDim:r}=this.#Dc;let s=i,a=n;if(i>r||n>r){let o=i,l=n,c=Math.log2(Math.max(i,n)/r);const h=Math.floor(c);c=c===h?h-1:h;for(let i=0;i=-128&&o<=127?Int8Array:a>=-32768&&o<=32767?Int16Array:Int32Array;const c=t.length,h=8+3*c,d=new Uint32Array(h);let u=0;d[u++]=h*Uint32Array.BYTES_PER_ELEMENT+(l-2*c)*s.BYTES_PER_ELEMENT;d[u++]=0;d[u++]=n;d[u++]=r;d[u++]=e?0:1;d[u++]=Math.max(0,Math.floor(i??0));d[u++]=c;d[u++]=s.BYTES_PER_ELEMENT;for(const e of t){d[u++]=e.length-2;d[u++]=e[0];d[u++]=e[1]}const p=new CompressionStream("deflate-raw"),g=p.writable.getWriter();await g.ready;g.write(d);const f=s.prototype.constructor;for(const e of t){const t=new f(e.length-2);for(let i=2,n=e.length;i{await r.ready;await r.close()}).catch(()=>{});let s=null,a=0;for await(const t of i){s||=new Uint8Array(new Uint32Array(t.buffer,0,4)[0]);s.set(t,a);a+=t.length}const o=new Uint32Array(s.buffer,0,s.length>>2),l=o[1];if(0!==l)throw new Error(`Invalid version: ${l}`);const c=o[2],h=o[3],d=0===o[4],u=o[5],p=o[6],g=o[7],f=[],m=(8+3*p)*Uint32Array.BYTES_PER_ELEMENT;let b;switch(g){case Int8Array.BYTES_PER_ELEMENT:b=new Int8Array(s.buffer,m);break;case Int16Array.BYTES_PER_ELEMENT:b=new Int16Array(s.buffer,m);break;case Int32Array.BYTES_PER_ELEMENT:b=new Int32Array(s.buffer,m)}a=0;for(let t=0;t{e?.updateEditSignatureButton(t)})}}getSignaturePreview(){const{newCurves:t,areContours:e,thickness:i,width:n,height:r}=this.#Wc,s=Math.max(n,r);return{areContours:e,outline:SignatureExtractor.processDrawnLines({lines:{curves:t.map(t=>({points:t})),thickness:i,width:n,height:r},pageWidth:s,pageHeight:s,rotation:0,innerMargin:0,mustSmooth:!1,areContours:e}).outline}}get toolbarButtons(){return this._uiManager.signatureManager?[["editSignature",this._uiManager.signatureManager]]:super.toolbarButtons}addSignature(t,e,i,n){const{x:r,y:s}=this,{outline:a}=this.#Wc=t;this.#Gc=a instanceof ContourDrawOutline;this.description=i;let o;if(this.#Gc)o=SignatureEditor.getDefaultDrawingOptions();else{o=SignatureEditor._defaultDrawnSignatureOptions.clone();o.updateProperties({"stroke-width":a.thickness})}this._addOutlines({drawOutlines:a,drawingOptions:o});const[,l]=this.pageDimensions;let c=e/l;c=c>=1?.5:c;this.width*=c/this.height;if(this.width>=1){c*=.9/this.width;this.width=.9}this.height=c;this.setDims();this.x=r;this.y=s;this.center();this._onResized();this.onScaleChanging();this.rotate();this._uiManager.addToAnnotationStorage(this);this.setUuid(n);this._reportTelemetry({action:"pdfjs.signature.inserted",data:{hasBeenSaved:!!n,hasDescription:!!i}});this.div.hidden=!1}getFromImage(t){const{rawDims:{pageWidth:e,pageHeight:i},rotation:n}=this.parent.viewport;return SignatureExtractor.process(t,e,i,n,SignatureEditor._INNER_MARGIN)}getFromText(t,e){const{rawDims:{pageWidth:i,pageHeight:n},rotation:r}=this.parent.viewport;return SignatureExtractor.extractContoursFromText(t,e,i,n,r,SignatureEditor._INNER_MARGIN)}getDrawnSignature(t){const{rawDims:{pageWidth:e,pageHeight:i},rotation:n}=this.parent.viewport;return SignatureExtractor.processDrawnLines({lines:t,pageWidth:e,pageHeight:i,rotation:n,innerMargin:SignatureEditor._INNER_MARGIN,mustSmooth:!1,areContours:!1})}createDrawingOptions({areContours:t,thickness:e}){if(t)this._drawingOptions=SignatureEditor.getDefaultDrawingOptions();else{this._drawingOptions=SignatureEditor._defaultDrawnSignatureOptions.clone();this._drawingOptions.updateProperties({"stroke-width":e})}}serialize(t=!1){if(this.isEmpty())return null;const{lines:e,points:i}=this.serializeDraw(t),{_drawingOptions:{"stroke-width":n}}=this,r=Object.assign(super.serialize(t),{isSignature:!0,areContours:this.#Gc,color:[0,0,0],thickness:this.#Gc?0:n});this.addComment(r);if(t){r.paths={lines:e,points:i};r.uuid=this.#Vc;r.isCopy=!0}else r.lines=e;this.#jc&&(r.accessibilityData={type:"Figure",alt:this.#jc});return r}static deserializeDraw(t,e,i,n,r,s){return s.areContours?ContourDrawOutline.deserialize(t,e,i,n,r,s):InkDrawOutline.deserialize(t,e,i,n,r,s)}static async deserialize(t,e,i){const n=await super.deserialize(t,e,i);n.#Gc=t.areContours;n.description=t.accessibilityData?.alt||"";n.#Vc=t.uuid;return n}}class StampEditor extends AnnotationEditor{#$c=null;#qc=null;#Xc=null;#Kc=null;#Yc=null;#Jc="";#Qc=null;#Zc=!1;#th=null;#eh=!1;#ih=!1;static _type="stamp";static _editorType=ki.STAMP;constructor(t){super({...t,name:"stampEditor"});this.#Kc=t.bitmapUrl;this.#Yc=t.bitmapFile;this.defaultL10nId="pdfjs-editor-stamp-editor"}static initialize(t,e){AnnotationEditor.initialize(t,e)}static isHandlingMimeForPasting(t){return sn.has(t)}static paste(t,e){e.pasteEditor({mode:ki.STAMP},{bitmapFile:t.getAsFile()})}altTextFinish(){this._uiManager.useNewAltTextFlow&&(this.div.hidden=!1);super.altTextFinish()}get telemetryFinalData(){return{type:"stamp",hasAltText:!!this.altTextData?.altText}}static computeTelemetryFinalData(t){const e=t.get("hasAltText");return{hasAltText:e.get(!0)??0,hasNoAltText:e.get(!1)??0}}#nh(t,e=!1){if(t){this.#$c=t.bitmap;if(!e){this.#qc=t.id;this.#eh=t.isSvg}t.file&&(this.#Jc=t.file.name);this.#rh()}else this.remove()}#sh(){this.#Xc=null;this._uiManager.enableWaiting(!1);if(this.#Qc)if(this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&this.#$c)this.addEditToolbar().then(()=>{this._editToolbar.hide();this._uiManager.editAltText(this,!0)});else{if(!this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&this.#$c){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(t=null,e=!0){if(this.hasAltTextData())return null;const{mlManager:i}=this._uiManager;if(!i)throw new Error("No ML.");if(!await i.isEnabledFor("altText"))throw new Error("ML isn't enabled for alt text.");const{data:n,width:r,height:s}=t||this.copyCanvas(null,null,!0).imageData,a=await i.guess({name:"altText",request:{data:n,width:r,height:s,channels:n.length/(r*s)}});if(!a)throw new Error("No response from the AI service.");if(a.error)throw new Error("Error from the AI service.");if(a.cancel)return null;if(!a.output)throw new Error("No valid response from the AI service.");const o=a.output;await this.setGuessedAltText(o);e&&!this.hasAltTextData()&&(this.altTextData={alt:o,decorative:!1});return o}#ah(){if(this.#qc){this._uiManager.enableWaiting(!0);this._uiManager.imageManager.getFromId(this.#qc).then(t=>this.#nh(t,!0)).finally(()=>this.#sh());return}if(this.#Kc){const t=this.#Kc;this.#Kc=null;this._uiManager.enableWaiting(!0);this.#Xc=this._uiManager.imageManager.getFromUrl(t).then(t=>this.#nh(t)).finally(()=>this.#sh());return}if(this.#Yc){const t=this.#Yc;this.#Yc=null;this._uiManager.enableWaiting(!0);this.#Xc=this._uiManager.imageManager.getFromFile(t).then(t=>this.#nh(t)).finally(()=>this.#sh());return}const t=document.createElement("input");t.type="file";t.accept=sn.keys().join(",");const e=this._uiManager._signal;this.#Xc=new Promise(i=>{t.addEventListener("change",async()=>{if(t.files&&0!==t.files.length){this._uiManager.enableWaiting(!0);const e=await this._uiManager.imageManager.getFromFile(t.files[0]);this._reportTelemetry({action:"pdfjs.image.image_selected",data:{alt_text_modal:this._uiManager.useNewAltTextFlow}});this.#nh(e)}else this.remove();i()},{signal:e});t.addEventListener("cancel",()=>{this.remove();i()},{signal:e})}).finally(()=>this.#sh());t.click()}remove(){if(this.#qc){this.#$c=null;this._uiManager.imageManager.deleteId(this.#qc);this.#Qc?.remove();this.#Qc=null;if(this.#th){clearTimeout(this.#th);this.#th=null}}super.remove()}rebuild(){if(this.parent){super.rebuild();if(null!==this.div){this.#qc&&null===this.#Qc&&this.#ah();this.isAttachedToDOM||this.parent.add(this)}}else this.#qc&&this.#ah()}onceAdded(t){this._isDraggable=!0;t&&this.div.focus()}isEmpty(){return!(this.#Xc||this.#$c||this.#Kc||this.#Yc||this.#qc||this.#Zc)}get toolbarButtons(){return[["altText",this.createAltText()]]}get isResizable(){return!0}render(){if(this.div)return this.div;let t,e;if(this._isCopy){t=this.x;e=this.y}super.render();this.div.hidden=!0;this.createAltText();this.#Zc||(this.#$c?this.#rh():this.#ah());this._isCopy&&this._moveAfterPaste(t,e);this._uiManager.addShouldRescale(this);return this.div}setCanvas(t,e){const{id:i,bitmap:n}=this._uiManager.imageManager.getFromCanvas(t,e);e.remove();if(i&&this._uiManager.imageManager.isValidId(i)){this.#qc=i;n&&(this.#$c=n);this.#Zc=!1;this.#rh()}}_onResized(){this.onScaleChanging()}onScaleChanging(){if(!this.parent)return;null!==this.#th&&clearTimeout(this.#th);this.#th=setTimeout(()=>{this.#th=null;this.#oh()},200)}#rh(){const{div:t}=this;let{width:e,height:i}=this.#$c;const[n,r]=this.pageDimensions,s=.75;if(this.width){e=this.width*n;i=this.height*r}else if(e>s*n||i>s*r){const t=Math.min(s*n/e,s*r/i);e*=t;i*=t}this._uiManager.enableWaiting(!1);const a=this.#Qc=document.createElement("canvas");a.setAttribute("role","img");this.addContainer(a);this.width=e/n;this.height=i/r;this.setDims();this._initialOptions?.isCentered?this.center():this.fixAndSetPosition();this._initialOptions=null;this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&!this.annotationElementId||(t.hidden=!1);this.#oh();if(!this.#ih){this.parent.addUndoableEditor(this);this.#ih=!0}this._reportTelemetry({action:"inserted_image"});this.#Jc&&this.div.setAttribute("aria-description",this.#Jc);this.annotationElementId||this._uiManager.a11yAlert(AnnotationEditor._l10nAlert.stamp)}copyCanvas(t,e,i=!1){t||=224;const{width:n,height:r}=this.#$c,s=new OutputScale;let a=this.#$c,o=n,l=r,c=null;if(e){if(n>e||r>e){const t=Math.min(e/n,e/r);o=Math.floor(n*t);l=Math.floor(r*t)}c=document.createElement("canvas");const t=c.width=Math.ceil(o*s.sx),i=c.height=Math.ceil(l*s.sy);this.#eh||(a=this.#lh(t,i));const h=c.getContext("2d");h.filter=this._uiManager.hcmFilter;let d="white",u="#cfcfd8";if("none"!==this._uiManager.hcmFilter)u="black";else if(ColorScheme.isDarkMode){d="#8f8f9d";u="#42414d"}const p=15,g=p*s.sx,f=p*s.sy,m=new OffscreenCanvas(2*g,2*f),b=m.getContext("2d");b.fillStyle=d;b.fillRect(0,0,2*g,2*f);b.fillStyle=u;b.fillRect(0,0,g,f);b.fillRect(g,f,g,f);h.fillStyle=h.createPattern(m,"repeat");h.fillRect(0,0,t,i);h.drawImage(a,0,0,a.width,a.height,0,0,t,i)}let h=null;if(i){let e,i;if(s.symmetric&&a.widtht||r>t){const s=Math.min(t/n,t/r);e=Math.floor(n*s);i=Math.floor(r*s);this.#eh||(a=this.#lh(e,i))}}const o=new OffscreenCanvas(e,i).getContext("2d",{willReadFrequently:!0});o.drawImage(a,0,0,a.width,a.height,0,0,e,i);h={width:e,height:i,data:o.getImageData(0,0,e,i).data}}return{canvas:c,width:o,height:l,imageData:h}}#lh(t,e){const{width:i,height:n}=this.#$c;let r=i,s=n,a=this.#$c;for(;r>2*t||s>2*e;){const i=r,n=s;r>2*t&&(r=Math.ceil(r/2));s>2*e&&(s=Math.ceil(s/2));const o=new OffscreenCanvas(r,s);o.getContext("2d").drawImage(a,0,0,i,n,0,0,r,s);a=o.transferToImageBitmap()}return a}#oh(){const[t,e]=this.parentDimensions,{width:i,height:n}=this,r=new OutputScale,s=Math.ceil(i*t*r.sx),a=Math.ceil(n*e*r.sy),o=this.#Qc;if(!o||o.width===s&&o.height===a)return;o.width=s;o.height=a;const l=this.#eh?this.#$c:this.#lh(s,a),c=o.getContext("2d");c.filter=this._uiManager.hcmFilter;c.drawImage(l,0,0,l.width,l.height,0,0,s,a)}#ch(t){if(t){if(this.#eh){const t=this._uiManager.imageManager.getSvgUrl(this.#qc);if(t)return t}const t=document.createElement("canvas");({width:t.width,height:t.height}=this.#$c);t.getContext("2d").drawImage(this.#$c,0,0);return t.toDataURL()}if(this.#eh){const[t,e]=this.pageDimensions,i=Math.round(this.width*t*PixelsPerInch.PDF_TO_CSS_UNITS),n=Math.round(this.height*e*PixelsPerInch.PDF_TO_CSS_UNITS),r=new OffscreenCanvas(i,n);r.getContext("2d").drawImage(this.#$c,0,0,this.#$c.width,this.#$c.height,0,0,i,n);return r.transferToImageBitmap()}return structuredClone(this.#$c)}static async deserialize(t,e,i){let n=null,r=!1;if(t instanceof StampAnnotationElement){const{data:{rect:s,rotation:a,id:o,structParent:l,popupRef:c,richText:h,contentsObj:d,creationDate:u,modificationDate:p},container:g,parent:{page:{pageNumber:f}},canvas:m}=t;let b,y;if(m){delete t.canvas;({id:b,bitmap:y}=i.imageManager.getFromCanvas(g.id,m));m.remove()}else{r=!0;t._hasNoCanvas=!0}const w=(await e._structTree.getAriaAttributes(`${Si}${o}`))?.get("aria-label")||"";n=t={annotationType:ki.STAMP,bitmapId:b,bitmap:y,pageIndex:f-1,rect:s.slice(0),rotation:a,annotationElementId:o,id:o,deleted:!1,accessibilityData:{decorative:!1,altText:w},isSvg:!1,structParent:l,popupRef:c,richText:h,comment:d?.str||null,creationDate:u,modificationDate:p}}const s=await super.deserialize(t,e,i),{rect:a,bitmap:o,bitmapUrl:l,bitmapId:c,isSvg:h,accessibilityData:d}=t;if(r){i.addMissingCanvas(t.id,s);s.#Zc=!0}else if(c&&i.imageManager.isValidId(c)){s.#qc=c;o&&(s.#$c=o)}else s.#Kc=l;s.#eh=h;const[u,p]=s.pageDimensions;s.width=(a[2]-a[0])/u;s.height=(a[3]-a[1])/p;d&&(s.altTextData=d);s._initialData=n;t.comment&&s.setCommentData(t);s.#ih=!!n;return s}serialize(t=!1,e=null){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();const i=Object.assign(super.serialize(t),{bitmapId:this.#qc,isSvg:this.#eh});this.addComment(i);if(t){i.bitmapUrl=this.#ch(!0);i.accessibilityData=this.serializeAltText(!0);i.isCopy=!0;return i}const{decorative:n,altText:r}=this.serializeAltText(!1);!n&&r&&(i.accessibilityData={type:"Figure",alt:r});if(this.annotationElementId){const t=this.#tl(i);if(t.isSame)return null;t.isSameAltText?delete i.accessibilityData:i.accessibilityData.structParent=this._initialData.structParent??-1;i.id=this.annotationElementId;delete i.bitmapId;return i}if(null===e)return i;e.stamps||=new Map;const s=this.#eh?(i.rect[2]-i.rect[0])*(i.rect[3]-i.rect[1]):null;if(e.stamps.has(this.#qc)){if(this.#eh){const t=e.stamps.get(this.#qc);if(s>t.area){t.area=s;t.serialized.bitmap.close();t.serialized.bitmap=this.#ch(!1)}}}else{e.stamps.set(this.#qc,{area:s,serialized:i});i.bitmap=this.#ch(!1)}return i}#tl(t){const{pageIndex:e,accessibilityData:{altText:i}}=this._initialData,n=t.pageIndex===e,r=(t.accessibilityData?.alt||"")===i;return{isSame:!this.hasEditedComment&&!this._hasBeenMoved&&!this._hasBeenResized&&n&&r,isSameAltText:r}}renderAnnotationElement(t){if(this.deleted){t.hide();return null}t.updateEdited({rect:this.getPDFRect(),popup:this.comment});return null}}class AnnotationEditorLayer{#Bo;#hh=!1;#dh=null;#uh=null;#ph=null;#gh=new Map;#fh=!1;#mh=!1;#bh=!1;#yh=null;#wh=null;#vh=null;#_h=null;#Ah=null;#xh=-1;#w;static _initialized=!1;static#tt=new Map([FreeTextEditor,InkEditor,StampEditor,HighlightEditor,SignatureEditor].map(t=>[t._editorType,t]));constructor({uiManager:t,pageIndex:e,div:i,structTreeLayer:n,accessibilityManager:r,annotationLayer:s,drawLayer:a,textLayer:o,viewport:l,l10n:c}){const h=[...AnnotationEditorLayer.#tt.values()];if(!AnnotationEditorLayer._initialized){AnnotationEditorLayer._initialized=!0;for(const e of h)e.initialize(c,t)}t.registerEditorTypes(h);this.#w=t;this.pageIndex=e;this.div=i;this.#Bo=r;this.#dh=s;this.viewport=l;this.#vh=o;this.drawLayer=a;this._structTree=n;this.#w.addLayer(this)}get isEmpty(){return 0===this.#gh.size}get isInvisible(){return this.isEmpty&&this.#w.getMode()===ki.NONE}updateToolbar(t){this.#w.updateToolbar(t)}updateMode(t=this.#w.getMode()){this.#Eh();switch(t){case ki.NONE:this.div.classList.toggle("nonEditing",!0);this.disableTextSelection();this.togglePointerEvents(!1);this.toggleAnnotationLayerPointerEvents(!0);this.disableClick();return;case ki.INK:this.disableTextSelection();this.togglePointerEvents(!0);this.enableClick();break;case ki.HIGHLIGHT:this.enableTextSelection();this.togglePointerEvents(!1);this.disableClick();break;default:this.disableTextSelection();this.togglePointerEvents(!0);this.enableClick()}this.toggleAnnotationLayerPointerEvents(!1);const{classList:e}=this.div;e.toggle("nonEditing",!1);if(t===ki.POPUP)e.toggle("commentEditing",!0);else{e.toggle("commentEditing",!1);for(const i of AnnotationEditorLayer.#tt.values())e.toggle(`${i._type}Editing`,t===i._editorType)}this.div.hidden=!1}hasTextLayer(t){return t===this.#vh?.div}setEditingState(t){this.#w.setEditingState(t)}addCommands(t){this.#w.addCommands(t)}cleanUndoStack(t){this.#w.cleanUndoStack(t)}toggleDrawing(t=!1){this.div.classList.toggle("drawing",!t)}togglePointerEvents(t=!1){this.div.classList.toggle("disabled",!t)}toggleAnnotationLayerPointerEvents(t=!1){this.#dh?.togglePointerEvents(t)}get#Ch(){return 0!==this.#gh.size?this.#gh.values():this.#w.getEditors(this.pageIndex)}async enable(){this.#bh=!0;this.div.tabIndex=0;this.togglePointerEvents(!0);this.div.classList.toggle("nonEditing",!1);this.#Ah?.abort();this.#Ah=null;const t=new Set;for(const e of this.#Ch){e.enableEditing();e.show(!0);if(e.annotationElementId){this.#w.removeChangedExistingAnnotation(e);t.add(e.annotationElementId)}}const e=this.#dh;if(e)for(const i of e.getEditableAnnotations()){i.hide();if(this.#w.isDeletedAnnotationElement(i.data.id)||t.has(i.data.id))continue;const e=await this.deserialize(i);if(e){this.addOrRebuild(e);e.enableEditing()}}this.#bh=!1;this.#w._eventBus.dispatch("editorsrendered",{source:this,pageNumber:this.pageIndex+1})}disable(){this.#mh=!0;this.div.tabIndex=-1;this.togglePointerEvents(!1);this.div.classList.toggle("nonEditing",!0);if(this.#vh&&!this.#Ah){this.#Ah=new AbortController;const t=this.#w.combinedSignal(this.#Ah);this.#vh.div.addEventListener("pointerdown",t=>{const{clientX:e,clientY:i,timeStamp:n}=t;if(n-this.#xh>500){this.#xh=n;return}this.#xh=-1;const{classList:r}=this.div;r.toggle("getElements",!0);const s=document.elementsFromPoint(e,i);r.toggle("getElements",!1);if(!this.div.contains(s[0]))return;let a;const o=new RegExp(`^${Ti}[0-9]+$`);for(const t of s)if(o.test(t.id)){a=t.id;break}if(!a)return;const l=this.#gh.get(a);if(null===l?.annotationElementId){stopEvent(t);l.dblclick(t)}},{signal:t,capture:!0})}const t=this.#dh,e=[];if(t){const i=new Map,n=new Map;for(const t of this.#Ch){t.disableEditing();if(t.annotationElementId)if(null===t.serialize()){n.set(t.annotationElementId,t);this.getEditableAnnotation(t.annotationElementId)?.show();t.remove()}else i.set(t.annotationElementId,t);else e.push(t)}for(const e of t.getEditableAnnotations()){const{id:t}=e.data;if(this.#w.isDeletedAnnotationElement(t)){e.updateEdited({deleted:!0});continue}let r=n.get(t);if(r){r.resetAnnotationElement(e);r.show(!1);e.show()}else{r=i.get(t);if(r){this.#w.addChangedExistingAnnotation(r);r.renderAnnotationElement(e)&&r.show(!1)}e.show()}}}this.#Eh();this.isEmpty&&(this.div.hidden=!0);const{classList:i}=this.div;for(const t of AnnotationEditorLayer.#tt.values())i.remove(`${t._type}Editing`);this.disableTextSelection();this.toggleAnnotationLayerPointerEvents(!0);t?.updateFakeAnnotations(e);this.#mh=!1}getEditableAnnotation(t){return this.#dh?.getEditableAnnotation(t)||null}setActiveEditor(t){this.#w.getActive()!==t&&this.#w.setActiveEditor(t)}enableTextSelection(){this.div.tabIndex=-1;if(this.#vh?.div&&!this.#_h){this.#_h=new AbortController;const t=this.#w.combinedSignal(this.#_h);this.#vh.div.addEventListener("pointerdown",this.#Sh.bind(this),{signal:t});this.#vh.div.classList.add("highlighting")}}disableTextSelection(){this.div.tabIndex=0;if(this.#vh?.div&&this.#_h){this.#_h.abort();this.#_h=null;this.#vh.div.classList.remove("highlighting")}}#Sh(t){this.#w.unselectAll();const{target:e}=t;if(e===this.#vh.div||("img"===e.getAttribute("role")||e.classList.contains("endOfContent")||e.classList.contains("textLayerImages")||e.classList.contains("textLayerImagePlaceholder"))&&this.#vh.div.contains(e)){const{isMac:e}=FeatureTest.platform;if(0!==t.button||t.ctrlKey&&e)return;this.#w.showAllEditors("highlight",!0,!0);HighlightEditor.startDrawing(this,this.#w,"ltr"===this.#w.direction,t);t.preventDefault()}}enableClick(){if(this.#uh)return;this.#uh=new AbortController;const t=this.#w.combinedSignal(this.#uh);this.div.addEventListener("pointerdown",this.pointerdown.bind(this),{signal:t});const e=this.pointerup.bind(this);this.div.addEventListener("pointerup",e,{signal:t});this.div.addEventListener("pointercancel",e,{signal:t})}disableClick(){this.#uh?.abort();this.#uh=null}attach(t){this.#gh.set(t.id,t);const{annotationElementId:e}=t;e&&this.#w.isDeletedAnnotationElement(e)&&this.#w.removeDeletedAnnotationElement(t)}detach(t){this.#gh.delete(t.id);this.#Bo?.removePointerInTextLayer(t.contentDiv);!this.#mh&&t.annotationElementId&&this.#w.addDeletedAnnotationElement(t)}remove(t){this.detach(t);this.#w.removeEditor(t);t.div.remove();t.isAttachedToDOM=!1}changeParent(t){if(t.parent!==this){if(t.parent&&t.annotationElementId){this.#w.addDeletedAnnotationElement(t);AnnotationEditor.deleteAnnotationElement(t);t.annotationElementId=null}this.attach(t);t.parent?.detach(t);t.setParent(this);if(t.div&&t.isAttachedToDOM){t.div.remove();this.div.append(t.div)}}}add(t){if(t.parent!==this||!t.isAttachedToDOM){this.changeParent(t);this.#w.addEditor(t);this.attach(t);if(!t.isAttachedToDOM){const e=t.render();this.div.append(e);t.isAttachedToDOM=!0}t.fixAndSetPosition();t.onceAdded(!this.#bh);this.#w.addToAnnotationStorage(t);t._reportTelemetry(t.telemetryInitialData)}}moveEditorInDOM(t){if(!t.isAttachedToDOM)return;const{activeElement:e}=document;if(t.div.contains(e)&&!this.#ph){t._focusEventsAllowed=!1;this.#ph=setTimeout(()=>{this.#ph=null;if(t.div.contains(document.activeElement))t._focusEventsAllowed=!0;else{t.div.addEventListener("focusin",()=>{t._focusEventsAllowed=!0},{once:!0,signal:this.#w._signal});e.focus()}},0)}t._structTreeParentId=this.#Bo?.moveElementInDOM(this.div,t.div,t.contentDiv,!0)}addOrRebuild(t){if(t.needsToBeRebuilt()){t.parent||=this;t.rebuild();t.show()}else this.add(t)}addUndoableEditor(t){this.addCommands({cmd:()=>t._uiManager.rebuild(t),undo:()=>{t.remove()},mustExec:!1})}getEditorByUID(t){for(const e of this.#gh.values())if(e.uid===t)return e;return null}get#Th(){return AnnotationEditorLayer.#tt.get(this.#w.getMode())}combinedSignal(t){return this.#w.combinedSignal(t)}#kh(t){const e=this.#Th;return e?new e.prototype.constructor(t):null}canCreateNewEmptyEditor(){return this.#Th?.canCreateNewEmptyEditor()}async pasteEditor(t,e){this.updateToolbar(t);await this.#w.updateMode(t.mode);const{offsetX:i,offsetY:n}=this.#Dh(),r=this.#w.getId(),s=this.#kh({parent:this,id:r,x:i,y:n,uiManager:this.#w,isCentered:!0,...e});s&&this.add(s)}async deserialize(t){return await(AnnotationEditorLayer.#tt.get(t.annotationType??t.annotationEditorType)?.deserialize(t,this,this.#w))||null}createAndAddNewEditor(t,e,i={}){const n=this.#w.getId(),r=this.#kh({parent:this,id:n,x:t.offsetX,y:t.offsetY,uiManager:this.#w,isCentered:e,...i});r&&this.add(r);return r}get boundingClientRect(){return this.div.getBoundingClientRect()}#Dh(){const{x:t,y:e,width:i,height:n}=this.boundingClientRect,r=Math.max(0,t),s=Math.max(0,e),a=(r+Math.min(window.innerWidth,t+i))/2-t,o=(s+Math.min(window.innerHeight,e+n))/2-e,[l,c]=this.viewport.rotation%180==0?[a,o]:[o,a];return{offsetX:l,offsetY:c}}addNewEditor(t={}){this.createAndAddNewEditor(this.#Dh(),!0,t)}setSelected(t){this.#w.setSelected(t)}toggleSelected(t){this.#w.toggleSelected(t)}unselect(t){this.#w.unselect(t)}pointerup(t){const{isMac:e}=FeatureTest.platform;if(0!==t.button||t.ctrlKey&&e)return;if(t.target!==this.div)return;if(!this.#fh)return;this.#fh=!1;if(this.#Th?.isDrawer&&this.#Th.supportMultipleDrawings)return;if(!this.#hh){this.#hh=!0;return}const i=this.#w.getMode();i!==ki.STAMP&&i!==ki.POPUP&&i!==ki.SIGNATURE?this.createAndAddNewEditor(t,!1):this.#w.unselectAll()}pointerdown(t){this.#w.getMode()===ki.HIGHLIGHT&&this.enableTextSelection();if(this.#fh){this.#fh=!1;return}const{isMac:e}=FeatureTest.platform;if(0!==t.button||t.ctrlKey&&e)return;if(t.target!==this.div)return;this.#fh=!0;if(this.#Th?.isDrawer){this.startDrawingSession(t);return}const i=this.#w.getActive();this.#hh=!i||i.isEmpty()}startDrawingSession(t){this.div.focus({preventScroll:!0});if(this.#yh){this.#Th.startDrawing(this,this.#w,!1,t);return}this.#w.setCurrentDrawingSession(this);this.#yh=new AbortController;const e=this.#w.combinedSignal(this.#yh);this.div.addEventListener("blur",({relatedTarget:t})=>{if(t&&!this.div.contains(t)){this.#wh=null;this.commitOrRemove()}},{signal:e});this.#Th.startDrawing(this,this.#w,!1,t)}pause(t){if(t){const{activeElement:t}=document;this.div.contains(t)&&(this.#wh=t);return}this.#wh&&setTimeout(()=>{this.#wh?.focus();this.#wh=null},0)}endDrawingSession(t=!1){if(!this.#yh)return null;this.#w.setCurrentDrawingSession(null);this.#yh.abort();this.#yh=null;this.#wh=null;return this.#Th.endDrawing(t)}findNewParent(t,e,i){const n=this.#w.findParent(e,i);if(null===n||n===this)return!1;n.changeParent(t);return!0}commitOrRemove(){if(this.#yh){this.endDrawingSession();return!0}return!1}onScaleChanging(){this.#yh&&this.#Th.onScaleChangingWhenDrawing(this)}destroy(){this.commitOrRemove();if(this.#w.getActive()?.parent===this){this.#w.commitOrRemove();this.#w.setActiveEditor(null)}if(this.#ph){clearTimeout(this.#ph);this.#ph=null}for(const t of this.#gh.values()){this.#Bo?.removePointerInTextLayer(t.contentDiv);t.setParent(null);t.isAttachedToDOM=!1;t.div.remove()}this.div=null;this.#gh.clear();this.#w.removeLayer(this)}#Eh(){for(const t of this.#gh.values())t.isEmpty()&&t.remove()}async render({viewport:t}){this.viewport=t;setLayerDimensions(this.div,t);for(const t of this.#w.getEditors(this.pageIndex)){this.add(t);t.rebuild()}await this.#w.findClonesForPage(this);this.div.hidden=this.isEmpty;this.updateMode()}update({viewport:t}){this.#w.commitOrRemove();this.#Eh();const e=this.viewport.rotation,i=t.rotation;this.viewport=t;setLayerDimensions(this.div,{rotation:i});if(e!==i)for(const t of this.#gh.values())t.rotate(i)}get pageDimensions(){const{pageWidth:t,pageHeight:e}=this.viewport.rawDims;return[t,e]}get scale(){return this.#w.viewParameters.realScale}}Ge();function compareTextLayers(t,e){return t===e?0:t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}function getTextLayer(t){return t?t.nodeType===Node.ELEMENT_NODE?t.closest(".textLayer"):t.parentElement?.closest(".textLayer")||null:null}function isPointBefore(t,e,i,n){if(t===i)return e<=n;const r=t.compareDocumentPosition(i);return!!(r&Node.DOCUMENT_POSITION_FOLLOWING)||!(r&Node.DOCUMENT_POSITION_PRECEDING)&&null}function normalizeEdgeBoundary(t,e,i){if(t.nodeType!==Node.ELEMENT_NODE||!t.classList.contains("textLayer")||e!==t.childNodes.length)return{container:t,offset:e};let n=t.lastChild;n?.nodeType===Node.ELEMENT_NODE&&n.classList.contains("endOfContent")&&(n=n.previousSibling);return n&&i.contains(n)?n.nodeType===Node.TEXT_NODE?{container:n,offset:n.textContent.length}:{container:n,offset:n.childNodes.length}:null}class DrawLayer{#io=null;#Ph=new Map;#vh=null;#st=null;#Et=null;#Mh=null;#Ih=new Map;static#T=0;static#Fh=0;static#Oh=null;static#Rh=new Set;static#Bh=!1;static#Lh=new Set;static#Nh=new WeakMap;constructor({filterFactory:t=null,pageColors:e=null,pageIndex:i,textLayer:n=null}){this.pageIndex=i;this.#st=t;this.#Et=e;if(n){const t=DrawLayer.#Nh.get(n);if(t?.selectionDiv){t.selectionDiv.remove();DrawLayer.#Rh.delete(t.selectionDiv)}DrawLayer.#Nh.set(n,{drawLayer:this});DrawLayer.#Lh.add(n);this.#vh=n;this.#Mh=new MutationObserver(t=>{if(this.#io&&this.#vh?.isConnected&&DrawLayer.#Uh())for(const{addedNodes:e}of t)for(const t of e)if(t.nodeType===Node.ELEMENT_NODE&&t.classList.contains("endOfContent")){DrawLayer.#Ht();return}});this.#Mh.observe(n,{childList:!0});if(null===DrawLayer.#Oh){DrawLayer.#Oh=new AbortController;const{signal:t}=DrawLayer.#Oh;document.addEventListener("selectionchange",DrawLayer.#Ht.bind(DrawLayer),{signal:t});document.addEventListener("pointerdown",()=>{DrawLayer.#Bh=!0},{signal:t});document.addEventListener("pointerup",()=>{DrawLayer.#Bh=!1},{signal:t});window.addEventListener("blur",()=>{DrawLayer.#Bh=!1},{signal:t})}}}setParent(t){if(this.#io){if(this.#io!==t){if(this.#Ph.size>0)for(const e of this.#Ph.values()){e.remove();t.append(e)}this.#io=t}}else{this.#io=t;this.#vh?.isConnected&&DrawLayer.#Uh()&&DrawLayer.#Ht()}}static#Hh(t){const e=this.#Nh.get(t);if(e?.selectionDiv){e.selectionDiv.remove();this.#Rh.delete(e.selectionDiv);e.selectionDiv=null;e.path=null}}static#Uh(){const t=document.getSelection();return!!t&&!t.isCollapsed}static#zh(){return this.#Lh.keys().filter(t=>t.isConnected).toArray().sort(compareTextLayers)}static#Ht(){const t=document.getSelection();if(!t||t.isCollapsed){for(const t of this.#Rh)t.remove();this.#Rh.clear();return}const e=new WeakMap,i=this.#zh(),n=[];for(let e=0,r=t.rangeCount;er.intersectsNode(t));if(0===p.length)continue;let g=!1;if(!c){c=p[0];s=c;a=0;g=!0}if(!h){h=p.at(-1);o=h;l=h.childNodes.length;g=!0}if(o.nodeType===Node.ELEMENT_NODE)if(o.classList.contains("endOfContent")){const t=o.previousSibling;if(!t)continue;o=t;l=t.nodeType===Node.TEXT_NODE?t.textContent.length:t.childNodes.length}else if(o.classList.contains("textLayer")&&o.childNodes.length===l){const t=normalizeEdgeBoundary(o,l,h);if(!t)continue;o=t.container;l=t.offset}if(s.nodeType===Node.ELEMENT_NODE){const t=normalizeEdgeBoundary(s,a,c);if(!t)continue;s=t.container;a=t.offset}if(c!==h||g||!p.includes(c))for(const t of p){const e=t.firstChild;if(!e)continue;const i=document.createRange();t===c?i.setStart(s,a):i.setStartBefore(e);if(t===h)i.setEnd(o,l);else{const e=t.lastChild;if(!e)continue;if(e.nodeType===Node.ELEMENT_NODE&&e.classList.contains("endOfContent")){const t=e.previousSibling;if(!t)continue;i.setEndAfter(t)}else i.setEndAfter(e)}i.collapsed||n.push([i,t])}else n.push([r,c])}const r=new Set(n.map(t=>t[1]));for(const t of this.#Lh)r.has(t)||this.#Hh(t);for(const[t,i]of n){const n=DrawLayer.#Nh.get(i);if(!n)continue;let r=e.get(i);if(!r){const t=i.getBoundingClientRect();r=(e,i,n,r)=>({x:(e-t.x)/t.width,y:(i-t.y)/t.height,width:n/t.width,height:r/t.height});e.set(i,r)}const s=[];for(let{x:e,y:i,width:n,height:a}of t.getClientRects())if(0!==n&&0!==a){({x:e,y:i,width:n,height:a}=r(e,i,n,a));1===n&&1===a||s.push(`M${e} ${i} h${n} v${a} h-${n} Z`)}if(0===s.length)continue;const a=n.drawLayer;let o=n.selectionDiv,l=n.path;if(!o){const t="clip_selection_"+DrawLayer.#Fh++;o=document.createElement("div");o.className="selection";o.style.clipPath=`url(#${t})`;const e=a.#st?.createSelectionStyle(a.#Et);if(e)for(const[t,i]of Object.entries(e))o.style.setProperty(t,i);const i=DrawLayer._svgFactory.create(1,1,!0);i.setAttribute("aria-hidden","true");i.setAttribute("width","100%");i.setAttribute("height","100%");const r=DrawLayer._svgFactory.createElement("clipPath");r.setAttribute("id",t);r.setAttribute("clipPathUnits","objectBoundingBox");l=DrawLayer._svgFactory.createElement("path");r.append(l);i.append(r);o.append(i);n.path=l;n.selectionDiv=o}if(a.#io&&o.parentNode!==a.#io){a.#io.append(o);this.#Rh.add(o)}l.setAttribute("d",s.join(" "))}}static get _svgFactory(){return util_shadow(this,"_svgFactory",new DOMSVGFactory)}static#Gh(t,[e,i,n,r]){const{style:s}=t;s.top=100*i+"%";s.left=100*e+"%";s.width=100*n+"%";s.height=100*r+"%"}#jh(){const t=DrawLayer._svgFactory.create(1,1,!0);this.#io.append(t);t.setAttribute("aria-hidden","true");return t}#Wh(t,e){const i=DrawLayer._svgFactory.createElement("clipPath");t.append(i);const n=`clip_${e}`;i.setAttribute("id",n);i.setAttribute("clipPathUnits","objectBoundingBox");const r=DrawLayer._svgFactory.createElement("use");i.append(r);r.setAttribute("href",`#${e}`);r.classList.add("clip");return n}#Vh(t,e){for(const[i,n]of Object.entries(e))null===n?t.removeAttribute(i):t.setAttribute(i,n)}draw(t,e=!1,i=!1){const n=DrawLayer.#T++,r=this.#jh(),s=DrawLayer._svgFactory.createElement("defs");r.append(s);const a=DrawLayer._svgFactory.createElement("path");s.append(a);const o=`path_${n}`;a.setAttribute("id",o);a.setAttribute("vector-effect","non-scaling-stroke");e&&this.#Ih.set(n,a);const l=i?this.#Wh(s,o):null,c=DrawLayer._svgFactory.createElement("use");r.append(c);c.setAttribute("href",`#${o}`);this.updateProperties(r,t);this.#Ph.set(n,r);return{id:n,clipPathId:`url(#${l})`}}drawOutline(t,e){const i=DrawLayer.#T++,n=this.#jh(),r=DrawLayer._svgFactory.createElement("defs");n.append(r);const s=DrawLayer._svgFactory.createElement("path");r.append(s);const a=`path_${i}`;s.setAttribute("id",a);s.setAttribute("vector-effect","non-scaling-stroke");let o;if(e){const t=DrawLayer._svgFactory.createElement("mask");r.append(t);o=`mask_${i}`;t.setAttribute("id",o);t.setAttribute("maskUnits","objectBoundingBox");const e=DrawLayer._svgFactory.createElement("rect");t.append(e);e.setAttribute("width","1");e.setAttribute("height","1");e.setAttribute("fill","white");const n=DrawLayer._svgFactory.createElement("use");t.append(n);n.setAttribute("href",`#${a}`);n.setAttribute("stroke","none");n.setAttribute("fill","black");n.setAttribute("fill-rule","nonzero");n.classList.add("mask")}const l=DrawLayer._svgFactory.createElement("use");n.append(l);l.setAttribute("href",`#${a}`);o&&l.setAttribute("mask",`url(#${o})`);const c=l.cloneNode();n.append(c);l.classList.add("mainOutline");c.classList.add("secondaryOutline");this.updateProperties(n,t);this.#Ph.set(i,n);return i}finalizeDraw(t,e){this.#Ih.delete(t);this.updateProperties(t,e)}updateProperties(t,e){if(!e)return;const{root:i,bbox:n,rootClass:r,path:s}=e,a="number"==typeof t?this.#Ph.get(t):t;if(a){i&&this.#Vh(a,i);n&&DrawLayer.#Gh(a,n);if(r){const{classList:t}=a;for(const[e,i]of Object.entries(r))t.toggle(e,i)}if(s){const t=a.firstElementChild.firstElementChild;this.#Vh(t,s)}}}updateParent(t,e){if(e===this)return;const i=this.#Ph.get(t);if(i){e.#io.append(i);this.#Ph.delete(t);e.#Ph.set(t,i)}}remove(t){this.#Ih.delete(t);if(null!==this.#io){this.#Ph.get(t).remove();this.#Ph.delete(t)}}destroy(){this.#io=null;for(const t of this.#Ph.values())t.remove();this.#Ph.clear();this.#Ih.clear();this.#Mh?.disconnect();this.#Mh=null;if(this.#vh){const t=DrawLayer.#Nh.get(this.#vh);if(t?.drawLayer===this){DrawLayer.#Hh(this.#vh);DrawLayer.#Nh.delete(this.#vh);DrawLayer.#Lh.delete(this.#vh);if(0===DrawLayer.#Lh.size){DrawLayer.#Oh?.abort();DrawLayer.#Oh=null;DrawLayer.#Bh=!1}}this.#vh=null}}}function percentage(t){return`${(100*t).toFixed(2)}%`}class TextLayerImages{#$h=[];#qh=new Map;#Xh=null;#Kh=0;#Es=0;#xs=0;static#Yh=null;constructor(t,e,i,n){this.#Kh=t;this.#$h=e;this.#Es=i.rawDims.pageWidth;this.#xs=i.rawDims.pageHeight;this.#Xh=n}render(){const t=document.createElement("div");t.className="textLayerImages";for(let e=0;e{if(!(t.target instanceof HTMLCanvasElement))return;const e=t.target,i=this.#qh.get(e);if(!i)return;const n=TextLayerImages.#Yh?.deref();if(n===e)return;if(n){n.width=0;n.height=0}TextLayerImages.#Yh=new WeakRef(e);const{inverseTransform:r,x1:s,y1:a,width:o,height:l}=i,c=this.#Xh(),h=Math.ceil(s*c.width),d=Math.ceil(a*c.height),u=Math.floor((s+o/this.#Es)*c.width),p=Math.floor((a+l/this.#xs)*c.height);e.width=u-h;e.height=p-d;const g=e.getContext("2d");g.setTransform(...r);g.translate(-h,-d);g.drawImage(c,0,0)});return t}#Jh([t,e,i,n,r,s]){const a=Math.hypot((r-t)*this.#Es,(s-e)*this.#xs),o=Math.hypot((i-t)*this.#Es,(n-e)*this.#xs);if(athis.messageHandler.sendWithPromise(t,e))}#Hr({loaded:t,total:e}){this.loadingTask.onProgress?.({loaded:t,total:e,percent:e?MathClamp(Math.round(t/e*100),0,100):NaN})}get annotationStorage(){return util_shadow(this,"annotationStorage",new AnnotationStorage)}getRenderingIntent(t,e=Ei.ENABLE,i=null,n=!1,r=!1){let s=yi,a=un;switch(t){case"any":s=bi;break;case"display":break;case"print":s=wi;break;default:warn(`getRenderingIntent - invalid intent: ${t}`)}const o=s&wi&&i instanceof PrintAnnotationStorage?i:this.annotationStorage;switch(e){case Ei.DISABLE:s+=Ai;break;case Ei.ENABLE:break;case Ei.ENABLE_FORMS:s+=vi;break;case Ei.ENABLE_STORAGE:s+=_i;a=o.serializable;break;default:warn(`getRenderingIntent - invalid annotationMode: ${e}`)}n&&(s+=xi);r&&(s+=Ci);const{ids:l,hash:c}=o.modifiedIds;return{renderingIntent:s,cacheKey:[s,a.hash,c].join("_"),annotationStorageSerializable:a,modifiedIds:l}}destroy(){if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0;this.destroyCapability=Promise.withResolvers();this.#Xa?.reject(new Error("Worker was destroyed during onPassword callback"));const t=[];for(const e of this.#Va.values())t.push(e._destroy());this.#Va.clear();this.#qa.clear();this.#$a.clear();Object.hasOwn(this,"annotationStorage")&&this.annotationStorage.resetModified();const e=this.messageHandler.sendWithPromise("Terminate",null);t.push(e);Promise.all(t).then(()=>{this.commonObjs.clear();this.fontLoader.clear();this.#Wa.clear();this.filterFactory.destroy();TextLayer.cleanup();this.#ja?.cancelAllRequests(new AbortException("Worker was terminated."));this.messageHandler?.destroy();this.messageHandler=null;this.rendererWorker=null;this.destroyCapability.resolve()},this.destroyCapability.reject);return this.destroyCapability.promise}setupMessageHandler(){const{messageHandler:t,loadingTask:e}=this;t.on("GetReader",(t,e)=>{util_assert(this.#ja,"GetReader - no `BasePDFStream` instance available.");this.#za=this.#ja.getFullReader();this.#za.onProgress=t=>this.#Hr(t);e.onPull=()=>{this.#za.read().then(function({value:t,done:i}){if(i)e.close();else{util_assert(t instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer.");e.enqueue(new Uint8Array(t),1,[t])}}).catch(t=>{e.error(t)})};e.onCancel=t=>{this.#za.cancel(t);e.ready.catch(t=>{if(!this.destroyed)throw t})}});t.on("ReaderHeadersReady",async t=>{await this.#za.headersReady;const{isStreamingSupported:e,isRangeSupported:i,contentLength:n}=this.#za;e&&i&&(this.#za.onProgress=null);return{isStreamingSupported:e,isRangeSupported:i,contentLength:n}});t.on("GetRangeReader",(t,e)=>{util_assert(this.#ja,"GetRangeReader - no `BasePDFStream` instance available.");const i=this.#ja.getRangeReader(t.begin,t.end);if(i){e.onPull=()=>{i.read().then(function({value:t,done:i}){if(i)e.close();else{util_assert(t instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer.");e.enqueue(new Uint8Array(t),1,[t])}}).catch(t=>{e.error(t)})};e.onCancel=t=>{i.cancel(t);e.ready.catch(t=>{if(!this.destroyed)throw t})}}else e.close()});t.on("GetDoc",({pdfInfo:t})=>{this.pagesMapper.pagesNumber=t.numPages;this._numPages=t.numPages;this._htmlForXfa=t.htmlForXfa;delete t.htmlForXfa;e._capability.resolve(new PDFDocumentProxy(t,this))});t.on("DocException",t=>{e._capability.reject(wrapReason(t))});t.on("PasswordRequest",t=>{this.#Xa=Promise.withResolvers();try{if(!e.onPassword)throw wrapReason(t);const updatePassword=t=>{t instanceof Error?this.#Xa.reject(t):this.#Xa.resolve({password:t})};e.onPassword(updatePassword,t.code)}catch(t){this.#Xa.reject(t)}return this.#Xa.promise});t.on("DataLoaded",t=>{this.#Hr({loaded:t.length,total:t.length});this.downloadInfoCapability.resolve(t)});t.on("StartRenderPage",t=>{if(this.destroyed)return;this.#Va.get(t.pageProxyId)._startRenderPage(t.transparency,t.cacheKey)});const i=new ObjectHandler({messageHandler:t,commonObjs:this.commonObjs,fontLoader:this.fontLoader,pageCache:this.#Va,pdfBug:this._params.pdfBug});this.rendererWorker?.promise.then(()=>{this.rendererWorker?.messageHandler?.on("FontFallback",e=>this.destroyed?null:t.sendWithPromise("FontFallback",e))},()=>{});t.on("commonobj",([t,e,n])=>{if(this.destroyed)return null;const{rendererWorker:r}=this;if("CopyLocalImage"===e){if(this.commonObjs.has(t))return null;const s=i.resolveCommonObject(t,e,n);s&&r?.sendCommonObj(t,"Image",this.commonObjs.get(t));return s}r?.sendCommonObj(t,e,n);if(!this.commonObjs.has(t)){i.resolveCommonObject(t,e,n);"Pattern"===e&&"Mesh"===this.commonObjs.get(t)[0]&&(this.#Ga=!0)}return null});t.on("obj",([t,e,n,r])=>{if(!this.destroyed){"Pattern"===n&&"Mesh"===r[0]&&(this.#Ga=!0);i.resolveObject(t,e,n,r)&&this.rendererWorker?.sendObj(t,e,n,r)}});t.on("DocProgress",t=>{this.destroyed||this.#Hr(t)});t.on("FetchBinaryData",async t=>{if(this.destroyed)throw new Error("Worker was destroyed.");if(!this.binaryDataFactory)throw new Error("`BinaryDataFactory` not initialized, see the `useWorkerFetch` parameter.");return this.binaryDataFactory.fetch(t)})}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(t=null){this.annotationStorage.size<=0&&warn("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");const{map:e,transfer:i}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:e,supportsPrintToPDF:null!==this.#Ka,filename:this.#za?.filename??null},i).finally(()=>{this.#Ka=null;this.annotationStorage.resetModified()})}extractPages(t,e=null){const i={pageInfos:t};let n;const r=globalThis.ImageBitmap;if("function"==typeof r){const e=Array.isArray(t)?t:[t];for(const t of e)t?.image instanceof r&&(n||=[]).push(t.image)}if(this.annotationStorage.size>0){const t=this.annotationStorage.serializable;let{map:r}=t;t.transfer?.length&&(n?n.push(...t.transfer):n=t.transfer);const s=this.pagesMapper.getMapping();if(s){const t=new Map;for(const[i,n]of r){if(void 0!==n?.pageIndex&&n.pageIndex>=0&&n.pageIndex{this.annotationStorage.resetModified()})}waitForGPU(){return this._params.enableWebGPU&&this.#Ga&&!isGPUReady()?initGPU():null}getPage(t){if(!Number.isInteger(t)||t<=0||t>this.pagesMapper.pagesNumber)return Promise.reject(new Error("Invalid page request."));const e=t-1,i=this.pagesMapper.getPageId(t)-1,n=this.#qa.get(e);if(n)return n;const r=this.messageHandler.sendWithPromise("GetPage",{pageIndex:i}).then(t=>{if(this.destroyed)throw new Error("Transport destroyed");t.refStr&&this.#$a.set(t.refStr,i);const n=new PDFPageProxy(e,t,this,this.pagesMapper,this._params.pdfBug);this.#Va.set(n._id,n);return n});this.#qa.set(e,r);return r}async getPageIndex(t){if(!isRefProxy(t))throw new Error("Invalid pageIndex request.");const e=await this.messageHandler.sendWithPromise("GetPageIndex",{num:t.num,gen:t.gen}),i=this.pagesMapper.getPageNumber(e+1);if(0===i)throw new Error("GetPageIndex: page has been removed.");return i-1}getAnnotations(t,e){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:this.pagesMapper.getPageId(t+1)-1,intent:e})}getFieldObjects(){return this.#Ya("GetFieldObjects")}getSignatures(){return this.#Ya("GetSignatures")}getSignatureData(t){return this.messageHandler.sendWithPromise("GetSignatureData",t)}hasJSActions(){return this.#Ya("HasJSActions")}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(t){return"string"!=typeof t?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:t})}getPageLabels(){return this.messageHandler.sendWithPromise("GetPageLabels",null)}getPageLayout(){return this.messageHandler.sendWithPromise("GetPageLayout",null)}getPageMode(){return this.messageHandler.sendWithPromise("GetPageMode",null)}getViewerPreferences(){return this.messageHandler.sendWithPromise("GetViewerPreferences",null)}getOpenAction(){return this.messageHandler.sendWithPromise("GetOpenAction",null)}getAttachments(){return this.messageHandler.sendWithPromise("GetAttachments",null)}getAttachmentContent(t){return this.messageHandler.sendWithPromise("GetAttachmentContent",t)}getAnnotationsByType(t,e){return this.messageHandler.sendWithPromise("GetAnnotationsByType",{types:t,pageIndexesToSkip:e})}getDocJSActions(){return this.#Ya("GetDocJSActions")}getPageJSActions(t){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:this.pagesMapper.getPageId(t+1)-1})}getStructTree(t){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:this.pagesMapper.getPageId(t+1)-1})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(t){const e="GetOptionalContentConfig";return this.#Wa.getOrInsertComputed(e,()=>this.messageHandler.sendWithPromise(e,null).catch(t=>{warn(`${e}: "${t}".`);return null})).then(e=>new OptionalContentConfig(e,t))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){const t="GetMetadata";return this.#Wa.getOrInsertComputed(t,()=>this.messageHandler.sendWithPromise(t,null).then(t=>({info:t[0],metadata:t[1]?new Metadata(t[1]):null,contentDispositionFilename:this.#za?.filename??null,contentLength:this.#za?.contentLength??null,hasStructTree:t[2]})))}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(t=!1){if(!this.destroyed){await this.messageHandler.sendWithPromise("Cleanup",null);for(const t of this.#Va.values()){if(!t.cleanup())throw new Error(`startCleanup: Page ${t.pageNumber} is currently rendering.`)}this.commonObjs.clear();t||this.fontLoader.clear();this.rendererWorker?.cleanup(t);this.#Wa.clear();this.filterFactory.destroy(!0);TextLayer.cleanup()}}cleanupPage(t){this.destroyed||this.messageHandler.send("CleanupPage",{pageProxyId:t});this.rendererWorker?.cleanupPage(t)}cachedPageNumber(t){if(!isRefProxy(t))return null;const e=0===t.gen?`${t.num}R`:`${t.num}R${t.gen}`,i=this.#$a.get(e);if(i>=0){const t=this.pagesMapper.getPageNumber(i+1);if(0!==t)return t}return null}}class RenderTask{_internalRenderTask=null;onContinue=null;onError=null;onFrame=null;constructor(t){this._internalRenderTask=t}get promise(){return this._internalRenderTask.capability.promise}cancel(t=0){this._internalRenderTask.cancel(null,t)}get separateAnnots(){const{separateAnnots:t}=this._internalRenderTask.operatorList;if(!t)return!1;const{annotationCanvasMap:e}=this._internalRenderTask;return t.form||t.canvas&&e?.size>0}get imageCoordinates(){return this._internalRenderTask.imageCoordinates||null}get isWorkerRendering(){return this._internalRenderTask.isWorkerRendering}}class InternalRenderTask{#kn=null;#Ja=null;#Qa=null;#Za=null;#to=null;static#eo=new WeakSet;constructor({callback:t,params:e,objs:i,commonObjs:n,annotationCanvasMap:r,operatorList:s,pageIndex:a,pageProxyId:o,canvasFactory:l,filterFactory:c,useRequestAnimationFrame:h=!1,pdfBug:d=!1,pageColors:u=null,operationsFilter:p=null,rendererWorker:g=null,waitForGPU:m=null}){this.callback=t;this.params=e;this.objs=i;this.commonObjs=n;this.annotationCanvasMap=r;this.operatorListIdx=null;this.operatorList=s;this._pageIndex=a;this.canvasFactory=l;this.filterFactory=c;this._pdfBug=d;this.pageColors=u;this.running=!1;this.graphicsReadyCallback=null;this.graphicsReady=!1;this._useRequestAnimationFrame=!0===h&&"undefined"!=typeof window;this.cancelled=!1;this.capability=Promise.withResolvers();this.task=new RenderTask(this);this._cancelBound=this.cancel.bind(this);this._continueBound=this._continue.bind(this);this._scheduleNextBound=this._scheduleNext.bind(this);this._nextBound=this._next.bind(this);this._canvas=e.canvas;this._canvasContext=e.canvas?null:e.canvasContext;this._operationsFilter=p;this.#to=m;this.#Za=g?.createRenderTask({pageProxyId:o,operatorList:s,params:e,pageColors:u,canvasFactory:l,annotationCanvasMap:r,onFrame:()=>this.task.onFrame?.(),onError:t=>this.cancel(t)})??null}get completed(){return this.capability.promise.catch(()=>{})}get isWorkerRendering(){return!!this.#Za}get imageCoordinates(){return this.#Za?this.#Za.imageCoordinates:this.#Ja?.take()}get recordedBBoxes(){return this.#Za?this.#Za.recordedBBoxes:this.#kn?.take()}get debugMetadata(){return this.#kn?.takeDebugMetadata()??null}async initializeGraphics({transparency:t=!1,optionalContentConfig:e}){if(!this.cancelled){if(this._canvas){if(InternalRenderTask.#eo.has(this._canvas))throw new Error("Cannot use the same canvas during multiple render() operations. Use different canvas or ensure previous operations were cancelled or completed.");InternalRenderTask.#eo.add(this._canvas)}if(this._pdfBug&&globalThis.StepperManager?.enabled){this.stepper=globalThis.StepperManager.create(this._pageIndex);this.stepper.init(this.operatorList);this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint()}if(this.#Za){const i=await this.#Za.initialize(t,e);if(this.cancelled)return;i||(this.#Za=null)}if(!this.#Za){const{viewport:i,transform:n,background:r,recordOperations:s,recordImages:a,recordForDebugger:o}=this.params,l=this._canvasContext||this.canvasFactory.getNoAlphaContext(this._canvas),{dependencyTracker:c,imagesTracker:h}=function createCanvasTrackers(t,e,{recordOperations:i=!1,recordImages:n=!1,recordDebugMetadata:r=!1}){const s=i||n?new CanvasBBoxTracker(t,e):null;return{dependencyTracker:i?new CanvasDependencyTracker(s,r):s,imagesTracker:n?new CanvasImagesTracker(t):null}}(this._canvas,this.operatorList.fnArray.length,{recordOperations:s,recordImages:a,recordDebugMetadata:o});this.#kn=c;this.#Ja=h;this.gfx=new CanvasGraphics(l,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:e},this.annotationCanvasMap,this.pageColors,c,h);this.gfx.beginDrawing({transform:n,viewport:i,transparency:t,background:r})}this.operatorListIdx=0;this.graphicsReady=!0;this.graphicsReadyCallback?.()}}cancel(t=null,e=0){this.running=!1;this.cancelled=!0;this.#Za?.cancel();this.gfx?.endDrawing();if(this.#Qa){window.cancelAnimationFrame(this.#Qa);this.#Qa=null}InternalRenderTask.#eo.delete(this._canvas);t||=new RenderingCancelledException(`Rendering cancelled, page ${this._pageIndex+1}`,e);this.callback(t);this.task.onError?.(t)}operatorListChanged(){if(this.graphicsReady){this.#kn?.growOperationsCount(this.operatorList.fnArray.length);this.stepper?.updateOperatorList(this.operatorList);this.running||this._continue()}else this.graphicsReadyCallback||=this._continueBound}_continue(){this.running=!0;this.cancelled||(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())}_scheduleNext(){this._useRequestAnimationFrame?this.#Qa=window.requestAnimationFrame(()=>{this.#Qa=null;this._nextBound().catch(this._cancelBound)}):Promise.resolve().then(this._nextBound).catch(this._cancelBound)}async _next(){if(this.cancelled)return;if(!this.#Za){const t=this.#to?.();if(t){await t;if(this.cancelled)return}}const{operatorList:t}=this,{lastChunk:e}=t;if(this.#Za){this.operatorListIdx=await this.#Za.executeOperatorList(t,this.operatorListIdx,this._operationsFilter);if(this.cancelled)return;if(this.operatorListIdx!==t.argsArray.length||e!==t.lastChunk){this._continue();return}}else this.operatorListIdx=this.gfx.executeOperatorList(t,this.operatorListIdx,this._continueBound,null,this.stepper,this._operationsFilter);if(this.operatorListIdx===t.argsArray.length){this.running=!1;if(e){this.gfx?.endDrawing();InternalRenderTask.#eo.delete(this._canvas);this.callback()}}}}const Yn="6.5.438",Jn="0a4153349";$e();class ColorPicker{#io=null;#no=null;#ro;#so=null;#ao=!1;#oo=!1;#a=null;#lo;#co=null;#y=null;static#ho=null;static get _keyboardManager(){return util_shadow(this,"_keyboardManager",new KeyboardManager([[["Escape"],ColorPicker.prototype._hideDropdownFromKeyboard],[["Space"],ColorPicker.prototype._colorSelectFromKeyboard],[["ArrowDown","ArrowRight"],ColorPicker.prototype._moveToNext],[["ArrowUp","ArrowLeft"],ColorPicker.prototype._moveToPrevious],[["Home"],ColorPicker.prototype._moveToBeginning],[["End"],ColorPicker.prototype._moveToEnd]]))}constructor({editor:t=null,uiManager:e=null}){if(t){this.#oo=!1;this.#a=t}else this.#oo=!0;this.#y=t?._uiManager||e;this.#lo=this.#y._eventBus;this.#ro=t?.color?.toUpperCase()||this.#y?.highlightColors.values().next().value||"#FFFF98";ColorPicker.#ho||=Object.freeze({blue:"pdfjs-editor-colorpicker-blue",green:"pdfjs-editor-colorpicker-green",pink:"pdfjs-editor-colorpicker-pink",red:"pdfjs-editor-colorpicker-red",yellow:"pdfjs-editor-colorpicker-yellow"})}renderButton(){const t=this.#io=document.createElement("button");t.className="colorPicker";t.tabIndex="0";t.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-button");t.ariaHasPopup="true";this.#a&&(t.ariaControls=`${this.#a.id}_colorpicker_dropdown`);const e=this.#y._signal;t.addEventListener("click",this.#do.bind(this),{signal:e});t.addEventListener("keydown",this.#uo.bind(this),{signal:e});const i=this.#no=document.createElement("span");i.className="swatch";i.ariaHidden="true";i.style.backgroundColor=this.#ro;t.append(i);return t}renderMainDropdown(){const t=this.#so=this.#po();t.ariaOrientation="horizontal";t.ariaLabelledBy="highlightColorPickerLabel";return t}#po(){const t=document.createElement("div"),e=this.#y._signal;t.addEventListener("contextmenu",noContextMenu,{signal:e});t.className="dropdown";t.role="listbox";t.ariaMultiSelectable="false";t.ariaOrientation="vertical";t.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-dropdown");this.#a&&(t.id=`${this.#a.id}_colorpicker_dropdown`);for(const[i,n]of this.#y.highlightColors){const r=document.createElement("button");r.tabIndex="0";r.role="option";r.setAttribute("data-color",n);r.title=i;r.setAttribute("data-l10n-id",ColorPicker.#ho[i]);const s=document.createElement("span");r.append(s);s.className="swatch";s.style.backgroundColor=n;r.ariaSelected=n===this.#ro;r.addEventListener("click",this.#go.bind(this,n),{signal:e});t.append(r)}t.addEventListener("keydown",this.#uo.bind(this),{signal:e});return t}#go(t,e){e.stopPropagation();this.#lo.dispatch("switchannotationeditorparams",{source:this,type:Pi.HIGHLIGHT_COLOR,value:t});this.update(t)}_colorSelectFromKeyboard(t){if(t.target===this.#io){this.#do(t);return}const e=t.target.getAttribute("data-color");e&&this.#go(e,t)}_moveToNext(t){this.#mo?t.target!==this.#io?t.target.nextSibling?.focus():this.#so.firstElementChild?.focus():this.#do(t)}_moveToPrevious(t){if(t.target!==this.#so?.firstElementChild&&t.target!==this.#io){this.#mo||this.#do(t);t.target.previousSibling?.focus()}else this.#mo&&this._hideDropdownFromKeyboard()}_moveToBeginning(t){this.#mo?this.#so.firstElementChild?.focus():this.#do(t)}_moveToEnd(t){this.#mo?this.#so.lastElementChild?.focus():this.#do(t)}#uo(t){ColorPicker._keyboardManager.exec(this,t)}#do(t){if(this.#mo){this.hideDropdown();return}this.#ao=0===t.detail;if(!this.#co){this.#co=new AbortController;window.addEventListener("pointerdown",this.#p.bind(this),{signal:this.#y.combinedSignal(this.#co)})}this.#io.ariaExpanded="true";if(this.#so){this.#so.classList.remove("hidden");return}const e=this.#so=this.#po();this.#io.append(e)}#p(t){this.#so?.contains(t.target)||this.hideDropdown()}hideDropdown(){this.#so?.classList.add("hidden");this.#io.ariaExpanded="false";this.#co?.abort();this.#co=null}get#mo(){return this.#so&&!this.#so.classList.contains("hidden")}_hideDropdownFromKeyboard(){if(!this.#oo)if(this.#mo){this.hideDropdown();this.#io.focus({preventScroll:!0,focusVisible:this.#ao})}else this.#a?.unselect()}update(t){this.#no&&(this.#no.style.backgroundColor=t);if(!this.#so)return;const e=this.#y.highlightColors.values();for(const i of this.#so.children)i.ariaSelected=e.next().value===t.toUpperCase()}destroy(){this.#io?.remove();this.#io=null;this.#no=null;this.#so?.remove();this.#so=null}}class BasicColorPicker{#fo=null;#bo=!1;#a=null;#y=null;static#ho=null;constructor(t){this.#a=t;this.#y=t._uiManager;BasicColorPicker.#ho||=Object.freeze({freetext:"pdfjs-editor-color-picker-free-text-input",ink:"pdfjs-editor-color-picker-ink-input"})}renderButton(){if(this.#fo)return this.#fo;const{editorType:t,colorType:e,colorAndOpacityType:i,opacityType:n,color:r,opacity:s}=this.#a,a=this.#bo=FeatureTest.isAlphaColorInputSupported&&void 0!==n,o=this.#fo=document.createElement("input");o.type="color";if(a){o.setAttribute("alpha","");const t=Util.hexNums[Math.round(255*(s??1))];o.value=(r||"#000000")+t}else o.value=r||"#000000";o.className="basicColorPicker";o.tabIndex=0;o.setAttribute("data-l10n-id",BasicColorPicker.#ho[t]);o.addEventListener("input",()=>{if(a){const t=getRGBA(o.value);if(!t)return;const[r,s,a,l]=t,c=Util.makeHexColor(r,s,a);if(void 0!==i)this.#y.updateParams(i,{color:c,opacity:l});else{this.#y.updateParams(e,c);this.#y.updateParams(n,l)}}else this.#y.updateParams(e,o.value)},{signal:this.#y._signal});return o}update(t){if(this.#fo)if(this.#bo){const e=Util.hexNums[Math.round(255*this.#a.opacity)];this.#fo.value=t+e}else this.#fo.value=t}updateOpacity(t){if(!this.#fo||!this.#bo)return;const e=Util.hexNums[Math.round(255*t)];this.#fo.value=this.#a.color+e}destroy(){this.#fo?.remove();this.#fo=null}hideDropdown(){}}Le();function makeColorComp(t){return Math.floor(255*MathClamp(t,0,1)).toString(16).padStart(2,"0")}function scaleAndClamp(t){return 255*MathClamp(t,0,1)}class ColorConverters{static CMYK_G([t,e,i,n]){return["G",1-Math.min(1,.3*t+.59*i+.11*e+n)]}static G_CMYK([t]){return["CMYK",0,0,0,1-t]}static G_RGB([t]){return["RGB",t,t,t]}static G_rgb([t]){return[t=scaleAndClamp(t),t,t]}static G_HTML([t]){const e=makeColorComp(t);return`#${e}${e}${e}`}static RGB_G([t,e,i]){return["G",.3*t+.59*e+.11*i]}static RGB_rgb(t){return t.map(scaleAndClamp)}static RGB_HTML(t){return`#${t.map(makeColorComp).join("")}`}static T_HTML(){return"#00000000"}static T_rgb(){return[null]}static CMYK_RGB([t,e,i,n]){return["RGB",1-Math.min(1,t+n),1-Math.min(1,i+n),1-Math.min(1,e+n)]}static CMYK_rgb([t,e,i,n]){return[scaleAndClamp(1-Math.min(1,t+n)),scaleAndClamp(1-Math.min(1,i+n)),scaleAndClamp(1-Math.min(1,e+n))]}static CMYK_HTML(t){const e=this.CMYK_RGB(t).slice(1);return this.RGB_HTML(e)}static RGB_CMYK([t,e,i]){const n=1-t,r=1-e,s=1-i;return["CMYK",n,r,s,Math.min(n,r,s)]}}class BaseSVGFactory{create(t,e,i=!1){if(t<=0||e<=0)throw new Error("Invalid SVG dimensions");const n=this._createSVG("svg:svg");n.setAttribute("version","1.1");if(!i){n.setAttribute("width",`${t}px`);n.setAttribute("height",`${e}px`)}n.setAttribute("preserveAspectRatio","none");n.setAttribute("viewBox",`0 0 ${t} ${e}`);return n}createElement(t){if("string"!=typeof t)throw new Error("Invalid SVG element type");return this._createSVG(t)}_createSVG(t){unreachable("Abstract method `_createSVG` called.")}}class DOMSVGFactory extends BaseSVGFactory{_createSVG(t){return document.createElementNS(fi,t)}}const Qn=new WeakSet,Zn=60*(new Date).getTimezoneOffset()*1e3;class AnnotationElementFactory{static create(t){switch(t.data.annotationType){case Ni.LINK:return new LinkAnnotationElement(t);case Ni.TEXT:return new TextAnnotationElement(t);case Ni.WIDGET:switch(t.data.fieldType){case"Tx":return new TextWidgetAnnotationElement(t);case"Btn":return t.data.radioButton?new RadioButtonWidgetAnnotationElement(t):t.data.checkBox?new CheckboxWidgetAnnotationElement(t):new PushButtonWidgetAnnotationElement(t);case"Ch":return new ChoiceWidgetAnnotationElement(t);case"Sig":return new SignatureWidgetAnnotationElement(t)}return new WidgetAnnotationElement(t);case Ni.POPUP:return new PopupAnnotationElement(t);case Ni.FREETEXT:return new FreeTextAnnotationElement(t);case Ni.LINE:return new LineAnnotationElement(t);case Ni.SQUARE:return new SquareAnnotationElement(t);case Ni.CIRCLE:return new CircleAnnotationElement(t);case Ni.POLYLINE:return new PolylineAnnotationElement(t);case Ni.CARET:return new CaretAnnotationElement(t);case Ni.INK:return new InkAnnotationElement(t);case Ni.POLYGON:return new PolygonAnnotationElement(t);case Ni.HIGHLIGHT:return new HighlightAnnotationElement(t);case Ni.UNDERLINE:return new UnderlineAnnotationElement(t);case Ni.SQUIGGLY:return new SquigglyAnnotationElement(t);case Ni.STRIKEOUT:return new StrikeOutAnnotationElement(t);case Ni.STAMP:return new StampAnnotationElement(t);case Ni.FILEATTACHMENT:return new FileAttachmentAnnotationElement(t);case Ni.RICHMEDIA:case Ni.SCREEN:case Ni.SOUND:return new MediaAnnotationElement(t);default:return new AnnotationElement(t)}}}class AnnotationElement{#yo=null;#wo=!1;#vo=null;constructor(t,{isRenderable:e=!1,ignoreBorder:i=!1,createQuadrilaterals:n=!1}={}){this.isRenderable=e;this.data=t.data;this.layer=t.layer;this.linkService=t.linkService;this.downloadManager=t.downloadManager;this.imageResourcesPath=t.imageResourcesPath;this.renderForms=t.renderForms;this.annotationStorage=t.annotationStorage;this.enableComment=t.enableComment;this.enableAnnotationEditing=!1!==t.enableAnnotationEditing;this.enableScripting=t.enableScripting;this.hasJSActions=t.hasJSActions;this._fieldObjects=t.fieldObjects;this.parent=t.parent;this.hasOwnCommentButton=!1;e&&(this.contentElement=this.container=this._createContainer(i));n&&this._createQuadrilaterals()}static _hasPopupData({contentsObj:t,richText:e}){return!(!t?.str&&!e?.str)}static get _svgFactory(){return util_shadow(this,"_svgFactory",new DOMSVGFactory)}get _isEditable(){return this.enableAnnotationEditing&&this.data.isEditable}get hasPopupData(){return AnnotationElement._hasPopupData(this.data)||this.enableComment&&!!this.commentText}get commentData(){const{data:t}=this,e=this.annotationStorage?.getEditor(t.id);return e?e.getData():t}get hasCommentButton(){return this.enableComment&&this.hasPopupElement}get commentButtonPosition(){const t=this.annotationStorage?.getEditor(this.data.id);if(t)return t.commentButtonPositionInPage;const{quadPoints:e,inkLists:i,rect:n}=this.data;let r=-1/0,s=-1/0;if(e?.length>=8){for(let t=0;ts){s=e[t+1];r=e[t+2]}else e[t+1]===s&&(r=Math.max(r,e[t+2]));return[r,s]}if(i?.length>=1){for(const t of i)for(let e=0,i=t.length;es){s=t[e+1];r=t[e]}else t[e+1]===s&&(r=Math.max(r,t[e]));if(r!==1/0)return[r,s]}return n?[n[2],n[3]]:null}_normalizePoint(t){const{page:{view:e},viewport:{rawDims:{pageWidth:i,pageHeight:n,pageX:r,pageY:s}}}=this.parent;t[1]=e[3]-t[1]+e[1];t[0]=100*(t[0]-r)/i;t[1]=100*(t[1]-s)/n;return t}get commentText(){const{data:t}=this;return this.annotationStorage.getRawValue(`${Ti}${t.id}`)?.popup?.contents||t.contentsObj?.str||""}set commentText(t){const{data:e}=this,i={deleted:!t,contents:t||""};this.annotationStorage.updateEditor(e.id,{popup:i})||this.annotationStorage.setValue(`${Ti}${e.id}`,{id:e.id,annotationType:e.annotationType,page:this.parent.page,popup:i,popupRef:e.popupRef,modificationDate:new Date});t||this.removePopup()}removePopup(){(this.#vo?.popup||this.popup)?.remove();this.#vo=this.popup=null}updateEdited(t){if(!this.container)return;t.rect&&(this.#yo||={rect:this.data.rect.slice(0)});const{rect:e,popup:i}=t;e&&this.#_o(e);let n=this.#vo?.popup||this.popup;if(!n&&i?.text){this._createPopup(i);n=this.#vo.popup}if(n){n.updateEdited(t);if(i?.deleted){n.remove();this.#vo=null;this.popup=null}}}resetEdited(){if(this.#yo){this.#_o(this.#yo.rect);this.#vo?.popup.resetEdited();this.#yo=null}}#_o(t){const{container:{style:e},data:{rect:i,rotation:n},parent:{viewport:{rawDims:{pageWidth:r,pageHeight:s,pageX:a,pageY:o}}}}=this;i?.splice(0,4,...t);e.left=100*(t[0]-a)/r+"%";e.top=100*(s-t[3]+o)/s+"%";if(0===n){e.width=100*(t[2]-t[0])/r+"%";e.height=100*(t[3]-t[1])/s+"%"}else this.setRotation(n)}_createContainer(t){const{data:e,parent:{page:i,viewport:n}}=this,r=document.createElement("section");r.setAttribute("data-annotation-id",e.id);this instanceof WidgetAnnotationElement||this instanceof LinkAnnotationElement||this instanceof MediaAnnotationElement||(r.tabIndex=0);const{style:s}=r;s.zIndex=this.parent.zIndex;this.parent.zIndex+=2;e.alternativeText&&(r.title=e.alternativeText);e.noRotate&&r.classList.add("norotate");if(!e.rect||this instanceof PopupAnnotationElement){const{rotation:t}=e;e.hasOwnCanvas||0===t||this.setRotation(t,r);return r}const{width:a,height:o}=this;if(!t&&e.borderStyle.width>0){s.borderWidth=`${e.borderStyle.width}px`;const t=e.borderStyle.horizontalCornerRadius,i=e.borderStyle.verticalCornerRadius;if(t>0||i>0){const e=`calc(${t}px * var(--total-scale-factor)) / calc(${i}px * var(--total-scale-factor))`;s.borderRadius=e}switch(e.borderStyle.style){case Ui:s.borderStyle="solid";break;case Hi:s.borderStyle="dashed";break;case zi:warn("Unimplemented border style: beveled");break;case Gi:warn("Unimplemented border style: inset");break;case Wi:s.borderBottomStyle="solid"}const n=e.borderColor||null;if(n){this.#wo=!0;s.borderColor=Util.makeHexColor(...n)}else s.borderWidth=0}const l=Util.normalizeRect([e.rect[0],i.view[3]-e.rect[1]+i.view[1],e.rect[2],i.view[3]-e.rect[3]+i.view[1]]),{pageWidth:c,pageHeight:h,pageX:d,pageY:u}=n.rawDims;s.left=100*(l[0]-d)/c+"%";s.top=100*(l[1]-u)/h+"%";const{rotation:p}=e;if(e.hasOwnCanvas||0===p){s.width=100*a/c+"%";s.height=100*o/h+"%"}else this.setRotation(p,r);return r}setRotation(t,e=this.container){if(!this.data.rect)return;const{pageWidth:i,pageHeight:n}=this.parent.viewport.rawDims;let{width:r,height:s}=this;t%180!=0&&([r,s]=[s,r]);e.style.width=100*r/i+"%";e.style.height=100*s/n+"%";e.setAttribute("data-main-rotation",(360-t)%360)}get _commonActions(){const setColor=(t,e,i)=>{const n=i.detail[t],r=n[0],s=n.slice(1);i.target.style[e]=ColorConverters[`${r}_HTML`](s);this.annotationStorage.setValue(this.data.id,{[e]:ColorConverters[`${r}_rgb`](s)})};return util_shadow(this,"_commonActions",{display:t=>{const{display:e}=t.detail,i=e%2==1;this.container.style.visibility=i?"hidden":"visible";this.annotationStorage.setValue(this.data.id,{noView:i,noPrint:1===e||2===e})},print:t=>{this.annotationStorage.setValue(this.data.id,{noPrint:!t.detail.print})},hidden:t=>{const{hidden:e}=t.detail;this.container.style.visibility=e?"hidden":"visible";this.annotationStorage.setValue(this.data.id,{noPrint:e,noView:e})},focus:t=>{setTimeout(()=>t.target.focus({preventScroll:!1}),0)},userName:t=>{t.target.title=t.detail.userName},readonly:t=>{t.target.disabled=t.detail.readonly},required:t=>{this._setRequired(t.target,t.detail.required)},bgColor:t=>{setColor("bgColor","backgroundColor",t)},fillColor:t=>{setColor("fillColor","backgroundColor",t)},fgColor:t=>{setColor("fgColor","color",t)},textColor:t=>{setColor("textColor","color",t)},borderColor:t=>{setColor("borderColor","borderColor",t)},strokeColor:t=>{setColor("strokeColor","borderColor",t)},rotation:t=>{const e=t.detail.rotation;this.setRotation(e);this.annotationStorage.setValue(this.data.id,{rotation:e})}})}_dispatchEventFromSandbox(t,e){const i=this._commonActions;for(const n of Object.keys(e.detail)){const r=t[n]||i[n];r?.(e)}}_setDefaultPropertiesFromJS(t){if(!this.enableScripting)return;const e=this.annotationStorage.getRawValue(this.data.id);if(!e)return;const i=this._commonActions;for(const[n,r]of Object.entries(e)){const s=i[n];if(s){s({detail:{[n]:r},target:t});delete e[n]}}}_createQuadrilaterals(){if(!this.container)return;const{quadPoints:t}=this.data;if(!t)return;const[e,i,n,r]=this.data.rect.map(Math.fround);if(8===t.length){const[s,a,o,l]=t.subarray(2,6);if(n===s&&r===a&&e===o&&i===l)return}const{style:s}=this.container;let a;if(this.#wo){const{borderColor:t,borderWidth:e}=s;s.borderWidth=0;a=["url('data:image/svg+xml;utf8,",``,``];this.container.classList.add("hasBorder")}const o=n-e,l=r-i,c=AnnotationElement._svgFactory,h=c.createElement("svg");h.classList.add("quadrilateralsContainer");h.setAttribute("width",0);h.setAttribute("height",0);h.role="none";const d=c.createElement("defs");h.append(d);const u=c.createElement("clipPath"),p=`clippath_${this.data.id}`;u.setAttribute("id",p);u.setAttribute("clipPathUnits","objectBoundingBox");d.append(u);for(let i=2,n=t.length;i`)}if(this.#wo){a.push("')");s.backgroundImage=a.join("")}this.container.append(h);this.container.style.clipPath=`url(#${p})`}_createPopup(t=null){const{data:e}=this;let i,n;if(t){i={str:t.text};n=t.date}else{i=e.contentsObj;n=e.modificationDate}this.#vo=new PopupAnnotationElement({data:{color:e.color,titleObj:e.titleObj,modificationDate:n,contentsObj:i,richText:e.richText,parentRect:e.rect,borderStyle:0,id:`popup_${e.id}`,rotation:e.rotation,noRotate:!0},linkService:this.linkService,parent:this.parent,elements:[this]})}get hasPopupElement(){return!!(this.#vo||this.popup||this.data.popupRef)}get extraPopupElement(){return this.#vo}render(){unreachable("Abstract method `AnnotationElement.render` called")}_getElementsByName(t,e=null){const i=[];if(this._fieldObjects){const n=this._fieldObjects.get(t)||[];for(const{page:t,id:r,exportValues:s}of n){if(-1===t||r===e)continue;const n="string"==typeof s?s:null,a=document.querySelector(`[data-element-id="${r}"]`);!a||Qn.has(a)?i.push({id:r,exportValue:n,domElement:a}):warn(`_getElementsByName - element not allowed: ${r}`)}return i}for(const n of document.getElementsByName(t)){const{exportValue:t}=n,r=n.getAttribute("data-element-id");r!==e&&Qn.has(n)&&i.push({id:r,exportValue:t,domElement:n})}return i}show(){this.container&&(this.container.hidden=!1);this.popup?.maybeShow()}hide(){this.container&&(this.container.hidden=!0);this.popup?.forceHide()}getElementsToTriggerPopup(){return this.container}addHighlightArea(){const t=this.getElementsToTriggerPopup();if(Array.isArray(t))for(const e of t)e.classList.add("highlightArea");else t.classList.add("highlightArea")}_editOnDoubleClick(){if(!this._isEditable)return;const{annotationEditorType:t,data:{id:e}}=this;this.container.addEventListener("dblclick",()=>{this.linkService.eventBus?.dispatch("switchannotationeditormode",{source:this,mode:t,editId:e,mustEnterInEditMode:!0})})}updateOC(t){if(!this.data.oc||!t)return;t.isVisible(this.data.oc)?this.show():this.hide()}get width(){return this.data.rect[2]-this.data.rect[0]}get height(){return this.data.rect[3]-this.data.rect[1]}_setBackgroundColor(t){const e=this.data.backgroundColor||null;t.style.backgroundColor=null===e?"transparent":Util.makeHexColor(...e)}}class EditorAnnotationElement extends AnnotationElement{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0});this.editor=t.editor}render(){this.container.className="editorAnnotation";return this.container}createOrUpdatePopup(){const{editor:t}=this;t.hasComment&&this._createPopup(t.comment)}get hasCommentButton(){return this.enableComment&&this.editor.hasComment}get commentButtonPosition(){return this.editor.commentButtonPositionInPage}get commentText(){return this.editor.comment.text}set commentText(t){this.editor.comment=t;t||this.removePopup()}get commentData(){return this.editor.getData()}remove(){this.parent.removeAnnotation(this.data.id);this.container.remove();this.container=null;this.removePopup()}}class LinkAnnotationElement extends AnnotationElement{constructor(t,e=null){super(t,{isRenderable:!0,ignoreBorder:!!e?.ignoreBorder,createQuadrilaterals:!0});this.isTooltipOnly=t.data.isTooltipOnly}render(){const{data:t,linkService:e}=this,i=document.createElement("a");i.setAttribute("data-element-id",t.id);let n=!1;if(t.url){e.addLinkAttributes(i,t.url,t.newWindow);n=!0}else if(t.action){this._bindNamedAction(i,t.action,t.overlaidText);n=!0}else if(t.attachment){this.#Ao(i,t.attachmentId,t.attachment,t.overlaidText,t.attachmentDest);n=!0}else if(t.setOCGState){this.#xo(i,t.setOCGState,t.overlaidText);n=!0}else if(t.dest){this._bindLink(i,t.dest,t.overlaidText);n=!0}else{if(t.actions&&(t.actions.has("Action")||t.actions.has("Mouse Up")||t.actions.has("Mouse Down"))&&this.enableScripting&&this.hasJSActions){this._bindJSAction(i,t);n=!0}if(t.resetForm){this._bindResetFormAction(i,t.resetForm);n=!0}else if(this.isTooltipOnly&&!n){this._bindLink(i,"");n=!0}}this.container.classList.add("linkAnnotation");if(n){this.contentElement=i;this.container.append(i)}return this.container}#Co(){this.container.setAttribute("data-internal-link","")}_bindLink(t,e,i=""){t.href=this.linkService.getDestinationHash(e);t.onclick=()=>{e&&this.linkService.goToDestination(e);return!1};(e||""===e)&&this.#Co();i&&(t.title=i)}_bindNamedAction(t,e,i=""){t.href=this.linkService.getAnchorUrl("");t.onclick=()=>{this.linkService.executeNamedAction(e);return!1};i&&(t.title=i);this.#Co()}#Ao(t,e,i,n="",r=null){t.href=this.linkService.getAnchorUrl("");i.description?t.title=i.description:n&&(t.title=n);const openAttachment=async()=>{const t=await this.linkService.getAttachmentContent(e);t&&this.downloadManager?.openOrDownloadData(t,i.filename,r)};t.onclick=()=>{openAttachment();return!1};this.#Co()}#xo(t,e,i=""){t.href=this.linkService.getAnchorUrl("");t.onclick=()=>{this.linkService.executeSetOCGState(e);return!1};i&&(t.title=i);this.#Co()}_bindJSAction(t,{actions:e,id:i,overlaidText:n}){t.href=this.linkService.getAnchorUrl("");const r=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(const n of e.keys()){const e=r.get(n);e&&(t[e]=()=>{this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:i,name:n}});return!1})}n&&(t.title=n);t.onclick||=()=>!1;this.#Co()}_bindResetFormAction(t,e){const i=t.onclick;i||(t.href=this.linkService.getAnchorUrl(""));this.#Co();if(this._fieldObjects)t.onclick=()=>{i?.();const{fields:t,refs:n,include:r}=e,s=[];if(0!==t.length||0!==n.length){const e=new Set(n);for(const i of t){const t=this._fieldObjects.get(i)||[];for(const{id:i}of t)e.add(i)}const i=new Map;for(const t of this._fieldObjects.values())for(const{id:e,kidIds:n}of t)n&&i.set(e,n);for(const t of e)for(const n of i.get(t)||[])e.add(n);for(const t of this._fieldObjects.values())for(const i of t)e.has(i.id)===r&&s.push(i)}else for(const t of this._fieldObjects.values())s.push(...t);const a=this.annotationStorage,o=[];for(const t of s){const{id:e}=t;o.push(e);switch(t.type){case"text":{const i=t.defaultValue||"";a.setValue(e,{value:i});break}case"checkbox":case"radiobutton":{const i=t.defaultValue===t.exportValues;a.setValue(e,{value:i});break}case"combobox":case"listbox":{const i=t.defaultValue||"";a.setValue(e,{value:i});break}default:continue}const i=document.querySelector(`[data-element-id="${e}"]`);i&&(Qn.has(i)?i.dispatchEvent(new Event("resetform")):warn(`_bindResetFormAction - element not allowed: ${e}`))}this.enableScripting&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:o,name:"ResetForm"}});return!1};else{warn('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.');i||(t.onclick=()=>!1)}}}class TextAnnotationElement extends AnnotationElement{constructor(t){super(t,{isRenderable:!0})}render(){this.container.classList.add("textAnnotation");const t=document.createElement("img");t.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg";t.setAttribute("data-l10n-id","pdfjs-text-annotation-type");t.setAttribute("data-l10n-args",JSON.stringify({type:this.data.name}));if(!this.data.popupRef&&this.hasPopupData){this.hasOwnCommentButton=!0;this._createPopup()}this.container.append(t);return this.container}}class WidgetAnnotationElement extends AnnotationElement{render(){return this.container}_getKeyModifier(t){return FeatureTest.platform.isMac?t.metaKey:t.ctrlKey}_setEventListener(t,e,i,n,r){i.includes("mouse")?t.addEventListener(i,t=>{this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:n,value:r(t),shift:t.shiftKey,modifier:this._getKeyModifier(t)}})}):t.addEventListener(i,t=>{if("blur"===i){if(!e.focused||!t.relatedTarget)return;e.focused=!1}else if("focus"===i){if(e.focused)return;e.focused=!0}r&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:n,value:r(t)}})})}_setEventListeners(t,e,i,n){const{actions:r}=this.data;for(const[s,a]of i)if("Action"===a||r?.has(a)){"Focus"!==a&&"Blur"!==a||(e||={focused:!1});this._setEventListener(t,e,s,a,n);"Focus"!==a||r?.has("Blur")?"Blur"!==a||r?.has("Focus")||this._setEventListener(t,e,"focus","Focus",null):this._setEventListener(t,e,"blur","Blur",null)}}_setTextStyle(t){const e=["left","center","right"],{fontColor:i}=this.data.defaultAppearanceData,n=this.data.defaultAppearanceData.fontSize||9,r=t.style;let s;const roundToOneDecimal=t=>Math.round(10*t)/10;if(this.data.multiLine){const t=Math.abs(this.data.rect[3]-this.data.rect[1]-2),e=t/(Math.round(t/(1.35*n))||1);s=Math.min(n,roundToOneDecimal(e/1.35))}else{const t=Math.abs(this.data.rect[3]-this.data.rect[1]-2);s=Math.min(n,roundToOneDecimal(t/1.35))}r.fontSize=`calc(${s}px * var(--total-scale-factor))`;r.color=Util.makeHexColor(...i);null===this.data.textAlignment||this.data.comb||(r.textAlign=e[this.data.textAlignment])}_setRequired(t,e){e?t.setAttribute("required",!0):t.removeAttribute("required");t.setAttribute("aria-required",e)}}class TextWidgetAnnotationElement extends WidgetAnnotationElement{constructor(t){super(t,{isRenderable:t.renderForms||t.data.hasOwnCanvas||!t.data.hasAppearance&&!!t.data.fieldValue})}setPropertyOnSiblings(t,e,i,n){const r=this.annotationStorage;for(const s of this._getElementsByName(t.name,t.id)){s.domElement&&(s.domElement[e]=i);r.setValue(s.id,{[n]:i})}}render(){const t=this.annotationStorage,e=this.data.id;this.container.classList.add("textWidgetAnnotation");let i=null;if(this.renderForms){const n=t.getValue(e,{value:this.data.fieldValue});let r=n.value||"";const s=t.getValue(e,{charLimit:this.data.maxLen}).charLimit;s&&r.length>s&&(r=r.slice(0,s));let a=n.formattedValue||this.data.textContent?.join("\n")||null;a&&this.data.comb&&(a=a.replaceAll(/\s+/g,""));const o={userValue:r,formattedValue:a,lastCommittedValue:null,commitKey:1,focused:!1};if(this.data.multiLine){i=document.createElement("textarea");i.textContent=a??r;this.data.doNotScroll&&(i.style.overflowY="hidden")}else{i=document.createElement("input");i.type=this.data.password?"password":"text";i.setAttribute("value",a??r);this.data.doNotScroll&&(i.style.overflowX="hidden")}if(this.data.hasOwnCanvas){this.container.classList.add("hasOwnCanvas");t.has(e)&&this.container.classList.add("sandboxModified")}Qn.add(i);this.contentElement=i;i.setAttribute("data-element-id",e);i.disabled=this.data.readOnly;i.name=this.data.fieldName;i.tabIndex=0;const{datetimeFormat:l,datetimeType:c,timeStep:h}=this.data,d=!!c&&this.enableScripting;l&&(i.title=l);this._setRequired(i,this.data.required);s&&(i.maxLength=s);i.addEventListener("input",n=>{t.setValue(e,{value:n.target.value});this.setPropertyOnSiblings(i,"value",n.target.value,"value");o.formattedValue=null});i.addEventListener("resetform",t=>{const e=this.data.defaultFieldValue??"";i.value=o.userValue=e;o.formattedValue=null});let blurListener=t=>{const{formattedValue:e}=o;null!=e&&(t.target.value=e);t.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){i.addEventListener("focus",t=>{if(o.focused)return;const{target:e}=t;if(d){e.type=c;h&&(e.step=h)}if(o.userValue){const t=o.userValue;if(d)if("time"===c){const i=new Date(t),n=[i.getHours(),i.getMinutes(),i.getSeconds()];e.value=n.map(t=>t.toString().padStart(2,"0")).join(":")}else e.value=new Date(t-Zn).toISOString().split("date"===c?"T":".",1)[0];else e.value=t}o.lastCommittedValue=e.value;o.commitKey=1;this.data.actions?.has("Focus")||(o.focused=!0)});i.addEventListener("updatefromsandbox",i=>{this.container.classList.add("sandboxModified");const n={value(i){o.userValue=i.detail.value??"";d||t.setValue(e,{value:o.userValue.toString()});i.target.value=o.userValue},formattedValue(i){const{formattedValue:n}=i.detail;o.formattedValue=n;null!=n&&i.target!==document.activeElement&&(i.target.value=n);const r={formattedValue:n};d&&(r.value=n);t.setValue(e,r)},selRange(t){t.target.setSelectionRange(...t.detail.selRange)},charLimit:i=>{const{charLimit:n}=i.detail,{target:r}=i;if(0===n){r.removeAttribute("maxLength");return}r.setAttribute("maxLength",n);let s=o.userValue;if(s&&!(s.length<=n)){s=s.slice(0,n);r.value=o.userValue=s;t.setValue(e,{value:s});this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:s,willCommit:!0,commitKey:1,selStart:r.selectionStart,selEnd:r.selectionEnd}})}}};this._dispatchEventFromSandbox(n,i)});i.addEventListener("keydown",t=>{o.commitKey=1;let i=-1;"Escape"===t.key?i=0:"Enter"!==t.key||this.data.multiLine?"Tab"===t.key&&(o.commitKey=3):i=2;if(-1===i)return;const{value:n}=t.target;if(o.lastCommittedValue!==n){o.lastCommittedValue=n;o.userValue=n;this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:n,willCommit:!0,commitKey:i,selStart:t.target.selectionStart,selEnd:t.target.selectionEnd}})}});const n=blurListener;blurListener=null;i.addEventListener("blur",t=>{if(!o.focused||!t.relatedTarget)return;this.data.actions?.has("Blur")||(o.focused=!1);const{target:i}=t;let{value:r}=i;if(d){if(r&&"time"===c){const t=r.split(":").map(t=>parseInt(t,10));r=new Date(2e3,0,1,t[0],t[1],t[2]||0).valueOf();i.step=""}else{r.includes("T")||(r=`${r}T00:00`);r=new Date(r).valueOf()}i.type="text"}o.userValue=r;o.lastCommittedValue!==r&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:r,willCommit:!0,commitKey:o.commitKey,selStart:t.target.selectionStart,selEnd:t.target.selectionEnd}});n(t)});this.data.actions?.has("Keystroke")&&i.addEventListener("beforeinput",t=>{o.lastCommittedValue=null;const{data:i,target:n}=t,{value:r,selectionStart:s,selectionEnd:a}=n;let l=s,c=a;switch(t.inputType){case"deleteWordBackward":{const t=/\w/;for(;l>0&&!t.test(r[l-1]);)l--;for(;l>0&&t.test(r[l-1]);)l--;break}case"deleteWordForward":{const t=r.substring(s).match(/^\W*\w*/);t&&(c+=t[0].length);break}case"deleteContentBackward":s===a&&(l-=1);break;case"deleteContentForward":s===a&&(c+=1)}t.preventDefault();this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:r,change:i||"",willCommit:!1,selStart:l,selEnd:c}})});this._setEventListeners(i,o,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],t=>t.target.value)}blurListener&&i.addEventListener("blur",blurListener);if(this.data.comb){const t=(this.data.rect[2]-this.data.rect[0])/s;i.classList.add("comb");i.style.setProperty("--comb-width",`calc(${t}px * var(--total-scale-factor))`);const e=this.data.textAlignment;if(1===e||2===e){const setCombOffset=()=>{const t=s-i.value.length;i.style.setProperty("--comb-offset",`${1===e?t>>1:t}`)};setCombOffset();for(const t of["input","blur","resetform","updatefromsandbox"])i.addEventListener(t,setCombOffset)}}}else{i=document.createElement("div");i.textContent=this.data.fieldValue;i.style.verticalAlign="middle";i.style.display="table-cell";this.data.hasOwnCanvas&&(i.hidden=!0)}this._setTextStyle(i);this._setBackgroundColor(i);this._setDefaultPropertiesFromJS(i);this.container.append(i);return this.container}}class SignatureWidgetAnnotationElement extends WidgetAnnotationElement{constructor(t){super(t,{isRenderable:!!t.data.hasOwnCanvas})}}class CheckboxWidgetAnnotationElement extends WidgetAnnotationElement{constructor(t){super(t,{isRenderable:t.renderForms})}render(){const t=this.annotationStorage,e=this.data,i=e.id;let n=t.getValue(i,{value:e.exportValue===e.fieldValue}).value;if("string"==typeof n){n="Off"!==n;t.setValue(i,{value:n})}this.container.classList.add("buttonWidgetAnnotation","checkBox");const r=document.createElement("input");Qn.add(r);r.setAttribute("data-element-id",i);r.disabled=e.readOnly;this._setRequired(r,this.data.required);r.type="checkbox";r.name=e.fieldName;n&&r.setAttribute("checked",!0);r.setAttribute("exportValue",e.exportValue);r.tabIndex=0;r.addEventListener("change",n=>{const{name:r,checked:s}=n.target;for(const n of this._getElementsByName(r,i)){const i=s&&n.exportValue===e.exportValue;n.domElement&&(n.domElement.checked=i);t.setValue(n.id,{value:i})}t.setValue(i,{value:s})});r.addEventListener("resetform",t=>{const i=e.defaultFieldValue||"Off";t.target.checked=i===e.exportValue});if(this.enableScripting&&this.hasJSActions){r.addEventListener("updatefromsandbox",e=>{const n={value(e){e.target.checked="Off"!==e.detail.value;t.setValue(i,{value:e.target.checked})}};this._dispatchEventFromSandbox(n,e)});this._setEventListeners(r,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],t=>t.target.checked)}this._setDefaultPropertiesFromJS(r);this.container.append(r);return this.container}}class RadioButtonWidgetAnnotationElement extends WidgetAnnotationElement{constructor(t){super(t,{isRenderable:t.renderForms})}render(){this.container.classList.add("buttonWidgetAnnotation","radioButton");const t=this.annotationStorage,e=this.data,i=e.id;let n=t.getValue(i,{value:null!==e.buttonValue&&e.fieldValue===e.buttonValue}).value;if("string"==typeof n){n=n!==e.buttonValue;t.setValue(i,{value:n})}if(n)for(const n of this._getElementsByName(e.fieldName,i))t.setValue(n.id,{value:!1});const r=document.createElement("input");Qn.add(r);r.setAttribute("data-element-id",i);r.disabled=e.readOnly;this._setRequired(r,this.data.required);r.type="radio";r.name=e.fieldName;n&&r.setAttribute("checked",!0);r.tabIndex=0;r.addEventListener("change",e=>{const{name:n,checked:r}=e.target;for(const e of this._getElementsByName(n,i))t.setValue(e.id,{value:!1});t.setValue(i,{value:r})});r.addEventListener("resetform",t=>{const i=e.defaultFieldValue;t.target.checked=null!=i&&i===e.buttonValue});if(this.enableScripting&&this.hasJSActions){const n=e.buttonValue;r.addEventListener("updatefromsandbox",e=>{const r={value:e=>{const r=n===e.detail.value;for(const n of this._getElementsByName(e.target.name)){const e=r&&n.id===i;n.domElement&&(n.domElement.checked=e);t.setValue(n.id,{value:e})}}};this._dispatchEventFromSandbox(r,e)});this._setEventListeners(r,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],t=>t.target.checked)}this._setDefaultPropertiesFromJS(r);this.container.append(r);return this.container}}class PushButtonWidgetAnnotationElement extends LinkAnnotationElement{constructor(t){super(t,{ignoreBorder:t.data.hasAppearance})}render(){const t=super.render();t.classList.add("buttonWidgetAnnotation","pushButton");const e=t.lastChild;if(this.enableScripting&&this.hasJSActions&&e){this._setDefaultPropertiesFromJS(e);e.addEventListener("updatefromsandbox",t=>{this._dispatchEventFromSandbox({},t)})}return t}}class ChoiceWidgetAnnotationElement extends WidgetAnnotationElement{constructor(t){super(t,{isRenderable:t.renderForms})}render(){this.container.classList.add("choiceWidgetAnnotation");const t=this.annotationStorage,e=this.data.id,i=t.getValue(e,{value:this.data.fieldValue}),n=document.createElement("select");Qn.add(n);n.setAttribute("data-element-id",e);n.disabled=this.data.readOnly;this._setRequired(n,this.data.required);n.name=this.data.fieldName;n.tabIndex=0;let r=this.data.combo&&this.data.options.length>0;if(!this.data.combo){n.size=this.data.options.length;this.data.multiSelect&&(n.multiple=!0)}n.addEventListener("resetform",t=>{const e=this.data.defaultFieldValue;for(const t of n.options)t.selected=t.value===e});const fixDisplayValue=(t,e)=>{const i=e.replaceAll(" "," ");t.textContent=i;i!==e&&t.setAttribute("display-value",e)};for(const t of this.data.options){const e=document.createElement("option");fixDisplayValue(e,t.displayValue);e.value=t.exportValue;if(i.value.includes(t.exportValue)){e.setAttribute("selected",!0);r=!1}n.append(e)}let s=null;if(r){const t=document.createElement("option");t.value=" ";t.setAttribute("hidden",!0);t.setAttribute("selected",!0);n.prepend(t);s=()=>{t.remove();n.removeEventListener("input",s);s=null};n.addEventListener("input",s)}const getValue=t=>{const e=t?"value":"textContent",{options:i,multiple:r}=n;return r?Array.prototype.filter.call(i,t=>t.selected).map(t=>t[e]):-1===i.selectedIndex?null:i[i.selectedIndex][e]};let a=getValue(!1);const getItems=t=>{const e=t.target.options;return Array.prototype.map.call(e,t=>({displayValue:t.getAttribute("display-value")||t.textContent,exportValue:t.value}))};if(this.enableScripting&&this.hasJSActions){n.addEventListener("updatefromsandbox",i=>{const r={value(i){s?.();const r=i.detail.value,o=new Set(Array.isArray(r)?r:[r]);for(const t of n.options)t.selected=o.has(t.value);t.setValue(e,{value:getValue(!0)});a=getValue(!1)},multipleSelection(t){n.multiple=!0},remove(i){const r=n.options,s=i.detail.remove;r[s].selected=!1;n.remove(s);if(r.length>0){-1===Array.prototype.findIndex.call(r,t=>t.selected)&&(r[0].selected=!0)}t.setValue(e,{value:getValue(!0),items:getItems(i)});a=getValue(!1)},clear(i){for(;0!==n.length;)n.remove(0);t.setValue(e,{value:null,items:[]});a=getValue(!1)},insert(i){const{index:r,displayValue:s,exportValue:o}=i.detail.insert,l=n.children[r],c=document.createElement("option");fixDisplayValue(c,s);c.value=o;l?l.before(c):n.append(c);t.setValue(e,{value:getValue(!0),items:getItems(i)});a=getValue(!1)},items(i){const{items:r}=i.detail;for(;0!==n.length;)n.remove(0);for(const t of r){const{displayValue:e,exportValue:i}=t,r=document.createElement("option");fixDisplayValue(r,e);r.value=i;n.append(r)}n.options.length>0&&(n.options[0].selected=!0);t.setValue(e,{value:getValue(!0),items:getItems(i)});a=getValue(!1)},indices(i){const n=new Set(i.detail.indices);for(const t of i.target.options)t.selected=n.has(t.index);t.setValue(e,{value:getValue(!0)});a=getValue(!1)},editable(t){t.target.disabled=!t.detail.editable}};this._dispatchEventFromSandbox(r,i)});n.addEventListener("input",i=>{const n=getValue(!0),r=getValue(!1);t.setValue(e,{value:n});i.preventDefault();this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:a,change:r,changeEx:n,willCommit:!1,commitKey:1,keyDown:!1}})});this._setEventListeners(n,null,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"],["input","Action"],["input","Validate"]],t=>t.target.value)}else n.addEventListener("input",function(i){t.setValue(e,{value:getValue(!0)})});this.data.combo&&this._setTextStyle(n);this._setBackgroundColor(n);this._setDefaultPropertiesFromJS(n);this.container.append(n);return this.container}}class PopupAnnotationElement extends AnnotationElement{constructor(t){const{data:e,elements:i,parent:n}=t,r=!!n._commentManager;super(t,{isRenderable:!r&&AnnotationElement._hasPopupData(e)});this.elements=i;if(r&&AnnotationElement._hasPopupData(e)){const t=this.popup=this.#Eo();for(const e of i)e.popup=t}else this.popup=null}#Eo(){return new PopupElement({container:this.container,color:this.data.color,titleObj:this.data.titleObj,modificationDate:this.data.modificationDate||this.data.creationDate,contentsObj:this.data.contentsObj,richText:this.data.richText,rect:this.data.rect,parentRect:this.data.parentRect||null,parent:this.parent,elements:this.elements,open:this.data.open,commentManager:this.parent._commentManager})}render(){const{container:t}=this;t.classList.add("popupAnnotation");t.role="comment";const e=this.popup=this.#Eo(),i=[];for(const t of this.elements){t.popup=e;t.container.ariaHasPopup="dialog";i.push(t.data.id);t.addHighlightArea()}this.container.setAttribute("aria-controls",i.map(t=>`${Si}${t}`).join(","));return this.container}}class PopupElement{#$=null;#So=this.#uo.bind(this);#To=this.#ko.bind(this);#Po=this.#Mo.bind(this);#Do=this.#Io.bind(this);#Fo=null;#Pt=null;#Oo=null;#Ro=null;#Bo=null;#Lo=null;#No=null;#Uo=!1;#Ho=null;#zo=null;#F=null;#Go=null;#Wo=null;#_e=null;#jo=null;#be=null;#Vo=null;#yo=null;#qo=!1;#$o=null;#Xo=null;constructor({container:t,color:e,elements:i,titleObj:n,modificationDate:r,contentsObj:s,richText:a,parent:o,rect:l,parentRect:c,open:h,commentManager:d=null}){this.#Pt=t;this.#Vo=n;this.#Oo=s;this.#be=a;this.#Lo=o;this.#Fo=e;this.#jo=l;this.#No=c;this.#Bo=i;this.#$=d;this.#$o=i[0];this.#Ro=PDFDateString.toDateObject(r);this.trigger=i.flatMap(t=>t.getElementsToTriggerPopup());if(!d){this.#Ko();this.#Pt.hidden=!0;h&&this.#Io()}}#Ko(){if(this.#zo)return;this.#zo=new AbortController;const{signal:t}=this.#zo;for(const e of this.trigger){e.addEventListener("click",this.#Do,{signal:t});e.addEventListener("pointerenter",this.#Po,{signal:t});e.addEventListener("pointerleave",this.#To,{signal:t});e.classList.add("popupTriggerArea")}for(const e of this.#Bo)e.container?.addEventListener("keydown",this.#So,{signal:t})}#Yo(){const t=this.#Bo.find(t=>t.hasCommentButton);t&&(this.#Wo=t._normalizePoint(t.commentButtonPosition))}renderCommentButton(){if(this.#Go){this.#Go.parentNode||this.#$o.container.after(this.#Go);return}this.#Wo||this.#Yo();if(!this.#Wo)return;const{signal:t}=this.#zo=new AbortController,e=this.#$o.hasOwnCommentButton,togglePopup=()=>{this.#$.toggleCommentPopup(this,!0,void 0,!e)},showPopup=()=>{this.#$.toggleCommentPopup(this,!1,!0,!e)},hidePopup=()=>{this.#$.toggleCommentPopup(this,!1,!1)};if(e){this.#Go=this.#$o.container;for(const e of this.trigger){e.ariaHasPopup="dialog";e.ariaControls="commentPopup";e.addEventListener("keydown",this.#So,{signal:t});e.addEventListener("click",togglePopup,{signal:t});e.addEventListener("pointerenter",showPopup,{signal:t});e.addEventListener("pointerleave",hidePopup,{signal:t});e.classList.add("popupTriggerArea")}}else{const e=this.#Go=document.createElement("button");e.className="annotationCommentButton";const i=this.#$o.container;e.style.zIndex=parseInt(i.style.zIndex,10)+1;e.tabIndex=0;e.ariaHasPopup="dialog";e.ariaControls="commentPopup";e.setAttribute("data-l10n-id","pdfjs-show-comment-button");this.#Jo();this.#Qo();e.addEventListener("keydown",this.#So,{signal:t});e.addEventListener("click",togglePopup,{signal:t});e.addEventListener("pointerenter",showPopup,{signal:t});e.addEventListener("pointerleave",hidePopup,{signal:t});i.after(e)}}#Qo(){if(this.#$o.extraPopupElement&&!this.#$o.editor)return;this.#Go||this.renderCommentButton();const[t,e]=this.#Wo,{style:i}=this.#Go;i.left=`calc(${t}%)`;i.top=`calc(${e}% - var(--comment-button-dim))`}#Jo(){if(!this.#$o.extraPopupElement){this.#Go||this.renderCommentButton();this.#Go.style.backgroundColor=this.commentButtonColor||""}}get commentButtonColor(){const{color:t,opacity:e}=this.#$o.commentData;return t?this.#Lo._commentManager.makeCommentColor(t,e):null}focusCommentButton(){setTimeout(()=>{this.#Go?.focus()},0)}getData(){const{richText:t,color:e,opacity:i,creationDate:n,modificationDate:r}=this.#$o.commentData;return{contentsObj:{str:this.comment},richText:t,color:e,opacity:i,creationDate:n,modificationDate:r}}get elementBeforePopup(){return this.#Go}get comment(){this.#Xo||=this.#$o.commentText;return this.#Xo}set comment(t){t!==this.comment&&(this.#$o.commentText=this.#Xo=t)}focus(){this.#$o.container?.focus()}get parentBoundingClientRect(){return this.#$o.layer.getBoundingClientRect()}setCommentButtonStates({selected:t,hasPopup:e}){if(this.#Go){this.#Go.classList.toggle("selected",t);this.#Go.ariaExpanded=e}}setSelectedCommentButton(t){this.#Go.classList.toggle("selected",t)}get commentPopupPosition(){if(this.#_e)return this.#_e;const{x:t,y:e,height:i}=this.#Go.getBoundingClientRect(),{x:n,y:r,width:s,height:a}=this.#$o.layer.getBoundingClientRect();return[(t-n)/s,(e+i-r)/a]}set commentPopupPosition(t){this.#_e=t}hasDefaultPopupPosition(){return null===this.#_e}get commentButtonPosition(){return this.#Wo}get commentButtonWidth(){return this.#Go.getBoundingClientRect().width/this.parentBoundingClientRect.width}editComment(t){const[e,i]=this.#_e||this.commentButtonPosition.map(t=>t/100),n=this.parentBoundingClientRect,{x:r,y:s,width:a,height:o}=n;this.#$.showDialog(null,this,r+e*a,s+i*o,{...t,parentDimensions:n})}render(){if(this.#Ho)return;const t=this.#Ho=document.createElement("div");t.className="popup";if(this.#Fo){const e=t.style.outlineColor=Util.makeHexColor(...this.#Fo);t.style.backgroundColor=`color-mix(in srgb, ${e} 30%, white)`}const e=document.createElement("span");e.className="header";if(this.#Vo?.str){const t=document.createElement("span");t.className="title";e.append(t);({dir:t.dir,str:t.textContent}=this.#Vo)}t.append(e);if(this.#Ro){const t=document.createElement("time");t.className="popupDate";t.setAttribute("data-l10n-id","pdfjs-annotation-date-time-string");t.setAttribute("data-l10n-args",JSON.stringify({dateObj:this.#Ro.valueOf()}));t.dateTime=this.#Ro.toISOString();e.append(t)}renderRichText({html:this.#Zo||this.#Oo.str,dir:this.#Oo?.dir,className:"popupContent"},t);this.#Pt.append(t)}get#Zo(){const t=this.#be,e=this.#Oo;return!t?.str||e?.str&&e.str!==t.str?null:this.#be.html||null}get#tl(){return this.#Zo?.attributes?.style?.fontSize||0}get#el(){return this.#Zo?.attributes?.style?.color||null}#il(t){const e=[],i={str:t,html:{name:"div",attributes:{dir:"auto"},children:[{name:"p",children:e}]}},n={style:{color:this.#el,fontSize:this.#tl?`calc(${this.#tl}px * var(--total-scale-factor))`:""}};for(const i of t.split("\n"))e.push({name:"span",value:i,attributes:n});return i}#uo(t){t.altKey||t.shiftKey||t.ctrlKey||t.metaKey||("Enter"===t.key||"Escape"===t.key&&this.#Uo)&&this.#Io()}updateEdited({rect:t,popup:e,deleted:i}){if(this.#$){if(i){this.remove();this.#Xo=null}else if(e)if(e.deleted)this.remove();else{this.#Jo();this.#Xo=e.text}if(t){this.#Wo=null;this.#Yo();this.#Qo()}}else if(i||e?.deleted)this.remove();else{this.#Ko();this.#yo||={contentsObj:this.#Oo,richText:this.#be};t&&(this.#F=null);if(e&&e.text){this.#be=this.#il(e.text);this.#Ro=PDFDateString.toDateObject(e.date);this.#Oo=null}this.#Ho?.remove();this.#Ho=null}}resetEdited(){if(this.#yo){({contentsObj:this.#Oo,richText:this.#be}=this.#yo);this.#yo=null;this.#Ho?.remove();this.#Ho=null;this.#F=null}}remove(){this.#zo?.abort();this.#zo=null;this.#Ho?.remove();this.#Ho=null;this.#qo=!1;this.#Uo=!1;this.#Go?.remove();this.#Go=null;if(this.trigger)for(const t of this.trigger)t.classList.remove("popupTriggerArea")}#nl(){if(null!==this.#F)return;const{page:{view:t},viewport:{rawDims:{pageWidth:e,pageHeight:i,pageX:n,pageY:r}}}=this.#Lo;let s=!!this.#No,a=s?this.#No:this.#jo;for(const t of this.#Bo)if(!a||null!==Util.intersect(t.data.rect,a)){a=t.data.rect;s=!0;break}const o=Util.normalizeRect([a[0],t[3]-a[1]+t[1],a[2],t[3]-a[3]+t[1]]),l=s?a[2]-a[0]+5:0,c=o[0]+l,h=o[1];this.#F=[100*(c-n)/e,100*(h-r)/i];const{style:d}=this.#Pt;d.left=`${this.#F[0]}%`;d.top=`${this.#F[1]}%`}#Io(){if(this.#$)this.#$.toggleCommentPopup(this,!1);else{this.#Uo=!this.#Uo;if(this.#Uo){this.#Mo();this.#Pt.addEventListener("click",this.#Do);this.#Pt.addEventListener("keydown",this.#So)}else{this.#ko();this.#Pt.removeEventListener("click",this.#Do);this.#Pt.removeEventListener("keydown",this.#So)}}}#Mo(){this.#Ho||this.render();if(this.isVisible)this.#Uo&&this.#Pt.classList.add("focused");else{this.#nl();this.#Pt.hidden=!1;this.#Pt.style.zIndex=parseInt(this.#Pt.style.zIndex,10)+1e3}}#ko(){this.#Pt.classList.remove("focused");if(!this.#Uo&&this.isVisible){this.#Pt.hidden=!0;this.#Pt.style.zIndex=parseInt(this.#Pt.style.zIndex,10)-1e3}}forceHide(){this.#qo=this.isVisible;this.#qo&&(this.#Pt.hidden=!0)}maybeShow(){if(!this.#$){this.#Ko();if(this.#qo){this.#Ho||this.#Mo();this.#qo=!1;this.#Pt.hidden=!1}}}get isVisible(){return!this.#$&&!1===this.#Pt.hidden}}class FreeTextAnnotationElement extends AnnotationElement{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0});this.textContent=t.data.textContent;this.textPosition=t.data.textPosition;this.annotationEditorType=ki.FREETEXT}render(){this.container.classList.add("freeTextAnnotation");if(this.textContent){const t=this.contentElement=document.createElement("div");t.classList.add("annotationTextContent");t.setAttribute("role","comment");for(const e of this.textContent){const i=document.createElement("span");i.textContent=e;t.append(i)}this.container.append(t)}if(!this.data.popupRef&&this.hasPopupData){this.hasOwnCommentButton=!0;this._createPopup()}this._editOnDoubleClick();return this.container}}class LineAnnotationElement extends AnnotationElement{#rl=null;constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("lineAnnotation");const{data:t,width:e,height:i}=this,n=AnnotationElement._svgFactory,r=n.create(e,i,!0),s=this.#rl=n.createElement("svg:line");s.setAttribute("x1",t.rect[2]-t.lineCoordinates[0]);s.setAttribute("y1",t.rect[3]-t.lineCoordinates[1]);s.setAttribute("x2",t.rect[2]-t.lineCoordinates[2]);s.setAttribute("y2",t.rect[3]-t.lineCoordinates[3]);s.setAttribute("stroke-width",t.borderStyle.width||1);s.setAttribute("stroke","transparent");s.setAttribute("fill","transparent");r.append(s);this.container.append(r);if(!t.popupRef&&this.hasPopupData){this.hasOwnCommentButton=!0;this._createPopup()}return this.container}getElementsToTriggerPopup(){return this.#rl}addHighlightArea(){this.container.classList.add("highlightArea")}}class SquareAnnotationElement extends AnnotationElement{#sl=null;constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("squareAnnotation");const{data:t,width:e,height:i}=this,n=AnnotationElement._svgFactory,r=n.create(e,i,!0),s=t.borderStyle.width,a=this.#sl=n.createElement("svg:rect");a.setAttribute("x",s/2);a.setAttribute("y",s/2);a.setAttribute("width",e-s);a.setAttribute("height",i-s);a.setAttribute("stroke-width",s||1);a.setAttribute("stroke","transparent");a.setAttribute("fill","transparent");r.append(a);this.container.append(r);if(!t.popupRef&&this.hasPopupData){this.hasOwnCommentButton=!0;this._createPopup()}return this.container}getElementsToTriggerPopup(){return this.#sl}addHighlightArea(){this.container.classList.add("highlightArea")}}class CircleAnnotationElement extends AnnotationElement{#al=null;constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("circleAnnotation");const{data:t,width:e,height:i}=this,n=AnnotationElement._svgFactory,r=n.create(e,i,!0),s=t.borderStyle.width,a=this.#al=n.createElement("svg:ellipse");a.setAttribute("cx",e/2);a.setAttribute("cy",i/2);a.setAttribute("rx",e/2-s/2);a.setAttribute("ry",i/2-s/2);a.setAttribute("stroke-width",s||1);a.setAttribute("stroke","transparent");a.setAttribute("fill","transparent");r.append(a);this.container.append(r);if(!t.popupRef&&this.hasPopupData){this.hasOwnCommentButton=!0;this._createPopup()}return this.container}getElementsToTriggerPopup(){return this.#al}addHighlightArea(){this.container.classList.add("highlightArea")}}class PolylineAnnotationElement extends AnnotationElement{#ol=null;constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0});this.containerClassName="polylineAnnotation";this.svgElementName="svg:polyline"}render(){this.container.classList.add(this.containerClassName);const{data:{rect:t,vertices:e,borderStyle:i,popupRef:n},width:r,height:s}=this;if(!e)return this.container;const a=AnnotationElement._svgFactory,o=a.create(r,s,!0);let l=[];for(let i=0,n=e.length;i=0&&r.setAttribute("stroke-width",e||1);if(i)for(let t=0,e=this.#cl.length;t{"Enter"===t.key&&(n?t.metaKey:t.ctrlKey)&&this.#ul()});if(!e.popupRef&&this.hasPopupData){this.hasOwnCommentButton=!0;this._createPopup()}else i.classList.add("popupTriggerArea");t.append(i);return t}getElementsToTriggerPopup(){return this.#dl}addHighlightArea(){this.container.classList.add("highlightArea")}async#ul(){const{fileId:t,filename:e,content:i}=this,n=await this.linkService.getAttachmentContent(t)||i;n&&this.downloadManager?.openOrDownloadData(n,e)}}class MediaAnnotationElement extends AnnotationElement{#B=new AbortController;#pl=null;#gl=null;constructor(t){super(t,{isRenderable:!!t.data.richMedia})}render(){this.container.classList.add("mediaAnnotation");const{filename:t}=this.data.richMedia,e=document.createElement("button");e.className="mediaPlayButton";e.type="button";e.title=e.ariaLabel=t;e.addEventListener("click",()=>this.#ml(e),{signal:this.#B.signal});this.container.append(e);return this.container}async#ml(t){const{fileId:e,filename:i,contentType:n}=this.data.richMedia;t.disabled=!0;let r;try{r=await this.linkService.getAttachmentContent(e)}catch{return}finally{t.disabled=!1}if(!r||!t.isConnected)return;const{signal:s}=this.#B,a=new Blob([r],{type:n});if(!/^(?:video|audio)\//.test(a.type))return;const o=URL.createObjectURL(a);this.#pl=o;const l=a.type.startsWith("audio/"),c=document.createElement(l?"audio":"video");this.#gl=c;c.className="mediaContent";this._setBackgroundColor(c);c.src=o;c.title=i;c.controls=!0;c.autoplay=!0;c.tabIndex=0;if(l){let t=!1,e=!1;const updateControls=()=>{c.controls=t||e};this.container.addEventListener("pointerenter",()=>{t=!0;updateControls()},{signal:s});this.container.addEventListener("pointerleave",()=>{t=!1;updateControls()},{signal:s});this.container.addEventListener("focusin",()=>{e=!0;updateControls()},{signal:s});this.container.addEventListener("focusout",()=>{e=!1;updateControls()},{signal:s})}c.addEventListener("emptied",()=>this.#fl(o),{once:!0,signal:s});t.replaceWith(c);c.play().catch(()=>{})}#fl(t=this.#pl){if(t&&t===this.#pl){URL.revokeObjectURL(t);this.#pl=null}}destroy(){this.#B.abort();if(this.#gl){this.#gl.pause();this.#gl.removeAttribute("src");this.#gl.load();this.#gl=null}this.#fl()}}class AnnotationLayer{#bl=null;#xs=null;#j=null;#yl=new Map;#wl=null;#vl=null;#Bo=[];#_l=!1;zIndex=0;constructor({div:t,accessibilityManager:e,annotationCanvasMap:i,annotationEditorUIManager:n,page:r,viewport:s,structTreeLayer:a,commentManager:o,linkService:l,annotationStorage:c}){this.div=t;this.#bl=e;this.#xs=i;this.#wl=a||null;this.#vl=l||null;this.#j=c||new AnnotationStorage;this.page=r;this.viewport=s;this._annotationEditorUIManager=n;this._commentManager=o||null}hasEditableAnnotations(){return this.#yl.size>0}async render(t){const{annotations:e,optionalContentConfig:i}=t,n=this.div;setLayerDimensions(n,this.viewport);const r=new Map,s=[],a={data:null,layer:n,linkService:this.#vl,downloadManager:t.downloadManager,imageResourcesPath:t.imageResourcesPath||"",renderForms:!1!==t.renderForms,annotationStorage:this.#j,enableComment:!0===t.enableComment,enableAnnotationEditing:!1!==t.enableAnnotationEditing,enableScripting:!0===t.enableScripting,hasJSActions:t.hasJSActions,fieldObjects:t.fieldObjects,parent:this,elements:null};for(const t of e){if(t.noHTML)continue;const e=t.annotationType===Ni.POPUP;if(e){const e=r.get(t.id);if(!e)continue;if(!this._commentManager){s.push(t);continue}a.elements=e}else if(t.rect[2]===t.rect[0]||t.rect[3]===t.rect[1])continue;a.data=t;const n=AnnotationElementFactory.create(a);if(!n.isRenderable)continue;if(!e){this.#Bo.push(n);t.popupRef&&r.getOrInsertComputed(t.popupRef,makeArr).push(n)}const o=n.render();t.hidden&&(o.style.visibility="hidden");n.updateOC(i);if(n._isEditable){this.#yl.set(n.data.id,n);this._annotationEditorUIManager?.renderAnnotationElement(n)}}await this.#Al();for(const t of s){const e=a.elements=r.get(t.id);a.data=t;const i=AnnotationElementFactory.create(a);if(!i.isRenderable)continue;const n=i.render();i.contentElement.id=`${Si}${t.id}`;t.hidden&&(n.style.visibility="hidden");e.at(-1).container.after(n)}this.#xl()}async#Al(){if(0===this.#Bo.length)return;this.div.replaceChildren();const t=[];if(!this.#_l){this.#_l=!0;for(const{contentElement:e,data:{hidden:i,id:n,oc:r}}of this.#Bo){const s=e.id=`${Si}${n}`,a="a"===e.localName&&!i&&!r;t.push(this.#wl?.getAriaAttributes(s,{enableLinkOwnership:a}).then(t=>{if(t)for(const[i,n]of t)e.setAttribute(i,n)}))}}this.#Bo.sort(({data:{rect:[t,e,i,n]}},{data:{rect:[r,s,a,o]}})=>{if(t===i&&e===n)return 1;if(r===a&&s===o)return-1;const l=(e+n)/2,c=(s+o)/2;if(l>=o&&c<=e)return-1;if(c>=n&&l<=s)return 1;return(t+i)/2-(r+a)/2});const e=document.createDocumentFragment();for(const t of this.#Bo){e.append(t.container);this._commentManager?(t.extraPopupElement?.popup||t.popup)?.renderCommentButton():t.extraPopupElement&&e.append(t.extraPopupElement.render())}this.div.append(e);await Promise.all(t);if(this.#bl){const t=await(this.#wl?.getAnnotationIds());for(const{contentElement:e}of this.#Bo)t?.has(e.id)||this.#bl.addPointerInTextLayer(e,!1)}}async addLinkAnnotations(t){const e={data:null,layer:this.div,linkService:this.#vl,parent:this};for(const i of t){i.borderStyle||=AnnotationLayer._defaultBorderStyle;e.data=i;const t=AnnotationElementFactory.create(e);if(t.isRenderable){t.render();t.contentElement.id=`${Si}${i.id}`;this.#Bo.push(t)}}await this.#Al()}update({viewport:t,optionalContentConfig:e}){const i=this.div;this.viewport=t;setLayerDimensions(i,{rotation:t.rotation});for(const t of this.#Bo)t.updateOC(e);this.#xl();i.hidden=!1}destroy(){for(const t of this.#Bo){t.destroy?.();this.#bl?.removePointerInTextLayer(t.contentElement)}this.#Bo.length=0;this.#yl.clear();this.div.replaceChildren()}#xl(){if(!this.#xs)return;const t=this.div;for(const[e,i]of this.#xs){const n=t.querySelector(`[data-annotation-id="${e}"]`);if(!n)continue;if(Array.isArray(i))for(const t of i){t.className="annotationContent";t.ariaHidden=!0}else{i.className="annotationContent";i.ariaHidden=!0}const r=[];for(const t of n.children)"CANVAS"===t.nodeName&&r.push(t);for(const t of r)t.remove();const s=Array.isArray(i)?i[0]:i,{firstChild:a}=n;a?a.classList.contains("annotationContent")?a.after(s):a.before(s):n.append(s);if(Array.isArray(i)){let t=s;for(let e=1,n=i.length;ee.data.id===t);if(e<0)return;const[i]=this.#Bo.splice(e,1);this.#bl?.removePointerInTextLayer(i.contentElement)}updateFakeAnnotations(t){if(0!==t.length){for(const e of t)e.updateFakeAnnotationElement(this);this.#Al()}}togglePointerEvents(t=!1){this.div.classList.toggle("disabled",!t)}static get _defaultBorderStyle(){return util_shadow(this,"_defaultBorderStyle",Object.freeze({width:1,rawWidth:1,style:Ui,dashArray:[3],horizontalCornerRadius:0,verticalCornerRadius:0}))}}const tr=/\r\n?|\n/g;class FreeTextEditor extends AnnotationEditor{#Cl="";#El=`${this.id}-editor`;#Sl=null;#tl;_colorPicker=null;static _freeTextDefaultContent="";static _internalPadding=0;static _defaultColor=null;static _defaultFontSize=10;static get _keyboardManager(){const t=FreeTextEditor.prototype,arrowChecker=t=>t.isEmpty(),e=AnnotationEditorUIManager.TRANSLATE_SMALL,i=AnnotationEditorUIManager.TRANSLATE_BIG;return util_shadow(this,"_keyboardManager",new KeyboardManager([[["ctrl+s","mac+meta+s","ctrl+p","mac+meta+p"],t.commitOrRemove,{bubbles:!0}],[["ctrl+Enter","mac+meta+Enter"],t.commitOrRemove],[["Escape"],t.commitOrRemove],[["ArrowLeft"],t._translateEmpty,{args:[-e,0],checker:arrowChecker}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t._translateEmpty,{args:[-i,0],checker:arrowChecker}],[["ArrowRight"],t._translateEmpty,{args:[e,0],checker:arrowChecker}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t._translateEmpty,{args:[i,0],checker:arrowChecker}],[["ArrowUp"],t._translateEmpty,{args:[0,-e],checker:arrowChecker}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t._translateEmpty,{args:[0,-i],checker:arrowChecker}],[["ArrowDown"],t._translateEmpty,{args:[0,e],checker:arrowChecker}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t._translateEmpty,{args:[0,i],checker:arrowChecker}]]))}static _type="freetext";static _editorType=ki.FREETEXT;constructor(t){super({...t,name:"freeTextEditor"});this.color=t.color||FreeTextEditor._defaultColor||AnnotationEditor._defaultLineColor;this.#tl=t.fontSize||FreeTextEditor._defaultFontSize;this.annotationElementId||this._uiManager.a11yAlert(AnnotationEditor._l10nAlert.freetext);this.canAddComment=!1}static initialize(t,e){AnnotationEditor.initialize(t,e);const i=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(i.getPropertyValue("--freetext-padding"))}static updateDefaultParams(t,e){switch(t){case Pi.FREETEXT_SIZE:FreeTextEditor._defaultFontSize=e;break;case Pi.FREETEXT_COLOR:FreeTextEditor._defaultColor=e}}updateParams(t,e){switch(t){case Pi.FREETEXT_SIZE:this.#Tl(e);break;case Pi.FREETEXT_COLOR:this.#Jo(e)}}static get defaultPropertiesToUpdate(){return[[Pi.FREETEXT_SIZE,FreeTextEditor._defaultFontSize],[Pi.FREETEXT_COLOR,FreeTextEditor._defaultColor||AnnotationEditor._defaultLineColor]]}get propertiesToUpdate(){return[[Pi.FREETEXT_SIZE,this.#tl],[Pi.FREETEXT_COLOR,this.color]]}get toolbarButtons(){this._colorPicker||=new BasicColorPicker(this);return[["colorPicker",this._colorPicker]]}get colorType(){return Pi.FREETEXT_COLOR}#Tl(t){const setFontsize=t=>{this.editorDiv.style.fontSize=`calc(${t}px * var(--total-scale-factor))`;this.translate(0,-(t-this.#tl)*this.parentScale);this.#tl=t;this.#kl()},e=this.#tl;this.addCommands({cmd:setFontsize.bind(this,t),undo:setFontsize.bind(this,e),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:Pi.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})}onUpdatedColor(){this.editorDiv.style.color=this.color;this._colorPicker?.update(this.color);super.onUpdatedColor()}#Jo(t){const setColor=t=>{this.color=t;this.onUpdatedColor()},e=this.color;this.addCommands({cmd:setColor.bind(this,t),undo:setColor.bind(this,e),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:Pi.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})}_translateEmpty(t,e){this._uiManager.translateSelectedEditors(t,e,!0)}getInitialTranslation(){const t=this.parentScale;return[-FreeTextEditor._internalPadding*t,-(FreeTextEditor._internalPadding+this.#tl)*t]}rebuild(){if(this.parent){super.rebuild();null!==this.div&&(this.isAttachedToDOM||this.parent.add(this))}}enableEditMode(){if(!super.enableEditMode())return!1;this.overlayDiv.classList.remove("enabled");this.editorDiv.contentEditable=!0;this._isDraggable=!1;this.div.removeAttribute("aria-activedescendant");this.#Sl=new AbortController;const t=this._uiManager.combinedSignal(this.#Sl);this.editorDiv.addEventListener("keydown",this.editorDivKeydown.bind(this),{signal:t});this.editorDiv.addEventListener("focus",this.editorDivFocus.bind(this),{signal:t});this.editorDiv.addEventListener("blur",this.editorDivBlur.bind(this),{signal:t});this.editorDiv.addEventListener("input",this.editorDivInput.bind(this),{signal:t});this.editorDiv.addEventListener("paste",this.editorDivPaste.bind(this),{signal:t});return!0}disableEditMode(){if(!super.disableEditMode())return!1;this.overlayDiv.classList.add("enabled");this.editorDiv.contentEditable=!1;this.div.setAttribute("aria-activedescendant",this.#El);this._isDraggable=!0;this.#Sl?.abort();this.#Sl=null;this.div.focus({preventScroll:!0});this.isEditing=!1;this.parent.div.classList.add("freetextEditing");return!0}focusin(t){if(this._focusEventsAllowed){super.focusin(t);t.target!==this.editorDiv&&this.editorDiv.focus()}}onceAdded(t){if(!this.width){this.enableEditMode();t&&this.editorDiv.focus();this._initialOptions?.isCentered&&this.center();this._initialOptions=null}}isEmpty(){return!this.editorDiv||""===this.editorDiv.innerText.trim()}remove(){this.isEditing=!1;if(this.parent){this.parent.setEditingState(!0);this.parent.div.classList.add("freetextEditing")}super.remove()}#Pl(){const t=[];this.editorDiv.normalize();let e=null;for(const i of this.editorDiv.childNodes)if(e?.nodeType!==Node.TEXT_NODE||"BR"!==i.nodeName){t.push(FreeTextEditor.#Ml(i));e=i}return t.join("\n")}#kl(){const[t,e]=this.parentDimensions;let i;if(this.isAttachedToDOM)i=this.div.getBoundingClientRect();else{const{currentLayer:t,div:e}=this,n=e.style.display,r=e.classList.contains("hidden");e.classList.remove("hidden");e.style.display="hidden";t.div.append(this.div);i=e.getBoundingClientRect();e.remove();e.style.display=n;e.classList.toggle("hidden",r)}if(this.rotation%180==this.parentRotation%180){this.width=i.width/t;this.height=i.height/e}else{this.width=i.height/t;this.height=i.width/e}this.fixAndSetPosition()}commit(){if(!this.isInEditMode())return;super.commit();this.disableEditMode();const t=this.#Cl,e=this.#Cl=this.#Pl().trimEnd();if(t===e)return;const setText=t=>{this.#Cl=t;if(t){this.#Dl();this._uiManager.rebuild(this);this.#kl()}else this.remove()};this.addCommands({cmd:()=>{setText(e)},undo:()=>{setText(t)},mustExec:!1});this.#kl()}shouldGetKeyboardEvents(){return this.isInEditMode()}enterInEditMode(){this.enableEditMode();this.editorDiv.focus()}keydown(t){if(t.target===this.div&&"Enter"===t.key){this.enterInEditMode();t.preventDefault()}}editorDivKeydown(t){FreeTextEditor._keyboardManager.exec(this,t)}editorDivFocus(t){this.isEditing=!0}editorDivBlur(t){this.isEditing=!1}editorDivInput(t){this.parent.div.classList.toggle("freetextEditing",this.isEmpty())}disableEditing(){this.editorDiv.setAttribute("role","comment");this.editorDiv.removeAttribute("aria-multiline")}enableEditing(){this.editorDiv.setAttribute("role","textbox");this.editorDiv.setAttribute("aria-multiline",!0)}get canChangeContent(){return!0}render(){if(this.div)return this.div;let t,e;if(this._isCopy||this.annotationElementId){t=this.x;e=this.y}super.render();this.editorDiv=document.createElement("div");this.editorDiv.className="internal";this.editorDiv.setAttribute("id",this.#El);this.editorDiv.setAttribute("data-l10n-id","pdfjs-free-text2");this.editorDiv.setAttribute("data-l10n-attrs","default-content");this.enableEditing();this.editorDiv.contentEditable=!0;const{style:i}=this.editorDiv;i.fontSize=`calc(${this.#tl}px * var(--total-scale-factor))`;i.color=this.color;this.div.append(this.editorDiv);this.overlayDiv=document.createElement("div");this.overlayDiv.classList.add("overlay","enabled");this.div.append(this.overlayDiv);if(this._isCopy||this.annotationElementId){const[i,n]=this.parentDimensions;if(this.annotationElementId){const{position:r}=this._initialData;let[s,a]=this.getInitialTranslation();[s,a]=this.pageTranslationToScreen(s,a);const[o,l]=this.pageDimensions,[c,h]=this.pageTranslation;let d,u;switch(this.rotation){case 0:d=t+(r[0]-c)/o;u=e+this.height-(r[1]-h)/l;break;case 90:d=t+(r[0]-c)/o;u=e-(r[1]-h)/l;[s,a]=[a,-s];break;case 180:d=t-this.width+(r[0]-c)/o;u=e-(r[1]-h)/l;[s,a]=[-s,-a];break;case 270:d=t+(r[0]-c-this.height*l)/o;u=e+(r[1]-h-this.width*o)/l;[s,a]=[-a,s]}this.setAt(d*i,u*n,s,a)}else this._moveAfterPaste(t,e);this.#Dl();this._isDraggable=!0;this.editorDiv.contentEditable=!1}else{this._isDraggable=!1;this.editorDiv.contentEditable=!0}return this.div}static#Ml(t){return(t.nodeType===Node.TEXT_NODE?t.nodeValue:t.innerText).replaceAll(tr,"")}editorDivPaste(t){const e=t.clipboardData||window.clipboardData,{types:i}=e;if(1===i.length&&"text/plain"===i[0])return;t.preventDefault();const n=FreeTextEditor.#Il(e.getData("text")||"").replaceAll(tr,"\n");if(!n)return;const r=window.getSelection();if(!r.rangeCount)return;this.editorDiv.normalize();r.deleteFromDocument();const s=r.getRangeAt(0);if(!n.includes("\n")){s.insertNode(document.createTextNode(n));this.editorDiv.normalize();r.collapseToStart();return}const{startContainer:a,startOffset:o}=s,l=[],c=[];if(a.nodeType===Node.TEXT_NODE){const t=a.parentElement;c.push(a.nodeValue.slice(o).replaceAll(tr,""));if(t!==this.editorDiv){let e=l;for(const i of this.editorDiv.childNodes)i!==t?e.push(FreeTextEditor.#Ml(i)):e=c}l.push(a.nodeValue.slice(0,o).replaceAll(tr,""))}else if(a===this.editorDiv){let t=l,e=0;for(const i of this.editorDiv.childNodes){e++===o&&(t=c);t.push(FreeTextEditor.#Ml(i))}}this.#Cl=`${l.join("\n")}${n}${c.join("\n")}`;this.#Dl();const h=new Range;let d=Math.sumPrecise(l.map(t=>t.length));for(const{firstChild:t}of this.editorDiv.childNodes)if(t.nodeType===Node.TEXT_NODE){const e=t.nodeValue.length;if(d<=e){h.setStart(t,d);h.setEnd(t,d);break}d-=e}r.removeAllRanges();r.addRange(h)}#Dl(){this.editorDiv.replaceChildren();if(this.#Cl)for(const t of this.#Cl.split("\n")){const e=document.createElement("div");e.append(t?document.createTextNode(t):document.createElement("br"));this.editorDiv.append(e)}}#Fl(){return this.#Cl.replaceAll(" "," ")}static#Il(t){return t.replaceAll(" "," ")}get contentDiv(){return this.editorDiv}getPDFRect(){const t=FreeTextEditor._internalPadding*this.parentScale;return this.getRect(t,t)}static async deserialize(t,e,i){let n=null;if(t instanceof FreeTextAnnotationElement){const{data:{defaultAppearanceData:{fontSize:e,fontColor:i},rect:r,rotation:s,id:a,popupRef:o,richText:l,contentsObj:c,creationDate:h,modificationDate:d},textContent:u,textPosition:p,parent:{page:{pageNumber:g}}}=t;if(!u?.length)return null;n=t={annotationType:ki.FREETEXT,color:Array.from(i),fontSize:e,value:u.join("\n"),position:p,pageIndex:g-1,rect:r.slice(0),rotation:s,annotationElementId:a,id:a,deleted:!1,popupRef:o,comment:c?.str||null,richText:l,creationDate:h,modificationDate:d}}const r=await super.deserialize(t,e,i);r.#tl=t.fontSize;r.color=Util.makeHexColor(...t.color);r.#Cl=FreeTextEditor.#Il(t.value);r._initialData=n;t.comment&&r.setCommentData(t);return r}serialize(t=!1){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();const e=AnnotationEditor._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:this.color),i=Object.assign(super.serialize(t),{color:e,fontSize:this.#tl,value:this.#Fl()});this.addComment(i);if(t){i.isCopy=!0;return i}if(this.annotationElementId&&!this.#Ol(i))return null;i.id=this.annotationElementId;return i}#Ol(t){const{value:e,fontSize:i,color:n,pageIndex:r}=this._initialData;return this.hasEditedComment||this._hasBeenMoved||t.value!==e||t.fontSize!==i||t.color.some((t,e)=>t!==n[e])||t.pageIndex!==r}renderAnnotationElement(t){const e=super.renderAnnotationElement(t);if(!e)return null;const{style:i}=e;i.fontSize=`calc(${this.#tl}px * var(--total-scale-factor))`;i.color=this.color;e.replaceChildren();for(const t of this.#Cl.split("\n")){const i=document.createElement("div");i.append(t?document.createTextNode(t):document.createElement("br"));e.append(i)}t.updateEdited({rect:this.getPDFRect(),popup:this._uiManager.hasCommentManager()||this.hasEditedComment?this.comment:{text:this.#Cl}});return e}resetAnnotationElement(t){super.resetAnnotationElement(t);t.resetEdited()}}class DrawingOptions{#Rl=Object.create(null);updateProperty(t,e){this[t]=e;this.updateSVGProperty(t,e)}updateProperties(t){if(t)for(const[e,i]of Object.entries(t))e.startsWith("_")||this.updateProperty(e,i)}updateSVGProperty(t,e){this.#Rl[t]=e}toSVGProperties(){const t=this.#Rl;this.#Rl=Object.create(null);return{root:t}}reset(){this.#Rl=Object.create(null)}updateAll(t=this){this.updateProperties(t)}clone(){unreachable("Not implemented")}}class DrawingEditor extends AnnotationEditor{#Bl=null;#Ll;_clipPathId=null;_colorPicker=null;_drawId=null;_drawOutlines=null;_focusDrawId=null;static _currentDrawId=-1;static _currentParent=null;static#Nl=null;static#Ul=null;static#Hl=null;static#zl=null;static _INNER_MARGIN=3;constructor(t){super(t);this.#Ll=t.mustBeCommitted||!1;this._addOutlines(t)}onUpdatedColor(){this._colorPicker?.update(this.color);super.onUpdatedColor()}onUpdatedOpacity(){this._colorPicker?.updateOpacity?.(this.opacity)}_addOutlines(t){if(t.drawOutlines){this.#Gl(t);this.#Wl()}}#Gl({drawOutlines:t,drawId:e,drawingOptions:i,clipPathId:n}){this._drawOutlines=t;this._drawingOptions||=i;this.annotationElementId||this._uiManager.a11yAlert(AnnotationEditor._l10nAlert[this.editorType]);if(e>=0){this._drawId=e;this._clipPathId=n??null;this.parent.drawLayer.finalizeDraw(e,t.defaultProperties);this.#jl(this.parent)}else this._drawId=this.#Vl(t,this.parent);this.#ql(t.box)}#Vl(t,e){const{id:i,clipPathId:n}=e.drawLayer.draw(DrawingEditor._mergeSVGProperties(this._drawingOptions.toSVGProperties(),t.defaultSVGProperties),!1,this.constructor._hasClipPath);this.constructor._hasClipPath&&(this._clipPathId=n);this.#jl(e);return i}#jl(t){const e=this._drawOutlines.getFocusSVGProperties(this.#$l);e&&(this._focusDrawId=t.drawLayer.drawOutline(e,this._drawOutlines.focusMustRemoveSelfIntersections))}#Xl(t=this.#$l){null!==this._focusDrawId&&this.parent?.drawLayer.updateProperties(this._focusDrawId,this._drawOutlines.getFocusSVGProperties(t))}#Kl(t){null!==this._focusDrawId&&this.parent?.drawLayer.updateProperties(this._focusDrawId,{rootClass:t})}#Yl(){const{parent:t,_drawId:e,_focusDrawId:i,_isVisible:n}=this;if(!t||null===e)return;const r={hidden:!n};t.drawLayer.updateProperties(e,{rootClass:r});null!==i&&t.drawLayer.updateProperties(i,{rootClass:r})}static _mergeSVGProperties(t,e){const i=new Set(Object.keys(t));for(const[n,r]of Object.entries(e))i.has(n)?Object.assign(t[n],r):t[n]=r;return t}static getDefaultDrawingOptions(t){unreachable("Not implemented")}static get typesMap(){unreachable("Not implemented")}static get isDrawer(){return!0}static get _hasClipPath(){return!1}static get _hasDrawClass(){return!0}static get supportMultipleDrawings(){return!1}get _drawRotation(){return this.rotation}get _opacityName(){return this.constructor.typesMap.get(this.opacityType)}get#$l(){return(this.parentRotation-this._drawRotation+360)%360}static updateDefaultParams(t,e){const i=this.typesMap.get(t);i&&this._defaultDrawingOptions.updateProperty(i,e);if(this._currentParent){DrawingEditor.#Nl.updateProperty(i,e);this._currentParent.drawLayer.updateProperties(this._currentDrawId,this._defaultDrawingOptions.toSVGProperties())}}updateParams(t,e){const i=this.constructor.typesMap.get(t);i&&this._updateProperty(t,i,e)}static get defaultPropertiesToUpdate(){const t=[],e=this._defaultDrawingOptions;for(const[i,n]of this.typesMap)t.push([i,e[n]]);return t}get propertiesToUpdate(){const t=[],{_drawingOptions:e}=this;for(const[i,n]of this.constructor.typesMap)t.push([i,e[n]]);return t}_updateProperty(t,e,i){const n=this._drawingOptions,r=n[e],setter=i=>{n.updateProperty(e,i);const r=this._drawOutlines.updateProperty(e,i);r&&this.#ql(r);this.parent?.drawLayer.updateProperties(this._drawId,n.toSVGProperties());t===this.colorType?this.onUpdatedColor():t===this.opacityType&&this.onUpdatedOpacity()};this.addCommands({cmd:setter.bind(this,i),undo:setter.bind(this,r),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:t,overwriteIfSameType:!0,keepUndo:!0})}_updateColorAndOpacity(t,e,i=this.colorAndOpacityType){const n=this.constructor.typesMap.get(this.colorType),r=this._opacityName,s=this._drawingOptions,a=s[n],o=s[r],setter=(t,e)=>{s.updateProperty(n,t);s.updateProperty(r,e);this._drawOutlines.updateProperty(n,t);this._drawOutlines.updateProperty(r,e);this.parent?.drawLayer.updateProperties(this._drawId,s.toSVGProperties());this.onUpdatedColor();this.onUpdatedOpacity()};this.addCommands({cmd:setter.bind(this,t,e),undo:setter.bind(this,a,o),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:i,overwriteIfSameType:!0,keepUndo:!0})}_onResizing(){this.parent?.drawLayer.updateProperties(this._drawId,DrawingEditor._mergeSVGProperties(this._drawOutlines.getPathResizingSVGProperties(this.#Jl()),{bbox:this.#Ql()}))}_onResized(){this.parent?.drawLayer.updateProperties(this._drawId,DrawingEditor._mergeSVGProperties(this._drawOutlines.getPathResizedSVGProperties(this.#Jl()),{bbox:this.#Ql()}));this.#Xl()}_onTranslating(t,e){this.parent?.drawLayer.updateProperties(this._drawId,{bbox:this.#Ql()})}_onTranslated(){this.parent?.drawLayer.updateProperties(this._drawId,DrawingEditor._mergeSVGProperties(this._drawOutlines.getPathTranslatedSVGProperties(this.#Jl(),this.parentDimensions),{bbox:this.#Ql()}))}_onStartDragging(){this.parent?.drawLayer.updateProperties(this._drawId,{rootClass:{moving:!0}})}_onStopDragging(){this.parent?.drawLayer.updateProperties(this._drawId,{rootClass:{moving:!1}})}get _mustBeDisabledOnCommit(){return!0}commit(){super.commit();if(this._mustBeDisabledOnCommit){this.disableEditMode();this.disableEditing()}}disableEditing(){super.disableEditing();this.div.classList.toggle("disabled",!0)}enableEditing(){super.enableEditing();this.div.classList.toggle("disabled",!1)}getBaseTranslation(){return[0,0]}get isResizable(){return!0}onceAdded(t){this.annotationElementId||null===this._drawId||this.parent.addUndoableEditor(this);this._isDraggable=!0;if(this.#Ll){this.#Ll=!1;this.commit();this.parent.setSelected(this);t&&this.isOnScreen&&this.div.focus()}}remove(){this._uiManager.removeShouldRescale(this);this.#Zl();super.remove()}rebuild(){if(this.parent){super.rebuild();if(null!==this.div){this.#Wl();this.#ql(this._drawOutlines.box);this.isAttachedToDOM||this.parent.add(this)}}}setParent(t){let e=!1;if(this.parent&&!t){this._uiManager.removeShouldRescale(this);this.#Zl()}else if(t){this._uiManager.addShouldRescale(this);this.#Wl(t);e=!this.parent&&this.div?.classList.contains("selectedEditor")}super.setParent(t);this.#Yl();e&&this.select()}#Zl(){if(null===this._drawId||!this.parent)return;const{drawLayer:t}=this.parent;t.remove(this._drawId);this._drawId=null;if(null!==this._focusDrawId){t.remove(this._focusDrawId);this._focusDrawId=null}this._drawingOptions.reset()}#Wl(t=this.parent){if(null===this._drawId||this.parent!==t){if(null!==this._drawId){const{drawLayer:e}=this.parent;e.updateParent(this._drawId,t.drawLayer);null!==this._focusDrawId&&e.updateParent(this._focusDrawId,t.drawLayer);return}this._drawingOptions.updateAll();this._drawId=this.#Vl(this._drawOutlines,t);this._clipPathId&&this.#Bl&&(this.#Bl.style.clipPath=this._clipPathId)}}#tc([t,e,i,n]){const{parentDimensions:[r,s],_drawRotation:a}=this;switch(a){case 90:return[e,1-t,i*(s/r),n*(r/s)];case 180:return[1-t,1-e,i,n];case 270:return[1-e,t,i*(s/r),n*(r/s)];default:return[t,e,i,n]}}#Jl(){const{x:t,y:e,width:i,height:n,parentDimensions:[r,s],_drawRotation:a}=this;switch(a){case 90:return[1-e,t,i*(r/s),n*(s/r)];case 180:return[1-t,1-e,i,n];case 270:return[e,1-t,i*(r/s),n*(s/r)];default:return[t,e,i,n]}}#ql(t){[this.x,this.y,this.width,this.height]=this.#tc(t);if(this.div){this.fixAndSetPosition();this.setDims()}this._onResized()}#Ql(t=this.parentRotation){const{x:e,y:i,width:n,height:r,_drawRotation:s,parentDimensions:[a,o]}=this;switch((4*s+t)/90){case 1:return[1-i-r,e,r,n];case 2:return[1-e-n,1-i-r,n,r];case 3:return[i,1-e-n,r,n];case 4:return[e,i-n*(a/o),r*(o/a),n*(a/o)];case 5:return[1-i,e,n*(a/o),r*(o/a)];case 6:return[1-e-r*(o/a),1-i,r*(o/a),n*(a/o)];case 7:return[i-n*(a/o),1-e-r*(o/a),n*(a/o),r*(o/a)];case 8:return[e-n,i-r,n,r];case 9:return[1-i,e-n,r,n];case 10:return[1-e,1-i,n,r];case 11:return[i-r,1-e,r,n];case 12:return[e-r*(o/a),i,r*(o/a),n*(a/o)];case 13:return[1-i-n*(a/o),e-r*(o/a),n*(a/o),r*(o/a)];case 14:return[1-e,1-i-n*(a/o),r*(o/a),n*(a/o)];case 15:return[i,1-e,n*(a/o),r*(o/a)];default:return[e,i,n,r]}}rotate(t=this.parentRotation){if(!this.parent||null===this._drawId)return;const e=(t-this._drawRotation+360)%360;this.parent.drawLayer.updateProperties(this._drawId,DrawingEditor._mergeSVGProperties({bbox:this.#Ql(t)},this._drawOutlines.updateRotation(e)));this.#Xl(e)}show(t=this._isVisible){super.show(t);this.#Yl()}select(){super.select();this.#Kl({hovered:!1,selected:!0})}unselect(){super.unselect();this.#Kl({selected:!1})}pointerover(){this.isSelected||this.#Kl({hovered:!0})}pointerleave(){this.isSelected||this.#Kl({hovered:!1})}onScaleChanging(){if(!this.parent)return;const t=this._drawOutlines.updateParentDimensions(this.parentDimensions,this.parent.scale);t&&this.#ql(t)}static onScaleChangingWhenDrawing(){}render(){if(this.div)return this.div;let t,e;if(this._isCopy){t=this.x;e=this.y}const i=super.render();this.constructor._hasDrawClass&&i.classList.add("draw");const n=this.#Bl=document.createElement("div");i.append(n);n.setAttribute("aria-hidden","true");n.className="internal";this._clipPathId&&(n.style.clipPath=this._clipPathId);bindEvents(this,n,["pointerover","pointerleave"]);this.setDims();this._uiManager.addShouldRescale(this);this.disableEditing();this._isCopy&&this._moveAfterPaste(t,e);return i}static createDrawerInstance(t){unreachable("Not implemented")}static _getDrawingTarget(t,{target:e}){return e}static _getPointerCoords({offsetX:t,offsetY:e,clientX:i,clientY:n},r=null){if(!r)return[t,e];let s=i-r.clientX,a=n-r.clientY;switch(this._currentParent.viewport.rotation){case 90:[s,a]=[a,-s];break;case 180:[s,a]=[-s,-a];break;case 270:[s,a]=[-a,s]}return[r.offsetX+s,r.offsetY+a]}static _addDrawingListeners(t,e){}static _endDrawingSession(t=!1){return this._currentParent.endDrawingSession(t)}static startDrawing(t,e,i,n){const{pointerId:r,pointerType:s}=n;if(CurrentPointers.isInitializedAndDifferentPointerType(s))return;const a=this._getDrawingTarget(t,n),[o,l]=this._getPointerCoords(n),{viewport:{rotation:c}}=t,{x:h,y:d,width:u,height:p}=a.getBoundingClientRect(),g=DrawingEditor.#Ul=new AbortController,m=t.combinedSignal(g);CurrentPointers.setPointer(s,r);window.addEventListener("pointerup",t=>{CurrentPointers.isSamePointerIdOrRemove(t.pointerId)&&this._endDraw(t)},{signal:m});window.addEventListener("pointercancel",t=>{CurrentPointers.isSamePointerIdOrRemove(t.pointerId)&&this._endDrawingSession()},{signal:m});window.addEventListener("pointerdown",t=>{if(CurrentPointers.isSamePointerType(t.pointerType)){CurrentPointers.initializeAndAddPointerId(t.pointerId);if(DrawingEditor.#Nl.isCancellable()){DrawingEditor.#Nl.removeLastElement();DrawingEditor.#Nl.isEmpty()?this._endDrawingSession(!0):this._endDraw(null)}}},{capture:!0,passive:!1,signal:m});window.addEventListener("contextmenu",noContextMenu,{signal:m});a.addEventListener("pointermove",this._drawMove.bind(this),{signal:m});a.addEventListener("touchmove",t=>{CurrentPointers.isSameTimeStamp(t.timeStamp)&&stopEvent(t)},{signal:m});this._addDrawingListeners(a,m);t.toggleDrawing();e._editorUndoBar?.hide();if(DrawingEditor.#Nl){t.drawLayer.updateProperties(this._currentDrawId,DrawingEditor.#Nl.startNew(o,l,u,p,c,n.timeStamp));return}e.updateUIForDefaultProperties(this);DrawingEditor.#Nl=this.createDrawerInstance({x:o,y:l,box:[h,d,u,p],rotation:c,parent:t,isLTR:i,timeStamp:n.timeStamp});DrawingEditor.#Hl=this.getDefaultDrawingOptions();this._currentParent=t;const{id:f,clipPathId:b}=t.drawLayer.draw(this._mergeSVGProperties(DrawingEditor.#Hl.toSVGProperties(),DrawingEditor.#Nl.defaultSVGProperties),!0,this._hasClipPath);this._currentDrawId=f;DrawingEditor.#zl=this._hasClipPath?b:null}static _drawMove(t){CurrentPointers.isSameTimeStamp(t.timeStamp);if(!DrawingEditor.#Nl||!CurrentPointers.isSamePointerId(t.pointerId))return;if(CurrentPointers.isUsingMultiplePointers()){this._endDraw(t);return}let e;const i=t.getCoalescedEvents?.();if(i?.length){const n=[],r=[];for(const e of i){n.push(...this._getPointerCoords(e,t));r.push(e.timeStamp)}e=DrawingEditor.#Nl.addPoints(n,r)}else e=DrawingEditor.#Nl.add(...this._getPointerCoords(t),t.timeStamp);this._currentParent.drawLayer.updateProperties(this._currentDrawId,e);CurrentPointers.setTimeStamp(t.timeStamp);stopEvent(t)}static _cleanup(t){if(t){this._currentDrawId=-1;this._currentParent=null;DrawingEditor.#Nl=null;DrawingEditor.#Hl=null;DrawingEditor.#zl=null;CurrentPointers.clearTimeStamp()}if(DrawingEditor.#Ul){DrawingEditor.#Ul.abort();DrawingEditor.#Ul=null;CurrentPointers.clearPointerIds()}}static _endDraw(t){const e=this._currentParent;if(e){e.toggleDrawing(!0);this._cleanup(!1);e.drawLayer.updateProperties(this._currentDrawId,t?.target===e.div?DrawingEditor.#Nl.end(...this._getPointerCoords(t),t.timeStamp):DrawingEditor.#Nl.end());if(this.supportMultipleDrawings){const t=DrawingEditor.#Nl,i=this._currentDrawId,n=t.getLastElement();e.addCommands({cmd:()=>{e.drawLayer.updateProperties(i,t.setLastElement(n))},undo:()=>{e.drawLayer.updateProperties(i,t.removeLastElement())},mustExec:!1,type:Pi.DRAW_STEP});return}this.endDrawing(!1)}}static endDrawing(t){const e=this._currentParent;if(!e)return null;e.toggleDrawing(!0);e.cleanUndoStack(Pi.DRAW_STEP);if(!DrawingEditor.#Nl.isEmpty()){const{pageDimensions:[i,n],scale:r}=e,s=e.createAndAddNewEditor({offsetX:0,offsetY:0},!1,{drawId:this._currentDrawId,clipPathId:DrawingEditor.#zl,drawOutlines:DrawingEditor.#Nl.getOutlines(i*r,n*r,r,this._INNER_MARGIN),drawingOptions:DrawingEditor.#Hl,mustBeCommitted:!t});this._cleanup(!0);return s}e.drawLayer.remove(this._currentDrawId);this._cleanup(!0);return null}createDrawingOptions(t){}static deserializeDraw(t,e,i,n,r,s,a){unreachable("Not implemented")}static async deserialize(t,e,i){const{rawDims:{pageWidth:n,pageHeight:r,pageX:s,pageY:a}}=e.viewport,o=this.deserializeDraw(s,a,n,r,this._INNER_MARGIN,t,i),l=await super.deserialize(t,e,i);l.createDrawingOptions(t);l.#Gl({drawOutlines:o});l.#Wl();l.onScaleChanging();l.rotate();return l}serializeDraw(t){const[e,i]=this.pageTranslation,[n,r]=this.pageDimensions;return this._drawOutlines.serialize([e,i,n,r],t)}renderAnnotationElement(t){t.updateEdited({rect:this.getPDFRect()});return null}static canCreateNewEmptyEditor(){return!1}}class Outline{static PRECISION=1e-4;focusOutline=null;toSVGPath(){unreachable("Abstract method `toSVGPath` must be implemented.")}get box(){unreachable("Abstract getter `box` must be implemented.")}serialize(t,e){unreachable("Abstract method `serialize` must be implemented.")}get defaultSVGProperties(){unreachable("Abstract getter `defaultSVGProperties` must be implemented.")}get defaultProperties(){return this.defaultSVGProperties}getFocusSVGProperties(t){return null}get focusMustRemoveSelfIntersections(){return!1}updateProperty(t,e){return null}updateParentDimensions(t,e){return null}serializeQuadPoints(t,e){return null}updateRotation(t){return{}}getPathResizingSVGProperties(t){return{}}getPathResizedSVGProperties(t){return{}}getPathTranslatedSVGProperties(t,e){return{}}static _rotateBox([t,e,i,n],r){switch(r){case 90:return[1-e-n,t,n,i];case 180:return[1-t-i,1-e-n,i,n];case 270:return[e,1-t-i,n,i]}return[t,e,i,n]}static _rescale(t,e,i,n,r,s){s||=new Float32Array(t.length);for(let a=0,o=t.length;a=6;t-=6)isNaN(e[t])?i.push(`L${e[t+4]} ${e[t+5]}`):i.push(`C${e[t]} ${e[t+1]} ${e[t+2]} ${e[t+3]} ${e[t+4]} ${e[t+5]}`);this.#vc(i);return i.join(" ")}#yc(){const[t,e,i,n]=this.#ec,[r,s,a,o]=this.#bc();return`M${(this.#ac[2]-t)/i} ${(this.#ac[3]-e)/n} L${(this.#ac[4]-t)/i} ${(this.#ac[5]-e)/n} L${r} ${s} L${a} ${o} L${(this.#ac[16]-t)/i} ${(this.#ac[17]-e)/n} L${(this.#ac[14]-t)/i} ${(this.#ac[15]-e)/n} Z`}#vc(t){const e=this.#ic;t.push(`L${e[4]} ${e[5]} Z`)}#wc(t){const[e,i,n,r]=this.#ec,s=this.#ac.subarray(4,6),a=this.#ac.subarray(16,18),[o,l,c,h]=this.#bc();t.push(`L${(s[0]-e)/n} ${(s[1]-i)/r} L${o} ${l} L${c} ${h} L${(a[0]-e)/n} ${(a[1]-i)/r}`)}newFreeDrawOutline(t,e,i,n,r,s){return new FreeDrawOutline(t,e,i,n,r,s)}getOutlines(){const t=this.#sc,e=this.#ic,i=this.#ac,[n,r,s,a]=this.#ec,o=new Float32Array((this.#pc?.length??0)+2);for(let t=0,e=o.length-2;t=6;t-=6)for(let i=0;i<6;i+=2)if(isNaN(e[t+i])){l[c]=l[c+1]=NaN;c+=2}else{l[c]=e[t+i];l[c+1]=e[t+i+1];c+=2}this.#xc(l,c);return this.newFreeDrawOutline(l,o,this.#ec,this.#dc,this.#nc,this.#rc)}#_c(t){const e=this.#ac,[i,n,r,s]=this.#ec,[a,o,l,c]=this.#bc(),h=new Float32Array(36);h.set([NaN,NaN,NaN,NaN,(e[2]-i)/r,(e[3]-n)/s,NaN,NaN,NaN,NaN,(e[4]-i)/r,(e[5]-n)/s,NaN,NaN,NaN,NaN,a,o,NaN,NaN,NaN,NaN,l,c,NaN,NaN,NaN,NaN,(e[16]-i)/r,(e[17]-n)/s,NaN,NaN,NaN,NaN,(e[14]-i)/r,(e[15]-n)/s],0);return this.newFreeDrawOutline(h,t,this.#ec,this.#dc,this.#nc,this.#rc)}#xc(t,e){const i=this.#ic;t.set([NaN,NaN,NaN,NaN,i[4],i[5]],e);return e+6}#Ac(t,e){const i=this.#ac.subarray(4,6),n=this.#ac.subarray(16,18),[r,s,a,o]=this.#ec,[l,c,h,d]=this.#bc();t.set([NaN,NaN,NaN,NaN,(i[0]-r)/a,(i[1]-s)/o,NaN,NaN,NaN,NaN,l,c,NaN,NaN,NaN,NaN,h,d,NaN,NaN,NaN,NaN,(n[0]-r)/a,(n[1]-s)/o],e);return e+24}}class FreeDrawOutline extends Outline{#ec;#Cc=new Float32Array(4);#nc;#rc;#pc;#dc;#Ec;constructor(t,e,i,n,r,s){super();this.#Ec=t;this.#pc=e;this.#ec=i;this.#dc=n;this.#nc=r;this.#rc=s;this.firstPoint=[NaN,NaN];this.lastPoint=[NaN,NaN];this.#Sc(s);const[a,o,l,c]=this.#Cc;for(let e=0,i=t.length;eu){s=d;a=u}else a===u&&(s=c(s,d));if(lh[1]){s=h[0];a=h[1]}else a===h[1]&&(s=c(s,h[0]));if(lt[0]-e[0]||t[1]-e[1]||t[2]-e[2]);const t=[];for(const e of this.#Pc)if(e[3]){t.push(...this.#Dc(e));this.#Ic(e)}else{this.#Fc(e);t.push(...this.#Dc(e))}return this.#Oc(t)}#Oc(t){const e=[],i=new Set;for(const i of t){const[t,n,r]=i;e.push([t,n,i],[t,r,i])}e.sort((t,e)=>t[1]-e[1]||t[0]-e[0]);for(let t=0,n=e.length;t0;){const t=i.values().next().value;let[e,r,s,a,o]=t;i.delete(t);let l=e,c=r;const h=[e,s];n.push(h);for(;;){let t;if(i.has(a))t=a;else{if(!i.has(o))break;t=o}i.delete(t);[e,r,s,a,o]=t;if(l!==e){h.push(l,c,e,c===r?r:s);l=e}c=c===r?s:r}h.push(l,c)}return new HighlightOutline(n,this.#ec,this.#Tc,this.#kc)}#Rc(t){const e=this.#Mc;let i=0,n=e.length-1;for(;i<=n;){const r=i+n>>1,s=e[r][0];if(s===t)return r;s=0;n--){const[i,r]=this.#Mc[n];if(i!==t)break;if(i===t&&r===e){this.#Mc.splice(n,1);return}}}#Dc(t){const[e,i,n]=t,r=[[e,i,n]],s=this.#Rc(n);for(let t=0;t=i)if(o>n)r[t][1]=n;else{if(1===s)return[];r.splice(t,1);t--;s--}else{r[t][2]=i;o>n&&r.push([e,n,o])}}}return r}}class HighlightOutline extends Outline{#ec;#Bc=null;#Lc;constructor(t,e,i,n){super();this.#Lc=t;this.#ec=e;this.firstPoint=i;this.lastPoint=n}static build(t,e){const i=new HighlightOutliner(t,.001).getOutlines();i.#Bc=t;i.focusOutline=new HighlightOutliner(t,.0025,.001,e).getOutlines();return i}get isFree(){return!1}get defaultSVGProperties(){return getHighlightSVGProperties(this)}getFocusSVGProperties(t){return getHighlightFocusSVGProperties(this,t)}updateRotation(t){return{root:{"data-main-rotation":t}}}serializeQuadPoints([t,e],[i,n]){const r=this.#Bc,s=new Float32Array(8*r.length);let a=0;for(const{x:o,y:l,width:c,height:h}of r){const r=o*i+t,d=(1-l)*n+e;s[a]=s[a+4]=r;s[a+1]=s[a+3]=d;s[a+2]=s[a+6]=r+c*i;s[a+5]=s[a+7]=d-h*n;a+=8}return s}toSVGPath(){const t=[];for(const e of this.#Lc){let[i,n]=e;t.push(`M${i} ${n}`);for(let r=2;rt.classList.remove("free"),{once:!0});window.addEventListener("blur",()=>this._endDraw(null),{signal:e});window.addEventListener("pointerdown",stopEvent,{capture:!0,passive:!1,signal:e})}static _endDrawingSession(t=!1){return this.endDrawing(t)}createDrawingOptions({color:t,opacity:e,thickness:i}){const{_defaultDrawingOptions:n,_DEFAULT_OPACITY:r}=HighlightEditor;this._drawingOptions=HighlightEditor.getDefaultDrawingOptions({fill:Util.makeHexColor(...t),"fill-opacity":e||r,thickness:i||n.thickness})}static deserializeDraw(t,e,i,n,r,s,a){const{quadPoints:o}=s;if(o){const r=[];for(let s=0,a=o.length;st!==e[i])}renderAnnotationElement(t){if(this.deleted){t.hide();return null}t.updateEdited({rect:this.getPDFRect(),popup:this.comment});return null}}class InputSmoother{static#Xc=10;static#Kc=1e3/180;static#Yc=100;static#Jc=.001;#Qc;#Zc;#th;constructor(t,e,i){this.#Qc=[t,e,i];this.#Zc=this.#th=i}add(t,e,i){const n=this.#Qc,r=n.at(-1);i=i>r?i:r+InputSmoother.#Jc;n.push(t,e,i);const s=this.#eh(i-InputSmoother.#Xc,!0),a=this.#ih(this.#th-InputSmoother.#Xc);if(a>=n.length/2){n.copyWithin(0,a);n.length-=a}return s}get pendingPoints(){return this.#eh(1/0,!1)}end(){return this.#eh(1/0,!0)}#eh(t,e){const i=this.#Qc,n=this.#Zc,r=i.at(-1),s=[],a=this.#th;for(let o=this.#ih(a)+3;ot)return s;const p=Math.min(InputSmoother.#Xc,u-n,r-u);this.#nh(u-p,u+p,s);e&&(this.#th=u)}}return s}#ih(t){const e=this.#Qc;let i=0,n=e.length/3-1;for(;i>1;e[3*r+2]<=t?i=r:n=r-1}return 3*i}#nh(t,e,i){const n=this.#Qc,r=this.#ih(t);let s=0,a=0,o=0;for(let i=r;ilineToSVGPath(t)).join("");return{path:{d:this.#ch}}}#fh(){this.#vh();const t=[this.#ch];if(0===this.#hh){t.push(`M${svgPoint(this.#rl,4)}`);4===this.#pc.length&&t.push(`L${svgPoint(this.#rl,10)}`)}let e=this.#ah?.pendingPoints;e?.length||(e=this.#rh);for(let i=0,n=e.length;ilineToSVGPath(t)).join("")}serialize([t,e,i,n],r){const s=[],a=[],[o,l,c,h]=this.#Eh();let d,u,p,g,m,f,b,y,w;switch(this.#da){case 0:w=Outline._rescale;d=t;u=e+n;p=i;g=-n;m=t+o*i;f=e+(1-l-h)*n;b=t+(o+c)*i;y=e+(1-l)*n;break;case 90:w=Outline._rescaleAndSwap;d=t;u=e;p=i;g=n;m=t+l*i;f=e+o*n;b=t+(l+h)*i;y=e+(o+c)*n;break;case 180:w=Outline._rescale;d=t+i;u=e;p=-i;g=n;m=t+(1-o-c)*i;f=e+l*n;b=t+(1-o)*i;y=e+(l+h)*n;break;case 270:w=Outline._rescaleAndSwap;d=t+i;u=e+n;p=-i;g=-n;m=t+(1-l-h)*i;f=e+(1-o-c)*n;b=t+(1-l)*i;y=e+(1-o)*n}for(const{line:t,points:e}of this.#sh){s.push(w(t,d,u,p,g,r?new Array(t.length):null));a.push(w(e,d,u,p,g,r?new Array(e.length):null))}return{lines:s,points:a,rect:[m,f,b,y]}}static deserialize(t,e,i,n,r,{paths:{lines:s,points:a},rotation:o,thickness:l}){const c=[];let h,d,u,p,g;switch(o){case 0:g=Outline._rescale;h=-t/i;d=e/n+1;u=1/i;p=-1/n;break;case 90:g=Outline._rescaleAndSwap;h=-e/n;d=-t/i;u=1/n;p=1/i;break;case 180:g=Outline._rescale;h=t/i+1;d=-e/n;u=-1/i;p=1/n;break;case 270:g=Outline._rescaleAndSwap;h=e/n+1;d=t/i+1;u=-1/n;p=-1/i}if(!s){s=[];for(const t of a){const e=t.length;if(2===e){s.push(new Float32Array([NaN,NaN,NaN,NaN,t[0],t[1]]));continue}if(4===e){s.push(new Float32Array([NaN,NaN,NaN,NaN,t[0],t[1],NaN,NaN,NaN,NaN,t[2],t[3]]));continue}const i=new Float32Array(3*e);s.push(i);let[n,r,a,o]=t.subarray(0,4);i.set([NaN,NaN,NaN,NaN,n,r],0);for(let s=4;s<=e;s+=2){const l=Math.min(s,e-2),c=t[l],h=t[l+1];i.set(Outline.createBezierPoints(n,r,a,o,c,h),3*(s-2));[n,r,a,o]=[a,o,c,h]}}}for(let t=0,e=s.length;tt??NaN),h,d,u,p),points:g(a[t].map(t=>t??NaN),h,d,u,p)});const m=new this.prototype.constructor;m.build(c,i,n,1,o,l,r);return m}#Sh(t=this.#uc){const e=this.#nc+t/2*this.#xh;return this.#da%180==0?[e/this.#dh,e/this.#uh]:[e/this.#uh,e/this.#dh]}#Eh(){const[t,e,i,n]=this.#Cc,[r,s]=this.#Sh(0);return[t+r,e+s,i-2*r,n-2*s]}#Ch(){const t=this.#Cc=gi.slice();for(const{line:e}of this.#sh){if(e.length<=12){for(let i=4,n=e.length;it!==e[i])||t.thickness!==i||t.opacity!==n||t.pageIndex!==r}renderAnnotationElement(t){if(this.deleted){t.hide();return null}const{points:e,rect:i}=this.serializeDraw(!1);t.updateEdited({rect:i,thickness:this._drawingOptions["stroke-width"],points:e,popup:this.comment});return null}}class ContourDrawOutline extends InkDrawOutline{toSVGPath(){let t=super.toSVGPath();t.endsWith("Z")||(t+="Z");return t}}ni();class SignatureExtractor{static#kh={maxDim:512,sigmaSFactor:.02,sigmaR:25,kernelSize:16};static#Ph(t,e,i,n){n-=e;return 0===(i-=t)?n>0?0:4:1===i?n+6:2-n}static#Mh=new Int32Array([0,1,-1,1,-1,0,-1,-1,0,-1,1,-1,1,0,1,1]);static#Dh(t,e,i,n,r,s,a){const o=this.#Ph(i,n,r,s);for(let r=0;r<8;r++){const s=(-r+o-a+16)%8;if(0!==t[(i+this.#Mh[2*s])*e+(n+this.#Mh[2*s+1])])return s}return-1}static#Ih(t,e,i,n,r,s,a){const o=this.#Ph(i,n,r,s);for(let r=0;r<8;r++){const s=(r+o+a+16)%8;if(0!==t[(i+this.#Mh[2*s])*e+(n+this.#Mh[2*s+1])])return s}return-1}static#Fh(t,e,i,n){const r=t.length,s=new Int32Array(r);for(let e=0;e=1&&0===s[n+1])){1!==r&&(a=Math.abs(r));continue}o+=1;h+=1;r>1&&(a=r)}const d=[i,t],u=h===i+1,p={isHole:u,points:d,id:o,parent:0};l.push(p);let g;for(const t of l)if(t.id===a){g=t;break}g?g.isHole?p.parent=u?g.parent:a:p.parent=u?a:g.parent:p.parent=u?a:0;const m=this.#Dh(s,e,t,i,c,h,0);if(-1===m){s[n]=-o;1!==s[n]&&(a=Math.abs(s[n]));continue}let f=this.#Mh[2*m],b=this.#Mh[2*m+1];const y=t+f,w=i+b;c=y;h=w;let v=t,_=i;for(;;){const r=this.#Ih(s,e,v,_,c,h,1);f=this.#Mh[2*r];b=this.#Mh[2*r+1];const l=v+f,u=_+b;d.push(u,l);const p=v*e+_;0===s[p+1]?s[p]=-o:1===s[p]&&(s[p]=o);if(l===t&&u===i&&v===y&&_===w){1!==s[n]&&(a=Math.abs(s[n]));break}c=v;h=_;v=l;_=u}}}return l}static#Oh(t,e,i,n){if(i-e<=4){for(let r=e;rv){_=n;v=e}}if(v>(l*w)**2){this.#Oh(t,e,_+2,n);this.#Oh(t,_,i,n)}else n.push(r,s)}static#Rh(t){const e=[],i=t.length;this.#Oh(t,0,i,e);e.push(t[i-2],t[i-1]);return e.length<=4?null:e}static#Bh(t,e,i,n,r,s){const a=new Float32Array(s**2),o=-2*n**2,l=s>>1;for(let t=0;t=i))for(let i=0;i=e)continue;const p=t[u*e+n],m=a[o*s+i]*c[Math.abs(p-h)];d+=p*m;g+=m}}p[u[o]=Math.round(d/g)]++}return[u,p]}static#Lh(t){const e=new Uint32Array(256);for(const i of t)e[i]++;return e}static#Nh(t){const e=t.length,i=new Uint8ClampedArray(e>>2);let n=-1/0,r=1/0;for(let e=0,s=i.length;e0!==t);let s=r,a=r;for(e=r;e<256;e++){const r=t[e];if(r>i){if(e-s>n){n=e-s;a=e-1}i=r;s=e}}for(e=a-1;e>=0&&!(t[e]>t[e+1]);e--);return e}static#Hh(t){const e=t,{width:i,height:n}=t,{maxDim:r}=this.#kh;let s=i,a=n;if(i>r||n>r){let o=i,l=n,c=Math.log2(Math.max(i,n)/r);const h=Math.floor(c);c=c===h?h-1:h;for(let i=0;i=-128&&o<=127?Int8Array:a>=-32768&&o<=32767?Int16Array:Int32Array;const c=t.length,h=8+3*c,d=new Uint32Array(h);let u=0;d[u++]=h*Uint32Array.BYTES_PER_ELEMENT+(l-2*c)*s.BYTES_PER_ELEMENT;d[u++]=0;d[u++]=n;d[u++]=r;d[u++]=e?0:1;d[u++]=Math.max(0,Math.floor(i??0));d[u++]=c;d[u++]=s.BYTES_PER_ELEMENT;for(const e of t){d[u++]=e.length-2;d[u++]=e[0];d[u++]=e[1]}const p=new CompressionStream("deflate-raw"),g=p.writable.getWriter();await g.ready;g.write(d);const m=s.prototype.constructor;for(const e of t){const t=new m(e.length-2);for(let i=2,n=e.length;i{await r.ready;await r.close()}).catch(()=>{});let s=null,a=0;for await(const t of i){s||=new Uint8Array(new Uint32Array(t.buffer,0,4)[0]);s.set(t,a);a+=t.length}const o=new Uint32Array(s.buffer,0,s.length>>2),l=o[1];if(0!==l)throw new Error(`Invalid version: ${l}`);const c=o[2],h=o[3],d=0===o[4],u=o[5],p=o[6],g=o[7],m=[],f=(8+3*p)*Uint32Array.BYTES_PER_ELEMENT;let b;switch(g){case Int8Array.BYTES_PER_ELEMENT:b=new Int8Array(s.buffer,f);break;case Int16Array.BYTES_PER_ELEMENT:b=new Int16Array(s.buffer,f);break;case Int32Array.BYTES_PER_ELEMENT:b=new Int32Array(s.buffer,f)}a=0;for(let t=0;t{e?.updateEditSignatureButton(t)})}}getSignaturePreview(){const{newCurves:t,areContours:e,thickness:i,width:n,height:r}=this.#Wh,s=Math.max(n,r);return{areContours:e,outline:SignatureExtractor.processDrawnLines({lines:{curves:t.map(t=>({points:t})),thickness:i,width:n,height:r},pageWidth:s,pageHeight:s,rotation:0,innerMargin:0,mustSmooth:!1,areContours:e}).outline}}get toolbarButtons(){return this._uiManager.signatureManager?[["editSignature",this._uiManager.signatureManager]]:super.toolbarButtons}addSignature(t,e,i,n){const{x:r,y:s}=this,{outline:a}=this.#Wh=t;this.#zh=a instanceof ContourDrawOutline;this.description=i;let o;if(this.#zh)o=SignatureEditor.getDefaultDrawingOptions();else{o=SignatureEditor._defaultDrawnSignatureOptions.clone();o.updateProperties({"stroke-width":a.thickness})}this._addOutlines({drawOutlines:a,drawingOptions:o});const[,l]=this.pageDimensions;let c=e/l;c=c>=1?.5:c;this.width*=c/this.height;if(this.width>=1){c*=.9/this.width;this.width=.9}this.height=c;this.setDims();this.x=r;this.y=s;this.center();this._onResized();this.onScaleChanging();this.rotate();this._uiManager.addToAnnotationStorage(this);this.setUuid(n);this._reportTelemetry({action:"pdfjs.signature.inserted",data:{hasBeenSaved:!!n,hasDescription:!!i}});this.div.hidden=!1;if(this.#Vh){this.#Vh=!1;this.parent.addUndoableEditor(this)}}getFromImage(t){const{rawDims:{pageWidth:e,pageHeight:i},rotation:n}=this.parent.viewport;return SignatureExtractor.process(t,e,i,n,SignatureEditor._INNER_MARGIN)}getFromText(t,e){const{rawDims:{pageWidth:i,pageHeight:n},rotation:r}=this.parent.viewport;return SignatureExtractor.extractContoursFromText(t,e,i,n,r,SignatureEditor._INNER_MARGIN)}getDrawnSignature(t){const{rawDims:{pageWidth:e,pageHeight:i},rotation:n}=this.parent.viewport;return SignatureExtractor.processDrawnLines({lines:t,pageWidth:e,pageHeight:i,rotation:n,innerMargin:SignatureEditor._INNER_MARGIN,mustSmooth:!1,areContours:!1})}createDrawingOptions({areContours:t,thickness:e}){if(t)this._drawingOptions=SignatureEditor.getDefaultDrawingOptions();else{this._drawingOptions=SignatureEditor._defaultDrawnSignatureOptions.clone();this._drawingOptions.updateProperties({"stroke-width":e})}}serialize(t=!1){if(this.isEmpty())return null;const{lines:e,points:i}=this.serializeDraw(t),{_drawingOptions:{"stroke-width":n}}=this,r=Object.assign(super.serialize(t),{isSignature:!0,areContours:this.#zh,color:[0,0,0],thickness:this.#zh?0:n});this.addComment(r);if(t){r.paths={lines:e,points:i};r.uuid=this.#jh;r.isCopy=!0}else r.lines=e;this.#Gh&&(r.accessibilityData={type:"Figure",alt:this.#Gh});return r}static deserializeDraw(t,e,i,n,r,s){return s.areContours?ContourDrawOutline.deserialize(t,e,i,n,r,s):InkDrawOutline.deserialize(t,e,i,n,r,s)}static async deserialize(t,e,i){const n=await super.deserialize(t,e,i);n.#zh=t.areContours;n.description=t.accessibilityData?.alt||"";n.#jh=t.uuid;return n}}class StampEditor extends AnnotationEditor{#qh=null;#$h=null;#Xh=null;#Kh=null;#Yh=null;#Jh="";#Es=null;#Qh=!1;#Zh=null;#td=!1;#ed=!1;static _type="stamp";static _editorType=ki.STAMP;constructor(t){super({...t,name:"stampEditor"});this.#Kh=t.bitmapUrl;this.#Yh=t.bitmapFile;this.defaultL10nId="pdfjs-editor-stamp-editor"}static initialize(t,e){AnnotationEditor.initialize(t,e)}static isHandlingMimeForPasting(t){return an.has(t)}static paste(t,e){e.pasteEditor({mode:ki.STAMP},{bitmapFile:t.getAsFile()})}altTextFinish(){this._uiManager.useNewAltTextFlow&&(this.div.hidden=!1);super.altTextFinish()}get telemetryFinalData(){return{type:"stamp",hasAltText:!!this.altTextData?.altText}}static computeTelemetryFinalData(t){const e=t.get("hasAltText");return{hasAltText:e.get(!0)??0,hasNoAltText:e.get(!1)??0}}#id(t,e=!1){if(t){this.#qh=t.bitmap;if(!e){this.#$h=t.id;this.#td=t.isSvg}t.file&&(this.#Jh=t.file.name);this.#nd()}else this.remove()}#rd(){this.#Xh=null;this._uiManager.enableWaiting(!1);if(this.#Es)if(this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&this.#qh)this.addEditToolbar().then(()=>{this._editToolbar.hide();this._uiManager.editAltText(this,!0)});else{if(!this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&this.#qh){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(t=null,e=!0){if(this.hasAltTextData())return null;const{mlManager:i}=this._uiManager;if(!i)throw new Error("No ML.");if(!await i.isEnabledFor("altText"))throw new Error("ML isn't enabled for alt text.");const{data:n,width:r,height:s}=t||this.copyCanvas(null,null,!0).imageData,a=await i.guess({name:"altText",request:{data:n,width:r,height:s,channels:n.length/(r*s)}});if(!a)throw new Error("No response from the AI service.");if(a.error)throw new Error("Error from the AI service.");if(a.cancel)return null;if(!a.output)throw new Error("No valid response from the AI service.");const o=a.output;await this.setGuessedAltText(o);e&&!this.hasAltTextData()&&(this.altTextData={alt:o,decorative:!1});return o}#sd(){if(this.#$h){this._uiManager.enableWaiting(!0);this._uiManager.imageManager.getFromId(this.#$h).then(t=>this.#id(t,!0)).finally(()=>this.#rd());return}if(this.#Kh){const t=this.#Kh;this.#Kh=null;this._uiManager.enableWaiting(!0);this.#Xh=this._uiManager.imageManager.getFromUrl(t).then(t=>this.#id(t)).finally(()=>this.#rd());return}if(this.#Yh){const t=this.#Yh;this.#Yh=null;this._uiManager.enableWaiting(!0);this.#Xh=this._uiManager.imageManager.getFromFile(t).then(t=>this.#id(t)).finally(()=>this.#rd());return}const t=document.createElement("input");t.type="file";t.accept=an.keys().join(",");const e=this._uiManager._signal;this.#Xh=new Promise(i=>{t.addEventListener("change",async()=>{if(t.files&&0!==t.files.length){this._uiManager.enableWaiting(!0);const e=await this._uiManager.imageManager.getFromFile(t.files[0]);this._reportTelemetry({action:"pdfjs.image.image_selected",data:{alt_text_modal:this._uiManager.useNewAltTextFlow}});this.#id(e)}else this.remove();i()},{signal:e});t.addEventListener("cancel",()=>{this.remove();i()},{signal:e})}).finally(()=>this.#rd());t.click()}remove(){if(this.#$h){this.#qh=null;this._uiManager.imageManager.deleteId(this.#$h);this.#Es?.remove();this.#Es=null;if(this.#Zh){clearTimeout(this.#Zh);this.#Zh=null}}super.remove()}rebuild(){if(this.parent){super.rebuild();if(null!==this.div){this.#$h&&null===this.#Es&&this.#sd();this.isAttachedToDOM||this.parent.add(this)}}else this.#$h&&this.#sd()}onceAdded(t){this._isDraggable=!0;t&&this.div.focus()}isEmpty(){return!(this.#Xh||this.#qh||this.#Kh||this.#Yh||this.#$h||this.#Qh)}get toolbarButtons(){return[["altText",this.createAltText()]]}get isResizable(){return!0}render(){if(this.div)return this.div;let t,e;if(this._isCopy){t=this.x;e=this.y}super.render();this.div.hidden=!0;this.createAltText();this.#Qh||(this.#qh?this.#nd():this.#sd());this._isCopy&&this._moveAfterPaste(t,e);this._uiManager.addShouldRescale(this);return this.div}setCanvas(t,e){const{id:i,bitmap:n}=this._uiManager.imageManager.getFromCanvas(t,e);e.remove();if(i&&this._uiManager.imageManager.isValidId(i)){this.#$h=i;n&&(this.#qh=n);this.#Qh=!1;this.#nd()}}_onResized(){this.onScaleChanging()}onScaleChanging(){if(!this.parent)return;null!==this.#Zh&&clearTimeout(this.#Zh);this.#Zh=setTimeout(()=>{this.#Zh=null;this.#ad()},200)}#nd(){const{div:t}=this;let{width:e,height:i}=this.#qh;const[n,r]=this.pageDimensions,s=.75;if(this.width){e=this.width*n;i=this.height*r}else if(e>s*n||i>s*r){const t=Math.min(s*n/e,s*r/i);e*=t;i*=t}this._uiManager.enableWaiting(!1);const a=this.#Es=document.createElement("canvas");a.setAttribute("role","img");this.addContainer(a);this.width=e/n;this.height=i/r;this.setDims();this._initialOptions?.isCentered?this.center():this.fixAndSetPosition();this._initialOptions=null;this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&!this.annotationElementId||(t.hidden=!1);this.#ad();if(!this.#ed){this.parent.addUndoableEditor(this);this.#ed=!0}this._reportTelemetry({action:"inserted_image"});this.#Jh&&this.div.setAttribute("aria-description",this.#Jh);this.annotationElementId||this._uiManager.a11yAlert(AnnotationEditor._l10nAlert.stamp)}copyCanvas(t,e,i=!1){t||=224;const{width:n,height:r}=this.#qh,s=new OutputScale;let a=this.#qh,o=n,l=r,c=null;if(e){if(n>e||r>e){const t=Math.min(e/n,e/r);o=Math.floor(n*t);l=Math.floor(r*t)}c=document.createElement("canvas");const t=c.width=Math.ceil(o*s.sx),i=c.height=Math.ceil(l*s.sy);this.#td||(a=this.#od(t,i));const h=c.getContext("2d");h.filter=this._uiManager.hcmFilter;let d="white",u="#cfcfd8";if("none"!==this._uiManager.hcmFilter)u="black";else if(ColorScheme.isDarkMode){d="#8f8f9d";u="#42414d"}const p=15,g=p*s.sx,m=p*s.sy,f=new OffscreenCanvas(2*g,2*m),b=f.getContext("2d");b.fillStyle=d;b.fillRect(0,0,2*g,2*m);b.fillStyle=u;b.fillRect(0,0,g,m);b.fillRect(g,m,g,m);h.fillStyle=h.createPattern(f,"repeat");h.fillRect(0,0,t,i);h.drawImage(a,0,0,a.width,a.height,0,0,t,i)}let h=null;if(i){let e,i;if(s.symmetric&&a.widtht||r>t){const s=Math.min(t/n,t/r);e=Math.floor(n*s);i=Math.floor(r*s);this.#td||(a=this.#od(e,i))}}const o=new OffscreenCanvas(e,i).getContext("2d",{willReadFrequently:!0});o.drawImage(a,0,0,a.width,a.height,0,0,e,i);h={width:e,height:i,data:o.getImageData(0,0,e,i).data}}return{canvas:c,width:o,height:l,imageData:h}}#od(t,e){const{width:i,height:n}=this.#qh;let r=i,s=n,a=this.#qh;for(;r>2*t||s>2*e;){const i=r,n=s;r>2*t&&(r=Math.ceil(r/2));s>2*e&&(s=Math.ceil(s/2));const o=new OffscreenCanvas(r,s);o.getContext("2d").drawImage(a,0,0,i,n,0,0,r,s);a=o.transferToImageBitmap()}return a}#ad(){const[t,e]=this.parentDimensions,{width:i,height:n}=this,r=new OutputScale,s=Math.ceil(i*t*r.sx),a=Math.ceil(n*e*r.sy),o=this.#Es;if(!o||o.width===s&&o.height===a)return;o.width=s;o.height=a;const l=this.#td?this.#qh:this.#od(s,a),c=o.getContext("2d");c.filter=this._uiManager.hcmFilter;c.drawImage(l,0,0,l.width,l.height,0,0,s,a)}#ld(t){if(t){if(this.#td){const t=this._uiManager.imageManager.getSvgUrl(this.#$h);if(t)return t}const t=document.createElement("canvas");({width:t.width,height:t.height}=this.#qh);t.getContext("2d").drawImage(this.#qh,0,0);return t.toDataURL()}if(this.#td){const[t,e]=this.pageDimensions,i=Math.round(this.width*t*PixelsPerInch.PDF_TO_CSS_UNITS),n=Math.round(this.height*e*PixelsPerInch.PDF_TO_CSS_UNITS),r=new OffscreenCanvas(i,n);r.getContext("2d").drawImage(this.#qh,0,0,this.#qh.width,this.#qh.height,0,0,i,n);return r.transferToImageBitmap()}return structuredClone(this.#qh)}static async deserialize(t,e,i){let n=null,r=!1;if(t instanceof StampAnnotationElement){const{data:{rect:s,rotation:a,id:o,structParent:l,popupRef:c,richText:h,contentsObj:d,creationDate:u,modificationDate:p},container:g,parent:{page:{pageNumber:m}},canvas:f}=t;let b,y;if(f){delete t.canvas;({id:b,bitmap:y}=i.imageManager.getFromCanvas(g.id,f));f.remove()}else{r=!0;t._hasNoCanvas=!0}const w=(await e._structTree.getAriaAttributes(`${Si}${o}`))?.get("aria-label")||"";n=t={annotationType:ki.STAMP,bitmapId:b,bitmap:y,pageIndex:m-1,rect:s.slice(0),rotation:a,annotationElementId:o,id:o,deleted:!1,accessibilityData:{decorative:!1,altText:w},isSvg:!1,structParent:l,popupRef:c,richText:h,comment:d?.str||null,creationDate:u,modificationDate:p}}const s=await super.deserialize(t,e,i),{rect:a,bitmap:o,bitmapUrl:l,bitmapId:c,isSvg:h,accessibilityData:d}=t;if(r){i.addMissingCanvas(t.id,s);s.#Qh=!0}else if(c&&i.imageManager.isValidId(c)){s.#$h=c;o&&(s.#qh=o)}else s.#Kh=l;s.#td=h;const[u,p]=s.pageDimensions;s.width=(a[2]-a[0])/u;s.height=(a[3]-a[1])/p;d&&(s.altTextData=d);s._initialData=n;t.comment&&s.setCommentData(t);s.#ed=!!n;return s}serialize(t=!1,e=null){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();const i=Object.assign(super.serialize(t),{bitmapId:this.#$h,isSvg:this.#td});this.addComment(i);if(t){i.bitmapUrl=this.#ld(!0);i.accessibilityData=this.serializeAltText(!0);i.isCopy=!0;return i}const{decorative:n,altText:r}=this.serializeAltText(!1);!n&&r&&(i.accessibilityData={type:"Figure",alt:r});if(this.annotationElementId){const t=this.#Ol(i);if(t.isSame)return null;if(t.isSameAltText)delete i.accessibilityData;else{const t=this._initialData.structParent??-1;i.accessibilityData?i.accessibilityData.structParent=t:t>=0&&(i.accessibilityData={type:"Figure",alt:"",structParent:t})}i.id=this.annotationElementId;delete i.bitmapId;return i}if(null===e)return i;e.stamps||=new Map;const s=this.#td?(i.rect[2]-i.rect[0])*(i.rect[3]-i.rect[1]):null;if(e.stamps.has(this.#$h)){if(this.#td){const t=e.stamps.get(this.#$h);if(s>t.area){t.area=s;t.serialized.bitmap.close();t.serialized.bitmap=this.#ld(!1)}}}else{e.stamps.set(this.#$h,{area:s,serialized:i});i.bitmap=this.#ld(!1)}return i}#Ol(t){const{pageIndex:e,accessibilityData:{altText:i}}=this._initialData,n=t.pageIndex===e,r=(t.accessibilityData?.alt||"")===i;return{isSame:!this.hasEditedComment&&!this._hasBeenMoved&&!this._hasBeenResized&&n&&r,isSameAltText:r}}renderAnnotationElement(t){if(this.deleted){t.hide();return null}t.updateEdited({rect:this.getPDFRect(),popup:this.comment});return null}}class AnnotationEditorLayer{#bl;#cd=!1;#hd=null;#dd=null;#ud=null;#pd=new Map;#gd=!1;#md=!1;#fd=!1;#bd=null;#yd=null;#wd=null;#vd=null;#_d=null;#Ad=-1;#y;static _initialized=!1;static#Z=new Map([FreeTextEditor,InkEditor,StampEditor,HighlightEditor,SignatureEditor].map(t=>[t._editorType,t]));constructor({uiManager:t,pageIndex:e,div:i,structTreeLayer:n,accessibilityManager:r,annotationLayer:s,drawLayer:a,textLayer:o,viewport:l,l10n:c}){const h=[...AnnotationEditorLayer.#Z.values()];if(!AnnotationEditorLayer._initialized){AnnotationEditorLayer._initialized=!0;for(const e of h)e.initialize(c,t)}t.registerEditorTypes(h);this.#y=t;this.pageIndex=e;this.div=i;this.#bl=r;this.#hd=s;this.viewport=l;this.#wd=o;this.drawLayer=a;this._structTree=n;this.#y.addLayer(this)}get isEmpty(){return 0===this.#pd.size}get isInvisible(){return this.isEmpty&&this.#y.getMode()===ki.NONE}updateToolbar(t){this.#y.updateToolbar(t)}updateMode(t=this.#y.getMode()){this.#xd();switch(t){case ki.NONE:this.div.classList.toggle("nonEditing",!0);this.disableTextSelection();this.togglePointerEvents(!1);this.toggleAnnotationLayerPointerEvents(!0);this.disableClick();return;case ki.INK:this.disableTextSelection();this.togglePointerEvents(!0);this.enableClick();break;case ki.HIGHLIGHT:this.enableTextSelection();this.togglePointerEvents(!1);this.disableClick();break;default:this.disableTextSelection();this.togglePointerEvents(!0);this.enableClick()}this.toggleAnnotationLayerPointerEvents(!1);const{classList:e}=this.div;e.toggle("nonEditing",!1);if(t===ki.POPUP)e.toggle("commentEditing",!0);else{e.toggle("commentEditing",!1);for(const i of AnnotationEditorLayer.#Z.values())e.toggle(`${i._type}Editing`,t===i._editorType)}this.div.hidden=!1}hasTextLayer(t){return t===this.#wd?.div}setEditingState(t){this.#y.setEditingState(t)}addCommands(t){this.#y.addCommands(t)}cleanUndoStack(t){this.#y.cleanUndoStack(t)}toggleDrawing(t=!1){this.div.classList.toggle("drawing",!t)}togglePointerEvents(t=!1){this.div.classList.toggle("disabled",!t)}toggleAnnotationLayerPointerEvents(t=!1){this.#hd?.togglePointerEvents(t)}get#Cd(){return 0!==this.#pd.size?this.#pd.values():this.#y.getEditors(this.pageIndex)}async enable(){this.#fd=!0;this.div.tabIndex=0;this.togglePointerEvents(!0);this.div.classList.toggle("nonEditing",!1);this.#_d?.abort();this.#_d=null;const t=new Set;for(const e of this.#Cd){e.enableEditing();e.show(!0);if(e.annotationElementId){this.#y.removeChangedExistingAnnotation(e);t.add(e.annotationElementId)}}const e=this.#hd;if(e)for(const i of e.getEditableAnnotations()){i.hide();if(this.#y.isDeletedAnnotationElement(i.data.id)||t.has(i.data.id))continue;const e=await this.deserialize(i);if(e){this.addOrRebuild(e);e.enableEditing()}}this.#fd=!1;this.#y._eventBus.dispatch("editorsrendered",{source:this,pageNumber:this.pageIndex+1})}disable(){this.#md=!0;this.div.tabIndex=-1;this.togglePointerEvents(!1);this.div.classList.toggle("nonEditing",!0);if(this.#wd&&!this.#_d){this.#_d=new AbortController;const t=this.#y.combinedSignal(this.#_d);this.#wd.div.addEventListener("pointerdown",t=>{const{clientX:e,clientY:i,timeStamp:n}=t;if(n-this.#Ad>500){this.#Ad=n;return}this.#Ad=-1;const{classList:r}=this.div;r.toggle("getElements",!0);const s=document.elementsFromPoint(e,i);r.toggle("getElements",!1);if(!this.div.contains(s[0]))return;let a;const o=new RegExp(`^${Ti}[0-9]+$`);for(const t of s)if(o.test(t.id)){a=t.id;break}if(!a)return;const l=this.#pd.get(a);if(null===l?.annotationElementId){stopEvent(t);l.dblclick(t)}},{signal:t,capture:!0})}const t=this.#hd,e=[];if(t){const i=new Map,n=new Map;for(const t of this.#Cd){t.disableEditing();if(t.annotationElementId)if(null===t.serialize()){n.set(t.annotationElementId,t);this.getEditableAnnotation(t.annotationElementId)?.show();t.remove()}else i.set(t.annotationElementId,t);else e.push(t)}for(const e of t.getEditableAnnotations()){const{id:t}=e.data;if(this.#y.isDeletedAnnotationElement(t)){e.updateEdited({deleted:!0});continue}let r=n.get(t);if(r){r.resetAnnotationElement(e);r.show(!1);e.show()}else{r=i.get(t);if(r){this.#y.addChangedExistingAnnotation(r);r.renderAnnotationElement(e)&&r.show(!1)}e.show()}}}this.#xd();this.isEmpty&&(this.div.hidden=!0);const{classList:i}=this.div;for(const t of AnnotationEditorLayer.#Z.values())i.remove(`${t._type}Editing`);this.disableTextSelection();this.toggleAnnotationLayerPointerEvents(!0);t?.updateFakeAnnotations(e);this.#md=!1}getEditableAnnotation(t){return this.#hd?.getEditableAnnotation(t)||null}setActiveEditor(t){this.#y.getActive()!==t&&this.#y.setActiveEditor(t)}enableTextSelection(){this.div.tabIndex=-1;if(this.#wd?.div&&!this.#vd){this.#vd=new AbortController;const t=this.#y.combinedSignal(this.#vd);this.#wd.div.addEventListener("pointerdown",this.#Ed.bind(this),{signal:t});this.#wd.div.classList.add("highlighting")}}disableTextSelection(){this.div.tabIndex=0;if(this.#wd?.div&&this.#vd){this.#vd.abort();this.#vd=null;this.#wd.div.classList.remove("highlighting")}}#Ed(t){this.#y.unselectAll();const{target:e}=t;if(e===this.#wd.div||("img"===e.getAttribute("role")||e.classList.contains("endOfContent")||e.classList.contains("textLayerImages")||e.classList.contains("textLayerImagePlaceholder"))&&this.#wd.div.contains(e)){const{isMac:e}=FeatureTest.platform;if(0!==t.button||t.ctrlKey&&e)return;this.#y.showAllEditors("highlight",!0,!0);HighlightEditor.startDrawing(this,this.#y,"ltr"===this.#y.direction,t);t.preventDefault()}}enableClick(){if(this.#dd)return;this.#dd=new AbortController;const t=this.#y.combinedSignal(this.#dd);this.div.addEventListener("pointerdown",this.pointerdown.bind(this),{signal:t});const e=this.pointerup.bind(this);this.div.addEventListener("pointerup",e,{signal:t});this.div.addEventListener("pointercancel",e,{signal:t})}disableClick(){this.#dd?.abort();this.#dd=null}attach(t){this.#pd.set(t.id,t);const{annotationElementId:e}=t;e&&this.#y.isDeletedAnnotationElement(e)&&this.#y.removeDeletedAnnotationElement(t)}detach(t){this.#pd.delete(t.id);this.#bl?.removePointerInTextLayer(t.contentDiv);!this.#md&&t.annotationElementId&&this.#y.addDeletedAnnotationElement(t)}remove(t){this.detach(t);this.#y.removeEditor(t);t.div.remove();t.isAttachedToDOM=!1}changeParent(t){if(t.parent!==this){if(t.parent&&t.annotationElementId){this.#y.addDeletedAnnotationElement(t);AnnotationEditor.deleteAnnotationElement(t);t.annotationElementId=null}this.attach(t);t.parent?.detach(t);t.setParent(this);if(t.div&&t.isAttachedToDOM){t.div.remove();this.div.append(t.div)}}}add(t){if(t.parent!==this||!t.isAttachedToDOM){this.changeParent(t);this.#y.addEditor(t);this.attach(t);if(!t.isAttachedToDOM){const e=t.render();this.div.append(e);t.isAttachedToDOM=!0}t.fixAndSetPosition();t.onceAdded(!this.#fd);this.#y.addToAnnotationStorage(t);t._reportTelemetry(t.telemetryInitialData)}}moveEditorInDOM(t){if(!t.isAttachedToDOM)return;const{activeElement:e}=document;if(t.div.contains(e)&&!this.#ud){t._focusEventsAllowed=!1;this.#ud=setTimeout(()=>{this.#ud=null;if(t.div.contains(document.activeElement))t._focusEventsAllowed=!0;else{t.div.addEventListener("focusin",()=>{t._focusEventsAllowed=!0},{once:!0,signal:this.#y._signal});e.focus()}},0)}t._structTreeParentId=this.#bl?.moveElementInDOM(this.div,t.div,t.contentDiv,!0)}addOrRebuild(t){if(t.needsToBeRebuilt()){t.parent||=this;t.rebuild();t.show()}else this.add(t)}addUndoableEditor(t){this.addCommands({cmd:()=>t._uiManager.rebuild(t),undo:()=>{t.remove()},mustExec:!1})}getEditorByUID(t){for(const e of this.#pd.values())if(e.uid===t)return e;return null}get#Sd(){return AnnotationEditorLayer.#Z.get(this.#y.getMode())}combinedSignal(t){return this.#y.combinedSignal(t)}#Td(t){const e=this.#Sd;return e?new e.prototype.constructor(t):null}canCreateNewEmptyEditor(){return this.#Sd?.canCreateNewEmptyEditor()}async pasteEditor(t,e){this.updateToolbar(t);await this.#y.updateMode(t.mode);const{offsetX:i,offsetY:n}=this.#kd(),r=this.#y.getId(),s=this.#Td({parent:this,id:r,x:i,y:n,uiManager:this.#y,isCentered:!0,...e});s&&this.add(s)}async deserialize(t){return await(AnnotationEditorLayer.#Z.get(t.annotationType??t.annotationEditorType)?.deserialize(t,this,this.#y))||null}createAndAddNewEditor(t,e,i={}){const n=this.#y.getId(),r=this.#Td({parent:this,id:n,x:t.offsetX,y:t.offsetY,uiManager:this.#y,isCentered:e,...i});r&&this.add(r);return r}get boundingClientRect(){return this.div.getBoundingClientRect()}#kd(){const{x:t,y:e,width:i,height:n}=this.boundingClientRect,r=Math.max(0,t),s=Math.max(0,e),a=(r+Math.min(window.innerWidth,t+i))/2-t,o=(s+Math.min(window.innerHeight,e+n))/2-e,[l,c]=this.viewport.rotation%180==0?[a,o]:[o,a];return{offsetX:l,offsetY:c}}addNewEditor(t={}){this.createAndAddNewEditor(this.#kd(),!0,t)}setSelected(t){this.#y.setSelected(t)}toggleSelected(t){this.#y.toggleSelected(t)}unselect(t){this.#y.unselect(t)}pointerup(t){const{isMac:e}=FeatureTest.platform;if(0!==t.button||t.ctrlKey&&e)return;if(t.target!==this.div)return;if(!this.#gd)return;this.#gd=!1;if(this.#Sd?.isDrawer&&this.#Sd.supportMultipleDrawings)return;if(!this.#cd){this.#cd=!0;return}const i=this.#y.getMode();i!==ki.STAMP&&i!==ki.POPUP&&i!==ki.SIGNATURE?this.createAndAddNewEditor(t,!1):this.#y.unselectAll()}pointerdown(t){this.#y.getMode()===ki.HIGHLIGHT&&this.enableTextSelection();if(this.#gd){this.#gd=!1;return}const{isMac:e}=FeatureTest.platform;if(0!==t.button||t.ctrlKey&&e)return;if(t.target!==this.div)return;this.#gd=!0;if(this.#Sd?.isDrawer){this.startDrawingSession(t);return}const i=this.#y.getActive();this.#cd=!i||i.isEmpty()}startDrawingSession(t){this.div.focus({preventScroll:!0});if(this.#bd){this.#Sd.startDrawing(this,this.#y,!1,t);return}this.#y.setCurrentDrawingSession(this);this.#bd=new AbortController;const e=this.#y.combinedSignal(this.#bd);this.div.addEventListener("blur",({relatedTarget:t})=>{if(t&&!this.div.contains(t)){this.#yd=null;this.commitOrRemove()}},{signal:e});this.#Sd.startDrawing(this,this.#y,!1,t)}pause(t){if(t){const{activeElement:t}=document;this.div.contains(t)&&(this.#yd=t);return}this.#yd&&setTimeout(()=>{this.#yd?.focus();this.#yd=null},0)}endDrawingSession(t=!1){if(!this.#bd)return null;this.#y.setCurrentDrawingSession(null);this.#bd.abort();this.#bd=null;this.#yd=null;return this.#Sd.endDrawing(t)}findNewParent(t,e,i){const n=this.#y.findParent(e,i);if(null===n||n===this)return!1;n.changeParent(t);return!0}commitOrRemove(){if(this.#bd){this.endDrawingSession();return!0}return!1}onScaleChanging(){this.#bd&&this.#Sd.onScaleChangingWhenDrawing(this)}destroy(){this.commitOrRemove();if(this.#y.getActive()?.parent===this){this.#y.commitOrRemove();this.#y.setActiveEditor(null)}if(this.#ud){clearTimeout(this.#ud);this.#ud=null}for(const t of this.#pd.values()){this.#bl?.removePointerInTextLayer(t.contentDiv);t.setParent(null);t.isAttachedToDOM=!1;t.div.remove()}this.div=null;this.#pd.clear();this.#y.removeLayer(this)}#xd(){for(const t of this.#pd.values())t.isEmpty()&&t.remove()}async render({viewport:t}){this.viewport=t;setLayerDimensions(this.div,t);for(const t of this.#y.getEditors(this.pageIndex)){this.add(t);t.rebuild()}await this.#y.findClonesForPage(this);this.div.hidden=this.isEmpty;this.updateMode()}update({viewport:t}){this.#y.commitOrRemove();this.#xd();const e=this.viewport.rotation,i=t.rotation;this.viewport=t;setLayerDimensions(this.div,{rotation:i});if(e!==i)for(const t of this.#pd.values())t.rotate(i)}get pageDimensions(){const{pageWidth:t,pageHeight:e}=this.viewport.rawDims;return[t,e]}get scale(){return this.#y.viewParameters.realScale}}Ge();function compareTextLayers(t,e){return t===e?0:t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}function getTextLayer(t){return t?t.nodeType===Node.ELEMENT_NODE?t.closest(".textLayer"):t.parentElement?.closest(".textLayer")||null:null}function isPointBefore(t,e,i,n){if(t===i)return e<=n;const r=t.compareDocumentPosition(i);return!!(r&Node.DOCUMENT_POSITION_FOLLOWING)||!(r&Node.DOCUMENT_POSITION_PRECEDING)&&null}function normalizeEdgeBoundary(t,e,i){if(t.nodeType!==Node.ELEMENT_NODE||!t.classList.contains("textLayer")||e!==t.childNodes.length)return{container:t,offset:e};let n=t.lastChild;n?.nodeType===Node.ELEMENT_NODE&&n.classList.contains("endOfContent")&&(n=n.previousSibling);return n&&i.contains(n)?n.nodeType===Node.TEXT_NODE?{container:n,offset:n.textContent.length}:{container:n,offset:n.childNodes.length}:null}class DrawLayer{#Lo=null;#Pd=new Map;#wd=null;#rt=null;#xt=null;#Md=null;#Dd=new Map;static#S=0;static#Id=0;static#Fd=null;static#Od=new Set;static#Rd=!1;static#Bd=new Set;static#Ld=new WeakMap;constructor({filterFactory:t=null,pageColors:e=null,pageIndex:i,textLayer:n=null}){this.pageIndex=i;this.#rt=t;this.#xt=e;if(n){const t=DrawLayer.#Ld.get(n);if(t?.selectionDiv){t.selectionDiv.remove();DrawLayer.#Od.delete(t.selectionDiv)}DrawLayer.#Ld.set(n,{drawLayer:this});DrawLayer.#Bd.add(n);this.#wd=n;this.#Md=new MutationObserver(t=>{if(this.#Lo&&this.#wd?.isConnected&&DrawLayer.#Nd())for(const{addedNodes:e}of t)for(const t of e)if(t.nodeType===Node.ELEMENT_NODE&&t.classList.contains("endOfContent")){DrawLayer.#Ut();return}});this.#Md.observe(n,{childList:!0});if(null===DrawLayer.#Fd){DrawLayer.#Fd=new AbortController;const{signal:t}=DrawLayer.#Fd;document.addEventListener("selectionchange",DrawLayer.#Ut.bind(DrawLayer),{signal:t});document.addEventListener("pointerdown",()=>{DrawLayer.#Rd=!0},{signal:t});document.addEventListener("pointerup",()=>{DrawLayer.#Rd=!1},{signal:t});window.addEventListener("blur",()=>{DrawLayer.#Rd=!1},{signal:t})}}}setParent(t){if(this.#Lo){if(this.#Lo!==t){if(this.#Pd.size>0)for(const e of this.#Pd.values()){e.remove();t.append(e)}this.#Lo=t}}else{this.#Lo=t;this.#wd?.isConnected&&DrawLayer.#Nd()&&DrawLayer.#Ut()}}static#Ud(t){const e=this.#Ld.get(t);if(e?.selectionDiv){e.selectionDiv.remove();this.#Od.delete(e.selectionDiv);e.selectionDiv=null;e.path=null}}static#Nd(){const t=document.getSelection();return!!t&&!t.isCollapsed}static#Hd(){return this.#Bd.keys().filter(t=>t.isConnected).toArray().sort(compareTextLayers)}static#Ut(){const t=document.getSelection();if(!t||t.isCollapsed){for(const t of this.#Od)t.remove();this.#Od.clear();return}const e=new WeakMap,i=this.#Hd(),n=[];for(let e=0,r=t.rangeCount;er.intersectsNode(t));if(0===p.length)continue;let g=!1;if(!c){c=p[0];s=c;a=0;g=!0}if(!h){h=p.at(-1);o=h;l=h.childNodes.length;g=!0}if(o.nodeType===Node.ELEMENT_NODE)if(o.classList.contains("endOfContent")){const t=o.previousSibling;if(!t)continue;o=t;l=t.nodeType===Node.TEXT_NODE?t.textContent.length:t.childNodes.length}else if(o.classList.contains("textLayer")&&o.childNodes.length===l){const t=normalizeEdgeBoundary(o,l,h);if(!t)continue;o=t.container;l=t.offset}if(s.nodeType===Node.ELEMENT_NODE){const t=normalizeEdgeBoundary(s,a,c);if(!t)continue;s=t.container;a=t.offset}if(c!==h||g||!p.includes(c))for(const t of p){const e=t.firstChild;if(!e)continue;const i=document.createRange();t===c?i.setStart(s,a):i.setStartBefore(e);if(t===h)i.setEnd(o,l);else{const e=t.lastChild;if(!e)continue;if(e.nodeType===Node.ELEMENT_NODE&&e.classList.contains("endOfContent")){const t=e.previousSibling;if(!t)continue;i.setEndAfter(t)}else i.setEndAfter(e)}i.collapsed||n.push([i,t])}else n.push([r,c])}const r=new Set(n.map(t=>t[1]));for(const t of this.#Bd)r.has(t)||this.#Ud(t);for(const[t,i]of n){const n=DrawLayer.#Ld.get(i);if(!n)continue;let r=e.get(i);if(!r){const t=i.getBoundingClientRect();r=(e,i,n,r)=>({x:(e-t.x)/t.width,y:(i-t.y)/t.height,width:n/t.width,height:r/t.height});e.set(i,r)}const s=[];for(let{x:e,y:i,width:n,height:a}of t.getClientRects())if(0!==n&&0!==a){({x:e,y:i,width:n,height:a}=r(e,i,n,a));1===n&&1===a||s.push(`M${e} ${i} h${n} v${a} h-${n} Z`)}if(0===s.length)continue;const a=n.drawLayer;let o=n.selectionDiv,l=n.path;if(!o){const t="clip_selection_"+DrawLayer.#Id++;o=document.createElement("div");o.className="selection";o.style.clipPath=`url(#${t})`;const e=a.#rt?.createSelectionStyle(a.#xt);if(e)for(const[t,i]of Object.entries(e))o.style.setProperty(t,i);const i=DrawLayer._svgFactory.create(1,1,!0);i.setAttribute("aria-hidden","true");i.setAttribute("width","100%");i.setAttribute("height","100%");const r=DrawLayer._svgFactory.createElement("clipPath");r.setAttribute("id",t);r.setAttribute("clipPathUnits","objectBoundingBox");l=DrawLayer._svgFactory.createElement("path");r.append(l);i.append(r);o.append(i);n.path=l;n.selectionDiv=o}if(a.#Lo&&o.parentNode!==a.#Lo){a.#Lo.append(o);this.#Od.add(o)}l.setAttribute("d",s.join(" "))}}static get _svgFactory(){return util_shadow(this,"_svgFactory",new DOMSVGFactory)}static#zd(t,[e,i,n,r]){const{style:s}=t;s.top=100*i+"%";s.left=100*e+"%";s.width=100*n+"%";s.height=100*r+"%"}#Gd(){const t=DrawLayer._svgFactory.create(1,1,!0);this.#Lo.append(t);t.setAttribute("aria-hidden","true");return t}#Wd(t,e){const i=DrawLayer._svgFactory.createElement("clipPath");t.append(i);const n=`clip_${e}`;i.setAttribute("id",n);i.setAttribute("clipPathUnits","objectBoundingBox");const r=DrawLayer._svgFactory.createElement("use");i.append(r);r.setAttribute("href",`#${e}`);r.classList.add("clip");return n}#jd(t,e){for(const[i,n]of Object.entries(e))null===n?t.removeAttribute(i):t.setAttribute(i,n)}draw(t,e=!1,i=!1){const n=DrawLayer.#S++,r=this.#Gd(),s=DrawLayer._svgFactory.createElement("defs");r.append(s);const a=DrawLayer._svgFactory.createElement("path");s.append(a);const o=`path_${n}`;a.setAttribute("id",o);a.setAttribute("vector-effect","non-scaling-stroke");e&&this.#Dd.set(n,a);const l=i?this.#Wd(s,o):null,c=DrawLayer._svgFactory.createElement("use");r.append(c);c.setAttribute("href",`#${o}`);this.updateProperties(r,t);this.#Pd.set(n,r);return{id:n,clipPathId:`url(#${l})`}}drawOutline(t,e){const i=DrawLayer.#S++,n=this.#Gd(),r=DrawLayer._svgFactory.createElement("defs");n.append(r);const s=DrawLayer._svgFactory.createElement("path");r.append(s);const a=`path_${i}`;s.setAttribute("id",a);s.setAttribute("vector-effect","non-scaling-stroke");let o;if(e){const t=DrawLayer._svgFactory.createElement("mask");r.append(t);o=`mask_${i}`;t.setAttribute("id",o);t.setAttribute("maskUnits","objectBoundingBox");const e=DrawLayer._svgFactory.createElement("rect");t.append(e);e.setAttribute("width","1");e.setAttribute("height","1");e.setAttribute("fill","white");const n=DrawLayer._svgFactory.createElement("use");t.append(n);n.setAttribute("href",`#${a}`);n.setAttribute("stroke","none");n.setAttribute("fill","black");n.setAttribute("fill-rule","nonzero");n.classList.add("mask")}const l=DrawLayer._svgFactory.createElement("use");n.append(l);l.setAttribute("href",`#${a}`);o&&l.setAttribute("mask",`url(#${o})`);const c=l.cloneNode();n.append(c);l.classList.add("mainOutline");c.classList.add("secondaryOutline");this.updateProperties(n,t);this.#Pd.set(i,n);return i}finalizeDraw(t,e){this.#Dd.delete(t);this.updateProperties(t,e)}updateProperties(t,e){if(!e)return;const{root:i,bbox:n,rootClass:r,path:s}=e,a="number"==typeof t?this.#Pd.get(t):t;if(a){i&&this.#jd(a,i);n&&DrawLayer.#zd(a,n);if(r){const{classList:t}=a;for(const[e,i]of Object.entries(r))t.toggle(e,i)}if(s){const t=a.firstElementChild.firstElementChild;this.#jd(t,s)}}}updateParent(t,e){if(e===this)return;const i=this.#Pd.get(t);if(i){e.#Lo.append(i);this.#Pd.delete(t);e.#Pd.set(t,i)}}remove(t){this.#Dd.delete(t);if(null!==this.#Lo){this.#Pd.get(t).remove();this.#Pd.delete(t)}}destroy(){this.#Lo=null;for(const t of this.#Pd.values())t.remove();this.#Pd.clear();this.#Dd.clear();this.#Md?.disconnect();this.#Md=null;if(this.#wd){const t=DrawLayer.#Ld.get(this.#wd);if(t?.drawLayer===this){DrawLayer.#Ud(this.#wd);DrawLayer.#Ld.delete(this.#wd);DrawLayer.#Bd.delete(this.#wd);if(0===DrawLayer.#Bd.size){DrawLayer.#Fd?.abort();DrawLayer.#Fd=null;DrawLayer.#Rd=!1}}this.#wd=null}}}function percentage(t){return`${(100*t).toFixed(2)}%`}class TextLayerImages{#Vd=[];#qd=new Map;#$d=null;#Xd=0;#oa=0;#aa=0;static#Kd=null;constructor(t,e,i,n){this.#Xd=t;this.#Vd=e;this.#oa=i.rawDims.pageWidth;this.#aa=i.rawDims.pageHeight;this.#$d=n}render(){const t=document.createElement("div");t.className="textLayerImages";for(let e=0;e{if(!(t.target instanceof HTMLCanvasElement))return;const e=t.target,i=this.#qd.get(e);if(!i)return;const n=TextLayerImages.#Kd?.deref();if(n===e)return;if(n){n.width=0;n.height=0}TextLayerImages.#Kd=new WeakRef(e);const{inverseTransform:r,x1:s,y1:a,width:o,height:l}=i,c=this.#$d(),h=Math.ceil(s*c.width),d=Math.ceil(a*c.height),u=Math.floor((s+o/this.#oa)*c.width),p=Math.floor((a+l/this.#aa)*c.height);e.width=u-h;e.height=p-d;const g=e.getContext("2d");g.setTransform(...r);g.translate(-h,-d);g.drawImage(c,0,0)});return t}#Yd([t,e,i,n,r,s]){const a=Math.hypot((r-t)*this.#oa,(s-e)*this.#aa),o=Math.hypot((i-t)*this.#oa,(n-e)*this.#aa);if(a { var isCallable = (is_callable_namespaceFn()); var tryToString = (try_to_string_namespaceFn()); @@ -486,7 +486,7 @@ module.exports = function (argument) { }); // MODULE: ./node_modules/core-js/internals/a-possible-prototype.js -var a_possible_prototype_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var a_possible_prototype_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { var isPossiblePrototype = (is_possible_prototype_namespaceFn()); @@ -501,7 +501,7 @@ module.exports = function (argument) { }); // MODULE: ./node_modules/core-js/internals/a-set.js -var a_set_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var a_set_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { var has = (set_helpers_namespaceFn().has); @@ -519,7 +519,7 @@ var a_string_namespaceFn = () => { }; // MODULE: ./node_modules/core-js/internals/a-weak-key.js -var a_weak_key_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var a_weak_key_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { var WeakMapHelpers = (weak_map_helpers_namespaceFn()); @@ -536,7 +536,7 @@ module.exports = function (key) { }); // MODULE: ./node_modules/core-js/internals/a-weak-map.js -var a_weak_map_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var a_weak_map_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { var has = (weak_map_helpers_namespaceFn().has); @@ -549,7 +549,7 @@ module.exports = function (it) { }); // MODULE: ./node_modules/core-js/internals/add-to-unscopables.js -var add_to_unscopables_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var add_to_unscopables_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { var wellKnownSymbol = (well_known_symbol_namespaceFn()); var create = (object_create_namespaceFn()); @@ -575,7 +575,7 @@ module.exports = function (key) { }); // MODULE: ./node_modules/core-js/internals/an-instance.js -var an_instance_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var an_instance_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { var isPrototypeOf = (object_is_prototype_of_namespaceFn()); @@ -589,7 +589,7 @@ module.exports = function (it, Prototype) { }); // MODULE: ./node_modules/core-js/internals/an-object-or-undefined.js -var an_object_or_undefined_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var an_object_or_undefined_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { var isObject = (is_object_namespaceFn()); @@ -604,7 +604,7 @@ module.exports = function (argument) { }); // MODULE: ./node_modules/core-js/internals/an-object.js -var an_object_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var an_object_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { var isObject = (is_object_namespaceFn()); @@ -620,7 +620,7 @@ module.exports = function (argument) { }); // MODULE: ./node_modules/core-js/internals/an-uint8-array.js -var an_uint8_array_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var an_uint8_array_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { var classof = (classof_namespaceFn()); @@ -636,7 +636,7 @@ module.exports = function (argument) { }); // MODULE: ./node_modules/core-js/internals/array-buffer-basic-detection.js -var array_buffer_basic_detection_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var array_buffer_basic_detection_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { // eslint-disable-next-line es/no-typed-arrays -- safe module.exports = typeof ArrayBuffer != 'undefined' && typeof DataView != 'undefined'; @@ -644,7 +644,7 @@ module.exports = typeof ArrayBuffer != 'undefined' && typeof DataView != 'undefi }); // MODULE: ./node_modules/core-js/internals/array-buffer-byte-length.js -var array_buffer_byte_length_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var array_buffer_byte_length_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { var globalThis = (global_this_namespaceFn()); var uncurryThisAccessor = (function_uncurry_this_accessor_namespaceFn()); @@ -664,7 +664,7 @@ module.exports = ArrayBuffer && uncurryThisAccessor(ArrayBuffer.prototype, 'byte }); // MODULE: ./node_modules/core-js/internals/array-buffer-is-detached.js -var array_buffer_is_detached_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var array_buffer_is_detached_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { var globalThis = (global_this_namespaceFn()); var NATIVE_ARRAY_BUFFER = (array_buffer_basic_detection_namespaceFn()); @@ -686,7 +686,7 @@ module.exports = function (O) { }); // MODULE: ./node_modules/core-js/internals/array-buffer-not-detached.js -var array_buffer_not_detached_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var array_buffer_not_detached_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { var isDetached = (array_buffer_is_detached_namespaceFn()); @@ -700,7 +700,7 @@ module.exports = function (it) { }); // MODULE: ./node_modules/core-js/internals/array-buffer-view-core.js -var array_buffer_view_core_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var array_buffer_view_core_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { var NATIVE_ARRAY_BUFFER = (array_buffer_basic_detection_namespaceFn()); var DESCRIPTORS = (descriptors_namespaceFn()); @@ -898,7 +898,7 @@ module.exports = { }); // MODULE: ./node_modules/core-js/internals/array-from-constructor-and-list.js -var array_from_constructor_and_list_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var array_from_constructor_and_list_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { var lengthOfArrayLike = (length_of_array_like_namespaceFn()); @@ -913,7 +913,7 @@ module.exports = function (Constructor, list, $length) { }); // MODULE: ./node_modules/core-js/internals/array-includes.js -var array_includes_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var array_includes_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { var toIndexedObject = (to_indexed_object_namespaceFn()); var toAbsoluteIndex = (to_absolute_index_namespaceFn()); @@ -952,7 +952,7 @@ module.exports = { }); // MODULE: ./node_modules/core-js/internals/array-set-length.js -var array_set_length_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var array_set_length_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { var DESCRIPTORS = (descriptors_namespaceFn()); var isArray = (is_array_namespaceFn()); @@ -984,7 +984,7 @@ module.exports = SILENT_ON_NON_WRITABLE_LENGTH_SET ? function (O, length) { }); // MODULE: ./node_modules/core-js/internals/array-slice.js -var array_slice_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var array_slice_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { var uncurryThis = (function_uncurry_this_namespaceFn()); @@ -998,7 +998,7 @@ var base64_map_namespaceFn = () => { }; // MODULE: ./node_modules/core-js/internals/call-with-safe-iteration-closing.js -var call_with_safe_iteration_closing_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var call_with_safe_iteration_closing_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { var anObject = (an_object_namespaceFn()); var iteratorClose = (iterator_close_namespaceFn()); @@ -1015,7 +1015,7 @@ module.exports = function (iterator, fn, value, ENTRIES) { }); // MODULE: ./node_modules/core-js/internals/classof-raw.js -var classof_raw_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var classof_raw_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { var uncurryThis = (function_uncurry_this_namespaceFn()); @@ -1029,7 +1029,7 @@ module.exports = function (it) { }); // MODULE: ./node_modules/core-js/internals/classof.js -var classof_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var classof_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { var TO_STRING_TAG_SUPPORT = (to_string_tag_support_namespaceFn()); var isCallable = (is_callable_namespaceFn()); @@ -1064,7 +1064,7 @@ module.exports = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) { }); // MODULE: ./node_modules/core-js/internals/copy-constructor-properties.js -var copy_constructor_properties_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var copy_constructor_properties_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { var hasOwn = (has_own_property_namespaceFn()); var ownKeys = (own_keys_namespaceFn()); @@ -1086,7 +1086,7 @@ module.exports = function (target, source, exceptions) { }); // MODULE: ./node_modules/core-js/internals/correct-prototype-getter.js -var correct_prototype_getter_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var correct_prototype_getter_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { var fails = (fails_namespaceFn()); @@ -1105,7 +1105,7 @@ var create_iter_result_object_namespaceFn = () => { }; // MODULE: ./node_modules/core-js/internals/create-non-enumerable-property.js -var create_non_enumerable_property_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var create_non_enumerable_property_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { var DESCRIPTORS = (descriptors_namespaceFn()); var definePropertyModule = (object_define_property_namespaceFn()); @@ -1121,7 +1121,7 @@ module.exports = DESCRIPTORS ? function (object, key, value) { }); // MODULE: ./node_modules/core-js/internals/create-property-descriptor.js -var create_property_descriptor_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var create_property_descriptor_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { module.exports = function (bitmap, value) { return { @@ -1135,7 +1135,7 @@ module.exports = function (bitmap, value) { }); // MODULE: ./node_modules/core-js/internals/create-property.js -var create_property_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var create_property_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { var DESCRIPTORS = (descriptors_namespaceFn()); var definePropertyModule = (object_define_property_namespaceFn()); @@ -1149,7 +1149,7 @@ module.exports = function (object, key, value) { }); // MODULE: ./node_modules/core-js/internals/define-built-in-accessor.js -var define_built_in_accessor_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var define_built_in_accessor_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { var makeBuiltIn = (make_built_in_namespaceFn()); var defineProperty = (object_define_property_namespaceFn()); @@ -1163,7 +1163,7 @@ module.exports = function (target, name, descriptor) { }); // MODULE: ./node_modules/core-js/internals/define-built-in.js -var define_built_in_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var define_built_in_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { var isCallable = (is_callable_namespaceFn()); var definePropertyModule = (object_define_property_namespaceFn()); @@ -1196,7 +1196,7 @@ module.exports = function (O, key, value, options) { }); // MODULE: ./node_modules/core-js/internals/define-built-ins.js -var define_built_ins_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var define_built_ins_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { var defineBuiltIn = (define_built_in_namespaceFn()); @@ -1208,7 +1208,7 @@ module.exports = function (target, src, options) { }); // MODULE: ./node_modules/core-js/internals/define-global-property.js -var define_global_property_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var define_global_property_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { var globalThis = (global_this_namespaceFn()); @@ -1226,7 +1226,7 @@ module.exports = function (key, value) { }); // MODULE: ./node_modules/core-js/internals/descriptors.js -var descriptors_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var descriptors_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { var fails = (fails_namespaceFn()); @@ -1239,7 +1239,7 @@ module.exports = !fails(function () { }); // MODULE: ./node_modules/core-js/internals/document-create-element.js -var document_create_element_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var document_create_element_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { var globalThis = (global_this_namespaceFn()); var isObject = (is_object_namespaceFn()); @@ -1265,7 +1265,7 @@ var dom_exception_constants_namespaceFn = () => { }; // MODULE: ./node_modules/core-js/internals/enum-bug-keys.js -var enum_bug_keys_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var enum_bug_keys_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { // IE8- don't enum bug keys module.exports = [ @@ -1281,7 +1281,7 @@ module.exports = [ }); // MODULE: ./node_modules/core-js/internals/environment-user-agent.js -var environment_user_agent_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var environment_user_agent_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { var globalThis = (global_this_namespaceFn()); @@ -1293,7 +1293,7 @@ module.exports = userAgent ? String(userAgent) : ''; }); // MODULE: ./node_modules/core-js/internals/environment-v8-version.js -var environment_v8_version_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var environment_v8_version_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { var globalThis = (global_this_namespaceFn()); var userAgent = (environment_user_agent_namespaceFn()); @@ -1326,7 +1326,7 @@ module.exports = version; }); // MODULE: ./node_modules/core-js/internals/error-stack-clear.js -var error_stack_clear_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var error_stack_clear_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { var uncurryThis = (function_uncurry_this_namespaceFn()); @@ -1347,7 +1347,7 @@ module.exports = function (stack, dropEntries) { }); // MODULE: ./node_modules/core-js/internals/export.js -var export_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var export_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { var globalThis = (global_this_namespaceFn()); var getOwnPropertyDescriptor = (object_get_own_property_descriptor_namespaceFn().f); @@ -1407,7 +1407,7 @@ module.exports = function (options, source) { }); // MODULE: ./node_modules/core-js/internals/fails.js -var fails_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var fails_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { module.exports = function (exec) { try { @@ -1420,7 +1420,7 @@ module.exports = function (exec) { }); // MODULE: ./node_modules/core-js/internals/function-apply.js -var function_apply_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var function_apply_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { var NATIVE_BIND = (function_bind_native_namespaceFn()); @@ -1436,7 +1436,7 @@ module.exports = typeof Reflect == 'object' && Reflect.apply || (NATIVE_BIND ? c }); // MODULE: ./node_modules/core-js/internals/function-bind-context.js -var function_bind_context_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var function_bind_context_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { var uncurryThis = (function_uncurry_this_clause_namespaceFn()); var aCallable = (a_callable_namespaceFn()); @@ -1455,7 +1455,7 @@ module.exports = function (fn, that) { }); // MODULE: ./node_modules/core-js/internals/function-bind-native.js -var function_bind_native_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var function_bind_native_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { var fails = (fails_namespaceFn()); @@ -1469,7 +1469,7 @@ module.exports = !fails(function () { }); // MODULE: ./node_modules/core-js/internals/function-call.js -var function_call_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var function_call_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { var NATIVE_BIND = (function_bind_native_namespaceFn()); @@ -1482,7 +1482,7 @@ module.exports = NATIVE_BIND ? call.bind(call) : function () { }); // MODULE: ./node_modules/core-js/internals/function-name.js -var function_name_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var function_name_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { var DESCRIPTORS = (descriptors_namespaceFn()); var hasOwn = (has_own_property_namespaceFn()); @@ -1505,7 +1505,7 @@ module.exports = { }); // MODULE: ./node_modules/core-js/internals/function-uncurry-this-accessor.js -var function_uncurry_this_accessor_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var function_uncurry_this_accessor_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { var uncurryThis = (function_uncurry_this_namespaceFn()); var aCallable = (a_callable_namespaceFn()); @@ -1520,7 +1520,7 @@ module.exports = function (object, key, method) { }); // MODULE: ./node_modules/core-js/internals/function-uncurry-this-clause.js -var function_uncurry_this_clause_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var function_uncurry_this_clause_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { var classofRaw = (classof_raw_namespaceFn()); var uncurryThis = (function_uncurry_this_namespaceFn()); @@ -1535,7 +1535,7 @@ module.exports = function (fn) { }); // MODULE: ./node_modules/core-js/internals/function-uncurry-this.js -var function_uncurry_this_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var function_uncurry_this_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { var NATIVE_BIND = (function_bind_native_namespaceFn()); @@ -1558,7 +1558,7 @@ var get_alphabet_option_namespaceFn = () => { }; // MODULE: ./node_modules/core-js/internals/get-built-in.js -var get_built_in_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var get_built_in_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { var globalThis = (global_this_namespaceFn()); var isCallable = (is_callable_namespaceFn()); @@ -1579,7 +1579,7 @@ var get_iterator_direct_namespaceFn = () => { }; // MODULE: ./node_modules/core-js/internals/get-iterator-flattenable.js -var get_iterator_flattenable_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var get_iterator_flattenable_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { var call = (function_call_namespaceFn()); var anObject = (an_object_namespaceFn()); @@ -1595,7 +1595,7 @@ module.exports = function (obj, stringHandling) { }); // MODULE: ./node_modules/core-js/internals/get-iterator-internal.js -var get_iterator_internal_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var get_iterator_internal_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { var call = (function_call_namespaceFn()); var isCallable = (is_callable_namespaceFn()); @@ -1614,7 +1614,7 @@ module.exports = function (argument, usingIterator) { }); // MODULE: ./node_modules/core-js/internals/get-iterator-method-internal.js -var get_iterator_method_internal_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var get_iterator_method_internal_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { var classof = (classof_raw_namespaceFn()); var isNullOrUndefined = (is_null_or_undefined_namespaceFn()); @@ -1633,7 +1633,7 @@ module.exports = function (it) { }); // MODULE: ./node_modules/core-js/internals/get-method.js -var get_method_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var get_method_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { var aCallable = (a_callable_namespaceFn()); var isNullOrUndefined = (is_null_or_undefined_namespaceFn()); @@ -1648,7 +1648,7 @@ module.exports = function (V, P) { }); // MODULE: ./node_modules/core-js/internals/get-set-record.js -var get_set_record_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var get_set_record_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { var aCallable = (a_callable_namespaceFn()); var anObject = (an_object_namespaceFn()); @@ -1693,7 +1693,7 @@ module.exports = function (obj) { }); // MODULE: ./node_modules/core-js/internals/global-this.js -var global_this_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var global_this_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module) { var check = function (it) { return it && it.Math === Math && it; @@ -1714,7 +1714,7 @@ module.exports = }); // MODULE: ./node_modules/core-js/internals/has-own-property.js -var has_own_property_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var has_own_property_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { var uncurryThis = (function_uncurry_this_namespaceFn()); var toObject = (to_object_namespaceFn()); @@ -1731,14 +1731,14 @@ module.exports = Object.hasOwn || function hasOwn(it, key) { }); // MODULE: ./node_modules/core-js/internals/hidden-keys.js -var hidden_keys_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var hidden_keys_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { module.exports = {}; }); // MODULE: ./node_modules/core-js/internals/html.js -var html_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var html_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { var getBuiltIn = (get_built_in_namespaceFn()); @@ -1747,7 +1747,7 @@ module.exports = getBuiltIn('document', 'documentElement'); }); // MODULE: ./node_modules/core-js/internals/ie8-dom-define.js -var ie8_dom_define_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var ie8_dom_define_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { var DESCRIPTORS = (descriptors_namespaceFn()); var fails = (fails_namespaceFn()); @@ -1764,7 +1764,7 @@ module.exports = !DESCRIPTORS && !fails(function () { }); // MODULE: ./node_modules/core-js/internals/indexed-object.js -var indexed_object_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var indexed_object_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { var uncurryThis = (function_uncurry_this_namespaceFn()); var fails = (fails_namespaceFn()); @@ -1785,7 +1785,7 @@ module.exports = fails(function () { }); // MODULE: ./node_modules/core-js/internals/inherit-if-required.js -var inherit_if_required_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var inherit_if_required_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { var isCallable = (is_callable_namespaceFn()); var isObject = (is_object_namespaceFn()); @@ -1809,7 +1809,7 @@ module.exports = function ($this, dummy, Wrapper) { }); // MODULE: ./node_modules/core-js/internals/inspect-source.js -var inspect_source_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var inspect_source_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { var uncurryThis = (function_uncurry_this_namespaceFn()); var isCallable = (is_callable_namespaceFn()); @@ -1829,7 +1829,7 @@ module.exports = store.inspectSource; }); // MODULE: ./node_modules/core-js/internals/internal-state.js -var internal_state_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var internal_state_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { var NATIVE_WEAK_MAP = (weak_map_basic_detection_namespaceFn()); var globalThis = (global_this_namespaceFn()); @@ -1905,7 +1905,7 @@ module.exports = { }); // MODULE: ./node_modules/core-js/internals/is-array-iterator-method.js -var is_array_iterator_method_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var is_array_iterator_method_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { var wellKnownSymbol = (well_known_symbol_namespaceFn()); var Iterators = (iterators_namespaceFn()); @@ -1921,7 +1921,7 @@ module.exports = function (it) { }); // MODULE: ./node_modules/core-js/internals/is-array.js -var is_array_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var is_array_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { var classof = (classof_raw_namespaceFn()); @@ -1935,7 +1935,7 @@ module.exports = Array.isArray || function isArray(argument) { }); // MODULE: ./node_modules/core-js/internals/is-big-int-array.js -var is_big_int_array_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var is_big_int_array_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { var classof = (classof_namespaceFn()); @@ -1947,7 +1947,7 @@ module.exports = function (it) { }); // MODULE: ./node_modules/core-js/internals/is-callable.js -var is_callable_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var is_callable_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { // https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot var documentAll = typeof document == 'object' && document.all; @@ -1964,7 +1964,7 @@ module.exports = typeof documentAll == 'undefined' && documentAll !== undefined }); // MODULE: ./node_modules/core-js/internals/is-forced.js -var is_forced_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var is_forced_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { var fails = (fails_namespaceFn()); var isCallable = (is_callable_namespaceFn()); @@ -1997,7 +1997,7 @@ var is_null_or_undefined_namespaceFn = () => { }; // MODULE: ./node_modules/core-js/internals/is-object.js -var is_object_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var is_object_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { var isCallable = (is_callable_namespaceFn()); @@ -2008,7 +2008,7 @@ module.exports = function (it) { }); // MODULE: ./node_modules/core-js/internals/is-possible-prototype.js -var is_possible_prototype_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var is_possible_prototype_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { var isObject = (is_object_namespaceFn()); @@ -2019,14 +2019,14 @@ module.exports = function (argument) { }); // MODULE: ./node_modules/core-js/internals/is-pure.js -var is_pure_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var is_pure_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { module.exports = false; }); // MODULE: ./node_modules/core-js/internals/is-raw-json.js -var is_raw_json_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var is_raw_json_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { var isObject = (is_object_namespaceFn()); var getInternalState = (internal_state_namespaceFn().get); @@ -2040,7 +2040,7 @@ module.exports = function isRawJSON(O) { }); // MODULE: ./node_modules/core-js/internals/is-symbol.js -var is_symbol_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var is_symbol_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { var getBuiltIn = (get_built_in_namespaceFn()); var isCallable = (is_callable_namespaceFn()); @@ -2059,7 +2059,7 @@ module.exports = USE_SYMBOL_AS_UID ? function (it) { }); // MODULE: ./node_modules/core-js/internals/iterate-simple.js -var iterate_simple_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var iterate_simple_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { var call = (function_call_namespaceFn()); @@ -2076,7 +2076,7 @@ module.exports = function (record, fn, ITERATOR_INSTEAD_OF_RECORD) { }); // MODULE: ./node_modules/core-js/internals/iterate.js -var iterate_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var iterate_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { var bind = (function_bind_context_namespaceFn()); var call = (function_call_namespaceFn()); @@ -2160,7 +2160,7 @@ var iterator_cleanup_state_namespaceFn = () => { }; // MODULE: ./node_modules/core-js/internals/iterator-close-all.js -var iterator_close_all_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var iterator_close_all_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { var iteratorClose = (iterator_close_namespaceFn()); @@ -2181,7 +2181,7 @@ module.exports = function (iters, kind, value) { }); // MODULE: ./node_modules/core-js/internals/iterator-close.js -var iterator_close_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var iterator_close_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { var call = (function_call_namespaceFn()); var anObject = (an_object_namespaceFn()); @@ -2210,7 +2210,7 @@ module.exports = function (iterator, kind, value) { }); // MODULE: ./node_modules/core-js/internals/iterator-create-proxy.js -var iterator_create_proxy_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var iterator_create_proxy_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { var call = (function_call_namespaceFn()); var create = (object_create_namespaceFn()); @@ -2315,7 +2315,7 @@ var iterator_helper_throws_on_invalid_iterator_namespaceFn = () => { }; // MODULE: ./node_modules/core-js/internals/iterator-helper-without-closing-on-early-error.js -var iterator_helper_without_closing_on_early_error_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var iterator_helper_without_closing_on_early_error_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { var globalThis = (global_this_namespaceFn()); @@ -2343,7 +2343,7 @@ module.exports = function (METHOD_NAME, ExpectedError) { }); // MODULE: ./node_modules/core-js/internals/iterators-core.js -var iterators_core_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var iterators_core_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { var fails = (fails_namespaceFn()); var isCallable = (is_callable_namespaceFn()); @@ -2402,7 +2402,7 @@ var iterators_namespaceFn = () => { }; // MODULE: ./node_modules/core-js/internals/length-of-array-like.js -var length_of_array_like_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var length_of_array_like_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { var toLength = (to_length_namespaceFn()); @@ -2415,7 +2415,7 @@ module.exports = function (obj) { }); // MODULE: ./node_modules/core-js/internals/make-built-in.js -var make_built_in_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var make_built_in_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { var uncurryThis = (function_uncurry_this_namespaceFn()); var fails = (fails_namespaceFn()); @@ -2475,7 +2475,7 @@ Function.prototype.toString = makeBuiltIn(function toString() { }); // MODULE: ./node_modules/core-js/internals/map-helpers.js -var map_helpers_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var map_helpers_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { var uncurryThis = (function_uncurry_this_namespaceFn()); @@ -2495,7 +2495,7 @@ module.exports = { }); // MODULE: ./node_modules/core-js/internals/native-raw-json.js -var native_raw_json_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var native_raw_json_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { /* eslint-disable es/no-json -- safe */ var fails = (fails_namespaceFn()); @@ -2511,7 +2511,7 @@ module.exports = !fails(function () { }); // MODULE: ./node_modules/core-js/internals/new-promise-capability.js -var new_promise_capability_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var new_promise_capability_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { var aCallable = (a_callable_namespaceFn()); @@ -2537,7 +2537,7 @@ module.exports.f = function (C) { }); // MODULE: ./node_modules/core-js/internals/normalize-string-argument.js -var normalize_string_argument_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var normalize_string_argument_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { var toString = (to_string_namespaceFn()); @@ -2553,7 +2553,7 @@ var not_a_nan_namespaceFn = () => { }; // MODULE: ./node_modules/core-js/internals/object-create.js -var object_create_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var object_create_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { /* global ActiveXObject -- old IE, WSH */ var anObject = (an_object_namespaceFn()); @@ -2643,7 +2643,7 @@ module.exports = Object.create || function create(O, Properties) { }); // MODULE: ./node_modules/core-js/internals/object-define-properties.js -var object_define_properties_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var object_define_properties_namespaceFn = /*#__PURE__*/__webpack_require__.cw((__unused_webpack_module, exports) => { var DESCRIPTORS = (descriptors_namespaceFn()); var V8_PROTOTYPE_DEFINE_BUG = (v8_prototype_define_bug_namespaceFn()); @@ -2669,7 +2669,7 @@ exports.f = DESCRIPTORS && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : }); // MODULE: ./node_modules/core-js/internals/object-define-property.js -var object_define_property_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var object_define_property_namespaceFn = /*#__PURE__*/__webpack_require__.cw((__unused_webpack_module, exports) => { var DESCRIPTORS = (descriptors_namespaceFn()); var IE8_DOM_DEFINE = (ie8_dom_define_namespaceFn()); @@ -2718,7 +2718,7 @@ exports.f = DESCRIPTORS ? V8_PROTOTYPE_DEFINE_BUG ? function defineProperty(O, P }); // MODULE: ./node_modules/core-js/internals/object-get-own-property-descriptor.js -var object_get_own_property_descriptor_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var object_get_own_property_descriptor_namespaceFn = /*#__PURE__*/__webpack_require__.cw((__unused_webpack_module, exports) => { var DESCRIPTORS = (descriptors_namespaceFn()); var call = (function_call_namespaceFn()); @@ -2746,7 +2746,7 @@ exports.f = DESCRIPTORS ? $getOwnPropertyDescriptor : function getOwnPropertyDes }); // MODULE: ./node_modules/core-js/internals/object-get-own-property-names.js -var object_get_own_property_names_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var object_get_own_property_names_namespaceFn = /*#__PURE__*/__webpack_require__.cw((__unused_webpack_module, exports) => { var internalObjectKeys = (object_keys_internal_namespaceFn()); var enumBugKeys = (enum_bug_keys_namespaceFn()); @@ -2768,7 +2768,7 @@ var object_get_own_property_symbols_namespaceFn = () => { }; // MODULE: ./node_modules/core-js/internals/object-get-prototype-of.js -var object_get_prototype_of_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var object_get_prototype_of_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { var hasOwn = (has_own_property_namespaceFn()); var isCallable = (is_callable_namespaceFn()); @@ -2795,7 +2795,7 @@ module.exports = CORRECT_PROTOTYPE_GETTER ? $Object.getPrototypeOf : function (O }); // MODULE: ./node_modules/core-js/internals/object-is-prototype-of.js -var object_is_prototype_of_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var object_is_prototype_of_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { var uncurryThis = (function_uncurry_this_namespaceFn()); @@ -2804,7 +2804,7 @@ module.exports = uncurryThis({}.isPrototypeOf); }); // MODULE: ./node_modules/core-js/internals/object-keys-internal.js -var object_keys_internal_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var object_keys_internal_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { var uncurryThis = (function_uncurry_this_namespaceFn()); var hasOwn = (has_own_property_namespaceFn()); @@ -2830,7 +2830,7 @@ module.exports = function (object, names) { }); // MODULE: ./node_modules/core-js/internals/object-keys.js -var object_keys_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var object_keys_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { var internalObjectKeys = (object_keys_internal_namespaceFn()); var enumBugKeys = (enum_bug_keys_namespaceFn()); @@ -2845,7 +2845,7 @@ module.exports = Object.keys || function keys(O) { }); // MODULE: ./node_modules/core-js/internals/object-property-is-enumerable.js -var object_property_is_enumerable_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var object_property_is_enumerable_namespaceFn = /*#__PURE__*/__webpack_require__.cw((__unused_webpack_module, exports) => { var $propertyIsEnumerable = {}.propertyIsEnumerable; // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe @@ -2864,7 +2864,7 @@ exports.f = NASHORN_BUG ? function propertyIsEnumerable(V) { }); // MODULE: ./node_modules/core-js/internals/object-set-prototype-of.js -var object_set_prototype_of_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var object_set_prototype_of_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { /* eslint-disable no-proto -- safe */ var uncurryThisAccessor = (function_uncurry_this_accessor_namespaceFn()); @@ -2898,7 +2898,7 @@ module.exports = Object.setPrototypeOf || ('__proto__' in {} ? function () { }); // MODULE: ./node_modules/core-js/internals/ordinary-to-primitive.js -var ordinary_to_primitive_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var ordinary_to_primitive_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { var call = (function_call_namespaceFn()); var isCallable = (is_callable_namespaceFn()); @@ -2919,7 +2919,7 @@ module.exports = function (input, pref) { }); // MODULE: ./node_modules/core-js/internals/own-keys.js -var own_keys_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var own_keys_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { var getBuiltIn = (get_built_in_namespaceFn()); var uncurryThis = (function_uncurry_this_namespaceFn()); @@ -2939,7 +2939,7 @@ module.exports = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) { }); // MODULE: ./node_modules/core-js/internals/parse-json-string.js -var parse_json_string_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var parse_json_string_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { var uncurryThis = (function_uncurry_this_namespaceFn()); var hasOwn = (has_own_property_namespaceFn()); @@ -3005,7 +3005,7 @@ var perform_namespaceFn = () => { }; // MODULE: ./node_modules/core-js/internals/promise-resolve.js -var promise_resolve_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var promise_resolve_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { var anObject = (an_object_namespaceFn()); var isObject = (is_object_namespaceFn()); @@ -3028,7 +3028,7 @@ var require_object_coercible_namespaceFn = () => { }; // MODULE: ./node_modules/core-js/internals/set-clone.js -var set_clone_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var set_clone_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { var SetHelpers = (set_helpers_namespaceFn()); var iterate = (set_iterate_namespaceFn()); @@ -3047,7 +3047,7 @@ module.exports = function (set) { }); // MODULE: ./node_modules/core-js/internals/set-difference.js -var set_difference_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var set_difference_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { var aSet = (a_set_namespaceFn()); var SetHelpers = (set_helpers_namespaceFn()); @@ -3078,7 +3078,7 @@ module.exports = function difference(other) { }); // MODULE: ./node_modules/core-js/internals/set-helpers.js -var set_helpers_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var set_helpers_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { var uncurryThis = (function_uncurry_this_namespaceFn()); @@ -3097,7 +3097,7 @@ module.exports = { }); // MODULE: ./node_modules/core-js/internals/set-intersection.js -var set_intersection_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var set_intersection_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { var aSet = (a_set_namespaceFn()); var SetHelpers = (set_helpers_namespaceFn()); @@ -3133,7 +3133,7 @@ module.exports = function intersection(other) { }); // MODULE: ./node_modules/core-js/internals/set-is-disjoint-from.js -var set_is_disjoint_from_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var set_is_disjoint_from_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { var aSet = (a_set_namespaceFn()); var has = (set_helpers_namespaceFn().has); @@ -3160,7 +3160,7 @@ module.exports = function isDisjointFrom(other) { }); // MODULE: ./node_modules/core-js/internals/set-is-subset-of.js -var set_is_subset_of_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var set_is_subset_of_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { var aSet = (a_set_namespaceFn()); var size = (set_size_namespaceFn()); @@ -3181,7 +3181,7 @@ module.exports = function isSubsetOf(other) { }); // MODULE: ./node_modules/core-js/internals/set-is-superset-of.js -var set_is_superset_of_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var set_is_superset_of_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { var aSet = (a_set_namespaceFn()); var has = (set_helpers_namespaceFn().has); @@ -3205,7 +3205,7 @@ module.exports = function isSupersetOf(other) { }); // MODULE: ./node_modules/core-js/internals/set-iterate.js -var set_iterate_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var set_iterate_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { var uncurryThis = (function_uncurry_this_namespaceFn()); var iterateSimple = (iterate_simple_namespaceFn()); @@ -3224,7 +3224,7 @@ module.exports = function (set, fn, interruptible) { }); // MODULE: ./node_modules/core-js/internals/set-method-accept-set-like.js -var set_method_accept_set_like_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var set_method_accept_set_like_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { var getBuiltIn = (get_built_in_namespaceFn()); @@ -3292,7 +3292,7 @@ var set_method_get_keys_before_cloning_detection_namespaceFn = () => { }; // MODULE: ./node_modules/core-js/internals/set-size.js -var set_size_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var set_size_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { var uncurryThisAccessor = (function_uncurry_this_accessor_namespaceFn()); var SetHelpers = (set_helpers_namespaceFn()); @@ -3304,7 +3304,7 @@ module.exports = uncurryThisAccessor(SetHelpers.proto, 'size', 'get') || functio }); // MODULE: ./node_modules/core-js/internals/set-symmetric-difference.js -var set_symmetric_difference_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var set_symmetric_difference_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { var aSet = (a_set_namespaceFn()); var SetHelpers = (set_helpers_namespaceFn()); @@ -3332,7 +3332,7 @@ module.exports = function symmetricDifference(other) { }); // MODULE: ./node_modules/core-js/internals/set-union.js -var set_union_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var set_union_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { var aSet = (a_set_namespaceFn()); var add = (set_helpers_namespaceFn().add); @@ -3355,7 +3355,7 @@ module.exports = function union(other) { }); // MODULE: ./node_modules/core-js/internals/shared-key.js -var shared_key_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var shared_key_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { var shared = (shared_namespaceFn()); var uid = (uid_namespaceFn()); @@ -3369,7 +3369,7 @@ module.exports = function (key) { }); // MODULE: ./node_modules/core-js/internals/shared-store.js -var shared_store_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var shared_store_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { var IS_PURE = (is_pure_namespaceFn()); var globalThis = (global_this_namespaceFn()); @@ -3379,17 +3379,17 @@ var SHARED = '__core-js_shared__'; var store = module.exports = globalThis[SHARED] || defineGlobalProperty(SHARED, {}); (store.versions || (store.versions = [])).push({ - version: '3.50.0', + version: '3.51.0', mode: IS_PURE ? 'pure' : 'global', copyright: '© 2013–2025 Denis Pushkarev (zloirock.ru), 2025–2026 CoreJS Company (core-js.io). All rights reserved.', - license: 'https://github.com/zloirock/core-js/blob/v3.50.0/LICENSE', + license: 'https://github.com/zloirock/core-js/blob/v3.51.0/LICENSE', source: 'https://github.com/zloirock/core-js' }); }); // MODULE: ./node_modules/core-js/internals/shared.js -var shared_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var shared_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { var store = (shared_store_namespaceFn()); // eslint-disable-next-line es/no-object-create -- safe @@ -3402,7 +3402,7 @@ module.exports = function (key, value) { }); // MODULE: ./node_modules/core-js/internals/symbol-constructor-detection.js -var symbol_constructor_detection_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var symbol_constructor_detection_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { /* eslint-disable es/no-symbol -- required for testing */ var V8_VERSION = (environment_v8_version_namespaceFn()); @@ -3426,7 +3426,7 @@ module.exports = !!Object.getOwnPropertySymbols && !fails(function () { }); // MODULE: ./node_modules/core-js/internals/this-number-value.js -var this_number_value_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var this_number_value_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { var uncurryThis = (function_uncurry_this_namespaceFn()); @@ -3437,7 +3437,7 @@ module.exports = uncurryThis(1.1.valueOf); }); // MODULE: ./node_modules/core-js/internals/to-absolute-index.js -var to_absolute_index_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var to_absolute_index_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { var toIntegerOrInfinity = (to_integer_or_infinity_namespaceFn()); @@ -3455,7 +3455,7 @@ module.exports = function (index, length) { }); // MODULE: ./node_modules/core-js/internals/to-big-int.js -var to_big_int_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var to_big_int_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { var toPrimitive = (to_primitive_namespaceFn()); @@ -3473,7 +3473,7 @@ module.exports = function (argument) { }); // MODULE: ./node_modules/core-js/internals/to-indexed-object.js -var to_indexed_object_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var to_indexed_object_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { // toObject with fallback for non-array-like ES3 strings var IndexedObject = (indexed_object_namespaceFn()); @@ -3506,7 +3506,7 @@ var to_positive_integer_namespaceFn = () => { }; // MODULE: ./node_modules/core-js/internals/to-primitive.js -var to_primitive_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var to_primitive_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { var call = (function_call_namespaceFn()); var isObject = (is_object_namespaceFn()); @@ -3537,7 +3537,7 @@ module.exports = function (input, pref) { }); // MODULE: ./node_modules/core-js/internals/to-property-key.js -var to_property_key_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var to_property_key_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { var toPrimitive = (to_primitive_namespaceFn()); var isSymbol = (is_symbol_namespaceFn()); @@ -3552,7 +3552,7 @@ module.exports = function (argument) { }); // MODULE: ./node_modules/core-js/internals/to-string-tag-support.js -var to_string_tag_support_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var to_string_tag_support_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { var wellKnownSymbol = (well_known_symbol_namespaceFn()); @@ -3566,7 +3566,7 @@ module.exports = String(test) === '[object z]'; }); // MODULE: ./node_modules/core-js/internals/to-string.js -var to_string_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var to_string_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { var classof = (classof_namespaceFn()); @@ -3580,7 +3580,7 @@ module.exports = function (argument) { }); // MODULE: ./node_modules/core-js/internals/try-to-string.js -var try_to_string_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var try_to_string_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { var $String = String; @@ -3595,7 +3595,7 @@ module.exports = function (argument) { }); // MODULE: ./node_modules/core-js/internals/uid.js -var uid_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var uid_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { var uncurryThis = (function_uncurry_this_namespaceFn()); @@ -3610,7 +3610,7 @@ module.exports = function (key) { }); // MODULE: ./node_modules/core-js/internals/uint8-from-base64.js -var uint8_from_base64_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var uint8_from_base64_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { var globalThis = (global_this_namespaceFn()); var uncurryThis = (function_uncurry_this_namespaceFn()); @@ -3774,7 +3774,7 @@ module.exports = function (string, options, into, maxLength) { }); // MODULE: ./node_modules/core-js/internals/uint8-from-hex.js -var uint8_from_hex_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var uint8_from_hex_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { var globalThis = (global_this_namespaceFn()); var uncurryThis = (function_uncurry_this_namespaceFn()); @@ -3805,7 +3805,7 @@ module.exports = function (string, into) { }); // MODULE: ./node_modules/core-js/internals/url-constructor-detection.js -var url_constructor_detection_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var url_constructor_detection_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { var fails = (fails_namespaceFn()); var wellKnownSymbol = (well_known_symbol_namespaceFn()); @@ -3852,7 +3852,7 @@ module.exports = !fails(function () { }); // MODULE: ./node_modules/core-js/internals/use-symbol-as-uid.js -var use_symbol_as_uid_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var use_symbol_as_uid_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { /* eslint-disable es/no-symbol -- required for testing */ var NATIVE_SYMBOL = (symbol_constructor_detection_namespaceFn()); @@ -3864,7 +3864,7 @@ module.exports = NATIVE_SYMBOL && }); // MODULE: ./node_modules/core-js/internals/v8-prototype-define-bug.js -var v8_prototype_define_bug_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var v8_prototype_define_bug_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { var DESCRIPTORS = (descriptors_namespaceFn()); var fails = (fails_namespaceFn()); @@ -3887,7 +3887,7 @@ var validate_arguments_length_namespaceFn = () => { }; // MODULE: ./node_modules/core-js/internals/weak-map-basic-detection.js -var weak_map_basic_detection_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var weak_map_basic_detection_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { var globalThis = (global_this_namespaceFn()); var isCallable = (is_callable_namespaceFn()); @@ -3899,7 +3899,7 @@ module.exports = isCallable(WeakMap) && /native code/.test(String(WeakMap)); }); // MODULE: ./node_modules/core-js/internals/weak-map-helpers.js -var weak_map_helpers_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var weak_map_helpers_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { var uncurryThis = (function_uncurry_this_namespaceFn()); @@ -3918,7 +3918,7 @@ module.exports = { }); // MODULE: ./node_modules/core-js/internals/well-known-symbol.js -var well_known_symbol_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var well_known_symbol_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => { var globalThis = (global_this_namespaceFn()); var shared = (shared_namespaceFn()); @@ -3942,7 +3942,7 @@ module.exports = function (name) { }); // MODULE: ./node_modules/core-js/modules/es.array.includes.js -var es_array_includes_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var es_array_includes_namespaceFn = /*#__PURE__*/__webpack_require__.cw(() => { var $ = (export_namespaceFn()); var $includes = (array_includes_namespaceFn().includes); @@ -3975,7 +3975,7 @@ addToUnscopables('includes'); }); // MODULE: ./node_modules/core-js/modules/es.array.push.js -var es_array_push_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var es_array_push_namespaceFn = /*#__PURE__*/__webpack_require__.cw(() => { var $ = (export_namespaceFn()); var toObject = (to_object_namespaceFn()); @@ -4022,7 +4022,7 @@ $({ target: 'Array', proto: true, arity: 1, forced: FORCED }, { }); // MODULE: ./node_modules/core-js/modules/es.iterator.constructor.js -var es_iterator_constructor_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var es_iterator_constructor_namespaceFn = /*#__PURE__*/__webpack_require__.cw(() => { var $ = (export_namespaceFn()); var globalThis = (global_this_namespaceFn()); @@ -4092,7 +4092,7 @@ $({ global: true, constructor: true, forced: FORCED }, { }); // MODULE: ./node_modules/core-js/modules/es.iterator.drop.js -var es_iterator_drop_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var es_iterator_drop_namespaceFn = /*#__PURE__*/__webpack_require__.cw(() => { var $ = (export_namespaceFn()); var call = (function_call_namespaceFn()); @@ -4165,7 +4165,7 @@ $({ target: 'Iterator', proto: true, real: true, forced: FORCED }, { }); // MODULE: ./node_modules/core-js/modules/es.iterator.every.js -var es_iterator_every_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var es_iterator_every_namespaceFn = /*#__PURE__*/__webpack_require__.cw(() => { var $ = (export_namespaceFn()); var call = (function_call_namespaceFn()); @@ -4202,7 +4202,7 @@ $({ target: 'Iterator', proto: true, real: true, forced: everyWithoutClosingOnEa }); // MODULE: ./node_modules/core-js/modules/es.iterator.filter.js -var es_iterator_filter_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var es_iterator_filter_namespaceFn = /*#__PURE__*/__webpack_require__.cw(() => { var $ = (export_namespaceFn()); var call = (function_call_namespaceFn()); @@ -4258,7 +4258,7 @@ $({ target: 'Iterator', proto: true, real: true, forced: FORCED }, { }); // MODULE: ./node_modules/core-js/modules/es.iterator.find.js -var es_iterator_find_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var es_iterator_find_namespaceFn = /*#__PURE__*/__webpack_require__.cw(() => { var $ = (export_namespaceFn()); var call = (function_call_namespaceFn()); @@ -4295,7 +4295,7 @@ $({ target: 'Iterator', proto: true, real: true, forced: findWithoutClosingOnEar }); // MODULE: ./node_modules/core-js/modules/es.iterator.flat-map.js -var es_iterator_flat_map_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var es_iterator_flat_map_namespaceFn = /*#__PURE__*/__webpack_require__.cw(() => { var $ = (export_namespaceFn()); var call = (function_call_namespaceFn()); @@ -4373,7 +4373,7 @@ $({ target: 'Iterator', proto: true, real: true, forced: FORCED }, { }); // MODULE: ./node_modules/core-js/modules/es.iterator.for-each.js -var es_iterator_for_each_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var es_iterator_for_each_namespaceFn = /*#__PURE__*/__webpack_require__.cw(() => { var $ = (export_namespaceFn()); var call = (function_call_namespaceFn()); @@ -4410,7 +4410,7 @@ $({ target: 'Iterator', proto: true, real: true, forced: forEachWithoutClosingOn }); // MODULE: ./node_modules/core-js/modules/es.iterator.map.js -var es_iterator_map_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var es_iterator_map_namespaceFn = /*#__PURE__*/__webpack_require__.cw(() => { var $ = (export_namespaceFn()); var call = (function_call_namespaceFn()); @@ -4459,7 +4459,7 @@ $({ target: 'Iterator', proto: true, real: true, forced: FORCED }, { }); // MODULE: ./node_modules/core-js/modules/es.iterator.some.js -var es_iterator_some_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var es_iterator_some_namespaceFn = /*#__PURE__*/__webpack_require__.cw(() => { var $ = (export_namespaceFn()); var call = (function_call_namespaceFn()); @@ -4496,7 +4496,7 @@ $({ target: 'Iterator', proto: true, real: true, forced: someWithoutClosingOnEar }); // MODULE: ./node_modules/core-js/modules/es.iterator.take.js -var es_iterator_take_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var es_iterator_take_namespaceFn = /*#__PURE__*/__webpack_require__.cw(() => { var $ = (export_namespaceFn()); var call = (function_call_namespaceFn()); @@ -4565,7 +4565,7 @@ $({ target: 'Iterator', proto: true, real: true, forced: FORCED }, { }); // MODULE: ./node_modules/core-js/modules/es.iterator.to-array.js -var es_iterator_to_array_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var es_iterator_to_array_namespaceFn = /*#__PURE__*/__webpack_require__.cw(() => { var $ = (export_namespaceFn()); var anObject = (an_object_namespaceFn()); @@ -4589,7 +4589,7 @@ $({ target: 'Iterator', proto: true, real: true }, { }); // MODULE: ./node_modules/core-js/modules/es.json.parse.js -var es_json_parse_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var es_json_parse_namespaceFn = /*#__PURE__*/__webpack_require__.cw(() => { var $ = (export_namespaceFn()); var DESCRIPTORS = (descriptors_namespaceFn()); @@ -4857,7 +4857,7 @@ $({ target: 'JSON', stat: true, forced: NO_SOURCE_SUPPORT }, { }); // MODULE: ./node_modules/core-js/modules/es.json.stringify.js -var es_json_stringify_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var es_json_stringify_namespaceFn = /*#__PURE__*/__webpack_require__.cw(() => { var $ = (export_namespaceFn()); var getBuiltIn = (get_built_in_namespaceFn()); @@ -5113,7 +5113,7 @@ if ($stringify) $({ target: 'JSON', stat: true, arity: 3, forced: WRONG_SYMBOLS_ }); // MODULE: ./node_modules/core-js/modules/es.map.get-or-insert-computed.js -var es_map_get_or_insert_computed_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var es_map_get_or_insert_computed_namespaceFn = /*#__PURE__*/__webpack_require__.cw(() => { var $ = (export_namespaceFn()); var aCallable = (a_callable_namespaceFn()); @@ -5142,7 +5142,7 @@ $({ target: 'Map', proto: true, real: true, forced: IS_PURE }, { }); // MODULE: ./node_modules/core-js/modules/es.map.get-or-insert.js -var es_map_get_or_insert_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var es_map_get_or_insert_namespaceFn = /*#__PURE__*/__webpack_require__.cw(() => { var $ = (export_namespaceFn()); var MapHelpers = (map_helpers_namespaceFn()); @@ -5165,21 +5165,28 @@ $({ target: 'Map', proto: true, real: true, forced: IS_PURE }, { }); // MODULE: ./node_modules/core-js/modules/es.math.sum-precise.js -var es_math_sum_precise_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var es_math_sum_precise_namespaceFn = /*#__PURE__*/__webpack_require__.cw(() => { // based on Shewchuk's algorithm for exactly floating point addition // adapted from https://github.com/tc39/proposal-math-sum/blob/3513d58323a1ae25560e8700aa5294500c6c9287/polyfill/polyfill.mjs var $ = (export_namespaceFn()); var uncurryThis = (function_uncurry_this_namespaceFn()); var iterate = (iterate_namespaceFn()); +var fails = (fails_namespaceFn()); +var getIterator = (get_iterator_internal_namespaceFn()); +var setPrototypeOf = (object_set_prototype_of_namespaceFn()); +var wellKnownSymbol = (well_known_symbol_namespaceFn()); var $RangeError = RangeError; var $TypeError = TypeError; var $Infinity = Infinity; var $NaN = NaN; +// eslint-disable-next-line es/no-math-sumprecise -- required for testing +var $sumPrecise = Math.sumPrecise; var abs = Math.abs; var pow = Math.pow; var push = uncurryThis([].push); +var ITERATOR = wellKnownSymbol('iterator'); var POW_2_1023 = pow(2, 1023); var MAX_SAFE_INTEGER = pow(2, 53) - 1; // 2 ** 53 - 1 === 9007199254740991 @@ -5192,6 +5199,25 @@ var PLUS_INFINITY = {}; var MINUS_ZERO = {}; var FINITE = {}; +// https://bugs.webkit.org/show_bug.cgi?id=315450 +var FORCED = fails(function () { + if ($sumPrecise([-1]) !== -1 || $sumPrecise([-MAX_DOUBLE]) !== -MAX_DOUBLE) return true; + if (!setPrototypeOf) return false; + // https://issues.chromium.org/issues/500536164 + try { + $sumPrecise(setPrototypeOf([1], {})); + return true; + } catch (error) { /* empty */ } + // https://issues.chromium.org/issues/572987948 + try { + var prototype = {}; + // eslint-disable-next-line unicorn/no-immediate-mutation -- ES3-compatible computed property + prototype[ITERATOR] = function () { return this; }; + $sumPrecise(setPrototypeOf(getIterator([1]), prototype)); + return true; + } catch (error) { /* empty */ } +}); + // prerequisite: abs(x) >= abs(y) var twosum = function (x, y) { var hi = x + y; @@ -5201,7 +5227,7 @@ var twosum = function (x, y) { // `Math.sumPrecise` method // https://tc39.es/ecma262/#sec-math.sumprecise -$({ target: 'Math', stat: true }, { +$({ target: 'Math', stat: true, forced: FORCED }, { // eslint-disable-next-line max-statements -- ok sumPrecise: function sumPrecise(items) { var numbers = []; @@ -5321,7 +5347,7 @@ $({ target: 'Math', stat: true }, { }); // MODULE: ./node_modules/core-js/modules/es.promise.try.js -var es_promise_try_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var es_promise_try_namespaceFn = /*#__PURE__*/__webpack_require__.cw(() => { var $ = (export_namespaceFn()); var globalThis = (global_this_namespaceFn()); @@ -5367,7 +5393,7 @@ $({ target: 'Promise', stat: true, forced: FORCED }, { }); // MODULE: ./node_modules/core-js/modules/es.set.difference.v2.js -var es_set_difference_v2_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var es_set_difference_v2_namespaceFn = /*#__PURE__*/__webpack_require__.cw(() => { var $ = (export_namespaceFn()); var difference = (set_difference_namespaceFn()); @@ -5409,7 +5435,7 @@ $({ target: 'Set', proto: true, real: true, forced: FORCED }, { }); // MODULE: ./node_modules/core-js/modules/es.set.intersection.v2.js -var es_set_intersection_v2_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var es_set_intersection_v2_namespaceFn = /*#__PURE__*/__webpack_require__.cw(() => { var $ = (export_namespaceFn()); var fails = (fails_namespaceFn()); @@ -5432,7 +5458,7 @@ $({ target: 'Set', proto: true, real: true, forced: INCORRECT }, { }); // MODULE: ./node_modules/core-js/modules/es.set.is-disjoint-from.v2.js -var es_set_is_disjoint_from_v2_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var es_set_is_disjoint_from_v2_namespaceFn = /*#__PURE__*/__webpack_require__.cw(() => { var $ = (export_namespaceFn()); var isDisjointFrom = (set_is_disjoint_from_namespaceFn()); @@ -5451,7 +5477,7 @@ $({ target: 'Set', proto: true, real: true, forced: INCORRECT }, { }); // MODULE: ./node_modules/core-js/modules/es.set.is-subset-of.v2.js -var es_set_is_subset_of_v2_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var es_set_is_subset_of_v2_namespaceFn = /*#__PURE__*/__webpack_require__.cw(() => { var $ = (export_namespaceFn()); var isSubsetOf = (set_is_subset_of_namespaceFn()); @@ -5470,7 +5496,7 @@ $({ target: 'Set', proto: true, real: true, forced: INCORRECT }, { }); // MODULE: ./node_modules/core-js/modules/es.set.is-superset-of.v2.js -var es_set_is_superset_of_v2_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var es_set_is_superset_of_v2_namespaceFn = /*#__PURE__*/__webpack_require__.cw(() => { var $ = (export_namespaceFn()); var isSupersetOf = (set_is_superset_of_namespaceFn()); @@ -5489,7 +5515,7 @@ $({ target: 'Set', proto: true, real: true, forced: INCORRECT }, { }); // MODULE: ./node_modules/core-js/modules/es.set.symmetric-difference.v2.js -var es_set_symmetric_difference_v2_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var es_set_symmetric_difference_v2_namespaceFn = /*#__PURE__*/__webpack_require__.cw(() => { var $ = (export_namespaceFn()); var symmetricDifference = (set_symmetric_difference_namespaceFn()); @@ -5507,7 +5533,7 @@ $({ target: 'Set', proto: true, real: true, forced: FORCED }, { }); // MODULE: ./node_modules/core-js/modules/es.set.union.v2.js -var es_set_union_v2_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var es_set_union_v2_namespaceFn = /*#__PURE__*/__webpack_require__.cw(() => { var $ = (export_namespaceFn()); var union = (set_union_namespaceFn()); @@ -5525,7 +5551,7 @@ $({ target: 'Set', proto: true, real: true, forced: FORCED }, { }); // MODULE: ./node_modules/core-js/modules/es.typed-array.with.js -var es_typed_array_with_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var es_typed_array_with_namespaceFn = /*#__PURE__*/__webpack_require__.cw(() => { var ArrayBufferViewCore = (array_buffer_view_core_namespaceFn()); var isBigIntArray = (is_big_int_array_namespaceFn()); @@ -5578,7 +5604,7 @@ exportTypedArrayMethod('with', { 'with': function (index, value) { }); // MODULE: ./node_modules/core-js/modules/es.uint8-array.from-base64.js -var es_uint8_array_from_base64_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var es_uint8_array_from_base64_namespaceFn = /*#__PURE__*/__webpack_require__.cw(() => { var $ = (export_namespaceFn()); var globalThis = (global_this_namespaceFn()); @@ -5612,7 +5638,7 @@ if (Uint8Array) $({ target: 'Uint8Array', stat: true, forced: INCORRECT_BEHAVIOR }); // MODULE: ./node_modules/core-js/modules/es.uint8-array.set-from-base64.js -var es_uint8_array_set_from_base64_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var es_uint8_array_set_from_base64_namespaceFn = /*#__PURE__*/__webpack_require__.cw(() => { var $ = (export_namespaceFn()); var globalThis = (global_this_namespaceFn()); @@ -5654,7 +5680,7 @@ if (Uint8Array) $({ target: 'Uint8Array', proto: true, forced: INCORRECT_BEHAVIO }); // MODULE: ./node_modules/core-js/modules/es.uint8-array.set-from-hex.js -var es_uint8_array_set_from_hex_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var es_uint8_array_set_from_hex_namespaceFn = /*#__PURE__*/__webpack_require__.cw(() => { var $ = (export_namespaceFn()); var globalThis = (global_this_namespaceFn()); @@ -5691,7 +5717,7 @@ if (globalThis.Uint8Array) $({ target: 'Uint8Array', proto: true, forced: throws }); // MODULE: ./node_modules/core-js/modules/es.uint8-array.to-base64.js -var es_uint8_array_to_base64_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var es_uint8_array_to_base64_namespaceFn = /*#__PURE__*/__webpack_require__.cw(() => { /* eslint-disable no-useless-assignment -- false positive for [index++] syntax */ var $ = (export_namespaceFn()); @@ -5773,7 +5799,7 @@ if (Uint8Array) $({ target: 'Uint8Array', proto: true, forced: INCORRECT_BEHAVIO }); // MODULE: ./node_modules/core-js/modules/es.uint8-array.to-hex.js -var es_uint8_array_to_hex_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var es_uint8_array_to_hex_namespaceFn = /*#__PURE__*/__webpack_require__.cw(() => { var $ = (export_namespaceFn()); var globalThis = (global_this_namespaceFn()); @@ -5814,7 +5840,7 @@ if (Uint8Array) $({ target: 'Uint8Array', proto: true, forced: INCORRECT_BEHAVIO }); // MODULE: ./node_modules/core-js/modules/es.weak-map.get-or-insert-computed.js -var es_weak_map_get_or_insert_computed_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var es_weak_map_get_or_insert_computed_namespaceFn = /*#__PURE__*/__webpack_require__.cw(() => { var $ = (export_namespaceFn()); var aCallable = (a_callable_namespaceFn()); @@ -5855,7 +5881,7 @@ $({ target: 'WeakMap', proto: true, real: true, forced: FORCED }, { }); // MODULE: ./node_modules/core-js/modules/es.weak-map.get-or-insert.js -var es_weak_map_get_or_insert_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var es_weak_map_get_or_insert_namespaceFn = /*#__PURE__*/__webpack_require__.cw(() => { var $ = (export_namespaceFn()); var WeakMapHelpers = (weak_map_helpers_namespaceFn()); @@ -5878,7 +5904,7 @@ $({ target: 'WeakMap', proto: true, real: true, forced: IS_PURE }, { }); // MODULE: ./node_modules/core-js/modules/web.dom-exception.stack.js -var web_dom_exception_stack_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var web_dom_exception_stack_namespaceFn = /*#__PURE__*/__webpack_require__.cw(() => { var $ = (export_namespaceFn()); var globalThis = (global_this_namespaceFn()); @@ -5951,7 +5977,7 @@ if (PolyfilledDOMExceptionPrototype.constructor !== PolyfilledDOMException) { }); // MODULE: ./node_modules/core-js/modules/web.url.parse.js -var web_url_parse_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module, exports) { +var web_url_parse_namespaceFn = /*#__PURE__*/__webpack_require__.cw(() => { var $ = (export_namespaceFn()); var getBuiltIn = (get_built_in_namespaceFn()); @@ -6059,6 +6085,8 @@ const isNodeJS = typeof process === "object" && process + "" === "[object proces const BBOX_INIT = [Infinity, Infinity, -Infinity, -Infinity]; const F32_BBOX_INIT = new Float32Array(BBOX_INIT); const FONT_IDENTITY_MATRIX = [0.001, 0, 0, 0.001, 0, 0]; +const DEFAULT_VERTICAL_ORIGIN_Y = 880; +const DEFAULT_VERTICAL_ADVANCE = 1000; const LINE_FACTOR = 1.35; const LINE_DESCENT_FACTOR = 0.35; const BASELINE_FACTOR = (/* unused pure expression or super */ null && (LINE_DESCENT_FACTOR / LINE_FACTOR)); @@ -6523,6 +6551,9 @@ class FeatureTest { static get isImageDecoderSupported() { return util_shadow(this, "isImageDecoderSupported", typeof ImageDecoder !== "undefined"); } + static get isVideoFrameSupported() { + return util_shadow(this, "isVideoFrameSupported", typeof VideoFrame !== "undefined"); + } static get isFloat16ArraySupported() { return util_shadow(this, "isFloat16ArraySupported", typeof Float16Array !== "undefined"); } @@ -6574,6 +6605,11 @@ class Util { static makeHexColor(r, g, b) { return `#${this.hexNums[r]}${this.hexNums[g]}${this.hexNums[b]}`; } + static get identity0to256Map() { + return util_shadow(this, "identity0to256Map", Uint8Array.from({ + length: 256 + }, (_, i) => i)); + } static transform(m1, m2) { return [m1[0] * m2[0] + m1[2] * m2[1], m1[1] * m2[0] + m1[3] * m2[1], m1[0] * m2[2] + m1[2] * m2[3], m1[1] * m2[2] + m1[3] * m2[3], m1[0] * m2[4] + m1[2] * m2[5] + m1[4], m1[1] * m2[4] + m1[3] * m2[5] + m1[5]]; } @@ -6640,10 +6676,10 @@ class Util { b1 += m1r2; b2 += m1r2; } - output[0] = Math.min(output[0], a0, a1, a2, a3); - output[1] = Math.min(output[1], b0, b1, b2, b3); - output[2] = Math.max(output[2], a0, a1, a2, a3); - output[3] = Math.max(output[3], b0, b1, b2, b3); + output[0] = Math.min(output[0], a0, a1, Math.min(a2, a3)); + output[1] = Math.min(output[1], b0, b1, Math.min(b2, b3)); + output[2] = Math.max(output[2], a0, a1, Math.max(a2, a3)); + output[3] = Math.max(output[3], b0, b1, Math.max(b2, b3)); } static inverseTransform(m) { const d = m[0] * m[3] - m[1] * m[2]; @@ -6844,6 +6880,304 @@ function MathClamp(v, min, max) { return Math.min(Math.max(v, min), max); } +;// ./src/display/display_utils.js + + + + + + + +class PixelsPerInch { + static CSS = 96.0; + static PDF = 72.0; + static PDF_TO_CSS_UNITS = this.CSS / this.PDF; +} +class RenderingCancelledException extends BaseException { + constructor(msg, extraDelay = 0) { + super(msg, "RenderingCancelledException"); + this.extraDelay = extraDelay; + } +} +function getRGBA(color) { + if (color.startsWith("#")) { + const hex = color.slice(1); + return [parseInt(hex.slice(0, 2), 16), parseInt(hex.slice(2, 4), 16), parseInt(hex.slice(4, 6), 16), hex.length >= 8 ? parseInt(hex.slice(6, 8), 16) / 255 : 1]; + } + if (color.startsWith("rgb(")) { + const [r, g, b] = color.slice(4, -1).split(",").map(x => parseInt(x, 10)); + return [r, g, b, 1]; + } + if (color.startsWith("rgba(")) { + const parts = color.slice(5, -1).split(","); + return [parseInt(parts[0], 10), parseInt(parts[1], 10), parseInt(parts[2], 10), parseFloat(parts[3])]; + } + const m = color.match(/^color\(srgb\s+([\d.]+)\s+([\d.]+)\s+([\d.]+)(?:\s*\/\s*([\d.]+|none))?\)$/); + if (m) { + return [Math.round(parseFloat(m[1]) * 255), Math.round(parseFloat(m[2]) * 255), Math.round(parseFloat(m[3]) * 255), m[4] !== undefined && m[4] !== "none" ? parseFloat(m[4]) : 1]; + } + return null; +} +function getRGB(color) { + const rgba = getRGBA(color); + if (!rgba) { + warn(`Not a valid color format: "${color}"`); + return [0, 0, 0]; + } + return rgba.slice(0, 3); +} +function getCurrentTransform(ctx) { + const { + a, + b, + c, + d, + e, + f + } = ctx.getTransform(); + return [a, b, c, d, e, f]; +} +function getCurrentTransformInverse(ctx) { + const { + a, + b, + c, + d, + e, + f + } = ctx.getTransform().invertSelf(); + return [a, b, c, d, e, f]; +} +class OutputScale { + constructor() { + const { + pixelRatio + } = OutputScale; + this.sx = pixelRatio; + this.sy = pixelRatio; + } + get scaled() { + return this.sx !== 1 || this.sy !== 1; + } + get symmetric() { + return this.sx === this.sy; + } + limitCanvas(width, height, maxPixels, maxDim, capAreaFactor = -1) { + let maxAreaScale = Infinity, + maxWidthScale = Infinity, + maxHeightScale = Infinity; + maxPixels = OutputScale.capPixels(maxPixels, capAreaFactor); + if (maxPixels > 0) { + maxAreaScale = Math.sqrt(maxPixels / (width * height)); + } + if (maxDim !== -1) { + maxWidthScale = maxDim / width; + maxHeightScale = maxDim / height; + } + const maxScale = Math.min(maxAreaScale, maxWidthScale, maxHeightScale); + if (this.sx > maxScale || this.sy > maxScale) { + this.sx = maxScale; + this.sy = maxScale; + return true; + } + return false; + } + static get pixelRatio() { + return globalThis.devicePixelRatio || 1; + } + static capPixels(maxPixels, capAreaFactor) { + if (capAreaFactor >= 0) { + const winPixels = Math.ceil(window.screen.availWidth * window.screen.availHeight * this.pixelRatio ** 2 * (1 + capAreaFactor / 100)); + return maxPixels > 0 ? Math.min(maxPixels, winPixels) : winPixels; + } + return maxPixels; + } +} +function applyOpacity(color, opacity) { + opacity = MathClamp(opacity ?? 1, 0, 1); + const white = 255 * (1 - opacity); + return color.map(c => Math.round(c * opacity + white)); +} +function RGBToHSL(rgb, output) { + const r = rgb[0] / 255; + const g = rgb[1] / 255; + const b = rgb[2] / 255; + const max = Math.max(r, g, b); + const min = Math.min(r, g, b); + const l = (max + min) / 2; + if (max === min) { + output[0] = output[1] = 0; + } else { + const d = max - min; + output[1] = l < 0.5 ? d / (max + min) : d / (2 - max - min); + switch (max) { + case r: + output[0] = ((g - b) / d + (g < b ? 6 : 0)) * 60; + break; + case g: + output[0] = ((b - r) / d + 2) * 60; + break; + case b: + output[0] = ((r - g) / d + 4) * 60; + break; + } + } + output[2] = l; +} +function HSLToRGB(hsl, output) { + const h = hsl[0]; + const s = hsl[1]; + const l = hsl[2]; + const c = (1 - Math.abs(2 * l - 1)) * s; + const x = c * (1 - Math.abs(h / 60 % 2 - 1)); + const m = l - c / 2; + switch (Math.floor(h / 60)) { + case 0: + output[0] = c + m; + output[1] = x + m; + output[2] = m; + break; + case 1: + output[0] = x + m; + output[1] = c + m; + output[2] = m; + break; + case 2: + output[0] = m; + output[1] = c + m; + output[2] = x + m; + break; + case 3: + output[0] = m; + output[1] = x + m; + output[2] = c + m; + break; + case 4: + output[0] = x + m; + output[1] = m; + output[2] = c + m; + break; + case 5: + case 6: + output[0] = c + m; + output[1] = m; + output[2] = x + m; + break; + } +} +function computeLuminance(x) { + return x <= 0.03928 ? x / 12.92 : ((x + 0.055) / 1.055) ** 2.4; +} +function contrastRatio(hsl1, hsl2, output) { + HSLToRGB(hsl1, output); + output.map(computeLuminance); + const lum1 = 0.2126 * output[0] + 0.7152 * output[1] + 0.0722 * output[2]; + HSLToRGB(hsl2, output); + output.map(computeLuminance); + const lum2 = 0.2126 * output[0] + 0.7152 * output[1] + 0.0722 * output[2]; + return lum1 > lum2 ? (lum1 + 0.05) / (lum2 + 0.05) : (lum2 + 0.05) / (lum1 + 0.05); +} +const contrastCache = new Map(); +function findContrastColor(baseColor, fixedColor) { + const key = baseColor[0] + baseColor[1] * 0x100 + baseColor[2] * 0x10000 + fixedColor[0] * 0x1000000 + fixedColor[1] * 0x100000000 + fixedColor[2] * 0x10000000000; + let cachedValue = contrastCache.get(key); + if (cachedValue) { + return cachedValue; + } + const array = new Float32Array(9); + const output = array.subarray(0, 3); + const baseHSL = array.subarray(3, 6); + RGBToHSL(baseColor, baseHSL); + const fixedHSL = array.subarray(6, 9); + RGBToHSL(fixedColor, fixedHSL); + const isFixedColorDark = fixedHSL[2] < 0.5; + const minContrast = isFixedColorDark ? 12 : 4.5; + baseHSL[2] = isFixedColorDark ? Math.sqrt(baseHSL[2]) : 1 - Math.sqrt(1 - baseHSL[2]); + if (contrastRatio(baseHSL, fixedHSL, output) < minContrast) { + let start, end; + if (isFixedColorDark) { + start = baseHSL[2]; + end = 1; + } else { + start = 0; + end = baseHSL[2]; + } + const PRECISION = 0.005; + while (end - start > PRECISION) { + const mid = baseHSL[2] = (start + end) / 2; + if (isFixedColorDark === contrastRatio(baseHSL, fixedHSL, output) < minContrast) { + start = mid; + } else { + end = mid; + } + } + baseHSL[2] = isFixedColorDark ? end : start; + } + HSLToRGB(baseHSL, output); + cachedValue = Util.makeHexColor(Math.round(output[0] * 255), Math.round(output[1] * 255), Math.round(output[2] * 255)); + contrastCache.set(key, cachedValue); + return cachedValue; +} +function makePathFromDrawOPS(data) { + const path = new Path2D(); + if (!data) { + return path; + } + for (let i = 0, ii = data.length; i < ii;) { + switch (data[i++]) { + case DrawOPS.moveTo: + path.moveTo(data[i++], data[i++]); + break; + case DrawOPS.lineTo: + path.lineTo(data[i++], data[i++]); + break; + case DrawOPS.curveTo: + path.bezierCurveTo(data[i++], data[i++], data[i++], data[i++], data[i++], data[i++]); + break; + case DrawOPS.quadraticCurveTo: + path.quadraticCurveTo(data[i++], data[i++], data[i++], data[i++]); + break; + case DrawOPS.closePath: + path.closePath(); + break; + default: + warn(`Unrecognized drawing path operator: ${data[i - 1]}`); + break; + } + } + return path; +} + +;// ./node_modules/core-js/modules/es.iterator.take.js +es_iterator_take_namespaceFn(); + +;// ./node_modules/core-js/modules/es.weak-map.get-or-insert.js +es_weak_map_get_or_insert_namespaceFn(); + +;// ./node_modules/core-js/modules/es.weak-map.get-or-insert-computed.js +es_weak_map_get_or_insert_computed_namespaceFn(); + +;// ./node_modules/core-js/modules/es.iterator.some.js +es_iterator_some_namespaceFn(); + +;// ./node_modules/core-js/modules/es.json.stringify.js +es_json_stringify_namespaceFn(); + +;// ./node_modules/core-js/modules/web.dom-exception.stack.js +web_dom_exception_stack_namespaceFn(); + +;// ./node_modules/core-js/modules/es.iterator.drop.js +es_iterator_drop_namespaceFn(); + +;// ./node_modules/core-js/modules/es.iterator.every.js +es_iterator_every_namespaceFn(); + +;// ./node_modules/core-js/modules/es.iterator.find.js +es_iterator_find_namespaceFn(); + +;// ./node_modules/core-js/modules/es.json.parse.js +es_json_parse_namespaceFn(); + ;// ./src/display/page_viewport.js class PageViewport { @@ -7278,12 +7612,7 @@ class XfaLayer { } } -;// ./src/display/display_utils.js - - - - - +;// ./src/display/dom_utils.js @@ -7302,11 +7631,6 @@ class XfaLayer { -class PixelsPerInch { - static CSS = 96.0; - static PDF = 72.0; - static PDF_TO_CSS_UNITS = this.CSS / this.PDF; -} async function fetchData(url, type = "text") { if (isValidFetchUrl(url, document.baseURI)) { const response = await fetch(url); @@ -7349,12 +7673,6 @@ async function fetchData(url, type = "text") { request.send(null); }); } -class RenderingCancelledException extends BaseException { - constructor(msg, extraDelay = 0) { - super(msg, "RenderingCancelledException"); - this.extraDelay = extraDelay; - } -} function isDataScheme(url) { const ii = url.length; let i = 0; @@ -7445,31 +7763,6 @@ function getPdfFilenameFromUrl(url, defaultFilename = "document.pdf") { } return defaultFilename; } -class StatTimer { - #started = new Map(); - times = []; - time(name) { - if (this.#started.has(name)) { - warn(`Timer is already running for ${name}`); - } - this.#started.set(name, Date.now()); - } - timeEnd(name) { - if (!this.#started.has(name)) { - warn(`Timer has not been started for ${name}`); - } - this.times.push({ - name, - start: this.#started.get(name), - end: Date.now() - }); - this.#started.delete(name); - } - toString() { - const longest = Math.max(...this.times.map(t => t.name.length)); - return this.times.map(t => `${t.name.padEnd(longest)} ${t.end - t.start}ms\n`).join(""); - } -} function isValidFetchUrl(url, baseUrl) { const res = baseUrl ? URL.parse(url, baseUrl) : URL.parse(url); return /https?:/.test(res?.protocol ?? ""); @@ -7481,9 +7774,6 @@ function stopEvent(e) { e.preventDefault(); e.stopPropagation(); } -function deprecated(details) { - console.log("Deprecated API usage: " + details); -} class PDFDateString { static #regex; static toDateObject(input) { @@ -7524,33 +7814,6 @@ class PDFDateString { return new Date(Date.UTC(year, month, day, hour, minute, second)); } } -function getRGBA(color) { - if (color.startsWith("#")) { - const hex = color.slice(1); - return [parseInt(hex.slice(0, 2), 16), parseInt(hex.slice(2, 4), 16), parseInt(hex.slice(4, 6), 16), hex.length >= 8 ? parseInt(hex.slice(6, 8), 16) / 255 : 1]; - } - if (color.startsWith("rgb(")) { - const [r, g, b] = color.slice(4, -1).split(",").map(x => parseInt(x, 10)); - return [r, g, b, 1]; - } - if (color.startsWith("rgba(")) { - const parts = color.slice(5, -1).split(","); - return [parseInt(parts[0], 10), parseInt(parts[1], 10), parseInt(parts[2], 10), parseFloat(parts[3])]; - } - const m = color.match(/^color\(srgb\s+([\d.]+)\s+([\d.]+)\s+([\d.]+)(?:\s*\/\s*([\d.]+|none))?\)$/); - if (m) { - return [Math.round(parseFloat(m[1]) * 255), Math.round(parseFloat(m[2]) * 255), Math.round(parseFloat(m[3]) * 255), m[4] !== undefined && m[4] !== "none" ? parseFloat(m[4]) : 1]; - } - return null; -} -function getRGB(color) { - const rgba = getRGBA(color); - if (!rgba) { - warn(`Not a valid color format: "${color}"`); - return [0, 0, 0]; - } - return rgba.slice(0, 3); -} function getColorValues(colors) { const span = document.createElement("span"); span.style.visibility = "hidden"; @@ -7563,28 +7826,6 @@ function getColorValues(colors) { } span.remove(); } -function getCurrentTransform(ctx) { - const { - a, - b, - c, - d, - e, - f - } = ctx.getTransform(); - return [a, b, c, d, e, f]; -} -function getCurrentTransformInverse(ctx) { - const { - a, - b, - c, - d, - e, - f - } = ctx.getTransform().invertSelf(); - return [a, b, c, d, e, f]; -} function setLayerDimensions(div, viewport, mustFlip = false, mustRotate = true) { if (viewport instanceof PageViewport) { const { @@ -7608,51 +7849,6 @@ function setLayerDimensions(div, viewport, mustFlip = false, mustRotate = true) div.setAttribute("data-main-rotation", viewport.rotation); } } -class OutputScale { - constructor() { - const { - pixelRatio - } = OutputScale; - this.sx = pixelRatio; - this.sy = pixelRatio; - } - get scaled() { - return this.sx !== 1 || this.sy !== 1; - } - get symmetric() { - return this.sx === this.sy; - } - limitCanvas(width, height, maxPixels, maxDim, capAreaFactor = -1) { - let maxAreaScale = Infinity, - maxWidthScale = Infinity, - maxHeightScale = Infinity; - maxPixels = OutputScale.capPixels(maxPixels, capAreaFactor); - if (maxPixels > 0) { - maxAreaScale = Math.sqrt(maxPixels / (width * height)); - } - if (maxDim !== -1) { - maxWidthScale = maxDim / width; - maxHeightScale = maxDim / height; - } - const maxScale = Math.min(maxAreaScale, maxWidthScale, maxHeightScale); - if (this.sx > maxScale || this.sy > maxScale) { - this.sx = maxScale; - this.sy = maxScale; - return true; - } - return false; - } - static get pixelRatio() { - return globalThis.devicePixelRatio || 1; - } - static capPixels(maxPixels, capAreaFactor) { - if (capAreaFactor >= 0) { - const winPixels = Math.ceil(window.screen.availWidth * window.screen.availHeight * this.pixelRatio ** 2 * (1 + capAreaFactor / 100)); - return maxPixels > 0 ? Math.min(maxPixels, winPixels) : winPixels; - } - return maxPixels; - } -} const SupportedImageMimeTypes = new Set(["image/apng", "image/avif", "image/bmp", "image/gif", "image/jpeg", "image/png", "image/svg+xml", "image/webp", "image/x-icon"]); class ColorScheme { static get isDarkMode() { @@ -7677,131 +7873,6 @@ class CSSConstants { return util_shadow(this, "commentForegroundColor", getRGB(color)); } } -function applyOpacity(color, opacity) { - opacity = MathClamp(opacity ?? 1, 0, 1); - const white = 255 * (1 - opacity); - return color.map(c => Math.round(c * opacity + white)); -} -function RGBToHSL(rgb, output) { - const r = rgb[0] / 255; - const g = rgb[1] / 255; - const b = rgb[2] / 255; - const max = Math.max(r, g, b); - const min = Math.min(r, g, b); - const l = (max + min) / 2; - if (max === min) { - output[0] = output[1] = 0; - } else { - const d = max - min; - output[1] = l < 0.5 ? d / (max + min) : d / (2 - max - min); - switch (max) { - case r: - output[0] = ((g - b) / d + (g < b ? 6 : 0)) * 60; - break; - case g: - output[0] = ((b - r) / d + 2) * 60; - break; - case b: - output[0] = ((r - g) / d + 4) * 60; - break; - } - } - output[2] = l; -} -function HSLToRGB(hsl, output) { - const h = hsl[0]; - const s = hsl[1]; - const l = hsl[2]; - const c = (1 - Math.abs(2 * l - 1)) * s; - const x = c * (1 - Math.abs(h / 60 % 2 - 1)); - const m = l - c / 2; - switch (Math.floor(h / 60)) { - case 0: - output[0] = c + m; - output[1] = x + m; - output[2] = m; - break; - case 1: - output[0] = x + m; - output[1] = c + m; - output[2] = m; - break; - case 2: - output[0] = m; - output[1] = c + m; - output[2] = x + m; - break; - case 3: - output[0] = m; - output[1] = x + m; - output[2] = c + m; - break; - case 4: - output[0] = x + m; - output[1] = m; - output[2] = c + m; - break; - case 5: - case 6: - output[0] = c + m; - output[1] = m; - output[2] = x + m; - break; - } -} -function computeLuminance(x) { - return x <= 0.03928 ? x / 12.92 : ((x + 0.055) / 1.055) ** 2.4; -} -function contrastRatio(hsl1, hsl2, output) { - HSLToRGB(hsl1, output); - output.map(computeLuminance); - const lum1 = 0.2126 * output[0] + 0.7152 * output[1] + 0.0722 * output[2]; - HSLToRGB(hsl2, output); - output.map(computeLuminance); - const lum2 = 0.2126 * output[0] + 0.7152 * output[1] + 0.0722 * output[2]; - return lum1 > lum2 ? (lum1 + 0.05) / (lum2 + 0.05) : (lum2 + 0.05) / (lum1 + 0.05); -} -const contrastCache = new Map(); -function findContrastColor(baseColor, fixedColor) { - const key = baseColor[0] + baseColor[1] * 0x100 + baseColor[2] * 0x10000 + fixedColor[0] * 0x1000000 + fixedColor[1] * 0x100000000 + fixedColor[2] * 0x10000000000; - let cachedValue = contrastCache.get(key); - if (cachedValue) { - return cachedValue; - } - const array = new Float32Array(9); - const output = array.subarray(0, 3); - const baseHSL = array.subarray(3, 6); - RGBToHSL(baseColor, baseHSL); - const fixedHSL = array.subarray(6, 9); - RGBToHSL(fixedColor, fixedHSL); - const isFixedColorDark = fixedHSL[2] < 0.5; - const minContrast = isFixedColorDark ? 12 : 4.5; - baseHSL[2] = isFixedColorDark ? Math.sqrt(baseHSL[2]) : 1 - Math.sqrt(1 - baseHSL[2]); - if (contrastRatio(baseHSL, fixedHSL, output) < minContrast) { - let start, end; - if (isFixedColorDark) { - start = baseHSL[2]; - end = 1; - } else { - start = 0; - end = baseHSL[2]; - } - const PRECISION = 0.005; - while (end - start > PRECISION) { - const mid = baseHSL[2] = (start + end) / 2; - if (isFixedColorDark === contrastRatio(baseHSL, fixedHSL, output) < minContrast) { - start = mid; - } else { - end = mid; - } - } - baseHSL[2] = isFixedColorDark ? end : start; - } - HSLToRGB(baseHSL, output); - cachedValue = Util.makeHexColor(Math.round(output[0] * 255), Math.round(output[1] * 255), Math.round(output[2] * 255)); - contrastCache.set(key, cachedValue); - return cachedValue; -} function renderRichText({ html, dir, @@ -7830,65 +7901,6 @@ function renderRichText({ fragment.firstElementChild.classList.add("richText", className); container.append(fragment); } -function makePathFromDrawOPS(data) { - const path = new Path2D(); - if (!data) { - return path; - } - for (let i = 0, ii = data.length; i < ii;) { - switch (data[i++]) { - case DrawOPS.moveTo: - path.moveTo(data[i++], data[i++]); - break; - case DrawOPS.lineTo: - path.lineTo(data[i++], data[i++]); - break; - case DrawOPS.curveTo: - path.bezierCurveTo(data[i++], data[i++], data[i++], data[i++], data[i++], data[i++]); - break; - case DrawOPS.quadraticCurveTo: - path.quadraticCurveTo(data[i++], data[i++], data[i++], data[i++]); - break; - case DrawOPS.closePath: - path.closePath(); - break; - default: - warn(`Unrecognized drawing path operator: ${data[i - 1]}`); - break; - } - } - return path; -} - -;// ./node_modules/core-js/modules/es.iterator.take.js -es_iterator_take_namespaceFn(); - -;// ./node_modules/core-js/modules/es.weak-map.get-or-insert.js -es_weak_map_get_or_insert_namespaceFn(); - -;// ./node_modules/core-js/modules/es.weak-map.get-or-insert-computed.js -es_weak_map_get_or_insert_computed_namespaceFn(); - -;// ./node_modules/core-js/modules/web.dom-exception.stack.js -web_dom_exception_stack_namespaceFn(); - -;// ./node_modules/core-js/modules/es.iterator.some.js -es_iterator_some_namespaceFn(); - -;// ./node_modules/core-js/modules/es.json.stringify.js -es_json_stringify_namespaceFn(); - -;// ./node_modules/core-js/modules/es.iterator.drop.js -es_iterator_drop_namespaceFn(); - -;// ./node_modules/core-js/modules/es.iterator.every.js -es_iterator_every_namespaceFn(); - -;// ./node_modules/core-js/modules/es.iterator.find.js -es_iterator_find_namespaceFn(); - -;// ./node_modules/core-js/modules/es.json.parse.js -es_json_parse_namespaceFn(); ;// ./src/display/editor/toolbar.js @@ -8195,7 +8207,7 @@ class FloatingToolbar { } ;// ./src/shared/internal_evt.js -const INTERNAL_EVT = "2837668c-d334-48d1-ba74-aa7deba483da"; +const INTERNAL_EVT = "0a475cb6-573c-46ed-869d-fa7c5839d995"; const internalOpt = Object.freeze({ internal: INTERNAL_EVT }); @@ -8222,6 +8234,7 @@ const internalOpt = Object.freeze({ + function bindEvents(obj, element, names) { @@ -8798,7 +8811,7 @@ class AnnotationEditorUIManager { checker: arrowChecker }]])); } - constructor(container, viewer, viewerAlert, altTextManager, commentManager, signatureManager, eventBus, pdfDocument, pageColors, highlightColors, enableHighlightFloatingButton, enableUpdatedAddImage, enableNewAltTextWhenAddingImage, mlManager, editorUndoBar, supportsPinchToZoom) { + constructor(container, viewer, viewerAlert, altTextManager, commentManager, signatureManager, eventBus, pdfDocument, pageColors, highlightColors, enableHighlightFloatingButton, enableUpdatedAddImage, enableNewAltTextWhenAddingImage, mlManager, editorUndoBar, supportsPinchToZoom, keepToolbarInPage) { const signal = this._signal = this.#abortController.signal; this.#container = container; this.#viewer = viewer; @@ -8852,6 +8865,7 @@ class AnnotationEditorUIManager { this.isShiftKeyDown = false; this._editorUndoBar = editorUndoBar || null; this._supportsPinchToZoom = supportsPinchToZoom !== false; + this._keepToolbarInPage = keepToolbarInPage === true; commentManager?.setSidebarUiManager(this); } destroy() { @@ -10017,7 +10031,7 @@ class AnnotationEditorUIManager { this.#commandManager.undo(); this.#dispatchUpdateStates({ hasSomethingToUndo: this.#commandManager.hasSomethingToUndo(), - hasSomethingToRedo: true, + hasSomethingToRedo: this.#commandManager.hasSomethingToRedo(), isEmpty: this.#isEmpty() }); this._editorUndoBar?.hide(); @@ -10025,7 +10039,7 @@ class AnnotationEditorUIManager { redo() { this.#commandManager.redo(); this.#dispatchUpdateStates({ - hasSomethingToUndo: true, + hasSomethingToUndo: this.#commandManager.hasSomethingToUndo(), hasSomethingToRedo: this.#commandManager.hasSomethingToRedo(), isEmpty: this.#isEmpty() }); @@ -10933,6 +10947,7 @@ class Comment { + function preventDefault(evt) { evt.preventDefault(); } @@ -11604,6 +11619,29 @@ class AnnotationEditor { height *= pageHeight; x *= pageWidth; y *= pageHeight; + let tx = 0; + let ty = 0; + const toolbar = this._uiManager._keepToolbarInPage && this._editToolbar?.div; + if (toolbar?.offsetParent) { + const scale = this.parentScale; + const toolbarLeft = toolbar.offsetLeft + this.div.clientLeft; + const toolbarTop = toolbar.offsetTop + this.div.clientTop; + const left = Math.min(0, toolbarLeft) / scale; + const top = Math.min(0, toolbarTop) / scale; + const widthWithToolbar = width - left + Math.max(0, toolbarLeft + toolbar.offsetWidth - this.div.offsetWidth) / scale; + const heightWithToolbar = height - top + Math.max(0, toolbarTop + toolbar.offsetHeight - this.div.offsetHeight) / scale; + if (widthWithToolbar <= (rotation % 180 ? pageHeight : pageWidth)) { + width = widthWithToolbar; + tx = left; + } + if (heightWithToolbar <= (rotation % 180 ? pageWidth : pageHeight)) { + height = heightWithToolbar; + ty = top; + } + [tx, ty] = AnnotationEditor.#rotatePoint(tx, ty, rotation); + x += tx; + y += ty; + } if (this._mustFixPosition) { switch (rotation) { case 0: @@ -11624,8 +11662,8 @@ class AnnotationEditor { break; } } - this.x = x /= pageWidth; - this.y = y /= pageHeight; + this.x = x = (x - tx) / pageWidth; + this.y = y = (y - ty) / pageHeight; const [bx, by] = this.getBaseTranslation(); x += bx; y += by; @@ -12706,14 +12744,21 @@ class AnnotationEditor { if (!this._editToolbar) { this.addEditToolbar().then(() => { if (this.div?.classList.contains("selectedEditor")) { - this._editToolbar?.show(); + this.#showEditToolbar(); } }); return; } - this._editToolbar?.show(); + this.#showEditToolbar(); this.#altText?.toggleAltTextBadge(false); } + #showEditToolbar() { + this._editToolbar?.show(); + if (this._uiManager._keepToolbarInPage) { + this.fixAndSetPosition(); + this._onTranslated(); + } + } focus() { if (this.div && !this.div.contains(document.activeElement)) { setTimeout(() => this.div?.focus({ @@ -13265,18 +13310,7 @@ class PrintAnnotationStorage extends AnnotationStorage { } } -;// ./node_modules/core-js/modules/es.iterator.for-each.js -es_iterator_for_each_namespaceFn(); - -;// ./src/display/canvas_dependency_tracker.js - - - - - - - - +;// ./src/display/api_utils.js @@ -13290,1574 +13324,346 @@ es_iterator_for_each_namespaceFn(); -const FORCED_DEPENDENCY_LABEL = "__forcedDependency"; -const { - floor: canvas_dependency_tracker_floor, - ceil -} = Math; -function expandBBox(array, index, minX, minY, maxX, maxY) { - array[index * 4 + 0] = Math.min(array[index * 4 + 0], minX); - array[index * 4 + 1] = Math.min(array[index * 4 + 1], minY); - array[index * 4 + 2] = Math.max(array[index * 4 + 2], maxX); - array[index * 4 + 3] = Math.max(array[index * 4 + 3], maxY); +function deprecated(details) { + console.log("Deprecated API usage: " + details); } -function scaleCharBBox(scaleX, scaleY, x, y, bbox) { - let temp; - if (scaleX) { - if (scaleX < 0) { - temp = bbox[0]; - bbox[0] = bbox[2]; - bbox[2] = temp; +function getUrlProp(val) { + if (val instanceof URL) { + return val; + } + if (typeof val === "string") { + if (isNodeJS) { + if (/^[a-z][a-z0-9\-+.]+:/i.test(val)) { + return new URL(val); + } + const url = process.getBuiltinModule("url"); + return new URL(url.pathToFileURL(val)); } - bbox[0] *= scaleX; - bbox[2] *= scaleX; - if (scaleY < 0) { - temp = bbox[1]; - bbox[1] = bbox[3]; - bbox[3] = temp; + const url = URL.parse(val, window.location); + if (url) { + return url; } - bbox[1] *= scaleY; - bbox[3] *= scaleY; - } else { - bbox.fill(0); } - bbox[0] += x; - bbox[1] += y; - bbox[2] += x; - bbox[3] += y; + throw new Error("Invalid PDF url data: " + "either string or URL-object is expected in the url property."); } -const EMPTY_BBOX = new Uint32Array(new Uint8Array([255, 255, 0, 0]).buffer)[0]; -class BBoxReader { - #bboxes; - #coords; - constructor(bboxes, coords) { - this.#bboxes = bboxes; - this.#coords = coords; - } - get length() { - return this.#bboxes.length; - } - isEmpty(i) { - return this.#bboxes[i] === EMPTY_BBOX; - } - minX(i) { - return this.#coords[i * 4 + 0] / 256; +function getDataProp(val) { + if (isNodeJS && typeof Buffer !== "undefined" && val instanceof Buffer) { + throw new Error("Please provide binary data as `Uint8Array`, rather than `Buffer`."); } - minY(i) { - return this.#coords[i * 4 + 1] / 256; + if (val instanceof Uint8Array && val.byteLength === val.buffer.byteLength) { + return val; } - maxX(i) { - return (this.#coords[i * 4 + 2] + 1) / 256; + if (typeof val === "string") { + return stringToBytes(val); } - maxY(i) { - return (this.#coords[i * 4 + 3] + 1) / 256; + if (val instanceof ArrayBuffer || ArrayBuffer.isView(val) || typeof val === "object" && !isNaN(val?.length)) { + return new Uint8Array(val); } + throw new Error("Invalid PDF binary data: either TypedArray, " + "string, or array-like object is expected in the data property."); } -const ensureDebugMetadata = (map, key) => map?.getOrInsertComputed(key, () => ({ - dependencies: new Set(), - isRenderingOperation: false -})); -class CanvasBBoxTracker { - #baseTransformStack = [[1, 0, 0, 1, 0, 0]]; - #clipBox = [-Infinity, -Infinity, Infinity, Infinity]; - #pendingBBox = new Float64Array(BBOX_INIT); - _pendingBBoxIdx = -1; - #canvasWidth; - #canvasHeight; - #bboxesCoords; - #bboxes; - _savesStack = []; - _markedContentStack = []; - constructor(canvas, operationsCount) { - this.#canvasWidth = canvas.width; - this.#canvasHeight = canvas.height; - this.#initializeBBoxes(operationsCount); +function getFactoryUrlProp(val) { + if (typeof val !== "string") { + return null; } - growOperationsCount(operationsCount) { - if (operationsCount >= this.#bboxes.length) { - this.#initializeBBoxes(operationsCount, this.#bboxes); - } + if (val.endsWith("/")) { + return val; } - #initializeBBoxes(operationsCount, oldBBoxes) { - const buffer = new ArrayBuffer(operationsCount * 4); - this.#bboxesCoords = new Uint8ClampedArray(buffer); - this.#bboxes = new Uint32Array(buffer); - if (oldBBoxes && oldBBoxes.length > 0) { - this.#bboxes.set(oldBBoxes); - this.#bboxes.fill(EMPTY_BBOX, oldBBoxes.length); - } else { - this.#bboxes.fill(EMPTY_BBOX); - } + throw new Error(`Invalid factory url: "${val}" must include trailing slash.`); +} +const isRefProxy = v => typeof v === "object" && Number.isInteger(v?.num) && v.num >= 0 && Number.isInteger(v?.gen) && v.gen >= 0; +const isNameProxy = v => typeof v === "object" && typeof v?.name === "string"; +const isValidExplicitDest = _isValidExplicitDest.bind(null, isRefProxy, isNameProxy); +function isSameOrigin(baseUrl, otherUrl) { + const base = URL.parse(baseUrl); + if (!base?.origin || base.origin === "null") { + return false; } - get clipBox() { - return this.#clipBox; + const other = new URL(otherUrl, base); + return base.origin === other.origin; +} +function getWorkerSrc(src) { + if (!isSameOrigin(window.location, src)) { + const wrapper = `await import("${new URL(src, window.location).href}");`; + return URL.createObjectURL(new Blob([wrapper], { + type: "text/javascript" + })); } - save(opIdx) { - this.#clipBox = { - __proto__: this.#clipBox + return src; +} +class LoopbackPort { + #listeners = new Map(); + #deferred = Promise.resolve(); + postMessage(obj, transfer) { + const event = { + data: structuredClone(obj, transfer ? { + transfer + } : null) }; - this._savesStack.push(opIdx); - return this; - } - restore(opIdx, onSavePopped) { - const previous = Object.getPrototypeOf(this.#clipBox); - if (previous === null) { - return this; - } - this.#clipBox = previous; - const lastSave = this._savesStack.pop(); - if (lastSave !== undefined) { - onSavePopped?.(lastSave, opIdx); - this.#bboxes[opIdx] = this.#bboxes[lastSave]; - } - return this; - } - recordOpenMarker(idx) { - this._savesStack.push(idx); - return this; - } - getOpenMarker() { - return this._savesStack.length === 0 ? null : this._savesStack.at(-1); + this.#deferred.then(() => { + for (const [listener] of this.#listeners) { + listener.call(this, event); + } + }); } - recordCloseMarker(opIdx, onSavePopped) { - const lastSave = this._savesStack.pop(); - if (lastSave !== undefined) { - onSavePopped?.(lastSave, opIdx); - this.#bboxes[opIdx] = this.#bboxes[lastSave]; + addEventListener(name, listener, options = null) { + let rmAbort = null; + if (options?.signal instanceof AbortSignal) { + const { + signal + } = options; + if (signal.aborted) { + warn("LoopbackPort - cannot use an `aborted` signal."); + return; + } + const onAbort = () => this.removeEventListener(name, listener); + rmAbort = () => signal.removeEventListener("abort", onAbort); + signal.addEventListener("abort", onAbort); } - return this; + this.#listeners.set(listener, rmAbort); } - beginMarkedContent(opIdx) { - this._markedContentStack.push(opIdx); - return this; + removeEventListener(name, listener) { + const rmAbort = this.#listeners.get(listener); + rmAbort?.(); + this.#listeners.delete(listener); } - endMarkedContent(opIdx, onSavePopped) { - const lastSave = this._markedContentStack.pop(); - if (lastSave !== undefined) { - onSavePopped?.(lastSave, opIdx); - this.#bboxes[opIdx] = this.#bboxes[lastSave]; + terminate() { + for (const [, rmAbort] of this.#listeners) { + rmAbort?.(); } - return this; - } - pushBaseTransform(ctx) { - this.#baseTransformStack.push(Util.multiplyByDOMMatrix(this.#baseTransformStack.at(-1), ctx.getTransform())); - return this; + this.#listeners.clear(); } - popBaseTransform() { - if (this.#baseTransformStack.length > 1) { - this.#baseTransformStack.pop(); +} +class StatTimer { + #started = new Map(); + times = []; + time(name) { + if (this.#started.has(name)) { + warn(`Timer is already running for ${name}`); } - return this; + this.#started.set(name, Date.now()); } - resetBBox(idx) { - if (this._pendingBBoxIdx !== idx) { - this._pendingBBoxIdx = idx; - this.#pendingBBox.set(BBOX_INIT, 0); + timeEnd(name) { + if (!this.#started.has(name)) { + warn(`Timer has not been started for ${name}`); } - return this; + this.times.push({ + name, + start: this.#started.get(name), + end: Date.now() + }); + this.#started.delete(name); } - recordClipBox(idx, ctx, minX, maxX, minY, maxY) { - const transform = Util.multiplyByDOMMatrix(this.#baseTransformStack.at(-1), ctx.getTransform()); - const clipBox = BBOX_INIT.slice(); - Util.axialAlignedBoundingBox([minX, minY, maxX, maxY], transform, clipBox); - const intersection = Util.intersect(this.#clipBox, clipBox); - if (intersection) { - this.#clipBox[0] = intersection[0]; - this.#clipBox[1] = intersection[1]; - this.#clipBox[2] = intersection[2]; - this.#clipBox[3] = intersection[3]; - } else { - this.#clipBox[0] = this.#clipBox[1] = Infinity; - this.#clipBox[2] = this.#clipBox[3] = -Infinity; - } - return this; + toString() { + const longest = Math.max(...this.times.map(t => t.name.length)); + return this.times.map(t => `${t.name.padEnd(longest)} ${t.end - t.start}ms\n`).join(""); } - recordBBox(idx, ctx, minX, maxX, minY, maxY) { - const clipBox = this.#clipBox; - if (clipBox[0] === Infinity) { - return this; +} + +;// ./src/display/webgpu.js + +const MESH_WGSL = ` +struct Uniforms { + offsetX : f32, + offsetY : f32, + scaleX : f32, + scaleY : f32, + paddedWidth : f32, + paddedHeight : f32, + borderSize : f32, + _pad : f32, +}; + +@group(0) @binding(0) var u : Uniforms; + +struct VertexInput { + @location(0) position : vec2, + @location(1) color : vec4, +}; + +struct VertexOutput { + @builtin(position) position : vec4, + @location(0) color : vec3, +}; + +@vertex +fn vs_main(in : VertexInput) -> VertexOutput { + var out : VertexOutput; + let cx = (in.position.x + u.offsetX) * u.scaleX; + let cy = (in.position.y + u.offsetY) * u.scaleY; + out.position = vec4( + ((cx + u.borderSize) / u.paddedWidth) * 2.0 - 1.0, + 1.0 - ((cy + u.borderSize) / u.paddedHeight) * 2.0, + 0.0, + 1.0 + ); + out.color = in.color.rgb; + return out; +} + +@fragment +fn fs_main(in : VertexOutput) -> @location(0) vec4 { + return vec4(in.color, 1.0); +} +`; +class WebGPU { + #initPromise = null; + #device = null; + #meshPipeline = null; + #preferredFormat = null; + async #initGPU() { + if (!globalThis.navigator?.gpu) { + return false; } - const transform = Util.multiplyByDOMMatrix(this.#baseTransformStack.at(-1), ctx.getTransform()); - if (clipBox[0] === -Infinity) { - Util.axialAlignedBoundingBox([minX, minY, maxX, maxY], transform, this.#pendingBBox); - return this; + try { + const adapter = await navigator.gpu.requestAdapter(); + if (!adapter) { + return false; + } + this.#preferredFormat = navigator.gpu.getPreferredCanvasFormat(); + this.#device = await adapter.requestDevice(); + return true; + } catch { + return false; } - const bbox = BBOX_INIT.slice(); - Util.axialAlignedBoundingBox([minX, minY, maxX, maxY], transform, bbox); - this.#pendingBBox[0] = MathClamp(bbox[0], clipBox[0], this.#pendingBBox[0]); - this.#pendingBBox[1] = MathClamp(bbox[1], clipBox[1], this.#pendingBBox[1]); - this.#pendingBBox[2] = MathClamp(bbox[2], this.#pendingBBox[2], clipBox[2]); - this.#pendingBBox[3] = MathClamp(bbox[3], this.#pendingBBox[3], clipBox[3]); - return this; } - recordFullPageBBox(idx) { - this.#pendingBBox[0] = Math.max(0, this.#clipBox[0]); - this.#pendingBBox[1] = Math.max(0, this.#clipBox[1]); - this.#pendingBBox[2] = Math.min(this.#canvasWidth, this.#clipBox[2]); - this.#pendingBBox[3] = Math.min(this.#canvasHeight, this.#clipBox[3]); - return this; + init() { + return this.#initPromise ||= this.#initGPU(); } - recordOperation(idx, preserve = false, dependencyLists) { - if (this._pendingBBoxIdx !== idx) { - return this; + get isReady() { + return this.#device !== null; + } + loadMeshShader() { + if (!this.#device || this.#meshPipeline) { + return; } - const minX = canvas_dependency_tracker_floor(this.#pendingBBox[0] * 256 / this.#canvasWidth); - const minY = canvas_dependency_tracker_floor(this.#pendingBBox[1] * 256 / this.#canvasHeight); - const maxX = ceil(this.#pendingBBox[2] * 256 / this.#canvasWidth); - const maxY = ceil(this.#pendingBBox[3] * 256 / this.#canvasHeight); - expandBBox(this.#bboxesCoords, idx, minX, minY, maxX, maxY); - if (dependencyLists) { - for (const dependencies of dependencyLists) { - for (const depIdx of dependencies) { - if (depIdx !== idx) { - expandBBox(this.#bboxesCoords, depIdx, minX, minY, maxX, maxY); - } - } + const shaderModule = this.#device.createShaderModule({ + code: MESH_WGSL + }); + this.#meshPipeline = this.#device.createRenderPipeline({ + layout: "auto", + vertex: { + module: shaderModule, + entryPoint: "vs_main", + buffers: [{ + arrayStride: 2 * 4, + attributes: [{ + shaderLocation: 0, + offset: 0, + format: "float32x2" + }] + }, { + arrayStride: 4, + attributes: [{ + shaderLocation: 1, + offset: 0, + format: "unorm8x4" + }] + }] + }, + fragment: { + module: shaderModule, + entryPoint: "fs_main", + targets: [{ + format: this.#preferredFormat + }] + }, + primitive: { + topology: "triangle-list" } + }); + } + draw(posData, colData, vertexCount, context, backgroundColor, paddedWidth, paddedHeight, borderSize) { + this.loadMeshShader(); + const device = this.#device; + const { + offsetX, + offsetY, + scaleX, + scaleY + } = context; + const posBuffer = device.createBuffer({ + size: Math.max(posData.byteLength, 4), + usage: GPUBufferUsage.VERTEX | GPUBufferUsage.COPY_DST + }); + if (posData.byteLength > 0) { + device.queue.writeBuffer(posBuffer, 0, posData); } - if (!preserve) { - this._pendingBBoxIdx = -1; + const colBuffer = device.createBuffer({ + size: Math.max(colData.byteLength, 4), + usage: GPUBufferUsage.VERTEX | GPUBufferUsage.COPY_DST + }); + if (colData.byteLength > 0) { + device.queue.writeBuffer(colBuffer, 0, colData); } - return this; - } - bboxToClipBoxDropOperation(idx) { - if (this._pendingBBoxIdx === idx) { - this._pendingBBoxIdx = -1; - this.#clipBox[0] = Math.max(this.#clipBox[0], this.#pendingBBox[0]); - this.#clipBox[1] = Math.max(this.#clipBox[1], this.#pendingBBox[1]); - this.#clipBox[2] = Math.min(this.#clipBox[2], this.#pendingBBox[2]); - this.#clipBox[3] = Math.min(this.#clipBox[3], this.#pendingBBox[3]); + const uniformBuffer = device.createBuffer({ + size: 8 * 4, + usage: GPUBufferUsage.UNIFORM | GPUBufferUsage.COPY_DST + }); + device.queue.writeBuffer(uniformBuffer, 0, new Float32Array([offsetX, offsetY, scaleX, scaleY, paddedWidth, paddedHeight, borderSize, 0])); + const bindGroup = device.createBindGroup({ + layout: this.#meshPipeline.getBindGroupLayout(0), + entries: [{ + binding: 0, + resource: { + buffer: uniformBuffer + } + }] + }); + const offscreen = new OffscreenCanvas(paddedWidth, paddedHeight); + const gpuCtx = offscreen.getContext("webgpu"); + gpuCtx.configure({ + device, + format: this.#preferredFormat, + alphaMode: backgroundColor ? "opaque" : "premultiplied" + }); + const clearValue = backgroundColor ? { + r: backgroundColor[0] / 255, + g: backgroundColor[1] / 255, + b: backgroundColor[2] / 255, + a: 1 + } : { + r: 0, + g: 0, + b: 0, + a: 0 + }; + const commandEncoder = device.createCommandEncoder(); + const renderPass = commandEncoder.beginRenderPass({ + colorAttachments: [{ + view: gpuCtx.getCurrentTexture().createView(), + clearValue, + loadOp: "clear", + storeOp: "store" + }] + }); + if (vertexCount > 0) { + renderPass.setPipeline(this.#meshPipeline); + renderPass.setBindGroup(0, bindGroup); + renderPass.setVertexBuffer(0, posBuffer); + renderPass.setVertexBuffer(1, colBuffer); + renderPass.draw(vertexCount); } - return this; - } - take() { - return new BBoxReader(this.#bboxes, this.#bboxesCoords); - } - takeDebugMetadata() { - throw new Error("Unreachable"); - } - recordSimpleData(name, idx) { - return this; - } - recordIncrementalData(name, idx) { - return this; - } - resetIncrementalData(name, idx) { - return this; - } - recordNamedData(name, idx) { - return this; - } - recordSimpleDataFromNamed(name, depName, fallbackIdx) { - return this; - } - recordFutureForcedDependency(name, idx) { - return this; - } - inheritSimpleDataAsFutureForcedDependencies(names) { - return this; - } - inheritPendingDependenciesAsFutureForcedDependencies() { - return this; - } - recordCharacterBBox(idx, ctx, font, scale = 1, x = 0, y = 0, getMeasure) { - return this; - } - getSimpleIndex(dependencyName) { - return undefined; - } - recordDependencies(idx, dependencyNames) { - return this; - } - recordNamedDependency(idx, name) { - return this; - } - recordShowTextOperation(idx, preserve = false) { - return this; - } -} -class CanvasDependencyTracker { - #simple = { - __proto__: null - }; - #incremental = { - __proto__: null, - transform: [], - moveText: [], - sameLineText: [], - [FORCED_DEPENDENCY_LABEL]: [] - }; - #namedDependencies = new Map(); - #pendingDependencies = new Set(); - #fontBBoxTrustworthy = new Map(); - #debugMetadata; - #recordDebugMetadataDepenencyAfterRestore; - #bboxTracker; - constructor(bboxTracker, recordDebugMetadata = false) { - this.#bboxTracker = bboxTracker; - if (recordDebugMetadata) { - this.#debugMetadata = new Map(); - this.#recordDebugMetadataDepenencyAfterRestore = (lastSave, opIdx) => { - ensureDebugMetadata(this.#debugMetadata, opIdx).dependencies.add(lastSave); - }; - } - } - get clipBox() { - return this.#bboxTracker.clipBox; - } - growOperationsCount(operationsCount) { - this.#bboxTracker.growOperationsCount(operationsCount); - } - save(opIdx) { - this.#simple = { - __proto__: this.#simple - }; - this.#incremental = { - __proto__: this.#incremental, - transform: { - __proto__: this.#incremental.transform - }, - moveText: { - __proto__: this.#incremental.moveText - }, - sameLineText: { - __proto__: this.#incremental.sameLineText - }, - [FORCED_DEPENDENCY_LABEL]: { - __proto__: this.#incremental[FORCED_DEPENDENCY_LABEL] - } - }; - this.#bboxTracker.save(opIdx); - return this; - } - restore(opIdx) { - this.#bboxTracker.restore(opIdx, this.#recordDebugMetadataDepenencyAfterRestore); - const previous = Object.getPrototypeOf(this.#simple); - if (previous === null) { - return this; - } - this.#simple = previous; - this.#incremental = Object.getPrototypeOf(this.#incremental); - return this; - } - recordOpenMarker(opIdx) { - this.#bboxTracker.recordOpenMarker(opIdx, this.#recordDebugMetadataDepenencyAfterRestore); - return this; - } - getOpenMarker() { - return this.#bboxTracker.getOpenMarker(); - } - recordCloseMarker(opIdx) { - this.#bboxTracker.recordCloseMarker(opIdx, this.#recordDebugMetadataDepenencyAfterRestore); - return this; - } - beginMarkedContent(opIdx) { - this.#bboxTracker.beginMarkedContent(opIdx); - return this; - } - endMarkedContent(opIdx) { - this.#bboxTracker.endMarkedContent(opIdx, this.#recordDebugMetadataDepenencyAfterRestore); - return this; - } - pushBaseTransform(ctx) { - this.#bboxTracker.pushBaseTransform(ctx); - return this; - } - popBaseTransform() { - this.#bboxTracker.popBaseTransform(); - return this; - } - recordSimpleData(name, idx) { - this.#simple[name] = idx; - return this; - } - recordIncrementalData(name, idx) { - this.#incremental[name].push(idx); - return this; - } - resetIncrementalData(name, idx) { - this.#incremental[name].length = 0; - return this; - } - recordNamedData(name, idx) { - this.#namedDependencies.set(name, idx); - return this; - } - recordSimpleDataFromNamed(name, depName, fallbackIdx) { - this.#simple[name] = this.#namedDependencies.get(depName) ?? fallbackIdx; - } - recordFutureForcedDependency(name, idx) { - this.recordIncrementalData(FORCED_DEPENDENCY_LABEL, idx); - return this; - } - inheritSimpleDataAsFutureForcedDependencies(names) { - for (const name of names) { - if (name in this.#simple) { - this.recordFutureForcedDependency(name, this.#simple[name]); - } - } - return this; - } - inheritPendingDependenciesAsFutureForcedDependencies() { - for (const dep of this.#pendingDependencies) { - this.recordFutureForcedDependency(FORCED_DEPENDENCY_LABEL, dep); - } - return this; - } - resetBBox(idx) { - this.#bboxTracker.resetBBox(idx); - return this; - } - recordClipBox(idx, ctx, minX, maxX, minY, maxY) { - this.#bboxTracker.recordClipBox(idx, ctx, minX, maxX, minY, maxY); - return this; - } - recordBBox(idx, ctx, minX, maxX, minY, maxY) { - this.#bboxTracker.recordBBox(idx, ctx, minX, maxX, minY, maxY); - return this; - } - recordCharacterBBox(idx, ctx, font, scale = 1, x = 0, y = 0, getMeasure) { - const fontBBox = font.bbox; - let isBBoxTrustworthy; - let computedBBox; - if (fontBBox) { - isBBoxTrustworthy = fontBBox[2] !== fontBBox[0] && fontBBox[3] !== fontBBox[1] && this.#fontBBoxTrustworthy.get(font); - if (isBBoxTrustworthy !== false) { - computedBBox = [0, 0, 0, 0]; - Util.axialAlignedBoundingBox(fontBBox, font.fontMatrix, computedBBox); - if (scale !== 1 || x !== 0 || y !== 0) { - scaleCharBBox(scale, -scale, x, y, computedBBox); - } - if (isBBoxTrustworthy) { - return this.recordBBox(idx, ctx, computedBBox[0], computedBBox[2], computedBBox[1], computedBBox[3]); - } - } - } - if (!getMeasure) { - return this.recordFullPageBBox(idx); - } - const measure = getMeasure(); - if (fontBBox && computedBBox && isBBoxTrustworthy === undefined) { - isBBoxTrustworthy = computedBBox[0] <= x - measure.actualBoundingBoxLeft && computedBBox[2] >= x + measure.actualBoundingBoxRight && computedBBox[1] <= y - measure.actualBoundingBoxAscent && computedBBox[3] >= y + measure.actualBoundingBoxDescent; - this.#fontBBoxTrustworthy.set(font, isBBoxTrustworthy); - if (isBBoxTrustworthy) { - return this.recordBBox(idx, ctx, computedBBox[0], computedBBox[2], computedBBox[1], computedBBox[3]); - } - } - return this.recordBBox(idx, ctx, x - measure.actualBoundingBoxLeft, x + measure.actualBoundingBoxRight, y - measure.actualBoundingBoxAscent, y + measure.actualBoundingBoxDescent); - } - recordFullPageBBox(idx) { - this.#bboxTracker.recordFullPageBBox(idx); - return this; - } - getSimpleIndex(dependencyName) { - return this.#simple[dependencyName]; - } - recordDependencies(idx, dependencyNames) { - const pendingDependencies = this.#pendingDependencies; - const simple = this.#simple; - const incremental = this.#incremental; - for (const name of dependencyNames) { - if (name in this.#simple) { - pendingDependencies.add(simple[name]); - } else if (name in incremental) { - incremental[name].forEach(pendingDependencies.add, pendingDependencies); - } - } - return this; - } - recordNamedDependency(idx, name) { - if (this.#namedDependencies.has(name)) { - this.#pendingDependencies.add(this.#namedDependencies.get(name)); - } - return this; - } - recordOperation(idx, preserve = false) { - this.recordDependencies(idx, [FORCED_DEPENDENCY_LABEL]); - if (this.#debugMetadata) { - const metadata = ensureDebugMetadata(this.#debugMetadata, idx); - const { - dependencies - } = metadata; - this.#pendingDependencies.forEach(dependencies.add, dependencies); - this.#bboxTracker._savesStack.forEach(dependencies.add, dependencies); - this.#bboxTracker._markedContentStack.forEach(dependencies.add, dependencies); - dependencies.delete(idx); - metadata.isRenderingOperation = true; - } - const needsCleanup = !preserve && idx === this.#bboxTracker._pendingBBoxIdx; - this.#bboxTracker.recordOperation(idx, preserve, [this.#pendingDependencies, this.#bboxTracker._savesStack, this.#bboxTracker._markedContentStack]); - if (needsCleanup) { - this.#pendingDependencies.clear(); - } - return this; - } - recordShowTextOperation(idx, preserve = false) { - const deps = Array.from(this.#pendingDependencies); - this.recordOperation(idx, preserve); - this.recordIncrementalData("sameLineText", idx); - for (const dep of deps) { - this.recordIncrementalData("sameLineText", dep); - } - return this; - } - bboxToClipBoxDropOperation(idx, preserve = false) { - const needsCleanup = !preserve && idx === this.#bboxTracker._pendingBBoxIdx; - this.#bboxTracker.bboxToClipBoxDropOperation(idx); - if (needsCleanup) { - this.#pendingDependencies.clear(); - } - return this; - } - take() { - this.#fontBBoxTrustworthy.clear(); - return this.#bboxTracker.take(); - } - takeDebugMetadata() { - return this.#debugMetadata; - } -} -class CanvasNestedDependencyTracker { - #dependencyTracker; - #opIdx; - #ignoreBBoxes; - #nestingLevel = 0; - #savesLevel = 0; - constructor(dependencyTracker, opIdx, ignoreBBoxes) { - if (dependencyTracker instanceof CanvasNestedDependencyTracker && dependencyTracker.#ignoreBBoxes === !!ignoreBBoxes) { - return dependencyTracker; - } - this.#dependencyTracker = dependencyTracker; - this.#opIdx = opIdx; - this.#ignoreBBoxes = !!ignoreBBoxes; - } - get clipBox() { - return this.#dependencyTracker.clipBox; - } - growOperationsCount() { - throw new Error("Unreachable"); - } - save(opIdx) { - this.#savesLevel++; - this.#dependencyTracker.save(this.#opIdx); - return this; - } - restore(opIdx) { - if (this.#savesLevel > 0) { - this.#dependencyTracker.restore(this.#opIdx); - this.#savesLevel--; - } - return this; - } - recordOpenMarker(idx) { - this.#nestingLevel++; - return this; - } - getOpenMarker() { - return this.#nestingLevel > 0 ? this.#opIdx : this.#dependencyTracker.getOpenMarker(); - } - recordCloseMarker(idx) { - this.#nestingLevel--; - return this; - } - beginMarkedContent(opIdx) { - return this; - } - endMarkedContent(opIdx) { - return this; - } - pushBaseTransform(ctx) { - this.#dependencyTracker.pushBaseTransform(ctx); - return this; - } - popBaseTransform() { - this.#dependencyTracker.popBaseTransform(); - return this; - } - recordSimpleData(name, idx) { - this.#dependencyTracker.recordSimpleData(name, this.#opIdx); - return this; - } - recordIncrementalData(name, idx) { - this.#dependencyTracker.recordIncrementalData(name, this.#opIdx); - return this; - } - resetIncrementalData(name, idx) { - this.#dependencyTracker.resetIncrementalData(name, this.#opIdx); - return this; - } - recordNamedData(name, idx) { - return this; - } - recordSimpleDataFromNamed(name, depName, fallbackIdx) { - this.#dependencyTracker.recordSimpleDataFromNamed(name, depName, this.#opIdx); - return this; - } - recordFutureForcedDependency(name, idx) { - this.#dependencyTracker.recordFutureForcedDependency(name, this.#opIdx); - return this; - } - inheritSimpleDataAsFutureForcedDependencies(names) { - this.#dependencyTracker.inheritSimpleDataAsFutureForcedDependencies(names); - return this; - } - inheritPendingDependenciesAsFutureForcedDependencies() { - this.#dependencyTracker.inheritPendingDependenciesAsFutureForcedDependencies(); - return this; - } - resetBBox(idx) { - if (!this.#ignoreBBoxes) { - this.#dependencyTracker.resetBBox(this.#opIdx); - } - return this; - } - recordClipBox(idx, ctx, minX, maxX, minY, maxY) { - if (!this.#ignoreBBoxes) { - this.#dependencyTracker.recordClipBox(this.#opIdx, ctx, minX, maxX, minY, maxY); - } - return this; - } - recordBBox(idx, ctx, minX, maxX, minY, maxY) { - if (!this.#ignoreBBoxes) { - this.#dependencyTracker.recordBBox(this.#opIdx, ctx, minX, maxX, minY, maxY); - } - return this; - } - recordCharacterBBox(idx, ctx, font, scale, x, y, getMeasure) { - if (!this.#ignoreBBoxes) { - this.#dependencyTracker.recordCharacterBBox(this.#opIdx, ctx, font, scale, x, y, getMeasure); - } - return this; - } - recordFullPageBBox(idx) { - if (!this.#ignoreBBoxes) { - this.#dependencyTracker.recordFullPageBBox(this.#opIdx); - } - return this; - } - getSimpleIndex(dependencyName) { - return this.#dependencyTracker.getSimpleIndex(dependencyName); - } - recordDependencies(idx, dependencyNames) { - this.#dependencyTracker.recordDependencies(this.#opIdx, dependencyNames); - return this; - } - recordNamedDependency(idx, name) { - this.#dependencyTracker.recordNamedDependency(this.#opIdx, name); - return this; - } - recordOperation(idx) { - this.#dependencyTracker.recordOperation(this.#opIdx, true); - return this; - } - recordShowTextOperation(idx) { - this.#dependencyTracker.recordShowTextOperation(this.#opIdx, true); - return this; - } - bboxToClipBoxDropOperation(idx) { - if (!this.#ignoreBBoxes) { - this.#dependencyTracker.bboxToClipBoxDropOperation(this.#opIdx, true); - } - return this; - } - take() { - throw new Error("Unreachable"); - } - takeDebugMetadata() { - throw new Error("Unreachable"); - } -} -const Dependencies = { - stroke: ["path", "transform", "filter", "strokeColor", "strokeAlpha", "lineWidth", "lineCap", "lineJoin", "miterLimit", "dash"], - fill: ["path", "transform", "filter", "fillColor", "fillAlpha", "globalCompositeOperation", "SMask"], - imageXObject: ["transform", "SMask", "filter", "fillAlpha", "strokeAlpha", "globalCompositeOperation"], - rawFillPath: ["filter", "fillColor", "fillAlpha"], - showText: ["transform", "leading", "charSpacing", "wordSpacing", "hScale", "textRise", "moveText", "textMatrix", "font", "fontObj", "filter", "fillColor", "textRenderingMode", "SMask", "fillAlpha", "strokeAlpha", "globalCompositeOperation", "sameLineText"], - transform: ["transform"], - transformAndFill: ["transform", "filter", "fillColor"] -}; -class CanvasImagesTracker { - #canvasWidth; - #canvasHeight; - #capacity = 4; - #count = 0; - #coords = new CanvasImagesTracker.#CoordsArray(this.#capacity * 6); - static #CoordsArray = FeatureTest.isFloat16ArraySupported ? Float16Array : Float32Array; - constructor(canvas) { - this.#canvasWidth = canvas.width; - this.#canvasHeight = canvas.height; - } - record(ctx, width, height, clipBox) { - if (this.#count === this.#capacity) { - this.#capacity *= 2; - const newCoords = new CanvasImagesTracker.#CoordsArray(this.#capacity * 6); - newCoords.set(this.#coords); - this.#coords = newCoords; - } - const transform = getCurrentTransform(ctx); - let coords; - if (clipBox[0] !== Infinity) { - const bbox = BBOX_INIT.slice(); - Util.axialAlignedBoundingBox([0, -height, width, 0], transform, bbox); - const finalBBox = Util.intersect(clipBox, bbox); - if (!finalBBox) { - return; - } - const [minX, minY, maxX, maxY] = finalBBox; - if (minX !== bbox[0] || minY !== bbox[1] || maxX !== bbox[2] || maxY !== bbox[3]) { - const rotationAngle = Math.atan2(transform[1], transform[0]); - const sin = Math.abs(Math.sin(rotationAngle)); - const cos = Math.abs(Math.cos(rotationAngle)); - if (sin < 1e-6 || cos < 1e-6 || Math.abs(sin - cos) < 1e-6) { - coords = [minX, minY, minX, maxY, maxX, minY]; - } else { - const finalBBoxWidth = maxX - minX; - const finalBBoxHeight = maxY - minY; - const sin2 = sin * sin; - const cos2 = cos * cos; - const cosSin = cos * sin; - const denom = cos2 - sin2; - const a = (finalBBoxHeight * cos2 - finalBBoxWidth * cosSin) / denom; - const b = (finalBBoxHeight * cosSin - finalBBoxWidth * sin2) / denom; - coords = [minX + b, minY, minX, minY + a, maxX, maxY - a]; - } - } - } - if (!coords) { - coords = [0, -height, 0, 0, width, -height]; - Util.applyTransform(coords, transform, 0); - Util.applyTransform(coords, transform, 2); - Util.applyTransform(coords, transform, 4); - } - coords[0] /= this.#canvasWidth; - coords[1] /= this.#canvasHeight; - coords[2] /= this.#canvasWidth; - coords[3] /= this.#canvasHeight; - coords[4] /= this.#canvasWidth; - coords[5] /= this.#canvasHeight; - this.#coords.set(coords, this.#count * 6); - this.#count++; - } - take() { - return this.#coords.subarray(0, this.#count * 6); - } -} - -;// ./src/shared/css_utils.js -const CONTROL_CHAR_REGEXP = /\p{Cc}/u; -function isCSSString(str) { - const quote = str[0]; - if (str.length < 2 || quote !== `"` && quote !== `'` || str.at(-1) !== quote) { - return false; - } - const end = str.length - 1; - for (let i = 1; i < end; i++) { - const char = str[i]; - if (char === quote || CONTROL_CHAR_REGEXP.test(char)) { - return false; - } - if (char === "\\") { - if (++i >= end || CONTROL_CHAR_REGEXP.test(str[i])) { - return false; - } - } - } - return true; -} -function serializeFontFamily(fontFamily) { - if (isCSSString(fontFamily)) { - return fontFamily; - } - const escaped = fontFamily.replaceAll(/["\\\p{Cc}]/gu, char => char === `"` || char === "\\" ? `\\${char}` : `\\${char.codePointAt(0).toString(16)} `); - return `"${escaped}"`; -} - -;// ./src/display/font_loader.js - - - - - - - - - - - - - - - - - -class FontLoader { - #nativeFontFaces = new Set(); - #systemFonts = new Set(); - #styleSheet = null; - constructor({ - ownerDocument = globalThis.document, - styleElement = null - }) { - this._document = ownerDocument; - this.styleElement = null; - this.loadingRequests = []; - this.loadTestFontId = 0; - } - addNativeFontFace(nativeFontFace) { - this.#nativeFontFaces.add(nativeFontFace); - this._document.fonts.add(nativeFontFace); - } - removeNativeFontFace(nativeFontFace) { - this.#nativeFontFaces.delete(nativeFontFace); - this._document.fonts.delete(nativeFontFace); - } - insertRule(rule) { - const styleSheet = this.#getStyleSheet(); - styleSheet.insertRule(rule, styleSheet.cssRules.length); - } - #getStyleSheet() { - if (this.#styleSheet) { - return this.#styleSheet; - } - const StyleSheet = this._document.defaultView?.CSSStyleSheet || globalThis.CSSStyleSheet; - if (!this.styleElement && StyleSheet) { - const { - adoptedStyleSheets - } = this._document; - if (adoptedStyleSheets) { - const styleSheet = new StyleSheet(); - adoptedStyleSheets.push(styleSheet); - return this.#styleSheet = styleSheet; - } - } - if (!this.styleElement) { - this.styleElement = this._document.createElement("style"); - this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement); - } - return this.#styleSheet = this.styleElement.sheet; - } - clear() { - for (const nativeFontFace of this.#nativeFontFaces) { - this._document.fonts.delete(nativeFontFace); - } - this.#nativeFontFaces.clear(); - this.#systemFonts.clear(); - if (this.#styleSheet) { - const { - adoptedStyleSheets - } = this._document; - if (adoptedStyleSheets?.includes(this.#styleSheet)) { - this._document.adoptedStyleSheets = adoptedStyleSheets.filter(styleSheet => styleSheet !== this.#styleSheet); - } - this.#styleSheet = null; - } - this.styleElement?.remove(); - this.styleElement = null; - } - async loadSystemFont({ - systemFontInfo: info, - disableFontFace, - _inspectFont - }) { - if (!info || this.#systemFonts.has(info.loadedName)) { - return; - } - util_assert(!disableFontFace, "loadSystemFont shouldn't be called when `disableFontFace` is set."); - if (this.isFontLoadingAPISupported) { - const { - loadedName, - src, - style - } = info; - const fontFace = new FontFace(loadedName, src, style); - this.addNativeFontFace(fontFace); - try { - await fontFace.load(); - this.#systemFonts.add(loadedName); - _inspectFont?.(info); - } catch { - warn(`Cannot load system font: ${info.baseFontName}, installing it could help to improve PDF rendering.`); - this.removeNativeFontFace(fontFace); - } - return; - } - unreachable("Not implemented: loadSystemFont without the Font Loading API."); - } - async bind(font) { - if (font.attached || font.missingFile && !font.systemFontInfo) { - return; - } - font.attached = true; - if (font.systemFontInfo) { - await this.loadSystemFont(font); - return; - } - if (this.isFontLoadingAPISupported) { - const nativeFontFace = font.createNativeFontFace(); - if (nativeFontFace) { - this.addNativeFontFace(nativeFontFace); - try { - await nativeFontFace.loaded; - } catch (ex) { - warn(`Failed to load font '${nativeFontFace.family}': '${ex}'.`); - font.disableFontFace = true; - throw ex; - } - } - return; - } - const rule = font.createFontFaceRule(); - if (rule) { - this.insertRule(rule); - if (this.isSyncFontLoadingSupported) { - return; - } - await this.#testFontLoaded(font); - } - } - get isFontLoadingAPISupported() { - return util_shadow(this, "isFontLoadingAPISupported", !!this._document?.fonts); - } - get isSyncFontLoadingSupported() { - return util_shadow(this, "isSyncFontLoadingSupported", isNodeJS || FeatureTest.platform.isFirefox); - } - #testFontLoaded(font) { - function completeRequest() { - util_assert(!request.done, "completeRequest() cannot be called twice."); - request.done = true; - while (loadingRequests.length > 0 && loadingRequests[0].done) { - const otherRequest = loadingRequests.shift(); - setTimeout(otherRequest.resolve, 0); - } - } - const { - loadingRequests - } = this; - const { - promise, - resolve - } = Promise.withResolvers(); - const request = { - done: false, - resolve - }; - loadingRequests.push(request); - this._loadTestFont ??= atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQA" + "FQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAA" + "ALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYX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AAAAQAAAAAAAAAAAAAAAAAA" + "AAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQAC" + "AQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3" + "Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTj" + "FQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA=="); - function int32(data, offset) { - return data.charCodeAt(offset) << 24 | data.charCodeAt(offset + 1) << 16 | data.charCodeAt(offset + 2) << 8 | data.charCodeAt(offset + 3) & 0xff; - } - function string32(value) { - return String.fromCharCode(value >> 24 & 0xff, value >> 16 & 0xff, value >> 8 & 0xff, value & 0xff); - } - function spliceString(s, offset, remove, insert) { - const chunk1 = s.substring(0, offset); - const chunk2 = s.substring(offset + remove); - return chunk1 + insert + chunk2; - } - let i, ii; - const canvas = this._document.createElement("canvas"); - canvas.width = 1; - canvas.height = 1; - const ctx = canvas.getContext("2d"); - let called = 0; - function isFontReady(name, callback) { - if (++called > 30) { - warn("Load test font never loaded."); - callback(); - return; - } - ctx.font = "30px " + name; - ctx.fillText(".", 0, 20); - const imageData = ctx.getImageData(0, 0, 1, 1); - if (imageData.data[3] > 0) { - callback(); - return; - } - setTimeout(isFontReady.bind(null, name, callback)); - } - const loadTestFontId = `lt${Date.now()}${this.loadTestFontId++}`; - let data = this._loadTestFont; - const COMMENT_OFFSET = 976; - data = spliceString(data, COMMENT_OFFSET, loadTestFontId.length, loadTestFontId); - const CFF_CHECKSUM_OFFSET = 16; - const XXXX_VALUE = 0x58585858; - let checksum = int32(data, CFF_CHECKSUM_OFFSET); - for (i = 0, ii = loadTestFontId.length - 3; i < ii; i += 4) { - checksum = checksum - XXXX_VALUE + int32(loadTestFontId, i) | 0; - } - if (i < loadTestFontId.length) { - checksum = checksum - XXXX_VALUE + int32(loadTestFontId + "XXX", i) | 0; - } - data = spliceString(data, CFF_CHECKSUM_OFFSET, 4, string32(checksum)); - const url = `url(data:font/opentype;base64,${btoa(data)});`; - const rule = `@font-face {font-family:"${loadTestFontId}";src:${url}}`; - this.insertRule(rule); - const div = this._document.createElement("div"); - div.style.visibility = "hidden"; - div.style.width = div.style.height = "10px"; - div.style.position = "absolute"; - div.style.top = div.style.left = "0px"; - for (const name of [font.loadedName, loadTestFontId]) { - const span = this._document.createElement("span"); - span.textContent = "Hi"; - span.style.fontFamily = name; - div.append(span); - } - this._document.body.append(div); - isFontReady(loadTestFontId, () => { - div.remove(); - completeRequest(); - }); - return promise; - } -} -class FontFaceObject { - #compiledPaths = new Map(); - #fontData; - constructor(translatedData, inspectFont = null, charProcOperatorList, extra) { - this.#fontData = translatedData; - this._inspectFont = inspectFont; - if (charProcOperatorList) { - this.charProcOperatorList = charProcOperatorList; - } - if (extra) { - Object.assign(this, extra); - } - } - createNativeFontFace() { - const { - data - } = this; - if (!data || this.disableFontFace) { - return null; - } - let nativeFontFace; - if (!this.cssFontInfo) { - nativeFontFace = new FontFace(this.loadedName, data, {}); - } else { - const css = { - weight: this.cssFontInfo.fontWeight - }; - if (this.cssFontInfo.italicAngle) { - css.style = `oblique ${this.cssFontInfo.italicAngle}deg`; - } - nativeFontFace = new FontFace(serializeFontFamily(this.cssFontInfo.fontFamily), data, css); - } - this._inspectFont?.(this); - return nativeFontFace; - } - createFontFaceRule() { - const { - data - } = this; - if (!data || this.disableFontFace) { - return null; - } - const url = `url(data:${this.mimetype};base64,${data.toBase64()});`; - let rule; - if (!this.cssFontInfo) { - rule = `@font-face {font-family:"${this.loadedName}";src:${url}}`; - } else { - let css = `font-weight: ${this.cssFontInfo.fontWeight};`; - if (this.cssFontInfo.italicAngle) { - css += `font-style: oblique ${this.cssFontInfo.italicAngle}deg;`; - } - const fontFamily = serializeFontFamily(this.cssFontInfo.fontFamily); - rule = `@font-face {font-family:${fontFamily};${css}src:${url}}`; - } - this._inspectFont?.(this, url); - return rule; - } - getPathGenerator(objs, character) { - let path = this.#compiledPaths.get(character); - if (path) { - return path; - } - const objId = `${this.loadedName}_path_${character}`; - let cmds; - try { - cmds = objs.get(objId); - } catch (ex) { - warn(`getPathGenerator - ignoring character: "${ex}".`); - } - path = makePathFromDrawOPS(cmds?.path); - if (!this.fontExtraProperties) { - objs.delete(objId); - } - this.#compiledPaths.set(character, path); - return path; - } - get black() { - return this.#fontData.black; - } - get bold() { - return this.#fontData.bold; - } - get disableFontFace() { - return this.#fontData.disableFontFace; - } - set disableFontFace(value) { - util_shadow(this, "disableFontFace", !!value); - } - get fontExtraProperties() { - return this.#fontData.fontExtraProperties; - } - get isInvalidPDFjsFont() { - return this.#fontData.isInvalidPDFjsFont; - } - get isType3Font() { - return this.#fontData.isType3Font; - } - get italic() { - return this.#fontData.italic; - } - get missingFile() { - return this.#fontData.missingFile; - } - get remeasure() { - return this.#fontData.remeasure; - } - get vertical() { - return this.#fontData.vertical; - } - get bbox() { - return this.#fontData.bbox; - } - get fontMatrix() { - return this.#fontData.fontMatrix; - } - get fallbackName() { - return this.#fontData.fallbackName; - } - get loadedName() { - return this.#fontData.loadedName; - } - get mimetype() { - return this.missingFile ? null : "font/opentype"; - } - get data() { - return this.#fontData.data; - } - clearData() { - this.#fontData.clearData(); - } - get cssFontInfo() { - return this.#fontData.cssFontInfo; - } - get systemFontInfo() { - return this.#fontData.systemFontInfo; - } -} - -;// ./src/shared/obj_bin_transform_utils.js - -class CSS_FONT_INFO { - static strings = ["fontFamily", "fontWeight", "italicAngle"]; -} -class SYSTEM_FONT_INFO { - static strings = ["css", "loadedName", "baseFontName", "src"]; -} -class FONT_INFO { - static bools = ["black", "bold", "disableFontFace", "fontExtraProperties", "isInvalidPDFjsFont", "isType3Font", "italic", "missingFile", "remeasure", "vertical"]; - static strings = ["fallbackName", "loadedName"]; - static OFFSET_BBOX = Math.ceil(this.bools.length * 2 / 8); - static OFFSET_FONT_MATRIX = this.OFFSET_BBOX + 1 + 2 * 4; - static OFFSET_STRINGS = this.OFFSET_FONT_MATRIX + 1 + 8 * 6; -} -class PATTERN_INFO { - static KIND = 0; - static HAS_BBOX = 1; - static HAS_BACKGROUND = 2; - static SHADING_TYPE = 3; - static N_COORD = 4; - static N_COLOR = 8; - static N_STOP = 12; - static N_FIGURES = 16; -} -class InfoUtils { - static get decoder() { - return util_shadow(this, "decoder", new TextDecoder()); - } - static get encoder() { - return util_shadow(this, "encoder", new TextEncoder()); - } -} - -;// ./src/display/obj_bin_transform_display.js - - - - - - - - -function readString(buffer, view, index, offset = 0) { - const { - decoder - } = InfoUtils; - for (let i = 0; i < index; i++) { - offset += view.getUint32(offset) + 4; - } - const length = view.getUint32(offset); - return decoder.decode(new Uint8Array(buffer, offset + 4, length)); -} -class CssFontInfo { - #buffer; - #view; - constructor(buffer) { - this.#buffer = buffer; - this.#view = new DataView(buffer); - } - #readString(index) { - util_assert(index < CSS_FONT_INFO.strings.length, "Invalid string index"); - return readString(this.#buffer, this.#view, index); - } - get fontFamily() { - return util_shadow(this, "fontFamily", this.#readString(0)); - } - get fontWeight() { - return util_shadow(this, "fontWeight", this.#readString(1)); - } - get italicAngle() { - return util_shadow(this, "italicAngle", this.#readString(2)); - } -} -class SystemFontInfo { - #buffer; - #view; - constructor(buffer) { - this.#buffer = buffer; - this.#view = new DataView(buffer); - } - #readString(index) { - util_assert(index < SYSTEM_FONT_INFO.strings.length, "Invalid string index"); - return readString(this.#buffer, this.#view, index, 4); - } - get css() { - return util_shadow(this, "css", this.#readString(0)); - } - get loadedName() { - return util_shadow(this, "loadedName", this.#readString(1)); - } - get baseFontName() { - return util_shadow(this, "baseFontName", this.#readString(2)); - } - get src() { - return util_shadow(this, "src", this.#readString(3)); - } - get style() { - let offset = 0; - offset += 4 + this.#view.getUint32(offset); - const style = readString(this.#buffer, this.#view, 0, offset), - weight = readString(this.#buffer, this.#view, 1, offset); - return util_shadow(this, "style", { - style, - weight - }); - } -} -class FontInfo { - #buffer; - #view; - constructor(buffer) { - this.#buffer = buffer; - this.#view = new DataView(buffer); - } - #readBoolean(index) { - util_assert(index < FONT_INFO.bools.length, "Invalid boolean index"); - const byteOffset = Math.floor(index / 4); - const bitOffset = index * 2 % 8; - const value = this.#view.getUint8(byteOffset) >> bitOffset & 0x03; - return value === 0x00 ? undefined : value === 0x02; - } - get black() { - return util_shadow(this, "black", this.#readBoolean(0)); - } - get bold() { - return util_shadow(this, "bold", this.#readBoolean(1)); - } - get disableFontFace() { - return util_shadow(this, "disableFontFace", this.#readBoolean(2)); - } - get fontExtraProperties() { - return util_shadow(this, "fontExtraProperties", this.#readBoolean(3)); - } - get isInvalidPDFjsFont() { - return util_shadow(this, "isInvalidPDFjsFont", this.#readBoolean(4)); - } - get isType3Font() { - return util_shadow(this, "isType3Font", this.#readBoolean(5)); - } - get italic() { - return util_shadow(this, "italic", this.#readBoolean(6)); - } - get missingFile() { - return util_shadow(this, "missingFile", this.#readBoolean(7)); - } - get remeasure() { - return util_shadow(this, "remeasure", this.#readBoolean(8)); - } - get vertical() { - return util_shadow(this, "vertical", this.#readBoolean(9)); - } - #readArray(offset, arrLen, lookupName, increment) { - const len = this.#view.getUint8(offset++); - if (len === 0) { - return undefined; - } - util_assert(len === arrLen, "Invalid array length."); - const arr = new Array(len); - for (let i = 0; i < len; i++) { - arr[i] = this.#view[lookupName](offset, true); - offset += increment; - } - return arr; - } - get bbox() { - return util_shadow(this, "bbox", this.#readArray(FONT_INFO.OFFSET_BBOX, 4, "getInt16", 2)); - } - get fontMatrix() { - return util_shadow(this, "fontMatrix", this.#readArray(FONT_INFO.OFFSET_FONT_MATRIX, 6, "getFloat64", 8)); - } - #readString(index) { - util_assert(index < FONT_INFO.strings.length, "Invalid string index"); - return readString(this.#buffer, this.#view, index, FONT_INFO.OFFSET_STRINGS + 4); - } - get fallbackName() { - return util_shadow(this, "fallbackName", this.#readString(0)); - } - get loadedName() { - return util_shadow(this, "loadedName", this.#readString(1)); - } - #getBufferOffset(index) { - let offset = FONT_INFO.OFFSET_STRINGS; - for (let i = 0; i <= index; i++) { - offset += 4 + this.#view.getUint32(offset); - } - const length = this.#view.getUint32(offset); - return { - offset, - length - }; - } - get data() { - const { - offset, - length - } = this.#getBufferOffset(2); - return !length ? undefined : new Uint8Array(this.#buffer, offset + 4, length); - } - clearData() { - const { - offset, - length - } = this.#getBufferOffset(2); - if (!length) { - return; - } - this.#view.setUint32(offset, 0); - this.#buffer = new Uint8Array(this.#buffer, 0, offset + 4).slice().buffer; - this.#view = new DataView(this.#buffer); - } - get cssFontInfo() { - const { - offset, - length - } = this.#getBufferOffset(1); - let info = null; - if (length) { - const data = new Uint8Array(this.#buffer, offset + 4, length).slice(); - info = new CssFontInfo(data.buffer); - } - return util_shadow(this, "cssFontInfo", info); - } - get systemFontInfo() { - const { - offset, - length - } = this.#getBufferOffset(0); - let info = null; - if (length) { - const data = new Uint8Array(this.#buffer, offset + 4, length).slice(); - info = new SystemFontInfo(data.buffer); - } - return util_shadow(this, "systemFontInfo", info); - } -} -class PatternInfo { - constructor(buffer) { - this.buffer = buffer; - this.view = new DataView(buffer); - this.data = new Uint8Array(buffer); - } - getIR() { - const dataView = this.view; - const kind = this.data[PATTERN_INFO.KIND]; - const hasBBox = !!this.data[PATTERN_INFO.HAS_BBOX]; - const hasBackground = !!this.data[PATTERN_INFO.HAS_BACKGROUND]; - const nCoord = dataView.getUint32(PATTERN_INFO.N_COORD, true); - const nColor = dataView.getUint32(PATTERN_INFO.N_COLOR, true); - const nStop = dataView.getUint32(PATTERN_INFO.N_STOP, true); - let offset = 20; - const coords = new Float32Array(this.buffer, offset, nCoord * 2); - offset += nCoord * 8; - const colors = new Uint8Array(this.buffer, offset, nColor * 4); - offset += nColor * 4; - const stops = []; - for (let i = 0; i < nStop; ++i) { - const p = dataView.getFloat32(offset, true); - offset += 4; - const rgb = dataView.getUint32(offset, true); - offset += 4; - stops.push([p, `#${rgb.toString(16).padStart(6, "0")}`]); - } - let bbox = null; - if (hasBBox) { - bbox = []; - for (let i = 0; i < 4; ++i) { - bbox.push(dataView.getFloat32(offset, true)); - offset += 4; - } - } - let background = null; - if (hasBackground) { - background = new Uint8Array(this.buffer, offset, 3); - offset += 3; - } - if (kind === 1) { - return ["RadialAxial", "axial", bbox, stops, [coords[0], coords[1]], [coords[2], coords[3]], null, null]; - } - if (kind === 2) { - return ["RadialAxial", "radial", bbox, stops, [coords[0], coords[1]], [coords[3], coords[4]], coords[2], coords[5]]; - } - if (kind === 3) { - const shadingType = this.data[PATTERN_INFO.SHADING_TYPE]; - let bounds = null; - if (coords.length > 0) { - bounds = BBOX_INIT.slice(); - for (let i = 0, ii = coords.length; i < ii; i += 2) { - Util.pointBoundingBox(coords[i], coords[i + 1], bounds); - } - } - return ["Mesh", shadingType, coords, colors, nCoord, bounds, bbox, background]; - } - throw new Error(`Unsupported pattern kind: ${kind}`); - } -} -class FontPathInfo { - #buffer; - constructor(buffer) { - this.#buffer = buffer; - } - get path() { - if (FeatureTest.isFloat16ArraySupported) { - return new Float16Array(this.#buffer); - } - return new Float32Array(this.#buffer); - } -} - -;// ./src/display/api_utils.js - - - - - - - - - - -function getUrlProp(val) { - if (val instanceof URL) { - return val; - } - if (typeof val === "string") { - if (isNodeJS) { - if (/^[a-z][a-z0-9\-+.]+:/i.test(val)) { - return new URL(val); - } - const url = process.getBuiltinModule("url"); - return new URL(url.pathToFileURL(val)); - } - const url = URL.parse(val, window.location); - if (url) { - return url; - } - } - throw new Error("Invalid PDF url data: " + "either string or URL-object is expected in the url property."); -} -function getDataProp(val) { - if (isNodeJS && typeof Buffer !== "undefined" && val instanceof Buffer) { - throw new Error("Please provide binary data as `Uint8Array`, rather than `Buffer`."); - } - if (val instanceof Uint8Array && val.byteLength === val.buffer.byteLength) { - return val; - } - if (typeof val === "string") { - return stringToBytes(val); - } - if (val instanceof ArrayBuffer || ArrayBuffer.isView(val) || typeof val === "object" && !isNaN(val?.length)) { - return new Uint8Array(val); - } - throw new Error("Invalid PDF binary data: either TypedArray, " + "string, or array-like object is expected in the data property."); -} -function getFactoryUrlProp(val) { - if (typeof val !== "string") { - return null; - } - if (val.endsWith("/")) { - return val; - } - throw new Error(`Invalid factory url: "${val}" must include trailing slash.`); -} -const isRefProxy = v => typeof v === "object" && Number.isInteger(v?.num) && v.num >= 0 && Number.isInteger(v?.gen) && v.gen >= 0; -const isNameProxy = v => typeof v === "object" && typeof v?.name === "string"; -const isValidExplicitDest = _isValidExplicitDest.bind(null, isRefProxy, isNameProxy); -class LoopbackPort { - #listeners = new Map(); - #deferred = Promise.resolve(); - postMessage(obj, transfer) { - const event = { - data: structuredClone(obj, transfer ? { - transfer - } : null) - }; - this.#deferred.then(() => { - for (const [listener] of this.#listeners) { - listener.call(this, event); - } - }); - } - addEventListener(name, listener, options = null) { - let rmAbort = null; - if (options?.signal instanceof AbortSignal) { - const { - signal - } = options; - if (signal.aborted) { - warn("LoopbackPort - cannot use an `aborted` signal."); - return; - } - const onAbort = () => this.removeEventListener(name, listener); - rmAbort = () => signal.removeEventListener("abort", onAbort); - signal.addEventListener("abort", onAbort); - } - this.#listeners.set(listener, rmAbort); - } - removeEventListener(name, listener) { - const rmAbort = this.#listeners.get(listener); - rmAbort?.(); - this.#listeners.delete(listener); - } - terminate() { - for (const [, rmAbort] of this.#listeners) { - rmAbort?.(); - } - this.#listeners.clear(); + renderPass.end(); + device.queue.submit([commandEncoder.finish()]); + posBuffer.destroy(); + colBuffer.destroy(); + uniformBuffer.destroy(); + return offscreen.transferToImageBitmap(); } } +const _webGPU = new WebGPU(); +function initGPU() { + return _webGPU.init(); +} +function isGPUReady() { + return _webGPU.isReady; +} +function loadMeshShader() { + _webGPU.loadMeshShader(); +} +function drawMeshWithGPU(posData, colData, vertexCount, context, backgroundColor, paddedWidth, paddedHeight, borderSize) { + return _webGPU.draw(posData, colData, vertexCount, context, backgroundColor, paddedWidth, paddedHeight, borderSize); +} ;// ./node_modules/core-js/modules/es.promise.try.js es_promise_try_namespaceFn(); @@ -14886,8 +13692,8 @@ function wrapReason(ex) { if (ex instanceof AbortException || ex instanceof InvalidPDFException || ex instanceof PasswordException || ex instanceof ResponseException || ex instanceof UnknownErrorException) { return ex; } - if (!(ex instanceof Error || typeof ex === "object" && ex !== null)) { - unreachable('wrapReason: Expected "reason" to be a (possibly cloned) Error.'); + if (typeof ex !== "object" || ex === null) { + return new UnknownErrorException(String(ex), String(ex)); } switch (ex.name) { case "AbortException": @@ -14967,7 +13773,7 @@ class MessageHandler { callbackId: data.callbackId, data: result }); - }, reason => { + }).catch(reason => { comObj.postMessage({ sourceName, targetName, @@ -15109,7 +13915,6 @@ class MessageHandler { streamSinks.delete(streamId); }, error(reason) { - util_assert(reason instanceof Error, "error must have a valid reason"); if (this.isCancelled) { return; } @@ -15272,6 +14077,9 @@ class MessageHandler { this.#messageAC?.abort(); this.#messageAC = null; } + get destroyed() { + return !this.#messageAC; + } } ;// ./src/display/binary_data_factory.js @@ -15374,495 +14182,914 @@ class BaseCanvasFactory { canvasAndContext.canvas = null; canvasAndContext.context = null; } + getNoAlphaContext(canvas) { + return canvas.getContext("2d", { + alpha: false, + willReadFrequently: !this.#enableHWA + }); + } _createCanvas(width, height) { unreachable("Abstract method `_createCanvas` called."); } -} -class DOMCanvasFactory extends BaseCanvasFactory { - constructor({ - ownerDocument = globalThis.document, - enableHWA = false - }) { - super({ - enableHWA - }); - this._document = ownerDocument; +} + +;// ./src/display/filter_factory.js + +class BaseFilterFactory { + addFilter(maps) { + return "none"; + } + addHCMFilter(fgColor, bgColor) { + return "none"; + } + addAlphaFilter(map) { + return "none"; + } + addLuminosityFilter(map) { + return "none"; + } + addKnockoutFilter(alpha = 0) { + return "none"; + } + addHighlightHCMFilter(filterName, fgColor, bgColor, newFgColor, newBgColor) { + return "none"; + } + addSelectionHCMFilter(fgColor, bgColor) { + return "none"; + } + addSelectionFilter() { + return "none"; + } + createSelectionStyle(pageColors = null) { + return null; + } + destroy(keepHCM = false) {} +} + +;// ./src/display/node_utils.js + + + + + + + + + +if (isNodeJS) { + let canvas; + try { + const require = process.getBuiltinModule("module").createRequire(import.meta.url); + try { + canvas = require("@napi-rs/canvas"); + } catch (ex) { + warn(`Cannot load "@napi-rs/canvas" package: "${ex}".`); + } + } catch (ex) { + warn(`Cannot access the \`require\` function: "${ex}".`); + } + if (!globalThis.DOMMatrix) { + if (canvas?.DOMMatrix) { + globalThis.DOMMatrix = canvas.DOMMatrix; + } else { + warn("Cannot polyfill `DOMMatrix`, rendering may be broken."); + } + } + if (!globalThis.Path2D) { + if (canvas?.Path2D) { + globalThis.Path2D = canvas.Path2D; + } else { + warn("Cannot polyfill `Path2D`, rendering may be broken."); + } + } + if (!globalThis.navigator?.language) { + globalThis.navigator = { + language: "en-US", + platform: "", + userAgent: "" + }; + } +} +async function node_utils_fetchData(url) { + const fs = process.getBuiltinModule("fs/promises"); + const data = await fs.readFile(url); + return new Uint8Array(data); +} +class NodeFilterFactory extends BaseFilterFactory {} +class NodeCanvasFactory extends BaseCanvasFactory { + _createCanvas(width, height) { + const require = process.getBuiltinModule("module").createRequire(import.meta.url); + const canvas = require("@napi-rs/canvas"); + return canvas.createCanvas(width, height); + } +} +class NodeBinaryDataFactory extends BaseBinaryDataFactory { + async _fetch(url, kind) { + return node_utils_fetchData(url); + } +} + +;// ./node_modules/core-js/modules/es.iterator.for-each.js +es_iterator_for_each_namespaceFn(); + +;// ./src/display/canvas_dependency_tracker.js + + + + + + + + + + + + + + + + + + + + + +const FORCED_DEPENDENCY_LABEL = "__forcedDependency"; +const { + floor: canvas_dependency_tracker_floor, + ceil +} = Math; +function expandBBox(array, index, minX, minY, maxX, maxY) { + array[index * 4 + 0] = Math.min(array[index * 4 + 0], minX); + array[index * 4 + 1] = Math.min(array[index * 4 + 1], minY); + array[index * 4 + 2] = Math.max(array[index * 4 + 2], maxX); + array[index * 4 + 3] = Math.max(array[index * 4 + 3], maxY); +} +function scaleCharBBox(scaleX, scaleY, x, y, bbox) { + let temp; + if (scaleX) { + if (scaleX < 0) { + temp = bbox[0]; + bbox[0] = bbox[2]; + bbox[2] = temp; + } + bbox[0] *= scaleX; + bbox[2] *= scaleX; + if (scaleY < 0) { + temp = bbox[1]; + bbox[1] = bbox[3]; + bbox[3] = temp; + } + bbox[1] *= scaleY; + bbox[3] *= scaleY; + } else { + bbox.fill(0); + } + bbox[0] += x; + bbox[1] += y; + bbox[2] += x; + bbox[3] += y; +} +const EMPTY_BBOX = new Uint32Array(new Uint8Array([255, 255, 0, 0]).buffer)[0]; +class BBoxReader { + #bboxes; + #coords; + constructor(bboxes, coords) { + this.#bboxes = bboxes; + this.#coords = coords; + } + static fromBuffer(buffer) { + return new BBoxReader(new Uint32Array(buffer), new Uint8ClampedArray(buffer)); + } + get buffer() { + return this.#bboxes.buffer; + } + get length() { + return this.#bboxes.length; + } + isEmpty(i) { + return this.#bboxes[i] === EMPTY_BBOX; + } + minX(i) { + return this.#coords[i * 4 + 0] / 256; + } + minY(i) { + return this.#coords[i * 4 + 1] / 256; + } + maxX(i) { + return (this.#coords[i * 4 + 2] + 1) / 256; + } + maxY(i) { + return (this.#coords[i * 4 + 3] + 1) / 256; + } +} +const ensureDebugMetadata = (map, key) => map?.getOrInsertComputed(key, () => ({ + dependencies: new Set(), + isRenderingOperation: false +})); +class CanvasBBoxTracker { + #baseTransformStack = [[1, 0, 0, 1, 0, 0]]; + #clipBox = [-Infinity, -Infinity, Infinity, Infinity]; + #pendingBBox = new Float64Array(BBOX_INIT); + _pendingBBoxIdx = -1; + #canvasWidth; + #canvasHeight; + #bboxesCoords; + #bboxes; + _savesStack = []; + _markedContentStack = []; + constructor(canvas, operationsCount) { + this.#canvasWidth = canvas.width; + this.#canvasHeight = canvas.height; + this.#initializeBBoxes(operationsCount); + } + growOperationsCount(operationsCount) { + if (operationsCount >= this.#bboxes.length) { + this.#initializeBBoxes(operationsCount, this.#bboxes); + } + } + #initializeBBoxes(operationsCount, oldBBoxes) { + const buffer = new ArrayBuffer(operationsCount * 4); + this.#bboxesCoords = new Uint8ClampedArray(buffer); + this.#bboxes = new Uint32Array(buffer); + if (oldBBoxes && oldBBoxes.length > 0) { + this.#bboxes.set(oldBBoxes); + this.#bboxes.fill(EMPTY_BBOX, oldBBoxes.length); + } else { + this.#bboxes.fill(EMPTY_BBOX); + } + } + get clipBox() { + return this.#clipBox; + } + save(opIdx) { + this.#clipBox = { + __proto__: this.#clipBox + }; + this._savesStack.push(opIdx); + return this; + } + restore(opIdx, onSavePopped) { + const previous = Object.getPrototypeOf(this.#clipBox); + if (previous === null) { + return this; + } + this.#clipBox = previous; + const lastSave = this._savesStack.pop(); + if (lastSave !== undefined) { + onSavePopped?.(lastSave, opIdx); + this.#bboxes[opIdx] = this.#bboxes[lastSave]; + } + return this; + } + recordOpenMarker(idx) { + this._savesStack.push(idx); + return this; + } + getOpenMarker() { + return this._savesStack.length === 0 ? null : this._savesStack.at(-1); + } + recordCloseMarker(opIdx, onSavePopped) { + const lastSave = this._savesStack.pop(); + if (lastSave !== undefined) { + onSavePopped?.(lastSave, opIdx); + this.#bboxes[opIdx] = this.#bboxes[lastSave]; + } + return this; + } + beginMarkedContent(opIdx) { + this._markedContentStack.push(opIdx); + return this; + } + endMarkedContent(opIdx, onSavePopped) { + const lastSave = this._markedContentStack.pop(); + if (lastSave !== undefined) { + onSavePopped?.(lastSave, opIdx); + this.#bboxes[opIdx] = this.#bboxes[lastSave]; + } + return this; + } + pushBaseTransform(ctx) { + this.#baseTransformStack.push(Util.multiplyByDOMMatrix(this.#baseTransformStack.at(-1), ctx.getTransform())); + return this; + } + popBaseTransform() { + if (this.#baseTransformStack.length > 1) { + this.#baseTransformStack.pop(); + } + return this; + } + resetBBox(idx) { + if (this._pendingBBoxIdx !== idx) { + this._pendingBBoxIdx = idx; + this.#pendingBBox.set(BBOX_INIT, 0); + } + return this; + } + recordClipBox(idx, ctx, minX, maxX, minY, maxY) { + const transform = Util.multiplyByDOMMatrix(this.#baseTransformStack.at(-1), ctx.getTransform()); + const clipBox = BBOX_INIT.slice(); + Util.axialAlignedBoundingBox([minX, minY, maxX, maxY], transform, clipBox); + const intersection = Util.intersect(this.#clipBox, clipBox); + if (intersection) { + this.#clipBox[0] = intersection[0]; + this.#clipBox[1] = intersection[1]; + this.#clipBox[2] = intersection[2]; + this.#clipBox[3] = intersection[3]; + } else { + this.#clipBox[0] = this.#clipBox[1] = Infinity; + this.#clipBox[2] = this.#clipBox[3] = -Infinity; + } + return this; + } + recordBBox(idx, ctx, minX, maxX, minY, maxY) { + const clipBox = this.#clipBox; + if (clipBox[0] === Infinity) { + return this; + } + const transform = Util.multiplyByDOMMatrix(this.#baseTransformStack.at(-1), ctx.getTransform()); + if (clipBox[0] === -Infinity) { + Util.axialAlignedBoundingBox([minX, minY, maxX, maxY], transform, this.#pendingBBox); + return this; + } + const bbox = BBOX_INIT.slice(); + Util.axialAlignedBoundingBox([minX, minY, maxX, maxY], transform, bbox); + this.#pendingBBox[0] = MathClamp(bbox[0], clipBox[0], this.#pendingBBox[0]); + this.#pendingBBox[1] = MathClamp(bbox[1], clipBox[1], this.#pendingBBox[1]); + this.#pendingBBox[2] = MathClamp(bbox[2], this.#pendingBBox[2], clipBox[2]); + this.#pendingBBox[3] = MathClamp(bbox[3], this.#pendingBBox[3], clipBox[3]); + return this; + } + recordFullPageBBox(idx) { + this.#pendingBBox[0] = Math.max(0, this.#clipBox[0]); + this.#pendingBBox[1] = Math.max(0, this.#clipBox[1]); + this.#pendingBBox[2] = Math.min(this.#canvasWidth, this.#clipBox[2]); + this.#pendingBBox[3] = Math.min(this.#canvasHeight, this.#clipBox[3]); + return this; + } + recordOperation(idx, preserve = false, dependencyLists) { + if (this._pendingBBoxIdx !== idx) { + return this; + } + const minX = canvas_dependency_tracker_floor(this.#pendingBBox[0] * 256 / this.#canvasWidth); + const minY = canvas_dependency_tracker_floor(this.#pendingBBox[1] * 256 / this.#canvasHeight); + const maxX = ceil(this.#pendingBBox[2] * 256 / this.#canvasWidth); + const maxY = ceil(this.#pendingBBox[3] * 256 / this.#canvasHeight); + expandBBox(this.#bboxesCoords, idx, minX, minY, maxX, maxY); + if (dependencyLists) { + for (const dependencies of dependencyLists) { + for (const depIdx of dependencies) { + if (depIdx !== idx) { + expandBBox(this.#bboxesCoords, depIdx, minX, minY, maxX, maxY); + } + } + } + } + if (!preserve) { + this._pendingBBoxIdx = -1; + } + return this; + } + bboxToClipBoxDropOperation(idx) { + if (this._pendingBBoxIdx === idx) { + this._pendingBBoxIdx = -1; + this.#clipBox[0] = Math.max(this.#clipBox[0], this.#pendingBBox[0]); + this.#clipBox[1] = Math.max(this.#clipBox[1], this.#pendingBBox[1]); + this.#clipBox[2] = Math.min(this.#clipBox[2], this.#pendingBBox[2]); + this.#clipBox[3] = Math.min(this.#clipBox[3], this.#pendingBBox[3]); + } + return this; + } + take() { + return new BBoxReader(this.#bboxes, this.#bboxesCoords); + } + takeDebugMetadata() { + throw new Error("Unreachable"); + } + recordSimpleData(name, idx) { + return this; + } + recordIncrementalData(name, idx) { + return this; + } + resetIncrementalData(name, idx) { + return this; + } + recordNamedData(name, idx) { + return this; + } + recordSimpleDataFromNamed(name, depName, fallbackIdx) { + return this; + } + recordFutureForcedDependency(name, idx) { + return this; + } + inheritSimpleDataAsFutureForcedDependencies(names) { + return this; + } + inheritPendingDependenciesAsFutureForcedDependencies() { + return this; + } + recordCharacterBBox(idx, ctx, font, scale = 1, x = 0, y = 0, getMeasure) { + return this; + } + getSimpleIndex(dependencyName) { + return undefined; + } + recordDependencies(idx, dependencyNames) { + return this; + } + recordNamedDependency(idx, name) { + return this; + } + recordShowTextOperation(idx, preserve = false) { + return this; + } +} +class CanvasDependencyTracker { + #simple = { + __proto__: null + }; + #incremental = { + __proto__: null, + transform: [], + moveText: [], + sameLineText: [], + [FORCED_DEPENDENCY_LABEL]: [] + }; + #namedDependencies = new Map(); + #pendingDependencies = new Set(); + #fontBBoxTrustworthy = new Map(); + #debugMetadata; + #recordDebugMetadataDepenencyAfterRestore; + #bboxTracker; + constructor(bboxTracker, recordDebugMetadata = false) { + this.#bboxTracker = bboxTracker; + if (recordDebugMetadata) { + this.#debugMetadata = new Map(); + this.#recordDebugMetadataDepenencyAfterRestore = (lastSave, opIdx) => { + ensureDebugMetadata(this.#debugMetadata, opIdx).dependencies.add(lastSave); + }; + } + } + get clipBox() { + return this.#bboxTracker.clipBox; + } + growOperationsCount(operationsCount) { + this.#bboxTracker.growOperationsCount(operationsCount); + } + save(opIdx) { + this.#simple = { + __proto__: this.#simple + }; + this.#incremental = { + __proto__: this.#incremental, + transform: { + __proto__: this.#incremental.transform + }, + moveText: { + __proto__: this.#incremental.moveText + }, + sameLineText: { + __proto__: this.#incremental.sameLineText + }, + [FORCED_DEPENDENCY_LABEL]: { + __proto__: this.#incremental[FORCED_DEPENDENCY_LABEL] + } + }; + this.#bboxTracker.save(opIdx); + return this; + } + restore(opIdx) { + this.#bboxTracker.restore(opIdx, this.#recordDebugMetadataDepenencyAfterRestore); + const previous = Object.getPrototypeOf(this.#simple); + if (previous === null) { + return this; + } + this.#simple = previous; + this.#incremental = Object.getPrototypeOf(this.#incremental); + return this; } - _createCanvas(width, height) { - const canvas = this._document.createElement("canvas"); - canvas.width = width; - canvas.height = height; - return canvas; + recordOpenMarker(opIdx) { + this.#bboxTracker.recordOpenMarker(opIdx, this.#recordDebugMetadataDepenencyAfterRestore); + return this; } -} - -;// ./src/display/filter_factory.js - - - - - - -class BaseFilterFactory { - addFilter(maps) { - return "none"; + getOpenMarker() { + return this.#bboxTracker.getOpenMarker(); } - addHCMFilter(fgColor, bgColor) { - return "none"; + recordCloseMarker(opIdx) { + this.#bboxTracker.recordCloseMarker(opIdx, this.#recordDebugMetadataDepenencyAfterRestore); + return this; } - addAlphaFilter(map) { - return "none"; + beginMarkedContent(opIdx) { + this.#bboxTracker.beginMarkedContent(opIdx); + return this; } - addLuminosityFilter(map) { - return "none"; + endMarkedContent(opIdx) { + this.#bboxTracker.endMarkedContent(opIdx, this.#recordDebugMetadataDepenencyAfterRestore); + return this; } - addKnockoutFilter(alpha = 0) { - return "none"; + pushBaseTransform(ctx) { + this.#bboxTracker.pushBaseTransform(ctx); + return this; } - addHighlightHCMFilter(filterName, fgColor, bgColor, newFgColor, newBgColor) { - return "none"; + popBaseTransform() { + this.#bboxTracker.popBaseTransform(); + return this; } - addSelectionHCMFilter(fgColor, bgColor) { - return "none"; + recordSimpleData(name, idx) { + this.#simple[name] = idx; + return this; } - addSelectionFilter() { - return "none"; + recordIncrementalData(name, idx) { + this.#incremental[name].push(idx); + return this; } - createSelectionStyle(pageColors = null) { - return null; + resetIncrementalData(name, idx) { + this.#incremental[name].length = 0; + return this; } - destroy(keepHCM = false) {} -} -class DOMFilterFactory extends BaseFilterFactory { - #baseUrl; - #_cache; - #_defs; - #docId; - #document; - #_hcmCache; - #id = 0; - constructor({ - docId, - ownerDocument = globalThis.document - }) { - super(); - this.#docId = docId; - this.#document = ownerDocument; + recordNamedData(name, idx) { + this.#namedDependencies.set(name, idx); + return this; } - get #cache() { - return this.#_cache ||= new Map(); + recordSimpleDataFromNamed(name, depName, fallbackIdx) { + this.#simple[name] = this.#namedDependencies.get(depName) ?? fallbackIdx; } - get #hcmCache() { - return this.#_hcmCache ||= new Map(); + recordFutureForcedDependency(name, idx) { + this.recordIncrementalData(FORCED_DEPENDENCY_LABEL, idx); + return this; } - get #defs() { - if (!this.#_defs) { - const div = this.#document.createElement("div"); - const { - style - } = div; - style.colorScheme = "only light"; - style.visibility = "hidden"; - style.contain = "strict"; - style.width = style.height = 0; - style.position = "absolute"; - style.top = style.left = 0; - style.zIndex = -1; - const svg = this.#document.createElementNS(SVG_NS, "svg"); - svg.setAttribute("width", 0); - svg.setAttribute("height", 0); - this.#_defs = this.#document.createElementNS(SVG_NS, "defs"); - div.append(svg); - svg.append(this.#_defs); - this.#document.body.append(div); + inheritSimpleDataAsFutureForcedDependencies(names) { + for (const name of names) { + if (name in this.#simple) { + this.recordFutureForcedDependency(name, this.#simple[name]); + } } - return this.#_defs; + return this; } - #createTables(maps) { - const toTable = map => map && Array.from(map, v => v / 255).join(","); - if (maps.length === 1) { - const table = toTable(maps[0]); - return [table, table, table]; + inheritPendingDependenciesAsFutureForcedDependencies() { + for (const dep of this.#pendingDependencies) { + this.recordFutureForcedDependency(FORCED_DEPENDENCY_LABEL, dep); } - const [mapR, mapG, mapB] = maps; - return [toTable(mapR), toTable(mapG), toTable(mapB)]; + return this; } - #createUrl(id) { - if (this.#baseUrl === undefined) { - this.#baseUrl = ""; - const url = this.#document.URL; - if (url !== this.#document.baseURI) { - if (isDataScheme(url)) { - warn('#createUrl: ignore "data:"-URL for performance reasons.'); - } else { - this.#baseUrl = updateUrlHash(url, ""); - } - } - } - return `url(${this.#baseUrl}#${id})`; + resetBBox(idx) { + this.#bboxTracker.resetBBox(idx); + return this; } - addFilter(maps) { - if (!maps) { - return "none"; - } - let value = this.#cache.get(maps); - if (value) { - return value; - } - const [tableR, tableG, tableB] = this.#createTables(maps); - const key = maps.length === 1 ? tableR : `${tableR}${tableG}${tableB}`; - value = this.#cache.get(key); - if (value) { - this.#cache.set(maps, value); - return value; - } - const id = `g_${this.#docId}_transfer_map_${this.#id++}`; - const url = this.#createUrl(id); - this.#cache.set(maps, url); - this.#cache.set(key, url); - const filter = this.#createFilter(id); - this.#addTransferMapConversion(tableR, tableG, tableB, filter); - return url; + recordClipBox(idx, ctx, minX, maxX, minY, maxY) { + this.#bboxTracker.recordClipBox(idx, ctx, minX, maxX, minY, maxY); + return this; } - addHCMFilter(fgColor, bgColor) { - const key = `${fgColor}-${bgColor}`; - const filterName = "base"; - let info = this.#hcmCache.get(filterName); - if (info?.key === key) { - return info.url; - } - if (info) { - info.filter?.remove(); - info.key = key; - info.url = "none"; - info.filter = null; - } else { - info = { - key, - url: "none", - filter: null - }; - this.#hcmCache.set(filterName, info); - } - if (!fgColor || !bgColor) { - return info.url; + recordBBox(idx, ctx, minX, maxX, minY, maxY) { + this.#bboxTracker.recordBBox(idx, ctx, minX, maxX, minY, maxY); + return this; + } + recordCharacterBBox(idx, ctx, font, scale = 1, x = 0, y = 0, getMeasure) { + const fontBBox = font.bbox; + let isBBoxTrustworthy; + let computedBBox; + if (fontBBox) { + isBBoxTrustworthy = fontBBox[2] !== fontBBox[0] && fontBBox[3] !== fontBBox[1] && this.#fontBBoxTrustworthy.get(font); + if (isBBoxTrustworthy !== false) { + computedBBox = [0, 0, 0, 0]; + Util.axialAlignedBoundingBox(fontBBox, font.fontMatrix, computedBBox); + if (scale !== 1 || x !== 0 || y !== 0) { + scaleCharBBox(scale, -scale, x, y, computedBBox); + } + if (isBBoxTrustworthy) { + return this.recordBBox(idx, ctx, computedBBox[0], computedBBox[2], computedBBox[1], computedBBox[3]); + } + } } - const fgRGB = this.#getRGB(fgColor); - fgColor = Util.makeHexColor(...fgRGB); - const bgRGB = this.#getRGB(bgColor); - bgColor = Util.makeHexColor(...bgRGB); - this.#resetDefsColor(); - if (fgColor === "#000000" && bgColor === "#ffffff" || fgColor === bgColor) { - return info.url; + if (!getMeasure) { + return this.recordFullPageBBox(idx); } - const map = Array.from({ - length: 256 - }, (_, i) => computeLuminance(i / 255)); - const table = map.join(","); - const id = `g_${this.#docId}_hcm_filter`; - const filter = info.filter = this.#createFilter(id); - this.#addTransferMapConversion(table, table, table, filter); - this.#addGrayConversion(filter); - const getSteps = (c, n) => { - const start = fgRGB[c] / 255; - const end = bgRGB[c] / 255; - const arr = new Array(n + 1); - for (let i = 0; i <= n; i++) { - arr[i] = start + i / n * (end - start); + const measure = getMeasure(); + if (fontBBox && computedBBox && isBBoxTrustworthy === undefined) { + isBBoxTrustworthy = computedBBox[0] <= x - measure.actualBoundingBoxLeft && computedBBox[2] >= x + measure.actualBoundingBoxRight && computedBBox[1] <= y - measure.actualBoundingBoxAscent && computedBBox[3] >= y + measure.actualBoundingBoxDescent; + this.#fontBBoxTrustworthy.set(font, isBBoxTrustworthy); + if (isBBoxTrustworthy) { + return this.recordBBox(idx, ctx, computedBBox[0], computedBBox[2], computedBBox[1], computedBBox[3]); } - return arr.join(","); - }; - this.#addTransferMapConversion(getSteps(0, 5), getSteps(1, 5), getSteps(2, 5), filter); - info.url = this.#createUrl(id); - return info.url; + } + return this.recordBBox(idx, ctx, x - measure.actualBoundingBoxLeft, x + measure.actualBoundingBoxRight, y - measure.actualBoundingBoxAscent, y + measure.actualBoundingBoxDescent); } - addSelectionHCMFilter(fgColor, bgColor) { - return this.addHighlightHCMFilter("selection", fgColor, bgColor, "HighlightText", "Highlight"); + recordFullPageBBox(idx) { + this.#bboxTracker.recordFullPageBBox(idx); + return this; } - addSelectionFilter() { - return this.addHighlightHCMFilter("selection_default", "black", "white", "HighlightText", "Highlight"); + getSimpleIndex(dependencyName) { + return this.#simple[dependencyName]; } - createSelectionStyle(pageColors = null) { - const filter = pageColors ? this.addSelectionHCMFilter(pageColors.foreground, pageColors.background) : this.addSelectionFilter(); - if (filter === "none" || !FeatureTest.platform.isFirefox) { - return null; + recordDependencies(idx, dependencyNames) { + const pendingDependencies = this.#pendingDependencies; + const simple = this.#simple; + const incremental = this.#incremental; + for (const name of dependencyNames) { + if (name in this.#simple) { + pendingDependencies.add(simple[name]); + } else if (name in incremental) { + incremental[name].forEach(pendingDependencies.add, pendingDependencies); + } } - return { - "backdrop-filter": filter, - "background-color": "transparent" - }; + return this; } - addAlphaFilter(map) { - let value = this.#cache.get(map); - if (value) { - return value; - } - const [tableA] = this.#createTables([map]); - const key = `alpha_${tableA}`; - value = this.#cache.get(key); - if (value) { - this.#cache.set(map, value); - return value; + recordNamedDependency(idx, name) { + if (this.#namedDependencies.has(name)) { + this.#pendingDependencies.add(this.#namedDependencies.get(name)); } - const id = `g_${this.#docId}_alpha_map_${this.#id++}`; - const url = this.#createUrl(id); - this.#cache.set(map, url); - this.#cache.set(key, url); - const filter = this.#createFilter(id); - this.#addTransferMapAlphaConversion(tableA, filter); - return url; + return this; } - addLuminosityFilter(map) { - let value = this.#cache.get(map || "luminosity"); - if (value) { - return value; - } - let tableA, key; - if (map) { - [tableA] = this.#createTables([map]); - key = `luminosity_${tableA}`; - } else { - key = "luminosity"; - } - value = this.#cache.get(key); - if (value) { - this.#cache.set(map, value); - return value; + recordOperation(idx, preserve = false) { + this.recordDependencies(idx, [FORCED_DEPENDENCY_LABEL]); + if (this.#debugMetadata) { + const metadata = ensureDebugMetadata(this.#debugMetadata, idx); + const { + dependencies + } = metadata; + this.#pendingDependencies.forEach(dependencies.add, dependencies); + this.#bboxTracker._savesStack.forEach(dependencies.add, dependencies); + this.#bboxTracker._markedContentStack.forEach(dependencies.add, dependencies); + dependencies.delete(idx); + metadata.isRenderingOperation = true; } - const id = `g_${this.#docId}_luminosity_map_${this.#id++}`; - const url = this.#createUrl(id); - this.#cache.set(map, url); - this.#cache.set(key, url); - const filter = this.#createFilter(id); - this.#addLuminosityConversion(filter); - if (map) { - this.#addTransferMapAlphaConversion(tableA, filter); + const needsCleanup = !preserve && idx === this.#bboxTracker._pendingBBoxIdx; + this.#bboxTracker.recordOperation(idx, preserve, [this.#pendingDependencies, this.#bboxTracker._savesStack, this.#bboxTracker._markedContentStack]); + if (needsCleanup) { + this.#pendingDependencies.clear(); } - return url; + return this; } - addKnockoutFilter(alpha = 0) { - const slope = alpha > 0 ? Math.min(1 / alpha, 1e6) : 1e6; - const key = `knockout_${slope}`; - const value = this.#cache.get(key); - if (value) { - return value; + recordShowTextOperation(idx, preserve = false) { + const deps = Array.from(this.#pendingDependencies); + this.recordOperation(idx, preserve); + this.recordIncrementalData("sameLineText", idx); + for (const dep of deps) { + this.recordIncrementalData("sameLineText", dep); } - const id = `g_${this.#docId}_knockout_filter_${this.#id++}`; - const url = this.#createUrl(id); - this.#cache.set(key, url); - const filter = this.#createFilter(id); - const feComponentTransfer = this.#document.createElementNS(SVG_NS, "feComponentTransfer"); - filter.append(feComponentTransfer); - const feFuncA = this.#document.createElementNS(SVG_NS, "feFuncA"); - feFuncA.setAttribute("type", "linear"); - feFuncA.setAttribute("slope", `${slope}`); - feFuncA.setAttribute("intercept", "0"); - feComponentTransfer.append(feFuncA); - return url; + return this; } - addHighlightHCMFilter(filterName, fgColor, bgColor, newFgColor, newBgColor) { - const key = `${fgColor}-${bgColor}-${newFgColor}-${newBgColor}`; - let info = this.#hcmCache.get(filterName); - if (info?.key === key) { - return info.url; - } - if (info) { - info.filter?.remove(); - info.key = key; - info.url = "none"; - info.filter = null; - } else { - info = { - key, - url: "none", - filter: null - }; - this.#hcmCache.set(filterName, info); - } - if (!fgColor || !bgColor) { - return info.url; + bboxToClipBoxDropOperation(idx, preserve = false) { + const needsCleanup = !preserve && idx === this.#bboxTracker._pendingBBoxIdx; + this.#bboxTracker.bboxToClipBoxDropOperation(idx); + if (needsCleanup) { + this.#pendingDependencies.clear(); } - const [fgRGB, bgRGB] = [fgColor, bgColor].map(this.#getRGB.bind(this)); - let fgGray = Math.round(0.2126 * fgRGB[0] + 0.7152 * fgRGB[1] + 0.0722 * fgRGB[2]); - let bgGray = Math.round(0.2126 * bgRGB[0] + 0.7152 * bgRGB[1] + 0.0722 * bgRGB[2]); - let [newFgRGB, newBgRGB] = [newFgColor, newBgColor].map(this.#getOpaqueTextColor.bind(this)); - if (bgGray < fgGray) { - [fgGray, bgGray, newFgRGB, newBgRGB] = [bgGray, fgGray, newBgRGB, newFgRGB]; + return this; + } + take() { + this.#fontBBoxTrustworthy.clear(); + return this.#bboxTracker.take(); + } + takeDebugMetadata() { + return this.#debugMetadata; + } +} +class CanvasNestedDependencyTracker { + #dependencyTracker; + #opIdx; + #ignoreBBoxes; + #nestingLevel = 0; + #savesLevel = 0; + constructor(dependencyTracker, opIdx, ignoreBBoxes) { + if (dependencyTracker instanceof CanvasNestedDependencyTracker && dependencyTracker.#ignoreBBoxes === !!ignoreBBoxes) { + return dependencyTracker; } - this.#resetDefsColor(); - const getSteps = (fg, bg, n) => { - const arr = new Array(256); - const step = (bgGray - fgGray) / n; - const newStart = fg / 255; - const newStep = (bg - fg) / (255 * n); - let prev = 0; - for (let i = 0; i <= n; i++) { - const k = Math.round(fgGray + i * step); - const value = newStart + i * newStep; - for (let j = prev; j <= k; j++) { - arr[j] = value; - } - prev = k + 1; - } - for (let i = prev; i < 256; i++) { - arr[i] = arr[prev - 1]; - } - return arr.join(","); - }; - const id = `g_${this.#docId}_hcm_${filterName}_filter`; - const filter = info.filter = this.#createFilter(id); - this.#addGrayConversion(filter); - this.#addTransferMapConversion(getSteps(newFgRGB[0], newBgRGB[0], 5), getSteps(newFgRGB[1], newBgRGB[1], 5), getSteps(newFgRGB[2], newBgRGB[2], 5), filter); - info.url = this.#createUrl(id); - return info.url; + this.#dependencyTracker = dependencyTracker; + this.#opIdx = opIdx; + this.#ignoreBBoxes = !!ignoreBBoxes; } - destroy(keepHCM = false) { - if (keepHCM && this.#_hcmCache?.size) { - return; + get clipBox() { + return this.#dependencyTracker.clipBox; + } + growOperationsCount() { + throw new Error("Unreachable"); + } + save(opIdx) { + this.#savesLevel++; + this.#dependencyTracker.save(this.#opIdx); + return this; + } + restore(opIdx) { + if (this.#savesLevel > 0) { + this.#dependencyTracker.restore(this.#opIdx); + this.#savesLevel--; } - this.#_defs?.parentNode.parentNode.remove(); - this.#_defs = null; - this.#_cache?.clear(); - this.#_cache = null; - this.#_hcmCache?.clear(); - this.#_hcmCache = null; - this.#id = 0; + return this; + } + recordOpenMarker(idx) { + this.#nestingLevel++; + return this; + } + getOpenMarker() { + return this.#nestingLevel > 0 ? this.#opIdx : this.#dependencyTracker.getOpenMarker(); + } + recordCloseMarker(idx) { + this.#nestingLevel--; + return this; + } + beginMarkedContent(opIdx) { + return this; + } + endMarkedContent(opIdx) { + return this; + } + pushBaseTransform(ctx) { + this.#dependencyTracker.pushBaseTransform(ctx); + return this; + } + popBaseTransform() { + this.#dependencyTracker.popBaseTransform(); + return this; } - #addLuminosityConversion(filter) { - const feColorMatrix = this.#document.createElementNS(SVG_NS, "feColorMatrix"); - feColorMatrix.setAttribute("type", "matrix"); - feColorMatrix.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"); - filter.append(feColorMatrix); + recordSimpleData(name, idx) { + this.#dependencyTracker.recordSimpleData(name, this.#opIdx); + return this; } - #addGrayConversion(filter) { - const feColorMatrix = this.#document.createElementNS(SVG_NS, "feColorMatrix"); - feColorMatrix.setAttribute("type", "matrix"); - feColorMatrix.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"); - filter.append(feColorMatrix); + recordIncrementalData(name, idx) { + this.#dependencyTracker.recordIncrementalData(name, this.#opIdx); + return this; } - #createFilter(id) { - const filter = this.#document.createElementNS(SVG_NS, "filter"); - filter.setAttribute("color-interpolation-filters", "sRGB"); - filter.setAttribute("id", id); - this.#defs.append(filter); - return filter; + resetIncrementalData(name, idx) { + this.#dependencyTracker.resetIncrementalData(name, this.#opIdx); + return this; } - #appendFeFunc(feComponentTransfer, func, table) { - if (!table) { - return; - } - const feFunc = this.#document.createElementNS(SVG_NS, func); - feFunc.setAttribute("type", "discrete"); - feFunc.setAttribute("tableValues", table); - feComponentTransfer.append(feFunc); + recordNamedData(name, idx) { + return this; } - #addTransferMapConversion(rTable, gTable, bTable, filter) { - const feComponentTransfer = this.#document.createElementNS(SVG_NS, "feComponentTransfer"); - filter.append(feComponentTransfer); - this.#appendFeFunc(feComponentTransfer, "feFuncR", rTable); - this.#appendFeFunc(feComponentTransfer, "feFuncG", gTable); - this.#appendFeFunc(feComponentTransfer, "feFuncB", bTable); + recordSimpleDataFromNamed(name, depName, fallbackIdx) { + this.#dependencyTracker.recordSimpleDataFromNamed(name, depName, this.#opIdx); + return this; } - #addTransferMapAlphaConversion(aTable, filter) { - const feComponentTransfer = this.#document.createElementNS(SVG_NS, "feComponentTransfer"); - filter.append(feComponentTransfer); - this.#appendFeFunc(feComponentTransfer, "feFuncA", aTable); + recordFutureForcedDependency(name, idx) { + this.#dependencyTracker.recordFutureForcedDependency(name, this.#opIdx); + return this; } - #getRGB(color) { - this.#defs.style.color = "CanvasText"; - this.#defs.style.backgroundColor = color; - return getRGB(getComputedStyle(this.#defs).getPropertyValue("background-color")); + inheritSimpleDataAsFutureForcedDependencies(names) { + this.#dependencyTracker.inheritSimpleDataAsFutureForcedDependencies(names); + return this; } - #getRGBA(color) { - this.#defs.style.color = "CanvasText"; - this.#defs.style.backgroundColor = color; - return getRGBA(getComputedStyle(this.#defs).getPropertyValue("background-color")); + inheritPendingDependenciesAsFutureForcedDependencies() { + this.#dependencyTracker.inheritPendingDependenciesAsFutureForcedDependencies(); + return this; } - #resetDefsColor() { - this.#defs.style.color = ""; - this.#defs.style.backgroundColor = ""; + resetBBox(idx) { + if (!this.#ignoreBBoxes) { + this.#dependencyTracker.resetBBox(this.#opIdx); + } + return this; } - #getOpaqueTextColor(color) { - const [r, g, b, alpha] = this.#getRGBA(color); - if (alpha === 1) { - return [r, g, b]; + recordClipBox(idx, ctx, minX, maxX, minY, maxY) { + if (!this.#ignoreBBoxes) { + this.#dependencyTracker.recordClipBox(this.#opIdx, ctx, minX, maxX, minY, maxY); } - const [canvasR, canvasG, canvasB] = this.#getRGB("Canvas"); - return [blend(r, canvasR, alpha), blend(g, canvasG, alpha), blend(b, canvasB, alpha)]; + return this; } -} -function blend(fg, bg, alpha) { - return Math.round(alpha * fg + (1 - alpha) * bg); -} - -;// ./src/display/node_utils.js - - - - - - - - - -if (isNodeJS) { - let canvas; - try { - const require = process.getBuiltinModule("module").createRequire(import.meta.url); - try { - canvas = require("@napi-rs/canvas"); - } catch (ex) { - warn(`Cannot load "@napi-rs/canvas" package: "${ex}".`); + recordBBox(idx, ctx, minX, maxX, minY, maxY) { + if (!this.#ignoreBBoxes) { + this.#dependencyTracker.recordBBox(this.#opIdx, ctx, minX, maxX, minY, maxY); } - } catch (ex) { - warn(`Cannot access the \`require\` function: "${ex}".`); + return this; } - if (!globalThis.DOMMatrix) { - if (canvas?.DOMMatrix) { - globalThis.DOMMatrix = canvas.DOMMatrix; - } else { - warn("Cannot polyfill `DOMMatrix`, rendering may be broken."); + recordCharacterBBox(idx, ctx, font, scale, x, y, getMeasure) { + if (!this.#ignoreBBoxes) { + this.#dependencyTracker.recordCharacterBBox(this.#opIdx, ctx, font, scale, x, y, getMeasure); } + return this; } - if (!globalThis.Path2D) { - if (canvas?.Path2D) { - globalThis.Path2D = canvas.Path2D; - } else { - warn("Cannot polyfill `Path2D`, rendering may be broken."); + recordFullPageBBox(idx) { + if (!this.#ignoreBBoxes) { + this.#dependencyTracker.recordFullPageBBox(this.#opIdx); } + return this; } - if (!globalThis.navigator?.language) { - globalThis.navigator = { - language: "en-US", - platform: "", - userAgent: "" - }; + getSimpleIndex(dependencyName) { + return this.#dependencyTracker.getSimpleIndex(dependencyName); } -} -async function node_utils_fetchData(url) { - const fs = process.getBuiltinModule("fs/promises"); - const data = await fs.readFile(url); - return new Uint8Array(data); -} -class NodeFilterFactory extends BaseFilterFactory {} -class NodeCanvasFactory extends BaseCanvasFactory { - _createCanvas(width, height) { - const require = process.getBuiltinModule("module").createRequire(import.meta.url); - const canvas = require("@napi-rs/canvas"); - return canvas.createCanvas(width, height); + recordDependencies(idx, dependencyNames) { + this.#dependencyTracker.recordDependencies(this.#opIdx, dependencyNames); + return this; + } + recordNamedDependency(idx, name) { + this.#dependencyTracker.recordNamedDependency(this.#opIdx, name); + return this; + } + recordOperation(idx) { + this.#dependencyTracker.recordOperation(this.#opIdx, true); + return this; + } + recordShowTextOperation(idx) { + this.#dependencyTracker.recordShowTextOperation(this.#opIdx, true); + return this; + } + bboxToClipBoxDropOperation(idx) { + if (!this.#ignoreBBoxes) { + this.#dependencyTracker.bboxToClipBoxDropOperation(this.#opIdx, true); + } + return this; + } + take() { + throw new Error("Unreachable"); + } + takeDebugMetadata() { + throw new Error("Unreachable"); } } -class NodeBinaryDataFactory extends BaseBinaryDataFactory { - async _fetch(url, kind) { - return node_utils_fetchData(url); +const Dependencies = { + stroke: ["path", "transform", "filter", "strokeColor", "strokeAlpha", "lineWidth", "lineCap", "lineJoin", "miterLimit", "dash"], + fill: ["path", "transform", "filter", "fillColor", "fillAlpha", "globalCompositeOperation", "SMask"], + imageXObject: ["transform", "SMask", "filter", "fillAlpha", "strokeAlpha", "globalCompositeOperation"], + rawFillPath: ["filter", "fillColor", "fillAlpha"], + showText: ["transform", "leading", "charSpacing", "wordSpacing", "hScale", "textRise", "moveText", "textMatrix", "font", "fontObj", "filter", "fillColor", "textRenderingMode", "SMask", "fillAlpha", "strokeAlpha", "globalCompositeOperation", "sameLineText"], + transform: ["transform"], + transformAndFill: ["transform", "filter", "fillColor"] +}; +class CanvasImagesTracker { + #canvasWidth; + #canvasHeight; + #capacity = 4; + #count = 0; + #coords = new CanvasImagesTracker.#CoordsArray(this.#capacity * 6); + static #CoordsArray = FeatureTest.isFloat16ArraySupported ? Float16Array : Float32Array; + constructor(canvas) { + this.#canvasWidth = canvas.width; + this.#canvasHeight = canvas.height; + } + record(ctx, width, height, clipBox) { + if (this.#count === this.#capacity) { + this.#capacity *= 2; + const newCoords = new CanvasImagesTracker.#CoordsArray(this.#capacity * 6); + newCoords.set(this.#coords); + this.#coords = newCoords; + } + const transform = getCurrentTransform(ctx); + let coords; + if (clipBox[0] !== Infinity) { + const bbox = BBOX_INIT.slice(); + Util.axialAlignedBoundingBox([0, -height, width, 0], transform, bbox); + const finalBBox = Util.intersect(clipBox, bbox); + if (!finalBBox) { + return; + } + const [minX, minY, maxX, maxY] = finalBBox; + if (minX !== bbox[0] || minY !== bbox[1] || maxX !== bbox[2] || maxY !== bbox[3]) { + const rotationAngle = Math.atan2(transform[1], transform[0]); + const sin = Math.abs(Math.sin(rotationAngle)); + const cos = Math.abs(Math.cos(rotationAngle)); + if (sin < 1e-6 || cos < 1e-6 || Math.abs(sin - cos) < 1e-6) { + coords = [minX, minY, minX, maxY, maxX, minY]; + } else { + const finalBBoxWidth = maxX - minX; + const finalBBoxHeight = maxY - minY; + const sin2 = sin * sin; + const cos2 = cos * cos; + const cosSin = cos * sin; + const denom = cos2 - sin2; + const a = (finalBBoxHeight * cos2 - finalBBoxWidth * cosSin) / denom; + const b = (finalBBoxHeight * cosSin - finalBBoxWidth * sin2) / denom; + coords = [minX + b, minY, minX, minY + a, maxX, maxY - a]; + } + } + } + if (!coords) { + coords = [0, -height, 0, 0, width, -height]; + Util.applyTransform(coords, transform, 0); + Util.applyTransform(coords, transform, 2); + Util.applyTransform(coords, transform, 4); + } + coords[0] /= this.#canvasWidth; + coords[1] /= this.#canvasHeight; + coords[2] /= this.#canvasWidth; + coords[3] /= this.#canvasHeight; + coords[4] /= this.#canvasWidth; + coords[5] /= this.#canvasHeight; + this.#coords.set(coords, this.#count * 6); + this.#count++; + } + take() { + return this.#coords.subarray(0, this.#count * 6); } } +function createCanvasTrackers(canvas, operationsCount, { + recordOperations = false, + recordImages = false, + recordDebugMetadata = false +}) { + const bboxTracker = recordOperations || recordImages ? new CanvasBBoxTracker(canvas, operationsCount) : null; + return { + dependencyTracker: recordOperations ? new CanvasDependencyTracker(bboxTracker, recordDebugMetadata) : bboxTracker, + imagesTracker: recordImages ? new CanvasImagesTracker(canvas) : null + }; +} ;// ./src/shared/image_utils.js /* unused harmony import specifier */ var image_utils_ImageKind; /* unused harmony import specifier */ var image_utils_FeatureTest; + function convertToRGBA(params) { switch (params.kind) { case image_utils_ImageKind.GRAYSCALE_1BPP: @@ -15901,280 +15128,75 @@ function convertBlackAndWhiteToRGBA({ dest[destPos + 6] = zeroMapping ^ -(elem >> 1 & 1) & xorMask; dest[destPos + 7] = zeroMapping ^ -(elem & 1) & xorMask; } - if (widthRemainder === 0) { - continue; - } - const elem = srcPos < srcLength ? src[srcPos++] : 255; - for (let j = 0; j < widthRemainder; ++j, ++destPos) { - dest[destPos] = zeroMapping ^ -(elem >> 7 - j & 1) & xorMask; - } - } - return { - srcPos, - destPos - }; -} -function convertRGBToRGBA({ - src, - srcPos = 0, - dest, - destPos = 0, - width, - height -}) { - let i = 0; - const len = width * height * 3; - const len32 = len >> 2; - const src32 = new Uint32Array(src.buffer, srcPos, len32); - const alphaMask = FeatureTest.isLittleEndian ? 0xff000000 : 0xff; - if (FeatureTest.isLittleEndian) { - for (; i < len32 - 2; i += 3, destPos += 4) { - const s1 = src32[i], - s2 = src32[i + 1], - s3 = src32[i + 2]; - dest[destPos] = s1 | alphaMask; - dest[destPos + 1] = s1 >>> 24 | s2 << 8 | alphaMask; - dest[destPos + 2] = s2 >>> 16 | s3 << 16 | alphaMask; - dest[destPos + 3] = s3 >>> 8 | alphaMask; - } - for (let j = srcPos + i * 4, jj = srcPos + len; j < jj; j += 3) { - dest[destPos++] = src[j] | src[j + 1] << 8 | src[j + 2] << 16 | alphaMask; - } - } else { - for (; i < len32 - 2; i += 3, destPos += 4) { - const s1 = src32[i], - s2 = src32[i + 1], - s3 = src32[i + 2]; - dest[destPos] = s1 | alphaMask; - dest[destPos + 1] = s1 << 24 | s2 >>> 8 | alphaMask; - dest[destPos + 2] = s2 << 16 | s3 >>> 16 | alphaMask; - dest[destPos + 3] = s3 << 8 | alphaMask; - } - for (let j = srcPos + i * 4, jj = srcPos + len; j < jj; j += 3) { - dest[destPos++] = src[j] << 24 | src[j + 1] << 16 | src[j + 2] << 8 | alphaMask; - } - } - return { - srcPos: srcPos + len, - destPos - }; -} -function grayToRGBA(src, dest) { - if (image_utils_FeatureTest.isLittleEndian) { - for (let i = 0, ii = src.length; i < ii; i++) { - dest[i] = src[i] * 0x10101 | 0xff000000; - } - } else { - for (let i = 0, ii = src.length; i < ii; i++) { - dest[i] = src[i] * 0x1010100 | 0x000000ff; - } - } -} - -;// ./src/display/webgpu.js - -const MESH_WGSL = ` -struct Uniforms { - offsetX : f32, - offsetY : f32, - scaleX : f32, - scaleY : f32, - paddedWidth : f32, - paddedHeight : f32, - borderSize : f32, - _pad : f32, -}; - -@group(0) @binding(0) var u : Uniforms; - -struct VertexInput { - @location(0) position : vec2, - @location(1) color : vec4, -}; - -struct VertexOutput { - @builtin(position) position : vec4, - @location(0) color : vec3, -}; - -@vertex -fn vs_main(in : VertexInput) -> VertexOutput { - var out : VertexOutput; - let cx = (in.position.x + u.offsetX) * u.scaleX; - let cy = (in.position.y + u.offsetY) * u.scaleY; - out.position = vec4( - ((cx + u.borderSize) / u.paddedWidth) * 2.0 - 1.0, - 1.0 - ((cy + u.borderSize) / u.paddedHeight) * 2.0, - 0.0, - 1.0 - ); - out.color = in.color.rgb; - return out; -} - -@fragment -fn fs_main(in : VertexOutput) -> @location(0) vec4 { - return vec4(in.color, 1.0); -} -`; -class WebGPU { - #initPromise = null; - #device = null; - #meshPipeline = null; - #preferredFormat = null; - async #initGPU() { - if (!globalThis.navigator?.gpu) { - return false; - } - try { - const adapter = await navigator.gpu.requestAdapter(); - if (!adapter) { - return false; - } - this.#preferredFormat = navigator.gpu.getPreferredCanvasFormat(); - this.#device = await adapter.requestDevice(); - return true; - } catch { - return false; - } - } - init() { - return this.#initPromise ||= this.#initGPU(); - } - get isReady() { - return this.#device !== null; - } - loadMeshShader() { - if (!this.#device || this.#meshPipeline) { - return; - } - const shaderModule = this.#device.createShaderModule({ - code: MESH_WGSL - }); - this.#meshPipeline = this.#device.createRenderPipeline({ - layout: "auto", - vertex: { - module: shaderModule, - entryPoint: "vs_main", - buffers: [{ - arrayStride: 2 * 4, - attributes: [{ - shaderLocation: 0, - offset: 0, - format: "float32x2" - }] - }, { - arrayStride: 4, - attributes: [{ - shaderLocation: 1, - offset: 0, - format: "unorm8x4" - }] - }] - }, - fragment: { - module: shaderModule, - entryPoint: "fs_main", - targets: [{ - format: this.#preferredFormat - }] - }, - primitive: { - topology: "triangle-list" - } - }); - } - draw(posData, colData, vertexCount, context, backgroundColor, paddedWidth, paddedHeight, borderSize) { - this.loadMeshShader(); - const device = this.#device; - const { - offsetX, - offsetY, - scaleX, - scaleY - } = context; - const posBuffer = device.createBuffer({ - size: Math.max(posData.byteLength, 4), - usage: GPUBufferUsage.VERTEX | GPUBufferUsage.COPY_DST - }); - if (posData.byteLength > 0) { - device.queue.writeBuffer(posBuffer, 0, posData); - } - const colBuffer = device.createBuffer({ - size: Math.max(colData.byteLength, 4), - usage: GPUBufferUsage.VERTEX | GPUBufferUsage.COPY_DST - }); - if (colData.byteLength > 0) { - device.queue.writeBuffer(colBuffer, 0, colData); - } - const uniformBuffer = device.createBuffer({ - size: 8 * 4, - usage: GPUBufferUsage.UNIFORM | GPUBufferUsage.COPY_DST - }); - device.queue.writeBuffer(uniformBuffer, 0, new Float32Array([offsetX, offsetY, scaleX, scaleY, paddedWidth, paddedHeight, borderSize, 0])); - const bindGroup = device.createBindGroup({ - layout: this.#meshPipeline.getBindGroupLayout(0), - entries: [{ - binding: 0, - resource: { - buffer: uniformBuffer - } - }] - }); - const offscreen = new OffscreenCanvas(paddedWidth, paddedHeight); - const gpuCtx = offscreen.getContext("webgpu"); - gpuCtx.configure({ - device, - format: this.#preferredFormat, - alphaMode: backgroundColor ? "opaque" : "premultiplied" - }); - const clearValue = backgroundColor ? { - r: backgroundColor[0] / 255, - g: backgroundColor[1] / 255, - b: backgroundColor[2] / 255, - a: 1 - } : { - r: 0, - g: 0, - b: 0, - a: 0 - }; - const commandEncoder = device.createCommandEncoder(); - const renderPass = commandEncoder.beginRenderPass({ - colorAttachments: [{ - view: gpuCtx.getCurrentTexture().createView(), - clearValue, - loadOp: "clear", - storeOp: "store" - }] - }); - if (vertexCount > 0) { - renderPass.setPipeline(this.#meshPipeline); - renderPass.setBindGroup(0, bindGroup); - renderPass.setVertexBuffer(0, posBuffer); - renderPass.setVertexBuffer(1, colBuffer); - renderPass.draw(vertexCount); + if (widthRemainder === 0) { + continue; + } + const elem = srcPos < srcLength ? src[srcPos++] : 255; + for (let j = 0; j < widthRemainder; ++j, ++destPos) { + dest[destPos] = zeroMapping ^ -(elem >> 7 - j & 1) & xorMask; } - renderPass.end(); - device.queue.submit([commandEncoder.finish()]); - posBuffer.destroy(); - colBuffer.destroy(); - uniformBuffer.destroy(); - return offscreen.transferToImageBitmap(); } + return { + srcPos, + destPos + }; } -const _webGPU = new WebGPU(); -function initGPU() { - return _webGPU.init(); -} -function isGPUReady() { - return _webGPU.isReady; -} -function loadMeshShader() { - _webGPU.loadMeshShader(); +function convertRGBToRGBA({ + src, + srcPos = 0, + dest, + destPos = 0, + width, + height +}) { + let i = 0; + const len = width * height * 3; + const byteOffset = src.byteOffset + srcPos; + const len32 = byteOffset % 4 === 0 ? Math.floor(MathClamp(src.length - srcPos, 0, len) / 4) : 0; + const src32 = len32 > 0 ? new Uint32Array(src.buffer, byteOffset, len32) : null; + const alphaMask = FeatureTest.isLittleEndian ? 0xff000000 : 0xff; + if (FeatureTest.isLittleEndian) { + for (; i < len32 - 2; i += 3, destPos += 4) { + const s1 = src32[i], + s2 = src32[i + 1], + s3 = src32[i + 2]; + dest[destPos] = s1 | alphaMask; + dest[destPos + 1] = s1 >>> 24 | s2 << 8 | alphaMask; + dest[destPos + 2] = s2 >>> 16 | s3 << 16 | alphaMask; + dest[destPos + 3] = s3 >>> 8 | alphaMask; + } + for (let j = srcPos + i * 4, jj = srcPos + len; j < jj; j += 3) { + dest[destPos++] = src[j] | src[j + 1] << 8 | src[j + 2] << 16 | alphaMask; + } + } else { + for (; i < len32 - 2; i += 3, destPos += 4) { + const s1 = src32[i], + s2 = src32[i + 1], + s3 = src32[i + 2]; + dest[destPos] = s1 | alphaMask; + dest[destPos + 1] = s1 << 24 | s2 >>> 8 | alphaMask; + dest[destPos + 2] = s2 << 16 | s3 >>> 16 | alphaMask; + dest[destPos + 3] = s3 << 8 | alphaMask; + } + for (let j = srcPos + i * 4, jj = srcPos + len; j < jj; j += 3) { + dest[destPos++] = src[j] << 24 | src[j + 1] << 16 | src[j + 2] << 8 | alphaMask; + } + } + return { + srcPos: srcPos + len, + destPos + }; } -function drawMeshWithGPU(posData, colData, vertexCount, context, backgroundColor, paddedWidth, paddedHeight, borderSize) { - return _webGPU.draw(posData, colData, vertexCount, context, backgroundColor, paddedWidth, paddedHeight, borderSize); +function grayToRGBA(src, dest) { + if (image_utils_FeatureTest.isLittleEndian) { + for (let i = 0, ii = src.length; i < ii; i++) { + dest[i] = src[i] * 0x10101 | 0xff000000; + } + } else { + for (let i = 0, ii = src.length; i < ii; i++) { + dest[i] = src[i] * 0x1010100 | 0x000000ff; + } + } } ;// ./src/display/pattern_helper.js @@ -16463,3078 +15485,3938 @@ class MeshShadingPattern extends BaseShadingPattern { this._background = IR[7]; loadMeshShader(); } - _createMeshCanvas(combinedScale, backgroundColor, canvasFactory, transferMaps = null) { - const EXPECTED_SCALE = 1.1; - const MAX_PATTERN_SIZE = 3000; - const BORDER_SIZE = 2; - const offsetX = Math.floor(this._bounds[0]); - const offsetY = Math.floor(this._bounds[1]); - const boundsWidth = Math.ceil(this._bounds[2]) - offsetX; - const boundsHeight = Math.ceil(this._bounds[3]) - offsetY; - const width = Math.min(Math.ceil(Math.abs(boundsWidth * combinedScale[0] * EXPECTED_SCALE)), MAX_PATTERN_SIZE) || 1; - const height = Math.min(Math.ceil(Math.abs(boundsHeight * combinedScale[1] * EXPECTED_SCALE)), MAX_PATTERN_SIZE) || 1; - const scaleX = boundsWidth ? boundsWidth / width : 1; - const scaleY = boundsHeight ? boundsHeight / height : 1; - const context = { - coords: this._posData, - colors: this._colData, - offsetX: -offsetX, - offsetY: -offsetY, - scaleX: 1 / scaleX, - scaleY: 1 / scaleY - }; - const paddedWidth = width + BORDER_SIZE * 2; - const paddedHeight = height + BORDER_SIZE * 2; - const tmpCanvas = canvasFactory.create(paddedWidth, paddedHeight); - if (isGPUReady() && this._vertexCount > 48) { - tmpCanvas.context.drawImage(drawMeshWithGPU(this._posData, this._colData, this._vertexCount, context, backgroundColor, paddedWidth, paddedHeight, BORDER_SIZE), 0, 0); - } else { - const data = tmpCanvas.context.createImageData(width, height); - if (backgroundColor) { - const bytes = data.data; - for (let i = 0, ii = bytes.length; i < ii; i += 4) { - bytes[i] = backgroundColor[0]; - bytes[i + 1] = backgroundColor[1]; - bytes[i + 2] = backgroundColor[2]; - bytes[i + 3] = 255; - } - } - for (let i = 0, ii = this._vertexCount; i < ii; i += 3) { - drawTriangle(data, context, i, i + 1, i + 2, i, i + 1, i + 2); + _createMeshCanvas(combinedScale, backgroundColor, canvasFactory, transferMaps = null) { + const EXPECTED_SCALE = 1.1; + const MAX_PATTERN_SIZE = 3000; + const BORDER_SIZE = 2; + const offsetX = Math.floor(this._bounds[0]); + const offsetY = Math.floor(this._bounds[1]); + const boundsWidth = Math.ceil(this._bounds[2]) - offsetX; + const boundsHeight = Math.ceil(this._bounds[3]) - offsetY; + const width = Math.min(Math.ceil(Math.abs(boundsWidth * combinedScale[0] * EXPECTED_SCALE)), MAX_PATTERN_SIZE) || 1; + const height = Math.min(Math.ceil(Math.abs(boundsHeight * combinedScale[1] * EXPECTED_SCALE)), MAX_PATTERN_SIZE) || 1; + const scaleX = boundsWidth ? boundsWidth / width : 1; + const scaleY = boundsHeight ? boundsHeight / height : 1; + const context = { + coords: this._posData, + colors: this._colData, + offsetX: -offsetX, + offsetY: -offsetY, + scaleX: 1 / scaleX, + scaleY: 1 / scaleY + }; + const paddedWidth = width + BORDER_SIZE * 2; + const paddedHeight = height + BORDER_SIZE * 2; + const tmpCanvas = canvasFactory.create(paddedWidth, paddedHeight); + if (isGPUReady() && this._vertexCount > 48) { + tmpCanvas.context.drawImage(drawMeshWithGPU(this._posData, this._colData, this._vertexCount, context, backgroundColor, paddedWidth, paddedHeight, BORDER_SIZE), 0, 0); + } else { + const data = tmpCanvas.context.createImageData(width, height); + if (backgroundColor) { + const bytes = data.data; + for (let i = 0, ii = bytes.length; i < ii; i += 4) { + bytes[i] = backgroundColor[0]; + bytes[i + 1] = backgroundColor[1]; + bytes[i + 2] = backgroundColor[2]; + bytes[i + 3] = 255; + } + } + for (let i = 0, ii = this._vertexCount; i < ii; i += 3) { + drawTriangle(data, context, i, i + 1, i + 2, i, i + 1, i + 2); + } + tmpCanvas.context.putImageData(data, BORDER_SIZE, BORDER_SIZE); + } + transferMaps?.applyToCanvas(tmpCanvas.context); + return { + canvas: tmpCanvas.canvas, + offsetX: offsetX - BORDER_SIZE * scaleX, + offsetY: offsetY - BORDER_SIZE * scaleY, + scaleX, + scaleY + }; + } + isModifyingCurrentTransform() { + return true; + } + getPattern(ctx, owner, inverse, pathType) { + applyBoundingBox(ctx, this._bbox); + const scale = new Float32Array(2); + if (pathType === PathType.SHADING) { + Util.singularValueDecompose2dScale(getCurrentTransform(ctx), scale); + } else if (this.matrix) { + Util.singularValueDecompose2dScale(this.matrix, scale); + const [matrixScaleX, matrixScaleY] = scale; + Util.singularValueDecompose2dScale(owner.baseTransform, scale); + scale[0] *= matrixScaleX; + scale[1] *= matrixScaleY; + } else { + Util.singularValueDecompose2dScale(owner.baseTransform, scale); + } + const temporaryPatternCanvas = this._createMeshCanvas(scale, pathType === PathType.SHADING ? null : this._background, owner.canvasFactory, owner.current.transferMapsFallback); + if (pathType !== PathType.SHADING) { + ctx.setTransform(...owner.baseTransform); + if (this.matrix) { + ctx.transform(...this.matrix); + } + } + ctx.translate(temporaryPatternCanvas.offsetX, temporaryPatternCanvas.offsetY); + ctx.scale(temporaryPatternCanvas.scaleX, temporaryPatternCanvas.scaleY); + const pattern = ctx.createPattern(temporaryPatternCanvas.canvas, "no-repeat"); + owner.canvasFactory.destroy(temporaryPatternCanvas); + return pattern; + } +} +class DummyShadingPattern extends BaseShadingPattern { + getPattern() { + return "hotpink"; + } +} +function getShadingPattern(IR) { + switch (IR[0]) { + case "RadialAxial": + return new RadialAxialShadingPattern(IR); + case "Mesh": + return new MeshShadingPattern(IR); + case "Dummy": + return new DummyShadingPattern(); + } + throw new Error(`Unknown IR type: ${IR[0]}`); +} +const PaintType = { + COLORED: 1, + UNCOLORED: 2 +}; +class TilingPattern { + static MAX_PATTERN_SIZE = 3000; + constructor(IR, ctx, canvasGraphicsFactory, baseTransform) { + this.color = IR[1]; + this.operatorList = IR[2]; + this.matrix = IR[3]; + this.bbox = IR[4]; + this.xstep = IR[5]; + this.ystep = IR[6]; + this.paintType = IR[7]; + this.tilingType = IR[8]; + this.needsIsolation = IR[9] ?? true; + this.ctx = ctx; + this.canvasGraphicsFactory = canvasGraphicsFactory; + this.baseTransform = baseTransform; + this.patternBaseMatrix = this.matrix ? Util.transform(baseTransform, this.matrix) : baseTransform; + } + canSkipPatternCanvas([width, height, offsetX, offsetY]) { + const [x0, y0, x1, y1] = this.bbox; + const absXStep = Math.abs(this.xstep); + const absYStep = Math.abs(this.ystep); + if (width > absXStep + 1e-6 || height > absYStep + 1e-6) { + return null; + } + const nXFirst = Math.floor((offsetX - x1) / absXStep) + 1; + const nXLast = Math.ceil((offsetX + width - x0) / absXStep) - 1; + const nYFirst = Math.floor((offsetY - y1) / absYStep) + 1; + const nYLast = Math.ceil((offsetY + height - y0) / absYStep) - 1; + return nXLast <= nXFirst && nYLast <= nYFirst ? [nXFirst, nYFirst] : null; + } + updatePatternDims(clippedBBox, dims) { + const bbox = BBOX_INIT.slice(); + Util.axialAlignedBoundingBox(clippedBBox, Util.inverseTransform(this.patternBaseMatrix), bbox); + dims[0] = bbox[2] - bbox[0]; + dims[1] = bbox[3] - bbox[1]; + dims[2] = bbox[0]; + dims[3] = bbox[1]; + } + _renderTileCanvas(owner, opIdx, dimx, dimy) { + const [x0, y0, x1, y1] = this.bbox; + const tmpCanvas = owner.canvasFactory.create(dimx.size, dimy.size); + const tmpCtx = tmpCanvas.context; + const graphics = this.canvasGraphicsFactory.createCanvasGraphics(tmpCtx, opIdx); + graphics.groupLevel = owner.groupLevel; + graphics.current.transferMapsFallback = owner.current.transferMapsFallback; + this.setFillAndStrokeStyleToContext(graphics, this.paintType, this.color); + tmpCtx.translate(-dimx.scale * x0, -dimy.scale * y0); + graphics.transform(0, dimx.scale, 0, 0, dimy.scale, 0, 0); + tmpCtx.save(); + graphics.dependencyTracker?.save(); + this.clipBbox(graphics, x0, y0, x1, y1); + graphics.baseTransform = getCurrentTransform(graphics.ctx); + graphics.executeOperatorList(this.operatorList); + graphics.endDrawing(); + graphics.dependencyTracker?.restore(); + tmpCtx.restore(); + return tmpCanvas; + } + _getCombinedScales() { + const scale = new Float32Array(2); + Util.singularValueDecompose2dScale(this.matrix, scale); + const [matrixScaleX, matrixScaleY] = scale; + Util.singularValueDecompose2dScale(this.baseTransform, scale); + return [matrixScaleX * scale[0], matrixScaleY * scale[1]]; + } + drawPattern(owner, path, useEOFill = false, [n, m], opIdx) { + const [x0, y0, x1, y1] = this.bbox; + const dependencyTracker = owner.dependencyTracker; + if (dependencyTracker) { + owner.dependencyTracker = new CanvasNestedDependencyTracker(dependencyTracker, opIdx); + } + try { + owner.save(); + if (useEOFill) { + owner.ctx.clip(path, "evenodd"); + } else { + owner.ctx.clip(path); + } + owner.ctx.setTransform(...this.patternBaseMatrix); + owner.ctx.translate(n * this.xstep, m * this.ystep); + if (this.needsIsolation || owner.ctx.globalAlpha !== 1 || owner.ctx.globalCompositeOperation !== "source-over" || owner.inSMaskMode) { + const bboxWidth = x1 - x0; + const bboxHeight = y1 - y0; + const [combinedScaleX, combinedScaleY] = this._getCombinedScales(); + const dimx = this.getSizeAndScale(bboxWidth, this.ctx.canvas.width, combinedScaleX); + const dimy = this.getSizeAndScale(bboxHeight, this.ctx.canvas.height, combinedScaleY); + const tmpCanvas = this._renderTileCanvas(owner, opIdx, dimx, dimy); + owner.ctx.drawImage(tmpCanvas.canvas, x0, y0, bboxWidth, bboxHeight); + owner.canvasFactory.destroy(tmpCanvas); + } else { + owner.resetGraphicsState(); + this.setFillAndStrokeStyleToContext(owner, this.paintType, this.color); + this.clipBbox(owner, x0, y0, x1, y1); + owner.baseTransformStack.push(owner.baseTransform); + owner.baseTransform = getCurrentTransform(owner.ctx); + owner.executeOperatorList(this.operatorList); + owner.baseTransform = owner.baseTransformStack.pop(); + } + owner.restore(); + } finally { + if (dependencyTracker) { + owner.dependencyTracker = dependencyTracker; + } + } + } + createPatternCanvas(owner, opIdx) { + const [x0, y0, x1, y1] = this.bbox; + const width = x1 - x0; + const height = y1 - y0; + let { + xstep, + ystep + } = this; + xstep = Math.abs(xstep); + ystep = Math.abs(ystep); + info("TilingType: " + this.tilingType); + const [combinedScaleX, combinedScaleY] = this._getCombinedScales(); + let canvasWidth = width, + canvasHeight = height, + redrawHorizontally = false, + redrawVertically = false; + if (Math.ceil(xstep * combinedScaleX) >= Math.ceil(width * combinedScaleX)) { + canvasWidth = xstep; + } else { + redrawHorizontally = true; + } + if (Math.ceil(ystep * combinedScaleY) >= Math.ceil(height * combinedScaleY)) { + canvasHeight = ystep; + } else { + redrawVertically = true; + } + const dimx = this.getSizeAndScale(canvasWidth, this.ctx.canvas.width, combinedScaleX); + const dimy = this.getSizeAndScale(canvasHeight, this.ctx.canvas.height, combinedScaleY); + const tmpCanvas = this._renderTileCanvas(owner, opIdx, dimx, dimy); + if (redrawHorizontally || redrawVertically) { + const image = tmpCanvas.canvas; + if (redrawHorizontally) { + canvasWidth = xstep; + } + if (redrawVertically) { + canvasHeight = ystep; + } + const dimx2 = this.getSizeAndScale(canvasWidth, this.ctx.canvas.width, combinedScaleX); + const dimy2 = this.getSizeAndScale(canvasHeight, this.ctx.canvas.height, combinedScaleY); + const xSize = dimx2.size; + const ySize = dimy2.size; + const tmpCanvas2 = owner.canvasFactory.create(xSize, ySize); + const tmpCtx2 = tmpCanvas2.context; + const ii = redrawHorizontally ? Math.min(Math.floor(width / xstep), Math.ceil(image.width / xSize)) : 0; + const jj = redrawVertically ? Math.min(Math.floor(height / ystep), Math.ceil(image.height / ySize)) : 0; + let rowSource = image; + let bandCanvas = null; + if (redrawVertically) { + bandCanvas = owner.canvasFactory.create(image.width, ySize); + const bandCtx = bandCanvas.context; + for (let j = jj; j >= 0; j--) { + bandCtx.drawImage(image, 0, ySize * j, image.width, ySize, 0, 0, image.width, ySize); + } + rowSource = bandCanvas.canvas; + } + for (let i = ii; i >= 0; i--) { + tmpCtx2.drawImage(rowSource, xSize * i, 0, xSize, ySize, 0, 0, xSize, ySize); + } + if (bandCanvas) { + owner.canvasFactory.destroy(bandCanvas); + } + owner.canvasFactory.destroy(tmpCanvas); + return { + canvas: tmpCanvas2.canvas, + canvasEntry: tmpCanvas2, + scaleX: dimx2.scale, + scaleY: dimy2.scale, + offsetX: x0, + offsetY: y0 + }; + } + return { + canvas: tmpCanvas.canvas, + canvasEntry: tmpCanvas, + scaleX: dimx.scale, + scaleY: dimy.scale, + offsetX: x0, + offsetY: y0 + }; + } + getSizeAndScale(step, realOutputSize, scale) { + const maxSize = Math.max(TilingPattern.MAX_PATTERN_SIZE, realOutputSize); + let size = Math.ceil(step * scale); + if (size >= maxSize) { + size = maxSize; + } else { + scale = size / step; + } + return { + scale, + size + }; + } + clipBbox(graphics, x0, y0, x1, y1) { + const bboxWidth = x1 - x0; + const bboxHeight = y1 - y0; + const clip = new Path2D(); + clip.rect(x0, y0, bboxWidth, bboxHeight); + Util.axialAlignedBoundingBox([x0, y0, x1, y1], getCurrentTransform(graphics.ctx), graphics.current.minMax); + graphics.ctx.clip(clip); + graphics.current.updateClipFromPath(); + } + setFillAndStrokeStyleToContext(graphics, paintType, color) { + switch (paintType) { + case PaintType.COLORED: + color = "#000000"; + break; + case PaintType.UNCOLORED: + break; + default: + throw new FormatError(`Unsupported paint type: ${paintType}`); + } + const { + ctx, + current + } = graphics; + current.patternFill = current.patternStroke = false; + ctx.fillStyle = ctx.strokeStyle = current.transferMapsFallback?.applyToColor(color) ?? color; + current.fillColor = current.strokeColor = color; + } + isModifyingCurrentTransform() { + return false; + } + getPattern(ctx, owner, inverse, pathType, opIdx) { + const matrix = pathType !== PathType.SHADING ? Util.transform(inverse, this.patternBaseMatrix) : inverse; + const temporaryPatternCanvas = this.createPatternCanvas(owner, opIdx); + let domMatrix = new DOMMatrix(matrix); + domMatrix = domMatrix.translate(temporaryPatternCanvas.offsetX, temporaryPatternCanvas.offsetY); + domMatrix = domMatrix.scale(1 / temporaryPatternCanvas.scaleX, 1 / temporaryPatternCanvas.scaleY); + const pattern = ctx.createPattern(temporaryPatternCanvas.canvas, "repeat"); + owner.canvasFactory.destroy(temporaryPatternCanvas.canvasEntry); + pattern.setTransform(domMatrix); + return pattern; + } +} + +;// ./src/display/canvas.js + + + + + + + + + + + + + + + + +const MIN_FONT_SIZE = 16; +const MAX_FONT_SIZE = 100; +const EXECUTION_TIME = 15; +const EXECUTION_STEPS = 10; +const FULL_CHUNK_HEIGHT = 16; +const XY = new Float32Array(2); +function mirrorContextOperations(ctx, destCtx) { + if (ctx._removeMirroring) { + throw new Error("Context is already forwarding operations."); + } + const originalMethods = new Map(); + for (const name of ["save", "restore", "rotate", "scale", "translate", "transform", "setTransform", "resetTransform", "clip", "moveTo", "lineTo", "bezierCurveTo", "quadraticCurveTo", "arc", "arcTo", "ellipse", "rect", "roundRect", "closePath", "beginPath"]) { + const original = ctx[name]; + if (typeof original !== "function" || typeof destCtx[name] !== "function") { + continue; + } + originalMethods.set(name, original); + ctx[name] = function (...args) { + destCtx[name](...args); + return original.apply(this, args); + }; + } + ctx._removeMirroring = () => { + for (const [name, original] of originalMethods) { + ctx[name] = original; + } + delete ctx._removeMirroring; + }; +} +function drawImageAtIntegerCoords(ctx, srcImg, srcX, srcY, srcW, srcH, destX, destY, destW, destH) { + const [a, b, c, d, tx, ty] = getCurrentTransform(ctx); + if (b === 0 && c === 0) { + const tlX = destX * a + tx; + const rTlX = Math.round(tlX); + const tlY = destY * d + ty; + const rTlY = Math.round(tlY); + const brX = (destX + destW) * a + tx; + const rWidth = Math.abs(Math.round(brX) - rTlX) || 1; + const brY = (destY + destH) * d + ty; + const rHeight = Math.abs(Math.round(brY) - rTlY) || 1; + ctx.setTransform(Math.sign(a), 0, 0, Math.sign(d), rTlX, rTlY); + ctx.drawImage(srcImg, srcX, srcY, srcW, srcH, 0, 0, rWidth, rHeight); + ctx.setTransform(a, b, c, d, tx, ty); + return [rWidth, rHeight]; + } + if (a === 0 && d === 0) { + const tlX = destY * c + tx; + const rTlX = Math.round(tlX); + const tlY = destX * b + ty; + const rTlY = Math.round(tlY); + const brX = (destY + destH) * c + tx; + const rWidth = Math.abs(Math.round(brX) - rTlX) || 1; + const brY = (destX + destW) * b + ty; + const rHeight = Math.abs(Math.round(brY) - rTlY) || 1; + ctx.setTransform(0, Math.sign(b), Math.sign(c), 0, rTlX, rTlY); + ctx.drawImage(srcImg, srcX, srcY, srcW, srcH, 0, 0, rHeight, rWidth); + ctx.setTransform(a, b, c, d, tx, ty); + return [rHeight, rWidth]; + } + ctx.drawImage(srcImg, srcX, srcY, srcW, srcH, destX, destY, destW, destH); + const scaleX = Math.hypot(a, b); + const scaleY = Math.hypot(c, d); + return [scaleX * destW, scaleY * destH]; +} +class CanvasExtraState { + alphaIsShape = false; + fontSize = 0; + fontSizeScale = 1; + textMatrix = null; + textMatrixScale = 1; + fontMatrix = FONT_IDENTITY_MATRIX; + leading = 0; + x = 0; + y = 0; + lineX = 0; + lineY = 0; + charSpacing = 0; + wordSpacing = 0; + textHScale = 1; + textRenderingMode = TextRenderingMode.FILL; + textRise = 0; + fillColor = "#000000"; + strokeColor = "#000000"; + tilingPatternDims = null; + patternFill = false; + patternStroke = false; + fillAlpha = 1; + strokeAlpha = 1; + lineWidth = 1; + activeSMask = null; + transferMaps = "none"; + transferMapsFallback = null; + minMax = F32_BBOX_INIT.slice(); + constructor(width, height) { + this.clipBox = new Float32Array([0, 0, width, height]); + } + clone() { + const clone = Object.create(this); + clone.clipBox = this.clipBox.slice(); + clone.minMax = this.minMax.slice(); + clone.tilingPatternDims = this.tilingPatternDims?.slice(); + return clone; + } + getPathBoundingBox(pathType = PathType.FILL, transform = null) { + const box = this.minMax.slice(); + if (pathType === PathType.STROKE) { + if (!transform) { + unreachable("Stroke bounding box must include transform."); } - tmpCanvas.context.putImageData(data, BORDER_SIZE, BORDER_SIZE); + Util.singularValueDecompose2dScale(transform, XY); + const xStrokePad = XY[0] * this.lineWidth / 2; + const yStrokePad = XY[1] * this.lineWidth / 2; + box[0] -= xStrokePad; + box[1] -= yStrokePad; + box[2] += xStrokePad; + box[3] += yStrokePad; } - transferMaps?.applyToCanvas(tmpCanvas.context); - return { - canvas: tmpCanvas.canvas, - offsetX: offsetX - BORDER_SIZE * scaleX, - offsetY: offsetY - BORDER_SIZE * scaleY, - scaleX, - scaleY - }; + return box; } - isModifyingCurrentTransform() { - return true; + updateClipFromPath() { + const intersect = Util.intersect(this.clipBox, this.getPathBoundingBox()); + this.startNewPathAndClipBox(intersect || [0, 0, 0, 0]); } - getPattern(ctx, owner, inverse, pathType) { - applyBoundingBox(ctx, this._bbox); - const scale = new Float32Array(2); - if (pathType === PathType.SHADING) { - Util.singularValueDecompose2dScale(getCurrentTransform(ctx), scale); - } else if (this.matrix) { - Util.singularValueDecompose2dScale(this.matrix, scale); - const [matrixScaleX, matrixScaleY] = scale; - Util.singularValueDecompose2dScale(owner.baseTransform, scale); - scale[0] *= matrixScaleX; - scale[1] *= matrixScaleY; - } else { - Util.singularValueDecompose2dScale(owner.baseTransform, scale); + isEmptyClip() { + return this.minMax[0] === Infinity; + } + startNewPathAndClipBox(box) { + this.clipBox.set(box, 0); + this.minMax.set(F32_BBOX_INIT, 0); + } + getClippedPathBoundingBox(pathType = PathType.FILL, transform = null) { + return Util.intersect(this.clipBox, this.getPathBoundingBox(pathType, transform)); + } +} +function putBinaryImageData(ctx, imgData) { + const { + width, + height, + kind + } = imgData; + const partialChunkHeight = height % FULL_CHUNK_HEIGHT; + const fullChunks = (height - partialChunkHeight) / FULL_CHUNK_HEIGHT; + const totalChunks = partialChunkHeight === 0 ? fullChunks : fullChunks + 1; + const chunkImgData = ctx.createImageData(width, FULL_CHUNK_HEIGHT); + let srcPos = 0; + const src = imgData.data; + const dest = chunkImgData.data; + let i; + if (kind === ImageKind.GRAYSCALE_1BPP) { + for (i = 0; i < totalChunks; i++) { + ({ + srcPos + } = convertBlackAndWhiteToRGBA({ + src, + srcPos, + dest, + width, + height: i < fullChunks ? FULL_CHUNK_HEIGHT : partialChunkHeight + })); + ctx.putImageData(chunkImgData, 0, i * FULL_CHUNK_HEIGHT); } - const temporaryPatternCanvas = this._createMeshCanvas(scale, pathType === PathType.SHADING ? null : this._background, owner.canvasFactory, owner.current.transferMapsFallback); - if (pathType !== PathType.SHADING) { - ctx.setTransform(...owner.baseTransform); - if (this.matrix) { - ctx.transform(...this.matrix); - } + } else if (kind === ImageKind.RGBA_32BPP) { + let j = 0; + let elemsInThisChunk = width * FULL_CHUNK_HEIGHT * 4; + for (i = 0; i < fullChunks; i++) { + dest.set(src.subarray(srcPos, srcPos + elemsInThisChunk)); + srcPos += elemsInThisChunk; + ctx.putImageData(chunkImgData, 0, j); + j += FULL_CHUNK_HEIGHT; } - ctx.translate(temporaryPatternCanvas.offsetX, temporaryPatternCanvas.offsetY); - ctx.scale(temporaryPatternCanvas.scaleX, temporaryPatternCanvas.scaleY); - const pattern = ctx.createPattern(temporaryPatternCanvas.canvas, "no-repeat"); - owner.canvasFactory.destroy(temporaryPatternCanvas); - return pattern; + if (i < totalChunks) { + elemsInThisChunk = width * partialChunkHeight * 4; + dest.set(src.subarray(srcPos, srcPos + elemsInThisChunk)); + ctx.putImageData(chunkImgData, 0, j); + } + } else if (kind === ImageKind.RGB_24BPP) { + for (i = 0; i < totalChunks; i++) { + ({ + srcPos + } = convertRGBToRGBA({ + src, + srcPos, + dest: new Uint32Array(dest.buffer), + width, + height: i < fullChunks ? FULL_CHUNK_HEIGHT : partialChunkHeight + })); + ctx.putImageData(chunkImgData, 0, i * FULL_CHUNK_HEIGHT); + } + } else { + throw new Error(`bad image kind: ${kind}`); } } -class DummyShadingPattern extends BaseShadingPattern { - getPattern() { - return "hotpink"; +function putBinaryImageMask(ctx, imgData) { + if (imgData.bitmap) { + ctx.drawImage(imgData.bitmap, 0, 0); + return; + } + const { + width, + height + } = imgData; + const partialChunkHeight = height % FULL_CHUNK_HEIGHT; + const fullChunks = (height - partialChunkHeight) / FULL_CHUNK_HEIGHT; + const totalChunks = partialChunkHeight === 0 ? fullChunks : fullChunks + 1; + const chunkImgData = ctx.createImageData(width, FULL_CHUNK_HEIGHT); + let srcPos = 0; + const src = imgData.data; + const dest = chunkImgData.data; + for (let i = 0; i < totalChunks; i++) { + ({ + srcPos + } = convertBlackAndWhiteToRGBA({ + src, + srcPos, + dest, + width, + height: i < fullChunks ? FULL_CHUNK_HEIGHT : partialChunkHeight, + nonBlackColor: 0 + })); + ctx.putImageData(chunkImgData, 0, i * FULL_CHUNK_HEIGHT); } } -function getShadingPattern(IR) { - switch (IR[0]) { - case "RadialAxial": - return new RadialAxialShadingPattern(IR); - case "Mesh": - return new MeshShadingPattern(IR); - case "Dummy": - return new DummyShadingPattern(); +function copyCtxState(sourceCtx, destCtx) { + const properties = ["strokeStyle", "fillStyle", "fillRule", "globalAlpha", "lineWidth", "lineCap", "lineJoin", "miterLimit", "globalCompositeOperation", "font", "filter"]; + for (const property of properties) { + if (sourceCtx[property] !== undefined) { + destCtx[property] = sourceCtx[property]; + } + } + if (sourceCtx.setLineDash !== undefined) { + destCtx.setLineDash(sourceCtx.getLineDash()); + destCtx.lineDashOffset = sourceCtx.lineDashOffset; } - throw new Error(`Unknown IR type: ${IR[0]}`); } -const PaintType = { - COLORED: 1, - UNCOLORED: 2 -}; -class TilingPattern { - static MAX_PATTERN_SIZE = 3000; - constructor(IR, ctx, canvasGraphicsFactory, baseTransform) { - this.color = IR[1]; - this.operatorList = IR[2]; - this.matrix = IR[3]; - this.bbox = IR[4]; - this.xstep = IR[5]; - this.ystep = IR[6]; - this.paintType = IR[7]; - this.tilingType = IR[8]; - this.needsIsolation = IR[9] ?? true; - this.ctx = ctx; - this.canvasGraphicsFactory = canvasGraphicsFactory; - this.baseTransform = baseTransform; - this.patternBaseMatrix = this.matrix ? Util.transform(baseTransform, this.matrix) : baseTransform; +function setAnnotationCanvasName(canvas, canvasName) { + canvas.setAttribute?.("data-canvas-name", canvasName); + canvas._pdfjsCanvasName = canvasName; +} +function getAnnotationCanvasName(canvas) { + return canvas._pdfjsCanvasName ?? null; +} +function resetCtxToDefault(ctx) { + ctx.strokeStyle = ctx.fillStyle = "#000000"; + ctx.fillRule = "nonzero"; + ctx.globalAlpha = 1; + ctx.lineWidth = 1; + ctx.lineCap = "butt"; + ctx.lineJoin = "miter"; + ctx.miterLimit = 10; + ctx.globalCompositeOperation = "source-over"; + ctx.font = "10px sans-serif"; + if (ctx.setLineDash !== undefined) { + ctx.setLineDash([]); + ctx.lineDashOffset = 0; } - canSkipPatternCanvas([width, height, offsetX, offsetY]) { - const [x0, y0, x1, y1] = this.bbox; - const absXStep = Math.abs(this.xstep); - const absYStep = Math.abs(this.ystep); - if (width > absXStep + 1e-6 || height > absYStep + 1e-6) { - return null; + const { + filter + } = ctx; + if (filter !== "none" && filter !== "") { + ctx.filter = "none"; + } +} +class TransferMapsFallback { + #maps; + constructor(maps) { + const [mapR, mapG = mapR, mapB = mapR] = maps; + const identityMap = Util.identity0to256Map.slice(); + this.#maps = [mapR || identityMap, mapG || identityMap, mapB || identityMap]; + } + applyToColor(color) { + if (typeof color !== "string" || !color.startsWith("#")) { + return color; } - const nXFirst = Math.floor((offsetX - x1) / absXStep) + 1; - const nXLast = Math.ceil((offsetX + width - x0) / absXStep) - 1; - const nYFirst = Math.floor((offsetY - y1) / absYStep) + 1; - const nYLast = Math.ceil((offsetY + height - y0) / absYStep) - 1; - return nXLast <= nXFirst && nYLast <= nYFirst ? [nXFirst, nYFirst] : null; + const [r, g, b] = getRGBA(color); + const [mapR, mapG, mapB] = this.#maps; + return Util.makeHexColor(mapR[r], mapG[g], mapB[b]); } - updatePatternDims(clippedBBox, dims) { - const bbox = BBOX_INIT.slice(); - Util.axialAlignedBoundingBox(clippedBBox, Util.inverseTransform(this.patternBaseMatrix), bbox); - dims[0] = bbox[2] - bbox[0]; - dims[1] = bbox[3] - bbox[1]; - dims[2] = bbox[0]; - dims[3] = bbox[1]; + applyToImageData({ + data + }) { + const [mapR, mapG, mapB] = this.#maps; + for (let i = 0, ii = data.length; i < ii; i += 4) { + data[i] = mapR[data[i]]; + data[i + 1] = mapG[data[i + 1]]; + data[i + 2] = mapB[data[i + 2]]; + } } - _renderTileCanvas(owner, opIdx, dimx, dimy) { - const [x0, y0, x1, y1] = this.bbox; - const tmpCanvas = owner.canvasFactory.create(dimx.size, dimy.size); - const tmpCtx = tmpCanvas.context; - const graphics = this.canvasGraphicsFactory.createCanvasGraphics(tmpCtx, opIdx); - graphics.groupLevel = owner.groupLevel; - graphics.current.transferMapsFallback = owner.current.transferMapsFallback; - this.setFillAndStrokeStyleToContext(graphics, this.paintType, this.color); - tmpCtx.translate(-dimx.scale * x0, -dimy.scale * y0); - graphics.transform(0, dimx.scale, 0, 0, dimy.scale, 0, 0); - tmpCtx.save(); - graphics.dependencyTracker?.save(); - this.clipBbox(graphics, x0, y0, x1, y1); - graphics.baseTransform = getCurrentTransform(graphics.ctx); - graphics.executeOperatorList(this.operatorList); - graphics.endDrawing(); - graphics.dependencyTracker?.restore(); - tmpCtx.restore(); - return tmpCanvas; + applyToCanvas(ctx) { + const { + width, + height + } = ctx.canvas; + const imgData = ctx.getImageData(0, 0, width, height); + this.applyToImageData(imgData); + ctx.putImageData(imgData, 0, 0); } - _getCombinedScales() { - const scale = new Float32Array(2); - Util.singularValueDecompose2dScale(this.matrix, scale); - const [matrixScaleX, matrixScaleY] = scale; - Util.singularValueDecompose2dScale(this.baseTransform, scale); - return [matrixScaleX * scale[0], matrixScaleY * scale[1]]; +} +function getImageSmoothingEnabled(transform, interpolate, pixelRatio) { + if (interpolate) { + return true; } - drawPattern(owner, path, useEOFill = false, [n, m], opIdx) { - const [x0, y0, x1, y1] = this.bbox; - const dependencyTracker = owner.dependencyTracker; - if (dependencyTracker) { - owner.dependencyTracker = new CanvasNestedDependencyTracker(dependencyTracker, opIdx); - } - owner.save(); - if (useEOFill) { - owner.ctx.clip(path, "evenodd"); - } else { - owner.ctx.clip(path); - } - owner.ctx.setTransform(...this.patternBaseMatrix); - owner.ctx.translate(n * this.xstep, m * this.ystep); - if (this.needsIsolation || owner.ctx.globalAlpha !== 1 || owner.ctx.globalCompositeOperation !== "source-over" || owner.inSMaskMode) { - const bboxWidth = x1 - x0; - const bboxHeight = y1 - y0; - const [combinedScaleX, combinedScaleY] = this._getCombinedScales(); - const dimx = this.getSizeAndScale(bboxWidth, this.ctx.canvas.width, combinedScaleX); - const dimy = this.getSizeAndScale(bboxHeight, this.ctx.canvas.height, combinedScaleY); - const tmpCanvas = this._renderTileCanvas(owner, opIdx, dimx, dimy); - owner.ctx.drawImage(tmpCanvas.canvas, x0, y0, bboxWidth, bboxHeight); - owner.canvasFactory.destroy(tmpCanvas); - } else { - this.setFillAndStrokeStyleToContext(owner, this.paintType, this.color); - this.clipBbox(owner, x0, y0, x1, y1); - owner.baseTransformStack.push(owner.baseTransform); - owner.baseTransform = getCurrentTransform(owner.ctx); - owner.executeOperatorList(this.operatorList); - owner.baseTransform = owner.baseTransformStack.pop(); - } - owner.restore(); - if (dependencyTracker) { - owner.dependencyTracker = dependencyTracker; + Util.singularValueDecompose2dScale(transform, XY); + const actualScale = Math.fround(pixelRatio * PixelsPerInch.PDF_TO_CSS_UNITS); + return XY[0] <= actualScale && XY[1] <= actualScale; +} +const LINE_CAP_STYLES = ["butt", "round", "square"]; +const LINE_JOIN_STYLES = ["miter", "round", "bevel"]; +const NORMAL_CLIP = {}; +const EO_CLIP = {}; +class CanvasGraphics { + static #SCALE_MATRIX = null; + static #pathCaches = new WeakMap(); + #knockoutGroupLevel = 0; + #knockoutElementDepth = 0; + #knockoutTempCanvasEntry = null; + #knockoutSavedCtx = null; + #knockoutSavedSMaskCtx = null; + #knockoutSavedGCO = null; + #knockoutElementAlpha = 1; + #knockoutFilterCache; + #knockoutElementGroupMeta = null; + #groupStackMeta = []; + constructor(canvasCtx, commonObjs, objs, canvasFactory, filterFactory, { + optionalContentConfig, + markedContentStack = null, + pixelRatio = OutputScale.pixelRatio + }, annotationCanvasMap, pageColors, dependencyTracker, imagesTracker) { + this.ctx = canvasCtx; + this.current = new CanvasExtraState(this.ctx.canvas.width, this.ctx.canvas.height); + this.stateStack = []; + this.pendingClip = null; + this.pendingEOFill = false; + this.commonObjs = commonObjs; + this.objs = objs; + this.canvasFactory = canvasFactory; + this.filterFactory = filterFactory; + this.groupStack = []; + this.baseTransform = null; + this.baseTransformStack = []; + this.groupLevel = 0; + this.smaskStack = []; + this.tempSMask = null; + this.smaskGroupCanvases = []; + this.smaskPreparedEntry = null; + this.smaskPreparedFor = null; + this.smaskPreparedOffsetX = 0; + this.smaskPreparedOffsetY = 0; + this.smaskPreparedOOBAlpha = null; + this.suspendedCtx = null; + this.contentVisible = true; + this.markedContentStack = markedContentStack || []; + this.optionalContentConfig = optionalContentConfig; + this.pixelRatio = pixelRatio; + this.cachedPatterns = new Map(); + this.annotationCanvasMap = annotationCanvasMap; + this.viewportScale = 1; + this.outputScaleX = 1; + this.outputScaleY = 1; + this.pageColors = pageColors; + this._cachedScaleForStroking = [-1, 0]; + this._cachedBitmapsMap = new Map(); + this.dependencyTracker = dependencyTracker ?? null; + this.imagesTracker = imagesTracker ?? null; + } + getObject(opIdx, data, fallback = null) { + if (typeof data === "string") { + this.dependencyTracker?.recordNamedDependency(opIdx, data); + return data.startsWith("g_") ? this.commonObjs.get(data) : this.objs.get(data); } + return fallback; } - createPatternCanvas(owner, opIdx) { - const [x0, y0, x1, y1] = this.bbox; - const width = x1 - x0; - const height = y1 - y0; - let { - xstep, - ystep - } = this; - xstep = Math.abs(xstep); - ystep = Math.abs(ystep); - info("TilingType: " + this.tilingType); - const [combinedScaleX, combinedScaleY] = this._getCombinedScales(); - let canvasWidth = width, - canvasHeight = height, - redrawHorizontally = false, - redrawVertically = false; - if (Math.ceil(xstep * combinedScaleX) >= Math.ceil(width * combinedScaleX)) { - canvasWidth = xstep; - } else { - redrawHorizontally = true; + beginDrawing({ + transform, + viewport, + transparency = false, + background = null + }) { + const width = this.ctx.canvas.width; + const height = this.ctx.canvas.height; + const savedFillStyle = this.ctx.fillStyle; + this.ctx.fillStyle = background || "#ffffff"; + this.ctx.fillRect(0, 0, width, height); + this.ctx.fillStyle = savedFillStyle; + if (transparency) { + const transparentCanvas = this.transparentCanvasEntry = this.canvasFactory.create(width, height); + this.compositeCtx = this.ctx; + ({ + canvas: this.transparentCanvas, + context: this.ctx + } = transparentCanvas); + this.ctx.save(); + this.ctx.transform(...getCurrentTransform(this.compositeCtx)); } - if (Math.ceil(ystep * combinedScaleY) >= Math.ceil(height * combinedScaleY)) { - canvasHeight = ystep; - } else { - redrawVertically = true; + this.ctx.save(); + resetCtxToDefault(this.ctx); + if (transform) { + this.ctx.transform(...transform); + this.outputScaleX = transform[0]; + this.outputScaleY = transform[3]; } - const dimx = this.getSizeAndScale(canvasWidth, this.ctx.canvas.width, combinedScaleX); - const dimy = this.getSizeAndScale(canvasHeight, this.ctx.canvas.height, combinedScaleY); - const tmpCanvas = this._renderTileCanvas(owner, opIdx, dimx, dimy); - if (redrawHorizontally || redrawVertically) { - const image = tmpCanvas.canvas; - if (redrawHorizontally) { - canvasWidth = xstep; + this.ctx.transform(...viewport.transform); + this.viewportScale = viewport.scale; + this.baseTransform = getCurrentTransform(this.ctx); + } + executeOperatorList(operatorList, executionStartIdx, continueCallback, errorCallback, stepper, operationsFilter) { + const argsArray = operatorList.argsArray; + const fnArray = operatorList.fnArray; + const prevPathCache = this._pathCache; + this._pathCache = operatorList.pathCache ?? CanvasGraphics.#pathCaches.getOrInsertComputed(operatorList, makeMap); + try { + let i = executionStartIdx || 0; + const argsArrayLen = argsArray.length; + if (argsArrayLen === i) { + return i; } - if (redrawVertically) { - canvasHeight = ystep; + const chunkOperations = argsArrayLen - i > EXECUTION_STEPS && typeof continueCallback === "function"; + const endTime = chunkOperations ? Date.now() + EXECUTION_TIME : 0; + let steps = 0; + const commonObjs = this.commonObjs; + const objs = this.objs; + let fnId, fnArgs; + while (true) { + if (stepper !== undefined) { + if (i === stepper.nextBreakPoint) { + stepper.breakIt(i, continueCallback); + return i; + } + if (stepper.shouldSkip(i)) { + if (++i === argsArrayLen) { + return i; + } + continue; + } + } + if (!operationsFilter || operationsFilter(i, operatorList)) { + fnId = fnArray[i]; + fnArgs = argsArray[i] ?? null; + if (fnId !== OPS.dependency) { + if (fnArgs === null) { + this[fnId](i); + } else { + this[fnId](i, ...fnArgs); + } + } else { + for (const depObjId of fnArgs) { + this.dependencyTracker?.recordNamedData(depObjId, i); + const objsPool = depObjId.startsWith("g_") ? commonObjs : objs; + if (!objsPool.has(depObjId)) { + objsPool.get(depObjId, continueCallback, errorCallback); + return i; + } + } + } + } + i++; + if (i === argsArrayLen) { + return i; + } + if (chunkOperations && ++steps > EXECUTION_STEPS) { + if (Date.now() > endTime) { + continueCallback(); + return i; + } + steps = 0; + } } - const dimx2 = this.getSizeAndScale(canvasWidth, this.ctx.canvas.width, combinedScaleX); - const dimy2 = this.getSizeAndScale(canvasHeight, this.ctx.canvas.height, combinedScaleY); - const xSize = dimx2.size; - const ySize = dimy2.size; - const tmpCanvas2 = owner.canvasFactory.create(xSize, ySize); - const tmpCtx2 = tmpCanvas2.context; - const ii = redrawHorizontally ? Math.min(Math.floor(width / xstep), Math.ceil(image.width / xSize)) : 0; - const jj = redrawVertically ? Math.min(Math.floor(height / ystep), Math.ceil(image.height / ySize)) : 0; - let rowSource = image; - let bandCanvas = null; - if (redrawVertically) { - bandCanvas = owner.canvasFactory.create(image.width, ySize); - const bandCtx = bandCanvas.context; - for (let j = jj; j >= 0; j--) { - bandCtx.drawImage(image, 0, ySize * j, image.width, ySize, 0, 0, image.width, ySize); + } finally { + this._pathCache = prevPathCache; + } + } + #restoreInitialState() { + while (this.stateStack.length || this.inSMaskMode) { + this.restore(); + } + this.current.activeSMask = null; + this.ctx.restore(); + if (this.transparentCanvas) { + this.ctx = this.compositeCtx; + this.ctx.save(); + this.ctx.setTransform(1, 0, 0, 1, 0, 0); + this.ctx.drawImage(this.transparentCanvas, 0, 0); + this.ctx.restore(); + this.canvasFactory.destroy(this.transparentCanvasEntry); + this.transparentCanvas = null; + this.transparentCanvasEntry = null; + } + } + endDrawing() { + this.#restoreInitialState(); + for (const canvas of this.smaskGroupCanvases) { + this.canvasFactory.destroy(canvas); + } + this.smaskGroupCanvases.length = 0; + this._clearPreparedSMask(); + this.tempSMask = null; + this.smaskStack.length = 0; + for (const meta of this.#groupStackMeta) { + this.#destroyKnockoutPools(meta); + } + this.#groupStackMeta.length = 0; + this.#knockoutTempCanvasEntry = null; + this.#knockoutSavedCtx = null; + this.#knockoutSavedSMaskCtx = null; + this.#knockoutSavedGCO = null; + this.#knockoutElementAlpha = 1; + this.#knockoutElementGroupMeta = null; + this.#knockoutElementDepth = 0; + this.#knockoutGroupLevel = 0; + this.cachedPatterns.clear(); + for (const cache of this._cachedBitmapsMap.values()) { + for (const canvas of cache.values()) { + if (typeof HTMLCanvasElement !== "undefined" && canvas instanceof HTMLCanvasElement) { + canvas.width = canvas.height = 0; } - rowSource = bandCanvas.canvas; } - for (let i = ii; i >= 0; i--) { - tmpCtx2.drawImage(rowSource, xSize * i, 0, xSize, ySize, 0, 0, xSize, ySize); + cache.clear(); + } + this._cachedBitmapsMap.clear(); + this.#drawFilter(); + } + #drawFilter() { + if (this.pageColors) { + const hcmFilterId = this.filterFactory.addHCMFilter(this.pageColors.foreground, this.pageColors.background); + if (hcmFilterId !== "none") { + const savedFilter = this.ctx.filter; + this.ctx.filter = hcmFilterId; + this.ctx.drawImage(this.ctx.canvas, 0, 0); + this.ctx.filter = savedFilter; } - if (bandCanvas) { - owner.canvasFactory.destroy(bandCanvas); + } + } + _scaleImage(img, inverseTransform) { + const width = img.width ?? img.displayWidth; + const height = img.height ?? img.displayHeight; + const widthScale = Math.max(Math.hypot(inverseTransform[0], inverseTransform[1]), 1); + const heightScale = Math.max(Math.hypot(inverseTransform[2], inverseTransform[3]), 1); + const scaleSteps = []; + let ws = widthScale, + hs = heightScale, + pw = width, + ph = height; + while (ws > 2 && pw > 1 || hs > 2 && ph > 1) { + let nw = pw, + nh = ph; + if (ws > 2 && pw > 1) { + nw = Math.ceil(pw / 2); + ws /= pw / nw; } - owner.canvasFactory.destroy(tmpCanvas); + if (hs > 2 && ph > 1) { + nh = Math.ceil(ph / 2); + hs /= ph / nh; + } + scaleSteps.push({ + newWidth: nw, + newHeight: nh + }); + pw = nw; + ph = nh; + } + if (scaleSteps.length === 0) { return { - canvas: tmpCanvas2.canvas, - canvasEntry: tmpCanvas2, - scaleX: dimx2.scale, - scaleY: dimy2.scale, - offsetX: x0, - offsetY: y0 + img, + paintWidth: width, + paintHeight: height, + tmpCanvas: null }; } - return { - canvas: tmpCanvas.canvas, - canvasEntry: tmpCanvas, - scaleX: dimx.scale, - scaleY: dimy.scale, - offsetX: x0, - offsetY: y0 - }; - } - getSizeAndScale(step, realOutputSize, scale) { - const maxSize = Math.max(TilingPattern.MAX_PATTERN_SIZE, realOutputSize); - let size = Math.ceil(step * scale); - if (size >= maxSize) { - size = maxSize; - } else { - scale = size / step; + if (scaleSteps.length === 1) { + const { + newWidth, + newHeight + } = scaleSteps[0]; + const tmpCanvas = this.canvasFactory.create(newWidth, newHeight); + tmpCanvas.context.drawImage(img, 0, 0, width, height, 0, 0, newWidth, newHeight); + return { + img: tmpCanvas.canvas, + paintWidth: newWidth, + paintHeight: newHeight, + tmpCanvas + }; + } + let readEntry = this.canvasFactory.create(1, 1); + let writeEntry = this.canvasFactory.create(1, 1); + let paintWidth = width, + paintHeight = height; + let source = img; + for (const { + newWidth, + newHeight + } of scaleSteps) { + this.canvasFactory.reset(writeEntry, newWidth, newHeight); + writeEntry.context.drawImage(source, 0, 0, paintWidth, paintHeight, 0, 0, newWidth, newHeight); + [readEntry, writeEntry] = [writeEntry, readEntry]; + source = readEntry.canvas; + paintWidth = newWidth; + paintHeight = newHeight; } + this.canvasFactory.destroy(writeEntry); return { - scale, - size + img: readEntry.canvas, + paintWidth, + paintHeight, + tmpCanvas: readEntry }; } - clipBbox(graphics, x0, y0, x1, y1) { - const bboxWidth = x1 - x0; - const bboxHeight = y1 - y0; - const clip = new Path2D(); - clip.rect(x0, y0, bboxWidth, bboxHeight); - Util.axialAlignedBoundingBox([x0, y0, x1, y1], getCurrentTransform(graphics.ctx), graphics.current.minMax); - graphics.ctx.clip(clip); - graphics.current.updateClipFromPath(); - } - setFillAndStrokeStyleToContext(graphics, paintType, color) { - switch (paintType) { - case PaintType.COLORED: - color = "#000000"; - break; - case PaintType.UNCOLORED: - break; - default: - throw new FormatError(`Unsupported paint type: ${paintType}`); - } + _createMaskCanvas(opIdx, img) { + const ctx = this.ctx; const { - ctx, - current - } = graphics; - current.patternFill = current.patternStroke = false; - ctx.fillStyle = ctx.strokeStyle = current.transferMapsFallback?.applyToColor(color) ?? color; - current.fillColor = current.strokeColor = color; - } - isModifyingCurrentTransform() { - return false; - } - getPattern(ctx, owner, inverse, pathType, opIdx) { - const matrix = pathType !== PathType.SHADING ? Util.transform(inverse, this.patternBaseMatrix) : inverse; - const temporaryPatternCanvas = this.createPatternCanvas(owner, opIdx); - let domMatrix = new DOMMatrix(matrix); - domMatrix = domMatrix.translate(temporaryPatternCanvas.offsetX, temporaryPatternCanvas.offsetY); - domMatrix = domMatrix.scale(1 / temporaryPatternCanvas.scaleX, 1 / temporaryPatternCanvas.scaleY); - const pattern = ctx.createPattern(temporaryPatternCanvas.canvas, "repeat"); - owner.canvasFactory.destroy(temporaryPatternCanvas.canvasEntry); - pattern.setTransform(domMatrix); - return pattern; - } -} - -;// ./src/display/canvas.js - - - - - - - - - - - - - - -const MIN_FONT_SIZE = 16; -const MAX_FONT_SIZE = 100; -const EXECUTION_TIME = 15; -const EXECUTION_STEPS = 10; -const FULL_CHUNK_HEIGHT = 16; -const XY = new Float32Array(2); -function mirrorContextOperations(ctx, destCtx) { - if (ctx._removeMirroring) { - throw new Error("Context is already forwarding operations."); - } - const originalMethods = new Map(); - for (const name of ["save", "restore", "rotate", "scale", "translate", "transform", "setTransform", "resetTransform", "clip", "moveTo", "lineTo", "bezierCurveTo", "quadraticCurveTo", "arc", "arcTo", "ellipse", "rect", "roundRect", "closePath", "beginPath"]) { - const original = ctx[name]; - if (typeof original !== "function" || typeof destCtx[name] !== "function") { - continue; + width, + height + } = img; + const isPatternFill = this.current.patternFill; + const fillColor = isPatternFill ? this.current.fillColor : ctx.fillStyle; + const currentTransform = getCurrentTransform(ctx); + let cache, cacheKey, scaled, maskCanvas; + if ((img.bitmap || img.data) && img.count > 1) { + const mainKey = img.bitmap || img.data.buffer; + cacheKey = JSON.stringify(isPatternFill ? currentTransform : [currentTransform.slice(0, 4), fillColor]); + cache = this._cachedBitmapsMap.getOrInsertComputed(mainKey, makeMap); + const cachedImage = cache.get(cacheKey); + if (cachedImage && !isPatternFill) { + const offsetX = Math.round(Math.min(currentTransform[0], currentTransform[2]) + currentTransform[4]); + const offsetY = Math.round(Math.min(currentTransform[1], currentTransform[3]) + currentTransform[5]); + this.dependencyTracker?.recordDependencies(opIdx, Dependencies.transformAndFill); + return { + canvas: cachedImage, + offsetX, + offsetY + }; + } + scaled = cachedImage; } - originalMethods.set(name, original); - ctx[name] = function (...args) { - destCtx[name](...args); - return original.apply(this, args); - }; - } - ctx._removeMirroring = () => { - for (const [name, original] of originalMethods) { - ctx[name] = original; + if (!scaled) { + maskCanvas = this.canvasFactory.create(width, height); + putBinaryImageMask(maskCanvas.context, img); } - delete ctx._removeMirroring; - }; -} -function drawImageAtIntegerCoords(ctx, srcImg, srcX, srcY, srcW, srcH, destX, destY, destW, destH) { - const [a, b, c, d, tx, ty] = getCurrentTransform(ctx); - if (b === 0 && c === 0) { - const tlX = destX * a + tx; - const rTlX = Math.round(tlX); - const tlY = destY * d + ty; - const rTlY = Math.round(tlY); - const brX = (destX + destW) * a + tx; - const rWidth = Math.abs(Math.round(brX) - rTlX) || 1; - const brY = (destY + destH) * d + ty; - const rHeight = Math.abs(Math.round(brY) - rTlY) || 1; - ctx.setTransform(Math.sign(a), 0, 0, Math.sign(d), rTlX, rTlY); - ctx.drawImage(srcImg, srcX, srcY, srcW, srcH, 0, 0, rWidth, rHeight); - ctx.setTransform(a, b, c, d, tx, ty); - return [rWidth, rHeight]; - } - if (a === 0 && d === 0) { - const tlX = destY * c + tx; - const rTlX = Math.round(tlX); - const tlY = destX * b + ty; - const rTlY = Math.round(tlY); - const brX = (destY + destH) * c + tx; - const rWidth = Math.abs(Math.round(brX) - rTlX) || 1; - const brY = (destX + destW) * b + ty; - const rHeight = Math.abs(Math.round(brY) - rTlY) || 1; - ctx.setTransform(0, Math.sign(b), Math.sign(c), 0, rTlX, rTlY); - ctx.drawImage(srcImg, srcX, srcY, srcW, srcH, 0, 0, rHeight, rWidth); - ctx.setTransform(a, b, c, d, tx, ty); - return [rHeight, rWidth]; - } - ctx.drawImage(srcImg, srcX, srcY, srcW, srcH, destX, destY, destW, destH); - const scaleX = Math.hypot(a, b); - const scaleY = Math.hypot(c, d); - return [scaleX * destW, scaleY * destH]; -} -class CanvasExtraState { - alphaIsShape = false; - fontSize = 0; - fontSizeScale = 1; - textMatrix = null; - textMatrixScale = 1; - fontMatrix = FONT_IDENTITY_MATRIX; - leading = 0; - x = 0; - y = 0; - lineX = 0; - lineY = 0; - charSpacing = 0; - wordSpacing = 0; - textHScale = 1; - textRenderingMode = TextRenderingMode.FILL; - textRise = 0; - fillColor = "#000000"; - strokeColor = "#000000"; - tilingPatternDims = null; - patternFill = false; - patternStroke = false; - fillAlpha = 1; - strokeAlpha = 1; - lineWidth = 1; - activeSMask = null; - transferMaps = "none"; - transferMapsFallback = null; - minMax = F32_BBOX_INIT.slice(); - constructor(width, height) { - this.clipBox = new Float32Array([0, 0, width, height]); - } - clone() { - const clone = Object.create(this); - clone.clipBox = this.clipBox.slice(); - clone.minMax = this.minMax.slice(); - clone.tilingPatternDims = this.tilingPatternDims?.slice(); - return clone; - } - getPathBoundingBox(pathType = PathType.FILL, transform = null) { - const box = this.minMax.slice(); - if (pathType === PathType.STROKE) { - if (!transform) { - unreachable("Stroke bounding box must include transform."); + let maskToCanvas = Util.transform(currentTransform, [1 / width, 0, 0, -1 / height, 0, 0]); + maskToCanvas = Util.transform(maskToCanvas, [1, 0, 0, 1, 0, -height]); + const minMax = F32_BBOX_INIT.slice(); + Util.axialAlignedBoundingBox([0, 0, width, height], maskToCanvas, minMax); + const [minX, minY, maxX, maxY] = minMax; + const drawnWidth = Math.round(maxX - minX) || 1; + const drawnHeight = Math.round(maxY - minY) || 1; + const fillCanvas = this.canvasFactory.create(drawnWidth, drawnHeight); + const fillCtx = fillCanvas.context; + const offsetX = minX; + const offsetY = minY; + fillCtx.translate(-offsetX, -offsetY); + fillCtx.transform(...maskToCanvas); + let scaledEntry = null; + if (!scaled) { + const scaleResult = this._scaleImage(maskCanvas.canvas, getCurrentTransformInverse(fillCtx)); + scaled = scaleResult.img; + scaledEntry = scaleResult.tmpCanvas; + if (scaled !== maskCanvas.canvas) { + this.canvasFactory.destroy(maskCanvas); + maskCanvas = null; + } + if (cache && isPatternFill) { + cache.set(cacheKey, scaled); + scaledEntry = null; + maskCanvas = null; } - Util.singularValueDecompose2dScale(transform, XY); - const xStrokePad = XY[0] * this.lineWidth / 2; - const yStrokePad = XY[1] * this.lineWidth / 2; - box[0] -= xStrokePad; - box[1] -= yStrokePad; - box[2] += xStrokePad; - box[3] += yStrokePad; } - return box; + fillCtx.imageSmoothingEnabled = getImageSmoothingEnabled(getCurrentTransform(fillCtx), img.interpolate, this.pixelRatio); + drawImageAtIntegerCoords(fillCtx, scaled, 0, 0, scaled.width, scaled.height, 0, 0, width, height); + if (scaledEntry) { + this.canvasFactory.destroy(scaledEntry); + } + if (maskCanvas) { + this.canvasFactory.destroy(maskCanvas); + } + fillCtx.globalCompositeOperation = "source-in"; + const inverse = Util.transform(getCurrentTransformInverse(fillCtx), [1, 0, 0, 1, -offsetX, -offsetY]); + fillCtx.fillStyle = isPatternFill ? fillColor.getPattern(ctx, this, inverse, PathType.FILL, opIdx) : fillColor; + fillCtx.fillRect(0, 0, width, height); + if (cache && !isPatternFill) { + cache.set(cacheKey, fillCanvas.canvas); + } + this.dependencyTracker?.recordDependencies(opIdx, Dependencies.transformAndFill); + return { + canvas: fillCanvas.canvas, + canvasEntry: cache && !isPatternFill ? null : fillCanvas, + offsetX: Math.round(offsetX), + offsetY: Math.round(offsetY) + }; } - updateClipFromPath() { - const intersect = Util.intersect(this.clipBox, this.getPathBoundingBox()); - this.startNewPathAndClipBox(intersect || [0, 0, 0, 0]); + setLineWidth(opIdx, width) { + this.dependencyTracker?.recordSimpleData("lineWidth", opIdx); + if (width !== this.current.lineWidth) { + this._cachedScaleForStroking[0] = -1; + } + this.current.lineWidth = width; + this.ctx.lineWidth = width; } - isEmptyClip() { - return this.minMax[0] === Infinity; + setLineCap(opIdx, style) { + this.dependencyTracker?.recordSimpleData("lineCap", opIdx); + this.ctx.lineCap = LINE_CAP_STYLES[style]; } - startNewPathAndClipBox(box) { - this.clipBox.set(box, 0); - this.minMax.set(F32_BBOX_INIT, 0); + setLineJoin(opIdx, style) { + this.dependencyTracker?.recordSimpleData("lineJoin", opIdx); + this.ctx.lineJoin = LINE_JOIN_STYLES[style]; } - getClippedPathBoundingBox(pathType = PathType.FILL, transform = null) { - return Util.intersect(this.clipBox, this.getPathBoundingBox(pathType, transform)); + setMiterLimit(opIdx, limit) { + this.dependencyTracker?.recordSimpleData("miterLimit", opIdx); + this.ctx.miterLimit = limit; } -} -function putBinaryImageData(ctx, imgData) { - const { - width, - height, - kind - } = imgData; - const partialChunkHeight = height % FULL_CHUNK_HEIGHT; - const fullChunks = (height - partialChunkHeight) / FULL_CHUNK_HEIGHT; - const totalChunks = partialChunkHeight === 0 ? fullChunks : fullChunks + 1; - const chunkImgData = ctx.createImageData(width, FULL_CHUNK_HEIGHT); - let srcPos = 0; - const src = imgData.data; - const dest = chunkImgData.data; - let i; - if (kind === ImageKind.GRAYSCALE_1BPP) { - for (i = 0; i < totalChunks; i++) { - ({ - srcPos - } = convertBlackAndWhiteToRGBA({ - src, - srcPos, - dest, - width, - height: i < fullChunks ? FULL_CHUNK_HEIGHT : partialChunkHeight - })); - ctx.putImageData(chunkImgData, 0, i * FULL_CHUNK_HEIGHT); - } - } else if (kind === ImageKind.RGBA_32BPP) { - let j = 0; - let elemsInThisChunk = width * FULL_CHUNK_HEIGHT * 4; - for (i = 0; i < fullChunks; i++) { - dest.set(src.subarray(srcPos, srcPos + elemsInThisChunk)); - srcPos += elemsInThisChunk; - ctx.putImageData(chunkImgData, 0, j); - j += FULL_CHUNK_HEIGHT; - } - if (i < totalChunks) { - elemsInThisChunk = width * partialChunkHeight * 4; - dest.set(src.subarray(srcPos, srcPos + elemsInThisChunk)); - ctx.putImageData(chunkImgData, 0, j); + setDash(opIdx, dashArray, dashPhase) { + this.dependencyTracker?.recordSimpleData("dash", opIdx); + const ctx = this.ctx; + if (ctx.setLineDash !== undefined) { + ctx.setLineDash(dashArray); + ctx.lineDashOffset = dashPhase; } - } else if (kind === ImageKind.RGB_24BPP) { - for (i = 0; i < totalChunks; i++) { - ({ - srcPos - } = convertRGBToRGBA({ - src, - srcPos, - dest: new Uint32Array(dest.buffer), - width, - height: i < fullChunks ? FULL_CHUNK_HEIGHT : partialChunkHeight - })); - ctx.putImageData(chunkImgData, 0, i * FULL_CHUNK_HEIGHT); + } + setRenderingIntent(opIdx, intent) {} + setFlatness(opIdx, flatness) {} + setGState(opIdx, states) { + for (const [key, value] of states) { + switch (key) { + case "LW": + this.setLineWidth(opIdx, value); + break; + case "LC": + this.setLineCap(opIdx, value); + break; + case "LJ": + this.setLineJoin(opIdx, value); + break; + case "ML": + this.setMiterLimit(opIdx, value); + break; + case "D": + this.setDash(opIdx, value[0], value[1]); + break; + case "RI": + this.setRenderingIntent(opIdx, value); + break; + case "FL": + this.setFlatness(opIdx, value); + break; + case "Font": + this.setFont(opIdx, value[0], value[1]); + break; + case "CA": + this.dependencyTracker?.recordSimpleData("strokeAlpha", opIdx); + this.current.strokeAlpha = value; + break; + case "ca": + this.dependencyTracker?.recordSimpleData("fillAlpha", opIdx); + this.ctx.globalAlpha = this.current.fillAlpha = value; + break; + case "BM": + this.dependencyTracker?.recordSimpleData("globalCompositeOperation", opIdx); + this.ctx.globalCompositeOperation = value; + break; + case "SMask": + this.dependencyTracker?.recordSimpleData("SMask", opIdx); + this.current.activeSMask = value ? this.tempSMask : null; + if (this.current.activeSMask) { + this.current.activeSMask.blendMode = this.ctx.globalCompositeOperation; + } + this.tempSMask = null; + this.checkSMaskState(opIdx); + break; + case "TR": + { + this.dependencyTracker?.recordSimpleData("filter", opIdx); + let filter = this.filterFactory.addFilter(value); + this.ctx.filter = filter; + let fallback = null; + if (value && (filter === "none" || !FeatureTest.isCanvasFilterSupported || this.ctx.filter === "none" || this.ctx.filter === "")) { + this.ctx.filter = filter = "none"; + fallback = new TransferMapsFallback(value); + } + this.current.transferMaps = filter; + if (fallback || this.current.transferMapsFallback) { + this.current.transferMapsFallback = fallback; + if (!this.current.patternFill) { + this.ctx.fillStyle = this.#transferColor(this.current.fillColor); + } + if (!this.current.patternStroke) { + this.ctx.strokeStyle = this.#transferColor(this.current.strokeColor); + } + } + break; + } + } } - } else { - throw new Error(`bad image kind: ${kind}`); } -} -function putBinaryImageMask(ctx, imgData) { - if (imgData.bitmap) { - ctx.drawImage(imgData.bitmap, 0, 0); - return; + get inSMaskMode() { + return !!this.suspendedCtx; } - const { - width, - height - } = imgData; - const partialChunkHeight = height % FULL_CHUNK_HEIGHT; - const fullChunks = (height - partialChunkHeight) / FULL_CHUNK_HEIGHT; - const totalChunks = partialChunkHeight === 0 ? fullChunks : fullChunks + 1; - const chunkImgData = ctx.createImageData(width, FULL_CHUNK_HEIGHT); - let srcPos = 0; - const src = imgData.data; - const dest = chunkImgData.data; - for (let i = 0; i < totalChunks; i++) { - ({ - srcPos - } = convertBlackAndWhiteToRGBA({ - src, - srcPos, - dest, - width, - height: i < fullChunks ? FULL_CHUNK_HEIGHT : partialChunkHeight, - nonBlackColor: 0 - })); - ctx.putImageData(chunkImgData, 0, i * FULL_CHUNK_HEIGHT); + _clearPreparedSMask() { + if (this.smaskPreparedEntry) { + this.canvasFactory.destroy(this.smaskPreparedEntry); + this.smaskPreparedEntry = null; + } + this.smaskPreparedFor = null; + this.smaskPreparedOffsetX = 0; + this.smaskPreparedOffsetY = 0; + this.smaskPreparedOOBAlpha = null; } -} -function copyCtxState(sourceCtx, destCtx) { - const properties = ["strokeStyle", "fillStyle", "fillRule", "globalAlpha", "lineWidth", "lineCap", "lineJoin", "miterLimit", "globalCompositeOperation", "font", "filter"]; - for (const property of properties) { - if (sourceCtx[property] !== undefined) { - destCtx[property] = sourceCtx[property]; + _ensurePreparedSMask(smask) { + if (smask === this.smaskPreparedFor) { + return; } + this._clearPreparedSMask(); + this._prepareSMaskCanvas(smask); } - if (sourceCtx.setLineDash !== undefined) { - destCtx.setLineDash(sourceCtx.getLineDash()); - destCtx.lineDashOffset = sourceCtx.lineDashOffset; + checkSMaskState(opIdx) { + const inSMaskMode = this.inSMaskMode; + if (this.current.activeSMask && !inSMaskMode) { + this.beginSMaskMode(opIdx); + } else if (!this.current.activeSMask && inSMaskMode) { + this.endSMaskMode(); + } else if (this.current.activeSMask && inSMaskMode) { + this._ensurePreparedSMask(this.current.activeSMask); + } } -} -function resetCtxToDefault(ctx) { - ctx.strokeStyle = ctx.fillStyle = "#000000"; - ctx.fillRule = "nonzero"; - ctx.globalAlpha = 1; - ctx.lineWidth = 1; - ctx.lineCap = "butt"; - ctx.lineJoin = "miter"; - ctx.miterLimit = 10; - ctx.globalCompositeOperation = "source-over"; - ctx.font = "10px sans-serif"; - if (ctx.setLineDash !== undefined) { - ctx.setLineDash([]); - ctx.lineDashOffset = 0; + _prepareSMaskCanvas(smask) { + const { + canvas: maskCanvas, + subtype, + backdrop, + transferMap + } = smask; + const hasFilter = subtype === "Luminosity" || subtype === "Alpha" && transferMap; + if (!hasFilter && !(subtype === "Luminosity" && backdrop)) { + this.smaskPreparedFor = smask; + return; + } + let filteredOOBAlpha; + if (subtype === "Luminosity" && backdrop) { + const [r, g, b] = getRGBA(backdrop); + const inputAlpha = Math.round(0.3 * r + 0.59 * g + 0.11 * b); + filteredOOBAlpha = transferMap?.[inputAlpha] ?? inputAlpha; + } else { + filteredOOBAlpha = transferMap?.[0] ?? 0; + } + const SMASK_LAYER_TO_MASK_AREA_RATIO = 4; + const { + width: layerW, + height: layerH + } = this.ctx.canvas; + const maskArea = maskCanvas.width * maskCanvas.height; + const useLayerSize = layerW * layerH < SMASK_LAYER_TO_MASK_AREA_RATIO * maskArea; + const filterSpec = hasFilter ? { + url: subtype === "Alpha" ? this.filterFactory.addAlphaFilter(transferMap) : this.filterFactory.addLuminosityFilter(transferMap), + subtype, + transferMap + } : null; + const bakedBackdrop = subtype === "Luminosity" ? backdrop : null; + let preparedEntry, offsetX, offsetY; + if (useLayerSize) { + preparedEntry = this._bakeSMaskCanvas(maskCanvas, smask.offsetX, smask.offsetY, layerW, layerH, bakedBackdrop, filterSpec); + offsetX = 0; + offsetY = 0; + } else { + preparedEntry = this._bakeSMaskCanvas(maskCanvas, 0, 0, maskCanvas.width, maskCanvas.height, bakedBackdrop, filterSpec); + offsetX = smask.offsetX; + offsetY = smask.offsetY; + } + this.smaskPreparedEntry = preparedEntry; + this.smaskPreparedFor = smask; + this.smaskPreparedOffsetX = offsetX; + this.smaskPreparedOffsetY = offsetY; + this.smaskPreparedOOBAlpha = !useLayerSize && filteredOOBAlpha !== 0 ? filteredOOBAlpha : null; } - const { - filter - } = ctx; - if (filter !== "none" && filter !== "") { - ctx.filter = "none"; + _bakeSMaskCanvas(maskCanvas, drawX, drawY, w, h, backdrop, filterSpec) { + if (!backdrop && !filterSpec) { + unreachable("_bakeSMaskCanvas with neither backdrop nor filter"); + } + const srcEntry = this.canvasFactory.create(w, h); + const sCtx = srcEntry.context; + sCtx.drawImage(maskCanvas, drawX, drawY); + if (backdrop) { + sCtx.globalCompositeOperation = "destination-atop"; + sCtx.fillStyle = backdrop; + sCtx.fillRect(0, 0, w, h); + } + if (!filterSpec) { + return srcEntry; + } + const preparedEntry = this.canvasFactory.create(w, h); + const pCtx = preparedEntry.context; + pCtx.filter = filterSpec.url; + const filterApplied = FeatureTest.isCanvasFilterSupported && pCtx.filter !== "none" && pCtx.filter !== ""; + pCtx.drawImage(srcEntry.canvas, 0, 0); + if (FeatureTest.isCanvasFilterSupported) { + pCtx.filter = "none"; + } + if (!filterApplied) { + const img = pCtx.getImageData(0, 0, w, h); + const { + data + } = img; + const { + transferMap + } = filterSpec; + if (filterSpec.subtype === "Luminosity") { + for (let i = 0, ii = data.length; i < ii; i += 4) { + const a = 0.3 * data[i] + 0.59 * data[i + 1] + 0.11 * data[i + 2] + 0.5 | 0; + data[i] = data[i + 1] = data[i + 2] = 0; + data[i + 3] = transferMap?.[a] ?? a; + } + } else { + for (let i = 3, ii = data.length; i < ii; i += 4) { + data[i] = transferMap[data[i]]; + } + } + pCtx.putImageData(img, 0, 0); + } + this.canvasFactory.destroy(srcEntry); + return preparedEntry; } -} -class TransferMapsFallback { - #maps; - constructor(maps) { - const [mapR, mapG = mapR, mapB = mapR] = maps; + beginSMaskMode(opIdx) { + if (this.inSMaskMode) { + throw new Error("beginSMaskMode called while already in smask mode"); + } const { - identityMap - } = TransferMapsFallback; - this.#maps = [mapR || identityMap, mapG || identityMap, mapB || identityMap]; + width: drawnWidth, + height: drawnHeight + } = this.ctx.canvas; + const scratchCanvas = this.canvasFactory.create(drawnWidth, drawnHeight); + this.smaskScratchCanvas = scratchCanvas; + this.suspendedCtx = this.ctx; + const ctx = this.ctx = scratchCanvas.context; + ctx.setTransform(this.suspendedCtx.getTransform()); + copyCtxState(this.suspendedCtx, ctx); + mirrorContextOperations(ctx, this.suspendedCtx); + this._ensurePreparedSMask(this.current.activeSMask); + this.setGState(opIdx, [["BM", "source-over"]]); } - static get identityMap() { - return util_shadow(this, "identityMap", Uint8Array.from({ - length: 256 - }, (_, i) => i)); + endSMaskMode() { + if (!this.inSMaskMode) { + throw new Error("endSMaskMode called while not in smask mode"); + } + this.ctx._removeMirroring(); + copyCtxState(this.ctx, this.suspendedCtx); + this.ctx = this.suspendedCtx; + this.suspendedCtx = null; + this.canvasFactory.destroy(this.smaskScratchCanvas); + this.smaskScratchCanvas = null; + this._clearPreparedSMask(); } - applyToColor(color) { - if (typeof color !== "string" || !color.startsWith("#")) { - return color; + #createKnockoutMaskCanvas(sourceCanvas, reuseEntry = null, alpha = 1) { + const { + width, + height + } = sourceCanvas; + const maskEntry = reuseEntry ?? this.canvasFactory.create(width, height); + const maskCtx = maskEntry.context; + alpha = Math.round(alpha * 255) / 255; + const needsAlphaScaling = alpha < 1; + if (needsAlphaScaling && this.#knockoutFilterCache === undefined) { + this.#knockoutFilterCache = FeatureTest.isCanvasFilterSupported ? new Map() : "none"; } - const [r, g, b] = getRGBA(color); - const [mapR, mapG, mapB] = this.#maps; - return Util.makeHexColor(mapR[r], mapG[g], mapB[b]); + let knockoutFilter = "none"; + if (needsAlphaScaling && this.#knockoutFilterCache instanceof Map) { + knockoutFilter = this.#knockoutFilterCache.getOrInsertComputed(alpha, () => this.filterFactory.addKnockoutFilter(alpha)); + } + if (!needsAlphaScaling || knockoutFilter !== "none") { + if (reuseEntry) { + maskCtx.save(); + maskCtx.setTransform(1, 0, 0, 1, 0, 0); + maskCtx.clearRect(0, 0, width, height); + maskCtx.restore(); + } + maskCtx.filter = knockoutFilter; + maskCtx.drawImage(sourceCanvas, 0, 0); + maskCtx.filter = "none"; + return maskEntry; + } + const sourceData = sourceCanvas.getContext("2d", { + willReadFrequently: true + }).getImageData(0, 0, width, height); + const maskData = maskCtx.createImageData(width, height); + const sourcePixels = sourceData.data, + maskPixels = maskData.data; + const alphaScale = alpha > 0 ? 1 / alpha : 1e6; + for (let i = 3, ii = sourcePixels.length; i < ii; i += 4) { + maskPixels[i] = Math.min(Math.round(sourcePixels[i] * alphaScale), 255); + } + maskCtx.putImageData(maskData, 0, 0); + return maskEntry; } - applyToImageData({ - data - }) { - const [mapR, mapG, mapB] = this.#maps; - for (let i = 0, ii = data.length; i < ii; i += 4) { - data[i] = mapR[data[i]]; - data[i + 1] = mapG[data[i + 1]]; - data[i + 2] = mapB[data[i + 2]]; + #getOrCreatePooledEntry(meta, key, width, height) { + let entry = meta?.[key] ?? null; + if (entry && (entry.canvas.width !== width || entry.canvas.height !== height)) { + this.canvasFactory.destroy(entry); + entry = null; + } + if (!entry) { + entry = this.canvasFactory.create(width, height); + if (meta) { + meta[key] = entry; + } + return entry; } + const ctx = entry.context; + ctx.save(); + ctx.setTransform(1, 0, 0, 1, 0, 0); + ctx.clearRect(0, 0, width, height); + ctx.restore(); + return entry; } - applyToCanvas(ctx) { + #compositeKnockoutSurface(destCtx, surfaceCanvas, options = {}) { + const { + backdropCanvas = null, + destTransform = [1, 0, 0, 1, 0, 0], + backdropOffset = [0, 0], + reuseMaskEntry = null, + poolMeta = null, + sourceAlpha = 1, + sourceFilter = "none", + knockoutAlpha = 1 + } = options; const { width, height - } = ctx.canvas; - const imgData = ctx.getImageData(0, 0, width, height); - this.applyToImageData(imgData); - ctx.putImageData(imgData, 0, 0); + } = surfaceCanvas; + const knockoutMaskEntry = this.#createKnockoutMaskCanvas(surfaceCanvas, reuseMaskEntry, knockoutAlpha); + const sourceCompositeOperation = destCtx.globalCompositeOperation; + destCtx.save(); + destCtx.setTransform(...destTransform); + destCtx.globalAlpha = 1; + if (FeatureTest.isCanvasFilterSupported) { + destCtx.filter = "none"; + } + destCtx.globalCompositeOperation = "destination-out"; + destCtx.drawImage(knockoutMaskEntry.canvas, 0, 0); + if (backdropCanvas) { + const [bx, by] = backdropOffset; + const backdropEntry = this.#getOrCreatePooledEntry(poolMeta, "knockoutBackdropEntry", width, height); + const backdropCtx = backdropEntry.context; + backdropCtx.drawImage(backdropCanvas, bx, by, width, height, 0, 0, width, height); + backdropCtx.globalCompositeOperation = "destination-in"; + backdropCtx.drawImage(knockoutMaskEntry.canvas, 0, 0); + backdropCtx.globalCompositeOperation = "source-over"; + destCtx.globalCompositeOperation = "destination-over"; + destCtx.drawImage(backdropEntry.canvas, 0, 0); + if (!poolMeta) { + this.canvasFactory.destroy(backdropEntry); + } + } + destCtx.globalCompositeOperation = sourceCompositeOperation; + destCtx.globalAlpha = sourceAlpha; + if (FeatureTest.isCanvasFilterSupported) { + destCtx.filter = sourceFilter ?? "none"; + } + destCtx.drawImage(surfaceCanvas, 0, 0); + destCtx.restore(); + if (!reuseMaskEntry) { + this.canvasFactory.destroy(knockoutMaskEntry); + } } -} -function getImageSmoothingEnabled(transform, interpolate) { - if (interpolate) { + #beginKnockoutElement(alpha = 1) { + if (this.#knockoutGroupLevel === 0 || this.#knockoutElementDepth > 0 || !this.contentVisible) { + return false; + } + this.#knockoutElementDepth++; + this.#knockoutElementAlpha = alpha; + const groupMeta = this.#groupStackMeta.at(-1); + const { + canvas + } = this.ctx; + const tempEntry = this.#getOrCreatePooledEntry(groupMeta, "knockoutTempEntry", canvas.width, canvas.height); + this.#knockoutTempCanvasEntry = tempEntry; + const tempCtx = tempEntry.context; + tempCtx.save(); + tempCtx.setTransform(this.ctx.getTransform()); + copyCtxState(this.ctx, tempCtx); + this.#knockoutSavedGCO = tempCtx.globalCompositeOperation; + tempCtx.globalCompositeOperation = "source-over"; + mirrorContextOperations(tempCtx, this.ctx); + this.#knockoutElementGroupMeta = groupMeta; + this.#knockoutSavedCtx = this.ctx; + this.#knockoutSavedSMaskCtx = this.suspendedCtx; + this.ctx = tempCtx; + if (this.inSMaskMode) { + this.suspendedCtx = tempCtx; + } return true; } - Util.singularValueDecompose2dScale(transform, XY); - const actualScale = Math.fround(OutputScale.pixelRatio * PixelsPerInch.PDF_TO_CSS_UNITS); - return XY[0] <= actualScale && XY[1] <= actualScale; -} -const LINE_CAP_STYLES = ["butt", "round", "square"]; -const LINE_JOIN_STYLES = ["miter", "round", "bevel"]; -const NORMAL_CLIP = {}; -const EO_CLIP = {}; -class CanvasGraphics { - static #SCALE_MATRIX = null; - #knockoutGroupLevel = 0; - #knockoutElementDepth = 0; - #knockoutTempCanvasEntry = null; - #knockoutSavedCtx = null; - #knockoutSavedSMaskCtx = null; - #knockoutSavedGCO = null; - #knockoutElementAlpha = 1; - #knockoutFilterCache; - #knockoutElementGroupMeta = null; - #groupStackMeta = []; - constructor(canvasCtx, commonObjs, objs, canvasFactory, filterFactory, { - optionalContentConfig, - markedContentStack = null - }, annotationCanvasMap, pageColors, dependencyTracker, imagesTracker) { - this.ctx = canvasCtx; - this.current = new CanvasExtraState(this.ctx.canvas.width, this.ctx.canvas.height); - this.stateStack = []; - this.pendingClip = null; - this.pendingEOFill = false; - this.commonObjs = commonObjs; - this.objs = objs; - this.canvasFactory = canvasFactory; - this.filterFactory = filterFactory; - this.groupStack = []; - this.baseTransform = null; - this.baseTransformStack = []; - this.groupLevel = 0; - this.smaskStack = []; - this.tempSMask = null; - this.smaskGroupCanvases = []; - this.smaskPreparedEntry = null; - this.smaskPreparedFor = null; - this.smaskPreparedOffsetX = 0; - this.smaskPreparedOffsetY = 0; - this.smaskPreparedOOBAlpha = null; - this.suspendedCtx = null; - this.contentVisible = true; - this.markedContentStack = markedContentStack || []; - this.optionalContentConfig = optionalContentConfig; - this.cachedPatterns = new Map(); - this.annotationCanvasMap = annotationCanvasMap; - this.viewportScale = 1; - this.outputScaleX = 1; - this.outputScaleY = 1; - this.pageColors = pageColors; - this._cachedScaleForStroking = [-1, 0]; - this._cachedBitmapsMap = new Map(); - this.dependencyTracker = dependencyTracker ?? null; - this.imagesTracker = imagesTracker ?? null; - } - getObject(opIdx, data, fallback = null) { - if (typeof data === "string") { - this.dependencyTracker?.recordNamedDependency(opIdx, data); - return data.startsWith("g_") ? this.commonObjs.get(data) : this.objs.get(data); + #endKnockoutElement(started) { + if (!started) { + return; } - return fallback; - } - beginDrawing({ - transform, - viewport, - transparency = false, - background = null - }) { - const width = this.ctx.canvas.width; - const height = this.ctx.canvas.height; - const savedFillStyle = this.ctx.fillStyle; - this.ctx.fillStyle = background || "#ffffff"; - this.ctx.fillRect(0, 0, width, height); - this.ctx.fillStyle = savedFillStyle; - if (transparency) { - const transparentCanvas = this.transparentCanvasEntry = this.canvasFactory.create(width, height); - this.compositeCtx = this.ctx; - ({ - canvas: this.transparentCanvas, - context: this.ctx - } = transparentCanvas); - this.ctx.save(); - this.ctx.transform(...getCurrentTransform(this.compositeCtx)); + const tempEntry = this.#knockoutTempCanvasEntry; + const savedCtx = this.#knockoutSavedCtx; + const savedSMaskCtx = this.#knockoutSavedSMaskCtx; + const tempCtx = tempEntry.context; + this.#knockoutTempCanvasEntry = null; + this.#knockoutSavedCtx = null; + this.#knockoutSavedSMaskCtx = null; + if (this.inSMaskMode && this.suspendedCtx === tempCtx && this.ctx !== tempCtx) { + this.endSMaskMode(); + } + if (this.inSMaskMode) { + this.suspendedCtx = savedSMaskCtx; + } + this.ctx._removeMirroring(); + this.ctx.globalCompositeOperation = this.#knockoutSavedGCO; + this.#knockoutSavedGCO = null; + copyCtxState(this.ctx, savedCtx); + this.ctx = savedCtx; + const groupMeta = this.#knockoutElementGroupMeta; + this.#knockoutElementGroupMeta = null; + const knockoutAlpha = this.#knockoutElementAlpha; + this.#knockoutElementAlpha = 1; + try { + this.#compositeKnockoutSurface(savedSMaskCtx ?? savedCtx, tempEntry.canvas, { + backdropCanvas: groupMeta?.backdropCtx?.canvas ?? null, + backdropOffset: groupMeta?.backdropCtx ? [groupMeta.offsetX, groupMeta.offsetY] : [0, 0], + reuseMaskEntry: groupMeta?.knockoutMaskEntry ?? null, + poolMeta: groupMeta, + knockoutAlpha + }); + } finally { + tempCtx.restore(); + this.#knockoutElementDepth--; + if (!groupMeta) { + this.canvasFactory.destroy(tempEntry); + } } - this.ctx.save(); - resetCtxToDefault(this.ctx); - if (transform) { - this.ctx.transform(...transform); - this.outputScaleX = transform[0]; - this.outputScaleY = transform[3]; + } + compose(dirtyBox) { + if (!this.current.activeSMask) { + return; } - this.ctx.transform(...viewport.transform); - this.viewportScale = viewport.scale; - this.baseTransform = getCurrentTransform(this.ctx); + dirtyBox = dirtyBox ? [Math.floor(dirtyBox[0]), Math.floor(dirtyBox[1]), Math.ceil(dirtyBox[2]), Math.ceil(dirtyBox[3])] : [0, 0, this.ctx.canvas.width, this.ctx.canvas.height]; + const smask = this.current.activeSMask; + const suspendedCtx = this.suspendedCtx; + const applySMaskInPlace = this.#knockoutElementDepth > 0 && suspendedCtx === this.ctx; + this.composeSMask(applySMaskInPlace ? null : suspendedCtx, smask, this.ctx, dirtyBox); + if (applySMaskInPlace) { + return; + } + 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(); } - executeOperatorList(operatorList, executionStartIdx, continueCallback, stepper, operationsFilter) { - const argsArray = operatorList.argsArray; - const fnArray = operatorList.fnArray; - let i = executionStartIdx || 0; - const argsArrayLen = argsArray.length; - if (argsArrayLen === i) { - return i; - } - const chunkOperations = argsArrayLen - i > EXECUTION_STEPS && typeof continueCallback === "function"; - const endTime = chunkOperations ? Date.now() + EXECUTION_TIME : 0; - let steps = 0; - const commonObjs = this.commonObjs; - const objs = this.objs; - let fnId, fnArgs; - while (true) { - if (stepper !== undefined) { - if (i === stepper.nextBreakPoint) { - stepper.breakIt(i, continueCallback); - return i; - } - if (stepper.shouldSkip(i)) { - if (++i === argsArrayLen) { - return i; - } - continue; - } - } - if (!operationsFilter || operationsFilter(i, operatorList)) { - fnId = fnArray[i]; - fnArgs = argsArray[i] ?? null; - if (fnId !== OPS.dependency) { - if (fnArgs === null) { - this[fnId](i); - } else { - this[fnId](i, ...fnArgs); - } - } else { - for (const depObjId of fnArgs) { - this.dependencyTracker?.recordNamedData(depObjId, i); - const objsPool = depObjId.startsWith("g_") ? commonObjs : objs; - if (!objsPool.has(depObjId)) { - objsPool.get(depObjId, continueCallback); - return i; - } - } - } + composeSMask(ctx, smask, layerCtx, layerBox) { + const layerOffsetX = layerBox[0]; + const layerOffsetY = layerBox[1]; + const layerWidth = layerBox[2] - layerOffsetX; + const layerHeight = layerBox[3] - layerOffsetY; + if (layerWidth === 0 || layerHeight === 0) { + return; + } + const preparedEntry = this.smaskPreparedEntry; + if (preparedEntry) { + let clipX = layerOffsetX; + let clipY = layerOffsetY; + let clipW = layerWidth; + let clipH = layerHeight; + const oobAlpha = this.smaskPreparedOOBAlpha; + const hasOOBAlpha = oobAlpha !== null; + if (hasOOBAlpha) { + clipX = Math.max(layerOffsetX, smask.offsetX); + clipY = Math.max(layerOffsetY, smask.offsetY); + const x1 = Math.min(layerOffsetX + layerWidth, smask.offsetX + smask.canvas.width); + const y1 = Math.min(layerOffsetY + layerHeight, smask.offsetY + smask.canvas.height); + clipW = x1 - clipX; + clipH = y1 - clipY; } - i++; - if (i === argsArrayLen) { - return i; + if (clipW > 0 && clipH > 0) { + const srcX = clipX - this.smaskPreparedOffsetX; + const srcY = clipY - this.smaskPreparedOffsetY; + layerCtx.save(); + layerCtx.globalAlpha = 1; + layerCtx.setTransform(1, 0, 0, 1, 0, 0); + const clip = new Path2D(); + clip.rect(clipX, clipY, clipW, clipH); + layerCtx.clip(clip); + layerCtx.globalCompositeOperation = "destination-in"; + layerCtx.drawImage(preparedEntry.canvas, srcX, srcY, clipW, clipH, clipX, clipY, clipW, clipH); + layerCtx.restore(); } - if (chunkOperations && ++steps > EXECUTION_STEPS) { - if (Date.now() > endTime) { - continueCallback(); - return i; - } - steps = 0; + if (hasOOBAlpha && oobAlpha < 255) { + this._applySMaskOOBAlpha(layerCtx, layerOffsetX, layerOffsetY, layerWidth, layerHeight, clipX, clipY, clipX + clipW, clipY + clipH, oobAlpha); } + } else { + this.genericComposeSMask(smask, layerCtx, layerWidth, layerHeight, layerOffsetX, layerOffsetY); + } + if (!ctx) { + return; } + ctx.save(); + ctx.globalAlpha = 1; + ctx.globalCompositeOperation = smask.blendMode || "source-over"; + ctx.setTransform(1, 0, 0, 1, 0, 0); + ctx.drawImage(layerCtx.canvas, layerOffsetX, layerOffsetY, layerWidth, layerHeight, layerOffsetX, layerOffsetY, layerWidth, layerHeight); + ctx.restore(); } - #restoreInitialState() { - while (this.stateStack.length || this.inSMaskMode) { - this.restore(); + _applySMaskOOBAlpha(layerCtx, layerOffsetX, layerOffsetY, layerWidth, layerHeight, maskX0, maskY0, maskX1, maskY1, alpha) { + const hasInnerCutout = maskX0 < maskX1 && maskY0 < maskY1; + if (hasInnerCutout && maskX0 === layerOffsetX && maskY0 === layerOffsetY && maskX1 === layerOffsetX + layerWidth && maskY1 === layerOffsetY + layerHeight) { + return; } - this.current.activeSMask = null; - this.ctx.restore(); - if (this.transparentCanvas) { - this.ctx = this.compositeCtx; - this.ctx.save(); - this.ctx.setTransform(1, 0, 0, 1, 0, 0); - this.ctx.drawImage(this.transparentCanvas, 0, 0); - this.ctx.restore(); - this.canvasFactory.destroy(this.transparentCanvasEntry); - this.transparentCanvas = null; - this.transparentCanvasEntry = null; + const path = new Path2D(); + path.rect(layerOffsetX, layerOffsetY, layerWidth, layerHeight); + if (hasInnerCutout) { + path.rect(maskX0, maskY0, maskX1 - maskX0, maskY1 - maskY0); } + layerCtx.save(); + layerCtx.globalAlpha = alpha / 255; + layerCtx.setTransform(1, 0, 0, 1, 0, 0); + layerCtx.clip(path, "evenodd"); + layerCtx.globalCompositeOperation = "destination-in"; + layerCtx.fillStyle = "#000000"; + layerCtx.fillRect(layerOffsetX, layerOffsetY, layerWidth, layerHeight); + layerCtx.restore(); } - endDrawing() { - this.#restoreInitialState(); - for (const canvas of this.smaskGroupCanvases) { - this.canvasFactory.destroy(canvas); - } - this.smaskGroupCanvases.length = 0; - this._clearPreparedSMask(); - this.tempSMask = null; - this.smaskStack.length = 0; - for (const meta of this.#groupStackMeta) { - this.#destroyKnockoutPools(meta); + genericComposeSMask(smask, layerCtx, width, height, layerOffsetX, layerOffsetY) { + const { + context: maskCtx, + offsetX: maskOffsetX, + offsetY: maskOffsetY + } = smask; + layerCtx.save(); + layerCtx.globalAlpha = 1; + layerCtx.setTransform(1, 0, 0, 1, 0, 0); + const clip = new Path2D(); + clip.rect(layerOffsetX, layerOffsetY, width, height); + layerCtx.clip(clip); + layerCtx.globalCompositeOperation = "destination-in"; + layerCtx.drawImage(maskCtx.canvas, layerOffsetX - maskOffsetX, layerOffsetY - maskOffsetY, width, height, layerOffsetX, layerOffsetY, width, height); + layerCtx.restore(); + } + save(opIdx) { + if (this.inSMaskMode) { + copyCtxState(this.ctx, this.suspendedCtx); } - this.#groupStackMeta.length = 0; - this.#knockoutTempCanvasEntry = null; - this.#knockoutSavedCtx = null; - this.#knockoutSavedSMaskCtx = null; - this.#knockoutSavedGCO = null; - this.#knockoutElementAlpha = 1; - this.#knockoutElementGroupMeta = null; - this.#knockoutElementDepth = 0; - this.#knockoutGroupLevel = 0; - this.cachedPatterns.clear(); - for (const cache of this._cachedBitmapsMap.values()) { - for (const canvas of cache.values()) { - if (typeof HTMLCanvasElement !== "undefined" && canvas instanceof HTMLCanvasElement) { - canvas.width = canvas.height = 0; - } + this.ctx.save(); + const old = this.current; + this.stateStack.push(old); + this.current = old.clone(); + this.dependencyTracker?.save(opIdx); + } + restore(opIdx) { + this.dependencyTracker?.restore(opIdx); + if (this.stateStack.length === 0) { + if (this.inSMaskMode) { + this.endSMaskMode(); } - cache.clear(); + return; } - this._cachedBitmapsMap.clear(); - this.#drawFilter(); + this.current = this.stateStack.pop(); + this.ctx.restore(); + if (this.inSMaskMode) { + copyCtxState(this.suspendedCtx, this.ctx); + this.ctx.setTransform(this.suspendedCtx.getTransform()); + } + this.checkSMaskState(opIdx); + this.pendingClip = null; + this._cachedScaleForStroking[0] = -1; } - #drawFilter() { - if (this.pageColors) { - const hcmFilterId = this.filterFactory.addHCMFilter(this.pageColors.foreground, this.pageColors.background); - if (hcmFilterId !== "none") { - const savedFilter = this.ctx.filter; - this.ctx.filter = hcmFilterId; - this.ctx.drawImage(this.ctx.canvas, 0, 0); - this.ctx.filter = savedFilter; - } + resetGraphicsState() { + const { + clipBox, + transferMaps, + transferMapsFallback + } = this.current; + const current = this.current = new CanvasExtraState(0, 0); + current.clipBox = clipBox; + current.transferMaps = transferMaps; + current.transferMapsFallback = transferMapsFallback; + const ctx = this.ctx; + ctx.lineWidth = 1; + ctx.lineCap = "butt"; + ctx.lineJoin = "miter"; + ctx.miterLimit = 10; + if (ctx.setLineDash !== undefined) { + ctx.setLineDash([]); + ctx.lineDashOffset = 0; } + this._cachedScaleForStroking[0] = -1; } - _scaleImage(img, inverseTransform) { - const width = img.width ?? img.displayWidth; - const height = img.height ?? img.displayHeight; - const widthScale = Math.max(Math.hypot(inverseTransform[0], inverseTransform[1]), 1); - const heightScale = Math.max(Math.hypot(inverseTransform[2], inverseTransform[3]), 1); - const scaleSteps = []; - let ws = widthScale, - hs = heightScale, - pw = width, - ph = height; - while (ws > 2 && pw > 1 || hs > 2 && ph > 1) { - let nw = pw, - nh = ph; - if (ws > 2 && pw > 1) { - nw = Math.ceil(pw / 2); - ws /= pw / nw; + transform(opIdx, a, b, c, d, e, f) { + this.dependencyTracker?.recordIncrementalData("transform", opIdx); + this.ctx.transform(a, b, c, d, e, f); + this._cachedScaleForStroking[0] = -1; + } + constructPath(opIdx, op, data, minMax) { + let path = this._pathCache.get(opIdx); + if (!minMax) { + if (!path) { + path = new Path2D(); + this._pathCache.set(opIdx, path); } - if (hs > 2 && ph > 1) { - nh = Math.ceil(ph / 2); - hs /= ph / nh; + if (op !== OPS.stroke && op !== OPS.closeStroke) { + this.current.tilingPatternDims = null; } - scaleSteps.push({ - newWidth: nw, - newHeight: nh - }); - pw = nw; - ph = nh; + this[op](opIdx, path); + return; } - if (scaleSteps.length === 0) { - return { - img, - paintWidth: width, - paintHeight: height, - tmpCanvas: null - }; + if (this.dependencyTracker !== null) { + const outerExtraSize = op === OPS.stroke ? this.current.lineWidth / 2 : 0; + this.dependencyTracker.resetBBox(opIdx).recordBBox(opIdx, this.ctx, minMax[0] - outerExtraSize, minMax[2] + outerExtraSize, minMax[1] - outerExtraSize, minMax[3] + outerExtraSize).recordDependencies(opIdx, ["transform"]); } - if (scaleSteps.length === 1) { - const { - newWidth, - newHeight - } = scaleSteps[0]; - const tmpCanvas = this.canvasFactory.create(newWidth, newHeight); - tmpCanvas.context.drawImage(img, 0, 0, width, height, 0, 0, newWidth, newHeight); - return { - img: tmpCanvas.canvas, - paintWidth: newWidth, - paintHeight: newHeight, - tmpCanvas - }; + if (!path) { + path = makePathFromDrawOPS(data[0]); + this._pathCache.set(opIdx, path); } - let readEntry = this.canvasFactory.create(1, 1); - let writeEntry = this.canvasFactory.create(1, 1); - let paintWidth = width, - paintHeight = height; - let source = img; - for (const { - newWidth, - newHeight - } of scaleSteps) { - this.canvasFactory.reset(writeEntry, newWidth, newHeight); - writeEntry.context.drawImage(source, 0, 0, paintWidth, paintHeight, 0, 0, newWidth, newHeight); - [readEntry, writeEntry] = [writeEntry, readEntry]; - source = readEntry.canvas; - paintWidth = newWidth; - paintHeight = newHeight; + Util.axialAlignedBoundingBox(minMax, getCurrentTransform(this.ctx), this.current.minMax); + const tilingDims = this.current.tilingPatternDims; + if (tilingDims && op !== OPS.stroke && op !== OPS.closeStroke && this.current.fillColor instanceof TilingPattern) { + const clippedBBox = Util.intersect(this.current.clipBox, this.current.minMax); + if (!clippedBBox) { + this.current.tilingPatternDims = null; + } else { + this.current.fillColor.updatePatternDims(clippedBBox, tilingDims); + } } - this.canvasFactory.destroy(writeEntry); - return { - img: readEntry.canvas, - paintWidth, - paintHeight, - tmpCanvas: readEntry - }; + this[op](opIdx, path); + this._pathStartIdx = opIdx; } - _createMaskCanvas(opIdx, img) { + closePath(opIdx) { + this.ctx.closePath(); + } + stroke(opIdx, path, consumePath = true) { + const started = consumePath && this.#beginKnockoutElement(this.current.strokeAlpha); const ctx = this.ctx; - const { - width, - height - } = img; + const strokeColor = this.current.strokeColor; + ctx.globalAlpha = this.current.strokeAlpha; + if (this.contentVisible) { + if (typeof strokeColor === "object" && strokeColor?.getPattern) { + const baseTransform = strokeColor.isModifyingCurrentTransform() ? ctx.getTransform() : null; + ctx.save(); + ctx.strokeStyle = strokeColor.getPattern(ctx, this, getCurrentTransformInverse(ctx), PathType.STROKE, opIdx); + if (baseTransform) { + const newPath = new Path2D(); + newPath.addPath(path, ctx.getTransform().invertSelf().multiplySelf(baseTransform)); + path = newPath; + } + this.rescaleAndStroke(path, false); + ctx.restore(); + } else { + this.rescaleAndStroke(path, true); + } + } + this.dependencyTracker?.recordDependencies(opIdx, Dependencies.stroke); + if (consumePath) { + this.consumePath(opIdx, path, this.current.getClippedPathBoundingBox(PathType.STROKE, getCurrentTransform(this.ctx))); + } + ctx.globalAlpha = this.current.fillAlpha; + this.#endKnockoutElement(started); + } + closeStroke(opIdx, path) { + this.stroke(opIdx, path); + } + fill(opIdx, path, consumePath = true) { + const started = consumePath && this.#beginKnockoutElement(this.current.fillAlpha); + const ctx = this.ctx; + const fillColor = this.current.fillColor; const isPatternFill = this.current.patternFill; - const fillColor = isPatternFill ? this.current.fillColor : ctx.fillStyle; - const currentTransform = getCurrentTransform(ctx); - let cache, cacheKey, scaled, maskCanvas; - if ((img.bitmap || img.data) && img.count > 1) { - const mainKey = img.bitmap || img.data.buffer; - cacheKey = JSON.stringify(isPatternFill ? currentTransform : [currentTransform.slice(0, 4), fillColor]); - cache = this._cachedBitmapsMap.getOrInsertComputed(mainKey, makeMap); - const cachedImage = cache.get(cacheKey); - if (cachedImage && !isPatternFill) { - const offsetX = Math.round(Math.min(currentTransform[0], currentTransform[2]) + currentTransform[4]); - const offsetY = Math.round(Math.min(currentTransform[1], currentTransform[3]) + currentTransform[5]); - this.dependencyTracker?.recordDependencies(opIdx, Dependencies.transformAndFill); - return { - canvas: cachedImage, - offsetX, - offsetY - }; + let needRestore = false; + const intersect = this.current.getClippedPathBoundingBox(); + this.dependencyTracker?.recordDependencies(opIdx, Dependencies.fill); + if (isPatternFill) { + const dims = this.current.tilingPatternDims; + const tileIdx = dims && fillColor.canSkipPatternCanvas(dims); + if (tileIdx) { + const { + pendingClip, + pendingEOFill + } = this; + this.pendingClip = null; + this.pendingEOFill = false; + fillColor.drawPattern(this, path, pendingEOFill, tileIdx, opIdx); + this.pendingClip = pendingClip; + if (consumePath) { + this.consumePath(opIdx, path, intersect); + } + this.current.tilingPatternDims = null; + this.#endKnockoutElement(started); + return; } - scaled = cachedImage; + const baseTransform = fillColor.isModifyingCurrentTransform() ? ctx.getTransform() : null; + this.dependencyTracker?.save(opIdx); + ctx.save(); + ctx.fillStyle = fillColor.getPattern(ctx, this, getCurrentTransformInverse(ctx), PathType.FILL, opIdx); + if (baseTransform) { + const newPath = new Path2D(); + newPath.addPath(path, ctx.getTransform().invertSelf().multiplySelf(baseTransform)); + path = newPath; + } + needRestore = true; } - if (!scaled) { - maskCanvas = this.canvasFactory.create(width, height); - putBinaryImageMask(maskCanvas.context, img); + if (this.contentVisible && intersect !== null) { + if (this.pendingEOFill) { + ctx.fill(path, "evenodd"); + this.pendingEOFill = false; + } else { + ctx.fill(path); + } } - let maskToCanvas = Util.transform(currentTransform, [1 / width, 0, 0, -1 / height, 0, 0]); - maskToCanvas = Util.transform(maskToCanvas, [1, 0, 0, 1, 0, -height]); - const minMax = F32_BBOX_INIT.slice(); - Util.axialAlignedBoundingBox([0, 0, width, height], maskToCanvas, minMax); - const [minX, minY, maxX, maxY] = minMax; - const drawnWidth = Math.round(maxX - minX) || 1; - const drawnHeight = Math.round(maxY - minY) || 1; - const fillCanvas = this.canvasFactory.create(drawnWidth, drawnHeight); - const fillCtx = fillCanvas.context; - const offsetX = minX; - const offsetY = minY; - fillCtx.translate(-offsetX, -offsetY); - fillCtx.transform(...maskToCanvas); - let scaledEntry = null; - if (!scaled) { - const scaleResult = this._scaleImage(maskCanvas.canvas, getCurrentTransformInverse(fillCtx)); - scaled = scaleResult.img; - scaledEntry = scaleResult.tmpCanvas; - if (scaled !== maskCanvas.canvas) { - this.canvasFactory.destroy(maskCanvas); - maskCanvas = null; + if (needRestore) { + ctx.restore(); + this.dependencyTracker?.restore(opIdx); + } + if (consumePath) { + this.consumePath(opIdx, path, intersect); + } + this.#endKnockoutElement(started); + } + eoFill(opIdx, path) { + this.pendingEOFill = true; + this.fill(opIdx, path); + } + fillStroke(opIdx, path) { + const started = this.#beginKnockoutElement(Math.min(this.current.fillAlpha, this.current.strokeAlpha)); + this.fill(opIdx, path, false); + this.stroke(opIdx, path, false); + this.consumePath(opIdx, path); + this.#endKnockoutElement(started); + } + eoFillStroke(opIdx, path) { + this.pendingEOFill = true; + this.fillStroke(opIdx, path); + } + closeFillStroke(opIdx, path) { + this.fillStroke(opIdx, path); + } + closeEOFillStroke(opIdx, path) { + this.pendingEOFill = true; + this.fillStroke(opIdx, path); + } + endPath(opIdx, path) { + this.consumePath(opIdx, path); + } + rawFillPath(opIdx, path) { + const started = this.#beginKnockoutElement(this.current.fillAlpha); + this.ctx.fill(path); + this.dependencyTracker?.recordDependencies(opIdx, Dependencies.rawFillPath).recordOperation(opIdx); + this.#endKnockoutElement(started); + } + clip(opIdx) { + this.dependencyTracker?.recordFutureForcedDependency("clipMode", opIdx); + this.pendingClip = NORMAL_CLIP; + } + eoClip(opIdx) { + this.dependencyTracker?.recordFutureForcedDependency("clipMode", opIdx); + this.pendingClip = EO_CLIP; + } + beginText(opIdx) { + 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(opIdx).resetIncrementalData("sameLineText").resetIncrementalData("moveText", opIdx); + } + endText(opIdx) { + const paths = this.pendingTextPaths; + const ctx = this.ctx; + if (this.dependencyTracker) { + const { + dependencyTracker + } = this; + if (paths !== undefined) { + dependencyTracker.recordFutureForcedDependency("textClip", dependencyTracker.getOpenMarker()).recordFutureForcedDependency("textClip", opIdx); } - if (cache && isPatternFill) { - cache.set(cacheKey, scaled); - scaledEntry = null; - maskCanvas = null; + dependencyTracker.recordCloseMarker(opIdx); + } + if (paths !== undefined) { + const newPath = new Path2D(); + const invTransf = ctx.getTransform().invertSelf(); + for (const { + transform, + x, + y, + fontSize, + path + } of paths) { + if (!path) { + continue; + } + newPath.addPath(path, new DOMMatrix(transform).preMultiplySelf(invTransf).translate(x, y).scale(fontSize, -fontSize)); } + ctx.clip(newPath); } - fillCtx.imageSmoothingEnabled = getImageSmoothingEnabled(getCurrentTransform(fillCtx), img.interpolate); - drawImageAtIntegerCoords(fillCtx, scaled, 0, 0, scaled.width, scaled.height, 0, 0, width, height); - if (scaledEntry) { - this.canvasFactory.destroy(scaledEntry); + delete this.pendingTextPaths; + } + setCharSpacing(opIdx, spacing) { + this.dependencyTracker?.recordSimpleData("charSpacing", opIdx); + this.current.charSpacing = spacing; + } + setWordSpacing(opIdx, spacing) { + this.dependencyTracker?.recordSimpleData("wordSpacing", opIdx); + this.current.wordSpacing = spacing; + } + setHScale(opIdx, scale) { + this.dependencyTracker?.recordSimpleData("hScale", opIdx); + this.current.textHScale = scale / 100; + } + setLeading(opIdx, leading) { + this.dependencyTracker?.recordSimpleData("leading", opIdx); + this.current.leading = -leading; + } + setFont(opIdx, fontRefName, size) { + this.dependencyTracker?.recordSimpleData("font", opIdx).recordSimpleDataFromNamed("fontObj", fontRefName, opIdx); + const fontObj = this.commonObjs.get(fontRefName); + const current = this.current; + if (!fontObj) { + throw new Error(`Can't find font for ${fontRefName}`); } - if (maskCanvas) { - this.canvasFactory.destroy(maskCanvas); + current.fontMatrix = fontObj.fontMatrix || FONT_IDENTITY_MATRIX; + if (current.fontMatrix[0] === 0 || current.fontMatrix[3] === 0) { + warn("Invalid font matrix for font " + fontRefName); } - fillCtx.globalCompositeOperation = "source-in"; - const inverse = Util.transform(getCurrentTransformInverse(fillCtx), [1, 0, 0, 1, -offsetX, -offsetY]); - fillCtx.fillStyle = isPatternFill ? fillColor.getPattern(ctx, this, inverse, PathType.FILL, opIdx) : fillColor; - fillCtx.fillRect(0, 0, width, height); - if (cache && !isPatternFill) { - cache.set(cacheKey, fillCanvas.canvas); + if (size < 0) { + size = -size; + current.fontDirection = -1; + } else { + current.fontDirection = 1; } - this.dependencyTracker?.recordDependencies(opIdx, Dependencies.transformAndFill); - return { - canvas: fillCanvas.canvas, - canvasEntry: cache && !isPatternFill ? null : fillCanvas, - offsetX: Math.round(offsetX), - offsetY: Math.round(offsetY) - }; - } - setLineWidth(opIdx, width) { - this.dependencyTracker?.recordSimpleData("lineWidth", opIdx); - if (width !== this.current.lineWidth) { - this._cachedScaleForStroking[0] = -1; + this.current.font = fontObj; + this.current.fontSize = size; + if (fontObj.isType3Font) { + return; } - this.current.lineWidth = width; - this.ctx.lineWidth = width; + const name = fontObj.loadedName || "sans-serif"; + const typeface = fontObj.systemFontInfo?.css || `"${name}", ${fontObj.fallbackName}`; + let bold = "normal"; + if (fontObj.black) { + bold = "900"; + } else if (fontObj.bold) { + bold = "bold"; + } + const italic = fontObj.italic ? "italic" : "normal"; + const browserFontSize = MathClamp(size, MIN_FONT_SIZE, MAX_FONT_SIZE); + this.current.fontSizeScale = size / browserFontSize; + this.ctx.font = `${italic} ${bold} ${browserFontSize}px ${typeface}`; } - setLineCap(opIdx, style) { - this.dependencyTracker?.recordSimpleData("lineCap", opIdx); - this.ctx.lineCap = LINE_CAP_STYLES[style]; + setTextRenderingMode(opIdx, mode) { + this.dependencyTracker?.recordSimpleData("textRenderingMode", opIdx); + this.current.textRenderingMode = mode; } - setLineJoin(opIdx, style) { - this.dependencyTracker?.recordSimpleData("lineJoin", opIdx); - this.ctx.lineJoin = LINE_JOIN_STYLES[style]; + setTextRise(opIdx, rise) { + this.dependencyTracker?.recordSimpleData("textRise", opIdx); + this.current.textRise = rise; } - setMiterLimit(opIdx, limit) { - this.dependencyTracker?.recordSimpleData("miterLimit", opIdx); - this.ctx.miterLimit = limit; + moveText(opIdx, x, y) { + this.dependencyTracker?.resetIncrementalData("sameLineText").recordIncrementalData("moveText", opIdx); + this.current.x = this.current.lineX += x; + this.current.y = this.current.lineY += y; } - setDash(opIdx, dashArray, dashPhase) { - this.dependencyTracker?.recordSimpleData("dash", opIdx); + setLeadingMoveText(opIdx, x, y) { + this.setLeading(opIdx, -y); + this.moveText(opIdx, x, y); + } + setTextMatrix(opIdx, matrix) { + this.dependencyTracker?.resetIncrementalData("sameLineText").recordSimpleData("textMatrix", opIdx); + const { + current + } = this; + current.textMatrix = matrix; + current.textMatrixScale = Math.hypot(matrix[0], matrix[1]); + current.x = current.lineX = 0; + current.y = current.lineY = 0; + } + nextLine(opIdx) { + this.moveText(opIdx, 0, this.current.leading); + this.dependencyTracker?.recordIncrementalData("moveText", this.dependencyTracker.getSimpleIndex("leading") ?? opIdx); + } + #getScaledPath(path, currentTransform, transform) { + const newPath = new Path2D(); + newPath.addPath(path, new DOMMatrix(transform).invertSelf().multiplySelf(currentTransform)); + return newPath; + } + paintChar(opIdx, character, x, y, patternFillTransform, patternStrokeTransform) { const ctx = this.ctx; - if (ctx.setLineDash !== undefined) { - ctx.setLineDash(dashArray); - ctx.lineDashOffset = dashPhase; + const current = this.current; + const font = current.font; + const textRenderingMode = current.textRenderingMode; + const fontSize = current.fontSize / current.fontSizeScale; + const fillStrokeMode = textRenderingMode & TextRenderingMode.FILL_STROKE_MASK; + const isAddToPathSet = !!(textRenderingMode & TextRenderingMode.ADD_TO_PATH_FLAG); + const patternFill = current.patternFill && !font.missingFile; + const patternStroke = current.patternStroke && !font.missingFile; + let path; + if ((font.disableFontFace || isAddToPathSet || patternFill || patternStroke) && !font.missingFile) { + path = font.getPathGenerator(this.commonObjs, character); + } + if (path && (font.disableFontFace || patternFill || patternStroke)) { + ctx.save(); + ctx.translate(x, y); + ctx.scale(fontSize, -fontSize); + this.dependencyTracker?.recordCharacterBBox(opIdx, ctx, font); + let currentTransform; + if (fillStrokeMode === TextRenderingMode.FILL || fillStrokeMode === TextRenderingMode.FILL_STROKE) { + if (patternFillTransform) { + currentTransform = ctx.getTransform(); + ctx.setTransform(...patternFillTransform); + const scaledPath = this.#getScaledPath(path, currentTransform, patternFillTransform); + ctx.fill(scaledPath); + } else { + ctx.fill(path); + } + } + if (fillStrokeMode === TextRenderingMode.STROKE || fillStrokeMode === TextRenderingMode.FILL_STROKE) { + if (patternStrokeTransform) { + currentTransform ||= ctx.getTransform(); + ctx.setTransform(...patternStrokeTransform); + const { + a, + b, + c, + d + } = currentTransform; + const invPatternTransform = Util.inverseTransform(patternStrokeTransform); + const transf = Util.transform([a, b, c, d, 0, 0], invPatternTransform); + Util.singularValueDecompose2dScale(transf, XY); + ctx.lineWidth *= Math.max(XY[0], XY[1]) / fontSize; + ctx.stroke(this.#getScaledPath(path, currentTransform, patternStrokeTransform)); + } else { + ctx.lineWidth /= fontSize; + ctx.stroke(path); + } + } + ctx.restore(); + } else { + if (fillStrokeMode === TextRenderingMode.FILL || fillStrokeMode === TextRenderingMode.FILL_STROKE) { + ctx.fillText(character, x, y); + this.dependencyTracker?.recordCharacterBBox(opIdx, ctx, font, fontSize, x, y, () => ctx.measureText(character)); + } + if (fillStrokeMode === TextRenderingMode.STROKE || fillStrokeMode === TextRenderingMode.FILL_STROKE) { + if (this.dependencyTracker) { + this.dependencyTracker?.recordCharacterBBox(opIdx, ctx, font, fontSize, x, y, () => ctx.measureText(character)).recordDependencies(opIdx, Dependencies.stroke); + } + ctx.strokeText(character, x, y); + } + } + if (isAddToPathSet) { + const paths = this.pendingTextPaths ||= []; + paths.push({ + transform: getCurrentTransform(ctx), + x, + y, + fontSize, + path + }); + this.dependencyTracker?.recordCharacterBBox(opIdx, ctx, font, fontSize, x, y); } } - setRenderingIntent(opIdx, intent) {} - setFlatness(opIdx, flatness) {} - setGState(opIdx, states) { - for (const [key, value] of states) { - switch (key) { - case "LW": - this.setLineWidth(opIdx, value); - break; - case "LC": - this.setLineCap(opIdx, value); - break; - case "LJ": - this.setLineJoin(opIdx, value); - break; - case "ML": - this.setMiterLimit(opIdx, value); - break; - case "D": - this.setDash(opIdx, value[0], value[1]); - break; - case "RI": - this.setRenderingIntent(opIdx, value); - break; - case "FL": - this.setFlatness(opIdx, value); - break; - case "Font": - this.setFont(opIdx, value[0], value[1]); - break; - case "CA": - this.dependencyTracker?.recordSimpleData("strokeAlpha", opIdx); - this.current.strokeAlpha = value; - break; - case "ca": - this.dependencyTracker?.recordSimpleData("fillAlpha", opIdx); - this.ctx.globalAlpha = this.current.fillAlpha = value; - break; - case "BM": - this.dependencyTracker?.recordSimpleData("globalCompositeOperation", opIdx); - this.ctx.globalCompositeOperation = value; - break; - case "SMask": - this.dependencyTracker?.recordSimpleData("SMask", opIdx); - this.current.activeSMask = value ? this.tempSMask : null; - if (this.current.activeSMask) { - this.current.activeSMask.blendMode = this.ctx.globalCompositeOperation; - } - this.tempSMask = null; - this.checkSMaskState(opIdx); - break; - case "TR": - { - this.dependencyTracker?.recordSimpleData("filter", opIdx); - let filter = this.filterFactory.addFilter(value); - this.ctx.filter = filter; - let fallback = null; - if (value && (filter === "none" || !FeatureTest.isCanvasFilterSupported || this.ctx.filter === "none" || this.ctx.filter === "")) { - this.ctx.filter = filter = "none"; - fallback = new TransferMapsFallback(value); - } - this.current.transferMaps = filter; - if (fallback || this.current.transferMapsFallback) { - this.current.transferMapsFallback = fallback; - if (!this.current.patternFill) { - this.ctx.fillStyle = this.#transferColor(this.current.fillColor); - } - if (!this.current.patternStroke) { - this.ctx.strokeStyle = this.#transferColor(this.current.strokeColor); - } - } - break; - } + get isFontSubpixelAAEnabled() { + const tmpCanvas = this.canvasFactory.create(10, 10); + const ctx = tmpCanvas.context; + ctx.scale(1.5, 1); + ctx.fillText("I", 0, 10); + const data = ctx.getImageData(0, 0, 10, 10).data; + this.canvasFactory.destroy(tmpCanvas); + let enabled = false; + for (let i = 3; i < data.length; i += 4) { + if (data[i] > 0 && data[i] < 255) { + enabled = true; + break; } } + return util_shadow(this, "isFontSubpixelAAEnabled", enabled); } - get inSMaskMode() { - return !!this.suspendedCtx; + #getTextPattern(color, pathType, opIdx) { + const ctx = this.ctx; + ctx.save(); + const pattern = color.getPattern(ctx, this, getCurrentTransformInverse(ctx), pathType, opIdx); + const transform = getCurrentTransform(ctx); + ctx.restore(); + return [pattern, transform]; } - _clearPreparedSMask() { - if (this.smaskPreparedEntry) { - this.canvasFactory.destroy(this.smaskPreparedEntry); - this.smaskPreparedEntry = null; + showText(opIdx, glyphs) { + if (this.dependencyTracker) { + this.dependencyTracker.recordDependencies(opIdx, Dependencies.showText).resetBBox(opIdx); + if (this.current.textRenderingMode & TextRenderingMode.ADD_TO_PATH_FLAG) { + this.dependencyTracker.recordFutureForcedDependency("textClip", opIdx).inheritPendingDependenciesAsFutureForcedDependencies(); + } } - this.smaskPreparedFor = null; - this.smaskPreparedOffsetX = 0; - this.smaskPreparedOffsetY = 0; - this.smaskPreparedOOBAlpha = null; - } - _ensurePreparedSMask(smask) { - if (smask === this.smaskPreparedFor) { + const current = this.current; + const font = current.font; + if (font.isType3Font) { + const started = this.#beginKnockoutElement(current.fillAlpha); + this.showType3Text(opIdx, glyphs); + this.dependencyTracker?.recordShowTextOperation(opIdx); + this.#endKnockoutElement(started); return; } - this._clearPreparedSMask(); - this._prepareSMaskCanvas(smask); - } - checkSMaskState(opIdx) { - const inSMaskMode = this.inSMaskMode; - if (this.current.activeSMask && !inSMaskMode) { - this.beginSMaskMode(opIdx); - } else if (!this.current.activeSMask && inSMaskMode) { - this.endSMaskMode(); - } else if (this.current.activeSMask && inSMaskMode) { - this._ensurePreparedSMask(this.current.activeSMask); - } - } - _prepareSMaskCanvas(smask) { - const { - canvas: maskCanvas, - subtype, - backdrop, - transferMap - } = smask; - const hasFilter = subtype === "Luminosity" || subtype === "Alpha" && transferMap; - if (!hasFilter && !(subtype === "Luminosity" && backdrop)) { - this.smaskPreparedFor = smask; + const fontSize = current.fontSize; + if (fontSize === 0) { + this.dependencyTracker?.recordOperation(opIdx); return; } - let filteredOOBAlpha; - if (subtype === "Luminosity" && backdrop) { - const [r, g, b] = getRGBA(backdrop); - const inputAlpha = Math.round(0.3 * r + 0.59 * g + 0.11 * b); - filteredOOBAlpha = transferMap?.[inputAlpha] ?? inputAlpha; + const started = this.#beginKnockoutElement(current.fillAlpha); + const ctx = this.ctx; + const fontSizeScale = current.fontSizeScale; + const charSpacing = current.charSpacing; + const wordSpacing = current.wordSpacing; + const fontDirection = current.fontDirection; + const textHScale = current.textHScale * fontDirection; + const glyphsLength = glyphs.length; + const vertical = font.vertical; + const spacingDir = vertical ? 1 : -1; + const widthAdvanceScale = fontSize * current.fontMatrix[0]; + const simpleFillText = current.textRenderingMode === TextRenderingMode.FILL && !font.disableFontFace && !current.patternFill; + ctx.save(); + if (current.textMatrix) { + ctx.transform(...current.textMatrix); + } + ctx.translate(current.x, current.y + current.textRise); + if (fontDirection > 0) { + ctx.scale(textHScale, -1); } else { - filteredOOBAlpha = transferMap?.[0] ?? 0; + ctx.scale(textHScale, 1); } - const SMASK_LAYER_TO_MASK_AREA_RATIO = 4; - const { - width: layerW, - height: layerH - } = this.ctx.canvas; - const maskArea = maskCanvas.width * maskCanvas.height; - const useLayerSize = layerW * layerH < SMASK_LAYER_TO_MASK_AREA_RATIO * maskArea; - const filterSpec = hasFilter ? { - url: subtype === "Alpha" ? this.filterFactory.addAlphaFilter(transferMap) : this.filterFactory.addLuminosityFilter(transferMap), - subtype, - transferMap - } : null; - const bakedBackdrop = subtype === "Luminosity" ? backdrop : null; - let preparedEntry, offsetX, offsetY; - if (useLayerSize) { - preparedEntry = this._bakeSMaskCanvas(maskCanvas, smask.offsetX, smask.offsetY, layerW, layerH, bakedBackdrop, filterSpec); - offsetX = 0; - offsetY = 0; + let patternFillTransform, patternStrokeTransform; + const fillStrokeMode = current.textRenderingMode & TextRenderingMode.FILL_STROKE_MASK; + const needsFill = fillStrokeMode === TextRenderingMode.FILL || fillStrokeMode === TextRenderingMode.FILL_STROKE; + const needsStroke = fillStrokeMode === TextRenderingMode.STROKE || fillStrokeMode === TextRenderingMode.FILL_STROKE; + let lineWidth = current.lineWidth; + const scale = current.textMatrixScale; + if (scale === 0 || lineWidth === 0) { + if (needsStroke) { + lineWidth = this.getSinglePixelWidth(); + } } else { - preparedEntry = this._bakeSMaskCanvas(maskCanvas, 0, 0, maskCanvas.width, maskCanvas.height, bakedBackdrop, filterSpec); - offsetX = smask.offsetX; - offsetY = smask.offsetY; + lineWidth /= scale; } - this.smaskPreparedEntry = preparedEntry; - this.smaskPreparedFor = smask; - this.smaskPreparedOffsetX = offsetX; - this.smaskPreparedOffsetY = offsetY; - this.smaskPreparedOOBAlpha = !useLayerSize && filteredOOBAlpha !== 0 ? filteredOOBAlpha : null; - } - _bakeSMaskCanvas(maskCanvas, drawX, drawY, w, h, backdrop, filterSpec) { - if (!backdrop && !filterSpec) { - unreachable("_bakeSMaskCanvas with neither backdrop nor filter"); + if (fontSizeScale !== 1.0) { + ctx.scale(fontSizeScale, fontSizeScale); + lineWidth /= fontSizeScale; } - const srcEntry = this.canvasFactory.create(w, h); - const sCtx = srcEntry.context; - sCtx.drawImage(maskCanvas, drawX, drawY); - if (backdrop) { - sCtx.globalCompositeOperation = "destination-atop"; - sCtx.fillStyle = backdrop; - sCtx.fillRect(0, 0, w, h); + ctx.lineWidth = lineWidth; + if (needsFill && current.patternFill) { + [ctx.fillStyle, patternFillTransform] = this.#getTextPattern(current.fillColor, PathType.FILL, opIdx); } - if (!filterSpec) { - return srcEntry; + if (needsStroke && current.patternStroke) { + [ctx.strokeStyle, patternStrokeTransform] = this.#getTextPattern(current.strokeColor, PathType.STROKE, opIdx); + } + if (font.isInvalidPDFjsFont) { + const chars = []; + let width = 0; + for (const glyph of glyphs) { + chars.push(glyph.unicode); + width += glyph.width; + } + const joinedChars = chars.join(""); + ctx.fillText(joinedChars, 0, 0); + if (this.dependencyTracker !== null) { + const measure = ctx.measureText(joinedChars); + this.dependencyTracker.recordBBox(opIdx, this.ctx, -measure.actualBoundingBoxLeft, measure.actualBoundingBoxRight, -measure.actualBoundingBoxAscent, measure.actualBoundingBoxDescent).recordShowTextOperation(opIdx); + } + current.x += width * widthAdvanceScale * textHScale; + ctx.restore(); + this.compose(); + this.#endKnockoutElement(started); + return; + } + let x = 0, + i, + glyphPatterns = null; + for (i = 0; i < glyphsLength; ++i) { + const glyph = glyphs[i]; + if (typeof glyph === "number") { + x += spacingDir * glyph * fontSize / 1000; + continue; + } + let restoreNeeded = false; + const spacing = (glyph.isSpace ? wordSpacing : 0) + charSpacing; + const character = glyph.fontChar; + const accent = glyph.accent; + let scaledX, scaledY, measure; + let width = glyph.width; + if (vertical) { + const vmetric = glyph.vmetric; + const vx = -vmetric[1] * widthAdvanceScale; + const vy = vmetric[2] * widthAdvanceScale; + width = -vmetric[0]; + scaledX = vx / fontSizeScale; + scaledY = (x + vy) / fontSizeScale; + if (glyph.isRotated) { + measure = ctx.measureText(character); + const glyphScale = widthAdvanceScale / fontSizeScale; + const halfWidth = glyph.width / 2 * glyphScale; + const centerX = scaledX + halfWidth; + scaledX = scaledY - ((/* inlined export .DEFAULT_VERTICAL_ORIGIN_Y */880) - (/* inlined export .DEFAULT_VERTICAL_ADVANCE */1000) / 2) * glyphScale - halfWidth; + scaledY = (measure.actualBoundingBoxAscent - measure.actualBoundingBoxDescent) / 2 - centerX; + restoreNeeded = true; + ctx.save(); + ctx.rotate(Math.PI / 2); + } + } else { + scaledX = x / fontSizeScale; + scaledY = 0; + } + const glyphWidth = glyph.isRotated ? glyph.width : width; + let characterScaleX = 1; + if ((font.remeasure || glyph.isRotated) && glyphWidth > 0) { + measure ??= ctx.measureText(character); + const measuredWidth = measure.width * 1000 / fontSize * fontSizeScale; + if (glyphWidth < measuredWidth && this.isFontSubpixelAAEnabled) { + characterScaleX = glyphWidth / measuredWidth; + if (!restoreNeeded) { + restoreNeeded = true; + ctx.save(); + } + ctx.scale(characterScaleX, 1); + scaledX /= characterScaleX; + } else if (glyphWidth !== measuredWidth) { + scaledX += (glyphWidth - measuredWidth) / 2000 * fontSize / fontSizeScale; + } + } + if (restoreNeeded && font.missingFile && (patternFillTransform || patternStrokeTransform)) { + glyphPatterns ||= new Map(); + [ctx.fillStyle, ctx.strokeStyle] = glyphPatterns.getOrInsertComputed(glyph.isRotated ? -characterScaleX : characterScaleX, () => [patternFillTransform ? this.#getTextPattern(current.fillColor, PathType.FILL, opIdx)[0] : ctx.fillStyle, patternStrokeTransform ? this.#getTextPattern(current.strokeColor, PathType.STROKE, opIdx)[0] : ctx.strokeStyle]); + } + if (this.contentVisible && (glyph.isInFont || font.missingFile)) { + if (simpleFillText && !accent) { + ctx.fillText(character, scaledX, scaledY); + this.dependencyTracker?.recordCharacterBBox(opIdx, ctx, measure ? { + bbox: null + } : font, fontSize / fontSizeScale, scaledX, scaledY, () => measure ?? ctx.measureText(character)); + } else { + this.paintChar(opIdx, character, scaledX, scaledY, patternFillTransform, patternStrokeTransform); + if (accent) { + const scaledAccentX = scaledX + fontSize * accent.offset.x / fontSizeScale; + const scaledAccentY = scaledY - fontSize * accent.offset.y / fontSizeScale; + this.paintChar(opIdx, accent.fontChar, scaledAccentX, scaledAccentY, patternFillTransform, patternStrokeTransform); + } + } + } + const charWidth = vertical ? width * widthAdvanceScale - spacing * fontDirection : width * widthAdvanceScale + spacing * fontDirection; + x += charWidth; + if (restoreNeeded) { + ctx.restore(); + } + } + if (vertical) { + current.y -= x; + } else { + current.x += x * textHScale; + } + ctx.restore(); + this.compose(); + this.dependencyTracker?.recordShowTextOperation(opIdx); + this.#endKnockoutElement(started); + } + showType3Text(opIdx, glyphs) { + const ctx = this.ctx; + const current = this.current; + const font = current.font; + const fontSize = current.fontSize; + const fontDirection = current.fontDirection; + const spacingDir = font.vertical ? 1 : -1; + const charSpacing = current.charSpacing; + const wordSpacing = current.wordSpacing; + const textHScale = current.textHScale * fontDirection; + const fontMatrix = current.fontMatrix || FONT_IDENTITY_MATRIX; + const glyphsLength = glyphs.length; + const isTextVisible = current.textRenderingMode !== TextRenderingMode.INVISIBLE; + let i, glyph, width, spacingLength; + if (fontSize === 0) { + return; } - const preparedEntry = this.canvasFactory.create(w, h); - const pCtx = preparedEntry.context; - pCtx.filter = filterSpec.url; - const filterApplied = FeatureTest.isCanvasFilterSupported && pCtx.filter !== "none" && pCtx.filter !== ""; - pCtx.drawImage(srcEntry.canvas, 0, 0); - if (FeatureTest.isCanvasFilterSupported) { - pCtx.filter = "none"; + this._cachedScaleForStroking[0] = -1; + ctx.save(); + if (current.textMatrix) { + ctx.transform(...current.textMatrix); } - if (!filterApplied) { - const img = pCtx.getImageData(0, 0, w, h); - const { - data - } = img; - const { - transferMap - } = filterSpec; - if (filterSpec.subtype === "Luminosity") { - for (let i = 0, ii = data.length; i < ii; i += 4) { - const a = 0.3 * data[i] + 0.59 * data[i + 1] + 0.11 * data[i + 2] + 0.5 | 0; - data[i] = data[i + 1] = data[i + 2] = 0; - data[i + 3] = transferMap?.[a] ?? a; + ctx.translate(current.x, current.y + current.textRise); + ctx.scale(textHScale, fontDirection); + const dependencyTracker = this.dependencyTracker; + this.dependencyTracker = dependencyTracker ? new CanvasNestedDependencyTracker(dependencyTracker, opIdx) : null; + try { + for (i = 0; i < glyphsLength; ++i) { + glyph = glyphs[i]; + if (typeof glyph === "number") { + spacingLength = spacingDir * glyph * fontSize / 1000; + this.ctx.translate(spacingLength, 0); + current.x += spacingLength * textHScale; + continue; } - } else { - for (let i = 3, ii = data.length; i < ii; i += 4) { - data[i] = transferMap[data[i]]; + const spacing = (glyph.isSpace ? wordSpacing : 0) + charSpacing; + const operatorList = font.charProcOperatorList.get(glyph.operatorListId); + if (!operatorList) { + warn(`Type3 character "${glyph.operatorListId}" is not available.`); + } else if (this.contentVisible && isTextVisible) { + this.save(); + ctx.scale(fontSize, fontSize); + ctx.transform(...fontMatrix); + this.executeOperatorList(operatorList); + this.restore(); } + width = glyph.width * fontMatrix[0] * fontSize + spacing * fontDirection; + ctx.translate(width, 0); + current.x += width * textHScale; + } + } finally { + if (dependencyTracker) { + this.dependencyTracker = dependencyTracker; } - pCtx.putImageData(img, 0, 0); } - this.canvasFactory.destroy(srcEntry); - return preparedEntry; + ctx.restore(); } - beginSMaskMode(opIdx) { - if (this.inSMaskMode) { - throw new Error("beginSMaskMode called while already in smask mode"); - } - const { - width: drawnWidth, - height: drawnHeight - } = this.ctx.canvas; - const scratchCanvas = this.canvasFactory.create(drawnWidth, drawnHeight); - this.smaskScratchCanvas = scratchCanvas; - this.suspendedCtx = this.ctx; - const ctx = this.ctx = scratchCanvas.context; - ctx.setTransform(this.suspendedCtx.getTransform()); - copyCtxState(this.suspendedCtx, ctx); - mirrorContextOperations(ctx, this.suspendedCtx); - this._ensurePreparedSMask(this.current.activeSMask); - this.setGState(opIdx, [["BM", "source-over"]]); + setCharWidth(opIdx, xWidth, yWidth) {} + setCharWidthAndBounds(opIdx, xWidth, yWidth, llx, lly, urx, ury) { + const clip = new Path2D(); + clip.rect(llx, lly, urx - llx, ury - lly); + this.ctx.clip(clip); + this.dependencyTracker?.recordBBox(opIdx, this.ctx, llx, urx, lly, ury).recordClipBox(opIdx, this.ctx, llx, urx, lly, ury); + this.endPath(opIdx); } - endSMaskMode() { - if (!this.inSMaskMode) { - throw new Error("endSMaskMode called while not in smask mode"); + getColorN_Pattern(opIdx, IR) { + let pattern; + if (IR[0] === "TilingPattern") { + const baseTransform = this.baseTransform || getCurrentTransform(this.ctx); + const canvasGraphicsFactory = { + createCanvasGraphics: (ctx, renderingOpIdx) => new CanvasGraphics(ctx, this.commonObjs, this.objs, this.canvasFactory, this.filterFactory, { + optionalContentConfig: this.optionalContentConfig, + markedContentStack: this.markedContentStack, + pixelRatio: this.pixelRatio + }, undefined, undefined, this.dependencyTracker ? new CanvasNestedDependencyTracker(this.dependencyTracker, renderingOpIdx, true) : null) + }; + pattern = new TilingPattern(IR, this.ctx, canvasGraphicsFactory, baseTransform); + } else { + pattern = this._getPattern(opIdx, IR[1], IR[2]); } - this.ctx._removeMirroring(); - copyCtxState(this.ctx, this.suspendedCtx); - this.ctx = this.suspendedCtx; - this.suspendedCtx = null; - this.canvasFactory.destroy(this.smaskScratchCanvas); - this.smaskScratchCanvas = null; - this._clearPreparedSMask(); + return pattern; } - #createKnockoutMaskCanvas(sourceCanvas, reuseEntry = null, alpha = 1) { - const { - width, - height - } = sourceCanvas; - const maskEntry = reuseEntry ?? this.canvasFactory.create(width, height); - const maskCtx = maskEntry.context; - alpha = Math.round(alpha * 255) / 255; - const needsAlphaScaling = alpha < 1; - if (needsAlphaScaling && this.#knockoutFilterCache === undefined) { - this.#knockoutFilterCache = FeatureTest.isCanvasFilterSupported ? new Map() : "none"; - } - let knockoutFilter = "none"; - if (needsAlphaScaling && this.#knockoutFilterCache instanceof Map) { - knockoutFilter = this.#knockoutFilterCache.getOrInsertComputed(alpha, () => this.filterFactory.addKnockoutFilter(alpha)); - } - if (!needsAlphaScaling || knockoutFilter !== "none") { - if (reuseEntry) { - maskCtx.save(); - maskCtx.setTransform(1, 0, 0, 1, 0, 0); - maskCtx.clearRect(0, 0, width, height); - maskCtx.restore(); - } - maskCtx.filter = knockoutFilter; - maskCtx.drawImage(sourceCanvas, 0, 0); - maskCtx.filter = "none"; - return maskEntry; - } - const sourceData = sourceCanvas.getContext("2d", { - willReadFrequently: true - }).getImageData(0, 0, width, height); - const maskData = maskCtx.createImageData(width, height); - const sourcePixels = sourceData.data, - maskPixels = maskData.data; - const alphaScale = alpha > 0 ? 1 / alpha : 1e6; - for (let i = 3, ii = sourcePixels.length; i < ii; i += 4) { - maskPixels[i] = Math.min(Math.round(sourcePixels[i] * alphaScale), 255); + setStrokeColorN(opIdx, ...args) { + this.dependencyTracker?.recordSimpleData("strokeColor", opIdx); + this.current.strokeColor = this.getColorN_Pattern(opIdx, args); + this.current.patternStroke = true; + } + setFillColorN(opIdx, ...args) { + this.dependencyTracker?.recordSimpleData("fillColor", opIdx); + const pattern = this.current.fillColor = this.getColorN_Pattern(opIdx, args); + this.current.patternFill = true; + this.current.tilingPatternDims = pattern instanceof TilingPattern ? [0, 0, 0, 0] : null; + } + #transferColor(color) { + return this.current.transferMapsFallback?.applyToColor(color) ?? color; + } + setStrokeRGBColor(opIdx, color) { + this.dependencyTracker?.recordSimpleData("strokeColor", opIdx); + this.current.strokeColor = color; + this.ctx.strokeStyle = this.#transferColor(color); + this.current.patternStroke = false; + } + setStrokeTransparent(opIdx) { + this.dependencyTracker?.recordSimpleData("strokeColor", opIdx); + this.ctx.strokeStyle = this.current.strokeColor = "transparent"; + this.current.patternStroke = false; + } + setFillRGBColor(opIdx, color) { + this.dependencyTracker?.recordSimpleData("fillColor", opIdx); + this.current.fillColor = color; + this.ctx.fillStyle = this.#transferColor(color); + this.current.patternFill = false; + this.current.tilingPatternDims = null; + } + setFillTransparent(opIdx) { + this.dependencyTracker?.recordSimpleData("fillColor", opIdx); + this.ctx.fillStyle = this.current.fillColor = "transparent"; + this.current.patternFill = false; + this.current.tilingPatternDims = null; + } + _getPattern(opIdx, objId, matrix = null) { + const pattern = this.cachedPatterns.getOrInsertComputed(objId, () => getShadingPattern(this.getObject(opIdx, objId))); + if (matrix) { + pattern.matrix = matrix; } - maskCtx.putImageData(maskData, 0, 0); - return maskEntry; + return pattern; } - #getOrCreatePooledEntry(meta, key, width, height) { - let entry = meta?.[key] ?? null; - if (entry && (entry.canvas.width !== width || entry.canvas.height !== height)) { - this.canvasFactory.destroy(entry); - entry = null; + shadingFill(opIdx, objId) { + if (!this.contentVisible) { + return; } - if (!entry) { - entry = this.canvasFactory.create(width, height); - if (meta) { - meta[key] = entry; - } - return entry; + const started = this.#beginKnockoutElement(this.current.fillAlpha); + const ctx = this.ctx; + this.save(opIdx); + const pattern = this._getPattern(opIdx, objId); + ctx.fillStyle = pattern.getPattern(ctx, this, getCurrentTransformInverse(ctx), PathType.SHADING, opIdx); + const inv = getCurrentTransformInverse(ctx); + if (inv) { + const { + width, + height + } = ctx.canvas; + const minMax = F32_BBOX_INIT.slice(); + Util.axialAlignedBoundingBox([0, 0, width, height], inv, minMax); + const [x0, y0, x1, y1] = minMax; + this.ctx.fillRect(x0, y0, x1 - x0, y1 - y0); + } else { + this.ctx.fillRect(-1e10, -1e10, 2e10, 2e10); } - const ctx = entry.context; - ctx.save(); - ctx.setTransform(1, 0, 0, 1, 0, 0); - ctx.clearRect(0, 0, width, height); - ctx.restore(); - return entry; + this.dependencyTracker?.resetBBox(opIdx).recordFullPageBBox(opIdx).recordDependencies(opIdx, Dependencies.transform).recordDependencies(opIdx, Dependencies.fill).recordOperation(opIdx); + this.compose(this.current.getClippedPathBoundingBox()); + this.restore(opIdx); + this.#endKnockoutElement(started); } - #compositeKnockoutSurface(destCtx, surfaceCanvas, options = {}) { - const { - backdropCanvas = null, - destTransform = [1, 0, 0, 1, 0, 0], - backdropOffset = [0, 0], - reuseMaskEntry = null, - poolMeta = null, - sourceAlpha = 1, - sourceFilter = "none", - knockoutAlpha = 1 - } = options; - const { - width, - height - } = surfaceCanvas; - const knockoutMaskEntry = this.#createKnockoutMaskCanvas(surfaceCanvas, reuseMaskEntry, knockoutAlpha); - const sourceCompositeOperation = destCtx.globalCompositeOperation; - destCtx.save(); - destCtx.setTransform(...destTransform); - destCtx.globalAlpha = 1; - if (FeatureTest.isCanvasFilterSupported) { - destCtx.filter = "none"; + beginInlineImage() { + unreachable("Should not call beginInlineImage"); + } + beginImageData() { + unreachable("Should not call beginImageData"); + } + paintFormXObjectBegin(opIdx, matrix, bbox) { + if (!this.contentVisible) { + return; } - destCtx.globalCompositeOperation = "destination-out"; - destCtx.drawImage(knockoutMaskEntry.canvas, 0, 0); - if (backdropCanvas) { - const [bx, by] = backdropOffset; - const backdropEntry = this.#getOrCreatePooledEntry(poolMeta, "knockoutBackdropEntry", width, height); - const backdropCtx = backdropEntry.context; - backdropCtx.drawImage(backdropCanvas, bx, by, width, height, 0, 0, width, height); - backdropCtx.globalCompositeOperation = "destination-in"; - backdropCtx.drawImage(knockoutMaskEntry.canvas, 0, 0); - backdropCtx.globalCompositeOperation = "source-over"; - destCtx.globalCompositeOperation = "destination-over"; - destCtx.drawImage(backdropEntry.canvas, 0, 0); - if (!poolMeta) { - this.canvasFactory.destroy(backdropEntry); - } + this.save(opIdx); + this.baseTransformStack.push(this.baseTransform); + if (matrix) { + this.transform(opIdx, ...matrix); } - destCtx.globalCompositeOperation = sourceCompositeOperation; - destCtx.globalAlpha = sourceAlpha; - if (FeatureTest.isCanvasFilterSupported) { - destCtx.filter = sourceFilter ?? "none"; + this.baseTransform = getCurrentTransform(this.ctx); + if (bbox) { + Util.axialAlignedBoundingBox(bbox, this.baseTransform, this.current.minMax); + const [x0, y0, x1, y1] = bbox; + const clip = new Path2D(); + clip.rect(x0, y0, x1 - x0, y1 - y0); + this.ctx.clip(clip); + this.dependencyTracker?.recordClipBox(opIdx, this.ctx, x0, x1, y0, y1); + this.endPath(opIdx); } - destCtx.drawImage(surfaceCanvas, 0, 0); - destCtx.restore(); - if (!reuseMaskEntry) { - this.canvasFactory.destroy(knockoutMaskEntry); + } + paintFormXObjectEnd(opIdx) { + if (!this.contentVisible) { + return; } + this.restore(opIdx); + this.baseTransform = this.baseTransformStack.pop(); } - #beginKnockoutElement(alpha = 1) { - if (this.#knockoutGroupLevel === 0 || this.#knockoutElementDepth > 0 || !this.contentVisible) { - return false; + beginGroup(opIdx, group) { + if (!this.contentVisible) { + return; } - this.#knockoutElementDepth++; - this.#knockoutElementAlpha = alpha; - const groupMeta = this.#groupStackMeta.at(-1); + this.save(opIdx); const { - canvas - } = this.ctx; - const tempEntry = this.#getOrCreatePooledEntry(groupMeta, "knockoutTempEntry", canvas.width, canvas.height); - this.#knockoutTempCanvasEntry = tempEntry; - const tempCtx = tempEntry.context; - tempCtx.save(); - tempCtx.setTransform(this.ctx.getTransform()); - copyCtxState(this.ctx, tempCtx); - this.#knockoutSavedGCO = tempCtx.globalCompositeOperation; - tempCtx.globalCompositeOperation = "source-over"; - mirrorContextOperations(tempCtx, this.ctx); - this.#knockoutElementGroupMeta = groupMeta; - this.#knockoutSavedCtx = this.ctx; - this.#knockoutSavedSMaskCtx = this.suspendedCtx; - this.ctx = tempCtx; - if (this.inSMaskMode) { - this.suspendedCtx = tempCtx; + inSMaskMode + } = this; + if (inSMaskMode) { + this.endSMaskMode(); + this.current.activeSMask = null; } - return true; - } - #endKnockoutElement(started) { - if (!started) { + const currentCtx = this.ctx; + if ((!group.needsIsolation || !group.isolated && !group.hasSoftMask) && !group.knockout && !group.isGray && this.#knockoutGroupLevel === 0 && currentCtx.globalAlpha === 1 && currentCtx.globalCompositeOperation === "source-over" && !inSMaskMode) { + if (group.bbox) { + let clip = new Path2D(); + const [x0, y0, x1, y1] = group.bbox; + clip.rect(x0, y0, x1 - x0, y1 - y0); + if (group.matrix) { + const path = new Path2D(); + path.addPath(clip, new DOMMatrix(group.matrix)); + clip = path; + } + currentCtx.clip(clip); + } + this.groupStack.push(null); + this.#groupStackMeta.push(null); + this.groupLevel++; return; } - const tempEntry = this.#knockoutTempCanvasEntry; - const savedCtx = this.#knockoutSavedCtx; - const savedSMaskCtx = this.#knockoutSavedSMaskCtx; - const tempCtx = tempEntry.context; - this.#knockoutTempCanvasEntry = null; - this.#knockoutSavedCtx = null; - this.#knockoutSavedSMaskCtx = null; - if (this.inSMaskMode && this.suspendedCtx === tempCtx && this.ctx !== tempCtx) { - this.endSMaskMode(); + if (!group.isolated && !group.knockout && this.#knockoutGroupLevel === 0) { + info("TODO: Fully support non-isolated non-knockout groups."); } - if (this.inSMaskMode) { - this.suspendedCtx = savedSMaskCtx; + const currentTransform = getCurrentTransform(currentCtx); + if (group.matrix) { + currentCtx.transform(...group.matrix); } - this.ctx._removeMirroring(); - this.ctx.globalCompositeOperation = this.#knockoutSavedGCO; - this.#knockoutSavedGCO = null; - copyCtxState(this.ctx, savedCtx); - this.ctx = savedCtx; - const groupMeta = this.#knockoutElementGroupMeta; - this.#knockoutElementGroupMeta = null; - const knockoutAlpha = this.#knockoutElementAlpha; - this.#knockoutElementAlpha = 1; - try { - this.#compositeKnockoutSurface(savedSMaskCtx ?? savedCtx, tempEntry.canvas, { - backdropCanvas: groupMeta?.backdropCtx?.canvas ?? null, - backdropOffset: groupMeta?.backdropCtx ? [groupMeta.offsetX, groupMeta.offsetY] : [0, 0], - reuseMaskEntry: groupMeta?.knockoutMaskEntry ?? null, - poolMeta: groupMeta, - knockoutAlpha - }); - } finally { - tempCtx.restore(); - this.#knockoutElementDepth--; - if (!groupMeta) { - this.canvasFactory.destroy(tempEntry); - } + const canvasBounds = [0, 0, currentCtx.canvas.width, currentCtx.canvas.height]; + let bounds; + if (group.bbox) { + bounds = F32_BBOX_INIT.slice(); + Util.axialAlignedBoundingBox(group.bbox, getCurrentTransform(currentCtx), bounds); + bounds = Util.intersect(bounds, canvasBounds) || [0, 0, 0, 0]; + } else { + bounds = canvasBounds; } - } - compose(dirtyBox) { - if (!this.current.activeSMask) { - return; + const offsetX = Math.floor(bounds[0]); + const offsetY = Math.floor(bounds[1]); + const drawnWidth = Math.max(Math.ceil(bounds[2]) - offsetX, 1); + const drawnHeight = Math.max(Math.ceil(bounds[3]) - offsetY, 1); + this.current.startNewPathAndClipBox([0, 0, drawnWidth, drawnHeight]); + const scratchCanvas = this.canvasFactory.create(drawnWidth, drawnHeight); + if (group.smask) { + this.smaskGroupCanvases.push(scratchCanvas); } - dirtyBox = dirtyBox ? [Math.floor(dirtyBox[0]), Math.floor(dirtyBox[1]), Math.ceil(dirtyBox[2]), Math.ceil(dirtyBox[3])] : [0, 0, this.ctx.canvas.width, this.ctx.canvas.height]; - const smask = this.current.activeSMask; - const suspendedCtx = this.suspendedCtx; - const applySMaskInPlace = this.#knockoutElementDepth > 0 && suspendedCtx === this.ctx; - this.composeSMask(applySMaskInPlace ? null : suspendedCtx, smask, this.ctx, dirtyBox); - if (applySMaskInPlace) { - return; + const groupCtx = scratchCanvas.context; + const backdropCtx = group.knockout && !group.isolated ? currentCtx : null; + const hasInnerBackdrop = !group.isolated && !group.knockout && !group.smask && group.needsIsolation && this.#knockoutGroupLevel > 0; + const knockoutMaskEntry = group.knockout ? this.canvasFactory.create(drawnWidth, drawnHeight) : null; + const savedKnockoutLevel = this.#knockoutGroupLevel; + if (group.knockout) { + this.#knockoutGroupLevel++; + } else { + this.#knockoutGroupLevel = 0; } - 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(ctx, smask, layerCtx, layerBox) { - const layerOffsetX = layerBox[0]; - const layerOffsetY = layerBox[1]; - const layerWidth = layerBox[2] - layerOffsetX; - const layerHeight = layerBox[3] - layerOffsetY; - if (layerWidth === 0 || layerHeight === 0) { - return; + groupCtx.translate(-offsetX, -offsetY); + groupCtx.transform(...currentTransform); + const needsBackdropCopy = !group.isolated && !group.smask && group.needsIsolation; + const replaceBackdrop = needsBackdropCopy && !inSMaskMode && savedKnockoutLevel === 0 && !group.knockout && !group.isGray && group.hasSoftMask && currentCtx.globalAlpha === 1 && currentCtx.globalCompositeOperation === "source-over" && this.current.transferMaps === "none" && !this.current.transferMapsFallback; + if (needsBackdropCopy && (inSMaskMode || replaceBackdrop)) { + groupCtx.save(); + groupCtx.setTransform(1, 0, 0, 1, 0, 0); + groupCtx.drawImage(currentCtx.canvas, -offsetX, -offsetY); + groupCtx.restore(); } - const preparedEntry = this.smaskPreparedEntry; - if (preparedEntry) { - let clipX = layerOffsetX; - let clipY = layerOffsetY; - let clipW = layerWidth; - let clipH = layerHeight; - const oobAlpha = this.smaskPreparedOOBAlpha; - const hasOOBAlpha = oobAlpha !== null; - if (hasOOBAlpha) { - clipX = Math.max(layerOffsetX, smask.offsetX); - clipY = Math.max(layerOffsetY, smask.offsetY); - const x1 = Math.min(layerOffsetX + layerWidth, smask.offsetX + smask.canvas.width); - const y1 = Math.min(layerOffsetY + layerHeight, smask.offsetY + smask.canvas.height); - clipW = x1 - clipX; - clipH = y1 - clipY; - } - if (clipW > 0 && clipH > 0) { - const srcX = clipX - this.smaskPreparedOffsetX; - const srcY = clipY - this.smaskPreparedOffsetY; - layerCtx.save(); - layerCtx.globalAlpha = 1; - layerCtx.setTransform(1, 0, 0, 1, 0, 0); - const clip = new Path2D(); - clip.rect(clipX, clipY, clipW, clipH); - layerCtx.clip(clip); - layerCtx.globalCompositeOperation = "destination-in"; - layerCtx.drawImage(preparedEntry.canvas, srcX, srcY, clipW, clipH, clipX, clipY, clipW, clipH); - layerCtx.restore(); - } - if (hasOOBAlpha && oobAlpha < 255) { - this._applySMaskOOBAlpha(layerCtx, layerOffsetX, layerOffsetY, layerWidth, layerHeight, clipX, clipY, clipX + clipW, clipY + clipH, oobAlpha); + if (group.bbox) { + let clip = new Path2D(); + const [x0, y0, x1, y1] = group.bbox; + clip.rect(x0, y0, x1 - x0, y1 - y0); + if (group.matrix) { + const path = new Path2D(); + path.addPath(clip, new DOMMatrix(group.matrix)); + clip = path; } - } else { - this.genericComposeSMask(smask, layerCtx, layerWidth, layerHeight, layerOffsetX, layerOffsetY); + groupCtx.clip(clip); } - if (!ctx) { + if (group.smask) { + this.smaskStack.push({ + canvas: scratchCanvas.canvas, + context: groupCtx, + offsetX, + offsetY, + subtype: group.smask.subtype, + backdrop: group.smask.backdrop, + transferMap: group.smask.transferMap || null + }); + } + if (!group.smask || this.dependencyTracker) { + currentCtx.setTransform(1, 0, 0, 1, 0, 0); + currentCtx.translate(offsetX, offsetY); + currentCtx.save(); + } + copyCtxState(currentCtx, groupCtx); + this.ctx = groupCtx; + this.dependencyTracker?.inheritSimpleDataAsFutureForcedDependencies(["fillAlpha", "strokeAlpha", "globalCompositeOperation"]).pushBaseTransform(currentCtx); + this.setGState(opIdx, [["BM", "source-over"], ["ca", 1], ["CA", 1], ["TR", null]]); + this.groupStack.push(currentCtx); + this.#groupStackMeta.push({ + backdropCtx, + savedKnockoutLevel, + offsetX, + offsetY, + hasInnerBackdrop, + replaceBackdrop, + knockoutMaskEntry, + knockoutTempEntry: null, + knockoutBackdropEntry: null + }); + this.groupLevel++; + } + endGroup(opIdx, group) { + if (!this.contentVisible) { return; } - ctx.save(); - ctx.globalAlpha = 1; - ctx.globalCompositeOperation = smask.blendMode || "source-over"; - ctx.setTransform(1, 0, 0, 1, 0, 0); - ctx.drawImage(layerCtx.canvas, layerOffsetX, layerOffsetY, layerWidth, layerHeight, layerOffsetX, layerOffsetY, layerWidth, layerHeight); - ctx.restore(); - } - _applySMaskOOBAlpha(layerCtx, layerOffsetX, layerOffsetY, layerWidth, layerHeight, maskX0, maskY0, maskX1, maskY1, alpha) { - const hasInnerCutout = maskX0 < maskX1 && maskY0 < maskY1; - if (hasInnerCutout && maskX0 === layerOffsetX && maskY0 === layerOffsetY && maskX1 === layerOffsetX + layerWidth && maskY1 === layerOffsetY + layerHeight) { + this.groupLevel--; + const groupCtx = this.ctx; + const ctx = this.groupStack.pop(); + const groupMeta = this.#groupStackMeta.pop(); + if (groupMeta) { + this.#knockoutGroupLevel = groupMeta.savedKnockoutLevel; + } + if (ctx === null) { + this.restore(opIdx); return; } - const path = new Path2D(); - path.rect(layerOffsetX, layerOffsetY, layerWidth, layerHeight); - if (hasInnerCutout) { - path.rect(maskX0, maskY0, maskX1 - maskX0, maskY1 - maskY0); + if (group.isGray) { + this.#convertGroupToGray(groupCtx); } - layerCtx.save(); - layerCtx.globalAlpha = alpha / 255; - layerCtx.setTransform(1, 0, 0, 1, 0, 0); - layerCtx.clip(path, "evenodd"); - layerCtx.globalCompositeOperation = "destination-in"; - layerCtx.fillStyle = "#000000"; - layerCtx.fillRect(layerOffsetX, layerOffsetY, layerWidth, layerHeight); - layerCtx.restore(); - } - genericComposeSMask(smask, layerCtx, width, height, layerOffsetX, layerOffsetY) { - const { - context: maskCtx, - offsetX: maskOffsetX, - offsetY: maskOffsetY - } = smask; - layerCtx.save(); - layerCtx.globalAlpha = 1; - layerCtx.setTransform(1, 0, 0, 1, 0, 0); - const clip = new Path2D(); - clip.rect(layerOffsetX, layerOffsetY, width, height); - layerCtx.clip(clip); - layerCtx.globalCompositeOperation = "destination-in"; - layerCtx.drawImage(maskCtx.canvas, layerOffsetX - maskOffsetX, layerOffsetY - maskOffsetY, width, height, layerOffsetX, layerOffsetY, width, height); - layerCtx.restore(); - } - save(opIdx) { - if (this.inSMaskMode) { - copyCtxState(this.ctx, this.suspendedCtx); + this.ctx = ctx; + this.ctx.imageSmoothingEnabled = false; + this.dependencyTracker?.popBaseTransform(); + if (group.smask) { + this.tempSMask = this.smaskStack.pop(); + this.restore(opIdx); + if (this.dependencyTracker) { + this.ctx.restore(); + if (this.inSMaskMode) { + this.ctx.setTransform(this.suspendedCtx.getTransform()); + } + } + this.#destroyKnockoutPools(groupMeta); + } else { + this.ctx.restore(); + const currentMtx = getCurrentTransform(this.ctx); + this.restore(opIdx); + this.current.transferMapsFallback?.applyToCanvas(groupCtx); + this.ctx.save(); + this.ctx.setTransform(...currentMtx); + const dirtyBox = F32_BBOX_INIT.slice(); + Util.axialAlignedBoundingBox([0, 0, groupCtx.canvas.width, groupCtx.canvas.height], currentMtx, dirtyBox); + const parentGroupMeta = this.#groupStackMeta.at(-1); + if (this.#knockoutGroupLevel > 0) { + if (groupMeta.hasInnerBackdrop) { + const { + width, + height + } = groupCtx.canvas; + const colorEntry = this.canvasFactory.create(width, height); + const colorCtx = colorEntry.context; + colorCtx.drawImage(ctx.canvas, groupMeta.offsetX, groupMeta.offsetY, width, height, 0, 0, width, height); + colorCtx.globalCompositeOperation = "source-over"; + colorCtx.drawImage(groupCtx.canvas, 0, 0); + const shapeMaskEntry = this.#createKnockoutMaskCanvas(groupCtx.canvas); + colorCtx.globalCompositeOperation = "destination-in"; + colorCtx.drawImage(shapeMaskEntry.canvas, 0, 0); + const sourceCompositeOperation = this.ctx.globalCompositeOperation; + const sourceAlpha = this.ctx.globalAlpha; + const sourceFilter = this.ctx.filter; + this.ctx.save(); + this.ctx.setTransform(...currentMtx); + this.ctx.globalAlpha = 1; + if (FeatureTest.isCanvasFilterSupported) { + this.ctx.filter = "none"; + } + this.ctx.globalCompositeOperation = "destination-out"; + this.ctx.drawImage(shapeMaskEntry.canvas, 0, 0); + this.ctx.globalCompositeOperation = sourceCompositeOperation; + this.ctx.globalAlpha = sourceAlpha; + if (FeatureTest.isCanvasFilterSupported) { + this.ctx.filter = sourceFilter ?? "none"; + } + this.ctx.drawImage(colorEntry.canvas, 0, 0); + this.ctx.restore(); + this.canvasFactory.destroy(shapeMaskEntry); + this.canvasFactory.destroy(colorEntry); + } else { + const backdropCtx = parentGroupMeta?.backdropCtx ?? null; + this.#compositeKnockoutSurface(this.ctx, groupCtx.canvas, { + backdropCanvas: backdropCtx?.canvas ?? null, + destTransform: currentMtx, + backdropOffset: backdropCtx ? [parentGroupMeta.offsetX + groupMeta.offsetX, parentGroupMeta.offsetY + groupMeta.offsetY] : [0, 0], + sourceAlpha: this.ctx.globalAlpha, + sourceFilter: this.ctx.filter + }); + } + } else { + if (groupMeta.replaceBackdrop) { + const clip = new Path2D(); + clip.rect(0, 0, groupCtx.canvas.width, groupCtx.canvas.height); + this.ctx.clip(clip); + this.ctx.globalCompositeOperation = "copy"; + } + this.ctx.drawImage(groupCtx.canvas, 0, 0); + } + this.ctx.restore(); + this.canvasFactory.destroy({ + canvas: groupCtx.canvas, + context: groupCtx + }); + this.#destroyKnockoutPools(groupMeta); + this.compose(dirtyBox); } - this.ctx.save(); - const old = this.current; - this.stateStack.push(old); - this.current = old.clone(); - this.dependencyTracker?.save(opIdx); } - restore(opIdx) { - this.dependencyTracker?.restore(opIdx); - if (this.stateStack.length === 0) { - if (this.inSMaskMode) { - this.endSMaskMode(); - } + #convertGroupToGray(groupCtx) { + const { + canvas + } = groupCtx; + const { + width, + height + } = canvas; + if (FeatureTest.isCanvasFilterSupported) { + groupCtx.save(); + groupCtx.setTransform(1, 0, 0, 1, 0, 0); + groupCtx.filter = "grayscale(1)"; + groupCtx.globalAlpha = 1; + groupCtx.globalCompositeOperation = "copy"; + groupCtx.drawImage(canvas, 0, 0); + groupCtx.restore(); return; } - this.current = this.stateStack.pop(); - this.ctx.restore(); - if (this.inSMaskMode) { - copyCtxState(this.suspendedCtx, this.ctx); - this.ctx.setTransform(this.suspendedCtx.getTransform()); + const imageData = groupCtx.getImageData(0, 0, width, height); + const { + data + } = imageData; + for (let i = 0, ii = data.length; i < ii; i += 4) { + const gray = data[i] * 0.2126 + data[i + 1] * 0.7152 + data[i + 2] * 0.0722 + 0.5 | 0; + data[i] = data[i + 1] = data[i + 2] = gray; } - this.checkSMaskState(opIdx); - this.pendingClip = null; - this._cachedScaleForStroking[0] = -1; - } - transform(opIdx, a, b, c, d, e, f) { - this.dependencyTracker?.recordIncrementalData("transform", opIdx); - this.ctx.transform(a, b, c, d, e, f); - this._cachedScaleForStroking[0] = -1; + groupCtx.putImageData(imageData, 0, 0); } - constructPath(opIdx, op, data, minMax) { - let [path] = data; - if (!minMax) { - path ||= data[0] = new Path2D(); - if (op !== OPS.stroke && op !== OPS.closeStroke) { - this.current.tilingPatternDims = null; - } - this[op](opIdx, path); + #destroyKnockoutPools(groupMeta) { + if (!groupMeta) { return; } - if (this.dependencyTracker !== null) { - const outerExtraSize = op === OPS.stroke ? this.current.lineWidth / 2 : 0; - this.dependencyTracker.resetBBox(opIdx).recordBBox(opIdx, this.ctx, minMax[0] - outerExtraSize, minMax[2] + outerExtraSize, minMax[1] - outerExtraSize, minMax[3] + outerExtraSize).recordDependencies(opIdx, ["transform"]); + if (groupMeta.knockoutMaskEntry) { + this.canvasFactory.destroy(groupMeta.knockoutMaskEntry); + groupMeta.knockoutMaskEntry = null; } - if (!(path instanceof Path2D)) { - path = data[0] = makePathFromDrawOPS(path); + if (groupMeta.knockoutTempEntry) { + this.canvasFactory.destroy(groupMeta.knockoutTempEntry); + groupMeta.knockoutTempEntry = null; } - Util.axialAlignedBoundingBox(minMax, getCurrentTransform(this.ctx), this.current.minMax); - const tilingDims = this.current.tilingPatternDims; - if (tilingDims && op !== OPS.stroke && op !== OPS.closeStroke && this.current.fillColor instanceof TilingPattern) { - const clippedBBox = Util.intersect(this.current.clipBox, this.current.minMax); - if (!clippedBBox) { - this.current.tilingPatternDims = null; - } else { - this.current.fillColor.updatePatternDims(clippedBBox, tilingDims); - } + if (groupMeta.knockoutBackdropEntry) { + this.canvasFactory.destroy(groupMeta.knockoutBackdropEntry); + groupMeta.knockoutBackdropEntry = null; } - this[op](opIdx, path); - this._pathStartIdx = opIdx; - } - closePath(opIdx) { - this.ctx.closePath(); } - stroke(opIdx, path, consumePath = true) { - const started = consumePath && this.#beginKnockoutElement(this.current.strokeAlpha); - const ctx = this.ctx; - const strokeColor = this.current.strokeColor; - ctx.globalAlpha = this.current.strokeAlpha; - if (this.contentVisible) { - if (typeof strokeColor === "object" && strokeColor?.getPattern) { - const baseTransform = strokeColor.isModifyingCurrentTransform() ? ctx.getTransform() : null; - ctx.save(); - ctx.strokeStyle = strokeColor.getPattern(ctx, this, getCurrentTransformInverse(ctx), PathType.STROKE, opIdx); - if (baseTransform) { - const newPath = new Path2D(); - newPath.addPath(path, ctx.getTransform().invertSelf().multiplySelf(baseTransform)); - path = newPath; + beginAnnotation(opIdx, id, rect, transform, matrix, hasOwnCanvas, canvasName) { + this.#restoreInitialState(); + resetCtxToDefault(this.ctx); + this.ctx.save(); + this.save(opIdx); + if (this.baseTransform) { + this.ctx.setTransform(...this.baseTransform); + } + if (rect) { + const width = rect[2] - rect[0]; + const height = rect[3] - rect[1]; + if (hasOwnCanvas && this.annotationCanvasMap) { + transform = transform.slice(); + transform[4] -= rect[0]; + transform[5] -= rect[1]; + Util.singularValueDecompose2dScale(getCurrentTransform(this.ctx), XY); + const { + viewportScale + } = this; + const canvasWidth = Math.ceil(width * this.outputScaleX * viewportScale); + const canvasHeight = Math.ceil(height * this.outputScaleY * viewportScale); + this.annotationCanvas = this.canvasFactory.create(canvasWidth, canvasHeight); + const { + canvas, + context + } = this.annotationCanvas; + if (canvasName) { + const canvases = this.annotationCanvasMap.getOrInsertComputed(id, makeArr); + setAnnotationCanvasName(canvas, canvasName); + const index = canvases.findIndex(c => getAnnotationCanvasName(c) === canvasName); + if (index === -1) { + canvases.push(canvas); + } else { + canvases[index] = canvas; + } + } else { + this.annotationCanvasMap.set(id, canvas); } - this.rescaleAndStroke(path, false); - ctx.restore(); + this.annotationCanvas.savedCtx = this.ctx; + this.ctx = context; + this.ctx.save(); + this.ctx.setTransform(XY[0], 0, 0, -XY[1], 0, height * XY[1]); + resetCtxToDefault(this.ctx); } else { - this.rescaleAndStroke(path, true); + resetCtxToDefault(this.ctx); + this.endPath(opIdx); + const clip = new Path2D(); + clip.rect(rect[0], rect[1], width, height); + this.ctx.clip(clip); } } - this.dependencyTracker?.recordDependencies(opIdx, Dependencies.stroke); - if (consumePath) { - this.consumePath(opIdx, path, this.current.getClippedPathBoundingBox(PathType.STROKE, getCurrentTransform(this.ctx))); - } - ctx.globalAlpha = this.current.fillAlpha; - this.#endKnockoutElement(started); + this.current = new CanvasExtraState(this.ctx.canvas.width, this.ctx.canvas.height); + this.baseTransformStack.push(this.baseTransform); + this.transform(opIdx, ...transform); + this.transform(opIdx, ...matrix); + this.baseTransform = getCurrentTransform(this.ctx); } - closeStroke(opIdx, path) { - this.stroke(opIdx, path); + endAnnotation(opIdx) { + if (this.annotationCanvas) { + this.ctx.restore(); + this.#drawFilter(); + this.ctx = this.annotationCanvas.savedCtx; + delete this.annotationCanvas.savedCtx; + delete this.annotationCanvas; + } + this.baseTransform = this.baseTransformStack.pop(); } - fill(opIdx, path, consumePath = true) { - const started = consumePath && this.#beginKnockoutElement(this.current.fillAlpha); + paintImageMaskXObject(opIdx, img) { + if (!this.contentVisible) { + return; + } + const count = img.count; + img = this.getObject(opIdx, img.data, img); + img.count = count; + const started = this.#beginKnockoutElement(this.current.fillAlpha); const ctx = this.ctx; - const fillColor = this.current.fillColor; - const isPatternFill = this.current.patternFill; - let needRestore = false; - const intersect = this.current.getClippedPathBoundingBox(); - this.dependencyTracker?.recordDependencies(opIdx, Dependencies.fill); - if (isPatternFill) { - const dims = this.current.tilingPatternDims; - const tileIdx = dims && fillColor.canSkipPatternCanvas(dims); - if (tileIdx) { - fillColor.drawPattern(this, path, this.pendingEOFill, tileIdx, opIdx); - this.pendingEOFill = false; - if (consumePath) { - this.consumePath(opIdx, path, intersect); - } - this.current.tilingPatternDims = null; - this.#endKnockoutElement(started); - return; - } - const baseTransform = fillColor.isModifyingCurrentTransform() ? ctx.getTransform() : null; - this.dependencyTracker?.save(opIdx); - ctx.save(); - ctx.fillStyle = fillColor.getPattern(ctx, this, getCurrentTransformInverse(ctx), PathType.FILL, opIdx); - if (baseTransform) { - const newPath = new Path2D(); - newPath.addPath(path, ctx.getTransform().invertSelf().multiplySelf(baseTransform)); - path = newPath; - } - needRestore = true; + const mask = this._createMaskCanvas(opIdx, img); + const maskCanvas = mask.canvas; + ctx.save(); + ctx.setTransform(1, 0, 0, 1, 0, 0); + ctx.drawImage(maskCanvas, mask.offsetX, mask.offsetY); + this.dependencyTracker?.resetBBox(opIdx).recordBBox(opIdx, this.ctx, mask.offsetX, mask.offsetX + maskCanvas.width, mask.offsetY, mask.offsetY + maskCanvas.height).recordOperation(opIdx); + ctx.restore(); + if (mask.canvasEntry) { + this.canvasFactory.destroy(mask.canvasEntry); } - if (this.contentVisible && intersect !== null) { - if (this.pendingEOFill) { - ctx.fill(path, "evenodd"); - this.pendingEOFill = false; - } else { - ctx.fill(path); - } + this.compose(); + this.#endKnockoutElement(started); + } + paintImageMaskXObjectRepeat(opIdx, img, scaleX, skewX = 0, skewY = 0, scaleY, positions) { + if (!this.contentVisible) { + return; } - if (needRestore) { - ctx.restore(); - this.dependencyTracker?.restore(opIdx); + img = this.getObject(opIdx, img.data, img); + const started = this.#beginKnockoutElement(this.current.fillAlpha); + const ctx = this.ctx; + ctx.save(); + const currentTransform = getCurrentTransform(ctx); + ctx.transform(scaleX, skewX, skewY, scaleY, 0, 0); + const mask = this._createMaskCanvas(opIdx, img); + ctx.setTransform(1, 0, 0, 1, mask.offsetX - currentTransform[4], mask.offsetY - currentTransform[5]); + this.dependencyTracker?.resetBBox(opIdx); + for (let i = 0, ii = positions.length; i < ii; i += 2) { + const trans = Util.transform(currentTransform, [scaleX, skewX, skewY, scaleY, positions[i], positions[i + 1]]); + ctx.drawImage(mask.canvas, trans[4], trans[5]); + this.dependencyTracker?.recordBBox(opIdx, this.ctx, trans[4], trans[4] + mask.canvas.width, trans[5], trans[5] + mask.canvas.height); } - if (consumePath) { - this.consumePath(opIdx, path, intersect); + ctx.restore(); + if (mask.canvasEntry) { + this.canvasFactory.destroy(mask.canvasEntry); } + this.compose(); + this.dependencyTracker?.recordOperation(opIdx); this.#endKnockoutElement(started); } - eoFill(opIdx, path) { - this.pendingEOFill = true; - this.fill(opIdx, path); - } - fillStroke(opIdx, path) { - const started = this.#beginKnockoutElement(Math.min(this.current.fillAlpha, this.current.strokeAlpha)); - this.fill(opIdx, path, false); - this.stroke(opIdx, path, false); - this.consumePath(opIdx, path); - this.#endKnockoutElement(started); - } - eoFillStroke(opIdx, path) { - this.pendingEOFill = true; - this.fillStroke(opIdx, path); - } - closeFillStroke(opIdx, path) { - this.fillStroke(opIdx, path); - } - closeEOFillStroke(opIdx, path) { - this.pendingEOFill = true; - this.fillStroke(opIdx, path); - } - endPath(opIdx, path) { - this.consumePath(opIdx, path); - } - rawFillPath(opIdx, path) { + paintImageMaskXObjectGroup(opIdx, images) { + if (!this.contentVisible) { + return; + } const started = this.#beginKnockoutElement(this.current.fillAlpha); - this.ctx.fill(path); - this.dependencyTracker?.recordDependencies(opIdx, Dependencies.rawFillPath).recordOperation(opIdx); - this.#endKnockoutElement(started); - } - clip(opIdx) { - this.dependencyTracker?.recordFutureForcedDependency("clipMode", opIdx); - this.pendingClip = NORMAL_CLIP; - } - eoClip(opIdx) { - this.dependencyTracker?.recordFutureForcedDependency("clipMode", opIdx); - this.pendingClip = EO_CLIP; - } - beginText(opIdx) { - 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(opIdx).resetIncrementalData("sameLineText").resetIncrementalData("moveText", opIdx); - } - endText(opIdx) { - const paths = this.pendingTextPaths; const ctx = this.ctx; - if (this.dependencyTracker) { + const isPatternFill = this.current.patternFill; + const fillColor = isPatternFill ? this.current.fillColor : ctx.fillStyle; + this.dependencyTracker?.resetBBox(opIdx).recordDependencies(opIdx, Dependencies.transformAndFill); + for (const image of images) { const { - dependencyTracker - } = this; - if (paths !== undefined) { - dependencyTracker.recordFutureForcedDependency("textClip", dependencyTracker.getOpenMarker()).recordFutureForcedDependency("textClip", opIdx); - } - dependencyTracker.recordCloseMarker(opIdx); - } - if (paths !== undefined) { - const newPath = new Path2D(); - const invTransf = ctx.getTransform().invertSelf(); - for (const { - transform, - x, - y, - fontSize, - path - } of paths) { - if (!path) { - continue; - } - newPath.addPath(path, new DOMMatrix(transform).preMultiplySelf(invTransf).translate(x, y).scale(fontSize, -fontSize)); - } - ctx.clip(newPath); + data, + width, + height, + transform + } = image; + const maskCanvas = this.canvasFactory.create(width, height); + const maskCtx = maskCanvas.context; + maskCtx.save(); + const img = this.getObject(opIdx, data, image); + putBinaryImageMask(maskCtx, img); + maskCtx.globalCompositeOperation = "source-in"; + maskCtx.fillStyle = isPatternFill ? fillColor.getPattern(maskCtx, this, getCurrentTransformInverse(ctx), PathType.FILL, opIdx) : fillColor; + maskCtx.fillRect(0, 0, width, height); + maskCtx.restore(); + ctx.save(); + ctx.transform(...transform); + ctx.scale(1, -1); + drawImageAtIntegerCoords(ctx, maskCanvas.canvas, 0, 0, width, height, 0, -1, 1, 1); + this.canvasFactory.destroy(maskCanvas); + this.dependencyTracker?.recordBBox(opIdx, ctx, 0, width, 0, height); + ctx.restore(); } - delete this.pendingTextPaths; - } - setCharSpacing(opIdx, spacing) { - this.dependencyTracker?.recordSimpleData("charSpacing", opIdx); - this.current.charSpacing = spacing; - } - setWordSpacing(opIdx, spacing) { - this.dependencyTracker?.recordSimpleData("wordSpacing", opIdx); - this.current.wordSpacing = spacing; - } - setHScale(opIdx, scale) { - this.dependencyTracker?.recordSimpleData("hScale", opIdx); - this.current.textHScale = scale / 100; - } - setLeading(opIdx, leading) { - this.dependencyTracker?.recordSimpleData("leading", opIdx); - this.current.leading = -leading; - } - setFont(opIdx, fontRefName, size) { - this.dependencyTracker?.recordSimpleData("font", opIdx).recordSimpleDataFromNamed("fontObj", fontRefName, opIdx); - const fontObj = this.commonObjs.get(fontRefName); - const current = this.current; - if (!fontObj) { - throw new Error(`Can't find font for ${fontRefName}`); + this.compose(); + this.dependencyTracker?.recordOperation(opIdx); + this.#endKnockoutElement(started); + } + paintImageXObject(opIdx, objId) { + if (!this.contentVisible) { + return; } - current.fontMatrix = fontObj.fontMatrix || FONT_IDENTITY_MATRIX; - if (current.fontMatrix[0] === 0 || current.fontMatrix[3] === 0) { - warn("Invalid font matrix for font " + fontRefName); + const imgData = this.getObject(opIdx, objId); + if (!imgData) { + warn("Dependent image isn't ready yet"); + return; } - if (size < 0) { - size = -size; - current.fontDirection = -1; - } else { - current.fontDirection = 1; + this.paintInlineImageXObject(opIdx, imgData); + } + paintImageXObjectRepeat(opIdx, objId, scaleX, scaleY, positions) { + if (!this.contentVisible) { + return; } - this.current.font = fontObj; - this.current.fontSize = size; - if (fontObj.isType3Font) { + const imgData = this.getObject(opIdx, objId); + if (!imgData) { + warn("Dependent image isn't ready yet"); return; } - const name = fontObj.loadedName || "sans-serif"; - const typeface = fontObj.systemFontInfo?.css || `"${name}", ${fontObj.fallbackName}`; - let bold = "normal"; - if (fontObj.black) { - bold = "900"; - } else if (fontObj.bold) { - bold = "bold"; + const width = imgData.width; + const height = imgData.height; + const map = []; + for (let i = 0, ii = positions.length; i < ii; i += 2) { + map.push({ + transform: [scaleX, 0, 0, scaleY, positions[i], positions[i + 1]], + x: 0, + y: 0, + w: width, + h: height + }); } - const italic = fontObj.italic ? "italic" : "normal"; - const browserFontSize = MathClamp(size, MIN_FONT_SIZE, MAX_FONT_SIZE); - this.current.fontSizeScale = size / browserFontSize; - this.ctx.font = `${italic} ${bold} ${browserFontSize}px ${typeface}`; - } - setTextRenderingMode(opIdx, mode) { - this.dependencyTracker?.recordSimpleData("textRenderingMode", opIdx); - this.current.textRenderingMode = mode; - } - setTextRise(opIdx, rise) { - this.dependencyTracker?.recordSimpleData("textRise", opIdx); - this.current.textRise = rise; - } - moveText(opIdx, x, y) { - this.dependencyTracker?.resetIncrementalData("sameLineText").recordIncrementalData("moveText", opIdx); - this.current.x = this.current.lineX += x; - this.current.y = this.current.lineY += y; + this.paintInlineImageXObjectGroup(opIdx, imgData, map); } - setLeadingMoveText(opIdx, x, y) { - this.setLeading(opIdx, -y); - this.moveText(opIdx, x, y); + applyTransferMapsToCanvas(ctx) { + if (this.current.transferMaps !== "none") { + ctx.filter = this.current.transferMaps; + ctx.drawImage(ctx.canvas, 0, 0); + ctx.filter = "none"; + } else { + this.current.transferMapsFallback?.applyToCanvas(ctx); + } + return ctx.canvas; } - setTextMatrix(opIdx, matrix) { - this.dependencyTracker?.resetIncrementalData("sameLineText").recordSimpleData("textMatrix", opIdx); + applyTransferMapsToBitmap(imgData) { const { - current - } = this; - current.textMatrix = matrix; - current.textMatrixScale = Math.hypot(matrix[0], matrix[1]); - current.x = current.lineX = 0; - current.y = current.lineY = 0; - } - nextLine(opIdx) { - this.moveText(opIdx, 0, this.current.leading); - this.dependencyTracker?.recordIncrementalData("moveText", this.dependencyTracker.getSimpleIndex("leading") ?? opIdx); - } - #getScaledPath(path, currentTransform, transform) { - const newPath = new Path2D(); - newPath.addPath(path, new DOMMatrix(transform).invertSelf().multiplySelf(currentTransform)); - return newPath; + transferMaps, + transferMapsFallback + } = this.current; + if (transferMaps === "none" && !transferMapsFallback) { + return { + img: imgData.bitmap, + canvasEntry: null + }; + } + const { + bitmap, + width, + height + } = imgData; + const tmpCanvas = this.canvasFactory.create(width, height); + const tmpCtx = tmpCanvas.context; + tmpCtx.filter = transferMaps; + tmpCtx.drawImage(bitmap, 0, 0); + tmpCtx.filter = "none"; + transferMapsFallback?.applyToCanvas(tmpCtx); + return { + img: tmpCanvas.canvas, + canvasEntry: tmpCanvas + }; } - paintChar(opIdx, character, x, y, patternFillTransform, patternStrokeTransform) { + paintInlineImageXObject(opIdx, imgData) { + if (!this.contentVisible) { + return; + } + const width = imgData.width; + const height = imgData.height; + const started = this.#beginKnockoutElement(this.current.fillAlpha); const ctx = this.ctx; - const current = this.current; - const font = current.font; - const textRenderingMode = current.textRenderingMode; - const fontSize = current.fontSize / current.fontSizeScale; - const fillStrokeMode = textRenderingMode & TextRenderingMode.FILL_STROKE_MASK; - const isAddToPathSet = !!(textRenderingMode & TextRenderingMode.ADD_TO_PATH_FLAG); - const patternFill = current.patternFill && !font.missingFile; - const patternStroke = current.patternStroke && !font.missingFile; - let path; - if ((font.disableFontFace || isAddToPathSet || patternFill || patternStroke) && !font.missingFile) { - path = font.getPathGenerator(this.commonObjs, character); + this.save(opIdx); + const { + filter + } = ctx; + if (filter !== "none" && filter !== "") { + ctx.filter = "none"; } - if (path && (font.disableFontFace || patternFill || patternStroke)) { - ctx.save(); - ctx.translate(x, y); - ctx.scale(fontSize, -fontSize); - this.dependencyTracker?.recordCharacterBBox(opIdx, ctx, font); - let currentTransform; - if (fillStrokeMode === TextRenderingMode.FILL || fillStrokeMode === TextRenderingMode.FILL_STROKE) { - if (patternFillTransform) { - currentTransform = ctx.getTransform(); - ctx.setTransform(...patternFillTransform); - const scaledPath = this.#getScaledPath(path, currentTransform, patternFillTransform); - ctx.fill(scaledPath); - } else { - ctx.fill(path); - } - } - if (fillStrokeMode === TextRenderingMode.STROKE || fillStrokeMode === TextRenderingMode.FILL_STROKE) { - if (patternStrokeTransform) { - currentTransform ||= ctx.getTransform(); - ctx.setTransform(...patternStrokeTransform); - const { - a, - b, - c, - d - } = currentTransform; - const invPatternTransform = Util.inverseTransform(patternStrokeTransform); - const transf = Util.transform([a, b, c, d, 0, 0], invPatternTransform); - Util.singularValueDecompose2dScale(transf, XY); - ctx.lineWidth *= Math.max(XY[0], XY[1]) / fontSize; - ctx.stroke(this.#getScaledPath(path, currentTransform, patternStrokeTransform)); - } else { - ctx.lineWidth /= fontSize; - ctx.stroke(path); - } - } - ctx.restore(); + ctx.scale(1 / width, -1 / height); + let imgToPaint; + let inlineImgCanvas = null; + if (imgData.bitmap) { + const result = this.applyTransferMapsToBitmap(imgData); + imgToPaint = result.img; + inlineImgCanvas = result.canvasEntry; } else { - if (fillStrokeMode === TextRenderingMode.FILL || fillStrokeMode === TextRenderingMode.FILL_STROKE) { - ctx.fillText(character, x, y); - this.dependencyTracker?.recordCharacterBBox(opIdx, ctx, font, fontSize, x, y, () => ctx.measureText(character)); - } - if (fillStrokeMode === TextRenderingMode.STROKE || fillStrokeMode === TextRenderingMode.FILL_STROKE) { - if (this.dependencyTracker) { - this.dependencyTracker?.recordCharacterBBox(opIdx, ctx, font, fontSize, x, y, () => ctx.measureText(character)).recordDependencies(opIdx, Dependencies.stroke); - } - ctx.strokeText(character, x, y); - } - } - if (isAddToPathSet) { - const paths = this.pendingTextPaths ||= []; - paths.push({ - transform: getCurrentTransform(ctx), - x, - y, - fontSize, - path - }); - this.dependencyTracker?.recordCharacterBBox(opIdx, ctx, font, fontSize, x, y); - } - } - get isFontSubpixelAAEnabled() { - const tmpCanvas = this.canvasFactory.create(10, 10); - const ctx = tmpCanvas.context; - ctx.scale(1.5, 1); - ctx.fillText("I", 0, 10); - const data = ctx.getImageData(0, 0, 10, 10).data; - this.canvasFactory.destroy(tmpCanvas); - let enabled = false; - for (let i = 3; i < data.length; i += 4) { - if (data[i] > 0 && data[i] < 255) { - enabled = true; - break; - } + const tmpCanvas = this.canvasFactory.create(width, height); + putBinaryImageData(tmpCanvas.context, imgData); + imgToPaint = this.applyTransferMapsToCanvas(tmpCanvas.context); + inlineImgCanvas = tmpCanvas; } - return util_shadow(this, "isFontSubpixelAAEnabled", enabled); - } - showText(opIdx, glyphs) { + const scaled = this._scaleImage(imgToPaint, getCurrentTransformInverse(ctx)); + ctx.imageSmoothingEnabled = getImageSmoothingEnabled(getCurrentTransform(ctx), imgData.interpolate, this.pixelRatio); if (this.dependencyTracker) { - this.dependencyTracker.recordDependencies(opIdx, Dependencies.showText).resetBBox(opIdx); - if (this.current.textRenderingMode & TextRenderingMode.ADD_TO_PATH_FLAG) { - this.dependencyTracker.recordFutureForcedDependency("textClip", opIdx).inheritPendingDependenciesAsFutureForcedDependencies(); - } + this.dependencyTracker.resetBBox(opIdx).recordBBox(opIdx, ctx, 0, width, -height, 0).recordDependencies(opIdx, Dependencies.imageXObject).recordOperation(opIdx); + this.imagesTracker?.record(ctx, width, height, this.dependencyTracker.clipBox); } - const current = this.current; - const font = current.font; - if (font.isType3Font) { - const started = this.#beginKnockoutElement(current.fillAlpha); - this.showType3Text(opIdx, glyphs); - this.dependencyTracker?.recordShowTextOperation(opIdx); - this.#endKnockoutElement(started); - return; + drawImageAtIntegerCoords(ctx, scaled.img, 0, 0, scaled.paintWidth, scaled.paintHeight, 0, -height, width, height); + if (scaled.tmpCanvas) { + this.canvasFactory.destroy(scaled.tmpCanvas); } - const fontSize = current.fontSize; - if (fontSize === 0) { - this.dependencyTracker?.recordOperation(opIdx); + if (inlineImgCanvas) { + this.canvasFactory.destroy(inlineImgCanvas); + } + this.compose(); + this.restore(opIdx); + this.#endKnockoutElement(started); + } + paintInlineImageXObjectGroup(opIdx, imgData, map) { + if (!this.contentVisible) { return; } - const started = this.#beginKnockoutElement(current.fillAlpha); + const started = this.#beginKnockoutElement(this.current.fillAlpha); const ctx = this.ctx; - const fontSizeScale = current.fontSizeScale; - const charSpacing = current.charSpacing; - const wordSpacing = current.wordSpacing; - const fontDirection = current.fontDirection; - const textHScale = current.textHScale * fontDirection; - const glyphsLength = glyphs.length; - const vertical = font.vertical; - const spacingDir = vertical ? 1 : -1; - const widthAdvanceScale = fontSize * current.fontMatrix[0]; - const simpleFillText = current.textRenderingMode === TextRenderingMode.FILL && !font.disableFontFace && !current.patternFill; - ctx.save(); - if (current.textMatrix) { - ctx.transform(...current.textMatrix); - } - ctx.translate(current.x, current.y + current.textRise); - if (fontDirection > 0) { - ctx.scale(textHScale, -1); - } else { - ctx.scale(textHScale, 1); - } - let patternFillTransform, patternStrokeTransform; - const fillStrokeMode = current.textRenderingMode & TextRenderingMode.FILL_STROKE_MASK; - const needsFill = fillStrokeMode === TextRenderingMode.FILL || fillStrokeMode === TextRenderingMode.FILL_STROKE; - const needsStroke = fillStrokeMode === TextRenderingMode.STROKE || fillStrokeMode === TextRenderingMode.FILL_STROKE; - let lineWidth = current.lineWidth; - const scale = current.textMatrixScale; - if (scale === 0 || lineWidth === 0) { - if (needsStroke) { - lineWidth = this.getSinglePixelWidth(); - } + let imgToPaint; + let inlineImgCanvas = null; + if (imgData.bitmap && !this.current.transferMapsFallback) { + imgToPaint = imgData.bitmap; + } else if (imgData.bitmap) { + ({ + img: imgToPaint, + canvasEntry: inlineImgCanvas + } = this.applyTransferMapsToBitmap(imgData)); } else { - lineWidth /= scale; - } - if (fontSizeScale !== 1.0) { - ctx.scale(fontSizeScale, fontSizeScale); - lineWidth /= fontSizeScale; + const w = imgData.width; + const h = imgData.height; + const tmpCanvas = this.canvasFactory.create(w, h); + putBinaryImageData(tmpCanvas.context, imgData); + imgToPaint = this.applyTransferMapsToCanvas(tmpCanvas.context); + inlineImgCanvas = tmpCanvas; } - ctx.lineWidth = lineWidth; - if (needsFill && current.patternFill) { + this.dependencyTracker?.resetBBox(opIdx); + for (const entry of map) { ctx.save(); - const pattern = current.fillColor.getPattern(ctx, this, getCurrentTransformInverse(ctx), PathType.FILL, opIdx); - patternFillTransform = getCurrentTransform(ctx); + ctx.transform(...entry.transform); + ctx.scale(1, -1); + drawImageAtIntegerCoords(ctx, imgToPaint, entry.x, entry.y, entry.w, entry.h, 0, -1, 1, 1); + this.dependencyTracker?.recordBBox(opIdx, ctx, 0, 1, -1, 0); ctx.restore(); - ctx.fillStyle = pattern; } - if (needsStroke && current.patternStroke) { - ctx.save(); - const pattern = current.strokeColor.getPattern(ctx, this, getCurrentTransformInverse(ctx), PathType.STROKE, opIdx); - patternStrokeTransform = getCurrentTransform(ctx); - ctx.restore(); - ctx.strokeStyle = pattern; + if (inlineImgCanvas) { + this.canvasFactory.destroy(inlineImgCanvas); } - if (font.isInvalidPDFjsFont) { - const chars = []; - let width = 0; - for (const glyph of glyphs) { - chars.push(glyph.unicode); - width += glyph.width; - } - const joinedChars = chars.join(""); - ctx.fillText(joinedChars, 0, 0); - if (this.dependencyTracker !== null) { - const measure = ctx.measureText(joinedChars); - this.dependencyTracker.recordBBox(opIdx, this.ctx, -measure.actualBoundingBoxLeft, measure.actualBoundingBoxRight, -measure.actualBoundingBoxAscent, measure.actualBoundingBoxDescent).recordShowTextOperation(opIdx); - } - current.x += width * widthAdvanceScale * textHScale; - ctx.restore(); - this.compose(); - this.#endKnockoutElement(started); + this.dependencyTracker?.recordOperation(opIdx); + this.compose(); + this.#endKnockoutElement(started); + } + paintSolidColorImageMask(opIdx) { + if (!this.contentVisible) { return; } - let x = 0, - i; - for (i = 0; i < glyphsLength; ++i) { - const glyph = glyphs[i]; - if (typeof glyph === "number") { - x += spacingDir * glyph * fontSize / 1000; - continue; - } - let restoreNeeded = false; - const spacing = (glyph.isSpace ? wordSpacing : 0) + charSpacing; - const character = glyph.fontChar; - const accent = glyph.accent; - let scaledX, scaledY; - let width = glyph.width; - if (vertical) { - const vmetric = glyph.vmetric; - const vx = -vmetric[1] * widthAdvanceScale; - const vy = vmetric[2] * widthAdvanceScale; - width = -vmetric[0]; - scaledX = vx / fontSizeScale; - scaledY = (x + vy) / fontSizeScale; - } else { - scaledX = x / fontSizeScale; - scaledY = 0; - } - let measure; - if (font.remeasure && width > 0) { - measure = ctx.measureText(character); - const measuredWidth = measure.width * 1000 / fontSize * fontSizeScale; - if (width < measuredWidth && this.isFontSubpixelAAEnabled) { - const characterScaleX = width / measuredWidth; - restoreNeeded = true; - ctx.save(); - ctx.scale(characterScaleX, 1); - scaledX /= characterScaleX; - } else if (width !== measuredWidth) { - scaledX += (width - measuredWidth) / 2000 * fontSize / fontSizeScale; + const started = this.#beginKnockoutElement(this.current.fillAlpha); + this.dependencyTracker?.resetBBox(opIdx).recordBBox(opIdx, this.ctx, 0, 1, 0, 1).recordDependencies(opIdx, Dependencies.fill).recordOperation(opIdx); + this.ctx.fillRect(0, 0, 1, 1); + this.compose(); + this.#endKnockoutElement(started); + } + markPoint(opIdx, tag) {} + markPointProps(opIdx, tag, properties) {} + beginMarkedContent(opIdx, tag) { + this.dependencyTracker?.beginMarkedContent(opIdx); + this.markedContentStack.push({ + visible: true + }); + } + beginMarkedContentProps(opIdx, tag, properties) { + this.dependencyTracker?.beginMarkedContent(opIdx); + if (tag === "OC") { + this.markedContentStack.push({ + visible: this.optionalContentConfig.isVisible(properties) + }); + } else { + this.markedContentStack.push({ + visible: true + }); + } + this.contentVisible = this.isContentVisible(); + } + endMarkedContent(opIdx) { + this.dependencyTracker?.endMarkedContent(opIdx); + this.markedContentStack.pop(); + this.contentVisible = this.isContentVisible(); + } + beginCompat(opIdx) {} + endCompat(opIdx) {} + consumePath(opIdx, path, clipBox) { + const isEmpty = this.current.isEmptyClip(); + if (this.pendingClip) { + this.current.updateClipFromPath(); + } + if (!this.pendingClip) { + this.compose(clipBox); + } + const ctx = this.ctx; + if (this.pendingClip) { + if (!isEmpty) { + if (this.pendingClip === EO_CLIP) { + ctx.clip(path, "evenodd"); + } else { + ctx.clip(path); } } - if (this.contentVisible && (glyph.isInFont || font.missingFile)) { - if (simpleFillText && !accent) { - ctx.fillText(character, scaledX, scaledY); - this.dependencyTracker?.recordCharacterBBox(opIdx, ctx, measure ? { - bbox: null - } : font, fontSize / fontSizeScale, scaledX, scaledY, () => measure ?? ctx.measureText(character)); - } else { - this.paintChar(opIdx, character, scaledX, scaledY, patternFillTransform, patternStrokeTransform); - if (accent) { - const scaledAccentX = scaledX + fontSize * accent.offset.x / fontSizeScale; - const scaledAccentY = scaledY - fontSize * accent.offset.y / fontSizeScale; - this.paintChar(opIdx, accent.fontChar, scaledAccentX, scaledAccentY, patternFillTransform, patternStrokeTransform); + this.pendingClip = null; + this.dependencyTracker?.bboxToClipBoxDropOperation(opIdx).recordFutureForcedDependency("clipPath", opIdx); + } else { + this.dependencyTracker?.recordOperation(opIdx); + } + this.current.startNewPathAndClipBox(this.current.clipBox); + } + getSinglePixelWidth() { + const m = getCurrentTransform(this.ctx); + if (m[1] === 0 && m[2] === 0) { + return 1 / Math.min(Math.abs(m[0]), Math.abs(m[3])); + } + const absDet = Math.abs(m[0] * m[3] - m[2] * m[1]); + const normX = Math.hypot(m[0], m[2]); + const normY = Math.hypot(m[1], m[3]); + return Math.max(normX, normY) / absDet; + } + getScaleForStroking() { + if (this._cachedScaleForStroking[0] === -1) { + const { + lineWidth + } = this.current; + const { + a, + b, + c, + d + } = this.ctx.getTransform(); + let scaleX, scaleY; + if (b === 0 && c === 0) { + const normX = Math.abs(a); + const normY = Math.abs(d); + if (normX === normY) { + if (lineWidth === 0) { + scaleX = scaleY = 1 / normX; + } else { + const scaledLineWidth = normX * lineWidth; + scaleX = scaleY = scaledLineWidth < 1 ? 1 / scaledLineWidth : 1; } + } else if (lineWidth === 0) { + scaleX = 1 / normX; + scaleY = 1 / normY; + } else { + const scaledXLineWidth = normX * lineWidth; + const scaledYLineWidth = normY * lineWidth; + scaleX = scaledXLineWidth < 1 ? 1 / scaledXLineWidth : 1; + scaleY = scaledYLineWidth < 1 ? 1 / scaledYLineWidth : 1; + } + } else { + const absDet = Math.abs(a * d - b * c); + const normX = Math.hypot(a, b); + const normY = Math.hypot(c, d); + if (lineWidth === 0) { + scaleX = normY / absDet; + scaleY = normX / absDet; + } else { + const baseArea = lineWidth * absDet; + scaleX = normY > baseArea ? normY / baseArea : 1; + scaleY = normX > baseArea ? normX / baseArea : 1; } } - const charWidth = vertical ? width * widthAdvanceScale - spacing * fontDirection : width * widthAdvanceScale + spacing * fontDirection; - x += charWidth; - if (restoreNeeded) { - ctx.restore(); - } - } - if (vertical) { - current.y -= x; - } else { - current.x += x * textHScale; + this._cachedScaleForStroking[0] = scaleX; + this._cachedScaleForStroking[1] = scaleY; } - ctx.restore(); - this.compose(); - this.dependencyTracker?.recordShowTextOperation(opIdx); - this.#endKnockoutElement(started); + return this._cachedScaleForStroking; } - showType3Text(opIdx, glyphs) { - const ctx = this.ctx; - const current = this.current; - const font = current.font; - const fontSize = current.fontSize; - const fontDirection = current.fontDirection; - const spacingDir = font.vertical ? 1 : -1; - const charSpacing = current.charSpacing; - const wordSpacing = current.wordSpacing; - const textHScale = current.textHScale * fontDirection; - const fontMatrix = current.fontMatrix || FONT_IDENTITY_MATRIX; - const glyphsLength = glyphs.length; - const isTextInvisible = current.textRenderingMode === TextRenderingMode.INVISIBLE; - let i, glyph, width, spacingLength; - if (isTextInvisible || fontSize === 0) { + rescaleAndStroke(path, saveRestore) { + const { + ctx, + current: { + lineWidth + } + } = this; + const [scaleX, scaleY] = this.getScaleForStroking(); + if (scaleX === scaleY) { + ctx.lineWidth = (lineWidth || 1) * scaleX; + ctx.stroke(path); return; } - this._cachedScaleForStroking[0] = -1; - ctx.save(); - if (current.textMatrix) { - ctx.transform(...current.textMatrix); + const SCALE_MATRIX = CanvasGraphics.#SCALE_MATRIX ??= new DOMMatrix(); + const dashes = ctx.getLineDash(); + if (saveRestore) { + ctx.save(); } - ctx.translate(current.x, current.y + current.textRise); - ctx.scale(textHScale, fontDirection); - const dependencyTracker = this.dependencyTracker; - this.dependencyTracker = dependencyTracker ? new CanvasNestedDependencyTracker(dependencyTracker, opIdx) : null; - for (i = 0; i < glyphsLength; ++i) { - glyph = glyphs[i]; - if (typeof glyph === "number") { - spacingLength = spacingDir * glyph * fontSize / 1000; - this.ctx.translate(spacingLength, 0); - current.x += spacingLength * textHScale; - continue; - } - const spacing = (glyph.isSpace ? wordSpacing : 0) + charSpacing; - const operatorList = font.charProcOperatorList.get(glyph.operatorListId); - if (!operatorList) { - warn(`Type3 character "${glyph.operatorListId}" is not available.`); - } else if (this.contentVisible) { - this.save(); - if (operatorList.fnArray[0] === OPS.setCharWidth) { - current.fillAlpha = current.strokeAlpha = 1; - ctx.globalAlpha = 1; - } - ctx.scale(fontSize, fontSize); - ctx.transform(...fontMatrix); - this.executeOperatorList(operatorList); - this.restore(); - } - const p = [glyph.width, 0]; - Util.applyTransform(p, fontMatrix); - width = p[0] * fontSize + spacing; - ctx.translate(width, 0); - current.x += width * textHScale; + ctx.scale(scaleX, scaleY); + SCALE_MATRIX.a = 1 / scaleX; + SCALE_MATRIX.d = 1 / scaleY; + const newPath = new Path2D(); + newPath.addPath(path, SCALE_MATRIX); + if (dashes.length > 0) { + const scale = Math.max(scaleX, scaleY); + ctx.setLineDash(dashes.map(x => x / scale)); + ctx.lineDashOffset /= scale; } - ctx.restore(); - if (dependencyTracker) { - this.dependencyTracker = dependencyTracker; + ctx.lineWidth = lineWidth || 1; + ctx.stroke(newPath); + if (saveRestore) { + ctx.restore(); } } - setCharWidth(opIdx, xWidth, yWidth) {} - setCharWidthAndBounds(opIdx, xWidth, yWidth, llx, lly, urx, ury) { - const clip = new Path2D(); - clip.rect(llx, lly, urx - llx, ury - lly); - this.ctx.clip(clip); - this.dependencyTracker?.recordBBox(opIdx, this.ctx, llx, urx, lly, ury).recordClipBox(opIdx, this.ctx, llx, urx, lly, ury); - this.endPath(opIdx); - } - getColorN_Pattern(opIdx, IR) { - let pattern; - if (IR[0] === "TilingPattern") { - const baseTransform = this.baseTransform || getCurrentTransform(this.ctx); - const canvasGraphicsFactory = { - createCanvasGraphics: (ctx, renderingOpIdx) => new CanvasGraphics(ctx, this.commonObjs, this.objs, this.canvasFactory, this.filterFactory, { - optionalContentConfig: this.optionalContentConfig, - markedContentStack: this.markedContentStack - }, undefined, undefined, this.dependencyTracker ? new CanvasNestedDependencyTracker(this.dependencyTracker, renderingOpIdx, true) : null) - }; - pattern = new TilingPattern(IR, this.ctx, canvasGraphicsFactory, baseTransform); - } else { - pattern = this._getPattern(opIdx, IR[1], IR[2]); + isContentVisible() { + for (let i = this.markedContentStack.length - 1; i >= 0; i--) { + if (!this.markedContentStack[i].visible) { + return false; + } } - return pattern; - } - setStrokeColorN(opIdx, ...args) { - this.dependencyTracker?.recordSimpleData("strokeColor", opIdx); - this.current.strokeColor = this.getColorN_Pattern(opIdx, args); - this.current.patternStroke = true; - } - setFillColorN(opIdx, ...args) { - this.dependencyTracker?.recordSimpleData("fillColor", opIdx); - const pattern = this.current.fillColor = this.getColorN_Pattern(opIdx, args); - this.current.patternFill = true; - this.current.tilingPatternDims = pattern instanceof TilingPattern ? [0, 0, 0, 0] : null; + return true; } - #transferColor(color) { - return this.current.transferMapsFallback?.applyToColor(color) ?? color; +} +for (const op in OPS) { + if (CanvasGraphics.prototype[op] !== undefined) { + CanvasGraphics.prototype[OPS[op]] = CanvasGraphics.prototype[op]; } - setStrokeRGBColor(opIdx, color) { - this.dependencyTracker?.recordSimpleData("strokeColor", opIdx); - this.current.strokeColor = color; - this.ctx.strokeStyle = this.#transferColor(color); - this.current.patternStroke = false; +} + +;// ./src/display/dom_canvas_factory.js + +class DOMCanvasFactory extends BaseCanvasFactory { + constructor({ + ownerDocument = globalThis.document, + enableHWA = false + }) { + super({ + enableHWA + }); + this._document = ownerDocument; } - setStrokeTransparent(opIdx) { - this.dependencyTracker?.recordSimpleData("strokeColor", opIdx); - this.ctx.strokeStyle = this.current.strokeColor = "transparent"; - this.current.patternStroke = false; + _createCanvas(width, height) { + const canvas = this._document.createElement("canvas"); + canvas.width = width; + canvas.height = height; + return canvas; } - setFillRGBColor(opIdx, color) { - this.dependencyTracker?.recordSimpleData("fillColor", opIdx); - this.current.fillColor = color; - this.ctx.fillStyle = this.#transferColor(color); - this.current.patternFill = false; - this.current.tilingPatternDims = null; +} + +;// ./src/display/dom_filter_factory.js + + + + + + + + +class DOMFilterFactory extends BaseFilterFactory { + #baseUrl; + #_cache; + #_defs; + #docId; + #document; + #_hcmCache; + #id = 0; + constructor({ + docId, + ownerDocument = globalThis.document + }) { + super(); + this.#docId = docId; + this.#document = ownerDocument; } - setFillTransparent(opIdx) { - this.dependencyTracker?.recordSimpleData("fillColor", opIdx); - this.ctx.fillStyle = this.current.fillColor = "transparent"; - this.current.patternFill = false; - this.current.tilingPatternDims = null; + get #cache() { + return this.#_cache ||= new Map(); } - _getPattern(opIdx, objId, matrix = null) { - const pattern = this.cachedPatterns.getOrInsertComputed(objId, () => getShadingPattern(this.getObject(opIdx, objId))); - if (matrix) { - pattern.matrix = matrix; - } - return pattern; + get #hcmCache() { + return this.#_hcmCache ||= new Map(); } - shadingFill(opIdx, objId) { - if (!this.contentVisible) { - return; - } - const started = this.#beginKnockoutElement(this.current.fillAlpha); - const ctx = this.ctx; - this.save(opIdx); - const pattern = this._getPattern(opIdx, objId); - ctx.fillStyle = pattern.getPattern(ctx, this, getCurrentTransformInverse(ctx), PathType.SHADING, opIdx); - const inv = getCurrentTransformInverse(ctx); - if (inv) { + get #defs() { + if (!this.#_defs) { + const div = this.#document.createElement("div"); const { - width, - height - } = ctx.canvas; - const minMax = F32_BBOX_INIT.slice(); - Util.axialAlignedBoundingBox([0, 0, width, height], inv, minMax); - const [x0, y0, x1, y1] = minMax; - this.ctx.fillRect(x0, y0, x1 - x0, y1 - y0); - } else { - this.ctx.fillRect(-1e10, -1e10, 2e10, 2e10); + style + } = div; + style.colorScheme = "only light"; + style.visibility = "hidden"; + style.contain = "strict"; + style.width = style.height = 0; + style.position = "absolute"; + style.top = style.left = 0; + style.zIndex = -1; + const svg = this.#document.createElementNS(SVG_NS, "svg"); + svg.setAttribute("width", 0); + svg.setAttribute("height", 0); + this.#_defs = this.#document.createElementNS(SVG_NS, "defs"); + div.append(svg); + svg.append(this.#_defs); + this.#document.body.append(div); } - this.dependencyTracker?.resetBBox(opIdx).recordFullPageBBox(opIdx).recordDependencies(opIdx, Dependencies.transform).recordDependencies(opIdx, Dependencies.fill).recordOperation(opIdx); - this.compose(this.current.getClippedPathBoundingBox()); - this.restore(opIdx); - this.#endKnockoutElement(started); + return this.#_defs; } - beginInlineImage() { - unreachable("Should not call beginInlineImage"); + #createTables(maps) { + const toTable = map => map && Array.from(map, v => v / 255).join(","); + if (maps.length === 1) { + const table = toTable(maps[0]); + return [table, table, table]; + } + const [mapR, mapG, mapB] = maps; + return [toTable(mapR), toTable(mapG), toTable(mapB)]; } - beginImageData() { - unreachable("Should not call beginImageData"); + #createUrl(id) { + if (this.#baseUrl === undefined) { + this.#baseUrl = ""; + const url = this.#document.URL; + if (url !== this.#document.baseURI) { + if (isDataScheme(url)) { + warn('#createUrl: ignore "data:"-URL for performance reasons.'); + } else { + this.#baseUrl = updateUrlHash(url, ""); + } + } + } + return `url(${this.#baseUrl}#${id})`; } - paintFormXObjectBegin(opIdx, matrix, bbox) { - if (!this.contentVisible) { - return; + addFilter(maps) { + if (!maps) { + return "none"; } - this.save(opIdx); - this.baseTransformStack.push(this.baseTransform); - if (matrix) { - this.transform(opIdx, ...matrix); + let value = this.#cache.get(maps); + if (value) { + return value; } - this.baseTransform = getCurrentTransform(this.ctx); - if (bbox) { - Util.axialAlignedBoundingBox(bbox, this.baseTransform, this.current.minMax); - const [x0, y0, x1, y1] = bbox; - const clip = new Path2D(); - clip.rect(x0, y0, x1 - x0, y1 - y0); - this.ctx.clip(clip); - this.dependencyTracker?.recordClipBox(opIdx, this.ctx, x0, x1, y0, y1); - this.endPath(opIdx); + const [tableR, tableG, tableB] = this.#createTables(maps); + const key = maps.length === 1 ? tableR : `${tableR}${tableG}${tableB}`; + value = this.#cache.get(key); + if (value) { + this.#cache.set(maps, value); + return value; } + const id = `g_${this.#docId}_transfer_map_${this.#id++}`; + const url = this.#createUrl(id); + this.#cache.set(maps, url); + this.#cache.set(key, url); + const filter = this.#createFilter(id); + this.#addTransferMapConversion(tableR, tableG, tableB, filter); + return url; } - paintFormXObjectEnd(opIdx) { - if (!this.contentVisible) { - return; + addHCMFilter(fgColor, bgColor) { + const key = `${fgColor}-${bgColor}`; + const filterName = "base"; + let info = this.#hcmCache.get(filterName); + if (info?.key === key) { + return info.url; } - this.restore(opIdx); - this.baseTransform = this.baseTransformStack.pop(); - } - beginGroup(opIdx, group) { - if (!this.contentVisible) { - return; + if (info) { + info.filter?.remove(); + info.key = key; + info.url = "none"; + info.filter = null; + } else { + info = { + key, + url: "none", + filter: null + }; + this.#hcmCache.set(filterName, info); } - this.save(opIdx); - const { - inSMaskMode - } = this; - if (inSMaskMode) { - this.endSMaskMode(); - this.current.activeSMask = null; + if (!fgColor || !bgColor) { + return info.url; } - const currentCtx = this.ctx; - if ((!group.needsIsolation || !group.isolated && !group.hasSoftMask) && !group.knockout && !group.isGray && this.#knockoutGroupLevel === 0 && currentCtx.globalAlpha === 1 && currentCtx.globalCompositeOperation === "source-over" && !inSMaskMode) { - if (group.bbox) { - let clip = new Path2D(); - const [x0, y0, x1, y1] = group.bbox; - clip.rect(x0, y0, x1 - x0, y1 - y0); - if (group.matrix) { - const path = new Path2D(); - path.addPath(clip, new DOMMatrix(group.matrix)); - clip = path; - } - currentCtx.clip(clip); - } - this.groupStack.push(null); - this.#groupStackMeta.push(null); - this.groupLevel++; - return; + const fgRGB = this.#getRGB(fgColor); + fgColor = Util.makeHexColor(...fgRGB); + const bgRGB = this.#getRGB(bgColor); + bgColor = Util.makeHexColor(...bgRGB); + this.#resetDefsColor(); + if (fgColor === "#000000" && bgColor === "#ffffff" || fgColor === bgColor) { + return info.url; } - if (!group.isolated && !group.knockout && this.#knockoutGroupLevel === 0) { - info("TODO: Fully support non-isolated non-knockout groups."); + const map = Array.from({ + length: 256 + }, (_, i) => computeLuminance(i / 255)); + const table = map.join(","); + const id = `g_${this.#docId}_hcm_filter`; + const filter = info.filter = this.#createFilter(id); + this.#addTransferMapConversion(table, table, table, filter); + this.#addGrayConversion(filter); + const getSteps = (c, n) => { + const start = fgRGB[c] / 255; + const end = bgRGB[c] / 255; + const arr = new Array(n + 1); + for (let i = 0; i <= n; i++) { + arr[i] = start + i / n * (end - start); + } + return arr.join(","); + }; + this.#addTransferMapConversion(getSteps(0, 5), getSteps(1, 5), getSteps(2, 5), filter); + info.url = this.#createUrl(id); + return info.url; + } + addSelectionHCMFilter(fgColor, bgColor) { + return this.addHighlightHCMFilter("selection", fgColor, bgColor, "HighlightText", "Highlight"); + } + addSelectionFilter() { + return this.addHighlightHCMFilter("selection_default", "black", "white", "HighlightText", "Highlight"); + } + createSelectionStyle(pageColors = null) { + const filter = pageColors ? this.addSelectionHCMFilter(pageColors.foreground, pageColors.background) : this.addSelectionFilter(); + if (filter === "none" || !FeatureTest.platform.isFirefox) { + return null; } - const currentTransform = getCurrentTransform(currentCtx); - if (group.matrix) { - currentCtx.transform(...group.matrix); + return { + "backdrop-filter": filter, + "background-color": "transparent" + }; + } + addAlphaFilter(map) { + let value = this.#cache.get(map); + if (value) { + return value; } - const canvasBounds = [0, 0, currentCtx.canvas.width, currentCtx.canvas.height]; - let bounds; - if (group.bbox) { - bounds = F32_BBOX_INIT.slice(); - Util.axialAlignedBoundingBox(group.bbox, getCurrentTransform(currentCtx), bounds); - bounds = Util.intersect(bounds, canvasBounds) || [0, 0, 0, 0]; - } else { - bounds = canvasBounds; + const [tableA] = this.#createTables([map]); + const key = `alpha_${tableA}`; + value = this.#cache.get(key); + if (value) { + this.#cache.set(map, value); + return value; } - const offsetX = Math.floor(bounds[0]); - const offsetY = Math.floor(bounds[1]); - const drawnWidth = Math.max(Math.ceil(bounds[2]) - offsetX, 1); - const drawnHeight = Math.max(Math.ceil(bounds[3]) - offsetY, 1); - this.current.startNewPathAndClipBox([0, 0, drawnWidth, drawnHeight]); - const scratchCanvas = this.canvasFactory.create(drawnWidth, drawnHeight); - if (group.smask) { - this.smaskGroupCanvases.push(scratchCanvas); + const id = `g_${this.#docId}_alpha_map_${this.#id++}`; + const url = this.#createUrl(id); + this.#cache.set(map, url); + this.#cache.set(key, url); + const filter = this.#createFilter(id); + this.#addTransferMapAlphaConversion(tableA, filter); + return url; + } + addLuminosityFilter(map) { + let value = this.#cache.get(map || "luminosity"); + if (value) { + return value; } - const groupCtx = scratchCanvas.context; - const backdropCtx = group.knockout && !group.isolated ? currentCtx : null; - const hasInnerBackdrop = !group.isolated && !group.knockout && !group.smask && group.needsIsolation && this.#knockoutGroupLevel > 0; - const knockoutMaskEntry = group.knockout ? this.canvasFactory.create(drawnWidth, drawnHeight) : null; - const savedKnockoutLevel = this.#knockoutGroupLevel; - if (group.knockout) { - this.#knockoutGroupLevel++; + let tableA, key; + if (map) { + [tableA] = this.#createTables([map]); + key = `luminosity_${tableA}`; } else { - this.#knockoutGroupLevel = 0; - } - groupCtx.translate(-offsetX, -offsetY); - groupCtx.transform(...currentTransform); - const needsBackdropCopy = !group.isolated && !group.smask && group.needsIsolation; - const replaceBackdrop = needsBackdropCopy && !inSMaskMode && savedKnockoutLevel === 0 && !group.knockout && !group.isGray && group.hasSoftMask && currentCtx.globalAlpha === 1 && currentCtx.globalCompositeOperation === "source-over" && this.current.transferMaps === "none" && !this.current.transferMapsFallback; - if (needsBackdropCopy && (inSMaskMode || replaceBackdrop)) { - groupCtx.save(); - groupCtx.setTransform(1, 0, 0, 1, 0, 0); - groupCtx.drawImage(currentCtx.canvas, -offsetX, -offsetY); - groupCtx.restore(); + key = "luminosity"; } - if (group.bbox) { - let clip = new Path2D(); - const [x0, y0, x1, y1] = group.bbox; - clip.rect(x0, y0, x1 - x0, y1 - y0); - if (group.matrix) { - const path = new Path2D(); - path.addPath(clip, new DOMMatrix(group.matrix)); - clip = path; - } - groupCtx.clip(clip); + value = this.#cache.get(key); + if (value) { + this.#cache.set(map, value); + return value; } - if (group.smask) { - this.smaskStack.push({ - canvas: scratchCanvas.canvas, - context: groupCtx, - offsetX, - offsetY, - subtype: group.smask.subtype, - backdrop: group.smask.backdrop, - transferMap: group.smask.transferMap || null - }); + const id = `g_${this.#docId}_luminosity_map_${this.#id++}`; + const url = this.#createUrl(id); + this.#cache.set(map, url); + this.#cache.set(key, url); + const filter = this.#createFilter(id); + this.#addLuminosityConversion(filter); + if (map) { + this.#addTransferMapAlphaConversion(tableA, filter); } - if (!group.smask || this.dependencyTracker) { - currentCtx.setTransform(1, 0, 0, 1, 0, 0); - currentCtx.translate(offsetX, offsetY); - currentCtx.save(); + return url; + } + addKnockoutFilter(alpha = 0) { + const slope = alpha > 0 ? Math.min(1 / alpha, 1e6) : 1e6; + const key = `knockout_${slope}`; + const value = this.#cache.get(key); + if (value) { + return value; } - copyCtxState(currentCtx, groupCtx); - this.ctx = groupCtx; - this.dependencyTracker?.inheritSimpleDataAsFutureForcedDependencies(["fillAlpha", "strokeAlpha", "globalCompositeOperation"]).pushBaseTransform(currentCtx); - this.setGState(opIdx, [["BM", "source-over"], ["ca", 1], ["CA", 1], ["TR", null]]); - this.groupStack.push(currentCtx); - this.#groupStackMeta.push({ - backdropCtx, - savedKnockoutLevel, - offsetX, - offsetY, - hasInnerBackdrop, - replaceBackdrop, - knockoutMaskEntry, - knockoutTempEntry: null, - knockoutBackdropEntry: null - }); - this.groupLevel++; + const id = `g_${this.#docId}_knockout_filter_${this.#id++}`; + const url = this.#createUrl(id); + this.#cache.set(key, url); + const filter = this.#createFilter(id); + const feComponentTransfer = this.#document.createElementNS(SVG_NS, "feComponentTransfer"); + filter.append(feComponentTransfer); + const feFuncA = this.#document.createElementNS(SVG_NS, "feFuncA"); + feFuncA.setAttribute("type", "linear"); + feFuncA.setAttribute("slope", `${slope}`); + feFuncA.setAttribute("intercept", "0"); + feComponentTransfer.append(feFuncA); + return url; } - endGroup(opIdx, group) { - if (!this.contentVisible) { - return; + addHighlightHCMFilter(filterName, fgColor, bgColor, newFgColor, newBgColor) { + const key = `${fgColor}-${bgColor}-${newFgColor}-${newBgColor}`; + let info = this.#hcmCache.get(filterName); + if (info?.key === key) { + return info.url; } - this.groupLevel--; - const groupCtx = this.ctx; - const ctx = this.groupStack.pop(); - const groupMeta = this.#groupStackMeta.pop(); - if (groupMeta) { - this.#knockoutGroupLevel = groupMeta.savedKnockoutLevel; + if (info) { + info.filter?.remove(); + info.key = key; + info.url = "none"; + info.filter = null; + } else { + info = { + key, + url: "none", + filter: null + }; + this.#hcmCache.set(filterName, info); } - if (ctx === null) { - this.restore(opIdx); - return; + if (!fgColor || !bgColor) { + return info.url; } - if (group.isGray) { - this.#convertGroupToGray(groupCtx); + const [fgRGB, bgRGB] = [fgColor, bgColor].map(this.#getRGB.bind(this)); + let fgGray = Math.round(0.2126 * fgRGB[0] + 0.7152 * fgRGB[1] + 0.0722 * fgRGB[2]); + let bgGray = Math.round(0.2126 * bgRGB[0] + 0.7152 * bgRGB[1] + 0.0722 * bgRGB[2]); + let [newFgRGB, newBgRGB] = [newFgColor, newBgColor].map(this.#getOpaqueTextColor.bind(this)); + if (bgGray < fgGray) { + [fgGray, bgGray, newFgRGB, newBgRGB] = [bgGray, fgGray, newBgRGB, newFgRGB]; } - this.ctx = ctx; - this.ctx.imageSmoothingEnabled = false; - this.dependencyTracker?.popBaseTransform(); - if (group.smask) { - this.tempSMask = this.smaskStack.pop(); - this.restore(opIdx); - if (this.dependencyTracker) { - this.ctx.restore(); - if (this.inSMaskMode) { - this.ctx.setTransform(this.suspendedCtx.getTransform()); + this.#resetDefsColor(); + const getSteps = (fg, bg, n) => { + const arr = new Array(256); + const step = (bgGray - fgGray) / n; + const newStart = fg / 255; + const newStep = (bg - fg) / (255 * n); + let prev = 0; + for (let i = 0; i <= n; i++) { + const k = Math.round(fgGray + i * step); + const value = newStart + i * newStep; + for (let j = prev; j <= k; j++) { + arr[j] = value; } + prev = k + 1; } - this.#destroyKnockoutPools(groupMeta); - } else { - this.ctx.restore(); - const currentMtx = getCurrentTransform(this.ctx); - this.restore(opIdx); - this.current.transferMapsFallback?.applyToCanvas(groupCtx); - this.ctx.save(); - this.ctx.setTransform(...currentMtx); - const dirtyBox = F32_BBOX_INIT.slice(); - Util.axialAlignedBoundingBox([0, 0, groupCtx.canvas.width, groupCtx.canvas.height], currentMtx, dirtyBox); - const parentGroupMeta = this.#groupStackMeta.at(-1); - if (this.#knockoutGroupLevel > 0) { - if (groupMeta.hasInnerBackdrop) { - const { - width, - height - } = groupCtx.canvas; - const colorEntry = this.canvasFactory.create(width, height); - const colorCtx = colorEntry.context; - colorCtx.drawImage(ctx.canvas, groupMeta.offsetX, groupMeta.offsetY, width, height, 0, 0, width, height); - colorCtx.globalCompositeOperation = "source-over"; - colorCtx.drawImage(groupCtx.canvas, 0, 0); - const shapeMaskEntry = this.#createKnockoutMaskCanvas(groupCtx.canvas); - colorCtx.globalCompositeOperation = "destination-in"; - colorCtx.drawImage(shapeMaskEntry.canvas, 0, 0); - const sourceCompositeOperation = this.ctx.globalCompositeOperation; - const sourceAlpha = this.ctx.globalAlpha; - const sourceFilter = this.ctx.filter; - this.ctx.save(); - this.ctx.setTransform(...currentMtx); - this.ctx.globalAlpha = 1; - if (FeatureTest.isCanvasFilterSupported) { - this.ctx.filter = "none"; - } - this.ctx.globalCompositeOperation = "destination-out"; - this.ctx.drawImage(shapeMaskEntry.canvas, 0, 0); - this.ctx.globalCompositeOperation = sourceCompositeOperation; - this.ctx.globalAlpha = sourceAlpha; - if (FeatureTest.isCanvasFilterSupported) { - this.ctx.filter = sourceFilter ?? "none"; - } - this.ctx.drawImage(colorEntry.canvas, 0, 0); - this.ctx.restore(); - this.canvasFactory.destroy(shapeMaskEntry); - this.canvasFactory.destroy(colorEntry); - } else { - const backdropCtx = parentGroupMeta?.backdropCtx ?? null; - this.#compositeKnockoutSurface(this.ctx, groupCtx.canvas, { - backdropCanvas: backdropCtx?.canvas ?? null, - destTransform: currentMtx, - backdropOffset: backdropCtx ? [parentGroupMeta.offsetX + groupMeta.offsetX, parentGroupMeta.offsetY + groupMeta.offsetY] : [0, 0], - sourceAlpha: this.ctx.globalAlpha, - sourceFilter: this.ctx.filter - }); - } - } else { - if (groupMeta.replaceBackdrop) { - const clip = new Path2D(); - clip.rect(0, 0, groupCtx.canvas.width, groupCtx.canvas.height); - this.ctx.clip(clip); - this.ctx.globalCompositeOperation = "copy"; - } - this.ctx.drawImage(groupCtx.canvas, 0, 0); + for (let i = prev; i < 256; i++) { + arr[i] = arr[prev - 1]; } - this.ctx.restore(); - this.canvasFactory.destroy({ - canvas: groupCtx.canvas, - context: groupCtx - }); - this.#destroyKnockoutPools(groupMeta); - this.compose(dirtyBox); - } + return arr.join(","); + }; + const id = `g_${this.#docId}_hcm_${filterName}_filter`; + const filter = info.filter = this.#createFilter(id); + this.#addGrayConversion(filter); + this.#addTransferMapConversion(getSteps(newFgRGB[0], newBgRGB[0], 5), getSteps(newFgRGB[1], newBgRGB[1], 5), getSteps(newFgRGB[2], newBgRGB[2], 5), filter); + info.url = this.#createUrl(id); + return info.url; } - #convertGroupToGray(groupCtx) { - const { - canvas - } = groupCtx; - const { - width, - height - } = canvas; - if (FeatureTest.isCanvasFilterSupported) { - groupCtx.save(); - groupCtx.setTransform(1, 0, 0, 1, 0, 0); - groupCtx.filter = "grayscale(1)"; - groupCtx.globalAlpha = 1; - groupCtx.globalCompositeOperation = "copy"; - groupCtx.drawImage(canvas, 0, 0); - groupCtx.restore(); + destroy(keepHCM = false) { + if (keepHCM && this.#_hcmCache?.size) { return; } - const imageData = groupCtx.getImageData(0, 0, width, height); - const { - data - } = imageData; - for (let i = 0, ii = data.length; i < ii; i += 4) { - const gray = data[i] * 0.2126 + data[i + 1] * 0.7152 + data[i + 2] * 0.0722 + 0.5 | 0; - data[i] = data[i + 1] = data[i + 2] = gray; - } - groupCtx.putImageData(imageData, 0, 0); + this.#_defs?.parentNode.parentNode.remove(); + this.#_defs = null; + this.#_cache?.clear(); + this.#_cache = null; + this.#_hcmCache?.clear(); + this.#_hcmCache = null; + this.#id = 0; } - #destroyKnockoutPools(groupMeta) { - if (!groupMeta) { + #addLuminosityConversion(filter) { + const feColorMatrix = this.#document.createElementNS(SVG_NS, "feColorMatrix"); + feColorMatrix.setAttribute("type", "matrix"); + feColorMatrix.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"); + filter.append(feColorMatrix); + } + #addGrayConversion(filter) { + const feColorMatrix = this.#document.createElementNS(SVG_NS, "feColorMatrix"); + feColorMatrix.setAttribute("type", "matrix"); + feColorMatrix.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"); + filter.append(feColorMatrix); + } + #createFilter(id) { + const filter = this.#document.createElementNS(SVG_NS, "filter"); + filter.setAttribute("color-interpolation-filters", "sRGB"); + filter.setAttribute("id", id); + this.#defs.append(filter); + return filter; + } + #appendFeFunc(feComponentTransfer, func, table) { + if (!table) { return; } - if (groupMeta.knockoutMaskEntry) { - this.canvasFactory.destroy(groupMeta.knockoutMaskEntry); - groupMeta.knockoutMaskEntry = null; - } - if (groupMeta.knockoutTempEntry) { - this.canvasFactory.destroy(groupMeta.knockoutTempEntry); - groupMeta.knockoutTempEntry = null; - } - if (groupMeta.knockoutBackdropEntry) { - this.canvasFactory.destroy(groupMeta.knockoutBackdropEntry); - groupMeta.knockoutBackdropEntry = null; + const feFunc = this.#document.createElementNS(SVG_NS, func); + feFunc.setAttribute("type", "discrete"); + feFunc.setAttribute("tableValues", table); + feComponentTransfer.append(feFunc); + } + #addTransferMapConversion(rTable, gTable, bTable, filter) { + const feComponentTransfer = this.#document.createElementNS(SVG_NS, "feComponentTransfer"); + filter.append(feComponentTransfer); + this.#appendFeFunc(feComponentTransfer, "feFuncR", rTable); + this.#appendFeFunc(feComponentTransfer, "feFuncG", gTable); + this.#appendFeFunc(feComponentTransfer, "feFuncB", bTable); + } + #addTransferMapAlphaConversion(aTable, filter) { + const feComponentTransfer = this.#document.createElementNS(SVG_NS, "feComponentTransfer"); + filter.append(feComponentTransfer); + this.#appendFeFunc(feComponentTransfer, "feFuncA", aTable); + } + #getRGB(color) { + this.#defs.style.color = "CanvasText"; + this.#defs.style.backgroundColor = color; + return getRGB(getComputedStyle(this.#defs).getPropertyValue("background-color")); + } + #getRGBA(color) { + this.#defs.style.color = "CanvasText"; + this.#defs.style.backgroundColor = color; + return getRGBA(getComputedStyle(this.#defs).getPropertyValue("background-color")); + } + #resetDefsColor() { + this.#defs.style.color = ""; + this.#defs.style.backgroundColor = ""; + } + #getOpaqueTextColor(color) { + const [r, g, b, alpha] = this.#getRGBA(color); + if (alpha === 1) { + return [r, g, b]; } + const [canvasR, canvasG, canvasB] = this.#getRGB("Canvas"); + return [blend(r, canvasR, alpha), blend(g, canvasG, alpha), blend(b, canvasB, alpha)]; } - beginAnnotation(opIdx, id, rect, transform, matrix, hasOwnCanvas, canvasName) { - this.#restoreInitialState(); - resetCtxToDefault(this.ctx); - this.ctx.save(); - this.save(opIdx); - if (this.baseTransform) { - this.ctx.setTransform(...this.baseTransform); +} +function blend(fg, bg, alpha) { + return Math.round(alpha * fg + (1 - alpha) * bg); +} + +;// ./src/shared/css_utils.js +const CONTROL_CHAR_REGEXP = /\p{Cc}/u; +function isCSSString(str) { + const quote = str[0]; + if (str.length < 2 || quote !== `"` && quote !== `'` || str.at(-1) !== quote) { + return false; + } + const end = str.length - 1; + for (let i = 1; i < end; i++) { + const char = str[i]; + if (char === quote || CONTROL_CHAR_REGEXP.test(char)) { + return false; } - if (rect) { - const width = rect[2] - rect[0]; - const height = rect[3] - rect[1]; - if (hasOwnCanvas && this.annotationCanvasMap) { - transform = transform.slice(); - transform[4] -= rect[0]; - transform[5] -= rect[1]; - Util.singularValueDecompose2dScale(getCurrentTransform(this.ctx), XY); - const { - viewportScale - } = this; - const canvasWidth = Math.ceil(width * this.outputScaleX * viewportScale); - const canvasHeight = Math.ceil(height * this.outputScaleY * viewportScale); - this.annotationCanvas = this.canvasFactory.create(canvasWidth, canvasHeight); - const { - canvas, - context - } = this.annotationCanvas; - if (canvasName) { - const canvases = this.annotationCanvasMap.getOrInsertComputed(id, makeArr); - canvas.setAttribute("data-canvas-name", canvasName); - const index = canvases.findIndex(c => c.getAttribute("data-canvas-name") === canvasName); - if (index === -1) { - canvases.push(canvas); - } else { - canvases[index] = canvas; - } - } else { - this.annotationCanvasMap.set(id, canvas); - } - this.annotationCanvas.savedCtx = this.ctx; - this.ctx = context; - this.ctx.save(); - this.ctx.setTransform(XY[0], 0, 0, -XY[1], 0, height * XY[1]); - resetCtxToDefault(this.ctx); - } else { - resetCtxToDefault(this.ctx); - this.endPath(opIdx); - const clip = new Path2D(); - clip.rect(rect[0], rect[1], width, height); - this.ctx.clip(clip); + if (char === "\\") { + if (++i >= end || CONTROL_CHAR_REGEXP.test(str[i])) { + return false; } } - this.current = new CanvasExtraState(this.ctx.canvas.width, this.ctx.canvas.height); - this.baseTransformStack.push(this.baseTransform); - this.transform(opIdx, ...transform); - this.transform(opIdx, ...matrix); - this.baseTransform = getCurrentTransform(this.ctx); } - endAnnotation(opIdx) { - if (this.annotationCanvas) { - this.ctx.restore(); - this.#drawFilter(); - this.ctx = this.annotationCanvas.savedCtx; - delete this.annotationCanvas.savedCtx; - delete this.annotationCanvas; - } - this.baseTransform = this.baseTransformStack.pop(); + return true; +} +function serializeFontFamily(fontFamily) { + if (isCSSString(fontFamily)) { + return fontFamily; } - paintImageMaskXObject(opIdx, img) { - if (!this.contentVisible) { - return; - } - const count = img.count; - img = this.getObject(opIdx, img.data, img); - img.count = count; - const started = this.#beginKnockoutElement(this.current.fillAlpha); - const ctx = this.ctx; - const mask = this._createMaskCanvas(opIdx, img); - const maskCanvas = mask.canvas; - ctx.save(); - ctx.setTransform(1, 0, 0, 1, 0, 0); - ctx.drawImage(maskCanvas, mask.offsetX, mask.offsetY); - this.dependencyTracker?.resetBBox(opIdx).recordBBox(opIdx, this.ctx, mask.offsetX, mask.offsetX + maskCanvas.width, mask.offsetY, mask.offsetY + maskCanvas.height).recordOperation(opIdx); - ctx.restore(); - if (mask.canvasEntry) { - this.canvasFactory.destroy(mask.canvasEntry); - } - this.compose(); - this.#endKnockoutElement(started); + const escaped = fontFamily.replaceAll(/["\\\p{Cc}]/gu, char => char === `"` || char === "\\" ? `\\${char}` : `\\${char.codePointAt(0).toString(16)} `); + return `"${escaped}"`; +} + +;// ./src/display/font_loader.js + + + + + + + + + + + + + + + + + +class FontLoader { + #nativeFontFaces = new Set(); + #systemFonts = new Set(); + #styleSheet = null; + constructor({ + ownerDocument = globalThis.document, + styleElement = null + }) { + this._document = ownerDocument; + this.styleElement = null; + this.loadingRequests = []; + this.loadTestFontId = 0; } - paintImageMaskXObjectRepeat(opIdx, img, scaleX, skewX = 0, skewY = 0, scaleY, positions) { - if (!this.contentVisible) { - return; + addNativeFontFace(nativeFontFace) { + this.#nativeFontFaces.add(nativeFontFace); + this._document.fonts.add(nativeFontFace); + } + removeNativeFontFace(nativeFontFace) { + this.#nativeFontFaces.delete(nativeFontFace); + this._document.fonts.delete(nativeFontFace); + } + insertRule(rule) { + const styleSheet = this.#getStyleSheet(); + styleSheet.insertRule(rule, styleSheet.cssRules.length); + } + #getStyleSheet() { + if (this.#styleSheet) { + return this.#styleSheet; } - img = this.getObject(opIdx, img.data, img); - const started = this.#beginKnockoutElement(this.current.fillAlpha); - const ctx = this.ctx; - ctx.save(); - const currentTransform = getCurrentTransform(ctx); - ctx.transform(scaleX, skewX, skewY, scaleY, 0, 0); - const mask = this._createMaskCanvas(opIdx, img); - ctx.setTransform(1, 0, 0, 1, mask.offsetX - currentTransform[4], mask.offsetY - currentTransform[5]); - this.dependencyTracker?.resetBBox(opIdx); - for (let i = 0, ii = positions.length; i < ii; i += 2) { - const trans = Util.transform(currentTransform, [scaleX, skewX, skewY, scaleY, positions[i], positions[i + 1]]); - ctx.drawImage(mask.canvas, trans[4], trans[5]); - this.dependencyTracker?.recordBBox(opIdx, this.ctx, trans[4], trans[4] + mask.canvas.width, trans[5], trans[5] + mask.canvas.height); + const StyleSheet = this._document.defaultView?.CSSStyleSheet || globalThis.CSSStyleSheet; + if (!this.styleElement && StyleSheet) { + const { + adoptedStyleSheets + } = this._document; + if (adoptedStyleSheets) { + const styleSheet = new StyleSheet(); + adoptedStyleSheets.push(styleSheet); + return this.#styleSheet = styleSheet; + } } - ctx.restore(); - if (mask.canvasEntry) { - this.canvasFactory.destroy(mask.canvasEntry); + if (!this.styleElement) { + this.styleElement = this._document.createElement("style"); + this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement); } - this.compose(); - this.dependencyTracker?.recordOperation(opIdx); - this.#endKnockoutElement(started); + return this.#styleSheet = this.styleElement.sheet; } - paintImageMaskXObjectGroup(opIdx, images) { - if (!this.contentVisible) { - return; + clear() { + for (const nativeFontFace of this.#nativeFontFaces) { + this._document.fonts.delete(nativeFontFace); } - const started = this.#beginKnockoutElement(this.current.fillAlpha); - const ctx = this.ctx; - const isPatternFill = this.current.patternFill; - const fillColor = isPatternFill ? this.current.fillColor : ctx.fillStyle; - this.dependencyTracker?.resetBBox(opIdx).recordDependencies(opIdx, Dependencies.transformAndFill); - for (const image of images) { + this.#nativeFontFaces.clear(); + this.#systemFonts.clear(); + if (this.#styleSheet) { const { - data, - width, - height, - transform - } = image; - const maskCanvas = this.canvasFactory.create(width, height); - const maskCtx = maskCanvas.context; - maskCtx.save(); - const img = this.getObject(opIdx, data, image); - putBinaryImageMask(maskCtx, img); - maskCtx.globalCompositeOperation = "source-in"; - maskCtx.fillStyle = isPatternFill ? fillColor.getPattern(maskCtx, this, getCurrentTransformInverse(ctx), PathType.FILL, opIdx) : fillColor; - maskCtx.fillRect(0, 0, width, height); - maskCtx.restore(); - ctx.save(); - ctx.transform(...transform); - ctx.scale(1, -1); - drawImageAtIntegerCoords(ctx, maskCanvas.canvas, 0, 0, width, height, 0, -1, 1, 1); - this.canvasFactory.destroy(maskCanvas); - this.dependencyTracker?.recordBBox(opIdx, ctx, 0, width, 0, height); - ctx.restore(); + adoptedStyleSheets + } = this._document; + if (adoptedStyleSheets?.includes(this.#styleSheet)) { + this._document.adoptedStyleSheets = adoptedStyleSheets.filter(styleSheet => styleSheet !== this.#styleSheet); + } + this.#styleSheet = null; } - this.compose(); - this.dependencyTracker?.recordOperation(opIdx); - this.#endKnockoutElement(started); + this.styleElement?.remove(); + this.styleElement = null; } - paintImageXObject(opIdx, objId) { - if (!this.contentVisible) { + async loadSystemFont({ + systemFontInfo: info, + disableFontFace, + _inspectFont + }) { + if (!info || this.#systemFonts.has(info.loadedName)) { + return; + } + util_assert(!disableFontFace, "loadSystemFont shouldn't be called when `disableFontFace` is set."); + if (this.isFontLoadingAPISupported) { + const { + loadedName, + src, + style + } = info; + const fontFace = new FontFace(loadedName, src, style); + this.addNativeFontFace(fontFace); + try { + await fontFace.load(); + this.#systemFonts.add(loadedName); + _inspectFont?.(info); + } catch { + warn(`Cannot load system font: ${info.baseFontName}, installing it could help to improve PDF rendering.`); + this.removeNativeFontFace(fontFace); + } return; } - const imgData = this.getObject(opIdx, objId); - if (!imgData) { - warn("Dependent image isn't ready yet"); + unreachable("Not implemented: loadSystemFont without the Font Loading API."); + } + async bind(font) { + if (font.attached || font.missingFile && !font.systemFontInfo) { return; } - this.paintInlineImageXObject(opIdx, imgData); - } - paintImageXObjectRepeat(opIdx, objId, scaleX, scaleY, positions) { - if (!this.contentVisible) { + font.attached = true; + if (font.systemFontInfo) { + await this.loadSystemFont(font); return; } - const imgData = this.getObject(opIdx, objId); - if (!imgData) { - warn("Dependent image isn't ready yet"); + if (this.isFontLoadingAPISupported) { + const nativeFontFace = font.createNativeFontFace(); + if (nativeFontFace) { + this.addNativeFontFace(nativeFontFace); + try { + await nativeFontFace.loaded; + } catch (ex) { + warn(`Failed to load font '${nativeFontFace.family}': '${ex}'.`); + font.disableFontFace = true; + throw ex; + } + } return; } - const width = imgData.width; - const height = imgData.height; - const map = []; - for (let i = 0, ii = positions.length; i < ii; i += 2) { - map.push({ - transform: [scaleX, 0, 0, scaleY, positions[i], positions[i + 1]], - x: 0, - y: 0, - w: width, - h: height - }); + const rule = font.createFontFaceRule(); + if (rule) { + this.insertRule(rule); + if (this.isSyncFontLoadingSupported) { + return; + } + await this.#testFontLoaded(font); } - this.paintInlineImageXObjectGroup(opIdx, imgData, map); } - applyTransferMapsToCanvas(ctx) { - if (this.current.transferMaps !== "none") { - ctx.filter = this.current.transferMaps; - ctx.drawImage(ctx.canvas, 0, 0); - ctx.filter = "none"; - } else { - this.current.transferMapsFallback?.applyToCanvas(ctx); - } - return ctx.canvas; + get isFontLoadingAPISupported() { + return util_shadow(this, "isFontLoadingAPISupported", !!this._document?.fonts); } - applyTransferMapsToBitmap(imgData) { - const { - transferMaps, - transferMapsFallback - } = this.current; - if (transferMaps === "none" && !transferMapsFallback) { - return { - img: imgData.bitmap, - canvasEntry: null - }; - } - const { - bitmap, - width, - height - } = imgData; - const tmpCanvas = this.canvasFactory.create(width, height); - const tmpCtx = tmpCanvas.context; - tmpCtx.filter = transferMaps; - tmpCtx.drawImage(bitmap, 0, 0); - tmpCtx.filter = "none"; - transferMapsFallback?.applyToCanvas(tmpCtx); - return { - img: tmpCanvas.canvas, - canvasEntry: tmpCanvas - }; + get isSyncFontLoadingSupported() { + return util_shadow(this, "isSyncFontLoadingSupported", isNodeJS || FeatureTest.platform.isFirefox); } - paintInlineImageXObject(opIdx, imgData) { - if (!this.contentVisible) { - return; + #testFontLoaded(font) { + function completeRequest() { + util_assert(!request.done, "completeRequest() cannot be called twice."); + request.done = true; + while (loadingRequests.length > 0 && loadingRequests[0].done) { + const otherRequest = loadingRequests.shift(); + setTimeout(otherRequest.resolve, 0); + } } - const width = imgData.width; - const height = imgData.height; - const started = this.#beginKnockoutElement(this.current.fillAlpha); - const ctx = this.ctx; - this.save(opIdx); const { - filter - } = ctx; - if (filter !== "none" && filter !== "") { - ctx.filter = "none"; - } - ctx.scale(1 / width, -1 / height); - let imgToPaint; - let inlineImgCanvas = null; - if (imgData.bitmap) { - const result = this.applyTransferMapsToBitmap(imgData); - imgToPaint = result.img; - inlineImgCanvas = result.canvasEntry; - } else { - const tmpCanvas = this.canvasFactory.create(width, height); - putBinaryImageData(tmpCanvas.context, imgData); - imgToPaint = this.applyTransferMapsToCanvas(tmpCanvas.context); - inlineImgCanvas = tmpCanvas; - } - const scaled = this._scaleImage(imgToPaint, getCurrentTransformInverse(ctx)); - ctx.imageSmoothingEnabled = getImageSmoothingEnabled(getCurrentTransform(ctx), imgData.interpolate); - if (this.dependencyTracker) { - this.dependencyTracker.resetBBox(opIdx).recordBBox(opIdx, ctx, 0, width, -height, 0).recordDependencies(opIdx, Dependencies.imageXObject).recordOperation(opIdx); - this.imagesTracker?.record(ctx, width, height, this.dependencyTracker.clipBox); - } - drawImageAtIntegerCoords(ctx, scaled.img, 0, 0, scaled.paintWidth, scaled.paintHeight, 0, -height, width, height); - if (scaled.tmpCanvas) { - this.canvasFactory.destroy(scaled.tmpCanvas); + loadingRequests + } = this; + const { + promise, + resolve + } = Promise.withResolvers(); + const request = { + done: false, + resolve + }; + loadingRequests.push(request); + this._loadTestFont ??= atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQA" + "FQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAA" + "ALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgA" + "AAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1" + "AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD" + "6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACM" + "AooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4D" + "IP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAA" + "AAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUA" + "AQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgAB" + "AAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABY" + "AAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAA" + "AC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "AAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAA" + "AAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQAC" + "AQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3" + "Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTj" + "FQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA=="); + function int32(data, offset) { + return data.charCodeAt(offset) << 24 | data.charCodeAt(offset + 1) << 16 | data.charCodeAt(offset + 2) << 8 | data.charCodeAt(offset + 3) & 0xff; } - if (inlineImgCanvas) { - this.canvasFactory.destroy(inlineImgCanvas); + function string32(value) { + return String.fromCharCode(value >> 24 & 0xff, value >> 16 & 0xff, value >> 8 & 0xff, value & 0xff); } - this.compose(); - this.restore(opIdx); - this.#endKnockoutElement(started); - } - paintInlineImageXObjectGroup(opIdx, imgData, map) { - if (!this.contentVisible) { - return; + function spliceString(s, offset, remove, insert) { + const chunk1 = s.substring(0, offset); + const chunk2 = s.substring(offset + remove); + return chunk1 + insert + chunk2; } - const started = this.#beginKnockoutElement(this.current.fillAlpha); - const ctx = this.ctx; - let imgToPaint; - let inlineImgCanvas = null; - if (imgData.bitmap && !this.current.transferMapsFallback) { - imgToPaint = imgData.bitmap; - } else if (imgData.bitmap) { - ({ - img: imgToPaint, - canvasEntry: inlineImgCanvas - } = this.applyTransferMapsToBitmap(imgData)); - } else { - const w = imgData.width; - const h = imgData.height; - const tmpCanvas = this.canvasFactory.create(w, h); - putBinaryImageData(tmpCanvas.context, imgData); - imgToPaint = this.applyTransferMapsToCanvas(tmpCanvas.context); - inlineImgCanvas = tmpCanvas; + let i, ii; + const canvas = this._document.createElement("canvas"); + canvas.width = 1; + canvas.height = 1; + const ctx = canvas.getContext("2d"); + let called = 0; + function isFontReady(name, callback) { + if (++called > 30) { + warn("Load test font never loaded."); + callback(); + return; + } + ctx.font = "30px " + name; + ctx.fillText(".", 0, 20); + const imageData = ctx.getImageData(0, 0, 1, 1); + if (imageData.data[3] > 0) { + callback(); + return; + } + setTimeout(isFontReady.bind(null, name, callback)); } - this.dependencyTracker?.resetBBox(opIdx); - for (const entry of map) { - ctx.save(); - ctx.transform(...entry.transform); - ctx.scale(1, -1); - drawImageAtIntegerCoords(ctx, imgToPaint, entry.x, entry.y, entry.w, entry.h, 0, -1, 1, 1); - this.dependencyTracker?.recordBBox(opIdx, ctx, 0, 1, -1, 0); - ctx.restore(); + const loadTestFontId = `lt${Date.now()}${this.loadTestFontId++}`; + let data = this._loadTestFont; + const COMMENT_OFFSET = 976; + data = spliceString(data, COMMENT_OFFSET, loadTestFontId.length, loadTestFontId); + const CFF_CHECKSUM_OFFSET = 16; + const XXXX_VALUE = 0x58585858; + let checksum = int32(data, CFF_CHECKSUM_OFFSET); + for (i = 0, ii = loadTestFontId.length - 3; i < ii; i += 4) { + checksum = checksum - XXXX_VALUE + int32(loadTestFontId, i) | 0; } - if (inlineImgCanvas) { - this.canvasFactory.destroy(inlineImgCanvas); + if (i < loadTestFontId.length) { + checksum = checksum - XXXX_VALUE + int32(loadTestFontId + "XXX", i) | 0; } - this.dependencyTracker?.recordOperation(opIdx); - this.compose(); - this.#endKnockoutElement(started); - } - paintSolidColorImageMask(opIdx) { - if (!this.contentVisible) { - return; + data = spliceString(data, CFF_CHECKSUM_OFFSET, 4, string32(checksum)); + const url = `url(data:font/opentype;base64,${btoa(data)});`; + const rule = `@font-face {font-family:"${loadTestFontId}";src:${url}}`; + this.insertRule(rule); + const div = this._document.createElement("div"); + div.style.visibility = "hidden"; + div.style.width = div.style.height = "10px"; + div.style.position = "absolute"; + div.style.top = div.style.left = "0px"; + for (const name of [font.loadedName, loadTestFontId]) { + const span = this._document.createElement("span"); + span.textContent = "Hi"; + span.style.fontFamily = name; + div.append(span); } - const started = this.#beginKnockoutElement(this.current.fillAlpha); - this.dependencyTracker?.resetBBox(opIdx).recordBBox(opIdx, this.ctx, 0, 1, 0, 1).recordDependencies(opIdx, Dependencies.fill).recordOperation(opIdx); - this.ctx.fillRect(0, 0, 1, 1); - this.compose(); - this.#endKnockoutElement(started); - } - markPoint(opIdx, tag) {} - markPointProps(opIdx, tag, properties) {} - beginMarkedContent(opIdx, tag) { - this.dependencyTracker?.beginMarkedContent(opIdx); - this.markedContentStack.push({ - visible: true + this._document.body.append(div); + isFontReady(loadTestFontId, () => { + div.remove(); + completeRequest(); }); + return promise; } - beginMarkedContentProps(opIdx, tag, properties) { - this.dependencyTracker?.beginMarkedContent(opIdx); - if (tag === "OC") { - this.markedContentStack.push({ - visible: this.optionalContentConfig.isVisible(properties) - }); - } else { - this.markedContentStack.push({ - visible: true - }); - } - this.contentVisible = this.isContentVisible(); - } - endMarkedContent(opIdx) { - this.dependencyTracker?.endMarkedContent(opIdx); - this.markedContentStack.pop(); - this.contentVisible = this.isContentVisible(); - } - beginCompat(opIdx) {} - endCompat(opIdx) {} - consumePath(opIdx, path, clipBox) { - const isEmpty = this.current.isEmptyClip(); - if (this.pendingClip) { - this.current.updateClipFromPath(); - } - if (!this.pendingClip) { - this.compose(clipBox); +} +class FontFaceObject { + #compiledPaths = new Map(); + #fontData; + constructor(translatedData, inspectFont = null, charProcOperatorList, extra) { + this.#fontData = translatedData; + this._inspectFont = inspectFont; + if (charProcOperatorList) { + this.charProcOperatorList = charProcOperatorList; } - const ctx = this.ctx; - if (this.pendingClip) { - if (!isEmpty) { - if (this.pendingClip === EO_CLIP) { - ctx.clip(path, "evenodd"); - } else { - ctx.clip(path); - } - } - this.pendingClip = null; - this.dependencyTracker?.bboxToClipBoxDropOperation(opIdx).recordFutureForcedDependency("clipPath", opIdx); - } else { - this.dependencyTracker?.recordOperation(opIdx); + if (extra) { + Object.assign(this, extra); } - this.current.startNewPathAndClipBox(this.current.clipBox); } - getSinglePixelWidth() { - const m = getCurrentTransform(this.ctx); - if (m[1] === 0 && m[2] === 0) { - return 1 / Math.min(Math.abs(m[0]), Math.abs(m[3])); + createNativeFontFace() { + const { + data + } = this; + if (!data || this.disableFontFace) { + return null; } - const absDet = Math.abs(m[0] * m[3] - m[2] * m[1]); - const normX = Math.hypot(m[0], m[2]); - const normY = Math.hypot(m[1], m[3]); - return Math.max(normX, normY) / absDet; - } - getScaleForStroking() { - if (this._cachedScaleForStroking[0] === -1) { - const { - lineWidth - } = this.current; - const { - a, - b, - c, - d - } = this.ctx.getTransform(); - let scaleX, scaleY; - if (b === 0 && c === 0) { - const normX = Math.abs(a); - const normY = Math.abs(d); - if (normX === normY) { - if (lineWidth === 0) { - scaleX = scaleY = 1 / normX; - } else { - const scaledLineWidth = normX * lineWidth; - scaleX = scaleY = scaledLineWidth < 1 ? 1 / scaledLineWidth : 1; - } - } else if (lineWidth === 0) { - scaleX = 1 / normX; - scaleY = 1 / normY; - } else { - const scaledXLineWidth = normX * lineWidth; - const scaledYLineWidth = normY * lineWidth; - scaleX = scaledXLineWidth < 1 ? 1 / scaledXLineWidth : 1; - scaleY = scaledYLineWidth < 1 ? 1 / scaledYLineWidth : 1; - } - } else { - const absDet = Math.abs(a * d - b * c); - const normX = Math.hypot(a, b); - const normY = Math.hypot(c, d); - if (lineWidth === 0) { - scaleX = normY / absDet; - scaleY = normX / absDet; - } else { - const baseArea = lineWidth * absDet; - scaleX = normY > baseArea ? normY / baseArea : 1; - scaleY = normX > baseArea ? normX / baseArea : 1; - } + let nativeFontFace; + if (!this.cssFontInfo) { + nativeFontFace = new FontFace(this.loadedName, data, {}); + } else { + const css = { + weight: this.cssFontInfo.fontWeight + }; + if (this.cssFontInfo.italicAngle) { + css.style = `oblique ${this.cssFontInfo.italicAngle}deg`; } - this._cachedScaleForStroking[0] = scaleX; - this._cachedScaleForStroking[1] = scaleY; + nativeFontFace = new FontFace(serializeFontFamily(this.cssFontInfo.fontFamily), data, css); } - return this._cachedScaleForStroking; + this._inspectFont?.(this); + return nativeFontFace; } - rescaleAndStroke(path, saveRestore) { + createFontFaceRule() { const { - ctx, - current: { - lineWidth - } + data } = this; - const [scaleX, scaleY] = this.getScaleForStroking(); - if (scaleX === scaleY) { - ctx.lineWidth = (lineWidth || 1) * scaleX; - ctx.stroke(path); - return; + if (!data || this.disableFontFace) { + return null; } - const SCALE_MATRIX = CanvasGraphics.#SCALE_MATRIX ??= new DOMMatrix(); - const dashes = ctx.getLineDash(); - if (saveRestore) { - ctx.save(); + const url = `url(data:${this.mimetype};base64,${data.toBase64()});`; + let rule; + if (!this.cssFontInfo) { + rule = `@font-face {font-family:"${this.loadedName}";src:${url}}`; + } else { + let css = `font-weight: ${this.cssFontInfo.fontWeight};`; + if (this.cssFontInfo.italicAngle) { + css += `font-style: oblique ${this.cssFontInfo.italicAngle}deg;`; + } + const fontFamily = serializeFontFamily(this.cssFontInfo.fontFamily); + rule = `@font-face {font-family:${fontFamily};${css}src:${url}}`; } - ctx.scale(scaleX, scaleY); - SCALE_MATRIX.a = 1 / scaleX; - SCALE_MATRIX.d = 1 / scaleY; - const newPath = new Path2D(); - newPath.addPath(path, SCALE_MATRIX); - if (dashes.length > 0) { - const scale = Math.max(scaleX, scaleY); - ctx.setLineDash(dashes.map(x => x / scale)); - ctx.lineDashOffset /= scale; + this._inspectFont?.(this, url); + return rule; + } + getPathGenerator(objs, character) { + let path = this.#compiledPaths.get(character); + if (path) { + return path; } - ctx.lineWidth = lineWidth || 1; - ctx.stroke(newPath); - if (saveRestore) { - ctx.restore(); + const objId = `${this.loadedName}_path_${character}`; + let cmds; + try { + cmds = objs.get(objId); + } catch (ex) { + warn(`getPathGenerator - ignoring character: "${ex}".`); } - } - isContentVisible() { - for (let i = this.markedContentStack.length - 1; i >= 0; i--) { - if (!this.markedContentStack[i].visible) { - return false; - } + path = makePathFromDrawOPS(cmds?.path); + if (!this.fontExtraProperties) { + objs.delete(objId); } - return true; + this.#compiledPaths.set(character, path); + return path; } -} -for (const op in OPS) { - if (CanvasGraphics.prototype[op] !== undefined) { - CanvasGraphics.prototype[OPS[op]] = CanvasGraphics.prototype[op]; + get black() { + return this.#fontData.black; + } + get bold() { + return this.#fontData.bold; + } + get disableFontFace() { + return this.#fontData.disableFontFace; + } + set disableFontFace(value) { + util_shadow(this, "disableFontFace", !!value); + } + get fontExtraProperties() { + return this.#fontData.fontExtraProperties; + } + get isInvalidPDFjsFont() { + return this.#fontData.isInvalidPDFjsFont; + } + get isType3Font() { + return this.#fontData.isType3Font; + } + get italic() { + return this.#fontData.italic; + } + get missingFile() { + return this.#fontData.missingFile; + } + get remeasure() { + return this.#fontData.remeasure; + } + get vertical() { + return this.#fontData.vertical; + } + get bbox() { + return this.#fontData.bbox; + } + get fontMatrix() { + return this.#fontData.fontMatrix; + } + get fallbackName() { + return this.#fontData.fallbackName; + } + get loadedName() { + return this.#fontData.loadedName; + } + get mimetype() { + return this.missingFile ? null : "font/opentype"; + } + get data() { + return this.#fontData.data; + } + clearData() { + this.#fontData.clearData(); + } + get cssFontInfo() { + return this.#fontData.cssFontInfo; + } + get systemFontInfo() { + return this.#fontData.systemFontInfo; } } @@ -19945,7 +19827,7 @@ class PDFFetchStreamReader extends BasePDFStreamReader { }; } cancel(reason) { - this._reader?.cancel(reason); + this._reader?.cancel(reason).catch(() => {}); this._abortController.abort(); } } @@ -19968,6 +19850,7 @@ class PDFFetchStreamRangeReader extends BasePDFStreamRangeReader { this._reader = response.body.getReader(); this._readCapability.resolve(); }).catch(this._readCapability.reject); + this._readCapability.promise.catch(() => {}); } async read() { await this._readCapability.promise; @@ -19984,7 +19867,7 @@ class PDFFetchStreamRangeReader extends BasePDFStreamRangeReader { }; } cancel(reason) { - this._reader?.cancel(reason); + this._reader?.cancel(reason).catch(() => {}); this._abortController.abort(); } } @@ -20582,7 +20465,7 @@ class PDFNodeStreamReader extends BasePDFStreamReader { }; } cancel(reason) { - this._reader?.cancel(reason); + this._reader?.cancel(reason).catch(() => {}); } } class PDFNodeStreamRangeReader extends BasePDFStreamRangeReader { @@ -20603,6 +20486,7 @@ class PDFNodeStreamRangeReader extends BasePDFStreamRangeReader { } catch (error) { this._readCapability.reject(error); } + this._readCapability.promise.catch(() => {}); } async read() { await this._readCapability.promise; @@ -20619,7 +20503,7 @@ class PDFNodeStreamRangeReader extends BasePDFStreamRangeReader { }; } cancel(reason) { - this._reader?.cancel(reason); + this._reader?.cancel(reason).catch(() => {}); } } @@ -20634,9 +20518,31 @@ function getNetworkStream(url) { } ;// ./src/display/worker_options.js + + class GlobalWorkerOptions { static #port = null; + static #rendererPorts = []; + static #rendererSrc = ""; static #src = ""; + static get rendererPorts() { + return this.#rendererPorts; + } + static set rendererPorts(val) { + if (!Array.isArray(val) || !val.every(port => typeof Worker !== "undefined" && port instanceof Worker)) { + throw new Error("Invalid `rendererPorts` type."); + } + this.#rendererPorts = val; + } + static get rendererSrc() { + return this.#rendererSrc; + } + static set rendererSrc(val) { + if (typeof val !== "string") { + throw new Error("Invalid `rendererSrc` type."); + } + this.#rendererSrc = val; + } static get workerPort() { return this.#port; } @@ -20679,6 +20585,493 @@ class Metadata { } } +;// ./src/shared/obj_bin_transform_utils.js + +class CSS_FONT_INFO { + static strings = ["fontFamily", "fontWeight", "italicAngle"]; +} +class SYSTEM_FONT_INFO { + static strings = ["css", "loadedName", "baseFontName", "src"]; +} +class FONT_INFO { + static bools = ["black", "bold", "disableFontFace", "fontExtraProperties", "isInvalidPDFjsFont", "isType3Font", "italic", "missingFile", "remeasure", "vertical"]; + static strings = ["fallbackName", "loadedName"]; + static OFFSET_BBOX = Math.ceil(this.bools.length * 2 / 8); + static OFFSET_FONT_MATRIX = this.OFFSET_BBOX + 1 + 2 * 4; + static OFFSET_STRINGS = this.OFFSET_FONT_MATRIX + 1 + 8 * 6; +} +class PATTERN_INFO { + static KIND = 0; + static HAS_BBOX = 1; + static HAS_BACKGROUND = 2; + static SHADING_TYPE = 3; + static N_COORD = 4; + static N_COLOR = 8; + static N_STOP = 12; + static N_FIGURES = 16; +} +class InfoUtils { + static get decoder() { + return util_shadow(this, "decoder", new TextDecoder()); + } + static get encoder() { + return util_shadow(this, "encoder", new TextEncoder()); + } +} + +;// ./src/display/obj_bin_transform_display.js + + + + + + + + +function readString(buffer, view, index, offset = 0) { + const { + decoder + } = InfoUtils; + for (let i = 0; i < index; i++) { + offset += view.getUint32(offset) + 4; + } + const length = view.getUint32(offset); + return decoder.decode(new Uint8Array(buffer, offset + 4, length)); +} +class CssFontInfo { + #buffer; + #view; + constructor(buffer) { + this.#buffer = buffer; + this.#view = new DataView(buffer); + } + #readString(index) { + util_assert(index < CSS_FONT_INFO.strings.length, "Invalid string index"); + return readString(this.#buffer, this.#view, index); + } + get fontFamily() { + return util_shadow(this, "fontFamily", this.#readString(0)); + } + get fontWeight() { + return util_shadow(this, "fontWeight", this.#readString(1)); + } + get italicAngle() { + return util_shadow(this, "italicAngle", this.#readString(2)); + } +} +class SystemFontInfo { + #buffer; + #view; + constructor(buffer) { + this.#buffer = buffer; + this.#view = new DataView(buffer); + } + #readString(index) { + util_assert(index < SYSTEM_FONT_INFO.strings.length, "Invalid string index"); + return readString(this.#buffer, this.#view, index, 4); + } + get css() { + return util_shadow(this, "css", this.#readString(0)); + } + get loadedName() { + return util_shadow(this, "loadedName", this.#readString(1)); + } + get baseFontName() { + return util_shadow(this, "baseFontName", this.#readString(2)); + } + get src() { + return util_shadow(this, "src", this.#readString(3)); + } + get style() { + let offset = 0; + offset += 4 + this.#view.getUint32(offset); + const style = readString(this.#buffer, this.#view, 0, offset), + weight = readString(this.#buffer, this.#view, 1, offset); + return util_shadow(this, "style", { + style, + weight + }); + } +} +class FontInfo { + #buffer; + #view; + constructor(buffer) { + this.#buffer = buffer; + this.#view = new DataView(buffer); + } + #readBoolean(index) { + util_assert(index < FONT_INFO.bools.length, "Invalid boolean index"); + const byteOffset = Math.floor(index / 4); + const bitOffset = index * 2 % 8; + const value = this.#view.getUint8(byteOffset) >> bitOffset & 0x03; + return value === 0x00 ? undefined : value === 0x02; + } + get black() { + return util_shadow(this, "black", this.#readBoolean(0)); + } + get bold() { + return util_shadow(this, "bold", this.#readBoolean(1)); + } + get disableFontFace() { + return util_shadow(this, "disableFontFace", this.#readBoolean(2)); + } + get fontExtraProperties() { + return util_shadow(this, "fontExtraProperties", this.#readBoolean(3)); + } + get isInvalidPDFjsFont() { + return util_shadow(this, "isInvalidPDFjsFont", this.#readBoolean(4)); + } + get isType3Font() { + return util_shadow(this, "isType3Font", this.#readBoolean(5)); + } + get italic() { + return util_shadow(this, "italic", this.#readBoolean(6)); + } + get missingFile() { + return util_shadow(this, "missingFile", this.#readBoolean(7)); + } + get remeasure() { + return util_shadow(this, "remeasure", this.#readBoolean(8)); + } + get vertical() { + return util_shadow(this, "vertical", this.#readBoolean(9)); + } + #readArray(offset, arrLen, lookupName, increment) { + const len = this.#view.getUint8(offset++); + if (len === 0) { + return undefined; + } + util_assert(len === arrLen, "Invalid array length."); + const arr = new Array(len); + for (let i = 0; i < len; i++) { + arr[i] = this.#view[lookupName](offset, true); + offset += increment; + } + return arr; + } + get bbox() { + return util_shadow(this, "bbox", this.#readArray(FONT_INFO.OFFSET_BBOX, 4, "getInt16", 2)); + } + get fontMatrix() { + return util_shadow(this, "fontMatrix", this.#readArray(FONT_INFO.OFFSET_FONT_MATRIX, 6, "getFloat64", 8)); + } + #readString(index) { + util_assert(index < FONT_INFO.strings.length, "Invalid string index"); + return readString(this.#buffer, this.#view, index, FONT_INFO.OFFSET_STRINGS + 4); + } + get fallbackName() { + return util_shadow(this, "fallbackName", this.#readString(0)); + } + get loadedName() { + return util_shadow(this, "loadedName", this.#readString(1)); + } + #getBufferOffset(index) { + let offset = FONT_INFO.OFFSET_STRINGS; + for (let i = 0; i <= index; i++) { + offset += 4 + this.#view.getUint32(offset); + } + const length = this.#view.getUint32(offset); + return { + offset, + length + }; + } + get data() { + const { + offset, + length + } = this.#getBufferOffset(2); + return !length ? undefined : new Uint8Array(this.#buffer, offset + 4, length); + } + clearData() { + const { + offset, + length + } = this.#getBufferOffset(2); + if (!length) { + return; + } + this.#view.setUint32(offset, 0); + this.#buffer = new Uint8Array(this.#buffer, 0, offset + 4).slice().buffer; + this.#view = new DataView(this.#buffer); + } + get cssFontInfo() { + const { + offset, + length + } = this.#getBufferOffset(1); + let info = null; + if (length) { + const data = new Uint8Array(this.#buffer, offset + 4, length).slice(); + info = new CssFontInfo(data.buffer); + } + return util_shadow(this, "cssFontInfo", info); + } + get systemFontInfo() { + const { + offset, + length + } = this.#getBufferOffset(0); + let info = null; + if (length) { + const data = new Uint8Array(this.#buffer, offset + 4, length).slice(); + info = new SystemFontInfo(data.buffer); + } + return util_shadow(this, "systemFontInfo", info); + } +} +class PatternInfo { + constructor(buffer) { + this.buffer = buffer; + this.view = new DataView(buffer); + this.data = new Uint8Array(buffer); + } + getIR() { + const dataView = this.view; + const kind = this.data[PATTERN_INFO.KIND]; + const hasBBox = !!this.data[PATTERN_INFO.HAS_BBOX]; + const hasBackground = !!this.data[PATTERN_INFO.HAS_BACKGROUND]; + const nCoord = dataView.getUint32(PATTERN_INFO.N_COORD, true); + const nColor = dataView.getUint32(PATTERN_INFO.N_COLOR, true); + const nStop = dataView.getUint32(PATTERN_INFO.N_STOP, true); + let offset = 20; + const coords = new Float32Array(this.buffer, offset, nCoord * 2); + offset += nCoord * 8; + const colors = new Uint8Array(this.buffer, offset, nColor * 4); + offset += nColor * 4; + const stops = []; + for (let i = 0; i < nStop; ++i) { + const p = dataView.getFloat32(offset, true); + offset += 4; + const rgb = dataView.getUint32(offset, true); + offset += 4; + stops.push([p, `#${rgb.toString(16).padStart(6, "0")}`]); + } + let bbox = null; + if (hasBBox) { + bbox = []; + for (let i = 0; i < 4; ++i) { + bbox.push(dataView.getFloat32(offset, true)); + offset += 4; + } + } + let background = null; + if (hasBackground) { + background = new Uint8Array(this.buffer, offset, 3); + offset += 3; + } + if (kind === 1) { + return ["RadialAxial", "axial", bbox, stops, [coords[0], coords[1]], [coords[2], coords[3]], null, null]; + } + if (kind === 2) { + return ["RadialAxial", "radial", bbox, stops, [coords[0], coords[1]], [coords[3], coords[4]], coords[2], coords[5]]; + } + if (kind === 3) { + const shadingType = this.data[PATTERN_INFO.SHADING_TYPE]; + let bounds = null; + if (coords.length > 0) { + bounds = BBOX_INIT.slice(); + for (let i = 0, ii = coords.length; i < ii; i += 2) { + Util.pointBoundingBox(coords[i], coords[i + 1], bounds); + } + } + return ["Mesh", shadingType, coords, colors, nCoord, bounds, bbox, background]; + } + throw new Error(`Unsupported pattern kind: ${kind}`); + } +} +class FontPathInfo { + #buffer; + constructor(buffer) { + this.#buffer = buffer; + } + get path() { + if (FeatureTest.isFloat16ArraySupported) { + return new Float16Array(this.#buffer); + } + return new Float32Array(this.#buffer); + } +} + +;// ./src/display/pdf_objects.js + + +const INITIAL_DATA = Symbol("INITIAL_DATA"); +const dataObj = () => ({ + ...Promise.withResolvers(), + data: INITIAL_DATA +}); +class PDFObjects { + #objs = new Map(); + get(objId, callback = null, errorCallback = null) { + if (callback) { + const obj = this.#objs.getOrInsertComputed(objId, dataObj); + obj.promise.then(() => callback(obj.data), errorCallback); + return null; + } + const obj = this.#objs.get(objId); + if (!obj || obj.data === INITIAL_DATA) { + throw new Error(`Requesting object that isn't resolved yet ${objId}.`); + } + return obj.data; + } + has(objId) { + const obj = this.#objs.get(objId); + return !!obj && obj.data !== INITIAL_DATA; + } + delete(objId) { + const obj = this.#objs.get(objId); + if (!obj || obj.data === INITIAL_DATA) { + return false; + } + this.#objs.delete(objId); + return true; + } + resolve(objId, data = null) { + const obj = this.#objs.getOrInsertComputed(objId, dataObj); + if (obj.data !== INITIAL_DATA) { + throw new Error(`Object already resolved ${objId}.`); + } + obj.data = data; + obj.resolve(); + } + reject(objId, reason) { + const obj = this.#objs.getOrInsertComputed(objId, dataObj); + if (obj.data !== INITIAL_DATA) { + return; + } + obj.promise.catch(() => {}); + obj.reject(reason); + } + clear() { + for (const { + data + } of this.#objs.values()) { + data?.bitmap?.close(); + } + this.#objs.clear(); + } + *[Symbol.iterator]() { + for (const [objId, { + data + }] of this.#objs) { + if (data !== INITIAL_DATA) { + yield [objId, data]; + } + } + } +} + +;// ./src/display/object_handler.js + + + + + +class ObjectHandler { + constructor({ + messageHandler, + commonObjs, + fontLoader, + pageCache, + pdfBug = false, + shouldCreatePageObjs = false + }) { + this.messageHandler = messageHandler; + this.commonObjs = commonObjs; + this.fontLoader = fontLoader; + this.pageCache = pageCache; + this.pdfBug = pdfBug; + this.shouldCreatePageObjs = shouldCreatePageObjs; + } + resolveCommonObject(id, type, exportedData) { + if (type === "CopyLocalImage") { + const { + imageRef + } = exportedData; + util_assert(imageRef, "The imageRef must be defined."); + for (const pageOrObjs of this.pageCache.values()) { + const objs = pageOrObjs.objs || pageOrObjs; + for (const [, data] of objs) { + if (data?.ref !== imageRef) { + continue; + } + if (!data.dataLen) { + return null; + } + const copy = structuredClone(data); + this.commonObjs.resolve(id, copy); + return data.dataLen; + } + } + return null; + } + switch (type) { + case "Font": + if ("error" in exportedData) { + const exportedError = exportedData.error; + warn(`Error during font loading: ${exportedError}`); + this.commonObjs.resolve(id, exportedError); + break; + } + const fontData = new FontInfo(exportedData.buffer); + const inspectFont = this.pdfBug && globalThis.FontInspector?.enabled ? (font, url) => globalThis.FontInspector.fontAdded(font, url) : null; + const font = new FontFaceObject(fontData, inspectFont, exportedData.charProcOperatorList, exportedData.extra); + this.fontLoader.bind(font).catch(() => this.messageHandler.sendWithPromise("FontFallback", { + id + }).catch(reason => { + warn(`FontFallback failed for "${id}": ${reason}`); + })).finally(() => { + if (!font.fontExtraProperties) { + font.clearData(); + } + this.commonObjs.resolve(id, font); + }); + break; + case "FontPath": + this.commonObjs.resolve(id, new FontPathInfo(exportedData)); + break; + case "Image": + this.commonObjs.resolve(id, exportedData); + break; + case "Pattern": + const pattern = new PatternInfo(exportedData); + this.commonObjs.resolve(id, pattern.getIR()); + break; + default: + throw new Error(`Got unknown common object type ${type}`); + } + return null; + } + resolveObject(id, pageProxyId, type, exportedData) { + let pageOrObjs = this.pageCache.get(pageProxyId); + if (!pageOrObjs) { + if (!this.shouldCreatePageObjs) { + return false; + } + pageOrObjs = new PDFObjects(); + this.pageCache.set(pageProxyId, pageOrObjs); + } + const objs = pageOrObjs.objs || pageOrObjs; + if (objs.has(id)) { + return false; + } + if (pageOrObjs._intentStates?.size === 0) { + exportedData?.bitmap?.close(); + return false; + } + switch (type) { + case "Image": + case "Pattern": + objs.resolve(id, exportedData); + return true; + default: + throw new Error(`Got unknown object type ${type}`); + } + } +} + ;// ./src/display/optional_content_config.js @@ -20997,6 +21390,7 @@ class PagesMapper { #pageNumberToId = null; #prevPageNumbers = null; #pagesNumber = 0; + #initialPagesNumber = 0; #clipboard = null; #savedData = null; get pagesNumber() { @@ -21006,7 +21400,7 @@ class PagesMapper { if (this.#pagesNumber === n) { return; } - this.#pagesNumber = n; + this.#pagesNumber = this.#initialPagesNumber = n; this.#pageNumberToId = null; this.#prevPageNumbers = null; } @@ -21063,7 +21457,7 @@ class PagesMapper { prevPageNumbers.copyWithin(adjustedTarget + movedCount, adjustedTarget, remainingLen); prevPageNumbers.set(pagesToMove, adjustedTarget); this.#prevPageNumbers = prevPageNumbers; - if (pageNumberToId.every((id, i) => id === i + 1)) { + if (pagesNumber === this.#initialPagesNumber && pageNumberToId.every((id, i) => id === i + 1)) { this.#pageNumberToId = null; } } @@ -21249,64 +21643,536 @@ class PagesMapper { } } -;// ./src/display/pdf_objects.js +;// ./src/display/renderer_worker_proxy.js -const INITIAL_DATA = Symbol("INITIAL_DATA"); -const dataObj = () => ({ - ...Promise.withResolvers(), - data: INITIAL_DATA -}); -class PDFObjects { - #objs = new Map(); - get(objId, callback = null) { - if (callback) { - const obj = this.#objs.getOrInsertComputed(objId, dataObj); - obj.promise.then(() => callback(obj.data)); - return null; + + + + + + + + + + + + + + + + + + + + + + + + + +const PORT_CONNECTION_TIMEOUT = 5000; +function closeFrame({ + bitmap, + annotationBitmaps +}) { + bitmap?.close(); + if (annotationBitmaps) { + for (const [,, annotationBitmap] of annotationBitmaps) { + annotationBitmap.close(); + } + } +} +class WorkerRenderTask { + #annotationCanvasMap; + #cancelled = false; + #canvas; + #canvasFactory; + #filteredLength = 0; + #id; + #initParams; + #onError; + #onFrame; + #operatorListState; + #rendererWorker; + #renderTasks; + imageCoordinates = null; + recordedBBoxes = null; + constructor({ + rendererWorker, + renderTasks, + canvas, + canvasFactory, + annotationCanvasMap, + operatorListState, + initParams, + onFrame, + onError + }) { + this.#rendererWorker = rendererWorker; + this.#renderTasks = renderTasks; + this.#canvas = canvas; + this.#canvasFactory = canvasFactory; + this.#annotationCanvasMap = annotationCanvasMap; + this.#operatorListState = operatorListState; + this.#initParams = initParams; + this.#id = initParams.renderTaskId; + this.#onFrame = onFrame; + this.#onError = onError; + } + async initialize(transparency, optionalContentConfig) { + try { + await this.#rendererWorker.promise; + } catch { + return false; } - const obj = this.#objs.get(objId); - if (!obj || obj.data === INITIAL_DATA) { - throw new Error(`Requesting object that isn't resolved yet ${objId}.`); + if (!this.#rendererWorker.messageHandler || this.#cancelled) { + return false; } - return obj.data; - } - has(objId) { - const obj = this.#objs.get(objId); - return !!obj && obj.data !== INITIAL_DATA; - } - delete(objId) { - const obj = this.#objs.get(objId); - if (!obj || obj.data === INITIAL_DATA) { + try { + await this.#rendererWorker.sendWithPromise("InitializeGraphics", { + ...this.#initParams, + width: this.#canvas.width, + height: this.#canvas.height, + transparency, + optionalContentConfig: optionalContentConfig.serializable + }); + } catch (ex) { + if (!this.#cancelled) { + warn(`Failed to initialize graphics in renderer worker: ${ex.message}. ` + "Falling back to main-thread rendering."); + } return false; } - this.#objs.delete(objId); + if (!this.#cancelled) { + this.#renderTasks.set(this.#id, this); + } return true; } - resolve(objId, data = null) { - const obj = this.#objs.getOrInsertComputed(objId, dataObj); - if (obj.data !== INITIAL_DATA) { - throw new Error(`Object already resolved ${objId}.`); + async executeOperatorList(operatorList, operatorListIdx, operationsFilter) { + const handler = this.#rendererWorker.messageHandler; + if (!handler) { + throw new Error("Renderer worker was destroyed during rendering."); } - obj.data = data; - obj.resolve(); + const { + lastChunk + } = operatorList; + const end = operatorList.argsArray.length; + const operatorListState = this.#operatorListState; + if (operatorListState.sentLength < end) { + const start = operatorListState.sentLength; + handler.send("AppendOperatorList", { + pageProxyId: this.#initParams.pageProxyId, + operatorListId: operatorListState.id, + fnArray: operatorList.fnArray.slice(start, end), + argsArray: operatorList.argsArray.slice(start, end) + }); + operatorListState.sentLength = end; + } + let operationsFilterMask = null; + if (operationsFilter && this.#filteredLength < end) { + const start = this.#filteredLength; + operationsFilterMask = new Uint8Array(end - start); + for (let i = start; i < end; i++) { + operationsFilterMask[i - start] = operationsFilter(i, operatorList) ? 1 : 0; + } + this.#filteredLength = end; + } + const response = await this.#rendererWorker.sendWithPromise("ExecuteOperatorList", { + renderTaskId: this.#id, + operatorListIdx, + operatorListLength: end, + operationsFilterMask, + lastChunk + }).catch(reason => { + if (!this.#cancelled) { + throw reason; + } + return { + operatorListIdx, + aborted: true + }; + }); + if (response.aborted && !this.#cancelled) { + throw new Error("Render task was aborted in the renderer worker."); + } + if (lastChunk && response.operatorListIdx === end) { + this.#renderTasks.delete(this.#id); + const { + recordedBBoxesBuffer, + imageCoordinates + } = response; + if (recordedBBoxesBuffer) { + this.recordedBBoxes = BBoxReader.fromBuffer(recordedBBoxesBuffer); + } + this.imageCoordinates = imageCoordinates ?? null; + } + return response.operatorListIdx; } - clear() { - for (const { - data - } of this.#objs.values()) { - data?.bitmap?.close(); + cancel() { + this.#cancelled = true; + this.#renderTasks.delete(this.#id); + this.#rendererWorker.messageHandler?.send("CleanupRenderTask", { + renderTaskId: this.#id + }); + } + drawFrame(frame) { + try { + if (frame.bitmap) { + const ctx = this.#canvasFactory.getNoAlphaContext(this.#canvas); + ctx.drawImage(frame.bitmap, 0, 0); + } + if (frame.annotationBitmaps) { + this.#drawAnnotationCanvases(frame.annotationBitmaps); + } + } catch (ex) { + this.#onError(ex); + return; + } finally { + closeFrame(frame); } - this.#objs.clear(); + this.#onFrame(); } - *[Symbol.iterator]() { - for (const [objId, { + #drawAnnotationCanvases(annotationBitmaps) { + const annotationCanvasMap = this.#annotationCanvasMap; + const seen = new Set(); + for (const [id, canvasName, bitmap] of annotationBitmaps) { + const { + canvas, + context + } = this.#canvasFactory.create(bitmap.width, bitmap.height); + context.drawImage(bitmap, 0, 0); + if (!canvasName) { + annotationCanvasMap.set(id, canvas); + continue; + } + setAnnotationCanvasName(canvas, canvasName); + if (seen.has(id)) { + annotationCanvasMap.get(id).push(canvas); + } else { + seen.add(id); + annotationCanvasMap.set(id, [canvas]); + } + } + } +} +class RendererWorker { + #capability = Promise.withResolvers(); + #enableHWA; + #enableWebGPU; + #messageHandler = null; + #operatorListId = 0; + #operatorLists = new WeakMap(); + #pendingMessages = []; + #pendingRequests = new Set(); + #port = null; + #portNames = null; + #renderTaskId = 0; + #renderTasks = new Map(); + #terminateEarly = null; + #webWorker = null; + #workerAC = null; + static #connectionId = 0; + static #usedPorts = new WeakSet(); + destroyed = false; + constructor({ + port = null, + verbosity = getVerbosityLevel(), + enableHWA = false, + enableWebGPU = false + } = {}) { + this.verbosity = verbosity; + this.#enableHWA = enableHWA; + this.#enableWebGPU = enableWebGPU; + if (port) { + this.#initializeFromPort(port); + } else { + this.#initialize(); + } + } + static get isAvailable() { + return (!!GlobalWorkerOptions.rendererSrc || GlobalWorkerOptions.rendererPorts.length > 0) && typeof Worker !== "undefined" && FeatureTest.isOffscreenCanvasSupported && !!globalThis.document?.fonts; + } + get promise() { + return this.#capability.promise; + } + get messageHandler() { + return this.#messageHandler; + } + get port() { + return this.#port; + } + #resolve() { + this.#messageHandler.on("RenderFrame", frame => { + const renderTask = this.#renderTasks.get(frame.renderTaskId); + if (renderTask) { + renderTask.drawFrame(frame); + } else { + closeFrame(frame); + } + }); + this.#capability.resolve(); + this.#messageHandler.send("configure", { + verbosity: this.verbosity, + enableHWA: this.#enableHWA, + enableWebGPU: this.#enableWebGPU + }); + const pendingMessages = this.#pendingMessages; + this.#pendingMessages = null; + for (const send of pendingMessages) { + send(); + } + } + #reject(reason) { + this.#pendingMessages = null; + this.#capability.reject(reason); + } + #initializeFromPort(port) { + RendererWorker.#usedPorts.add(port); + this.#port = port; + const id = RendererWorker.#connectionId++; + const sourceName = `main${id}`; + const targetName = `renderer${id}`; + this.#portNames = { + sourceName, + targetName + }; + const handler = new MessageHandler("main", "renderer", port); + handler.send("Connect", { + sourceName: targetName, + targetName: sourceName + }); + handler.destroy(); + this.#waitForReady(port, new MessageHandler(sourceName, targetName, port), true); + } + #initialize() { + try { + const { + rendererSrc + } = GlobalWorkerOptions; + if (!rendererSrc) { + throw new Error('No "GlobalWorkerOptions.rendererSrc" specified.'); + } + const worker = new Worker(getWorkerSrc(rendererSrc), { + type: "module" + }); + this.#waitForReady(worker, new MessageHandler("main", "renderer", worker), false); + } catch (reason) { + this.#reject(reason); + } + } + #waitForReady(worker, messageHandler, isPort) { + let timeoutId = null; + const terminateEarly = reason => { + this.#terminateEarly = null; + clearTimeout(timeoutId); + ac.abort(); + messageHandler.destroy(); + if (isPort) { + this.#port = null; + } else { + worker.terminate(); + } + this.#reject(new Error(`Renderer worker failed to initialize: "${reason?.message ?? reason}".`)); + }; + this.#terminateEarly = terminateEarly; + const ac = new AbortController(); + const onError = (event, reason) => { + if (!this.#messageHandler) { + terminateEarly(reason); + return; + } + event.preventDefault(); + warn(`Renderer worker failed: "${reason}". ` + "Falling back to main-thread rendering."); + this.destroy(); + }; + worker.addEventListener("error", event => onError(event, event.error?.message ?? event.message), { + signal: ac.signal + }); + worker.addEventListener("messageerror", event => onError(event, "Cannot deserialize a message."), { + signal: ac.signal + }); + if (isPort) { + timeoutId = setTimeout(() => terminateEarly("Connection timed out."), PORT_CONNECTION_TIMEOUT); + } + messageHandler.on("ready", data => { + if (!(data?.testObj instanceof Uint8Array)) { + terminateEarly("TypedArray transfer test failed."); + return; + } + const apiVersion = "6.5.438"; + if (apiVersion !== data.workerVersion) { + terminateEarly(`The API version "${apiVersion}" does not match the Worker version "${data.workerVersion}".`); + return; + } + this.#terminateEarly = null; + clearTimeout(timeoutId); + this.#messageHandler = messageHandler; + if (!isPort) { + this.#webWorker = worker; + } + this.#workerAC = ac; + this.#resolve(); + }); + } + destroy() { + this.destroyed = true; + if (this.#port) { + if (this.#messageHandler) { + this.#closeStrayFrames(this.#port); + this.#messageHandler.send("Disconnect", null); + } + RendererWorker.#usedPorts.delete(this.#port); + this.#port = null; + } + this.#terminateEarly?.("Worker was destroyed."); + this.#workerAC?.abort(); + this.#workerAC = null; + this.#webWorker?.terminate(); + this.#webWorker = null; + this.#messageHandler?.destroy(); + this.#messageHandler = null; + for (const reject of this.#pendingRequests) { + reject(new Error("Renderer worker was destroyed.")); + } + this.#pendingRequests.clear(); + } + #closeStrayFrames(port) { + const { + sourceName, + targetName + } = this.#portNames; + const ac = new AbortController(); + const timeoutId = setTimeout(() => ac.abort(), PORT_CONNECTION_TIMEOUT); + port.addEventListener("message", ({ data - }] of this.#objs) { - if (data !== INITIAL_DATA) { - yield [objId, data]; + }) => { + if (data?.targetName !== sourceName || data.sourceName !== targetName) { + return; + } + if (data.action === "RenderFrame") { + closeFrame(data.data); + } else if (data.action === "Disconnected") { + clearTimeout(timeoutId); + ac.abort(); } + }, { + signal: ac.signal + }); + } + static create({ + ports = [], + ...params + } = {}) { + const port = ports.find(p => !this.#usedPorts.has(p)) ?? null; + if (!port && ports.length > 0) { + warn("RendererWorker.create - no unused `rendererPorts` available, " + "falling back to `rendererSrc`."); + } + return new RendererWorker({ + ...params, + port + }); + } + sendWithPromise(action, data) { + const handler = this.#messageHandler; + if (!handler) { + return Promise.reject(new Error("Renderer worker was destroyed.")); + } + const { + promise, + resolve, + reject + } = Promise.withResolvers(); + this.#pendingRequests.add(reject); + handler.sendWithPromise(action, data).then(resolve, reject); + return promise.finally(() => { + this.#pendingRequests.delete(reject); + }); + } + #send(action, data) { + if (this.#pendingMessages) { + this.#pendingMessages.push(() => this.#send(action, data)); + return; } + this.#messageHandler?.send(action, data); + } + #sendObj(action, data, id, pageProxyId, isFont = false) { + try { + if (this.#pendingMessages) { + const queuedData = isFont ? structuredClone(data) : data; + this.#pendingMessages.push(() => this.#sendObj(action, queuedData, id, pageProxyId)); + return; + } + this.#messageHandler?.send(action, data); + } catch (reason) { + warn(`RendererWorker - failed to send "${action}": ${reason}`); + this.#send("objFailed", { + id, + pageProxyId, + reason: reason.message + }); + } + } + sendCommonObj(id, type, data) { + this.#sendObj("commonobj", [id, type, data], id, null, type === "Font"); + } + sendObj(id, pageProxyId, type, data) { + this.#sendObj("obj", [id, pageProxyId, type, data], id, pageProxyId); + } + cleanup(keepLoadedFonts) { + this.#send("Cleanup", { + keepLoadedFonts + }); + } + cleanupPage(pageProxyId) { + this.#send("cleanupPage", { + pageProxyId + }); + } + createRenderTask({ + pageProxyId, + operatorList, + params, + pageColors, + canvasFactory, + annotationCanvasMap, + onFrame, + onError + }) { + const { + canvas, + canvasContext, + background + } = params; + if (!this.#messageHandler && !this.#pendingMessages || canvasContext || background && typeof background !== "string" || pageColors || params.recordForDebugger) { + return null; + } + const operatorListState = this.#operatorLists.getOrInsertComputed(operatorList, () => ({ + id: this.#operatorListId++, + sentLength: 0 + })); + return new WorkerRenderTask({ + rendererWorker: this, + renderTasks: this.#renderTasks, + canvas, + canvasFactory, + annotationCanvasMap, + operatorListState, + initParams: { + pageProxyId, + operatorListId: operatorListState.id, + renderTaskId: this.#renderTaskId++, + hasAnnotationCanvasMap: !!annotationCanvasMap, + recordOperations: params.recordOperations, + recordImages: params.recordImages, + partialFrames: params.partialFrames, + transform: params.transform, + viewport: params.viewport, + background, + pixelRatio: OutputScale.pixelRatio + }, + onFrame, + onError + }); } } @@ -21325,6 +22191,7 @@ class PDFObjects { + const MAX_TEXT_DIVS_TO_RENDER = 100000; const DEFAULT_FONT_SIZE = 30; class TextLayer { @@ -21346,7 +22213,6 @@ class TextLayer { #textContentItemsStr = []; #textContentSource = null; #textDivs = []; - #textDivProperties = new WeakMap(); #transform = null; static #ascentCache = new Map(); static #canvasContexts = new Map(); @@ -21430,32 +22296,19 @@ class TextLayer { return this.#capability.promise; } update({ - viewport, - onBefore = null + viewport }) { const scale = viewport.scale * OutputScale.pixelRatio; const rotation = viewport.rotation; if (rotation !== this.#rotation) { - onBefore?.(); this.#rotation = rotation; setLayerDimensions(this.#rootContainer, { rotation }); } if (scale !== this.#scale) { - onBefore?.(); this.#scale = scale; this.#pixelRatio = OutputScale.pixelRatio; - const params = { - div: null, - properties: null, - ctx: TextLayer.#getCtx(this.#lang) - }; - for (const div of this.#textDivs) { - params.properties = this.#textDivProperties.get(div); - params.div = div; - this.#layout(params); - } } } cancel() { @@ -21561,7 +22414,6 @@ class TextLayer { if (shouldScaleText) { textDivProperties.canvasWidth = style.vertical ? geom.height : geom.width; } - this.#textDivProperties.set(textDiv, textDivProperties); this.#layoutTextParams.div = textDiv; this.#layoutTextParams.properties = textDivProperties; this.#layout(this.#layoutTextParams); @@ -21779,12 +22631,15 @@ function getDocument(src = {}) { const BinaryDataFactory = src.BinaryDataFactory || (isNodeJS ? NodeBinaryDataFactory : DOMBinaryDataFactory); const enableHWA = src.enableHWA === true; const enableWebGPU = src.enableWebGPU === true; - const gpuPromise = enableWebGPU ? initGPU() : Promise.resolve(false); + if (enableWebGPU) { + initGPU(); + } const useWasm = src.useWasm !== false; const pagesMapper = src.pagesMapper || new PagesMapper(); + const styleElement = null; const useSystemFonts = typeof src.useSystemFonts === "boolean" ? src.useSystemFonts : !isNodeJS && !disableFontFace; const useWorkerFetch = typeof src.useWorkerFetch === "boolean" ? src.useWorkerFetch : !!(BinaryDataFactory === DOMBinaryDataFactory && cMapUrl && cMapPacked && standardFontDataUrl && wasmUrl && isValidFetchUrl(cMapUrl, document.baseURI) && isValidFetchUrl(standardFontDataUrl, document.baseURI) && isValidFetchUrl(wasmUrl, document.baseURI)); - const styleElement = null; + const disableWorkerRendering = src.disableWorkerRendering === true || !isOffscreenCanvasSupported || ownerDocument !== globalThis.document || !!styleElement || !RendererWorker.isAvailable; setVerbosityLevel(verbosity); const transportFactory = { canvasFactory: new CanvasFactory({ @@ -21808,9 +22663,24 @@ function getDocument(src = {}) { }); task._worker = worker; } + if (!disableWorkerRendering) { + const rendererWorker = RendererWorker.create({ + verbosity, + enableHWA, + enableWebGPU, + ports: GlobalWorkerOptions.rendererPorts + }); + rendererWorker.promise.catch(reason => { + if (!rendererWorker.destroyed) { + warn(`Renderer worker disabled: ${reason.message}`); + rendererWorker.destroy(); + } + }); + task._rendererWorker = rendererWorker; + } const docParams = { docId, - apiVersion: "6.4.299", + apiVersion: "6.5.438", data, password, disableAutoFetch, @@ -21832,25 +22702,24 @@ function getDocument(src = {}) { cMapPacked, iccUrl, standardFontDataUrl, - wasmUrl, - hasGPU: false + wasmUrl } }; const transportParams = { ownerDocument, pdfBug, styleElement, - enableHWA, + rendererWorker: task._rendererWorker, + enableWebGPU, loadingParams: { disableAutoFetch, enableXfa } }; - Promise.all([worker.promise, gpuPromise]).then(function ([, hasGPU]) { + worker.promise.then(function () { if (worker.destroyed) { throw new Error("Worker was destroyed"); } - docParams.evaluatorOptions.hasGPU = hasGPU; const workerIdPromise = worker.messageHandler.sendWithPromise("GetDocRequest", docParams, data ? [data.buffer] : null); let networkStream; if (data) {} else if (rangeTransport) { @@ -21893,6 +22762,7 @@ class PDFDocumentLoadingTask { _setupCapability = Promise.withResolvers(); _transport = null; _worker = null; + _rendererWorker = null; docId = `d${PDFDocumentLoadingTask.#docId++}`; destroyed = false; onPassword = null; @@ -21914,6 +22784,9 @@ class PDFDocumentLoadingTask { delete this._worker._pendingDestroy; } throw ex; + } finally { + this._rendererWorker?.destroy(); + this._rendererWorker = null; } this._transport = null; this._worker?.destroy(); @@ -22187,6 +23060,7 @@ class PDFPageProxy { isEditing = false, recordImages = false, recordOperations = false, + partialFrames = false, operationsFilter = null }) { this._stats?.time("Overall"); @@ -22220,16 +23094,18 @@ class PDFPageProxy { const complete = error => { intentState.renderTasks.delete(internalRenderTask); if (shouldRecordOperations) { - const recordedBBoxes = internalRenderTask.gfx?.dependencyTracker.take(); + const { + recordedBBoxes + } = internalRenderTask; if (recordedBBoxes) { - internalRenderTask.stepper?.setOperatorBBoxes(recordedBBoxes, internalRenderTask.gfx.dependencyTracker.takeDebugMetadata()); + internalRenderTask.stepper?.setOperatorBBoxes(recordedBBoxes, internalRenderTask.debugMetadata); if (recordOperations) { this.recordedBBoxes = recordedBBoxes; } } } if (shouldRecordImages && !error) { - this.imageCoordinates = internalRenderTask.gfx?.imagesTracker.take(); + this.imageCoordinates = internalRenderTask.imageCoordinates; } if (intentPrint) { this.#pendingCleanup = true; @@ -22252,41 +23128,37 @@ class PDFPageProxy { } } }; - let dependencyTracker = null; - let bboxTracker = null; - if (shouldRecordOperations || shouldRecordImages) { - bboxTracker = new CanvasBBoxTracker(canvas, intentState.operatorList.length); - } - if (shouldRecordOperations) { - dependencyTracker = new CanvasDependencyTracker(bboxTracker, recordForDebugger); - } const internalRenderTask = new InternalRenderTask({ callback: complete, params: { canvas, canvasContext, - dependencyTracker: dependencyTracker ?? bboxTracker, - imagesTracker: shouldRecordImages ? new CanvasImagesTracker(canvas) : null, viewport, transform, - background + background, + recordOperations: shouldRecordOperations, + recordImages: shouldRecordImages, + partialFrames, + recordForDebugger }, objs: this.objs, commonObjs: this.commonObjs, annotationCanvasMap, operatorList: intentState.operatorList, pageIndex: this._pageIndex, + pageProxyId: this._id, canvasFactory: this._transport.canvasFactory, filterFactory: this._transport.filterFactory, useRequestAnimationFrame: !intentPrint, pdfBug: this._pdfBug, pageColors, - enableHWA: this._transport.enableHWA, - operationsFilter + operationsFilter, + rendererWorker: this._transport.rendererWorker, + waitForGPU: () => this._transport.waitForGPU() }); (intentState.renderTasks ||= new Set()).add(internalRenderTask); const renderTask = internalRenderTask.task; - Promise.all([intentState.displayReadyCapability.promise, optionalContentConfigPromise]).then(([transparency, optionalContentConfig]) => { + Promise.all([intentState.displayReadyCapability.promise, optionalContentConfigPromise]).then(async ([transparency, optionalContentConfig]) => { if (this.destroyed) { complete(); return; @@ -22295,7 +23167,7 @@ class PDFPageProxy { if (!(optionalContentConfig.renderingIntent & renderingIntent)) { throw new Error("Must use the same `intent`-argument when calling the `PDFPageProxy.render` " + "and `PDFDocumentProxy.getOptionalContentConfig` methods."); } - internalRenderTask.initializeGraphics({ + await internalRenderTask.initializeGraphics({ transparency, optionalContentConfig }); @@ -22354,12 +23226,20 @@ class PDFPageProxy { return this.getXfa().then(xfa => XfaText.textContent(xfa)); } const readableStream = this.streamTextContent(params); + const reader = readableStream.getReader(); const textContent = { items: [], styles: Object.create(null), lang: null }; - for await (const value of readableStream) { + while (true) { + const { + value, + done + } = await reader.read(); + if (done) { + break; + } textContent.lang ??= value.lang; Object.assign(textContent.styles, value.styles); textContent.items.push(...value.items); @@ -22387,6 +23267,7 @@ class PDFPageProxy { } } this.objs.clear(); + this._transport.cleanupPage(this._id); this.#pendingCleanup = false; return Promise.all(waitOn); } @@ -22412,6 +23293,7 @@ class PDFPageProxy { } this._intentStates.clear(); this.objs.clear(); + this._transport.cleanupPage(this._id); this.#pendingCleanup = false; return true; } @@ -22558,20 +23440,6 @@ class PDFWorker { this.#isWorkerDisabled = true; GlobalWorkerOptions.workerSrc ||= "./pdf.worker.mjs"; } - this._isSameOrigin = (baseUrl, otherUrl) => { - const base = URL.parse(baseUrl); - if (!base?.origin || base.origin === "null") { - return false; - } - const other = new URL(otherUrl, base); - return base.origin === other.origin; - }; - this._createCDNWrapper = url => { - const wrapper = `await import("${url}");`; - return URL.createObjectURL(new Blob([wrapper], { - type: "text/javascript" - })); - }; } constructor({ name = null, @@ -22617,14 +23485,11 @@ class PDFWorker { this.#setupFakeWorker(); return; } - let { + const { workerSrc } = PDFWorker; try { - if (!PDFWorker._isSameOrigin(window.location, workerSrc)) { - workerSrc = PDFWorker._createCDNWrapper(new URL(workerSrc, window.location).href); - } - const worker = new Worker(workerSrc, { + const worker = new Worker(getWorkerSrc(workerSrc), { type: "module" }); const messageHandler = new MessageHandler("main", "worker", worker); @@ -22732,6 +23597,7 @@ class PDFWorker { class WorkerTransport { downloadInfoCapability = Promise.withResolvers(); #fullReader = null; + #hasMeshPattern = false; #methodPromises = new Map(); #networkStream = null; #pageCache = new Map(); @@ -22748,7 +23614,7 @@ class WorkerTransport { ownerDocument: params.ownerDocument, styleElement: params.styleElement }); - this.enableHWA = params.enableHWA; + this.rendererWorker = params.rendererWorker; this.loadingParams = params.loadingParams; this._params = params; this.canvasFactory = factory.canvasFactory; @@ -22857,6 +23723,7 @@ class WorkerTransport { this.#networkStream?.cancelAllRequests(new AbortException("Worker was terminated.")); this.messageHandler?.destroy(); this.messageHandler = null; + this.rendererWorker = null; this.destroyCapability.resolve(); }, this.destroyCapability.reject); return this.destroyCapability.promise; @@ -22990,64 +23857,39 @@ class WorkerTransport { const page = this.#pageCache.get(data.pageProxyId); page._startRenderPage(data.transparency, data.cacheKey); }); + const objectHandler = new ObjectHandler({ + messageHandler, + commonObjs: this.commonObjs, + fontLoader: this.fontLoader, + pageCache: this.#pageCache, + pdfBug: this._params.pdfBug + }); + this.rendererWorker?.promise.then(() => { + this.rendererWorker?.messageHandler?.on("FontFallback", data => this.destroyed ? null : messageHandler.sendWithPromise("FontFallback", data)); + }, () => {}); messageHandler.on("commonobj", ([id, type, exportedData]) => { if (this.destroyed) { return null; } - if (this.commonObjs.has(id)) { - return null; + const { + rendererWorker + } = this; + if (type === "CopyLocalImage") { + if (this.commonObjs.has(id)) { + return null; + } + const dataLen = objectHandler.resolveCommonObject(id, type, exportedData); + if (dataLen) { + rendererWorker?.sendCommonObj(id, "Image", this.commonObjs.get(id)); + } + return dataLen; } - switch (type) { - case "Font": - if ("error" in exportedData) { - const exportedError = exportedData.error; - warn(`Error during font loading: ${exportedError}`); - this.commonObjs.resolve(id, exportedError); - break; - } - const fontData = new FontInfo(exportedData.buffer); - const inspectFont = this._params.pdfBug && globalThis.FontInspector?.enabled ? (font, url) => globalThis.FontInspector.fontAdded(font, url) : null; - const font = new FontFaceObject(fontData, inspectFont, exportedData.charProcOperatorList, exportedData.extra); - this.fontLoader.bind(font).catch(() => messageHandler.sendWithPromise("FontFallback", { - id - })).finally(() => { - if (!font.fontExtraProperties) { - font.clearData(); - } - this.commonObjs.resolve(id, font); - }); - break; - case "CopyLocalImage": - const { - imageRef - } = exportedData; - util_assert(imageRef, "The imageRef must be defined."); - for (const pageProxy of this.#pageCache.values()) { - for (const [, data] of pageProxy.objs) { - if (data?.ref !== imageRef) { - continue; - } - if (!data.dataLen) { - return null; - } - const copy = structuredClone(data); - this.commonObjs.resolve(id, copy); - return data.dataLen; - } - } - break; - case "FontPath": - this.commonObjs.resolve(id, new FontPathInfo(exportedData)); - break; - case "Image": - this.commonObjs.resolve(id, exportedData); - break; - case "Pattern": - const pattern = new PatternInfo(exportedData); - this.commonObjs.resolve(id, pattern.getIR()); - break; - default: - throw new Error(`Got unknown common object type ${type}`); + rendererWorker?.sendCommonObj(id, type, exportedData); + if (!this.commonObjs.has(id)) { + objectHandler.resolveCommonObject(id, type, exportedData); + if (type === "Pattern" && this.commonObjs.get(id)[0] === "Mesh") { + this.#hasMeshPattern = true; + } } return null; }); @@ -23055,21 +23897,11 @@ class WorkerTransport { if (this.destroyed) { return; } - const pageProxy = this.#pageCache.get(pageProxyId); - if (pageProxy.objs.has(id)) { - return; + if (type === "Pattern" && imageData[0] === "Mesh") { + this.#hasMeshPattern = true; } - if (pageProxy._intentStates.size === 0) { - imageData?.bitmap?.close(); - return; - } - switch (type) { - case "Image": - case "Pattern": - pageProxy.objs.resolve(id, imageData); - break; - default: - throw new Error(`Got unknown object type ${type}`); + if (objectHandler.resolveObject(id, pageProxyId, type, imageData)) { + this.rendererWorker?.sendObj(id, pageProxyId, type, imageData); } }); messageHandler.on("DocProgress", data => { @@ -23162,6 +23994,9 @@ class WorkerTransport { this.annotationStorage.resetModified(); }); } + waitForGPU() { + return this._params.enableWebGPU && this.#hasMeshPattern && !isGPUReady() ? initGPU() : null; + } getPage(pageNumber) { if (!Number.isInteger(pageNumber) || pageNumber <= 0 || pageNumber > this.pagesMapper.pagesNumber) { return Promise.reject(new Error("Invalid page request.")); @@ -23275,7 +24110,11 @@ class WorkerTransport { return this.messageHandler.sendWithPromise("GetOutline", null); } getOptionalContentConfig(renderingIntent) { - return this.#cacheSimpleMethod("GetOptionalContentConfig").then(data => new OptionalContentConfig(data, renderingIntent)); + const name = "GetOptionalContentConfig"; + return this.#methodPromises.getOrInsertComputed(name, () => this.messageHandler.sendWithPromise(name, null).catch(reason => { + warn(`${name}: "${reason}".`); + return null; + })).then(data => new OptionalContentConfig(data, renderingIntent)); } getPermissions() { return this.messageHandler.sendWithPromise("GetPermissions", null); @@ -23308,10 +24147,19 @@ class WorkerTransport { if (!keepLoadedFonts) { this.fontLoader.clear(); } + this.rendererWorker?.cleanup(keepLoadedFonts); this.#methodPromises.clear(); this.filterFactory.destroy(true); TextLayer.cleanup(); } + cleanupPage(pageProxyId) { + if (!this.destroyed) { + this.messageHandler.send("CleanupPage", { + pageProxyId + }); + } + this.rendererWorker?.cleanupPage(pageProxyId); + } cachedPageNumber(ref) { if (!isRefProxy(ref)) { return null; @@ -23331,6 +24179,7 @@ class RenderTask { _internalRenderTask = null; onContinue = null; onError = null; + onFrame = null; constructor(internalRenderTask) { this._internalRenderTask = internalRenderTask; } @@ -23355,9 +24204,16 @@ class RenderTask { get imageCoordinates() { return this._internalRenderTask.imageCoordinates || null; } + get isWorkerRendering() { + return this._internalRenderTask.isWorkerRendering; + } } class InternalRenderTask { + #dependencyTracker = null; + #imagesTracker = null; #rAF = null; + #rendererTask = null; + #waitForGPU = null; static #canvasInUse = new WeakSet(); constructor({ callback, @@ -23367,13 +24223,15 @@ class InternalRenderTask { annotationCanvasMap, operatorList, pageIndex, + pageProxyId, canvasFactory, filterFactory, useRequestAnimationFrame = false, pdfBug = false, pageColors = null, - enableHWA = false, - operationsFilter = null + operationsFilter = null, + rendererWorker = null, + waitForGPU = null }) { this.callback = callback; this.params = params; @@ -23400,15 +24258,35 @@ class InternalRenderTask { this._nextBound = this._next.bind(this); this._canvas = params.canvas; this._canvasContext = params.canvas ? null : params.canvasContext; - this._enableHWA = enableHWA; - this._dependencyTracker = params.dependencyTracker; - this._imagesTracker = params.imagesTracker; this._operationsFilter = operationsFilter; + this.#waitForGPU = waitForGPU; + this.#rendererTask = rendererWorker?.createRenderTask({ + pageProxyId, + operatorList, + params, + pageColors, + canvasFactory, + annotationCanvasMap, + onFrame: () => this.task.onFrame?.(), + onError: reason => this.cancel(reason) + }) ?? null; } get completed() { return this.capability.promise.catch(() => {}); } - initializeGraphics({ + get isWorkerRendering() { + return !!this.#rendererTask; + } + get imageCoordinates() { + return this.#rendererTask ? this.#rendererTask.imageCoordinates : this.#imagesTracker?.take(); + } + get recordedBBoxes() { + return this.#rendererTask ? this.#rendererTask.recordedBBoxes : this.#dependencyTracker?.take(); + } + get debugMetadata() { + return this.#dependencyTracker?.takeDebugMetadata() ?? null; + } + async initializeGraphics({ transparency = false, optionalContentConfig }) { @@ -23426,26 +24304,45 @@ class InternalRenderTask { this.stepper.init(this.operatorList); this.stepper.nextBreakPoint = this.stepper.getNextBreakPoint(); } - const { - viewport, - transform, - background, - dependencyTracker, - imagesTracker - } = this.params; - const canvasContext = this._canvasContext || this._canvas.getContext("2d", { - alpha: false, - willReadFrequently: !this._enableHWA - }); - this.gfx = new CanvasGraphics(canvasContext, this.commonObjs, this.objs, this.canvasFactory, this.filterFactory, { - optionalContentConfig - }, this.annotationCanvasMap, this.pageColors, dependencyTracker, imagesTracker); - this.gfx.beginDrawing({ - transform, - viewport, - transparency, - background - }); + if (this.#rendererTask) { + const initialized = await this.#rendererTask.initialize(transparency, optionalContentConfig); + if (this.cancelled) { + return; + } + if (!initialized) { + this.#rendererTask = null; + } + } + if (!this.#rendererTask) { + const { + viewport, + transform, + background, + recordOperations, + recordImages, + recordForDebugger + } = this.params; + const canvasContext = this._canvasContext || this.canvasFactory.getNoAlphaContext(this._canvas); + const { + dependencyTracker, + imagesTracker + } = createCanvasTrackers(this._canvas, this.operatorList.fnArray.length, { + recordOperations, + recordImages, + recordDebugMetadata: recordForDebugger + }); + this.#dependencyTracker = dependencyTracker; + this.#imagesTracker = imagesTracker; + this.gfx = new CanvasGraphics(canvasContext, this.commonObjs, this.objs, this.canvasFactory, this.filterFactory, { + optionalContentConfig + }, this.annotationCanvasMap, this.pageColors, dependencyTracker, imagesTracker); + this.gfx.beginDrawing({ + transform, + viewport, + transparency, + background + }); + } this.operatorListIdx = 0; this.graphicsReady = true; this.graphicsReadyCallback?.(); @@ -23453,6 +24350,7 @@ class InternalRenderTask { cancel(error = null, extraDelay = 0) { this.running = false; this.cancelled = true; + this.#rendererTask?.cancel(); this.gfx?.endDrawing(); if (this.#rAF) { window.cancelAnimationFrame(this.#rAF); @@ -23468,7 +24366,7 @@ class InternalRenderTask { this.graphicsReadyCallback ||= this._continueBound; return; } - this.gfx.dependencyTracker?.growOperationsCount(this.operatorList.fnArray.length); + this.#dependencyTracker?.growOperationsCount(this.operatorList.fnArray.length); this.stepper?.updateOperatorList(this.operatorList); if (this.running) { return; @@ -23500,19 +24398,45 @@ class InternalRenderTask { if (this.cancelled) { return; } - this.operatorListIdx = this.gfx.executeOperatorList(this.operatorList, this.operatorListIdx, this._continueBound, this.stepper, this._operationsFilter); - if (this.operatorListIdx === this.operatorList.argsArray.length) { + if (!this.#rendererTask) { + const gpuPromise = this.#waitForGPU?.(); + if (gpuPromise) { + await gpuPromise; + if (this.cancelled) { + return; + } + } + } + const { + operatorList + } = this; + const { + lastChunk + } = operatorList; + if (this.#rendererTask) { + this.operatorListIdx = await this.#rendererTask.executeOperatorList(operatorList, this.operatorListIdx, this._operationsFilter); + if (this.cancelled) { + return; + } + if (this.operatorListIdx !== operatorList.argsArray.length || lastChunk !== operatorList.lastChunk) { + this._continue(); + return; + } + } else { + this.operatorListIdx = this.gfx.executeOperatorList(operatorList, this.operatorListIdx, this._continueBound, null, this.stepper, this._operationsFilter); + } + if (this.operatorListIdx === operatorList.argsArray.length) { this.running = false; - if (this.operatorList.lastChunk) { - this.gfx.endDrawing(); + if (lastChunk) { + this.gfx?.endDrawing(); InternalRenderTask.#canvasInUse.delete(this._canvas); this.callback(); } } } } -const api_version = "6.4.299"; -const build = "d0991a0d5"; +const api_version = "6.5.438"; +const build = "0a4153349"; ;// ./node_modules/core-js/modules/es.math.sum-precise.js es_math_sum_precise_namespaceFn(); @@ -23521,6 +24445,7 @@ es_math_sum_precise_namespaceFn(); + class ColorPicker { #button = null; #buttonSwatch = null; @@ -24046,9 +24971,9 @@ class AnnotationElement { this.downloadManager = parameters.downloadManager; this.imageResourcesPath = parameters.imageResourcesPath; this.renderForms = parameters.renderForms; - this.svgFactory = parameters.svgFactory; this.annotationStorage = parameters.annotationStorage; this.enableComment = parameters.enableComment; + this.enableAnnotationEditing = parameters.enableAnnotationEditing !== false; this.enableScripting = parameters.enableScripting; this.hasJSActions = parameters.hasJSActions; this._fieldObjects = parameters.fieldObjects; @@ -24067,8 +24992,11 @@ class AnnotationElement { }) { return !!(contentsObj?.str || richText?.str); } + static get _svgFactory() { + return util_shadow(this, "_svgFactory", new DOMSVGFactory()); + } get _isEditable() { - return this.data.isEditable; + return this.enableAnnotationEditing && this.data.isEditable; } get hasPopupData() { return AnnotationElement._hasPopupData(this.data) || this.enableComment && !!this.commentText; @@ -24496,9 +25424,7 @@ class AnnotationElement { } const width = rectTrX - rectBlX; const height = rectTrY - rectBlY; - const { - svgFactory - } = this; + const svgFactory = AnnotationElement._svgFactory; const svg = svgFactory.createElement("svg"); svg.classList.add("quadrilateralsContainer"); svg.setAttribute("width", 0); @@ -26565,8 +27491,9 @@ class LineAnnotationElement extends AnnotationElement { width, height } = this; - const svg = this.svgFactory.create(width, height, true); - const line = this.#line = this.svgFactory.createElement("svg:line"); + const svgFactory = AnnotationElement._svgFactory; + const svg = svgFactory.create(width, height, true); + const line = this.#line = svgFactory.createElement("svg:line"); line.setAttribute("x1", data.rect[2] - data.lineCoordinates[0]); line.setAttribute("y1", data.rect[3] - data.lineCoordinates[1]); line.setAttribute("x2", data.rect[2] - data.lineCoordinates[2]); @@ -26604,9 +27531,10 @@ class SquareAnnotationElement extends AnnotationElement { width, height } = this; - const svg = this.svgFactory.create(width, height, true); + const svgFactory = AnnotationElement._svgFactory; + const svg = svgFactory.create(width, height, true); const borderWidth = data.borderStyle.width; - const square = this.#square = this.svgFactory.createElement("svg:rect"); + const square = this.#square = svgFactory.createElement("svg:rect"); square.setAttribute("x", borderWidth / 2); square.setAttribute("y", borderWidth / 2); square.setAttribute("width", width - borderWidth); @@ -26644,9 +27572,10 @@ class CircleAnnotationElement extends AnnotationElement { width, height } = this; - const svg = this.svgFactory.create(width, height, true); + const svgFactory = AnnotationElement._svgFactory; + const svg = svgFactory.create(width, height, true); const borderWidth = data.borderStyle.width; - const circle = this.#circle = this.svgFactory.createElement("svg:ellipse"); + const circle = this.#circle = svgFactory.createElement("svg:ellipse"); circle.setAttribute("cx", width / 2); circle.setAttribute("cy", height / 2); circle.setAttribute("rx", width / 2 - borderWidth / 2); @@ -26694,7 +27623,8 @@ class PolylineAnnotationElement extends AnnotationElement { if (!vertices) { return this.container; } - const svg = this.svgFactory.create(width, height, true); + const svgFactory = AnnotationElement._svgFactory; + const svg = svgFactory.create(width, height, true); let points = []; for (let i = 0, ii = vertices.length; i < ii; i += 2) { const x = vertices[i] - rect[0]; @@ -26702,7 +27632,7 @@ class PolylineAnnotationElement extends AnnotationElement { points.push(`${x},${y}`); } points = points.join(" "); - const polyline = this.#polyline = this.svgFactory.createElement(this.svgElementName); + const polyline = this.#polyline = svgFactory.createElement(this.svgElementName); polyline.setAttribute("points", points); polyline.setAttribute("stroke-width", borderStyle.width || 1); polyline.setAttribute("stroke", "transparent"); @@ -26801,8 +27731,9 @@ class InkAnnotationElement extends AnnotationElement { width, height } = this.#getTransform(rotation, rect); - const svg = this.svgFactory.create(width, height, true); - const g = this.#polylinesGroupElement = this.svgFactory.createElement("svg:g"); + const svgFactory = AnnotationElement._svgFactory; + const svg = svgFactory.create(width, height, true); + const g = this.#polylinesGroupElement = svgFactory.createElement("svg:g"); svg.append(g); g.setAttribute("stroke-width", borderStyle.width || 1); g.setAttribute("stroke-linecap", "round"); @@ -26812,7 +27743,7 @@ class InkAnnotationElement extends AnnotationElement { g.setAttribute("fill", "transparent"); g.setAttribute("transform", transform); for (const inkList of inkLists) { - const polyline = this.svgFactory.createElement(this.svgElementName); + const polyline = svgFactory.createElement(this.svgElementName); this.#polylines.push(polyline); polyline.setAttribute("points", inkList.join(",")); g.append(polyline); @@ -27238,9 +28169,9 @@ class AnnotationLayer { downloadManager: params.downloadManager, imageResourcesPath: params.imageResourcesPath || "", renderForms: params.renderForms !== false, - svgFactory: new DOMSVGFactory(), annotationStorage: this.#annotationStorage, enableComment: params.enableComment === true, + enableAnnotationEditing: params.enableAnnotationEditing !== false, enableScripting: params.enableScripting === true, hasJSActions: params.hasJSActions, fieldObjects: params.fieldObjects, @@ -27393,7 +28324,6 @@ class AnnotationLayer { data: null, layer: this.div, linkService: this.#linkService, - svgFactory: new DOMSVGFactory(), parent: this }; for (const data of annotations) { @@ -28545,7 +29475,7 @@ class DrawingEditor extends AnnotationEditor { return true; } onceAdded(focus) { - if (!this.annotationElementId) { + if (!this.annotationElementId && this._drawId !== null) { this.parent.addUndoableEditor(this); } this._isDraggable = true; @@ -28905,7 +29835,7 @@ class DrawingEditor extends AnnotationEditor { parent.toggleDrawing(); uiManager._editorUndoBar?.hide(); if (DrawingEditor.#currentDraw) { - parent.drawLayer.updateProperties(this._currentDrawId, DrawingEditor.#currentDraw.startNew(x, y, parentWidth, parentHeight, rotation)); + parent.drawLayer.updateProperties(this._currentDrawId, DrawingEditor.#currentDraw.startNew(x, y, parentWidth, parentHeight, rotation, event.timeStamp)); return; } uiManager.updateUIForDefaultProperties(this); @@ -28915,7 +29845,8 @@ class DrawingEditor extends AnnotationEditor { box: [boxX, boxY, parentWidth, parentHeight], rotation, parent, - isLTR + isLTR, + timeStamp: event.timeStamp }); DrawingEditor.#currentDrawingOptions = this.getDefaultDrawingOptions(); this._currentParent = parent; @@ -28939,12 +29870,14 @@ class DrawingEditor extends AnnotationEditor { const coalesced = event.getCoalescedEvents?.(); if (coalesced?.length) { const points = []; + const timeStamps = []; for (const sample of coalesced) { points.push(...this._getPointerCoords(sample, event)); + timeStamps.push(sample.timeStamp); } - properties = DrawingEditor.#currentDraw.addPoints(points); + properties = DrawingEditor.#currentDraw.addPoints(points, timeStamps); } else { - properties = DrawingEditor.#currentDraw.add(...this._getPointerCoords(event)); + properties = DrawingEditor.#currentDraw.add(...this._getPointerCoords(event), event.timeStamp); } this._currentParent.drawLayer.updateProperties(this._currentDrawId, properties); CurrentPointers.setTimeStamp(event.timeStamp); @@ -28972,7 +29905,7 @@ class DrawingEditor extends AnnotationEditor { } parent.toggleDrawing(true); this._cleanup(false); - parent.drawLayer.updateProperties(this._currentDrawId, event?.target === parent.div ? DrawingEditor.#currentDraw.end(...this._getPointerCoords(event)) : DrawingEditor.#currentDraw.end()); + parent.drawLayer.updateProperties(this._currentDrawId, event?.target === parent.div ? DrawingEditor.#currentDraw.end(...this._getPointerCoords(event), event.timeStamp) : DrawingEditor.#currentDraw.end()); if (this.supportMultipleDrawings) { const draw = DrawingEditor.#currentDraw; const drawId = this._currentDrawId; @@ -29063,6 +29996,7 @@ class DrawingEditor extends AnnotationEditor { ;// ./src/display/editor/drawers/outline.js + class Outline { static PRECISION = 1e-4; focusOutline = null; @@ -29146,20 +30080,30 @@ class Outline { static svgRound(x) { return Math.round(x * 10000); } - static _normalizePoint(x, y, parentWidth, parentHeight, rotation) { + static _normalizePoint(x, y, parentWidth, parentHeight, rotation, dest = []) { switch (rotation) { case 90: - return [1 - y / parentWidth, x / parentHeight]; + dest[0] = 1 - y / parentWidth; + dest[1] = x / parentHeight; + break; case 180: - return [1 - x / parentWidth, 1 - y / parentHeight]; + dest[0] = 1 - x / parentWidth; + dest[1] = 1 - y / parentHeight; + break; case 270: - return [y / parentWidth, 1 - x / parentHeight]; + dest[0] = y / parentWidth; + dest[1] = 1 - x / parentHeight; + break; default: - return [x / parentWidth, y / parentHeight]; + dest[0] = x / parentWidth; + dest[1] = y / parentHeight; + break; } + return dest; } - static createBezierPoints(x1, y1, x2, y2, x3, y3) { - return [(x1 + 5 * x2) / 6, (y1 + 5 * y2) / 6, (5 * x2 + x3) / 6, (5 * y2 + y3) / 6, (x2 + x3) / 2, (y2 + y3) / 2]; + static createBezierPoints(x1, y1, x2, y2, x3, y3, dest = []) { + dest.push((x1 + 5 * x2) / 6, (y1 + 5 * y2) / 6, (5 * x2 + x3) / 6, (5 * y2 + y3) / 6, (x2 + x3) / 2, (y2 + y3) / 2); + return dest; } } @@ -30459,6 +31403,110 @@ class HighlightEditor extends DrawingEditor { } } +;// ./src/display/editor/drawers/input_smoother.js + +class InputSmoother { + static #HALF_WINDOW = 10; + static #UPSAMPLING_PERIOD = 1000 / 180; + static #MAX_DIVISIONS = 100; + static #TIME_EPSILON = 1e-3; + #samples; + #firstTime; + #lastTime; + constructor(x, y, timeStamp) { + this.#samples = [x, y, timeStamp]; + this.#firstTime = this.#lastTime = timeStamp; + } + add(x, y, timeStamp) { + const samples = this.#samples; + const lastTime = samples.at(-1); + timeStamp = timeStamp > lastTime ? timeStamp : lastTime + InputSmoother.#TIME_EPSILON; + samples.push(x, y, timeStamp); + const points = this.#smooth(timeStamp - InputSmoother.#HALF_WINDOW, true); + const start = this.#getSampleIndex(this.#lastTime - InputSmoother.#HALF_WINDOW); + if (start >= samples.length / 2) { + samples.copyWithin(0, start); + samples.length -= start; + } + return points; + } + get pendingPoints() { + return this.#smooth(Infinity, false); + } + end() { + return this.#smooth(Infinity, true); + } + #smooth(maxTime, isStable) { + const samples = this.#samples; + const firstTime = this.#firstTime; + const lastTime = samples.at(-1); + const points = []; + const time = this.#lastTime; + for (let i = this.#getSampleIndex(time) + 3; i < samples.length; i += 3) { + const startTime = samples[i - 1]; + const dt = samples[i + 2] - startTime; + const n = Math.min(Math.ceil(dt / InputSmoother.#UPSAMPLING_PERIOD), InputSmoother.#MAX_DIVISIONS); + for (let k = 1; k <= n; k++) { + const t = k === n ? samples[i + 2] : startTime + dt * k / n; + if (t <= time) { + continue; + } + if (t > maxTime) { + return points; + } + const halfWindow = Math.min(InputSmoother.#HALF_WINDOW, t - firstTime, lastTime - t); + this.#average(t - halfWindow, t + halfWindow, points); + if (isStable) { + this.#lastTime = t; + } + } + } + return points; + } + #getSampleIndex(time) { + const samples = this.#samples; + let start = 0; + let end = samples.length / 3 - 1; + while (start < end) { + const middle = start + end + 1 >> 1; + if (samples[3 * middle + 2] <= time) { + start = middle; + } else { + end = middle - 1; + } + } + return 3 * start; + } + #average(startTime, endTime, points) { + const samples = this.#samples; + const index = this.#getSampleIndex(startTime); + let sumX = 0, + sumY = 0, + duration = 0; + for (let i = index; i < samples.length - 3 && samples[i + 2] < endTime; i += 3) { + const x1 = samples[i], + y1 = samples[i + 1], + t1 = samples[i + 2], + t2 = samples[i + 5]; + const start = Math.max(t1, startTime); + const end = Math.min(t2, endTime); + if (end <= start) { + continue; + } + const dt = end - start; + const ratio = (start + end - 2 * t1) / (t2 - t1); + sumX += dt * (x1 + ratio * (samples[i + 3] - x1) / 2); + sumY += dt * (y1 + ratio * (samples[i + 4] - y1) / 2); + duration += dt; + } + if (duration === 0) { + points.push(samples[index], samples[index + 1]); + } else { + points.push(sumX / duration, sumY / duration); + } + } +} + ;// ./src/display/editor/drawers/inkdraw.js @@ -30467,72 +31515,90 @@ class HighlightEditor extends DrawingEditor { + +function svgPoint(data, i) { + return `${Outline.svgRound(data[i])} ${Outline.svgRound(data[i + 1])}`; +} +function pushCurves(buffer, line, start) { + for (let i = start, ii = line.length; i < ii; i += 6) { + buffer.push(`C${svgPoint(line, i)} ${svgPoint(line, i + 2)} ${svgPoint(line, i + 4)}`); + } +} +function lineToSVGPath(line) { + const start = `M${svgPoint(line, 4)}`; + if (line.length === 6) { + return `${start}Z`; + } + if (line.length === 12 && isNaN(line[6])) { + return `${start}L${svgPoint(line, 10)}`; + } + const buffer = [start]; + pushCurves(buffer, line, 6); + return buffer.join(""); +} class InkDrawOutliner { #last = new Float64Array(6); #tip = new Float64Array(2); #line; #lines; #rotation; + #smoother = null; #thickness; #points; + #inputCount = 1; + #lastInput = new Float64Array(2); #lastSVGPath = ""; #lastIndex = 0; #outlines = new InkDrawOutline(); #parentWidth; #parentHeight; - constructor(x, y, parentWidth, parentHeight, rotation, thickness) { + constructor(x, y, parentWidth, parentHeight, rotation, thickness, timeStamp) { this.#parentWidth = parentWidth; this.#parentHeight = parentHeight; this.#rotation = rotation; this.#thickness = thickness; - [x, y] = this.#normalizePoint(x, y); + this.#lines = []; + this.#startLine(x, y, timeStamp); + } + #startLine(x, y, timeStamp) { + [x, y] = this.#normalizeToTip(x, y); const line = this.#line = [NaN, NaN, NaN, NaN, x, y]; this.#points = [x, y]; - this.#lines = [{ + this.#lines.push({ line, points: this.#points - }]; + }); this.#last.set(line, 0); - this.#tip.set([x, y], 0); + this.#lastIndex = 0; + this.#inputCount = 1; + this.#lastInput.set(this.#tip); + this.#smoother = timeStamp === undefined ? null : new InputSmoother(x, y, timeStamp); } updateProperty(name, value) { if (name === "stroke-width") { this.#thickness = value; } } - #normalizePoint(x, y) { - return Outline._normalizePoint(x, y, this.#parentWidth, this.#parentHeight, this.#rotation); + #normalizeToTip(x, y) { + return Outline._normalizePoint(x, y, this.#parentWidth, this.#parentHeight, this.#rotation, this.#tip); } isEmpty() { return !this.#lines?.length; } isCancellable() { - return this.#points.length <= 10; + return this.#inputCount <= 5; } - add(x, y) { - if (this.#add(x, y)) { - this.toSVGPath(); - } + add(x, y, timeStamp) { + this.#addSample(x, y, timeStamp); return { path: { d: this.#toSVGPathWithTip() } }; } - addPoints(points) { - let needsPathUpdate = false; + addPoints(points, timeStamps) { for (let i = 0, ii = points.length; i < ii; i += 2) { - if (!this.#add(points[i], points[i + 1])) { - continue; - } - needsPathUpdate = true; - if (this.#points.length <= 6) { - this.toSVGPath(); - needsPathUpdate = false; - } - } - if (needsPathUpdate) { - this.toSVGPath(); + this.#addSample(points[i], points[i + 1], timeStamps?.[i / 2]); } return { path: { @@ -30540,70 +31606,97 @@ class InkDrawOutliner { } }; } - #add(x, y) { - [x, y] = this.#normalizePoint(x, y); - this.#tip.set([x, y], 0); - const [x1, y1, x2, y2] = this.#last.subarray(2, 6); - const diffX = x - x2; - const diffY = y - y2; - const d = Math.hypot(this.#parentWidth * diffX, this.#parentHeight * diffY); - if (d <= 2) { - return false; + #addSample(x, y, timeStamp) { + [x, y] = this.#normalizeToTip(x, y); + const [lastX, lastY] = this.#lastInput; + if (!this.#isTooClose(x, y, lastX, lastY)) { + this.#inputCount++; + this.#lastInput.set(this.#tip); + } + if (this.#smoother) { + this.#addSmoothedPoints(this.#smoother.add(x, y, timeStamp)); + } else { + this.#addPoint(x, y); + } + } + #isTooClose(x, y, lastX, lastY) { + return Math.hypot(this.#parentWidth * (x - lastX), this.#parentHeight * (y - lastY)) <= 2; + } + #addSmoothedPoints(points) { + for (let i = 0, ii = points.length; i < ii; i += 2) { + this.#addPoint(points[i], points[i + 1]); + } + } + #addPoint(x, y) { + const [,, x1, y1, x2, y2] = this.#last; + if (this.#isTooClose(x, y, x2, y2)) { + return; } this.#points.push(x, y); if (isNaN(x1)) { - this.#last.set([x2, y2, x, y], 2); this.#line.push(NaN, NaN, NaN, NaN, x, y); - return true; + } else { + if (isNaN(this.#last[0])) { + this.#line.splice(6, 6); + } + Outline.createBezierPoints(x1, y1, x2, y2, x, y, this.#line); } - if (isNaN(this.#last[0])) { - this.#line.splice(6, 6); + this.#last.copyWithin(0, 2); + this.#last[4] = x; + this.#last[5] = y; + } + #updatePath() { + const line = this.#line; + if (this.#points.length < 6 || this.#lastIndex === line.length) { + return; } - this.#last.set([x1, y1, x2, y2, x, y], 0); - this.#line.push(...Outline.createBezierPoints(x1, y1, x2, y2, x, y)); - return true; + const buffer = [this.#lastSVGPath]; + if (this.#lastIndex === 0) { + buffer.push(`M${svgPoint(line, 4)}`); + this.#lastIndex = 6; + } + pushCurves(buffer, line, this.#lastIndex); + this.#lastSVGPath = buffer.join(""); + this.#lastIndex = line.length; } - end(x, y) { - if (x !== undefined && this.#add(x, y)) { - return { - path: { - d: this.toSVGPath() - } - }; + #endLine() { + if (!this.#line) { + return; } - if (this.#points.length === 2) { - return { - path: { - d: this.toSVGPath() - } - }; + if (this.#smoother) { + this.#addSmoothedPoints(this.#smoother.end()); + this.#smoother = null; + } + if (this.#points.length < 6) { + this.#lastSVGPath += lineToSVGPath(this.#line); + } else { + const [,, x1, y1, x2, y2] = this.#last; + Outline.createBezierPoints(x1, y1, x2, y2, x2, y2, this.#line); + this.#updatePath(); } + this.#line = this.#points = null; + } + end(x, y, timeStamp) { + if (this.#line && x !== undefined) { + this.#addSample(x, y, timeStamp); + } + this.#endLine(); return { path: { d: this.#lastSVGPath } }; } - startNew(x, y, parentWidth, parentHeight, rotation) { + startNew(x, y, parentWidth, parentHeight, rotation, timeStamp) { this.#parentWidth = parentWidth; this.#parentHeight = parentHeight; this.#rotation = rotation; - [x, y] = this.#normalizePoint(x, y); - const line = this.#line = [NaN, NaN, NaN, NaN, x, y]; - this.#points = [x, y]; - this.#tip.set([x, y], 0); const last = this.#lines.at(-1); if (last) { last.line = new Float32Array(last.line); last.points = new Float32Array(last.points); } - this.#lines.push({ - line, - points: this.#points - }); - this.#last.set(line, 0); - this.#lastIndex = 0; - this.toSVGPath(); + this.#startLine(x, y, timeStamp); return null; } getLastElement() { @@ -30614,12 +31707,10 @@ class InkDrawOutliner { return this.#outlines.setLastElement(element); } this.#lines.push(element); - this.#line = element.line; - this.#points = element.points; - this.#lastIndex = 0; + this.#lastSVGPath += lineToSVGPath(element.line); return { path: { - d: this.toSVGPath() + d: this.#lastSVGPath } }; } @@ -30627,18 +31718,11 @@ class InkDrawOutliner { if (!this.#lines) { return this.#outlines.removeLastElement(); } + this.#line = this.#points = this.#smoother = null; this.#lines.pop(); - this.#lastSVGPath = ""; - for (let i = 0, ii = this.#lines.length; i < ii; i++) { - const { - line, - points - } = this.#lines[i]; - this.#line = line; - this.#points = points; - this.#lastIndex = 0; - this.toSVGPath(); - } + this.#lastSVGPath = this.#lines.map(({ + line + }) => lineToSVGPath(line)).join(""); return { path: { d: this.#lastSVGPath @@ -30646,48 +31730,25 @@ class InkDrawOutliner { }; } #toSVGPathWithTip() { - const tipX = Outline.svgRound(this.#tip[0]); - const tipY = Outline.svgRound(this.#tip[1]); - if (this.#points.length === 2) { - const firstX = Outline.svgRound(this.#line[4]); - const firstY = Outline.svgRound(this.#line[5]); - return `${this.#lastSVGPath} M ${firstX} ${firstY} L ${tipX} ${tipY}`; - } - return `${this.#lastSVGPath} L ${tipX} ${tipY}`; - } - toSVGPath() { - const firstX = Outline.svgRound(this.#line[4]); - const firstY = Outline.svgRound(this.#line[5]); - if (this.#points.length === 2) { - this.#lastSVGPath = `${this.#lastSVGPath} M ${firstX} ${firstY} Z`; - return this.#lastSVGPath; - } - if (this.#points.length <= 6) { - const i = this.#lastSVGPath.lastIndexOf("M"); - this.#lastSVGPath = `${this.#lastSVGPath.slice(0, i)} M ${firstX} ${firstY}`; - this.#lastIndex = 6; - } - if (this.#points.length === 4) { - const secondX = Outline.svgRound(this.#line[10]); - const secondY = Outline.svgRound(this.#line[11]); - this.#lastSVGPath = `${this.#lastSVGPath} L ${secondX} ${secondY}`; - this.#lastIndex = 12; - return this.#lastSVGPath; - } - const buffer = []; + this.#updatePath(); + const buffer = [this.#lastSVGPath]; if (this.#lastIndex === 0) { - buffer.push(`M ${firstX} ${firstY}`); - this.#lastIndex = 6; + buffer.push(`M${svgPoint(this.#line, 4)}`); + if (this.#points.length === 4) { + buffer.push(`L${svgPoint(this.#line, 10)}`); + } } - for (let i = this.#lastIndex, ii = this.#line.length; i < ii; i += 6) { - const [c1x, c1y, c2x, c2y, x, y] = this.#line.slice(i, i + 6).map(Outline.svgRound); - buffer.push(`C${c1x} ${c1y} ${c2x} ${c2y} ${x} ${y}`); + let points = this.#smoother?.pendingPoints; + if (!points?.length) { + points = this.#tip; } - this.#lastSVGPath += buffer.join(" "); - this.#lastIndex = this.#line.length; - return this.#lastSVGPath; + for (let i = 0, ii = points.length; i < ii; i += 2) { + buffer.push(`L${svgPoint(points, i)}`); + } + return buffer.join(""); } getOutlines(parentWidth, parentHeight, scale, innerMargin) { + this.#endLine(); const last = this.#lines.at(-1); last.line = new Float32Array(last.line); last.points = new Float32Array(last.points); @@ -30750,25 +31811,9 @@ class InkDrawOutline extends Outline { }; } toSVGPath() { - const buffer = []; - for (const { + return this.#lines.map(({ line - } of this.#lines) { - buffer.push(`M${Outline.svgRound(line[4])} ${Outline.svgRound(line[5])}`); - if (line.length === 6) { - buffer.push("Z"); - continue; - } - if (line.length === 12 && isNaN(line[6])) { - buffer.push(`L${Outline.svgRound(line[10])} ${Outline.svgRound(line[11])}`); - continue; - } - for (let i = 6, ii = line.length; i < ii; i += 6) { - const [c1x, c1y, c2x, c2y, x, y] = line.subarray(i, i + 6).map(Outline.svgRound); - buffer.push(`C${c1x} ${c1y} ${c2x} ${c2y} ${x} ${y}`); - } - } - return buffer.join(""); + }) => lineToSVGPath(line)).join(""); } serialize([pageX, pageY, pageWidth, pageHeight], isForCopying) { const serializedLines = []; @@ -30886,13 +31931,14 @@ class InkDrawOutline extends Outline { lines.push(new Float32Array([NaN, NaN, NaN, NaN, point[0], point[1], NaN, NaN, NaN, NaN, point[2], point[3]])); continue; } - const line = new Float32Array(3 * (len - 2)); + const line = new Float32Array(3 * len); lines.push(line); let [x1, y1, x2, y2] = point.subarray(0, 4); line.set([NaN, NaN, NaN, NaN, x1, y1], 0); - for (let i = 4; i < len; i += 2) { - const x = point[i]; - const y = point[i + 1]; + for (let i = 4; i <= len; i += 2) { + const j = Math.min(i, len - 2); + const x = point[j]; + const y = point[j + 1]; line.set(Outline.createBezierPoints(x1, y1, x2, y2, x, y), (i - 2) * 3); [x1, y1, x2, y2] = [x2, y2, x, y]; } @@ -31235,9 +32281,10 @@ class InkEditor extends DrawingEditor { x, y, box: [,, width, height], - rotation + rotation, + timeStamp }) { - return new InkDrawOutliner(x, y, width, height, rotation, this._defaultDrawingOptions["stroke-width"]); + return new InkDrawOutliner(x, y, width, height, rotation, this._defaultDrawingOptions["stroke-width"], timeStamp); } static deserializeDraw(pageX, pageY, pageWidth, pageHeight, innerMargin, data) { return InkDrawOutline.deserialize(pageX, pageY, pageWidth, pageHeight, innerMargin, data); @@ -32114,6 +33161,7 @@ class SignatureEditor extends DrawingEditor { #description = null; #signatureData = null; #signatureUUID = null; + #isWaitingForSignature = false; static _type = "signature"; static _editorType = AnnotationEditorType.SIGNATURE; static _defaultDrawingOptions = null; @@ -32163,6 +33211,10 @@ class SignatureEditor extends DrawingEditor { get isResizable() { return true; } + onceAdded(focus) { + this.#isWaitingForSignature = this._drawId === null; + super.onceAdded(focus); + } onScaleChanging() { if (this._drawId === null) { return; @@ -32332,6 +33384,10 @@ class SignatureEditor extends DrawingEditor { } }); this.div.hidden = false; + if (this.#isWaitingForSignature) { + this.#isWaitingForSignature = false; + this.parent.addUndoableEditor(this); + } } getFromImage(bitmap) { const { @@ -32447,6 +33503,7 @@ class SignatureEditor extends DrawingEditor { + class StampEditor extends AnnotationEditor { #bitmap = null; #bitmapId = null; @@ -33080,7 +34137,16 @@ class StampEditor extends AnnotationEditor { if (changes.isSameAltText) { delete serialized.accessibilityData; } else { - serialized.accessibilityData.structParent = this._initialData.structParent ?? -1; + const structParent = this._initialData.structParent ?? -1; + if (serialized.accessibilityData) { + serialized.accessibilityData.structParent = structParent; + } else if (structParent >= 0) { + serialized.accessibilityData = { + type: "Figure", + alt: "", + structParent + }; + } } serialized.id = this.annotationElementId; delete serialized.bitmapId; @@ -34597,6 +35663,7 @@ class TextLayerImages { + { globalThis._pdfjsTestingUtils = { HighlightOutliner: HighlightOutliner diff --git a/src/build/pdf.mjs.map b/src/build/pdf.mjs.map index 7d457e6..7ea5171 100644 --- a/src/build/pdf.mjs.map +++ b/src/build/pdf.mjs.map @@ -1 +1 @@ -{"version":3,"file":"pdf.mjs","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAa;AACb;;AAEA;AACA;AACA;AACA;;;;;;;;ACNa;AACb;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAS,YAAY;AACrB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AClBa;AACb;AACA;AACA;AACA,WAAW;AACX;;;;;;;;ACLa;AACb;AACA,yCAAyC;;AAEzC;AACA;AACA;AACA;;;;;;;;ACPa;AACb;AACA,oBAAoB,iCAAiC;AACrD,wBAAwB,qCAAqC;AAC7D,2BAA2B,wCAAwC;AACnE,wBAAwB,qCAAqC;AAC7D,2BAA2B,wCAAwC;AACnE,wBAAwB,sCAAsC;AAC9D,gCAAgC,8CAA8C;AAC9E,mBAAmB,gCAAgC;AACnD,uBAAuB,oCAAoC;AAC3D,yBAAyB,uCAAuC;AAChE,uBAAuB,qCAAqC;AAC5D,iBAAiB,8BAA8B;AAC/C,8BAA8B,4CAA4C;AAC1E,oBAAoB,iCAAiC;AACrD,wBAAwB,sCAAsC;AAC9D,qBAAqB,kCAAkC;AACvD,uBAAuB,qCAAqC;AAC5D,mBAAmB,gCAAgC;AACnD,kBAAkB,+BAA+B;AACjD,gBAAgB,6BAA6B;AAC7C,sBAAsB,oCAAoC;AAC1D,wBAAwB,sCAAsC;AAC9D,kBAAkB,+BAA+B;AACjD,0BAA0B,yCAAyC;AACnE,oBAAoB;AACpB;;;;;;;;AC3Ba;AACb;;AAEA;AACA;AACA;AACA;AACA;;;;;;;;ACPa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACTa;AACb;AACA;AACA;AACA;AACA;;;;;;;;ACLa;AACb;AACA;AACA;AACA;AACA;;;;;;;;ACLa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,YAAY;AAC9B,IAAI;AACJ;AACA;AACA;;;;;;;;ACXa;AACb;;;;;;;;ACDa;AACb;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACVa;AACb;;AAEA;AACA;AACA;AACA;AACA;;;;;;;;ACPa;AACb;AACA,SAAS;;;;;;;;ACFI;AACb;AACA;AACA,aAAa;AACb,IAAI;AACJ,aAAa;AACb;AACA;;;;;;;;ACPa;AACb,wBAAwB,mBAAO,CAAC,GAAmC;;AAEnE;;AAEA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACVa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,cAAc;AACvC;AACA;AACA,uCAAuC;AACvC;AACA;AACA;AACA;AACA,uBAAuB;AACvB;AACA;AACA,SAAS;AACT;AACA;AACA;;AAEA;AACA,IAAI;AACJ;AACA;AACA;;;;;;;;AC7Ba;AACb,YAAY,mBAAO,CAAC,GAAyB;;AAE7C;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACTa;AACb,0BAA0B,mBAAO,CAAC,GAAqC;;AAEvE;;AAEA;AACA;AACA;AACA;AACA,mDAAmD;AACnD;;;;;;;;ACVa;AACb,6BAA6B,mBAAO,CAAC,GAAuC;;AAE5E;;AAEA;AACA;AACA;AACA;AACA;;;;;;;;ACTa;AACb,0BAA0B,mBAAO,CAAC,GAAqC;;AAEvE;;AAEA;AACA;AACA;AACA;AACA;;;;;;;;ACTa;AACb;;AAEA;AACA;AACA;AACA;;;;;;;SCNA;SACA;;SAEA;SACA;SACA;SACA;SACA;SACA;SACA;SACA;SACA;SACA;SACA;SACA;SACA;;SAEA;SACA;;SAEA;SACA;SACA;;;;SCtBA,iEAAiE;SACjE;SACA;SACA;SACA;SACA;SACA;SACA;SACA;SACA,WAAW;SACX;SACA;SACA;SACA;SACA,E;;;SCdA;SACA;SACA;SACA;SACA,yCAAyC,wCAAwC;SACjF;SACA;SACA,E;;;SCPA,yF;;;;;;ACAa;AACb,iBAAiB,2BAAmC;AACpD,kBAAkB,6BAAqC;;AAEvD;;AAEA;AACA;AACA;AACA;AACA;;;;;;ACVa;AACb,0BAA0B,qCAA6C;;AAEvE;AACA;;AAEA;AACA;AACA;AACA;;;;;;ACTa;AACb,UAAU,+BAAuC;;AAEjD;AACA;AACA;AACA;AACA;;;;;;;;;;;ACPa;AACb,qBAAqB,gCAAwC;;AAE7D;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;;;;ACXa;AACb,UAAU,oCAA4C;;AAEtD;AACA;AACA;AACA;AACA;;;;;;ACPa;AACb,sBAAsB,iCAAyC;AAC/D,aAAa,6BAAqC;AAClD,qBAAqB,wCAAgD;;AAErE;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;;;;;;ACpBa;AACb,oBAAoB,sCAA8C;;AAElE;;AAEA;AACA;AACA;AACA;;;;;;ACRa;AACb,eAAe,yBAAiC;;AAEhD;AACA;;AAEA;AACA;AACA;AACA;;;;;;ACTa;AACb,eAAe,yBAAiC;;AAEhD;AACA;;AAEA;AACA;AACA;AACA;AACA;;;;;;ACVa;AACb,cAAc,uBAA+B;;AAE7C;;AAEA;AACA;AACA;AACA;AACA;AACA;;;;;;ACVa;AACb;AACA;;;;;;ACFa;AACb,iBAAiB,2BAAmC;AACpD,0BAA0B,8CAAsD;AAChF,cAAc,2BAAmC;;AAEjD;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;ACda;AACb,iBAAiB,2BAAmC;AACpD,0BAA0B,4CAAoD;AAC9E,4BAA4B,wCAAgD;;AAE5E;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;;;;;;AChBa;AACb,iBAAiB,wCAAgD;;AAEjE;;AAEA;AACA;AACA;AACA;;;;;;ACRa;AACb,0BAA0B,4CAAoD;AAC9E,kBAAkB,2BAAmC;AACrD,iBAAiB,2BAAmC;AACpD,iBAAiB,2BAAmC;AACpD,eAAe,yBAAiC;AAChD,aAAa,gCAAwC;AACrD,cAAc,uBAA+B;AAC7C,kBAAkB,6BAAqC;AACvD,kCAAkC,8CAAsD;AACxF,oBAAoB,+BAAuC;AAC3D,4BAA4B,wCAAgD;AAC5E,oBAAoB,sCAA8C;AAClE,qBAAqB,uCAA+C;AACpE,qBAAqB,uCAA+C;AACpE,sBAAsB,iCAAyC;AAC/D,UAAU,mBAA2B;AACrC,0BAA0B,8BAAsC;;AAEhE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA,QAAQ,iBAAiB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,gBAAgB;AACxB;AACA;AACA;AACA;AACA;AACA,QAAQ,gBAAgB;AACxB,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;AChMa;AACb,wBAAwB,oCAA4C;;AAEpE;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;ACTa;AACb,sBAAsB,iCAAyC;AAC/D,sBAAsB,iCAAyC;AAC/D,wBAAwB,oCAA4C;;AAEpE,sBAAsB,mBAAmB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,WAAW,gBAAgB;AACjC;AACA,MAAM;AACN;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;ACjCa;AACb,kBAAkB,2BAAmC;AACrD,cAAc,wBAAgC;;AAE9C;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,iBAAiB;AAC3D,IAAI;AACJ;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA,IAAI;AACJ,EAAE;AACF;AACA;;;;;;AC1Ba;AACb,kBAAkB,qCAA6C;;AAE/D;;;;;;;;;;;ACHa;AACb,eAAe,yBAAiC;AAChD,oBAAoB,8BAAsC;;AAE1D;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;;;;;;ACXa;AACb,kBAAkB,qCAA6C;;AAE/D,6BAA6B;AAC7B;;AAEA;AACA;AACA;;;;;;ACRa;AACb,4BAA4B,qCAA6C;AACzE,iBAAiB,2BAAmC;AACpD,iBAAiB,2BAAmC;AACpD,sBAAsB,iCAAyC;;AAE/D;AACA;;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;;AAEzC;AACA;AACA;AACA,iCAAiC,OAAO,mBAAmB,aAAa;AACxE,CAAC;;;;;;ACPY;AACb,iBAAiB,2BAAmC;AACpD,eAAe,yBAAiC;;AAEhD;AACA;AACA;;AAEA;AACA;AACA;;;;;;;;;;;;;;;;ACVa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;ACVa;AACb,iBAAiB,2BAAmC;;AAEpD;AACA;;AAEA;;;;;;ACNa;AACb,iBAAiB,2BAAmC;AACpD,gBAAgB,sCAA8C;;AAE9D;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;AC3Ba;AACb,kBAAkB,qCAA6C;;AAE/D;AACA;;AAEA,6BAA6B,uCAAuC;AACpE;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAI;AACJ;;;;;;ACfa;AACb,iBAAiB,2BAAmC;AACpD,+BAA+B,oDAA4D;AAC3F,kCAAkC,8CAAsD;AACxF,oBAAoB,+BAAuC;AAC3D,2BAA2B,sCAA8C;AACzE,gCAAgC,2CAAmD;AACnF,eAAe,yBAAiC;;AAEhD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ,kEAAkE;AAClE,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;ACtDa;AACb;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;;;;;;ACPa;AACb,kBAAkB,oCAA4C;;AAE9D;AACA;AACA;;AAEA;AACA;AACA;AACA,CAAC;;;;;;ACVY;AACb,kBAAkB,4CAAoD;AACtE,gBAAgB,0BAAkC;AAClD,kBAAkB,oCAA4C;;AAE9D;;AAEA;AACA;A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ACA;;;;;;ACTa;AACb,gBAAgB,0BAAkC;AAClD,eAAe,yBAAiC;AAChD,WAAW,6BAAqC;AAChD,0BAA0B,sCAA8C;AACxE,wBAAwB,mCAA2C;;AAEnE;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;ACvCa;AACb;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,cAAc;;;;;;ACflB;AACb,kBAAkB,qCAA6C;AAC/D,eAAe,yBAAiC;;AAEhD,mCAAmC;;AAEnC;AACA;AACA;AACA;AACA;AACA;;;;;;ACXa;AACb;;;;;;ACDa;AACb,iBAAiB,4BAAoC;;AAErD;;;;;;ACHa;AACb,kBAAkB,2BAAmC;AACrD,YAAY,qBAA6B;AACzC,oBAAoB,uCAA+C;;AAEnE;AACA;AACA;AACA;AACA,uBAAuB;AACvB,GAAG;AACH,CAAC;;;;;;ACXY;AACb,kBAAkB,qCAA6C;AAC/D,YAAY,qBAA6B;AACzC,cAAc,2BAAmC;;AAEjD;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA,EAAE;;;;;;ACfW;AACb,iBAAiB,2BAAmC;AACpD,eAAe,yBAAiC;AAChD,qBAAqB,uCAA+C;;AAEpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;AClBa;AACb,kBAAkB,qCAA6C;AAC/D,iBAAiB,2BAAmC;AACpD,YAAY,4BAAoC;;AAEhD;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;ACda;AACb,sBAAsB,wCAAgD;AACtE,iBAAiB,2BAAmC;AACpD,eAAe,yBAAiC;AAChD,kCAAkC,8CAAsD;AACxF,aAAa,gCAAwC;AACrD,aAAa,4BAAoC;AACjD,gBAAgB,0BAAkC;AAClD,iBAAiB,2BAAmC;;AAEpD;AACA;AACA;AACA;;AAEA;AACA,uCAAuC;AACvC;;AAEA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;ACtEa;AACb,sBAAsB,iCAAyC;AAC/D,gBAAgB,yBAAiC;;AAEjD;AACA;;AAEA;AACA;AACA;AACA;;;;;;ACVa;AACb,cAAc,2BAAmC;;AAEjD;AACA;AACA;AACA;AACA;AACA;;;;;;ACRa;AACb,cAAc,uBAA+B;;AAE7C;AACA;AACA;AACA;;;;;;ACNa;AACb;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;;;;;;ACXa;AACb,YAAY,qBAA6B;AACzC,iBAAiB,2BAAmC;;AAEpD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;;;;;;;;;;ACtBa;AACb,iBAAiB,2BAAmC;;AAEpD;AACA;AACA;;;;;;ACLa;AACb,eAAe,yBAAiC;;AAEhD;AACA;AACA;;;;;;ACLa;AACb;;;;;;ACDa;AACb,eAAe,yBAAiC;AAChD,uBAAuB,kCAA0C;;AAEjE;AACA;AACA;AACA;AACA;;;;;;ACRa;AACb,iBAAiB,4BAAoC;AACrD,iBAAiB,2BAAmC;AACpD,oBAAoB,sCAA8C;AAClE,wBAAwB,iCAAyC;;AAEjE;;AAEA;AACA;AACA,EAAE;AACF;AACA;AACA;;;;;;ACba;AACb,WAAW,6BAAqC;;AAEhD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;ACXa;AACb,WAAW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AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;;;;;;;;;;AC9Fa;AACb,iBAAiB,2BAAmC;;AAEpD;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,0BAA0B,SAAS,eAAe;AAClD,8BAA8B;AAC9B,KAAK;AACL,IAAI;AACJ;AACA;AACA;;AAEA;AACA;;;;;;ACtBa;AACb,YAAY,qBAA6B;AACzC,iBAAiB,2BAAmC;AACpD,eAAe,yBAAiC;AAChD,aAAa,6BAAqC;AAClD,qBAAqB,uCAA+C;AACpE,oBAAoB,+BAAuC;AAC3D,sBAAsB,iCAAyC;AAC/D,cAAc,uBAA+B;;AAE7C;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA,EAAE,0CAAwB,sBAAsB;AAChD;;;;;;;;;;;AChDa;AACb,eAAe,yBAAiC;;AAEhD;AACA;AACA;AACA;AACA;;;;;;ACPa;AACb,kBAAkB,qCAA6C;AAC/D,YAAY,qBAA6B;AACzC,iBAAiB,2BAAmC;AACpD,aAAa,gCAAwC;AACrD,kBAAkB,2BAAmC;AACrD,iCAAiC,0CAAkD;AACnF,oBAAoB,8BAAsC;AAC1D,0BAA0B,8BAAsC;;AAEhE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,sCAAsC,aAAa,cAAc,UAAU;AAC3E,CAAC;;AAED;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,iCAAiC;AACtF;AACA;AACA;AACA,sCAAsC,sBAAsB;AAC5D;AACA;AACA;AACA,4DAA4D,iBAAiB;AAC7E;AACA,MAAM;AACN,IAAI,gBAAgB;AACpB;AACA;AACA;AACA,IAAI;AACJ;;AAEA;AACA;AACA;AACA;AACA,CAAC;;;;;;ACtDY;AACb,kBAAkB,qCAA6C;;AAE/D;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;ACda;AACb;AACA,YAAY,qBAA6B;;AAEzC;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;;;;;ACVY;AACb,gBAAgB,0BAAkC;;AAElD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA,gBAAgB;AAChB;AACA;;;;;;ACpBa;AACb,eAAe,yBAAiC;;AAEhD;AACA;AACA;;;;;;;;;;;ACLa;AACb;AACA,eAAe,yBAAiC;AAChD,6BAA6B,wCAAgD;AAC7E,kBAAkB,6BAAqC;AACvD,iBAAiB,2BAAmC;AACpD,WAAW,oBAA4B;AACvC,4BAA4B,uCAA+C;AAC3E,gBAAgB,0BAAkC;;AAElD;AACA;AACA;AACA;AACA;;AAEA,qCAAqC;;AAErC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,gBAAgB;AACpB;AACA;AACA;AACA;AACA,kDAAkD;AAClD;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;;;;;;ACpFa;AACb,kBAAkB,2BAAmC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sBAAsB,iCAAyC;AAC/D,cAAc,sCAA8C;AAC5D,iBAAiB,2BAAmC;;AAEpD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;ACpBa;AACb,yBAAyB,oCAA4C;AACrE,kBAAkB,6BAAqC;;AAEvD;AACA;AACA;AACA;AACA;AACA;;;;;;ACTa;AACb,8BAA8B;AAC9B;AACA;;AAEA;AACA,4EAA4E,MAAM;;AAElF;AACA;AACA,SAAS;AACT;AACA;AACA,EAAE;;;;;;ACbW;AACb;AACA,0BAA0B,8CAAsD;AAChF,eAAe,yBAAiC;AAChD,6BAA6B,wCAAgD;AAC7E,yBAAyB,oCAA4C;;AAErE;AACA;AACA;AACA;AACA,6DAA6D;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,gBAAgB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;;;;;AC5BY;AACb,WAAW,6BAAqC;AAChD,iBAAiB,2BAAmC;AACpD,eAAe,yBAAiC;;AAEhD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;ACfa;AACb,iBAAiB,4BAAoC;AACrD,kBAAkB,qCAA6C;AAC/D,gCAAgC,6CAAqD;AACrF,kCAAkC,+CAAuD;AACzF,eAAe,yBAAiC;;AAEhD;;AAEA;AACA;AACA;AACA;AACA;AACA;;;;;;ACda;AACb,kBAAkB,qCAA6C;AAC/D,aAAa,gCAAwC;;AAErD;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,gCAAgC,EAAE;AAClC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR,MAAM;AACN;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;;;;;;;;;;;ACv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,GAAG;AACH;;;;;;ACfa;AACb,WAAW,qBAA6B;AACxC,UAAU,+BAAuC;AACjD,WAAW,wBAAgC;AAC3C,mBAAmB,8BAAsC;AACzD,oBAAoB,8BAAsC;AAC1D,oBAAoB,8BAAsC;;AAE1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;;;;;AClBa;AACb,kBAAkB,qCAA6C;AAC/D,oBAAoB,8BAAsC;AAC1D,iBAAiB,2BAAmC;;AAEpD;AACA;AACA;AACA;AACA;;AAEA;AACA,yCAAyC,iCAAiC;AAC1E;;;;;;ACba;AACb,iBAAiB,4BAAoC;;AAErD;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;;;;;;;;;;;ACzDa;AACb,0BAA0B,8CAAsD;AAChF,iBAAiB,2BAAmC;;AAEpD;AACA;AACA;;;;;;ACNa;AACb,WAAW,qBAA6B;AACxC,iBAAiB,2BAAmC;AACpD,YAAY,yBAAiC;AAC7C,mBAAmB,8BAAsC;AACzD,oBAAoB,8BAAsC;;AAE1D;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;;;;;ACtBa;AACb,WAAW,qBAA6B;AACxC,UAAU,+BAAuC;AACjD,YAAY,yBAAiC;AAC7C,mBAAmB,8BAAsC;AACzD,oBAAoB,8BAAsC;;AAE1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;;;;;ACjBa;AACb,aAAa,sBAA8B;AAC3C,UAAU,mBAA2B;;AAErC;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AA6C;;AAE/D;AACA;AACA;;AAEA;AACA;AACA;;;;;;ACTa;AACb,iBAAiB,2BAAmC;AACpD,kBAAkB,qCAA6C;AAC/D,0BAA0B,sCAA8C;AACxE,cAAc,wBAAgC;AAC9C,aAAa,gCAAwC;AACrD,gBAAgB,0BAAkC;AAClD,wBAAwB,mCAA2C;AACnE,kBAAkB,yCAAiD;;AAEnE;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,QAAQ,gBAAgB;AACxB;AACA;AACA,IAAI;AACJ;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,sBAAsB,wBAAwB;AAC9C;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;;;;;;AC9Ja;AACb,iBAAiB,2BAAmC;AACpD,kBAAkB,qCAA6C;;AAE/D;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,6CAA6C,EAAE;AAC/C;AACA,SAAS,qBAAqB;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;;;;;;ACzBa;AACb,YAAY,qBAA6B;AACzC,sBAAsB,iCAAyC;AAC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Q,sBAA8B;AACtC,eAAe,yBAAiC;AAChD,qBAAqB,+BAAuC;AAC5D,cAAc,uBAA+B;AAC7C,wBAAwB,mCAA2C;;AAEnE;AACA;AACA,IAAI,6CAA6C;AACjD;AACA;AACA;AACA;AACA;AACA,KAAK,IAAI,iBAAiB;AAC1B;AACA;AACA,CAAC;;;;;;AClBY;AACb,QAAQ,sBAA8B;AACtC,kBAAkB,2BAAmC;AACrD,iBAAiB,2BAAmC;AACpD,iBAAiB,4BAAoC;AACrD,kBAAkB,qCAA6C;AAC/D,WAAW,6BAAqC;AAChD,iBAAiB,2BAAmC;AACpD,eAAe,yBAAiC;AAChD,cAAc,wBAAgC;AAC9C,aAAa,gCAAwC;AACrD,eAAe,yBAAiC;AAChD,wBAAwB,oCAA4C;AACpE,qBAAqB,+BAAuC;AAC5D,YAAY,qBAA6B;AACzC,sBAAsB,iCAAyC;AAC/D,oBAAoB,4CAAoD;;AAExE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,WAAW;AACxD;;AAEA;AACA;AACA;AACA,iEAAiE,sBAAsB;AACvF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,SAAS;AAC3B;AACA;AACA,MAAM;AACN;AACA;AACA,kBAAkB,SAAS;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN,GAAG;AACH;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA,QAAQ,mBAAmB;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,WAAW,mBAAmB;AAC9B;AACA,GAAG;AACH;AACA;AACA;AACA,oBAAoB,kBAAkB;AACtC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,CAAC;;AAED;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA,IAAI,uDAAuD;AAC3D;AACA;AACA;AACA,CAAC;;;;;;ACtQY;AACb,QAAQ,sBAA8B;AACtC,iBAAiB,4BAAoC;AACrD,WAAW,6BAAqC;AAChD,kBAAkB,qCAA6C;AAC/D,YAAY,qBAA6B;AACzC,cAAc,wBAAgC;AAC9C,iBAAiB,2BAAmC;AACpD,eAAe,yBAAiC;AAChD,aAAa,6BAAqC;AAClD,gBAAgB,2BAAmC;AACnD,eAAe,yBAAiC;AAChD,cAAc,2BAAmC;AACjD,sBAAsB,iCAAyC;AAC/D,eAAe,uCAA+C;AAC9D,aAAa,gCAAwC;AACrD,eAAe,yBAAiC;AAChD,sBAAsB,iCAAyC;AAC/D,UAAU,mBAA2B;AACrC,oBAAoB,4CAAoD;AACxE,sBAAsB,+BAAuC;;AAE7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,oBAAoB,WAAW,SAAS;AACxC;AACA,yCAAyC;AACzC,CAAC;;AAED;AACA;AACA;AACA;AACA,CAAC;;AAED;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,eAAe;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;;AAEA;AACA;AACA;AACA,gDAAgD,YAAY;AAC5D;AACA,IAAI;AACJ;;AAEA;AACA;AACA;AACA;AACA;AACA,gDAAgD,YAAY;AAC5D;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,oBAAoB,kHAAkH;AACtI;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;;AAER;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;;AAEA;;AAEA;;AAEA;AACA;;AAEA,oBAAoB,YAAY;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;;AAEA;AACA;AACA,CAAC;;;;;;AC1PY;AACb,QAAQ,sBAA8B;AACtC,gBAAgB,0BAAkC;AAClD,iBAAiB,2BAAmC;AACpD,cAAc,uBAA+B;;AAE7C;AACA;AACA;;AAEA;AACA;AACA,IAAI,yDAAyD;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;;;;;ACvBY;AACb,QAAQ,sBAA8B;AACtC,iBAAiB,2BAAmC;AACpD,cAAc,uBAA+B;;AAE7C;AACA;AACA;;AAEA;AACA;AACA,IAAI,yDAAyD;AAC7D;AACA;AACA;AACA;AACA;AACA,CAAC;;;;;;ACjBY;AACb;AACA;AACA,QAAQ,sBAA8B;AACtC,kBAAkB,qCAA6C;AAC/D,cAAc,uBAA+B;;AAE7C;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,uCAAuC;AACvC,mCAAmC;AACnC,2BAA2B;;AAE3B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW;AACX;;AAEA;AACA;AACA,IAAI,4BAA4B;AAChC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,sBAAsB,4CAA4C;AAClE;;AAEA,oBAAoB,oBAAoB;AACxC;AACA;AACA,sBAAsB,qBAAqB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,CAA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,IAAI,gBAAgB;AACpB;AACA;AACA;AACA;AACA,IAAI,gBAAgB;AACpB;AACA;AACA,IAAI;AACJ;AACA;AACA,CAAC;;AAED;AACA;AACA,oBAAoB,gFAAgF;AACpG;AACA;;AAEA;;AAEA,aAAa;AACb;AACA,CAAC;;;;;;ACpCY;AACb,QAAQ,sBAA8B;AACtC,iBAAiB,2BAAmC;AACpD,cAAc,wBAAgC;AAC9C,mBAAmB,8BAAsC;AACzD,kBAAkB,yCAAiD;AACnE,eAAe,8BAAsC;;AAErD;AACA;AACA;AACA;AACA;AACA,oCAAoC,qBAAqB;AACzD;AACA;AACA,IAAI;AACJ;AACA;AACA;;AAEA;AACA;AACA,+BAA+B,yEAAyE;AACxG;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,CAAC;;;;;;AC/BY;AACb;AACA,QAAQ,sBAA8B;AACtC,iBAAiB,2BAAmC;AACpD,kBAAkB,qCAA6C;AAC/D,0BAA0B,sCAA8C;AACxE,mBAAmB,8BAAsC;AACzD,kBAAkB,yCAAiD;AACnE,gBAAgB,0BAAkC;AAClD,wBAAwB,mCAA2C;;AAEnE;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA,CAAC;;AAED;AACA;AACA,oBAAoB,gFAAgF;AACpG;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,WAAW,gBAAgB;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,CAAC;;;;;;AC5EY;AACb,QAAQ,sBAA8B;AACtC,iBAAiB,2BAAmC;AACpD,kBAAkB,qCAA6C;AAC/D,mBAAmB,8BAAsC;AACzD,kBAAkB,yCAAiD;;AAEnE;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,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ACT,iBAAiB;EACjB,WAAW;EACX,kBAAkB;EAClB,qBAAqB;EACrB,MAAM;EACN,OAAO;EACP,OAAO;EACP,mBAAmB;EACnB,SAAS;EACT,mBAAmB;EACnB,YAAY;EACZ,SAAS;EACT,mBAAmB;EACnB,OAAO;EACP,OAAO;EACP,OAAO;EACP,OAAO;EACP,SAAS;EACT,aAAa;EACb,gBAAgB;EAChB,GAAG;EACH,WAAW;EACX,iBAAiB;EACjB,iBAAiB;EACjB,qBAAqB;EACrB,aAAa;EACb,SAAS;EACT,cAAc;EACd,aAAa;EACb,2BAA2B;EAC3B,cAAc;EACd,iBAAiB;EACjB,kBAAkB;EAClB,MAAM;EACN,kBAAkB;EAClB,SAAS;EACT,uBAAuB;EACvB,SAAS;EACT,eAAe;EACf,YAAY;EACZ,aAAa;EACb,IAAI;EACJ,cAAc;EACd,OAAO;EACP,QAAQ;AACV,CAAC","sources":["webpack://pdf.js/./node_modules/core-js/internals/a-string.js","webpack://pdf.js/./node_modules/core-js/internals/base64-map.js","webpack://pdf.js/./node_modules/core-js/internals/create-iter-result-object.js","webpack://pdf.js/./node_modules/core-js/internals/does-not-exceed-safe-integer.js","webpack://pdf.js/./node_modules/core-js/internals/dom-exception-constants.js","webpack://pdf.js/./node_modules/core-js/internals/get-alphabet-option.js","webpack://pdf.js/./node_modules/core-js/internals/get-iterator-direct.js","webpack://pdf.js/./node_modules/core-js/internals/is-null-or-undefined.js","webpack://pdf.js/./node_modules/core-js/internals/iterator-cleanup-state.js","webpack://pdf.js/./node_modules/core-js/internals/iterator-helper-throws-on-invalid-iterator.js","webpack://pdf.js/./node_modules/core-js/internals/iterators.js","webpack://pdf.js/./node_modules/core-js/internals/math-trunc.js","webpack://pdf.js/./node_modules/core-js/internals/not-a-nan.js","webpack://pdf.js/./node_modules/core-js/internals/object-get-own-property-symbols.js","webpack://pdf.js/./node_modules/core-js/internals/perform.js","webpack://pdf.js/./node_modules/core-js/internals/require-object-coercible.js","webpack://pdf.js/./node_modules/core-js/internals/set-method-get-keys-before-cloning-detection.js","webpack://pdf.js/./node_modules/core-js/internals/to-integer-or-infinity.js","webpack://pdf.js/./node_modules/core-js/internals/to-length.js","webpack://pdf.js/./node_modules/core-js/internals/to-object.js","webpack://pdf.js/./node_modules/core-js/internals/to-positive-integer.js","webpack://pdf.js/./node_modules/core-js/internals/validate-arguments-length.js","webpack://pdf.js/webpack/bootstrap","webpack://pdf.js/webpack/runtime/concatenation wrap","webpack://pdf.js/webpack/runtime/define property getters","webpack://pdf.js/webpack/runtime/hasOwnProperty shorthand","webpack://pdf.js/./node_modules/core-js/internals/a-callable.js","webpack://pdf.js/./node_modules/core-js/internals/a-possible-prototype.js","webpack://pdf.js/./node_modules/core-js/internals/a-set.js","webpack://pdf.js/./node_modules/core-js/internals/a-weak-key.js","webpack://pdf.js/./node_modules/core-js/internals/a-weak-map.js","webpack://pdf.js/./node_modules/core-js/internals/add-to-unscopables.js","webpack://pdf.js/./node_modules/core-js/internals/an-instance.js","webpack://pdf.js/./node_modules/core-js/internals/an-object-or-undefined.js","webpack://pdf.js/./node_modules/core-js/internals/an-object.js","webpack://pdf.js/./node_modules/core-js/internals/an-uint8-array.js","webpack://pdf.js/./node_modules/core-js/internals/array-buffer-basic-detection.js","webpack://pdf.js/./node_modules/core-js/internals/array-buffer-byte-length.js","webpack://pdf.js/./node_modules/core-js/internals/array-buffer-is-detached.js","webpack://pdf.js/./node_modules/core-js/internals/array-buffer-not-detached.js","webpack://pdf.js/./node_modules/core-js/internals/array-buffer-view-core.js","webpack://pdf.js/./node_modules/core-js/internals/array-from-constructor-and-list.js","webpack://pdf.js/./node_modules/core-js/internals/array-includes.js","webpack://pdf.js/./node_modules/core-js/internals/array-set-length.js","webpack://pdf.js/./node_modules/core-js/internals/array-slice.js","webpack://pdf.js/./node_modules/core-js/internals/call-with-safe-iteration-closing.js","webpack://pdf.js/./node_modules/core-js/internals/classof-raw.js","webpack://pdf.js/./node_modules/core-js/internals/classof.js","webpack://pdf.js/./node_modules/core-js/internals/copy-constructor-properties.js","webpack://pdf.js/./node_modules/core-js/internals/correct-prototype-getter.js","webpack://pdf.js/./node_modules/core-js/internals/create-non-enumerable-property.js","webpack://pdf.js/./node_modules/core-js/internals/create-property-descriptor.js","webpack://pdf.js/./node_modules/core-js/internals/create-property.js","webpack://pdf.js/./node_modules/core-js/internals/define-built-in-accessor.js","webpack://pdf.js/./node_modules/core-js/internals/define-built-in.js","webpack://pdf.js/./node_modules/core-js/internals/define-built-ins.js","webpack://pdf.js/./node_modules/core-js/internals/define-global-property.js","webpack://pdf.js/./node_modules/core-js/internals/descriptors.js","webpack://pdf.js/./node_modules/core-js/internals/document-create-element.js","webpack://pdf.js/./node_modules/core-js/internals/enum-bug-keys.js","webpack://pdf.js/./node_modules/core-js/internals/environment-user-agent.js","webpack://pdf.js/./node_modules/core-js/internals/environment-v8-version.js","webpack://pdf.js/./node_modules/core-js/internals/error-stack-clear.js","webpack://pdf.js/./node_modules/core-js/internals/export.js","webpack://pdf.js/./node_modules/core-js/internals/fails.js","webpack://pdf.js/./node_modules/core-js/internals/function-apply.js","webpack://pdf.js/./node_modules/core-js/internals/function-bind-context.js","webpack://pdf.js/./node_modules/core-js/internals/function-bind-native.js","webpack://pdf.js/./node_modules/core-js/internals/function-call.js","webpack://pdf.js/./node_modules/core-js/internals/function-name.js","webpack://pdf.js/./node_modules/core-js/internals/function-uncurry-this-accessor.js","webpack://pdf.js/./node_modules/core-js/internals/function-uncurry-this-clause.js","webpack://pdf.js/./node_modules/core-js/internals/function-uncurry-this.js","webpack://pdf.js/./node_modules/core-js/internals/get-built-in.js","webpack://pdf.js/./node_modules/core-js/internals/get-iterator-flattenable.js","webpack://pdf.js/./node_modules/core-js/internals/get-iterator-internal.js","webpack://pdf.js/./node_modules/core-js/internals/get-iterator-method-internal.js","webpack://pdf.js/./node_modules/core-js/internals/get-method.js","webpack://pdf.js/./node_modules/core-js/internals/get-set-record.js","webpack://pdf.js/./node_modules/core-js/internals/global-this.js","webpack://pdf.js/./node_modules/core-js/internals/has-own-property.js","webpack://pdf.js/./node_modules/core-js/internals/hidden-keys.js","webpack://pdf.js/./node_modules/core-js/internals/html.js","webpack://pdf.js/./node_modules/core-js/internals/ie8-dom-define.js","webpack://pdf.js/./node_modules/core-js/internals/indexed-object.js","webpack://pdf.js/./node_modules/core-js/internals/inherit-if-required.js","webpack://pdf.js/./node_modules/core-js/internals/inspect-source.js","webpack://pdf.js/./node_modules/core-js/internals/internal-state.js","webpack://pdf.js/./node_modules/core-js/internals/is-array-iterator-method.js","webpack://pdf.js/./node_modules/core-js/internals/is-array.js","webpack://pdf.js/./node_modules/core-js/internals/is-big-int-array.js","webpack://pdf.js/./node_modules/core-js/internals/is-callable.js","webpack://pdf.js/./node_modules/core-js/internals/is-forced.js","webpack://pdf.js/./node_modules/core-js/internals/is-object.js","webpack://pdf.js/./node_modules/core-js/internals/is-possible-prototype.js","webpack://pdf.js/./node_modules/core-js/internals/is-pure.js","webpack://pdf.js/./node_modules/core-js/internals/is-raw-json.js","webpack://pdf.js/./node_modules/core-js/internals/is-symbol.js","webpack://pdf.js/./node_modules/core-js/internals/iterate-simple.js","webpack://pdf.js/./node_modules/core-js/internals/iterate.js","webpack://pdf.js/./node_modules/core-js/internals/iterator-close-all.js","webpack://pdf.js/./node_modules/core-js/internals/iterator-close.js","webpack://pdf.js/./node_modules/core-js/internals/iterator-create-proxy.js","webpack://pdf.js/./node_modules/core-js/internals/iterator-helper-without-closing-on-early-error.js","webpack://pdf.js/./node_modules/core-js/internals/iterators-core.js","webpack://pdf.js/./node_modules/core-js/internals/length-of-array-like.js","webpack://pdf.js/./node_modules/core-js/internals/make-built-in.js","webpack://pdf.js/./node_modules/core-js/internals/map-helpers.js","webpack://pdf.js/./node_modules/core-js/internals/native-raw-json.js","webpack://pdf.js/./node_modules/core-js/internals/new-promise-capability.js","webpack://pdf.js/./node_modules/core-js/internals/normalize-string-argument.js","webpack://pdf.js/./node_modules/core-js/internals/object-create.js","webpack://pdf.js/./node_modules/core-js/internals/object-define-properties.js","webpack://pdf.js/./node_modules/core-js/internals/object-define-property.js","webpack://pdf.js/./node_modules/core-js/internals/object-get-own-property-descriptor.js","webpack://pdf.js/./node_modules/core-js/internals/object-get-own-property-names.js","webpack://pdf.js/./node_modules/core-js/internals/object-get-prototype-of.js","webpack://pdf.js/./node_modules/core-js/internals/object-is-prototype-of.js","webpack://pdf.js/./node_modules/core-js/internals/object-keys-internal.js","webpack://pdf.js/./node_modules/core-js/internals/object-keys.js","webpack://pdf.js/./node_modules/core-js/internals/object-property-is-enumerable.js","webpack://pdf.js/./node_modules/core-js/internals/object-set-prototype-of.js","webpack://pdf.js/./node_modules/core-js/internals/ordinary-to-primitive.js","webpack://pdf.js/./node_modules/core-js/internals/own-keys.js","webpack://pdf.js/./node_modules/core-js/internals/parse-json-string.js","webpack://pdf.js/./node_modules/core-js/internals/promise-resolve.js","webpack://pdf.js/./node_modules/core-js/internals/set-clone.js","webpack://pdf.js/./node_modules/core-js/internals/set-difference.js","webpack://pdf.js/./node_modules/core-js/internals/set-helpers.js","webpack://pdf.js/./node_modules/core-js/internals/set-intersection.js","webpack://pdf.js/./node_modules/core-js/internals/set-is-disjoint-from.js","webpack://pdf.js/./node_modules/core-js/internals/set-is-subset-of.js","webpack://pdf.js/./node_modules/core-js/internals/set-is-superset-of.js","webpack://pdf.js/./node_modules/core-js/internals/set-iterate.js","webpack://pdf.js/./node_modules/core-js/internals/set-method-accept-set-like.js","webpack://pdf.js/./node_modules/core-js/internals/set-size.js","webpack://pdf.js/./node_modules/core-js/internals/set-symmetric-difference.js","webpack://pdf.js/./node_modules/core-js/internals/set-union.js","webpack://pdf.js/./node_modules/core-js/internals/shared-key.js","webpack://pdf.js/./node_modules/core-js/internals/shared-store.js","webpack://pdf.js/./node_modules/core-js/internals/shared.js","webpack://pdf.js/./node_modules/core-js/internals/symbol-constructor-detection.js","webpack://pdf.js/./node_modules/core-js/internals/this-number-value.js","webpack://pdf.js/./node_modules/core-js/internals/to-absolute-index.js","webpack://pdf.js/./node_modules/core-js/internals/to-big-int.js","webpack://pdf.js/./node_modules/core-js/internals/to-indexed-object.js","webpack://pdf.js/./node_modules/core-js/internals/to-primitive.js","webpack://pdf.js/./node_modules/core-js/internals/to-property-key.js","webpack://pdf.js/./node_modules/core-js/internals/to-string-tag-support.js","webpack://pdf.js/./node_modules/core-js/internals/to-string.js","webpack://pdf.js/./node_modules/core-js/internals/try-to-string.js","webpack://pdf.js/./node_modules/core-js/internals/uid.js","webpack://pdf.js/./node_modules/core-js/internals/uint8-from-base64.js","webpack://pdf.js/./node_modules/core-js/internals/uint8-from-hex.js","webpack://pdf.js/./node_modules/core-js/internals/url-constructor-detection.js","webpack://pdf.js/./node_modules/core-js/internals/use-symbol-as-uid.js","webpack://pdf.js/./node_modules/core-js/internals/v8-prototype-define-bug.js","webpack://pdf.js/./node_modules/core-js/internals/weak-map-basic-detection.js","webpack://pdf.js/./node_modules/core-js/internals/weak-map-helpers.js","webpack://pdf.js/./node_modules/core-js/internals/well-known-symbol.js","webpack://pdf.js/./node_modules/core-js/modules/es.array.includes.js","webpack://pdf.js/./node_modules/core-js/modules/es.array.push.js","webpack://pdf.js/./node_modules/core-js/modules/es.iterator.constructor.js","webpack://pdf.js/./node_modules/core-js/modules/es.iterator.drop.js","webpack://pdf.js/./node_modules/core-js/modules/es.iterator.every.js","webpack://pdf.js/./node_modules/core-js/modules/es.iterator.filter.js","webpack://pdf.js/./node_modules/core-js/modules/es.iterator.find.js","webpack://pdf.js/./node_modules/core-js/modules/es.iterator.flat-map.js","webpack://pdf.js/./node_modules/core-js/modules/es.iterator.for-each.js","webpack://pdf.js/./node_modules/core-js/modules/es.iterator.map.js","webpack://pdf.js/./node_modules/core-js/modules/es.iterator.some.js","webpack://pdf.js/./node_modules/core-js/modules/es.iterator.take.js","webpack://pdf.js/./node_modules/core-js/modules/es.iterator.to-array.js","webpack://pdf.js/./node_modules/core-js/modules/es.json.parse.js","webpack://pdf.js/./node_modules/core-js/modules/es.json.stringify.js","webpack://pdf.js/./node_modules/core-js/modules/es.map.get-or-insert-computed.js","webpack://pdf.js/./node_modules/core-js/modules/es.map.get-or-insert.js","webpack://pdf.js/./node_modules/core-js/modules/es.math.sum-precise.js","webpack://pdf.js/./node_modules/core-js/modules/es.promise.try.js","webpack://pdf.js/./node_modules/core-js/modules/es.set.difference.v2.js","webpack://pdf.js/./node_modules/core-js/modules/es.set.intersection.v2.js","webpack://pdf.js/./node_modules/core-js/modules/es.set.is-disjoint-from.v2.js","webpack://pdf.js/./node_modules/core-js/modules/es.set.is-subset-of.v2.js","webpack://pdf.js/./node_modules/core-js/modules/es.set.is-superset-of.v2.js","webpack://pdf.js/./node_modules/core-js/modules/es.set.symmetric-difference.v2.js","webpack://pdf.js/./node_modules/core-js/modules/es.set.union.v2.js","webpack://pdf.js/./node_modules/core-js/modules/es.typed-array.with.js","webpack://pdf.js/./node_modules/core-js/modules/es.uint8-array.from-base64.js","webpack://pdf.js/./node_modules/core-js/modules/es.uint8-array.set-from-base64.js","webpack://pdf.js/./node_modules/core-js/modules/es.uint8-array.set-from-hex.js","webpack://pdf.js/./node_modules/core-js/modules/es.uint8-array.to-base64.js","webpack://pdf.js/./node_modules/core-js/modules/es.uint8-array.to-hex.js","webpack://pdf.js/./node_modules/core-js/modules/es.weak-map.get-or-insert-computed.js","webpack://pdf.js/./node_modules/core-js/modules/es.weak-map.get-or-insert.js","webpack://pdf.js/./node_modules/core-js/modules/web.dom-exception.stack.js","webpack://pdf.js/./node_modules/core-js/modules/web.url.parse.js","webpack://pdf.js/./src/shared/util.js","webpack://pdf.js/./src/shared/math_clamp.js","webpack://pdf.js/./src/display/page_viewport.js","webpack://pdf.js/./src/display/xfa_text.js","webpack://pdf.js/./src/display/xfa_layer.js","webpack://pdf.js/./src/display/display_utils.js","webpack://pdf.js/./src/display/editor/toolbar.js","webpack://pdf.js/./src/shared/internal_evt.js","webpack://pdf.js/./src/display/editor/tools.js","webpack://pdf.js/./src/display/editor/alt_text.js","webpack://pdf.js/./src/display/editor/comment.js","webpack://pdf.js/./src/display/touch_manager.js","webpack://pdf.js/./src/display/editor/editor.js","webpack://pdf.js/./src/shared/murmurhash3.js","webpack://pdf.js/./src/display/annotation_storage.js","webpack://pdf.js/./src/display/canvas_dependency_tracker.js","webpack://pdf.js/./src/shared/css_utils.js","webpack://pdf.js/./src/display/font_loader.js","webpack://pdf.js/./src/shared/obj_bin_transform_utils.js","webpack://pdf.js/./src/display/obj_bin_transform_display.js","webpack://pdf.js/./src/display/api_utils.js","webpack://pdf.js/./src/shared/message_handler.js","webpack://pdf.js/./src/display/binary_data_factory.js","webpack://pdf.js/./src/display/canvas_factory.js","webpack://pdf.js/./src/display/filter_factory.js","webpack://pdf.js/./src/display/node_utils.js","webpack://pdf.js/./src/shared/image_utils.js","webpack://pdf.js/./src/display/webgpu.js","webpack://pdf.js/./src/display/pattern_helper.js","webpack://pdf.js/./src/display/canvas.js","webpack://pdf.js/./src/shared/base_pdf_stream.js","webpack://pdf.js/./src/display/content_disposition.js","webpack://pdf.js/./src/display/network_utils.js","webpack://pdf.js/./src/display/fetch_stream.js","webpack://pdf.js/./src/display/transport_stream.js","webpack://pdf.js/./src/display/network.js","webpack://pdf.js/./src/display/node_stream.js","webpack://pdf.js/./src/display/network_stream.js","webpack://pdf.js/./src/display/worker_options.js","webpack://pdf.js/./src/display/metadata.js","webpack://pdf.js/./src/display/optional_content_config.js","webpack://pdf.js/./src/display/pages_mapper.js","webpack://pdf.js/./src/display/pdf_objects.js","webpack://pdf.js/./src/display/text_layer.js","webpack://pdf.js/./src/display/api.js","webpack://pdf.js/./src/display/editor/color_picker.js","webpack://pdf.js/./src/shared/scripting_utils.js","webpack://pdf.js/./src/display/svg_factory.js","webpack://pdf.js/./src/display/annotation_layer.js","webpack://pdf.js/./src/display/editor/freetext.js","webpack://pdf.js/./src/display/editor/draw.js","webpack://pdf.js/./src/display/editor/drawers/outline.js","webpack://pdf.js/./src/display/editor/drawers/freedraw.js","webpack://pdf.js/./src/display/editor/drawers/highlight.js","webpack://pdf.js/./src/display/editor/highlight.js","webpack://pdf.js/./src/display/editor/drawers/inkdraw.js","webpack://pdf.js/./src/display/editor/ink.js","webpack://pdf.js/./src/display/editor/drawers/contour.js","webpack://pdf.js/./src/display/editor/drawers/signaturedraw.js","webpack://pdf.js/./src/display/editor/signature.js","webpack://pdf.js/./src/display/editor/stamp.js","webpack://pdf.js/./src/display/editor/annotation_editor_layer.js","webpack://pdf.js/./src/display/draw_layer.js","webpack://pdf.js/./src/display/text_layer_images.js","webpack://pdf.js/./src/pdf.js"],"sourcesContent":["'use strict';\nvar $TypeError = TypeError;\n\nmodule.exports = function (argument) {\n if (typeof argument == 'string') return argument;\n throw new $TypeError('Argument is not a string');\n};\n","'use strict';\nvar commonAlphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\nvar base64Alphabet = commonAlphabet + '+/';\nvar base64UrlAlphabet = commonAlphabet + '-_';\n\nvar inverse = function (characters) {\n // TODO: use `Object.create(null)` in `core-js@4`\n var result = {};\n var index = 0;\n for (; index < 64; index++) result[characters.charAt(index)] = index;\n return result;\n};\n\nmodule.exports = {\n i2c: base64Alphabet,\n c2i: inverse(base64Alphabet),\n i2cUrl: base64UrlAlphabet,\n c2iUrl: inverse(base64UrlAlphabet)\n};\n","'use strict';\n// `CreateIterResultObject` abstract operation\n// https://tc39.es/ecma262/#sec-createiterresultobject\nmodule.exports = function (value, done) {\n return { value: value, done: done };\n};\n","'use strict';\nvar $TypeError = TypeError;\nvar MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF; // 2 ** 53 - 1 == 9007199254740991\n\nmodule.exports = function (it) {\n if (it > MAX_SAFE_INTEGER) throw new $TypeError('Maximum allowed index exceeded');\n return it;\n};\n","'use strict';\nmodule.exports = {\n IndexSizeError: { s: 'INDEX_SIZE_ERR', c: 1, m: 1 },\n DOMStringSizeError: { s: 'DOMSTRING_SIZE_ERR', c: 2, m: 0 },\n HierarchyRequestError: { s: 'HIERARCHY_REQUEST_ERR', c: 3, m: 1 },\n WrongDocumentError: { s: 'WRONG_DOCUMENT_ERR', c: 4, m: 1 },\n InvalidCharacterError: { s: 'INVALID_CHARACTER_ERR', c: 5, m: 1 },\n NoDataAllowedError: { s: 'NO_DATA_ALLOWED_ERR', c: 6, m: 0 },\n NoModificationAllowedError: { s: 'NO_MODIFICATION_ALLOWED_ERR', c: 7, m: 1 },\n NotFoundError: { s: 'NOT_FOUND_ERR', c: 8, m: 1 },\n NotSupportedError: { s: 'NOT_SUPPORTED_ERR', c: 9, m: 1 },\n InUseAttributeError: { s: 'INUSE_ATTRIBUTE_ERR', c: 10, m: 1 },\n InvalidStateError: { s: 'INVALID_STATE_ERR', c: 11, m: 1 },\n SyntaxError: { s: 'SYNTAX_ERR', c: 12, m: 1 },\n InvalidModificationError: { s: 'INVALID_MODIFICATION_ERR', c: 13, m: 1 },\n NamespaceError: { s: 'NAMESPACE_ERR', c: 14, m: 1 },\n InvalidAccessError: { s: 'INVALID_ACCESS_ERR', c: 15, m: 1 },\n ValidationError: { s: 'VALIDATION_ERR', c: 16, m: 0 },\n TypeMismatchError: { s: 'TYPE_MISMATCH_ERR', c: 17, m: 1 },\n SecurityError: { s: 'SECURITY_ERR', c: 18, m: 1 },\n NetworkError: { s: 'NETWORK_ERR', c: 19, m: 1 },\n AbortError: { s: 'ABORT_ERR', c: 20, m: 1 },\n URLMismatchError: { s: 'URL_MISMATCH_ERR', c: 21, m: 1 },\n QuotaExceededError: { s: 'QUOTA_EXCEEDED_ERR', c: 22, m: 1 },\n TimeoutError: { s: 'TIMEOUT_ERR', c: 23, m: 1 },\n InvalidNodeTypeError: { s: 'INVALID_NODE_TYPE_ERR', c: 24, m: 1 },\n DataCloneError: { s: 'DATA_CLONE_ERR', c: 25, m: 1 }\n};\n","'use strict';\nvar $TypeError = TypeError;\n\nmodule.exports = function (options) {\n var alphabet = options && options.alphabet;\n if (alphabet === undefined || alphabet === 'base64' || alphabet === 'base64url') return alphabet || 'base64';\n throw new $TypeError('Incorrect `alphabet` option');\n};\n","'use strict';\n// `GetIteratorDirect(obj)` abstract operation\n// https://tc39.es/ecma262/#sec-getiteratordirect\nmodule.exports = function (obj) {\n return {\n iterator: obj,\n next: obj.next,\n done: false\n };\n};\n","'use strict';\n// we can't use just `it == null` since of `document.all` special case\n// https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot-aec\nmodule.exports = function (it) {\n return it === null || it === undefined;\n};\n","'use strict';\n// release references held by exhausted / closed iterator helpers to allow GC of the source chain\nmodule.exports = function (state) {\n state.iterator = state.next = state.nextHandler = state.mapper = state.predicate = state.inner =\n state.iterables = state.iters = state.openIters = state.padding = state.finishResults = state.buffer = null;\n};\n","'use strict';\n// Should throw an error on invalid iterator\n// https://issues.chromium.org/issues/336839115\nmodule.exports = function (methodName, argument) {\n // eslint-disable-next-line es/no-iterator -- required for testing\n var method = typeof Iterator == 'function' && Iterator.prototype[methodName];\n if (method) try {\n method.call({ next: null }, argument).next();\n } catch (error) {\n return true;\n }\n};\n","'use strict';\nmodule.exports = Object.create ? Object.create(null) : {};\n","'use strict';\nvar ceil = Math.ceil;\nvar floor = Math.floor;\n\n// `Math.trunc` method\n// https://tc39.es/ecma262/#sec-math.trunc\n// eslint-disable-next-line es/no-math-trunc -- safe\nmodule.exports = Math.trunc || function trunc(x) {\n var n = +x;\n return (n > 0 ? floor : ceil)(n);\n};\n","'use strict';\nvar $RangeError = RangeError;\n\nmodule.exports = function (it) {\n // eslint-disable-next-line no-self-compare -- NaN check\n if (it === it) return it;\n throw new $RangeError('NaN is not allowed');\n};\n","'use strict';\n// eslint-disable-next-line es/no-object-getownpropertysymbols -- safe\nexports.f = Object.getOwnPropertySymbols;\n","'use strict';\nmodule.exports = function (exec) {\n try {\n return { error: false, value: exec() };\n } catch (error) {\n return { error: true, value: error };\n }\n};\n","'use strict';\nvar isNullOrUndefined = require('../internals/is-null-or-undefined');\n\nvar $TypeError = TypeError;\n\n// `RequireObjectCoercible` abstract operation\n// https://tc39.es/ecma262/#sec-requireobjectcoercible\nmodule.exports = function (it) {\n if (isNullOrUndefined(it)) throw new $TypeError(\"Can't call method on \" + it);\n return it;\n};\n","'use strict';\n// Should get iterator record of a set-like object before cloning this\n// https://bugs.webkit.org/show_bug.cgi?id=289430\nmodule.exports = function (METHOD_NAME) {\n try {\n // eslint-disable-next-line es/no-set -- needed for test\n var baseSet = new Set();\n var setLike = {\n size: 0,\n has: function () { return true; },\n keys: function () {\n // eslint-disable-next-line es/no-object-defineproperty -- needed for test\n return Object.defineProperty({}, 'next', {\n get: function () {\n baseSet.clear();\n baseSet.add(4);\n return function () {\n return { done: true };\n };\n }\n });\n }\n };\n var result = baseSet[METHOD_NAME](setLike);\n\n return result.size === 1 && result.values().next().value === 4;\n } catch (error) {\n return false;\n }\n};\n","'use strict';\nvar trunc = require('../internals/math-trunc');\n\n// `ToIntegerOrInfinity` abstract operation\n// https://tc39.es/ecma262/#sec-tointegerorinfinity\nmodule.exports = function (argument) {\n var number = +argument;\n // eslint-disable-next-line no-self-compare -- NaN check\n return number !== number || number === 0 ? 0 : trunc(number);\n};\n","'use strict';\nvar toIntegerOrInfinity = require('../internals/to-integer-or-infinity');\n\nvar min = Math.min;\n\n// `ToLength` abstract operation\n// https://tc39.es/ecma262/#sec-tolength\nmodule.exports = function (argument) {\n var len = toIntegerOrInfinity(argument);\n return len > 0 ? min(len, 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991\n};\n","'use strict';\nvar requireObjectCoercible = require('../internals/require-object-coercible');\n\nvar $Object = Object;\n\n// `ToObject` abstract operation\n// https://tc39.es/ecma262/#sec-toobject\nmodule.exports = function (argument) {\n return $Object(requireObjectCoercible(argument));\n};\n","'use strict';\nvar toIntegerOrInfinity = require('../internals/to-integer-or-infinity');\n\nvar $RangeError = RangeError;\n\nmodule.exports = function (it) {\n var result = toIntegerOrInfinity(it);\n if (result < 0) throw new $RangeError(\"The argument can't be less than 0\");\n return result;\n};\n","'use strict';\nvar $TypeError = TypeError;\n\nmodule.exports = function (passed, required) {\n if (passed < required) throw new $TypeError('Not enough arguments');\n return passed;\n};\n","// The module cache\nconst __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tconst cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tconst module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// wrap a concatenated module body as a lazy, memoized accessor; mod is\n// set before the body runs so re-entrant calls (require cycles) observe\n// the partial exports like Node.js\n__webpack_require__.cw = (body) => {\n\tvar mod;\n\treturn () => {\n\t\tif (body) {\n\t\t\tvar fn = body;\n\t\t\tbody = 0;\n\t\t\tmod = { exports: {} };\n\t\t\tfn.call(mod.exports, mod, mod.exports);\n\t\t}\n\t\treturn mod.exports;\n\t};\n};","// define getter/value functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop));","'use strict';\nvar isCallable = require('../internals/is-callable');\nvar tryToString = require('../internals/try-to-string');\n\nvar $TypeError = TypeError;\n\n// `Assert: IsCallable(argument) is true`\nmodule.exports = function (argument) {\n if (isCallable(argument)) return argument;\n throw new $TypeError(tryToString(argument) + ' is not a function');\n};\n","'use strict';\nvar isPossiblePrototype = require('../internals/is-possible-prototype');\n\nvar $String = String;\nvar $TypeError = TypeError;\n\nmodule.exports = function (argument) {\n if (isPossiblePrototype(argument)) return argument;\n throw new $TypeError(\"Can't set \" + $String(argument) + ' as a prototype');\n};\n","'use strict';\nvar has = require('../internals/set-helpers').has;\n\n// Perform ? RequireInternalSlot(M, [[SetData]])\nmodule.exports = function (it) {\n has(it);\n return it;\n};\n","'use strict';\nvar WeakMapHelpers = require('../internals/weak-map-helpers');\n\nvar weakmap = new WeakMapHelpers.WeakMap();\nvar set = WeakMapHelpers.set;\nvar remove = WeakMapHelpers.remove;\n\nmodule.exports = function (key) {\n set(weakmap, key, 1);\n remove(weakmap, key);\n return key;\n};\n","'use strict';\nvar has = require('../internals/weak-map-helpers').has;\n\n// Perform ? RequireInternalSlot(M, [[WeakMapData]])\nmodule.exports = function (it) {\n has(it);\n return it;\n};\n","'use strict';\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar create = require('../internals/object-create');\nvar defineProperty = require('../internals/object-define-property').f;\n\nvar UNSCOPABLES = wellKnownSymbol('unscopables');\nvar ArrayPrototype = Array.prototype;\n\n// Array.prototype[@@unscopables]\n// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables\nif (ArrayPrototype[UNSCOPABLES] === undefined) {\n defineProperty(ArrayPrototype, UNSCOPABLES, {\n configurable: true,\n value: create(null)\n });\n}\n\n// add a key to Array.prototype[@@unscopables]\nmodule.exports = function (key) {\n ArrayPrototype[UNSCOPABLES][key] = true;\n};\n","'use strict';\nvar isPrototypeOf = require('../internals/object-is-prototype-of');\n\nvar $TypeError = TypeError;\n\nmodule.exports = function (it, Prototype) {\n if (isPrototypeOf(Prototype, it)) return it;\n throw new $TypeError('Incorrect invocation');\n};\n","'use strict';\nvar isObject = require('../internals/is-object');\n\nvar $String = String;\nvar $TypeError = TypeError;\n\nmodule.exports = function (argument) {\n if (argument === undefined || isObject(argument)) return argument;\n throw new $TypeError($String(argument) + ' is not an object or undefined');\n};\n","'use strict';\nvar isObject = require('../internals/is-object');\n\nvar $String = String;\nvar $TypeError = TypeError;\n\n// `Assert: Type(argument) is Object`\nmodule.exports = function (argument) {\n if (isObject(argument)) return argument;\n throw new $TypeError($String(argument) + ' is not an object');\n};\n","'use strict';\nvar classof = require('../internals/classof');\n\nvar $TypeError = TypeError;\n\n// Perform ? RequireInternalSlot(argument, [[TypedArrayName]])\n// If argument.[[TypedArrayName]] is not \"Uint8Array\", throw a TypeError exception\nmodule.exports = function (argument) {\n if (classof(argument) === 'Uint8Array') return argument;\n throw new $TypeError('Argument is not an Uint8Array');\n};\n","'use strict';\n// eslint-disable-next-line es/no-typed-arrays -- safe\nmodule.exports = typeof ArrayBuffer != 'undefined' && typeof DataView != 'undefined';\n","'use strict';\nvar globalThis = require('../internals/global-this');\nvar uncurryThisAccessor = require('../internals/function-uncurry-this-accessor');\nvar classof = require('../internals/classof-raw');\n\nvar ArrayBuffer = globalThis.ArrayBuffer;\nvar TypeError = globalThis.TypeError;\n\n// Includes\n// - Perform ? RequireInternalSlot(O, [[ArrayBufferData]]).\n// - If IsSharedArrayBuffer(O) is true, throw a TypeError exception.\nmodule.exports = ArrayBuffer && uncurryThisAccessor(ArrayBuffer.prototype, 'byteLength', 'get') || function (O) {\n if (classof(O) !== 'ArrayBuffer') throw new TypeError('ArrayBuffer expected');\n return O.byteLength;\n};\n","'use strict';\nvar globalThis = require('../internals/global-this');\nvar NATIVE_ARRAY_BUFFER = require('../internals/array-buffer-basic-detection');\nvar arrayBufferByteLength = require('../internals/array-buffer-byte-length');\n\nvar DataView = globalThis.DataView;\n\nmodule.exports = function (O) {\n if (!NATIVE_ARRAY_BUFFER || arrayBufferByteLength(O) !== 0) return false;\n try {\n // eslint-disable-next-line no-new -- thrower\n new DataView(O);\n return false;\n } catch (error) {\n return true;\n }\n};\n","'use strict';\nvar isDetached = require('../internals/array-buffer-is-detached');\n\nvar $TypeError = TypeError;\n\nmodule.exports = function (it) {\n if (isDetached(it)) throw new $TypeError('ArrayBuffer is detached');\n return it;\n};\n","'use strict';\nvar NATIVE_ARRAY_BUFFER = require('../internals/array-buffer-basic-detection');\nvar DESCRIPTORS = require('../internals/descriptors');\nvar globalThis = require('../internals/global-this');\nvar isCallable = require('../internals/is-callable');\nvar isObject = require('../internals/is-object');\nvar hasOwn = require('../internals/has-own-property');\nvar classof = require('../internals/classof');\nvar tryToString = require('../internals/try-to-string');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar defineBuiltIn = require('../internals/define-built-in');\nvar defineBuiltInAccessor = require('../internals/define-built-in-accessor');\nvar isPrototypeOf = require('../internals/object-is-prototype-of');\nvar getPrototypeOf = require('../internals/object-get-prototype-of');\nvar setPrototypeOf = require('../internals/object-set-prototype-of');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar uid = require('../internals/uid');\nvar InternalStateModule = require('../internals/internal-state');\n\nvar enforceInternalState = InternalStateModule.enforce;\nvar getInternalState = InternalStateModule.get;\nvar Int8Array = globalThis.Int8Array;\nvar Int8ArrayPrototype = Int8Array && Int8Array.prototype;\nvar Uint8ClampedArray = globalThis.Uint8ClampedArray;\nvar Uint8ClampedArrayPrototype = Uint8ClampedArray && Uint8ClampedArray.prototype;\nvar TypedArray = Int8Array && getPrototypeOf(Int8Array);\nvar TypedArrayPrototype = Int8ArrayPrototype && getPrototypeOf(Int8ArrayPrototype);\nvar ObjectPrototype = Object.prototype;\nvar TypeError = globalThis.TypeError;\n\nvar TO_STRING_TAG = wellKnownSymbol('toStringTag');\nvar TYPED_ARRAY_TAG = uid('TYPED_ARRAY_TAG');\nvar TYPED_ARRAY_CONSTRUCTOR = 'TypedArrayConstructor';\n// Fixing native typed arrays in Opera Presto crashes the browser, see #595\nvar NATIVE_ARRAY_BUFFER_VIEWS = NATIVE_ARRAY_BUFFER && !!setPrototypeOf && classof(globalThis.opera) !== 'Opera';\nvar TYPED_ARRAY_TAG_REQUIRED = false;\nvar NAME, Constructor, Prototype;\n\nvar TypedArrayConstructorsList = {\n Int8Array: 1,\n Uint8Array: 1,\n Uint8ClampedArray: 1,\n Int16Array: 2,\n Uint16Array: 2,\n Int32Array: 4,\n Uint32Array: 4,\n Float32Array: 4,\n Float64Array: 8\n};\n\nvar BigIntArrayConstructorsList = {\n BigInt64Array: 8,\n BigUint64Array: 8\n};\n\nvar isView = function isView(it) {\n if (!isObject(it)) return false;\n var klass = classof(it);\n return klass === 'DataView'\n || hasOwn(TypedArrayConstructorsList, klass)\n || hasOwn(BigIntArrayConstructorsList, klass);\n};\n\nvar getTypedArrayConstructor = function (it) {\n var proto = getPrototypeOf(it);\n if (!isObject(proto)) return;\n var state = getInternalState(proto);\n return (state && hasOwn(state, TYPED_ARRAY_CONSTRUCTOR)) ? state[TYPED_ARRAY_CONSTRUCTOR] : getTypedArrayConstructor(proto);\n};\n\nvar isTypedArray = function (it) {\n if (!isObject(it)) return false;\n var klass = classof(it);\n return hasOwn(TypedArrayConstructorsList, klass)\n || hasOwn(BigIntArrayConstructorsList, klass);\n};\n\nvar aTypedArray = function (it) {\n if (isTypedArray(it)) return it;\n throw new TypeError('Target is not a typed array');\n};\n\nvar aTypedArrayConstructor = function (C) {\n if (isCallable(C) && (!setPrototypeOf || isPrototypeOf(TypedArray, C))) return C;\n throw new TypeError(tryToString(C) + ' is not a typed array constructor');\n};\n\nvar exportTypedArrayMethod = function (KEY, property, forced, options) {\n if (!DESCRIPTORS) return;\n if (forced) for (var ARRAY in TypedArrayConstructorsList) {\n var TypedArrayConstructor = globalThis[ARRAY];\n if (TypedArrayConstructor && hasOwn(TypedArrayConstructor.prototype, KEY)) try {\n delete TypedArrayConstructor.prototype[KEY];\n } catch (error) {\n // old WebKit bug - some methods are non-configurable\n try {\n TypedArrayConstructor.prototype[KEY] = property;\n } catch (error2) { /* empty */ }\n }\n }\n if (!TypedArrayPrototype[KEY] || forced) {\n defineBuiltIn(TypedArrayPrototype, KEY, forced ? property\n : NATIVE_ARRAY_BUFFER_VIEWS && Int8ArrayPrototype[KEY] || property, options);\n }\n};\n\nvar exportTypedArrayStaticMethod = function (KEY, property, forced) {\n var ARRAY, TypedArrayConstructor;\n if (!DESCRIPTORS) return;\n if (setPrototypeOf) {\n if (forced) for (ARRAY in TypedArrayConstructorsList) {\n TypedArrayConstructor = globalThis[ARRAY];\n if (TypedArrayConstructor && hasOwn(TypedArrayConstructor, KEY)) try {\n delete TypedArrayConstructor[KEY];\n } catch (error) { /* empty */ }\n }\n if (!TypedArray[KEY] || forced) {\n // V8 ~ Chrome 49-50 `%TypedArray%` methods are non-writable non-configurable\n try {\n return defineBuiltIn(TypedArray, KEY, forced ? property : NATIVE_ARRAY_BUFFER_VIEWS && TypedArray[KEY] || property);\n } catch (error) { /* empty */ }\n } else return;\n }\n for (ARRAY in TypedArrayConstructorsList) {\n TypedArrayConstructor = globalThis[ARRAY];\n if (TypedArrayConstructor && (!TypedArrayConstructor[KEY] || forced)) {\n defineBuiltIn(TypedArrayConstructor, KEY, property);\n }\n }\n};\n\nfor (NAME in TypedArrayConstructorsList) {\n Constructor = globalThis[NAME];\n Prototype = Constructor && Constructor.prototype;\n if (Prototype) enforceInternalState(Prototype)[TYPED_ARRAY_CONSTRUCTOR] = Constructor;\n else NATIVE_ARRAY_BUFFER_VIEWS = false;\n}\n\nfor (NAME in BigIntArrayConstructorsList) {\n Constructor = globalThis[NAME];\n Prototype = Constructor && Constructor.prototype;\n if (Prototype) enforceInternalState(Prototype)[TYPED_ARRAY_CONSTRUCTOR] = Constructor;\n}\n\n// WebKit bug - typed arrays constructors prototype is Object.prototype\nif (!NATIVE_ARRAY_BUFFER_VIEWS || !isCallable(TypedArray) || TypedArray === Function.prototype) {\n // eslint-disable-next-line no-shadow -- safe\n TypedArray = function TypedArray() {\n throw new TypeError('Incorrect invocation');\n };\n if (NATIVE_ARRAY_BUFFER_VIEWS) for (NAME in TypedArrayConstructorsList) {\n if (globalThis[NAME]) setPrototypeOf(globalThis[NAME], TypedArray);\n }\n}\n\nif (!NATIVE_ARRAY_BUFFER_VIEWS || !TypedArrayPrototype || TypedArrayPrototype === ObjectPrototype) {\n TypedArrayPrototype = TypedArray.prototype;\n if (NATIVE_ARRAY_BUFFER_VIEWS) for (NAME in TypedArrayConstructorsList) {\n if (globalThis[NAME]) setPrototypeOf(globalThis[NAME].prototype, TypedArrayPrototype);\n }\n}\n\n// WebKit bug - one more object in Uint8ClampedArray prototype chain\nif (NATIVE_ARRAY_BUFFER_VIEWS && getPrototypeOf(Uint8ClampedArrayPrototype) !== TypedArrayPrototype) {\n setPrototypeOf(Uint8ClampedArrayPrototype, TypedArrayPrototype);\n}\n\nif (DESCRIPTORS && !hasOwn(TypedArrayPrototype, TO_STRING_TAG)) {\n TYPED_ARRAY_TAG_REQUIRED = true;\n defineBuiltInAccessor(TypedArrayPrototype, TO_STRING_TAG, {\n configurable: true,\n get: function () {\n return isObject(this) ? this[TYPED_ARRAY_TAG] : undefined;\n }\n });\n for (NAME in TypedArrayConstructorsList) if (globalThis[NAME]) {\n createNonEnumerableProperty(globalThis[NAME].prototype, TYPED_ARRAY_TAG, NAME);\n }\n}\n\nmodule.exports = {\n NATIVE_ARRAY_BUFFER_VIEWS: NATIVE_ARRAY_BUFFER_VIEWS,\n TYPED_ARRAY_TAG: TYPED_ARRAY_TAG_REQUIRED && TYPED_ARRAY_TAG,\n aTypedArray: aTypedArray,\n aTypedArrayConstructor: aTypedArrayConstructor,\n exportTypedArrayMethod: exportTypedArrayMethod,\n exportTypedArrayStaticMethod: exportTypedArrayStaticMethod,\n getTypedArrayConstructor: getTypedArrayConstructor,\n isView: isView,\n isTypedArray: isTypedArray,\n TypedArray: TypedArray,\n TypedArrayPrototype: TypedArrayPrototype\n};\n","'use strict';\nvar lengthOfArrayLike = require('../internals/length-of-array-like');\n\nmodule.exports = function (Constructor, list, $length) {\n var index = 0;\n var length = arguments.length > 2 ? $length : lengthOfArrayLike(list);\n var result = new Constructor(length);\n while (length > index) result[index] = list[index++];\n return result;\n};\n","'use strict';\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar toAbsoluteIndex = require('../internals/to-absolute-index');\nvar lengthOfArrayLike = require('../internals/length-of-array-like');\n\n// `Array.prototype.{ indexOf, includes }` methods implementation\nvar createMethod = function (IS_INCLUDES) {\n return function ($this, el, fromIndex) {\n var O = toIndexedObject($this);\n var length = lengthOfArrayLike(O);\n if (length === 0) return !IS_INCLUDES && -1;\n var index = toAbsoluteIndex(fromIndex, length);\n var value;\n // Array#includes uses SameValueZero equality algorithm\n // eslint-disable-next-line no-self-compare -- NaN check\n if (IS_INCLUDES && el !== el) while (length > index) {\n value = O[index++];\n // eslint-disable-next-line no-self-compare -- NaN check\n if (value !== value) return true;\n // Array#indexOf ignores holes, Array#includes - not\n } else for (;length > index; index++) {\n if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;\n } return !IS_INCLUDES && -1;\n };\n};\n\nmodule.exports = {\n // `Array.prototype.includes` method\n // https://tc39.es/ecma262/#sec-array.prototype.includes\n includes: createMethod(true),\n // `Array.prototype.indexOf` method\n // https://tc39.es/ecma262/#sec-array.prototype.indexof\n indexOf: createMethod(false)\n};\n","'use strict';\nvar DESCRIPTORS = require('../internals/descriptors');\nvar isArray = require('../internals/is-array');\n\nvar $TypeError = TypeError;\n// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe\nvar getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\n\n// Safari < 13 does not throw an error in this case\nvar SILENT_ON_NON_WRITABLE_LENGTH_SET = DESCRIPTORS && !function () {\n // makes no sense without proper strict mode support\n if (this !== undefined) return true;\n try {\n // eslint-disable-next-line es/no-object-defineproperty -- safe\n Object.defineProperty([], 'length', { writable: false }).length = 1;\n } catch (error) {\n return error instanceof TypeError;\n }\n}();\n\nmodule.exports = SILENT_ON_NON_WRITABLE_LENGTH_SET ? function (O, length) {\n if (isArray(O) && !getOwnPropertyDescriptor(O, 'length').writable) {\n throw new $TypeError('Cannot set read only .length');\n } return O.length = length;\n} : function (O, length) {\n return O.length = length;\n};\n","'use strict';\nvar uncurryThis = require('../internals/function-uncurry-this');\n\nmodule.exports = uncurryThis([].slice);\n","'use strict';\nvar anObject = require('../internals/an-object');\nvar iteratorClose = require('../internals/iterator-close');\n\n// call something on iterator step with safe closing on error\nmodule.exports = function (iterator, fn, value, ENTRIES) {\n try {\n return ENTRIES ? fn(anObject(value)[0], value[1]) : fn(value);\n } catch (error) {\n iteratorClose(iterator, 'throw', error);\n }\n};\n","'use strict';\nvar uncurryThis = require('../internals/function-uncurry-this');\n\nvar toString = uncurryThis({}.toString);\nvar stringSlice = uncurryThis(''.slice);\n\nmodule.exports = function (it) {\n return stringSlice(toString(it), 8, -1);\n};\n","'use strict';\nvar TO_STRING_TAG_SUPPORT = require('../internals/to-string-tag-support');\nvar isCallable = require('../internals/is-callable');\nvar classofRaw = require('../internals/classof-raw');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar TO_STRING_TAG = wellKnownSymbol('toStringTag');\nvar $Object = Object;\n\n// ES3 wrong here\nvar CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) === 'Arguments';\n\n// fallback for IE11 Script Access Denied error\nvar tryGet = function (it, key) {\n try {\n return it[key];\n } catch (error) { /* empty */ }\n};\n\n// getting tag from ES6+ `Object.prototype.toString`\nmodule.exports = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {\n var O, tag, result;\n return it === undefined ? 'Undefined' : it === null ? 'Null'\n // @@toStringTag case\n : typeof (tag = tryGet(O = $Object(it), TO_STRING_TAG)) == 'string' ? tag\n // builtinTag case\n : CORRECT_ARGUMENTS ? classofRaw(O)\n // ES3 arguments fallback\n : (result = classofRaw(O)) === 'Object' && isCallable(O.callee) ? 'Arguments' : result;\n};\n","'use strict';\nvar hasOwn = require('../internals/has-own-property');\nvar ownKeys = require('../internals/own-keys');\nvar getOwnPropertyDescriptorModule = require('../internals/object-get-own-property-descriptor');\nvar definePropertyModule = require('../internals/object-define-property');\n\nmodule.exports = function (target, source, exceptions) {\n var keys = ownKeys(source);\n var defineProperty = definePropertyModule.f;\n var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n if (!hasOwn(target, key) && !(exceptions && hasOwn(exceptions, key))) {\n defineProperty(target, key, getOwnPropertyDescriptor(source, key));\n }\n }\n};\n","'use strict';\nvar fails = require('../internals/fails');\n\nmodule.exports = !fails(function () {\n function F() { /* empty */ }\n F.prototype.constructor = null;\n // eslint-disable-next-line es/no-object-getprototypeof -- required for testing\n return Object.getPrototypeOf(new F()) !== F.prototype;\n});\n","'use strict';\nvar DESCRIPTORS = require('../internals/descriptors');\nvar definePropertyModule = require('../internals/object-define-property');\nvar createPropertyDescriptor = require('../internals/create-property-descriptor');\n\nmodule.exports = DESCRIPTORS ? function (object, key, value) {\n return definePropertyModule.f(object, key, createPropertyDescriptor(1, value));\n} : function (object, key, value) {\n object[key] = value;\n return object;\n};\n","'use strict';\nmodule.exports = function (bitmap, value) {\n return {\n enumerable: !(bitmap & 1),\n configurable: !(bitmap & 2),\n writable: !(bitmap & 4),\n value: value\n };\n};\n","'use strict';\nvar DESCRIPTORS = require('../internals/descriptors');\nvar definePropertyModule = require('../internals/object-define-property');\nvar createPropertyDescriptor = require('../internals/create-property-descriptor');\n\nmodule.exports = function (object, key, value) {\n if (DESCRIPTORS) definePropertyModule.f(object, key, createPropertyDescriptor(0, value));\n else object[key] = value;\n};\n","'use strict';\nvar makeBuiltIn = require('../internals/make-built-in');\nvar defineProperty = require('../internals/object-define-property');\n\nmodule.exports = function (target, name, descriptor) {\n if (descriptor.get) makeBuiltIn(descriptor.get, name, { getter: true });\n if (descriptor.set) makeBuiltIn(descriptor.set, name, { setter: true });\n return defineProperty.f(target, name, descriptor);\n};\n","'use strict';\nvar isCallable = require('../internals/is-callable');\nvar definePropertyModule = require('../internals/object-define-property');\nvar makeBuiltIn = require('../internals/make-built-in');\nvar defineGlobalProperty = require('../internals/define-global-property');\n\nmodule.exports = function (O, key, value, options) {\n if (!options) options = {};\n var simple = options.enumerable;\n var name = options.name !== undefined ? options.name : key;\n if (isCallable(value)) makeBuiltIn(value, name, options);\n if (options.global) {\n if (simple) O[key] = value;\n else defineGlobalProperty(key, value);\n } else {\n try {\n if (!options.unsafe) delete O[key];\n else if (O[key]) simple = true;\n } catch (error) { /* empty */ }\n if (simple) O[key] = value;\n else definePropertyModule.f(O, key, {\n value: value,\n enumerable: false,\n configurable: !options.nonConfigurable,\n writable: !options.nonWritable\n });\n } return O;\n};\n","'use strict';\nvar defineBuiltIn = require('../internals/define-built-in');\n\nmodule.exports = function (target, src, options) {\n for (var key in src) defineBuiltIn(target, key, src[key], options);\n return target;\n};\n","'use strict';\nvar globalThis = require('../internals/global-this');\n\n// eslint-disable-next-line es/no-object-defineproperty -- safe\nvar defineProperty = Object.defineProperty;\n\nmodule.exports = function (key, value) {\n try {\n defineProperty(globalThis, key, { value: value, configurable: true, writable: true });\n } catch (error) {\n globalThis[key] = value;\n } return value;\n};\n","'use strict';\nvar fails = require('../internals/fails');\n\n// Detect IE8's incomplete defineProperty implementation\nmodule.exports = !fails(function () {\n // eslint-disable-next-line es/no-object-defineproperty -- required for testing\n return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] !== 7;\n});\n","'use strict';\nvar globalThis = require('../internals/global-this');\nvar isObject = require('../internals/is-object');\n\nvar document = globalThis.document;\n// typeof document.createElement is 'object' in old IE\nvar EXISTS = isObject(document) && isObject(document.createElement);\n\nmodule.exports = function (it) {\n return EXISTS ? document.createElement(it) : {};\n};\n","'use strict';\n// IE8- don't enum bug keys\nmodule.exports = [\n 'constructor',\n 'hasOwnProperty',\n 'isPrototypeOf',\n 'propertyIsEnumerable',\n 'toLocaleString',\n 'toString',\n 'valueOf'\n];\n","'use strict';\nvar globalThis = require('../internals/global-this');\n\nvar navigator = globalThis.navigator;\nvar userAgent = navigator && navigator.userAgent;\n\nmodule.exports = userAgent ? String(userAgent) : '';\n","'use strict';\nvar globalThis = require('../internals/global-this');\nvar userAgent = require('../internals/environment-user-agent');\n\nvar process = globalThis.process;\nvar Deno = globalThis.Deno;\nvar versions = process && process.versions || Deno && Deno.version;\nvar v8 = versions && versions.v8;\nvar match, version;\n\nif (v8) {\n match = v8.split('.');\n // in old Chrome, versions of V8 isn't V8 = Chrome / 10\n // but their correct versions are not interesting for us\n version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);\n}\n\n// BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`\n// so check `userAgent` even if `.v8` exists, but 0\nif (!version && userAgent) {\n match = userAgent.match(/Edge\\/(\\d+)/);\n if (!match || match[1] >= 74) {\n match = userAgent.match(/Chrome\\/(\\d+)/);\n if (match) version = +match[1];\n }\n}\n\nmodule.exports = version;\n","'use strict';\nvar uncurryThis = require('../internals/function-uncurry-this');\n\nvar $Error = Error;\nvar replace = uncurryThis(''.replace);\n\nvar TEST = (function (arg) { return String(new $Error(arg).stack); })('zxcasd');\n// eslint-disable-next-line redos/no-vulnerable -- safe\nvar V8_OR_CHAKRA_STACK_ENTRY = /\\n\\s*at [^:]*:[^\\n]*/;\nvar IS_V8_OR_CHAKRA_STACK = V8_OR_CHAKRA_STACK_ENTRY.test(TEST);\n\nmodule.exports = function (stack, dropEntries) {\n if (IS_V8_OR_CHAKRA_STACK && typeof stack == 'string' && !$Error.prepareStackTrace) {\n while (dropEntries--) stack = replace(stack, V8_OR_CHAKRA_STACK_ENTRY, '');\n } return stack;\n};\n","'use strict';\nvar globalThis = require('../internals/global-this');\nvar getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f;\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar defineBuiltIn = require('../internals/define-built-in');\nvar defineGlobalProperty = require('../internals/define-global-property');\nvar copyConstructorProperties = require('../internals/copy-constructor-properties');\nvar isForced = require('../internals/is-forced');\n\n/*\n options.target - name of the target object\n options.global - target is the global object\n options.stat - export as static methods of target\n options.proto - export as prototype methods of target\n options.real - real prototype method for the `pure` version\n options.forced - export even if the native feature is available\n options.bind - bind methods to the target, required for the `pure` version\n options.wrap - wrap constructors to preventing global pollution, required for the `pure` version\n options.unsafe - use the simple assignment of property instead of delete + defineProperty\n options.sham - add a flag to not completely full polyfills\n options.enumerable - export as enumerable property\n options.dontCallGetSet - prevent calling a getter on target\n options.name - the .name of the function if it does not match the key\n*/\nmodule.exports = function (options, source) {\n var TARGET = options.target;\n var GLOBAL = options.global;\n var STATIC = options.stat;\n var FORCED, target, key, targetProperty, sourceProperty, descriptor;\n if (GLOBAL) {\n target = globalThis;\n } else if (STATIC) {\n target = globalThis[TARGET] || defineGlobalProperty(TARGET, {});\n } else {\n target = globalThis[TARGET] && globalThis[TARGET].prototype;\n }\n if (target) for (key in source) {\n sourceProperty = source[key];\n if (options.dontCallGetSet) {\n descriptor = getOwnPropertyDescriptor(target, key);\n targetProperty = descriptor && descriptor.value;\n } else targetProperty = target[key];\n FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);\n // contained in target\n if (!FORCED && targetProperty !== undefined) {\n if (typeof sourceProperty == typeof targetProperty) continue;\n copyConstructorProperties(sourceProperty, targetProperty);\n }\n // add a flag to not completely full polyfills\n if (options.sham || (targetProperty && targetProperty.sham)) {\n createNonEnumerableProperty(sourceProperty, 'sham', true);\n }\n defineBuiltIn(target, key, sourceProperty, options);\n }\n};\n","'use strict';\nmodule.exports = function (exec) {\n try {\n return !!exec();\n } catch (error) {\n return true;\n }\n};\n","'use strict';\nvar NATIVE_BIND = require('../internals/function-bind-native');\n\nvar FunctionPrototype = Function.prototype;\nvar apply = FunctionPrototype.apply;\nvar call = FunctionPrototype.call;\n\n// eslint-disable-next-line es/no-function-prototype-bind, es/no-reflect -- safe\nmodule.exports = typeof Reflect == 'object' && Reflect.apply || (NATIVE_BIND ? call.bind(apply) : function () {\n return call.apply(apply, arguments);\n});\n","'use strict';\nvar uncurryThis = require('../internals/function-uncurry-this-clause');\nvar aCallable = require('../internals/a-callable');\nvar NATIVE_BIND = require('../internals/function-bind-native');\n\nvar bind = uncurryThis(uncurryThis.bind);\n\n// optional / simple context binding\nmodule.exports = function (fn, that) {\n aCallable(fn);\n return that === undefined ? fn : NATIVE_BIND ? bind(fn, that) : function (/* ...args */) {\n return fn.apply(that, arguments);\n };\n};\n","'use strict';\nvar fails = require('../internals/fails');\n\nmodule.exports = !fails(function () {\n // eslint-disable-next-line es/no-function-prototype-bind -- safe\n var test = function () { /* empty */ }.bind();\n // eslint-disable-next-line no-prototype-builtins -- safe\n return typeof test != 'function' || test.hasOwnProperty('prototype');\n});\n","'use strict';\nvar NATIVE_BIND = require('../internals/function-bind-native');\n\nvar call = Function.prototype.call;\n// eslint-disable-next-line es/no-function-prototype-bind -- safe\nmodule.exports = NATIVE_BIND ? call.bind(call) : function () {\n return call.apply(call, arguments);\n};\n","'use strict';\nvar DESCRIPTORS = require('../internals/descriptors');\nvar hasOwn = require('../internals/has-own-property');\n\nvar FunctionPrototype = Function.prototype;\n// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe\nvar getDescriptor = DESCRIPTORS && Object.getOwnPropertyDescriptor;\n\nvar EXISTS = hasOwn(FunctionPrototype, 'name');\n// additional protection from minified / mangled / dropped function names\nvar PROPER = EXISTS && function something() { /* empty */ }.name === 'something';\nvar CONFIGURABLE = EXISTS && (!DESCRIPTORS || (DESCRIPTORS && getDescriptor(FunctionPrototype, 'name').configurable));\n\nmodule.exports = {\n EXISTS: EXISTS,\n PROPER: PROPER,\n CONFIGURABLE: CONFIGURABLE\n};\n","'use strict';\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar aCallable = require('../internals/a-callable');\n\nmodule.exports = function (object, key, method) {\n try {\n // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe\n return uncurryThis(aCallable(Object.getOwnPropertyDescriptor(object, key)[method]));\n } catch (error) { /* empty */ }\n};\n","'use strict';\nvar classofRaw = require('../internals/classof-raw');\nvar uncurryThis = require('../internals/function-uncurry-this');\n\nmodule.exports = function (fn) {\n // Nashorn bug:\n // https://github.com/zloirock/core-js/issues/1128\n // https://github.com/zloirock/core-js/issues/1130\n if (classofRaw(fn) === 'Function') return uncurryThis(fn);\n};\n","'use strict';\nvar NATIVE_BIND = require('../internals/function-bind-native');\n\nvar FunctionPrototype = Function.prototype;\nvar call = FunctionPrototype.call;\n// eslint-disable-next-line es/no-function-prototype-bind -- safe\nvar uncurryThisWithBind = NATIVE_BIND && FunctionPrototype.bind.bind(call, call);\n\nmodule.exports = NATIVE_BIND ? uncurryThisWithBind : function (fn) {\n return function () {\n return call.apply(fn, arguments);\n };\n};\n","'use strict';\nvar globalThis = require('../internals/global-this');\nvar isCallable = require('../internals/is-callable');\n\nvar aFunction = function (argument) {\n return isCallable(argument) ? argument : undefined;\n};\n\nmodule.exports = function (namespace, method) {\n return arguments.length < 2 ? aFunction(globalThis[namespace]) : globalThis[namespace] && globalThis[namespace][method];\n};\n","'use strict';\nvar call = require('../internals/function-call');\nvar anObject = require('../internals/an-object');\nvar getIteratorDirect = require('../internals/get-iterator-direct');\nvar getIteratorMethod = require('../internals/get-iterator-method-internal');\n\nmodule.exports = function (obj, stringHandling) {\n if (!stringHandling || typeof obj !== 'string') anObject(obj);\n var method = getIteratorMethod(obj);\n return getIteratorDirect(anObject(method !== undefined ? call(method, obj) : obj));\n};\n","'use strict';\nvar call = require('../internals/function-call');\nvar isCallable = require('../internals/is-callable');\nvar anObject = require('../internals/an-object');\nvar tryToString = require('../internals/try-to-string');\nvar getIteratorMethod = require('../internals/get-iterator-method-internal');\n\nvar $TypeError = TypeError;\n\nmodule.exports = function (argument, usingIterator) {\n var iteratorMethod = arguments.length < 2 ? getIteratorMethod(argument) : usingIterator;\n if (isCallable(iteratorMethod)) return anObject(call(iteratorMethod, argument));\n throw new $TypeError(tryToString(argument) + ' is not iterable');\n};\n","'use strict';\nvar classof = require('../internals/classof-raw');\nvar isNullOrUndefined = require('../internals/is-null-or-undefined');\nvar getMethod = require('../internals/get-method');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar ITERATOR = wellKnownSymbol('iterator');\nvar ArrayPrototype = Array.prototype;\n\nmodule.exports = function (it) {\n if (!isNullOrUndefined(it)) return getMethod(it, ITERATOR)\n || getMethod(it, '@@iterator')\n || (classof(it) === 'Arguments' ? ArrayPrototype[ITERATOR] : undefined);\n};\n","'use strict';\nvar aCallable = require('../internals/a-callable');\nvar isNullOrUndefined = require('../internals/is-null-or-undefined');\n\n// `GetMethod` abstract operation\n// https://tc39.es/ecma262/#sec-getmethod\nmodule.exports = function (V, P) {\n var func = V[P];\n return isNullOrUndefined(func) ? undefined : aCallable(func);\n};\n","'use strict';\nvar aCallable = require('../internals/a-callable');\nvar anObject = require('../internals/an-object');\nvar call = require('../internals/function-call');\nvar toIntegerOrInfinity = require('../internals/to-integer-or-infinity');\nvar getIteratorDirect = require('../internals/get-iterator-direct');\n\nvar INVALID_SIZE = 'Invalid size';\nvar $RangeError = RangeError;\nvar $TypeError = TypeError;\nvar max = Math.max;\n\nvar SetRecord = function (set, intSize) {\n this.set = set;\n this.size = max(intSize, 0);\n this.has = aCallable(set.has);\n this.keys = aCallable(set.keys);\n};\n\nSetRecord.prototype = {\n getIterator: function () {\n return getIteratorDirect(anObject(call(this.keys, this.set)));\n },\n includes: function (it) {\n return call(this.has, this.set, it);\n }\n};\n\n// `GetSetRecord` abstract operation\n// https://tc39.es/proposal-set-methods/#sec-getsetrecord\nmodule.exports = function (obj) {\n anObject(obj);\n var numSize = +obj.size;\n // NOTE: If size is undefined, then numSize will be NaN\n // eslint-disable-next-line no-self-compare -- NaN check\n if (numSize !== numSize) throw new $TypeError(INVALID_SIZE);\n var intSize = toIntegerOrInfinity(numSize);\n if (intSize < 0) throw new $RangeError(INVALID_SIZE);\n return new SetRecord(obj, intSize);\n};\n","'use strict';\nvar check = function (it) {\n return it && it.Math === Math && it;\n};\n\n// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028\nmodule.exports =\n // eslint-disable-next-line es/no-global-this -- safe\n check(typeof globalThis == 'object' && globalThis) ||\n check(typeof window == 'object' && window) ||\n // eslint-disable-next-line no-restricted-globals -- safe\n check(typeof self == 'object' && self) ||\n check(typeof global == 'object' && global) ||\n check(typeof this == 'object' && this) ||\n // eslint-disable-next-line no-new-func -- fallback\n (function () { return this; })() || Function('return this')();\n","'use strict';\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar toObject = require('../internals/to-object');\n\nvar hasOwnProperty = uncurryThis({}.hasOwnProperty);\n\n// `HasOwnProperty` abstract operation\n// https://tc39.es/ecma262/#sec-hasownproperty\n// eslint-disable-next-line es/no-object-hasown -- safe\nmodule.exports = Object.hasOwn || function hasOwn(it, key) {\n return hasOwnProperty(toObject(it), key);\n};\n","'use strict';\nmodule.exports = {};\n","'use strict';\nvar getBuiltIn = require('../internals/get-built-in');\n\nmodule.exports = getBuiltIn('document', 'documentElement');\n","'use strict';\nvar DESCRIPTORS = require('../internals/descriptors');\nvar fails = require('../internals/fails');\nvar createElement = require('../internals/document-create-element');\n\n// Thanks to IE8 for its funny defineProperty\nmodule.exports = !DESCRIPTORS && !fails(function () {\n // eslint-disable-next-line es/no-object-defineproperty -- required for testing\n return Object.defineProperty(createElement('div'), 'a', {\n get: function () { return 7; }\n }).a !== 7;\n});\n","'use strict';\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar fails = require('../internals/fails');\nvar classof = require('../internals/classof-raw');\n\nvar $Object = Object;\nvar split = uncurryThis(''.split);\n\n// fallback for non-array-like ES3 and non-enumerable old V8 strings\nmodule.exports = fails(function () {\n // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346\n // eslint-disable-next-line no-prototype-builtins -- safe\n return !$Object('z').propertyIsEnumerable(0);\n}) ? function (it) {\n return classof(it) === 'String' ? split(it, '') : $Object(it);\n} : $Object;\n","'use strict';\nvar isCallable = require('../internals/is-callable');\nvar isObject = require('../internals/is-object');\nvar setPrototypeOf = require('../internals/object-set-prototype-of');\n\n// makes subclassing work correct for wrapped built-ins\nmodule.exports = function ($this, dummy, Wrapper) {\n var NewTarget, NewTargetPrototype;\n if (\n // it can work only with native `setPrototypeOf`\n setPrototypeOf &&\n // we haven't completely correct pre-ES6 way for getting `new.target`, so use this\n isCallable(NewTarget = dummy.constructor) &&\n NewTarget !== Wrapper &&\n isObject(NewTargetPrototype = NewTarget.prototype) &&\n NewTargetPrototype !== Wrapper.prototype\n ) setPrototypeOf($this, NewTargetPrototype);\n return $this;\n};\n","'use strict';\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar isCallable = require('../internals/is-callable');\nvar store = require('../internals/shared-store');\n\nvar functionToString = uncurryThis(Function.toString);\n\n// this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper\nif (!isCallable(store.inspectSource)) {\n store.inspectSource = function (it) {\n return functionToString(it);\n };\n}\n\nmodule.exports = store.inspectSource;\n","'use strict';\nvar NATIVE_WEAK_MAP = require('../internals/weak-map-basic-detection');\nvar globalThis = require('../internals/global-this');\nvar isObject = require('../internals/is-object');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar hasOwn = require('../internals/has-own-property');\nvar shared = require('../internals/shared-store');\nvar sharedKey = require('../internals/shared-key');\nvar hiddenKeys = require('../internals/hidden-keys');\n\nvar OBJECT_ALREADY_INITIALIZED = 'Object already initialized';\nvar TypeError = globalThis.TypeError;\nvar WeakMap = globalThis.WeakMap;\nvar set, get, has;\n\nvar enforce = function (it) {\n return has(it) ? get(it) : set(it, {});\n};\n\nvar getterFor = function (TYPE) {\n return function (it) {\n var state;\n if (!isObject(it) || (state = get(it)).type !== TYPE) {\n throw new TypeError('Incompatible receiver, ' + TYPE + ' required');\n } return state;\n };\n};\n\nif (NATIVE_WEAK_MAP || shared.state) {\n var store = shared.state || (shared.state = new WeakMap());\n /* eslint-disable no-self-assign -- prototype methods protection */\n store.get = store.get;\n store.has = store.has;\n store.set = store.set;\n /* eslint-enable no-self-assign -- prototype methods protection */\n set = function (it, metadata) {\n if (store.has(it)) throw new TypeError(OBJECT_ALREADY_INITIALIZED);\n metadata.facade = it;\n store.set(it, metadata);\n return metadata;\n };\n get = function (it) {\n return store.get(it) || {};\n };\n has = function (it) {\n return store.has(it);\n };\n} else {\n var STATE = sharedKey('state');\n hiddenKeys[STATE] = true;\n set = function (it, metadata) {\n if (hasOwn(it, STATE)) throw new TypeError(OBJECT_ALREADY_INITIALIZED);\n metadata.facade = it;\n createNonEnumerableProperty(it, STATE, metadata);\n return metadata;\n };\n get = function (it) {\n return hasOwn(it, STATE) ? it[STATE] : {};\n };\n has = function (it) {\n return hasOwn(it, STATE);\n };\n}\n\nmodule.exports = {\n set: set,\n get: get,\n has: has,\n enforce: enforce,\n getterFor: getterFor\n};\n","'use strict';\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar Iterators = require('../internals/iterators');\n\nvar ITERATOR = wellKnownSymbol('iterator');\nvar ArrayPrototype = Array.prototype;\n\n// check on default Array iterator\nmodule.exports = function (it) {\n return it !== undefined && (Iterators.Array === it || ArrayPrototype[ITERATOR] === it);\n};\n","'use strict';\nvar classof = require('../internals/classof-raw');\n\n// `IsArray` abstract operation\n// https://tc39.es/ecma262/#sec-isarray\n// eslint-disable-next-line es/no-array-isarray -- safe\nmodule.exports = Array.isArray || function isArray(argument) {\n return classof(argument) === 'Array';\n};\n","'use strict';\nvar classof = require('../internals/classof');\n\nmodule.exports = function (it) {\n var klass = classof(it);\n return klass === 'BigInt64Array' || klass === 'BigUint64Array';\n};\n","'use strict';\n// https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot\nvar documentAll = typeof document == 'object' && document.all;\n\n// `IsCallable` abstract operation\n// https://tc39.es/ecma262/#sec-iscallable\n// eslint-disable-next-line unicorn/no-typeof-undefined -- required for testing\nmodule.exports = typeof documentAll == 'undefined' && documentAll !== undefined ? function (argument) {\n return typeof argument == 'function' || argument === documentAll;\n} : function (argument) {\n return typeof argument == 'function';\n};\n","'use strict';\nvar fails = require('../internals/fails');\nvar isCallable = require('../internals/is-callable');\n\nvar replacement = /#|\\.prototype\\./;\n\nvar isForced = function (feature, detection) {\n var value = data[normalize(feature)];\n return value === POLYFILL ? true\n : value === NATIVE ? false\n : isCallable(detection) ? fails(detection)\n : !!detection;\n};\n\nvar normalize = isForced.normalize = function (string) {\n return String(string).replace(replacement, '.').toLowerCase();\n};\n\nvar data = isForced.data = {};\nvar NATIVE = isForced.NATIVE = 'N';\nvar POLYFILL = isForced.POLYFILL = 'P';\n\nmodule.exports = isForced;\n","'use strict';\nvar isCallable = require('../internals/is-callable');\n\nmodule.exports = function (it) {\n return typeof it == 'object' ? it !== null : isCallable(it);\n};\n","'use strict';\nvar isObject = require('../internals/is-object');\n\nmodule.exports = function (argument) {\n return isObject(argument) || argument === null;\n};\n","'use strict';\nmodule.exports = false;\n","'use strict';\nvar isObject = require('../internals/is-object');\nvar getInternalState = require('../internals/internal-state').get;\n\nmodule.exports = function isRawJSON(O) {\n if (!isObject(O)) return false;\n var state = getInternalState(O);\n return !!state && state.type === 'RawJSON';\n};\n","'use strict';\nvar getBuiltIn = require('../internals/get-built-in');\nvar isCallable = require('../internals/is-callable');\nvar isPrototypeOf = require('../internals/object-is-prototype-of');\nvar USE_SYMBOL_AS_UID = require('../internals/use-symbol-as-uid');\n\nvar $Object = Object;\n\nmodule.exports = USE_SYMBOL_AS_UID ? function (it) {\n return typeof it == 'symbol';\n} : function (it) {\n var $Symbol = getBuiltIn('Symbol');\n return isCallable($Symbol) && isPrototypeOf($Symbol.prototype, $Object(it));\n};\n","'use strict';\nvar call = require('../internals/function-call');\n\nmodule.exports = function (record, fn, ITERATOR_INSTEAD_OF_RECORD) {\n var iterator = ITERATOR_INSTEAD_OF_RECORD ? record : record.iterator;\n var next = record.next;\n var step, result;\n while (!(step = call(next, iterator)).done) {\n result = fn(step.value);\n if (result !== undefined) return result;\n }\n};\n","'use strict';\nvar bind = require('../internals/function-bind-context');\nvar call = require('../internals/function-call');\nvar anObject = require('../internals/an-object');\nvar tryToString = require('../internals/try-to-string');\nvar isArrayIteratorMethod = require('../internals/is-array-iterator-method');\nvar lengthOfArrayLike = require('../internals/length-of-array-like');\nvar isPrototypeOf = require('../internals/object-is-prototype-of');\nvar getIterator = require('../internals/get-iterator-internal');\nvar getIteratorMethod = require('../internals/get-iterator-method-internal');\nvar iteratorClose = require('../internals/iterator-close');\n\nvar $TypeError = TypeError;\n\nvar Result = function (stopped, result) {\n this.stopped = stopped;\n this.result = result;\n};\n\nvar ResultPrototype = Result.prototype;\n\nmodule.exports = function (iterable, unboundFunction, options) {\n var that = options && options.that;\n var AS_ENTRIES = !!(options && options.AS_ENTRIES);\n var IS_RECORD = !!(options && options.IS_RECORD);\n var IS_ITERATOR = !!(options && options.IS_ITERATOR);\n var INTERRUPTED = !!(options && options.INTERRUPTED);\n var fn = bind(unboundFunction, that);\n var iterator, iterFn, index, length, result, next, step;\n\n var stop = function (condition) {\n var $iterator = iterator;\n iterator = undefined;\n if ($iterator) iteratorClose($iterator, 'normal');\n return new Result(true, condition);\n };\n\n var callFn = function (value) {\n if (AS_ENTRIES) {\n anObject(value);\n return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]);\n } return INTERRUPTED ? fn(value, stop) : fn(value);\n };\n\n if (IS_RECORD) {\n iterator = iterable.iterator;\n } else if (IS_ITERATOR) {\n iterator = iterable;\n } else {\n iterFn = getIteratorMethod(iterable);\n if (!iterFn) throw new $TypeError(tryToString(iterable) + ' is not iterable');\n // optimisation for array iterators\n if (isArrayIteratorMethod(iterFn)) {\n for (index = 0, length = lengthOfArrayLike(iterable); length > index; index++) {\n result = callFn(iterable[index]);\n if (result && isPrototypeOf(ResultPrototype, result)) return result;\n } return new Result(false);\n }\n iterator = getIterator(iterable, iterFn);\n }\n\n next = IS_RECORD ? iterable.next : iterator.next;\n while (!(step = call(next, iterator)).done) {\n // `IteratorValue` errors should propagate without closing the iterator\n var value = step.value;\n try {\n result = callFn(value);\n } catch (error) {\n if (iterator) iteratorClose(iterator, 'throw', error);\n else throw error;\n }\n if (typeof result == 'object' && result && isPrototypeOf(ResultPrototype, result)) return result;\n } return new Result(false);\n};\n","'use strict';\nvar iteratorClose = require('../internals/iterator-close');\n\nmodule.exports = function (iters, kind, value) {\n for (var i = iters.length - 1; i >= 0; i--) {\n if (iters[i] === undefined) continue;\n try {\n value = iteratorClose(iters[i].iterator, kind, value);\n } catch (error) {\n kind = 'throw';\n value = error;\n }\n }\n if (kind === 'throw') throw value;\n return value;\n};\n","'use strict';\nvar call = require('../internals/function-call');\nvar anObject = require('../internals/an-object');\nvar getMethod = require('../internals/get-method');\n\nmodule.exports = function (iterator, kind, value) {\n var innerResult, innerError;\n anObject(iterator);\n try {\n innerResult = getMethod(iterator, 'return');\n if (!innerResult) {\n if (kind === 'throw') throw value;\n return value;\n }\n innerResult = call(innerResult, iterator);\n } catch (error) {\n innerError = true;\n innerResult = error;\n }\n if (kind === 'throw') throw value;\n if (innerError) throw innerResult;\n anObject(innerResult);\n return value;\n};\n","'use strict';\nvar call = require('../internals/function-call');\nvar create = require('../internals/object-create');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar defineBuiltIns = require('../internals/define-built-ins');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar InternalStateModule = require('../internals/internal-state');\nvar getMethod = require('../internals/get-method');\nvar IteratorPrototype = require('../internals/iterators-core').IteratorPrototype;\nvar createIterResultObject = require('../internals/create-iter-result-object');\nvar iteratorClose = require('../internals/iterator-close');\nvar iteratorCloseAll = require('../internals/iterator-close-all');\nvar cleanupState = require('../internals/iterator-cleanup-state');\n\nvar TO_STRING_TAG = wellKnownSymbol('toStringTag');\nvar ITERATOR_HELPER = 'IteratorHelper';\nvar WRAP_FOR_VALID_ITERATOR = 'WrapForValidIterator';\nvar NORMAL = 'normal';\nvar THROW = 'throw';\nvar setInternalState = InternalStateModule.set;\n\nvar createIteratorProxyPrototype = function (IS_ITERATOR) {\n var getInternalState = InternalStateModule.getterFor(IS_ITERATOR ? WRAP_FOR_VALID_ITERATOR : ITERATOR_HELPER);\n\n return defineBuiltIns(create(IteratorPrototype), {\n next: function next() {\n var state = getInternalState(this);\n // for simplification:\n // for `%WrapForValidIteratorPrototype%.next` or with `state.returnHandlerResult` our `nextHandler` returns `IterResultObject`\n // for `%IteratorHelperPrototype%.next` - just a value\n if (IS_ITERATOR) return state.nextHandler();\n if (state.done) return createIterResultObject(undefined, true);\n try {\n var result = state.nextHandler();\n if (state.done) cleanupState(state);\n return state.returnHandlerResult ? result : createIterResultObject(result, state.done);\n } catch (error) {\n state.done = true;\n cleanupState(state);\n throw error;\n }\n },\n 'return': function () {\n var state = getInternalState(this);\n var iterator = state.iterator;\n var inner = state.inner;\n var openIters = state.openIters;\n var done = state.done;\n state.done = true;\n if (IS_ITERATOR) {\n var returnMethod = getMethod(iterator, 'return');\n return returnMethod ? call(returnMethod, iterator) : createIterResultObject(undefined, true);\n }\n cleanupState(state);\n if (done) return createIterResultObject(undefined, true);\n if (inner) try {\n iteratorClose(inner.iterator, NORMAL);\n } catch (error) {\n return iteratorClose(iterator, THROW, error);\n }\n if (openIters) try {\n iteratorCloseAll(openIters, NORMAL);\n } catch (error) {\n if (iterator) return iteratorClose(iterator, THROW, error);\n throw error;\n }\n if (iterator) iteratorClose(iterator, NORMAL);\n return createIterResultObject(undefined, true);\n }\n });\n};\n\nvar WrapForValidIteratorPrototype = createIteratorProxyPrototype(true);\nvar IteratorHelperPrototype = createIteratorProxyPrototype(false);\n\ncreateNonEnumerableProperty(IteratorHelperPrototype, TO_STRING_TAG, 'Iterator Helper');\n\nmodule.exports = function (nextHandler, IS_ITERATOR, RETURN_HANDLER_RESULT) {\n var IteratorProxy = function Iterator(record, state) {\n if (state) {\n state.iterator = record.iterator;\n state.next = record.next;\n } else state = record;\n state.type = IS_ITERATOR ? WRAP_FOR_VALID_ITERATOR : ITERATOR_HELPER;\n state.returnHandlerResult = !!RETURN_HANDLER_RESULT;\n state.nextHandler = nextHandler;\n state.counter = 0;\n state.done = false;\n setInternalState(this, state);\n };\n\n IteratorProxy.prototype = IS_ITERATOR ? WrapForValidIteratorPrototype : IteratorHelperPrototype;\n\n return IteratorProxy;\n};\n","'use strict';\nvar globalThis = require('../internals/global-this');\n\n// https://github.com/tc39/ecma262/pull/3467\nmodule.exports = function (METHOD_NAME, ExpectedError) {\n var Iterator = globalThis.Iterator;\n var IteratorPrototype = Iterator && Iterator.prototype;\n var method = IteratorPrototype && IteratorPrototype[METHOD_NAME];\n\n var CLOSED = false;\n\n if (method) try {\n method.call({\n next: function () { return { done: true }; },\n 'return': function () { CLOSED = true; }\n }, -1);\n } catch (error) {\n // https://bugs.webkit.org/show_bug.cgi?id=291195\n if (!(error instanceof ExpectedError)) CLOSED = false;\n }\n\n if (!CLOSED) return method;\n};\n","'use strict';\nvar fails = require('../internals/fails');\nvar isCallable = require('../internals/is-callable');\nvar isObject = require('../internals/is-object');\nvar create = require('../internals/object-create');\nvar getPrototypeOf = require('../internals/object-get-prototype-of');\nvar defineBuiltIn = require('../internals/define-built-in');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar IS_PURE = require('../internals/is-pure');\n\nvar ITERATOR = wellKnownSymbol('iterator');\nvar BUGGY_SAFARI_ITERATORS = false;\n\n// `%IteratorPrototype%` object\n// https://tc39.es/ecma262/#sec-%iteratorprototype%-object\nvar IteratorPrototype, PrototypeOfArrayIteratorPrototype, arrayIterator;\n\n/* eslint-disable es/no-array-prototype-keys -- safe */\nif ([].keys) {\n arrayIterator = [].keys();\n // Safari 8 has buggy iterators w/o `next`\n if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS = true;\n else {\n PrototypeOfArrayIteratorPrototype = getPrototypeOf(getPrototypeOf(arrayIterator));\n if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype = PrototypeOfArrayIteratorPrototype;\n }\n}\n\nvar NEW_ITERATOR_PROTOTYPE = !isObject(IteratorPrototype) || fails(function () {\n var test = {};\n // FF44- legacy iterators case\n return IteratorPrototype[ITERATOR].call(test) !== test;\n});\n\nif (NEW_ITERATOR_PROTOTYPE) IteratorPrototype = {};\nelse if (IS_PURE) IteratorPrototype = create(IteratorPrototype);\n\n// `%IteratorPrototype%[@@iterator]()` method\n// https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator\nif (!isCallable(IteratorPrototype[ITERATOR])) {\n defineBuiltIn(IteratorPrototype, ITERATOR, function () {\n return this;\n });\n}\n\nmodule.exports = {\n IteratorPrototype: IteratorPrototype,\n BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS\n};\n","'use strict';\nvar toLength = require('../internals/to-length');\n\n// `LengthOfArrayLike` abstract operation\n// https://tc39.es/ecma262/#sec-lengthofarraylike\nmodule.exports = function (obj) {\n return toLength(obj.length);\n};\n","'use strict';\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar fails = require('../internals/fails');\nvar isCallable = require('../internals/is-callable');\nvar hasOwn = require('../internals/has-own-property');\nvar DESCRIPTORS = require('../internals/descriptors');\nvar CONFIGURABLE_FUNCTION_NAME = require('../internals/function-name').CONFIGURABLE;\nvar inspectSource = require('../internals/inspect-source');\nvar InternalStateModule = require('../internals/internal-state');\n\nvar enforceInternalState = InternalStateModule.enforce;\nvar getInternalState = InternalStateModule.get;\nvar $String = String;\n// eslint-disable-next-line es/no-object-defineproperty -- safe\nvar defineProperty = Object.defineProperty;\nvar stringSlice = uncurryThis(''.slice);\nvar replace = uncurryThis(''.replace);\nvar join = uncurryThis([].join);\n\nvar CONFIGURABLE_LENGTH = DESCRIPTORS && !fails(function () {\n return defineProperty(function () { /* empty */ }, 'length', { value: 8 }).length !== 8;\n});\n\nvar TEMPLATE = String(String).split('String');\n\nvar makeBuiltIn = module.exports = function (value, name, options) {\n if (stringSlice($String(name), 0, 7) === 'Symbol(') {\n name = '[' + replace($String(name), /^Symbol\\(([^)]*)\\).*$/, '$1') + ']';\n }\n if (options && options.getter) name = 'get ' + name;\n if (options && options.setter) name = 'set ' + name;\n if (!hasOwn(value, 'name') || (CONFIGURABLE_FUNCTION_NAME && value.name !== name)) {\n if (DESCRIPTORS) defineProperty(value, 'name', { value: name, configurable: true });\n else value.name = name;\n }\n if (CONFIGURABLE_LENGTH && options && hasOwn(options, 'arity') && value.length !== options.arity) {\n defineProperty(value, 'length', { value: options.arity });\n }\n try {\n if (options && hasOwn(options, 'constructor') && options.constructor) {\n if (DESCRIPTORS) defineProperty(value, 'prototype', { writable: false });\n // in V8 ~ Chrome 53, prototypes of some methods, like `Array.prototype.values`, are non-writable\n } else if (value.prototype) value.prototype = undefined;\n } catch (error) { /* empty */ }\n var state = enforceInternalState(value);\n if (!hasOwn(state, 'source')) {\n state.source = join(TEMPLATE, typeof name == 'string' ? name : '');\n } return value;\n};\n\n// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative\n// eslint-disable-next-line no-extend-native -- required\nFunction.prototype.toString = makeBuiltIn(function toString() {\n return isCallable(this) && getInternalState(this).source || inspectSource(this);\n}, 'toString');\n","'use strict';\nvar uncurryThis = require('../internals/function-uncurry-this');\n\n// eslint-disable-next-line es/no-map -- safe\nvar MapPrototype = Map.prototype;\n\nmodule.exports = {\n // eslint-disable-next-line es/no-map -- safe\n Map: Map,\n set: uncurryThis(MapPrototype.set),\n get: uncurryThis(MapPrototype.get),\n has: uncurryThis(MapPrototype.has),\n remove: uncurryThis(MapPrototype['delete']),\n proto: MapPrototype\n};\n","'use strict';\n/* eslint-disable es/no-json -- safe */\nvar fails = require('../internals/fails');\n\nmodule.exports = !fails(function () {\n var unsafeInt = '9007199254740993';\n // eslint-disable-next-line es/no-json-rawjson -- feature detection\n var raw = JSON.rawJSON(unsafeInt);\n // eslint-disable-next-line es/no-json-israwjson -- feature detection\n return !JSON.isRawJSON(raw) || JSON.stringify(raw) !== unsafeInt;\n});\n","'use strict';\nvar aCallable = require('../internals/a-callable');\n\nvar $TypeError = TypeError;\n\nvar PromiseCapability = function (C) {\n var resolve, reject;\n this.promise = new C(function ($$resolve, $$reject) {\n if (resolve !== undefined || reject !== undefined) throw new $TypeError('Bad Promise constructor');\n resolve = $$resolve;\n reject = $$reject;\n });\n this.resolve = aCallable(resolve);\n this.reject = aCallable(reject);\n};\n\n// `NewPromiseCapability` abstract operation\n// https://tc39.es/ecma262/#sec-newpromisecapability\nmodule.exports.f = function (C) {\n return new PromiseCapability(C);\n};\n","'use strict';\nvar toString = require('../internals/to-string');\n\nmodule.exports = function (argument, $default) {\n return argument === undefined ? arguments.length < 2 ? '' : $default : toString(argument);\n};\n","'use strict';\n/* global ActiveXObject -- old IE, WSH */\nvar anObject = require('../internals/an-object');\nvar definePropertiesModule = require('../internals/object-define-properties');\nvar enumBugKeys = require('../internals/enum-bug-keys');\nvar hiddenKeys = require('../internals/hidden-keys');\nvar html = require('../internals/html');\nvar documentCreateElement = require('../internals/document-create-element');\nvar sharedKey = require('../internals/shared-key');\n\nvar GT = '>';\nvar LT = '<';\nvar PROTOTYPE = 'prototype';\nvar SCRIPT = 'script';\nvar IE_PROTO = sharedKey('IE_PROTO');\n\nvar EmptyConstructor = function () { /* empty */ };\n\nvar scriptTag = function (content) {\n return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;\n};\n\n// Create object with fake `null` prototype: use ActiveX Object with cleared prototype\nvar NullProtoObjectViaActiveX = function (activeXDocument) {\n activeXDocument.write(scriptTag(''));\n activeXDocument.close();\n var temp = activeXDocument.parentWindow.Object;\n // eslint-disable-next-line no-useless-assignment -- avoid memory leak\n activeXDocument = null;\n return temp;\n};\n\n// Create object with fake `null` prototype: use iframe Object with cleared prototype\nvar NullProtoObjectViaIFrame = function () {\n // Thrash, waste and sodomy: IE GC bug\n var iframe = documentCreateElement('iframe');\n var JS = 'java' + SCRIPT + ':';\n var iframeDocument;\n iframe.style.display = 'none';\n html.appendChild(iframe);\n // https://github.com/zloirock/core-js/issues/475\n iframe.src = String(JS);\n iframeDocument = iframe.contentWindow.document;\n iframeDocument.open();\n iframeDocument.write(scriptTag('document.F=Object'));\n iframeDocument.close();\n return iframeDocument.F;\n};\n\n// Check for document.domain and active x support\n// No need to use active x approach when document.domain is not set\n// see https://github.com/es-shims/es5-shim/issues/150\n// variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346\n// avoid IE GC bug\nvar activeXDocument;\nvar NullProtoObject = function () {\n try {\n activeXDocument = new ActiveXObject('htmlfile');\n } catch (error) { /* ignore */ }\n NullProtoObject = typeof document != 'undefined'\n ? document.domain && activeXDocument\n ? NullProtoObjectViaActiveX(activeXDocument) // old IE\n : NullProtoObjectViaIFrame()\n : NullProtoObjectViaActiveX(activeXDocument); // WSH\n var length = enumBugKeys.length;\n while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];\n return NullProtoObject();\n};\n\nhiddenKeys[IE_PROTO] = true;\n\n// `Object.create` method\n// https://tc39.es/ecma262/#sec-object.create\n// eslint-disable-next-line es/no-object-create -- safe\nmodule.exports = Object.create || function create(O, Properties) {\n var result;\n if (O !== null) {\n EmptyConstructor[PROTOTYPE] = anObject(O);\n result = new EmptyConstructor();\n EmptyConstructor[PROTOTYPE] = null;\n // add \"__proto__\" for Object.getPrototypeOf polyfill\n result[IE_PROTO] = O;\n } else result = NullProtoObject();\n return Properties === undefined ? result : definePropertiesModule.f(result, Properties);\n};\n","'use strict';\nvar DESCRIPTORS = require('../internals/descriptors');\nvar V8_PROTOTYPE_DEFINE_BUG = require('../internals/v8-prototype-define-bug');\nvar definePropertyModule = require('../internals/object-define-property');\nvar anObject = require('../internals/an-object');\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar objectKeys = require('../internals/object-keys');\n\n// `Object.defineProperties` method\n// https://tc39.es/ecma262/#sec-object.defineproperties\n// eslint-disable-next-line es/no-object-defineproperties -- safe\nexports.f = DESCRIPTORS && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) {\n anObject(O);\n var props = toIndexedObject(Properties);\n var keys = objectKeys(Properties);\n var length = keys.length;\n var index = 0;\n var key;\n while (length > index) definePropertyModule.f(O, key = keys[index++], props[key]);\n return O;\n};\n","'use strict';\nvar DESCRIPTORS = require('../internals/descriptors');\nvar IE8_DOM_DEFINE = require('../internals/ie8-dom-define');\nvar V8_PROTOTYPE_DEFINE_BUG = require('../internals/v8-prototype-define-bug');\nvar anObject = require('../internals/an-object');\nvar toPropertyKey = require('../internals/to-property-key');\n\nvar $TypeError = TypeError;\n// eslint-disable-next-line es/no-object-defineproperty -- safe\nvar $defineProperty = Object.defineProperty;\n// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe\nvar $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\nvar ENUMERABLE = 'enumerable';\nvar CONFIGURABLE = 'configurable';\nvar WRITABLE = 'writable';\n\n// `Object.defineProperty` method\n// https://tc39.es/ecma262/#sec-object.defineproperty\nexports.f = DESCRIPTORS ? V8_PROTOTYPE_DEFINE_BUG ? function defineProperty(O, P, Attributes) {\n anObject(O);\n P = toPropertyKey(P);\n anObject(Attributes);\n if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {\n var current = $getOwnPropertyDescriptor(O, P);\n if (current && current[WRITABLE]) {\n O[P] = Attributes.value;\n Attributes = {\n configurable: CONFIGURABLE in Attributes ? Attributes[CONFIGURABLE] : current[CONFIGURABLE],\n enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],\n writable: false\n };\n }\n } return $defineProperty(O, P, Attributes);\n} : $defineProperty : function defineProperty(O, P, Attributes) {\n anObject(O);\n P = toPropertyKey(P);\n anObject(Attributes);\n if (IE8_DOM_DEFINE) try {\n return $defineProperty(O, P, Attributes);\n } catch (error) { /* empty */ }\n if ('get' in Attributes || 'set' in Attributes) throw new $TypeError('Accessors not supported');\n if ('value' in Attributes) O[P] = Attributes.value;\n return O;\n};\n","'use strict';\nvar DESCRIPTORS = require('../internals/descriptors');\nvar call = require('../internals/function-call');\nvar propertyIsEnumerableModule = require('../internals/object-property-is-enumerable');\nvar createPropertyDescriptor = require('../internals/create-property-descriptor');\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar toPropertyKey = require('../internals/to-property-key');\nvar hasOwn = require('../internals/has-own-property');\nvar IE8_DOM_DEFINE = require('../internals/ie8-dom-define');\n\n// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe\nvar $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\n\n// `Object.getOwnPropertyDescriptor` method\n// https://tc39.es/ecma262/#sec-object.getownpropertydescriptor\nexports.f = DESCRIPTORS ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {\n O = toIndexedObject(O);\n P = toPropertyKey(P);\n if (IE8_DOM_DEFINE) try {\n return $getOwnPropertyDescriptor(O, P);\n } catch (error) { /* empty */ }\n if (hasOwn(O, P)) return createPropertyDescriptor(!call(propertyIsEnumerableModule.f, O, P), O[P]);\n};\n","'use strict';\nvar internalObjectKeys = require('../internals/object-keys-internal');\nvar enumBugKeys = require('../internals/enum-bug-keys');\n\nvar hiddenKeys = enumBugKeys.concat('length', 'prototype');\n\n// `Object.getOwnPropertyNames` method\n// https://tc39.es/ecma262/#sec-object.getownpropertynames\n// eslint-disable-next-line es/no-object-getownpropertynames -- safe\nexports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {\n return internalObjectKeys(O, hiddenKeys);\n};\n","'use strict';\nvar hasOwn = require('../internals/has-own-property');\nvar isCallable = require('../internals/is-callable');\nvar toObject = require('../internals/to-object');\nvar sharedKey = require('../internals/shared-key');\nvar CORRECT_PROTOTYPE_GETTER = require('../internals/correct-prototype-getter');\n\nvar IE_PROTO = sharedKey('IE_PROTO');\nvar $Object = Object;\nvar ObjectPrototype = $Object.prototype;\n\n// `Object.getPrototypeOf` method\n// https://tc39.es/ecma262/#sec-object.getprototypeof\n// eslint-disable-next-line es/no-object-getprototypeof -- safe\nmodule.exports = CORRECT_PROTOTYPE_GETTER ? $Object.getPrototypeOf : function (O) {\n var object = toObject(O);\n if (hasOwn(object, IE_PROTO)) return object[IE_PROTO];\n var constructor = object.constructor;\n if (isCallable(constructor) && object instanceof constructor) {\n return constructor.prototype;\n } return object instanceof $Object ? ObjectPrototype : null;\n};\n","'use strict';\nvar uncurryThis = require('../internals/function-uncurry-this');\n\nmodule.exports = uncurryThis({}.isPrototypeOf);\n","'use strict';\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar hasOwn = require('../internals/has-own-property');\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar indexOf = require('../internals/array-includes').indexOf;\nvar hiddenKeys = require('../internals/hidden-keys');\n\nvar push = uncurryThis([].push);\n\nmodule.exports = function (object, names) {\n var O = toIndexedObject(object);\n var i = 0;\n var result = [];\n var key;\n for (key in O) !hasOwn(hiddenKeys, key) && hasOwn(O, key) && push(result, key);\n // Don't enum bug & hidden keys\n while (names.length > i) if (hasOwn(O, key = names[i++])) {\n ~indexOf(result, key) || push(result, key);\n }\n return result;\n};\n","'use strict';\nvar internalObjectKeys = require('../internals/object-keys-internal');\nvar enumBugKeys = require('../internals/enum-bug-keys');\n\n// `Object.keys` method\n// https://tc39.es/ecma262/#sec-object.keys\n// eslint-disable-next-line es/no-object-keys -- safe\nmodule.exports = Object.keys || function keys(O) {\n return internalObjectKeys(O, enumBugKeys);\n};\n","'use strict';\nvar $propertyIsEnumerable = {}.propertyIsEnumerable;\n// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe\nvar getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\n\n// Nashorn ~ JDK8 bug\nvar NASHORN_BUG = getOwnPropertyDescriptor && !$propertyIsEnumerable.call({ 1: 2 }, 1);\n\n// `Object.prototype.propertyIsEnumerable` method implementation\n// https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable\nexports.f = NASHORN_BUG ? function propertyIsEnumerable(V) {\n var descriptor = getOwnPropertyDescriptor(this, V);\n return !!descriptor && descriptor.enumerable;\n} : $propertyIsEnumerable;\n","'use strict';\n/* eslint-disable no-proto -- safe */\nvar uncurryThisAccessor = require('../internals/function-uncurry-this-accessor');\nvar isObject = require('../internals/is-object');\nvar requireObjectCoercible = require('../internals/require-object-coercible');\nvar aPossiblePrototype = require('../internals/a-possible-prototype');\n\n// `Object.setPrototypeOf` method\n// https://tc39.es/ecma262/#sec-object.setprototypeof\n// Works with __proto__ only. Old v8 can't work with null proto objects.\n// eslint-disable-next-line es/no-object-setprototypeof -- safe\nmodule.exports = Object.setPrototypeOf || ('__proto__' in {} ? function () {\n var CORRECT_SETTER = false;\n var test = {};\n var setter;\n try {\n setter = uncurryThisAccessor(Object.prototype, '__proto__', 'set');\n setter(test, []);\n CORRECT_SETTER = test instanceof Array;\n } catch (error) { /* empty */ }\n return function setPrototypeOf(O, proto) {\n requireObjectCoercible(O);\n aPossiblePrototype(proto);\n if (!isObject(O)) return O;\n if (CORRECT_SETTER) setter(O, proto);\n else O.__proto__ = proto;\n return O;\n };\n}() : undefined);\n","'use strict';\nvar call = require('../internals/function-call');\nvar isCallable = require('../internals/is-callable');\nvar isObject = require('../internals/is-object');\n\nvar $TypeError = TypeError;\n\n// `OrdinaryToPrimitive` abstract operation\n// https://tc39.es/ecma262/#sec-ordinarytoprimitive\nmodule.exports = function (input, pref) {\n var fn, val;\n if (pref === 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) return val;\n if (isCallable(fn = input.valueOf) && !isObject(val = call(fn, input))) return val;\n if (pref !== 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) return val;\n throw new $TypeError(\"Can't convert object to primitive value\");\n};\n","'use strict';\nvar getBuiltIn = require('../internals/get-built-in');\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar getOwnPropertyNamesModule = require('../internals/object-get-own-property-names');\nvar getOwnPropertySymbolsModule = require('../internals/object-get-own-property-symbols');\nvar anObject = require('../internals/an-object');\n\nvar concat = uncurryThis([].concat);\n\n// all object keys, includes non-enumerable and symbols\nmodule.exports = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {\n var keys = getOwnPropertyNamesModule.f(anObject(it));\n var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;\n return getOwnPropertySymbols ? concat(keys, getOwnPropertySymbols(it)) : keys;\n};\n","'use strict';\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar hasOwn = require('../internals/has-own-property');\n\nvar $SyntaxError = SyntaxError;\nvar $parseInt = parseInt;\nvar fromCharCode = String.fromCharCode;\nvar at = uncurryThis(''.charAt);\nvar slice = uncurryThis(''.slice);\nvar exec = uncurryThis(/./.exec);\n\nvar codePoints = {\n '\\\\\"': '\"',\n '\\\\\\\\': '\\\\',\n '\\\\/': '/',\n '\\\\b': '\\b',\n '\\\\f': '\\f',\n '\\\\n': '\\n',\n '\\\\r': '\\r',\n '\\\\t': '\\t'\n};\n\nvar IS_4_HEX_DIGITS = /^[\\da-f]{4}$/i;\n// eslint-disable-next-line regexp/no-control-character -- safe\nvar IS_C0_CONTROL_CODE = /^[\\u0000-\\u001F]$/;\n\nmodule.exports = function (source, i) {\n var unterminated = true;\n var value = '';\n while (i < source.length) {\n var chr = at(source, i);\n if (chr === '\\\\') {\n var twoChars = slice(source, i, i + 2);\n if (hasOwn(codePoints, twoChars)) {\n value += codePoints[twoChars];\n i += 2;\n } else if (twoChars === '\\\\u') {\n i += 2;\n var fourHexDigits = slice(source, i, i + 4);\n if (!exec(IS_4_HEX_DIGITS, fourHexDigits)) throw new $SyntaxError('Bad Unicode escape at: ' + i);\n value += fromCharCode($parseInt(fourHexDigits, 16));\n i += 4;\n } else throw new $SyntaxError('Unknown escape sequence: \"' + twoChars + '\"');\n } else if (chr === '\"') {\n unterminated = false;\n i++;\n break;\n } else {\n if (exec(IS_C0_CONTROL_CODE, chr)) throw new $SyntaxError('Bad control character in string literal at: ' + i);\n value += chr;\n i++;\n }\n }\n if (unterminated) throw new $SyntaxError('Unterminated string at: ' + i);\n return { value: value, end: i };\n};\n","'use strict';\nvar anObject = require('../internals/an-object');\nvar isObject = require('../internals/is-object');\nvar newPromiseCapability = require('../internals/new-promise-capability');\n\nmodule.exports = function (C, x) {\n anObject(C);\n if (isObject(x) && x.constructor === C) return x;\n var promiseCapability = newPromiseCapability.f(C);\n var resolve = promiseCapability.resolve;\n resolve(x);\n return promiseCapability.promise;\n};\n","'use strict';\nvar SetHelpers = require('../internals/set-helpers');\nvar iterate = require('../internals/set-iterate');\n\nvar Set = SetHelpers.Set;\nvar add = SetHelpers.add;\n\nmodule.exports = function (set) {\n var result = new Set();\n iterate(set, function (it) {\n add(result, it);\n });\n return result;\n};\n","'use strict';\nvar aSet = require('../internals/a-set');\nvar SetHelpers = require('../internals/set-helpers');\nvar clone = require('../internals/set-clone');\nvar size = require('../internals/set-size');\nvar getSetRecord = require('../internals/get-set-record');\nvar iterateSet = require('../internals/set-iterate');\nvar iterateSimple = require('../internals/iterate-simple');\n\nvar has = SetHelpers.has;\nvar remove = SetHelpers.remove;\n\n// `Set.prototype.difference` method\n// https://tc39.es/ecma262/#sec-set.prototype.difference\nmodule.exports = function difference(other) {\n var O = aSet(this);\n var otherRec = getSetRecord(other);\n var result = clone(O);\n if (size(result) <= otherRec.size) iterateSet(result, function (e) {\n if (otherRec.includes(e)) remove(result, e);\n });\n else iterateSimple(otherRec.getIterator(), function (e) {\n if (has(result, e)) remove(result, e);\n });\n return result;\n};\n","'use strict';\nvar uncurryThis = require('../internals/function-uncurry-this');\n\n// eslint-disable-next-line es/no-set -- safe\nvar SetPrototype = Set.prototype;\n\nmodule.exports = {\n // eslint-disable-next-line es/no-set -- safe\n Set: Set,\n add: uncurryThis(SetPrototype.add),\n has: uncurryThis(SetPrototype.has),\n remove: uncurryThis(SetPrototype['delete']),\n proto: SetPrototype\n};\n","'use strict';\nvar aSet = require('../internals/a-set');\nvar SetHelpers = require('../internals/set-helpers');\nvar size = require('../internals/set-size');\nvar getSetRecord = require('../internals/get-set-record');\nvar iterateSet = require('../internals/set-iterate');\nvar iterateSimple = require('../internals/iterate-simple');\n\nvar Set = SetHelpers.Set;\nvar add = SetHelpers.add;\nvar has = SetHelpers.has;\n\n// `Set.prototype.intersection` method\n// https://tc39.es/ecma262/#sec-set.prototype.intersection\nmodule.exports = function intersection(other) {\n var O = aSet(this);\n var otherRec = getSetRecord(other);\n var result = new Set();\n\n if (size(O) > otherRec.size) {\n iterateSimple(otherRec.getIterator(), function (e) {\n if (has(O, e)) add(result, e);\n });\n } else {\n iterateSet(O, function (e) {\n if (otherRec.includes(e)) add(result, e);\n });\n }\n\n return result;\n};\n","'use strict';\nvar aSet = require('../internals/a-set');\nvar has = require('../internals/set-helpers').has;\nvar size = require('../internals/set-size');\nvar getSetRecord = require('../internals/get-set-record');\nvar iterateSet = require('../internals/set-iterate');\nvar iterateSimple = require('../internals/iterate-simple');\nvar iteratorClose = require('../internals/iterator-close');\n\n// `Set.prototype.isDisjointFrom` method\n// https://tc39.es/ecma262/#sec-set.prototype.isdisjointfrom\nmodule.exports = function isDisjointFrom(other) {\n var O = aSet(this);\n var otherRec = getSetRecord(other);\n if (size(O) <= otherRec.size) return iterateSet(O, function (e) {\n if (otherRec.includes(e)) return false;\n }, true) !== false;\n var iterator = otherRec.getIterator();\n return iterateSimple(iterator, function (e) {\n if (has(O, e)) return iteratorClose(iterator.iterator, 'normal', false);\n }) !== false;\n};\n","'use strict';\nvar aSet = require('../internals/a-set');\nvar size = require('../internals/set-size');\nvar iterate = require('../internals/set-iterate');\nvar getSetRecord = require('../internals/get-set-record');\n\n// `Set.prototype.isSubsetOf` method\n// https://tc39.es/ecma262/#sec-set.prototype.issubsetof\nmodule.exports = function isSubsetOf(other) {\n var O = aSet(this);\n var otherRec = getSetRecord(other);\n if (size(O) > otherRec.size) return false;\n return iterate(O, function (e) {\n if (!otherRec.includes(e)) return false;\n }, true) !== false;\n};\n","'use strict';\nvar aSet = require('../internals/a-set');\nvar has = require('../internals/set-helpers').has;\nvar size = require('../internals/set-size');\nvar getSetRecord = require('../internals/get-set-record');\nvar iterateSimple = require('../internals/iterate-simple');\nvar iteratorClose = require('../internals/iterator-close');\n\n// `Set.prototype.isSupersetOf` method\n// https://tc39.es/ecma262/#sec-set.prototype.issupersetof\nmodule.exports = function isSupersetOf(other) {\n var O = aSet(this);\n var otherRec = getSetRecord(other);\n if (size(O) < otherRec.size) return false;\n var iterator = otherRec.getIterator();\n return iterateSimple(iterator, function (e) {\n if (!has(O, e)) return iteratorClose(iterator.iterator, 'normal', false);\n }) !== false;\n};\n","'use strict';\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar iterateSimple = require('../internals/iterate-simple');\nvar SetHelpers = require('../internals/set-helpers');\n\nvar Set = SetHelpers.Set;\nvar SetPrototype = SetHelpers.proto;\nvar forEach = uncurryThis(SetPrototype.forEach);\nvar keys = uncurryThis(SetPrototype.keys);\nvar next = keys(new Set()).next;\n\nmodule.exports = function (set, fn, interruptible) {\n return interruptible ? iterateSimple({ iterator: keys(set), next: next }, fn) : forEach(set, fn);\n};\n","'use strict';\nvar getBuiltIn = require('../internals/get-built-in');\n\nvar createSetLike = function (size) {\n return {\n size: size,\n has: function () {\n return false;\n },\n keys: function () {\n return {\n next: function () {\n return { done: true };\n }\n };\n }\n };\n};\n\nvar createSetLikeWithInfinitySize = function (size) {\n return {\n size: size,\n has: function () {\n return true;\n },\n keys: function () {\n throw new Error('e');\n }\n };\n};\n\nmodule.exports = function (name, callback) {\n var Set = getBuiltIn('Set');\n try {\n new Set()[name](createSetLike(0));\n try {\n // late spec change, early WebKit ~ Safari 17 implementation does not pass it\n // https://github.com/tc39/proposal-set-methods/pull/88\n // also covered engines with\n // https://bugs.webkit.org/show_bug.cgi?id=272679\n new Set()[name](createSetLike(-1));\n return false;\n } catch (error2) {\n if (!callback) return true;\n // early V8 implementation bug\n // https://issues.chromium.org/issues/351332634\n try {\n new Set()[name](createSetLikeWithInfinitySize(-Infinity));\n return false;\n } catch (error) {\n var set = new Set([1, 2]);\n return callback(set[name](createSetLikeWithInfinitySize(Infinity)));\n }\n }\n } catch (error) {\n return false;\n }\n};\n","'use strict';\nvar uncurryThisAccessor = require('../internals/function-uncurry-this-accessor');\nvar SetHelpers = require('../internals/set-helpers');\n\nmodule.exports = uncurryThisAccessor(SetHelpers.proto, 'size', 'get') || function (set) {\n return set.size;\n};\n","'use strict';\nvar aSet = require('../internals/a-set');\nvar SetHelpers = require('../internals/set-helpers');\nvar clone = require('../internals/set-clone');\nvar getSetRecord = require('../internals/get-set-record');\nvar iterateSimple = require('../internals/iterate-simple');\n\nvar add = SetHelpers.add;\nvar has = SetHelpers.has;\nvar remove = SetHelpers.remove;\n\n// `Set.prototype.symmetricDifference` method\n// https://tc39.es/ecma262/#sec-set.prototype.symmetricdifference\nmodule.exports = function symmetricDifference(other) {\n var O = aSet(this);\n var keysIter = getSetRecord(other).getIterator();\n var result = clone(O);\n iterateSimple(keysIter, function (e) {\n if (has(O, e)) remove(result, e);\n else add(result, e);\n });\n return result;\n};\n","'use strict';\nvar aSet = require('../internals/a-set');\nvar add = require('../internals/set-helpers').add;\nvar clone = require('../internals/set-clone');\nvar getSetRecord = require('../internals/get-set-record');\nvar iterateSimple = require('../internals/iterate-simple');\n\n// `Set.prototype.union` method\n// https://tc39.es/ecma262/#sec-set.prototype.union\nmodule.exports = function union(other) {\n var O = aSet(this);\n var keysIter = getSetRecord(other).getIterator();\n var result = clone(O);\n iterateSimple(keysIter, function (it) {\n add(result, it);\n });\n return result;\n};\n","'use strict';\nvar shared = require('../internals/shared');\nvar uid = require('../internals/uid');\n\nvar keys = shared('keys');\n\nmodule.exports = function (key) {\n return keys[key] || (keys[key] = uid(key));\n};\n","'use strict';\nvar IS_PURE = require('../internals/is-pure');\nvar globalThis = require('../internals/global-this');\nvar defineGlobalProperty = require('../internals/define-global-property');\n\nvar SHARED = '__core-js_shared__';\nvar store = module.exports = globalThis[SHARED] || defineGlobalProperty(SHARED, {});\n\n(store.versions || (store.versions = [])).push({\n version: '3.50.0',\n mode: IS_PURE ? 'pure' : 'global',\n copyright: '© 2013–2025 Denis Pushkarev (zloirock.ru), 2025–2026 CoreJS Company (core-js.io). All rights reserved.',\n license: 'https://github.com/zloirock/core-js/blob/v3.50.0/LICENSE',\n source: 'https://github.com/zloirock/core-js'\n});\n","'use strict';\nvar store = require('../internals/shared-store');\n// eslint-disable-next-line es/no-object-create -- safe\nvar create = Object.create || Object;\n\nmodule.exports = function (key, value) {\n return store[key] || (store[key] = value || create(null));\n};\n","'use strict';\n/* eslint-disable es/no-symbol -- required for testing */\nvar V8_VERSION = require('../internals/environment-v8-version');\nvar fails = require('../internals/fails');\nvar globalThis = require('../internals/global-this');\n\nvar $String = globalThis.String;\n\n// eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing\nmodule.exports = !!Object.getOwnPropertySymbols && !fails(function () {\n var symbol = Symbol('symbol detection');\n // Chrome 38 Symbol has incorrect toString conversion\n // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances\n // nb: Do not call `String` directly to avoid this being optimized out to `symbol+''` which will,\n // of course, fail.\n return !$String(symbol) || !(Object(symbol) instanceof Symbol) ||\n // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances\n !Symbol.sham && V8_VERSION && V8_VERSION < 41;\n});\n","'use strict';\nvar uncurryThis = require('../internals/function-uncurry-this');\n\n// `thisNumberValue` abstract operation\n// https://tc39.es/ecma262/#sec-thisnumbervalue\nmodule.exports = uncurryThis(1.1.valueOf);\n","'use strict';\nvar toIntegerOrInfinity = require('../internals/to-integer-or-infinity');\n\nvar max = Math.max;\nvar min = Math.min;\n\n// Helper for a popular repeating case of the spec:\n// Let integer be ? ToInteger(index).\n// If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).\nmodule.exports = function (index, length) {\n var integer = toIntegerOrInfinity(index);\n return integer < 0 ? max(integer + length, 0) : min(integer, length);\n};\n","'use strict';\nvar toPrimitive = require('../internals/to-primitive');\n\nvar $TypeError = TypeError;\n\n// `ToBigInt` abstract operation\n// https://tc39.es/ecma262/#sec-tobigint\nmodule.exports = function (argument) {\n var prim = toPrimitive(argument, 'number');\n if (typeof prim == 'number') throw new $TypeError(\"Can't convert number to bigint\");\n // eslint-disable-next-line es/no-bigint -- safe\n return BigInt(prim);\n};\n","'use strict';\n// toObject with fallback for non-array-like ES3 strings\nvar IndexedObject = require('../internals/indexed-object');\nvar requireObjectCoercible = require('../internals/require-object-coercible');\n\nmodule.exports = function (it) {\n return IndexedObject(requireObjectCoercible(it));\n};\n","'use strict';\nvar call = require('../internals/function-call');\nvar isObject = require('../internals/is-object');\nvar isSymbol = require('../internals/is-symbol');\nvar getMethod = require('../internals/get-method');\nvar ordinaryToPrimitive = require('../internals/ordinary-to-primitive');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar $TypeError = TypeError;\nvar TO_PRIMITIVE = wellKnownSymbol('toPrimitive');\n\n// `ToPrimitive` abstract operation\n// https://tc39.es/ecma262/#sec-toprimitive\nmodule.exports = function (input, pref) {\n if (!isObject(input) || isSymbol(input)) return input;\n var exoticToPrim = getMethod(input, TO_PRIMITIVE);\n var result;\n if (exoticToPrim) {\n if (pref === undefined) pref = 'default';\n result = call(exoticToPrim, input, pref);\n if (!isObject(result) || isSymbol(result)) return result;\n throw new $TypeError(\"Can't convert object to primitive value\");\n }\n if (pref === undefined) pref = 'number';\n return ordinaryToPrimitive(input, pref);\n};\n","'use strict';\nvar toPrimitive = require('../internals/to-primitive');\nvar isSymbol = require('../internals/is-symbol');\n\n// `ToPropertyKey` abstract operation\n// https://tc39.es/ecma262/#sec-topropertykey\nmodule.exports = function (argument) {\n var key = toPrimitive(argument, 'string');\n return isSymbol(key) ? key : key + '';\n};\n","'use strict';\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar TO_STRING_TAG = wellKnownSymbol('toStringTag');\nvar test = {};\n// eslint-disable-next-line unicorn/no-immediate-mutation -- ES3 syntax limitation\ntest[TO_STRING_TAG] = 'z';\n\nmodule.exports = String(test) === '[object z]';\n","'use strict';\nvar classof = require('../internals/classof');\n\nvar $String = String;\n\nmodule.exports = function (argument) {\n if (classof(argument) === 'Symbol') throw new TypeError('Cannot convert a Symbol value to a string');\n return $String(argument);\n};\n","'use strict';\nvar $String = String;\n\nmodule.exports = function (argument) {\n try {\n return $String(argument);\n } catch (error) {\n return 'Object';\n }\n};\n","'use strict';\nvar uncurryThis = require('../internals/function-uncurry-this');\n\nvar id = 0;\nvar postfix = Math.random();\nvar toString = uncurryThis(1.1.toString);\n\nmodule.exports = function (key) {\n return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString(++id + postfix, 36);\n};\n","'use strict';\nvar globalThis = require('../internals/global-this');\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar anObjectOrUndefined = require('../internals/an-object-or-undefined');\nvar aString = require('../internals/a-string');\nvar hasOwn = require('../internals/has-own-property');\nvar base64Map = require('../internals/base64-map');\nvar getAlphabetOption = require('../internals/get-alphabet-option');\nvar notDetached = require('../internals/array-buffer-not-detached');\n\nvar base64Alphabet = base64Map.c2i;\nvar base64UrlAlphabet = base64Map.c2iUrl;\n\nvar SyntaxError = globalThis.SyntaxError;\nvar TypeError = globalThis.TypeError;\nvar $Array = globalThis.Array;\nvar at = uncurryThis(''.charAt);\nvar floor = Math.floor;\n\nvar skipAsciiWhitespace = function (string, index) {\n var length = string.length;\n for (;index < length; index++) {\n var chr = at(string, index);\n if (chr !== ' ' && chr !== '\\t' && chr !== '\\n' && chr !== '\\f' && chr !== '\\r') break;\n } return index;\n};\n\nvar decodeBase64Chunk = function (chunk, alphabet, throwOnExtraBits) {\n var chunkLength = chunk.length;\n\n if (chunkLength < 4) {\n chunk += chunkLength === 2 ? 'AA' : 'A';\n }\n\n var triplet = (alphabet[at(chunk, 0)] << 18)\n + (alphabet[at(chunk, 1)] << 12)\n + (alphabet[at(chunk, 2)] << 6)\n + alphabet[at(chunk, 3)];\n\n var chunkBytes = [\n (triplet >> 16) & 255,\n (triplet >> 8) & 255,\n triplet & 255\n ];\n\n if (chunkLength === 2) {\n if (throwOnExtraBits && chunkBytes[1] !== 0) {\n throw new SyntaxError('Extra bits');\n }\n return [chunkBytes[0]];\n }\n\n if (chunkLength === 3) {\n if (throwOnExtraBits && chunkBytes[2] !== 0) {\n throw new SyntaxError('Extra bits');\n }\n return [chunkBytes[0], chunkBytes[1]];\n }\n\n return chunkBytes;\n};\n\nvar writeBytes = function (bytes, elements, written) {\n var elementsLength = elements.length;\n for (var index = 0; index < elementsLength; index++) {\n bytes[written + index] = elements[index];\n }\n return written + elementsLength;\n};\n\n/* eslint-disable max-statements, max-depth -- TODO */\nmodule.exports = function (string, options, into, maxLength) {\n aString(string);\n anObjectOrUndefined(options);\n var alphabet = getAlphabetOption(options) === 'base64' ? base64Alphabet : base64UrlAlphabet;\n var lastChunkHandling = options ? options.lastChunkHandling : undefined;\n\n if (lastChunkHandling === undefined) lastChunkHandling = 'loose';\n\n if (lastChunkHandling !== 'loose' && lastChunkHandling !== 'strict' && lastChunkHandling !== 'stop-before-partial') {\n throw new TypeError('Incorrect `lastChunkHandling` option');\n }\n\n if (into) notDetached(into.buffer);\n\n var stringLength = string.length;\n var bytes = into || $Array(floor(stringLength * 3 / 4));\n var written = 0;\n var read = 0;\n var chunk = '';\n var index = 0;\n\n if (maxLength) while (true) {\n index = skipAsciiWhitespace(string, index);\n if (index === stringLength) {\n if (chunk.length > 0) {\n if (lastChunkHandling === 'stop-before-partial') {\n break;\n }\n if (lastChunkHandling === 'loose') {\n if (chunk.length === 1) {\n throw new SyntaxError('Malformed padding: exactly one additional character');\n }\n written = writeBytes(bytes, decodeBase64Chunk(chunk, alphabet, false), written);\n } else {\n throw new SyntaxError('Missing padding');\n }\n }\n read = stringLength;\n break;\n }\n var chr = at(string, index);\n ++index;\n if (chr === '=') {\n if (chunk.length < 2) {\n throw new SyntaxError('Padding is too early');\n }\n index = skipAsciiWhitespace(string, index);\n if (chunk.length === 2) {\n if (index === stringLength) {\n if (lastChunkHandling === 'stop-before-partial') {\n break;\n }\n throw new SyntaxError('Malformed padding: only one =');\n }\n if (at(string, index) === '=') {\n ++index;\n index = skipAsciiWhitespace(string, index);\n }\n }\n if (index < stringLength) {\n throw new SyntaxError('Unexpected character after padding');\n }\n written = writeBytes(bytes, decodeBase64Chunk(chunk, alphabet, lastChunkHandling === 'strict'), written);\n read = stringLength;\n break;\n }\n if (!hasOwn(alphabet, chr)) {\n throw new SyntaxError('Unexpected character');\n }\n var remainingBytes = maxLength - written;\n if (remainingBytes === 1 && chunk.length === 2 || remainingBytes === 2 && chunk.length === 3) {\n // special case: we can fit exactly the number of bytes currently represented by chunk, so we were just checking for `=`\n break;\n }\n\n chunk += chr;\n if (chunk.length === 4) {\n written = writeBytes(bytes, decodeBase64Chunk(chunk, alphabet, false), written);\n chunk = '';\n read = index;\n if (written === maxLength) {\n break;\n }\n }\n }\n if (!into) bytes.length = written;\n return { bytes: bytes, read: read, written: written };\n};\n","'use strict';\nvar globalThis = require('../internals/global-this');\nvar uncurryThis = require('../internals/function-uncurry-this');\n\nvar Uint8Array = globalThis.Uint8Array;\nvar SyntaxError = globalThis.SyntaxError;\nvar min = Math.min;\nvar stringMatch = uncurryThis(''.match);\n\nmodule.exports = function (string, into) {\n var stringLength = string.length;\n if (stringLength % 2 !== 0) throw new SyntaxError('String should be an even number of characters');\n var maxLength = into ? min(into.length, stringLength / 2) : stringLength / 2;\n var bytes = into || new Uint8Array(maxLength);\n var segments = stringMatch(string, /[\\S\\s]{2}/g);\n var written = 0;\n for (; written < maxLength; written++) {\n var result = +('0x' + segments[written] + '0');\n // eslint-disable-next-line no-self-compare -- NaN check\n if (result !== result) {\n throw new SyntaxError('String should only contain hex characters');\n }\n bytes[written] = result >> 4;\n }\n return { bytes: bytes, read: written << 1 };\n};\n","'use strict';\nvar fails = require('../internals/fails');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar DESCRIPTORS = require('../internals/descriptors');\nvar IS_PURE = require('../internals/is-pure');\n\nvar ITERATOR = wellKnownSymbol('iterator');\n\nmodule.exports = !fails(function () {\n // eslint-disable-next-line unicorn/relative-url-style -- required for testing\n var url = new URL('b?a=1&b=2&c=3', 'https://a');\n var params = url.searchParams;\n var params2 = new URLSearchParams('a=1&a=2&b=3');\n var result = '';\n url.pathname = 'c%20d';\n params.forEach(function (value, key) {\n params['delete']('b');\n result += key + value;\n });\n params2['delete']('a', 2);\n // `undefined` case is a Chromium 117 bug\n // https://bugs.chromium.org/p/v8/issues/detail?id=14222\n params2['delete']('b', undefined);\n return (IS_PURE && (!url.toJSON || !params2.has('a', 1) || params2.has('a', 2) || !params2.has('a', undefined) || params2.has('b')))\n || (!params.size && (IS_PURE || !DESCRIPTORS))\n || !params.sort\n || url.href !== 'https://a/c%20d?a=1&c=3'\n || params.get('c') !== '3'\n || String(new URLSearchParams('?a=1')) !== 'a=1'\n || !params[ITERATOR]\n // throws in Edge\n || new URL('https://a@b').username !== 'a'\n || new URLSearchParams(new URLSearchParams('a=b')).get('a') !== 'b'\n // not punycoded in Edge\n || new URL('https://тест').host !== 'xn--e1aybc'\n // not escaped in Chrome 62-\n || new URL('https://a#б').hash !== '#%D0%B1'\n // fails in Chrome 66-\n || result !== 'a1c3'\n // throws in Safari\n || new URL('https://x', undefined).host !== 'x';\n});\n","'use strict';\n/* eslint-disable es/no-symbol -- required for testing */\nvar NATIVE_SYMBOL = require('../internals/symbol-constructor-detection');\n\nmodule.exports = NATIVE_SYMBOL &&\n !Symbol.sham &&\n typeof Symbol.iterator == 'symbol';\n","'use strict';\nvar DESCRIPTORS = require('../internals/descriptors');\nvar fails = require('../internals/fails');\n\n// V8 ~ Chrome 36-\n// https://bugs.chromium.org/p/v8/issues/detail?id=3334\nmodule.exports = DESCRIPTORS && fails(function () {\n // eslint-disable-next-line es/no-object-defineproperty -- required for testing\n return Object.defineProperty(function () { /* empty */ }, 'prototype', {\n value: 42,\n writable: false\n }).prototype !== 42;\n});\n","'use strict';\nvar globalThis = require('../internals/global-this');\nvar isCallable = require('../internals/is-callable');\n\nvar WeakMap = globalThis.WeakMap;\n\nmodule.exports = isCallable(WeakMap) && /native code/.test(String(WeakMap));\n","'use strict';\nvar uncurryThis = require('../internals/function-uncurry-this');\n\n// eslint-disable-next-line es/no-weak-map -- safe\nvar WeakMapPrototype = WeakMap.prototype;\n\nmodule.exports = {\n // eslint-disable-next-line es/no-weak-map -- safe\n WeakMap: WeakMap,\n set: uncurryThis(WeakMapPrototype.set),\n get: uncurryThis(WeakMapPrototype.get),\n has: uncurryThis(WeakMapPrototype.has),\n remove: uncurryThis(WeakMapPrototype['delete'])\n};\n","'use strict';\nvar globalThis = require('../internals/global-this');\nvar shared = require('../internals/shared');\nvar hasOwn = require('../internals/has-own-property');\nvar uid = require('../internals/uid');\nvar NATIVE_SYMBOL = require('../internals/symbol-constructor-detection');\nvar USE_SYMBOL_AS_UID = require('../internals/use-symbol-as-uid');\n\nvar Symbol = globalThis.Symbol;\nvar WellKnownSymbolsStore = shared('wks');\nvar createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol['for'] || Symbol : Symbol && Symbol.withoutSetter || uid;\n\nmodule.exports = function (name) {\n if (!hasOwn(WellKnownSymbolsStore, name)) {\n WellKnownSymbolsStore[name] = NATIVE_SYMBOL && hasOwn(Symbol, name)\n ? Symbol[name]\n : createWellKnownSymbol('Symbol.' + name);\n } return WellKnownSymbolsStore[name];\n};\n","'use strict';\nvar $ = require('../internals/export');\nvar $includes = require('../internals/array-includes').includes;\nvar fails = require('../internals/fails');\nvar addToUnscopables = require('../internals/add-to-unscopables');\n\n// FF99+ bug\nvar BROKEN_ON_SPARSE = fails(function () {\n // eslint-disable-next-line es/no-array-prototype-includes -- detection\n return !Array(1).includes();\n});\n\n// Safari 26.4- bug\nvar BROKEN_ON_SPARSE_WITH_FROM_INDEX = fails(function () {\n // eslint-disable-next-line no-sparse-arrays, es/no-array-prototype-includes -- detection\n return [, 1].includes(undefined, 1);\n});\n\n// `Array.prototype.includes` method\n// https://tc39.es/ecma262/#sec-array.prototype.includes\n$({ target: 'Array', proto: true, forced: BROKEN_ON_SPARSE || BROKEN_ON_SPARSE_WITH_FROM_INDEX }, {\n includes: function includes(el /* , fromIndex = 0 */) {\n return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\n\n// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables\naddToUnscopables('includes');\n","'use strict';\nvar $ = require('../internals/export');\nvar toObject = require('../internals/to-object');\nvar lengthOfArrayLike = require('../internals/length-of-array-like');\nvar setArrayLength = require('../internals/array-set-length');\nvar doesNotExceedSafeInteger = require('../internals/does-not-exceed-safe-integer');\nvar fails = require('../internals/fails');\n\nvar INCORRECT_TO_LENGTH = fails(function () {\n return [].push.call({ length: 0x100000000 }, 1) !== 4294967297;\n});\n\n// V8 <= 121 and Safari <= 15.4; FF < 23 throws InternalError\n// https://bugs.chromium.org/p/v8/issues/detail?id=12681\nvar properErrorOnNonWritableLength = function () {\n try {\n // eslint-disable-next-line es/no-object-defineproperty -- safe\n Object.defineProperty([], 'length', { writable: false }).push();\n } catch (error) {\n return error instanceof TypeError;\n }\n};\n\nvar FORCED = INCORRECT_TO_LENGTH || !properErrorOnNonWritableLength();\n\n// `Array.prototype.push` method\n// https://tc39.es/ecma262/#sec-array.prototype.push\n$({ target: 'Array', proto: true, arity: 1, forced: FORCED }, {\n // eslint-disable-next-line no-unused-vars -- required for `.length`\n push: function push(item) {\n var O = toObject(this);\n var len = lengthOfArrayLike(O);\n var argCount = arguments.length;\n doesNotExceedSafeInteger(len + argCount);\n for (var i = 0; i < argCount; i++) {\n O[len] = arguments[i];\n len++;\n }\n setArrayLength(O, len);\n return len;\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar globalThis = require('../internals/global-this');\nvar anInstance = require('../internals/an-instance');\nvar anObject = require('../internals/an-object');\nvar isCallable = require('../internals/is-callable');\nvar getPrototypeOf = require('../internals/object-get-prototype-of');\nvar defineBuiltInAccessor = require('../internals/define-built-in-accessor');\nvar createProperty = require('../internals/create-property');\nvar fails = require('../internals/fails');\nvar hasOwn = require('../internals/has-own-property');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar IteratorPrototype = require('../internals/iterators-core').IteratorPrototype;\nvar DESCRIPTORS = require('../internals/descriptors');\nvar IS_PURE = require('../internals/is-pure');\n\nvar CONSTRUCTOR = 'constructor';\nvar ITERATOR = 'Iterator';\nvar TO_STRING_TAG = wellKnownSymbol('toStringTag');\n\nvar $TypeError = TypeError;\nvar NativeIterator = globalThis[ITERATOR];\n\n// FF56- have non-standard global helper `Iterator`\nvar FORCED = IS_PURE\n || !isCallable(NativeIterator)\n || NativeIterator.prototype !== IteratorPrototype\n // FF44- non-standard `Iterator` passes previous tests\n || !fails(function () { NativeIterator({}); });\n\nvar IteratorConstructor = function Iterator() {\n anInstance(this, IteratorPrototype);\n if (getPrototypeOf(this) === IteratorPrototype) throw new $TypeError('Abstract class Iterator not directly constructable');\n};\n\nvar defineIteratorPrototypeAccessor = function (key, value) {\n if (DESCRIPTORS) {\n defineBuiltInAccessor(IteratorPrototype, key, {\n configurable: true,\n get: function () {\n return value;\n },\n set: function (replacement) {\n anObject(this);\n if (this === IteratorPrototype) throw new $TypeError(\"You can't redefine this property\");\n if (hasOwn(this, key)) this[key] = replacement;\n else createProperty(this, key, replacement);\n }\n });\n } else IteratorPrototype[key] = value;\n};\n\nif (!hasOwn(IteratorPrototype, TO_STRING_TAG)) defineIteratorPrototypeAccessor(TO_STRING_TAG, ITERATOR);\n\nif (FORCED || !hasOwn(IteratorPrototype, CONSTRUCTOR) || IteratorPrototype[CONSTRUCTOR] === Object) {\n defineIteratorPrototypeAccessor(CONSTRUCTOR, IteratorConstructor);\n}\n\nIteratorConstructor.prototype = IteratorPrototype;\n\n// `Iterator` constructor\n// https://tc39.es/ecma262/#sec-iterator\n$({ global: true, constructor: true, forced: FORCED }, {\n Iterator: IteratorConstructor\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar call = require('../internals/function-call');\nvar anObject = require('../internals/an-object');\nvar getIteratorDirect = require('../internals/get-iterator-direct');\nvar notANaN = require('../internals/not-a-nan');\nvar toPositiveInteger = require('../internals/to-positive-integer');\nvar iteratorClose = require('../internals/iterator-close');\nvar createIteratorProxy = require('../internals/iterator-create-proxy');\nvar iteratorHelperThrowsOnInvalidIterator = require('../internals/iterator-helper-throws-on-invalid-iterator');\nvar iteratorHelperWithoutClosingOnEarlyError = require('../internals/iterator-helper-without-closing-on-early-error');\nvar IS_PURE = require('../internals/is-pure');\n\nvar $RangeError = RangeError;\nvar $Infinity = Infinity;\n\nvar DROP_WITHOUT_THROWING_ON_INVALID_ITERATOR = !IS_PURE && !iteratorHelperThrowsOnInvalidIterator('drop', 0);\nvar dropWithoutClosingOnEarlyError = !IS_PURE && !DROP_WITHOUT_THROWING_ON_INVALID_ITERATOR\n && iteratorHelperWithoutClosingOnEarlyError('drop', RangeError);\n\nvar FORCED = IS_PURE || DROP_WITHOUT_THROWING_ON_INVALID_ITERATOR || dropWithoutClosingOnEarlyError || !function () {\n try {\n // eslint-disable-next-line es/no-iterator, es/no-iterator-prototype-drop -- detection\n Iterator.prototype.drop.call({\n next: function () { return { done: true }; }\n }, 0x20000000000000);\n } catch (error) {\n return error instanceof $RangeError;\n }\n}();\n\nvar IteratorProxy = createIteratorProxy(function () {\n var iterator = this.iterator;\n var next = this.next;\n var result, done;\n while (this.remaining) {\n this.remaining--;\n result = anObject(call(next, iterator));\n done = this.done = !!result.done;\n if (done) return;\n }\n result = anObject(call(next, iterator));\n done = this.done = !!result.done;\n if (!done) return result.value;\n});\n\n// `Iterator.prototype.drop` method\n// https://tc39.es/ecma262/#sec-iterator.prototype.drop\n$({ target: 'Iterator', proto: true, real: true, forced: FORCED }, {\n drop: function drop(limit) {\n anObject(this);\n var remaining;\n try {\n remaining = toPositiveInteger(notANaN(+limit));\n if (remaining > 0x1FFFFFFFFFFFFF && remaining !== $Infinity) {\n throw new $RangeError('The argument should be a safe integer');\n }\n } catch (error) {\n iteratorClose(this, 'throw', error);\n }\n\n if (dropWithoutClosingOnEarlyError) return call(dropWithoutClosingOnEarlyError, this, remaining);\n\n return new IteratorProxy(getIteratorDirect(this), {\n remaining: remaining\n });\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar call = require('../internals/function-call');\nvar iterate = require('../internals/iterate');\nvar aCallable = require('../internals/a-callable');\nvar anObject = require('../internals/an-object');\nvar getIteratorDirect = require('../internals/get-iterator-direct');\nvar iteratorClose = require('../internals/iterator-close');\nvar iteratorHelperWithoutClosingOnEarlyError = require('../internals/iterator-helper-without-closing-on-early-error');\n\nvar everyWithoutClosingOnEarlyError = iteratorHelperWithoutClosingOnEarlyError('every', TypeError);\n\n// `Iterator.prototype.every` method\n// https://tc39.es/ecma262/#sec-iterator.prototype.every\n$({ target: 'Iterator', proto: true, real: true, forced: everyWithoutClosingOnEarlyError }, {\n every: function every(predicate) {\n anObject(this);\n try {\n aCallable(predicate);\n } catch (error) {\n iteratorClose(this, 'throw', error);\n }\n\n if (everyWithoutClosingOnEarlyError) return call(everyWithoutClosingOnEarlyError, this, predicate);\n\n var record = getIteratorDirect(this);\n var counter = 0;\n return !iterate(record, function (value, stop) {\n if (!predicate(value, counter++)) return stop();\n }, { IS_RECORD: true, INTERRUPTED: true }).stopped;\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar call = require('../internals/function-call');\nvar aCallable = require('../internals/a-callable');\nvar anObject = require('../internals/an-object');\nvar getIteratorDirect = require('../internals/get-iterator-direct');\nvar createIteratorProxy = require('../internals/iterator-create-proxy');\nvar callWithSafeIterationClosing = require('../internals/call-with-safe-iteration-closing');\nvar IS_PURE = require('../internals/is-pure');\nvar iteratorClose = require('../internals/iterator-close');\nvar iteratorHelperThrowsOnInvalidIterator = require('../internals/iterator-helper-throws-on-invalid-iterator');\nvar iteratorHelperWithoutClosingOnEarlyError = require('../internals/iterator-helper-without-closing-on-early-error');\n\nvar FILTER_WITHOUT_THROWING_ON_INVALID_ITERATOR = !IS_PURE && !iteratorHelperThrowsOnInvalidIterator('filter', function () { /* empty */ });\nvar filterWithoutClosingOnEarlyError = !IS_PURE && !FILTER_WITHOUT_THROWING_ON_INVALID_ITERATOR\n && iteratorHelperWithoutClosingOnEarlyError('filter', TypeError);\n\nvar FORCED = IS_PURE || FILTER_WITHOUT_THROWING_ON_INVALID_ITERATOR || filterWithoutClosingOnEarlyError;\n\nvar IteratorProxy = createIteratorProxy(function () {\n var iterator = this.iterator;\n var predicate = this.predicate;\n var next = this.next;\n var result, done, value;\n while (true) {\n result = anObject(call(next, iterator));\n done = this.done = !!result.done;\n if (done) return;\n value = result.value;\n if (callWithSafeIterationClosing(iterator, predicate, [value, this.counter++], true)) return value;\n }\n});\n\n// `Iterator.prototype.filter` method\n// https://tc39.es/ecma262/#sec-iterator.prototype.filter\n$({ target: 'Iterator', proto: true, real: true, forced: FORCED }, {\n filter: function filter(predicate) {\n anObject(this);\n try {\n aCallable(predicate);\n } catch (error) {\n iteratorClose(this, 'throw', error);\n }\n\n if (filterWithoutClosingOnEarlyError) return call(filterWithoutClosingOnEarlyError, this, predicate);\n\n return new IteratorProxy(getIteratorDirect(this), {\n predicate: predicate\n });\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar call = require('../internals/function-call');\nvar iterate = require('../internals/iterate');\nvar aCallable = require('../internals/a-callable');\nvar anObject = require('../internals/an-object');\nvar getIteratorDirect = require('../internals/get-iterator-direct');\nvar iteratorClose = require('../internals/iterator-close');\nvar iteratorHelperWithoutClosingOnEarlyError = require('../internals/iterator-helper-without-closing-on-early-error');\n\nvar findWithoutClosingOnEarlyError = iteratorHelperWithoutClosingOnEarlyError('find', TypeError);\n\n// `Iterator.prototype.find` method\n// https://tc39.es/ecma262/#sec-iterator.prototype.find\n$({ target: 'Iterator', proto: true, real: true, forced: findWithoutClosingOnEarlyError }, {\n find: function find(predicate) {\n anObject(this);\n try {\n aCallable(predicate);\n } catch (error) {\n iteratorClose(this, 'throw', error);\n }\n\n if (findWithoutClosingOnEarlyError) return call(findWithoutClosingOnEarlyError, this, predicate);\n\n var record = getIteratorDirect(this);\n var counter = 0;\n return iterate(record, function (value, stop) {\n if (predicate(value, counter++)) return stop(value);\n }, { IS_RECORD: true, INTERRUPTED: true }).result;\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar call = require('../internals/function-call');\nvar aCallable = require('../internals/a-callable');\nvar anObject = require('../internals/an-object');\nvar getIteratorDirect = require('../internals/get-iterator-direct');\nvar getIteratorFlattenable = require('../internals/get-iterator-flattenable');\nvar createIteratorProxy = require('../internals/iterator-create-proxy');\nvar iteratorClose = require('../internals/iterator-close');\nvar fails = require('../internals/fails');\nvar IS_PURE = require('../internals/is-pure');\nvar iteratorHelperThrowsOnInvalidIterator = require('../internals/iterator-helper-throws-on-invalid-iterator');\nvar iteratorHelperWithoutClosingOnEarlyError = require('../internals/iterator-helper-without-closing-on-early-error');\n\n// Should not throw an error for an iterator without `return` method. Fixed in Safari 26.2\n// https://bugs.webkit.org/show_bug.cgi?id=297532\nvar THROWS_ON_ITERATOR_WITHOUT_RETURN = !IS_PURE && fails(function () {\n // eslint-disable-next-line es/no-array-prototype-values, es/no-iterator-prototype-flatmap, es/no-iterator-prototype-find -- testing\n return [1].values()\n .flatMap(function () { return [1]; })\n .find(function () { return true; }) !== 1;\n});\n\nvar FLAT_MAP_WITHOUT_THROWING_ON_INVALID_ITERATOR = !IS_PURE && !THROWS_ON_ITERATOR_WITHOUT_RETURN\n && !iteratorHelperThrowsOnInvalidIterator('flatMap', function () { /* empty */ });\n\nvar flatMapWithoutClosingOnEarlyError = !IS_PURE && !THROWS_ON_ITERATOR_WITHOUT_RETURN && !FLAT_MAP_WITHOUT_THROWING_ON_INVALID_ITERATOR\n && iteratorHelperWithoutClosingOnEarlyError('flatMap', TypeError);\n\nvar FORCED = IS_PURE || THROWS_ON_ITERATOR_WITHOUT_RETURN || FLAT_MAP_WITHOUT_THROWING_ON_INVALID_ITERATOR\n || flatMapWithoutClosingOnEarlyError;\n\nvar IteratorProxy = createIteratorProxy(function () {\n var iterator = this.iterator;\n var mapper = this.mapper;\n var result, inner;\n\n while (true) {\n if (inner = this.inner) try {\n result = anObject(call(inner.next, inner.iterator));\n if (!result.done) return result.value;\n this.inner = null;\n } catch (error) { iteratorClose(iterator, 'throw', error); }\n\n result = anObject(call(this.next, iterator));\n\n if (this.done = !!result.done) return;\n\n try {\n this.inner = getIteratorFlattenable(mapper(result.value, this.counter++), false);\n } catch (error) { iteratorClose(iterator, 'throw', error); }\n }\n});\n\n// `Iterator.prototype.flatMap` method\n// https://tc39.es/ecma262/#sec-iterator.prototype.flatmap\n$({ target: 'Iterator', proto: true, real: true, forced: FORCED }, {\n flatMap: function flatMap(mapper) {\n anObject(this);\n try {\n aCallable(mapper);\n } catch (error) {\n iteratorClose(this, 'throw', error);\n }\n\n if (flatMapWithoutClosingOnEarlyError) return call(flatMapWithoutClosingOnEarlyError, this, mapper);\n\n return new IteratorProxy(getIteratorDirect(this), {\n mapper: mapper,\n inner: null\n });\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar call = require('../internals/function-call');\nvar iterate = require('../internals/iterate');\nvar aCallable = require('../internals/a-callable');\nvar anObject = require('../internals/an-object');\nvar getIteratorDirect = require('../internals/get-iterator-direct');\nvar iteratorClose = require('../internals/iterator-close');\nvar iteratorHelperWithoutClosingOnEarlyError = require('../internals/iterator-helper-without-closing-on-early-error');\n\nvar forEachWithoutClosingOnEarlyError = iteratorHelperWithoutClosingOnEarlyError('forEach', TypeError);\n\n// `Iterator.prototype.forEach` method\n// https://tc39.es/ecma262/#sec-iterator.prototype.foreach\n$({ target: 'Iterator', proto: true, real: true, forced: forEachWithoutClosingOnEarlyError }, {\n forEach: function forEach(fn) {\n anObject(this);\n try {\n aCallable(fn);\n } catch (error) {\n iteratorClose(this, 'throw', error);\n }\n\n if (forEachWithoutClosingOnEarlyError) return call(forEachWithoutClosingOnEarlyError, this, fn);\n\n var record = getIteratorDirect(this);\n var counter = 0;\n iterate(record, function (value) {\n fn(value, counter++);\n }, { IS_RECORD: true });\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar call = require('../internals/function-call');\nvar aCallable = require('../internals/a-callable');\nvar anObject = require('../internals/an-object');\nvar getIteratorDirect = require('../internals/get-iterator-direct');\nvar createIteratorProxy = require('../internals/iterator-create-proxy');\nvar callWithSafeIterationClosing = require('../internals/call-with-safe-iteration-closing');\nvar iteratorClose = require('../internals/iterator-close');\nvar iteratorHelperThrowsOnInvalidIterator = require('../internals/iterator-helper-throws-on-invalid-iterator');\nvar iteratorHelperWithoutClosingOnEarlyError = require('../internals/iterator-helper-without-closing-on-early-error');\nvar IS_PURE = require('../internals/is-pure');\n\nvar MAP_WITHOUT_THROWING_ON_INVALID_ITERATOR = !IS_PURE && !iteratorHelperThrowsOnInvalidIterator('map', function () { /* empty */ });\nvar mapWithoutClosingOnEarlyError = !IS_PURE && !MAP_WITHOUT_THROWING_ON_INVALID_ITERATOR\n && iteratorHelperWithoutClosingOnEarlyError('map', TypeError);\n\nvar FORCED = IS_PURE || MAP_WITHOUT_THROWING_ON_INVALID_ITERATOR || mapWithoutClosingOnEarlyError;\n\nvar IteratorProxy = createIteratorProxy(function () {\n var iterator = this.iterator;\n var result = anObject(call(this.next, iterator));\n var done = this.done = !!result.done;\n if (!done) return callWithSafeIterationClosing(iterator, this.mapper, [result.value, this.counter++], true);\n});\n\n// `Iterator.prototype.map` method\n// https://tc39.es/ecma262/#sec-iterator.prototype.map\n$({ target: 'Iterator', proto: true, real: true, forced: FORCED }, {\n map: function map(mapper) {\n anObject(this);\n try {\n aCallable(mapper);\n } catch (error) {\n iteratorClose(this, 'throw', error);\n }\n\n if (mapWithoutClosingOnEarlyError) return call(mapWithoutClosingOnEarlyError, this, mapper);\n\n return new IteratorProxy(getIteratorDirect(this), {\n mapper: mapper\n });\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar call = require('../internals/function-call');\nvar iterate = require('../internals/iterate');\nvar aCallable = require('../internals/a-callable');\nvar anObject = require('../internals/an-object');\nvar getIteratorDirect = require('../internals/get-iterator-direct');\nvar iteratorClose = require('../internals/iterator-close');\nvar iteratorHelperWithoutClosingOnEarlyError = require('../internals/iterator-helper-without-closing-on-early-error');\n\nvar someWithoutClosingOnEarlyError = iteratorHelperWithoutClosingOnEarlyError('some', TypeError);\n\n// `Iterator.prototype.some` method\n// https://tc39.es/ecma262/#sec-iterator.prototype.some\n$({ target: 'Iterator', proto: true, real: true, forced: someWithoutClosingOnEarlyError }, {\n some: function some(predicate) {\n anObject(this);\n try {\n aCallable(predicate);\n } catch (error) {\n iteratorClose(this, 'throw', error);\n }\n\n if (someWithoutClosingOnEarlyError) return call(someWithoutClosingOnEarlyError, this, predicate);\n\n var record = getIteratorDirect(this);\n var counter = 0;\n return iterate(record, function (value, stop) {\n if (predicate(value, counter++)) return stop();\n }, { IS_RECORD: true, INTERRUPTED: true }).stopped;\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar call = require('../internals/function-call');\nvar anObject = require('../internals/an-object');\nvar getIteratorDirect = require('../internals/get-iterator-direct');\nvar notANaN = require('../internals/not-a-nan');\nvar toPositiveInteger = require('../internals/to-positive-integer');\nvar createIteratorProxy = require('../internals/iterator-create-proxy');\nvar iteratorClose = require('../internals/iterator-close');\nvar iteratorHelperThrowsOnInvalidIterator = require('../internals/iterator-helper-throws-on-invalid-iterator');\nvar iteratorHelperWithoutClosingOnEarlyError = require('../internals/iterator-helper-without-closing-on-early-error');\nvar IS_PURE = require('../internals/is-pure');\n\nvar $RangeError = RangeError;\nvar $Infinity = Infinity;\n\nvar TAKE_WITHOUT_THROWING_ON_INVALID_ITERATOR = !IS_PURE && !iteratorHelperThrowsOnInvalidIterator('take', 1);\nvar takeWithoutClosingOnEarlyError = !IS_PURE && !TAKE_WITHOUT_THROWING_ON_INVALID_ITERATOR\n && iteratorHelperWithoutClosingOnEarlyError('take', RangeError);\n\nvar FORCED = IS_PURE || TAKE_WITHOUT_THROWING_ON_INVALID_ITERATOR || takeWithoutClosingOnEarlyError || !function () {\n try {\n // eslint-disable-next-line es/no-iterator, es/no-iterator-prototype-take -- detection\n Iterator.prototype.take.call({\n next: function () { return { done: true }; }\n }, 0x20000000000000);\n } catch (error) {\n return error instanceof $RangeError;\n }\n}();\n\nvar IteratorProxy = createIteratorProxy(function () {\n var iterator = this.iterator;\n if (!this.remaining--) {\n this.done = true;\n return iteratorClose(iterator, 'normal', undefined);\n }\n var result = anObject(call(this.next, iterator));\n var done = this.done = !!result.done;\n if (!done) return result.value;\n});\n\n// `Iterator.prototype.take` method\n// https://tc39.es/ecma262/#sec-iterator.prototype.take\n$({ target: 'Iterator', proto: true, real: true, forced: FORCED }, {\n take: function take(limit) {\n anObject(this);\n var remaining;\n try {\n remaining = toPositiveInteger(notANaN(+limit));\n if (remaining > 0x1FFFFFFFFFFFFF && remaining !== $Infinity) {\n throw new $RangeError('The argument should be a safe integer');\n }\n } catch (error) {\n iteratorClose(this, 'throw', error);\n }\n\n if (takeWithoutClosingOnEarlyError) return call(takeWithoutClosingOnEarlyError, this, remaining);\n\n return new IteratorProxy(getIteratorDirect(this), {\n remaining: remaining\n });\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar anObject = require('../internals/an-object');\nvar createProperty = require('../internals/create-property');\nvar iterate = require('../internals/iterate');\nvar getIteratorDirect = require('../internals/get-iterator-direct');\n\n// `Iterator.prototype.toArray` method\n// https://tc39.es/ecma262/#sec-iterator.prototype.toarray\n$({ target: 'Iterator', proto: true, real: true }, {\n toArray: function toArray() {\n var result = [];\n var index = 0;\n iterate(getIteratorDirect(anObject(this)), function (element) {\n createProperty(result, index++, element);\n }, { IS_RECORD: true });\n return result;\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar DESCRIPTORS = require('../internals/descriptors');\nvar globalThis = require('../internals/global-this');\nvar getBuiltIn = require('../internals/get-built-in');\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar call = require('../internals/function-call');\nvar isCallable = require('../internals/is-callable');\nvar isObject = require('../internals/is-object');\nvar isArray = require('../internals/is-array');\nvar hasOwn = require('../internals/has-own-property');\nvar toString = require('../internals/to-string');\nvar lengthOfArrayLike = require('../internals/length-of-array-like');\nvar createProperty = require('../internals/create-property');\nvar fails = require('../internals/fails');\nvar parseJSONString = require('../internals/parse-json-string');\nvar NATIVE_SYMBOL = require('../internals/symbol-constructor-detection');\n\nvar JSON = globalThis.JSON;\nvar Number = globalThis.Number;\nvar SyntaxError = globalThis.SyntaxError;\nvar nativeParse = JSON && JSON.parse;\nvar enumerableOwnProperties = getBuiltIn('Object', 'keys');\n// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe\nvar getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\nvar at = uncurryThis(''.charAt);\nvar slice = uncurryThis(''.slice);\nvar exec = uncurryThis(/./.exec);\nvar push = uncurryThis([].push);\n\nvar IS_DIGIT = /^\\d$/;\nvar IS_NON_ZERO_DIGIT = /^[1-9]$/;\nvar IS_NUMBER_START = /^[\\d-]$/;\nvar IS_WHITESPACE = /^[\\t\\n\\r ]$/;\n\nvar PRIMITIVE = 0;\nvar OBJECT = 1;\n\nvar $parse = function (source, reviver) {\n source = toString(source);\n var context = new Context(source, 0);\n var root = context.parse();\n var value = root.value;\n var endIndex = context.skip(IS_WHITESPACE, root.end);\n if (endIndex < source.length) {\n throw new SyntaxError('Unexpected extra character: \"' + at(source, endIndex) + '\" after the parsed data at: ' + endIndex);\n }\n return isCallable(reviver) ? internalize({ '': value }, '', reviver, root) : value;\n};\n\nvar internalize = function (holder, name, reviver, node) {\n var val = holder[name];\n var unmodified = node && val === node.value;\n var context = unmodified && typeof node.source == 'string' ? { source: node.source } : {};\n var elementRecordsLen, keys, len, i, P;\n if (isObject(val)) {\n var nodeIsArray = isArray(val);\n var nodes = unmodified ? node.nodes : nodeIsArray ? [] : {};\n if (nodeIsArray) {\n elementRecordsLen = nodes.length;\n len = lengthOfArrayLike(val);\n for (i = 0; i < len; i++) {\n internalizeProperty(val, i, internalize(val, '' + i, reviver, i < elementRecordsLen ? nodes[i] : undefined));\n }\n } else {\n keys = enumerableOwnProperties(val);\n len = lengthOfArrayLike(keys);\n for (i = 0; i < len; i++) {\n P = keys[i];\n internalizeProperty(val, P, internalize(val, P, reviver, hasOwn(nodes, P) ? nodes[P] : undefined));\n }\n }\n }\n return call(reviver, holder, name, val, context);\n};\n\nvar internalizeProperty = function (object, key, value) {\n if (DESCRIPTORS) {\n var descriptor = getOwnPropertyDescriptor(object, key);\n if (descriptor && !descriptor.configurable) return;\n }\n if (value === undefined) delete object[key];\n else createProperty(object, key, value);\n};\n\nvar Node = function (value, end, source, nodes) {\n this.value = value;\n this.end = end;\n this.source = source;\n this.nodes = nodes;\n};\n\nvar Context = function (source, index) {\n this.source = source;\n this.index = index;\n};\n\n// https://www.json.org/json-en.html\nContext.prototype = {\n fork: function (nextIndex) {\n return new Context(this.source, nextIndex);\n },\n parse: function () {\n var source = this.source;\n var i = this.skip(IS_WHITESPACE, this.index);\n var fork = this.fork(i);\n var chr = at(source, i);\n if (exec(IS_NUMBER_START, chr)) return fork.number();\n switch (chr) {\n case '{':\n return fork.object();\n case '[':\n return fork.array();\n case '\"':\n return fork.string();\n case 't':\n return fork.keyword(true);\n case 'f':\n return fork.keyword(false);\n case 'n':\n return fork.keyword(null);\n } throw new SyntaxError('Unexpected character: \"' + chr + '\" at: ' + i);\n },\n node: function (type, value, start, end, nodes) {\n return new Node(value, end, type ? null : slice(this.source, start, end), nodes);\n },\n object: function () {\n var source = this.source;\n var i = this.index + 1;\n var expectKeypair = false;\n var object = {};\n var nodes = {};\n var closed = false;\n while (i < source.length) {\n i = this.until(['\"', '}'], i);\n if (at(source, i) === '}' && !expectKeypair) {\n i++;\n closed = true;\n break;\n }\n // Parsing the key\n var result = this.fork(i).string();\n var key = result.value;\n i = result.end;\n i = this.until([':'], i) + 1;\n // Parsing value\n i = this.skip(IS_WHITESPACE, i);\n result = this.fork(i).parse();\n createProperty(nodes, key, result);\n createProperty(object, key, result.value);\n i = this.until([',', '}'], result.end);\n var chr = at(source, i);\n if (chr === ',') {\n expectKeypair = true;\n i++;\n } else if (chr === '}') {\n i++;\n closed = true;\n break;\n }\n }\n if (!closed) throw new SyntaxError('Unterminated object at: ' + i);\n return this.node(OBJECT, object, this.index, i, nodes);\n },\n array: function () {\n var source = this.source;\n var i = this.index + 1;\n var expectElement = false;\n var array = [];\n var nodes = [];\n var closed = false;\n while (i < source.length) {\n i = this.skip(IS_WHITESPACE, i);\n if (at(source, i) === ']' && !expectElement) {\n i++;\n closed = true;\n break;\n }\n var result = this.fork(i).parse();\n push(nodes, result);\n push(array, result.value);\n i = this.until([',', ']'], result.end);\n if (at(source, i) === ',') {\n expectElement = true;\n i++;\n } else if (at(source, i) === ']') {\n i++;\n closed = true;\n break;\n }\n }\n if (!closed) throw new SyntaxError('Unterminated array at: ' + i);\n return this.node(OBJECT, array, this.index, i, nodes);\n },\n string: function () {\n var index = this.index;\n var parsed = parseJSONString(this.source, this.index + 1);\n return this.node(PRIMITIVE, parsed.value, index, parsed.end);\n },\n number: function () {\n var source = this.source;\n var startIndex = this.index;\n var i = startIndex;\n if (at(source, i) === '-') i++;\n if (at(source, i) === '0') i++;\n else if (exec(IS_NON_ZERO_DIGIT, at(source, i))) i = this.skip(IS_DIGIT, i + 1);\n else throw new SyntaxError('Failed to parse number at: ' + i);\n if (at(source, i) === '.') {\n var fractionStartIndex = i + 1;\n i = this.skip(IS_DIGIT, fractionStartIndex);\n if (fractionStartIndex === i) throw new SyntaxError(\"Failed to parse number's fraction at: \" + i);\n }\n if (at(source, i) === 'e' || at(source, i) === 'E') {\n i++;\n if (at(source, i) === '+' || at(source, i) === '-') i++;\n var exponentStartIndex = i;\n i = this.skip(IS_DIGIT, i);\n if (exponentStartIndex === i) throw new SyntaxError(\"Failed to parse number's exponent value at: \" + i);\n }\n return this.node(PRIMITIVE, Number(slice(source, startIndex, i)), startIndex, i);\n },\n keyword: function (value) {\n var keyword = '' + value;\n var index = this.index;\n var endIndex = index + keyword.length;\n if (slice(this.source, index, endIndex) !== keyword) throw new SyntaxError('Failed to parse value at: ' + index);\n return this.node(PRIMITIVE, value, index, endIndex);\n },\n skip: function (regex, i) {\n var source = this.source;\n for (; i < source.length; i++) if (!exec(regex, at(source, i))) break;\n return i;\n },\n until: function (array, i) {\n i = this.skip(IS_WHITESPACE, i);\n var chr = at(this.source, i);\n for (var j = 0; j < array.length; j++) if (array[j] === chr) return i;\n throw new SyntaxError('Unexpected character: \"' + chr + '\" at: ' + i);\n }\n};\n\nvar NO_SOURCE_SUPPORT = fails(function () {\n var unsafeInt = '9007199254740993';\n var source;\n nativeParse(unsafeInt, function (key, value, context) {\n source = context.source;\n });\n return source !== unsafeInt;\n});\n\nvar PROPER_BASE_PARSE = NATIVE_SYMBOL && !fails(function () {\n // Safari 9 bug\n return 1 / nativeParse('-0 \\t') !== -Infinity;\n});\n\n// `JSON.parse` method\n// https://tc39.es/ecma262/#sec-json.parse\n// https://github.com/tc39/proposal-json-parse-with-source\n$({ target: 'JSON', stat: true, forced: NO_SOURCE_SUPPORT }, {\n parse: function parse(text, reviver) {\n return PROPER_BASE_PARSE && !isCallable(reviver) ? nativeParse(text) : $parse(text, reviver);\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar getBuiltIn = require('../internals/get-built-in');\nvar call = require('../internals/function-call');\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar fails = require('../internals/fails');\nvar isArray = require('../internals/is-array');\nvar isCallable = require('../internals/is-callable');\nvar isObject = require('../internals/is-object');\nvar create = require('../internals/object-create');\nvar isRawJSON = require('../internals/is-raw-json');\nvar isSymbol = require('../internals/is-symbol');\nvar classof = require('../internals/classof-raw');\nvar thisNumberValue = require('../internals/this-number-value');\nvar includes = require('../internals/array-includes').includes;\nvar hasOwn = require('../internals/has-own-property');\nvar toString = require('../internals/to-string');\nvar parseJSONString = require('../internals/parse-json-string');\nvar uid = require('../internals/uid');\nvar NATIVE_SYMBOL = require('../internals/symbol-constructor-detection');\nvar NATIVE_RAW_JSON = require('../internals/native-raw-json');\n\nvar $String = String;\nvar $TypeError = TypeError;\nvar $stringify = getBuiltIn('JSON', 'stringify');\nvar $BigInt = getBuiltIn('BigInt');\nvar stringValueOf = uncurryThis(''.valueOf);\nvar booleanValueOf = uncurryThis(true.valueOf);\nvar bigIntValueOf = $BigInt && uncurryThis($BigInt.prototype.valueOf);\nvar exec = uncurryThis(/./.exec);\nvar charAt = uncurryThis(''.charAt);\nvar charCodeAt = uncurryThis(''.charCodeAt);\nvar replace = uncurryThis(''.replace);\nvar slice = uncurryThis(''.slice);\nvar push = uncurryThis([].push);\nvar pop = uncurryThis([].pop);\nvar numberToString = uncurryThis(1.1.toString);\n\nvar surrogates = /[\\uD800-\\uDFFF]/g;\nvar leadingSurrogates = /^[\\uD800-\\uDBFF]$/;\nvar trailingSurrogates = /^[\\uDC00-\\uDFFF]$/;\nvar digits = /^\\d+$/;\n\n// a placeholder of a raw JSON value\nvar RAW_MARK = uid();\n// a prefix of keys of a reordered object, see `createOrderedObject`\nvar KEY_MARK = uid();\n// the last key of a reordered object, marks the end of its serialization\nvar END_MARK = uid();\nvar RAW_MARK_LENGTH = RAW_MARK.length;\nvar KEY_MARK_LENGTH = KEY_MARK.length;\n\nvar WRONG_SYMBOLS_CONVERSION = !NATIVE_SYMBOL || fails(function () {\n var symbol = getBuiltIn('Symbol')('stringify detection');\n // MS Edge converts symbol values to JSON as {}\n return $stringify([symbol]) !== '[null]'\n // WebKit converts symbol values to JSON as null\n || $stringify({ a: symbol }) !== '{}'\n // V8 throws on boxed symbols\n || $stringify(Object(symbol)) !== '{}';\n});\n\n// https://github.com/tc39/proposal-well-formed-stringify\nvar ILL_FORMED_UNICODE = fails(function () {\n return $stringify('\\uDF06\\uD834') !== '\"\\\\udf06\\\\ud834\"'\n || $stringify('\\uDEAD') !== '\"\\\\udead\"';\n});\n\nvar isRawJSONValue = NATIVE_RAW_JSON ? getBuiltIn('JSON', 'isRawJSON') : isRawJSON;\n\nvar stringifyWithProperSymbolsConversion = WRONG_SYMBOLS_CONVERSION ? function (it, replacer, space) {\n return $stringify(it, function (key, value) {\n var replaced = call(replacer, this, key, value);\n if (!isSymbol(replaced)) return replaced;\n }, space);\n} : $stringify;\n\nvar fixIllFormedJSON = function (match, offset, string) {\n var prev = charAt(string, offset - 1);\n var next = charAt(string, offset + 1);\n if (\n (exec(leadingSurrogates, match) && !exec(trailingSurrogates, next)) ||\n (exec(trailingSurrogates, match) && !exec(leadingSurrogates, prev))\n ) {\n return '\\\\u' + numberToString(charCodeAt(match, 0), 16);\n } return match;\n};\n\n// `PropertyList` of `JSON.stringify`\n// https://tc39.es/ecma262/#sec-json.stringify\nvar getPropertyList = function (replacer) {\n if (!isArray(replacer)) return;\n var rawLength = replacer.length;\n var propertyList = [];\n // a null prototype object is used as a set of already added keys to keep the deduplication linear\n var addedKeys = create(null);\n for (var i = 0; i < rawLength; i++) {\n var element = replacer[i];\n var key;\n if (typeof element == 'string') key = element;\n else if (typeof element == 'number' || classof(element) === 'Number' || classof(element) === 'String') key = toString(element);\n else continue;\n if (!hasOwn(addedKeys, key)) {\n addedKeys[key] = true;\n push(propertyList, key);\n }\n }\n return propertyList;\n};\n\n// values with such an internal slot are unwrapped by `SerializeJSONProperty` instead of being serialized as objects\nvar hasInternalSlot = function (valueOf, it) {\n try {\n valueOf(it);\n return true;\n } catch (error) {\n return false;\n }\n};\n\n// the slot check is expensive, so it's performed only for the kind reported by the value itself -\n// a value lying about its kind via `Symbol.toStringTag` is serialized as an ordinary object\nvar isBoxedPrimitive = function (it) {\n var kind = classof(it);\n return (kind === 'Number' && hasInternalSlot(thisNumberValue, it))\n || (kind === 'String' && hasInternalSlot(stringValueOf, it))\n || (kind === 'Boolean' && hasInternalSlot(booleanValueOf, it))\n || (!!bigIntValueOf && kind === 'BigInt' && hasInternalSlot(bigIntValueOf, it));\n};\n\n// only objects serialized by `SerializeJSONObject` are affected by the property list\nvar isSerializedAsObject = function (it) {\n if (!isObject(it) || isCallable(it) || isArray(it)) return false;\n try {\n return !isBoxedPrimitive(it);\n // `classof` reads `Symbol.toStringTag`, so a proxy could throw - it has no internal slots anyway\n } catch (error) {\n return true;\n }\n};\n\n// the engine unwraps it in the same order as it would read the original property,\n// so the property is read lazily and `toJSON` is called once and with the original key\nvar createElementHolder = function (holder, key) {\n return {\n toJSON: function () {\n var element = holder[key];\n if (isObject(element) || typeof element == 'bigint') {\n var elementToJSON = element.toJSON;\n if (isCallable(elementToJSON)) element = call(elementToJSON, element, key);\n } return element;\n }\n };\n};\n\n// own keys of objects are sorted - integer-like keys are moved to the beginning,\n// so such keys should be marked and restored in the serialized string\nvar getKeyPrefix = function (propertyList) {\n for (var i = 0, length = propertyList.length; i < length; i++) {\n if (exec(digits, propertyList[i])) return KEY_MARK;\n } return '';\n};\n\n// `SerializeJSONObject` iterates the property list, so the value is replaced with an object with keys in this order\nvar createOrderedObject = function (value, propertyList, keyPrefix) {\n // keys are not marked if the property list has no integer-like keys, so `Object.prototype`\n // with a setter, a non-writable property or `__proto__` should not intercept the assignment\n var ordered = create(null);\n for (var i = 0, length = propertyList.length; i < length; i++) {\n var key = propertyList[i];\n ordered[keyPrefix + key] = createElementHolder(value, key);\n }\n ordered[END_MARK] = null;\n return ordered;\n};\n\n// `JSON.stringify` method\n// https://tc39.es/ecma262/#sec-json.stringify\n// https://github.com/tc39/proposal-json-parse-with-source\nif ($stringify) $({ target: 'JSON', stat: true, arity: 3, forced: WRONG_SYMBOLS_CONVERSION || ILL_FORMED_UNICODE || !NATIVE_RAW_JSON }, {\n stringify: function stringify(text, replacer, space) {\n var replacerFunction = isCallable(replacer) ? replacer : undefined;\n var propertyList = replacerFunction ? undefined : getPropertyList(replacer);\n var keyPrefix = propertyList && getKeyPrefix(propertyList);\n var rawStrings = [];\n var openObjects = [];\n var parentOrdered = [];\n var currentOrdered;\n var marked = false;\n var root = true;\n\n var json = stringifyWithProperSymbolsConversion(text, function (key, value) {\n // some old implementations (like WebKit) could pass numbers as keys\n key = $String(key);\n\n if (propertyList) {\n if (key === END_MARK) {\n pop(openObjects);\n currentOrdered = pop(parentOrdered);\n return;\n }\n if (root) root = false;\n // the innermost reordered object already contains only keys of the property list and arrays are not\n // affected by it, the rest of objects (like objects with a fake `Symbol.toStringTag`) are filtered here\n else if (this !== currentOrdered && !isArray(this) && !includes(propertyList, key)) return;\n } else if (replacerFunction) value = call(replacerFunction, this, key, value);\n\n if (isRawJSONValue(value)) {\n if (NATIVE_RAW_JSON) return value;\n marked = true;\n return RAW_MARK + (push(rawStrings, value.rawJSON) - 1);\n }\n\n if (propertyList && isSerializedAsObject(value)) {\n // reordered objects are new each time, so cycles should be detected before the engine does it\n if (includes(openObjects, value)) throw new $TypeError('Converting circular structure to JSON');\n var ordered = createOrderedObject(value, propertyList, keyPrefix);\n push(openObjects, value);\n push(parentOrdered, currentOrdered);\n currentOrdered = ordered;\n if (keyPrefix) marked = true;\n return ordered;\n }\n\n return value;\n }, space);\n\n if (typeof json != 'string') return json;\n\n if (ILL_FORMED_UNICODE) json = replace(json, surrogates, fixIllFormedJSON);\n\n if (!marked) return json;\n\n var result = '';\n var length = json.length;\n\n for (var i = 0; i < length; i++) {\n var chr = charAt(json, i);\n if (chr === '\"') {\n var end = parseJSONString(json, ++i).end - 1;\n var string = slice(json, i, end);\n if (slice(string, 0, RAW_MARK_LENGTH) === RAW_MARK) result += rawStrings[slice(string, RAW_MARK_LENGTH)];\n else if (slice(string, 0, KEY_MARK_LENGTH) === KEY_MARK) result += '\"' + slice(string, KEY_MARK_LENGTH) + '\"';\n else result += '\"' + string + '\"';\n i = end;\n } else result += chr;\n }\n\n return result;\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar aCallable = require('../internals/a-callable');\nvar MapHelpers = require('../internals/map-helpers');\nvar IS_PURE = require('../internals/is-pure');\n\nvar get = MapHelpers.get;\nvar has = MapHelpers.has;\nvar set = MapHelpers.set;\n\n// `Map.prototype.getOrInsertComputed` method\n// https://tc39.es/ecma262/#sec-map.prototype.getorinsertcomputed\n$({ target: 'Map', proto: true, real: true, forced: IS_PURE }, {\n getOrInsertComputed: function getOrInsertComputed(key, callbackfn) {\n var hasKey = has(this, key);\n aCallable(callbackfn);\n if (hasKey) return get(this, key);\n // CanonicalizeKeyedCollectionKey\n if (key === 0 && 1 / key === -Infinity) key = 0;\n var value = callbackfn(key);\n set(this, key, value);\n return value;\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar MapHelpers = require('../internals/map-helpers');\nvar IS_PURE = require('../internals/is-pure');\n\nvar get = MapHelpers.get;\nvar has = MapHelpers.has;\nvar set = MapHelpers.set;\n\n// `Map.prototype.getOrInsert` method\n// https://tc39.es/ecma262/#sec-map.prototype.getorinsert\n$({ target: 'Map', proto: true, real: true, forced: IS_PURE }, {\n getOrInsert: function getOrInsert(key, value) {\n if (has(this, key)) return get(this, key);\n set(this, key, value);\n return value;\n }\n});\n","'use strict';\n// based on Shewchuk's algorithm for exactly floating point addition\n// adapted from https://github.com/tc39/proposal-math-sum/blob/3513d58323a1ae25560e8700aa5294500c6c9287/polyfill/polyfill.mjs\nvar $ = require('../internals/export');\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar iterate = require('../internals/iterate');\n\nvar $RangeError = RangeError;\nvar $TypeError = TypeError;\nvar $Infinity = Infinity;\nvar $NaN = NaN;\nvar abs = Math.abs;\nvar pow = Math.pow;\nvar push = uncurryThis([].push);\n\nvar POW_2_1023 = pow(2, 1023);\nvar MAX_SAFE_INTEGER = pow(2, 53) - 1; // 2 ** 53 - 1 === 9007199254740991\nvar MAX_DOUBLE = Number.MAX_VALUE; // 2 ** 1024 - 2 ** (1023 - 52) === 1.79769313486231570815e+308\nvar MAX_ULP = pow(2, 971); // 2 ** (1023 - 52) === 1.99584030953471981166e+292\n\nvar NOT_A_NUMBER = {};\nvar MINUS_INFINITY = {};\nvar PLUS_INFINITY = {};\nvar MINUS_ZERO = {};\nvar FINITE = {};\n\n// prerequisite: abs(x) >= abs(y)\nvar twosum = function (x, y) {\n var hi = x + y;\n var lo = y - (hi - x);\n return { hi: hi, lo: lo };\n};\n\n// `Math.sumPrecise` method\n// https://tc39.es/ecma262/#sec-math.sumprecise\n$({ target: 'Math', stat: true }, {\n // eslint-disable-next-line max-statements -- ok\n sumPrecise: function sumPrecise(items) {\n var numbers = [];\n var count = 0;\n var state = MINUS_ZERO;\n\n iterate(items, function (n) {\n if (++count > MAX_SAFE_INTEGER) throw new $RangeError('Maximum allowed index exceeded');\n if (typeof n != 'number') throw new $TypeError('Value is not a number');\n if (state !== NOT_A_NUMBER) {\n // eslint-disable-next-line no-self-compare -- NaN check\n if (n !== n) state = NOT_A_NUMBER;\n else if (n === $Infinity) state = state === MINUS_INFINITY ? NOT_A_NUMBER : PLUS_INFINITY;\n else if (n === -$Infinity) state = state === PLUS_INFINITY ? NOT_A_NUMBER : MINUS_INFINITY;\n else if ((n !== 0 || (1 / n) === $Infinity) && (state === MINUS_ZERO || state === FINITE)) {\n state = FINITE;\n push(numbers, n);\n }\n }\n });\n\n switch (state) {\n case NOT_A_NUMBER: return $NaN;\n case MINUS_INFINITY: return -$Infinity;\n case PLUS_INFINITY: return $Infinity;\n case MINUS_ZERO: return -0;\n }\n\n var partials = [];\n var overflow = 0; // conceptually 2 ** 1024 times this value; the final partial is biased by this amount\n var x, y, sum, hi, lo, tmp;\n\n for (var i = 0; i < numbers.length; i++) {\n x = numbers[i];\n var actuallyUsedPartials = 0;\n for (var j = 0; j < partials.length; j++) {\n y = partials[j];\n if (abs(x) < abs(y)) {\n tmp = x;\n x = y;\n y = tmp;\n }\n sum = twosum(x, y);\n hi = sum.hi;\n lo = sum.lo;\n if (abs(hi) === $Infinity) {\n var sign = hi === $Infinity ? 1 : -1;\n overflow += sign;\n\n x = (x - (sign * POW_2_1023)) - (sign * POW_2_1023);\n if (abs(x) < abs(y)) {\n tmp = x;\n x = y;\n y = tmp;\n }\n sum = twosum(x, y);\n hi = sum.hi;\n lo = sum.lo;\n }\n if (lo !== 0) partials[actuallyUsedPartials++] = lo;\n x = hi;\n }\n partials.length = actuallyUsedPartials;\n if (x !== 0) push(partials, x);\n }\n\n // compute the exact sum of partials, stopping once we lose precision\n var n = partials.length - 1;\n hi = 0;\n lo = 0;\n\n if (overflow !== 0) {\n var next = n >= 0 ? partials[n] : 0;\n n--;\n if (abs(overflow) > 1 || (overflow > 0 && next > 0) || (overflow < 0 && next < 0)) {\n return overflow > 0 ? $Infinity : -$Infinity;\n }\n // here we actually have to do the arithmetic\n // drop a factor of 2 so we can do it without overflow\n // assert(abs(overflow) === 1)\n sum = twosum(overflow * POW_2_1023, next / 2);\n hi = sum.hi;\n lo = sum.lo;\n lo *= 2;\n if (abs(2 * hi) === $Infinity) {\n // rounding to the maximum value\n if (hi > 0) {\n return (hi === POW_2_1023 && lo === -(MAX_ULP / 2) && n >= 0 && partials[n] < 0) ? MAX_DOUBLE : $Infinity;\n } return (hi === -POW_2_1023 && lo === (MAX_ULP / 2) && n >= 0 && partials[n] > 0) ? -MAX_DOUBLE : -$Infinity;\n }\n\n if (lo !== 0) {\n partials[++n] = lo;\n lo = 0;\n }\n\n hi *= 2;\n }\n\n while (n >= 0) {\n sum = twosum(hi, partials[n--]);\n hi = sum.hi;\n lo = sum.lo;\n if (lo !== 0) break;\n }\n\n if (n >= 0 && ((lo < 0 && partials[n] < 0) || (lo > 0 && partials[n] > 0))) {\n y = lo * 2;\n x = hi + y;\n if (y === x - hi) hi = x;\n }\n\n return hi;\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar globalThis = require('../internals/global-this');\nvar apply = require('../internals/function-apply');\nvar slice = require('../internals/array-slice');\nvar promiseResolve = require('../internals/promise-resolve');\nvar newPromiseCapabilityModule = require('../internals/new-promise-capability');\nvar aCallable = require('../internals/a-callable');\nvar perform = require('../internals/perform');\nvar fails = require('../internals/fails');\n\nvar Promise = globalThis.Promise;\n\nvar ACCEPT_ARGUMENTS = false;\nvar FORCED = !Promise || !Promise['try'] || fails(function () {\n var p = Promise.resolve();\n return Promise['try'](function (argument) {\n // avoiding the use of polyfills of the previous iteration of this proposal\n // that does not accept arguments of the callback\n ACCEPT_ARGUMENTS = argument === 8;\n return p;\n // it should use `PromiseResolve`\n // https://github.com/tc39/ecma262/pull/3883\n }, 8) !== p;\n}) || !ACCEPT_ARGUMENTS;\n\n// `Promise.try` method\n// https://tc39.es/ecma262/#sec-promise.try\n$({ target: 'Promise', stat: true, forced: FORCED }, {\n 'try': function (callbackfn /* , ...args */) {\n var args = arguments.length > 1 ? slice(arguments, 1) : [];\n var result = perform(function () {\n return apply(aCallable(callbackfn), undefined, args);\n });\n if (!result.error) return promiseResolve(this, result.value);\n var promiseCapability = newPromiseCapabilityModule.f(this);\n var reject = promiseCapability.reject;\n reject(result.value);\n return promiseCapability.promise;\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar difference = require('../internals/set-difference');\nvar fails = require('../internals/fails');\nvar setMethodAcceptSetLike = require('../internals/set-method-accept-set-like');\n\nvar SET_LIKE_INCORRECT_BEHAVIOR = !setMethodAcceptSetLike('difference', function (result) {\n return result.size === 0;\n});\n\nvar FORCED = SET_LIKE_INCORRECT_BEHAVIOR || fails(function () {\n // https://bugs.webkit.org/show_bug.cgi?id=288595\n var setLike = {\n size: 1,\n has: function () { return true; },\n keys: function () {\n var index = 0;\n return {\n next: function () {\n var done = index++ > 1;\n if (baseSet.has(1)) baseSet.clear();\n return { done: done, value: 2 };\n }\n };\n }\n };\n // eslint-disable-next-line es/no-set -- testing\n var baseSet = new Set([1, 2, 3, 4]);\n // eslint-disable-next-line es/no-set-prototype-difference -- testing\n return baseSet.difference(setLike).size !== 3;\n});\n\n// `Set.prototype.difference` method\n// https://tc39.es/ecma262/#sec-set.prototype.difference\n$({ target: 'Set', proto: true, real: true, forced: FORCED }, {\n difference: difference\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar fails = require('../internals/fails');\nvar intersection = require('../internals/set-intersection');\nvar setMethodAcceptSetLike = require('../internals/set-method-accept-set-like');\n\nvar INCORRECT = !setMethodAcceptSetLike('intersection', function (result) {\n return result.size === 2 && result.has(1) && result.has(2);\n}) || fails(function () {\n // eslint-disable-next-line es/no-array-from, es/no-set, es/no-set-prototype-intersection -- testing\n return String(Array.from(new Set([1, 2, 3]).intersection(new Set([3, 2])))) !== '3,2';\n});\n\n// `Set.prototype.intersection` method\n// https://tc39.es/ecma262/#sec-set.prototype.intersection\n$({ target: 'Set', proto: true, real: true, forced: INCORRECT }, {\n intersection: intersection\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar isDisjointFrom = require('../internals/set-is-disjoint-from');\nvar setMethodAcceptSetLike = require('../internals/set-method-accept-set-like');\n\nvar INCORRECT = !setMethodAcceptSetLike('isDisjointFrom', function (result) {\n return !result;\n});\n\n// `Set.prototype.isDisjointFrom` method\n// https://tc39.es/ecma262/#sec-set.prototype.isdisjointfrom\n$({ target: 'Set', proto: true, real: true, forced: INCORRECT }, {\n isDisjointFrom: isDisjointFrom\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar isSubsetOf = require('../internals/set-is-subset-of');\nvar setMethodAcceptSetLike = require('../internals/set-method-accept-set-like');\n\nvar INCORRECT = !setMethodAcceptSetLike('isSubsetOf', function (result) {\n return result;\n});\n\n// `Set.prototype.isSubsetOf` method\n// https://tc39.es/ecma262/#sec-set.prototype.issubsetof\n$({ target: 'Set', proto: true, real: true, forced: INCORRECT }, {\n isSubsetOf: isSubsetOf\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar isSupersetOf = require('../internals/set-is-superset-of');\nvar setMethodAcceptSetLike = require('../internals/set-method-accept-set-like');\n\nvar INCORRECT = !setMethodAcceptSetLike('isSupersetOf', function (result) {\n return !result;\n});\n\n// `Set.prototype.isSupersetOf` method\n// https://tc39.es/ecma262/#sec-set.prototype.issupersetof\n$({ target: 'Set', proto: true, real: true, forced: INCORRECT }, {\n isSupersetOf: isSupersetOf\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar symmetricDifference = require('../internals/set-symmetric-difference');\nvar setMethodGetKeysBeforeCloning = require('../internals/set-method-get-keys-before-cloning-detection');\nvar setMethodAcceptSetLike = require('../internals/set-method-accept-set-like');\n\nvar FORCED = !setMethodAcceptSetLike('symmetricDifference') || !setMethodGetKeysBeforeCloning('symmetricDifference');\n\n// `Set.prototype.symmetricDifference` method\n// https://tc39.es/ecma262/#sec-set.prototype.symmetricdifference\n$({ target: 'Set', proto: true, real: true, forced: FORCED }, {\n symmetricDifference: symmetricDifference\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar union = require('../internals/set-union');\nvar setMethodGetKeysBeforeCloning = require('../internals/set-method-get-keys-before-cloning-detection');\nvar setMethodAcceptSetLike = require('../internals/set-method-accept-set-like');\n\nvar FORCED = !setMethodAcceptSetLike('union') || !setMethodGetKeysBeforeCloning('union');\n\n// `Set.prototype.union` method\n// https://tc39.es/ecma262/#sec-set.prototype.union\n$({ target: 'Set', proto: true, real: true, forced: FORCED }, {\n union: union\n});\n","'use strict';\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar isBigIntArray = require('../internals/is-big-int-array');\nvar lengthOfArrayLike = require('../internals/length-of-array-like');\nvar toIntegerOrInfinity = require('../internals/to-integer-or-infinity');\nvar toBigInt = require('../internals/to-big-int');\n\nvar aTypedArray = ArrayBufferViewCore.aTypedArray;\nvar getTypedArrayConstructor = ArrayBufferViewCore.getTypedArrayConstructor;\nvar exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;\n\nvar $RangeError = RangeError;\n\nvar PROPER_ORDER = function () {\n try {\n // eslint-disable-next-line no-throw-literal, es/no-typed-arrays, es/no-array-prototype-with -- required for testing\n new Int8Array(1)['with'](2, { valueOf: function () { throw 8; } });\n } catch (error) {\n // some early implementations, like WebKit, does not follow the final semantic\n // https://github.com/tc39/proposal-change-array-by-copy/pull/86\n return error === 8;\n }\n}();\n\n// Bug in WebKit. It should truncate a negative fractional index to zero, but instead throws an error\nvar THROW_ON_NEGATIVE_FRACTIONAL_INDEX = PROPER_ORDER && function () {\n try {\n // eslint-disable-next-line es/no-typed-arrays, es/no-array-prototype-with -- required for testing\n new Int8Array(1)['with'](-0.5, 1);\n } catch (error) {\n return true;\n }\n}();\n\n// `%TypedArray%.prototype.with` method\n// https://tc39.es/ecma262/#sec-%typedarray%.prototype.with\nexportTypedArrayMethod('with', { 'with': function (index, value) {\n var O = aTypedArray(this);\n var len = lengthOfArrayLike(O);\n var relativeIndex = toIntegerOrInfinity(index);\n var actualIndex = relativeIndex < 0 ? len + relativeIndex : relativeIndex;\n var numericValue = isBigIntArray(O) ? toBigInt(value) : +value;\n if (actualIndex >= len || actualIndex < 0) throw new $RangeError('Incorrect index');\n var A = new (getTypedArrayConstructor(O))(len);\n var k = 0;\n for (; k < len; k++) A[k] = k === actualIndex ? numericValue : O[k];\n return A;\n} }['with'], !PROPER_ORDER || THROW_ON_NEGATIVE_FRACTIONAL_INDEX);\n","'use strict';\nvar $ = require('../internals/export');\nvar globalThis = require('../internals/global-this');\nvar arrayFromConstructorAndList = require('../internals/array-from-constructor-and-list');\nvar $fromBase64 = require('../internals/uint8-from-base64');\n\nvar Uint8Array = globalThis.Uint8Array;\n\nvar INCORRECT_BEHAVIOR_OR_DOESNT_EXISTS = !Uint8Array || !Uint8Array.fromBase64 || !function () {\n // Webkit not throw an error on odd length string\n try {\n Uint8Array.fromBase64('a');\n return;\n } catch (error) { /* empty */ }\n try {\n Uint8Array.fromBase64('', null);\n } catch (error) {\n return true;\n }\n}();\n\n// `Uint8Array.fromBase64` method\n// https://tc39.es/ecma262/#sec-uint8array.frombase64\nif (Uint8Array) $({ target: 'Uint8Array', stat: true, forced: INCORRECT_BEHAVIOR_OR_DOESNT_EXISTS }, {\n fromBase64: function fromBase64(string /* , options */) {\n var result = $fromBase64(string, arguments.length > 1 ? arguments[1] : undefined, null, 0x1FFFFFFFFFFFFF);\n return arrayFromConstructorAndList(Uint8Array, result.bytes);\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar globalThis = require('../internals/global-this');\nvar $fromBase64 = require('../internals/uint8-from-base64');\nvar anUint8Array = require('../internals/an-uint8-array');\n\nvar Uint8Array = globalThis.Uint8Array;\n\nvar INCORRECT_BEHAVIOR_OR_DOESNT_EXISTS = !Uint8Array || !Uint8Array.prototype.setFromBase64 || !function () {\n var target = new Uint8Array([255, 255, 255, 255, 255]);\n try {\n target.setFromBase64('', null);\n return;\n } catch (error) { /* empty */ }\n // Webkit not throw an error on odd length string\n try {\n target.setFromBase64('a');\n return;\n } catch (error) { /* empty */ }\n try {\n target.setFromBase64('MjYyZg===');\n } catch (error) {\n return target[0] === 50 && target[1] === 54 && target[2] === 50 && target[3] === 255 && target[4] === 255;\n }\n}();\n\n// `Uint8Array.prototype.setFromBase64` method\n// https://tc39.es/ecma262/#sec-uint8array.prototype.setfrombase64\nif (Uint8Array) $({ target: 'Uint8Array', proto: true, forced: INCORRECT_BEHAVIOR_OR_DOESNT_EXISTS }, {\n setFromBase64: function setFromBase64(string /* , options */) {\n anUint8Array(this);\n\n var result = $fromBase64(string, arguments.length > 1 ? arguments[1] : undefined, this, this.length);\n\n return { read: result.read, written: result.written };\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar globalThis = require('../internals/global-this');\nvar aString = require('../internals/a-string');\nvar anUint8Array = require('../internals/an-uint8-array');\nvar notDetached = require('../internals/array-buffer-not-detached');\nvar $fromHex = require('../internals/uint8-from-hex');\n\n// Should not throw an error on length-tracking views over ResizableArrayBuffer\n// https://issues.chromium.org/issues/454630441\nfunction throwsOnLengthTrackingView() {\n try {\n // eslint-disable-next-line es/no-resizable-and-growable-arraybuffers -- required for testing\n var rab = new ArrayBuffer(16, { maxByteLength: 1024 });\n // eslint-disable-next-line es/no-uint8array-prototype-setfromhex, es/no-typed-arrays -- required for testing\n new Uint8Array(rab).setFromHex('cafed00d');\n } catch (error) {\n return true;\n }\n}\n\n// `Uint8Array.prototype.setFromHex` method\n// https://tc39.es/ecma262/#sec-uint8array.prototype.setfromhex\nif (globalThis.Uint8Array) $({ target: 'Uint8Array', proto: true, forced: throwsOnLengthTrackingView() }, {\n setFromHex: function setFromHex(string) {\n anUint8Array(this);\n aString(string);\n notDetached(this.buffer);\n var read = $fromHex(string, this).read;\n return { read: read, written: read / 2 };\n }\n});\n","'use strict';\n/* eslint-disable no-useless-assignment -- false positive for [index++] syntax */\nvar $ = require('../internals/export');\nvar globalThis = require('../internals/global-this');\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar anObjectOrUndefined = require('../internals/an-object-or-undefined');\nvar anUint8Array = require('../internals/an-uint8-array');\nvar notDetached = require('../internals/array-buffer-not-detached');\nvar base64Map = require('../internals/base64-map');\nvar getAlphabetOption = require('../internals/get-alphabet-option');\n\nvar base64Alphabet = base64Map.i2c;\nvar base64UrlAlphabet = base64Map.i2cUrl;\nvar $floor = Math.floor;\nvar $ceil = Math.ceil;\n\nvar charAt = uncurryThis(''.charAt);\n\nvar Uint8Array = globalThis.Uint8Array;\nvar $Array = globalThis.Array;\nvar join = uncurryThis([].join);\n\nvar INCORRECT_BEHAVIOR_OR_DOESNT_EXISTS = !Uint8Array || !Uint8Array.prototype.toBase64 || !function () {\n try {\n var target = new Uint8Array();\n target.toBase64(null);\n } catch (error) {\n return true;\n }\n}();\n\n// `Uint8Array.prototype.toBase64` method\n// https://tc39.es/ecma262/#sec-uint8array.prototype.tobase64\nif (Uint8Array) $({ target: 'Uint8Array', proto: true, forced: INCORRECT_BEHAVIOR_OR_DOESNT_EXISTS }, {\n toBase64: function toBase64(/* options */) {\n var array = anUint8Array(this);\n var options = arguments.length ? anObjectOrUndefined(arguments[0]) : undefined;\n var alphabet = getAlphabetOption(options) === 'base64' ? base64Alphabet : base64UrlAlphabet;\n var omitPadding = !!options && !!options.omitPadding;\n notDetached(this.buffer);\n\n var i = 0;\n var length = array.length;\n var result = $Array(omitPadding ? $floor(length / 3) * 4 + (length % 3 ? length % 3 + 1 : 0) : $ceil(length / 3) * 4);\n var written = 0;\n var triplet;\n\n var at = function (shift) {\n return charAt(alphabet, (triplet >> (6 * shift)) & 63);\n };\n\n for (; i + 2 < length; i += 3) {\n triplet = (array[i] << 16) + (array[i + 1] << 8) + array[i + 2];\n result[written++] = at(3);\n result[written++] = at(2);\n result[written++] = at(1);\n result[written++] = at(0);\n }\n if (i + 2 === length) {\n triplet = (array[i] << 16) + (array[i + 1] << 8);\n result[written++] = at(3);\n result[written++] = at(2);\n result[written++] = at(1);\n if (!omitPadding) result[written++] = '=';\n } else if (i + 1 === length) {\n triplet = array[i] << 16;\n result[written++] = at(3);\n result[written++] = at(2);\n if (!omitPadding) {\n result[written++] = '=';\n result[written++] = '=';\n }\n }\n\n return join(result, '');\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar globalThis = require('../internals/global-this');\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar anUint8Array = require('../internals/an-uint8-array');\nvar notDetached = require('../internals/array-buffer-not-detached');\n\nvar numberToString = uncurryThis(1.1.toString);\nvar join = uncurryThis([].join);\nvar $Array = Array;\n\nvar Uint8Array = globalThis.Uint8Array;\n\nvar INCORRECT_BEHAVIOR_OR_DOESNT_EXISTS = !Uint8Array || !Uint8Array.prototype.toHex || !(function () {\n try {\n var target = new Uint8Array([255, 255, 255, 255, 255, 255, 255, 255]);\n return target.toHex() === 'ffffffffffffffff';\n } catch (error) {\n return false;\n }\n})();\n\n// `Uint8Array.prototype.toHex` method\n// https://tc39.es/ecma262/#sec-uint8array.prototype.tohex\nif (Uint8Array) $({ target: 'Uint8Array', proto: true, forced: INCORRECT_BEHAVIOR_OR_DOESNT_EXISTS }, {\n toHex: function toHex() {\n anUint8Array(this);\n notDetached(this.buffer);\n var result = $Array(this.length);\n for (var i = 0, length = this.length; i < length; i++) {\n var hex = numberToString(this[i], 16);\n result[i] = hex.length === 1 ? '0' + hex : hex;\n }\n return join(result, '');\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar aCallable = require('../internals/a-callable');\nvar aWeakMap = require('../internals/a-weak-map');\nvar aWeakKey = require('../internals/a-weak-key');\nvar WeakMapHelpers = require('../internals/weak-map-helpers');\nvar IS_PURE = require('../internals/is-pure');\n\nvar get = WeakMapHelpers.get;\nvar has = WeakMapHelpers.has;\nvar set = WeakMapHelpers.set;\n\nvar FORCED = IS_PURE || !function () {\n try {\n // eslint-disable-next-line es/no-weak-map, no-throw-literal -- testing\n if (WeakMap.prototype.getOrInsertComputed) new WeakMap().getOrInsertComputed(1, function () { throw 1; });\n } catch (error) {\n // FF144 Nightly - Beta 3 bug\n // https://bugzilla.mozilla.org/show_bug.cgi?id=1988369\n return error instanceof TypeError;\n }\n}();\n\n// `WeakMap.prototype.getOrInsertComputed` method\n// https://tc39.es/ecma262/#sec-weakmap.prototype.getorinsertcomputed\n$({ target: 'WeakMap', proto: true, real: true, forced: FORCED }, {\n getOrInsertComputed: function getOrInsertComputed(key, callbackfn) {\n if (!IS_PURE) aWeakMap(this);\n aWeakKey(key);\n aCallable(callbackfn);\n if (has(this, key)) return get(this, key);\n var value = callbackfn(key);\n set(this, key, value);\n return value;\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar WeakMapHelpers = require('../internals/weak-map-helpers');\nvar IS_PURE = require('../internals/is-pure');\n\nvar get = WeakMapHelpers.get;\nvar has = WeakMapHelpers.has;\nvar set = WeakMapHelpers.set;\n\n// `WeakMap.prototype.getOrInsert` method\n// https://tc39.es/ecma262/#sec-weakmap.prototype.getorinsert\n$({ target: 'WeakMap', proto: true, real: true, forced: IS_PURE }, {\n getOrInsert: function getOrInsert(key, value) {\n if (has(this, key)) return get(this, key);\n set(this, key, value);\n return value;\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar globalThis = require('../internals/global-this');\nvar getBuiltIn = require('../internals/get-built-in');\nvar createPropertyDescriptor = require('../internals/create-property-descriptor');\nvar defineProperty = require('../internals/object-define-property').f;\nvar hasOwn = require('../internals/has-own-property');\nvar anInstance = require('../internals/an-instance');\nvar inheritIfRequired = require('../internals/inherit-if-required');\nvar normalizeStringArgument = require('../internals/normalize-string-argument');\nvar DOMExceptionConstants = require('../internals/dom-exception-constants');\nvar clearErrorStack = require('../internals/error-stack-clear');\nvar DESCRIPTORS = require('../internals/descriptors');\nvar IS_PURE = require('../internals/is-pure');\n\nvar DOM_EXCEPTION = 'DOMException';\nvar Error = getBuiltIn('Error');\nvar NativeDOMException = getBuiltIn(DOM_EXCEPTION);\n\nvar $DOMException = function DOMException() {\n anInstance(this, DOMExceptionPrototype);\n var argumentsLength = arguments.length;\n var message = normalizeStringArgument(argumentsLength < 1 ? undefined : arguments[0]);\n var name = normalizeStringArgument(argumentsLength < 2 ? undefined : arguments[1], 'Error');\n var that = new NativeDOMException(message, name);\n var error = new Error(message);\n error.name = DOM_EXCEPTION;\n defineProperty(that, 'stack', createPropertyDescriptor(1, clearErrorStack(error.stack, 1)));\n inheritIfRequired(that, this, $DOMException);\n return that;\n};\n\nvar DOMExceptionPrototype = $DOMException.prototype = NativeDOMException.prototype;\n\nvar ERROR_HAS_STACK = 'stack' in new Error(DOM_EXCEPTION);\nvar DOM_EXCEPTION_HAS_STACK = 'stack' in new NativeDOMException(1, 2);\n\n// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe\nvar descriptor = NativeDOMException && DESCRIPTORS && Object.getOwnPropertyDescriptor(globalThis, DOM_EXCEPTION);\n\n// Bun ~ 0.1.1 DOMException have incorrect descriptor and we can't redefine it\n// https://github.com/Jarred-Sumner/bun/issues/399\nvar BUGGY_DESCRIPTOR = !!descriptor && !(descriptor.writable && descriptor.configurable);\n\nvar FORCED_CONSTRUCTOR = ERROR_HAS_STACK && !BUGGY_DESCRIPTOR && !DOM_EXCEPTION_HAS_STACK;\n\n// `DOMException` constructor patch for `.stack` where it's required\n// https://webidl.spec.whatwg.org/#es-DOMException-specialness\n$({ global: true, constructor: true, forced: IS_PURE || FORCED_CONSTRUCTOR }, { // TODO: fix export logic\n DOMException: FORCED_CONSTRUCTOR ? $DOMException : NativeDOMException\n});\n\nvar PolyfilledDOMException = getBuiltIn(DOM_EXCEPTION);\nvar PolyfilledDOMExceptionPrototype = PolyfilledDOMException.prototype;\n\nif (PolyfilledDOMExceptionPrototype.constructor !== PolyfilledDOMException) {\n if (!IS_PURE) {\n defineProperty(PolyfilledDOMExceptionPrototype, 'constructor', createPropertyDescriptor(1, PolyfilledDOMException));\n }\n\n for (var key in DOMExceptionConstants) if (hasOwn(DOMExceptionConstants, key)) {\n var constant = DOMExceptionConstants[key];\n var constantName = constant.s;\n if (!hasOwn(PolyfilledDOMException, constantName)) {\n defineProperty(PolyfilledDOMException, constantName, createPropertyDescriptor(6, constant.c));\n }\n }\n}\n","'use strict';\nvar $ = require('../internals/export');\nvar getBuiltIn = require('../internals/get-built-in');\nvar validateArgumentsLength = require('../internals/validate-arguments-length');\nvar toString = require('../internals/to-string');\nvar USE_NATIVE_URL = require('../internals/url-constructor-detection');\n\nvar URL = getBuiltIn('URL');\n\n// `URL.parse` method\n// https://url.spec.whatwg.org/#dom-url-parse\n$({ target: 'URL', stat: true, forced: !USE_NATIVE_URL }, {\n parse: function parse(url) {\n var length = validateArgumentsLength(arguments.length, 1);\n var urlString = toString(url);\n var base = length < 2 || arguments[1] === undefined ? undefined : toString(arguments[1]);\n try {\n return new URL(urlString, base);\n } catch (error) {\n return null;\n }\n }\n});\n","/* Copyright 2012 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/* globals process */\n\n// NW.js / Electron is a browser context, but copies some Node.js objects; see\n// http://docs.nwjs.io/en/latest/For%20Users/Advanced/JavaScript%20Contexts%20in%20NW.js/#access-nodejs-and-nwjs-api-in-browser-context\n// https://www.electronjs.org/docs/api/process#processversionselectron-readonly\n// https://www.electronjs.org/docs/api/process#processtype-readonly\nconst isNodeJS =\n (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) &&\n typeof process === \"object\" &&\n process + \"\" === \"[object process]\" &&\n !process.versions.nw &&\n !(process.versions.electron && process.type && process.type !== \"browser\");\n\nconst BBOX_INIT = [Infinity, Infinity, -Infinity, -Infinity];\nconst F32_BBOX_INIT = new Float32Array(BBOX_INIT);\n\nconst FONT_IDENTITY_MATRIX = [0.001, 0, 0, 0.001, 0, 0];\n\n// Represent the percentage of the height of a single-line field over\n// the font size. Acrobat seems to use this value.\nconst LINE_FACTOR = 1.35;\nconst LINE_DESCENT_FACTOR = 0.35;\nconst BASELINE_FACTOR = LINE_DESCENT_FACTOR / LINE_FACTOR;\n\nconst SVG_NS = \"http://www.w3.org/2000/svg\";\n\n/**\n * Refer to the `WorkerTransport.getRenderingIntent`-method in the API, to see\n * how these flags are being used:\n * - ANY, DISPLAY, and PRINT are the normal rendering intents, note the\n * `PDFPageProxy.{render, getOperatorList, getAnnotations}`-methods.\n * - SAVE is used, on the worker-thread, when saving modified annotations.\n * - ANNOTATIONS_FORMS, ANNOTATIONS_STORAGE, ANNOTATIONS_DISABLE control which\n * annotations are rendered onto the canvas (i.e. by being included in the\n * operatorList), note the `PDFPageProxy.{render, getOperatorList}`-methods\n * and their `annotationMode`-option.\n * - IS_EDITING is used when editing is active in the viewer.\n * - OPLIST is used with the `PDFPageProxy.getOperatorList`-method, note the\n * `OperatorList`-constructor (on the worker-thread).\n */\nconst RenderingIntentFlag = {\n ANY: 0x01,\n DISPLAY: 0x02,\n PRINT: 0x04,\n SAVE: 0x08,\n ANNOTATIONS_FORMS: 0x10,\n ANNOTATIONS_STORAGE: 0x20,\n ANNOTATIONS_DISABLE: 0x40,\n IS_EDITING: 0x80,\n OPLIST: 0x100,\n};\n\nconst AnnotationMode = {\n DISABLE: 0,\n ENABLE: 1,\n ENABLE_FORMS: 2,\n ENABLE_STORAGE: 3,\n};\n\nconst AnnotationPrefix = \"pdfjs_internal_id_\";\nconst AnnotationEditorPrefix = \"pdfjs_internal_editor_\";\n\nconst AnnotationEditorType = {\n DISABLE: -1,\n NONE: 0,\n FREETEXT: 3,\n HIGHLIGHT: 9,\n STAMP: 13,\n INK: 15,\n POPUP: 16,\n SIGNATURE: 101,\n COMMENT: 102,\n};\n\nconst AnnotationEditorParamsType = {\n RESIZE: 1,\n CREATE: 2,\n FREETEXT_SIZE: 11,\n FREETEXT_COLOR: 12,\n FREETEXT_OPACITY: 13,\n INK_COLOR: 21,\n INK_THICKNESS: 22,\n INK_OPACITY: 23,\n INK_COLOR_AND_OPACITY: 24,\n HIGHLIGHT_COLOR: 31,\n HIGHLIGHT_THICKNESS: 32,\n HIGHLIGHT_FREE: 33,\n HIGHLIGHT_SHOW_ALL: 34,\n DRAW_STEP: 41,\n};\n\n// Permission flags from Table 22, Section 7.6.3.2 of the PDF specification.\nconst PermissionFlag = {\n PRINT: 0x04,\n MODIFY_CONTENTS: 0x08,\n COPY: 0x10,\n MODIFY_ANNOTATIONS: 0x20,\n FILL_INTERACTIVE_FORMS: 0x100,\n COPY_FOR_ACCESSIBILITY: 0x200,\n ASSEMBLE: 0x400,\n PRINT_HIGH_QUALITY: 0x800,\n};\n\nconst MeshFigureType = {\n TRIANGLES: 1,\n LATTICE: 2,\n PATCH: 3,\n};\n\nconst TextRenderingMode = {\n FILL: 0,\n STROKE: 1,\n FILL_STROKE: 2,\n INVISIBLE: 3,\n FILL_ADD_TO_PATH: 4,\n STROKE_ADD_TO_PATH: 5,\n FILL_STROKE_ADD_TO_PATH: 6,\n ADD_TO_PATH: 7,\n FILL_STROKE_MASK: 3,\n ADD_TO_PATH_FLAG: 4,\n};\n\nconst ImageKind = {\n GRAYSCALE_1BPP: 1,\n RGB_24BPP: 2,\n RGBA_32BPP: 3,\n};\n\nconst AnnotationType = {\n TEXT: 1,\n LINK: 2,\n FREETEXT: 3,\n LINE: 4,\n SQUARE: 5,\n CIRCLE: 6,\n POLYGON: 7,\n POLYLINE: 8,\n HIGHLIGHT: 9,\n UNDERLINE: 10,\n SQUIGGLY: 11,\n STRIKEOUT: 12,\n STAMP: 13,\n CARET: 14,\n INK: 15,\n POPUP: 16,\n FILEATTACHMENT: 17,\n SOUND: 18,\n MOVIE: 19,\n WIDGET: 20,\n SCREEN: 21,\n PRINTERMARK: 22,\n TRAPNET: 23,\n WATERMARK: 24,\n THREED: 25,\n REDACT: 26,\n RICHMEDIA: 27,\n};\n\nconst AnnotationReplyType = {\n GROUP: \"Group\",\n REPLY: \"R\",\n};\n\n// Rendition action operations from Table 214, Section 12.6.4.13 of the PDF\n// specification (ISO 32000-1).\nconst AnnotationRenditionOperation = {\n PLAY_OR_RESUME: 0,\n STOP: 1,\n PAUSE: 2,\n RESUME: 3,\n PLAY: 4,\n};\n\nconst AnnotationFlag = {\n INVISIBLE: 0x01,\n HIDDEN: 0x02,\n PRINT: 0x04,\n NOZOOM: 0x08,\n NOROTATE: 0x10,\n NOVIEW: 0x20,\n READONLY: 0x40,\n LOCKED: 0x80,\n TOGGLENOVIEW: 0x100,\n LOCKEDCONTENTS: 0x200,\n};\n\nconst AnnotationFieldFlag = {\n READONLY: 0x0000001,\n REQUIRED: 0x0000002,\n NOEXPORT: 0x0000004,\n MULTILINE: 0x0001000,\n PASSWORD: 0x0002000,\n NOTOGGLETOOFF: 0x0004000,\n RADIO: 0x0008000,\n PUSHBUTTON: 0x0010000,\n COMBO: 0x0020000,\n EDIT: 0x0040000,\n SORT: 0x0080000,\n FILESELECT: 0x0100000,\n MULTISELECT: 0x0200000,\n DONOTSPELLCHECK: 0x0400000,\n DONOTSCROLL: 0x0800000,\n COMB: 0x1000000,\n RICHTEXT: 0x2000000,\n RADIOSINUNISON: 0x2000000,\n COMMITONSELCHANGE: 0x4000000,\n};\n\nconst AnnotationBorderStyleType = {\n SOLID: 1,\n DASHED: 2,\n BEVELED: 3,\n INSET: 4,\n UNDERLINE: 5,\n};\n\nconst AnnotationActionEventType = {\n E: \"Mouse Enter\",\n X: \"Mouse Exit\",\n D: \"Mouse Down\",\n U: \"Mouse Up\",\n Fo: \"Focus\",\n Bl: \"Blur\",\n PO: \"PageOpen\",\n PC: \"PageClose\",\n PV: \"PageVisible\",\n PI: \"PageInvisible\",\n K: \"Keystroke\",\n F: \"Format\",\n V: \"Validate\",\n C: \"Calculate\",\n};\n\nconst DocumentActionEventType = {\n WC: \"WillClose\",\n WS: \"WillSave\",\n DS: \"DidSave\",\n WP: \"WillPrint\",\n DP: \"DidPrint\",\n};\n\nconst PageActionEventType = {\n O: \"PageOpen\",\n C: \"PageClose\",\n};\n\nconst VerbosityLevel = {\n ERRORS: 0,\n WARNINGS: 1,\n INFOS: 5,\n};\n\n// All the possible operations for an operator list.\nconst OPS = {\n // Intentionally start from 1 so it is easy to spot bad operators that will be\n // 0's.\n // PLEASE NOTE: We purposely keep any removed operators commented out, since\n // re-numbering the list would risk breaking third-party users.\n dependency: 1,\n setLineWidth: 2,\n setLineCap: 3,\n setLineJoin: 4,\n setMiterLimit: 5,\n setDash: 6,\n setRenderingIntent: 7,\n setFlatness: 8,\n setGState: 9,\n save: 10,\n restore: 11,\n transform: 12,\n moveTo: 13,\n lineTo: 14,\n curveTo: 15,\n curveTo2: 16,\n curveTo3: 17,\n closePath: 18,\n rectangle: 19,\n stroke: 20,\n closeStroke: 21,\n fill: 22,\n eoFill: 23,\n fillStroke: 24,\n eoFillStroke: 25,\n closeFillStroke: 26,\n closeEOFillStroke: 27,\n endPath: 28,\n clip: 29,\n eoClip: 30,\n beginText: 31,\n endText: 32,\n setCharSpacing: 33,\n setWordSpacing: 34,\n setHScale: 35,\n setLeading: 36,\n setFont: 37,\n setTextRenderingMode: 38,\n setTextRise: 39,\n moveText: 40,\n setLeadingMoveText: 41,\n setTextMatrix: 42,\n nextLine: 43,\n showText: 44,\n showSpacedText: 45,\n nextLineShowText: 46,\n nextLineSetSpacingShowText: 47,\n setCharWidth: 48,\n setCharWidthAndBounds: 49,\n setStrokeColorSpace: 50,\n setFillColorSpace: 51,\n setStrokeColor: 52,\n setStrokeColorN: 53,\n setFillColor: 54,\n setFillColorN: 55,\n setStrokeGray: 56,\n setFillGray: 57,\n setStrokeRGBColor: 58,\n setFillRGBColor: 59,\n setStrokeCMYKColor: 60,\n setFillCMYKColor: 61,\n shadingFill: 62,\n beginInlineImage: 63,\n beginImageData: 64,\n endInlineImage: 65,\n paintXObject: 66,\n markPoint: 67,\n markPointProps: 68,\n beginMarkedContent: 69,\n beginMarkedContentProps: 70,\n endMarkedContent: 71,\n beginCompat: 72,\n endCompat: 73,\n paintFormXObjectBegin: 74,\n paintFormXObjectEnd: 75,\n beginGroup: 76,\n endGroup: 77,\n // beginAnnotations: 78,\n // endAnnotations: 79,\n beginAnnotation: 80,\n endAnnotation: 81,\n // paintJpegXObject: 82,\n paintImageMaskXObject: 83,\n paintImageMaskXObjectGroup: 84,\n paintImageXObject: 85,\n paintInlineImageXObject: 86,\n paintInlineImageXObjectGroup: 87,\n paintImageXObjectRepeat: 88,\n paintImageMaskXObjectRepeat: 89,\n paintSolidColorImageMask: 90,\n constructPath: 91,\n setStrokeTransparent: 92,\n setFillTransparent: 93,\n rawFillPath: 94,\n};\n\n// In order to have a switch statement that is fast (i.e. which use a jump\n// table), we need to have the OPS in a contiguous range.\nconst DrawOPS = {\n moveTo: 0,\n lineTo: 1,\n curveTo: 2,\n quadraticCurveTo: 3,\n closePath: 4,\n};\n\nconst PasswordResponses = {\n NEED_PASSWORD: 1,\n INCORRECT_PASSWORD: 2,\n};\n\nlet verbosity = VerbosityLevel.WARNINGS;\n\nfunction setVerbosityLevel(level) {\n if (Number.isInteger(level)) {\n verbosity = level;\n }\n}\n\nfunction getVerbosityLevel() {\n return verbosity;\n}\n\n// A notice for devs. These are good for things that are helpful to devs, such\n// as warning that Workers were disabled, which is important to devs but not\n// end users.\nfunction info(msg) {\n if (verbosity >= VerbosityLevel.INFOS) {\n // eslint-disable-next-line no-console\n console.info(`Info: ${msg}`);\n }\n}\n\n// Non-fatal warnings.\nfunction warn(msg) {\n if (verbosity >= VerbosityLevel.WARNINGS) {\n // eslint-disable-next-line no-console\n console.warn(`Warning: ${msg}`);\n }\n}\n\n/**\n * @param {string} msg\n * @returns {never}\n */\nfunction unreachable(msg) {\n throw new Error(msg);\n}\n\nfunction assert(cond, msg) {\n if (!cond) {\n unreachable(msg);\n }\n}\n\n// Checks if URLs use one of the allowed protocols, e.g. to avoid XSS.\nfunction _isValidProtocol(url) {\n switch (url?.protocol) {\n case \"http:\":\n case \"https:\":\n case \"ftp:\":\n case \"mailto:\":\n case \"tel:\":\n return true;\n default:\n return false;\n }\n}\n\n/**\n * Attempts to create a valid absolute URL.\n * @param {URL|string} url - An absolute, or relative, URL.\n * @param {URL|string} [baseUrl] - An absolute URL.\n * @param {object} [options]\n * @returns {URL | null} Either a valid {@link URL}, or `null` otherwise.\n */\nfunction createValidAbsoluteUrl(url, baseUrl = null, options = null) {\n if (!url) {\n return null;\n }\n if (options && typeof url === \"string\") {\n // Let URLs beginning with \"www.\" default to using the \"http://\" protocol.\n if (options.addDefaultProtocol && url.startsWith(\"www.\")) {\n const dots = url.match(/\\./g);\n // Avoid accidentally matching a *relative* URL pointing to a file named\n // e.g. \"www.pdf\" or similar.\n if (dots?.length >= 2) {\n url = `http://${url}`;\n }\n }\n\n // According to ISO 32000-1:2008, section 12.6.4.7, URIs should be encoded\n // in 7-bit ASCII. Some bad PDFs use UTF-8 encoding; see bug 1122280.\n if (options.tryConvertEncoding) {\n try {\n url = stringToUTF8String(url);\n } catch {}\n }\n }\n\n const absoluteUrl = baseUrl ? URL.parse(url, baseUrl) : URL.parse(url);\n return _isValidProtocol(absoluteUrl) ? absoluteUrl : null;\n}\n\n/**\n * Remove, or replace, the hash property of the URL.\n * @param {URL|string} url - The absolute, or relative, URL.\n * @param {string} hash - The hash property (use an empty string to remove it).\n * @param {boolean} [allowRel] - Allow relative URLs.\n * @returns {string} The resulting URL string.\n */\nfunction updateUrlHash(url, hash, allowRel = false) {\n const res = URL.parse(url);\n if (res) {\n res.hash = hash;\n return res.href;\n }\n // Support well-formed relative URLs, necessary for `web/app.js` in GENERIC\n // builds, by optionally falling back to string parsing.\n if (allowRel && createValidAbsoluteUrl(url, \"http://example.com\")) {\n return url.split(\"#\", 1)[0] + `${hash ? `#${hash}` : \"\"}`;\n }\n return \"\";\n}\n\n// Extract the final component from a path string.\nfunction stripPath(str) {\n return str.substring(str.lastIndexOf(\"/\") + 1);\n}\n\nfunction shadow(obj, prop, value, nonSerializable = false) {\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n assert(\n prop in obj,\n `shadow: Property \"${prop && prop.toString()}\" not found in object.`\n );\n }\n Object.defineProperty(obj, prop, {\n value,\n enumerable: !nonSerializable,\n configurable: true,\n writable: false,\n });\n return value;\n}\n\n/**\n * @type {any}\n */\nconst BaseException = (function BaseExceptionClosure() {\n // eslint-disable-next-line no-shadow\n function BaseException(message, name) {\n if (\n (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) &&\n this.constructor === BaseException\n ) {\n unreachable(\"Cannot initialize BaseException.\");\n }\n this.message = message;\n this.name = name;\n }\n BaseException.prototype = new Error();\n BaseException.constructor = BaseException;\n\n return BaseException;\n})();\n\nclass PasswordException extends BaseException {\n constructor(msg, code) {\n super(msg, \"PasswordException\");\n this.code = code;\n }\n}\n\nclass UnknownErrorException extends BaseException {\n constructor(msg, details) {\n super(msg, \"UnknownErrorException\");\n this.details = details;\n }\n}\n\nclass InvalidPDFException extends BaseException {\n constructor(msg) {\n super(msg, \"InvalidPDFException\");\n }\n}\n\nclass ResponseException extends BaseException {\n constructor(msg, status, missing) {\n super(msg, \"ResponseException\");\n this.status = status;\n this.missing = missing;\n }\n}\n\n/**\n * Error caused during parsing PDF data.\n */\nclass FormatError extends BaseException {\n constructor(msg) {\n super(msg, \"FormatError\");\n }\n}\n\n/**\n * Error used to indicate task cancellation.\n */\nclass AbortException extends BaseException {\n constructor(msg) {\n super(msg, \"AbortException\");\n }\n}\n\nfunction bytesToString(bytes) {\n if (typeof bytes !== \"object\" || bytes?.length === undefined) {\n unreachable(\"Invalid argument for bytesToString\");\n }\n const length = bytes.length;\n const MAX_ARGUMENT_COUNT = 8192;\n if (length < MAX_ARGUMENT_COUNT) {\n return String.fromCharCode.apply(null, bytes);\n }\n const strBuf = [];\n for (let i = 0; i < length; i += MAX_ARGUMENT_COUNT) {\n const chunkEnd = Math.min(i + MAX_ARGUMENT_COUNT, length);\n const chunk = bytes.subarray(i, chunkEnd);\n strBuf.push(String.fromCharCode.apply(null, chunk));\n }\n return strBuf.join(\"\");\n}\n\nfunction stringToBytes(str) {\n if (typeof str !== \"string\") {\n unreachable(\"Invalid argument for stringToBytes\");\n }\n const length = str.length;\n const bytes = new Uint8Array(length);\n for (let i = 0; i < length; ++i) {\n bytes[i] = str.charCodeAt(i) & 0xff;\n }\n return bytes;\n}\n\nclass FeatureTest {\n static get isLittleEndian() {\n const buffer8 = new Uint8Array(4);\n buffer8[0] = 1;\n const view32 = new Uint32Array(buffer8.buffer, 0, 1);\n\n return shadow(this, \"isLittleEndian\", view32[0] === 1);\n }\n\n static get isOffscreenCanvasSupported() {\n return shadow(\n this,\n \"isOffscreenCanvasSupported\",\n typeof OffscreenCanvas !== \"undefined\"\n );\n }\n\n static get isImageDecoderSupported() {\n return shadow(\n this,\n \"isImageDecoderSupported\",\n typeof ImageDecoder !== \"undefined\"\n );\n }\n\n static get isFloat16ArraySupported() {\n return shadow(\n this,\n \"isFloat16ArraySupported\",\n typeof Float16Array !== \"undefined\"\n );\n }\n\n static get isSanitizerSupported() {\n return shadow(\n this,\n \"isSanitizerSupported\",\n typeof Sanitizer !== \"undefined\"\n );\n }\n\n static get platform() {\n const { platform, userAgent } = navigator;\n\n return shadow(this, \"platform\", {\n isAndroid: userAgent.includes(\"Android\"),\n isLinux: platform.includes(\"Linux\"),\n isMac: platform.includes(\"Mac\"),\n isWindows: platform.includes(\"Win\"),\n isFirefox:\n (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) ||\n userAgent.includes(\"Firefox\"),\n });\n }\n\n static get isCanvasFilterSupported() {\n let ctx;\n if (this.isOffscreenCanvasSupported) {\n ctx = new OffscreenCanvas(1, 1).getContext(\"2d\");\n } else if (\n (typeof PDFJSDev === \"undefined\" || !PDFJSDev.test(\"WORKER_THREAD\")) &&\n typeof document !== \"undefined\"\n ) {\n ctx = document.createElement(\"canvas\").getContext(\"2d\");\n }\n // Spec-compliant Canvas2D defaults `ctx.filter` to \"none\". On\n // browsers without filter support (Safari) the property is absent\n // until you assign to it, after which it behaves like an ordinary\n // JS property and stores whatever string you set without applying\n // it. Probing the default lets us detect the difference reliably.\n return shadow(this, \"isCanvasFilterSupported\", ctx?.filter !== undefined);\n }\n\n static get isAlphaColorInputSupported() {\n if (\n (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"WORKER_THREAD\")) ||\n typeof document === \"undefined\"\n ) {\n return shadow(this, \"isAlphaColorInputSupported\", false);\n }\n const input = document.createElement(\"input\");\n input.type = \"color\";\n input.setAttribute(\"alpha\", \"\");\n input.value = \"#ff000080\";\n // If alpha is supported the color picker retains the alpha channel, so\n // the value won't be a plain opaque color (7-char #rrggbb).\n return shadow(\n this,\n \"isAlphaColorInputSupported\",\n input.value !== \"#ff0000\"\n );\n }\n\n static get isBackdropFilterSupported() {\n return shadow(\n this,\n \"isBackdropFilterSupported\",\n typeof CSS !== \"undefined\" && CSS.supports(\"backdrop-filter\", \"blur(1px)\")\n );\n }\n}\n\nclass Util {\n static get hexNums() {\n return shadow(\n this,\n \"hexNums\",\n Array.from({ length: 256 }, (_, n) => n.toString(16).padStart(2, \"0\"))\n );\n }\n\n static makeHexColor(r, g, b) {\n return `#${this.hexNums[r]}${this.hexNums[g]}${this.hexNums[b]}`;\n }\n\n // Concatenates two transformation matrices together and returns the result.\n static transform(m1, m2) {\n return [\n m1[0] * m2[0] + m1[2] * m2[1],\n m1[1] * m2[0] + m1[3] * m2[1],\n m1[0] * m2[2] + m1[2] * m2[3],\n m1[1] * m2[2] + m1[3] * m2[3],\n m1[0] * m2[4] + m1[2] * m2[5] + m1[4],\n m1[1] * m2[4] + m1[3] * m2[5] + m1[5],\n ];\n }\n\n // Multiplies m (an array-based transform) by md (a DOMMatrix transform).\n static multiplyByDOMMatrix(m, md) {\n return [\n m[0] * md.a + m[2] * md.b,\n m[1] * md.a + m[3] * md.b,\n m[0] * md.c + m[2] * md.d,\n m[1] * md.c + m[3] * md.d,\n m[0] * md.e + m[2] * md.f + m[4],\n m[1] * md.e + m[3] * md.f + m[5],\n ];\n }\n\n // For 2d affine transforms\n static applyTransform(p, m, pos = 0) {\n const p0 = p[pos];\n const p1 = p[pos + 1];\n p[pos] = p0 * m[0] + p1 * m[2] + m[4];\n p[pos + 1] = p0 * m[1] + p1 * m[3] + m[5];\n }\n\n static applyTransformToBezier(p, transform, pos = 0) {\n const m0 = transform[0];\n const m1 = transform[1];\n const m2 = transform[2];\n const m3 = transform[3];\n const m4 = transform[4];\n const m5 = transform[5];\n for (let i = 0; i < 6; i += 2) {\n const pI = p[pos + i];\n const pI1 = p[pos + i + 1];\n p[pos + i] = pI * m0 + pI1 * m2 + m4;\n p[pos + i + 1] = pI * m1 + pI1 * m3 + m5;\n }\n }\n\n static applyInverseTransform(p, m) {\n const p0 = p[0];\n const p1 = p[1];\n const d = m[0] * m[3] - m[1] * m[2];\n p[0] = (p0 * m[3] - p1 * m[2] + m[2] * m[5] - m[4] * m[3]) / d;\n p[1] = (-p0 * m[1] + p1 * m[0] + m[4] * m[1] - m[5] * m[0]) / d;\n }\n\n // Applies the transform to the rectangle and finds the minimum axially\n // aligned bounding box.\n static axialAlignedBoundingBox(rect, transform, output) {\n const m0 = transform[0];\n const m1 = transform[1];\n const m2 = transform[2];\n const m3 = transform[3];\n const m4 = transform[4];\n const m5 = transform[5];\n const r0 = rect[0];\n const r1 = rect[1];\n const r2 = rect[2];\n const r3 = rect[3];\n\n let a0 = m0 * r0 + m4;\n let a2 = a0;\n let a1 = m0 * r2 + m4;\n let a3 = a1;\n let b0 = m3 * r1 + m5;\n let b2 = b0;\n let b1 = m3 * r3 + m5;\n let b3 = b1;\n\n if (m1 !== 0 || m2 !== 0) {\n // Non-scaling matrix: shouldn't be frequent.\n const m1r0 = m1 * r0;\n const m1r2 = m1 * r2;\n const m2r1 = m2 * r1;\n const m2r3 = m2 * r3;\n a0 += m2r1;\n a3 += m2r1;\n a1 += m2r3;\n a2 += m2r3;\n b0 += m1r0;\n b3 += m1r0;\n b1 += m1r2;\n b2 += m1r2;\n }\n\n output[0] = Math.min(output[0], a0, a1, a2, a3);\n output[1] = Math.min(output[1], b0, b1, b2, b3);\n output[2] = Math.max(output[2], a0, a1, a2, a3);\n output[3] = Math.max(output[3], b0, b1, b2, b3);\n }\n\n static inverseTransform(m) {\n const d = m[0] * m[3] - m[1] * m[2];\n return [\n m[3] / d,\n -m[1] / d,\n -m[2] / d,\n m[0] / d,\n (m[2] * m[5] - m[4] * m[3]) / d,\n (m[4] * m[1] - m[5] * m[0]) / d,\n ];\n }\n\n // This calculation uses Singular Value Decomposition.\n // The SVD can be represented with formula A = USV. We are interested in the\n // matrix S here because it represents the scale values.\n static singularValueDecompose2dScale(matrix, output) {\n const m0 = matrix[0];\n const m1 = matrix[1];\n const m2 = matrix[2];\n const m3 = matrix[3];\n // Multiply matrix m with its transpose.\n const a = m0 ** 2 + m1 ** 2;\n const b = m0 * m2 + m1 * m3;\n const c = m2 ** 2 + m3 ** 2;\n\n // Solve the second degree polynomial to get roots.\n const first = (a + c) / 2;\n const second = Math.sqrt(first ** 2 - (a * c - b ** 2));\n output[0] = Math.sqrt(first + second || 1);\n output[1] = Math.sqrt(first - second || 1);\n }\n\n // Normalize rectangle rect=[x1, y1, x2, y2] so that (x1,y1) < (x2,y2)\n // For coordinate systems whose origin lies in the bottom-left, this\n // means normalization to (BL,TR) ordering. For systems with origin in the\n // top-left, this means (TL,BR) ordering.\n static normalizeRect(rect) {\n const r = rect.slice(0); // clone rect\n if (rect[0] > rect[2]) {\n r[0] = rect[2];\n r[2] = rect[0];\n }\n if (rect[1] > rect[3]) {\n r[1] = rect[3];\n r[3] = rect[1];\n }\n return r;\n }\n\n // Returns a rectangle [x1, y1, x2, y2] corresponding to the\n // intersection of rect1 and rect2. If no intersection, returns 'null'\n // The rectangle coordinates of rect1, rect2 should be [x1, y1, x2, y2]\n static intersect(rect1, rect2) {\n const xLow = Math.max(\n Math.min(rect1[0], rect1[2]),\n Math.min(rect2[0], rect2[2])\n );\n const xHigh = Math.min(\n Math.max(rect1[0], rect1[2]),\n Math.max(rect2[0], rect2[2])\n );\n if (xLow > xHigh) {\n return null;\n }\n const yLow = Math.max(\n Math.min(rect1[1], rect1[3]),\n Math.min(rect2[1], rect2[3])\n );\n const yHigh = Math.min(\n Math.max(rect1[1], rect1[3]),\n Math.max(rect2[1], rect2[3])\n );\n return yLow > yHigh ? null : [xLow, yLow, xHigh, yHigh];\n }\n\n static pointBoundingBox(x, y, minMax) {\n minMax[0] = Math.min(minMax[0], x);\n minMax[1] = Math.min(minMax[1], y);\n minMax[2] = Math.max(minMax[2], x);\n minMax[3] = Math.max(minMax[3], y);\n }\n\n static rectBoundingBox(x0, y0, x1, y1, minMax) {\n minMax[0] = Math.min(minMax[0], x0, x1);\n minMax[1] = Math.min(minMax[1], y0, y1);\n minMax[2] = Math.max(minMax[2], x0, x1);\n minMax[3] = Math.max(minMax[3], y0, y1);\n }\n\n static #getExtremumOnCurve(x0, x1, x2, x3, y0, y1, y2, y3, t, minMax) {\n if (t <= 0 || t >= 1) {\n return;\n }\n const mt = 1 - t;\n const tt = t * t;\n const ttt = tt * t;\n const x = mt * (mt * (mt * x0 + 3 * t * x1) + 3 * tt * x2) + ttt * x3;\n const y = mt * (mt * (mt * y0 + 3 * t * y1) + 3 * tt * y2) + ttt * y3;\n minMax[0] = Math.min(minMax[0], x);\n minMax[1] = Math.min(minMax[1], y);\n minMax[2] = Math.max(minMax[2], x);\n minMax[3] = Math.max(minMax[3], y);\n }\n\n static #getExtremum(x0, x1, x2, x3, y0, y1, y2, y3, a, b, c, minMax) {\n if (Math.abs(a) < 1e-12) {\n if (Math.abs(b) >= 1e-12) {\n this.#getExtremumOnCurve(\n x0,\n x1,\n x2,\n x3,\n y0,\n y1,\n y2,\n y3,\n -c / b,\n minMax\n );\n }\n return;\n }\n\n const delta = b ** 2 - 4 * c * a;\n if (delta < 0) {\n return;\n }\n const sqrtDelta = Math.sqrt(delta);\n const a2 = 2 * a;\n this.#getExtremumOnCurve(\n x0,\n x1,\n x2,\n x3,\n y0,\n y1,\n y2,\n y3,\n (-b + sqrtDelta) / a2,\n minMax\n );\n this.#getExtremumOnCurve(\n x0,\n x1,\n x2,\n x3,\n y0,\n y1,\n y2,\n y3,\n (-b - sqrtDelta) / a2,\n minMax\n );\n }\n\n // From https://github.com/adobe-webplatform/Snap.svg/blob/b365287722a72526000ac4bfcf0ce4cac2faa015/src/path.js#L852\n static bezierBoundingBox(x0, y0, x1, y1, x2, y2, x3, y3, minMax) {\n minMax[0] = Math.min(minMax[0], x0, x3);\n minMax[1] = Math.min(minMax[1], y0, y3);\n minMax[2] = Math.max(minMax[2], x0, x3);\n minMax[3] = Math.max(minMax[3], y0, y3);\n\n this.#getExtremum(\n x0,\n x1,\n x2,\n x3,\n y0,\n y1,\n y2,\n y3,\n 3 * (-x0 + 3 * (x1 - x2) + x3),\n 6 * (x0 - 2 * x1 + x2),\n 3 * (x1 - x0),\n minMax\n );\n this.#getExtremum(\n x0,\n x1,\n x2,\n x3,\n y0,\n y1,\n y2,\n y3,\n 3 * (-y0 + 3 * (y1 - y2) + y3),\n 6 * (y0 - 2 * y1 + y2),\n 3 * (y1 - y0),\n minMax\n );\n }\n}\n\nfunction stringToUTF8String(str) {\n return decodeURIComponent(escape(str));\n}\n\nfunction utf8StringToString(str) {\n return unescape(encodeURIComponent(str));\n}\n\nfunction isArrayEqual(arr1, arr2) {\n if (arr1.length !== arr2.length) {\n return false;\n }\n for (let i = 0, ii = arr1.length; i < ii; i++) {\n if (arr1[i] !== arr2[i]) {\n return false;\n }\n }\n return true;\n}\n\nlet NormalizeRegex = null;\nlet NormalizationMap = null;\nfunction normalizeUnicode(str) {\n if (!NormalizeRegex) {\n // In order to generate the following regex:\n // - create a PDF containing all the chars in the range 0000-FFFF with\n // a NFKC which is different of the char.\n // - copy and paste all those chars and get the ones where NFKC is\n // required.\n // It appears that most the chars here contain some ligatures.\n NormalizeRegex =\n /([\\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;\n NormalizationMap = new Map([[\"ſt\", \"ſt\"]]);\n }\n return str.replaceAll(NormalizeRegex, (_, p1, p2) =>\n p1 ? p1.normalize(\"NFKC\") : NormalizationMap.get(p2)\n );\n}\n\nfunction getUuid() {\n if (\n (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) ||\n typeof crypto.randomUUID === \"function\"\n ) {\n return crypto.randomUUID();\n }\n const buf = new Uint8Array(32);\n crypto.getRandomValues(buf);\n return bytesToString(buf);\n}\n\nfunction _isValidExplicitDest(validRef, validName, dest) {\n if (!Array.isArray(dest) || dest.length < 2) {\n return false;\n }\n const [page, zoom, ...args] = dest;\n if (!validRef(page) && !Number.isInteger(page)) {\n return false;\n }\n if (!validName(zoom)) {\n return false;\n }\n const argsLen = args.length;\n let allowNull = true;\n switch (zoom.name) {\n case \"XYZ\":\n if (argsLen < 2 || argsLen > 3) {\n return false;\n }\n break;\n case \"Fit\":\n case \"FitB\":\n return argsLen === 0;\n case \"FitH\":\n case \"FitBH\":\n case \"FitV\":\n case \"FitBV\":\n if (argsLen > 1) {\n return false;\n }\n break;\n case \"FitR\":\n if (argsLen !== 4) {\n return false;\n }\n allowNull = false;\n break;\n default:\n return false;\n }\n for (const arg of args) {\n if (typeof arg === \"number\" || (allowNull && arg === null)) {\n continue;\n }\n return false;\n }\n return true;\n}\n\n// Helpers for simple `Map.prototype.getOrInsertComputed()` invocations,\n// to avoid duplicate function creation.\nconst makeArr = () => [];\nconst makeMap = () => new Map();\nconst makeObj = () => Object.create(null);\nconst makeSet = () => new Set();\n\n// See https://developer.mozilla.org/en-US/docs/Web/API/Blob/bytes#browser_compatibility\nif (\n typeof PDFJSDev !== \"undefined\" &&\n !PDFJSDev.test(\"SKIP_BABEL\") &&\n typeof Blob.prototype.bytes !== \"function\"\n) {\n Blob.prototype.bytes = async function () {\n return new Uint8Array(await this.arrayBuffer());\n };\n}\n\n// See https://developer.mozilla.org/en-US/docs/Web/API/Response/bytes#browser_compatibility\nif (\n typeof PDFJSDev !== \"undefined\" &&\n !PDFJSDev.test(\"SKIP_BABEL\") &&\n typeof Response.prototype.bytes !== \"function\"\n) {\n Response.prototype.bytes = async function () {\n return new Uint8Array(await this.arrayBuffer());\n };\n}\n\n// TODO: Remove this once `Iterator.prototype.join` is generally available.\nif (typeof Iterator.prototype.join !== \"function\") {\n // eslint-disable-next-line no-extend-native\n Iterator.prototype.join = function (separator) {\n return [...this].join(separator);\n };\n}\n\nexport {\n _isValidExplicitDest,\n AbortException,\n AnnotationActionEventType,\n AnnotationBorderStyleType,\n AnnotationEditorParamsType,\n AnnotationEditorPrefix,\n AnnotationEditorType,\n AnnotationFieldFlag,\n AnnotationFlag,\n AnnotationMode,\n AnnotationPrefix,\n AnnotationRenditionOperation,\n AnnotationReplyType,\n AnnotationType,\n assert,\n BaseException,\n BASELINE_FACTOR,\n BBOX_INIT,\n bytesToString,\n createValidAbsoluteUrl,\n DocumentActionEventType,\n DrawOPS,\n F32_BBOX_INIT,\n FeatureTest,\n FONT_IDENTITY_MATRIX,\n FormatError,\n getUuid,\n getVerbosityLevel,\n ImageKind,\n info,\n InvalidPDFException,\n isArrayEqual,\n isNodeJS,\n LINE_DESCENT_FACTOR,\n LINE_FACTOR,\n makeArr,\n makeMap,\n makeObj,\n makeSet,\n MeshFigureType,\n normalizeUnicode,\n OPS,\n PageActionEventType,\n PasswordException,\n PasswordResponses,\n PermissionFlag,\n RenderingIntentFlag,\n ResponseException,\n setVerbosityLevel,\n shadow,\n stringToBytes,\n stringToUTF8String,\n stripPath,\n SVG_NS,\n TextRenderingMode,\n UnknownErrorException,\n unreachable,\n updateUrlHash,\n utf8StringToString,\n Util,\n VerbosityLevel,\n warn,\n};\n","/* Copyright 2026 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// TODO: Replace all occurrences of this function, and remove the file, once\n// https://github.com/tc39/proposal-math-clamp/ is generally available.\nfunction MathClamp(v, min, max) {\n // eslint-disable-next-line prefer-math-clamp/prefer-math-clamp\n return Math.min(Math.max(v, min), max);\n}\n\nexport { MathClamp };\n","/* Copyright 2015 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { shadow, Util } from \"../shared/util.js\";\n\n/**\n * @typedef {object} PageViewportParameters\n * @property {Array} viewBox - The xMin, yMin, xMax and\n * yMax coordinates.\n * @property {number} userUnit - The size of units.\n * @property {number} scale - The scale of the viewport.\n * @property {number} rotation - The rotation, in degrees, of the viewport.\n * @property {number} [offsetX] - The horizontal, i.e. x-axis, offset. The\n * default value is `0`.\n * @property {number} [offsetY] - The vertical, i.e. y-axis, offset. The\n * default value is `0`.\n * @property {boolean} [dontFlip] - If true, the y-axis will not be flipped.\n * The default value is `false`.\n */\n\n/**\n * @typedef {object} PageViewportCloneParameters\n * @property {number} [scale] - The scale, overriding the one in the cloned\n * viewport. The default value is `this.scale`.\n * @property {number} [rotation] - The rotation, in degrees, overriding the one\n * in the cloned viewport. The default value is `this.rotation`.\n * @property {number} [offsetX] - The horizontal, i.e. x-axis, offset.\n * The default value is `this.offsetX`.\n * @property {number} [offsetY] - The vertical, i.e. y-axis, offset.\n * The default value is `this.offsetY`.\n * @property {boolean} [dontFlip] - If true, the x-axis will not be flipped.\n * The default value is `false`.\n */\n\n/**\n * PDF page viewport created based on scale, rotation and offset.\n */\nclass PageViewport {\n /**\n * @param {PageViewportParameters} params\n */\n constructor({\n viewBox,\n userUnit,\n scale,\n rotation,\n offsetX = 0,\n offsetY = 0,\n dontFlip = false,\n }) {\n this.viewBox = viewBox;\n this.userUnit = userUnit;\n this.scale = scale;\n this.rotation = rotation;\n this.offsetX = offsetX;\n this.offsetY = offsetY;\n\n scale *= userUnit; // Take the userUnit into account.\n\n // creating transform to convert pdf coordinate system to the normal\n // canvas like coordinates taking in account scale and rotation\n const centerX = (viewBox[2] + viewBox[0]) / 2;\n const centerY = (viewBox[3] + viewBox[1]) / 2;\n let rotateA, rotateB, rotateC, rotateD;\n // Normalize the rotation, by clamping it to the [0, 360) range.\n rotation %= 360;\n if (rotation < 0) {\n rotation += 360;\n }\n switch (rotation) {\n case 180:\n rotateA = -1;\n rotateB = 0;\n rotateC = 0;\n rotateD = 1;\n break;\n case 90:\n rotateA = 0;\n rotateB = 1;\n rotateC = 1;\n rotateD = 0;\n break;\n case 270:\n rotateA = 0;\n rotateB = -1;\n rotateC = -1;\n rotateD = 0;\n break;\n case 0:\n rotateA = 1;\n rotateB = 0;\n rotateC = 0;\n rotateD = -1;\n break;\n default:\n throw new Error(\n \"PageViewport: Invalid rotation, must be a multiple of 90 degrees.\"\n );\n }\n\n if (dontFlip) {\n rotateC = -rotateC;\n rotateD = -rotateD;\n }\n\n let offsetCanvasX, offsetCanvasY;\n let width, height;\n if (rotateA === 0) {\n offsetCanvasX = Math.abs(centerY - viewBox[1]) * scale + offsetX;\n offsetCanvasY = Math.abs(centerX - viewBox[0]) * scale + offsetY;\n width = (viewBox[3] - viewBox[1]) * scale;\n height = (viewBox[2] - viewBox[0]) * scale;\n } else {\n offsetCanvasX = Math.abs(centerX - viewBox[0]) * scale + offsetX;\n offsetCanvasY = Math.abs(centerY - viewBox[1]) * scale + offsetY;\n width = (viewBox[2] - viewBox[0]) * scale;\n height = (viewBox[3] - viewBox[1]) * scale;\n }\n // creating transform for the following operations:\n // translate(-centerX, -centerY), rotate and flip vertically,\n // scale, and translate(offsetCanvasX, offsetCanvasY)\n this.transform = [\n rotateA * scale,\n rotateB * scale,\n rotateC * scale,\n rotateD * scale,\n offsetCanvasX - rotateA * scale * centerX - rotateC * scale * centerY,\n offsetCanvasY - rotateB * scale * centerX - rotateD * scale * centerY,\n ];\n\n this.width = width;\n this.height = height;\n }\n\n /**\n * The original, un-scaled, viewport dimensions.\n * @type {object}\n */\n get rawDims() {\n const dims = this.viewBox;\n\n return shadow(this, \"rawDims\", {\n pageWidth: dims[2] - dims[0],\n pageHeight: dims[3] - dims[1],\n pageX: dims[0],\n pageY: dims[1],\n });\n }\n\n /**\n * Clones viewport, with optional additional properties.\n * @param {PageViewportCloneParameters} [params]\n * @returns {PageViewport} Cloned viewport.\n */\n clone({\n scale = this.scale,\n rotation = this.rotation,\n offsetX = this.offsetX,\n offsetY = this.offsetY,\n dontFlip = false,\n } = {}) {\n return new PageViewport({\n viewBox: this.viewBox.slice(),\n userUnit: this.userUnit,\n scale,\n rotation,\n offsetX,\n offsetY,\n dontFlip,\n });\n }\n\n /**\n * Converts PDF point to the viewport coordinates. For examples, useful for\n * converting PDF location into canvas pixel coordinates.\n * @param {number} x - The x-coordinate.\n * @param {number} y - The y-coordinate.\n * @returns {Array} Array containing `x`- and `y`-coordinates of the\n * point in the viewport coordinate space.\n * @see {@link convertToPdfPoint}\n */\n convertToViewportPoint(x, y) {\n const p = [x, y];\n Util.applyTransform(p, this.transform);\n return p;\n }\n\n /**\n * Converts viewport coordinates to the PDF location. For examples, useful\n * for converting canvas pixel location into PDF one.\n * @param {number} x - The x-coordinate.\n * @param {number} y - The y-coordinate.\n * @returns {Array} Array containing `x`- and `y`-coordinates of the\n * point in the PDF coordinate space.\n * @see {@link convertToViewportPoint}\n */\n convertToPdfPoint(x, y) {\n const p = [x, y];\n Util.applyInverseTransform(p, this.transform);\n return p;\n }\n}\n\nexport { PageViewport };\n","/* Copyright 2021 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/** @typedef {import(\"./api\").TextContent} TextContent */\n\nclass XfaText {\n /**\n * Walk an XFA tree and create an array of text nodes that is compatible\n * with a regular PDFs TextContent. Currently, only TextItem.str is supported,\n * all other fields and styles haven't been implemented.\n * @param {object} xfa - An XFA fake DOM object.\n * @returns {TextContent}\n */\n static textContent(xfa) {\n const items = [];\n const output = {\n items,\n styles: Object.create(null),\n };\n function walk(node) {\n if (!node) {\n return;\n }\n let str = null;\n const name = node.name;\n if (name === \"#text\") {\n str = node.value;\n } else if (!XfaText.shouldBuildText(name)) {\n return;\n } else if (node?.attributes?.textContent) {\n str = node.attributes.textContent;\n } else if (node.value) {\n str = node.value;\n }\n if (str !== null) {\n items.push({\n str,\n });\n }\n if (!node.children) {\n return;\n }\n for (const child of node.children) {\n walk(child);\n }\n }\n walk(xfa);\n return output;\n }\n\n /**\n * @param {string} name - DOM node name. (lower case)\n * @returns {boolean} true if the DOM node should have a corresponding text\n * node.\n */\n static shouldBuildText(name) {\n return !(\n name === \"textarea\" ||\n name === \"input\" ||\n name === \"option\" ||\n name === \"select\"\n );\n }\n}\n\nexport { XfaText };\n","/* Copyright 2021 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// eslint-disable-next-line max-len\n/** @typedef {import(\"./annotation_storage\").AnnotationStorage} AnnotationStorage */\n// eslint-disable-next-line max-len\n/** @typedef {import(\"../../web/pdf_link_service.js\").PDFLinkService} PDFLinkService */\n\nimport { shadow, SVG_NS } from \"../shared/util.js\";\nimport { PageViewport } from \"./page_viewport.js\";\nimport { XfaText } from \"./xfa_text.js\";\n\n/**\n * @typedef {object} XfaLayerParameters\n * @property {PageViewport} viewport\n * @property {HTMLDivElement} div\n * @property {object} xfaHtml\n * @property {AnnotationStorage} [annotationStorage]\n * @property {PDFLinkService} linkService\n * @property {string} [intent] - (default value is 'display').\n */\n\nconst disallowedRichTextStyleRegExp = /url\\(|image-set\\(/i;\n\nconst disallowedEventHandlerAttrRegExp = /^on/i;\n\nclass XfaLayer {\n static get _allowedHtmlElements() {\n return shadow(\n this,\n \"_allowedHtmlElements\",\n new Set([\n \"a\",\n \"b\",\n \"br\",\n \"button\",\n \"div\",\n \"i\",\n \"img\",\n \"input\",\n \"label\",\n \"li\",\n \"ol\",\n \"option\",\n \"p\",\n \"select\",\n \"span\",\n \"sub\",\n \"sup\",\n \"textarea\",\n \"ul\",\n ])\n );\n }\n\n static get _allowedSvgElements() {\n return shadow(\n this,\n \"_allowedSvgElements\",\n new Set([\"ellipse\", \"line\", \"path\", \"rect\", \"svg\"])\n );\n }\n\n // The elements the rich text renderer is allowed to create: this matches the\n // (much smaller) set the worker can emit for rich text, see\n // `src/core/xfa/xhtml.js`. In particular no SVG and no interactive/form\n // elements are allowed here.\n static get _allowedRichTextElements() {\n return shadow(\n this,\n \"_allowedRichTextElements\",\n new Set([\n \"a\",\n \"b\",\n \"br\",\n \"div\",\n \"i\",\n \"li\",\n \"ol\",\n \"p\",\n \"span\",\n \"sub\",\n \"sup\",\n \"ul\",\n ])\n );\n }\n\n static get _allowedRichTextAttributes() {\n return shadow(\n this,\n \"_allowedRichTextAttributes\",\n new Set([\"class\", \"dir\", \"style\"])\n );\n }\n\n // The CSS properties the rich text renderer is allowed to set (camel-cased,\n // as produced by `mapStyle` in `src/core/xfa/xhtml.js`). This mirrors that\n // file's `VALID_STYLES`, so it excludes anything that could load a remote\n // resource or escape the layout (e.g. `position`, `zIndex`, `background`).\n static get _allowedRichTextStyles() {\n return shadow(\n this,\n \"_allowedRichTextStyles\",\n new Set([\n \"color\",\n \"font\",\n \"fontFamily\",\n \"fontSize\",\n \"fontStretch\",\n \"fontStyle\",\n \"fontWeight\",\n \"kerningMode\",\n \"letterSpacing\",\n \"lineHeight\",\n \"margin\",\n \"marginBottom\",\n \"marginLeft\",\n \"marginRight\",\n \"marginTop\",\n \"orphans\",\n \"paddingLeft\",\n \"paddingRight\",\n \"breakAfter\",\n \"breakBefore\",\n \"breakInside\",\n \"tabInterval\",\n \"tabStop\",\n \"textAlign\",\n \"textDecoration\",\n \"textIndent\",\n \"transform\",\n \"verticalAlign\",\n \"widows\",\n ])\n );\n }\n\n static setupStorage(html, id, element, storage, intent) {\n const storedData = storage.getValue(id, { value: null });\n switch (element.name) {\n case \"textarea\":\n if (storedData.value !== null) {\n html.textContent = storedData.value;\n }\n if (intent === \"print\") {\n break;\n }\n html.addEventListener(\"input\", event => {\n storage.setValue(id, { value: event.target.value });\n });\n break;\n case \"input\":\n if (\n element.attributes.type === \"radio\" ||\n element.attributes.type === \"checkbox\"\n ) {\n if (storedData.value === element.attributes.xfaOn) {\n html.setAttribute(\"checked\", true);\n } else if (storedData.value === element.attributes.xfaOff) {\n // The checked attribute may have been set when opening the file,\n // unset through the UI and we're here because of printing.\n html.removeAttribute(\"checked\");\n }\n if (intent === \"print\") {\n break;\n }\n html.addEventListener(\"change\", event => {\n storage.setValue(id, {\n value: event.target.checked\n ? event.target.getAttribute(\"xfaOn\")\n : event.target.getAttribute(\"xfaOff\"),\n });\n });\n } else {\n if (storedData.value !== null) {\n html.setAttribute(\"value\", storedData.value);\n }\n if (intent === \"print\") {\n break;\n }\n html.addEventListener(\"input\", event => {\n storage.setValue(id, { value: event.target.value });\n });\n }\n break;\n case \"select\":\n if (storedData.value !== null) {\n html.setAttribute(\"value\", storedData.value);\n for (const option of element.children) {\n if (option.attributes.value === storedData.value) {\n option.attributes.selected = true;\n } else if (Object.hasOwn(option.attributes, \"selected\")) {\n delete option.attributes.selected;\n }\n }\n }\n html.addEventListener(\"input\", event => {\n const options = event.target.options;\n const value =\n options.selectedIndex === -1\n ? \"\"\n : options[options.selectedIndex].value;\n storage.setValue(id, { value });\n });\n break;\n }\n }\n\n static setAttributes({ html, element, storage = null, intent, linkService }) {\n const { attributes } = element;\n const isHTMLAnchorElement = html instanceof HTMLAnchorElement;\n\n if (attributes.type === \"radio\") {\n // Avoid to have a radio group when printing with the same as one\n // already displayed.\n attributes.name = `${attributes.name}-${intent}`;\n }\n for (const [key, value] of Object.entries(attributes)) {\n if (\n value === null ||\n value === undefined ||\n disallowedEventHandlerAttrRegExp.test(key)\n ) {\n continue;\n }\n\n if (intent === \"richText\" && !this._allowedRichTextAttributes.has(key)) {\n continue;\n }\n\n switch (key) {\n case \"class\":\n if (value.length) {\n html.setAttribute(key, value.join(\" \"));\n }\n break;\n case \"dataId\":\n // We don't need to add dataId in the html object but it can\n // be useful to know its value when writing printing tests:\n // in this case, don't skip dataId to have its value.\n break;\n case \"id\":\n html.setAttribute(\"data-element-id\", value);\n break;\n case \"style\":\n if (intent === \"richText\") {\n const allowedStyles = this._allowedRichTextStyles;\n for (const [styleName, styleValue] of Object.entries(value)) {\n if (\n allowedStyles.has(styleName) &&\n !disallowedRichTextStyleRegExp.test(styleValue)\n ) {\n html.style[styleName] = styleValue;\n }\n }\n } else {\n Object.assign(html.style, value);\n }\n break;\n case \"textContent\":\n html.textContent = value;\n break;\n default:\n if (!isHTMLAnchorElement || (key !== \"href\" && key !== \"newWindow\")) {\n html.setAttribute(key, value);\n }\n }\n }\n\n if (isHTMLAnchorElement) {\n linkService?.addLinkAttributes(\n html,\n attributes.href,\n attributes.newWindow\n );\n }\n\n // Set the value after the others to be sure to overwrite any other values.\n if (storage && attributes.dataId) {\n this.setupStorage(html, attributes.dataId, element, storage);\n }\n }\n\n static #createElement(name, xmlns, intent) {\n if (intent === \"richText\") {\n return !xmlns && this._allowedRichTextElements.has(name)\n ? document.createElement(name)\n : null;\n }\n if (xmlns) {\n return xmlns === SVG_NS && this._allowedSvgElements.has(name)\n ? document.createElementNS(SVG_NS, name)\n : null;\n }\n return this._allowedHtmlElements.has(name)\n ? document.createElement(name)\n : null;\n }\n\n /**\n * Render the XFA layer.\n * @param {XfaLayerParameters} parameters\n */\n static render(parameters) {\n const storage = parameters.annotationStorage;\n const linkService = parameters.linkService;\n const root = parameters.xfaHtml;\n const intent = parameters.intent || \"display\";\n const rootHtml =\n this.#createElement(root.name, root.attributes?.xmlns, intent) ??\n document.createElement(\"div\");\n if (root.attributes) {\n this.setAttributes({\n html: rootHtml,\n element: root,\n intent,\n linkService,\n });\n }\n\n const isNotForRichText = intent !== \"richText\";\n const rootDiv = parameters.div;\n rootDiv.append(rootHtml);\n\n if (parameters.viewport) {\n const transform = `matrix(${parameters.viewport.transform.join(\",\")})`;\n rootDiv.style.transform = transform;\n }\n\n // Set defaults.\n if (isNotForRichText) {\n rootDiv.setAttribute(\"class\", \"xfaLayer xfaFont\");\n }\n\n // Text nodes used for the text highlighter.\n const textDivs = [];\n\n // In the rich text context, it's possible to just have a text node without\n // a root element, so we handle this case here (see issue 17215).\n if (root.children.length === 0) {\n if (root.value) {\n const node = document.createTextNode(root.value);\n rootHtml.append(node);\n if (isNotForRichText && XfaText.shouldBuildText(root.name)) {\n textDivs.push(node);\n }\n }\n return { textDivs };\n }\n\n const stack = [[root, -1, rootHtml]];\n\n while (stack.length > 0) {\n const [parent, i, html] = stack.at(-1);\n if (i + 1 === parent.children.length) {\n stack.pop();\n continue;\n }\n\n const child = parent.children[++stack.at(-1)[1]];\n if (child === null) {\n continue;\n }\n\n const { name } = child;\n if (name === \"#text\") {\n const node = document.createTextNode(child.value);\n textDivs.push(node);\n html.append(node);\n continue;\n }\n\n const childHtml = this.#createElement(\n name,\n child.attributes?.xmlns,\n intent\n );\n if (!childHtml) {\n continue;\n }\n\n html.append(childHtml);\n if (child.attributes) {\n this.setAttributes({\n html: childHtml,\n element: child,\n storage,\n intent,\n linkService,\n });\n }\n\n if (child.children?.length > 0) {\n stack.push([child, -1, childHtml]);\n } else if (child.value) {\n const node = document.createTextNode(child.value);\n if (isNotForRichText && XfaText.shouldBuildText(name)) {\n textDivs.push(node);\n }\n childHtml.append(node);\n }\n }\n\n /**\n * TODO: re-enable that stuff once we've JS implementation.\n * See https://bugzilla.mozilla.org/show_bug.cgi?id=1719465.\n *\n * for (const el of rootDiv.querySelectorAll(\n * \".xfaDisabled input, .xfaDisabled textarea\"\n * )) {\n * el.setAttribute(\"disabled\", true);\n * }\n * for (const el of rootDiv.querySelectorAll(\n * \".xfaReadOnly input, .xfaReadOnly textarea\"\n * )) {\n * el.setAttribute(\"readOnly\", true);\n * }\n */\n\n for (const el of rootDiv.querySelectorAll(\n \".xfaNonInteractive input, .xfaNonInteractive textarea\"\n )) {\n el.setAttribute(\"readOnly\", true);\n }\n\n return {\n textDivs,\n };\n }\n\n /**\n * Update the XFA layer.\n * @param {XfaLayerParameters} parameters\n */\n static update(parameters) {\n const transform = `matrix(${parameters.viewport.transform.join(\",\")})`;\n parameters.div.style.transform = transform;\n parameters.div.hidden = false;\n }\n\n /**\n * NOTE: This is (mostly) intended to support printing of XFA forms.\n */\n static getPageViewport(xfaPage, { scale = 1, rotation = 0 }) {\n const { width, height } = xfaPage.attributes.style;\n\n return new PageViewport({\n viewBox: [0, 0, parseInt(width, 10), parseInt(height, 10)],\n userUnit: 1,\n scale,\n rotation,\n });\n }\n}\n\nexport { XfaLayer };\n","/* Copyright 2015 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n BaseException,\n DrawOPS,\n shadow,\n stripPath,\n Util,\n warn,\n} from \"../shared/util.js\";\nimport { MathClamp } from \"../shared/math_clamp.js\";\nimport { PageViewport } from \"./page_viewport.js\";\nimport { XfaLayer } from \"./xfa_layer.js\";\n\nclass PixelsPerInch {\n static CSS = 96.0;\n\n static PDF = 72.0;\n\n static PDF_TO_CSS_UNITS = this.CSS / this.PDF;\n}\n\nasync function fetchData(url, type = \"text\") {\n if (\n (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) ||\n isValidFetchUrl(url, document.baseURI)\n ) {\n const response = await fetch(url);\n if (!response.ok) {\n throw new Error(response.statusText);\n }\n switch (type) {\n case \"blob\":\n return response.blob();\n case \"bytes\":\n return response.bytes();\n case \"json\":\n return response.json();\n }\n return response.text();\n }\n\n // The Fetch API is not supported.\n return new Promise((resolve, reject) => {\n const request = new XMLHttpRequest();\n request.open(\"GET\", url, /* async = */ true);\n request.responseType = type === \"bytes\" ? \"arraybuffer\" : type;\n\n request.onreadystatechange = () => {\n if (request.readyState !== XMLHttpRequest.DONE) {\n return;\n }\n if (request.status === 200 || request.status === 0) {\n switch (type) {\n case \"bytes\":\n resolve(new Uint8Array(request.response));\n return;\n case \"blob\":\n case \"json\":\n resolve(request.response);\n return;\n }\n resolve(request.responseText);\n return;\n }\n reject(new Error(request.statusText));\n };\n\n request.send(null);\n });\n}\n\nclass RenderingCancelledException extends BaseException {\n constructor(msg, extraDelay = 0) {\n super(msg, \"RenderingCancelledException\");\n this.extraDelay = extraDelay;\n }\n}\n\nfunction isDataScheme(url) {\n const ii = url.length;\n let i = 0;\n while (i < ii && url[i].trim() === \"\") {\n i++;\n }\n return url.substring(i, i + 5).toLowerCase() === \"data:\";\n}\n\nfunction isPdfFile(filename) {\n return typeof filename === \"string\" && /\\.pdf$/i.test(filename);\n}\n\n/**\n * Gets the filename from a given URL.\n * @param {string} url\n * @returns {string}\n */\nfunction getFilenameFromUrl(url) {\n [url] = url.split(/[#?]/, 1);\n return stripPath(url);\n}\n\n/**\n * Returns the filename or guessed filename from the url (see issue 3455).\n * @param {string} url - The original PDF location.\n * @param {string} defaultFilename - The value returned if the filename is\n * unknown, or the protocol is unsupported.\n * @returns {string} Guessed PDF filename.\n */\nfunction getPdfFilenameFromUrl(url, defaultFilename = \"document.pdf\") {\n if (typeof url !== \"string\") {\n return defaultFilename;\n }\n if (isDataScheme(url)) {\n warn('getPdfFilenameFromUrl: ignore \"data:\"-URL for performance reasons.');\n return defaultFilename;\n }\n\n const getURL = urlString => {\n try {\n return new URL(urlString);\n } catch {}\n try {\n return new URL(decodeURIComponent(urlString));\n } catch {}\n try {\n // Attempt to parse the URL using the document's base URI.\n return new URL(urlString, \"https://foo.bar\");\n } catch {}\n try {\n return new URL(decodeURIComponent(urlString), \"https://foo.bar\");\n } catch {}\n\n return null;\n };\n\n const newURL = getURL(url);\n if (!newURL) {\n // If the URL is invalid, return the default filename.\n return defaultFilename;\n }\n\n const decode = name => {\n try {\n let decoded = decodeURIComponent(name);\n if (decoded.includes(\"/\")) {\n decoded = stripPath(decoded);\n // Ignore the decoded name if it's identical to \".pdf\".\n if (decoded.length === 4 && pdfRegex.test(decoded)) {\n return name;\n }\n }\n return decoded;\n } catch {\n return name;\n }\n };\n\n const pdfRegex = /\\.pdf$/i;\n const filename = stripPath(newURL.pathname);\n if (pdfRegex.test(filename)) {\n return decode(filename);\n }\n\n if (newURL.searchParams.size > 0) {\n const getLast = iterator => [...iterator].findLast(v => pdfRegex.test(v));\n\n // If any of the search parameters ends with \".pdf\", return it.\n const name =\n getLast(newURL.searchParams.values()) ??\n getLast(newURL.searchParams.keys());\n if (name) {\n return decode(name);\n }\n }\n\n if (newURL.hash) {\n // Locate the last \".pdf\" and then extend it to the left, up to the closest\n // separator. Both steps are linear, whereas a single pattern starting with\n // `[^/?#=]+` is quadratic on a hash which contains no \".pdf\" at all.\n const { hash } = newURL;\n let extensionStart = -1;\n for (const { index } of hash.matchAll(/\\.pdf\\b/gi)) {\n extensionStart = index;\n }\n if (extensionStart > 0) {\n let filenameStart = extensionStart;\n while (filenameStart > 0 && !\"/?#=\".includes(hash[filenameStart - 1])) {\n filenameStart--;\n }\n if (filenameStart < extensionStart) {\n return decode(hash.slice(filenameStart, extensionStart + 4));\n }\n }\n }\n\n return defaultFilename;\n}\n\nclass StatTimer {\n #started = new Map();\n\n times = [];\n\n time(name) {\n if (this.#started.has(name)) {\n warn(`Timer is already running for ${name}`);\n }\n this.#started.set(name, Date.now());\n }\n\n timeEnd(name) {\n if (!this.#started.has(name)) {\n warn(`Timer has not been started for ${name}`);\n }\n this.times.push({\n name,\n start: this.#started.get(name),\n end: Date.now(),\n });\n // Remove timer from started so it can be called again.\n this.#started.delete(name);\n }\n\n toString() {\n // Find the longest name for padding purposes.\n const longest = Math.max(...this.times.map(t => t.name.length));\n\n return this.times\n .map(t => `${t.name.padEnd(longest)} ${t.end - t.start}ms\\n`)\n .join(\"\");\n }\n}\n\nfunction isValidFetchUrl(url, baseUrl) {\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n throw new Error(\"Not implemented: isValidFetchUrl\");\n }\n const res = baseUrl ? URL.parse(url, baseUrl) : URL.parse(url);\n // The Fetch API only supports the http/https protocols, and not file/ftp.\n return /https?:/.test(res?.protocol ?? \"\");\n}\n\n/**\n * Event handler to suppress context menu.\n */\nfunction noContextMenu(e) {\n e.preventDefault();\n}\n\nfunction stopEvent(e) {\n e.preventDefault();\n e.stopPropagation();\n}\n\n// Deprecated API function -- display regardless of the `verbosity` setting.\nfunction deprecated(details) {\n // eslint-disable-next-line no-console\n console.log(\"Deprecated API usage: \" + details);\n}\n\nclass PDFDateString {\n static #regex;\n\n /**\n * Convert a PDF date string to a JavaScript `Date` object.\n *\n * The PDF date string format is described in section 7.9.4 of the official\n * PDF 32000-1:2008 specification. However, in the PDF 1.7 reference (sixth\n * edition) Adobe describes the same format including a trailing apostrophe.\n * This syntax in incorrect, but Adobe Acrobat creates PDF files that contain\n * them. We ignore all apostrophes as they are not necessary for date parsing.\n *\n * Moreover, Adobe Acrobat doesn't handle changing the date to universal time\n * and doesn't use the user's time zone (effectively ignoring the HH' and mm'\n * parts of the date string).\n * @param {string} input\n * @returns {Date|null}\n */\n static toDateObject(input) {\n if (input instanceof Date) {\n return input;\n }\n if (!input || typeof input !== \"string\") {\n return null;\n }\n\n // Lazily initialize the regular expression.\n this.#regex ||= new RegExp(\n \"^D:\" + // Prefix (required)\n \"(\\\\d{4})\" + // Year (required)\n \"(\\\\d{2})?\" + // Month (optional)\n \"(\\\\d{2})?\" + // Day (optional)\n \"(\\\\d{2})?\" + // Hour (optional)\n \"(\\\\d{2})?\" + // Minute (optional)\n \"(\\\\d{2})?\" + // Second (optional)\n \"([Z|+\\\\-])?\" + // Universal time relation (optional)\n \"(\\\\d{2})?\" + // Offset hour (optional)\n \"'?\" + // Splitting apostrophe (optional)\n \"(\\\\d{2})?\" + // Offset minute (optional)\n \"'?\" // Trailing apostrophe (optional)\n );\n\n // Optional fields that don't satisfy the requirements from the regular\n // expression (such as incorrect digit counts or numbers that are out of\n // range) will fall back the defaults from the specification.\n const matches = this.#regex.exec(input);\n if (!matches) {\n return null;\n }\n\n // JavaScript's `Date` object expects the month to be between 0 and 11\n // instead of 1 and 12, so we have to correct for that.\n const year = parseInt(matches[1], 10);\n let month = parseInt(matches[2], 10);\n month = month >= 1 && month <= 12 ? month - 1 : 0;\n let day = parseInt(matches[3], 10);\n day = day >= 1 && day <= 31 ? day : 1;\n let hour = parseInt(matches[4], 10);\n hour = hour >= 0 && hour <= 23 ? hour : 0;\n let minute = parseInt(matches[5], 10);\n minute = minute >= 0 && minute <= 59 ? minute : 0;\n let second = parseInt(matches[6], 10);\n second = second >= 0 && second <= 59 ? second : 0;\n const universalTimeRelation = matches[7] || \"Z\";\n let offsetHour = parseInt(matches[8], 10);\n offsetHour = offsetHour >= 0 && offsetHour <= 23 ? offsetHour : 0;\n let offsetMinute = parseInt(matches[9], 10) || 0;\n offsetMinute = offsetMinute >= 0 && offsetMinute <= 59 ? offsetMinute : 0;\n\n // Universal time relation 'Z' means that the local time is equal to the\n // universal time, whereas the relations '+'/'-' indicate that the local\n // time is later respectively earlier than the universal time. Every date\n // is normalized to universal time.\n if (universalTimeRelation === \"-\") {\n hour += offsetHour;\n minute += offsetMinute;\n } else if (universalTimeRelation === \"+\") {\n hour -= offsetHour;\n minute -= offsetMinute;\n }\n\n return new Date(Date.UTC(year, month, day, hour, minute, second));\n }\n}\n\nfunction getRGBA(color) {\n if (color.startsWith(\"#\")) {\n // #RRGGBB or #RRGGBBAA\n const hex = color.slice(1);\n return [\n parseInt(hex.slice(0, 2), 16),\n parseInt(hex.slice(2, 4), 16),\n parseInt(hex.slice(4, 6), 16),\n hex.length >= 8 ? parseInt(hex.slice(6, 8), 16) / 255 : 1,\n ];\n }\n\n if (color.startsWith(\"rgb(\")) {\n // getComputedStyle(...).color returns a `rgb(R, G, B)` color.\n const [r, g, b] = color\n .slice(/* \"rgb(\".length */ 4, -1) // Strip out \"rgb(\" and \")\".\n .split(\",\")\n .map(x => parseInt(x, 10));\n return [r, g, b, 1];\n }\n\n if (color.startsWith(\"rgba(\")) {\n const parts = color\n .slice(/* \"rgba(\".length */ 5, -1) // Strip out \"rgba(\" and \")\".\n .split(\",\");\n return [\n parseInt(parts[0], 10),\n parseInt(parts[1], 10),\n parseInt(parts[2], 10),\n parseFloat(parts[3]),\n ];\n }\n\n // color(srgb r g b / a) — CSS Color 4, used e.g. by Firefox alpha inputs.\n // Components are in [0, 1]; alpha may be \"none\" (treated as fully opaque).\n const m = color.match(\n /^color\\(srgb\\s+([\\d.]+)\\s+([\\d.]+)\\s+([\\d.]+)(?:\\s*\\/\\s*([\\d.]+|none))?\\)$/\n );\n if (m) {\n return [\n Math.round(parseFloat(m[1]) * 255),\n Math.round(parseFloat(m[2]) * 255),\n Math.round(parseFloat(m[3]) * 255),\n m[4] !== undefined && m[4] !== \"none\" ? parseFloat(m[4]) : 1,\n ];\n }\n\n return null;\n}\n\nfunction getRGB(color) {\n const rgba = getRGBA(color);\n if (!rgba) {\n warn(`Not a valid color format: \"${color}\"`);\n return [0, 0, 0];\n }\n return rgba.slice(0, 3);\n}\n\nfunction getColorValues(colors) {\n const span = document.createElement(\"span\");\n span.style.visibility = \"hidden\";\n // NOTE: The following does *not* affect `forced-colors: active` mode.\n span.style.colorScheme = \"only light\";\n document.body.append(span);\n for (const name of colors.keys()) {\n span.style.color = name;\n const computedColor = window.getComputedStyle(span).color;\n colors.set(name, getRGB(computedColor));\n }\n span.remove();\n}\n\nfunction getCurrentTransform(ctx) {\n const { a, b, c, d, e, f } = ctx.getTransform();\n return [a, b, c, d, e, f];\n}\n\nfunction getCurrentTransformInverse(ctx) {\n const { a, b, c, d, e, f } = ctx.getTransform().invertSelf();\n return [a, b, c, d, e, f];\n}\n\n/**\n * @param {HTMLDivElement} div\n * @param {PageViewport} viewport\n * @param {boolean} mustFlip\n * @param {boolean} mustRotate\n */\nfunction setLayerDimensions(\n div,\n viewport,\n mustFlip = false,\n mustRotate = true\n) {\n if (viewport instanceof PageViewport) {\n const { pageWidth, pageHeight } = viewport.rawDims;\n const { style } = div;\n\n const widthStr = `round(down, var(--total-scale-factor) * ${pageWidth}px, var(--scale-round-x))`,\n heightStr = `round(down, var(--total-scale-factor) * ${pageHeight}px, var(--scale-round-y))`;\n\n if (!mustFlip || viewport.rotation % 180 === 0) {\n style.width = widthStr;\n style.height = heightStr;\n } else {\n style.width = heightStr;\n style.height = widthStr;\n }\n }\n\n if (mustRotate) {\n div.setAttribute(\"data-main-rotation\", viewport.rotation);\n }\n}\n\n/**\n * Scale factors for the canvas, necessary with HiDPI displays.\n */\nclass OutputScale {\n constructor() {\n const { pixelRatio } = OutputScale;\n\n /**\n * @type {number} Horizontal scale.\n */\n this.sx = pixelRatio;\n\n /**\n * @type {number} Vertical scale.\n */\n this.sy = pixelRatio;\n }\n\n /**\n * @type {boolean} Returns `true` when scaling is required, `false` otherwise.\n */\n get scaled() {\n return this.sx !== 1 || this.sy !== 1;\n }\n\n /**\n * @type {boolean} Returns `true` when scaling is symmetric,\n * `false` otherwise.\n */\n get symmetric() {\n return this.sx === this.sy;\n }\n\n /**\n * @returns {boolean} Returns `true` if scaling was limited,\n * `false` otherwise.\n */\n limitCanvas(width, height, maxPixels, maxDim, capAreaFactor = -1) {\n let maxAreaScale = Infinity,\n maxWidthScale = Infinity,\n maxHeightScale = Infinity;\n\n maxPixels = OutputScale.capPixels(maxPixels, capAreaFactor);\n if (maxPixels > 0) {\n maxAreaScale = Math.sqrt(maxPixels / (width * height));\n }\n if (maxDim !== -1) {\n maxWidthScale = maxDim / width;\n maxHeightScale = maxDim / height;\n }\n const maxScale = Math.min(maxAreaScale, maxWidthScale, maxHeightScale);\n\n if (this.sx > maxScale || this.sy > maxScale) {\n this.sx = maxScale;\n this.sy = maxScale;\n return true;\n }\n return false;\n }\n\n static get pixelRatio() {\n return globalThis.devicePixelRatio || 1;\n }\n\n static capPixels(maxPixels, capAreaFactor) {\n if (capAreaFactor >= 0) {\n const winPixels = Math.ceil(\n (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"TESTING\")\n ? window.innerWidth * window.innerHeight\n : window.screen.availWidth * window.screen.availHeight) *\n this.pixelRatio ** 2 *\n (1 + capAreaFactor / 100)\n );\n return maxPixels > 0 ? Math.min(maxPixels, winPixels) : winPixels;\n }\n return maxPixels;\n }\n}\n\n// See https://developer.mozilla.org/en-US/docs/Web/Media/Formats/Image_types\n// to know which types are supported by the browser.\nconst SupportedImageMimeTypes = new Set([\n \"image/apng\",\n \"image/avif\",\n \"image/bmp\",\n \"image/gif\",\n \"image/jpeg\",\n \"image/png\",\n \"image/svg+xml\",\n \"image/webp\",\n \"image/x-icon\",\n]);\n\nclass ColorScheme {\n static get isDarkMode() {\n return shadow(\n this,\n \"isDarkMode\",\n !!window?.matchMedia?.(\"(prefers-color-scheme: dark)\").matches\n );\n }\n}\n\nclass CSSConstants {\n static get commentForegroundColor() {\n const element = document.createElement(\"span\");\n element.classList.add(\"comment\", \"sidebar\");\n const { style } = element;\n style.width = style.height = \"0\";\n style.display = \"none\";\n style.color = \"var(--comment-fg-color)\";\n document.body.append(element);\n const { color } = window.getComputedStyle(element);\n element.remove();\n return shadow(this, \"commentForegroundColor\", getRGB(color));\n }\n}\n\nfunction applyOpacity(color, opacity) {\n opacity = MathClamp(opacity ?? 1, 0, 1);\n const white = 255 * (1 - opacity);\n return color.map(c => Math.round(c * opacity + white));\n}\n\nfunction RGBToHSL(rgb, output) {\n const r = rgb[0] / 255;\n const g = rgb[1] / 255;\n const b = rgb[2] / 255;\n\n const max = Math.max(r, g, b);\n const min = Math.min(r, g, b);\n const l = (max + min) / 2;\n\n if (max === min) {\n // achromatic\n output[0] = output[1] = 0; // hue and saturation are 0\n } else {\n const d = max - min;\n output[1] = l < 0.5 ? d / (max + min) : d / (2 - max - min);\n // hue\n switch (max) {\n case r:\n output[0] = ((g - b) / d + (g < b ? 6 : 0)) * 60;\n break;\n case g:\n output[0] = ((b - r) / d + 2) * 60;\n break;\n case b:\n output[0] = ((r - g) / d + 4) * 60;\n break;\n }\n }\n output[2] = l;\n}\n\nfunction HSLToRGB(hsl, output) {\n const h = hsl[0];\n const s = hsl[1];\n const l = hsl[2];\n const c = (1 - Math.abs(2 * l - 1)) * s; // chroma\n const x = c * (1 - Math.abs(((h / 60) % 2) - 1));\n const m = l - c / 2;\n\n switch (Math.floor(h / 60)) {\n case 0:\n output[0] = c + m;\n output[1] = x + m;\n output[2] = m;\n break;\n case 1:\n output[0] = x + m;\n output[1] = c + m;\n output[2] = m;\n break;\n case 2:\n output[0] = m;\n output[1] = c + m;\n output[2] = x + m;\n break;\n case 3:\n output[0] = m;\n output[1] = x + m;\n output[2] = c + m;\n break;\n case 4:\n output[0] = x + m;\n output[1] = m;\n output[2] = c + m;\n break;\n case 5:\n case 6:\n output[0] = c + m;\n output[1] = m;\n output[2] = x + m;\n break;\n }\n}\n\nfunction computeLuminance(x) {\n return x <= 0.03928 ? x / 12.92 : ((x + 0.055) / 1.055) ** 2.4;\n}\n\nfunction contrastRatio(hsl1, hsl2, output) {\n HSLToRGB(hsl1, output);\n output.map(computeLuminance);\n const lum1 = 0.2126 * output[0] + 0.7152 * output[1] + 0.0722 * output[2];\n HSLToRGB(hsl2, output);\n output.map(computeLuminance);\n const lum2 = 0.2126 * output[0] + 0.7152 * output[1] + 0.0722 * output[2];\n return lum1 > lum2\n ? (lum1 + 0.05) / (lum2 + 0.05)\n : (lum2 + 0.05) / (lum1 + 0.05);\n}\n\n// Cache for the findContrastColor function, to improve performance.\nconst contrastCache = new Map();\n\n/**\n * Find a color that has sufficient contrast against a fixed color.\n * The luminance (in HSL color space) of the base color is adjusted\n * until the contrast ratio between the base color and the fixed color\n * is at least the minimum contrast ratio required by WCAG 2.1.\n * @param {Array} baseColor\n * @param {Array} fixedColor\n * @returns {string}\n */\nfunction findContrastColor(baseColor, fixedColor) {\n const key =\n baseColor[0] +\n baseColor[1] * 0x100 +\n baseColor[2] * 0x10000 +\n fixedColor[0] * 0x1000000 +\n fixedColor[1] * 0x100000000 +\n fixedColor[2] * 0x10000000000;\n let cachedValue = contrastCache.get(key);\n if (cachedValue) {\n return cachedValue;\n }\n const array = new Float32Array(9);\n const output = array.subarray(0, 3);\n const baseHSL = array.subarray(3, 6);\n RGBToHSL(baseColor, baseHSL);\n const fixedHSL = array.subarray(6, 9);\n RGBToHSL(fixedColor, fixedHSL);\n const isFixedColorDark = fixedHSL[2] < 0.5;\n\n // Use the contrast ratio requirements from WCAG 2.1.\n // https://www.w3.org/TR/WCAG21/#contrast-minimum\n // https://www.w3.org/TR/WCAG21/#contrast-enhanced\n const minContrast = isFixedColorDark ? 12 : 4.5;\n\n baseHSL[2] = isFixedColorDark\n ? Math.sqrt(baseHSL[2])\n : 1 - Math.sqrt(1 - baseHSL[2]);\n\n if (contrastRatio(baseHSL, fixedHSL, output) < minContrast) {\n let start, end;\n if (isFixedColorDark) {\n start = baseHSL[2];\n end = 1;\n } else {\n start = 0;\n end = baseHSL[2];\n }\n const PRECISION = 0.005;\n while (end - start > PRECISION) {\n const mid = (baseHSL[2] = (start + end) / 2);\n if (\n isFixedColorDark ===\n contrastRatio(baseHSL, fixedHSL, output) < minContrast\n ) {\n start = mid;\n } else {\n end = mid;\n }\n }\n baseHSL[2] = isFixedColorDark ? end : start;\n }\n\n HSLToRGB(baseHSL, output);\n cachedValue = Util.makeHexColor(\n Math.round(output[0] * 255),\n Math.round(output[1] * 255),\n Math.round(output[2] * 255)\n );\n contrastCache.set(key, cachedValue);\n return cachedValue;\n}\n\nfunction renderRichText({ html, dir, className }, container) {\n const fragment = document.createDocumentFragment();\n if (typeof html === \"string\") {\n const p = document.createElement(\"p\");\n p.dir = dir || \"auto\";\n const lines = html.split(/\\r\\n?|\\n/);\n for (let i = 0, ii = lines.length; i < ii; ++i) {\n const line = lines[i];\n p.append(document.createTextNode(line));\n if (i < ii - 1) {\n p.append(document.createElement(\"br\"));\n }\n }\n fragment.append(p);\n } else {\n XfaLayer.render({\n xfaHtml: html,\n div: fragment,\n intent: \"richText\",\n });\n }\n fragment.firstElementChild.classList.add(\"richText\", className);\n container.append(fragment);\n}\n\nfunction makePathFromDrawOPS(data) {\n // Using a SVG string is slightly slower than using the following loop.\n const path = new Path2D();\n if (!data) {\n return path;\n }\n for (let i = 0, ii = data.length; i < ii;) {\n switch (data[i++]) {\n case DrawOPS.moveTo:\n path.moveTo(data[i++], data[i++]);\n break;\n case DrawOPS.lineTo:\n path.lineTo(data[i++], data[i++]);\n break;\n case DrawOPS.curveTo:\n path.bezierCurveTo(\n data[i++],\n data[i++],\n data[i++],\n data[i++],\n data[i++],\n data[i++]\n );\n break;\n case DrawOPS.quadraticCurveTo:\n path.quadraticCurveTo(data[i++], data[i++], data[i++], data[i++]);\n break;\n case DrawOPS.closePath:\n path.closePath();\n break;\n default:\n warn(`Unrecognized drawing path operator: ${data[i - 1]}`);\n break;\n }\n }\n return path;\n}\n\nexport {\n applyOpacity,\n ColorScheme,\n computeLuminance,\n CSSConstants,\n deprecated,\n fetchData,\n findContrastColor,\n getColorValues,\n getCurrentTransform,\n getCurrentTransformInverse,\n getFilenameFromUrl,\n getPdfFilenameFromUrl,\n getRGB,\n getRGBA,\n isDataScheme,\n isPdfFile,\n isValidFetchUrl,\n makePathFromDrawOPS,\n noContextMenu,\n OutputScale,\n PDFDateString,\n PixelsPerInch,\n RenderingCancelledException,\n renderRichText,\n setLayerDimensions,\n StatTimer,\n stopEvent,\n SupportedImageMimeTypes,\n};\n","/* Copyright 2023 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { noContextMenu, stopEvent } from \"../display_utils.js\";\n\nclass EditorToolbar {\n #toolbar = null;\n\n #colorPicker = null;\n\n #editor;\n\n #buttons = null;\n\n #altText = null;\n\n #comment = null;\n\n #commentButtonDivider = null;\n\n #signatureDescriptionButton = null;\n\n static #l10nRemove = null;\n\n constructor(editor) {\n this.#editor = editor;\n\n EditorToolbar.#l10nRemove ||= Object.freeze({\n freetext: \"pdfjs-editor-remove-freetext-button\",\n highlight: \"pdfjs-editor-remove-highlight-button\",\n ink: \"pdfjs-editor-remove-ink-button\",\n stamp: \"pdfjs-editor-remove-stamp-button\",\n signature: \"pdfjs-editor-remove-signature-button\",\n });\n }\n\n render() {\n const editToolbar = (this.#toolbar = document.createElement(\"div\"));\n editToolbar.classList.add(\"editToolbar\", \"hidden\");\n editToolbar.setAttribute(\"role\", \"toolbar\");\n\n const signal = this.#editor._uiManager._signal;\n if (signal instanceof AbortSignal && !signal.aborted) {\n editToolbar.addEventListener(\"contextmenu\", noContextMenu, { signal });\n editToolbar.addEventListener(\"pointerdown\", EditorToolbar.#pointerDown, {\n signal,\n });\n }\n\n const buttons = (this.#buttons = document.createElement(\"div\"));\n buttons.className = \"buttons\";\n editToolbar.append(buttons);\n\n const position = this.#editor.toolbarPosition;\n if (position) {\n const { style } = editToolbar;\n const x =\n this.#editor._uiManager.direction === \"ltr\"\n ? 1 - position[0]\n : position[0];\n style.insetInlineEnd = `${100 * x}%`;\n style.top = `calc(${\n 100 * position[1]\n }% + var(--editor-toolbar-vert-offset))`;\n }\n\n return editToolbar;\n }\n\n get div() {\n return this.#toolbar;\n }\n\n static #pointerDown(e) {\n e.stopPropagation();\n }\n\n #focusIn(e) {\n this.#editor._focusEventsAllowed = false;\n stopEvent(e);\n }\n\n #focusOut(e) {\n this.#editor._focusEventsAllowed = true;\n stopEvent(e);\n }\n\n #addListenersToElement(element) {\n // If we're clicking on a button with the keyboard or with\n // the mouse, we don't want to trigger any focus events on\n // the editor.\n const signal = this.#editor._uiManager._signal;\n if (!(signal instanceof AbortSignal) || signal.aborted) {\n return false;\n }\n element.addEventListener(\"focusin\", this.#focusIn.bind(this), {\n capture: true,\n signal,\n });\n element.addEventListener(\"focusout\", this.#focusOut.bind(this), {\n capture: true,\n signal,\n });\n element.addEventListener(\"contextmenu\", noContextMenu, { signal });\n return true;\n }\n\n hide() {\n this.#toolbar.classList.add(\"hidden\");\n this.#colorPicker?.hideDropdown();\n }\n\n show() {\n this.#toolbar.classList.remove(\"hidden\");\n this.#altText?.shown();\n this.#comment?.shown();\n }\n\n addDeleteButton() {\n const { editorType, _uiManager } = this.#editor;\n\n const button = document.createElement(\"button\");\n button.classList.add(\"basic\", \"deleteButton\");\n button.tabIndex = 0;\n button.setAttribute(\"data-l10n-id\", EditorToolbar.#l10nRemove[editorType]);\n if (this.#addListenersToElement(button)) {\n button.addEventListener(\n \"click\",\n e => {\n _uiManager.delete();\n },\n { signal: _uiManager._signal }\n );\n }\n this.#buttons.append(button);\n }\n\n get #divider() {\n const divider = document.createElement(\"div\");\n divider.className = \"divider\";\n return divider;\n }\n\n async addAltText(altText) {\n const button = await altText.render();\n this.#addListenersToElement(button);\n this.#buttons.append(button, this.#divider);\n this.#altText = altText;\n }\n\n addComment(comment, beforeElement = null) {\n if (this.#comment) {\n return;\n }\n const button = comment.renderForToolbar();\n if (!button) {\n return;\n }\n this.#addListenersToElement(button);\n const divider = (this.#commentButtonDivider = this.#divider);\n if (!beforeElement) {\n this.#buttons.append(button, divider);\n } else {\n this.#buttons.insertBefore(button, beforeElement);\n this.#buttons.insertBefore(divider, beforeElement);\n }\n this.#comment = comment;\n comment.toolbar = this;\n }\n\n addColorPicker(colorPicker) {\n if (this.#colorPicker) {\n return;\n }\n this.#colorPicker = colorPicker;\n const button = colorPicker.renderButton();\n this.#addListenersToElement(button);\n this.#buttons.append(button, this.#divider);\n }\n\n async addEditSignatureButton(signatureManager) {\n const button = (this.#signatureDescriptionButton =\n await signatureManager.renderEditButton(this.#editor));\n if (!button) {\n return;\n }\n this.#addListenersToElement(button);\n this.#buttons.append(button, this.#divider);\n }\n\n removeButton(name) {\n switch (name) {\n case \"comment\":\n this.#comment?.removeToolbarCommentButton();\n this.#comment = null;\n this.#commentButtonDivider?.remove();\n this.#commentButtonDivider = null;\n break;\n }\n }\n\n async addButton(name, tool) {\n switch (name) {\n case \"colorPicker\":\n if (tool) {\n this.addColorPicker(tool);\n }\n break;\n case \"altText\":\n if (tool) {\n await this.addAltText(tool);\n }\n break;\n case \"editSignature\":\n if (tool) {\n await this.addEditSignatureButton(tool);\n }\n break;\n case \"delete\":\n this.addDeleteButton();\n break;\n case \"comment\":\n if (tool) {\n this.addComment(tool);\n }\n break;\n }\n }\n\n async addButtonBefore(name, tool, beforeSelector) {\n if (!tool && name === \"comment\") {\n return;\n }\n const beforeElement = this.#buttons.querySelector(beforeSelector);\n if (!beforeElement) {\n return;\n }\n if (name === \"comment\") {\n this.addComment(tool, beforeElement);\n }\n }\n\n updateEditSignatureButton(description) {\n if (this.#signatureDescriptionButton) {\n this.#signatureDescriptionButton.title = description;\n }\n }\n\n remove() {\n this.#toolbar.remove();\n this.#colorPicker?.destroy();\n this.#colorPicker = null;\n }\n}\n\nclass FloatingToolbar {\n #buttons = null;\n\n #toolbar = null;\n\n #uiManager;\n\n constructor(uiManager) {\n this.#uiManager = uiManager;\n }\n\n #render() {\n const editToolbar = (this.#toolbar = document.createElement(\"div\"));\n editToolbar.className = \"editToolbar\";\n editToolbar.setAttribute(\"role\", \"toolbar\");\n // The toolbar is inserted in the text layer which is always LTR (see\n // `.pdfViewer .page`), hence the direction must be set here in order to\n // have `inset-inline-end` (see `show`) resolved against the UI direction.\n editToolbar.dir = this.#uiManager.direction;\n\n const signal = this.#uiManager._signal;\n if (signal instanceof AbortSignal && !signal.aborted) {\n editToolbar.addEventListener(\"contextmenu\", noContextMenu, {\n signal,\n });\n }\n\n const buttons = (this.#buttons = document.createElement(\"div\"));\n buttons.className = \"buttons\";\n editToolbar.append(buttons);\n\n if (this.#uiManager.hasCommentManager()) {\n this.#makeButton(\n \"commentButton\",\n `pdfjs-comment-floating-button`,\n \"pdfjs-comment-floating-button-label\",\n () => {\n this.#uiManager.commentSelection(\"floating_button\");\n }\n );\n }\n\n this.#makeButton(\n \"highlightButton\",\n `pdfjs-highlight-floating-button1`,\n \"pdfjs-highlight-floating-button-label\",\n () => {\n this.#uiManager.highlightSelection(\"floating_button\");\n }\n );\n\n return editToolbar;\n }\n\n #getLastPoint(boxes, isLTR) {\n let lastY = 0;\n let lastX = 0;\n for (const box of boxes) {\n const y = box.y + box.height;\n if (y < lastY) {\n continue;\n }\n const x = box.x + (isLTR ? box.width : 0);\n if (y > lastY) {\n lastX = x;\n lastY = y;\n continue;\n }\n if (isLTR) {\n if (x > lastX) {\n lastX = x;\n }\n } else if (x < lastX) {\n lastX = x;\n }\n }\n return [isLTR ? 1 - lastX : lastX, lastY];\n }\n\n show(parent, boxes, isLTR) {\n const [x, y] = this.#getLastPoint(boxes, isLTR);\n const { style } = (this.#toolbar ||= this.#render());\n parent.append(this.#toolbar);\n style.insetInlineEnd = `${100 * x}%`;\n style.top = `calc(${100 * y}% + var(--editor-toolbar-vert-offset))`;\n }\n\n hide() {\n this.#toolbar.remove();\n }\n\n #makeButton(buttonClass, l10nId, labelL10nId, clickHandler) {\n const button = document.createElement(\"button\");\n button.classList.add(\"basic\", buttonClass);\n button.tabIndex = 0;\n button.setAttribute(\"data-l10n-id\", l10nId);\n const span = document.createElement(\"span\");\n button.append(span);\n span.className = \"visuallyHidden\";\n span.setAttribute(\"data-l10n-id\", labelL10nId);\n const signal = this.#uiManager._signal;\n if (signal instanceof AbortSignal && !signal.aborted) {\n button.addEventListener(\"contextmenu\", noContextMenu, { signal });\n button.addEventListener(\"click\", clickHandler, { signal });\n }\n this.#buttons.append(button);\n }\n}\n\nexport { EditorToolbar, FloatingToolbar };\n","/* Copyright 2026 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Keep this file in sync with `web/internal_evt.js`.\n */\n\nconst INTERNAL_EVT =\n typeof PDFJSDev !== \"undefined\" && !PDFJSDev.test(\"TESTING\")\n ? PDFJSDev.eval(\"INTERNAL_EVT\")\n : \"internalEvent\";\n\nconst internalOpt = Object.freeze({ internal: INTERNAL_EVT });\n\nexport { INTERNAL_EVT, internalOpt };\n","/* Copyright 2022 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/** @typedef {import(\"./editor.js\").AnnotationEditor} AnnotationEditor */\n// eslint-disable-next-line max-len\n/** @typedef {import(\"./annotation_editor_layer.js\").AnnotationEditorLayer} AnnotationEditorLayer */\n\nimport {\n AnnotationEditorParamsType,\n AnnotationEditorPrefix,\n AnnotationEditorType,\n FeatureTest,\n getUuid,\n makeArr,\n shadow,\n SVG_NS,\n Util,\n warn,\n} from \"../../shared/util.js\";\nimport {\n fetchData,\n getColorValues,\n getRGB,\n PixelsPerInch,\n stopEvent,\n} from \"../display_utils.js\";\nimport { FloatingToolbar } from \"./toolbar.js\";\nimport { internalOpt } from \"../../shared/internal_evt.js\";\n\nfunction bindEvents(obj, element, names) {\n for (const name of names) {\n element.addEventListener(name, obj[name].bind(obj));\n }\n}\n\n/**\n * Class to store current pointers used by the editor to be able to handle\n * multiple pointers (e.g. two fingers, a pen, a mouse, ...).\n */\nclass CurrentPointers {\n // To manage the pointer events.\n\n // The pointerId and pointerIds are used to keep track of\n // the pointers with a same type (e.g. two fingers).\n static #pointerId = NaN;\n\n static #pointerIds = null;\n\n // Track the timestamp to know if the touchmove event is used.\n static #moveTimestamp = NaN;\n\n // The pointerType is used to know if we are using a mouse, a pen or a touch.\n static #pointerType = null;\n\n static initializeAndAddPointerId(pointerId) {\n // Store pointer ids. For example, the user is using a second finger.\n (CurrentPointers.#pointerIds ||= new Set()).add(pointerId);\n }\n\n static setPointer(pointerType, pointerId) {\n CurrentPointers.#pointerId ||= pointerId;\n CurrentPointers.#pointerType ??= pointerType;\n }\n\n static setTimeStamp(timeStamp) {\n CurrentPointers.#moveTimestamp = timeStamp;\n }\n\n static isSamePointerId(pointerId) {\n return CurrentPointers.#pointerId === pointerId;\n }\n\n // Check if it's the same pointer id, otherwise remove it from the set.\n static isSamePointerIdOrRemove(pointerId) {\n if (CurrentPointers.#pointerId === pointerId) {\n return true;\n }\n\n CurrentPointers.#pointerIds?.delete(pointerId);\n return false;\n }\n\n static isSamePointerType(pointerType) {\n return CurrentPointers.#pointerType === pointerType;\n }\n\n static isInitializedAndDifferentPointerType(pointerType) {\n return (\n CurrentPointers.#pointerType !== null &&\n !CurrentPointers.isSamePointerType(pointerType)\n );\n }\n\n static isSameTimeStamp(timeStamp) {\n return CurrentPointers.#moveTimestamp === timeStamp;\n }\n\n static isUsingMultiplePointers() {\n // Check if the user is using multiple fingers\n return CurrentPointers.#pointerIds?.size >= 1;\n }\n\n static clearPointerType() {\n CurrentPointers.#pointerType = null;\n }\n\n static clearPointerIds() {\n CurrentPointers.#pointerId = NaN;\n CurrentPointers.#pointerIds = null;\n }\n\n static clearTimeStamp() {\n CurrentPointers.#moveTimestamp = NaN;\n }\n}\n\n/**\n * Class to create some unique ids for the different editors.\n */\nclass IdManager {\n #id = 0;\n\n constructor() {\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"TESTING\")) {\n Object.defineProperty(this, \"getNextId\", {\n value: () => this.#id,\n });\n }\n }\n\n /**\n * Get a unique id.\n * @returns {string}\n */\n get id() {\n return `${AnnotationEditorPrefix}${this.#id++}`;\n }\n}\n\n/**\n * Class to manage the images used by the editors.\n * The main idea is to try to minimize the memory used by the images.\n * The images are cached and reused when possible\n * We use a refCounter to know when an image is not used anymore but we need to\n * be able to restore an image after a remove+undo, so we keep a file reference\n * or an url one.\n */\nclass ImageManager {\n #baseId = getUuid();\n\n #id = 0;\n\n #cache = null;\n\n static get _isSVGFittingCanvas() {\n // By default, Firefox doesn't rescale without preserving the aspect ratio\n // when drawing an SVG image on a canvas, see https://bugzilla.mozilla.org/1547776.\n // The \"workaround\" is to append \"svgView(preserveAspectRatio(none))\" to the\n // url, but according to comment #15, it seems that it leads to unexpected\n // behavior in Safari.\n const svg = `data:image/svg+xml;charset=UTF-8,`;\n const canvas = new OffscreenCanvas(1, 3);\n const ctx = canvas.getContext(\"2d\", { willReadFrequently: true });\n const image = new Image();\n image.src = svg;\n const promise = image.decode().then(() => {\n ctx.drawImage(image, 0, 0, 1, 1, 0, 0, 1, 3);\n return new Uint32Array(ctx.getImageData(0, 0, 1, 1).data.buffer)[0] === 0;\n });\n\n return shadow(this, \"_isSVGFittingCanvas\", promise);\n }\n\n async #get(key, rawData) {\n this.#cache ||= new Map();\n let data = this.#cache.get(key);\n if (data === null) {\n // We already tried to load the image but it failed.\n return null;\n }\n if (data?.bitmap) {\n data.refCounter += 1;\n return data;\n }\n try {\n data ||= {\n bitmap: null,\n id: `image_${this.#baseId}_${this.#id++}`,\n refCounter: 0,\n isSvg: false,\n };\n let image;\n if (typeof rawData === \"string\") {\n data.url = rawData;\n image = await fetchData(rawData, \"blob\");\n } else if (rawData instanceof File) {\n image = data.file = rawData;\n } else if (rawData instanceof Blob) {\n image = rawData;\n }\n\n if (image.type === \"image/svg+xml\") {\n // Unfortunately, createImageBitmap doesn't work with SVG images.\n // (see https://bugzilla.mozilla.org/1841972).\n const mustRemoveAspectRatioPromise = ImageManager._isSVGFittingCanvas;\n const fileReader = new FileReader();\n const imageElement = new Image();\n const imagePromise = new Promise((resolve, reject) => {\n imageElement.onload = () => {\n data.bitmap = imageElement;\n data.isSvg = true;\n resolve();\n };\n fileReader.onload = async () => {\n const url = (data.svgUrl = fileReader.result);\n // We need to set the preserveAspectRatio to none in order to let\n // the image fits the canvas when resizing.\n imageElement.src = (await mustRemoveAspectRatioPromise)\n ? `${url}#svgView(preserveAspectRatio(none))`\n : url;\n };\n imageElement.onerror = fileReader.onerror = reject;\n });\n fileReader.readAsDataURL(image);\n await imagePromise;\n } else {\n data.bitmap = await createImageBitmap(image);\n }\n data.refCounter = 1;\n } catch (e) {\n warn(e);\n data = null;\n }\n this.#cache.set(key, data);\n if (data) {\n this.#cache.set(data.id, data);\n }\n return data;\n }\n\n async getFromFile(file) {\n const { lastModified, name, size, type } = file;\n return this.#get(`${lastModified}_${name}_${size}_${type}`, file);\n }\n\n async getFromUrl(url) {\n return this.#get(url, url);\n }\n\n async getFromBlob(id, blobPromise) {\n const blob = await blobPromise;\n return this.#get(id, blob);\n }\n\n async getFromId(id) {\n this.#cache ||= new Map();\n const data = this.#cache.get(id);\n if (!data) {\n return null;\n }\n if (data.bitmap) {\n data.refCounter += 1;\n return data;\n }\n\n if (data.file) {\n return this.getFromFile(data.file);\n }\n if (data.blobPromise) {\n const { blobPromise } = data;\n delete data.blobPromise;\n return this.getFromBlob(data.id, blobPromise);\n }\n return this.getFromUrl(data.url);\n }\n\n getFromCanvas(id, canvas) {\n this.#cache ||= new Map();\n let data = this.#cache.get(id);\n if (data?.bitmap) {\n data.refCounter += 1;\n return data;\n }\n const offscreen = new OffscreenCanvas(canvas.width, canvas.height);\n const ctx = offscreen.getContext(\"2d\");\n ctx.drawImage(canvas, 0, 0);\n data = {\n bitmap: offscreen.transferToImageBitmap(),\n id: `image_${this.#baseId}_${this.#id++}`,\n refCounter: 1,\n isSvg: false,\n };\n this.#cache.set(id, data);\n this.#cache.set(data.id, data);\n return data;\n }\n\n getSvgUrl(id) {\n const data = this.#cache.get(id);\n return !data?.isSvg ? null : data.svgUrl;\n }\n\n deleteId(id) {\n this.#cache ||= new Map();\n const data = this.#cache.get(id);\n if (!data) {\n return;\n }\n data.refCounter -= 1;\n if (data.refCounter !== 0) {\n return;\n }\n const { bitmap } = data;\n if (!data.url && !data.file) {\n // The image has no way to be restored (ctrl+z) so we must fix that.\n const canvas = new OffscreenCanvas(bitmap.width, bitmap.height);\n const ctx = canvas.getContext(\"bitmaprenderer\");\n ctx.transferFromImageBitmap(bitmap);\n data.blobPromise = canvas.convertToBlob();\n }\n\n bitmap.close?.();\n data.bitmap = null;\n }\n\n // We can use the id only if it belongs this manager.\n // We must take care of having the right manager because we can copy/paste\n // some images from other documents, hence it'd be a pity to use an id from an\n // other manager.\n isValidId(id) {\n return id.startsWith(`image_${this.#baseId}_`);\n }\n}\n\n/**\n * Class to handle undo/redo.\n * Commands are just saved in a buffer.\n * If we hit some memory issues we could likely use a circular buffer.\n * It has to be used as a singleton.\n */\nclass CommandManager {\n #commands = [];\n\n #locked = false;\n\n #maxSize;\n\n #position = -1;\n\n constructor(maxSize = 128) {\n this.#maxSize = maxSize;\n }\n\n /**\n * @typedef {object} addOptions\n * @property {Function} cmd\n * @property {Function} undo\n * @property {Function} [post]\n * @property {boolean} mustExec\n * @property {number} type\n * @property {boolean} overwriteIfSameType\n * @property {boolean} keepUndo\n */\n\n /**\n * Add a new couple of commands to be used in case of redo/undo.\n * @param {addOptions} options\n */\n add({\n cmd,\n undo,\n post,\n mustExec,\n type = NaN,\n overwriteIfSameType = false,\n keepUndo = false,\n }) {\n if (mustExec) {\n cmd();\n }\n\n if (this.#locked) {\n return;\n }\n\n const save = { cmd, undo, post, type };\n if (this.#position === -1) {\n if (this.#commands.length > 0) {\n // All the commands have been undone and then a new one is added\n // hence we clear the queue.\n this.#commands.length = 0;\n }\n this.#position = 0;\n this.#commands.push(save);\n return;\n }\n\n if (overwriteIfSameType && this.#commands[this.#position].type === type) {\n // For example when we change a color we don't want to\n // be able to undo all the steps, hence we only want to\n // keep the last undoable action in this sequence of actions.\n if (keepUndo) {\n save.undo = this.#commands[this.#position].undo;\n }\n this.#commands[this.#position] = save;\n return;\n }\n\n const next = this.#position + 1;\n if (next === this.#maxSize) {\n this.#commands.splice(0, 1);\n } else {\n this.#position = next;\n if (next < this.#commands.length) {\n this.#commands.splice(next);\n }\n }\n\n this.#commands.push(save);\n }\n\n /**\n * Undo the last command.\n */\n undo() {\n if (this.#position === -1) {\n // Nothing to undo.\n return;\n }\n\n // Avoid to insert something during the undo execution.\n this.#locked = true;\n const { undo, post } = this.#commands[this.#position];\n undo();\n post?.();\n this.#locked = false;\n\n this.#position -= 1;\n }\n\n /**\n * Redo the last command.\n */\n redo() {\n if (this.#position < this.#commands.length - 1) {\n this.#position += 1;\n\n // Avoid to insert something during the redo execution.\n this.#locked = true;\n const { cmd, post } = this.#commands[this.#position];\n cmd();\n post?.();\n this.#locked = false;\n }\n }\n\n /**\n * Check if there is something to undo.\n * @returns {boolean}\n */\n hasSomethingToUndo() {\n return this.#position !== -1;\n }\n\n /**\n * Check if there is something to redo.\n * @returns {boolean}\n */\n hasSomethingToRedo() {\n return this.#position < this.#commands.length - 1;\n }\n\n cleanType(type) {\n if (this.#position === -1) {\n return;\n }\n for (let i = this.#position; i >= 0; i--) {\n if (this.#commands[i].type !== type) {\n this.#commands.splice(i + 1, this.#position - i);\n this.#position = i;\n return;\n }\n }\n this.#commands.length = 0;\n this.#position = -1;\n }\n\n destroy() {\n this.#commands = null;\n }\n}\n\n/**\n * Class to handle the different keyboards shortcuts we can have on mac or\n * non-mac OSes.\n */\nclass KeyboardManager {\n static ALT = 0x1;\n\n static CTRL = 0x2;\n\n static META = 0x4;\n\n static SHIFT = 0x8;\n\n /**\n * Create a new keyboard manager class.\n * @param {Array} callbacks - an array containing an array of shortcuts\n * and a callback to call. If the array contains no `mac+`-prefixed entry,\n * every shortcut applies on all platforms. As soon as it contains at least\n * one `mac+` entry, the `mac+` ones become the macOS-only set and the bare\n * entries apply only on non-Mac.\n */\n constructor(callbacks) {\n this.callbacks = new Map();\n\n const { isMac } = FeatureTest.platform;\n for (const [keys, callback, options = {}] of callbacks) {\n const hasMacOverride = keys.some(k => k.startsWith(\"mac+\"));\n for (const key of keys) {\n let shortcut = key;\n if (hasMacOverride) {\n const isMacKey = key.startsWith(\"mac+\");\n if (isMac !== isMacKey) {\n continue;\n }\n if (isMacKey) {\n shortcut = key.slice(4);\n }\n }\n const [keyName, modifiers] = KeyboardManager.#parseShortcut(shortcut);\n if (keyName === null) {\n continue;\n }\n this.callbacks\n .getOrInsertComputed(keyName, makeArr)\n .push({ callback, options, modifiers });\n }\n }\n }\n\n /**\n * Parse a shortcut string like \"ctrl+shift+a\" into a `[key, modifiers]`\n * pair. Modifier names are case-insensitive and may appear in any order;\n * the key part is matched against `event.key` so `Space` is normalized to\n * `\" \"` but other names like `ArrowLeft`, `Enter`, `Backspace`, and\n * single-letter keys (`a`, `Z`) are preserved.\n * @param {string} value\n * @returns {[string|null, number]}\n */\n static #parseShortcut(value) {\n let keyPart = null;\n let modifiers = 0;\n for (let part of value.split(\"+\")) {\n part = part.trim();\n if (!part) {\n continue;\n }\n const upper = part.toUpperCase();\n const modifier = KeyboardManager[upper];\n if (modifier) {\n modifiers |= modifier;\n continue;\n }\n if (keyPart !== null) {\n warn(`KeyboardManager: multiple keys in shortcut \"${value}\"`);\n break;\n }\n keyPart = upper === \"SPACE\" ? \" \" : part;\n }\n if (keyPart === null) {\n warn(`KeyboardManager: no key found in shortcut \"${value}\"`);\n }\n return [keyPart, modifiers];\n }\n\n /**\n * Translate `event.code` (a layout-independent physical key identifier) to\n * the equivalent `event.key` value on a US layout, so a Ctrl+A shortcut\n * still fires when the user is on a layout where the \"A\" key produces a\n * non-Latin character.\n * @param {string} code\n * @returns {string|null}\n */\n static #codeToKey(code) {\n // KeyA..KeyZ -> a..z, Digit0..Digit9 / Numpad0..Numpad9 -> 0..9.\n // Codes like NumpadEnter are intentionally skipped — their event.key\n // already matches the corresponding non-numpad key.\n const match = /^(?:Key([A-Z])|(?:Digit|Numpad)(\\d))$/.exec(code);\n return !match ? null : (match[1]?.toLowerCase() ?? match[2]);\n }\n\n /**\n * Execute a callback, if any, for a given keyboard event.\n * The self is used as `this` in the callback.\n * @param {object} self\n * @param {KeyboardEvent} event\n */\n exec(self, event) {\n let shortcuts = this.callbacks.get(event.key);\n if (!shortcuts) {\n // Layout-independent fallback: on a Cyrillic layout the physical \"A\"\n // key reports event.key=\"ф\" but event.code=\"KeyA\". This must be skipped\n // when event.key is already a Latin letter, otherwise on AZERTY (where\n // the \"A\" key has event.key=\"a\" but event.code=\"KeyQ\") ctrl+A would\n // wrongly trigger ctrl+Q.\n if (/^[a-z]$/i.test(event.key)) {\n return;\n }\n const fallback = KeyboardManager.#codeToKey(event.code);\n if (fallback === null || fallback === event.key) {\n return;\n }\n shortcuts = this.callbacks.get(fallback);\n if (!shortcuts) {\n return;\n }\n }\n\n const eventModifiers =\n (event.altKey ? KeyboardManager.ALT : 0) |\n (event.ctrlKey ? KeyboardManager.CTRL : 0) |\n (event.metaKey ? KeyboardManager.META : 0) |\n (event.shiftKey ? KeyboardManager.SHIFT : 0);\n const info = shortcuts.find(\n shortcut => shortcut.modifiers === eventModifiers\n );\n if (!info) {\n return;\n }\n\n const {\n callback,\n options: { bubbles = false, args = [], checker = null },\n } = info;\n\n if (checker && !checker(self, event)) {\n return;\n }\n callback.bind(self, ...args, event)();\n\n // For example, ctrl+s in a FreeText must be handled by the viewer, hence\n // the event must bubble.\n if (!bubbles) {\n stopEvent(event);\n }\n }\n}\n\nclass ColorManager {\n static _colorsMapping = new Map([\n [\"CanvasText\", [0, 0, 0]],\n [\"Canvas\", [255, 255, 255]],\n ]);\n\n get _colors() {\n if (\n typeof PDFJSDev !== \"undefined\" &&\n PDFJSDev.test(\"LIB\") &&\n typeof document === \"undefined\"\n ) {\n return shadow(this, \"_colors\", ColorManager._colorsMapping);\n }\n\n const colors = new Map([\n [\"CanvasText\", null],\n [\"Canvas\", null],\n ]);\n getColorValues(colors);\n return shadow(this, \"_colors\", colors);\n }\n\n /**\n * In High Contrast Mode, the color on the screen is not always the\n * real color used in the pdf.\n * For example in some cases white can appear to be black but when saving\n * we want to have white.\n * @param {string} color\n * @returns {Array}\n */\n convert(color) {\n const rgb = getRGB(color);\n if (!window.matchMedia(\"(forced-colors: active)\").matches) {\n return rgb;\n }\n\n for (const [name, RGB] of this._colors) {\n if (RGB.every((x, i) => x === rgb[i])) {\n return ColorManager._colorsMapping.get(name);\n }\n }\n return rgb;\n }\n\n /**\n * An input element must have its color value as a hex string\n * and not as color name.\n * So this function converts a name into an hex string.\n * @param {string} name\n * @returns {string}\n */\n getHexCode(name) {\n const rgb = this._colors.get(name);\n return !rgb ? name : Util.makeHexColor(...rgb);\n }\n}\n\n/**\n * A pdf has several pages and each of them when it will rendered\n * will have an AnnotationEditorLayer which will contain the some\n * new Annotations associated to an editor in order to modify them.\n *\n * This class is used to manage all the different layers, editors and\n * some action like copy/paste, undo/redo, ...\n */\nclass AnnotationEditorUIManager {\n #abortController = new AbortController();\n\n #activeEditor = null;\n\n #allEditableAnnotations = null;\n\n #allEditors = new Map();\n\n #allLayers = new Map();\n\n #savedAllLayers = null;\n\n #savedEditorsByPage = null;\n\n #altTextManager = null;\n\n #annotationStorage = null;\n\n #changedExistingAnnotations = null;\n\n #commandManager = new CommandManager();\n\n #commentManager = null;\n\n #copyPasteAC = null;\n\n #currentDrawingSession = null;\n\n #currentPageIndex = 0;\n\n #deletedAnnotationsElementIds = new Set();\n\n #draggingEditors = null;\n\n #editorTypes = null;\n\n #editorsToRescale = new Set();\n\n _editorUndoBar = null;\n\n #enableHighlightFloatingButton = false;\n\n #enableUpdatedAddImage = false;\n\n #enableNewAltTextWhenAddingImage = false;\n\n #filterFactory = null;\n\n #focusMainContainerTimeoutId = null;\n\n #focusManagerAC = null;\n\n #highlightColors = null;\n\n #highlightWhenShiftUp = false;\n\n #floatingToolbar = null;\n\n #idManager = new IdManager();\n\n #isEnabled = false;\n\n #isPointerDown = false;\n\n #isWaiting = false;\n\n #keyboardManagerAC = null;\n\n #lastActiveElement = null;\n\n #mainHighlightColorPicker = null;\n\n #missingCanvases = null;\n\n #mlManager = null;\n\n #mode = AnnotationEditorType.NONE;\n\n #selectedEditors = new Set();\n\n #selectedTextNode = null;\n\n #signatureManager = null;\n\n #pageColors = null;\n\n #showAllStates = null;\n\n #pdfDocument = null;\n\n #previousStates = {\n isEditing: false,\n isEmpty: true,\n hasSomethingToUndo: false,\n hasSomethingToRedo: false,\n hasSelectedEditor: false,\n hasSelectedText: false,\n };\n\n #translation = [0, 0];\n\n #translationTimeoutId = null;\n\n #container = null;\n\n #viewer = null;\n\n #viewerAlert = null;\n\n #updateModeCapability = null;\n\n static TRANSLATE_SMALL = 1; // page units.\n\n static TRANSLATE_BIG = 10; // page units.\n\n static get _keyboardManager() {\n const proto = AnnotationEditorUIManager.prototype;\n\n /**\n * If the focused element is an input, we don't want to handle the arrow.\n * For example, sliders can be controlled with the arrow keys.\n */\n const arrowChecker = self =>\n self.#container.contains(document.activeElement) &&\n document.activeElement.tagName !== \"BUTTON\" &&\n self.hasSomethingToControl();\n\n const textInputChecker = (_self, { target: el }) => {\n if (el instanceof HTMLInputElement) {\n const { type } = el;\n return type !== \"text\" && type !== \"number\";\n }\n return true;\n };\n\n const small = this.TRANSLATE_SMALL;\n const big = this.TRANSLATE_BIG;\n\n return shadow(\n this,\n \"_keyboardManager\",\n new KeyboardManager([\n [\n [\"ctrl+a\", \"mac+meta+a\"],\n proto.selectAll,\n { checker: textInputChecker },\n ],\n [[\"ctrl+z\", \"mac+meta+z\"], proto.undo, { checker: textInputChecker }],\n [\n // On mac, depending of the OS version, the event.key is either \"z\" or\n // \"Z\" when the user presses \"meta+shift+z\".\n [\n \"ctrl+y\",\n \"ctrl+shift+z\",\n \"mac+meta+shift+z\",\n \"ctrl+shift+Z\",\n \"mac+meta+shift+Z\",\n ],\n proto.redo,\n { checker: textInputChecker },\n ],\n [\n [\n \"Backspace\",\n \"alt+Backspace\",\n \"ctrl+Backspace\",\n \"shift+Backspace\",\n \"mac+Backspace\",\n \"mac+alt+Backspace\",\n \"mac+ctrl+Backspace\",\n \"Delete\",\n \"ctrl+Delete\",\n \"shift+Delete\",\n \"mac+Delete\",\n ],\n proto.delete,\n { checker: textInputChecker },\n ],\n [\n [\"Enter\"],\n proto.addNewEditorFromKeyboard,\n {\n // Those shortcuts can be used in the toolbar for some other actions\n // like zooming, hence we need to check if the container has the\n // focus.\n checker: (self, { target: el }) =>\n !(el instanceof HTMLButtonElement) &&\n self.#container.contains(el) &&\n !self.isEnterHandled,\n },\n ],\n [\n [\"Space\"],\n proto.addNewEditorFromKeyboard,\n {\n // Those shortcuts can be used in the toolbar for some other actions\n // like zooming, hence we need to check if the container has the\n // focus.\n checker: (self, { target: el }) =>\n !(el instanceof HTMLButtonElement) &&\n self.#container.contains(document.activeElement),\n },\n ],\n [[\"Escape\"], proto.unselectAll],\n [\n [\"ArrowLeft\"],\n proto.translateSelectedEditors,\n { args: [-small, 0], checker: arrowChecker },\n ],\n [\n [\"ctrl+ArrowLeft\", \"mac+shift+ArrowLeft\"],\n proto.translateSelectedEditors,\n { args: [-big, 0], checker: arrowChecker },\n ],\n [\n [\"ArrowRight\"],\n proto.translateSelectedEditors,\n { args: [small, 0], checker: arrowChecker },\n ],\n [\n [\"ctrl+ArrowRight\", \"mac+shift+ArrowRight\"],\n proto.translateSelectedEditors,\n { args: [big, 0], checker: arrowChecker },\n ],\n [\n [\"ArrowUp\"],\n proto.translateSelectedEditors,\n { args: [0, -small], checker: arrowChecker },\n ],\n [\n [\"ctrl+ArrowUp\", \"mac+shift+ArrowUp\"],\n proto.translateSelectedEditors,\n { args: [0, -big], checker: arrowChecker },\n ],\n [\n [\"ArrowDown\"],\n proto.translateSelectedEditors,\n { args: [0, small], checker: arrowChecker },\n ],\n [\n [\"ctrl+ArrowDown\", \"mac+shift+ArrowDown\"],\n proto.translateSelectedEditors,\n { args: [0, big], checker: arrowChecker },\n ],\n ])\n );\n }\n\n constructor(\n container,\n viewer,\n viewerAlert,\n altTextManager,\n commentManager,\n signatureManager,\n eventBus,\n pdfDocument,\n pageColors,\n highlightColors,\n enableHighlightFloatingButton,\n enableUpdatedAddImage,\n enableNewAltTextWhenAddingImage,\n mlManager,\n editorUndoBar,\n supportsPinchToZoom\n ) {\n const signal = (this._signal = this.#abortController.signal);\n this.#container = container;\n this.#viewer = viewer;\n this.#viewerAlert = viewerAlert;\n this.#altTextManager = altTextManager;\n this.#commentManager = commentManager;\n this.#signatureManager = signatureManager;\n this.#pdfDocument = pdfDocument;\n this._eventBus = eventBus;\n\n const evtOpts = { signal, ...internalOpt };\n eventBus.on(\"editingaction\", this.onEditingAction.bind(this), evtOpts);\n eventBus.on(\"pagechanging\", this.onPageChanging.bind(this), evtOpts);\n eventBus.on(\"scalechanging\", this.onScaleChanging.bind(this), evtOpts);\n eventBus.on(\n \"rotationchanging\",\n this.onRotationChanging.bind(this),\n evtOpts\n );\n eventBus.on(\"setpreference\", this.onSetPreference.bind(this), evtOpts);\n eventBus.on(\n \"switchannotationeditorparams\",\n evt => this.updateParams(evt.type, evt.value),\n evtOpts\n );\n window.addEventListener(\n \"pointerdown\",\n () => {\n this.#isPointerDown = true;\n },\n { capture: true, signal }\n );\n window.addEventListener(\n \"pointerup\",\n () => {\n this.#isPointerDown = false;\n },\n { capture: true, signal }\n );\n window.addEventListener(\"beforeunload\", this.endCurrentEditing.bind(this), {\n capture: true,\n signal,\n });\n this.#addSelectionListener();\n this.#addDragAndDropListeners();\n this.#addKeyboardManager();\n this.#annotationStorage = pdfDocument.annotationStorage;\n this.#filterFactory = pdfDocument.filterFactory;\n this.#pageColors = pageColors;\n this.#highlightColors = highlightColors || null;\n this.#enableHighlightFloatingButton = enableHighlightFloatingButton;\n this.#enableUpdatedAddImage = enableUpdatedAddImage;\n this.#enableNewAltTextWhenAddingImage = enableNewAltTextWhenAddingImage;\n this.#mlManager = mlManager || null;\n this.viewParameters = {\n realScale: PixelsPerInch.PDF_TO_CSS_UNITS,\n rotation: 0,\n };\n this.isShiftKeyDown = false;\n this._editorUndoBar = editorUndoBar || null;\n this._supportsPinchToZoom = supportsPinchToZoom !== false;\n commentManager?.setSidebarUiManager(this);\n\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"TESTING\")) {\n Object.defineProperty(this, \"getNextEditorId\", {\n value: () => this.#idManager.getNextId(),\n });\n }\n }\n\n destroy() {\n this.#updateModeCapability?.resolve();\n this.#updateModeCapability = null;\n\n this.#abortController?.abort();\n this.#abortController = null;\n this._signal = null;\n\n for (const layer of this.#allLayers.values()) {\n layer.destroy();\n }\n this.#allLayers.clear();\n this.#allEditors.clear();\n this.#editorsToRescale.clear();\n this.#missingCanvases?.clear();\n this.#activeEditor = null;\n this.#selectedEditors.clear();\n this.#commandManager.destroy();\n this.#altTextManager?.destroy();\n this.#commentManager?.destroy();\n this.#signatureManager?.destroy();\n this.#floatingToolbar?.hide();\n this.#floatingToolbar = null;\n this.#mainHighlightColorPicker?.destroy();\n this.#mainHighlightColorPicker = null;\n this.#allEditableAnnotations = null;\n if (this.#focusMainContainerTimeoutId) {\n clearTimeout(this.#focusMainContainerTimeoutId);\n this.#focusMainContainerTimeoutId = null;\n }\n if (this.#translationTimeoutId) {\n clearTimeout(this.#translationTimeoutId);\n this.#translationTimeoutId = null;\n }\n this._editorUndoBar?.destroy();\n this.#pdfDocument = null;\n }\n\n combinedSignal(ac) {\n return AbortSignal.any([this._signal, ac.signal]);\n }\n\n get mlManager() {\n return this.#mlManager;\n }\n\n get useNewAltTextFlow() {\n return this.#enableUpdatedAddImage;\n }\n\n get useNewAltTextWhenAddingImage() {\n return this.#enableNewAltTextWhenAddingImage;\n }\n\n get hcmFilter() {\n return shadow(\n this,\n \"hcmFilter\",\n this.#pageColors\n ? this.#filterFactory.addHCMFilter(\n this.#pageColors.foreground,\n this.#pageColors.background\n )\n : \"none\"\n );\n }\n\n get direction() {\n return shadow(\n this,\n \"direction\",\n getComputedStyle(this.#container).direction\n );\n }\n\n get _highlightColors() {\n return shadow(\n this,\n \"_highlightColors\",\n this.#highlightColors\n ? new Map(\n this.#highlightColors.split(\",\").map(pair => {\n pair = pair.split(\"=\").map(x => x.trim());\n pair[1] = pair[1].toUpperCase();\n return pair;\n })\n )\n : null\n );\n }\n\n get highlightColors() {\n const { _highlightColors } = this;\n if (!_highlightColors) {\n return shadow(this, \"highlightColors\", null);\n }\n const map = new Map();\n const hasHCM = !!this.#pageColors;\n for (const [name, color] of _highlightColors) {\n const isNameForHCM = name.endsWith(\"_HCM\");\n if (hasHCM && isNameForHCM) {\n map.set(name.replace(\"_HCM\", \"\"), color);\n continue;\n }\n if (!hasHCM && !isNameForHCM) {\n map.set(name, color);\n }\n }\n return shadow(this, \"highlightColors\", map);\n }\n\n get highlightColorNames() {\n return shadow(\n this,\n \"highlightColorNames\",\n this.highlightColors\n ? new Map(Array.from(this.highlightColors, e => e.reverse()))\n : null\n );\n }\n\n getNonHCMColor(color) {\n if (!this._highlightColors) {\n return color;\n }\n const colorName = this.highlightColorNames.get(color);\n return this._highlightColors.get(colorName) || color;\n }\n\n getNonHCMColorName(color) {\n return this.highlightColorNames.get(color) || color;\n }\n\n /**\n * Set the current drawing session.\n * @param {AnnotationEditorLayer} layer\n */\n setCurrentDrawingSession(layer) {\n if (layer) {\n this.unselectAll();\n this.disableUserSelect(true);\n } else {\n this.disableUserSelect(false);\n }\n this.#currentDrawingSession = layer;\n }\n\n setMainHighlightColorPicker(colorPicker) {\n this.#mainHighlightColorPicker = colorPicker;\n }\n\n editAltText(editor, firstTime = false) {\n this.#altTextManager?.editAltText(this, editor, firstTime);\n }\n\n hasCommentManager() {\n return !!this.#commentManager;\n }\n\n editComment(editor, posX, posY, options) {\n this.#commentManager?.showDialog(this, editor, posX, posY, options);\n }\n\n selectComment(pageIndex, uid) {\n const layer = this.#allLayers.get(pageIndex);\n const editor = layer?.getEditorByUID(uid);\n editor?.toggleComment(/* isSelected */ true, /* visibility */ true);\n }\n\n updateComment(editor) {\n this.#commentManager?.updateComment(editor.getData());\n }\n\n updatePopupColor(editor) {\n this.#commentManager?.updatePopupColor(editor);\n }\n\n removeComment(editor) {\n this.#commentManager?.removeComments([editor.uid]);\n }\n\n /**\n * Delete a comment from an editor with undo support.\n * @param {AnnotationEditor} editor - The editor whose comment to delete.\n * @param {object} savedData - The comment data to save for undo.\n */\n deleteComment(editor, savedData) {\n const undo = () => {\n editor.comment = savedData;\n };\n const cmd = () => {\n this._editorUndoBar?.show(undo, \"comment\");\n this.toggleComment(/* editor = */ null);\n editor.comment = null;\n };\n this.addCommands({ cmd, undo, mustExec: true });\n }\n\n toggleComment(editor, isSelected, visibility = undefined) {\n this.#commentManager?.toggleCommentPopup(editor, isSelected, visibility);\n }\n\n makeCommentColor(color, opacity) {\n return (\n (color && this.#commentManager?.makeCommentColor(color, opacity)) || null\n );\n }\n\n getCommentDialogElement() {\n return this.#commentManager?.dialogElement || null;\n }\n\n async waitForEditorsRendered(pageNumber) {\n if (this.#allLayers.has(pageNumber - 1)) {\n return;\n }\n const { resolve, promise } = Promise.withResolvers();\n const onEditorsRendered = evt => {\n if (evt.pageNumber === pageNumber) {\n this._eventBus.off(\"editorsrendered\", onEditorsRendered);\n resolve();\n }\n };\n this._eventBus.on(\"editorsrendered\", onEditorsRendered, internalOpt);\n await promise;\n }\n\n getSignature(editor) {\n this.#signatureManager?.getSignature({ uiManager: this, editor });\n }\n\n get signatureManager() {\n return this.#signatureManager;\n }\n\n switchToMode(mode, callback) {\n // Switching to a mode can be asynchronous.\n this._eventBus.on(\"annotationeditormodechanged\", callback, {\n once: true,\n signal: this._signal,\n ...internalOpt,\n });\n this._eventBus.dispatch(\"showannotationeditorui\", {\n source: this,\n mode,\n });\n }\n\n setPreference(name, value) {\n this._eventBus.dispatch(\"setpreference\", {\n source: this,\n name,\n value,\n });\n }\n\n onSetPreference({ name, value }) {\n switch (name) {\n case \"enableNewAltTextWhenAddingImage\":\n this.#enableNewAltTextWhenAddingImage = value;\n break;\n }\n }\n\n onPageChanging({ pageNumber }) {\n this.#currentPageIndex = pageNumber - 1;\n }\n\n deletePage(id) {\n for (const editor of this.getEditors(id)) {\n editor.remove();\n }\n this.#allLayers.delete(id);\n if (this.#currentPageIndex === id) {\n this.#currentPageIndex = 0;\n }\n }\n\n focusMainContainer() {\n this.#container.focus();\n }\n\n findParent(x, y) {\n for (const layer of this.#allLayers.values()) {\n const {\n x: layerX,\n y: layerY,\n width,\n height,\n } = layer.div.getBoundingClientRect();\n if (\n x >= layerX &&\n x <= layerX + width &&\n y >= layerY &&\n y <= layerY + height\n ) {\n return layer;\n }\n }\n return null;\n }\n\n disableUserSelect(value = false) {\n this.#viewer.classList.toggle(\"noUserSelect\", value);\n }\n\n addShouldRescale(editor) {\n this.#editorsToRescale.add(editor);\n }\n\n removeShouldRescale(editor) {\n this.#editorsToRescale.delete(editor);\n }\n\n onScaleChanging({ scale }) {\n this.commitOrRemove();\n this.viewParameters.realScale = scale * PixelsPerInch.PDF_TO_CSS_UNITS;\n for (const editor of this.#editorsToRescale) {\n editor.onScaleChanging();\n }\n this.#currentDrawingSession?.onScaleChanging();\n }\n\n onRotationChanging({ pagesRotation }) {\n this.commitOrRemove();\n this.viewParameters.rotation = pagesRotation;\n }\n\n #getAnchorElementForSelection({ anchorNode }) {\n return anchorNode.nodeType === Node.TEXT_NODE\n ? anchorNode.parentElement\n : anchorNode;\n }\n\n #getLayerForTextLayer(textLayer) {\n const { currentLayer } = this;\n if (currentLayer.hasTextLayer(textLayer)) {\n return currentLayer;\n }\n for (const layer of this.#allLayers.values()) {\n if (layer.hasTextLayer(textLayer)) {\n return layer;\n }\n }\n return null;\n }\n\n highlightSelection(methodOfCreation = \"\", comment = false) {\n const selection = document.getSelection();\n if (!selection || selection.isCollapsed) {\n return;\n }\n const { anchorNode, anchorOffset, focusNode, focusOffset } = selection;\n const text = selection.toString();\n const anchorElement = this.#getAnchorElementForSelection(selection);\n const textLayer = anchorElement.closest(\".textLayer\");\n const boxes = this.getSelectionBoxes(textLayer);\n if (!boxes) {\n return;\n }\n selection.empty();\n\n const layer = this.#getLayerForTextLayer(textLayer);\n const isNoneMode = this.#mode === AnnotationEditorType.NONE;\n const callback = () => {\n const editor = layer?.createAndAddNewEditor({ x: 0, y: 0 }, false, {\n methodOfCreation,\n boxes,\n anchorNode,\n anchorOffset,\n focusNode,\n focusOffset,\n text,\n });\n if (isNoneMode) {\n this.showAllEditors(\"highlight\", true, /* updateButton = */ true);\n }\n if (comment) {\n editor?.editComment();\n }\n };\n if (isNoneMode) {\n this.switchToMode(AnnotationEditorType.HIGHLIGHT, callback);\n return;\n }\n callback();\n }\n\n commentSelection(methodOfCreation = \"\") {\n this.highlightSelection(methodOfCreation, /* comment */ true);\n }\n\n endCurrentEditing() {\n this.commitOrRemove();\n this.currentLayer?.endDrawingSession(/* isAborted = */ false);\n }\n\n #displayFloatingToolbar() {\n const selection = document.getSelection();\n if (!selection || selection.isCollapsed) {\n return;\n }\n const anchorElement = this.#getAnchorElementForSelection(selection);\n const textLayer = anchorElement.closest(\".textLayer\");\n const boxes = this.getSelectionBoxes(textLayer);\n if (!boxes) {\n return;\n }\n this.#floatingToolbar ||= new FloatingToolbar(this);\n this.#floatingToolbar.show(textLayer, boxes, this.direction === \"ltr\");\n }\n\n /**\n * Some annotations may have been modified in the annotation layer\n * (e.g. comments added or modified).\n * So this function retrieves the data from the storage and removes\n * them from the storage in order to be able to save them later.\n * @param {string} annotationId\n * @returns {object | null} The data associated to the annotation or null.\n */\n getAndRemoveDataFromAnnotationStorage(annotationId) {\n if (!this.#annotationStorage) {\n return null;\n }\n const key = `${AnnotationEditorPrefix}${annotationId}`;\n const storedValue = this.#annotationStorage.getRawValue(key);\n if (storedValue) {\n this.#annotationStorage.remove(key);\n }\n return storedValue;\n }\n\n /**\n * Add an editor in the annotation storage.\n * @param {AnnotationEditor} editor\n */\n addToAnnotationStorage(editor) {\n if (\n !editor.isEmpty() &&\n this.#annotationStorage &&\n !this.#annotationStorage.has(editor.id)\n ) {\n this.#annotationStorage.setValue(editor.id, editor);\n }\n }\n\n a11yAlert(messageId, args = null) {\n const viewerAlert = this.#viewerAlert;\n if (!viewerAlert) {\n return;\n }\n viewerAlert.setAttribute(\"data-l10n-id\", messageId);\n if (args) {\n viewerAlert.setAttribute(\"data-l10n-args\", JSON.stringify(args));\n } else {\n viewerAlert.removeAttribute(\"data-l10n-args\");\n }\n }\n\n #selectionChange() {\n const selection = document.getSelection();\n if (!selection || selection.isCollapsed) {\n if (this.#selectedTextNode) {\n this.#floatingToolbar?.hide();\n this.#selectedTextNode = null;\n this.#dispatchUpdateStates({\n hasSelectedText: false,\n });\n }\n return;\n }\n const { anchorNode } = selection;\n if (anchorNode === this.#selectedTextNode) {\n return;\n }\n\n const anchorElement = this.#getAnchorElementForSelection(selection);\n const textLayer = anchorElement.closest(\".textLayer\");\n if (!textLayer) {\n if (this.#selectedTextNode) {\n this.#floatingToolbar?.hide();\n this.#selectedTextNode = null;\n this.#dispatchUpdateStates({\n hasSelectedText: false,\n });\n }\n return;\n }\n\n this.#floatingToolbar?.hide();\n this.#selectedTextNode = anchorNode;\n this.#dispatchUpdateStates({\n hasSelectedText: true,\n });\n\n if (\n this.#mode !== AnnotationEditorType.HIGHLIGHT &&\n this.#mode !== AnnotationEditorType.NONE\n ) {\n return;\n }\n\n if (this.#mode === AnnotationEditorType.HIGHLIGHT) {\n this.showAllEditors(\"highlight\", true, /* updateButton = */ true);\n }\n\n this.#highlightWhenShiftUp = this.isShiftKeyDown;\n if (!this.isShiftKeyDown) {\n const activeLayer =\n this.#mode === AnnotationEditorType.HIGHLIGHT\n ? this.#getLayerForTextLayer(textLayer)\n : null;\n activeLayer?.toggleDrawing();\n\n if (this.#isPointerDown) {\n const ac = new AbortController();\n const signal = this.combinedSignal(ac);\n\n const pointerup = e => {\n if (e.type === \"pointerup\" && e.button !== 0) {\n // Do nothing on right click.\n return;\n }\n ac.abort();\n activeLayer?.toggleDrawing(true);\n if (e.type === \"pointerup\") {\n this.#onSelectEnd(\"main_toolbar\");\n }\n };\n window.addEventListener(\"pointerup\", pointerup, { signal });\n window.addEventListener(\"blur\", pointerup, { signal });\n } else {\n // Here neither the shift key nor the pointer is down and we've\n // something in the selection: we can be in the case where the user is\n // using a screen reader (see bug 1976597).\n activeLayer?.toggleDrawing(true);\n this.#onSelectEnd(\"main_toolbar\");\n }\n }\n }\n\n #onSelectEnd(methodOfCreation = \"\") {\n if (this.#mode === AnnotationEditorType.HIGHLIGHT) {\n this.highlightSelection(methodOfCreation);\n } else if (this.#enableHighlightFloatingButton) {\n this.#displayFloatingToolbar();\n }\n }\n\n #addSelectionListener() {\n document.addEventListener(\n \"selectionchange\",\n this.#selectionChange.bind(this),\n { signal: this._signal }\n );\n }\n\n #addFocusManager() {\n if (this.#focusManagerAC) {\n return;\n }\n this.#focusManagerAC = new AbortController();\n const signal = this.combinedSignal(this.#focusManagerAC);\n\n window.addEventListener(\"focus\", this.focus.bind(this), { signal });\n window.addEventListener(\"blur\", this.blur.bind(this), { signal });\n }\n\n #removeFocusManager() {\n this.#focusManagerAC?.abort();\n this.#focusManagerAC = null;\n }\n\n blur() {\n this.isShiftKeyDown = false;\n if (this.#highlightWhenShiftUp) {\n this.#highlightWhenShiftUp = false;\n this.#onSelectEnd(\"main_toolbar\");\n }\n if (!this.hasSelection) {\n return;\n }\n // When several editors are selected and the window loses focus, we want to\n // keep the last active element in order to be able to focus it again when\n // the window gets the focus back but we don't want to trigger any focus\n // callbacks else only one editor will be selected.\n const { activeElement } = document;\n for (const editor of this.#selectedEditors) {\n if (editor.div.contains(activeElement)) {\n this.#lastActiveElement = [editor, activeElement];\n editor._focusEventsAllowed = false;\n break;\n }\n }\n }\n\n focus() {\n if (!this.#lastActiveElement) {\n return;\n }\n const [lastEditor, lastActiveElement] = this.#lastActiveElement;\n this.#lastActiveElement = null;\n lastActiveElement.addEventListener(\n \"focusin\",\n () => {\n lastEditor._focusEventsAllowed = true;\n },\n { once: true, signal: this._signal }\n );\n lastActiveElement.focus();\n }\n\n #addKeyboardManager() {\n if (this.#keyboardManagerAC) {\n return;\n }\n this.#keyboardManagerAC = new AbortController();\n const signal = this.combinedSignal(this.#keyboardManagerAC);\n\n // The keyboard events are caught at the container level in order to be able\n // to execute some callbacks even if the current page doesn't have focus.\n window.addEventListener(\"keydown\", this.keydown.bind(this), { signal });\n window.addEventListener(\"keyup\", this.keyup.bind(this), { signal });\n }\n\n #removeKeyboardManager() {\n this.#keyboardManagerAC?.abort();\n this.#keyboardManagerAC = null;\n }\n\n #addCopyPasteListeners() {\n if (this.#copyPasteAC) {\n return;\n }\n this.#copyPasteAC = new AbortController();\n const signal = this.combinedSignal(this.#copyPasteAC);\n\n document.addEventListener(\"copy\", this.copy.bind(this), { signal });\n document.addEventListener(\"cut\", this.cut.bind(this), { signal });\n document.addEventListener(\"paste\", this.paste.bind(this), { signal });\n }\n\n #removeCopyPasteListeners() {\n this.#copyPasteAC?.abort();\n this.#copyPasteAC = null;\n }\n\n #addDragAndDropListeners() {\n const signal = this._signal;\n document.addEventListener(\"dragover\", this.dragOver.bind(this), { signal });\n document.addEventListener(\"drop\", this.drop.bind(this), { signal });\n }\n\n addEditListeners() {\n this.#addKeyboardManager();\n this.setEditingState(true);\n }\n\n removeEditListeners() {\n this.#removeKeyboardManager();\n this.setEditingState(false);\n }\n\n dragOver(event) {\n for (const { type } of event.dataTransfer.items) {\n for (const editorType of this.#editorTypes) {\n if (editorType.isHandlingMimeForPasting(type)) {\n event.dataTransfer.dropEffect = \"copy\";\n event.preventDefault();\n return;\n }\n }\n }\n }\n\n /**\n * Drop callback.\n * @param {DragEvent} event\n */\n drop(event) {\n for (const item of event.dataTransfer.items) {\n for (const editorType of this.#editorTypes) {\n if (editorType.isHandlingMimeForPasting(item.type)) {\n editorType.paste(item, this.currentLayer);\n event.preventDefault();\n return;\n }\n }\n }\n }\n\n /**\n * Copy callback.\n * @param {ClipboardEvent} event\n */\n copy(event) {\n event.preventDefault();\n\n // An editor is being edited so just commit it.\n this.#activeEditor?.commitOrRemove();\n\n if (!this.hasSelection) {\n return;\n }\n\n const editors = [];\n for (const editor of this.#selectedEditors) {\n const serialized = editor.serialize(/* isForCopying = */ true);\n if (serialized) {\n editors.push(serialized);\n }\n }\n if (editors.length === 0) {\n return;\n }\n\n event.clipboardData.setData(\"application/pdfjs\", JSON.stringify(editors));\n }\n\n /**\n * Cut callback.\n * @param {ClipboardEvent} event\n */\n cut(event) {\n this.copy(event);\n this.delete();\n }\n\n /**\n * Paste callback.\n * @param {ClipboardEvent} event\n */\n async paste(event) {\n event.preventDefault();\n const { clipboardData } = event;\n for (const item of clipboardData.items) {\n for (const editorType of this.#editorTypes) {\n if (editorType.isHandlingMimeForPasting(item.type)) {\n editorType.paste(item, this.currentLayer);\n return;\n }\n }\n }\n\n let data = clipboardData.getData(\"application/pdfjs\");\n if (!data) {\n return;\n }\n\n try {\n data = JSON.parse(data);\n } catch (ex) {\n warn(`paste: \"${ex.message}\".`);\n return;\n }\n\n if (!Array.isArray(data)) {\n return;\n }\n\n this.unselectAll();\n const layer = this.currentLayer;\n\n try {\n const newEditors = [];\n for (const editor of data) {\n const deserializedEditor = await layer.deserialize(editor);\n if (!deserializedEditor) {\n return;\n }\n newEditors.push(deserializedEditor);\n }\n\n const cmd = () => {\n for (const editor of newEditors) {\n this.#addEditorToLayer(editor);\n }\n this.#selectEditors(newEditors);\n };\n const undo = () => {\n for (const editor of newEditors) {\n editor.remove();\n }\n };\n this.addCommands({ cmd, undo, mustExec: true });\n } catch (ex) {\n warn(`paste: \"${ex.message}\".`);\n }\n }\n\n /**\n * Keydown callback.\n * @param {KeyboardEvent} event\n */\n keydown(event) {\n if (!this.isShiftKeyDown && event.key === \"Shift\") {\n this.isShiftKeyDown = true;\n }\n if (\n this.#mode !== AnnotationEditorType.NONE &&\n !this.isEditorHandlingKeyboard\n ) {\n AnnotationEditorUIManager._keyboardManager.exec(this, event);\n }\n }\n\n /**\n * Keyup callback.\n * @param {KeyboardEvent} event\n */\n keyup(event) {\n if (this.isShiftKeyDown && event.key === \"Shift\") {\n this.isShiftKeyDown = false;\n if (this.#highlightWhenShiftUp) {\n this.#highlightWhenShiftUp = false;\n this.#onSelectEnd(\"main_toolbar\");\n }\n }\n }\n\n /**\n * Execute an action for a given name.\n * For example, the user can click on the \"Undo\" entry in the context menu\n * and it'll trigger the undo action.\n */\n onEditingAction({ name }) {\n switch (name) {\n case \"undo\":\n case \"redo\":\n case \"delete\":\n case \"selectAll\":\n this[name]();\n break;\n case \"highlightSelection\":\n this.highlightSelection(\"context_menu\");\n break;\n case \"commentSelection\":\n this.commentSelection(\"context_menu\");\n break;\n }\n }\n\n updatePageIndex(oldPageIndex, newPageIndex) {\n for (const editor of this.#savedEditorsByPage.get(oldPageIndex) || []) {\n editor.pageIndex = newPageIndex;\n }\n const layer = this.#savedAllLayers.get(oldPageIndex);\n if (layer) {\n layer.pageIndex = newPageIndex;\n this.#allLayers.set(newPageIndex, layer);\n if (this.#isEnabled) {\n layer.enable();\n } else {\n layer.disable();\n }\n }\n }\n\n startUpdatePages() {\n this.#savedAllLayers = new Map(this.#allLayers);\n this.#allLayers.clear();\n\n const savedEditorsByPage = (this.#savedEditorsByPage = new Map());\n const saveEditor = editor => {\n savedEditorsByPage\n .getOrInsertComputed(editor.pageIndex, makeArr)\n .push(editor);\n };\n for (const editor of this.#allEditors.values()) {\n saveEditor(editor);\n }\n // Clones are initially kept serialized until their editor layer is\n // rendered, hence they're not present in #allEditors yet.\n for (const [id, editor] of this.#annotationStorage) {\n if (\n id.startsWith(AnnotationEditorPrefix) &&\n !this.#allEditors.has(id) &&\n Number.isInteger(editor?.pageIndex)\n ) {\n saveEditor(editor);\n }\n }\n }\n\n endUpdatePages() {\n this.#savedAllLayers = null;\n this.#savedEditorsByPage = null;\n }\n\n clonePage(pageIndex, newPageIndex) {\n for (const editor of this.getEditors(pageIndex)) {\n const serialized = editor.serialize(\n editor.mode !== AnnotationEditorType.HIGHLIGHT\n );\n if (!serialized) {\n continue;\n }\n serialized.pageIndex = newPageIndex;\n serialized.id = this.getId();\n serialized.isClone = true;\n delete serialized.popupRef;\n this.#annotationStorage.setValue(serialized.id, serialized);\n }\n }\n\n findClonesForPage(layer) {\n const promises = [];\n const { pageIndex } = layer;\n for (const [id, editor] of this.#annotationStorage) {\n if (editor.pageIndex === pageIndex && editor.isClone) {\n this.#annotationStorage.remove(id);\n promises.push(\n layer.deserialize(editor).then(deserializedEditor => {\n if (deserializedEditor) {\n deserializedEditor.isClone = true;\n layer.addOrRebuild(deserializedEditor);\n }\n })\n );\n }\n }\n return Promise.all(promises);\n }\n\n /**\n * Update the different possible states of this manager, e.g. is there\n * something to undo, redo, ...\n * @param {object} details\n */\n #dispatchUpdateStates(details) {\n const hasChanged = Object.entries(details).some(\n ([key, value]) => this.#previousStates[key] !== value\n );\n\n if (hasChanged) {\n this._eventBus.dispatch(\"editingstateschanged\", {\n source: this,\n details: Object.assign(this.#previousStates, details),\n });\n // We could listen on our own event but it sounds like a bit weird and\n // it's a way to simpler to handle that stuff here instead of having to\n // add something in every place where an editor can be unselected.\n if (\n this.#mode === AnnotationEditorType.HIGHLIGHT &&\n details.hasSelectedEditor === false\n ) {\n this.#dispatchUpdateUI([\n [AnnotationEditorParamsType.HIGHLIGHT_FREE, true],\n ]);\n }\n }\n }\n\n #dispatchUpdateUI(details) {\n this._eventBus.dispatch(\"annotationeditorparamschanged\", {\n source: this,\n details,\n });\n }\n\n /**\n * Set the editing state.\n * It can be useful to temporarily disable it when the user is editing a\n * FreeText annotation.\n * @param {boolean} isEditing\n */\n setEditingState(isEditing) {\n if (isEditing) {\n this.#addFocusManager();\n this.#addCopyPasteListeners();\n this.#dispatchUpdateStates({\n isEditing: this.#mode !== AnnotationEditorType.NONE,\n isEmpty: this.#isEmpty(),\n hasSomethingToUndo: this.#commandManager.hasSomethingToUndo(),\n hasSomethingToRedo: this.#commandManager.hasSomethingToRedo(),\n hasSelectedEditor: false,\n });\n } else {\n this.#removeFocusManager();\n this.#removeCopyPasteListeners();\n this.#dispatchUpdateStates({\n isEditing: false,\n });\n this.disableUserSelect(false);\n }\n }\n\n registerEditorTypes(types) {\n if (this.#editorTypes) {\n return;\n }\n this.#editorTypes = types;\n for (const editorType of this.#editorTypes) {\n this.#dispatchUpdateUI(editorType.defaultPropertiesToUpdate);\n }\n }\n\n /**\n * Get an id.\n * @returns {string}\n */\n getId() {\n return this.#idManager.id;\n }\n\n get currentLayer() {\n return this.#allLayers.get(this.#currentPageIndex);\n }\n\n getLayer(pageIndex) {\n return this.#allLayers.get(pageIndex);\n }\n\n get currentPageIndex() {\n return this.#currentPageIndex;\n }\n\n /**\n * Add a new layer for a page which will contains the editors.\n * @param {AnnotationEditorLayer} layer\n */\n addLayer(layer) {\n this.#allLayers.set(layer.pageIndex, layer);\n if (this.#isEnabled) {\n layer.enable();\n } else {\n layer.disable();\n }\n }\n\n /**\n * Remove a layer.\n * @param {AnnotationEditorLayer} layer\n */\n removeLayer(layer) {\n this.#allLayers.delete(layer.pageIndex);\n }\n\n /**\n * Change the editor mode (None, FreeText, Ink, ...)\n * @param {number} mode\n * @param {string|null} editId\n * @param {boolean} [isFromUser] - true if the mode change is due to a\n * user action.\n * @param {boolean} [isFromKeyboard] - true if the mode change is due to a\n * keyboard action.\n * @param {boolean} [mustEnterInEditMode] - true if the editor must enter in\n * edit mode.\n * @param {boolean} [editComment] - true if the mode change is due to a\n * comment edit.\n */\n async updateMode(\n mode,\n editId = null,\n isFromUser = false,\n isFromKeyboard = false,\n mustEnterInEditMode = false,\n editComment = false\n ) {\n if (this.#mode === mode) {\n return;\n }\n\n if (this.#updateModeCapability) {\n await this.#updateModeCapability.promise;\n if (!this.#updateModeCapability) {\n // This ui manager has been destroyed.\n return;\n }\n }\n\n this.#updateModeCapability = Promise.withResolvers();\n this.#currentDrawingSession?.commitOrRemove();\n\n if (this.#mode === AnnotationEditorType.POPUP) {\n this.#commentManager?.hideSidebar();\n }\n this.#commentManager?.destroyPopup();\n\n this.#mode = mode;\n if (mode === AnnotationEditorType.NONE) {\n this.setEditingState(false);\n this.#disableAll();\n for (const editor of this.#allEditors.values()) {\n editor.hideStandaloneCommentButton();\n }\n\n this._editorUndoBar?.hide();\n this.toggleComment(/* editor = */ null);\n\n this.#updateModeCapability.resolve();\n return;\n }\n\n for (const editor of this.#allEditors.values()) {\n editor.addStandaloneCommentButton();\n }\n\n if (mode === AnnotationEditorType.SIGNATURE) {\n await this.#signatureManager?.loadSignatures();\n }\n\n if (isFromUser) {\n // reinitialize the pointer type when the mode is changed by the user\n CurrentPointers.clearPointerType();\n }\n\n this.setEditingState(true);\n await this.#enableAll();\n this.unselectAll();\n for (const layer of this.#allLayers.values()) {\n layer.updateMode(mode);\n }\n\n if (mode === AnnotationEditorType.POPUP) {\n this.#allEditableAnnotations ||=\n await this.#pdfDocument.getAnnotationsByType(\n new Set(this.#editorTypes.map(editorClass => editorClass._editorType))\n );\n const elementIds = new Set();\n const allComments = [];\n for (const editor of this.#allEditors.values()) {\n const { annotationElementId, hasComment, deleted } = editor;\n if (annotationElementId) {\n elementIds.add(annotationElementId);\n }\n if (hasComment && !deleted) {\n allComments.push(editor.getData());\n }\n }\n for (const annotation of this.#allEditableAnnotations) {\n const { id, popupRef, contentsObj } = annotation;\n if (\n popupRef &&\n contentsObj?.str &&\n !elementIds.has(id) &&\n !this.#deletedAnnotationsElementIds.has(id)\n ) {\n // The annotation exists in the PDF and has a comment but there\n // is no editor for it (anymore).\n allComments.push(annotation);\n }\n }\n this.#commentManager?.showSidebar(allComments);\n }\n\n if (!editId) {\n if (isFromKeyboard) {\n this.addNewEditorFromKeyboard();\n }\n\n this.#updateModeCapability.resolve();\n return;\n }\n\n for (const editor of this.#allEditors.values()) {\n if (editor.uid === editId) {\n this.setSelected(editor);\n if (editComment) {\n editor.editComment();\n } else if (mustEnterInEditMode) {\n editor.enterInEditMode();\n } else {\n editor.focus();\n }\n } else {\n editor.unselect();\n }\n }\n\n this.#updateModeCapability.resolve();\n }\n\n addNewEditorFromKeyboard() {\n if (this.currentLayer.canCreateNewEmptyEditor()) {\n this.currentLayer.addNewEditor();\n }\n }\n\n /**\n * Update the toolbar if it's required to reflect the tool currently used.\n * @param {object} options\n * @param {number} options.mode\n * @returns {undefined}\n */\n updateToolbar(options) {\n if (options.mode === this.#mode) {\n return;\n }\n this._eventBus.dispatch(\"switchannotationeditormode\", {\n source: this,\n ...options,\n });\n }\n\n /**\n * Update a parameter in the current editor or globally.\n * @param {number} type\n * @param {*} value\n */\n updateParams(type, value) {\n if (!this.#editorTypes) {\n return;\n }\n\n switch (type) {\n case AnnotationEditorParamsType.CREATE:\n this.currentLayer.addNewEditor(value);\n return;\n case AnnotationEditorParamsType.HIGHLIGHT_SHOW_ALL:\n this._eventBus.dispatch(\"reporttelemetry\", {\n source: this,\n details: {\n type: \"editing\",\n data: {\n type: \"highlight\",\n action: \"toggle_visibility\",\n },\n },\n });\n (this.#showAllStates ||= new Map()).set(type, value);\n this.showAllEditors(\"highlight\", value);\n break;\n }\n\n if (this.hasSelection) {\n for (const editor of this.#selectedEditors) {\n editor.updateParams(type, value);\n }\n } else {\n for (const editorType of this.#editorTypes) {\n editorType.updateDefaultParams(type, value);\n }\n }\n }\n\n showAllEditors(type, visible, updateButton = false) {\n for (const editor of this.#allEditors.values()) {\n if (editor.editorType === type) {\n editor.show(visible);\n }\n }\n const state =\n this.#showAllStates?.get(AnnotationEditorParamsType.HIGHLIGHT_SHOW_ALL) ??\n true;\n if (state !== visible) {\n this.#dispatchUpdateUI([\n [AnnotationEditorParamsType.HIGHLIGHT_SHOW_ALL, visible],\n ]);\n }\n }\n\n enableWaiting(mustWait = false) {\n if (this.#isWaiting === mustWait) {\n return;\n }\n this.#isWaiting = mustWait;\n for (const layer of this.#allLayers.values()) {\n if (mustWait) {\n layer.disableClick();\n } else {\n layer.enableClick();\n }\n layer.div.classList.toggle(\"waiting\", mustWait);\n }\n }\n\n /**\n * Enable all the layers.\n */\n async #enableAll() {\n if (!this.#isEnabled) {\n this.#isEnabled = true;\n const promises = [];\n for (const layer of this.#allLayers.values()) {\n promises.push(layer.enable());\n }\n await Promise.all(promises);\n for (const editor of this.#allEditors.values()) {\n editor.enable();\n }\n }\n }\n\n /**\n * Disable all the layers.\n */\n #disableAll() {\n this.unselectAll();\n if (this.#isEnabled) {\n this.#isEnabled = false;\n for (const layer of this.#allLayers.values()) {\n layer.disable();\n }\n for (const editor of this.#allEditors.values()) {\n editor.disable();\n }\n }\n }\n\n /**\n * Get all the editors belonging to a given page.\n * @param {number} pageIndex\n * @yields {AnnotationEditor} An editor on the given page.\n */\n *getEditors(pageIndex) {\n for (const editor of this.#allEditors.values()) {\n if (editor.pageIndex === pageIndex) {\n yield editor;\n }\n }\n }\n\n /**\n * Get an editor with the given id.\n * @param {string} id\n * @returns {AnnotationEditor}\n */\n getEditor(id) {\n return this.#allEditors.get(id);\n }\n\n /**\n * Add a new editor.\n * @param {AnnotationEditor} editor\n */\n addEditor(editor) {\n this.#allEditors.set(editor.id, editor);\n }\n\n /**\n * Remove an editor.\n * @param {AnnotationEditor} editor\n */\n removeEditor(editor) {\n if (editor.div.contains(document.activeElement)) {\n if (this.#focusMainContainerTimeoutId) {\n clearTimeout(this.#focusMainContainerTimeoutId);\n }\n this.#focusMainContainerTimeoutId = setTimeout(() => {\n // When the div is removed from DOM the focus can move on the\n // document.body, so we need to move it back to the main container.\n this.focusMainContainer();\n this.#focusMainContainerTimeoutId = null;\n }, 0);\n }\n this.#allEditors.delete(editor.id);\n if (editor.annotationElementId) {\n this.#missingCanvases?.delete(editor.annotationElementId);\n }\n this.unselect(editor);\n if (\n !editor.annotationElementId ||\n !this.#deletedAnnotationsElementIds.has(editor.annotationElementId)\n ) {\n this.#annotationStorage?.remove(editor.id);\n }\n }\n\n /**\n * The annotation element with the given id has been deleted.\n * @param {AnnotationEditor} editor\n */\n addDeletedAnnotationElement(editor) {\n this.#deletedAnnotationsElementIds.add(editor.annotationElementId);\n this.addChangedExistingAnnotation(editor);\n editor.deleted = true;\n }\n\n /**\n * Check if the annotation element with the given id has been deleted.\n * @param {string} annotationElementId\n * @returns {boolean}\n */\n isDeletedAnnotationElement(annotationElementId) {\n return this.#deletedAnnotationsElementIds.has(annotationElementId);\n }\n\n /**\n * The annotation element with the given id have been restored.\n * @param {AnnotationEditor} editor\n */\n removeDeletedAnnotationElement(editor) {\n this.#deletedAnnotationsElementIds.delete(editor.annotationElementId);\n this.removeChangedExistingAnnotation(editor);\n editor.deleted = false;\n }\n\n /**\n * Add an editor to the layer it belongs to or add it to the global map.\n * @param {AnnotationEditor} editor\n */\n #addEditorToLayer(editor) {\n const layer = this.#allLayers.get(editor.pageIndex);\n if (layer) {\n layer.addOrRebuild(editor);\n } else {\n this.addEditor(editor);\n this.addToAnnotationStorage(editor);\n }\n }\n\n /**\n * Set the given editor as the active one.\n * @param {AnnotationEditor} editor\n */\n setActiveEditor(editor) {\n if (this.#activeEditor === editor) {\n return;\n }\n\n this.#activeEditor = editor;\n if (editor) {\n this.#dispatchUpdateUI(editor.propertiesToUpdate);\n }\n }\n\n get #lastSelectedEditor() {\n let ed = null;\n for (ed of this.#selectedEditors) {\n // Iterate to get the last element.\n }\n return ed;\n }\n\n /**\n * Update the UI of the active editor.\n * @param {AnnotationEditor} editor\n */\n updateUI(editor) {\n if (this.#lastSelectedEditor === editor) {\n this.#dispatchUpdateUI(editor.propertiesToUpdate);\n }\n }\n\n updateUIForDefaultProperties(editorType) {\n this.#dispatchUpdateUI(editorType.defaultPropertiesToUpdate);\n }\n\n /**\n * Add or remove an editor the current selection.\n * @param {AnnotationEditor} editor\n */\n toggleSelected(editor) {\n if (this.#selectedEditors.has(editor)) {\n this.#selectedEditors.delete(editor);\n editor.unselect();\n this.#dispatchUpdateStates({\n hasSelectedEditor: this.hasSelection,\n });\n return;\n }\n this.#selectedEditors.add(editor);\n editor.select();\n this.#dispatchUpdateUI(editor.propertiesToUpdate);\n this.#dispatchUpdateStates({\n hasSelectedEditor: true,\n });\n }\n\n /**\n * Set the last selected editor.\n * @param {AnnotationEditor} editor\n */\n setSelected(editor) {\n this.updateToolbar({\n mode: editor.mode,\n editId: editor.uid,\n });\n\n this.#currentDrawingSession?.commitOrRemove();\n for (const ed of this.#selectedEditors) {\n if (ed !== editor) {\n ed.unselect();\n }\n }\n this.#commentManager?.destroyPopup();\n this.#selectedEditors.clear();\n\n this.#selectedEditors.add(editor);\n editor.select();\n this.#dispatchUpdateUI(editor.propertiesToUpdate);\n this.#dispatchUpdateStates({\n hasSelectedEditor: true,\n });\n }\n\n get firstSelectedEditor() {\n return this.#selectedEditors.values().next().value;\n }\n\n /**\n * Unselect an editor.\n * @param {AnnotationEditor} editor\n */\n unselect(editor) {\n editor.unselect();\n this.#selectedEditors.delete(editor);\n this.#dispatchUpdateStates({\n hasSelectedEditor: this.hasSelection,\n });\n }\n\n get hasSelection() {\n return this.#selectedEditors.size !== 0;\n }\n\n get isEnterHandled() {\n return (\n this.#selectedEditors.size === 1 &&\n this.firstSelectedEditor.isEnterHandled\n );\n }\n\n /**\n * Undo the last command.\n */\n undo() {\n this.#commandManager.undo();\n this.#dispatchUpdateStates({\n hasSomethingToUndo: this.#commandManager.hasSomethingToUndo(),\n hasSomethingToRedo: true,\n isEmpty: this.#isEmpty(),\n });\n this._editorUndoBar?.hide();\n }\n\n /**\n * Redo the last undoed command.\n */\n redo() {\n this.#commandManager.redo();\n this.#dispatchUpdateStates({\n hasSomethingToUndo: true,\n hasSomethingToRedo: this.#commandManager.hasSomethingToRedo(),\n isEmpty: this.#isEmpty(),\n });\n }\n\n /**\n * Add a command to execute (cmd) and another one to undo it.\n * @param {object} params\n */\n addCommands(params) {\n this.#commandManager.add(params);\n this.#dispatchUpdateStates({\n hasSomethingToUndo: true,\n hasSomethingToRedo: false,\n isEmpty: this.#isEmpty(),\n });\n }\n\n cleanUndoStack(type) {\n this.#commandManager.cleanType(type);\n }\n\n #isEmpty() {\n if (this.#allEditors.size === 0) {\n return true;\n }\n\n if (this.#allEditors.size === 1) {\n for (const editor of this.#allEditors.values()) {\n return editor.isEmpty();\n }\n }\n\n return false;\n }\n\n /**\n * Delete the current editor or all.\n */\n delete() {\n this.commitOrRemove();\n const drawingEditor = this.currentLayer?.endDrawingSession(\n /* isAborted = */ true\n );\n if (!this.hasSelection && !drawingEditor) {\n return;\n }\n\n const editors = drawingEditor\n ? [drawingEditor]\n : [...this.#selectedEditors];\n const cmd = () => {\n this._editorUndoBar?.show(\n undo,\n editors.length === 1 ? editors[0].editorType : editors.length\n );\n for (const editor of editors) {\n editor.remove();\n }\n };\n const undo = () => {\n for (const editor of editors) {\n this.#addEditorToLayer(editor);\n }\n };\n\n this.addCommands({ cmd, undo, mustExec: true });\n }\n\n commitOrRemove() {\n // An editor is being edited so just commit it.\n this.#activeEditor?.commitOrRemove();\n }\n\n hasSomethingToControl() {\n return this.#activeEditor || this.hasSelection;\n }\n\n /**\n * Select the editors.\n * @param {Array} editors\n */\n #selectEditors(editors) {\n for (const editor of this.#selectedEditors) {\n editor.unselect();\n }\n this.#selectedEditors.clear();\n for (const editor of editors) {\n if (editor.isEmpty()) {\n continue;\n }\n this.#selectedEditors.add(editor);\n editor.select();\n }\n this.#dispatchUpdateStates({ hasSelectedEditor: this.hasSelection });\n }\n\n /**\n * Select all the editors.\n */\n selectAll() {\n for (const editor of this.#selectedEditors) {\n editor.commit();\n }\n this.#selectEditors(this.#allEditors.values());\n }\n\n /**\n * Unselect all the selected editors.\n */\n unselectAll() {\n if (this.#activeEditor) {\n // An editor is being edited so just commit it.\n this.#activeEditor.commitOrRemove();\n if (this.#mode !== AnnotationEditorType.NONE) {\n // If the mode is NONE, we want to really unselect the editor, hence we\n // mustn't return here.\n return;\n }\n }\n\n if (this.#currentDrawingSession?.commitOrRemove()) {\n return;\n }\n\n this.#commentManager?.destroyPopup();\n\n if (!this.hasSelection) {\n return;\n }\n for (const editor of this.#selectedEditors) {\n editor.unselect();\n }\n this.#selectedEditors.clear();\n this.#dispatchUpdateStates({\n hasSelectedEditor: false,\n });\n }\n\n translateSelectedEditors(x, y, noCommit = false) {\n if (!noCommit) {\n this.commitOrRemove();\n }\n if (!this.hasSelection) {\n return;\n }\n\n this.#translation[0] += x;\n this.#translation[1] += y;\n const [totalX, totalY] = this.#translation;\n const editors = [...this.#selectedEditors];\n\n // We don't want to have an undo/redo for each translation so we wait a bit\n // before adding the command to the command manager.\n const TIME_TO_WAIT = 1000;\n\n if (this.#translationTimeoutId) {\n clearTimeout(this.#translationTimeoutId);\n }\n\n this.#translationTimeoutId = setTimeout(() => {\n this.#translationTimeoutId = null;\n this.#translation[0] = this.#translation[1] = 0;\n\n this.addCommands({\n cmd: () => {\n for (const editor of editors) {\n if (this.#allEditors.has(editor.id)) {\n editor.translateInPage(totalX, totalY);\n editor.translationDone();\n }\n }\n },\n undo: () => {\n for (const editor of editors) {\n if (this.#allEditors.has(editor.id)) {\n editor.translateInPage(-totalX, -totalY);\n editor.translationDone();\n }\n }\n },\n mustExec: false,\n });\n }, TIME_TO_WAIT);\n\n for (const editor of editors) {\n editor.translateInPage(x, y);\n editor.translationDone();\n }\n }\n\n /**\n * Set up the drag session for moving the selected editors.\n */\n setUpDragSession() {\n // Note: don't use any references to the editor's parent which can be null\n // if the editor belongs to a destroyed page.\n if (!this.hasSelection) {\n return;\n }\n // Avoid to have spurious text selection in the text layer when dragging.\n this.disableUserSelect(true);\n this.#draggingEditors = new Map();\n for (const editor of this.#selectedEditors) {\n this.#draggingEditors.set(editor, {\n savedX: editor.x,\n savedY: editor.y,\n savedPageIndex: editor.pageIndex,\n newX: 0,\n newY: 0,\n newPageIndex: -1,\n });\n }\n }\n\n /**\n * Ends the drag session.\n * @returns {boolean} true if at least one editor has been moved.\n */\n endDragSession() {\n if (!this.#draggingEditors) {\n return false;\n }\n this.disableUserSelect(false);\n const map = this.#draggingEditors;\n this.#draggingEditors = null;\n let mustBeAddedInUndoStack = false;\n\n for (const [{ x, y, pageIndex }, value] of map) {\n value.newX = x;\n value.newY = y;\n value.newPageIndex = pageIndex;\n mustBeAddedInUndoStack ||=\n x !== value.savedX ||\n y !== value.savedY ||\n pageIndex !== value.savedPageIndex;\n }\n\n if (!mustBeAddedInUndoStack) {\n return false;\n }\n\n const move = (editor, x, y, pageIndex) => {\n if (this.#allEditors.has(editor.id)) {\n // The editor can be undone/redone on a page which is not visible (and\n // which potentially has no annotation editor layer), hence we need to\n // use the pageIndex instead of the parent.\n const parent = this.#allLayers.get(pageIndex);\n if (parent) {\n editor._setParentAndPosition(parent, x, y);\n } else {\n editor.pageIndex = pageIndex;\n editor.x = x;\n editor.y = y;\n }\n }\n };\n\n this.addCommands({\n cmd: () => {\n for (const [editor, { newX, newY, newPageIndex }] of map) {\n move(editor, newX, newY, newPageIndex);\n }\n },\n undo: () => {\n for (const [editor, { savedX, savedY, savedPageIndex }] of map) {\n move(editor, savedX, savedY, savedPageIndex);\n }\n },\n mustExec: true,\n });\n\n return true;\n }\n\n /**\n * Drag the set of selected editors.\n * @param {number} tx\n * @param {number} ty\n */\n dragSelectedEditors(tx, ty) {\n if (!this.#draggingEditors) {\n return;\n }\n for (const editor of this.#draggingEditors.keys()) {\n editor.drag(tx, ty);\n }\n }\n\n /**\n * Rebuild the editor (usually on undo/redo actions) on a potentially\n * non-rendered page.\n * @param {AnnotationEditor} editor\n */\n rebuild(editor) {\n if (editor.parent === null) {\n const parent = this.getLayer(editor.pageIndex);\n if (parent) {\n parent.changeParent(editor);\n parent.addOrRebuild(editor);\n } else {\n this.addEditor(editor);\n this.addToAnnotationStorage(editor);\n editor.rebuild();\n }\n } else {\n editor.parent.addOrRebuild(editor);\n }\n }\n\n get isEditorHandlingKeyboard() {\n return (\n this.getActive()?.shouldGetKeyboardEvents() ||\n (this.#selectedEditors.size === 1 &&\n this.firstSelectedEditor.shouldGetKeyboardEvents())\n );\n }\n\n /**\n * Is the current editor the one passed as argument?\n * @param {AnnotationEditor} editor\n * @returns {boolean}\n */\n isActive(editor) {\n return this.#activeEditor === editor;\n }\n\n /**\n * Get the current active editor.\n * @returns {AnnotationEditor|null}\n */\n getActive() {\n return this.#activeEditor;\n }\n\n /**\n * Get the current editor mode.\n * @returns {number}\n */\n getMode() {\n return this.#mode;\n }\n\n isEditingMode() {\n return this.#mode !== AnnotationEditorType.NONE;\n }\n\n get imageManager() {\n return shadow(this, \"imageManager\", new ImageManager());\n }\n\n getSelectionBoxes(textLayer) {\n if (!textLayer) {\n return null;\n }\n const selection = document.getSelection();\n for (let i = 0, ii = selection.rangeCount; i < ii; i++) {\n if (\n !textLayer.contains(selection.getRangeAt(i).commonAncestorContainer)\n ) {\n return null;\n }\n }\n\n const {\n x: layerX,\n y: layerY,\n width: parentWidth,\n height: parentHeight,\n } = textLayer.getBoundingClientRect();\n\n // We must rotate the boxes because we want to have them in the non-rotated\n // page coordinates.\n let rotator;\n switch (textLayer.getAttribute(\"data-main-rotation\")) {\n case \"90\":\n rotator = (x, y, w, h) => ({\n x: (y - layerY) / parentHeight,\n y: 1 - (x + w - layerX) / parentWidth,\n width: h / parentHeight,\n height: w / parentWidth,\n });\n break;\n case \"180\":\n rotator = (x, y, w, h) => ({\n x: 1 - (x + w - layerX) / parentWidth,\n y: 1 - (y + h - layerY) / parentHeight,\n width: w / parentWidth,\n height: h / parentHeight,\n });\n break;\n case \"270\":\n rotator = (x, y, w, h) => ({\n x: 1 - (y + h - layerY) / parentHeight,\n y: (x - layerX) / parentWidth,\n width: h / parentHeight,\n height: w / parentWidth,\n });\n break;\n default:\n rotator = (x, y, w, h) => ({\n x: (x - layerX) / parentWidth,\n y: (y - layerY) / parentHeight,\n width: w / parentWidth,\n height: h / parentHeight,\n });\n break;\n }\n\n const boxes = [];\n for (let i = 0, ii = selection.rangeCount; i < ii; i++) {\n const range = selection.getRangeAt(i);\n if (range.collapsed) {\n continue;\n }\n for (const { x, y, width, height } of range.getClientRects()) {\n if (width === 0 || height === 0) {\n continue;\n }\n boxes.push(rotator(x, y, width, height));\n }\n }\n return boxes.length === 0 ? null : boxes;\n }\n\n addChangedExistingAnnotation({ annotationElementId, id }) {\n (this.#changedExistingAnnotations ||= new Map()).set(\n annotationElementId,\n id\n );\n }\n\n removeChangedExistingAnnotation({ annotationElementId }) {\n this.#changedExistingAnnotations?.delete(annotationElementId);\n }\n\n renderAnnotationElement(annotation) {\n const editorId = this.#changedExistingAnnotations?.get(annotation.data.id);\n if (!editorId) {\n return;\n }\n const editor = this.#annotationStorage.getRawValue(editorId);\n if (!editor) {\n return;\n }\n if (this.#mode === AnnotationEditorType.NONE && !editor.hasBeenModified) {\n return;\n }\n editor.renderAnnotationElement(annotation);\n }\n\n setMissingCanvas(annotationId, annotationElementId, canvas) {\n const editor = this.#missingCanvases?.get(annotationId);\n if (!editor) {\n return;\n }\n editor.setCanvas(annotationElementId, canvas);\n this.#missingCanvases.delete(annotationId);\n }\n\n addMissingCanvas(annotationId, editor) {\n (this.#missingCanvases ||= new Map()).set(annotationId, editor);\n }\n}\n\nexport {\n AnnotationEditorUIManager,\n bindEvents,\n ColorManager,\n CommandManager,\n CurrentPointers,\n KeyboardManager,\n};\n","/* Copyright 2023 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { noContextMenu } from \"../display_utils.js\";\n\nclass AltText {\n #altText = null;\n\n #altTextDecorative = false;\n\n #altTextButton = null;\n\n #altTextButtonLabel = null;\n\n #altTextTooltip = null;\n\n #altTextTooltipTimeout = null;\n\n #altTextWasFromKeyBoard = false;\n\n #badge = null;\n\n #editor = null;\n\n #guessedText = null;\n\n #textWithDisclaimer = null;\n\n #useNewAltTextFlow = false;\n\n static #l10nNewButton = null;\n\n static _l10n = null;\n\n constructor(editor) {\n this.#editor = editor;\n this.#useNewAltTextFlow = editor._uiManager.useNewAltTextFlow;\n\n AltText.#l10nNewButton ||= Object.freeze({\n added: \"pdfjs-editor-new-alt-text-added-button\",\n \"added-label\": \"pdfjs-editor-new-alt-text-added-button-label\",\n missing: \"pdfjs-editor-new-alt-text-missing-button\",\n \"missing-label\": \"pdfjs-editor-new-alt-text-missing-button-label\",\n review: \"pdfjs-editor-new-alt-text-to-review-button\",\n \"review-label\": \"pdfjs-editor-new-alt-text-to-review-button-label\",\n });\n }\n\n static initialize(l10n) {\n AltText._l10n ??= l10n;\n }\n\n async render() {\n const altText = (this.#altTextButton = document.createElement(\"button\"));\n altText.className = \"altText\";\n altText.tabIndex = \"0\";\n\n const label = (this.#altTextButtonLabel = document.createElement(\"span\"));\n altText.append(label);\n\n if (this.#useNewAltTextFlow) {\n altText.classList.add(\"new\");\n altText.setAttribute(\"data-l10n-id\", AltText.#l10nNewButton.missing);\n label.setAttribute(\n \"data-l10n-id\",\n AltText.#l10nNewButton[\"missing-label\"]\n );\n } else {\n altText.setAttribute(\"data-l10n-id\", \"pdfjs-editor-alt-text-button\");\n label.setAttribute(\"data-l10n-id\", \"pdfjs-editor-alt-text-button-label\");\n }\n\n const signal = this.#editor._uiManager._signal;\n altText.addEventListener(\"contextmenu\", noContextMenu, { signal });\n altText.addEventListener(\"pointerdown\", event => event.stopPropagation(), {\n signal,\n });\n\n const onClick = event => {\n event.preventDefault();\n this.#editor._uiManager.editAltText(this.#editor);\n if (this.#useNewAltTextFlow) {\n this.#editor._reportTelemetry({\n action: \"pdfjs.image.alt_text.image_status_label_clicked\",\n data: { label: this.#label },\n });\n }\n };\n altText.addEventListener(\"click\", onClick, { capture: true, signal });\n altText.addEventListener(\n \"keydown\",\n event => {\n if (event.target === altText && event.key === \"Enter\") {\n this.#altTextWasFromKeyBoard = true;\n onClick(event);\n }\n },\n { signal }\n );\n await this.#setState();\n\n return altText;\n }\n\n get #label() {\n return (\n (this.#altText && \"added\") ||\n (this.#altText === null && this.guessedText && \"review\") ||\n \"missing\"\n );\n }\n\n finish() {\n if (!this.#altTextButton) {\n return;\n }\n this.#altTextButton.focus({ focusVisible: this.#altTextWasFromKeyBoard });\n this.#altTextWasFromKeyBoard = false;\n }\n\n isEmpty() {\n return this.#useNewAltTextFlow\n ? this.#altText === null\n : !this.#altText && !this.#altTextDecorative;\n }\n\n hasData() {\n return this.#useNewAltTextFlow\n ? this.#altText !== null || !!this.#guessedText\n : this.isEmpty();\n }\n\n get guessedText() {\n return this.#guessedText;\n }\n\n async setGuessedText(guessedText) {\n if (this.#altText !== null) {\n // The user provided their own alt text, so we don't want to overwrite it.\n return;\n }\n this.#guessedText = guessedText;\n this.#textWithDisclaimer = await AltText._l10n.get(\n \"pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer\",\n { generatedAltText: guessedText }\n );\n this.#setState();\n }\n\n toggleAltTextBadge(visibility = false) {\n if (!this.#useNewAltTextFlow || this.#altText) {\n this.#badge?.remove();\n this.#badge = null;\n return;\n }\n if (!this.#badge) {\n const badge = (this.#badge = document.createElement(\"div\"));\n badge.className = \"noAltTextBadge\";\n this.#editor.div.append(badge);\n }\n this.#badge.classList.toggle(\"hidden\", !visibility);\n }\n\n serialize(isForCopying) {\n let altText = this.#altText;\n if (!isForCopying && this.#guessedText === altText) {\n altText = this.#textWithDisclaimer;\n }\n return {\n altText,\n decorative: this.#altTextDecorative,\n guessedText: this.#guessedText,\n textWithDisclaimer: this.#textWithDisclaimer,\n };\n }\n\n get data() {\n return {\n altText: this.#altText,\n decorative: this.#altTextDecorative,\n };\n }\n\n /**\n * Set the alt text data.\n */\n set data({\n altText,\n decorative,\n guessedText,\n textWithDisclaimer,\n cancel = false,\n }) {\n if (guessedText) {\n this.#guessedText = guessedText;\n this.#textWithDisclaimer = textWithDisclaimer;\n }\n if (this.#altText === altText && this.#altTextDecorative === decorative) {\n return;\n }\n if (!cancel) {\n this.#altText = altText;\n this.#altTextDecorative = decorative;\n }\n this.#setState();\n }\n\n toggle(enabled = false) {\n if (!this.#altTextButton) {\n return;\n }\n if (!enabled && this.#altTextTooltipTimeout) {\n clearTimeout(this.#altTextTooltipTimeout);\n this.#altTextTooltipTimeout = null;\n }\n this.#altTextButton.disabled = !enabled;\n }\n\n shown() {\n this.#editor._reportTelemetry({\n action: \"pdfjs.image.alt_text.image_status_label_displayed\",\n data: { label: this.#label },\n });\n }\n\n destroy() {\n this.#altTextButton?.remove();\n this.#altTextButton = null;\n this.#altTextButtonLabel = null;\n this.#altTextTooltip = null;\n this.#badge?.remove();\n this.#badge = null;\n }\n\n async #setState() {\n const button = this.#altTextButton;\n if (!button) {\n return;\n }\n\n if (this.#useNewAltTextFlow) {\n button.classList.toggle(\"done\", !!this.#altText);\n button.setAttribute(\"data-l10n-id\", AltText.#l10nNewButton[this.#label]);\n\n this.#altTextButtonLabel?.setAttribute(\n \"data-l10n-id\",\n AltText.#l10nNewButton[`${this.#label}-label`]\n );\n if (!this.#altText) {\n this.#altTextTooltip?.remove();\n return;\n }\n } else {\n if (!this.#altText && !this.#altTextDecorative) {\n button.classList.remove(\"done\");\n this.#altTextTooltip?.remove();\n return;\n }\n button.classList.add(\"done\");\n button.setAttribute(\"data-l10n-id\", \"pdfjs-editor-alt-text-edit-button\");\n }\n\n let tooltip = this.#altTextTooltip;\n if (!tooltip) {\n this.#altTextTooltip = tooltip = document.createElement(\"span\");\n tooltip.className = \"tooltip\";\n tooltip.setAttribute(\"role\", \"tooltip\");\n tooltip.id = `alt-text-tooltip-${this.#editor.id}`;\n\n const DELAY_TO_SHOW_TOOLTIP = 100;\n const signal = this.#editor._uiManager._signal;\n signal.addEventListener(\n \"abort\",\n () => {\n clearTimeout(this.#altTextTooltipTimeout);\n this.#altTextTooltipTimeout = null;\n },\n { once: true }\n );\n button.addEventListener(\n \"mouseenter\",\n () => {\n this.#altTextTooltipTimeout = setTimeout(() => {\n this.#altTextTooltipTimeout = null;\n this.#altTextTooltip.classList.add(\"show\");\n this.#editor._reportTelemetry({\n action: \"alt_text_tooltip\",\n });\n }, DELAY_TO_SHOW_TOOLTIP);\n },\n { signal }\n );\n button.addEventListener(\n \"mouseleave\",\n () => {\n if (this.#altTextTooltipTimeout) {\n clearTimeout(this.#altTextTooltipTimeout);\n this.#altTextTooltipTimeout = null;\n }\n this.#altTextTooltip?.classList.remove(\"show\");\n },\n { signal }\n );\n }\n if (this.#altTextDecorative) {\n tooltip.setAttribute(\n \"data-l10n-id\",\n \"pdfjs-editor-alt-text-decorative-tooltip\"\n );\n } else {\n tooltip.removeAttribute(\"data-l10n-id\");\n tooltip.textContent = this.#altText;\n }\n\n if (!tooltip.parentNode) {\n button.append(tooltip);\n }\n\n const element = this.#editor.getElementForAltText();\n element?.setAttribute(\"aria-describedby\", tooltip.id);\n }\n}\n\nexport { AltText };\n","/* Copyright 2025 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { noContextMenu, stopEvent } from \"../display_utils.js\";\n\nclass Comment {\n #commentStandaloneButton = null;\n\n #commentToolbarButton = null;\n\n #commentWasFromKeyBoard = false;\n\n #editor = null;\n\n #initialText = null;\n\n #richText = null;\n\n #text = null;\n\n #date = null;\n\n #deleted = false;\n\n #popupPosition = null;\n\n constructor(editor) {\n this.#editor = editor;\n }\n\n renderForToolbar() {\n const button = (this.#commentToolbarButton =\n document.createElement(\"button\"));\n button.className = \"comment\";\n return this.#render(button, false);\n }\n\n renderForStandalone() {\n const button = (this.#commentStandaloneButton =\n document.createElement(\"button\"));\n button.className = \"annotationCommentButton\";\n\n const position = this.#editor.commentButtonPosition;\n if (position) {\n const { style } = button;\n style.insetInlineEnd = `calc(${\n 100 *\n (this.#editor._uiManager.direction === \"ltr\"\n ? 1 - position[0]\n : position[0])\n }% - var(--comment-button-dim))`;\n style.top = `calc(${100 * position[1]}% - var(--comment-button-dim))`;\n const color = this.#editor.commentButtonColor;\n if (color) {\n style.backgroundColor = color;\n }\n }\n\n return this.#render(button, true);\n }\n\n focusButton() {\n setTimeout(() => {\n (this.#commentStandaloneButton ?? this.#commentToolbarButton)?.focus();\n }, 0);\n }\n\n onUpdatedColor() {\n if (!this.#commentStandaloneButton) {\n return;\n }\n const color = this.#editor.commentButtonColor;\n if (color) {\n this.#commentStandaloneButton.style.backgroundColor = color;\n }\n this.#editor._uiManager.updatePopupColor(this.#editor);\n }\n\n get commentButtonWidth() {\n return (\n (this.#commentStandaloneButton?.getBoundingClientRect().width ?? 0) /\n this.#editor.parent.boundingClientRect.width\n );\n }\n\n get commentPopupPositionInLayer() {\n if (this.#popupPosition) {\n return this.#popupPosition;\n }\n if (!this.#commentStandaloneButton) {\n return null;\n }\n const { x, y, height } =\n this.#commentStandaloneButton.getBoundingClientRect();\n const {\n x: parentX,\n y: parentY,\n width: parentWidth,\n height: parentHeight,\n } = this.#editor.parent.boundingClientRect;\n return [(x - parentX) / parentWidth, (y + height - parentY) / parentHeight];\n }\n\n set commentPopupPositionInLayer(pos) {\n this.#popupPosition = pos;\n }\n\n hasDefaultPopupPosition() {\n return this.#popupPosition === null;\n }\n\n removeStandaloneCommentButton() {\n this.#commentStandaloneButton?.remove();\n this.#commentStandaloneButton = null;\n }\n\n removeToolbarCommentButton() {\n this.#commentToolbarButton?.remove();\n this.#commentToolbarButton = null;\n }\n\n setCommentButtonStates({ selected, hasPopup }) {\n if (!this.#commentStandaloneButton) {\n return;\n }\n this.#commentStandaloneButton.classList.toggle(\"selected\", selected);\n this.#commentStandaloneButton.ariaExpanded = hasPopup;\n }\n\n #render(comment, isStandalone) {\n if (!this.#editor._uiManager.hasCommentManager()) {\n return null;\n }\n\n comment.tabIndex = \"0\";\n comment.ariaHasPopup = \"dialog\";\n\n if (isStandalone) {\n comment.ariaControls = \"commentPopup\";\n comment.setAttribute(\"data-l10n-id\", \"pdfjs-show-comment-button\");\n } else {\n comment.ariaControlsElements = [\n this.#editor._uiManager.getCommentDialogElement(),\n ];\n comment.setAttribute(\"data-l10n-id\", \"pdfjs-editor-add-comment-button\");\n }\n\n const signal = this.#editor._uiManager._signal;\n if (!(signal instanceof AbortSignal) || signal.aborted) {\n return comment;\n }\n\n comment.addEventListener(\"contextmenu\", noContextMenu, { signal });\n if (isStandalone) {\n comment.addEventListener(\n \"focusin\",\n e => {\n this.#editor._focusEventsAllowed = false;\n stopEvent(e);\n },\n {\n capture: true,\n signal,\n }\n );\n comment.addEventListener(\n \"focusout\",\n e => {\n this.#editor._focusEventsAllowed = true;\n stopEvent(e);\n },\n {\n capture: true,\n signal,\n }\n );\n }\n comment.addEventListener(\"pointerdown\", event => event.stopPropagation(), {\n signal,\n });\n\n const onClick = event => {\n event.preventDefault();\n if (comment === this.#commentToolbarButton) {\n this.edit();\n } else {\n this.#editor.toggleComment(/* isSelected = */ true);\n }\n };\n comment.addEventListener(\"click\", onClick, { capture: true, signal });\n comment.addEventListener(\n \"keydown\",\n event => {\n if (event.target === comment && event.key === \"Enter\") {\n this.#commentWasFromKeyBoard = true;\n onClick(event);\n }\n },\n { signal }\n );\n\n comment.addEventListener(\n \"pointerenter\",\n () => {\n this.#editor.toggleComment(\n /* isSelected = */ false,\n /* visibility = */ true\n );\n },\n { signal }\n );\n comment.addEventListener(\n \"pointerleave\",\n () => {\n this.#editor.toggleComment(\n /* isSelected = */ false,\n /* visibility = */ false\n );\n },\n { signal }\n );\n\n return comment;\n }\n\n edit(options) {\n const position = this.commentPopupPositionInLayer;\n let posX, posY;\n if (position) {\n [posX, posY] = position;\n } else {\n // The position is in the editor coordinates.\n [posX, posY] = this.#editor.commentButtonPosition;\n const { width, height, x, y } = this.#editor;\n posX = x + posX * width;\n posY = y + posY * height;\n }\n const parentDimensions = this.#editor.parent.boundingClientRect;\n const {\n x: parentX,\n y: parentY,\n width: parentWidth,\n height: parentHeight,\n } = parentDimensions;\n this.#editor._uiManager.editComment(\n this.#editor,\n parentX + posX * parentWidth,\n parentY + posY * parentHeight,\n { ...options, parentDimensions }\n );\n }\n\n finish() {\n if (!this.#commentToolbarButton) {\n return;\n }\n this.#commentToolbarButton.focus({\n focusVisible: this.#commentWasFromKeyBoard,\n });\n this.#commentWasFromKeyBoard = false;\n }\n\n isDeleted() {\n return this.#deleted || this.#text === \"\";\n }\n\n isEmpty() {\n return this.#text === null;\n }\n\n hasBeenEdited() {\n return this.isDeleted() || this.#text !== this.#initialText;\n }\n\n serialize() {\n return this.data;\n }\n\n get data() {\n return {\n text: this.#text,\n richText: this.#richText,\n date: this.#date,\n deleted: this.isDeleted(),\n };\n }\n\n /**\n * Set the comment data.\n */\n set data(text) {\n if (text !== this.#text) {\n this.#richText = null;\n }\n if (text === null) {\n this.#text = \"\";\n this.#deleted = true;\n return;\n }\n this.#text = text;\n this.#date = new Date();\n this.#deleted = false;\n }\n\n /**\n * Restore the comment data (used for undo).\n * @param {object} data - The comment data to restore.\n * @param {string} data.text - The comment text.\n * @param {string|null} data.richText - The rich text content.\n * @param {Date|null} data.date - The original date.\n */\n restoreData({ text, richText, date }) {\n this.#text = text;\n this.#richText = richText;\n this.#date = date;\n this.#deleted = false;\n }\n\n setInitialText(text, richText = null) {\n this.#initialText = text;\n this.data = text;\n this.#date = null;\n this.#richText = richText;\n }\n\n shown() {}\n\n destroy() {\n this.#commentToolbarButton?.remove();\n this.#commentToolbarButton = null;\n this.#commentStandaloneButton?.remove();\n this.#commentStandaloneButton = null;\n this.#text = \"\";\n this.#richText = null;\n this.#date = null;\n this.#editor = null;\n this.#commentWasFromKeyBoard = false;\n this.#deleted = false;\n }\n}\n\nexport { Comment };\n","/* Copyright 2024 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { OutputScale, stopEvent } from \"./display_utils.js\";\n\nfunction preventDefault(evt) {\n evt.preventDefault();\n}\n\n// Use Gecko's pinch-span epsilon:\n// https://searchfox.org/mozilla-central/source/gfx/layers/apz/src/AsyncPanZoomController.cpp#1775-1788\n// https://searchfox.org/mozilla-central/source/gfx/layers/apz/src/Axis.h#21\nconst MIN_TOUCH_SPAN = 1e-4;\n\n/**\n * @param {TouchEvent} evt\n * @returns {boolean} Whether the event was cancelable.\n */\nfunction stopTouchEvent(evt) {\n if (evt.cancelable) {\n stopEvent(evt);\n return true;\n }\n // `preventDefault()` has no effect; still hide it from an outer manager.\n evt.stopPropagation();\n return false;\n}\n\n/**\n * @typedef {object} TouchManagerOptions\n * @property {HTMLElement | Window} container\n * @property {Function} [isPinchingDisabled]\n * @property {Function} [isPinchingStopped]\n * @property {Function} [onPinchStart]\n * @property {Function} [onPinching] - Called with the previous client\n * midpoint, the previous/current screen distance, and the client midpoint\n * delta.\n * @property {Function} [onPinchEnd]\n * @property {Function} [onPanning] - Called with the client midpoint delta\n * when no scale update is emitted.\n * @property {AbortSignal} signal\n */\n\nclass TouchManager {\n #container;\n\n #isPinching = false;\n\n #isPinchingStopped = null;\n\n #isPinchingDisabled;\n\n #onPinchStart;\n\n #onPinching;\n\n #onPinchEnd;\n\n #onPanning;\n\n #ownsGesture = false;\n\n #pointerDownAC = null;\n\n #signal;\n\n #touchIds = new Set();\n\n #touchInfo = null;\n\n #touchManagerAC;\n\n #touchMoveAC = null;\n\n #unconfirmedPinch = 0;\n\n /**\n * @param {TouchManagerOptions} options\n */\n constructor({\n container,\n isPinchingDisabled = null,\n isPinchingStopped = null,\n onPinchStart = null,\n onPinching = null,\n onPinchEnd = null,\n onPanning = null,\n signal,\n }) {\n this.#container = container;\n this.#isPinchingStopped = isPinchingStopped;\n this.#isPinchingDisabled = isPinchingDisabled;\n this.#onPinchStart = onPinchStart;\n this.#onPinching = onPinching;\n this.#onPinchEnd = onPinchEnd;\n this.#onPanning = onPanning;\n this.#touchManagerAC = new AbortController();\n this.#signal = AbortSignal.any([signal, this.#touchManagerAC.signal]);\n\n container.addEventListener(\"touchstart\", this.#onTouchStart.bind(this), {\n passive: false,\n signal: this.#signal,\n });\n }\n\n /**\n * NOTE: Don't shadow this value since `devicePixelRatio` may change if the\n * window resolution changes, e.g. if the viewer is moved to another monitor.\n */\n get MIN_TOUCH_DISTANCE_TO_PINCH() {\n // The 35 is coming from:\n // https://searchfox.org/mozilla-central/source/gfx/layers/apz/src/GestureEventListener.cpp#36\n //\n // The properties TouchEvent::screenX/Y are in screen CSS pixels:\n // https://developer.mozilla.org/en-US/docs/Web/API/Touch/screenX#examples\n // MIN_TOUCH_DISTANCE_TO_PINCH is in CSS pixels.\n return 35 / OutputScale.pixelRatio;\n }\n\n /**\n * Once pinching, the span must change by at least 4 device pixels to update\n * the scale: below that it's contact jitter (a moving finger is reported\n * with a slight lag and its position is quantized), not an intentional\n * pinch, hence a two-finger pan doesn't make the zoom drift.\n *\n * NOTE: Don't shadow this value since `devicePixelRatio` may change.\n */\n get MIN_TOUCH_DISTANCE_TO_SCALE() {\n return 4 / OutputScale.pixelRatio;\n }\n\n #onTouchStart(evt) {\n if (this.#isPinchingDisabled?.()) {\n return;\n }\n\n this.#pruneTouchIds(evt);\n const touchIds = this.#touchIds;\n for (const { identifier } of evt.changedTouches) {\n touchIds.add(identifier);\n }\n\n if (touchIds.size === 1) {\n this.#armPointerDown();\n return;\n }\n\n if (!this.#touchMoveAC) {\n this.#touchMoveAC = new AbortController();\n const signal = AbortSignal.any([this.#signal, this.#touchMoveAC.signal]);\n const container = this.#container;\n\n const opt = { signal, capture: false, passive: false };\n container.addEventListener(\n \"touchmove\",\n this.#onTouchMove.bind(this),\n opt\n );\n const onTouchEnd = this.#onTouchEnd.bind(this);\n container.addEventListener(\"touchend\", onTouchEnd, opt);\n container.addEventListener(\"touchcancel\", onTouchEnd, opt);\n\n opt.capture = true;\n container.addEventListener(\"pointerdown\", stopEvent, opt);\n container.addEventListener(\"pointermove\", stopEvent, opt);\n // `pointerup` and `pointercancel` are only default-prevented: a\n // `stopPropagation` in the capture phase also skips the bubble-phase\n // listeners of the very node it's called on, hence swallowing them here\n // would prevent any session in flight, e.g. an editor being resized, from\n // ever being ended.\n container.addEventListener(\"pointercancel\", preventDefault, opt);\n container.addEventListener(\"pointerup\", preventDefault, opt);\n this.#onPinchStart?.();\n }\n\n // Cancelability can change during a touch sequence.\n this.#ownsGesture = stopTouchEvent(evt);\n this.#setTouchInfo(evt);\n }\n\n /**\n * Swallow the `pointerdown` of the next finger to land while one is already\n * down on the container.\n *\n * That finger is about to become the second one of a two-finger gesture, so\n * it must neither select anything nor start a session of its own, e.g. an\n * editor drag: the latter listens on `window`, hence the capture-phase\n * listeners which `#touchMoveAC` adds on the container run too late to stop\n * it, and swallowing the `pointerdown` itself is the only chance to.\n */\n #armPointerDown() {\n if (this.#pointerDownAC) {\n return;\n }\n const pointerDownAC = (this.#pointerDownAC = new AbortController());\n const signal = AbortSignal.any([this.#signal, pointerDownAC.signal]);\n const container = this.#container;\n\n // We want to have the events at the capture phase to make sure we can\n // cancel them.\n const opts = { capture: true, signal, passive: false };\n const cancelPointerDown = e => {\n if (e.pointerType === \"touch\") {\n this.#pointerDownAC?.abort();\n this.#pointerDownAC = null;\n }\n };\n container.addEventListener(\n \"pointerdown\",\n e => {\n if (e.pointerType === \"touch\") {\n // This is the second finger so we don't want it select something\n // or whatever.\n stopEvent(e);\n cancelPointerDown(e);\n }\n },\n opts\n );\n container.addEventListener(\"pointerup\", cancelPointerDown, opts);\n container.addEventListener(\"pointercancel\", cancelPointerDown, opts);\n }\n\n /**\n * Drop, from the tracked identifiers, the fingers which are no longer down.\n *\n * `evt.touches` lists every active touch in the document, whereas an element\n * listener only receives events targeted at that element or bubbling from\n * its descendants. Intersect with the document-wide list because an end\n * event for a tracked touch can be stopped before reaching this manager.\n * @param {TouchEvent} evt\n */\n #pruneTouchIds(evt) {\n const previous = this.#touchIds;\n if (previous.size === 0) {\n return;\n }\n const touchIds = (this.#touchIds = new Set());\n for (const { identifier } of evt.touches) {\n if (previous.has(identifier)) {\n touchIds.add(identifier);\n }\n }\n }\n\n /**\n * @param {TouchEvent} evt\n * @returns {Array} The tracked fingers which are still down.\n */\n #getTrackedTouches(evt) {\n const touchIds = this.#touchIds;\n const touches = [];\n for (const touch of evt.touches) {\n if (touchIds.has(touch.identifier)) {\n touches.push(touch);\n }\n }\n return touches;\n }\n\n /**\n * Take the current position of the two tracked fingers as the new baseline.\n *\n * `#isPinching` is deliberately left as it is, and is only reset when the\n * gesture ends: a pinch in progress mustn't have to earn\n * `MIN_TOUCH_DISTANCE_TO_PINCH` all over again because a third finger landed\n * and was lifted.\n * @param {TouchEvent} evt\n */\n #setTouchInfo(evt) {\n const touches = this.#getTrackedTouches(evt);\n if (touches.length !== 2 || this.#isPinchingStopped?.()) {\n this.#touchInfo = null;\n return;\n }\n\n const [touch0, touch1] = touches;\n this.#touchInfo = {\n touch0X: touch0.screenX,\n touch0Y: touch0.screenY,\n touch1X: touch1.screenX,\n touch1Y: touch1.screenY,\n // Distances use screen coordinates; zoom and scrolling use client ones.\n panX: (touch0.clientX + touch1.clientX) / 2,\n panY: (touch0.clientY + touch1.clientY) / 2,\n // Screen-coordinate midpoint used by the sampling allowance.\n screenPanX: (touch0.screenX + touch1.screenX) / 2,\n screenPanY: (touch0.screenY + touch1.screenY) / 2,\n };\n }\n\n #onTouchMove(evt) {\n if (!this.#touchInfo) {\n return;\n }\n const touches = this.#getTrackedTouches(evt);\n if (touches.length !== 2) {\n return;\n }\n\n const wasOwned = this.#ownsGesture;\n this.#ownsGesture = stopTouchEvent(evt);\n if (!this.#ownsGesture) {\n return;\n }\n if (!wasOwned) {\n // Drop movement accumulated while events could not be canceled.\n this.#setTouchInfo(evt);\n return;\n }\n\n const [touch0, touch1] = touches;\n const { screenX: screen0X, screenY: screen0Y } = touch0;\n const { screenX: screen1X, screenY: screen1Y } = touch1;\n const touchInfo = this.#touchInfo;\n const {\n touch0X: pTouch0X,\n touch0Y: pTouch0Y,\n touch1X: pTouch1X,\n touch1Y: pTouch1Y,\n panX: pPanX,\n panY: pPanY,\n } = touchInfo;\n\n const prevGapX = pTouch1X - pTouch0X;\n const prevGapY = pTouch1Y - pTouch0Y;\n const currGapX = screen1X - screen0X;\n const currGapY = screen1Y - screen0Y;\n\n // Advance the panning baseline independently of the pinch threshold.\n const panX = (touch0.clientX + touch1.clientX) / 2;\n const panY = (touch0.clientY + touch1.clientY) / 2;\n touchInfo.panX = panX;\n touchInfo.panY = panY;\n const dx = panX - pPanX;\n const dy = panY - pPanY;\n\n // Measure midpoint motion in the same coordinates as the span.\n const screenPanX = (screen0X + screen1X) / 2;\n const screenPanY = (screen0Y + screen1Y) / 2;\n const translation = Math.hypot(\n screenPanX - touchInfo.screenPanX,\n screenPanY - touchInfo.screenPanY\n );\n touchInfo.screenPanX = screenPanX;\n touchInfo.screenPanY = screenPanY;\n\n const distance = Math.hypot(currGapX, currGapY);\n const pDistance = Math.hypot(prevGapX, prevGapY);\n // Before pinching, moving one contact by d moves the midpoint by d / 2 and\n // changes the span by at most d. Add that sampling allowance to the\n // threshold.\n const minDistance = this.#isPinching\n ? this.MIN_TOUCH_DISTANCE_TO_SCALE\n : this.MIN_TOUCH_DISTANCE_TO_PINCH + 2 * translation;\n if (\n distance < MIN_TOUCH_SPAN ||\n pDistance < MIN_TOUCH_SPAN ||\n Math.abs(pDistance - distance) <= minDistance\n ) {\n // Keep the distance baseline so a slow pinch can cross the threshold, or\n // a degenerate span recover, but the midpoint still moved.\n if (dx || dy) {\n this.#onPanning?.(dx, dy);\n }\n return;\n }\n\n touchInfo.touch0X = screen0X;\n touchInfo.touch0Y = screen0Y;\n touchInfo.touch1X = screen1X;\n touchInfo.touch1Y = screen1Y;\n\n const direction = Math.sign(distance - pDistance);\n\n if (!this.#isPinching) {\n // Start pinching.\n this.#isPinching = true;\n this.#unconfirmedPinch = direction;\n\n // Skip the first scale update, as before, but keep its translation.\n if (dx || dy) {\n this.#onPanning?.(dx, dy);\n }\n return;\n }\n\n if (this.#unconfirmedPinch) {\n const unconfirmed = this.#unconfirmedPinch;\n this.#unconfirmedPinch = 0;\n if (\n direction !== unconfirmed &&\n Math.abs(distance - pDistance) <= 2 * translation\n ) {\n // This reversal matches a lagging contact catching up: its span change\n // is at most twice the midpoint movement. Discard the tentative pinch.\n this.#isPinching = false;\n if (dx || dy) {\n this.#onPanning?.(dx, dy);\n }\n return;\n }\n }\n\n // The distances are in screen CSS pixels, but the origin must be in client\n // coordinates, like the one coming from a wheel event.\n // Zoom around the previous midpoint and apply its movement in the same\n // update. Using the current midpoint would add `(ratio - 1) * delta`.\n this.#onPinching?.([pPanX, pPanY], pDistance, distance, dx, dy);\n }\n\n #onTouchEnd(evt) {\n this.#pruneTouchIds(evt);\n if (this.#touchIds.size >= 2) {\n // Re-evaluate the remaining tracked touches; exactly two form a new\n // baseline.\n this.#setTouchInfo(evt);\n return;\n }\n // Fewer than two tracked touches remain, so this manager's gesture is over;\n // unrelated entries in the document-wide touch list must not keep it alive.\n // Swallow the end only while a two-touch baseline is active.\n const wasTracking = !!this.#touchInfo;\n this.#endGesture();\n\n if (this.#touchIds.size === 1) {\n // A finger which started on the container is still down, so the gesture\n // is back to its one-finger state: the next finger to land must be\n // swallowed again. Without this, lifting one finger of a pinch and\n // putting it back down would let its `pointerdown` through.\n this.#armPointerDown();\n }\n if (wasTracking) {\n stopTouchEvent(evt);\n }\n }\n\n #endGesture() {\n // `#setTouchInfo` may already have cleared the baseline.\n this.#touchInfo = null;\n this.#isPinching = false;\n this.#unconfirmedPinch = 0;\n this.#ownsGesture = false;\n if (this.#touchMoveAC) {\n this.#touchMoveAC.abort();\n this.#touchMoveAC = null;\n this.#onPinchEnd?.();\n }\n }\n\n destroy() {\n this.#endGesture();\n this.#touchIds.clear();\n this.#touchManagerAC?.abort();\n this.#touchManagerAC = null;\n this.#pointerDownAC?.abort();\n this.#pointerDownAC = null;\n }\n}\n\nexport { TouchManager };\n","/* Copyright 2022 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// eslint-disable-next-line max-len\n/** @typedef {import(\"./annotation_editor_layer.js\").AnnotationEditorLayer} AnnotationEditorLayer */\n\nimport {\n AnnotationEditorUIManager,\n bindEvents,\n ColorManager,\n KeyboardManager,\n} from \"./tools.js\";\nimport { FeatureTest, shadow, unreachable } from \"../../shared/util.js\";\nimport { noContextMenu, stopEvent } from \"../display_utils.js\";\nimport { AltText } from \"./alt_text.js\";\nimport { Comment } from \"./comment.js\";\nimport { EditorToolbar } from \"./toolbar.js\";\nimport { MathClamp } from \"../../shared/math_clamp.js\";\nimport { TouchManager } from \"../touch_manager.js\";\n\n/**\n * @typedef {object} AnnotationEditorParameters\n * @property {AnnotationEditorUIManager} uiManager - the global manager\n * @property {AnnotationEditorLayer} parent - the layer containing this editor\n * @property {string} id - editor id\n * @property {number} x - x-coordinate\n * @property {number} y - y-coordinate\n */\n\n/**\n * Base class for editors.\n */\nclass AnnotationEditor {\n #accessibilityData = null;\n\n #allResizerDivs = null;\n\n #altText = null;\n\n #comment = null;\n\n #commentStandaloneButton = null;\n\n #disabled = false;\n\n #dragPointerId = null;\n\n #dragPointerType = \"\";\n\n #resizersDiv = null;\n\n #lastPointerCoords = null;\n\n #savedDimensions = null;\n\n #fakeAnnotation = null;\n\n #focusAC = null;\n\n #focusedResizerName = \"\";\n\n #hasBeenClicked = false;\n\n #initialRect = null;\n\n #isEditing = false;\n\n #isInEditMode = false;\n\n #isResizerEnabledForKeyboard = false;\n\n #moveInDOMTimeout = null;\n\n #prevDragX = 0;\n\n #prevDragY = 0;\n\n #telemetryTimeouts = null;\n\n #touchManager = null;\n\n isSelected = false;\n\n _isCopy = false;\n\n _editToolbar = null;\n\n _initialOptions = Object.create(null);\n\n _initialData = null;\n\n _isVisible = true;\n\n _uiManager = null;\n\n _focusEventsAllowed = true;\n\n static _l10n = null;\n\n static _l10nAlert = null;\n\n static _l10nResizer = null;\n\n #isDraggable = false;\n\n #zIndex = AnnotationEditor._zIndex++;\n\n static _borderLineWidth = -1;\n\n static _colorManager = new ColorManager();\n\n static _zIndex = 1;\n\n // Time to wait (in ms) before sending the telemetry data.\n // We wait a bit to avoid sending too many requests when changing something\n // like the thickness of a line.\n static _telemetryTimeout = 1000;\n\n static get _resizerKeyboardManager() {\n const resize = AnnotationEditor.prototype._resizeWithKeyboard;\n const small = AnnotationEditorUIManager.TRANSLATE_SMALL;\n const big = AnnotationEditorUIManager.TRANSLATE_BIG;\n\n return shadow(\n this,\n \"_resizerKeyboardManager\",\n new KeyboardManager([\n [[\"ArrowLeft\"], resize, { args: [-small, 0] }],\n [\n [\"ctrl+ArrowLeft\", \"mac+shift+ArrowLeft\"],\n resize,\n { args: [-big, 0] },\n ],\n [[\"ArrowRight\"], resize, { args: [small, 0] }],\n [\n [\"ctrl+ArrowRight\", \"mac+shift+ArrowRight\"],\n resize,\n { args: [big, 0] },\n ],\n [[\"ArrowUp\"], resize, { args: [0, -small] }],\n [[\"ctrl+ArrowUp\", \"mac+shift+ArrowUp\"], resize, { args: [0, -big] }],\n [[\"ArrowDown\"], resize, { args: [0, small] }],\n [[\"ctrl+ArrowDown\", \"mac+shift+ArrowDown\"], resize, { args: [0, big] }],\n [[\"Escape\"], AnnotationEditor.prototype._stopResizingWithKeyboard],\n ])\n );\n }\n\n /**\n * @param {AnnotationEditorParameters} parameters\n */\n constructor(parameters) {\n if (\n (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) &&\n this.constructor === AnnotationEditor\n ) {\n unreachable(\"Cannot initialize AnnotationEditor.\");\n }\n\n this.parent = parameters.parent;\n this.id = parameters.id;\n this.width = this.height = null;\n this.pageIndex = parameters.parent.pageIndex;\n this.name = parameters.name;\n this.div = null;\n this._uiManager = parameters.uiManager;\n this.annotationElementId = null;\n this._willKeepAspectRatio = false;\n this._initialOptions.isCentered = parameters.isCentered;\n this._structTreeParentId = null;\n this.annotationElementId = parameters.annotationElementId || null;\n this.creationDate = parameters.creationDate || new Date();\n this.modificationDate = parameters.modificationDate || null;\n this.canAddComment = true;\n\n const {\n rotation,\n rawDims: { pageWidth, pageHeight, pageX, pageY },\n } = this.parent.viewport;\n\n this.rotation = rotation;\n this.pageRotation =\n (360 + rotation - this._uiManager.viewParameters.rotation) % 360;\n this.pageDimensions = [pageWidth, pageHeight];\n this.pageTranslation = [pageX, pageY];\n\n const [width, height] = this.parentDimensions;\n this.x = parameters.x / width;\n this.y = parameters.y / height;\n\n this.isAttachedToDOM = false;\n this.deleted = false;\n }\n\n updatePageIndex(newPageIndex) {\n this.pageIndex = newPageIndex;\n }\n\n get editorType() {\n return Object.getPrototypeOf(this).constructor._type;\n }\n\n get mode() {\n return Object.getPrototypeOf(this).constructor._editorType;\n }\n\n static get isDrawer() {\n return false;\n }\n\n static get _defaultLineColor() {\n return shadow(\n this,\n \"_defaultLineColor\",\n this._colorManager.getHexCode(\"CanvasText\")\n );\n }\n\n static deleteAnnotationElement(editor) {\n const fakeEditor = new FakeEditor({\n id: editor._uiManager.getId(),\n parent: editor.parent,\n uiManager: editor._uiManager,\n });\n fakeEditor.annotationElementId = editor.annotationElementId;\n fakeEditor.deleted = true;\n fakeEditor._uiManager.addToAnnotationStorage(fakeEditor);\n }\n\n /**\n * Initialize the l10n stuff for this type of editor.\n * @param {object} l10n\n */\n static initialize(l10n, _uiManager) {\n AnnotationEditor._l10n ??= l10n;\n\n AnnotationEditor._l10nAlert ??= Object.freeze({\n highlight: \"pdfjs-editor-highlight-added-alert\",\n freetext: \"pdfjs-editor-freetext-added-alert\",\n ink: \"pdfjs-editor-ink-added-alert\",\n stamp: \"pdfjs-editor-stamp-added-alert\",\n signature: \"pdfjs-editor-signature-added-alert\",\n });\n\n AnnotationEditor._l10nResizer ??= Object.freeze({\n topLeft: \"pdfjs-editor-resizer-top-left\",\n topMiddle: \"pdfjs-editor-resizer-top-middle\",\n topRight: \"pdfjs-editor-resizer-top-right\",\n middleRight: \"pdfjs-editor-resizer-middle-right\",\n bottomRight: \"pdfjs-editor-resizer-bottom-right\",\n bottomMiddle: \"pdfjs-editor-resizer-bottom-middle\",\n bottomLeft: \"pdfjs-editor-resizer-bottom-left\",\n middleLeft: \"pdfjs-editor-resizer-middle-left\",\n });\n\n if (AnnotationEditor._borderLineWidth !== -1) {\n return;\n }\n const style = getComputedStyle(document.documentElement);\n AnnotationEditor._borderLineWidth =\n parseFloat(style.getPropertyValue(\"--outline-width\")) || 0;\n }\n\n /**\n * Update the default parameters for this type of editor.\n * @param {number} _type\n * @param {*} _value\n */\n static updateDefaultParams(_type, _value) {}\n\n /**\n * Get the default properties to set in the UI for this type of editor.\n * @returns {Array}\n */\n static get defaultPropertiesToUpdate() {\n return [];\n }\n\n /**\n * Check if this kind of editor is able to handle the given mime type for\n * pasting.\n * @param {string} mime\n * @returns {boolean}\n */\n static isHandlingMimeForPasting(mime) {\n return false;\n }\n\n /**\n * Extract the data from the clipboard item and delegate the creation of the\n * editor to the parent.\n * @param {DataTransferItem} item\n * @param {AnnotationEditorLayer} parent\n */\n static paste(item, parent) {\n unreachable(\"Not implemented\");\n }\n\n /**\n * Get the properties to update in the UI for this editor.\n * @returns {Array}\n */\n get propertiesToUpdate() {\n return [];\n }\n\n get _isDraggable() {\n return this.#isDraggable;\n }\n\n set _isDraggable(value) {\n this.#isDraggable = value;\n this.div?.classList.toggle(\"draggable\", value);\n }\n\n get uid() {\n return this.annotationElementId || this.id;\n }\n\n /**\n * @returns {boolean} true if the editor handles the Enter key itself.\n */\n get isEnterHandled() {\n return true;\n }\n\n center() {\n const [pageWidth, pageHeight] = this.pageDimensions;\n switch (this.parentRotation) {\n case 90:\n this.x -= (this.height * pageHeight) / (pageWidth * 2);\n this.y += (this.width * pageWidth) / (pageHeight * 2);\n break;\n case 180:\n this.x += this.width / 2;\n this.y += this.height / 2;\n break;\n case 270:\n this.x += (this.height * pageHeight) / (pageWidth * 2);\n this.y -= (this.width * pageWidth) / (pageHeight * 2);\n break;\n default:\n this.x -= this.width / 2;\n this.y -= this.height / 2;\n break;\n }\n this.fixAndSetPosition();\n }\n\n /**\n * Add some commands into the CommandManager (undo/redo stuff).\n * @param {object} params\n */\n addCommands(params) {\n this._uiManager.addCommands(params);\n }\n\n get currentLayer() {\n return this._uiManager.currentLayer;\n }\n\n /**\n * This editor will be behind the others.\n */\n setInBackground() {\n this.div.style.zIndex = 0;\n }\n\n /**\n * This editor will be in the foreground.\n */\n setInForeground() {\n this.div.style.zIndex = this.#zIndex;\n }\n\n setParent(parent) {\n if (parent !== null) {\n this.pageIndex = parent.pageIndex;\n this.pageDimensions = parent.pageDimensions;\n } else {\n // The editor is being removed from the DOM, so we need to stop resizing.\n this.#stopResizing();\n\n // Remove the fake annotation in the annotation layer.\n this.#fakeAnnotation?.remove();\n this.#fakeAnnotation = null;\n }\n this.parent = parent;\n }\n\n /**\n * onfocus callback.\n */\n focusin(event) {\n if (!this._focusEventsAllowed) {\n return;\n }\n if (!this.#hasBeenClicked) {\n this.parent.setSelected(this);\n } else {\n this.#hasBeenClicked = false;\n }\n }\n\n /**\n * onblur callback.\n * @param {FocusEvent} event\n */\n focusout(event) {\n if (!this._focusEventsAllowed || !this.isAttachedToDOM) {\n return;\n }\n\n // In case of focusout, the relatedTarget is the element which\n // is grabbing the focus.\n // So if the related target is an element under the div for this\n // editor, then the editor isn't unactive.\n const target = event.relatedTarget;\n if (target?.closest(`#${this.id}`)) {\n return;\n }\n\n event.preventDefault();\n\n if (!this.parent?.isMultipleSelection) {\n this.commitOrRemove();\n }\n }\n\n commitOrRemove() {\n if (this.isEmpty()) {\n this.remove();\n } else {\n this.commit();\n }\n }\n\n /**\n * Commit the data contained in this editor.\n */\n commit() {\n if (!this.isInEditMode()) {\n return;\n }\n this.addToAnnotationStorage();\n }\n\n addToAnnotationStorage() {\n this._uiManager.addToAnnotationStorage(this);\n }\n\n /**\n * Set the editor position within its parent.\n * @param {number} x\n * @param {number} y\n * @param {number} tx - x-translation in screen coordinates.\n * @param {number} ty - y-translation in screen coordinates.\n */\n setAt(x, y, tx, ty) {\n const [width, height] = this.parentDimensions;\n [tx, ty] = this.screenToPageTranslation(tx, ty);\n\n this.x = (x + tx) / width;\n this.y = (y + ty) / height;\n\n this.fixAndSetPosition();\n }\n\n _moveAfterPaste(baseX, baseY) {\n if (this.isClone) {\n delete this.isClone;\n return;\n }\n const [parentWidth, parentHeight] = this.parentDimensions;\n this.setAt(\n baseX * parentWidth,\n baseY * parentHeight,\n this.width * parentWidth,\n this.height * parentHeight\n );\n this._onTranslated();\n }\n\n #translate([width, height], x, y) {\n [x, y] = this.screenToPageTranslation(x, y);\n\n this.x += x / width;\n this.y += y / height;\n\n this._onTranslating(this.x, this.y);\n\n this.fixAndSetPosition();\n }\n\n /**\n * Translate the editor position within its parent.\n * @param {number} x - x-translation in screen coordinates.\n * @param {number} y - y-translation in screen coordinates.\n */\n translate(x, y) {\n // We don't change the initial position because the move here hasn't been\n // done by the user.\n this.#translate(this.parentDimensions, x, y);\n }\n\n /**\n * Translate the editor position within its page and adjust the scroll\n * in order to have the editor in the view.\n * @param {number} x - x-translation in page coordinates.\n * @param {number} y - y-translation in page coordinates.\n */\n translateInPage(x, y) {\n this.#initialRect ||= [this.x, this.y, this.width, this.height];\n this.#translate(this.pageDimensions, x, y);\n this.div.scrollIntoView({ block: \"nearest\" });\n }\n\n translationDone() {\n this._onTranslated(this.x, this.y);\n }\n\n drag(tx, ty) {\n this.#initialRect ||= [this.x, this.y, this.width, this.height];\n const {\n div,\n parentDimensions: [parentWidth, parentHeight],\n } = this;\n this.x += tx / parentWidth;\n this.y += ty / parentHeight;\n if (this.parent && (this.x < 0 || this.x > 1 || this.y < 0 || this.y > 1)) {\n // It's possible to not have a parent: for example, when the user is\n // dragging all the selected editors but this one on a page which has been\n // destroyed.\n // It's why we need to check for it. In such a situation, it isn't really\n // a problem to not find a new parent: it's something which is related to\n // what the user is seeing, hence it depends on how pages are layed out.\n\n // The element will be outside of its parent so change the parent.\n const { x, y } = this.div.getBoundingClientRect();\n if (this.parent.findNewParent(this, x, y)) {\n this.x -= Math.floor(this.x);\n this.y -= Math.floor(this.y);\n }\n }\n\n // The editor can be moved wherever the user wants, so we don't need to fix\n // the position: it'll be done when the user will release the mouse button.\n\n let { x, y } = this;\n const [bx, by] = this.getBaseTranslation();\n x += bx;\n y += by;\n\n const { style } = div;\n style.left = `${(100 * x).toFixed(2)}%`;\n style.top = `${(100 * y).toFixed(2)}%`;\n\n this._onTranslating(x, y);\n }\n\n /**\n * Called when the editor is being translated.\n * @param {number} x - in page coordinates.\n * @param {number} y - in page coordinates.\n */\n _onTranslating(x, y) {}\n\n /**\n * Called when the editor has been translated.\n * @param {number} x - in page coordinates.\n * @param {number} y - in page coordinates.\n */\n _onTranslated(x, y) {}\n\n get _hasBeenMoved() {\n return (\n !!this.#initialRect &&\n (this.#initialRect[0] !== this.x || this.#initialRect[1] !== this.y)\n );\n }\n\n get _hasBeenResized() {\n return (\n !!this.#initialRect &&\n (this.#initialRect[2] !== this.width ||\n this.#initialRect[3] !== this.height)\n );\n }\n\n /**\n * Get the translation to take into account the editor border.\n * The CSS engine positions the element by taking the border into account so\n * we must apply the opposite translation to have the editor in the right\n * position.\n * @returns {Array}\n */\n getBaseTranslation() {\n const [parentWidth, parentHeight] = this.parentDimensions;\n const { _borderLineWidth } = AnnotationEditor;\n const x = _borderLineWidth / parentWidth;\n const y = _borderLineWidth / parentHeight;\n switch (this.rotation) {\n case 90:\n return [-x, y];\n case 180:\n return [x, y];\n case 270:\n return [x, -y];\n default:\n return [-x, -y];\n }\n }\n\n /**\n * @returns {boolean} true if position must be fixed (i.e. make the x and y\n * living in the page).\n */\n get _mustFixPosition() {\n return true;\n }\n\n /**\n * Fix the position of the editor in order to keep it inside its parent page.\n * @param {number} [rotation] - the rotation of the page.\n */\n fixAndSetPosition(rotation = this.rotation) {\n const {\n div: { style },\n pageDimensions: [pageWidth, pageHeight],\n } = this;\n let { x, y, width, height } = this;\n width *= pageWidth;\n height *= pageHeight;\n x *= pageWidth;\n y *= pageHeight;\n\n if (this._mustFixPosition) {\n switch (rotation) {\n case 0:\n x = MathClamp(x, 0, pageWidth - width);\n y = MathClamp(y, 0, pageHeight - height);\n break;\n case 90:\n x = MathClamp(x, 0, pageWidth - height);\n y = MathClamp(y, width, pageHeight);\n break;\n case 180:\n x = MathClamp(x, width, pageWidth);\n y = MathClamp(y, height, pageHeight);\n break;\n case 270:\n x = MathClamp(x, height, pageWidth);\n y = MathClamp(y, 0, pageHeight - width);\n break;\n }\n }\n\n this.x = x /= pageWidth;\n this.y = y /= pageHeight;\n\n const [bx, by] = this.getBaseTranslation();\n x += bx;\n y += by;\n\n style.left = `${(100 * x).toFixed(2)}%`;\n style.top = `${(100 * y).toFixed(2)}%`;\n\n this.moveInDOM();\n }\n\n static #rotatePoint(x, y, angle) {\n switch (angle) {\n case 90:\n return [y, -x];\n case 180:\n return [-x, -y];\n case 270:\n return [-y, x];\n default:\n return [x, y];\n }\n }\n\n /**\n * Convert a screen translation into a page one.\n * @param {number} x\n * @param {number} y\n */\n screenToPageTranslation(x, y) {\n return AnnotationEditor.#rotatePoint(x, y, this.parentRotation);\n }\n\n /**\n * Convert a page translation into a screen one.\n * @param {number} x\n * @param {number} y\n */\n pageTranslationToScreen(x, y) {\n return AnnotationEditor.#rotatePoint(x, y, 360 - this.parentRotation);\n }\n\n #getRotationMatrix(rotation) {\n switch (rotation) {\n case 90: {\n const [pageWidth, pageHeight] = this.pageDimensions;\n return [0, -pageWidth / pageHeight, pageHeight / pageWidth, 0];\n }\n case 180:\n return [-1, 0, 0, -1];\n case 270: {\n const [pageWidth, pageHeight] = this.pageDimensions;\n return [0, pageWidth / pageHeight, -pageHeight / pageWidth, 0];\n }\n default:\n return [1, 0, 0, 1];\n }\n }\n\n get parentScale() {\n return this._uiManager.viewParameters.realScale;\n }\n\n get parentRotation() {\n return (this._uiManager.viewParameters.rotation + this.pageRotation) % 360;\n }\n\n get parentDimensions() {\n const {\n parentScale,\n pageDimensions: [pageWidth, pageHeight],\n } = this;\n return [pageWidth * parentScale, pageHeight * parentScale];\n }\n\n /**\n * Set the dimensions of this editor.\n */\n setDims() {\n const {\n div: { style },\n width,\n height,\n } = this;\n style.width = `${(100 * width).toFixed(2)}%`;\n style.height = `${(100 * height).toFixed(2)}%`;\n }\n\n /**\n * Get the translation used to position this editor when it's created.\n * @returns {Array}\n */\n getInitialTranslation() {\n return [0, 0];\n }\n\n #createResizers() {\n if (this.#resizersDiv) {\n return;\n }\n this.#resizersDiv = document.createElement(\"div\");\n this.#resizersDiv.classList.add(\"resizers\");\n // When the resizers are used with the keyboard, they're focusable, hence\n // we want to have them in this order (top left, top middle, top right, ...)\n // in the DOM to have the focus order correct.\n const classes = this._willKeepAspectRatio\n ? [\"topLeft\", \"topRight\", \"bottomRight\", \"bottomLeft\"]\n : [\n \"topLeft\",\n \"topMiddle\",\n \"topRight\",\n \"middleRight\",\n \"bottomRight\",\n \"bottomMiddle\",\n \"bottomLeft\",\n \"middleLeft\",\n ];\n const signal = this._uiManager._signal;\n for (const name of classes) {\n const div = document.createElement(\"div\");\n this.#resizersDiv.append(div);\n div.classList.add(\"resizer\", name);\n div.setAttribute(\"data-resizer-name\", name);\n div.addEventListener(\n \"pointerdown\",\n this.#resizerPointerdown.bind(this, name),\n { signal }\n );\n div.addEventListener(\"contextmenu\", noContextMenu, { signal });\n div.tabIndex = -1;\n }\n this.div.prepend(this.#resizersDiv);\n }\n\n #resizerPointerdown(name, event) {\n event.preventDefault();\n const { isMac } = FeatureTest.platform;\n if (event.button !== 0 || (event.ctrlKey && isMac)) {\n return;\n }\n\n this.#altText?.toggle(false);\n\n const savedDraggable = this._isDraggable;\n this._isDraggable = false;\n this.#lastPointerCoords = [event.screenX, event.screenY];\n\n const ac = new AbortController();\n const signal = this._uiManager.combinedSignal(ac);\n\n this.parent.togglePointerEvents(false);\n window.addEventListener(\n \"pointermove\",\n this.#resizerPointermove.bind(this, name),\n { passive: true, capture: true, signal }\n );\n window.addEventListener(\n \"touchmove\",\n stopEvent /* Prevent the page from scrolling */,\n { passive: false, signal }\n );\n window.addEventListener(\"contextmenu\", noContextMenu, { signal });\n this.#savedDimensions = {\n savedX: this.x,\n savedY: this.y,\n savedWidth: this.width,\n savedHeight: this.height,\n };\n const savedParentCursor = this.parent.div.style.cursor;\n const savedCursor = this.div.style.cursor;\n this.div.style.cursor = this.parent.div.style.cursor =\n window.getComputedStyle(event.target).cursor;\n\n const pointerUpCallback = () => {\n ac.abort();\n this.parent.togglePointerEvents(true);\n this.#altText?.toggle(true);\n this._isDraggable = savedDraggable;\n this.parent.div.style.cursor = savedParentCursor;\n this.div.style.cursor = savedCursor;\n\n this.#addResizeToUndoStack();\n };\n window.addEventListener(\"pointerup\", pointerUpCallback, { signal });\n // If the user switches to another window (with alt+tab), then we end the\n // resize session.\n window.addEventListener(\"blur\", pointerUpCallback, { signal });\n }\n\n #resize(x, y, width, height) {\n this.width = width;\n this.height = height;\n this.x = x;\n this.y = y;\n this.setDims();\n this.fixAndSetPosition();\n this._onResized();\n }\n\n /**\n * Called when the editor has been resized.\n */\n _onResized() {}\n\n #addResizeToUndoStack() {\n if (!this.#savedDimensions) {\n return;\n }\n const { savedX, savedY, savedWidth, savedHeight } = this.#savedDimensions;\n this.#savedDimensions = null;\n\n const newX = this.x;\n const newY = this.y;\n const newWidth = this.width;\n const newHeight = this.height;\n if (\n newX === savedX &&\n newY === savedY &&\n newWidth === savedWidth &&\n newHeight === savedHeight\n ) {\n return;\n }\n\n this.addCommands({\n cmd: this.#resize.bind(this, newX, newY, newWidth, newHeight),\n undo: this.#resize.bind(this, savedX, savedY, savedWidth, savedHeight),\n mustExec: true,\n });\n }\n\n static _round(x) {\n // 10000 because we multiply by 100 and use toFixed(2) in fixAndSetPosition.\n // Without rounding, the positions of the corners other than the top left\n // one can be slightly wrong.\n return Math.round(x * 10000) / 10000;\n }\n\n #resizerPointermove(name, event) {\n const [parentWidth, parentHeight] = this.parentDimensions;\n const savedX = this.x;\n const savedY = this.y;\n const savedWidth = this.width;\n const savedHeight = this.height;\n const minWidth = AnnotationEditor.MIN_SIZE / parentWidth;\n const minHeight = AnnotationEditor.MIN_SIZE / parentHeight;\n\n const rotationMatrix = this.#getRotationMatrix(this.rotation);\n const transf = (x, y) => [\n rotationMatrix[0] * x + rotationMatrix[2] * y,\n rotationMatrix[1] * x + rotationMatrix[3] * y,\n ];\n const invRotationMatrix = this.#getRotationMatrix(360 - this.rotation);\n const invTransf = (x, y) => [\n invRotationMatrix[0] * x + invRotationMatrix[2] * y,\n invRotationMatrix[1] * x + invRotationMatrix[3] * y,\n ];\n let getPoint;\n let getOpposite;\n let isDiagonal = false;\n let isHorizontal = false;\n\n switch (name) {\n case \"topLeft\":\n isDiagonal = true;\n getPoint = (w, h) => [0, 0];\n getOpposite = (w, h) => [w, h];\n break;\n case \"topMiddle\":\n getPoint = (w, h) => [w / 2, 0];\n getOpposite = (w, h) => [w / 2, h];\n break;\n case \"topRight\":\n isDiagonal = true;\n getPoint = (w, h) => [w, 0];\n getOpposite = (w, h) => [0, h];\n break;\n case \"middleRight\":\n isHorizontal = true;\n getPoint = (w, h) => [w, h / 2];\n getOpposite = (w, h) => [0, h / 2];\n break;\n case \"bottomRight\":\n isDiagonal = true;\n getPoint = (w, h) => [w, h];\n getOpposite = (w, h) => [0, 0];\n break;\n case \"bottomMiddle\":\n getPoint = (w, h) => [w / 2, h];\n getOpposite = (w, h) => [w / 2, 0];\n break;\n case \"bottomLeft\":\n isDiagonal = true;\n getPoint = (w, h) => [0, h];\n getOpposite = (w, h) => [w, 0];\n break;\n case \"middleLeft\":\n isHorizontal = true;\n getPoint = (w, h) => [0, h / 2];\n getOpposite = (w, h) => [w, h / 2];\n break;\n }\n\n const point = getPoint(savedWidth, savedHeight);\n const oppositePoint = getOpposite(savedWidth, savedHeight);\n let transfOppositePoint = transf(...oppositePoint);\n const oppositeX = AnnotationEditor._round(savedX + transfOppositePoint[0]);\n const oppositeY = AnnotationEditor._round(savedY + transfOppositePoint[1]);\n let ratioX = 1;\n let ratioY = 1;\n\n let deltaX, deltaY;\n\n if (!event.fromKeyboard) {\n // We can't use event.movementX/Y because they're not reliable:\n // https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/movementX\n // (it was buggy on a laptop with a touch screen).\n const { screenX, screenY } = event;\n const [lastScreenX, lastScreenY] = this.#lastPointerCoords;\n [deltaX, deltaY] = this.screenToPageTranslation(\n screenX - lastScreenX,\n screenY - lastScreenY\n );\n this.#lastPointerCoords[0] = screenX;\n this.#lastPointerCoords[1] = screenY;\n } else {\n ({ deltaX, deltaY } = event);\n }\n [deltaX, deltaY] = invTransf(deltaX / parentWidth, deltaY / parentHeight);\n\n if (isDiagonal) {\n const oldDiag = Math.hypot(savedWidth, savedHeight);\n ratioX = ratioY = Math.max(\n Math.min(\n Math.hypot(\n oppositePoint[0] - point[0] - deltaX,\n oppositePoint[1] - point[1] - deltaY\n ) / oldDiag,\n // Avoid the editor to be larger than the page.\n 1 / savedWidth,\n 1 / savedHeight\n ),\n // Avoid the editor to be smaller than the minimum size.\n minWidth / savedWidth,\n minHeight / savedHeight\n );\n } else if (isHorizontal) {\n ratioX =\n MathClamp(Math.abs(oppositePoint[0] - point[0] - deltaX), minWidth, 1) /\n savedWidth;\n } else {\n ratioY =\n MathClamp(\n Math.abs(oppositePoint[1] - point[1] - deltaY),\n minHeight,\n 1\n ) / savedHeight;\n }\n\n const newWidth = AnnotationEditor._round(savedWidth * ratioX);\n const newHeight = AnnotationEditor._round(savedHeight * ratioY);\n transfOppositePoint = transf(...getOpposite(newWidth, newHeight));\n const newX = oppositeX - transfOppositePoint[0];\n const newY = oppositeY - transfOppositePoint[1];\n\n this.#initialRect ||= [this.x, this.y, this.width, this.height];\n this.width = newWidth;\n this.height = newHeight;\n this.x = newX;\n this.y = newY;\n\n this.setDims();\n this.fixAndSetPosition();\n\n this._onResizing();\n }\n\n /**\n * Called when the editor is being resized.\n */\n _onResizing() {}\n\n /**\n * Called when the alt text dialog is closed.\n */\n altTextFinish() {\n this.#altText?.finish();\n }\n\n /**\n * Get the toolbar buttons for this editor.\n * @returns {Array>|null}\n */\n get toolbarButtons() {\n return null;\n }\n\n /**\n * Add a toolbar for this editor.\n * @returns {Promise}\n */\n async addEditToolbar() {\n if (this._editToolbar || this.#isInEditMode) {\n return this._editToolbar;\n }\n this._editToolbar = new EditorToolbar(this);\n this.div.append(this._editToolbar.render());\n const { toolbarButtons } = this;\n if (toolbarButtons) {\n for (const [name, tool] of toolbarButtons) {\n await this._editToolbar.addButton(name, tool);\n }\n }\n if (!this.hasComment) {\n this._editToolbar.addButton(\"comment\", this.addCommentButton());\n }\n this._editToolbar.addButton(\"delete\");\n\n return this._editToolbar;\n }\n\n addCommentButtonInToolbar() {\n this._editToolbar?.addButtonBefore(\n \"comment\",\n this.addCommentButton(),\n \".deleteButton\"\n );\n }\n\n removeCommentButtonFromToolbar() {\n this._editToolbar?.removeButton(\"comment\");\n }\n\n removeEditToolbar() {\n this._editToolbar?.remove();\n this._editToolbar = null;\n\n // We destroy the alt text but we don't null it because we want to be able\n // to restore it in case the user undoes the deletion.\n this.#altText?.destroy();\n }\n\n addContainer(container) {\n const editToolbarDiv = this._editToolbar?.div;\n if (editToolbarDiv) {\n editToolbarDiv.before(container);\n } else {\n this.div.append(container);\n }\n }\n\n getClientDimensions() {\n return this.div.getBoundingClientRect();\n }\n\n /**\n * Create the alt text for this editor.\n * @returns {object}\n */\n createAltText() {\n if (!this.#altText) {\n AltText.initialize(AnnotationEditor._l10n);\n this.#altText = new AltText(this);\n if (this.#accessibilityData) {\n this.#altText.data = this.#accessibilityData;\n this.#accessibilityData = null;\n }\n }\n return this.#altText;\n }\n\n get altTextData() {\n return this.#altText?.data;\n }\n\n /**\n * Set the alt text data.\n */\n set altTextData(data) {\n if (!this.#altText) {\n return;\n }\n this.#altText.data = data;\n }\n\n get guessedAltText() {\n return this.#altText?.guessedText;\n }\n\n async setGuessedAltText(text) {\n await this.#altText?.setGuessedText(text);\n }\n\n serializeAltText(isForCopying) {\n return this.#altText?.serialize(isForCopying);\n }\n\n hasAltText() {\n return !!this.#altText && !this.#altText.isEmpty();\n }\n\n hasAltTextData() {\n return this.#altText?.hasData() ?? false;\n }\n\n focusCommentButton() {\n this.#comment?.focusButton();\n }\n\n addCommentButton() {\n return this.canAddComment ? (this.#comment ||= new Comment(this)) : null;\n }\n\n addStandaloneCommentButton() {\n if (!this._uiManager.hasCommentManager()) {\n return;\n }\n if (this.#commentStandaloneButton) {\n if (this._uiManager.isEditingMode()) {\n this.#commentStandaloneButton.classList.remove(\"hidden\");\n }\n return;\n }\n if (!this.hasComment) {\n return;\n }\n this.#commentStandaloneButton = this.#comment.renderForStandalone();\n this.div.append(this.#commentStandaloneButton);\n }\n\n removeStandaloneCommentButton() {\n this.#comment.removeStandaloneCommentButton();\n this.#commentStandaloneButton = null;\n }\n\n hideStandaloneCommentButton() {\n this.#commentStandaloneButton?.classList.add(\"hidden\");\n }\n\n get comment() {\n if (!this.#comment) {\n return null;\n }\n const {\n data: { richText, text, date, deleted },\n } = this.#comment;\n return {\n text,\n richText,\n date,\n deleted,\n color: this.getNonHCMColor(),\n opacity: this.opacity ?? 1,\n };\n }\n\n set comment(value) {\n this.#comment ||= new Comment(this);\n if (typeof value === \"object\" && value !== null) {\n // Restore full comment data (used for undo).\n this.#comment.restoreData(value);\n } else {\n this.#comment.data = value;\n }\n if (this.hasComment) {\n this.removeCommentButtonFromToolbar();\n this.addStandaloneCommentButton();\n this._uiManager.updateComment(this);\n } else {\n this.addCommentButtonInToolbar();\n this.removeStandaloneCommentButton();\n this._uiManager.removeComment(this);\n }\n }\n\n setCommentData({ comment, popupRef, richText }) {\n if (!popupRef) {\n return;\n }\n this.#comment ||= new Comment(this);\n this.#comment.setInitialText(comment, richText);\n\n if (!this.annotationElementId) {\n return;\n }\n const storedData = this._uiManager.getAndRemoveDataFromAnnotationStorage(\n this.annotationElementId\n );\n if (storedData) {\n this.updateFromAnnotationLayer(storedData);\n }\n }\n\n get hasEditedComment() {\n return this.#comment?.hasBeenEdited();\n }\n\n get hasDeletedComment() {\n return this.#comment?.isDeleted();\n }\n\n get hasComment() {\n return (\n !!this.#comment && !this.#comment.isEmpty() && !this.#comment.isDeleted()\n );\n }\n\n async editComment(options) {\n this.#comment ||= new Comment(this);\n this.#comment.edit(options);\n }\n\n toggleComment(isSelected, visibility = undefined) {\n if (this.hasComment) {\n this._uiManager.toggleComment(this, isSelected, visibility);\n }\n }\n\n setSelectedCommentButton(selected) {\n this.#comment.setSelectedButton(selected);\n }\n\n addComment(serialized) {\n if (this.hasEditedComment) {\n const DEFAULT_POPUP_WIDTH = 180;\n const DEFAULT_POPUP_HEIGHT = 100;\n const [, , , trY] = serialized.rect;\n const [pageWidth] = this.pageDimensions;\n const [pageX] = this.pageTranslation;\n const blX = pageX + pageWidth + 1;\n const blY = trY - DEFAULT_POPUP_HEIGHT;\n const trX = blX + DEFAULT_POPUP_WIDTH;\n serialized.popup = {\n contents: this.comment.text,\n deleted: this.comment.deleted,\n rect: [blX, blY, trX, trY],\n };\n }\n }\n\n updateFromAnnotationLayer({ popup: { contents, deleted } }) {\n this.#comment.data = deleted ? null : contents;\n }\n\n get parentBoundingClientRect() {\n return this.parent.boundingClientRect;\n }\n\n /**\n * Render this editor in a div.\n * @returns {HTMLDivElement | null}\n */\n render() {\n const div = (this.div = document.createElement(\"div\"));\n div.setAttribute(\"data-editor-rotation\", (360 - this.rotation) % 360);\n div.className = this.name;\n div.setAttribute(\"id\", this.id);\n div.tabIndex = this.#disabled ? -1 : 0;\n div.setAttribute(\"role\", \"application\");\n if (this.defaultL10nId) {\n div.setAttribute(\"data-l10n-id\", this.defaultL10nId);\n }\n if (!this._isVisible) {\n div.classList.add(\"hidden\");\n }\n\n this.setInForeground();\n this.#addFocusListeners();\n\n const [parentWidth, parentHeight] = this.parentDimensions;\n if (this.parentRotation % 180 !== 0) {\n div.style.maxWidth = `${((100 * parentHeight) / parentWidth).toFixed(\n 2\n )}%`;\n div.style.maxHeight = `${((100 * parentWidth) / parentHeight).toFixed(\n 2\n )}%`;\n }\n\n const [tx, ty] = this.getInitialTranslation();\n this.translate(tx, ty);\n\n bindEvents(this, div, [\"keydown\", \"pointerdown\", \"dblclick\"]);\n\n this.#addTouchManager();\n\n this.addStandaloneCommentButton();\n this._uiManager._editorUndoBar?.hide();\n\n return div;\n }\n\n #touchPinchStartCallback() {\n this.#savedDimensions = {\n savedX: this.x,\n savedY: this.y,\n savedWidth: this.width,\n savedHeight: this.height,\n };\n this.#altText?.toggle(false);\n this.parent.togglePointerEvents(false);\n }\n\n #touchPinchCallback(_origin, prevDistance, distance) {\n // Slightly slow down the zooming because the editor could be small and the\n // user could have difficulties to rescale it as they want.\n const slowDownFactor = 0.7;\n let factor =\n slowDownFactor * (distance / prevDistance) + 1 - slowDownFactor;\n if (factor === 1) {\n return;\n }\n\n const rotationMatrix = this.#getRotationMatrix(this.rotation);\n const transf = (x, y) => [\n rotationMatrix[0] * x + rotationMatrix[2] * y,\n rotationMatrix[1] * x + rotationMatrix[3] * y,\n ];\n\n // The center of the editor is the fixed point.\n const [parentWidth, parentHeight] = this.parentDimensions;\n const savedX = this.x;\n const savedY = this.y;\n const savedWidth = this.width;\n const savedHeight = this.height;\n\n const minWidth = AnnotationEditor.MIN_SIZE / parentWidth;\n const minHeight = AnnotationEditor.MIN_SIZE / parentHeight;\n factor = Math.max(\n Math.min(factor, 1 / savedWidth, 1 / savedHeight),\n minWidth / savedWidth,\n minHeight / savedHeight\n );\n const newWidth = AnnotationEditor._round(savedWidth * factor);\n const newHeight = AnnotationEditor._round(savedHeight * factor);\n if (newWidth === savedWidth && newHeight === savedHeight) {\n return;\n }\n\n this.#initialRect ||= [savedX, savedY, savedWidth, savedHeight];\n const transfCenterPoint = transf(savedWidth / 2, savedHeight / 2);\n const centerX = AnnotationEditor._round(savedX + transfCenterPoint[0]);\n const centerY = AnnotationEditor._round(savedY + transfCenterPoint[1]);\n const newTransfCenterPoint = transf(newWidth / 2, newHeight / 2);\n\n this.x = centerX - newTransfCenterPoint[0];\n this.y = centerY - newTransfCenterPoint[1];\n this.width = newWidth;\n this.height = newHeight;\n\n this.setDims();\n this.fixAndSetPosition();\n\n this._onResizing();\n }\n\n #touchPinchEndCallback() {\n this.#altText?.toggle(true);\n this.parent.togglePointerEvents(true);\n this.#addResizeToUndoStack();\n }\n\n /**\n * Onpointerdown callback.\n * @param {PointerEvent} event\n */\n pointerdown(event) {\n const { isMac } = FeatureTest.platform;\n if (event.button !== 0 || (event.ctrlKey && isMac)) {\n // Avoid to focus this editor because of a non-left click.\n event.preventDefault();\n return;\n }\n this.#hasBeenClicked = true;\n\n if (this._isDraggable) {\n this.#setUpDragSession(event);\n return;\n }\n\n this.#selectOnPointerEvent(event);\n }\n\n #selectOnPointerEvent(event) {\n const { isMac } = FeatureTest.platform;\n if (\n (event.ctrlKey && !isMac) ||\n event.shiftKey ||\n (event.metaKey && isMac)\n ) {\n this.parent.toggleSelected(this);\n } else {\n this.parent.setSelected(this);\n }\n }\n\n #setUpDragSession(event) {\n const { isSelected } = this;\n this._uiManager.setUpDragSession();\n let hasDraggingStarted = false;\n\n const ac = new AbortController();\n const signal = this._uiManager.combinedSignal(ac);\n const opts = { capture: true, passive: false, signal };\n const cancelDrag = e => {\n ac.abort();\n\n this.#dragPointerId = null;\n this.#hasBeenClicked = false;\n if (!this._uiManager.endDragSession()) {\n this.#selectOnPointerEvent(e);\n }\n if (hasDraggingStarted) {\n this._onStopDragging();\n }\n };\n\n if (isSelected) {\n this.#prevDragX = event.clientX;\n this.#prevDragY = event.clientY;\n this.#dragPointerId = event.pointerId;\n this.#dragPointerType = event.pointerType;\n window.addEventListener(\n \"pointermove\",\n e => {\n if (!hasDraggingStarted) {\n hasDraggingStarted = true;\n this._uiManager.toggleComment(\n this,\n /* isSelected = */ true,\n /* visibility = */ false\n );\n this._onStartDragging();\n }\n const { clientX: x, clientY: y, pointerId } = e;\n if (pointerId !== this.#dragPointerId) {\n stopEvent(e);\n return;\n }\n const [tx, ty] = this.screenToPageTranslation(\n x - this.#prevDragX,\n y - this.#prevDragY\n );\n this.#prevDragX = x;\n this.#prevDragY = y;\n this._uiManager.dragSelectedEditors(tx, ty);\n // Keep the editor where the drag started in view. Calling\n // `scrollIntoView` here does it once per handled pointermove, after\n // `dragSelectedEditors` has moved the selection, rather than once\n // from every selected editor's `drag` method.\n this.div.scrollIntoView({ block: \"nearest\" });\n },\n opts\n );\n window.addEventListener(\n \"touchmove\",\n stopEvent /* Prevent the page from scrolling */,\n opts\n );\n window.addEventListener(\n \"pointerdown\",\n // If the user drags with one finger and then clicks with another.\n e => {\n if (e.pointerType === this.#dragPointerType) {\n // We've a pinch to zoom session.\n // We cannot have two primaries at the same time.\n // It's possible to be in this state with Firefox and Gnome when\n // trying to drag with three fingers (see bug 1933716).\n if (this.#touchManager || e.isPrimary) {\n cancelDrag(e);\n }\n }\n stopEvent(e);\n },\n opts\n );\n }\n\n const pointerUpCallback = e => {\n if (!this.#dragPointerId || this.#dragPointerId === e.pointerId) {\n cancelDrag(e);\n return;\n }\n stopEvent(e);\n };\n window.addEventListener(\"pointerup\", pointerUpCallback, { signal });\n // If the user is using alt+tab during the dragging session, the pointerup\n // event could be not fired, but a blur event is fired so we can use it in\n // order to interrupt the dragging session.\n window.addEventListener(\"blur\", pointerUpCallback, { signal });\n }\n\n _onStartDragging() {}\n\n _onStopDragging() {}\n\n moveInDOM() {\n // Moving the editor in the DOM can be expensive, so we wait a bit before.\n // It's important to not block the UI (for example when changing the font\n // size in a FreeText).\n if (this.#moveInDOMTimeout) {\n clearTimeout(this.#moveInDOMTimeout);\n }\n this.#moveInDOMTimeout = setTimeout(() => {\n this.#moveInDOMTimeout = null;\n this.parent?.moveEditorInDOM(this);\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"TESTING\")) {\n this._uiManager._eventBus.dispatch(\"editormovedindom\", {\n source: this,\n });\n }\n }, 0);\n }\n\n _setParentAndPosition(parent, x, y) {\n parent.changeParent(this);\n this.x = x;\n this.y = y;\n this.fixAndSetPosition();\n this._onTranslated();\n }\n\n /**\n * Convert the current rect into a page one.\n * @param {number} tx - x-translation in screen coordinates.\n * @param {number} ty - y-translation in screen coordinates.\n * @param {number} [rotation] - the rotation of the page.\n */\n getRect(tx, ty, rotation = this.rotation) {\n const scale = this.parentScale;\n const [pageWidth, pageHeight] = this.pageDimensions;\n const [pageX, pageY] = this.pageTranslation;\n const shiftX = tx / scale;\n const shiftY = ty / scale;\n const x = this.x * pageWidth;\n const y = this.y * pageHeight;\n const width = this.width * pageWidth;\n const height = this.height * pageHeight;\n\n switch (rotation) {\n case 0:\n return [\n x + shiftX + pageX,\n pageHeight - y - shiftY - height + pageY,\n x + shiftX + width + pageX,\n pageHeight - y - shiftY + pageY,\n ];\n case 90:\n return [\n x + shiftY + pageX,\n pageHeight - y + shiftX + pageY,\n x + shiftY + height + pageX,\n pageHeight - y + shiftX + width + pageY,\n ];\n case 180:\n return [\n x - shiftX - width + pageX,\n pageHeight - y + shiftY + pageY,\n x - shiftX + pageX,\n pageHeight - y + shiftY + height + pageY,\n ];\n case 270:\n return [\n x - shiftY - height + pageX,\n pageHeight - y - shiftX - width + pageY,\n x - shiftY + pageX,\n pageHeight - y - shiftX + pageY,\n ];\n default:\n throw new Error(\"Invalid rotation\");\n }\n }\n\n getRectInCurrentCoords(rect, pageHeight) {\n const [x1, y1, x2, y2] = rect;\n\n const width = x2 - x1;\n const height = y2 - y1;\n\n switch (this.rotation) {\n case 0:\n return [x1, pageHeight - y2, width, height];\n case 90:\n return [x1, pageHeight - y1, height, width];\n case 180:\n return [x2, pageHeight - y1, width, height];\n case 270:\n return [x2, pageHeight - y2, height, width];\n default:\n throw new Error(\"Invalid rotation\");\n }\n }\n\n /**\n * Get the rect in page coordinates without any translation.\n * It's used when serializing the editor.\n * @returns {Array}\n */\n getPDFRect() {\n return this.getRect(0, 0);\n }\n\n getNonHCMColor() {\n return (\n this.color &&\n AnnotationEditor._colorManager.convert(\n this._uiManager.getNonHCMColor(this.color)\n )\n );\n }\n\n /**\n * The color has been changed.\n */\n onUpdatedColor() {\n this.#comment?.onUpdatedColor();\n }\n\n getData() {\n const {\n comment: { text: str, color, date, opacity, deleted, richText },\n uid: id,\n pageIndex,\n creationDate,\n modificationDate,\n } = this;\n return {\n id,\n pageIndex,\n rect: this.getPDFRect(),\n richText,\n contentsObj: { str },\n creationDate,\n modificationDate: date || modificationDate,\n popupRef: !deleted,\n color,\n opacity,\n };\n }\n\n /**\n * Executed once this editor has been rendered.\n * @param {boolean} focus - true if the editor should be focused.\n */\n onceAdded(focus) {}\n\n /**\n * Check if the editor contains something.\n * @returns {boolean}\n */\n isEmpty() {\n return false;\n }\n\n /**\n * Enable edit mode.\n * @returns {boolean} - true if the edit mode has been enabled.\n */\n enableEditMode() {\n if (this.isInEditMode()) {\n return false;\n }\n this.parent.setEditingState(false);\n this.#isInEditMode = true;\n\n return true;\n }\n\n /**\n * Disable edit mode.\n * @returns {boolean} - true if the edit mode has been disabled.\n */\n disableEditMode() {\n if (!this.isInEditMode()) {\n return false;\n }\n this.parent.setEditingState(true);\n this.#isInEditMode = false;\n\n return true;\n }\n\n /**\n * Check if the editor is edited.\n * @returns {boolean}\n */\n isInEditMode() {\n return this.#isInEditMode;\n }\n\n /**\n * If it returns true, then this editor handles the keyboard\n * events itself.\n * @returns {boolean}\n */\n shouldGetKeyboardEvents() {\n return this.#isResizerEnabledForKeyboard;\n }\n\n /**\n * Check if this editor needs to be rebuilt or not.\n * @returns {boolean}\n */\n needsToBeRebuilt() {\n return this.div && !this.isAttachedToDOM;\n }\n\n get isOnScreen() {\n const { top, left, bottom, right } = this.getClientDimensions();\n const { innerHeight, innerWidth } = window;\n return left < innerWidth && right > 0 && top < innerHeight && bottom > 0;\n }\n\n #addFocusListeners() {\n if (this.#focusAC || !this.div) {\n return;\n }\n this.#focusAC = new AbortController();\n const signal = this._uiManager.combinedSignal(this.#focusAC);\n\n this.div.addEventListener(\"focusin\", this.focusin.bind(this), { signal });\n this.div.addEventListener(\"focusout\", this.focusout.bind(this), { signal });\n }\n\n #addTouchManager() {\n if (\n this.#touchManager ||\n !this.div ||\n !this.isResizable ||\n !this._uiManager._supportsPinchToZoom\n ) {\n return;\n }\n this.#touchManager = new TouchManager({\n container: this.div,\n isPinchingDisabled: () => !this.isSelected,\n onPinchStart: this.#touchPinchStartCallback.bind(this),\n onPinching: this.#touchPinchCallback.bind(this),\n onPinchEnd: this.#touchPinchEndCallback.bind(this),\n signal: this._uiManager._signal,\n });\n }\n\n /**\n * Rebuild the editor in case it has been removed on undo.\n *\n * To implement in subclasses.\n */\n rebuild() {\n this.#addFocusListeners();\n this.#addTouchManager();\n }\n\n /**\n * Rotate the editor when the page is rotated.\n * @param {number} _angle\n */\n rotate(_angle) {}\n\n /**\n * Resize the editor when the page is resized.\n */\n resize() {}\n\n /**\n * Serialize the editor when it has been deleted.\n * @returns {object}\n */\n serializeDeleted() {\n return {\n id: this.annotationElementId,\n deleted: true,\n pageIndex: this.pageIndex,\n popupRef: this._initialData?.popupRef || \"\",\n };\n }\n\n /**\n * Serialize the editor.\n * The result of the serialization will be used to construct a\n * new annotation to add to the pdf document.\n *\n * To implement in subclasses.\n * @param {boolean} [isForCopying]\n * @param {object | null} [context]\n * @returns {object | null}\n */\n serialize(isForCopying = false, context = null) {\n return {\n annotationType: this.mode,\n pageIndex: this.pageIndex,\n rect: this.getPDFRect(),\n rotation: this.rotation,\n structTreeParentId: this._structTreeParentId,\n popupRef: this._initialData?.popupRef || \"\",\n };\n }\n\n /**\n * Deserialize the editor.\n * The result of the deserialization is a new editor.\n * @param {object} data\n * @param {AnnotationEditorLayer} parent\n * @param {AnnotationEditorUIManager} uiManager\n * @returns {Promise}\n */\n static async deserialize(data, parent, uiManager) {\n const editor = new this.prototype.constructor({\n parent,\n id: uiManager.getId(),\n uiManager,\n annotationElementId: data.annotationElementId,\n creationDate: data.creationDate,\n modificationDate: data.modificationDate,\n });\n editor.rotation = data.rotation;\n editor.#accessibilityData = data.accessibilityData;\n editor._isCopy = data.isCopy || false;\n\n const [pageWidth, pageHeight] = editor.pageDimensions;\n const [x, y, width, height] = editor.getRectInCurrentCoords(\n data.rect,\n pageHeight\n );\n\n editor.x = x / pageWidth;\n editor.y = y / pageHeight;\n editor.width = width / pageWidth;\n editor.height = height / pageHeight;\n\n return editor;\n }\n\n /**\n * Check if an existing annotation associated with this editor has been\n * modified.\n * @returns {boolean}\n */\n get hasBeenModified() {\n return (\n !!this.annotationElementId && (this.deleted || this.serialize() !== null)\n );\n }\n\n /**\n * Remove this editor.\n * It's used on ctrl+backspace action.\n */\n remove() {\n this.#focusAC?.abort();\n this.#focusAC = null;\n\n if (!this.isEmpty()) {\n // The editor is removed but it can be back at some point thanks to\n // undo/redo so we must commit it before.\n this.commit();\n }\n // End an active pinch before detaching: its callback uses `parent` and\n // records the resize.\n this.#touchManager?.destroy();\n this.#touchManager = null;\n\n if (this.parent) {\n this.parent.remove(this);\n } else {\n this._uiManager.removeEditor(this);\n }\n this.hideCommentPopup();\n\n if (this.#moveInDOMTimeout) {\n clearTimeout(this.#moveInDOMTimeout);\n this.#moveInDOMTimeout = null;\n }\n this.#stopResizing();\n this.removeEditToolbar();\n if (this.#telemetryTimeouts) {\n for (const timeout of this.#telemetryTimeouts.values()) {\n clearTimeout(timeout);\n }\n this.#telemetryTimeouts = null;\n }\n this.parent = null;\n this.#fakeAnnotation?.remove();\n this.#fakeAnnotation = null;\n }\n\n /**\n * @returns {boolean} true if this editor can be resized.\n */\n get isResizable() {\n return false;\n }\n\n /**\n * Add the resizers to this editor.\n */\n makeResizable() {\n if (this.isResizable) {\n this.#createResizers();\n this.#resizersDiv.classList.remove(\"hidden\");\n }\n }\n\n /**\n * @returns {Array|null}\n */\n get toolbarPosition() {\n return null;\n }\n\n /**\n * Get the position of the comment button.\n * @returns {Array|null}\n */\n get commentButtonPosition() {\n return this._uiManager.direction === \"ltr\" ? [1, 0] : [0, 0];\n }\n\n get commentButtonPositionInPage() {\n const {\n commentButtonPosition: [posX, posY],\n } = this;\n const [blX, blY, trX, trY] = this.getPDFRect();\n return [\n AnnotationEditor._round(blX + (trX - blX) * posX),\n AnnotationEditor._round(blY + (trY - blY) * (1 - posY)),\n ];\n }\n\n get commentButtonColor() {\n return this._uiManager.makeCommentColor(\n this.getNonHCMColor(),\n this.opacity\n );\n }\n\n get commentPopupPosition() {\n return this.#comment.commentPopupPositionInLayer;\n }\n\n set commentPopupPosition(pos) {\n this.#comment.commentPopupPositionInLayer = pos;\n }\n\n hasDefaultPopupPosition() {\n return this.#comment.hasDefaultPopupPosition();\n }\n\n get commentButtonWidth() {\n return this.#comment.commentButtonWidth;\n }\n\n get elementBeforePopup() {\n return this.div;\n }\n\n setCommentButtonStates(options) {\n this.#comment?.setCommentButtonStates(options);\n }\n\n /**\n * onkeydown callback.\n * @param {KeyboardEvent} event\n */\n keydown(event) {\n if (\n !this.isResizable ||\n event.target !== this.div ||\n event.key !== \"Enter\"\n ) {\n return;\n }\n this._uiManager.setSelected(this);\n this.#savedDimensions = {\n savedX: this.x,\n savedY: this.y,\n savedWidth: this.width,\n savedHeight: this.height,\n };\n const children = this.#resizersDiv.children;\n if (!this.#allResizerDivs) {\n this.#allResizerDivs = Array.from(children);\n const boundResizerKeydown = this.#resizerKeydown.bind(this);\n const boundResizerBlur = this.#resizerBlur.bind(this);\n const signal = this._uiManager._signal;\n for (const div of this.#allResizerDivs) {\n const name = div.getAttribute(\"data-resizer-name\");\n div.setAttribute(\"role\", \"spinbutton\");\n div.addEventListener(\"keydown\", boundResizerKeydown, { signal });\n div.addEventListener(\"blur\", boundResizerBlur, { signal });\n div.addEventListener(\"focus\", this.#resizerFocus.bind(this, name), {\n signal,\n });\n div.setAttribute(\"data-l10n-id\", AnnotationEditor._l10nResizer[name]);\n }\n }\n\n // We want to have the resizers in the visual order, so we move the first\n // (top-left) to the right place.\n const first = this.#allResizerDivs[0];\n let firstPosition = 0;\n for (const div of children) {\n if (div === first) {\n break;\n }\n firstPosition++;\n }\n const nextFirstPosition =\n (((360 - this.rotation + this.parentRotation) % 360) / 90) *\n (this.#allResizerDivs.length / 4);\n\n if (nextFirstPosition !== firstPosition) {\n // We need to reorder the resizers in the DOM in order to have the focus\n // on the top-left one.\n if (nextFirstPosition < firstPosition) {\n for (let i = 0; i < firstPosition - nextFirstPosition; i++) {\n this.#resizersDiv.append(this.#resizersDiv.firstElementChild);\n }\n } else if (nextFirstPosition > firstPosition) {\n for (let i = 0; i < nextFirstPosition - firstPosition; i++) {\n this.#resizersDiv.firstElementChild.before(\n this.#resizersDiv.lastElementChild\n );\n }\n }\n\n let i = 0;\n for (const child of children) {\n const div = this.#allResizerDivs[i++];\n const name = div.getAttribute(\"data-resizer-name\");\n child.setAttribute(\"data-l10n-id\", AnnotationEditor._l10nResizer[name]);\n }\n }\n\n this.#setResizerTabIndex(0);\n this.#isResizerEnabledForKeyboard = true;\n this.#resizersDiv.firstElementChild.focus({ focusVisible: true });\n event.preventDefault();\n event.stopImmediatePropagation();\n }\n\n #resizerKeydown(event) {\n AnnotationEditor._resizerKeyboardManager.exec(this, event);\n }\n\n #resizerBlur(event) {\n if (\n this.#isResizerEnabledForKeyboard &&\n event.relatedTarget?.parentNode !== this.#resizersDiv\n ) {\n this.#stopResizing();\n }\n }\n\n #resizerFocus(name) {\n this.#focusedResizerName = this.#isResizerEnabledForKeyboard ? name : \"\";\n }\n\n #setResizerTabIndex(value) {\n if (!this.#allResizerDivs) {\n return;\n }\n for (const div of this.#allResizerDivs) {\n div.tabIndex = value;\n }\n }\n\n _resizeWithKeyboard(x, y) {\n if (!this.#isResizerEnabledForKeyboard) {\n return;\n }\n this.#resizerPointermove(this.#focusedResizerName, {\n deltaX: x,\n deltaY: y,\n fromKeyboard: true,\n });\n }\n\n #stopResizing() {\n this.#isResizerEnabledForKeyboard = false;\n this.#setResizerTabIndex(-1);\n this.#addResizeToUndoStack();\n }\n\n _stopResizingWithKeyboard() {\n this.#stopResizing();\n this.div.focus();\n }\n\n /**\n * Select this editor.\n */\n select() {\n if (this.isSelected && this._editToolbar) {\n this._editToolbar.show();\n return;\n }\n this.isSelected = true;\n this.makeResizable();\n this.div?.classList.add(\"selectedEditor\");\n if (!this._editToolbar) {\n this.addEditToolbar().then(() => {\n if (this.div?.classList.contains(\"selectedEditor\")) {\n // The editor can have been unselected while we were waiting for the\n // edit toolbar to be created, hence we want to be sure that this\n // editor is still selected.\n this._editToolbar?.show();\n }\n });\n return;\n }\n this._editToolbar?.show();\n this.#altText?.toggleAltTextBadge(false);\n }\n\n focus() {\n if (this.div && !this.div.contains(document.activeElement)) {\n setTimeout(() => this.div?.focus({ preventScroll: true }), 0);\n }\n }\n\n /**\n * Unselect this editor.\n */\n unselect() {\n if (!this.isSelected) {\n return;\n }\n this.isSelected = false;\n this.#resizersDiv?.classList.add(\"hidden\");\n this.div?.classList.remove(\"selectedEditor\");\n if (this.div?.contains(document.activeElement)) {\n // Don't use this.div.blur() because we don't know where the focus will\n // go.\n this._uiManager.currentLayer.div.focus({\n preventScroll: true,\n });\n }\n this._editToolbar?.hide();\n this.#altText?.toggleAltTextBadge(true);\n this.hideCommentPopup();\n }\n\n hideCommentPopup() {\n if (this.hasComment) {\n this._uiManager.toggleComment(null);\n }\n }\n\n /**\n * Update some parameters which have been changed through the UI.\n * @param {number} type\n * @param {*} value\n */\n updateParams(type, value) {}\n\n /**\n * When the user disables the editing mode some editors can change some of\n * their properties.\n */\n disableEditing() {}\n\n /**\n * When the user enables the editing mode some editors can change some of\n * their properties.\n */\n enableEditing() {}\n\n /**\n * Check if the content of this editor can be changed.\n * For example, a FreeText editor can be changed (the user can change the\n * text), but a Stamp editor cannot.\n * @returns {boolean}\n */\n get canChangeContent() {\n return false;\n }\n\n /**\n * The editor is about to be edited.\n */\n enterInEditMode() {\n if (!this.canChangeContent) {\n return;\n }\n this.enableEditMode();\n this.div.focus();\n }\n\n /**\n * ondblclick callback.\n * @param {MouseEvent} event\n */\n dblclick(event) {\n if (event.target.nodeName === \"BUTTON\") {\n // Avoid entering in edit mode when clicking on the comment button.\n return;\n }\n this.enterInEditMode();\n this.parent.updateToolbar({\n mode: this.constructor._editorType,\n editId: this.uid,\n });\n }\n\n /**\n * @returns {HTMLElement | null} the element requiring an alt text.\n */\n getElementForAltText() {\n return this.div;\n }\n\n /**\n * Get the div which really contains the displayed content.\n * @returns {HTMLDivElement | undefined}\n */\n get contentDiv() {\n return this.div;\n }\n\n /**\n * If true then the editor is currently edited.\n * @type {boolean}\n */\n get isEditing() {\n return this.#isEditing;\n }\n\n /**\n * When set to true, it means that this editor is currently edited.\n * @param {boolean} value\n */\n set isEditing(value) {\n this.#isEditing = value;\n if (!this.parent) {\n return;\n }\n if (value) {\n this.parent.setSelected(this);\n this.parent.setActiveEditor(this);\n } else {\n this.parent.setActiveEditor(null);\n }\n }\n\n static get MIN_SIZE() {\n return 16;\n }\n\n static canCreateNewEmptyEditor() {\n return true;\n }\n\n /**\n * Get the data to report to the telemetry when the editor is added.\n * @returns {object}\n */\n get telemetryInitialData() {\n return { action: \"added\" };\n }\n\n /**\n * The telemetry data to use when saving/printing.\n * @returns {object | null}\n */\n get telemetryFinalData() {\n return null;\n }\n\n _reportTelemetry(data, mustWait = false) {\n if (mustWait) {\n this.#telemetryTimeouts ||= new Map();\n const { action } = data;\n let timeout = this.#telemetryTimeouts.get(action);\n if (timeout) {\n clearTimeout(timeout);\n }\n timeout = setTimeout(() => {\n this._reportTelemetry(data);\n this.#telemetryTimeouts.delete(action);\n if (this.#telemetryTimeouts.size === 0) {\n this.#telemetryTimeouts = null;\n }\n }, AnnotationEditor._telemetryTimeout);\n this.#telemetryTimeouts.set(action, timeout);\n return;\n }\n data.type ||= this.editorType;\n this._uiManager._eventBus.dispatch(\"reporttelemetry\", {\n source: this,\n details: {\n type: \"editing\",\n data,\n },\n });\n }\n\n /**\n * Show or hide this editor.\n * @param {boolean|undefined} visible\n */\n show(visible = this._isVisible) {\n this.div.classList.toggle(\"hidden\", !visible);\n this._isVisible = visible;\n }\n\n enable() {\n if (this.div) {\n this.div.tabIndex = 0;\n }\n this.#disabled = false;\n }\n\n disable() {\n if (this.div) {\n this.div.tabIndex = -1;\n }\n this.#disabled = true;\n }\n\n updateFakeAnnotationElement(annotationLayer) {\n if (!this.#fakeAnnotation && !this.deleted) {\n this.#fakeAnnotation = annotationLayer.addFakeAnnotation(this);\n return;\n }\n if (this.deleted) {\n this.#fakeAnnotation.remove();\n this.#fakeAnnotation = null;\n return;\n }\n if (this.hasEditedComment || this._hasBeenMoved || this._hasBeenResized) {\n this.#fakeAnnotation.updateEdited({\n rect: this.getPDFRect(),\n popup: this.comment,\n });\n }\n }\n\n /**\n * Render an annotation in the annotation layer.\n * @param {object} annotation\n * @returns {HTMLElement|null}\n */\n renderAnnotationElement(annotation) {\n if (this.deleted) {\n annotation.hide();\n return null;\n }\n let content = annotation.container.querySelector(\".annotationContent\");\n if (!content) {\n content = document.createElement(\"div\");\n content.classList.add(\"annotationContent\", this.editorType);\n annotation.container.prepend(content);\n } else if (content.nodeName === \"CANVAS\") {\n const canvas = content;\n content = document.createElement(\"div\");\n content.classList.add(\"annotationContent\", this.editorType);\n canvas.before(content);\n }\n\n return content;\n }\n\n resetAnnotationElement(annotation) {\n const { firstElementChild } = annotation.container;\n if (\n firstElementChild?.nodeName === \"DIV\" &&\n firstElementChild.classList.contains(\"annotationContent\")\n ) {\n firstElementChild.remove();\n }\n }\n}\n\n// This class is used to fake an editor which has been deleted.\nclass FakeEditor extends AnnotationEditor {\n constructor(params) {\n super(params);\n this.annotationElementId = params.annotationElementId;\n this.deleted = true;\n }\n\n serialize() {\n return this.serializeDeleted();\n }\n}\n\nexport { AnnotationEditor };\n","/* Copyright 2014 Opera Software ASA\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n *\n * Based on https://code.google.com/p/smhasher/wiki/MurmurHash3.\n * Hashes roughly 100 KB per millisecond on i7 3.4 GHz.\n */\n\nconst SEED = 0xc3d2e1f0;\n// Workaround for missing math precision in JS.\nconst MASK_HIGH = 0xffff0000;\nconst MASK_LOW = 0xffff;\n\nclass MurmurHash3_64 {\n constructor(seed) {\n this.h1 = seed ? seed & 0xffffffff : SEED;\n this.h2 = seed ? seed & 0xffffffff : SEED;\n }\n\n update(input) {\n let data, length;\n if (typeof input === \"string\") {\n data = new Uint8Array(input.length * 2);\n length = 0;\n for (let i = 0, ii = input.length; i < ii; i++) {\n const code = input.charCodeAt(i);\n if (code <= 0xff) {\n data[length++] = code;\n } else {\n data[length++] = code >>> 8;\n data[length++] = code & 0xff;\n }\n }\n } else if (ArrayBuffer.isView(input)) {\n data = input.slice();\n length = data.byteLength;\n } else {\n throw new Error(\"Invalid data format, must be a string or TypedArray.\");\n }\n\n const blockCounts = length >> 2;\n const tailLength = length - blockCounts * 4;\n // We don't care about endianness here.\n const dataUint32 = new Uint32Array(data.buffer, 0, blockCounts);\n let k1 = 0,\n k2 = 0;\n let h1 = this.h1,\n h2 = this.h2;\n const C1 = 0xcc9e2d51,\n C2 = 0x1b873593;\n const C1_LOW = C1 & MASK_LOW,\n C2_LOW = C2 & MASK_LOW;\n\n for (let i = 0; i < blockCounts; i++) {\n if (i & 1) {\n k1 = dataUint32[i];\n k1 = ((k1 * C1) & MASK_HIGH) | ((k1 * C1_LOW) & MASK_LOW);\n k1 = (k1 << 15) | (k1 >>> 17);\n k1 = ((k1 * C2) & MASK_HIGH) | ((k1 * C2_LOW) & MASK_LOW);\n h1 ^= k1;\n h1 = (h1 << 13) | (h1 >>> 19);\n h1 = h1 * 5 + 0xe6546b64;\n } else {\n k2 = dataUint32[i];\n k2 = ((k2 * C1) & MASK_HIGH) | ((k2 * C1_LOW) & MASK_LOW);\n k2 = (k2 << 15) | (k2 >>> 17);\n k2 = ((k2 * C2) & MASK_HIGH) | ((k2 * C2_LOW) & MASK_LOW);\n h2 ^= k2;\n h2 = (h2 << 13) | (h2 >>> 19);\n h2 = h2 * 5 + 0xe6546b64;\n }\n }\n\n k1 = 0;\n\n switch (tailLength) {\n case 3:\n k1 ^= data[blockCounts * 4 + 2] << 16;\n /* falls through */\n case 2:\n k1 ^= data[blockCounts * 4 + 1] << 8;\n /* falls through */\n case 1:\n k1 ^= data[blockCounts * 4];\n /* falls through */\n\n k1 = ((k1 * C1) & MASK_HIGH) | ((k1 * C1_LOW) & MASK_LOW);\n k1 = (k1 << 15) | (k1 >>> 17);\n k1 = ((k1 * C2) & MASK_HIGH) | ((k1 * C2_LOW) & MASK_LOW);\n if (blockCounts & 1) {\n h1 ^= k1;\n } else {\n h2 ^= k1;\n }\n }\n\n this.h1 = h1;\n this.h2 = h2;\n }\n\n hexdigest() {\n let h1 = this.h1,\n h2 = this.h2;\n\n h1 ^= h2 >>> 1;\n h1 = ((h1 * 0xed558ccd) & MASK_HIGH) | ((h1 * 0x8ccd) & MASK_LOW);\n h2 =\n ((h2 * 0xff51afd7) & MASK_HIGH) |\n (((((h2 << 16) | (h1 >>> 16)) * 0xafd7ed55) & MASK_HIGH) >>> 16);\n h1 ^= h2 >>> 1;\n h1 = ((h1 * 0x1a85ec53) & MASK_HIGH) | ((h1 * 0xec53) & MASK_LOW);\n h2 =\n ((h2 * 0xc4ceb9fe) & MASK_HIGH) |\n (((((h2 << 16) | (h1 >>> 16)) * 0xb9fe1a85) & MASK_HIGH) >>> 16);\n h1 ^= h2 >>> 1;\n\n return (\n (h1 >>> 0).toString(16).padStart(8, \"0\") +\n (h2 >>> 0).toString(16).padStart(8, \"0\")\n );\n }\n}\n\nexport { MurmurHash3_64 };\n","/* Copyright 2020 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { makeMap, shadow, unreachable } from \"../shared/util.js\";\nimport { AnnotationEditor } from \"./editor/editor.js\";\nimport { MurmurHash3_64 } from \"../shared/murmurhash3.js\";\n\nconst SerializableEmpty = Object.freeze({\n map: null,\n hash: \"\",\n transfer: undefined,\n});\n\n/**\n * Key/value storage for annotation data in forms.\n */\nclass AnnotationStorage {\n #modified = false;\n\n #modifiedIds = null;\n\n #editorsMap = null;\n\n #storage = new Map();\n\n // Callbacks to signal when the modification state is set or reset.\n // This is used by the viewer to only bind on `beforeunload` if forms\n // are actually edited to prevent doing so unconditionally since that\n // can have undesirable effects.\n onSetModified = null;\n\n onResetModified = null;\n\n onAnnotationEditor = null;\n\n constructor() {\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n // For testing purposes.\n Object.defineProperty(this, \"_setValues\", {\n value: obj => {\n for (const [key, val] of Object.entries(obj)) {\n this.setValue(key, val);\n }\n },\n });\n }\n }\n\n /**\n * Get the value for a given key if it exists, or return the default value.\n * @param {string} key\n * @param {object} defaultValue\n * @returns {object}\n */\n getValue(key, defaultValue) {\n const value = this.#storage.get(key);\n return value === undefined\n ? defaultValue\n : Object.assign(defaultValue, value);\n }\n\n /**\n * Get the value for a given key.\n * @param {string} key\n * @returns {object}\n */\n getRawValue(key) {\n return this.#storage.get(key);\n }\n\n /**\n * Remove a value from the storage.\n * @param {string} key\n */\n remove(key) {\n const storedValue = this.#storage.get(key);\n if (storedValue === undefined) {\n return;\n }\n if (storedValue instanceof AnnotationEditor) {\n this.#editorsMap.delete(storedValue.annotationElementId);\n }\n this.#storage.delete(key);\n\n if (this.#storage.size === 0) {\n this.resetModified();\n }\n\n if (this.#storage.values().some(v => v instanceof AnnotationEditor)) {\n return;\n }\n this.onAnnotationEditor?.(null);\n }\n\n /**\n * Set the value for a given key\n * @param {string} key\n * @param {object} value\n */\n setValue(key, value) {\n const obj = this.#storage.get(key);\n let modified = false;\n if (obj !== undefined) {\n for (const [entry, val] of Object.entries(value)) {\n if (obj[entry] !== val) {\n modified = true;\n obj[entry] = val;\n }\n }\n } else {\n modified = true;\n this.#storage.set(key, value);\n }\n if (modified) {\n this.#setModified();\n }\n\n if (value instanceof AnnotationEditor) {\n (this.#editorsMap ||= new Map()).set(value.annotationElementId, value);\n this.onAnnotationEditor?.(value.constructor._type);\n }\n }\n\n /**\n * Check if the storage contains the given key.\n * @param {string} key\n * @returns {boolean}\n */\n has(key) {\n return this.#storage.has(key);\n }\n\n get size() {\n return this.#storage.size;\n }\n\n #setModified() {\n if (!this.#modified) {\n this.#modified = true;\n this.onSetModified?.();\n }\n }\n\n resetModified() {\n if (this.#modified) {\n this.#modified = false;\n this.onResetModified?.();\n }\n }\n\n /**\n * @returns {PrintAnnotationStorage}\n */\n get print() {\n return new PrintAnnotationStorage(this);\n }\n\n /**\n * PLEASE NOTE: Only intended for usage within the API itself.\n * @ignore\n */\n get serializable() {\n if (this.#storage.size === 0) {\n return SerializableEmpty;\n }\n const map = new Map(),\n hash = new MurmurHash3_64(),\n transfer = [];\n const context = Object.create(null);\n let hasBitmap = false;\n\n for (const [key, val] of this.#storage) {\n const serialized =\n val instanceof AnnotationEditor\n ? val.serialize(/* isForCopying = */ false, context)\n : val;\n if (val.page) {\n val.pageIndex = val.page._pageIndex;\n delete val.page;\n }\n if (serialized) {\n map.set(key, serialized);\n\n hash.update(`${key}:${JSON.stringify(serialized)}`);\n hasBitmap ||= !!serialized.bitmap;\n }\n }\n\n if (hasBitmap) {\n // We must transfer the bitmap data separately, since it can be changed\n // during serialization with SVG images.\n for (const value of map.values()) {\n if (value.bitmap) {\n transfer.push(value.bitmap);\n }\n }\n }\n\n return map.size > 0\n ? { map, hash: hash.hexdigest(), transfer }\n : SerializableEmpty;\n }\n\n get editorStats() {\n let stats = null;\n const typeToEditor = new Map();\n let numberOfEditedComments = 0;\n let numberOfDeletedComments = 0;\n for (const value of this.#storage.values()) {\n if (!(value instanceof AnnotationEditor)) {\n if (value.popup) {\n if (value.popup.deleted) {\n numberOfDeletedComments += 1;\n } else {\n numberOfEditedComments += 1;\n }\n }\n continue;\n }\n if (value.isCommentDeleted) {\n numberOfDeletedComments += 1;\n } else if (value.hasEditedComment) {\n numberOfEditedComments += 1;\n }\n const editorStats = value.telemetryFinalData;\n if (!editorStats) {\n continue;\n }\n const { type } = editorStats;\n typeToEditor.getOrInsertComputed(\n type,\n () => Object.getPrototypeOf(value).constructor\n );\n stats ||= Object.create(null);\n const map = (stats[type] ||= new Map());\n for (const [key, val] of Object.entries(editorStats)) {\n if (key === \"type\") {\n continue;\n }\n const counters = map.getOrInsertComputed(key, makeMap);\n counters.set(val, (counters.get(val) ?? 0) + 1);\n }\n }\n if (numberOfDeletedComments > 0 || numberOfEditedComments > 0) {\n stats ||= Object.create(null);\n stats.comments = {\n deleted: numberOfDeletedComments,\n edited: numberOfEditedComments,\n };\n }\n if (!stats) {\n return null;\n }\n for (const [type, editor] of typeToEditor) {\n stats[type] = editor.computeTelemetryFinalData(stats[type]);\n }\n return stats;\n }\n\n resetModifiedIds() {\n this.#modifiedIds = null;\n }\n\n updateEditor(annotationId, data) {\n const value = this.#editorsMap?.get(annotationId);\n if (value) {\n value.updateFromAnnotationLayer(data);\n return true;\n }\n return false;\n }\n\n getEditor(annotationId) {\n return this.#editorsMap?.get(annotationId) || null;\n }\n\n /**\n * @returns {{ids: Set, hash: string}}\n */\n get modifiedIds() {\n if (this.#modifiedIds) {\n return this.#modifiedIds;\n }\n const ids = [];\n if (this.#editorsMap) {\n for (const value of this.#editorsMap.values()) {\n if (!value.serialize()) {\n continue;\n }\n ids.push(value.annotationElementId);\n }\n }\n let hash = \"\";\n if (ids.length) {\n const h = new MurmurHash3_64();\n h.update(ids.join(\",\"));\n hash = h.hexdigest();\n }\n return (this.#modifiedIds = {\n ids: new Set(ids),\n hash,\n });\n }\n\n [Symbol.iterator]() {\n return this.#storage.entries();\n }\n}\n\n/**\n * A special `AnnotationStorage` for use during printing, where the serializable\n * data is *frozen* upon initialization, to prevent scripting from modifying its\n * contents. (Necessary since printing is triggered synchronously in browsers.)\n */\nclass PrintAnnotationStorage extends AnnotationStorage {\n #serializable = SerializableEmpty;\n\n constructor(parent) {\n super();\n\n const { serializable } = parent;\n if (serializable === SerializableEmpty) {\n return;\n }\n const { map, hash, transfer } = serializable;\n // Create a *copy* of the data, since Objects are passed by reference in JS.\n const clone = structuredClone(map, transfer ? { transfer } : null);\n // The `PrintAnnotationStorage` instance is re-used for all pages,\n // hence we cannot transfer the data since that breaks printing.\n this.#serializable = { map: clone, hash, transfer: [] };\n }\n\n /**\n * @type {PrintAnnotationStorage}\n * @throws {Error} Always, since a `PrintAnnotationStorage` cannot be nested.\n */\n // eslint-disable-next-line getter-return\n get print() {\n unreachable(\"Should not call PrintAnnotationStorage.print\");\n }\n\n /**\n * PLEASE NOTE: Only intended for usage within the API itself.\n * @ignore\n */\n get serializable() {\n return this.#serializable;\n }\n\n get modifiedIds() {\n return shadow(this, \"modifiedIds\", {\n ids: new Set(),\n hash: \"\",\n });\n }\n}\n\nexport { AnnotationStorage, PrintAnnotationStorage, SerializableEmpty };\n","/* Copyright 2025 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { BBOX_INIT, FeatureTest, Util } from \"../shared/util.js\";\nimport { getCurrentTransform } from \"./display_utils.js\";\nimport { MathClamp } from \"../shared/math_clamp.js\";\n\nconst FORCED_DEPENDENCY_LABEL = \"__forcedDependency\";\n\nconst { floor, ceil } = Math;\n\nfunction expandBBox(array, index, minX, minY, maxX, maxY) {\n array[index * 4 + 0] = Math.min(array[index * 4 + 0], minX);\n array[index * 4 + 1] = Math.min(array[index * 4 + 1], minY);\n array[index * 4 + 2] = Math.max(array[index * 4 + 2], maxX);\n array[index * 4 + 3] = Math.max(array[index * 4 + 3], maxY);\n}\n\n// If a scaling factor is negative then min and max must be swapped.\nfunction scaleCharBBox(scaleX, scaleY, x, y, bbox) {\n let temp;\n if (scaleX) {\n if (scaleX < 0) {\n temp = bbox[0];\n bbox[0] = bbox[2];\n bbox[2] = temp;\n }\n bbox[0] *= scaleX;\n bbox[2] *= scaleX;\n\n if (scaleY < 0) {\n temp = bbox[1];\n bbox[1] = bbox[3];\n bbox[3] = temp;\n }\n bbox[1] *= scaleY;\n bbox[3] *= scaleY;\n } else {\n bbox.fill(0);\n }\n bbox[0] += x;\n bbox[1] += y;\n bbox[2] += x;\n bbox[3] += y;\n}\n\n// This is computed rathter than hard-coded to keep into\n// account the platform's endianess.\nconst EMPTY_BBOX = new Uint32Array(new Uint8Array([255, 255, 0, 0]).buffer)[0];\n\nclass BBoxReader {\n #bboxes;\n\n #coords;\n\n constructor(bboxes, coords) {\n this.#bboxes = bboxes;\n this.#coords = coords;\n }\n\n get length() {\n return this.#bboxes.length;\n }\n\n isEmpty(i) {\n return this.#bboxes[i] === EMPTY_BBOX;\n }\n\n minX(i) {\n return this.#coords[i * 4 + 0] / 256;\n }\n\n minY(i) {\n return this.#coords[i * 4 + 1] / 256;\n }\n\n maxX(i) {\n return (this.#coords[i * 4 + 2] + 1) / 256;\n }\n\n maxY(i) {\n return (this.#coords[i * 4 + 3] + 1) / 256;\n }\n}\n\nconst ensureDebugMetadata = (map, key) =>\n map?.getOrInsertComputed(key, () => ({\n dependencies: new Set(),\n isRenderingOperation: false,\n }));\n\n// NOTE: CanvasBBoxTracker, CanvasDependencyTracker and\n// CanvasNestedDependencyTracker must all have the same interface.\n\nclass CanvasBBoxTracker {\n #baseTransformStack = [[1, 0, 0, 1, 0, 0]];\n\n // minX, minY, maxX, maxY\n #clipBox = [-Infinity, -Infinity, Infinity, Infinity];\n\n // minX, minY, maxX, maxY\n #pendingBBox = new Float64Array(BBOX_INIT);\n\n _pendingBBoxIdx = -1;\n\n #canvasWidth;\n\n #canvasHeight;\n\n // Uint8ClampedArray\n #bboxesCoords;\n\n #bboxes;\n\n _savesStack = [];\n\n _markedContentStack = [];\n\n constructor(canvas, operationsCount) {\n this.#canvasWidth = canvas.width;\n this.#canvasHeight = canvas.height;\n this.#initializeBBoxes(operationsCount);\n }\n\n growOperationsCount(operationsCount) {\n if (operationsCount >= this.#bboxes.length) {\n this.#initializeBBoxes(operationsCount, this.#bboxes);\n }\n }\n\n #initializeBBoxes(operationsCount, oldBBoxes) {\n const buffer = new ArrayBuffer(operationsCount * 4);\n this.#bboxesCoords = new Uint8ClampedArray(buffer);\n this.#bboxes = new Uint32Array(buffer);\n if (oldBBoxes && oldBBoxes.length > 0) {\n this.#bboxes.set(oldBBoxes);\n this.#bboxes.fill(EMPTY_BBOX, oldBBoxes.length);\n } else {\n this.#bboxes.fill(EMPTY_BBOX);\n }\n }\n\n get clipBox() {\n return this.#clipBox;\n }\n\n save(opIdx) {\n this.#clipBox = { __proto__: this.#clipBox };\n this._savesStack.push(opIdx);\n return this;\n }\n\n restore(opIdx, onSavePopped) {\n const previous = Object.getPrototypeOf(this.#clipBox);\n if (previous === null) {\n // Sometimes we call more .restore() than .save(), for\n // example when using CanvasGraphics' #restoreInitialState()\n return this;\n }\n this.#clipBox = previous;\n\n const lastSave = this._savesStack.pop();\n if (lastSave !== undefined) {\n onSavePopped?.(lastSave, opIdx);\n this.#bboxes[opIdx] = this.#bboxes[lastSave];\n }\n return this;\n }\n\n /**\n * @param {number} idx\n */\n recordOpenMarker(idx) {\n this._savesStack.push(idx);\n return this;\n }\n\n getOpenMarker() {\n return this._savesStack.length === 0 ? null : this._savesStack.at(-1);\n }\n\n recordCloseMarker(opIdx, onSavePopped) {\n const lastSave = this._savesStack.pop();\n if (lastSave !== undefined) {\n onSavePopped?.(lastSave, opIdx);\n this.#bboxes[opIdx] = this.#bboxes[lastSave];\n }\n return this;\n }\n\n // Marked content needs a separate stack from save/restore, because they\n // form two independent trees.\n beginMarkedContent(opIdx) {\n this._markedContentStack.push(opIdx);\n return this;\n }\n\n endMarkedContent(opIdx, onSavePopped) {\n const lastSave = this._markedContentStack.pop();\n if (lastSave !== undefined) {\n onSavePopped?.(lastSave, opIdx);\n this.#bboxes[opIdx] = this.#bboxes[lastSave];\n }\n return this;\n }\n\n pushBaseTransform(ctx) {\n this.#baseTransformStack.push(\n Util.multiplyByDOMMatrix(\n this.#baseTransformStack.at(-1),\n ctx.getTransform()\n )\n );\n return this;\n }\n\n popBaseTransform() {\n if (this.#baseTransformStack.length > 1) {\n this.#baseTransformStack.pop();\n }\n return this;\n }\n\n resetBBox(idx) {\n if (this._pendingBBoxIdx !== idx) {\n this._pendingBBoxIdx = idx;\n this.#pendingBBox.set(BBOX_INIT, 0);\n }\n return this;\n }\n\n recordClipBox(idx, ctx, minX, maxX, minY, maxY) {\n const transform = Util.multiplyByDOMMatrix(\n this.#baseTransformStack.at(-1),\n ctx.getTransform()\n );\n const clipBox = BBOX_INIT.slice();\n Util.axialAlignedBoundingBox([minX, minY, maxX, maxY], transform, clipBox);\n const intersection = Util.intersect(this.#clipBox, clipBox);\n if (intersection) {\n this.#clipBox[0] = intersection[0];\n this.#clipBox[1] = intersection[1];\n this.#clipBox[2] = intersection[2];\n this.#clipBox[3] = intersection[3];\n } else {\n this.#clipBox[0] = this.#clipBox[1] = Infinity;\n this.#clipBox[2] = this.#clipBox[3] = -Infinity;\n }\n return this;\n }\n\n recordBBox(idx, ctx, minX, maxX, minY, maxY) {\n const clipBox = this.#clipBox;\n if (clipBox[0] === Infinity) {\n return this;\n }\n\n const transform = Util.multiplyByDOMMatrix(\n this.#baseTransformStack.at(-1),\n ctx.getTransform()\n );\n if (clipBox[0] === -Infinity) {\n Util.axialAlignedBoundingBox(\n [minX, minY, maxX, maxY],\n transform,\n this.#pendingBBox\n );\n return this;\n }\n\n const bbox = BBOX_INIT.slice();\n Util.axialAlignedBoundingBox([minX, minY, maxX, maxY], transform, bbox);\n\n this.#pendingBBox[0] = MathClamp(bbox[0], clipBox[0], this.#pendingBBox[0]);\n this.#pendingBBox[1] = MathClamp(bbox[1], clipBox[1], this.#pendingBBox[1]);\n this.#pendingBBox[2] = MathClamp(bbox[2], this.#pendingBBox[2], clipBox[2]);\n this.#pendingBBox[3] = MathClamp(bbox[3], this.#pendingBBox[3], clipBox[3]);\n return this;\n }\n\n recordFullPageBBox(idx) {\n this.#pendingBBox[0] = Math.max(0, this.#clipBox[0]);\n this.#pendingBBox[1] = Math.max(0, this.#clipBox[1]);\n this.#pendingBBox[2] = Math.min(this.#canvasWidth, this.#clipBox[2]);\n this.#pendingBBox[3] = Math.min(this.#canvasHeight, this.#clipBox[3]);\n return this;\n }\n\n /**\n * @param {number} idx\n * @param {boolean} [preserve=false] - When false, the pending bounding box\n * is cleared once recorded; pass true to keep it for subsequent\n * operations.\n * @param {Iterable>} [dependencyLists] - Groups of operation\n * indices whose bounding boxes are also expanded to cover this operation.\n */\n recordOperation(idx, preserve = false, dependencyLists) {\n if (this._pendingBBoxIdx !== idx) {\n return this;\n }\n\n const minX = floor((this.#pendingBBox[0] * 256) / this.#canvasWidth);\n const minY = floor((this.#pendingBBox[1] * 256) / this.#canvasHeight);\n const maxX = ceil((this.#pendingBBox[2] * 256) / this.#canvasWidth);\n const maxY = ceil((this.#pendingBBox[3] * 256) / this.#canvasHeight);\n\n expandBBox(this.#bboxesCoords, idx, minX, minY, maxX, maxY);\n if (dependencyLists) {\n for (const dependencies of dependencyLists) {\n for (const depIdx of dependencies) {\n if (depIdx !== idx) {\n expandBBox(this.#bboxesCoords, depIdx, minX, minY, maxX, maxY);\n }\n }\n }\n }\n\n if (!preserve) {\n this._pendingBBoxIdx = -1;\n }\n\n return this;\n }\n\n bboxToClipBoxDropOperation(idx) {\n if (this._pendingBBoxIdx === idx) {\n this._pendingBBoxIdx = -1;\n\n this.#clipBox[0] = Math.max(this.#clipBox[0], this.#pendingBBox[0]);\n this.#clipBox[1] = Math.max(this.#clipBox[1], this.#pendingBBox[1]);\n this.#clipBox[2] = Math.min(this.#clipBox[2], this.#pendingBBox[2]);\n this.#clipBox[3] = Math.min(this.#clipBox[3], this.#pendingBBox[3]);\n }\n return this;\n }\n\n take() {\n return new BBoxReader(this.#bboxes, this.#bboxesCoords);\n }\n\n takeDebugMetadata() {\n throw new Error(\"Unreachable\");\n }\n\n recordSimpleData(name, idx) {\n return this;\n }\n\n recordIncrementalData(name, idx) {\n return this;\n }\n\n resetIncrementalData(name, idx) {\n return this;\n }\n\n recordNamedData(name, idx) {\n return this;\n }\n\n recordSimpleDataFromNamed(name, depName, fallbackIdx) {\n return this;\n }\n\n recordFutureForcedDependency(name, idx) {\n return this;\n }\n\n inheritSimpleDataAsFutureForcedDependencies(names) {\n return this;\n }\n\n inheritPendingDependenciesAsFutureForcedDependencies() {\n return this;\n }\n\n recordCharacterBBox(idx, ctx, font, scale = 1, x = 0, y = 0, getMeasure) {\n return this;\n }\n\n getSimpleIndex(dependencyName) {\n return undefined;\n }\n\n recordDependencies(idx, dependencyNames) {\n return this;\n }\n\n recordNamedDependency(idx, name) {\n return this;\n }\n\n recordShowTextOperation(idx, preserve = false) {\n return this;\n }\n}\n\n/**\n * @typedef {\"lineWidth\" | \"lineCap\" | \"lineJoin\" | \"miterLimit\" | \"dash\" |\n * \"strokeAlpha\" | \"fillColor\" | \"fillAlpha\" | \"globalCompositeOperation\" |\n * \"path\" | \"filter\" | \"font\" | \"fontObj\"} SimpleDependency\n */\n\n/**\n * @typedef {\"transform\" | \"moveText\" | \"sameLineText\"} IncrementalDependency\n */\n\n/**\n * @typedef {IncrementalDependency |\n * typeof FORCED_DEPENDENCY_LABEL} InternalIncrementalDependency\n */\nclass CanvasDependencyTracker {\n /** @type {Record} */\n #simple = { __proto__: null };\n\n /** @type {Record} */\n #incremental = {\n __proto__: null,\n transform: [],\n moveText: [],\n sameLineText: [],\n [FORCED_DEPENDENCY_LABEL]: [],\n };\n\n #namedDependencies = new Map();\n\n #pendingDependencies = new Set();\n\n #fontBBoxTrustworthy = new Map();\n\n #debugMetadata;\n\n #recordDebugMetadataDepenencyAfterRestore;\n\n #bboxTracker;\n\n constructor(bboxTracker, recordDebugMetadata = false) {\n this.#bboxTracker = bboxTracker;\n if (recordDebugMetadata) {\n this.#debugMetadata = new Map();\n this.#recordDebugMetadataDepenencyAfterRestore = (lastSave, opIdx) => {\n ensureDebugMetadata(this.#debugMetadata, opIdx).dependencies.add(\n lastSave\n );\n };\n }\n }\n\n get clipBox() {\n return this.#bboxTracker.clipBox;\n }\n\n growOperationsCount(operationsCount) {\n this.#bboxTracker.growOperationsCount(operationsCount);\n }\n\n save(opIdx) {\n this.#simple = { __proto__: this.#simple };\n this.#incremental = {\n __proto__: this.#incremental,\n transform: { __proto__: this.#incremental.transform },\n moveText: { __proto__: this.#incremental.moveText },\n sameLineText: { __proto__: this.#incremental.sameLineText },\n [FORCED_DEPENDENCY_LABEL]: {\n __proto__: this.#incremental[FORCED_DEPENDENCY_LABEL],\n },\n };\n this.#bboxTracker.save(opIdx);\n\n return this;\n }\n\n restore(opIdx) {\n this.#bboxTracker.restore(\n opIdx,\n this.#recordDebugMetadataDepenencyAfterRestore\n );\n\n const previous = Object.getPrototypeOf(this.#simple);\n if (previous === null) {\n // Sometimes we call more .restore() than .save(), for\n // example when using CanvasGraphics' #restoreInitialState()\n return this;\n }\n this.#simple = previous;\n this.#incremental = Object.getPrototypeOf(this.#incremental);\n\n return this;\n }\n\n recordOpenMarker(opIdx) {\n this.#bboxTracker.recordOpenMarker(\n opIdx,\n this.#recordDebugMetadataDepenencyAfterRestore\n );\n return this;\n }\n\n getOpenMarker() {\n return this.#bboxTracker.getOpenMarker();\n }\n\n recordCloseMarker(opIdx) {\n this.#bboxTracker.recordCloseMarker(\n opIdx,\n this.#recordDebugMetadataDepenencyAfterRestore\n );\n return this;\n }\n\n /**\n * @param {number} opIdx\n */\n beginMarkedContent(opIdx) {\n this.#bboxTracker.beginMarkedContent(opIdx);\n return this;\n }\n\n endMarkedContent(opIdx) {\n this.#bboxTracker.endMarkedContent(\n opIdx,\n this.#recordDebugMetadataDepenencyAfterRestore\n );\n return this;\n }\n\n pushBaseTransform(ctx) {\n this.#bboxTracker.pushBaseTransform(ctx);\n return this;\n }\n\n popBaseTransform() {\n this.#bboxTracker.popBaseTransform();\n return this;\n }\n\n /**\n * @param {SimpleDependency} name\n * @param {number} idx\n */\n recordSimpleData(name, idx) {\n this.#simple[name] = idx;\n return this;\n }\n\n /**\n * @param {IncrementalDependency} name\n * @param {number} idx\n */\n recordIncrementalData(name, idx) {\n this.#incremental[name].push(idx);\n return this;\n }\n\n /**\n * @param {IncrementalDependency} name\n * @param {number} idx\n */\n resetIncrementalData(name, idx) {\n this.#incremental[name].length = 0;\n return this;\n }\n\n recordNamedData(name, idx) {\n this.#namedDependencies.set(name, idx);\n return this;\n }\n\n /**\n * @param {SimpleDependency} name\n * @param {string} depName\n * @param {number} fallbackIdx\n */\n recordSimpleDataFromNamed(name, depName, fallbackIdx) {\n this.#simple[name] = this.#namedDependencies.get(depName) ?? fallbackIdx;\n }\n\n // All next operations, until the next .restore(), will depend on this\n recordFutureForcedDependency(name, idx) {\n this.recordIncrementalData(FORCED_DEPENDENCY_LABEL, idx);\n return this;\n }\n\n // All next operations, until the next .restore(), will depend on all\n // the already recorded data with the given names.\n inheritSimpleDataAsFutureForcedDependencies(names) {\n for (const name of names) {\n if (name in this.#simple) {\n this.recordFutureForcedDependency(name, this.#simple[name]);\n }\n }\n return this;\n }\n\n inheritPendingDependenciesAsFutureForcedDependencies() {\n for (const dep of this.#pendingDependencies) {\n this.recordFutureForcedDependency(FORCED_DEPENDENCY_LABEL, dep);\n }\n return this;\n }\n\n resetBBox(idx) {\n this.#bboxTracker.resetBBox(idx);\n return this;\n }\n\n recordClipBox(idx, ctx, minX, maxX, minY, maxY) {\n this.#bboxTracker.recordClipBox(idx, ctx, minX, maxX, minY, maxY);\n return this;\n }\n\n recordBBox(idx, ctx, minX, maxX, minY, maxY) {\n this.#bboxTracker.recordBBox(idx, ctx, minX, maxX, minY, maxY);\n return this;\n }\n\n recordCharacterBBox(idx, ctx, font, scale = 1, x = 0, y = 0, getMeasure) {\n const fontBBox = font.bbox;\n let isBBoxTrustworthy;\n let computedBBox;\n\n if (fontBBox) {\n isBBoxTrustworthy =\n // Only use the bounding box defined by the font if it\n // has a non-empty area.\n fontBBox[2] !== fontBBox[0] &&\n fontBBox[3] !== fontBBox[1] &&\n this.#fontBBoxTrustworthy.get(font);\n\n if (isBBoxTrustworthy !== false) {\n computedBBox = [0, 0, 0, 0];\n Util.axialAlignedBoundingBox(fontBBox, font.fontMatrix, computedBBox);\n if (scale !== 1 || x !== 0 || y !== 0) {\n scaleCharBBox(scale, -scale, x, y, computedBBox);\n }\n\n if (isBBoxTrustworthy) {\n return this.recordBBox(\n idx,\n ctx,\n computedBBox[0],\n computedBBox[2],\n computedBBox[1],\n computedBBox[3]\n );\n }\n }\n }\n\n if (!getMeasure) {\n // We have no way of telling how big this character actually is, record\n // a full page bounding box.\n return this.recordFullPageBBox(idx);\n }\n\n const measure = getMeasure();\n\n if (fontBBox && computedBBox && isBBoxTrustworthy === undefined) {\n // If it's the first time we can compare the font bbox with the actual\n // bbox measured when drawing it, check if the one recorded in the font\n // is large enough to cover the actual bbox. If it is, we assume that the\n // font is well-formed and we can use the declared bbox without having to\n // measure it again for every character.\n isBBoxTrustworthy =\n computedBBox[0] <= x - measure.actualBoundingBoxLeft &&\n computedBBox[2] >= x + measure.actualBoundingBoxRight &&\n computedBBox[1] <= y - measure.actualBoundingBoxAscent &&\n computedBBox[3] >= y + measure.actualBoundingBoxDescent;\n this.#fontBBoxTrustworthy.set(font, isBBoxTrustworthy);\n if (isBBoxTrustworthy) {\n return this.recordBBox(\n idx,\n ctx,\n computedBBox[0],\n computedBBox[2],\n computedBBox[1],\n computedBBox[3]\n );\n }\n }\n\n // The font has no bbox or it is not trustworthy, so we need to\n // return the bounding box based on .measureText().\n return this.recordBBox(\n idx,\n ctx,\n x - measure.actualBoundingBoxLeft,\n x + measure.actualBoundingBoxRight,\n y - measure.actualBoundingBoxAscent,\n y + measure.actualBoundingBoxDescent\n );\n }\n\n recordFullPageBBox(idx) {\n this.#bboxTracker.recordFullPageBBox(idx);\n return this;\n }\n\n getSimpleIndex(dependencyName) {\n return this.#simple[dependencyName];\n }\n\n recordDependencies(idx, dependencyNames) {\n const pendingDependencies = this.#pendingDependencies;\n const simple = this.#simple;\n const incremental = this.#incremental;\n for (const name of dependencyNames) {\n if (name in this.#simple) {\n pendingDependencies.add(simple[name]);\n } else if (name in incremental) {\n incremental[name].forEach(pendingDependencies.add, pendingDependencies);\n }\n }\n\n return this;\n }\n\n recordNamedDependency(idx, name) {\n if (this.#namedDependencies.has(name)) {\n this.#pendingDependencies.add(this.#namedDependencies.get(name));\n }\n\n return this;\n }\n\n /**\n * @param {number} idx\n * @param {boolean} [preserve=false] - When false, the pending dependencies\n * are cleared once recorded; pass true to keep them for later operations.\n */\n recordOperation(idx, preserve = false) {\n this.recordDependencies(idx, [FORCED_DEPENDENCY_LABEL]);\n\n if (this.#debugMetadata) {\n const metadata = ensureDebugMetadata(this.#debugMetadata, idx);\n const { dependencies } = metadata;\n this.#pendingDependencies.forEach(dependencies.add, dependencies);\n this.#bboxTracker._savesStack.forEach(dependencies.add, dependencies);\n this.#bboxTracker._markedContentStack.forEach(\n dependencies.add,\n dependencies\n );\n dependencies.delete(idx);\n metadata.isRenderingOperation = true;\n }\n\n const needsCleanup = !preserve && idx === this.#bboxTracker._pendingBBoxIdx;\n\n this.#bboxTracker.recordOperation(idx, preserve, [\n this.#pendingDependencies,\n this.#bboxTracker._savesStack,\n this.#bboxTracker._markedContentStack,\n ]);\n\n if (needsCleanup) {\n this.#pendingDependencies.clear();\n }\n\n return this;\n }\n\n recordShowTextOperation(idx, preserve = false) {\n const deps = Array.from(this.#pendingDependencies);\n this.recordOperation(idx, preserve);\n this.recordIncrementalData(\"sameLineText\", idx);\n for (const dep of deps) {\n this.recordIncrementalData(\"sameLineText\", dep);\n }\n return this;\n }\n\n bboxToClipBoxDropOperation(idx, preserve = false) {\n const needsCleanup = !preserve && idx === this.#bboxTracker._pendingBBoxIdx;\n this.#bboxTracker.bboxToClipBoxDropOperation(idx);\n if (needsCleanup) {\n this.#pendingDependencies.clear();\n }\n return this;\n }\n\n take() {\n this.#fontBBoxTrustworthy.clear();\n return this.#bboxTracker.take();\n }\n\n takeDebugMetadata() {\n return this.#debugMetadata;\n }\n}\n\n/**\n * Used to track dependencies of nested operations list, that\n * should actually all map to the index of the operation that\n * contains the nested list.\n * @implements {CanvasDependencyTracker}\n */\nclass CanvasNestedDependencyTracker {\n /** @type {CanvasDependencyTracker} */\n #dependencyTracker;\n\n /** @type {number} */\n #opIdx;\n\n #ignoreBBoxes;\n\n #nestingLevel = 0;\n\n #savesLevel = 0;\n\n constructor(dependencyTracker, opIdx, ignoreBBoxes) {\n if (\n dependencyTracker instanceof CanvasNestedDependencyTracker &&\n dependencyTracker.#ignoreBBoxes === !!ignoreBBoxes\n ) {\n // The goal of CanvasNestedDependencyTracker is to collapse all operations\n // into a single one. If we are already in a\n // CanvasNestedDependencyTracker, that is already happening.\n return dependencyTracker;\n }\n\n this.#dependencyTracker = dependencyTracker;\n this.#opIdx = opIdx;\n this.#ignoreBBoxes = !!ignoreBBoxes;\n }\n\n get clipBox() {\n return this.#dependencyTracker.clipBox;\n }\n\n growOperationsCount() {\n throw new Error(\"Unreachable\");\n }\n\n save(opIdx) {\n this.#savesLevel++;\n this.#dependencyTracker.save(this.#opIdx);\n return this;\n }\n\n restore(opIdx) {\n if (this.#savesLevel > 0) {\n this.#dependencyTracker.restore(this.#opIdx);\n this.#savesLevel--;\n }\n return this;\n }\n\n recordOpenMarker(idx) {\n this.#nestingLevel++;\n return this;\n }\n\n getOpenMarker() {\n return this.#nestingLevel > 0\n ? this.#opIdx\n : this.#dependencyTracker.getOpenMarker();\n }\n\n recordCloseMarker(idx) {\n this.#nestingLevel--;\n return this;\n }\n\n beginMarkedContent(opIdx) {\n return this;\n }\n\n endMarkedContent(opIdx) {\n return this;\n }\n\n pushBaseTransform(ctx) {\n this.#dependencyTracker.pushBaseTransform(ctx);\n return this;\n }\n\n popBaseTransform() {\n this.#dependencyTracker.popBaseTransform();\n return this;\n }\n\n /**\n * @param {SimpleDependency} name\n * @param {number} idx\n */\n recordSimpleData(name, idx) {\n this.#dependencyTracker.recordSimpleData(name, this.#opIdx);\n return this;\n }\n\n /**\n * @param {IncrementalDependency} name\n * @param {number} idx\n */\n recordIncrementalData(name, idx) {\n this.#dependencyTracker.recordIncrementalData(name, this.#opIdx);\n return this;\n }\n\n /**\n * @param {IncrementalDependency} name\n * @param {number} idx\n */\n resetIncrementalData(name, idx) {\n this.#dependencyTracker.resetIncrementalData(name, this.#opIdx);\n return this;\n }\n\n recordNamedData(name, idx) {\n // Nested dependencies are not visible to the outside.\n return this;\n }\n\n /**\n * @param {SimpleDependency} name\n * @param {string} depName\n * @param {number} fallbackIdx\n */\n recordSimpleDataFromNamed(name, depName, fallbackIdx) {\n this.#dependencyTracker.recordSimpleDataFromNamed(\n name,\n depName,\n this.#opIdx\n );\n return this;\n }\n\n // All next operations, until the next .restore(), will depend on this\n recordFutureForcedDependency(name, idx) {\n this.#dependencyTracker.recordFutureForcedDependency(name, this.#opIdx);\n return this;\n }\n\n // All next operations, until the next .restore(), will depend on all\n // the already recorded data with the given names.\n inheritSimpleDataAsFutureForcedDependencies(names) {\n this.#dependencyTracker.inheritSimpleDataAsFutureForcedDependencies(names);\n return this;\n }\n\n inheritPendingDependenciesAsFutureForcedDependencies() {\n this.#dependencyTracker.inheritPendingDependenciesAsFutureForcedDependencies();\n return this;\n }\n\n resetBBox(idx) {\n if (!this.#ignoreBBoxes) {\n this.#dependencyTracker.resetBBox(this.#opIdx);\n }\n return this;\n }\n\n recordClipBox(idx, ctx, minX, maxX, minY, maxY) {\n if (!this.#ignoreBBoxes) {\n this.#dependencyTracker.recordClipBox(\n this.#opIdx,\n ctx,\n minX,\n maxX,\n minY,\n maxY\n );\n }\n return this;\n }\n\n recordBBox(idx, ctx, minX, maxX, minY, maxY) {\n if (!this.#ignoreBBoxes) {\n this.#dependencyTracker.recordBBox(\n this.#opIdx,\n ctx,\n minX,\n maxX,\n minY,\n maxY\n );\n }\n return this;\n }\n\n recordCharacterBBox(idx, ctx, font, scale, x, y, getMeasure) {\n if (!this.#ignoreBBoxes) {\n this.#dependencyTracker.recordCharacterBBox(\n this.#opIdx,\n ctx,\n font,\n scale,\n x,\n y,\n getMeasure\n );\n }\n return this;\n }\n\n recordFullPageBBox(idx) {\n if (!this.#ignoreBBoxes) {\n this.#dependencyTracker.recordFullPageBBox(this.#opIdx);\n }\n return this;\n }\n\n getSimpleIndex(dependencyName) {\n return this.#dependencyTracker.getSimpleIndex(dependencyName);\n }\n\n recordDependencies(idx, dependencyNames) {\n this.#dependencyTracker.recordDependencies(this.#opIdx, dependencyNames);\n return this;\n }\n\n recordNamedDependency(idx, name) {\n this.#dependencyTracker.recordNamedDependency(this.#opIdx, name);\n return this;\n }\n\n /**\n * @param {number} idx\n */\n recordOperation(idx) {\n this.#dependencyTracker.recordOperation(this.#opIdx, true);\n return this;\n }\n\n recordShowTextOperation(idx) {\n this.#dependencyTracker.recordShowTextOperation(this.#opIdx, true);\n return this;\n }\n\n bboxToClipBoxDropOperation(idx) {\n if (!this.#ignoreBBoxes) {\n this.#dependencyTracker.bboxToClipBoxDropOperation(this.#opIdx, true);\n }\n return this;\n }\n\n take() {\n throw new Error(\"Unreachable\");\n }\n\n takeDebugMetadata() {\n throw new Error(\"Unreachable\");\n }\n}\n\n/** @satisfies {Record} */\nconst Dependencies = {\n stroke: [\n \"path\",\n \"transform\",\n \"filter\",\n \"strokeColor\",\n \"strokeAlpha\",\n \"lineWidth\",\n \"lineCap\",\n \"lineJoin\",\n \"miterLimit\",\n \"dash\",\n ],\n fill: [\n \"path\",\n \"transform\",\n \"filter\",\n \"fillColor\",\n \"fillAlpha\",\n \"globalCompositeOperation\",\n \"SMask\",\n ],\n imageXObject: [\n \"transform\",\n \"SMask\",\n \"filter\",\n \"fillAlpha\",\n \"strokeAlpha\",\n \"globalCompositeOperation\",\n ],\n rawFillPath: [\"filter\", \"fillColor\", \"fillAlpha\"],\n showText: [\n \"transform\",\n \"leading\",\n \"charSpacing\",\n \"wordSpacing\",\n \"hScale\",\n \"textRise\",\n \"moveText\",\n \"textMatrix\",\n \"font\",\n \"fontObj\",\n \"filter\",\n \"fillColor\",\n \"textRenderingMode\",\n \"SMask\",\n \"fillAlpha\",\n \"strokeAlpha\",\n \"globalCompositeOperation\",\n\n \"sameLineText\",\n ],\n transform: [\"transform\"],\n transformAndFill: [\"transform\", \"filter\", \"fillColor\"],\n};\n\n/**\n * Track the locations of images in the canvas. For each image it computes\n * a bounding box as a potentially rotated rectangle, matching the rotation of\n * the current canvas transform.\n */\nclass CanvasImagesTracker {\n #canvasWidth;\n\n #canvasHeight;\n\n #capacity = 4;\n\n #count = 0;\n\n // Array of [x1, y1, x2, y2, x3, y3] coordinates.\n // We need three points to be able to represent a rectangle with a transform\n // applied.\n #coords = new CanvasImagesTracker.#CoordsArray(this.#capacity * 6);\n\n static #CoordsArray =\n (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) ||\n FeatureTest.isFloat16ArraySupported\n ? Float16Array\n : Float32Array;\n\n constructor(canvas) {\n this.#canvasWidth = canvas.width;\n this.#canvasHeight = canvas.height;\n }\n\n record(ctx, width, height, clipBox) {\n if (this.#count === this.#capacity) {\n this.#capacity *= 2;\n const newCoords = new CanvasImagesTracker.#CoordsArray(\n this.#capacity * 6\n );\n newCoords.set(this.#coords);\n this.#coords = newCoords;\n }\n\n const transform = getCurrentTransform(ctx);\n\n // We want top left, bottom left, top right.\n // (0, 0) is the bottom left corner.\n let coords;\n\n if (clipBox[0] !== Infinity) {\n const bbox = BBOX_INIT.slice();\n Util.axialAlignedBoundingBox([0, -height, width, 0], transform, bbox);\n\n const finalBBox = Util.intersect(clipBox, bbox);\n if (!finalBBox) {\n // The image is fully clipped out.\n return;\n }\n\n const [minX, minY, maxX, maxY] = finalBBox;\n\n if (\n minX !== bbox[0] ||\n minY !== bbox[1] ||\n maxX !== bbox[2] ||\n maxY !== bbox[3]\n ) {\n // The clip box affects the image drawing. We need to compute a\n // transform that takes the image bbox and fits it into the final bbox,\n // so that we can then apply it to the original image shape (the\n // non-axially-aligned rectangle).\n const rotationAngle = Math.atan2(transform[1], transform[0]);\n\n // Normalize the angle to be between 0 and 90 degrees.\n const sin = Math.abs(Math.sin(rotationAngle));\n const cos = Math.abs(Math.cos(rotationAngle));\n\n if (\n sin < 1e-6 ||\n cos < 1e-6 ||\n // The logic in the `else` case gives more accurate bounding boxes for\n // rotated images, but the equation it uses does not give a result\n // when the rotation is exactly 45 degrees, because there are infinite\n // possible rectangles that can fit into the same bbox with that same\n // 45deg rotation. Fallback to returning the whole bbox.\n Math.abs(sin - cos) < 1e-6\n ) {\n coords = [minX, minY, minX, maxY, maxX, minY];\n } else {\n // We cannot just scale the bbox into the original bbox, because that\n // would not preserve the 90deg corners if they have been rotated.\n // We instead need to find the transform that maps the original\n // rectangle into the only rectangle that is rotated by the expected\n // angle and fits into the final bbox.\n //\n // This represents the final bbox, with the top-left corner having\n // coordinates (minX, minY) and the bottom-right corner having\n // coordinates (maxX, maxY). Alpha is the rotation angle, and a and b\n // are helper variables used to compute the effective transform.\n //\n // ------------b----------\n // +-----------------------*----+\n // | | _ -‾ \\ |\n // a | _ -‾ \\ |\n // | |alpha _ -‾ \\ |\n // | | _ -‾ \\|\n // |\\ _ -‾|\n // | \\ _ -‾ |\n // | \\ _ -‾ |\n // | \\ _ -‾ |\n // +----*-----------------------+\n\n const finalBBoxWidth = maxX - minX;\n const finalBBoxHeight = maxY - minY;\n\n const sin2 = sin * sin;\n const cos2 = cos * cos;\n const cosSin = cos * sin;\n const denom = cos2 - sin2;\n\n const a = (finalBBoxHeight * cos2 - finalBBoxWidth * cosSin) / denom;\n const b = (finalBBoxHeight * cosSin - finalBBoxWidth * sin2) / denom;\n\n coords = [minX + b, minY, minX, minY + a, maxX, maxY - a];\n }\n }\n }\n\n if (!coords) {\n coords = [0, -height, 0, 0, width, -height];\n Util.applyTransform(coords, transform, 0);\n Util.applyTransform(coords, transform, 2);\n Util.applyTransform(coords, transform, 4);\n }\n coords[0] /= this.#canvasWidth;\n coords[1] /= this.#canvasHeight;\n coords[2] /= this.#canvasWidth;\n coords[3] /= this.#canvasHeight;\n coords[4] /= this.#canvasWidth;\n coords[5] /= this.#canvasHeight;\n this.#coords.set(coords, this.#count * 6);\n this.#count++;\n }\n\n take() {\n return this.#coords.subarray(0, this.#count * 6);\n }\n}\n\nexport {\n CanvasBBoxTracker,\n CanvasDependencyTracker,\n CanvasImagesTracker,\n CanvasNestedDependencyTracker,\n Dependencies,\n};\n","/* Copyright 2026 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nconst CONTROL_CHAR_REGEXP = /\\p{Cc}/u;\n\n/**\n * Checks if the given value already is a well-formed CSS , i.e. a\n * value which can be used verbatim since it cannot introduce delimiters.\n * See https://drafts.csswg.org/css-syntax/#string-token-diagram.\n * @param {string} str\n * @returns {boolean}\n */\nfunction isCSSString(str) {\n const quote = str[0];\n if (\n str.length < 2 ||\n (quote !== `\"` && quote !== `'`) ||\n str.at(-1) !== quote\n ) {\n return false;\n }\n const end = str.length - 1;\n for (let i = 1; i < end; i++) {\n const char = str[i];\n if (char === quote || CONTROL_CHAR_REGEXP.test(char)) {\n return false;\n }\n if (char === \"\\\\\") {\n // Skip the escaped character. A trailing backslash would instead escape\n // the closing quote, and control characters must not occur in a CSS\n // even when escaped this way.\n if (++i >= end || CONTROL_CHAR_REGEXP.test(str[i])) {\n return false;\n }\n }\n }\n return true;\n}\n\n/**\n * Serializes a font family, originating from the PDF document, such that it\n * can safely be interpolated into CSS.\n * @param {string} fontFamily\n * @returns {string}\n */\nfunction serializeFontFamily(fontFamily) {\n if (isCSSString(fontFamily)) {\n return fontFamily;\n }\n // Always emit a , rather than a sequence, since both\n // denote the same family name but only the former cannot be mistaken for a\n // generic family (e.g. `serif`) or a CSS-wide keyword (e.g. `inherit`);\n // those are not valid font family names and would be ignored.\n // Control characters use hexadecimal escapes, since CSS line terminators\n // cannot be escaped by simply prefixing them with a backslash.\n const escaped = fontFamily.replaceAll(/[\"\\\\\\p{Cc}]/gu, char =>\n char === `\"` || char === \"\\\\\"\n ? `\\\\${char}`\n : `\\\\${char.codePointAt(0).toString(16)} `\n );\n return `\"${escaped}\"`;\n}\n\nexport { CONTROL_CHAR_REGEXP, serializeFontFamily };\n","/* Copyright 2012 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n assert,\n FeatureTest,\n isNodeJS,\n shadow,\n unreachable,\n warn,\n} from \"../shared/util.js\";\nimport { makePathFromDrawOPS } from \"./display_utils.js\";\nimport { serializeFontFamily } from \"../shared/css_utils.js\";\n\nclass FontLoader {\n #nativeFontFaces = new Set();\n\n #systemFonts = new Set();\n\n #styleSheet = null;\n\n constructor({\n ownerDocument = globalThis.document,\n styleElement = null, // For testing only.\n }) {\n this._document = ownerDocument;\n\n this.styleElement =\n typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")\n ? styleElement\n : null;\n\n if (\n typeof PDFJSDev === \"undefined\" ||\n !PDFJSDev.test(\"MOZCENTRAL || WORKER_THREAD\")\n ) {\n this.loadingRequests = [];\n this.loadTestFontId = 0;\n }\n }\n\n addNativeFontFace(nativeFontFace) {\n this.#nativeFontFaces.add(nativeFontFace);\n this._document.fonts.add(nativeFontFace);\n }\n\n removeNativeFontFace(nativeFontFace) {\n this.#nativeFontFaces.delete(nativeFontFace);\n this._document.fonts.delete(nativeFontFace);\n }\n\n insertRule(rule) {\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"WORKER_THREAD\")) {\n throw new Error(\"Not implemented: insertRule\");\n }\n\n const styleSheet = this.#getStyleSheet();\n styleSheet.insertRule(rule, styleSheet.cssRules.length);\n }\n\n #getStyleSheet() {\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"WORKER_THREAD\")) {\n throw new Error(\"Not implemented: #getStyleSheet\");\n }\n\n if (this.#styleSheet) {\n return this.#styleSheet;\n }\n\n // Constructable stylesheets aren't blocked by CSP inline-style checks.\n // Use the constructor from the document's own window, since\n // `this._document` may belong to a different window (e.g. a print iframe)\n // and a constructable stylesheet can only be adopted by the document it was\n // created for.\n const StyleSheet =\n this._document.defaultView?.CSSStyleSheet || globalThis.CSSStyleSheet;\n if (!this.styleElement && StyleSheet) {\n const { adoptedStyleSheets } = this._document;\n if (adoptedStyleSheets) {\n const styleSheet = new StyleSheet();\n adoptedStyleSheets.push(styleSheet);\n return (this.#styleSheet = styleSheet);\n }\n }\n\n if (!this.styleElement) {\n this.styleElement = this._document.createElement(\"style\");\n this._document.documentElement\n .getElementsByTagName(\"head\")[0]\n .append(this.styleElement);\n }\n return (this.#styleSheet = this.styleElement.sheet);\n }\n\n clear() {\n for (const nativeFontFace of this.#nativeFontFaces) {\n this._document.fonts.delete(nativeFontFace);\n }\n this.#nativeFontFaces.clear();\n this.#systemFonts.clear();\n\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"WORKER_THREAD\")) {\n return;\n }\n if (this.#styleSheet) {\n const { adoptedStyleSheets } = this._document;\n if (adoptedStyleSheets?.includes(this.#styleSheet)) {\n this._document.adoptedStyleSheets = adoptedStyleSheets.filter(\n styleSheet => styleSheet !== this.#styleSheet\n );\n }\n this.#styleSheet = null;\n }\n this.styleElement?.remove();\n this.styleElement = null;\n }\n\n async loadSystemFont({\n systemFontInfo: info,\n disableFontFace,\n _inspectFont,\n }) {\n if (!info || this.#systemFonts.has(info.loadedName)) {\n return;\n }\n assert(\n !disableFontFace,\n \"loadSystemFont shouldn't be called when `disableFontFace` is set.\"\n );\n\n if (this.isFontLoadingAPISupported) {\n const { loadedName, src, style } = info;\n const fontFace = new FontFace(loadedName, src, style);\n this.addNativeFontFace(fontFace);\n try {\n await fontFace.load();\n this.#systemFonts.add(loadedName);\n _inspectFont?.(info);\n } catch {\n warn(\n `Cannot load system font: ${info.baseFontName}, installing it could help to improve PDF rendering.`\n );\n\n this.removeNativeFontFace(fontFace);\n }\n return;\n }\n\n unreachable(\n \"Not implemented: loadSystemFont without the Font Loading API.\"\n );\n }\n\n async bind(font) {\n // Add the font to the DOM only once; skip if the font is already loaded.\n if (font.attached || (font.missingFile && !font.systemFontInfo)) {\n return;\n }\n font.attached = true;\n\n if (font.systemFontInfo) {\n await this.loadSystemFont(font);\n return;\n }\n\n if (this.isFontLoadingAPISupported) {\n const nativeFontFace = font.createNativeFontFace();\n if (nativeFontFace) {\n this.addNativeFontFace(nativeFontFace);\n try {\n await nativeFontFace.loaded;\n } catch (ex) {\n warn(`Failed to load font '${nativeFontFace.family}': '${ex}'.`);\n\n // When font loading failed, fall back to the built-in font renderer.\n font.disableFontFace = true;\n throw ex;\n }\n }\n return; // The font was, asynchronously, loaded.\n }\n\n // !this.isFontLoadingAPISupported\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"WORKER_THREAD\")) {\n throw new Error(\"Not implemented: DOM font loading\");\n }\n const rule = font.createFontFaceRule();\n if (rule) {\n this.insertRule(rule);\n\n if (this.isSyncFontLoadingSupported) {\n return; // The font was, synchronously, loaded.\n }\n await this.#testFontLoaded(font);\n // The font was, asynchronously, loaded.\n }\n }\n\n get isFontLoadingAPISupported() {\n if (\n (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) &&\n this.styleElement\n ) {\n return shadow(this, \"isFontLoadingAPISupported\", false);\n }\n return shadow(this, \"isFontLoadingAPISupported\", !!this._document?.fonts);\n }\n\n get isSyncFontLoadingSupported() {\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n return shadow(this, \"isSyncFontLoadingSupported\", true);\n }\n\n // Node.js - we can pretend that sync font loading is supported.\n // Firefox, from version 14, supports synchronous font loading.\n return shadow(\n this,\n \"isSyncFontLoadingSupported\",\n (typeof PDFJSDev === \"undefined\" || !PDFJSDev.test(\"CHROME\")) &&\n (isNodeJS || FeatureTest.platform.isFirefox)\n );\n }\n\n #testFontLoaded(font) {\n if (\n typeof PDFJSDev !== \"undefined\" &&\n PDFJSDev.test(\"MOZCENTRAL || WORKER_THREAD\")\n ) {\n throw new Error(\"Not implemented: #testFontLoaded\");\n }\n\n function completeRequest() {\n assert(!request.done, \"completeRequest() cannot be called twice.\");\n request.done = true;\n\n // Sending all completed requests in order of how they were queued.\n while (loadingRequests.length > 0 && loadingRequests[0].done) {\n const otherRequest = loadingRequests.shift();\n setTimeout(otherRequest.resolve, 0);\n }\n }\n\n const { loadingRequests } = this;\n const { promise, resolve } = Promise.withResolvers();\n const request = {\n done: false,\n resolve,\n };\n loadingRequests.push(request);\n\n // This is a CFF font with 1 glyph for '.' that fills its entire width\n // and height.\n this._loadTestFont ??= atob(\n \"T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQA\" +\n \"FQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAA\" +\n \"ALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgA\" +\n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AAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAA\" +\n \"AAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQAC\" +\n \"AQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3\" +\n \"Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTj\" +\n \"FQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==\"\n );\n\n /** Hack begin */\n // There's currently no event when a font has finished downloading so the\n // following code is a dirty hack to 'guess' when a font is ready.\n // It's assumed fonts are loaded in order, so add a known test font after\n // the desired fonts and then test for the loading of that test font.\n\n function int32(data, offset) {\n return (\n (data.charCodeAt(offset) << 24) |\n (data.charCodeAt(offset + 1) << 16) |\n (data.charCodeAt(offset + 2) << 8) |\n (data.charCodeAt(offset + 3) & 0xff)\n );\n }\n function string32(value) {\n return String.fromCharCode(\n (value >> 24) & 0xff,\n (value >> 16) & 0xff,\n (value >> 8) & 0xff,\n value & 0xff\n );\n }\n function spliceString(s, offset, remove, insert) {\n const chunk1 = s.substring(0, offset);\n const chunk2 = s.substring(offset + remove);\n return chunk1 + insert + chunk2;\n }\n let i, ii;\n\n // The temporary canvas is used to determine if fonts are loaded.\n const canvas = this._document.createElement(\"canvas\");\n canvas.width = 1;\n canvas.height = 1;\n const ctx = canvas.getContext(\"2d\");\n\n let called = 0;\n function isFontReady(name, callback) {\n // With setTimeout clamping this gives the font ~100ms to load.\n if (++called > 30) {\n warn(\"Load test font never loaded.\");\n callback();\n return;\n }\n ctx.font = \"30px \" + name;\n ctx.fillText(\".\", 0, 20);\n const imageData = ctx.getImageData(0, 0, 1, 1);\n if (imageData.data[3] > 0) {\n callback();\n return;\n }\n setTimeout(isFontReady.bind(null, name, callback));\n }\n\n const loadTestFontId = `lt${Date.now()}${this.loadTestFontId++}`;\n // Chromium seems to cache fonts based on a hash of the actual font data,\n // so the font must be modified for each load test else it will appear to\n // be loaded already.\n // TODO: This could maybe be made faster by avoiding the btoa of the full\n // font by splitting it in chunks before hand and padding the font id.\n let data = this._loadTestFont;\n const COMMENT_OFFSET = 976; // has to be on 4 byte boundary (for checksum)\n data = spliceString(\n data,\n COMMENT_OFFSET,\n loadTestFontId.length,\n loadTestFontId\n );\n // CFF checksum is important for IE, adjusting it\n const CFF_CHECKSUM_OFFSET = 16;\n const XXXX_VALUE = 0x58585858; // the \"comment\" filled with 'X'\n let checksum = int32(data, CFF_CHECKSUM_OFFSET);\n for (i = 0, ii = loadTestFontId.length - 3; i < ii; i += 4) {\n checksum = (checksum - XXXX_VALUE + int32(loadTestFontId, i)) | 0;\n }\n if (i < loadTestFontId.length) {\n // align to 4 bytes boundary\n checksum = (checksum - XXXX_VALUE + int32(loadTestFontId + \"XXX\", i)) | 0;\n }\n data = spliceString(data, CFF_CHECKSUM_OFFSET, 4, string32(checksum));\n\n const url = `url(data:font/opentype;base64,${btoa(data)});`;\n const rule = `@font-face {font-family:\"${loadTestFontId}\";src:${url}}`;\n this.insertRule(rule);\n\n const div = this._document.createElement(\"div\");\n div.style.visibility = \"hidden\";\n div.style.width = div.style.height = \"10px\";\n div.style.position = \"absolute\";\n div.style.top = div.style.left = \"0px\";\n\n for (const name of [font.loadedName, loadTestFontId]) {\n const span = this._document.createElement(\"span\");\n span.textContent = \"Hi\";\n span.style.fontFamily = name;\n div.append(span);\n }\n this._document.body.append(div);\n\n isFontReady(loadTestFontId, () => {\n div.remove();\n completeRequest();\n });\n /** Hack end */\n\n return promise;\n }\n}\n\nclass FontFaceObject {\n #compiledPaths = new Map();\n\n #fontData;\n\n constructor(translatedData, inspectFont = null, charProcOperatorList, extra) {\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n assert(\n typeof translatedData.disableFontFace === \"boolean\",\n \"disableFontFace must be available.\"\n );\n assert(\n typeof translatedData.fontExtraProperties === \"boolean\",\n \"fontExtraProperties must be available.\"\n );\n }\n this.#fontData = translatedData;\n this._inspectFont = inspectFont;\n\n if (charProcOperatorList) {\n this.charProcOperatorList = charProcOperatorList;\n }\n if (extra) {\n Object.assign(this, extra);\n }\n }\n\n createNativeFontFace() {\n const { data } = this; // Get `data` just once, since it's not shadowed.\n if (!data || this.disableFontFace) {\n return null;\n }\n let nativeFontFace;\n if (!this.cssFontInfo) {\n nativeFontFace = new FontFace(this.loadedName, data, {});\n } else {\n const css = {\n weight: this.cssFontInfo.fontWeight,\n };\n if (this.cssFontInfo.italicAngle) {\n css.style = `oblique ${this.cssFontInfo.italicAngle}deg`;\n }\n nativeFontFace = new FontFace(\n serializeFontFamily(this.cssFontInfo.fontFamily),\n data,\n css\n );\n }\n\n this._inspectFont?.(this);\n return nativeFontFace;\n }\n\n createFontFaceRule() {\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"WORKER_THREAD\")) {\n throw new Error(\"Not implemented: createFontFaceRule\");\n }\n\n const { data } = this; // Get `data` just once, since it's not shadowed.\n if (!data || this.disableFontFace) {\n return null;\n }\n // Add the @font-face rule to the document.\n const url = `url(data:${this.mimetype};base64,${data.toBase64()});`;\n let rule;\n if (!this.cssFontInfo) {\n rule = `@font-face {font-family:\"${this.loadedName}\";src:${url}}`;\n } else {\n let css = `font-weight: ${this.cssFontInfo.fontWeight};`;\n if (this.cssFontInfo.italicAngle) {\n css += `font-style: oblique ${this.cssFontInfo.italicAngle}deg;`;\n }\n // The font family originates from the PDF document, hence it must be\n // serialized as a to prevent arbitrary rule injection.\n const fontFamily = serializeFontFamily(this.cssFontInfo.fontFamily);\n rule = `@font-face {font-family:${fontFamily};${css}src:${url}}`;\n }\n\n this._inspectFont?.(this, url);\n return rule;\n }\n\n getPathGenerator(objs, character) {\n let path = this.#compiledPaths.get(character);\n if (path) {\n return path;\n }\n\n const objId = `${this.loadedName}_path_${character}`;\n let cmds;\n try {\n cmds = objs.get(objId);\n } catch (ex) {\n warn(`getPathGenerator - ignoring character: \"${ex}\".`);\n }\n path = makePathFromDrawOPS(cmds?.path);\n\n if (!this.fontExtraProperties) {\n // Remove the raw path-data, since we don't need it anymore.\n objs.delete(objId);\n }\n this.#compiledPaths.set(character, path);\n return path;\n }\n\n get black() {\n return this.#fontData.black;\n }\n\n get bold() {\n return this.#fontData.bold;\n }\n\n get disableFontFace() {\n return this.#fontData.disableFontFace;\n }\n\n set disableFontFace(value) {\n shadow(this, \"disableFontFace\", !!value);\n }\n\n get fontExtraProperties() {\n return this.#fontData.fontExtraProperties;\n }\n\n get isInvalidPDFjsFont() {\n return this.#fontData.isInvalidPDFjsFont;\n }\n\n get isType3Font() {\n return this.#fontData.isType3Font;\n }\n\n get italic() {\n return this.#fontData.italic;\n }\n\n get missingFile() {\n return this.#fontData.missingFile;\n }\n\n get remeasure() {\n return this.#fontData.remeasure;\n }\n\n get vertical() {\n return this.#fontData.vertical;\n }\n\n get bbox() {\n return this.#fontData.bbox;\n }\n\n get fontMatrix() {\n return this.#fontData.fontMatrix;\n }\n\n get fallbackName() {\n return this.#fontData.fallbackName;\n }\n\n get loadedName() {\n return this.#fontData.loadedName;\n }\n\n get mimetype() {\n return this.missingFile ? null : \"font/opentype\";\n }\n\n get data() {\n return this.#fontData.data;\n }\n\n clearData() {\n this.#fontData.clearData();\n }\n\n get cssFontInfo() {\n return this.#fontData.cssFontInfo;\n }\n\n get systemFontInfo() {\n return this.#fontData.systemFontInfo;\n }\n}\n\nexport { FontFaceObject, FontLoader };\n","/* Copyright 2025 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { shadow } from \"./util.js\";\n\nclass CSS_FONT_INFO {\n static strings = [\"fontFamily\", \"fontWeight\", \"italicAngle\"];\n}\n\nclass SYSTEM_FONT_INFO {\n static strings = [\"css\", \"loadedName\", \"baseFontName\", \"src\"];\n}\n\nclass FONT_INFO {\n static bools = [\n \"black\",\n \"bold\",\n \"disableFontFace\",\n \"fontExtraProperties\",\n \"isInvalidPDFjsFont\",\n \"isType3Font\",\n \"italic\",\n \"missingFile\",\n \"remeasure\",\n \"vertical\",\n ];\n\n static strings = [\"fallbackName\", \"loadedName\"];\n\n static OFFSET_BBOX = Math.ceil((this.bools.length * 2) / 8);\n\n static OFFSET_FONT_MATRIX = this.OFFSET_BBOX + 1 + 2 * 4;\n\n static OFFSET_STRINGS = this.OFFSET_FONT_MATRIX + 1 + 8 * 6;\n}\n\nclass PATTERN_INFO {\n static KIND = 0; // 1=axial, 2=radial, 3=mesh\n\n static HAS_BBOX = 1; // 0/1\n\n static HAS_BACKGROUND = 2; // 0/1 (background for mesh patterns)\n\n static SHADING_TYPE = 3; // shadingType (only for mesh patterns)\n\n static N_COORD = 4; // number of coordinate pairs\n\n static N_COLOR = 8; // number of RGBA-stride color entries\n\n static N_STOP = 12; // number of gradient stops\n\n static N_FIGURES = 16; // number of figures\n}\n\nclass InfoUtils {\n static get decoder() {\n return shadow(this, \"decoder\", new TextDecoder());\n }\n\n static get encoder() {\n return shadow(this, \"encoder\", new TextEncoder());\n }\n}\n\nexport { CSS_FONT_INFO, FONT_INFO, InfoUtils, PATTERN_INFO, SYSTEM_FONT_INFO };\n","/* Copyright 2025 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n assert,\n BBOX_INIT,\n FeatureTest,\n shadow,\n Util,\n} from \"../shared/util.js\";\nimport {\n CSS_FONT_INFO,\n FONT_INFO,\n InfoUtils,\n PATTERN_INFO,\n SYSTEM_FONT_INFO,\n} from \"../shared/obj_bin_transform_utils.js\";\n\nfunction readString(buffer, view, index, offset = 0) {\n const { decoder } = InfoUtils;\n for (let i = 0; i < index; i++) {\n offset += view.getUint32(offset) + 4;\n }\n const length = view.getUint32(offset);\n return decoder.decode(new Uint8Array(buffer, offset + 4, length));\n}\n\nclass CssFontInfo {\n #buffer;\n\n #view;\n\n constructor(buffer) {\n this.#buffer = buffer;\n this.#view = new DataView(buffer);\n }\n\n #readString(index) {\n assert(index < CSS_FONT_INFO.strings.length, \"Invalid string index\");\n return readString(this.#buffer, this.#view, index);\n }\n\n get fontFamily() {\n return shadow(this, \"fontFamily\", this.#readString(0));\n }\n\n get fontWeight() {\n return shadow(this, \"fontWeight\", this.#readString(1));\n }\n\n get italicAngle() {\n return shadow(this, \"italicAngle\", this.#readString(2));\n }\n}\n\nclass SystemFontInfo {\n #buffer;\n\n #view;\n\n constructor(buffer) {\n this.#buffer = buffer;\n this.#view = new DataView(buffer);\n }\n\n #readString(index) {\n assert(index < SYSTEM_FONT_INFO.strings.length, \"Invalid string index\");\n return readString(this.#buffer, this.#view, index, /* offset = */ 4);\n }\n\n get css() {\n return shadow(this, \"css\", this.#readString(0));\n }\n\n get loadedName() {\n return shadow(this, \"loadedName\", this.#readString(1));\n }\n\n get baseFontName() {\n return shadow(this, \"baseFontName\", this.#readString(2));\n }\n\n get src() {\n return shadow(this, \"src\", this.#readString(3));\n }\n\n get style() {\n let offset = 0;\n offset += 4 + this.#view.getUint32(offset);\n const style = readString(this.#buffer, this.#view, /* index = */ 0, offset),\n weight = readString(this.#buffer, this.#view, /* index = */ 1, offset);\n return shadow(this, \"style\", { style, weight });\n }\n}\n\nclass FontInfo {\n #buffer;\n\n #view;\n\n constructor(buffer) {\n this.#buffer = buffer;\n this.#view = new DataView(buffer);\n }\n\n #readBoolean(index) {\n assert(index < FONT_INFO.bools.length, \"Invalid boolean index\");\n const byteOffset = Math.floor(index / 4);\n const bitOffset = (index * 2) % 8;\n const value = (this.#view.getUint8(byteOffset) >> bitOffset) & 0x03;\n return value === 0x00 ? undefined : value === 0x02;\n }\n\n get black() {\n return shadow(this, \"black\", this.#readBoolean(0));\n }\n\n get bold() {\n return shadow(this, \"bold\", this.#readBoolean(1));\n }\n\n get disableFontFace() {\n return shadow(this, \"disableFontFace\", this.#readBoolean(2));\n }\n\n get fontExtraProperties() {\n return shadow(this, \"fontExtraProperties\", this.#readBoolean(3));\n }\n\n get isInvalidPDFjsFont() {\n return shadow(this, \"isInvalidPDFjsFont\", this.#readBoolean(4));\n }\n\n get isType3Font() {\n return shadow(this, \"isType3Font\", this.#readBoolean(5));\n }\n\n get italic() {\n return shadow(this, \"italic\", this.#readBoolean(6));\n }\n\n get missingFile() {\n return shadow(this, \"missingFile\", this.#readBoolean(7));\n }\n\n get remeasure() {\n return shadow(this, \"remeasure\", this.#readBoolean(8));\n }\n\n get vertical() {\n return shadow(this, \"vertical\", this.#readBoolean(9));\n }\n\n #readArray(offset, arrLen, lookupName, increment) {\n const len = this.#view.getUint8(offset++);\n if (len === 0) {\n return undefined;\n }\n assert(len === arrLen, \"Invalid array length.\");\n const arr = new Array(len);\n for (let i = 0; i < len; i++) {\n arr[i] = this.#view[lookupName](offset, true);\n offset += increment;\n }\n return arr;\n }\n\n get bbox() {\n return shadow(\n this,\n \"bbox\",\n this.#readArray(\n /* offset = */ FONT_INFO.OFFSET_BBOX,\n /* arrLen = */ 4,\n /* lookup = */ \"getInt16\",\n /* increment = */ 2\n )\n );\n }\n\n get fontMatrix() {\n return shadow(\n this,\n \"fontMatrix\",\n this.#readArray(\n /* offset = */ FONT_INFO.OFFSET_FONT_MATRIX,\n /* arrLen = */ 6,\n /* lookup = */ \"getFloat64\",\n /* increment = */ 8\n )\n );\n }\n\n #readString(index) {\n assert(index < FONT_INFO.strings.length, \"Invalid string index\");\n return readString(\n this.#buffer,\n this.#view,\n index,\n /* offset = */ FONT_INFO.OFFSET_STRINGS + 4\n );\n }\n\n get fallbackName() {\n return shadow(this, \"fallbackName\", this.#readString(0));\n }\n\n get loadedName() {\n return shadow(this, \"loadedName\", this.#readString(1));\n }\n\n #getBufferOffset(index) {\n let offset = FONT_INFO.OFFSET_STRINGS;\n // We need to move past any string-data first, hence the `<=` condition.\n for (let i = 0; i <= index; i++) {\n offset += 4 + this.#view.getUint32(offset);\n }\n const length = this.#view.getUint32(offset);\n\n return { offset, length };\n }\n\n // NOTE: This cannot be shadowed, since it may be cleared.\n get data() {\n const { offset, length } = this.#getBufferOffset(2);\n return !length\n ? undefined\n : new Uint8Array(this.#buffer, offset + 4, length);\n }\n\n clearData() {\n const { offset, length } = this.#getBufferOffset(2);\n if (!length) {\n return; // The data is either not present, or it was previously cleared.\n }\n this.#view.setUint32(offset, 0); // Zero the data-length.\n\n // Replace the buffer/view with only its contents *before* the data-block.\n this.#buffer = new Uint8Array(this.#buffer, 0, offset + 4).slice().buffer;\n this.#view = new DataView(this.#buffer);\n }\n\n get cssFontInfo() {\n const { offset, length } = this.#getBufferOffset(1);\n let info = null;\n if (length) {\n const data = new Uint8Array(this.#buffer, offset + 4, length).slice();\n info = new CssFontInfo(data.buffer);\n }\n return shadow(this, \"cssFontInfo\", info);\n }\n\n get systemFontInfo() {\n const { offset, length } = this.#getBufferOffset(0);\n let info = null;\n if (length) {\n const data = new Uint8Array(this.#buffer, offset + 4, length).slice();\n info = new SystemFontInfo(data.buffer);\n }\n return shadow(this, \"systemFontInfo\", info);\n }\n}\n\nclass PatternInfo {\n constructor(buffer) {\n this.buffer = buffer;\n this.view = new DataView(buffer);\n this.data = new Uint8Array(buffer);\n }\n\n getIR() {\n const dataView = this.view;\n const kind = this.data[PATTERN_INFO.KIND];\n const hasBBox = !!this.data[PATTERN_INFO.HAS_BBOX];\n const hasBackground = !!this.data[PATTERN_INFO.HAS_BACKGROUND];\n const nCoord = dataView.getUint32(PATTERN_INFO.N_COORD, true);\n const nColor = dataView.getUint32(PATTERN_INFO.N_COLOR, true);\n const nStop = dataView.getUint32(PATTERN_INFO.N_STOP, true);\n\n let offset = 20;\n const coords = new Float32Array(this.buffer, offset, nCoord * 2);\n offset += nCoord * 8;\n const colors = new Uint8Array(this.buffer, offset, nColor * 4);\n offset += nColor * 4;\n const stops = [];\n for (let i = 0; i < nStop; ++i) {\n const p = dataView.getFloat32(offset, true);\n offset += 4;\n const rgb = dataView.getUint32(offset, true);\n offset += 4;\n stops.push([p, `#${rgb.toString(16).padStart(6, \"0\")}`]);\n }\n let bbox = null;\n if (hasBBox) {\n bbox = [];\n for (let i = 0; i < 4; ++i) {\n bbox.push(dataView.getFloat32(offset, true));\n offset += 4;\n }\n }\n\n let background = null;\n if (hasBackground) {\n background = new Uint8Array(this.buffer, offset, 3);\n offset += 3;\n }\n\n if (kind === 1) {\n // axial\n return [\n \"RadialAxial\",\n \"axial\",\n bbox,\n stops,\n [coords[0], coords[1]],\n [coords[2], coords[3]],\n null,\n null,\n ];\n }\n if (kind === 2) {\n return [\n \"RadialAxial\",\n \"radial\",\n bbox,\n stops,\n [coords[0], coords[1]],\n [coords[3], coords[4]],\n coords[2],\n coords[5],\n ];\n }\n if (kind === 3) {\n const shadingType = this.data[PATTERN_INFO.SHADING_TYPE];\n let bounds = null;\n if (coords.length > 0) {\n bounds = BBOX_INIT.slice();\n\n for (let i = 0, ii = coords.length; i < ii; i += 2) {\n Util.pointBoundingBox(coords[i], coords[i + 1], bounds);\n }\n }\n return [\n \"Mesh\",\n shadingType,\n coords,\n colors,\n nCoord,\n bounds,\n bbox,\n background,\n ];\n }\n throw new Error(`Unsupported pattern kind: ${kind}`);\n }\n}\n\nclass FontPathInfo {\n #buffer;\n\n constructor(buffer) {\n this.#buffer = buffer;\n }\n\n get path() {\n if (\n (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) ||\n FeatureTest.isFloat16ArraySupported\n ) {\n return new Float16Array(this.#buffer);\n }\n return new Float32Array(this.#buffer);\n }\n}\n\nexport { CssFontInfo, FontInfo, FontPathInfo, PatternInfo, SystemFontInfo };\n","/* Copyright 2012 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n _isValidExplicitDest,\n isNodeJS,\n stringToBytes,\n warn,\n} from \"../shared/util.js\";\n\nfunction getUrlProp(val) {\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n return null; // The 'url' is unused with `PDFDataRangeTransport`.\n }\n if (val instanceof URL) {\n return val;\n }\n if (typeof val === \"string\") {\n if (\n typeof PDFJSDev !== \"undefined\" &&\n PDFJSDev.test(\"GENERIC\") &&\n isNodeJS\n ) {\n if (/^[a-z][a-z0-9\\-+.]+:/i.test(val)) {\n return new URL(val);\n }\n // eslint-disable-next-line no-undef\n const url = process.getBuiltinModule(\"url\");\n return new URL(url.pathToFileURL(val));\n }\n\n // The full path is required in the 'url' field.\n const url = URL.parse(val, window.location);\n if (url) {\n return url;\n }\n }\n throw new Error(\n \"Invalid PDF url data: \" +\n \"either string or URL-object is expected in the url property.\"\n );\n}\n\nfunction getDataProp(val) {\n // Converting string or array-like data to Uint8Array.\n if (\n typeof PDFJSDev !== \"undefined\" &&\n PDFJSDev.test(\"GENERIC\") &&\n isNodeJS &&\n typeof Buffer !== \"undefined\" && // eslint-disable-line no-undef\n val instanceof Buffer // eslint-disable-line no-undef\n ) {\n throw new Error(\n \"Please provide binary data as `Uint8Array`, rather than `Buffer`.\"\n );\n }\n if (val instanceof Uint8Array && val.byteLength === val.buffer.byteLength) {\n // Use the data as-is when it's already a Uint8Array that completely\n // \"utilizes\" its underlying ArrayBuffer, to prevent any possible\n // issues when transferring it to the worker-thread.\n return val;\n }\n if (typeof val === \"string\") {\n return stringToBytes(val);\n }\n if (\n val instanceof ArrayBuffer ||\n ArrayBuffer.isView(val) ||\n (typeof val === \"object\" && !isNaN(val?.length))\n ) {\n return new Uint8Array(val);\n }\n throw new Error(\n \"Invalid PDF binary data: either TypedArray, \" +\n \"string, or array-like object is expected in the data property.\"\n );\n}\n\nfunction getFactoryUrlProp(val) {\n if (typeof val !== \"string\") {\n return null;\n }\n if (val.endsWith(\"/\")) {\n return val;\n }\n throw new Error(`Invalid factory url: \"${val}\" must include trailing slash.`);\n}\n\nconst isRefProxy = v =>\n typeof v === \"object\" &&\n Number.isInteger(v?.num) &&\n v.num >= 0 &&\n Number.isInteger(v?.gen) &&\n v.gen >= 0;\n\nconst isNameProxy = v => typeof v === \"object\" && typeof v?.name === \"string\";\n\nconst isValidExplicitDest = _isValidExplicitDest.bind(\n null,\n /* validRef = */ isRefProxy,\n /* validName = */ isNameProxy\n);\n\nclass LoopbackPort {\n #listeners = new Map();\n\n #deferred = Promise.resolve();\n\n postMessage(obj, transfer) {\n const event = {\n data: structuredClone(obj, transfer ? { transfer } : null),\n };\n\n this.#deferred.then(() => {\n for (const [listener] of this.#listeners) {\n listener.call(this, event);\n }\n });\n }\n\n addEventListener(name, listener, options = null) {\n let rmAbort = null;\n if (options?.signal instanceof AbortSignal) {\n const { signal } = options;\n if (signal.aborted) {\n warn(\"LoopbackPort - cannot use an `aborted` signal.\");\n return;\n }\n const onAbort = () => this.removeEventListener(name, listener);\n rmAbort = () => signal.removeEventListener(\"abort\", onAbort);\n\n signal.addEventListener(\"abort\", onAbort);\n }\n this.#listeners.set(listener, rmAbort);\n }\n\n removeEventListener(name, listener) {\n const rmAbort = this.#listeners.get(listener);\n rmAbort?.();\n\n this.#listeners.delete(listener);\n }\n\n terminate() {\n for (const [, rmAbort] of this.#listeners) {\n rmAbort?.();\n }\n this.#listeners.clear();\n }\n}\n\nexport {\n getDataProp,\n getFactoryUrlProp,\n getUrlProp,\n isNameProxy,\n isRefProxy,\n isValidExplicitDest,\n LoopbackPort,\n};\n","/* Copyright 2018 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n AbortException,\n assert,\n InvalidPDFException,\n PasswordException,\n ResponseException,\n UnknownErrorException,\n unreachable,\n} from \"./util.js\";\n\nconst CallbackKind = {\n DATA: 1,\n ERROR: 2,\n};\n\nconst StreamKind = {\n CANCEL: 1,\n CANCEL_COMPLETE: 2,\n CLOSE: 3,\n ENQUEUE: 4,\n ERROR: 5,\n PULL: 6,\n PULL_COMPLETE: 7,\n START_COMPLETE: 8,\n};\n\nfunction onFn() {}\n\nfunction wrapReason(ex) {\n if (\n ex instanceof AbortException ||\n ex instanceof InvalidPDFException ||\n ex instanceof PasswordException ||\n ex instanceof ResponseException ||\n ex instanceof UnknownErrorException\n ) {\n // Avoid re-creating the exception when its type is already correct.\n return ex;\n }\n\n if (!(ex instanceof Error || (typeof ex === \"object\" && ex !== null))) {\n unreachable(\n 'wrapReason: Expected \"reason\" to be a (possibly cloned) Error.'\n );\n }\n switch (ex.name) {\n case \"AbortException\":\n return new AbortException(ex.message);\n case \"InvalidPDFException\":\n return new InvalidPDFException(ex.message);\n case \"PasswordException\":\n return new PasswordException(ex.message, ex.code);\n case \"ResponseException\":\n return new ResponseException(ex.message, ex.status, ex.missing);\n case \"UnknownErrorException\":\n return new UnknownErrorException(ex.message, ex.details);\n }\n return new UnknownErrorException(ex.message, ex.toString());\n}\n\nclass MessageHandler {\n #actions = new Map();\n\n #callbackCapabilities = new Map();\n\n #callbackId = 1;\n\n #comObj;\n\n #messageAC = new AbortController();\n\n #sourceName;\n\n #streamControllers = new Map();\n\n #streamId = 1;\n\n #streamSinks = new Map();\n\n #targetName;\n\n constructor(sourceName, targetName, comObj) {\n this.#sourceName = sourceName;\n this.#targetName = targetName;\n this.#comObj = comObj;\n\n comObj.addEventListener(\"message\", this.#onMessage.bind(this), {\n signal: this.#messageAC.signal,\n });\n\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n // For testing purposes.\n Object.defineProperty(this, \"_comObj\", {\n get: () => comObj,\n });\n }\n }\n\n #onMessage({ data }) {\n if (data.targetName !== this.#sourceName) {\n return;\n }\n if (data.stream) {\n this.#processStreamMessage(data);\n return;\n }\n if (data.callback) {\n const { callbackId, callback } = data;\n const capability = this.#callbackCapabilities.get(callbackId);\n if (!capability) {\n throw new Error(`Cannot resolve callback ${callbackId}`);\n }\n this.#callbackCapabilities.delete(callbackId);\n\n if (callback === CallbackKind.DATA) {\n capability.resolve(data.data);\n } else if (callback === CallbackKind.ERROR) {\n capability.reject(wrapReason(data.reason));\n } else {\n throw new Error(\"Unexpected callback case\");\n }\n return;\n }\n const action = this.#actions.get(data.action);\n if (!action) {\n throw new Error(`Unknown action from worker: ${data.action}`);\n }\n if (data.callbackId) {\n const sourceName = this.#sourceName,\n targetName = data.sourceName,\n comObj = this.#comObj;\n\n Promise.try(action, data.data).then(\n result => {\n comObj.postMessage({\n sourceName,\n targetName,\n callback: CallbackKind.DATA,\n callbackId: data.callbackId,\n data: result,\n });\n },\n reason => {\n comObj.postMessage({\n sourceName,\n targetName,\n callback: CallbackKind.ERROR,\n callbackId: data.callbackId,\n reason: wrapReason(reason),\n });\n }\n );\n return;\n }\n if (data.streamId) {\n this.#createStreamSink(data);\n return;\n }\n action(data.data);\n }\n\n on(actionName, handler) {\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n assert(\n typeof handler === \"function\",\n 'MessageHandler.on: Expected \"handler\" to be a function.'\n );\n }\n const ah = this.#actions;\n if (ah.has(actionName)) {\n throw new Error(`There is already a \"${actionName}\" handler.`);\n }\n ah.set(actionName, handler);\n }\n\n /**\n * Sends a message to the comObj to invoke the action with the supplied data.\n * @param {string} actionName - Action to call.\n * @param {JSON} data - JSON data to send.\n * @param {Array} [transfers] - List of transfers/ArrayBuffers.\n */\n send(actionName, data, transfers) {\n this.#comObj.postMessage(\n {\n sourceName: this.#sourceName,\n targetName: this.#targetName,\n action: actionName,\n data,\n },\n transfers\n );\n }\n\n /**\n * Sends a message to the comObj to invoke the action with the supplied data.\n * Expects that the other side will callback with the response.\n * @param {string} actionName - Action to call.\n * @param {JSON} data - JSON data to send.\n * @param {Array} [transfers] - List of transfers/ArrayBuffers.\n * @returns {Promise} Promise to be resolved with response data.\n */\n sendWithPromise(actionName, data, transfers) {\n const callbackId = this.#callbackId++,\n capability = Promise.withResolvers();\n this.#callbackCapabilities.set(callbackId, capability);\n try {\n this.#comObj.postMessage(\n {\n sourceName: this.#sourceName,\n targetName: this.#targetName,\n action: actionName,\n callbackId,\n data,\n },\n transfers\n );\n } catch (ex) {\n capability.reject(ex);\n }\n return capability.promise;\n }\n\n /**\n * Sends a message to the comObj to invoke the action with the supplied data.\n * Expect that the other side will callback to signal 'start_complete'.\n * @param {string} actionName - Action to call.\n * @param {JSON} data - JSON data to send.\n * @param {object} queueingStrategy - Strategy to signal backpressure based on\n * internal queue.\n * @param {Array} [transfers] - List of transfers/ArrayBuffers.\n * @returns {ReadableStream} ReadableStream to read data in chunks.\n */\n sendWithStream(actionName, data, queueingStrategy, transfers) {\n const streamId = this.#streamId++,\n sourceName = this.#sourceName,\n targetName = this.#targetName,\n comObj = this.#comObj;\n\n return new ReadableStream(\n {\n start: controller => {\n const startCapability = Promise.withResolvers();\n this.#streamControllers.set(streamId, {\n controller,\n startCall: startCapability,\n pullCall: null,\n cancelCall: null,\n isClosed: false,\n });\n comObj.postMessage(\n {\n sourceName,\n targetName,\n action: actionName,\n streamId,\n data,\n desiredSize: controller.desiredSize,\n },\n transfers\n );\n // Return Promise for Async process, to signal success/failure.\n return startCapability.promise;\n },\n\n pull: controller => {\n const pullCapability = Promise.withResolvers();\n this.#streamControllers.get(streamId).pullCall = pullCapability;\n comObj.postMessage({\n sourceName,\n targetName,\n stream: StreamKind.PULL,\n streamId,\n desiredSize: controller.desiredSize,\n });\n // Returning Promise will not call \"pull\"\n // again until current pull is resolved.\n return pullCapability.promise;\n },\n\n cancel: reason => {\n assert(reason instanceof Error, \"cancel must have a valid reason\");\n const cancelCapability = Promise.withResolvers();\n this.#streamControllers.get(streamId).cancelCall = cancelCapability;\n this.#streamControllers.get(streamId).isClosed = true;\n comObj.postMessage({\n sourceName,\n targetName,\n stream: StreamKind.CANCEL,\n streamId,\n reason: wrapReason(reason),\n });\n // Return Promise to signal success or failure.\n return cancelCapability.promise;\n },\n },\n queueingStrategy\n );\n }\n\n #createStreamSink(data) {\n const streamId = data.streamId,\n sourceName = this.#sourceName,\n targetName = data.sourceName,\n comObj = this.#comObj;\n const streamSinks = this.#streamSinks,\n action = this.#actions.get(data.action);\n\n const streamSink = {\n enqueue(chunk, size = 1, transfers) {\n if (this.isCancelled) {\n return;\n }\n const lastDesiredSize = this.desiredSize;\n this.desiredSize -= size;\n // Enqueue decreases the desiredSize property of sink,\n // so when it changes from positive to negative,\n // set ready as unresolved promise.\n if (lastDesiredSize > 0 && this.desiredSize <= 0) {\n this.sinkCapability = Promise.withResolvers();\n this.ready = this.sinkCapability.promise;\n }\n comObj.postMessage(\n {\n sourceName,\n targetName,\n stream: StreamKind.ENQUEUE,\n streamId,\n chunk,\n },\n transfers\n );\n },\n\n close() {\n if (this.isCancelled) {\n return;\n }\n this.isCancelled = true;\n comObj.postMessage({\n sourceName,\n targetName,\n stream: StreamKind.CLOSE,\n streamId,\n });\n streamSinks.delete(streamId);\n },\n\n error(reason) {\n assert(reason instanceof Error, \"error must have a valid reason\");\n if (this.isCancelled) {\n return;\n }\n this.isCancelled = true;\n comObj.postMessage({\n sourceName,\n targetName,\n stream: StreamKind.ERROR,\n streamId,\n reason: wrapReason(reason),\n });\n },\n\n sinkCapability: Promise.withResolvers(),\n onPull: null,\n onCancel: null,\n isCancelled: false,\n desiredSize: data.desiredSize,\n ready: null,\n };\n\n streamSink.sinkCapability.resolve();\n streamSink.ready = streamSink.sinkCapability.promise;\n streamSinks.set(streamId, streamSink);\n\n Promise.try(action, data.data, streamSink).then(\n () => {\n comObj.postMessage({\n sourceName,\n targetName,\n stream: StreamKind.START_COMPLETE,\n streamId,\n success: true,\n });\n },\n reason => {\n comObj.postMessage({\n sourceName,\n targetName,\n stream: StreamKind.START_COMPLETE,\n streamId,\n reason: wrapReason(reason),\n });\n }\n );\n }\n\n #processStreamMessage(data) {\n const streamId = data.streamId,\n sourceName = this.#sourceName,\n targetName = data.sourceName,\n comObj = this.#comObj;\n const streamController = this.#streamControllers.get(streamId),\n streamSink = this.#streamSinks.get(streamId);\n\n switch (data.stream) {\n case StreamKind.START_COMPLETE:\n if (data.success) {\n streamController.startCall.resolve();\n } else {\n streamController.startCall.reject(wrapReason(data.reason));\n }\n break;\n case StreamKind.PULL_COMPLETE:\n if (data.success) {\n streamController.pullCall.resolve();\n } else {\n streamController.pullCall.reject(wrapReason(data.reason));\n }\n break;\n case StreamKind.PULL:\n // Ignore any pull after close is called.\n if (!streamSink) {\n comObj.postMessage({\n sourceName,\n targetName,\n stream: StreamKind.PULL_COMPLETE,\n streamId,\n success: true,\n });\n break;\n }\n // Pull increases the desiredSize property of sink, so when it changes\n // from negative to positive, set ready property as resolved promise.\n if (streamSink.desiredSize <= 0 && data.desiredSize > 0) {\n streamSink.sinkCapability.resolve();\n }\n // Reset desiredSize property of sink on every pull.\n streamSink.desiredSize = data.desiredSize;\n\n Promise.try(streamSink.onPull || onFn).then(\n () => {\n comObj.postMessage({\n sourceName,\n targetName,\n stream: StreamKind.PULL_COMPLETE,\n streamId,\n success: true,\n });\n },\n reason => {\n comObj.postMessage({\n sourceName,\n targetName,\n stream: StreamKind.PULL_COMPLETE,\n streamId,\n reason: wrapReason(reason),\n });\n }\n );\n break;\n case StreamKind.ENQUEUE:\n assert(streamController, \"enqueue should have stream controller\");\n if (streamController.isClosed) {\n break;\n }\n streamController.controller.enqueue(data.chunk);\n break;\n case StreamKind.CLOSE:\n assert(streamController, \"close should have stream controller\");\n if (streamController.isClosed) {\n break;\n }\n streamController.isClosed = true;\n streamController.controller.close();\n this.#deleteStreamController(streamController, streamId);\n break;\n case StreamKind.ERROR:\n assert(streamController, \"error should have stream controller\");\n streamController.controller.error(wrapReason(data.reason));\n this.#deleteStreamController(streamController, streamId);\n break;\n case StreamKind.CANCEL_COMPLETE:\n if (data.success) {\n streamController.cancelCall.resolve();\n } else {\n streamController.cancelCall.reject(wrapReason(data.reason));\n }\n this.#deleteStreamController(streamController, streamId);\n break;\n case StreamKind.CANCEL:\n if (!streamSink) {\n break;\n }\n const dataReason = wrapReason(data.reason);\n\n Promise.try(streamSink.onCancel || onFn, dataReason).then(\n () => {\n comObj.postMessage({\n sourceName,\n targetName,\n stream: StreamKind.CANCEL_COMPLETE,\n streamId,\n success: true,\n });\n },\n reason => {\n comObj.postMessage({\n sourceName,\n targetName,\n stream: StreamKind.CANCEL_COMPLETE,\n streamId,\n reason: wrapReason(reason),\n });\n }\n );\n streamSink.sinkCapability.reject(dataReason);\n streamSink.isCancelled = true;\n this.#streamSinks.delete(streamId);\n break;\n default:\n throw new Error(\"Unexpected stream case\");\n }\n }\n\n async #deleteStreamController(streamController, streamId) {\n // Delete the `streamController` only when the start, pull, and cancel\n // capabilities have settled, to prevent `TypeError`s.\n await Promise.allSettled([\n streamController.startCall?.promise,\n streamController.pullCall?.promise,\n streamController.cancelCall?.promise,\n ]);\n this.#streamControllers.delete(streamId);\n }\n\n destroy() {\n this.#messageAC?.abort();\n this.#messageAC = null;\n }\n}\n\nexport { MessageHandler, wrapReason };\n","/* Copyright 2015 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { stringToBytes, unreachable } from \"../shared/util.js\";\nimport { fetchData } from \"./display_utils.js\";\n\nclass BaseBinaryDataFactory {\n #errorStr = Object.freeze({\n cMapUrl: \"CMap\",\n standardFontDataUrl: \"font\",\n wasmUrl: \"wasm\",\n });\n\n constructor({ cMapUrl = null, standardFontDataUrl = null, wasmUrl = null }) {\n if (\n (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) &&\n this.constructor === BaseBinaryDataFactory\n ) {\n unreachable(\"Cannot initialize BaseBinaryDataFactory.\");\n }\n this.cMapUrl = cMapUrl;\n this.standardFontDataUrl = standardFontDataUrl;\n this.wasmUrl = wasmUrl;\n }\n\n async fetch({ kind, filename }) {\n switch (kind) {\n case \"cMapUrl\":\n case \"standardFontDataUrl\":\n case \"wasmUrl\":\n break;\n default:\n unreachable(`Not implemented: ${kind}`);\n }\n const baseUrl = this[kind];\n if (!baseUrl) {\n throw new Error(`Ensure that the \\`${kind}\\` API parameter is provided.`);\n }\n const url = `${baseUrl}${filename}`;\n\n return this._fetch(url, kind).catch(reason => {\n throw new Error(`Unable to load ${this.#errorStr[kind]} data at: ${url}`);\n });\n }\n\n /**\n * @ignore\n * @returns {Promise}\n */\n async _fetch(url, kind) {\n unreachable(\"Abstract method `_fetch` called.\");\n }\n}\n\nclass DOMBinaryDataFactory extends BaseBinaryDataFactory {\n /**\n * @ignore\n */\n async _fetch(url, kind) {\n const type =\n kind === \"cMapUrl\" && !url.endsWith(\".bcmap\") ? \"text\" : \"bytes\";\n const data = await fetchData(url, type);\n return data instanceof Uint8Array ? data : stringToBytes(data);\n }\n}\n\nexport { BaseBinaryDataFactory, DOMBinaryDataFactory };\n","/* Copyright 2015 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { unreachable } from \"../shared/util.js\";\n\nclass BaseCanvasFactory {\n #enableHWA = false;\n\n constructor({ enableHWA = false }) {\n if (\n (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) &&\n this.constructor === BaseCanvasFactory\n ) {\n unreachable(\"Cannot initialize BaseCanvasFactory.\");\n }\n this.#enableHWA = enableHWA;\n }\n\n create(width, height) {\n if (width <= 0 || height <= 0) {\n throw new Error(\"Invalid canvas size\");\n }\n const canvas = this._createCanvas(width, height);\n return {\n canvas,\n context: canvas.getContext(\"2d\", {\n willReadFrequently: !this.#enableHWA,\n }),\n };\n }\n\n reset({ canvas }, width, height) {\n if (!canvas) {\n throw new Error(\"Canvas is not specified\");\n }\n if (width <= 0 || height <= 0) {\n throw new Error(\"Invalid canvas size\");\n }\n canvas.width = width;\n canvas.height = height;\n }\n\n destroy(canvasAndContext) {\n const { canvas } = canvasAndContext;\n if (!canvas) {\n throw new Error(\"Canvas is not specified\");\n }\n // Zeroing the width and height cause Firefox to release graphics\n // resources immediately, which can greatly reduce memory consumption.\n canvas.width = canvas.height = 0;\n canvasAndContext.canvas = null;\n canvasAndContext.context = null;\n }\n\n /**\n * @ignore\n */\n _createCanvas(width, height) {\n unreachable(\"Abstract method `_createCanvas` called.\");\n }\n}\n\nclass DOMCanvasFactory extends BaseCanvasFactory {\n constructor({ ownerDocument = globalThis.document, enableHWA = false }) {\n super({ enableHWA });\n this._document = ownerDocument;\n }\n\n /**\n * @ignore\n */\n _createCanvas(width, height) {\n const canvas = this._document.createElement(\"canvas\");\n canvas.width = width;\n canvas.height = height;\n return canvas;\n }\n}\n\nexport { BaseCanvasFactory, DOMCanvasFactory };\n","/* Copyright 2015 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n computeLuminance,\n getRGB,\n getRGBA,\n isDataScheme,\n} from \"./display_utils.js\";\nimport {\n FeatureTest,\n SVG_NS,\n unreachable,\n updateUrlHash,\n Util,\n warn,\n} from \"../shared/util.js\";\n\nclass BaseFilterFactory {\n constructor() {\n if (\n (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) &&\n this.constructor === BaseFilterFactory\n ) {\n unreachable(\"Cannot initialize BaseFilterFactory.\");\n }\n }\n\n addFilter(maps) {\n return \"none\";\n }\n\n addHCMFilter(fgColor, bgColor) {\n return \"none\";\n }\n\n addAlphaFilter(map) {\n return \"none\";\n }\n\n addLuminosityFilter(map) {\n return \"none\";\n }\n\n addKnockoutFilter(alpha = 0) {\n return \"none\";\n }\n\n addHighlightHCMFilter(filterName, fgColor, bgColor, newFgColor, newBgColor) {\n return \"none\";\n }\n\n /**\n * Create a filter for the selection of text, given colors.\n * @param {string} fgColor\n * @param {string} bgColor\n * @returns {string}\n */\n addSelectionHCMFilter(fgColor, bgColor) {\n return \"none\";\n }\n\n /**\n * Create a filter for the selection of text.\n * @returns {string}\n */\n addSelectionFilter() {\n return \"none\";\n }\n\n /**\n * @param {object} [pageColors]\n * @param {string} [pageColors.background]\n * @param {string} [pageColors.foreground]\n * @returns {Record | null}\n */\n createSelectionStyle(pageColors = null) {\n return null;\n }\n\n destroy(keepHCM = false) {}\n}\n\n/**\n * FilterFactory aims to create some SVG filters we can use when drawing an\n * image (or whatever) on a canvas.\n * Filters aren't applied with ctx.putImageData because it just overwrites the\n * underlying pixels.\n * With these filters, it's possible for example to apply some transfer maps on\n * an image without the need to apply them on the pixel arrays: the renderer\n * does the magic for us.\n */\nclass DOMFilterFactory extends BaseFilterFactory {\n #baseUrl;\n\n #_cache;\n\n #_defs;\n\n #docId;\n\n #document;\n\n #_hcmCache;\n\n #id = 0;\n\n constructor({ docId, ownerDocument = globalThis.document }) {\n super();\n this.#docId = docId;\n this.#document = ownerDocument;\n }\n\n get #cache() {\n return (this.#_cache ||= new Map());\n }\n\n get #hcmCache() {\n return (this.#_hcmCache ||= new Map());\n }\n\n get #defs() {\n if (!this.#_defs) {\n const div = this.#document.createElement(\"div\");\n const { style } = div;\n // The pdf colors are mostly in light mode (white background with a black\n // foreground), so the filters are created in light mode.\n style.colorScheme = \"only light\";\n style.visibility = \"hidden\";\n style.contain = \"strict\";\n style.width = style.height = 0;\n style.position = \"absolute\";\n style.top = style.left = 0;\n style.zIndex = -1;\n\n const svg = this.#document.createElementNS(SVG_NS, \"svg\");\n svg.setAttribute(\"width\", 0);\n svg.setAttribute(\"height\", 0);\n this.#_defs = this.#document.createElementNS(SVG_NS, \"defs\");\n div.append(svg);\n svg.append(this.#_defs);\n this.#document.body.append(div);\n }\n return this.#_defs;\n }\n\n #createTables(maps) {\n // A `null` map is an /Identity entry, no feFunc is needed for it.\n const toTable = map => map && Array.from(map, v => v / 255).join(\",\");\n if (maps.length === 1) {\n const table = toTable(maps[0]);\n return [table, table, table];\n }\n const [mapR, mapG, mapB] = maps;\n return [toTable(mapR), toTable(mapG), toTable(mapB)];\n }\n\n #createUrl(id) {\n if (this.#baseUrl === undefined) {\n // Unless a ``-element is present a relative URL should work.\n this.#baseUrl = \"\";\n\n const url = this.#document.URL;\n if (url !== this.#document.baseURI) {\n if (isDataScheme(url)) {\n warn('#createUrl: ignore \"data:\"-URL for performance reasons.');\n } else {\n this.#baseUrl = updateUrlHash(url, \"\");\n }\n }\n }\n return `url(${this.#baseUrl}#${id})`;\n }\n\n addFilter(maps) {\n if (!maps) {\n return \"none\";\n }\n\n // When a page is zoomed the page is re-drawn but the maps are likely\n // the same.\n let value = this.#cache.get(maps);\n if (value) {\n return value;\n }\n\n const [tableR, tableG, tableB] = this.#createTables(maps);\n const key = maps.length === 1 ? tableR : `${tableR}${tableG}${tableB}`;\n\n value = this.#cache.get(key);\n if (value) {\n this.#cache.set(maps, value);\n return value;\n }\n\n // We create a SVG filter: feComponentTransferElement\n // https://www.w3.org/TR/SVG11/filters.html#feComponentTransferElement\n\n const id = `g_${this.#docId}_transfer_map_${this.#id++}`;\n const url = this.#createUrl(id);\n this.#cache.set(maps, url);\n this.#cache.set(key, url);\n\n const filter = this.#createFilter(id);\n this.#addTransferMapConversion(tableR, tableG, tableB, filter);\n\n return url;\n }\n\n addHCMFilter(fgColor, bgColor) {\n const key = `${fgColor}-${bgColor}`;\n const filterName = \"base\";\n let info = this.#hcmCache.get(filterName);\n if (info?.key === key) {\n return info.url;\n }\n\n if (info) {\n info.filter?.remove();\n info.key = key;\n info.url = \"none\";\n info.filter = null;\n } else {\n info = {\n key,\n url: \"none\",\n filter: null,\n };\n this.#hcmCache.set(filterName, info);\n }\n\n if (!fgColor || !bgColor) {\n return info.url;\n }\n\n const fgRGB = this.#getRGB(fgColor);\n fgColor = Util.makeHexColor(...fgRGB);\n const bgRGB = this.#getRGB(bgColor);\n bgColor = Util.makeHexColor(...bgRGB);\n this.#resetDefsColor();\n\n if (\n (fgColor === \"#000000\" && bgColor === \"#ffffff\") ||\n fgColor === bgColor\n ) {\n return info.url;\n }\n\n // https://developer.mozilla.org/en-US/docs/Web/Accessibility/Understanding_Colors_and_Luminance\n //\n // Relative luminance:\n // https://www.w3.org/TR/WCAG20/#relativeluminancedef\n //\n // We compute the rounded luminance of the default background color.\n // Then for every color in the pdf, if its rounded luminance is the\n // same as the background one then it's replaced by the new\n // background color else by the foreground one.\n const map = Array.from({ length: 256 }, (_, i) =>\n computeLuminance(i / 255)\n );\n const table = map.join(\",\");\n\n const id = `g_${this.#docId}_hcm_filter`;\n const filter = (info.filter = this.#createFilter(id));\n this.#addTransferMapConversion(table, table, table, filter);\n this.#addGrayConversion(filter);\n\n const getSteps = (c, n) => {\n const start = fgRGB[c] / 255;\n const end = bgRGB[c] / 255;\n const arr = new Array(n + 1);\n for (let i = 0; i <= n; i++) {\n arr[i] = start + (i / n) * (end - start);\n }\n return arr.join(\",\");\n };\n this.#addTransferMapConversion(\n getSteps(0, 5),\n getSteps(1, 5),\n getSteps(2, 5),\n filter\n );\n\n info.url = this.#createUrl(id);\n return info.url;\n }\n\n /**\n * Create a filter for the selection of text, given colors.\n * @param {string} fgColor\n * @param {string} bgColor\n * @returns {string}\n */\n addSelectionHCMFilter(fgColor, bgColor) {\n return this.addHighlightHCMFilter(\n \"selection\",\n fgColor,\n bgColor,\n // Background becomes foreground so these are flipped.\n \"HighlightText\",\n \"Highlight\"\n );\n }\n\n /**\n * Create a filter for the selection of text.\n * @returns {string}\n */\n addSelectionFilter() {\n return this.addHighlightHCMFilter(\n \"selection_default\",\n \"black\",\n \"white\",\n \"HighlightText\",\n \"Highlight\"\n );\n }\n\n /**\n * @param {object} [pageColors]\n * @param {string} [pageColors.background]\n * @param {string} [pageColors.foreground]\n * @returns {Record | null}\n */\n createSelectionStyle(pageColors = null) {\n const filter = pageColors\n ? this.addSelectionHCMFilter(pageColors.foreground, pageColors.background)\n : this.addSelectionFilter();\n\n // Safari does not supported SVG filters in `backdrop-filter`:\n // .\n // Chrome *and* Safari do not use the user’s preferred text selection color.\n // So this is Firefox-specific for now.\n if (filter === \"none\" || !FeatureTest.platform.isFirefox) {\n return null;\n }\n\n return {\n \"backdrop-filter\": filter,\n \"background-color\": \"transparent\",\n };\n }\n\n addAlphaFilter(map) {\n // When a page is zoomed the page is re-drawn but the maps are likely\n // the same.\n let value = this.#cache.get(map);\n if (value) {\n return value;\n }\n\n const [tableA] = this.#createTables([map]);\n const key = `alpha_${tableA}`;\n\n value = this.#cache.get(key);\n if (value) {\n this.#cache.set(map, value);\n return value;\n }\n\n const id = `g_${this.#docId}_alpha_map_${this.#id++}`;\n const url = this.#createUrl(id);\n this.#cache.set(map, url);\n this.#cache.set(key, url);\n\n const filter = this.#createFilter(id);\n this.#addTransferMapAlphaConversion(tableA, filter);\n\n return url;\n }\n\n addLuminosityFilter(map) {\n // When a page is zoomed the page is re-drawn but the maps are likely\n // the same.\n let value = this.#cache.get(map || \"luminosity\");\n if (value) {\n return value;\n }\n\n let tableA, key;\n if (map) {\n [tableA] = this.#createTables([map]);\n key = `luminosity_${tableA}`;\n } else {\n key = \"luminosity\";\n }\n\n value = this.#cache.get(key);\n if (value) {\n this.#cache.set(map, value);\n return value;\n }\n\n const id = `g_${this.#docId}_luminosity_map_${this.#id++}`;\n const url = this.#createUrl(id);\n this.#cache.set(map, url);\n this.#cache.set(key, url);\n\n const filter = this.#createFilter(id);\n this.#addLuminosityConversion(filter);\n if (map) {\n this.#addTransferMapAlphaConversion(tableA, filter);\n }\n\n return url;\n }\n\n addKnockoutFilter(alpha = 0) {\n // Shape alpha mask: for translucent elements, remove the opacity constant\n // from the painted alpha while preserving antialias coverage. With no\n // usable opacity, fall back to a binary mask.\n const slope = alpha > 0 ? Math.min(1 / alpha, 1e6) : 1e6;\n const key = `knockout_${slope}`;\n const value = this.#cache.get(key);\n if (value) {\n return value;\n }\n\n const id = `g_${this.#docId}_knockout_filter_${this.#id++}`;\n const url = this.#createUrl(id);\n this.#cache.set(key, url);\n\n const filter = this.#createFilter(id);\n const feComponentTransfer = this.#document.createElementNS(\n SVG_NS,\n \"feComponentTransfer\"\n );\n filter.append(feComponentTransfer);\n const feFuncA = this.#document.createElementNS(SVG_NS, \"feFuncA\");\n // Linear feFunc clamps to [0, 1].\n feFuncA.setAttribute(\"type\", \"linear\");\n feFuncA.setAttribute(\"slope\", `${slope}`);\n feFuncA.setAttribute(\"intercept\", \"0\");\n feComponentTransfer.append(feFuncA);\n\n return url;\n }\n\n addHighlightHCMFilter(filterName, fgColor, bgColor, newFgColor, newBgColor) {\n const key = `${fgColor}-${bgColor}-${newFgColor}-${newBgColor}`;\n let info = this.#hcmCache.get(filterName);\n if (info?.key === key) {\n return info.url;\n }\n\n if (info) {\n info.filter?.remove();\n info.key = key;\n info.url = \"none\";\n info.filter = null;\n } else {\n info = {\n key,\n url: \"none\",\n filter: null,\n };\n this.#hcmCache.set(filterName, info);\n }\n\n if (!fgColor || !bgColor) {\n return info.url;\n }\n\n const [fgRGB, bgRGB] = [fgColor, bgColor].map(this.#getRGB.bind(this));\n let fgGray = Math.round(\n 0.2126 * fgRGB[0] + 0.7152 * fgRGB[1] + 0.0722 * fgRGB[2]\n );\n let bgGray = Math.round(\n 0.2126 * bgRGB[0] + 0.7152 * bgRGB[1] + 0.0722 * bgRGB[2]\n );\n let [newFgRGB, newBgRGB] = [newFgColor, newBgColor].map(\n this.#getOpaqueTextColor.bind(this)\n );\n if (bgGray < fgGray) {\n [fgGray, bgGray, newFgRGB, newBgRGB] = [\n bgGray,\n fgGray,\n newBgRGB,\n newFgRGB,\n ];\n }\n this.#resetDefsColor();\n\n // Now we can create the filters to highlight some canvas parts.\n // The colors in the pdf will almost be Canvas and CanvasText, hence we\n // want to filter them to finally get Highlight and HighlightText.\n // Since we're in HCM the background color and the foreground color should\n // be really different when converted to grayscale (if they're not then it\n // means that we've a poor contrast). Once the canvas colors are converted\n // to grayscale we can easily map them on their new colors.\n // The grayscale step is important because if we've something like:\n // fgColor = #FF....\n // bgColor = #FF....\n // then we are enable to map the red component on the new red components\n // which can be different.\n\n const getSteps = (fg, bg, n) => {\n const arr = new Array(256);\n const step = (bgGray - fgGray) / n;\n const newStart = fg / 255;\n const newStep = (bg - fg) / (255 * n);\n let prev = 0;\n for (let i = 0; i <= n; i++) {\n const k = Math.round(fgGray + i * step);\n const value = newStart + i * newStep;\n for (let j = prev; j <= k; j++) {\n arr[j] = value;\n }\n prev = k + 1;\n }\n for (let i = prev; i < 256; i++) {\n arr[i] = arr[prev - 1];\n }\n return arr.join(\",\");\n };\n\n const id = `g_${this.#docId}_hcm_${filterName}_filter`;\n const filter = (info.filter = this.#createFilter(id));\n\n this.#addGrayConversion(filter);\n this.#addTransferMapConversion(\n getSteps(newFgRGB[0], newBgRGB[0], 5),\n getSteps(newFgRGB[1], newBgRGB[1], 5),\n getSteps(newFgRGB[2], newBgRGB[2], 5),\n filter\n );\n\n info.url = this.#createUrl(id);\n return info.url;\n }\n\n destroy(keepHCM = false) {\n if (keepHCM && this.#_hcmCache?.size) {\n return;\n }\n this.#_defs?.parentNode.parentNode.remove();\n this.#_defs = null;\n\n this.#_cache?.clear();\n this.#_cache = null;\n\n this.#_hcmCache?.clear();\n this.#_hcmCache = null;\n\n this.#id = 0;\n }\n\n #addLuminosityConversion(filter) {\n const feColorMatrix = this.#document.createElementNS(\n SVG_NS,\n \"feColorMatrix\"\n );\n feColorMatrix.setAttribute(\"type\", \"matrix\");\n feColorMatrix.setAttribute(\n \"values\",\n \"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.3 0.59 0.11 0 0\"\n );\n filter.append(feColorMatrix);\n }\n\n #addGrayConversion(filter) {\n const feColorMatrix = this.#document.createElementNS(\n SVG_NS,\n \"feColorMatrix\"\n );\n feColorMatrix.setAttribute(\"type\", \"matrix\");\n feColorMatrix.setAttribute(\n \"values\",\n \"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\"\n );\n filter.append(feColorMatrix);\n }\n\n #createFilter(id) {\n const filter = this.#document.createElementNS(SVG_NS, \"filter\");\n filter.setAttribute(\"color-interpolation-filters\", \"sRGB\");\n filter.setAttribute(\"id\", id);\n this.#defs.append(filter);\n\n return filter;\n }\n\n #appendFeFunc(feComponentTransfer, func, table) {\n if (!table) {\n return;\n }\n const feFunc = this.#document.createElementNS(SVG_NS, func);\n feFunc.setAttribute(\"type\", \"discrete\");\n feFunc.setAttribute(\"tableValues\", table);\n feComponentTransfer.append(feFunc);\n }\n\n #addTransferMapConversion(rTable, gTable, bTable, filter) {\n const feComponentTransfer = this.#document.createElementNS(\n SVG_NS,\n \"feComponentTransfer\"\n );\n filter.append(feComponentTransfer);\n this.#appendFeFunc(feComponentTransfer, \"feFuncR\", rTable);\n this.#appendFeFunc(feComponentTransfer, \"feFuncG\", gTable);\n this.#appendFeFunc(feComponentTransfer, \"feFuncB\", bTable);\n }\n\n #addTransferMapAlphaConversion(aTable, filter) {\n const feComponentTransfer = this.#document.createElementNS(\n SVG_NS,\n \"feComponentTransfer\"\n );\n filter.append(feComponentTransfer);\n this.#appendFeFunc(feComponentTransfer, \"feFuncA\", aTable);\n }\n\n /**\n * Get the RGB channels of a color.\n * @param {string} color\n * Color in any valid CSS format (such as `x` in `color: x`).\n * @returns {[number, number, number, number]}\n * RGBA values of the color;\n * the RGB channels are in the range `[0, 255]`;\n * the alpha channel is in the range `[0, 1]`.\n */\n #getRGB(color) {\n // Some colors on some OSes (e.g. HighlightText in Firefox on macOS)\n // are affected by the current text color. Ensure consistent behavior by\n // setting it to CanvasText.\n this.#defs.style.color = \"CanvasText\";\n this.#defs.style.backgroundColor = color;\n return getRGB(\n getComputedStyle(this.#defs).getPropertyValue(\"background-color\")\n );\n }\n\n #getRGBA(color) {\n // Some colors on some OSes (e.g. HighlightText in Firefox on macOS)\n // are affected by the current text color. Ensure consistent behavior by\n // setting it to CanvasText.\n this.#defs.style.color = \"CanvasText\";\n this.#defs.style.backgroundColor = color;\n return getRGBA(\n getComputedStyle(this.#defs).getPropertyValue(\"background-color\")\n );\n }\n\n #resetDefsColor() {\n this.#defs.style.color = \"\";\n this.#defs.style.backgroundColor = \"\";\n }\n\n /**\n * Get the opaque text color by, if it has an alpha layer, blending it with\n * the `Canvas` background.\n * @param {string} color\n * Color in any valid CSS format (such as `x` in `color: x`).\n * @returns {[number, number, number]}\n * RGB values of the opaque color.\n */\n #getOpaqueTextColor(color) {\n const [r, g, b, alpha] = this.#getRGBA(color);\n\n if (alpha === 1) {\n return [r, g, b];\n }\n\n const [canvasR, canvasG, canvasB] = this.#getRGB(\"Canvas\");\n\n return [\n blend(r, canvasR, alpha),\n blend(g, canvasG, alpha),\n blend(b, canvasB, alpha),\n ];\n }\n}\n\n/**\n * Blend a foreground color with a background color using the alpha value.\n * @param {number} fg\n * Foreground color channel value in the range `[0, 255]`.\n * @param {number} bg\n * Background color channel value in the range `[0, 255]`.\n * @param {number} alpha\n * Alpha value in the range `[0, 1]`.\n * @returns {number}\n * Blended color channel value in the range `[0, 255]`.\n */\nfunction blend(fg, bg, alpha) {\n return Math.round(alpha * fg + (1 - alpha) * bg);\n}\n\nexport { BaseFilterFactory, DOMFilterFactory };\n","/* Copyright 2020 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/* globals process */\n\nimport { isNodeJS, warn } from \"../shared/util.js\";\nimport { BaseBinaryDataFactory } from \"./binary_data_factory.js\";\nimport { BaseCanvasFactory } from \"./canvas_factory.js\";\nimport { BaseFilterFactory } from \"./filter_factory.js\";\n\nif (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n throw new Error(\n 'Module \"./node_utils.js\" shall not be used with MOZCENTRAL builds.'\n );\n}\n\nif (isNodeJS) {\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"SKIP_BABEL\")) {\n warn(\"Please use the `legacy` build in Node.js environments.\");\n } else {\n let canvas;\n try {\n const require = process\n .getBuiltinModule(\"module\")\n .createRequire(import.meta.url);\n\n try {\n canvas = require(\"@napi-rs/canvas\");\n } catch (ex) {\n warn(`Cannot load \"@napi-rs/canvas\" package: \"${ex}\".`);\n }\n } catch (ex) {\n warn(`Cannot access the \\`require\\` function: \"${ex}\".`);\n }\n\n if (!globalThis.DOMMatrix) {\n if (canvas?.DOMMatrix) {\n globalThis.DOMMatrix = canvas.DOMMatrix;\n } else {\n warn(\"Cannot polyfill `DOMMatrix`, rendering may be broken.\");\n }\n }\n if (!globalThis.Path2D) {\n if (canvas?.Path2D) {\n globalThis.Path2D = canvas.Path2D;\n } else {\n warn(\"Cannot polyfill `Path2D`, rendering may be broken.\");\n }\n }\n if (!globalThis.navigator?.language) {\n globalThis.navigator = {\n language: \"en-US\",\n platform: \"\",\n userAgent: \"\",\n };\n }\n }\n}\n\nasync function fetchData(url) {\n const fs = process.getBuiltinModule(\"fs/promises\");\n const data = await fs.readFile(url);\n return new Uint8Array(data);\n}\n\nclass NodeFilterFactory extends BaseFilterFactory {}\n\nclass NodeCanvasFactory extends BaseCanvasFactory {\n /**\n * @ignore\n */\n _createCanvas(width, height) {\n const require = process\n .getBuiltinModule(\"module\")\n .createRequire(import.meta.url);\n const canvas = require(\"@napi-rs/canvas\");\n return canvas.createCanvas(width, height);\n }\n}\n\nclass NodeBinaryDataFactory extends BaseBinaryDataFactory {\n /**\n * @ignore\n */\n async _fetch(url, kind) {\n return fetchData(url);\n }\n}\n\nexport {\n fetchData,\n NodeBinaryDataFactory,\n NodeCanvasFactory,\n NodeFilterFactory,\n};\n","/* Copyright 2022 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { FeatureTest, ImageKind } from \"./util.js\";\n\nfunction convertToRGBA(params) {\n switch (params.kind) {\n case ImageKind.GRAYSCALE_1BPP:\n return convertBlackAndWhiteToRGBA(params);\n case ImageKind.RGB_24BPP:\n return convertRGBToRGBA(params);\n }\n\n return null;\n}\n\nfunction convertBlackAndWhiteToRGBA({\n src,\n srcPos = 0,\n dest,\n width,\n height,\n nonBlackColor = 0xffffffff,\n inverseDecode = false,\n}) {\n const black = FeatureTest.isLittleEndian ? 0xff000000 : 0x000000ff;\n const [zeroMapping, oneMapping] = inverseDecode\n ? [nonBlackColor, black]\n : [black, nonBlackColor];\n const widthInSource = width >> 3;\n const widthRemainder = width & 7;\n const xorMask = zeroMapping ^ oneMapping;\n const srcLength = src.length;\n dest = new Uint32Array(dest.buffer);\n let destPos = 0;\n\n for (let i = 0; i < height; ++i) {\n for (\n const max = srcPos + widthInSource;\n srcPos < max;\n ++srcPos, destPos += 8\n ) {\n const elem = src[srcPos];\n dest[destPos] = zeroMapping ^ (-((elem >> 7) & 1) & xorMask);\n dest[destPos + 1] = zeroMapping ^ (-((elem >> 6) & 1) & xorMask);\n dest[destPos + 2] = zeroMapping ^ (-((elem >> 5) & 1) & xorMask);\n dest[destPos + 3] = zeroMapping ^ (-((elem >> 4) & 1) & xorMask);\n dest[destPos + 4] = zeroMapping ^ (-((elem >> 3) & 1) & xorMask);\n dest[destPos + 5] = zeroMapping ^ (-((elem >> 2) & 1) & xorMask);\n dest[destPos + 6] = zeroMapping ^ (-((elem >> 1) & 1) & xorMask);\n dest[destPos + 7] = zeroMapping ^ (-(elem & 1) & xorMask);\n }\n if (widthRemainder === 0) {\n continue;\n }\n const elem = srcPos < srcLength ? src[srcPos++] : 255;\n for (let j = 0; j < widthRemainder; ++j, ++destPos) {\n dest[destPos] = zeroMapping ^ (-((elem >> (7 - j)) & 1) & xorMask);\n }\n }\n\n return { srcPos, destPos };\n}\n\nfunction convertRGBToRGBA({\n src,\n srcPos = 0,\n dest,\n destPos = 0,\n width,\n height,\n}) {\n let i = 0;\n const len = width * height * 3;\n const len32 = len >> 2;\n const src32 = new Uint32Array(src.buffer, srcPos, len32);\n const alphaMask = FeatureTest.isLittleEndian ? 0xff000000 : 0xff;\n\n if (FeatureTest.isLittleEndian) {\n // It's a way faster to do the shuffle manually instead of working\n // component by component with some Uint8 arrays.\n for (; i < len32 - 2; i += 3, destPos += 4) {\n const s1 = src32[i], // R2B1G1R1\n s2 = src32[i + 1], // G3R3B2G2\n s3 = src32[i + 2]; // B4G4R4B3\n\n dest[destPos] = s1 | alphaMask;\n dest[destPos + 1] = (s1 >>> 24) | (s2 << 8) | alphaMask;\n dest[destPos + 2] = (s2 >>> 16) | (s3 << 16) | alphaMask;\n dest[destPos + 3] = (s3 >>> 8) | alphaMask;\n }\n\n for (let j = srcPos + i * 4, jj = srcPos + len; j < jj; j += 3) {\n dest[destPos++] =\n src[j] | (src[j + 1] << 8) | (src[j + 2] << 16) | alphaMask;\n }\n } else {\n for (; i < len32 - 2; i += 3, destPos += 4) {\n const s1 = src32[i], // R1G1B1R2\n s2 = src32[i + 1], // G2B2R3G3\n s3 = src32[i + 2]; // B3R4G4B4\n\n dest[destPos] = s1 | alphaMask;\n dest[destPos + 1] = (s1 << 24) | (s2 >>> 8) | alphaMask;\n dest[destPos + 2] = (s2 << 16) | (s3 >>> 16) | alphaMask;\n dest[destPos + 3] = (s3 << 8) | alphaMask;\n }\n\n for (let j = srcPos + i * 4, jj = srcPos + len; j < jj; j += 3) {\n dest[destPos++] =\n (src[j] << 24) | (src[j + 1] << 16) | (src[j + 2] << 8) | alphaMask;\n }\n }\n\n return { srcPos: srcPos + len, destPos };\n}\n\nfunction grayToRGBA(src, dest) {\n if (FeatureTest.isLittleEndian) {\n for (let i = 0, ii = src.length; i < ii; i++) {\n dest[i] = (src[i] * 0x10101) | 0xff000000;\n }\n } else {\n for (let i = 0, ii = src.length; i < ii; i++) {\n dest[i] = (src[i] * 0x1010100) | 0x000000ff;\n }\n }\n}\n\nexport {\n convertBlackAndWhiteToRGBA,\n convertRGBToRGBA,\n convertToRGBA,\n grayToRGBA,\n};\n","/* Copyright 2026 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// WGSL shader for Gouraud-shaded triangle mesh rasterization.\n// Vertices arrive in PDF content-space coordinates; the vertex shader\n// applies the affine transform supplied via a uniform buffer to map them\n// to NDC (X: -1..1 left→right, Y: -1..1 bottom→top).\n// Colors are delivered as unorm8x4 (r,g,b,_) and passed through as-is.\nconst MESH_WGSL = /* wgsl */ `\nstruct Uniforms {\n offsetX : f32,\n offsetY : f32,\n scaleX : f32,\n scaleY : f32,\n paddedWidth : f32,\n paddedHeight : f32,\n borderSize : f32,\n _pad : f32,\n};\n\n@group(0) @binding(0) var u : Uniforms;\n\nstruct VertexInput {\n @location(0) position : vec2,\n @location(1) color : vec4,\n};\n\nstruct VertexOutput {\n @builtin(position) position : vec4,\n @location(0) color : vec3,\n};\n\n@vertex\nfn vs_main(in : VertexInput) -> VertexOutput {\n var out : VertexOutput;\n let cx = (in.position.x + u.offsetX) * u.scaleX;\n let cy = (in.position.y + u.offsetY) * u.scaleY;\n out.position = vec4(\n ((cx + u.borderSize) / u.paddedWidth) * 2.0 - 1.0,\n 1.0 - ((cy + u.borderSize) / u.paddedHeight) * 2.0,\n 0.0,\n 1.0\n );\n out.color = in.color.rgb;\n return out;\n}\n\n@fragment\nfn fs_main(in : VertexOutput) -> @location(0) vec4 {\n return vec4(in.color, 1.0);\n}\n`;\n\nclass WebGPU {\n #initPromise = null;\n\n #device = null;\n\n #meshPipeline = null;\n\n // Format chosen to match the OffscreenCanvas swapchain on this device.\n #preferredFormat = null;\n\n async #initGPU() {\n if (!globalThis.navigator?.gpu) {\n return false;\n }\n try {\n const adapter = await navigator.gpu.requestAdapter();\n if (!adapter) {\n return false;\n }\n this.#preferredFormat = navigator.gpu.getPreferredCanvasFormat();\n this.#device = await adapter.requestDevice();\n return true;\n } catch {\n return false;\n }\n }\n\n /**\n * Start GPU initialization.\n * @returns {Promise} true when a GPU device is available.\n */\n init() {\n return (this.#initPromise ||= this.#initGPU());\n }\n\n get isReady() {\n return this.#device !== null;\n }\n\n /**\n * Compile (and cache) the Gouraud-mesh pipeline.\n */\n loadMeshShader() {\n if (!this.#device || this.#meshPipeline) {\n return;\n }\n const shaderModule = this.#device.createShaderModule({ code: MESH_WGSL });\n this.#meshPipeline = this.#device.createRenderPipeline({\n layout: \"auto\",\n vertex: {\n module: shaderModule,\n entryPoint: \"vs_main\",\n buffers: [\n {\n // Buffer 0: PDF content-space coords, 2 × float32 per vertex.\n arrayStride: 2 * 4,\n attributes: [{ shaderLocation: 0, offset: 0, format: \"float32x2\" }],\n },\n {\n // Buffer 1: vertex colors, 4 × unorm8 per vertex (r, g, b, _).\n arrayStride: 4,\n attributes: [{ shaderLocation: 1, offset: 0, format: \"unorm8x4\" }],\n },\n ],\n },\n fragment: {\n module: shaderModule,\n entryPoint: \"fs_main\",\n // Use the canvas-preferred format so the OffscreenCanvas swapchain\n // and the pipeline output format always agree.\n targets: [{ format: this.#preferredFormat }],\n },\n primitive: { topology: \"triangle-list\" },\n });\n }\n\n /**\n * Render a mesh shading to an ImageBitmap using WebGPU.\n *\n * The flat vertex streams (positions and colors) were pre-built by the\n * worker and arrive ready to upload. A uniform buffer carries the affine\n * transform so the vertex shader maps PDF content-space coordinates to NDC\n * without any CPU arithmetic per vertex.\n *\n * After `device.queue.submit()`, `transferToImageBitmap()` presents the\n * current GPU frame synchronously – the browser ensures all submitted GPU\n * commands are complete before returning. The resulting ImageBitmap stays\n * GPU-resident; `ctx2d.drawImage(bitmap)` is a zero-copy GPU-to-GPU blit.\n *\n * The GPU device must already be initialized (`this.isReady === true`).\n * @param {Float32Array} posData flat vertex positions (x,y per vertex)\n * @param {Uint8Array} colData flat vertex colors (r,g,b,_ per vertex)\n * @param {number} vertexCount\n * @param {object} context offsetX/offsetY/scaleX/scaleY\n * @param {Uint8Array|null} backgroundColor [r,g,b] or null for transparent\n * @param {number} paddedWidth render-target width\n * @param {number} paddedHeight render-target height\n * @param {number} borderSize transparent border size in pixels\n * @returns {ImageBitmap}\n */\n draw(\n posData,\n colData,\n vertexCount,\n context,\n backgroundColor,\n paddedWidth,\n paddedHeight,\n borderSize\n ) {\n // Lazily compile the mesh pipeline the first time we need to draw.\n this.loadMeshShader();\n\n const device = this.#device;\n const { offsetX, offsetY, scaleX, scaleY } = context;\n\n // Upload vertex positions (raw PDF coords) and colors as separate buffers.\n // GPUBufferUsage requires size > 0.\n const posBuffer = device.createBuffer({\n size: Math.max(posData.byteLength, 4),\n usage: GPUBufferUsage.VERTEX | GPUBufferUsage.COPY_DST,\n });\n if (posData.byteLength > 0) {\n device.queue.writeBuffer(posBuffer, 0, posData);\n }\n\n const colBuffer = device.createBuffer({\n size: Math.max(colData.byteLength, 4),\n usage: GPUBufferUsage.VERTEX | GPUBufferUsage.COPY_DST,\n });\n if (colData.byteLength > 0) {\n device.queue.writeBuffer(colBuffer, 0, colData);\n }\n\n // Uniform buffer: affine transform parameters for the vertex shader.\n const uniformBuffer = device.createBuffer({\n size: 8 * 4, // 8 × float32 = 32 bytes\n usage: GPUBufferUsage.UNIFORM | GPUBufferUsage.COPY_DST,\n });\n device.queue.writeBuffer(\n uniformBuffer,\n 0,\n new Float32Array([\n offsetX,\n offsetY,\n scaleX,\n scaleY,\n paddedWidth,\n paddedHeight,\n borderSize,\n 0, // padding to 32 bytes\n ])\n );\n\n const bindGroup = device.createBindGroup({\n layout: this.#meshPipeline.getBindGroupLayout(0),\n entries: [{ binding: 0, resource: { buffer: uniformBuffer } }],\n });\n\n // The canvas covers the full padded area so the border is naturally clear.\n const offscreen = new OffscreenCanvas(paddedWidth, paddedHeight);\n const gpuCtx = offscreen.getContext(\"webgpu\");\n gpuCtx.configure({\n device,\n format: this.#preferredFormat,\n // \"premultiplied\" allows fully transparent border pixels when there is\n // no backgroundColor; \"opaque\" is slightly more efficient otherwise.\n alphaMode: backgroundColor ? \"opaque\" : \"premultiplied\",\n });\n\n const clearValue = backgroundColor\n ? {\n r: backgroundColor[0] / 255,\n g: backgroundColor[1] / 255,\n b: backgroundColor[2] / 255,\n a: 1,\n }\n : { r: 0, g: 0, b: 0, a: 0 };\n\n const commandEncoder = device.createCommandEncoder();\n const renderPass = commandEncoder.beginRenderPass({\n colorAttachments: [\n {\n view: gpuCtx.getCurrentTexture().createView(),\n clearValue,\n loadOp: \"clear\",\n storeOp: \"store\",\n },\n ],\n });\n if (vertexCount > 0) {\n renderPass.setPipeline(this.#meshPipeline);\n renderPass.setBindGroup(0, bindGroup);\n renderPass.setVertexBuffer(0, posBuffer);\n renderPass.setVertexBuffer(1, colBuffer);\n renderPass.draw(vertexCount);\n }\n renderPass.end();\n\n device.queue.submit([commandEncoder.finish()]);\n posBuffer.destroy();\n colBuffer.destroy();\n uniformBuffer.destroy();\n\n // Present the current GPU frame and capture it as an ImageBitmap.\n // The browser flushes all pending GPU commands before returning, so this\n // is synchronous from the JavaScript perspective. The ImageBitmap is\n // GPU-resident; drawing it onto a 2D canvas is a GPU-to-GPU blit.\n return offscreen.transferToImageBitmap();\n }\n}\n\nconst _webGPU = new WebGPU();\n\n/**\n * Start GPU initialization as early as possible.\n * @returns {Promise} true if a GPU device was acquired.\n */\nfunction initGPU() {\n return _webGPU.init();\n}\n\nfunction isGPUReady() {\n return _webGPU.isReady;\n}\n\n/**\n * Pre-compile the Gouraud-mesh WGSL pipeline.\n */\nfunction loadMeshShader() {\n _webGPU.loadMeshShader();\n}\n\nfunction drawMeshWithGPU(\n posData,\n colData,\n vertexCount,\n context,\n backgroundColor,\n paddedWidth,\n paddedHeight,\n borderSize\n) {\n return _webGPU.draw(\n posData,\n colData,\n vertexCount,\n context,\n backgroundColor,\n paddedWidth,\n paddedHeight,\n borderSize\n );\n}\n\nexport { drawMeshWithGPU, initGPU, isGPUReady, loadMeshShader };\n","/* Copyright 2014 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n BBOX_INIT,\n FormatError,\n info,\n unreachable,\n Util,\n} from \"../shared/util.js\";\nimport { drawMeshWithGPU, isGPUReady, loadMeshShader } from \"./webgpu.js\";\nimport { CanvasNestedDependencyTracker } from \"./canvas_dependency_tracker.js\";\nimport { getCurrentTransform } from \"./display_utils.js\";\n\nconst PathType = {\n FILL: \"Fill\",\n STROKE: \"Stroke\",\n SHADING: \"Shading\",\n};\n\nfunction applyBoundingBox(ctx, bbox) {\n if (!bbox) {\n return;\n }\n const width = bbox[2] - bbox[0];\n const height = bbox[3] - bbox[1];\n const region = new Path2D();\n region.rect(bbox[0], bbox[1], width, height);\n ctx.clip(region);\n}\n\nclass BaseShadingPattern {\n matrix = null;\n\n constructor() {\n if (\n (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) &&\n this.constructor === BaseShadingPattern\n ) {\n unreachable(\"Cannot initialize BaseShadingPattern.\");\n }\n }\n\n isModifyingCurrentTransform() {\n return false;\n }\n\n getPattern() {\n unreachable(\"Abstract method `getPattern` called.\");\n }\n}\n\nclass RadialAxialShadingPattern extends BaseShadingPattern {\n constructor(IR) {\n super();\n this._type = IR[1];\n this._bbox = IR[2];\n this._colorStops = IR[3];\n this._p0 = IR[4];\n this._p1 = IR[5];\n this._r0 = IR[6];\n this._r1 = IR[7];\n }\n\n isOriginBased() {\n return (\n this._p0[0] === 0 &&\n this._p0[1] === 0 &&\n (!this.isRadial() || (this._p1[0] === 0 && this._p1[1] === 0))\n );\n }\n\n isRadial() {\n return this._type === \"radial\";\n }\n\n // Return true when the a circle of a radial gradient isn't fully included in\n // the other circle, which means that the gradient is conic and we need to\n // draw the reversed gradient first to correctly render the pattern (see\n // #20851 and #257).\n areConic() {\n if (!this.isRadial()) {\n return false;\n }\n const dist = Math.hypot(\n this._p0[0] - this._p1[0],\n this._p0[1] - this._p1[1]\n );\n return dist + this._r1 > this._r0 && dist + this._r0 > this._r1;\n }\n\n _createGradient(ctx, transform = null) {\n let grad;\n let firstPoint = this._p0;\n let secondPoint = this._p1;\n if (transform) {\n firstPoint = firstPoint.slice();\n secondPoint = secondPoint.slice();\n Util.applyTransform(firstPoint, transform);\n Util.applyTransform(secondPoint, transform);\n }\n if (this._type === \"axial\") {\n grad = ctx.createLinearGradient(\n firstPoint[0],\n firstPoint[1],\n secondPoint[0],\n secondPoint[1]\n );\n } else if (this._type === \"radial\") {\n let r0 = this._r0;\n let r1 = this._r1;\n if (transform) {\n const scale = new Float32Array(2);\n Util.singularValueDecompose2dScale(transform, scale);\n r0 *= scale[0];\n r1 *= scale[0];\n }\n grad = ctx.createRadialGradient(\n firstPoint[0],\n firstPoint[1],\n r0,\n secondPoint[0],\n secondPoint[1],\n r1\n );\n }\n\n for (const colorStop of this._colorStops) {\n grad.addColorStop(colorStop[0], colorStop[1]);\n }\n return grad;\n }\n\n _createReversedGradient(ctx, transform = null) {\n // Swapped circles: (p1, r1) → (p0, r0), with color stops reversed.\n let firstPoint = this._p1;\n let secondPoint = this._p0;\n if (transform) {\n firstPoint = firstPoint.slice();\n secondPoint = secondPoint.slice();\n Util.applyTransform(firstPoint, transform);\n Util.applyTransform(secondPoint, transform);\n }\n let r0 = this._r1;\n let r1 = this._r0;\n if (transform) {\n const scale = new Float32Array(2);\n Util.singularValueDecompose2dScale(transform, scale);\n r0 *= scale[0];\n r1 *= scale[0];\n }\n const grad = ctx.createRadialGradient(\n firstPoint[0],\n firstPoint[1],\n r0,\n secondPoint[0],\n secondPoint[1],\n r1\n );\n const reversedStops = this._colorStops\n .map(([t, c]) => [1 - t, c])\n .reverse();\n for (const [t, c] of reversedStops) {\n grad.addColorStop(t, c);\n }\n return grad;\n }\n\n /** Rasterize a shading within its device-space bounding box. */\n _createRasterPattern(ctx, owner, inverse, bbox, transform, transferMaps) {\n // Limit the temporary canvas to `bbox` (see bug 1722807).\n const width = Math.ceil(bbox[2] - bbox[0]) || 1;\n const height = Math.ceil(bbox[3] - bbox[1]) || 1;\n\n const tmpCanvas = owner.canvasFactory.create(width, height);\n\n const tmpCtx = tmpCanvas.context;\n tmpCtx.clearRect(0, 0, width, height);\n tmpCtx.beginPath();\n tmpCtx.rect(0, 0, width, height);\n // Account for the `bbox` origin.\n tmpCtx.translate(-bbox[0], -bbox[1]);\n inverse = Util.transform(inverse, [1, 0, 0, 1, bbox[0], bbox[1]]);\n\n tmpCtx.transform(...transform);\n applyBoundingBox(tmpCtx, this._bbox);\n\n if (this.areConic()) {\n tmpCtx.fillStyle = this._createReversedGradient(tmpCtx);\n tmpCtx.fill();\n }\n tmpCtx.fillStyle = this._createGradient(tmpCtx);\n tmpCtx.fill();\n // Apply maps after interpolation by filtering the raster, not the stops.\n transferMaps?.applyToCanvas(tmpCtx);\n\n const pattern = ctx.createPattern(tmpCanvas.canvas, \"no-repeat\");\n owner.canvasFactory.destroy(tmpCanvas);\n pattern.setTransform(new DOMMatrix(inverse));\n return pattern;\n }\n\n getPattern(ctx, owner, inverse, pathType) {\n const transferMaps = owner.current.transferMapsFallback;\n if (pathType === PathType.STROKE || pathType === PathType.FILL) {\n if (this.isOriginBased() && !transferMaps) {\n let transf = Util.transform(inverse, owner.baseTransform);\n if (this.matrix) {\n transf = Util.transform(transf, this.matrix);\n }\n const precision = 1e-3;\n const n1 = Math.hypot(transf[0], transf[1]);\n const n2 = Math.hypot(transf[2], transf[3]);\n const ps = (transf[0] * transf[2] + transf[1] * transf[3]) / (n1 * n2);\n if (Math.abs(ps) < precision) {\n // The images of the basis vectors are orthogonal.\n if (this.isRadial()) {\n // If the images of the basis vectors are a square then the\n // circles are transformed to circles and we can use a gradient\n // directly.\n if (Math.abs(n1 - n2) < precision) {\n return this._createGradient(ctx, transf);\n }\n } else {\n // The rectangles are transformed to rectangles and we can use a\n // gradient directly.\n return this._createGradient(ctx, transf);\n }\n }\n }\n\n const ownerBBox = owner.current.getClippedPathBoundingBox(\n pathType,\n getCurrentTransform(ctx)\n ) || [0, 0, 0, 0];\n // Fill and stroke patterns use the owner's base transform.\n const transform = this.matrix\n ? Util.transform(owner.baseTransform, this.matrix)\n : owner.baseTransform;\n return this._createRasterPattern(\n ctx,\n owner,\n inverse,\n ownerBBox,\n transform,\n transferMaps\n );\n }\n\n // Direct gradients work unless the maps require a raster.\n if (transferMaps && inverse) {\n return this._createRasterPattern(\n ctx,\n owner,\n inverse,\n owner.current.clipBox,\n getCurrentTransform(ctx),\n transferMaps\n );\n }\n if (this.areConic()) {\n // Draw the reversed gradient first so the normal gradient can\n // correctly overlay it (see _isCircleCenterOutside for details).\n ctx.save();\n applyBoundingBox(ctx, this._bbox);\n ctx.fillStyle = this._createReversedGradient(ctx);\n ctx.fillRect(-1e10, -1e10, 2e10, 2e10);\n ctx.restore();\n }\n applyBoundingBox(ctx, this._bbox);\n return this._createGradient(ctx);\n }\n}\n\nfunction drawTriangle(data, context, p1, p2, p3, c1, c2, c3) {\n // Very basic Gouraud-shaded triangle rasterization algorithm.\n const coords = context.coords,\n colors = context.colors;\n const bytes = data.data,\n rowSize = data.width * 4;\n let tmp;\n if (coords[p1 * 2 + 1] > coords[p2 * 2 + 1]) {\n tmp = p1;\n p1 = p2;\n p2 = tmp;\n tmp = c1;\n c1 = c2;\n c2 = tmp;\n }\n if (coords[p2 * 2 + 1] > coords[p3 * 2 + 1]) {\n tmp = p2;\n p2 = p3;\n p3 = tmp;\n tmp = c2;\n c2 = c3;\n c3 = tmp;\n }\n if (coords[p1 * 2 + 1] > coords[p2 * 2 + 1]) {\n tmp = p1;\n p1 = p2;\n p2 = tmp;\n tmp = c1;\n c1 = c2;\n c2 = tmp;\n }\n const x1 = (coords[p1 * 2] + context.offsetX) * context.scaleX;\n const y1 = (coords[p1 * 2 + 1] + context.offsetY) * context.scaleY;\n const x2 = (coords[p2 * 2] + context.offsetX) * context.scaleX;\n const y2 = (coords[p2 * 2 + 1] + context.offsetY) * context.scaleY;\n const x3 = (coords[p3 * 2] + context.offsetX) * context.scaleX;\n const y3 = (coords[p3 * 2 + 1] + context.offsetY) * context.scaleY;\n if (y1 >= y3) {\n return;\n }\n const c1r = colors[c1 * 4],\n c1g = colors[c1 * 4 + 1],\n c1b = colors[c1 * 4 + 2];\n const c2r = colors[c2 * 4],\n c2g = colors[c2 * 4 + 1],\n c2b = colors[c2 * 4 + 2];\n const c3r = colors[c3 * 4],\n c3g = colors[c3 * 4 + 1],\n c3b = colors[c3 * 4 + 2];\n\n const minY = Math.round(y1),\n maxY = Math.round(y3);\n let xa, car, cag, cab;\n let xb, cbr, cbg, cbb;\n for (let y = minY; y <= maxY; y++) {\n if (y < y2) {\n const k = y < y1 ? 0 : (y1 - y) / (y1 - y2);\n xa = x1 - (x1 - x2) * k;\n car = c1r - (c1r - c2r) * k;\n cag = c1g - (c1g - c2g) * k;\n cab = c1b - (c1b - c2b) * k;\n } else {\n let k;\n if (y > y3) {\n k = 1;\n } else if (y2 === y3) {\n k = 0;\n } else {\n k = (y2 - y) / (y2 - y3);\n }\n xa = x2 - (x2 - x3) * k;\n car = c2r - (c2r - c3r) * k;\n cag = c2g - (c2g - c3g) * k;\n cab = c2b - (c2b - c3b) * k;\n }\n\n let k;\n if (y < y1) {\n k = 0;\n } else if (y > y3) {\n k = 1;\n } else {\n k = (y1 - y) / (y1 - y3);\n }\n xb = x1 - (x1 - x3) * k;\n cbr = c1r - (c1r - c3r) * k;\n cbg = c1g - (c1g - c3g) * k;\n cbb = c1b - (c1b - c3b) * k;\n const x1_ = Math.round(Math.min(xa, xb));\n const x2_ = Math.round(Math.max(xa, xb));\n let j = rowSize * y + x1_ * 4;\n for (let x = x1_; x <= x2_; x++) {\n k = (xa - x) / (xa - xb);\n if (k < 0) {\n k = 0;\n } else if (k > 1) {\n k = 1;\n }\n bytes[j++] = (car - (car - cbr) * k) | 0;\n bytes[j++] = (cag - (cag - cbg) * k) | 0;\n bytes[j++] = (cab - (cab - cbb) * k) | 0;\n bytes[j++] = 255;\n }\n }\n}\n\nclass MeshShadingPattern extends BaseShadingPattern {\n constructor(IR) {\n super();\n this._posData = IR[2];\n this._colData = IR[3];\n this._vertexCount = IR[4];\n this._bounds = IR[5];\n this._bbox = IR[6];\n this._background = IR[7];\n // Pre-compile the mesh pipeline now that we know GPU-renderable content\n // is present; no-op if the GPU is not available or already compiled.\n loadMeshShader();\n }\n\n _createMeshCanvas(\n combinedScale,\n backgroundColor,\n canvasFactory,\n transferMaps = null\n ) {\n // we will increase scale on some weird factor to let antialiasing take\n // care of \"rough\" edges\n const EXPECTED_SCALE = 1.1;\n // MAX_PATTERN_SIZE is used to avoid OOM situation.\n const MAX_PATTERN_SIZE = 3000; // 10in @ 300dpi shall be enough\n // We need to keep transparent border around our pattern for fill():\n // createPattern with 'no-repeat' will bleed edges across entire area.\n const BORDER_SIZE = 2;\n\n const offsetX = Math.floor(this._bounds[0]);\n const offsetY = Math.floor(this._bounds[1]);\n const boundsWidth = Math.ceil(this._bounds[2]) - offsetX;\n const boundsHeight = Math.ceil(this._bounds[3]) - offsetY;\n\n // Ensure that the shading has non-zero width and height, to prevent errors\n // in `pattern_helper.js` (fixes issue17848.pdf).\n const width =\n Math.min(\n Math.ceil(Math.abs(boundsWidth * combinedScale[0] * EXPECTED_SCALE)),\n MAX_PATTERN_SIZE\n ) || 1;\n const height =\n Math.min(\n Math.ceil(Math.abs(boundsHeight * combinedScale[1] * EXPECTED_SCALE)),\n MAX_PATTERN_SIZE\n ) || 1;\n const scaleX = boundsWidth ? boundsWidth / width : 1;\n const scaleY = boundsHeight ? boundsHeight / height : 1;\n\n const context = {\n coords: this._posData,\n colors: this._colData,\n offsetX: -offsetX,\n offsetY: -offsetY,\n scaleX: 1 / scaleX,\n scaleY: 1 / scaleY,\n };\n\n const paddedWidth = width + BORDER_SIZE * 2;\n const paddedHeight = height + BORDER_SIZE * 2;\n const tmpCanvas = canvasFactory.create(paddedWidth, paddedHeight);\n\n // Use the GPU path when there are more than 16 triangles (> 48 vertices).\n // With small meshes the GPU overhead is significant and the CPU path is\n // faster. The texture has to move from the GPU to the main thread and it's\n // costly. So it's frequent to have a lot of mesh-based shading patterns\n // when rendering some 3D surfaces (see bug 2030745).\n if (isGPUReady() && this._vertexCount > 48) {\n tmpCanvas.context.drawImage(\n drawMeshWithGPU(\n this._posData,\n this._colData,\n this._vertexCount,\n context,\n backgroundColor,\n paddedWidth,\n paddedHeight,\n BORDER_SIZE\n ),\n 0,\n 0\n );\n } else {\n const data = tmpCanvas.context.createImageData(width, height);\n if (backgroundColor) {\n const bytes = data.data;\n for (let i = 0, ii = bytes.length; i < ii; i += 4) {\n bytes[i] = backgroundColor[0];\n bytes[i + 1] = backgroundColor[1];\n bytes[i + 2] = backgroundColor[2];\n bytes[i + 3] = 255;\n }\n }\n for (let i = 0, ii = this._vertexCount; i < ii; i += 3) {\n drawTriangle(data, context, i, i + 1, i + 2, i, i + 1, i + 2);\n }\n tmpCanvas.context.putImageData(data, BORDER_SIZE, BORDER_SIZE);\n }\n // Filter the raster when using the software fallback.\n transferMaps?.applyToCanvas(tmpCanvas.context);\n\n return {\n canvas: tmpCanvas.canvas,\n offsetX: offsetX - BORDER_SIZE * scaleX,\n offsetY: offsetY - BORDER_SIZE * scaleY,\n scaleX,\n scaleY,\n };\n }\n\n isModifyingCurrentTransform() {\n return true;\n }\n\n getPattern(ctx, owner, inverse, pathType) {\n applyBoundingBox(ctx, this._bbox);\n const scale = new Float32Array(2);\n if (pathType === PathType.SHADING) {\n Util.singularValueDecompose2dScale(getCurrentTransform(ctx), scale);\n } else if (this.matrix) {\n // Obtain scale from matrix and current transformation matrix.\n Util.singularValueDecompose2dScale(this.matrix, scale);\n const [matrixScaleX, matrixScaleY] = scale;\n Util.singularValueDecompose2dScale(owner.baseTransform, scale);\n scale[0] *= matrixScaleX;\n scale[1] *= matrixScaleY;\n } else {\n Util.singularValueDecompose2dScale(owner.baseTransform, scale);\n }\n\n // Rasterizing on the main thread since sending/queue large canvases\n // might cause OOM.\n const temporaryPatternCanvas = this._createMeshCanvas(\n scale,\n pathType === PathType.SHADING ? null : this._background,\n owner.canvasFactory,\n owner.current.transferMapsFallback\n );\n\n if (pathType !== PathType.SHADING) {\n ctx.setTransform(...owner.baseTransform);\n if (this.matrix) {\n ctx.transform(...this.matrix);\n }\n }\n\n ctx.translate(\n temporaryPatternCanvas.offsetX,\n temporaryPatternCanvas.offsetY\n );\n ctx.scale(temporaryPatternCanvas.scaleX, temporaryPatternCanvas.scaleY);\n\n const pattern = ctx.createPattern(\n temporaryPatternCanvas.canvas,\n \"no-repeat\"\n );\n owner.canvasFactory.destroy(temporaryPatternCanvas);\n return pattern;\n }\n}\n\nclass DummyShadingPattern extends BaseShadingPattern {\n getPattern() {\n return \"hotpink\";\n }\n}\n\nfunction getShadingPattern(IR) {\n switch (IR[0]) {\n case \"RadialAxial\":\n return new RadialAxialShadingPattern(IR);\n case \"Mesh\":\n return new MeshShadingPattern(IR);\n case \"Dummy\":\n return new DummyShadingPattern();\n }\n throw new Error(`Unknown IR type: ${IR[0]}`);\n}\n\nconst PaintType = {\n COLORED: 1,\n UNCOLORED: 2,\n};\n\nclass TilingPattern {\n // 10in @ 300dpi shall be enough.\n static MAX_PATTERN_SIZE = 3000;\n\n constructor(IR, ctx, canvasGraphicsFactory, baseTransform) {\n this.color = IR[1];\n this.operatorList = IR[2];\n this.matrix = IR[3];\n this.bbox = IR[4];\n this.xstep = IR[5];\n this.ystep = IR[6];\n this.paintType = IR[7];\n this.tilingType = IR[8];\n this.needsIsolation = IR[9] ?? true;\n this.ctx = ctx;\n this.canvasGraphicsFactory = canvasGraphicsFactory;\n this.baseTransform = baseTransform;\n // baseTransform * patternMatrix.\n this.patternBaseMatrix = this.matrix\n ? Util.transform(baseTransform, this.matrix)\n : baseTransform;\n }\n\n // Returns [n, m] tile index if the fill area fits within one tile,\n // null otherwise.\n canSkipPatternCanvas([width, height, offsetX, offsetY]) {\n const [x0, y0, x1, y1] = this.bbox;\n const absXStep = Math.abs(this.xstep);\n const absYStep = Math.abs(this.ystep);\n\n // dims is in pattern space, so compare directly with xstep/ystep.\n if (width > absXStep + 1e-6 || height > absYStep + 1e-6) {\n return null;\n }\n\n // Tile n covers [x0+n·xstep, x1+n·xstep]; find the range intersecting\n // [offsetX, offsetX+width].\n const nXFirst = Math.floor((offsetX - x1) / absXStep) + 1;\n const nXLast = Math.ceil((offsetX + width - x0) / absXStep) - 1;\n const nYFirst = Math.floor((offsetY - y1) / absYStep) + 1;\n const nYLast = Math.ceil((offsetY + height - y0) / absYStep) - 1;\n return nXLast <= nXFirst && nYLast <= nYFirst ? [nXFirst, nYFirst] : null;\n }\n\n // Converts clippedBBox from device space to pattern space and stores it\n // as [width, height, offsetX, offsetY] in dims.\n updatePatternDims(clippedBBox, dims) {\n // Two diagonal corners aren't enough when the pattern matrix is rotated.\n const bbox = BBOX_INIT.slice();\n Util.axialAlignedBoundingBox(\n clippedBBox,\n Util.inverseTransform(this.patternBaseMatrix),\n bbox\n );\n dims[0] = bbox[2] - bbox[0];\n dims[1] = bbox[3] - bbox[1];\n dims[2] = bbox[0];\n dims[3] = bbox[1];\n }\n\n // Renders the tile operators onto a fresh canvas and returns it.\n _renderTileCanvas(owner, opIdx, dimx, dimy) {\n const [x0, y0, x1, y1] = this.bbox;\n const tmpCanvas = owner.canvasFactory.create(dimx.size, dimy.size);\n const tmpCtx = tmpCanvas.context;\n const graphics = this.canvasGraphicsFactory.createCanvasGraphics(\n tmpCtx,\n opIdx\n );\n graphics.groupLevel = owner.groupLevel;\n // Inherit the owner's fallback while rendering the tile.\n graphics.current.transferMapsFallback = owner.current.transferMapsFallback;\n\n this.setFillAndStrokeStyleToContext(graphics, this.paintType, this.color);\n\n tmpCtx.translate(-dimx.scale * x0, -dimy.scale * y0);\n // 0: sub-ops are indexed under the top-level opIdx from\n // createCanvasGraphics.\n graphics.transform(0, dimx.scale, 0, 0, dimy.scale, 0, 0);\n\n // Required to balance the save/restore in CanvasGraphics beginDrawing.\n tmpCtx.save();\n graphics.dependencyTracker?.save();\n\n this.clipBbox(graphics, x0, y0, x1, y1);\n graphics.baseTransform = getCurrentTransform(graphics.ctx);\n graphics.executeOperatorList(this.operatorList);\n\n graphics.endDrawing();\n graphics.dependencyTracker?.restore();\n tmpCtx.restore();\n\n return tmpCanvas;\n }\n\n _getCombinedScales() {\n const scale = new Float32Array(2);\n Util.singularValueDecompose2dScale(this.matrix, scale);\n const [matrixScaleX, matrixScaleY] = scale;\n Util.singularValueDecompose2dScale(this.baseTransform, scale);\n return [matrixScaleX * scale[0], matrixScaleY * scale[1]];\n }\n\n // Draws a single tile directly onto owner, clipped to path.\n drawPattern(owner, path, useEOFill = false, [n, m], opIdx) {\n const [x0, y0, x1, y1] = this.bbox;\n\n const dependencyTracker = owner.dependencyTracker;\n if (dependencyTracker) {\n owner.dependencyTracker = new CanvasNestedDependencyTracker(\n dependencyTracker,\n opIdx\n );\n }\n\n owner.save();\n if (useEOFill) {\n owner.ctx.clip(path, \"evenodd\");\n } else {\n owner.ctx.clip(path);\n }\n // Position tile (n, m) in device space; the clip above is unaffected\n // by setTransform.\n owner.ctx.setTransform(...this.patternBaseMatrix);\n owner.ctx.translate(n * this.xstep, m * this.ystep);\n if (\n this.needsIsolation ||\n owner.ctx.globalAlpha !== 1 ||\n owner.ctx.globalCompositeOperation !== \"source-over\" ||\n owner.inSMaskMode\n ) {\n const bboxWidth = x1 - x0;\n const bboxHeight = y1 - y0;\n const [combinedScaleX, combinedScaleY] = this._getCombinedScales();\n const dimx = this.getSizeAndScale(\n bboxWidth,\n this.ctx.canvas.width,\n combinedScaleX\n );\n const dimy = this.getSizeAndScale(\n bboxHeight,\n this.ctx.canvas.height,\n combinedScaleY\n );\n // Isolate blend modes from the main canvas.\n const tmpCanvas = this._renderTileCanvas(owner, opIdx, dimx, dimy);\n owner.ctx.drawImage(tmpCanvas.canvas, x0, y0, bboxWidth, bboxHeight);\n owner.canvasFactory.destroy(tmpCanvas);\n } else {\n // No blend modes or transparency: render the tile directly onto owner.\n this.setFillAndStrokeStyleToContext(owner, this.paintType, this.color);\n this.clipBbox(owner, x0, y0, x1, y1);\n owner.baseTransformStack.push(owner.baseTransform);\n owner.baseTransform = getCurrentTransform(owner.ctx);\n owner.executeOperatorList(this.operatorList);\n owner.baseTransform = owner.baseTransformStack.pop();\n }\n\n owner.restore();\n if (dependencyTracker) {\n owner.dependencyTracker = dependencyTracker;\n }\n }\n\n createPatternCanvas(owner, opIdx) {\n const [x0, y0, x1, y1] = this.bbox;\n const width = x1 - x0;\n const height = y1 - y0;\n let { xstep, ystep } = this;\n xstep = Math.abs(xstep);\n ystep = Math.abs(ystep);\n\n info(\"TilingType: \" + this.tilingType);\n\n // A tiling pattern as defined by PDF spec 8.7.2 is a cell whose size is\n // described by bbox, and may repeat regularly by shifting the cell by\n // xstep and ystep.\n // Because the HTML5 canvas API does not support pattern repetition with\n // gaps in between, we use the xstep/ystep instead of the bbox's size.\n //\n // This has the following consequences (similarly for ystep):\n //\n // - If xstep is the same as bbox, then there is no observable difference.\n //\n // - If xstep is larger than bbox, then the pattern canvas is partially\n // empty: the area bounded by bbox is painted, the outside area is void.\n //\n // - If xstep is smaller than bbox, then the pixels between xstep and the\n // bbox boundary will be missing. This is INCORRECT behavior.\n // \"Figures on adjacent tiles should not overlap\" (PDF spec 8.7.3.1),\n // but overlapping cells without common pixels are still valid.\n\n // Obtain scale from matrix and current transformation matrix.\n const [combinedScaleX, combinedScaleY] = this._getCombinedScales();\n\n // Use width and height values that are as close as possible to the end\n // result when the pattern is used. Too low value makes the pattern look\n // blurry. Too large value makes it look too crispy.\n let canvasWidth = width,\n canvasHeight = height,\n redrawHorizontally = false,\n redrawVertically = false;\n\n if (\n Math.ceil(xstep * combinedScaleX) >= Math.ceil(width * combinedScaleX)\n ) {\n canvasWidth = xstep;\n } else {\n redrawHorizontally = true;\n }\n if (\n Math.ceil(ystep * combinedScaleY) >= Math.ceil(height * combinedScaleY)\n ) {\n canvasHeight = ystep;\n } else {\n redrawVertically = true;\n }\n\n const dimx = this.getSizeAndScale(\n canvasWidth,\n this.ctx.canvas.width,\n combinedScaleX\n );\n const dimy = this.getSizeAndScale(\n canvasHeight,\n this.ctx.canvas.height,\n combinedScaleY\n );\n\n const tmpCanvas = this._renderTileCanvas(owner, opIdx, dimx, dimy);\n\n if (redrawHorizontally || redrawVertically) {\n // The tile is overlapping itself, so we create a new tile with\n // dimensions xstep * ystep.\n // Then we draw the overlapping parts of the original tile on the new\n // tile.\n // Just as a side note, the code here works correctly even if we don't\n // have to redraw the tile horizontally or vertically. In that case, the\n // original tile is drawn on the new tile only once, but it's useless.\n const image = tmpCanvas.canvas;\n if (redrawHorizontally) {\n canvasWidth = xstep;\n }\n if (redrawVertically) {\n canvasHeight = ystep;\n }\n\n const dimx2 = this.getSizeAndScale(\n canvasWidth,\n this.ctx.canvas.width,\n combinedScaleX\n );\n const dimy2 = this.getSizeAndScale(\n canvasHeight,\n this.ctx.canvas.height,\n combinedScaleY\n );\n\n const xSize = dimx2.size;\n const ySize = dimy2.size;\n const tmpCanvas2 = owner.canvasFactory.create(xSize, ySize);\n const tmpCtx2 = tmpCanvas2.context;\n // Source rectangles outside the image contribute no pixels.\n const ii = redrawHorizontally\n ? Math.min(Math.floor(width / xstep), Math.ceil(image.width / xSize))\n : 0;\n const jj = redrawVertically\n ? Math.min(Math.floor(height / ystep), Math.ceil(image.height / ySize))\n : 0;\n\n // Fold rows, then columns, to avoid drawing every offset pair.\n // Descending indices draw the origin tile last.\n let rowSource = image;\n let bandCanvas = null;\n if (redrawVertically) {\n bandCanvas = owner.canvasFactory.create(image.width, ySize);\n const bandCtx = bandCanvas.context;\n for (let j = jj; j >= 0; j--) {\n bandCtx.drawImage(\n image,\n 0,\n ySize * j,\n image.width,\n ySize,\n 0,\n 0,\n image.width,\n ySize\n );\n }\n rowSource = bandCanvas.canvas;\n }\n\n for (let i = ii; i >= 0; i--) {\n tmpCtx2.drawImage(\n rowSource,\n xSize * i,\n 0,\n xSize,\n ySize,\n 0,\n 0,\n xSize,\n ySize\n );\n }\n if (bandCanvas) {\n owner.canvasFactory.destroy(bandCanvas);\n }\n owner.canvasFactory.destroy(tmpCanvas);\n return {\n canvas: tmpCanvas2.canvas,\n canvasEntry: tmpCanvas2,\n scaleX: dimx2.scale,\n scaleY: dimy2.scale,\n offsetX: x0,\n offsetY: y0,\n };\n }\n\n return {\n canvas: tmpCanvas.canvas,\n canvasEntry: tmpCanvas,\n scaleX: dimx.scale,\n scaleY: dimy.scale,\n offsetX: x0,\n offsetY: y0,\n };\n }\n\n getSizeAndScale(step, realOutputSize, scale) {\n // MAX_PATTERN_SIZE is used to avoid OOM situation.\n // Use the destination canvas's size if it is bigger than the hard-coded\n // limit of MAX_PATTERN_SIZE to avoid clipping patterns that cover the\n // whole canvas.\n const maxSize = Math.max(TilingPattern.MAX_PATTERN_SIZE, realOutputSize);\n let size = Math.ceil(step * scale);\n if (size >= maxSize) {\n size = maxSize;\n } else {\n scale = size / step;\n }\n return { scale, size };\n }\n\n clipBbox(graphics, x0, y0, x1, y1) {\n const bboxWidth = x1 - x0;\n const bboxHeight = y1 - y0;\n const clip = new Path2D();\n clip.rect(x0, y0, bboxWidth, bboxHeight);\n Util.axialAlignedBoundingBox(\n [x0, y0, x1, y1],\n getCurrentTransform(graphics.ctx),\n graphics.current.minMax\n );\n graphics.ctx.clip(clip);\n graphics.current.updateClipFromPath();\n }\n\n setFillAndStrokeStyleToContext(graphics, paintType, color) {\n switch (paintType) {\n case PaintType.COLORED:\n // The cell starts from the initial graphics state of its parent\n // content stream (PDF 32000-1, 8.7.3.1), hence black and not the\n // colours in effect when the pattern was selected.\n color = \"#000000\";\n break;\n case PaintType.UNCOLORED:\n break;\n default:\n throw new FormatError(`Unsupported paint type: ${paintType}`);\n }\n const { ctx, current } = graphics;\n current.patternFill = current.patternStroke = false;\n // Pre-transfer solid colors in fallback mode.\n ctx.fillStyle = ctx.strokeStyle =\n current.transferMapsFallback?.applyToColor(color) ?? color;\n // Also needed by image masks (fixes issues 3226 and 8741).\n current.fillColor = current.strokeColor = color;\n }\n\n isModifyingCurrentTransform() {\n return false;\n }\n\n getPattern(ctx, owner, inverse, pathType, opIdx) {\n // PDF spec 8.7.2: prepend inverse CTM to patternBaseMatrix to position\n // the CSS pattern.\n const matrix =\n pathType !== PathType.SHADING\n ? Util.transform(inverse, this.patternBaseMatrix)\n : inverse;\n\n const temporaryPatternCanvas = this.createPatternCanvas(owner, opIdx);\n\n let domMatrix = new DOMMatrix(matrix);\n // Rescale and so that the ctx.createPattern call generates a pattern with\n // the desired size.\n domMatrix = domMatrix.translate(\n temporaryPatternCanvas.offsetX,\n temporaryPatternCanvas.offsetY\n );\n domMatrix = domMatrix.scale(\n 1 / temporaryPatternCanvas.scaleX,\n 1 / temporaryPatternCanvas.scaleY\n );\n\n const pattern = ctx.createPattern(temporaryPatternCanvas.canvas, \"repeat\");\n owner.canvasFactory.destroy(temporaryPatternCanvas.canvasEntry);\n pattern.setTransform(domMatrix);\n\n return pattern;\n }\n}\n\nexport { getShadingPattern, PathType, TilingPattern };\n","/* Copyright 2012 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n CanvasNestedDependencyTracker,\n Dependencies,\n} from \"./canvas_dependency_tracker.js\";\nimport {\n convertBlackAndWhiteToRGBA,\n convertRGBToRGBA,\n} from \"../shared/image_utils.js\";\nimport {\n F32_BBOX_INIT,\n FeatureTest,\n FONT_IDENTITY_MATRIX,\n ImageKind,\n info,\n makeArr,\n makeMap,\n OPS,\n shadow,\n TextRenderingMode,\n unreachable,\n Util,\n warn,\n} from \"../shared/util.js\";\nimport {\n getCurrentTransform,\n getCurrentTransformInverse,\n getRGBA,\n makePathFromDrawOPS,\n OutputScale,\n PixelsPerInch,\n} from \"./display_utils.js\";\nimport {\n getShadingPattern,\n PathType,\n TilingPattern,\n} from \"./pattern_helper.js\";\nimport { MathClamp } from \"../shared/math_clamp.js\";\n\n// contexts store most of the state we need natively.\n// However, PDF needs a bit more state, which we store here.\n// Minimal font size that would be used during canvas fillText operations.\nconst MIN_FONT_SIZE = 16;\n// Maximum font size that would be used during canvas fillText operations.\nconst MAX_FONT_SIZE = 100;\n\n// Defines the time the `executeOperatorList`-method is going to be executing\n// before it stops and schedules a continue of execution.\nconst EXECUTION_TIME = 15; // ms\n// Defines the number of steps before checking the execution time.\nconst EXECUTION_STEPS = 10;\n\nconst FULL_CHUNK_HEIGHT = 16;\n\n// Used to get some coordinates.\nconst XY = new Float32Array(2);\n\n/**\n * Overrides certain methods on a 2d ctx so that when they are called they\n * will also call the same method on the destCtx. The methods that are\n * overridden are all the transformation state modifiers, path creation, and\n * save/restore. We only forward these specific methods because they are the\n * only state modifiers that we cannot copy over when we switch contexts.\n *\n * To remove mirroring call `ctx._removeMirroring()`.\n * @param {object} ctx - The 2d canvas context that will duplicate its calls on\n * the destCtx.\n * @param {object} destCtx - The 2d canvas context that will receive the\n * forwarded calls.\n */\nfunction mirrorContextOperations(ctx, destCtx) {\n if (ctx._removeMirroring) {\n throw new Error(\"Context is already forwarding operations.\");\n }\n const originalMethods = new Map();\n for (const name of [\n \"save\",\n \"restore\",\n \"rotate\",\n \"scale\",\n \"translate\",\n \"transform\",\n \"setTransform\",\n \"resetTransform\",\n \"clip\",\n \"moveTo\",\n \"lineTo\",\n \"bezierCurveTo\",\n \"quadraticCurveTo\",\n \"arc\",\n \"arcTo\",\n \"ellipse\",\n \"rect\",\n \"roundRect\",\n \"closePath\",\n \"beginPath\",\n ]) {\n const original = ctx[name];\n if (typeof original !== \"function\" || typeof destCtx[name] !== \"function\") {\n continue;\n }\n originalMethods.set(name, original);\n ctx[name] = function (...args) {\n destCtx[name](...args);\n return original.apply(this, args);\n };\n }\n\n ctx._removeMirroring = () => {\n for (const [name, original] of originalMethods) {\n ctx[name] = original;\n }\n delete ctx._removeMirroring;\n };\n}\n\nfunction drawImageAtIntegerCoords(\n ctx,\n srcImg,\n srcX,\n srcY,\n srcW,\n srcH,\n destX,\n destY,\n destW,\n destH\n) {\n const [a, b, c, d, tx, ty] = getCurrentTransform(ctx);\n if (b === 0 && c === 0) {\n // top-left corner is at (X, Y) and\n // bottom-right one is at (X + width, Y + height).\n\n // If leftX is 4.321 then it's rounded to 4.\n // If width is 10.432 then it's rounded to 11 because\n // rightX = leftX + width = 14.753 which is rounded to 15\n // so after rounding the total width is 11 (15 - 4).\n // It's why we can't just floor/ceil uniformly, it just depends\n // on the values we've.\n\n const tlX = destX * a + tx;\n const rTlX = Math.round(tlX);\n const tlY = destY * d + ty;\n const rTlY = Math.round(tlY);\n const brX = (destX + destW) * a + tx;\n\n // Some pdf contains images with 1x1 images so in case of 0-width after\n // scaling we must fallback on 1 to be sure there is something.\n const rWidth = Math.abs(Math.round(brX) - rTlX) || 1;\n const brY = (destY + destH) * d + ty;\n const rHeight = Math.abs(Math.round(brY) - rTlY) || 1;\n\n // We must apply a transformation in order to apply it on the image itself.\n // For example if a == 1 && d == -1, it means that the image itself is\n // mirrored w.r.t. the x-axis.\n ctx.setTransform(Math.sign(a), 0, 0, Math.sign(d), rTlX, rTlY);\n ctx.drawImage(srcImg, srcX, srcY, srcW, srcH, 0, 0, rWidth, rHeight);\n ctx.setTransform(a, b, c, d, tx, ty);\n\n return [rWidth, rHeight];\n }\n\n if (a === 0 && d === 0) {\n // This path is taken in issue9462.pdf (page 3).\n const tlX = destY * c + tx;\n const rTlX = Math.round(tlX);\n const tlY = destX * b + ty;\n const rTlY = Math.round(tlY);\n const brX = (destY + destH) * c + tx;\n const rWidth = Math.abs(Math.round(brX) - rTlX) || 1;\n const brY = (destX + destW) * b + ty;\n const rHeight = Math.abs(Math.round(brY) - rTlY) || 1;\n\n ctx.setTransform(0, Math.sign(b), Math.sign(c), 0, rTlX, rTlY);\n ctx.drawImage(srcImg, srcX, srcY, srcW, srcH, 0, 0, rHeight, rWidth);\n ctx.setTransform(a, b, c, d, tx, ty);\n\n return [rHeight, rWidth];\n }\n\n // Not a scale matrix so let the render handle the case without rounding.\n ctx.drawImage(srcImg, srcX, srcY, srcW, srcH, destX, destY, destW, destH);\n\n const scaleX = Math.hypot(a, b);\n const scaleY = Math.hypot(c, d);\n return [scaleX * destW, scaleY * destH];\n}\n\nclass CanvasExtraState {\n // Are soft masks and alpha values shapes or opacities?\n alphaIsShape = false;\n\n fontSize = 0;\n\n fontSizeScale = 1;\n\n textMatrix = null;\n\n textMatrixScale = 1;\n\n fontMatrix = FONT_IDENTITY_MATRIX;\n\n leading = 0;\n\n // Current point (in user coordinates)\n x = 0;\n\n y = 0;\n\n // Start of text line (in text coordinates)\n lineX = 0;\n\n lineY = 0;\n\n // Character and word spacing\n charSpacing = 0;\n\n wordSpacing = 0;\n\n textHScale = 1;\n\n textRenderingMode = TextRenderingMode.FILL;\n\n textRise = 0;\n\n // Default fore and background colors\n fillColor = \"#000000\";\n\n strokeColor = \"#000000\";\n\n tilingPatternDims = null;\n\n patternFill = false;\n\n patternStroke = false;\n\n // Note: fill alpha applies to all non-stroking operations\n fillAlpha = 1;\n\n strokeAlpha = 1;\n\n lineWidth = 1;\n\n activeSMask = null;\n\n transferMaps = \"none\";\n\n // Software fallback for transfer maps when canvas filters are unavailable.\n transferMapsFallback = null;\n\n minMax = F32_BBOX_INIT.slice();\n\n constructor(width, height) {\n this.clipBox = new Float32Array([0, 0, width, height]);\n }\n\n clone() {\n const clone = Object.create(this);\n clone.clipBox = this.clipBox.slice();\n clone.minMax = this.minMax.slice();\n clone.tilingPatternDims = this.tilingPatternDims?.slice();\n return clone;\n }\n\n getPathBoundingBox(pathType = PathType.FILL, transform = null) {\n const box = this.minMax.slice();\n if (pathType === PathType.STROKE) {\n if (!transform) {\n unreachable(\"Stroke bounding box must include transform.\");\n }\n // Stroked paths can be outside of the path bounding box by 1/2 the line\n // width.\n Util.singularValueDecompose2dScale(transform, XY);\n const xStrokePad = (XY[0] * this.lineWidth) / 2;\n const yStrokePad = (XY[1] * this.lineWidth) / 2;\n box[0] -= xStrokePad;\n box[1] -= yStrokePad;\n box[2] += xStrokePad;\n box[3] += yStrokePad;\n }\n return box;\n }\n\n updateClipFromPath() {\n const intersect = Util.intersect(this.clipBox, this.getPathBoundingBox());\n this.startNewPathAndClipBox(intersect || [0, 0, 0, 0]);\n }\n\n isEmptyClip() {\n return this.minMax[0] === Infinity;\n }\n\n startNewPathAndClipBox(box) {\n this.clipBox.set(box, 0);\n this.minMax.set(F32_BBOX_INIT, 0);\n }\n\n getClippedPathBoundingBox(pathType = PathType.FILL, transform = null) {\n return Util.intersect(\n this.clipBox,\n this.getPathBoundingBox(pathType, transform)\n );\n }\n}\n\nfunction putBinaryImageData(ctx, imgData) {\n // Put the image data to the canvas in chunks, rather than putting the\n // whole image at once. This saves JS memory, because the ImageData object\n // is smaller. It also possibly saves C++ memory within the implementation\n // of putImageData(). (E.g. in Firefox we make two short-lived copies of\n // the data passed to putImageData()). |n| shouldn't be too small, however,\n // because too many putImageData() calls will slow things down.\n //\n // Note: as written, if the last chunk is partial, the putImageData() call\n // will (conceptually) put pixels past the bounds of the canvas. But\n // that's ok; any such pixels are ignored.\n\n const { width, height, kind } = imgData;\n const partialChunkHeight = height % FULL_CHUNK_HEIGHT;\n const fullChunks = (height - partialChunkHeight) / FULL_CHUNK_HEIGHT;\n const totalChunks = partialChunkHeight === 0 ? fullChunks : fullChunks + 1;\n\n const chunkImgData = ctx.createImageData(width, FULL_CHUNK_HEIGHT);\n let srcPos = 0;\n const src = imgData.data;\n const dest = chunkImgData.data;\n let i;\n\n // There are multiple forms in which the pixel data can be passed, and\n // imgData.kind tells us which one this is.\n if (kind === ImageKind.GRAYSCALE_1BPP) {\n // Grayscale, 1 bit per pixel (i.e. black-and-white).\n for (i = 0; i < totalChunks; i++) {\n ({ srcPos } = convertBlackAndWhiteToRGBA({\n src,\n srcPos,\n dest,\n width,\n height: i < fullChunks ? FULL_CHUNK_HEIGHT : partialChunkHeight,\n }));\n\n ctx.putImageData(chunkImgData, 0, i * FULL_CHUNK_HEIGHT);\n }\n } else if (kind === ImageKind.RGBA_32BPP) {\n // RGBA, 32-bits per pixel.\n let j = 0;\n let elemsInThisChunk = width * FULL_CHUNK_HEIGHT * 4;\n for (i = 0; i < fullChunks; i++) {\n dest.set(src.subarray(srcPos, srcPos + elemsInThisChunk));\n srcPos += elemsInThisChunk;\n\n ctx.putImageData(chunkImgData, 0, j);\n j += FULL_CHUNK_HEIGHT;\n }\n if (i < totalChunks) {\n elemsInThisChunk = width * partialChunkHeight * 4;\n dest.set(src.subarray(srcPos, srcPos + elemsInThisChunk));\n\n ctx.putImageData(chunkImgData, 0, j);\n }\n } else if (kind === ImageKind.RGB_24BPP) {\n // RGB, 24-bits per pixel.\n for (i = 0; i < totalChunks; i++) {\n ({ srcPos } = convertRGBToRGBA({\n src,\n srcPos,\n dest: new Uint32Array(dest.buffer),\n width,\n height: i < fullChunks ? FULL_CHUNK_HEIGHT : partialChunkHeight,\n }));\n\n ctx.putImageData(chunkImgData, 0, i * FULL_CHUNK_HEIGHT);\n }\n } else {\n throw new Error(`bad image kind: ${kind}`);\n }\n}\n\nfunction putBinaryImageMask(ctx, imgData) {\n if (imgData.bitmap) {\n // The bitmap has been created in the worker.\n ctx.drawImage(imgData.bitmap, 0, 0);\n return;\n }\n\n // Slow path: OffscreenCanvas isn't available in the worker.\n const { width, height } = imgData;\n const partialChunkHeight = height % FULL_CHUNK_HEIGHT;\n const fullChunks = (height - partialChunkHeight) / FULL_CHUNK_HEIGHT;\n const totalChunks = partialChunkHeight === 0 ? fullChunks : fullChunks + 1;\n\n const chunkImgData = ctx.createImageData(width, FULL_CHUNK_HEIGHT);\n let srcPos = 0;\n const src = imgData.data;\n const dest = chunkImgData.data;\n\n for (let i = 0; i < totalChunks; i++) {\n // Expand the mask so it can be used by the canvas. Any required\n // inversion has already been handled.\n ({ srcPos } = convertBlackAndWhiteToRGBA({\n src,\n srcPos,\n dest,\n width,\n height: i < fullChunks ? FULL_CHUNK_HEIGHT : partialChunkHeight,\n nonBlackColor: 0,\n }));\n\n ctx.putImageData(chunkImgData, 0, i * FULL_CHUNK_HEIGHT);\n }\n}\n\nfunction copyCtxState(sourceCtx, destCtx) {\n const properties = [\n \"strokeStyle\",\n \"fillStyle\",\n \"fillRule\",\n \"globalAlpha\",\n \"lineWidth\",\n \"lineCap\",\n \"lineJoin\",\n \"miterLimit\",\n \"globalCompositeOperation\",\n \"font\",\n \"filter\",\n ];\n for (const property of properties) {\n if (sourceCtx[property] !== undefined) {\n destCtx[property] = sourceCtx[property];\n }\n }\n if (sourceCtx.setLineDash !== undefined) {\n destCtx.setLineDash(sourceCtx.getLineDash());\n destCtx.lineDashOffset = sourceCtx.lineDashOffset;\n }\n}\n\nfunction resetCtxToDefault(ctx) {\n ctx.strokeStyle = ctx.fillStyle = \"#000000\";\n ctx.fillRule = \"nonzero\";\n ctx.globalAlpha = 1;\n ctx.lineWidth = 1;\n ctx.lineCap = \"butt\";\n ctx.lineJoin = \"miter\";\n ctx.miterLimit = 10;\n ctx.globalCompositeOperation = \"source-over\";\n ctx.font = \"10px sans-serif\";\n if (ctx.setLineDash !== undefined) {\n ctx.setLineDash([]);\n ctx.lineDashOffset = 0;\n }\n const { filter } = ctx;\n if (filter !== \"none\" && filter !== \"\") {\n ctx.filter = \"none\";\n }\n}\n\n/**\n * Applies transfer maps when canvas filters are unavailable.\n * The SVG filters aren't available in all environments (especially in workers\n * with OffscreenCanvas), so this class provides a fallback mechanism for\n * applying transfer maps directly to canvas image data.\n */\nclass TransferMapsFallback {\n #maps;\n\n constructor(maps) {\n // One map applies to R, G, and B; `null` maps are identities.\n const [mapR, mapG = mapR, mapB = mapR] = maps;\n const { identityMap } = TransferMapsFallback;\n this.#maps = [\n mapR || identityMap,\n mapG || identityMap,\n mapB || identityMap,\n ];\n }\n\n static get identityMap() {\n return shadow(\n this,\n \"identityMap\",\n Uint8Array.from({ length: 256 }, (_, i) => i)\n );\n }\n\n /**\n * @param {string} color\n * @returns {string}\n */\n applyToColor(color) {\n if (typeof color !== \"string\" || !color.startsWith(\"#\")) {\n return color; // E.g. \"transparent\".\n }\n const [r, g, b] = getRGBA(color);\n const [mapR, mapG, mapB] = this.#maps;\n return Util.makeHexColor(mapR[r], mapG[g], mapB[b]);\n }\n\n applyToImageData({ data }) {\n const [mapR, mapG, mapB] = this.#maps;\n for (let i = 0, ii = data.length; i < ii; i += 4) {\n data[i] = mapR[data[i]];\n data[i + 1] = mapG[data[i + 1]];\n data[i + 2] = mapB[data[i + 2]];\n }\n }\n\n applyToCanvas(ctx) {\n const { width, height } = ctx.canvas;\n const imgData = ctx.getImageData(0, 0, width, height);\n this.applyToImageData(imgData);\n ctx.putImageData(imgData, 0, 0);\n }\n}\n\nfunction getImageSmoothingEnabled(transform, interpolate) {\n // In section 8.9.5.3 of the PDF spec, it's mentioned that the interpolate\n // flag should be used when the image is upscaled.\n // In Firefox, smoothing is always used when downscaling images (bug 1360415).\n\n if (interpolate) {\n return true;\n }\n\n Util.singularValueDecompose2dScale(transform, XY);\n // Round to a 32bit float so that `<=` check below will pass for numbers that\n // are very close, but not exactly the same 64bit floats.\n const actualScale = Math.fround(\n OutputScale.pixelRatio * PixelsPerInch.PDF_TO_CSS_UNITS\n );\n // `XY` is a Float32Array.\n return XY[0] <= actualScale && XY[1] <= actualScale;\n}\n\nconst LINE_CAP_STYLES = [\"butt\", \"round\", \"square\"];\nconst LINE_JOIN_STYLES = [\"miter\", \"round\", \"bevel\"];\nconst NORMAL_CLIP = {};\nconst EO_CLIP = {};\n\nclass CanvasGraphics {\n // Only used in rescaleAndStroke. The goal is to avoid\n // creating a new DOMMatrix object each time we need it.\n static #SCALE_MATRIX = null;\n\n // Knockout group support fields.\n #knockoutGroupLevel = 0;\n\n #knockoutElementDepth = 0;\n\n #knockoutTempCanvasEntry = null;\n\n #knockoutSavedCtx = null;\n\n #knockoutSavedSMaskCtx = null;\n\n // Parent ctx globalCompositeOperation (GCO) at element start. Restored on\n // tempCtx before the post-element copyCtxState so the saved ctx keeps its\n // blend mode.\n #knockoutSavedGCO = null;\n\n #knockoutElementAlpha = 1;\n\n /**\n * Lazy alpha-scaling filter cache, populated on the first translucent\n * knockout element. One of:\n * - `Map` - when `ctx.filter` is supported; one SVG filter\n * per quantised alpha_s value (cache bounded by 8-bit alpha precision).\n * - `\"none\"` - no DOM available; the JS pixel-loop fallback handles\n * scaling instead.\n * Stays `undefined` until the first translucent element forces a resolve.\n * @type {Map | \"none\" | undefined}\n */\n #knockoutFilterCache;\n\n // Snapshot of #groupStackMeta.at(-1) at element-begin so the right backdrop\n // is used even if nested groups push/pop during the element's lifetime.\n #knockoutElementGroupMeta = null;\n\n // Per-group metadata, aligned with `groupStack`. `null` for the no-canvas\n // fast path. Otherwise: `backdropCtx` (parent ctx for non-isolated KO,\n // read directly since it's frozen), `hasInnerBackdrop` (non-isolated\n // non-KO subgroup inside a KO parent), `savedKnockoutLevel` (level to\n // restore on exit), pixel offsets, and pooled scratch entries.\n #groupStackMeta = [];\n\n constructor(\n canvasCtx,\n commonObjs,\n objs,\n canvasFactory,\n filterFactory,\n { optionalContentConfig, markedContentStack = null },\n annotationCanvasMap,\n pageColors,\n dependencyTracker,\n imagesTracker\n ) {\n this.ctx = canvasCtx;\n this.current = new CanvasExtraState(\n this.ctx.canvas.width,\n this.ctx.canvas.height\n );\n this.stateStack = [];\n this.pendingClip = null;\n this.pendingEOFill = false;\n this.commonObjs = commonObjs;\n this.objs = objs;\n this.canvasFactory = canvasFactory;\n this.filterFactory = filterFactory;\n this.groupStack = [];\n // Patterns are painted relative to the initial page/form transform, see\n // PDF spec 8.7.2 NOTE 1.\n this.baseTransform = null;\n this.baseTransformStack = [];\n this.groupLevel = 0;\n this.smaskStack = [];\n this.tempSMask = null;\n this.smaskGroupCanvases = [];\n this.smaskPreparedEntry = null;\n this.smaskPreparedFor = null;\n this.smaskPreparedOffsetX = 0;\n this.smaskPreparedOffsetY = 0;\n // For mask-size prebakes with non-zero OOB alpha, the constant\n // alpha applied to OOB pixels (dirty box outside the mask canvas)\n // at compose time. Null when no compose-time OOB work is needed:\n // - layer-size prebake bakes OOB inline; or\n // - OOB alpha is 0 and destination-in's transparent source\n // samples clear OOB layer pixels for free.\n // Compose-time behavior splits on this:\n // null -> clip = full dirty box; OOB cleared or baked.\n // 255 -> clip excludes OOB; OOB survives unchanged.\n // intermediate -> clip excludes OOB, then a fade pass applies\n // this constant alpha.\n this.smaskPreparedOOBAlpha = null;\n this.suspendedCtx = null;\n this.contentVisible = true;\n this.markedContentStack = markedContentStack || [];\n this.optionalContentConfig = optionalContentConfig;\n this.cachedPatterns = new Map();\n this.annotationCanvasMap = annotationCanvasMap;\n this.viewportScale = 1;\n this.outputScaleX = 1;\n this.outputScaleY = 1;\n this.pageColors = pageColors;\n\n this._cachedScaleForStroking = [-1, 0];\n this._cachedBitmapsMap = new Map();\n\n this.dependencyTracker = dependencyTracker ?? null;\n this.imagesTracker = imagesTracker ?? null;\n }\n\n getObject(opIdx, data, fallback = null) {\n if (typeof data === \"string\") {\n this.dependencyTracker?.recordNamedDependency(opIdx, data);\n return data.startsWith(\"g_\")\n ? this.commonObjs.get(data)\n : this.objs.get(data);\n }\n return fallback;\n }\n\n beginDrawing({\n transform,\n viewport,\n transparency = false,\n background = null,\n }) {\n // For pdfs that use blend modes we have to clear the canvas else certain\n // blend modes can look wrong since we'd be blending with a white\n // backdrop. The problem with a transparent backdrop though is we then\n // don't get sub pixel anti aliasing on text, creating temporary\n // transparent canvas when we have blend modes.\n const width = this.ctx.canvas.width;\n const height = this.ctx.canvas.height;\n\n const savedFillStyle = this.ctx.fillStyle;\n this.ctx.fillStyle = background || \"#ffffff\";\n this.ctx.fillRect(0, 0, width, height);\n this.ctx.fillStyle = savedFillStyle;\n\n if (transparency) {\n const transparentCanvas = (this.transparentCanvasEntry =\n this.canvasFactory.create(width, height));\n this.compositeCtx = this.ctx;\n ({ canvas: this.transparentCanvas, context: this.ctx } =\n transparentCanvas);\n this.ctx.save();\n // The transform can be applied before rendering, transferring it to\n // the new canvas.\n this.ctx.transform(...getCurrentTransform(this.compositeCtx));\n }\n\n this.ctx.save();\n resetCtxToDefault(this.ctx);\n if (transform) {\n this.ctx.transform(...transform);\n this.outputScaleX = transform[0];\n this.outputScaleY = transform[3];\n }\n this.ctx.transform(...viewport.transform);\n this.viewportScale = viewport.scale;\n\n this.baseTransform = getCurrentTransform(this.ctx);\n }\n\n executeOperatorList(\n operatorList,\n executionStartIdx,\n continueCallback,\n stepper,\n operationsFilter\n ) {\n const argsArray = operatorList.argsArray;\n const fnArray = operatorList.fnArray;\n let i = executionStartIdx || 0;\n const argsArrayLen = argsArray.length;\n\n // Sometimes the OperatorList to execute is empty.\n if (argsArrayLen === i) {\n return i;\n }\n\n const chunkOperations =\n argsArrayLen - i > EXECUTION_STEPS &&\n typeof continueCallback === \"function\";\n const endTime = chunkOperations ? Date.now() + EXECUTION_TIME : 0;\n let steps = 0;\n\n const commonObjs = this.commonObjs;\n const objs = this.objs;\n let fnId, fnArgs;\n\n while (true) {\n if (stepper !== undefined) {\n if (i === stepper.nextBreakPoint) {\n stepper.breakIt(i, continueCallback);\n return i;\n }\n if (stepper.shouldSkip(i)) {\n if (++i === argsArrayLen) {\n return i;\n }\n continue;\n }\n }\n\n if (!operationsFilter || operationsFilter(i, operatorList)) {\n fnId = fnArray[i];\n // TODO: There is a `undefined` coming from somewhere.\n fnArgs = argsArray[i] ?? null;\n\n if (fnId !== OPS.dependency) {\n if (fnArgs === null) {\n this[fnId](i);\n } else {\n this[fnId](i, ...fnArgs);\n }\n } else {\n for (const depObjId of fnArgs) {\n this.dependencyTracker?.recordNamedData(depObjId, i);\n const objsPool = depObjId.startsWith(\"g_\") ? commonObjs : objs;\n\n // If the promise isn't resolved yet, add the continueCallback\n // to the promise and bail out.\n if (!objsPool.has(depObjId)) {\n objsPool.get(depObjId, continueCallback);\n return i;\n }\n }\n }\n }\n\n i++;\n\n // If the entire operatorList was executed, stop as were done.\n if (i === argsArrayLen) {\n return i;\n }\n\n // If the execution took longer then a certain amount of time and\n // `continueCallback` is specified, interrupt the execution.\n if (chunkOperations && ++steps > EXECUTION_STEPS) {\n if (Date.now() > endTime) {\n continueCallback();\n return i;\n }\n steps = 0;\n }\n\n // If the operatorList isn't executed completely yet OR the execution\n // time was short enough, do another execution round.\n }\n }\n\n #restoreInitialState() {\n // Finishing all opened operations such as SMask group painting.\n while (this.stateStack.length || this.inSMaskMode) {\n this.restore();\n }\n\n this.current.activeSMask = null;\n this.ctx.restore();\n\n if (this.transparentCanvas) {\n this.ctx = this.compositeCtx;\n this.ctx.save();\n this.ctx.setTransform(1, 0, 0, 1, 0, 0); // Avoid apply transform twice\n this.ctx.drawImage(this.transparentCanvas, 0, 0);\n this.ctx.restore();\n this.canvasFactory.destroy(this.transparentCanvasEntry);\n this.transparentCanvas = null;\n this.transparentCanvasEntry = null;\n }\n }\n\n endDrawing() {\n this.#restoreInitialState();\n\n // Destroy all smask group canvases now that rendering is complete.\n // These cannot be destroyed eagerly because activeSMask is part of\n // CanvasExtraState and is shared (via Object.create prototype chain) across\n // save/restore state copies.\n for (const canvas of this.smaskGroupCanvases) {\n this.canvasFactory.destroy(canvas);\n }\n this.smaskGroupCanvases.length = 0;\n this._clearPreparedSMask();\n this.tempSMask = null;\n this.smaskStack.length = 0;\n\n // Drop knockout state in case rendering was cancelled mid-group. Pooled\n // temp/backdrop entries are owned by the meta and freed there; the\n // active-element fields just alias into the meta, so only clear them.\n for (const meta of this.#groupStackMeta) {\n this.#destroyKnockoutPools(meta);\n }\n this.#groupStackMeta.length = 0;\n this.#knockoutTempCanvasEntry = null;\n this.#knockoutSavedCtx = null;\n this.#knockoutSavedSMaskCtx = null;\n this.#knockoutSavedGCO = null;\n this.#knockoutElementAlpha = 1;\n this.#knockoutElementGroupMeta = null;\n this.#knockoutElementDepth = 0;\n this.#knockoutGroupLevel = 0;\n\n this.cachedPatterns.clear();\n\n for (const cache of this._cachedBitmapsMap.values()) {\n for (const canvas of cache.values()) {\n if (\n typeof HTMLCanvasElement !== \"undefined\" &&\n canvas instanceof HTMLCanvasElement\n ) {\n canvas.width = canvas.height = 0;\n }\n }\n cache.clear();\n }\n this._cachedBitmapsMap.clear();\n this.#drawFilter();\n }\n\n #drawFilter() {\n if (this.pageColors) {\n const hcmFilterId = this.filterFactory.addHCMFilter(\n this.pageColors.foreground,\n this.pageColors.background\n );\n if (hcmFilterId !== \"none\") {\n const savedFilter = this.ctx.filter;\n this.ctx.filter = hcmFilterId;\n this.ctx.drawImage(this.ctx.canvas, 0, 0);\n this.ctx.filter = savedFilter;\n }\n }\n }\n\n _scaleImage(img, inverseTransform) {\n // Vertical or horizontal scaling shall not be more than 2 to not lose the\n // pixels during drawImage operation, painting on the temporary canvas(es)\n // that are twice smaller in size.\n\n // displayWidth and displayHeight are used for VideoFrame.\n const width = img.width ?? img.displayWidth;\n const height = img.height ?? img.displayHeight;\n const widthScale = Math.max(\n Math.hypot(inverseTransform[0], inverseTransform[1]),\n 1\n );\n const heightScale = Math.max(\n Math.hypot(inverseTransform[2], inverseTransform[3]),\n 1\n );\n\n // Pre-compute each step's output dimensions.\n const scaleSteps = [];\n let ws = widthScale,\n hs = heightScale,\n pw = width,\n ph = height;\n while ((ws > 2 && pw > 1) || (hs > 2 && ph > 1)) {\n let nw = pw,\n nh = ph;\n if (ws > 2 && pw > 1) {\n nw = Math.ceil(pw / 2);\n ws /= pw / nw;\n }\n if (hs > 2 && ph > 1) {\n nh = Math.ceil(ph / 2);\n hs /= ph / nh;\n }\n scaleSteps.push({ newWidth: nw, newHeight: nh });\n pw = nw;\n ph = nh;\n }\n\n if (scaleSteps.length === 0) {\n return { img, paintWidth: width, paintHeight: height, tmpCanvas: null };\n }\n\n if (scaleSteps.length === 1) {\n const { newWidth, newHeight } = scaleSteps[0];\n const tmpCanvas = this.canvasFactory.create(newWidth, newHeight);\n tmpCanvas.context.drawImage(\n img,\n 0,\n 0,\n width,\n height,\n 0,\n 0,\n newWidth,\n newHeight\n );\n return {\n img: tmpCanvas.canvas,\n paintWidth: newWidth,\n paintHeight: newHeight,\n tmpCanvas,\n };\n }\n\n // More than 2 steps: ping-pong between two reused canvas entries.\n // canvasFactory.reset() resizes (and implicitly clears) a canvas without\n // creating a new JS object or calling getContext() again.\n let readEntry = this.canvasFactory.create(1, 1);\n let writeEntry = this.canvasFactory.create(1, 1);\n let paintWidth = width,\n paintHeight = height;\n let source = img;\n\n for (const { newWidth, newHeight } of scaleSteps) {\n this.canvasFactory.reset(writeEntry, newWidth, newHeight);\n writeEntry.context.drawImage(\n source,\n 0,\n 0,\n paintWidth,\n paintHeight,\n 0,\n 0,\n newWidth,\n newHeight\n );\n [readEntry, writeEntry] = [writeEntry, readEntry];\n source = readEntry.canvas;\n paintWidth = newWidth;\n paintHeight = newHeight;\n }\n\n // writeEntry is now the stale buffer; destroy it.\n this.canvasFactory.destroy(writeEntry);\n return {\n img: readEntry.canvas,\n paintWidth,\n paintHeight,\n tmpCanvas: readEntry,\n };\n }\n\n _createMaskCanvas(opIdx, img) {\n const ctx = this.ctx;\n const { width, height } = img;\n const isPatternFill = this.current.patternFill;\n // Solid-color styles contain the transferred fallback value.\n const fillColor = isPatternFill ? this.current.fillColor : ctx.fillStyle;\n const currentTransform = getCurrentTransform(ctx);\n\n let cache, cacheKey, scaled, maskCanvas;\n if ((img.bitmap || img.data) && img.count > 1) {\n const mainKey = img.bitmap || img.data.buffer;\n // We're reusing the same image several times, so we can cache it.\n // In case we've a pattern fill we just keep the scaled version of\n // the image.\n // Only the scaling part matters, the translation part is just used\n // to compute offsets (but not when filling patterns see #15573).\n // TODO: handle the case of a pattern fill if it's possible.\n cacheKey = JSON.stringify(\n isPatternFill\n ? currentTransform\n : [currentTransform.slice(0, 4), fillColor]\n );\n\n cache = this._cachedBitmapsMap.getOrInsertComputed(mainKey, makeMap);\n const cachedImage = cache.get(cacheKey);\n if (cachedImage && !isPatternFill) {\n const offsetX = Math.round(\n Math.min(currentTransform[0], currentTransform[2]) +\n currentTransform[4]\n );\n const offsetY = Math.round(\n Math.min(currentTransform[1], currentTransform[3]) +\n currentTransform[5]\n );\n\n this.dependencyTracker?.recordDependencies(\n opIdx,\n Dependencies.transformAndFill\n );\n return {\n canvas: cachedImage,\n offsetX,\n offsetY,\n };\n }\n scaled = cachedImage;\n }\n\n if (!scaled) {\n maskCanvas = this.canvasFactory.create(width, height);\n putBinaryImageMask(maskCanvas.context, img);\n }\n\n // Create the mask canvas at the size it will be drawn at and also set\n // its transform to match the current transform so if there are any\n // patterns applied they will be applied relative to the correct\n // transform.\n\n let maskToCanvas = Util.transform(currentTransform, [\n 1 / width,\n 0,\n 0,\n -1 / height,\n 0,\n 0,\n ]);\n maskToCanvas = Util.transform(maskToCanvas, [1, 0, 0, 1, 0, -height]);\n const minMax = F32_BBOX_INIT.slice();\n Util.axialAlignedBoundingBox([0, 0, width, height], maskToCanvas, minMax);\n const [minX, minY, maxX, maxY] = minMax;\n const drawnWidth = Math.round(maxX - minX) || 1;\n const drawnHeight = Math.round(maxY - minY) || 1;\n const fillCanvas = this.canvasFactory.create(drawnWidth, drawnHeight);\n const fillCtx = fillCanvas.context;\n\n // The offset will be the top-left coordinate mask.\n // If objToCanvas is [a,b,c,d,e,f] then:\n // - offsetX = min(a, c) + e\n // - offsetY = min(b, d) + f\n const offsetX = minX;\n const offsetY = minY;\n fillCtx.translate(-offsetX, -offsetY);\n fillCtx.transform(...maskToCanvas);\n\n let scaledEntry = null;\n if (!scaled) {\n // Pre-scale if needed to improve image smoothing.\n const scaleResult = this._scaleImage(\n maskCanvas.canvas,\n getCurrentTransformInverse(fillCtx)\n );\n scaled = scaleResult.img;\n scaledEntry = scaleResult.tmpCanvas;\n if (scaled !== maskCanvas.canvas) {\n // _scaleImage created a new canvas; maskCanvas is no longer needed.\n this.canvasFactory.destroy(maskCanvas);\n maskCanvas = null;\n }\n if (cache && isPatternFill) {\n cache.set(cacheKey, scaled);\n scaledEntry = null; // bitmap cache owns the canvas now\n maskCanvas = null; // bitmap cache may own maskCanvas.canvas (= scaled)\n }\n }\n\n fillCtx.imageSmoothingEnabled = getImageSmoothingEnabled(\n getCurrentTransform(fillCtx),\n img.interpolate\n );\n\n drawImageAtIntegerCoords(\n fillCtx,\n scaled,\n 0,\n 0,\n scaled.width,\n scaled.height,\n 0,\n 0,\n width,\n height\n );\n if (scaledEntry) {\n this.canvasFactory.destroy(scaledEntry);\n }\n if (maskCanvas) {\n // scaled === maskCanvas.canvas and not owned by the bitmap cache.\n this.canvasFactory.destroy(maskCanvas);\n }\n fillCtx.globalCompositeOperation = \"source-in\";\n\n const inverse = Util.transform(getCurrentTransformInverse(fillCtx), [\n 1,\n 0,\n 0,\n 1,\n -offsetX,\n -offsetY,\n ]);\n fillCtx.fillStyle = isPatternFill\n ? fillColor.getPattern(ctx, this, inverse, PathType.FILL, opIdx)\n : fillColor;\n\n fillCtx.fillRect(0, 0, width, height);\n\n if (cache && !isPatternFill) {\n // The fill canvas is put in the cache associated to the mask image\n // so it mustn't be used again.\n cache.set(cacheKey, fillCanvas.canvas);\n }\n\n this.dependencyTracker?.recordDependencies(\n opIdx,\n Dependencies.transformAndFill\n );\n\n // Round the offsets to avoid drawing fractional pixels.\n return {\n canvas: fillCanvas.canvas,\n // canvasEntry is null when the bitmap cache owns the canvas.\n canvasEntry: cache && !isPatternFill ? null : fillCanvas,\n offsetX: Math.round(offsetX),\n offsetY: Math.round(offsetY),\n };\n }\n\n // Graphics state\n setLineWidth(opIdx, width) {\n this.dependencyTracker?.recordSimpleData(\"lineWidth\", opIdx);\n if (width !== this.current.lineWidth) {\n this._cachedScaleForStroking[0] = -1;\n }\n this.current.lineWidth = width;\n this.ctx.lineWidth = width;\n }\n\n setLineCap(opIdx, style) {\n this.dependencyTracker?.recordSimpleData(\"lineCap\", opIdx);\n this.ctx.lineCap = LINE_CAP_STYLES[style];\n }\n\n setLineJoin(opIdx, style) {\n this.dependencyTracker?.recordSimpleData(\"lineJoin\", opIdx);\n this.ctx.lineJoin = LINE_JOIN_STYLES[style];\n }\n\n setMiterLimit(opIdx, limit) {\n this.dependencyTracker?.recordSimpleData(\"miterLimit\", opIdx);\n this.ctx.miterLimit = limit;\n }\n\n setDash(opIdx, dashArray, dashPhase) {\n this.dependencyTracker?.recordSimpleData(\"dash\", opIdx);\n const ctx = this.ctx;\n if (ctx.setLineDash !== undefined) {\n ctx.setLineDash(dashArray);\n ctx.lineDashOffset = dashPhase;\n }\n }\n\n setRenderingIntent(opIdx, intent) {\n // This operation is ignored since we haven't found a use case for it yet.\n }\n\n setFlatness(opIdx, flatness) {\n // This operation is ignored since we haven't found a use case for it yet.\n }\n\n setGState(opIdx, states) {\n for (const [key, value] of states) {\n switch (key) {\n case \"LW\":\n this.setLineWidth(opIdx, value);\n break;\n case \"LC\":\n this.setLineCap(opIdx, value);\n break;\n case \"LJ\":\n this.setLineJoin(opIdx, value);\n break;\n case \"ML\":\n this.setMiterLimit(opIdx, value);\n break;\n case \"D\":\n this.setDash(opIdx, value[0], value[1]);\n break;\n case \"RI\":\n this.setRenderingIntent(opIdx, value);\n break;\n case \"FL\":\n this.setFlatness(opIdx, value);\n break;\n case \"Font\":\n this.setFont(opIdx, value[0], value[1]);\n break;\n case \"CA\":\n this.dependencyTracker?.recordSimpleData(\"strokeAlpha\", opIdx);\n this.current.strokeAlpha = value;\n break;\n case \"ca\":\n this.dependencyTracker?.recordSimpleData(\"fillAlpha\", opIdx);\n this.ctx.globalAlpha = this.current.fillAlpha = value;\n break;\n case \"BM\":\n this.dependencyTracker?.recordSimpleData(\n \"globalCompositeOperation\",\n opIdx\n );\n this.ctx.globalCompositeOperation = value;\n break;\n case \"SMask\":\n this.dependencyTracker?.recordSimpleData(\"SMask\", opIdx);\n this.current.activeSMask = value ? this.tempSMask : null;\n if (this.current.activeSMask) {\n // Save the current blend mode so that it can be applied when\n // compositing the SMask result back to the main canvas.\n this.current.activeSMask.blendMode =\n this.ctx.globalCompositeOperation;\n }\n this.tempSMask = null;\n this.checkSMaskState(opIdx);\n break;\n case \"TR\": {\n this.dependencyTracker?.recordSimpleData(\"filter\", opIdx);\n let filter = this.filterFactory.addFilter(value);\n this.ctx.filter = filter;\n let fallback = null;\n if (\n value &&\n // Fall back if no SVG filter was created or canvas filters are\n // unavailable or rejected.\n (filter === \"none\" ||\n !FeatureTest.isCanvasFilterSupported ||\n this.ctx.filter === \"none\" ||\n this.ctx.filter === \"\")\n ) {\n this.ctx.filter = filter = \"none\";\n fallback = new TransferMapsFallback(value);\n }\n this.current.transferMaps = filter;\n if (fallback || this.current.transferMapsFallback) {\n this.current.transferMapsFallback = fallback;\n // Reapply the maps to the current solid colors.\n if (!this.current.patternFill) {\n this.ctx.fillStyle = this.#transferColor(this.current.fillColor);\n }\n if (!this.current.patternStroke) {\n this.ctx.strokeStyle = this.#transferColor(\n this.current.strokeColor\n );\n }\n }\n break;\n }\n }\n }\n }\n\n get inSMaskMode() {\n return !!this.suspendedCtx;\n }\n\n _clearPreparedSMask() {\n if (this.smaskPreparedEntry) {\n this.canvasFactory.destroy(this.smaskPreparedEntry);\n this.smaskPreparedEntry = null;\n }\n this.smaskPreparedFor = null;\n this.smaskPreparedOffsetX = 0;\n this.smaskPreparedOffsetY = 0;\n this.smaskPreparedOOBAlpha = null;\n }\n\n _ensurePreparedSMask(smask) {\n if (smask === this.smaskPreparedFor) {\n return;\n }\n this._clearPreparedSMask();\n this._prepareSMaskCanvas(smask);\n }\n\n checkSMaskState(opIdx) {\n const inSMaskMode = this.inSMaskMode;\n if (this.current.activeSMask && !inSMaskMode) {\n this.beginSMaskMode(opIdx);\n } else if (!this.current.activeSMask && inSMaskMode) {\n this.endSMaskMode();\n } else if (this.current.activeSMask && inSMaskMode) {\n // The active SMask may have changed while SMask mode stayed active\n // (e.g. a direct SMask A->B replacement, or a restore() that surfaces\n // a different saved mask). _ensurePreparedSMask is a no-op when the\n // same mask object is re-encountered.\n this._ensurePreparedSMask(this.current.activeSMask);\n }\n }\n\n _prepareSMaskCanvas(smask) {\n const { canvas: maskCanvas, subtype, backdrop, transferMap } = smask;\n const hasFilter =\n subtype === \"Luminosity\" || (subtype === \"Alpha\" && transferMap);\n\n // Nothing to amortize unless we have a filter or a Luminosity\n // backdrop -- Alpha SMasks ignore /BC for the alpha output, and\n // unknown subtypes have no defined backdrop semantics. Record the\n // mask so checkSMaskState's identity check skips the rebuild path\n // on subsequent restore()/setGState() calls.\n if (!hasFilter && !(subtype === \"Luminosity\" && backdrop)) {\n this.smaskPreparedFor = smask;\n return;\n }\n\n // Constant alpha OOB pixels receive after the spec backdrop+filter\n // chain (see smaskPreparedOOBAlpha field doc for the compose-time\n // table). /BC only feeds the alpha output for Luminosity (its\n // color enters the luminance computation). Alpha SMasks treat /BC\n // as a pure color-space backdrop and must not bake it into the\n // alpha output.\n let filteredOOBAlpha;\n if (subtype === \"Luminosity\" && backdrop) {\n // backdrop is \"#RRGGBB\" (see Evaluator#handleSMask).\n const [r, g, b] = getRGBA(backdrop);\n const inputAlpha = Math.round(0.3 * r + 0.59 * g + 0.11 * b);\n filteredOOBAlpha = transferMap?.[inputAlpha] ?? inputAlpha;\n } else {\n // Alpha, or Luminosity with no backdrop: OOB input is transparent,\n // and both filters map alpha=0 to alpha=0; only transferMap[0] can\n // produce a non-zero result.\n filteredOOBAlpha = transferMap?.[0] ?? 0;\n }\n\n // Use a layer-size prebake when the layer is at most this many\n // times bigger than the mask: layer-size avoids compose-time OOB\n // work and hits the same-size drawImage GPU fast path, but the\n // alloc cost grows with the layer. The crossover is empirical;\n // tuned against the bug-2033095 corpus.\n const SMASK_LAYER_TO_MASK_AREA_RATIO = 4;\n const { width: layerW, height: layerH } = this.ctx.canvas;\n const maskArea = maskCanvas.width * maskCanvas.height;\n const useLayerSize =\n layerW * layerH < SMASK_LAYER_TO_MASK_AREA_RATIO * maskArea;\n\n // Bundle the filter URL with the spec needed for the pixel-buffer\n // fallback (see _bakeSMaskCanvas). subtype + transferMap let the\n // fallback reproduce the SVG filter without an extra round-trip\n // through the filter factory.\n const filterSpec = hasFilter\n ? {\n url:\n subtype === \"Alpha\"\n ? this.filterFactory.addAlphaFilter(transferMap)\n : this.filterFactory.addLuminosityFilter(transferMap),\n subtype,\n transferMap,\n }\n : null;\n\n // Alpha SMasks must not bake /BC into the prepared canvas (see\n // filteredOOBAlpha comment above).\n const bakedBackdrop = subtype === \"Luminosity\" ? backdrop : null;\n\n let preparedEntry, offsetX, offsetY;\n if (useLayerSize) {\n preparedEntry = this._bakeSMaskCanvas(\n maskCanvas,\n smask.offsetX,\n smask.offsetY,\n layerW,\n layerH,\n bakedBackdrop,\n filterSpec\n );\n offsetX = 0;\n offsetY = 0;\n } else {\n preparedEntry = this._bakeSMaskCanvas(\n maskCanvas,\n 0,\n 0,\n maskCanvas.width,\n maskCanvas.height,\n bakedBackdrop,\n filterSpec\n );\n offsetX = smask.offsetX;\n offsetY = smask.offsetY;\n }\n\n this.smaskPreparedEntry = preparedEntry;\n this.smaskPreparedFor = smask;\n this.smaskPreparedOffsetX = offsetX;\n this.smaskPreparedOffsetY = offsetY;\n // Only mask-size prebakes with non-zero OOB alpha need compose-time\n // OOB work (see field doc).\n this.smaskPreparedOOBAlpha =\n !useLayerSize && filteredOOBAlpha !== 0 ? filteredOOBAlpha : null;\n }\n\n /**\n * Bake the mask plus optional backdrop into a (w x h) canvas with the\n * mask drawn at (drawX, drawY), then optionally pipe through the SVG\n * filter described by `filterSpec`. Returns the prepared canvas-\n * factory entry.\n *\n * The backdrop fill uses destination-atop so transparent / partial-\n * alpha pixels inside the mask see the backdrop *before* filtering\n * (per PDF spec). Filtering the raw mask would yield filter(0)\n * instead of filter(backdrop) -- wrong for \"keep\" Luminosity and for\n * Alpha masks whose transferMap[255] differs from transferMap[0].\n *\n * In the no-backdrop layer-size case the OOB region of srcEntry\n * stays transparent and the filter outputs filter(transparent) =\n * transferMap[0], matching the spec's transparent extension of the\n * mask group. No-backdrop mask-size prebakes have no OOB region;\n * destination-in handles OOB at compose time.\n *\n * Some browsers (e.g. older Safari) silently ignore SVG `url(#id)`\n * filters on a 2D canvas: the assignment is accepted but\n * `ctx.filter` reads back as \"none\" and `drawImage` produces an\n * unfiltered copy. We detect that and fall back to a pixel-buffer\n * loop that reproduces the SVG filter exactly (matrix luminance and\n * `feFuncA` transferMap, both with sRGB color-interpolation, i.e.\n * straight on gamma-encoded byte values).\n */\n _bakeSMaskCanvas(maskCanvas, drawX, drawY, w, h, backdrop, filterSpec) {\n if (!backdrop && !filterSpec) {\n // Caller (_prepareSMaskCanvas) gates on this; without either,\n // the prebake would just be a wasted copy of the mask.\n unreachable(\"_bakeSMaskCanvas with neither backdrop nor filter\");\n }\n const srcEntry = this.canvasFactory.create(w, h);\n const sCtx = srcEntry.context;\n sCtx.drawImage(maskCanvas, drawX, drawY);\n if (backdrop) {\n sCtx.globalCompositeOperation = \"destination-atop\";\n sCtx.fillStyle = backdrop;\n sCtx.fillRect(0, 0, w, h);\n }\n if (!filterSpec) {\n return srcEntry;\n }\n const preparedEntry = this.canvasFactory.create(w, h);\n const pCtx = preparedEntry.context;\n // Post-assign \"none\"/\"\" means the URL was rejected (Firefox\n // normalizes accepted url(#id) to an absolute URL).\n pCtx.filter = filterSpec.url;\n const filterApplied =\n FeatureTest.isCanvasFilterSupported &&\n pCtx.filter !== \"none\" &&\n pCtx.filter !== \"\";\n pCtx.drawImage(srcEntry.canvas, 0, 0);\n if (FeatureTest.isCanvasFilterSupported) {\n pCtx.filter = \"none\";\n }\n if (!filterApplied) {\n const img = pCtx.getImageData(0, 0, w, h);\n const { data } = img;\n const { transferMap } = filterSpec;\n if (filterSpec.subtype === \"Luminosity\") {\n for (let i = 0, ii = data.length; i < ii; i += 4) {\n // Match #addLuminosityConversion: a' = 0.3*R + 0.59*G + 0.11*B,\n // RGB -> 0; then optional transferMap on alpha.\n const a =\n (0.3 * data[i] + 0.59 * data[i + 1] + 0.11 * data[i + 2] + 0.5) | 0;\n data[i] = data[i + 1] = data[i + 2] = 0;\n data[i + 3] = transferMap?.[a] ?? a;\n }\n } else {\n // Alpha: transferMap is guaranteed by _prepareSMaskCanvas's\n // hasFilter gate.\n for (let i = 3, ii = data.length; i < ii; i += 4) {\n data[i] = transferMap[data[i]];\n }\n }\n pCtx.putImageData(img, 0, 0);\n }\n this.canvasFactory.destroy(srcEntry);\n return preparedEntry;\n }\n\n /**\n * Replaces the current drawing canvas with a temporary scratch canvas and\n * suspends the main context. Drawing operations on the scratch canvas are\n * composited back via `compose()`. The scratch canvas mirrors many operations\n * onto the suspended canvas to keep their graphics-state stacks in sync, so\n * that clipping paths and transformations remain correct when soft mask mode\n * ends.\n */\n beginSMaskMode(opIdx) {\n if (this.inSMaskMode) {\n throw new Error(\"beginSMaskMode called while already in smask mode\");\n }\n const { width: drawnWidth, height: drawnHeight } = this.ctx.canvas;\n const scratchCanvas = this.canvasFactory.create(drawnWidth, drawnHeight);\n this.smaskScratchCanvas = scratchCanvas;\n this.suspendedCtx = this.ctx;\n const ctx = (this.ctx = scratchCanvas.context);\n ctx.setTransform(this.suspendedCtx.getTransform());\n copyCtxState(this.suspendedCtx, ctx);\n mirrorContextOperations(ctx, this.suspendedCtx);\n\n this._ensurePreparedSMask(this.current.activeSMask);\n\n this.setGState(opIdx, [[\"BM\", \"source-over\"]]);\n }\n\n endSMaskMode() {\n if (!this.inSMaskMode) {\n throw new Error(\"endSMaskMode called while not in smask mode\");\n }\n // The soft mask is done, now restore the suspended canvas as the main\n // drawing canvas.\n this.ctx._removeMirroring();\n copyCtxState(this.ctx, this.suspendedCtx);\n this.ctx = this.suspendedCtx;\n\n this.suspendedCtx = null;\n this.canvasFactory.destroy(this.smaskScratchCanvas);\n this.smaskScratchCanvas = null;\n this._clearPreparedSMask();\n }\n\n #createKnockoutMaskCanvas(sourceCanvas, reuseEntry = null, alpha = 1) {\n const { width, height } = sourceCanvas;\n // reuseEntry is assumed to match sourceCanvas in size (all current call\n // sites guarantee this); the mask is rebuilt in-place.\n const maskEntry = reuseEntry ?? this.canvasFactory.create(width, height);\n const maskCtx = maskEntry.context;\n // Snap alpha_s to 8-bit precision: the painted alpha we're scaling is\n // already 8-bit, so any finer-grained alpha_s is indistinguishable. Caps\n // both the local Map and the filter-factory cache at <=256 entries\n // regardless of how many distinct gstate alpha values the PDF uses.\n alpha = Math.round(alpha * 255) / 255;\n const needsAlphaScaling = alpha < 1;\n if (needsAlphaScaling && this.#knockoutFilterCache === undefined) {\n // On Safari `ctx.filter` is settable but inert: the filter URL would\n // be stored without being applied, leaving the mask unscaled.\n // Force the JS fallback there.\n this.#knockoutFilterCache = FeatureTest.isCanvasFilterSupported\n ? new Map()\n : \"none\";\n }\n let knockoutFilter = \"none\";\n if (needsAlphaScaling && this.#knockoutFilterCache instanceof Map) {\n knockoutFilter = this.#knockoutFilterCache.getOrInsertComputed(\n alpha,\n () => this.filterFactory.addKnockoutFilter(alpha)\n );\n }\n\n if (!needsAlphaScaling || knockoutFilter !== \"none\") {\n // Reused entries may carry stale pixels. Avoid the\n // globalCompositeOperation = \"copy\" + filter combo: that pair is\n // browser-divergent.\n if (reuseEntry) {\n maskCtx.save();\n maskCtx.setTransform(1, 0, 0, 1, 0, 0);\n maskCtx.clearRect(0, 0, width, height);\n maskCtx.restore();\n }\n maskCtx.filter = knockoutFilter;\n maskCtx.drawImage(sourceCanvas, 0, 0);\n maskCtx.filter = \"none\";\n return maskEntry;\n }\n\n // No-DOM fallback (Node/embedded). Scale painted alpha back to shape\n // coverage; color channels are irrelevant for destination-out/in.\n const sourceData = sourceCanvas\n .getContext(\"2d\", { willReadFrequently: true })\n .getImageData(0, 0, width, height);\n const maskData = maskCtx.createImageData(width, height);\n const sourcePixels = sourceData.data,\n maskPixels = maskData.data;\n const alphaScale = alpha > 0 ? 1 / alpha : 1e6;\n for (let i = 3, ii = sourcePixels.length; i < ii; i += 4) {\n maskPixels[i] = Math.min(Math.round(sourcePixels[i] * alphaScale), 255);\n }\n maskCtx.putImageData(maskData, 0, 0);\n return maskEntry;\n }\n\n #getOrCreatePooledEntry(meta, key, width, height) {\n let entry = meta?.[key] ?? null;\n if (\n entry &&\n (entry.canvas.width !== width || entry.canvas.height !== height)\n ) {\n this.canvasFactory.destroy(entry);\n entry = null;\n }\n if (!entry) {\n entry = this.canvasFactory.create(width, height);\n if (meta) {\n meta[key] = entry;\n }\n return entry;\n }\n // Reused entry: clear any stale pixels before the caller refills it.\n const ctx = entry.context;\n ctx.save();\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n ctx.clearRect(0, 0, width, height);\n ctx.restore();\n return entry;\n }\n\n #compositeKnockoutSurface(destCtx, surfaceCanvas, options = {}) {\n const {\n // Backdrop canvas for non-isolated groups, or null for isolated.\n // Passed directly (no copy) since the parent canvas is frozen while\n // the group renders.\n backdropCanvas = null,\n // Transform for destCtx before the final draw. Identity is correct\n // when destCtx and surfaceCanvas share pixel coords (per-element\n // path); pass currentMtx for the endGroup subgroup-into-parent path.\n destTransform = [1, 0, 0, 1, 0, 0],\n // Pixel origin within backdropCanvas of the region that maps onto\n // surfaceCanvas. [0,0] when the backdrop is already pre-cropped;\n // pass the (possibly compounded) group offsets in endGroup.\n backdropOffset = [0, 0],\n // Pool entry to refill in place for the knockout mask. Caller owns\n // its lifetime when provided.\n reuseMaskEntry = null,\n // Group meta to pool the backdrop scratch on. Without it the scratch\n // is allocated and destroyed locally.\n poolMeta = null,\n // Per-element surfaces already have alpha/filter baked in (defaults\n // 1/\"none\"). Subgroup canvases don't, so endGroup passes the parent\n // values to apply only at the final draw.\n sourceAlpha = 1,\n sourceFilter = \"none\",\n knockoutAlpha = 1,\n } = options;\n const { width, height } = surfaceCanvas;\n const knockoutMaskEntry = this.#createKnockoutMaskCanvas(\n surfaceCanvas,\n reuseMaskEntry,\n knockoutAlpha\n );\n const sourceCompositeOperation = destCtx.globalCompositeOperation;\n\n destCtx.save();\n destCtx.setTransform(...destTransform);\n destCtx.globalAlpha = 1;\n if (FeatureTest.isCanvasFilterSupported) {\n destCtx.filter = \"none\";\n }\n\n // Erase prior group content wherever the new surface has any coverage.\n destCtx.globalCompositeOperation = \"destination-out\";\n destCtx.drawImage(knockoutMaskEntry.canvas, 0, 0);\n\n if (backdropCanvas) {\n // Non-isolated: refill the just-erased footprint with the backdrop,\n // pre-clipped to the same shape mask so non-element pixels stay\n // transparent (otherwise sparse groups bleed the backdrop rect).\n const [bx, by] = backdropOffset;\n const backdropEntry = this.#getOrCreatePooledEntry(\n poolMeta,\n \"knockoutBackdropEntry\",\n width,\n height\n );\n const backdropCtx = backdropEntry.context;\n backdropCtx.drawImage(\n backdropCanvas,\n bx,\n by,\n width,\n height,\n 0,\n 0,\n width,\n height\n );\n backdropCtx.globalCompositeOperation = \"destination-in\";\n backdropCtx.drawImage(knockoutMaskEntry.canvas, 0, 0);\n // Reset the GCO so the pooled entry is in a known state for next use.\n backdropCtx.globalCompositeOperation = \"source-over\";\n\n destCtx.globalCompositeOperation = \"destination-over\";\n destCtx.drawImage(backdropEntry.canvas, 0, 0);\n if (!poolMeta) {\n this.canvasFactory.destroy(backdropEntry);\n }\n }\n destCtx.globalCompositeOperation = sourceCompositeOperation;\n destCtx.globalAlpha = sourceAlpha;\n if (FeatureTest.isCanvasFilterSupported) {\n destCtx.filter = sourceFilter ?? \"none\";\n }\n destCtx.drawImage(surfaceCanvas, 0, 0);\n\n destCtx.restore();\n if (!reuseMaskEntry) {\n this.canvasFactory.destroy(knockoutMaskEntry);\n }\n }\n\n /**\n * Begin a knockout element. In a KO group each element composites against\n * the initial group backdrop (transparent if isolated, parent canvas if\n * not) rather than against the running group result. We render onto a temp\n * canvas; path/clip/transform ops are mirrored back to the group canvas so\n * its state stays in sync for the next element.\n * @returns {boolean} true if a knockout element was started.\n */\n #beginKnockoutElement(alpha = 1) {\n if (\n this.#knockoutGroupLevel === 0 ||\n this.#knockoutElementDepth > 0 ||\n !this.contentVisible\n ) {\n return false;\n }\n this.#knockoutElementDepth++;\n this.#knockoutElementAlpha = alpha;\n const groupMeta = this.#groupStackMeta.at(-1);\n const { canvas } = this.ctx;\n const tempEntry = this.#getOrCreatePooledEntry(\n groupMeta,\n \"knockoutTempEntry\",\n canvas.width,\n canvas.height\n );\n this.#knockoutTempCanvasEntry = tempEntry;\n const tempCtx = tempEntry.context;\n // Bracket-save before installing mirroring so #endKnockoutElement can\n // restore() the pooled canvas to a clean clip+transform without\n // propagating that save through the mirror.\n tempCtx.save();\n tempCtx.setTransform(this.ctx.getTransform());\n copyCtxState(this.ctx, tempCtx);\n // Force source-over for the element raster: the parent's blend mode is\n // meant for the final composite back onto the group canvas (done by\n // #compositeKnockoutSurface), not for drawing onto a transparent temp\n // (e.g. multiply on alpha=0 zeros the element's colour). Stash the\n // parent GCO and re-apply it on tempCtx before the post-element\n // copyCtxState so the saved ctx keeps the parent blend mode.\n this.#knockoutSavedGCO = tempCtx.globalCompositeOperation;\n tempCtx.globalCompositeOperation = \"source-over\";\n mirrorContextOperations(tempCtx, this.ctx);\n this.#knockoutElementGroupMeta = groupMeta;\n this.#knockoutSavedCtx = this.ctx;\n this.#knockoutSavedSMaskCtx = this.suspendedCtx;\n this.ctx = tempCtx;\n if (this.inSMaskMode) {\n this.suspendedCtx = tempCtx;\n }\n return true;\n }\n\n /**\n * End a knockout element started by `#beginKnockoutElement`. Composites\n * the rendered surface onto the group canvas with KO semantics: build a\n * shape mask from the element (painted alpha scaled back to geometric\n * coverage when alpha_s < 1), destination-out the group canvas over that\n * mask, restore the initial backdrop into the cleared footprint\n * (non-isolated only), then paint the element on top.\n * @param {boolean} started - the value returned by `#beginKnockoutElement`.\n */\n #endKnockoutElement(started) {\n if (!started) {\n return;\n }\n const tempEntry = this.#knockoutTempCanvasEntry;\n const savedCtx = this.#knockoutSavedCtx;\n const savedSMaskCtx = this.#knockoutSavedSMaskCtx;\n const tempCtx = tempEntry.context;\n this.#knockoutTempCanvasEntry = null;\n this.#knockoutSavedCtx = null;\n this.#knockoutSavedSMaskCtx = null;\n if (\n this.inSMaskMode &&\n this.suspendedCtx === tempCtx &&\n this.ctx !== tempCtx\n ) {\n this.endSMaskMode();\n }\n if (this.inSMaskMode) {\n this.suspendedCtx = savedSMaskCtx;\n }\n this.ctx._removeMirroring();\n // Re-apply the parent GCO before copyCtxState writes it back to\n // savedCtx so #compositeKnockoutSurface sees the original blend mode.\n this.ctx.globalCompositeOperation = this.#knockoutSavedGCO;\n this.#knockoutSavedGCO = null;\n copyCtxState(this.ctx, savedCtx);\n this.ctx = savedCtx;\n const groupMeta = this.#knockoutElementGroupMeta;\n this.#knockoutElementGroupMeta = null;\n const knockoutAlpha = this.#knockoutElementAlpha;\n this.#knockoutElementAlpha = 1;\n try {\n this.#compositeKnockoutSurface(\n savedSMaskCtx ?? savedCtx,\n tempEntry.canvas,\n {\n backdropCanvas: groupMeta?.backdropCtx?.canvas ?? null,\n backdropOffset: groupMeta?.backdropCtx\n ? [groupMeta.offsetX, groupMeta.offsetY]\n : [0, 0],\n reuseMaskEntry: groupMeta?.knockoutMaskEntry ?? null,\n poolMeta: groupMeta,\n knockoutAlpha,\n }\n );\n } finally {\n // Pop the begin-element bracket save so the pooled canvas re-enters\n // with a clean clip+transform stack.\n tempCtx.restore();\n // Decrement only after the canvas is fully reset, so a re-entry from\n // a compositing callback sees depth>0 and bails out.\n this.#knockoutElementDepth--;\n // Defensive: groupMeta is non-null in practice for any active KO\n // element, but if it isn't we must release the unpooled entry.\n if (!groupMeta) {\n this.canvasFactory.destroy(tempEntry);\n }\n }\n }\n\n compose(dirtyBox) {\n if (!this.current.activeSMask) {\n return;\n }\n\n // Don't mutate the caller's box -- callers (e.g. consumePath) may\n // hold on to it.\n dirtyBox = dirtyBox\n ? [\n Math.floor(dirtyBox[0]),\n Math.floor(dirtyBox[1]),\n Math.ceil(dirtyBox[2]),\n Math.ceil(dirtyBox[3]),\n ]\n : [0, 0, this.ctx.canvas.width, this.ctx.canvas.height];\n const smask = this.current.activeSMask;\n const suspendedCtx = this.suspendedCtx;\n const applySMaskInPlace =\n this.#knockoutElementDepth > 0 && suspendedCtx === this.ctx;\n\n this.composeSMask(\n applySMaskInPlace ? null : suspendedCtx,\n smask,\n this.ctx,\n dirtyBox\n );\n if (applySMaskInPlace) {\n return;\n }\n\n // Clear the full scratch canvas, not just the dirty box. Pixels left\n // outside dirtyBox can leak into a later compose() whose destination-in\n // pass doesn't overwrite them, producing stale output -- this is what\n // breaks `firefox-issue17779-partial` (issue #21276).\n this.ctx.save();\n this.ctx.setTransform(1, 0, 0, 1, 0, 0);\n this.ctx.clearRect(0, 0, this.ctx.canvas.width, this.ctx.canvas.height);\n this.ctx.restore();\n }\n\n composeSMask(ctx, smask, layerCtx, layerBox) {\n const layerOffsetX = layerBox[0];\n const layerOffsetY = layerBox[1];\n const layerWidth = layerBox[2] - layerOffsetX;\n const layerHeight = layerBox[3] - layerOffsetY;\n if (layerWidth === 0 || layerHeight === 0) {\n return;\n }\n\n const preparedEntry = this.smaskPreparedEntry;\n if (preparedEntry) {\n // Fast path: prepared-mask destination-in drawImage. See\n // smaskPreparedOOBAlpha field doc for the OOB handling table.\n let clipX = layerOffsetX;\n let clipY = layerOffsetY;\n let clipW = layerWidth;\n let clipH = layerHeight;\n const oobAlpha = this.smaskPreparedOOBAlpha;\n const hasOOBAlpha = oobAlpha !== null;\n if (hasOOBAlpha) {\n clipX = Math.max(layerOffsetX, smask.offsetX);\n clipY = Math.max(layerOffsetY, smask.offsetY);\n const x1 = Math.min(\n layerOffsetX + layerWidth,\n smask.offsetX + smask.canvas.width\n );\n const y1 = Math.min(\n layerOffsetY + layerHeight,\n smask.offsetY + smask.canvas.height\n );\n clipW = x1 - clipX;\n clipH = y1 - clipY;\n }\n if (clipW > 0 && clipH > 0) {\n const srcX = clipX - this.smaskPreparedOffsetX;\n const srcY = clipY - this.smaskPreparedOffsetY;\n layerCtx.save();\n layerCtx.globalAlpha = 1;\n layerCtx.setTransform(1, 0, 0, 1, 0, 0);\n const clip = new Path2D();\n clip.rect(clipX, clipY, clipW, clipH);\n layerCtx.clip(clip);\n layerCtx.globalCompositeOperation = \"destination-in\";\n layerCtx.drawImage(\n preparedEntry.canvas,\n srcX,\n srcY,\n clipW,\n clipH,\n clipX,\n clipY,\n clipW,\n clipH\n );\n layerCtx.restore();\n }\n if (hasOOBAlpha && oobAlpha < 255) {\n this._applySMaskOOBAlpha(\n layerCtx,\n layerOffsetX,\n layerOffsetY,\n layerWidth,\n layerHeight,\n clipX,\n clipY,\n clipX + clipW,\n clipY + clipH,\n oobAlpha\n );\n }\n } else {\n this.genericComposeSMask(\n smask,\n layerCtx,\n layerWidth,\n layerHeight,\n layerOffsetX,\n layerOffsetY\n );\n }\n\n if (!ctx) {\n return;\n }\n\n ctx.save();\n ctx.globalAlpha = 1;\n ctx.globalCompositeOperation = smask.blendMode || \"source-over\";\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n // Blit only the dirty box -- the rest of the scratch canvas was\n // cleared in compose().\n ctx.drawImage(\n layerCtx.canvas,\n layerOffsetX,\n layerOffsetY,\n layerWidth,\n layerHeight,\n layerOffsetX,\n layerOffsetY,\n layerWidth,\n layerHeight\n );\n ctx.restore();\n }\n\n /**\n * Fade the dirty box's OOB region by a constant alpha. Called from\n * composeSMask when smaskPreparedOOBAlpha is in (0, 255).\n *\n * destination-in clears every destination pixel outside the source's\n * footprint, so four fillRects (one per strip) would each clear the\n * others. Instead one fillRect covers the dirty box, restricted by\n * an even-odd clip enclosing exactly (dirty_box XOR mask_region);\n * within the clip the source covers everything so no \"outside\n * source\" pixels exist.\n */\n _applySMaskOOBAlpha(\n layerCtx,\n layerOffsetX,\n layerOffsetY,\n layerWidth,\n layerHeight,\n maskX0,\n maskY0,\n maskX1,\n maskY1,\n alpha\n ) {\n const hasInnerCutout = maskX0 < maskX1 && maskY0 < maskY1;\n if (\n hasInnerCutout &&\n maskX0 === layerOffsetX &&\n maskY0 === layerOffsetY &&\n maskX1 === layerOffsetX + layerWidth &&\n maskY1 === layerOffsetY + layerHeight\n ) {\n // Dirty box is entirely inside the mask -- no OOB region to fade.\n return;\n }\n const path = new Path2D();\n path.rect(layerOffsetX, layerOffsetY, layerWidth, layerHeight);\n if (hasInnerCutout) {\n path.rect(maskX0, maskY0, maskX1 - maskX0, maskY1 - maskY0);\n }\n\n layerCtx.save();\n layerCtx.globalAlpha = alpha / 255;\n layerCtx.setTransform(1, 0, 0, 1, 0, 0);\n layerCtx.clip(path, \"evenodd\");\n layerCtx.globalCompositeOperation = \"destination-in\";\n // MUST be fully opaque -- destination-in scales dst_a by src_a, and\n // globalAlpha must be the only thing scaling source alpha.\n layerCtx.fillStyle = \"#000000\";\n layerCtx.fillRect(layerOffsetX, layerOffsetY, layerWidth, layerHeight);\n layerCtx.restore();\n }\n\n genericComposeSMask(\n smask,\n layerCtx,\n width,\n height,\n layerOffsetX,\n layerOffsetY\n ) {\n // composeSMask helper, reached only for plain-alpha masks (no\n // filter, no backdrop); every backdrop/filter case prebakes in\n // _prepareSMaskCanvas. A single destination-in blit suffices:\n // transparent OOB mask samples clear OOB layer pixels.\n const {\n context: maskCtx,\n offsetX: maskOffsetX,\n offsetY: maskOffsetY,\n } = smask;\n\n layerCtx.save();\n layerCtx.globalAlpha = 1;\n layerCtx.setTransform(1, 0, 0, 1, 0, 0);\n const clip = new Path2D();\n clip.rect(layerOffsetX, layerOffsetY, width, height);\n layerCtx.clip(clip);\n layerCtx.globalCompositeOperation = \"destination-in\";\n layerCtx.drawImage(\n maskCtx.canvas,\n layerOffsetX - maskOffsetX,\n layerOffsetY - maskOffsetY,\n width,\n height,\n layerOffsetX,\n layerOffsetY,\n width,\n height\n );\n layerCtx.restore();\n }\n\n save(opIdx) {\n if (this.inSMaskMode) {\n // SMask mode may be turned on/off causing us to lose graphics state.\n // Copy the temporary canvas state to the main(suspended) canvas to keep\n // it in sync.\n copyCtxState(this.ctx, this.suspendedCtx);\n }\n this.ctx.save();\n const old = this.current;\n this.stateStack.push(old);\n this.current = old.clone();\n this.dependencyTracker?.save(opIdx);\n }\n\n restore(opIdx) {\n this.dependencyTracker?.restore(opIdx);\n\n if (this.stateStack.length === 0) {\n if (this.inSMaskMode) {\n this.endSMaskMode();\n }\n return;\n }\n\n this.current = this.stateStack.pop();\n this.ctx.restore();\n if (this.inSMaskMode) {\n // Graphics state is stored on the main(suspended) canvas. Restore its\n // state then copy it over to the temporary canvas.\n copyCtxState(this.suspendedCtx, this.ctx);\n // The scratch canvas may have been freshly created by beginSMaskMode\n // (called from checkSMaskState during a previous endGroup), in which\n // case its save/restore stack is empty and ctx.restore() above was a\n // no-op. Explicitly sync the CTM from the main canvas so that any CTM\n // change that the mirrored restore applied to the main canvas is also\n // reflected on the scratch canvas.\n this.ctx.setTransform(this.suspendedCtx.getTransform());\n }\n this.checkSMaskState(opIdx);\n\n // Ensure that the clipping path is reset (fixes issue6413.pdf).\n this.pendingClip = null;\n\n this._cachedScaleForStroking[0] = -1;\n }\n\n transform(opIdx, a, b, c, d, e, f) {\n this.dependencyTracker?.recordIncrementalData(\"transform\", opIdx);\n this.ctx.transform(a, b, c, d, e, f);\n\n this._cachedScaleForStroking[0] = -1;\n }\n\n // Path\n constructPath(opIdx, op, data, minMax) {\n let [path] = data;\n if (!minMax) {\n // The path is empty, so no need to update the current minMax.\n path ||= data[0] = new Path2D();\n if (op !== OPS.stroke && op !== OPS.closeStroke) {\n this.current.tilingPatternDims = null;\n }\n this[op](opIdx, path);\n return;\n }\n\n if (this.dependencyTracker !== null) {\n const outerExtraSize = op === OPS.stroke ? this.current.lineWidth / 2 : 0;\n this.dependencyTracker\n .resetBBox(opIdx)\n .recordBBox(\n opIdx,\n this.ctx,\n minMax[0] - outerExtraSize,\n minMax[2] + outerExtraSize,\n minMax[1] - outerExtraSize,\n minMax[3] + outerExtraSize\n )\n .recordDependencies(opIdx, [\"transform\"]);\n }\n\n if (!(path instanceof Path2D)) {\n path = data[0] = makePathFromDrawOPS(path);\n }\n Util.axialAlignedBoundingBox(\n minMax,\n getCurrentTransform(this.ctx),\n this.current.minMax\n );\n\n const tilingDims = this.current.tilingPatternDims;\n if (\n tilingDims &&\n op !== OPS.stroke &&\n op !== OPS.closeStroke &&\n this.current.fillColor instanceof TilingPattern\n ) {\n // Intersect with clip box to get the actual fill area, then convert\n // to pattern space.\n const clippedBBox = Util.intersect(\n this.current.clipBox,\n this.current.minMax\n );\n if (!clippedBBox) {\n this.current.tilingPatternDims = null;\n } else {\n this.current.fillColor.updatePatternDims(clippedBBox, tilingDims);\n }\n }\n\n this[op](opIdx, path);\n\n this._pathStartIdx = opIdx;\n }\n\n closePath(opIdx) {\n this.ctx.closePath();\n }\n\n stroke(opIdx, path, consumePath = true) {\n const started =\n consumePath && this.#beginKnockoutElement(this.current.strokeAlpha);\n const ctx = this.ctx;\n const strokeColor = this.current.strokeColor;\n // For stroke we want to temporarily change the global alpha to the\n // stroking alpha.\n ctx.globalAlpha = this.current.strokeAlpha;\n if (this.contentVisible) {\n if (typeof strokeColor === \"object\" && strokeColor?.getPattern) {\n const baseTransform = strokeColor.isModifyingCurrentTransform()\n ? ctx.getTransform()\n : null;\n ctx.save();\n ctx.strokeStyle = strokeColor.getPattern(\n ctx,\n this,\n getCurrentTransformInverse(ctx),\n PathType.STROKE,\n opIdx\n );\n if (baseTransform) {\n const newPath = new Path2D();\n newPath.addPath(\n path,\n ctx.getTransform().invertSelf().multiplySelf(baseTransform)\n );\n path = newPath;\n }\n this.rescaleAndStroke(path, /* saveRestore */ false);\n ctx.restore();\n } else {\n this.rescaleAndStroke(path, /* saveRestore */ true);\n }\n }\n\n this.dependencyTracker?.recordDependencies(opIdx, Dependencies.stroke);\n\n if (consumePath) {\n this.consumePath(\n opIdx,\n path,\n this.current.getClippedPathBoundingBox(\n PathType.STROKE,\n getCurrentTransform(this.ctx)\n )\n );\n }\n\n // Restore the global alpha to the fill alpha\n ctx.globalAlpha = this.current.fillAlpha;\n this.#endKnockoutElement(started);\n }\n\n closeStroke(opIdx, path) {\n this.stroke(opIdx, path);\n }\n\n fill(opIdx, path, consumePath = true) {\n const started =\n consumePath && this.#beginKnockoutElement(this.current.fillAlpha);\n const ctx = this.ctx;\n const fillColor = this.current.fillColor;\n const isPatternFill = this.current.patternFill;\n let needRestore = false;\n const intersect = this.current.getClippedPathBoundingBox();\n\n this.dependencyTracker?.recordDependencies(opIdx, Dependencies.fill);\n\n if (isPatternFill) {\n const dims = this.current.tilingPatternDims;\n const tileIdx = dims && fillColor.canSkipPatternCanvas(dims);\n if (tileIdx) {\n // Draw the tile directly, skipping the pattern canvas.\n fillColor.drawPattern(this, path, this.pendingEOFill, tileIdx, opIdx);\n this.pendingEOFill = false;\n if (consumePath) {\n this.consumePath(opIdx, path, intersect);\n }\n this.current.tilingPatternDims = null;\n this.#endKnockoutElement(started);\n return;\n }\n const baseTransform = fillColor.isModifyingCurrentTransform()\n ? ctx.getTransform()\n : null;\n this.dependencyTracker?.save(opIdx);\n ctx.save();\n ctx.fillStyle = fillColor.getPattern(\n ctx,\n this,\n getCurrentTransformInverse(ctx),\n PathType.FILL,\n opIdx\n );\n if (baseTransform) {\n const newPath = new Path2D();\n newPath.addPath(\n path,\n ctx.getTransform().invertSelf().multiplySelf(baseTransform)\n );\n path = newPath;\n }\n needRestore = true;\n }\n\n if (this.contentVisible && intersect !== null) {\n if (this.pendingEOFill) {\n ctx.fill(path, \"evenodd\");\n this.pendingEOFill = false;\n } else {\n ctx.fill(path);\n }\n }\n\n if (needRestore) {\n ctx.restore();\n this.dependencyTracker?.restore(opIdx);\n }\n if (consumePath) {\n this.consumePath(opIdx, path, intersect);\n }\n this.#endKnockoutElement(started);\n }\n\n eoFill(opIdx, path) {\n this.pendingEOFill = true;\n this.fill(opIdx, path);\n }\n\n fillStroke(opIdx, path) {\n // Fill and stroke share one KO element so they composite against the\n // initial backdrop once, not twice. Use the smaller of the two alpha_s as\n // the mask divisor: it's conservative (over-clamps the other pass's\n // mask towards 1) but keeps the mask coverage at least as large as the\n // union of fill+stroke shapes, which is what KO erasure wants.\n const started = this.#beginKnockoutElement(\n Math.min(this.current.fillAlpha, this.current.strokeAlpha)\n );\n this.fill(opIdx, path, false);\n this.stroke(opIdx, path, false);\n this.consumePath(opIdx, path);\n this.#endKnockoutElement(started);\n }\n\n eoFillStroke(opIdx, path) {\n this.pendingEOFill = true;\n this.fillStroke(opIdx, path);\n }\n\n closeFillStroke(opIdx, path) {\n this.fillStroke(opIdx, path);\n }\n\n closeEOFillStroke(opIdx, path) {\n this.pendingEOFill = true;\n this.fillStroke(opIdx, path);\n }\n\n endPath(opIdx, path) {\n this.consumePath(opIdx, path);\n }\n\n rawFillPath(opIdx, path) {\n const started = this.#beginKnockoutElement(this.current.fillAlpha);\n this.ctx.fill(path);\n this.dependencyTracker\n ?.recordDependencies(opIdx, Dependencies.rawFillPath)\n .recordOperation(opIdx);\n this.#endKnockoutElement(started);\n }\n\n // Clipping\n clip(opIdx) {\n this.dependencyTracker?.recordFutureForcedDependency(\"clipMode\", opIdx);\n this.pendingClip = NORMAL_CLIP;\n }\n\n eoClip(opIdx) {\n this.dependencyTracker?.recordFutureForcedDependency(\"clipMode\", opIdx);\n this.pendingClip = EO_CLIP;\n }\n\n // Text\n beginText(opIdx) {\n this.current.textMatrix = null;\n this.current.textMatrixScale = 1;\n this.current.x = this.current.lineX = 0;\n this.current.y = this.current.lineY = 0;\n\n this.dependencyTracker\n ?.recordOpenMarker(opIdx)\n .resetIncrementalData(\"sameLineText\")\n .resetIncrementalData(\"moveText\", opIdx);\n }\n\n endText(opIdx) {\n const paths = this.pendingTextPaths;\n const ctx = this.ctx;\n\n if (this.dependencyTracker) {\n const { dependencyTracker } = this;\n if (paths !== undefined) {\n dependencyTracker\n .recordFutureForcedDependency(\n \"textClip\",\n dependencyTracker.getOpenMarker()\n )\n .recordFutureForcedDependency(\"textClip\", opIdx);\n }\n dependencyTracker.recordCloseMarker(opIdx);\n }\n\n if (paths !== undefined) {\n const newPath = new Path2D();\n const invTransf = ctx.getTransform().invertSelf();\n for (const { transform, x, y, fontSize, path } of paths) {\n if (!path) {\n continue; // Skip empty paths.\n }\n newPath.addPath(\n path,\n new DOMMatrix(transform)\n .preMultiplySelf(invTransf)\n .translate(x, y)\n .scale(fontSize, -fontSize)\n );\n }\n\n ctx.clip(newPath);\n }\n delete this.pendingTextPaths;\n }\n\n setCharSpacing(opIdx, spacing) {\n this.dependencyTracker?.recordSimpleData(\"charSpacing\", opIdx);\n this.current.charSpacing = spacing;\n }\n\n setWordSpacing(opIdx, spacing) {\n this.dependencyTracker?.recordSimpleData(\"wordSpacing\", opIdx);\n this.current.wordSpacing = spacing;\n }\n\n setHScale(opIdx, scale) {\n this.dependencyTracker?.recordSimpleData(\"hScale\", opIdx);\n this.current.textHScale = scale / 100;\n }\n\n setLeading(opIdx, leading) {\n this.dependencyTracker?.recordSimpleData(\"leading\", opIdx);\n this.current.leading = -leading;\n }\n\n setFont(opIdx, fontRefName, size) {\n this.dependencyTracker\n ?.recordSimpleData(\"font\", opIdx)\n .recordSimpleDataFromNamed(\"fontObj\", fontRefName, opIdx);\n const fontObj = this.commonObjs.get(fontRefName);\n const current = this.current;\n\n if (!fontObj) {\n throw new Error(`Can't find font for ${fontRefName}`);\n }\n current.fontMatrix = fontObj.fontMatrix || FONT_IDENTITY_MATRIX;\n\n // A valid matrix needs all main diagonal elements to be non-zero\n // This also ensures we bypass FF bugzilla bug #719844.\n if (current.fontMatrix[0] === 0 || current.fontMatrix[3] === 0) {\n warn(\"Invalid font matrix for font \" + fontRefName);\n }\n\n // The spec for Tf (setFont) says that 'size' specifies the font 'scale',\n // and in some docs this can be negative (inverted x-y axes).\n if (size < 0) {\n size = -size;\n current.fontDirection = -1;\n } else {\n current.fontDirection = 1;\n }\n\n this.current.font = fontObj;\n this.current.fontSize = size;\n\n if (fontObj.isType3Font) {\n return; // we don't need ctx.font for Type3 fonts\n }\n\n const name = fontObj.loadedName || \"sans-serif\";\n const typeface =\n fontObj.systemFontInfo?.css || `\"${name}\", ${fontObj.fallbackName}`;\n\n let bold = \"normal\";\n if (fontObj.black) {\n bold = \"900\";\n } else if (fontObj.bold) {\n bold = \"bold\";\n }\n const italic = fontObj.italic ? \"italic\" : \"normal\";\n\n // Some font backends cannot handle fonts below certain size.\n // Keeping the font at minimal size and using the fontSizeScale to change\n // the current transformation matrix before the fillText/strokeText.\n // See https://bugzilla.mozilla.org/show_bug.cgi?id=726227\n const browserFontSize = MathClamp(size, MIN_FONT_SIZE, MAX_FONT_SIZE);\n this.current.fontSizeScale = size / browserFontSize;\n\n this.ctx.font = `${italic} ${bold} ${browserFontSize}px ${typeface}`;\n }\n\n setTextRenderingMode(opIdx, mode) {\n this.dependencyTracker?.recordSimpleData(\"textRenderingMode\", opIdx);\n this.current.textRenderingMode = mode;\n }\n\n setTextRise(opIdx, rise) {\n this.dependencyTracker?.recordSimpleData(\"textRise\", opIdx);\n this.current.textRise = rise;\n }\n\n moveText(opIdx, x, y) {\n this.dependencyTracker\n ?.resetIncrementalData(\"sameLineText\")\n .recordIncrementalData(\"moveText\", opIdx);\n this.current.x = this.current.lineX += x;\n this.current.y = this.current.lineY += y;\n }\n\n setLeadingMoveText(opIdx, x, y) {\n this.setLeading(opIdx, -y);\n this.moveText(opIdx, x, y);\n }\n\n setTextMatrix(opIdx, matrix) {\n this.dependencyTracker\n ?.resetIncrementalData(\"sameLineText\")\n .recordSimpleData(\"textMatrix\", opIdx);\n const { current } = this;\n current.textMatrix = matrix;\n current.textMatrixScale = Math.hypot(matrix[0], matrix[1]);\n\n current.x = current.lineX = 0;\n current.y = current.lineY = 0;\n }\n\n nextLine(opIdx) {\n this.moveText(opIdx, 0, this.current.leading);\n\n this.dependencyTracker?.recordIncrementalData(\n \"moveText\",\n // 'leading' affects 'nextLine' operations. Rather than dealing\n // with transitive dependencies, just mark everything that depends on\n // the 'moveText' operation as depending on the 'leading' value.\n this.dependencyTracker.getSimpleIndex(\"leading\") ?? opIdx\n );\n }\n\n #getScaledPath(path, currentTransform, transform) {\n const newPath = new Path2D();\n newPath.addPath(\n path,\n new DOMMatrix(transform).invertSelf().multiplySelf(currentTransform)\n );\n return newPath;\n }\n\n paintChar(\n opIdx,\n character,\n x,\n y,\n patternFillTransform,\n patternStrokeTransform\n ) {\n const ctx = this.ctx;\n const current = this.current;\n const font = current.font;\n const textRenderingMode = current.textRenderingMode;\n const fontSize = current.fontSize / current.fontSizeScale;\n const fillStrokeMode =\n textRenderingMode & TextRenderingMode.FILL_STROKE_MASK;\n const isAddToPathSet = !!(\n textRenderingMode & TextRenderingMode.ADD_TO_PATH_FLAG\n );\n const patternFill = current.patternFill && !font.missingFile;\n const patternStroke = current.patternStroke && !font.missingFile;\n\n let path;\n if (\n (font.disableFontFace ||\n isAddToPathSet ||\n patternFill ||\n patternStroke) &&\n !font.missingFile\n ) {\n path = font.getPathGenerator(this.commonObjs, character);\n }\n\n if (path && (font.disableFontFace || patternFill || patternStroke)) {\n ctx.save();\n ctx.translate(x, y);\n ctx.scale(fontSize, -fontSize);\n\n this.dependencyTracker?.recordCharacterBBox(opIdx, ctx, font);\n\n let currentTransform;\n if (\n fillStrokeMode === TextRenderingMode.FILL ||\n fillStrokeMode === TextRenderingMode.FILL_STROKE\n ) {\n if (patternFillTransform) {\n currentTransform = ctx.getTransform();\n ctx.setTransform(...patternFillTransform);\n const scaledPath = this.#getScaledPath(\n path,\n currentTransform,\n patternFillTransform\n );\n ctx.fill(scaledPath);\n } else {\n ctx.fill(path);\n }\n }\n if (\n fillStrokeMode === TextRenderingMode.STROKE ||\n fillStrokeMode === TextRenderingMode.FILL_STROKE\n ) {\n if (patternStrokeTransform) {\n currentTransform ||= ctx.getTransform();\n ctx.setTransform(...patternStrokeTransform);\n const { a, b, c, d } = currentTransform;\n const invPatternTransform = Util.inverseTransform(\n patternStrokeTransform\n );\n const transf = Util.transform(\n [a, b, c, d, 0, 0],\n invPatternTransform\n );\n Util.singularValueDecompose2dScale(transf, XY);\n\n // Cancel the pattern scaling of the line width.\n // If sx and sy are different, unfortunately we can't do anything and\n // we'll have a rendering bug.\n ctx.lineWidth *= Math.max(XY[0], XY[1]) / fontSize;\n ctx.stroke(\n this.#getScaledPath(path, currentTransform, patternStrokeTransform)\n );\n } else {\n ctx.lineWidth /= fontSize;\n ctx.stroke(path);\n }\n }\n ctx.restore();\n } else {\n if (\n fillStrokeMode === TextRenderingMode.FILL ||\n fillStrokeMode === TextRenderingMode.FILL_STROKE\n ) {\n ctx.fillText(character, x, y);\n this.dependencyTracker?.recordCharacterBBox(\n opIdx,\n ctx,\n font,\n fontSize,\n x,\n y,\n () => ctx.measureText(character)\n );\n }\n if (\n fillStrokeMode === TextRenderingMode.STROKE ||\n fillStrokeMode === TextRenderingMode.FILL_STROKE\n ) {\n if (this.dependencyTracker) {\n this.dependencyTracker\n ?.recordCharacterBBox(opIdx, ctx, font, fontSize, x, y, () =>\n ctx.measureText(character)\n )\n .recordDependencies(opIdx, Dependencies.stroke);\n }\n ctx.strokeText(character, x, y);\n }\n }\n\n if (isAddToPathSet) {\n const paths = (this.pendingTextPaths ||= []);\n paths.push({\n transform: getCurrentTransform(ctx),\n x,\n y,\n fontSize,\n path,\n });\n this.dependencyTracker?.recordCharacterBBox(\n opIdx,\n ctx,\n font,\n fontSize,\n x,\n y\n );\n }\n }\n\n get isFontSubpixelAAEnabled() {\n // Checks if anti-aliasing is enabled when scaled text is painted.\n // On Windows GDI scaled fonts looks bad.\n const tmpCanvas = this.canvasFactory.create(10, 10);\n const ctx = tmpCanvas.context;\n ctx.scale(1.5, 1);\n ctx.fillText(\"I\", 0, 10);\n const data = ctx.getImageData(0, 0, 10, 10).data;\n this.canvasFactory.destroy(tmpCanvas);\n let enabled = false;\n for (let i = 3; i < data.length; i += 4) {\n if (data[i] > 0 && data[i] < 255) {\n enabled = true;\n break;\n }\n }\n return shadow(this, \"isFontSubpixelAAEnabled\", enabled);\n }\n\n showText(opIdx, glyphs) {\n if (this.dependencyTracker) {\n this.dependencyTracker\n .recordDependencies(opIdx, Dependencies.showText)\n .resetBBox(opIdx);\n if (this.current.textRenderingMode & TextRenderingMode.ADD_TO_PATH_FLAG) {\n this.dependencyTracker\n .recordFutureForcedDependency(\"textClip\", opIdx)\n .inheritPendingDependenciesAsFutureForcedDependencies();\n }\n }\n\n const current = this.current;\n const font = current.font;\n if (font.isType3Font) {\n const started = this.#beginKnockoutElement(current.fillAlpha);\n this.showType3Text(opIdx, glyphs);\n this.dependencyTracker?.recordShowTextOperation(opIdx);\n this.#endKnockoutElement(started);\n return;\n }\n\n const fontSize = current.fontSize;\n if (fontSize === 0) {\n this.dependencyTracker?.recordOperation(opIdx);\n return;\n }\n\n const started = this.#beginKnockoutElement(current.fillAlpha);\n const ctx = this.ctx;\n const fontSizeScale = current.fontSizeScale;\n const charSpacing = current.charSpacing;\n const wordSpacing = current.wordSpacing;\n const fontDirection = current.fontDirection;\n const textHScale = current.textHScale * fontDirection;\n const glyphsLength = glyphs.length;\n const vertical = font.vertical;\n const spacingDir = vertical ? 1 : -1;\n const widthAdvanceScale = fontSize * current.fontMatrix[0];\n\n const simpleFillText =\n current.textRenderingMode === TextRenderingMode.FILL &&\n !font.disableFontFace &&\n !current.patternFill;\n\n ctx.save();\n if (current.textMatrix) {\n ctx.transform(...current.textMatrix);\n }\n ctx.translate(current.x, current.y + current.textRise);\n\n if (fontDirection > 0) {\n ctx.scale(textHScale, -1);\n } else {\n ctx.scale(textHScale, 1);\n }\n\n let patternFillTransform, patternStrokeTransform;\n\n // Only compute pattern transforms if the text rendering mode actually\n // uses fill/stroke. This avoids expensive pattern calculations each call\n // when a patternFill/patternStroke is set, but unused.\n const fillStrokeMode =\n current.textRenderingMode & TextRenderingMode.FILL_STROKE_MASK;\n const needsFill =\n fillStrokeMode === TextRenderingMode.FILL ||\n fillStrokeMode === TextRenderingMode.FILL_STROKE;\n const needsStroke =\n fillStrokeMode === TextRenderingMode.STROKE ||\n fillStrokeMode === TextRenderingMode.FILL_STROKE;\n\n let lineWidth = current.lineWidth;\n const scale = current.textMatrixScale;\n if (scale === 0 || lineWidth === 0) {\n if (needsStroke) {\n lineWidth = this.getSinglePixelWidth();\n }\n } else {\n lineWidth /= scale;\n }\n\n if (fontSizeScale !== 1.0) {\n ctx.scale(fontSizeScale, fontSizeScale);\n lineWidth /= fontSizeScale;\n }\n\n ctx.lineWidth = lineWidth;\n\n if (needsFill && current.patternFill) {\n ctx.save();\n const pattern = current.fillColor.getPattern(\n ctx,\n this,\n getCurrentTransformInverse(ctx),\n PathType.FILL,\n opIdx\n );\n patternFillTransform = getCurrentTransform(ctx);\n ctx.restore();\n ctx.fillStyle = pattern;\n }\n\n if (needsStroke && current.patternStroke) {\n ctx.save();\n const pattern = current.strokeColor.getPattern(\n ctx,\n this,\n getCurrentTransformInverse(ctx),\n PathType.STROKE,\n opIdx\n );\n patternStrokeTransform = getCurrentTransform(ctx);\n ctx.restore();\n ctx.strokeStyle = pattern;\n }\n\n if (font.isInvalidPDFjsFont) {\n const chars = [];\n let width = 0;\n for (const glyph of glyphs) {\n chars.push(glyph.unicode);\n width += glyph.width;\n }\n const joinedChars = chars.join(\"\");\n ctx.fillText(joinedChars, 0, 0);\n if (this.dependencyTracker !== null) {\n const measure = ctx.measureText(joinedChars);\n this.dependencyTracker\n .recordBBox(\n opIdx,\n this.ctx,\n -measure.actualBoundingBoxLeft,\n measure.actualBoundingBoxRight,\n -measure.actualBoundingBoxAscent,\n measure.actualBoundingBoxDescent\n )\n .recordShowTextOperation(opIdx);\n }\n current.x += width * widthAdvanceScale * textHScale;\n ctx.restore();\n this.compose();\n this.#endKnockoutElement(started);\n return;\n }\n\n let x = 0,\n i;\n for (i = 0; i < glyphsLength; ++i) {\n const glyph = glyphs[i];\n if (typeof glyph === \"number\") {\n x += (spacingDir * glyph * fontSize) / 1000;\n continue;\n }\n\n let restoreNeeded = false;\n const spacing = (glyph.isSpace ? wordSpacing : 0) + charSpacing;\n const character = glyph.fontChar;\n const accent = glyph.accent;\n let scaledX, scaledY;\n let width = glyph.width;\n if (vertical) {\n const vmetric = glyph.vmetric;\n const vx = -vmetric[1] * widthAdvanceScale;\n const vy = vmetric[2] * widthAdvanceScale;\n\n width = -vmetric[0];\n scaledX = vx / fontSizeScale;\n scaledY = (x + vy) / fontSizeScale;\n } else {\n scaledX = x / fontSizeScale;\n scaledY = 0;\n }\n\n let measure;\n\n if (font.remeasure && width > 0) {\n measure = ctx.measureText(character);\n\n // Some standard fonts may not have the exact width: rescale per\n // character if measured width is greater than expected glyph width\n // and subpixel-aa is enabled, otherwise just center the glyph.\n const measuredWidth =\n ((measure.width * 1000) / fontSize) * fontSizeScale;\n if (width < measuredWidth && this.isFontSubpixelAAEnabled) {\n const characterScaleX = width / measuredWidth;\n restoreNeeded = true;\n ctx.save();\n ctx.scale(characterScaleX, 1);\n scaledX /= characterScaleX;\n } else if (width !== measuredWidth) {\n scaledX +=\n (((width - measuredWidth) / 2000) * fontSize) / fontSizeScale;\n }\n }\n\n // Only attempt to draw the glyph if it is actually in the embedded font\n // file or if there isn't a font file so the fallback font is shown.\n if (this.contentVisible && (glyph.isInFont || font.missingFile)) {\n if (simpleFillText && !accent) {\n // common case\n ctx.fillText(character, scaledX, scaledY);\n\n this.dependencyTracker?.recordCharacterBBox(\n opIdx,\n ctx,\n // If we already measured the character, force usage of that\n measure ? { bbox: null } : font,\n fontSize / fontSizeScale,\n scaledX,\n scaledY,\n () => measure ?? ctx.measureText(character)\n );\n } else {\n this.paintChar(\n opIdx,\n character,\n scaledX,\n scaledY,\n patternFillTransform,\n patternStrokeTransform\n );\n if (accent) {\n const scaledAccentX =\n scaledX + (fontSize * accent.offset.x) / fontSizeScale;\n const scaledAccentY =\n scaledY - (fontSize * accent.offset.y) / fontSizeScale;\n this.paintChar(\n opIdx,\n accent.fontChar,\n scaledAccentX,\n scaledAccentY,\n patternFillTransform,\n patternStrokeTransform\n );\n }\n }\n }\n\n const charWidth = vertical\n ? width * widthAdvanceScale - spacing * fontDirection\n : width * widthAdvanceScale + spacing * fontDirection;\n x += charWidth;\n\n if (restoreNeeded) {\n ctx.restore();\n }\n }\n if (vertical) {\n current.y -= x;\n } else {\n current.x += x * textHScale;\n }\n ctx.restore();\n this.compose();\n\n this.dependencyTracker?.recordShowTextOperation(opIdx);\n this.#endKnockoutElement(started);\n }\n\n showType3Text(opIdx, glyphs) {\n // Type3 fonts - each glyph is a \"mini-PDF\"\n const ctx = this.ctx;\n const current = this.current;\n const font = current.font;\n const fontSize = current.fontSize;\n const fontDirection = current.fontDirection;\n const spacingDir = font.vertical ? 1 : -1;\n const charSpacing = current.charSpacing;\n const wordSpacing = current.wordSpacing;\n const textHScale = current.textHScale * fontDirection;\n const fontMatrix = current.fontMatrix || FONT_IDENTITY_MATRIX;\n const glyphsLength = glyphs.length;\n const isTextInvisible =\n current.textRenderingMode === TextRenderingMode.INVISIBLE;\n let i, glyph, width, spacingLength;\n\n if (isTextInvisible || fontSize === 0) {\n return;\n }\n this._cachedScaleForStroking[0] = -1;\n\n ctx.save();\n if (current.textMatrix) {\n ctx.transform(...current.textMatrix);\n }\n ctx.translate(current.x, current.y + current.textRise);\n\n ctx.scale(textHScale, fontDirection);\n\n // Type3 fonts have their own operator list. Avoid mixing it up with the\n // dependency tracker of the main operator list.\n const dependencyTracker = this.dependencyTracker;\n this.dependencyTracker = dependencyTracker\n ? new CanvasNestedDependencyTracker(dependencyTracker, opIdx)\n : null;\n\n for (i = 0; i < glyphsLength; ++i) {\n glyph = glyphs[i];\n if (typeof glyph === \"number\") {\n spacingLength = (spacingDir * glyph * fontSize) / 1000;\n this.ctx.translate(spacingLength, 0);\n current.x += spacingLength * textHScale;\n continue;\n }\n\n const spacing = (glyph.isSpace ? wordSpacing : 0) + charSpacing;\n const operatorList = font.charProcOperatorList.get(glyph.operatorListId);\n if (!operatorList) {\n warn(`Type3 character \"${glyph.operatorListId}\" is not available.`);\n } else if (this.contentVisible) {\n this.save();\n // A d0 (setCharWidth) glyph is colored (see Table 113 in pdf 1.7 specs)\n // unlike a d1 glyph painted as a stencil mask with the current fill\n // color. The constant alphas (ca/CA) are the opacity of that current\n // color, so they must not attenuate a d0 glyph.\n if (operatorList.fnArray[0] === OPS.setCharWidth) {\n current.fillAlpha = current.strokeAlpha = 1;\n ctx.globalAlpha = 1;\n }\n ctx.scale(fontSize, fontSize);\n ctx.transform(...fontMatrix);\n this.executeOperatorList(operatorList);\n this.restore();\n }\n\n const p = [glyph.width, 0];\n Util.applyTransform(p, fontMatrix);\n width = p[0] * fontSize + spacing;\n\n ctx.translate(width, 0);\n current.x += width * textHScale;\n }\n ctx.restore();\n if (dependencyTracker) {\n this.dependencyTracker = dependencyTracker;\n }\n }\n\n // Type3 fonts\n setCharWidth(opIdx, xWidth, yWidth) {\n // We can safely ignore this since the width should be the same\n // as the width in the Widths array.\n }\n\n setCharWidthAndBounds(opIdx, xWidth, yWidth, llx, lly, urx, ury) {\n const clip = new Path2D();\n clip.rect(llx, lly, urx - llx, ury - lly);\n this.ctx.clip(clip);\n this.dependencyTracker\n ?.recordBBox(opIdx, this.ctx, llx, urx, lly, ury)\n .recordClipBox(opIdx, this.ctx, llx, urx, lly, ury);\n this.endPath(opIdx);\n }\n\n // Color\n getColorN_Pattern(opIdx, IR) {\n let pattern;\n if (IR[0] === \"TilingPattern\") {\n const baseTransform = this.baseTransform || getCurrentTransform(this.ctx);\n const canvasGraphicsFactory = {\n createCanvasGraphics: (ctx, renderingOpIdx) =>\n new CanvasGraphics(\n ctx,\n this.commonObjs,\n this.objs,\n this.canvasFactory,\n this.filterFactory,\n {\n optionalContentConfig: this.optionalContentConfig,\n markedContentStack: this.markedContentStack,\n },\n undefined,\n undefined,\n this.dependencyTracker\n ? new CanvasNestedDependencyTracker(\n this.dependencyTracker,\n renderingOpIdx,\n /* ignoreBBoxes */ true\n )\n : null\n ),\n };\n pattern = new TilingPattern(\n IR,\n this.ctx,\n canvasGraphicsFactory,\n baseTransform\n );\n } else {\n pattern = this._getPattern(opIdx, IR[1], IR[2]);\n }\n return pattern;\n }\n\n setStrokeColorN(opIdx, ...args) {\n this.dependencyTracker?.recordSimpleData(\"strokeColor\", opIdx);\n this.current.strokeColor = this.getColorN_Pattern(opIdx, args);\n this.current.patternStroke = true;\n }\n\n setFillColorN(opIdx, ...args) {\n this.dependencyTracker?.recordSimpleData(\"fillColor\", opIdx);\n const pattern = (this.current.fillColor = this.getColorN_Pattern(\n opIdx,\n args\n ));\n this.current.patternFill = true;\n this.current.tilingPatternDims =\n pattern instanceof TilingPattern ? [0, 0, 0, 0] : null;\n }\n\n #transferColor(color) {\n return this.current.transferMapsFallback?.applyToColor(color) ?? color;\n }\n\n setStrokeRGBColor(opIdx, color) {\n this.dependencyTracker?.recordSimpleData(\"strokeColor\", opIdx);\n this.current.strokeColor = color;\n this.ctx.strokeStyle = this.#transferColor(color);\n this.current.patternStroke = false;\n }\n\n setStrokeTransparent(opIdx) {\n this.dependencyTracker?.recordSimpleData(\"strokeColor\", opIdx);\n this.ctx.strokeStyle = this.current.strokeColor = \"transparent\";\n this.current.patternStroke = false;\n }\n\n setFillRGBColor(opIdx, color) {\n this.dependencyTracker?.recordSimpleData(\"fillColor\", opIdx);\n this.current.fillColor = color;\n this.ctx.fillStyle = this.#transferColor(color);\n this.current.patternFill = false;\n this.current.tilingPatternDims = null;\n }\n\n setFillTransparent(opIdx) {\n this.dependencyTracker?.recordSimpleData(\"fillColor\", opIdx);\n this.ctx.fillStyle = this.current.fillColor = \"transparent\";\n this.current.patternFill = false;\n this.current.tilingPatternDims = null;\n }\n\n _getPattern(opIdx, objId, matrix = null) {\n const pattern = this.cachedPatterns.getOrInsertComputed(objId, () =>\n getShadingPattern(this.getObject(opIdx, objId))\n );\n if (matrix) {\n pattern.matrix = matrix;\n }\n return pattern;\n }\n\n shadingFill(opIdx, objId) {\n if (!this.contentVisible) {\n return;\n }\n const started = this.#beginKnockoutElement(this.current.fillAlpha);\n const ctx = this.ctx;\n\n this.save(opIdx);\n const pattern = this._getPattern(opIdx, objId);\n ctx.fillStyle = pattern.getPattern(\n ctx,\n this,\n getCurrentTransformInverse(ctx),\n PathType.SHADING,\n opIdx\n );\n\n const inv = getCurrentTransformInverse(ctx);\n if (inv) {\n const { width, height } = ctx.canvas;\n const minMax = F32_BBOX_INIT.slice();\n Util.axialAlignedBoundingBox([0, 0, width, height], inv, minMax);\n const [x0, y0, x1, y1] = minMax;\n\n this.ctx.fillRect(x0, y0, x1 - x0, y1 - y0);\n } else {\n // HACK to draw the gradient onto an infinite rectangle.\n // PDF gradients are drawn across the entire image while\n // Canvas only allows gradients to be drawn in a rectangle\n // The following bug should allow us to remove this.\n // https://bugzilla.mozilla.org/show_bug.cgi?id=664884\n\n this.ctx.fillRect(-1e10, -1e10, 2e10, 2e10);\n }\n\n this.dependencyTracker\n ?.resetBBox(opIdx)\n // TODO: Track proper bbox\n .recordFullPageBBox(opIdx)\n .recordDependencies(opIdx, Dependencies.transform)\n .recordDependencies(opIdx, Dependencies.fill)\n .recordOperation(opIdx);\n\n this.compose(this.current.getClippedPathBoundingBox());\n this.restore(opIdx);\n this.#endKnockoutElement(started);\n }\n\n // Images\n beginInlineImage() {\n unreachable(\"Should not call beginInlineImage\");\n }\n\n beginImageData() {\n unreachable(\"Should not call beginImageData\");\n }\n\n paintFormXObjectBegin(opIdx, matrix, bbox) {\n if (!this.contentVisible) {\n return;\n }\n this.save(opIdx);\n this.baseTransformStack.push(this.baseTransform);\n\n if (matrix) {\n this.transform(opIdx, ...matrix);\n }\n this.baseTransform = getCurrentTransform(this.ctx);\n\n if (bbox) {\n Util.axialAlignedBoundingBox(\n bbox,\n this.baseTransform,\n this.current.minMax\n );\n const [x0, y0, x1, y1] = bbox;\n const clip = new Path2D();\n clip.rect(x0, y0, x1 - x0, y1 - y0);\n this.ctx.clip(clip);\n this.dependencyTracker?.recordClipBox(opIdx, this.ctx, x0, x1, y0, y1);\n this.endPath(opIdx);\n }\n }\n\n paintFormXObjectEnd(opIdx) {\n if (!this.contentVisible) {\n return;\n }\n this.restore(opIdx);\n this.baseTransform = this.baseTransformStack.pop();\n }\n\n beginGroup(opIdx, group) {\n if (!this.contentVisible) {\n return;\n }\n\n this.save(opIdx);\n // If there's an active soft mask we don't want it enabled for the group, so\n // clear it out. The mask and suspended canvas will be restored in endGroup.\n const { inSMaskMode } = this;\n if (inSMaskMode) {\n this.endSMaskMode();\n this.current.activeSMask = null;\n }\n\n const currentCtx = this.ctx;\n if (\n // A non-isolated group blends with its backdrop, so drawing it directly\n // on the parent canvas (rather than on a transparent intermediate one)\n // is correct even when it contains blend modes (bug 1873345). A soft\n // mask still needs its own canvas though, and an isolated group requires\n // a transparent backdrop, so both keep the intermediate canvas.\n (!group.needsIsolation || (!group.isolated && !group.hasSoftMask)) &&\n !group.knockout &&\n !group.isGray &&\n this.#knockoutGroupLevel === 0 &&\n currentCtx.globalAlpha === 1 &&\n currentCtx.globalCompositeOperation === \"source-over\" &&\n !inSMaskMode\n ) {\n if (group.bbox) {\n let clip = new Path2D();\n const [x0, y0, x1, y1] = group.bbox;\n clip.rect(x0, y0, x1 - x0, y1 - y0);\n if (group.matrix) {\n const path = new Path2D();\n path.addPath(clip, new DOMMatrix(group.matrix));\n clip = path;\n }\n currentCtx.clip(clip);\n }\n // Unlike the intermediate-canvas path below, the content is drawn\n // straight onto the parent canvas with no later compositing step, so the\n // inherited blend mode, alpha constants and transfer function must stay\n // active here rather than being reset (issue 20722); the conditions\n // above already guarantee a Normal blend and an opaque (ca === 1) state.\n this.groupStack.push(null); // null = no intermediate canvas\n this.#groupStackMeta.push(null);\n this.groupLevel++;\n return;\n }\n\n // Reached only when the direct path above didn't apply, e.g. a soft mask,\n // non-default group alpha or blend mode: we still composite on a\n // transparent intermediate canvas rather than the real backdrop.\n if (!group.isolated && !group.knockout && this.#knockoutGroupLevel === 0) {\n info(\"TODO: Fully support non-isolated non-knockout groups.\");\n }\n\n const currentTransform = getCurrentTransform(currentCtx);\n if (group.matrix) {\n currentCtx.transform(...group.matrix);\n }\n\n // Clip the bounding box to the current canvas.\n const canvasBounds = [\n 0,\n 0,\n currentCtx.canvas.width,\n currentCtx.canvas.height,\n ];\n\n let bounds;\n if (group.bbox) {\n bounds = F32_BBOX_INIT.slice();\n Util.axialAlignedBoundingBox(\n group.bbox,\n getCurrentTransform(currentCtx),\n bounds\n );\n\n bounds = Util.intersect(bounds, canvasBounds) || [0, 0, 0, 0];\n } else {\n bounds = canvasBounds;\n }\n\n // Based on the current transform figure out how big the bounding box\n // will actually be.\n // Use ceil in case we're between sizes so we don't create canvas that is\n // too small and make the canvas at least 1x1 pixels.\n const offsetX = Math.floor(bounds[0]);\n const offsetY = Math.floor(bounds[1]);\n const drawnWidth = Math.max(Math.ceil(bounds[2]) - offsetX, 1);\n const drawnHeight = Math.max(Math.ceil(bounds[3]) - offsetY, 1);\n\n this.current.startNewPathAndClipBox([0, 0, drawnWidth, drawnHeight]);\n\n const scratchCanvas = this.canvasFactory.create(drawnWidth, drawnHeight);\n if (group.smask) {\n this.smaskGroupCanvases.push(scratchCanvas);\n }\n const groupCtx = scratchCanvas.context;\n // Non-isolated KO: keep a reference to the parent ctx (not a copy). It's\n // frozen while the group renders, so we can read from it on demand. The\n // backdrop is only restored under each element's footprint in\n // #compositeKnockoutSurface so it doesn't become part of the group\n // source itself.\n const backdropCtx = group.knockout && !group.isolated ? currentCtx : null;\n // Non-isolated non-KO subgroup inside a KO parent, with inner compositing\n // of its own: at endGroup we'll blend its elements against the outer KO\n // running canvas (also frozen), so just record the flag here and read\n // ctx.canvas at composite time.\n const hasInnerBackdrop =\n !group.isolated &&\n !group.knockout &&\n !group.smask &&\n group.needsIsolation &&\n this.#knockoutGroupLevel > 0;\n\n // Pool the per-element shape mask for the lifetime of this KO group.\n // Non-KO groups never call #compositeKnockoutSurface for their own\n // elements so the entry is unused there.\n const knockoutMaskEntry = group.knockout\n ? this.canvasFactory.create(drawnWidth, drawnHeight)\n : null;\n\n // For KO groups bump the level so inner elements get KO treatment; for\n // non-KO groups reset to 0 so an ancestor KO group doesn't apply to\n // them. Restored on endGroup.\n const savedKnockoutLevel = this.#knockoutGroupLevel;\n if (group.knockout) {\n this.#knockoutGroupLevel++;\n } else {\n this.#knockoutGroupLevel = 0;\n }\n\n // Since we created a new canvas that is just the size of the bounding box\n // we have to translate the group ctx.\n groupCtx.translate(-offsetX, -offsetY);\n groupCtx.transform(...currentTransform);\n\n const needsBackdropCopy =\n !group.isolated && !group.smask && group.needsIsolation;\n const replaceBackdrop =\n needsBackdropCopy &&\n !inSMaskMode &&\n savedKnockoutLevel === 0 &&\n !group.knockout &&\n !group.isGray &&\n group.hasSoftMask &&\n currentCtx.globalAlpha === 1 &&\n currentCtx.globalCompositeOperation === \"source-over\" &&\n this.current.transferMaps === \"none\" &&\n !this.current.transferMapsFallback;\n if (needsBackdropCopy && (inSMaskMode || replaceBackdrop)) {\n // A non-isolated group that needs isolation (because of an inner blend\n // mode and/or a soft mask) can't use the direct path above, so it\n // renders on a transparent intermediate canvas. Copy the current\n // backdrop into it so the inner blend modes (e.g. \"multiply\", \"screen\")\n // interact with the real background instead of transparency; otherwise a\n // /Multiply highlight, say, would be painted opaquely over the text\n // behind it, hiding it (bug 1873345 -- same as the direct path, but here\n // the soft mask forces an intermediate canvas).\n // This is needed both when entered from SMask mode and at the top level;\n // a non-isolated subgroup nested inside a knockout group instead gets its\n // backdrop through the hasInnerBackdrop path in endGroup, so it's\n // excluded here via savedKnockoutLevel.\n //\n // Outside SMask mode the copy is limited to a group that *would* have\n // qualified for the direct path (source-over, group alpha 1, not\n // knockout/gray) but was forced onto the intermediate canvas by its soft\n // mask (`hasSoftMask`). Restricting to that domain keeps the change\n // surgical:\n // - Only the soft-mask case is the bug 1873345 gap; a non-isolated\n // blend group pushed onto the intermediate canvas merely by a\n // non-default group alpha (no soft mask) is a separate pre-existing\n // case, left untouched to avoid changing its rendering (issue 13520).\n // - source-over/alpha 1 let endGroup replace the backdrop region with\n // the copied-and-updated result; compositing it normally would blend\n // partially transparent backdrop pixels twice. Under an outer blend\n // mode the outer blend would combine the backdrop with itself (e.g.\n // a /Multiply group with an inner soft mask darkens, issue 12798); a\n // non-1 group alpha would likewise mix the copied backdrop back in.\n // Those groups keep the transparent canvas and blend against the\n // real backdrop instead.\n // - isGray groups are grayscaled in endGroup, and inherited transfer\n // maps would also alter the copied backdrop.\n groupCtx.save();\n groupCtx.setTransform(1, 0, 0, 1, 0, 0);\n groupCtx.drawImage(currentCtx.canvas, -offsetX, -offsetY);\n groupCtx.restore();\n }\n\n // Apply the bbox to the group context.\n if (group.bbox) {\n let clip = new Path2D();\n const [x0, y0, x1, y1] = group.bbox;\n clip.rect(x0, y0, x1 - x0, y1 - y0);\n if (group.matrix) {\n const path = new Path2D();\n path.addPath(clip, new DOMMatrix(group.matrix));\n clip = path;\n }\n groupCtx.clip(clip);\n }\n\n if (group.smask) {\n // Saving state and cached mask to be used in setGState.\n this.smaskStack.push({\n canvas: scratchCanvas.canvas,\n context: groupCtx,\n offsetX,\n offsetY,\n subtype: group.smask.subtype,\n backdrop: group.smask.backdrop,\n transferMap: group.smask.transferMap || null,\n });\n }\n if (\n !group.smask ||\n // When this is not an SMask group, we only need to update the current\n // transform if recording operations bboxes, so they the bboxes have the\n // correct transform applied.\n this.dependencyTracker\n ) {\n // Setup the current ctx so when the group is popped we draw it at the\n // right location.\n currentCtx.setTransform(1, 0, 0, 1, 0, 0);\n currentCtx.translate(offsetX, offsetY);\n currentCtx.save();\n }\n // The transparency group inherits all off the current graphics state\n // except the blend mode, soft mask, and alpha constants.\n copyCtxState(currentCtx, groupCtx);\n this.ctx = groupCtx;\n this.dependencyTracker\n ?.inheritSimpleDataAsFutureForcedDependencies([\n \"fillAlpha\",\n \"strokeAlpha\",\n \"globalCompositeOperation\",\n ])\n .pushBaseTransform(currentCtx);\n this.setGState(opIdx, [\n [\"BM\", \"source-over\"],\n [\"ca\", 1],\n [\"CA\", 1],\n [\"TR\", null],\n ]);\n this.groupStack.push(currentCtx);\n this.#groupStackMeta.push({\n backdropCtx,\n savedKnockoutLevel,\n offsetX,\n offsetY,\n hasInnerBackdrop,\n replaceBackdrop,\n knockoutMaskEntry,\n // Per-group scratch pools, lazily filled and freed in endGroup.\n knockoutTempEntry: null,\n knockoutBackdropEntry: null,\n });\n this.groupLevel++;\n }\n\n endGroup(opIdx, group) {\n if (!this.contentVisible) {\n return;\n }\n this.groupLevel--;\n const groupCtx = this.ctx;\n const ctx = this.groupStack.pop();\n const groupMeta = this.#groupStackMeta.pop();\n // Restore the knockout level that was in effect before this group began.\n // Simple groups (groupMeta === null) never modify the level, so skip them.\n if (groupMeta) {\n this.#knockoutGroupLevel = groupMeta.savedKnockoutLevel;\n }\n if (ctx === null) {\n // Simple group: content was drawn directly on the parent canvas.\n this.restore(opIdx);\n return;\n }\n\n if (group.isGray) {\n // The group color space is gray (a single component), so its rendered\n // content must be converted to grayscale before being composited onto\n // the parent canvas, see issue 7998.\n this.#convertGroupToGray(groupCtx);\n }\n\n this.ctx = ctx;\n // Turn off image smoothing to avoid sub pixel interpolation which can\n // look kind of blurry for some pdfs.\n this.ctx.imageSmoothingEnabled = false;\n\n this.dependencyTracker?.popBaseTransform();\n\n if (group.smask) {\n this.tempSMask = this.smaskStack.pop();\n this.restore(opIdx);\n if (this.dependencyTracker) {\n this.ctx.restore();\n // beginSMaskMode() may have been called inside restore(opIdx) above\n // (via checkSMaskState), creating a fresh scratch canvas. If so,\n // the mirrored ctx.restore() just synced main's CTM but left the\n // scratch at the stale CTM set by beginSMaskMode(). Re-sync it.\n if (this.inSMaskMode) {\n this.ctx.setTransform(this.suspendedCtx.getTransform());\n }\n }\n this.#destroyKnockoutPools(groupMeta);\n } else {\n this.ctx.restore();\n const currentMtx = getCurrentTransform(this.ctx);\n this.restore(opIdx);\n // Canvas filters run below; fallback maps must run here.\n this.current.transferMapsFallback?.applyToCanvas(groupCtx);\n this.ctx.save();\n this.ctx.setTransform(...currentMtx);\n const dirtyBox = F32_BBOX_INIT.slice();\n Util.axialAlignedBoundingBox(\n [0, 0, groupCtx.canvas.width, groupCtx.canvas.height],\n currentMtx,\n dirtyBox\n );\n const parentGroupMeta = this.#groupStackMeta.at(-1);\n if (this.#knockoutGroupLevel > 0) {\n // The subgroup is one element of the enclosing KO group, so\n // composite it with KO semantics. Two coord systems below:\n // - `currentMtx` (`destTransform`) places the subgroup canvas in\n // the parent on the final draw, like the non-KO `drawImage`.\n // - `groupMeta.offsetX/Y` are the pixel origins beginGroup stored\n // when sizing the scratch; we use them (not `currentMtx[4]/[5]`,\n // which are PDF-transform components) to crop the backdrop.\n if (groupMeta.hasInnerBackdrop) {\n // Non-isolated subgroup inside a KO parent: blend the elements\n // against the subgroup's own initial backdrop for colour, but use\n // the elements-only scratch as the alpha mask so transparent\n // areas don't erase the parent. `ctx` is the outer KO canvas\n // (just popped); its pixels still match the subgroup's\n // beginGroup state since the subgroup draws to its own scratch.\n const { width, height } = groupCtx.canvas;\n const colorEntry = this.canvasFactory.create(width, height);\n const colorCtx = colorEntry.context;\n colorCtx.drawImage(\n ctx.canvas,\n groupMeta.offsetX,\n groupMeta.offsetY,\n width,\n height,\n 0,\n 0,\n width,\n height\n );\n colorCtx.globalCompositeOperation = \"source-over\";\n colorCtx.drawImage(groupCtx.canvas, 0, 0);\n // Clip colorEntry to the subgroup's element footprint so\n // backdrop pixels outside the elements don't bleed onto the\n // parent. Built with alpha=1 (no scaling) so the mask uses the\n // subgroup's composited painted alpha directly as shape - its\n // global gstate alpha gets applied at the final draw below. The\n // mask is sized to the subgroup canvas, so we can't reuse the\n // parent KO group's pooled mask here; allocate a fresh entry\n // and reuse it for both the destination-in and the\n // destination-out below.\n const shapeMaskEntry = this.#createKnockoutMaskCanvas(\n groupCtx.canvas\n );\n colorCtx.globalCompositeOperation = \"destination-in\";\n colorCtx.drawImage(shapeMaskEntry.canvas, 0, 0);\n // Inline the isolated-path compositing here so we can share\n // shapeMaskEntry with the destination-in above.\n const sourceCompositeOperation = this.ctx.globalCompositeOperation;\n const sourceAlpha = this.ctx.globalAlpha;\n const sourceFilter = this.ctx.filter;\n this.ctx.save();\n this.ctx.setTransform(...currentMtx);\n this.ctx.globalAlpha = 1;\n if (FeatureTest.isCanvasFilterSupported) {\n this.ctx.filter = \"none\";\n }\n this.ctx.globalCompositeOperation = \"destination-out\";\n this.ctx.drawImage(shapeMaskEntry.canvas, 0, 0);\n this.ctx.globalCompositeOperation = sourceCompositeOperation;\n this.ctx.globalAlpha = sourceAlpha;\n if (FeatureTest.isCanvasFilterSupported) {\n this.ctx.filter = sourceFilter ?? \"none\";\n }\n this.ctx.drawImage(colorEntry.canvas, 0, 0);\n this.ctx.restore();\n this.canvasFactory.destroy(shapeMaskEntry);\n this.canvasFactory.destroy(colorEntry);\n } else {\n // For a non-isolated KO parent the backdrop lives one level up.\n // Compound the parent's and subgroup's offsets to crop it.\n const backdropCtx = parentGroupMeta?.backdropCtx ?? null;\n this.#compositeKnockoutSurface(this.ctx, groupCtx.canvas, {\n backdropCanvas: backdropCtx?.canvas ?? null,\n destTransform: currentMtx,\n backdropOffset: backdropCtx\n ? [\n parentGroupMeta.offsetX + groupMeta.offsetX,\n parentGroupMeta.offsetY + groupMeta.offsetY,\n ]\n : [0, 0],\n sourceAlpha: this.ctx.globalAlpha,\n sourceFilter: this.ctx.filter,\n });\n }\n } else {\n if (groupMeta.replaceBackdrop) {\n // \"copy\" clears the destination outside the source within the\n // current clip, so limit it to the intermediate canvas bounds.\n const clip = new Path2D();\n clip.rect(0, 0, groupCtx.canvas.width, groupCtx.canvas.height);\n this.ctx.clip(clip);\n this.ctx.globalCompositeOperation = \"copy\";\n }\n this.ctx.drawImage(groupCtx.canvas, 0, 0);\n }\n this.ctx.restore();\n this.canvasFactory.destroy({\n canvas: groupCtx.canvas,\n context: groupCtx,\n });\n this.#destroyKnockoutPools(groupMeta);\n this.compose(dirtyBox);\n }\n }\n\n #convertGroupToGray(groupCtx) {\n const { canvas } = groupCtx;\n const { width, height } = canvas;\n\n if (FeatureTest.isCanvasFilterSupported) {\n // Draw the canvas onto itself with the grayscale filter applied (which\n // preserves the alpha channel), using the \"copy\" composite operation so\n // the filtered content fully replaces the original.\n groupCtx.save();\n groupCtx.setTransform(1, 0, 0, 1, 0, 0);\n groupCtx.filter = \"grayscale(1)\";\n groupCtx.globalAlpha = 1;\n groupCtx.globalCompositeOperation = \"copy\";\n groupCtx.drawImage(canvas, 0, 0);\n groupCtx.restore();\n return;\n }\n\n // Fallback when canvas filters aren't supported: convert each pixel to\n // grayscale by hand, using the same luminance coefficients as the\n // \"grayscale(1)\" filter while leaving the alpha channel untouched.\n const imageData = groupCtx.getImageData(0, 0, width, height);\n const { data } = imageData;\n for (let i = 0, ii = data.length; i < ii; i += 4) {\n const gray =\n (data[i] * 0.2126 + data[i + 1] * 0.7152 + data[i + 2] * 0.0722 + 0.5) |\n 0;\n data[i] = data[i + 1] = data[i + 2] = gray;\n }\n groupCtx.putImageData(imageData, 0, 0);\n }\n\n #destroyKnockoutPools(groupMeta) {\n if (!groupMeta) {\n return;\n }\n if (groupMeta.knockoutMaskEntry) {\n this.canvasFactory.destroy(groupMeta.knockoutMaskEntry);\n groupMeta.knockoutMaskEntry = null;\n }\n if (groupMeta.knockoutTempEntry) {\n this.canvasFactory.destroy(groupMeta.knockoutTempEntry);\n groupMeta.knockoutTempEntry = null;\n }\n if (groupMeta.knockoutBackdropEntry) {\n this.canvasFactory.destroy(groupMeta.knockoutBackdropEntry);\n groupMeta.knockoutBackdropEntry = null;\n }\n }\n\n beginAnnotation(\n opIdx,\n id,\n rect,\n transform,\n matrix,\n hasOwnCanvas,\n canvasName\n ) {\n // The annotations are drawn just after the page content.\n // The page content drawing can potentially have set a transform,\n // a clipping path, whatever...\n // So in order to have something clean, we restore the initial state.\n this.#restoreInitialState();\n resetCtxToDefault(this.ctx);\n\n this.ctx.save();\n this.save(opIdx);\n\n if (this.baseTransform) {\n this.ctx.setTransform(...this.baseTransform);\n }\n\n if (rect) {\n const width = rect[2] - rect[0];\n const height = rect[3] - rect[1];\n\n if (hasOwnCanvas && this.annotationCanvasMap) {\n transform = transform.slice();\n transform[4] -= rect[0];\n transform[5] -= rect[1];\n\n Util.singularValueDecompose2dScale(getCurrentTransform(this.ctx), XY);\n const { viewportScale } = this;\n const canvasWidth = Math.ceil(\n width * this.outputScaleX * viewportScale\n );\n const canvasHeight = Math.ceil(\n height * this.outputScaleY * viewportScale\n );\n\n this.annotationCanvas = this.canvasFactory.create(\n canvasWidth,\n canvasHeight\n );\n const { canvas, context } = this.annotationCanvas;\n if (canvasName) {\n const canvases = this.annotationCanvasMap.getOrInsertComputed(\n id,\n makeArr\n );\n canvas.setAttribute(\"data-canvas-name\", canvasName);\n // Replace any same-named canvas from a previous render so stale\n // low-resolution canvases don't pile up across zooms.\n const index = canvases.findIndex(\n c => c.getAttribute(\"data-canvas-name\") === canvasName\n );\n if (index === -1) {\n canvases.push(canvas);\n } else {\n canvases[index] = canvas;\n }\n } else {\n this.annotationCanvasMap.set(id, canvas);\n }\n this.annotationCanvas.savedCtx = this.ctx;\n this.ctx = context;\n this.ctx.save();\n this.ctx.setTransform(XY[0], 0, 0, -XY[1], 0, height * XY[1]);\n\n resetCtxToDefault(this.ctx);\n } else {\n resetCtxToDefault(this.ctx);\n\n // Consume a potential path before clipping.\n this.endPath(opIdx);\n\n const clip = new Path2D();\n clip.rect(rect[0], rect[1], width, height);\n this.ctx.clip(clip);\n }\n }\n\n this.current = new CanvasExtraState(\n this.ctx.canvas.width,\n this.ctx.canvas.height\n );\n\n this.baseTransformStack.push(this.baseTransform);\n this.transform(opIdx, ...transform);\n this.transform(opIdx, ...matrix);\n this.baseTransform = getCurrentTransform(this.ctx);\n }\n\n endAnnotation(opIdx) {\n if (this.annotationCanvas) {\n this.ctx.restore();\n this.#drawFilter();\n\n this.ctx = this.annotationCanvas.savedCtx;\n delete this.annotationCanvas.savedCtx;\n delete this.annotationCanvas;\n }\n this.baseTransform = this.baseTransformStack.pop();\n }\n\n paintImageMaskXObject(opIdx, img) {\n if (!this.contentVisible) {\n return;\n }\n\n const count = img.count;\n img = this.getObject(opIdx, img.data, img);\n img.count = count;\n\n const started = this.#beginKnockoutElement(this.current.fillAlpha);\n const ctx = this.ctx;\n const mask = this._createMaskCanvas(opIdx, img);\n const maskCanvas = mask.canvas;\n\n ctx.save();\n // The mask is drawn with the transform applied. Reset the current\n // transform to draw to the identity.\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n ctx.drawImage(maskCanvas, mask.offsetX, mask.offsetY);\n this.dependencyTracker\n ?.resetBBox(opIdx)\n .recordBBox(\n opIdx,\n this.ctx,\n mask.offsetX,\n mask.offsetX + maskCanvas.width,\n mask.offsetY,\n mask.offsetY + maskCanvas.height\n )\n .recordOperation(opIdx);\n ctx.restore();\n if (mask.canvasEntry) {\n this.canvasFactory.destroy(mask.canvasEntry);\n }\n this.compose();\n this.#endKnockoutElement(started);\n }\n\n paintImageMaskXObjectRepeat(\n opIdx,\n img,\n scaleX,\n skewX = 0,\n skewY = 0,\n scaleY,\n positions\n ) {\n if (!this.contentVisible) {\n return;\n }\n\n img = this.getObject(opIdx, img.data, img);\n\n const started = this.#beginKnockoutElement(this.current.fillAlpha);\n const ctx = this.ctx;\n ctx.save();\n const currentTransform = getCurrentTransform(ctx);\n ctx.transform(scaleX, skewX, skewY, scaleY, 0, 0);\n const mask = this._createMaskCanvas(opIdx, img);\n\n ctx.setTransform(\n 1,\n 0,\n 0,\n 1,\n mask.offsetX - currentTransform[4],\n mask.offsetY - currentTransform[5]\n );\n this.dependencyTracker?.resetBBox(opIdx);\n for (let i = 0, ii = positions.length; i < ii; i += 2) {\n const trans = Util.transform(currentTransform, [\n scaleX,\n skewX,\n skewY,\n scaleY,\n positions[i],\n positions[i + 1],\n ]);\n\n // Here we want to apply the transform at the origin,\n // hence no additional computation is necessary.\n ctx.drawImage(mask.canvas, trans[4], trans[5]);\n this.dependencyTracker?.recordBBox(\n opIdx,\n this.ctx,\n trans[4],\n trans[4] + mask.canvas.width,\n trans[5],\n trans[5] + mask.canvas.height\n );\n }\n ctx.restore();\n if (mask.canvasEntry) {\n this.canvasFactory.destroy(mask.canvasEntry);\n }\n this.compose();\n\n this.dependencyTracker?.recordOperation(opIdx);\n this.#endKnockoutElement(started);\n }\n\n paintImageMaskXObjectGroup(opIdx, images) {\n if (!this.contentVisible) {\n return;\n }\n const started = this.#beginKnockoutElement(this.current.fillAlpha);\n const ctx = this.ctx;\n\n const isPatternFill = this.current.patternFill;\n // Solid-color styles contain the transferred fallback value.\n const fillColor = isPatternFill ? this.current.fillColor : ctx.fillStyle;\n\n this.dependencyTracker\n ?.resetBBox(opIdx)\n .recordDependencies(opIdx, Dependencies.transformAndFill);\n\n for (const image of images) {\n const { data, width, height, transform } = image;\n\n const maskCanvas = this.canvasFactory.create(width, height);\n const maskCtx = maskCanvas.context;\n maskCtx.save();\n\n const img = this.getObject(opIdx, data, image);\n putBinaryImageMask(maskCtx, img);\n\n maskCtx.globalCompositeOperation = \"source-in\";\n\n maskCtx.fillStyle = isPatternFill\n ? fillColor.getPattern(\n maskCtx,\n this,\n getCurrentTransformInverse(ctx),\n PathType.FILL,\n opIdx\n )\n : fillColor;\n maskCtx.fillRect(0, 0, width, height);\n\n maskCtx.restore();\n\n ctx.save();\n ctx.transform(...transform);\n ctx.scale(1, -1);\n drawImageAtIntegerCoords(\n ctx,\n maskCanvas.canvas,\n 0,\n 0,\n width,\n height,\n 0,\n -1,\n 1,\n 1\n );\n this.canvasFactory.destroy(maskCanvas);\n\n this.dependencyTracker?.recordBBox(opIdx, ctx, 0, width, 0, height);\n ctx.restore();\n }\n this.compose();\n this.dependencyTracker?.recordOperation(opIdx);\n this.#endKnockoutElement(started);\n }\n\n paintImageXObject(opIdx, objId) {\n if (!this.contentVisible) {\n return;\n }\n const imgData = this.getObject(opIdx, objId);\n if (!imgData) {\n warn(\"Dependent image isn't ready yet\");\n return;\n }\n\n this.paintInlineImageXObject(opIdx, imgData);\n }\n\n paintImageXObjectRepeat(opIdx, objId, scaleX, scaleY, positions) {\n if (!this.contentVisible) {\n return;\n }\n const imgData = this.getObject(opIdx, objId);\n if (!imgData) {\n warn(\"Dependent image isn't ready yet\");\n return;\n }\n\n const width = imgData.width;\n const height = imgData.height;\n const map = [];\n for (let i = 0, ii = positions.length; i < ii; i += 2) {\n map.push({\n transform: [scaleX, 0, 0, scaleY, positions[i], positions[i + 1]],\n x: 0,\n y: 0,\n w: width,\n h: height,\n });\n }\n this.paintInlineImageXObjectGroup(opIdx, imgData, map);\n }\n\n applyTransferMapsToCanvas(ctx) {\n if (this.current.transferMaps !== \"none\") {\n ctx.filter = this.current.transferMaps;\n ctx.drawImage(ctx.canvas, 0, 0);\n ctx.filter = \"none\";\n } else {\n this.current.transferMapsFallback?.applyToCanvas(ctx);\n }\n return ctx.canvas;\n }\n\n applyTransferMapsToBitmap(imgData) {\n const { transferMaps, transferMapsFallback } = this.current;\n if (transferMaps === \"none\" && !transferMapsFallback) {\n return { img: imgData.bitmap, canvasEntry: null };\n }\n const { bitmap, width, height } = imgData;\n const tmpCanvas = this.canvasFactory.create(width, height);\n const tmpCtx = tmpCanvas.context;\n tmpCtx.filter = transferMaps;\n tmpCtx.drawImage(bitmap, 0, 0);\n tmpCtx.filter = \"none\";\n transferMapsFallback?.applyToCanvas(tmpCtx);\n\n return { img: tmpCanvas.canvas, canvasEntry: tmpCanvas };\n }\n\n paintInlineImageXObject(opIdx, imgData) {\n if (!this.contentVisible) {\n return;\n }\n const width = imgData.width;\n const height = imgData.height;\n const started = this.#beginKnockoutElement(this.current.fillAlpha);\n const ctx = this.ctx;\n\n this.save(opIdx);\n\n // The filter, if any, will be applied in applyTransferMapsToBitmap.\n // It must be applied to the image before rescaling else some artifacts\n // could appear.\n // The final restore will reset it to its value.\n const { filter } = ctx;\n if (filter !== \"none\" && filter !== \"\") {\n ctx.filter = \"none\";\n }\n\n // scale the image to the unit square\n ctx.scale(1 / width, -1 / height);\n\n let imgToPaint;\n let inlineImgCanvas = null;\n if (imgData.bitmap) {\n const result = this.applyTransferMapsToBitmap(imgData);\n imgToPaint = result.img;\n inlineImgCanvas = result.canvasEntry;\n } else {\n const tmpCanvas = this.canvasFactory.create(width, height);\n putBinaryImageData(tmpCanvas.context, imgData);\n imgToPaint = this.applyTransferMapsToCanvas(tmpCanvas.context);\n inlineImgCanvas = tmpCanvas;\n }\n\n const scaled = this._scaleImage(\n imgToPaint,\n getCurrentTransformInverse(ctx)\n );\n ctx.imageSmoothingEnabled = getImageSmoothingEnabled(\n getCurrentTransform(ctx),\n imgData.interpolate\n );\n\n if (this.dependencyTracker) {\n this.dependencyTracker\n .resetBBox(opIdx)\n .recordBBox(opIdx, ctx, 0, width, -height, 0)\n .recordDependencies(opIdx, Dependencies.imageXObject)\n .recordOperation(opIdx);\n this.imagesTracker?.record(\n ctx,\n width,\n height,\n this.dependencyTracker.clipBox\n );\n }\n\n drawImageAtIntegerCoords(\n ctx,\n scaled.img,\n 0,\n 0,\n scaled.paintWidth,\n scaled.paintHeight,\n 0,\n -height,\n width,\n height\n );\n if (scaled.tmpCanvas) {\n this.canvasFactory.destroy(scaled.tmpCanvas);\n }\n if (inlineImgCanvas) {\n this.canvasFactory.destroy(inlineImgCanvas);\n }\n this.compose();\n this.restore(opIdx);\n this.#endKnockoutElement(started);\n }\n\n paintInlineImageXObjectGroup(opIdx, imgData, map) {\n if (!this.contentVisible) {\n return;\n }\n const started = this.#beginKnockoutElement(this.current.fillAlpha);\n const ctx = this.ctx;\n let imgToPaint;\n let inlineImgCanvas = null;\n if (imgData.bitmap && !this.current.transferMapsFallback) {\n imgToPaint = imgData.bitmap;\n } else if (imgData.bitmap) {\n // Apply the fallback once before drawing the repeated copies.\n ({ img: imgToPaint, canvasEntry: inlineImgCanvas } =\n this.applyTransferMapsToBitmap(imgData));\n } else {\n const w = imgData.width;\n const h = imgData.height;\n\n const tmpCanvas = this.canvasFactory.create(w, h);\n putBinaryImageData(tmpCanvas.context, imgData);\n imgToPaint = this.applyTransferMapsToCanvas(tmpCanvas.context);\n inlineImgCanvas = tmpCanvas;\n }\n\n this.dependencyTracker?.resetBBox(opIdx);\n\n for (const entry of map) {\n ctx.save();\n ctx.transform(...entry.transform);\n ctx.scale(1, -1);\n drawImageAtIntegerCoords(\n ctx,\n imgToPaint,\n entry.x,\n entry.y,\n entry.w,\n entry.h,\n 0,\n -1,\n 1,\n 1\n );\n this.dependencyTracker?.recordBBox(opIdx, ctx, 0, 1, -1, 0);\n ctx.restore();\n }\n if (inlineImgCanvas) {\n this.canvasFactory.destroy(inlineImgCanvas);\n }\n this.dependencyTracker?.recordOperation(opIdx);\n this.compose();\n this.#endKnockoutElement(started);\n }\n\n paintSolidColorImageMask(opIdx) {\n if (!this.contentVisible) {\n return;\n }\n const started = this.#beginKnockoutElement(this.current.fillAlpha);\n this.dependencyTracker\n ?.resetBBox(opIdx)\n .recordBBox(opIdx, this.ctx, 0, 1, 0, 1)\n .recordDependencies(opIdx, Dependencies.fill)\n .recordOperation(opIdx);\n this.ctx.fillRect(0, 0, 1, 1);\n this.compose();\n this.#endKnockoutElement(started);\n }\n\n // Marked content\n\n markPoint(opIdx, tag) {\n // TODO Marked content.\n }\n\n markPointProps(opIdx, tag, properties) {\n // TODO Marked content.\n }\n\n beginMarkedContent(opIdx, tag) {\n this.dependencyTracker?.beginMarkedContent(opIdx);\n this.markedContentStack.push({\n visible: true,\n });\n }\n\n beginMarkedContentProps(opIdx, tag, properties) {\n this.dependencyTracker?.beginMarkedContent(opIdx);\n if (tag === \"OC\") {\n this.markedContentStack.push({\n visible: this.optionalContentConfig.isVisible(properties),\n });\n } else {\n this.markedContentStack.push({\n visible: true,\n });\n }\n this.contentVisible = this.isContentVisible();\n }\n\n endMarkedContent(opIdx) {\n this.dependencyTracker?.endMarkedContent(opIdx);\n this.markedContentStack.pop();\n this.contentVisible = this.isContentVisible();\n }\n\n // Compatibility\n\n beginCompat(opIdx) {\n // TODO ignore undefined operators (should we do that anyway?)\n }\n\n endCompat(opIdx) {\n // TODO stop ignoring undefined operators\n }\n\n // Helper functions\n\n consumePath(opIdx, path, clipBox) {\n const isEmpty = this.current.isEmptyClip();\n if (this.pendingClip) {\n this.current.updateClipFromPath();\n }\n if (!this.pendingClip) {\n this.compose(clipBox);\n }\n const ctx = this.ctx;\n if (this.pendingClip) {\n if (!isEmpty) {\n if (this.pendingClip === EO_CLIP) {\n ctx.clip(path, \"evenodd\");\n } else {\n ctx.clip(path);\n }\n }\n this.pendingClip = null;\n this.dependencyTracker\n ?.bboxToClipBoxDropOperation(opIdx)\n .recordFutureForcedDependency(\"clipPath\", opIdx);\n } else {\n this.dependencyTracker?.recordOperation(opIdx);\n }\n\n this.current.startNewPathAndClipBox(this.current.clipBox);\n }\n\n getSinglePixelWidth() {\n const m = getCurrentTransform(this.ctx);\n if (m[1] === 0 && m[2] === 0) {\n // Fast path\n return 1 / Math.min(Math.abs(m[0]), Math.abs(m[3]));\n }\n const absDet = Math.abs(m[0] * m[3] - m[2] * m[1]);\n const normX = Math.hypot(m[0], m[2]);\n const normY = Math.hypot(m[1], m[3]);\n return Math.max(normX, normY) / absDet;\n }\n\n getScaleForStroking() {\n // A pixel has thicknessX = thicknessY = 1;\n // A transformed pixel is a parallelogram and the thicknesses\n // corresponds to the heights.\n // The goal of this function is to rescale before setting the\n // lineWidth in order to have both thicknesses greater or equal\n // to 1 after transform.\n if (this._cachedScaleForStroking[0] === -1) {\n const { lineWidth } = this.current;\n const { a, b, c, d } = this.ctx.getTransform();\n let scaleX, scaleY;\n\n if (b === 0 && c === 0) {\n // Fast path\n const normX = Math.abs(a);\n const normY = Math.abs(d);\n if (normX === normY) {\n if (lineWidth === 0) {\n scaleX = scaleY = 1 / normX;\n } else {\n const scaledLineWidth = normX * lineWidth;\n scaleX = scaleY = scaledLineWidth < 1 ? 1 / scaledLineWidth : 1;\n }\n } else if (lineWidth === 0) {\n scaleX = 1 / normX;\n scaleY = 1 / normY;\n } else {\n const scaledXLineWidth = normX * lineWidth;\n const scaledYLineWidth = normY * lineWidth;\n scaleX = scaledXLineWidth < 1 ? 1 / scaledXLineWidth : 1;\n scaleY = scaledYLineWidth < 1 ? 1 / scaledYLineWidth : 1;\n }\n } else {\n // A pixel (base (x, y)) is transformed by M into a parallelogram:\n // - its area is |det(M)|;\n // - heightY (orthogonal to Mx) has a length: |det(M)| / norm(Mx);\n // - heightX (orthogonal to My) has a length: |det(M)| / norm(My).\n // heightX and heightY are the thicknesses of the transformed pixel\n // and they must be both greater or equal to 1.\n const absDet = Math.abs(a * d - b * c);\n const normX = Math.hypot(a, b);\n const normY = Math.hypot(c, d);\n if (lineWidth === 0) {\n scaleX = normY / absDet;\n scaleY = normX / absDet;\n } else {\n const baseArea = lineWidth * absDet;\n scaleX = normY > baseArea ? normY / baseArea : 1;\n scaleY = normX > baseArea ? normX / baseArea : 1;\n }\n }\n this._cachedScaleForStroking[0] = scaleX;\n this._cachedScaleForStroking[1] = scaleY;\n }\n return this._cachedScaleForStroking;\n }\n\n // Rescale before stroking in order to have a final lineWidth\n // with both thicknesses greater or equal to 1.\n rescaleAndStroke(path, saveRestore) {\n const {\n ctx,\n current: { lineWidth },\n } = this;\n const [scaleX, scaleY] = this.getScaleForStroking();\n\n if (scaleX === scaleY) {\n ctx.lineWidth = (lineWidth || 1) * scaleX;\n ctx.stroke(path);\n return;\n }\n const SCALE_MATRIX = (CanvasGraphics.#SCALE_MATRIX ??= new DOMMatrix());\n\n const dashes = ctx.getLineDash();\n if (saveRestore) {\n ctx.save();\n }\n\n ctx.scale(scaleX, scaleY);\n SCALE_MATRIX.a = 1 / scaleX;\n SCALE_MATRIX.d = 1 / scaleY;\n const newPath = new Path2D();\n newPath.addPath(path, SCALE_MATRIX);\n\n // How the dashed line is rendered depends on the current transform...\n // so we added a rescale to handle too thin lines and consequently\n // the way the line is dashed will be modified.\n // If scaleX === scaleY, the dashed lines will be rendered correctly\n // else we'll have some bugs (but only with too thin lines).\n // Here we take the max... why not taking the min... or something else.\n // Anyway, as said it's buggy when scaleX !== scaleY.\n if (dashes.length > 0) {\n const scale = Math.max(scaleX, scaleY);\n ctx.setLineDash(dashes.map(x => x / scale));\n ctx.lineDashOffset /= scale;\n }\n\n ctx.lineWidth = lineWidth || 1;\n ctx.stroke(newPath);\n\n if (saveRestore) {\n ctx.restore();\n }\n }\n\n isContentVisible() {\n for (let i = this.markedContentStack.length - 1; i >= 0; i--) {\n if (!this.markedContentStack[i].visible) {\n return false;\n }\n }\n return true;\n }\n}\n\nfor (const op in OPS) {\n if (CanvasGraphics.prototype[op] !== undefined) {\n CanvasGraphics.prototype[OPS[op]] = CanvasGraphics.prototype[op];\n }\n}\n\nexport { CanvasGraphics };\n","/* Copyright 2018 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { assert, unreachable } from \"./util.js\";\n\n/**\n * Interface that represents PDF data transport. If possible, it allows\n * progressively load entire or fragment of the PDF binary data.\n */\nclass BasePDFStream {\n #PDFStreamReader = null;\n\n #PDFStreamRangeReader = null;\n\n _fullReader = null;\n\n _rangeReaders = new Set();\n\n _source = null;\n\n constructor(source, PDFStreamReader, PDFStreamRangeReader) {\n if (\n (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) &&\n this.constructor === BasePDFStream\n ) {\n unreachable(\"Cannot initialize BasePDFStream.\");\n }\n this._source = source;\n\n this.#PDFStreamReader = PDFStreamReader;\n this.#PDFStreamRangeReader = PDFStreamRangeReader;\n }\n\n get _progressiveDataLength() {\n return this._fullReader?._loaded ?? 0;\n }\n\n /**\n * Gets a reader for the entire PDF data.\n * @returns {BasePDFStreamReader}\n */\n getFullReader() {\n assert(\n !this._fullReader,\n \"BasePDFStream.getFullReader can only be called once.\"\n );\n return (this._fullReader = new this.#PDFStreamReader(this));\n }\n\n /**\n * Gets a reader for the range of the PDF data.\n *\n * NOTE: Currently this method is only expected to be invoked *after*\n * the `BasePDFStreamReader.prototype.headersReady` promise has resolved.\n * @param {number} begin - the start offset of the data.\n * @param {number} end - the end offset of the data.\n * @returns {BasePDFStreamRangeReader}\n */\n getRangeReader(begin, end) {\n if (end <= this._progressiveDataLength) {\n return null;\n }\n const reader = new this.#PDFStreamRangeReader(this, begin, end);\n this._rangeReaders.add(reader);\n return reader;\n }\n\n /**\n * Cancels all opened reader and closes all their opened requests.\n * @param {object} reason - the reason for cancelling\n */\n cancelAllRequests(reason) {\n this._fullReader?.cancel(reason);\n\n // Always create a copy of the rangeReaders.\n for (const reader of new Set(this._rangeReaders)) {\n reader.cancel(reason);\n }\n }\n}\n\n/**\n * Interface for a PDF binary data reader.\n */\nclass BasePDFStreamReader {\n /**\n * Sets or gets the progress callback. The callback can be useful when the\n * isStreamingSupported property of the object is defined as false.\n * The callback is called with one parameter: an object with the loaded and\n * total properties.\n */\n onProgress = null;\n\n _contentLength = 0;\n\n _filename = null;\n\n _headersCapability = Promise.withResolvers();\n\n _isRangeSupported = false;\n\n _isStreamingSupported = false;\n\n _loaded = 0;\n\n _stream = null;\n\n constructor(stream) {\n if (\n (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) &&\n this.constructor === BasePDFStreamReader\n ) {\n unreachable(\"Cannot initialize BasePDFStreamReader.\");\n }\n this._stream = stream;\n }\n\n _callOnProgress() {\n this.onProgress?.({ loaded: this._loaded, total: this._contentLength });\n }\n\n /**\n * Gets a promise that is resolved when the headers and other metadata of\n * the PDF data stream are available.\n * @type {Promise}\n */\n get headersReady() {\n return this._headersCapability.promise;\n }\n\n /**\n * Gets the Content-Disposition filename. It is defined after the headersReady\n * promise is resolved.\n * @type {string|null} The filename, or `null` if the Content-Disposition\n * header is missing/invalid.\n */\n get filename() {\n return this._filename;\n }\n\n /**\n * Gets PDF binary data length. It is defined after the headersReady promise\n * is resolved.\n * @type {number} The data length (or 0 if unknown).\n */\n get contentLength() {\n return this._contentLength;\n }\n\n /**\n * Gets ability of the stream to handle range requests. It is defined after\n * the headersReady promise is resolved. Rejected when the reader is cancelled\n * or an error occurs.\n * @type {boolean}\n */\n get isRangeSupported() {\n return this._isRangeSupported;\n }\n\n /**\n * Gets ability of the stream to progressively load binary data. It is defined\n * after the headersReady promise is resolved.\n * @type {boolean}\n */\n get isStreamingSupported() {\n return this._isStreamingSupported;\n }\n\n /**\n * Requests a chunk of the binary data. The method returns the promise, which\n * is resolved into object with properties \"value\" and \"done\". If the done\n * is set to true, then the stream has reached its end, otherwise the value\n * contains binary data. Cancelled requests will be resolved with the done is\n * set to true.\n * @returns {Promise}\n */\n async read() {\n unreachable(\"Abstract method `read` called\");\n }\n\n /**\n * Cancels all pending read requests and closes the stream.\n * @param {object} reason\n */\n cancel(reason) {\n unreachable(\"Abstract method `cancel` called\");\n }\n}\n\n/**\n * Interface for a PDF binary data fragment reader.\n */\nclass BasePDFStreamRangeReader {\n _stream = null;\n\n constructor(stream, begin, end) {\n if (\n (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) &&\n this.constructor === BasePDFStreamRangeReader\n ) {\n unreachable(\"Cannot initialize BasePDFStreamRangeReader.\");\n }\n this._stream = stream;\n }\n\n /**\n * Requests a chunk of the binary data. The method returns the promise, which\n * is resolved into object with properties \"value\" and \"done\". If the done\n * is set to true, then the stream has reached its end, otherwise the value\n * contains binary data. Cancelled requests will be resolved with the done is\n * set to true.\n * @returns {Promise}\n */\n async read() {\n unreachable(\"Abstract method `read` called\");\n }\n\n /**\n * Cancels all pending read requests and closes the stream.\n * @param {object} reason\n */\n cancel(reason) {\n unreachable(\"Abstract method `cancel` called\");\n }\n}\n\nexport { BasePDFStream, BasePDFStreamRangeReader, BasePDFStreamReader };\n","/* Copyright 2017 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { stringToBytes } from \"../shared/util.js\";\n\n// This getFilenameFromContentDispositionHeader function is adapted from\n// https://github.com/Rob--W/open-in-browser/blob/7e2e35a38b8b4e981b11da7b2f01df0149049e92/extension/content-disposition.js\n// with the following changes:\n// - Modified to conform to PDF.js's coding style.\n// - Move return to the end of the function to prevent Babel from dropping the\n// function declarations.\n\n/**\n * Extract file name from the Content-Disposition HTTP response header.\n * @param {string} contentDisposition\n * @returns {string} Filename, if found in the Content-Disposition header.\n */\nfunction getFilenameFromContentDispositionHeader(contentDisposition) {\n let needsEncodingFixup = true;\n\n // filename*=ext-value (\"ext-value\" from RFC 5987, referenced by RFC 6266).\n let tmp = toParamRegExp(\"filename\\\\*\", \"i\").exec(contentDisposition);\n if (tmp) {\n tmp = tmp[1];\n let filename = rfc2616unquote(tmp);\n filename = unescape(filename);\n filename = rfc5987decode(filename);\n filename = rfc2047decode(filename);\n return fixupEncoding(filename);\n }\n\n // Continuations (RFC 2231 section 3, referenced by RFC 5987 section 3.1).\n // filename*n*=part\n // filename*n=part\n tmp = rfc2231getparam(contentDisposition);\n if (tmp) {\n // RFC 2047, section\n const filename = rfc2047decode(tmp);\n return fixupEncoding(filename);\n }\n\n // filename=value (RFC 5987, section 4.1).\n tmp = toParamRegExp(\"filename\", \"i\").exec(contentDisposition);\n if (tmp) {\n tmp = tmp[1];\n let filename = rfc2616unquote(tmp);\n filename = rfc2047decode(filename);\n return fixupEncoding(filename);\n }\n\n // After this line there are only function declarations. We cannot put\n // \"return\" here for readability because babel would then drop the function\n // declarations...\n function toParamRegExp(attributePattern, flags) {\n return new RegExp(\n \"(?:^|;)\\\\s*\" +\n attributePattern +\n \"\\\\s*=\\\\s*\" +\n // Captures: value = token | quoted-string\n // (RFC 2616, section 3.6 and referenced by RFC 6266 4.1)\n \"(\" +\n '[^\";\\\\s][^;\\\\s]*' +\n \"|\" +\n '\"(?:[^\"\\\\\\\\]|\\\\\\\\\"?)+\"?' +\n \")\",\n flags\n );\n }\n function textdecode(encoding, value) {\n if (encoding) {\n // eslint-disable-next-line no-control-regex\n if (!/^[\\x00-\\xFF]+$/.test(value)) {\n return value;\n }\n try {\n const decoder = new TextDecoder(encoding, { fatal: true });\n const buffer = stringToBytes(value);\n value = decoder.decode(buffer);\n needsEncodingFixup = false;\n } catch {\n // TextDecoder constructor threw - unrecognized encoding.\n }\n }\n return value;\n }\n function fixupEncoding(value) {\n if (needsEncodingFixup && /[\\x80-\\xff]/.test(value)) {\n // Maybe multi-byte UTF-8.\n value = textdecode(\"utf-8\", value);\n if (needsEncodingFixup) {\n // Try iso-8859-1 encoding.\n value = textdecode(\"iso-8859-1\", value);\n }\n }\n return value;\n }\n function rfc2231getparam(contentDispositionStr) {\n const matches = [];\n let match;\n // Iterate over all filename*n= and filename*n*= with n being an integer\n // of at least zero. Any non-zero number must not start with '0'.\n const iter = toParamRegExp(\"filename\\\\*((?!0\\\\d)\\\\d+)(\\\\*?)\", \"ig\");\n while ((match = iter.exec(contentDispositionStr)) !== null) {\n let [, n, quot, part] = match; // eslint-disable-line prefer-const\n n = parseInt(n, 10);\n if (n in matches) {\n // Ignore anything after the invalid second filename*0.\n if (n === 0) {\n break;\n }\n continue;\n }\n matches[n] = [quot, part];\n }\n const parts = [];\n for (let n = 0; n < matches.length; ++n) {\n if (!(n in matches)) {\n // Numbers must be consecutive. Truncate when there is a hole.\n break;\n }\n let [quot, part] = matches[n]; // eslint-disable-line prefer-const\n part = rfc2616unquote(part);\n if (quot) {\n part = unescape(part);\n if (n === 0) {\n part = rfc5987decode(part);\n }\n }\n parts.push(part);\n }\n return parts.join(\"\");\n }\n function rfc2616unquote(value) {\n if (value.startsWith('\"')) {\n const parts = value.slice(1).split('\\\\\"');\n // Find the first unescaped \" and terminate there.\n for (let i = 0; i < parts.length; ++i) {\n const quotindex = parts[i].indexOf('\"');\n if (quotindex !== -1) {\n parts[i] = parts[i].slice(0, quotindex);\n parts.length = i + 1; // Truncates and stop the iteration.\n }\n parts[i] = parts[i].replaceAll(/\\\\(.)/g, \"$1\");\n }\n value = parts.join('\"');\n }\n return value;\n }\n function rfc5987decode(extvalue) {\n // Decodes \"ext-value\" from RFC 5987.\n const encodingend = extvalue.indexOf(\"'\");\n if (encodingend === -1) {\n // Some servers send \"filename*=\" without encoding 'language' prefix,\n // e.g. in https://github.com/Rob--W/open-in-browser/issues/26\n // Let's accept the value like Firefox (57) (Chrome 62 rejects it).\n return extvalue;\n }\n const encoding = extvalue.slice(0, encodingend);\n const langvalue = extvalue.slice(encodingend + 1);\n // Ignore language (RFC 5987 section 3.2.1, and RFC 6266 section 4.1 ).\n const value = langvalue.replace(/^[^']*'/, \"\");\n return textdecode(encoding, value);\n }\n function rfc2047decode(value) {\n // RFC 2047-decode the result. Firefox tried to drop support for it, but\n // backed out because some servers use it - https://bugzil.la/875615\n // Firefox's condition for decoding is here: https://searchfox.org/mozilla-central/rev/4a590a5a15e35d88a3b23dd6ac3c471cf85b04a8/netwerk/mime/nsMIMEHeaderParamImpl.cpp#742-748\n\n // We are more strict and only recognize RFC 2047-encoding if the value\n // starts with \"=?\", since then it is likely that the full value is\n // RFC 2047-encoded.\n\n // Firefox also decodes words even where RFC 2047 section 5 states:\n // \"An 'encoded-word' MUST NOT appear within a 'quoted-string'.\"\n // eslint-disable-next-line no-control-regex\n if (!value.startsWith(\"=?\") || /[\\x00-\\x19\\x80-\\xff]/.test(value)) {\n return value;\n }\n // RFC 2047, section 2.4\n // encoded-word = \"=?\" charset \"?\" encoding \"?\" encoded-text \"?=\"\n // charset = token (but let's restrict to characters that denote a\n // possibly valid encoding).\n // encoding = q or b\n // encoded-text = any printable ASCII character other than ? or space.\n // ... but Firefox permits ? and space.\n return value.replaceAll(\n /=\\?([\\w-]*)\\?([QB])\\?((?:[^?]|\\?(?!=))*)\\?=/gi,\n function (matches, charset, encoding, text) {\n if (encoding === \"q\" || encoding === \"Q\") {\n // RFC 2047 section 4.2.\n text = text\n .replaceAll(\"_\", \" \")\n .replaceAll(/=([0-9a-f]{2})/gi, (_, hex) =>\n String.fromCharCode(parseInt(hex, 16))\n );\n return textdecode(charset, text);\n } // else encoding is b or B - base64 (RFC 2047 section 4.1)\n try {\n text = atob(text);\n } catch {}\n return textdecode(charset, text);\n }\n );\n }\n\n return \"\";\n}\n\nexport { getFilenameFromContentDispositionHeader };\n","/* Copyright 2012 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { assert, ResponseException } from \"../shared/util.js\";\nimport { getFilenameFromContentDispositionHeader } from \"./content_disposition.js\";\nimport { isPdfFile } from \"./display_utils.js\";\n\nfunction createHeaders(isHttp, httpHeaders) {\n const headers = new Headers();\n\n if (!isHttp || !httpHeaders || typeof httpHeaders !== \"object\") {\n return headers;\n }\n for (const key in httpHeaders) {\n const val = httpHeaders[key];\n if (val !== undefined) {\n headers.append(key, val);\n }\n }\n return headers;\n}\n\n// Trim the trailing whitespace of the raw response headers, but keep the\n// regular spaces (hence no `trimEnd`). Scanning backwards keeps this linear,\n// whereas a `$`-anchored regex is quadratic in the length of the run.\nfunction trimHeadersEnd(str) {\n let end = str.length;\n while (end > 0 && str[end - 1] !== \" \" && /\\s/.test(str[end - 1])) {\n end--;\n }\n return str.slice(0, end);\n}\n\nfunction getResponseOrigin(url) {\n // Notably, null is distinct from \"null\" string (e.g. from file:-URLs).\n return URL.parse(url)?.origin ?? null;\n}\n\nfunction validateRangeRequestCapabilities({\n responseHeaders,\n isHttp,\n rangeChunkSize,\n disableRange,\n}) {\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n assert(\n Number.isInteger(rangeChunkSize) && rangeChunkSize > 0,\n \"rangeChunkSize must be an integer larger than zero.\"\n );\n }\n const rv = {\n contentLength: 0,\n isRangeSupported: false,\n };\n\n const length = parseInt(responseHeaders.get(\"Content-Length\"), 10);\n if (!Number.isInteger(length)) {\n return rv;\n }\n rv.contentLength = length;\n\n if (length <= 2 * rangeChunkSize) {\n // The file size is smaller than the size of two chunks, so it does not\n // make any sense to abort the request and retry with a range request.\n return rv;\n }\n if (\n disableRange ||\n !isHttp ||\n responseHeaders.get(\"Accept-Ranges\") !== \"bytes\"\n ) {\n return rv;\n }\n\n const contentEncoding = responseHeaders.get(\"Content-Encoding\") || \"identity\";\n if (contentEncoding === \"identity\") {\n rv.isRangeSupported = true;\n }\n return rv;\n}\n\nfunction extractFilenameFromHeader(responseHeaders) {\n const contentDisposition = responseHeaders.get(\"Content-Disposition\");\n if (contentDisposition) {\n let filename = getFilenameFromContentDispositionHeader(contentDisposition);\n if (filename.includes(\"%\")) {\n try {\n filename = decodeURIComponent(filename);\n } catch {}\n }\n if (isPdfFile(filename)) {\n return filename;\n }\n }\n return null;\n}\n\nfunction createResponseError(status, url) {\n return new ResponseException(\n `Unexpected server response (${status}) while retrieving PDF \"${url.href}\".`,\n status,\n /* missing = */ status === 404 || (status === 0 && url.protocol === \"file:\")\n );\n}\n\nfunction ensureResponseOrigin(rangeOrigin, origin) {\n if (rangeOrigin !== origin) {\n throw new Error(\n `Expected range response-origin \"${rangeOrigin}\" to match \"${origin}\".`\n );\n }\n}\n\nexport {\n createHeaders,\n createResponseError,\n ensureResponseOrigin,\n extractFilenameFromHeader,\n getResponseOrigin,\n trimHeadersEnd,\n validateRangeRequestCapabilities,\n};\n","/* Copyright 2012 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { AbortException, assert } from \"../shared/util.js\";\nimport {\n BasePDFStream,\n BasePDFStreamRangeReader,\n BasePDFStreamReader,\n} from \"../shared/base_pdf_stream.js\";\nimport {\n createHeaders,\n createResponseError,\n ensureResponseOrigin,\n extractFilenameFromHeader,\n getResponseOrigin,\n validateRangeRequestCapabilities,\n} from \"./network_utils.js\";\n\nif (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n throw new Error(\n 'Module \"./fetch_stream.js\" shall not be used with MOZCENTRAL builds.'\n );\n}\n\nfunction fetchUrl(url, headers, withCredentials, abortController) {\n return fetch(url, {\n method: \"GET\",\n headers,\n signal: abortController.signal,\n mode: \"cors\",\n credentials: withCredentials ? \"include\" : \"same-origin\",\n redirect: \"follow\",\n });\n}\n\nfunction ensureResponseStatus(status, url) {\n if (status !== 200 && status !== 206) {\n throw createResponseError(status, url);\n }\n}\n\nfunction getArrayBuffer(val) {\n if (val instanceof Uint8Array) {\n return val.buffer;\n }\n if (val instanceof ArrayBuffer) {\n return val;\n }\n throw new Error(`getArrayBuffer - unexpected data: ${val}`);\n}\n\nclass PDFFetchStream extends BasePDFStream {\n _responseOrigin = null;\n\n constructor(source) {\n super(source, PDFFetchStreamReader, PDFFetchStreamRangeReader);\n const { httpHeaders, url } = source;\n\n assert(\n /https?:/.test(url.protocol),\n \"PDFFetchStream only supports http(s):// URLs.\"\n );\n this.headers = createHeaders(/* isHttp = */ true, httpHeaders);\n }\n}\n\nclass PDFFetchStreamReader extends BasePDFStreamReader {\n _abortController = new AbortController();\n\n _reader = null;\n\n constructor(stream) {\n super(stream);\n const {\n disableRange,\n disableStream,\n rangeChunkSize,\n url,\n withCredentials,\n } = stream._source;\n\n this._isStreamingSupported = !disableStream;\n // Always create a copy of the headers.\n const headers = new Headers(stream.headers);\n\n fetchUrl(url, headers, withCredentials, this._abortController)\n .then(response => {\n stream._responseOrigin = getResponseOrigin(response.url);\n\n ensureResponseStatus(response.status, url);\n this._reader = response.body.getReader();\n\n const responseHeaders = response.headers;\n\n const { contentLength, isRangeSupported } =\n validateRangeRequestCapabilities({\n responseHeaders,\n isHttp: true,\n rangeChunkSize,\n disableRange,\n });\n this._contentLength = contentLength;\n this._isRangeSupported = isRangeSupported;\n\n this._filename = extractFilenameFromHeader(responseHeaders);\n\n // We need to stop reading when range is supported and streaming is\n // disabled.\n if (!this._isStreamingSupported && this._isRangeSupported) {\n this.cancel(new AbortException(\"Streaming is disabled.\"));\n }\n\n this._headersCapability.resolve();\n })\n .catch(this._headersCapability.reject);\n }\n\n async read() {\n await this._headersCapability.promise;\n const { value, done } = await this._reader.read();\n if (done) {\n return { value, done };\n }\n this._loaded += value.byteLength;\n this._callOnProgress();\n\n return { value: getArrayBuffer(value), done: false };\n }\n\n cancel(reason) {\n this._reader?.cancel(reason);\n this._abortController.abort();\n }\n}\n\nclass PDFFetchStreamRangeReader extends BasePDFStreamRangeReader {\n _abortController = new AbortController();\n\n _readCapability = Promise.withResolvers();\n\n _reader = null;\n\n constructor(stream, begin, end) {\n super(stream, begin, end);\n const { url, withCredentials } = stream._source;\n\n // Always create a copy of the headers.\n const headers = new Headers(stream.headers);\n headers.append(\"Range\", `bytes=${begin}-${end - 1}`);\n\n fetchUrl(url, headers, withCredentials, this._abortController)\n .then(response => {\n const responseOrigin = getResponseOrigin(response.url);\n\n ensureResponseOrigin(responseOrigin, stream._responseOrigin);\n ensureResponseStatus(response.status, url);\n this._reader = response.body.getReader();\n\n this._readCapability.resolve();\n })\n .catch(this._readCapability.reject);\n }\n\n async read() {\n await this._readCapability.promise;\n const { value, done } = await this._reader.read();\n return done\n ? { value, done }\n : { value: getArrayBuffer(value), done: false };\n }\n\n cancel(reason) {\n this._reader?.cancel(reason);\n this._abortController.abort();\n }\n}\n\nexport { getArrayBuffer, PDFFetchStream };\n","/* Copyright 2012 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n BasePDFStream,\n BasePDFStreamRangeReader,\n BasePDFStreamReader,\n} from \"../shared/base_pdf_stream.js\";\nimport { assert } from \"../shared/util.js\";\nimport { isPdfFile } from \"./display_utils.js\";\n\nfunction getArrayBuffer(val) {\n // Prevent any possible issues by only transferring a Uint8Array that\n // completely \"utilizes\" its underlying ArrayBuffer.\n return val instanceof Uint8Array && val.byteLength === val.buffer.byteLength\n ? val.buffer\n : new Uint8Array(val).buffer;\n}\n\nfunction endRequests() {\n for (const capability of this._requests) {\n capability.resolve({ value: undefined, done: true });\n }\n this._requests.length = 0;\n}\n\nclass PDFDataTransportStream extends BasePDFStream {\n _progressiveDone = false;\n\n _queuedChunks = [];\n\n constructor(source) {\n super(\n source,\n PDFDataTransportStreamReader,\n PDFDataTransportStreamRangeReader\n );\n const { pdfDataRangeTransport } = source;\n const { initialData, progressiveDone } = pdfDataRangeTransport;\n\n if (initialData?.length > 0) {\n const buffer = getArrayBuffer(initialData);\n this._queuedChunks.push(buffer);\n }\n this._progressiveDone = progressiveDone;\n\n const listener = args => {\n switch (args.type) {\n case \"range\":\n case \"progressiveRead\":\n this.#onReceiveData(args.begin, args.chunk);\n break;\n case \"progressiveDone\":\n this._fullReader?.progressiveDone();\n this._progressiveDone = true;\n break;\n }\n };\n pdfDataRangeTransport.transportReady(listener);\n }\n\n #onReceiveData(begin, chunk) {\n const buffer = getArrayBuffer(chunk);\n\n if (begin === undefined) {\n if (this._fullReader) {\n this._fullReader._enqueue(buffer);\n } else {\n this._queuedChunks.push(buffer);\n }\n } else {\n const rangeReader = this._rangeReaders\n .keys()\n .find(r => r._begin === begin);\n\n assert(\n rangeReader,\n \"#onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.\"\n );\n rangeReader._enqueue(buffer);\n }\n }\n\n getFullReader() {\n const reader = super.getFullReader();\n this._queuedChunks = null;\n return reader;\n }\n\n getRangeReader(begin, end) {\n const reader = super.getRangeReader(begin, end);\n\n if (reader) {\n reader.onDone = () => this._rangeReaders.delete(reader);\n\n this._source.pdfDataRangeTransport.requestDataRange(begin, end);\n }\n return reader;\n }\n\n cancelAllRequests(reason) {\n super.cancelAllRequests(reason);\n\n this._source.pdfDataRangeTransport.abort();\n }\n}\n\nclass PDFDataTransportStreamReader extends BasePDFStreamReader {\n #endRequests = endRequests.bind(this);\n\n _done = false;\n\n _queuedChunks = null;\n\n _requests = [];\n\n constructor(stream) {\n super(stream);\n const { pdfDataRangeTransport, disableRange, disableStream } =\n stream._source;\n const { length, contentDispositionFilename } = pdfDataRangeTransport;\n\n this._queuedChunks = stream._queuedChunks || [];\n for (const chunk of this._queuedChunks) {\n this._loaded += chunk.byteLength;\n }\n this._done = stream._progressiveDone;\n\n this._contentLength = length;\n this._isStreamingSupported = !disableStream;\n this._isRangeSupported = !disableRange;\n\n if (isPdfFile(contentDispositionFilename)) {\n this._filename = contentDispositionFilename;\n }\n this._headersCapability.resolve();\n\n // Report loading progress when there is `initialData`, and `_enqueue` has\n // not been invoked, but with a small delay to give an `onProgress` callback\n // a chance to be registered first.\n const loaded = this._loaded;\n Promise.resolve().then(() => {\n if (loaded > 0 && this._loaded === loaded) {\n this._callOnProgress();\n }\n });\n }\n\n _enqueue(chunk) {\n if (this._done) {\n return; // Ignore new data.\n }\n if (this._requests.length > 0) {\n const capability = this._requests.shift();\n capability.resolve({ value: chunk, done: false });\n } else {\n this._queuedChunks.push(chunk);\n }\n this._loaded += chunk.byteLength;\n this._callOnProgress();\n }\n\n async read() {\n if (this._queuedChunks.length > 0) {\n const chunk = this._queuedChunks.shift();\n return { value: chunk, done: false };\n }\n if (this._done) {\n return { value: undefined, done: true };\n }\n const capability = Promise.withResolvers();\n this._requests.push(capability);\n return capability.promise;\n }\n\n cancel(reason) {\n this._done = true;\n this.#endRequests();\n }\n\n progressiveDone() {\n this._done ||= true;\n\n if (this._queuedChunks.length === 0) {\n this.#endRequests();\n }\n }\n}\n\nclass PDFDataTransportStreamRangeReader extends BasePDFStreamRangeReader {\n #endRequests = endRequests.bind(this);\n\n onDone = null;\n\n _begin = -1;\n\n _done = false;\n\n _queuedChunk = null;\n\n _requests = [];\n\n constructor(stream, begin, end) {\n super(stream, begin, end);\n this._begin = begin;\n }\n\n _enqueue(chunk) {\n if (this._done) {\n return; // ignore new data\n }\n if (this._requests.length === 0) {\n this._queuedChunk = chunk;\n } else {\n const capability = this._requests.shift();\n capability.resolve({ value: chunk, done: false });\n\n this.#endRequests();\n }\n this._done = true;\n this.onDone?.();\n }\n\n async read() {\n if (this._queuedChunk) {\n const chunk = this._queuedChunk;\n this._queuedChunk = null;\n return { value: chunk, done: false };\n }\n if (this._done) {\n return { value: undefined, done: true };\n }\n const capability = Promise.withResolvers();\n this._requests.push(capability);\n return capability.promise;\n }\n\n cancel(reason) {\n this._done = true;\n this.#endRequests();\n this.onDone?.();\n }\n}\n\nexport { endRequests, PDFDataTransportStream };\n","/* Copyright 2012 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { assert, stringToBytes, warn } from \"../shared/util.js\";\nimport {\n BasePDFStream,\n BasePDFStreamRangeReader,\n BasePDFStreamReader,\n} from \"../shared/base_pdf_stream.js\";\nimport {\n createHeaders,\n createResponseError,\n ensureResponseOrigin,\n extractFilenameFromHeader,\n getResponseOrigin,\n trimHeadersEnd,\n validateRangeRequestCapabilities,\n} from \"./network_utils.js\";\nimport { endRequests } from \"./transport_stream.js\";\n\nif (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n throw new Error(\n 'Module \"./network.js\" shall not be used with MOZCENTRAL builds.'\n );\n}\n\nconst OK_RESPONSE = 200;\nconst PARTIAL_CONTENT_RESPONSE = 206;\n\nfunction getArrayBuffer(val) {\n return typeof val !== \"string\" ? val : stringToBytes(val).buffer;\n}\n\nclass PDFNetworkStream extends BasePDFStream {\n #pendingRequests = new WeakMap();\n\n _responseOrigin = null;\n\n constructor(source) {\n super(source, PDFNetworkStreamReader, PDFNetworkStreamRangeReader);\n const { httpHeaders, url } = source;\n\n this.url = url;\n this.isHttp = /https?:/.test(url.protocol);\n this.headers = createHeaders(this.isHttp, httpHeaders);\n }\n\n /**\n * @ignore\n */\n _request(args) {\n const xhr = new XMLHttpRequest();\n const pendingRequest = {\n validateStatus: null,\n onHeadersReceived: args.onHeadersReceived,\n onDone: args.onDone,\n onError: args.onError,\n onProgress: args.onProgress,\n };\n this.#pendingRequests.set(xhr, pendingRequest);\n\n xhr.open(\"GET\", this.url);\n xhr.withCredentials = this._source.withCredentials;\n for (const [key, val] of this.headers) {\n xhr.setRequestHeader(key, val);\n }\n if (this.isHttp && \"begin\" in args && \"end\" in args) {\n xhr.setRequestHeader(\"Range\", `bytes=${args.begin}-${args.end - 1}`);\n\n // From http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.35.2:\n // \"A server MAY ignore the Range header\". This means it's possible to\n // get a 200 rather than a 206 response from a range request.\n pendingRequest.validateStatus = status =>\n status === PARTIAL_CONTENT_RESPONSE || status === OK_RESPONSE;\n } else {\n pendingRequest.validateStatus = status => status === OK_RESPONSE;\n }\n xhr.responseType = \"arraybuffer\";\n\n assert(args.onError, \"Expected `onError` callback to be provided.\");\n xhr.onerror = () => args.onError(xhr.status);\n xhr.onreadystatechange = this.#onStateChange.bind(this, xhr);\n xhr.onprogress = this.#onProgress.bind(this, xhr);\n\n xhr.send(null);\n\n return xhr;\n }\n\n #onProgress(xhr, evt) {\n const pendingRequest = this.#pendingRequests.get(xhr);\n pendingRequest?.onProgress?.(evt);\n }\n\n #onStateChange(xhr, evt) {\n const pendingRequest = this.#pendingRequests.get(xhr);\n if (!pendingRequest) {\n return; // Maybe abortRequest was called...\n }\n\n if (xhr.readyState >= 2 && pendingRequest.onHeadersReceived) {\n pendingRequest.onHeadersReceived();\n delete pendingRequest.onHeadersReceived;\n }\n\n if (xhr.readyState !== 4) {\n return;\n }\n\n if (!this.#pendingRequests.has(xhr)) {\n // The XHR request might have been aborted in onHeadersReceived()\n // callback, in which case we should abort request.\n return;\n }\n this.#pendingRequests.delete(xhr);\n\n // Success status == 0 can be on ftp, file and other protocols.\n if (xhr.status === 0 && this.isHttp) {\n pendingRequest.onError(xhr.status);\n return;\n }\n const xhrStatus = xhr.status || OK_RESPONSE;\n\n if (!pendingRequest.validateStatus(xhrStatus)) {\n pendingRequest.onError(xhr.status);\n return;\n }\n\n const chunk = getArrayBuffer(xhr.response);\n if (xhrStatus === PARTIAL_CONTENT_RESPONSE) {\n const rangeHeader = xhr.getResponseHeader(\"Content-Range\");\n if (/bytes \\d+-\\d+\\/\\d+/.test(rangeHeader)) {\n pendingRequest.onDone(chunk);\n } else {\n warn(`Missing or invalid \"Content-Range\" header.`);\n pendingRequest.onError(0);\n }\n } else if (chunk) {\n pendingRequest.onDone(chunk);\n } else {\n pendingRequest.onError(xhr.status);\n }\n }\n\n /**\n * Abort the request, if it's pending.\n * @ignore\n */\n _abortRequest(xhr) {\n if (this.#pendingRequests.has(xhr)) {\n this.#pendingRequests.delete(xhr);\n xhr.abort();\n }\n }\n\n getRangeReader(begin, end) {\n const reader = super.getRangeReader(begin, end);\n\n if (reader) {\n reader.onClosed = () => this._rangeReaders.delete(reader);\n }\n return reader;\n }\n}\n\nclass PDFNetworkStreamReader extends BasePDFStreamReader {\n #endRequests = endRequests.bind(this);\n\n _cachedChunks = [];\n\n _done = false;\n\n _requests = [];\n\n _storedError = null;\n\n constructor(stream) {\n super(stream);\n // Note that `XMLHttpRequest` doesn't support streaming, and range requests\n // will be enabled (if supported) in `this.#onHeadersReceived` below.\n\n this._fullRequestXhr = stream._request({\n onHeadersReceived: this.#onHeadersReceived.bind(this),\n onDone: this.#onDone.bind(this),\n onError: this.#onError.bind(this),\n onProgress: this.#onProgress.bind(this),\n });\n }\n\n #onHeadersReceived() {\n const stream = this._stream;\n const { disableRange, rangeChunkSize } = stream._source;\n const fullRequestXhr = this._fullRequestXhr;\n\n stream._responseOrigin = getResponseOrigin(fullRequestXhr.responseURL);\n\n const rawResponseHeaders = fullRequestXhr.getAllResponseHeaders();\n const responseHeaders = new Headers(\n rawResponseHeaders\n ? trimHeadersEnd(rawResponseHeaders.trimStart())\n .split(/[\\r\\n]+/)\n .map(x => {\n const [key, ...val] = x.split(\": \");\n return [key, val.join(\": \")];\n })\n : []\n );\n\n const { contentLength, isRangeSupported } =\n validateRangeRequestCapabilities({\n responseHeaders,\n isHttp: stream.isHttp,\n rangeChunkSize,\n disableRange,\n });\n this._contentLength = contentLength;\n this._isRangeSupported = isRangeSupported;\n\n this._filename = extractFilenameFromHeader(responseHeaders);\n\n if (this._isRangeSupported) {\n // NOTE: by cancelling the full request, and then issuing range\n // requests, there will be an issue for sites where you can only\n // request the pdf once. However, if this is the case, then the\n // server should not be returning that it can support range requests.\n stream._abortRequest(fullRequestXhr);\n }\n\n this._headersCapability.resolve();\n }\n\n #onDone(chunk) {\n if (this._requests.length > 0) {\n const capability = this._requests.shift();\n capability.resolve({ value: chunk, done: false });\n } else {\n this._cachedChunks.push(chunk);\n }\n this._done = true;\n if (this._cachedChunks.length === 0) {\n this.#endRequests();\n }\n }\n\n #onError(status) {\n this._storedError = createResponseError(status, this._stream.url);\n this._headersCapability.reject(this._storedError);\n for (const capability of this._requests) {\n capability.reject(this._storedError);\n }\n this._requests.length = 0;\n this._cachedChunks.length = 0;\n }\n\n #onProgress(evt) {\n this.onProgress?.({\n loaded: evt.loaded,\n total: evt.lengthComputable ? evt.total : this._contentLength,\n });\n }\n\n async read() {\n await this._headersCapability.promise;\n\n if (this._storedError) {\n throw this._storedError;\n }\n if (this._cachedChunks.length > 0) {\n const chunk = this._cachedChunks.shift();\n return { value: chunk, done: false };\n }\n if (this._done) {\n return { value: undefined, done: true };\n }\n const capability = Promise.withResolvers();\n this._requests.push(capability);\n return capability.promise;\n }\n\n cancel(reason) {\n this._done = true;\n this._headersCapability.reject(reason);\n this.#endRequests();\n\n this._stream._abortRequest(this._fullRequestXhr);\n this._fullRequestXhr = null;\n }\n}\n\nclass PDFNetworkStreamRangeReader extends BasePDFStreamRangeReader {\n #endRequests = endRequests.bind(this);\n\n onClosed = null;\n\n _done = false;\n\n _queuedChunk = null;\n\n _requests = [];\n\n _storedError = null;\n\n constructor(stream, begin, end) {\n super(stream, begin, end);\n\n this._requestXhr = stream._request({\n begin,\n end,\n onHeadersReceived: this.#onHeadersReceived.bind(this),\n onDone: this.#onDone.bind(this),\n onError: this.#onError.bind(this),\n onProgress: null,\n });\n }\n\n #onHeadersReceived() {\n const responseOrigin = getResponseOrigin(this._requestXhr?.responseURL);\n try {\n ensureResponseOrigin(responseOrigin, this._stream._responseOrigin);\n } catch (ex) {\n this._storedError = ex;\n this.#onError(0);\n }\n }\n\n #onDone(chunk) {\n if (this._requests.length > 0) {\n const capability = this._requests.shift();\n capability.resolve({ value: chunk, done: false });\n } else {\n this._queuedChunk = chunk;\n }\n this._done = true;\n this.#endRequests();\n this.onClosed?.();\n }\n\n #onError(status) {\n this._storedError ??= createResponseError(status, this._stream.url);\n for (const capability of this._requests) {\n capability.reject(this._storedError);\n }\n this._requests.length = 0;\n this._queuedChunk = null;\n }\n\n async read() {\n if (this._storedError) {\n throw this._storedError;\n }\n if (this._queuedChunk !== null) {\n const chunk = this._queuedChunk;\n this._queuedChunk = null;\n return { value: chunk, done: false };\n }\n if (this._done) {\n return { value: undefined, done: true };\n }\n const capability = Promise.withResolvers();\n this._requests.push(capability);\n return capability.promise;\n }\n\n cancel(reason) {\n this._done = true;\n this.#endRequests();\n\n this._stream._abortRequest(this._requestXhr);\n this.onClosed?.();\n }\n}\n\nexport { PDFNetworkStream };\n","/* Copyright 2012 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/* globals process */\n\nimport { AbortException, assert } from \"../shared/util.js\";\nimport {\n BasePDFStream,\n BasePDFStreamRangeReader,\n BasePDFStreamReader,\n} from \"../shared/base_pdf_stream.js\";\nimport { createResponseError } from \"./network_utils.js\";\nimport { getArrayBuffer } from \"./fetch_stream.js\";\n\nif (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n throw new Error(\n 'Module \"./node_stream.js\" shall not be used with MOZCENTRAL builds.'\n );\n}\n\nfunction getReadableStream(url, opts = null) {\n const fs = process.getBuiltinModule(\"fs\");\n const { Readable } = process.getBuiltinModule(\"stream\");\n\n const readStream = fs.createReadStream(url, opts);\n return Readable.toWeb(readStream);\n}\n\nclass PDFNodeStream extends BasePDFStream {\n constructor(source) {\n super(source, PDFNodeStreamReader, PDFNodeStreamRangeReader);\n const { url } = source;\n\n assert(\n url.protocol === \"file:\",\n \"PDFNodeStream only supports file:// URLs.\"\n );\n }\n}\n\nclass PDFNodeStreamReader extends BasePDFStreamReader {\n _reader = null;\n\n constructor(stream) {\n super(stream);\n const { disableRange, disableStream, rangeChunkSize, url } = stream._source;\n\n this._isStreamingSupported = !disableStream;\n\n const fs = process.getBuiltinModule(\"fs/promises\");\n fs.lstat(url)\n .then(stat => {\n const readableStream = getReadableStream(url);\n this._reader = readableStream.getReader();\n\n const { size } = stat;\n this._contentLength = size;\n // When the file size is smaller than the size of two chunks, it doesn't\n // make any sense to abort the request and retry with a range request.\n this._isRangeSupported = !disableRange && size > 2 * rangeChunkSize;\n\n // We need to stop reading when range is supported and streaming is\n // disabled.\n if (!this._isStreamingSupported && this._isRangeSupported) {\n this.cancel(new AbortException(\"Streaming is disabled.\"));\n }\n\n this._headersCapability.resolve();\n })\n .catch(error => {\n if (error.code === \"ENOENT\") {\n error = createResponseError(/* status = */ 0, url);\n }\n this._headersCapability.reject(error);\n });\n }\n\n async read() {\n await this._headersCapability.promise;\n const { value, done } = await this._reader.read();\n if (done) {\n return { value, done };\n }\n this._loaded += value.byteLength;\n this._callOnProgress();\n\n return { value: getArrayBuffer(value), done: false };\n }\n\n cancel(reason) {\n this._reader?.cancel(reason);\n }\n}\n\nclass PDFNodeStreamRangeReader extends BasePDFStreamRangeReader {\n _readCapability = Promise.withResolvers();\n\n _reader = null;\n\n constructor(stream, begin, end) {\n super(stream, begin, end);\n const { url } = stream._source;\n\n try {\n const readableStream = getReadableStream(url, {\n start: begin,\n end: end - 1,\n });\n this._reader = readableStream.getReader();\n\n this._readCapability.resolve();\n } catch (error) {\n this._readCapability.reject(error);\n }\n }\n\n async read() {\n await this._readCapability.promise;\n const { value, done } = await this._reader.read();\n return done\n ? { value, done }\n : { value: getArrayBuffer(value), done: false };\n }\n\n cancel(reason) {\n this._reader?.cancel(reason);\n }\n}\n\nexport { PDFNodeStream };\n","/* Copyright 2026 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { isNodeJS } from \"../shared/util.js\";\nimport { isValidFetchUrl } from \"./display_utils.js\";\nimport { PDFFetchStream } from \"./fetch_stream.js\";\nimport { PDFNetworkStream } from \"./network.js\";\nimport { PDFNodeStream } from \"./node_stream.js\";\n\nfunction getNetworkStream(url) {\n // eslint-disable-next-line no-nested-ternary\n return isValidFetchUrl(url)\n ? PDFFetchStream\n : typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"GENERIC\") && isNodeJS\n ? PDFNodeStream\n : PDFNetworkStream;\n}\n\nexport { getNetworkStream };\n","/* Copyright 2018 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nclass GlobalWorkerOptions {\n static #port = null;\n\n static #src = \"\";\n\n /**\n * @type {Worker | null}\n */\n static get workerPort() {\n return this.#port;\n }\n\n /**\n * @param {Worker | null} val - Defines global port for worker process.\n * Overrides the `workerSrc` option.\n */\n static set workerPort(val) {\n if (\n !(typeof Worker !== \"undefined\" && val instanceof Worker) &&\n val !== null\n ) {\n throw new Error(\"Invalid `workerPort` type.\");\n }\n this.#port = val;\n }\n\n /**\n * @type {string}\n */\n static get workerSrc() {\n return this.#src;\n }\n\n /**\n * @param {string} val - A string containing the path and filename of\n * the worker file.\n *\n * NOTE: The `workerSrc` option should always be set, in order to prevent\n * any issues when using the PDF.js library.\n */\n static set workerSrc(val) {\n if (typeof val !== \"string\") {\n throw new Error(\"Invalid `workerSrc` type.\");\n }\n this.#src = val;\n }\n}\n\nexport { GlobalWorkerOptions };\n","/* Copyright 2012 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nclass Metadata {\n #map;\n\n #data;\n\n constructor({ parsedData, rawData }) {\n this.#map = parsedData;\n this.#data = rawData;\n }\n\n getRaw() {\n return this.#data;\n }\n\n get(name) {\n return this.#map.get(name) ?? null;\n }\n\n [Symbol.iterator]() {\n return this.#map.entries();\n }\n}\n\nexport { Metadata };\n","/* Copyright 2020 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n info,\n RenderingIntentFlag,\n unreachable,\n warn,\n} from \"../shared/util.js\";\nimport { MurmurHash3_64 } from \"../shared/murmurhash3.js\";\n\nconst INTERNAL = Symbol(\"INTERNAL\");\n\nclass OptionalContentGroup {\n #isDisplay = false;\n\n #isPrint = false;\n\n #userSet = false;\n\n #visible = true;\n\n constructor(renderingIntent, { name, intent, usage, rbGroups }) {\n this.#isDisplay = !!(renderingIntent & RenderingIntentFlag.DISPLAY);\n this.#isPrint = !!(renderingIntent & RenderingIntentFlag.PRINT);\n\n this.name = name;\n this.intent = intent;\n this.usage = usage;\n this.rbGroups = rbGroups;\n }\n\n /**\n * @type {boolean}\n */\n get visible() {\n if (this.#userSet) {\n return this.#visible;\n }\n if (!this.#visible) {\n return false;\n }\n const { print, view } = this.usage;\n\n if (this.#isDisplay) {\n return view?.viewState !== \"OFF\";\n } else if (this.#isPrint) {\n return print?.printState !== \"OFF\";\n }\n return true;\n }\n\n /**\n * @ignore\n */\n _setVisible(internal, visible, userSet = false) {\n if (internal !== INTERNAL) {\n unreachable(\"Internal method `_setVisible` called.\");\n }\n this.#userSet = userSet;\n this.#visible = visible;\n }\n\n get serializable() {\n return {\n userSet: this.#userSet,\n visible: this.#visible,\n };\n }\n}\n\nclass OptionalContentConfig {\n #cachedGetHash = null;\n\n #groups = new Map();\n\n #initialHash = null;\n\n #order = null;\n\n #rawData;\n\n creator = null;\n\n name = null;\n\n constructor(\n data,\n renderingIntent = RenderingIntentFlag.DISPLAY,\n groupState = null // Should *only* be used with `fromSerializable`.\n ) {\n this.#rawData = data;\n this.renderingIntent = renderingIntent;\n\n if (data === null) {\n return;\n }\n this.name = data.name;\n this.creator = data.creator;\n this.#order = data.order;\n for (const group of data.groups) {\n this.#groups.set(\n group.id,\n new OptionalContentGroup(renderingIntent, group)\n );\n }\n\n if (groupState) {\n if (groupState.size !== this.#groups.size) {\n unreachable(\"Incorrect serialized groupState.\");\n }\n for (const [id, group] of groupState) {\n this.#groups\n .get(id)\n ._setVisible(INTERNAL, group.visible, group.userSet);\n }\n } else {\n if (data.baseState === \"OFF\") {\n for (const group of this.#groups.values()) {\n group._setVisible(INTERNAL, false);\n }\n }\n\n for (const on of data.on) {\n this.#groups.get(on)._setVisible(INTERNAL, true);\n }\n\n for (const off of data.off) {\n this.#groups.get(off)._setVisible(INTERNAL, false);\n }\n }\n\n // The following code must always run *last* in the constructor.\n this.#initialHash = this.getHash();\n }\n\n #evaluateVisibilityExpression(array) {\n const length = array.length;\n if (length < 2) {\n return true;\n }\n const operator = array[0];\n for (let i = 1; i < length; i++) {\n const element = array[i];\n let state;\n if (Array.isArray(element)) {\n state = this.#evaluateVisibilityExpression(element);\n } else if (this.#groups.has(element)) {\n state = this.#groups.get(element).visible;\n } else {\n warn(`Optional content group not found: ${element}`);\n return true;\n }\n switch (operator) {\n case \"And\":\n if (!state) {\n return false;\n }\n break;\n case \"Or\":\n if (state) {\n return true;\n }\n break;\n case \"Not\":\n return !state;\n default:\n return true;\n }\n }\n return operator === \"And\";\n }\n\n isVisible(group) {\n if (this.#groups.size === 0) {\n return true;\n }\n if (!group) {\n info(\"Optional content group not defined.\");\n return true;\n }\n if (group.type === \"OCG\") {\n if (!this.#groups.has(group.id)) {\n warn(`Optional content group not found: ${group.id}`);\n return true;\n }\n return this.#groups.get(group.id).visible;\n } else if (group.type === \"OCMD\") {\n // Per the spec, the expression should be preferred if available.\n if (group.expression) {\n return this.#evaluateVisibilityExpression(group.expression);\n }\n if (!group.policy || group.policy === \"AnyOn\") {\n // Default\n for (const id of group.ids) {\n if (!this.#groups.has(id)) {\n warn(`Optional content group not found: ${id}`);\n return true;\n }\n if (this.#groups.get(id).visible) {\n return true;\n }\n }\n return false;\n } else if (group.policy === \"AllOn\") {\n for (const id of group.ids) {\n if (!this.#groups.has(id)) {\n warn(`Optional content group not found: ${id}`);\n return true;\n }\n if (!this.#groups.get(id).visible) {\n return false;\n }\n }\n return true;\n } else if (group.policy === \"AnyOff\") {\n for (const id of group.ids) {\n if (!this.#groups.has(id)) {\n warn(`Optional content group not found: ${id}`);\n return true;\n }\n if (!this.#groups.get(id).visible) {\n return true;\n }\n }\n return false;\n } else if (group.policy === \"AllOff\") {\n for (const id of group.ids) {\n if (!this.#groups.has(id)) {\n warn(`Optional content group not found: ${id}`);\n return true;\n }\n if (this.#groups.get(id).visible) {\n return false;\n }\n }\n return true;\n }\n warn(`Unknown optional content policy ${group.policy}.`);\n return true;\n }\n warn(`Unknown group type ${group.type}.`);\n return true;\n }\n\n setVisibility(id, visible = true, preserveRB = true) {\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"WORKER_THREAD\")) {\n throw new Error(\"Not implemented: setVisibility\");\n }\n const group = this.#groups.get(id);\n if (!group) {\n warn(`Optional content group not found: ${id}`);\n return;\n }\n\n // If the visibility is about to be set to `true` and the group belongs to\n // any radiobutton groups, hide all other OCGs in these radiobutton groups,\n // provided that radiobutton state relationships are to be preserved.\n if (preserveRB && visible && group.rbGroups.length) {\n for (const rbGroup of group.rbGroups) {\n for (const otherId of rbGroup) {\n if (otherId !== id) {\n this.#groups.get(otherId)?._setVisible(INTERNAL, false, true);\n }\n }\n }\n }\n\n group._setVisible(INTERNAL, !!visible, /* userSet = */ true);\n\n this.#cachedGetHash = null;\n }\n\n setOCGState({ state, preserveRB }) {\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"WORKER_THREAD\")) {\n throw new Error(\"Not implemented: setOCGState\");\n }\n let operator;\n\n for (const elem of state) {\n switch (elem) {\n case \"ON\":\n case \"OFF\":\n case \"Toggle\":\n operator = elem;\n continue;\n }\n\n const group = this.#groups.get(elem);\n if (!group) {\n continue;\n }\n switch (operator) {\n case \"ON\":\n this.setVisibility(elem, true, preserveRB);\n break;\n case \"OFF\":\n this.setVisibility(elem, false, preserveRB);\n break;\n case \"Toggle\":\n this.setVisibility(elem, !group.visible, preserveRB);\n break;\n }\n }\n\n this.#cachedGetHash = null;\n }\n\n get hasInitialVisibility() {\n return this.#initialHash === null || this.getHash() === this.#initialHash;\n }\n\n getOrder() {\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"WORKER_THREAD\")) {\n throw new Error(\"Not implemented: getOrder\");\n }\n if (!this.#groups.size) {\n return null;\n }\n return this.#order ? this.#order.slice() : [...this.#groups.keys()];\n }\n\n getGroup(id) {\n return this.#groups.get(id) || null;\n }\n\n getHash() {\n if (this.#cachedGetHash !== null) {\n return this.#cachedGetHash;\n }\n const hash = new MurmurHash3_64();\n\n for (const [id, group] of this.#groups) {\n hash.update(`${id}:${group.visible}`);\n }\n return (this.#cachedGetHash = hash.hexdigest());\n }\n\n [Symbol.iterator]() {\n return this.#groups.entries();\n }\n\n get serializable() {\n const groupState = new Map();\n for (const [id, group] of this.#groups) {\n groupState.set(id, group.serializable);\n }\n\n return {\n data: this.#rawData,\n renderingIntent: this.renderingIntent,\n groupState,\n };\n }\n\n static fromSerializable({ data, renderingIntent, groupState }) {\n return new OptionalContentConfig(data, renderingIntent, groupState);\n }\n}\n\nexport { OptionalContentConfig };\n","/* Copyright 2026 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { makeArr } from \"../shared/util.js\";\nimport { MathClamp } from \"../shared/math_clamp.js\";\n\n/**\n * Maps between page IDs and page numbers, allowing bidirectional conversion\n * between the two representations. This is useful when the page numbering\n * in the PDF document doesn't match the default sequential ordering.\n *\n * When #pageNumberToId is null the mapping is the identity (page N has ID N).\n */\nclass PagesMapper {\n /**\n * Maps page positions (0-indexed) to their page IDs (1-indexed).\n * Null when the mapping is the identity.\n * @type {Uint32Array|null}\n */\n #pageNumberToId = null;\n\n /**\n * Previous page number for each position, used to track what happened to\n * each page after a mutation. Negative values indicate copied pages.\n * @type {Int32Array|null}\n */\n #prevPageNumbers = null;\n\n /** @type {number} */\n #pagesNumber = 0;\n\n /**\n * Clipboard state for copy/paste operations.\n * @type {{pageNumbers: Uint32Array, pageIds: Uint32Array}|null}\n */\n #clipboard = null;\n\n /** Saved state for undoing a delete. */\n #savedData = null;\n\n get pagesNumber() {\n return this.#pagesNumber;\n }\n\n set pagesNumber(n) {\n if (this.#pagesNumber === n) {\n return;\n }\n this.#pagesNumber = n;\n this.#pageNumberToId = null;\n this.#prevPageNumbers = null;\n }\n\n /**\n * Ensures the identity mapping is initialized.\n * Must be called before any mutation or before reading #pageNumberToId.\n */\n #ensureInit() {\n if (this.#pageNumberToId) {\n return;\n }\n const n = this.#pagesNumber;\n const pageNumberToId = (this.#pageNumberToId = new Uint32Array(n));\n for (let i = 0; i < n; i++) {\n pageNumberToId[i] = i + 1;\n }\n this.#prevPageNumbers = new Int32Array(pageNumberToId);\n }\n\n /**\n * Builds and returns the inverse map (id to page numbers) from\n * #pageNumberToId.\n * Since a page ID can appear multiple times (after a copy), the value is an\n * array of all page numbers that share that ID.\n * @returns {Map>}\n */\n #buildIdToPageNumber() {\n const idToPageNumber = new Map();\n const pageNumberToId = this.#pageNumberToId;\n for (let i = 0, ii = this.#pagesNumber; i < ii; i++) {\n const id = pageNumberToId[i];\n const pageNumbers = idToPageNumber.get(id);\n if (pageNumbers) {\n pageNumbers.push(i + 1);\n } else {\n idToPageNumber.set(id, [i + 1]);\n }\n }\n return idToPageNumber;\n }\n\n /**\n * Move a set of pages to a new position.\n * @param {Set} selectedPages - Page numbers being moved (1-indexed).\n * @param {number[]} pagesToMove - Ordered list of page numbers to move.\n * @param {number} index - Zero-based insertion index in the page-number list.\n */\n movePages(selectedPages, pagesToMove, index) {\n this.#ensureInit();\n const pageNumberToId = this.#pageNumberToId;\n const movedCount = pagesToMove.length;\n const mappedPagesToMove = new Uint32Array(movedCount);\n let removedBeforeTarget = 0;\n\n for (let i = 0; i < movedCount; i++) {\n const pageIndex = pagesToMove[i] - 1;\n mappedPagesToMove[i] = pageNumberToId[pageIndex];\n if (pageIndex < index) {\n removedBeforeTarget++;\n }\n }\n\n const pagesNumber = this.#pagesNumber;\n const remainingLen = pagesNumber - movedCount;\n const prevPageNumbers = new Int32Array(pagesNumber);\n const adjustedTarget = MathClamp(\n index - removedBeforeTarget,\n 0,\n remainingLen\n );\n\n // Compact: keep only non-moved pages.\n for (let i = 0, r = 0; i < pagesNumber; i++) {\n if (!selectedPages.has(i + 1)) {\n pageNumberToId[r] = pageNumberToId[i];\n prevPageNumbers[r++] = i + 1;\n }\n }\n\n // Make room at the target and insert.\n pageNumberToId.copyWithin(\n adjustedTarget + movedCount,\n adjustedTarget,\n remainingLen\n );\n pageNumberToId.set(mappedPagesToMove, adjustedTarget);\n prevPageNumbers.copyWithin(\n adjustedTarget + movedCount,\n adjustedTarget,\n remainingLen\n );\n prevPageNumbers.set(pagesToMove, adjustedTarget);\n this.#prevPageNumbers = prevPageNumbers;\n\n if (pageNumberToId.every((id, i) => id === i + 1)) {\n this.#pageNumberToId = null;\n }\n }\n\n /**\n * Deletes a set of pages.\n * @param {Array} pagesToDelete - Page numbers to delete (1-indexed),\n * unique and sorted ascending.\n */\n deletePages(pagesToDelete) {\n this.#ensureInit();\n const pageNumberToId = this.#pageNumberToId;\n const prevIdToPageNumber = this.#buildIdToPageNumber();\n\n this.#savedData = {\n pageNumberToId: pageNumberToId.slice(),\n pagesNumber: this.#pagesNumber,\n prevPageNumbers: this.#prevPageNumbers.slice(),\n };\n\n const newN = this.#pagesNumber - pagesToDelete.length;\n this.#pagesNumber = newN;\n const newPageNumberToId = (this.#pageNumberToId = new Uint32Array(newN));\n this.#prevPageNumbers = new Int32Array(newN);\n\n let sourceIndex = 0;\n let destIndex = 0;\n for (const pageNumber of pagesToDelete) {\n const pageIndex = pageNumber - 1;\n if (pageIndex !== sourceIndex) {\n newPageNumberToId.set(\n pageNumberToId.subarray(sourceIndex, pageIndex),\n destIndex\n );\n destIndex += pageIndex - sourceIndex;\n }\n sourceIndex = pageIndex + 1;\n }\n if (sourceIndex < pageNumberToId.length) {\n newPageNumberToId.set(pageNumberToId.subarray(sourceIndex), destIndex);\n }\n\n this.#updatePrevPageNumbers(prevIdToPageNumber, new Set(pagesToDelete));\n }\n\n cancelDelete() {\n if (this.#savedData) {\n this.#pageNumberToId = this.#savedData.pageNumberToId;\n this.#pagesNumber = this.#savedData.pagesNumber;\n this.#prevPageNumbers = this.#savedData.prevPageNumbers;\n this.#savedData = null;\n }\n }\n\n cleanSavedData() {\n this.#savedData = null;\n }\n\n /**\n * Records which pages are being copied so that pastePages can insert them.\n * @param {Uint32Array} pagesToCopy - Page numbers to copy (1-indexed).\n */\n copyPages(pagesToCopy) {\n this.#ensureInit();\n this.#clipboard = {\n pageNumbers: pagesToCopy,\n pageIds: pagesToCopy.map(n => this.#pageNumberToId[n - 1]),\n };\n }\n\n cancelCopy() {\n this.#clipboard = null;\n }\n\n /**\n * Inserts the previously copied pages at the given position.\n * @param {number} index - Zero-based insertion index in the page-number list.\n */\n pastePages(index) {\n this.#ensureInit();\n const pageNumberToId = this.#pageNumberToId;\n const prevIdToPageNumber = this.#buildIdToPageNumber();\n const { pageNumbers: copiedPageNumbers, pageIds: copiedPageIds } =\n this.#clipboard;\n\n const newN = this.#pagesNumber + copiedPageNumbers.length;\n this.#pagesNumber = newN;\n const newPageNumberToId = (this.#pageNumberToId = new Uint32Array(newN));\n this.#prevPageNumbers = new Int32Array(newN);\n\n newPageNumberToId.set(pageNumberToId.subarray(0, index), 0);\n newPageNumberToId.set(copiedPageIds, index);\n newPageNumberToId.set(\n pageNumberToId.subarray(index),\n index + copiedPageNumbers.length\n );\n\n this.#updatePrevPageNumbers(\n prevIdToPageNumber,\n null,\n index,\n copiedPageNumbers\n );\n this.#clipboard = null;\n }\n\n /**\n * Recomputes #prevPageNumbers after a mutation, using the pre-mutation\n * id to pageNumbers map to track where each page came from.\n * @param {Map>} prevIdToPageNumber - Id to pageNumbers\n * before the mutation.\n * @param {Set|null} [deletedPageNumbers] - Page numbers that were\n * deleted (so their old positions are skipped).\n * @param {number} [pasteIndex] - If this is a paste, the zero-based\n * insertion index; paired with copiedPageNumbers.\n * @param {Uint32Array} [copiedPageNumbers] - Source page numbers of the\n * pasted pages; paired with pasteIndex.\n */\n #updatePrevPageNumbers(\n prevIdToPageNumber,\n deletedPageNumbers = null,\n pasteIndex = -1,\n copiedPageNumbers = null\n ) {\n const prevPageNumbers = this.#prevPageNumbers;\n const newPageNumberToId = this.#pageNumberToId;\n const pasteEnd = pasteIndex + (copiedPageNumbers?.length ?? 0);\n const idsIndices = new Map();\n\n for (let i = 0, ii = this.#pagesNumber; i < ii; i++) {\n if (i >= pasteIndex && i < pasteEnd) {\n // Negative value signals this page is a copy; encodes its source.\n prevPageNumbers[i] = -copiedPageNumbers[i - pasteIndex];\n continue;\n }\n const id = newPageNumberToId[i];\n const oldPositions = prevIdToPageNumber.get(id);\n let j = idsIndices.get(id) || 0;\n if (deletedPageNumbers && oldPositions) {\n while (\n j < oldPositions.length &&\n deletedPageNumbers.has(oldPositions[j])\n ) {\n j++;\n }\n }\n prevPageNumbers[i] = oldPositions?.[j];\n idsIndices.set(id, j + 1);\n }\n }\n\n /**\n * Checks if the page mappings have been altered from their initial state.\n * @returns {boolean}\n */\n hasBeenAltered() {\n return this.#pageNumberToId !== null;\n }\n\n /**\n * Builds the copy level of every page. Extracted pages are ranked, in page\n * order, among the extracted pages sharing their page ID. Pages which aren't\n * extracted get -1.\n * @param {Array} [extractedPageNumbers] - Sorted 1-based page\n * numbers to extract, or null to extract everything.\n * @returns {Int32Array|null} null when the page mapping is the identity.\n */\n #buildCopyLevels(extractedPageNumbers = null) {\n if (!this.#pageNumberToId) {\n return null;\n }\n const copyLevels = new Int32Array(this.#pagesNumber).fill(-1);\n const counts = new Map();\n if (extractedPageNumbers) {\n for (const pageNumber of extractedPageNumbers) {\n const id = this.getPageId(pageNumber);\n const level = counts.get(id) ?? 0;\n counts.set(id, level + 1);\n copyLevels[pageNumber - 1] = level;\n }\n } else {\n for (let i = 0, ii = this.#pagesNumber; i < ii; i++) {\n const id = this.#pageNumberToId[i];\n const level = counts.get(id) ?? 0;\n counts.set(id, level + 1);\n copyLevels[i] = level;\n }\n }\n return copyLevels;\n }\n\n /**\n * Gets the current page mapping suitable for saving.\n * @param {Map>} [idToPageNumber]\n * @param {Int32Array} [copyLevels]\n * @returns {{pageInfos: Array, copyLevels: Int32Array | null}}\n */\n getPageMappingForSaving(\n idToPageNumber = null,\n copyLevels = this.#buildCopyLevels()\n ) {\n idToPageNumber ??= this.#buildIdToPageNumber();\n // idToPageNumber maps used 1-based IDs to 1-based page numbers.\n // For example if the final pdf contains page 3 twice and they are moved at\n // page 1 and 4, then it contains:\n // pageNumberToId = [3, ., ., 3, ...,]\n // idToPageNumber = {3: [1, 4], ...}\n // In such a case we need to take a page 3 from the original pdf and take\n // page 3 from a \"copy\".\n // So we need to pass to the api something like:\n // [ {\n // document: null // this pdf\n // includePages: [ 2, ... ], // page 3 is at index 2\n // pageIndices: [0, ...], // page 3 will be at index 0 in the new pdf\n // }, {\n // document: null // this pdf\n // includePages: [ 2, ... ], // page 3 is at index 2\n // pageIndices: [3, ...], // page 3 will be at index 3 in the new pdf\n // }\n // ]\n\n let nCopy = 0;\n for (const pageNumbers of idToPageNumber.values()) {\n nCopy = Math.max(nCopy, pageNumbers.length);\n }\n\n const extractParams = new Array(nCopy);\n for (let i = 0; i < nCopy; i++) {\n extractParams[i] = {\n document: null,\n pageIndices: [],\n includePages: [],\n };\n }\n\n for (const [id, pageNumbers] of idToPageNumber) {\n for (let i = 0, ii = pageNumbers.length; i < ii; i++) {\n extractParams[i].includePages.push([id - 1, pageNumbers[i] - 1]);\n }\n }\n\n for (const { includePages, pageIndices } of extractParams) {\n includePages.sort((a, b) => a[0] - b[0]);\n for (let i = 0, ii = includePages.length; i < ii; i++) {\n pageIndices.push(includePages[i][1]);\n includePages[i] = includePages[i][0];\n }\n }\n\n return { pageInfos: extractParams, copyLevels };\n }\n\n extractPages(extractedPageNumbers) {\n extractedPageNumbers = Array.from(extractedPageNumbers).sort(\n (a, b) => a - b\n );\n const usedIds = new Map();\n for (let i = 0, ii = extractedPageNumbers.length; i < ii; i++) {\n const id = this.getPageId(extractedPageNumbers[i]);\n const usedPageNumbers = usedIds.getOrInsertComputed(id, makeArr);\n usedPageNumbers.push(i + 1);\n }\n return this.getPageMappingForSaving(\n usedIds,\n this.#buildCopyLevels(extractedPageNumbers)\n );\n }\n\n /**\n * Gets the previous page number for a given page number.\n * Negative values indicate a copied page (the absolute value is the source).\n * @param {number} pageNumber\n * @returns {number}\n */\n getPrevPageNumber(pageNumber) {\n return this.#prevPageNumbers?.[pageNumber - 1] ?? 0;\n }\n\n /**\n * Gets the first page number that currently maps to the given page ID.\n * @param {number} id - The page ID (1-indexed).\n * @returns {number} The page number, or 0 if not found.\n */\n getPageNumber(id) {\n if (!this.#pageNumberToId) {\n return id; // identity mapping\n }\n const pageNumberToId = this.#pageNumberToId;\n for (let i = 0, ii = this.#pagesNumber; i < ii; i++) {\n if (pageNumberToId[i] === id) {\n return i + 1;\n }\n }\n return 0;\n }\n\n /**\n * Gets the page ID for a given page number.\n * @param {number} pageNumber - The page number (1-indexed).\n * @returns {number} The page ID, or the page number itself if no mapping\n * exists.\n */\n getPageId(pageNumber) {\n return this.#pageNumberToId?.[pageNumber - 1] ?? pageNumber;\n }\n\n getMapping() {\n return this.#pageNumberToId?.subarray(0, this.pagesNumber);\n }\n}\n\nexport { PagesMapper };\n","/* Copyright 2012 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nconst INITIAL_DATA = Symbol(\"INITIAL_DATA\");\n\nconst dataObj = () => ({\n ...Promise.withResolvers(),\n data: INITIAL_DATA,\n});\n\n/**\n * A PDF document and page is built of many objects. E.g. there are objects for\n * fonts, images, rendering code, etc. These objects may get processed inside of\n * a worker. This class implements some basic methods to manage these objects.\n */\nclass PDFObjects {\n #objs = new Map();\n\n /**\n * If called *without* callback, this returns the data of `objId` but the\n * object needs to be resolved. If it isn't, this method throws.\n *\n * If called *with* a callback, the callback is called with the data of the\n * object once the object is resolved. That means, if you call this method\n * and the object is already resolved, the callback gets called right away.\n * @param {string} objId\n * @param {Function} [callback]\n * @returns {any}\n */\n get(objId, callback = null) {\n // If there is a callback, then the get can be async and the object is\n // not required to be resolved right now.\n if (callback) {\n const obj = this.#objs.getOrInsertComputed(objId, dataObj);\n obj.promise.then(() => callback(obj.data));\n return null;\n }\n // If there isn't a callback, the user expects to get the resolved data\n // directly.\n const obj = this.#objs.get(objId);\n // If there isn't an object yet or the object isn't resolved, then the\n // data isn't ready yet!\n if (!obj || obj.data === INITIAL_DATA) {\n throw new Error(`Requesting object that isn't resolved yet ${objId}.`);\n }\n return obj.data;\n }\n\n /**\n * @param {string} objId\n * @returns {boolean}\n */\n has(objId) {\n const obj = this.#objs.get(objId);\n return !!obj && obj.data !== INITIAL_DATA;\n }\n\n /**\n * @param {string} objId\n * @returns {boolean}\n */\n delete(objId) {\n const obj = this.#objs.get(objId);\n if (!obj || obj.data === INITIAL_DATA) {\n // Only allow removing the object *after* it's been resolved.\n return false;\n }\n this.#objs.delete(objId);\n return true;\n }\n\n /**\n * Resolves the object `objId` with optional `data`.\n * @param {string} objId\n * @param {any} [data]\n */\n resolve(objId, data = null) {\n const obj = this.#objs.getOrInsertComputed(objId, dataObj);\n if (obj.data !== INITIAL_DATA) {\n throw new Error(`Object already resolved ${objId}.`);\n }\n obj.data = data;\n obj.resolve();\n }\n\n clear() {\n for (const { data } of this.#objs.values()) {\n data?.bitmap?.close(); // Release any `ImageBitmap` data.\n }\n this.#objs.clear();\n }\n\n *[Symbol.iterator]() {\n for (const [objId, { data }] of this.#objs) {\n if (data !== INITIAL_DATA) {\n yield [objId, data];\n }\n }\n }\n}\n\nexport { PDFObjects };\n","/* Copyright 2015 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/** @typedef {import(\"./page_viewport\").PageViewport} PageViewport */\n/** @typedef {import(\"./api\").TextContent} TextContent */\n/** @typedef {import(\"./text_layer_images\").TextLayerImages} TextLayerImages */\n\nimport {\n AbortException,\n FeatureTest,\n shadow,\n Util,\n warn,\n} from \"../shared/util.js\";\nimport { OutputScale, setLayerDimensions } from \"./display_utils.js\";\n\n/**\n * @typedef {object} TextLayerParameters\n * @property {ReadableStream | TextContent} textContentSource - Text content to\n * render, i.e. the value returned by the page's `streamTextContent` or\n * `getTextContent` method.\n * @property {HTMLElement} container - The DOM node that will contain the text\n * runs.\n * @property {PageViewport} viewport - The target viewport to properly layout\n * the text runs.\n * @property {TextLayerImages} [images] - An optional TextLayerImages instance\n * that handles right clicking on images.\n */\n\n/**\n * @typedef {object} TextLayerUpdateParameters\n * @property {PageViewport} viewport - The target viewport to properly layout\n * the text runs.\n * @property {Function} [onBefore] - Callback invoked before the textLayer is\n * updated in the DOM.\n */\n\nconst MAX_TEXT_DIVS_TO_RENDER = 100000;\nconst DEFAULT_FONT_SIZE = 30;\n\nclass TextLayer {\n #capability = Promise.withResolvers();\n\n #container = null;\n\n #disableProcessItems = false;\n\n #fontInspectorEnabled = !!globalThis.FontInspector?.enabled;\n\n #imagesHandler = null;\n\n #lang = null;\n\n #layoutTextParams = null;\n\n #pageHeight = 0;\n\n #pageWidth = 0;\n\n #pixelRatio = OutputScale.pixelRatio;\n\n #reader = null;\n\n #rootContainer = null;\n\n #rotation = 0;\n\n #scale = 0;\n\n #styleCache = Object.create(null);\n\n #textContentItemsStr = [];\n\n #textContentSource = null;\n\n #textDivs = [];\n\n #textDivProperties = new WeakMap();\n\n #transform = null;\n\n static #ascentCache = new Map();\n\n static #canvasContexts = new Map();\n\n static #canvasCtxFonts = new WeakMap();\n\n static #minFontSize = null;\n\n static #pendingTextLayers = new Set();\n\n /**\n * @param {TextLayerParameters} options\n */\n constructor({ textContentSource, images, container, viewport }) {\n if (textContentSource instanceof ReadableStream) {\n this.#textContentSource = textContentSource;\n } else if (\n (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) &&\n typeof textContentSource === \"object\"\n ) {\n this.#textContentSource = new ReadableStream({\n start(controller) {\n controller.enqueue(textContentSource);\n controller.close();\n },\n });\n } else {\n throw new Error('No \"textContentSource\" parameter specified.');\n }\n this.#container = this.#rootContainer = container;\n\n this.#imagesHandler = images;\n\n this.#scale = viewport.scale * this.#pixelRatio;\n this.#rotation = viewport.rotation;\n this.#layoutTextParams = {\n div: null,\n properties: null,\n ctx: null,\n };\n const { pageWidth, pageHeight, pageX, pageY } = viewport.rawDims;\n this.#transform = [1, 0, 0, -1, -pageX, pageY + pageHeight];\n this.#pageWidth = pageWidth;\n this.#pageHeight = pageHeight;\n\n TextLayer.#ensureMinFontSizeComputed();\n container.style.setProperty(\"--min-font-size\", TextLayer.#minFontSize);\n\n setLayerDimensions(container, viewport);\n\n // Always clean-up the temporary canvas once rendering is no longer pending.\n this.#capability.promise\n .finally(() => {\n TextLayer.#pendingTextLayers.delete(this);\n this.#layoutTextParams = null;\n this.#styleCache = null;\n })\n .catch(() => {\n // Avoid \"Uncaught promise\" messages in the console.\n });\n\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n // For testing purposes.\n Object.defineProperty(this, \"pageWidth\", {\n get() {\n return this.#pageWidth;\n },\n });\n Object.defineProperty(this, \"pageHeight\", {\n get() {\n return this.#pageHeight;\n },\n });\n }\n }\n\n static get fontFamilyMap() {\n const { isWindows, isFirefox } = FeatureTest.platform;\n return shadow(\n this,\n \"fontFamilyMap\",\n new Map([\n [\n \"sans-serif\",\n `${isWindows && isFirefox ? \"Calibri, \" : \"\"}sans-serif`,\n ],\n [\n \"monospace\",\n `${isWindows && isFirefox ? \"Lucida Console, \" : \"\"}monospace`,\n ],\n ])\n );\n }\n\n /**\n * Render the textLayer.\n * @returns {Promise}\n */\n render() {\n if (this.#imagesHandler) {\n this.#container.append(this.#imagesHandler.render());\n }\n\n const pump = () => {\n this.#reader.read().then(({ value, done }) => {\n if (done) {\n this.#capability.resolve();\n return;\n }\n this.#lang ??= value.lang;\n Object.assign(this.#styleCache, value.styles);\n this.#processItems(value.items);\n pump();\n }, this.#capability.reject);\n };\n this.#reader = this.#textContentSource.getReader();\n TextLayer.#pendingTextLayers.add(this);\n pump();\n\n return this.#capability.promise;\n }\n\n /**\n * Update a previously rendered textLayer, if necessary.\n * @param {TextLayerUpdateParameters} options\n * @returns {undefined}\n */\n update({ viewport, onBefore = null }) {\n const scale = viewport.scale * OutputScale.pixelRatio;\n const rotation = viewport.rotation;\n\n if (rotation !== this.#rotation) {\n onBefore?.();\n this.#rotation = rotation;\n setLayerDimensions(this.#rootContainer, { rotation });\n }\n\n if (scale !== this.#scale) {\n onBefore?.();\n this.#scale = scale;\n this.#pixelRatio = OutputScale.pixelRatio;\n const params = {\n div: null,\n properties: null,\n ctx: TextLayer.#getCtx(this.#lang),\n };\n for (const div of this.#textDivs) {\n params.properties = this.#textDivProperties.get(div);\n params.div = div;\n this.#layout(params);\n }\n }\n }\n\n /**\n * Cancel rendering of the textLayer.\n * @returns {undefined}\n */\n cancel() {\n const abortEx = new AbortException(\"TextLayer task cancelled.\");\n\n this.#reader?.cancel(abortEx).catch(() => {\n // Avoid \"Uncaught promise\" messages in the console.\n });\n this.#reader = null;\n\n this.#capability.reject(abortEx);\n }\n\n /**\n * @type {Array} HTML elements that correspond to the text items\n * of the textContent input.\n * This is output and will initially be set to an empty array.\n */\n get textDivs() {\n return this.#textDivs;\n }\n\n /**\n * @type {Array} Strings that correspond to the `str` property of\n * the text items of the textContent input.\n * This is output and will initially be set to an empty array\n */\n get textContentItemsStr() {\n return this.#textContentItemsStr;\n }\n\n #processItems(items) {\n if (this.#disableProcessItems) {\n return;\n }\n this.#layoutTextParams.ctx ??= TextLayer.#getCtx(this.#lang);\n\n const textDivs = this.#textDivs,\n textContentItemsStr = this.#textContentItemsStr;\n\n for (const item of items) {\n // No point in rendering many divs as it would make the browser\n // unusable even after the divs are rendered.\n if (textDivs.length > MAX_TEXT_DIVS_TO_RENDER) {\n warn(\"Ignoring additional textDivs for performance reasons.\");\n\n this.#disableProcessItems = true; // Avoid multiple warnings for one page.\n return;\n }\n\n if (item.str === undefined) {\n if (\n item.type === \"beginMarkedContentProps\" ||\n item.type === \"beginMarkedContent\"\n ) {\n const parent = this.#container;\n this.#container = document.createElement(\"span\");\n this.#container.classList.add(\"markedContent\");\n if (item.id) {\n this.#container.setAttribute(\"id\", item.id);\n }\n if (item.tag === \"Artifact\") {\n this.#container.ariaHidden = true;\n }\n parent.append(this.#container);\n } else if (item.type === \"endMarkedContent\") {\n this.#container = this.#container.parentNode;\n }\n continue;\n }\n textContentItemsStr.push(item.str);\n this.#appendText(item);\n }\n }\n\n #appendText(geom) {\n // Initialize all used properties to keep the caches monomorphic.\n const textDiv = document.createElement(\"span\");\n const textDivProperties = {\n angle: 0,\n canvasWidth: 0,\n hasText: geom.str !== \"\",\n hasEOL: geom.hasEOL,\n fontSize: 0,\n };\n this.#textDivs.push(textDiv);\n\n const tx = Util.transform(this.#transform, geom.transform);\n let angle = Math.atan2(tx[1], tx[0]);\n const style = this.#styleCache[geom.fontName];\n if (style.vertical) {\n angle += Math.PI / 2;\n }\n\n let fontFamily =\n (this.#fontInspectorEnabled && style.fontSubstitution) ||\n style.fontFamily;\n\n // Workaround for bug 1922063.\n fontFamily = TextLayer.fontFamilyMap.get(fontFamily) || fontFamily;\n const fontHeight = Math.hypot(tx[2], tx[3]);\n const fontAscent =\n fontHeight * TextLayer.#getAscent(fontFamily, style, this.#lang);\n\n let left, top;\n if (angle === 0) {\n left = tx[4];\n top = tx[5] - fontAscent;\n } else {\n left = tx[4] + fontAscent * Math.sin(angle);\n top = tx[5] - fontAscent * Math.cos(angle);\n }\n\n const divStyle = textDiv.style;\n // Setting the style properties individually, rather than all at once,\n // should be OK since the `textDiv` isn't appended to the document yet.\n divStyle.left = `${((100 * left) / this.#pageWidth).toFixed(2)}%`;\n divStyle.top = `${((100 * top) / this.#pageHeight).toFixed(2)}%`;\n // The text is laid out with the rounded value, hence keep it around in\n // order to measure the text with the very same size, see `#layout`.\n const roundedFontHeight = Math.round(fontHeight * 100) / 100;\n divStyle.setProperty(\"--font-height\", `${roundedFontHeight}px`);\n divStyle.fontFamily = fontFamily;\n\n textDivProperties.fontSize = roundedFontHeight;\n\n // Keeps screen readers from pausing on every new text span.\n textDiv.setAttribute(\"role\", \"presentation\");\n\n textDiv.textContent = geom.str;\n // geom.dir may be 'ttb' for vertical texts.\n textDiv.dir = geom.dir;\n\n // `fontName` is only used by the FontInspector, and we only use `dataset`\n // here to make the font name available in the debugger.\n if (this.#fontInspectorEnabled) {\n textDiv.dataset.fontName =\n style.fontSubstitutionLoadedName || geom.fontName;\n }\n if (angle !== 0) {\n textDivProperties.angle = angle * (180 / Math.PI);\n }\n // We don't bother scaling single-char text divs, because it has very\n // little effect on text highlighting. This makes scrolling on docs with\n // lots of such divs a lot faster.\n let shouldScaleText = false;\n if (geom.str.length > 1) {\n shouldScaleText = true;\n } else if (geom.str !== \" \" && geom.transform[0] !== geom.transform[3]) {\n const absScaleX = Math.abs(geom.transform[0]),\n absScaleY = Math.abs(geom.transform[3]);\n // When the horizontal/vertical scaling differs significantly, also scale\n // even single-char text to improve highlighting (fixes issue11713.pdf).\n if (\n absScaleX !== absScaleY &&\n Math.max(absScaleX, absScaleY) / Math.min(absScaleX, absScaleY) > 1.5\n ) {\n shouldScaleText = true;\n }\n }\n if (shouldScaleText) {\n textDivProperties.canvasWidth = style.vertical ? geom.height : geom.width;\n }\n this.#textDivProperties.set(textDiv, textDivProperties);\n\n // Finally, layout and append the text to the DOM.\n this.#layoutTextParams.div = textDiv;\n this.#layoutTextParams.properties = textDivProperties;\n this.#layout(this.#layoutTextParams);\n\n if (textDivProperties.hasText) {\n this.#container.append(textDiv);\n }\n if (textDivProperties.hasEOL) {\n const br = document.createElement(\"br\");\n br.setAttribute(\"role\", \"presentation\");\n this.#container.append(br);\n }\n }\n\n #layout(params) {\n const { div, properties, ctx } = params;\n const { style } = div;\n const { canvasWidth, fontSize } = properties;\n\n if (canvasWidth !== 0 && fontSize !== 0 && properties.hasText) {\n const { fontFamily } = style;\n // Firefox quantizes canvas font sizes after dividing by the device-pixel\n // ratio. Measure at a quantized size, then rescale the width.\n const pixelRatio = this.#pixelRatio;\n const measuredSize =\n TextLayer.#quantizeFontSize((fontSize * this.#scale) / pixelRatio) *\n pixelRatio;\n\n TextLayer.#ensureCtxFont(ctx, measuredSize, fontFamily);\n // Only measure the width for multi-char text divs, see `appendText`.\n const { width } = ctx.measureText(div.textContent);\n\n if (width > 0) {\n style.setProperty(\n \"--scale-x\",\n (canvasWidth * measuredSize) / (width * fontSize)\n );\n }\n }\n if (properties.angle !== 0) {\n style.setProperty(\"--rotate\", `${properties.angle}deg`);\n }\n }\n\n /**\n * Clean-up global textLayer data.\n * @returns {undefined}\n */\n static cleanup() {\n if (this.#pendingTextLayers.size > 0) {\n return;\n }\n this.#ascentCache.clear();\n\n for (const { canvas } of this.#canvasContexts.values()) {\n canvas.remove();\n }\n this.#canvasContexts.clear();\n }\n\n static #getCtx(lang = null) {\n let ctx = this.#canvasContexts.get((lang ||= \"\"));\n if (!ctx) {\n // We don't use an OffscreenCanvas here because we use serif/sans serif\n // fonts with it and they depends on the locale.\n // In Firefox, the element get a lang attribute that depends on\n // what Fluent returns for the locale and the OffscreenCanvas uses\n // the OS locale.\n // Those two locales can be different and consequently the used fonts will\n // be different (see bug 1869001).\n // Ideally, we should use in the text layer the fonts we've in the pdf (or\n // their replacements when they aren't embedded) and then we can use an\n // OffscreenCanvas.\n const canvas = document.createElement(\"canvas\");\n canvas.style.cssText =\n \"position:absolute;top:0;left:0;width:0;height:0;display:none;\" +\n \"letter-spacing:normal;word-spacing:normal\";\n canvas.lang = lang;\n document.body.append(canvas);\n ctx = canvas.getContext(\"2d\", {\n alpha: false,\n willReadFrequently: true,\n });\n this.#canvasContexts.set(lang, ctx);\n\n // Also, initialize state for the `#ensureCtxFont` method.\n // Resizing the canvas resets ctx.font but leaves this cache stale.\n this.#canvasCtxFonts.set(ctx, { size: 0, family: \"\" });\n }\n return ctx;\n }\n\n // Match Firefox's 7-bit `QuantizeFontSize` implementation:\n // https://searchfox.org/firefox-main/rev/04b29f9c2d2dbf5639c3f45ea812bb4c21dc81c6/dom/canvas/CanvasRenderingContext2D.cpp#4205-4215\n static #quantizeFontSize(size) {\n size = Math.fround(size);\n const d = Math.fround(size * ((1 << 17) + 1));\n return Math.fround(d - Math.fround(d - size));\n }\n\n static #ensureCtxFont(ctx, size, family) {\n const cached = this.#canvasCtxFonts.get(ctx);\n if (size === cached.size && family === cached.family) {\n return; // The font is already set.\n }\n ctx.font = `${size}px ${family}`;\n cached.size = size;\n cached.family = family;\n }\n\n /**\n * Compute the minimum font size enforced by the browser.\n */\n static #ensureMinFontSizeComputed() {\n if (this.#minFontSize !== null) {\n return;\n }\n const div = document.createElement(\"div\");\n div.style.opacity = 0;\n div.style.lineHeight = 1;\n div.style.fontSize = \"1px\";\n div.style.position = \"absolute\";\n div.textContent = \"X\";\n document.body.append(div);\n // In `display:block` elements contain a single line of text,\n // the height matches the line height (which, when set to 1,\n // matches the actual font size).\n this.#minFontSize = div.getBoundingClientRect().height;\n div.remove();\n }\n\n static #getAscent(fontFamily, style, lang) {\n const cachedAscent = this.#ascentCache.get(fontFamily);\n if (cachedAscent) {\n return cachedAscent;\n }\n const ctx = this.#getCtx(lang);\n\n this.#ensureCtxFont(ctx, DEFAULT_FONT_SIZE, fontFamily);\n const metrics = ctx.measureText(\"\");\n\n const ascent = metrics.fontBoundingBoxAscent;\n const descent = Math.abs(metrics.fontBoundingBoxDescent);\n\n let ratio = 0.8; // DEFAULT_FONT_ASCENT\n\n if (ascent) {\n ratio = ascent / (ascent + descent);\n } else {\n if (\n (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) ||\n FeatureTest.platform.isFirefox\n ) {\n warn(\n \"Enable the `dom.textMetrics.fontBoundingBox.enabled` preference \" +\n \"in `about:config` to improve TextLayer rendering.\"\n );\n }\n if (style.ascent) {\n ratio = style.ascent;\n } else if (style.descent) {\n ratio = 1 + style.descent;\n }\n }\n\n this.#ascentCache.set(fontFamily, ratio);\n return ratio;\n }\n}\n\nexport { DEFAULT_FONT_SIZE, TextLayer };\n","/* Copyright 2012 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * @module pdfjsLib\n */\n\nimport {\n AbortException,\n AnnotationMode,\n assert,\n getVerbosityLevel,\n info,\n isNodeJS,\n makeObj,\n RenderingIntentFlag,\n setVerbosityLevel,\n shadow,\n unreachable,\n warn,\n} from \"../shared/util.js\";\nimport {\n AnnotationStorage,\n PrintAnnotationStorage,\n SerializableEmpty,\n} from \"./annotation_storage.js\";\nimport {\n CanvasBBoxTracker,\n CanvasDependencyTracker,\n CanvasImagesTracker,\n} from \"./canvas_dependency_tracker.js\";\nimport { FontFaceObject, FontLoader } from \"./font_loader.js\";\nimport {\n FontInfo,\n FontPathInfo,\n PatternInfo,\n} from \"./obj_bin_transform_display.js\";\nimport {\n getDataProp,\n getFactoryUrlProp,\n getUrlProp,\n isRefProxy,\n LoopbackPort,\n} from \"./api_utils.js\";\nimport {\n isDataScheme,\n isValidFetchUrl,\n RenderingCancelledException,\n StatTimer,\n} from \"./display_utils.js\";\nimport { MessageHandler, wrapReason } from \"../shared/message_handler.js\";\nimport {\n NodeBinaryDataFactory,\n NodeCanvasFactory,\n NodeFilterFactory,\n} from \"display-node_utils\";\nimport { CanvasGraphics } from \"./canvas.js\";\nimport { DOMBinaryDataFactory } from \"display-binary_data_factory\";\nimport { DOMCanvasFactory } from \"./canvas_factory.js\";\nimport { DOMFilterFactory } from \"./filter_factory.js\";\nimport { getNetworkStream } from \"display-network_stream\";\nimport { GlobalWorkerOptions } from \"./worker_options.js\";\nimport { initGPU } from \"./webgpu.js\";\nimport { MathClamp } from \"../shared/math_clamp.js\";\nimport { Metadata } from \"./metadata.js\";\nimport { OptionalContentConfig } from \"./optional_content_config.js\";\nimport { PagesMapper } from \"./pages_mapper.js\";\nimport { PageViewport } from \"./page_viewport.js\";\nimport { PDFDataTransportStream } from \"./transport_stream.js\";\nimport { PDFObjects } from \"./pdf_objects.js\";\nimport { TextLayer } from \"./text_layer.js\";\nimport { XfaText } from \"./xfa_text.js\";\n\nconst RENDERING_CANCELLED_TIMEOUT = 100; // ms\n\n/**\n * @import {\n * CatalogAttachmentContent,\n * CatalogAttachment\n * } from \"../core/catalog.js\";\n */\n\n/**\n * @typedef { Int8Array | Uint8Array | Uint8ClampedArray |\n * Int16Array | Uint16Array |\n * Int32Array | Uint32Array | Float32Array |\n * Float64Array\n * } TypedArray\n */\n\n/**\n * @typedef {object} RefProxy\n * @property {number} num\n * @property {number} gen\n */\n\n/**\n * Document initialization / loading parameters object.\n * @typedef {object} DocumentInitParameters\n * @property {string | URL} [url] - The URL of the PDF.\n * @property {TypedArray | ArrayBuffer | Array | string} [data] -\n * Binary PDF data.\n * Use TypedArrays (Uint8Array) to improve the memory usage. If PDF data is\n * BASE64-encoded, use `atob()` to convert it to a binary string first.\n *\n * NOTE: If TypedArrays are used they will generally be transferred to the\n * worker-thread. This will help reduce main-thread memory usage, however\n * it will take ownership of the TypedArrays.\n * @property {object} [httpHeaders] - Basic authentication headers.\n * @property {boolean} [withCredentials] - Indicates whether or not\n * cross-site Access-Control requests should be made using credentials such\n * as cookies or authorization headers. The default is `false`.\n * @property {string} [password] - For decrypting password-protected PDFs.\n * @property {PDFDataRangeTransport} [range] - Allows for using a custom range\n * transport implementation.\n * @property {number} [rangeChunkSize] - Specify maximum number of bytes fetched\n * per range request. The default value is 65536 (= 2^16).\n * @property {PDFWorker} [worker] - The worker that will be used for loading and\n * parsing the PDF data.\n * @property {number} [verbosity] - Controls the logging level; the constants\n * from {@link VerbosityLevel} should be used.\n * @property {string} [docBaseUrl] - The base URL of the document, used when\n * attempting to recover valid absolute URLs for annotations, and outline\n * items, that (incorrectly) only specify relative URLs.\n * @property {string} [cMapUrl] - The URL where the predefined Adobe CMaps are\n * located. Include the trailing slash.\n * @property {boolean} [cMapPacked] - Specifies if the Adobe CMaps are binary\n * packed or not. The default value is `true`.\n * @property {string} [iccUrl] - The URL where the predefined ICC profiles are\n * located. Include the trailing slash.\n * @property {boolean} [useSystemFonts] - When `true`, fonts that aren't\n * embedded in the PDF document will fallback to a system font.\n * The default value is `true` in web environments and `false` in Node.js;\n * unless `disableFontFace === true` in which case this defaults to `false`\n * regardless of the environment (to prevent completely broken fonts).\n * @property {string} [standardFontDataUrl] - The URL where the standard font\n * files are located. Include the trailing slash.\n * @property {string} [wasmUrl] - The URL where the wasm files are located.\n * Include the trailing slash.\n * @property {boolean} [useWorkerFetch] - Enable using the Fetch API in the\n * worker-thread when reading built-in CMap files, standard font files,\n * and wasm files. If `true`, the `BinaryDataFactory` option is ignored.\n * The default value is `true` in web environments and `false` in Node.js.\n * @property {boolean} [useWasm] - Attempt to use WebAssembly in order to\n * improve e.g. image decoding performance.\n * The default value is `true`.\n * @property {boolean} [stopAtErrors] - Reject certain promises, e.g.\n * `getOperatorList`, `getTextContent`, and `RenderTask`, when the associated\n * PDF data cannot be successfully parsed, instead of attempting to recover\n * whatever possible of the data. The default value is `false`.\n * @property {number} [maxImageSize] - The maximum allowed image size in total\n * pixels, i.e. width * height. Images above this value will not be rendered.\n * Use -1 for no limit, which is also the default value.\n * @property {boolean} [isOffscreenCanvasSupported] - Determines if we can use\n * `OffscreenCanvas` in the worker. Primarily used to improve performance of\n * image conversion/rendering.\n * The default value is `true` in web environments and `false` in Node.js.\n * @property {boolean} [isImageDecoderSupported] - Determines if we can use\n * `ImageDecoder` in the worker. Primarily used to improve performance of\n * image conversion/rendering.\n * The default value is `true` in web environments and `false` in Node.js.\n * @property {number} [canvasMaxAreaInBytes] - The integer value is used to\n * know when an image must be resized (uses `OffscreenCanvas` in the worker).\n * If it's -1 then a possibly slow algorithm is used to guess the max value.\n * @property {boolean} [disableFontFace] - By default fonts are converted to\n * OpenType fonts and loaded via the Font Loading API or `@font-face` rules.\n * If disabled, fonts will be rendered using a built-in font renderer that\n * constructs the glyphs with primitive path commands.\n * The default value is `false` in web environments and `true` in Node.js.\n * @property {boolean} [fontExtraProperties] - Include additional properties,\n * which are unused during rendering of PDF documents, when exporting the\n * parsed font data from the worker-thread. This may be useful for debugging\n * purposes (and backwards compatibility), but note that it will lead to\n * increased memory usage. The default value is `false`.\n * @property {boolean} [enableXfa] - Render Xfa forms if any.\n * The default value is `false`.\n * @property {HTMLDocument} [ownerDocument] - Specify an explicit document\n * context to create elements with and to load resources, such as fonts,\n * into. Defaults to the current document.\n * @property {boolean} [disableRange] - Disable range request loading of PDF\n * files. When enabled, and if the server supports partial content requests,\n * then the PDF will be fetched in chunks. The default value is `false`.\n * @property {boolean} [disableStream] - Disable streaming of PDF file data.\n * By default PDF.js attempts to load PDF files in chunks. The default value\n * is `false`.\n * @property {boolean} [disableAutoFetch] - Disable pre-fetching of PDF file\n * data. When range requests are enabled PDF.js will automatically keep\n * fetching more data even if it isn't needed to display the current page.\n * The default value is `false`.\n *\n * NOTE: It is also necessary to disable streaming, see above, in order for\n * disabling of pre-fetching to work correctly.\n * @property {boolean} [pdfBug] - Enables special hooks for debugging PDF.js\n * (see `web/debugger.js`). The default value is `false`.\n * @property {object} [CanvasFactory] - The factory that will be used when\n * creating canvases. The default value is {DOMCanvasFactory}.\n * @property {object} [FilterFactory] - The factory that will be used to\n * create SVG filters when rendering some images on the main canvas.\n * The default value is {DOMFilterFactory}.\n * @property {object} [BinaryDataFactory] - The factory that will be used when\n * falling back to reading built-in CMap files, standard font files,\n * and wasm files in the main-thread.\n * The default value is {DOMBinaryDataFactory}.\n * @property {boolean} [enableHWA] - Enables hardware acceleration for\n * rendering. The default value is `false`.\n * @property {object} [pagesMapper] - The pages mapper that will be used to map\n * page ids and page numbers. It's used when the page order is changed or some\n * pages are removed, cloned, etc.\n */\n\n/**\n * This is the main entry point for loading a PDF and interacting with it.\n *\n * NOTE: If a URL is used to fetch the PDF data a standard Fetch API call (or\n * XHR as fallback) is used, which means it must follow same origin rules,\n * e.g. no cross-domain requests without CORS.\n * @param {DocumentInitParameters} src - Parameter object.\n * @returns {PDFDocumentLoadingTask}\n */\nfunction getDocument(src = {}) {\n const task = new PDFDocumentLoadingTask();\n const { docId } = task;\n\n const url = src.url ? getUrlProp(src.url) : null;\n const data = src.data ? getDataProp(src.data) : null;\n const httpHeaders = src.httpHeaders || null;\n const withCredentials = src.withCredentials === true;\n const password = src.password ?? null;\n const rangeTransport =\n src.range instanceof PDFDataRangeTransport ? src.range : null;\n const rangeChunkSize =\n Number.isInteger(src.rangeChunkSize) && src.rangeChunkSize > 0\n ? src.rangeChunkSize\n : 2 ** 16;\n let worker = src.worker instanceof PDFWorker ? src.worker : null;\n const verbosity = src.verbosity;\n // Ignore \"data:\"-URLs, since they can't be used to recover valid absolute\n // URLs anyway. We want to avoid sending them to the worker-thread, since\n // they contain the *entire* PDF document and can thus be arbitrarily long.\n const docBaseUrl =\n typeof src.docBaseUrl === \"string\" && !isDataScheme(src.docBaseUrl)\n ? src.docBaseUrl\n : null;\n const cMapUrl = getFactoryUrlProp(src.cMapUrl);\n const cMapPacked = src.cMapPacked !== false;\n const iccUrl = getFactoryUrlProp(src.iccUrl);\n const standardFontDataUrl = getFactoryUrlProp(src.standardFontDataUrl);\n const wasmUrl = getFactoryUrlProp(src.wasmUrl);\n const ignoreErrors = src.stopAtErrors !== true;\n const maxImageSize =\n Number.isInteger(src.maxImageSize) && src.maxImageSize > -1\n ? src.maxImageSize\n : -1;\n const isOffscreenCanvasSupported =\n typeof src.isOffscreenCanvasSupported === \"boolean\"\n ? src.isOffscreenCanvasSupported\n : !isNodeJS;\n const isImageDecoderSupported =\n typeof src.isImageDecoderSupported === \"boolean\"\n ? src.isImageDecoderSupported\n : !isNodeJS;\n const canvasMaxAreaInBytes = Number.isInteger(src.canvasMaxAreaInBytes)\n ? src.canvasMaxAreaInBytes\n : -1;\n const disableFontFace =\n typeof src.disableFontFace === \"boolean\" ? src.disableFontFace : isNodeJS;\n const fontExtraProperties = src.fontExtraProperties === true;\n const enableXfa = src.enableXfa === true;\n const ownerDocument = src.ownerDocument || globalThis.document;\n const disableRange = src.disableRange === true;\n const disableStream = src.disableStream === true;\n const disableAutoFetch = src.disableAutoFetch === true;\n const pdfBug = src.pdfBug === true;\n const CanvasFactory =\n src.CanvasFactory ||\n (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"GENERIC\") && isNodeJS\n ? NodeCanvasFactory\n : DOMCanvasFactory);\n const FilterFactory =\n src.FilterFactory ||\n (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"GENERIC\") && isNodeJS\n ? NodeFilterFactory\n : DOMFilterFactory);\n const BinaryDataFactory =\n src.BinaryDataFactory ||\n (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"GENERIC\") && isNodeJS\n ? NodeBinaryDataFactory\n : DOMBinaryDataFactory);\n const enableHWA = src.enableHWA === true;\n const enableWebGPU = src.enableWebGPU === true;\n // Start GPU initialisation immediately so it runs in parallel with the\n // worker bootstrap; the resolved boolean is forwarded to the worker.\n const gpuPromise = enableWebGPU ? initGPU() : Promise.resolve(false);\n const useWasm = src.useWasm !== false;\n const pagesMapper = src.pagesMapper || new PagesMapper();\n\n // Parameters whose default values depend on other parameters.\n const useSystemFonts =\n typeof src.useSystemFonts === \"boolean\"\n ? src.useSystemFonts\n : !isNodeJS && !disableFontFace;\n const useWorkerFetch =\n typeof src.useWorkerFetch === \"boolean\"\n ? src.useWorkerFetch\n : (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) ||\n !!(\n BinaryDataFactory === DOMBinaryDataFactory &&\n cMapUrl &&\n cMapPacked &&\n standardFontDataUrl &&\n wasmUrl &&\n isValidFetchUrl(cMapUrl, document.baseURI) &&\n isValidFetchUrl(standardFontDataUrl, document.baseURI) &&\n isValidFetchUrl(wasmUrl, document.baseURI)\n );\n\n // Parameters only intended for development/testing purposes.\n const styleElement =\n typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")\n ? src.styleElement\n : null;\n\n // Set the main-thread verbosity level.\n setVerbosityLevel(verbosity);\n\n // Ensure that the various factories can be initialized, when necessary,\n // since the user may provide *custom* ones.\n const transportFactory = {\n canvasFactory: new CanvasFactory({ ownerDocument, enableHWA }),\n filterFactory: new FilterFactory({ docId, ownerDocument }),\n binaryDataFactory:\n (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) ||\n useWorkerFetch\n ? null\n : new BinaryDataFactory({ cMapUrl, standardFontDataUrl, wasmUrl }),\n };\n\n if (!worker) {\n // Worker was not provided -- creating and owning our own. If message port\n // is specified in global worker options, using it.\n worker = PDFWorker.create({\n verbosity,\n port: GlobalWorkerOptions.workerPort,\n });\n task._worker = worker;\n }\n\n const docParams = {\n docId,\n apiVersion:\n typeof PDFJSDev !== \"undefined\" && !PDFJSDev.test(\"TESTING\")\n ? PDFJSDev.eval(\"BUNDLE_VERSION\")\n : null,\n data,\n password,\n disableAutoFetch,\n rangeChunkSize,\n docBaseUrl,\n enableXfa,\n evaluatorOptions: {\n maxImageSize,\n disableFontFace,\n ignoreErrors,\n isOffscreenCanvasSupported,\n isImageDecoderSupported,\n canvasMaxAreaInBytes,\n fontExtraProperties,\n useSystemFonts,\n useWasm,\n useWorkerFetch,\n cMapUrl,\n cMapPacked,\n iccUrl,\n standardFontDataUrl,\n wasmUrl,\n hasGPU: false, // Set below.\n },\n };\n const transportParams = {\n ownerDocument,\n pdfBug,\n styleElement,\n enableHWA,\n loadingParams: {\n disableAutoFetch,\n enableXfa,\n },\n };\n\n Promise.all([worker.promise, gpuPromise])\n .then(function ([, hasGPU]) {\n if (worker.destroyed) {\n throw new Error(\"Worker was destroyed\");\n }\n\n docParams.evaluatorOptions.hasGPU = hasGPU;\n\n const workerIdPromise = worker.messageHandler.sendWithPromise(\n \"GetDocRequest\",\n docParams,\n data ? [data.buffer] : null\n );\n\n let networkStream;\n if (data) {\n // The entire PDF was provided, no `networkStream` necessary.\n } else if (rangeTransport) {\n networkStream = new PDFDataTransportStream({\n pdfDataRangeTransport: rangeTransport,\n disableRange,\n disableStream,\n });\n } else if (url) {\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n throw new Error(\"Not implemented: NetworkStream\");\n }\n const NetworkStream = getNetworkStream(url);\n\n networkStream = new NetworkStream({\n url,\n httpHeaders,\n withCredentials,\n rangeChunkSize,\n disableRange,\n disableStream,\n });\n } else {\n throw new Error(\n \"getDocument - expected either `data`, `range`, or `url` parameter.\"\n );\n }\n\n return workerIdPromise.then(workerId => {\n if (worker.destroyed) {\n throw new Error(\"Worker was destroyed\");\n }\n\n const messageHandler = new MessageHandler(docId, workerId, worker.port);\n const transport = new WorkerTransport(\n messageHandler,\n task,\n networkStream,\n transportParams,\n transportFactory,\n pagesMapper\n );\n task._transport = transport;\n\n if (task.destroyed) {\n // `destroy()` was called during the worker handshake; the orderly\n // shutdown (including the \"Terminate\" message) will be issued\n // through the transport once destroy resumes.\n throw new Error(\"Loading aborted\");\n }\n messageHandler.send(\"Ready\", null);\n });\n })\n .catch(task._capability.reject)\n .finally(task._setupCapability.resolve);\n\n return task;\n}\n\n/**\n * @typedef {object} OnProgressParameters\n * @property {number} loaded - Currently loaded number of bytes.\n * @property {number} total - Total number of bytes in the PDF file.\n * @property {number} percent - Currently loaded percentage, as an integer value\n * in the [0, 100] range. If `total` is undefined, the percentage is `NaN`.\n */\n\n/**\n * The loading task controls the operations required to load a PDF document\n * (such as network requests) and provides a way to listen for completion,\n * after which individual pages can be rendered.\n */\nclass PDFDocumentLoadingTask {\n static #docId = 0;\n\n /**\n * @private\n */\n _capability = Promise.withResolvers();\n\n /**\n * Resolves once the load-time setup chain has settled, regardless of\n * outcome; used by `destroy()` to wait until `_transport` is either set\n * or definitely never going to be.\n * @private\n */\n _setupCapability = Promise.withResolvers();\n\n /**\n * @private\n */\n _transport = null;\n\n /**\n * @private\n */\n _worker = null;\n\n /**\n * Unique identifier for the document loading task.\n * @type {string}\n */\n docId = `d${PDFDocumentLoadingTask.#docId++}`;\n\n /**\n * Whether the loading task is destroyed or not.\n * @type {boolean}\n */\n destroyed = false;\n\n /**\n * Callback to request a password if a wrong or no password was provided.\n * The callback receives two parameters: a function that should be called\n * with the new password, and a reason (see {@link PasswordResponses}).\n * @type {Function}\n */\n onPassword = null;\n\n /**\n * Callback to be able to monitor the loading progress of the PDF file\n * (necessary to implement e.g. a loading bar).\n * The callback receives an {@link OnProgressParameters} argument.\n * @type {Function}\n */\n onProgress = null;\n\n /**\n * Promise for document loading task completion.\n * @type {Promise}\n */\n get promise() {\n return this._capability.promise;\n }\n\n /**\n * Abort all network requests and destroy the worker.\n * @returns {Promise} A promise that is resolved when destruction is\n * completed.\n */\n async destroy() {\n this.destroyed = true;\n // The setup chain rejects `_capability` with \"Loading aborted\" once the\n // load-time chain unwinds (see `getDocument`). Claim that rejection\n // here so it isn't reported as unhandled during the awaits below;\n // callers awaiting `task.promise` still see it.\n this._capability.promise.catch(() => {});\n\n try {\n // `_pendingDestroy` must be set synchronously, before any `await`,\n // so subsequent `PDFWorker.create()` calls on the shared `workerPort`\n // observe it and throw (see issue 16777).\n if (this._worker?.port) {\n this._worker._pendingDestroy = true;\n }\n // Wait for the load-time setup chain to settle so `_transport` is set\n // (when applicable) before we tear down. This is what guarantees the\n // \"Terminate\" message gets sent through `WorkerTransport.destroy` if\n // `destroy` races with the initial worker handshake.\n await this._setupCapability.promise;\n\n await this._transport?.destroy();\n } catch (ex) {\n if (this._worker?.port) {\n delete this._worker._pendingDestroy;\n }\n throw ex;\n }\n this._transport = null;\n\n this._worker?.destroy();\n this._worker = null;\n }\n\n /**\n * Attempt to fetch the raw data of the PDF document, when e.g.\n * - An exception was thrown during document initialization.\n * - An `onPassword` callback is delaying initialization.\n * @returns {Promise}\n */\n async getData() {\n return this._transport.getData();\n }\n}\n\n/**\n * Abstract class to support range requests file loading.\n *\n * NOTE: The TypedArrays passed to the constructor and relevant methods below\n * will generally be transferred to the worker-thread. This will help reduce\n * main-thread memory usage, however it will take ownership of the TypedArrays.\n */\nclass PDFDataRangeTransport {\n #capability = Promise.withResolvers();\n\n #listener = null;\n\n /**\n * @param {number} length\n * @param {Uint8Array|null} initialData\n * @param {boolean} [progressiveDone]\n * @param {string} [contentDispositionFilename]\n */\n constructor(\n length,\n initialData,\n progressiveDone = false,\n contentDispositionFilename = null\n ) {\n this.length = length;\n this.initialData = initialData;\n this.progressiveDone = progressiveDone;\n this.contentDispositionFilename = contentDispositionFilename;\n }\n\n /**\n * @param {number} begin\n * @param {Uint8Array|null} chunk\n */\n onDataRange(begin, chunk) {\n this.#listener({ type: \"range\", begin, chunk });\n }\n\n /**\n * @param {Uint8Array|null} chunk\n */\n onDataProgressiveRead(chunk) {\n this.#capability.promise.then(() => {\n this.#listener({ type: \"progressiveRead\", chunk });\n });\n }\n\n onDataProgressiveDone() {\n this.#capability.promise.then(() => {\n this.#listener({ type: \"progressiveDone\" });\n });\n }\n\n transportReady(listener) {\n this.#listener = listener;\n this.#capability.resolve();\n }\n\n /**\n * @param {number} begin\n * @param {number} end\n */\n requestDataRange(begin, end) {\n unreachable(\"Abstract method PDFDataRangeTransport.requestDataRange\");\n }\n\n abort() {}\n}\n\n/**\n * Proxy to a `PDFDocument` in the worker thread.\n */\nclass PDFDocumentProxy {\n constructor(pdfInfo, transport) {\n this._pdfInfo = pdfInfo;\n this._transport = transport;\n\n if (\n typeof PDFJSDev === \"undefined\" ||\n PDFJSDev.test(\"TESTING || INTERNAL_VIEWER\")\n ) {\n // For the PDF debugger.\n Object.defineProperty(this, \"getRawData\", {\n value: data => this._transport.getRawData(data),\n });\n }\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n // For testing purposes.\n Object.defineProperty(this, \"getNetworkStreamName\", {\n value: () => this._transport.getNetworkStreamName(),\n });\n Object.defineProperty(this, \"getXFADatasets\", {\n value: () => this._transport.getXFADatasets(),\n });\n Object.defineProperty(this, \"getStartXRefPos\", {\n value: () => this._transport.getStartXRefPos(),\n });\n Object.defineProperty(this, \"getAnnotArray\", {\n value: pageIndex => this._transport.getAnnotArray(pageIndex),\n });\n }\n }\n\n /**\n * @type {PagesMapper} The pages mapper instance.\n */\n get pagesMapper() {\n return this._transport.pagesMapper;\n }\n\n /**\n * @type {AnnotationStorage} Storage for annotation data in forms.\n */\n get annotationStorage() {\n return this._transport.annotationStorage;\n }\n\n /**\n * @type {object} The canvas factory instance.\n */\n get canvasFactory() {\n return this._transport.canvasFactory;\n }\n\n /**\n * @type {object} The filter factory instance.\n */\n get filterFactory() {\n return this._transport.filterFactory;\n }\n\n /**\n * @type {number} Total number of pages in the PDF file.\n */\n get numPages() {\n return this._pdfInfo.numPages;\n }\n\n /**\n * @type {Array} A (not guaranteed to be) unique ID to identify\n * the PDF document.\n * NOTE: The first element will always be defined for all PDF documents,\n * whereas the second element is only defined for *modified* PDF documents.\n */\n get fingerprints() {\n return this._pdfInfo.fingerprints;\n }\n\n /**\n * @type {boolean} True if only XFA form.\n */\n get isPureXfa() {\n return shadow(this, \"isPureXfa\", !!this._transport._htmlForXfa);\n }\n\n /**\n * NOTE: This is (mostly) intended to support printing of XFA forms.\n * @type {object | null} An object representing a HTML tree structure\n * to render the XFA, or `null` when no XFA form exists.\n */\n get allXfaHtml() {\n return this._transport._htmlForXfa;\n }\n\n /**\n * @param {number} pageNumber - The page number to get. The first page is 1.\n * @returns {Promise} A promise that is resolved with\n * a {@link PDFPageProxy} object.\n */\n getPage(pageNumber) {\n return this._transport.getPage(pageNumber);\n }\n\n /**\n * @param {RefProxy} ref - The page reference.\n * @returns {Promise} A promise that is resolved with the page index,\n * starting from zero, that is associated with the reference.\n */\n getPageIndex(ref) {\n return this._transport.getPageIndex(ref);\n }\n\n /**\n * @returns {Promise>>} A promise that is resolved\n * with a mapping from named destinations to references.\n *\n * This can be slow for large documents. Use `getDestination` instead.\n */\n getDestinations() {\n return this._transport.getDestinations();\n }\n\n /**\n * @param {string} id - The named destination to get.\n * @returns {Promise | null>} A promise that is resolved with all\n * information of the given named destination, or `null` when the named\n * destination is not present in the PDF file.\n */\n getDestination(id) {\n return this._transport.getDestination(id);\n }\n\n /**\n * @returns {Promise | null>} A promise that is resolved with\n * an {Array} containing the page labels that correspond to the page\n * indexes, or `null` when no page labels are present in the PDF file.\n */\n getPageLabels() {\n return this._transport.getPageLabels();\n }\n\n /**\n * @returns {Promise} A promise that is resolved with a {string}\n * containing the page layout name.\n */\n getPageLayout() {\n return this._transport.getPageLayout();\n }\n\n /**\n * @returns {Promise} A promise that is resolved with a {string}\n * containing the page mode name.\n */\n getPageMode() {\n return this._transport.getPageMode();\n }\n\n /**\n * @returns {Promise} A promise that is resolved with a {Map}\n * containing the viewer preferences, or `null` when no viewer preferences\n * are present in the PDF file.\n */\n getViewerPreferences() {\n return this._transport.getViewerPreferences();\n }\n\n /**\n * @returns {Promise} A promise that is resolved with a {Map}\n * containing a destination or action, or `null` when no open action is\n * present in the PDF.\n */\n getOpenAction() {\n return this._transport.getOpenAction();\n }\n\n /**\n * @returns {Promise | null>}\n * Promise that is resolved with a lookup table for mapping named\n * attachments to their content.\n */\n getAttachments() {\n return this._transport.getAttachments();\n }\n\n /**\n * @param {string} id\n * Unique attachment identifier (required).\n * @returns {Promise}\n * Promise that resolves to attachment content.\n */\n getAttachmentContent(id) {\n return this._transport.getAttachmentContent(id);\n }\n\n /**\n * @param {Set} types - The annotation types to retrieve.\n * @param {Set} pageIndexesToSkip\n * @returns {Promise>} A promise that is resolved with a list of\n * annotations data.\n */\n getAnnotationsByType(types, pageIndexesToSkip) {\n return this._transport.getAnnotationsByType(types, pageIndexesToSkip);\n }\n\n /**\n * @returns {Promise} A promise that is resolved with a {Map} with\n * the JavaScript actions:\n * - from the name tree.\n * - from A or AA entries in the catalog dictionary.\n * , or `null` if no JavaScript exists.\n */\n getJSActions() {\n return this._transport.getDocJSActions();\n }\n\n /**\n * @typedef {object} OutlineNode\n * @property {string} title\n * @property {boolean} bold\n * @property {boolean} italic\n * @property {Uint8ClampedArray} color - The color in RGB format to use for\n * display purposes.\n * @property {string | Array | null} dest\n * @property {string | null} url\n * @property {string | undefined} unsafeUrl\n * @property {boolean | undefined} newWindow\n * @property {number | undefined} count\n * @property {Array} items\n */\n\n /**\n * @returns {Promise>} A promise that is resolved with an\n * {Array} that is a tree outline (if it has one) of the PDF file.\n */\n getOutline() {\n return this._transport.getOutline();\n }\n\n /**\n * @typedef {object} GetOptionalContentConfigParameters\n * @property {string} [intent] - Determines the optional content groups that\n * are visible by default; valid values are:\n * - 'display' (viewable groups).\n * - 'print' (printable groups).\n * - 'any' (all groups).\n * The default value is 'display'.\n */\n\n /**\n * @param {GetOptionalContentConfigParameters} [params] - Optional content\n * config parameters.\n * @returns {Promise} A promise that is resolved with\n * an {@link OptionalContentConfig} that contains all the optional content\n * groups (assuming that the document has any).\n */\n getOptionalContentConfig({ intent = \"display\" } = {}) {\n const { renderingIntent } = this._transport.getRenderingIntent(intent);\n\n return this._transport.getOptionalContentConfig(renderingIntent);\n }\n\n /**\n * @returns {Promise | null>} A promise that is resolved with\n * a {Set} that contains the permission flags for the PDF document,\n * or `null` when no permissions are present in the PDF file.\n */\n getPermissions() {\n return this._transport.getPermissions();\n }\n\n /**\n * @returns {Promise<{info: object, metadata: Metadata}>} A promise that is\n * resolved with an {Object} that has `info` and `metadata` properties.\n * `info` is an {Object} filled with anything available in the information\n * dictionary and similarly `metadata` is a {Metadata} object with\n * information from the metadata section of the PDF.\n */\n getMetadata() {\n return this._transport.getMetadata();\n }\n\n /**\n * @typedef {object} MarkInfo\n * Properties correspond to Table 321 of the PDF 32000-1:2008 spec.\n * @property {boolean} Marked\n * @property {boolean} UserProperties\n * @property {boolean} Suspects\n */\n\n /**\n * @returns {Promise} A promise that is resolved with\n * a {MarkInfo} object that contains the MarkInfo flags for the PDF\n * document, or `null` when no MarkInfo values are present in the PDF file.\n */\n getMarkInfo() {\n return this._transport.getMarkInfo();\n }\n\n /**\n * @returns {Promise} A promise that is resolved with a\n * {Uint8Array} containing the raw data of the PDF document.\n */\n getData() {\n return this._transport.getData();\n }\n\n /**\n * @param {function(Array): Promise} [printToPDF] -\n * Firefox-only platform appearance renderer. It receives ordered\n * `{ data }` entries and returns a PDF with one page per entry, or `null`.\n * Each page must place its appearance in\n * `[0, 0, data.width, data.height]`, with dimensions in points.\n * @returns {Promise>} A promise that is\n * resolved with a {Uint8Array} containing the\n * full data of the saved document.\n */\n saveDocument(printToPDF) {\n return this._transport.saveDocument(printToPDF);\n }\n\n /**\n * @typedef {object} PageInfo\n * @property {null|Uint8Array} [document]\n * @property {ImageBitmap} [image] Image to insert as a synthetic page.\n * @property {Array|number>} [includePages]\n * included ranges or indices.\n * @property {Array|number>} [excludePages]\n * excluded ranges or indices.\n * @property {Array} [pageIndices] Explicit 0-based positions in the\n * final document for pages contributed by this entry. If shorter than the\n * filtered page list, the remaining pages are placed in the first free\n * slots at extraction time. Positions must not overlap with those of\n * other entries, and the union of all explicit/auto-filled positions\n * across the call must form a dense `[0, N)` range (where `N` is the\n * total page count of the final document) — sparse layouts leave empty\n * slots and are not supported. Cannot be combined with `insertAfter` on\n * the same entry, and must fully cover the filtered page list when any\n * entry in the same call specifies `insertAfter` (partial arrays are\n * rejected in that case).\n * @property {number} [insertAfter] 0-based index in the base sequential\n * sequence (the concatenation of entries that have neither `pageIndices`\n * nor `insertAfter`) after which to insert the pages. When every\n * contributing entry carries explicit `pageIndices`, this is interpreted\n * against that explicit layout instead, shifting any existing positions\n * beyond the insertion point to make room. Use `-1` to insert before\n * everything. Values beyond the current layout are clamped so the pages\n * are appended at the end. Cannot be combined with `pageIndices` on the\n * same entry.\n */\n\n /**\n * @param {Array} pageInfos - The pages to extract.\n * @param {Int32Array} [copyLevels] - For each viewer page, its rank among the\n * extracted pages sharing the same source page, or -1 if it isn't extracted.\n * This routes editor annotations when the viewer contains multiple copies\n * of a source page.\n * @returns {Promise} A promise that is resolved with a\n * {Uint8Array} containing the full data of the saved document.\n */\n extractPages(pageInfos, copyLevels = null) {\n return this._transport.extractPages(pageInfos, copyLevels);\n }\n\n /**\n * @returns {Promise<{ length: number }>} A promise that is resolved when the\n * document's data is loaded. It is resolved with an {Object} that contains\n * the `length` property that indicates size of the PDF data in bytes.\n */\n getDownloadInfo() {\n return this._transport.downloadInfoCapability.promise;\n }\n\n /**\n * Cleans up resources allocated by the document on both the main and worker\n * threads.\n *\n * NOTE: Do not, under any circumstances, call this method when rendering is\n * currently ongoing since that may lead to rendering errors.\n * @param {boolean} [keepLoadedFonts] - Let fonts remain attached to the DOM.\n * NOTE: This will increase persistent memory usage, hence don't use this\n * option unless absolutely necessary. The default value is `false`.\n * @returns {Promise} A promise that is resolved when clean-up has finished.\n */\n cleanup(keepLoadedFonts = false) {\n return this._transport.startCleanup(keepLoadedFonts || this.isPureXfa);\n }\n\n /**\n * @param {RefProxy} ref - The page reference.\n * @returns {number | null} The page number, if it's cached.\n */\n cachedPageNumber(ref) {\n return this._transport.cachedPageNumber(ref);\n }\n\n /**\n * @type {DocumentInitParameters} A subset of the current\n * {DocumentInitParameters}, which are needed in the viewer.\n */\n get loadingParams() {\n return this._transport.loadingParams;\n }\n\n /**\n * @type {PDFDocumentLoadingTask} The loadingTask for the current document.\n */\n get loadingTask() {\n return this._transport.loadingTask;\n }\n\n /**\n * @returns {Promise> | null>} A promise that is\n * resolved with a {Map} containing /AcroForm field data for the JS sandbox,\n * or `null` when no field data is present in the PDF file.\n */\n getFieldObjects() {\n return this._transport.getFieldObjects();\n }\n\n /**\n * @returns {Promise | null>} A promise that is resolved\n * with an {Array} of digital signature metadata (signerName, reason,\n * signingTime, byteRange, subFilter, …), or `null` when the document\n * has no signatures. The PKCS#7 blob and signed-data byte spans\n * needed for verification are fetched separately via\n * {@link PDFDocumentProxy.getSignatureData} so they don't ride the\n * worker boundary unless verification is actually requested.\n */\n getSignatures() {\n return this._transport.getSignatures();\n }\n\n /**\n * @param {string} id Signature `id` from a {@link getSignatures} entry.\n * @returns {Promise<{ data: Uint8Array[], pkcs7: Uint8Array } | null>}\n * The byte payload needed to verify the signature, or `null` if the\n * id is unknown.\n */\n getSignatureData(id) {\n return this._transport.getSignatureData(id);\n }\n\n /**\n * @returns {Promise} A promise that is resolved with `true`\n * if some /AcroForm fields have JavaScript actions.\n */\n hasJSActions() {\n return this._transport.hasJSActions();\n }\n\n /**\n * @returns {Promise | null>} A promise that is resolved with an\n * {Array} containing IDs of annotations that have a calculation\n * action, or `null` when no such annotations are present in the PDF file.\n */\n getCalculationOrderIds() {\n return this._transport.getCalculationOrderIds();\n }\n}\n\n/**\n * Page getViewport parameters.\n * @typedef {object} GetViewportParameters\n * @property {number} scale - The desired scale of the viewport.\n * @property {number} [rotation] - The desired rotation, in degrees, of\n * the viewport. If omitted it defaults to the page rotation.\n * @property {number} [offsetX] - The horizontal, i.e. x-axis, offset.\n * The default value is `0`.\n * @property {number} [offsetY] - The vertical, i.e. y-axis, offset.\n * The default value is `0`.\n * @property {boolean} [dontFlip] - If true, the y-axis will not be\n * flipped. The default value is `false`.\n */\n\n/**\n * Page getTextContent parameters.\n * @typedef {object} getTextContentParameters\n * @property {boolean} [includeMarkedContent] - When true include marked\n * content items in the items array of TextContent. The default is `false`.\n * @property {boolean} [disableNormalization] - When true the text is *not*\n * normalized in the worker-thread. The default is `false`.\n */\n\n/**\n * Page text content.\n * @typedef {object} TextContent\n * @property {Array} items - Array of\n * {@link TextItem} and {@link TextMarkedContent} objects. TextMarkedContent\n * items are included when includeMarkedContent is true.\n * @property {Record} styles - {@link TextStyle} objects,\n * indexed by font name.\n * @property {string | null} lang - The document /Lang attribute.\n */\n\n/**\n * Page text content part.\n * @typedef {object} TextItem\n * @property {string} str - Text content.\n * @property {string} dir - Text direction: 'ttb', 'ltr' or 'rtl'.\n * @property {Array} transform - Transformation matrix.\n * @property {number} width - Width in device space.\n * @property {number} height - Height in device space.\n * @property {string} fontName - Font name used by PDF.js for converted font.\n * @property {boolean} hasEOL - Indicating if the text content is followed by a\n * line-break.\n */\n\n/**\n * Page text marked content part.\n * @typedef {object} TextMarkedContent\n * @property {string} type - Either 'beginMarkedContent',\n * 'beginMarkedContentProps', or 'endMarkedContent'.\n * @property {string} id - The marked content identifier. Only used for type\n * 'beginMarkedContentProps'.\n */\n\n/**\n * Text style.\n * @typedef {object} TextStyle\n * @property {number} ascent - Font ascent.\n * @property {number} descent - Font descent.\n * @property {boolean} vertical - Whether or not the text is in vertical mode.\n * @property {string} fontFamily - The possible font family.\n */\n\n/**\n * Page annotation parameters.\n * @typedef {object} GetAnnotationsParameters\n * @property {string} [intent] - Determines the annotations that are fetched,\n * can be 'display' (viewable annotations), 'print' (printable annotations),\n * or 'any' (all annotations). The default value is 'display'.\n */\n\n/**\n * Page render parameters.\n * @typedef {object} RenderParameters\n * @property {HTMLCanvasElement|null} canvas - A DOM Canvas object. The default\n * value is the canvas associated with the `canvasContext` parameter if no\n * value is provided explicitly.\n * @property {PageViewport} viewport - Rendering viewport obtained by calling\n * the `PDFPageProxy.getViewport` method.\n * @property {CanvasRenderingContext2D} [canvasContext] - 2D context of a DOM\n * Canvas object for backwards compatibility; it is recommended to use the\n * `canvas` parameter instead.\n * If the context must absolutely be used to render the page, the canvas must\n * be null.\n * @property {string} [intent] - Rendering intent, can be 'display', 'print',\n * or 'any'. The default value is 'display'.\n * @property {number} [annotationMode] Controls which annotations are rendered\n * onto the canvas, for annotations with appearance-data; the values from\n * {@link AnnotationMode} should be used. The following values are supported:\n * - `AnnotationMode.DISABLE`, which disables all annotations.\n * - `AnnotationMode.ENABLE`, which includes all possible annotations (thus\n * it also depends on the `intent`-option, see above).\n * - `AnnotationMode.ENABLE_FORMS`, which excludes annotations that contain\n * interactive form elements (those will be rendered in the display layer).\n * - `AnnotationMode.ENABLE_STORAGE`, which includes all possible annotations\n * (as above) but where interactive form elements are updated with data\n * from the {@link AnnotationStorage}-instance; useful e.g. for printing.\n * The default value is `AnnotationMode.ENABLE`.\n * @property {Array} [transform] - Additional transform, applied just\n * before viewport transform.\n * @property {CanvasGradient | CanvasPattern | string} [background] - Background\n * to use for the canvas.\n * Any valid `canvas.fillStyle` can be used: a `DOMString` parsed as CSS\n * value, a `CanvasGradient` object (a linear or radial gradient) or\n * a `CanvasPattern` object (a repetitive image). The default value is\n * 'rgb(255,255,255)'.\n *\n * NOTE: This option may be partially, or completely, ignored when the\n * `pageColors`-option is used.\n * @property {object} [pageColors] - Overwrites background and foreground colors\n * with user defined ones in order to improve readability in high contrast\n * mode.\n * @property {Promise} [optionalContentConfigPromise] -\n * A promise that should resolve with an {@link OptionalContentConfig}\n * created from `PDFDocumentProxy.getOptionalContentConfig`. If `null`,\n * the configuration will be fetched automatically with the default visibility\n * states set.\n * @property {Map} [annotationCanvasMap] - Map some\n * annotation ids with canvases used to render them.\n * @property {PrintAnnotationStorage} [printAnnotationStorage]\n * @property {boolean} [isEditing] - Render the page in editing mode.\n * @property {boolean} [recordImages] - Record the location of images in the PDF\n * @property {boolean} [recordOperations] - Record the dependencies and bounding\n * boxes of all PDF operations that render onto the canvas.\n * @property {OperationsFilter} [operationsFilter] - If provided, only\n * run for which this function returns `true`.\n */\n\n/**\n * @callback OperationsFilter\n * @param {number} index - The index of the operation.\n * @param {PDFOperatorList} operatorList - The page operator list.\n * @returns {boolean} If false, the operation is ignored.\n */\n\n/**\n * Page getOperatorList parameters.\n * @typedef {object} GetOperatorListParameters\n * @property {string} [intent] - Rendering intent, can be 'display', 'print',\n * or 'any'. The default value is 'display'.\n * @property {number} [annotationMode] Controls which annotations are included\n * in the operatorList, for annotations with appearance-data; the values from\n * {@link AnnotationMode} should be used. The following values are supported:\n * - `AnnotationMode.DISABLE`, which disables all annotations.\n * - `AnnotationMode.ENABLE`, which includes all possible annotations (thus\n * it also depends on the `intent`-option, see above).\n * - `AnnotationMode.ENABLE_FORMS`, which excludes annotations that contain\n * interactive form elements (those will be rendered in the display layer).\n * - `AnnotationMode.ENABLE_STORAGE`, which includes all possible annotations\n * (as above) but where interactive form elements are updated with data\n * from the {@link AnnotationStorage}-instance; useful e.g. for printing.\n * The default value is `AnnotationMode.ENABLE`.\n * @property {PrintAnnotationStorage} [printAnnotationStorage]\n * @property {boolean} [isEditing] - Render the page in editing mode.\n */\n\n/**\n * Structure tree node. The root node will have a role \"Root\".\n * @typedef {object} StructTreeNode\n * @property {Array} children - Array of\n * {@link StructTreeNode} and {@link StructTreeContent} objects.\n * @property {string} role - element's role, already mapped if a role map exists\n * in the PDF.\n * @property {string} [structId] - A table header's structure element\n * identifier, i.e. its `ID` entry. Note that this is unrelated to the `id`\n * property of a {@link StructTreeContent} object.\n * @property {number} [rowSpan] - The number of rows spanned by a table cell.\n * @property {number} [colSpan] - The number of columns spanned by a table cell.\n * @property {Array} [headers] - The `structId` values of the table\n * headers associated with a table cell.\n * @property {\"Row\" | \"Column\" | \"Both\"} [scope] - The cells to which a table\n * header applies.\n * @property {string} [short] - An abbreviated version of a table header's\n * content.\n * @property {string} [summary] - A summary of a table's purpose and structure.\n */\n\n/**\n * Structure tree content.\n * @typedef {object} StructTreeContent\n * @property {string} type - either \"content\" for page and stream structure\n * elements or \"object\" for object references.\n * @property {string} id - unique id that will map to the text layer.\n */\n\n/**\n * PDF page operator list.\n * @typedef {object} PDFOperatorList\n * @property {Array} fnArray - Array containing the operator functions.\n * @property {Array} argsArray - Array containing the arguments of the\n * functions.\n */\n\n/**\n * Proxy to a `PDFPage` in the worker thread.\n */\nclass PDFPageProxy {\n #pendingCleanup = false;\n\n #pagesMapper = null;\n\n static #idCounter = 0;\n\n constructor(pageIndex, pageInfo, transport, pagesMapper, pdfBug = false) {\n this._pageIndex = pageIndex;\n // Stable identifier for worker messages targeting this page proxy.\n this._id = PDFPageProxy.#idCounter++;\n this._pageInfo = pageInfo;\n this._transport = transport;\n this._stats = pdfBug ? new StatTimer() : null;\n this._pdfBug = pdfBug;\n /** @type {PDFObjects} */\n this.commonObjs = transport.commonObjs;\n this.objs = new PDFObjects();\n\n this._intentStates = new Map();\n this.destroyed = false;\n this.recordedBBoxes = null;\n this.#pagesMapper = pagesMapper;\n this.imageCoordinates = null;\n }\n\n clone(id) {\n const clone = new PDFPageProxy(\n id,\n this._pageInfo,\n this._transport,\n this.#pagesMapper,\n this._pdfBug\n );\n clone.clonedFromIndex = this.clonedFromIndex ?? this._pageIndex;\n this._transport.updatePage(clone);\n return clone;\n }\n\n /**\n * @type {number} Page number of the page. First page is 1.\n */\n get pageNumber() {\n return this._pageIndex + 1;\n }\n\n /**\n * @param {number} value - The page number to set. First page is 1.\n */\n set pageNumber(value) {\n this._pageIndex = value - 1;\n this._transport.updatePage(this);\n }\n\n /**\n * @type {number} The number of degrees the page is rotated clockwise.\n */\n get rotate() {\n return this._pageInfo.rotate;\n }\n\n /**\n * @type {RefProxy | null} The reference that points to this page.\n */\n get ref() {\n return this._pageInfo.ref;\n }\n\n /**\n * @type {number} The default size of units in 1/72nds of an inch.\n */\n get userUnit() {\n return this._pageInfo.userUnit;\n }\n\n /**\n * @type {Array} An array of the visible portion of the PDF page in\n * user space units [x1, y1, x2, y2].\n */\n get view() {\n return this._pageInfo.view;\n }\n\n /**\n * @param {GetViewportParameters} params - Viewport parameters.\n * @returns {PageViewport} Contains 'width' and 'height' properties\n * along with transforms required for rendering.\n */\n getViewport({\n scale,\n rotation = this.rotate,\n offsetX = 0,\n offsetY = 0,\n dontFlip = false,\n } = {}) {\n return new PageViewport({\n viewBox: this.view,\n userUnit: this.userUnit,\n scale,\n rotation,\n offsetX,\n offsetY,\n dontFlip,\n });\n }\n\n /**\n * @param {GetAnnotationsParameters} [params] - Annotation parameters.\n * @returns {Promise>} A promise that is resolved with an\n * {Array} of the annotation objects.\n */\n getAnnotations({ intent = \"display\" } = {}) {\n const { renderingIntent } = this._transport.getRenderingIntent(intent);\n\n return this._transport.getAnnotations(this._pageIndex, renderingIntent);\n }\n\n /**\n * @returns {Promise} A promise that is resolved with a {Map} with\n * the JavaScript actions, or `null` if no JavaScript exists.\n */\n getJSActions() {\n return this._transport.getPageJSActions(this._pageIndex);\n }\n\n /**\n * @type {object} The filter factory instance.\n */\n get filterFactory() {\n return this._transport.filterFactory;\n }\n\n /**\n * @type {boolean} True if only XFA form.\n */\n get isPureXfa() {\n return shadow(this, \"isPureXfa\", !!this._transport._htmlForXfa);\n }\n\n /**\n * @returns {Promise} A promise that is resolved with\n * an {Object} with a fake DOM object (a tree structure where elements\n * are {Object} with a name, attributes (class, style, ...), value and\n * children, very similar to a HTML DOM tree), or `null` if no XFA exists.\n */\n async getXfa() {\n return this._transport._htmlForXfa?.children[this._pageIndex] || null;\n }\n\n /**\n * Begins the process of rendering a page to the desired context.\n * @param {RenderParameters} params - Page render parameters.\n * @returns {RenderTask} An object that contains a promise that is\n * resolved when the page finishes rendering.\n */\n render({\n canvasContext,\n canvas = canvasContext.canvas,\n viewport,\n intent = \"display\",\n annotationMode = AnnotationMode.ENABLE,\n transform = null,\n background = null,\n optionalContentConfigPromise = null,\n annotationCanvasMap = null,\n pageColors = null,\n printAnnotationStorage = null,\n isEditing = false,\n recordImages = false,\n recordOperations = false,\n operationsFilter = null,\n }) {\n this._stats?.time(\"Overall\");\n\n const intentArgs = this._transport.getRenderingIntent(\n intent,\n annotationMode,\n printAnnotationStorage,\n isEditing\n );\n const { renderingIntent, cacheKey } = intentArgs;\n // If there was a pending destroy, cancel it so no cleanup happens during\n // this call to render.\n this.#pendingCleanup = false;\n\n optionalContentConfigPromise ||=\n this._transport.getOptionalContentConfig(renderingIntent);\n\n const intentState = this._intentStates.getOrInsertComputed(\n cacheKey,\n makeObj\n );\n // Ensure that a pending `streamReader` cancel timeout is always aborted.\n if (intentState.streamReaderCancelTimeout) {\n clearTimeout(intentState.streamReaderCancelTimeout);\n intentState.streamReaderCancelTimeout = null;\n }\n\n const intentPrint = !!(renderingIntent & RenderingIntentFlag.PRINT);\n\n // If there's no displayReadyCapability yet, then the operatorList\n // was never requested before. Make the request and create the promise.\n if (!intentState.displayReadyCapability) {\n intentState.displayReadyCapability = Promise.withResolvers();\n intentState.operatorList = {\n fnArray: [],\n argsArray: [],\n lastChunk: false,\n separateAnnots: null,\n };\n\n this._stats?.time(\"Page Request\");\n this._pumpOperatorList(intentArgs);\n }\n\n const recordForDebugger = !!(\n this._pdfBug && globalThis.StepperManager?.enabled\n );\n const shouldRecordOperations =\n !!canvas &&\n !this.recordedBBoxes &&\n (recordOperations || recordForDebugger);\n const shouldRecordImages =\n !!canvas && !this.imageCoordinates && recordImages;\n\n const complete = error => {\n intentState.renderTasks.delete(internalRenderTask);\n\n if (shouldRecordOperations) {\n const recordedBBoxes = internalRenderTask.gfx?.dependencyTracker.take();\n if (recordedBBoxes) {\n internalRenderTask.stepper?.setOperatorBBoxes(\n recordedBBoxes,\n internalRenderTask.gfx.dependencyTracker.takeDebugMetadata()\n );\n\n if (recordOperations) {\n this.recordedBBoxes = recordedBBoxes;\n }\n }\n }\n\n if (shouldRecordImages && !error) {\n this.imageCoordinates = internalRenderTask.gfx?.imagesTracker.take();\n }\n\n // Attempt to reduce memory usage during *printing*, by always running\n // cleanup immediately once rendering has finished.\n if (intentPrint) {\n this.#pendingCleanup = true;\n }\n this.#tryCleanup();\n\n if (error) {\n internalRenderTask.capability.reject(error);\n\n this._abortOperatorList({\n intentState,\n reason: error instanceof Error ? error : new Error(error),\n });\n } else {\n internalRenderTask.capability.resolve();\n }\n\n if (this._stats) {\n this._stats.timeEnd(\"Rendering\");\n this._stats.timeEnd(\"Overall\");\n\n if (globalThis.Stats?.enabled) {\n globalThis.Stats.add(this.pageNumber, this._stats);\n }\n }\n };\n\n let dependencyTracker = null;\n let bboxTracker = null;\n if (shouldRecordOperations || shouldRecordImages) {\n bboxTracker = new CanvasBBoxTracker(\n canvas,\n intentState.operatorList.length\n );\n }\n if (shouldRecordOperations) {\n dependencyTracker = new CanvasDependencyTracker(\n bboxTracker,\n recordForDebugger\n );\n }\n\n const internalRenderTask = new InternalRenderTask({\n callback: complete,\n // Only include the required properties, and *not* the entire object.\n params: {\n canvas,\n canvasContext,\n dependencyTracker: dependencyTracker ?? bboxTracker,\n imagesTracker: shouldRecordImages\n ? new CanvasImagesTracker(canvas)\n : null,\n viewport,\n transform,\n background,\n },\n objs: this.objs,\n commonObjs: this.commonObjs,\n annotationCanvasMap,\n operatorList: intentState.operatorList,\n pageIndex: this._pageIndex,\n canvasFactory: this._transport.canvasFactory,\n filterFactory: this._transport.filterFactory,\n useRequestAnimationFrame: !intentPrint,\n pdfBug: this._pdfBug,\n pageColors,\n enableHWA: this._transport.enableHWA,\n operationsFilter,\n });\n\n (intentState.renderTasks ||= new Set()).add(internalRenderTask);\n const renderTask = internalRenderTask.task;\n\n Promise.all([\n intentState.displayReadyCapability.promise,\n optionalContentConfigPromise,\n ])\n .then(([transparency, optionalContentConfig]) => {\n if (this.destroyed) {\n complete();\n return;\n }\n this._stats?.time(\"Rendering\");\n\n if (!(optionalContentConfig.renderingIntent & renderingIntent)) {\n throw new Error(\n \"Must use the same `intent`-argument when calling the `PDFPageProxy.render` \" +\n \"and `PDFDocumentProxy.getOptionalContentConfig` methods.\"\n );\n }\n internalRenderTask.initializeGraphics({\n transparency,\n optionalContentConfig,\n });\n internalRenderTask.operatorListChanged();\n })\n .catch(complete);\n\n return renderTask;\n }\n\n /**\n * @param {GetOperatorListParameters} params - Page getOperatorList\n * parameters.\n * @returns {Promise} A promise resolved with an\n * {@link PDFOperatorList} object that represents the page's operator list.\n */\n getOperatorList({\n intent = \"display\",\n annotationMode = AnnotationMode.ENABLE,\n printAnnotationStorage = null,\n isEditing = false,\n } = {}) {\n if (typeof PDFJSDev !== \"undefined\" && !PDFJSDev.test(\"GENERIC\")) {\n throw new Error(\"Not implemented: getOperatorList\");\n }\n function operatorListChanged() {\n if (intentState.operatorList.lastChunk) {\n intentState.opListReadCapability.resolve(intentState.operatorList);\n\n intentState.renderTasks.delete(opListTask);\n }\n }\n\n const intentArgs = this._transport.getRenderingIntent(\n intent,\n annotationMode,\n printAnnotationStorage,\n isEditing,\n /* isOpList = */ true\n );\n const intentState = this._intentStates.getOrInsertComputed(\n intentArgs.cacheKey,\n makeObj\n );\n let opListTask;\n\n if (!intentState.opListReadCapability) {\n opListTask = Object.create(null);\n opListTask.operatorListChanged = operatorListChanged;\n intentState.opListReadCapability = Promise.withResolvers();\n (intentState.renderTasks ||= new Set()).add(opListTask);\n intentState.operatorList = {\n fnArray: [],\n argsArray: [],\n lastChunk: false,\n separateAnnots: null,\n };\n\n this._stats?.time(\"Page Request\");\n this._pumpOperatorList(intentArgs);\n }\n return intentState.opListReadCapability.promise;\n }\n\n /**\n * NOTE: All occurrences of whitespace will be replaced by\n * standard spaces (0x20).\n * @param {getTextContentParameters} params - getTextContent parameters.\n * @returns {ReadableStream} Stream for reading text content chunks.\n */\n streamTextContent({\n includeMarkedContent = false,\n disableNormalization = false,\n } = {}) {\n const TEXT_CONTENT_CHUNK_SIZE = 100;\n\n return this._transport.messageHandler.sendWithStream(\n \"GetTextContent\",\n {\n pageId: this.#pagesMapper.getPageId(this._pageIndex + 1) - 1,\n pageIndex: this._pageIndex,\n includeMarkedContent: includeMarkedContent === true,\n disableNormalization: disableNormalization === true,\n },\n {\n highWaterMark: TEXT_CONTENT_CHUNK_SIZE,\n size: textContent => textContent.items.length,\n }\n );\n }\n\n /**\n * NOTE: All occurrences of whitespace will be replaced by\n * standard spaces (0x20).\n * @param {getTextContentParameters} params - getTextContent parameters.\n * @returns {Promise} A promise that is resolved with a\n * {@link TextContent} object that represents the page's text content.\n */\n async getTextContent(params = {}) {\n if (this._transport._htmlForXfa) {\n // TODO: We need to revisit this once the XFA foreground patch lands and\n // only do this for non-foreground XFA.\n return this.getXfa().then(xfa => XfaText.textContent(xfa));\n }\n const readableStream = this.streamTextContent(params);\n\n const textContent = {\n items: [],\n styles: Object.create(null),\n lang: null,\n };\n\n for await (const value of readableStream) {\n textContent.lang ??= value.lang;\n Object.assign(textContent.styles, value.styles);\n textContent.items.push(...value.items);\n }\n return textContent;\n }\n\n /**\n * @returns {Promise} A promise that is resolved with a\n * {@link StructTreeNode} object that represents the page's structure tree,\n * or `null` when no structure tree is present for the current page.\n */\n getStructTree() {\n return this._transport.getStructTree(this._pageIndex);\n }\n\n /**\n * Destroys the page object.\n * @private\n */\n _destroy() {\n this.destroyed = true;\n\n const waitOn = [];\n for (const intentState of this._intentStates.values()) {\n this._abortOperatorList({\n intentState,\n reason: new Error(\"Page was destroyed.\"),\n force: true,\n });\n\n if (intentState.opListReadCapability) {\n // Avoid errors below, since the renderTasks are just stubs.\n continue;\n }\n for (const internalRenderTask of intentState.renderTasks) {\n waitOn.push(internalRenderTask.completed);\n internalRenderTask.cancel();\n }\n }\n this.objs.clear();\n this.#pendingCleanup = false;\n\n return Promise.all(waitOn);\n }\n\n /**\n * Cleans up resources allocated by the page.\n * @param {boolean} [resetStats] - Reset page stats, if enabled.\n * The default value is `false`.\n * @returns {boolean} Indicates if clean-up was successfully run.\n */\n cleanup(resetStats = false) {\n this.#pendingCleanup = true;\n const success = this.#tryCleanup();\n\n if (resetStats && success) {\n this._stats &&= new StatTimer();\n }\n return success;\n }\n\n /**\n * Attempts to clean up if rendering is in a state where that's possible.\n * @returns {boolean} Indicates if clean-up was successfully run.\n */\n #tryCleanup() {\n if (!this.#pendingCleanup || this.destroyed) {\n return false;\n }\n for (const { renderTasks, operatorList } of this._intentStates.values()) {\n if (renderTasks.size > 0 || !operatorList.lastChunk) {\n return false;\n }\n }\n this._intentStates.clear();\n this.objs.clear();\n this.#pendingCleanup = false;\n return true;\n }\n\n /**\n * @private\n */\n _startRenderPage(transparency, cacheKey) {\n const intentState = this._intentStates.get(cacheKey);\n if (!intentState) {\n return; // Rendering was cancelled.\n }\n this._stats?.timeEnd(\"Page Request\");\n\n // TODO Refactor RenderPageRequest to separate rendering\n // and operator list logic\n intentState.displayReadyCapability?.resolve(transparency);\n }\n\n /**\n * @private\n */\n _renderPageChunk(operatorListChunk, intentState) {\n // Add the new chunk to the current operator list.\n for (let i = 0, ii = operatorListChunk.length; i < ii; i++) {\n intentState.operatorList.fnArray.push(operatorListChunk.fnArray[i]);\n intentState.operatorList.argsArray.push(operatorListChunk.argsArray[i]);\n }\n intentState.operatorList.lastChunk = operatorListChunk.lastChunk;\n intentState.operatorList.separateAnnots = operatorListChunk.separateAnnots;\n\n // Notify all the rendering tasks there are more operators to be consumed.\n for (const internalRenderTask of intentState.renderTasks) {\n internalRenderTask.operatorListChanged();\n }\n\n if (operatorListChunk.lastChunk) {\n this.#tryCleanup();\n }\n }\n\n /**\n * @private\n */\n _pumpOperatorList({\n renderingIntent,\n cacheKey,\n annotationStorageSerializable,\n modifiedIds,\n }) {\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n assert(\n Number.isInteger(renderingIntent) && renderingIntent > 0,\n '_pumpOperatorList: Expected valid \"renderingIntent\" argument.'\n );\n }\n const { map, transfer } = annotationStorageSerializable;\n\n const readableStream = this._transport.messageHandler.sendWithStream(\n \"GetOperatorList\",\n {\n pageId: this.#pagesMapper.getPageId(this._pageIndex + 1) - 1,\n pageIndex: this._pageIndex,\n pageProxyId: this._id,\n intent: renderingIntent,\n cacheKey,\n annotationStorage: map,\n modifiedIds,\n },\n /* queueingStrategy = */ undefined,\n transfer\n );\n const reader = readableStream.getReader();\n\n const intentState = this._intentStates.get(cacheKey);\n intentState.streamReader = reader;\n\n const pump = () => {\n reader.read().then(\n ({ value, done }) => {\n if (done) {\n intentState.streamReader = null;\n return;\n }\n if (this._transport.destroyed) {\n return; // Ignore any pending requests if the worker was terminated.\n }\n this._renderPageChunk(value, intentState);\n pump();\n },\n reason => {\n intentState.streamReader = null;\n\n if (this._transport.destroyed) {\n return; // Ignore any pending requests if the worker was terminated.\n }\n if (intentState.operatorList) {\n // Mark operator list as complete.\n intentState.operatorList.lastChunk = true;\n\n for (const internalRenderTask of intentState.renderTasks) {\n internalRenderTask.operatorListChanged();\n }\n this.#tryCleanup();\n }\n\n if (intentState.displayReadyCapability) {\n intentState.displayReadyCapability.reject(reason);\n } else if (intentState.opListReadCapability) {\n intentState.opListReadCapability.reject(reason);\n } else {\n throw reason;\n }\n }\n );\n };\n pump();\n }\n\n /**\n * @private\n */\n _abortOperatorList({ intentState, reason, force = false }) {\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n assert(\n reason instanceof Error,\n '_abortOperatorList: Expected valid \"reason\" argument.'\n );\n }\n\n if (!intentState.streamReader) {\n return;\n }\n // Ensure that a pending `streamReader` cancel timeout is always aborted.\n if (intentState.streamReaderCancelTimeout) {\n clearTimeout(intentState.streamReaderCancelTimeout);\n intentState.streamReaderCancelTimeout = null;\n }\n\n if (!force) {\n // Ensure that an Error occurring in *only* one `InternalRenderTask`, e.g.\n // multiple render() calls on the same canvas, won't break all rendering.\n if (intentState.renderTasks.size > 0) {\n return;\n }\n // Don't immediately abort parsing on the worker-thread when rendering is\n // cancelled, since that will unnecessarily delay re-rendering when (for\n // partially parsed pages) e.g. zooming/rotation occurs in the viewer.\n if (reason instanceof RenderingCancelledException) {\n let delay = RENDERING_CANCELLED_TIMEOUT;\n if (reason.extraDelay > 0 && reason.extraDelay < /* ms = */ 1000) {\n // Above, we prevent the total delay from becoming arbitrarily large.\n delay += reason.extraDelay;\n }\n\n intentState.streamReaderCancelTimeout = setTimeout(() => {\n intentState.streamReaderCancelTimeout = null;\n this._abortOperatorList({ intentState, reason, force: true });\n }, delay);\n return;\n }\n }\n intentState.streamReader\n .cancel(new AbortException(reason.message))\n .catch(() => {\n // Avoid \"Uncaught promise\" messages in the console.\n });\n intentState.streamReader = null;\n\n if (this._transport.destroyed) {\n return; // Ignore any pending requests if the worker was terminated.\n }\n // Remove the current `intentState`, since a cancelled `getOperatorList`\n // call on the worker-thread cannot be re-started...\n for (const [curCacheKey, curIntentState] of this._intentStates) {\n if (curIntentState === intentState) {\n this._intentStates.delete(curCacheKey);\n break;\n }\n }\n // ... and force clean-up to ensure that any old state is always removed.\n this.cleanup();\n }\n\n /**\n * @type {StatTimer | null} Returns page stats, if enabled; returns `null`\n * otherwise.\n */\n get stats() {\n return this._stats;\n }\n}\n\n/**\n * @typedef {object} PDFWorkerParameters\n * @property {string} [name] - The name of the worker.\n * @property {Worker} [port] - The `workerPort` object.\n * @property {number} [verbosity] - Controls the logging level;\n * the constants from {@link VerbosityLevel} should be used.\n */\n\n/**\n * PDF.js web worker abstraction that controls the instantiation of PDF\n * documents. Message handlers are used to pass information from the main\n * thread to the worker thread and vice versa. If the creation of a web\n * worker is not possible, a \"fake\" worker will be used instead.\n * @param {PDFWorkerParameters} params - The worker initialization parameters.\n */\nclass PDFWorker {\n #capability = Promise.withResolvers();\n\n #messageHandler = null;\n\n #port = null;\n\n #webWorker = null;\n\n static #fakeWorkerId = 0;\n\n static #isWorkerDisabled = false;\n\n static #workerPorts = new WeakMap();\n\n static {\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) {\n if (isNodeJS) {\n // Workers aren't supported in Node.js, force-disabling them there.\n this.#isWorkerDisabled = true;\n\n GlobalWorkerOptions.workerSrc ||= PDFJSDev.test(\"LIB\")\n ? \"../pdf.worker.js\"\n : \"./pdf.worker.mjs\";\n }\n\n // Check if URLs have the same origin. For non-HTTP based URLs, returns\n // false.\n this._isSameOrigin = (baseUrl, otherUrl) => {\n const base = URL.parse(baseUrl);\n if (!base?.origin || base.origin === \"null\") {\n return false; // non-HTTP url\n }\n const other = new URL(otherUrl, base);\n return base.origin === other.origin;\n };\n\n this._createCDNWrapper = url => {\n // We will rely on blob URL's property to specify origin.\n // We want this function to fail in case if createObjectURL or Blob do\n // not exist or fail for some reason -- our Worker creation will fail\n // anyway.\n const wrapper = `await import(\"${url}\");`;\n return URL.createObjectURL(\n new Blob([wrapper], { type: \"text/javascript\" })\n );\n };\n }\n\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n this._resetGlobalState = () => {\n this.#isWorkerDisabled = false;\n delete globalThis.pdfjsWorker;\n };\n }\n }\n\n constructor({\n name = null,\n port = null,\n verbosity = getVerbosityLevel(),\n } = {}) {\n this.name = name;\n this.destroyed = false;\n this.verbosity = verbosity;\n\n if (port) {\n if (PDFWorker.#workerPorts.has(port)) {\n throw new Error(\"Cannot use more than one PDFWorker per port.\");\n }\n PDFWorker.#workerPorts.set(port, this);\n this.#initializeFromPort(port);\n } else {\n this.#initialize();\n }\n\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n // For testing purposes.\n Object.defineProperty(this, \"_webWorker\", {\n get() {\n return this.#webWorker;\n },\n });\n }\n }\n\n /**\n * Promise for worker initialization completion.\n * @type {Promise}\n */\n get promise() {\n return this.#capability.promise;\n }\n\n #resolve() {\n this.#capability.resolve();\n // Send global setting, e.g. verbosity level.\n this.#messageHandler.send(\"configure\", {\n verbosity: this.verbosity,\n });\n }\n\n /**\n * The current `workerPort`, when it exists.\n * @type {Worker}\n */\n get port() {\n return this.#port;\n }\n\n /**\n * The current MessageHandler-instance.\n * @type {MessageHandler}\n */\n get messageHandler() {\n return this.#messageHandler;\n }\n\n #initializeFromPort(port) {\n this.#port = port;\n this.#messageHandler = new MessageHandler(\"main\", \"worker\", port);\n this.#messageHandler.on(\"ready\", () => {\n // Ignoring \"ready\" event -- MessageHandler should already be initialized\n // and ready to accept messages.\n });\n this.#resolve();\n }\n\n #initialize() {\n // If worker support isn't disabled explicit and the browser has worker\n // support, create a new web worker and test if it/the browser fulfills\n // all requirements to run parts of pdf.js in a web worker.\n // Right now, the requirement is, that an Uint8Array is still an\n // Uint8Array as it arrives on the worker.\n if (\n PDFWorker.#isWorkerDisabled ||\n PDFWorker.#mainThreadWorkerMessageHandler\n ) {\n this.#setupFakeWorker();\n return;\n }\n let { workerSrc } = PDFWorker;\n\n try {\n // Wraps workerSrc path into blob URL, if the former does not belong\n // to the same origin.\n if (\n typeof PDFJSDev !== \"undefined\" &&\n PDFJSDev.test(\"GENERIC\") &&\n !PDFWorker._isSameOrigin(window.location, workerSrc)\n ) {\n workerSrc = PDFWorker._createCDNWrapper(\n new URL(workerSrc, window.location).href\n );\n }\n\n const worker = new Worker(workerSrc, { type: \"module\" });\n const messageHandler = new MessageHandler(\"main\", \"worker\", worker);\n const terminateEarly = () => {\n ac.abort();\n messageHandler.destroy();\n worker.terminate();\n if (this.destroyed) {\n this.#capability.reject(new Error(\"Worker was destroyed\"));\n } else {\n // Fall back to fake worker if the termination is caused by an\n // error (e.g. NetworkError / SecurityError).\n this.#setupFakeWorker();\n }\n };\n\n const ac = new AbortController();\n worker.addEventListener(\n \"error\",\n () => {\n if (!this.#webWorker) {\n // Worker failed to initialize due to an error. Clean up and fall\n // back to the fake worker.\n terminateEarly();\n }\n },\n { signal: ac.signal }\n );\n\n messageHandler.on(\"ready\", data => {\n ac.abort();\n if (this.destroyed || !(data instanceof Uint8Array)) {\n terminateEarly();\n return;\n }\n this.#messageHandler = messageHandler;\n this.#port = worker;\n this.#webWorker = worker;\n\n this.#resolve();\n });\n } catch {\n info(\"The worker has been disabled.\");\n this.#setupFakeWorker();\n }\n }\n\n #setupFakeWorker() {\n if (!PDFWorker.#isWorkerDisabled) {\n warn(\"Setting up fake worker.\");\n PDFWorker.#isWorkerDisabled = true;\n }\n\n PDFWorker._setupFakeWorkerGlobal\n .then(WorkerMessageHandler => {\n if (this.destroyed) {\n this.#capability.reject(new Error(\"Worker was destroyed\"));\n return;\n }\n const port = new LoopbackPort();\n this.#port = port;\n\n // All fake workers use the same port, making id unique.\n const id = `fake${PDFWorker.#fakeWorkerId++}`;\n\n // If the main thread is our worker, setup the handling for the\n // messages -- the main thread sends to it self.\n const workerHandler = new MessageHandler(id + \"_worker\", id, port);\n WorkerMessageHandler.setup(workerHandler, port);\n\n this.#messageHandler = new MessageHandler(id, id + \"_worker\", port);\n this.#resolve();\n })\n .catch(reason => {\n this.#capability.reject(\n new Error(`Setting up fake worker failed: \"${reason.message}\".`)\n );\n });\n }\n\n /**\n * Destroys the worker instance.\n */\n destroy() {\n this.destroyed = true;\n\n // We need to terminate only web worker created resource.\n this.#webWorker?.terminate();\n this.#webWorker = null;\n\n PDFWorker.#workerPorts.delete(this.#port);\n this.#port = null;\n\n this.#messageHandler?.destroy();\n this.#messageHandler = null;\n }\n\n /**\n * @param {PDFWorkerParameters} params - The worker initialization parameters.\n * @returns {PDFWorker}\n */\n static create(params) {\n const cachedPort = this.#workerPorts.get(params?.port);\n if (cachedPort) {\n if (cachedPort._pendingDestroy) {\n throw new Error(\n \"PDFWorker.create - the worker is being destroyed.\\n\" +\n \"Please remember to await `PDFDocumentLoadingTask.destroy()`-calls.\"\n );\n }\n return cachedPort;\n }\n return new PDFWorker(params);\n }\n\n /**\n * The current `workerSrc`, when it exists.\n * @type {string}\n */\n static get workerSrc() {\n if (GlobalWorkerOptions.workerSrc) {\n return GlobalWorkerOptions.workerSrc;\n }\n throw new Error('No \"GlobalWorkerOptions.workerSrc\" specified.');\n }\n\n static get #mainThreadWorkerMessageHandler() {\n try {\n return globalThis.pdfjsWorker?.WorkerMessageHandler || null;\n } catch {\n return null;\n }\n }\n\n // Loads worker code into the main-thread.\n static get _setupFakeWorkerGlobal() {\n const loader = async () => {\n if (this.#mainThreadWorkerMessageHandler) {\n // The worker was already loaded using e.g. a `