codex 1.5.19__py3-none-any.whl → 1.6.0a0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of codex might be problematic. Click here for more details.
- codex/exceptions.py +14 -5
- codex/librarian/covers/create.py +2 -1
- codex/librarian/covers/path.py +1 -2
- codex/librarian/importer/const.py +34 -13
- codex/librarian/importer/create_comics.py +0 -1
- codex/librarian/importer/create_fks.py +35 -21
- codex/librarian/importer/failed_imports.py +2 -2
- codex/librarian/importer/moved.py +12 -10
- codex/librarian/importer/query_fks.py +124 -78
- codex/librarian/importer/update_comics.py +0 -1
- codex/librarian/janitor/cleanup.py +35 -14
- codex/migrations/0027_sort_name.py +149 -0
- codex/models/admin.py +1 -0
- codex/models/base.py +3 -0
- codex/models/comic.py +32 -35
- codex/models/const.py +18 -0
- codex/models/functions.py +12 -0
- codex/models/groups.py +40 -8
- codex/models/paths.py +5 -4
- codex/models/query.py +91 -0
- codex/search/backend.py +2 -2
- codex/search/backend_search.py +232 -0
- codex/search/engine.py +1 -9
- codex/search/query.py +44 -0
- codex/serializers/admin.py +3 -1
- codex/serializers/browser/filters.py +3 -8
- codex/serializers/{metadata.py → browser/metadata.py} +1 -1
- codex/serializers/browser/mixins.py +32 -0
- codex/serializers/browser/page.py +6 -18
- codex/serializers/browser/settings.py +1 -0
- codex/serializers/choices.py +22 -12
- codex/serializers/mixins.py +0 -22
- codex/serializers/opds/urls.py +10 -0
- codex/serializers/reader.py +7 -13
- codex/serializers/route.py +36 -0
- codex/settings/settings.py +57 -25
- codex/signals/django_signals.py +6 -0
- codex/static_root/assets/{VCheckbox-D7WF5wMC.c98c1beb207e.js → VCheckbox-Aq_ImMNC.da711f8b6a15.js} +1 -1
- codex/static_root/assets/VCheckbox-Aq_ImMNC.da711f8b6a15.js.br +0 -0
- codex/static_root/assets/VCheckbox-Aq_ImMNC.da711f8b6a15.js.gz +0 -0
- codex/static_root/assets/{VCheckbox-D7WF5wMC.js → VCheckbox-Aq_ImMNC.js} +1 -1
- codex/static_root/assets/VCheckbox-Aq_ImMNC.js.br +0 -0
- codex/static_root/assets/VCheckbox-Aq_ImMNC.js.gz +0 -0
- codex/static_root/assets/{VCheckboxBtn-CzTNt4cV.39d03f0eaf4b.js → VCheckboxBtn-D3izCBa7.54f4d7f48bbf.js} +1 -1
- codex/static_root/assets/VCheckboxBtn-D3izCBa7.54f4d7f48bbf.js.br +0 -0
- codex/static_root/assets/VCheckboxBtn-D3izCBa7.54f4d7f48bbf.js.gz +0 -0
- codex/static_root/assets/{VCheckboxBtn-CzTNt4cV.js → VCheckboxBtn-D3izCBa7.js} +1 -1
- codex/static_root/assets/VCheckboxBtn-D3izCBa7.js.br +0 -0
- codex/static_root/assets/VCheckboxBtn-D3izCBa7.js.gz +0 -0
- codex/static_root/assets/VCombobox-DLL1EsSN.55622a0cd4ab.js +1 -0
- codex/static_root/assets/VCombobox-DLL1EsSN.55622a0cd4ab.js.br +0 -0
- codex/static_root/assets/VCombobox-DLL1EsSN.55622a0cd4ab.js.gz +0 -0
- codex/static_root/assets/VCombobox-DLL1EsSN.js +1 -0
- codex/static_root/assets/VCombobox-DLL1EsSN.js.br +0 -0
- codex/static_root/assets/VCombobox-DLL1EsSN.js.gz +0 -0
- codex/static_root/assets/VDialog-C5Nxd_zP.css +1 -0
- codex/static_root/assets/VDialog-C5Nxd_zP.css.br +0 -0
- codex/static_root/assets/VDialog-C5Nxd_zP.css.gz +0 -0
- codex/static_root/assets/VDialog-C5Nxd_zP.d327f505ef0e.css +1 -0
- codex/static_root/assets/VDialog-C5Nxd_zP.d327f505ef0e.css.br +0 -0
- codex/static_root/assets/VDialog-C5Nxd_zP.d327f505ef0e.css.gz +0 -0
- codex/static_root/assets/VDialog-yDKzaGEj.e8dba78ac8db.js +1 -0
- codex/static_root/assets/VDialog-yDKzaGEj.e8dba78ac8db.js.br +0 -0
- codex/static_root/assets/VDialog-yDKzaGEj.e8dba78ac8db.js.gz +0 -0
- codex/static_root/assets/VDialog-yDKzaGEj.js +1 -0
- codex/static_root/assets/VDialog-yDKzaGEj.js.br +0 -0
- codex/static_root/assets/VDialog-yDKzaGEj.js.gz +0 -0
- codex/static_root/assets/VExpansionPanels-Cpo8QLLq.d733b7906e00.js +1 -0
- codex/static_root/assets/VExpansionPanels-Cpo8QLLq.d733b7906e00.js.br +0 -0
- codex/static_root/assets/VExpansionPanels-Cpo8QLLq.d733b7906e00.js.gz +0 -0
- codex/static_root/assets/VExpansionPanels-Cpo8QLLq.js +1 -0
- codex/static_root/assets/VExpansionPanels-Cpo8QLLq.js.br +0 -0
- codex/static_root/assets/VExpansionPanels-Cpo8QLLq.js.gz +0 -0
- codex/static_root/assets/{VRadioGroup-DGplihzh.3f4a5d26a1cb.js → VRadioGroup-DEezv8bL.4a609e74e507.js} +1 -1
- codex/static_root/assets/VRadioGroup-DEezv8bL.4a609e74e507.js.br +0 -0
- codex/static_root/assets/VRadioGroup-DEezv8bL.4a609e74e507.js.gz +0 -0
- codex/static_root/assets/{VRadioGroup-DGplihzh.js → VRadioGroup-DEezv8bL.js} +1 -1
- codex/static_root/assets/VRadioGroup-DEezv8bL.js.br +0 -0
- codex/static_root/assets/VRadioGroup-DEezv8bL.js.gz +0 -0
- codex/static_root/assets/VSelect-ARDhJiQK.372c098fb475.css +1 -0
- codex/static_root/assets/VSelect-ARDhJiQK.372c098fb475.css.br +0 -0
- codex/static_root/assets/VSelect-ARDhJiQK.372c098fb475.css.gz +0 -0
- codex/static_root/assets/VSelect-ARDhJiQK.css +1 -0
- codex/static_root/assets/VSelect-ARDhJiQK.css.br +0 -0
- codex/static_root/assets/VSelect-ARDhJiQK.css.gz +0 -0
- codex/static_root/assets/VSelect-BKXcujPy.8871035f5634.js +1 -0
- codex/static_root/assets/VSelect-BKXcujPy.8871035f5634.js.br +0 -0
- codex/static_root/assets/VSelect-BKXcujPy.8871035f5634.js.gz +0 -0
- codex/static_root/assets/VSelect-BKXcujPy.js +1 -0
- codex/static_root/assets/VSelect-BKXcujPy.js.br +0 -0
- codex/static_root/assets/VSelect-BKXcujPy.js.gz +0 -0
- codex/static_root/assets/{VSelectionControl-DvHEDoJy.30ca0aef8bd2.js → VSelectionControl-DJAPiluk.402a7ad84a8e.js} +1 -1
- codex/static_root/assets/VSelectionControl-DJAPiluk.402a7ad84a8e.js.br +0 -0
- codex/static_root/assets/VSelectionControl-DJAPiluk.402a7ad84a8e.js.gz +0 -0
- codex/static_root/assets/{VSelectionControl-DvHEDoJy.js → VSelectionControl-DJAPiluk.js} +1 -1
- codex/static_root/assets/VSelectionControl-DJAPiluk.js.br +0 -0
- codex/static_root/assets/VSelectionControl-DJAPiluk.js.gz +0 -0
- codex/static_root/assets/VSlideGroup-C-kO93Va.8c9e31362dc5.js +1 -0
- codex/static_root/assets/VSlideGroup-C-kO93Va.8c9e31362dc5.js.br +0 -0
- codex/static_root/assets/VSlideGroup-C-kO93Va.8c9e31362dc5.js.gz +0 -0
- codex/static_root/assets/VSlideGroup-C-kO93Va.js +1 -0
- codex/static_root/assets/VSlideGroup-C-kO93Va.js.br +0 -0
- codex/static_root/assets/VSlideGroup-C-kO93Va.js.gz +0 -0
- codex/static_root/assets/VSlideGroup-Dk_1upHt.2c836070ec75.css +1 -0
- codex/static_root/assets/VSlideGroup-Dk_1upHt.2c836070ec75.css.br +0 -0
- codex/static_root/assets/VSlideGroup-Dk_1upHt.2c836070ec75.css.gz +0 -0
- codex/static_root/assets/VSlideGroup-Dk_1upHt.css +1 -0
- codex/static_root/assets/VSlideGroup-Dk_1upHt.css.br +0 -0
- codex/static_root/assets/VSlideGroup-Dk_1upHt.css.gz +0 -0
- codex/static_root/assets/{VTable-TEvK4Tmn.c68c176d93db.js → VTable-9vsIQObs.0a135029e924.js} +1 -1
- codex/static_root/assets/VTable-9vsIQObs.0a135029e924.js.br +0 -0
- codex/static_root/assets/VTable-9vsIQObs.0a135029e924.js.gz +0 -0
- codex/static_root/assets/{VTable-TEvK4Tmn.js → VTable-9vsIQObs.js} +1 -1
- codex/static_root/assets/VTable-9vsIQObs.js.br +0 -0
- codex/static_root/assets/VTable-9vsIQObs.js.gz +0 -0
- codex/static_root/assets/VTextField-DI9HAmWh.0de01739bbf9.js +1 -0
- codex/static_root/assets/VTextField-DI9HAmWh.0de01739bbf9.js.br +0 -0
- codex/static_root/assets/VTextField-DI9HAmWh.0de01739bbf9.js.gz +0 -0
- codex/static_root/assets/VTextField-DI9HAmWh.js +1 -0
- codex/static_root/assets/VTextField-DI9HAmWh.js.br +0 -0
- codex/static_root/assets/VTextField-DI9HAmWh.js.gz +0 -0
- codex/static_root/assets/{VSlideGroup-CTW-HJl4.css → VTextField-DuIIp-VY.580110ad24dc.css} +1 -1
- codex/static_root/assets/VTextField-DuIIp-VY.580110ad24dc.css.br +0 -0
- codex/static_root/assets/VTextField-DuIIp-VY.580110ad24dc.css.gz +0 -0
- codex/static_root/assets/{VSlideGroup-CTW-HJl4.8b75b66602c9.css → VTextField-DuIIp-VY.css} +1 -1
- codex/static_root/assets/VTextField-DuIIp-VY.css.br +0 -0
- codex/static_root/assets/VTextField-DuIIp-VY.css.gz +0 -0
- codex/static_root/assets/VWindowItem-DpnYkF3y.017d99c27b7b.js +1 -0
- codex/static_root/assets/VWindowItem-DpnYkF3y.017d99c27b7b.js.br +0 -0
- codex/static_root/assets/VWindowItem-DpnYkF3y.017d99c27b7b.js.gz +0 -0
- codex/static_root/assets/VWindowItem-DpnYkF3y.js +1 -0
- codex/static_root/assets/VWindowItem-DpnYkF3y.js.br +0 -0
- codex/static_root/assets/VWindowItem-DpnYkF3y.js.gz +0 -0
- codex/static_root/assets/admin-2BTkfSQA.e7ef29cb106d.js +1 -0
- codex/static_root/assets/admin-2BTkfSQA.e7ef29cb106d.js.br +0 -0
- codex/static_root/assets/admin-2BTkfSQA.e7ef29cb106d.js.gz +0 -0
- codex/static_root/assets/admin-2BTkfSQA.js +1 -0
- codex/static_root/assets/admin-2BTkfSQA.js.br +0 -0
- codex/static_root/assets/admin-2BTkfSQA.js.gz +0 -0
- codex/static_root/assets/admin-BbrOU9Y9.29936748af9e.css +1 -0
- codex/static_root/assets/admin-BbrOU9Y9.29936748af9e.css.br +0 -0
- codex/static_root/assets/admin-BbrOU9Y9.29936748af9e.css.gz +0 -0
- codex/static_root/assets/admin-BbrOU9Y9.css +1 -0
- codex/static_root/assets/admin-BbrOU9Y9.css.br +0 -0
- codex/static_root/assets/admin-BbrOU9Y9.css.gz +0 -0
- codex/static_root/assets/admin-drawer-panel-BF0dMvEE.1514926c78e8.css +1 -0
- codex/static_root/assets/admin-drawer-panel-BF0dMvEE.1514926c78e8.css.br +0 -0
- codex/static_root/assets/admin-drawer-panel-BF0dMvEE.1514926c78e8.css.gz +0 -0
- codex/static_root/assets/admin-drawer-panel-BF0dMvEE.css +1 -0
- codex/static_root/assets/admin-drawer-panel-BF0dMvEE.css.br +0 -0
- codex/static_root/assets/admin-drawer-panel-BF0dMvEE.css.gz +0 -0
- codex/static_root/assets/admin-drawer-panel-mtdde7vY.c172dbae9463.js +30 -0
- codex/static_root/assets/admin-drawer-panel-mtdde7vY.c172dbae9463.js.br +0 -0
- codex/static_root/assets/admin-drawer-panel-mtdde7vY.c172dbae9463.js.gz +0 -0
- codex/static_root/assets/admin-drawer-panel-mtdde7vY.js +30 -0
- codex/static_root/assets/admin-drawer-panel-mtdde7vY.js.br +0 -0
- codex/static_root/assets/admin-drawer-panel-mtdde7vY.js.gz +0 -0
- codex/static_root/assets/browser-BA-AwUn-.23bb4b2f6a29.js +1 -0
- codex/static_root/assets/browser-BA-AwUn-.23bb4b2f6a29.js.br +0 -0
- codex/static_root/assets/browser-BA-AwUn-.23bb4b2f6a29.js.gz +0 -0
- codex/static_root/assets/browser-BA-AwUn-.js +1 -0
- codex/static_root/assets/browser-BA-AwUn-.js.br +0 -0
- codex/static_root/assets/browser-BA-AwUn-.js.gz +0 -0
- codex/static_root/assets/browser-CZeVqRNy.ccfca9a05bfe.css +1 -0
- codex/static_root/assets/browser-CZeVqRNy.ccfca9a05bfe.css.br +0 -0
- codex/static_root/assets/browser-CZeVqRNy.ccfca9a05bfe.css.gz +0 -0
- codex/static_root/assets/browser-CZeVqRNy.css +1 -0
- codex/static_root/assets/browser-CZeVqRNy.css.br +0 -0
- codex/static_root/assets/browser-CZeVqRNy.css.gz +0 -0
- codex/static_root/assets/change-password-dialog-C8YONrId.49aa6df6a91d.js +1 -0
- codex/static_root/assets/change-password-dialog-C8YONrId.49aa6df6a91d.js.br +0 -0
- codex/static_root/assets/change-password-dialog-C8YONrId.49aa6df6a91d.js.gz +0 -0
- codex/static_root/assets/change-password-dialog-C8YONrId.js +1 -0
- codex/static_root/assets/change-password-dialog-C8YONrId.js.br +0 -0
- codex/static_root/assets/change-password-dialog-C8YONrId.js.gz +0 -0
- codex/static_root/assets/change-password-dialog-HvIvmmIE.73be0c8a8278.css +1 -0
- codex/static_root/assets/change-password-dialog-HvIvmmIE.73be0c8a8278.css.br +0 -0
- codex/static_root/assets/change-password-dialog-HvIvmmIE.73be0c8a8278.css.gz +0 -0
- codex/static_root/assets/change-password-dialog-HvIvmmIE.css +1 -0
- codex/static_root/assets/change-password-dialog-HvIvmmIE.css.br +0 -0
- codex/static_root/assets/change-password-dialog-HvIvmmIE.css.gz +0 -0
- codex/static_root/assets/confirm-dialog-Clg-o2G-.e11d8efef3fb.js +1 -0
- codex/static_root/assets/confirm-dialog-Clg-o2G-.e11d8efef3fb.js.br +0 -0
- codex/static_root/assets/confirm-dialog-Clg-o2G-.e11d8efef3fb.js.gz +0 -0
- codex/static_root/assets/confirm-dialog-Clg-o2G-.js +1 -0
- codex/static_root/assets/confirm-dialog-Clg-o2G-.js.br +0 -0
- codex/static_root/assets/confirm-dialog-Clg-o2G-.js.gz +0 -0
- codex/static_root/assets/{datetime-column-C3t430gN.97e5c5364aef.js → datetime-column-DejrPZxl.9fd36bef6fdd.js} +1 -1
- codex/static_root/assets/datetime-column-DejrPZxl.9fd36bef6fdd.js.br +0 -0
- codex/static_root/assets/datetime-column-DejrPZxl.9fd36bef6fdd.js.gz +0 -0
- codex/static_root/assets/{datetime-column-C3t430gN.js → datetime-column-DejrPZxl.js} +1 -1
- codex/static_root/assets/datetime-column-DejrPZxl.js.br +0 -0
- codex/static_root/assets/datetime-column-DejrPZxl.js.gz +0 -0
- codex/static_root/assets/datetime-column-Dg_RxTVM.1fa7c5cbead7.css +1 -0
- codex/static_root/assets/datetime-column-Dg_RxTVM.1fa7c5cbead7.css.br +0 -0
- codex/static_root/assets/datetime-column-Dg_RxTVM.css +1 -0
- codex/static_root/assets/datetime-column-Dg_RxTVM.css.br +0 -0
- codex/static_root/assets/{filter-BQ_FuhIp.ee8b78c4aa55.js → filter-DHo57nTp.4d79a276d806.js} +1 -1
- codex/static_root/assets/filter-DHo57nTp.4d79a276d806.js.br +0 -0
- codex/static_root/assets/filter-DHo57nTp.4d79a276d806.js.gz +0 -0
- codex/static_root/assets/{filter-BQ_FuhIp.js → filter-DHo57nTp.js} +1 -1
- codex/static_root/assets/filter-DHo57nTp.js.br +0 -0
- codex/static_root/assets/filter-DHo57nTp.js.gz +0 -0
- codex/static_root/assets/flag-tab-BacZLlVi.8deba6a5370d.css +1 -0
- codex/static_root/assets/flag-tab-BacZLlVi.8deba6a5370d.css.br +0 -0
- codex/static_root/assets/flag-tab-BacZLlVi.8deba6a5370d.css.gz +0 -0
- codex/static_root/assets/flag-tab-BacZLlVi.css +1 -0
- codex/static_root/assets/flag-tab-BacZLlVi.css.br +0 -0
- codex/static_root/assets/flag-tab-BacZLlVi.css.gz +0 -0
- codex/static_root/assets/flag-tab-CagMLGSE.125739911c45.js +1 -0
- codex/static_root/assets/flag-tab-CagMLGSE.125739911c45.js.br +0 -0
- codex/static_root/assets/flag-tab-CagMLGSE.125739911c45.js.gz +0 -0
- codex/static_root/assets/flag-tab-CagMLGSE.js +1 -0
- codex/static_root/assets/flag-tab-CagMLGSE.js.br +0 -0
- codex/static_root/assets/flag-tab-CagMLGSE.js.gz +0 -0
- codex/static_root/assets/group-tab-BTAjhv32.ac196780d0a9.js +1 -0
- codex/static_root/assets/group-tab-BTAjhv32.ac196780d0a9.js.br +0 -0
- codex/static_root/assets/group-tab-BTAjhv32.ac196780d0a9.js.gz +0 -0
- codex/static_root/assets/group-tab-BTAjhv32.js +1 -0
- codex/static_root/assets/group-tab-BTAjhv32.js.br +0 -0
- codex/static_root/assets/group-tab-BTAjhv32.js.gz +0 -0
- codex/static_root/assets/group-tab-CBKuS3Iv.7e4746634782.css +1 -0
- codex/static_root/assets/group-tab-CBKuS3Iv.7e4746634782.css.br +0 -0
- codex/static_root/assets/group-tab-CBKuS3Iv.7e4746634782.css.gz +0 -0
- codex/static_root/assets/group-tab-CBKuS3Iv.css +1 -0
- codex/static_root/assets/group-tab-CBKuS3Iv.css.br +0 -0
- codex/static_root/assets/group-tab-CBKuS3Iv.css.gz +0 -0
- codex/static_root/assets/http-error-DaHEsKbT.55d56ce2b9b4.js +1 -0
- codex/static_root/assets/http-error-DaHEsKbT.55d56ce2b9b4.js.br +0 -0
- codex/static_root/assets/http-error-DaHEsKbT.55d56ce2b9b4.js.gz +0 -0
- codex/static_root/assets/http-error-DaHEsKbT.js +1 -0
- codex/static_root/assets/http-error-DaHEsKbT.js.br +0 -0
- codex/static_root/assets/http-error-DaHEsKbT.js.gz +0 -0
- codex/static_root/assets/http-error-_wlDqEcp.5b78d3e332c9.css +1 -0
- codex/static_root/assets/http-error-_wlDqEcp.5b78d3e332c9.css.br +0 -0
- codex/static_root/assets/http-error-_wlDqEcp.5b78d3e332c9.css.gz +0 -0
- codex/static_root/assets/http-error-_wlDqEcp.css +1 -0
- codex/static_root/assets/http-error-_wlDqEcp.css.br +0 -0
- codex/static_root/assets/http-error-_wlDqEcp.css.gz +0 -0
- codex/static_root/assets/library-tab-CXbkxNZt.954f2850a439.css +1 -0
- codex/static_root/assets/library-tab-CXbkxNZt.954f2850a439.css.br +2 -0
- codex/static_root/assets/library-tab-CXbkxNZt.954f2850a439.css.gz +0 -0
- codex/static_root/assets/library-tab-CXbkxNZt.css +1 -0
- codex/static_root/assets/library-tab-CXbkxNZt.css.br +2 -0
- codex/static_root/assets/library-tab-CXbkxNZt.css.gz +0 -0
- codex/static_root/assets/library-tab-Cud4639b.7f5a50aaabe8.js +1 -0
- codex/static_root/assets/library-tab-Cud4639b.7f5a50aaabe8.js.br +0 -0
- codex/static_root/assets/library-tab-Cud4639b.7f5a50aaabe8.js.gz +0 -0
- codex/static_root/assets/library-tab-Cud4639b.js +1 -0
- codex/static_root/assets/library-tab-Cud4639b.js.br +0 -0
- codex/static_root/assets/library-tab-Cud4639b.js.gz +0 -0
- codex/static_root/assets/main-BnzL_Byv.22f98ee91990.js +32 -0
- codex/static_root/assets/main-BnzL_Byv.22f98ee91990.js.br +0 -0
- codex/static_root/assets/main-BnzL_Byv.22f98ee91990.js.gz +0 -0
- codex/static_root/assets/main-BnzL_Byv.js +32 -0
- codex/static_root/assets/main-BnzL_Byv.js.br +0 -0
- codex/static_root/assets/main-BnzL_Byv.js.gz +0 -0
- codex/static_root/assets/{main-ED57DJUb.b84231dc384d.css → main-sK7HC5h4.6f04ddfc5f1a.css} +1 -1
- codex/static_root/assets/main-sK7HC5h4.6f04ddfc5f1a.css.br +0 -0
- codex/static_root/assets/{main-ED57DJUb.b84231dc384d.css.gz → main-sK7HC5h4.6f04ddfc5f1a.css.gz} +0 -0
- codex/static_root/assets/{main-ED57DJUb.css → main-sK7HC5h4.css} +1 -1
- codex/static_root/assets/main-sK7HC5h4.css.br +0 -0
- codex/static_root/assets/{main-ED57DJUb.css.gz → main-sK7HC5h4.css.gz} +0 -0
- codex/static_root/assets/pagination-toolbar-B3wS4_7p.7695fafdefce.css +1 -0
- codex/static_root/assets/pagination-toolbar-B3wS4_7p.7695fafdefce.css.br +0 -0
- codex/static_root/assets/pagination-toolbar-B3wS4_7p.7695fafdefce.css.gz +0 -0
- codex/static_root/assets/pagination-toolbar-B3wS4_7p.css +1 -0
- codex/static_root/assets/pagination-toolbar-B3wS4_7p.css.br +0 -0
- codex/static_root/assets/pagination-toolbar-B3wS4_7p.css.gz +0 -0
- codex/static_root/assets/pagination-toolbar-Covpd-k8.b71277bd7a2d.js +1 -0
- codex/static_root/assets/pagination-toolbar-Covpd-k8.b71277bd7a2d.js.br +0 -0
- codex/static_root/assets/pagination-toolbar-Covpd-k8.b71277bd7a2d.js.gz +0 -0
- codex/static_root/assets/pagination-toolbar-Covpd-k8.js +1 -0
- codex/static_root/assets/pagination-toolbar-Covpd-k8.js.br +0 -0
- codex/static_root/assets/pagination-toolbar-Covpd-k8.js.gz +0 -0
- codex/static_root/assets/{pdf-doc-x5fJF5N8.67b5456d222e.js → pdf-doc-CD2lnB32.1cef3bf498be.js} +1 -1
- codex/static_root/assets/pdf-doc-CD2lnB32.1cef3bf498be.js.br +0 -0
- codex/static_root/assets/pdf-doc-CD2lnB32.1cef3bf498be.js.gz +0 -0
- codex/static_root/assets/{pdf-doc-x5fJF5N8.js → pdf-doc-CD2lnB32.js} +1 -1
- codex/static_root/assets/pdf-doc-CD2lnB32.js.br +0 -0
- codex/static_root/assets/pdf-doc-CD2lnB32.js.gz +0 -0
- codex/static_root/assets/reader-Dspy46e8.925a6b05bfcf.css +1 -0
- codex/static_root/assets/reader-Dspy46e8.925a6b05bfcf.css.br +0 -0
- codex/static_root/assets/reader-Dspy46e8.925a6b05bfcf.css.gz +0 -0
- codex/static_root/assets/reader-Dspy46e8.css +1 -0
- codex/static_root/assets/reader-Dspy46e8.css.br +0 -0
- codex/static_root/assets/reader-Dspy46e8.css.gz +0 -0
- codex/static_root/assets/reader-L85y7IXD.6de58f450421.js +2 -0
- codex/static_root/assets/reader-L85y7IXD.6de58f450421.js.br +0 -0
- codex/static_root/assets/reader-L85y7IXD.6de58f450421.js.gz +0 -0
- codex/static_root/assets/reader-L85y7IXD.js +2 -0
- codex/static_root/assets/reader-L85y7IXD.js.br +0 -0
- codex/static_root/assets/reader-L85y7IXD.js.gz +0 -0
- codex/static_root/assets/relation-chips-BpuqEeqM.1372d8a3e6cf.js +1 -0
- codex/static_root/assets/relation-chips-BpuqEeqM.1372d8a3e6cf.js.br +0 -0
- codex/static_root/assets/relation-chips-BpuqEeqM.1372d8a3e6cf.js.gz +0 -0
- codex/static_root/assets/relation-chips-BpuqEeqM.js +1 -0
- codex/static_root/assets/relation-chips-BpuqEeqM.js.br +0 -0
- codex/static_root/assets/relation-chips-BpuqEeqM.js.gz +0 -0
- codex/static_root/assets/relation-chips-D6T6FX7G.css +1 -0
- codex/static_root/assets/relation-chips-D6T6FX7G.css.br +0 -0
- codex/static_root/assets/relation-chips-D6T6FX7G.css.gz +0 -0
- codex/static_root/assets/relation-chips-D6T6FX7G.db095b2497e4.css +1 -0
- codex/static_root/assets/relation-chips-D6T6FX7G.db095b2497e4.css.br +0 -0
- codex/static_root/assets/relation-chips-D6T6FX7G.db095b2497e4.css.gz +0 -0
- codex/static_root/assets/settings-drawer-BgUazs7O.7bbeb1fd98f1.css +1 -0
- codex/static_root/assets/settings-drawer-BgUazs7O.7bbeb1fd98f1.css.br +0 -0
- codex/static_root/assets/settings-drawer-BgUazs7O.7bbeb1fd98f1.css.gz +0 -0
- codex/static_root/assets/settings-drawer-BgUazs7O.css +1 -0
- codex/static_root/assets/settings-drawer-BgUazs7O.css.br +0 -0
- codex/static_root/assets/settings-drawer-BgUazs7O.css.gz +0 -0
- codex/static_root/assets/settings-drawer-CLMcxfVd.b9619341ad48.js +2 -0
- codex/static_root/assets/settings-drawer-CLMcxfVd.b9619341ad48.js.br +0 -0
- codex/static_root/assets/settings-drawer-CLMcxfVd.b9619341ad48.js.gz +0 -0
- codex/static_root/assets/settings-drawer-CLMcxfVd.js +2 -0
- codex/static_root/assets/settings-drawer-CLMcxfVd.js.br +0 -0
- codex/static_root/assets/settings-drawer-CLMcxfVd.js.gz +0 -0
- codex/static_root/assets/stats-tab-CQa3-W05.3d7c61418528.js +1 -0
- codex/static_root/assets/stats-tab-CQa3-W05.3d7c61418528.js.br +0 -0
- codex/static_root/assets/stats-tab-CQa3-W05.3d7c61418528.js.gz +0 -0
- codex/static_root/assets/stats-tab-CQa3-W05.js +1 -0
- codex/static_root/assets/stats-tab-CQa3-W05.js.br +0 -0
- codex/static_root/assets/stats-tab-CQa3-W05.js.gz +0 -0
- codex/static_root/assets/stats-tab-TsyG3wH_.b93c080356fc.css +1 -0
- codex/static_root/assets/stats-tab-TsyG3wH_.b93c080356fc.css.br +2 -0
- codex/static_root/assets/stats-tab-TsyG3wH_.b93c080356fc.css.gz +0 -0
- codex/static_root/assets/stats-tab-TsyG3wH_.css +1 -0
- codex/static_root/assets/stats-tab-TsyG3wH_.css.br +2 -0
- codex/static_root/assets/stats-tab-TsyG3wH_.css.gz +0 -0
- codex/static_root/assets/task-tab-1XiWn9xP.06cb8e1b794d.css +1 -0
- codex/static_root/assets/{task-tab-DoX9OA37.9bb355f36dbf.css.br → task-tab-1XiWn9xP.06cb8e1b794d.css.br} +1 -1
- codex/static_root/assets/task-tab-1XiWn9xP.06cb8e1b794d.css.gz +0 -0
- codex/static_root/assets/task-tab-1XiWn9xP.css +1 -0
- codex/static_root/assets/{task-tab-DoX9OA37.css.br → task-tab-1XiWn9xP.css.br} +1 -1
- codex/static_root/assets/task-tab-1XiWn9xP.css.gz +0 -0
- codex/static_root/assets/task-tab-OPhBm-O2.8f31f4215114.js +1 -0
- codex/static_root/assets/task-tab-OPhBm-O2.8f31f4215114.js.br +0 -0
- codex/static_root/assets/task-tab-OPhBm-O2.8f31f4215114.js.gz +0 -0
- codex/static_root/assets/task-tab-OPhBm-O2.js +1 -0
- codex/static_root/assets/task-tab-OPhBm-O2.js.br +0 -0
- codex/static_root/assets/task-tab-OPhBm-O2.js.gz +0 -0
- codex/static_root/assets/unauthorized-ClQNhRb5.32a8a84d1781.js +1 -0
- codex/static_root/assets/unauthorized-ClQNhRb5.32a8a84d1781.js.br +0 -0
- codex/static_root/assets/unauthorized-ClQNhRb5.32a8a84d1781.js.gz +0 -0
- codex/static_root/assets/unauthorized-ClQNhRb5.js +1 -0
- codex/static_root/assets/unauthorized-ClQNhRb5.js.br +0 -0
- codex/static_root/assets/unauthorized-ClQNhRb5.js.gz +0 -0
- codex/static_root/assets/unauthorized-DWgytUow.ca2f13dbdbf5.css +1 -0
- codex/static_root/assets/unauthorized-DWgytUow.ca2f13dbdbf5.css.br +0 -0
- codex/static_root/assets/unauthorized-DWgytUow.ca2f13dbdbf5.css.gz +0 -0
- codex/static_root/assets/unauthorized-DWgytUow.css +1 -0
- codex/static_root/assets/unauthorized-DWgytUow.css.br +0 -0
- codex/static_root/assets/unauthorized-DWgytUow.css.gz +0 -0
- codex/static_root/assets/user-tab-BKkxa2WL.50d83951c09f.js +1 -0
- codex/static_root/assets/user-tab-BKkxa2WL.50d83951c09f.js.br +0 -0
- codex/static_root/assets/user-tab-BKkxa2WL.50d83951c09f.js.gz +0 -0
- codex/static_root/assets/user-tab-BKkxa2WL.js +1 -0
- codex/static_root/assets/user-tab-BKkxa2WL.js.br +0 -0
- codex/static_root/assets/user-tab-BKkxa2WL.js.gz +0 -0
- codex/static_root/img/folder.f28936a3701d.svg +1 -0
- codex/static_root/img/folder.f28936a3701d.svg.br +0 -0
- codex/static_root/img/folder.f28936a3701d.svg.gz +0 -0
- codex/static_root/img/folder.svg +1 -0
- codex/static_root/img/folder.svg.br +0 -0
- codex/static_root/img/folder.svg.gz +0 -0
- codex/static_root/img/imprint.7c2adebb76d6.svg +1 -0
- codex/static_root/img/imprint.7c2adebb76d6.svg.br +0 -0
- codex/static_root/img/imprint.7c2adebb76d6.svg.gz +0 -0
- codex/static_root/img/imprint.svg +1 -0
- codex/static_root/img/imprint.svg.br +0 -0
- codex/static_root/img/imprint.svg.gz +0 -0
- codex/static_root/img/logo-32.5688944495bf.webp +0 -0
- codex/static_root/img/logo-32.webp +0 -0
- codex/static_root/img/logo-maskable-180.c58d966aa64e.webp +0 -0
- codex/static_root/img/logo-maskable-180.webp +0 -0
- codex/static_root/img/logo-maskable.8f7de7f1c6a8.svg +1 -0
- codex/static_root/img/logo-maskable.8f7de7f1c6a8.svg.br +0 -0
- codex/static_root/img/logo-maskable.8f7de7f1c6a8.svg.gz +0 -0
- codex/static_root/img/logo-maskable.svg +1 -83
- codex/static_root/img/logo-maskable.svg.br +0 -0
- codex/static_root/img/logo-maskable.svg.gz +0 -0
- codex/static_root/img/logo.0f5344a028ca.svg +1 -0
- codex/static_root/img/logo.0f5344a028ca.svg.br +0 -0
- codex/static_root/img/logo.0f5344a028ca.svg.gz +0 -0
- codex/static_root/img/logo.svg +1 -80
- codex/static_root/img/logo.svg.br +0 -0
- codex/static_root/img/logo.svg.gz +0 -0
- codex/static_root/img/missing-cover-165.0743171f2148.webp +0 -0
- codex/static_root/img/missing-cover-165.webp +0 -0
- codex/static_root/img/missing-cover.ddb038cc2c56.svg +1 -0
- codex/static_root/img/missing-cover.ddb038cc2c56.svg.br +0 -0
- codex/static_root/img/missing-cover.ddb038cc2c56.svg.gz +0 -0
- codex/static_root/img/missing-cover.svg +1 -0
- codex/static_root/img/missing-cover.svg.br +0 -0
- codex/static_root/img/missing-cover.svg.gz +0 -0
- codex/static_root/img/publisher.82d378fcd601.svg +1 -0
- codex/static_root/img/publisher.82d378fcd601.svg.br +0 -0
- codex/static_root/img/publisher.82d378fcd601.svg.gz +0 -0
- codex/static_root/img/publisher.svg +1 -0
- codex/static_root/img/publisher.svg.br +0 -0
- codex/static_root/img/publisher.svg.gz +0 -0
- codex/static_root/img/series.ec8a889b8f95.svg +1 -0
- codex/static_root/img/series.ec8a889b8f95.svg.br +0 -0
- codex/static_root/img/series.ec8a889b8f95.svg.gz +0 -0
- codex/static_root/img/series.svg +1 -0
- codex/static_root/img/series.svg.br +0 -0
- codex/static_root/img/series.svg.gz +0 -0
- codex/static_root/img/story-arc.ca10014355ef.svg +1 -0
- codex/static_root/img/story-arc.ca10014355ef.svg.br +1 -0
- codex/static_root/img/story-arc.ca10014355ef.svg.gz +0 -0
- codex/static_root/img/story-arc.svg +1 -0
- codex/static_root/img/story-arc.svg.br +1 -0
- codex/static_root/img/story-arc.svg.gz +0 -0
- codex/static_root/img/volume.814e4c79461a.svg +1 -0
- codex/static_root/img/volume.814e4c79461a.svg.br +0 -0
- codex/static_root/img/volume.814e4c79461a.svg.gz +0 -0
- codex/static_root/img/volume.svg +1 -0
- codex/static_root/img/volume.svg.br +0 -0
- codex/static_root/img/volume.svg.gz +0 -0
- codex/static_root/js/{choices-admin.bb730e4f26ac.json → choices-admin.248384ece3f6.json} +1 -1
- codex/static_root/js/choices-admin.248384ece3f6.json.br +0 -0
- codex/static_root/js/choices-admin.248384ece3f6.json.gz +0 -0
- codex/static_root/js/choices-admin.json +1 -1
- codex/static_root/js/choices-admin.json.br +0 -0
- codex/static_root/js/choices-admin.json.gz +0 -0
- codex/static_root/js/choices.b60817ba0a93.json +1 -0
- codex/static_root/js/choices.b60817ba0a93.json.br +0 -0
- codex/static_root/js/choices.b60817ba0a93.json.gz +0 -0
- codex/static_root/js/choices.json +1 -1
- codex/static_root/js/choices.json.br +0 -0
- codex/static_root/js/choices.json.gz +0 -0
- codex/static_root/manifest.c5fa10a7dfdc.json +641 -0
- codex/static_root/manifest.c5fa10a7dfdc.json.br +0 -0
- codex/static_root/manifest.c5fa10a7dfdc.json.gz +0 -0
- codex/static_root/manifest.json +354 -320
- codex/static_root/manifest.json.br +0 -0
- codex/static_root/manifest.json.gz +0 -0
- codex/static_root/staticfiles.json +1 -1
- codex/templates/headers-script-globals.html +1 -4
- codex/urls/api/admin.py +5 -7
- codex/urls/api/browser.py +5 -5
- codex/urls/api/reader.py +3 -3
- codex/urls/api/v3.py +2 -0
- codex/urls/app.py +8 -3
- codex/urls/converters.py +39 -0
- codex/urls/opds/root.py +3 -4
- codex/urls/opds/v1.py +1 -1
- codex/urls/opds/v2.py +6 -1
- codex/urls/root.py +2 -1
- codex/views/admin/user.py +0 -5
- codex/views/auth.py +10 -12
- codex/views/bookmark.py +6 -5
- codex/views/browser/base.py +88 -26
- codex/views/browser/browser.py +245 -319
- codex/views/browser/browser_annotations.py +236 -187
- codex/views/browser/browser_breadcrumbs.py +175 -0
- codex/views/browser/browser_order_by.py +44 -89
- codex/views/browser/choices.py +39 -45
- codex/views/browser/filters/annotations.py +34 -0
- codex/views/browser/filters/group.py +8 -7
- codex/views/browser/filters/search.py +157 -24
- codex/views/browser/metadata.py +98 -104
- codex/views/const.py +17 -0
- codex/views/cover.py +22 -4
- codex/views/download.py +3 -12
- codex/views/error.py +2 -2
- codex/views/frontend.py +4 -1
- codex/views/mixins.py +76 -0
- codex/views/opds/urls.py +28 -0
- codex/views/opds/util.py +7 -7
- codex/views/opds/v1/entry/data.py +2 -2
- codex/views/opds/v1/entry/entry.py +5 -5
- codex/views/opds/v1/entry/links.py +69 -44
- codex/views/opds/v1/facets.py +4 -4
- codex/views/opds/v1/feed.py +32 -21
- codex/views/opds/v1/links.py +14 -14
- codex/views/opds/v1/opensearch_v1.py +4 -1
- codex/views/opds/v2/feed.py +52 -35
- codex/views/opds/v2/publications.py +17 -15
- codex/views/opds/v2/top_links.py +2 -2
- codex/views/reader/page.py +4 -0
- codex/views/reader/reader.py +168 -79
- codex/views/session.py +21 -12
- {codex-1.5.19.dist-info → codex-1.6.0a0.dist-info}/METADATA +22 -11
- {codex-1.5.19.dist-info → codex-1.6.0a0.dist-info}/RECORD +488 -429
- codex/db_functions.py +0 -25
- codex/img/missing-cover.webp +0 -0
- codex/static_root/assets/VCheckbox-D7WF5wMC.c98c1beb207e.js.br +0 -0
- codex/static_root/assets/VCheckbox-D7WF5wMC.c98c1beb207e.js.gz +0 -0
- codex/static_root/assets/VCheckbox-D7WF5wMC.js.br +0 -0
- codex/static_root/assets/VCheckbox-D7WF5wMC.js.gz +0 -0
- codex/static_root/assets/VCheckboxBtn-CzTNt4cV.39d03f0eaf4b.js.br +0 -0
- codex/static_root/assets/VCheckboxBtn-CzTNt4cV.39d03f0eaf4b.js.gz +0 -0
- codex/static_root/assets/VCheckboxBtn-CzTNt4cV.js.br +0 -0
- codex/static_root/assets/VCheckboxBtn-CzTNt4cV.js.gz +0 -0
- codex/static_root/assets/VCombobox-BWrSBDP9.52f0c0067437.js +0 -1
- codex/static_root/assets/VCombobox-BWrSBDP9.52f0c0067437.js.br +0 -0
- codex/static_root/assets/VCombobox-BWrSBDP9.52f0c0067437.js.gz +0 -0
- codex/static_root/assets/VCombobox-BWrSBDP9.js +0 -1
- codex/static_root/assets/VCombobox-BWrSBDP9.js.br +0 -0
- codex/static_root/assets/VCombobox-BWrSBDP9.js.gz +0 -0
- codex/static_root/assets/VDataTableVirtual-BMondxto.8b48739e5470.js +0 -1
- codex/static_root/assets/VDataTableVirtual-BMondxto.8b48739e5470.js.br +0 -0
- codex/static_root/assets/VDataTableVirtual-BMondxto.8b48739e5470.js.gz +0 -0
- codex/static_root/assets/VDataTableVirtual-BMondxto.js +0 -1
- codex/static_root/assets/VDataTableVirtual-BMondxto.js.br +0 -0
- codex/static_root/assets/VDataTableVirtual-BMondxto.js.gz +0 -0
- codex/static_root/assets/VDataTableVirtual-C5zDmmxd.a73a7dd5614a.css +0 -1
- codex/static_root/assets/VDataTableVirtual-C5zDmmxd.a73a7dd5614a.css.br +0 -0
- codex/static_root/assets/VDataTableVirtual-C5zDmmxd.a73a7dd5614a.css.gz +0 -0
- codex/static_root/assets/VDataTableVirtual-C5zDmmxd.css +0 -1
- codex/static_root/assets/VDataTableVirtual-C5zDmmxd.css.br +0 -0
- codex/static_root/assets/VDataTableVirtual-C5zDmmxd.css.gz +0 -0
- codex/static_root/assets/VExpansionPanels-CDS9qp1D.9fdf68e2f68f.js +0 -1
- codex/static_root/assets/VExpansionPanels-CDS9qp1D.9fdf68e2f68f.js.br +0 -0
- codex/static_root/assets/VExpansionPanels-CDS9qp1D.9fdf68e2f68f.js.gz +0 -0
- codex/static_root/assets/VExpansionPanels-CDS9qp1D.js +0 -1
- codex/static_root/assets/VExpansionPanels-CDS9qp1D.js.br +0 -0
- codex/static_root/assets/VExpansionPanels-CDS9qp1D.js.gz +0 -0
- codex/static_root/assets/VMain-8vjSGbNt.4a97ed735dc3.js +0 -1
- codex/static_root/assets/VMain-8vjSGbNt.4a97ed735dc3.js.br +0 -0
- codex/static_root/assets/VMain-8vjSGbNt.4a97ed735dc3.js.gz +0 -0
- codex/static_root/assets/VMain-8vjSGbNt.js +0 -1
- codex/static_root/assets/VMain-8vjSGbNt.js.br +0 -0
- codex/static_root/assets/VMain-8vjSGbNt.js.gz +0 -0
- codex/static_root/assets/VMain-Byt37V4c.a00e206f3cfa.css +0 -1
- codex/static_root/assets/VMain-Byt37V4c.a00e206f3cfa.css.br +0 -0
- codex/static_root/assets/VMain-Byt37V4c.a00e206f3cfa.css.gz +0 -0
- codex/static_root/assets/VMain-Byt37V4c.css +0 -1
- codex/static_root/assets/VMain-Byt37V4c.css.br +0 -0
- codex/static_root/assets/VMain-Byt37V4c.css.gz +0 -0
- codex/static_root/assets/VRadioGroup-DGplihzh.3f4a5d26a1cb.js.br +0 -0
- codex/static_root/assets/VRadioGroup-DGplihzh.3f4a5d26a1cb.js.gz +0 -0
- codex/static_root/assets/VRadioGroup-DGplihzh.js.br +0 -0
- codex/static_root/assets/VRadioGroup-DGplihzh.js.gz +0 -0
- codex/static_root/assets/VSelect-DfV5vhqb.d24dcc61a20f.js +0 -1
- codex/static_root/assets/VSelect-DfV5vhqb.d24dcc61a20f.js.br +0 -0
- codex/static_root/assets/VSelect-DfV5vhqb.d24dcc61a20f.js.gz +0 -0
- codex/static_root/assets/VSelect-DfV5vhqb.js +0 -1
- codex/static_root/assets/VSelect-DfV5vhqb.js.br +0 -0
- codex/static_root/assets/VSelect-DfV5vhqb.js.gz +0 -0
- codex/static_root/assets/VSelect-MGVSeLgr.7cabd30bc5e4.css +0 -1
- codex/static_root/assets/VSelect-MGVSeLgr.7cabd30bc5e4.css.br +0 -0
- codex/static_root/assets/VSelect-MGVSeLgr.7cabd30bc5e4.css.gz +0 -0
- codex/static_root/assets/VSelect-MGVSeLgr.css +0 -1
- codex/static_root/assets/VSelect-MGVSeLgr.css.br +0 -0
- codex/static_root/assets/VSelect-MGVSeLgr.css.gz +0 -0
- codex/static_root/assets/VSelectionControl-DvHEDoJy.30ca0aef8bd2.js.br +0 -0
- codex/static_root/assets/VSelectionControl-DvHEDoJy.30ca0aef8bd2.js.gz +0 -0
- codex/static_root/assets/VSelectionControl-DvHEDoJy.js.br +0 -0
- codex/static_root/assets/VSelectionControl-DvHEDoJy.js.gz +0 -0
- codex/static_root/assets/VSlideGroup-BdgkaRxE.ba78a4e0efc0.js +0 -1
- codex/static_root/assets/VSlideGroup-BdgkaRxE.ba78a4e0efc0.js.br +0 -0
- codex/static_root/assets/VSlideGroup-BdgkaRxE.ba78a4e0efc0.js.gz +0 -0
- codex/static_root/assets/VSlideGroup-BdgkaRxE.js +0 -1
- codex/static_root/assets/VSlideGroup-BdgkaRxE.js.br +0 -0
- codex/static_root/assets/VSlideGroup-BdgkaRxE.js.gz +0 -0
- codex/static_root/assets/VSlideGroup-CTW-HJl4.8b75b66602c9.css.br +0 -0
- codex/static_root/assets/VSlideGroup-CTW-HJl4.8b75b66602c9.css.gz +0 -0
- codex/static_root/assets/VSlideGroup-CTW-HJl4.css.br +0 -0
- codex/static_root/assets/VSlideGroup-CTW-HJl4.css.gz +0 -0
- codex/static_root/assets/VTable-TEvK4Tmn.c68c176d93db.js.br +0 -0
- codex/static_root/assets/VTable-TEvK4Tmn.c68c176d93db.js.gz +0 -0
- codex/static_root/assets/VTable-TEvK4Tmn.js.br +0 -0
- codex/static_root/assets/VTable-TEvK4Tmn.js.gz +0 -0
- codex/static_root/assets/VToolbar-D7BgLWdG.css +0 -1
- codex/static_root/assets/VToolbar-D7BgLWdG.css.br +0 -0
- codex/static_root/assets/VToolbar-D7BgLWdG.css.gz +0 -0
- codex/static_root/assets/VToolbar-D7BgLWdG.e4d8a79cc655.css +0 -1
- codex/static_root/assets/VToolbar-D7BgLWdG.e4d8a79cc655.css.br +0 -0
- codex/static_root/assets/VToolbar-D7BgLWdG.e4d8a79cc655.css.gz +0 -0
- codex/static_root/assets/VToolbar-DCXw9xBt.576c107a78d3.js +0 -2
- codex/static_root/assets/VToolbar-DCXw9xBt.576c107a78d3.js.br +0 -0
- codex/static_root/assets/VToolbar-DCXw9xBt.576c107a78d3.js.gz +0 -0
- codex/static_root/assets/VToolbar-DCXw9xBt.js +0 -2
- codex/static_root/assets/VToolbar-DCXw9xBt.js.br +0 -0
- codex/static_root/assets/VToolbar-DCXw9xBt.js.gz +0 -0
- codex/static_root/assets/VWindowItem-CCYriq5i.8a6d4a38dabd.js +0 -1
- codex/static_root/assets/VWindowItem-CCYriq5i.8a6d4a38dabd.js.br +0 -0
- codex/static_root/assets/VWindowItem-CCYriq5i.8a6d4a38dabd.js.gz +0 -0
- codex/static_root/assets/VWindowItem-CCYriq5i.js +0 -1
- codex/static_root/assets/VWindowItem-CCYriq5i.js.br +0 -0
- codex/static_root/assets/VWindowItem-CCYriq5i.js.gz +0 -0
- codex/static_root/assets/admin-A2T028Mn.be3fa80456de.js +0 -1
- codex/static_root/assets/admin-A2T028Mn.be3fa80456de.js.br +0 -0
- codex/static_root/assets/admin-A2T028Mn.be3fa80456de.js.gz +0 -0
- codex/static_root/assets/admin-A2T028Mn.js +0 -1
- codex/static_root/assets/admin-A2T028Mn.js.br +0 -0
- codex/static_root/assets/admin-A2T028Mn.js.gz +0 -0
- codex/static_root/assets/admin-C8Kk7_Ni.255594400b96.css +0 -1
- codex/static_root/assets/admin-C8Kk7_Ni.255594400b96.css.br +0 -0
- codex/static_root/assets/admin-C8Kk7_Ni.255594400b96.css.gz +0 -0
- codex/static_root/assets/admin-C8Kk7_Ni.css +0 -1
- codex/static_root/assets/admin-C8Kk7_Ni.css.br +0 -0
- codex/static_root/assets/admin-C8Kk7_Ni.css.gz +0 -0
- codex/static_root/assets/admin-drawer-panel-DffXGW1d.8f7f39ffb127.js +0 -30
- codex/static_root/assets/admin-drawer-panel-DffXGW1d.8f7f39ffb127.js.br +0 -0
- codex/static_root/assets/admin-drawer-panel-DffXGW1d.8f7f39ffb127.js.gz +0 -0
- codex/static_root/assets/admin-drawer-panel-DffXGW1d.js +0 -30
- codex/static_root/assets/admin-drawer-panel-DffXGW1d.js.br +0 -0
- codex/static_root/assets/admin-drawer-panel-DffXGW1d.js.gz +0 -0
- codex/static_root/assets/admin-drawer-panel-Dv_IY0x2.af4fa9980c09.css +0 -1
- codex/static_root/assets/admin-drawer-panel-Dv_IY0x2.af4fa9980c09.css.br +0 -0
- codex/static_root/assets/admin-drawer-panel-Dv_IY0x2.af4fa9980c09.css.gz +0 -0
- codex/static_root/assets/admin-drawer-panel-Dv_IY0x2.css +0 -1
- codex/static_root/assets/admin-drawer-panel-Dv_IY0x2.css.br +0 -0
- codex/static_root/assets/admin-drawer-panel-Dv_IY0x2.css.gz +0 -0
- codex/static_root/assets/browser-CY9BdW6B.c9c3e5dffcbf.js +0 -1
- codex/static_root/assets/browser-CY9BdW6B.c9c3e5dffcbf.js.br +0 -0
- codex/static_root/assets/browser-CY9BdW6B.c9c3e5dffcbf.js.gz +0 -0
- codex/static_root/assets/browser-CY9BdW6B.js +0 -1
- codex/static_root/assets/browser-CY9BdW6B.js.br +0 -0
- codex/static_root/assets/browser-CY9BdW6B.js.gz +0 -0
- codex/static_root/assets/browser-HtKThxA9.69be059a55f4.css +0 -1
- codex/static_root/assets/browser-HtKThxA9.69be059a55f4.css.br +0 -0
- codex/static_root/assets/browser-HtKThxA9.69be059a55f4.css.gz +0 -0
- codex/static_root/assets/browser-HtKThxA9.css +0 -1
- codex/static_root/assets/browser-HtKThxA9.css.br +0 -0
- codex/static_root/assets/browser-HtKThxA9.css.gz +0 -0
- codex/static_root/assets/change-password-dialog-BRmvkNir.2fead58a78c7.css +0 -1
- codex/static_root/assets/change-password-dialog-BRmvkNir.2fead58a78c7.css.br +0 -0
- codex/static_root/assets/change-password-dialog-BRmvkNir.2fead58a78c7.css.gz +0 -0
- codex/static_root/assets/change-password-dialog-BRmvkNir.css +0 -1
- codex/static_root/assets/change-password-dialog-BRmvkNir.css.br +0 -0
- codex/static_root/assets/change-password-dialog-BRmvkNir.css.gz +0 -0
- codex/static_root/assets/change-password-dialog-Dr1CYQ46.afdd502a985d.js +0 -1
- codex/static_root/assets/change-password-dialog-Dr1CYQ46.afdd502a985d.js.br +0 -0
- codex/static_root/assets/change-password-dialog-Dr1CYQ46.afdd502a985d.js.gz +0 -0
- codex/static_root/assets/change-password-dialog-Dr1CYQ46.js +0 -1
- codex/static_root/assets/change-password-dialog-Dr1CYQ46.js.br +0 -0
- codex/static_root/assets/change-password-dialog-Dr1CYQ46.js.gz +0 -0
- codex/static_root/assets/confirm-dialog-BoVvCI5y.8549e2429bdf.js +0 -1
- codex/static_root/assets/confirm-dialog-BoVvCI5y.8549e2429bdf.js.br +0 -0
- codex/static_root/assets/confirm-dialog-BoVvCI5y.8549e2429bdf.js.gz +0 -0
- codex/static_root/assets/confirm-dialog-BoVvCI5y.js +0 -1
- codex/static_root/assets/confirm-dialog-BoVvCI5y.js.br +0 -0
- codex/static_root/assets/confirm-dialog-BoVvCI5y.js.gz +0 -0
- codex/static_root/assets/confirm-footer-BPuy6r_H.3aa74b8e07c1.css +0 -1
- codex/static_root/assets/confirm-footer-BPuy6r_H.3aa74b8e07c1.css.br +0 -0
- codex/static_root/assets/confirm-footer-BPuy6r_H.3aa74b8e07c1.css.gz +0 -0
- codex/static_root/assets/confirm-footer-BPuy6r_H.css +0 -1
- codex/static_root/assets/confirm-footer-BPuy6r_H.css.br +0 -0
- codex/static_root/assets/confirm-footer-BPuy6r_H.css.gz +0 -0
- codex/static_root/assets/confirm-footer-CIu2tkFD.0aa16c0fc333.js +0 -1
- codex/static_root/assets/confirm-footer-CIu2tkFD.0aa16c0fc333.js.br +0 -0
- codex/static_root/assets/confirm-footer-CIu2tkFD.0aa16c0fc333.js.gz +0 -0
- codex/static_root/assets/confirm-footer-CIu2tkFD.js +0 -1
- codex/static_root/assets/confirm-footer-CIu2tkFD.js.br +0 -0
- codex/static_root/assets/confirm-footer-CIu2tkFD.js.gz +0 -0
- codex/static_root/assets/datetime-column-BWWfvyhn.a4a94ba57c73.css +0 -1
- codex/static_root/assets/datetime-column-BWWfvyhn.a4a94ba57c73.css.br +0 -0
- codex/static_root/assets/datetime-column-BWWfvyhn.css +0 -1
- codex/static_root/assets/datetime-column-BWWfvyhn.css.br +0 -0
- codex/static_root/assets/datetime-column-C3t430gN.97e5c5364aef.js.br +0 -0
- codex/static_root/assets/datetime-column-C3t430gN.97e5c5364aef.js.gz +0 -0
- codex/static_root/assets/datetime-column-C3t430gN.js.br +0 -0
- codex/static_root/assets/datetime-column-C3t430gN.js.gz +0 -0
- codex/static_root/assets/filter-BQ_FuhIp.ee8b78c4aa55.js.br +0 -0
- codex/static_root/assets/filter-BQ_FuhIp.ee8b78c4aa55.js.gz +0 -0
- codex/static_root/assets/filter-BQ_FuhIp.js.br +0 -0
- codex/static_root/assets/filter-BQ_FuhIp.js.gz +0 -0
- codex/static_root/assets/flag-tab-D380D1SI.f4bc34623651.js +0 -1
- codex/static_root/assets/flag-tab-D380D1SI.f4bc34623651.js.br +0 -0
- codex/static_root/assets/flag-tab-D380D1SI.f4bc34623651.js.gz +0 -0
- codex/static_root/assets/flag-tab-D380D1SI.js +0 -1
- codex/static_root/assets/flag-tab-D380D1SI.js.br +0 -0
- codex/static_root/assets/flag-tab-D380D1SI.js.gz +0 -0
- codex/static_root/assets/flag-tab-D_HjkAta.203bedf35ce7.css +0 -1
- codex/static_root/assets/flag-tab-D_HjkAta.203bedf35ce7.css.br +0 -0
- codex/static_root/assets/flag-tab-D_HjkAta.203bedf35ce7.css.gz +0 -0
- codex/static_root/assets/flag-tab-D_HjkAta.css +0 -1
- codex/static_root/assets/flag-tab-D_HjkAta.css.br +0 -0
- codex/static_root/assets/flag-tab-D_HjkAta.css.gz +0 -0
- codex/static_root/assets/group-tab-CDcOyQyw.9c85a4fb987a.js +0 -1
- codex/static_root/assets/group-tab-CDcOyQyw.9c85a4fb987a.js.br +0 -0
- codex/static_root/assets/group-tab-CDcOyQyw.9c85a4fb987a.js.gz +0 -0
- codex/static_root/assets/group-tab-CDcOyQyw.js +0 -1
- codex/static_root/assets/group-tab-CDcOyQyw.js.br +0 -0
- codex/static_root/assets/group-tab-CDcOyQyw.js.gz +0 -0
- codex/static_root/assets/group-tab-GFacGljN.98df9e04f2a7.css +0 -1
- codex/static_root/assets/group-tab-GFacGljN.98df9e04f2a7.css.br +0 -0
- codex/static_root/assets/group-tab-GFacGljN.98df9e04f2a7.css.gz +0 -0
- codex/static_root/assets/group-tab-GFacGljN.css +0 -1
- codex/static_root/assets/group-tab-GFacGljN.css.br +0 -0
- codex/static_root/assets/group-tab-GFacGljN.css.gz +0 -0
- codex/static_root/assets/http-error-C25WdjWC.1c7337ad6e1d.css +0 -1
- codex/static_root/assets/http-error-C25WdjWC.1c7337ad6e1d.css.br +0 -0
- codex/static_root/assets/http-error-C25WdjWC.1c7337ad6e1d.css.gz +0 -0
- codex/static_root/assets/http-error-C25WdjWC.css +0 -1
- codex/static_root/assets/http-error-C25WdjWC.css.br +0 -0
- codex/static_root/assets/http-error-C25WdjWC.css.gz +0 -0
- codex/static_root/assets/http-error-D4BCbtF2.d3d31021f2ca.js +0 -1
- codex/static_root/assets/http-error-D4BCbtF2.d3d31021f2ca.js.br +0 -0
- codex/static_root/assets/http-error-D4BCbtF2.d3d31021f2ca.js.gz +0 -0
- codex/static_root/assets/http-error-D4BCbtF2.js +0 -1
- codex/static_root/assets/http-error-D4BCbtF2.js.br +0 -0
- codex/static_root/assets/http-error-D4BCbtF2.js.gz +0 -0
- codex/static_root/assets/library-tab-BpWTK9vs.b2a752770db5.js +0 -1
- codex/static_root/assets/library-tab-BpWTK9vs.b2a752770db5.js.br +0 -0
- codex/static_root/assets/library-tab-BpWTK9vs.b2a752770db5.js.gz +0 -0
- codex/static_root/assets/library-tab-BpWTK9vs.js +0 -1
- codex/static_root/assets/library-tab-BpWTK9vs.js.br +0 -0
- codex/static_root/assets/library-tab-BpWTK9vs.js.gz +0 -0
- codex/static_root/assets/library-tab-DZKDtQ5v.c8123e4bc5a4.css +0 -1
- codex/static_root/assets/library-tab-DZKDtQ5v.c8123e4bc5a4.css.br +0 -3
- codex/static_root/assets/library-tab-DZKDtQ5v.c8123e4bc5a4.css.gz +0 -0
- codex/static_root/assets/library-tab-DZKDtQ5v.css +0 -1
- codex/static_root/assets/library-tab-DZKDtQ5v.css.br +0 -3
- codex/static_root/assets/library-tab-DZKDtQ5v.css.gz +0 -0
- codex/static_root/assets/main-DB0zDxIA.e71734100695.js +0 -32
- codex/static_root/assets/main-DB0zDxIA.e71734100695.js.br +0 -0
- codex/static_root/assets/main-DB0zDxIA.e71734100695.js.gz +0 -0
- codex/static_root/assets/main-DB0zDxIA.js +0 -32
- codex/static_root/assets/main-DB0zDxIA.js.br +0 -0
- codex/static_root/assets/main-DB0zDxIA.js.gz +0 -0
- codex/static_root/assets/main-ED57DJUb.b84231dc384d.css.br +0 -0
- codex/static_root/assets/main-ED57DJUb.css.br +0 -0
- codex/static_root/assets/metadata-dialog-BlvHIpPe.aca38025f67b.js +0 -1
- codex/static_root/assets/metadata-dialog-BlvHIpPe.aca38025f67b.js.br +0 -0
- codex/static_root/assets/metadata-dialog-BlvHIpPe.aca38025f67b.js.gz +0 -0
- codex/static_root/assets/metadata-dialog-BlvHIpPe.js +0 -1
- codex/static_root/assets/metadata-dialog-BlvHIpPe.js.br +0 -0
- codex/static_root/assets/metadata-dialog-BlvHIpPe.js.gz +0 -0
- codex/static_root/assets/metadata-dialog-CNrYFyyx.87cbe14f8752.css +0 -1
- codex/static_root/assets/metadata-dialog-CNrYFyyx.87cbe14f8752.css.br +0 -0
- codex/static_root/assets/metadata-dialog-CNrYFyyx.87cbe14f8752.css.gz +0 -0
- codex/static_root/assets/metadata-dialog-CNrYFyyx.css +0 -1
- codex/static_root/assets/metadata-dialog-CNrYFyyx.css.br +0 -0
- codex/static_root/assets/metadata-dialog-CNrYFyyx.css.gz +0 -0
- codex/static_root/assets/pdf-doc-x5fJF5N8.67b5456d222e.js.br +0 -0
- codex/static_root/assets/pdf-doc-x5fJF5N8.67b5456d222e.js.gz +0 -0
- codex/static_root/assets/pdf-doc-x5fJF5N8.js.br +0 -0
- codex/static_root/assets/pdf-doc-x5fJF5N8.js.gz +0 -0
- codex/static_root/assets/reader-BDo-P8Ww.46ce70253011.css +0 -1
- codex/static_root/assets/reader-BDo-P8Ww.46ce70253011.css.br +0 -0
- codex/static_root/assets/reader-BDo-P8Ww.46ce70253011.css.gz +0 -0
- codex/static_root/assets/reader-BDo-P8Ww.css +0 -1
- codex/static_root/assets/reader-BDo-P8Ww.css.br +0 -0
- codex/static_root/assets/reader-BDo-P8Ww.css.gz +0 -0
- codex/static_root/assets/reader-CXmsYhy4.3f98149c37d9.js +0 -2
- codex/static_root/assets/reader-CXmsYhy4.3f98149c37d9.js.br +0 -0
- codex/static_root/assets/reader-CXmsYhy4.3f98149c37d9.js.gz +0 -0
- codex/static_root/assets/reader-CXmsYhy4.js +0 -2
- codex/static_root/assets/reader-CXmsYhy4.js.br +0 -0
- codex/static_root/assets/reader-CXmsYhy4.js.gz +0 -0
- codex/static_root/assets/stats-tab-BTZLMBCU.7e0a9547c12e.css +0 -1
- codex/static_root/assets/stats-tab-BTZLMBCU.7e0a9547c12e.css.br +0 -0
- codex/static_root/assets/stats-tab-BTZLMBCU.7e0a9547c12e.css.gz +0 -0
- codex/static_root/assets/stats-tab-BTZLMBCU.css +0 -1
- codex/static_root/assets/stats-tab-BTZLMBCU.css.br +0 -0
- codex/static_root/assets/stats-tab-BTZLMBCU.css.gz +0 -0
- codex/static_root/assets/stats-tab-xK8fU37K.24f65a4c7479.js +0 -1
- codex/static_root/assets/stats-tab-xK8fU37K.24f65a4c7479.js.br +0 -0
- codex/static_root/assets/stats-tab-xK8fU37K.24f65a4c7479.js.gz +0 -0
- codex/static_root/assets/stats-tab-xK8fU37K.js +0 -1
- codex/static_root/assets/stats-tab-xK8fU37K.js.br +0 -0
- codex/static_root/assets/stats-tab-xK8fU37K.js.gz +0 -0
- codex/static_root/assets/task-tab-D-j9C5kb.f8defdafa5d1.js +0 -1
- codex/static_root/assets/task-tab-D-j9C5kb.f8defdafa5d1.js.br +0 -0
- codex/static_root/assets/task-tab-D-j9C5kb.f8defdafa5d1.js.gz +0 -0
- codex/static_root/assets/task-tab-D-j9C5kb.js +0 -1
- codex/static_root/assets/task-tab-D-j9C5kb.js.br +0 -0
- codex/static_root/assets/task-tab-D-j9C5kb.js.gz +0 -0
- codex/static_root/assets/task-tab-DoX9OA37.9bb355f36dbf.css +0 -1
- codex/static_root/assets/task-tab-DoX9OA37.9bb355f36dbf.css.gz +0 -0
- codex/static_root/assets/task-tab-DoX9OA37.css +0 -1
- codex/static_root/assets/task-tab-DoX9OA37.css.gz +0 -0
- codex/static_root/assets/user-tab-DMcrO04A.501813c958bd.js +0 -1
- codex/static_root/assets/user-tab-DMcrO04A.501813c958bd.js.br +0 -0
- codex/static_root/assets/user-tab-DMcrO04A.501813c958bd.js.gz +0 -0
- codex/static_root/assets/user-tab-DMcrO04A.js +0 -1
- codex/static_root/assets/user-tab-DMcrO04A.js.br +0 -0
- codex/static_root/assets/user-tab-DMcrO04A.js.gz +0 -0
- codex/static_root/img/logo-32.dbb98f6dfde4.webp +0 -0
- codex/static_root/img/logo-maskable-180.201cbde62d55.webp +0 -0
- codex/static_root/img/logo-maskable.d618c2d7943f.svg +0 -83
- codex/static_root/img/logo-maskable.d618c2d7943f.svg.br +0 -0
- codex/static_root/img/logo-maskable.d618c2d7943f.svg.gz +0 -0
- codex/static_root/img/logo.3fb129bfbd92.svg +0 -80
- codex/static_root/img/logo.3fb129bfbd92.svg.br +0 -0
- codex/static_root/img/logo.3fb129bfbd92.svg.gz +0 -0
- codex/static_root/img/missing-cover.8c8c1d4f6782.webp +0 -0
- codex/static_root/img/missing-cover.webp +0 -0
- codex/static_root/img/missing-page.71bb10f7c72a.svg +0 -13
- codex/static_root/img/missing-page.71bb10f7c72a.svg.br +0 -0
- codex/static_root/img/missing-page.71bb10f7c72a.svg.gz +0 -0
- codex/static_root/img/missing-page.svg +0 -13
- codex/static_root/img/missing-page.svg.br +0 -0
- codex/static_root/img/missing-page.svg.gz +0 -0
- codex/static_root/js/choices-admin.bb730e4f26ac.json.br +0 -0
- codex/static_root/js/choices-admin.bb730e4f26ac.json.gz +0 -0
- codex/static_root/js/choices.fedcbd1ec085.json +0 -1
- codex/static_root/js/choices.fedcbd1ec085.json.br +0 -0
- codex/static_root/js/choices.fedcbd1ec085.json.gz +0 -0
- codex/static_root/manifest.8e6c35516db7.json +0 -607
- codex/static_root/manifest.8e6c35516db7.json.br +0 -0
- codex/static_root/manifest.8e6c35516db7.json.gz +0 -0
- {codex-1.5.19.dist-info → codex-1.6.0a0.dist-info}/LICENSE +0 -0
- {codex-1.5.19.dist-info → codex-1.6.0a0.dist-info}/WHEEL +0 -0
- {codex-1.5.19.dist-info → codex-1.6.0a0.dist-info}/entry_points.txt +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var Ks=Object.defineProperty;var vs=(lt,r,h)=>r in lt?Ks(lt,r,{enumerable:!0,configurable:!0,writable:!0,value:h}):lt[r]=h;var gl=(lt,r,h)=>(vs(lt,typeof r!="symbol"?r+"":r,h),h),Xe=(lt,r,h)=>{if(!r.has(lt))throw TypeError("Cannot "+h)};var bt=(lt,r,h)=>(Xe(lt,r,"read from private field"),h?h.call(lt):r.get(lt)),ll=(lt,r,h)=>{if(r.has(lt))throw TypeError("Cannot add the same private member more than once");r instanceof WeakSet?r.add(lt):r.set(lt,h)},ul=(lt,r,h,M)=>(Xe(lt,r,"write to private field"),M?M.call(lt,h):r.set(lt,h),h);var Al=(lt,r,h,M)=>({set _(p){ul(lt,r,p,h)},get _(){return bt(lt,r,M)}}),nl=(lt,r,h)=>(Xe(lt,r,"access private method"),h);import{s as shallowRef,w as watchEffect,dA as toValue,o as onBeforeUnmount,e as defineComponent,r as ref,ax as toRef,h as computed,a as watch,R as openBlock,aB as createElementBlock,M as Fragment,aC as renderList,aN as renderSlot,aG as createBaseVNode,aE as createCommentVNode,bn as normalizeStyle,_ as _export_sfc,aA as mapGetters,N as mapState,O as mapActions,Q as resolveComponent,P as createBlock,af as normalizeClass}from"./admin-drawer-panel-DffXGW1d.js";import{g as getAugmentedNamespace$1}from"./main-DB0zDxIA.js";import{u as useReaderStore}from"./VToolbar-DCXw9xBt.js";import"./index-DUjeNg4x.js";import"./confirm-footer-CIu2tkFD.js";import"./change-password-dialog-Dr1CYQ46.js";import"./VSlideGroup-BdgkaRxE.js";import"./VSelectionControl-DvHEDoJy.js";function commonjsRequire$1(lt){throw new Error('Could not dynamically require "'+lt+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var pdf$1={exports:{}};const __viteBrowserExternal$2={},__viteBrowserExternal$3=Object.freeze(Object.defineProperty({__proto__:null,default:__viteBrowserExternal$2},Symbol.toStringTag,{value:"Module"})),require$$5=getAugmentedNamespace$1(__viteBrowserExternal$3);(function(module,exports){(function(r,h){module.exports=r.pdfjsLib=h()})(globalThis,()=>(()=>{var __webpack_modules__=[,(lt,r)=>{var Vl;Object.defineProperty(r,"__esModule",{value:!0}),r.VerbosityLevel=r.Util=r.UnknownErrorException=r.UnexpectedResponseException=r.TextRenderingMode=r.RenderingIntentFlag=r.PromiseCapability=r.PermissionFlag=r.PasswordResponses=r.PasswordException=r.PageActionEventType=r.OPS=r.MissingPDFException=r.MAX_IMAGE_SIZE_TO_CACHE=r.LINE_FACTOR=r.LINE_DESCENT_FACTOR=r.InvalidPDFException=r.ImageKind=r.IDENTITY_MATRIX=r.FormatError=r.FeatureTest=r.FONT_IDENTITY_MATRIX=r.DocumentActionEventType=r.CMapCompressionType=r.BaseException=r.BASELINE_FACTOR=r.AnnotationType=r.AnnotationReplyType=r.AnnotationPrefix=r.AnnotationMode=r.AnnotationFlag=r.AnnotationFieldFlag=r.AnnotationEditorType=r.AnnotationEditorPrefix=r.AnnotationEditorParamsType=r.AnnotationBorderStyleType=r.AnnotationActionEventType=r.AbortException=void 0,r.assert=Ut,r.bytesToString=Mt,r.createValidAbsoluteUrl=Ht,r.getModificationDate=dl,r.getUuid=Ll,r.getVerbosityLevel=Xt,r.info=zt,r.isArrayBuffer=Ct,r.isArrayEqual=$t,r.isNodeJS=void 0,r.normalizeUnicode=pl,r.objectFromMap=Dt,r.objectSize=Jt,r.setVerbosityLevel=it,r.shadow=Pt,r.string32=gt,r.stringToBytes=Rt,r.stringToPDFString=Ft,r.stringToUTF8String=wt,r.unreachable=Nt,r.utf8StringToString=pt,r.warn=Gt;const h=typeof process=="object"&&process+""=="[object process]"&&!process.versions.nw&&!(process.versions.electron&&process.type&&process.type!=="browser");r.isNodeJS=h;const M=[1,0,0,1,0,0];r.IDENTITY_MATRIX=M;const p=[.001,0,0,.001,0,0];r.FONT_IDENTITY_MATRIX=p;const B=1e7;r.MAX_IMAGE_SIZE_TO_CACHE=B;const Q=1.35;r.LINE_FACTOR=Q;const U=.35;r.LINE_DESCENT_FACTOR=U;const O=U/Q;r.BASELINE_FACTOR=O;const I={ANY:1,DISPLAY:2,PRINT:4,SAVE:8,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,OPLIST:256};r.RenderingIntentFlag=I;const j={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3};r.AnnotationMode=j;const q="pdfjs_internal_editor_";r.AnnotationEditorPrefix=q;const K={DISABLE:-1,NONE:0,FREETEXT:3,STAMP:13,INK:15};r.AnnotationEditorType=K;const f={RESIZE:1,CREATE:2,FREETEXT_SIZE:11,FREETEXT_COLOR:12,FREETEXT_OPACITY:13,INK_COLOR:21,INK_THICKNESS:22,INK_OPACITY:23};r.AnnotationEditorParamsType=f;const S={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048};r.PermissionFlag=S;const k={FILL:0,STROKE:1,FILL_STROKE:2,INVISIBLE:3,FILL_ADD_TO_PATH:4,STROKE_ADD_TO_PATH:5,FILL_STROKE_ADD_TO_PATH:6,ADD_TO_PATH:7,FILL_STROKE_MASK:3,ADD_TO_PATH_FLAG:4};r.TextRenderingMode=k;const T={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3};r.ImageKind=T;const g={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};r.AnnotationType=g;const F={GROUP:"Group",REPLY:"R"};r.AnnotationReplyType=F;const J={INVISIBLE:1,HIDDEN:2,PRINT:4,NOZOOM:8,NOROTATE:16,NOVIEW:32,READONLY:64,LOCKED:128,TOGGLENOVIEW:256,LOCKEDCONTENTS:512};r.AnnotationFlag=J;const v={READONLY:1,REQUIRED:2,NOEXPORT:4,MULTILINE:4096,PASSWORD:8192,NOTOGGLETOOFF:16384,RADIO:32768,PUSHBUTTON:65536,COMBO:131072,EDIT:262144,SORT:524288,FILESELECT:1048576,MULTISELECT:2097152,DONOTSPELLCHECK:4194304,DONOTSCROLL:8388608,COMB:16777216,RICHTEXT:33554432,RADIOSINUNISON:33554432,COMMITONSELCHANGE:67108864};r.AnnotationFieldFlag=v;const u={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5};r.AnnotationBorderStyleType=u;const m={E:"Mouse Enter",X:"Mouse Exit",D:"Mouse Down",U:"Mouse Up",Fo:"Focus",Bl:"Blur",PO:"PageOpen",PC:"PageClose",PV:"PageVisible",PI:"PageInvisible",K:"Keystroke",F:"Format",V:"Validate",C:"Calculate"};r.AnnotationActionEventType=m;const _={WC:"WillClose",WS:"WillSave",DS:"DidSave",WP:"WillPrint",DP:"DidPrint"};r.DocumentActionEventType=_;const $={O:"PageOpen",C:"PageClose"};r.PageActionEventType=$;const P={ERRORS:0,WARNINGS:1,INFOS:5};r.VerbosityLevel=P;const Zt={NONE:0,BINARY:1};r.CMapCompressionType=Zt;const dt={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};r.OPS=dt;const It={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};r.PasswordResponses=It;let xt=P.WARNINGS;function it(_t){Number.isInteger(_t)&&(xt=_t)}function Xt(){return xt}function zt(_t){xt>=P.INFOS&&console.log(`Info: ${_t}`)}function Gt(_t){xt>=P.WARNINGS&&console.log(`Warning: ${_t}`)}function Nt(_t){throw new Error(_t)}function Ut(_t,ot){_t||Nt(ot)}function Vt(_t){switch(_t==null?void 0:_t.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}function Ht(_t,ot=null,ut=null){if(!_t)return null;try{if(ut&&typeof _t=="string"){if(ut.addDefaultProtocol&&_t.startsWith("www.")){const jt=_t.match(/\./g);(jt==null?void 0:jt.length)>=2&&(_t=`http://${_t}`)}if(ut.tryConvertEncoding)try{_t=wt(_t)}catch{}}const Tt=ot?new URL(_t,ot):new URL(_t);if(Vt(Tt))return Tt}catch{}return null}function Pt(_t,ot,ut,Tt=!1){return Object.defineProperty(_t,ot,{value:ut,enumerable:!Tt,configurable:!0,writable:!1}),ut}const at=function(){function ot(ut,Tt){this.constructor===ot&&Nt("Cannot initialize BaseException."),this.message=ut,this.name=Tt}return ot.prototype=new Error,ot.constructor=ot,ot}();r.BaseException=at;class R extends at{constructor(ot,ut){super(ot,"PasswordException"),this.code=ut}}r.PasswordException=R;class w extends at{constructor(ot,ut){super(ot,"UnknownErrorException"),this.details=ut}}r.UnknownErrorException=w;class X extends at{constructor(ot){super(ot,"InvalidPDFException")}}r.InvalidPDFException=X;class C extends at{constructor(ot){super(ot,"MissingPDFException")}}r.MissingPDFException=C;class H extends at{constructor(ot,ut){super(ot,"UnexpectedResponseException"),this.status=ut}}r.UnexpectedResponseException=H;class st extends at{constructor(ot){super(ot,"FormatError")}}r.FormatError=st;class et extends at{constructor(ot){super(ot,"AbortException")}}r.AbortException=et;function Mt(_t){(typeof _t!="object"||(_t==null?void 0:_t.length)===void 0)&&Nt("Invalid argument for bytesToString");const ot=_t.length,ut=8192;if(ot<ut)return String.fromCharCode.apply(null,_t);const Tt=[];for(let jt=0;jt<ot;jt+=ut){const Ot=Math.min(jt+ut,ot),Lt=_t.subarray(jt,Ot);Tt.push(String.fromCharCode.apply(null,Lt))}return Tt.join("")}function Rt(_t){typeof _t!="string"&&Nt("Invalid argument for stringToBytes");const ot=_t.length,ut=new Uint8Array(ot);for(let Tt=0;Tt<ot;++Tt)ut[Tt]=_t.charCodeAt(Tt)&255;return ut}function gt(_t){return String.fromCharCode(_t>>24&255,_t>>16&255,_t>>8&255,_t&255)}function Jt(_t){return Object.keys(_t).length}function Dt(_t){const ot=Object.create(null);for(const[ut,Tt]of _t)ot[ut]=Tt;return ot}function qt(){const _t=new Uint8Array(4);return _t[0]=1,new Uint32Array(_t.buffer,0,1)[0]===1}function vt(){try{return new Function(""),!0}catch{return!1}}class cl{static get isLittleEndian(){return Pt(this,"isLittleEndian",qt())}static get isEvalSupported(){return Pt(this,"isEvalSupported",vt())}static get isOffscreenCanvasSupported(){return Pt(this,"isOffscreenCanvasSupported",typeof OffscreenCanvas<"u")}static get platform(){return typeof navigator>"u"?Pt(this,"platform",{isWin:!1,isMac:!1}):Pt(this,"platform",{isWin:navigator.platform.includes("Win"),isMac:navigator.platform.includes("Mac")})}static get isCSSRoundSupported(){var ot,ut;return Pt(this,"isCSSRoundSupported",(ut=(ot=globalThis.CSS)==null?void 0:ot.supports)==null?void 0:ut.call(ot,"width: round(1.5px, 1px)"))}}r.FeatureTest=cl;const bl=[...Array(256).keys()].map(_t=>_t.toString(16).padStart(2,"0"));class il{static makeHexColor(ot,ut,Tt){return`#${bl[ot]}${bl[ut]}${bl[Tt]}`}static scaleMinMax(ot,ut){let Tt;ot[0]?(ot[0]<0&&(Tt=ut[0],ut[0]=ut[1],ut[1]=Tt),ut[0]*=ot[0],ut[1]*=ot[0],ot[3]<0&&(Tt=ut[2],ut[2]=ut[3],ut[3]=Tt),ut[2]*=ot[3],ut[3]*=ot[3]):(Tt=ut[0],ut[0]=ut[2],ut[2]=Tt,Tt=ut[1],ut[1]=ut[3],ut[3]=Tt,ot[1]<0&&(Tt=ut[2],ut[2]=ut[3],ut[3]=Tt),ut[2]*=ot[1],ut[3]*=ot[1],ot[2]<0&&(Tt=ut[0],ut[0]=ut[1],ut[1]=Tt),ut[0]*=ot[2],ut[1]*=ot[2]),ut[0]+=ot[4],ut[1]+=ot[4],ut[2]+=ot[5],ut[3]+=ot[5]}static transform(ot,ut){return[ot[0]*ut[0]+ot[2]*ut[1],ot[1]*ut[0]+ot[3]*ut[1],ot[0]*ut[2]+ot[2]*ut[3],ot[1]*ut[2]+ot[3]*ut[3],ot[0]*ut[4]+ot[2]*ut[5]+ot[4],ot[1]*ut[4]+ot[3]*ut[5]+ot[5]]}static applyTransform(ot,ut){const Tt=ot[0]*ut[0]+ot[1]*ut[2]+ut[4],jt=ot[0]*ut[1]+ot[1]*ut[3]+ut[5];return[Tt,jt]}static applyInverseTransform(ot,ut){const Tt=ut[0]*ut[3]-ut[1]*ut[2],jt=(ot[0]*ut[3]-ot[1]*ut[2]+ut[2]*ut[5]-ut[4]*ut[3])/Tt,Ot=(-ot[0]*ut[1]+ot[1]*ut[0]+ut[4]*ut[1]-ut[5]*ut[0])/Tt;return[jt,Ot]}static getAxialAlignedBoundingBox(ot,ut){const Tt=this.applyTransform(ot,ut),jt=this.applyTransform(ot.slice(2,4),ut),Ot=this.applyTransform([ot[0],ot[3]],ut),Lt=this.applyTransform([ot[2],ot[1]],ut);return[Math.min(Tt[0],jt[0],Ot[0],Lt[0]),Math.min(Tt[1],jt[1],Ot[1],Lt[1]),Math.max(Tt[0],jt[0],Ot[0],Lt[0]),Math.max(Tt[1],jt[1],Ot[1],Lt[1])]}static inverseTransform(ot){const ut=ot[0]*ot[3]-ot[1]*ot[2];return[ot[3]/ut,-ot[1]/ut,-ot[2]/ut,ot[0]/ut,(ot[2]*ot[5]-ot[4]*ot[3])/ut,(ot[4]*ot[1]-ot[5]*ot[0])/ut]}static singularValueDecompose2dScale(ot){const ut=[ot[0],ot[2],ot[1],ot[3]],Tt=ot[0]*ut[0]+ot[1]*ut[2],jt=ot[0]*ut[1]+ot[1]*ut[3],Ot=ot[2]*ut[0]+ot[3]*ut[2],Lt=ot[2]*ut[1]+ot[3]*ut[3],yt=(Tt+Lt)/2,Kt=Math.sqrt((Tt+Lt)**2-4*(Tt*Lt-Ot*jt))/2,tl=yt+Kt||1,el=yt-Kt||1;return[Math.sqrt(tl),Math.sqrt(el)]}static normalizeRect(ot){const ut=ot.slice(0);return ot[0]>ot[2]&&(ut[0]=ot[2],ut[2]=ot[0]),ot[1]>ot[3]&&(ut[1]=ot[3],ut[3]=ot[1]),ut}static intersect(ot,ut){const Tt=Math.max(Math.min(ot[0],ot[2]),Math.min(ut[0],ut[2])),jt=Math.min(Math.max(ot[0],ot[2]),Math.max(ut[0],ut[2]));if(Tt>jt)return null;const Ot=Math.max(Math.min(ot[1],ot[3]),Math.min(ut[1],ut[3])),Lt=Math.min(Math.max(ot[1],ot[3]),Math.max(ut[1],ut[3]));return Ot>Lt?null:[Tt,Ot,jt,Lt]}static bezierBoundingBox(ot,ut,Tt,jt,Ot,Lt,yt,Kt){const tl=[],el=[[],[]];let ol,Qt,Ml,hl,Il,Wl,nt,L;for(let kt=0;kt<2;++kt){if(kt===0?(Qt=6*ot-12*Tt+6*Ot,ol=-3*ot+9*Tt-9*Ot+3*yt,Ml=3*Tt-3*ot):(Qt=6*ut-12*jt+6*Lt,ol=-3*ut+9*jt-9*Lt+3*Kt,Ml=3*jt-3*ut),Math.abs(ol)<1e-12){if(Math.abs(Qt)<1e-12)continue;hl=-Ml/Qt,0<hl&&hl<1&&tl.push(hl);continue}nt=Qt*Qt-4*Ml*ol,L=Math.sqrt(nt),!(nt<0)&&(Il=(-Qt+L)/(2*ol),0<Il&&Il<1&&tl.push(Il),Wl=(-Qt-L)/(2*ol),0<Wl&&Wl<1&&tl.push(Wl))}let ct=tl.length,Wt;const Yt=ct;for(;ct--;)hl=tl[ct],Wt=1-hl,el[0][ct]=Wt*Wt*Wt*ot+3*Wt*Wt*hl*Tt+3*Wt*hl*hl*Ot+hl*hl*hl*yt,el[1][ct]=Wt*Wt*Wt*ut+3*Wt*Wt*hl*jt+3*Wt*hl*hl*Lt+hl*hl*hl*Kt;return el[0][Yt]=ot,el[1][Yt]=ut,el[0][Yt+1]=yt,el[1][Yt+1]=Kt,el[0].length=el[1].length=Yt+2,[Math.min(...el[0]),Math.min(...el[1]),Math.max(...el[0]),Math.max(...el[1])]}}r.Util=il;const Bt=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,728,711,710,729,733,731,730,732,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8226,8224,8225,8230,8212,8211,402,8260,8249,8250,8722,8240,8222,8220,8221,8216,8217,8218,8482,64257,64258,321,338,352,376,381,305,322,339,353,382,0,8364];function Ft(_t){if(_t[0]>="ï"){let ut;if(_t[0]==="þ"&&_t[1]==="ÿ"?ut="utf-16be":_t[0]==="ÿ"&&_t[1]==="þ"?ut="utf-16le":_t[0]==="ï"&&_t[1]==="»"&&_t[2]==="¿"&&(ut="utf-8"),ut)try{const Tt=new TextDecoder(ut,{fatal:!0}),jt=Rt(_t);return Tt.decode(jt)}catch(Tt){Gt(`stringToPDFString: "${Tt}".`)}}const ot=[];for(let ut=0,Tt=_t.length;ut<Tt;ut++){const jt=Bt[_t.charCodeAt(ut)];ot.push(jt?String.fromCharCode(jt):_t.charAt(ut))}return ot.join("")}function wt(_t){return decodeURIComponent(escape(_t))}function pt(_t){return unescape(encodeURIComponent(_t))}function Ct(_t){return typeof _t=="object"&&(_t==null?void 0:_t.byteLength)!==void 0}function $t(_t,ot){if(_t.length!==ot.length)return!1;for(let ut=0,Tt=_t.length;ut<Tt;ut++)if(_t[ut]!==ot[ut])return!1;return!0}function dl(_t=new Date){return[_t.getUTCFullYear().toString(),(_t.getUTCMonth()+1).toString().padStart(2,"0"),_t.getUTCDate().toString().padStart(2,"0"),_t.getUTCHours().toString().padStart(2,"0"),_t.getUTCMinutes().toString().padStart(2,"0"),_t.getUTCSeconds().toString().padStart(2,"0")].join("")}class rl{constructor(){ll(this,Vl,!1);this.promise=new Promise((ot,ut)=>{this.resolve=Tt=>{ul(this,Vl,!0),ot(Tt)},this.reject=Tt=>{ul(this,Vl,!0),ut(Tt)}})}get settled(){return bt(this,Vl)}}Vl=new WeakMap,r.PromiseCapability=rl;let Yl=null,Xl=null;function pl(_t){return Yl||(Yl=/([\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,Xl=new Map([["ſt","ſt"]])),_t.replaceAll(Yl,(ot,ut,Tt)=>ut?ut.normalize("NFKC"):Xl.get(Tt))}function Ll(){if(typeof crypto<"u"&&typeof(crypto==null?void 0:crypto.randomUUID)=="function")return crypto.randomUUID();const _t=new Uint8Array(32);if(typeof crypto<"u"&&typeof(crypto==null?void 0:crypto.getRandomValues)=="function")crypto.getRandomValues(_t);else for(let ot=0;ot<32;ot++)_t[ot]=Math.floor(Math.random()*255);return Mt(_t)}const yl="pdfjs_internal_id_";r.AnnotationPrefix=yl},(__unused_webpack_module,exports,__w_pdfjs_require__)=>{var lt,h,M,p,vl,Q,ce,O,I,j,q,K,f,S,k,T,de,F,J,Ye,u,m;Object.defineProperty(exports,"__esModule",{value:!0}),exports.RenderTask=exports.PDFWorkerUtil=exports.PDFWorker=exports.PDFPageProxy=exports.PDFDocumentProxy=exports.PDFDocumentLoadingTask=exports.PDFDataRangeTransport=exports.LoopbackPort=exports.DefaultStandardFontDataFactory=exports.DefaultFilterFactory=exports.DefaultCanvasFactory=exports.DefaultCMapReaderFactory=void 0,Object.defineProperty(exports,"SVGGraphics",{enumerable:!0,get:function(){return _displaySvg.SVGGraphics}}),exports.build=void 0,exports.getDocument=getDocument,exports.version=void 0;var _util=__w_pdfjs_require__(1),_annotation_storage=__w_pdfjs_require__(3),_display_utils=__w_pdfjs_require__(6),_font_loader=__w_pdfjs_require__(9),_displayNode_utils=__w_pdfjs_require__(10),_canvas=__w_pdfjs_require__(11),_worker_options=__w_pdfjs_require__(14),_message_handler=__w_pdfjs_require__(15),_metadata=__w_pdfjs_require__(16),_optional_content_config=__w_pdfjs_require__(17),_transport_stream=__w_pdfjs_require__(18),_displayFetch_stream=__w_pdfjs_require__(19),_displayNetwork=__w_pdfjs_require__(22),_displayNode_stream=__w_pdfjs_require__(23),_displaySvg=__w_pdfjs_require__(24),_xfa_text=__w_pdfjs_require__(25);const DEFAULT_RANGE_CHUNK_SIZE=65536,RENDERING_CANCELLED_TIMEOUT=100,DELAYED_CLEANUP_TIMEOUT=5e3,DefaultCanvasFactory=_util.isNodeJS?_displayNode_utils.NodeCanvasFactory:_display_utils.DOMCanvasFactory;exports.DefaultCanvasFactory=DefaultCanvasFactory;const DefaultCMapReaderFactory=_util.isNodeJS?_displayNode_utils.NodeCMapReaderFactory:_display_utils.DOMCMapReaderFactory;exports.DefaultCMapReaderFactory=DefaultCMapReaderFactory;const DefaultFilterFactory=_util.isNodeJS?_displayNode_utils.NodeFilterFactory:_display_utils.DOMFilterFactory;exports.DefaultFilterFactory=DefaultFilterFactory;const DefaultStandardFontDataFactory=_util.isNodeJS?_displayNode_utils.NodeStandardFontDataFactory:_display_utils.DOMStandardFontDataFactory;exports.DefaultStandardFontDataFactory=DefaultStandardFontDataFactory;function getDocument($){if(typeof $=="string"||$ instanceof URL?$={url:$}:(0,_util.isArrayBuffer)($)&&($={data:$}),typeof $!="object")throw new Error("Invalid parameter in getDocument, need parameter object.");if(!$.url&&!$.data&&!$.range)throw new Error("Invalid parameter object: need either .data, .range or .url");const P=new PDFDocumentLoadingTask,{docId:Zt}=P,dt=$.url?getUrlProp($.url):null,It=$.data?getDataProp($.data):null,xt=$.httpHeaders||null,it=$.withCredentials===!0,Xt=$.password??null,zt=$.range instanceof PDFDataRangeTransport?$.range:null,Gt=Number.isInteger($.rangeChunkSize)&&$.rangeChunkSize>0?$.rangeChunkSize:DEFAULT_RANGE_CHUNK_SIZE;let Nt=$.worker instanceof PDFWorker?$.worker:null;const Ut=$.verbosity,Vt=typeof $.docBaseUrl=="string"&&!(0,_display_utils.isDataScheme)($.docBaseUrl)?$.docBaseUrl:null,Ht=typeof $.cMapUrl=="string"?$.cMapUrl:null,Pt=$.cMapPacked!==!1,at=$.CMapReaderFactory||DefaultCMapReaderFactory,R=typeof $.standardFontDataUrl=="string"?$.standardFontDataUrl:null,w=$.StandardFontDataFactory||DefaultStandardFontDataFactory,X=$.stopAtErrors!==!0,C=Number.isInteger($.maxImageSize)&&$.maxImageSize>-1?$.maxImageSize:-1,H=$.isEvalSupported!==!1,st=typeof $.isOffscreenCanvasSupported=="boolean"?$.isOffscreenCanvasSupported:!_util.isNodeJS,et=Number.isInteger($.canvasMaxAreaInBytes)?$.canvasMaxAreaInBytes:-1,Mt=typeof $.disableFontFace=="boolean"?$.disableFontFace:_util.isNodeJS,Rt=$.fontExtraProperties===!0,gt=$.enableXfa===!0,Jt=$.ownerDocument||globalThis.document,Dt=$.disableRange===!0,qt=$.disableStream===!0,vt=$.disableAutoFetch===!0,cl=$.pdfBug===!0,bl=zt?zt.length:$.length??NaN,il=typeof $.useSystemFonts=="boolean"?$.useSystemFonts:!_util.isNodeJS&&!Mt,Bt=typeof $.useWorkerFetch=="boolean"?$.useWorkerFetch:at===_display_utils.DOMCMapReaderFactory&&w===_display_utils.DOMStandardFontDataFactory&&Ht&&R&&(0,_display_utils.isValidFetchUrl)(Ht,document.baseURI)&&(0,_display_utils.isValidFetchUrl)(R,document.baseURI),Ft=$.canvasFactory||new DefaultCanvasFactory({ownerDocument:Jt}),wt=$.filterFactory||new DefaultFilterFactory({docId:Zt,ownerDocument:Jt}),pt=null;(0,_util.setVerbosityLevel)(Ut);const Ct={canvasFactory:Ft,filterFactory:wt};if(Bt||(Ct.cMapReaderFactory=new at({baseUrl:Ht,isCompressed:Pt}),Ct.standardFontDataFactory=new w({baseUrl:R})),!Nt){const rl={verbosity:Ut,port:_worker_options.GlobalWorkerOptions.workerPort};Nt=rl.port?PDFWorker.fromPort(rl):new PDFWorker(rl),P._worker=Nt}const $t={docId:Zt,apiVersion:"3.11.174",data:It,password:Xt,disableAutoFetch:vt,rangeChunkSize:Gt,length:bl,docBaseUrl:Vt,enableXfa:gt,evaluatorOptions:{maxImageSize:C,disableFontFace:Mt,ignoreErrors:X,isEvalSupported:H,isOffscreenCanvasSupported:st,canvasMaxAreaInBytes:et,fontExtraProperties:Rt,useSystemFonts:il,cMapUrl:Bt?Ht:null,standardFontDataUrl:Bt?R:null}},dl={ignoreErrors:X,isEvalSupported:H,disableFontFace:Mt,fontExtraProperties:Rt,enableXfa:gt,ownerDocument:Jt,disableAutoFetch:vt,pdfBug:cl,styleElement:pt};return Nt.promise.then(function(){if(P.destroyed)throw new Error("Loading aborted");const rl=_fetchDocument(Nt,$t),Yl=new Promise(function(Xl){let pl;zt?pl=new _transport_stream.PDFDataTransportStream({length:bl,initialData:zt.initialData,progressiveDone:zt.progressiveDone,contentDispositionFilename:zt.contentDispositionFilename,disableRange:Dt,disableStream:qt},zt):It||(pl=(yl=>_util.isNodeJS?new _displayNode_stream.PDFNodeStream(yl):(0,_display_utils.isValidFetchUrl)(yl.url)?new _displayFetch_stream.PDFFetchStream(yl):new _displayNetwork.PDFNetworkStream(yl))({url:dt,length:bl,httpHeaders:xt,withCredentials:it,rangeChunkSize:Gt,disableRange:Dt,disableStream:qt})),Xl(pl)});return Promise.all([rl,Yl]).then(function([Xl,pl]){if(P.destroyed)throw new Error("Loading aborted");const Ll=new _message_handler.MessageHandler(Zt,Xl,Nt.port),yl=new WorkerTransport(Ll,P,pl,dl,Ct);P._transport=yl,Ll.send("Ready",null)})}).catch(P._capability.reject),P}async function _fetchDocument($,P){if($.destroyed)throw new Error("Worker was destroyed");const Zt=await $.messageHandler.sendWithPromise("GetDocRequest",P,P.data?[P.data.buffer]:null);if($.destroyed)throw new Error("Worker was destroyed");return Zt}function getUrlProp($){if($ instanceof URL)return $.href;try{return new URL($,window.location).href}catch{if(_util.isNodeJS&&typeof $=="string")return $}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}function getDataProp($){if(_util.isNodeJS&&typeof Buffer<"u"&&$ instanceof Buffer)throw new Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");if($ instanceof Uint8Array&&$.byteLength===$.buffer.byteLength)return $;if(typeof $=="string")return(0,_util.stringToBytes)($);if(typeof $=="object"&&!isNaN($==null?void 0:$.length)||(0,_util.isArrayBuffer)($))return new Uint8Array($);throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")}const r=class r{constructor(){this._capability=new _util.PromiseCapability,this._transport=null,this._worker=null,this.docId=`d${Al(r,lt)._++}`,this.destroyed=!1,this.onPassword=null,this.onProgress=null}get promise(){return this._capability.promise}async destroy(){var P,Zt,dt;this.destroyed=!0;try{(P=this._worker)!=null&&P.port&&(this._worker._pendingDestroy=!0),await((Zt=this._transport)==null?void 0:Zt.destroy())}catch(It){throw(dt=this._worker)!=null&&dt.port&&delete this._worker._pendingDestroy,It}this._transport=null,this._worker&&(this._worker.destroy(),this._worker=null)}};lt=new WeakMap,ll(r,lt,0);let PDFDocumentLoadingTask=r;exports.PDFDocumentLoadingTask=PDFDocumentLoadingTask;class PDFDataRangeTransport{constructor(P,Zt,dt=!1,It=null){this.length=P,this.initialData=Zt,this.progressiveDone=dt,this.contentDispositionFilename=It,this._rangeListeners=[],this._progressListeners=[],this._progressiveReadListeners=[],this._progressiveDoneListeners=[],this._readyCapability=new _util.PromiseCapability}addRangeListener(P){this._rangeListeners.push(P)}addProgressListener(P){this._progressListeners.push(P)}addProgressiveReadListener(P){this._progressiveReadListeners.push(P)}addProgressiveDoneListener(P){this._progressiveDoneListeners.push(P)}onDataRange(P,Zt){for(const dt of this._rangeListeners)dt(P,Zt)}onDataProgress(P,Zt){this._readyCapability.promise.then(()=>{for(const dt of this._progressListeners)dt(P,Zt)})}onDataProgressiveRead(P){this._readyCapability.promise.then(()=>{for(const Zt of this._progressiveReadListeners)Zt(P)})}onDataProgressiveDone(){this._readyCapability.promise.then(()=>{for(const P of this._progressiveDoneListeners)P()})}transportReady(){this._readyCapability.resolve()}requestDataRange(P,Zt){(0,_util.unreachable)("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}}exports.PDFDataRangeTransport=PDFDataRangeTransport;class PDFDocumentProxy{constructor(P,Zt){this._pdfInfo=P,this._transport=Zt,Object.defineProperty(this,"getJavaScript",{value:()=>((0,_display_utils.deprecated)("`PDFDocumentProxy.getJavaScript`, please use `PDFDocumentProxy.getJSActions` instead."),this.getJSActions().then(dt=>{if(!dt)return dt;const It=[];for(const xt in dt)It.push(...dt[xt]);return It}))})}get annotationStorage(){return this._transport.annotationStorage}get filterFactory(){return this._transport.filterFactory}get numPages(){return this._pdfInfo.numPages}get fingerprints(){return this._pdfInfo.fingerprints}get isPureXfa(){return(0,_util.shadow)(this,"isPureXfa",!!this._transport._htmlForXfa)}get allXfaHtml(){return this._transport._htmlForXfa}getPage(P){return this._transport.getPage(P)}getPageIndex(P){return this._transport.getPageIndex(P)}getDestinations(){return this._transport.getDestinations()}getDestination(P){return this._transport.getDestination(P)}getPageLabels(){return this._transport.getPageLabels()}getPageLayout(){return this._transport.getPageLayout()}getPageMode(){return this._transport.getPageMode()}getViewerPreferences(){return this._transport.getViewerPreferences()}getOpenAction(){return this._transport.getOpenAction()}getAttachments(){return this._transport.getAttachments()}getJSActions(){return this._transport.getDocJSActions()}getOutline(){return this._transport.getOutline()}getOptionalContentConfig(){return this._transport.getOptionalContentConfig()}getPermissions(){return this._transport.getPermissions()}getMetadata(){return this._transport.getMetadata()}getMarkInfo(){return this._transport.getMarkInfo()}getData(){return this._transport.getData()}saveDocument(){return this._transport.saveDocument()}getDownloadInfo(){return this._transport.downloadInfoCapability.promise}cleanup(P=!1){return this._transport.startCleanup(P||this.isPureXfa)}destroy(){return this.loadingTask.destroy()}get loadingParams(){return this._transport.loadingParams}get loadingTask(){return this._transport.loadingTask}getFieldObjects(){return this._transport.getFieldObjects()}hasJSActions(){return this._transport.hasJSActions()}getCalculationOrderIds(){return this._transport.getCalculationOrderIds()}}exports.PDFDocumentProxy=PDFDocumentProxy;class PDFPageProxy{constructor(P,Zt,dt,It=!1){ll(this,p);ll(this,Q);ll(this,h,null);ll(this,M,!1);this._pageIndex=P,this._pageInfo=Zt,this._transport=dt,this._stats=It?new _display_utils.StatTimer:null,this._pdfBug=It,this.commonObjs=dt.commonObjs,this.objs=new PDFObjects,this._maybeCleanupAfterRender=!1,this._intentStates=new Map,this.destroyed=!1}get pageNumber(){return this._pageIndex+1}get rotate(){return this._pageInfo.rotate}get ref(){return this._pageInfo.ref}get userUnit(){return this._pageInfo.userUnit}get view(){return this._pageInfo.view}getViewport({scale:P,rotation:Zt=this.rotate,offsetX:dt=0,offsetY:It=0,dontFlip:xt=!1}={}){return new _display_utils.PageViewport({viewBox:this.view,scale:P,rotation:Zt,offsetX:dt,offsetY:It,dontFlip:xt})}getAnnotations({intent:P="display"}={}){const Zt=this._transport.getRenderingIntent(P);return this._transport.getAnnotations(this._pageIndex,Zt.renderingIntent)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get filterFactory(){return this._transport.filterFactory}get isPureXfa(){return(0,_util.shadow)(this,"isPureXfa",!!this._transport._htmlForXfa)}async getXfa(){var P;return((P=this._transport._htmlForXfa)==null?void 0:P.children[this._pageIndex])||null}render({canvasContext:P,viewport:Zt,intent:dt="display",annotationMode:It=_util.AnnotationMode.ENABLE,transform:xt=null,background:it=null,optionalContentConfigPromise:Xt=null,annotationCanvasMap:zt=null,pageColors:Gt=null,printAnnotationStorage:Nt=null}){var w,X;(w=this._stats)==null||w.time("Overall");const Ut=this._transport.getRenderingIntent(dt,It,Nt);ul(this,M,!1),nl(this,Q,ce).call(this),Xt||(Xt=this._transport.getOptionalContentConfig());let Vt=this._intentStates.get(Ut.cacheKey);Vt||(Vt=Object.create(null),this._intentStates.set(Ut.cacheKey,Vt)),Vt.streamReaderCancelTimeout&&(clearTimeout(Vt.streamReaderCancelTimeout),Vt.streamReaderCancelTimeout=null);const Ht=!!(Ut.renderingIntent&_util.RenderingIntentFlag.PRINT);Vt.displayReadyCapability||(Vt.displayReadyCapability=new _util.PromiseCapability,Vt.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},(X=this._stats)==null||X.time("Page Request"),this._pumpOperatorList(Ut));const Pt=C=>{var H,st;Vt.renderTasks.delete(at),(this._maybeCleanupAfterRender||Ht)&&ul(this,M,!0),nl(this,p,vl).call(this,!Ht),C?(at.capability.reject(C),this._abortOperatorList({intentState:Vt,reason:C instanceof Error?C:new Error(C)})):at.capability.resolve(),(H=this._stats)==null||H.timeEnd("Rendering"),(st=this._stats)==null||st.timeEnd("Overall")},at=new InternalRenderTask({callback:Pt,params:{canvasContext:P,viewport:Zt,transform:xt,background:it},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:zt,operatorList:Vt.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!Ht,pdfBug:this._pdfBug,pageColors:Gt});(Vt.renderTasks||(Vt.renderTasks=new Set)).add(at);const R=at.task;return Promise.all([Vt.displayReadyCapability.promise,Xt]).then(([C,H])=>{var st;if(this.destroyed){Pt();return}(st=this._stats)==null||st.time("Rendering"),at.initializeGraphics({transparency:C,optionalContentConfig:H}),at.operatorListChanged()}).catch(Pt),R}getOperatorList({intent:P="display",annotationMode:Zt=_util.AnnotationMode.ENABLE,printAnnotationStorage:dt=null}={}){var zt;function It(){it.operatorList.lastChunk&&(it.opListReadCapability.resolve(it.operatorList),it.renderTasks.delete(Xt))}const xt=this._transport.getRenderingIntent(P,Zt,dt,!0);let it=this._intentStates.get(xt.cacheKey);it||(it=Object.create(null),this._intentStates.set(xt.cacheKey,it));let Xt;return it.opListReadCapability||(Xt=Object.create(null),Xt.operatorListChanged=It,it.opListReadCapability=new _util.PromiseCapability,(it.renderTasks||(it.renderTasks=new Set)).add(Xt),it.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},(zt=this._stats)==null||zt.time("Page Request"),this._pumpOperatorList(xt)),it.opListReadCapability.promise}streamTextContent({includeMarkedContent:P=!1,disableNormalization:Zt=!1}={}){return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,includeMarkedContent:P===!0,disableNormalization:Zt===!0},{highWaterMark:100,size(It){return It.items.length}})}getTextContent(P={}){if(this._transport._htmlForXfa)return this.getXfa().then(dt=>_xfa_text.XfaText.textContent(dt));const Zt=this.streamTextContent(P);return new Promise(function(dt,It){function xt(){it.read().then(function({value:zt,done:Gt}){if(Gt){dt(Xt);return}Object.assign(Xt.styles,zt.styles),Xt.items.push(...zt.items),xt()},It)}const it=Zt.getReader(),Xt={items:[],styles:Object.create(null)};xt()})}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;const P=[];for(const Zt of this._intentStates.values())if(this._abortOperatorList({intentState:Zt,reason:new Error("Page was destroyed."),force:!0}),!Zt.opListReadCapability)for(const dt of Zt.renderTasks)P.push(dt.completed),dt.cancel();return this.objs.clear(),ul(this,M,!1),nl(this,Q,ce).call(this),Promise.all(P)}cleanup(P=!1){ul(this,M,!0);const Zt=nl(this,p,vl).call(this,!1);return P&&Zt&&this._stats&&(this._stats=new _display_utils.StatTimer),Zt}_startRenderPage(P,Zt){var It,xt;const dt=this._intentStates.get(Zt);dt&&((It=this._stats)==null||It.timeEnd("Page Request"),(xt=dt.displayReadyCapability)==null||xt.resolve(P))}_renderPageChunk(P,Zt){for(let dt=0,It=P.length;dt<It;dt++)Zt.operatorList.fnArray.push(P.fnArray[dt]),Zt.operatorList.argsArray.push(P.argsArray[dt]);Zt.operatorList.lastChunk=P.lastChunk,Zt.operatorList.separateAnnots=P.separateAnnots;for(const dt of Zt.renderTasks)dt.operatorListChanged();P.lastChunk&&nl(this,p,vl).call(this,!0)}_pumpOperatorList({renderingIntent:P,cacheKey:Zt,annotationStorageSerializable:dt}){const{map:It,transfers:xt}=dt,Xt=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:P,cacheKey:Zt,annotationStorage:It},xt).getReader(),zt=this._intentStates.get(Zt);zt.streamReader=Xt;const Gt=()=>{Xt.read().then(({value:Nt,done:Ut})=>{if(Ut){zt.streamReader=null;return}this._transport.destroyed||(this._renderPageChunk(Nt,zt),Gt())},Nt=>{if(zt.streamReader=null,!this._transport.destroyed){if(zt.operatorList){zt.operatorList.lastChunk=!0;for(const Ut of zt.renderTasks)Ut.operatorListChanged();nl(this,p,vl).call(this,!0)}if(zt.displayReadyCapability)zt.displayReadyCapability.reject(Nt);else if(zt.opListReadCapability)zt.opListReadCapability.reject(Nt);else throw Nt}})};Gt()}_abortOperatorList({intentState:P,reason:Zt,force:dt=!1}){if(P.streamReader){if(P.streamReaderCancelTimeout&&(clearTimeout(P.streamReaderCancelTimeout),P.streamReaderCancelTimeout=null),!dt){if(P.renderTasks.size>0)return;if(Zt instanceof _display_utils.RenderingCancelledException){let It=RENDERING_CANCELLED_TIMEOUT;Zt.extraDelay>0&&Zt.extraDelay<1e3&&(It+=Zt.extraDelay),P.streamReaderCancelTimeout=setTimeout(()=>{P.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:P,reason:Zt,force:!0})},It);return}}if(P.streamReader.cancel(new _util.AbortException(Zt.message)).catch(()=>{}),P.streamReader=null,!this._transport.destroyed){for(const[It,xt]of this._intentStates)if(xt===P){this._intentStates.delete(It);break}this.cleanup()}}}get stats(){return this._stats}}h=new WeakMap,M=new WeakMap,p=new WeakSet,vl=function(P=!1){if(nl(this,Q,ce).call(this),!bt(this,M)||this.destroyed)return!1;if(P)return ul(this,h,setTimeout(()=>{ul(this,h,null),nl(this,p,vl).call(this,!1)},DELAYED_CLEANUP_TIMEOUT)),!1;for(const{renderTasks:Zt,operatorList:dt}of this._intentStates.values())if(Zt.size>0||!dt.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),ul(this,M,!1),!0},Q=new WeakSet,ce=function(){bt(this,h)&&(clearTimeout(bt(this,h)),ul(this,h,null))},exports.PDFPageProxy=PDFPageProxy;class LoopbackPort{constructor(){ll(this,O,new Set);ll(this,I,Promise.resolve())}postMessage(P,Zt){const dt={data:structuredClone(P,Zt?{transfer:Zt}:null)};bt(this,I).then(()=>{for(const It of bt(this,O))It.call(this,dt)})}addEventListener(P,Zt){bt(this,O).add(Zt)}removeEventListener(P,Zt){bt(this,O).delete(Zt)}terminate(){bt(this,O).clear()}}O=new WeakMap,I=new WeakMap,exports.LoopbackPort=LoopbackPort;const PDFWorkerUtil={isWorkerDisabled:!1,fallbackWorkerSrc:null,fakeWorkerId:0};exports.PDFWorkerUtil=PDFWorkerUtil;{if(_util.isNodeJS&&typeof commonjsRequire$1=="function")PDFWorkerUtil.isWorkerDisabled=!0,PDFWorkerUtil.fallbackWorkerSrc="./pdf.worker.js";else if(typeof document=="object"){const $=(j=document==null?void 0:document.currentScript)==null?void 0:j.src;$&&(PDFWorkerUtil.fallbackWorkerSrc=$.replace(/(\.(?:min\.)?js)(\?.*)?$/i,".worker$1$2"))}PDFWorkerUtil.isSameOrigin=function($,P){let Zt;try{if(Zt=new URL($),!Zt.origin||Zt.origin==="null")return!1}catch{return!1}const dt=new URL(P,Zt);return Zt.origin===dt.origin},PDFWorkerUtil.createCDNWrapper=function($){const P=`importScripts("${$}");`;return URL.createObjectURL(new Blob([P]))}}const _PDFWorker=class _PDFWorker{constructor({name:$=null,port:P=null,verbosity:Zt=(0,_util.getVerbosityLevel)()}={}){var dt;if(this.name=$,this.destroyed=!1,this.verbosity=Zt,this._readyCapability=new _util.PromiseCapability,this._port=null,this._webWorker=null,this._messageHandler=null,P){if((dt=bt(_PDFWorker,q))!=null&&dt.has(P))throw new Error("Cannot use more than one PDFWorker per port.");(bt(_PDFWorker,q)||ul(_PDFWorker,q,new WeakMap)).set(P,this),this._initializeFromPort(P);return}this._initialize()}get promise(){return this._readyCapability.promise}get port(){return this._port}get messageHandler(){return this._messageHandler}_initializeFromPort($){this._port=$,this._messageHandler=new _message_handler.MessageHandler("main","worker",$),this._messageHandler.on("ready",function(){}),this._readyCapability.resolve(),this._messageHandler.send("configure",{verbosity:this.verbosity})}_initialize(){if(!PDFWorkerUtil.isWorkerDisabled&&!_PDFWorker._mainThreadWorkerMessageHandler){let{workerSrc:$}=_PDFWorker;try{PDFWorkerUtil.isSameOrigin(window.location.href,$)||($=PDFWorkerUtil.createCDNWrapper(new URL($,window.location).href));const P=new Worker($),Zt=new _message_handler.MessageHandler("main","worker",P),dt=()=>{P.removeEventListener("error",It),Zt.destroy(),P.terminate(),this.destroyed?this._readyCapability.reject(new Error("Worker was destroyed")):this._setupFakeWorker()},It=()=>{this._webWorker||dt()};P.addEventListener("error",It),Zt.on("test",it=>{if(P.removeEventListener("error",It),this.destroyed){dt();return}it?(this._messageHandler=Zt,this._port=P,this._webWorker=P,this._readyCapability.resolve(),Zt.send("configure",{verbosity:this.verbosity})):(this._setupFakeWorker(),Zt.destroy(),P.terminate())}),Zt.on("ready",it=>{if(P.removeEventListener("error",It),this.destroyed){dt();return}try{xt()}catch{this._setupFakeWorker()}});const xt=()=>{const it=new Uint8Array;Zt.send("test",it,[it.buffer])};xt();return}catch{(0,_util.info)("The worker has been disabled.")}}this._setupFakeWorker()}_setupFakeWorker(){PDFWorkerUtil.isWorkerDisabled||((0,_util.warn)("Setting up fake worker."),PDFWorkerUtil.isWorkerDisabled=!0),_PDFWorker._setupFakeWorkerGlobal.then($=>{if(this.destroyed){this._readyCapability.reject(new Error("Worker was destroyed"));return}const P=new LoopbackPort;this._port=P;const Zt=`fake${PDFWorkerUtil.fakeWorkerId++}`,dt=new _message_handler.MessageHandler(Zt+"_worker",Zt,P);$.setup(dt,P);const It=new _message_handler.MessageHandler(Zt,Zt+"_worker",P);this._messageHandler=It,this._readyCapability.resolve(),It.send("configure",{verbosity:this.verbosity})}).catch($=>{this._readyCapability.reject(new Error(`Setting up fake worker failed: "${$.message}".`))})}destroy(){var $;this.destroyed=!0,this._webWorker&&(this._webWorker.terminate(),this._webWorker=null),($=bt(_PDFWorker,q))==null||$.delete(this._port),this._port=null,this._messageHandler&&(this._messageHandler.destroy(),this._messageHandler=null)}static fromPort($){var Zt;if(!($!=null&&$.port))throw new Error("PDFWorker.fromPort - invalid method signature.");const P=(Zt=bt(this,q))==null?void 0:Zt.get($.port);if(P){if(P._pendingDestroy)throw new Error("PDFWorker.fromPort - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");return P}return new _PDFWorker($)}static get workerSrc(){if(_worker_options.GlobalWorkerOptions.workerSrc)return _worker_options.GlobalWorkerOptions.workerSrc;if(PDFWorkerUtil.fallbackWorkerSrc!==null)return _util.isNodeJS||(0,_display_utils.deprecated)('No "GlobalWorkerOptions.workerSrc" specified.'),PDFWorkerUtil.fallbackWorkerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get _mainThreadWorkerMessageHandler(){var $;try{return(($=globalThis.pdfjsWorker)==null?void 0:$.WorkerMessageHandler)||null}catch{return null}}static get _setupFakeWorkerGlobal(){const loader=async()=>{const mainWorkerMessageHandler=this._mainThreadWorkerMessageHandler;if(mainWorkerMessageHandler)return mainWorkerMessageHandler;if(_util.isNodeJS&&typeof commonjsRequire$1=="function"){const worker=eval("require")(this.workerSrc);return worker.WorkerMessageHandler}return await(0,_display_utils.loadScript)(this.workerSrc),window.pdfjsWorker.WorkerMessageHandler};return(0,_util.shadow)(this,"_setupFakeWorkerGlobal",loader())}};q=new WeakMap,ll(_PDFWorker,q,void 0);let PDFWorker=_PDFWorker;exports.PDFWorker=PDFWorker;class WorkerTransport{constructor(P,Zt,dt,It,xt){ll(this,T);ll(this,K,new Map);ll(this,f,new Map);ll(this,S,new Map);ll(this,k,null);this.messageHandler=P,this.loadingTask=Zt,this.commonObjs=new PDFObjects,this.fontLoader=new _font_loader.FontLoader({ownerDocument:It.ownerDocument,styleElement:It.styleElement}),this._params=It,this.canvasFactory=xt.canvasFactory,this.filterFactory=xt.filterFactory,this.cMapReaderFactory=xt.cMapReaderFactory,this.standardFontDataFactory=xt.standardFontDataFactory,this.destroyed=!1,this.destroyCapability=null,this._networkStream=dt,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=new _util.PromiseCapability,this.setupMessageHandler()}get annotationStorage(){return(0,_util.shadow)(this,"annotationStorage",new _annotation_storage.AnnotationStorage)}getRenderingIntent(P,Zt=_util.AnnotationMode.ENABLE,dt=null,It=!1){let xt=_util.RenderingIntentFlag.DISPLAY,it=_annotation_storage.SerializableEmpty;switch(P){case"any":xt=_util.RenderingIntentFlag.ANY;break;case"display":break;case"print":xt=_util.RenderingIntentFlag.PRINT;break;default:(0,_util.warn)(`getRenderingIntent - invalid intent: ${P}`)}switch(Zt){case _util.AnnotationMode.DISABLE:xt+=_util.RenderingIntentFlag.ANNOTATIONS_DISABLE;break;case _util.AnnotationMode.ENABLE:break;case _util.AnnotationMode.ENABLE_FORMS:xt+=_util.RenderingIntentFlag.ANNOTATIONS_FORMS;break;case _util.AnnotationMode.ENABLE_STORAGE:xt+=_util.RenderingIntentFlag.ANNOTATIONS_STORAGE,it=(xt&_util.RenderingIntentFlag.PRINT&&dt instanceof _annotation_storage.PrintAnnotationStorage?dt:this.annotationStorage).serializable;break;default:(0,_util.warn)(`getRenderingIntent - invalid annotationMode: ${Zt}`)}return It&&(xt+=_util.RenderingIntentFlag.OPLIST),{renderingIntent:xt,cacheKey:`${xt}_${it.hash}`,annotationStorageSerializable:it}}destroy(){var dt;if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=new _util.PromiseCapability,(dt=bt(this,k))==null||dt.reject(new Error("Worker was destroyed during onPassword callback"));const P=[];for(const It of bt(this,f).values())P.push(It._destroy());bt(this,f).clear(),bt(this,S).clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();const Zt=this.messageHandler.sendWithPromise("Terminate",null);return P.push(Zt),Promise.all(P).then(()=>{var It;this.commonObjs.clear(),this.fontLoader.clear(),bt(this,K).clear(),this.filterFactory.destroy(),(It=this._networkStream)==null||It.cancelAllRequests(new _util.AbortException("Worker was terminated.")),this.messageHandler&&(this.messageHandler.destroy(),this.messageHandler=null),this.destroyCapability.resolve()},this.destroyCapability.reject),this.destroyCapability.promise}setupMessageHandler(){const{messageHandler:P,loadingTask:Zt}=this;P.on("GetReader",(dt,It)=>{(0,_util.assert)(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=xt=>{this._lastProgress={loaded:xt.loaded,total:xt.total}},It.onPull=()=>{this._fullReader.read().then(function({value:xt,done:it}){if(it){It.close();return}(0,_util.assert)(xt instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),It.enqueue(new Uint8Array(xt),1,[xt])}).catch(xt=>{It.error(xt)})},It.onCancel=xt=>{this._fullReader.cancel(xt),It.ready.catch(it=>{if(!this.destroyed)throw it})}}),P.on("ReaderHeadersReady",dt=>{const It=new _util.PromiseCapability,xt=this._fullReader;return xt.headersReady.then(()=>{var it;(!xt.isStreamingSupported||!xt.isRangeSupported)&&(this._lastProgress&&((it=Zt.onProgress)==null||it.call(Zt,this._lastProgress)),xt.onProgress=Xt=>{var zt;(zt=Zt.onProgress)==null||zt.call(Zt,{loaded:Xt.loaded,total:Xt.total})}),It.resolve({isStreamingSupported:xt.isStreamingSupported,isRangeSupported:xt.isRangeSupported,contentLength:xt.contentLength})},It.reject),It.promise}),P.on("GetRangeReader",(dt,It)=>{(0,_util.assert)(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const xt=this._networkStream.getRangeReader(dt.begin,dt.end);if(!xt){It.close();return}It.onPull=()=>{xt.read().then(function({value:it,done:Xt}){if(Xt){It.close();return}(0,_util.assert)(it instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),It.enqueue(new Uint8Array(it),1,[it])}).catch(it=>{It.error(it)})},It.onCancel=it=>{xt.cancel(it),It.ready.catch(Xt=>{if(!this.destroyed)throw Xt})}}),P.on("GetDoc",({pdfInfo:dt})=>{this._numPages=dt.numPages,this._htmlForXfa=dt.htmlForXfa,delete dt.htmlForXfa,Zt._capability.resolve(new PDFDocumentProxy(dt,this))}),P.on("DocException",function(dt){let It;switch(dt.name){case"PasswordException":It=new _util.PasswordException(dt.message,dt.code);break;case"InvalidPDFException":It=new _util.InvalidPDFException(dt.message);break;case"MissingPDFException":It=new _util.MissingPDFException(dt.message);break;case"UnexpectedResponseException":It=new _util.UnexpectedResponseException(dt.message,dt.status);break;case"UnknownErrorException":It=new _util.UnknownErrorException(dt.message,dt.details);break;default:(0,_util.unreachable)("DocException - expected a valid Error.")}Zt._capability.reject(It)}),P.on("PasswordRequest",dt=>{if(ul(this,k,new _util.PromiseCapability),Zt.onPassword){const It=xt=>{xt instanceof Error?bt(this,k).reject(xt):bt(this,k).resolve({password:xt})};try{Zt.onPassword(It,dt.code)}catch(xt){bt(this,k).reject(xt)}}else bt(this,k).reject(new _util.PasswordException(dt.message,dt.code));return bt(this,k).promise}),P.on("DataLoaded",dt=>{var It;(It=Zt.onProgress)==null||It.call(Zt,{loaded:dt.length,total:dt.length}),this.downloadInfoCapability.resolve(dt)}),P.on("StartRenderPage",dt=>{if(this.destroyed)return;bt(this,f).get(dt.pageIndex)._startRenderPage(dt.transparency,dt.cacheKey)}),P.on("commonobj",([dt,It,xt])=>{var it;if(!this.destroyed&&!this.commonObjs.has(dt))switch(It){case"Font":const Xt=this._params;if("error"in xt){const Nt=xt.error;(0,_util.warn)(`Error during font loading: ${Nt}`),this.commonObjs.resolve(dt,Nt);break}const zt=Xt.pdfBug&&((it=globalThis.FontInspector)!=null&&it.enabled)?(Nt,Ut)=>globalThis.FontInspector.fontAdded(Nt,Ut):null,Gt=new _font_loader.FontFaceObject(xt,{isEvalSupported:Xt.isEvalSupported,disableFontFace:Xt.disableFontFace,ignoreErrors:Xt.ignoreErrors,inspectFont:zt});this.fontLoader.bind(Gt).catch(Nt=>P.sendWithPromise("FontFallback",{id:dt})).finally(()=>{!Xt.fontExtraProperties&&Gt.data&&(Gt.data=null),this.commonObjs.resolve(dt,Gt)});break;case"FontPath":case"Image":case"Pattern":this.commonObjs.resolve(dt,xt);break;default:throw new Error(`Got unknown common object type ${It}`)}}),P.on("obj",([dt,It,xt,it])=>{var zt;if(this.destroyed)return;const Xt=bt(this,f).get(It);if(!Xt.objs.has(dt))switch(xt){case"Image":if(Xt.objs.resolve(dt,it),it){let Gt;if(it.bitmap){const{width:Nt,height:Ut}=it;Gt=Nt*Ut*4}else Gt=((zt=it.data)==null?void 0:zt.length)||0;Gt>_util.MAX_IMAGE_SIZE_TO_CACHE&&(Xt._maybeCleanupAfterRender=!0)}break;case"Pattern":Xt.objs.resolve(dt,it);break;default:throw new Error(`Got unknown object type ${xt}`)}}),P.on("DocProgress",dt=>{var It;this.destroyed||(It=Zt.onProgress)==null||It.call(Zt,{loaded:dt.loaded,total:dt.total})}),P.on("FetchBuiltInCMap",dt=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.cMapReaderFactory?this.cMapReaderFactory.fetch(dt):Promise.reject(new Error("CMapReaderFactory not initialized, see the `useWorkerFetch` parameter."))),P.on("FetchStandardFontData",dt=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.standardFontDataFactory?this.standardFontDataFactory.fetch(dt):Promise.reject(new Error("StandardFontDataFactory not initialized, see the `useWorkerFetch` parameter.")))}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){var dt;this.annotationStorage.size<=0&&(0,_util.warn)("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");const{map:P,transfers:Zt}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:P,filename:((dt=this._fullReader)==null?void 0:dt.filename)??null},Zt).finally(()=>{this.annotationStorage.resetModified()})}getPage(P){if(!Number.isInteger(P)||P<=0||P>this._numPages)return Promise.reject(new Error("Invalid page request."));const Zt=P-1,dt=bt(this,S).get(Zt);if(dt)return dt;const It=this.messageHandler.sendWithPromise("GetPage",{pageIndex:Zt}).then(xt=>{if(this.destroyed)throw new Error("Transport destroyed");const it=new PDFPageProxy(Zt,xt,this,this._params.pdfBug);return bt(this,f).set(Zt,it),it});return bt(this,S).set(Zt,It),It}getPageIndex(P){return typeof P!="object"||P===null||!Number.isInteger(P.num)||P.num<0||!Number.isInteger(P.gen)||P.gen<0?Promise.reject(new Error("Invalid pageIndex request.")):this.messageHandler.sendWithPromise("GetPageIndex",{num:P.num,gen:P.gen})}getAnnotations(P,Zt){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:P,intent:Zt})}getFieldObjects(){return nl(this,T,de).call(this,"GetFieldObjects")}hasJSActions(){return nl(this,T,de).call(this,"HasJSActions")}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(P){return typeof P!="string"?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:P})}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)}getDocJSActions(){return nl(this,T,de).call(this,"GetDocJSActions")}getPageJSActions(P){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:P})}getStructTree(P){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:P})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(){return this.messageHandler.sendWithPromise("GetOptionalContentConfig",null).then(P=>new _optional_content_config.OptionalContentConfig(P))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){const P="GetMetadata",Zt=bt(this,K).get(P);if(Zt)return Zt;const dt=this.messageHandler.sendWithPromise(P,null).then(It=>{var xt,it;return{info:It[0],metadata:It[1]?new _metadata.Metadata(It[1]):null,contentDispositionFilename:((xt=this._fullReader)==null?void 0:xt.filename)??null,contentLength:((it=this._fullReader)==null?void 0:it.contentLength)??null}});return bt(this,K).set(P,dt),dt}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(P=!1){if(!this.destroyed){await this.messageHandler.sendWithPromise("Cleanup",null);for(const Zt of bt(this,f).values())if(!Zt.cleanup())throw new Error(`startCleanup: Page ${Zt.pageNumber} is currently rendering.`);this.commonObjs.clear(),P||this.fontLoader.clear(),bt(this,K).clear(),this.filterFactory.destroy(!0)}}get loadingParams(){const{disableAutoFetch:P,enableXfa:Zt}=this._params;return(0,_util.shadow)(this,"loadingParams",{disableAutoFetch:P,enableXfa:Zt})}}K=new WeakMap,f=new WeakMap,S=new WeakMap,k=new WeakMap,T=new WeakSet,de=function(P,Zt=null){const dt=bt(this,K).get(P);if(dt)return dt;const It=this.messageHandler.sendWithPromise(P,Zt);return bt(this,K).set(P,It),It};class PDFObjects{constructor(){ll(this,J);ll(this,F,Object.create(null))}get(P,Zt=null){if(Zt){const It=nl(this,J,Ye).call(this,P);return It.capability.promise.then(()=>Zt(It.data)),null}const dt=bt(this,F)[P];if(!(dt!=null&&dt.capability.settled))throw new Error(`Requesting object that isn't resolved yet ${P}.`);return dt.data}has(P){const Zt=bt(this,F)[P];return(Zt==null?void 0:Zt.capability.settled)||!1}resolve(P,Zt=null){const dt=nl(this,J,Ye).call(this,P);dt.data=Zt,dt.capability.resolve()}clear(){var P;for(const Zt in bt(this,F)){const{data:dt}=bt(this,F)[Zt];(P=dt==null?void 0:dt.bitmap)==null||P.close()}ul(this,F,Object.create(null))}}F=new WeakMap,J=new WeakSet,Ye=function(P){var Zt;return(Zt=bt(this,F))[P]||(Zt[P]={capability:new _util.PromiseCapability,data:null})};class RenderTask{constructor(P){ll(this,u,null);ul(this,u,P),this.onContinue=null}get promise(){return bt(this,u).capability.promise}cancel(P=0){bt(this,u).cancel(null,P)}get separateAnnots(){const{separateAnnots:P}=bt(this,u).operatorList;if(!P)return!1;const{annotationCanvasMap:Zt}=bt(this,u);return P.form||P.canvas&&(Zt==null?void 0:Zt.size)>0}}u=new WeakMap,exports.RenderTask=RenderTask;const _=class _{constructor({callback:P,params:Zt,objs:dt,commonObjs:It,annotationCanvasMap:xt,operatorList:it,pageIndex:Xt,canvasFactory:zt,filterFactory:Gt,useRequestAnimationFrame:Nt=!1,pdfBug:Ut=!1,pageColors:Vt=null}){this.callback=P,this.params=Zt,this.objs=dt,this.commonObjs=It,this.annotationCanvasMap=xt,this.operatorListIdx=null,this.operatorList=it,this._pageIndex=Xt,this.canvasFactory=zt,this.filterFactory=Gt,this._pdfBug=Ut,this.pageColors=Vt,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=Nt===!0&&typeof window<"u",this.cancelled=!1,this.capability=new _util.PromiseCapability,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=Zt.canvasContext.canvas}get completed(){return this.capability.promise.catch(function(){})}initializeGraphics({transparency:P=!1,optionalContentConfig:Zt}){var Xt,zt;if(this.cancelled)return;if(this._canvas){if(bt(_,m).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.");bt(_,m).add(this._canvas)}this._pdfBug&&((Xt=globalThis.StepperManager)!=null&&Xt.enabled)&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());const{canvasContext:dt,viewport:It,transform:xt,background:it}=this.params;this.gfx=new _canvas.CanvasGraphics(dt,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:Zt},this.annotationCanvasMap,this.pageColors),this.gfx.beginDrawing({transform:xt,viewport:It,transparency:P,background:it}),this.operatorListIdx=0,this.graphicsReady=!0,(zt=this.graphicsReadyCallback)==null||zt.call(this)}cancel(P=null,Zt=0){var dt;this.running=!1,this.cancelled=!0,(dt=this.gfx)==null||dt.endDrawing(),bt(_,m).delete(this._canvas),this.callback(P||new _display_utils.RenderingCancelledException(`Rendering cancelled, page ${this._pageIndex+1}`,Zt))}operatorListChanged(){var P;if(!this.graphicsReady){this.graphicsReadyCallback||(this.graphicsReadyCallback=this._continueBound);return}(P=this.stepper)==null||P.updateOperatorList(this.operatorList),!this.running&&this._continue()}_continue(){this.running=!0,!this.cancelled&&(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())}_scheduleNext(){this._useRequestAnimationFrame?window.requestAnimationFrame(()=>{this._nextBound().catch(this._cancelBound)}):Promise.resolve().then(this._nextBound).catch(this._cancelBound)}async _next(){this.cancelled||(this.operatorListIdx=this.gfx.executeOperatorList(this.operatorList,this.operatorListIdx,this._continueBound,this.stepper),this.operatorListIdx===this.operatorList.argsArray.length&&(this.running=!1,this.operatorList.lastChunk&&(this.gfx.endDrawing(),bt(_,m).delete(this._canvas),this.callback())))}};m=new WeakMap,ll(_,m,new WeakSet);let InternalRenderTask=_;const version="3.11.174";exports.version=version;const build="ce8716743";exports.build=build},(lt,r,h)=>{var I,j,q,ss,f;Object.defineProperty(r,"__esModule",{value:!0}),r.SerializableEmpty=r.PrintAnnotationStorage=r.AnnotationStorage=void 0;var M=h(1),p=h(4),B=h(8);const Q=Object.freeze({map:null,hash:"",transfers:void 0});r.SerializableEmpty=Q;class U{constructor(){ll(this,q);ll(this,I,!1);ll(this,j,new Map);this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(k,T){const g=bt(this,j).get(k);return g===void 0?T:Object.assign(T,g)}getRawValue(k){return bt(this,j).get(k)}remove(k){if(bt(this,j).delete(k),bt(this,j).size===0&&this.resetModified(),typeof this.onAnnotationEditor=="function"){for(const T of bt(this,j).values())if(T instanceof p.AnnotationEditor)return;this.onAnnotationEditor(null)}}setValue(k,T){const g=bt(this,j).get(k);let F=!1;if(g!==void 0)for(const[J,v]of Object.entries(T))g[J]!==v&&(F=!0,g[J]=v);else F=!0,bt(this,j).set(k,T);F&&nl(this,q,ss).call(this),T instanceof p.AnnotationEditor&&typeof this.onAnnotationEditor=="function"&&this.onAnnotationEditor(T.constructor._type)}has(k){return bt(this,j).has(k)}getAll(){return bt(this,j).size>0?(0,M.objectFromMap)(bt(this,j)):null}setAll(k){for(const[T,g]of Object.entries(k))this.setValue(T,g)}get size(){return bt(this,j).size}resetModified(){bt(this,I)&&(ul(this,I,!1),typeof this.onResetModified=="function"&&this.onResetModified())}get print(){return new O(this)}get serializable(){if(bt(this,j).size===0)return Q;const k=new Map,T=new B.MurmurHash3_64,g=[],F=Object.create(null);let J=!1;for(const[v,u]of bt(this,j)){const m=u instanceof p.AnnotationEditor?u.serialize(!1,F):u;m&&(k.set(v,m),T.update(`${v}:${JSON.stringify(m)}`),J||(J=!!m.bitmap))}if(J)for(const v of k.values())v.bitmap&&g.push(v.bitmap);return k.size>0?{map:k,hash:T.hexdigest(),transfers:g}:Q}}I=new WeakMap,j=new WeakMap,q=new WeakSet,ss=function(){bt(this,I)||(ul(this,I,!0),typeof this.onSetModified=="function"&&this.onSetModified())},r.AnnotationStorage=U;class O extends U{constructor(T){super();ll(this,f,void 0);const{map:g,hash:F,transfers:J}=T.serializable,v=structuredClone(g,J?{transfer:J}:null);ul(this,f,{map:v,hash:F,transfers:J})}get print(){(0,M.unreachable)("Should not call PrintAnnotationStorage.print")}get serializable(){return bt(this,f)}}f=new WeakMap,r.PrintAnnotationStorage=O},(lt,r,h)=>{var O,I,j,q,K,f,S,k,T,g,F,J,v,u,m,pe,$,ye,Zt,Te,It,Le,it,is,zt,cs,Nt,ds,Vt,Ve,Pt,as;Object.defineProperty(r,"__esModule",{value:!0}),r.AnnotationEditor=void 0;var M=h(5),p=h(1),B=h(6);const R=class R{constructor(X){ll(this,m);ll(this,$);ll(this,It);ll(this,it);ll(this,zt);ll(this,Nt);ll(this,Vt);ll(this,Pt);ll(this,O,"");ll(this,I,!1);ll(this,j,null);ll(this,q,null);ll(this,K,null);ll(this,f,!1);ll(this,S,null);ll(this,k,this.focusin.bind(this));ll(this,T,this.focusout.bind(this));ll(this,g,!1);ll(this,F,!1);ll(this,J,!1);gl(this,"_initialOptions",Object.create(null));gl(this,"_uiManager",null);gl(this,"_focusEventsAllowed",!0);gl(this,"_l10nPromise",null);ll(this,v,!1);ll(this,u,R._zIndex++);this.constructor===R&&(0,p.unreachable)("Cannot initialize AnnotationEditor."),this.parent=X.parent,this.id=X.id,this.width=this.height=null,this.pageIndex=X.parent.pageIndex,this.name=X.name,this.div=null,this._uiManager=X.uiManager,this.annotationElementId=null,this._willKeepAspectRatio=!1,this._initialOptions.isCentered=X.isCentered,this._structTreeParentId=null;const{rotation:C,rawDims:{pageWidth:H,pageHeight:st,pageX:et,pageY:Mt}}=this.parent.viewport;this.rotation=C,this.pageRotation=(360+C-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[H,st],this.pageTranslation=[et,Mt];const[Rt,gt]=this.parentDimensions;this.x=X.x/Rt,this.y=X.y/gt,this.isAttachedToDOM=!1,this.deleted=!1}get editorType(){return Object.getPrototypeOf(this).constructor._type}static get _defaultLineColor(){return(0,p.shadow)(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(X){const C=new U({id:X.parent.getNextId(),parent:X.parent,uiManager:X._uiManager});C.annotationElementId=X.annotationElementId,C.deleted=!0,C._uiManager.addToAnnotationStorage(C)}static initialize(X,C=null){if(R._l10nPromise||(R._l10nPromise=new Map(["editor_alt_text_button_label","editor_alt_text_edit_button_label","editor_alt_text_decorative_tooltip"].map(st=>[st,X.get(st)]))),C!=null&&C.strings)for(const st of C.strings)R._l10nPromise.set(st,X.get(st));if(R._borderLineWidth!==-1)return;const H=getComputedStyle(document.documentElement);R._borderLineWidth=parseFloat(H.getPropertyValue("--outline-width"))||0}static updateDefaultParams(X,C){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(X){return!1}static paste(X,C){(0,p.unreachable)("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return bt(this,v)}set _isDraggable(X){var C;ul(this,v,X),(C=this.div)==null||C.classList.toggle("draggable",X)}center(){const[X,C]=this.pageDimensions;switch(this.parentRotation){case 90:this.x-=this.height*C/(X*2),this.y+=this.width*X/(C*2);break;case 180:this.x+=this.width/2,this.y+=this.height/2;break;case 270:this.x+=this.height*C/(X*2),this.y-=this.width*X/(C*2);break;default:this.x-=this.width/2,this.y-=this.height/2;break}this.fixAndSetPosition()}addCommands(X){this._uiManager.addCommands(X)}get currentLayer(){return this._uiManager.currentLayer}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=bt(this,u)}setParent(X){X!==null&&(this.pageIndex=X.pageIndex,this.pageDimensions=X.pageDimensions),this.parent=X}focusin(X){this._focusEventsAllowed&&(bt(this,g)?ul(this,g,!1):this.parent.setSelected(this))}focusout(X){var H;if(!this._focusEventsAllowed||!this.isAttachedToDOM)return;const C=X.relatedTarget;C!=null&&C.closest(`#${this.id}`)||(X.preventDefault(),(H=this.parent)!=null&&H.isMultipleSelection||this.commitOrRemove())}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}setAt(X,C,H,st){const[et,Mt]=this.parentDimensions;[H,st]=this.screenToPageTranslation(H,st),this.x=(X+H)/et,this.y=(C+st)/Mt,this.fixAndSetPosition()}translate(X,C){nl(this,m,pe).call(this,this.parentDimensions,X,C)}translateInPage(X,C){nl(this,m,pe).call(this,this.pageDimensions,X,C),this.div.scrollIntoView({block:"nearest"})}drag(X,C){const[H,st]=this.parentDimensions;if(this.x+=X/H,this.y+=C/st,this.parent&&(this.x<0||this.x>1||this.y<0||this.y>1)){const{x:Jt,y:Dt}=this.div.getBoundingClientRect();this.parent.findNewParent(this,Jt,Dt)&&(this.x-=Math.floor(this.x),this.y-=Math.floor(this.y))}let{x:et,y:Mt}=this;const[Rt,gt]=nl(this,$,ye).call(this);et+=Rt,Mt+=gt,this.div.style.left=`${(100*et).toFixed(2)}%`,this.div.style.top=`${(100*Mt).toFixed(2)}%`,this.div.scrollIntoView({block:"nearest"})}fixAndSetPosition(){const[X,C]=this.pageDimensions;let{x:H,y:st,width:et,height:Mt}=this;switch(et*=X,Mt*=C,H*=X,st*=C,this.rotation){case 0:H=Math.max(0,Math.min(X-et,H)),st=Math.max(0,Math.min(C-Mt,st));break;case 90:H=Math.max(0,Math.min(X-Mt,H)),st=Math.min(C,Math.max(et,st));break;case 180:H=Math.min(X,Math.max(et,H)),st=Math.min(C,Math.max(Mt,st));break;case 270:H=Math.min(X,Math.max(Mt,H)),st=Math.max(0,Math.min(C-et,st));break}this.x=H/=X,this.y=st/=C;const[Rt,gt]=nl(this,$,ye).call(this);H+=Rt,st+=gt;const{style:Jt}=this.div;Jt.left=`${(100*H).toFixed(2)}%`,Jt.top=`${(100*st).toFixed(2)}%`,this.moveInDOM()}screenToPageTranslation(X,C){var H;return nl(H=R,Zt,Te).call(H,X,C,this.parentRotation)}pageTranslationToScreen(X,C){var H;return nl(H=R,Zt,Te).call(H,X,C,360-this.parentRotation)}get parentScale(){return this._uiManager.viewParameters.realScale}get parentRotation(){return(this._uiManager.viewParameters.rotation+this.pageRotation)%360}get parentDimensions(){const{parentScale:X,pageDimensions:[C,H]}=this,st=C*X,et=H*X;return p.FeatureTest.isCSSRoundSupported?[Math.round(st),Math.round(et)]:[st,et]}setDims(X,C){var et;const[H,st]=this.parentDimensions;this.div.style.width=`${(100*X/H).toFixed(2)}%`,bt(this,f)||(this.div.style.height=`${(100*C/st).toFixed(2)}%`),(et=bt(this,j))==null||et.classList.toggle("small",X<R.SMALL_EDITOR_SIZE||C<R.SMALL_EDITOR_SIZE)}fixDims(){const{style:X}=this.div,{height:C,width:H}=X,st=H.endsWith("%"),et=!bt(this,f)&&C.endsWith("%");if(st&&et)return;const[Mt,Rt]=this.parentDimensions;st||(X.width=`${(100*parseFloat(H)/Mt).toFixed(2)}%`),!bt(this,f)&&!et&&(X.height=`${(100*parseFloat(C)/Rt).toFixed(2)}%`)}getInitialTranslation(){return[0,0]}async addAltTextButton(){if(bt(this,j))return;const X=ul(this,j,document.createElement("button"));X.className="altText";const C=await R._l10nPromise.get("editor_alt_text_button_label");X.textContent=C,X.setAttribute("aria-label",C),X.tabIndex="0",X.addEventListener("contextmenu",B.noContextMenu),X.addEventListener("pointerdown",H=>H.stopPropagation()),X.addEventListener("click",H=>{H.preventDefault(),this._uiManager.editAltText(this)},{capture:!0}),X.addEventListener("keydown",H=>{H.target===X&&H.key==="Enter"&&(H.preventDefault(),this._uiManager.editAltText(this))}),nl(this,Vt,Ve).call(this),this.div.append(X),R.SMALL_EDITOR_SIZE||(R.SMALL_EDITOR_SIZE=Math.min(128,Math.round(X.getBoundingClientRect().width*1.4)))}getClientDimensions(){return this.div.getBoundingClientRect()}get altTextData(){return{altText:bt(this,O),decorative:bt(this,I)}}set altTextData({altText:X,decorative:C}){bt(this,O)===X&&bt(this,I)===C||(ul(this,O,X),ul(this,I,C),nl(this,Vt,Ve).call(this))}render(){this.div=document.createElement("div"),this.div.setAttribute("data-editor-rotation",(360-this.rotation)%360),this.div.className=this.name,this.div.setAttribute("id",this.id),this.div.setAttribute("tabIndex",0),this.setInForeground(),this.div.addEventListener("focusin",bt(this,k)),this.div.addEventListener("focusout",bt(this,T));const[X,C]=this.parentDimensions;this.parentRotation%180!==0&&(this.div.style.maxWidth=`${(100*C/X).toFixed(2)}%`,this.div.style.maxHeight=`${(100*X/C).toFixed(2)}%`);const[H,st]=this.getInitialTranslation();return this.translate(H,st),(0,M.bindEvents)(this,this.div,["pointerdown"]),this.div}pointerdown(X){const{isMac:C}=p.FeatureTest.platform;if(X.button!==0||X.ctrlKey&&C){X.preventDefault();return}ul(this,g,!0),nl(this,Pt,as).call(this,X)}moveInDOM(){var X;(X=this.parent)==null||X.moveEditorInDOM(this)}_setParentAndPosition(X,C,H){X.changeParent(this),this.x=C,this.y=H,this.fixAndSetPosition()}getRect(X,C){const H=this.parentScale,[st,et]=this.pageDimensions,[Mt,Rt]=this.pageTranslation,gt=X/H,Jt=C/H,Dt=this.x*st,qt=this.y*et,vt=this.width*st,cl=this.height*et;switch(this.rotation){case 0:return[Dt+gt+Mt,et-qt-Jt-cl+Rt,Dt+gt+vt+Mt,et-qt-Jt+Rt];case 90:return[Dt+Jt+Mt,et-qt+gt+Rt,Dt+Jt+cl+Mt,et-qt+gt+vt+Rt];case 180:return[Dt-gt-vt+Mt,et-qt+Jt+Rt,Dt-gt+Mt,et-qt+Jt+cl+Rt];case 270:return[Dt-Jt-cl+Mt,et-qt-gt-vt+Rt,Dt-Jt+Mt,et-qt-gt+Rt];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(X,C){const[H,st,et,Mt]=X,Rt=et-H,gt=Mt-st;switch(this.rotation){case 0:return[H,C-Mt,Rt,gt];case 90:return[H,C-st,gt,Rt];case 180:return[et,C-st,Rt,gt];case 270:return[et,C-Mt,gt,Rt];default:throw new Error("Invalid rotation")}}onceAdded(){}isEmpty(){return!1}enableEditMode(){ul(this,J,!0)}disableEditMode(){ul(this,J,!1)}isInEditMode(){return bt(this,J)}shouldGetKeyboardEvents(){return!1}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}rebuild(){var X,C;(X=this.div)==null||X.addEventListener("focusin",bt(this,k)),(C=this.div)==null||C.addEventListener("focusout",bt(this,T))}serialize(X=!1,C=null){(0,p.unreachable)("An editor must be serializable")}static deserialize(X,C,H){const st=new this.prototype.constructor({parent:C,id:C.getNextId(),uiManager:H});st.rotation=X.rotation;const[et,Mt]=st.pageDimensions,[Rt,gt,Jt,Dt]=st.getRectInCurrentCoords(X.rect,Mt);return st.x=Rt/et,st.y=gt/Mt,st.width=Jt/et,st.height=Dt/Mt,st}remove(){var X;this.div.removeEventListener("focusin",bt(this,k)),this.div.removeEventListener("focusout",bt(this,T)),this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),(X=bt(this,j))==null||X.remove(),ul(this,j,null),ul(this,q,null)}get isResizable(){return!1}makeResizable(){this.isResizable&&(nl(this,it,is).call(this),bt(this,S).classList.remove("hidden"))}select(){var X;this.makeResizable(),(X=this.div)==null||X.classList.add("selectedEditor")}unselect(){var X,C,H;(X=bt(this,S))==null||X.classList.add("hidden"),(C=this.div)==null||C.classList.remove("selectedEditor"),(H=this.div)!=null&&H.contains(document.activeElement)&&this._uiManager.currentLayer.div.focus()}updateParams(X,C){}disableEditing(){bt(this,j)&&(bt(this,j).hidden=!0)}enableEditing(){bt(this,j)&&(bt(this,j).hidden=!1)}enterInEditMode(){}get contentDiv(){return this.div}get isEditing(){return bt(this,F)}set isEditing(X){ul(this,F,X),this.parent&&(X?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null))}setAspectRatio(X,C){ul(this,f,!0);const H=X/C,{style:st}=this.div;st.aspectRatio=H,st.height="auto"}static get MIN_SIZE(){return 16}};O=new WeakMap,I=new WeakMap,j=new WeakMap,q=new WeakMap,K=new WeakMap,f=new WeakMap,S=new WeakMap,k=new WeakMap,T=new WeakMap,g=new WeakMap,F=new WeakMap,J=new WeakMap,v=new WeakMap,u=new WeakMap,m=new WeakSet,pe=function([X,C],H,st){[H,st]=this.screenToPageTranslation(H,st),this.x+=H/X,this.y+=st/C,this.fixAndSetPosition()},$=new WeakSet,ye=function(){const[X,C]=this.parentDimensions,{_borderLineWidth:H}=R,st=H/X,et=H/C;switch(this.rotation){case 90:return[-st,et];case 180:return[st,et];case 270:return[st,-et];default:return[-st,-et]}},Zt=new WeakSet,Te=function(X,C,H){switch(H){case 90:return[C,-X];case 180:return[-X,-C];case 270:return[-C,X];default:return[X,C]}},It=new WeakSet,Le=function(X){switch(X){case 90:{const[C,H]=this.pageDimensions;return[0,-C/H,H/C,0]}case 180:return[-1,0,0,-1];case 270:{const[C,H]=this.pageDimensions;return[0,C/H,-H/C,0]}default:return[1,0,0,1]}},it=new WeakSet,is=function(){if(bt(this,S))return;ul(this,S,document.createElement("div")),bt(this,S).classList.add("resizers");const X=["topLeft","topRight","bottomRight","bottomLeft"];this._willKeepAspectRatio||X.push("topMiddle","middleRight","bottomMiddle","middleLeft");for(const C of X){const H=document.createElement("div");bt(this,S).append(H),H.classList.add("resizer",C),H.addEventListener("pointerdown",nl(this,zt,cs).bind(this,C)),H.addEventListener("contextmenu",B.noContextMenu)}this.div.prepend(bt(this,S))},zt=new WeakSet,cs=function(X,C){C.preventDefault();const{isMac:H}=p.FeatureTest.platform;if(C.button!==0||C.ctrlKey&&H)return;const st=nl(this,Nt,ds).bind(this,X),et=this._isDraggable;this._isDraggable=!1;const Mt={passive:!0,capture:!0};window.addEventListener("pointermove",st,Mt);const Rt=this.x,gt=this.y,Jt=this.width,Dt=this.height,qt=this.parent.div.style.cursor,vt=this.div.style.cursor;this.div.style.cursor=this.parent.div.style.cursor=window.getComputedStyle(C.target).cursor;const cl=()=>{this._isDraggable=et,window.removeEventListener("pointerup",cl),window.removeEventListener("blur",cl),window.removeEventListener("pointermove",st,Mt),this.parent.div.style.cursor=qt,this.div.style.cursor=vt;const bl=this.x,il=this.y,Bt=this.width,Ft=this.height;bl===Rt&&il===gt&&Bt===Jt&&Ft===Dt||this.addCommands({cmd:()=>{this.width=Bt,this.height=Ft,this.x=bl,this.y=il;const[wt,pt]=this.parentDimensions;this.setDims(wt*Bt,pt*Ft),this.fixAndSetPosition()},undo:()=>{this.width=Jt,this.height=Dt,this.x=Rt,this.y=gt;const[wt,pt]=this.parentDimensions;this.setDims(wt*Jt,pt*Dt),this.fixAndSetPosition()},mustExec:!0})};window.addEventListener("pointerup",cl),window.addEventListener("blur",cl)},Nt=new WeakSet,ds=function(X,C){const[H,st]=this.parentDimensions,et=this.x,Mt=this.y,Rt=this.width,gt=this.height,Jt=R.MIN_SIZE/H,Dt=R.MIN_SIZE/st,qt=Tt=>Math.round(Tt*1e4)/1e4,vt=nl(this,It,Le).call(this,this.rotation),cl=(Tt,jt)=>[vt[0]*Tt+vt[2]*jt,vt[1]*Tt+vt[3]*jt],bl=nl(this,It,Le).call(this,360-this.rotation),il=(Tt,jt)=>[bl[0]*Tt+bl[2]*jt,bl[1]*Tt+bl[3]*jt];let Bt,Ft,wt=!1,pt=!1;switch(X){case"topLeft":wt=!0,Bt=(Tt,jt)=>[0,0],Ft=(Tt,jt)=>[Tt,jt];break;case"topMiddle":Bt=(Tt,jt)=>[Tt/2,0],Ft=(Tt,jt)=>[Tt/2,jt];break;case"topRight":wt=!0,Bt=(Tt,jt)=>[Tt,0],Ft=(Tt,jt)=>[0,jt];break;case"middleRight":pt=!0,Bt=(Tt,jt)=>[Tt,jt/2],Ft=(Tt,jt)=>[0,jt/2];break;case"bottomRight":wt=!0,Bt=(Tt,jt)=>[Tt,jt],Ft=(Tt,jt)=>[0,0];break;case"bottomMiddle":Bt=(Tt,jt)=>[Tt/2,jt],Ft=(Tt,jt)=>[Tt/2,0];break;case"bottomLeft":wt=!0,Bt=(Tt,jt)=>[0,jt],Ft=(Tt,jt)=>[Tt,0];break;case"middleLeft":pt=!0,Bt=(Tt,jt)=>[0,jt/2],Ft=(Tt,jt)=>[Tt,jt/2];break}const Ct=Bt(Rt,gt),$t=Ft(Rt,gt);let dl=cl(...$t);const rl=qt(et+dl[0]),Yl=qt(Mt+dl[1]);let Xl=1,pl=1,[Ll,yl]=this.screenToPageTranslation(C.movementX,C.movementY);if([Ll,yl]=il(Ll/H,yl/st),wt){const Tt=Math.hypot(Rt,gt);Xl=pl=Math.max(Math.min(Math.hypot($t[0]-Ct[0]-Ll,$t[1]-Ct[1]-yl)/Tt,1/Rt,1/gt),Jt/Rt,Dt/gt)}else pt?Xl=Math.max(Jt,Math.min(1,Math.abs($t[0]-Ct[0]-Ll)))/Rt:pl=Math.max(Dt,Math.min(1,Math.abs($t[1]-Ct[1]-yl)))/gt;const Vl=qt(Rt*Xl),_t=qt(gt*pl);dl=cl(...Ft(Vl,_t));const ot=rl-dl[0],ut=Yl-dl[1];this.width=Vl,this.height=_t,this.x=ot,this.y=ut,this.setDims(H*Vl,st*_t),this.fixAndSetPosition()},Vt=new WeakSet,Ve=async function(){var H;const X=bt(this,j);if(!X)return;if(!bt(this,O)&&!bt(this,I)){X.classList.remove("done"),(H=bt(this,q))==null||H.remove();return}R._l10nPromise.get("editor_alt_text_edit_button_label").then(st=>{X.setAttribute("aria-label",st)});let C=bt(this,q);if(!C){ul(this,q,C=document.createElement("span")),C.className="tooltip",C.setAttribute("role","tooltip");const st=C.id=`alt-text-tooltip-${this.id}`;X.setAttribute("aria-describedby",st);const et=100;X.addEventListener("mouseenter",()=>{ul(this,K,setTimeout(()=>{ul(this,K,null),bt(this,q).classList.add("show"),this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",subtype:this.editorType,data:{action:"alt_text_tooltip"}}})},et))}),X.addEventListener("mouseleave",()=>{var Mt;clearTimeout(bt(this,K)),ul(this,K,null),(Mt=bt(this,q))==null||Mt.classList.remove("show")})}X.classList.add("done"),C.innerText=bt(this,I)?await R._l10nPromise.get("editor_alt_text_decorative_tooltip"):bt(this,O),C.parentNode||X.append(C)},Pt=new WeakSet,as=function(X){if(!this._isDraggable)return;const C=this._uiManager.isSelected(this);this._uiManager.setUpDragSession();let H,st;C&&(H={passive:!0,capture:!0},st=Mt=>{const[Rt,gt]=this.screenToPageTranslation(Mt.movementX,Mt.movementY);this._uiManager.dragSelectedEditors(Rt,gt)},window.addEventListener("pointermove",st,H));const et=()=>{if(window.removeEventListener("pointerup",et),window.removeEventListener("blur",et),C&&window.removeEventListener("pointermove",st,H),ul(this,g,!1),!this._uiManager.endDragSession()){const{isMac:Mt}=p.FeatureTest.platform;X.ctrlKey&&!Mt||X.shiftKey||X.metaKey&&Mt?this.parent.toggleSelected(this):this.parent.setSelected(this)}};window.addEventListener("pointerup",et),window.addEventListener("blur",et)},ll(R,Zt),gl(R,"_borderLineWidth",-1),gl(R,"_colorManager",new M.ColorManager),gl(R,"_zIndex",1),gl(R,"SMALL_EDITOR_SIZE",0);let Q=R;r.AnnotationEditor=Q;class U extends Q{constructor(X){super(X),this.annotationElementId=X.annotationElementId,this.deleted=!0}serialize(){return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex}}}},(lt,r,h)=>{var f,S,k,T,g,Ie,v,u,m,_,$,ns,dt,It,xt,it,Xt,zt,Gt,Nt,Ut,Vt,Ht,Pt,at,R,w,X,C,H,st,et,Mt,Rt,gt,Jt,Dt,qt,vt,cl,bl,il,Bt,Ft,wt,pt,Ct,Zs,dl,ze,Yl,Re,pl,ae,yl,Se,_t,we,ut,Jl,jt,_l,Lt,hs,Kt,bs,el,xe,Qt,ql,hl,ke;Object.defineProperty(r,"__esModule",{value:!0}),r.KeyboardManager=r.CommandManager=r.ColorManager=r.AnnotationEditorUIManager=void 0,r.bindEvents=B,r.opacityToHex=Q;var M=h(1),p=h(6);function B(nt,L,ct){for(const Wt of ct)L.addEventListener(Wt,nt[Wt].bind(nt))}function Q(nt){return Math.round(Math.min(255,Math.max(1,255*nt))).toString(16).padStart(2,"0")}class U{constructor(){ll(this,f,0)}getId(){return`${M.AnnotationEditorPrefix}${Al(this,f)._++}`}}f=new WeakMap;const J=class J{constructor(){ll(this,g);ll(this,S,(0,M.getUuid)());ll(this,k,0);ll(this,T,null)}static get _isSVGFittingCanvas(){const L='data:image/svg+xml;charset=UTF-8,<svg viewBox="0 0 1 1" width="1" height="1" xmlns="http://www.w3.org/2000/svg"><rect width="1" height="1" style="fill:red;"/></svg>',Wt=new OffscreenCanvas(1,3).getContext("2d"),Yt=new Image;Yt.src=L;const kt=Yt.decode().then(()=>(Wt.drawImage(Yt,0,0,1,1,0,0,1,3),new Uint32Array(Wt.getImageData(0,0,1,1).data.buffer)[0]===0));return(0,M.shadow)(this,"_isSVGFittingCanvas",kt)}async getFromFile(L){const{lastModified:ct,name:Wt,size:Yt,type:kt}=L;return nl(this,g,Ie).call(this,`${ct}_${Wt}_${Yt}_${kt}`,L)}async getFromUrl(L){return nl(this,g,Ie).call(this,L,L)}async getFromId(L){bt(this,T)||ul(this,T,new Map);const ct=bt(this,T).get(L);return ct?ct.bitmap?(ct.refCounter+=1,ct):ct.file?this.getFromFile(ct.file):this.getFromUrl(ct.url):null}getSvgUrl(L){const ct=bt(this,T).get(L);return ct!=null&&ct.isSvg?ct.svgUrl:null}deleteId(L){bt(this,T)||ul(this,T,new Map);const ct=bt(this,T).get(L);ct&&(ct.refCounter-=1,ct.refCounter===0&&(ct.bitmap=null))}isValidId(L){return L.startsWith(`image_${bt(this,S)}_`)}};S=new WeakMap,k=new WeakMap,T=new WeakMap,g=new WeakSet,Ie=async function(L,ct){bt(this,T)||ul(this,T,new Map);let Wt=bt(this,T).get(L);if(Wt===null)return null;if(Wt!=null&&Wt.bitmap)return Wt.refCounter+=1,Wt;try{Wt||(Wt={bitmap:null,id:`image_${bt(this,S)}_${Al(this,k)._++}`,refCounter:0,isSvg:!1});let Yt;if(typeof ct=="string"){Wt.url=ct;const kt=await fetch(ct);if(!kt.ok)throw new Error(kt.statusText);Yt=await kt.blob()}else Yt=Wt.file=ct;if(Yt.type==="image/svg+xml"){const kt=J._isSVGFittingCanvas,Et=new FileReader,sl=new Image,ml=new Promise((al,zl)=>{sl.onload=()=>{Wt.bitmap=sl,Wt.isSvg=!0,al()},Et.onload=async()=>{const Gl=Wt.svgUrl=Et.result;sl.src=await kt?`${Gl}#svgView(preserveAspectRatio(none))`:Gl},sl.onerror=Et.onerror=zl});Et.readAsDataURL(Yt),await ml}else Wt.bitmap=await createImageBitmap(Yt);Wt.refCounter=1}catch(Yt){console.error(Yt),Wt=null}return bt(this,T).set(L,Wt),Wt&&bt(this,T).set(Wt.id,Wt),Wt};let O=J;class I{constructor(L=128){ll(this,v,[]);ll(this,u,!1);ll(this,m,void 0);ll(this,_,-1);ul(this,m,L)}add({cmd:L,undo:ct,mustExec:Wt,type:Yt=NaN,overwriteIfSameType:kt=!1,keepUndo:Et=!1}){if(Wt&&L(),bt(this,u))return;const sl={cmd:L,undo:ct,type:Yt};if(bt(this,_)===-1){bt(this,v).length>0&&(bt(this,v).length=0),ul(this,_,0),bt(this,v).push(sl);return}if(kt&&bt(this,v)[bt(this,_)].type===Yt){Et&&(sl.undo=bt(this,v)[bt(this,_)].undo),bt(this,v)[bt(this,_)]=sl;return}const ml=bt(this,_)+1;ml===bt(this,m)?bt(this,v).splice(0,1):(ul(this,_,ml),ml<bt(this,v).length&&bt(this,v).splice(ml)),bt(this,v).push(sl)}undo(){bt(this,_)!==-1&&(ul(this,u,!0),bt(this,v)[bt(this,_)].undo(),ul(this,u,!1),ul(this,_,bt(this,_)-1))}redo(){bt(this,_)<bt(this,v).length-1&&(ul(this,_,bt(this,_)+1),ul(this,u,!0),bt(this,v)[bt(this,_)].cmd(),ul(this,u,!1))}hasSomethingToUndo(){return bt(this,_)!==-1}hasSomethingToRedo(){return bt(this,_)<bt(this,v).length-1}destroy(){ul(this,v,null)}}v=new WeakMap,u=new WeakMap,m=new WeakMap,_=new WeakMap,r.CommandManager=I;class j{constructor(L){ll(this,$);this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;const{isMac:ct}=M.FeatureTest.platform;for(const[Wt,Yt,kt={}]of L)for(const Et of Wt){const sl=Et.startsWith("mac+");ct&&sl?(this.callbacks.set(Et.slice(4),{callback:Yt,options:kt}),this.allKeys.add(Et.split("+").at(-1))):!ct&&!sl&&(this.callbacks.set(Et,{callback:Yt,options:kt}),this.allKeys.add(Et.split("+").at(-1)))}}exec(L,ct){if(!this.allKeys.has(ct.key))return;const Wt=this.callbacks.get(nl(this,$,ns).call(this,ct));if(!Wt)return;const{callback:Yt,options:{bubbles:kt=!1,args:Et=[],checker:sl=null}}=Wt;sl&&!sl(L,ct)||(Yt.bind(L,...Et)(),kt||(ct.stopPropagation(),ct.preventDefault()))}}$=new WeakSet,ns=function(L){L.altKey&&this.buffer.push("alt"),L.ctrlKey&&this.buffer.push("ctrl"),L.metaKey&&this.buffer.push("meta"),L.shiftKey&&this.buffer.push("shift"),this.buffer.push(L.key);const ct=this.buffer.join("+");return this.buffer.length=0,ct},r.KeyboardManager=j;const Zt=class Zt{get _colors(){const L=new Map([["CanvasText",null],["Canvas",null]]);return(0,p.getColorValues)(L),(0,M.shadow)(this,"_colors",L)}convert(L){const ct=(0,p.getRGB)(L);if(!window.matchMedia("(forced-colors: active)").matches)return ct;for(const[Wt,Yt]of this._colors)if(Yt.every((kt,Et)=>kt===ct[Et]))return Zt._colorsMapping.get(Wt);return ct}getHexCode(L){const ct=this._colors.get(L);return ct?M.Util.makeHexColor(...ct):L}};gl(Zt,"_colorsMapping",new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]));let q=Zt;r.ColorManager=q;const Wl=class Wl{constructor(L,ct,Wt,Yt,kt,Et){ll(this,Ct);ll(this,dl);ll(this,Yl);ll(this,pl);ll(this,yl);ll(this,_t);ll(this,ut);ll(this,jt);ll(this,Lt);ll(this,Kt);ll(this,el);ll(this,Qt);ll(this,hl);ll(this,dt,null);ll(this,It,new Map);ll(this,xt,new Map);ll(this,it,null);ll(this,Xt,null);ll(this,zt,new I);ll(this,Gt,0);ll(this,Nt,new Set);ll(this,Ut,null);ll(this,Vt,null);ll(this,Ht,new Set);ll(this,Pt,null);ll(this,at,new U);ll(this,R,!1);ll(this,w,!1);ll(this,X,null);ll(this,C,M.AnnotationEditorType.NONE);ll(this,H,new Set);ll(this,st,null);ll(this,et,this.blur.bind(this));ll(this,Mt,this.focus.bind(this));ll(this,Rt,this.copy.bind(this));ll(this,gt,this.cut.bind(this));ll(this,Jt,this.paste.bind(this));ll(this,Dt,this.keydown.bind(this));ll(this,qt,this.onEditingAction.bind(this));ll(this,vt,this.onPageChanging.bind(this));ll(this,cl,this.onScaleChanging.bind(this));ll(this,bl,this.onRotationChanging.bind(this));ll(this,il,{isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1});ll(this,Bt,[0,0]);ll(this,Ft,null);ll(this,wt,null);ll(this,pt,null);ul(this,wt,L),ul(this,pt,ct),ul(this,it,Wt),this._eventBus=Yt,this._eventBus._on("editingaction",bt(this,qt)),this._eventBus._on("pagechanging",bt(this,vt)),this._eventBus._on("scalechanging",bt(this,cl)),this._eventBus._on("rotationchanging",bt(this,bl)),ul(this,Xt,kt.annotationStorage),ul(this,Pt,kt.filterFactory),ul(this,st,Et),this.viewParameters={realScale:p.PixelsPerInch.PDF_TO_CSS_UNITS,rotation:0}}static get _keyboardManager(){const L=Wl.prototype,ct=kt=>{const{activeElement:Et}=document;return Et&&bt(kt,wt).contains(Et)&&kt.hasSomethingToControl()},Wt=this.TRANSLATE_SMALL,Yt=this.TRANSLATE_BIG;return(0,M.shadow)(this,"_keyboardManager",new j([[["ctrl+a","mac+meta+a"],L.selectAll],[["ctrl+z","mac+meta+z"],L.undo],[["ctrl+y","ctrl+shift+z","mac+meta+shift+z","ctrl+shift+Z","mac+meta+shift+Z"],L.redo],[["Backspace","alt+Backspace","ctrl+Backspace","shift+Backspace","mac+Backspace","mac+alt+Backspace","mac+ctrl+Backspace","Delete","ctrl+Delete","shift+Delete","mac+Delete"],L.delete],[["Escape","mac+Escape"],L.unselectAll],[["ArrowLeft","mac+ArrowLeft"],L.translateSelectedEditors,{args:[-Wt,0],checker:ct}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],L.translateSelectedEditors,{args:[-Yt,0],checker:ct}],[["ArrowRight","mac+ArrowRight"],L.translateSelectedEditors,{args:[Wt,0],checker:ct}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],L.translateSelectedEditors,{args:[Yt,0],checker:ct}],[["ArrowUp","mac+ArrowUp"],L.translateSelectedEditors,{args:[0,-Wt],checker:ct}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],L.translateSelectedEditors,{args:[0,-Yt],checker:ct}],[["ArrowDown","mac+ArrowDown"],L.translateSelectedEditors,{args:[0,Wt],checker:ct}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],L.translateSelectedEditors,{args:[0,Yt],checker:ct}]]))}destroy(){nl(this,pl,ae).call(this),nl(this,dl,ze).call(this),this._eventBus._off("editingaction",bt(this,qt)),this._eventBus._off("pagechanging",bt(this,vt)),this._eventBus._off("scalechanging",bt(this,cl)),this._eventBus._off("rotationchanging",bt(this,bl));for(const L of bt(this,xt).values())L.destroy();bt(this,xt).clear(),bt(this,It).clear(),bt(this,Ht).clear(),ul(this,dt,null),bt(this,H).clear(),bt(this,zt).destroy(),bt(this,it).destroy()}get hcmFilter(){return(0,M.shadow)(this,"hcmFilter",bt(this,st)?bt(this,Pt).addHCMFilter(bt(this,st).foreground,bt(this,st).background):"none")}get direction(){return(0,M.shadow)(this,"direction",getComputedStyle(bt(this,wt)).direction)}editAltText(L){var ct;(ct=bt(this,it))==null||ct.editAltText(this,L)}onPageChanging({pageNumber:L}){ul(this,Gt,L-1)}focusMainContainer(){bt(this,wt).focus()}findParent(L,ct){for(const Wt of bt(this,xt).values()){const{x:Yt,y:kt,width:Et,height:sl}=Wt.div.getBoundingClientRect();if(L>=Yt&&L<=Yt+Et&&ct>=kt&&ct<=kt+sl)return Wt}return null}disableUserSelect(L=!1){bt(this,pt).classList.toggle("noUserSelect",L)}addShouldRescale(L){bt(this,Ht).add(L)}removeShouldRescale(L){bt(this,Ht).delete(L)}onScaleChanging({scale:L}){this.commitOrRemove(),this.viewParameters.realScale=L*p.PixelsPerInch.PDF_TO_CSS_UNITS;for(const ct of bt(this,Ht))ct.onScaleChanging()}onRotationChanging({pagesRotation:L}){this.commitOrRemove(),this.viewParameters.rotation=L}addToAnnotationStorage(L){!L.isEmpty()&&bt(this,Xt)&&!bt(this,Xt).has(L.id)&&bt(this,Xt).setValue(L.id,L)}blur(){if(!this.hasSelection)return;const{activeElement:L}=document;for(const ct of bt(this,H))if(ct.div.contains(L)){ul(this,X,[ct,L]),ct._focusEventsAllowed=!1;break}}focus(){if(!bt(this,X))return;const[L,ct]=bt(this,X);ul(this,X,null),ct.addEventListener("focusin",()=>{L._focusEventsAllowed=!0},{once:!0}),ct.focus()}addEditListeners(){nl(this,Yl,Re).call(this),nl(this,yl,Se).call(this)}removeEditListeners(){nl(this,pl,ae).call(this),nl(this,_t,we).call(this)}copy(L){var Wt;if(L.preventDefault(),(Wt=bt(this,dt))==null||Wt.commitOrRemove(),!this.hasSelection)return;const ct=[];for(const Yt of bt(this,H)){const kt=Yt.serialize(!0);kt&&ct.push(kt)}ct.length!==0&&L.clipboardData.setData("application/pdfjs",JSON.stringify(ct))}cut(L){this.copy(L),this.delete()}paste(L){L.preventDefault();const{clipboardData:ct}=L;for(const kt of ct.items)for(const Et of bt(this,Vt))if(Et.isHandlingMimeForPasting(kt.type)){Et.paste(kt,this.currentLayer);return}let Wt=ct.getData("application/pdfjs");if(!Wt)return;try{Wt=JSON.parse(Wt)}catch(kt){(0,M.warn)(`paste: "${kt.message}".`);return}if(!Array.isArray(Wt))return;this.unselectAll();const Yt=this.currentLayer;try{const kt=[];for(const ml of Wt){const al=Yt.deserialize(ml);if(!al)return;kt.push(al)}const Et=()=>{for(const ml of kt)nl(this,el,xe).call(this,ml);nl(this,hl,ke).call(this,kt)},sl=()=>{for(const ml of kt)ml.remove()};this.addCommands({cmd:Et,undo:sl,mustExec:!0})}catch(kt){(0,M.warn)(`paste: "${kt.message}".`)}}keydown(L){var ct;(ct=this.getActive())!=null&&ct.shouldGetKeyboardEvents()||Wl._keyboardManager.exec(this,L)}onEditingAction(L){["undo","redo","delete","selectAll"].includes(L.name)&&this[L.name]()}setEditingState(L){L?(nl(this,Ct,Zs).call(this),nl(this,Yl,Re).call(this),nl(this,yl,Se).call(this),nl(this,ut,Jl).call(this,{isEditing:bt(this,C)!==M.AnnotationEditorType.NONE,isEmpty:nl(this,Qt,ql).call(this),hasSomethingToUndo:bt(this,zt).hasSomethingToUndo(),hasSomethingToRedo:bt(this,zt).hasSomethingToRedo(),hasSelectedEditor:!1})):(nl(this,dl,ze).call(this),nl(this,pl,ae).call(this),nl(this,_t,we).call(this),nl(this,ut,Jl).call(this,{isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(L){if(!bt(this,Vt)){ul(this,Vt,L);for(const ct of bt(this,Vt))nl(this,jt,_l).call(this,ct.defaultPropertiesToUpdate)}}getId(){return bt(this,at).getId()}get currentLayer(){return bt(this,xt).get(bt(this,Gt))}getLayer(L){return bt(this,xt).get(L)}get currentPageIndex(){return bt(this,Gt)}addLayer(L){bt(this,xt).set(L.pageIndex,L),bt(this,R)?L.enable():L.disable()}removeLayer(L){bt(this,xt).delete(L.pageIndex)}updateMode(L,ct=null){if(bt(this,C)!==L){if(ul(this,C,L),L===M.AnnotationEditorType.NONE){this.setEditingState(!1),nl(this,Kt,bs).call(this);return}this.setEditingState(!0),nl(this,Lt,hs).call(this),this.unselectAll();for(const Wt of bt(this,xt).values())Wt.updateMode(L);if(ct){for(const Wt of bt(this,It).values())if(Wt.annotationElementId===ct){this.setSelected(Wt),Wt.enterInEditMode();break}}}}updateToolbar(L){L!==bt(this,C)&&this._eventBus.dispatch("switchannotationeditormode",{source:this,mode:L})}updateParams(L,ct){if(bt(this,Vt)){if(L===M.AnnotationEditorParamsType.CREATE){this.currentLayer.addNewEditor(L);return}for(const Wt of bt(this,H))Wt.updateParams(L,ct);for(const Wt of bt(this,Vt))Wt.updateDefaultParams(L,ct)}}enableWaiting(L=!1){if(bt(this,w)!==L){ul(this,w,L);for(const ct of bt(this,xt).values())L?ct.disableClick():ct.enableClick(),ct.div.classList.toggle("waiting",L)}}getEditors(L){const ct=[];for(const Wt of bt(this,It).values())Wt.pageIndex===L&&ct.push(Wt);return ct}getEditor(L){return bt(this,It).get(L)}addEditor(L){bt(this,It).set(L.id,L)}removeEditor(L){var ct;bt(this,It).delete(L.id),this.unselect(L),(!L.annotationElementId||!bt(this,Nt).has(L.annotationElementId))&&((ct=bt(this,Xt))==null||ct.remove(L.id))}addDeletedAnnotationElement(L){bt(this,Nt).add(L.annotationElementId),L.deleted=!0}isDeletedAnnotationElement(L){return bt(this,Nt).has(L)}removeDeletedAnnotationElement(L){bt(this,Nt).delete(L.annotationElementId),L.deleted=!1}setActiveEditor(L){bt(this,dt)!==L&&(ul(this,dt,L),L&&nl(this,jt,_l).call(this,L.propertiesToUpdate))}toggleSelected(L){if(bt(this,H).has(L)){bt(this,H).delete(L),L.unselect(),nl(this,ut,Jl).call(this,{hasSelectedEditor:this.hasSelection});return}bt(this,H).add(L),L.select(),nl(this,jt,_l).call(this,L.propertiesToUpdate),nl(this,ut,Jl).call(this,{hasSelectedEditor:!0})}setSelected(L){for(const ct of bt(this,H))ct!==L&&ct.unselect();bt(this,H).clear(),bt(this,H).add(L),L.select(),nl(this,jt,_l).call(this,L.propertiesToUpdate),nl(this,ut,Jl).call(this,{hasSelectedEditor:!0})}isSelected(L){return bt(this,H).has(L)}unselect(L){L.unselect(),bt(this,H).delete(L),nl(this,ut,Jl).call(this,{hasSelectedEditor:this.hasSelection})}get hasSelection(){return bt(this,H).size!==0}undo(){bt(this,zt).undo(),nl(this,ut,Jl).call(this,{hasSomethingToUndo:bt(this,zt).hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:nl(this,Qt,ql).call(this)})}redo(){bt(this,zt).redo(),nl(this,ut,Jl).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:bt(this,zt).hasSomethingToRedo(),isEmpty:nl(this,Qt,ql).call(this)})}addCommands(L){bt(this,zt).add(L),nl(this,ut,Jl).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:nl(this,Qt,ql).call(this)})}delete(){if(this.commitOrRemove(),!this.hasSelection)return;const L=[...bt(this,H)],ct=()=>{for(const Yt of L)Yt.remove()},Wt=()=>{for(const Yt of L)nl(this,el,xe).call(this,Yt)};this.addCommands({cmd:ct,undo:Wt,mustExec:!0})}commitOrRemove(){var L;(L=bt(this,dt))==null||L.commitOrRemove()}hasSomethingToControl(){return bt(this,dt)||this.hasSelection}selectAll(){for(const L of bt(this,H))L.commit();nl(this,hl,ke).call(this,bt(this,It).values())}unselectAll(){if(bt(this,dt)){bt(this,dt).commitOrRemove();return}if(this.hasSelection){for(const L of bt(this,H))L.unselect();bt(this,H).clear(),nl(this,ut,Jl).call(this,{hasSelectedEditor:!1})}}translateSelectedEditors(L,ct,Wt=!1){if(Wt||this.commitOrRemove(),!this.hasSelection)return;bt(this,Bt)[0]+=L,bt(this,Bt)[1]+=ct;const[Yt,kt]=bt(this,Bt),Et=[...bt(this,H)],sl=1e3;bt(this,Ft)&&clearTimeout(bt(this,Ft)),ul(this,Ft,setTimeout(()=>{ul(this,Ft,null),bt(this,Bt)[0]=bt(this,Bt)[1]=0,this.addCommands({cmd:()=>{for(const ml of Et)bt(this,It).has(ml.id)&&ml.translateInPage(Yt,kt)},undo:()=>{for(const ml of Et)bt(this,It).has(ml.id)&&ml.translateInPage(-Yt,-kt)},mustExec:!1})},sl));for(const ml of Et)ml.translateInPage(L,ct)}setUpDragSession(){if(this.hasSelection){this.disableUserSelect(!0),ul(this,Ut,new Map);for(const L of bt(this,H))bt(this,Ut).set(L,{savedX:L.x,savedY:L.y,savedPageIndex:L.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!bt(this,Ut))return!1;this.disableUserSelect(!1);const L=bt(this,Ut);ul(this,Ut,null);let ct=!1;for(const[{x:Yt,y:kt,pageIndex:Et},sl]of L)sl.newX=Yt,sl.newY=kt,sl.newPageIndex=Et,ct||(ct=Yt!==sl.savedX||kt!==sl.savedY||Et!==sl.savedPageIndex);if(!ct)return!1;const Wt=(Yt,kt,Et,sl)=>{if(bt(this,It).has(Yt.id)){const ml=bt(this,xt).get(sl);ml?Yt._setParentAndPosition(ml,kt,Et):(Yt.pageIndex=sl,Yt.x=kt,Yt.y=Et)}};return this.addCommands({cmd:()=>{for(const[Yt,{newX:kt,newY:Et,newPageIndex:sl}]of L)Wt(Yt,kt,Et,sl)},undo:()=>{for(const[Yt,{savedX:kt,savedY:Et,savedPageIndex:sl}]of L)Wt(Yt,kt,Et,sl)},mustExec:!0}),!0}dragSelectedEditors(L,ct){if(bt(this,Ut))for(const Wt of bt(this,Ut).keys())Wt.drag(L,ct)}rebuild(L){if(L.parent===null){const ct=this.getLayer(L.pageIndex);ct?(ct.changeParent(L),ct.addOrRebuild(L)):(this.addEditor(L),this.addToAnnotationStorage(L),L.rebuild())}else L.parent.addOrRebuild(L)}isActive(L){return bt(this,dt)===L}getActive(){return bt(this,dt)}getMode(){return bt(this,C)}get imageManager(){return(0,M.shadow)(this,"imageManager",new O)}};dt=new WeakMap,It=new WeakMap,xt=new WeakMap,it=new WeakMap,Xt=new WeakMap,zt=new WeakMap,Gt=new WeakMap,Nt=new WeakMap,Ut=new WeakMap,Vt=new WeakMap,Ht=new WeakMap,Pt=new WeakMap,at=new WeakMap,R=new WeakMap,w=new WeakMap,X=new WeakMap,C=new WeakMap,H=new WeakMap,st=new WeakMap,et=new WeakMap,Mt=new WeakMap,Rt=new WeakMap,gt=new WeakMap,Jt=new WeakMap,Dt=new WeakMap,qt=new WeakMap,vt=new WeakMap,cl=new WeakMap,bl=new WeakMap,il=new WeakMap,Bt=new WeakMap,Ft=new WeakMap,wt=new WeakMap,pt=new WeakMap,Ct=new WeakSet,Zs=function(){window.addEventListener("focus",bt(this,Mt)),window.addEventListener("blur",bt(this,et))},dl=new WeakSet,ze=function(){window.removeEventListener("focus",bt(this,Mt)),window.removeEventListener("blur",bt(this,et))},Yl=new WeakSet,Re=function(){window.addEventListener("keydown",bt(this,Dt),{capture:!0})},pl=new WeakSet,ae=function(){window.removeEventListener("keydown",bt(this,Dt),{capture:!0})},yl=new WeakSet,Se=function(){document.addEventListener("copy",bt(this,Rt)),document.addEventListener("cut",bt(this,gt)),document.addEventListener("paste",bt(this,Jt))},_t=new WeakSet,we=function(){document.removeEventListener("copy",bt(this,Rt)),document.removeEventListener("cut",bt(this,gt)),document.removeEventListener("paste",bt(this,Jt))},ut=new WeakSet,Jl=function(L){Object.entries(L).some(([Wt,Yt])=>bt(this,il)[Wt]!==Yt)&&this._eventBus.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(bt(this,il),L)})},jt=new WeakSet,_l=function(L){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:L})},Lt=new WeakSet,hs=function(){if(!bt(this,R)){ul(this,R,!0);for(const L of bt(this,xt).values())L.enable()}},Kt=new WeakSet,bs=function(){if(this.unselectAll(),bt(this,R)){ul(this,R,!1);for(const L of bt(this,xt).values())L.disable()}},el=new WeakSet,xe=function(L){const ct=bt(this,xt).get(L.pageIndex);ct?ct.addOrRebuild(L):this.addEditor(L)},Qt=new WeakSet,ql=function(){if(bt(this,It).size===0)return!0;if(bt(this,It).size===1)for(const L of bt(this,It).values())return L.isEmpty();return!1},hl=new WeakSet,ke=function(L){bt(this,H).clear();for(const ct of L)ct.isEmpty()||(bt(this,H).add(ct),ct.select());nl(this,ut,Jl).call(this,{hasSelectedEditor:!0})},gl(Wl,"TRANSLATE_SMALL",1),gl(Wl,"TRANSLATE_BIG",10);let K=Wl;r.AnnotationEditorUIManager=K},(lt,r,h)=>{var Gt,Nt,Ut,Vt,Ht,Pt,at,R,w,X,C,H,Pl,et,Hl,Rt,ge,Jt,ne,qt,Ze,cl,$l,il,te;Object.defineProperty(r,"__esModule",{value:!0}),r.StatTimer=r.RenderingCancelledException=r.PixelsPerInch=r.PageViewport=r.PDFDateString=r.DOMStandardFontDataFactory=r.DOMSVGFactory=r.DOMFilterFactory=r.DOMCanvasFactory=r.DOMCMapReaderFactory=void 0,r.deprecated=_,r.getColorValues=It,r.getCurrentTransform=xt,r.getCurrentTransformInverse=it,r.getFilenameFromUrl=g,r.getPdfFilenameFromUrl=F,r.getRGB=dt,r.getXfaPageViewport=Zt,r.isDataScheme=k,r.isPdfFile=T,r.isValidFetchUrl=v,r.loadScript=m,r.noContextMenu=u,r.setLayerDimensions=Xt;var M=h(7),p=h(1);const B="http://www.w3.org/2000/svg",zt=class zt{};gl(zt,"CSS",96),gl(zt,"PDF",72),gl(zt,"PDF_TO_CSS_UNITS",zt.CSS/zt.PDF);let Q=zt;r.PixelsPerInch=Q;class U extends M.BaseFilterFactory{constructor({docId:pt,ownerDocument:Ct=globalThis.document}={}){super();ll(this,H);ll(this,et);ll(this,Rt);ll(this,Jt);ll(this,qt);ll(this,cl);ll(this,il);ll(this,Gt,void 0);ll(this,Nt,void 0);ll(this,Ut,void 0);ll(this,Vt,void 0);ll(this,Ht,void 0);ll(this,Pt,void 0);ll(this,at,void 0);ll(this,R,void 0);ll(this,w,void 0);ll(this,X,void 0);ll(this,C,0);ul(this,Ut,pt),ul(this,Vt,Ct)}addFilter(pt){if(!pt)return"none";let Ct=bt(this,H,Pl).get(pt);if(Ct)return Ct;let $t,dl,rl,Yl;if(pt.length===1){const yl=pt[0],Vl=new Array(256);for(let _t=0;_t<256;_t++)Vl[_t]=yl[_t]/255;Yl=$t=dl=rl=Vl.join(",")}else{const[yl,Vl,_t]=pt,ot=new Array(256),ut=new Array(256),Tt=new Array(256);for(let jt=0;jt<256;jt++)ot[jt]=yl[jt]/255,ut[jt]=Vl[jt]/255,Tt[jt]=_t[jt]/255;$t=ot.join(","),dl=ut.join(","),rl=Tt.join(","),Yl=`${$t}${dl}${rl}`}if(Ct=bt(this,H,Pl).get(Yl),Ct)return bt(this,H,Pl).set(pt,Ct),Ct;const Xl=`g_${bt(this,Ut)}_transfer_map_${Al(this,C)._++}`,pl=`url(#${Xl})`;bt(this,H,Pl).set(pt,pl),bt(this,H,Pl).set(Yl,pl);const Ll=nl(this,Jt,ne).call(this,Xl);return nl(this,cl,$l).call(this,$t,dl,rl,Ll),pl}addHCMFilter(pt,Ct){var Vl;const $t=`${pt}-${Ct}`;if(bt(this,Pt)===$t)return bt(this,at);if(ul(this,Pt,$t),ul(this,at,"none"),(Vl=bt(this,Ht))==null||Vl.remove(),!pt||!Ct)return bt(this,at);const dl=nl(this,il,te).call(this,pt);pt=p.Util.makeHexColor(...dl);const rl=nl(this,il,te).call(this,Ct);if(Ct=p.Util.makeHexColor(...rl),bt(this,et,Hl).style.color="",pt==="#000000"&&Ct==="#ffffff"||pt===Ct)return bt(this,at);const Yl=new Array(256);for(let _t=0;_t<=255;_t++){const ot=_t/255;Yl[_t]=ot<=.03928?ot/12.92:((ot+.055)/1.055)**2.4}const Xl=Yl.join(","),pl=`g_${bt(this,Ut)}_hcm_filter`,Ll=ul(this,R,nl(this,Jt,ne).call(this,pl));nl(this,cl,$l).call(this,Xl,Xl,Xl,Ll),nl(this,Rt,ge).call(this,Ll);const yl=(_t,ot)=>{const ut=dl[_t]/255,Tt=rl[_t]/255,jt=new Array(ot+1);for(let Ot=0;Ot<=ot;Ot++)jt[Ot]=ut+Ot/ot*(Tt-ut);return jt.join(",")};return nl(this,cl,$l).call(this,yl(0,5),yl(1,5),yl(2,5),Ll),ul(this,at,`url(#${pl})`),bt(this,at)}addHighlightHCMFilter(pt,Ct,$t,dl){var Tt;const rl=`${pt}-${Ct}-${$t}-${dl}`;if(bt(this,w)===rl)return bt(this,X);if(ul(this,w,rl),ul(this,X,"none"),(Tt=bt(this,R))==null||Tt.remove(),!pt||!Ct)return bt(this,X);const[Yl,Xl]=[pt,Ct].map(nl(this,il,te).bind(this));let pl=Math.round(.2126*Yl[0]+.7152*Yl[1]+.0722*Yl[2]),Ll=Math.round(.2126*Xl[0]+.7152*Xl[1]+.0722*Xl[2]),[yl,Vl]=[$t,dl].map(nl(this,il,te).bind(this));Ll<pl&&([pl,Ll,yl,Vl]=[Ll,pl,Vl,yl]),bt(this,et,Hl).style.color="";const _t=(jt,Ot,Lt)=>{const yt=new Array(256),Kt=(Ll-pl)/Lt,tl=jt/255,el=(Ot-jt)/(255*Lt);let ol=0;for(let Qt=0;Qt<=Lt;Qt++){const Ml=Math.round(pl+Qt*Kt),hl=tl+Qt*el;for(let Il=ol;Il<=Ml;Il++)yt[Il]=hl;ol=Ml+1}for(let Qt=ol;Qt<256;Qt++)yt[Qt]=yt[ol-1];return yt.join(",")},ot=`g_${bt(this,Ut)}_hcm_highlight_filter`,ut=ul(this,R,nl(this,Jt,ne).call(this,ot));return nl(this,Rt,ge).call(this,ut),nl(this,cl,$l).call(this,_t(yl[0],Vl[0],5),_t(yl[1],Vl[1],5),_t(yl[2],Vl[2],5),ut),ul(this,X,`url(#${ot})`),bt(this,X)}destroy(pt=!1){pt&&(bt(this,at)||bt(this,X))||(bt(this,Nt)&&(bt(this,Nt).parentNode.parentNode.remove(),ul(this,Nt,null)),bt(this,Gt)&&(bt(this,Gt).clear(),ul(this,Gt,null)),ul(this,C,0))}}Gt=new WeakMap,Nt=new WeakMap,Ut=new WeakMap,Vt=new WeakMap,Ht=new WeakMap,Pt=new WeakMap,at=new WeakMap,R=new WeakMap,w=new WeakMap,X=new WeakMap,C=new WeakMap,H=new WeakSet,Pl=function(){return bt(this,Gt)||ul(this,Gt,new Map)},et=new WeakSet,Hl=function(){if(!bt(this,Nt)){const pt=bt(this,Vt).createElement("div"),{style:Ct}=pt;Ct.visibility="hidden",Ct.contain="strict",Ct.width=Ct.height=0,Ct.position="absolute",Ct.top=Ct.left=0,Ct.zIndex=-1;const $t=bt(this,Vt).createElementNS(B,"svg");$t.setAttribute("width",0),$t.setAttribute("height",0),ul(this,Nt,bt(this,Vt).createElementNS(B,"defs")),pt.append($t),$t.append(bt(this,Nt)),bt(this,Vt).body.append(pt)}return bt(this,Nt)},Rt=new WeakSet,ge=function(pt){const Ct=bt(this,Vt).createElementNS(B,"feColorMatrix");Ct.setAttribute("type","matrix"),Ct.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"),pt.append(Ct)},Jt=new WeakSet,ne=function(pt){const Ct=bt(this,Vt).createElementNS(B,"filter");return Ct.setAttribute("color-interpolation-filters","sRGB"),Ct.setAttribute("id",pt),bt(this,et,Hl).append(Ct),Ct},qt=new WeakSet,Ze=function(pt,Ct,$t){const dl=bt(this,Vt).createElementNS(B,Ct);dl.setAttribute("type","discrete"),dl.setAttribute("tableValues",$t),pt.append(dl)},cl=new WeakSet,$l=function(pt,Ct,$t,dl){const rl=bt(this,Vt).createElementNS(B,"feComponentTransfer");dl.append(rl),nl(this,qt,Ze).call(this,rl,"feFuncR",pt),nl(this,qt,Ze).call(this,rl,"feFuncG",Ct),nl(this,qt,Ze).call(this,rl,"feFuncB",$t)},il=new WeakSet,te=function(pt){return bt(this,et,Hl).style.color=pt,dt(getComputedStyle(bt(this,et,Hl)).getPropertyValue("color"))},r.DOMFilterFactory=U;class O extends M.BaseCanvasFactory{constructor({ownerDocument:wt=globalThis.document}={}){super(),this._document=wt}_createCanvas(wt,pt){const Ct=this._document.createElement("canvas");return Ct.width=wt,Ct.height=pt,Ct}}r.DOMCanvasFactory=O;async function I(Ft,wt=!1){if(v(Ft,document.baseURI)){const pt=await fetch(Ft);if(!pt.ok)throw new Error(pt.statusText);return wt?new Uint8Array(await pt.arrayBuffer()):(0,p.stringToBytes)(await pt.text())}return new Promise((pt,Ct)=>{const $t=new XMLHttpRequest;$t.open("GET",Ft,!0),wt&&($t.responseType="arraybuffer"),$t.onreadystatechange=()=>{if($t.readyState===XMLHttpRequest.DONE){if($t.status===200||$t.status===0){let dl;if(wt&&$t.response?dl=new Uint8Array($t.response):!wt&&$t.responseText&&(dl=(0,p.stringToBytes)($t.responseText)),dl){pt(dl);return}}Ct(new Error($t.statusText))}},$t.send(null)})}class j extends M.BaseCMapReaderFactory{_fetchData(wt,pt){return I(wt,this.isCompressed).then(Ct=>({cMapData:Ct,compressionType:pt}))}}r.DOMCMapReaderFactory=j;class q extends M.BaseStandardFontDataFactory{_fetchData(wt){return I(wt,!0)}}r.DOMStandardFontDataFactory=q;class K extends M.BaseSVGFactory{_createSVG(wt){return document.createElementNS(B,wt)}}r.DOMSVGFactory=K;class f{constructor({viewBox:wt,scale:pt,rotation:Ct,offsetX:$t=0,offsetY:dl=0,dontFlip:rl=!1}){this.viewBox=wt,this.scale=pt,this.rotation=Ct,this.offsetX=$t,this.offsetY=dl;const Yl=(wt[2]+wt[0])/2,Xl=(wt[3]+wt[1])/2;let pl,Ll,yl,Vl;switch(Ct%=360,Ct<0&&(Ct+=360),Ct){case 180:pl=-1,Ll=0,yl=0,Vl=1;break;case 90:pl=0,Ll=1,yl=1,Vl=0;break;case 270:pl=0,Ll=-1,yl=-1,Vl=0;break;case 0:pl=1,Ll=0,yl=0,Vl=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}rl&&(yl=-yl,Vl=-Vl);let _t,ot,ut,Tt;pl===0?(_t=Math.abs(Xl-wt[1])*pt+$t,ot=Math.abs(Yl-wt[0])*pt+dl,ut=(wt[3]-wt[1])*pt,Tt=(wt[2]-wt[0])*pt):(_t=Math.abs(Yl-wt[0])*pt+$t,ot=Math.abs(Xl-wt[1])*pt+dl,ut=(wt[2]-wt[0])*pt,Tt=(wt[3]-wt[1])*pt),this.transform=[pl*pt,Ll*pt,yl*pt,Vl*pt,_t-pl*pt*Yl-yl*pt*Xl,ot-Ll*pt*Yl-Vl*pt*Xl],this.width=ut,this.height=Tt}get rawDims(){const{viewBox:wt}=this;return(0,p.shadow)(this,"rawDims",{pageWidth:wt[2]-wt[0],pageHeight:wt[3]-wt[1],pageX:wt[0],pageY:wt[1]})}clone({scale:wt=this.scale,rotation:pt=this.rotation,offsetX:Ct=this.offsetX,offsetY:$t=this.offsetY,dontFlip:dl=!1}={}){return new f({viewBox:this.viewBox.slice(),scale:wt,rotation:pt,offsetX:Ct,offsetY:$t,dontFlip:dl})}convertToViewportPoint(wt,pt){return p.Util.applyTransform([wt,pt],this.transform)}convertToViewportRectangle(wt){const pt=p.Util.applyTransform([wt[0],wt[1]],this.transform),Ct=p.Util.applyTransform([wt[2],wt[3]],this.transform);return[pt[0],pt[1],Ct[0],Ct[1]]}convertToPdfPoint(wt,pt){return p.Util.applyInverseTransform([wt,pt],this.transform)}}r.PageViewport=f;class S extends p.BaseException{constructor(wt,pt=0){super(wt,"RenderingCancelledException"),this.extraDelay=pt}}r.RenderingCancelledException=S;function k(Ft){const wt=Ft.length;let pt=0;for(;pt<wt&&Ft[pt].trim()==="";)pt++;return Ft.substring(pt,pt+5).toLowerCase()==="data:"}function T(Ft){return typeof Ft=="string"&&/\.pdf$/i.test(Ft)}function g(Ft,wt=!1){return wt||([Ft]=Ft.split(/[#?]/,1)),Ft.substring(Ft.lastIndexOf("/")+1)}function F(Ft,wt="document.pdf"){if(typeof Ft!="string")return wt;if(k(Ft))return(0,p.warn)('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),wt;const pt=/^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/,Ct=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i,$t=pt.exec(Ft);let dl=Ct.exec($t[1])||Ct.exec($t[2])||Ct.exec($t[3]);if(dl&&(dl=dl[0],dl.includes("%")))try{dl=Ct.exec(decodeURIComponent(dl))[0]}catch{}return dl||wt}class J{constructor(){gl(this,"started",Object.create(null));gl(this,"times",[])}time(wt){wt in this.started&&(0,p.warn)(`Timer is already running for ${wt}`),this.started[wt]=Date.now()}timeEnd(wt){wt in this.started||(0,p.warn)(`Timer has not been started for ${wt}`),this.times.push({name:wt,start:this.started[wt],end:Date.now()}),delete this.started[wt]}toString(){const wt=[];let pt=0;for(const{name:Ct}of this.times)pt=Math.max(Ct.length,pt);for(const{name:Ct,start:$t,end:dl}of this.times)wt.push(`${Ct.padEnd(pt)} ${dl-$t}ms
|
|
1
|
+
var Ks=Object.defineProperty;var vs=(lt,r,h)=>r in lt?Ks(lt,r,{enumerable:!0,configurable:!0,writable:!0,value:h}):lt[r]=h;var gl=(lt,r,h)=>(vs(lt,typeof r!="symbol"?r+"":r,h),h),Xe=(lt,r,h)=>{if(!r.has(lt))throw TypeError("Cannot "+h)};var bt=(lt,r,h)=>(Xe(lt,r,"read from private field"),h?h.call(lt):r.get(lt)),ll=(lt,r,h)=>{if(r.has(lt))throw TypeError("Cannot add the same private member more than once");r instanceof WeakSet?r.add(lt):r.set(lt,h)},ul=(lt,r,h,M)=>(Xe(lt,r,"write to private field"),M?M.call(lt,h):r.set(lt,h),h);var Al=(lt,r,h,M)=>({set _(p){ul(lt,r,p,h)},get _(){return bt(lt,r,M)}}),nl=(lt,r,h)=>(Xe(lt,r,"access private method"),h);import{s as shallowRef,w as watchEffect,dC as toValue,o as onBeforeUnmount,e as defineComponent,r as ref,ax as toRef,h as computed,a as watch,R as openBlock,aA as createElementBlock,M as Fragment,aB as renderList,bl as renderSlot,aK as createBaseVNode,aD as createCommentVNode,bu as normalizeStyle,_ as _export_sfc,ag as mapGetters,N as mapState,O as mapActions,Q as resolveComponent,P as createBlock,ae as normalizeClass}from"./admin-drawer-panel-mtdde7vY.js";import{g as getAugmentedNamespace$1}from"./main-BnzL_Byv.js";import{u as useReaderStore}from"./reader-L85y7IXD.js";import"./index-DUjeNg4x.js";import"./pagination-toolbar-Covpd-k8.js";import"./VSelect-BKXcujPy.js";import"./VTextField-DI9HAmWh.js";import"./VDialog-yDKzaGEj.js";import"./VSelectionControl-DJAPiluk.js";import"./VCheckboxBtn-D3izCBa7.js";import"./VSlideGroup-C-kO93Va.js";import"./to-case-kUm8NPpW.js";import"./settings-drawer-CLMcxfVd.js";import"./unauthorized-ClQNhRb5.js";import"./change-password-dialog-C8YONrId.js";import"./VWindowItem-DpnYkF3y.js";import"./VExpansionPanels-Cpo8QLLq.js";import"./VRadioGroup-DEezv8bL.js";import"./VCheckbox-Aq_ImMNC.js";function commonjsRequire$1(lt){throw new Error('Could not dynamically require "'+lt+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var pdf$1={exports:{}};const __viteBrowserExternal$2={},__viteBrowserExternal$3=Object.freeze(Object.defineProperty({__proto__:null,default:__viteBrowserExternal$2},Symbol.toStringTag,{value:"Module"})),require$$5=getAugmentedNamespace$1(__viteBrowserExternal$3);(function(module,exports){(function(r,h){module.exports=r.pdfjsLib=h()})(globalThis,()=>(()=>{var __webpack_modules__=[,(lt,r)=>{var Vl;Object.defineProperty(r,"__esModule",{value:!0}),r.VerbosityLevel=r.Util=r.UnknownErrorException=r.UnexpectedResponseException=r.TextRenderingMode=r.RenderingIntentFlag=r.PromiseCapability=r.PermissionFlag=r.PasswordResponses=r.PasswordException=r.PageActionEventType=r.OPS=r.MissingPDFException=r.MAX_IMAGE_SIZE_TO_CACHE=r.LINE_FACTOR=r.LINE_DESCENT_FACTOR=r.InvalidPDFException=r.ImageKind=r.IDENTITY_MATRIX=r.FormatError=r.FeatureTest=r.FONT_IDENTITY_MATRIX=r.DocumentActionEventType=r.CMapCompressionType=r.BaseException=r.BASELINE_FACTOR=r.AnnotationType=r.AnnotationReplyType=r.AnnotationPrefix=r.AnnotationMode=r.AnnotationFlag=r.AnnotationFieldFlag=r.AnnotationEditorType=r.AnnotationEditorPrefix=r.AnnotationEditorParamsType=r.AnnotationBorderStyleType=r.AnnotationActionEventType=r.AbortException=void 0,r.assert=Ut,r.bytesToString=Mt,r.createValidAbsoluteUrl=Ht,r.getModificationDate=dl,r.getUuid=Ll,r.getVerbosityLevel=Xt,r.info=zt,r.isArrayBuffer=Ct,r.isArrayEqual=$t,r.isNodeJS=void 0,r.normalizeUnicode=pl,r.objectFromMap=Dt,r.objectSize=Jt,r.setVerbosityLevel=it,r.shadow=Pt,r.string32=gt,r.stringToBytes=Rt,r.stringToPDFString=Ft,r.stringToUTF8String=wt,r.unreachable=Nt,r.utf8StringToString=pt,r.warn=Gt;const h=typeof process=="object"&&process+""=="[object process]"&&!process.versions.nw&&!(process.versions.electron&&process.type&&process.type!=="browser");r.isNodeJS=h;const M=[1,0,0,1,0,0];r.IDENTITY_MATRIX=M;const p=[.001,0,0,.001,0,0];r.FONT_IDENTITY_MATRIX=p;const B=1e7;r.MAX_IMAGE_SIZE_TO_CACHE=B;const Q=1.35;r.LINE_FACTOR=Q;const U=.35;r.LINE_DESCENT_FACTOR=U;const O=U/Q;r.BASELINE_FACTOR=O;const I={ANY:1,DISPLAY:2,PRINT:4,SAVE:8,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,OPLIST:256};r.RenderingIntentFlag=I;const j={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3};r.AnnotationMode=j;const q="pdfjs_internal_editor_";r.AnnotationEditorPrefix=q;const K={DISABLE:-1,NONE:0,FREETEXT:3,STAMP:13,INK:15};r.AnnotationEditorType=K;const f={RESIZE:1,CREATE:2,FREETEXT_SIZE:11,FREETEXT_COLOR:12,FREETEXT_OPACITY:13,INK_COLOR:21,INK_THICKNESS:22,INK_OPACITY:23};r.AnnotationEditorParamsType=f;const S={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048};r.PermissionFlag=S;const k={FILL:0,STROKE:1,FILL_STROKE:2,INVISIBLE:3,FILL_ADD_TO_PATH:4,STROKE_ADD_TO_PATH:5,FILL_STROKE_ADD_TO_PATH:6,ADD_TO_PATH:7,FILL_STROKE_MASK:3,ADD_TO_PATH_FLAG:4};r.TextRenderingMode=k;const T={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3};r.ImageKind=T;const g={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};r.AnnotationType=g;const F={GROUP:"Group",REPLY:"R"};r.AnnotationReplyType=F;const J={INVISIBLE:1,HIDDEN:2,PRINT:4,NOZOOM:8,NOROTATE:16,NOVIEW:32,READONLY:64,LOCKED:128,TOGGLENOVIEW:256,LOCKEDCONTENTS:512};r.AnnotationFlag=J;const v={READONLY:1,REQUIRED:2,NOEXPORT:4,MULTILINE:4096,PASSWORD:8192,NOTOGGLETOOFF:16384,RADIO:32768,PUSHBUTTON:65536,COMBO:131072,EDIT:262144,SORT:524288,FILESELECT:1048576,MULTISELECT:2097152,DONOTSPELLCHECK:4194304,DONOTSCROLL:8388608,COMB:16777216,RICHTEXT:33554432,RADIOSINUNISON:33554432,COMMITONSELCHANGE:67108864};r.AnnotationFieldFlag=v;const u={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5};r.AnnotationBorderStyleType=u;const m={E:"Mouse Enter",X:"Mouse Exit",D:"Mouse Down",U:"Mouse Up",Fo:"Focus",Bl:"Blur",PO:"PageOpen",PC:"PageClose",PV:"PageVisible",PI:"PageInvisible",K:"Keystroke",F:"Format",V:"Validate",C:"Calculate"};r.AnnotationActionEventType=m;const _={WC:"WillClose",WS:"WillSave",DS:"DidSave",WP:"WillPrint",DP:"DidPrint"};r.DocumentActionEventType=_;const $={O:"PageOpen",C:"PageClose"};r.PageActionEventType=$;const P={ERRORS:0,WARNINGS:1,INFOS:5};r.VerbosityLevel=P;const Zt={NONE:0,BINARY:1};r.CMapCompressionType=Zt;const dt={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};r.OPS=dt;const It={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};r.PasswordResponses=It;let xt=P.WARNINGS;function it(_t){Number.isInteger(_t)&&(xt=_t)}function Xt(){return xt}function zt(_t){xt>=P.INFOS&&console.log(`Info: ${_t}`)}function Gt(_t){xt>=P.WARNINGS&&console.log(`Warning: ${_t}`)}function Nt(_t){throw new Error(_t)}function Ut(_t,ot){_t||Nt(ot)}function Vt(_t){switch(_t==null?void 0:_t.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}function Ht(_t,ot=null,ut=null){if(!_t)return null;try{if(ut&&typeof _t=="string"){if(ut.addDefaultProtocol&&_t.startsWith("www.")){const jt=_t.match(/\./g);(jt==null?void 0:jt.length)>=2&&(_t=`http://${_t}`)}if(ut.tryConvertEncoding)try{_t=wt(_t)}catch{}}const Tt=ot?new URL(_t,ot):new URL(_t);if(Vt(Tt))return Tt}catch{}return null}function Pt(_t,ot,ut,Tt=!1){return Object.defineProperty(_t,ot,{value:ut,enumerable:!Tt,configurable:!0,writable:!1}),ut}const at=function(){function ot(ut,Tt){this.constructor===ot&&Nt("Cannot initialize BaseException."),this.message=ut,this.name=Tt}return ot.prototype=new Error,ot.constructor=ot,ot}();r.BaseException=at;class R extends at{constructor(ot,ut){super(ot,"PasswordException"),this.code=ut}}r.PasswordException=R;class w extends at{constructor(ot,ut){super(ot,"UnknownErrorException"),this.details=ut}}r.UnknownErrorException=w;class X extends at{constructor(ot){super(ot,"InvalidPDFException")}}r.InvalidPDFException=X;class C extends at{constructor(ot){super(ot,"MissingPDFException")}}r.MissingPDFException=C;class H extends at{constructor(ot,ut){super(ot,"UnexpectedResponseException"),this.status=ut}}r.UnexpectedResponseException=H;class st extends at{constructor(ot){super(ot,"FormatError")}}r.FormatError=st;class et extends at{constructor(ot){super(ot,"AbortException")}}r.AbortException=et;function Mt(_t){(typeof _t!="object"||(_t==null?void 0:_t.length)===void 0)&&Nt("Invalid argument for bytesToString");const ot=_t.length,ut=8192;if(ot<ut)return String.fromCharCode.apply(null,_t);const Tt=[];for(let jt=0;jt<ot;jt+=ut){const Ot=Math.min(jt+ut,ot),Lt=_t.subarray(jt,Ot);Tt.push(String.fromCharCode.apply(null,Lt))}return Tt.join("")}function Rt(_t){typeof _t!="string"&&Nt("Invalid argument for stringToBytes");const ot=_t.length,ut=new Uint8Array(ot);for(let Tt=0;Tt<ot;++Tt)ut[Tt]=_t.charCodeAt(Tt)&255;return ut}function gt(_t){return String.fromCharCode(_t>>24&255,_t>>16&255,_t>>8&255,_t&255)}function Jt(_t){return Object.keys(_t).length}function Dt(_t){const ot=Object.create(null);for(const[ut,Tt]of _t)ot[ut]=Tt;return ot}function qt(){const _t=new Uint8Array(4);return _t[0]=1,new Uint32Array(_t.buffer,0,1)[0]===1}function vt(){try{return new Function(""),!0}catch{return!1}}class cl{static get isLittleEndian(){return Pt(this,"isLittleEndian",qt())}static get isEvalSupported(){return Pt(this,"isEvalSupported",vt())}static get isOffscreenCanvasSupported(){return Pt(this,"isOffscreenCanvasSupported",typeof OffscreenCanvas<"u")}static get platform(){return typeof navigator>"u"?Pt(this,"platform",{isWin:!1,isMac:!1}):Pt(this,"platform",{isWin:navigator.platform.includes("Win"),isMac:navigator.platform.includes("Mac")})}static get isCSSRoundSupported(){var ot,ut;return Pt(this,"isCSSRoundSupported",(ut=(ot=globalThis.CSS)==null?void 0:ot.supports)==null?void 0:ut.call(ot,"width: round(1.5px, 1px)"))}}r.FeatureTest=cl;const bl=[...Array(256).keys()].map(_t=>_t.toString(16).padStart(2,"0"));class il{static makeHexColor(ot,ut,Tt){return`#${bl[ot]}${bl[ut]}${bl[Tt]}`}static scaleMinMax(ot,ut){let Tt;ot[0]?(ot[0]<0&&(Tt=ut[0],ut[0]=ut[1],ut[1]=Tt),ut[0]*=ot[0],ut[1]*=ot[0],ot[3]<0&&(Tt=ut[2],ut[2]=ut[3],ut[3]=Tt),ut[2]*=ot[3],ut[3]*=ot[3]):(Tt=ut[0],ut[0]=ut[2],ut[2]=Tt,Tt=ut[1],ut[1]=ut[3],ut[3]=Tt,ot[1]<0&&(Tt=ut[2],ut[2]=ut[3],ut[3]=Tt),ut[2]*=ot[1],ut[3]*=ot[1],ot[2]<0&&(Tt=ut[0],ut[0]=ut[1],ut[1]=Tt),ut[0]*=ot[2],ut[1]*=ot[2]),ut[0]+=ot[4],ut[1]+=ot[4],ut[2]+=ot[5],ut[3]+=ot[5]}static transform(ot,ut){return[ot[0]*ut[0]+ot[2]*ut[1],ot[1]*ut[0]+ot[3]*ut[1],ot[0]*ut[2]+ot[2]*ut[3],ot[1]*ut[2]+ot[3]*ut[3],ot[0]*ut[4]+ot[2]*ut[5]+ot[4],ot[1]*ut[4]+ot[3]*ut[5]+ot[5]]}static applyTransform(ot,ut){const Tt=ot[0]*ut[0]+ot[1]*ut[2]+ut[4],jt=ot[0]*ut[1]+ot[1]*ut[3]+ut[5];return[Tt,jt]}static applyInverseTransform(ot,ut){const Tt=ut[0]*ut[3]-ut[1]*ut[2],jt=(ot[0]*ut[3]-ot[1]*ut[2]+ut[2]*ut[5]-ut[4]*ut[3])/Tt,Ot=(-ot[0]*ut[1]+ot[1]*ut[0]+ut[4]*ut[1]-ut[5]*ut[0])/Tt;return[jt,Ot]}static getAxialAlignedBoundingBox(ot,ut){const Tt=this.applyTransform(ot,ut),jt=this.applyTransform(ot.slice(2,4),ut),Ot=this.applyTransform([ot[0],ot[3]],ut),Lt=this.applyTransform([ot[2],ot[1]],ut);return[Math.min(Tt[0],jt[0],Ot[0],Lt[0]),Math.min(Tt[1],jt[1],Ot[1],Lt[1]),Math.max(Tt[0],jt[0],Ot[0],Lt[0]),Math.max(Tt[1],jt[1],Ot[1],Lt[1])]}static inverseTransform(ot){const ut=ot[0]*ot[3]-ot[1]*ot[2];return[ot[3]/ut,-ot[1]/ut,-ot[2]/ut,ot[0]/ut,(ot[2]*ot[5]-ot[4]*ot[3])/ut,(ot[4]*ot[1]-ot[5]*ot[0])/ut]}static singularValueDecompose2dScale(ot){const ut=[ot[0],ot[2],ot[1],ot[3]],Tt=ot[0]*ut[0]+ot[1]*ut[2],jt=ot[0]*ut[1]+ot[1]*ut[3],Ot=ot[2]*ut[0]+ot[3]*ut[2],Lt=ot[2]*ut[1]+ot[3]*ut[3],yt=(Tt+Lt)/2,Kt=Math.sqrt((Tt+Lt)**2-4*(Tt*Lt-Ot*jt))/2,tl=yt+Kt||1,el=yt-Kt||1;return[Math.sqrt(tl),Math.sqrt(el)]}static normalizeRect(ot){const ut=ot.slice(0);return ot[0]>ot[2]&&(ut[0]=ot[2],ut[2]=ot[0]),ot[1]>ot[3]&&(ut[1]=ot[3],ut[3]=ot[1]),ut}static intersect(ot,ut){const Tt=Math.max(Math.min(ot[0],ot[2]),Math.min(ut[0],ut[2])),jt=Math.min(Math.max(ot[0],ot[2]),Math.max(ut[0],ut[2]));if(Tt>jt)return null;const Ot=Math.max(Math.min(ot[1],ot[3]),Math.min(ut[1],ut[3])),Lt=Math.min(Math.max(ot[1],ot[3]),Math.max(ut[1],ut[3]));return Ot>Lt?null:[Tt,Ot,jt,Lt]}static bezierBoundingBox(ot,ut,Tt,jt,Ot,Lt,yt,Kt){const tl=[],el=[[],[]];let ol,Qt,Ml,hl,Il,Wl,nt,L;for(let kt=0;kt<2;++kt){if(kt===0?(Qt=6*ot-12*Tt+6*Ot,ol=-3*ot+9*Tt-9*Ot+3*yt,Ml=3*Tt-3*ot):(Qt=6*ut-12*jt+6*Lt,ol=-3*ut+9*jt-9*Lt+3*Kt,Ml=3*jt-3*ut),Math.abs(ol)<1e-12){if(Math.abs(Qt)<1e-12)continue;hl=-Ml/Qt,0<hl&&hl<1&&tl.push(hl);continue}nt=Qt*Qt-4*Ml*ol,L=Math.sqrt(nt),!(nt<0)&&(Il=(-Qt+L)/(2*ol),0<Il&&Il<1&&tl.push(Il),Wl=(-Qt-L)/(2*ol),0<Wl&&Wl<1&&tl.push(Wl))}let ct=tl.length,Wt;const Yt=ct;for(;ct--;)hl=tl[ct],Wt=1-hl,el[0][ct]=Wt*Wt*Wt*ot+3*Wt*Wt*hl*Tt+3*Wt*hl*hl*Ot+hl*hl*hl*yt,el[1][ct]=Wt*Wt*Wt*ut+3*Wt*Wt*hl*jt+3*Wt*hl*hl*Lt+hl*hl*hl*Kt;return el[0][Yt]=ot,el[1][Yt]=ut,el[0][Yt+1]=yt,el[1][Yt+1]=Kt,el[0].length=el[1].length=Yt+2,[Math.min(...el[0]),Math.min(...el[1]),Math.max(...el[0]),Math.max(...el[1])]}}r.Util=il;const Bt=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,728,711,710,729,733,731,730,732,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8226,8224,8225,8230,8212,8211,402,8260,8249,8250,8722,8240,8222,8220,8221,8216,8217,8218,8482,64257,64258,321,338,352,376,381,305,322,339,353,382,0,8364];function Ft(_t){if(_t[0]>="ï"){let ut;if(_t[0]==="þ"&&_t[1]==="ÿ"?ut="utf-16be":_t[0]==="ÿ"&&_t[1]==="þ"?ut="utf-16le":_t[0]==="ï"&&_t[1]==="»"&&_t[2]==="¿"&&(ut="utf-8"),ut)try{const Tt=new TextDecoder(ut,{fatal:!0}),jt=Rt(_t);return Tt.decode(jt)}catch(Tt){Gt(`stringToPDFString: "${Tt}".`)}}const ot=[];for(let ut=0,Tt=_t.length;ut<Tt;ut++){const jt=Bt[_t.charCodeAt(ut)];ot.push(jt?String.fromCharCode(jt):_t.charAt(ut))}return ot.join("")}function wt(_t){return decodeURIComponent(escape(_t))}function pt(_t){return unescape(encodeURIComponent(_t))}function Ct(_t){return typeof _t=="object"&&(_t==null?void 0:_t.byteLength)!==void 0}function $t(_t,ot){if(_t.length!==ot.length)return!1;for(let ut=0,Tt=_t.length;ut<Tt;ut++)if(_t[ut]!==ot[ut])return!1;return!0}function dl(_t=new Date){return[_t.getUTCFullYear().toString(),(_t.getUTCMonth()+1).toString().padStart(2,"0"),_t.getUTCDate().toString().padStart(2,"0"),_t.getUTCHours().toString().padStart(2,"0"),_t.getUTCMinutes().toString().padStart(2,"0"),_t.getUTCSeconds().toString().padStart(2,"0")].join("")}class rl{constructor(){ll(this,Vl,!1);this.promise=new Promise((ot,ut)=>{this.resolve=Tt=>{ul(this,Vl,!0),ot(Tt)},this.reject=Tt=>{ul(this,Vl,!0),ut(Tt)}})}get settled(){return bt(this,Vl)}}Vl=new WeakMap,r.PromiseCapability=rl;let Yl=null,Xl=null;function pl(_t){return Yl||(Yl=/([\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,Xl=new Map([["ſt","ſt"]])),_t.replaceAll(Yl,(ot,ut,Tt)=>ut?ut.normalize("NFKC"):Xl.get(Tt))}function Ll(){if(typeof crypto<"u"&&typeof(crypto==null?void 0:crypto.randomUUID)=="function")return crypto.randomUUID();const _t=new Uint8Array(32);if(typeof crypto<"u"&&typeof(crypto==null?void 0:crypto.getRandomValues)=="function")crypto.getRandomValues(_t);else for(let ot=0;ot<32;ot++)_t[ot]=Math.floor(Math.random()*255);return Mt(_t)}const yl="pdfjs_internal_id_";r.AnnotationPrefix=yl},(__unused_webpack_module,exports,__w_pdfjs_require__)=>{var lt,h,M,p,vl,Q,ce,O,I,j,q,K,f,S,k,T,de,F,J,Ye,u,m;Object.defineProperty(exports,"__esModule",{value:!0}),exports.RenderTask=exports.PDFWorkerUtil=exports.PDFWorker=exports.PDFPageProxy=exports.PDFDocumentProxy=exports.PDFDocumentLoadingTask=exports.PDFDataRangeTransport=exports.LoopbackPort=exports.DefaultStandardFontDataFactory=exports.DefaultFilterFactory=exports.DefaultCanvasFactory=exports.DefaultCMapReaderFactory=void 0,Object.defineProperty(exports,"SVGGraphics",{enumerable:!0,get:function(){return _displaySvg.SVGGraphics}}),exports.build=void 0,exports.getDocument=getDocument,exports.version=void 0;var _util=__w_pdfjs_require__(1),_annotation_storage=__w_pdfjs_require__(3),_display_utils=__w_pdfjs_require__(6),_font_loader=__w_pdfjs_require__(9),_displayNode_utils=__w_pdfjs_require__(10),_canvas=__w_pdfjs_require__(11),_worker_options=__w_pdfjs_require__(14),_message_handler=__w_pdfjs_require__(15),_metadata=__w_pdfjs_require__(16),_optional_content_config=__w_pdfjs_require__(17),_transport_stream=__w_pdfjs_require__(18),_displayFetch_stream=__w_pdfjs_require__(19),_displayNetwork=__w_pdfjs_require__(22),_displayNode_stream=__w_pdfjs_require__(23),_displaySvg=__w_pdfjs_require__(24),_xfa_text=__w_pdfjs_require__(25);const DEFAULT_RANGE_CHUNK_SIZE=65536,RENDERING_CANCELLED_TIMEOUT=100,DELAYED_CLEANUP_TIMEOUT=5e3,DefaultCanvasFactory=_util.isNodeJS?_displayNode_utils.NodeCanvasFactory:_display_utils.DOMCanvasFactory;exports.DefaultCanvasFactory=DefaultCanvasFactory;const DefaultCMapReaderFactory=_util.isNodeJS?_displayNode_utils.NodeCMapReaderFactory:_display_utils.DOMCMapReaderFactory;exports.DefaultCMapReaderFactory=DefaultCMapReaderFactory;const DefaultFilterFactory=_util.isNodeJS?_displayNode_utils.NodeFilterFactory:_display_utils.DOMFilterFactory;exports.DefaultFilterFactory=DefaultFilterFactory;const DefaultStandardFontDataFactory=_util.isNodeJS?_displayNode_utils.NodeStandardFontDataFactory:_display_utils.DOMStandardFontDataFactory;exports.DefaultStandardFontDataFactory=DefaultStandardFontDataFactory;function getDocument($){if(typeof $=="string"||$ instanceof URL?$={url:$}:(0,_util.isArrayBuffer)($)&&($={data:$}),typeof $!="object")throw new Error("Invalid parameter in getDocument, need parameter object.");if(!$.url&&!$.data&&!$.range)throw new Error("Invalid parameter object: need either .data, .range or .url");const P=new PDFDocumentLoadingTask,{docId:Zt}=P,dt=$.url?getUrlProp($.url):null,It=$.data?getDataProp($.data):null,xt=$.httpHeaders||null,it=$.withCredentials===!0,Xt=$.password??null,zt=$.range instanceof PDFDataRangeTransport?$.range:null,Gt=Number.isInteger($.rangeChunkSize)&&$.rangeChunkSize>0?$.rangeChunkSize:DEFAULT_RANGE_CHUNK_SIZE;let Nt=$.worker instanceof PDFWorker?$.worker:null;const Ut=$.verbosity,Vt=typeof $.docBaseUrl=="string"&&!(0,_display_utils.isDataScheme)($.docBaseUrl)?$.docBaseUrl:null,Ht=typeof $.cMapUrl=="string"?$.cMapUrl:null,Pt=$.cMapPacked!==!1,at=$.CMapReaderFactory||DefaultCMapReaderFactory,R=typeof $.standardFontDataUrl=="string"?$.standardFontDataUrl:null,w=$.StandardFontDataFactory||DefaultStandardFontDataFactory,X=$.stopAtErrors!==!0,C=Number.isInteger($.maxImageSize)&&$.maxImageSize>-1?$.maxImageSize:-1,H=$.isEvalSupported!==!1,st=typeof $.isOffscreenCanvasSupported=="boolean"?$.isOffscreenCanvasSupported:!_util.isNodeJS,et=Number.isInteger($.canvasMaxAreaInBytes)?$.canvasMaxAreaInBytes:-1,Mt=typeof $.disableFontFace=="boolean"?$.disableFontFace:_util.isNodeJS,Rt=$.fontExtraProperties===!0,gt=$.enableXfa===!0,Jt=$.ownerDocument||globalThis.document,Dt=$.disableRange===!0,qt=$.disableStream===!0,vt=$.disableAutoFetch===!0,cl=$.pdfBug===!0,bl=zt?zt.length:$.length??NaN,il=typeof $.useSystemFonts=="boolean"?$.useSystemFonts:!_util.isNodeJS&&!Mt,Bt=typeof $.useWorkerFetch=="boolean"?$.useWorkerFetch:at===_display_utils.DOMCMapReaderFactory&&w===_display_utils.DOMStandardFontDataFactory&&Ht&&R&&(0,_display_utils.isValidFetchUrl)(Ht,document.baseURI)&&(0,_display_utils.isValidFetchUrl)(R,document.baseURI),Ft=$.canvasFactory||new DefaultCanvasFactory({ownerDocument:Jt}),wt=$.filterFactory||new DefaultFilterFactory({docId:Zt,ownerDocument:Jt}),pt=null;(0,_util.setVerbosityLevel)(Ut);const Ct={canvasFactory:Ft,filterFactory:wt};if(Bt||(Ct.cMapReaderFactory=new at({baseUrl:Ht,isCompressed:Pt}),Ct.standardFontDataFactory=new w({baseUrl:R})),!Nt){const rl={verbosity:Ut,port:_worker_options.GlobalWorkerOptions.workerPort};Nt=rl.port?PDFWorker.fromPort(rl):new PDFWorker(rl),P._worker=Nt}const $t={docId:Zt,apiVersion:"3.11.174",data:It,password:Xt,disableAutoFetch:vt,rangeChunkSize:Gt,length:bl,docBaseUrl:Vt,enableXfa:gt,evaluatorOptions:{maxImageSize:C,disableFontFace:Mt,ignoreErrors:X,isEvalSupported:H,isOffscreenCanvasSupported:st,canvasMaxAreaInBytes:et,fontExtraProperties:Rt,useSystemFonts:il,cMapUrl:Bt?Ht:null,standardFontDataUrl:Bt?R:null}},dl={ignoreErrors:X,isEvalSupported:H,disableFontFace:Mt,fontExtraProperties:Rt,enableXfa:gt,ownerDocument:Jt,disableAutoFetch:vt,pdfBug:cl,styleElement:pt};return Nt.promise.then(function(){if(P.destroyed)throw new Error("Loading aborted");const rl=_fetchDocument(Nt,$t),Yl=new Promise(function(Xl){let pl;zt?pl=new _transport_stream.PDFDataTransportStream({length:bl,initialData:zt.initialData,progressiveDone:zt.progressiveDone,contentDispositionFilename:zt.contentDispositionFilename,disableRange:Dt,disableStream:qt},zt):It||(pl=(yl=>_util.isNodeJS?new _displayNode_stream.PDFNodeStream(yl):(0,_display_utils.isValidFetchUrl)(yl.url)?new _displayFetch_stream.PDFFetchStream(yl):new _displayNetwork.PDFNetworkStream(yl))({url:dt,length:bl,httpHeaders:xt,withCredentials:it,rangeChunkSize:Gt,disableRange:Dt,disableStream:qt})),Xl(pl)});return Promise.all([rl,Yl]).then(function([Xl,pl]){if(P.destroyed)throw new Error("Loading aborted");const Ll=new _message_handler.MessageHandler(Zt,Xl,Nt.port),yl=new WorkerTransport(Ll,P,pl,dl,Ct);P._transport=yl,Ll.send("Ready",null)})}).catch(P._capability.reject),P}async function _fetchDocument($,P){if($.destroyed)throw new Error("Worker was destroyed");const Zt=await $.messageHandler.sendWithPromise("GetDocRequest",P,P.data?[P.data.buffer]:null);if($.destroyed)throw new Error("Worker was destroyed");return Zt}function getUrlProp($){if($ instanceof URL)return $.href;try{return new URL($,window.location).href}catch{if(_util.isNodeJS&&typeof $=="string")return $}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}function getDataProp($){if(_util.isNodeJS&&typeof Buffer<"u"&&$ instanceof Buffer)throw new Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");if($ instanceof Uint8Array&&$.byteLength===$.buffer.byteLength)return $;if(typeof $=="string")return(0,_util.stringToBytes)($);if(typeof $=="object"&&!isNaN($==null?void 0:$.length)||(0,_util.isArrayBuffer)($))return new Uint8Array($);throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")}const r=class r{constructor(){this._capability=new _util.PromiseCapability,this._transport=null,this._worker=null,this.docId=`d${Al(r,lt)._++}`,this.destroyed=!1,this.onPassword=null,this.onProgress=null}get promise(){return this._capability.promise}async destroy(){var P,Zt,dt;this.destroyed=!0;try{(P=this._worker)!=null&&P.port&&(this._worker._pendingDestroy=!0),await((Zt=this._transport)==null?void 0:Zt.destroy())}catch(It){throw(dt=this._worker)!=null&&dt.port&&delete this._worker._pendingDestroy,It}this._transport=null,this._worker&&(this._worker.destroy(),this._worker=null)}};lt=new WeakMap,ll(r,lt,0);let PDFDocumentLoadingTask=r;exports.PDFDocumentLoadingTask=PDFDocumentLoadingTask;class PDFDataRangeTransport{constructor(P,Zt,dt=!1,It=null){this.length=P,this.initialData=Zt,this.progressiveDone=dt,this.contentDispositionFilename=It,this._rangeListeners=[],this._progressListeners=[],this._progressiveReadListeners=[],this._progressiveDoneListeners=[],this._readyCapability=new _util.PromiseCapability}addRangeListener(P){this._rangeListeners.push(P)}addProgressListener(P){this._progressListeners.push(P)}addProgressiveReadListener(P){this._progressiveReadListeners.push(P)}addProgressiveDoneListener(P){this._progressiveDoneListeners.push(P)}onDataRange(P,Zt){for(const dt of this._rangeListeners)dt(P,Zt)}onDataProgress(P,Zt){this._readyCapability.promise.then(()=>{for(const dt of this._progressListeners)dt(P,Zt)})}onDataProgressiveRead(P){this._readyCapability.promise.then(()=>{for(const Zt of this._progressiveReadListeners)Zt(P)})}onDataProgressiveDone(){this._readyCapability.promise.then(()=>{for(const P of this._progressiveDoneListeners)P()})}transportReady(){this._readyCapability.resolve()}requestDataRange(P,Zt){(0,_util.unreachable)("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}}exports.PDFDataRangeTransport=PDFDataRangeTransport;class PDFDocumentProxy{constructor(P,Zt){this._pdfInfo=P,this._transport=Zt,Object.defineProperty(this,"getJavaScript",{value:()=>((0,_display_utils.deprecated)("`PDFDocumentProxy.getJavaScript`, please use `PDFDocumentProxy.getJSActions` instead."),this.getJSActions().then(dt=>{if(!dt)return dt;const It=[];for(const xt in dt)It.push(...dt[xt]);return It}))})}get annotationStorage(){return this._transport.annotationStorage}get filterFactory(){return this._transport.filterFactory}get numPages(){return this._pdfInfo.numPages}get fingerprints(){return this._pdfInfo.fingerprints}get isPureXfa(){return(0,_util.shadow)(this,"isPureXfa",!!this._transport._htmlForXfa)}get allXfaHtml(){return this._transport._htmlForXfa}getPage(P){return this._transport.getPage(P)}getPageIndex(P){return this._transport.getPageIndex(P)}getDestinations(){return this._transport.getDestinations()}getDestination(P){return this._transport.getDestination(P)}getPageLabels(){return this._transport.getPageLabels()}getPageLayout(){return this._transport.getPageLayout()}getPageMode(){return this._transport.getPageMode()}getViewerPreferences(){return this._transport.getViewerPreferences()}getOpenAction(){return this._transport.getOpenAction()}getAttachments(){return this._transport.getAttachments()}getJSActions(){return this._transport.getDocJSActions()}getOutline(){return this._transport.getOutline()}getOptionalContentConfig(){return this._transport.getOptionalContentConfig()}getPermissions(){return this._transport.getPermissions()}getMetadata(){return this._transport.getMetadata()}getMarkInfo(){return this._transport.getMarkInfo()}getData(){return this._transport.getData()}saveDocument(){return this._transport.saveDocument()}getDownloadInfo(){return this._transport.downloadInfoCapability.promise}cleanup(P=!1){return this._transport.startCleanup(P||this.isPureXfa)}destroy(){return this.loadingTask.destroy()}get loadingParams(){return this._transport.loadingParams}get loadingTask(){return this._transport.loadingTask}getFieldObjects(){return this._transport.getFieldObjects()}hasJSActions(){return this._transport.hasJSActions()}getCalculationOrderIds(){return this._transport.getCalculationOrderIds()}}exports.PDFDocumentProxy=PDFDocumentProxy;class PDFPageProxy{constructor(P,Zt,dt,It=!1){ll(this,p);ll(this,Q);ll(this,h,null);ll(this,M,!1);this._pageIndex=P,this._pageInfo=Zt,this._transport=dt,this._stats=It?new _display_utils.StatTimer:null,this._pdfBug=It,this.commonObjs=dt.commonObjs,this.objs=new PDFObjects,this._maybeCleanupAfterRender=!1,this._intentStates=new Map,this.destroyed=!1}get pageNumber(){return this._pageIndex+1}get rotate(){return this._pageInfo.rotate}get ref(){return this._pageInfo.ref}get userUnit(){return this._pageInfo.userUnit}get view(){return this._pageInfo.view}getViewport({scale:P,rotation:Zt=this.rotate,offsetX:dt=0,offsetY:It=0,dontFlip:xt=!1}={}){return new _display_utils.PageViewport({viewBox:this.view,scale:P,rotation:Zt,offsetX:dt,offsetY:It,dontFlip:xt})}getAnnotations({intent:P="display"}={}){const Zt=this._transport.getRenderingIntent(P);return this._transport.getAnnotations(this._pageIndex,Zt.renderingIntent)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get filterFactory(){return this._transport.filterFactory}get isPureXfa(){return(0,_util.shadow)(this,"isPureXfa",!!this._transport._htmlForXfa)}async getXfa(){var P;return((P=this._transport._htmlForXfa)==null?void 0:P.children[this._pageIndex])||null}render({canvasContext:P,viewport:Zt,intent:dt="display",annotationMode:It=_util.AnnotationMode.ENABLE,transform:xt=null,background:it=null,optionalContentConfigPromise:Xt=null,annotationCanvasMap:zt=null,pageColors:Gt=null,printAnnotationStorage:Nt=null}){var w,X;(w=this._stats)==null||w.time("Overall");const Ut=this._transport.getRenderingIntent(dt,It,Nt);ul(this,M,!1),nl(this,Q,ce).call(this),Xt||(Xt=this._transport.getOptionalContentConfig());let Vt=this._intentStates.get(Ut.cacheKey);Vt||(Vt=Object.create(null),this._intentStates.set(Ut.cacheKey,Vt)),Vt.streamReaderCancelTimeout&&(clearTimeout(Vt.streamReaderCancelTimeout),Vt.streamReaderCancelTimeout=null);const Ht=!!(Ut.renderingIntent&_util.RenderingIntentFlag.PRINT);Vt.displayReadyCapability||(Vt.displayReadyCapability=new _util.PromiseCapability,Vt.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},(X=this._stats)==null||X.time("Page Request"),this._pumpOperatorList(Ut));const Pt=C=>{var H,st;Vt.renderTasks.delete(at),(this._maybeCleanupAfterRender||Ht)&&ul(this,M,!0),nl(this,p,vl).call(this,!Ht),C?(at.capability.reject(C),this._abortOperatorList({intentState:Vt,reason:C instanceof Error?C:new Error(C)})):at.capability.resolve(),(H=this._stats)==null||H.timeEnd("Rendering"),(st=this._stats)==null||st.timeEnd("Overall")},at=new InternalRenderTask({callback:Pt,params:{canvasContext:P,viewport:Zt,transform:xt,background:it},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:zt,operatorList:Vt.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!Ht,pdfBug:this._pdfBug,pageColors:Gt});(Vt.renderTasks||(Vt.renderTasks=new Set)).add(at);const R=at.task;return Promise.all([Vt.displayReadyCapability.promise,Xt]).then(([C,H])=>{var st;if(this.destroyed){Pt();return}(st=this._stats)==null||st.time("Rendering"),at.initializeGraphics({transparency:C,optionalContentConfig:H}),at.operatorListChanged()}).catch(Pt),R}getOperatorList({intent:P="display",annotationMode:Zt=_util.AnnotationMode.ENABLE,printAnnotationStorage:dt=null}={}){var zt;function It(){it.operatorList.lastChunk&&(it.opListReadCapability.resolve(it.operatorList),it.renderTasks.delete(Xt))}const xt=this._transport.getRenderingIntent(P,Zt,dt,!0);let it=this._intentStates.get(xt.cacheKey);it||(it=Object.create(null),this._intentStates.set(xt.cacheKey,it));let Xt;return it.opListReadCapability||(Xt=Object.create(null),Xt.operatorListChanged=It,it.opListReadCapability=new _util.PromiseCapability,(it.renderTasks||(it.renderTasks=new Set)).add(Xt),it.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},(zt=this._stats)==null||zt.time("Page Request"),this._pumpOperatorList(xt)),it.opListReadCapability.promise}streamTextContent({includeMarkedContent:P=!1,disableNormalization:Zt=!1}={}){return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,includeMarkedContent:P===!0,disableNormalization:Zt===!0},{highWaterMark:100,size(It){return It.items.length}})}getTextContent(P={}){if(this._transport._htmlForXfa)return this.getXfa().then(dt=>_xfa_text.XfaText.textContent(dt));const Zt=this.streamTextContent(P);return new Promise(function(dt,It){function xt(){it.read().then(function({value:zt,done:Gt}){if(Gt){dt(Xt);return}Object.assign(Xt.styles,zt.styles),Xt.items.push(...zt.items),xt()},It)}const it=Zt.getReader(),Xt={items:[],styles:Object.create(null)};xt()})}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;const P=[];for(const Zt of this._intentStates.values())if(this._abortOperatorList({intentState:Zt,reason:new Error("Page was destroyed."),force:!0}),!Zt.opListReadCapability)for(const dt of Zt.renderTasks)P.push(dt.completed),dt.cancel();return this.objs.clear(),ul(this,M,!1),nl(this,Q,ce).call(this),Promise.all(P)}cleanup(P=!1){ul(this,M,!0);const Zt=nl(this,p,vl).call(this,!1);return P&&Zt&&this._stats&&(this._stats=new _display_utils.StatTimer),Zt}_startRenderPage(P,Zt){var It,xt;const dt=this._intentStates.get(Zt);dt&&((It=this._stats)==null||It.timeEnd("Page Request"),(xt=dt.displayReadyCapability)==null||xt.resolve(P))}_renderPageChunk(P,Zt){for(let dt=0,It=P.length;dt<It;dt++)Zt.operatorList.fnArray.push(P.fnArray[dt]),Zt.operatorList.argsArray.push(P.argsArray[dt]);Zt.operatorList.lastChunk=P.lastChunk,Zt.operatorList.separateAnnots=P.separateAnnots;for(const dt of Zt.renderTasks)dt.operatorListChanged();P.lastChunk&&nl(this,p,vl).call(this,!0)}_pumpOperatorList({renderingIntent:P,cacheKey:Zt,annotationStorageSerializable:dt}){const{map:It,transfers:xt}=dt,Xt=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:P,cacheKey:Zt,annotationStorage:It},xt).getReader(),zt=this._intentStates.get(Zt);zt.streamReader=Xt;const Gt=()=>{Xt.read().then(({value:Nt,done:Ut})=>{if(Ut){zt.streamReader=null;return}this._transport.destroyed||(this._renderPageChunk(Nt,zt),Gt())},Nt=>{if(zt.streamReader=null,!this._transport.destroyed){if(zt.operatorList){zt.operatorList.lastChunk=!0;for(const Ut of zt.renderTasks)Ut.operatorListChanged();nl(this,p,vl).call(this,!0)}if(zt.displayReadyCapability)zt.displayReadyCapability.reject(Nt);else if(zt.opListReadCapability)zt.opListReadCapability.reject(Nt);else throw Nt}})};Gt()}_abortOperatorList({intentState:P,reason:Zt,force:dt=!1}){if(P.streamReader){if(P.streamReaderCancelTimeout&&(clearTimeout(P.streamReaderCancelTimeout),P.streamReaderCancelTimeout=null),!dt){if(P.renderTasks.size>0)return;if(Zt instanceof _display_utils.RenderingCancelledException){let It=RENDERING_CANCELLED_TIMEOUT;Zt.extraDelay>0&&Zt.extraDelay<1e3&&(It+=Zt.extraDelay),P.streamReaderCancelTimeout=setTimeout(()=>{P.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:P,reason:Zt,force:!0})},It);return}}if(P.streamReader.cancel(new _util.AbortException(Zt.message)).catch(()=>{}),P.streamReader=null,!this._transport.destroyed){for(const[It,xt]of this._intentStates)if(xt===P){this._intentStates.delete(It);break}this.cleanup()}}}get stats(){return this._stats}}h=new WeakMap,M=new WeakMap,p=new WeakSet,vl=function(P=!1){if(nl(this,Q,ce).call(this),!bt(this,M)||this.destroyed)return!1;if(P)return ul(this,h,setTimeout(()=>{ul(this,h,null),nl(this,p,vl).call(this,!1)},DELAYED_CLEANUP_TIMEOUT)),!1;for(const{renderTasks:Zt,operatorList:dt}of this._intentStates.values())if(Zt.size>0||!dt.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),ul(this,M,!1),!0},Q=new WeakSet,ce=function(){bt(this,h)&&(clearTimeout(bt(this,h)),ul(this,h,null))},exports.PDFPageProxy=PDFPageProxy;class LoopbackPort{constructor(){ll(this,O,new Set);ll(this,I,Promise.resolve())}postMessage(P,Zt){const dt={data:structuredClone(P,Zt?{transfer:Zt}:null)};bt(this,I).then(()=>{for(const It of bt(this,O))It.call(this,dt)})}addEventListener(P,Zt){bt(this,O).add(Zt)}removeEventListener(P,Zt){bt(this,O).delete(Zt)}terminate(){bt(this,O).clear()}}O=new WeakMap,I=new WeakMap,exports.LoopbackPort=LoopbackPort;const PDFWorkerUtil={isWorkerDisabled:!1,fallbackWorkerSrc:null,fakeWorkerId:0};exports.PDFWorkerUtil=PDFWorkerUtil;{if(_util.isNodeJS&&typeof commonjsRequire$1=="function")PDFWorkerUtil.isWorkerDisabled=!0,PDFWorkerUtil.fallbackWorkerSrc="./pdf.worker.js";else if(typeof document=="object"){const $=(j=document==null?void 0:document.currentScript)==null?void 0:j.src;$&&(PDFWorkerUtil.fallbackWorkerSrc=$.replace(/(\.(?:min\.)?js)(\?.*)?$/i,".worker$1$2"))}PDFWorkerUtil.isSameOrigin=function($,P){let Zt;try{if(Zt=new URL($),!Zt.origin||Zt.origin==="null")return!1}catch{return!1}const dt=new URL(P,Zt);return Zt.origin===dt.origin},PDFWorkerUtil.createCDNWrapper=function($){const P=`importScripts("${$}");`;return URL.createObjectURL(new Blob([P]))}}const _PDFWorker=class _PDFWorker{constructor({name:$=null,port:P=null,verbosity:Zt=(0,_util.getVerbosityLevel)()}={}){var dt;if(this.name=$,this.destroyed=!1,this.verbosity=Zt,this._readyCapability=new _util.PromiseCapability,this._port=null,this._webWorker=null,this._messageHandler=null,P){if((dt=bt(_PDFWorker,q))!=null&&dt.has(P))throw new Error("Cannot use more than one PDFWorker per port.");(bt(_PDFWorker,q)||ul(_PDFWorker,q,new WeakMap)).set(P,this),this._initializeFromPort(P);return}this._initialize()}get promise(){return this._readyCapability.promise}get port(){return this._port}get messageHandler(){return this._messageHandler}_initializeFromPort($){this._port=$,this._messageHandler=new _message_handler.MessageHandler("main","worker",$),this._messageHandler.on("ready",function(){}),this._readyCapability.resolve(),this._messageHandler.send("configure",{verbosity:this.verbosity})}_initialize(){if(!PDFWorkerUtil.isWorkerDisabled&&!_PDFWorker._mainThreadWorkerMessageHandler){let{workerSrc:$}=_PDFWorker;try{PDFWorkerUtil.isSameOrigin(window.location.href,$)||($=PDFWorkerUtil.createCDNWrapper(new URL($,window.location).href));const P=new Worker($),Zt=new _message_handler.MessageHandler("main","worker",P),dt=()=>{P.removeEventListener("error",It),Zt.destroy(),P.terminate(),this.destroyed?this._readyCapability.reject(new Error("Worker was destroyed")):this._setupFakeWorker()},It=()=>{this._webWorker||dt()};P.addEventListener("error",It),Zt.on("test",it=>{if(P.removeEventListener("error",It),this.destroyed){dt();return}it?(this._messageHandler=Zt,this._port=P,this._webWorker=P,this._readyCapability.resolve(),Zt.send("configure",{verbosity:this.verbosity})):(this._setupFakeWorker(),Zt.destroy(),P.terminate())}),Zt.on("ready",it=>{if(P.removeEventListener("error",It),this.destroyed){dt();return}try{xt()}catch{this._setupFakeWorker()}});const xt=()=>{const it=new Uint8Array;Zt.send("test",it,[it.buffer])};xt();return}catch{(0,_util.info)("The worker has been disabled.")}}this._setupFakeWorker()}_setupFakeWorker(){PDFWorkerUtil.isWorkerDisabled||((0,_util.warn)("Setting up fake worker."),PDFWorkerUtil.isWorkerDisabled=!0),_PDFWorker._setupFakeWorkerGlobal.then($=>{if(this.destroyed){this._readyCapability.reject(new Error("Worker was destroyed"));return}const P=new LoopbackPort;this._port=P;const Zt=`fake${PDFWorkerUtil.fakeWorkerId++}`,dt=new _message_handler.MessageHandler(Zt+"_worker",Zt,P);$.setup(dt,P);const It=new _message_handler.MessageHandler(Zt,Zt+"_worker",P);this._messageHandler=It,this._readyCapability.resolve(),It.send("configure",{verbosity:this.verbosity})}).catch($=>{this._readyCapability.reject(new Error(`Setting up fake worker failed: "${$.message}".`))})}destroy(){var $;this.destroyed=!0,this._webWorker&&(this._webWorker.terminate(),this._webWorker=null),($=bt(_PDFWorker,q))==null||$.delete(this._port),this._port=null,this._messageHandler&&(this._messageHandler.destroy(),this._messageHandler=null)}static fromPort($){var Zt;if(!($!=null&&$.port))throw new Error("PDFWorker.fromPort - invalid method signature.");const P=(Zt=bt(this,q))==null?void 0:Zt.get($.port);if(P){if(P._pendingDestroy)throw new Error("PDFWorker.fromPort - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");return P}return new _PDFWorker($)}static get workerSrc(){if(_worker_options.GlobalWorkerOptions.workerSrc)return _worker_options.GlobalWorkerOptions.workerSrc;if(PDFWorkerUtil.fallbackWorkerSrc!==null)return _util.isNodeJS||(0,_display_utils.deprecated)('No "GlobalWorkerOptions.workerSrc" specified.'),PDFWorkerUtil.fallbackWorkerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get _mainThreadWorkerMessageHandler(){var $;try{return(($=globalThis.pdfjsWorker)==null?void 0:$.WorkerMessageHandler)||null}catch{return null}}static get _setupFakeWorkerGlobal(){const loader=async()=>{const mainWorkerMessageHandler=this._mainThreadWorkerMessageHandler;if(mainWorkerMessageHandler)return mainWorkerMessageHandler;if(_util.isNodeJS&&typeof commonjsRequire$1=="function"){const worker=eval("require")(this.workerSrc);return worker.WorkerMessageHandler}return await(0,_display_utils.loadScript)(this.workerSrc),window.pdfjsWorker.WorkerMessageHandler};return(0,_util.shadow)(this,"_setupFakeWorkerGlobal",loader())}};q=new WeakMap,ll(_PDFWorker,q,void 0);let PDFWorker=_PDFWorker;exports.PDFWorker=PDFWorker;class WorkerTransport{constructor(P,Zt,dt,It,xt){ll(this,T);ll(this,K,new Map);ll(this,f,new Map);ll(this,S,new Map);ll(this,k,null);this.messageHandler=P,this.loadingTask=Zt,this.commonObjs=new PDFObjects,this.fontLoader=new _font_loader.FontLoader({ownerDocument:It.ownerDocument,styleElement:It.styleElement}),this._params=It,this.canvasFactory=xt.canvasFactory,this.filterFactory=xt.filterFactory,this.cMapReaderFactory=xt.cMapReaderFactory,this.standardFontDataFactory=xt.standardFontDataFactory,this.destroyed=!1,this.destroyCapability=null,this._networkStream=dt,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=new _util.PromiseCapability,this.setupMessageHandler()}get annotationStorage(){return(0,_util.shadow)(this,"annotationStorage",new _annotation_storage.AnnotationStorage)}getRenderingIntent(P,Zt=_util.AnnotationMode.ENABLE,dt=null,It=!1){let xt=_util.RenderingIntentFlag.DISPLAY,it=_annotation_storage.SerializableEmpty;switch(P){case"any":xt=_util.RenderingIntentFlag.ANY;break;case"display":break;case"print":xt=_util.RenderingIntentFlag.PRINT;break;default:(0,_util.warn)(`getRenderingIntent - invalid intent: ${P}`)}switch(Zt){case _util.AnnotationMode.DISABLE:xt+=_util.RenderingIntentFlag.ANNOTATIONS_DISABLE;break;case _util.AnnotationMode.ENABLE:break;case _util.AnnotationMode.ENABLE_FORMS:xt+=_util.RenderingIntentFlag.ANNOTATIONS_FORMS;break;case _util.AnnotationMode.ENABLE_STORAGE:xt+=_util.RenderingIntentFlag.ANNOTATIONS_STORAGE,it=(xt&_util.RenderingIntentFlag.PRINT&&dt instanceof _annotation_storage.PrintAnnotationStorage?dt:this.annotationStorage).serializable;break;default:(0,_util.warn)(`getRenderingIntent - invalid annotationMode: ${Zt}`)}return It&&(xt+=_util.RenderingIntentFlag.OPLIST),{renderingIntent:xt,cacheKey:`${xt}_${it.hash}`,annotationStorageSerializable:it}}destroy(){var dt;if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=new _util.PromiseCapability,(dt=bt(this,k))==null||dt.reject(new Error("Worker was destroyed during onPassword callback"));const P=[];for(const It of bt(this,f).values())P.push(It._destroy());bt(this,f).clear(),bt(this,S).clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();const Zt=this.messageHandler.sendWithPromise("Terminate",null);return P.push(Zt),Promise.all(P).then(()=>{var It;this.commonObjs.clear(),this.fontLoader.clear(),bt(this,K).clear(),this.filterFactory.destroy(),(It=this._networkStream)==null||It.cancelAllRequests(new _util.AbortException("Worker was terminated.")),this.messageHandler&&(this.messageHandler.destroy(),this.messageHandler=null),this.destroyCapability.resolve()},this.destroyCapability.reject),this.destroyCapability.promise}setupMessageHandler(){const{messageHandler:P,loadingTask:Zt}=this;P.on("GetReader",(dt,It)=>{(0,_util.assert)(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=xt=>{this._lastProgress={loaded:xt.loaded,total:xt.total}},It.onPull=()=>{this._fullReader.read().then(function({value:xt,done:it}){if(it){It.close();return}(0,_util.assert)(xt instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),It.enqueue(new Uint8Array(xt),1,[xt])}).catch(xt=>{It.error(xt)})},It.onCancel=xt=>{this._fullReader.cancel(xt),It.ready.catch(it=>{if(!this.destroyed)throw it})}}),P.on("ReaderHeadersReady",dt=>{const It=new _util.PromiseCapability,xt=this._fullReader;return xt.headersReady.then(()=>{var it;(!xt.isStreamingSupported||!xt.isRangeSupported)&&(this._lastProgress&&((it=Zt.onProgress)==null||it.call(Zt,this._lastProgress)),xt.onProgress=Xt=>{var zt;(zt=Zt.onProgress)==null||zt.call(Zt,{loaded:Xt.loaded,total:Xt.total})}),It.resolve({isStreamingSupported:xt.isStreamingSupported,isRangeSupported:xt.isRangeSupported,contentLength:xt.contentLength})},It.reject),It.promise}),P.on("GetRangeReader",(dt,It)=>{(0,_util.assert)(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const xt=this._networkStream.getRangeReader(dt.begin,dt.end);if(!xt){It.close();return}It.onPull=()=>{xt.read().then(function({value:it,done:Xt}){if(Xt){It.close();return}(0,_util.assert)(it instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),It.enqueue(new Uint8Array(it),1,[it])}).catch(it=>{It.error(it)})},It.onCancel=it=>{xt.cancel(it),It.ready.catch(Xt=>{if(!this.destroyed)throw Xt})}}),P.on("GetDoc",({pdfInfo:dt})=>{this._numPages=dt.numPages,this._htmlForXfa=dt.htmlForXfa,delete dt.htmlForXfa,Zt._capability.resolve(new PDFDocumentProxy(dt,this))}),P.on("DocException",function(dt){let It;switch(dt.name){case"PasswordException":It=new _util.PasswordException(dt.message,dt.code);break;case"InvalidPDFException":It=new _util.InvalidPDFException(dt.message);break;case"MissingPDFException":It=new _util.MissingPDFException(dt.message);break;case"UnexpectedResponseException":It=new _util.UnexpectedResponseException(dt.message,dt.status);break;case"UnknownErrorException":It=new _util.UnknownErrorException(dt.message,dt.details);break;default:(0,_util.unreachable)("DocException - expected a valid Error.")}Zt._capability.reject(It)}),P.on("PasswordRequest",dt=>{if(ul(this,k,new _util.PromiseCapability),Zt.onPassword){const It=xt=>{xt instanceof Error?bt(this,k).reject(xt):bt(this,k).resolve({password:xt})};try{Zt.onPassword(It,dt.code)}catch(xt){bt(this,k).reject(xt)}}else bt(this,k).reject(new _util.PasswordException(dt.message,dt.code));return bt(this,k).promise}),P.on("DataLoaded",dt=>{var It;(It=Zt.onProgress)==null||It.call(Zt,{loaded:dt.length,total:dt.length}),this.downloadInfoCapability.resolve(dt)}),P.on("StartRenderPage",dt=>{if(this.destroyed)return;bt(this,f).get(dt.pageIndex)._startRenderPage(dt.transparency,dt.cacheKey)}),P.on("commonobj",([dt,It,xt])=>{var it;if(!this.destroyed&&!this.commonObjs.has(dt))switch(It){case"Font":const Xt=this._params;if("error"in xt){const Nt=xt.error;(0,_util.warn)(`Error during font loading: ${Nt}`),this.commonObjs.resolve(dt,Nt);break}const zt=Xt.pdfBug&&((it=globalThis.FontInspector)!=null&&it.enabled)?(Nt,Ut)=>globalThis.FontInspector.fontAdded(Nt,Ut):null,Gt=new _font_loader.FontFaceObject(xt,{isEvalSupported:Xt.isEvalSupported,disableFontFace:Xt.disableFontFace,ignoreErrors:Xt.ignoreErrors,inspectFont:zt});this.fontLoader.bind(Gt).catch(Nt=>P.sendWithPromise("FontFallback",{id:dt})).finally(()=>{!Xt.fontExtraProperties&&Gt.data&&(Gt.data=null),this.commonObjs.resolve(dt,Gt)});break;case"FontPath":case"Image":case"Pattern":this.commonObjs.resolve(dt,xt);break;default:throw new Error(`Got unknown common object type ${It}`)}}),P.on("obj",([dt,It,xt,it])=>{var zt;if(this.destroyed)return;const Xt=bt(this,f).get(It);if(!Xt.objs.has(dt))switch(xt){case"Image":if(Xt.objs.resolve(dt,it),it){let Gt;if(it.bitmap){const{width:Nt,height:Ut}=it;Gt=Nt*Ut*4}else Gt=((zt=it.data)==null?void 0:zt.length)||0;Gt>_util.MAX_IMAGE_SIZE_TO_CACHE&&(Xt._maybeCleanupAfterRender=!0)}break;case"Pattern":Xt.objs.resolve(dt,it);break;default:throw new Error(`Got unknown object type ${xt}`)}}),P.on("DocProgress",dt=>{var It;this.destroyed||(It=Zt.onProgress)==null||It.call(Zt,{loaded:dt.loaded,total:dt.total})}),P.on("FetchBuiltInCMap",dt=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.cMapReaderFactory?this.cMapReaderFactory.fetch(dt):Promise.reject(new Error("CMapReaderFactory not initialized, see the `useWorkerFetch` parameter."))),P.on("FetchStandardFontData",dt=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.standardFontDataFactory?this.standardFontDataFactory.fetch(dt):Promise.reject(new Error("StandardFontDataFactory not initialized, see the `useWorkerFetch` parameter.")))}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){var dt;this.annotationStorage.size<=0&&(0,_util.warn)("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");const{map:P,transfers:Zt}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:P,filename:((dt=this._fullReader)==null?void 0:dt.filename)??null},Zt).finally(()=>{this.annotationStorage.resetModified()})}getPage(P){if(!Number.isInteger(P)||P<=0||P>this._numPages)return Promise.reject(new Error("Invalid page request."));const Zt=P-1,dt=bt(this,S).get(Zt);if(dt)return dt;const It=this.messageHandler.sendWithPromise("GetPage",{pageIndex:Zt}).then(xt=>{if(this.destroyed)throw new Error("Transport destroyed");const it=new PDFPageProxy(Zt,xt,this,this._params.pdfBug);return bt(this,f).set(Zt,it),it});return bt(this,S).set(Zt,It),It}getPageIndex(P){return typeof P!="object"||P===null||!Number.isInteger(P.num)||P.num<0||!Number.isInteger(P.gen)||P.gen<0?Promise.reject(new Error("Invalid pageIndex request.")):this.messageHandler.sendWithPromise("GetPageIndex",{num:P.num,gen:P.gen})}getAnnotations(P,Zt){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:P,intent:Zt})}getFieldObjects(){return nl(this,T,de).call(this,"GetFieldObjects")}hasJSActions(){return nl(this,T,de).call(this,"HasJSActions")}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(P){return typeof P!="string"?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:P})}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)}getDocJSActions(){return nl(this,T,de).call(this,"GetDocJSActions")}getPageJSActions(P){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:P})}getStructTree(P){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:P})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(){return this.messageHandler.sendWithPromise("GetOptionalContentConfig",null).then(P=>new _optional_content_config.OptionalContentConfig(P))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){const P="GetMetadata",Zt=bt(this,K).get(P);if(Zt)return Zt;const dt=this.messageHandler.sendWithPromise(P,null).then(It=>{var xt,it;return{info:It[0],metadata:It[1]?new _metadata.Metadata(It[1]):null,contentDispositionFilename:((xt=this._fullReader)==null?void 0:xt.filename)??null,contentLength:((it=this._fullReader)==null?void 0:it.contentLength)??null}});return bt(this,K).set(P,dt),dt}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(P=!1){if(!this.destroyed){await this.messageHandler.sendWithPromise("Cleanup",null);for(const Zt of bt(this,f).values())if(!Zt.cleanup())throw new Error(`startCleanup: Page ${Zt.pageNumber} is currently rendering.`);this.commonObjs.clear(),P||this.fontLoader.clear(),bt(this,K).clear(),this.filterFactory.destroy(!0)}}get loadingParams(){const{disableAutoFetch:P,enableXfa:Zt}=this._params;return(0,_util.shadow)(this,"loadingParams",{disableAutoFetch:P,enableXfa:Zt})}}K=new WeakMap,f=new WeakMap,S=new WeakMap,k=new WeakMap,T=new WeakSet,de=function(P,Zt=null){const dt=bt(this,K).get(P);if(dt)return dt;const It=this.messageHandler.sendWithPromise(P,Zt);return bt(this,K).set(P,It),It};class PDFObjects{constructor(){ll(this,J);ll(this,F,Object.create(null))}get(P,Zt=null){if(Zt){const It=nl(this,J,Ye).call(this,P);return It.capability.promise.then(()=>Zt(It.data)),null}const dt=bt(this,F)[P];if(!(dt!=null&&dt.capability.settled))throw new Error(`Requesting object that isn't resolved yet ${P}.`);return dt.data}has(P){const Zt=bt(this,F)[P];return(Zt==null?void 0:Zt.capability.settled)||!1}resolve(P,Zt=null){const dt=nl(this,J,Ye).call(this,P);dt.data=Zt,dt.capability.resolve()}clear(){var P;for(const Zt in bt(this,F)){const{data:dt}=bt(this,F)[Zt];(P=dt==null?void 0:dt.bitmap)==null||P.close()}ul(this,F,Object.create(null))}}F=new WeakMap,J=new WeakSet,Ye=function(P){var Zt;return(Zt=bt(this,F))[P]||(Zt[P]={capability:new _util.PromiseCapability,data:null})};class RenderTask{constructor(P){ll(this,u,null);ul(this,u,P),this.onContinue=null}get promise(){return bt(this,u).capability.promise}cancel(P=0){bt(this,u).cancel(null,P)}get separateAnnots(){const{separateAnnots:P}=bt(this,u).operatorList;if(!P)return!1;const{annotationCanvasMap:Zt}=bt(this,u);return P.form||P.canvas&&(Zt==null?void 0:Zt.size)>0}}u=new WeakMap,exports.RenderTask=RenderTask;const _=class _{constructor({callback:P,params:Zt,objs:dt,commonObjs:It,annotationCanvasMap:xt,operatorList:it,pageIndex:Xt,canvasFactory:zt,filterFactory:Gt,useRequestAnimationFrame:Nt=!1,pdfBug:Ut=!1,pageColors:Vt=null}){this.callback=P,this.params=Zt,this.objs=dt,this.commonObjs=It,this.annotationCanvasMap=xt,this.operatorListIdx=null,this.operatorList=it,this._pageIndex=Xt,this.canvasFactory=zt,this.filterFactory=Gt,this._pdfBug=Ut,this.pageColors=Vt,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=Nt===!0&&typeof window<"u",this.cancelled=!1,this.capability=new _util.PromiseCapability,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=Zt.canvasContext.canvas}get completed(){return this.capability.promise.catch(function(){})}initializeGraphics({transparency:P=!1,optionalContentConfig:Zt}){var Xt,zt;if(this.cancelled)return;if(this._canvas){if(bt(_,m).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.");bt(_,m).add(this._canvas)}this._pdfBug&&((Xt=globalThis.StepperManager)!=null&&Xt.enabled)&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());const{canvasContext:dt,viewport:It,transform:xt,background:it}=this.params;this.gfx=new _canvas.CanvasGraphics(dt,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:Zt},this.annotationCanvasMap,this.pageColors),this.gfx.beginDrawing({transform:xt,viewport:It,transparency:P,background:it}),this.operatorListIdx=0,this.graphicsReady=!0,(zt=this.graphicsReadyCallback)==null||zt.call(this)}cancel(P=null,Zt=0){var dt;this.running=!1,this.cancelled=!0,(dt=this.gfx)==null||dt.endDrawing(),bt(_,m).delete(this._canvas),this.callback(P||new _display_utils.RenderingCancelledException(`Rendering cancelled, page ${this._pageIndex+1}`,Zt))}operatorListChanged(){var P;if(!this.graphicsReady){this.graphicsReadyCallback||(this.graphicsReadyCallback=this._continueBound);return}(P=this.stepper)==null||P.updateOperatorList(this.operatorList),!this.running&&this._continue()}_continue(){this.running=!0,!this.cancelled&&(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())}_scheduleNext(){this._useRequestAnimationFrame?window.requestAnimationFrame(()=>{this._nextBound().catch(this._cancelBound)}):Promise.resolve().then(this._nextBound).catch(this._cancelBound)}async _next(){this.cancelled||(this.operatorListIdx=this.gfx.executeOperatorList(this.operatorList,this.operatorListIdx,this._continueBound,this.stepper),this.operatorListIdx===this.operatorList.argsArray.length&&(this.running=!1,this.operatorList.lastChunk&&(this.gfx.endDrawing(),bt(_,m).delete(this._canvas),this.callback())))}};m=new WeakMap,ll(_,m,new WeakSet);let InternalRenderTask=_;const version="3.11.174";exports.version=version;const build="ce8716743";exports.build=build},(lt,r,h)=>{var I,j,q,ss,f;Object.defineProperty(r,"__esModule",{value:!0}),r.SerializableEmpty=r.PrintAnnotationStorage=r.AnnotationStorage=void 0;var M=h(1),p=h(4),B=h(8);const Q=Object.freeze({map:null,hash:"",transfers:void 0});r.SerializableEmpty=Q;class U{constructor(){ll(this,q);ll(this,I,!1);ll(this,j,new Map);this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(k,T){const g=bt(this,j).get(k);return g===void 0?T:Object.assign(T,g)}getRawValue(k){return bt(this,j).get(k)}remove(k){if(bt(this,j).delete(k),bt(this,j).size===0&&this.resetModified(),typeof this.onAnnotationEditor=="function"){for(const T of bt(this,j).values())if(T instanceof p.AnnotationEditor)return;this.onAnnotationEditor(null)}}setValue(k,T){const g=bt(this,j).get(k);let F=!1;if(g!==void 0)for(const[J,v]of Object.entries(T))g[J]!==v&&(F=!0,g[J]=v);else F=!0,bt(this,j).set(k,T);F&&nl(this,q,ss).call(this),T instanceof p.AnnotationEditor&&typeof this.onAnnotationEditor=="function"&&this.onAnnotationEditor(T.constructor._type)}has(k){return bt(this,j).has(k)}getAll(){return bt(this,j).size>0?(0,M.objectFromMap)(bt(this,j)):null}setAll(k){for(const[T,g]of Object.entries(k))this.setValue(T,g)}get size(){return bt(this,j).size}resetModified(){bt(this,I)&&(ul(this,I,!1),typeof this.onResetModified=="function"&&this.onResetModified())}get print(){return new O(this)}get serializable(){if(bt(this,j).size===0)return Q;const k=new Map,T=new B.MurmurHash3_64,g=[],F=Object.create(null);let J=!1;for(const[v,u]of bt(this,j)){const m=u instanceof p.AnnotationEditor?u.serialize(!1,F):u;m&&(k.set(v,m),T.update(`${v}:${JSON.stringify(m)}`),J||(J=!!m.bitmap))}if(J)for(const v of k.values())v.bitmap&&g.push(v.bitmap);return k.size>0?{map:k,hash:T.hexdigest(),transfers:g}:Q}}I=new WeakMap,j=new WeakMap,q=new WeakSet,ss=function(){bt(this,I)||(ul(this,I,!0),typeof this.onSetModified=="function"&&this.onSetModified())},r.AnnotationStorage=U;class O extends U{constructor(T){super();ll(this,f,void 0);const{map:g,hash:F,transfers:J}=T.serializable,v=structuredClone(g,J?{transfer:J}:null);ul(this,f,{map:v,hash:F,transfers:J})}get print(){(0,M.unreachable)("Should not call PrintAnnotationStorage.print")}get serializable(){return bt(this,f)}}f=new WeakMap,r.PrintAnnotationStorage=O},(lt,r,h)=>{var O,I,j,q,K,f,S,k,T,g,F,J,v,u,m,pe,$,ye,Zt,Te,It,Le,it,is,zt,cs,Nt,ds,Vt,Ve,Pt,as;Object.defineProperty(r,"__esModule",{value:!0}),r.AnnotationEditor=void 0;var M=h(5),p=h(1),B=h(6);const R=class R{constructor(X){ll(this,m);ll(this,$);ll(this,It);ll(this,it);ll(this,zt);ll(this,Nt);ll(this,Vt);ll(this,Pt);ll(this,O,"");ll(this,I,!1);ll(this,j,null);ll(this,q,null);ll(this,K,null);ll(this,f,!1);ll(this,S,null);ll(this,k,this.focusin.bind(this));ll(this,T,this.focusout.bind(this));ll(this,g,!1);ll(this,F,!1);ll(this,J,!1);gl(this,"_initialOptions",Object.create(null));gl(this,"_uiManager",null);gl(this,"_focusEventsAllowed",!0);gl(this,"_l10nPromise",null);ll(this,v,!1);ll(this,u,R._zIndex++);this.constructor===R&&(0,p.unreachable)("Cannot initialize AnnotationEditor."),this.parent=X.parent,this.id=X.id,this.width=this.height=null,this.pageIndex=X.parent.pageIndex,this.name=X.name,this.div=null,this._uiManager=X.uiManager,this.annotationElementId=null,this._willKeepAspectRatio=!1,this._initialOptions.isCentered=X.isCentered,this._structTreeParentId=null;const{rotation:C,rawDims:{pageWidth:H,pageHeight:st,pageX:et,pageY:Mt}}=this.parent.viewport;this.rotation=C,this.pageRotation=(360+C-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[H,st],this.pageTranslation=[et,Mt];const[Rt,gt]=this.parentDimensions;this.x=X.x/Rt,this.y=X.y/gt,this.isAttachedToDOM=!1,this.deleted=!1}get editorType(){return Object.getPrototypeOf(this).constructor._type}static get _defaultLineColor(){return(0,p.shadow)(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(X){const C=new U({id:X.parent.getNextId(),parent:X.parent,uiManager:X._uiManager});C.annotationElementId=X.annotationElementId,C.deleted=!0,C._uiManager.addToAnnotationStorage(C)}static initialize(X,C=null){if(R._l10nPromise||(R._l10nPromise=new Map(["editor_alt_text_button_label","editor_alt_text_edit_button_label","editor_alt_text_decorative_tooltip"].map(st=>[st,X.get(st)]))),C!=null&&C.strings)for(const st of C.strings)R._l10nPromise.set(st,X.get(st));if(R._borderLineWidth!==-1)return;const H=getComputedStyle(document.documentElement);R._borderLineWidth=parseFloat(H.getPropertyValue("--outline-width"))||0}static updateDefaultParams(X,C){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(X){return!1}static paste(X,C){(0,p.unreachable)("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return bt(this,v)}set _isDraggable(X){var C;ul(this,v,X),(C=this.div)==null||C.classList.toggle("draggable",X)}center(){const[X,C]=this.pageDimensions;switch(this.parentRotation){case 90:this.x-=this.height*C/(X*2),this.y+=this.width*X/(C*2);break;case 180:this.x+=this.width/2,this.y+=this.height/2;break;case 270:this.x+=this.height*C/(X*2),this.y-=this.width*X/(C*2);break;default:this.x-=this.width/2,this.y-=this.height/2;break}this.fixAndSetPosition()}addCommands(X){this._uiManager.addCommands(X)}get currentLayer(){return this._uiManager.currentLayer}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=bt(this,u)}setParent(X){X!==null&&(this.pageIndex=X.pageIndex,this.pageDimensions=X.pageDimensions),this.parent=X}focusin(X){this._focusEventsAllowed&&(bt(this,g)?ul(this,g,!1):this.parent.setSelected(this))}focusout(X){var H;if(!this._focusEventsAllowed||!this.isAttachedToDOM)return;const C=X.relatedTarget;C!=null&&C.closest(`#${this.id}`)||(X.preventDefault(),(H=this.parent)!=null&&H.isMultipleSelection||this.commitOrRemove())}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}setAt(X,C,H,st){const[et,Mt]=this.parentDimensions;[H,st]=this.screenToPageTranslation(H,st),this.x=(X+H)/et,this.y=(C+st)/Mt,this.fixAndSetPosition()}translate(X,C){nl(this,m,pe).call(this,this.parentDimensions,X,C)}translateInPage(X,C){nl(this,m,pe).call(this,this.pageDimensions,X,C),this.div.scrollIntoView({block:"nearest"})}drag(X,C){const[H,st]=this.parentDimensions;if(this.x+=X/H,this.y+=C/st,this.parent&&(this.x<0||this.x>1||this.y<0||this.y>1)){const{x:Jt,y:Dt}=this.div.getBoundingClientRect();this.parent.findNewParent(this,Jt,Dt)&&(this.x-=Math.floor(this.x),this.y-=Math.floor(this.y))}let{x:et,y:Mt}=this;const[Rt,gt]=nl(this,$,ye).call(this);et+=Rt,Mt+=gt,this.div.style.left=`${(100*et).toFixed(2)}%`,this.div.style.top=`${(100*Mt).toFixed(2)}%`,this.div.scrollIntoView({block:"nearest"})}fixAndSetPosition(){const[X,C]=this.pageDimensions;let{x:H,y:st,width:et,height:Mt}=this;switch(et*=X,Mt*=C,H*=X,st*=C,this.rotation){case 0:H=Math.max(0,Math.min(X-et,H)),st=Math.max(0,Math.min(C-Mt,st));break;case 90:H=Math.max(0,Math.min(X-Mt,H)),st=Math.min(C,Math.max(et,st));break;case 180:H=Math.min(X,Math.max(et,H)),st=Math.min(C,Math.max(Mt,st));break;case 270:H=Math.min(X,Math.max(Mt,H)),st=Math.max(0,Math.min(C-et,st));break}this.x=H/=X,this.y=st/=C;const[Rt,gt]=nl(this,$,ye).call(this);H+=Rt,st+=gt;const{style:Jt}=this.div;Jt.left=`${(100*H).toFixed(2)}%`,Jt.top=`${(100*st).toFixed(2)}%`,this.moveInDOM()}screenToPageTranslation(X,C){var H;return nl(H=R,Zt,Te).call(H,X,C,this.parentRotation)}pageTranslationToScreen(X,C){var H;return nl(H=R,Zt,Te).call(H,X,C,360-this.parentRotation)}get parentScale(){return this._uiManager.viewParameters.realScale}get parentRotation(){return(this._uiManager.viewParameters.rotation+this.pageRotation)%360}get parentDimensions(){const{parentScale:X,pageDimensions:[C,H]}=this,st=C*X,et=H*X;return p.FeatureTest.isCSSRoundSupported?[Math.round(st),Math.round(et)]:[st,et]}setDims(X,C){var et;const[H,st]=this.parentDimensions;this.div.style.width=`${(100*X/H).toFixed(2)}%`,bt(this,f)||(this.div.style.height=`${(100*C/st).toFixed(2)}%`),(et=bt(this,j))==null||et.classList.toggle("small",X<R.SMALL_EDITOR_SIZE||C<R.SMALL_EDITOR_SIZE)}fixDims(){const{style:X}=this.div,{height:C,width:H}=X,st=H.endsWith("%"),et=!bt(this,f)&&C.endsWith("%");if(st&&et)return;const[Mt,Rt]=this.parentDimensions;st||(X.width=`${(100*parseFloat(H)/Mt).toFixed(2)}%`),!bt(this,f)&&!et&&(X.height=`${(100*parseFloat(C)/Rt).toFixed(2)}%`)}getInitialTranslation(){return[0,0]}async addAltTextButton(){if(bt(this,j))return;const X=ul(this,j,document.createElement("button"));X.className="altText";const C=await R._l10nPromise.get("editor_alt_text_button_label");X.textContent=C,X.setAttribute("aria-label",C),X.tabIndex="0",X.addEventListener("contextmenu",B.noContextMenu),X.addEventListener("pointerdown",H=>H.stopPropagation()),X.addEventListener("click",H=>{H.preventDefault(),this._uiManager.editAltText(this)},{capture:!0}),X.addEventListener("keydown",H=>{H.target===X&&H.key==="Enter"&&(H.preventDefault(),this._uiManager.editAltText(this))}),nl(this,Vt,Ve).call(this),this.div.append(X),R.SMALL_EDITOR_SIZE||(R.SMALL_EDITOR_SIZE=Math.min(128,Math.round(X.getBoundingClientRect().width*1.4)))}getClientDimensions(){return this.div.getBoundingClientRect()}get altTextData(){return{altText:bt(this,O),decorative:bt(this,I)}}set altTextData({altText:X,decorative:C}){bt(this,O)===X&&bt(this,I)===C||(ul(this,O,X),ul(this,I,C),nl(this,Vt,Ve).call(this))}render(){this.div=document.createElement("div"),this.div.setAttribute("data-editor-rotation",(360-this.rotation)%360),this.div.className=this.name,this.div.setAttribute("id",this.id),this.div.setAttribute("tabIndex",0),this.setInForeground(),this.div.addEventListener("focusin",bt(this,k)),this.div.addEventListener("focusout",bt(this,T));const[X,C]=this.parentDimensions;this.parentRotation%180!==0&&(this.div.style.maxWidth=`${(100*C/X).toFixed(2)}%`,this.div.style.maxHeight=`${(100*X/C).toFixed(2)}%`);const[H,st]=this.getInitialTranslation();return this.translate(H,st),(0,M.bindEvents)(this,this.div,["pointerdown"]),this.div}pointerdown(X){const{isMac:C}=p.FeatureTest.platform;if(X.button!==0||X.ctrlKey&&C){X.preventDefault();return}ul(this,g,!0),nl(this,Pt,as).call(this,X)}moveInDOM(){var X;(X=this.parent)==null||X.moveEditorInDOM(this)}_setParentAndPosition(X,C,H){X.changeParent(this),this.x=C,this.y=H,this.fixAndSetPosition()}getRect(X,C){const H=this.parentScale,[st,et]=this.pageDimensions,[Mt,Rt]=this.pageTranslation,gt=X/H,Jt=C/H,Dt=this.x*st,qt=this.y*et,vt=this.width*st,cl=this.height*et;switch(this.rotation){case 0:return[Dt+gt+Mt,et-qt-Jt-cl+Rt,Dt+gt+vt+Mt,et-qt-Jt+Rt];case 90:return[Dt+Jt+Mt,et-qt+gt+Rt,Dt+Jt+cl+Mt,et-qt+gt+vt+Rt];case 180:return[Dt-gt-vt+Mt,et-qt+Jt+Rt,Dt-gt+Mt,et-qt+Jt+cl+Rt];case 270:return[Dt-Jt-cl+Mt,et-qt-gt-vt+Rt,Dt-Jt+Mt,et-qt-gt+Rt];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(X,C){const[H,st,et,Mt]=X,Rt=et-H,gt=Mt-st;switch(this.rotation){case 0:return[H,C-Mt,Rt,gt];case 90:return[H,C-st,gt,Rt];case 180:return[et,C-st,Rt,gt];case 270:return[et,C-Mt,gt,Rt];default:throw new Error("Invalid rotation")}}onceAdded(){}isEmpty(){return!1}enableEditMode(){ul(this,J,!0)}disableEditMode(){ul(this,J,!1)}isInEditMode(){return bt(this,J)}shouldGetKeyboardEvents(){return!1}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}rebuild(){var X,C;(X=this.div)==null||X.addEventListener("focusin",bt(this,k)),(C=this.div)==null||C.addEventListener("focusout",bt(this,T))}serialize(X=!1,C=null){(0,p.unreachable)("An editor must be serializable")}static deserialize(X,C,H){const st=new this.prototype.constructor({parent:C,id:C.getNextId(),uiManager:H});st.rotation=X.rotation;const[et,Mt]=st.pageDimensions,[Rt,gt,Jt,Dt]=st.getRectInCurrentCoords(X.rect,Mt);return st.x=Rt/et,st.y=gt/Mt,st.width=Jt/et,st.height=Dt/Mt,st}remove(){var X;this.div.removeEventListener("focusin",bt(this,k)),this.div.removeEventListener("focusout",bt(this,T)),this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),(X=bt(this,j))==null||X.remove(),ul(this,j,null),ul(this,q,null)}get isResizable(){return!1}makeResizable(){this.isResizable&&(nl(this,it,is).call(this),bt(this,S).classList.remove("hidden"))}select(){var X;this.makeResizable(),(X=this.div)==null||X.classList.add("selectedEditor")}unselect(){var X,C,H;(X=bt(this,S))==null||X.classList.add("hidden"),(C=this.div)==null||C.classList.remove("selectedEditor"),(H=this.div)!=null&&H.contains(document.activeElement)&&this._uiManager.currentLayer.div.focus()}updateParams(X,C){}disableEditing(){bt(this,j)&&(bt(this,j).hidden=!0)}enableEditing(){bt(this,j)&&(bt(this,j).hidden=!1)}enterInEditMode(){}get contentDiv(){return this.div}get isEditing(){return bt(this,F)}set isEditing(X){ul(this,F,X),this.parent&&(X?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null))}setAspectRatio(X,C){ul(this,f,!0);const H=X/C,{style:st}=this.div;st.aspectRatio=H,st.height="auto"}static get MIN_SIZE(){return 16}};O=new WeakMap,I=new WeakMap,j=new WeakMap,q=new WeakMap,K=new WeakMap,f=new WeakMap,S=new WeakMap,k=new WeakMap,T=new WeakMap,g=new WeakMap,F=new WeakMap,J=new WeakMap,v=new WeakMap,u=new WeakMap,m=new WeakSet,pe=function([X,C],H,st){[H,st]=this.screenToPageTranslation(H,st),this.x+=H/X,this.y+=st/C,this.fixAndSetPosition()},$=new WeakSet,ye=function(){const[X,C]=this.parentDimensions,{_borderLineWidth:H}=R,st=H/X,et=H/C;switch(this.rotation){case 90:return[-st,et];case 180:return[st,et];case 270:return[st,-et];default:return[-st,-et]}},Zt=new WeakSet,Te=function(X,C,H){switch(H){case 90:return[C,-X];case 180:return[-X,-C];case 270:return[-C,X];default:return[X,C]}},It=new WeakSet,Le=function(X){switch(X){case 90:{const[C,H]=this.pageDimensions;return[0,-C/H,H/C,0]}case 180:return[-1,0,0,-1];case 270:{const[C,H]=this.pageDimensions;return[0,C/H,-H/C,0]}default:return[1,0,0,1]}},it=new WeakSet,is=function(){if(bt(this,S))return;ul(this,S,document.createElement("div")),bt(this,S).classList.add("resizers");const X=["topLeft","topRight","bottomRight","bottomLeft"];this._willKeepAspectRatio||X.push("topMiddle","middleRight","bottomMiddle","middleLeft");for(const C of X){const H=document.createElement("div");bt(this,S).append(H),H.classList.add("resizer",C),H.addEventListener("pointerdown",nl(this,zt,cs).bind(this,C)),H.addEventListener("contextmenu",B.noContextMenu)}this.div.prepend(bt(this,S))},zt=new WeakSet,cs=function(X,C){C.preventDefault();const{isMac:H}=p.FeatureTest.platform;if(C.button!==0||C.ctrlKey&&H)return;const st=nl(this,Nt,ds).bind(this,X),et=this._isDraggable;this._isDraggable=!1;const Mt={passive:!0,capture:!0};window.addEventListener("pointermove",st,Mt);const Rt=this.x,gt=this.y,Jt=this.width,Dt=this.height,qt=this.parent.div.style.cursor,vt=this.div.style.cursor;this.div.style.cursor=this.parent.div.style.cursor=window.getComputedStyle(C.target).cursor;const cl=()=>{this._isDraggable=et,window.removeEventListener("pointerup",cl),window.removeEventListener("blur",cl),window.removeEventListener("pointermove",st,Mt),this.parent.div.style.cursor=qt,this.div.style.cursor=vt;const bl=this.x,il=this.y,Bt=this.width,Ft=this.height;bl===Rt&&il===gt&&Bt===Jt&&Ft===Dt||this.addCommands({cmd:()=>{this.width=Bt,this.height=Ft,this.x=bl,this.y=il;const[wt,pt]=this.parentDimensions;this.setDims(wt*Bt,pt*Ft),this.fixAndSetPosition()},undo:()=>{this.width=Jt,this.height=Dt,this.x=Rt,this.y=gt;const[wt,pt]=this.parentDimensions;this.setDims(wt*Jt,pt*Dt),this.fixAndSetPosition()},mustExec:!0})};window.addEventListener("pointerup",cl),window.addEventListener("blur",cl)},Nt=new WeakSet,ds=function(X,C){const[H,st]=this.parentDimensions,et=this.x,Mt=this.y,Rt=this.width,gt=this.height,Jt=R.MIN_SIZE/H,Dt=R.MIN_SIZE/st,qt=Tt=>Math.round(Tt*1e4)/1e4,vt=nl(this,It,Le).call(this,this.rotation),cl=(Tt,jt)=>[vt[0]*Tt+vt[2]*jt,vt[1]*Tt+vt[3]*jt],bl=nl(this,It,Le).call(this,360-this.rotation),il=(Tt,jt)=>[bl[0]*Tt+bl[2]*jt,bl[1]*Tt+bl[3]*jt];let Bt,Ft,wt=!1,pt=!1;switch(X){case"topLeft":wt=!0,Bt=(Tt,jt)=>[0,0],Ft=(Tt,jt)=>[Tt,jt];break;case"topMiddle":Bt=(Tt,jt)=>[Tt/2,0],Ft=(Tt,jt)=>[Tt/2,jt];break;case"topRight":wt=!0,Bt=(Tt,jt)=>[Tt,0],Ft=(Tt,jt)=>[0,jt];break;case"middleRight":pt=!0,Bt=(Tt,jt)=>[Tt,jt/2],Ft=(Tt,jt)=>[0,jt/2];break;case"bottomRight":wt=!0,Bt=(Tt,jt)=>[Tt,jt],Ft=(Tt,jt)=>[0,0];break;case"bottomMiddle":Bt=(Tt,jt)=>[Tt/2,jt],Ft=(Tt,jt)=>[Tt/2,0];break;case"bottomLeft":wt=!0,Bt=(Tt,jt)=>[0,jt],Ft=(Tt,jt)=>[Tt,0];break;case"middleLeft":pt=!0,Bt=(Tt,jt)=>[0,jt/2],Ft=(Tt,jt)=>[Tt,jt/2];break}const Ct=Bt(Rt,gt),$t=Ft(Rt,gt);let dl=cl(...$t);const rl=qt(et+dl[0]),Yl=qt(Mt+dl[1]);let Xl=1,pl=1,[Ll,yl]=this.screenToPageTranslation(C.movementX,C.movementY);if([Ll,yl]=il(Ll/H,yl/st),wt){const Tt=Math.hypot(Rt,gt);Xl=pl=Math.max(Math.min(Math.hypot($t[0]-Ct[0]-Ll,$t[1]-Ct[1]-yl)/Tt,1/Rt,1/gt),Jt/Rt,Dt/gt)}else pt?Xl=Math.max(Jt,Math.min(1,Math.abs($t[0]-Ct[0]-Ll)))/Rt:pl=Math.max(Dt,Math.min(1,Math.abs($t[1]-Ct[1]-yl)))/gt;const Vl=qt(Rt*Xl),_t=qt(gt*pl);dl=cl(...Ft(Vl,_t));const ot=rl-dl[0],ut=Yl-dl[1];this.width=Vl,this.height=_t,this.x=ot,this.y=ut,this.setDims(H*Vl,st*_t),this.fixAndSetPosition()},Vt=new WeakSet,Ve=async function(){var H;const X=bt(this,j);if(!X)return;if(!bt(this,O)&&!bt(this,I)){X.classList.remove("done"),(H=bt(this,q))==null||H.remove();return}R._l10nPromise.get("editor_alt_text_edit_button_label").then(st=>{X.setAttribute("aria-label",st)});let C=bt(this,q);if(!C){ul(this,q,C=document.createElement("span")),C.className="tooltip",C.setAttribute("role","tooltip");const st=C.id=`alt-text-tooltip-${this.id}`;X.setAttribute("aria-describedby",st);const et=100;X.addEventListener("mouseenter",()=>{ul(this,K,setTimeout(()=>{ul(this,K,null),bt(this,q).classList.add("show"),this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",subtype:this.editorType,data:{action:"alt_text_tooltip"}}})},et))}),X.addEventListener("mouseleave",()=>{var Mt;clearTimeout(bt(this,K)),ul(this,K,null),(Mt=bt(this,q))==null||Mt.classList.remove("show")})}X.classList.add("done"),C.innerText=bt(this,I)?await R._l10nPromise.get("editor_alt_text_decorative_tooltip"):bt(this,O),C.parentNode||X.append(C)},Pt=new WeakSet,as=function(X){if(!this._isDraggable)return;const C=this._uiManager.isSelected(this);this._uiManager.setUpDragSession();let H,st;C&&(H={passive:!0,capture:!0},st=Mt=>{const[Rt,gt]=this.screenToPageTranslation(Mt.movementX,Mt.movementY);this._uiManager.dragSelectedEditors(Rt,gt)},window.addEventListener("pointermove",st,H));const et=()=>{if(window.removeEventListener("pointerup",et),window.removeEventListener("blur",et),C&&window.removeEventListener("pointermove",st,H),ul(this,g,!1),!this._uiManager.endDragSession()){const{isMac:Mt}=p.FeatureTest.platform;X.ctrlKey&&!Mt||X.shiftKey||X.metaKey&&Mt?this.parent.toggleSelected(this):this.parent.setSelected(this)}};window.addEventListener("pointerup",et),window.addEventListener("blur",et)},ll(R,Zt),gl(R,"_borderLineWidth",-1),gl(R,"_colorManager",new M.ColorManager),gl(R,"_zIndex",1),gl(R,"SMALL_EDITOR_SIZE",0);let Q=R;r.AnnotationEditor=Q;class U extends Q{constructor(X){super(X),this.annotationElementId=X.annotationElementId,this.deleted=!0}serialize(){return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex}}}},(lt,r,h)=>{var f,S,k,T,g,Ie,v,u,m,_,$,ns,dt,It,xt,it,Xt,zt,Gt,Nt,Ut,Vt,Ht,Pt,at,R,w,X,C,H,st,et,Mt,Rt,gt,Jt,Dt,qt,vt,cl,bl,il,Bt,Ft,wt,pt,Ct,Zs,dl,ze,Yl,Re,pl,ae,yl,Se,_t,we,ut,Jl,jt,_l,Lt,hs,Kt,bs,el,xe,Qt,ql,hl,ke;Object.defineProperty(r,"__esModule",{value:!0}),r.KeyboardManager=r.CommandManager=r.ColorManager=r.AnnotationEditorUIManager=void 0,r.bindEvents=B,r.opacityToHex=Q;var M=h(1),p=h(6);function B(nt,L,ct){for(const Wt of ct)L.addEventListener(Wt,nt[Wt].bind(nt))}function Q(nt){return Math.round(Math.min(255,Math.max(1,255*nt))).toString(16).padStart(2,"0")}class U{constructor(){ll(this,f,0)}getId(){return`${M.AnnotationEditorPrefix}${Al(this,f)._++}`}}f=new WeakMap;const J=class J{constructor(){ll(this,g);ll(this,S,(0,M.getUuid)());ll(this,k,0);ll(this,T,null)}static get _isSVGFittingCanvas(){const L='data:image/svg+xml;charset=UTF-8,<svg viewBox="0 0 1 1" width="1" height="1" xmlns="http://www.w3.org/2000/svg"><rect width="1" height="1" style="fill:red;"/></svg>',Wt=new OffscreenCanvas(1,3).getContext("2d"),Yt=new Image;Yt.src=L;const kt=Yt.decode().then(()=>(Wt.drawImage(Yt,0,0,1,1,0,0,1,3),new Uint32Array(Wt.getImageData(0,0,1,1).data.buffer)[0]===0));return(0,M.shadow)(this,"_isSVGFittingCanvas",kt)}async getFromFile(L){const{lastModified:ct,name:Wt,size:Yt,type:kt}=L;return nl(this,g,Ie).call(this,`${ct}_${Wt}_${Yt}_${kt}`,L)}async getFromUrl(L){return nl(this,g,Ie).call(this,L,L)}async getFromId(L){bt(this,T)||ul(this,T,new Map);const ct=bt(this,T).get(L);return ct?ct.bitmap?(ct.refCounter+=1,ct):ct.file?this.getFromFile(ct.file):this.getFromUrl(ct.url):null}getSvgUrl(L){const ct=bt(this,T).get(L);return ct!=null&&ct.isSvg?ct.svgUrl:null}deleteId(L){bt(this,T)||ul(this,T,new Map);const ct=bt(this,T).get(L);ct&&(ct.refCounter-=1,ct.refCounter===0&&(ct.bitmap=null))}isValidId(L){return L.startsWith(`image_${bt(this,S)}_`)}};S=new WeakMap,k=new WeakMap,T=new WeakMap,g=new WeakSet,Ie=async function(L,ct){bt(this,T)||ul(this,T,new Map);let Wt=bt(this,T).get(L);if(Wt===null)return null;if(Wt!=null&&Wt.bitmap)return Wt.refCounter+=1,Wt;try{Wt||(Wt={bitmap:null,id:`image_${bt(this,S)}_${Al(this,k)._++}`,refCounter:0,isSvg:!1});let Yt;if(typeof ct=="string"){Wt.url=ct;const kt=await fetch(ct);if(!kt.ok)throw new Error(kt.statusText);Yt=await kt.blob()}else Yt=Wt.file=ct;if(Yt.type==="image/svg+xml"){const kt=J._isSVGFittingCanvas,Et=new FileReader,sl=new Image,ml=new Promise((al,zl)=>{sl.onload=()=>{Wt.bitmap=sl,Wt.isSvg=!0,al()},Et.onload=async()=>{const Gl=Wt.svgUrl=Et.result;sl.src=await kt?`${Gl}#svgView(preserveAspectRatio(none))`:Gl},sl.onerror=Et.onerror=zl});Et.readAsDataURL(Yt),await ml}else Wt.bitmap=await createImageBitmap(Yt);Wt.refCounter=1}catch(Yt){console.error(Yt),Wt=null}return bt(this,T).set(L,Wt),Wt&&bt(this,T).set(Wt.id,Wt),Wt};let O=J;class I{constructor(L=128){ll(this,v,[]);ll(this,u,!1);ll(this,m,void 0);ll(this,_,-1);ul(this,m,L)}add({cmd:L,undo:ct,mustExec:Wt,type:Yt=NaN,overwriteIfSameType:kt=!1,keepUndo:Et=!1}){if(Wt&&L(),bt(this,u))return;const sl={cmd:L,undo:ct,type:Yt};if(bt(this,_)===-1){bt(this,v).length>0&&(bt(this,v).length=0),ul(this,_,0),bt(this,v).push(sl);return}if(kt&&bt(this,v)[bt(this,_)].type===Yt){Et&&(sl.undo=bt(this,v)[bt(this,_)].undo),bt(this,v)[bt(this,_)]=sl;return}const ml=bt(this,_)+1;ml===bt(this,m)?bt(this,v).splice(0,1):(ul(this,_,ml),ml<bt(this,v).length&&bt(this,v).splice(ml)),bt(this,v).push(sl)}undo(){bt(this,_)!==-1&&(ul(this,u,!0),bt(this,v)[bt(this,_)].undo(),ul(this,u,!1),ul(this,_,bt(this,_)-1))}redo(){bt(this,_)<bt(this,v).length-1&&(ul(this,_,bt(this,_)+1),ul(this,u,!0),bt(this,v)[bt(this,_)].cmd(),ul(this,u,!1))}hasSomethingToUndo(){return bt(this,_)!==-1}hasSomethingToRedo(){return bt(this,_)<bt(this,v).length-1}destroy(){ul(this,v,null)}}v=new WeakMap,u=new WeakMap,m=new WeakMap,_=new WeakMap,r.CommandManager=I;class j{constructor(L){ll(this,$);this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;const{isMac:ct}=M.FeatureTest.platform;for(const[Wt,Yt,kt={}]of L)for(const Et of Wt){const sl=Et.startsWith("mac+");ct&&sl?(this.callbacks.set(Et.slice(4),{callback:Yt,options:kt}),this.allKeys.add(Et.split("+").at(-1))):!ct&&!sl&&(this.callbacks.set(Et,{callback:Yt,options:kt}),this.allKeys.add(Et.split("+").at(-1)))}}exec(L,ct){if(!this.allKeys.has(ct.key))return;const Wt=this.callbacks.get(nl(this,$,ns).call(this,ct));if(!Wt)return;const{callback:Yt,options:{bubbles:kt=!1,args:Et=[],checker:sl=null}}=Wt;sl&&!sl(L,ct)||(Yt.bind(L,...Et)(),kt||(ct.stopPropagation(),ct.preventDefault()))}}$=new WeakSet,ns=function(L){L.altKey&&this.buffer.push("alt"),L.ctrlKey&&this.buffer.push("ctrl"),L.metaKey&&this.buffer.push("meta"),L.shiftKey&&this.buffer.push("shift"),this.buffer.push(L.key);const ct=this.buffer.join("+");return this.buffer.length=0,ct},r.KeyboardManager=j;const Zt=class Zt{get _colors(){const L=new Map([["CanvasText",null],["Canvas",null]]);return(0,p.getColorValues)(L),(0,M.shadow)(this,"_colors",L)}convert(L){const ct=(0,p.getRGB)(L);if(!window.matchMedia("(forced-colors: active)").matches)return ct;for(const[Wt,Yt]of this._colors)if(Yt.every((kt,Et)=>kt===ct[Et]))return Zt._colorsMapping.get(Wt);return ct}getHexCode(L){const ct=this._colors.get(L);return ct?M.Util.makeHexColor(...ct):L}};gl(Zt,"_colorsMapping",new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]));let q=Zt;r.ColorManager=q;const Wl=class Wl{constructor(L,ct,Wt,Yt,kt,Et){ll(this,Ct);ll(this,dl);ll(this,Yl);ll(this,pl);ll(this,yl);ll(this,_t);ll(this,ut);ll(this,jt);ll(this,Lt);ll(this,Kt);ll(this,el);ll(this,Qt);ll(this,hl);ll(this,dt,null);ll(this,It,new Map);ll(this,xt,new Map);ll(this,it,null);ll(this,Xt,null);ll(this,zt,new I);ll(this,Gt,0);ll(this,Nt,new Set);ll(this,Ut,null);ll(this,Vt,null);ll(this,Ht,new Set);ll(this,Pt,null);ll(this,at,new U);ll(this,R,!1);ll(this,w,!1);ll(this,X,null);ll(this,C,M.AnnotationEditorType.NONE);ll(this,H,new Set);ll(this,st,null);ll(this,et,this.blur.bind(this));ll(this,Mt,this.focus.bind(this));ll(this,Rt,this.copy.bind(this));ll(this,gt,this.cut.bind(this));ll(this,Jt,this.paste.bind(this));ll(this,Dt,this.keydown.bind(this));ll(this,qt,this.onEditingAction.bind(this));ll(this,vt,this.onPageChanging.bind(this));ll(this,cl,this.onScaleChanging.bind(this));ll(this,bl,this.onRotationChanging.bind(this));ll(this,il,{isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1});ll(this,Bt,[0,0]);ll(this,Ft,null);ll(this,wt,null);ll(this,pt,null);ul(this,wt,L),ul(this,pt,ct),ul(this,it,Wt),this._eventBus=Yt,this._eventBus._on("editingaction",bt(this,qt)),this._eventBus._on("pagechanging",bt(this,vt)),this._eventBus._on("scalechanging",bt(this,cl)),this._eventBus._on("rotationchanging",bt(this,bl)),ul(this,Xt,kt.annotationStorage),ul(this,Pt,kt.filterFactory),ul(this,st,Et),this.viewParameters={realScale:p.PixelsPerInch.PDF_TO_CSS_UNITS,rotation:0}}static get _keyboardManager(){const L=Wl.prototype,ct=kt=>{const{activeElement:Et}=document;return Et&&bt(kt,wt).contains(Et)&&kt.hasSomethingToControl()},Wt=this.TRANSLATE_SMALL,Yt=this.TRANSLATE_BIG;return(0,M.shadow)(this,"_keyboardManager",new j([[["ctrl+a","mac+meta+a"],L.selectAll],[["ctrl+z","mac+meta+z"],L.undo],[["ctrl+y","ctrl+shift+z","mac+meta+shift+z","ctrl+shift+Z","mac+meta+shift+Z"],L.redo],[["Backspace","alt+Backspace","ctrl+Backspace","shift+Backspace","mac+Backspace","mac+alt+Backspace","mac+ctrl+Backspace","Delete","ctrl+Delete","shift+Delete","mac+Delete"],L.delete],[["Escape","mac+Escape"],L.unselectAll],[["ArrowLeft","mac+ArrowLeft"],L.translateSelectedEditors,{args:[-Wt,0],checker:ct}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],L.translateSelectedEditors,{args:[-Yt,0],checker:ct}],[["ArrowRight","mac+ArrowRight"],L.translateSelectedEditors,{args:[Wt,0],checker:ct}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],L.translateSelectedEditors,{args:[Yt,0],checker:ct}],[["ArrowUp","mac+ArrowUp"],L.translateSelectedEditors,{args:[0,-Wt],checker:ct}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],L.translateSelectedEditors,{args:[0,-Yt],checker:ct}],[["ArrowDown","mac+ArrowDown"],L.translateSelectedEditors,{args:[0,Wt],checker:ct}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],L.translateSelectedEditors,{args:[0,Yt],checker:ct}]]))}destroy(){nl(this,pl,ae).call(this),nl(this,dl,ze).call(this),this._eventBus._off("editingaction",bt(this,qt)),this._eventBus._off("pagechanging",bt(this,vt)),this._eventBus._off("scalechanging",bt(this,cl)),this._eventBus._off("rotationchanging",bt(this,bl));for(const L of bt(this,xt).values())L.destroy();bt(this,xt).clear(),bt(this,It).clear(),bt(this,Ht).clear(),ul(this,dt,null),bt(this,H).clear(),bt(this,zt).destroy(),bt(this,it).destroy()}get hcmFilter(){return(0,M.shadow)(this,"hcmFilter",bt(this,st)?bt(this,Pt).addHCMFilter(bt(this,st).foreground,bt(this,st).background):"none")}get direction(){return(0,M.shadow)(this,"direction",getComputedStyle(bt(this,wt)).direction)}editAltText(L){var ct;(ct=bt(this,it))==null||ct.editAltText(this,L)}onPageChanging({pageNumber:L}){ul(this,Gt,L-1)}focusMainContainer(){bt(this,wt).focus()}findParent(L,ct){for(const Wt of bt(this,xt).values()){const{x:Yt,y:kt,width:Et,height:sl}=Wt.div.getBoundingClientRect();if(L>=Yt&&L<=Yt+Et&&ct>=kt&&ct<=kt+sl)return Wt}return null}disableUserSelect(L=!1){bt(this,pt).classList.toggle("noUserSelect",L)}addShouldRescale(L){bt(this,Ht).add(L)}removeShouldRescale(L){bt(this,Ht).delete(L)}onScaleChanging({scale:L}){this.commitOrRemove(),this.viewParameters.realScale=L*p.PixelsPerInch.PDF_TO_CSS_UNITS;for(const ct of bt(this,Ht))ct.onScaleChanging()}onRotationChanging({pagesRotation:L}){this.commitOrRemove(),this.viewParameters.rotation=L}addToAnnotationStorage(L){!L.isEmpty()&&bt(this,Xt)&&!bt(this,Xt).has(L.id)&&bt(this,Xt).setValue(L.id,L)}blur(){if(!this.hasSelection)return;const{activeElement:L}=document;for(const ct of bt(this,H))if(ct.div.contains(L)){ul(this,X,[ct,L]),ct._focusEventsAllowed=!1;break}}focus(){if(!bt(this,X))return;const[L,ct]=bt(this,X);ul(this,X,null),ct.addEventListener("focusin",()=>{L._focusEventsAllowed=!0},{once:!0}),ct.focus()}addEditListeners(){nl(this,Yl,Re).call(this),nl(this,yl,Se).call(this)}removeEditListeners(){nl(this,pl,ae).call(this),nl(this,_t,we).call(this)}copy(L){var Wt;if(L.preventDefault(),(Wt=bt(this,dt))==null||Wt.commitOrRemove(),!this.hasSelection)return;const ct=[];for(const Yt of bt(this,H)){const kt=Yt.serialize(!0);kt&&ct.push(kt)}ct.length!==0&&L.clipboardData.setData("application/pdfjs",JSON.stringify(ct))}cut(L){this.copy(L),this.delete()}paste(L){L.preventDefault();const{clipboardData:ct}=L;for(const kt of ct.items)for(const Et of bt(this,Vt))if(Et.isHandlingMimeForPasting(kt.type)){Et.paste(kt,this.currentLayer);return}let Wt=ct.getData("application/pdfjs");if(!Wt)return;try{Wt=JSON.parse(Wt)}catch(kt){(0,M.warn)(`paste: "${kt.message}".`);return}if(!Array.isArray(Wt))return;this.unselectAll();const Yt=this.currentLayer;try{const kt=[];for(const ml of Wt){const al=Yt.deserialize(ml);if(!al)return;kt.push(al)}const Et=()=>{for(const ml of kt)nl(this,el,xe).call(this,ml);nl(this,hl,ke).call(this,kt)},sl=()=>{for(const ml of kt)ml.remove()};this.addCommands({cmd:Et,undo:sl,mustExec:!0})}catch(kt){(0,M.warn)(`paste: "${kt.message}".`)}}keydown(L){var ct;(ct=this.getActive())!=null&&ct.shouldGetKeyboardEvents()||Wl._keyboardManager.exec(this,L)}onEditingAction(L){["undo","redo","delete","selectAll"].includes(L.name)&&this[L.name]()}setEditingState(L){L?(nl(this,Ct,Zs).call(this),nl(this,Yl,Re).call(this),nl(this,yl,Se).call(this),nl(this,ut,Jl).call(this,{isEditing:bt(this,C)!==M.AnnotationEditorType.NONE,isEmpty:nl(this,Qt,ql).call(this),hasSomethingToUndo:bt(this,zt).hasSomethingToUndo(),hasSomethingToRedo:bt(this,zt).hasSomethingToRedo(),hasSelectedEditor:!1})):(nl(this,dl,ze).call(this),nl(this,pl,ae).call(this),nl(this,_t,we).call(this),nl(this,ut,Jl).call(this,{isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(L){if(!bt(this,Vt)){ul(this,Vt,L);for(const ct of bt(this,Vt))nl(this,jt,_l).call(this,ct.defaultPropertiesToUpdate)}}getId(){return bt(this,at).getId()}get currentLayer(){return bt(this,xt).get(bt(this,Gt))}getLayer(L){return bt(this,xt).get(L)}get currentPageIndex(){return bt(this,Gt)}addLayer(L){bt(this,xt).set(L.pageIndex,L),bt(this,R)?L.enable():L.disable()}removeLayer(L){bt(this,xt).delete(L.pageIndex)}updateMode(L,ct=null){if(bt(this,C)!==L){if(ul(this,C,L),L===M.AnnotationEditorType.NONE){this.setEditingState(!1),nl(this,Kt,bs).call(this);return}this.setEditingState(!0),nl(this,Lt,hs).call(this),this.unselectAll();for(const Wt of bt(this,xt).values())Wt.updateMode(L);if(ct){for(const Wt of bt(this,It).values())if(Wt.annotationElementId===ct){this.setSelected(Wt),Wt.enterInEditMode();break}}}}updateToolbar(L){L!==bt(this,C)&&this._eventBus.dispatch("switchannotationeditormode",{source:this,mode:L})}updateParams(L,ct){if(bt(this,Vt)){if(L===M.AnnotationEditorParamsType.CREATE){this.currentLayer.addNewEditor(L);return}for(const Wt of bt(this,H))Wt.updateParams(L,ct);for(const Wt of bt(this,Vt))Wt.updateDefaultParams(L,ct)}}enableWaiting(L=!1){if(bt(this,w)!==L){ul(this,w,L);for(const ct of bt(this,xt).values())L?ct.disableClick():ct.enableClick(),ct.div.classList.toggle("waiting",L)}}getEditors(L){const ct=[];for(const Wt of bt(this,It).values())Wt.pageIndex===L&&ct.push(Wt);return ct}getEditor(L){return bt(this,It).get(L)}addEditor(L){bt(this,It).set(L.id,L)}removeEditor(L){var ct;bt(this,It).delete(L.id),this.unselect(L),(!L.annotationElementId||!bt(this,Nt).has(L.annotationElementId))&&((ct=bt(this,Xt))==null||ct.remove(L.id))}addDeletedAnnotationElement(L){bt(this,Nt).add(L.annotationElementId),L.deleted=!0}isDeletedAnnotationElement(L){return bt(this,Nt).has(L)}removeDeletedAnnotationElement(L){bt(this,Nt).delete(L.annotationElementId),L.deleted=!1}setActiveEditor(L){bt(this,dt)!==L&&(ul(this,dt,L),L&&nl(this,jt,_l).call(this,L.propertiesToUpdate))}toggleSelected(L){if(bt(this,H).has(L)){bt(this,H).delete(L),L.unselect(),nl(this,ut,Jl).call(this,{hasSelectedEditor:this.hasSelection});return}bt(this,H).add(L),L.select(),nl(this,jt,_l).call(this,L.propertiesToUpdate),nl(this,ut,Jl).call(this,{hasSelectedEditor:!0})}setSelected(L){for(const ct of bt(this,H))ct!==L&&ct.unselect();bt(this,H).clear(),bt(this,H).add(L),L.select(),nl(this,jt,_l).call(this,L.propertiesToUpdate),nl(this,ut,Jl).call(this,{hasSelectedEditor:!0})}isSelected(L){return bt(this,H).has(L)}unselect(L){L.unselect(),bt(this,H).delete(L),nl(this,ut,Jl).call(this,{hasSelectedEditor:this.hasSelection})}get hasSelection(){return bt(this,H).size!==0}undo(){bt(this,zt).undo(),nl(this,ut,Jl).call(this,{hasSomethingToUndo:bt(this,zt).hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:nl(this,Qt,ql).call(this)})}redo(){bt(this,zt).redo(),nl(this,ut,Jl).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:bt(this,zt).hasSomethingToRedo(),isEmpty:nl(this,Qt,ql).call(this)})}addCommands(L){bt(this,zt).add(L),nl(this,ut,Jl).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:nl(this,Qt,ql).call(this)})}delete(){if(this.commitOrRemove(),!this.hasSelection)return;const L=[...bt(this,H)],ct=()=>{for(const Yt of L)Yt.remove()},Wt=()=>{for(const Yt of L)nl(this,el,xe).call(this,Yt)};this.addCommands({cmd:ct,undo:Wt,mustExec:!0})}commitOrRemove(){var L;(L=bt(this,dt))==null||L.commitOrRemove()}hasSomethingToControl(){return bt(this,dt)||this.hasSelection}selectAll(){for(const L of bt(this,H))L.commit();nl(this,hl,ke).call(this,bt(this,It).values())}unselectAll(){if(bt(this,dt)){bt(this,dt).commitOrRemove();return}if(this.hasSelection){for(const L of bt(this,H))L.unselect();bt(this,H).clear(),nl(this,ut,Jl).call(this,{hasSelectedEditor:!1})}}translateSelectedEditors(L,ct,Wt=!1){if(Wt||this.commitOrRemove(),!this.hasSelection)return;bt(this,Bt)[0]+=L,bt(this,Bt)[1]+=ct;const[Yt,kt]=bt(this,Bt),Et=[...bt(this,H)],sl=1e3;bt(this,Ft)&&clearTimeout(bt(this,Ft)),ul(this,Ft,setTimeout(()=>{ul(this,Ft,null),bt(this,Bt)[0]=bt(this,Bt)[1]=0,this.addCommands({cmd:()=>{for(const ml of Et)bt(this,It).has(ml.id)&&ml.translateInPage(Yt,kt)},undo:()=>{for(const ml of Et)bt(this,It).has(ml.id)&&ml.translateInPage(-Yt,-kt)},mustExec:!1})},sl));for(const ml of Et)ml.translateInPage(L,ct)}setUpDragSession(){if(this.hasSelection){this.disableUserSelect(!0),ul(this,Ut,new Map);for(const L of bt(this,H))bt(this,Ut).set(L,{savedX:L.x,savedY:L.y,savedPageIndex:L.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!bt(this,Ut))return!1;this.disableUserSelect(!1);const L=bt(this,Ut);ul(this,Ut,null);let ct=!1;for(const[{x:Yt,y:kt,pageIndex:Et},sl]of L)sl.newX=Yt,sl.newY=kt,sl.newPageIndex=Et,ct||(ct=Yt!==sl.savedX||kt!==sl.savedY||Et!==sl.savedPageIndex);if(!ct)return!1;const Wt=(Yt,kt,Et,sl)=>{if(bt(this,It).has(Yt.id)){const ml=bt(this,xt).get(sl);ml?Yt._setParentAndPosition(ml,kt,Et):(Yt.pageIndex=sl,Yt.x=kt,Yt.y=Et)}};return this.addCommands({cmd:()=>{for(const[Yt,{newX:kt,newY:Et,newPageIndex:sl}]of L)Wt(Yt,kt,Et,sl)},undo:()=>{for(const[Yt,{savedX:kt,savedY:Et,savedPageIndex:sl}]of L)Wt(Yt,kt,Et,sl)},mustExec:!0}),!0}dragSelectedEditors(L,ct){if(bt(this,Ut))for(const Wt of bt(this,Ut).keys())Wt.drag(L,ct)}rebuild(L){if(L.parent===null){const ct=this.getLayer(L.pageIndex);ct?(ct.changeParent(L),ct.addOrRebuild(L)):(this.addEditor(L),this.addToAnnotationStorage(L),L.rebuild())}else L.parent.addOrRebuild(L)}isActive(L){return bt(this,dt)===L}getActive(){return bt(this,dt)}getMode(){return bt(this,C)}get imageManager(){return(0,M.shadow)(this,"imageManager",new O)}};dt=new WeakMap,It=new WeakMap,xt=new WeakMap,it=new WeakMap,Xt=new WeakMap,zt=new WeakMap,Gt=new WeakMap,Nt=new WeakMap,Ut=new WeakMap,Vt=new WeakMap,Ht=new WeakMap,Pt=new WeakMap,at=new WeakMap,R=new WeakMap,w=new WeakMap,X=new WeakMap,C=new WeakMap,H=new WeakMap,st=new WeakMap,et=new WeakMap,Mt=new WeakMap,Rt=new WeakMap,gt=new WeakMap,Jt=new WeakMap,Dt=new WeakMap,qt=new WeakMap,vt=new WeakMap,cl=new WeakMap,bl=new WeakMap,il=new WeakMap,Bt=new WeakMap,Ft=new WeakMap,wt=new WeakMap,pt=new WeakMap,Ct=new WeakSet,Zs=function(){window.addEventListener("focus",bt(this,Mt)),window.addEventListener("blur",bt(this,et))},dl=new WeakSet,ze=function(){window.removeEventListener("focus",bt(this,Mt)),window.removeEventListener("blur",bt(this,et))},Yl=new WeakSet,Re=function(){window.addEventListener("keydown",bt(this,Dt),{capture:!0})},pl=new WeakSet,ae=function(){window.removeEventListener("keydown",bt(this,Dt),{capture:!0})},yl=new WeakSet,Se=function(){document.addEventListener("copy",bt(this,Rt)),document.addEventListener("cut",bt(this,gt)),document.addEventListener("paste",bt(this,Jt))},_t=new WeakSet,we=function(){document.removeEventListener("copy",bt(this,Rt)),document.removeEventListener("cut",bt(this,gt)),document.removeEventListener("paste",bt(this,Jt))},ut=new WeakSet,Jl=function(L){Object.entries(L).some(([Wt,Yt])=>bt(this,il)[Wt]!==Yt)&&this._eventBus.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(bt(this,il),L)})},jt=new WeakSet,_l=function(L){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:L})},Lt=new WeakSet,hs=function(){if(!bt(this,R)){ul(this,R,!0);for(const L of bt(this,xt).values())L.enable()}},Kt=new WeakSet,bs=function(){if(this.unselectAll(),bt(this,R)){ul(this,R,!1);for(const L of bt(this,xt).values())L.disable()}},el=new WeakSet,xe=function(L){const ct=bt(this,xt).get(L.pageIndex);ct?ct.addOrRebuild(L):this.addEditor(L)},Qt=new WeakSet,ql=function(){if(bt(this,It).size===0)return!0;if(bt(this,It).size===1)for(const L of bt(this,It).values())return L.isEmpty();return!1},hl=new WeakSet,ke=function(L){bt(this,H).clear();for(const ct of L)ct.isEmpty()||(bt(this,H).add(ct),ct.select());nl(this,ut,Jl).call(this,{hasSelectedEditor:!0})},gl(Wl,"TRANSLATE_SMALL",1),gl(Wl,"TRANSLATE_BIG",10);let K=Wl;r.AnnotationEditorUIManager=K},(lt,r,h)=>{var Gt,Nt,Ut,Vt,Ht,Pt,at,R,w,X,C,H,Pl,et,Hl,Rt,ge,Jt,ne,qt,Ze,cl,$l,il,te;Object.defineProperty(r,"__esModule",{value:!0}),r.StatTimer=r.RenderingCancelledException=r.PixelsPerInch=r.PageViewport=r.PDFDateString=r.DOMStandardFontDataFactory=r.DOMSVGFactory=r.DOMFilterFactory=r.DOMCanvasFactory=r.DOMCMapReaderFactory=void 0,r.deprecated=_,r.getColorValues=It,r.getCurrentTransform=xt,r.getCurrentTransformInverse=it,r.getFilenameFromUrl=g,r.getPdfFilenameFromUrl=F,r.getRGB=dt,r.getXfaPageViewport=Zt,r.isDataScheme=k,r.isPdfFile=T,r.isValidFetchUrl=v,r.loadScript=m,r.noContextMenu=u,r.setLayerDimensions=Xt;var M=h(7),p=h(1);const B="http://www.w3.org/2000/svg",zt=class zt{};gl(zt,"CSS",96),gl(zt,"PDF",72),gl(zt,"PDF_TO_CSS_UNITS",zt.CSS/zt.PDF);let Q=zt;r.PixelsPerInch=Q;class U extends M.BaseFilterFactory{constructor({docId:pt,ownerDocument:Ct=globalThis.document}={}){super();ll(this,H);ll(this,et);ll(this,Rt);ll(this,Jt);ll(this,qt);ll(this,cl);ll(this,il);ll(this,Gt,void 0);ll(this,Nt,void 0);ll(this,Ut,void 0);ll(this,Vt,void 0);ll(this,Ht,void 0);ll(this,Pt,void 0);ll(this,at,void 0);ll(this,R,void 0);ll(this,w,void 0);ll(this,X,void 0);ll(this,C,0);ul(this,Ut,pt),ul(this,Vt,Ct)}addFilter(pt){if(!pt)return"none";let Ct=bt(this,H,Pl).get(pt);if(Ct)return Ct;let $t,dl,rl,Yl;if(pt.length===1){const yl=pt[0],Vl=new Array(256);for(let _t=0;_t<256;_t++)Vl[_t]=yl[_t]/255;Yl=$t=dl=rl=Vl.join(",")}else{const[yl,Vl,_t]=pt,ot=new Array(256),ut=new Array(256),Tt=new Array(256);for(let jt=0;jt<256;jt++)ot[jt]=yl[jt]/255,ut[jt]=Vl[jt]/255,Tt[jt]=_t[jt]/255;$t=ot.join(","),dl=ut.join(","),rl=Tt.join(","),Yl=`${$t}${dl}${rl}`}if(Ct=bt(this,H,Pl).get(Yl),Ct)return bt(this,H,Pl).set(pt,Ct),Ct;const Xl=`g_${bt(this,Ut)}_transfer_map_${Al(this,C)._++}`,pl=`url(#${Xl})`;bt(this,H,Pl).set(pt,pl),bt(this,H,Pl).set(Yl,pl);const Ll=nl(this,Jt,ne).call(this,Xl);return nl(this,cl,$l).call(this,$t,dl,rl,Ll),pl}addHCMFilter(pt,Ct){var Vl;const $t=`${pt}-${Ct}`;if(bt(this,Pt)===$t)return bt(this,at);if(ul(this,Pt,$t),ul(this,at,"none"),(Vl=bt(this,Ht))==null||Vl.remove(),!pt||!Ct)return bt(this,at);const dl=nl(this,il,te).call(this,pt);pt=p.Util.makeHexColor(...dl);const rl=nl(this,il,te).call(this,Ct);if(Ct=p.Util.makeHexColor(...rl),bt(this,et,Hl).style.color="",pt==="#000000"&&Ct==="#ffffff"||pt===Ct)return bt(this,at);const Yl=new Array(256);for(let _t=0;_t<=255;_t++){const ot=_t/255;Yl[_t]=ot<=.03928?ot/12.92:((ot+.055)/1.055)**2.4}const Xl=Yl.join(","),pl=`g_${bt(this,Ut)}_hcm_filter`,Ll=ul(this,R,nl(this,Jt,ne).call(this,pl));nl(this,cl,$l).call(this,Xl,Xl,Xl,Ll),nl(this,Rt,ge).call(this,Ll);const yl=(_t,ot)=>{const ut=dl[_t]/255,Tt=rl[_t]/255,jt=new Array(ot+1);for(let Ot=0;Ot<=ot;Ot++)jt[Ot]=ut+Ot/ot*(Tt-ut);return jt.join(",")};return nl(this,cl,$l).call(this,yl(0,5),yl(1,5),yl(2,5),Ll),ul(this,at,`url(#${pl})`),bt(this,at)}addHighlightHCMFilter(pt,Ct,$t,dl){var Tt;const rl=`${pt}-${Ct}-${$t}-${dl}`;if(bt(this,w)===rl)return bt(this,X);if(ul(this,w,rl),ul(this,X,"none"),(Tt=bt(this,R))==null||Tt.remove(),!pt||!Ct)return bt(this,X);const[Yl,Xl]=[pt,Ct].map(nl(this,il,te).bind(this));let pl=Math.round(.2126*Yl[0]+.7152*Yl[1]+.0722*Yl[2]),Ll=Math.round(.2126*Xl[0]+.7152*Xl[1]+.0722*Xl[2]),[yl,Vl]=[$t,dl].map(nl(this,il,te).bind(this));Ll<pl&&([pl,Ll,yl,Vl]=[Ll,pl,Vl,yl]),bt(this,et,Hl).style.color="";const _t=(jt,Ot,Lt)=>{const yt=new Array(256),Kt=(Ll-pl)/Lt,tl=jt/255,el=(Ot-jt)/(255*Lt);let ol=0;for(let Qt=0;Qt<=Lt;Qt++){const Ml=Math.round(pl+Qt*Kt),hl=tl+Qt*el;for(let Il=ol;Il<=Ml;Il++)yt[Il]=hl;ol=Ml+1}for(let Qt=ol;Qt<256;Qt++)yt[Qt]=yt[ol-1];return yt.join(",")},ot=`g_${bt(this,Ut)}_hcm_highlight_filter`,ut=ul(this,R,nl(this,Jt,ne).call(this,ot));return nl(this,Rt,ge).call(this,ut),nl(this,cl,$l).call(this,_t(yl[0],Vl[0],5),_t(yl[1],Vl[1],5),_t(yl[2],Vl[2],5),ut),ul(this,X,`url(#${ot})`),bt(this,X)}destroy(pt=!1){pt&&(bt(this,at)||bt(this,X))||(bt(this,Nt)&&(bt(this,Nt).parentNode.parentNode.remove(),ul(this,Nt,null)),bt(this,Gt)&&(bt(this,Gt).clear(),ul(this,Gt,null)),ul(this,C,0))}}Gt=new WeakMap,Nt=new WeakMap,Ut=new WeakMap,Vt=new WeakMap,Ht=new WeakMap,Pt=new WeakMap,at=new WeakMap,R=new WeakMap,w=new WeakMap,X=new WeakMap,C=new WeakMap,H=new WeakSet,Pl=function(){return bt(this,Gt)||ul(this,Gt,new Map)},et=new WeakSet,Hl=function(){if(!bt(this,Nt)){const pt=bt(this,Vt).createElement("div"),{style:Ct}=pt;Ct.visibility="hidden",Ct.contain="strict",Ct.width=Ct.height=0,Ct.position="absolute",Ct.top=Ct.left=0,Ct.zIndex=-1;const $t=bt(this,Vt).createElementNS(B,"svg");$t.setAttribute("width",0),$t.setAttribute("height",0),ul(this,Nt,bt(this,Vt).createElementNS(B,"defs")),pt.append($t),$t.append(bt(this,Nt)),bt(this,Vt).body.append(pt)}return bt(this,Nt)},Rt=new WeakSet,ge=function(pt){const Ct=bt(this,Vt).createElementNS(B,"feColorMatrix");Ct.setAttribute("type","matrix"),Ct.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"),pt.append(Ct)},Jt=new WeakSet,ne=function(pt){const Ct=bt(this,Vt).createElementNS(B,"filter");return Ct.setAttribute("color-interpolation-filters","sRGB"),Ct.setAttribute("id",pt),bt(this,et,Hl).append(Ct),Ct},qt=new WeakSet,Ze=function(pt,Ct,$t){const dl=bt(this,Vt).createElementNS(B,Ct);dl.setAttribute("type","discrete"),dl.setAttribute("tableValues",$t),pt.append(dl)},cl=new WeakSet,$l=function(pt,Ct,$t,dl){const rl=bt(this,Vt).createElementNS(B,"feComponentTransfer");dl.append(rl),nl(this,qt,Ze).call(this,rl,"feFuncR",pt),nl(this,qt,Ze).call(this,rl,"feFuncG",Ct),nl(this,qt,Ze).call(this,rl,"feFuncB",$t)},il=new WeakSet,te=function(pt){return bt(this,et,Hl).style.color=pt,dt(getComputedStyle(bt(this,et,Hl)).getPropertyValue("color"))},r.DOMFilterFactory=U;class O extends M.BaseCanvasFactory{constructor({ownerDocument:wt=globalThis.document}={}){super(),this._document=wt}_createCanvas(wt,pt){const Ct=this._document.createElement("canvas");return Ct.width=wt,Ct.height=pt,Ct}}r.DOMCanvasFactory=O;async function I(Ft,wt=!1){if(v(Ft,document.baseURI)){const pt=await fetch(Ft);if(!pt.ok)throw new Error(pt.statusText);return wt?new Uint8Array(await pt.arrayBuffer()):(0,p.stringToBytes)(await pt.text())}return new Promise((pt,Ct)=>{const $t=new XMLHttpRequest;$t.open("GET",Ft,!0),wt&&($t.responseType="arraybuffer"),$t.onreadystatechange=()=>{if($t.readyState===XMLHttpRequest.DONE){if($t.status===200||$t.status===0){let dl;if(wt&&$t.response?dl=new Uint8Array($t.response):!wt&&$t.responseText&&(dl=(0,p.stringToBytes)($t.responseText)),dl){pt(dl);return}}Ct(new Error($t.statusText))}},$t.send(null)})}class j extends M.BaseCMapReaderFactory{_fetchData(wt,pt){return I(wt,this.isCompressed).then(Ct=>({cMapData:Ct,compressionType:pt}))}}r.DOMCMapReaderFactory=j;class q extends M.BaseStandardFontDataFactory{_fetchData(wt){return I(wt,!0)}}r.DOMStandardFontDataFactory=q;class K extends M.BaseSVGFactory{_createSVG(wt){return document.createElementNS(B,wt)}}r.DOMSVGFactory=K;class f{constructor({viewBox:wt,scale:pt,rotation:Ct,offsetX:$t=0,offsetY:dl=0,dontFlip:rl=!1}){this.viewBox=wt,this.scale=pt,this.rotation=Ct,this.offsetX=$t,this.offsetY=dl;const Yl=(wt[2]+wt[0])/2,Xl=(wt[3]+wt[1])/2;let pl,Ll,yl,Vl;switch(Ct%=360,Ct<0&&(Ct+=360),Ct){case 180:pl=-1,Ll=0,yl=0,Vl=1;break;case 90:pl=0,Ll=1,yl=1,Vl=0;break;case 270:pl=0,Ll=-1,yl=-1,Vl=0;break;case 0:pl=1,Ll=0,yl=0,Vl=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}rl&&(yl=-yl,Vl=-Vl);let _t,ot,ut,Tt;pl===0?(_t=Math.abs(Xl-wt[1])*pt+$t,ot=Math.abs(Yl-wt[0])*pt+dl,ut=(wt[3]-wt[1])*pt,Tt=(wt[2]-wt[0])*pt):(_t=Math.abs(Yl-wt[0])*pt+$t,ot=Math.abs(Xl-wt[1])*pt+dl,ut=(wt[2]-wt[0])*pt,Tt=(wt[3]-wt[1])*pt),this.transform=[pl*pt,Ll*pt,yl*pt,Vl*pt,_t-pl*pt*Yl-yl*pt*Xl,ot-Ll*pt*Yl-Vl*pt*Xl],this.width=ut,this.height=Tt}get rawDims(){const{viewBox:wt}=this;return(0,p.shadow)(this,"rawDims",{pageWidth:wt[2]-wt[0],pageHeight:wt[3]-wt[1],pageX:wt[0],pageY:wt[1]})}clone({scale:wt=this.scale,rotation:pt=this.rotation,offsetX:Ct=this.offsetX,offsetY:$t=this.offsetY,dontFlip:dl=!1}={}){return new f({viewBox:this.viewBox.slice(),scale:wt,rotation:pt,offsetX:Ct,offsetY:$t,dontFlip:dl})}convertToViewportPoint(wt,pt){return p.Util.applyTransform([wt,pt],this.transform)}convertToViewportRectangle(wt){const pt=p.Util.applyTransform([wt[0],wt[1]],this.transform),Ct=p.Util.applyTransform([wt[2],wt[3]],this.transform);return[pt[0],pt[1],Ct[0],Ct[1]]}convertToPdfPoint(wt,pt){return p.Util.applyInverseTransform([wt,pt],this.transform)}}r.PageViewport=f;class S extends p.BaseException{constructor(wt,pt=0){super(wt,"RenderingCancelledException"),this.extraDelay=pt}}r.RenderingCancelledException=S;function k(Ft){const wt=Ft.length;let pt=0;for(;pt<wt&&Ft[pt].trim()==="";)pt++;return Ft.substring(pt,pt+5).toLowerCase()==="data:"}function T(Ft){return typeof Ft=="string"&&/\.pdf$/i.test(Ft)}function g(Ft,wt=!1){return wt||([Ft]=Ft.split(/[#?]/,1)),Ft.substring(Ft.lastIndexOf("/")+1)}function F(Ft,wt="document.pdf"){if(typeof Ft!="string")return wt;if(k(Ft))return(0,p.warn)('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),wt;const pt=/^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/,Ct=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i,$t=pt.exec(Ft);let dl=Ct.exec($t[1])||Ct.exec($t[2])||Ct.exec($t[3]);if(dl&&(dl=dl[0],dl.includes("%")))try{dl=Ct.exec(decodeURIComponent(dl))[0]}catch{}return dl||wt}class J{constructor(){gl(this,"started",Object.create(null));gl(this,"times",[])}time(wt){wt in this.started&&(0,p.warn)(`Timer is already running for ${wt}`),this.started[wt]=Date.now()}timeEnd(wt){wt in this.started||(0,p.warn)(`Timer has not been started for ${wt}`),this.times.push({name:wt,start:this.started[wt],end:Date.now()}),delete this.started[wt]}toString(){const wt=[];let pt=0;for(const{name:Ct}of this.times)pt=Math.max(Ct.length,pt);for(const{name:Ct,start:$t,end:dl}of this.times)wt.push(`${Ct.padEnd(pt)} ${dl-$t}ms
|
|
2
2
|
`);return wt.join("")}}r.StatTimer=J;function v(Ft,wt){try{const{protocol:pt}=wt?new URL(Ft,wt):new URL(Ft);return pt==="http:"||pt==="https:"}catch{return!1}}function u(Ft){Ft.preventDefault()}function m(Ft,wt=!1){return new Promise((pt,Ct)=>{const $t=document.createElement("script");$t.src=Ft,$t.onload=function(dl){wt&&$t.remove(),pt(dl)},$t.onerror=function(){Ct(new Error(`Cannot load script at: ${$t.src}`))},(document.head||document.documentElement).append($t)})}function _(Ft){console.log("Deprecated API usage: "+Ft)}let $;class P{static toDateObject(wt){if(!wt||typeof wt!="string")return null;$||($=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"));const pt=$.exec(wt);if(!pt)return null;const Ct=parseInt(pt[1],10);let $t=parseInt(pt[2],10);$t=$t>=1&&$t<=12?$t-1:0;let dl=parseInt(pt[3],10);dl=dl>=1&&dl<=31?dl:1;let rl=parseInt(pt[4],10);rl=rl>=0&&rl<=23?rl:0;let Yl=parseInt(pt[5],10);Yl=Yl>=0&&Yl<=59?Yl:0;let Xl=parseInt(pt[6],10);Xl=Xl>=0&&Xl<=59?Xl:0;const pl=pt[7]||"Z";let Ll=parseInt(pt[8],10);Ll=Ll>=0&&Ll<=23?Ll:0;let yl=parseInt(pt[9],10)||0;return yl=yl>=0&&yl<=59?yl:0,pl==="-"?(rl+=Ll,Yl+=yl):pl==="+"&&(rl-=Ll,Yl-=yl),new Date(Date.UTC(Ct,$t,dl,rl,Yl,Xl))}}r.PDFDateString=P;function Zt(Ft,{scale:wt=1,rotation:pt=0}){const{width:Ct,height:$t}=Ft.attributes.style,dl=[0,0,parseInt(Ct),parseInt($t)];return new f({viewBox:dl,scale:wt,rotation:pt})}function dt(Ft){if(Ft.startsWith("#")){const wt=parseInt(Ft.slice(1),16);return[(wt&16711680)>>16,(wt&65280)>>8,wt&255]}return Ft.startsWith("rgb(")?Ft.slice(4,-1).split(",").map(wt=>parseInt(wt)):Ft.startsWith("rgba(")?Ft.slice(5,-1).split(",").map(wt=>parseInt(wt)).slice(0,3):((0,p.warn)(`Not a valid color format: "${Ft}"`),[0,0,0])}function It(Ft){const wt=document.createElement("span");wt.style.visibility="hidden",document.body.append(wt);for(const pt of Ft.keys()){wt.style.color=pt;const Ct=window.getComputedStyle(wt).color;Ft.set(pt,dt(Ct))}wt.remove()}function xt(Ft){const{a:wt,b:pt,c:Ct,d:$t,e:dl,f:rl}=Ft.getTransform();return[wt,pt,Ct,$t,dl,rl]}function it(Ft){const{a:wt,b:pt,c:Ct,d:$t,e:dl,f:rl}=Ft.getTransform().invertSelf();return[wt,pt,Ct,$t,dl,rl]}function Xt(Ft,wt,pt=!1,Ct=!0){if(wt instanceof f){const{pageWidth:$t,pageHeight:dl}=wt.rawDims,{style:rl}=Ft,Yl=p.FeatureTest.isCSSRoundSupported,Xl=`var(--scale-factor) * ${$t}px`,pl=`var(--scale-factor) * ${dl}px`,Ll=Yl?`round(${Xl}, 1px)`:`calc(${Xl})`,yl=Yl?`round(${pl}, 1px)`:`calc(${pl})`;!pt||wt.rotation%180===0?(rl.width=Ll,rl.height=yl):(rl.width=yl,rl.height=Ll)}Ct&&Ft.setAttribute("data-main-rotation",wt.rotation)}},(lt,r,h)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BaseStandardFontDataFactory=r.BaseSVGFactory=r.BaseFilterFactory=r.BaseCanvasFactory=r.BaseCMapReaderFactory=void 0;var M=h(1);class p{constructor(){this.constructor===p&&(0,M.unreachable)("Cannot initialize BaseFilterFactory.")}addFilter(j){return"none"}addHCMFilter(j,q){return"none"}addHighlightHCMFilter(j,q,K,f){return"none"}destroy(j=!1){}}r.BaseFilterFactory=p;class B{constructor(){this.constructor===B&&(0,M.unreachable)("Cannot initialize BaseCanvasFactory.")}create(j,q){if(j<=0||q<=0)throw new Error("Invalid canvas size");const K=this._createCanvas(j,q);return{canvas:K,context:K.getContext("2d")}}reset(j,q,K){if(!j.canvas)throw new Error("Canvas is not specified");if(q<=0||K<=0)throw new Error("Invalid canvas size");j.canvas.width=q,j.canvas.height=K}destroy(j){if(!j.canvas)throw new Error("Canvas is not specified");j.canvas.width=0,j.canvas.height=0,j.canvas=null,j.context=null}_createCanvas(j,q){(0,M.unreachable)("Abstract method `_createCanvas` called.")}}r.BaseCanvasFactory=B;class Q{constructor({baseUrl:j=null,isCompressed:q=!0}){this.constructor===Q&&(0,M.unreachable)("Cannot initialize BaseCMapReaderFactory."),this.baseUrl=j,this.isCompressed=q}async fetch({name:j}){if(!this.baseUrl)throw new Error('The CMap "baseUrl" parameter must be specified, ensure that the "cMapUrl" and "cMapPacked" API parameters are provided.');if(!j)throw new Error("CMap name must be specified.");const q=this.baseUrl+j+(this.isCompressed?".bcmap":""),K=this.isCompressed?M.CMapCompressionType.BINARY:M.CMapCompressionType.NONE;return this._fetchData(q,K).catch(f=>{throw new Error(`Unable to load ${this.isCompressed?"binary ":""}CMap at: ${q}`)})}_fetchData(j,q){(0,M.unreachable)("Abstract method `_fetchData` called.")}}r.BaseCMapReaderFactory=Q;class U{constructor({baseUrl:j=null}){this.constructor===U&&(0,M.unreachable)("Cannot initialize BaseStandardFontDataFactory."),this.baseUrl=j}async fetch({filename:j}){if(!this.baseUrl)throw new Error('The standard font "baseUrl" parameter must be specified, ensure that the "standardFontDataUrl" API parameter is provided.');if(!j)throw new Error("Font filename must be specified.");const q=`${this.baseUrl}${j}`;return this._fetchData(q).catch(K=>{throw new Error(`Unable to load font data at: ${q}`)})}_fetchData(j){(0,M.unreachable)("Abstract method `_fetchData` called.")}}r.BaseStandardFontDataFactory=U;class O{constructor(){this.constructor===O&&(0,M.unreachable)("Cannot initialize BaseSVGFactory.")}create(j,q,K=!1){if(j<=0||q<=0)throw new Error("Invalid SVG dimensions");const f=this._createSVG("svg:svg");return f.setAttribute("version","1.1"),K||(f.setAttribute("width",`${j}px`),f.setAttribute("height",`${q}px`)),f.setAttribute("preserveAspectRatio","none"),f.setAttribute("viewBox",`0 0 ${j} ${q}`),f}createElement(j){if(typeof j!="string")throw new Error("Invalid SVG element type");return this._createSVG(j)}_createSVG(j){(0,M.unreachable)("Abstract method `_createSVG` called.")}}r.BaseSVGFactory=O},(lt,r,h)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.MurmurHash3_64=void 0;var M=h(1);const p=3285377520,B=4294901760,Q=65535;class U{constructor(I){this.h1=I?I&4294967295:p,this.h2=I?I&4294967295:p}update(I){let j,q;if(typeof I=="string"){j=new Uint8Array(I.length*2),q=0;for(let _=0,$=I.length;_<$;_++){const P=I.charCodeAt(_);P<=255?j[q++]=P:(j[q++]=P>>>8,j[q++]=P&255)}}else if((0,M.isArrayBuffer)(I))j=I.slice(),q=j.byteLength;else throw new Error("Wrong data format in MurmurHash3_64_update. Input must be a string or array.");const K=q>>2,f=q-K*4,S=new Uint32Array(j.buffer,0,K);let k=0,T=0,g=this.h1,F=this.h2;const J=3432918353,v=461845907,u=J&Q,m=v&Q;for(let _=0;_<K;_++)_&1?(k=S[_],k=k*J&B|k*u&Q,k=k<<15|k>>>17,k=k*v&B|k*m&Q,g^=k,g=g<<13|g>>>19,g=g*5+3864292196):(T=S[_],T=T*J&B|T*u&Q,T=T<<15|T>>>17,T=T*v&B|T*m&Q,F^=T,F=F<<13|F>>>19,F=F*5+3864292196);switch(k=0,f){case 3:k^=j[K*4+2]<<16;case 2:k^=j[K*4+1]<<8;case 1:k^=j[K*4],k=k*J&B|k*u&Q,k=k<<15|k>>>17,k=k*v&B|k*m&Q,K&1?g^=k:F^=k}this.h1=g,this.h2=F}hexdigest(){let I=this.h1,j=this.h2;return I^=j>>>1,I=I*3981806797&B|I*36045&Q,j=j*4283543511&B|((j<<16|I>>>16)*2950163797&B)>>>16,I^=j>>>1,I=I*444984403&B|I*60499&Q,j=j*3301882366&B|((j<<16|I>>>16)*3120437893&B)>>>16,I^=j>>>1,(I>>>0).toString(16).padStart(8,"0")+(j>>>0).toString(16).padStart(8,"0")}}r.MurmurHash3_64=U},(lt,r,h)=>{var Q;Object.defineProperty(r,"__esModule",{value:!0}),r.FontLoader=r.FontFaceObject=void 0;var M=h(1);class p{constructor({ownerDocument:O=globalThis.document,styleElement:I=null}){ll(this,Q,new Set);this._document=O,this.nativeFontFaces=new Set,this.styleElement=null,this.loadingRequests=[],this.loadTestFontId=0}addNativeFontFace(O){this.nativeFontFaces.add(O),this._document.fonts.add(O)}removeNativeFontFace(O){this.nativeFontFaces.delete(O),this._document.fonts.delete(O)}insertRule(O){this.styleElement||(this.styleElement=this._document.createElement("style"),this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement));const I=this.styleElement.sheet;I.insertRule(O,I.cssRules.length)}clear(){for(const O of this.nativeFontFaces)this._document.fonts.delete(O);this.nativeFontFaces.clear(),bt(this,Q).clear(),this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async loadSystemFont(O){if(!(!O||bt(this,Q).has(O.loadedName))){if((0,M.assert)(!this.disableFontFace,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){const{loadedName:I,src:j,style:q}=O,K=new FontFace(I,j,q);this.addNativeFontFace(K);try{await K.load(),bt(this,Q).add(I)}catch{(0,M.warn)(`Cannot load system font: ${O.baseFontName}, installing it could help to improve PDF rendering.`),this.removeNativeFontFace(K)}return}(0,M.unreachable)("Not implemented: loadSystemFont without the Font Loading API.")}}async bind(O){if(O.attached||O.missingFile&&!O.systemFontInfo)return;if(O.attached=!0,O.systemFontInfo){await this.loadSystemFont(O.systemFontInfo);return}if(this.isFontLoadingAPISupported){const j=O.createNativeFontFace();if(j){this.addNativeFontFace(j);try{await j.loaded}catch(q){throw(0,M.warn)(`Failed to load font '${j.family}': '${q}'.`),O.disableFontFace=!0,q}}return}const I=O.createFontFaceRule();if(I){if(this.insertRule(I),this.isSyncFontLoadingSupported)return;await new Promise(j=>{const q=this._queueLoadingCallback(j);this._prepareFontLoadEvent(O,q)})}}get isFontLoadingAPISupported(){var I;const O=!!((I=this._document)!=null&&I.fonts);return(0,M.shadow)(this,"isFontLoadingAPISupported",O)}get isSyncFontLoadingSupported(){let O=!1;return(M.isNodeJS||typeof navigator<"u"&&/Mozilla\/5.0.*?rv:\d+.*? Gecko/.test(navigator.userAgent))&&(O=!0),(0,M.shadow)(this,"isSyncFontLoadingSupported",O)}_queueLoadingCallback(O){function I(){for((0,M.assert)(!q.done,"completeRequest() cannot be called twice."),q.done=!0;j.length>0&&j[0].done;){const K=j.shift();setTimeout(K.callback,0)}}const{loadingRequests:j}=this,q={done:!1,complete:I,callback:O};return j.push(q),q}get _loadTestFont(){const O=atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==");return(0,M.shadow)(this,"_loadTestFont",O)}_prepareFontLoadEvent(O,I){function j(dt,It){return dt.charCodeAt(It)<<24|dt.charCodeAt(It+1)<<16|dt.charCodeAt(It+2)<<8|dt.charCodeAt(It+3)&255}function q(dt,It,xt,it){const Xt=dt.substring(0,It),zt=dt.substring(It+xt);return Xt+it+zt}let K,f;const S=this._document.createElement("canvas");S.width=1,S.height=1;const k=S.getContext("2d");let T=0;function g(dt,It){if(++T>30){(0,M.warn)("Load test font never loaded."),It();return}if(k.font="30px "+dt,k.fillText(".",0,20),k.getImageData(0,0,1,1).data[3]>0){It();return}setTimeout(g.bind(null,dt,It))}const F=`lt${Date.now()}${this.loadTestFontId++}`;let J=this._loadTestFont;J=q(J,976,F.length,F);const u=16,m=1482184792;let _=j(J,u);for(K=0,f=F.length-3;K<f;K+=4)_=_-m+j(F,K)|0;K<F.length&&(_=_-m+j(F+"XXX",K)|0),J=q(J,u,4,(0,M.string32)(_));const $=`url(data:font/opentype;base64,${btoa(J)});`,P=`@font-face {font-family:"${F}";src:${$}}`;this.insertRule(P);const Zt=this._document.createElement("div");Zt.style.visibility="hidden",Zt.style.width=Zt.style.height="10px",Zt.style.position="absolute",Zt.style.top=Zt.style.left="0px";for(const dt of[O.loadedName,F]){const It=this._document.createElement("span");It.textContent="Hi",It.style.fontFamily=dt,Zt.append(It)}this._document.body.append(Zt),g(F,()=>{Zt.remove(),I.complete()})}}Q=new WeakMap,r.FontLoader=p;class B{constructor(O,{isEvalSupported:I=!0,disableFontFace:j=!1,ignoreErrors:q=!1,inspectFont:K=null}){this.compiledGlyphs=Object.create(null);for(const f in O)this[f]=O[f];this.isEvalSupported=I!==!1,this.disableFontFace=j===!0,this.ignoreErrors=q===!0,this._inspectFont=K}createNativeFontFace(){var I;if(!this.data||this.disableFontFace)return null;let O;if(!this.cssFontInfo)O=new FontFace(this.loadedName,this.data,{});else{const j={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(j.style=`oblique ${this.cssFontInfo.italicAngle}deg`),O=new FontFace(this.cssFontInfo.fontFamily,this.data,j)}return(I=this._inspectFont)==null||I.call(this,this),O}createFontFaceRule(){var q;if(!this.data||this.disableFontFace)return null;const O=(0,M.bytesToString)(this.data),I=`url(data:${this.mimetype};base64,${btoa(O)});`;let j;if(!this.cssFontInfo)j=`@font-face {font-family:"${this.loadedName}";src:${I}}`;else{let K=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(K+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`),j=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${K}src:${I}}`}return(q=this._inspectFont)==null||q.call(this,this,I),j}getPathGenerator(O,I){if(this.compiledGlyphs[I]!==void 0)return this.compiledGlyphs[I];let j;try{j=O.get(this.loadedName+"_path_"+I)}catch(q){if(!this.ignoreErrors)throw q;return(0,M.warn)(`getPathGenerator - ignoring character: "${q}".`),this.compiledGlyphs[I]=function(K,f){}}if(this.isEvalSupported&&M.FeatureTest.isEvalSupported){const q=[];for(const K of j){const f=K.args!==void 0?K.args.join(","):"";q.push("c.",K.cmd,"(",f,`);
|
|
3
3
|
`)}return this.compiledGlyphs[I]=new Function("c","size",q.join(""))}return this.compiledGlyphs[I]=function(q,K){for(const f of j)f.cmd==="scale"&&(f.args=[K,-K]),q[f.cmd].apply(q,f.args)}}}r.FontFaceObject=B},(lt,r,h)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.NodeStandardFontDataFactory=r.NodeFilterFactory=r.NodeCanvasFactory=r.NodeCMapReaderFactory=void 0;var M=h(7);h(1);const p=function(I){return new Promise((j,q)=>{require$$5.readFile(I,(f,S)=>{if(f||!S){q(new Error(f));return}j(new Uint8Array(S))})})};class B extends M.BaseFilterFactory{}r.NodeFilterFactory=B;class Q extends M.BaseCanvasFactory{_createCanvas(j,q){return require$$5.createCanvas(j,q)}}r.NodeCanvasFactory=Q;class U extends M.BaseCMapReaderFactory{_fetchData(j,q){return p(j).then(K=>({cMapData:K,compressionType:q}))}}r.NodeCMapReaderFactory=U;class O extends M.BaseStandardFontDataFactory{_fetchData(j){return p(j)}}r.NodeStandardFontDataFactory=O},(lt,r,h)=>{var Nt,De,Vt,je;Object.defineProperty(r,"__esModule",{value:!0}),r.CanvasGraphics=void 0;var M=h(1),p=h(6),B=h(12),Q=h(13);const U=16,O=100,I=4096,j=15,q=10,K=1e3,f=16;function S(at,R){if(at._removeMirroring)throw new Error("Context is already forwarding operations.");at.__originalSave=at.save,at.__originalRestore=at.restore,at.__originalRotate=at.rotate,at.__originalScale=at.scale,at.__originalTranslate=at.translate,at.__originalTransform=at.transform,at.__originalSetTransform=at.setTransform,at.__originalResetTransform=at.resetTransform,at.__originalClip=at.clip,at.__originalMoveTo=at.moveTo,at.__originalLineTo=at.lineTo,at.__originalBezierCurveTo=at.bezierCurveTo,at.__originalRect=at.rect,at.__originalClosePath=at.closePath,at.__originalBeginPath=at.beginPath,at._removeMirroring=()=>{at.save=at.__originalSave,at.restore=at.__originalRestore,at.rotate=at.__originalRotate,at.scale=at.__originalScale,at.translate=at.__originalTranslate,at.transform=at.__originalTransform,at.setTransform=at.__originalSetTransform,at.resetTransform=at.__originalResetTransform,at.clip=at.__originalClip,at.moveTo=at.__originalMoveTo,at.lineTo=at.__originalLineTo,at.bezierCurveTo=at.__originalBezierCurveTo,at.rect=at.__originalRect,at.closePath=at.__originalClosePath,at.beginPath=at.__originalBeginPath,delete at._removeMirroring},at.save=function(){R.save(),this.__originalSave()},at.restore=function(){R.restore(),this.__originalRestore()},at.translate=function(X,C){R.translate(X,C),this.__originalTranslate(X,C)},at.scale=function(X,C){R.scale(X,C),this.__originalScale(X,C)},at.transform=function(X,C,H,st,et,Mt){R.transform(X,C,H,st,et,Mt),this.__originalTransform(X,C,H,st,et,Mt)},at.setTransform=function(X,C,H,st,et,Mt){R.setTransform(X,C,H,st,et,Mt),this.__originalSetTransform(X,C,H,st,et,Mt)},at.resetTransform=function(){R.resetTransform(),this.__originalResetTransform()},at.rotate=function(X){R.rotate(X),this.__originalRotate(X)},at.clip=function(X){R.clip(X),this.__originalClip(X)},at.moveTo=function(w,X){R.moveTo(w,X),this.__originalMoveTo(w,X)},at.lineTo=function(w,X){R.lineTo(w,X),this.__originalLineTo(w,X)},at.bezierCurveTo=function(w,X,C,H,st,et){R.bezierCurveTo(w,X,C,H,st,et),this.__originalBezierCurveTo(w,X,C,H,st,et)},at.rect=function(w,X,C,H){R.rect(w,X,C,H),this.__originalRect(w,X,C,H)},at.closePath=function(){R.closePath(),this.__originalClosePath()},at.beginPath=function(){R.beginPath(),this.__originalBeginPath()}}class k{constructor(R){this.canvasFactory=R,this.cache=Object.create(null)}getCanvas(R,w,X){let C;return this.cache[R]!==void 0?(C=this.cache[R],this.canvasFactory.reset(C,w,X)):(C=this.canvasFactory.create(w,X),this.cache[R]=C),C}delete(R){delete this.cache[R]}clear(){for(const R in this.cache){const w=this.cache[R];this.canvasFactory.destroy(w),delete this.cache[R]}}}function T(at,R,w,X,C,H,st,et,Mt,Rt){const[gt,Jt,Dt,qt,vt,cl]=(0,p.getCurrentTransform)(at);if(Jt===0&&Dt===0){const Bt=st*gt+vt,Ft=Math.round(Bt),wt=et*qt+cl,pt=Math.round(wt),Ct=(st+Mt)*gt+vt,$t=Math.abs(Math.round(Ct)-Ft)||1,dl=(et+Rt)*qt+cl,rl=Math.abs(Math.round(dl)-pt)||1;return at.setTransform(Math.sign(gt),0,0,Math.sign(qt),Ft,pt),at.drawImage(R,w,X,C,H,0,0,$t,rl),at.setTransform(gt,Jt,Dt,qt,vt,cl),[$t,rl]}if(gt===0&&qt===0){const Bt=et*Dt+vt,Ft=Math.round(Bt),wt=st*Jt+cl,pt=Math.round(wt),Ct=(et+Rt)*Dt+vt,$t=Math.abs(Math.round(Ct)-Ft)||1,dl=(st+Mt)*Jt+cl,rl=Math.abs(Math.round(dl)-pt)||1;return at.setTransform(0,Math.sign(Jt),Math.sign(Dt),0,Ft,pt),at.drawImage(R,w,X,C,H,0,0,rl,$t),at.setTransform(gt,Jt,Dt,qt,vt,cl),[rl,$t]}at.drawImage(R,w,X,C,H,st,et,Mt,Rt);const bl=Math.hypot(gt,Jt),il=Math.hypot(Dt,qt);return[bl*Mt,il*Rt]}function g(at){const{width:R,height:w}=at;if(R>K||w>K)return null;const X=1e3,C=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),H=R+1;let st=new Uint8Array(H*(w+1)),et,Mt,Rt;const gt=R+7&-8;let Jt=new Uint8Array(gt*w),Dt=0;for(const il of at.data){let Bt=128;for(;Bt>0;)Jt[Dt++]=il&Bt?0:255,Bt>>=1}let qt=0;for(Dt=0,Jt[Dt]!==0&&(st[0]=1,++qt),Mt=1;Mt<R;Mt++)Jt[Dt]!==Jt[Dt+1]&&(st[Mt]=Jt[Dt]?2:1,++qt),Dt++;for(Jt[Dt]!==0&&(st[Mt]=2,++qt),et=1;et<w;et++){Dt=et*gt,Rt=et*H,Jt[Dt-gt]!==Jt[Dt]&&(st[Rt]=Jt[Dt]?1:8,++qt);let il=(Jt[Dt]?4:0)+(Jt[Dt-gt]?8:0);for(Mt=1;Mt<R;Mt++)il=(il>>2)+(Jt[Dt+1]?4:0)+(Jt[Dt-gt+1]?8:0),C[il]&&(st[Rt+Mt]=C[il],++qt),Dt++;if(Jt[Dt-gt]!==Jt[Dt]&&(st[Rt+Mt]=Jt[Dt]?2:4,++qt),qt>X)return null}for(Dt=gt*(w-1),Rt=et*H,Jt[Dt]!==0&&(st[Rt]=8,++qt),Mt=1;Mt<R;Mt++)Jt[Dt]!==Jt[Dt+1]&&(st[Rt+Mt]=Jt[Dt]?4:8,++qt),Dt++;if(Jt[Dt]!==0&&(st[Rt+Mt]=4,++qt),qt>X)return null;const vt=new Int32Array([0,H,-1,0,-H,0,0,0,1]),cl=new Path2D;for(et=0;qt&&et<=w;et++){let il=et*H;const Bt=il+R;for(;il<Bt&&!st[il];)il++;if(il===Bt)continue;cl.moveTo(il%H,et);const Ft=il;let wt=st[il];do{const pt=vt[wt];do il+=pt;while(!st[il]);const Ct=st[il];Ct!==5&&Ct!==10?(wt=Ct,st[il]=0):(wt=Ct&51*wt>>4,st[il]&=wt>>2|wt<<2),cl.lineTo(il%H,il/H|0),st[il]||--qt}while(Ft!==il);--et}return Jt=null,st=null,function(il){il.save(),il.scale(1/R,-1/w),il.translate(0,-w),il.fill(cl),il.beginPath(),il.restore()}}class F{constructor(R,w){this.alphaIsShape=!1,this.fontSize=0,this.fontSizeScale=1,this.textMatrix=M.IDENTITY_MATRIX,this.textMatrixScale=1,this.fontMatrix=M.FONT_IDENTITY_MATRIX,this.leading=0,this.x=0,this.y=0,this.lineX=0,this.lineY=0,this.charSpacing=0,this.wordSpacing=0,this.textHScale=1,this.textRenderingMode=M.TextRenderingMode.FILL,this.textRise=0,this.fillColor="#000000",this.strokeColor="#000000",this.patternFill=!1,this.fillAlpha=1,this.strokeAlpha=1,this.lineWidth=1,this.activeSMask=null,this.transferMaps="none",this.startNewPathAndClipBox([0,0,R,w])}clone(){const R=Object.create(this);return R.clipBox=this.clipBox.slice(),R}setCurrentPoint(R,w){this.x=R,this.y=w}updatePathMinMax(R,w,X){[w,X]=M.Util.applyTransform([w,X],R),this.minX=Math.min(this.minX,w),this.minY=Math.min(this.minY,X),this.maxX=Math.max(this.maxX,w),this.maxY=Math.max(this.maxY,X)}updateRectMinMax(R,w){const X=M.Util.applyTransform(w,R),C=M.Util.applyTransform(w.slice(2),R);this.minX=Math.min(this.minX,X[0],C[0]),this.minY=Math.min(this.minY,X[1],C[1]),this.maxX=Math.max(this.maxX,X[0],C[0]),this.maxY=Math.max(this.maxY,X[1],C[1])}updateScalingPathMinMax(R,w){M.Util.scaleMinMax(R,w),this.minX=Math.min(this.minX,w[0]),this.maxX=Math.max(this.maxX,w[1]),this.minY=Math.min(this.minY,w[2]),this.maxY=Math.max(this.maxY,w[3])}updateCurvePathMinMax(R,w,X,C,H,st,et,Mt,Rt,gt){const Jt=M.Util.bezierBoundingBox(w,X,C,H,st,et,Mt,Rt);if(gt){gt[0]=Math.min(gt[0],Jt[0],Jt[2]),gt[1]=Math.max(gt[1],Jt[0],Jt[2]),gt[2]=Math.min(gt[2],Jt[1],Jt[3]),gt[3]=Math.max(gt[3],Jt[1],Jt[3]);return}this.updateRectMinMax(R,Jt)}getPathBoundingBox(R=B.PathType.FILL,w=null){const X=[this.minX,this.minY,this.maxX,this.maxY];if(R===B.PathType.STROKE){w||(0,M.unreachable)("Stroke bounding box must include transform.");const C=M.Util.singularValueDecompose2dScale(w),H=C[0]*this.lineWidth/2,st=C[1]*this.lineWidth/2;X[0]-=H,X[1]-=st,X[2]+=H,X[3]+=st}return X}updateClipFromPath(){const R=M.Util.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(R||[0,0,0,0])}isEmptyClip(){return this.minX===1/0}startNewPathAndClipBox(R){this.clipBox=R,this.minX=1/0,this.minY=1/0,this.maxX=0,this.maxY=0}getClippedPathBoundingBox(R=B.PathType.FILL,w=null){return M.Util.intersect(this.clipBox,this.getPathBoundingBox(R,w))}}function J(at,R){if(typeof ImageData<"u"&&R instanceof ImageData){at.putImageData(R,0,0);return}const w=R.height,X=R.width,C=w%f,H=(w-C)/f,st=C===0?H:H+1,et=at.createImageData(X,f);let Mt=0,Rt;const gt=R.data,Jt=et.data;let Dt,qt,vt,cl;if(R.kind===M.ImageKind.GRAYSCALE_1BPP){const bl=gt.byteLength,il=new Uint32Array(Jt.buffer,0,Jt.byteLength>>2),Bt=il.length,Ft=X+7>>3,wt=4294967295,pt=M.FeatureTest.isLittleEndian?4278190080:255;for(Dt=0;Dt<st;Dt++){for(vt=Dt<H?f:C,Rt=0,qt=0;qt<vt;qt++){const Ct=bl-Mt;let $t=0;const dl=Ct>Ft?X:Ct*8-7,rl=dl&-8;let Yl=0,Xl=0;for(;$t<rl;$t+=8)Xl=gt[Mt++],il[Rt++]=Xl&128?wt:pt,il[Rt++]=Xl&64?wt:pt,il[Rt++]=Xl&32?wt:pt,il[Rt++]=Xl&16?wt:pt,il[Rt++]=Xl&8?wt:pt,il[Rt++]=Xl&4?wt:pt,il[Rt++]=Xl&2?wt:pt,il[Rt++]=Xl&1?wt:pt;for(;$t<dl;$t++)Yl===0&&(Xl=gt[Mt++],Yl=128),il[Rt++]=Xl&Yl?wt:pt,Yl>>=1}for(;Rt<Bt;)il[Rt++]=0;at.putImageData(et,0,Dt*f)}}else if(R.kind===M.ImageKind.RGBA_32BPP){for(qt=0,cl=X*f*4,Dt=0;Dt<H;Dt++)Jt.set(gt.subarray(Mt,Mt+cl)),Mt+=cl,at.putImageData(et,0,qt),qt+=f;Dt<st&&(cl=X*C*4,Jt.set(gt.subarray(Mt,Mt+cl)),at.putImageData(et,0,qt))}else if(R.kind===M.ImageKind.RGB_24BPP)for(vt=f,cl=X*vt,Dt=0;Dt<st;Dt++){for(Dt>=H&&(vt=C,cl=X*vt),Rt=0,qt=cl;qt--;)Jt[Rt++]=gt[Mt++],Jt[Rt++]=gt[Mt++],Jt[Rt++]=gt[Mt++],Jt[Rt++]=255;at.putImageData(et,0,Dt*f)}else throw new Error(`bad image kind: ${R.kind}`)}function v(at,R){if(R.bitmap){at.drawImage(R.bitmap,0,0);return}const w=R.height,X=R.width,C=w%f,H=(w-C)/f,st=C===0?H:H+1,et=at.createImageData(X,f);let Mt=0;const Rt=R.data,gt=et.data;for(let Jt=0;Jt<st;Jt++){const Dt=Jt<H?f:C;({srcPos:Mt}=(0,Q.convertBlackAndWhiteToRGBA)({src:Rt,srcPos:Mt,dest:gt,width:X,height:Dt,nonBlackColor:0})),at.putImageData(et,0,Jt*f)}}function u(at,R){const w=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font","filter"];for(const X of w)at[X]!==void 0&&(R[X]=at[X]);at.setLineDash!==void 0&&(R.setLineDash(at.getLineDash()),R.lineDashOffset=at.lineDashOffset)}function m(at){if(at.strokeStyle=at.fillStyle="#000000",at.fillRule="nonzero",at.globalAlpha=1,at.lineWidth=1,at.lineCap="butt",at.lineJoin="miter",at.miterLimit=10,at.globalCompositeOperation="source-over",at.font="10px sans-serif",at.setLineDash!==void 0&&(at.setLineDash([]),at.lineDashOffset=0),!M.isNodeJS){const{filter:R}=at;R!=="none"&&R!==""&&(at.filter="none")}}function _(at,R,w,X){const C=at.length;for(let H=3;H<C;H+=4){const st=at[H];if(st===0)at[H-3]=R,at[H-2]=w,at[H-1]=X;else if(st<255){const et=255-st;at[H-3]=at[H-3]*st+R*et>>8,at[H-2]=at[H-2]*st+w*et>>8,at[H-1]=at[H-1]*st+X*et>>8}}}function $(at,R,w){const X=at.length,C=1/255;for(let H=3;H<X;H+=4){const st=w?w[at[H]]:at[H];R[H]=R[H]*st*C|0}}function P(at,R,w){const X=at.length;for(let C=3;C<X;C+=4){const H=at[C-3]*77+at[C-2]*152+at[C-1]*28;R[C]=w?R[C]*w[H>>8]>>8:R[C]*H>>16}}function Zt(at,R,w,X,C,H,st,et,Mt,Rt,gt){const Jt=!!H,Dt=Jt?H[0]:0,qt=Jt?H[1]:0,vt=Jt?H[2]:0,cl=C==="Luminosity"?P:$,il=Math.min(X,Math.ceil(1048576/w));for(let Bt=0;Bt<X;Bt+=il){const Ft=Math.min(il,X-Bt),wt=at.getImageData(et-Rt,Bt+(Mt-gt),w,Ft),pt=R.getImageData(et,Bt+Mt,w,Ft);Jt&&_(wt.data,Dt,qt,vt),cl(wt.data,pt.data,st),R.putImageData(pt,et,Bt+Mt)}}function dt(at,R,w,X){const C=X[0],H=X[1],st=X[2]-C,et=X[3]-H;st===0||et===0||(Zt(R.context,w,st,et,R.subtype,R.backdrop,R.transferMap,C,H,R.offsetX,R.offsetY),at.save(),at.globalAlpha=1,at.globalCompositeOperation="source-over",at.setTransform(1,0,0,1,0,0),at.drawImage(w.canvas,0,0),at.restore())}function It(at,R){const w=M.Util.singularValueDecompose2dScale(at);w[0]=Math.fround(w[0]),w[1]=Math.fround(w[1]);const X=Math.fround((globalThis.devicePixelRatio||1)*p.PixelsPerInch.PDF_TO_CSS_UNITS);return R!==void 0?R:w[0]<=X||w[1]<=X}const xt=["butt","round","square"],it=["miter","round","bevel"],Xt={},zt={},Pt=class Pt{constructor(R,w,X,C,H,{optionalContentConfig:st,markedContentStack:et=null},Mt,Rt){ll(this,Nt);ll(this,Vt);this.ctx=R,this.current=new F(this.ctx.canvas.width,this.ctx.canvas.height),this.stateStack=[],this.pendingClip=null,this.pendingEOFill=!1,this.res=null,this.xobjs=null,this.commonObjs=w,this.objs=X,this.canvasFactory=C,this.filterFactory=H,this.groupStack=[],this.processingType3=null,this.baseTransform=null,this.baseTransformStack=[],this.groupLevel=0,this.smaskStack=[],this.smaskCounter=0,this.tempSMask=null,this.suspendedCtx=null,this.contentVisible=!0,this.markedContentStack=et||[],this.optionalContentConfig=st,this.cachedCanvases=new k(this.canvasFactory),this.cachedPatterns=new Map,this.annotationCanvasMap=Mt,this.viewportScale=1,this.outputScaleX=1,this.outputScaleY=1,this.pageColors=Rt,this._cachedScaleForStroking=[-1,0],this._cachedGetSinglePixelWidth=null,this._cachedBitmapsMap=new Map}getObject(R,w=null){return typeof R=="string"?R.startsWith("g_")?this.commonObjs.get(R):this.objs.get(R):w}beginDrawing({transform:R,viewport:w,transparency:X=!1,background:C=null}){const H=this.ctx.canvas.width,st=this.ctx.canvas.height,et=this.ctx.fillStyle;if(this.ctx.fillStyle=C||"#ffffff",this.ctx.fillRect(0,0,H,st),this.ctx.fillStyle=et,X){const Mt=this.cachedCanvases.getCanvas("transparent",H,st);this.compositeCtx=this.ctx,this.transparentCanvas=Mt.canvas,this.ctx=Mt.context,this.ctx.save(),this.ctx.transform(...(0,p.getCurrentTransform)(this.compositeCtx))}this.ctx.save(),m(this.ctx),R&&(this.ctx.transform(...R),this.outputScaleX=R[0],this.outputScaleY=R[0]),this.ctx.transform(...w.transform),this.viewportScale=w.scale,this.baseTransform=(0,p.getCurrentTransform)(this.ctx)}executeOperatorList(R,w,X,C){const H=R.argsArray,st=R.fnArray;let et=w||0;const Mt=H.length;if(Mt===et)return et;const Rt=Mt-et>q&&typeof X=="function",gt=Rt?Date.now()+j:0;let Jt=0;const Dt=this.commonObjs,qt=this.objs;let vt;for(;;){if(C!==void 0&&et===C.nextBreakPoint)return C.breakIt(et,X),et;if(vt=st[et],vt!==M.OPS.dependency)this[vt].apply(this,H[et]);else for(const cl of H[et]){const bl=cl.startsWith("g_")?Dt:qt;if(!bl.has(cl))return bl.get(cl,X),et}if(et++,et===Mt)return et;if(Rt&&++Jt>q){if(Date.now()>gt)return X(),et;Jt=0}}}endDrawing(){nl(this,Nt,De).call(this),this.cachedCanvases.clear(),this.cachedPatterns.clear();for(const R of this._cachedBitmapsMap.values()){for(const w of R.values())typeof HTMLCanvasElement<"u"&&w instanceof HTMLCanvasElement&&(w.width=w.height=0);R.clear()}this._cachedBitmapsMap.clear(),nl(this,Vt,je).call(this)}_scaleImage(R,w){const X=R.width,C=R.height;let H=Math.max(Math.hypot(w[0],w[1]),1),st=Math.max(Math.hypot(w[2],w[3]),1),et=X,Mt=C,Rt="prescale1",gt,Jt;for(;H>2&&et>1||st>2&&Mt>1;){let Dt=et,qt=Mt;H>2&&et>1&&(Dt=et>=16384?Math.floor(et/2)-1||1:Math.ceil(et/2),H/=et/Dt),st>2&&Mt>1&&(qt=Mt>=16384?Math.floor(Mt/2)-1||1:Math.ceil(Mt)/2,st/=Mt/qt),gt=this.cachedCanvases.getCanvas(Rt,Dt,qt),Jt=gt.context,Jt.clearRect(0,0,Dt,qt),Jt.drawImage(R,0,0,et,Mt,0,0,Dt,qt),R=gt.canvas,et=Dt,Mt=qt,Rt=Rt==="prescale1"?"prescale2":"prescale1"}return{img:R,paintWidth:et,paintHeight:Mt}}_createMaskCanvas(R){const w=this.ctx,{width:X,height:C}=R,H=this.current.fillColor,st=this.current.patternFill,et=(0,p.getCurrentTransform)(w);let Mt,Rt,gt,Jt;if((R.bitmap||R.data)&&R.count>1){const $t=R.bitmap||R.data.buffer;Rt=JSON.stringify(st?et:[et.slice(0,4),H]),Mt=this._cachedBitmapsMap.get($t),Mt||(Mt=new Map,this._cachedBitmapsMap.set($t,Mt));const dl=Mt.get(Rt);if(dl&&!st){const rl=Math.round(Math.min(et[0],et[2])+et[4]),Yl=Math.round(Math.min(et[1],et[3])+et[5]);return{canvas:dl,offsetX:rl,offsetY:Yl}}gt=dl}gt||(Jt=this.cachedCanvases.getCanvas("maskCanvas",X,C),v(Jt.context,R));let Dt=M.Util.transform(et,[1/X,0,0,-1/C,0,0]);Dt=M.Util.transform(Dt,[1,0,0,1,0,-C]);const qt=M.Util.applyTransform([0,0],Dt),vt=M.Util.applyTransform([X,C],Dt),cl=M.Util.normalizeRect([qt[0],qt[1],vt[0],vt[1]]),bl=Math.round(cl[2]-cl[0])||1,il=Math.round(cl[3]-cl[1])||1,Bt=this.cachedCanvases.getCanvas("fillCanvas",bl,il),Ft=Bt.context,wt=Math.min(qt[0],vt[0]),pt=Math.min(qt[1],vt[1]);Ft.translate(-wt,-pt),Ft.transform(...Dt),gt||(gt=this._scaleImage(Jt.canvas,(0,p.getCurrentTransformInverse)(Ft)),gt=gt.img,Mt&&st&&Mt.set(Rt,gt)),Ft.imageSmoothingEnabled=It((0,p.getCurrentTransform)(Ft),R.interpolate),T(Ft,gt,0,0,gt.width,gt.height,0,0,X,C),Ft.globalCompositeOperation="source-in";const Ct=M.Util.transform((0,p.getCurrentTransformInverse)(Ft),[1,0,0,1,-wt,-pt]);return Ft.fillStyle=st?H.getPattern(w,this,Ct,B.PathType.FILL):H,Ft.fillRect(0,0,X,C),Mt&&!st&&(this.cachedCanvases.delete("fillCanvas"),Mt.set(Rt,Bt.canvas)),{canvas:Bt.canvas,offsetX:Math.round(wt),offsetY:Math.round(pt)}}setLineWidth(R){R!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1),this.current.lineWidth=R,this.ctx.lineWidth=R}setLineCap(R){this.ctx.lineCap=xt[R]}setLineJoin(R){this.ctx.lineJoin=it[R]}setMiterLimit(R){this.ctx.miterLimit=R}setDash(R,w){const X=this.ctx;X.setLineDash!==void 0&&(X.setLineDash(R),X.lineDashOffset=w)}setRenderingIntent(R){}setFlatness(R){}setGState(R){for(const[w,X]of R)switch(w){case"LW":this.setLineWidth(X);break;case"LC":this.setLineCap(X);break;case"LJ":this.setLineJoin(X);break;case"ML":this.setMiterLimit(X);break;case"D":this.setDash(X[0],X[1]);break;case"RI":this.setRenderingIntent(X);break;case"FL":this.setFlatness(X);break;case"Font":this.setFont(X[0],X[1]);break;case"CA":this.current.strokeAlpha=X;break;case"ca":this.current.fillAlpha=X,this.ctx.globalAlpha=X;break;case"BM":this.ctx.globalCompositeOperation=X;break;case"SMask":this.current.activeSMask=X?this.tempSMask:null,this.tempSMask=null,this.checkSMaskState();break;case"TR":this.ctx.filter=this.current.transferMaps=this.filterFactory.addFilter(X);break}}get inSMaskMode(){return!!this.suspendedCtx}checkSMaskState(){const R=this.inSMaskMode;this.current.activeSMask&&!R?this.beginSMaskMode():!this.current.activeSMask&&R&&this.endSMaskMode()}beginSMaskMode(){if(this.inSMaskMode)throw new Error("beginSMaskMode called while already in smask mode");const R=this.ctx.canvas.width,w=this.ctx.canvas.height,X="smaskGroupAt"+this.groupLevel,C=this.cachedCanvases.getCanvas(X,R,w);this.suspendedCtx=this.ctx,this.ctx=C.context;const H=this.ctx;H.setTransform(...(0,p.getCurrentTransform)(this.suspendedCtx)),u(this.suspendedCtx,H),S(H,this.suspendedCtx),this.setGState([["BM","source-over"],["ca",1],["CA",1]])}endSMaskMode(){if(!this.inSMaskMode)throw new Error("endSMaskMode called while not in smask mode");this.ctx._removeMirroring(),u(this.ctx,this.suspendedCtx),this.ctx=this.suspendedCtx,this.suspendedCtx=null}compose(R){if(!this.current.activeSMask)return;R?(R[0]=Math.floor(R[0]),R[1]=Math.floor(R[1]),R[2]=Math.ceil(R[2]),R[3]=Math.ceil(R[3])):R=[0,0,this.ctx.canvas.width,this.ctx.canvas.height];const w=this.current.activeSMask,X=this.suspendedCtx;dt(X,w,this.ctx,R),this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.clearRect(0,0,this.ctx.canvas.width,this.ctx.canvas.height),this.ctx.restore()}save(){this.inSMaskMode?(u(this.ctx,this.suspendedCtx),this.suspendedCtx.save()):this.ctx.save();const R=this.current;this.stateStack.push(R),this.current=R.clone()}restore(){this.stateStack.length===0&&this.inSMaskMode&&this.endSMaskMode(),this.stateStack.length!==0&&(this.current=this.stateStack.pop(),this.inSMaskMode?(this.suspendedCtx.restore(),u(this.suspendedCtx,this.ctx)):this.ctx.restore(),this.checkSMaskState(),this.pendingClip=null,this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null)}transform(R,w,X,C,H,st){this.ctx.transform(R,w,X,C,H,st),this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}constructPath(R,w,X){const C=this.ctx,H=this.current;let st=H.x,et=H.y,Mt,Rt;const gt=(0,p.getCurrentTransform)(C),Jt=gt[0]===0&>[3]===0||gt[1]===0&>[2]===0,Dt=Jt?X.slice(0):null;for(let qt=0,vt=0,cl=R.length;qt<cl;qt++)switch(R[qt]|0){case M.OPS.rectangle:st=w[vt++],et=w[vt++];const bl=w[vt++],il=w[vt++],Bt=st+bl,Ft=et+il;C.moveTo(st,et),bl===0||il===0?C.lineTo(Bt,Ft):(C.lineTo(Bt,et),C.lineTo(Bt,Ft),C.lineTo(st,Ft)),Jt||H.updateRectMinMax(gt,[st,et,Bt,Ft]),C.closePath();break;case M.OPS.moveTo:st=w[vt++],et=w[vt++],C.moveTo(st,et),Jt||H.updatePathMinMax(gt,st,et);break;case M.OPS.lineTo:st=w[vt++],et=w[vt++],C.lineTo(st,et),Jt||H.updatePathMinMax(gt,st,et);break;case M.OPS.curveTo:Mt=st,Rt=et,st=w[vt+4],et=w[vt+5],C.bezierCurveTo(w[vt],w[vt+1],w[vt+2],w[vt+3],st,et),H.updateCurvePathMinMax(gt,Mt,Rt,w[vt],w[vt+1],w[vt+2],w[vt+3],st,et,Dt),vt+=6;break;case M.OPS.curveTo2:Mt=st,Rt=et,C.bezierCurveTo(st,et,w[vt],w[vt+1],w[vt+2],w[vt+3]),H.updateCurvePathMinMax(gt,Mt,Rt,st,et,w[vt],w[vt+1],w[vt+2],w[vt+3],Dt),st=w[vt+2],et=w[vt+3],vt+=4;break;case M.OPS.curveTo3:Mt=st,Rt=et,st=w[vt+2],et=w[vt+3],C.bezierCurveTo(w[vt],w[vt+1],st,et,st,et),H.updateCurvePathMinMax(gt,Mt,Rt,w[vt],w[vt+1],st,et,st,et,Dt),vt+=4;break;case M.OPS.closePath:C.closePath();break}Jt&&H.updateScalingPathMinMax(gt,Dt),H.setCurrentPoint(st,et)}closePath(){this.ctx.closePath()}stroke(R=!0){const w=this.ctx,X=this.current.strokeColor;w.globalAlpha=this.current.strokeAlpha,this.contentVisible&&(typeof X=="object"&&(X!=null&&X.getPattern)?(w.save(),w.strokeStyle=X.getPattern(w,this,(0,p.getCurrentTransformInverse)(w),B.PathType.STROKE),this.rescaleAndStroke(!1),w.restore()):this.rescaleAndStroke(!0)),R&&this.consumePath(this.current.getClippedPathBoundingBox()),w.globalAlpha=this.current.fillAlpha}closeStroke(){this.closePath(),this.stroke()}fill(R=!0){const w=this.ctx,X=this.current.fillColor,C=this.current.patternFill;let H=!1;C&&(w.save(),w.fillStyle=X.getPattern(w,this,(0,p.getCurrentTransformInverse)(w),B.PathType.FILL),H=!0);const st=this.current.getClippedPathBoundingBox();this.contentVisible&&st!==null&&(this.pendingEOFill?(w.fill("evenodd"),this.pendingEOFill=!1):w.fill()),H&&w.restore(),R&&this.consumePath(st)}eoFill(){this.pendingEOFill=!0,this.fill()}fillStroke(){this.fill(!1),this.stroke(!1),this.consumePath()}eoFillStroke(){this.pendingEOFill=!0,this.fillStroke()}closeFillStroke(){this.closePath(),this.fillStroke()}closeEOFillStroke(){this.pendingEOFill=!0,this.closePath(),this.fillStroke()}endPath(){this.consumePath()}clip(){this.pendingClip=Xt}eoClip(){this.pendingClip=zt}beginText(){this.current.textMatrix=M.IDENTITY_MATRIX,this.current.textMatrixScale=1,this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}endText(){const R=this.pendingTextPaths,w=this.ctx;if(R===void 0){w.beginPath();return}w.save(),w.beginPath();for(const X of R)w.setTransform(...X.transform),w.translate(X.x,X.y),X.addToPath(w,X.fontSize);w.restore(),w.clip(),w.beginPath(),delete this.pendingTextPaths}setCharSpacing(R){this.current.charSpacing=R}setWordSpacing(R){this.current.wordSpacing=R}setHScale(R){this.current.textHScale=R/100}setLeading(R){this.current.leading=-R}setFont(R,w){var gt;const X=this.commonObjs.get(R),C=this.current;if(!X)throw new Error(`Can't find font for ${R}`);if(C.fontMatrix=X.fontMatrix||M.FONT_IDENTITY_MATRIX,(C.fontMatrix[0]===0||C.fontMatrix[3]===0)&&(0,M.warn)("Invalid font matrix for font "+R),w<0?(w=-w,C.fontDirection=-1):C.fontDirection=1,this.current.font=X,this.current.fontSize=w,X.isType3Font)return;const H=X.loadedName||"sans-serif",st=((gt=X.systemFontInfo)==null?void 0:gt.css)||`"${H}", ${X.fallbackName}`;let et="normal";X.black?et="900":X.bold&&(et="bold");const Mt=X.italic?"italic":"normal";let Rt=w;w<U?Rt=U:w>O&&(Rt=O),this.current.fontSizeScale=w/Rt,this.ctx.font=`${Mt} ${et} ${Rt}px ${st}`}setTextRenderingMode(R){this.current.textRenderingMode=R}setTextRise(R){this.current.textRise=R}moveText(R,w){this.current.x=this.current.lineX+=R,this.current.y=this.current.lineY+=w}setLeadingMoveText(R,w){this.setLeading(-w),this.moveText(R,w)}setTextMatrix(R,w,X,C,H,st){this.current.textMatrix=[R,w,X,C,H,st],this.current.textMatrixScale=Math.hypot(R,w),this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}nextLine(){this.moveText(0,this.current.leading)}paintChar(R,w,X,C){const H=this.ctx,st=this.current,et=st.font,Mt=st.textRenderingMode,Rt=st.fontSize/st.fontSizeScale,gt=Mt&M.TextRenderingMode.FILL_STROKE_MASK,Jt=!!(Mt&M.TextRenderingMode.ADD_TO_PATH_FLAG),Dt=st.patternFill&&!et.missingFile;let qt;(et.disableFontFace||Jt||Dt)&&(qt=et.getPathGenerator(this.commonObjs,R)),et.disableFontFace||Dt?(H.save(),H.translate(w,X),H.beginPath(),qt(H,Rt),C&&H.setTransform(...C),(gt===M.TextRenderingMode.FILL||gt===M.TextRenderingMode.FILL_STROKE)&&H.fill(),(gt===M.TextRenderingMode.STROKE||gt===M.TextRenderingMode.FILL_STROKE)&&H.stroke(),H.restore()):((gt===M.TextRenderingMode.FILL||gt===M.TextRenderingMode.FILL_STROKE)&&H.fillText(R,w,X),(gt===M.TextRenderingMode.STROKE||gt===M.TextRenderingMode.FILL_STROKE)&&H.strokeText(R,w,X)),Jt&&(this.pendingTextPaths||(this.pendingTextPaths=[])).push({transform:(0,p.getCurrentTransform)(H),x:w,y:X,fontSize:Rt,addToPath:qt})}get isFontSubpixelAAEnabled(){const{context:R}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10);R.scale(1.5,1),R.fillText("I",0,10);const w=R.getImageData(0,0,10,10).data;let X=!1;for(let C=3;C<w.length;C+=4)if(w[C]>0&&w[C]<255){X=!0;break}return(0,M.shadow)(this,"isFontSubpixelAAEnabled",X)}showText(R){const w=this.current,X=w.font;if(X.isType3Font)return this.showType3Text(R);const C=w.fontSize;if(C===0)return;const H=this.ctx,st=w.fontSizeScale,et=w.charSpacing,Mt=w.wordSpacing,Rt=w.fontDirection,gt=w.textHScale*Rt,Jt=R.length,Dt=X.vertical,qt=Dt?1:-1,vt=X.defaultVMetrics,cl=C*w.fontMatrix[0],bl=w.textRenderingMode===M.TextRenderingMode.FILL&&!X.disableFontFace&&!w.patternFill;H.save(),H.transform(...w.textMatrix),H.translate(w.x,w.y+w.textRise),Rt>0?H.scale(gt,-1):H.scale(gt,1);let il;if(w.patternFill){H.save();const Ct=w.fillColor.getPattern(H,this,(0,p.getCurrentTransformInverse)(H),B.PathType.FILL);il=(0,p.getCurrentTransform)(H),H.restore(),H.fillStyle=Ct}let Bt=w.lineWidth;const Ft=w.textMatrixScale;if(Ft===0||Bt===0){const Ct=w.textRenderingMode&M.TextRenderingMode.FILL_STROKE_MASK;(Ct===M.TextRenderingMode.STROKE||Ct===M.TextRenderingMode.FILL_STROKE)&&(Bt=this.getSinglePixelWidth())}else Bt/=Ft;if(st!==1&&(H.scale(st,st),Bt/=st),H.lineWidth=Bt,X.isInvalidPDFjsFont){const Ct=[];let $t=0;for(const dl of R)Ct.push(dl.unicode),$t+=dl.width;H.fillText(Ct.join(""),0,0),w.x+=$t*cl*gt,H.restore(),this.compose();return}let wt=0,pt;for(pt=0;pt<Jt;++pt){const Ct=R[pt];if(typeof Ct=="number"){wt+=qt*Ct*C/1e3;continue}let $t=!1;const dl=(Ct.isSpace?Mt:0)+et,rl=Ct.fontChar,Yl=Ct.accent;let Xl,pl,Ll=Ct.width;if(Dt){const Vl=Ct.vmetric||vt,_t=-(Ct.vmetric?Vl[1]:Ll*.5)*cl,ot=Vl[2]*cl;Ll=Vl?-Vl[0]:Ll,Xl=_t/st,pl=(wt+ot)/st}else Xl=wt/st,pl=0;if(X.remeasure&&Ll>0){const Vl=H.measureText(rl).width*1e3/C*st;if(Ll<Vl&&this.isFontSubpixelAAEnabled){const _t=Ll/Vl;$t=!0,H.save(),H.scale(_t,1),Xl/=_t}else Ll!==Vl&&(Xl+=(Ll-Vl)/2e3*C/st)}if(this.contentVisible&&(Ct.isInFont||X.missingFile)){if(bl&&!Yl)H.fillText(rl,Xl,pl);else if(this.paintChar(rl,Xl,pl,il),Yl){const Vl=Xl+C*Yl.offset.x/st,_t=pl-C*Yl.offset.y/st;this.paintChar(Yl.fontChar,Vl,_t,il)}}const yl=Dt?Ll*cl-dl*Rt:Ll*cl+dl*Rt;wt+=yl,$t&&H.restore()}Dt?w.y-=wt:w.x+=wt*gt,H.restore(),this.compose()}showType3Text(R){const w=this.ctx,X=this.current,C=X.font,H=X.fontSize,st=X.fontDirection,et=C.vertical?1:-1,Mt=X.charSpacing,Rt=X.wordSpacing,gt=X.textHScale*st,Jt=X.fontMatrix||M.FONT_IDENTITY_MATRIX,Dt=R.length,qt=X.textRenderingMode===M.TextRenderingMode.INVISIBLE;let vt,cl,bl,il;if(!(qt||H===0)){for(this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null,w.save(),w.transform(...X.textMatrix),w.translate(X.x,X.y),w.scale(gt,st),vt=0;vt<Dt;++vt){if(cl=R[vt],typeof cl=="number"){il=et*cl*H/1e3,this.ctx.translate(il,0),X.x+=il*gt;continue}const Bt=(cl.isSpace?Rt:0)+Mt,Ft=C.charProcOperatorList[cl.operatorListId];if(!Ft){(0,M.warn)(`Type3 character "${cl.operatorListId}" is not available.`);continue}this.contentVisible&&(this.processingType3=cl,this.save(),w.scale(H,H),w.transform(...Jt),this.executeOperatorList(Ft),this.restore()),bl=M.Util.applyTransform([cl.width,0],Jt)[0]*H+Bt,w.translate(bl,0),X.x+=bl*gt}w.restore(),this.processingType3=null}}setCharWidth(R,w){}setCharWidthAndBounds(R,w,X,C,H,st){this.ctx.rect(X,C,H-X,st-C),this.ctx.clip(),this.endPath()}getColorN_Pattern(R){let w;if(R[0]==="TilingPattern"){const X=R[1],C=this.baseTransform||(0,p.getCurrentTransform)(this.ctx),H={createCanvasGraphics:st=>new Pt(st,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack})};w=new B.TilingPattern(R,X,this.ctx,H,C)}else w=this._getPattern(R[1],R[2]);return w}setStrokeColorN(){this.current.strokeColor=this.getColorN_Pattern(arguments)}setFillColorN(){this.current.fillColor=this.getColorN_Pattern(arguments),this.current.patternFill=!0}setStrokeRGBColor(R,w,X){const C=M.Util.makeHexColor(R,w,X);this.ctx.strokeStyle=C,this.current.strokeColor=C}setFillRGBColor(R,w,X){const C=M.Util.makeHexColor(R,w,X);this.ctx.fillStyle=C,this.current.fillColor=C,this.current.patternFill=!1}_getPattern(R,w=null){let X;return this.cachedPatterns.has(R)?X=this.cachedPatterns.get(R):(X=(0,B.getShadingPattern)(this.getObject(R)),this.cachedPatterns.set(R,X)),w&&(X.matrix=w),X}shadingFill(R){if(!this.contentVisible)return;const w=this.ctx;this.save();const X=this._getPattern(R);w.fillStyle=X.getPattern(w,this,(0,p.getCurrentTransformInverse)(w),B.PathType.SHADING);const C=(0,p.getCurrentTransformInverse)(w);if(C){const{width:H,height:st}=w.canvas,[et,Mt,Rt,gt]=M.Util.getAxialAlignedBoundingBox([0,0,H,st],C);this.ctx.fillRect(et,Mt,Rt-et,gt-Mt)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.compose(this.current.getClippedPathBoundingBox()),this.restore()}beginInlineImage(){(0,M.unreachable)("Should not call beginInlineImage")}beginImageData(){(0,M.unreachable)("Should not call beginImageData")}paintFormXObjectBegin(R,w){if(this.contentVisible&&(this.save(),this.baseTransformStack.push(this.baseTransform),Array.isArray(R)&&R.length===6&&this.transform(...R),this.baseTransform=(0,p.getCurrentTransform)(this.ctx),w)){const X=w[2]-w[0],C=w[3]-w[1];this.ctx.rect(w[0],w[1],X,C),this.current.updateRectMinMax((0,p.getCurrentTransform)(this.ctx),w),this.clip(),this.endPath()}}paintFormXObjectEnd(){this.contentVisible&&(this.restore(),this.baseTransform=this.baseTransformStack.pop())}beginGroup(R){if(!this.contentVisible)return;this.save(),this.inSMaskMode&&(this.endSMaskMode(),this.current.activeSMask=null);const w=this.ctx;R.isolated||(0,M.info)("TODO: Support non-isolated groups."),R.knockout&&(0,M.warn)("Knockout groups not supported.");const X=(0,p.getCurrentTransform)(w);if(R.matrix&&w.transform(...R.matrix),!R.bbox)throw new Error("Bounding box is required.");let C=M.Util.getAxialAlignedBoundingBox(R.bbox,(0,p.getCurrentTransform)(w));const H=[0,0,w.canvas.width,w.canvas.height];C=M.Util.intersect(C,H)||[0,0,0,0];const st=Math.floor(C[0]),et=Math.floor(C[1]);let Mt=Math.max(Math.ceil(C[2])-st,1),Rt=Math.max(Math.ceil(C[3])-et,1),gt=1,Jt=1;Mt>I&&(gt=Mt/I,Mt=I),Rt>I&&(Jt=Rt/I,Rt=I),this.current.startNewPathAndClipBox([0,0,Mt,Rt]);let Dt="groupAt"+this.groupLevel;R.smask&&(Dt+="_smask_"+this.smaskCounter++%2);const qt=this.cachedCanvases.getCanvas(Dt,Mt,Rt),vt=qt.context;vt.scale(1/gt,1/Jt),vt.translate(-st,-et),vt.transform(...X),R.smask?this.smaskStack.push({canvas:qt.canvas,context:vt,offsetX:st,offsetY:et,scaleX:gt,scaleY:Jt,subtype:R.smask.subtype,backdrop:R.smask.backdrop,transferMap:R.smask.transferMap||null,startTransformInverse:null}):(w.setTransform(1,0,0,1,0,0),w.translate(st,et),w.scale(gt,Jt),w.save()),u(w,vt),this.ctx=vt,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(w),this.groupLevel++}endGroup(R){if(!this.contentVisible)return;this.groupLevel--;const w=this.ctx,X=this.groupStack.pop();if(this.ctx=X,this.ctx.imageSmoothingEnabled=!1,R.smask)this.tempSMask=this.smaskStack.pop(),this.restore();else{this.ctx.restore();const C=(0,p.getCurrentTransform)(this.ctx);this.restore(),this.ctx.save(),this.ctx.setTransform(...C);const H=M.Util.getAxialAlignedBoundingBox([0,0,w.canvas.width,w.canvas.height],C);this.ctx.drawImage(w.canvas,0,0),this.ctx.restore(),this.compose(H)}}beginAnnotation(R,w,X,C,H){if(nl(this,Nt,De).call(this),m(this.ctx),this.ctx.save(),this.save(),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),Array.isArray(w)&&w.length===4){const st=w[2]-w[0],et=w[3]-w[1];if(H&&this.annotationCanvasMap){X=X.slice(),X[4]-=w[0],X[5]-=w[1],w=w.slice(),w[0]=w[1]=0,w[2]=st,w[3]=et;const[Mt,Rt]=M.Util.singularValueDecompose2dScale((0,p.getCurrentTransform)(this.ctx)),{viewportScale:gt}=this,Jt=Math.ceil(st*this.outputScaleX*gt),Dt=Math.ceil(et*this.outputScaleY*gt);this.annotationCanvas=this.canvasFactory.create(Jt,Dt);const{canvas:qt,context:vt}=this.annotationCanvas;this.annotationCanvasMap.set(R,qt),this.annotationCanvas.savedCtx=this.ctx,this.ctx=vt,this.ctx.save(),this.ctx.setTransform(Mt,0,0,-Rt,0,et*Rt),m(this.ctx)}else m(this.ctx),this.ctx.rect(w[0],w[1],st,et),this.ctx.clip(),this.endPath()}this.current=new F(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(...X),this.transform(...C)}endAnnotation(){this.annotationCanvas&&(this.ctx.restore(),nl(this,Vt,je).call(this),this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas)}paintImageMaskXObject(R){if(!this.contentVisible)return;const w=R.count;R=this.getObject(R.data,R),R.count=w;const X=this.ctx,C=this.processingType3;if(C&&(C.compiled===void 0&&(C.compiled=g(R)),C.compiled)){C.compiled(X);return}const H=this._createMaskCanvas(R),st=H.canvas;X.save(),X.setTransform(1,0,0,1,0,0),X.drawImage(st,H.offsetX,H.offsetY),X.restore(),this.compose()}paintImageMaskXObjectRepeat(R,w,X=0,C=0,H,st){if(!this.contentVisible)return;R=this.getObject(R.data,R);const et=this.ctx;et.save();const Mt=(0,p.getCurrentTransform)(et);et.transform(w,X,C,H,0,0);const Rt=this._createMaskCanvas(R);et.setTransform(1,0,0,1,Rt.offsetX-Mt[4],Rt.offsetY-Mt[5]);for(let gt=0,Jt=st.length;gt<Jt;gt+=2){const Dt=M.Util.transform(Mt,[w,X,C,H,st[gt],st[gt+1]]),[qt,vt]=M.Util.applyTransform([0,0],Dt);et.drawImage(Rt.canvas,qt,vt)}et.restore(),this.compose()}paintImageMaskXObjectGroup(R){if(!this.contentVisible)return;const w=this.ctx,X=this.current.fillColor,C=this.current.patternFill;for(const H of R){const{data:st,width:et,height:Mt,transform:Rt}=H,gt=this.cachedCanvases.getCanvas("maskCanvas",et,Mt),Jt=gt.context;Jt.save();const Dt=this.getObject(st,H);v(Jt,Dt),Jt.globalCompositeOperation="source-in",Jt.fillStyle=C?X.getPattern(Jt,this,(0,p.getCurrentTransformInverse)(w),B.PathType.FILL):X,Jt.fillRect(0,0,et,Mt),Jt.restore(),w.save(),w.transform(...Rt),w.scale(1,-1),T(w,gt.canvas,0,0,et,Mt,0,-1,1,1),w.restore()}this.compose()}paintImageXObject(R){if(!this.contentVisible)return;const w=this.getObject(R);if(!w){(0,M.warn)("Dependent image isn't ready yet");return}this.paintInlineImageXObject(w)}paintImageXObjectRepeat(R,w,X,C){if(!this.contentVisible)return;const H=this.getObject(R);if(!H){(0,M.warn)("Dependent image isn't ready yet");return}const st=H.width,et=H.height,Mt=[];for(let Rt=0,gt=C.length;Rt<gt;Rt+=2)Mt.push({transform:[w,0,0,X,C[Rt],C[Rt+1]],x:0,y:0,w:st,h:et});this.paintInlineImageXObjectGroup(H,Mt)}applyTransferMapsToCanvas(R){return this.current.transferMaps!=="none"&&(R.filter=this.current.transferMaps,R.drawImage(R.canvas,0,0),R.filter="none"),R.canvas}applyTransferMapsToBitmap(R){if(this.current.transferMaps==="none")return R.bitmap;const{bitmap:w,width:X,height:C}=R,H=this.cachedCanvases.getCanvas("inlineImage",X,C),st=H.context;return st.filter=this.current.transferMaps,st.drawImage(w,0,0),st.filter="none",H.canvas}paintInlineImageXObject(R){if(!this.contentVisible)return;const w=R.width,X=R.height,C=this.ctx;if(this.save(),!M.isNodeJS){const{filter:et}=C;et!=="none"&&et!==""&&(C.filter="none")}C.scale(1/w,-1/X);let H;if(R.bitmap)H=this.applyTransferMapsToBitmap(R);else if(typeof HTMLElement=="function"&&R instanceof HTMLElement||!R.data)H=R;else{const Mt=this.cachedCanvases.getCanvas("inlineImage",w,X).context;J(Mt,R),H=this.applyTransferMapsToCanvas(Mt)}const st=this._scaleImage(H,(0,p.getCurrentTransformInverse)(C));C.imageSmoothingEnabled=It((0,p.getCurrentTransform)(C),R.interpolate),T(C,st.img,0,0,st.paintWidth,st.paintHeight,0,-X,w,X),this.compose(),this.restore()}paintInlineImageXObjectGroup(R,w){if(!this.contentVisible)return;const X=this.ctx;let C;if(R.bitmap)C=R.bitmap;else{const H=R.width,st=R.height,Mt=this.cachedCanvases.getCanvas("inlineImage",H,st).context;J(Mt,R),C=this.applyTransferMapsToCanvas(Mt)}for(const H of w)X.save(),X.transform(...H.transform),X.scale(1,-1),T(X,C,H.x,H.y,H.w,H.h,0,-1,1,1),X.restore();this.compose()}paintSolidColorImageMask(){this.contentVisible&&(this.ctx.fillRect(0,0,1,1),this.compose())}markPoint(R){}markPointProps(R,w){}beginMarkedContent(R){this.markedContentStack.push({visible:!0})}beginMarkedContentProps(R,w){R==="OC"?this.markedContentStack.push({visible:this.optionalContentConfig.isVisible(w)}):this.markedContentStack.push({visible:!0}),this.contentVisible=this.isContentVisible()}endMarkedContent(){this.markedContentStack.pop(),this.contentVisible=this.isContentVisible()}beginCompat(){}endCompat(){}consumePath(R){const w=this.current.isEmptyClip();this.pendingClip&&this.current.updateClipFromPath(),this.pendingClip||this.compose(R);const X=this.ctx;this.pendingClip&&(w||(this.pendingClip===zt?X.clip("evenodd"):X.clip()),this.pendingClip=null),this.current.startNewPathAndClipBox(this.current.clipBox),X.beginPath()}getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){const R=(0,p.getCurrentTransform)(this.ctx);if(R[1]===0&&R[2]===0)this._cachedGetSinglePixelWidth=1/Math.min(Math.abs(R[0]),Math.abs(R[3]));else{const w=Math.abs(R[0]*R[3]-R[2]*R[1]),X=Math.hypot(R[0],R[2]),C=Math.hypot(R[1],R[3]);this._cachedGetSinglePixelWidth=Math.max(X,C)/w}}return this._cachedGetSinglePixelWidth}getScaleForStroking(){if(this._cachedScaleForStroking[0]===-1){const{lineWidth:R}=this.current,{a:w,b:X,c:C,d:H}=this.ctx.getTransform();let st,et;if(X===0&&C===0){const Mt=Math.abs(w),Rt=Math.abs(H);if(Mt===Rt)if(R===0)st=et=1/Mt;else{const gt=Mt*R;st=et=gt<1?1/gt:1}else if(R===0)st=1/Mt,et=1/Rt;else{const gt=Mt*R,Jt=Rt*R;st=gt<1?1/gt:1,et=Jt<1?1/Jt:1}}else{const Mt=Math.abs(w*H-X*C),Rt=Math.hypot(w,X),gt=Math.hypot(C,H);if(R===0)st=gt/Mt,et=Rt/Mt;else{const Jt=R*Mt;st=gt>Jt?gt/Jt:1,et=Rt>Jt?Rt/Jt:1}}this._cachedScaleForStroking[0]=st,this._cachedScaleForStroking[1]=et}return this._cachedScaleForStroking}rescaleAndStroke(R){const{ctx:w}=this,{lineWidth:X}=this.current,[C,H]=this.getScaleForStroking();if(w.lineWidth=X||1,C===1&&H===1){w.stroke();return}const st=w.getLineDash();if(R&&w.save(),w.scale(C,H),st.length>0){const et=Math.max(C,H);w.setLineDash(st.map(Mt=>Mt/et)),w.lineDashOffset/=et}w.stroke(),R&&w.restore()}isContentVisible(){for(let R=this.markedContentStack.length-1;R>=0;R--)if(!this.markedContentStack[R].visible)return!1;return!0}};Nt=new WeakSet,De=function(){for(;this.stateStack.length||this.inSMaskMode;)this.restore();this.ctx.restore(),this.transparentCanvas&&(this.ctx=this.compositeCtx,this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.drawImage(this.transparentCanvas,0,0),this.ctx.restore(),this.transparentCanvas=null)},Vt=new WeakSet,je=function(){if(this.pageColors){const R=this.filterFactory.addHCMFilter(this.pageColors.foreground,this.pageColors.background);if(R!=="none"){const w=this.ctx.filter;this.ctx.filter=R,this.ctx.drawImage(this.ctx.canvas,0,0),this.ctx.filter=w}}};let Gt=Pt;r.CanvasGraphics=Gt;for(const at in M.OPS)Gt.prototype[at]!==void 0&&(Gt.prototype[M.OPS[at]]=Gt.prototype[at])},(lt,r,h)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.TilingPattern=r.PathType=void 0,r.getShadingPattern=f;var M=h(1),p=h(6);const B={FILL:"Fill",STROKE:"Stroke",SHADING:"Shading"};r.PathType=B;function Q(g,F){if(!F)return;const J=F[2]-F[0],v=F[3]-F[1],u=new Path2D;u.rect(F[0],F[1],J,v),g.clip(u)}class U{constructor(){this.constructor===U&&(0,M.unreachable)("Cannot initialize BaseShadingPattern.")}getPattern(){(0,M.unreachable)("Abstract method `getPattern` called.")}}class O extends U{constructor(F){super(),this._type=F[1],this._bbox=F[2],this._colorStops=F[3],this._p0=F[4],this._p1=F[5],this._r0=F[6],this._r1=F[7],this.matrix=null}_createGradient(F){let J;this._type==="axial"?J=F.createLinearGradient(this._p0[0],this._p0[1],this._p1[0],this._p1[1]):this._type==="radial"&&(J=F.createRadialGradient(this._p0[0],this._p0[1],this._r0,this._p1[0],this._p1[1],this._r1));for(const v of this._colorStops)J.addColorStop(v[0],v[1]);return J}getPattern(F,J,v,u){let m;if(u===B.STROKE||u===B.FILL){const _=J.current.getClippedPathBoundingBox(u,(0,p.getCurrentTransform)(F))||[0,0,0,0],$=Math.ceil(_[2]-_[0])||1,P=Math.ceil(_[3]-_[1])||1,Zt=J.cachedCanvases.getCanvas("pattern",$,P,!0),dt=Zt.context;dt.clearRect(0,0,dt.canvas.width,dt.canvas.height),dt.beginPath(),dt.rect(0,0,dt.canvas.width,dt.canvas.height),dt.translate(-_[0],-_[1]),v=M.Util.transform(v,[1,0,0,1,_[0],_[1]]),dt.transform(...J.baseTransform),this.matrix&&dt.transform(...this.matrix),Q(dt,this._bbox),dt.fillStyle=this._createGradient(dt),dt.fill(),m=F.createPattern(Zt.canvas,"no-repeat");const It=new DOMMatrix(v);m.setTransform(It)}else Q(F,this._bbox),m=this._createGradient(F);return m}}function I(g,F,J,v,u,m,_,$){const P=F.coords,Zt=F.colors,dt=g.data,It=g.width*4;let xt;P[J+1]>P[v+1]&&(xt=J,J=v,v=xt,xt=m,m=_,_=xt),P[v+1]>P[u+1]&&(xt=v,v=u,u=xt,xt=_,_=$,$=xt),P[J+1]>P[v+1]&&(xt=J,J=v,v=xt,xt=m,m=_,_=xt);const it=(P[J]+F.offsetX)*F.scaleX,Xt=(P[J+1]+F.offsetY)*F.scaleY,zt=(P[v]+F.offsetX)*F.scaleX,Gt=(P[v+1]+F.offsetY)*F.scaleY,Nt=(P[u]+F.offsetX)*F.scaleX,Ut=(P[u+1]+F.offsetY)*F.scaleY;if(Xt>=Ut)return;const Vt=Zt[m],Ht=Zt[m+1],Pt=Zt[m+2],at=Zt[_],R=Zt[_+1],w=Zt[_+2],X=Zt[$],C=Zt[$+1],H=Zt[$+2],st=Math.round(Xt),et=Math.round(Ut);let Mt,Rt,gt,Jt,Dt,qt,vt,cl;for(let bl=st;bl<=et;bl++){if(bl<Gt){const pt=bl<Xt?0:(Xt-bl)/(Xt-Gt);Mt=it-(it-zt)*pt,Rt=Vt-(Vt-at)*pt,gt=Ht-(Ht-R)*pt,Jt=Pt-(Pt-w)*pt}else{let pt;bl>Ut?pt=1:Gt===Ut?pt=0:pt=(Gt-bl)/(Gt-Ut),Mt=zt-(zt-Nt)*pt,Rt=at-(at-X)*pt,gt=R-(R-C)*pt,Jt=w-(w-H)*pt}let il;bl<Xt?il=0:bl>Ut?il=1:il=(Xt-bl)/(Xt-Ut),Dt=it-(it-Nt)*il,qt=Vt-(Vt-X)*il,vt=Ht-(Ht-C)*il,cl=Pt-(Pt-H)*il;const Bt=Math.round(Math.min(Mt,Dt)),Ft=Math.round(Math.max(Mt,Dt));let wt=It*bl+Bt*4;for(let pt=Bt;pt<=Ft;pt++)il=(Mt-pt)/(Mt-Dt),il<0?il=0:il>1&&(il=1),dt[wt++]=Rt-(Rt-qt)*il|0,dt[wt++]=gt-(gt-vt)*il|0,dt[wt++]=Jt-(Jt-cl)*il|0,dt[wt++]=255}}function j(g,F,J){const v=F.coords,u=F.colors;let m,_;switch(F.type){case"lattice":const $=F.verticesPerRow,P=Math.floor(v.length/$)-1,Zt=$-1;for(m=0;m<P;m++){let dt=m*$;for(let It=0;It<Zt;It++,dt++)I(g,J,v[dt],v[dt+1],v[dt+$],u[dt],u[dt+1],u[dt+$]),I(g,J,v[dt+$+1],v[dt+1],v[dt+$],u[dt+$+1],u[dt+1],u[dt+$])}break;case"triangles":for(m=0,_=v.length;m<_;m+=3)I(g,J,v[m],v[m+1],v[m+2],u[m],u[m+1],u[m+2]);break;default:throw new Error("illegal figure")}}class q extends U{constructor(F){super(),this._coords=F[2],this._colors=F[3],this._figures=F[4],this._bounds=F[5],this._bbox=F[7],this._background=F[8],this.matrix=null}_createMeshCanvas(F,J,v){const $=Math.floor(this._bounds[0]),P=Math.floor(this._bounds[1]),Zt=Math.ceil(this._bounds[2])-$,dt=Math.ceil(this._bounds[3])-P,It=Math.min(Math.ceil(Math.abs(Zt*F[0]*1.1)),3e3),xt=Math.min(Math.ceil(Math.abs(dt*F[1]*1.1)),3e3),it=Zt/It,Xt=dt/xt,zt={coords:this._coords,colors:this._colors,offsetX:-$,offsetY:-P,scaleX:1/it,scaleY:1/Xt},Gt=It+2*2,Nt=xt+2*2,Ut=v.getCanvas("mesh",Gt,Nt,!1),Vt=Ut.context,Ht=Vt.createImageData(It,xt);if(J){const at=Ht.data;for(let R=0,w=at.length;R<w;R+=4)at[R]=J[0],at[R+1]=J[1],at[R+2]=J[2],at[R+3]=255}for(const at of this._figures)j(Ht,at,zt);return Vt.putImageData(Ht,2,2),{canvas:Ut.canvas,offsetX:$-2*it,offsetY:P-2*Xt,scaleX:it,scaleY:Xt}}getPattern(F,J,v,u){Q(F,this._bbox);let m;if(u===B.SHADING)m=M.Util.singularValueDecompose2dScale((0,p.getCurrentTransform)(F));else if(m=M.Util.singularValueDecompose2dScale(J.baseTransform),this.matrix){const $=M.Util.singularValueDecompose2dScale(this.matrix);m=[m[0]*$[0],m[1]*$[1]]}const _=this._createMeshCanvas(m,u===B.SHADING?null:this._background,J.cachedCanvases);return u!==B.SHADING&&(F.setTransform(...J.baseTransform),this.matrix&&F.transform(...this.matrix)),F.translate(_.offsetX,_.offsetY),F.scale(_.scaleX,_.scaleY),F.createPattern(_.canvas,"no-repeat")}}class K extends U{getPattern(){return"hotpink"}}function f(g){switch(g[0]){case"RadialAxial":return new O(g);case"Mesh":return new q(g);case"Dummy":return new K}throw new Error(`Unknown IR type: ${g[0]}`)}const S={COLORED:1,UNCOLORED:2},T=class T{constructor(F,J,v,u,m){this.operatorList=F[2],this.matrix=F[3]||[1,0,0,1,0,0],this.bbox=F[4],this.xstep=F[5],this.ystep=F[6],this.paintType=F[7],this.tilingType=F[8],this.color=J,this.ctx=v,this.canvasGraphicsFactory=u,this.baseTransform=m}createPatternCanvas(F){const J=this.operatorList,v=this.bbox,u=this.xstep,m=this.ystep,_=this.paintType,$=this.tilingType,P=this.color,Zt=this.canvasGraphicsFactory;(0,M.info)("TilingType: "+$);const dt=v[0],It=v[1],xt=v[2],it=v[3],Xt=M.Util.singularValueDecompose2dScale(this.matrix),zt=M.Util.singularValueDecompose2dScale(this.baseTransform),Gt=[Xt[0]*zt[0],Xt[1]*zt[1]],Nt=this.getSizeAndScale(u,this.ctx.canvas.width,Gt[0]),Ut=this.getSizeAndScale(m,this.ctx.canvas.height,Gt[1]),Vt=F.cachedCanvases.getCanvas("pattern",Nt.size,Ut.size,!0),Ht=Vt.context,Pt=Zt.createCanvasGraphics(Ht);Pt.groupLevel=F.groupLevel,this.setFillAndStrokeStyleToContext(Pt,_,P);let at=dt,R=It,w=xt,X=it;return dt<0&&(at=0,w+=Math.abs(dt)),It<0&&(R=0,X+=Math.abs(It)),Ht.translate(-(Nt.scale*at),-(Ut.scale*R)),Pt.transform(Nt.scale,0,0,Ut.scale,0,0),Ht.save(),this.clipBbox(Pt,at,R,w,X),Pt.baseTransform=(0,p.getCurrentTransform)(Pt.ctx),Pt.executeOperatorList(J),Pt.endDrawing(),{canvas:Vt.canvas,scaleX:Nt.scale,scaleY:Ut.scale,offsetX:at,offsetY:R}}getSizeAndScale(F,J,v){F=Math.abs(F);const u=Math.max(T.MAX_PATTERN_SIZE,J);let m=Math.ceil(F*v);return m>=u?m=u:v=m/F,{scale:v,size:m}}clipBbox(F,J,v,u,m){const _=u-J,$=m-v;F.ctx.rect(J,v,_,$),F.current.updateRectMinMax((0,p.getCurrentTransform)(F.ctx),[J,v,u,m]),F.clip(),F.endPath()}setFillAndStrokeStyleToContext(F,J,v){const u=F.ctx,m=F.current;switch(J){case S.COLORED:const _=this.ctx;u.fillStyle=_.fillStyle,u.strokeStyle=_.strokeStyle,m.fillColor=_.fillStyle,m.strokeColor=_.strokeStyle;break;case S.UNCOLORED:const $=M.Util.makeHexColor(v[0],v[1],v[2]);u.fillStyle=$,u.strokeStyle=$,m.fillColor=$,m.strokeColor=$;break;default:throw new M.FormatError(`Unsupported paint type: ${J}`)}}getPattern(F,J,v,u){let m=v;u!==B.SHADING&&(m=M.Util.transform(m,J.baseTransform),this.matrix&&(m=M.Util.transform(m,this.matrix)));const _=this.createPatternCanvas(J);let $=new DOMMatrix(m);$=$.translate(_.offsetX,_.offsetY),$=$.scale(1/_.scaleX,1/_.scaleY);const P=F.createPattern(_.canvas,"repeat");return P.setTransform($),P}};gl(T,"MAX_PATTERN_SIZE",3e3);let k=T;r.TilingPattern=k},(lt,r,h)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.convertBlackAndWhiteToRGBA=B,r.convertToRGBA=p,r.grayToRGBA=U;var M=h(1);function p(O){switch(O.kind){case M.ImageKind.GRAYSCALE_1BPP:return B(O);case M.ImageKind.RGB_24BPP:return Q(O)}return null}function B({src:O,srcPos:I=0,dest:j,width:q,height:K,nonBlackColor:f=4294967295,inverseDecode:S=!1}){const k=M.FeatureTest.isLittleEndian?4278190080:255,[T,g]=S?[f,k]:[k,f],F=q>>3,J=q&7,v=O.length;j=new Uint32Array(j.buffer);let u=0;for(let m=0;m<K;m++){for(const $=I+F;I<$;I++){const P=I<v?O[I]:255;j[u++]=P&128?g:T,j[u++]=P&64?g:T,j[u++]=P&32?g:T,j[u++]=P&16?g:T,j[u++]=P&8?g:T,j[u++]=P&4?g:T,j[u++]=P&2?g:T,j[u++]=P&1?g:T}if(J===0)continue;const _=I<v?O[I++]:255;for(let $=0;$<J;$++)j[u++]=_&1<<7-$?g:T}return{srcPos:I,destPos:u}}function Q({src:O,srcPos:I=0,dest:j,destPos:q=0,width:K,height:f}){let S=0;const k=O.length>>2,T=new Uint32Array(O.buffer,I,k);if(M.FeatureTest.isLittleEndian){for(;S<k-2;S+=3,q+=4){const g=T[S],F=T[S+1],J=T[S+2];j[q]=g|4278190080,j[q+1]=g>>>24|F<<8|4278190080,j[q+2]=F>>>16|J<<16|4278190080,j[q+3]=J>>>8|4278190080}for(let g=S*4,F=O.length;g<F;g+=3)j[q++]=O[g]|O[g+1]<<8|O[g+2]<<16|4278190080}else{for(;S<k-2;S+=3,q+=4){const g=T[S],F=T[S+1],J=T[S+2];j[q]=g|255,j[q+1]=g<<24|F>>>8|255,j[q+2]=F<<16|J>>>16|255,j[q+3]=J<<8|255}for(let g=S*4,F=O.length;g<F;g+=3)j[q++]=O[g]<<24|O[g+1]<<16|O[g+2]<<8|255}return{srcPos:I,destPos:q}}function U(O,I){if(M.FeatureTest.isLittleEndian)for(let j=0,q=O.length;j<q;j++)I[j]=O[j]*65793|4278190080;else for(let j=0,q=O.length;j<q;j++)I[j]=O[j]*16843008|255}},(lt,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.GlobalWorkerOptions=void 0;const h=Object.create(null);r.GlobalWorkerOptions=h,h.workerPort=null,h.workerSrc=""},(lt,r,h)=>{var O,os,j,ms,K,he;Object.defineProperty(r,"__esModule",{value:!0}),r.MessageHandler=void 0;var M=h(1);const p={UNKNOWN:0,DATA:1,ERROR:2},B={UNKNOWN:0,CANCEL:1,CANCEL_COMPLETE:2,CLOSE:3,ENQUEUE:4,ERROR:5,PULL:6,PULL_COMPLETE:7,START_COMPLETE:8};function Q(S){switch(S instanceof Error||typeof S=="object"&&S!==null||(0,M.unreachable)('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),S.name){case"AbortException":return new M.AbortException(S.message);case"MissingPDFException":return new M.MissingPDFException(S.message);case"PasswordException":return new M.PasswordException(S.message,S.code);case"UnexpectedResponseException":return new M.UnexpectedResponseException(S.message,S.status);case"UnknownErrorException":return new M.UnknownErrorException(S.message,S.details);default:return new M.UnknownErrorException(S.message,S.toString())}}class U{constructor(k,T,g){ll(this,O);ll(this,j);ll(this,K);this.sourceName=k,this.targetName=T,this.comObj=g,this.callbackId=1,this.streamId=1,this.streamSinks=Object.create(null),this.streamControllers=Object.create(null),this.callbackCapabilities=Object.create(null),this.actionHandler=Object.create(null),this._onComObjOnMessage=F=>{const J=F.data;if(J.targetName!==this.sourceName)return;if(J.stream){nl(this,j,ms).call(this,J);return}if(J.callback){const u=J.callbackId,m=this.callbackCapabilities[u];if(!m)throw new Error(`Cannot resolve callback ${u}`);if(delete this.callbackCapabilities[u],J.callback===p.DATA)m.resolve(J.data);else if(J.callback===p.ERROR)m.reject(Q(J.reason));else throw new Error("Unexpected callback case");return}const v=this.actionHandler[J.action];if(!v)throw new Error(`Unknown action from worker: ${J.action}`);if(J.callbackId){const u=this.sourceName,m=J.sourceName;new Promise(function(_){_(v(J.data))}).then(function(_){g.postMessage({sourceName:u,targetName:m,callback:p.DATA,callbackId:J.callbackId,data:_})},function(_){g.postMessage({sourceName:u,targetName:m,callback:p.ERROR,callbackId:J.callbackId,reason:Q(_)})});return}if(J.streamId){nl(this,O,os).call(this,J);return}v(J.data)},g.addEventListener("message",this._onComObjOnMessage)}on(k,T){const g=this.actionHandler;if(g[k])throw new Error(`There is already an actionName called "${k}"`);g[k]=T}send(k,T,g){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:k,data:T},g)}sendWithPromise(k,T,g){const F=this.callbackId++,J=new M.PromiseCapability;this.callbackCapabilities[F]=J;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:k,callbackId:F,data:T},g)}catch(v){J.reject(v)}return J.promise}sendWithStream(k,T,g,F){const J=this.streamId++,v=this.sourceName,u=this.targetName,m=this.comObj;return new ReadableStream({start:_=>{const $=new M.PromiseCapability;return this.streamControllers[J]={controller:_,startCall:$,pullCall:null,cancelCall:null,isClosed:!1},m.postMessage({sourceName:v,targetName:u,action:k,streamId:J,data:T,desiredSize:_.desiredSize},F),$.promise},pull:_=>{const $=new M.PromiseCapability;return this.streamControllers[J].pullCall=$,m.postMessage({sourceName:v,targetName:u,stream:B.PULL,streamId:J,desiredSize:_.desiredSize}),$.promise},cancel:_=>{(0,M.assert)(_ instanceof Error,"cancel must have a valid reason");const $=new M.PromiseCapability;return this.streamControllers[J].cancelCall=$,this.streamControllers[J].isClosed=!0,m.postMessage({sourceName:v,targetName:u,stream:B.CANCEL,streamId:J,reason:Q(_)}),$.promise}},g)}destroy(){this.comObj.removeEventListener("message",this._onComObjOnMessage)}}O=new WeakSet,os=function(k){const T=k.streamId,g=this.sourceName,F=k.sourceName,J=this.comObj,v=this,u=this.actionHandler[k.action],m={enqueue(_,$=1,P){if(this.isCancelled)return;const Zt=this.desiredSize;this.desiredSize-=$,Zt>0&&this.desiredSize<=0&&(this.sinkCapability=new M.PromiseCapability,this.ready=this.sinkCapability.promise),J.postMessage({sourceName:g,targetName:F,stream:B.ENQUEUE,streamId:T,chunk:_},P)},close(){this.isCancelled||(this.isCancelled=!0,J.postMessage({sourceName:g,targetName:F,stream:B.CLOSE,streamId:T}),delete v.streamSinks[T])},error(_){(0,M.assert)(_ instanceof Error,"error must have a valid reason"),!this.isCancelled&&(this.isCancelled=!0,J.postMessage({sourceName:g,targetName:F,stream:B.ERROR,streamId:T,reason:Q(_)}))},sinkCapability:new M.PromiseCapability,onPull:null,onCancel:null,isCancelled:!1,desiredSize:k.desiredSize,ready:null};m.sinkCapability.resolve(),m.ready=m.sinkCapability.promise,this.streamSinks[T]=m,new Promise(function(_){_(u(k.data,m))}).then(function(){J.postMessage({sourceName:g,targetName:F,stream:B.START_COMPLETE,streamId:T,success:!0})},function(_){J.postMessage({sourceName:g,targetName:F,stream:B.START_COMPLETE,streamId:T,reason:Q(_)})})},j=new WeakSet,ms=function(k){const T=k.streamId,g=this.sourceName,F=k.sourceName,J=this.comObj,v=this.streamControllers[T],u=this.streamSinks[T];switch(k.stream){case B.START_COMPLETE:k.success?v.startCall.resolve():v.startCall.reject(Q(k.reason));break;case B.PULL_COMPLETE:k.success?v.pullCall.resolve():v.pullCall.reject(Q(k.reason));break;case B.PULL:if(!u){J.postMessage({sourceName:g,targetName:F,stream:B.PULL_COMPLETE,streamId:T,success:!0});break}u.desiredSize<=0&&k.desiredSize>0&&u.sinkCapability.resolve(),u.desiredSize=k.desiredSize,new Promise(function(m){var _;m((_=u.onPull)==null?void 0:_.call(u))}).then(function(){J.postMessage({sourceName:g,targetName:F,stream:B.PULL_COMPLETE,streamId:T,success:!0})},function(m){J.postMessage({sourceName:g,targetName:F,stream:B.PULL_COMPLETE,streamId:T,reason:Q(m)})});break;case B.ENQUEUE:if((0,M.assert)(v,"enqueue should have stream controller"),v.isClosed)break;v.controller.enqueue(k.chunk);break;case B.CLOSE:if((0,M.assert)(v,"close should have stream controller"),v.isClosed)break;v.isClosed=!0,v.controller.close(),nl(this,K,he).call(this,v,T);break;case B.ERROR:(0,M.assert)(v,"error should have stream controller"),v.controller.error(Q(k.reason)),nl(this,K,he).call(this,v,T);break;case B.CANCEL_COMPLETE:k.success?v.cancelCall.resolve():v.cancelCall.reject(Q(k.reason)),nl(this,K,he).call(this,v,T);break;case B.CANCEL:if(!u)break;new Promise(function(m){var _;m((_=u.onCancel)==null?void 0:_.call(u,Q(k.reason)))}).then(function(){J.postMessage({sourceName:g,targetName:F,stream:B.CANCEL_COMPLETE,streamId:T,success:!0})},function(m){J.postMessage({sourceName:g,targetName:F,stream:B.CANCEL_COMPLETE,streamId:T,reason:Q(m)})}),u.sinkCapability.reject(Q(k.reason)),u.isCancelled=!0,delete this.streamSinks[T];break;default:throw new Error("Unexpected stream case")}},K=new WeakSet,he=async function(k,T){var g,F,J;await Promise.allSettled([(g=k.startCall)==null?void 0:g.promise,(F=k.pullCall)==null?void 0:F.promise,(J=k.cancelCall)==null?void 0:J.promise]),delete this.streamControllers[T]},r.MessageHandler=U},(lt,r,h)=>{var B,Q;Object.defineProperty(r,"__esModule",{value:!0}),r.Metadata=void 0;var M=h(1);class p{constructor({parsedData:O,rawData:I}){ll(this,B,void 0);ll(this,Q,void 0);ul(this,B,O),ul(this,Q,I)}getRaw(){return bt(this,Q)}get(O){return bt(this,B).get(O)??null}getAll(){return(0,M.objectFromMap)(bt(this,B))}has(O){return bt(this,B).has(O)}}B=new WeakMap,Q=new WeakMap,r.Metadata=p},(lt,r,h)=>{var O,I,j,q,K,f,Ce;Object.defineProperty(r,"__esModule",{value:!0}),r.OptionalContentConfig=void 0;var M=h(1),p=h(8);const B=Symbol("INTERNAL");class Q{constructor(T,g){ll(this,O,!0);this.name=T,this.intent=g}get visible(){return bt(this,O)}_setVisible(T,g){T!==B&&(0,M.unreachable)("Internal method `_setVisible` called."),ul(this,O,g)}}O=new WeakMap;class U{constructor(T){ll(this,f);ll(this,I,null);ll(this,j,new Map);ll(this,q,null);ll(this,K,null);if(this.name=null,this.creator=null,T!==null){this.name=T.name,this.creator=T.creator,ul(this,K,T.order);for(const g of T.groups)bt(this,j).set(g.id,new Q(g.name,g.intent));if(T.baseState==="OFF")for(const g of bt(this,j).values())g._setVisible(B,!1);for(const g of T.on)bt(this,j).get(g)._setVisible(B,!0);for(const g of T.off)bt(this,j).get(g)._setVisible(B,!1);ul(this,q,this.getHash())}}isVisible(T){if(bt(this,j).size===0)return!0;if(!T)return(0,M.warn)("Optional content group not defined."),!0;if(T.type==="OCG")return bt(this,j).has(T.id)?bt(this,j).get(T.id).visible:((0,M.warn)(`Optional content group not found: ${T.id}`),!0);if(T.type==="OCMD"){if(T.expression)return nl(this,f,Ce).call(this,T.expression);if(!T.policy||T.policy==="AnyOn"){for(const g of T.ids){if(!bt(this,j).has(g))return(0,M.warn)(`Optional content group not found: ${g}`),!0;if(bt(this,j).get(g).visible)return!0}return!1}else if(T.policy==="AllOn"){for(const g of T.ids){if(!bt(this,j).has(g))return(0,M.warn)(`Optional content group not found: ${g}`),!0;if(!bt(this,j).get(g).visible)return!1}return!0}else if(T.policy==="AnyOff"){for(const g of T.ids){if(!bt(this,j).has(g))return(0,M.warn)(`Optional content group not found: ${g}`),!0;if(!bt(this,j).get(g).visible)return!0}return!1}else if(T.policy==="AllOff"){for(const g of T.ids){if(!bt(this,j).has(g))return(0,M.warn)(`Optional content group not found: ${g}`),!0;if(bt(this,j).get(g).visible)return!1}return!0}return(0,M.warn)(`Unknown optional content policy ${T.policy}.`),!0}return(0,M.warn)(`Unknown group type ${T.type}.`),!0}setVisibility(T,g=!0){if(!bt(this,j).has(T)){(0,M.warn)(`Optional content group not found: ${T}`);return}bt(this,j).get(T)._setVisible(B,!!g),ul(this,I,null)}get hasInitialVisibility(){return bt(this,q)===null||this.getHash()===bt(this,q)}getOrder(){return bt(this,j).size?bt(this,K)?bt(this,K).slice():[...bt(this,j).keys()]:null}getGroups(){return bt(this,j).size>0?(0,M.objectFromMap)(bt(this,j)):null}getGroup(T){return bt(this,j).get(T)||null}getHash(){if(bt(this,I)!==null)return bt(this,I);const T=new p.MurmurHash3_64;for(const[g,F]of bt(this,j))T.update(`${g}:${F.visible}`);return ul(this,I,T.hexdigest())}}I=new WeakMap,j=new WeakMap,q=new WeakMap,K=new WeakMap,f=new WeakSet,Ce=function(T){const g=T.length;if(g<2)return!0;const F=T[0];for(let J=1;J<g;J++){const v=T[J];let u;if(Array.isArray(v))u=nl(this,f,Ce).call(this,v);else if(bt(this,j).has(v))u=bt(this,j).get(v).visible;else return(0,M.warn)(`Optional content group not found: ${v}`),!0;switch(F){case"And":if(!u)return!1;break;case"Or":if(u)return!0;break;case"Not":return!u;default:return!0}}return F==="And"},r.OptionalContentConfig=U},(lt,r,h)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.PDFDataTransportStream=void 0;var M=h(1),p=h(6);class B{constructor({length:I,initialData:j,progressiveDone:q=!1,contentDispositionFilename:K=null,disableRange:f=!1,disableStream:S=!1},k){if((0,M.assert)(k,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.'),this._queuedChunks=[],this._progressiveDone=q,this._contentDispositionFilename=K,(j==null?void 0:j.length)>0){const T=j instanceof Uint8Array&&j.byteLength===j.buffer.byteLength?j.buffer:new Uint8Array(j).buffer;this._queuedChunks.push(T)}this._pdfDataRangeTransport=k,this._isStreamingSupported=!S,this._isRangeSupported=!f,this._contentLength=I,this._fullRequestReader=null,this._rangeReaders=[],this._pdfDataRangeTransport.addRangeListener((T,g)=>{this._onReceiveData({begin:T,chunk:g})}),this._pdfDataRangeTransport.addProgressListener((T,g)=>{this._onProgress({loaded:T,total:g})}),this._pdfDataRangeTransport.addProgressiveReadListener(T=>{this._onReceiveData({chunk:T})}),this._pdfDataRangeTransport.addProgressiveDoneListener(()=>{this._onProgressiveDone()}),this._pdfDataRangeTransport.transportReady()}_onReceiveData({begin:I,chunk:j}){const q=j instanceof Uint8Array&&j.byteLength===j.buffer.byteLength?j.buffer:new Uint8Array(j).buffer;if(I===void 0)this._fullRequestReader?this._fullRequestReader._enqueue(q):this._queuedChunks.push(q);else{const K=this._rangeReaders.some(function(f){return f._begin!==I?!1:(f._enqueue(q),!0)});(0,M.assert)(K,"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}get _progressiveDataLength(){var I;return((I=this._fullRequestReader)==null?void 0:I._loaded)??0}_onProgress(I){var j,q,K,f;I.total===void 0?(q=(j=this._rangeReaders[0])==null?void 0:j.onProgress)==null||q.call(j,{loaded:I.loaded}):(f=(K=this._fullRequestReader)==null?void 0:K.onProgress)==null||f.call(K,{loaded:I.loaded,total:I.total})}_onProgressiveDone(){var I;(I=this._fullRequestReader)==null||I.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(I){const j=this._rangeReaders.indexOf(I);j>=0&&this._rangeReaders.splice(j,1)}getFullReader(){(0,M.assert)(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");const I=this._queuedChunks;return this._queuedChunks=null,new Q(this,I,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(I,j){if(j<=this._progressiveDataLength)return null;const q=new U(this,I,j);return this._pdfDataRangeTransport.requestDataRange(I,j),this._rangeReaders.push(q),q}cancelAllRequests(I){var j;(j=this._fullRequestReader)==null||j.cancel(I);for(const q of this._rangeReaders.slice(0))q.cancel(I);this._pdfDataRangeTransport.abort()}}r.PDFDataTransportStream=B;class Q{constructor(I,j,q=!1,K=null){this._stream=I,this._done=q||!1,this._filename=(0,p.isPdfFile)(K)?K:null,this._queuedChunks=j||[],this._loaded=0;for(const f of this._queuedChunks)this._loaded+=f.byteLength;this._requests=[],this._headersReady=Promise.resolve(),I._fullRequestReader=this,this.onProgress=null}_enqueue(I){this._done||(this._requests.length>0?this._requests.shift().resolve({value:I,done:!1}):this._queuedChunks.push(I),this._loaded+=I.byteLength)}get headersReady(){return this._headersReady}get filename(){return this._filename}get isRangeSupported(){return this._stream._isRangeSupported}get isStreamingSupported(){return this._stream._isStreamingSupported}get contentLength(){return this._stream._contentLength}async read(){if(this._queuedChunks.length>0)return{value:this._queuedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};const I=new M.PromiseCapability;return this._requests.push(I),I.promise}cancel(I){this._done=!0;for(const j of this._requests)j.resolve({value:void 0,done:!0});this._requests.length=0}progressiveDone(){this._done||(this._done=!0)}}class U{constructor(I,j,q){this._stream=I,this._begin=j,this._end=q,this._queuedChunk=null,this._requests=[],this._done=!1,this.onProgress=null}_enqueue(I){if(!this._done){if(this._requests.length===0)this._queuedChunk=I;else{this._requests.shift().resolve({value:I,done:!1});for(const q of this._requests)q.resolve({value:void 0,done:!0});this._requests.length=0}this._done=!0,this._stream._removeRangeReader(this)}}get isStreamingSupported(){return!1}async read(){if(this._queuedChunk){const j=this._queuedChunk;return this._queuedChunk=null,{value:j,done:!1}}if(this._done)return{value:void 0,done:!0};const I=new M.PromiseCapability;return this._requests.push(I),I.promise}cancel(I){this._done=!0;for(const j of this._requests)j.resolve({value:void 0,done:!0});this._requests.length=0,this._stream._removeRangeReader(this)}}},(lt,r,h)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.PDFFetchStream=void 0;var M=h(1),p=h(20);function B(q,K,f){return{method:"GET",headers:q,signal:f.signal,mode:"cors",credentials:K?"include":"same-origin",redirect:"follow"}}function Q(q){const K=new Headers;for(const f in q){const S=q[f];S!==void 0&&K.append(f,S)}return K}function U(q){return q instanceof Uint8Array?q.buffer:q instanceof ArrayBuffer?q:((0,M.warn)(`getArrayBuffer - unexpected data format: ${q}`),new Uint8Array(q).buffer)}class O{constructor(K){this.source=K,this.isHttp=/^https?:/i.test(K.url),this.httpHeaders=this.isHttp&&K.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){var K;return((K=this._fullRequestReader)==null?void 0:K._loaded)??0}getFullReader(){return(0,M.assert)(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new I(this),this._fullRequestReader}getRangeReader(K,f){if(f<=this._progressiveDataLength)return null;const S=new j(this,K,f);return this._rangeRequestReaders.push(S),S}cancelAllRequests(K){var f;(f=this._fullRequestReader)==null||f.cancel(K);for(const S of this._rangeRequestReaders.slice(0))S.cancel(K)}}r.PDFFetchStream=O;class I{constructor(K){this._stream=K,this._reader=null,this._loaded=0,this._filename=null;const f=K.source;this._withCredentials=f.withCredentials||!1,this._contentLength=f.length,this._headersCapability=new M.PromiseCapability,this._disableRange=f.disableRange||!1,this._rangeChunkSize=f.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._abortController=new AbortController,this._isStreamingSupported=!f.disableStream,this._isRangeSupported=!f.disableRange,this._headers=Q(this._stream.httpHeaders);const S=f.url;fetch(S,B(this._headers,this._withCredentials,this._abortController)).then(k=>{if(!(0,p.validateResponseStatus)(k.status))throw(0,p.createResponseStatusError)(k.status,S);this._reader=k.body.getReader(),this._headersCapability.resolve();const T=J=>k.headers.get(J),{allowRangeRequests:g,suggestedLength:F}=(0,p.validateRangeRequestCapabilities)({getResponseHeader:T,isHttp:this._stream.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=g,this._contentLength=F||this._contentLength,this._filename=(0,p.extractFilenameFromHeader)(T),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new M.AbortException("Streaming is disabled."))}).catch(this._headersCapability.reject),this.onProgress=null}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){var S;await this._headersCapability.promise;const{value:K,done:f}=await this._reader.read();return f?{value:K,done:f}:(this._loaded+=K.byteLength,(S=this.onProgress)==null||S.call(this,{loaded:this._loaded,total:this._contentLength}),{value:U(K),done:!1})}cancel(K){var f;(f=this._reader)==null||f.cancel(K),this._abortController.abort()}}class j{constructor(K,f,S){this._stream=K,this._reader=null,this._loaded=0;const k=K.source;this._withCredentials=k.withCredentials||!1,this._readCapability=new M.PromiseCapability,this._isStreamingSupported=!k.disableStream,this._abortController=new AbortController,this._headers=Q(this._stream.httpHeaders),this._headers.append("Range",`bytes=${f}-${S-1}`);const T=k.url;fetch(T,B(this._headers,this._withCredentials,this._abortController)).then(g=>{if(!(0,p.validateResponseStatus)(g.status))throw(0,p.createResponseStatusError)(g.status,T);this._readCapability.resolve(),this._reader=g.body.getReader()}).catch(this._readCapability.reject),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){var S;await this._readCapability.promise;const{value:K,done:f}=await this._reader.read();return f?{value:K,done:f}:(this._loaded+=K.byteLength,(S=this.onProgress)==null||S.call(this,{loaded:this._loaded}),{value:U(K),done:!1})}cancel(K){var f;(f=this._reader)==null||f.cancel(K),this._abortController.abort()}}},(lt,r,h)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.createResponseStatusError=O,r.extractFilenameFromHeader=U,r.validateRangeRequestCapabilities=Q,r.validateResponseStatus=I;var M=h(1),p=h(21),B=h(6);function Q({getResponseHeader:j,isHttp:q,rangeChunkSize:K,disableRange:f}){const S={allowRangeRequests:!1,suggestedLength:void 0},k=parseInt(j("Content-Length"),10);return!Number.isInteger(k)||(S.suggestedLength=k,k<=2*K)||f||!q||j("Accept-Ranges")!=="bytes"||(j("Content-Encoding")||"identity")!=="identity"||(S.allowRangeRequests=!0),S}function U(j){const q=j("Content-Disposition");if(q){let K=(0,p.getFilenameFromContentDispositionHeader)(q);if(K.includes("%"))try{K=decodeURIComponent(K)}catch{}if((0,B.isPdfFile)(K))return K}return null}function O(j,q){return j===404||j===0&&q.startsWith("file:")?new M.MissingPDFException('Missing PDF "'+q+'".'):new M.UnexpectedResponseException(`Unexpected server response (${j}) while retrieving PDF "${q}".`,j)}function I(j){return j===200||j===206}},(lt,r,h)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.getFilenameFromContentDispositionHeader=p;var M=h(1);function p(B){let Q=!0,U=O("filename\\*","i").exec(B);if(U){U=U[1];let k=K(U);return k=unescape(k),k=f(k),k=S(k),j(k)}if(U=q(B),U){const k=S(U);return j(k)}if(U=O("filename","i").exec(B),U){U=U[1];let k=K(U);return k=S(k),j(k)}function O(k,T){return new RegExp("(?:^|;)\\s*"+k+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',T)}function I(k,T){if(k){if(!/^[\x00-\xFF]+$/.test(T))return T;try{const g=new TextDecoder(k,{fatal:!0}),F=(0,M.stringToBytes)(T);T=g.decode(F),Q=!1}catch{}}return T}function j(k){return Q&&/[\x80-\xff]/.test(k)&&(k=I("utf-8",k),Q&&(k=I("iso-8859-1",k))),k}function q(k){const T=[];let g;const F=O("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;(g=F.exec(k))!==null;){let[,v,u,m]=g;if(v=parseInt(v,10),v in T){if(v===0)break;continue}T[v]=[u,m]}const J=[];for(let v=0;v<T.length&&v in T;++v){let[u,m]=T[v];m=K(m),u&&(m=unescape(m),v===0&&(m=f(m))),J.push(m)}return J.join("")}function K(k){if(k.startsWith('"')){const T=k.slice(1).split('\\"');for(let g=0;g<T.length;++g){const F=T[g].indexOf('"');F!==-1&&(T[g]=T[g].slice(0,F),T.length=g+1),T[g]=T[g].replaceAll(/\\(.)/g,"$1")}k=T.join('"')}return k}function f(k){const T=k.indexOf("'");if(T===-1)return k;const g=k.slice(0,T),J=k.slice(T+1).replace(/^[^']*'/,"");return I(g,J)}function S(k){return!k.startsWith("=?")||/[\x00-\x19\x80-\xff]/.test(k)?k:k.replaceAll(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,function(T,g,F,J){if(F==="q"||F==="Q")return J=J.replaceAll("_"," "),J=J.replaceAll(/=([0-9a-fA-F]{2})/g,function(v,u){return String.fromCharCode(parseInt(u,16))}),I(g,J);try{J=atob(J)}catch{}return I(g,J)})}return""}},(lt,r,h)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.PDFNetworkStream=void 0;var M=h(1),p=h(20);const B=200,Q=206;function U(K){const f=K.response;return typeof f!="string"?f:(0,M.stringToBytes)(f).buffer}class O{constructor(f,S={}){this.url=f,this.isHttp=/^https?:/i.test(f),this.httpHeaders=this.isHttp&&S.httpHeaders||Object.create(null),this.withCredentials=S.withCredentials||!1,this.currXhrId=0,this.pendingRequests=Object.create(null)}requestRange(f,S,k){const T={begin:f,end:S};for(const g in k)T[g]=k[g];return this.request(T)}requestFull(f){return this.request(f)}request(f){const S=new XMLHttpRequest,k=this.currXhrId++,T=this.pendingRequests[k]={xhr:S};S.open("GET",this.url),S.withCredentials=this.withCredentials;for(const g in this.httpHeaders){const F=this.httpHeaders[g];F!==void 0&&S.setRequestHeader(g,F)}return this.isHttp&&"begin"in f&&"end"in f?(S.setRequestHeader("Range",`bytes=${f.begin}-${f.end-1}`),T.expectedStatus=Q):T.expectedStatus=B,S.responseType="arraybuffer",f.onError&&(S.onerror=function(g){f.onError(S.status)}),S.onreadystatechange=this.onStateChange.bind(this,k),S.onprogress=this.onProgress.bind(this,k),T.onHeadersReceived=f.onHeadersReceived,T.onDone=f.onDone,T.onError=f.onError,T.onProgress=f.onProgress,S.send(null),k}onProgress(f,S){var T;const k=this.pendingRequests[f];k&&((T=k.onProgress)==null||T.call(k,S))}onStateChange(f,S){var v,u,m;const k=this.pendingRequests[f];if(!k)return;const T=k.xhr;if(T.readyState>=2&&k.onHeadersReceived&&(k.onHeadersReceived(),delete k.onHeadersReceived),T.readyState!==4||!(f in this.pendingRequests))return;if(delete this.pendingRequests[f],T.status===0&&this.isHttp){(v=k.onError)==null||v.call(k,T.status);return}const g=T.status||B;if(!(g===B&&k.expectedStatus===Q)&&g!==k.expectedStatus){(u=k.onError)==null||u.call(k,T.status);return}const J=U(T);if(g===Q){const _=T.getResponseHeader("Content-Range"),$=/bytes (\d+)-(\d+)\/(\d+)/.exec(_);k.onDone({begin:parseInt($[1],10),chunk:J})}else J?k.onDone({begin:0,chunk:J}):(m=k.onError)==null||m.call(k,T.status)}getRequestXhr(f){return this.pendingRequests[f].xhr}isPendingRequest(f){return f in this.pendingRequests}abortRequest(f){const S=this.pendingRequests[f].xhr;delete this.pendingRequests[f],S.abort()}}class I{constructor(f){this._source=f,this._manager=new O(f.url,{httpHeaders:f.httpHeaders,withCredentials:f.withCredentials}),this._rangeChunkSize=f.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(f){const S=this._rangeRequestReaders.indexOf(f);S>=0&&this._rangeRequestReaders.splice(S,1)}getFullReader(){return(0,M.assert)(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new j(this._manager,this._source),this._fullRequestReader}getRangeReader(f,S){const k=new q(this._manager,f,S);return k.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(k),k}cancelAllRequests(f){var S;(S=this._fullRequestReader)==null||S.cancel(f);for(const k of this._rangeRequestReaders.slice(0))k.cancel(f)}}r.PDFNetworkStream=I;class j{constructor(f,S){this._manager=f;const k={onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=S.url,this._fullRequestId=f.requestFull(k),this._headersReceivedCapability=new M.PromiseCapability,this._disableRange=S.disableRange||!1,this._contentLength=S.length,this._rangeChunkSize=S.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._isStreamingSupported=!1,this._isRangeSupported=!1,this._cachedChunks=[],this._requests=[],this._done=!1,this._storedError=void 0,this._filename=null,this.onProgress=null}_onHeadersReceived(){const f=this._fullRequestId,S=this._manager.getRequestXhr(f),k=F=>S.getResponseHeader(F),{allowRangeRequests:T,suggestedLength:g}=(0,p.validateRangeRequestCapabilities)({getResponseHeader:k,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});T&&(this._isRangeSupported=!0),this._contentLength=g||this._contentLength,this._filename=(0,p.extractFilenameFromHeader)(k),this._isRangeSupported&&this._manager.abortRequest(f),this._headersReceivedCapability.resolve()}_onDone(f){if(f&&(this._requests.length>0?this._requests.shift().resolve({value:f.chunk,done:!1}):this._cachedChunks.push(f.chunk)),this._done=!0,!(this._cachedChunks.length>0)){for(const S of this._requests)S.resolve({value:void 0,done:!0});this._requests.length=0}}_onError(f){this._storedError=(0,p.createResponseStatusError)(f,this._url),this._headersReceivedCapability.reject(this._storedError);for(const S of this._requests)S.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0}_onProgress(f){var S;(S=this.onProgress)==null||S.call(this,{loaded:f.loaded,total:f.lengthComputable?f.total:this._contentLength})}get filename(){return this._filename}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}get contentLength(){return this._contentLength}get headersReady(){return this._headersReceivedCapability.promise}async read(){if(this._storedError)throw this._storedError;if(this._cachedChunks.length>0)return{value:this._cachedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};const f=new M.PromiseCapability;return this._requests.push(f),f.promise}cancel(f){this._done=!0,this._headersReceivedCapability.reject(f);for(const S of this._requests)S.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId),this._fullRequestReader=null}}class q{constructor(f,S,k){this._manager=f;const T={onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=f.url,this._requestId=f.requestRange(S,k,T),this._requests=[],this._queuedChunk=null,this._done=!1,this._storedError=void 0,this.onProgress=null,this.onClosed=null}_close(){var f;(f=this.onClosed)==null||f.call(this,this)}_onDone(f){const S=f.chunk;this._requests.length>0?this._requests.shift().resolve({value:S,done:!1}):this._queuedChunk=S,this._done=!0;for(const k of this._requests)k.resolve({value:void 0,done:!0});this._requests.length=0,this._close()}_onError(f){this._storedError=(0,p.createResponseStatusError)(f,this._url);for(const S of this._requests)S.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}_onProgress(f){var S;this.isStreamingSupported||(S=this.onProgress)==null||S.call(this,{loaded:f.loaded})}get isStreamingSupported(){return!1}async read(){if(this._storedError)throw this._storedError;if(this._queuedChunk!==null){const S=this._queuedChunk;return this._queuedChunk=null,{value:S,done:!1}}if(this._done)return{value:void 0,done:!0};const f=new M.PromiseCapability;return this._requests.push(f),f.promise}cancel(f){this._done=!0;for(const S of this._requests)S.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId),this._close()}}},(lt,r,h)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.PDFNodeStream=void 0;var M=h(1),p=h(20);const B=/^file:\/\/\/[a-zA-Z]:\//;function Q(k){const T=require$$5,g=T.parse(k);return g.protocol==="file:"||g.host?g:/^[a-z]:[/\\]/i.test(k)?T.parse(`file:///${k}`):(g.host||(g.protocol="file:"),g)}class U{constructor(T){this.source=T,this.url=Q(T.url),this.isHttp=this.url.protocol==="http:"||this.url.protocol==="https:",this.isFsUrl=this.url.protocol==="file:",this.httpHeaders=this.isHttp&&T.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){var T;return((T=this._fullRequestReader)==null?void 0:T._loaded)??0}getFullReader(){return(0,M.assert)(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=this.isFsUrl?new f(this):new q(this),this._fullRequestReader}getRangeReader(T,g){if(g<=this._progressiveDataLength)return null;const F=this.isFsUrl?new S(this,T,g):new K(this,T,g);return this._rangeRequestReaders.push(F),F}cancelAllRequests(T){var g;(g=this._fullRequestReader)==null||g.cancel(T);for(const F of this._rangeRequestReaders.slice(0))F.cancel(T)}}r.PDFNodeStream=U;class O{constructor(T){this._url=T.url,this._done=!1,this._storedError=null,this.onProgress=null;const g=T.source;this._contentLength=g.length,this._loaded=0,this._filename=null,this._disableRange=g.disableRange||!1,this._rangeChunkSize=g.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._isStreamingSupported=!g.disableStream,this._isRangeSupported=!g.disableRange,this._readableStream=null,this._readCapability=new M.PromiseCapability,this._headersCapability=new M.PromiseCapability}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(){var F;if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const T=this._readableStream.read();return T===null?(this._readCapability=new M.PromiseCapability,this.read()):(this._loaded+=T.length,(F=this.onProgress)==null||F.call(this,{loaded:this._loaded,total:this._contentLength}),{value:new Uint8Array(T).buffer,done:!1})}cancel(T){if(!this._readableStream){this._error(T);return}this._readableStream.destroy(T)}_error(T){this._storedError=T,this._readCapability.resolve()}_setReadableStream(T){this._readableStream=T,T.on("readable",()=>{this._readCapability.resolve()}),T.on("end",()=>{T.destroy(),this._done=!0,this._readCapability.resolve()}),T.on("error",g=>{this._error(g)}),!this._isStreamingSupported&&this._isRangeSupported&&this._error(new M.AbortException("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class I{constructor(T){this._url=T.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=new M.PromiseCapability;const g=T.source;this._isStreamingSupported=!g.disableStream}get isStreamingSupported(){return this._isStreamingSupported}async read(){var F;if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const T=this._readableStream.read();return T===null?(this._readCapability=new M.PromiseCapability,this.read()):(this._loaded+=T.length,(F=this.onProgress)==null||F.call(this,{loaded:this._loaded}),{value:new Uint8Array(T).buffer,done:!1})}cancel(T){if(!this._readableStream){this._error(T);return}this._readableStream.destroy(T)}_error(T){this._storedError=T,this._readCapability.resolve()}_setReadableStream(T){this._readableStream=T,T.on("readable",()=>{this._readCapability.resolve()}),T.on("end",()=>{T.destroy(),this._done=!0,this._readCapability.resolve()}),T.on("error",g=>{this._error(g)}),this._storedError&&this._readableStream.destroy(this._storedError)}}function j(k,T){return{protocol:k.protocol,auth:k.auth,host:k.hostname,port:k.port,path:k.path,method:"GET",headers:T}}class q extends O{constructor(T){super(T);const g=F=>{if(F.statusCode===404){const m=new M.MissingPDFException(`Missing PDF "${this._url}".`);this._storedError=m,this._headersCapability.reject(m);return}this._headersCapability.resolve(),this._setReadableStream(F);const J=m=>this._readableStream.headers[m.toLowerCase()],{allowRangeRequests:v,suggestedLength:u}=(0,p.validateRangeRequestCapabilities)({getResponseHeader:J,isHttp:T.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=v,this._contentLength=u||this._contentLength,this._filename=(0,p.extractFilenameFromHeader)(J)};if(this._request=null,this._url.protocol==="http:"){const F=require$$5;this._request=F.request(j(this._url,T.httpHeaders),g)}else{const F=require$$5;this._request=F.request(j(this._url,T.httpHeaders),g)}this._request.on("error",F=>{this._storedError=F,this._headersCapability.reject(F)}),this._request.end()}}class K extends I{constructor(T,g,F){super(T),this._httpHeaders={};for(const v in T.httpHeaders){const u=T.httpHeaders[v];u!==void 0&&(this._httpHeaders[v]=u)}this._httpHeaders.Range=`bytes=${g}-${F-1}`;const J=v=>{if(v.statusCode===404){const u=new M.MissingPDFException(`Missing PDF "${this._url}".`);this._storedError=u;return}this._setReadableStream(v)};if(this._request=null,this._url.protocol==="http:"){const v=require$$5;this._request=v.request(j(this._url,this._httpHeaders),J)}else{const v=require$$5;this._request=v.request(j(this._url,this._httpHeaders),J)}this._request.on("error",v=>{this._storedError=v}),this._request.end()}}class f extends O{constructor(T){super(T);let g=decodeURIComponent(this._url.path);B.test(this._url.href)&&(g=g.replace(/^\//,""));const F=require$$5;F.lstat(g,(J,v)=>{if(J){J.code==="ENOENT"&&(J=new M.MissingPDFException(`Missing PDF "${g}".`)),this._storedError=J,this._headersCapability.reject(J);return}this._contentLength=v.size,this._setReadableStream(F.createReadStream(g)),this._headersCapability.resolve()})}}class S extends I{constructor(T,g,F){super(T);let J=decodeURIComponent(this._url.path);B.test(this._url.href)&&(J=J.replace(/^\//,""));const v=require$$5;this._setReadableStream(v.createReadStream(J,{start:g,end:F-1}))}}},(lt,r,h)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.SVGGraphics=void 0;var M=h(6),p=h(1);const B={fontStyle:"normal",fontWeight:"normal",fillColor:"#000000"},Q="http://www.w3.org/XML/1998/namespace",U="http://www.w3.org/1999/xlink",O=["butt","round","square"],I=["miter","round","bevel"],j=function(v,u="",m=!1){if(URL.createObjectURL&&typeof Blob<"u"&&!m)return URL.createObjectURL(new Blob([v],{type:u}));const _="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";let $=`data:${u};base64,`;for(let P=0,Zt=v.length;P<Zt;P+=3){const dt=v[P]&255,It=v[P+1]&255,xt=v[P+2]&255,it=dt>>2,Xt=(dt&3)<<4|It>>4,zt=P+1<Zt?(It&15)<<2|xt>>6:64,Gt=P+2<Zt?xt&63:64;$+=_[it]+_[Xt]+_[zt]+_[Gt]}return $},q=function(){const v=new Uint8Array([137,80,78,71,13,10,26,10]),u=12,m=new Int32Array(256);for(let xt=0;xt<256;xt++){let it=xt;for(let Xt=0;Xt<8;Xt++)it=it&1?3988292384^it>>1&2147483647:it>>1&2147483647;m[xt]=it}function _(xt,it,Xt){let zt=-1;for(let Gt=it;Gt<Xt;Gt++){const Nt=(zt^xt[Gt])&255,Ut=m[Nt];zt=zt>>>8^Ut}return zt^-1}function $(xt,it,Xt,zt){let Gt=zt;const Nt=it.length;Xt[Gt]=Nt>>24&255,Xt[Gt+1]=Nt>>16&255,Xt[Gt+2]=Nt>>8&255,Xt[Gt+3]=Nt&255,Gt+=4,Xt[Gt]=xt.charCodeAt(0)&255,Xt[Gt+1]=xt.charCodeAt(1)&255,Xt[Gt+2]=xt.charCodeAt(2)&255,Xt[Gt+3]=xt.charCodeAt(3)&255,Gt+=4,Xt.set(it,Gt),Gt+=it.length;const Ut=_(Xt,zt+4,Gt);Xt[Gt]=Ut>>24&255,Xt[Gt+1]=Ut>>16&255,Xt[Gt+2]=Ut>>8&255,Xt[Gt+3]=Ut&255}function P(xt,it,Xt){let zt=1,Gt=0;for(let Nt=it;Nt<Xt;++Nt)zt=(zt+(xt[Nt]&255))%65521,Gt=(Gt+zt)%65521;return Gt<<16|zt}function Zt(xt){if(!p.isNodeJS)return dt(xt);try{const it=parseInt(process.versions.node)>=8?xt:Buffer.from(xt),Xt=require$$5.deflateSync(it,{level:9});return Xt instanceof Uint8Array?Xt:new Uint8Array(Xt)}catch(it){(0,p.warn)("Not compressing PNG because zlib.deflateSync is unavailable: "+it)}return dt(xt)}function dt(xt){let it=xt.length;const Xt=65535,zt=Math.ceil(it/Xt),Gt=new Uint8Array(2+it+zt*5+4);let Nt=0;Gt[Nt++]=120,Gt[Nt++]=156;let Ut=0;for(;it>Xt;)Gt[Nt++]=0,Gt[Nt++]=255,Gt[Nt++]=255,Gt[Nt++]=0,Gt[Nt++]=0,Gt.set(xt.subarray(Ut,Ut+Xt),Nt),Nt+=Xt,Ut+=Xt,it-=Xt;Gt[Nt++]=1,Gt[Nt++]=it&255,Gt[Nt++]=it>>8&255,Gt[Nt++]=~it&65535&255,Gt[Nt++]=(~it&65535)>>8&255,Gt.set(xt.subarray(Ut),Nt),Nt+=xt.length-Ut;const Vt=P(xt,0,xt.length);return Gt[Nt++]=Vt>>24&255,Gt[Nt++]=Vt>>16&255,Gt[Nt++]=Vt>>8&255,Gt[Nt++]=Vt&255,Gt}function It(xt,it,Xt,zt){const Gt=xt.width,Nt=xt.height;let Ut,Vt,Ht;const Pt=xt.data;switch(it){case p.ImageKind.GRAYSCALE_1BPP:Vt=0,Ut=1,Ht=Gt+7>>3;break;case p.ImageKind.RGB_24BPP:Vt=2,Ut=8,Ht=Gt*3;break;case p.ImageKind.RGBA_32BPP:Vt=6,Ut=8,Ht=Gt*4;break;default:throw new Error("invalid format")}const at=new Uint8Array((1+Ht)*Nt);let R=0,w=0;for(let Mt=0;Mt<Nt;++Mt)at[R++]=0,at.set(Pt.subarray(w,w+Ht),R),w+=Ht,R+=Ht;if(it===p.ImageKind.GRAYSCALE_1BPP&&zt){R=0;for(let Mt=0;Mt<Nt;Mt++){R++;for(let Rt=0;Rt<Ht;Rt++)at[R++]^=255}}const X=new Uint8Array([Gt>>24&255,Gt>>16&255,Gt>>8&255,Gt&255,Nt>>24&255,Nt>>16&255,Nt>>8&255,Nt&255,Ut,Vt,0,0,0]),C=Zt(at),H=v.length+u*3+X.length+C.length,st=new Uint8Array(H);let et=0;return st.set(v,et),et+=v.length,$("IHDR",X,st,et),et+=u+X.length,$("IDATA",C,st,et),et+=u+C.length,$("IEND",new Uint8Array(0),st,et),j(st,"image/png",Xt)}return function(it,Xt,zt){const Gt=it.kind===void 0?p.ImageKind.GRAYSCALE_1BPP:it.kind;return It(it,Gt,Xt,zt)}}();class K{constructor(){this.fontSizeScale=1,this.fontWeight=B.fontWeight,this.fontSize=0,this.textMatrix=p.IDENTITY_MATRIX,this.fontMatrix=p.FONT_IDENTITY_MATRIX,this.leading=0,this.textRenderingMode=p.TextRenderingMode.FILL,this.textMatrixScale=1,this.x=0,this.y=0,this.lineX=0,this.lineY=0,this.charSpacing=0,this.wordSpacing=0,this.textHScale=1,this.textRise=0,this.fillColor=B.fillColor,this.strokeColor="#000000",this.fillAlpha=1,this.strokeAlpha=1,this.lineWidth=1,this.lineJoin="",this.lineCap="",this.miterLimit=0,this.dashArray=[],this.dashPhase=0,this.dependencies=[],this.activeClipUrl=null,this.clipGroup=null,this.maskId=""}clone(){return Object.create(this)}setCurrentPoint(u,m){this.x=u,this.y=m}}function f(v){let u=[];const m=[];for(const _ of v){if(_.fn==="save"){u.push({fnId:92,fn:"group",items:[]}),m.push(u),u=u.at(-1).items;continue}_.fn==="restore"?u=m.pop():u.push(_)}return u}function S(v){if(Number.isInteger(v))return v.toString();const u=v.toFixed(10);let m=u.length-1;if(u[m]!=="0")return u;do m--;while(u[m]==="0");return u.substring(0,u[m]==="."?m:m+1)}function k(v){if(v[4]===0&&v[5]===0){if(v[1]===0&&v[2]===0)return v[0]===1&&v[3]===1?"":`scale(${S(v[0])} ${S(v[3])})`;if(v[0]===v[3]&&v[1]===-v[2]){const u=Math.acos(v[0])*180/Math.PI;return`rotate(${S(u)})`}}else if(v[0]===1&&v[1]===0&&v[2]===0&&v[3]===1)return`translate(${S(v[4])} ${S(v[5])})`;return`matrix(${S(v[0])} ${S(v[1])} ${S(v[2])} ${S(v[3])} ${S(v[4])} ${S(v[5])})`}let T=0,g=0,F=0;class J{constructor(u,m,_=!1){(0,M.deprecated)("The SVG back-end is no longer maintained and *may* be removed in the future."),this.svgFactory=new M.DOMSVGFactory,this.current=new K,this.transformMatrix=p.IDENTITY_MATRIX,this.transformStack=[],this.extraStack=[],this.commonObjs=u,this.objs=m,this.pendingClip=null,this.pendingEOFill=!1,this.embedFonts=!1,this.embeddedFonts=Object.create(null),this.cssStyle=null,this.forceDataSchema=!!_,this._operatorIdMapping=[];for(const $ in p.OPS)this._operatorIdMapping[p.OPS[$]]=$}getObject(u,m=null){return typeof u=="string"?u.startsWith("g_")?this.commonObjs.get(u):this.objs.get(u):m}save(){this.transformStack.push(this.transformMatrix);const u=this.current;this.extraStack.push(u),this.current=u.clone()}restore(){this.transformMatrix=this.transformStack.pop(),this.current=this.extraStack.pop(),this.pendingClip=null,this.tgrp=null}group(u){this.save(),this.executeOpTree(u),this.restore()}loadDependencies(u){const m=u.fnArray,_=u.argsArray;for(let $=0,P=m.length;$<P;$++)if(m[$]===p.OPS.dependency)for(const Zt of _[$]){const dt=Zt.startsWith("g_")?this.commonObjs:this.objs,It=new Promise(xt=>{dt.get(Zt,xt)});this.current.dependencies.push(It)}return Promise.all(this.current.dependencies)}transform(u,m,_,$,P,Zt){const dt=[u,m,_,$,P,Zt];this.transformMatrix=p.Util.transform(this.transformMatrix,dt),this.tgrp=null}getSVG(u,m){this.viewport=m;const _=this._initialize(m);return this.loadDependencies(u).then(()=>(this.transformMatrix=p.IDENTITY_MATRIX,this.executeOpTree(this.convertOpList(u)),_))}convertOpList(u){const m=this._operatorIdMapping,_=u.argsArray,$=u.fnArray,P=[];for(let Zt=0,dt=$.length;Zt<dt;Zt++){const It=$[Zt];P.push({fnId:It,fn:m[It],args:_[Zt]})}return f(P)}executeOpTree(u){for(const m of u){const _=m.fn,$=m.fnId,P=m.args;switch($|0){case p.OPS.beginText:this.beginText();break;case p.OPS.dependency:break;case p.OPS.setLeading:this.setLeading(P);break;case p.OPS.setLeadingMoveText:this.setLeadingMoveText(P[0],P[1]);break;case p.OPS.setFont:this.setFont(P);break;case p.OPS.showText:this.showText(P[0]);break;case p.OPS.showSpacedText:this.showText(P[0]);break;case p.OPS.endText:this.endText();break;case p.OPS.moveText:this.moveText(P[0],P[1]);break;case p.OPS.setCharSpacing:this.setCharSpacing(P[0]);break;case p.OPS.setWordSpacing:this.setWordSpacing(P[0]);break;case p.OPS.setHScale:this.setHScale(P[0]);break;case p.OPS.setTextMatrix:this.setTextMatrix(P[0],P[1],P[2],P[3],P[4],P[5]);break;case p.OPS.setTextRise:this.setTextRise(P[0]);break;case p.OPS.setTextRenderingMode:this.setTextRenderingMode(P[0]);break;case p.OPS.setLineWidth:this.setLineWidth(P[0]);break;case p.OPS.setLineJoin:this.setLineJoin(P[0]);break;case p.OPS.setLineCap:this.setLineCap(P[0]);break;case p.OPS.setMiterLimit:this.setMiterLimit(P[0]);break;case p.OPS.setFillRGBColor:this.setFillRGBColor(P[0],P[1],P[2]);break;case p.OPS.setStrokeRGBColor:this.setStrokeRGBColor(P[0],P[1],P[2]);break;case p.OPS.setStrokeColorN:this.setStrokeColorN(P);break;case p.OPS.setFillColorN:this.setFillColorN(P);break;case p.OPS.shadingFill:this.shadingFill(P[0]);break;case p.OPS.setDash:this.setDash(P[0],P[1]);break;case p.OPS.setRenderingIntent:this.setRenderingIntent(P[0]);break;case p.OPS.setFlatness:this.setFlatness(P[0]);break;case p.OPS.setGState:this.setGState(P[0]);break;case p.OPS.fill:this.fill();break;case p.OPS.eoFill:this.eoFill();break;case p.OPS.stroke:this.stroke();break;case p.OPS.fillStroke:this.fillStroke();break;case p.OPS.eoFillStroke:this.eoFillStroke();break;case p.OPS.clip:this.clip("nonzero");break;case p.OPS.eoClip:this.clip("evenodd");break;case p.OPS.paintSolidColorImageMask:this.paintSolidColorImageMask();break;case p.OPS.paintImageXObject:this.paintImageXObject(P[0]);break;case p.OPS.paintInlineImageXObject:this.paintInlineImageXObject(P[0]);break;case p.OPS.paintImageMaskXObject:this.paintImageMaskXObject(P[0]);break;case p.OPS.paintFormXObjectBegin:this.paintFormXObjectBegin(P[0],P[1]);break;case p.OPS.paintFormXObjectEnd:this.paintFormXObjectEnd();break;case p.OPS.closePath:this.closePath();break;case p.OPS.closeStroke:this.closeStroke();break;case p.OPS.closeFillStroke:this.closeFillStroke();break;case p.OPS.closeEOFillStroke:this.closeEOFillStroke();break;case p.OPS.nextLine:this.nextLine();break;case p.OPS.transform:this.transform(P[0],P[1],P[2],P[3],P[4],P[5]);break;case p.OPS.constructPath:this.constructPath(P[0],P[1]);break;case p.OPS.endPath:this.endPath();break;case 92:this.group(m.items);break;default:(0,p.warn)(`Unimplemented operator ${_}`);break}}}setWordSpacing(u){this.current.wordSpacing=u}setCharSpacing(u){this.current.charSpacing=u}nextLine(){this.moveText(0,this.current.leading)}setTextMatrix(u,m,_,$,P,Zt){const dt=this.current;dt.textMatrix=dt.lineMatrix=[u,m,_,$,P,Zt],dt.textMatrixScale=Math.hypot(u,m),dt.x=dt.lineX=0,dt.y=dt.lineY=0,dt.xcoords=[],dt.ycoords=[],dt.tspan=this.svgFactory.createElement("svg:tspan"),dt.tspan.setAttributeNS(null,"font-family",dt.fontFamily),dt.tspan.setAttributeNS(null,"font-size",`${S(dt.fontSize)}px`),dt.tspan.setAttributeNS(null,"y",S(-dt.y)),dt.txtElement=this.svgFactory.createElement("svg:text"),dt.txtElement.append(dt.tspan)}beginText(){const u=this.current;u.x=u.lineX=0,u.y=u.lineY=0,u.textMatrix=p.IDENTITY_MATRIX,u.lineMatrix=p.IDENTITY_MATRIX,u.textMatrixScale=1,u.tspan=this.svgFactory.createElement("svg:tspan"),u.txtElement=this.svgFactory.createElement("svg:text"),u.txtgrp=this.svgFactory.createElement("svg:g"),u.xcoords=[],u.ycoords=[]}moveText(u,m){const _=this.current;_.x=_.lineX+=u,_.y=_.lineY+=m,_.xcoords=[],_.ycoords=[],_.tspan=this.svgFactory.createElement("svg:tspan"),_.tspan.setAttributeNS(null,"font-family",_.fontFamily),_.tspan.setAttributeNS(null,"font-size",`${S(_.fontSize)}px`),_.tspan.setAttributeNS(null,"y",S(-_.y))}showText(u){const m=this.current,_=m.font,$=m.fontSize;if($===0)return;const P=m.fontSizeScale,Zt=m.charSpacing,dt=m.wordSpacing,It=m.fontDirection,xt=m.textHScale*It,it=_.vertical,Xt=it?1:-1,zt=_.defaultVMetrics,Gt=$*m.fontMatrix[0];let Nt=0;for(const Ht of u){if(Ht===null){Nt+=It*dt;continue}else if(typeof Ht=="number"){Nt+=Xt*Ht*$/1e3;continue}const Pt=(Ht.isSpace?dt:0)+Zt,at=Ht.fontChar;let R,w,X=Ht.width;if(it){let H;const st=Ht.vmetric||zt;H=Ht.vmetric?st[1]:X*.5,H=-H*Gt;const et=st[2]*Gt;X=st?-st[0]:X,R=H/P,w=(Nt+et)/P}else R=Nt/P,w=0;(Ht.isInFont||_.missingFile)&&(m.xcoords.push(m.x+R),it&&m.ycoords.push(-m.y+w),m.tspan.textContent+=at);const C=it?X*Gt-Pt*It:X*Gt+Pt*It;Nt+=C}m.tspan.setAttributeNS(null,"x",m.xcoords.map(S).join(" ")),it?m.tspan.setAttributeNS(null,"y",m.ycoords.map(S).join(" ")):m.tspan.setAttributeNS(null,"y",S(-m.y)),it?m.y-=Nt:m.x+=Nt*xt,m.tspan.setAttributeNS(null,"font-family",m.fontFamily),m.tspan.setAttributeNS(null,"font-size",`${S(m.fontSize)}px`),m.fontStyle!==B.fontStyle&&m.tspan.setAttributeNS(null,"font-style",m.fontStyle),m.fontWeight!==B.fontWeight&&m.tspan.setAttributeNS(null,"font-weight",m.fontWeight);const Ut=m.textRenderingMode&p.TextRenderingMode.FILL_STROKE_MASK;if(Ut===p.TextRenderingMode.FILL||Ut===p.TextRenderingMode.FILL_STROKE?(m.fillColor!==B.fillColor&&m.tspan.setAttributeNS(null,"fill",m.fillColor),m.fillAlpha<1&&m.tspan.setAttributeNS(null,"fill-opacity",m.fillAlpha)):m.textRenderingMode===p.TextRenderingMode.ADD_TO_PATH?m.tspan.setAttributeNS(null,"fill","transparent"):m.tspan.setAttributeNS(null,"fill","none"),Ut===p.TextRenderingMode.STROKE||Ut===p.TextRenderingMode.FILL_STROKE){const Ht=1/(m.textMatrixScale||1);this._setStrokeAttributes(m.tspan,Ht)}let Vt=m.textMatrix;m.textRise!==0&&(Vt=Vt.slice(),Vt[5]+=m.textRise),m.txtElement.setAttributeNS(null,"transform",`${k(Vt)} scale(${S(xt)}, -1)`),m.txtElement.setAttributeNS(Q,"xml:space","preserve"),m.txtElement.append(m.tspan),m.txtgrp.append(m.txtElement),this._ensureTransformGroup().append(m.txtElement)}setLeadingMoveText(u,m){this.setLeading(-m),this.moveText(u,m)}addFontStyle(u){if(!u.data)throw new Error('addFontStyle: No font data available, ensure that the "fontExtraProperties" API parameter is set.');this.cssStyle||(this.cssStyle=this.svgFactory.createElement("svg:style"),this.cssStyle.setAttributeNS(null,"type","text/css"),this.defs.append(this.cssStyle));const m=j(u.data,u.mimetype,this.forceDataSchema);this.cssStyle.textContent+=`@font-face { font-family: "${u.loadedName}"; src: url(${m}); }
|
|
4
4
|
`}setFont(u){const m=this.current,_=this.commonObjs.get(u[0]);let $=u[1];m.font=_,this.embedFonts&&!_.missingFile&&!this.embeddedFonts[_.loadedName]&&(this.addFontStyle(_),this.embeddedFonts[_.loadedName]=_),m.fontMatrix=_.fontMatrix||p.FONT_IDENTITY_MATRIX;let P="normal";_.black?P="900":_.bold&&(P="bold");const Zt=_.italic?"italic":"normal";$<0?($=-$,m.fontDirection=-1):m.fontDirection=1,m.fontSize=$,m.fontFamily=_.loadedName,m.fontWeight=P,m.fontStyle=Zt,m.tspan=this.svgFactory.createElement("svg:tspan"),m.tspan.setAttributeNS(null,"y",S(-m.y)),m.xcoords=[],m.ycoords=[]}endText(){var m;const u=this.current;u.textRenderingMode&p.TextRenderingMode.ADD_TO_PATH_FLAG&&((m=u.txtElement)!=null&&m.hasChildNodes())&&(u.element=u.txtElement,this.clip("nonzero"),this.endPath())}setLineWidth(u){u>0&&(this.current.lineWidth=u)}setLineCap(u){this.current.lineCap=O[u]}setLineJoin(u){this.current.lineJoin=I[u]}setMiterLimit(u){this.current.miterLimit=u}setStrokeAlpha(u){this.current.strokeAlpha=u}setStrokeRGBColor(u,m,_){this.current.strokeColor=p.Util.makeHexColor(u,m,_)}setFillAlpha(u){this.current.fillAlpha=u}setFillRGBColor(u,m,_){this.current.fillColor=p.Util.makeHexColor(u,m,_),this.current.tspan=this.svgFactory.createElement("svg:tspan"),this.current.xcoords=[],this.current.ycoords=[]}setStrokeColorN(u){this.current.strokeColor=this._makeColorN_Pattern(u)}setFillColorN(u){this.current.fillColor=this._makeColorN_Pattern(u)}shadingFill(u){const{width:m,height:_}=this.viewport,$=p.Util.inverseTransform(this.transformMatrix),[P,Zt,dt,It]=p.Util.getAxialAlignedBoundingBox([0,0,m,_],$),xt=this.svgFactory.createElement("svg:rect");xt.setAttributeNS(null,"x",P),xt.setAttributeNS(null,"y",Zt),xt.setAttributeNS(null,"width",dt-P),xt.setAttributeNS(null,"height",It-Zt),xt.setAttributeNS(null,"fill",this._makeShadingPattern(u)),this.current.fillAlpha<1&&xt.setAttributeNS(null,"fill-opacity",this.current.fillAlpha),this._ensureTransformGroup().append(xt)}_makeColorN_Pattern(u){return u[0]==="TilingPattern"?this._makeTilingPattern(u):this._makeShadingPattern(u)}_makeTilingPattern(u){const m=u[1],_=u[2],$=u[3]||p.IDENTITY_MATRIX,[P,Zt,dt,It]=u[4],xt=u[5],it=u[6],Xt=u[7],zt=`shading${F++}`,[Gt,Nt,Ut,Vt]=p.Util.normalizeRect([...p.Util.applyTransform([P,Zt],$),...p.Util.applyTransform([dt,It],$)]),[Ht,Pt]=p.Util.singularValueDecompose2dScale($),at=xt*Ht,R=it*Pt,w=this.svgFactory.createElement("svg:pattern");w.setAttributeNS(null,"id",zt),w.setAttributeNS(null,"patternUnits","userSpaceOnUse"),w.setAttributeNS(null,"width",at),w.setAttributeNS(null,"height",R),w.setAttributeNS(null,"x",`${Gt}`),w.setAttributeNS(null,"y",`${Nt}`);const X=this.svg,C=this.transformMatrix,H=this.current.fillColor,st=this.current.strokeColor,et=this.svgFactory.create(Ut-Gt,Vt-Nt);if(this.svg=et,this.transformMatrix=$,Xt===2){const Mt=p.Util.makeHexColor(...m);this.current.fillColor=Mt,this.current.strokeColor=Mt}return this.executeOpTree(this.convertOpList(_)),this.svg=X,this.transformMatrix=C,this.current.fillColor=H,this.current.strokeColor=st,w.append(et.childNodes[0]),this.defs.append(w),`url(#${zt})`}_makeShadingPattern(u){switch(typeof u=="string"&&(u=this.objs.get(u)),u[0]){case"RadialAxial":const m=`shading${F++}`,_=u[3];let $;switch(u[1]){case"axial":const P=u[4],Zt=u[5];$=this.svgFactory.createElement("svg:linearGradient"),$.setAttributeNS(null,"id",m),$.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),$.setAttributeNS(null,"x1",P[0]),$.setAttributeNS(null,"y1",P[1]),$.setAttributeNS(null,"x2",Zt[0]),$.setAttributeNS(null,"y2",Zt[1]);break;case"radial":const dt=u[4],It=u[5],xt=u[6],it=u[7];$=this.svgFactory.createElement("svg:radialGradient"),$.setAttributeNS(null,"id",m),$.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),$.setAttributeNS(null,"cx",It[0]),$.setAttributeNS(null,"cy",It[1]),$.setAttributeNS(null,"r",it),$.setAttributeNS(null,"fx",dt[0]),$.setAttributeNS(null,"fy",dt[1]),$.setAttributeNS(null,"fr",xt);break;default:throw new Error(`Unknown RadialAxial type: ${u[1]}`)}for(const P of _){const Zt=this.svgFactory.createElement("svg:stop");Zt.setAttributeNS(null,"offset",P[0]),Zt.setAttributeNS(null,"stop-color",P[1]),$.append(Zt)}return this.defs.append($),`url(#${m})`;case"Mesh":return(0,p.warn)("Unimplemented pattern Mesh"),null;case"Dummy":return"hotpink";default:throw new Error(`Unknown IR type: ${u[0]}`)}}setDash(u,m){this.current.dashArray=u,this.current.dashPhase=m}constructPath(u,m){const _=this.current;let $=_.x,P=_.y,Zt=[],dt=0;for(const It of u)switch(It|0){case p.OPS.rectangle:$=m[dt++],P=m[dt++];const xt=m[dt++],it=m[dt++],Xt=$+xt,zt=P+it;Zt.push("M",S($),S(P),"L",S(Xt),S(P),"L",S(Xt),S(zt),"L",S($),S(zt),"Z");break;case p.OPS.moveTo:$=m[dt++],P=m[dt++],Zt.push("M",S($),S(P));break;case p.OPS.lineTo:$=m[dt++],P=m[dt++],Zt.push("L",S($),S(P));break;case p.OPS.curveTo:$=m[dt+4],P=m[dt+5],Zt.push("C",S(m[dt]),S(m[dt+1]),S(m[dt+2]),S(m[dt+3]),S($),S(P)),dt+=6;break;case p.OPS.curveTo2:Zt.push("C",S($),S(P),S(m[dt]),S(m[dt+1]),S(m[dt+2]),S(m[dt+3])),$=m[dt+2],P=m[dt+3],dt+=4;break;case p.OPS.curveTo3:$=m[dt+2],P=m[dt+3],Zt.push("C",S(m[dt]),S(m[dt+1]),S($),S(P),S($),S(P)),dt+=4;break;case p.OPS.closePath:Zt.push("Z");break}Zt=Zt.join(" "),_.path&&u.length>0&&u[0]!==p.OPS.rectangle&&u[0]!==p.OPS.moveTo?Zt=_.path.getAttributeNS(null,"d")+Zt:(_.path=this.svgFactory.createElement("svg:path"),this._ensureTransformGroup().append(_.path)),_.path.setAttributeNS(null,"d",Zt),_.path.setAttributeNS(null,"fill","none"),_.element=_.path,_.setCurrentPoint($,P)}endPath(){const u=this.current;if(u.path=null,!this.pendingClip)return;if(!u.element){this.pendingClip=null;return}const m=`clippath${T++}`,_=this.svgFactory.createElement("svg:clipPath");_.setAttributeNS(null,"id",m),_.setAttributeNS(null,"transform",k(this.transformMatrix));const $=u.element.cloneNode(!0);if(this.pendingClip==="evenodd"?$.setAttributeNS(null,"clip-rule","evenodd"):$.setAttributeNS(null,"clip-rule","nonzero"),this.pendingClip=null,_.append($),this.defs.append(_),u.activeClipUrl){u.clipGroup=null;for(const P of this.extraStack)P.clipGroup=null;_.setAttributeNS(null,"clip-path",u.activeClipUrl)}u.activeClipUrl=`url(#${m})`,this.tgrp=null}clip(u){this.pendingClip=u}closePath(){const u=this.current;if(u.path){const m=`${u.path.getAttributeNS(null,"d")}Z`;u.path.setAttributeNS(null,"d",m)}}setLeading(u){this.current.leading=-u}setTextRise(u){this.current.textRise=u}setTextRenderingMode(u){this.current.textRenderingMode=u}setHScale(u){this.current.textHScale=u/100}setRenderingIntent(u){}setFlatness(u){}setGState(u){for(const[m,_]of u)switch(m){case"LW":this.setLineWidth(_);break;case"LC":this.setLineCap(_);break;case"LJ":this.setLineJoin(_);break;case"ML":this.setMiterLimit(_);break;case"D":this.setDash(_[0],_[1]);break;case"RI":this.setRenderingIntent(_);break;case"FL":this.setFlatness(_);break;case"Font":this.setFont(_);break;case"CA":this.setStrokeAlpha(_);break;case"ca":this.setFillAlpha(_);break;default:(0,p.warn)(`Unimplemented graphic state operator ${m}`);break}}fill(){const u=this.current;u.element&&(u.element.setAttributeNS(null,"fill",u.fillColor),u.element.setAttributeNS(null,"fill-opacity",u.fillAlpha),this.endPath())}stroke(){const u=this.current;u.element&&(this._setStrokeAttributes(u.element),u.element.setAttributeNS(null,"fill","none"),this.endPath())}_setStrokeAttributes(u,m=1){const _=this.current;let $=_.dashArray;m!==1&&$.length>0&&($=$.map(function(P){return m*P})),u.setAttributeNS(null,"stroke",_.strokeColor),u.setAttributeNS(null,"stroke-opacity",_.strokeAlpha),u.setAttributeNS(null,"stroke-miterlimit",S(_.miterLimit)),u.setAttributeNS(null,"stroke-linecap",_.lineCap),u.setAttributeNS(null,"stroke-linejoin",_.lineJoin),u.setAttributeNS(null,"stroke-width",S(m*_.lineWidth)+"px"),u.setAttributeNS(null,"stroke-dasharray",$.map(S).join(" ")),u.setAttributeNS(null,"stroke-dashoffset",S(m*_.dashPhase)+"px")}eoFill(){var u;(u=this.current.element)==null||u.setAttributeNS(null,"fill-rule","evenodd"),this.fill()}fillStroke(){this.stroke(),this.fill()}eoFillStroke(){var u;(u=this.current.element)==null||u.setAttributeNS(null,"fill-rule","evenodd"),this.fillStroke()}closeStroke(){this.closePath(),this.stroke()}closeFillStroke(){this.closePath(),this.fillStroke()}closeEOFillStroke(){this.closePath(),this.eoFillStroke()}paintSolidColorImageMask(){const u=this.svgFactory.createElement("svg:rect");u.setAttributeNS(null,"x","0"),u.setAttributeNS(null,"y","0"),u.setAttributeNS(null,"width","1px"),u.setAttributeNS(null,"height","1px"),u.setAttributeNS(null,"fill",this.current.fillColor),this._ensureTransformGroup().append(u)}paintImageXObject(u){const m=this.getObject(u);if(!m){(0,p.warn)(`Dependent image with object ID ${u} is not ready yet`);return}this.paintInlineImageXObject(m)}paintInlineImageXObject(u,m){const _=u.width,$=u.height,P=q(u,this.forceDataSchema,!!m),Zt=this.svgFactory.createElement("svg:rect");Zt.setAttributeNS(null,"x","0"),Zt.setAttributeNS(null,"y","0"),Zt.setAttributeNS(null,"width",S(_)),Zt.setAttributeNS(null,"height",S($)),this.current.element=Zt,this.clip("nonzero");const dt=this.svgFactory.createElement("svg:image");dt.setAttributeNS(U,"xlink:href",P),dt.setAttributeNS(null,"x","0"),dt.setAttributeNS(null,"y",S(-$)),dt.setAttributeNS(null,"width",S(_)+"px"),dt.setAttributeNS(null,"height",S($)+"px"),dt.setAttributeNS(null,"transform",`scale(${S(1/_)} ${S(-1/$)})`),m?m.append(dt):this._ensureTransformGroup().append(dt)}paintImageMaskXObject(u){const m=this.getObject(u.data,u);if(m.bitmap){(0,p.warn)("paintImageMaskXObject: ImageBitmap support is not implemented, ensure that the `isOffscreenCanvasSupported` API parameter is disabled.");return}const _=this.current,$=m.width,P=m.height,Zt=_.fillColor;_.maskId=`mask${g++}`;const dt=this.svgFactory.createElement("svg:mask");dt.setAttributeNS(null,"id",_.maskId);const It=this.svgFactory.createElement("svg:rect");It.setAttributeNS(null,"x","0"),It.setAttributeNS(null,"y","0"),It.setAttributeNS(null,"width",S($)),It.setAttributeNS(null,"height",S(P)),It.setAttributeNS(null,"fill",Zt),It.setAttributeNS(null,"mask",`url(#${_.maskId})`),this.defs.append(dt),this._ensureTransformGroup().append(It),this.paintInlineImageXObject(m,dt)}paintFormXObjectBegin(u,m){if(Array.isArray(u)&&u.length===6&&this.transform(u[0],u[1],u[2],u[3],u[4],u[5]),m){const _=m[2]-m[0],$=m[3]-m[1],P=this.svgFactory.createElement("svg:rect");P.setAttributeNS(null,"x",m[0]),P.setAttributeNS(null,"y",m[1]),P.setAttributeNS(null,"width",S(_)),P.setAttributeNS(null,"height",S($)),this.current.element=P,this.clip("nonzero"),this.endPath()}}paintFormXObjectEnd(){}_initialize(u){const m=this.svgFactory.create(u.width,u.height),_=this.svgFactory.createElement("svg:defs");m.append(_),this.defs=_;const $=this.svgFactory.createElement("svg:g");return $.setAttributeNS(null,"transform",k(u.transform)),m.append($),this.svg=$,m}_ensureClipGroup(){if(!this.current.clipGroup){const u=this.svgFactory.createElement("svg:g");u.setAttributeNS(null,"clip-path",this.current.activeClipUrl),this.svg.append(u),this.current.clipGroup=u}return this.current.clipGroup}_ensureTransformGroup(){return this.tgrp||(this.tgrp=this.svgFactory.createElement("svg:g"),this.tgrp.setAttributeNS(null,"transform",k(this.transformMatrix)),this.current.activeClipUrl?this._ensureClipGroup().append(this.tgrp):this.svg.append(this.tgrp)),this.tgrp}}r.SVGGraphics=J},(lt,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.XfaText=void 0;class h{static textContent(p){const B=[],Q={items:B,styles:Object.create(null)};function U(O){var q;if(!O)return;let I=null;const j=O.name;if(j==="#text")I=O.value;else if(h.shouldBuildText(j))(q=O==null?void 0:O.attributes)!=null&&q.textContent?I=O.attributes.textContent:O.value&&(I=O.value);else return;if(I!==null&&B.push({str:I}),!!O.children)for(const K of O.children)U(K)}return U(p),Q}static shouldBuildText(p){return!(p==="textarea"||p==="input"||p==="option"||p==="select")}}r.XfaText=h},(lt,r,h)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.TextLayerRenderTask=void 0,r.renderTextLayer=k,r.updateTextLayer=T;var M=h(1),p=h(6);const B=1e5,Q=30,U=.8,O=new Map;function I(g,F){let J;if(F&&M.FeatureTest.isOffscreenCanvasSupported)J=new OffscreenCanvas(g,g).getContext("2d",{alpha:!1});else{const v=document.createElement("canvas");v.width=v.height=g,J=v.getContext("2d",{alpha:!1})}return J}function j(g,F){const J=O.get(g);if(J)return J;const v=I(Q,F);v.font=`${Q}px ${g}`;const u=v.measureText("");let m=u.fontBoundingBoxAscent,_=Math.abs(u.fontBoundingBoxDescent);if(m){const P=m/(m+_);return O.set(g,P),v.canvas.width=v.canvas.height=0,P}v.strokeStyle="red",v.clearRect(0,0,Q,Q),v.strokeText("g",0,0);let $=v.getImageData(0,0,Q,Q).data;_=0;for(let P=$.length-1-3;P>=0;P-=4)if($[P]>0){_=Math.ceil(P/4/Q);break}v.clearRect(0,0,Q,Q),v.strokeText("A",0,Q),$=v.getImageData(0,0,Q,Q).data,m=0;for(let P=0,Zt=$.length;P<Zt;P+=4)if($[P]>0){m=Q-Math.floor(P/4/Q);break}if(v.canvas.width=v.canvas.height=0,m){const P=m/(m+_);return O.set(g,P),P}return O.set(g,U),U}function q(g,F,J){const v=document.createElement("span"),u={angle:0,canvasWidth:0,hasText:F.str!=="",hasEOL:F.hasEOL,fontSize:0};g._textDivs.push(v);const m=M.Util.transform(g._transform,F.transform);let _=Math.atan2(m[1],m[0]);const $=J[F.fontName];$.vertical&&(_+=Math.PI/2);const P=Math.hypot(m[2],m[3]),Zt=P*j($.fontFamily,g._isOffscreenCanvasSupported);let dt,It;_===0?(dt=m[4],It=m[5]-Zt):(dt=m[4]+Zt*Math.sin(_),It=m[5]-Zt*Math.cos(_));const xt="calc(var(--scale-factor)*",it=v.style;g._container===g._rootContainer?(it.left=`${(100*dt/g._pageWidth).toFixed(2)}%`,it.top=`${(100*It/g._pageHeight).toFixed(2)}%`):(it.left=`${xt}${dt.toFixed(2)}px)`,it.top=`${xt}${It.toFixed(2)}px)`),it.fontSize=`${xt}${P.toFixed(2)}px)`,it.fontFamily=$.fontFamily,u.fontSize=P,v.setAttribute("role","presentation"),v.textContent=F.str,v.dir=F.dir,g._fontInspectorEnabled&&(v.dataset.fontName=F.fontName),_!==0&&(u.angle=_*(180/Math.PI));let Xt=!1;if(F.str.length>1)Xt=!0;else if(F.str!==" "&&F.transform[0]!==F.transform[3]){const zt=Math.abs(F.transform[0]),Gt=Math.abs(F.transform[3]);zt!==Gt&&Math.max(zt,Gt)/Math.min(zt,Gt)>1.5&&(Xt=!0)}Xt&&(u.canvasWidth=$.vertical?F.height:F.width),g._textDivProperties.set(v,u),g._isReadableStream&&g._layoutText(v)}function K(g){const{div:F,scale:J,properties:v,ctx:u,prevFontSize:m,prevFontFamily:_}=g,{style:$}=F;let P="";if(v.canvasWidth!==0&&v.hasText){const{fontFamily:Zt}=$,{canvasWidth:dt,fontSize:It}=v;(m!==It||_!==Zt)&&(u.font=`${It*J}px ${Zt}`,g.prevFontSize=It,g.prevFontFamily=Zt);const{width:xt}=u.measureText(F.textContent);xt>0&&(P=`scaleX(${dt*J/xt})`)}v.angle!==0&&(P=`rotate(${v.angle}deg) ${P}`),P.length>0&&($.transform=P)}function f(g){if(g._canceled)return;const F=g._textDivs,J=g._capability;if(F.length>B){J.resolve();return}if(!g._isReadableStream)for(const u of F)g._layoutText(u);J.resolve()}class S{constructor({textContentSource:F,container:J,viewport:v,textDivs:u,textDivProperties:m,textContentItemsStr:_,isOffscreenCanvasSupported:$}){var xt;this._textContentSource=F,this._isReadableStream=F instanceof ReadableStream,this._container=this._rootContainer=J,this._textDivs=u||[],this._textContentItemsStr=_||[],this._isOffscreenCanvasSupported=$,this._fontInspectorEnabled=!!((xt=globalThis.FontInspector)!=null&&xt.enabled),this._reader=null,this._textDivProperties=m||new WeakMap,this._canceled=!1,this._capability=new M.PromiseCapability,this._layoutTextParams={prevFontSize:null,prevFontFamily:null,div:null,scale:v.scale*(globalThis.devicePixelRatio||1),properties:null,ctx:I(0,$)};const{pageWidth:P,pageHeight:Zt,pageX:dt,pageY:It}=v.rawDims;this._transform=[1,0,0,-1,-dt,It+Zt],this._pageWidth=P,this._pageHeight=Zt,(0,p.setLayerDimensions)(J,v),this._capability.promise.finally(()=>{this._layoutTextParams=null}).catch(()=>{})}get promise(){return this._capability.promise}cancel(){this._canceled=!0,this._reader&&(this._reader.cancel(new M.AbortException("TextLayer task cancelled.")).catch(()=>{}),this._reader=null),this._capability.reject(new M.AbortException("TextLayer task cancelled."))}_processItems(F,J){for(const v of F){if(v.str===void 0){if(v.type==="beginMarkedContentProps"||v.type==="beginMarkedContent"){const u=this._container;this._container=document.createElement("span"),this._container.classList.add("markedContent"),v.id!==null&&this._container.setAttribute("id",`${v.id}`),u.append(this._container)}else v.type==="endMarkedContent"&&(this._container=this._container.parentNode);continue}this._textContentItemsStr.push(v.str),q(this,v,J)}}_layoutText(F){const J=this._layoutTextParams.properties=this._textDivProperties.get(F);if(this._layoutTextParams.div=F,K(this._layoutTextParams),J.hasText&&this._container.append(F),J.hasEOL){const v=document.createElement("br");v.setAttribute("role","presentation"),this._container.append(v)}}_render(){const F=new M.PromiseCapability;let J=Object.create(null);if(this._isReadableStream){const v=()=>{this._reader.read().then(({value:u,done:m})=>{if(m){F.resolve();return}Object.assign(J,u.styles),this._processItems(u.items,J),v()},F.reject)};this._reader=this._textContentSource.getReader(),v()}else if(this._textContentSource){const{items:v,styles:u}=this._textContentSource;this._processItems(v,u),F.resolve()}else throw new Error('No "textContentSource" parameter specified.');F.promise.then(()=>{J=null,f(this)},this._capability.reject)}}r.TextLayerRenderTask=S;function k(g){!g.textContentSource&&(g.textContent||g.textContentStream)&&((0,p.deprecated)("The TextLayerRender `textContent`/`textContentStream` parameters will be removed in the future, please use `textContentSource` instead."),g.textContentSource=g.textContent||g.textContentStream);const{container:F,viewport:J}=g,v=getComputedStyle(F),u=v.getPropertyValue("visibility"),m=parseFloat(v.getPropertyValue("--scale-factor"));u==="visible"&&(!m||Math.abs(m-J.scale)>1e-5)&&console.error("The `--scale-factor` CSS-variable must be set, to the same value as `viewport.scale`, either on the `container`-element itself or higher up in the DOM.");const _=new S(g);return _._render(),_}function T({container:g,viewport:F,textDivs:J,textDivProperties:v,isOffscreenCanvasSupported:u,mustRotate:m=!0,mustRescale:_=!0}){if(m&&(0,p.setLayerDimensions)(g,{rotation:F.rotation}),_){const $=I(0,u),Zt={prevFontSize:null,prevFontFamily:null,div:null,scale:F.scale*(globalThis.devicePixelRatio||1),properties:null,ctx:$};for(const dt of J)Zt.properties=v.get(dt),Zt.div=dt,K(Zt)}}},(lt,r,h)=>{var j,q,K,f,S,k,T,g,F,J,v,Fe,m,be,$,Je,Zt,Oe;Object.defineProperty(r,"__esModule",{value:!0}),r.AnnotationEditorLayer=void 0;var M=h(1),p=h(4),B=h(28),Q=h(33),U=h(6),O=h(34);const It=class It{constructor({uiManager:it,pageIndex:Xt,div:zt,accessibilityManager:Gt,annotationLayer:Nt,viewport:Ut,l10n:Vt}){ll(this,v);ll(this,m);ll(this,$);ll(this,Zt);ll(this,j,void 0);ll(this,q,!1);ll(this,K,null);ll(this,f,this.pointerup.bind(this));ll(this,S,this.pointerdown.bind(this));ll(this,k,new Map);ll(this,T,!1);ll(this,g,!1);ll(this,F,!1);ll(this,J,void 0);const Ht=[B.FreeTextEditor,Q.InkEditor,O.StampEditor];if(!It._initialized){It._initialized=!0;for(const Pt of Ht)Pt.initialize(Vt)}it.registerEditorTypes(Ht),ul(this,J,it),this.pageIndex=Xt,this.div=zt,ul(this,j,Gt),ul(this,K,Nt),this.viewport=Ut,bt(this,J).addLayer(this)}get isEmpty(){return bt(this,k).size===0}updateToolbar(it){bt(this,J).updateToolbar(it)}updateMode(it=bt(this,J).getMode()){nl(this,Zt,Oe).call(this),it===M.AnnotationEditorType.INK?(this.addInkEditorIfNeeded(!1),this.disableClick()):this.enableClick(),it!==M.AnnotationEditorType.NONE&&(this.div.classList.toggle("freeTextEditing",it===M.AnnotationEditorType.FREETEXT),this.div.classList.toggle("inkEditing",it===M.AnnotationEditorType.INK),this.div.classList.toggle("stampEditing",it===M.AnnotationEditorType.STAMP),this.div.hidden=!1)}addInkEditorIfNeeded(it){if(!it&&bt(this,J).getMode()!==M.AnnotationEditorType.INK)return;if(!it){for(const zt of bt(this,k).values())if(zt.isEmpty()){zt.setInBackground();return}}nl(this,m,be).call(this,{offsetX:0,offsetY:0},!1).setInBackground()}setEditingState(it){bt(this,J).setEditingState(it)}addCommands(it){bt(this,J).addCommands(it)}enable(){this.div.style.pointerEvents="auto";const it=new Set;for(const zt of bt(this,k).values())zt.enableEditing(),zt.annotationElementId&&it.add(zt.annotationElementId);if(!bt(this,K))return;const Xt=bt(this,K).getEditableAnnotations();for(const zt of Xt){if(zt.hide(),bt(this,J).isDeletedAnnotationElement(zt.data.id)||it.has(zt.data.id))continue;const Gt=this.deserialize(zt);Gt&&(this.addOrRebuild(Gt),Gt.enableEditing())}}disable(){var Xt;ul(this,F,!0),this.div.style.pointerEvents="none";const it=new Set;for(const zt of bt(this,k).values()){if(zt.disableEditing(),!zt.annotationElementId||zt.serialize()!==null){it.add(zt.annotationElementId);continue}(Xt=this.getEditableAnnotation(zt.annotationElementId))==null||Xt.show(),zt.remove()}if(bt(this,K)){const zt=bt(this,K).getEditableAnnotations();for(const Gt of zt){const{id:Nt}=Gt.data;it.has(Nt)||bt(this,J).isDeletedAnnotationElement(Nt)||Gt.show()}}nl(this,Zt,Oe).call(this),this.isEmpty&&(this.div.hidden=!0),ul(this,F,!1)}getEditableAnnotation(it){var Xt;return((Xt=bt(this,K))==null?void 0:Xt.getEditableAnnotation(it))||null}setActiveEditor(it){bt(this,J).getActive()!==it&&bt(this,J).setActiveEditor(it)}enableClick(){this.div.addEventListener("pointerdown",bt(this,S)),this.div.addEventListener("pointerup",bt(this,f))}disableClick(){this.div.removeEventListener("pointerdown",bt(this,S)),this.div.removeEventListener("pointerup",bt(this,f))}attach(it){bt(this,k).set(it.id,it);const{annotationElementId:Xt}=it;Xt&&bt(this,J).isDeletedAnnotationElement(Xt)&&bt(this,J).removeDeletedAnnotationElement(it)}detach(it){var Xt;bt(this,k).delete(it.id),(Xt=bt(this,j))==null||Xt.removePointerInTextLayer(it.contentDiv),!bt(this,F)&&it.annotationElementId&&bt(this,J).addDeletedAnnotationElement(it)}remove(it){this.detach(it),bt(this,J).removeEditor(it),it.div.contains(document.activeElement)&&setTimeout(()=>{bt(this,J).focusMainContainer()},0),it.div.remove(),it.isAttachedToDOM=!1,bt(this,g)||this.addInkEditorIfNeeded(!1)}changeParent(it){var Xt;it.parent!==this&&(it.annotationElementId&&(bt(this,J).addDeletedAnnotationElement(it.annotationElementId),p.AnnotationEditor.deleteAnnotationElement(it),it.annotationElementId=null),this.attach(it),(Xt=it.parent)==null||Xt.detach(it),it.setParent(this),it.div&&it.isAttachedToDOM&&(it.div.remove(),this.div.append(it.div)))}add(it){if(this.changeParent(it),bt(this,J).addEditor(it),this.attach(it),!it.isAttachedToDOM){const Xt=it.render();this.div.append(Xt),it.isAttachedToDOM=!0}it.fixAndSetPosition(),it.onceAdded(),bt(this,J).addToAnnotationStorage(it)}moveEditorInDOM(it){var zt;if(!it.isAttachedToDOM)return;const{activeElement:Xt}=document;it.div.contains(Xt)&&(it._focusEventsAllowed=!1,setTimeout(()=>{it.div.contains(document.activeElement)?it._focusEventsAllowed=!0:(it.div.addEventListener("focusin",()=>{it._focusEventsAllowed=!0},{once:!0}),Xt.focus())},0)),it._structTreeParentId=(zt=bt(this,j))==null?void 0:zt.moveElementInDOM(this.div,it.div,it.contentDiv,!0)}addOrRebuild(it){it.needsToBeRebuilt()?it.rebuild():this.add(it)}addUndoableEditor(it){const Xt=()=>it._uiManager.rebuild(it),zt=()=>{it.remove()};this.addCommands({cmd:Xt,undo:zt,mustExec:!1})}getNextId(){return bt(this,J).getId()}pasteEditor(it,Xt){bt(this,J).updateToolbar(it),bt(this,J).updateMode(it);const{offsetX:zt,offsetY:Gt}=nl(this,$,Je).call(this),Nt=this.getNextId(),Ut=nl(this,v,Fe).call(this,{parent:this,id:Nt,x:zt,y:Gt,uiManager:bt(this,J),isCentered:!0,...Xt});Ut&&this.add(Ut)}deserialize(it){switch(it.annotationType??it.annotationEditorType){case M.AnnotationEditorType.FREETEXT:return B.FreeTextEditor.deserialize(it,this,bt(this,J));case M.AnnotationEditorType.INK:return Q.InkEditor.deserialize(it,this,bt(this,J));case M.AnnotationEditorType.STAMP:return O.StampEditor.deserialize(it,this,bt(this,J))}return null}addNewEditor(){nl(this,m,be).call(this,nl(this,$,Je).call(this),!0)}setSelected(it){bt(this,J).setSelected(it)}toggleSelected(it){bt(this,J).toggleSelected(it)}isSelected(it){return bt(this,J).isSelected(it)}unselect(it){bt(this,J).unselect(it)}pointerup(it){const{isMac:Xt}=M.FeatureTest.platform;if(!(it.button!==0||it.ctrlKey&&Xt)&&it.target===this.div&&bt(this,T)){if(ul(this,T,!1),!bt(this,q)){ul(this,q,!0);return}if(bt(this,J).getMode()===M.AnnotationEditorType.STAMP){bt(this,J).unselectAll();return}nl(this,m,be).call(this,it,!1)}}pointerdown(it){if(bt(this,T)){ul(this,T,!1);return}const{isMac:Xt}=M.FeatureTest.platform;if(it.button!==0||it.ctrlKey&&Xt||it.target!==this.div)return;ul(this,T,!0);const zt=bt(this,J).getActive();ul(this,q,!zt||zt.isEmpty())}findNewParent(it,Xt,zt){const Gt=bt(this,J).findParent(Xt,zt);return Gt===null||Gt===this?!1:(Gt.changeParent(it),!0)}destroy(){var it,Xt;((it=bt(this,J).getActive())==null?void 0:it.parent)===this&&(bt(this,J).commitOrRemove(),bt(this,J).setActiveEditor(null));for(const zt of bt(this,k).values())(Xt=bt(this,j))==null||Xt.removePointerInTextLayer(zt.contentDiv),zt.setParent(null),zt.isAttachedToDOM=!1,zt.div.remove();this.div=null,bt(this,k).clear(),bt(this,J).removeLayer(this)}render({viewport:it}){this.viewport=it,(0,U.setLayerDimensions)(this.div,it);for(const Xt of bt(this,J).getEditors(this.pageIndex))this.add(Xt);this.updateMode()}update({viewport:it}){bt(this,J).commitOrRemove(),this.viewport=it,(0,U.setLayerDimensions)(this.div,{rotation:it.rotation}),this.updateMode()}get pageDimensions(){const{pageWidth:it,pageHeight:Xt}=this.viewport.rawDims;return[it,Xt]}};j=new WeakMap,q=new WeakMap,K=new WeakMap,f=new WeakMap,S=new WeakMap,k=new WeakMap,T=new WeakMap,g=new WeakMap,F=new WeakMap,J=new WeakMap,v=new WeakSet,Fe=function(it){switch(bt(this,J).getMode()){case M.AnnotationEditorType.FREETEXT:return new B.FreeTextEditor(it);case M.AnnotationEditorType.INK:return new Q.InkEditor(it);case M.AnnotationEditorType.STAMP:return new O.StampEditor(it)}return null},m=new WeakSet,be=function(it,Xt){const zt=this.getNextId(),Gt=nl(this,v,Fe).call(this,{parent:this,id:zt,x:it.offsetX,y:it.offsetY,uiManager:bt(this,J),isCentered:Xt});return Gt&&this.add(Gt),Gt},$=new WeakSet,Je=function(){const{x:it,y:Xt,width:zt,height:Gt}=this.div.getBoundingClientRect(),Nt=Math.max(0,it),Ut=Math.max(0,Xt),Vt=Math.min(window.innerWidth,it+zt),Ht=Math.min(window.innerHeight,Xt+Gt),Pt=(Nt+Vt)/2-it,at=(Ut+Ht)/2-Xt,[R,w]=this.viewport.rotation%180===0?[Pt,at]:[at,Pt];return{offsetX:R,offsetY:w}},Zt=new WeakSet,Oe=function(){ul(this,g,!0);for(const it of bt(this,k).values())it.isEmpty()&&it.remove();ul(this,g,!1)},gl(It,"_initialized",!1);let I=It;r.AnnotationEditorLayer=I},(lt,r,h)=>{var O,I,j,q,K,f,S,k,T,g,us,J,Ws,u,Gs,_,le,P,Ue,dt,Ms,xt,Ee;Object.defineProperty(r,"__esModule",{value:!0}),r.FreeTextEditor=void 0;var M=h(1),p=h(5),B=h(4),Q=h(29);const Xt=class Xt extends B.AnnotationEditor{constructor(Nt){super({...Nt,name:"freeTextEditor"});ll(this,g);ll(this,J);ll(this,u);ll(this,_);ll(this,P);ll(this,dt);ll(this,xt);ll(this,O,this.editorDivBlur.bind(this));ll(this,I,this.editorDivFocus.bind(this));ll(this,j,this.editorDivInput.bind(this));ll(this,q,this.editorDivKeydown.bind(this));ll(this,K,void 0);ll(this,f,"");ll(this,S,`${this.id}-editor`);ll(this,k,void 0);ll(this,T,null);ul(this,K,Nt.color||Xt._defaultColor||B.AnnotationEditor._defaultLineColor),ul(this,k,Nt.fontSize||Xt._defaultFontSize)}static get _keyboardManager(){const Nt=Xt.prototype,Ut=Pt=>Pt.isEmpty(),Vt=p.AnnotationEditorUIManager.TRANSLATE_SMALL,Ht=p.AnnotationEditorUIManager.TRANSLATE_BIG;return(0,M.shadow)(this,"_keyboardManager",new p.KeyboardManager([[["ctrl+s","mac+meta+s","ctrl+p","mac+meta+p"],Nt.commitOrRemove,{bubbles:!0}],[["ctrl+Enter","mac+meta+Enter","Escape","mac+Escape"],Nt.commitOrRemove],[["ArrowLeft","mac+ArrowLeft"],Nt._translateEmpty,{args:[-Vt,0],checker:Ut}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],Nt._translateEmpty,{args:[-Ht,0],checker:Ut}],[["ArrowRight","mac+ArrowRight"],Nt._translateEmpty,{args:[Vt,0],checker:Ut}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],Nt._translateEmpty,{args:[Ht,0],checker:Ut}],[["ArrowUp","mac+ArrowUp"],Nt._translateEmpty,{args:[0,-Vt],checker:Ut}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],Nt._translateEmpty,{args:[0,-Ht],checker:Ut}],[["ArrowDown","mac+ArrowDown"],Nt._translateEmpty,{args:[0,Vt],checker:Ut}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],Nt._translateEmpty,{args:[0,Ht],checker:Ut}]]))}static initialize(Nt){B.AnnotationEditor.initialize(Nt,{strings:["free_text2_default_content","editor_free_text2_aria_label"]});const Ut=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(Ut.getPropertyValue("--freetext-padding"))}static updateDefaultParams(Nt,Ut){switch(Nt){case M.AnnotationEditorParamsType.FREETEXT_SIZE:Xt._defaultFontSize=Ut;break;case M.AnnotationEditorParamsType.FREETEXT_COLOR:Xt._defaultColor=Ut;break}}updateParams(Nt,Ut){switch(Nt){case M.AnnotationEditorParamsType.FREETEXT_SIZE:nl(this,g,us).call(this,Ut);break;case M.AnnotationEditorParamsType.FREETEXT_COLOR:nl(this,J,Ws).call(this,Ut);break}}static get defaultPropertiesToUpdate(){return[[M.AnnotationEditorParamsType.FREETEXT_SIZE,Xt._defaultFontSize],[M.AnnotationEditorParamsType.FREETEXT_COLOR,Xt._defaultColor||B.AnnotationEditor._defaultLineColor]]}get propertiesToUpdate(){return[[M.AnnotationEditorParamsType.FREETEXT_SIZE,bt(this,k)],[M.AnnotationEditorParamsType.FREETEXT_COLOR,bt(this,K)]]}_translateEmpty(Nt,Ut){this._uiManager.translateSelectedEditors(Nt,Ut,!0)}getInitialTranslation(){const Nt=this.parentScale;return[-Xt._internalPadding*Nt,-(Xt._internalPadding+bt(this,k))*Nt]}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(this.isAttachedToDOM||this.parent.add(this)))}enableEditMode(){this.isInEditMode()||(this.parent.setEditingState(!1),this.parent.updateToolbar(M.AnnotationEditorType.FREETEXT),super.enableEditMode(),this.overlayDiv.classList.remove("enabled"),this.editorDiv.contentEditable=!0,this._isDraggable=!1,this.div.removeAttribute("aria-activedescendant"),this.editorDiv.addEventListener("keydown",bt(this,q)),this.editorDiv.addEventListener("focus",bt(this,I)),this.editorDiv.addEventListener("blur",bt(this,O)),this.editorDiv.addEventListener("input",bt(this,j)))}disableEditMode(){this.isInEditMode()&&(this.parent.setEditingState(!0),super.disableEditMode(),this.overlayDiv.classList.add("enabled"),this.editorDiv.contentEditable=!1,this.div.setAttribute("aria-activedescendant",bt(this,S)),this._isDraggable=!0,this.editorDiv.removeEventListener("keydown",bt(this,q)),this.editorDiv.removeEventListener("focus",bt(this,I)),this.editorDiv.removeEventListener("blur",bt(this,O)),this.editorDiv.removeEventListener("input",bt(this,j)),this.div.focus({preventScroll:!0}),this.isEditing=!1,this.parent.div.classList.add("freeTextEditing"))}focusin(Nt){this._focusEventsAllowed&&(super.focusin(Nt),Nt.target!==this.editorDiv&&this.editorDiv.focus())}onceAdded(){var Nt;if(this.width){nl(this,xt,Ee).call(this);return}this.enableEditMode(),this.editorDiv.focus(),(Nt=this._initialOptions)!=null&&Nt.isCentered&&this.center(),this._initialOptions=null}isEmpty(){return!this.editorDiv||this.editorDiv.innerText.trim()===""}remove(){this.isEditing=!1,this.parent&&(this.parent.setEditingState(!0),this.parent.div.classList.add("freeTextEditing")),super.remove()}commit(){if(!this.isInEditMode())return;super.commit(),this.disableEditMode();const Nt=bt(this,f),Ut=ul(this,f,nl(this,u,Gs).call(this).trimEnd());if(Nt===Ut)return;const Vt=Ht=>{if(ul(this,f,Ht),!Ht){this.remove();return}nl(this,P,Ue).call(this),this._uiManager.rebuild(this),nl(this,_,le).call(this)};this.addCommands({cmd:()=>{Vt(Ut)},undo:()=>{Vt(Nt)},mustExec:!1}),nl(this,_,le).call(this)}shouldGetKeyboardEvents(){return this.isInEditMode()}enterInEditMode(){this.enableEditMode(),this.editorDiv.focus()}dblclick(Nt){this.enterInEditMode()}keydown(Nt){Nt.target===this.div&&Nt.key==="Enter"&&(this.enterInEditMode(),Nt.preventDefault())}editorDivKeydown(Nt){Xt._keyboardManager.exec(this,Nt)}editorDivFocus(Nt){this.isEditing=!0}editorDivBlur(Nt){this.isEditing=!1}editorDivInput(Nt){this.parent.div.classList.toggle("freeTextEditing",this.isEmpty())}disableEditing(){this.editorDiv.setAttribute("role","comment"),this.editorDiv.removeAttribute("aria-multiline")}enableEditing(){this.editorDiv.setAttribute("role","textbox"),this.editorDiv.setAttribute("aria-multiline",!0)}render(){if(this.div)return this.div;let Nt,Ut;this.width&&(Nt=this.x,Ut=this.y),super.render(),this.editorDiv=document.createElement("div"),this.editorDiv.className="internal",this.editorDiv.setAttribute("id",bt(this,S)),this.enableEditing(),B.AnnotationEditor._l10nPromise.get("editor_free_text2_aria_label").then(Ht=>{var Pt;return(Pt=this.editorDiv)==null?void 0:Pt.setAttribute("aria-label",Ht)}),B.AnnotationEditor._l10nPromise.get("free_text2_default_content").then(Ht=>{var Pt;return(Pt=this.editorDiv)==null?void 0:Pt.setAttribute("default-content",Ht)}),this.editorDiv.contentEditable=!0;const{style:Vt}=this.editorDiv;if(Vt.fontSize=`calc(${bt(this,k)}px * var(--scale-factor))`,Vt.color=bt(this,K),this.div.append(this.editorDiv),this.overlayDiv=document.createElement("div"),this.overlayDiv.classList.add("overlay","enabled"),this.div.append(this.overlayDiv),(0,p.bindEvents)(this,this.div,["dblclick","keydown"]),this.width){const[Ht,Pt]=this.parentDimensions;if(this.annotationElementId){const{position:at}=bt(this,T);let[R,w]=this.getInitialTranslation();[R,w]=this.pageTranslationToScreen(R,w);const[X,C]=this.pageDimensions,[H,st]=this.pageTranslation;let et,Mt;switch(this.rotation){case 0:et=Nt+(at[0]-H)/X,Mt=Ut+this.height-(at[1]-st)/C;break;case 90:et=Nt+(at[0]-H)/X,Mt=Ut-(at[1]-st)/C,[R,w]=[w,-R];break;case 180:et=Nt-this.width+(at[0]-H)/X,Mt=Ut-(at[1]-st)/C,[R,w]=[-R,-w];break;case 270:et=Nt+(at[0]-H-this.height*C)/X,Mt=Ut+(at[1]-st-this.width*X)/C,[R,w]=[-w,R];break}this.setAt(et*Ht,Mt*Pt,R,w)}else this.setAt(Nt*Ht,Ut*Pt,this.width*Ht,this.height*Pt);nl(this,P,Ue).call(this),this._isDraggable=!0,this.editorDiv.contentEditable=!1}else this._isDraggable=!1,this.editorDiv.contentEditable=!0;return this.div}get contentDiv(){return this.editorDiv}static deserialize(Nt,Ut,Vt){let Ht=null;if(Nt instanceof Q.FreeTextAnnotationElement){const{data:{defaultAppearanceData:{fontSize:at,fontColor:R},rect:w,rotation:X,id:C},textContent:H,textPosition:st,parent:{page:{pageNumber:et}}}=Nt;if(!H||H.length===0)return null;Ht=Nt={annotationType:M.AnnotationEditorType.FREETEXT,color:Array.from(R),fontSize:at,value:H.join(`
|