codex 1.7.0__py3-none-any.whl → 1.7.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/db.py +17 -32
- codex/exceptions.py +3 -2
- codex/librarian/covers/coverd.py +4 -3
- codex/librarian/covers/create.py +7 -8
- codex/librarian/covers/path.py +2 -1
- codex/librarian/covers/purge.py +2 -2
- codex/librarian/janitor/integrity.py +10 -12
- codex/librarian/janitor/tasks.py +1 -1
- codex/librarian/librariand.py +0 -5
- codex/librarian/watchdog/emitter.py +19 -21
- codex/librarian/watchdog/event_batcherd.py +1 -0
- codex/migrations/0030_nocase_collation_day_month_indexes_status_types.py +0 -4
- codex/models/admin.py +5 -0
- codex/models/functions.py +5 -6
- codex/models/query.py +0 -6
- codex/run.py +9 -11
- codex/serializers/admin/tasks.py +2 -2
- codex/serializers/browser/mixins.py +14 -18
- codex/serializers/browser/settings.py +4 -4
- codex/serializers/choices.py +196 -0
- codex/serializers/fields.py +5 -9
- codex/startup.py +4 -6
- codex/static_root/assets/VCheckbox-CWiqcZ7a.3feebd47daab.js +1 -0
- codex/static_root/assets/VCheckbox-CWiqcZ7a.3feebd47daab.js.br +0 -0
- codex/static_root/assets/VCheckbox-CWiqcZ7a.3feebd47daab.js.gz +0 -0
- codex/static_root/assets/VCheckbox-CWiqcZ7a.js +1 -0
- codex/static_root/assets/VCheckbox-CWiqcZ7a.js.br +0 -0
- codex/static_root/assets/VCheckbox-CWiqcZ7a.js.gz +0 -0
- codex/static_root/assets/VCheckboxBtn-Dk3iB62X.bc66d5351baa.js +1 -0
- codex/static_root/assets/VCheckboxBtn-Dk3iB62X.bc66d5351baa.js.br +0 -0
- codex/static_root/assets/VCheckboxBtn-Dk3iB62X.bc66d5351baa.js.gz +0 -0
- codex/static_root/assets/VCheckboxBtn-Dk3iB62X.js +1 -0
- codex/static_root/assets/VCheckboxBtn-Dk3iB62X.js.br +0 -0
- codex/static_root/assets/VCheckboxBtn-Dk3iB62X.js.gz +0 -0
- codex/static_root/assets/VCombobox-D1_KU27A.b1d30587a973.js +1 -0
- codex/static_root/assets/VCombobox-D1_KU27A.b1d30587a973.js.br +0 -0
- codex/static_root/assets/VCombobox-D1_KU27A.b1d30587a973.js.gz +0 -0
- codex/static_root/assets/VCombobox-D1_KU27A.js +1 -0
- codex/static_root/assets/VCombobox-D1_KU27A.js.br +0 -0
- codex/static_root/assets/VCombobox-D1_KU27A.js.gz +0 -0
- codex/static_root/assets/VDialog-38np3TSA.5a0cb7a9e56d.css +1 -0
- codex/static_root/assets/VDialog-38np3TSA.5a0cb7a9e56d.css.br +0 -0
- codex/static_root/assets/VDialog-38np3TSA.5a0cb7a9e56d.css.gz +0 -0
- codex/static_root/assets/VDialog-38np3TSA.css +1 -0
- codex/static_root/assets/VDialog-38np3TSA.css.br +0 -0
- codex/static_root/assets/VDialog-38np3TSA.css.gz +0 -0
- codex/static_root/assets/VDialog-GbxvFMMN.594fb3a39ced.js +1 -0
- codex/static_root/assets/VDialog-GbxvFMMN.594fb3a39ced.js.br +0 -0
- codex/static_root/assets/VDialog-GbxvFMMN.594fb3a39ced.js.gz +0 -0
- codex/static_root/assets/VDialog-GbxvFMMN.js +1 -0
- codex/static_root/assets/VDialog-GbxvFMMN.js.br +0 -0
- codex/static_root/assets/VDialog-GbxvFMMN.js.gz +0 -0
- codex/static_root/assets/VExpansionPanels-Cywv_bEj.a762e63858e5.js +1 -0
- codex/static_root/assets/VExpansionPanels-Cywv_bEj.a762e63858e5.js.br +0 -0
- codex/static_root/assets/VExpansionPanels-Cywv_bEj.a762e63858e5.js.gz +0 -0
- codex/static_root/assets/VExpansionPanels-Cywv_bEj.js +1 -0
- codex/static_root/assets/VExpansionPanels-Cywv_bEj.js.br +0 -0
- codex/static_root/assets/VExpansionPanels-Cywv_bEj.js.gz +0 -0
- codex/static_root/assets/VRadioGroup-C0etmxpZ.0eb3009a6300.js +1 -0
- codex/static_root/assets/VRadioGroup-C0etmxpZ.0eb3009a6300.js.br +0 -0
- codex/static_root/assets/VRadioGroup-C0etmxpZ.0eb3009a6300.js.gz +0 -0
- codex/static_root/assets/VRadioGroup-C0etmxpZ.js +1 -0
- codex/static_root/assets/VRadioGroup-C0etmxpZ.js.br +0 -0
- codex/static_root/assets/VRadioGroup-C0etmxpZ.js.gz +0 -0
- codex/static_root/assets/VSelect-Ca2bIOso.6613989e4c45.css +1 -0
- codex/static_root/assets/VSelect-Ca2bIOso.6613989e4c45.css.br +0 -0
- codex/static_root/assets/VSelect-Ca2bIOso.6613989e4c45.css.gz +0 -0
- codex/static_root/assets/VSelect-Ca2bIOso.css +1 -0
- codex/static_root/assets/VSelect-Ca2bIOso.css.br +0 -0
- codex/static_root/assets/VSelect-Ca2bIOso.css.gz +0 -0
- codex/static_root/assets/VSelect-txrnRiNJ.a5625760018c.js +1 -0
- codex/static_root/assets/VSelect-txrnRiNJ.a5625760018c.js.br +0 -0
- codex/static_root/assets/VSelect-txrnRiNJ.a5625760018c.js.gz +0 -0
- codex/static_root/assets/VSelect-txrnRiNJ.js +1 -0
- codex/static_root/assets/VSelect-txrnRiNJ.js.br +0 -0
- codex/static_root/assets/VSelect-txrnRiNJ.js.gz +0 -0
- codex/static_root/assets/VSelectionControl-CY6RmcvW.7e8824224f6c.js +1 -0
- codex/static_root/assets/VSelectionControl-CY6RmcvW.7e8824224f6c.js.br +0 -0
- codex/static_root/assets/VSelectionControl-CY6RmcvW.7e8824224f6c.js.gz +0 -0
- codex/static_root/assets/VSelectionControl-CY6RmcvW.js +1 -0
- codex/static_root/assets/VSelectionControl-CY6RmcvW.js.br +0 -0
- codex/static_root/assets/VSelectionControl-CY6RmcvW.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/VSlideGroup-DtEQMwY1.6c72325635ed.js +1 -0
- codex/static_root/assets/VSlideGroup-DtEQMwY1.6c72325635ed.js.br +0 -0
- codex/static_root/assets/VSlideGroup-DtEQMwY1.6c72325635ed.js.gz +0 -0
- codex/static_root/assets/VSlideGroup-DtEQMwY1.js +1 -0
- codex/static_root/assets/VSlideGroup-DtEQMwY1.js.br +0 -0
- codex/static_root/assets/VSlideGroup-DtEQMwY1.js.gz +0 -0
- codex/static_root/assets/VTable-2af995xo.6c5bf36631b2.js +1 -0
- codex/static_root/assets/VTable-2af995xo.6c5bf36631b2.js.br +0 -0
- codex/static_root/assets/VTable-2af995xo.6c5bf36631b2.js.gz +0 -0
- codex/static_root/assets/VTable-2af995xo.js +1 -0
- codex/static_root/assets/VTable-2af995xo.js.br +0 -0
- codex/static_root/assets/VTable-2af995xo.js.gz +0 -0
- codex/static_root/assets/VTextField-Crc3gdNh.39995ccf4d52.css +1 -0
- codex/static_root/assets/VTextField-Crc3gdNh.39995ccf4d52.css.br +0 -0
- codex/static_root/assets/VTextField-Crc3gdNh.39995ccf4d52.css.gz +0 -0
- codex/static_root/assets/VTextField-Crc3gdNh.css +1 -0
- codex/static_root/assets/VTextField-Crc3gdNh.css.br +0 -0
- codex/static_root/assets/VTextField-Crc3gdNh.css.gz +0 -0
- codex/static_root/assets/VTextField-G6CMj7yO.657a130dd302.js +1 -0
- codex/static_root/assets/VTextField-G6CMj7yO.657a130dd302.js.br +0 -0
- codex/static_root/assets/VTextField-G6CMj7yO.657a130dd302.js.gz +0 -0
- codex/static_root/assets/VTextField-G6CMj7yO.js +1 -0
- codex/static_root/assets/VTextField-G6CMj7yO.js.br +0 -0
- codex/static_root/assets/VTextField-G6CMj7yO.js.gz +0 -0
- codex/static_root/assets/VWindowItem-CzoGd6Ul.721e5da11ad4.js +1 -0
- codex/static_root/assets/VWindowItem-CzoGd6Ul.721e5da11ad4.js.br +0 -0
- codex/static_root/assets/VWindowItem-CzoGd6Ul.721e5da11ad4.js.gz +0 -0
- codex/static_root/assets/VWindowItem-CzoGd6Ul.js +1 -0
- codex/static_root/assets/VWindowItem-CzoGd6Ul.js.br +0 -0
- codex/static_root/assets/VWindowItem-CzoGd6Ul.js.gz +0 -0
- codex/static_root/assets/{admin-DJ7pIXDQ.css → admin-CWEjaFr5.7d4523387384.css} +1 -1
- codex/static_root/assets/admin-CWEjaFr5.7d4523387384.css.br +0 -0
- codex/static_root/assets/admin-CWEjaFr5.7d4523387384.css.gz +0 -0
- codex/static_root/assets/{admin-DJ7pIXDQ.e2a77af73ef2.css → admin-CWEjaFr5.css} +1 -1
- codex/static_root/assets/admin-CWEjaFr5.css.br +0 -0
- codex/static_root/assets/admin-CWEjaFr5.css.gz +0 -0
- codex/static_root/assets/admin-CsPAIQeG.5175467148a3.js +1 -0
- codex/static_root/assets/admin-CsPAIQeG.5175467148a3.js.br +0 -0
- codex/static_root/assets/admin-CsPAIQeG.5175467148a3.js.gz +0 -0
- codex/static_root/assets/admin-CsPAIQeG.js +1 -0
- codex/static_root/assets/admin-CsPAIQeG.js.br +0 -0
- codex/static_root/assets/admin-CsPAIQeG.js.gz +0 -0
- codex/static_root/assets/admin-drawer-panel-BAT7GA64.73a064628c19.js +30 -0
- codex/static_root/assets/admin-drawer-panel-BAT7GA64.73a064628c19.js.br +0 -0
- codex/static_root/assets/admin-drawer-panel-BAT7GA64.73a064628c19.js.gz +0 -0
- codex/static_root/assets/admin-drawer-panel-BAT7GA64.js +30 -0
- codex/static_root/assets/admin-drawer-panel-BAT7GA64.js.br +0 -0
- codex/static_root/assets/admin-drawer-panel-BAT7GA64.js.gz +0 -0
- codex/static_root/assets/admin-drawer-panel-Bs2wgKj3.3cb33056e994.css +1 -0
- codex/static_root/assets/admin-drawer-panel-Bs2wgKj3.3cb33056e994.css.br +0 -0
- codex/static_root/assets/admin-drawer-panel-Bs2wgKj3.3cb33056e994.css.gz +0 -0
- codex/static_root/assets/admin-drawer-panel-Bs2wgKj3.css +1 -0
- codex/static_root/assets/admin-drawer-panel-Bs2wgKj3.css.br +0 -0
- codex/static_root/assets/admin-drawer-panel-Bs2wgKj3.css.gz +0 -0
- codex/static_root/assets/browser-C18l93yc.923860009ef4.js +1 -0
- codex/static_root/assets/browser-C18l93yc.923860009ef4.js.br +0 -0
- codex/static_root/assets/browser-C18l93yc.923860009ef4.js.gz +0 -0
- codex/static_root/assets/browser-C18l93yc.js +1 -0
- codex/static_root/assets/browser-C18l93yc.js.br +0 -0
- codex/static_root/assets/browser-C18l93yc.js.gz +0 -0
- codex/static_root/assets/browser-DaAqlBYO.708ecf0904bb.css +1 -0
- codex/static_root/assets/browser-DaAqlBYO.708ecf0904bb.css.br +0 -0
- codex/static_root/assets/browser-DaAqlBYO.708ecf0904bb.css.gz +0 -0
- codex/static_root/assets/browser-DaAqlBYO.css +1 -0
- codex/static_root/assets/browser-DaAqlBYO.css.br +0 -0
- codex/static_root/assets/browser-DaAqlBYO.css.gz +0 -0
- codex/static_root/assets/change-password-dialog-BazJdNs9.0a4e02656a35.js +1 -0
- codex/static_root/assets/change-password-dialog-BazJdNs9.0a4e02656a35.js.br +0 -0
- codex/static_root/assets/change-password-dialog-BazJdNs9.0a4e02656a35.js.gz +0 -0
- codex/static_root/assets/change-password-dialog-BazJdNs9.js +1 -0
- codex/static_root/assets/change-password-dialog-BazJdNs9.js.br +0 -0
- codex/static_root/assets/change-password-dialog-BazJdNs9.js.gz +0 -0
- codex/static_root/assets/change-password-dialog-Mlmvz8_4.111421f51e79.css +1 -0
- codex/static_root/assets/change-password-dialog-Mlmvz8_4.111421f51e79.css.br +0 -0
- codex/static_root/assets/change-password-dialog-Mlmvz8_4.111421f51e79.css.gz +0 -0
- codex/static_root/assets/change-password-dialog-Mlmvz8_4.css +1 -0
- codex/static_root/assets/change-password-dialog-Mlmvz8_4.css.br +0 -0
- codex/static_root/assets/change-password-dialog-Mlmvz8_4.css.gz +0 -0
- codex/static_root/assets/confirm-dialog-BmhedLCx.7c2103d319d4.css +1 -0
- codex/static_root/assets/confirm-dialog-BmhedLCx.css +1 -0
- codex/static_root/assets/confirm-dialog-CbW3hlOp.9dd39b443c31.js +1 -0
- codex/static_root/assets/confirm-dialog-CbW3hlOp.9dd39b443c31.js.br +0 -0
- codex/static_root/assets/confirm-dialog-CbW3hlOp.9dd39b443c31.js.gz +0 -0
- codex/static_root/assets/confirm-dialog-CbW3hlOp.js +1 -0
- codex/static_root/assets/confirm-dialog-CbW3hlOp.js.br +0 -0
- codex/static_root/assets/confirm-dialog-CbW3hlOp.js.gz +0 -0
- codex/static_root/assets/datetime-column-uSqKZU37.b157b0743db5.js +1 -0
- codex/static_root/assets/datetime-column-uSqKZU37.b157b0743db5.js.br +0 -0
- codex/static_root/assets/datetime-column-uSqKZU37.b157b0743db5.js.gz +0 -0
- codex/static_root/assets/datetime-column-uSqKZU37.js +1 -0
- codex/static_root/assets/datetime-column-uSqKZU37.js.br +0 -0
- codex/static_root/assets/datetime-column-uSqKZU37.js.gz +0 -0
- codex/static_root/assets/filter-CBl5KEsB.845a81573c2e.js +1 -0
- codex/static_root/assets/filter-CBl5KEsB.845a81573c2e.js.br +0 -0
- codex/static_root/assets/filter-CBl5KEsB.845a81573c2e.js.gz +0 -0
- codex/static_root/assets/filter-CBl5KEsB.js +1 -0
- codex/static_root/assets/filter-CBl5KEsB.js.br +0 -0
- codex/static_root/assets/filter-CBl5KEsB.js.gz +0 -0
- codex/static_root/assets/flag-tab-CT8pqM4r.ecb6eee2e7a0.js +1 -0
- codex/static_root/assets/flag-tab-CT8pqM4r.ecb6eee2e7a0.js.br +0 -0
- codex/static_root/assets/flag-tab-CT8pqM4r.ecb6eee2e7a0.js.gz +0 -0
- codex/static_root/assets/flag-tab-CT8pqM4r.js +1 -0
- codex/static_root/assets/flag-tab-CT8pqM4r.js.br +0 -0
- codex/static_root/assets/flag-tab-CT8pqM4r.js.gz +0 -0
- codex/static_root/assets/flag-tab-DBqpLKi7.css +1 -0
- codex/static_root/assets/flag-tab-DBqpLKi7.css.br +0 -0
- codex/static_root/assets/flag-tab-DBqpLKi7.css.gz +0 -0
- codex/static_root/assets/flag-tab-DBqpLKi7.dcfef39f541e.css +1 -0
- codex/static_root/assets/flag-tab-DBqpLKi7.dcfef39f541e.css.br +0 -0
- codex/static_root/assets/flag-tab-DBqpLKi7.dcfef39f541e.css.gz +0 -0
- codex/static_root/assets/group-tab-BOW9kigw.7e5007596367.js +1 -0
- codex/static_root/assets/group-tab-BOW9kigw.7e5007596367.js.br +0 -0
- codex/static_root/assets/group-tab-BOW9kigw.7e5007596367.js.gz +0 -0
- codex/static_root/assets/group-tab-BOW9kigw.js +1 -0
- codex/static_root/assets/group-tab-BOW9kigw.js.br +0 -0
- codex/static_root/assets/group-tab-BOW9kigw.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-C6yuLApo.45cf99eb7a70.js +1 -0
- codex/static_root/assets/http-error-C6yuLApo.45cf99eb7a70.js.br +4 -0
- codex/static_root/assets/http-error-C6yuLApo.45cf99eb7a70.js.gz +0 -0
- codex/static_root/assets/http-error-C6yuLApo.js +1 -0
- codex/static_root/assets/http-error-C6yuLApo.js.br +4 -0
- codex/static_root/assets/http-error-C6yuLApo.js.gz +0 -0
- codex/static_root/assets/{library-tab-Wew8YOLv.0c1780a6b68e.css → library-tab-Bh7ErAk7.7c44200ee727.css} +1 -1
- codex/static_root/assets/library-tab-Bh7ErAk7.7c44200ee727.css.br +2 -0
- codex/static_root/assets/library-tab-Bh7ErAk7.7c44200ee727.css.gz +0 -0
- codex/static_root/assets/{library-tab-Wew8YOLv.css → library-tab-Bh7ErAk7.css} +1 -1
- codex/static_root/assets/library-tab-Bh7ErAk7.css.br +2 -0
- codex/static_root/assets/library-tab-Bh7ErAk7.css.gz +0 -0
- codex/static_root/assets/library-tab-D3WOtpE0.9af34e6e7235.js +1 -0
- codex/static_root/assets/library-tab-D3WOtpE0.9af34e6e7235.js.br +0 -0
- codex/static_root/assets/library-tab-D3WOtpE0.9af34e6e7235.js.gz +0 -0
- codex/static_root/assets/library-tab-D3WOtpE0.js +1 -0
- codex/static_root/assets/library-tab-D3WOtpE0.js.br +0 -0
- codex/static_root/assets/library-tab-D3WOtpE0.js.gz +0 -0
- codex/static_root/assets/main-CmjU2oTp.6a471f6900e5.js +6 -0
- codex/static_root/assets/main-CmjU2oTp.6a471f6900e5.js.br +0 -0
- codex/static_root/assets/main-CmjU2oTp.6a471f6900e5.js.gz +0 -0
- codex/static_root/assets/main-CmjU2oTp.js +6 -0
- codex/static_root/assets/main-CmjU2oTp.js.br +0 -0
- codex/static_root/assets/main-CmjU2oTp.js.gz +0 -0
- codex/static_root/assets/pager-full-pdf-BH54_5f6.6e92d0555cd7.js +1 -0
- codex/static_root/assets/pager-full-pdf-BH54_5f6.6e92d0555cd7.js.br +0 -0
- codex/static_root/assets/pager-full-pdf-BH54_5f6.6e92d0555cd7.js.gz +0 -0
- codex/static_root/assets/pager-full-pdf-BH54_5f6.js +1 -0
- codex/static_root/assets/pager-full-pdf-BH54_5f6.js.br +0 -0
- codex/static_root/assets/pager-full-pdf-BH54_5f6.js.gz +0 -0
- codex/static_root/assets/pagination-toolbar-JH3Kbffr.451171f7ac33.js +1 -0
- codex/static_root/assets/pagination-toolbar-JH3Kbffr.451171f7ac33.js.br +0 -0
- codex/static_root/assets/pagination-toolbar-JH3Kbffr.451171f7ac33.js.gz +0 -0
- codex/static_root/assets/pagination-toolbar-JH3Kbffr.js +1 -0
- codex/static_root/assets/pagination-toolbar-JH3Kbffr.js.br +0 -0
- codex/static_root/assets/pagination-toolbar-JH3Kbffr.js.gz +0 -0
- codex/static_root/assets/{pdf-doc-ctqZIwOP.7e7b2c815ea4.js → pdf-doc-BcRNpoaW.882f6e967869.js} +3 -3
- codex/static_root/assets/pdf-doc-BcRNpoaW.882f6e967869.js.br +0 -0
- codex/static_root/assets/pdf-doc-BcRNpoaW.882f6e967869.js.gz +0 -0
- codex/static_root/assets/{pdf-doc-ctqZIwOP.js → pdf-doc-BcRNpoaW.js} +3 -3
- codex/static_root/assets/pdf-doc-BcRNpoaW.js.br +0 -0
- codex/static_root/assets/pdf-doc-BcRNpoaW.js.gz +0 -0
- codex/static_root/assets/reader-DIPRg2VB.900370e097aa.js +2 -0
- codex/static_root/assets/reader-DIPRg2VB.900370e097aa.js.br +0 -0
- codex/static_root/assets/reader-DIPRg2VB.900370e097aa.js.gz +0 -0
- codex/static_root/assets/reader-DIPRg2VB.js +2 -0
- codex/static_root/assets/reader-DIPRg2VB.js.br +0 -0
- codex/static_root/assets/reader-DIPRg2VB.js.gz +0 -0
- codex/static_root/assets/{reader-nD70BeEz.06e85e73c391.css → reader-DveZZr9x.7b21b9f8f628.css} +1 -1
- codex/static_root/assets/reader-DveZZr9x.7b21b9f8f628.css.br +0 -0
- codex/static_root/assets/reader-DveZZr9x.7b21b9f8f628.css.gz +0 -0
- codex/static_root/assets/{reader-nD70BeEz.css → reader-DveZZr9x.css} +1 -1
- codex/static_root/assets/reader-DveZZr9x.css.br +0 -0
- codex/static_root/assets/reader-DveZZr9x.css.gz +0 -0
- codex/static_root/assets/relation-chips-3tTlR5QH.71f18bc92adc.js +1 -0
- codex/static_root/assets/relation-chips-3tTlR5QH.71f18bc92adc.js.br +0 -0
- codex/static_root/assets/relation-chips-3tTlR5QH.71f18bc92adc.js.gz +0 -0
- codex/static_root/assets/relation-chips-3tTlR5QH.js +1 -0
- codex/static_root/assets/relation-chips-3tTlR5QH.js.br +0 -0
- codex/static_root/assets/relation-chips-3tTlR5QH.js.gz +0 -0
- codex/static_root/assets/settings-drawer-BdyFhA_r.151f4c3061ed.js +2 -0
- codex/static_root/assets/settings-drawer-BdyFhA_r.151f4c3061ed.js.br +0 -0
- codex/static_root/assets/settings-drawer-BdyFhA_r.151f4c3061ed.js.gz +0 -0
- codex/static_root/assets/settings-drawer-BdyFhA_r.js +2 -0
- codex/static_root/assets/settings-drawer-BdyFhA_r.js.br +0 -0
- codex/static_root/assets/settings-drawer-BdyFhA_r.js.gz +0 -0
- codex/static_root/assets/stats-tab-DeKjwvmh.7557c71b4cfa.js +1 -0
- codex/static_root/assets/stats-tab-DeKjwvmh.7557c71b4cfa.js.br +0 -0
- codex/static_root/assets/stats-tab-DeKjwvmh.7557c71b4cfa.js.gz +0 -0
- codex/static_root/assets/stats-tab-DeKjwvmh.js +1 -0
- codex/static_root/assets/stats-tab-DeKjwvmh.js.br +0 -0
- codex/static_root/assets/stats-tab-DeKjwvmh.js.gz +0 -0
- codex/static_root/assets/{stats-tab-BAYTqQNg.5f715428c394.css → stats-tab-DpfGsVX3.1cb66f2649a9.css} +1 -1
- codex/static_root/assets/stats-tab-DpfGsVX3.1cb66f2649a9.css.br +0 -0
- codex/static_root/assets/stats-tab-DpfGsVX3.1cb66f2649a9.css.gz +0 -0
- codex/static_root/assets/{stats-tab-BAYTqQNg.css → stats-tab-DpfGsVX3.css} +1 -1
- codex/static_root/assets/stats-tab-DpfGsVX3.css.br +0 -0
- codex/static_root/assets/stats-tab-DpfGsVX3.css.gz +0 -0
- codex/static_root/assets/task-tab-1XiWn9xP.06cb8e1b794d.css +1 -0
- codex/static_root/assets/{task-tab--cXi48kg.5dfd6890a1c2.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--cXi48kg.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-C8D0qRP_.d4ab174c69a3.js +1 -0
- codex/static_root/assets/task-tab-C8D0qRP_.d4ab174c69a3.js.br +0 -0
- codex/static_root/assets/task-tab-C8D0qRP_.d4ab174c69a3.js.gz +0 -0
- codex/static_root/assets/task-tab-C8D0qRP_.js +1 -0
- codex/static_root/assets/task-tab-C8D0qRP_.js.br +0 -0
- codex/static_root/assets/task-tab-C8D0qRP_.js.gz +0 -0
- codex/static_root/assets/unauthorized-BHgBRF4z.8e5c1b9e52b0.js +1 -0
- codex/static_root/assets/unauthorized-BHgBRF4z.8e5c1b9e52b0.js.br +0 -0
- codex/static_root/assets/unauthorized-BHgBRF4z.8e5c1b9e52b0.js.gz +0 -0
- codex/static_root/assets/unauthorized-BHgBRF4z.js +1 -0
- codex/static_root/assets/unauthorized-BHgBRF4z.js.br +0 -0
- codex/static_root/assets/unauthorized-BHgBRF4z.js.gz +0 -0
- codex/static_root/assets/user-tab-BU31Z92y.35613c713faf.js +1 -0
- codex/static_root/assets/user-tab-BU31Z92y.35613c713faf.js.br +0 -0
- codex/static_root/assets/user-tab-BU31Z92y.35613c713faf.js.gz +0 -0
- codex/static_root/assets/user-tab-BU31Z92y.js +1 -0
- codex/static_root/assets/user-tab-BU31Z92y.js.br +0 -0
- codex/static_root/assets/user-tab-BU31Z92y.js.gz +0 -0
- codex/static_root/js/choices-admin.8aa64c911203.json +1 -0
- codex/static_root/js/choices-admin.8aa64c911203.json.br +0 -0
- codex/static_root/js/choices-admin.8aa64c911203.json.gz +0 -0
- codex/static_root/js/choices-admin.json +1 -0
- 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.2f6b0359e1ef.json +1 -0
- codex/static_root/js/choices.2f6b0359e1ef.json.br +0 -0
- codex/static_root/js/choices.2f6b0359e1ef.json.gz +0 -0
- codex/static_root/js/choices.json +1 -0
- codex/static_root/js/choices.json.br +0 -0
- codex/static_root/js/choices.json.gz +0 -0
- codex/static_root/manifest.45cb46e19686.json +635 -0
- codex/static_root/manifest.45cb46e19686.json.br +0 -0
- codex/static_root/manifest.45cb46e19686.json.gz +0 -0
- codex/static_root/manifest.json +300 -377
- codex/static_root/manifest.json.br +0 -0
- codex/static_root/manifest.json.gz +0 -0
- codex/static_root/staticfiles.json +1 -1
- codex/status_controller.py +6 -5
- codex/threads.py +1 -1
- codex/urls/api/auth.py +1 -1
- codex/urls/api/browser.py +1 -1
- codex/views/admin/library.py +13 -18
- codex/views/admin/stats.py +16 -23
- codex/views/admin/tasks.py +2 -1
- codex/views/auth.py +77 -42
- codex/views/bookmark.py +153 -16
- codex/views/browser/annotations.py +339 -0
- codex/views/browser/base.py +139 -0
- codex/views/browser/breadcrumbs.py +11 -90
- codex/views/browser/browser.py +110 -44
- codex/views/browser/choices.py +18 -15
- codex/views/browser/cover.py +20 -10
- codex/views/browser/filters/annotations.py +125 -0
- codex/views/browser/filters/bookmark.py +19 -18
- codex/views/browser/filters/field.py +3 -8
- codex/views/browser/filters/group.py +6 -9
- codex/views/browser/filters/search/fts.py +19 -5
- codex/views/browser/filters/search/parse.py +24 -54
- codex/views/browser/metadata.py +332 -0
- codex/views/browser/mtime.py +10 -2
- codex/views/browser/order_by.py +22 -22
- codex/views/browser/page_in_bounds.py +2 -2
- codex/views/browser/paginate.py +15 -9
- codex/views/browser/title.py +6 -1
- codex/views/browser/validate.py +33 -68
- codex/views/download.py +1 -1
- codex/views/mixins.py +15 -27
- codex/views/opds/const.py +3 -2
- codex/views/opds/urls.py +2 -2
- codex/views/opds/util.py +3 -2
- codex/views/opds/v1/entry/links.py +1 -3
- codex/views/opds/v1/facets.py +12 -65
- codex/views/opds/v1/feed.py +64 -5
- codex/views/opds/v1/links.py +4 -5
- codex/views/opds/v2/feed.py +28 -1
- codex/views/opds/v2/links.py +1 -26
- codex/views/opds/v2/publications.py +6 -5
- codex/views/opds/v2/top_links.py +6 -3
- codex/views/public.py +2 -2
- codex/views/reader/arcs.py +3 -0
- codex/views/reader/books.py +41 -57
- codex/views/reader/{params.py → init.py} +31 -37
- codex/views/reader/page.py +4 -10
- codex/views/reader/reader.py +2 -1
- codex/views/session.py +54 -43
- codex/views/version.py +1 -1
- {codex-1.7.0.dist-info → codex-1.7.0a0.dist-info}/METADATA +5 -2
- {codex-1.7.0.dist-info → codex-1.7.0a0.dist-info}/RECORD +385 -419
- codex/choices.py +0 -419
- codex/choices_to_json.py +0 -122
- codex/librarian/bookmark/__init__.py +0 -1
- codex/librarian/bookmark/bookmarkd.py +0 -38
- codex/librarian/bookmark/tasks.py +0 -19
- codex/librarian/bookmark/update.py +0 -154
- codex/static_root/assets/VCheckbox-D_CWEmqR.84f2b49311e8.js +0 -1
- codex/static_root/assets/VCheckbox-D_CWEmqR.84f2b49311e8.js.br +0 -0
- codex/static_root/assets/VCheckbox-D_CWEmqR.84f2b49311e8.js.gz +0 -0
- codex/static_root/assets/VCheckbox-D_CWEmqR.js +0 -1
- codex/static_root/assets/VCheckbox-D_CWEmqR.js.br +0 -0
- codex/static_root/assets/VCheckbox-D_CWEmqR.js.gz +0 -0
- codex/static_root/assets/VCheckboxBtn-B1BhcFvi.0eaf3c516474.js +0 -1
- codex/static_root/assets/VCheckboxBtn-B1BhcFvi.0eaf3c516474.js.br +0 -0
- codex/static_root/assets/VCheckboxBtn-B1BhcFvi.0eaf3c516474.js.gz +0 -0
- codex/static_root/assets/VCheckboxBtn-B1BhcFvi.js +0 -1
- codex/static_root/assets/VCheckboxBtn-B1BhcFvi.js.br +0 -0
- codex/static_root/assets/VCheckboxBtn-B1BhcFvi.js.gz +0 -0
- codex/static_root/assets/VCombobox-CZAW6_3Q.0e2401e819a5.js +0 -1
- codex/static_root/assets/VCombobox-CZAW6_3Q.0e2401e819a5.js.br +0 -0
- codex/static_root/assets/VCombobox-CZAW6_3Q.0e2401e819a5.js.gz +0 -0
- codex/static_root/assets/VCombobox-CZAW6_3Q.js +0 -1
- codex/static_root/assets/VCombobox-CZAW6_3Q.js.br +0 -0
- codex/static_root/assets/VCombobox-CZAW6_3Q.js.gz +0 -0
- codex/static_root/assets/VDialog-CSHgHIlG.a0bcd336cb7b.js +0 -1
- codex/static_root/assets/VDialog-CSHgHIlG.a0bcd336cb7b.js.br +0 -0
- codex/static_root/assets/VDialog-CSHgHIlG.a0bcd336cb7b.js.gz +0 -0
- codex/static_root/assets/VDialog-CSHgHIlG.js +0 -1
- codex/static_root/assets/VDialog-CSHgHIlG.js.br +0 -0
- codex/static_root/assets/VDialog-CSHgHIlG.js.gz +0 -0
- codex/static_root/assets/VDialog-CSvrKKb2.css +0 -1
- codex/static_root/assets/VDialog-CSvrKKb2.css.br +0 -0
- codex/static_root/assets/VDialog-CSvrKKb2.css.gz +0 -0
- codex/static_root/assets/VDialog-CSvrKKb2.fd4d50904b17.css +0 -1
- codex/static_root/assets/VDialog-CSvrKKb2.fd4d50904b17.css.br +0 -0
- codex/static_root/assets/VDialog-CSvrKKb2.fd4d50904b17.css.gz +0 -0
- codex/static_root/assets/VExpansionPanels-CG6MpdMC.e96ae8afad97.js +0 -1
- codex/static_root/assets/VExpansionPanels-CG6MpdMC.e96ae8afad97.js.br +0 -0
- codex/static_root/assets/VExpansionPanels-CG6MpdMC.e96ae8afad97.js.gz +0 -0
- codex/static_root/assets/VExpansionPanels-CG6MpdMC.js +0 -1
- codex/static_root/assets/VExpansionPanels-CG6MpdMC.js.br +0 -0
- codex/static_root/assets/VExpansionPanels-CG6MpdMC.js.gz +0 -0
- codex/static_root/assets/VRadioGroup-CAgQxkiU.f26ecb0c3e34.js +0 -1
- codex/static_root/assets/VRadioGroup-CAgQxkiU.f26ecb0c3e34.js.br +0 -0
- codex/static_root/assets/VRadioGroup-CAgQxkiU.f26ecb0c3e34.js.gz +0 -0
- codex/static_root/assets/VRadioGroup-CAgQxkiU.js +0 -1
- codex/static_root/assets/VRadioGroup-CAgQxkiU.js.br +0 -0
- codex/static_root/assets/VRadioGroup-CAgQxkiU.js.gz +0 -0
- codex/static_root/assets/VSelect-C1gez8rl.9b11d2f00faf.js +0 -1
- codex/static_root/assets/VSelect-C1gez8rl.9b11d2f00faf.js.br +0 -0
- codex/static_root/assets/VSelect-C1gez8rl.9b11d2f00faf.js.gz +0 -0
- codex/static_root/assets/VSelect-C1gez8rl.js +0 -1
- codex/static_root/assets/VSelect-C1gez8rl.js.br +0 -0
- codex/static_root/assets/VSelect-C1gez8rl.js.gz +0 -0
- codex/static_root/assets/VSelect-DLu8bpcs.98bdcf35411c.css +0 -1
- codex/static_root/assets/VSelect-DLu8bpcs.98bdcf35411c.css.br +0 -0
- codex/static_root/assets/VSelect-DLu8bpcs.98bdcf35411c.css.gz +0 -0
- codex/static_root/assets/VSelect-DLu8bpcs.css +0 -1
- codex/static_root/assets/VSelect-DLu8bpcs.css.br +0 -0
- codex/static_root/assets/VSelect-DLu8bpcs.css.gz +0 -0
- codex/static_root/assets/VSelectionControl-DBqDlKjK.160beaa1b56c.js +0 -1
- codex/static_root/assets/VSelectionControl-DBqDlKjK.160beaa1b56c.js.br +0 -0
- codex/static_root/assets/VSelectionControl-DBqDlKjK.160beaa1b56c.js.gz +0 -0
- codex/static_root/assets/VSelectionControl-DBqDlKjK.js +0 -1
- codex/static_root/assets/VSelectionControl-DBqDlKjK.js.br +0 -0
- codex/static_root/assets/VSelectionControl-DBqDlKjK.js.gz +0 -0
- codex/static_root/assets/VSlideGroup-BtXPhMOT.830f136ffd41.css +0 -1
- codex/static_root/assets/VSlideGroup-BtXPhMOT.830f136ffd41.css.br +0 -0
- codex/static_root/assets/VSlideGroup-BtXPhMOT.830f136ffd41.css.gz +0 -0
- codex/static_root/assets/VSlideGroup-BtXPhMOT.css +0 -1
- codex/static_root/assets/VSlideGroup-BtXPhMOT.css.br +0 -0
- codex/static_root/assets/VSlideGroup-BtXPhMOT.css.gz +0 -0
- codex/static_root/assets/VSlideGroup-SqR_NAL1.40ba1d838a6e.js +0 -1
- codex/static_root/assets/VSlideGroup-SqR_NAL1.40ba1d838a6e.js.br +0 -0
- codex/static_root/assets/VSlideGroup-SqR_NAL1.40ba1d838a6e.js.gz +0 -0
- codex/static_root/assets/VSlideGroup-SqR_NAL1.js +0 -1
- codex/static_root/assets/VSlideGroup-SqR_NAL1.js.br +0 -0
- codex/static_root/assets/VSlideGroup-SqR_NAL1.js.gz +0 -0
- codex/static_root/assets/VTable-CYC-wMpk.8f15d66044da.js +0 -1
- codex/static_root/assets/VTable-CYC-wMpk.8f15d66044da.js.br +0 -0
- codex/static_root/assets/VTable-CYC-wMpk.8f15d66044da.js.gz +0 -0
- codex/static_root/assets/VTable-CYC-wMpk.js +0 -1
- codex/static_root/assets/VTable-CYC-wMpk.js.br +0 -0
- codex/static_root/assets/VTable-CYC-wMpk.js.gz +0 -0
- codex/static_root/assets/VTextField-BnCEPZIq.b0c32b2c0b14.css +0 -1
- codex/static_root/assets/VTextField-BnCEPZIq.b0c32b2c0b14.css.br +0 -0
- codex/static_root/assets/VTextField-BnCEPZIq.b0c32b2c0b14.css.gz +0 -0
- codex/static_root/assets/VTextField-BnCEPZIq.css +0 -1
- codex/static_root/assets/VTextField-BnCEPZIq.css.br +0 -0
- codex/static_root/assets/VTextField-BnCEPZIq.css.gz +0 -0
- codex/static_root/assets/VTextField-DMRKRbbT.911ac84d8c9d.js +0 -1
- codex/static_root/assets/VTextField-DMRKRbbT.911ac84d8c9d.js.br +0 -0
- codex/static_root/assets/VTextField-DMRKRbbT.911ac84d8c9d.js.gz +0 -0
- codex/static_root/assets/VTextField-DMRKRbbT.js +0 -1
- codex/static_root/assets/VTextField-DMRKRbbT.js.br +0 -0
- codex/static_root/assets/VTextField-DMRKRbbT.js.gz +0 -0
- codex/static_root/assets/VWindowItem-D0P2xNJl.6a10e3f3a153.js +0 -1
- codex/static_root/assets/VWindowItem-D0P2xNJl.6a10e3f3a153.js.br +0 -0
- codex/static_root/assets/VWindowItem-D0P2xNJl.6a10e3f3a153.js.gz +0 -0
- codex/static_root/assets/VWindowItem-D0P2xNJl.js +0 -1
- codex/static_root/assets/VWindowItem-D0P2xNJl.js.br +0 -0
- codex/static_root/assets/VWindowItem-D0P2xNJl.js.gz +0 -0
- codex/static_root/assets/admin-CD90VMen.4c2b6f2a5111.js +0 -1
- codex/static_root/assets/admin-CD90VMen.4c2b6f2a5111.js.br +0 -0
- codex/static_root/assets/admin-CD90VMen.4c2b6f2a5111.js.gz +0 -0
- codex/static_root/assets/admin-CD90VMen.js +0 -1
- codex/static_root/assets/admin-CD90VMen.js.br +0 -0
- codex/static_root/assets/admin-CD90VMen.js.gz +0 -0
- codex/static_root/assets/admin-DJ7pIXDQ.css.br +0 -0
- codex/static_root/assets/admin-DJ7pIXDQ.css.gz +0 -0
- codex/static_root/assets/admin-DJ7pIXDQ.e2a77af73ef2.css.br +0 -0
- codex/static_root/assets/admin-DJ7pIXDQ.e2a77af73ef2.css.gz +0 -0
- codex/static_root/assets/admin-menu-B9bzD6hV.c13b7df2ff57.css +0 -1
- codex/static_root/assets/admin-menu-B9bzD6hV.c13b7df2ff57.css.br +0 -0
- codex/static_root/assets/admin-menu-B9bzD6hV.c13b7df2ff57.css.gz +0 -0
- codex/static_root/assets/admin-menu-B9bzD6hV.css +0 -1
- codex/static_root/assets/admin-menu-B9bzD6hV.css.br +0 -0
- codex/static_root/assets/admin-menu-B9bzD6hV.css.gz +0 -0
- codex/static_root/assets/admin-menu-BpEPGKr_.c9f9178c5a82.js +0 -1
- codex/static_root/assets/admin-menu-BpEPGKr_.c9f9178c5a82.js.br +0 -0
- codex/static_root/assets/admin-menu-BpEPGKr_.c9f9178c5a82.js.gz +0 -0
- codex/static_root/assets/admin-menu-BpEPGKr_.js +0 -1
- codex/static_root/assets/admin-menu-BpEPGKr_.js.br +0 -0
- codex/static_root/assets/admin-menu-BpEPGKr_.js.gz +0 -0
- codex/static_root/assets/admin-settings-button-progress-DDF4rY07.4f1158b650ab.js +0 -1
- codex/static_root/assets/admin-settings-button-progress-DDF4rY07.4f1158b650ab.js.br +0 -0
- codex/static_root/assets/admin-settings-button-progress-DDF4rY07.4f1158b650ab.js.gz +0 -0
- codex/static_root/assets/admin-settings-button-progress-DDF4rY07.js +0 -1
- codex/static_root/assets/admin-settings-button-progress-DDF4rY07.js.br +0 -0
- codex/static_root/assets/admin-settings-button-progress-DDF4rY07.js.gz +0 -0
- codex/static_root/assets/admin-settings-button-progress-DUUQfVsZ.2548c49a853e.css +0 -1
- codex/static_root/assets/admin-settings-button-progress-DUUQfVsZ.css +0 -1
- codex/static_root/assets/browser-C0KS3g2E.0bf1c9c6319c.js +0 -1
- codex/static_root/assets/browser-C0KS3g2E.0bf1c9c6319c.js.br +0 -0
- codex/static_root/assets/browser-C0KS3g2E.0bf1c9c6319c.js.gz +0 -0
- codex/static_root/assets/browser-C0KS3g2E.js +0 -1
- codex/static_root/assets/browser-C0KS3g2E.js.br +0 -0
- codex/static_root/assets/browser-C0KS3g2E.js.gz +0 -0
- codex/static_root/assets/browser-JFL2hLjt.21cb2f7335f7.css +0 -1
- codex/static_root/assets/browser-JFL2hLjt.21cb2f7335f7.css.br +0 -0
- codex/static_root/assets/browser-JFL2hLjt.21cb2f7335f7.css.gz +0 -0
- codex/static_root/assets/browser-JFL2hLjt.css +0 -1
- codex/static_root/assets/browser-JFL2hLjt.css.br +0 -0
- codex/static_root/assets/browser-JFL2hLjt.css.gz +0 -0
- codex/static_root/assets/change-password-dialog-DXJalgW4.a9f34729599d.js +0 -1
- codex/static_root/assets/change-password-dialog-DXJalgW4.a9f34729599d.js.br +0 -0
- codex/static_root/assets/change-password-dialog-DXJalgW4.a9f34729599d.js.gz +0 -0
- codex/static_root/assets/change-password-dialog-DXJalgW4.js +0 -1
- codex/static_root/assets/change-password-dialog-DXJalgW4.js.br +0 -0
- codex/static_root/assets/change-password-dialog-DXJalgW4.js.gz +0 -0
- codex/static_root/assets/change-password-dialog-DrIXdKUC.217574b45b02.css +0 -1
- codex/static_root/assets/change-password-dialog-DrIXdKUC.217574b45b02.css.br +0 -0
- codex/static_root/assets/change-password-dialog-DrIXdKUC.217574b45b02.css.gz +0 -0
- codex/static_root/assets/change-password-dialog-DrIXdKUC.css +0 -1
- codex/static_root/assets/change-password-dialog-DrIXdKUC.css.br +0 -0
- codex/static_root/assets/change-password-dialog-DrIXdKUC.css.gz +0 -0
- codex/static_root/assets/confirm-dialog-B7w6z2rf.472011c06253.css +0 -1
- codex/static_root/assets/confirm-dialog-B7w6z2rf.css +0 -1
- codex/static_root/assets/confirm-dialog-CqDEpU9k.e1811488121d.js +0 -1
- codex/static_root/assets/confirm-dialog-CqDEpU9k.e1811488121d.js.br +0 -0
- codex/static_root/assets/confirm-dialog-CqDEpU9k.e1811488121d.js.gz +0 -0
- codex/static_root/assets/confirm-dialog-CqDEpU9k.js +0 -1
- codex/static_root/assets/confirm-dialog-CqDEpU9k.js.br +0 -0
- codex/static_root/assets/confirm-dialog-CqDEpU9k.js.gz +0 -0
- codex/static_root/assets/datetime-column-UxNaJr8b.c06a11531af3.js +0 -1
- codex/static_root/assets/datetime-column-UxNaJr8b.c06a11531af3.js.br +0 -0
- codex/static_root/assets/datetime-column-UxNaJr8b.c06a11531af3.js.gz +0 -0
- codex/static_root/assets/datetime-column-UxNaJr8b.js +0 -1
- codex/static_root/assets/datetime-column-UxNaJr8b.js.br +0 -0
- codex/static_root/assets/datetime-column-UxNaJr8b.js.gz +0 -0
- codex/static_root/assets/filter-DskcqZHA.e707b5a05b4b.js +0 -1
- codex/static_root/assets/filter-DskcqZHA.e707b5a05b4b.js.br +0 -0
- codex/static_root/assets/filter-DskcqZHA.e707b5a05b4b.js.gz +0 -0
- codex/static_root/assets/filter-DskcqZHA.js +0 -1
- codex/static_root/assets/filter-DskcqZHA.js.br +0 -0
- codex/static_root/assets/filter-DskcqZHA.js.gz +0 -0
- codex/static_root/assets/flag-tab-CqWovuBu.4dfc6b251e85.css +0 -1
- codex/static_root/assets/flag-tab-CqWovuBu.4dfc6b251e85.css.br +0 -0
- codex/static_root/assets/flag-tab-CqWovuBu.4dfc6b251e85.css.gz +0 -0
- codex/static_root/assets/flag-tab-CqWovuBu.css +0 -1
- codex/static_root/assets/flag-tab-CqWovuBu.css.br +0 -0
- codex/static_root/assets/flag-tab-CqWovuBu.css.gz +0 -0
- codex/static_root/assets/flag-tab-xBeWEQ0w.582e77d9e885.js +0 -1
- codex/static_root/assets/flag-tab-xBeWEQ0w.582e77d9e885.js.br +0 -0
- codex/static_root/assets/flag-tab-xBeWEQ0w.582e77d9e885.js.gz +0 -0
- codex/static_root/assets/flag-tab-xBeWEQ0w.js +0 -1
- codex/static_root/assets/flag-tab-xBeWEQ0w.js.br +0 -0
- codex/static_root/assets/flag-tab-xBeWEQ0w.js.gz +0 -0
- codex/static_root/assets/group-tab-Czt2x61x.56e2886b1bac.js +0 -1
- codex/static_root/assets/group-tab-Czt2x61x.56e2886b1bac.js.br +0 -0
- codex/static_root/assets/group-tab-Czt2x61x.56e2886b1bac.js.gz +0 -0
- codex/static_root/assets/group-tab-Czt2x61x.js +0 -1
- codex/static_root/assets/group-tab-Czt2x61x.js.br +0 -0
- codex/static_root/assets/group-tab-Czt2x61x.js.gz +0 -0
- codex/static_root/assets/group-tab-DkIN1Heu.948e907b1e6b.css +0 -1
- codex/static_root/assets/group-tab-DkIN1Heu.948e907b1e6b.css.br +0 -0
- codex/static_root/assets/group-tab-DkIN1Heu.948e907b1e6b.css.gz +0 -0
- codex/static_root/assets/group-tab-DkIN1Heu.css +0 -1
- codex/static_root/assets/group-tab-DkIN1Heu.css.br +0 -0
- codex/static_root/assets/group-tab-DkIN1Heu.css.gz +0 -0
- codex/static_root/assets/http-error-NHcwE5e_.d49089e40589.js +0 -1
- codex/static_root/assets/http-error-NHcwE5e_.d49089e40589.js.br +0 -0
- codex/static_root/assets/http-error-NHcwE5e_.d49089e40589.js.gz +0 -0
- codex/static_root/assets/http-error-NHcwE5e_.js +0 -1
- codex/static_root/assets/http-error-NHcwE5e_.js.br +0 -0
- codex/static_root/assets/http-error-NHcwE5e_.js.gz +0 -0
- codex/static_root/assets/index-CL_6g4tJ.523d7b3d350f.css +0 -1
- codex/static_root/assets/index-CL_6g4tJ.523d7b3d350f.css.br +0 -0
- codex/static_root/assets/index-CL_6g4tJ.523d7b3d350f.css.gz +0 -0
- codex/static_root/assets/index-CL_6g4tJ.css +0 -1
- codex/static_root/assets/index-CL_6g4tJ.css.br +0 -0
- codex/static_root/assets/index-CL_6g4tJ.css.gz +0 -0
- codex/static_root/assets/index-DYNNO5kn.24a2d270253a.js +0 -1
- codex/static_root/assets/index-DYNNO5kn.24a2d270253a.js.br +0 -0
- codex/static_root/assets/index-DYNNO5kn.24a2d270253a.js.gz +0 -0
- codex/static_root/assets/index-DYNNO5kn.js +0 -1
- codex/static_root/assets/index-DYNNO5kn.js.br +0 -0
- codex/static_root/assets/index-DYNNO5kn.js.gz +0 -0
- codex/static_root/assets/library-tab-CgIqcjvj.60327dfa8ecb.js +0 -1
- codex/static_root/assets/library-tab-CgIqcjvj.60327dfa8ecb.js.br +0 -0
- codex/static_root/assets/library-tab-CgIqcjvj.60327dfa8ecb.js.gz +0 -0
- codex/static_root/assets/library-tab-CgIqcjvj.js +0 -1
- codex/static_root/assets/library-tab-CgIqcjvj.js.br +0 -0
- codex/static_root/assets/library-tab-CgIqcjvj.js.gz +0 -0
- codex/static_root/assets/library-tab-Wew8YOLv.0c1780a6b68e.css.br +0 -0
- codex/static_root/assets/library-tab-Wew8YOLv.0c1780a6b68e.css.gz +0 -0
- codex/static_root/assets/library-tab-Wew8YOLv.css.br +0 -0
- codex/static_root/assets/library-tab-Wew8YOLv.css.gz +0 -0
- codex/static_root/assets/main-B3EwXQ3Q.14dfc21e272c.js +0 -35
- codex/static_root/assets/main-B3EwXQ3Q.14dfc21e272c.js.br +0 -0
- codex/static_root/assets/main-B3EwXQ3Q.14dfc21e272c.js.gz +0 -0
- codex/static_root/assets/main-B3EwXQ3Q.js +0 -35
- codex/static_root/assets/main-B3EwXQ3Q.js.br +0 -0
- codex/static_root/assets/main-B3EwXQ3Q.js.gz +0 -0
- codex/static_root/assets/pager-full-pdf-YkzUXx0B.f39d84e2380a.js +0 -1
- codex/static_root/assets/pager-full-pdf-YkzUXx0B.f39d84e2380a.js.br +0 -0
- codex/static_root/assets/pager-full-pdf-YkzUXx0B.f39d84e2380a.js.gz +0 -0
- codex/static_root/assets/pager-full-pdf-YkzUXx0B.js +0 -1
- codex/static_root/assets/pager-full-pdf-YkzUXx0B.js.br +0 -0
- codex/static_root/assets/pager-full-pdf-YkzUXx0B.js.gz +0 -0
- codex/static_root/assets/pagination-toolbar-CrruiVov.3bf9b795350d.js +0 -1
- codex/static_root/assets/pagination-toolbar-CrruiVov.3bf9b795350d.js.br +0 -0
- codex/static_root/assets/pagination-toolbar-CrruiVov.3bf9b795350d.js.gz +0 -0
- codex/static_root/assets/pagination-toolbar-CrruiVov.js +0 -1
- codex/static_root/assets/pagination-toolbar-CrruiVov.js.br +0 -0
- codex/static_root/assets/pagination-toolbar-CrruiVov.js.gz +0 -0
- codex/static_root/assets/pdf-doc-ctqZIwOP.7e7b2c815ea4.js.br +0 -0
- codex/static_root/assets/pdf-doc-ctqZIwOP.7e7b2c815ea4.js.gz +0 -0
- codex/static_root/assets/pdf-doc-ctqZIwOP.js.br +0 -0
- codex/static_root/assets/pdf-doc-ctqZIwOP.js.gz +0 -0
- codex/static_root/assets/reader-DPLhdrJD.268417c618c5.js +0 -2
- codex/static_root/assets/reader-DPLhdrJD.268417c618c5.js.br +0 -0
- codex/static_root/assets/reader-DPLhdrJD.268417c618c5.js.gz +0 -0
- codex/static_root/assets/reader-DPLhdrJD.js +0 -2
- codex/static_root/assets/reader-DPLhdrJD.js.br +0 -0
- codex/static_root/assets/reader-DPLhdrJD.js.gz +0 -0
- codex/static_root/assets/reader-nD70BeEz.06e85e73c391.css.br +0 -0
- codex/static_root/assets/reader-nD70BeEz.06e85e73c391.css.gz +0 -0
- codex/static_root/assets/reader-nD70BeEz.css.br +0 -0
- codex/static_root/assets/reader-nD70BeEz.css.gz +0 -0
- codex/static_root/assets/relation-chips-DOALMcWL.5d3b8100ba03.js +0 -1
- codex/static_root/assets/relation-chips-DOALMcWL.5d3b8100ba03.js.br +0 -0
- codex/static_root/assets/relation-chips-DOALMcWL.5d3b8100ba03.js.gz +0 -0
- codex/static_root/assets/relation-chips-DOALMcWL.js +0 -1
- codex/static_root/assets/relation-chips-DOALMcWL.js.br +0 -0
- codex/static_root/assets/relation-chips-DOALMcWL.js.gz +0 -0
- codex/static_root/assets/settings-drawer-BVj1U_LC.c68369e0c2de.js +0 -2
- codex/static_root/assets/settings-drawer-BVj1U_LC.c68369e0c2de.js.br +0 -0
- codex/static_root/assets/settings-drawer-BVj1U_LC.c68369e0c2de.js.gz +0 -0
- codex/static_root/assets/settings-drawer-BVj1U_LC.js +0 -2
- codex/static_root/assets/settings-drawer-BVj1U_LC.js.br +0 -0
- codex/static_root/assets/settings-drawer-BVj1U_LC.js.gz +0 -0
- codex/static_root/assets/stats-tab-BAYTqQNg.5f715428c394.css.br +0 -0
- codex/static_root/assets/stats-tab-BAYTqQNg.5f715428c394.css.gz +0 -0
- codex/static_root/assets/stats-tab-BAYTqQNg.css.br +0 -0
- codex/static_root/assets/stats-tab-BAYTqQNg.css.gz +0 -0
- codex/static_root/assets/stats-tab-DDLwwwnP.35305258097b.js +0 -1
- codex/static_root/assets/stats-tab-DDLwwwnP.35305258097b.js.br +0 -0
- codex/static_root/assets/stats-tab-DDLwwwnP.35305258097b.js.gz +0 -0
- codex/static_root/assets/stats-tab-DDLwwwnP.js +0 -1
- codex/static_root/assets/stats-tab-DDLwwwnP.js.br +0 -0
- codex/static_root/assets/stats-tab-DDLwwwnP.js.gz +0 -0
- codex/static_root/assets/task-tab--cXi48kg.5dfd6890a1c2.css +0 -1
- codex/static_root/assets/task-tab--cXi48kg.5dfd6890a1c2.css.gz +0 -0
- codex/static_root/assets/task-tab--cXi48kg.css +0 -1
- codex/static_root/assets/task-tab--cXi48kg.css.gz +0 -0
- codex/static_root/assets/task-tab-BpP3n2dO.c853eb565200.js +0 -1
- codex/static_root/assets/task-tab-BpP3n2dO.c853eb565200.js.br +0 -0
- codex/static_root/assets/task-tab-BpP3n2dO.c853eb565200.js.gz +0 -0
- codex/static_root/assets/task-tab-BpP3n2dO.js +0 -1
- codex/static_root/assets/task-tab-BpP3n2dO.js.br +0 -0
- codex/static_root/assets/task-tab-BpP3n2dO.js.gz +0 -0
- codex/static_root/assets/transition-3g2arGgl.c6e6f91b7978.js +0 -1
- codex/static_root/assets/transition-3g2arGgl.c6e6f91b7978.js.br +0 -0
- codex/static_root/assets/transition-3g2arGgl.c6e6f91b7978.js.gz +0 -0
- codex/static_root/assets/transition-3g2arGgl.js +0 -1
- codex/static_root/assets/transition-3g2arGgl.js.br +0 -0
- codex/static_root/assets/transition-3g2arGgl.js.gz +0 -0
- codex/static_root/assets/transition-5LRFTPo5.3d726f9bbcb0.css +0 -1
- codex/static_root/assets/transition-5LRFTPo5.3d726f9bbcb0.css.br +0 -4
- codex/static_root/assets/transition-5LRFTPo5.3d726f9bbcb0.css.gz +0 -0
- codex/static_root/assets/transition-5LRFTPo5.css +0 -1
- codex/static_root/assets/transition-5LRFTPo5.css.br +0 -4
- codex/static_root/assets/transition-5LRFTPo5.css.gz +0 -0
- codex/static_root/assets/unauthorized-CdumQ1Vf.79d9a61eb572.js +0 -1
- codex/static_root/assets/unauthorized-CdumQ1Vf.79d9a61eb572.js.br +0 -0
- codex/static_root/assets/unauthorized-CdumQ1Vf.79d9a61eb572.js.gz +0 -0
- codex/static_root/assets/unauthorized-CdumQ1Vf.js +0 -1
- codex/static_root/assets/unauthorized-CdumQ1Vf.js.br +0 -0
- codex/static_root/assets/unauthorized-CdumQ1Vf.js.gz +0 -0
- codex/static_root/assets/user-tab-D6oOKZTP.05944b00c700.js +0 -1
- codex/static_root/assets/user-tab-D6oOKZTP.05944b00c700.js.br +0 -0
- codex/static_root/assets/user-tab-D6oOKZTP.05944b00c700.js.gz +0 -0
- codex/static_root/assets/user-tab-D6oOKZTP.js +0 -1
- codex/static_root/assets/user-tab-D6oOKZTP.js.br +0 -0
- codex/static_root/assets/user-tab-D6oOKZTP.js.gz +0 -0
- codex/static_root/manifest.c5f1de88b1ac.json +0 -712
- codex/static_root/manifest.c5f1de88b1ac.json.br +0 -0
- codex/static_root/manifest.c5f1de88b1ac.json.gz +0 -0
- codex/views/browser/annotate/__init__.py +0 -1
- codex/views/browser/annotate/bookmark.py +0 -112
- codex/views/browser/annotate/card.py +0 -61
- codex/views/browser/annotate/order.py +0 -247
- codex/views/browser/filters/filter.py +0 -69
- codex/views/browser/group_mtime.py +0 -83
- codex/views/browser/metadata/__init__.py +0 -1
- codex/views/browser/metadata/annotate.py +0 -109
- codex/views/browser/metadata/copy_intersections.py +0 -90
- codex/views/browser/metadata/metadata.py +0 -83
- codex/views/browser/metadata/query_intersections.py +0 -112
- codex/views/browser/params.py +0 -64
- codex/views/timezone.py +0 -54
- {codex-1.7.0.dist-info → codex-1.7.0a0.dist-info}/LICENSE +0 -0
- {codex-1.7.0.dist-info → codex-1.7.0a0.dist-info}/WHEEL +0 -0
- {codex-1.7.0.dist-info → codex-1.7.0a0.dist-info}/entry_points.txt +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{aT as Sn,bh as YM,cH as db,aU as Pi,bk as te,cI as pM,e as BM,t as uM,f as oM,o as fF,A as M0,F as yM,B as kM,ai as Zb,L as ce,E as Fb,ar as LM,_ as zM,y as DM,al as tb,cJ as IM,m as EM,r as wM,c as CM,n as xM}from"./main-B3EwXQ3Q.js";var rM=Object.defineProperty,jM=(d,l,U)=>l in d?rM(d,l,{enumerable:!0,configurable:!0,writable:!0,value:U}):d[l]=U,H=(d,l,U)=>(jM(d,typeof l!="symbol"?l+"":l,U),U),rh=(d,l,U)=>{if(!l.has(d))throw TypeError("Cannot "+U)},W=(d,l,U)=>(rh(d,l,"read from private field"),U?U.call(d):l.get(d)),i=(d,l,U)=>{if(l.has(d))throw TypeError("Cannot add the same private member more than once");l instanceof WeakSet?l.add(d):l.set(d,U)},m=(d,l,U,Z)=>(rh(d,l,"write to private field"),l.set(d,U),U),NU=(d,l,U,Z)=>({set _(F){m(d,l,F)},get _(){return W(d,l,Z)}}),b=(d,l,U)=>(rh(d,l,"access private method"),U),OM={9306:(d,l,U)=>{var Z=U(4901),F=U(6823),t=TypeError;d.exports=function(c){if(Z(c))return c;throw new t(F(c)+" is not a function")}},3506:(d,l,U)=>{var Z=U(3925),F=String,t=TypeError;d.exports=function(c){if(Z(c))return c;throw new t("Can't set "+F(c)+" as a prototype")}},7080:(d,l,U)=>{var Z=U(4402).has;d.exports=function(F){return Z(F),F}},679:(d,l,U)=>{var Z=U(1625),F=TypeError;d.exports=function(t,c){if(Z(c,t))return t;throw new F("Incorrect invocation")}},8551:(d,l,U)=>{var Z=U(34),F=String,t=TypeError;d.exports=function(c){if(Z(c))return c;throw new t(F(c)+" is not an object")}},7811:d=>{d.exports=typeof ArrayBuffer<"u"&&typeof DataView<"u"},7394:(d,l,U)=>{var Z=U(6706),F=U(4576),t=TypeError;d.exports=Z(ArrayBuffer.prototype,"byteLength","get")||function(c){if(F(c)!=="ArrayBuffer")throw new t("ArrayBuffer expected");return c.byteLength}},3238:(d,l,U)=>{var Z=U(9504),F=U(7394),t=Z(ArrayBuffer.prototype.slice);d.exports=function(c){if(F(c)!==0)return!1;try{return t(c,0,0),!1}catch{return!0}}},5636:(d,l,U)=>{var Z=U(4475),F=U(9504),t=U(6706),c=U(7696),V=U(3238),Q=U(7394),a=U(4483),n=U(1548),s=Z.structuredClone,R=Z.ArrayBuffer,N=Z.DataView,h=Z.TypeError,e=Math.min,M=R.prototype,J=N.prototype,G=F(M.slice),T=t(M,"resizable","get"),p=t(M,"maxByteLength","get"),S=F(J.getInt8),X=F(J.setInt8);d.exports=(n||a)&&function(B,k,Y){var o=Q(B),y=k===void 0?o:c(k),D=!T||!T(B),I;if(V(B))throw new h("ArrayBuffer is detached");if(n&&(B=s(B,{transfer:[B]}),o===y&&(Y||D)))return B;if(o>=y&&(!Y||D))I=G(B,0,y);else{var j=Y&&!D&&p?{maxByteLength:p(B)}:void 0;I=new R(y,j);for(var x=new N(B),u=new N(I),E=e(y,o),A=0;A<E;A++)X(u,A,S(x,A))}return n||a(B),I}},4644:(d,l,U)=>{var Z=U(7811),F=U(3724),t=U(4475),c=U(4901),V=U(34),Q=U(9297),a=U(6955),n=U(6823),s=U(6699),R=U(6840),N=U(2106),h=U(1625),e=U(2787),M=U(2967),J=U(8227),G=U(3392),T=U(1181),p=T.enforce,S=T.get,X=t.Int8Array,B=X&&X.prototype,k=t.Uint8ClampedArray,Y=k&&k.prototype,o=X&&e(X),y=B&&e(B),D=Object.prototype,I=t.TypeError,j=J("toStringTag"),x=G("TYPED_ARRAY_TAG"),u="TypedArrayConstructor",E=Z&&!!M&&a(t.opera)!=="Opera",A=!1,Wl,ml,dU,Fl={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},Vl={BigInt64Array:8,BigUint64Array:8},Cd=function(g){if(!V(g))return!1;var al=a(g);return al==="DataView"||Q(Fl,al)||Q(Vl,al)},hU=function(g){var al=e(g);if(V(al)){var Tl=S(al);return Tl&&Q(Tl,u)?Tl[u]:hU(al)}},w=function(g){if(!V(g))return!1;var al=a(g);return Q(Fl,al)||Q(Vl,al)},L=function(g){if(w(g))return g;throw new I("Target is not a typed array")},C=function(g){if(c(g)&&(!M||h(o,g)))return g;throw new I(n(g)+" is not a typed array constructor")},P=function(g,al,Tl,xU){if(F){if(Tl)for(var Al in Fl){var Il=t[Al];if(Il&&Q(Il.prototype,g))try{delete Il.prototype[g]}catch{try{Il.prototype[g]=al}catch{}}}(!y[g]||Tl)&&R(y,g,Tl?al:E&&B[g]||al,xU)}},Ql=function(g,al,Tl){var xU,Al;if(F){if(M){if(Tl){for(xU in Fl)if(Al=t[xU],Al&&Q(Al,g))try{delete Al[g]}catch{}}if(!o[g]||Tl)try{return R(o,g,Tl?al:E&&o[g]||al)}catch{}else return}for(xU in Fl)Al=t[xU],Al&&(!Al[g]||Tl)&&R(Al,g,al)}};for(Wl in Fl)ml=t[Wl],dU=ml&&ml.prototype,dU?p(dU)[u]=ml:E=!1;for(Wl in Vl)ml=t[Wl],dU=ml&&ml.prototype,dU&&(p(dU)[u]=ml);if((!E||!c(o)||o===Function.prototype)&&(o=function(){throw new I("Incorrect invocation")},E))for(Wl in Fl)t[Wl]&&M(t[Wl],o);if((!E||!y||y===D)&&(y=o.prototype,E))for(Wl in Fl)t[Wl]&&M(t[Wl].prototype,y);if(E&&e(Y)!==y&&M(Y,y),F&&!Q(y,j)){A=!0,N(y,j,{configurable:!0,get:function(){return V(this)?this[x]:void 0}});for(Wl in Fl)t[Wl]&&s(t[Wl],x,Wl)}d.exports={NATIVE_ARRAY_BUFFER_VIEWS:E,TYPED_ARRAY_TAG:A&&x,aTypedArray:L,aTypedArrayConstructor:C,exportTypedArrayMethod:P,exportTypedArrayStaticMethod:Ql,getTypedArrayConstructor:hU,isView:Cd,isTypedArray:w,TypedArray:o,TypedArrayPrototype:y}},5370:(d,l,U)=>{var Z=U(6198);d.exports=function(F,t,c){for(var V=0,Q=arguments.length>2?c:Z(t),a=new F(Q);Q>V;)a[V]=t[V++];return a}},9617:(d,l,U)=>{var Z=U(5397),F=U(5610),t=U(6198),c=function(V){return function(Q,a,n){var s=Z(Q),R=t(s);if(R===0)return!V&&-1;var N=F(n,R),h;if(V&&a!==a){for(;R>N;)if(h=s[N++],h!==h)return!0}else for(;R>N;N++)if((V||N in s)&&s[N]===a)return V||N||0;return!V&&-1}};d.exports={includes:c(!0),indexOf:c(!1)}},4527:(d,l,U)=>{var Z=U(3724),F=U(4376),t=TypeError,c=Object.getOwnPropertyDescriptor,V=Z&&!function(){if(this!==void 0)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(Q){return Q instanceof TypeError}}();d.exports=V?function(Q,a){if(F(Q)&&!c(Q,"length").writable)throw new t("Cannot set read only .length");return Q.length=a}:function(Q,a){return Q.length=a}},7628:(d,l,U)=>{var Z=U(6198);d.exports=function(F,t){for(var c=Z(F),V=new t(c),Q=0;Q<c;Q++)V[Q]=F[c-Q-1];return V}},9928:(d,l,U)=>{var Z=U(6198),F=U(1291),t=RangeError;d.exports=function(c,V,Q,a){var n=Z(c),s=F(Q),R=s<0?n+s:s;if(R>=n||R<0)throw new t("Incorrect index");for(var N=new V(n),h=0;h<n;h++)N[h]=h===R?a:c[h];return N}},6319:(d,l,U)=>{var Z=U(8551),F=U(9539);d.exports=function(t,c,V,Q){try{return Q?c(Z(V)[0],V[1]):c(V)}catch(a){F(t,"throw",a)}}},4576:(d,l,U)=>{var Z=U(9504),F=Z({}.toString),t=Z("".slice);d.exports=function(c){return t(F(c),8,-1)}},6955:(d,l,U)=>{var Z=U(2140),F=U(4901),t=U(4576),c=U(8227),V=c("toStringTag"),Q=Object,a=t(function(){return arguments}())==="Arguments",n=function(s,R){try{return s[R]}catch{}};d.exports=Z?t:function(s){var R,N,h;return s===void 0?"Undefined":s===null?"Null":typeof(N=n(R=Q(s),V))=="string"?N:a?t(R):(h=t(R))==="Object"&&F(R.callee)?"Arguments":h}},7740:(d,l,U)=>{var Z=U(9297),F=U(5031),t=U(7347),c=U(4913);d.exports=function(V,Q,a){for(var n=F(Q),s=c.f,R=t.f,N=0;N<n.length;N++){var h=n[N];!Z(V,h)&&!(a&&Z(a,h))&&s(V,h,R(Q,h))}}},2211:(d,l,U)=>{var Z=U(9039);d.exports=!Z(function(){function F(){}return F.prototype.constructor=null,Object.getPrototypeOf(new F)!==F.prototype})},2529:d=>{d.exports=function(l,U){return{value:l,done:U}}},6699:(d,l,U)=>{var Z=U(3724),F=U(4913),t=U(6980);d.exports=Z?function(c,V,Q){return F.f(c,V,t(1,Q))}:function(c,V,Q){return c[V]=Q,c}},6980:d=>{d.exports=function(l,U){return{enumerable:!(l&1),configurable:!(l&2),writable:!(l&4),value:U}}},4659:(d,l,U)=>{var Z=U(3724),F=U(4913),t=U(6980);d.exports=function(c,V,Q){Z?F.f(c,V,t(0,Q)):c[V]=Q}},2106:(d,l,U)=>{var Z=U(283),F=U(4913);d.exports=function(t,c,V){return V.get&&Z(V.get,c,{getter:!0}),V.set&&Z(V.set,c,{setter:!0}),F.f(t,c,V)}},6840:(d,l,U)=>{var Z=U(4901),F=U(4913),t=U(283),c=U(9433);d.exports=function(V,Q,a,n){n||(n={});var s=n.enumerable,R=n.name!==void 0?n.name:Q;if(Z(a)&&t(a,R,n),n.global)s?V[Q]=a:c(Q,a);else{try{n.unsafe?V[Q]&&(s=!0):delete V[Q]}catch{}s?V[Q]=a:F.f(V,Q,{value:a,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return V}},6279:(d,l,U)=>{var Z=U(6840);d.exports=function(F,t,c){for(var V in t)Z(F,V,t[V],c);return F}},9433:(d,l,U)=>{var Z=U(4475),F=Object.defineProperty;d.exports=function(t,c){try{F(Z,t,{value:c,configurable:!0,writable:!0})}catch{Z[t]=c}return c}},3724:(d,l,U)=>{var Z=U(9039);d.exports=!Z(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7})},4483:(d,l,U)=>{var Z=U(4475),F=U(9714),t=U(1548),c=Z.structuredClone,V=Z.ArrayBuffer,Q=Z.MessageChannel,a=!1,n,s,R,N;if(t)a=function(h){c(h,{transfer:[h]})};else if(V)try{Q||(n=F("worker_threads"),n&&(Q=n.MessageChannel)),Q&&(s=new Q,R=new V(2),N=function(h){s.port1.postMessage(null,[h])},R.byteLength===2&&(N(R),R.byteLength===0&&(a=N)))}catch{}d.exports=a},4055:(d,l,U)=>{var Z=U(4475),F=U(34),t=Z.document,c=F(t)&&F(t.createElement);d.exports=function(V){return c?t.createElement(V):{}}},6837:d=>{var l=TypeError,U=9007199254740991;d.exports=function(Z){if(Z>U)throw l("Maximum allowed index exceeded");return Z}},5002:d=>{d.exports={IndexSizeError:{s:"INDEX_SIZE_ERR",c:1,m:1},DOMStringSizeError:{s:"DOMSTRING_SIZE_ERR",c:2,m:0},HierarchyRequestError:{s:"HIERARCHY_REQUEST_ERR",c:3,m:1},WrongDocumentError:{s:"WRONG_DOCUMENT_ERR",c:4,m:1},InvalidCharacterError:{s:"INVALID_CHARACTER_ERR",c:5,m:1},NoDataAllowedError:{s:"NO_DATA_ALLOWED_ERR",c:6,m:0},NoModificationAllowedError:{s:"NO_MODIFICATION_ALLOWED_ERR",c:7,m:1},NotFoundError:{s:"NOT_FOUND_ERR",c:8,m:1},NotSupportedError:{s:"NOT_SUPPORTED_ERR",c:9,m:1},InUseAttributeError:{s:"INUSE_ATTRIBUTE_ERR",c:10,m:1},InvalidStateError:{s:"INVALID_STATE_ERR",c:11,m:1},SyntaxError:{s:"SYNTAX_ERR",c:12,m:1},InvalidModificationError:{s:"INVALID_MODIFICATION_ERR",c:13,m:1},NamespaceError:{s:"NAMESPACE_ERR",c:14,m:1},InvalidAccessError:{s:"INVALID_ACCESS_ERR",c:15,m:1},ValidationError:{s:"VALIDATION_ERR",c:16,m:0},TypeMismatchError:{s:"TYPE_MISMATCH_ERR",c:17,m:1},SecurityError:{s:"SECURITY_ERR",c:18,m:1},NetworkError:{s:"NETWORK_ERR",c:19,m:1},AbortError:{s:"ABORT_ERR",c:20,m:1},URLMismatchError:{s:"URL_MISMATCH_ERR",c:21,m:1},QuotaExceededError:{s:"QUOTA_EXCEEDED_ERR",c:22,m:1},TimeoutError:{s:"TIMEOUT_ERR",c:23,m:1},InvalidNodeTypeError:{s:"INVALID_NODE_TYPE_ERR",c:24,m:1},DataCloneError:{s:"DATA_CLONE_ERR",c:25,m:1}}},7290:(d,l,U)=>{var Z=U(516),F=U(9088);d.exports=!Z&&!F&&typeof window=="object"&&typeof document=="object"},516:d=>{d.exports=typeof Deno=="object"&&Deno&&typeof Deno.version=="object"},9088:(d,l,U)=>{var Z=U(4475),F=U(4576);d.exports=F(Z.process)==="process"},9392:d=>{d.exports=typeof navigator<"u"&&String(navigator.userAgent)||""},7388:(d,l,U)=>{var Z=U(4475),F=U(9392),t=Z.process,c=Z.Deno,V=t&&t.versions||c&&c.version,Q=V&&V.v8,a,n;Q&&(a=Q.split("."),n=a[0]>0&&a[0]<4?1:+(a[0]+a[1])),!n&&F&&(a=F.match(/Edge\/(\d+)/),(!a||a[1]>=74)&&(a=F.match(/Chrome\/(\d+)/),a&&(n=+a[1]))),d.exports=n},8727:d=>{d.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},6193:(d,l,U)=>{var Z=U(9504),F=Error,t=Z("".replace),c=function(a){return String(new F(a).stack)}("zxcasd"),V=/\n\s*at [^:]*:[^\n]*/,Q=V.test(c);d.exports=function(a,n){if(Q&&typeof a=="string"&&!F.prepareStackTrace)for(;n--;)a=t(a,V,"");return a}},6518:(d,l,U)=>{var Z=U(4475),F=U(7347).f,t=U(6699),c=U(6840),V=U(9433),Q=U(7740),a=U(2796);d.exports=function(n,s){var R=n.target,N=n.global,h=n.stat,e,M,J,G,T,p;if(N?M=Z:h?M=Z[R]||V(R,{}):M=Z[R]&&Z[R].prototype,M)for(J in s){if(T=s[J],n.dontCallGetSet?(p=F(M,J),G=p&&p.value):G=M[J],e=a(N?J:R+(h?".":"#")+J,n.forced),!e&&G!==void 0){if(typeof T==typeof G)continue;Q(T,G)}(n.sham||G&&G.sham)&&t(T,"sham",!0),c(M,J,T,n)}}},9039:d=>{d.exports=function(l){try{return!!l()}catch{return!0}}},6080:(d,l,U)=>{var Z=U(7476),F=U(9306),t=U(616),c=Z(Z.bind);d.exports=function(V,Q){return F(V),Q===void 0?V:t?c(V,Q):function(){return V.apply(Q,arguments)}}},616:(d,l,U)=>{var Z=U(9039);d.exports=!Z(function(){var F=(function(){}).bind();return typeof F!="function"||F.hasOwnProperty("prototype")})},9565:(d,l,U)=>{var Z=U(616),F=Function.prototype.call;d.exports=Z?F.bind(F):function(){return F.apply(F,arguments)}},350:(d,l,U)=>{var Z=U(3724),F=U(9297),t=Function.prototype,c=Z&&Object.getOwnPropertyDescriptor,V=F(t,"name"),Q=V&&(function(){}).name==="something",a=V&&(!Z||Z&&c(t,"name").configurable);d.exports={EXISTS:V,PROPER:Q,CONFIGURABLE:a}},6706:(d,l,U)=>{var Z=U(9504),F=U(9306);d.exports=function(t,c,V){try{return Z(F(Object.getOwnPropertyDescriptor(t,c)[V]))}catch{}}},7476:(d,l,U)=>{var Z=U(4576),F=U(9504);d.exports=function(t){if(Z(t)==="Function")return F(t)}},9504:(d,l,U)=>{var Z=U(616),F=Function.prototype,t=F.call,c=Z&&F.bind.bind(t,t);d.exports=Z?c:function(V){return function(){return t.apply(V,arguments)}}},7751:(d,l,U)=>{var Z=U(4475),F=U(4901),t=function(c){return F(c)?c:void 0};d.exports=function(c,V){return arguments.length<2?t(Z[c]):Z[c]&&Z[c][V]}},1767:d=>{d.exports=function(l){return{iterator:l,next:l.next,done:!1}}},8646:(d,l,U)=>{var Z=U(9565),F=U(8551),t=U(1767),c=U(851);d.exports=function(V,Q){(!Q||typeof V!="string")&&F(V);var a=c(V);return t(F(a!==void 0?Z(a,V):V))}},851:(d,l,U)=>{var Z=U(6955),F=U(5966),t=U(4117),c=U(6269),V=U(8227),Q=V("iterator");d.exports=function(a){if(!t(a))return F(a,Q)||F(a,"@@iterator")||c[Z(a)]}},81:(d,l,U)=>{var Z=U(9565),F=U(9306),t=U(8551),c=U(6823),V=U(851),Q=TypeError;d.exports=function(a,n){var s=arguments.length<2?V(a):n;if(F(s))return t(Z(s,a));throw new Q(c(a)+" is not iterable")}},5966:(d,l,U)=>{var Z=U(9306),F=U(4117);d.exports=function(t,c){var V=t[c];return F(V)?void 0:Z(V)}},3789:(d,l,U)=>{var Z=U(9306),F=U(8551),t=U(9565),c=U(1291),V=U(1767),Q="Invalid size",a=RangeError,n=TypeError,s=Math.max,R=function(N,h){this.set=N,this.size=s(h,0),this.has=Z(N.has),this.keys=Z(N.keys)};R.prototype={getIterator:function(){return V(F(t(this.keys,this.set)))},includes:function(N){return t(this.has,this.set,N)}},d.exports=function(N){F(N);var h=+N.size;if(h!==h)throw new n(Q);var e=c(h);if(e<0)throw new a(Q);return new R(N,e)}},4475:function(d){var l=function(U){return U&&U.Math===Math&&U};d.exports=l(typeof globalThis=="object"&&globalThis)||l(typeof window=="object"&&window)||l(typeof self=="object"&&self)||l(typeof global=="object"&&global)||l(typeof this=="object"&&this)||function(){return this}()||Function("return this")()},9297:(d,l,U)=>{var Z=U(9504),F=U(8981),t=Z({}.hasOwnProperty);d.exports=Object.hasOwn||function(c,V){return t(F(c),V)}},421:d=>{d.exports={}},397:(d,l,U)=>{var Z=U(7751);d.exports=Z("document","documentElement")},5917:(d,l,U)=>{var Z=U(3724),F=U(9039),t=U(4055);d.exports=!Z&&!F(function(){return Object.defineProperty(t("div"),"a",{get:function(){return 7}}).a!==7})},7055:(d,l,U)=>{var Z=U(9504),F=U(9039),t=U(4576),c=Object,V=Z("".split);d.exports=F(function(){return!c("z").propertyIsEnumerable(0)})?function(Q){return t(Q)==="String"?V(Q,""):c(Q)}:c},3167:(d,l,U)=>{var Z=U(4901),F=U(34),t=U(2967);d.exports=function(c,V,Q){var a,n;return t&&Z(a=V.constructor)&&a!==Q&&F(n=a.prototype)&&n!==Q.prototype&&t(c,n),c}},3706:(d,l,U)=>{var Z=U(9504),F=U(4901),t=U(7629),c=Z(Function.toString);F(t.inspectSource)||(t.inspectSource=function(V){return c(V)}),d.exports=t.inspectSource},1181:(d,l,U)=>{var Z=U(8622),F=U(4475),t=U(34),c=U(6699),V=U(9297),Q=U(7629),a=U(6119),n=U(421),s="Object already initialized",R=F.TypeError,N=F.WeakMap,h,e,M,J=function(S){return M(S)?e(S):h(S,{})},G=function(S){return function(X){var B;if(!t(X)||(B=e(X)).type!==S)throw new R("Incompatible receiver, "+S+" required");return B}};if(Z||Q.state){var T=Q.state||(Q.state=new N);T.get=T.get,T.has=T.has,T.set=T.set,h=function(S,X){if(T.has(S))throw new R(s);return X.facade=S,T.set(S,X),X},e=function(S){return T.get(S)||{}},M=function(S){return T.has(S)}}else{var p=a("state");n[p]=!0,h=function(S,X){if(V(S,p))throw new R(s);return X.facade=S,c(S,p,X),X},e=function(S){return V(S,p)?S[p]:{}},M=function(S){return V(S,p)}}d.exports={set:h,get:e,has:M,enforce:J,getterFor:G}},4209:(d,l,U)=>{var Z=U(8227),F=U(6269),t=Z("iterator"),c=Array.prototype;d.exports=function(V){return V!==void 0&&(F.Array===V||c[t]===V)}},4376:(d,l,U)=>{var Z=U(4576);d.exports=Array.isArray||function(F){return Z(F)==="Array"}},1108:(d,l,U)=>{var Z=U(6955);d.exports=function(F){var t=Z(F);return t==="BigInt64Array"||t==="BigUint64Array"}},4901:d=>{var l=typeof document=="object"&&document.all;d.exports=typeof l>"u"&&l!==void 0?function(U){return typeof U=="function"||U===l}:function(U){return typeof U=="function"}},2796:(d,l,U)=>{var Z=U(9039),F=U(4901),t=/#|\.prototype\./,c=function(s,R){var N=Q[V(s)];return N===n?!0:N===a?!1:F(R)?Z(R):!!R},V=c.normalize=function(s){return String(s).replace(t,".").toLowerCase()},Q=c.data={},a=c.NATIVE="N",n=c.POLYFILL="P";d.exports=c},4117:d=>{d.exports=function(l){return l==null}},34:(d,l,U)=>{var Z=U(4901);d.exports=function(F){return typeof F=="object"?F!==null:Z(F)}},3925:(d,l,U)=>{var Z=U(34);d.exports=function(F){return Z(F)||F===null}},6395:d=>{d.exports=!1},757:(d,l,U)=>{var Z=U(7751),F=U(4901),t=U(1625),c=U(7040),V=Object;d.exports=c?function(Q){return typeof Q=="symbol"}:function(Q){var a=Z("Symbol");return F(a)&&t(a.prototype,V(Q))}},507:(d,l,U)=>{var Z=U(9565);d.exports=function(F,t,c){for(var V=c?F:F.iterator,Q=F.next,a,n;!(a=Z(Q,V)).done;)if(n=t(a.value),n!==void 0)return n}},2652:(d,l,U)=>{var Z=U(6080),F=U(9565),t=U(8551),c=U(6823),V=U(4209),Q=U(6198),a=U(1625),n=U(81),s=U(851),R=U(9539),N=TypeError,h=function(M,J){this.stopped=M,this.result=J},e=h.prototype;d.exports=function(M,J,G){var T=G&&G.that,p=!!(G&&G.AS_ENTRIES),S=!!(G&&G.IS_RECORD),X=!!(G&&G.IS_ITERATOR),B=!!(G&&G.INTERRUPTED),k=Z(J,T),Y,o,y,D,I,j,x,u=function(A){return Y&&R(Y,"normal",A),new h(!0,A)},E=function(A){return p?(t(A),B?k(A[0],A[1],u):k(A[0],A[1])):B?k(A,u):k(A)};if(S)Y=M.iterator;else if(X)Y=M;else{if(o=s(M),!o)throw new N(c(M)+" is not iterable");if(V(o)){for(y=0,D=Q(M);D>y;y++)if(I=E(M[y]),I&&a(e,I))return I;return new h(!1)}Y=n(M,o)}for(j=S?M.next:Y.next;!(x=F(j,Y)).done;){try{I=E(x.value)}catch(A){R(Y,"throw",A)}if(typeof I=="object"&&I&&a(e,I))return I}return new h(!1)}},9539:(d,l,U)=>{var Z=U(9565),F=U(8551),t=U(5966);d.exports=function(c,V,Q){var a,n;F(c);try{if(a=t(c,"return"),!a){if(V==="throw")throw Q;return Q}a=Z(a,c)}catch(s){n=!0,a=s}if(V==="throw")throw Q;if(n)throw a;return F(a),Q}},9462:(d,l,U)=>{var Z=U(9565),F=U(2360),t=U(6699),c=U(6279),V=U(8227),Q=U(1181),a=U(5966),n=U(7657).IteratorPrototype,s=U(2529),R=U(9539),N=V("toStringTag"),h="IteratorHelper",e="WrapForValidIterator",M=Q.set,J=function(p){var S=Q.getterFor(p?e:h);return c(F(n),{next:function(){var X=S(this);if(p)return X.nextHandler();try{var B=X.done?void 0:X.nextHandler();return s(B,X.done)}catch(k){throw X.done=!0,k}},return:function(){var X=S(this),B=X.iterator;if(X.done=!0,p){var k=a(B,"return");return k?Z(k,B):s(void 0,!0)}if(X.inner)try{R(X.inner.iterator,"normal")}catch(Y){return R(B,"throw",Y)}return R(B,"normal"),s(void 0,!0)}})},G=J(!0),T=J(!1);t(T,N,"Iterator Helper"),d.exports=function(p,S){var X=function(B,k){k?(k.iterator=B.iterator,k.next=B.next):k=B,k.type=S?e:h,k.nextHandler=p,k.counter=0,k.done=!1,M(this,k)};return X.prototype=S?G:T,X}},713:(d,l,U)=>{var Z=U(9565),F=U(9306),t=U(8551),c=U(1767),V=U(9462),Q=U(6319),a=V(function(){var n=this.iterator,s=t(Z(this.next,n)),R=this.done=!!s.done;if(!R)return Q(n,this.mapper,[s.value,this.counter++],!0)});d.exports=function(n){return t(this),F(n),new a(c(this),{mapper:n})}},7657:(d,l,U)=>{var Z=U(9039),F=U(4901),t=U(34),c=U(2360),V=U(2787),Q=U(6840),a=U(8227),n=U(6395),s=a("iterator"),R=!1,N,h,e;[].keys&&(e=[].keys(),"next"in e?(h=V(V(e)),h!==Object.prototype&&(N=h)):R=!0);var M=!t(N)||Z(function(){var J={};return N[s].call(J)!==J});M?N={}:n&&(N=c(N)),F(N[s])||Q(N,s,function(){return this}),d.exports={IteratorPrototype:N,BUGGY_SAFARI_ITERATORS:R}},6269:d=>{d.exports={}},6198:(d,l,U)=>{var Z=U(8014);d.exports=function(F){return Z(F.length)}},283:(d,l,U)=>{var Z=U(9504),F=U(9039),t=U(4901),c=U(9297),V=U(3724),Q=U(350).CONFIGURABLE,a=U(3706),n=U(1181),s=n.enforce,R=n.get,N=String,h=Object.defineProperty,e=Z("".slice),M=Z("".replace),J=Z([].join),G=V&&!F(function(){return h(function(){},"length",{value:8}).length!==8}),T=String(String).split("String"),p=d.exports=function(S,X,B){e(N(X),0,7)==="Symbol("&&(X="["+M(N(X),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),B&&B.getter&&(X="get "+X),B&&B.setter&&(X="set "+X),(!c(S,"name")||Q&&S.name!==X)&&(V?h(S,"name",{value:X,configurable:!0}):S.name=X),G&&B&&c(B,"arity")&&S.length!==B.arity&&h(S,"length",{value:B.arity});try{B&&c(B,"constructor")&&B.constructor?V&&h(S,"prototype",{writable:!1}):S.prototype&&(S.prototype=void 0)}catch{}var k=s(S);return c(k,"source")||(k.source=J(T,typeof X=="string"?X:"")),S};Function.prototype.toString=p(function(){return t(this)&&R(this).source||a(this)},"toString")},741:d=>{var l=Math.ceil,U=Math.floor;d.exports=Math.trunc||function(Z){var F=+Z;return(F>0?U:l)(F)}},6043:(d,l,U)=>{var Z=U(9306),F=TypeError,t=function(c){var V,Q;this.promise=new c(function(a,n){if(V!==void 0||Q!==void 0)throw new F("Bad Promise constructor");V=a,Q=n}),this.resolve=Z(V),this.reject=Z(Q)};d.exports.f=function(c){return new t(c)}},2603:(d,l,U)=>{var Z=U(655);d.exports=function(F,t){return F===void 0?arguments.length<2?"":t:Z(F)}},4149:d=>{var l=RangeError;d.exports=function(U){if(U===U)return U;throw new l("NaN is not allowed")}},2360:(d,l,U)=>{var Z=U(8551),F=U(6801),t=U(8727),c=U(421),V=U(397),Q=U(4055),a=U(6119),n=">",s="<",R="prototype",N="script",h=a("IE_PROTO"),e=function(){},M=function(S){return s+N+n+S+s+"/"+N+n},J=function(S){S.write(M("")),S.close();var X=S.parentWindow.Object;return S=null,X},G=function(){var S=Q("iframe"),X="java"+N+":",B;return S.style.display="none",V.appendChild(S),S.src=String(X),B=S.contentWindow.document,B.open(),B.write(M("document.F=Object")),B.close(),B.F},T,p=function(){try{T=new ActiveXObject("htmlfile")}catch{}p=typeof document<"u"?document.domain&&T?J(T):G():J(T);for(var S=t.length;S--;)delete p[R][t[S]];return p()};c[h]=!0,d.exports=Object.create||function(S,X){var B;return S!==null?(e[R]=Z(S),B=new e,e[R]=null,B[h]=S):B=p(),X===void 0?B:F.f(B,X)}},6801:(d,l,U)=>{var Z=U(3724),F=U(8686),t=U(4913),c=U(8551),V=U(5397),Q=U(1072);l.f=Z&&!F?Object.defineProperties:function(a,n){c(a);for(var s=V(n),R=Q(n),N=R.length,h=0,e;N>h;)t.f(a,e=R[h++],s[e]);return a}},4913:(d,l,U)=>{var Z=U(3724),F=U(5917),t=U(8686),c=U(8551),V=U(6969),Q=TypeError,a=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s="enumerable",R="configurable",N="writable";l.f=Z?t?function(h,e,M){if(c(h),e=V(e),c(M),typeof h=="function"&&e==="prototype"&&"value"in M&&N in M&&!M[N]){var J=n(h,e);J&&J[N]&&(h[e]=M.value,M={configurable:R in M?M[R]:J[R],enumerable:s in M?M[s]:J[s],writable:!1})}return a(h,e,M)}:a:function(h,e,M){if(c(h),e=V(e),c(M),F)try{return a(h,e,M)}catch{}if("get"in M||"set"in M)throw new Q("Accessors not supported");return"value"in M&&(h[e]=M.value),h}},7347:(d,l,U)=>{var Z=U(3724),F=U(9565),t=U(8773),c=U(6980),V=U(5397),Q=U(6969),a=U(9297),n=U(5917),s=Object.getOwnPropertyDescriptor;l.f=Z?s:function(R,N){if(R=V(R),N=Q(N),n)try{return s(R,N)}catch{}if(a(R,N))return c(!F(t.f,R,N),R[N])}},8480:(d,l,U)=>{var Z=U(1828),F=U(8727),t=F.concat("length","prototype");l.f=Object.getOwnPropertyNames||function(c){return Z(c,t)}},3717:(d,l)=>{l.f=Object.getOwnPropertySymbols},2787:(d,l,U)=>{var Z=U(9297),F=U(4901),t=U(8981),c=U(6119),V=U(2211),Q=c("IE_PROTO"),a=Object,n=a.prototype;d.exports=V?a.getPrototypeOf:function(s){var R=t(s);if(Z(R,Q))return R[Q];var N=R.constructor;return F(N)&&R instanceof N?N.prototype:R instanceof a?n:null}},1625:(d,l,U)=>{var Z=U(9504);d.exports=Z({}.isPrototypeOf)},1828:(d,l,U)=>{var Z=U(9504),F=U(9297),t=U(5397),c=U(9617).indexOf,V=U(421),Q=Z([].push);d.exports=function(a,n){var s=t(a),R=0,N=[],h;for(h in s)!F(V,h)&&F(s,h)&&Q(N,h);for(;n.length>R;)F(s,h=n[R++])&&(~c(N,h)||Q(N,h));return N}},1072:(d,l,U)=>{var Z=U(1828),F=U(8727);d.exports=Object.keys||function(t){return Z(t,F)}},8773:(d,l)=>{var U={}.propertyIsEnumerable,Z=Object.getOwnPropertyDescriptor,F=Z&&!U.call({1:2},1);l.f=F?function(t){var c=Z(this,t);return!!c&&c.enumerable}:U},2967:(d,l,U)=>{var Z=U(6706),F=U(34),t=U(7750),c=U(3506);d.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var V=!1,Q={},a;try{a=Z(Object.prototype,"__proto__","set"),a(Q,[]),V=Q instanceof Array}catch{}return function(n,s){return t(n),c(s),F(n)&&(V?a(n,s):n.__proto__=s),n}}():void 0)},4270:(d,l,U)=>{var Z=U(9565),F=U(4901),t=U(34),c=TypeError;d.exports=function(V,Q){var a,n;if(Q==="string"&&F(a=V.toString)&&!t(n=Z(a,V))||F(a=V.valueOf)&&!t(n=Z(a,V))||Q!=="string"&&F(a=V.toString)&&!t(n=Z(a,V)))return n;throw new c("Can't convert object to primitive value")}},5031:(d,l,U)=>{var Z=U(7751),F=U(9504),t=U(8480),c=U(3717),V=U(8551),Q=F([].concat);d.exports=Z("Reflect","ownKeys")||function(a){var n=t.f(V(a)),s=c.f;return s?Q(n,s(a)):n}},8235:(d,l,U)=>{var Z=U(9504),F=U(9297),t=SyntaxError,c=parseInt,V=String.fromCharCode,Q=Z("".charAt),a=Z("".slice),n=Z(/./.exec),s={'\\"':'"',"\\\\":"\\","\\/":"/","\\b":"\b","\\f":"\f","\\n":`
|
|
1
|
+
import{s as Sn,w as YM,dv as db,a as Pi,o as te,e as pM,r as BM,av as uM,h as oM,V as fF,aA as M0,al as yM,aB as kM,bs as Zb,aJ as ce,aE as Fb,bz as LM,_ as zM,R as DM,S as IM,U as EM,T as wM,ag as CM}from"./admin-drawer-panel-BAT7GA64.js";import{b as tb,V as xM}from"./main-CmjU2oTp.js";var rM=Object.defineProperty,jM=(d,l,U)=>l in d?rM(d,l,{enumerable:!0,configurable:!0,writable:!0,value:U}):d[l]=U,H=(d,l,U)=>(jM(d,typeof l!="symbol"?l+"":l,U),U),rh=(d,l,U)=>{if(!l.has(d))throw TypeError("Cannot "+U)},W=(d,l,U)=>(rh(d,l,"read from private field"),U?U.call(d):l.get(d)),i=(d,l,U)=>{if(l.has(d))throw TypeError("Cannot add the same private member more than once");l instanceof WeakSet?l.add(d):l.set(d,U)},m=(d,l,U,Z)=>(rh(d,l,"write to private field"),l.set(d,U),U),NU=(d,l,U,Z)=>({set _(F){m(d,l,F)},get _(){return W(d,l,Z)}}),b=(d,l,U)=>(rh(d,l,"access private method"),U),OM={9306:(d,l,U)=>{var Z=U(4901),F=U(6823),t=TypeError;d.exports=function(c){if(Z(c))return c;throw new t(F(c)+" is not a function")}},3506:(d,l,U)=>{var Z=U(3925),F=String,t=TypeError;d.exports=function(c){if(Z(c))return c;throw new t("Can't set "+F(c)+" as a prototype")}},7080:(d,l,U)=>{var Z=U(4402).has;d.exports=function(F){return Z(F),F}},679:(d,l,U)=>{var Z=U(1625),F=TypeError;d.exports=function(t,c){if(Z(c,t))return t;throw new F("Incorrect invocation")}},8551:(d,l,U)=>{var Z=U(34),F=String,t=TypeError;d.exports=function(c){if(Z(c))return c;throw new t(F(c)+" is not an object")}},7811:d=>{d.exports=typeof ArrayBuffer<"u"&&typeof DataView<"u"},7394:(d,l,U)=>{var Z=U(6706),F=U(4576),t=TypeError;d.exports=Z(ArrayBuffer.prototype,"byteLength","get")||function(c){if(F(c)!=="ArrayBuffer")throw new t("ArrayBuffer expected");return c.byteLength}},3238:(d,l,U)=>{var Z=U(9504),F=U(7394),t=Z(ArrayBuffer.prototype.slice);d.exports=function(c){if(F(c)!==0)return!1;try{return t(c,0,0),!1}catch{return!0}}},5636:(d,l,U)=>{var Z=U(4475),F=U(9504),t=U(6706),c=U(7696),V=U(3238),Q=U(7394),a=U(4483),n=U(1548),s=Z.structuredClone,R=Z.ArrayBuffer,N=Z.DataView,h=Z.TypeError,e=Math.min,M=R.prototype,J=N.prototype,G=F(M.slice),T=t(M,"resizable","get"),p=t(M,"maxByteLength","get"),S=F(J.getInt8),X=F(J.setInt8);d.exports=(n||a)&&function(B,k,Y){var o=Q(B),y=k===void 0?o:c(k),D=!T||!T(B),I;if(V(B))throw new h("ArrayBuffer is detached");if(n&&(B=s(B,{transfer:[B]}),o===y&&(Y||D)))return B;if(o>=y&&(!Y||D))I=G(B,0,y);else{var j=Y&&!D&&p?{maxByteLength:p(B)}:void 0;I=new R(y,j);for(var x=new N(B),u=new N(I),E=e(y,o),A=0;A<E;A++)X(u,A,S(x,A))}return n||a(B),I}},4644:(d,l,U)=>{var Z=U(7811),F=U(3724),t=U(4475),c=U(4901),V=U(34),Q=U(9297),a=U(6955),n=U(6823),s=U(6699),R=U(6840),N=U(2106),h=U(1625),e=U(2787),M=U(2967),J=U(8227),G=U(3392),T=U(1181),p=T.enforce,S=T.get,X=t.Int8Array,B=X&&X.prototype,k=t.Uint8ClampedArray,Y=k&&k.prototype,o=X&&e(X),y=B&&e(B),D=Object.prototype,I=t.TypeError,j=J("toStringTag"),x=G("TYPED_ARRAY_TAG"),u="TypedArrayConstructor",E=Z&&!!M&&a(t.opera)!=="Opera",A=!1,Wl,ml,dU,Fl={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},Vl={BigInt64Array:8,BigUint64Array:8},Cd=function(g){if(!V(g))return!1;var al=a(g);return al==="DataView"||Q(Fl,al)||Q(Vl,al)},hU=function(g){var al=e(g);if(V(al)){var Tl=S(al);return Tl&&Q(Tl,u)?Tl[u]:hU(al)}},w=function(g){if(!V(g))return!1;var al=a(g);return Q(Fl,al)||Q(Vl,al)},L=function(g){if(w(g))return g;throw new I("Target is not a typed array")},C=function(g){if(c(g)&&(!M||h(o,g)))return g;throw new I(n(g)+" is not a typed array constructor")},P=function(g,al,Tl,xU){if(F){if(Tl)for(var Al in Fl){var Il=t[Al];if(Il&&Q(Il.prototype,g))try{delete Il.prototype[g]}catch{try{Il.prototype[g]=al}catch{}}}(!y[g]||Tl)&&R(y,g,Tl?al:E&&B[g]||al,xU)}},Ql=function(g,al,Tl){var xU,Al;if(F){if(M){if(Tl){for(xU in Fl)if(Al=t[xU],Al&&Q(Al,g))try{delete Al[g]}catch{}}if(!o[g]||Tl)try{return R(o,g,Tl?al:E&&o[g]||al)}catch{}else return}for(xU in Fl)Al=t[xU],Al&&(!Al[g]||Tl)&&R(Al,g,al)}};for(Wl in Fl)ml=t[Wl],dU=ml&&ml.prototype,dU?p(dU)[u]=ml:E=!1;for(Wl in Vl)ml=t[Wl],dU=ml&&ml.prototype,dU&&(p(dU)[u]=ml);if((!E||!c(o)||o===Function.prototype)&&(o=function(){throw new I("Incorrect invocation")},E))for(Wl in Fl)t[Wl]&&M(t[Wl],o);if((!E||!y||y===D)&&(y=o.prototype,E))for(Wl in Fl)t[Wl]&&M(t[Wl].prototype,y);if(E&&e(Y)!==y&&M(Y,y),F&&!Q(y,j)){A=!0,N(y,j,{configurable:!0,get:function(){return V(this)?this[x]:void 0}});for(Wl in Fl)t[Wl]&&s(t[Wl],x,Wl)}d.exports={NATIVE_ARRAY_BUFFER_VIEWS:E,TYPED_ARRAY_TAG:A&&x,aTypedArray:L,aTypedArrayConstructor:C,exportTypedArrayMethod:P,exportTypedArrayStaticMethod:Ql,getTypedArrayConstructor:hU,isView:Cd,isTypedArray:w,TypedArray:o,TypedArrayPrototype:y}},5370:(d,l,U)=>{var Z=U(6198);d.exports=function(F,t,c){for(var V=0,Q=arguments.length>2?c:Z(t),a=new F(Q);Q>V;)a[V]=t[V++];return a}},9617:(d,l,U)=>{var Z=U(5397),F=U(5610),t=U(6198),c=function(V){return function(Q,a,n){var s=Z(Q),R=t(s);if(R===0)return!V&&-1;var N=F(n,R),h;if(V&&a!==a){for(;R>N;)if(h=s[N++],h!==h)return!0}else for(;R>N;N++)if((V||N in s)&&s[N]===a)return V||N||0;return!V&&-1}};d.exports={includes:c(!0),indexOf:c(!1)}},4527:(d,l,U)=>{var Z=U(3724),F=U(4376),t=TypeError,c=Object.getOwnPropertyDescriptor,V=Z&&!function(){if(this!==void 0)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(Q){return Q instanceof TypeError}}();d.exports=V?function(Q,a){if(F(Q)&&!c(Q,"length").writable)throw new t("Cannot set read only .length");return Q.length=a}:function(Q,a){return Q.length=a}},7628:(d,l,U)=>{var Z=U(6198);d.exports=function(F,t){for(var c=Z(F),V=new t(c),Q=0;Q<c;Q++)V[Q]=F[c-Q-1];return V}},9928:(d,l,U)=>{var Z=U(6198),F=U(1291),t=RangeError;d.exports=function(c,V,Q,a){var n=Z(c),s=F(Q),R=s<0?n+s:s;if(R>=n||R<0)throw new t("Incorrect index");for(var N=new V(n),h=0;h<n;h++)N[h]=h===R?a:c[h];return N}},6319:(d,l,U)=>{var Z=U(8551),F=U(9539);d.exports=function(t,c,V,Q){try{return Q?c(Z(V)[0],V[1]):c(V)}catch(a){F(t,"throw",a)}}},4576:(d,l,U)=>{var Z=U(9504),F=Z({}.toString),t=Z("".slice);d.exports=function(c){return t(F(c),8,-1)}},6955:(d,l,U)=>{var Z=U(2140),F=U(4901),t=U(4576),c=U(8227),V=c("toStringTag"),Q=Object,a=t(function(){return arguments}())==="Arguments",n=function(s,R){try{return s[R]}catch{}};d.exports=Z?t:function(s){var R,N,h;return s===void 0?"Undefined":s===null?"Null":typeof(N=n(R=Q(s),V))=="string"?N:a?t(R):(h=t(R))==="Object"&&F(R.callee)?"Arguments":h}},7740:(d,l,U)=>{var Z=U(9297),F=U(5031),t=U(7347),c=U(4913);d.exports=function(V,Q,a){for(var n=F(Q),s=c.f,R=t.f,N=0;N<n.length;N++){var h=n[N];!Z(V,h)&&!(a&&Z(a,h))&&s(V,h,R(Q,h))}}},2211:(d,l,U)=>{var Z=U(9039);d.exports=!Z(function(){function F(){}return F.prototype.constructor=null,Object.getPrototypeOf(new F)!==F.prototype})},2529:d=>{d.exports=function(l,U){return{value:l,done:U}}},6699:(d,l,U)=>{var Z=U(3724),F=U(4913),t=U(6980);d.exports=Z?function(c,V,Q){return F.f(c,V,t(1,Q))}:function(c,V,Q){return c[V]=Q,c}},6980:d=>{d.exports=function(l,U){return{enumerable:!(l&1),configurable:!(l&2),writable:!(l&4),value:U}}},4659:(d,l,U)=>{var Z=U(3724),F=U(4913),t=U(6980);d.exports=function(c,V,Q){Z?F.f(c,V,t(0,Q)):c[V]=Q}},2106:(d,l,U)=>{var Z=U(283),F=U(4913);d.exports=function(t,c,V){return V.get&&Z(V.get,c,{getter:!0}),V.set&&Z(V.set,c,{setter:!0}),F.f(t,c,V)}},6840:(d,l,U)=>{var Z=U(4901),F=U(4913),t=U(283),c=U(9433);d.exports=function(V,Q,a,n){n||(n={});var s=n.enumerable,R=n.name!==void 0?n.name:Q;if(Z(a)&&t(a,R,n),n.global)s?V[Q]=a:c(Q,a);else{try{n.unsafe?V[Q]&&(s=!0):delete V[Q]}catch{}s?V[Q]=a:F.f(V,Q,{value:a,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return V}},6279:(d,l,U)=>{var Z=U(6840);d.exports=function(F,t,c){for(var V in t)Z(F,V,t[V],c);return F}},9433:(d,l,U)=>{var Z=U(4475),F=Object.defineProperty;d.exports=function(t,c){try{F(Z,t,{value:c,configurable:!0,writable:!0})}catch{Z[t]=c}return c}},3724:(d,l,U)=>{var Z=U(9039);d.exports=!Z(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7})},4483:(d,l,U)=>{var Z=U(4475),F=U(9714),t=U(1548),c=Z.structuredClone,V=Z.ArrayBuffer,Q=Z.MessageChannel,a=!1,n,s,R,N;if(t)a=function(h){c(h,{transfer:[h]})};else if(V)try{Q||(n=F("worker_threads"),n&&(Q=n.MessageChannel)),Q&&(s=new Q,R=new V(2),N=function(h){s.port1.postMessage(null,[h])},R.byteLength===2&&(N(R),R.byteLength===0&&(a=N)))}catch{}d.exports=a},4055:(d,l,U)=>{var Z=U(4475),F=U(34),t=Z.document,c=F(t)&&F(t.createElement);d.exports=function(V){return c?t.createElement(V):{}}},6837:d=>{var l=TypeError,U=9007199254740991;d.exports=function(Z){if(Z>U)throw l("Maximum allowed index exceeded");return Z}},5002:d=>{d.exports={IndexSizeError:{s:"INDEX_SIZE_ERR",c:1,m:1},DOMStringSizeError:{s:"DOMSTRING_SIZE_ERR",c:2,m:0},HierarchyRequestError:{s:"HIERARCHY_REQUEST_ERR",c:3,m:1},WrongDocumentError:{s:"WRONG_DOCUMENT_ERR",c:4,m:1},InvalidCharacterError:{s:"INVALID_CHARACTER_ERR",c:5,m:1},NoDataAllowedError:{s:"NO_DATA_ALLOWED_ERR",c:6,m:0},NoModificationAllowedError:{s:"NO_MODIFICATION_ALLOWED_ERR",c:7,m:1},NotFoundError:{s:"NOT_FOUND_ERR",c:8,m:1},NotSupportedError:{s:"NOT_SUPPORTED_ERR",c:9,m:1},InUseAttributeError:{s:"INUSE_ATTRIBUTE_ERR",c:10,m:1},InvalidStateError:{s:"INVALID_STATE_ERR",c:11,m:1},SyntaxError:{s:"SYNTAX_ERR",c:12,m:1},InvalidModificationError:{s:"INVALID_MODIFICATION_ERR",c:13,m:1},NamespaceError:{s:"NAMESPACE_ERR",c:14,m:1},InvalidAccessError:{s:"INVALID_ACCESS_ERR",c:15,m:1},ValidationError:{s:"VALIDATION_ERR",c:16,m:0},TypeMismatchError:{s:"TYPE_MISMATCH_ERR",c:17,m:1},SecurityError:{s:"SECURITY_ERR",c:18,m:1},NetworkError:{s:"NETWORK_ERR",c:19,m:1},AbortError:{s:"ABORT_ERR",c:20,m:1},URLMismatchError:{s:"URL_MISMATCH_ERR",c:21,m:1},QuotaExceededError:{s:"QUOTA_EXCEEDED_ERR",c:22,m:1},TimeoutError:{s:"TIMEOUT_ERR",c:23,m:1},InvalidNodeTypeError:{s:"INVALID_NODE_TYPE_ERR",c:24,m:1},DataCloneError:{s:"DATA_CLONE_ERR",c:25,m:1}}},7290:(d,l,U)=>{var Z=U(516),F=U(9088);d.exports=!Z&&!F&&typeof window=="object"&&typeof document=="object"},516:d=>{d.exports=typeof Deno=="object"&&Deno&&typeof Deno.version=="object"},9088:(d,l,U)=>{var Z=U(4475),F=U(4576);d.exports=F(Z.process)==="process"},9392:d=>{d.exports=typeof navigator<"u"&&String(navigator.userAgent)||""},7388:(d,l,U)=>{var Z=U(4475),F=U(9392),t=Z.process,c=Z.Deno,V=t&&t.versions||c&&c.version,Q=V&&V.v8,a,n;Q&&(a=Q.split("."),n=a[0]>0&&a[0]<4?1:+(a[0]+a[1])),!n&&F&&(a=F.match(/Edge\/(\d+)/),(!a||a[1]>=74)&&(a=F.match(/Chrome\/(\d+)/),a&&(n=+a[1]))),d.exports=n},8727:d=>{d.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},6193:(d,l,U)=>{var Z=U(9504),F=Error,t=Z("".replace),c=function(a){return String(new F(a).stack)}("zxcasd"),V=/\n\s*at [^:]*:[^\n]*/,Q=V.test(c);d.exports=function(a,n){if(Q&&typeof a=="string"&&!F.prepareStackTrace)for(;n--;)a=t(a,V,"");return a}},6518:(d,l,U)=>{var Z=U(4475),F=U(7347).f,t=U(6699),c=U(6840),V=U(9433),Q=U(7740),a=U(2796);d.exports=function(n,s){var R=n.target,N=n.global,h=n.stat,e,M,J,G,T,p;if(N?M=Z:h?M=Z[R]||V(R,{}):M=Z[R]&&Z[R].prototype,M)for(J in s){if(T=s[J],n.dontCallGetSet?(p=F(M,J),G=p&&p.value):G=M[J],e=a(N?J:R+(h?".":"#")+J,n.forced),!e&&G!==void 0){if(typeof T==typeof G)continue;Q(T,G)}(n.sham||G&&G.sham)&&t(T,"sham",!0),c(M,J,T,n)}}},9039:d=>{d.exports=function(l){try{return!!l()}catch{return!0}}},6080:(d,l,U)=>{var Z=U(7476),F=U(9306),t=U(616),c=Z(Z.bind);d.exports=function(V,Q){return F(V),Q===void 0?V:t?c(V,Q):function(){return V.apply(Q,arguments)}}},616:(d,l,U)=>{var Z=U(9039);d.exports=!Z(function(){var F=(function(){}).bind();return typeof F!="function"||F.hasOwnProperty("prototype")})},9565:(d,l,U)=>{var Z=U(616),F=Function.prototype.call;d.exports=Z?F.bind(F):function(){return F.apply(F,arguments)}},350:(d,l,U)=>{var Z=U(3724),F=U(9297),t=Function.prototype,c=Z&&Object.getOwnPropertyDescriptor,V=F(t,"name"),Q=V&&(function(){}).name==="something",a=V&&(!Z||Z&&c(t,"name").configurable);d.exports={EXISTS:V,PROPER:Q,CONFIGURABLE:a}},6706:(d,l,U)=>{var Z=U(9504),F=U(9306);d.exports=function(t,c,V){try{return Z(F(Object.getOwnPropertyDescriptor(t,c)[V]))}catch{}}},7476:(d,l,U)=>{var Z=U(4576),F=U(9504);d.exports=function(t){if(Z(t)==="Function")return F(t)}},9504:(d,l,U)=>{var Z=U(616),F=Function.prototype,t=F.call,c=Z&&F.bind.bind(t,t);d.exports=Z?c:function(V){return function(){return t.apply(V,arguments)}}},7751:(d,l,U)=>{var Z=U(4475),F=U(4901),t=function(c){return F(c)?c:void 0};d.exports=function(c,V){return arguments.length<2?t(Z[c]):Z[c]&&Z[c][V]}},1767:d=>{d.exports=function(l){return{iterator:l,next:l.next,done:!1}}},8646:(d,l,U)=>{var Z=U(9565),F=U(8551),t=U(1767),c=U(851);d.exports=function(V,Q){(!Q||typeof V!="string")&&F(V);var a=c(V);return t(F(a!==void 0?Z(a,V):V))}},851:(d,l,U)=>{var Z=U(6955),F=U(5966),t=U(4117),c=U(6269),V=U(8227),Q=V("iterator");d.exports=function(a){if(!t(a))return F(a,Q)||F(a,"@@iterator")||c[Z(a)]}},81:(d,l,U)=>{var Z=U(9565),F=U(9306),t=U(8551),c=U(6823),V=U(851),Q=TypeError;d.exports=function(a,n){var s=arguments.length<2?V(a):n;if(F(s))return t(Z(s,a));throw new Q(c(a)+" is not iterable")}},5966:(d,l,U)=>{var Z=U(9306),F=U(4117);d.exports=function(t,c){var V=t[c];return F(V)?void 0:Z(V)}},3789:(d,l,U)=>{var Z=U(9306),F=U(8551),t=U(9565),c=U(1291),V=U(1767),Q="Invalid size",a=RangeError,n=TypeError,s=Math.max,R=function(N,h){this.set=N,this.size=s(h,0),this.has=Z(N.has),this.keys=Z(N.keys)};R.prototype={getIterator:function(){return V(F(t(this.keys,this.set)))},includes:function(N){return t(this.has,this.set,N)}},d.exports=function(N){F(N);var h=+N.size;if(h!==h)throw new n(Q);var e=c(h);if(e<0)throw new a(Q);return new R(N,e)}},4475:function(d){var l=function(U){return U&&U.Math===Math&&U};d.exports=l(typeof globalThis=="object"&&globalThis)||l(typeof window=="object"&&window)||l(typeof self=="object"&&self)||l(typeof global=="object"&&global)||l(typeof this=="object"&&this)||function(){return this}()||Function("return this")()},9297:(d,l,U)=>{var Z=U(9504),F=U(8981),t=Z({}.hasOwnProperty);d.exports=Object.hasOwn||function(c,V){return t(F(c),V)}},421:d=>{d.exports={}},397:(d,l,U)=>{var Z=U(7751);d.exports=Z("document","documentElement")},5917:(d,l,U)=>{var Z=U(3724),F=U(9039),t=U(4055);d.exports=!Z&&!F(function(){return Object.defineProperty(t("div"),"a",{get:function(){return 7}}).a!==7})},7055:(d,l,U)=>{var Z=U(9504),F=U(9039),t=U(4576),c=Object,V=Z("".split);d.exports=F(function(){return!c("z").propertyIsEnumerable(0)})?function(Q){return t(Q)==="String"?V(Q,""):c(Q)}:c},3167:(d,l,U)=>{var Z=U(4901),F=U(34),t=U(2967);d.exports=function(c,V,Q){var a,n;return t&&Z(a=V.constructor)&&a!==Q&&F(n=a.prototype)&&n!==Q.prototype&&t(c,n),c}},3706:(d,l,U)=>{var Z=U(9504),F=U(4901),t=U(7629),c=Z(Function.toString);F(t.inspectSource)||(t.inspectSource=function(V){return c(V)}),d.exports=t.inspectSource},1181:(d,l,U)=>{var Z=U(8622),F=U(4475),t=U(34),c=U(6699),V=U(9297),Q=U(7629),a=U(6119),n=U(421),s="Object already initialized",R=F.TypeError,N=F.WeakMap,h,e,M,J=function(S){return M(S)?e(S):h(S,{})},G=function(S){return function(X){var B;if(!t(X)||(B=e(X)).type!==S)throw new R("Incompatible receiver, "+S+" required");return B}};if(Z||Q.state){var T=Q.state||(Q.state=new N);T.get=T.get,T.has=T.has,T.set=T.set,h=function(S,X){if(T.has(S))throw new R(s);return X.facade=S,T.set(S,X),X},e=function(S){return T.get(S)||{}},M=function(S){return T.has(S)}}else{var p=a("state");n[p]=!0,h=function(S,X){if(V(S,p))throw new R(s);return X.facade=S,c(S,p,X),X},e=function(S){return V(S,p)?S[p]:{}},M=function(S){return V(S,p)}}d.exports={set:h,get:e,has:M,enforce:J,getterFor:G}},4209:(d,l,U)=>{var Z=U(8227),F=U(6269),t=Z("iterator"),c=Array.prototype;d.exports=function(V){return V!==void 0&&(F.Array===V||c[t]===V)}},4376:(d,l,U)=>{var Z=U(4576);d.exports=Array.isArray||function(F){return Z(F)==="Array"}},1108:(d,l,U)=>{var Z=U(6955);d.exports=function(F){var t=Z(F);return t==="BigInt64Array"||t==="BigUint64Array"}},4901:d=>{var l=typeof document=="object"&&document.all;d.exports=typeof l>"u"&&l!==void 0?function(U){return typeof U=="function"||U===l}:function(U){return typeof U=="function"}},2796:(d,l,U)=>{var Z=U(9039),F=U(4901),t=/#|\.prototype\./,c=function(s,R){var N=Q[V(s)];return N===n?!0:N===a?!1:F(R)?Z(R):!!R},V=c.normalize=function(s){return String(s).replace(t,".").toLowerCase()},Q=c.data={},a=c.NATIVE="N",n=c.POLYFILL="P";d.exports=c},4117:d=>{d.exports=function(l){return l==null}},34:(d,l,U)=>{var Z=U(4901);d.exports=function(F){return typeof F=="object"?F!==null:Z(F)}},3925:(d,l,U)=>{var Z=U(34);d.exports=function(F){return Z(F)||F===null}},6395:d=>{d.exports=!1},757:(d,l,U)=>{var Z=U(7751),F=U(4901),t=U(1625),c=U(7040),V=Object;d.exports=c?function(Q){return typeof Q=="symbol"}:function(Q){var a=Z("Symbol");return F(a)&&t(a.prototype,V(Q))}},507:(d,l,U)=>{var Z=U(9565);d.exports=function(F,t,c){for(var V=c?F:F.iterator,Q=F.next,a,n;!(a=Z(Q,V)).done;)if(n=t(a.value),n!==void 0)return n}},2652:(d,l,U)=>{var Z=U(6080),F=U(9565),t=U(8551),c=U(6823),V=U(4209),Q=U(6198),a=U(1625),n=U(81),s=U(851),R=U(9539),N=TypeError,h=function(M,J){this.stopped=M,this.result=J},e=h.prototype;d.exports=function(M,J,G){var T=G&&G.that,p=!!(G&&G.AS_ENTRIES),S=!!(G&&G.IS_RECORD),X=!!(G&&G.IS_ITERATOR),B=!!(G&&G.INTERRUPTED),k=Z(J,T),Y,o,y,D,I,j,x,u=function(A){return Y&&R(Y,"normal",A),new h(!0,A)},E=function(A){return p?(t(A),B?k(A[0],A[1],u):k(A[0],A[1])):B?k(A,u):k(A)};if(S)Y=M.iterator;else if(X)Y=M;else{if(o=s(M),!o)throw new N(c(M)+" is not iterable");if(V(o)){for(y=0,D=Q(M);D>y;y++)if(I=E(M[y]),I&&a(e,I))return I;return new h(!1)}Y=n(M,o)}for(j=S?M.next:Y.next;!(x=F(j,Y)).done;){try{I=E(x.value)}catch(A){R(Y,"throw",A)}if(typeof I=="object"&&I&&a(e,I))return I}return new h(!1)}},9539:(d,l,U)=>{var Z=U(9565),F=U(8551),t=U(5966);d.exports=function(c,V,Q){var a,n;F(c);try{if(a=t(c,"return"),!a){if(V==="throw")throw Q;return Q}a=Z(a,c)}catch(s){n=!0,a=s}if(V==="throw")throw Q;if(n)throw a;return F(a),Q}},9462:(d,l,U)=>{var Z=U(9565),F=U(2360),t=U(6699),c=U(6279),V=U(8227),Q=U(1181),a=U(5966),n=U(7657).IteratorPrototype,s=U(2529),R=U(9539),N=V("toStringTag"),h="IteratorHelper",e="WrapForValidIterator",M=Q.set,J=function(p){var S=Q.getterFor(p?e:h);return c(F(n),{next:function(){var X=S(this);if(p)return X.nextHandler();try{var B=X.done?void 0:X.nextHandler();return s(B,X.done)}catch(k){throw X.done=!0,k}},return:function(){var X=S(this),B=X.iterator;if(X.done=!0,p){var k=a(B,"return");return k?Z(k,B):s(void 0,!0)}if(X.inner)try{R(X.inner.iterator,"normal")}catch(Y){return R(B,"throw",Y)}return R(B,"normal"),s(void 0,!0)}})},G=J(!0),T=J(!1);t(T,N,"Iterator Helper"),d.exports=function(p,S){var X=function(B,k){k?(k.iterator=B.iterator,k.next=B.next):k=B,k.type=S?e:h,k.nextHandler=p,k.counter=0,k.done=!1,M(this,k)};return X.prototype=S?G:T,X}},713:(d,l,U)=>{var Z=U(9565),F=U(9306),t=U(8551),c=U(1767),V=U(9462),Q=U(6319),a=V(function(){var n=this.iterator,s=t(Z(this.next,n)),R=this.done=!!s.done;if(!R)return Q(n,this.mapper,[s.value,this.counter++],!0)});d.exports=function(n){return t(this),F(n),new a(c(this),{mapper:n})}},7657:(d,l,U)=>{var Z=U(9039),F=U(4901),t=U(34),c=U(2360),V=U(2787),Q=U(6840),a=U(8227),n=U(6395),s=a("iterator"),R=!1,N,h,e;[].keys&&(e=[].keys(),"next"in e?(h=V(V(e)),h!==Object.prototype&&(N=h)):R=!0);var M=!t(N)||Z(function(){var J={};return N[s].call(J)!==J});M?N={}:n&&(N=c(N)),F(N[s])||Q(N,s,function(){return this}),d.exports={IteratorPrototype:N,BUGGY_SAFARI_ITERATORS:R}},6269:d=>{d.exports={}},6198:(d,l,U)=>{var Z=U(8014);d.exports=function(F){return Z(F.length)}},283:(d,l,U)=>{var Z=U(9504),F=U(9039),t=U(4901),c=U(9297),V=U(3724),Q=U(350).CONFIGURABLE,a=U(3706),n=U(1181),s=n.enforce,R=n.get,N=String,h=Object.defineProperty,e=Z("".slice),M=Z("".replace),J=Z([].join),G=V&&!F(function(){return h(function(){},"length",{value:8}).length!==8}),T=String(String).split("String"),p=d.exports=function(S,X,B){e(N(X),0,7)==="Symbol("&&(X="["+M(N(X),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),B&&B.getter&&(X="get "+X),B&&B.setter&&(X="set "+X),(!c(S,"name")||Q&&S.name!==X)&&(V?h(S,"name",{value:X,configurable:!0}):S.name=X),G&&B&&c(B,"arity")&&S.length!==B.arity&&h(S,"length",{value:B.arity});try{B&&c(B,"constructor")&&B.constructor?V&&h(S,"prototype",{writable:!1}):S.prototype&&(S.prototype=void 0)}catch{}var k=s(S);return c(k,"source")||(k.source=J(T,typeof X=="string"?X:"")),S};Function.prototype.toString=p(function(){return t(this)&&R(this).source||a(this)},"toString")},741:d=>{var l=Math.ceil,U=Math.floor;d.exports=Math.trunc||function(Z){var F=+Z;return(F>0?U:l)(F)}},6043:(d,l,U)=>{var Z=U(9306),F=TypeError,t=function(c){var V,Q;this.promise=new c(function(a,n){if(V!==void 0||Q!==void 0)throw new F("Bad Promise constructor");V=a,Q=n}),this.resolve=Z(V),this.reject=Z(Q)};d.exports.f=function(c){return new t(c)}},2603:(d,l,U)=>{var Z=U(655);d.exports=function(F,t){return F===void 0?arguments.length<2?"":t:Z(F)}},4149:d=>{var l=RangeError;d.exports=function(U){if(U===U)return U;throw new l("NaN is not allowed")}},2360:(d,l,U)=>{var Z=U(8551),F=U(6801),t=U(8727),c=U(421),V=U(397),Q=U(4055),a=U(6119),n=">",s="<",R="prototype",N="script",h=a("IE_PROTO"),e=function(){},M=function(S){return s+N+n+S+s+"/"+N+n},J=function(S){S.write(M("")),S.close();var X=S.parentWindow.Object;return S=null,X},G=function(){var S=Q("iframe"),X="java"+N+":",B;return S.style.display="none",V.appendChild(S),S.src=String(X),B=S.contentWindow.document,B.open(),B.write(M("document.F=Object")),B.close(),B.F},T,p=function(){try{T=new ActiveXObject("htmlfile")}catch{}p=typeof document<"u"?document.domain&&T?J(T):G():J(T);for(var S=t.length;S--;)delete p[R][t[S]];return p()};c[h]=!0,d.exports=Object.create||function(S,X){var B;return S!==null?(e[R]=Z(S),B=new e,e[R]=null,B[h]=S):B=p(),X===void 0?B:F.f(B,X)}},6801:(d,l,U)=>{var Z=U(3724),F=U(8686),t=U(4913),c=U(8551),V=U(5397),Q=U(1072);l.f=Z&&!F?Object.defineProperties:function(a,n){c(a);for(var s=V(n),R=Q(n),N=R.length,h=0,e;N>h;)t.f(a,e=R[h++],s[e]);return a}},4913:(d,l,U)=>{var Z=U(3724),F=U(5917),t=U(8686),c=U(8551),V=U(6969),Q=TypeError,a=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s="enumerable",R="configurable",N="writable";l.f=Z?t?function(h,e,M){if(c(h),e=V(e),c(M),typeof h=="function"&&e==="prototype"&&"value"in M&&N in M&&!M[N]){var J=n(h,e);J&&J[N]&&(h[e]=M.value,M={configurable:R in M?M[R]:J[R],enumerable:s in M?M[s]:J[s],writable:!1})}return a(h,e,M)}:a:function(h,e,M){if(c(h),e=V(e),c(M),F)try{return a(h,e,M)}catch{}if("get"in M||"set"in M)throw new Q("Accessors not supported");return"value"in M&&(h[e]=M.value),h}},7347:(d,l,U)=>{var Z=U(3724),F=U(9565),t=U(8773),c=U(6980),V=U(5397),Q=U(6969),a=U(9297),n=U(5917),s=Object.getOwnPropertyDescriptor;l.f=Z?s:function(R,N){if(R=V(R),N=Q(N),n)try{return s(R,N)}catch{}if(a(R,N))return c(!F(t.f,R,N),R[N])}},8480:(d,l,U)=>{var Z=U(1828),F=U(8727),t=F.concat("length","prototype");l.f=Object.getOwnPropertyNames||function(c){return Z(c,t)}},3717:(d,l)=>{l.f=Object.getOwnPropertySymbols},2787:(d,l,U)=>{var Z=U(9297),F=U(4901),t=U(8981),c=U(6119),V=U(2211),Q=c("IE_PROTO"),a=Object,n=a.prototype;d.exports=V?a.getPrototypeOf:function(s){var R=t(s);if(Z(R,Q))return R[Q];var N=R.constructor;return F(N)&&R instanceof N?N.prototype:R instanceof a?n:null}},1625:(d,l,U)=>{var Z=U(9504);d.exports=Z({}.isPrototypeOf)},1828:(d,l,U)=>{var Z=U(9504),F=U(9297),t=U(5397),c=U(9617).indexOf,V=U(421),Q=Z([].push);d.exports=function(a,n){var s=t(a),R=0,N=[],h;for(h in s)!F(V,h)&&F(s,h)&&Q(N,h);for(;n.length>R;)F(s,h=n[R++])&&(~c(N,h)||Q(N,h));return N}},1072:(d,l,U)=>{var Z=U(1828),F=U(8727);d.exports=Object.keys||function(t){return Z(t,F)}},8773:(d,l)=>{var U={}.propertyIsEnumerable,Z=Object.getOwnPropertyDescriptor,F=Z&&!U.call({1:2},1);l.f=F?function(t){var c=Z(this,t);return!!c&&c.enumerable}:U},2967:(d,l,U)=>{var Z=U(6706),F=U(34),t=U(7750),c=U(3506);d.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var V=!1,Q={},a;try{a=Z(Object.prototype,"__proto__","set"),a(Q,[]),V=Q instanceof Array}catch{}return function(n,s){return t(n),c(s),F(n)&&(V?a(n,s):n.__proto__=s),n}}():void 0)},4270:(d,l,U)=>{var Z=U(9565),F=U(4901),t=U(34),c=TypeError;d.exports=function(V,Q){var a,n;if(Q==="string"&&F(a=V.toString)&&!t(n=Z(a,V))||F(a=V.valueOf)&&!t(n=Z(a,V))||Q!=="string"&&F(a=V.toString)&&!t(n=Z(a,V)))return n;throw new c("Can't convert object to primitive value")}},5031:(d,l,U)=>{var Z=U(7751),F=U(9504),t=U(8480),c=U(3717),V=U(8551),Q=F([].concat);d.exports=Z("Reflect","ownKeys")||function(a){var n=t.f(V(a)),s=c.f;return s?Q(n,s(a)):n}},8235:(d,l,U)=>{var Z=U(9504),F=U(9297),t=SyntaxError,c=parseInt,V=String.fromCharCode,Q=Z("".charAt),a=Z("".slice),n=Z(/./.exec),s={'\\"':'"',"\\\\":"\\","\\/":"/","\\b":"\b","\\f":"\f","\\n":`
|
|
2
2
|
`,"\\r":"\r","\\t":" "},R=/^[\da-f]{4}$/i,N=/^[\u0000-\u001F]$/;d.exports=function(h,e){for(var M=!0,J="";e<h.length;){var G=Q(h,e);if(G==="\\"){var T=a(h,e,e+2);if(F(s,T))J+=s[T],e+=2;else if(T==="\\u"){e+=2;var p=a(h,e,e+4);if(!n(R,p))throw new t("Bad Unicode escape at: "+e);J+=V(c(p,16)),e+=4}else throw new t('Unknown escape sequence: "'+T+'"')}else if(G==='"'){M=!1,e++;break}else{if(n(N,G))throw new t("Bad control character in string literal at: "+e);J+=G,e++}}if(M)throw new t("Unterminated string at: "+e);return{value:J,end:e}}},7750:(d,l,U)=>{var Z=U(4117),F=TypeError;d.exports=function(t){if(Z(t))throw new F("Can't call method on "+t);return t}},9286:(d,l,U)=>{var Z=U(4402),F=U(8469),t=Z.Set,c=Z.add;d.exports=function(V){var Q=new t;return F(V,function(a){c(Q,a)}),Q}},3440:(d,l,U)=>{var Z=U(7080),F=U(4402),t=U(9286),c=U(5170),V=U(3789),Q=U(8469),a=U(507),n=F.has,s=F.remove;d.exports=function(R){var N=Z(this),h=V(R),e=t(N);return c(N)<=h.size?Q(N,function(M){h.includes(M)&&s(e,M)}):a(h.getIterator(),function(M){n(N,M)&&s(e,M)}),e}},4402:(d,l,U)=>{var Z=U(9504),F=Set.prototype;d.exports={Set,add:Z(F.add),has:Z(F.has),remove:Z(F.delete),proto:F}},8750:(d,l,U)=>{var Z=U(7080),F=U(4402),t=U(5170),c=U(3789),V=U(8469),Q=U(507),a=F.Set,n=F.add,s=F.has;d.exports=function(R){var N=Z(this),h=c(R),e=new a;return t(N)>h.size?Q(h.getIterator(),function(M){s(N,M)&&n(e,M)}):V(N,function(M){h.includes(M)&&n(e,M)}),e}},4449:(d,l,U)=>{var Z=U(7080),F=U(4402).has,t=U(5170),c=U(3789),V=U(8469),Q=U(507),a=U(9539);d.exports=function(n){var s=Z(this),R=c(n);if(t(s)<=R.size)return V(s,function(h){if(R.includes(h))return!1},!0)!==!1;var N=R.getIterator();return Q(N,function(h){if(F(s,h))return a(N,"normal",!1)})!==!1}},3838:(d,l,U)=>{var Z=U(7080),F=U(5170),t=U(8469),c=U(3789);d.exports=function(V){var Q=Z(this),a=c(V);return F(Q)>a.size?!1:t(Q,function(n){if(!a.includes(n))return!1},!0)!==!1}},8527:(d,l,U)=>{var Z=U(7080),F=U(4402).has,t=U(5170),c=U(3789),V=U(507),Q=U(9539);d.exports=function(a){var n=Z(this),s=c(a);if(t(n)<s.size)return!1;var R=s.getIterator();return V(R,function(N){if(!F(n,N))return Q(R,"normal",!1)})!==!1}},8469:(d,l,U)=>{var Z=U(9504),F=U(507),t=U(4402),c=t.Set,V=t.proto,Q=Z(V.forEach),a=Z(V.keys),n=a(new c).next;d.exports=function(s,R,N){return N?F({iterator:a(s),next:n},R):Q(s,R)}},4916:(d,l,U)=>{var Z=U(7751),F=function(t){return{size:t,has:function(){return!1},keys:function(){return{next:function(){return{done:!0}}}}}};d.exports=function(t){var c=Z("Set");try{new c()[t](F(0));try{return new c()[t](F(-1)),!1}catch{return!0}}catch{return!1}}},5170:(d,l,U)=>{var Z=U(6706),F=U(4402);d.exports=Z(F.proto,"size","get")||function(t){return t.size}},3650:(d,l,U)=>{var Z=U(7080),F=U(4402),t=U(9286),c=U(3789),V=U(507),Q=F.add,a=F.has,n=F.remove;d.exports=function(s){var R=Z(this),N=c(s).getIterator(),h=t(R);return V(N,function(e){a(R,e)?n(h,e):Q(h,e)}),h}},4204:(d,l,U)=>{var Z=U(7080),F=U(4402).add,t=U(9286),c=U(3789),V=U(507);d.exports=function(Q){var a=Z(this),n=c(Q).getIterator(),s=t(a);return V(n,function(R){F(s,R)}),s}},6119:(d,l,U)=>{var Z=U(5745),F=U(3392),t=Z("keys");d.exports=function(c){return t[c]||(t[c]=F(c))}},7629:(d,l,U)=>{var Z=U(6395),F=U(4475),t=U(9433),c="__core-js_shared__",V=d.exports=F[c]||t(c,{});(V.versions||(V.versions=[])).push({version:"3.37.1",mode:Z?"pure":"global",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.37.1/LICENSE",source:"https://github.com/zloirock/core-js"})},5745:(d,l,U)=>{var Z=U(7629);d.exports=function(F,t){return Z[F]||(Z[F]=t||{})}},1548:(d,l,U)=>{var Z=U(4475),F=U(9039),t=U(7388),c=U(7290),V=U(516),Q=U(9088),a=Z.structuredClone;d.exports=!!a&&!F(function(){if(V&&t>92||Q&&t>94||c&&t>97)return!1;var n=new ArrayBuffer(8),s=a(n,{transfer:[n]});return n.byteLength!==0||s.byteLength!==8})},4495:(d,l,U)=>{var Z=U(7388),F=U(9039),t=U(4475),c=t.String;d.exports=!!Object.getOwnPropertySymbols&&!F(function(){var V=Symbol("symbol detection");return!c(V)||!(Object(V)instanceof Symbol)||!Symbol.sham&&Z&&Z<41})},5610:(d,l,U)=>{var Z=U(1291),F=Math.max,t=Math.min;d.exports=function(c,V){var Q=Z(c);return Q<0?F(Q+V,0):t(Q,V)}},5854:(d,l,U)=>{var Z=U(2777),F=TypeError;d.exports=function(t){var c=Z(t,"number");if(typeof c=="number")throw new F("Can't convert number to bigint");return BigInt(c)}},7696:(d,l,U)=>{var Z=U(1291),F=U(8014),t=RangeError;d.exports=function(c){if(c===void 0)return 0;var V=Z(c),Q=F(V);if(V!==Q)throw new t("Wrong length or index");return Q}},5397:(d,l,U)=>{var Z=U(7055),F=U(7750);d.exports=function(t){return Z(F(t))}},1291:(d,l,U)=>{var Z=U(741);d.exports=function(F){var t=+F;return t!==t||t===0?0:Z(t)}},8014:(d,l,U)=>{var Z=U(1291),F=Math.min;d.exports=function(t){var c=Z(t);return c>0?F(c,9007199254740991):0}},8981:(d,l,U)=>{var Z=U(7750),F=Object;d.exports=function(t){return F(Z(t))}},9590:(d,l,U)=>{var Z=U(1291),F=RangeError;d.exports=function(t){var c=Z(t);if(c<0)throw new F("The argument can't be less than 0");return c}},2777:(d,l,U)=>{var Z=U(9565),F=U(34),t=U(757),c=U(5966),V=U(4270),Q=U(8227),a=TypeError,n=Q("toPrimitive");d.exports=function(s,R){if(!F(s)||t(s))return s;var N=c(s,n),h;if(N){if(R===void 0&&(R="default"),h=Z(N,s,R),!F(h)||t(h))return h;throw new a("Can't convert object to primitive value")}return R===void 0&&(R="number"),V(s,R)}},6969:(d,l,U)=>{var Z=U(2777),F=U(757);d.exports=function(t){var c=Z(t,"string");return F(c)?c:c+""}},2140:(d,l,U)=>{var Z=U(8227),F=Z("toStringTag"),t={};t[F]="z",d.exports=String(t)==="[object z]"},655:(d,l,U)=>{var Z=U(6955),F=String;d.exports=function(t){if(Z(t)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return F(t)}},9714:(d,l,U)=>{var Z=U(9088);d.exports=function(F){try{if(Z)return Function('return require("'+F+'")')()}catch{}}},6823:d=>{var l=String;d.exports=function(U){try{return l(U)}catch{return"Object"}}},3392:(d,l,U)=>{var Z=U(9504),F=0,t=Math.random(),c=Z(1 .toString);d.exports=function(V){return"Symbol("+(V===void 0?"":V)+")_"+c(++F+t,36)}},7040:(d,l,U)=>{var Z=U(4495);d.exports=Z&&!Symbol.sham&&typeof Symbol.iterator=="symbol"},8686:(d,l,U)=>{var Z=U(3724),F=U(9039);d.exports=Z&&F(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42})},2812:d=>{var l=TypeError;d.exports=function(U,Z){if(U<Z)throw new l("Not enough arguments");return U}},8622:(d,l,U)=>{var Z=U(4475),F=U(4901),t=Z.WeakMap;d.exports=F(t)&&/native code/.test(String(t))},8227:(d,l,U)=>{var Z=U(4475),F=U(5745),t=U(9297),c=U(3392),V=U(4495),Q=U(7040),a=Z.Symbol,n=F("wks"),s=Q?a.for||a:a&&a.withoutSetter||c;d.exports=function(R){return t(n,R)||(n[R]=V&&t(a,R)?a[R]:s("Symbol."+R)),n[R]}},6573:(d,l,U)=>{var Z=U(3724),F=U(2106),t=U(3238),c=ArrayBuffer.prototype;Z&&!("detached"in c)&&F(c,"detached",{configurable:!0,get:function(){return t(this)}})},7936:(d,l,U)=>{var Z=U(6518),F=U(5636);F&&Z({target:"ArrayBuffer",proto:!0},{transferToFixedLength:function(){return F(this,arguments.length?arguments[0]:void 0,!1)}})},8100:(d,l,U)=>{var Z=U(6518),F=U(5636);F&&Z({target:"ArrayBuffer",proto:!0},{transfer:function(){return F(this,arguments.length?arguments[0]:void 0,!0)}})},4114:(d,l,U)=>{var Z=U(6518),F=U(8981),t=U(6198),c=U(4527),V=U(6837),Q=U(9039),a=Q(function(){return[].push.call({length:4294967296},1)!==4294967297}),n=function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(R){return R instanceof TypeError}},s=a||!n();Z({target:"Array",proto:!0,arity:1,forced:s},{push:function(R){var N=F(this),h=t(N),e=arguments.length;V(h+e);for(var M=0;M<e;M++)N[h]=arguments[M],h++;return c(N,h),h}})},4628:(d,l,U)=>{var Z=U(6518),F=U(6043);Z({target:"Promise",stat:!0},{withResolvers:function(){var t=F.f(this);return{promise:t.promise,resolve:t.resolve,reject:t.reject}}})},7642:(d,l,U)=>{var Z=U(6518),F=U(3440),t=U(4916);Z({target:"Set",proto:!0,real:!0,forced:!t("difference")},{difference:F})},8004:(d,l,U)=>{var Z=U(6518),F=U(9039),t=U(8750),c=U(4916),V=!c("intersection")||F(function(){return String(Array.from(new Set([1,2,3]).intersection(new Set([3,2]))))!=="3,2"});Z({target:"Set",proto:!0,real:!0,forced:V},{intersection:t})},3853:(d,l,U)=>{var Z=U(6518),F=U(4449),t=U(4916);Z({target:"Set",proto:!0,real:!0,forced:!t("isDisjointFrom")},{isDisjointFrom:F})},5876:(d,l,U)=>{var Z=U(6518),F=U(3838),t=U(4916);Z({target:"Set",proto:!0,real:!0,forced:!t("isSubsetOf")},{isSubsetOf:F})},2475:(d,l,U)=>{var Z=U(6518),F=U(8527),t=U(4916);Z({target:"Set",proto:!0,real:!0,forced:!t("isSupersetOf")},{isSupersetOf:F})},5024:(d,l,U)=>{var Z=U(6518),F=U(3650),t=U(4916);Z({target:"Set",proto:!0,real:!0,forced:!t("symmetricDifference")},{symmetricDifference:F})},1698:(d,l,U)=>{var Z=U(6518),F=U(4204),t=U(4916);Z({target:"Set",proto:!0,real:!0,forced:!t("union")},{union:F})},7467:(d,l,U)=>{var Z=U(7628),F=U(4644),t=F.aTypedArray,c=F.exportTypedArrayMethod,V=F.getTypedArrayConstructor;c("toReversed",function(){return Z(t(this),V(this))})},4732:(d,l,U)=>{var Z=U(4644),F=U(9504),t=U(9306),c=U(5370),V=Z.aTypedArray,Q=Z.getTypedArrayConstructor,a=Z.exportTypedArrayMethod,n=F(Z.TypedArrayPrototype.sort);a("toSorted",function(s){s!==void 0&&t(s);var R=V(this),N=c(Q(R),R);return n(N,s)})},9577:(d,l,U)=>{var Z=U(9928),F=U(4644),t=U(1108),c=U(1291),V=U(5854),Q=F.aTypedArray,a=F.getTypedArrayConstructor,n=F.exportTypedArrayMethod,s=!!function(){try{new Int8Array(1).with(2,{valueOf:function(){throw 8}})}catch(R){return R===8}}();n("with",function(R,N){var h=Q(this),e=c(R),M=t(h)?V(N):+N;return Z(h,a(h),e,M)},!s)},8992:(d,l,U)=>{var Z=U(6518),F=U(4475),t=U(679),c=U(8551),V=U(4901),Q=U(2787),a=U(2106),n=U(4659),s=U(9039),R=U(9297),N=U(8227),h=U(7657).IteratorPrototype,e=U(3724),M=U(6395),J="constructor",G="Iterator",T=N("toStringTag"),p=TypeError,S=F[G],X=M||!V(S)||S.prototype!==h||!s(function(){S({})}),B=function(){if(t(this,h),Q(this)===h)throw new p("Abstract class Iterator not directly constructable")},k=function(Y,o){e?a(h,Y,{configurable:!0,get:function(){return o},set:function(y){if(c(this),this===h)throw new p("You can't redefine this property");R(this,Y)?this[Y]=y:n(this,Y,y)}}):h[Y]=o};R(h,T)||k(T,G),(X||!R(h,J)||h[J]===Object)&&k(J,B),B.prototype=h,Z({global:!0,constructor:!0,forced:X},{Iterator:B})},4743:(d,l,U)=>{var Z=U(6518),F=U(9565),t=U(8551),c=U(1767),V=U(4149),Q=U(9590),a=U(9462),n=U(6395),s=a(function(){for(var R=this.iterator,N=this.next,h,e;this.remaining;)if(this.remaining--,h=t(F(N,R)),e=this.done=!!h.done,e)return;if(h=t(F(N,R)),e=this.done=!!h.done,!e)return h.value});Z({target:"Iterator",proto:!0,real:!0,forced:n},{drop:function(R){t(this);var N=Q(V(+R));return new s(c(this),{remaining:N})}})},3215:(d,l,U)=>{var Z=U(6518),F=U(2652),t=U(9306),c=U(8551),V=U(1767);Z({target:"Iterator",proto:!0,real:!0},{every:function(Q){c(this),t(Q);var a=V(this),n=0;return!F(a,function(s,R){if(!Q(s,n++))return R()},{IS_RECORD:!0,INTERRUPTED:!0}).stopped}})},4520:(d,l,U)=>{var Z=U(6518),F=U(9565),t=U(9306),c=U(8551),V=U(1767),Q=U(9462),a=U(6319),n=U(6395),s=Q(function(){for(var R=this.iterator,N=this.predicate,h=this.next,e,M,J;;){if(e=c(F(h,R)),M=this.done=!!e.done,M)return;if(J=e.value,a(R,N,[J,this.counter++],!0))return J}});Z({target:"Iterator",proto:!0,real:!0,forced:n},{filter:function(R){return c(this),t(R),new s(V(this),{predicate:R})}})},670:(d,l,U)=>{var Z=U(6518),F=U(9565),t=U(9306),c=U(8551),V=U(1767),Q=U(8646),a=U(9462),n=U(9539),s=U(6395),R=a(function(){for(var N=this.iterator,h=this.mapper,e,M;;){if(M=this.inner)try{if(e=c(F(M.next,M.iterator)),!e.done)return e.value;this.inner=null}catch(J){n(N,"throw",J)}if(e=c(F(this.next,N)),this.done=!!e.done)return;try{this.inner=Q(h(e.value,this.counter++),!1)}catch(J){n(N,"throw",J)}}});Z({target:"Iterator",proto:!0,real:!0,forced:s},{flatMap:function(N){return c(this),t(N),new R(V(this),{mapper:N,inner:null})}})},1454:(d,l,U)=>{var Z=U(6518),F=U(713),t=U(6395);Z({target:"Iterator",proto:!0,real:!0,forced:t},{map:F})},7550:(d,l,U)=>{var Z=U(6518),F=U(2652),t=U(9306),c=U(8551),V=U(1767);Z({target:"Iterator",proto:!0,real:!0},{some:function(Q){c(this),t(Q);var a=V(this),n=0;return F(a,function(s,R){if(Q(s,n++))return R()},{IS_RECORD:!0,INTERRUPTED:!0}).stopped}})},8335:(d,l,U)=>{var Z=U(6518),F=U(3724),t=U(4475),c=U(7751),V=U(9504),Q=U(9565),a=U(4901),n=U(34),s=U(4376),R=U(9297),N=U(655),h=U(6198),e=U(4659),M=U(9039),J=U(8235),G=U(4495),T=t.JSON,p=t.Number,S=t.SyntaxError,X=T&&T.parse,B=c("Object","keys"),k=Object.getOwnPropertyDescriptor,Y=V("".charAt),o=V("".slice),y=V(/./.exec),D=V([].push),I=/^\d$/,j=/^[1-9]$/,x=/^(?:-|\d)$/,u=/^[\t\n\r ]$/,E=0,A=1,Wl=function(w,L){w=N(w);var C=new Vl(w,0),P=C.parse(),Ql=P.value,g=C.skip(u,P.end);if(g<w.length)throw new S('Unexpected extra character: "'+Y(w,g)+'" after the parsed data at: '+g);return a(L)?ml({"":Ql},"",L,P):Ql},ml=function(w,L,C,P){var Ql=w[L],g=P&&Ql===P.value,al=g&&typeof P.source=="string"?{source:P.source}:{},Tl,xU,Al,Il,e0;if(n(Ql)){var Ub=s(Ql),fW=g?P.nodes:Ub?[]:{};if(Ub)for(Tl=fW.length,Al=h(Ql),Il=0;Il<Al;Il++)dU(Ql,Il,ml(Ql,""+Il,C,Il<Tl?fW[Il]:void 0));else for(xU=B(Ql),Al=h(xU),Il=0;Il<Al;Il++)e0=xU[Il],dU(Ql,e0,ml(Ql,e0,C,R(fW,e0)?fW[e0]:void 0))}return Q(C,w,L,Ql,al)},dU=function(w,L,C){if(F){var P=k(w,L);if(P&&!P.configurable)return}C===void 0?delete w[L]:e(w,L,C)},Fl=function(w,L,C,P){this.value=w,this.end=L,this.source=C,this.nodes=P},Vl=function(w,L){this.source=w,this.index=L};Vl.prototype={fork:function(w){return new Vl(this.source,w)},parse:function(){var w=this.source,L=this.skip(u,this.index),C=this.fork(L),P=Y(w,L);if(y(x,P))return C.number();switch(P){case"{":return C.object();case"[":return C.array();case'"':return C.string();case"t":return C.keyword(!0);case"f":return C.keyword(!1);case"n":return C.keyword(null)}throw new S('Unexpected character: "'+P+'" at: '+L)},node:function(w,L,C,P,Ql){return new Fl(L,P,w?null:o(this.source,C,P),Ql)},object:function(){for(var w=this.source,L=this.index+1,C=!1,P={},Ql={};L<w.length;){if(L=this.until(['"',"}"],L),Y(w,L)==="}"&&!C){L++;break}var g=this.fork(L).string(),al=g.value;L=g.end,L=this.until([":"],L)+1,L=this.skip(u,L),g=this.fork(L).parse(),e(Ql,al,g),e(P,al,g.value),L=this.until([",","}"],g.end);var Tl=Y(w,L);if(Tl===",")C=!0,L++;else if(Tl==="}"){L++;break}}return this.node(A,P,this.index,L,Ql)},array:function(){for(var w=this.source,L=this.index+1,C=!1,P=[],Ql=[];L<w.length;){if(L=this.skip(u,L),Y(w,L)==="]"&&!C){L++;break}var g=this.fork(L).parse();if(D(Ql,g),D(P,g.value),L=this.until([",","]"],g.end),Y(w,L)===",")C=!0,L++;else if(Y(w,L)==="]"){L++;break}}return this.node(A,P,this.index,L,Ql)},string:function(){var w=this.index,L=J(this.source,this.index+1);return this.node(E,L.value,w,L.end)},number:function(){var w=this.source,L=this.index,C=L;if(Y(w,C)==="-"&&C++,Y(w,C)==="0")C++;else if(y(j,Y(w,C)))C=this.skip(I,++C);else throw new S("Failed to parse number at: "+C);if(Y(w,C)==="."&&(C=this.skip(I,++C)),Y(w,C)==="e"||Y(w,C)==="E"){C++,(Y(w,C)==="+"||Y(w,C)==="-")&&C++;var P=C;if(C=this.skip(I,C),P===C)throw new S("Failed to parse number's exponent value at: "+C)}return this.node(E,p(o(w,L,C)),L,C)},keyword:function(w){var L=""+w,C=this.index,P=C+L.length;if(o(this.source,C,P)!==L)throw new S("Failed to parse value at: "+C);return this.node(E,w,C,P)},skip:function(w,L){for(var C=this.source;L<C.length&&y(w,Y(C,L));L++);return L},until:function(w,L){L=this.skip(u,L);for(var C=Y(this.source,L),P=0;P<w.length;P++)if(w[P]===C)return L;throw new S('Unexpected character: "'+C+'" at: '+L)}};var Cd=M(function(){var w="9007199254740993",L;return X(w,function(C,P,Ql){L=Ql.source}),L!==w}),hU=G&&!M(function(){return 1/X("-0 ")!==-1/0});Z({target:"JSON",stat:!0,forced:Cd},{parse:function(w,L){return hU&&!a(L)?X(w):Wl(w,L)}})},3375:(d,l,U)=>{U(7642)},9225:(d,l,U)=>{U(8004)},3972:(d,l,U)=>{U(3853)},9209:(d,l,U)=>{U(5876)},5714:(d,l,U)=>{U(2475)},7561:(d,l,U)=>{U(5024)},6197:(d,l,U)=>{U(1698)},4979:(d,l,U)=>{var Z=U(6518),F=U(4475),t=U(7751),c=U(6980),V=U(4913).f,Q=U(9297),a=U(679),n=U(3167),s=U(2603),R=U(5002),N=U(6193),h=U(3724),e=U(6395),M="DOMException",J=t("Error"),G=t(M),T=function(){a(this,p);var x=arguments.length,u=s(x<1?void 0:arguments[0]),E=s(x<2?void 0:arguments[1],"Error"),A=new G(u,E),Wl=new J(u);return Wl.name=M,V(A,"stack",c(1,N(Wl.stack,1))),n(A,this,T),A},p=T.prototype=G.prototype,S="stack"in new J(M),X="stack"in new G(1,2),B=G&&h&&Object.getOwnPropertyDescriptor(F,M),k=!!B&&!(B.writable&&B.configurable),Y=S&&!k&&!X;Z({global:!0,constructor:!0,forced:e||Y},{DOMException:Y?T:G});var o=t(M),y=o.prototype;if(y.constructor!==o){e||V(y,"constructor",c(1,o));for(var D in R)if(Q(R,D)){var I=R[D],j=I.s;Q(o,j)||V(o,j,c(6,I.c))}}},4603:(d,l,U)=>{var Z=U(6840),F=U(9504),t=U(655),c=U(2812),V=URLSearchParams,Q=V.prototype,a=F(Q.append),n=F(Q.delete),s=F(Q.forEach),R=F([].push),N=new V("a=1&a=2&b=3");N.delete("a",1),N.delete("b",void 0),N+""!="a=2"&&Z(Q,"delete",function(h){var e=arguments.length,M=e<2?void 0:arguments[1];if(e&&M===void 0)return n(this,h);var J=[];s(this,function(Y,o){R(J,{key:o,value:Y})}),c(e,1);for(var G=t(h),T=t(M),p=0,S=0,X=!1,B=J.length,k;p<B;)k=J[p++],X||k.key===G?(X=!0,n(this,k.key)):S++;for(;S<B;)k=J[S++],k.key===G&&k.value===T||a(this,k.key,k.value)},{enumerable:!0,unsafe:!0})},7566:(d,l,U)=>{var Z=U(6840),F=U(9504),t=U(655),c=U(2812),V=URLSearchParams,Q=V.prototype,a=F(Q.getAll),n=F(Q.has),s=new V("a=1");(s.has("a",2)||!s.has("a",void 0))&&Z(Q,"has",function(R){var N=arguments.length,h=N<2?void 0:arguments[1];if(N&&h===void 0)return n(this,R);var e=a(this,R);c(N,1);for(var M=t(h),J=0;J<e.length;)if(e[J++]===M)return!0;return!1},{enumerable:!0,unsafe:!0})},8721:(d,l,U)=>{var Z=U(3724),F=U(9504),t=U(2106),c=URLSearchParams.prototype,V=F(c.forEach);Z&&!("size"in c)&&t(c,"size",{get:function(){var Q=0;return V(this,function(){Q++}),Q},configurable:!0,enumerable:!0})}},cb={};function Ul(d){var l=cb[d];if(l!==void 0)return l.exports;var U=cb[d]={exports:{}};return OM[d].call(U.exports,U,U.exports,Ul),U.exports}Ul.d=(d,l)=>{for(var U in l)Ul.o(l,U)&&!Ul.o(d,U)&&Object.defineProperty(d,U,{enumerable:!0,get:l[U]})};Ul.o=(d,l)=>Object.prototype.hasOwnProperty.call(d,l);var K=globalThis.pdfjsLib={};Ul.d(K,{AbortException:()=>yF,AnnotationEditorLayer:()=>UT,AnnotationEditorParamsType:()=>v,AnnotationEditorType:()=>$,AnnotationEditorUIManager:()=>xW,AnnotationLayer:()=>AG,AnnotationMode:()=>aZ,CMapCompressionType:()=>Ai,ColorPicker:()=>M2,DOMSVGFactory:()=>gh,DrawLayer:()=>dT,FeatureTest:()=>aU,GlobalWorkerOptions:()=>b0,ImageKind:()=>bQ,InvalidPDFException:()=>Ve,MissingPDFException:()=>oF,OPS:()=>EU,Outliner:()=>ZN,PDFDataRangeTransport:()=>_e,PDFDateString:()=>be,PDFWorker:()=>OQ,PasswordResponses:()=>HM,PermissionFlag:()=>vM,PixelsPerInch:()=>h0,RenderingCancelledException:()=>Kh,TextLayer:()=>In,UnexpectedResponseException:()=>hs,Util:()=>r,VerbosityLevel:()=>is,XfaLayer:()=>l2,build:()=>uG,createValidAbsoluteUrl:()=>_M,fetchData:()=>Js,getDocument:()=>mG,getFilenameFromUrl:()=>VJ,getPdfFilenameFromUrl:()=>QJ,getXfaPageViewport:()=>aJ,isDataScheme:()=>vh,isPdfFile:()=>Hh,noContextMenu:()=>nU,normalizeUnicode:()=>ZJ,renderTextLayer:()=>QG,setLayerDimensions:()=>BF,shadow:()=>ll,updateTextLayer:()=>aG,version:()=>BG});Ul(4114);Ul(6573);Ul(8100);Ul(7936);Ul(7467);Ul(4732);Ul(9577);Ul(4603);Ul(7566);Ul(8721);const fl=typeof process=="object"&&process+""=="[object process]"&&!process.versions.nw&&!(process.versions.electron&&process.type&&process.type!=="browser"),We=[1,0,0,1,0,0],fi=[.001,0,0,.001,0,0],gM=1e7,Ys=1.35,SU={ANY:1,DISPLAY:2,PRINT:4,SAVE:8,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,OPLIST:256},aZ={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3},KM="pdfjs_internal_editor_",$={DISABLE:-1,NONE:0,FREETEXT:3,HIGHLIGHT:9,STAMP:13,INK:15},v={RESIZE:1,CREATE:2,FREETEXT_SIZE:11,FREETEXT_COLOR:12,FREETEXT_OPACITY:13,INK_COLOR:21,INK_THICKNESS:22,INK_OPACITY:23,HIGHLIGHT_COLOR:31,HIGHLIGHT_DEFAULT_COLOR:32,HIGHLIGHT_THICKNESS:33,HIGHLIGHT_FREE:34,HIGHLIGHT_SHOW_ALL:35},vM={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},xl={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},bQ={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},el={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},J0={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5},is={ERRORS:0,WARNINGS:1,INFOS:5},Ai={NONE:0,BINARY:1},EU={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},HM={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};let Rs=is.WARNINGS;function PM(d){Number.isInteger(d)&&(Rs=d)}function fM(){return Rs}function Ns(d){Rs>=is.INFOS&&console.log(`Info: ${d}`)}function f(d){Rs>=is.WARNINGS&&console.log(`Warning: ${d}`)}function Zl(d){throw new Error(d)}function Jl(d,l){d||Zl(l)}function AM(d){switch(d==null?void 0:d.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}function _M(d,l=null,U=null){if(!d)return null;try{if(U&&typeof d=="string"){if(U.addDefaultProtocol&&d.startsWith("www.")){const F=d.match(/\./g);(F==null?void 0:F.length)>=2&&(d=`http://${d}`)}if(U.tryConvertEncoding)try{d=dJ(d)}catch{}}const Z=l?new URL(d,l):new URL(d);if(AM(Z))return Z}catch{}return null}function ll(d,l,U,Z=!1){return Object.defineProperty(d,l,{value:U,enumerable:!Z,configurable:!0,writable:!1}),U}const BZ=function(){function d(l,U){this.constructor===d&&Zl("Cannot initialize BaseException."),this.message=l,this.name=U}return d.prototype=new Error,d.constructor=d,d}();class _i extends BZ{constructor(l,U){super(l,"PasswordException"),this.code=U}}class qi extends BZ{constructor(l,U){super(l,"UnknownErrorException"),this.details=U}}let Ve=class extends BZ{constructor(d){super(d,"InvalidPDFException")}},oF=class extends BZ{constructor(d){super(d,"MissingPDFException")}},hs=class extends BZ{constructor(d,l){super(d,"UnexpectedResponseException"),this.status=l}};class qM extends BZ{constructor(l){super(l,"FormatError")}}let yF=class extends BZ{constructor(d){super(d,"AbortException")}};function Qe(d){(typeof d!="object"||(d==null?void 0:d.length)===void 0)&&Zl("Invalid argument for bytesToString");const l=d.length,U=8192;if(l<U)return String.fromCharCode.apply(null,d);const Z=[];for(let F=0;F<l;F+=U){const t=Math.min(F+U,l),c=d.subarray(F,t);Z.push(String.fromCharCode.apply(null,c))}return Z.join("")}function bs(d){typeof d!="string"&&Zl("Invalid argument for stringToBytes");const l=d.length,U=new Uint8Array(l);for(let Z=0;Z<l;++Z)U[Z]=d.charCodeAt(Z)&255;return U}function $M(d){return String.fromCharCode(d>>24&255,d>>16&255,d>>8&255,d&255)}function jh(d){const l=Object.create(null);for(const[U,Z]of d)l[U]=Z;return l}function lJ(){const d=new Uint8Array(4);return d[0]=1,new Uint32Array(d.buffer,0,1)[0]===1}function UJ(){try{return new Function(""),!0}catch{return!1}}class aU{static get isLittleEndian(){return ll(this,"isLittleEndian",lJ())}static get isEvalSupported(){return ll(this,"isEvalSupported",UJ())}static get isOffscreenCanvasSupported(){return ll(this,"isOffscreenCanvasSupported",typeof OffscreenCanvas<"u")}static get platform(){return typeof navigator<"u"&&typeof(navigator==null?void 0:navigator.platform)=="string"?ll(this,"platform",{isMac:navigator.platform.includes("Mac")}):ll(this,"platform",{isMac:!1})}static get isCSSRoundSupported(){var l,U;return ll(this,"isCSSRoundSupported",(U=(l=globalThis.CSS)==null?void 0:l.supports)==null?void 0:U.call(l,"width: round(1.5px, 1px)"))}}const ps=Array.from(Array(256).keys(),d=>d.toString(16).padStart(2,"0"));var G0,AW,_W,qW,Bs;let r=(AW=class{static makeHexColor(d,l,U){return`#${ps[d]}${ps[l]}${ps[U]}`}static scaleMinMax(d,l){let U;d[0]?(d[0]<0&&(U=l[0],l[0]=l[2],l[2]=U),l[0]*=d[0],l[2]*=d[0],d[3]<0&&(U=l[1],l[1]=l[3],l[3]=U),l[1]*=d[3],l[3]*=d[3]):(U=l[0],l[0]=l[1],l[1]=U,U=l[2],l[2]=l[3],l[3]=U,d[1]<0&&(U=l[1],l[1]=l[3],l[3]=U),l[1]*=d[1],l[3]*=d[1],d[2]<0&&(U=l[0],l[0]=l[2],l[2]=U),l[0]*=d[2],l[2]*=d[2]),l[0]+=d[4],l[1]+=d[5],l[2]+=d[4],l[3]+=d[5]}static transform(d,l){return[d[0]*l[0]+d[2]*l[1],d[1]*l[0]+d[3]*l[1],d[0]*l[2]+d[2]*l[3],d[1]*l[2]+d[3]*l[3],d[0]*l[4]+d[2]*l[5]+d[4],d[1]*l[4]+d[3]*l[5]+d[5]]}static applyTransform(d,l){const U=d[0]*l[0]+d[1]*l[2]+l[4],Z=d[0]*l[1]+d[1]*l[3]+l[5];return[U,Z]}static applyInverseTransform(d,l){const U=l[0]*l[3]-l[1]*l[2],Z=(d[0]*l[3]-d[1]*l[2]+l[2]*l[5]-l[4]*l[3])/U,F=(-d[0]*l[1]+d[1]*l[0]+l[4]*l[1]-l[5]*l[0])/U;return[Z,F]}static getAxialAlignedBoundingBox(d,l){const U=this.applyTransform(d,l),Z=this.applyTransform(d.slice(2,4),l),F=this.applyTransform([d[0],d[3]],l),t=this.applyTransform([d[2],d[1]],l);return[Math.min(U[0],Z[0],F[0],t[0]),Math.min(U[1],Z[1],F[1],t[1]),Math.max(U[0],Z[0],F[0],t[0]),Math.max(U[1],Z[1],F[1],t[1])]}static inverseTransform(d){const l=d[0]*d[3]-d[1]*d[2];return[d[3]/l,-d[1]/l,-d[2]/l,d[0]/l,(d[2]*d[5]-d[4]*d[3])/l,(d[4]*d[1]-d[5]*d[0])/l]}static singularValueDecompose2dScale(d){const l=[d[0],d[2],d[1],d[3]],U=d[0]*l[0]+d[1]*l[2],Z=d[0]*l[1]+d[1]*l[3],F=d[2]*l[0]+d[3]*l[2],t=d[2]*l[1]+d[3]*l[3],c=(U+t)/2,V=Math.sqrt((U+t)**2-4*(U*t-F*Z))/2,Q=c+V||1,a=c-V||1;return[Math.sqrt(Q),Math.sqrt(a)]}static normalizeRect(d){const l=d.slice(0);return d[0]>d[2]&&(l[0]=d[2],l[2]=d[0]),d[1]>d[3]&&(l[1]=d[3],l[3]=d[1]),l}static intersect(d,l){const U=Math.max(Math.min(d[0],d[2]),Math.min(l[0],l[2])),Z=Math.min(Math.max(d[0],d[2]),Math.max(l[0],l[2]));if(U>Z)return null;const F=Math.max(Math.min(d[1],d[3]),Math.min(l[1],l[3])),t=Math.min(Math.max(d[1],d[3]),Math.max(l[1],l[3]));return F>t?null:[U,F,Z,t]}static bezierBoundingBox(d,l,U,Z,F,t,c,V,Q){return Q?(Q[0]=Math.min(Q[0],d,c),Q[1]=Math.min(Q[1],l,V),Q[2]=Math.max(Q[2],d,c),Q[3]=Math.max(Q[3],l,V)):Q=[Math.min(d,c),Math.min(l,V),Math.max(d,c),Math.max(l,V)],b(this,qW,Bs).call(this,d,U,F,c,l,Z,t,V,3*(-d+3*(U-F)+c),6*(d-2*U+F),3*(U-d),Q),b(this,qW,Bs).call(this,d,U,F,c,l,Z,t,V,3*(-l+3*(Z-t)+V),6*(l-2*Z+t),3*(Z-l),Q),Q}},G0=new WeakSet,_W=function(d,l,U,Z,F,t,c,V,Q,a){if(Q<=0||Q>=1)return;const n=1-Q,s=Q*Q,R=s*Q,N=n*(n*(n*d+3*Q*l)+3*s*U)+R*Z,h=n*(n*(n*F+3*Q*t)+3*s*c)+R*V;a[0]=Math.min(a[0],N),a[1]=Math.min(a[1],h),a[2]=Math.max(a[2],N),a[3]=Math.max(a[3],h)},qW=new WeakSet,Bs=function(d,l,U,Z,F,t,c,V,Q,a,n,s){if(Math.abs(Q)<1e-12){Math.abs(a)>=1e-12&&b(this,G0,_W).call(this,d,l,U,Z,F,t,c,V,-n/a,s);return}const R=a**2-4*n*Q;if(R<0)return;const N=Math.sqrt(R),h=2*Q;b(this,G0,_W).call(this,d,l,U,Z,F,t,c,V,(-a+N)/h,s),b(this,G0,_W).call(this,d,l,U,Z,F,t,c,V,(-a-N)/h,s)},i(AW,G0),i(AW,qW),AW);function dJ(d){return decodeURIComponent(escape(d))}let us=null,Wb=null;function ZJ(d){return us||(us=/([\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,Wb=new Map([["ſt","ſt"]])),d.replaceAll(us,(l,U,Z)=>U?U.normalize("NFKC"):Wb.get(Z))}function FJ(){if(typeof crypto<"u"&&typeof(crypto==null?void 0:crypto.randomUUID)=="function")return crypto.randomUUID();const d=new Uint8Array(32);if(typeof crypto<"u"&&typeof(crypto==null?void 0:crypto.getRandomValues)=="function")crypto.getRandomValues(d);else for(let l=0;l<32;l++)d[l]=Math.floor(Math.random()*255);return Qe(d)}const ae="pdfjs_internal_id_",cd={BEZIER_CURVE_TO:0,MOVE_TO:1,LINE_TO:2,QUADRATIC_CURVE_TO:3,RESTORE:4,SAVE:5,SCALE:6,TRANSFORM:7,TRANSLATE:8};Ul(4628);Ul(1454);Ul(3375);Ul(9225);Ul(3972);Ul(9209);Ul(5714);Ul(7561);Ul(6197);Ul(4979);Ul(8992);Ul(4743);Ul(3215);Ul(7550);Ul(8335);Ul(4520);class ms{constructor(){this.constructor===ms&&Zl("Cannot initialize BaseFilterFactory.")}addFilter(l){return"none"}addHCMFilter(l,U){return"none"}addAlphaFilter(l){return"none"}addLuminosityFilter(l){return"none"}addHighlightHCMFilter(l,U,Z,F,t){return"none"}destroy(l=!1){}}var mQ;const tJ=class ne{constructor({enableHWA:l=!1}={}){i(this,mQ,!1),this.constructor===ne&&Zl("Cannot initialize BaseCanvasFactory."),m(this,mQ,l)}create(l,U){if(l<=0||U<=0)throw new Error("Invalid canvas size");const Z=this._createCanvas(l,U);return{canvas:Z,context:Z.getContext("2d",{willReadFrequently:!W(this,mQ)})}}reset(l,U,Z){if(!l.canvas)throw new Error("Canvas is not specified");if(U<=0||Z<=0)throw new Error("Invalid canvas size");l.canvas.width=U,l.canvas.height=Z}destroy(l){if(!l.canvas)throw new Error("Canvas is not specified");l.canvas.width=0,l.canvas.height=0,l.canvas=null,l.context=null}_createCanvas(l,U){Zl("Abstract method `_createCanvas` called.")}};mQ=new WeakMap;let se=tJ;class es{constructor({baseUrl:l=null,isCompressed:U=!0}){this.constructor===es&&Zl("Cannot initialize BaseCMapReaderFactory."),this.baseUrl=l,this.isCompressed=U}async fetch({name:l}){if(!this.baseUrl)throw new Error('The CMap "baseUrl" parameter must be specified, ensure that the "cMapUrl" and "cMapPacked" API parameters are provided.');if(!l)throw new Error("CMap name must be specified.");const U=this.baseUrl+l+(this.isCompressed?".bcmap":""),Z=this.isCompressed?Ai.BINARY:Ai.NONE;return this._fetchData(U,Z).catch(F=>{throw new Error(`Unable to load ${this.isCompressed?"binary ":""}CMap at: ${U}`)})}_fetchData(l,U){Zl("Abstract method `_fetchData` called.")}}class Ms{constructor({baseUrl:l=null}){this.constructor===Ms&&Zl("Cannot initialize BaseStandardFontDataFactory."),this.baseUrl=l}async fetch({filename:l}){if(!this.baseUrl)throw new Error('The standard font "baseUrl" parameter must be specified, ensure that the "standardFontDataUrl" API parameter is provided.');if(!l)throw new Error("Font filename must be specified.");const U=`${this.baseUrl}${l}`;return this._fetchData(U).catch(Z=>{throw new Error(`Unable to load font data at: ${U}`)})}_fetchData(l){Zl("Abstract method `_fetchData` called.")}}class Oh{constructor(){this.constructor===Oh&&Zl("Cannot initialize BaseSVGFactory.")}create(l,U,Z=!1){if(l<=0||U<=0)throw new Error("Invalid SVG dimensions");const F=this._createSVG("svg:svg");return F.setAttribute("version","1.1"),Z||(F.setAttribute("width",`${l}px`),F.setAttribute("height",`${U}px`)),F.setAttribute("preserveAspectRatio","none"),F.setAttribute("viewBox",`0 0 ${l} ${U}`),F}createElement(l){if(typeof l!="string")throw new Error("Invalid SVG element type");return this._createSVG(l)}_createSVG(l){Zl("Abstract method `_createSVG` called.")}}const hd="http://www.w3.org/2000/svg";var uZ;let h0=(uZ=class{},H(uZ,"CSS",96),H(uZ,"PDF",72),H(uZ,"PDF_TO_CSS_UNITS",uZ.CSS/uZ.PDF),uZ);var eF,ud,Ad,iU,eQ,AF,yl,rl,gZ,_F,MF,Dt,cc,MQ,$i,ie,JQ,lR,KZ,qF,$F,T0,lt,Wc,GQ,UR,Ut,Vc;class cJ extends ms{constructor({docId:l,ownerDocument:U=globalThis.document}={}){super(),i(this,yl),i(this,gZ),i(this,MF),i(this,cc),i(this,$i),i(this,JQ),i(this,KZ),i(this,$F),i(this,lt),i(this,GQ),i(this,Ut),i(this,eF,void 0),i(this,ud,void 0),i(this,Ad,void 0),i(this,iU,void 0),i(this,eQ,void 0),i(this,AF,0),m(this,Ad,l),m(this,iU,U)}addFilter(l){if(!l)return"none";let U=W(this,yl,rl).get(l);if(U)return U;const[Z,F,t]=b(this,cc,MQ).call(this,l),c=l.length===1?Z:`${Z}${F}${t}`;if(U=W(this,yl,rl).get(c),U)return W(this,yl,rl).set(l,U),U;const V=`g_${W(this,Ad)}_transfer_map_${NU(this,AF)._++}`,Q=`url(#${V})`;W(this,yl,rl).set(l,Q),W(this,yl,rl).set(c,Q);const a=b(this,KZ,qF).call(this,V);return b(this,lt,Wc).call(this,Z,F,t,a),Q}addHCMFilter(l,U){var Z;const F=`${l}-${U}`,t="base";let c=W(this,gZ,_F).get(t);if((c==null?void 0:c.key)===F||(c?((Z=c.filter)==null||Z.remove(),c.key=F,c.url="none",c.filter=null):(c={key:F,url:"none",filter:null},W(this,gZ,_F).set(t,c)),!l||!U))return c.url;const V=b(this,Ut,Vc).call(this,l);l=r.makeHexColor(...V);const Q=b(this,Ut,Vc).call(this,U);if(U=r.makeHexColor(...Q),W(this,MF,Dt).style.color="",l==="#000000"&&U==="#ffffff"||l===U)return c.url;const a=new Array(256);for(let h=0;h<=255;h++){const e=h/255;a[h]=e<=.03928?e/12.92:((e+.055)/1.055)**2.4}const n=a.join(","),s=`g_${W(this,Ad)}_hcm_filter`,R=c.filter=b(this,KZ,qF).call(this,s);b(this,lt,Wc).call(this,n,n,n,R),b(this,JQ,lR).call(this,R);const N=(h,e)=>{const M=V[h]/255,J=Q[h]/255,G=new Array(e+1);for(let T=0;T<=e;T++)G[T]=M+T/e*(J-M);return G.join(",")};return b(this,lt,Wc).call(this,N(0,5),N(1,5),N(2,5),R),c.url=`url(#${s})`,c.url}addAlphaFilter(l){let U=W(this,yl,rl).get(l);if(U)return U;const[Z]=b(this,cc,MQ).call(this,[l]),F=`alpha_${Z}`;if(U=W(this,yl,rl).get(F),U)return W(this,yl,rl).set(l,U),U;const t=`g_${W(this,Ad)}_alpha_map_${NU(this,AF)._++}`,c=`url(#${t})`;W(this,yl,rl).set(l,c),W(this,yl,rl).set(F,c);const V=b(this,KZ,qF).call(this,t);return b(this,GQ,UR).call(this,Z,V),c}addLuminosityFilter(l){let U=W(this,yl,rl).get(l||"luminosity");if(U)return U;let Z,F;if(l?([Z]=b(this,cc,MQ).call(this,[l]),F=`luminosity_${Z}`):F="luminosity",U=W(this,yl,rl).get(F),U)return W(this,yl,rl).set(l,U),U;const t=`g_${W(this,Ad)}_luminosity_map_${NU(this,AF)._++}`,c=`url(#${t})`;W(this,yl,rl).set(l,c),W(this,yl,rl).set(F,c);const V=b(this,KZ,qF).call(this,t);return b(this,$i,ie).call(this,V),l&&b(this,GQ,UR).call(this,Z,V),c}addHighlightHCMFilter(l,U,Z,F,t){var c;const V=`${U}-${Z}-${F}-${t}`;let Q=W(this,gZ,_F).get(l);if((Q==null?void 0:Q.key)===V||(Q?((c=Q.filter)==null||c.remove(),Q.key=V,Q.url="none",Q.filter=null):(Q={key:V,url:"none",filter:null},W(this,gZ,_F).set(l,Q)),!U||!Z))return Q.url;const[a,n]=[U,Z].map(b(this,Ut,Vc).bind(this));let s=Math.round(.2126*a[0]+.7152*a[1]+.0722*a[2]),R=Math.round(.2126*n[0]+.7152*n[1]+.0722*n[2]),[N,h]=[F,t].map(b(this,Ut,Vc).bind(this));R<s&&([s,R,N,h]=[R,s,h,N]),W(this,MF,Dt).style.color="";const e=(G,T,p)=>{const S=new Array(256),X=(R-s)/p,B=G/255,k=(T-G)/(255*p);let Y=0;for(let o=0;o<=p;o++){const y=Math.round(s+o*X),D=B+o*k;for(let I=Y;I<=y;I++)S[I]=D;Y=y+1}for(let o=Y;o<256;o++)S[o]=S[Y-1];return S.join(",")},M=`g_${W(this,Ad)}_hcm_${l}_filter`,J=Q.filter=b(this,KZ,qF).call(this,M);return b(this,JQ,lR).call(this,J),b(this,lt,Wc).call(this,e(N[0],h[0],5),e(N[1],h[1],5),e(N[2],h[2],5),J),Q.url=`url(#${M})`,Q.url}destroy(l=!1){l&&W(this,gZ,_F).size!==0||(W(this,ud)&&(W(this,ud).parentNode.parentNode.remove(),m(this,ud,null)),W(this,eF)&&(W(this,eF).clear(),m(this,eF,null)),m(this,AF,0))}}eF=new WeakMap,ud=new WeakMap,Ad=new WeakMap,iU=new WeakMap,eQ=new WeakMap,AF=new WeakMap,yl=new WeakSet,rl=function(){return W(this,eF)||m(this,eF,new Map)},gZ=new WeakSet,_F=function(){return W(this,eQ)||m(this,eQ,new Map)},MF=new WeakSet,Dt=function(){if(!W(this,ud)){const d=W(this,iU).createElement("div"),{style:l}=d;l.visibility="hidden",l.contain="strict",l.width=l.height=0,l.position="absolute",l.top=l.left=0,l.zIndex=-1;const U=W(this,iU).createElementNS(hd,"svg");U.setAttribute("width",0),U.setAttribute("height",0),m(this,ud,W(this,iU).createElementNS(hd,"defs")),d.append(U),U.append(W(this,ud)),W(this,iU).body.append(d)}return W(this,ud)},cc=new WeakSet,MQ=function(d){if(d.length===1){const V=d[0],Q=new Array(256);for(let n=0;n<256;n++)Q[n]=V[n]/255;const a=Q.join(",");return[a,a,a]}const[l,U,Z]=d,F=new Array(256),t=new Array(256),c=new Array(256);for(let V=0;V<256;V++)F[V]=l[V]/255,t[V]=U[V]/255,c[V]=Z[V]/255;return[F.join(","),t.join(","),c.join(",")]},$i=new WeakSet,ie=function(d){const l=W(this,iU).createElementNS(hd,"feColorMatrix");l.setAttribute("type","matrix"),l.setAttribute("values","0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.3 0.59 0.11 0 0"),d.append(l)},JQ=new WeakSet,lR=function(d){const l=W(this,iU).createElementNS(hd,"feColorMatrix");l.setAttribute("type","matrix"),l.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"),d.append(l)},KZ=new WeakSet,qF=function(d){const l=W(this,iU).createElementNS(hd,"filter");return l.setAttribute("color-interpolation-filters","sRGB"),l.setAttribute("id",d),W(this,MF,Dt).append(l),l},$F=new WeakSet,T0=function(d,l,U){const Z=W(this,iU).createElementNS(hd,l);Z.setAttribute("type","discrete"),Z.setAttribute("tableValues",U),d.append(Z)},lt=new WeakSet,Wc=function(d,l,U,Z){const F=W(this,iU).createElementNS(hd,"feComponentTransfer");Z.append(F),b(this,$F,T0).call(this,F,"feFuncR",d),b(this,$F,T0).call(this,F,"feFuncG",l),b(this,$F,T0).call(this,F,"feFuncB",U)},GQ=new WeakSet,UR=function(d,l){const U=W(this,iU).createElementNS(hd,"feComponentTransfer");l.append(U),b(this,$F,T0).call(this,U,"feFuncA",d)},Ut=new WeakSet,Vc=function(d){return W(this,MF,Dt).style.color=d,Ph(getComputedStyle(W(this,MF,Dt)).getPropertyValue("color"))};class WJ extends se{constructor({ownerDocument:l=globalThis.document,enableHWA:U=!1}={}){super({enableHWA:U}),this._document=l}_createCanvas(l,U){const Z=this._document.createElement("canvas");return Z.width=l,Z.height=U,Z}}async function Js(d,l="text"){if(Qc(d,document.baseURI)){const U=await fetch(d);if(!U.ok)throw new Error(U.statusText);switch(l){case"arraybuffer":return U.arrayBuffer();case"blob":return U.blob();case"json":return U.json()}return U.text()}return new Promise((U,Z)=>{const F=new XMLHttpRequest;F.open("GET",d,!0),F.responseType=l,F.onreadystatechange=()=>{if(F.readyState===XMLHttpRequest.DONE){if(F.status===200||F.status===0){switch(l){case"arraybuffer":case"blob":case"json":U(F.response);return}U(F.responseText);return}Z(new Error(F.statusText))}},F.send(null)})}class Re extends es{_fetchData(l,U){return Js(l,this.isCompressed?"arraybuffer":"text").then(Z=>({cMapData:Z instanceof ArrayBuffer?new Uint8Array(Z):bs(Z),compressionType:U}))}}class Ne extends Ms{_fetchData(l){return Js(l,"arraybuffer").then(U=>new Uint8Array(U))}}let gh=class extends Oh{_createSVG(d){return document.createElementNS(hd,d)}};class KW{constructor({viewBox:l,scale:U,rotation:Z,offsetX:F=0,offsetY:t=0,dontFlip:c=!1}){this.viewBox=l,this.scale=U,this.rotation=Z,this.offsetX=F,this.offsetY=t;const V=(l[2]+l[0])/2,Q=(l[3]+l[1])/2;let a,n,s,R;switch(Z%=360,Z<0&&(Z+=360),Z){case 180:a=-1,n=0,s=0,R=1;break;case 90:a=0,n=1,s=1,R=0;break;case 270:a=0,n=-1,s=-1,R=0;break;case 0:a=1,n=0,s=0,R=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}c&&(s=-s,R=-R);let N,h,e,M;a===0?(N=Math.abs(Q-l[1])*U+F,h=Math.abs(V-l[0])*U+t,e=(l[3]-l[1])*U,M=(l[2]-l[0])*U):(N=Math.abs(V-l[0])*U+F,h=Math.abs(Q-l[1])*U+t,e=(l[2]-l[0])*U,M=(l[3]-l[1])*U),this.transform=[a*U,n*U,s*U,R*U,N-a*U*V-s*U*Q,h-n*U*V-R*U*Q],this.width=e,this.height=M}get rawDims(){const{viewBox:l}=this;return ll(this,"rawDims",{pageWidth:l[2]-l[0],pageHeight:l[3]-l[1],pageX:l[0],pageY:l[1]})}clone({scale:l=this.scale,rotation:U=this.rotation,offsetX:Z=this.offsetX,offsetY:F=this.offsetY,dontFlip:t=!1}={}){return new KW({viewBox:this.viewBox.slice(),scale:l,rotation:U,offsetX:Z,offsetY:F,dontFlip:t})}convertToViewportPoint(l,U){return r.applyTransform([l,U],this.transform)}convertToViewportRectangle(l){const U=r.applyTransform([l[0],l[1]],this.transform),Z=r.applyTransform([l[2],l[3]],this.transform);return[U[0],U[1],Z[0],Z[1]]}convertToPdfPoint(l,U){return r.applyInverseTransform([l,U],this.transform)}}let Kh=class extends BZ{constructor(d,l=0){super(d,"RenderingCancelledException"),this.extraDelay=l}};function vh(d){const l=d.length;let U=0;for(;U<l&&d[U].trim()==="";)U++;return d.substring(U,U+5).toLowerCase()==="data:"}function Hh(d){return typeof d=="string"&&/\.pdf$/i.test(d)}function VJ(d){return[d]=d.split(/[#?]/,1),d.substring(d.lastIndexOf("/")+1)}function QJ(d,l="document.pdf"){if(typeof d!="string")return l;if(vh(d))return f('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),l;const U=/^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/,Z=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i,F=U.exec(d);let t=Z.exec(F[1])||Z.exec(F[2])||Z.exec(F[3]);if(t&&(t=t[0],t.includes("%")))try{t=Z.exec(decodeURIComponent(t))[0]}catch{}return t||l}class Vb{constructor(){H(this,"started",Object.create(null)),H(this,"times",[])}time(l){l in this.started&&f(`Timer is already running for ${l}`),this.started[l]=Date.now()}timeEnd(l){l in this.started||f(`Timer has not been started for ${l}`),this.times.push({name:l,start:this.started[l],end:Date.now()}),delete this.started[l]}toString(){const l=[];let U=0;for(const{name:Z}of this.times)U=Math.max(Z.length,U);for(const{name:Z,start:F,end:t}of this.times)l.push(`${Z.padEnd(U)} ${t-F}ms
|
|
3
3
|
`);return l.join("")}}function Qc(d,l){try{const{protocol:U}=l?new URL(d,l):new URL(d);return U==="http:"||U==="https:"}catch{return!1}}function nU(d){d.preventDefault()}function he(d){console.log("Deprecated API usage: "+d)}let os,be=class{static toDateObject(d){if(!d||typeof d!="string")return null;os||(os=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"));const l=os.exec(d);if(!l)return null;const U=parseInt(l[1],10);let Z=parseInt(l[2],10);Z=Z>=1&&Z<=12?Z-1:0;let F=parseInt(l[3],10);F=F>=1&&F<=31?F:1;let t=parseInt(l[4],10);t=t>=0&&t<=23?t:0;let c=parseInt(l[5],10);c=c>=0&&c<=59?c:0;let V=parseInt(l[6],10);V=V>=0&&V<=59?V:0;const Q=l[7]||"Z";let a=parseInt(l[8],10);a=a>=0&&a<=23?a:0;let n=parseInt(l[9],10)||0;return n=n>=0&&n<=59?n:0,Q==="-"?(t+=a,c+=n):Q==="+"&&(t-=a,c-=n),new Date(Date.UTC(U,Z,F,t,c,V))}};function aJ(d,{scale:l=1,rotation:U=0}){const{width:Z,height:F}=d.attributes.style,t=[0,0,parseInt(Z),parseInt(F)];return new KW({viewBox:t,scale:l,rotation:U})}function Ph(d){if(d.startsWith("#")){const l=parseInt(d.slice(1),16);return[(l&16711680)>>16,(l&65280)>>8,l&255]}return d.startsWith("rgb(")?d.slice(4,-1).split(",").map(l=>parseInt(l)):d.startsWith("rgba(")?d.slice(5,-1).split(",").map(l=>parseInt(l)).slice(0,3):(f(`Not a valid color format: "${d}"`),[0,0,0])}function nJ(d){const l=document.createElement("span");l.style.visibility="hidden",document.body.append(l);for(const U of d.keys()){l.style.color=U;const Z=window.getComputedStyle(l).color;d.set(U,Ph(Z))}l.remove()}function nl(d){const{a:l,b:U,c:Z,d:F,e:t,f:c}=d.getTransform();return[l,U,Z,F,t,c]}function Wd(d){const{a:l,b:U,c:Z,d:F,e:t,f:c}=d.getTransform().invertSelf();return[l,U,Z,F,t,c]}function BF(d,l,U=!1,Z=!0){if(l instanceof KW){const{pageWidth:F,pageHeight:t}=l.rawDims,{style:c}=d,V=aU.isCSSRoundSupported,Q=`var(--scale-factor) * ${F}px`,a=`var(--scale-factor) * ${t}px`,n=V?`round(${Q}, 1px)`:`calc(${Q})`,s=V?`round(${a}, 1px)`:`calc(${a})`;!U||l.rotation%180===0?(c.width=n,c.height=s):(c.width=s,c.height=n)}Z&&d.setAttribute("data-main-rotation",l.rotation)}var dt,Zt,uU,It,dR,me,ZR,Qb,FR,ab,WW,Xn,tR,ee,TQ,cR;const Me=class Je{constructor(l){i(this,ZR),i(this,FR),i(this,WW),i(this,tR),i(this,TQ),i(this,dt,null),i(this,Zt,null),i(this,uU,void 0),i(this,It,null),m(this,uU,l)}render(){const l=m(this,dt,document.createElement("div"));l.className="editToolbar",l.setAttribute("role","toolbar");const U=W(this,uU)._uiManager._signal;l.addEventListener("contextmenu",nU,{signal:U}),l.addEventListener("pointerdown",b(Je,dR,me),{signal:U});const Z=m(this,It,document.createElement("div"));Z.className="buttons",l.append(Z);const F=W(this,uU).toolbarPosition;if(F){const{style:t}=l,c=W(this,uU)._uiManager.direction==="ltr"?1-F[0]:F[0];t.insetInlineEnd=`${100*c}%`,t.top=`calc(${100*F[1]}% + var(--editor-toolbar-vert-offset))`}return b(this,tR,ee).call(this),l}hide(){var l;W(this,dt).classList.add("hidden"),(l=W(this,Zt))==null||l.hideDropdown()}show(){W(this,dt).classList.remove("hidden")}addAltTextButton(l){b(this,WW,Xn).call(this,l),W(this,It).prepend(l,W(this,TQ,cR))}addColorPicker(l){m(this,Zt,l);const U=l.renderButton();b(this,WW,Xn).call(this,U),W(this,It).prepend(U,W(this,TQ,cR))}remove(){var l;W(this,dt).remove(),(l=W(this,Zt))==null||l.destroy(),m(this,Zt,null)}};dt=new WeakMap,Zt=new WeakMap,uU=new WeakMap,It=new WeakMap,dR=new WeakSet,me=function(d){d.stopPropagation()},ZR=new WeakSet,Qb=function(d){W(this,uU)._focusEventsAllowed=!1,d.preventDefault(),d.stopPropagation()},FR=new WeakSet,ab=function(d){W(this,uU)._focusEventsAllowed=!0,d.preventDefault(),d.stopPropagation()},WW=new WeakSet,Xn=function(d){const l=W(this,uU)._uiManager._signal;d.addEventListener("focusin",b(this,ZR,Qb).bind(this),{capture:!0,signal:l}),d.addEventListener("focusout",b(this,FR,ab).bind(this),{capture:!0,signal:l}),d.addEventListener("contextmenu",nU,{signal:l})},tR=new WeakSet,ee=function(){const d=document.createElement("button");d.className="delete",d.tabIndex=0,d.setAttribute("data-l10n-id",`pdfjs-editor-remove-${W(this,uU).editorType}-button`),b(this,WW,Xn).call(this,d),d.addEventListener("click",l=>{W(this,uU)._uiManager.delete()},{signal:W(this,uU)._uiManager._signal}),W(this,It).append(d)},TQ=new WeakSet,cR=function(){const d=document.createElement("div");return d.className="divider",d},i(Me,dR);let sJ=Me;var SQ,iF,Et,WR,Ge,VR,Te,QR,nb;class iJ{constructor(l){i(this,WR),i(this,VR),i(this,QR),i(this,SQ,null),i(this,iF,null),i(this,Et,void 0),m(this,Et,l)}show(l,U,Z){const[F,t]=b(this,VR,Te).call(this,U,Z),{style:c}=W(this,iF)||m(this,iF,b(this,WR,Ge).call(this));l.append(W(this,iF)),c.insetInlineEnd=`${100*F}%`,c.top=`calc(${100*t}% + var(--editor-toolbar-vert-offset))`}hide(){W(this,iF).remove()}}SQ=new WeakMap,iF=new WeakMap,Et=new WeakMap,WR=new WeakSet,Ge=function(){const d=m(this,iF,document.createElement("div"));d.className="editToolbar",d.setAttribute("role","toolbar"),d.addEventListener("contextmenu",nU,{signal:W(this,Et)._signal});const l=m(this,SQ,document.createElement("div"));return l.className="buttons",d.append(l),b(this,QR,nb).call(this),d},VR=new WeakSet,Te=function(d,l){let U=0,Z=0;for(const F of d){const t=F.y+F.height;if(t<U)continue;const c=F.x+(l?F.width:0);if(t>U){Z=c,U=t;continue}l?c>Z&&(Z=c):c<Z&&(Z=c)}return[l?1-Z:Z,U]},QR=new WeakSet,nb=function(){const d=document.createElement("button");d.className="highlightButton",d.tabIndex=0,d.setAttribute("data-l10n-id","pdfjs-highlight-floating-button1");const l=document.createElement("span");d.append(l),l.className="visuallyHidden",l.setAttribute("data-l10n-id","pdfjs-highlight-floating-button-label");const U=W(this,Et)._signal;d.addEventListener("contextmenu",nU,{signal:U}),d.addEventListener("click",()=>{W(this,Et).highlightSelection("floating_button")},{signal:U}),W(this,SQ).append(d)};function Yn(d,l,U){for(const Z of U)l.addEventListener(Z,d[Z].bind(d))}function RJ(d){return Math.round(Math.min(255,Math.max(1,255*d))).toString(16).padStart(2,"0")}var aR;class NJ{constructor(){i(this,aR,0)}get id(){return`${KM}${NU(this,aR)._++}`}}aR=new WeakMap;var pn,nR,VU,XQ,sR;const Se=class{constructor(){i(this,XQ),i(this,pn,FJ()),i(this,nR,0),i(this,VU,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>',U=new OffscreenCanvas(1,3).getContext("2d",{willReadFrequently:!0}),Z=new Image;Z.src=l;const F=Z.decode().then(()=>(U.drawImage(Z,0,0,1,1,0,0,1,3),new Uint32Array(U.getImageData(0,0,1,1).data.buffer)[0]===0));return ll(this,"_isSVGFittingCanvas",F)}async getFromFile(l){const{lastModified:U,name:Z,size:F,type:t}=l;return b(this,XQ,sR).call(this,`${U}_${Z}_${F}_${t}`,l)}async getFromUrl(l){return b(this,XQ,sR).call(this,l,l)}async getFromId(l){W(this,VU)||m(this,VU,new Map);const U=W(this,VU).get(l);return U?U.bitmap?(U.refCounter+=1,U):U.file?this.getFromFile(U.file):this.getFromUrl(U.url):null}getSvgUrl(l){const U=W(this,VU).get(l);return U!=null&&U.isSvg?U.svgUrl:null}deleteId(l){W(this,VU)||m(this,VU,new Map);const U=W(this,VU).get(l);U&&(U.refCounter-=1,U.refCounter===0&&(U.bitmap=null))}isValidId(l){return l.startsWith(`image_${W(this,pn)}_`)}};pn=new WeakMap,nR=new WeakMap,VU=new WeakMap,XQ=new WeakSet,sR=async function(d,l){W(this,VU)||m(this,VU,new Map);let U=W(this,VU).get(d);if(U===null)return null;if(U!=null&&U.bitmap)return U.refCounter+=1,U;try{U||(U={bitmap:null,id:`image_${W(this,pn)}_${NU(this,nR)._++}`,refCounter:0,isSvg:!1});let Z;if(typeof l=="string"?(U.url=l,Z=await Js(l,"blob")):Z=U.file=l,Z.type==="image/svg+xml"){const F=Se._isSVGFittingCanvas,t=new FileReader,c=new Image,V=new Promise((Q,a)=>{c.onload=()=>{U.bitmap=c,U.isSvg=!0,Q()},t.onload=async()=>{const n=U.svgUrl=t.result;c.src=await F?`${n}#svgView(preserveAspectRatio(none))`:n},c.onerror=t.onerror=a});t.readAsDataURL(Z),await V}else U.bitmap=await createImageBitmap(Z);U.refCounter=1}catch(Z){console.error(Z),U=null}return W(this,VU).set(d,U),U&&W(this,VU).set(U.id,U),U};let hJ=Se;var kl,vZ,YQ,Ml;class bJ{constructor(l=128){i(this,kl,[]),i(this,vZ,!1),i(this,YQ,void 0),i(this,Ml,-1),m(this,YQ,l)}add({cmd:l,undo:U,post:Z,mustExec:F,type:t=NaN,overwriteIfSameType:c=!1,keepUndo:V=!1}){if(F&&l(),W(this,vZ))return;const Q={cmd:l,undo:U,post:Z,type:t};if(W(this,Ml)===-1){W(this,kl).length>0&&(W(this,kl).length=0),m(this,Ml,0),W(this,kl).push(Q);return}if(c&&W(this,kl)[W(this,Ml)].type===t){V&&(Q.undo=W(this,kl)[W(this,Ml)].undo),W(this,kl)[W(this,Ml)]=Q;return}const a=W(this,Ml)+1;a===W(this,YQ)?W(this,kl).splice(0,1):(m(this,Ml,a),a<W(this,kl).length&&W(this,kl).splice(a)),W(this,kl).push(Q)}undo(){if(W(this,Ml)===-1)return;m(this,vZ,!0);const{undo:l,post:U}=W(this,kl)[W(this,Ml)];l(),U==null||U(),m(this,vZ,!1),m(this,Ml,W(this,Ml)-1)}redo(){if(W(this,Ml)<W(this,kl).length-1){m(this,Ml,W(this,Ml)+1),m(this,vZ,!0);const{cmd:l,post:U}=W(this,kl)[W(this,Ml)];l(),U==null||U(),m(this,vZ,!1)}}hasSomethingToUndo(){return W(this,Ml)!==-1}hasSomethingToRedo(){return W(this,Ml)<W(this,kl).length-1}destroy(){m(this,kl,null)}}kl=new WeakMap,vZ=new WeakMap,YQ=new WeakMap,Ml=new WeakMap;var iR,Xe;class vW{constructor(l){i(this,iR),this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;const{isMac:U}=aU.platform;for(const[Z,F,t={}]of l)for(const c of Z){const V=c.startsWith("mac+");U&&V?(this.callbacks.set(c.slice(4),{callback:F,options:t}),this.allKeys.add(c.split("+").at(-1))):!U&&!V&&(this.callbacks.set(c,{callback:F,options:t}),this.allKeys.add(c.split("+").at(-1)))}}exec(l,U){if(!this.allKeys.has(U.key))return;const Z=this.callbacks.get(b(this,iR,Xe).call(this,U));if(!Z)return;const{callback:F,options:{bubbles:t=!1,args:c=[],checker:V=null}}=Z;V&&!V(l,U)||(F.bind(l,...c,U)(),t||(U.stopPropagation(),U.preventDefault()))}}iR=new WeakSet,Xe=function(d){d.altKey&&this.buffer.push("alt"),d.ctrlKey&&this.buffer.push("ctrl"),d.metaKey&&this.buffer.push("meta"),d.shiftKey&&this.buffer.push("shift"),this.buffer.push(d.key);const l=this.buffer.join("+");return this.buffer.length=0,l};const Ye=class pe{get _colors(){const l=new Map([["CanvasText",null],["Canvas",null]]);return nJ(l),ll(this,"_colors",l)}convert(l){const U=Ph(l);if(!window.matchMedia("(forced-colors: active)").matches)return U;for(const[Z,F]of this._colors)if(F.every((t,c)=>t===U[c]))return pe._colorsMapping.get(Z);return U}getHexCode(l){const U=this._colors.get(l);return U?r.makeHexColor(...U):l}};H(Ye,"_colorsMapping",new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]));let mJ=Ye;var S0,bU,Sl,El,X0,xd,LF,rU,Y0,zF,Vd,jU,DF,$W,lV,Qd,p0,oZ,OU,ys,yZ,UV,IF,dV,B0,wl,dl,rd,EF,u0,ZV,FV,tV,cV,WV,VV,QV,aV,nV,sV,iV,RV,kZ,ad,jd,NV,wF,o0,hV,ks,sb,Ls,ib,y0,bV,zs,Rb,Ds,Nb,Is,hb,mV,Es,ws,bb,eV,Cs,MV,xs,rs,mb,Cl,_l,nd,Od,js,eb,Os,Mb,JV,gs,Ks,Jb,CF,k0,GV,vs;let xW=(wF=class{constructor(d,l,U,Z,F,t,c,V,Q){i(this,o0),i(this,ks),i(this,Ls),i(this,y0),i(this,zs),i(this,Ds),i(this,Is),i(this,mV),i(this,ws),i(this,eV),i(this,MV),i(this,rs),i(this,Cl),i(this,nd),i(this,js),i(this,Os),i(this,JV),i(this,Ks),i(this,CF),i(this,GV),i(this,S0,new AbortController),i(this,bU,null),i(this,Sl,new Map),i(this,El,new Map),i(this,X0,null),i(this,xd,null),i(this,LF,null),i(this,rU,new bJ),i(this,Y0,0),i(this,zF,new Set),i(this,Vd,null),i(this,jU,null),i(this,DF,new Set),i(this,$W,!1),i(this,lV,null),i(this,Qd,null),i(this,p0,null),i(this,oZ,!1),i(this,OU,null),i(this,ys,new NJ),i(this,yZ,!1),i(this,UV,!1),i(this,IF,null),i(this,dV,null),i(this,B0,null),i(this,wl,$.NONE),i(this,dl,new Set),i(this,rd,null),i(this,EF,null),i(this,u0,null),i(this,ZV,this.blur.bind(this)),i(this,FV,this.focus.bind(this)),i(this,tV,this.copy.bind(this)),i(this,cV,this.cut.bind(this)),i(this,WV,this.paste.bind(this)),i(this,VV,this.keydown.bind(this)),i(this,QV,this.keyup.bind(this)),i(this,aV,this.onEditingAction.bind(this)),i(this,nV,this.onPageChanging.bind(this)),i(this,sV,this.onScaleChanging.bind(this)),i(this,iV,this.onRotationChanging.bind(this)),i(this,RV,{isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1,hasSelectedText:!1}),i(this,kZ,[0,0]),i(this,ad,null),i(this,jd,null),i(this,NV,null),this._signal=W(this,S0).signal,m(this,jd,d),m(this,NV,l),m(this,X0,U),this._eventBus=Z,this._eventBus._on("editingaction",W(this,aV)),this._eventBus._on("pagechanging",W(this,nV)),this._eventBus._on("scalechanging",W(this,sV)),this._eventBus._on("rotationchanging",W(this,iV)),b(this,zs,Rb).call(this),b(this,rs,mb).call(this),b(this,mV,Es).call(this),m(this,xd,F.annotationStorage),m(this,lV,F.filterFactory),m(this,EF,t),m(this,p0,c||null),m(this,$W,V),m(this,B0,Q||null),this.viewParameters={realScale:h0.PDF_TO_CSS_UNITS,rotation:0},this.isShiftKeyDown=!1}static get _keyboardManager(){const d=wF.prototype,l=t=>W(t,jd).contains(document.activeElement)&&document.activeElement.tagName!=="BUTTON"&&t.hasSomethingToControl(),U=(t,{target:c})=>{if(c instanceof HTMLInputElement){const{type:V}=c;return V!=="text"&&V!=="number"}return!0},Z=this.TRANSLATE_SMALL,F=this.TRANSLATE_BIG;return ll(this,"_keyboardManager",new vW([[["ctrl+a","mac+meta+a"],d.selectAll,{checker:U}],[["ctrl+z","mac+meta+z"],d.undo,{checker:U}],[["ctrl+y","ctrl+shift+z","mac+meta+shift+z","ctrl+shift+Z","mac+meta+shift+Z"],d.redo,{checker:U}],[["Backspace","alt+Backspace","ctrl+Backspace","shift+Backspace","mac+Backspace","mac+alt+Backspace","mac+ctrl+Backspace","Delete","ctrl+Delete","shift+Delete","mac+Delete"],d.delete,{checker:U}],[["Enter","mac+Enter"],d.addNewEditorFromKeyboard,{checker:(t,{target:c})=>!(c instanceof HTMLButtonElement)&&W(t,jd).contains(c)&&!t.isEnterHandled}],[[" ","mac+ "],d.addNewEditorFromKeyboard,{checker:(t,{target:c})=>!(c instanceof HTMLButtonElement)&&W(t,jd).contains(document.activeElement)}],[["Escape","mac+Escape"],d.unselectAll],[["ArrowLeft","mac+ArrowLeft"],d.translateSelectedEditors,{args:[-Z,0],checker:l}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],d.translateSelectedEditors,{args:[-F,0],checker:l}],[["ArrowRight","mac+ArrowRight"],d.translateSelectedEditors,{args:[Z,0],checker:l}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],d.translateSelectedEditors,{args:[F,0],checker:l}],[["ArrowUp","mac+ArrowUp"],d.translateSelectedEditors,{args:[0,-Z],checker:l}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],d.translateSelectedEditors,{args:[0,-F],checker:l}],[["ArrowDown","mac+ArrowDown"],d.translateSelectedEditors,{args:[0,Z],checker:l}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],d.translateSelectedEditors,{args:[0,F],checker:l}]]))}destroy(){var d,l,U;(d=W(this,S0))==null||d.abort(),m(this,S0,null),this._signal=null,this._eventBus._off("editingaction",W(this,aV)),this._eventBus._off("pagechanging",W(this,nV)),this._eventBus._off("scalechanging",W(this,sV)),this._eventBus._off("rotationchanging",W(this,iV));for(const Z of W(this,El).values())Z.destroy();W(this,El).clear(),W(this,Sl).clear(),W(this,DF).clear(),m(this,bU,null),W(this,dl).clear(),W(this,rU).destroy(),(l=W(this,X0))==null||l.destroy(),(U=W(this,OU))==null||U.hide(),m(this,OU,null),W(this,Qd)&&(clearTimeout(W(this,Qd)),m(this,Qd,null)),W(this,ad)&&(clearTimeout(W(this,ad)),m(this,ad,null))}async mlGuess(d){var l;return((l=W(this,B0))==null?void 0:l.guess(d))||null}get hasMLManager(){return!!W(this,B0)}get hcmFilter(){return ll(this,"hcmFilter",W(this,EF)?W(this,lV).addHCMFilter(W(this,EF).foreground,W(this,EF).background):"none")}get direction(){return ll(this,"direction",getComputedStyle(W(this,jd)).direction)}get highlightColors(){return ll(this,"highlightColors",W(this,p0)?new Map(W(this,p0).split(",").map(d=>d.split("=").map(l=>l.trim()))):null)}get highlightColorNames(){return ll(this,"highlightColorNames",this.highlightColors?new Map(Array.from(this.highlightColors,d=>d.reverse())):null)}setMainHighlightColorPicker(d){m(this,dV,d)}editAltText(d){var l;(l=W(this,X0))==null||l.editAltText(this,d)}onPageChanging({pageNumber:d}){m(this,Y0,d-1)}focusMainContainer(){W(this,jd).focus()}findParent(d,l){for(const U of W(this,El).values()){const{x:Z,y:F,width:t,height:c}=U.div.getBoundingClientRect();if(d>=Z&&d<=Z+t&&l>=F&&l<=F+c)return U}return null}disableUserSelect(d=!1){W(this,NV).classList.toggle("noUserSelect",d)}addShouldRescale(d){W(this,DF).add(d)}removeShouldRescale(d){W(this,DF).delete(d)}onScaleChanging({scale:d}){this.commitOrRemove(),this.viewParameters.realScale=d*h0.PDF_TO_CSS_UNITS;for(const l of W(this,DF))l.onScaleChanging()}onRotationChanging({pagesRotation:d}){this.commitOrRemove(),this.viewParameters.rotation=d}highlightSelection(d=""){const l=document.getSelection();if(!l||l.isCollapsed)return;const{anchorNode:U,anchorOffset:Z,focusNode:F,focusOffset:t}=l,c=l.toString(),V=b(this,o0,hV).call(this,l).closest(".textLayer"),Q=this.getSelectionBoxes(V);if(Q){l.empty(),W(this,wl)===$.NONE&&(this._eventBus.dispatch("showannotationeditorui",{source:this,mode:$.HIGHLIGHT}),this.showAllEditors("highlight",!0,!0));for(const a of W(this,El).values())if(a.hasTextLayer(V)){a.createAndAddNewEditor({x:0,y:0},!1,{methodOfCreation:d,boxes:Q,anchorNode:U,anchorOffset:Z,focusNode:F,focusOffset:t,text:c});break}}}addToAnnotationStorage(d){!d.isEmpty()&&W(this,xd)&&!W(this,xd).has(d.id)&&W(this,xd).setValue(d.id,d)}blur(){if(this.isShiftKeyDown=!1,W(this,oZ)&&(m(this,oZ,!1),b(this,y0,bV).call(this,"main_toolbar")),!this.hasSelection)return;const{activeElement:d}=document;for(const l of W(this,dl))if(l.div.contains(d)){m(this,IF,[l,d]),l._focusEventsAllowed=!1;break}}focus(){if(!W(this,IF))return;const[d,l]=W(this,IF);m(this,IF,null),l.addEventListener("focusin",()=>{d._focusEventsAllowed=!0},{once:!0,signal:this._signal}),l.focus()}addEditListeners(){b(this,mV,Es).call(this),b(this,eV,Cs).call(this)}removeEditListeners(){b(this,ws,bb).call(this),b(this,MV,xs).call(this)}dragOver(d){for(const{type:l}of d.dataTransfer.items)for(const U of W(this,jU))if(U.isHandlingMimeForPasting(l)){d.dataTransfer.dropEffect="copy",d.preventDefault();return}}drop(d){for(const l of d.dataTransfer.items)for(const U of W(this,jU))if(U.isHandlingMimeForPasting(l.type)){U.paste(l,this.currentLayer),d.preventDefault();return}}copy(d){var l;if(d.preventDefault(),(l=W(this,bU))==null||l.commitOrRemove(),!this.hasSelection)return;const U=[];for(const Z of W(this,dl)){const F=Z.serialize(!0);F&&U.push(F)}U.length!==0&&d.clipboardData.setData("application/pdfjs",JSON.stringify(U))}cut(d){this.copy(d),this.delete()}paste(d){d.preventDefault();const{clipboardData:l}=d;for(const F of l.items)for(const t of W(this,jU))if(t.isHandlingMimeForPasting(F.type)){t.paste(F,this.currentLayer);return}let U=l.getData("application/pdfjs");if(!U)return;try{U=JSON.parse(U)}catch(F){f(`paste: "${F.message}".`);return}if(!Array.isArray(U))return;this.unselectAll();const Z=this.currentLayer;try{const F=[];for(const V of U){const Q=Z.deserialize(V);if(!Q)return;F.push(Q)}const t=()=>{for(const V of F)b(this,JV,gs).call(this,V);b(this,GV,vs).call(this,F)},c=()=>{for(const V of F)V.remove()};this.addCommands({cmd:t,undo:c,mustExec:!0})}catch(F){f(`paste: "${F.message}".`)}}keydown(d){!this.isShiftKeyDown&&d.key==="Shift"&&(this.isShiftKeyDown=!0),W(this,wl)!==$.NONE&&!this.isEditorHandlingKeyboard&&wF._keyboardManager.exec(this,d)}keyup(d){this.isShiftKeyDown&&d.key==="Shift"&&(this.isShiftKeyDown=!1,W(this,oZ)&&(m(this,oZ,!1),b(this,y0,bV).call(this,"main_toolbar")))}onEditingAction({name:d}){switch(d){case"undo":case"redo":case"delete":case"selectAll":this[d]();break;case"highlightSelection":this.highlightSelection("context_menu");break}}setEditingState(d){d?(b(this,Ds,Nb).call(this),b(this,eV,Cs).call(this),b(this,Cl,_l).call(this,{isEditing:W(this,wl)!==$.NONE,isEmpty:b(this,CF,k0).call(this),hasSomethingToUndo:W(this,rU).hasSomethingToUndo(),hasSomethingToRedo:W(this,rU).hasSomethingToRedo(),hasSelectedEditor:!1})):(b(this,Is,hb).call(this),b(this,MV,xs).call(this),b(this,Cl,_l).call(this,{isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(d){if(!W(this,jU)){m(this,jU,d);for(const l of W(this,jU))b(this,nd,Od).call(this,l.defaultPropertiesToUpdate)}}getId(){return W(this,ys).id}get currentLayer(){return W(this,El).get(W(this,Y0))}getLayer(d){return W(this,El).get(d)}get currentPageIndex(){return W(this,Y0)}addLayer(d){W(this,El).set(d.pageIndex,d),W(this,yZ)?d.enable():d.disable()}removeLayer(d){W(this,El).delete(d.pageIndex)}updateMode(d,l=null,U=!1){if(W(this,wl)!==d){if(m(this,wl,d),d===$.NONE){this.setEditingState(!1),b(this,Os,Mb).call(this);return}this.setEditingState(!0),b(this,js,eb).call(this),this.unselectAll();for(const Z of W(this,El).values())Z.updateMode(d);if(!l&&U){this.addNewEditorFromKeyboard();return}if(l){for(const Z of W(this,Sl).values())if(Z.annotationElementId===l){this.setSelected(Z),Z.enterInEditMode();break}}}}addNewEditorFromKeyboard(){this.currentLayer.canCreateNewEmptyEditor()&&this.currentLayer.addNewEditor()}updateToolbar(d){d!==W(this,wl)&&this._eventBus.dispatch("switchannotationeditormode",{source:this,mode:d})}updateParams(d,l){var U;if(W(this,jU)){switch(d){case v.CREATE:this.currentLayer.addNewEditor();return;case v.HIGHLIGHT_DEFAULT_COLOR:(U=W(this,dV))==null||U.updateColor(l);break;case v.HIGHLIGHT_SHOW_ALL:this._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:{type:"highlight",action:"toggle_visibility"}}}),(W(this,u0)||m(this,u0,new Map)).set(d,l),this.showAllEditors("highlight",l);break}for(const Z of W(this,dl))Z.updateParams(d,l);for(const Z of W(this,jU))Z.updateDefaultParams(d,l)}}showAllEditors(d,l,U=!1){var Z;for(const F of W(this,Sl).values())F.editorType===d&&F.show(l);(((Z=W(this,u0))==null?void 0:Z.get(v.HIGHLIGHT_SHOW_ALL))??!0)!==l&&b(this,nd,Od).call(this,[[v.HIGHLIGHT_SHOW_ALL,l]])}enableWaiting(d=!1){if(W(this,UV)!==d){m(this,UV,d);for(const l of W(this,El).values())d?l.disableClick():l.enableClick(),l.div.classList.toggle("waiting",d)}}getEditors(d){const l=[];for(const U of W(this,Sl).values())U.pageIndex===d&&l.push(U);return l}getEditor(d){return W(this,Sl).get(d)}addEditor(d){W(this,Sl).set(d.id,d)}removeEditor(d){var l;d.div.contains(document.activeElement)&&(W(this,Qd)&&clearTimeout(W(this,Qd)),m(this,Qd,setTimeout(()=>{this.focusMainContainer(),m(this,Qd,null)},0))),W(this,Sl).delete(d.id),this.unselect(d),(!d.annotationElementId||!W(this,zF).has(d.annotationElementId))&&((l=W(this,xd))==null||l.remove(d.id))}addDeletedAnnotationElement(d){W(this,zF).add(d.annotationElementId),this.addChangedExistingAnnotation(d),d.deleted=!0}isDeletedAnnotationElement(d){return W(this,zF).has(d)}removeDeletedAnnotationElement(d){W(this,zF).delete(d.annotationElementId),this.removeChangedExistingAnnotation(d),d.deleted=!1}setActiveEditor(d){W(this,bU)!==d&&(m(this,bU,d),d&&b(this,nd,Od).call(this,d.propertiesToUpdate))}updateUI(d){W(this,Ks,Jb)===d&&b(this,nd,Od).call(this,d.propertiesToUpdate)}toggleSelected(d){if(W(this,dl).has(d)){W(this,dl).delete(d),d.unselect(),b(this,Cl,_l).call(this,{hasSelectedEditor:this.hasSelection});return}W(this,dl).add(d),d.select(),b(this,nd,Od).call(this,d.propertiesToUpdate),b(this,Cl,_l).call(this,{hasSelectedEditor:!0})}setSelected(d){for(const l of W(this,dl))l!==d&&l.unselect();W(this,dl).clear(),W(this,dl).add(d),d.select(),b(this,nd,Od).call(this,d.propertiesToUpdate),b(this,Cl,_l).call(this,{hasSelectedEditor:!0})}isSelected(d){return W(this,dl).has(d)}get firstSelectedEditor(){return W(this,dl).values().next().value}unselect(d){d.unselect(),W(this,dl).delete(d),b(this,Cl,_l).call(this,{hasSelectedEditor:this.hasSelection})}get hasSelection(){return W(this,dl).size!==0}get isEnterHandled(){return W(this,dl).size===1&&this.firstSelectedEditor.isEnterHandled}undo(){W(this,rU).undo(),b(this,Cl,_l).call(this,{hasSomethingToUndo:W(this,rU).hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:b(this,CF,k0).call(this)})}redo(){W(this,rU).redo(),b(this,Cl,_l).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:W(this,rU).hasSomethingToRedo(),isEmpty:b(this,CF,k0).call(this)})}addCommands(d){W(this,rU).add(d),b(this,Cl,_l).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:b(this,CF,k0).call(this)})}delete(){if(this.commitOrRemove(),!this.hasSelection)return;const d=[...W(this,dl)],l=()=>{for(const Z of d)Z.remove()},U=()=>{for(const Z of d)b(this,JV,gs).call(this,Z)};this.addCommands({cmd:l,undo:U,mustExec:!0})}commitOrRemove(){var d;(d=W(this,bU))==null||d.commitOrRemove()}hasSomethingToControl(){return W(this,bU)||this.hasSelection}selectAll(){for(const d of W(this,dl))d.commit();b(this,GV,vs).call(this,W(this,Sl).values())}unselectAll(){if(!(W(this,bU)&&(W(this,bU).commitOrRemove(),W(this,wl)!==$.NONE))&&this.hasSelection){for(const d of W(this,dl))d.unselect();W(this,dl).clear(),b(this,Cl,_l).call(this,{hasSelectedEditor:!1})}}translateSelectedEditors(d,l,U=!1){if(U||this.commitOrRemove(),!this.hasSelection)return;W(this,kZ)[0]+=d,W(this,kZ)[1]+=l;const[Z,F]=W(this,kZ),t=[...W(this,dl)];W(this,ad)&&clearTimeout(W(this,ad)),m(this,ad,setTimeout(()=>{m(this,ad,null),W(this,kZ)[0]=W(this,kZ)[1]=0,this.addCommands({cmd:()=>{for(const V of t)W(this,Sl).has(V.id)&&V.translateInPage(Z,F)},undo:()=>{for(const V of t)W(this,Sl).has(V.id)&&V.translateInPage(-Z,-F)},mustExec:!1})},1e3));for(const V of t)V.translateInPage(d,l)}setUpDragSession(){if(this.hasSelection){this.disableUserSelect(!0),m(this,Vd,new Map);for(const d of W(this,dl))W(this,Vd).set(d,{savedX:d.x,savedY:d.y,savedPageIndex:d.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!W(this,Vd))return!1;this.disableUserSelect(!1);const d=W(this,Vd);m(this,Vd,null);let l=!1;for(const[{x:Z,y:F,pageIndex:t},c]of d)c.newX=Z,c.newY=F,c.newPageIndex=t,l||(l=Z!==c.savedX||F!==c.savedY||t!==c.savedPageIndex);if(!l)return!1;const U=(Z,F,t,c)=>{if(W(this,Sl).has(Z.id)){const V=W(this,El).get(c);V?Z._setParentAndPosition(V,F,t):(Z.pageIndex=c,Z.x=F,Z.y=t)}};return this.addCommands({cmd:()=>{for(const[Z,{newX:F,newY:t,newPageIndex:c}]of d)U(Z,F,t,c)},undo:()=>{for(const[Z,{savedX:F,savedY:t,savedPageIndex:c}]of d)U(Z,F,t,c)},mustExec:!0}),!0}dragSelectedEditors(d,l){if(W(this,Vd))for(const U of W(this,Vd).keys())U.drag(d,l)}rebuild(d){if(d.parent===null){const l=this.getLayer(d.pageIndex);l?(l.changeParent(d),l.addOrRebuild(d)):(this.addEditor(d),this.addToAnnotationStorage(d),d.rebuild())}else d.parent.addOrRebuild(d)}get isEditorHandlingKeyboard(){var d;return((d=this.getActive())==null?void 0:d.shouldGetKeyboardEvents())||W(this,dl).size===1&&this.firstSelectedEditor.shouldGetKeyboardEvents()}isActive(d){return W(this,bU)===d}getActive(){return W(this,bU)}getMode(){return W(this,wl)}get imageManager(){return ll(this,"imageManager",new hJ)}getSelectionBoxes(d){if(!d)return null;const l=document.getSelection();for(let Q=0,a=l.rangeCount;Q<a;Q++)if(!d.contains(l.getRangeAt(Q).commonAncestorContainer))return null;const{x:U,y:Z,width:F,height:t}=d.getBoundingClientRect();let c;switch(d.getAttribute("data-main-rotation")){case"90":c=(Q,a,n,s)=>({x:(a-Z)/t,y:1-(Q+n-U)/F,width:s/t,height:n/F});break;case"180":c=(Q,a,n,s)=>({x:1-(Q+n-U)/F,y:1-(a+s-Z)/t,width:n/F,height:s/t});break;case"270":c=(Q,a,n,s)=>({x:1-(a+s-Z)/t,y:(Q-U)/F,width:s/t,height:n/F});break;default:c=(Q,a,n,s)=>({x:(Q-U)/F,y:(a-Z)/t,width:n/F,height:s/t});break}const V=[];for(let Q=0,a=l.rangeCount;Q<a;Q++){const n=l.getRangeAt(Q);if(!n.collapsed)for(const{x:s,y:R,width:N,height:h}of n.getClientRects())N===0||h===0||V.push(c(s,R,N,h))}return V.length===0?null:V}addChangedExistingAnnotation({annotationElementId:d,id:l}){(W(this,LF)||m(this,LF,new Map)).set(d,l)}removeChangedExistingAnnotation({annotationElementId:d}){var l;(l=W(this,LF))==null||l.delete(d)}renderAnnotationElement(d){var l;const U=(l=W(this,LF))==null?void 0:l.get(d.data.id);if(!U)return;const Z=W(this,xd).getRawValue(U);Z&&(W(this,wl)===$.NONE&&!Z.hasBeenModified||Z.renderAnnotationElement(d))}},S0=new WeakMap,bU=new WeakMap,Sl=new WeakMap,El=new WeakMap,X0=new WeakMap,xd=new WeakMap,LF=new WeakMap,rU=new WeakMap,Y0=new WeakMap,zF=new WeakMap,Vd=new WeakMap,jU=new WeakMap,DF=new WeakMap,$W=new WeakMap,lV=new WeakMap,Qd=new WeakMap,p0=new WeakMap,oZ=new WeakMap,OU=new WeakMap,ys=new WeakMap,yZ=new WeakMap,UV=new WeakMap,IF=new WeakMap,dV=new WeakMap,B0=new WeakMap,wl=new WeakMap,dl=new WeakMap,rd=new WeakMap,EF=new WeakMap,u0=new WeakMap,ZV=new WeakMap,FV=new WeakMap,tV=new WeakMap,cV=new WeakMap,WV=new WeakMap,VV=new WeakMap,QV=new WeakMap,aV=new WeakMap,nV=new WeakMap,sV=new WeakMap,iV=new WeakMap,RV=new WeakMap,kZ=new WeakMap,ad=new WeakMap,jd=new WeakMap,NV=new WeakMap,o0=new WeakSet,hV=function({anchorNode:d}){return d.nodeType===Node.TEXT_NODE?d.parentElement:d},ks=new WeakSet,sb=function(){const d=document.getSelection();if(!d||d.isCollapsed)return;const l=b(this,o0,hV).call(this,d).closest(".textLayer"),U=this.getSelectionBoxes(l);U&&(W(this,OU)||m(this,OU,new iJ(this)),W(this,OU).show(l,U,this.direction==="ltr"))},Ls=new WeakSet,ib=function(){var d,l,U;const Z=document.getSelection();if(!Z||Z.isCollapsed){W(this,rd)&&((d=W(this,OU))==null||d.hide(),m(this,rd,null),b(this,Cl,_l).call(this,{hasSelectedText:!1}));return}const{anchorNode:F}=Z;if(F!==W(this,rd)){if(!b(this,o0,hV).call(this,Z).closest(".textLayer")){W(this,rd)&&((l=W(this,OU))==null||l.hide(),m(this,rd,null),b(this,Cl,_l).call(this,{hasSelectedText:!1}));return}if((U=W(this,OU))==null||U.hide(),m(this,rd,F),b(this,Cl,_l).call(this,{hasSelectedText:!0}),!(W(this,wl)!==$.HIGHLIGHT&&W(this,wl)!==$.NONE)&&(W(this,wl)===$.HIGHLIGHT&&this.showAllEditors("highlight",!0,!0),m(this,oZ,this.isShiftKeyDown),!this.isShiftKeyDown)){const t=this._signal,c=V=>{V.type==="pointerup"&&V.button!==0||(window.removeEventListener("pointerup",c),window.removeEventListener("blur",c),V.type==="pointerup"&&b(this,y0,bV).call(this,"main_toolbar"))};window.addEventListener("pointerup",c,{signal:t}),window.addEventListener("blur",c,{signal:t})}}},y0=new WeakSet,bV=function(d=""){W(this,wl)===$.HIGHLIGHT?this.highlightSelection(d):W(this,$W)&&b(this,ks,sb).call(this)},zs=new WeakSet,Rb=function(){document.addEventListener("selectionchange",b(this,Ls,ib).bind(this),{signal:this._signal})},Ds=new WeakSet,Nb=function(){const d=this._signal;window.addEventListener("focus",W(this,FV),{signal:d}),window.addEventListener("blur",W(this,ZV),{signal:d})},Is=new WeakSet,hb=function(){window.removeEventListener("focus",W(this,FV)),window.removeEventListener("blur",W(this,ZV))},mV=new WeakSet,Es=function(){const d=this._signal;window.addEventListener("keydown",W(this,VV),{signal:d}),window.addEventListener("keyup",W(this,QV),{signal:d})},ws=new WeakSet,bb=function(){window.removeEventListener("keydown",W(this,VV)),window.removeEventListener("keyup",W(this,QV))},eV=new WeakSet,Cs=function(){const d=this._signal;document.addEventListener("copy",W(this,tV),{signal:d}),document.addEventListener("cut",W(this,cV),{signal:d}),document.addEventListener("paste",W(this,WV),{signal:d})},MV=new WeakSet,xs=function(){document.removeEventListener("copy",W(this,tV)),document.removeEventListener("cut",W(this,cV)),document.removeEventListener("paste",W(this,WV))},rs=new WeakSet,mb=function(){const d=this._signal;document.addEventListener("dragover",this.dragOver.bind(this),{signal:d}),document.addEventListener("drop",this.drop.bind(this),{signal:d})},Cl=new WeakSet,_l=function(d){Object.entries(d).some(([l,U])=>W(this,RV)[l]!==U)&&(this._eventBus.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(W(this,RV),d)}),W(this,wl)===$.HIGHLIGHT&&d.hasSelectedEditor===!1&&b(this,nd,Od).call(this,[[v.HIGHLIGHT_FREE,!0]]))},nd=new WeakSet,Od=function(d){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:d})},js=new WeakSet,eb=function(){if(!W(this,yZ)){m(this,yZ,!0);for(const d of W(this,El).values())d.enable();for(const d of W(this,Sl).values())d.enable()}},Os=new WeakSet,Mb=function(){if(this.unselectAll(),W(this,yZ)){m(this,yZ,!1);for(const d of W(this,El).values())d.disable();for(const d of W(this,Sl).values())d.disable()}},JV=new WeakSet,gs=function(d){const l=W(this,El).get(d.pageIndex);l?l.addOrRebuild(d):(this.addEditor(d),this.addToAnnotationStorage(d))},Ks=new WeakSet,Jb=function(){let d=null;for(d of W(this,dl));return d},CF=new WeakSet,k0=function(){if(W(this,Sl).size===0)return!0;if(W(this,Sl).size===1)for(const d of W(this,Sl).values())return d.isEmpty();return!1},GV=new WeakSet,vs=function(d){for(const l of W(this,dl))l.unselect();W(this,dl).clear();for(const l of d)l.isEmpty()||(W(this,dl).add(l),l.select());b(this,Cl,_l).call(this,{hasSelectedEditor:this.hasSelection})},H(wF,"TRANSLATE_SMALL",1),H(wF,"TRANSLATE_BIG",10),wF);var nZ,sZ,fU,tZ,XU,ac,Ud,pQ,RR;const BQ=class uQ{constructor(l){i(this,pQ),i(this,nZ,""),i(this,sZ,!1),i(this,fU,null),i(this,tZ,null),i(this,XU,null),i(this,ac,!1),i(this,Ud,null),m(this,Ud,l)}static initialize(l){uQ._l10nPromise||(uQ._l10nPromise=l)}async render(){const l=m(this,fU,document.createElement("button"));l.className="altText";const U=await uQ._l10nPromise.get("pdfjs-editor-alt-text-button-label");l.textContent=U,l.setAttribute("aria-label",U),l.tabIndex="0";const Z=W(this,Ud)._uiManager._signal;l.addEventListener("contextmenu",nU,{signal:Z}),l.addEventListener("pointerdown",t=>t.stopPropagation(),{signal:Z});const F=t=>{t.preventDefault(),W(this,Ud)._uiManager.editAltText(W(this,Ud))};return l.addEventListener("click",F,{capture:!0,signal:Z}),l.addEventListener("keydown",t=>{t.target===l&&t.key==="Enter"&&(m(this,ac,!0),F(t))},{signal:Z}),await b(this,pQ,RR).call(this),l}finish(){W(this,fU)&&(W(this,fU).focus({focusVisible:W(this,ac)}),m(this,ac,!1))}isEmpty(){return!W(this,nZ)&&!W(this,sZ)}get data(){return{altText:W(this,nZ),decorative:W(this,sZ)}}set data({altText:l,decorative:U}){W(this,nZ)===l&&W(this,sZ)===U||(m(this,nZ,l),m(this,sZ,U),b(this,pQ,RR).call(this))}toggle(l=!1){W(this,fU)&&(!l&&W(this,XU)&&(clearTimeout(W(this,XU)),m(this,XU,null)),W(this,fU).disabled=!l)}destroy(){var l;(l=W(this,fU))==null||l.remove(),m(this,fU,null),m(this,tZ,null)}};nZ=new WeakMap,sZ=new WeakMap,fU=new WeakMap,tZ=new WeakMap,XU=new WeakMap,ac=new WeakMap,Ud=new WeakMap,pQ=new WeakSet,RR=async function(){var d;const l=W(this,fU);if(!l)return;if(!W(this,nZ)&&!W(this,sZ)){l.classList.remove("done"),(d=W(this,tZ))==null||d.remove();return}l.classList.add("done"),BQ._l10nPromise.get("pdfjs-editor-alt-text-edit-button-label").then(F=>{l.setAttribute("aria-label",F)});let U=W(this,tZ);if(!U){m(this,tZ,U=document.createElement("span")),U.className="tooltip",U.setAttribute("role","tooltip");const F=U.id=`alt-text-tooltip-${W(this,Ud).id}`;l.setAttribute("aria-describedby",F);const t=100,c=W(this,Ud)._uiManager._signal;c.addEventListener("abort",()=>{clearTimeout(W(this,XU)),m(this,XU,null)},{once:!0}),l.addEventListener("mouseenter",()=>{m(this,XU,setTimeout(()=>{m(this,XU,null),W(this,tZ).classList.add("show"),W(this,Ud)._reportTelemetry({action:"alt_text_tooltip"})},t))},{signal:c}),l.addEventListener("mouseleave",()=>{var V;W(this,XU)&&(clearTimeout(W(this,XU)),m(this,XU,null)),(V=W(this,tZ))==null||V.classList.remove("show")},{signal:c})}U.innerText=W(this,sZ)?await BQ._l10nPromise.get("pdfjs-editor-alt-text-decorative-tooltip"):W(this,nZ),U.parentNode||l.append(U);const Z=W(this,Ud).getImageForAltText();Z==null||Z.setAttribute("aria-describedby",U.id)},H(BQ,"_l10nPromise",null);let Gb=BQ;var Ft,$U,lU,nc,tt,Hl,wt,sc,ic,ql,Bn,Ct,bd,oQ,ct,XZ,md,Rc,Nc,JU,yQ,NR,kQ,hR,un,bR,LQ,Hs,mR,Be,eR,Tb,zQ,Ps,on,MR,yn,JR,GR,ue,TR,oe,SR,ye,XR,ke,kn,YR,xt,VW;const ed=class Ll{constructor(l){i(this,kQ),i(this,LQ),i(this,mR),i(this,eR),i(this,zQ),i(this,on),i(this,yn),i(this,GR),i(this,TR),i(this,SR),i(this,XR),i(this,kn),i(this,xt),i(this,Ft,null),i(this,$U,null),i(this,lU,null),i(this,nc,!1),i(this,tt,!1),i(this,Hl,null),i(this,wt,null),i(this,sc,this.focusin.bind(this)),i(this,ic,this.focusout.bind(this)),i(this,ql,null),i(this,Bn,""),i(this,Ct,!1),i(this,bd,null),i(this,oQ,!1),i(this,ct,!1),i(this,XZ,!1),i(this,md,null),i(this,Rc,0),i(this,Nc,0),i(this,JU,null),H(this,"_initialOptions",Object.create(null)),H(this,"_isVisible",!0),H(this,"_uiManager",null),H(this,"_focusEventsAllowed",!0),H(this,"_l10nPromise",null),i(this,yQ,!1),i(this,NR,Ll._zIndex++),this.constructor===Ll&&Zl("Cannot initialize AnnotationEditor."),this.parent=l.parent,this.id=l.id,this.width=this.height=null,this.pageIndex=l.parent.pageIndex,this.name=l.name,this.div=null,this._uiManager=l.uiManager,this.annotationElementId=null,this._willKeepAspectRatio=!1,this._initialOptions.isCentered=l.isCentered,this._structTreeParentId=null;const{rotation:U,rawDims:{pageWidth:Z,pageHeight:F,pageX:t,pageY:c}}=this.parent.viewport;this.rotation=U,this.pageRotation=(360+U-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[Z,F],this.pageTranslation=[t,c];const[V,Q]=this.parentDimensions;this.x=l.x/V,this.y=l.y/Q,this.isAttachedToDOM=!1,this.deleted=!1}static get _resizerKeyboardManager(){const l=Ll.prototype._resizeWithKeyboard,U=xW.TRANSLATE_SMALL,Z=xW.TRANSLATE_BIG;return ll(this,"_resizerKeyboardManager",new vW([[["ArrowLeft","mac+ArrowLeft"],l,{args:[-U,0]}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],l,{args:[-Z,0]}],[["ArrowRight","mac+ArrowRight"],l,{args:[U,0]}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],l,{args:[Z,0]}],[["ArrowUp","mac+ArrowUp"],l,{args:[0,-U]}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],l,{args:[0,-Z]}],[["ArrowDown","mac+ArrowDown"],l,{args:[0,U]}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],l,{args:[0,Z]}],[["Escape","mac+Escape"],Ll.prototype._stopResizingWithKeyboard]]))}get editorType(){return Object.getPrototypeOf(this).constructor._type}static get _defaultLineColor(){return ll(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(l){const U=new eJ({id:l.parent.getNextId(),parent:l.parent,uiManager:l._uiManager});U.annotationElementId=l.annotationElementId,U.deleted=!0,U._uiManager.addToAnnotationStorage(U)}static initialize(l,U,Z){if(Ll._l10nPromise||(Ll._l10nPromise=new Map(["pdfjs-editor-alt-text-button-label","pdfjs-editor-alt-text-edit-button-label","pdfjs-editor-alt-text-decorative-tooltip","pdfjs-editor-resizer-label-topLeft","pdfjs-editor-resizer-label-topMiddle","pdfjs-editor-resizer-label-topRight","pdfjs-editor-resizer-label-middleRight","pdfjs-editor-resizer-label-bottomRight","pdfjs-editor-resizer-label-bottomMiddle","pdfjs-editor-resizer-label-bottomLeft","pdfjs-editor-resizer-label-middleLeft"].map(t=>[t,l.get(t.replaceAll(/([A-Z])/g,c=>`-${c.toLowerCase()}`))]))),Z!=null&&Z.strings)for(const t of Z.strings)Ll._l10nPromise.set(t,l.get(t));if(Ll._borderLineWidth!==-1)return;const F=getComputedStyle(document.documentElement);Ll._borderLineWidth=parseFloat(F.getPropertyValue("--outline-width"))||0}static updateDefaultParams(l,U){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(l){return!1}static paste(l,U){Zl("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return W(this,yQ)}set _isDraggable(l){var U;m(this,yQ,l),(U=this.div)==null||U.classList.toggle("draggable",l)}get isEnterHandled(){return!0}center(){const[l,U]=this.pageDimensions;switch(this.parentRotation){case 90:this.x-=this.height*U/(l*2),this.y+=this.width*l/(U*2);break;case 180:this.x+=this.width/2,this.y+=this.height/2;break;case 270:this.x+=this.height*U/(l*2),this.y-=this.width*l/(U*2);break;default:this.x-=this.width/2,this.y-=this.height/2;break}this.fixAndSetPosition()}addCommands(l){this._uiManager.addCommands(l)}get currentLayer(){return this._uiManager.currentLayer}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=W(this,NR)}setParent(l){l!==null?(this.pageIndex=l.pageIndex,this.pageDimensions=l.pageDimensions):b(this,xt,VW).call(this),this.parent=l}focusin(l){this._focusEventsAllowed&&(W(this,Ct)?m(this,Ct,!1):this.parent.setSelected(this))}focusout(l){var U;if(!this._focusEventsAllowed||!this.isAttachedToDOM)return;const Z=l.relatedTarget;Z!=null&&Z.closest(`#${this.id}`)||(l.preventDefault(),(U=this.parent)!=null&&U.isMultipleSelection||this.commitOrRemove())}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}setAt(l,U,Z,F){const[t,c]=this.parentDimensions;[Z,F]=this.screenToPageTranslation(Z,F),this.x=(l+Z)/t,this.y=(U+F)/c,this.fixAndSetPosition()}translate(l,U){b(this,kQ,hR).call(this,this.parentDimensions,l,U)}translateInPage(l,U){W(this,bd)||m(this,bd,[this.x,this.y]),b(this,kQ,hR).call(this,this.pageDimensions,l,U),this.div.scrollIntoView({block:"nearest"})}drag(l,U){W(this,bd)||m(this,bd,[this.x,this.y]);const[Z,F]=this.parentDimensions;if(this.x+=l/Z,this.y+=U/F,this.parent&&(this.x<0||this.x>1||this.y<0||this.y>1)){const{x:a,y:n}=this.div.getBoundingClientRect();this.parent.findNewParent(this,a,n)&&(this.x-=Math.floor(this.x),this.y-=Math.floor(this.y))}let{x:t,y:c}=this;const[V,Q]=this.getBaseTranslation();t+=V,c+=Q,this.div.style.left=`${(100*t).toFixed(2)}%`,this.div.style.top=`${(100*c).toFixed(2)}%`,this.div.scrollIntoView({block:"nearest"})}get _hasBeenMoved(){return!!W(this,bd)&&(W(this,bd)[0]!==this.x||W(this,bd)[1]!==this.y)}getBaseTranslation(){const[l,U]=this.parentDimensions,{_borderLineWidth:Z}=Ll,F=Z/l,t=Z/U;switch(this.rotation){case 90:return[-F,t];case 180:return[F,t];case 270:return[F,-t];default:return[-F,-t]}}get _mustFixPosition(){return!0}fixAndSetPosition(l=this.rotation){const[U,Z]=this.pageDimensions;let{x:F,y:t,width:c,height:V}=this;if(c*=U,V*=Z,F*=U,t*=Z,this._mustFixPosition)switch(l){case 0:F=Math.max(0,Math.min(U-c,F)),t=Math.max(0,Math.min(Z-V,t));break;case 90:F=Math.max(0,Math.min(U-V,F)),t=Math.min(Z,Math.max(c,t));break;case 180:F=Math.min(U,Math.max(c,F)),t=Math.min(Z,Math.max(V,t));break;case 270:F=Math.min(U,Math.max(V,F)),t=Math.max(0,Math.min(Z-c,t));break}this.x=F/=U,this.y=t/=Z;const[Q,a]=this.getBaseTranslation();F+=Q,t+=a;const{style:n}=this.div;n.left=`${(100*F).toFixed(2)}%`,n.top=`${(100*t).toFixed(2)}%`,this.moveInDOM()}screenToPageTranslation(l,U){var Z;return b(Z=Ll,un,bR).call(Z,l,U,this.parentRotation)}pageTranslationToScreen(l,U){var Z;return b(Z=Ll,un,bR).call(Z,l,U,360-this.parentRotation)}get parentScale(){return this._uiManager.viewParameters.realScale}get parentRotation(){return(this._uiManager.viewParameters.rotation+this.pageRotation)%360}get parentDimensions(){const{parentScale:l,pageDimensions:[U,Z]}=this,F=U*l,t=Z*l;return aU.isCSSRoundSupported?[Math.round(F),Math.round(t)]:[F,t]}setDims(l,U){const[Z,F]=this.parentDimensions;this.div.style.width=`${(100*l/Z).toFixed(2)}%`,W(this,tt)||(this.div.style.height=`${(100*U/F).toFixed(2)}%`)}fixDims(){const{style:l}=this.div,{height:U,width:Z}=l,F=Z.endsWith("%"),t=!W(this,tt)&&U.endsWith("%");if(F&&t)return;const[c,V]=this.parentDimensions;F||(l.width=`${(100*parseFloat(Z)/c).toFixed(2)}%`),!W(this,tt)&&!t&&(l.height=`${(100*parseFloat(U)/V).toFixed(2)}%`)}getInitialTranslation(){return[0,0]}altTextFinish(){var l;(l=W(this,lU))==null||l.finish()}async addEditToolbar(){return W(this,ql)||W(this,ct)?W(this,ql):(m(this,ql,new sJ(this)),this.div.append(W(this,ql).render()),W(this,lU)&&W(this,ql).addAltTextButton(await W(this,lU).render()),W(this,ql))}removeEditToolbar(){var l;W(this,ql)&&(W(this,ql).remove(),m(this,ql,null),(l=W(this,lU))==null||l.destroy())}getClientDimensions(){return this.div.getBoundingClientRect()}async addAltTextButton(){W(this,lU)||(Gb.initialize(Ll._l10nPromise),m(this,lU,new Gb(this)),W(this,Ft)&&(W(this,lU).data=W(this,Ft),m(this,Ft,null)),await this.addEditToolbar())}get altTextData(){var l;return(l=W(this,lU))==null?void 0:l.data}set altTextData(l){W(this,lU)&&(W(this,lU).data=l)}hasAltText(){var l;return!((l=W(this,lU))!=null&&l.isEmpty())}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.tabIndex=W(this,nc)?-1:0,this._isVisible||this.div.classList.add("hidden"),this.setInForeground();const l=this._uiManager._signal;this.div.addEventListener("focusin",W(this,sc),{signal:l}),this.div.addEventListener("focusout",W(this,ic),{signal:l});const[U,Z]=this.parentDimensions;this.parentRotation%180!==0&&(this.div.style.maxWidth=`${(100*Z/U).toFixed(2)}%`,this.div.style.maxHeight=`${(100*U/Z).toFixed(2)}%`);const[F,t]=this.getInitialTranslation();return this.translate(F,t),Yn(this,this.div,["pointerdown"]),this.div}pointerdown(l){const{isMac:U}=aU.platform;if(l.button!==0||l.ctrlKey&&U){l.preventDefault();return}if(m(this,Ct,!0),this._isDraggable){b(this,GR,ue).call(this,l);return}b(this,yn,JR).call(this,l)}moveInDOM(){W(this,md)&&clearTimeout(W(this,md)),m(this,md,setTimeout(()=>{var l;m(this,md,null),(l=this.parent)==null||l.moveEditorInDOM(this)},0))}_setParentAndPosition(l,U,Z){l.changeParent(this),this.x=U,this.y=Z,this.fixAndSetPosition()}getRect(l,U,Z=this.rotation){const F=this.parentScale,[t,c]=this.pageDimensions,[V,Q]=this.pageTranslation,a=l/F,n=U/F,s=this.x*t,R=this.y*c,N=this.width*t,h=this.height*c;switch(Z){case 0:return[s+a+V,c-R-n-h+Q,s+a+N+V,c-R-n+Q];case 90:return[s+n+V,c-R+a+Q,s+n+h+V,c-R+a+N+Q];case 180:return[s-a-N+V,c-R+n+Q,s-a+V,c-R+n+h+Q];case 270:return[s-n-h+V,c-R-a-N+Q,s-n+V,c-R-a+Q];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(l,U){const[Z,F,t,c]=l,V=t-Z,Q=c-F;switch(this.rotation){case 0:return[Z,U-c,V,Q];case 90:return[Z,U-F,Q,V];case 180:return[t,U-F,V,Q];case 270:return[t,U-c,Q,V];default:throw new Error("Invalid rotation")}}onceAdded(){}isEmpty(){return!1}enableEditMode(){m(this,ct,!0)}disableEditMode(){m(this,ct,!1)}isInEditMode(){return W(this,ct)}shouldGetKeyboardEvents(){return W(this,XZ)}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}rebuild(){var l,U;const Z=this._uiManager._signal;(l=this.div)==null||l.addEventListener("focusin",W(this,sc),{signal:Z}),(U=this.div)==null||U.addEventListener("focusout",W(this,ic),{signal:Z})}rotate(l){}serialize(l=!1,U=null){Zl("An editor must be serializable")}static deserialize(l,U,Z){const F=new this.prototype.constructor({parent:U,id:U.getNextId(),uiManager:Z});F.rotation=l.rotation,m(F,Ft,l.accessibilityData);const[t,c]=F.pageDimensions,[V,Q,a,n]=F.getRectInCurrentCoords(l.rect,c);return F.x=V/t,F.y=Q/c,F.width=a/t,F.height=n/c,F}get hasBeenModified(){return!!this.annotationElementId&&(this.deleted||this.serialize()!==null)}remove(){if(this.div.removeEventListener("focusin",W(this,sc)),this.div.removeEventListener("focusout",W(this,ic)),this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),W(this,md)&&(clearTimeout(W(this,md)),m(this,md,null)),b(this,xt,VW).call(this),this.removeEditToolbar(),W(this,JU)){for(const l of W(this,JU).values())clearTimeout(l);m(this,JU,null)}this.parent=null}get isResizable(){return!1}makeResizable(){this.isResizable&&(b(this,mR,Be).call(this),W(this,Hl).classList.remove("hidden"),Yn(this,this.div,["keydown"]))}get toolbarPosition(){return null}keydown(l){if(!this.isResizable||l.target!==this.div||l.key!=="Enter")return;this._uiManager.setSelected(this),m(this,wt,{savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height});const U=W(this,Hl).children;if(!W(this,$U)){m(this,$U,Array.from(U));const c=b(this,TR,oe).bind(this),V=b(this,SR,ye).bind(this),Q=this._uiManager._signal;for(const a of W(this,$U)){const n=a.getAttribute("data-resizer-name");a.setAttribute("role","spinbutton"),a.addEventListener("keydown",c,{signal:Q}),a.addEventListener("blur",V,{signal:Q}),a.addEventListener("focus",b(this,XR,ke).bind(this,n),{signal:Q}),Ll._l10nPromise.get(`pdfjs-editor-resizer-label-${n}`).then(s=>a.setAttribute("aria-label",s))}}const Z=W(this,$U)[0];let F=0;for(const c of U){if(c===Z)break;F++}const t=(360-this.rotation+this.parentRotation)%360/90*(W(this,$U).length/4);if(t!==F){if(t<F)for(let V=0;V<F-t;V++)W(this,Hl).append(W(this,Hl).firstChild);else if(t>F)for(let V=0;V<t-F;V++)W(this,Hl).firstChild.before(W(this,Hl).lastChild);let c=0;for(const V of U){const Q=W(this,$U)[c++].getAttribute("data-resizer-name");Ll._l10nPromise.get(`pdfjs-editor-resizer-label-${Q}`).then(a=>V.setAttribute("aria-label",a))}}b(this,kn,YR).call(this,0),m(this,XZ,!0),W(this,Hl).firstChild.focus({focusVisible:!0}),l.preventDefault(),l.stopImmediatePropagation()}_resizeWithKeyboard(l,U){W(this,XZ)&&b(this,on,MR).call(this,W(this,Bn),{movementX:l,movementY:U})}_stopResizingWithKeyboard(){b(this,xt,VW).call(this),this.div.focus()}select(){var l,U;if(this.makeResizable(),(l=this.div)==null||l.classList.add("selectedEditor"),!W(this,ql)){this.addEditToolbar().then(()=>{var Z,F;(Z=this.div)!=null&&Z.classList.contains("selectedEditor")&&((F=W(this,ql))==null||F.show())});return}(U=W(this,ql))==null||U.show()}unselect(){var l,U,Z,F;(l=W(this,Hl))==null||l.classList.add("hidden"),(U=this.div)==null||U.classList.remove("selectedEditor"),(Z=this.div)!=null&&Z.contains(document.activeElement)&&this._uiManager.currentLayer.div.focus({preventScroll:!0}),(F=W(this,ql))==null||F.hide()}updateParams(l,U){}disableEditing(){}enableEditing(){}enterInEditMode(){}getImageForAltText(){return null}get contentDiv(){return this.div}get isEditing(){return W(this,oQ)}set isEditing(l){m(this,oQ,l),this.parent&&(l?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null))}setAspectRatio(l,U){m(this,tt,!0);const Z=l/U,{style:F}=this.div;F.aspectRatio=Z,F.height="auto"}static get MIN_SIZE(){return 16}static canCreateNewEmptyEditor(){return!0}get telemetryInitialData(){return{action:"added"}}get telemetryFinalData(){return null}_reportTelemetry(l,U=!1){if(U){W(this,JU)||m(this,JU,new Map);const{action:Z}=l;let F=W(this,JU).get(Z);F&&clearTimeout(F),F=setTimeout(()=>{this._reportTelemetry(l),W(this,JU).delete(Z),W(this,JU).size===0&&m(this,JU,null)},Ll._telemetryTimeout),W(this,JU).set(Z,F);return}l.type||(l.type=this.editorType),this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:l}})}show(l=this._isVisible){this.div.classList.toggle("hidden",!l),this._isVisible=l}enable(){this.div&&(this.div.tabIndex=0),m(this,nc,!1)}disable(){this.div&&(this.div.tabIndex=-1),m(this,nc,!0)}renderAnnotationElement(l){let U=l.container.querySelector(".annotationContent");if(!U)U=document.createElement("div"),U.classList.add("annotationContent",this.editorType),l.container.prepend(U);else if(U.nodeName==="CANVAS"){const Z=U;U=document.createElement("div"),U.classList.add("annotationContent",this.editorType),Z.before(U)}return U}resetAnnotationElement(l){const{firstChild:U}=l.container;U.nodeName==="DIV"&&U.classList.contains("annotationContent")&&U.remove()}};Ft=new WeakMap,$U=new WeakMap,lU=new WeakMap,nc=new WeakMap,tt=new WeakMap,Hl=new WeakMap,wt=new WeakMap,sc=new WeakMap,ic=new WeakMap,ql=new WeakMap,Bn=new WeakMap,Ct=new WeakMap,bd=new WeakMap,oQ=new WeakMap,ct=new WeakMap,XZ=new WeakMap,md=new WeakMap,Rc=new WeakMap,Nc=new WeakMap,JU=new WeakMap,yQ=new WeakMap,NR=new WeakMap,kQ=new WeakSet,hR=function([d,l],U,Z){[U,Z]=this.screenToPageTranslation(U,Z),this.x+=U/d,this.y+=Z/l,this.fixAndSetPosition()},un=new WeakSet,bR=function(d,l,U){switch(U){case 90:return[l,-d];case 180:return[-d,-l];case 270:return[-l,d];default:return[d,l]}},LQ=new WeakSet,Hs=function(d){switch(d){case 90:{const[l,U]=this.pageDimensions;return[0,-l/U,U/l,0]}case 180:return[-1,0,0,-1];case 270:{const[l,U]=this.pageDimensions;return[0,l/U,-U/l,0]}default:return[1,0,0,1]}},mR=new WeakSet,Be=function(){if(W(this,Hl))return;m(this,Hl,document.createElement("div")),W(this,Hl).classList.add("resizers");const d=this._willKeepAspectRatio?["topLeft","topRight","bottomRight","bottomLeft"]:["topLeft","topMiddle","topRight","middleRight","bottomRight","bottomMiddle","bottomLeft","middleLeft"],l=this._uiManager._signal;for(const U of d){const Z=document.createElement("div");W(this,Hl).append(Z),Z.classList.add("resizer",U),Z.setAttribute("data-resizer-name",U),Z.addEventListener("pointerdown",b(this,eR,Tb).bind(this,U),{signal:l}),Z.addEventListener("contextmenu",nU,{signal:l}),Z.tabIndex=-1}this.div.prepend(W(this,Hl))},eR=new WeakSet,Tb=function(d,l){var U;l.preventDefault();const{isMac:Z}=aU.platform;if(l.button!==0||l.ctrlKey&&Z)return;(U=W(this,lU))==null||U.toggle(!1);const F=b(this,on,MR).bind(this,d),t=this._isDraggable;this._isDraggable=!1;const c=this._uiManager._signal,V={passive:!0,capture:!0,signal:c};this.parent.togglePointerEvents(!1),window.addEventListener("pointermove",F,V),window.addEventListener("contextmenu",nU,{signal:c});const Q=this.x,a=this.y,n=this.width,s=this.height,R=this.parent.div.style.cursor,N=this.div.style.cursor;this.div.style.cursor=this.parent.div.style.cursor=window.getComputedStyle(l.target).cursor;const h=()=>{var e;this.parent.togglePointerEvents(!0),(e=W(this,lU))==null||e.toggle(!0),this._isDraggable=t,window.removeEventListener("pointerup",h),window.removeEventListener("blur",h),window.removeEventListener("pointermove",F,V),window.removeEventListener("contextmenu",nU),this.parent.div.style.cursor=R,this.div.style.cursor=N,b(this,zQ,Ps).call(this,Q,a,n,s)};window.addEventListener("pointerup",h,{signal:c}),window.addEventListener("blur",h,{signal:c})},zQ=new WeakSet,Ps=function(d,l,U,Z){const F=this.x,t=this.y,c=this.width,V=this.height;F===d&&t===l&&c===U&&V===Z||this.addCommands({cmd:()=>{this.width=c,this.height=V,this.x=F,this.y=t;const[Q,a]=this.parentDimensions;this.setDims(Q*c,a*V),this.fixAndSetPosition()},undo:()=>{this.width=U,this.height=Z,this.x=d,this.y=l;const[Q,a]=this.parentDimensions;this.setDims(Q*U,a*Z),this.fixAndSetPosition()},mustExec:!0})},on=new WeakSet,MR=function(d,l){const[U,Z]=this.parentDimensions,F=this.x,t=this.y,c=this.width,V=this.height,Q=ed.MIN_SIZE/U,a=ed.MIN_SIZE/Z,n=u=>Math.round(u*1e4)/1e4,s=b(this,LQ,Hs).call(this,this.rotation),R=(u,E)=>[s[0]*u+s[2]*E,s[1]*u+s[3]*E],N=b(this,LQ,Hs).call(this,360-this.rotation),h=(u,E)=>[N[0]*u+N[2]*E,N[1]*u+N[3]*E];let e,M,J=!1,G=!1;switch(d){case"topLeft":J=!0,e=(u,E)=>[0,0],M=(u,E)=>[u,E];break;case"topMiddle":e=(u,E)=>[u/2,0],M=(u,E)=>[u/2,E];break;case"topRight":J=!0,e=(u,E)=>[u,0],M=(u,E)=>[0,E];break;case"middleRight":G=!0,e=(u,E)=>[u,E/2],M=(u,E)=>[0,E/2];break;case"bottomRight":J=!0,e=(u,E)=>[u,E],M=(u,E)=>[0,0];break;case"bottomMiddle":e=(u,E)=>[u/2,E],M=(u,E)=>[u/2,0];break;case"bottomLeft":J=!0,e=(u,E)=>[0,E],M=(u,E)=>[u,0];break;case"middleLeft":G=!0,e=(u,E)=>[0,E/2],M=(u,E)=>[u,E/2];break}const T=e(c,V),p=M(c,V);let S=R(...p);const X=n(F+S[0]),B=n(t+S[1]);let k=1,Y=1,[o,y]=this.screenToPageTranslation(l.movementX,l.movementY);if([o,y]=h(o/U,y/Z),J){const u=Math.hypot(c,V);k=Y=Math.max(Math.min(Math.hypot(p[0]-T[0]-o,p[1]-T[1]-y)/u,1/c,1/V),Q/c,a/V)}else G?k=Math.max(Q,Math.min(1,Math.abs(p[0]-T[0]-o)))/c:Y=Math.max(a,Math.min(1,Math.abs(p[1]-T[1]-y)))/V;const D=n(c*k),I=n(V*Y);S=R(...M(D,I));const j=X-S[0],x=B-S[1];this.width=D,this.height=I,this.x=j,this.y=x,this.setDims(U*D,Z*I),this.fixAndSetPosition()},yn=new WeakSet,JR=function(d){const{isMac:l}=aU.platform;d.ctrlKey&&!l||d.shiftKey||d.metaKey&&l?this.parent.toggleSelected(this):this.parent.setSelected(this)},GR=new WeakSet,ue=function(d){const l=this._uiManager.isSelected(this);this._uiManager.setUpDragSession();let U,Z;const F=this._uiManager._signal;l&&(this.div.classList.add("moving"),U={passive:!0,capture:!0,signal:F},m(this,Rc,d.clientX),m(this,Nc,d.clientY),Z=c=>{const{clientX:V,clientY:Q}=c,[a,n]=this.screenToPageTranslation(V-W(this,Rc),Q-W(this,Nc));m(this,Rc,V),m(this,Nc,Q),this._uiManager.dragSelectedEditors(a,n)},window.addEventListener("pointermove",Z,U));const t=()=>{window.removeEventListener("pointerup",t),window.removeEventListener("blur",t),l&&(this.div.classList.remove("moving"),window.removeEventListener("pointermove",Z,U)),m(this,Ct,!1),this._uiManager.endDragSession()||b(this,yn,JR).call(this,d)};window.addEventListener("pointerup",t,{signal:F}),window.addEventListener("blur",t,{signal:F})},TR=new WeakSet,oe=function(d){ed._resizerKeyboardManager.exec(this,d)},SR=new WeakSet,ye=function(d){var l;W(this,XZ)&&((l=d.relatedTarget)==null?void 0:l.parentNode)!==W(this,Hl)&&b(this,xt,VW).call(this)},XR=new WeakSet,ke=function(d){m(this,Bn,W(this,XZ)?d:"")},kn=new WeakSet,YR=function(d){if(W(this,$U))for(const l of W(this,$U))l.tabIndex=d},xt=new WeakSet,VW=function(){if(m(this,XZ,!1),b(this,kn,YR).call(this,-1),W(this,wt)){const{savedX:d,savedY:l,savedWidth:U,savedHeight:Z}=W(this,wt);b(this,zQ,Ps).call(this,d,l,U,Z),m(this,wt,null)}},i(ed,un),H(ed,"_borderLineWidth",-1),H(ed,"_colorManager",new mJ),H(ed,"_zIndex",1),H(ed,"_telemetryTimeout",1e3);let cl=ed;class eJ extends cl{constructor(l){super(l),this.annotationElementId=l.annotationElementId,this.deleted=!0}serialize(){return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex}}}const Sb=3285377520,mU=4294901760,gU=65535;class Le{constructor(l){this.h1=l?l&4294967295:Sb,this.h2=l?l&4294967295:Sb}update(l){let U,Z;if(typeof l=="string"){U=new Uint8Array(l.length*2),Z=0;for(let e=0,M=l.length;e<M;e++){const J=l.charCodeAt(e);J<=255?U[Z++]=J:(U[Z++]=J>>>8,U[Z++]=J&255)}}else if(ArrayBuffer.isView(l))U=l.slice(),Z=U.byteLength;else throw new Error("Invalid data format, must be a string or TypedArray.");const F=Z>>2,t=Z-F*4,c=new Uint32Array(U.buffer,0,F);let V=0,Q=0,a=this.h1,n=this.h2;const s=3432918353,R=461845907,N=s&gU,h=R&gU;for(let e=0;e<F;e++)e&1?(V=c[e],V=V*s&mU|V*N&gU,V=V<<15|V>>>17,V=V*R&mU|V*h&gU,a^=V,a=a<<13|a>>>19,a=a*5+3864292196):(Q=c[e],Q=Q*s&mU|Q*N&gU,Q=Q<<15|Q>>>17,Q=Q*R&mU|Q*h&gU,n^=Q,n=n<<13|n>>>19,n=n*5+3864292196);switch(V=0,t){case 3:V^=U[F*4+2]<<16;case 2:V^=U[F*4+1]<<8;case 1:V^=U[F*4],V=V*s&mU|V*N&gU,V=V<<15|V>>>17,V=V*R&mU|V*h&gU,F&1?a^=V:n^=V}this.h1=a,this.h2=n}hexdigest(){let l=this.h1,U=this.h2;return l^=U>>>1,l=l*3981806797&mU|l*36045&gU,U=U*4283543511&mU|((U<<16|l>>>16)*2950163797&mU)>>>16,l^=U>>>1,l=l*444984403&mU|l*60499&gU,U=U*3301882366&mU|((U<<16|l>>>16)*3120437893&mU)>>>16,l^=U>>>1,(l>>>0).toString(16).padStart(8,"0")+(U>>>0).toString(16).padStart(8,"0")}}const pR=Object.freeze({map:null,hash:"",transfer:void 0});var Z0,jl,BR,ze;class fh{constructor(){i(this,BR),i(this,Z0,!1),i(this,jl,new Map),this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(l,U){const Z=W(this,jl).get(l);return Z===void 0?U:Object.assign(U,Z)}getRawValue(l){return W(this,jl).get(l)}remove(l){if(W(this,jl).delete(l),W(this,jl).size===0&&this.resetModified(),typeof this.onAnnotationEditor=="function"){for(const U of W(this,jl).values())if(U instanceof cl)return;this.onAnnotationEditor(null)}}setValue(l,U){const Z=W(this,jl).get(l);let F=!1;if(Z!==void 0)for(const[t,c]of Object.entries(U))Z[t]!==c&&(F=!0,Z[t]=c);else F=!0,W(this,jl).set(l,U);F&&b(this,BR,ze).call(this),U instanceof cl&&typeof this.onAnnotationEditor=="function"&&this.onAnnotationEditor(U.constructor._type)}has(l){return W(this,jl).has(l)}getAll(){return W(this,jl).size>0?jh(W(this,jl)):null}setAll(l){for(const[U,Z]of Object.entries(l))this.setValue(U,Z)}get size(){return W(this,jl).size}resetModified(){W(this,Z0)&&(m(this,Z0,!1),typeof this.onResetModified=="function"&&this.onResetModified())}get print(){return new De(this)}get serializable(){if(W(this,jl).size===0)return pR;const l=new Map,U=new Le,Z=[],F=Object.create(null);let t=!1;for(const[c,V]of W(this,jl)){const Q=V instanceof cl?V.serialize(!1,F):V;Q&&(l.set(c,Q),U.update(`${c}:${JSON.stringify(Q)}`),t||(t=!!Q.bitmap))}if(t)for(const c of l.values())c.bitmap&&Z.push(c.bitmap);return l.size>0?{map:l,hash:U.hexdigest(),transfer:Z}:pR}get editorStats(){let l=null;const U=new Map;for(const Z of W(this,jl).values()){if(!(Z instanceof cl))continue;const F=Z.telemetryFinalData;if(!F)continue;const{type:t}=F;U.has(t)||U.set(t,Object.getPrototypeOf(Z).constructor),l||(l=Object.create(null));const c=l[t]||(l[t]=new Map);for(const[V,Q]of Object.entries(F)){if(V==="type")continue;let a=c.get(V);a||(a=new Map,c.set(V,a));const n=a.get(Q)??0;a.set(Q,n+1)}}for(const[Z,F]of U)l[Z]=F.computeTelemetryFinalData(l[Z]);return l}}Z0=new WeakMap,jl=new WeakMap,BR=new WeakSet,ze=function(){W(this,Z0)||(m(this,Z0,!0),typeof this.onSetModified=="function"&&this.onSetModified())};var DQ;class De extends fh{constructor(l){super(),i(this,DQ,void 0);const{map:U,hash:Z,transfer:F}=l.serializable,t=structuredClone(U,F?{transfer:F}:null);m(this,DQ,{map:t,hash:Z,transfer:F})}get print(){Zl("Should not call PrintAnnotationStorage.print")}get serializable(){return W(this,DQ)}}DQ=new WeakMap;var hc;class MJ{constructor({ownerDocument:l=globalThis.document,styleElement:U=null}){i(this,hc,new Set),this._document=l,this.nativeFontFaces=new Set,this.styleElement=null,this.loadingRequests=[],this.loadTestFontId=0}addNativeFontFace(l){this.nativeFontFaces.add(l),this._document.fonts.add(l)}removeNativeFontFace(l){this.nativeFontFaces.delete(l),this._document.fonts.delete(l)}insertRule(l){this.styleElement||(this.styleElement=this._document.createElement("style"),this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement));const U=this.styleElement.sheet;U.insertRule(l,U.cssRules.length)}clear(){for(const l of this.nativeFontFaces)this._document.fonts.delete(l);this.nativeFontFaces.clear(),W(this,hc).clear(),this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async loadSystemFont({systemFontInfo:l,_inspectFont:U}){if(!(!l||W(this,hc).has(l.loadedName))){if(Jl(!this.disableFontFace,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){const{loadedName:Z,src:F,style:t}=l,c=new FontFace(Z,F,t);this.addNativeFontFace(c);try{await c.load(),W(this,hc).add(Z),U==null||U(l)}catch{f(`Cannot load system font: ${l.baseFontName}, installing it could help to improve PDF rendering.`),this.removeNativeFontFace(c)}return}Zl("Not implemented: loadSystemFont without the Font Loading API.")}}async bind(l){if(l.attached||l.missingFile&&!l.systemFontInfo)return;if(l.attached=!0,l.systemFontInfo){await this.loadSystemFont(l);return}if(this.isFontLoadingAPISupported){const Z=l.createNativeFontFace();if(Z){this.addNativeFontFace(Z);try{await Z.loaded}catch(F){throw f(`Failed to load font '${Z.family}': '${F}'.`),l.disableFontFace=!0,F}}return}const U=l.createFontFaceRule();if(U){if(this.insertRule(U),this.isSyncFontLoadingSupported)return;await new Promise(Z=>{const F=this._queueLoadingCallback(Z);this._prepareFontLoadEvent(l,F)})}}get isFontLoadingAPISupported(){var l;const U=!!((l=this._document)!=null&&l.fonts);return ll(this,"isFontLoadingAPISupported",U)}get isSyncFontLoadingSupported(){let l=!1;return(fl||typeof navigator<"u"&&typeof(navigator==null?void 0:navigator.userAgent)=="string"&&/Mozilla\/5.0.*?rv:\d+.*? Gecko/.test(navigator.userAgent))&&(l=!0),ll(this,"isSyncFontLoadingSupported",l)}_queueLoadingCallback(l){function U(){for(Jl(!F.done,"completeRequest() cannot be called twice."),F.done=!0;Z.length>0&&Z[0].done;){const t=Z.shift();setTimeout(t.callback,0)}}const{loadingRequests:Z}=this,F={done:!1,complete:U,callback:l};return Z.push(F),F}get _loadTestFont(){const l=atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==");return ll(this,"_loadTestFont",l)}_prepareFontLoadEvent(l,U){function Z(T,p){return T.charCodeAt(p)<<24|T.charCodeAt(p+1)<<16|T.charCodeAt(p+2)<<8|T.charCodeAt(p+3)&255}function F(T,p,S,X){const B=T.substring(0,p),k=T.substring(p+S);return B+X+k}let t,c;const V=this._document.createElement("canvas");V.width=1,V.height=1;const Q=V.getContext("2d");let a=0;function n(T,p){if(++a>30){f("Load test font never loaded."),p();return}if(Q.font="30px "+T,Q.fillText(".",0,20),Q.getImageData(0,0,1,1).data[3]>0){p();return}setTimeout(n.bind(null,T,p))}const s=`lt${Date.now()}${this.loadTestFontId++}`;let R=this._loadTestFont;R=F(R,976,s.length,s);const N=16,h=1482184792;let e=Z(R,N);for(t=0,c=s.length-3;t<c;t+=4)e=e-h+Z(s,t)|0;t<s.length&&(e=e-h+Z(s+"XXX",t)|0),R=F(R,N,4,$M(e));const M=`url(data:font/opentype;base64,${btoa(R)});`,J=`@font-face {font-family:"${s}";src:${M}}`;this.insertRule(J);const G=this._document.createElement("div");G.style.visibility="hidden",G.style.width=G.style.height="10px",G.style.position="absolute",G.style.top=G.style.left="0px";for(const T of[l.loadedName,s]){const p=this._document.createElement("span");p.textContent="Hi",p.style.fontFamily=T,G.append(p)}this._document.body.append(G),n(s,()=>{G.remove(),U.complete()})}}hc=new WeakMap;class JJ{constructor(l,{disableFontFace:U=!1,inspectFont:Z=null}){this.compiledGlyphs=Object.create(null);for(const F in l)this[F]=l[F];this.disableFontFace=U===!0,this._inspectFont=Z}createNativeFontFace(){var l;if(!this.data||this.disableFontFace)return null;let U;if(!this.cssFontInfo)U=new FontFace(this.loadedName,this.data,{});else{const Z={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(Z.style=`oblique ${this.cssFontInfo.italicAngle}deg`),U=new FontFace(this.cssFontInfo.fontFamily,this.data,Z)}return(l=this._inspectFont)==null||l.call(this,this),U}createFontFaceRule(){var l;if(!this.data||this.disableFontFace)return null;const U=Qe(this.data),Z=`url(data:${this.mimetype};base64,${btoa(U)});`;let F;if(!this.cssFontInfo)F=`@font-face {font-family:"${this.loadedName}";src:${Z}}`;else{let t=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(t+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`),F=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${t}src:${Z}}`}return(l=this._inspectFont)==null||l.call(this,this,Z),F}getPathGenerator(l,U){if(this.compiledGlyphs[U]!==void 0)return this.compiledGlyphs[U];let Z;try{Z=l.get(this.loadedName+"_path_"+U)}catch(t){f(`getPathGenerator - ignoring character: "${t}".`)}if(!Array.isArray(Z)||Z.length===0)return this.compiledGlyphs[U]=function(t,c){};const F=[];for(let t=0,c=Z.length;t<c;)switch(Z[t++]){case cd.BEZIER_CURVE_TO:{const[V,Q,a,n,s,R]=Z.slice(t,t+6);F.push(N=>N.bezierCurveTo(V,Q,a,n,s,R)),t+=6}break;case cd.MOVE_TO:{const[V,Q]=Z.slice(t,t+2);F.push(a=>a.moveTo(V,Q)),t+=2}break;case cd.LINE_TO:{const[V,Q]=Z.slice(t,t+2);F.push(a=>a.lineTo(V,Q)),t+=2}break;case cd.QUADRATIC_CURVE_TO:{const[V,Q,a,n]=Z.slice(t,t+4);F.push(s=>s.quadraticCurveTo(V,Q,a,n)),t+=4}break;case cd.RESTORE:F.push(V=>V.restore());break;case cd.SAVE:F.push(V=>V.save());break;case cd.SCALE:Jl(F.length===2,"Scale command is only valid at the third position.");break;case cd.TRANSFORM:{const[V,Q,a,n,s,R]=Z.slice(t,t+6);F.push(N=>N.transform(V,Q,a,n,s,R)),t+=6}break;case cd.TRANSLATE:{const[V,Q]=Z.slice(t,t+2);F.push(a=>a.translate(V,Q)),t+=2}break}return this.compiledGlyphs[U]=function(t,c){F[0](t),F[1](t),t.scale(c,-c);for(let V=2,Q=F.length;V<Q;V++)F[V](t)}}}if(fl){var uR=Promise.withResolvers(),Ln=null;(async()=>{const d=await Promise.resolve().then(()=>Fc),l=await Promise.resolve().then(()=>Fc),U=await Promise.resolve().then(()=>Fc),Z=await Promise.resolve().then(()=>Fc);let F,t;try{F=await Promise.resolve().then(()=>Fc)}catch{}try{t=await Promise.resolve().then(()=>IX)}catch{}return new Map(Object.entries({fs:d,http:l,https:U,url:Z,canvas:F,path2d:t}))})().then(d=>{var l,U,Z,F;if(Ln=d,uR.resolve(),!globalThis.DOMMatrix){const t=(l=d.get("canvas"))==null?void 0:l.DOMMatrix;t?globalThis.DOMMatrix=t:f("Cannot polyfill `DOMMatrix`, rendering may be broken.")}if(!globalThis.Path2D){const t=(U=d.get("canvas"))==null?void 0:U.CanvasRenderingContext2D,c=(Z=d.get("path2d"))==null?void 0:Z.applyPath2DToCanvasRenderingContext,V=(F=d.get("path2d"))==null?void 0:F.Path2D;t&&c&&V?(c(t),globalThis.Path2D=V):f("Cannot polyfill `Path2D`, rendering may be broken.")}},d=>{f(`loadPackages: ${d}`),Ln=new Map,uR.resolve()})}class td{static get promise(){return uR.promise}static get(l){return Ln==null?void 0:Ln.get(l)}}const Ie=function(d){return td.get("fs").promises.readFile(d).then(l=>new Uint8Array(l))};class GJ extends ms{}class TJ extends se{_createCanvas(l,U){return td.get("canvas").createCanvas(l,U)}}class SJ extends es{_fetchData(l,U){return Ie(l).then(Z=>({cMapData:Z,compressionType:U}))}}class XJ extends Ms{_fetchData(l){return Ie(l)}}const UU={FILL:"Fill",STROKE:"Stroke",SHADING:"Shading"};function oR(d,l){if(!l)return;const U=l[2]-l[0],Z=l[3]-l[1],F=new Path2D;F.rect(l[0],l[1],U,Z),d.clip(F)}class HW{constructor(){this.constructor===HW&&Zl("Cannot initialize BaseShadingPattern.")}getPattern(){Zl("Abstract method `getPattern` called.")}}class YJ extends HW{constructor(l){super(),this._type=l[1],this._bbox=l[2],this._colorStops=l[3],this._p0=l[4],this._p1=l[5],this._r0=l[6],this._r1=l[7],this.matrix=null}_createGradient(l){let U;this._type==="axial"?U=l.createLinearGradient(this._p0[0],this._p0[1],this._p1[0],this._p1[1]):this._type==="radial"&&(U=l.createRadialGradient(this._p0[0],this._p0[1],this._r0,this._p1[0],this._p1[1],this._r1));for(const Z of this._colorStops)U.addColorStop(Z[0],Z[1]);return U}getPattern(l,U,Z,F){let t;if(F===UU.STROKE||F===UU.FILL){const c=U.current.getClippedPathBoundingBox(F,nl(l))||[0,0,0,0],V=Math.ceil(c[2]-c[0])||1,Q=Math.ceil(c[3]-c[1])||1,a=U.cachedCanvases.getCanvas("pattern",V,Q,!0),n=a.context;n.clearRect(0,0,n.canvas.width,n.canvas.height),n.beginPath(),n.rect(0,0,n.canvas.width,n.canvas.height),n.translate(-c[0],-c[1]),Z=r.transform(Z,[1,0,0,1,c[0],c[1]]),n.transform(...U.baseTransform),this.matrix&&n.transform(...this.matrix),oR(n,this._bbox),n.fillStyle=this._createGradient(n),n.fill(),t=l.createPattern(a.canvas,"no-repeat");const s=new DOMMatrix(Z);t.setTransform(s)}else oR(l,this._bbox),t=this._createGradient(l);return t}}function fs(d,l,U,Z,F,t,c,V){const Q=l.coords,a=l.colors,n=d.data,s=d.width*4;let R;Q[U+1]>Q[Z+1]&&(R=U,U=Z,Z=R,R=t,t=c,c=R),Q[Z+1]>Q[F+1]&&(R=Z,Z=F,F=R,R=c,c=V,V=R),Q[U+1]>Q[Z+1]&&(R=U,U=Z,Z=R,R=t,t=c,c=R);const N=(Q[U]+l.offsetX)*l.scaleX,h=(Q[U+1]+l.offsetY)*l.scaleY,e=(Q[Z]+l.offsetX)*l.scaleX,M=(Q[Z+1]+l.offsetY)*l.scaleY,J=(Q[F]+l.offsetX)*l.scaleX,G=(Q[F+1]+l.offsetY)*l.scaleY;if(h>=G)return;const T=a[t],p=a[t+1],S=a[t+2],X=a[c],B=a[c+1],k=a[c+2],Y=a[V],o=a[V+1],y=a[V+2],D=Math.round(h),I=Math.round(G);let j,x,u,E,A,Wl,ml,dU;for(let Fl=D;Fl<=I;Fl++){if(Fl<M){const L=Fl<h?0:(h-Fl)/(h-M);j=N-(N-e)*L,x=T-(T-X)*L,u=p-(p-B)*L,E=S-(S-k)*L}else{let L;Fl>G?L=1:M===G?L=0:L=(M-Fl)/(M-G),j=e-(e-J)*L,x=X-(X-Y)*L,u=B-(B-o)*L,E=k-(k-y)*L}let Vl;Fl<h?Vl=0:Fl>G?Vl=1:Vl=(h-Fl)/(h-G),A=N-(N-J)*Vl,Wl=T-(T-Y)*Vl,ml=p-(p-o)*Vl,dU=S-(S-y)*Vl;const Cd=Math.round(Math.min(j,A)),hU=Math.round(Math.max(j,A));let w=s*Fl+Cd*4;for(let L=Cd;L<=hU;L++)Vl=(j-L)/(j-A),Vl<0?Vl=0:Vl>1&&(Vl=1),n[w++]=x-(x-Wl)*Vl|0,n[w++]=u-(u-ml)*Vl|0,n[w++]=E-(E-dU)*Vl|0,n[w++]=255}}function pJ(d,l,U){const Z=l.coords,F=l.colors;let t,c;switch(l.type){case"lattice":const V=l.verticesPerRow,Q=Math.floor(Z.length/V)-1,a=V-1;for(t=0;t<Q;t++){let n=t*V;for(let s=0;s<a;s++,n++)fs(d,U,Z[n],Z[n+1],Z[n+V],F[n],F[n+1],F[n+V]),fs(d,U,Z[n+V+1],Z[n+1],Z[n+V],F[n+V+1],F[n+1],F[n+V])}break;case"triangles":for(t=0,c=Z.length;t<c;t+=3)fs(d,U,Z[t],Z[t+1],Z[t+2],F[t],F[t+1],F[t+2]);break;default:throw new Error("illegal figure")}}class BJ extends HW{constructor(l){super(),this._coords=l[2],this._colors=l[3],this._figures=l[4],this._bounds=l[5],this._bbox=l[7],this._background=l[8],this.matrix=null}_createMeshCanvas(l,U,Z){const F=Math.floor(this._bounds[0]),t=Math.floor(this._bounds[1]),c=Math.ceil(this._bounds[2])-F,V=Math.ceil(this._bounds[3])-t,Q=Math.min(Math.ceil(Math.abs(c*l[0]*1.1)),3e3),a=Math.min(Math.ceil(Math.abs(V*l[1]*1.1)),3e3),n=c/Q,s=V/a,R={coords:this._coords,colors:this._colors,offsetX:-F,offsetY:-t,scaleX:1/n,scaleY:1/s},N=Q+2*2,h=a+2*2,e=Z.getCanvas("mesh",N,h,!1),M=e.context,J=M.createImageData(Q,a);if(U){const G=J.data;for(let T=0,p=G.length;T<p;T+=4)G[T]=U[0],G[T+1]=U[1],G[T+2]=U[2],G[T+3]=255}for(const G of this._figures)pJ(J,G,R);return M.putImageData(J,2,2),{canvas:e.canvas,offsetX:F-2*n,offsetY:t-2*s,scaleX:n,scaleY:s}}getPattern(l,U,Z,F){oR(l,this._bbox);let t;if(F===UU.SHADING)t=r.singularValueDecompose2dScale(nl(l));else if(t=r.singularValueDecompose2dScale(U.baseTransform),this.matrix){const V=r.singularValueDecompose2dScale(this.matrix);t=[t[0]*V[0],t[1]*V[1]]}const c=this._createMeshCanvas(t,F===UU.SHADING?null:this._background,U.cachedCanvases);return F!==UU.SHADING&&(l.setTransform(...U.baseTransform),this.matrix&&l.transform(...this.matrix)),l.translate(c.offsetX,c.offsetY),l.scale(c.scaleX,c.scaleY),l.createPattern(c.canvas,"no-repeat")}}class uJ extends HW{getPattern(){return"hotpink"}}function oJ(d){switch(d[0]){case"RadialAxial":return new YJ(d);case"Mesh":return new BJ(d);case"Dummy":return new uJ}throw new Error(`Unknown IR type: ${d[0]}`)}const Xb={COLORED:1,UNCOLORED:2},Ee=class we{constructor(l,U,Z,F,t){this.operatorList=l[2],this.matrix=l[3],this.bbox=l[4],this.xstep=l[5],this.ystep=l[6],this.paintType=l[7],this.tilingType=l[8],this.color=U,this.ctx=Z,this.canvasGraphicsFactory=F,this.baseTransform=t}createPatternCanvas(l){const U=this.operatorList,Z=this.bbox,F=this.xstep,t=this.ystep,c=this.paintType,V=this.tilingType,Q=this.color,a=this.canvasGraphicsFactory;Ns("TilingType: "+V);const n=Z[0],s=Z[1],R=Z[2],N=Z[3],h=r.singularValueDecompose2dScale(this.matrix),e=r.singularValueDecompose2dScale(this.baseTransform),M=[h[0]*e[0],h[1]*e[1]],J=this.getSizeAndScale(F,this.ctx.canvas.width,M[0]),G=this.getSizeAndScale(t,this.ctx.canvas.height,M[1]),T=l.cachedCanvases.getCanvas("pattern",J.size,G.size,!0),p=T.context,S=a.createCanvasGraphics(p);S.groupLevel=l.groupLevel,this.setFillAndStrokeStyleToContext(S,c,Q);let X=n,B=s,k=R,Y=N;return n<0&&(X=0,k+=Math.abs(n)),s<0&&(B=0,Y+=Math.abs(s)),p.translate(-(J.scale*X),-(G.scale*B)),S.transform(J.scale,0,0,G.scale,0,0),p.save(),this.clipBbox(S,X,B,k,Y),S.baseTransform=nl(S.ctx),S.executeOperatorList(U),S.endDrawing(),{canvas:T.canvas,scaleX:J.scale,scaleY:G.scale,offsetX:X,offsetY:B}}getSizeAndScale(l,U,Z){l=Math.abs(l);const F=Math.max(we.MAX_PATTERN_SIZE,U);let t=Math.ceil(l*Z);return t>=F?t=F:Z=t/l,{scale:Z,size:t}}clipBbox(l,U,Z,F,t){const c=F-U,V=t-Z;l.ctx.rect(U,Z,c,V),l.current.updateRectMinMax(nl(l.ctx),[U,Z,F,t]),l.clip(),l.endPath()}setFillAndStrokeStyleToContext(l,U,Z){const F=l.ctx,t=l.current;switch(U){case Xb.COLORED:const c=this.ctx;F.fillStyle=c.fillStyle,F.strokeStyle=c.strokeStyle,t.fillColor=c.fillStyle,t.strokeColor=c.strokeStyle;break;case Xb.UNCOLORED:const V=r.makeHexColor(Z[0],Z[1],Z[2]);F.fillStyle=V,F.strokeStyle=V,t.fillColor=V,t.strokeColor=V;break;default:throw new qM(`Unsupported paint type: ${U}`)}}getPattern(l,U,Z,F){let t=Z;F!==UU.SHADING&&(t=r.transform(t,U.baseTransform),this.matrix&&(t=r.transform(t,this.matrix)));const c=this.createPatternCanvas(U);let V=new DOMMatrix(t);V=V.translate(c.offsetX,c.offsetY),V=V.scale(1/c.scaleX,1/c.scaleY);const Q=l.createPattern(c.canvas,"repeat");return Q.setTransform(V),Q}};H(Ee,"MAX_PATTERN_SIZE",3e3);let yJ=Ee;function kJ({src:d,srcPos:l=0,dest:U,width:Z,height:F,nonBlackColor:t=4294967295,inverseDecode:c=!1}){const V=aU.isLittleEndian?4278190080:255,[Q,a]=c?[t,V]:[V,t],n=Z>>3,s=Z&7,R=d.length;U=new Uint32Array(U.buffer);let N=0;for(let h=0;h<F;h++){for(const M=l+n;l<M;l++){const J=l<R?d[l]:255;U[N++]=J&128?a:Q,U[N++]=J&64?a:Q,U[N++]=J&32?a:Q,U[N++]=J&16?a:Q,U[N++]=J&8?a:Q,U[N++]=J&4?a:Q,U[N++]=J&2?a:Q,U[N++]=J&1?a:Q}if(s===0)continue;const e=l<R?d[l++]:255;for(let M=0;M<s;M++)U[N++]=e&1<<7-M?a:Q}return{srcPos:l,destPos:N}}const Yb=16,pb=100,LJ=15,Bb=10,ub=1e3,WU=16;function zJ(d,l){if(d._removeMirroring)throw new Error("Context is already forwarding operations.");d.__originalSave=d.save,d.__originalRestore=d.restore,d.__originalRotate=d.rotate,d.__originalScale=d.scale,d.__originalTranslate=d.translate,d.__originalTransform=d.transform,d.__originalSetTransform=d.setTransform,d.__originalResetTransform=d.resetTransform,d.__originalClip=d.clip,d.__originalMoveTo=d.moveTo,d.__originalLineTo=d.lineTo,d.__originalBezierCurveTo=d.bezierCurveTo,d.__originalRect=d.rect,d.__originalClosePath=d.closePath,d.__originalBeginPath=d.beginPath,d._removeMirroring=()=>{d.save=d.__originalSave,d.restore=d.__originalRestore,d.rotate=d.__originalRotate,d.scale=d.__originalScale,d.translate=d.__originalTranslate,d.transform=d.__originalTransform,d.setTransform=d.__originalSetTransform,d.resetTransform=d.__originalResetTransform,d.clip=d.__originalClip,d.moveTo=d.__originalMoveTo,d.lineTo=d.__originalLineTo,d.bezierCurveTo=d.__originalBezierCurveTo,d.rect=d.__originalRect,d.closePath=d.__originalClosePath,d.beginPath=d.__originalBeginPath,delete d._removeMirroring},d.save=function(){l.save(),this.__originalSave()},d.restore=function(){l.restore(),this.__originalRestore()},d.translate=function(U,Z){l.translate(U,Z),this.__originalTranslate(U,Z)},d.scale=function(U,Z){l.scale(U,Z),this.__originalScale(U,Z)},d.transform=function(U,Z,F,t,c,V){l.transform(U,Z,F,t,c,V),this.__originalTransform(U,Z,F,t,c,V)},d.setTransform=function(U,Z,F,t,c,V){l.setTransform(U,Z,F,t,c,V),this.__originalSetTransform(U,Z,F,t,c,V)},d.resetTransform=function(){l.resetTransform(),this.__originalResetTransform()},d.rotate=function(U){l.rotate(U),this.__originalRotate(U)},d.clip=function(U){l.clip(U),this.__originalClip(U)},d.moveTo=function(U,Z){l.moveTo(U,Z),this.__originalMoveTo(U,Z)},d.lineTo=function(U,Z){l.lineTo(U,Z),this.__originalLineTo(U,Z)},d.bezierCurveTo=function(U,Z,F,t,c,V){l.bezierCurveTo(U,Z,F,t,c,V),this.__originalBezierCurveTo(U,Z,F,t,c,V)},d.rect=function(U,Z,F,t){l.rect(U,Z,F,t),this.__originalRect(U,Z,F,t)},d.closePath=function(){l.closePath(),this.__originalClosePath()},d.beginPath=function(){l.beginPath(),this.__originalBeginPath()}}class DJ{constructor(l){this.canvasFactory=l,this.cache=Object.create(null)}getCanvas(l,U,Z){let F;return this.cache[l]!==void 0?(F=this.cache[l],this.canvasFactory.reset(F,U,Z)):(F=this.canvasFactory.create(U,Z),this.cache[l]=F),F}delete(l){delete this.cache[l]}clear(){for(const l in this.cache){const U=this.cache[l];this.canvasFactory.destroy(U),delete this.cache[l]}}}function TV(d,l,U,Z,F,t,c,V,Q,a){const[n,s,R,N,h,e]=nl(d);if(s===0&&R===0){const G=c*n+h,T=Math.round(G),p=V*N+e,S=Math.round(p),X=(c+Q)*n+h,B=Math.abs(Math.round(X)-T)||1,k=(V+a)*N+e,Y=Math.abs(Math.round(k)-S)||1;return d.setTransform(Math.sign(n),0,0,Math.sign(N),T,S),d.drawImage(l,U,Z,F,t,0,0,B,Y),d.setTransform(n,s,R,N,h,e),[B,Y]}if(n===0&&N===0){const G=V*R+h,T=Math.round(G),p=c*s+e,S=Math.round(p),X=(V+a)*R+h,B=Math.abs(Math.round(X)-T)||1,k=(c+Q)*s+e,Y=Math.abs(Math.round(k)-S)||1;return d.setTransform(0,Math.sign(s),Math.sign(R),0,T,S),d.drawImage(l,U,Z,F,t,0,0,Y,B),d.setTransform(n,s,R,N,h,e),[Y,B]}d.drawImage(l,U,Z,F,t,c,V,Q,a);const M=Math.hypot(n,s),J=Math.hypot(R,N);return[M*Q,J*a]}function IJ(d){const{width:l,height:U}=d;if(l>ub||U>ub)return null;const Z=1e3,F=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),t=l+1;let c=new Uint8Array(t*(U+1)),V,Q,a;const n=l+7&-8;let s=new Uint8Array(n*U),R=0;for(const M of d.data){let J=128;for(;J>0;)s[R++]=M&J?0:255,J>>=1}let N=0;for(R=0,s[R]!==0&&(c[0]=1,++N),Q=1;Q<l;Q++)s[R]!==s[R+1]&&(c[Q]=s[R]?2:1,++N),R++;for(s[R]!==0&&(c[Q]=2,++N),V=1;V<U;V++){R=V*n,a=V*t,s[R-n]!==s[R]&&(c[a]=s[R]?1:8,++N);let M=(s[R]?4:0)+(s[R-n]?8:0);for(Q=1;Q<l;Q++)M=(M>>2)+(s[R+1]?4:0)+(s[R-n+1]?8:0),F[M]&&(c[a+Q]=F[M],++N),R++;if(s[R-n]!==s[R]&&(c[a+Q]=s[R]?2:4,++N),N>Z)return null}for(R=n*(U-1),a=V*t,s[R]!==0&&(c[a]=8,++N),Q=1;Q<l;Q++)s[R]!==s[R+1]&&(c[a+Q]=s[R]?4:8,++N),R++;if(s[R]!==0&&(c[a+Q]=4,++N),N>Z)return null;const h=new Int32Array([0,t,-1,0,-t,0,0,0,1]),e=new Path2D;for(V=0;N&&V<=U;V++){let M=V*t;const J=M+l;for(;M<J&&!c[M];)M++;if(M===J)continue;e.moveTo(M%t,V);const G=M;let T=c[M];do{const p=h[T];do M+=p;while(!c[M]);const S=c[M];S!==5&&S!==10?(T=S,c[M]=0):(T=S&51*T>>4,c[M]&=T>>2|T<<2),e.lineTo(M%t,M/t|0),c[M]||--N}while(G!==M);--V}return s=null,c=null,function(M){M.save(),M.scale(1/l,-1/U),M.translate(0,-U),M.fill(e),M.beginPath(),M.restore()}}class ob{constructor(l,U){this.alphaIsShape=!1,this.fontSize=0,this.fontSizeScale=1,this.textMatrix=We,this.textMatrixScale=1,this.fontMatrix=fi,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=xl.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,l,U])}clone(){const l=Object.create(this);return l.clipBox=this.clipBox.slice(),l}setCurrentPoint(l,U){this.x=l,this.y=U}updatePathMinMax(l,U,Z){[U,Z]=r.applyTransform([U,Z],l),this.minX=Math.min(this.minX,U),this.minY=Math.min(this.minY,Z),this.maxX=Math.max(this.maxX,U),this.maxY=Math.max(this.maxY,Z)}updateRectMinMax(l,U){const Z=r.applyTransform(U,l),F=r.applyTransform(U.slice(2),l),t=r.applyTransform([U[0],U[3]],l),c=r.applyTransform([U[2],U[1]],l);this.minX=Math.min(this.minX,Z[0],F[0],t[0],c[0]),this.minY=Math.min(this.minY,Z[1],F[1],t[1],c[1]),this.maxX=Math.max(this.maxX,Z[0],F[0],t[0],c[0]),this.maxY=Math.max(this.maxY,Z[1],F[1],t[1],c[1])}updateScalingPathMinMax(l,U){r.scaleMinMax(l,U),this.minX=Math.min(this.minX,U[0]),this.minY=Math.min(this.minY,U[1]),this.maxX=Math.max(this.maxX,U[2]),this.maxY=Math.max(this.maxY,U[3])}updateCurvePathMinMax(l,U,Z,F,t,c,V,Q,a,n){const s=r.bezierBoundingBox(U,Z,F,t,c,V,Q,a,n);n||this.updateRectMinMax(l,s)}getPathBoundingBox(l=UU.FILL,U=null){const Z=[this.minX,this.minY,this.maxX,this.maxY];if(l===UU.STROKE){U||Zl("Stroke bounding box must include transform.");const F=r.singularValueDecompose2dScale(U),t=F[0]*this.lineWidth/2,c=F[1]*this.lineWidth/2;Z[0]-=t,Z[1]-=c,Z[2]+=t,Z[3]+=c}return Z}updateClipFromPath(){const l=r.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(l||[0,0,0,0])}isEmptyClip(){return this.minX===1/0}startNewPathAndClipBox(l){this.clipBox=l,this.minX=1/0,this.minY=1/0,this.maxX=0,this.maxY=0}getClippedPathBoundingBox(l=UU.FILL,U=null){return r.intersect(this.clipBox,this.getPathBoundingBox(l,U))}}function yb(d,l){if(typeof ImageData<"u"&&l instanceof ImageData){d.putImageData(l,0,0);return}const U=l.height,Z=l.width,F=U%WU,t=(U-F)/WU,c=F===0?t:t+1,V=d.createImageData(Z,WU);let Q=0,a;const n=l.data,s=V.data;let R,N,h,e;if(l.kind===bQ.GRAYSCALE_1BPP){const M=n.byteLength,J=new Uint32Array(s.buffer,0,s.byteLength>>2),G=J.length,T=Z+7>>3,p=4294967295,S=aU.isLittleEndian?4278190080:255;for(R=0;R<c;R++){for(h=R<t?WU:F,a=0,N=0;N<h;N++){const X=M-Q;let B=0;const k=X>T?Z:X*8-7,Y=k&-8;let o=0,y=0;for(;B<Y;B+=8)y=n[Q++],J[a++]=y&128?p:S,J[a++]=y&64?p:S,J[a++]=y&32?p:S,J[a++]=y&16?p:S,J[a++]=y&8?p:S,J[a++]=y&4?p:S,J[a++]=y&2?p:S,J[a++]=y&1?p:S;for(;B<k;B++)o===0&&(y=n[Q++],o=128),J[a++]=y&o?p:S,o>>=1}for(;a<G;)J[a++]=0;d.putImageData(V,0,R*WU)}}else if(l.kind===bQ.RGBA_32BPP){for(N=0,e=Z*WU*4,R=0;R<t;R++)s.set(n.subarray(Q,Q+e)),Q+=e,d.putImageData(V,0,N),N+=WU;R<c&&(e=Z*F*4,s.set(n.subarray(Q,Q+e)),d.putImageData(V,0,N))}else if(l.kind===bQ.RGB_24BPP)for(h=WU,e=Z*h,R=0;R<c;R++){for(R>=t&&(h=F,e=Z*h),a=0,N=e;N--;)s[a++]=n[Q++],s[a++]=n[Q++],s[a++]=n[Q++],s[a++]=255;d.putImageData(V,0,R*WU)}else throw new Error(`bad image kind: ${l.kind}`)}function kb(d,l){if(l.bitmap){d.drawImage(l.bitmap,0,0);return}const U=l.height,Z=l.width,F=U%WU,t=(U-F)/WU,c=F===0?t:t+1,V=d.createImageData(Z,WU);let Q=0;const a=l.data,n=V.data;for(let s=0;s<c;s++){const R=s<t?WU:F;({srcPos:Q}=kJ({src:a,srcPos:Q,dest:n,width:Z,height:R,nonBlackColor:0})),d.putImageData(V,0,s*WU)}}function L0(d,l){const U=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font","filter"];for(const Z of U)d[Z]!==void 0&&(l[Z]=d[Z]);d.setLineDash!==void 0&&(l.setLineDash(d.getLineDash()),l.lineDashOffset=d.lineDashOffset)}function SV(d){if(d.strokeStyle=d.fillStyle="#000000",d.fillRule="nonzero",d.globalAlpha=1,d.lineWidth=1,d.lineCap="butt",d.lineJoin="miter",d.miterLimit=10,d.globalCompositeOperation="source-over",d.font="10px sans-serif",d.setLineDash!==void 0&&(d.setLineDash([]),d.lineDashOffset=0),!fl){const{filter:l}=d;l!=="none"&&l!==""&&(d.filter="none")}}function Lb(d,l){if(l)return!0;const U=r.singularValueDecompose2dScale(d);U[0]=Math.fround(U[0]),U[1]=Math.fround(U[1]);const Z=Math.fround((globalThis.devicePixelRatio||1)*h0.PDF_TO_CSS_UNITS);return U[0]<=Z&&U[1]<=Z}const EJ=["butt","round","square"],wJ=["miter","round","bevel"],CJ={},zb={};var IQ,yR,EQ,kR;const xJ=class Ce{constructor(l,U,Z,F,t,{optionalContentConfig:c,markedContentStack:V=null},Q,a){i(this,IQ),i(this,EQ),this.ctx=l,this.current=new ob(this.ctx.canvas.width,this.ctx.canvas.height),this.stateStack=[],this.pendingClip=null,this.pendingEOFill=!1,this.res=null,this.xobjs=null,this.commonObjs=U,this.objs=Z,this.canvasFactory=F,this.filterFactory=t,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=V||[],this.optionalContentConfig=c,this.cachedCanvases=new DJ(this.canvasFactory),this.cachedPatterns=new Map,this.annotationCanvasMap=Q,this.viewportScale=1,this.outputScaleX=1,this.outputScaleY=1,this.pageColors=a,this._cachedScaleForStroking=[-1,0],this._cachedGetSinglePixelWidth=null,this._cachedBitmapsMap=new Map}getObject(l,U=null){return typeof l=="string"?l.startsWith("g_")?this.commonObjs.get(l):this.objs.get(l):U}beginDrawing({transform:l,viewport:U,transparency:Z=!1,background:F=null}){const t=this.ctx.canvas.width,c=this.ctx.canvas.height,V=this.ctx.fillStyle;if(this.ctx.fillStyle=F||"#ffffff",this.ctx.fillRect(0,0,t,c),this.ctx.fillStyle=V,Z){const Q=this.cachedCanvases.getCanvas("transparent",t,c);this.compositeCtx=this.ctx,this.transparentCanvas=Q.canvas,this.ctx=Q.context,this.ctx.save(),this.ctx.transform(...nl(this.compositeCtx))}this.ctx.save(),SV(this.ctx),l&&(this.ctx.transform(...l),this.outputScaleX=l[0],this.outputScaleY=l[0]),this.ctx.transform(...U.transform),this.viewportScale=U.scale,this.baseTransform=nl(this.ctx)}executeOperatorList(l,U,Z,F){const t=l.argsArray,c=l.fnArray;let V=U||0;const Q=t.length;if(Q===V)return V;const a=Q-V>Bb&&typeof Z=="function",n=a?Date.now()+LJ:0;let s=0;const R=this.commonObjs,N=this.objs;let h;for(;;){if(F!==void 0&&V===F.nextBreakPoint)return F.breakIt(V,Z),V;if(h=c[V],h!==EU.dependency)this[h].apply(this,t[V]);else for(const e of t[V]){const M=e.startsWith("g_")?R:N;if(!M.has(e))return M.get(e,Z),V}if(V++,V===Q)return V;if(a&&++s>Bb){if(Date.now()>n)return Z(),V;s=0}}}endDrawing(){b(this,IQ,yR).call(this),this.cachedCanvases.clear(),this.cachedPatterns.clear();for(const l of this._cachedBitmapsMap.values()){for(const U of l.values())typeof HTMLCanvasElement<"u"&&U instanceof HTMLCanvasElement&&(U.width=U.height=0);l.clear()}this._cachedBitmapsMap.clear(),b(this,EQ,kR).call(this)}_scaleImage(l,U){const Z=l.width,F=l.height;let t=Math.max(Math.hypot(U[0],U[1]),1),c=Math.max(Math.hypot(U[2],U[3]),1),V=Z,Q=F,a="prescale1",n,s;for(;t>2&&V>1||c>2&&Q>1;){let R=V,N=Q;t>2&&V>1&&(R=V>=16384?Math.floor(V/2)-1||1:Math.ceil(V/2),t/=V/R),c>2&&Q>1&&(N=Q>=16384?Math.floor(Q/2)-1||1:Math.ceil(Q)/2,c/=Q/N),n=this.cachedCanvases.getCanvas(a,R,N),s=n.context,s.clearRect(0,0,R,N),s.drawImage(l,0,0,V,Q,0,0,R,N),l=n.canvas,V=R,Q=N,a=a==="prescale1"?"prescale2":"prescale1"}return{img:l,paintWidth:V,paintHeight:Q}}_createMaskCanvas(l){const U=this.ctx,{width:Z,height:F}=l,t=this.current.fillColor,c=this.current.patternFill,V=nl(U);let Q,a,n,s;if((l.bitmap||l.data)&&l.count>1){const k=l.bitmap||l.data.buffer;a=JSON.stringify(c?V:[V.slice(0,4),t]),Q=this._cachedBitmapsMap.get(k),Q||(Q=new Map,this._cachedBitmapsMap.set(k,Q));const Y=Q.get(a);if(Y&&!c){const o=Math.round(Math.min(V[0],V[2])+V[4]),y=Math.round(Math.min(V[1],V[3])+V[5]);return{canvas:Y,offsetX:o,offsetY:y}}n=Y}n||(s=this.cachedCanvases.getCanvas("maskCanvas",Z,F),kb(s.context,l));let R=r.transform(V,[1/Z,0,0,-1/F,0,0]);R=r.transform(R,[1,0,0,1,0,-F]);const[N,h,e,M]=r.getAxialAlignedBoundingBox([0,0,Z,F],R),J=Math.round(e-N)||1,G=Math.round(M-h)||1,T=this.cachedCanvases.getCanvas("fillCanvas",J,G),p=T.context,S=N,X=h;p.translate(-S,-X),p.transform(...R),n||(n=this._scaleImage(s.canvas,Wd(p)),n=n.img,Q&&c&&Q.set(a,n)),p.imageSmoothingEnabled=Lb(nl(p),l.interpolate),TV(p,n,0,0,n.width,n.height,0,0,Z,F),p.globalCompositeOperation="source-in";const B=r.transform(Wd(p),[1,0,0,1,-S,-X]);return p.fillStyle=c?t.getPattern(U,this,B,UU.FILL):t,p.fillRect(0,0,Z,F),Q&&!c&&(this.cachedCanvases.delete("fillCanvas"),Q.set(a,T.canvas)),{canvas:T.canvas,offsetX:Math.round(S),offsetY:Math.round(X)}}setLineWidth(l){l!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1),this.current.lineWidth=l,this.ctx.lineWidth=l}setLineCap(l){this.ctx.lineCap=EJ[l]}setLineJoin(l){this.ctx.lineJoin=wJ[l]}setMiterLimit(l){this.ctx.miterLimit=l}setDash(l,U){const Z=this.ctx;Z.setLineDash!==void 0&&(Z.setLineDash(l),Z.lineDashOffset=U)}setRenderingIntent(l){}setFlatness(l){}setGState(l){for(const[U,Z]of l)switch(U){case"LW":this.setLineWidth(Z);break;case"LC":this.setLineCap(Z);break;case"LJ":this.setLineJoin(Z);break;case"ML":this.setMiterLimit(Z);break;case"D":this.setDash(Z[0],Z[1]);break;case"RI":this.setRenderingIntent(Z);break;case"FL":this.setFlatness(Z);break;case"Font":this.setFont(Z[0],Z[1]);break;case"CA":this.current.strokeAlpha=Z;break;case"ca":this.current.fillAlpha=Z,this.ctx.globalAlpha=Z;break;case"BM":this.ctx.globalCompositeOperation=Z;break;case"SMask":this.current.activeSMask=Z?this.tempSMask:null,this.tempSMask=null,this.checkSMaskState();break;case"TR":this.ctx.filter=this.current.transferMaps=this.filterFactory.addFilter(Z);break}}get inSMaskMode(){return!!this.suspendedCtx}checkSMaskState(){const l=this.inSMaskMode;this.current.activeSMask&&!l?this.beginSMaskMode():!this.current.activeSMask&&l&&this.endSMaskMode()}beginSMaskMode(){if(this.inSMaskMode)throw new Error("beginSMaskMode called while already in smask mode");const l=this.ctx.canvas.width,U=this.ctx.canvas.height,Z="smaskGroupAt"+this.groupLevel,F=this.cachedCanvases.getCanvas(Z,l,U);this.suspendedCtx=this.ctx,this.ctx=F.context;const t=this.ctx;t.setTransform(...nl(this.suspendedCtx)),L0(this.suspendedCtx,t),zJ(t,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(),L0(this.ctx,this.suspendedCtx),this.ctx=this.suspendedCtx,this.suspendedCtx=null}compose(l){if(!this.current.activeSMask)return;l?(l[0]=Math.floor(l[0]),l[1]=Math.floor(l[1]),l[2]=Math.ceil(l[2]),l[3]=Math.ceil(l[3])):l=[0,0,this.ctx.canvas.width,this.ctx.canvas.height];const U=this.current.activeSMask,Z=this.suspendedCtx;this.composeSMask(Z,U,this.ctx,l),this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.clearRect(0,0,this.ctx.canvas.width,this.ctx.canvas.height),this.ctx.restore()}composeSMask(l,U,Z,F){const t=F[0],c=F[1],V=F[2]-t,Q=F[3]-c;V===0||Q===0||(this.genericComposeSMask(U.context,Z,V,Q,U.subtype,U.backdrop,U.transferMap,t,c,U.offsetX,U.offsetY),l.save(),l.globalAlpha=1,l.globalCompositeOperation="source-over",l.setTransform(1,0,0,1,0,0),l.drawImage(Z.canvas,0,0),l.restore())}genericComposeSMask(l,U,Z,F,t,c,V,Q,a,n,s){let R=l.canvas,N=Q-n,h=a-s;if(c){if(N<0||h<0||N+Z>R.width||h+F>R.height){const M=this.cachedCanvases.getCanvas("maskExtension",Z,F),J=M.context;J.drawImage(R,-N,-h),c.some(G=>G!==0)&&(J.globalCompositeOperation="destination-atop",J.fillStyle=r.makeHexColor(...c),J.fillRect(0,0,Z,F),J.globalCompositeOperation="source-over"),R=M.canvas,N=h=0}else if(c.some(M=>M!==0)){l.save(),l.globalAlpha=1,l.setTransform(1,0,0,1,0,0);const M=new Path2D;M.rect(N,h,Z,F),l.clip(M),l.globalCompositeOperation="destination-atop",l.fillStyle=r.makeHexColor(...c),l.fillRect(N,h,Z,F),l.restore()}}U.save(),U.globalAlpha=1,U.setTransform(1,0,0,1,0,0),t==="Alpha"&&V?U.filter=this.filterFactory.addAlphaFilter(V):t==="Luminosity"&&(U.filter=this.filterFactory.addLuminosityFilter(V));const e=new Path2D;e.rect(Q,a,Z,F),U.clip(e),U.globalCompositeOperation="destination-in",U.drawImage(R,N,h,Z,F,Q,a,Z,F),U.restore()}save(){this.inSMaskMode?(L0(this.ctx,this.suspendedCtx),this.suspendedCtx.save()):this.ctx.save();const l=this.current;this.stateStack.push(l),this.current=l.clone()}restore(){this.stateStack.length===0&&this.inSMaskMode&&this.endSMaskMode(),this.stateStack.length!==0&&(this.current=this.stateStack.pop(),this.inSMaskMode?(this.suspendedCtx.restore(),L0(this.suspendedCtx,this.ctx)):this.ctx.restore(),this.checkSMaskState(),this.pendingClip=null,this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null)}transform(l,U,Z,F,t,c){this.ctx.transform(l,U,Z,F,t,c),this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}constructPath(l,U,Z){const F=this.ctx,t=this.current;let c=t.x,V=t.y,Q,a;const n=nl(F),s=n[0]===0&&n[3]===0||n[1]===0&&n[2]===0,R=s?Z.slice(0):null;for(let N=0,h=0,e=l.length;N<e;N++)switch(l[N]|0){case EU.rectangle:c=U[h++],V=U[h++];const M=U[h++],J=U[h++],G=c+M,T=V+J;F.moveTo(c,V),M===0||J===0?F.lineTo(G,T):(F.lineTo(G,V),F.lineTo(G,T),F.lineTo(c,T)),s||t.updateRectMinMax(n,[c,V,G,T]),F.closePath();break;case EU.moveTo:c=U[h++],V=U[h++],F.moveTo(c,V),s||t.updatePathMinMax(n,c,V);break;case EU.lineTo:c=U[h++],V=U[h++],F.lineTo(c,V),s||t.updatePathMinMax(n,c,V);break;case EU.curveTo:Q=c,a=V,c=U[h+4],V=U[h+5],F.bezierCurveTo(U[h],U[h+1],U[h+2],U[h+3],c,V),t.updateCurvePathMinMax(n,Q,a,U[h],U[h+1],U[h+2],U[h+3],c,V,R),h+=6;break;case EU.curveTo2:Q=c,a=V,F.bezierCurveTo(c,V,U[h],U[h+1],U[h+2],U[h+3]),t.updateCurvePathMinMax(n,Q,a,c,V,U[h],U[h+1],U[h+2],U[h+3],R),c=U[h+2],V=U[h+3],h+=4;break;case EU.curveTo3:Q=c,a=V,c=U[h+2],V=U[h+3],F.bezierCurveTo(U[h],U[h+1],c,V,c,V),t.updateCurvePathMinMax(n,Q,a,U[h],U[h+1],c,V,c,V,R),h+=4;break;case EU.closePath:F.closePath();break}s&&t.updateScalingPathMinMax(n,R),t.setCurrentPoint(c,V)}closePath(){this.ctx.closePath()}stroke(l=!0){const U=this.ctx,Z=this.current.strokeColor;U.globalAlpha=this.current.strokeAlpha,this.contentVisible&&(typeof Z=="object"&&Z!=null&&Z.getPattern?(U.save(),U.strokeStyle=Z.getPattern(U,this,Wd(U),UU.STROKE),this.rescaleAndStroke(!1),U.restore()):this.rescaleAndStroke(!0)),l&&this.consumePath(this.current.getClippedPathBoundingBox()),U.globalAlpha=this.current.fillAlpha}closeStroke(){this.closePath(),this.stroke()}fill(l=!0){const U=this.ctx,Z=this.current.fillColor,F=this.current.patternFill;let t=!1;F&&(U.save(),U.fillStyle=Z.getPattern(U,this,Wd(U),UU.FILL),t=!0);const c=this.current.getClippedPathBoundingBox();this.contentVisible&&c!==null&&(this.pendingEOFill?(U.fill("evenodd"),this.pendingEOFill=!1):U.fill()),t&&U.restore(),l&&this.consumePath(c)}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=CJ}eoClip(){this.pendingClip=zb}beginText(){this.current.textMatrix=We,this.current.textMatrixScale=1,this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}endText(){const l=this.pendingTextPaths,U=this.ctx;if(l===void 0){U.beginPath();return}U.save(),U.beginPath();for(const Z of l)U.setTransform(...Z.transform),U.translate(Z.x,Z.y),Z.addToPath(U,Z.fontSize);U.restore(),U.clip(),U.beginPath(),delete this.pendingTextPaths}setCharSpacing(l){this.current.charSpacing=l}setWordSpacing(l){this.current.wordSpacing=l}setHScale(l){this.current.textHScale=l/100}setLeading(l){this.current.leading=-l}setFont(l,U){var Z;const F=this.commonObjs.get(l),t=this.current;if(!F)throw new Error(`Can't find font for ${l}`);if(t.fontMatrix=F.fontMatrix||fi,(t.fontMatrix[0]===0||t.fontMatrix[3]===0)&&f("Invalid font matrix for font "+l),U<0?(U=-U,t.fontDirection=-1):t.fontDirection=1,this.current.font=F,this.current.fontSize=U,F.isType3Font)return;const c=F.loadedName||"sans-serif",V=((Z=F.systemFontInfo)==null?void 0:Z.css)||`"${c}", ${F.fallbackName}`;let Q="normal";F.black?Q="900":F.bold&&(Q="bold");const a=F.italic?"italic":"normal";let n=U;U<Yb?n=Yb:U>pb&&(n=pb),this.current.fontSizeScale=U/n,this.ctx.font=`${a} ${Q} ${n}px ${V}`}setTextRenderingMode(l){this.current.textRenderingMode=l}setTextRise(l){this.current.textRise=l}moveText(l,U){this.current.x=this.current.lineX+=l,this.current.y=this.current.lineY+=U}setLeadingMoveText(l,U){this.setLeading(-U),this.moveText(l,U)}setTextMatrix(l,U,Z,F,t,c){this.current.textMatrix=[l,U,Z,F,t,c],this.current.textMatrixScale=Math.hypot(l,U),this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}nextLine(){this.moveText(0,this.current.leading)}paintChar(l,U,Z,F){const t=this.ctx,c=this.current,V=c.font,Q=c.textRenderingMode,a=c.fontSize/c.fontSizeScale,n=Q&xl.FILL_STROKE_MASK,s=!!(Q&xl.ADD_TO_PATH_FLAG),R=c.patternFill&&!V.missingFile;let N;(V.disableFontFace||s||R)&&(N=V.getPathGenerator(this.commonObjs,l)),V.disableFontFace||R?(t.save(),t.translate(U,Z),t.beginPath(),N(t,a),F&&t.setTransform(...F),(n===xl.FILL||n===xl.FILL_STROKE)&&t.fill(),(n===xl.STROKE||n===xl.FILL_STROKE)&&t.stroke(),t.restore()):((n===xl.FILL||n===xl.FILL_STROKE)&&t.fillText(l,U,Z),(n===xl.STROKE||n===xl.FILL_STROKE)&&t.strokeText(l,U,Z)),s&&(this.pendingTextPaths||(this.pendingTextPaths=[])).push({transform:nl(t),x:U,y:Z,fontSize:a,addToPath:N})}get isFontSubpixelAAEnabled(){const{context:l}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10);l.scale(1.5,1),l.fillText("I",0,10);const U=l.getImageData(0,0,10,10).data;let Z=!1;for(let F=3;F<U.length;F+=4)if(U[F]>0&&U[F]<255){Z=!0;break}return ll(this,"isFontSubpixelAAEnabled",Z)}showText(l){const U=this.current,Z=U.font;if(Z.isType3Font)return this.showType3Text(l);const F=U.fontSize;if(F===0)return;const t=this.ctx,c=U.fontSizeScale,V=U.charSpacing,Q=U.wordSpacing,a=U.fontDirection,n=U.textHScale*a,s=l.length,R=Z.vertical,N=R?1:-1,h=Z.defaultVMetrics,e=F*U.fontMatrix[0],M=U.textRenderingMode===xl.FILL&&!Z.disableFontFace&&!U.patternFill;t.save(),t.transform(...U.textMatrix),t.translate(U.x,U.y+U.textRise),a>0?t.scale(n,-1):t.scale(n,1);let J;if(U.patternFill){t.save();const X=U.fillColor.getPattern(t,this,Wd(t),UU.FILL);J=nl(t),t.restore(),t.fillStyle=X}let G=U.lineWidth;const T=U.textMatrixScale;if(T===0||G===0){const X=U.textRenderingMode&xl.FILL_STROKE_MASK;(X===xl.STROKE||X===xl.FILL_STROKE)&&(G=this.getSinglePixelWidth())}else G/=T;if(c!==1&&(t.scale(c,c),G/=c),t.lineWidth=G,Z.isInvalidPDFjsFont){const X=[];let B=0;for(const k of l)X.push(k.unicode),B+=k.width;t.fillText(X.join(""),0,0),U.x+=B*e*n,t.restore(),this.compose();return}let p=0,S;for(S=0;S<s;++S){const X=l[S];if(typeof X=="number"){p+=N*X*F/1e3;continue}let B=!1;const k=(X.isSpace?Q:0)+V,Y=X.fontChar,o=X.accent;let y,D,I=X.width;if(R){const x=X.vmetric||h,u=-(X.vmetric?x[1]:I*.5)*e,E=x[2]*e;I=x?-x[0]:I,y=u/c,D=(p+E)/c}else y=p/c,D=0;if(Z.remeasure&&I>0){const x=t.measureText(Y).width*1e3/F*c;if(I<x&&this.isFontSubpixelAAEnabled){const u=I/x;B=!0,t.save(),t.scale(u,1),y/=u}else I!==x&&(y+=(I-x)/2e3*F/c)}if(this.contentVisible&&(X.isInFont||Z.missingFile)){if(M&&!o)t.fillText(Y,y,D);else if(this.paintChar(Y,y,D,J),o){const x=y+F*o.offset.x/c,u=D-F*o.offset.y/c;this.paintChar(o.fontChar,x,u,J)}}const j=R?I*e-k*a:I*e+k*a;p+=j,B&&t.restore()}R?U.y-=p:U.x+=p*n,t.restore(),this.compose()}showType3Text(l){const U=this.ctx,Z=this.current,F=Z.font,t=Z.fontSize,c=Z.fontDirection,V=F.vertical?1:-1,Q=Z.charSpacing,a=Z.wordSpacing,n=Z.textHScale*c,s=Z.fontMatrix||fi,R=l.length,N=Z.textRenderingMode===xl.INVISIBLE;let h,e,M,J;if(!(N||t===0)){for(this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null,U.save(),U.transform(...Z.textMatrix),U.translate(Z.x,Z.y),U.scale(n,c),h=0;h<R;++h){if(e=l[h],typeof e=="number"){J=V*e*t/1e3,this.ctx.translate(J,0),Z.x+=J*n;continue}const G=(e.isSpace?a:0)+Q,T=F.charProcOperatorList[e.operatorListId];if(!T){f(`Type3 character "${e.operatorListId}" is not available.`);continue}this.contentVisible&&(this.processingType3=e,this.save(),U.scale(t,t),U.transform(...s),this.executeOperatorList(T),this.restore()),M=r.applyTransform([e.width,0],s)[0]*t+G,U.translate(M,0),Z.x+=M*n}U.restore(),this.processingType3=null}}setCharWidth(l,U){}setCharWidthAndBounds(l,U,Z,F,t,c){this.ctx.rect(Z,F,t-Z,c-F),this.ctx.clip(),this.endPath()}getColorN_Pattern(l){let U;if(l[0]==="TilingPattern"){const Z=l[1],F=this.baseTransform||nl(this.ctx),t={createCanvasGraphics:c=>new Ce(c,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack})};U=new yJ(l,Z,this.ctx,t,F)}else U=this._getPattern(l[1],l[2]);return U}setStrokeColorN(){this.current.strokeColor=this.getColorN_Pattern(arguments)}setFillColorN(){this.current.fillColor=this.getColorN_Pattern(arguments),this.current.patternFill=!0}setStrokeRGBColor(l,U,Z){const F=r.makeHexColor(l,U,Z);this.ctx.strokeStyle=F,this.current.strokeColor=F}setFillRGBColor(l,U,Z){const F=r.makeHexColor(l,U,Z);this.ctx.fillStyle=F,this.current.fillColor=F,this.current.patternFill=!1}_getPattern(l,U=null){let Z;return this.cachedPatterns.has(l)?Z=this.cachedPatterns.get(l):(Z=oJ(this.getObject(l)),this.cachedPatterns.set(l,Z)),U&&(Z.matrix=U),Z}shadingFill(l){if(!this.contentVisible)return;const U=this.ctx;this.save();const Z=this._getPattern(l);U.fillStyle=Z.getPattern(U,this,Wd(U),UU.SHADING);const F=Wd(U);if(F){const{width:t,height:c}=U.canvas,[V,Q,a,n]=r.getAxialAlignedBoundingBox([0,0,t,c],F);this.ctx.fillRect(V,Q,a-V,n-Q)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.compose(this.current.getClippedPathBoundingBox()),this.restore()}beginInlineImage(){Zl("Should not call beginInlineImage")}beginImageData(){Zl("Should not call beginImageData")}paintFormXObjectBegin(l,U){if(this.contentVisible&&(this.save(),this.baseTransformStack.push(this.baseTransform),l&&this.transform(...l),this.baseTransform=nl(this.ctx),U)){const Z=U[2]-U[0],F=U[3]-U[1];this.ctx.rect(U[0],U[1],Z,F),this.current.updateRectMinMax(nl(this.ctx),U),this.clip(),this.endPath()}}paintFormXObjectEnd(){this.contentVisible&&(this.restore(),this.baseTransform=this.baseTransformStack.pop())}beginGroup(l){if(!this.contentVisible)return;this.save(),this.inSMaskMode&&(this.endSMaskMode(),this.current.activeSMask=null);const U=this.ctx;l.isolated||Ns("TODO: Support non-isolated groups."),l.knockout&&f("Knockout groups not supported.");const Z=nl(U);if(l.matrix&&U.transform(...l.matrix),!l.bbox)throw new Error("Bounding box is required.");let F=r.getAxialAlignedBoundingBox(l.bbox,nl(U));const t=[0,0,U.canvas.width,U.canvas.height];F=r.intersect(F,t)||[0,0,0,0];const c=Math.floor(F[0]),V=Math.floor(F[1]),Q=Math.max(Math.ceil(F[2])-c,1),a=Math.max(Math.ceil(F[3])-V,1);this.current.startNewPathAndClipBox([0,0,Q,a]);let n="groupAt"+this.groupLevel;l.smask&&(n+="_smask_"+this.smaskCounter++%2);const s=this.cachedCanvases.getCanvas(n,Q,a),R=s.context;R.translate(-c,-V),R.transform(...Z),l.smask?this.smaskStack.push({canvas:s.canvas,context:R,offsetX:c,offsetY:V,subtype:l.smask.subtype,backdrop:l.smask.backdrop,transferMap:l.smask.transferMap||null,startTransformInverse:null}):(U.setTransform(1,0,0,1,0,0),U.translate(c,V),U.save()),L0(U,R),this.ctx=R,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(U),this.groupLevel++}endGroup(l){if(!this.contentVisible)return;this.groupLevel--;const U=this.ctx,Z=this.groupStack.pop();if(this.ctx=Z,this.ctx.imageSmoothingEnabled=!1,l.smask)this.tempSMask=this.smaskStack.pop(),this.restore();else{this.ctx.restore();const F=nl(this.ctx);this.restore(),this.ctx.save(),this.ctx.setTransform(...F);const t=r.getAxialAlignedBoundingBox([0,0,U.canvas.width,U.canvas.height],F);this.ctx.drawImage(U.canvas,0,0),this.ctx.restore(),this.compose(t)}}beginAnnotation(l,U,Z,F,t){if(b(this,IQ,yR).call(this),SV(this.ctx),this.ctx.save(),this.save(),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),U){const c=U[2]-U[0],V=U[3]-U[1];if(t&&this.annotationCanvasMap){Z=Z.slice(),Z[4]-=U[0],Z[5]-=U[1],U=U.slice(),U[0]=U[1]=0,U[2]=c,U[3]=V;const[Q,a]=r.singularValueDecompose2dScale(nl(this.ctx)),{viewportScale:n}=this,s=Math.ceil(c*this.outputScaleX*n),R=Math.ceil(V*this.outputScaleY*n);this.annotationCanvas=this.canvasFactory.create(s,R);const{canvas:N,context:h}=this.annotationCanvas;this.annotationCanvasMap.set(l,N),this.annotationCanvas.savedCtx=this.ctx,this.ctx=h,this.ctx.save(),this.ctx.setTransform(Q,0,0,-a,0,V*a),SV(this.ctx)}else SV(this.ctx),this.ctx.rect(U[0],U[1],c,V),this.ctx.clip(),this.endPath()}this.current=new ob(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(...Z),this.transform(...F)}endAnnotation(){this.annotationCanvas&&(this.ctx.restore(),b(this,EQ,kR).call(this),this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas)}paintImageMaskXObject(l){if(!this.contentVisible)return;const U=l.count;l=this.getObject(l.data,l),l.count=U;const Z=this.ctx,F=this.processingType3;if(F&&(F.compiled===void 0&&(F.compiled=IJ(l)),F.compiled)){F.compiled(Z);return}const t=this._createMaskCanvas(l),c=t.canvas;Z.save(),Z.setTransform(1,0,0,1,0,0),Z.drawImage(c,t.offsetX,t.offsetY),Z.restore(),this.compose()}paintImageMaskXObjectRepeat(l,U,Z=0,F=0,t,c){if(!this.contentVisible)return;l=this.getObject(l.data,l);const V=this.ctx;V.save();const Q=nl(V);V.transform(U,Z,F,t,0,0);const a=this._createMaskCanvas(l);V.setTransform(1,0,0,1,a.offsetX-Q[4],a.offsetY-Q[5]);for(let n=0,s=c.length;n<s;n+=2){const R=r.transform(Q,[U,Z,F,t,c[n],c[n+1]]),[N,h]=r.applyTransform([0,0],R);V.drawImage(a.canvas,N,h)}V.restore(),this.compose()}paintImageMaskXObjectGroup(l){if(!this.contentVisible)return;const U=this.ctx,Z=this.current.fillColor,F=this.current.patternFill;for(const t of l){const{data:c,width:V,height:Q,transform:a}=t,n=this.cachedCanvases.getCanvas("maskCanvas",V,Q),s=n.context;s.save();const R=this.getObject(c,t);kb(s,R),s.globalCompositeOperation="source-in",s.fillStyle=F?Z.getPattern(s,this,Wd(U),UU.FILL):Z,s.fillRect(0,0,V,Q),s.restore(),U.save(),U.transform(...a),U.scale(1,-1),TV(U,n.canvas,0,0,V,Q,0,-1,1,1),U.restore()}this.compose()}paintImageXObject(l){if(!this.contentVisible)return;const U=this.getObject(l);if(!U){f("Dependent image isn't ready yet");return}this.paintInlineImageXObject(U)}paintImageXObjectRepeat(l,U,Z,F){if(!this.contentVisible)return;const t=this.getObject(l);if(!t){f("Dependent image isn't ready yet");return}const c=t.width,V=t.height,Q=[];for(let a=0,n=F.length;a<n;a+=2)Q.push({transform:[U,0,0,Z,F[a],F[a+1]],x:0,y:0,w:c,h:V});this.paintInlineImageXObjectGroup(t,Q)}applyTransferMapsToCanvas(l){return this.current.transferMaps!=="none"&&(l.filter=this.current.transferMaps,l.drawImage(l.canvas,0,0),l.filter="none"),l.canvas}applyTransferMapsToBitmap(l){if(this.current.transferMaps==="none")return l.bitmap;const{bitmap:U,width:Z,height:F}=l,t=this.cachedCanvases.getCanvas("inlineImage",Z,F),c=t.context;return c.filter=this.current.transferMaps,c.drawImage(U,0,0),c.filter="none",t.canvas}paintInlineImageXObject(l){if(!this.contentVisible)return;const U=l.width,Z=l.height,F=this.ctx;if(this.save(),!fl){const{filter:V}=F;V!=="none"&&V!==""&&(F.filter="none")}F.scale(1/U,-1/Z);let t;if(l.bitmap)t=this.applyTransferMapsToBitmap(l);else if(typeof HTMLElement=="function"&&l instanceof HTMLElement||!l.data)t=l;else{const V=this.cachedCanvases.getCanvas("inlineImage",U,Z).context;yb(V,l),t=this.applyTransferMapsToCanvas(V)}const c=this._scaleImage(t,Wd(F));F.imageSmoothingEnabled=Lb(nl(F),l.interpolate),TV(F,c.img,0,0,c.paintWidth,c.paintHeight,0,-Z,U,Z),this.compose(),this.restore()}paintInlineImageXObjectGroup(l,U){if(!this.contentVisible)return;const Z=this.ctx;let F;if(l.bitmap)F=l.bitmap;else{const t=l.width,c=l.height,V=this.cachedCanvases.getCanvas("inlineImage",t,c).context;yb(V,l),F=this.applyTransferMapsToCanvas(V)}for(const t of U)Z.save(),Z.transform(...t.transform),Z.scale(1,-1),TV(Z,F,t.x,t.y,t.w,t.h,0,-1,1,1),Z.restore();this.compose()}paintSolidColorImageMask(){this.contentVisible&&(this.ctx.fillRect(0,0,1,1),this.compose())}markPoint(l){}markPointProps(l,U){}beginMarkedContent(l){this.markedContentStack.push({visible:!0})}beginMarkedContentProps(l,U){l==="OC"?this.markedContentStack.push({visible:this.optionalContentConfig.isVisible(U)}):this.markedContentStack.push({visible:!0}),this.contentVisible=this.isContentVisible()}endMarkedContent(){this.markedContentStack.pop(),this.contentVisible=this.isContentVisible()}beginCompat(){}endCompat(){}consumePath(l){const U=this.current.isEmptyClip();this.pendingClip&&this.current.updateClipFromPath(),this.pendingClip||this.compose(l);const Z=this.ctx;this.pendingClip&&(U||(this.pendingClip===zb?Z.clip("evenodd"):Z.clip()),this.pendingClip=null),this.current.startNewPathAndClipBox(this.current.clipBox),Z.beginPath()}getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){const l=nl(this.ctx);if(l[1]===0&&l[2]===0)this._cachedGetSinglePixelWidth=1/Math.min(Math.abs(l[0]),Math.abs(l[3]));else{const U=Math.abs(l[0]*l[3]-l[2]*l[1]),Z=Math.hypot(l[0],l[2]),F=Math.hypot(l[1],l[3]);this._cachedGetSinglePixelWidth=Math.max(Z,F)/U}}return this._cachedGetSinglePixelWidth}getScaleForStroking(){if(this._cachedScaleForStroking[0]===-1){const{lineWidth:l}=this.current,{a:U,b:Z,c:F,d:t}=this.ctx.getTransform();let c,V;if(Z===0&&F===0){const Q=Math.abs(U),a=Math.abs(t);if(Q===a)if(l===0)c=V=1/Q;else{const n=Q*l;c=V=n<1?1/n:1}else if(l===0)c=1/Q,V=1/a;else{const n=Q*l,s=a*l;c=n<1?1/n:1,V=s<1?1/s:1}}else{const Q=Math.abs(U*t-Z*F),a=Math.hypot(U,Z),n=Math.hypot(F,t);if(l===0)c=n/Q,V=a/Q;else{const s=l*Q;c=n>s?n/s:1,V=a>s?a/s:1}}this._cachedScaleForStroking[0]=c,this._cachedScaleForStroking[1]=V}return this._cachedScaleForStroking}rescaleAndStroke(l){const{ctx:U}=this,{lineWidth:Z}=this.current,[F,t]=this.getScaleForStroking();if(U.lineWidth=Z||1,F===1&&t===1){U.stroke();return}const c=U.getLineDash();if(l&&U.save(),U.scale(F,t),c.length>0){const V=Math.max(F,t);U.setLineDash(c.map(Q=>Q/V)),U.lineDashOffset/=V}U.stroke(),l&&U.restore()}isContentVisible(){for(let l=this.markedContentStack.length-1;l>=0;l--)if(!this.markedContentStack[l].visible)return!1;return!0}};IQ=new WeakSet,yR=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)},EQ=new WeakSet,kR=function(){if(this.pageColors){const d=this.filterFactory.addHCMFilter(this.pageColors.foreground,this.pageColors.background);if(d!=="none"){const l=this.ctx.filter;this.ctx.filter=d,this.ctx.drawImage(this.ctx.canvas,0,0),this.ctx.filter=l}}};let wQ=xJ;for(const d in EU)wQ.prototype[d]!==void 0&&(wQ.prototype[EU[d]]=wQ.prototype[d]);var XV,YV,pV;let b0=(XV=class{static get workerPort(){return W(this,YV)}static set workerPort(d){if(!(typeof Worker<"u"&&d instanceof Worker)&&d!==null)throw new Error("Invalid `workerPort` type.");m(this,YV,d)}static get workerSrc(){return W(this,pV)}static set workerSrc(d){if(typeof d!="string")throw new Error("Invalid `workerSrc` type.");m(this,pV,d)}},YV=new WeakMap,pV=new WeakMap,i(XV,YV,null),i(XV,pV,""),XV);const BV={UNKNOWN:0,DATA:1,ERROR:2},Nl={UNKNOWN:0,CANCEL:1,CANCEL_COMPLETE:2,CLOSE:3,ENQUEUE:4,ERROR:5,PULL:6,PULL_COMPLETE:7,START_COMPLETE:8};function RU(d){switch(d instanceof Error||typeof d=="object"&&d!==null||Zl('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),d.name){case"AbortException":return new yF(d.message);case"MissingPDFException":return new oF(d.message);case"PasswordException":return new _i(d.message,d.code);case"UnexpectedResponseException":return new hs(d.message,d.status);case"UnknownErrorException":return new qi(d.message,d.details);default:return new qi(d.message,d.toString())}}var LR,xe,zR,re,bc,uV;class mc{constructor(l,U,Z){i(this,LR),i(this,zR),i(this,bc),this.sourceName=l,this.targetName=U,this.comObj=Z,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 t=F.data;if(t.targetName!==this.sourceName)return;if(t.stream){b(this,zR,re).call(this,t);return}if(t.callback){const V=t.callbackId,Q=this.callbackCapabilities[V];if(!Q)throw new Error(`Cannot resolve callback ${V}`);if(delete this.callbackCapabilities[V],t.callback===BV.DATA)Q.resolve(t.data);else if(t.callback===BV.ERROR)Q.reject(RU(t.reason));else throw new Error("Unexpected callback case");return}const c=this.actionHandler[t.action];if(!c)throw new Error(`Unknown action from worker: ${t.action}`);if(t.callbackId){const V=this.sourceName,Q=t.sourceName;new Promise(function(a){a(c(t.data))}).then(function(a){Z.postMessage({sourceName:V,targetName:Q,callback:BV.DATA,callbackId:t.callbackId,data:a})},function(a){Z.postMessage({sourceName:V,targetName:Q,callback:BV.ERROR,callbackId:t.callbackId,reason:RU(a)})});return}if(t.streamId){b(this,LR,xe).call(this,t);return}c(t.data)},Z.addEventListener("message",this._onComObjOnMessage)}on(l,U){const Z=this.actionHandler;if(Z[l])throw new Error(`There is already an actionName called "${l}"`);Z[l]=U}send(l,U,Z){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:l,data:U},Z)}sendWithPromise(l,U,Z){const F=this.callbackId++,t=Promise.withResolvers();this.callbackCapabilities[F]=t;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:l,callbackId:F,data:U},Z)}catch(c){t.reject(c)}return t.promise}sendWithStream(l,U,Z,F){const t=this.streamId++,c=this.sourceName,V=this.targetName,Q=this.comObj;return new ReadableStream({start:a=>{const n=Promise.withResolvers();return this.streamControllers[t]={controller:a,startCall:n,pullCall:null,cancelCall:null,isClosed:!1},Q.postMessage({sourceName:c,targetName:V,action:l,streamId:t,data:U,desiredSize:a.desiredSize},F),n.promise},pull:a=>{const n=Promise.withResolvers();return this.streamControllers[t].pullCall=n,Q.postMessage({sourceName:c,targetName:V,stream:Nl.PULL,streamId:t,desiredSize:a.desiredSize}),n.promise},cancel:a=>{Jl(a instanceof Error,"cancel must have a valid reason");const n=Promise.withResolvers();return this.streamControllers[t].cancelCall=n,this.streamControllers[t].isClosed=!0,Q.postMessage({sourceName:c,targetName:V,stream:Nl.CANCEL,streamId:t,reason:RU(a)}),n.promise}},Z)}destroy(){this.comObj.removeEventListener("message",this._onComObjOnMessage)}}LR=new WeakSet,xe=function(d){const l=d.streamId,U=this.sourceName,Z=d.sourceName,F=this.comObj,t=this,c=this.actionHandler[d.action],V={enqueue(Q,a=1,n){if(this.isCancelled)return;const s=this.desiredSize;this.desiredSize-=a,s>0&&this.desiredSize<=0&&(this.sinkCapability=Promise.withResolvers(),this.ready=this.sinkCapability.promise),F.postMessage({sourceName:U,targetName:Z,stream:Nl.ENQUEUE,streamId:l,chunk:Q},n)},close(){this.isCancelled||(this.isCancelled=!0,F.postMessage({sourceName:U,targetName:Z,stream:Nl.CLOSE,streamId:l}),delete t.streamSinks[l])},error(Q){Jl(Q instanceof Error,"error must have a valid reason"),!this.isCancelled&&(this.isCancelled=!0,F.postMessage({sourceName:U,targetName:Z,stream:Nl.ERROR,streamId:l,reason:RU(Q)}))},sinkCapability:Promise.withResolvers(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:d.desiredSize,ready:null};V.sinkCapability.resolve(),V.ready=V.sinkCapability.promise,this.streamSinks[l]=V,new Promise(function(Q){Q(c(d.data,V))}).then(function(){F.postMessage({sourceName:U,targetName:Z,stream:Nl.START_COMPLETE,streamId:l,success:!0})},function(Q){F.postMessage({sourceName:U,targetName:Z,stream:Nl.START_COMPLETE,streamId:l,reason:RU(Q)})})},zR=new WeakSet,re=function(d){const l=d.streamId,U=this.sourceName,Z=d.sourceName,F=this.comObj,t=this.streamControllers[l],c=this.streamSinks[l];switch(d.stream){case Nl.START_COMPLETE:d.success?t.startCall.resolve():t.startCall.reject(RU(d.reason));break;case Nl.PULL_COMPLETE:d.success?t.pullCall.resolve():t.pullCall.reject(RU(d.reason));break;case Nl.PULL:if(!c){F.postMessage({sourceName:U,targetName:Z,stream:Nl.PULL_COMPLETE,streamId:l,success:!0});break}c.desiredSize<=0&&d.desiredSize>0&&c.sinkCapability.resolve(),c.desiredSize=d.desiredSize,new Promise(function(V){var Q;V((Q=c.onPull)==null?void 0:Q.call(c))}).then(function(){F.postMessage({sourceName:U,targetName:Z,stream:Nl.PULL_COMPLETE,streamId:l,success:!0})},function(V){F.postMessage({sourceName:U,targetName:Z,stream:Nl.PULL_COMPLETE,streamId:l,reason:RU(V)})});break;case Nl.ENQUEUE:if(Jl(t,"enqueue should have stream controller"),t.isClosed)break;t.controller.enqueue(d.chunk);break;case Nl.CLOSE:if(Jl(t,"close should have stream controller"),t.isClosed)break;t.isClosed=!0,t.controller.close(),b(this,bc,uV).call(this,t,l);break;case Nl.ERROR:Jl(t,"error should have stream controller"),t.controller.error(RU(d.reason)),b(this,bc,uV).call(this,t,l);break;case Nl.CANCEL_COMPLETE:d.success?t.cancelCall.resolve():t.cancelCall.reject(RU(d.reason)),b(this,bc,uV).call(this,t,l);break;case Nl.CANCEL:if(!c)break;new Promise(function(V){var Q;V((Q=c.onCancel)==null?void 0:Q.call(c,RU(d.reason)))}).then(function(){F.postMessage({sourceName:U,targetName:Z,stream:Nl.CANCEL_COMPLETE,streamId:l,success:!0})},function(V){F.postMessage({sourceName:U,targetName:Z,stream:Nl.CANCEL_COMPLETE,streamId:l,reason:RU(V)})}),c.sinkCapability.reject(RU(d.reason)),c.isCancelled=!0,delete this.streamSinks[l];break;default:throw new Error("Unexpected stream case")}},bc=new WeakSet,uV=async function(d,l){var U,Z,F;await Promise.allSettled([(U=d.startCall)==null?void 0:U.promise,(Z=d.pullCall)==null?void 0:Z.promise,(F=d.cancelCall)==null?void 0:F.promise]),delete this.streamControllers[l]};var Wt,CQ;class rJ{constructor({parsedData:l,rawData:U}){i(this,Wt,void 0),i(this,CQ,void 0),m(this,Wt,l),m(this,CQ,U)}getRaw(){return W(this,CQ)}get(l){return W(this,Wt).get(l)??null}getAll(){return jh(W(this,Wt))}has(l){return W(this,Wt).has(l)}}Wt=new WeakMap,CQ=new WeakMap;const _d=Symbol("INTERNAL");var xQ,rQ,jQ,ec;class jJ{constructor(l,{name:U,intent:Z,usage:F}){i(this,xQ,!1),i(this,rQ,!1),i(this,jQ,!1),i(this,ec,!0),m(this,xQ,!!(l&SU.DISPLAY)),m(this,rQ,!!(l&SU.PRINT)),this.name=U,this.intent=Z,this.usage=F}get visible(){if(W(this,jQ))return W(this,ec);if(!W(this,ec))return!1;const{print:l,view:U}=this.usage;return W(this,xQ)?(U==null?void 0:U.viewState)!=="OFF":W(this,rQ)?(l==null?void 0:l.printState)!=="OFF":!0}_setVisible(l,U,Z=!1){l!==_d&&Zl("Internal method `_setVisible` called."),m(this,jQ,Z),m(this,ec,U)}}xQ=new WeakMap,rQ=new WeakMap,jQ=new WeakMap,ec=new WeakMap;var HZ,tl,Mc,Jc,zn,DR;class OJ{constructor(l,U=SU.DISPLAY){if(i(this,zn),i(this,HZ,null),i(this,tl,new Map),i(this,Mc,null),i(this,Jc,null),this.renderingIntent=U,this.name=null,this.creator=null,l!==null){this.name=l.name,this.creator=l.creator,m(this,Jc,l.order);for(const Z of l.groups)W(this,tl).set(Z.id,new jJ(U,Z));if(l.baseState==="OFF")for(const Z of W(this,tl).values())Z._setVisible(_d,!1);for(const Z of l.on)W(this,tl).get(Z)._setVisible(_d,!0);for(const Z of l.off)W(this,tl).get(Z)._setVisible(_d,!1);m(this,Mc,this.getHash())}}isVisible(l){if(W(this,tl).size===0)return!0;if(!l)return Ns("Optional content group not defined."),!0;if(l.type==="OCG")return W(this,tl).has(l.id)?W(this,tl).get(l.id).visible:(f(`Optional content group not found: ${l.id}`),!0);if(l.type==="OCMD"){if(l.expression)return b(this,zn,DR).call(this,l.expression);if(!l.policy||l.policy==="AnyOn"){for(const U of l.ids){if(!W(this,tl).has(U))return f(`Optional content group not found: ${U}`),!0;if(W(this,tl).get(U).visible)return!0}return!1}else if(l.policy==="AllOn"){for(const U of l.ids){if(!W(this,tl).has(U))return f(`Optional content group not found: ${U}`),!0;if(!W(this,tl).get(U).visible)return!1}return!0}else if(l.policy==="AnyOff"){for(const U of l.ids){if(!W(this,tl).has(U))return f(`Optional content group not found: ${U}`),!0;if(!W(this,tl).get(U).visible)return!0}return!1}else if(l.policy==="AllOff"){for(const U of l.ids){if(!W(this,tl).has(U))return f(`Optional content group not found: ${U}`),!0;if(W(this,tl).get(U).visible)return!1}return!0}return f(`Unknown optional content policy ${l.policy}.`),!0}return f(`Unknown group type ${l.type}.`),!0}setVisibility(l,U=!0){const Z=W(this,tl).get(l);if(!Z){f(`Optional content group not found: ${l}`);return}Z._setVisible(_d,!!U,!0),m(this,HZ,null)}setOCGState({state:l,preserveRB:U}){let Z;for(const F of l){switch(F){case"ON":case"OFF":case"Toggle":Z=F;continue}const t=W(this,tl).get(F);if(t)switch(Z){case"ON":t._setVisible(_d,!0);break;case"OFF":t._setVisible(_d,!1);break;case"Toggle":t._setVisible(_d,!t.visible);break}}m(this,HZ,null)}get hasInitialVisibility(){return W(this,Mc)===null||this.getHash()===W(this,Mc)}getOrder(){return W(this,tl).size?W(this,Jc)?W(this,Jc).slice():[...W(this,tl).keys()]:null}getGroups(){return W(this,tl).size>0?jh(W(this,tl)):null}getGroup(l){return W(this,tl).get(l)||null}getHash(){if(W(this,HZ)!==null)return W(this,HZ);const l=new Le;for(const[U,Z]of W(this,tl))l.update(`${U}:${Z.visible}`);return m(this,HZ,l.hexdigest())}}HZ=new WeakMap,tl=new WeakMap,Mc=new WeakMap,Jc=new WeakMap,zn=new WeakSet,DR=function(d){const l=d.length;if(l<2)return!0;const U=d[0];for(let Z=1;Z<l;Z++){const F=d[Z];let t;if(Array.isArray(F))t=b(this,zn,DR).call(this,F);else if(W(this,tl).has(F))t=W(this,tl).get(F).visible;else return f(`Optional content group not found: ${F}`),!0;switch(U){case"And":if(!t)return!1;break;case"Or":if(t)return!0;break;case"Not":return!t;default:return!0}}return U==="And"};class gJ{constructor(l,{disableRange:U=!1,disableStream:Z=!1}){Jl(l,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.');const{length:F,initialData:t,progressiveDone:c,contentDispositionFilename:V}=l;if(this._queuedChunks=[],this._progressiveDone=c,this._contentDispositionFilename=V,(t==null?void 0:t.length)>0){const Q=t instanceof Uint8Array&&t.byteLength===t.buffer.byteLength?t.buffer:new Uint8Array(t).buffer;this._queuedChunks.push(Q)}this._pdfDataRangeTransport=l,this._isStreamingSupported=!Z,this._isRangeSupported=!U,this._contentLength=F,this._fullRequestReader=null,this._rangeReaders=[],l.addRangeListener((Q,a)=>{this._onReceiveData({begin:Q,chunk:a})}),l.addProgressListener((Q,a)=>{this._onProgress({loaded:Q,total:a})}),l.addProgressiveReadListener(Q=>{this._onReceiveData({chunk:Q})}),l.addProgressiveDoneListener(()=>{this._onProgressiveDone()}),l.transportReady()}_onReceiveData({begin:l,chunk:U}){const Z=U instanceof Uint8Array&&U.byteLength===U.buffer.byteLength?U.buffer:new Uint8Array(U).buffer;if(l===void 0)this._fullRequestReader?this._fullRequestReader._enqueue(Z):this._queuedChunks.push(Z);else{const F=this._rangeReaders.some(function(t){return t._begin!==l?!1:(t._enqueue(Z),!0)});Jl(F,"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}get _progressiveDataLength(){var l;return((l=this._fullRequestReader)==null?void 0:l._loaded)??0}_onProgress(l){var U,Z,F,t;l.total===void 0?(Z=(U=this._rangeReaders[0])==null?void 0:U.onProgress)==null||Z.call(U,{loaded:l.loaded}):(t=(F=this._fullRequestReader)==null?void 0:F.onProgress)==null||t.call(F,{loaded:l.loaded,total:l.total})}_onProgressiveDone(){var l;(l=this._fullRequestReader)==null||l.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(l){const U=this._rangeReaders.indexOf(l);U>=0&&this._rangeReaders.splice(U,1)}getFullReader(){Jl(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");const l=this._queuedChunks;return this._queuedChunks=null,new KJ(this,l,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(l,U){if(U<=this._progressiveDataLength)return null;const Z=new vJ(this,l,U);return this._pdfDataRangeTransport.requestDataRange(l,U),this._rangeReaders.push(Z),Z}cancelAllRequests(l){var U;(U=this._fullRequestReader)==null||U.cancel(l);for(const Z of this._rangeReaders.slice(0))Z.cancel(l);this._pdfDataRangeTransport.abort()}}class KJ{constructor(l,U,Z=!1,F=null){this._stream=l,this._done=Z||!1,this._filename=Hh(F)?F:null,this._queuedChunks=U||[],this._loaded=0;for(const t of this._queuedChunks)this._loaded+=t.byteLength;this._requests=[],this._headersReady=Promise.resolve(),l._fullRequestReader=this,this.onProgress=null}_enqueue(l){this._done||(this._requests.length>0?this._requests.shift().resolve({value:l,done:!1}):this._queuedChunks.push(l),this._loaded+=l.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 l=Promise.withResolvers();return this._requests.push(l),l.promise}cancel(l){this._done=!0;for(const U of this._requests)U.resolve({value:void 0,done:!0});this._requests.length=0}progressiveDone(){this._done||(this._done=!0)}}class vJ{constructor(l,U,Z){this._stream=l,this._begin=U,this._end=Z,this._queuedChunk=null,this._requests=[],this._done=!1,this.onProgress=null}_enqueue(l){if(!this._done){if(this._requests.length===0)this._queuedChunk=l;else{this._requests.shift().resolve({value:l,done:!1});for(const U of this._requests)U.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 U=this._queuedChunk;return this._queuedChunk=null,{value:U,done:!1}}if(this._done)return{value:void 0,done:!0};const l=Promise.withResolvers();return this._requests.push(l),l.promise}cancel(l){this._done=!0;for(const U of this._requests)U.resolve({value:void 0,done:!0});this._requests.length=0,this._stream._removeRangeReader(this)}}function HJ(d){let l=!0,U=Z("filename\\*","i").exec(d);if(U){U=U[1];let n=V(U);return n=unescape(n),n=Q(n),n=a(n),t(n)}if(U=c(d),U){const n=a(U);return t(n)}if(U=Z("filename","i").exec(d),U){U=U[1];let n=V(U);return n=a(n),t(n)}function Z(n,s){return new RegExp("(?:^|;)\\s*"+n+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',s)}function F(n,s){if(n){if(!/^[\x00-\xFF]+$/.test(s))return s;try{const R=new TextDecoder(n,{fatal:!0}),N=bs(s);s=R.decode(N),l=!1}catch{}}return s}function t(n){return l&&/[\x80-\xff]/.test(n)&&(n=F("utf-8",n),l&&(n=F("iso-8859-1",n))),n}function c(n){const s=[];let R;const N=Z("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;(R=N.exec(n))!==null;){let[,e,M,J]=R;if(e=parseInt(e,10),e in s){if(e===0)break;continue}s[e]=[M,J]}const h=[];for(let e=0;e<s.length&&e in s;++e){let[M,J]=s[e];J=V(J),M&&(J=unescape(J),e===0&&(J=Q(J))),h.push(J)}return h.join("")}function V(n){if(n.startsWith('"')){const s=n.slice(1).split('\\"');for(let R=0;R<s.length;++R){const N=s[R].indexOf('"');N!==-1&&(s[R]=s[R].slice(0,N),s.length=R+1),s[R]=s[R].replaceAll(/\\(.)/g,"$1")}n=s.join('"')}return n}function Q(n){const s=n.indexOf("'");if(s===-1)return n;const R=n.slice(0,s),N=n.slice(s+1).replace(/^[^']*'/,"");return F(R,N)}function a(n){return!n.startsWith("=?")||/[\x00-\x19\x80-\xff]/.test(n)?n:n.replaceAll(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,function(s,R,N,h){if(N==="q"||N==="Q")return h=h.replaceAll("_"," "),h=h.replaceAll(/=([0-9a-fA-F]{2})/g,function(e,M){return String.fromCharCode(parseInt(M,16))}),F(R,h);try{h=atob(h)}catch{}return F(R,h)})}return""}function Ah({getResponseHeader:d,isHttp:l,rangeChunkSize:U,disableRange:Z}){const F={allowRangeRequests:!1,suggestedLength:void 0},t=parseInt(d("Content-Length"),10);return!Number.isInteger(t)||(F.suggestedLength=t,t<=2*U)||Z||!l||d("Accept-Ranges")!=="bytes"||(d("Content-Encoding")||"identity")!=="identity"||(F.allowRangeRequests=!0),F}function _h(d){const l=d("Content-Disposition");if(l){let U=HJ(l);if(U.includes("%"))try{U=decodeURIComponent(U)}catch{}if(Hh(U))return U}return null}function Gs(d,l){return d===404||d===0&&l.startsWith("file:")?new oF('Missing PDF "'+l+'".'):new hs(`Unexpected server response (${d}) while retrieving PDF "${l}".`,d)}function je(d){return d===200||d===206}function Oe(d,l,U){return{method:"GET",headers:d,signal:U.signal,mode:"cors",credentials:l?"include":"same-origin",redirect:"follow"}}function ge(d){const l=new Headers;for(const U in d){const Z=d[U];Z!==void 0&&l.append(U,Z)}return l}function Ke(d){return d instanceof Uint8Array?d.buffer:d instanceof ArrayBuffer?d:(f(`getArrayBuffer - unexpected data format: ${d}`),new Uint8Array(d).buffer)}class Db{constructor(l){this.source=l,this.isHttp=/^https?:/i.test(l.url),this.httpHeaders=this.isHttp&&l.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){var l;return((l=this._fullRequestReader)==null?void 0:l._loaded)??0}getFullReader(){return Jl(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new PJ(this),this._fullRequestReader}getRangeReader(l,U){if(U<=this._progressiveDataLength)return null;const Z=new fJ(this,l,U);return this._rangeRequestReaders.push(Z),Z}cancelAllRequests(l){var U;(U=this._fullRequestReader)==null||U.cancel(l);for(const Z of this._rangeRequestReaders.slice(0))Z.cancel(l)}}class PJ{constructor(l){this._stream=l,this._reader=null,this._loaded=0,this._filename=null;const U=l.source;this._withCredentials=U.withCredentials||!1,this._contentLength=U.length,this._headersCapability=Promise.withResolvers(),this._disableRange=U.disableRange||!1,this._rangeChunkSize=U.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._abortController=new AbortController,this._isStreamingSupported=!U.disableStream,this._isRangeSupported=!U.disableRange,this._headers=ge(this._stream.httpHeaders);const Z=U.url;fetch(Z,Oe(this._headers,this._withCredentials,this._abortController)).then(F=>{if(!je(F.status))throw Gs(F.status,Z);this._reader=F.body.getReader(),this._headersCapability.resolve();const t=Q=>F.headers.get(Q),{allowRangeRequests:c,suggestedLength:V}=Ah({getResponseHeader:t,isHttp:this._stream.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=c,this._contentLength=V||this._contentLength,this._filename=_h(t),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new yF("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 l;await this._headersCapability.promise;const{value:U,done:Z}=await this._reader.read();return Z?{value:U,done:Z}:(this._loaded+=U.byteLength,(l=this.onProgress)==null||l.call(this,{loaded:this._loaded,total:this._contentLength}),{value:Ke(U),done:!1})}cancel(l){var U;(U=this._reader)==null||U.cancel(l),this._abortController.abort()}}class fJ{constructor(l,U,Z){this._stream=l,this._reader=null,this._loaded=0;const F=l.source;this._withCredentials=F.withCredentials||!1,this._readCapability=Promise.withResolvers(),this._isStreamingSupported=!F.disableStream,this._abortController=new AbortController,this._headers=ge(this._stream.httpHeaders),this._headers.append("Range",`bytes=${U}-${Z-1}`);const t=F.url;fetch(t,Oe(this._headers,this._withCredentials,this._abortController)).then(c=>{if(!je(c.status))throw Gs(c.status,t);this._readCapability.resolve(),this._reader=c.body.getReader()}).catch(this._readCapability.reject),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){var l;await this._readCapability.promise;const{value:U,done:Z}=await this._reader.read();return Z?{value:U,done:Z}:(this._loaded+=U.byteLength,(l=this.onProgress)==null||l.call(this,{loaded:this._loaded}),{value:Ke(U),done:!1})}cancel(l){var U;(U=this._reader)==null||U.cancel(l),this._abortController.abort()}}const As=200,_s=206;function AJ(d){const l=d.response;return typeof l!="string"?l:bs(l).buffer}class _J{constructor(l,U={}){this.url=l,this.isHttp=/^https?:/i.test(l),this.httpHeaders=this.isHttp&&U.httpHeaders||Object.create(null),this.withCredentials=U.withCredentials||!1,this.currXhrId=0,this.pendingRequests=Object.create(null)}requestRange(l,U,Z){const F={begin:l,end:U};for(const t in Z)F[t]=Z[t];return this.request(F)}requestFull(l){return this.request(l)}request(l){const U=new XMLHttpRequest,Z=this.currXhrId++,F=this.pendingRequests[Z]={xhr:U};U.open("GET",this.url),U.withCredentials=this.withCredentials;for(const t in this.httpHeaders){const c=this.httpHeaders[t];c!==void 0&&U.setRequestHeader(t,c)}return this.isHttp&&"begin"in l&&"end"in l?(U.setRequestHeader("Range",`bytes=${l.begin}-${l.end-1}`),F.expectedStatus=_s):F.expectedStatus=As,U.responseType="arraybuffer",l.onError&&(U.onerror=function(t){l.onError(U.status)}),U.onreadystatechange=this.onStateChange.bind(this,Z),U.onprogress=this.onProgress.bind(this,Z),F.onHeadersReceived=l.onHeadersReceived,F.onDone=l.onDone,F.onError=l.onError,F.onProgress=l.onProgress,U.send(null),Z}onProgress(l,U){var Z;const F=this.pendingRequests[l];F&&((Z=F.onProgress)==null||Z.call(F,U))}onStateChange(l,U){var Z,F,t;const c=this.pendingRequests[l];if(!c)return;const V=c.xhr;if(V.readyState>=2&&c.onHeadersReceived&&(c.onHeadersReceived(),delete c.onHeadersReceived),V.readyState!==4||!(l in this.pendingRequests))return;if(delete this.pendingRequests[l],V.status===0&&this.isHttp){(Z=c.onError)==null||Z.call(c,V.status);return}const Q=V.status||As;if(!(Q===As&&c.expectedStatus===_s)&&Q!==c.expectedStatus){(F=c.onError)==null||F.call(c,V.status);return}const a=AJ(V);if(Q===_s){const n=V.getResponseHeader("Content-Range"),s=/bytes (\d+)-(\d+)\/(\d+)/.exec(n);c.onDone({begin:parseInt(s[1],10),chunk:a})}else a?c.onDone({begin:0,chunk:a}):(t=c.onError)==null||t.call(c,V.status)}getRequestXhr(l){return this.pendingRequests[l].xhr}isPendingRequest(l){return l in this.pendingRequests}abortRequest(l){const U=this.pendingRequests[l].xhr;delete this.pendingRequests[l],U.abort()}}class qJ{constructor(l){this._source=l,this._manager=new _J(l.url,{httpHeaders:l.httpHeaders,withCredentials:l.withCredentials}),this._rangeChunkSize=l.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(l){const U=this._rangeRequestReaders.indexOf(l);U>=0&&this._rangeRequestReaders.splice(U,1)}getFullReader(){return Jl(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new $J(this._manager,this._source),this._fullRequestReader}getRangeReader(l,U){const Z=new lG(this._manager,l,U);return Z.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(Z),Z}cancelAllRequests(l){var U;(U=this._fullRequestReader)==null||U.cancel(l);for(const Z of this._rangeRequestReaders.slice(0))Z.cancel(l)}}class $J{constructor(l,U){this._manager=l;const Z={onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=U.url,this._fullRequestId=l.requestFull(Z),this._headersReceivedCapability=Promise.withResolvers(),this._disableRange=U.disableRange||!1,this._contentLength=U.length,this._rangeChunkSize=U.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 l=this._fullRequestId,U=this._manager.getRequestXhr(l),Z=c=>U.getResponseHeader(c),{allowRangeRequests:F,suggestedLength:t}=Ah({getResponseHeader:Z,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});F&&(this._isRangeSupported=!0),this._contentLength=t||this._contentLength,this._filename=_h(Z),this._isRangeSupported&&this._manager.abortRequest(l),this._headersReceivedCapability.resolve()}_onDone(l){if(l&&(this._requests.length>0?this._requests.shift().resolve({value:l.chunk,done:!1}):this._cachedChunks.push(l.chunk)),this._done=!0,!(this._cachedChunks.length>0)){for(const U of this._requests)U.resolve({value:void 0,done:!0});this._requests.length=0}}_onError(l){this._storedError=Gs(l,this._url),this._headersReceivedCapability.reject(this._storedError);for(const U of this._requests)U.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0}_onProgress(l){var U;(U=this.onProgress)==null||U.call(this,{loaded:l.loaded,total:l.lengthComputable?l.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 l=Promise.withResolvers();return this._requests.push(l),l.promise}cancel(l){this._done=!0,this._headersReceivedCapability.reject(l);for(const U of this._requests)U.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId),this._fullRequestReader=null}}class lG{constructor(l,U,Z){this._manager=l;const F={onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=l.url,this._requestId=l.requestRange(U,Z,F),this._requests=[],this._queuedChunk=null,this._done=!1,this._storedError=void 0,this.onProgress=null,this.onClosed=null}_close(){var l;(l=this.onClosed)==null||l.call(this,this)}_onDone(l){const U=l.chunk;this._requests.length>0?this._requests.shift().resolve({value:U,done:!1}):this._queuedChunk=U,this._done=!0;for(const Z of this._requests)Z.resolve({value:void 0,done:!0});this._requests.length=0,this._close()}_onError(l){this._storedError=Gs(l,this._url);for(const U of this._requests)U.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}_onProgress(l){var U;this.isStreamingSupported||(U=this.onProgress)==null||U.call(this,{loaded:l.loaded})}get isStreamingSupported(){return!1}async read(){if(this._storedError)throw this._storedError;if(this._queuedChunk!==null){const U=this._queuedChunk;return this._queuedChunk=null,{value:U,done:!1}}if(this._done)return{value:void 0,done:!0};const l=Promise.withResolvers();return this._requests.push(l),l.promise}cancel(l){this._done=!0;for(const U of this._requests)U.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId),this._close()}}const ve=/^file:\/\/\/[a-zA-Z]:\//;function UG(d){const l=td.get("url"),U=l.parse(d);return U.protocol==="file:"||U.host?U:/^[a-z]:[/\\]/i.test(d)?l.parse(`file:///${d}`):(U.host||(U.protocol="file:"),U)}class dG{constructor(l){this.source=l,this.url=UG(l.url),this.isHttp=this.url.protocol==="http:"||this.url.protocol==="https:",this.isFsUrl=this.url.protocol==="file:",this.httpHeaders=this.isHttp&&l.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){var l;return((l=this._fullRequestReader)==null?void 0:l._loaded)??0}getFullReader(){return Jl(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=this.isFsUrl?new tG(this):new ZG(this),this._fullRequestReader}getRangeReader(l,U){if(U<=this._progressiveDataLength)return null;const Z=this.isFsUrl?new cG(this,l,U):new FG(this,l,U);return this._rangeRequestReaders.push(Z),Z}cancelAllRequests(l){var U;(U=this._fullRequestReader)==null||U.cancel(l);for(const Z of this._rangeRequestReaders.slice(0))Z.cancel(l)}}class He{constructor(l){this._url=l.url,this._done=!1,this._storedError=null,this.onProgress=null;const U=l.source;this._contentLength=U.length,this._loaded=0,this._filename=null,this._disableRange=U.disableRange||!1,this._rangeChunkSize=U.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._isStreamingSupported=!U.disableStream,this._isRangeSupported=!U.disableRange,this._readableStream=null,this._readCapability=Promise.withResolvers(),this._headersCapability=Promise.withResolvers()}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 l;if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const U=this._readableStream.read();return U===null?(this._readCapability=Promise.withResolvers(),this.read()):(this._loaded+=U.length,(l=this.onProgress)==null||l.call(this,{loaded:this._loaded,total:this._contentLength}),{value:new Uint8Array(U).buffer,done:!1})}cancel(l){if(!this._readableStream){this._error(l);return}this._readableStream.destroy(l)}_error(l){this._storedError=l,this._readCapability.resolve()}_setReadableStream(l){this._readableStream=l,l.on("readable",()=>{this._readCapability.resolve()}),l.on("end",()=>{l.destroy(),this._done=!0,this._readCapability.resolve()}),l.on("error",U=>{this._error(U)}),!this._isStreamingSupported&&this._isRangeSupported&&this._error(new yF("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class Pe{constructor(l){this._url=l.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=Promise.withResolvers();const U=l.source;this._isStreamingSupported=!U.disableStream}get isStreamingSupported(){return this._isStreamingSupported}async read(){var l;if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const U=this._readableStream.read();return U===null?(this._readCapability=Promise.withResolvers(),this.read()):(this._loaded+=U.length,(l=this.onProgress)==null||l.call(this,{loaded:this._loaded}),{value:new Uint8Array(U).buffer,done:!1})}cancel(l){if(!this._readableStream){this._error(l);return}this._readableStream.destroy(l)}_error(l){this._storedError=l,this._readCapability.resolve()}_setReadableStream(l){this._readableStream=l,l.on("readable",()=>{this._readCapability.resolve()}),l.on("end",()=>{l.destroy(),this._done=!0,this._readCapability.resolve()}),l.on("error",U=>{this._error(U)}),this._storedError&&this._readableStream.destroy(this._storedError)}}function Dn(d,l){return{protocol:d.protocol,auth:d.auth,host:d.hostname,port:d.port,path:d.path,method:"GET",headers:l}}class ZG extends He{constructor(l){super(l);const U=Z=>{if(Z.statusCode===404){const V=new oF(`Missing PDF "${this._url}".`);this._storedError=V,this._headersCapability.reject(V);return}this._headersCapability.resolve(),this._setReadableStream(Z);const F=V=>this._readableStream.headers[V.toLowerCase()],{allowRangeRequests:t,suggestedLength:c}=Ah({getResponseHeader:F,isHttp:l.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=t,this._contentLength=c||this._contentLength,this._filename=_h(F)};if(this._request=null,this._url.protocol==="http:"){const Z=td.get("http");this._request=Z.request(Dn(this._url,l.httpHeaders),U)}else{const Z=td.get("https");this._request=Z.request(Dn(this._url,l.httpHeaders),U)}this._request.on("error",Z=>{this._storedError=Z,this._headersCapability.reject(Z)}),this._request.end()}}class FG extends Pe{constructor(l,U,Z){super(l),this._httpHeaders={};for(const t in l.httpHeaders){const c=l.httpHeaders[t];c!==void 0&&(this._httpHeaders[t]=c)}this._httpHeaders.Range=`bytes=${U}-${Z-1}`;const F=t=>{if(t.statusCode===404){const c=new oF(`Missing PDF "${this._url}".`);this._storedError=c;return}this._setReadableStream(t)};if(this._request=null,this._url.protocol==="http:"){const t=td.get("http");this._request=t.request(Dn(this._url,this._httpHeaders),F)}else{const t=td.get("https");this._request=t.request(Dn(this._url,this._httpHeaders),F)}this._request.on("error",t=>{this._storedError=t}),this._request.end()}}class tG extends He{constructor(l){super(l);let U=decodeURIComponent(this._url.path);ve.test(this._url.href)&&(U=U.replace(/^\//,""));const Z=td.get("fs");Z.promises.lstat(U).then(F=>{this._contentLength=F.size,this._setReadableStream(Z.createReadStream(U)),this._headersCapability.resolve()},F=>{F.code==="ENOENT"&&(F=new oF(`Missing PDF "${U}".`)),this._storedError=F,this._headersCapability.reject(F)})}}class cG extends Pe{constructor(l,U,Z){super(l);let F=decodeURIComponent(this._url.path);ve.test(this._url.href)&&(F=F.replace(/^\//,""));const t=td.get("fs");this._setReadableStream(t.createReadStream(F,{start:U,end:Z-1}))}}const WG=1e5,ZU=30,VG=.8;var Ib,LZ,sU,oV,yV,zZ,gd,kV,LV,xF,z0,D0,DZ,I0,zV,E0,rF,DV,IV,Xl,jF,OF,IZ,w0,qs,Eb,$s,wb,EV,li,C0,wV,Ui,Cb,di,xb;let In=(Xl=class{constructor({textContentSource:d,container:l,viewport:U}){i(this,qs),i(this,$s),i(this,EV),i(this,LZ,Promise.withResolvers()),i(this,sU,null),i(this,oV,!1),i(this,yV,!!((Ib=globalThis.FontInspector)!=null&&Ib.enabled)),i(this,zZ,null),i(this,gd,null),i(this,kV,0),i(this,LV,0),i(this,xF,null),i(this,z0,null),i(this,D0,0),i(this,DZ,0),i(this,I0,Object.create(null)),i(this,zV,[]),i(this,E0,null),i(this,rF,[]),i(this,DV,new WeakMap),i(this,IV,null);var Z;if(d instanceof ReadableStream)m(this,E0,d);else if(typeof d=="object")m(this,E0,new ReadableStream({start(Q){Q.enqueue(d),Q.close()}}));else throw new Error('No "textContentSource" parameter specified.');m(this,sU,m(this,z0,l)),m(this,DZ,U.scale*(globalThis.devicePixelRatio||1)),m(this,D0,U.rotation),m(this,gd,{prevFontSize:null,prevFontFamily:null,div:null,properties:null,ctx:null});const{pageWidth:F,pageHeight:t,pageX:c,pageY:V}=U.rawDims;m(this,IV,[1,0,0,-1,-c,V+t]),m(this,LV,F),m(this,kV,t),b(Z=Xl,Ui,Cb).call(Z),BF(l,U),W(this,LZ).promise.catch(()=>{}).then(()=>{W(Xl,w0).delete(this),m(this,gd,null),m(this,I0,null)})}render(){const d=()=>{W(this,xF).read().then(({value:l,done:U})=>{if(U){W(this,LZ).resolve();return}W(this,zZ)??m(this,zZ,l.lang),Object.assign(W(this,I0),l.styles),b(this,qs,Eb).call(this,l.items),d()},W(this,LZ).reject)};return m(this,xF,W(this,E0).getReader()),W(Xl,w0).add(this),d(),W(this,LZ).promise}update({viewport:d,onBefore:l=null}){var U;const Z=d.scale*(globalThis.devicePixelRatio||1),F=d.rotation;if(F!==W(this,D0)&&(l==null||l(),m(this,D0,F),BF(W(this,z0),{rotation:F})),Z!==W(this,DZ)){l==null||l(),m(this,DZ,Z);const t={prevFontSize:null,prevFontFamily:null,div:null,properties:null,ctx:b(U=Xl,C0,wV).call(U,W(this,zZ))};for(const c of W(this,rF))t.properties=W(this,DV).get(c),t.div=c,b(this,EV,li).call(this,t)}}cancel(){var d;const l=new yF("TextLayer task cancelled.");(d=W(this,xF))==null||d.cancel(l).catch(()=>{}),m(this,xF,null),W(this,LZ).reject(l)}get textDivs(){return W(this,rF)}get textContentItemsStr(){return W(this,zV)}static cleanup(){if(!(W(this,w0).size>0)){W(this,jF).clear();for(const{canvas:d}of W(this,OF).values())d.remove();W(this,OF).clear()}}},LZ=new WeakMap,sU=new WeakMap,oV=new WeakMap,yV=new WeakMap,zZ=new WeakMap,gd=new WeakMap,kV=new WeakMap,LV=new WeakMap,xF=new WeakMap,z0=new WeakMap,D0=new WeakMap,DZ=new WeakMap,I0=new WeakMap,zV=new WeakMap,E0=new WeakMap,rF=new WeakMap,DV=new WeakMap,IV=new WeakMap,jF=new WeakMap,OF=new WeakMap,IZ=new WeakMap,w0=new WeakMap,qs=new WeakSet,Eb=function(d){var l,U;if(W(this,oV))return;(U=W(this,gd)).ctx??(U.ctx=b(l=Xl,C0,wV).call(l,W(this,zZ)));const Z=W(this,rF),F=W(this,zV);for(const t of d){if(Z.length>WG){f("Ignoring additional textDivs for performance reasons."),m(this,oV,!0);return}if(t.str===void 0){if(t.type==="beginMarkedContentProps"||t.type==="beginMarkedContent"){const c=W(this,sU);m(this,sU,document.createElement("span")),W(this,sU).classList.add("markedContent"),t.id!==null&&W(this,sU).setAttribute("id",`${t.id}`),c.append(W(this,sU))}else t.type==="endMarkedContent"&&m(this,sU,W(this,sU).parentNode);continue}F.push(t.str),b(this,$s,wb).call(this,t)}},$s=new WeakSet,wb=function(d){var l;const U=document.createElement("span"),Z={angle:0,canvasWidth:0,hasText:d.str!=="",hasEOL:d.hasEOL,fontSize:0};W(this,rF).push(U);const F=r.transform(W(this,IV),d.transform);let t=Math.atan2(F[1],F[0]);const c=W(this,I0)[d.fontName];c.vertical&&(t+=Math.PI/2);const V=W(this,yV)&&c.fontSubstitution||c.fontFamily,Q=Math.hypot(F[2],F[3]),a=Q*b(l=Xl,di,xb).call(l,V,W(this,zZ));let n,s;t===0?(n=F[4],s=F[5]-a):(n=F[4]+a*Math.sin(t),s=F[5]-a*Math.cos(t));const R="calc(var(--scale-factor)*",N=U.style;W(this,sU)===W(this,z0)?(N.left=`${(100*n/W(this,LV)).toFixed(2)}%`,N.top=`${(100*s/W(this,kV)).toFixed(2)}%`):(N.left=`${R}${n.toFixed(2)}px)`,N.top=`${R}${s.toFixed(2)}px)`),N.fontSize=`${R}${(W(Xl,IZ)*Q).toFixed(2)}px)`,N.fontFamily=V,Z.fontSize=Q,U.setAttribute("role","presentation"),U.textContent=d.str,U.dir=d.dir,W(this,yV)&&(U.dataset.fontName=c.fontSubstitutionLoadedName||d.fontName),t!==0&&(Z.angle=t*(180/Math.PI));let h=!1;if(d.str.length>1)h=!0;else if(d.str!==" "&&d.transform[0]!==d.transform[3]){const e=Math.abs(d.transform[0]),M=Math.abs(d.transform[3]);e!==M&&Math.max(e,M)/Math.min(e,M)>1.5&&(h=!0)}if(h&&(Z.canvasWidth=c.vertical?d.height:d.width),W(this,DV).set(U,Z),W(this,gd).div=U,W(this,gd).properties=Z,b(this,EV,li).call(this,W(this,gd)),Z.hasText&&W(this,sU).append(U),Z.hasEOL){const e=document.createElement("br");e.setAttribute("role","presentation"),W(this,sU).append(e)}},EV=new WeakSet,li=function(d){const{div:l,properties:U,ctx:Z,prevFontSize:F,prevFontFamily:t}=d,{style:c}=l;let V="";if(W(Xl,IZ)>1&&(V=`scale(${1/W(Xl,IZ)})`),U.canvasWidth!==0&&U.hasText){const{fontFamily:Q}=c,{canvasWidth:a,fontSize:n}=U;(F!==n||t!==Q)&&(Z.font=`${n*W(this,DZ)}px ${Q}`,d.prevFontSize=n,d.prevFontFamily=Q);const{width:s}=Z.measureText(l.textContent);s>0&&(V=`scaleX(${a*W(this,DZ)/s}) ${V}`)}U.angle!==0&&(V=`rotate(${U.angle}deg) ${V}`),V.length>0&&(c.transform=V)},C0=new WeakSet,wV=function(d=null){let l=W(this,OF).get(d||(d=""));if(!l){const U=document.createElement("canvas");U.className="hiddenCanvasElement",U.lang=d,document.body.append(U),l=U.getContext("2d",{alpha:!1,willReadFrequently:!0}),W(this,OF).set(d,l)}return l},Ui=new WeakSet,Cb=function(){if(W(this,IZ)!==null)return;const d=document.createElement("div");d.style.opacity=0,d.style.lineHeight=1,d.style.fontSize="1px",d.textContent="X",document.body.append(d),m(this,IZ,d.getBoundingClientRect().height),d.remove()},di=new WeakSet,xb=function(d,l){const U=W(this,jF).get(d);if(U)return U;const Z=b(this,C0,wV).call(this,l),F=Z.font;Z.canvas.width=Z.canvas.height=ZU,Z.font=`${ZU}px ${d}`;const t=Z.measureText("");let c=t.fontBoundingBoxAscent,V=Math.abs(t.fontBoundingBoxDescent);if(c){const n=c/(c+V);return W(this,jF).set(d,n),Z.canvas.width=Z.canvas.height=0,Z.font=F,n}Z.strokeStyle="red",Z.clearRect(0,0,ZU,ZU),Z.strokeText("g",0,0);let Q=Z.getImageData(0,0,ZU,ZU).data;V=0;for(let n=Q.length-1-3;n>=0;n-=4)if(Q[n]>0){V=Math.ceil(n/4/ZU);break}Z.clearRect(0,0,ZU,ZU),Z.strokeText("A",0,ZU),Q=Z.getImageData(0,0,ZU,ZU).data,c=0;for(let n=0,s=Q.length;n<s;n+=4)if(Q[n]>0){c=ZU-Math.floor(n/4/ZU);break}Z.canvas.width=Z.canvas.height=0,Z.font=F;const a=c?c/(c+V):VG;return W(this,jF).set(d,a),a},i(Xl,C0),i(Xl,Ui),i(Xl,di),i(Xl,jF,new Map),i(Xl,OF,new Map),i(Xl,IZ,null),i(Xl,w0,new Set),Xl);function QG(){he("`renderTextLayer`, please use `TextLayer` instead.");const{textContentSource:d,container:l,viewport:U,...Z}=arguments[0],F=Object.keys(Z);F.length>0&&f("Ignoring `renderTextLayer` parameters: "+F.join(", "));const t=new In({textContentSource:d,container:l,viewport:U}),{textDivs:c,textContentItemsStr:V}=t;return{promise:t.render(),textDivs:c,textContentItemsStr:V}}function aG(){he("`updateTextLayer`, please use `TextLayer` instead.")}class rW{static textContent(l){const U=[],Z={items:U,styles:Object.create(null)};function F(t){var c;if(!t)return;let V=null;const Q=t.name;if(Q==="#text")V=t.value;else if(rW.shouldBuildText(Q))(c=t==null?void 0:t.attributes)!=null&&c.textContent?V=t.attributes.textContent:t.value&&(V=t.value);else return;if(V!==null&&U.push({str:V}),!!t.children)for(const a of t.children)F(a)}return F(l),Z}static shouldBuildText(l){return!(l==="textarea"||l==="input"||l==="option"||l==="select")}}const nG=65536,sG=100,iG=5e3,RG=fl?TJ:WJ,NG=fl?SJ:Re,hG=fl?GJ:cJ,bG=fl?XJ:Ne;function mG(d={}){typeof d=="string"||d instanceof URL?d={url:d}:(d instanceof ArrayBuffer||ArrayBuffer.isView(d))&&(d={data:d});const l=new JG,{docId:U}=l,Z=d.url?eG(d.url):null,F=d.data?MG(d.data):null,t=d.httpHeaders||null,c=d.withCredentials===!0,V=d.password??null,Q=d.range instanceof _e?d.range:null,a=Number.isInteger(d.rangeChunkSize)&&d.rangeChunkSize>0?d.rangeChunkSize:nG;let n=d.worker instanceof OQ?d.worker:null;const s=d.verbosity,R=typeof d.docBaseUrl=="string"&&!vh(d.docBaseUrl)?d.docBaseUrl:null,N=typeof d.cMapUrl=="string"?d.cMapUrl:null,h=d.cMapPacked!==!1,e=d.CMapReaderFactory||NG,M=typeof d.standardFontDataUrl=="string"?d.standardFontDataUrl:null,J=d.StandardFontDataFactory||bG,G=d.stopAtErrors!==!0,T=Number.isInteger(d.maxImageSize)&&d.maxImageSize>-1?d.maxImageSize:-1,p=d.isEvalSupported!==!1,S=typeof d.isOffscreenCanvasSupported=="boolean"?d.isOffscreenCanvasSupported:!fl,X=Number.isInteger(d.canvasMaxAreaInBytes)?d.canvasMaxAreaInBytes:-1,B=typeof d.disableFontFace=="boolean"?d.disableFontFace:fl,k=d.fontExtraProperties===!0,Y=d.enableXfa===!0,o=d.ownerDocument||globalThis.document,y=d.disableRange===!0,D=d.disableStream===!0,I=d.disableAutoFetch===!0,j=d.pdfBug===!0,x=d.enableHWA===!0,u=Q?Q.length:d.length??NaN,E=typeof d.useSystemFonts=="boolean"?d.useSystemFonts:!fl&&!B,A=typeof d.useWorkerFetch=="boolean"?d.useWorkerFetch:e===Re&&J===Ne&&N&&M&&Qc(N,document.baseURI)&&Qc(M,document.baseURI),Wl=d.canvasFactory||new RG({ownerDocument:o,enableHWA:x}),ml=d.filterFactory||new hG({docId:U,ownerDocument:o}),dU=null;PM(s);const Fl={canvasFactory:Wl,filterFactory:ml};if(A||(Fl.cMapReaderFactory=new e({baseUrl:N,isCompressed:h}),Fl.standardFontDataFactory=new J({baseUrl:M})),!n){const hU={verbosity:s,port:b0.workerPort};n=hU.port?OQ.fromPort(hU):new OQ(hU),l._worker=n}const Vl={docId:U,apiVersion:"4.4.168",data:F,password:V,disableAutoFetch:I,rangeChunkSize:a,length:u,docBaseUrl:R,enableXfa:Y,evaluatorOptions:{maxImageSize:T,disableFontFace:B,ignoreErrors:G,isEvalSupported:p,isOffscreenCanvasSupported:S,canvasMaxAreaInBytes:X,fontExtraProperties:k,useSystemFonts:E,cMapUrl:A?N:null,standardFontDataUrl:A?M:null}},Cd={disableFontFace:B,fontExtraProperties:k,ownerDocument:o,pdfBug:j,styleElement:dU,loadingParams:{disableAutoFetch:I,enableXfa:Y}};return n.promise.then(function(){if(l.destroyed)throw new Error("Loading aborted");if(n.destroyed)throw new Error("Worker was destroyed");const hU=n.messageHandler.sendWithPromise("GetDocRequest",Vl,F?[F.buffer]:null);let w;if(Q)w=new gJ(Q,{disableRange:y,disableStream:D});else if(!F){if(!Z)throw new Error("getDocument - no `url` parameter provided.");w=(L=>fl?function(){return typeof fetch<"u"&&typeof Response<"u"&&"body"in Response.prototype}()&&Qc(L.url)?new Db(L):new dG(L):Qc(L.url)?new Db(L):new qJ(L))({url:Z,length:u,httpHeaders:t,withCredentials:c,rangeChunkSize:a,disableRange:y,disableStream:D})}return hU.then(L=>{if(l.destroyed)throw new Error("Loading aborted");if(n.destroyed)throw new Error("Worker was destroyed");const C=new mc(U,L,n.port),P=new XG(C,l,w,Cd,Fl);l._transport=P,C.send("Ready",null)})}).catch(l._capability.reject),l}function eG(d){if(d instanceof URL)return d.href;try{return new URL(d,window.location).href}catch{if(fl&&typeof d=="string")return d}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}function MG(d){if(fl&&typeof Buffer<"u"&&d instanceof Buffer)throw new Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");if(d instanceof Uint8Array&&d.byteLength===d.buffer.byteLength)return d;if(typeof d=="string")return bs(d);if(d instanceof ArrayBuffer||ArrayBuffer.isView(d)||typeof d=="object"&&!isNaN(d==null?void 0:d.length))return new Uint8Array(d);throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")}function rb(d){return typeof d=="object"&&Number.isInteger(d==null?void 0:d.num)&&d.num>=0&&Number.isInteger(d==null?void 0:d.gen)&&d.gen>=0}var IR;const fe=class Ae{constructor(){this._capability=Promise.withResolvers(),this._transport=null,this._worker=null,this.docId=`d${NU(Ae,IR)._++}`,this.destroyed=!1,this.onPassword=null,this.onProgress=null}get promise(){return this._capability.promise}async destroy(){var l,U,Z;this.destroyed=!0;try{(l=this._worker)!=null&&l.port&&(this._worker._pendingDestroy=!0),await((U=this._transport)==null?void 0:U.destroy())}catch(F){throw(Z=this._worker)!=null&&Z.port&&delete this._worker._pendingDestroy,F}this._transport=null,this._worker&&(this._worker.destroy(),this._worker=null)}};IR=new WeakMap,i(fe,IR,0);let JG=fe,_e=class{constructor(d,l,U=!1,Z=null){this.length=d,this.initialData=l,this.progressiveDone=U,this.contentDispositionFilename=Z,this._rangeListeners=[],this._progressListeners=[],this._progressiveReadListeners=[],this._progressiveDoneListeners=[],this._readyCapability=Promise.withResolvers()}addRangeListener(d){this._rangeListeners.push(d)}addProgressListener(d){this._progressListeners.push(d)}addProgressiveReadListener(d){this._progressiveReadListeners.push(d)}addProgressiveDoneListener(d){this._progressiveDoneListeners.push(d)}onDataRange(d,l){for(const U of this._rangeListeners)U(d,l)}onDataProgress(d,l){this._readyCapability.promise.then(()=>{for(const U of this._progressListeners)U(d,l)})}onDataProgressiveRead(d){this._readyCapability.promise.then(()=>{for(const l of this._progressiveReadListeners)l(d)})}onDataProgressiveDone(){this._readyCapability.promise.then(()=>{for(const d of this._progressiveDoneListeners)d()})}transportReady(){this._readyCapability.resolve()}requestDataRange(d,l){Zl("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}};class GG{constructor(l,U){this._pdfInfo=l,this._transport=U}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 ll(this,"isPureXfa",!!this._transport._htmlForXfa)}get allXfaHtml(){return this._transport._htmlForXfa}getPage(l){return this._transport.getPage(l)}getPageIndex(l){return this._transport.getPageIndex(l)}getDestinations(){return this._transport.getDestinations()}getDestination(l){return this._transport.getDestination(l)}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({intent:l="display"}={}){const{renderingIntent:U}=this._transport.getRenderingIntent(l);return this._transport.getOptionalContentConfig(U)}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(l=!1){return this._transport.startCleanup(l||this.isPureXfa)}destroy(){return this.loadingTask.destroy()}cachedPageNumber(l){return this._transport.cachedPageNumber(l)}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()}}var PZ,iZ,RF,rt,QW,En;class TG{constructor(l,U,Z,F=!1){i(this,RF),i(this,QW),i(this,PZ,null),i(this,iZ,!1),this._pageIndex=l,this._pageInfo=U,this._transport=Z,this._stats=F?new Vb:null,this._pdfBug=F,this.commonObjs=Z.commonObjs,this.objs=new qe,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:l,rotation:U=this.rotate,offsetX:Z=0,offsetY:F=0,dontFlip:t=!1}={}){return new KW({viewBox:this.view,scale:l,rotation:U,offsetX:Z,offsetY:F,dontFlip:t})}getAnnotations({intent:l="display"}={}){const{renderingIntent:U}=this._transport.getRenderingIntent(l);return this._transport.getAnnotations(this._pageIndex,U)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get filterFactory(){return this._transport.filterFactory}get isPureXfa(){return ll(this,"isPureXfa",!!this._transport._htmlForXfa)}async getXfa(){var l;return((l=this._transport._htmlForXfa)==null?void 0:l.children[this._pageIndex])||null}render({canvasContext:l,viewport:U,intent:Z="display",annotationMode:F=aZ.ENABLE,transform:t=null,background:c=null,optionalContentConfigPromise:V=null,annotationCanvasMap:Q=null,pageColors:a=null,printAnnotationStorage:n=null}){var s,R;(s=this._stats)==null||s.time("Overall");const N=this._transport.getRenderingIntent(Z,F,n),{renderingIntent:h,cacheKey:e}=N;m(this,iZ,!1),b(this,QW,En).call(this),V||(V=this._transport.getOptionalContentConfig(h));let M=this._intentStates.get(e);M||(M=Object.create(null),this._intentStates.set(e,M)),M.streamReaderCancelTimeout&&(clearTimeout(M.streamReaderCancelTimeout),M.streamReaderCancelTimeout=null);const J=!!(h&SU.PRINT);M.displayReadyCapability||(M.displayReadyCapability=Promise.withResolvers(),M.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},(R=this._stats)==null||R.time("Page Request"),this._pumpOperatorList(N));const G=S=>{var X;M.renderTasks.delete(T),(this._maybeCleanupAfterRender||J)&&m(this,iZ,!0),b(this,RF,rt).call(this,!J),S?(T.capability.reject(S),this._abortOperatorList({intentState:M,reason:S instanceof Error?S:new Error(S)})):T.capability.resolve(),this._stats&&(this._stats.timeEnd("Rendering"),this._stats.timeEnd("Overall"),(X=globalThis.Stats)!=null&&X.enabled&&globalThis.Stats.add(this.pageNumber,this._stats))},T=new pG({callback:G,params:{canvasContext:l,viewport:U,transform:t,background:c},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:Q,operatorList:M.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!J,pdfBug:this._pdfBug,pageColors:a});(M.renderTasks||(M.renderTasks=new Set)).add(T);const p=T.task;return Promise.all([M.displayReadyCapability.promise,V]).then(([S,X])=>{var B;if(this.destroyed){G();return}if((B=this._stats)==null||B.time("Rendering"),!(X.renderingIntent&h))throw new Error("Must use the same `intent`-argument when calling the `PDFPageProxy.render` and `PDFDocumentProxy.getOptionalContentConfig` methods.");T.initializeGraphics({transparency:S,optionalContentConfig:X}),T.operatorListChanged()}).catch(G),p}getOperatorList({intent:l="display",annotationMode:U=aZ.ENABLE,printAnnotationStorage:Z=null}={}){var F;function t(){V.operatorList.lastChunk&&(V.opListReadCapability.resolve(V.operatorList),V.renderTasks.delete(Q))}const c=this._transport.getRenderingIntent(l,U,Z,!0);let V=this._intentStates.get(c.cacheKey);V||(V=Object.create(null),this._intentStates.set(c.cacheKey,V));let Q;return V.opListReadCapability||(Q=Object.create(null),Q.operatorListChanged=t,V.opListReadCapability=Promise.withResolvers(),(V.renderTasks||(V.renderTasks=new Set)).add(Q),V.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},(F=this._stats)==null||F.time("Page Request"),this._pumpOperatorList(c)),V.opListReadCapability.promise}streamTextContent({includeMarkedContent:l=!1,disableNormalization:U=!1}={}){return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,includeMarkedContent:l===!0,disableNormalization:U===!0},{highWaterMark:100,size(Z){return Z.items.length}})}getTextContent(l={}){if(this._transport._htmlForXfa)return this.getXfa().then(Z=>rW.textContent(Z));const U=this.streamTextContent(l);return new Promise(function(Z,F){function t(){c.read().then(function({value:Q,done:a}){if(a){Z(V);return}V.lang??(V.lang=Q.lang),Object.assign(V.styles,Q.styles),V.items.push(...Q.items),t()},F)}const c=U.getReader(),V={items:[],styles:Object.create(null),lang:null};t()})}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;const l=[];for(const U of this._intentStates.values())if(this._abortOperatorList({intentState:U,reason:new Error("Page was destroyed."),force:!0}),!U.opListReadCapability)for(const Z of U.renderTasks)l.push(Z.completed),Z.cancel();return this.objs.clear(),m(this,iZ,!1),b(this,QW,En).call(this),Promise.all(l)}cleanup(l=!1){m(this,iZ,!0);const U=b(this,RF,rt).call(this,!1);return l&&U&&this._stats&&(this._stats=new Vb),U}_startRenderPage(l,U){var Z,F;const t=this._intentStates.get(U);t&&((Z=this._stats)==null||Z.timeEnd("Page Request"),(F=t.displayReadyCapability)==null||F.resolve(l))}_renderPageChunk(l,U){for(let Z=0,F=l.length;Z<F;Z++)U.operatorList.fnArray.push(l.fnArray[Z]),U.operatorList.argsArray.push(l.argsArray[Z]);U.operatorList.lastChunk=l.lastChunk,U.operatorList.separateAnnots=l.separateAnnots;for(const Z of U.renderTasks)Z.operatorListChanged();l.lastChunk&&b(this,RF,rt).call(this,!0)}_pumpOperatorList({renderingIntent:l,cacheKey:U,annotationStorageSerializable:Z}){const{map:F,transfer:t}=Z,c=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:l,cacheKey:U,annotationStorage:F},t).getReader(),V=this._intentStates.get(U);V.streamReader=c;const Q=()=>{c.read().then(({value:a,done:n})=>{if(n){V.streamReader=null;return}this._transport.destroyed||(this._renderPageChunk(a,V),Q())},a=>{if(V.streamReader=null,!this._transport.destroyed){if(V.operatorList){V.operatorList.lastChunk=!0;for(const n of V.renderTasks)n.operatorListChanged();b(this,RF,rt).call(this,!0)}if(V.displayReadyCapability)V.displayReadyCapability.reject(a);else if(V.opListReadCapability)V.opListReadCapability.reject(a);else throw a}})};Q()}_abortOperatorList({intentState:l,reason:U,force:Z=!1}){if(l.streamReader){if(l.streamReaderCancelTimeout&&(clearTimeout(l.streamReaderCancelTimeout),l.streamReaderCancelTimeout=null),!Z){if(l.renderTasks.size>0)return;if(U instanceof Kh){let F=sG;U.extraDelay>0&&U.extraDelay<1e3&&(F+=U.extraDelay),l.streamReaderCancelTimeout=setTimeout(()=>{l.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:l,reason:U,force:!0})},F);return}}if(l.streamReader.cancel(new yF(U.message)).catch(()=>{}),l.streamReader=null,!this._transport.destroyed){for(const[F,t]of this._intentStates)if(t===l){this._intentStates.delete(F);break}this.cleanup()}}}get stats(){return this._stats}}PZ=new WeakMap,iZ=new WeakMap,RF=new WeakSet,rt=function(d=!1){if(b(this,QW,En).call(this),!W(this,iZ)||this.destroyed)return!1;if(d)return m(this,PZ,setTimeout(()=>{m(this,PZ,null),b(this,RF,rt).call(this,!1)},iG)),!1;for(const{renderTasks:l,operatorList:U}of this._intentStates.values())if(l.size>0||!U.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),m(this,iZ,!1),!0},QW=new WeakSet,En=function(){W(this,PZ)&&(clearTimeout(W(this,PZ)),m(this,PZ,null))};var Vt,ER;class SG{constructor(){i(this,Vt,new Set),i(this,ER,Promise.resolve())}postMessage(l,U){const Z={data:structuredClone(l,U?{transfer:U}:null)};W(this,ER).then(()=>{for(const F of W(this,Vt))F.call(this,Z)})}addEventListener(l,U){W(this,Vt).add(U)}removeEventListener(l,U){W(this,Vt).delete(U)}terminate(){W(this,Vt).clear()}}Vt=new WeakMap,ER=new WeakMap;const Bd={isWorkerDisabled:!1,fakeWorkerId:0};fl&&(Bd.isWorkerDisabled=!0,b0.workerSrc||(b0.workerSrc="./pdf.worker.mjs")),Bd.isSameOrigin=function(d,l){let U;try{if(U=new URL(d),!U.origin||U.origin==="null")return!1}catch{return!1}const Z=new URL(l,U);return U.origin===Z.origin},Bd.createCDNWrapper=function(d){const l=`await import("${d}");`;return URL.createObjectURL(new Blob([l],{type:"text/javascript"}))};var eU,EZ,x0,CV,r0,xV;let OQ=(eU=class{constructor({name:d=null,port:l=null,verbosity:U=fM()}={}){i(this,x0);var Z;if(this.name=d,this.destroyed=!1,this.verbosity=U,this._readyCapability=Promise.withResolvers(),this._port=null,this._webWorker=null,this._messageHandler=null,l){if((Z=W(eU,EZ))!=null&&Z.has(l))throw new Error("Cannot use more than one PDFWorker per port.");(W(eU,EZ)||m(eU,EZ,new WeakMap)).set(l,this),this._initializeFromPort(l);return}this._initialize()}get promise(){return fl?Promise.all([td.promise,this._readyCapability.promise]):this._readyCapability.promise}get port(){return this._port}get messageHandler(){return this._messageHandler}_initializeFromPort(d){this._port=d,this._messageHandler=new mc("main","worker",d),this._messageHandler.on("ready",function(){}),b(this,x0,CV).call(this)}_initialize(){if(Bd.isWorkerDisabled||W(eU,r0,xV)){this._setupFakeWorker();return}let{workerSrc:d}=eU;try{Bd.isSameOrigin(window.location.href,d)||(d=Bd.createCDNWrapper(new URL(d,window.location).href));const l=new Worker(d,{type:"module"}),U=new mc("main","worker",l),Z=()=>{F.abort(),U.destroy(),l.terminate(),this.destroyed?this._readyCapability.reject(new Error("Worker was destroyed")):this._setupFakeWorker()},F=new AbortController;l.addEventListener("error",()=>{this._webWorker||Z()},{signal:F.signal}),U.on("test",c=>{if(F.abort(),this.destroyed||!c){Z();return}this._messageHandler=U,this._port=l,this._webWorker=l,b(this,x0,CV).call(this)}),U.on("ready",c=>{if(F.abort(),this.destroyed){Z();return}try{t()}catch{this._setupFakeWorker()}});const t=()=>{const c=new Uint8Array;U.send("test",c,[c.buffer])};t();return}catch{Ns("The worker has been disabled.")}this._setupFakeWorker()}_setupFakeWorker(){Bd.isWorkerDisabled||(f("Setting up fake worker."),Bd.isWorkerDisabled=!0),eU._setupFakeWorkerGlobal.then(d=>{if(this.destroyed){this._readyCapability.reject(new Error("Worker was destroyed"));return}const l=new SG;this._port=l;const U=`fake${Bd.fakeWorkerId++}`,Z=new mc(U+"_worker",U,l);d.setup(Z,l),this._messageHandler=new mc(U,U+"_worker",l),b(this,x0,CV).call(this)}).catch(d=>{this._readyCapability.reject(new Error(`Setting up fake worker failed: "${d.message}".`))})}destroy(){var d;this.destroyed=!0,this._webWorker&&(this._webWorker.terminate(),this._webWorker=null),(d=W(eU,EZ))==null||d.delete(this._port),this._port=null,this._messageHandler&&(this._messageHandler.destroy(),this._messageHandler=null)}static fromPort(d){var l;if(!(d!=null&&d.port))throw new Error("PDFWorker.fromPort - invalid method signature.");const U=(l=W(this,EZ))==null?void 0:l.get(d.port);if(U){if(U._pendingDestroy)throw new Error("PDFWorker.fromPort - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");return U}return new eU(d)}static get workerSrc(){if(b0.workerSrc)return b0.workerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get _setupFakeWorkerGlobal(){return ll(this,"_setupFakeWorkerGlobal",(async()=>W(this,r0,xV)?W(this,r0,xV):(await import(this.workerSrc)).WorkerMessageHandler)())}},EZ=new WeakMap,x0=new WeakSet,CV=function(){this._readyCapability.resolve(),this._messageHandler.send("configure",{verbosity:this.verbosity})},r0=new WeakSet,xV=function(){var d;try{return((d=globalThis.pdfjsWorker)==null?void 0:d.WorkerMessageHandler)||null}catch{return null}},i(eU,r0),i(eU,EZ,void 0),eU);var RZ,Md,Gc,Tc,Jd,Qt,Sc;class XG{constructor(l,U,Z,F,t){i(this,Qt),i(this,RZ,new Map),i(this,Md,new Map),i(this,Gc,new Map),i(this,Tc,new Map),i(this,Jd,null),this.messageHandler=l,this.loadingTask=U,this.commonObjs=new qe,this.fontLoader=new MJ({ownerDocument:F.ownerDocument,styleElement:F.styleElement}),this.loadingParams=F.loadingParams,this._params=F,this.canvasFactory=t.canvasFactory,this.filterFactory=t.filterFactory,this.cMapReaderFactory=t.cMapReaderFactory,this.standardFontDataFactory=t.standardFontDataFactory,this.destroyed=!1,this.destroyCapability=null,this._networkStream=Z,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=Promise.withResolvers(),this.setupMessageHandler()}get annotationStorage(){return ll(this,"annotationStorage",new fh)}getRenderingIntent(l,U=aZ.ENABLE,Z=null,F=!1){let t=SU.DISPLAY,c=pR;switch(l){case"any":t=SU.ANY;break;case"display":break;case"print":t=SU.PRINT;break;default:f(`getRenderingIntent - invalid intent: ${l}`)}switch(U){case aZ.DISABLE:t+=SU.ANNOTATIONS_DISABLE;break;case aZ.ENABLE:break;case aZ.ENABLE_FORMS:t+=SU.ANNOTATIONS_FORMS;break;case aZ.ENABLE_STORAGE:t+=SU.ANNOTATIONS_STORAGE,c=(t&SU.PRINT&&Z instanceof De?Z:this.annotationStorage).serializable;break;default:f(`getRenderingIntent - invalid annotationMode: ${U}`)}return F&&(t+=SU.OPLIST),{renderingIntent:t,cacheKey:`${t}_${c.hash}`,annotationStorageSerializable:c}}destroy(){var l;if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=Promise.withResolvers(),(l=W(this,Jd))==null||l.reject(new Error("Worker was destroyed during onPassword callback"));const U=[];for(const F of W(this,Md).values())U.push(F._destroy());W(this,Md).clear(),W(this,Gc).clear(),W(this,Tc).clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();const Z=this.messageHandler.sendWithPromise("Terminate",null);return U.push(Z),Promise.all(U).then(()=>{var F;this.commonObjs.clear(),this.fontLoader.clear(),W(this,RZ).clear(),this.filterFactory.destroy(),In.cleanup(),(F=this._networkStream)==null||F.cancelAllRequests(new yF("Worker was terminated.")),this.messageHandler&&(this.messageHandler.destroy(),this.messageHandler=null),this.destroyCapability.resolve()},this.destroyCapability.reject),this.destroyCapability.promise}setupMessageHandler(){const{messageHandler:l,loadingTask:U}=this;l.on("GetReader",(Z,F)=>{Jl(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=t=>{this._lastProgress={loaded:t.loaded,total:t.total}},F.onPull=()=>{this._fullReader.read().then(function({value:t,done:c}){if(c){F.close();return}Jl(t instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),F.enqueue(new Uint8Array(t),1,[t])}).catch(t=>{F.error(t)})},F.onCancel=t=>{this._fullReader.cancel(t),F.ready.catch(c=>{if(!this.destroyed)throw c})}}),l.on("ReaderHeadersReady",Z=>{const F=Promise.withResolvers(),t=this._fullReader;return t.headersReady.then(()=>{var c;(!t.isStreamingSupported||!t.isRangeSupported)&&(this._lastProgress&&((c=U.onProgress)==null||c.call(U,this._lastProgress)),t.onProgress=V=>{var Q;(Q=U.onProgress)==null||Q.call(U,{loaded:V.loaded,total:V.total})}),F.resolve({isStreamingSupported:t.isStreamingSupported,isRangeSupported:t.isRangeSupported,contentLength:t.contentLength})},F.reject),F.promise}),l.on("GetRangeReader",(Z,F)=>{Jl(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const t=this._networkStream.getRangeReader(Z.begin,Z.end);if(!t){F.close();return}F.onPull=()=>{t.read().then(function({value:c,done:V}){if(V){F.close();return}Jl(c instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),F.enqueue(new Uint8Array(c),1,[c])}).catch(c=>{F.error(c)})},F.onCancel=c=>{t.cancel(c),F.ready.catch(V=>{if(!this.destroyed)throw V})}}),l.on("GetDoc",({pdfInfo:Z})=>{this._numPages=Z.numPages,this._htmlForXfa=Z.htmlForXfa,delete Z.htmlForXfa,U._capability.resolve(new GG(Z,this))}),l.on("DocException",function(Z){let F;switch(Z.name){case"PasswordException":F=new _i(Z.message,Z.code);break;case"InvalidPDFException":F=new Ve(Z.message);break;case"MissingPDFException":F=new oF(Z.message);break;case"UnexpectedResponseException":F=new hs(Z.message,Z.status);break;case"UnknownErrorException":F=new qi(Z.message,Z.details);break;default:Zl("DocException - expected a valid Error.")}U._capability.reject(F)}),l.on("PasswordRequest",Z=>{if(m(this,Jd,Promise.withResolvers()),U.onPassword){const F=t=>{t instanceof Error?W(this,Jd).reject(t):W(this,Jd).resolve({password:t})};try{U.onPassword(F,Z.code)}catch(t){W(this,Jd).reject(t)}}else W(this,Jd).reject(new _i(Z.message,Z.code));return W(this,Jd).promise}),l.on("DataLoaded",Z=>{var F;(F=U.onProgress)==null||F.call(U,{loaded:Z.length,total:Z.length}),this.downloadInfoCapability.resolve(Z)}),l.on("StartRenderPage",Z=>{this.destroyed||W(this,Md).get(Z.pageIndex)._startRenderPage(Z.transparency,Z.cacheKey)}),l.on("commonobj",([Z,F,t])=>{var c;if(this.destroyed||this.commonObjs.has(Z))return null;switch(F){case"Font":const{disableFontFace:V,fontExtraProperties:Q,pdfBug:a}=this._params;if("error"in t){const N=t.error;f(`Error during font loading: ${N}`),this.commonObjs.resolve(Z,N);break}const n=a&&(c=globalThis.FontInspector)!=null&&c.enabled?(N,h)=>globalThis.FontInspector.fontAdded(N,h):null,s=new JJ(t,{disableFontFace:V,inspectFont:n});this.fontLoader.bind(s).catch(()=>l.sendWithPromise("FontFallback",{id:Z})).finally(()=>{!Q&&s.data&&(s.data=null),this.commonObjs.resolve(Z,s)});break;case"CopyLocalImage":const{imageRef:R}=t;Jl(R,"The imageRef must be defined.");for(const N of W(this,Md).values())for(const[,h]of N.objs)if((h==null?void 0:h.ref)===R)return h.dataLen?(this.commonObjs.resolve(Z,structuredClone(h)),h.dataLen):null;break;case"FontPath":case"Image":case"Pattern":this.commonObjs.resolve(Z,t);break;default:throw new Error(`Got unknown common object type ${F}`)}return null}),l.on("obj",([Z,F,t,c])=>{var V;if(this.destroyed)return;const Q=W(this,Md).get(F);if(!Q.objs.has(Z)){if(Q._intentStates.size===0){(V=c==null?void 0:c.bitmap)==null||V.close();return}switch(t){case"Image":Q.objs.resolve(Z,c),(c==null?void 0:c.dataLen)>gM&&(Q._maybeCleanupAfterRender=!0);break;case"Pattern":Q.objs.resolve(Z,c);break;default:throw new Error(`Got unknown object type ${t}`)}}}),l.on("DocProgress",Z=>{var F;this.destroyed||(F=U.onProgress)==null||F.call(U,{loaded:Z.loaded,total:Z.total})}),l.on("FetchBuiltInCMap",Z=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.cMapReaderFactory?this.cMapReaderFactory.fetch(Z):Promise.reject(new Error("CMapReaderFactory not initialized, see the `useWorkerFetch` parameter."))),l.on("FetchStandardFontData",Z=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.standardFontDataFactory?this.standardFontDataFactory.fetch(Z):Promise.reject(new Error("StandardFontDataFactory not initialized, see the `useWorkerFetch` parameter.")))}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){var l;this.annotationStorage.size<=0&&f("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");const{map:U,transfer:Z}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:U,filename:((l=this._fullReader)==null?void 0:l.filename)??null},Z).finally(()=>{this.annotationStorage.resetModified()})}getPage(l){if(!Number.isInteger(l)||l<=0||l>this._numPages)return Promise.reject(new Error("Invalid page request."));const U=l-1,Z=W(this,Gc).get(U);if(Z)return Z;const F=this.messageHandler.sendWithPromise("GetPage",{pageIndex:U}).then(t=>{if(this.destroyed)throw new Error("Transport destroyed");t.refStr&&W(this,Tc).set(t.refStr,l);const c=new TG(U,t,this,this._params.pdfBug);return W(this,Md).set(U,c),c});return W(this,Gc).set(U,F),F}getPageIndex(l){return rb(l)?this.messageHandler.sendWithPromise("GetPageIndex",{num:l.num,gen:l.gen}):Promise.reject(new Error("Invalid pageIndex request."))}getAnnotations(l,U){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:l,intent:U})}getFieldObjects(){return b(this,Qt,Sc).call(this,"GetFieldObjects")}hasJSActions(){return b(this,Qt,Sc).call(this,"HasJSActions")}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(l){return typeof l!="string"?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:l})}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 b(this,Qt,Sc).call(this,"GetDocJSActions")}getPageJSActions(l){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:l})}getStructTree(l){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:l})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(l){return b(this,Qt,Sc).call(this,"GetOptionalContentConfig").then(U=>new OJ(U,l))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){const l="GetMetadata",U=W(this,RZ).get(l);if(U)return U;const Z=this.messageHandler.sendWithPromise(l,null).then(F=>{var t,c;return{info:F[0],metadata:F[1]?new rJ(F[1]):null,contentDispositionFilename:((t=this._fullReader)==null?void 0:t.filename)??null,contentLength:((c=this._fullReader)==null?void 0:c.contentLength)??null}});return W(this,RZ).set(l,Z),Z}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(l=!1){if(!this.destroyed){await this.messageHandler.sendWithPromise("Cleanup",null);for(const U of W(this,Md).values())if(!U.cleanup())throw new Error(`startCleanup: Page ${U.pageNumber} is currently rendering.`);this.commonObjs.clear(),l||this.fontLoader.clear(),W(this,RZ).clear(),this.filterFactory.destroy(!0),In.cleanup()}}cachedPageNumber(l){if(!rb(l))return null;const U=l.gen===0?`${l.num}R`:`${l.num}R${l.gen}`;return W(this,Tc).get(U)??null}}RZ=new WeakMap,Md=new WeakMap,Gc=new WeakMap,Tc=new WeakMap,Jd=new WeakMap,Qt=new WeakSet,Sc=function(d,l=null){const U=W(this,RZ).get(d);if(U)return U;const Z=this.messageHandler.sendWithPromise(d,l);return W(this,RZ).set(d,Z),Z};const gQ=Symbol("INITIAL_DATA");var AU,KQ,wR;class qe{constructor(){i(this,KQ),i(this,AU,Object.create(null))}get(l,U=null){if(U){const F=b(this,KQ,wR).call(this,l);return F.promise.then(()=>U(F.data)),null}const Z=W(this,AU)[l];if(!Z||Z.data===gQ)throw new Error(`Requesting object that isn't resolved yet ${l}.`);return Z.data}has(l){const U=W(this,AU)[l];return!!U&&U.data!==gQ}resolve(l,U=null){const Z=b(this,KQ,wR).call(this,l);Z.data=U,Z.resolve()}clear(){var l;for(const U in W(this,AU)){const{data:Z}=W(this,AU)[U];(l=Z==null?void 0:Z.bitmap)==null||l.close()}m(this,AU,Object.create(null))}*[Symbol.iterator](){for(const l in W(this,AU)){const{data:U}=W(this,AU)[l];U!==gQ&&(yield[l,U])}}}AU=new WeakMap,KQ=new WeakSet,wR=function(d){var l;return(l=W(this,AU))[d]||(l[d]={...Promise.withResolvers(),data:gQ})};var fZ;class YG{constructor(l){i(this,fZ,null),m(this,fZ,l),this.onContinue=null}get promise(){return W(this,fZ).capability.promise}cancel(l=0){W(this,fZ).cancel(null,l)}get separateAnnots(){const{separateAnnots:l}=W(this,fZ).operatorList;if(!l)return!1;const{annotationCanvasMap:U}=W(this,fZ);return l.form||l.canvas&&(U==null?void 0:U.size)>0}}fZ=new WeakMap;var AZ,jt;const $e=class Xc{constructor({callback:l,params:U,objs:Z,commonObjs:F,annotationCanvasMap:t,operatorList:c,pageIndex:V,canvasFactory:Q,filterFactory:a,useRequestAnimationFrame:n=!1,pdfBug:s=!1,pageColors:R=null}){i(this,AZ,null),this.callback=l,this.params=U,this.objs=Z,this.commonObjs=F,this.annotationCanvasMap=t,this.operatorListIdx=null,this.operatorList=c,this._pageIndex=V,this.canvasFactory=Q,this.filterFactory=a,this._pdfBug=s,this.pageColors=R,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=n===!0&&typeof window<"u",this.cancelled=!1,this.capability=Promise.withResolvers(),this.task=new YG(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=U.canvasContext.canvas}get completed(){return this.capability.promise.catch(function(){})}initializeGraphics({transparency:l=!1,optionalContentConfig:U}){var Z,F;if(this.cancelled)return;if(this._canvas){if(W(Xc,jt).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.");W(Xc,jt).add(this._canvas)}this._pdfBug&&(Z=globalThis.StepperManager)!=null&&Z.enabled&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());const{canvasContext:t,viewport:c,transform:V,background:Q}=this.params;this.gfx=new wQ(t,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:U},this.annotationCanvasMap,this.pageColors),this.gfx.beginDrawing({transform:V,viewport:c,transparency:l,background:Q}),this.operatorListIdx=0,this.graphicsReady=!0,(F=this.graphicsReadyCallback)==null||F.call(this)}cancel(l=null,U=0){var Z;this.running=!1,this.cancelled=!0,(Z=this.gfx)==null||Z.endDrawing(),W(this,AZ)&&(window.cancelAnimationFrame(W(this,AZ)),m(this,AZ,null)),W(Xc,jt).delete(this._canvas),this.callback(l||new Kh(`Rendering cancelled, page ${this._pageIndex+1}`,U))}operatorListChanged(){var l;if(!this.graphicsReady){this.graphicsReadyCallback||(this.graphicsReadyCallback=this._continueBound);return}(l=this.stepper)==null||l.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?m(this,AZ,window.requestAnimationFrame(()=>{m(this,AZ,null),this._nextBound().catch(this._cancelBound)})):Promise.resolve().then(this._nextBound).catch(this._cancelBound)}async _next(){this.cancelled||(this.operatorListIdx=this.gfx.executeOperatorList(this.operatorList,this.operatorListIdx,this._continueBound,this.stepper),this.operatorListIdx===this.operatorList.argsArray.length&&(this.running=!1,this.operatorList.lastChunk&&(this.gfx.endDrawing(),W(Xc,jt).delete(this._canvas),this.callback())))}};AZ=new WeakMap,jt=new WeakMap,i($e,jt,new WeakSet);let pG=$e;const BG="4.4.168",uG="19fbc8998";Ul(670);function jb(d){return Math.floor(Math.max(0,Math.min(1,d))*255).toString(16).padStart(2,"0")}function j0(d){return Math.max(0,Math.min(255,255*d))}class Ob{static CMYK_G([l,U,Z,F]){return["G",1-Math.min(1,.3*l+.59*Z+.11*U+F)]}static G_CMYK([l]){return["CMYK",0,0,0,1-l]}static G_RGB([l]){return["RGB",l,l,l]}static G_rgb([l]){return l=j0(l),[l,l,l]}static G_HTML([l]){const U=jb(l);return`#${U}${U}${U}`}static RGB_G([l,U,Z]){return["G",.3*l+.59*U+.11*Z]}static RGB_rgb(l){return l.map(j0)}static RGB_HTML(l){return`#${l.map(jb).join("")}`}static T_HTML(){return"#00000000"}static T_rgb(){return[null]}static CMYK_RGB([l,U,Z,F]){return["RGB",1-Math.min(1,l+F),1-Math.min(1,Z+F),1-Math.min(1,U+F)]}static CMYK_rgb([l,U,Z,F]){return[j0(1-Math.min(1,l+F)),j0(1-Math.min(1,Z+F)),j0(1-Math.min(1,U+F))]}static CMYK_HTML(l){const U=this.CMYK_RGB(l).slice(1);return this.RGB_HTML(U)}static RGB_CMYK([l,U,Z]){const F=1-l,t=1-U,c=1-Z,V=Math.min(F,t,c);return["CMYK",F,t,c,V]}}let l2=class{static setupStorage(d,l,U,Z,F){const t=Z.getValue(l,{value:null});switch(U.name){case"textarea":if(t.value!==null&&(d.textContent=t.value),F==="print")break;d.addEventListener("input",c=>{Z.setValue(l,{value:c.target.value})});break;case"input":if(U.attributes.type==="radio"||U.attributes.type==="checkbox"){if(t.value===U.attributes.xfaOn?d.setAttribute("checked",!0):t.value===U.attributes.xfaOff&&d.removeAttribute("checked"),F==="print")break;d.addEventListener("change",c=>{Z.setValue(l,{value:c.target.checked?c.target.getAttribute("xfaOn"):c.target.getAttribute("xfaOff")})})}else{if(t.value!==null&&d.setAttribute("value",t.value),F==="print")break;d.addEventListener("input",c=>{Z.setValue(l,{value:c.target.value})})}break;case"select":if(t.value!==null){d.setAttribute("value",t.value);for(const c of U.children)c.attributes.value===t.value?c.attributes.selected=!0:c.attributes.hasOwnProperty("selected")&&delete c.attributes.selected}d.addEventListener("input",c=>{const V=c.target.options,Q=V.selectedIndex===-1?"":V[V.selectedIndex].value;Z.setValue(l,{value:Q})});break}}static setAttributes({html:d,element:l,storage:U=null,intent:Z,linkService:F}){const{attributes:t}=l,c=d instanceof HTMLAnchorElement;t.type==="radio"&&(t.name=`${t.name}-${Z}`);for(const[V,Q]of Object.entries(t))if(Q!=null)switch(V){case"class":Q.length&&d.setAttribute(V,Q.join(" "));break;case"dataId":break;case"id":d.setAttribute("data-element-id",Q);break;case"style":Object.assign(d.style,Q);break;case"textContent":d.textContent=Q;break;default:(!c||V!=="href"&&V!=="newWindow")&&d.setAttribute(V,Q)}c&&F.addLinkAttributes(d,t.href,t.newWindow),U&&t.dataId&&this.setupStorage(d,t.dataId,l,U)}static render(d){var l,U;const Z=d.annotationStorage,F=d.linkService,t=d.xfaHtml,c=d.intent||"display",V=document.createElement(t.name);t.attributes&&this.setAttributes({html:V,element:t,intent:c,linkService:F});const Q=c!=="richText",a=d.div;if(a.append(V),d.viewport){const R=`matrix(${d.viewport.transform.join(",")})`;a.style.transform=R}Q&&a.setAttribute("class","xfaLayer xfaFont");const n=[];if(t.children.length===0){if(t.value){const R=document.createTextNode(t.value);V.append(R),Q&&rW.shouldBuildText(t.name)&&n.push(R)}return{textDivs:n}}const s=[[t,-1,V]];for(;s.length>0;){const[R,N,h]=s.at(-1);if(N+1===R.children.length){s.pop();continue}const e=R.children[++s.at(-1)[1]];if(e===null)continue;const{name:M}=e;if(M==="#text"){const G=document.createTextNode(e.value);n.push(G),h.append(G);continue}const J=(l=e==null?void 0:e.attributes)!=null&&l.xmlns?document.createElementNS(e.attributes.xmlns,M):document.createElement(M);if(h.append(J),e.attributes&&this.setAttributes({html:J,element:e,storage:Z,intent:c,linkService:F}),((U=e.children)==null?void 0:U.length)>0)s.push([e,-1,J]);else if(e.value){const G=document.createTextNode(e.value);Q&&rW.shouldBuildText(M)&&n.push(G),J.append(G)}}for(const R of a.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))R.setAttribute("readOnly",!0);return{textDivs:n}}static update(d){const l=`matrix(${d.viewport.transform.join(",")})`;d.div.style.transform=l,d.div.hidden=!1}};const PW=1e3,oG=9,uF=new WeakSet;function wd(d){return{width:d[2]-d[0],height:d[3]-d[1]}}class yG{static create(l){switch(l.data.annotationType){case el.LINK:return new F2(l);case el.TEXT:return new LG(l);case el.WIDGET:switch(l.data.fieldType){case"Tx":return new zG(l);case"Btn":return l.data.radioButton?new t2(l):l.data.checkBox?new IG(l):new EG(l);case"Ch":return new wG(l);case"Sig":return new DG(l)}return new kF(l);case el.POPUP:return new jR(l);case el.FREETEXT:return new V2(l);case el.LINE:return new xG(l);case el.SQUARE:return new rG(l);case el.CIRCLE:return new jG(l);case el.POLYLINE:return new Q2(l);case el.CARET:return new gG(l);case el.INK:return new a2(l);case el.POLYGON:return new OG(l);case el.HIGHLIGHT:return new KG(l);case el.UNDERLINE:return new vG(l);case el.SQUIGGLY:return new HG(l);case el.STRIKEOUT:return new PG(l);case el.STAMP:return new n2(l);case el.FILEATTACHMENT:return new fG(l);default:return new Gl(l)}}}var _Z,Yc,pc,vQ,CR;const kG=class U2{constructor(l,{isRenderable:U=!1,ignoreBorder:Z=!1,createQuadrilaterals:F=!1}={}){i(this,vQ),i(this,_Z,null),i(this,Yc,!1),i(this,pc,null),this.isRenderable=U,this.data=l.data,this.layer=l.layer,this.linkService=l.linkService,this.downloadManager=l.downloadManager,this.imageResourcesPath=l.imageResourcesPath,this.renderForms=l.renderForms,this.svgFactory=l.svgFactory,this.annotationStorage=l.annotationStorage,this.enableScripting=l.enableScripting,this.hasJSActions=l.hasJSActions,this._fieldObjects=l.fieldObjects,this.parent=l.parent,U&&(this.container=this._createContainer(Z)),F&&this._createQuadrilaterals()}static _hasPopupData({titleObj:l,contentsObj:U,richText:Z}){return!!(l!=null&&l.str||U!=null&&U.str||Z!=null&&Z.str)}get hasPopupData(){return U2._hasPopupData(this.data)}updateEdited(l){var U;if(!this.container)return;W(this,_Z)||m(this,_Z,{rect:this.data.rect.slice(0)});const{rect:Z}=l;Z&&b(this,vQ,CR).call(this,Z),(U=W(this,pc))==null||U.popup.updateEdited(l)}resetEdited(){var l;W(this,_Z)&&(b(this,vQ,CR).call(this,W(this,_Z).rect),(l=W(this,pc))==null||l.popup.resetEdited(),m(this,_Z,null))}_createContainer(l){const{data:U,parent:{page:Z,viewport:F}}=this,t=document.createElement("section");t.setAttribute("data-annotation-id",U.id),this instanceof kF||(t.tabIndex=PW);const{style:c}=t;if(c.zIndex=this.parent.zIndex++,U.popupRef&&t.setAttribute("aria-haspopup","dialog"),U.alternativeText&&(t.title=U.alternativeText),U.noRotate&&t.classList.add("norotate"),!U.rect||this instanceof jR){const{rotation:e}=U;return!U.hasOwnCanvas&&e!==0&&this.setRotation(e,t),t}const{width:V,height:Q}=wd(U.rect);if(!l&&U.borderStyle.width>0){c.borderWidth=`${U.borderStyle.width}px`;const e=U.borderStyle.horizontalCornerRadius,M=U.borderStyle.verticalCornerRadius;if(e>0||M>0){const G=`calc(${e}px * var(--scale-factor)) / calc(${M}px * var(--scale-factor))`;c.borderRadius=G}else if(this instanceof t2){const G=`calc(${V}px * var(--scale-factor)) / calc(${Q}px * var(--scale-factor))`;c.borderRadius=G}switch(U.borderStyle.style){case J0.SOLID:c.borderStyle="solid";break;case J0.DASHED:c.borderStyle="dashed";break;case J0.BEVELED:f("Unimplemented border style: beveled");break;case J0.INSET:f("Unimplemented border style: inset");break;case J0.UNDERLINE:c.borderBottomStyle="solid";break}const J=U.borderColor||null;J?(m(this,Yc,!0),c.borderColor=r.makeHexColor(J[0]|0,J[1]|0,J[2]|0)):c.borderWidth=0}const a=r.normalizeRect([U.rect[0],Z.view[3]-U.rect[1]+Z.view[1],U.rect[2],Z.view[3]-U.rect[3]+Z.view[1]]),{pageWidth:n,pageHeight:s,pageX:R,pageY:N}=F.rawDims;c.left=`${100*(a[0]-R)/n}%`,c.top=`${100*(a[1]-N)/s}%`;const{rotation:h}=U;return U.hasOwnCanvas||h===0?(c.width=`${100*V/n}%`,c.height=`${100*Q/s}%`):this.setRotation(h,t),t}setRotation(l,U=this.container){if(!this.data.rect)return;const{pageWidth:Z,pageHeight:F}=this.parent.viewport.rawDims,{width:t,height:c}=wd(this.data.rect);let V,Q;l%180===0?(V=100*t/Z,Q=100*c/F):(V=100*c/Z,Q=100*t/F),U.style.width=`${V}%`,U.style.height=`${Q}%`,U.setAttribute("data-main-rotation",(360-l)%360)}get _commonActions(){const l=(U,Z,F)=>{const t=F.detail[U],c=t[0],V=t.slice(1);F.target.style[Z]=Ob[`${c}_HTML`](V),this.annotationStorage.setValue(this.data.id,{[Z]:Ob[`${c}_rgb`](V)})};return ll(this,"_commonActions",{display:U=>{const{display:Z}=U.detail,F=Z%2===1;this.container.style.visibility=F?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noView:F,noPrint:Z===1||Z===2})},print:U=>{this.annotationStorage.setValue(this.data.id,{noPrint:!U.detail.print})},hidden:U=>{const{hidden:Z}=U.detail;this.container.style.visibility=Z?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noPrint:Z,noView:Z})},focus:U=>{setTimeout(()=>U.target.focus({preventScroll:!1}),0)},userName:U=>{U.target.title=U.detail.userName},readonly:U=>{U.target.disabled=U.detail.readonly},required:U=>{this._setRequired(U.target,U.detail.required)},bgColor:U=>{l("bgColor","backgroundColor",U)},fillColor:U=>{l("fillColor","backgroundColor",U)},fgColor:U=>{l("fgColor","color",U)},textColor:U=>{l("textColor","color",U)},borderColor:U=>{l("borderColor","borderColor",U)},strokeColor:U=>{l("strokeColor","borderColor",U)},rotation:U=>{const Z=U.detail.rotation;this.setRotation(Z),this.annotationStorage.setValue(this.data.id,{rotation:Z})}})}_dispatchEventFromSandbox(l,U){const Z=this._commonActions;for(const F of Object.keys(U.detail)){const t=l[F]||Z[F];t==null||t(U)}}_setDefaultPropertiesFromJS(l){if(!this.enableScripting)return;const U=this.annotationStorage.getRawValue(this.data.id);if(!U)return;const Z=this._commonActions;for(const[F,t]of Object.entries(U)){const c=Z[F];if(c){const V={detail:{[F]:t},target:l};c(V),delete U[F]}}}_createQuadrilaterals(){if(!this.container)return;const{quadPoints:l}=this.data;if(!l)return;const[U,Z,F,t]=this.data.rect.map(e=>Math.fround(e));if(l.length===8){const[e,M,J,G]=l.subarray(2,6);if(F===e&&t===M&&U===J&&Z===G)return}const{style:c}=this.container;let V;if(W(this,Yc)){const{borderColor:e,borderWidth:M}=c;c.borderWidth=0,V=["url('data:image/svg+xml;utf8,",'<svg xmlns="http://www.w3.org/2000/svg"',' preserveAspectRatio="none" viewBox="0 0 1 1">',`<g fill="transparent" stroke="${e}" stroke-width="${M}">`],this.container.classList.add("hasBorder")}const Q=F-U,a=t-Z,{svgFactory:n}=this,s=n.createElement("svg");s.classList.add("quadrilateralsContainer"),s.setAttribute("width",0),s.setAttribute("height",0);const R=n.createElement("defs");s.append(R);const N=n.createElement("clipPath"),h=`clippath_${this.data.id}`;N.setAttribute("id",h),N.setAttribute("clipPathUnits","objectBoundingBox"),R.append(N);for(let e=2,M=l.length;e<M;e+=8){const J=l[e],G=l[e+1],T=l[e+2],p=l[e+3],S=n.createElement("rect"),X=(T-U)/Q,B=(t-G)/a,k=(J-T)/Q,Y=(G-p)/a;S.setAttribute("x",X),S.setAttribute("y",B),S.setAttribute("width",k),S.setAttribute("height",Y),N.append(S),V==null||V.push(`<rect vector-effect="non-scaling-stroke" x="${X}" y="${B}" width="${k}" height="${Y}"/>`)}W(this,Yc)&&(V.push("</g></svg>')"),c.backgroundImage=V.join("")),this.container.append(s),this.container.style.clipPath=`url(#${h})`}_createPopup(){const{container:l,data:U}=this;l.setAttribute("aria-haspopup","dialog");const Z=m(this,pc,new jR({data:{color:U.color,titleObj:U.titleObj,modificationDate:U.modificationDate,contentsObj:U.contentsObj,richText:U.richText,parentRect:U.rect,borderStyle:0,id:`popup_${U.id}`,rotation:U.rotation},parent:this.parent,elements:[this]}));this.parent.div.append(Z.render())}render(){Zl("Abstract method `AnnotationElement.render` called")}_getElementsByName(l,U=null){const Z=[];if(this._fieldObjects){const F=this._fieldObjects[l];if(F)for(const{page:t,id:c,exportValues:V}of F){if(t===-1||c===U)continue;const Q=typeof V=="string"?V:null,a=document.querySelector(`[data-element-id="${c}"]`);if(a&&!uF.has(a)){f(`_getElementsByName - element not allowed: ${c}`);continue}Z.push({id:c,exportValue:Q,domElement:a})}return Z}for(const F of document.getElementsByName(l)){const{exportValue:t}=F,c=F.getAttribute("data-element-id");c!==U&&uF.has(F)&&Z.push({id:c,exportValue:t,domElement:F})}return Z}show(){var l;this.container&&(this.container.hidden=!1),(l=this.popup)==null||l.maybeShow()}hide(){var l;this.container&&(this.container.hidden=!0),(l=this.popup)==null||l.forceHide()}getElementsToTriggerPopup(){return this.container}addHighlightArea(){const l=this.getElementsToTriggerPopup();if(Array.isArray(l))for(const U of l)U.classList.add("highlightArea");else l.classList.add("highlightArea")}get _isEditable(){return!1}_editOnDoubleClick(){if(!this._isEditable)return;const{annotationEditorType:l,data:{id:U}}=this;this.container.addEventListener("dblclick",()=>{var Z;(Z=this.linkService.eventBus)==null||Z.dispatch("switchannotationeditormode",{source:this,mode:l,editId:U})})}};_Z=new WeakMap,Yc=new WeakMap,pc=new WeakMap,vQ=new WeakSet,CR=function(d){const{container:{style:l},data:{rect:U,rotation:Z},parent:{viewport:{rawDims:{pageWidth:F,pageHeight:t,pageX:c,pageY:V}}}}=this;U==null||U.splice(0,4,...d);const{width:Q,height:a}=wd(d);l.left=`${100*(d[0]-c)/F}%`,l.top=`${100*(t-d[3]+V)/t}%`,Z===0?(l.width=`${100*Q/F}%`,l.height=`${100*a/t}%`):this.setRotation(Z)};let Gl=kG;var NZ,JF,xR,d2,rR,Z2;class F2 extends Gl{constructor(l,U=null){super(l,{isRenderable:!0,ignoreBorder:!!(U!=null&&U.ignoreBorder),createQuadrilaterals:!0}),i(this,NZ),i(this,xR),i(this,rR),this.isTooltipOnly=l.data.isTooltipOnly}render(){const{data:l,linkService:U}=this,Z=document.createElement("a");Z.setAttribute("data-element-id",l.id);let F=!1;return l.url?(U.addLinkAttributes(Z,l.url,l.newWindow),F=!0):l.action?(this._bindNamedAction(Z,l.action),F=!0):l.attachment?(b(this,xR,d2).call(this,Z,l.attachment,l.attachmentDest),F=!0):l.setOCGState?(b(this,rR,Z2).call(this,Z,l.setOCGState),F=!0):l.dest?(this._bindLink(Z,l.dest),F=!0):(l.actions&&(l.actions.Action||l.actions["Mouse Up"]||l.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction(Z,l),F=!0),l.resetForm?(this._bindResetFormAction(Z,l.resetForm),F=!0):this.isTooltipOnly&&!F&&(this._bindLink(Z,""),F=!0)),this.container.classList.add("linkAnnotation"),F&&this.container.append(Z),this.container}_bindLink(l,U){l.href=this.linkService.getDestinationHash(U),l.onclick=()=>(U&&this.linkService.goToDestination(U),!1),(U||U==="")&&b(this,NZ,JF).call(this)}_bindNamedAction(l,U){l.href=this.linkService.getAnchorUrl(""),l.onclick=()=>(this.linkService.executeNamedAction(U),!1),b(this,NZ,JF).call(this)}_bindJSAction(l,U){l.href=this.linkService.getAnchorUrl("");const Z=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(const F of Object.keys(U.actions)){const t=Z.get(F);t&&(l[t]=()=>{var c;return(c=this.linkService.eventBus)==null||c.dispatch("dispatcheventinsandbox",{source:this,detail:{id:U.id,name:F}}),!1})}l.onclick||(l.onclick=()=>!1),b(this,NZ,JF).call(this)}_bindResetFormAction(l,U){const Z=l.onclick;if(Z||(l.href=this.linkService.getAnchorUrl("")),b(this,NZ,JF).call(this),!this._fieldObjects){f('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),Z||(l.onclick=()=>!1);return}l.onclick=()=>{var F;Z==null||Z();const{fields:t,refs:c,include:V}=U,Q=[];if(t.length!==0||c.length!==0){const s=new Set(c);for(const R of t){const N=this._fieldObjects[R]||[];for(const{id:h}of N)s.add(h)}for(const R of Object.values(this._fieldObjects))for(const N of R)s.has(N.id)===V&&Q.push(N)}else for(const s of Object.values(this._fieldObjects))Q.push(...s);const a=this.annotationStorage,n=[];for(const s of Q){const{id:R}=s;switch(n.push(R),s.type){case"text":{const h=s.defaultValue||"";a.setValue(R,{value:h});break}case"checkbox":case"radiobutton":{const h=s.defaultValue===s.exportValues;a.setValue(R,{value:h});break}case"combobox":case"listbox":{const h=s.defaultValue||"";a.setValue(R,{value:h});break}default:continue}const N=document.querySelector(`[data-element-id="${R}"]`);if(N){if(!uF.has(N)){f(`_bindResetFormAction - element not allowed: ${R}`);continue}}else continue;N.dispatchEvent(new Event("resetform"))}return this.enableScripting&&((F=this.linkService.eventBus)==null||F.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:n,name:"ResetForm"}})),!1}}}NZ=new WeakSet,JF=function(){this.container.setAttribute("data-internal-link","")},xR=new WeakSet,d2=function(d,l,U=null){d.href=this.linkService.getAnchorUrl(""),l.description&&(d.title=l.description),d.onclick=()=>{var Z;return(Z=this.downloadManager)==null||Z.openOrDownloadData(l.content,l.filename,U),!1},b(this,NZ,JF).call(this)},rR=new WeakSet,Z2=function(d,l){d.href=this.linkService.getAnchorUrl(""),d.onclick=()=>(this.linkService.executeSetOCGState(l),!1),b(this,NZ,JF).call(this)};class LG extends Gl{constructor(l){super(l,{isRenderable:!0})}render(){this.container.classList.add("textAnnotation");const l=document.createElement("img");return l.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg",l.setAttribute("data-l10n-id","pdfjs-text-annotation-type"),l.setAttribute("data-l10n-args",JSON.stringify({type:this.data.name})),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.append(l),this.container}}class kF extends Gl{render(){return this.container}showElementAndHideCanvas(l){var U;this.data.hasOwnCanvas&&(((U=l.previousSibling)==null?void 0:U.nodeName)==="CANVAS"&&(l.previousSibling.hidden=!0),l.hidden=!1)}_getKeyModifier(l){return aU.platform.isMac?l.metaKey:l.ctrlKey}_setEventListener(l,U,Z,F,t){Z.includes("mouse")?l.addEventListener(Z,c=>{var V;(V=this.linkService.eventBus)==null||V.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:F,value:t(c),shift:c.shiftKey,modifier:this._getKeyModifier(c)}})}):l.addEventListener(Z,c=>{var V;if(Z==="blur"){if(!U.focused||!c.relatedTarget)return;U.focused=!1}else if(Z==="focus"){if(U.focused)return;U.focused=!0}t&&((V=this.linkService.eventBus)==null||V.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:F,value:t(c)}}))})}_setEventListeners(l,U,Z,F){var t,c,V;for(const[Q,a]of Z)(a==="Action"||(t=this.data.actions)!=null&&t[a])&&((a==="Focus"||a==="Blur")&&(U||(U={focused:!1})),this._setEventListener(l,U,Q,a,F),a==="Focus"&&!((c=this.data.actions)!=null&&c.Blur)?this._setEventListener(l,U,"blur","Blur",null):a==="Blur"&&!((V=this.data.actions)!=null&&V.Focus)&&this._setEventListener(l,U,"focus","Focus",null))}_setBackgroundColor(l){const U=this.data.backgroundColor||null;l.style.backgroundColor=U===null?"transparent":r.makeHexColor(U[0],U[1],U[2])}_setTextStyle(l){const U=["left","center","right"],{fontColor:Z}=this.data.defaultAppearanceData,F=this.data.defaultAppearanceData.fontSize||oG,t=l.style;let c;const V=2,Q=a=>Math.round(10*a)/10;if(this.data.multiLine){const a=Math.abs(this.data.rect[3]-this.data.rect[1]-V),n=Math.round(a/(Ys*F))||1,s=a/n;c=Math.min(F,Q(s/Ys))}else{const a=Math.abs(this.data.rect[3]-this.data.rect[1]-V);c=Math.min(F,Q(a/Ys))}t.fontSize=`calc(${c}px * var(--scale-factor))`,t.color=r.makeHexColor(Z[0],Z[1],Z[2]),this.data.textAlignment!==null&&(t.textAlign=U[this.data.textAlignment])}_setRequired(l,U){U?l.setAttribute("required",!0):l.removeAttribute("required"),l.setAttribute("aria-required",U)}}class zG extends kF{constructor(l){const U=l.renderForms||l.data.hasOwnCanvas||!l.data.hasAppearance&&!!l.data.fieldValue;super(l,{isRenderable:U})}setPropertyOnSiblings(l,U,Z,F){const t=this.annotationStorage;for(const c of this._getElementsByName(l.name,l.id))c.domElement&&(c.domElement[U]=Z),t.setValue(c.id,{[F]:Z})}render(){var l,U;const Z=this.annotationStorage,F=this.data.id;this.container.classList.add("textWidgetAnnotation");let t=null;if(this.renderForms){const c=Z.getValue(F,{value:this.data.fieldValue});let V=c.value||"";const Q=Z.getValue(F,{charLimit:this.data.maxLen}).charLimit;Q&&V.length>Q&&(V=V.slice(0,Q));let a=c.formattedValue||((l=this.data.textContent)==null?void 0:l.join(`
|
|
4
4
|
`))||null;a&&this.data.comb&&(a=a.replaceAll(/\s+/g,""));const n={userValue:V,formattedValue:a,lastCommittedValue:null,commitKey:1,focused:!1};this.data.multiLine?(t=document.createElement("textarea"),t.textContent=a??V,this.data.doNotScroll&&(t.style.overflowY="hidden")):(t=document.createElement("input"),t.type="text",t.setAttribute("value",a??V),this.data.doNotScroll&&(t.style.overflowX="hidden")),this.data.hasOwnCanvas&&(t.hidden=!0),uF.add(t),t.setAttribute("data-element-id",F),t.disabled=this.data.readOnly,t.name=this.data.fieldName,t.tabIndex=PW,this._setRequired(t,this.data.required),Q&&(t.maxLength=Q),t.addEventListener("input",R=>{Z.setValue(F,{value:R.target.value}),this.setPropertyOnSiblings(t,"value",R.target.value,"value"),n.formattedValue=null}),t.addEventListener("resetform",R=>{const N=this.data.defaultFieldValue??"";t.value=n.userValue=N,n.formattedValue=null});let s=R=>{const{formattedValue:N}=n;N!=null&&(R.target.value=N),R.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){t.addEventListener("focus",N=>{var h;if(n.focused)return;const{target:e}=N;n.userValue&&(e.value=n.userValue),n.lastCommittedValue=e.value,n.commitKey=1,(h=this.data.actions)!=null&&h.Focus||(n.focused=!0)}),t.addEventListener("updatefromsandbox",N=>{this.showElementAndHideCanvas(N.target);const h={value(e){n.userValue=e.detail.value??"",Z.setValue(F,{value:n.userValue.toString()}),e.target.value=n.userValue},formattedValue(e){const{formattedValue:M}=e.detail;n.formattedValue=M,M!=null&&e.target!==document.activeElement&&(e.target.value=M),Z.setValue(F,{formattedValue:M})},selRange(e){e.target.setSelectionRange(...e.detail.selRange)},charLimit:e=>{var M;const{charLimit:J}=e.detail,{target:G}=e;if(J===0){G.removeAttribute("maxLength");return}G.setAttribute("maxLength",J);let T=n.userValue;!T||T.length<=J||(T=T.slice(0,J),G.value=n.userValue=T,Z.setValue(F,{value:T}),(M=this.linkService.eventBus)==null||M.dispatch("dispatcheventinsandbox",{source:this,detail:{id:F,name:"Keystroke",value:T,willCommit:!0,commitKey:1,selStart:G.selectionStart,selEnd:G.selectionEnd}}))}};this._dispatchEventFromSandbox(h,N)}),t.addEventListener("keydown",N=>{var h;n.commitKey=1;let e=-1;if(N.key==="Escape"?e=0:N.key==="Enter"&&!this.data.multiLine?e=2:N.key==="Tab"&&(n.commitKey=3),e===-1)return;const{value:M}=N.target;n.lastCommittedValue!==M&&(n.lastCommittedValue=M,n.userValue=M,(h=this.linkService.eventBus)==null||h.dispatch("dispatcheventinsandbox",{source:this,detail:{id:F,name:"Keystroke",value:M,willCommit:!0,commitKey:e,selStart:N.target.selectionStart,selEnd:N.target.selectionEnd}}))});const R=s;s=null,t.addEventListener("blur",N=>{var h,e;if(!n.focused||!N.relatedTarget)return;(h=this.data.actions)!=null&&h.Blur||(n.focused=!1);const{value:M}=N.target;n.userValue=M,n.lastCommittedValue!==M&&((e=this.linkService.eventBus)==null||e.dispatch("dispatcheventinsandbox",{source:this,detail:{id:F,name:"Keystroke",value:M,willCommit:!0,commitKey:n.commitKey,selStart:N.target.selectionStart,selEnd:N.target.selectionEnd}})),R(N)}),(U=this.data.actions)!=null&&U.Keystroke&&t.addEventListener("beforeinput",N=>{var h;n.lastCommittedValue=null;const{data:e,target:M}=N,{value:J,selectionStart:G,selectionEnd:T}=M;let p=G,S=T;switch(N.inputType){case"deleteWordBackward":{const X=J.substring(0,G).match(/\w*[^\w]*$/);X&&(p-=X[0].length);break}case"deleteWordForward":{const X=J.substring(G).match(/^[^\w]*\w*/);X&&(S+=X[0].length);break}case"deleteContentBackward":G===T&&(p-=1);break;case"deleteContentForward":G===T&&(S+=1);break}N.preventDefault(),(h=this.linkService.eventBus)==null||h.dispatch("dispatcheventinsandbox",{source:this,detail:{id:F,name:"Keystroke",value:J,change:e||"",willCommit:!1,selStart:p,selEnd:S}})}),this._setEventListeners(t,n,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],N=>N.target.value)}if(s&&t.addEventListener("blur",s),this.data.comb){const R=(this.data.rect[2]-this.data.rect[0])/Q;t.classList.add("comb"),t.style.letterSpacing=`calc(${R}px * var(--scale-factor) - 1ch)`}}else t=document.createElement("div"),t.textContent=this.data.fieldValue,t.style.verticalAlign="middle",t.style.display="table-cell",this.data.hasOwnCanvas&&(t.hidden=!0);return this._setTextStyle(t),this._setBackgroundColor(t),this._setDefaultPropertiesFromJS(t),this.container.append(t),this.container}}class DG extends kF{constructor(l){super(l,{isRenderable:!!l.data.hasOwnCanvas})}}class IG extends kF{constructor(l){super(l,{isRenderable:l.renderForms})}render(){const l=this.annotationStorage,U=this.data,Z=U.id;let F=l.getValue(Z,{value:U.exportValue===U.fieldValue}).value;typeof F=="string"&&(F=F!=="Off",l.setValue(Z,{value:F})),this.container.classList.add("buttonWidgetAnnotation","checkBox");const t=document.createElement("input");return uF.add(t),t.setAttribute("data-element-id",Z),t.disabled=U.readOnly,this._setRequired(t,this.data.required),t.type="checkbox",t.name=U.fieldName,F&&t.setAttribute("checked",!0),t.setAttribute("exportValue",U.exportValue),t.tabIndex=PW,t.addEventListener("change",c=>{const{name:V,checked:Q}=c.target;for(const a of this._getElementsByName(V,Z)){const n=Q&&a.exportValue===U.exportValue;a.domElement&&(a.domElement.checked=n),l.setValue(a.id,{value:n})}l.setValue(Z,{value:Q})}),t.addEventListener("resetform",c=>{const V=U.defaultFieldValue||"Off";c.target.checked=V===U.exportValue}),this.enableScripting&&this.hasJSActions&&(t.addEventListener("updatefromsandbox",c=>{const V={value(Q){Q.target.checked=Q.detail.value!=="Off",l.setValue(Z,{value:Q.target.checked})}};this._dispatchEventFromSandbox(V,c)}),this._setEventListeners(t,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],c=>c.target.checked)),this._setBackgroundColor(t),this._setDefaultPropertiesFromJS(t),this.container.append(t),this.container}}class t2 extends kF{constructor(l){super(l,{isRenderable:l.renderForms})}render(){this.container.classList.add("buttonWidgetAnnotation","radioButton");const l=this.annotationStorage,U=this.data,Z=U.id;let F=l.getValue(Z,{value:U.fieldValue===U.buttonValue}).value;if(typeof F=="string"&&(F=F!==U.buttonValue,l.setValue(Z,{value:F})),F)for(const c of this._getElementsByName(U.fieldName,Z))l.setValue(c.id,{value:!1});const t=document.createElement("input");if(uF.add(t),t.setAttribute("data-element-id",Z),t.disabled=U.readOnly,this._setRequired(t,this.data.required),t.type="radio",t.name=U.fieldName,F&&t.setAttribute("checked",!0),t.tabIndex=PW,t.addEventListener("change",c=>{const{name:V,checked:Q}=c.target;for(const a of this._getElementsByName(V,Z))l.setValue(a.id,{value:!1});l.setValue(Z,{value:Q})}),t.addEventListener("resetform",c=>{const V=U.defaultFieldValue;c.target.checked=V!=null&&V===U.buttonValue}),this.enableScripting&&this.hasJSActions){const c=U.buttonValue;t.addEventListener("updatefromsandbox",V=>{const Q={value:a=>{const n=c===a.detail.value;for(const s of this._getElementsByName(a.target.name)){const R=n&&s.id===Z;s.domElement&&(s.domElement.checked=R),l.setValue(s.id,{value:R})}}};this._dispatchEventFromSandbox(Q,V)}),this._setEventListeners(t,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],V=>V.target.checked)}return this._setBackgroundColor(t),this._setDefaultPropertiesFromJS(t),this.container.append(t),this.container}}class EG extends F2{constructor(l){super(l,{ignoreBorder:l.data.hasAppearance})}render(){const l=super.render();l.classList.add("buttonWidgetAnnotation","pushButton");const U=l.lastChild;return this.enableScripting&&this.hasJSActions&&U&&(this._setDefaultPropertiesFromJS(U),U.addEventListener("updatefromsandbox",Z=>{this._dispatchEventFromSandbox({},Z)})),l}}class wG extends kF{constructor(l){super(l,{isRenderable:l.renderForms})}render(){this.container.classList.add("choiceWidgetAnnotation");const l=this.annotationStorage,U=this.data.id,Z=l.getValue(U,{value:this.data.fieldValue}),F=document.createElement("select");uF.add(F),F.setAttribute("data-element-id",U),F.disabled=this.data.readOnly,this._setRequired(F,this.data.required),F.name=this.data.fieldName,F.tabIndex=PW;let t=this.data.combo&&this.data.options.length>0;this.data.combo||(F.size=this.data.options.length,this.data.multiSelect&&(F.multiple=!0)),F.addEventListener("resetform",n=>{const s=this.data.defaultFieldValue;for(const R of F.options)R.selected=R.value===s});for(const n of this.data.options){const s=document.createElement("option");s.textContent=n.displayValue,s.value=n.exportValue,Z.value.includes(n.exportValue)&&(s.setAttribute("selected",!0),t=!1),F.append(s)}let c=null;if(t){const n=document.createElement("option");n.value=" ",n.setAttribute("hidden",!0),n.setAttribute("selected",!0),F.prepend(n),c=()=>{n.remove(),F.removeEventListener("input",c),c=null},F.addEventListener("input",c)}const V=n=>{const s=n?"value":"textContent",{options:R,multiple:N}=F;return N?Array.prototype.filter.call(R,h=>h.selected).map(h=>h[s]):R.selectedIndex===-1?null:R[R.selectedIndex][s]};let Q=V(!1);const a=n=>{const s=n.target.options;return Array.prototype.map.call(s,R=>({displayValue:R.textContent,exportValue:R.value}))};return this.enableScripting&&this.hasJSActions?(F.addEventListener("updatefromsandbox",n=>{const s={value(R){c==null||c();const N=R.detail.value,h=new Set(Array.isArray(N)?N:[N]);for(const e of F.options)e.selected=h.has(e.value);l.setValue(U,{value:V(!0)}),Q=V(!1)},multipleSelection(R){F.multiple=!0},remove(R){const N=F.options,h=R.detail.remove;N[h].selected=!1,F.remove(h),N.length>0&&Array.prototype.findIndex.call(N,e=>e.selected)===-1&&(N[0].selected=!0),l.setValue(U,{value:V(!0),items:a(R)}),Q=V(!1)},clear(R){for(;F.length!==0;)F.remove(0);l.setValue(U,{value:null,items:[]}),Q=V(!1)},insert(R){const{index:N,displayValue:h,exportValue:e}=R.detail.insert,M=F.children[N],J=document.createElement("option");J.textContent=h,J.value=e,M?M.before(J):F.append(J),l.setValue(U,{value:V(!0),items:a(R)}),Q=V(!1)},items(R){const{items:N}=R.detail;for(;F.length!==0;)F.remove(0);for(const h of N){const{displayValue:e,exportValue:M}=h,J=document.createElement("option");J.textContent=e,J.value=M,F.append(J)}F.options.length>0&&(F.options[0].selected=!0),l.setValue(U,{value:V(!0),items:a(R)}),Q=V(!1)},indices(R){const N=new Set(R.detail.indices);for(const h of R.target.options)h.selected=N.has(h.index);l.setValue(U,{value:V(!0)}),Q=V(!1)},editable(R){R.target.disabled=!R.detail.editable}};this._dispatchEventFromSandbox(s,n)}),F.addEventListener("input",n=>{var s;const R=V(!0),N=V(!1);l.setValue(U,{value:R}),n.preventDefault(),(s=this.linkService.eventBus)==null||s.dispatch("dispatcheventinsandbox",{source:this,detail:{id:U,name:"Keystroke",value:Q,change:N,changeEx:R,willCommit:!1,commitKey:1,keyDown:!1}})}),this._setEventListeners(F,null,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"],["input","Action"],["input","Validate"]],n=>n.target.value)):F.addEventListener("input",function(n){l.setValue(U,{value:V(!0)})}),this.data.combo&&this._setTextStyle(F),this._setBackgroundColor(F),this._setDefaultPropertiesFromJS(F),this.container.append(F),this.container}}class jR extends Gl{constructor(l){const{data:U,elements:Z}=l;super(l,{isRenderable:Gl._hasPopupData(U)}),this.elements=Z,this.popup=null}render(){this.container.classList.add("popupAnnotation");const l=this.popup=new CG({container:this.container,color:this.data.color,titleObj:this.data.titleObj,modificationDate:this.data.modificationDate,contentsObj:this.data.contentsObj,richText:this.data.richText,rect:this.data.rect,parentRect:this.data.parentRect||null,parent:this.parent,elements:this.elements,open:this.data.open}),U=[];for(const Z of this.elements)Z.popup=l,U.push(Z.data.id),Z.addHighlightArea();return this.container.setAttribute("aria-controls",U.map(Z=>`${ae}${Z}`).join(",")),this.container}}var aW,OR,gR,nW,at,Rl,cZ,nt,wn,Cn,sW,qd,_U,hZ,xn,bZ,HQ,qZ,st,iW,PQ,fQ,Zi,KR,gb,vR,c2,HR,W2,PR,Kb,RW,rn,NW,jn,On,fR;class CG{constructor({container:l,color:U,elements:Z,titleObj:F,modificationDate:t,contentsObj:c,richText:V,parent:Q,rect:a,parentRect:n,open:s}){i(this,iW),i(this,fQ),i(this,KR),i(this,vR),i(this,HR),i(this,PR),i(this,RW),i(this,NW),i(this,On),i(this,aW,b(this,HR,W2).bind(this)),i(this,OR,b(this,On,fR).bind(this)),i(this,gR,b(this,NW,jn).bind(this)),i(this,nW,b(this,RW,rn).bind(this)),i(this,at,null),i(this,Rl,null),i(this,cZ,null),i(this,nt,null),i(this,wn,null),i(this,Cn,null),i(this,sW,null),i(this,qd,!1),i(this,_U,null),i(this,hZ,null),i(this,xn,null),i(this,bZ,null),i(this,HQ,null),i(this,qZ,null),i(this,st,!1);var R;m(this,Rl,l),m(this,HQ,F),m(this,cZ,c),m(this,bZ,V),m(this,Cn,Q),m(this,at,U),m(this,xn,a),m(this,sW,n),m(this,wn,Z),m(this,nt,be.toDateObject(t)),this.trigger=Z.flatMap(N=>N.getElementsToTriggerPopup());for(const N of this.trigger)N.addEventListener("click",W(this,nW)),N.addEventListener("mouseenter",W(this,gR)),N.addEventListener("mouseleave",W(this,OR)),N.classList.add("popupTriggerArea");for(const N of Z)(R=N.container)==null||R.addEventListener("keydown",W(this,aW));W(this,Rl).hidden=!0,s&&b(this,RW,rn).call(this)}render(){if(W(this,_U))return;const l=m(this,_U,document.createElement("div"));if(l.className="popup",W(this,at)){const t=l.style.outlineColor=r.makeHexColor(...W(this,at));CSS.supports("background-color","color-mix(in srgb, red 30%, white)")?l.style.backgroundColor=`color-mix(in srgb, ${t} 30%, white)`:l.style.backgroundColor=r.makeHexColor(...W(this,at).map(c=>Math.floor(.7*(255-c)+c)))}const U=document.createElement("span");U.className="header";const Z=document.createElement("h1");if(U.append(Z),{dir:Z.dir,str:Z.textContent}=W(this,HQ),l.append(U),W(this,nt)){const t=document.createElement("span");t.classList.add("popupDate"),t.setAttribute("data-l10n-id","pdfjs-annotation-date-string"),t.setAttribute("data-l10n-args",JSON.stringify({date:W(this,nt).toLocaleDateString(),time:W(this,nt).toLocaleTimeString()})),U.append(t)}const F=W(this,iW,PQ);if(F)l2.render({xfaHtml:F,intent:"richText",div:l}),l.lastChild.classList.add("richText","popupContent");else{const t=this._formatContents(W(this,cZ));l.append(t)}W(this,Rl).append(l)}_formatContents({str:l,dir:U}){const Z=document.createElement("p");Z.classList.add("popupContent"),Z.dir=U;const F=l.split(/(?:\r\n?|\n)/);for(let t=0,c=F.length;t<c;++t){const V=F[t];Z.append(document.createTextNode(V)),t<c-1&&Z.append(document.createElement("br"))}return Z}updateEdited({rect:l,popupContent:U}){var Z;W(this,qZ)||m(this,qZ,{contentsObj:W(this,cZ),richText:W(this,bZ)}),l&&m(this,hZ,null),U&&(m(this,bZ,b(this,vR,c2).call(this,U)),m(this,cZ,null)),(Z=W(this,_U))==null||Z.remove(),m(this,_U,null)}resetEdited(){var l;W(this,qZ)&&({contentsObj:NU(this,cZ)._,richText:NU(this,bZ)._}=W(this,qZ),m(this,qZ,null),(l=W(this,_U))==null||l.remove(),m(this,_U,null),m(this,hZ,null))}forceHide(){m(this,st,this.isVisible),W(this,st)&&(W(this,Rl).hidden=!0)}maybeShow(){W(this,st)&&(W(this,_U)||b(this,NW,jn).call(this),m(this,st,!1),W(this,Rl).hidden=!1)}get isVisible(){return W(this,Rl).hidden===!1}}aW=new WeakMap,OR=new WeakMap,gR=new WeakMap,nW=new WeakMap,at=new WeakMap,Rl=new WeakMap,cZ=new WeakMap,nt=new WeakMap,wn=new WeakMap,Cn=new WeakMap,sW=new WeakMap,qd=new WeakMap,_U=new WeakMap,hZ=new WeakMap,xn=new WeakMap,bZ=new WeakMap,HQ=new WeakMap,qZ=new WeakMap,st=new WeakMap,iW=new WeakSet,PQ=function(){const d=W(this,bZ),l=W(this,cZ);return d!=null&&d.str&&(!(l!=null&&l.str)||l.str===d.str)&&W(this,bZ).html||null},fQ=new WeakSet,Zi=function(){var d,l,U;return((U=(l=(d=W(this,iW,PQ))==null?void 0:d.attributes)==null?void 0:l.style)==null?void 0:U.fontSize)||0},KR=new WeakSet,gb=function(){var d,l,U;return((U=(l=(d=W(this,iW,PQ))==null?void 0:d.attributes)==null?void 0:l.style)==null?void 0:U.color)||null},vR=new WeakSet,c2=function(d){const l=[],U={str:d,html:{name:"div",attributes:{dir:"auto"},children:[{name:"p",children:l}]}},Z={style:{color:W(this,KR,gb),fontSize:W(this,fQ,Zi)?`calc(${W(this,fQ,Zi)}px * var(--scale-factor))`:""}};for(const F of d.split(`
|
|
@@ -26,7 +26,7 @@ import{aT as Sn,bh as YM,cH as db,aU as Pi,bk as te,cI as pM,e as BM,t as uM,f a
|
|
|
26
26
|
}
|
|
27
27
|
`,d.contentWindow.document.head.appendChild(Z),d.contentWindow.document.body.style.width="100%"}function QT(d){return new Promise(l=>{const U=document.createElement("iframe");U.width="0",U.height="0",U.style.position="absolute",U.style.top="0",U.style.left="0",U.style.border="none",U.style.overflow="hidden",U.onload=()=>l(U),d.appendChild(U)})}function aT(d,l){const U=URL.createObjectURL(new Blob([d],{type:"application/pdf"})),Z=document.createElement("a");Z.href=U,Z.download=l,Z.style.display="none",document.body.append(Z),Z.click(),setTimeout(()=>{URL.revokeObjectURL(U),document.body.removeChild(Z)},1e3)}function sm(d){for(;d!=null&&d.firstChild;)d.removeChild(d.firstChild)}function Yi(d){d==null||d.querySelectorAll("canvas").forEach(l=>{var U;l.width=1,l.height=1,(U=l.getContext("2d"))==null||U.clearRect(0,0,1,1)})}function im(d){return Object.prototype.hasOwnProperty.call(d,"_pdfInfo")}function I2({onError:d,onPasswordRequest:l,onProgress:U,source:Z}){const F=Sn(null),t=Sn(null);return YM(async()=>{const c=db(Z);if(c){if(im(c)){F.value=c;return}try{t.value=cT(c),l&&(t.value.onPassword=(V,Q)=>{l({callback:V,isWrongPassword:Q===FT.INCORRECT_PASSWORD})}),U&&(t.value.onProgress=U),F.value=await t.value.promise}catch(V){if(F.value=null,d)d(V);else throw V}}}),Pi(F,(c,V)=>{V==null||V.destroy()}),te(()=>{var c,V,Q,a;(c=t.value)!=null&&c.onPassword&&(t.value.onPassword=null),(V=t.value)!=null&&V.onProgress&&(t.value.onProgress=null),(Q=t.value)==null||Q.destroy(),im(db(Z))||(a=F.value)==null||a.destroy()}),{doc:F}}var YW={};YW.d=(d,l)=>{for(var U in l)YW.o(l,U)&&!YW.o(d,U)&&Object.defineProperty(d,U,{enumerable:!0,get:l[U]})};YW.o=(d,l)=>Object.prototype.hasOwnProperty.call(d,l);var sl=globalThis.pdfjsViewer={};YW.d(sl,{AnnotationLayerBuilder:()=>f2,DownloadManager:()=>tS,EventBus:()=>_2,FindState:()=>UZ,GenericL10n:()=>Xs,LinkTarget:()=>ZF,PDFFindController:()=>vT,PDFHistory:()=>ZX,PDFLinkService:()=>P2,PDFPageView:()=>RM,PDFScriptingManager:()=>bX,PDFSinglePageViewer:()=>JX,PDFViewer:()=>TM,ProgressBar:()=>TT,RenderingStates:()=>il,ScrollMode:()=>q,SimpleLinkService:()=>qh,SpreadMode:()=>Pl,StructTreeLayerBuilder:()=>WM,TextLayerBuilder:()=>sM,XfaLayerBuilder:()=>iM,parseQueryString:()=>Ts});const nT="auto",E2=1,Rm=1.1,sT=.1,iT=10,pi=0,RT=1.25,w2=40,C2=5,il={INITIAL:0,RUNNING:1,PAUSED:2,FINISHED:3},n0={UNKNOWN:0,NORMAL:1,CHANGING:2,FULLSCREEN:3},Fd={DISABLE:0,ENABLE:1,ENABLE_PERMISSIONS:2},q={UNKNOWN:-1,VERTICAL:0,HORIZONTAL:1,WRAPPED:2,PAGE:3},Pl={UNKNOWN:-1,NONE:0,ODD:1,EVEN:2};class NT{constructor(){const l=window.devicePixelRatio||1;this.sx=l,this.sy=l}get scaled(){return this.sx!==1||this.sy!==1}}function x2(d,l,U=!1){let Z=d.offsetParent;if(!Z){console.error("offsetParent is not set -- cannot scroll");return}let F=d.offsetTop+d.clientTop,t=d.offsetLeft+d.clientLeft;for(;Z.clientHeight===Z.scrollHeight&&Z.clientWidth===Z.scrollWidth||U&&(Z.classList.contains("markedContent")||getComputedStyle(Z).overflow==="hidden");)if(F+=Z.offsetTop,t+=Z.offsetLeft,Z=Z.offsetParent,!Z)return;l&&(l.top!==void 0&&(F+=l.top),l.left!==void 0&&(t+=l.left,Z.scrollLeft=t)),Z.scrollTop=F}function hT(d,l,U=void 0){const Z=function(c){t||(t=window.requestAnimationFrame(function(){t=null;const V=d.scrollLeft,Q=F.lastX;V!==Q&&(F.right=V>Q),F.lastX=V;const a=d.scrollTop,n=F.lastY;a!==n&&(F.down=a>n),F.lastY=a,l(F)}))},F={right:!0,down:!0,lastX:d.scrollLeft,lastY:d.scrollTop,_eventHandler:Z};let t=null;return d.addEventListener("scroll",Z,{useCapture:!0,signal:U}),U==null||U.addEventListener("abort",()=>window.cancelAnimationFrame(t),{once:!0}),F}function Ts(d){const l=new Map;for(const[U,Z]of new URLSearchParams(d))l.set(U.toLowerCase(),Z);return l}const Nm=/[\x00-\x1F]/g;function ds(d,l=!1){return Nm.test(d)?l?d.replaceAll(Nm,U=>U==="\0"?"":" "):d.replaceAll("\0",""):d}function jW(d,l,U=0){let Z=U,F=d.length-1;if(F<0||!l(d[F]))return d.length;if(l(d[Z]))return Z;for(;Z<F;){const t=Z+F>>1,c=d[t];l(c)?F=t:Z=t+1}return Z}function hm(d){if(Math.floor(d)===d)return[d,1];const l=1/d,U=8;if(l>U)return[1,U];if(Math.floor(l)===l)return[1,l];const Z=d>1?l:d;let F=0,t=1,c=1,V=1;for(;;){const a=F+c,n=t+V;if(n>U)break;Z<=a/n?(c=a,V=n):(F=a,t=n)}let Q;return Z-F/t<c/V-Z?Q=Z===d?[F,t]:[t,F]:Q=Z===d?[c,V]:[V,c],Q}function QQ(d,l){return d-d%l}function bT(d,l,U){if(d<2)return d;let Z=l[d].div,F=Z.offsetTop+Z.clientTop;F>=U&&(Z=l[d-1].div,F=Z.offsetTop+Z.clientTop);for(let t=d-2;t>=0&&(Z=l[t].div,!(Z.offsetTop+Z.clientTop+Z.clientHeight<=F));--t)d=t;return d}function mT({scrollEl:d,views:l,sortByVisibility:U=!1,horizontal:Z=!1,rtl:F=!1}){const t=d.scrollTop,c=t+d.clientHeight,V=d.scrollLeft,Q=V+d.clientWidth;function a(G){const T=G.div;return T.offsetTop+T.clientTop+T.clientHeight>t}function n(G){const T=G.div,p=T.offsetLeft+T.clientLeft,S=p+T.clientWidth;return F?p<Q:S>V}const s=[],R=new Set,N=l.length;let h=jW(l,Z?n:a);h>0&&h<N&&!Z&&(h=bT(h,l,t));let e=Z?Q:-1;for(let G=h;G<N;G++){const T=l[G],p=T.div,S=p.offsetLeft+p.clientLeft,X=p.offsetTop+p.clientTop,B=p.clientWidth,k=p.clientHeight,Y=S+B,o=X+k;if(e===-1)o>=c&&(e=o);else if((Z?S:X)>e)break;if(o<=t||X>=c||Y<=V||S>=Q)continue;const y=Math.max(0,t-X)+Math.max(0,o-c),D=Math.max(0,V-S)+Math.max(0,Y-Q),I=(k-y)/k,j=(B-D)/B,x=I*j*100|0;s.push({id:T.id,x:S,y:X,view:T,percent:x,widthPercent:j*100|0}),R.add(T.id)}const M=s[0],J=s.at(-1);return U&&s.sort(function(G,T){const p=G.percent-T.percent;return Math.abs(p)>.001?-p:G.id-T.id}),{first:M,last:J,views:s,ids:R}}function r2(d){return Number.isInteger(d)&&d%90===0}function eT(d){return Number.isInteger(d)&&Object.values(q).includes(d)&&d!==q.UNKNOWN}function MT(d){return Number.isInteger(d)&&Object.values(Pl).includes(d)&&d!==Pl.UNKNOWN}function j2(d){return d.width<=d.height}new Promise(function(d){window.requestAnimationFrame(d)});const JT=document.documentElement.style;function GT(d,l,U){return Math.min(Math.max(d,l),U)}var UF,Mt,Jt,Kc,Gt;class TT{constructor(l){i(this,UF,null),i(this,Mt,null),i(this,Jt,0),i(this,Kc,null),i(this,Gt,!0),m(this,UF,l.classList),m(this,Kc,l.style)}get percent(){return W(this,Jt)}set percent(l){if(m(this,Jt,GT(l,0,100)),isNaN(l)){W(this,UF).add("indeterminate");return}W(this,UF).remove("indeterminate"),W(this,Kc).setProperty("--progressBar-percent",`${W(this,Jt)}%`)}setWidth(l){if(!l)return;const U=l.parentNode.offsetWidth-l.offsetWidth;U>0&&W(this,Kc).setProperty("--progressBar-end-offset",`${U}px`)}setDisableAutoFetch(l=5e3){isNaN(W(this,Jt))||(W(this,Mt)&&clearTimeout(W(this,Mt)),this.show(),m(this,Mt,setTimeout(()=>{m(this,Mt,null),this.hide()},l)))}hide(){W(this,Gt)&&(m(this,Gt,!1),W(this,UF).add("hidden"))}show(){W(this,Gt)||(m(this,Gt,!0),W(this,UF).remove("hidden"))}}UF=new WeakMap,Mt=new WeakMap,Jt=new WeakMap,Kc=new WeakMap,Gt=new WeakMap;function ST(d){let l=q.VERTICAL,U=Pl.NONE;switch(d){case"SinglePage":l=q.PAGE;break;case"OneColumn":break;case"TwoPageLeft":l=q.PAGE;case"TwoColumnLeft":U=Pl.ODD;break;case"TwoPageRight":l=q.PAGE;case"TwoColumnRight":U=Pl.EVEN;break}return{scrollMode:l,spreadMode:U}}const yU={SPACE:0,ALPHA_LETTER:1,PUNCT:2,HAN_LETTER:3,KATAKANA_LETTER:4,HIRAGANA_LETTER:5,HALFWIDTH_KATAKANA_LETTER:6,THAI_LETTER:7};function XT(d){return d<11904}function YT(d){return(d&65408)===0}function pT(d){return d>=97&&d<=122||d>=65&&d<=90}function BT(d){return d>=48&&d<=57}function uT(d){return d===32||d===9||d===13||d===10}function oT(d){return d>=13312&&d<=40959||d>=63744&&d<=64255}function yT(d){return d>=12448&&d<=12543}function kT(d){return d>=12352&&d<=12447}function LT(d){return d>=65376&&d<=65439}function zT(d){return(d&65408)===3584}function aQ(d){return XT(d)?YT(d)?uT(d)?yU.SPACE:pT(d)||BT(d)||d===95?yU.ALPHA_LETTER:yU.PUNCT:zT(d)?yU.THAI_LETTER:d===160?yU.SPACE:yU.ALPHA_LETTER:oT(d)?yU.HAN_LETTER:yT(d)?yU.KATAKANA_LETTER:kT(d)?yU.HIRAGANA_LETTER:LT(d)?yU.HALFWIDTH_KATAKANA_LETTER:yU.ALPHA_LETTER}let Bi;function DT(){return Bi||(Bi=" ¨ª¯²-µ¸-º¼-¾IJ-ijĿ-ŀʼnſDŽ-njDZ-dzʰ-ʸ˘-˝ˠ-ˤʹͺ;΄-΅·ϐ-ϖϰ-ϲϴ-ϵϹևٵ-ٸक़-य़ড়-ঢ়য়ਲ਼ਸ਼ਖ਼-ਜ਼ਫ਼ଡ଼-ଢ଼ำຳໜ-ໝ༌གྷཌྷདྷབྷཛྷཀྵჼᴬ-ᴮᴰ-ᴺᴼ-ᵍᵏ-ᵪᵸᶛ-ᶿẚ-ẛάέήίόύώΆ᾽-῁ΈΉ῍-῏ΐΊ῝-῟ΰΎ῭-`ΌΏ´-῾ - ‑‗․-… ″-‴‶-‷‼‾⁇-⁉⁗ ⁰-ⁱ⁴-₎ₐ-ₜ₨℀-℃℅-ℇ℉-ℓℕ-№ℙ-ℝ℠-™ℤΩℨK-ℭℯ-ℱℳ-ℹ℻-⅀ⅅ-ⅉ⅐-ⅿ↉∬-∭∯-∰〈-〉①-⓪⨌⩴-⩶⫝̸ⱼ-ⱽⵯ⺟⻳⼀-⿕ 〶〸-〺゛-゜ゟヿㄱ-ㆎ㆒-㆟㈀-㈞㈠-㉇㉐-㉾㊀-㏿ꚜ-ꚝꝰꟲ-ꟴꟸ-ꟹꭜ-ꭟꭩ豈-嗀塚晴凞-羽蘒諸逸-都飯-舘並-龎ff-stﬓ-ﬗיִײַ-זּטּ-לּמּנּ-סּףּ-פּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-﷼︐-︙︰-﹄﹇-﹒﹔-﹦﹨-﹫ﹰ-ﹲﹴﹶ-ﻼ!-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ¢-₩"),Bi}const UZ={FOUND:0,NOT_FOUND:1,WRAPPED:2,PENDING:3},IT=250,ET=-50,wT=-400,bm={"‐":"-","‘":"'","’":"'","‚":"'","‛":"'","“":'"',"”":'"',"„":'"',"‟":'"',"¼":"1/4","½":"1/2","¾":"3/4"},mm=new Set([12441,12442,2381,2509,2637,2765,2893,3021,3149,3277,3387,3388,3405,3530,3642,3770,3972,4153,4154,5908,5940,6098,6752,6980,7082,7083,7154,7155,11647,43014,43052,43204,43347,43456,43766,44013,3158,3953,3954,3962,3963,3964,3965,3968,3956]);let ui;const CT=new RegExp("\\p{M}+","gu"),xT=new RegExp("([.*+?^${}()|[\\]\\\\])|(\\p{P})|(\\s+)|(\\p{M})|(\\p{L})","gu"),rT=new RegExp("([^\\p{M}])\\p{M}*$","u"),jT=new RegExp("^\\p{M}*([^\\p{M}])","u"),OT=/[\uAC00-\uD7AF\uFA6C\uFACF-\uFAD1\uFAD5-\uFAD7]+/g,em=new Map,gT="[\\u1100-\\u1112\\ud7a4-\\ud7af\\ud84a\\ud84c\\ud850\\ud854\\ud857\\ud85f]",Mm=new Map;let oi=null,yi=null;function ki(d){const l=[];let U;for(;(U=OT.exec(d))!==null;){let{index:N}=U;for(const h of U[0]){let e=em.get(h);e||(e=h.normalize("NFD").length,em.set(h,e)),l.push([e,N++])}}let Z;if(l.length===0&&oi)Z=oi;else if(l.length>0&&yi)Z=yi;else{const N=Object.keys(bm).join(""),h=DT(),e=`([${N}])|([${h}])|((?:゙|゚)\\n)|(\\p{M}+(?:-\\n)?)|(\\S-\\n)|((?:\\p{Ideographic}|[-ヿ])\\n)|(\\n)`;l.length===0?Z=oi=new RegExp(e+"|(\\u0000)","gum"):Z=yi=new RegExp(e+`|(${gT})`,"gum")}const F=[];for(;(U=CT.exec(d))!==null;)F.push([U[0].length,U.index]);let t=d.normalize("NFD");const c=[[0,0]];let V=0,Q=0,a=0,n=0,s=0,R=!1;return t=t.replace(Z,(N,h,e,M,J,G,T,p,S,X)=>{var B,k,Y;if(X-=n,h){const o=bm[h],y=o.length;for(let D=1;D<y;D++)c.push([X-a+D,a-D]);return a-=y-1,o}if(e){let o=Mm.get(e);o||(o=e.normalize("NFKC"),Mm.set(e,o));const y=o.length;for(let D=1;D<y;D++)c.push([X-a+D,a-D]);return a-=y-1,o}if(M)return R=!0,X+s===((B=F[V])==null?void 0:B[1])?++V:(c.push([X-1-a+1,a-1]),a-=1,n+=1),c.push([X-a+1,a]),n+=1,s+=1,M.charAt(0);if(J){const o=J.endsWith(`
|
|
28
28
|
`),y=o?J.length-2:J.length;R=!0;let D=y;X+s===((k=F[V])==null?void 0:k[1])&&(D-=F[V][0],++V);for(let I=1;I<=D;I++)c.push([X-1-a+I,a-I]);return a-=D,n+=D,o?(X+=y-1,c.push([X-a+1,1+a]),a+=1,n+=1,s+=1,J.slice(0,y)):J}if(G){const o=G.length-2;return c.push([X-a+o,1+a]),a+=1,n+=1,s+=1,G.slice(0,-2)}if(T){const o=T.length-1;return c.push([X-a+o,a]),n+=1,s+=1,T.slice(0,-1)}if(p)return c.push([X-a+1,a-1]),a-=1,n+=1,s+=1," ";if(X+s===((Y=l[Q])==null?void 0:Y[1])){const o=l[Q][0]-1;++Q;for(let y=1;y<=o;y++)c.push([X-(a-y),a-y]);a-=o,n+=o}return S}),c.push([t.length,a]),[t,c,R]}function KT(d,l,U){if(!d)return[l,U];const Z=l,F=l+U-1;let t=jW(d,a=>a[0]>=Z);d[t][0]>Z&&--t;let c=jW(d,a=>a[0]>=F,t);d[c][0]>F&&--c;const V=Z+d[t][1],Q=F+d[c][1]+1-V;return[V,Q]}var Dl,pW,Tt,jN,O2,La,ON,za,Li,gN,Jm,KN,Gm,vN,Tm,Da,zi,HN,Sm,PN,Xm,vc,nQ,St,lc,dF,PF,fN,Ym,Ia,Di,Ea,Ii,Hc,sQ,AN,g2,wa,Ei,Ca,wi,Xt,Uc;class vT{constructor({linkService:l,eventBus:U,updateMatchesCountOnProgress:Z=!0}){i(this,jN),i(this,La),i(this,za),i(this,gN),i(this,KN),i(this,vN),i(this,Da),i(this,HN),i(this,PN),i(this,vc),i(this,St),i(this,dF),i(this,fN),i(this,Ia),i(this,Ea),i(this,Hc),i(this,AN),i(this,wa),i(this,Ca),i(this,Xt),i(this,Dl,null),i(this,pW,!0),i(this,Tt,0),this._linkService=l,this._eventBus=U,m(this,pW,Z),this.onIsPageVisible=null,b(this,La,ON).call(this),U._on("find",b(this,jN,O2).bind(this)),U._on("findbarclose",b(this,AN,g2).bind(this))}get highlightMatches(){return this._highlightMatches}get pageMatches(){return this._pageMatches}get pageMatchesLength(){return this._pageMatchesLength}get selected(){return this._selected}get state(){return W(this,Dl)}setDocument(l){this._pdfDocument&&b(this,La,ON).call(this),l&&(this._pdfDocument=l,this._firstPageCapability.resolve())}scrollMatchIntoView({element:l=null,selectedLeft:U=0,pageIndex:Z=-1,matchIndex:F=-1}){if(!this._scrollMatches||!l||F===-1||F!==this._selected.matchIdx||Z===-1||Z!==this._selected.pageIdx)return;this._scrollMatches=!1;const t={top:ET,left:U+wT};x2(l,t,!0)}}Dl=new WeakMap,pW=new WeakMap,Tt=new WeakMap,jN=new WeakSet,O2=function(d){if(!d)return;const l=this._pdfDocument,{type:U}=d;(W(this,Dl)===null||b(this,gN,Jm).call(this,d))&&(this._dirtyMatch=!0),m(this,Dl,d),U!=="highlightallchange"&&b(this,Xt,Uc).call(this,UZ.PENDING),this._firstPageCapability.promise.then(()=>{if(!this._pdfDocument||l&&this._pdfDocument!==l)return;b(this,PN,Xm).call(this);const Z=!this._highlightMatches,F=!!this._findTimeout;this._findTimeout&&(clearTimeout(this._findTimeout),this._findTimeout=null),U?this._dirtyMatch?b(this,dF,PF).call(this):U==="again"?(b(this,dF,PF).call(this),Z&&W(this,Dl).highlightAll&&b(this,St,lc).call(this)):U==="highlightallchange"?(F?b(this,dF,PF).call(this):this._highlightMatches=!0,b(this,St,lc).call(this)):b(this,dF,PF).call(this):this._findTimeout=setTimeout(()=>{b(this,dF,PF).call(this),this._findTimeout=null},IT)})},La=new WeakSet,ON=function(){this._highlightMatches=!1,this._scrollMatches=!1,this._pdfDocument=null,this._pageMatches=[],this._pageMatchesLength=[],m(this,Tt,0),m(this,Dl,null),this._selected={pageIdx:-1,matchIdx:-1},this._offset={pageIdx:null,matchIdx:null,wrapped:!1},this._extractTextPromises=[],this._pageContents=[],this._pageDiffs=[],this._hasDiacritics=[],this._matchesCountTotal=0,this._pagesToSearch=null,this._pendingFindMatches=new Set,this._resumePageIdx=null,this._dirtyMatch=!1,clearTimeout(this._findTimeout),this._findTimeout=null,this._firstPageCapability=Promise.withResolvers()},za=new WeakSet,Li=function(){const{query:d}=W(this,Dl);return typeof d=="string"?(d!==this._rawQuery&&(this._rawQuery=d,[this._normalizedQuery]=ki(d)),this._normalizedQuery):(d||[]).filter(l=>!!l).map(l=>ki(l)[0])},gN=new WeakSet,Jm=function(d){var l;const U=d.query,Z=W(this,Dl).query,F=typeof U;if(F!==typeof Z)return!0;if(F==="string"){if(U!==Z)return!0}else if(JSON.stringify(U)!==JSON.stringify(Z))return!0;switch(d.type){case"again":const t=this._selected.pageIdx+1,c=this._linkService;return t>=1&&t<=c.pagesCount&&t!==c.page&&!(((l=this.onIsPageVisible)==null?void 0:l.call(this,t))??!0);case"highlightallchange":return!1}return!0},KN=new WeakSet,Gm=function(d,l,U){let Z=d.slice(0,l).match(rT);if(Z){const F=d.charCodeAt(l),t=Z[1].charCodeAt(0);if(aQ(F)===aQ(t))return!1}if(Z=d.slice(l+U).match(jT),Z){const F=d.charCodeAt(l+U-1),t=Z[1].charCodeAt(0);if(aQ(F)===aQ(t))return!1}return!0},vN=new WeakSet,Tm=function(d,l,U,Z){const F=this._pageMatches[U]=[],t=this._pageMatchesLength[U]=[];if(!d)return;const c=this._pageDiffs[U];let V;for(;(V=d.exec(Z))!==null;){if(l&&!b(this,KN,Gm).call(this,Z,V.index,V[0].length))continue;const[Q,a]=KT(c,V.index,V[0].length);a&&(F.push(Q),t.push(a))}},Da=new WeakSet,zi=function(d,l){const{matchDiacritics:U}=W(this,Dl);let Z=!1;d=d.replaceAll(xT,(t,c,V,Q,a,n)=>c?`[ ]*\\${c}[ ]*`:V?`[ ]*${V}[ ]*`:Q?"[ ]+":U?a||n:a?mm.has(a.charCodeAt(0))?a:"":l?(Z=!0,`${n}\\p{M}*`):n);const F="[ ]*";return d.endsWith(F)&&(d=d.slice(0,d.length-F.length)),U&&l&&(ui||(ui=String.fromCharCode(...mm)),Z=!0,d=`${d}(?=[${ui}]|[^\\p{M}]|$)`),[Z,d]},HN=new WeakSet,Sm=function(d){let l=W(this,za,Li);if(l.length===0)return;const{caseSensitive:U,entireWord:Z}=W(this,Dl),F=this._pageContents[d],t=this._hasDiacritics[d];let c=!1;typeof l=="string"?[c,l]=b(this,Da,zi).call(this,l,t):l=l.sort().reverse().map(a=>{const[n,s]=b(this,Da,zi).call(this,a,t);return c||(c=n),`(${s})`}).join("|");const V=`g${c?"u":""}${U?"":"i"}`;l=l?new RegExp(l,V):null,b(this,vN,Tm).call(this,l,Z,d,F),W(this,Dl).highlightAll&&b(this,vc,nQ).call(this,d),this._resumePageIdx===d&&(this._resumePageIdx=null,b(this,Ia,Di).call(this));const Q=this._pageMatches[d].length;this._matchesCountTotal+=Q,W(this,pW)?Q>0&&b(this,Ca,wi).call(this):++NU(this,Tt)._===this._linkService.pagesCount&&b(this,Ca,wi).call(this)},PN=new WeakSet,Xm=function(){if(this._extractTextPromises.length>0)return;let d=Promise.resolve();const l={disableNormalization:!0};for(let U=0,Z=this._linkService.pagesCount;U<Z;U++){const{promise:F,resolve:t}=Promise.withResolvers();this._extractTextPromises[U]=F,d=d.then(()=>this._pdfDocument.getPage(U+1).then(c=>c.getTextContent(l)).then(c=>{const V=[];for(const Q of c.items)V.push(Q.str),Q.hasEOL&&V.push(`
|
|
29
|
-
`);[this._pageContents[U],this._pageDiffs[U],this._hasDiacritics[U]]=ki(V.join("")),t()},c=>{console.error(`Unable to get text content for page ${U+1}`,c),this._pageContents[U]="",this._pageDiffs[U]=null,this._hasDiacritics[U]=!1,t()}))}},vc=new WeakSet,nQ=function(d){this._scrollMatches&&this._selected.pageIdx===d&&(this._linkService.page=d+1),this._eventBus.dispatch("updatetextlayermatches",{source:this,pageIndex:d})},St=new WeakSet,lc=function(){this._eventBus.dispatch("updatetextlayermatches",{source:this,pageIndex:-1})},dF=new WeakSet,PF=function(){const d=W(this,Dl).findPrevious,l=this._linkService.page-1,U=this._linkService.pagesCount;if(this._highlightMatches=!0,this._dirtyMatch){this._dirtyMatch=!1,this._selected.pageIdx=this._selected.matchIdx=-1,this._offset.pageIdx=l,this._offset.matchIdx=null,this._offset.wrapped=!1,this._resumePageIdx=null,this._pageMatches.length=0,this._pageMatchesLength.length=0,m(this,Tt,0),this._matchesCountTotal=0,b(this,St,lc).call(this);for(let F=0;F<U;F++)this._pendingFindMatches.has(F)||(this._pendingFindMatches.add(F),this._extractTextPromises[F].then(()=>{this._pendingFindMatches.delete(F),b(this,HN,Sm).call(this,F)}))}if(W(this,za,Li).length===0){b(this,Xt,Uc).call(this,UZ.FOUND);return}if(this._resumePageIdx)return;const Z=this._offset;if(this._pagesToSearch=U,Z.matchIdx!==null){const F=this._pageMatches[Z.pageIdx].length;if(!d&&Z.matchIdx+1<F||d&&Z.matchIdx>0){Z.matchIdx=d?Z.matchIdx-1:Z.matchIdx+1,b(this,Hc,sQ).call(this,!0);return}b(this,Ea,Ii).call(this,d)}b(this,Ia,Di).call(this)},fN=new WeakSet,Ym=function(d){const l=this._offset,U=d.length,Z=W(this,Dl).findPrevious;return U?(l.matchIdx=Z?U-1:0,b(this,Hc,sQ).call(this,!0),!0):(b(this,Ea,Ii).call(this,Z),l.wrapped&&(l.matchIdx=null,this._pagesToSearch<0)?(b(this,Hc,sQ).call(this,!1),!0):!1)},Ia=new WeakSet,Di=function(){this._resumePageIdx!==null&&console.error("There can only be one pending page.");let d=null;do{const l=this._offset.pageIdx;if(d=this._pageMatches[l],!d){this._resumePageIdx=l;break}}while(!b(this,fN,Ym).call(this,d))},Ea=new WeakSet,Ii=function(d){const l=this._offset,U=this._linkService.pagesCount;l.pageIdx=d?l.pageIdx-1:l.pageIdx+1,l.matchIdx=null,this._pagesToSearch--,(l.pageIdx>=U||l.pageIdx<0)&&(l.pageIdx=d?U-1:0,l.wrapped=!0)},Hc=new WeakSet,sQ=function(d=!1){let l=UZ.NOT_FOUND;const U=this._offset.wrapped;if(this._offset.wrapped=!1,d){const Z=this._selected.pageIdx;this._selected.pageIdx=this._offset.pageIdx,this._selected.matchIdx=this._offset.matchIdx,l=U?UZ.WRAPPED:UZ.FOUND,Z!==-1&&Z!==this._selected.pageIdx&&b(this,vc,nQ).call(this,Z)}b(this,Xt,Uc).call(this,l,W(this,Dl).findPrevious),this._selected.pageIdx!==-1&&(this._scrollMatches=!0,b(this,vc,nQ).call(this,this._selected.pageIdx))},AN=new WeakSet,g2=function(d){const l=this._pdfDocument;this._firstPageCapability.promise.then(()=>{!this._pdfDocument||l&&this._pdfDocument!==l||(this._findTimeout&&(clearTimeout(this._findTimeout),this._findTimeout=null),this._resumePageIdx&&(this._resumePageIdx=null,this._dirtyMatch=!0),b(this,Xt,Uc).call(this,UZ.FOUND),this._highlightMatches=!1,b(this,St,lc).call(this))})},wa=new WeakSet,Ei=function(){var d;const{pageIdx:l,matchIdx:U}=this._selected;let Z=0,F=this._matchesCountTotal;if(U!==-1){for(let t=0;t<l;t++)Z+=((d=this._pageMatches[t])==null?void 0:d.length)||0;Z+=U+1}return(Z<1||Z>F)&&(Z=F=0),{current:Z,total:F}},Ca=new WeakSet,wi=function(){this._eventBus.dispatch("updatefindmatchescount",{source:this,matchesCount:b(this,wa,Ei).call(this)})},Xt=new WeakSet,Uc=function(d,l=!1){var U,Z;!W(this,pW)&&(W(this,Tt)!==this._linkService.pagesCount||d===UZ.PENDING)||this._eventBus.dispatch("updatefindcontrolstate",{source:this,state:d,previous:l,entireWord:((U=W(this,Dl))==null?void 0:U.entireWord)??null,matchesCount:b(this,wa,Ei).call(this),rawQuery:((Z=W(this,Dl))==null?void 0:Z.query)??null})};const HT="noopener noreferrer nofollow",ZF={NONE:0,SELF:1,BLANK:2,PARENT:3,TOP:4};var _N,K2;const v2=class H2{constructor({eventBus:l,externalLinkTarget:U=null,externalLinkRel:Z=null,ignoreDestinationZoom:F=!1}={}){H(this,"externalLinkEnabled",!0),this.eventBus=l,this.externalLinkTarget=U,this.externalLinkRel=Z,this._ignoreDestinationZoom=F,this.baseUrl=null,this.pdfDocument=null,this.pdfViewer=null,this.pdfHistory=null}setDocument(l,U=null){this.baseUrl=U,this.pdfDocument=l}setViewer(l){this.pdfViewer=l}setHistory(l){this.pdfHistory=l}get pagesCount(){return this.pdfDocument?this.pdfDocument.numPages:0}get page(){return this.pdfDocument?this.pdfViewer.currentPageNumber:1}set page(l){this.pdfDocument&&(this.pdfViewer.currentPageNumber=l)}get rotation(){return this.pdfDocument?this.pdfViewer.pagesRotation:0}set rotation(l){this.pdfDocument&&(this.pdfViewer.pagesRotation=l)}get isInPresentationMode(){return this.pdfDocument?this.pdfViewer.isInPresentationMode:!1}async goToDestination(l){if(!this.pdfDocument)return;let U,Z,F;if(typeof l=="string"?(U=l,Z=await this.pdfDocument.getDestination(l)):(U=null,Z=await l),!Array.isArray(Z)){console.error(`goToDestination: "${Z}" is not a valid destination array, for dest="${l}".`);return}const[t]=Z;if(t&&typeof t=="object"){if(F=this.pdfDocument.cachedPageNumber(t),!F)try{F=await this.pdfDocument.getPageIndex(t)+1}catch{console.error(`goToDestination: "${t}" is not a valid page reference, for dest="${l}".`);return}}else Number.isInteger(t)&&(F=t+1);if(!F||F<1||F>this.pagesCount){console.error(`goToDestination: "${F}" is not a valid page number, for dest="${l}".`);return}this.pdfHistory&&(this.pdfHistory.pushCurrentPosition(),this.pdfHistory.push({namedDest:U,explicitDest:Z,pageNumber:F})),this.pdfViewer.scrollPageIntoView({pageNumber:F,destArray:Z,ignoreDestinationZoom:this._ignoreDestinationZoom})}goToPage(l){if(!this.pdfDocument)return;const U=typeof l=="string"&&this.pdfViewer.pageLabelToPageNumber(l)||l|0;if(!(Number.isInteger(U)&&U>0&&U<=this.pagesCount)){console.error(`PDFLinkService.goToPage: "${l}" is not a valid page.`);return}this.pdfHistory&&(this.pdfHistory.pushCurrentPosition(),this.pdfHistory.pushPage(U)),this.pdfViewer.scrollPageIntoView({pageNumber:U})}addLinkAttributes(l,U,Z=!1){if(!U||typeof U!="string")throw new Error('A valid "url" parameter must provided.');const F=Z?ZF.BLANK:this.externalLinkTarget,t=this.externalLinkRel;this.externalLinkEnabled?l.href=l.title=U:(l.href="",l.title=`Disabled: ${U}`,l.onclick=()=>!1);let c="";switch(F){case ZF.NONE:break;case ZF.SELF:c="_self";break;case ZF.BLANK:c="_blank";break;case ZF.PARENT:c="_parent";break;case ZF.TOP:c="_top";break}l.target=c,l.rel=typeof t=="string"?t:HT}getDestinationHash(l){if(typeof l=="string"){if(l.length>0)return this.getAnchorUrl("#"+escape(l))}else if(Array.isArray(l)){const U=JSON.stringify(l);if(U.length>0)return this.getAnchorUrl("#"+escape(U))}return this.getAnchorUrl("")}getAnchorUrl(l){return this.baseUrl?this.baseUrl+l:l}setHash(l){var U;if(!this.pdfDocument)return;let Z,F;if(l.includes("=")){const t=Ts(l);if(t.has("search")){const c=t.get("search").replaceAll('"',""),V=t.get("phrase")==="true";this.eventBus.dispatch("findfromurlhash",{source:this,query:V?c:c.match(/\S+/g)})}if(t.has("page")&&(Z=t.get("page")|0||1),t.has("zoom")){const c=t.get("zoom").split(","),V=c[0],Q=parseFloat(V);V.includes("Fit")?V==="Fit"||V==="FitB"?F=[null,{name:V}]:V==="FitH"||V==="FitBH"||V==="FitV"||V==="FitBV"?F=[null,{name:V},c.length>1?c[1]|0:null]:V==="FitR"?c.length!==5?console.error('PDFLinkService.setHash: Not enough parameters for "FitR".'):F=[null,{name:V},c[1]|0,c[2]|0,c[3]|0,c[4]|0]:console.error(`PDFLinkService.setHash: "${V}" is not a valid zoom value.`):F=[null,{name:"XYZ"},c.length>1?c[1]|0:null,c.length>2?c[2]|0:null,Q?Q/100:V]}F?this.pdfViewer.scrollPageIntoView({pageNumber:Z||this.page,destArray:F,allowNegativeOffset:!0}):Z&&(this.page=Z),t.has("pagemode")&&this.eventBus.dispatch("pagemode",{source:this,mode:t.get("pagemode")}),t.has("nameddest")&&this.goToDestination(t.get("nameddest"));return}F=unescape(l);try{F=JSON.parse(F),Array.isArray(F)||(F=F.toString())}catch{}if(typeof F=="string"||b(U=H2,_N,K2).call(U,F)){this.goToDestination(F);return}console.error(`PDFLinkService.setHash: "${unescape(l)}" is not a valid destination.`)}executeNamedAction(l){var U,Z;if(this.pdfDocument){switch(l){case"GoBack":(U=this.pdfHistory)==null||U.back();break;case"GoForward":(Z=this.pdfHistory)==null||Z.forward();break;case"NextPage":this.pdfViewer.nextPage();break;case"PrevPage":this.pdfViewer.previousPage();break;case"LastPage":this.page=this.pagesCount;break;case"FirstPage":this.page=1;break}this.eventBus.dispatch("namedaction",{source:this,action:l})}}async executeSetOCGState(l){if(!this.pdfDocument)return;const U=this.pdfDocument,Z=await this.pdfViewer.optionalContentConfigPromise;U===this.pdfDocument&&(Z.setOCGState(l),this.pdfViewer.optionalContentConfigPromise=Promise.resolve(Z))}};_N=new WeakSet,K2=function(d){if(!Array.isArray(d)||d.length<2)return!1;const[l,U,...Z]=d;if(!(typeof l=="object"&&Number.isInteger(l==null?void 0:l.num)&&Number.isInteger(l==null?void 0:l.gen))&&!Number.isInteger(l)||!(typeof U=="object"&&typeof(U==null?void 0:U.name)=="string"))return!1;let F=!0;switch(U.name){case"XYZ":if(Z.length!==3)return!1;break;case"Fit":case"FitB":return Z.length===0;case"FitH":case"FitBH":case"FitV":case"FitBV":if(Z.length!==1)return!1;break;case"FitR":if(Z.length!==4)return!1;F=!1;break;default:return!1}for(const t of Z)if(!(typeof t=="number"||F&&t===null))return!1;return!0},i(v2,_N);let P2=v2;class qh extends P2{setDocument(l,U=null){}}const{AbortException:PT,AnnotationEditorLayer:fT,AnnotationEditorParamsType:jX,AnnotationEditorType:GZ,AnnotationEditorUIManager:AT,AnnotationLayer:_T,AnnotationMode:Id,build:OX,CMapCompressionType:gX,ColorPicker:KX,createValidAbsoluteUrl:qT,DOMSVGFactory:vX,DrawLayer:$T,FeatureTest:HX,fetchData:pm,getDocument:PX,getFilenameFromUrl:fX,getPdfFilenameFromUrl:lS,getXfaPageViewport:AX,GlobalWorkerOptions:_X,ImageKind:qX,InvalidPDFException:$X,isDataScheme:lY,isPdfFile:US,MissingPDFException:UY,noContextMenu:dY,normalizeUnicode:dS,OPS:ZY,Outliner:FY,PasswordResponses:tY,PDFDataRangeTransport:cY,PDFDateString:WY,PDFWorker:VY,PermissionFlag:iQ,PixelsPerInch:zd,RenderingCancelledException:$h,renderTextLayer:QY,setLayerDimensions:ZS,shadow:Zs,TextLayer:FS,UnexpectedResponseException:aY,updateTextLayer:nY,Util:sY,VerbosityLevel:iY,version:Bm,XfaLayer:Ci}=globalThis.pdfjsLib;var xa,FF,ra,qN;class f2{constructor({pdfPage:l,linkService:U,downloadManager:Z,annotationStorage:F=null,imageResourcesPath:t="",renderForms:c=!0,enableScripting:V=!1,hasJSActionsPromise:Q=null,fieldObjectsPromise:a=null,annotationCanvasMap:n=null,accessibilityManager:s=null,annotationEditorUIManager:R=null,onAppend:N=null}){i(this,ra),i(this,xa,null),i(this,FF,null),this.pdfPage=l,this.linkService=U,this.downloadManager=Z,this.imageResourcesPath=t,this.renderForms=c,this.annotationStorage=F,this.enableScripting=V,this._hasJSActionsPromise=Q||Promise.resolve(!1),this._fieldObjectsPromise=a||Promise.resolve(null),this._annotationCanvasMap=n,this._accessibilityManager=s,this._annotationEditorUIManager=R,m(this,xa,N),this.annotationLayer=null,this.div=null,this._cancelled=!1,this._eventBus=U.eventBus}async render(l,U="display"){var Z,F;if(this.div){if(this._cancelled||!this.annotationLayer)return;this.annotationLayer.update({viewport:l.clone({dontFlip:!0})});return}const[t,c,V]=await Promise.all([this.pdfPage.getAnnotations({intent:U}),this._hasJSActionsPromise,this._fieldObjectsPromise]);if(this._cancelled)return;const Q=this.div=document.createElement("div");if(Q.className="annotationLayer",(Z=W(this,xa))==null||Z.call(this,Q),t.length===0){this.hide();return}this.annotationLayer=new _T({div:Q,accessibilityManager:this._accessibilityManager,annotationCanvasMap:this._annotationCanvasMap,annotationEditorUIManager:this._annotationEditorUIManager,page:this.pdfPage,viewport:l.clone({dontFlip:!0})}),await this.annotationLayer.render({annotations:t,imageResourcesPath:this.imageResourcesPath,renderForms:this.renderForms,linkService:this.linkService,downloadManager:this.downloadManager,annotationStorage:this.annotationStorage,enableScripting:this.enableScripting,hasJSActions:c,fieldObjects:V}),this.linkService.isInPresentationMode&&b(this,ra,qN).call(this,n0.FULLSCREEN),W(this,FF)||(m(this,FF,new AbortController),(F=this._eventBus)==null||F._on("presentationmodechanged",a=>{b(this,ra,qN).call(this,a.state)},{signal:W(this,FF).signal}))}cancel(){var l;this._cancelled=!0,(l=W(this,FF))==null||l.abort(),m(this,FF,null)}hide(){this.div&&(this.div.hidden=!0)}}xa=new WeakMap,FF=new WeakMap,ra=new WeakSet,qN=function(d){if(!this.div)return;let l=!1;switch(d){case n0.FULLSCREEN:l=!0;break;case n0.NORMAL:break;default:return}for(const U of this.div.childNodes)U.hasAttribute("data-internal-link")||(U.inert=l)};function um(d,l){const U=document.createElement("a");if(!U.click)throw new Error('DownloadManager: "a.click()" is not supported.');U.href=d,U.target="_parent","download"in U&&(U.download=l),(document.body||document.documentElement).append(U),U.click(),U.remove()}var A2;class tS{constructor(){i(this,A2,new WeakMap)}downloadData(l,U,Z){const F=URL.createObjectURL(new Blob([l],{type:Z}));um(F,U)}openOrDownloadData(l,U,Z=null){const F=US(U)?"application/pdf":"";return this.downloadData(l,U,F),!1}download(l,U,Z,F){let t;if(l)t=URL.createObjectURL(new Blob([l],{type:"application/pdf"}));else{if(!qT(U,"http://example.com")){console.error(`download - not a valid URL: ${U}`);return}t=U+"#pdfjs.action=download"}um(t,Z)}}A2=new WeakMap;const om={EVENT:"event",TIMEOUT:"timeout"};async function cS({target:d,name:l,delay:U=0}){if(typeof d!="object"||!(l&&typeof l=="string")||!(Number.isInteger(U)&&U>=0))throw new Error("waitOnEventOrTimeout - invalid parameters.");const{promise:Z,resolve:F}=Promise.withResolvers(),t=new AbortController;function c(a){t.abort(),clearTimeout(Q),F(a)}const V=d instanceof _2?"_on":"addEventListener";d[V](l,c.bind(null,om.EVENT),{signal:t.signal});const Q=setTimeout(c.bind(null,om.TIMEOUT),U);return Z}var Pc;class _2{constructor(){i(this,Pc,Object.create(null))}on(l,U,Z=null){this._on(l,U,{external:!0,once:Z==null?void 0:Z.once,signal:Z==null?void 0:Z.signal})}off(l,U,Z=null){this._off(l,U)}dispatch(l,U){const Z=W(this,Pc)[l];if(!Z||Z.length===0)return;let F;for(const{listener:t,external:c,once:V}of Z.slice(0)){if(V&&this._off(l,t),c){(F||(F=[])).push(t);continue}t(U)}if(F){for(const t of F)t(U);F=null}}_on(l,U,Z=null){var F;let t=null;if((Z==null?void 0:Z.signal)instanceof AbortSignal){const{signal:c}=Z;if(c.aborted){console.error("Cannot use an `aborted` signal.");return}const V=()=>this._off(l,U);t=()=>c.removeEventListener("abort",V),c.addEventListener("abort",V)}((F=W(this,Pc))[l]||(F[l]=[])).push({listener:U,external:(Z==null?void 0:Z.external)===!0,once:(Z==null?void 0:Z.once)===!0,rmAbort:t})}_off(l,U,Z=null){var F;const t=W(this,Pc)[l];if(t)for(let c=0,V=t.length;c<V;c++){const Q=t[c];if(Q.listener===U){(F=Q.rmAbort)==null||F.call(Q),t.splice(c,1);return}}}}Pc=new WeakMap;class Ss{constructor(l){this.value=l}valueOf(){return this.value}}class bl extends Ss{constructor(l="???"){super(l)}toString(l){return`{${this.value}}`}}class Ed extends Ss{constructor(l,U={}){super(l),this.opts=U}toString(l){try{return l.memoizeIntlObject(Intl.NumberFormat,this.opts).format(this.value)}catch(U){return l.reportError(U),this.value.toString(10)}}}class BW extends Ss{constructor(l,U={}){super(l),this.opts=U}toString(l){try{return l.memoizeIntlObject(Intl.DateTimeFormat,this.opts).format(this.value)}catch(U){return l.reportError(U),new Date(this.value).toISOString()}}}const ym=100,WS="",VS="";function QS(d,l,U){if(U===l||U instanceof Ed&&l instanceof Ed&&U.value===l.value)return!0;if(l instanceof Ed&&typeof U=="string"){let Z=d.memoizeIntlObject(Intl.PluralRules,l.opts).select(l.value);if(U===Z)return!0}return!1}function km(d,l,U){return l[U]?m0(d,l[U].value):(d.reportError(new RangeError("No default")),new bl)}function $N(d,l){const U=[],Z=Object.create(null);for(const F of l)F.type==="narg"?Z[F.name]=OW(d,F.value):U.push(OW(d,F));return{positional:U,named:Z}}function OW(d,l){switch(l.type){case"str":return l.value;case"num":return new Ed(l.value,{minimumFractionDigits:l.precision});case"var":return aS(d,l);case"mesg":return nS(d,l);case"term":return sS(d,l);case"func":return iS(d,l);case"select":return RS(d,l);default:return new bl}}function aS(d,{name:l}){let U;if(d.params)if(Object.prototype.hasOwnProperty.call(d.params,l))U=d.params[l];else return new bl(`$${l}`);else if(d.args&&Object.prototype.hasOwnProperty.call(d.args,l))U=d.args[l];else return d.reportError(new ReferenceError(`Unknown variable: $${l}`)),new bl(`$${l}`);if(U instanceof Ss)return U;switch(typeof U){case"string":return U;case"number":return new Ed(U);case"object":if(U instanceof Date)return new BW(U.getTime());default:return d.reportError(new TypeError(`Variable type not supported: $${l}, ${typeof U}`)),new bl(`$${l}`)}}function nS(d,{name:l,attr:U}){const Z=d.bundle._messages.get(l);if(!Z)return d.reportError(new ReferenceError(`Unknown message: ${l}`)),new bl(l);if(U){const F=Z.attributes[U];return F?m0(d,F):(d.reportError(new ReferenceError(`Unknown attribute: ${U}`)),new bl(`${l}.${U}`))}return Z.value?m0(d,Z.value):(d.reportError(new ReferenceError(`No value: ${l}`)),new bl(l))}function sS(d,{name:l,attr:U,args:Z}){const F=`-${l}`,t=d.bundle._terms.get(F);if(!t)return d.reportError(new ReferenceError(`Unknown term: ${F}`)),new bl(F);if(U){const V=t.attributes[U];if(V){d.params=$N(d,Z).named;const Q=m0(d,V);return d.params=null,Q}return d.reportError(new ReferenceError(`Unknown attribute: ${U}`)),new bl(`${F}.${U}`)}d.params=$N(d,Z).named;const c=m0(d,t.value);return d.params=null,c}function iS(d,{name:l,args:U}){let Z=d.bundle._functions[l];if(!Z)return d.reportError(new ReferenceError(`Unknown function: ${l}()`)),new bl(`${l}()`);if(typeof Z!="function")return d.reportError(new TypeError(`Function ${l}() is not callable`)),new bl(`${l}()`);try{let F=$N(d,U);return Z(F.positional,F.named)}catch(F){return d.reportError(F),new bl(`${l}()`)}}function RS(d,{selector:l,variants:U,star:Z}){let F=OW(d,l);if(F instanceof bl)return km(d,U,Z);for(const t of U){const c=OW(d,t.key);if(QS(d,F,c))return m0(d,t.value)}return km(d,U,Z)}function q2(d,l){if(d.dirty.has(l))return d.reportError(new RangeError("Cyclic reference")),new bl;d.dirty.add(l);const U=[],Z=d.bundle._useIsolating&&l.length>1;for(const F of l){if(typeof F=="string"){U.push(d.bundle._transform(F));continue}if(d.placeables++,d.placeables>ym)throw d.dirty.delete(l),new RangeError(`Too many placeables expanded: ${d.placeables}, max allowed is ${ym}`);Z&&U.push(WS),U.push(OW(d,F).toString(d)),Z&&U.push(VS)}return d.dirty.delete(l),U.join("")}function m0(d,l){return typeof l=="string"?d.bundle._transform(l):q2(d,l)}class NS{constructor(l,U,Z){this.dirty=new WeakSet,this.params=null,this.placeables=0,this.bundle=l,this.errors=U,this.args=Z}reportError(l){if(!this.errors||!(l instanceof Error))throw l;this.errors.push(l)}memoizeIntlObject(l,U){let Z=this.bundle._intls.get(l);Z||(Z={},this.bundle._intls.set(l,Z));let F=JSON.stringify(U);return Z[F]||(Z[F]=new l(this.bundle.locales,U)),Z[F]}}function Fs(d,l){const U=Object.create(null);for(const[Z,F]of Object.entries(d))l.includes(Z)&&(U[Z]=F.valueOf());return U}const Lm=["unitDisplay","currencyDisplay","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits"];function hS(d,l){let U=d[0];if(U instanceof bl)return new bl(`NUMBER(${U.valueOf()})`);if(U instanceof Ed)return new Ed(U.valueOf(),{...U.opts,...Fs(l,Lm)});if(U instanceof BW)return new Ed(U.valueOf(),{...Fs(l,Lm)});throw new TypeError("Invalid argument to NUMBER")}const zm=["dateStyle","timeStyle","fractionalSecondDigits","dayPeriod","hour12","weekday","era","year","month","day","hour","minute","second","timeZoneName"];function bS(d,l){let U=d[0];if(U instanceof bl)return new bl(`DATETIME(${U.valueOf()})`);if(U instanceof BW)return new BW(U.valueOf(),{...U.opts,...Fs(l,zm)});if(U instanceof Ed)return new BW(U.valueOf(),{...Fs(l,zm)});throw new TypeError("Invalid argument to DATETIME")}const Dm=new Map;function mS(d){const l=Array.isArray(d)?d.join(" "):d;let U=Dm.get(l);return U===void 0&&(U=new Map,Dm.set(l,U)),U}class eS{constructor(l,{functions:U,useIsolating:Z=!0,transform:F=t=>t}={}){this._terms=new Map,this._messages=new Map,this.locales=Array.isArray(l)?l:[l],this._functions={NUMBER:hS,DATETIME:bS,...U},this._useIsolating=Z,this._transform=F,this._intls=mS(l)}hasMessage(l){return this._messages.has(l)}getMessage(l){return this._messages.get(l)}addResource(l,{allowOverrides:U=!1}={}){const Z=[];for(let F=0;F<l.body.length;F++){let t=l.body[F];if(t.id.startsWith("-")){if(U===!1&&this._terms.has(t.id)){Z.push(new Error(`Attempt to override an existing term: "${t.id}"`));continue}this._terms.set(t.id,t)}else{if(U===!1&&this._messages.has(t.id)){Z.push(new Error(`Attempt to override an existing message: "${t.id}"`));continue}this._messages.set(t.id,t)}}return Z}formatPattern(l,U=null,Z=null){if(typeof l=="string")return this._transform(l);let F=new NS(this,Z,U);try{return q2(F,l).toString(F)}catch(t){if(F.errors&&t instanceof Error)return F.errors.push(t),new bl().toString(F);throw t}}}const xi=/^(-?[a-zA-Z][\w-]*) *= */gm,Im=/\.([a-zA-Z][\w-]*) *= */y,MS=/\*?\[/y,ri=/(-?[0-9]+(?:\.([0-9]+))?)/y,JS=/([a-zA-Z][\w-]*)/y,Em=/([$-])?([a-zA-Z][\w-]*)(?:\.([a-zA-Z][\w-]*))?/y,GS=/^[A-Z][A-Z0-9_-]*$/,RQ=/([^{}\n\r]+)/y,TS=/([^\\"\n\r]*)/y,wm=/\\([\\"])/y,Cm=/\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{6})/y,SS=/^\n+/,xm=/ +$/,XS=/ *\r?\n/g,YS=/( *)$/,pS=/{\s*/y,rm=/\s*}/y,BS=/\[\s*/y,uS=/\s*] */y,oS=/\s*\(\s*/y,yS=/\s*->\s*/y,kS=/\s*:\s*/y,LS=/\s*,?\s*/y,zS=/\s+/y;class DS{constructor(l){this.body=[],xi.lastIndex=0;let U=0;for(;;){let Y=xi.exec(l);if(Y===null)break;U=xi.lastIndex;try{this.body.push(Q(Y[1]))}catch(o){if(o instanceof SyntaxError)continue;throw o}}function Z(Y){return Y.lastIndex=U,Y.test(l)}function F(Y,o){if(l[U]===Y)return U++,!0;if(o)throw new o(`Expected ${Y}`);return!1}function t(Y,o){if(Z(Y))return U=Y.lastIndex,!0;if(o)throw new o(`Expected ${Y.toString()}`);return!1}function c(Y){Y.lastIndex=U;let o=Y.exec(l);if(o===null)throw new SyntaxError(`Expected ${Y.toString()}`);return U=Y.lastIndex,o}function V(Y){return c(Y)[1]}function Q(Y){let o=n(),y=a();if(o===null&&Object.keys(y).length===0)throw new SyntaxError("Expected message value or attributes");return{id:Y,value:o,attributes:y}}function a(){let Y=Object.create(null);for(;Z(Im);){let o=V(Im),y=n();if(y===null)throw new SyntaxError("Expected attribute value");Y[o]=y}return Y}function n(){let Y;if(Z(RQ)&&(Y=V(RQ)),l[U]==="{"||l[U]==="}")return s(Y?[Y]:[],1/0);let o=X();return o?Y?s([Y,o],o.length):(o.value=B(o.value,SS),s([o],o.length)):Y?B(Y,xm):null}function s(Y=[],o){for(;;){if(Z(RQ)){Y.push(V(RQ));continue}if(l[U]==="{"){Y.push(R());continue}if(l[U]==="}")throw new SyntaxError("Unbalanced closing brace");let j=X();if(j){Y.push(j),o=Math.min(o,j.length);continue}break}let y=Y.length-1,D=Y[y];typeof D=="string"&&(Y[y]=B(D,xm));let I=[];for(let j of Y)j instanceof jm&&(j=j.value.slice(0,j.value.length-o)),j&&I.push(j);return I}function R(){t(pS,SyntaxError);let Y=N();if(t(rm))return Y;if(t(yS)){let o=M();return t(rm,SyntaxError),{type:"select",selector:Y,...o}}throw new SyntaxError("Unclosed placeable")}function N(){if(l[U]==="{")return R();if(Z(Em)){let[,Y,o,y=null]=c(Em);if(Y==="$")return{type:"var",name:o};if(t(oS)){let D=h();if(Y==="-")return{type:"term",name:o,attr:y,args:D};if(GS.test(o))return{type:"func",name:o,args:D};throw new SyntaxError("Function names must be all upper-case")}return Y==="-"?{type:"term",name:o,attr:y,args:[]}:{type:"mesg",name:o,attr:y}}return G()}function h(){let Y=[];for(;;){switch(l[U]){case")":return U++,Y;case void 0:throw new SyntaxError("Unclosed argument list")}Y.push(e()),t(LS)}}function e(){let Y=N();return Y.type!=="mesg"?Y:t(kS)?{type:"narg",name:Y.name,value:G()}:Y}function M(){let Y=[],o=0,y;for(;Z(MS);){F("*")&&(y=o);let D=J(),I=n();if(I===null)throw new SyntaxError("Expected variant value");Y[o++]={key:D,value:I}}if(o===0)return null;if(y===void 0)throw new SyntaxError("Expected default variant");return{variants:Y,star:y}}function J(){t(BS,SyntaxError);let Y;return Z(ri)?Y=T():Y={type:"str",value:V(JS)},t(uS,SyntaxError),Y}function G(){if(Z(ri))return T();if(l[U]==='"')return p();throw new SyntaxError("Invalid expression")}function T(){let[,Y,o=""]=c(ri),y=o.length;return{type:"num",value:parseFloat(Y),precision:y}}function p(){F('"',SyntaxError);let Y="";for(;;){if(Y+=V(TS),l[U]==="\\"){Y+=S();continue}if(F('"'))return{type:"str",value:Y};throw new SyntaxError("Unclosed string literal")}}function S(){if(Z(wm))return V(wm);if(Z(Cm)){let[,Y,o]=c(Cm),y=parseInt(Y||o,16);return y<=55295||57344<=y?String.fromCodePoint(y):"�"}throw new SyntaxError("Unknown escape sequence")}function X(){let Y=U;switch(t(zS),l[U]){case".":case"[":case"*":case"}":case void 0:return!1;case"{":return k(l.slice(Y,U))}return l[U-1]===" "?k(l.slice(Y,U)):!1}function B(Y,o){return Y.replace(o,"")}function k(Y){let o=Y.replace(XS,`
|
|
29
|
+
`);[this._pageContents[U],this._pageDiffs[U],this._hasDiacritics[U]]=ki(V.join("")),t()},c=>{console.error(`Unable to get text content for page ${U+1}`,c),this._pageContents[U]="",this._pageDiffs[U]=null,this._hasDiacritics[U]=!1,t()}))}},vc=new WeakSet,nQ=function(d){this._scrollMatches&&this._selected.pageIdx===d&&(this._linkService.page=d+1),this._eventBus.dispatch("updatetextlayermatches",{source:this,pageIndex:d})},St=new WeakSet,lc=function(){this._eventBus.dispatch("updatetextlayermatches",{source:this,pageIndex:-1})},dF=new WeakSet,PF=function(){const d=W(this,Dl).findPrevious,l=this._linkService.page-1,U=this._linkService.pagesCount;if(this._highlightMatches=!0,this._dirtyMatch){this._dirtyMatch=!1,this._selected.pageIdx=this._selected.matchIdx=-1,this._offset.pageIdx=l,this._offset.matchIdx=null,this._offset.wrapped=!1,this._resumePageIdx=null,this._pageMatches.length=0,this._pageMatchesLength.length=0,m(this,Tt,0),this._matchesCountTotal=0,b(this,St,lc).call(this);for(let F=0;F<U;F++)this._pendingFindMatches.has(F)||(this._pendingFindMatches.add(F),this._extractTextPromises[F].then(()=>{this._pendingFindMatches.delete(F),b(this,HN,Sm).call(this,F)}))}if(W(this,za,Li).length===0){b(this,Xt,Uc).call(this,UZ.FOUND);return}if(this._resumePageIdx)return;const Z=this._offset;if(this._pagesToSearch=U,Z.matchIdx!==null){const F=this._pageMatches[Z.pageIdx].length;if(!d&&Z.matchIdx+1<F||d&&Z.matchIdx>0){Z.matchIdx=d?Z.matchIdx-1:Z.matchIdx+1,b(this,Hc,sQ).call(this,!0);return}b(this,Ea,Ii).call(this,d)}b(this,Ia,Di).call(this)},fN=new WeakSet,Ym=function(d){const l=this._offset,U=d.length,Z=W(this,Dl).findPrevious;return U?(l.matchIdx=Z?U-1:0,b(this,Hc,sQ).call(this,!0),!0):(b(this,Ea,Ii).call(this,Z),l.wrapped&&(l.matchIdx=null,this._pagesToSearch<0)?(b(this,Hc,sQ).call(this,!1),!0):!1)},Ia=new WeakSet,Di=function(){this._resumePageIdx!==null&&console.error("There can only be one pending page.");let d=null;do{const l=this._offset.pageIdx;if(d=this._pageMatches[l],!d){this._resumePageIdx=l;break}}while(!b(this,fN,Ym).call(this,d))},Ea=new WeakSet,Ii=function(d){const l=this._offset,U=this._linkService.pagesCount;l.pageIdx=d?l.pageIdx-1:l.pageIdx+1,l.matchIdx=null,this._pagesToSearch--,(l.pageIdx>=U||l.pageIdx<0)&&(l.pageIdx=d?U-1:0,l.wrapped=!0)},Hc=new WeakSet,sQ=function(d=!1){let l=UZ.NOT_FOUND;const U=this._offset.wrapped;if(this._offset.wrapped=!1,d){const Z=this._selected.pageIdx;this._selected.pageIdx=this._offset.pageIdx,this._selected.matchIdx=this._offset.matchIdx,l=U?UZ.WRAPPED:UZ.FOUND,Z!==-1&&Z!==this._selected.pageIdx&&b(this,vc,nQ).call(this,Z)}b(this,Xt,Uc).call(this,l,W(this,Dl).findPrevious),this._selected.pageIdx!==-1&&(this._scrollMatches=!0,b(this,vc,nQ).call(this,this._selected.pageIdx))},AN=new WeakSet,g2=function(d){const l=this._pdfDocument;this._firstPageCapability.promise.then(()=>{!this._pdfDocument||l&&this._pdfDocument!==l||(this._findTimeout&&(clearTimeout(this._findTimeout),this._findTimeout=null),this._resumePageIdx&&(this._resumePageIdx=null,this._dirtyMatch=!0),b(this,Xt,Uc).call(this,UZ.FOUND),this._highlightMatches=!1,b(this,St,lc).call(this))})},wa=new WeakSet,Ei=function(){var d;const{pageIdx:l,matchIdx:U}=this._selected;let Z=0,F=this._matchesCountTotal;if(U!==-1){for(let t=0;t<l;t++)Z+=((d=this._pageMatches[t])==null?void 0:d.length)||0;Z+=U+1}return(Z<1||Z>F)&&(Z=F=0),{current:Z,total:F}},Ca=new WeakSet,wi=function(){this._eventBus.dispatch("updatefindmatchescount",{source:this,matchesCount:b(this,wa,Ei).call(this)})},Xt=new WeakSet,Uc=function(d,l=!1){var U,Z;!W(this,pW)&&(W(this,Tt)!==this._linkService.pagesCount||d===UZ.PENDING)||this._eventBus.dispatch("updatefindcontrolstate",{source:this,state:d,previous:l,entireWord:((U=W(this,Dl))==null?void 0:U.entireWord)??null,matchesCount:b(this,wa,Ei).call(this),rawQuery:((Z=W(this,Dl))==null?void 0:Z.query)??null})};const HT="noopener noreferrer nofollow",ZF={NONE:0,SELF:1,BLANK:2,PARENT:3,TOP:4};var _N,K2;const v2=class H2{constructor({eventBus:l,externalLinkTarget:U=null,externalLinkRel:Z=null,ignoreDestinationZoom:F=!1}={}){H(this,"externalLinkEnabled",!0),this.eventBus=l,this.externalLinkTarget=U,this.externalLinkRel=Z,this._ignoreDestinationZoom=F,this.baseUrl=null,this.pdfDocument=null,this.pdfViewer=null,this.pdfHistory=null}setDocument(l,U=null){this.baseUrl=U,this.pdfDocument=l}setViewer(l){this.pdfViewer=l}setHistory(l){this.pdfHistory=l}get pagesCount(){return this.pdfDocument?this.pdfDocument.numPages:0}get page(){return this.pdfDocument?this.pdfViewer.currentPageNumber:1}set page(l){this.pdfDocument&&(this.pdfViewer.currentPageNumber=l)}get rotation(){return this.pdfDocument?this.pdfViewer.pagesRotation:0}set rotation(l){this.pdfDocument&&(this.pdfViewer.pagesRotation=l)}get isInPresentationMode(){return this.pdfDocument?this.pdfViewer.isInPresentationMode:!1}async goToDestination(l){if(!this.pdfDocument)return;let U,Z,F;if(typeof l=="string"?(U=l,Z=await this.pdfDocument.getDestination(l)):(U=null,Z=await l),!Array.isArray(Z)){console.error(`goToDestination: "${Z}" is not a valid destination array, for dest="${l}".`);return}const[t]=Z;if(t&&typeof t=="object"){if(F=this.pdfDocument.cachedPageNumber(t),!F)try{F=await this.pdfDocument.getPageIndex(t)+1}catch{console.error(`goToDestination: "${t}" is not a valid page reference, for dest="${l}".`);return}}else Number.isInteger(t)&&(F=t+1);if(!F||F<1||F>this.pagesCount){console.error(`goToDestination: "${F}" is not a valid page number, for dest="${l}".`);return}this.pdfHistory&&(this.pdfHistory.pushCurrentPosition(),this.pdfHistory.push({namedDest:U,explicitDest:Z,pageNumber:F})),this.pdfViewer.scrollPageIntoView({pageNumber:F,destArray:Z,ignoreDestinationZoom:this._ignoreDestinationZoom})}goToPage(l){if(!this.pdfDocument)return;const U=typeof l=="string"&&this.pdfViewer.pageLabelToPageNumber(l)||l|0;if(!(Number.isInteger(U)&&U>0&&U<=this.pagesCount)){console.error(`PDFLinkService.goToPage: "${l}" is not a valid page.`);return}this.pdfHistory&&(this.pdfHistory.pushCurrentPosition(),this.pdfHistory.pushPage(U)),this.pdfViewer.scrollPageIntoView({pageNumber:U})}addLinkAttributes(l,U,Z=!1){if(!U||typeof U!="string")throw new Error('A valid "url" parameter must provided.');const F=Z?ZF.BLANK:this.externalLinkTarget,t=this.externalLinkRel;this.externalLinkEnabled?l.href=l.title=U:(l.href="",l.title=`Disabled: ${U}`,l.onclick=()=>!1);let c="";switch(F){case ZF.NONE:break;case ZF.SELF:c="_self";break;case ZF.BLANK:c="_blank";break;case ZF.PARENT:c="_parent";break;case ZF.TOP:c="_top";break}l.target=c,l.rel=typeof t=="string"?t:HT}getDestinationHash(l){if(typeof l=="string"){if(l.length>0)return this.getAnchorUrl("#"+escape(l))}else if(Array.isArray(l)){const U=JSON.stringify(l);if(U.length>0)return this.getAnchorUrl("#"+escape(U))}return this.getAnchorUrl("")}getAnchorUrl(l){return this.baseUrl?this.baseUrl+l:l}setHash(l){var U;if(!this.pdfDocument)return;let Z,F;if(l.includes("=")){const t=Ts(l);if(t.has("search")){const c=t.get("search").replaceAll('"',""),V=t.get("phrase")==="true";this.eventBus.dispatch("findfromurlhash",{source:this,query:V?c:c.match(/\S+/g)})}if(t.has("page")&&(Z=t.get("page")|0||1),t.has("zoom")){const c=t.get("zoom").split(","),V=c[0],Q=parseFloat(V);V.includes("Fit")?V==="Fit"||V==="FitB"?F=[null,{name:V}]:V==="FitH"||V==="FitBH"||V==="FitV"||V==="FitBV"?F=[null,{name:V},c.length>1?c[1]|0:null]:V==="FitR"?c.length!==5?console.error('PDFLinkService.setHash: Not enough parameters for "FitR".'):F=[null,{name:V},c[1]|0,c[2]|0,c[3]|0,c[4]|0]:console.error(`PDFLinkService.setHash: "${V}" is not a valid zoom value.`):F=[null,{name:"XYZ"},c.length>1?c[1]|0:null,c.length>2?c[2]|0:null,Q?Q/100:V]}F?this.pdfViewer.scrollPageIntoView({pageNumber:Z||this.page,destArray:F,allowNegativeOffset:!0}):Z&&(this.page=Z),t.has("pagemode")&&this.eventBus.dispatch("pagemode",{source:this,mode:t.get("pagemode")}),t.has("nameddest")&&this.goToDestination(t.get("nameddest"));return}F=unescape(l);try{F=JSON.parse(F),Array.isArray(F)||(F=F.toString())}catch{}if(typeof F=="string"||b(U=H2,_N,K2).call(U,F)){this.goToDestination(F);return}console.error(`PDFLinkService.setHash: "${unescape(l)}" is not a valid destination.`)}executeNamedAction(l){var U,Z;if(this.pdfDocument){switch(l){case"GoBack":(U=this.pdfHistory)==null||U.back();break;case"GoForward":(Z=this.pdfHistory)==null||Z.forward();break;case"NextPage":this.pdfViewer.nextPage();break;case"PrevPage":this.pdfViewer.previousPage();break;case"LastPage":this.page=this.pagesCount;break;case"FirstPage":this.page=1;break}this.eventBus.dispatch("namedaction",{source:this,action:l})}}async executeSetOCGState(l){if(!this.pdfDocument)return;const U=this.pdfDocument,Z=await this.pdfViewer.optionalContentConfigPromise;U===this.pdfDocument&&(Z.setOCGState(l),this.pdfViewer.optionalContentConfigPromise=Promise.resolve(Z))}};_N=new WeakSet,K2=function(d){if(!Array.isArray(d)||d.length<2)return!1;const[l,U,...Z]=d;if(!(typeof l=="object"&&Number.isInteger(l==null?void 0:l.num)&&Number.isInteger(l==null?void 0:l.gen))&&!Number.isInteger(l)||!(typeof U=="object"&&typeof(U==null?void 0:U.name)=="string"))return!1;let F=!0;switch(U.name){case"XYZ":if(Z.length!==3)return!1;break;case"Fit":case"FitB":return Z.length===0;case"FitH":case"FitBH":case"FitV":case"FitBV":if(Z.length!==1)return!1;break;case"FitR":if(Z.length!==4)return!1;F=!1;break;default:return!1}for(const t of Z)if(!(typeof t=="number"||F&&t===null))return!1;return!0},i(v2,_N);let P2=v2;class qh extends P2{setDocument(l,U=null){}}const{AbortException:PT,AnnotationEditorLayer:fT,AnnotationEditorParamsType:OX,AnnotationEditorType:GZ,AnnotationEditorUIManager:AT,AnnotationLayer:_T,AnnotationMode:Id,build:gX,CMapCompressionType:KX,ColorPicker:vX,createValidAbsoluteUrl:qT,DOMSVGFactory:HX,DrawLayer:$T,FeatureTest:PX,fetchData:pm,getDocument:fX,getFilenameFromUrl:AX,getPdfFilenameFromUrl:lS,getXfaPageViewport:_X,GlobalWorkerOptions:qX,ImageKind:$X,InvalidPDFException:lY,isDataScheme:UY,isPdfFile:US,MissingPDFException:dY,noContextMenu:ZY,normalizeUnicode:dS,OPS:FY,Outliner:tY,PasswordResponses:cY,PDFDataRangeTransport:WY,PDFDateString:VY,PDFWorker:QY,PermissionFlag:iQ,PixelsPerInch:zd,RenderingCancelledException:$h,renderTextLayer:aY,setLayerDimensions:ZS,shadow:Zs,TextLayer:FS,UnexpectedResponseException:nY,updateTextLayer:sY,Util:iY,VerbosityLevel:RY,version:Bm,XfaLayer:Ci}=globalThis.pdfjsLib;var xa,FF,ra,qN;class f2{constructor({pdfPage:l,linkService:U,downloadManager:Z,annotationStorage:F=null,imageResourcesPath:t="",renderForms:c=!0,enableScripting:V=!1,hasJSActionsPromise:Q=null,fieldObjectsPromise:a=null,annotationCanvasMap:n=null,accessibilityManager:s=null,annotationEditorUIManager:R=null,onAppend:N=null}){i(this,ra),i(this,xa,null),i(this,FF,null),this.pdfPage=l,this.linkService=U,this.downloadManager=Z,this.imageResourcesPath=t,this.renderForms=c,this.annotationStorage=F,this.enableScripting=V,this._hasJSActionsPromise=Q||Promise.resolve(!1),this._fieldObjectsPromise=a||Promise.resolve(null),this._annotationCanvasMap=n,this._accessibilityManager=s,this._annotationEditorUIManager=R,m(this,xa,N),this.annotationLayer=null,this.div=null,this._cancelled=!1,this._eventBus=U.eventBus}async render(l,U="display"){var Z,F;if(this.div){if(this._cancelled||!this.annotationLayer)return;this.annotationLayer.update({viewport:l.clone({dontFlip:!0})});return}const[t,c,V]=await Promise.all([this.pdfPage.getAnnotations({intent:U}),this._hasJSActionsPromise,this._fieldObjectsPromise]);if(this._cancelled)return;const Q=this.div=document.createElement("div");if(Q.className="annotationLayer",(Z=W(this,xa))==null||Z.call(this,Q),t.length===0){this.hide();return}this.annotationLayer=new _T({div:Q,accessibilityManager:this._accessibilityManager,annotationCanvasMap:this._annotationCanvasMap,annotationEditorUIManager:this._annotationEditorUIManager,page:this.pdfPage,viewport:l.clone({dontFlip:!0})}),await this.annotationLayer.render({annotations:t,imageResourcesPath:this.imageResourcesPath,renderForms:this.renderForms,linkService:this.linkService,downloadManager:this.downloadManager,annotationStorage:this.annotationStorage,enableScripting:this.enableScripting,hasJSActions:c,fieldObjects:V}),this.linkService.isInPresentationMode&&b(this,ra,qN).call(this,n0.FULLSCREEN),W(this,FF)||(m(this,FF,new AbortController),(F=this._eventBus)==null||F._on("presentationmodechanged",a=>{b(this,ra,qN).call(this,a.state)},{signal:W(this,FF).signal}))}cancel(){var l;this._cancelled=!0,(l=W(this,FF))==null||l.abort(),m(this,FF,null)}hide(){this.div&&(this.div.hidden=!0)}}xa=new WeakMap,FF=new WeakMap,ra=new WeakSet,qN=function(d){if(!this.div)return;let l=!1;switch(d){case n0.FULLSCREEN:l=!0;break;case n0.NORMAL:break;default:return}for(const U of this.div.childNodes)U.hasAttribute("data-internal-link")||(U.inert=l)};function um(d,l){const U=document.createElement("a");if(!U.click)throw new Error('DownloadManager: "a.click()" is not supported.');U.href=d,U.target="_parent","download"in U&&(U.download=l),(document.body||document.documentElement).append(U),U.click(),U.remove()}var A2;class tS{constructor(){i(this,A2,new WeakMap)}downloadData(l,U,Z){const F=URL.createObjectURL(new Blob([l],{type:Z}));um(F,U)}openOrDownloadData(l,U,Z=null){const F=US(U)?"application/pdf":"";return this.downloadData(l,U,F),!1}download(l,U,Z,F){let t;if(l)t=URL.createObjectURL(new Blob([l],{type:"application/pdf"}));else{if(!qT(U,"http://example.com")){console.error(`download - not a valid URL: ${U}`);return}t=U+"#pdfjs.action=download"}um(t,Z)}}A2=new WeakMap;const om={EVENT:"event",TIMEOUT:"timeout"};async function cS({target:d,name:l,delay:U=0}){if(typeof d!="object"||!(l&&typeof l=="string")||!(Number.isInteger(U)&&U>=0))throw new Error("waitOnEventOrTimeout - invalid parameters.");const{promise:Z,resolve:F}=Promise.withResolvers(),t=new AbortController;function c(a){t.abort(),clearTimeout(Q),F(a)}const V=d instanceof _2?"_on":"addEventListener";d[V](l,c.bind(null,om.EVENT),{signal:t.signal});const Q=setTimeout(c.bind(null,om.TIMEOUT),U);return Z}var Pc;class _2{constructor(){i(this,Pc,Object.create(null))}on(l,U,Z=null){this._on(l,U,{external:!0,once:Z==null?void 0:Z.once,signal:Z==null?void 0:Z.signal})}off(l,U,Z=null){this._off(l,U)}dispatch(l,U){const Z=W(this,Pc)[l];if(!Z||Z.length===0)return;let F;for(const{listener:t,external:c,once:V}of Z.slice(0)){if(V&&this._off(l,t),c){(F||(F=[])).push(t);continue}t(U)}if(F){for(const t of F)t(U);F=null}}_on(l,U,Z=null){var F;let t=null;if((Z==null?void 0:Z.signal)instanceof AbortSignal){const{signal:c}=Z;if(c.aborted){console.error("Cannot use an `aborted` signal.");return}const V=()=>this._off(l,U);t=()=>c.removeEventListener("abort",V),c.addEventListener("abort",V)}((F=W(this,Pc))[l]||(F[l]=[])).push({listener:U,external:(Z==null?void 0:Z.external)===!0,once:(Z==null?void 0:Z.once)===!0,rmAbort:t})}_off(l,U,Z=null){var F;const t=W(this,Pc)[l];if(t)for(let c=0,V=t.length;c<V;c++){const Q=t[c];if(Q.listener===U){(F=Q.rmAbort)==null||F.call(Q),t.splice(c,1);return}}}}Pc=new WeakMap;class Ss{constructor(l){this.value=l}valueOf(){return this.value}}class bl extends Ss{constructor(l="???"){super(l)}toString(l){return`{${this.value}}`}}class Ed extends Ss{constructor(l,U={}){super(l),this.opts=U}toString(l){try{return l.memoizeIntlObject(Intl.NumberFormat,this.opts).format(this.value)}catch(U){return l.reportError(U),this.value.toString(10)}}}class BW extends Ss{constructor(l,U={}){super(l),this.opts=U}toString(l){try{return l.memoizeIntlObject(Intl.DateTimeFormat,this.opts).format(this.value)}catch(U){return l.reportError(U),new Date(this.value).toISOString()}}}const ym=100,WS="",VS="";function QS(d,l,U){if(U===l||U instanceof Ed&&l instanceof Ed&&U.value===l.value)return!0;if(l instanceof Ed&&typeof U=="string"){let Z=d.memoizeIntlObject(Intl.PluralRules,l.opts).select(l.value);if(U===Z)return!0}return!1}function km(d,l,U){return l[U]?m0(d,l[U].value):(d.reportError(new RangeError("No default")),new bl)}function $N(d,l){const U=[],Z=Object.create(null);for(const F of l)F.type==="narg"?Z[F.name]=OW(d,F.value):U.push(OW(d,F));return{positional:U,named:Z}}function OW(d,l){switch(l.type){case"str":return l.value;case"num":return new Ed(l.value,{minimumFractionDigits:l.precision});case"var":return aS(d,l);case"mesg":return nS(d,l);case"term":return sS(d,l);case"func":return iS(d,l);case"select":return RS(d,l);default:return new bl}}function aS(d,{name:l}){let U;if(d.params)if(Object.prototype.hasOwnProperty.call(d.params,l))U=d.params[l];else return new bl(`$${l}`);else if(d.args&&Object.prototype.hasOwnProperty.call(d.args,l))U=d.args[l];else return d.reportError(new ReferenceError(`Unknown variable: $${l}`)),new bl(`$${l}`);if(U instanceof Ss)return U;switch(typeof U){case"string":return U;case"number":return new Ed(U);case"object":if(U instanceof Date)return new BW(U.getTime());default:return d.reportError(new TypeError(`Variable type not supported: $${l}, ${typeof U}`)),new bl(`$${l}`)}}function nS(d,{name:l,attr:U}){const Z=d.bundle._messages.get(l);if(!Z)return d.reportError(new ReferenceError(`Unknown message: ${l}`)),new bl(l);if(U){const F=Z.attributes[U];return F?m0(d,F):(d.reportError(new ReferenceError(`Unknown attribute: ${U}`)),new bl(`${l}.${U}`))}return Z.value?m0(d,Z.value):(d.reportError(new ReferenceError(`No value: ${l}`)),new bl(l))}function sS(d,{name:l,attr:U,args:Z}){const F=`-${l}`,t=d.bundle._terms.get(F);if(!t)return d.reportError(new ReferenceError(`Unknown term: ${F}`)),new bl(F);if(U){const V=t.attributes[U];if(V){d.params=$N(d,Z).named;const Q=m0(d,V);return d.params=null,Q}return d.reportError(new ReferenceError(`Unknown attribute: ${U}`)),new bl(`${F}.${U}`)}d.params=$N(d,Z).named;const c=m0(d,t.value);return d.params=null,c}function iS(d,{name:l,args:U}){let Z=d.bundle._functions[l];if(!Z)return d.reportError(new ReferenceError(`Unknown function: ${l}()`)),new bl(`${l}()`);if(typeof Z!="function")return d.reportError(new TypeError(`Function ${l}() is not callable`)),new bl(`${l}()`);try{let F=$N(d,U);return Z(F.positional,F.named)}catch(F){return d.reportError(F),new bl(`${l}()`)}}function RS(d,{selector:l,variants:U,star:Z}){let F=OW(d,l);if(F instanceof bl)return km(d,U,Z);for(const t of U){const c=OW(d,t.key);if(QS(d,F,c))return m0(d,t.value)}return km(d,U,Z)}function q2(d,l){if(d.dirty.has(l))return d.reportError(new RangeError("Cyclic reference")),new bl;d.dirty.add(l);const U=[],Z=d.bundle._useIsolating&&l.length>1;for(const F of l){if(typeof F=="string"){U.push(d.bundle._transform(F));continue}if(d.placeables++,d.placeables>ym)throw d.dirty.delete(l),new RangeError(`Too many placeables expanded: ${d.placeables}, max allowed is ${ym}`);Z&&U.push(WS),U.push(OW(d,F).toString(d)),Z&&U.push(VS)}return d.dirty.delete(l),U.join("")}function m0(d,l){return typeof l=="string"?d.bundle._transform(l):q2(d,l)}class NS{constructor(l,U,Z){this.dirty=new WeakSet,this.params=null,this.placeables=0,this.bundle=l,this.errors=U,this.args=Z}reportError(l){if(!this.errors||!(l instanceof Error))throw l;this.errors.push(l)}memoizeIntlObject(l,U){let Z=this.bundle._intls.get(l);Z||(Z={},this.bundle._intls.set(l,Z));let F=JSON.stringify(U);return Z[F]||(Z[F]=new l(this.bundle.locales,U)),Z[F]}}function Fs(d,l){const U=Object.create(null);for(const[Z,F]of Object.entries(d))l.includes(Z)&&(U[Z]=F.valueOf());return U}const Lm=["unitDisplay","currencyDisplay","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits"];function hS(d,l){let U=d[0];if(U instanceof bl)return new bl(`NUMBER(${U.valueOf()})`);if(U instanceof Ed)return new Ed(U.valueOf(),{...U.opts,...Fs(l,Lm)});if(U instanceof BW)return new Ed(U.valueOf(),{...Fs(l,Lm)});throw new TypeError("Invalid argument to NUMBER")}const zm=["dateStyle","timeStyle","fractionalSecondDigits","dayPeriod","hour12","weekday","era","year","month","day","hour","minute","second","timeZoneName"];function bS(d,l){let U=d[0];if(U instanceof bl)return new bl(`DATETIME(${U.valueOf()})`);if(U instanceof BW)return new BW(U.valueOf(),{...U.opts,...Fs(l,zm)});if(U instanceof Ed)return new BW(U.valueOf(),{...Fs(l,zm)});throw new TypeError("Invalid argument to DATETIME")}const Dm=new Map;function mS(d){const l=Array.isArray(d)?d.join(" "):d;let U=Dm.get(l);return U===void 0&&(U=new Map,Dm.set(l,U)),U}class eS{constructor(l,{functions:U,useIsolating:Z=!0,transform:F=t=>t}={}){this._terms=new Map,this._messages=new Map,this.locales=Array.isArray(l)?l:[l],this._functions={NUMBER:hS,DATETIME:bS,...U},this._useIsolating=Z,this._transform=F,this._intls=mS(l)}hasMessage(l){return this._messages.has(l)}getMessage(l){return this._messages.get(l)}addResource(l,{allowOverrides:U=!1}={}){const Z=[];for(let F=0;F<l.body.length;F++){let t=l.body[F];if(t.id.startsWith("-")){if(U===!1&&this._terms.has(t.id)){Z.push(new Error(`Attempt to override an existing term: "${t.id}"`));continue}this._terms.set(t.id,t)}else{if(U===!1&&this._messages.has(t.id)){Z.push(new Error(`Attempt to override an existing message: "${t.id}"`));continue}this._messages.set(t.id,t)}}return Z}formatPattern(l,U=null,Z=null){if(typeof l=="string")return this._transform(l);let F=new NS(this,Z,U);try{return q2(F,l).toString(F)}catch(t){if(F.errors&&t instanceof Error)return F.errors.push(t),new bl().toString(F);throw t}}}const xi=/^(-?[a-zA-Z][\w-]*) *= */gm,Im=/\.([a-zA-Z][\w-]*) *= */y,MS=/\*?\[/y,ri=/(-?[0-9]+(?:\.([0-9]+))?)/y,JS=/([a-zA-Z][\w-]*)/y,Em=/([$-])?([a-zA-Z][\w-]*)(?:\.([a-zA-Z][\w-]*))?/y,GS=/^[A-Z][A-Z0-9_-]*$/,RQ=/([^{}\n\r]+)/y,TS=/([^\\"\n\r]*)/y,wm=/\\([\\"])/y,Cm=/\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{6})/y,SS=/^\n+/,xm=/ +$/,XS=/ *\r?\n/g,YS=/( *)$/,pS=/{\s*/y,rm=/\s*}/y,BS=/\[\s*/y,uS=/\s*] */y,oS=/\s*\(\s*/y,yS=/\s*->\s*/y,kS=/\s*:\s*/y,LS=/\s*,?\s*/y,zS=/\s+/y;class DS{constructor(l){this.body=[],xi.lastIndex=0;let U=0;for(;;){let Y=xi.exec(l);if(Y===null)break;U=xi.lastIndex;try{this.body.push(Q(Y[1]))}catch(o){if(o instanceof SyntaxError)continue;throw o}}function Z(Y){return Y.lastIndex=U,Y.test(l)}function F(Y,o){if(l[U]===Y)return U++,!0;if(o)throw new o(`Expected ${Y}`);return!1}function t(Y,o){if(Z(Y))return U=Y.lastIndex,!0;if(o)throw new o(`Expected ${Y.toString()}`);return!1}function c(Y){Y.lastIndex=U;let o=Y.exec(l);if(o===null)throw new SyntaxError(`Expected ${Y.toString()}`);return U=Y.lastIndex,o}function V(Y){return c(Y)[1]}function Q(Y){let o=n(),y=a();if(o===null&&Object.keys(y).length===0)throw new SyntaxError("Expected message value or attributes");return{id:Y,value:o,attributes:y}}function a(){let Y=Object.create(null);for(;Z(Im);){let o=V(Im),y=n();if(y===null)throw new SyntaxError("Expected attribute value");Y[o]=y}return Y}function n(){let Y;if(Z(RQ)&&(Y=V(RQ)),l[U]==="{"||l[U]==="}")return s(Y?[Y]:[],1/0);let o=X();return o?Y?s([Y,o],o.length):(o.value=B(o.value,SS),s([o],o.length)):Y?B(Y,xm):null}function s(Y=[],o){for(;;){if(Z(RQ)){Y.push(V(RQ));continue}if(l[U]==="{"){Y.push(R());continue}if(l[U]==="}")throw new SyntaxError("Unbalanced closing brace");let j=X();if(j){Y.push(j),o=Math.min(o,j.length);continue}break}let y=Y.length-1,D=Y[y];typeof D=="string"&&(Y[y]=B(D,xm));let I=[];for(let j of Y)j instanceof jm&&(j=j.value.slice(0,j.value.length-o)),j&&I.push(j);return I}function R(){t(pS,SyntaxError);let Y=N();if(t(rm))return Y;if(t(yS)){let o=M();return t(rm,SyntaxError),{type:"select",selector:Y,...o}}throw new SyntaxError("Unclosed placeable")}function N(){if(l[U]==="{")return R();if(Z(Em)){let[,Y,o,y=null]=c(Em);if(Y==="$")return{type:"var",name:o};if(t(oS)){let D=h();if(Y==="-")return{type:"term",name:o,attr:y,args:D};if(GS.test(o))return{type:"func",name:o,args:D};throw new SyntaxError("Function names must be all upper-case")}return Y==="-"?{type:"term",name:o,attr:y,args:[]}:{type:"mesg",name:o,attr:y}}return G()}function h(){let Y=[];for(;;){switch(l[U]){case")":return U++,Y;case void 0:throw new SyntaxError("Unclosed argument list")}Y.push(e()),t(LS)}}function e(){let Y=N();return Y.type!=="mesg"?Y:t(kS)?{type:"narg",name:Y.name,value:G()}:Y}function M(){let Y=[],o=0,y;for(;Z(MS);){F("*")&&(y=o);let D=J(),I=n();if(I===null)throw new SyntaxError("Expected variant value");Y[o++]={key:D,value:I}}if(o===0)return null;if(y===void 0)throw new SyntaxError("Expected default variant");return{variants:Y,star:y}}function J(){t(BS,SyntaxError);let Y;return Z(ri)?Y=T():Y={type:"str",value:V(JS)},t(uS,SyntaxError),Y}function G(){if(Z(ri))return T();if(l[U]==='"')return p();throw new SyntaxError("Invalid expression")}function T(){let[,Y,o=""]=c(ri),y=o.length;return{type:"num",value:parseFloat(Y),precision:y}}function p(){F('"',SyntaxError);let Y="";for(;;){if(Y+=V(TS),l[U]==="\\"){Y+=S();continue}if(F('"'))return{type:"str",value:Y};throw new SyntaxError("Unclosed string literal")}}function S(){if(Z(wm))return V(wm);if(Z(Cm)){let[,Y,o]=c(Cm),y=parseInt(Y||o,16);return y<=55295||57344<=y?String.fromCodePoint(y):"�"}throw new SyntaxError("Unknown escape sequence")}function X(){let Y=U;switch(t(zS),l[U]){case".":case"[":case"*":case"}":case void 0:return!1;case"{":return k(l.slice(Y,U))}return l[U-1]===" "?k(l.slice(Y,U)):!1}function B(Y,o){return Y.replace(o,"")}function k(Y){let o=Y.replace(XS,`
|
|
30
30
|
`),y=YS.exec(Y)[1].length;return new jm(o,y)}}}class jm{constructor(l,U){this.value=l,this.length=U}}const IS=/<|&#?\w+;/,ES={"http://www.w3.org/1999/xhtml":["em","strong","small","s","cite","q","dfn","abbr","data","time","code","var","samp","kbd","sub","sup","i","b","u","mark","bdi","bdo","span","br","wbr"]},wS={"http://www.w3.org/1999/xhtml":{global:["title","aria-label","aria-valuetext"],a:["download"],area:["download","alt"],input:["alt","placeholder"],menuitem:["label"],menu:["label"],optgroup:["label"],option:["label"],track:["label"],img:["alt"],textarea:["placeholder"],th:["abbr"]},"http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul":{global:["accesskey","aria-label","aria-valuetext","label","title","tooltiptext"],description:["value"],key:["key","keycode"],label:["value"],textbox:["placeholder","value"]}};function CS(d,l){const{value:U}=l;if(typeof U=="string")if(d.localName==="title"&&d.namespaceURI==="http://www.w3.org/1999/xhtml")d.textContent=U;else if(!IS.test(U))d.textContent=U;else{const Z=d.ownerDocument.createElementNS("http://www.w3.org/1999/xhtml","template");Z.innerHTML=U,xS(Z.content,d)}$2(l,d)}function xS(d,l){for(const U of d.childNodes)if(U.nodeType!==U.TEXT_NODE){if(U.hasAttribute("data-l10n-name")){const Z=jS(l,U);d.replaceChild(Z,U);continue}if(gS(U)){const Z=OS(U);d.replaceChild(Z,U);continue}console.warn(`An element of forbidden type "${U.localName}" was found in the translation. Only safe text-level elements and elements with data-l10n-name are allowed.`),d.replaceChild(lh(U),U)}l.textContent="",l.appendChild(d)}function rS(d,l){if(!d)return!1;for(let U of d)if(U.name===l)return!0;return!1}function $2(d,l){const U=l.hasAttribute("data-l10n-attrs")?l.getAttribute("data-l10n-attrs").split(",").map(Z=>Z.trim()):null;for(const Z of Array.from(l.attributes))Om(Z.name,l,U)&&!rS(d.attributes,Z.name)&&l.removeAttribute(Z.name);if(d.attributes)for(const Z of Array.from(d.attributes))Om(Z.name,l,U)&&l.getAttribute(Z.name)!==Z.value&&l.setAttribute(Z.name,Z.value)}function jS(d,l){const U=l.getAttribute("data-l10n-name"),Z=d.querySelector(`[data-l10n-name="${U}"]`);if(!Z)return console.warn(`An element named "${U}" wasn't found in the source.`),lh(l);if(Z.localName!==l.localName)return console.warn(`An element named "${U}" was found in the translation but its type ${l.localName} didn't match the element found in the source (${Z.localName}).`),lh(l);d.removeChild(Z);const F=Z.cloneNode(!1);return lM(l,F)}function OS(d){const l=d.ownerDocument.createElement(d.localName);return lM(d,l)}function lh(d){return d.ownerDocument.createTextNode(d.textContent)}function gS(d){const l=ES[d.namespaceURI];return l&&l.includes(d.localName)}function Om(d,l,U=null){if(U&&U.includes(d))return!0;const Z=wS[l.namespaceURI];if(!Z)return!1;const F=d.toLowerCase(),t=l.localName;if(Z.global.includes(F))return!0;if(!Z[t])return!1;if(Z[t].includes(F))return!0;if(l.namespaceURI==="http://www.w3.org/1999/xhtml"&&t==="input"&&F==="value"){const c=l.type.toLowerCase();if(c==="submit"||c==="button"||c==="reset")return!0}return!1}function lM(d,l){return l.textContent=d.textContent,$2(d,l),l}class KS extends Array{static from(l){return l instanceof this?l:new this(l)}}class vS extends KS{constructor(l){if(super(),Symbol.asyncIterator in Object(l))this.iterator=l[Symbol.asyncIterator]();else if(Symbol.iterator in Object(l))this.iterator=l[Symbol.iterator]();else throw new TypeError("Argument must implement the iteration protocol.")}[Symbol.asyncIterator](){const l=this;let U=0;return{async next(){return l.length<=U&&l.push(l.iterator.next()),l[U++]}}}async touchNext(l=1){let U=0;for(;U++<l;){const Z=this[this.length-1];if(Z&&(await Z).done)break;this.push(this.iterator.next())}return this[this.length-1]}}class HS{constructor(l=[],U){this.resourceIds=l,this.generateBundles=U,this.onChange(!0)}addResourceIds(l,U=!1){return this.resourceIds.push(...l),this.onChange(U),this.resourceIds.length}removeResourceIds(l){return this.resourceIds=this.resourceIds.filter(U=>!l.includes(U)),this.onChange(),this.resourceIds.length}async formatWithFallback(l,U){const Z=[];let F=!1;for await(const t of this.bundles){F=!0;const c=AS(U,t,l,Z);if(c.size===0)break;if(typeof console<"u"){const V=t.locales[0],Q=Array.from(c).join(", ");console.warn(`[fluent] Missing translations in ${V}: ${Q}`)}}return!F&&typeof console<"u"&&console.warn(`[fluent] Request for keys failed because no resource bundles got generated.
|
|
31
31
|
keys: ${JSON.stringify(l)}.
|
|
32
32
|
resourceIds: ${JSON.stringify(this.resourceIds)}.`),Z}formatMessages(l){return this.formatWithFallback(l,fS)}formatValues(l){return this.formatWithFallback(l,PS)}async formatValue(l,U){const[Z]=await this.formatValues([{id:l,args:U}]);return Z}handleEvent(){this.onChange()}onChange(l=!1){this.bundles=vS.from(this.generateBundles(this.resourceIds)),l&&this.bundles.touchNext(2)}}function PS(d,l,U,Z){return U.value?d.formatPattern(U.value,Z,l):null}function fS(d,l,U,Z){const F={value:null,attributes:null};U.value&&(F.value=d.formatPattern(U.value,Z,l));let t=Object.keys(U.attributes);if(t.length>0){F.attributes=new Array(t.length);for(let[c,V]of t.entries()){let Q=d.formatPattern(U.attributes[V],Z,l);F.attributes[c]={name:V,value:Q}}}return F}function AS(d,l,U,Z){const F=[],t=new Set;return U.forEach(({id:c,args:V},Q)=>{if(Z[Q]!==void 0)return;let a=l.getMessage(c);if(a){if(F.length=0,Z[Q]=d(l,F,a,V),F.length>0&&typeof console<"u"){const n=l.locales[0],s=F.join(", ");console.warn(`[fluent][resolver] errors in ${n}/${c}: ${s}.`)}}else t.add(c)}),t}const tF="data-l10n-id",dc="data-l10n-args",_S=`[${tF}]`;class qS extends HS{constructor(l,U){super(l,U),this.roots=new Set,this.pendingrAF=null,this.pendingElements=new Set,this.windowElement=null,this.mutationObserver=null,this.observerConfig={attributes:!0,characterData:!1,childList:!0,subtree:!0,attributeFilter:[tF,dc]}}onChange(l=!1){super.onChange(l),this.roots&&this.translateRoots()}setAttributes(l,U,Z){return l.setAttribute(tF,U),Z?l.setAttribute(dc,JSON.stringify(Z)):l.removeAttribute(dc),l}getAttributes(l){return{id:l.getAttribute(tF),args:JSON.parse(l.getAttribute(dc)||null)}}connectRoot(l){for(const U of this.roots)if(U===l||U.contains(l)||l.contains(U))throw new Error("Cannot add a root that overlaps with existing root.");if(this.windowElement){if(this.windowElement!==l.ownerDocument.defaultView)throw new Error(`Cannot connect a root:
|
|
@@ -302,4 +302,4 @@ pdfjs-editor-highlight-show-all-button-label = Show all
|
|
|
302
302
|
pdfjs-editor-highlight-show-all-button =
|
|
303
303
|
.title = Show all`)},i(Yt,th),i(Yt,ji),i(Yt,Oi),i(Yt,ch),i(Yt,NQ);let Xs=Yt;const lX=1e3,UX=50,dX=1e3;function Wh(){return document.location.hash}var cF,Zd,Dd,uW,Oa,oW,ts,qt,yW,kW,ga,cs,Vh,Qh,Hm,ah,Pm,Ws,nh,sh,tM,ih,cM;class ZX{constructor({linkService:l,eventBus:U}){i(this,Zd),i(this,uW),i(this,oW),i(this,qt),i(this,kW),i(this,cs),i(this,Qh),i(this,ah),i(this,Ws),i(this,sh),i(this,ih),i(this,cF,null),this.linkService=l,this.eventBus=U,this._initialized=!1,this._fingerprint="",this.reset(),this.eventBus._on("pagesinit",()=>{this._isPagesLoaded=!1,this.eventBus._on("pagesloaded",Z=>{this._isPagesLoaded=!!Z.pagesCount},{once:!0})})}initialize({fingerprint:l,resetHistory:U=!1,updateUrl:Z=!1}){if(!l||typeof l!="string"){console.error('PDFHistory.initialize: The "fingerprint" must be a non-empty string.');return}this._initialized&&this.reset();const F=this._fingerprint!==""&&this._fingerprint!==l;this._fingerprint=l,this._updateUrl=Z===!0,this._initialized=!0,b(this,sh,tM).call(this);const t=window.history.state;if(this._popStateInProgress=!1,this._blockHashChange=0,this._currentHash=Wh(),this._numPositionUpdates=0,this._uid=this._maxUid=0,this._destination=null,this._position=null,!b(this,qt,yW).call(this,t,!0)||U){const{hash:V,page:Q,rotation:a}=b(this,cs,Vh).call(this,!0);if(!V||F||U){b(this,Zd,Dd).call(this,null,!0);return}b(this,Zd,Dd).call(this,{hash:V,page:Q,rotation:a},!0);return}const c=t.destination;b(this,kW,ga).call(this,c,t.uid,!0),c.rotation!==void 0&&(this._initialRotation=c.rotation),c.dest?(this._initialBookmark=JSON.stringify(c.dest),this._destination.page=null):c.hash?this._initialBookmark=c.hash:c.page&&(this._initialBookmark=`page=${c.page}`)}reset(){this._initialized&&(b(this,Ws,nh).call(this),this._initialized=!1,b(this,ih,cM).call(this)),this._updateViewareaTimeout&&(clearTimeout(this._updateViewareaTimeout),this._updateViewareaTimeout=null),this._initialBookmark=null,this._initialRotation=null}push({namedDest:l=null,explicitDest:U,pageNumber:Z}){if(!this._initialized)return;if(l&&typeof l!="string"){console.error(`PDFHistory.push: "${l}" is not a valid namedDest parameter.`);return}else if(Array.isArray(U)){if(!b(this,oW,ts).call(this,Z)&&(Z!==null||this._destination)){console.error(`PDFHistory.push: "${Z}" is not a valid pageNumber parameter.`);return}}else{console.error(`PDFHistory.push: "${U}" is not a valid explicitDest parameter.`);return}const F=l||JSON.stringify(U);if(!F)return;let t=!1;if(this._destination&&(FX(this._destination.hash,F)||tX(this._destination.dest,U))){if(this._destination.page)return;t=!0}this._popStateInProgress&&!t||(b(this,Zd,Dd).call(this,{dest:U,hash:F,page:Z,rotation:this.linkService.rotation},t),this._popStateInProgress||(this._popStateInProgress=!0,Promise.resolve().then(()=>{this._popStateInProgress=!1})))}pushPage(l){var U;if(this._initialized){if(!b(this,oW,ts).call(this,l)){console.error(`PDFHistory.pushPage: "${l}" is not a valid page number.`);return}((U=this._destination)==null?void 0:U.page)!==l&&(this._popStateInProgress||(b(this,Zd,Dd).call(this,{dest:null,hash:`page=${l}`,page:l,rotation:this.linkService.rotation}),this._popStateInProgress||(this._popStateInProgress=!0,Promise.resolve().then(()=>{this._popStateInProgress=!1}))))}}pushCurrentPosition(){!this._initialized||this._popStateInProgress||b(this,uW,Oa).call(this)}back(){if(!this._initialized||this._popStateInProgress)return;const l=window.history.state;b(this,qt,yW).call(this,l)&&l.uid>0&&window.history.back()}forward(){if(!this._initialized||this._popStateInProgress)return;const l=window.history.state;b(this,qt,yW).call(this,l)&&l.uid<this._maxUid&&window.history.forward()}get popStateInProgress(){return this._initialized&&(this._popStateInProgress||this._blockHashChange>0)}get initialBookmark(){return this._initialized?this._initialBookmark:null}get initialRotation(){return this._initialized?this._initialRotation:null}}cF=new WeakMap,Zd=new WeakSet,Dd=function(d,l=!1){const U=l||!this._destination,Z={fingerprint:this._fingerprint,uid:U?this._uid:this._uid+1,destination:d};b(this,kW,ga).call(this,d,Z.uid);let F;if(this._updateUrl&&d!=null&&d.hash){const t=document.location.href.split("#",1)[0];t.startsWith("file://")||(F=`${t}#${d.hash}`)}U?window.history.replaceState(Z,"",F):window.history.pushState(Z,"",F)},uW=new WeakSet,Oa=function(d=!1){if(!this._position)return;let l=this._position;if(d&&(l=Object.assign(Object.create(null),this._position),l.temporary=!0),!this._destination){b(this,Zd,Dd).call(this,l);return}if(this._destination.temporary){b(this,Zd,Dd).call(this,l,!0);return}if(this._destination.hash===l.hash||!this._destination.page&&this._numPositionUpdates<=UX)return;let U=!1;if(this._destination.page>=l.first&&this._destination.page<=l.page){if(this._destination.dest!==void 0||!this._destination.first)return;U=!0}b(this,Zd,Dd).call(this,l,U)},oW=new WeakSet,ts=function(d){return Number.isInteger(d)&&d>0&&d<=this.linkService.pagesCount},qt=new WeakSet,yW=function(d,l=!1){if(!d)return!1;if(d.fingerprint!==this._fingerprint)if(l){if(typeof d.fingerprint!="string"||d.fingerprint.length!==this._fingerprint.length)return!1;const[U]=performance.getEntriesByType("navigation");if((U==null?void 0:U.type)!=="reload")return!1}else return!1;return!(!Number.isInteger(d.uid)||d.uid<0||d.destination===null||typeof d.destination!="object")},kW=new WeakSet,ga=function(d,l,U=!1){this._updateViewareaTimeout&&(clearTimeout(this._updateViewareaTimeout),this._updateViewareaTimeout=null),U&&d!=null&&d.temporary&&delete d.temporary,this._destination=d,this._uid=l,this._maxUid=Math.max(this._maxUid,l),this._numPositionUpdates=0},cs=new WeakSet,Vh=function(d=!1){const l=unescape(Wh()).substring(1),U=Ts(l),Z=U.get("nameddest")||"";let F=U.get("page")|0;return(!b(this,oW,ts).call(this,F)||d&&Z.length>0)&&(F=null),{hash:l,page:F,rotation:this.linkService.rotation}},Qh=new WeakSet,Hm=function({location:d}){this._updateViewareaTimeout&&(clearTimeout(this._updateViewareaTimeout),this._updateViewareaTimeout=null),this._position={hash:d.pdfOpenParams.substring(1),page:this.linkService.page,first:d.pageNumber,rotation:d.rotation},!this._popStateInProgress&&(this._isPagesLoaded&&this._destination&&!this._destination.page&&this._numPositionUpdates++,this._updateViewareaTimeout=setTimeout(()=>{this._popStateInProgress||b(this,uW,Oa).call(this,!0),this._updateViewareaTimeout=null},dX))},ah=new WeakSet,Pm=function({state:d}){const l=Wh(),U=this._currentHash!==l;if(this._currentHash=l,!d){this._uid++;const{hash:F,page:t,rotation:c}=b(this,cs,Vh).call(this);b(this,Zd,Dd).call(this,{hash:F,page:t,rotation:c},!0);return}if(!b(this,qt,yW).call(this,d))return;this._popStateInProgress=!0,U&&(this._blockHashChange++,cS({target:window,name:"hashchange",delay:lX}).then(()=>{this._blockHashChange--}));const Z=d.destination;b(this,kW,ga).call(this,Z,d.uid,!0),r2(Z.rotation)&&(this.linkService.rotation=Z.rotation),Z.dest?this.linkService.goToDestination(Z.dest):Z.hash?this.linkService.setHash(Z.hash):Z.page&&(this.linkService.page=Z.page),Promise.resolve().then(()=>{this._popStateInProgress=!1})},Ws=new WeakSet,nh=function(){(!this._destination||this._destination.temporary)&&b(this,uW,Oa).call(this)},sh=new WeakSet,tM=function(){if(W(this,cF))return;m(this,cF,new AbortController);const{signal:d}=W(this,cF);this.eventBus._on("updateviewarea",b(this,Qh,Hm).bind(this),{signal:d}),window.addEventListener("popstate",b(this,ah,Pm).bind(this),{signal:d}),window.addEventListener("pagehide",b(this,Ws,nh).bind(this),{signal:d})},ih=new WeakSet,cM=function(){var d;(d=W(this,cF))==null||d.abort(),m(this,cF,null)};function FX(d,l){return typeof d!="string"||typeof l!="string"?!1:d===l||Ts(d).get("nameddest")===l}function tX(d,l){function U(Z,F){if(typeof Z!=typeof F||Array.isArray(Z)||Array.isArray(F))return!1;if(Z!==null&&typeof Z=="object"&&F!==null){if(Object.keys(Z).length!==Object.keys(F).length)return!1;for(const t in Z)if(!U(Z[t],F[t]))return!1;return!0}return Z===F||Number.isNaN(Z)&&Number.isNaN(F)}if(!(Array.isArray(d)&&Array.isArray(l))||d.length!==l.length)return!1;for(let Z=0,F=d.length;Z<F;Z++)if(!U(d[Z],l[Z]))return!1;return!0}var Ka,va,Ha,Pa,qc;class cX{constructor(l){i(this,Ka,null),i(this,va,null),i(this,Ha,null),i(this,Pa,null),i(this,qc,void 0),this.pdfPage=l.pdfPage,this.accessibilityManager=l.accessibilityManager,this.l10n=l.l10n,this.l10n||(this.l10n=new Xs),this.annotationEditorLayer=null,this.div=null,this._cancelled=!1,m(this,qc,l.uiManager),m(this,Ka,l.annotationLayer||null),m(this,Pa,l.textLayer||null),m(this,va,l.drawLayer||null),m(this,Ha,l.onAppend||null)}async render(l,U="display"){var Z;if(U!=="display"||this._cancelled)return;const F=l.clone({dontFlip:!0});if(this.div){this.annotationEditorLayer.update({viewport:F}),this.show();return}const t=this.div=document.createElement("div");t.className="annotationEditorLayer",t.hidden=!0,t.dir=W(this,qc).direction,(Z=W(this,Ha))==null||Z.call(this,t),this.annotationEditorLayer=new fT({uiManager:W(this,qc),div:t,accessibilityManager:this.accessibilityManager,pageIndex:this.pdfPage.pageNumber-1,l10n:this.l10n,viewport:F,annotationLayer:W(this,Ka),textLayer:W(this,Pa),drawLayer:W(this,va)});const c={viewport:F,div:t,annotations:null,intent:U};this.annotationEditorLayer.render(c),this.show()}cancel(){this._cancelled=!0,this.div&&this.annotationEditorLayer.destroy()}hide(){this.div&&(this.div.hidden=!0)}show(){!this.div||this.annotationEditorLayer.isInvisible||(this.div.hidden=!1)}}Ka=new WeakMap,va=new WeakMap,Ha=new WeakMap,Pa=new WeakMap,qc=new WeakMap;{var gW=Object.create(null);const d=navigator.userAgent||"",l=navigator.platform||"",U=navigator.maxTouchPoints||1,Z=/Android/.test(d),F=/\b(iPad|iPhone|iPod)(?=;)/.test(d)||l==="MacIntel"&&U>1;(function(){(F||Z)&&(gW.maxCanvasPixels=5242880)})()}const z={BROWSER:1,VIEWER:2,API:4,WORKER:8,PREFERENCE:128},pZ={canvasMaxAreaInBytes:{value:-1,kind:z.BROWSER+z.API},isInAutomation:{value:!1,kind:z.BROWSER},supportsCaretBrowsingMode:{value:!1,kind:z.BROWSER},supportsDocumentFonts:{value:!0,kind:z.BROWSER},supportsIntegratedFind:{value:!1,kind:z.BROWSER},supportsMouseWheelZoomCtrlKey:{value:!0,kind:z.BROWSER},supportsMouseWheelZoomMetaKey:{value:!0,kind:z.BROWSER},supportsPinchToZoom:{value:!0,kind:z.BROWSER},annotationEditorMode:{value:0,kind:z.VIEWER+z.PREFERENCE},annotationMode:{value:2,kind:z.VIEWER+z.PREFERENCE},cursorToolOnLoad:{value:0,kind:z.VIEWER+z.PREFERENCE},debuggerSrc:{value:"./debugger.mjs",kind:z.VIEWER},defaultZoomDelay:{value:400,kind:z.VIEWER+z.PREFERENCE},defaultZoomValue:{value:"",kind:z.VIEWER+z.PREFERENCE},disableHistory:{value:!1,kind:z.VIEWER},disablePageLabels:{value:!1,kind:z.VIEWER+z.PREFERENCE},enableHighlightEditor:{value:!1,kind:z.VIEWER+z.PREFERENCE},enableHighlightFloatingButton:{value:!1,kind:z.VIEWER+z.PREFERENCE},enableML:{value:!1,kind:z.VIEWER+z.PREFERENCE},enablePermissions:{value:!1,kind:z.VIEWER+z.PREFERENCE},enablePrintAutoRotate:{value:!0,kind:z.VIEWER+z.PREFERENCE},enableScripting:{value:!0,kind:z.VIEWER+z.PREFERENCE},enableStampEditor:{value:!0,kind:z.VIEWER+z.PREFERENCE},externalLinkRel:{value:"noopener noreferrer nofollow",kind:z.VIEWER},externalLinkTarget:{value:0,kind:z.VIEWER+z.PREFERENCE},highlightEditorColors:{value:"yellow=#FFFF98,green=#53FFBC,blue=#80EBFF,pink=#FFCBE6,red=#FF4F5F",kind:z.VIEWER+z.PREFERENCE},historyUpdateUrl:{value:!1,kind:z.VIEWER+z.PREFERENCE},ignoreDestinationZoom:{value:!1,kind:z.VIEWER+z.PREFERENCE},imageResourcesPath:{value:"./images/",kind:z.VIEWER},maxCanvasPixels:{value:2**25,kind:z.VIEWER},forcePageColors:{value:!1,kind:z.VIEWER+z.PREFERENCE},pageColorsBackground:{value:"Canvas",kind:z.VIEWER+z.PREFERENCE},pageColorsForeground:{value:"CanvasText",kind:z.VIEWER+z.PREFERENCE},pdfBugEnabled:{value:!1,kind:z.VIEWER+z.PREFERENCE},printResolution:{value:150,kind:z.VIEWER},sidebarViewOnLoad:{value:-1,kind:z.VIEWER+z.PREFERENCE},scrollModeOnLoad:{value:-1,kind:z.VIEWER+z.PREFERENCE},spreadModeOnLoad:{value:-1,kind:z.VIEWER+z.PREFERENCE},textLayerMode:{value:1,kind:z.VIEWER+z.PREFERENCE},viewOnLoad:{value:0,kind:z.VIEWER+z.PREFERENCE},cMapPacked:{value:!0,kind:z.API},cMapUrl:{value:"../web/cmaps/",kind:z.API},disableAutoFetch:{value:!1,kind:z.API+z.PREFERENCE},disableFontFace:{value:!1,kind:z.API+z.PREFERENCE},disableRange:{value:!1,kind:z.API+z.PREFERENCE},disableStream:{value:!1,kind:z.API+z.PREFERENCE},docBaseUrl:{value:"",kind:z.API},enableHWA:{value:!0,kind:z.API+z.VIEWER+z.PREFERENCE},enableXfa:{value:!0,kind:z.API+z.PREFERENCE},fontExtraProperties:{value:!1,kind:z.API},isEvalSupported:{value:!0,kind:z.API},isOffscreenCanvasSupported:{value:!0,kind:z.API},maxImageSize:{value:-1,kind:z.API},pdfBug:{value:!1,kind:z.API},standardFontDataUrl:{value:"../web/standard_fonts/",kind:z.API},verbosity:{value:1,kind:z.API},workerPort:{value:null,kind:z.WORKER},workerSrc:{value:"../build/pdf.worker.mjs",kind:z.WORKER}};pZ.defaultUrl={value:"compressed.tracemonkey-pldi-09.pdf",kind:z.VIEWER},pZ.sandboxBundleSrc={value:"../build/pdf.sandbox.mjs",kind:z.VIEWER},pZ.viewerCssTheme={value:0,kind:z.VIEWER+z.PREFERENCE};pZ.disablePreferences={value:!1,kind:z.VIEWER},pZ.locale={value:navigator.language||"en-US",kind:z.VIEWER};const dZ=Object.create(null);for(const d in gW)dZ[d]=gW[d];class WX{constructor(){throw new Error("Cannot initialize AppOptions.")}static get(l){var U;return dZ[l]??((U=pZ[l])==null?void 0:U.value)??void 0}static getAll(l=null,U=!1){const Z=Object.create(null);for(const F in pZ){const t=pZ[F];l&&!(l&t.kind)||(Z[F]=U?t.value:dZ[F]??t.value)}return Z}static set(l,U){dZ[l]=U}static setAll(l,U=!1){if(U){if(this.get("disablePreferences"))return;for(const Z in dZ)if(gW[Z]===void 0){console.warn('setAll: The Preferences may override manually set AppOptions; please use the "disablePreferences"-option in order to prevent that.');break}}for(const Z in l)dZ[Z]=l[Z]}static remove(l){delete dZ[l];const U=gW[l];U!==void 0&&(dZ[l]=U)}}var Td;class VX{constructor(l){i(this,Td,null),this.pageIndex=l.pageIndex}async render(l="display"){l!=="display"||W(this,Td)||this._cancelled||m(this,Td,new $T({pageIndex:this.pageIndex}))}cancel(){this._cancelled=!0,W(this,Td)&&(W(this,Td).destroy(),m(this,Td,null))}setParent(l){var U;(U=W(this,Td))==null||U.setParent(l)}getDrawLayer(){return W(this,Td)}}Td=new WeakMap;const fm={Document:null,DocumentFragment:null,Part:"group",Sect:"group",Div:"group",Aside:"note",NonStruct:"none",P:null,H:"heading",Title:null,FENote:"note",Sub:"group",Lbl:null,Span:null,Em:null,Strong:null,Link:"link",Annot:"note",Form:"form",Ruby:null,RB:null,RT:null,RP:null,Warichu:null,WT:null,WP:null,L:"list",LI:"listitem",LBody:null,Table:"table",TR:"row",TH:"columnheader",TD:"cell",THead:"columnheader",TBody:null,TFoot:null,Caption:null,Figure:"figure",Formula:null,Artifact:null},QX=/^H(\d+)$/;var zU,fa,Ki,Vs,Rh;class WM{constructor(){i(this,fa),i(this,Vs),i(this,zU,void 0)}get renderingDone(){return W(this,zU)!==void 0}render(l){if(W(this,zU)!==void 0)return W(this,zU);const U=b(this,Vs,Rh).call(this,l);return U==null||U.classList.add("structTree"),m(this,zU,U)}hide(){W(this,zU)&&!W(this,zU).hidden&&(W(this,zU).hidden=!0)}show(){var l;(l=W(this,zU))!=null&&l.hidden&&(W(this,zU).hidden=!1)}}zU=new WeakMap,fa=new WeakSet,Ki=function(d,l){const{alt:U,id:Z,lang:F}=d;U!==void 0&&l.setAttribute("aria-label",ds(U)),Z!==void 0&&l.setAttribute("aria-owns",Z),F!==void 0&&l.setAttribute("lang",ds(F,!0))},Vs=new WeakSet,Rh=function(d){if(!d)return null;const l=document.createElement("span");if("role"in d){const{role:U}=d,Z=U.match(QX);Z?(l.setAttribute("role","heading"),l.setAttribute("aria-level",Z[1])):fm[U]&&l.setAttribute("role",fm[U])}if(b(this,fa,Ki).call(this,d,l),d.children)if(d.children.length===1&&"id"in d.children[0])b(this,fa,Ki).call(this,d.children[0],l);else for(const U of d.children)l.append(b(this,Vs,Rh).call(this,U));return l};var ZZ,DU,FZ,WF,LW,Aa,_a,Nh;const VM=class qa{constructor(){i(this,_a),i(this,ZZ,!1),i(this,DU,null),i(this,FZ,new Map),i(this,WF,new Map)}setTextMapping(l){m(this,DU,l)}enable(){if(W(this,ZZ))throw new Error("TextAccessibilityManager is already enabled.");if(!W(this,DU))throw new Error("Text divs and strings have not been set.");if(m(this,ZZ,!0),m(this,DU,W(this,DU).slice()),W(this,DU).sort(b(qa,LW,Aa)),W(this,FZ).size>0){const l=W(this,DU);for(const[U,Z]of W(this,FZ)){if(!document.getElementById(U)){W(this,FZ).delete(U);continue}b(this,_a,Nh).call(this,U,l[Z])}}for(const[l,U]of W(this,WF))this.addPointerInTextLayer(l,U);W(this,WF).clear()}disable(){W(this,ZZ)&&(W(this,WF).clear(),m(this,DU,null),m(this,ZZ,!1))}removePointerInTextLayer(l){if(!W(this,ZZ)){W(this,WF).delete(l);return}const U=W(this,DU);if(!U||U.length===0)return;const{id:Z}=l,F=W(this,FZ).get(Z);if(F===void 0)return;const t=U[F];W(this,FZ).delete(Z);let c=t.getAttribute("aria-owns");c!=null&&c.includes(Z)&&(c=c.split(" ").filter(V=>V!==Z).join(" "),c?t.setAttribute("aria-owns",c):(t.removeAttribute("aria-owns"),t.setAttribute("role","presentation")))}addPointerInTextLayer(l,U){const{id:Z}=l;if(!Z)return null;if(!W(this,ZZ))return W(this,WF).set(l,U),null;U&&this.removePointerInTextLayer(l);const F=W(this,DU);if(!F||F.length===0)return null;const t=jW(F,a=>{var n;return b(n=qa,LW,Aa).call(n,l,a)<0}),c=Math.max(0,t-1),V=F[c];b(this,_a,Nh).call(this,Z,V),W(this,FZ).set(Z,c);const Q=V.parentNode;return Q!=null&&Q.classList.contains("markedContent")?Q.id:null}moveElementInDOM(l,U,Z,F){const t=this.addPointerInTextLayer(Z,F);if(!l.hasChildNodes())return l.append(U),t;const c=Array.from(l.childNodes).filter(a=>a!==U);if(c.length===0)return t;const V=Z||U,Q=jW(c,a=>{var n;return b(n=qa,LW,Aa).call(n,V,a)<0});return Q===0?c[0].before(U):c[Q-1].after(U),t}};ZZ=new WeakMap,DU=new WeakMap,FZ=new WeakMap,WF=new WeakMap,LW=new WeakSet,Aa=function(d,l){const U=d.getBoundingClientRect(),Z=l.getBoundingClientRect();if(U.width===0&&U.height===0)return 1;if(Z.width===0&&Z.height===0)return-1;const F=U.y,t=U.y+U.height,c=U.y+U.height/2,V=Z.y,Q=Z.y+Z.height,a=Z.y+Z.height/2;if(c<=V&&a>=t)return-1;if(a<=F&&c>=Q)return 1;const n=U.x+U.width/2,s=Z.x+Z.width/2;return n-s},_a=new WeakSet,Nh=function(d,l){const U=l.getAttribute("aria-owns");U!=null&&U.includes(d)||l.setAttribute("aria-owns",U?`${U} ${d}`:d),l.removeAttribute("role")},i(VM,LW);let aX=VM;var VF;class nX{constructor({findController:l,eventBus:U,pageIndex:Z}){i(this,VF,null),this.findController=l,this.matches=[],this.eventBus=U,this.pageIdx=Z,this.textDivs=null,this.textContentItemsStr=null,this.enabled=!1}setTextMapping(l,U){this.textDivs=l,this.textContentItemsStr=U}enable(){if(!this.textDivs||!this.textContentItemsStr)throw new Error("Text divs and strings have not been set.");if(this.enabled)throw new Error("TextHighlighter is already enabled.");this.enabled=!0,W(this,VF)||(m(this,VF,new AbortController),this.eventBus._on("updatetextlayermatches",l=>{(l.pageIndex===this.pageIdx||l.pageIndex===-1)&&this._updateMatches()},{signal:W(this,VF).signal})),this._updateMatches()}disable(){var l;this.enabled&&(this.enabled=!1,(l=W(this,VF))==null||l.abort(),m(this,VF,null),this._updateMatches(!0))}_convertMatches(l,U){if(!l)return[];const{textContentItemsStr:Z}=this;let F=0,t=0;const c=Z.length-1,V=[];for(let Q=0,a=l.length;Q<a;Q++){let n=l[Q];for(;F!==c&&n>=t+Z[F].length;)t+=Z[F].length,F++;F===Z.length&&console.error("Could not find a matching mapping");const s={begin:{divIdx:F,offset:n-t}};for(n+=U[Q];F!==c&&n>t+Z[F].length;)t+=Z[F].length,F++;s.end={divIdx:F,offset:n-t},V.push(s)}return V}_renderMatches(l){if(l.length===0)return;const{findController:U,pageIdx:Z}=this,{textContentItemsStr:F,textDivs:t}=this,c=Z===U.selected.pageIdx,V=U.selected.matchIdx,Q=U.state.highlightAll;let a=null;const n={divIdx:-1,offset:void 0};function s(J,G){const T=J.divIdx;return t[T].textContent="",R(T,0,J.offset,G)}function R(J,G,T,p){let S=t[J];if(S.nodeType===Node.TEXT_NODE){const k=document.createElement("span");S.before(k),k.append(S),t[J]=k,S=k}const X=F[J].substring(G,T),B=document.createTextNode(X);if(p){const k=document.createElement("span");return k.className=`${p} appended`,k.append(B),S.append(k),p.includes("selected")?k.offsetLeft:0}return S.append(B),0}let N=V,h=N+1;if(Q)N=0,h=l.length;else if(!c)return;let e=-1,M=-1;for(let J=N;J<h;J++){const G=l[J],T=G.begin;if(T.divIdx===e&&T.offset===M)continue;e=T.divIdx,M=T.offset;const p=G.end,S=c&&J===V,X=S?" selected":"";let B=0;if(!a||T.divIdx!==a.divIdx?(a!==null&&R(a.divIdx,a.offset,n.offset),s(T)):R(a.divIdx,a.offset,T.offset),T.divIdx===p.divIdx)B=R(T.divIdx,T.offset,p.offset,"highlight"+X);else{B=R(T.divIdx,T.offset,n.offset,"highlight begin"+X);for(let k=T.divIdx+1,Y=p.divIdx;k<Y;k++)t[k].className="highlight middle"+X;s(p,"highlight end"+X)}a=p,S&&U.scrollMatchIntoView({element:t[T.divIdx],selectedLeft:B,pageIndex:Z,matchIndex:V})}a&&R(a.divIdx,a.offset,n.offset)}_updateMatches(l=!1){if(!this.enabled&&!l)return;const{findController:U,matches:Z,pageIdx:F}=this,{textContentItemsStr:t,textDivs:c}=this;let V=-1;for(const n of Z){const s=Math.max(V,n.begin.divIdx);for(let R=s,N=n.end.divIdx;R<=N;R++){const h=c[R];h.textContent=t[R],h.className=""}V=n.end.divIdx+1}if(!(U!=null&&U.highlightMatches)||l)return;const Q=U.pageMatches[F]||null,a=U.pageMatchesLength[F]||null;this.matches=this._convertMatches(Q,a),this._renderMatches(this.matches)}}VF=new WeakMap;var Qs,$a,pt,Sd,kU,OZ,hh,QM,bh,aM,vi,Am;const QF=class nM{constructor({pdfPage:l,highlighter:U=null,accessibilityManager:Z=null,enablePermissions:F=!1,onAppend:t=null}){i(this,hh),i(this,Qs,!1),i(this,$a,null),i(this,pt,!1),i(this,Sd,null),this.pdfPage=l,this.highlighter=U,this.accessibilityManager=Z,m(this,Qs,F===!0),m(this,$a,t),this.div=document.createElement("div"),this.div.tabIndex=0,this.div.className="textLayer"}async render(l,U=null){var Z,F,t,c,V;if(W(this,pt)&&W(this,Sd)){W(this,Sd).update({viewport:l,onBefore:this.hide.bind(this)}),this.show();return}this.cancel(),m(this,Sd,new FS({textContentSource:this.pdfPage.streamTextContent(U||{includeMarkedContent:!0,disableNormalization:!0}),container:this.div,viewport:l}));const{textDivs:Q,textContentItemsStr:a}=W(this,Sd);(Z=this.highlighter)==null||Z.setTextMapping(Q,a),(F=this.accessibilityManager)==null||F.setTextMapping(Q),await W(this,Sd).render(),m(this,pt,!0);const n=document.createElement("div");n.className="endOfContent",this.div.append(n),b(this,hh,QM).call(this,n),(t=W(this,$a))==null||t.call(this,this.div),(c=this.highlighter)==null||c.enable(),(V=this.accessibilityManager)==null||V.enable()}hide(){var l;!this.div.hidden&&W(this,pt)&&((l=this.highlighter)==null||l.disable(),this.div.hidden=!0)}show(){var l;this.div.hidden&&W(this,pt)&&(this.div.hidden=!1,(l=this.highlighter)==null||l.enable())}cancel(){var l,U,Z,F;(l=W(this,Sd))==null||l.cancel(),m(this,Sd,null),(U=this.highlighter)==null||U.disable(),(Z=this.accessibilityManager)==null||Z.disable(),b(F=nM,bh,aM).call(F,this.div)}};Qs=new WeakMap,$a=new WeakMap,pt=new WeakMap,Sd=new WeakMap,kU=new WeakMap,OZ=new WeakMap,hh=new WeakSet,QM=function(d){var l;const{div:U}=this;U.addEventListener("mousedown",Z=>{d.classList.add("active")}),U.addEventListener("copy",Z=>{if(!W(this,Qs)){const F=document.getSelection();Z.clipboardData.setData("text/plain",ds(dS(F.toString())))}Z.preventDefault(),Z.stopPropagation()}),W(QF,kU).set(U,d),b(l=QF,vi,Am).call(l)},bh=new WeakSet,aM=function(d){var l;W(this,kU).delete(d),W(this,kU).size===0&&((l=W(this,OZ))==null||l.abort(),m(this,OZ,null))},vi=new WeakSet,Am=function(){if(W(this,OZ))return;m(this,OZ,new AbortController);const{signal:d}=W(this,OZ),l=(F,t)=>{t.append(F),F.style.width="",F.style.height="",F.classList.remove("active")};document.addEventListener("pointerup",()=>{W(this,kU).forEach(l)},{signal:d});var U,Z;document.addEventListener("selectionchange",()=>{const F=document.getSelection();if(F.rangeCount===0){W(this,kU).forEach(l);return}const t=new Set;for(let s=0;s<F.rangeCount;s++){const R=F.getRangeAt(s);for(const N of W(this,kU).keys())!t.has(N)&&R.intersectsNode(N)&&t.add(N)}for(const[s,R]of W(this,kU))t.has(s)?R.classList.add("active"):l(R,s);if(U??(U=getComputedStyle(W(this,kU).values().next().value).getPropertyValue("-moz-user-select")==="none"),U)return;const c=F.getRangeAt(0),V=Z&&(c.compareBoundaryPoints(Range.END_TO_END,Z)===0||c.compareBoundaryPoints(Range.START_TO_END,Z)===0);let Q=V?c.startContainer:c.endContainer;Q.nodeType===Node.TEXT_NODE&&(Q=Q.parentNode);const a=Q.parentElement.closest(".textLayer"),n=W(this,kU).get(a);n&&(n.style.width=a.style.width,n.style.height=a.style.height,Q.parentElement.insertBefore(n,V?Q:Q.nextSibling)),Z=c.cloneRange()},{signal:d})},i(QF,bh),i(QF,vi),i(QF,kU,new Map),i(QF,OZ,null);let sM=QF;class iM{constructor({pdfPage:l,annotationStorage:U=null,linkService:Z,xfaHtml:F=null}){this.pdfPage=l,this.annotationStorage=U,this.linkService=Z,this.xfaHtml=F,this.div=null,this._cancelled=!1}async render(l,U="display"){if(U==="print"){const t={viewport:l.clone({dontFlip:!0}),div:this.div,xfaHtml:this.xfaHtml,annotationStorage:this.annotationStorage,linkService:this.linkService,intent:U};return this.div=document.createElement("div"),t.div=this.div,Ci.render(t)}const Z=await this.pdfPage.getXfa();if(this._cancelled||!Z)return{textDivs:[]};const F={viewport:l.clone({dontFlip:!0}),div:this.div,xfaHtml:Z,annotationStorage:this.annotationStorage,linkService:this.linkService,intent:U};return this.div?Ci.update(F):(this.div=document.createElement("div"),F.div=this.div,Ci.render(F))}cancel(){this._cancelled=!0}hide(){this.div&&(this.div.hidden=!0)}}const sX={annotationEditorUIManager:null,annotationStorage:null,downloadManager:null,enableScripting:!1,fieldObjectsPromise:null,findController:null,hasJSActionsPromise:null,get linkService(){return new qh}},iX=new Map([["canvasWrapper",0],["textLayer",1],["annotationLayer",2],["annotationEditorLayer",3],["xfaLayer",3]]);var Bt,ln,ut,aF,nF,Un,$t,$c,lW,WZ,ot,YF,bF,l0,UW,dn,yt,Zc,Zn,mh,Fn,eh,tn,Mh,cn,Jh,Wn,Gh,Th,_m,Sh,qm,Vn,Xh;class RM{constructor(l){i(this,bF),i(this,UW),i(this,yt),i(this,Zn),i(this,Fn),i(this,tn),i(this,cn),i(this,Wn),i(this,Th),i(this,Sh),i(this,Vn),i(this,Bt,Id.ENABLE_FORMS),i(this,ln,!1),i(this,ut,!1),i(this,aF,null),i(this,nF,null),i(this,Un,null),i(this,$t,null),i(this,$c,il.INITIAL),i(this,lW,Fd.ENABLE),i(this,WZ,{directDrawing:!0,initialOptionalContent:!0,regularAnnotations:!0}),i(this,ot,new WeakMap),i(this,YF,[null,null,null,null]);var U;const Z=l.container,F=l.defaultViewport;this.id=l.id,this.renderingId="page"+this.id,m(this,aF,l.layerProperties||sX),this.pdfPage=null,this.pageLabel=null,this.rotation=0,this.scale=l.scale||E2,this.viewport=F,this.pdfPageRotate=F.rotation,this._optionalContentConfigPromise=l.optionalContentConfigPromise||null,m(this,lW,l.textLayerMode??Fd.ENABLE),m(this,Bt,l.annotationMode??Id.ENABLE_FORMS),this.imageResourcesPath=l.imageResourcesPath||"",this.maxCanvasPixels=l.maxCanvasPixels??WX.get("maxCanvasPixels"),this.pageColors=l.pageColors||null,m(this,ln,l.enableHWA||!1),this.eventBus=l.eventBus,this.renderingQueue=l.renderingQueue,this.l10n=l.l10n,this.l10n||(this.l10n=new Xs),this.renderTask=null,this.resume=null,this._isStandalone=!((U=this.renderingQueue)!=null&&U.hasViewer()),this._container=Z,this._annotationCanvasMap=null,this.annotationLayer=null,this.annotationEditorLayer=null,this.textLayer=null,this.zoomLayer=null,this.xfaLayer=null,this.structTreeLayer=null,this.drawLayer=null;const t=document.createElement("div");if(t.className="page",t.setAttribute("data-page-number",this.id),t.setAttribute("role","region"),t.setAttribute("data-l10n-id","pdfjs-page-landmark"),t.setAttribute("data-l10n-args",JSON.stringify({page:this.id})),this.div=t,b(this,UW,dn).call(this),Z==null||Z.append(t),this._isStandalone){Z==null||Z.style.setProperty("--scale-factor",this.scale*zd.PDF_TO_CSS_UNITS);const{optionalContentConfigPromise:c}=l;c&&c.then(V=>{c===this._optionalContentConfigPromise&&(W(this,WZ).initialOptionalContent=V.hasInitialVisibility)}),l.l10n||this.l10n.translate(this.div)}}get renderingState(){return W(this,$c)}set renderingState(l){if(l!==W(this,$c))switch(m(this,$c,l),W(this,nF)&&(clearTimeout(W(this,nF)),m(this,nF,null)),l){case il.PAUSED:this.div.classList.remove("loading");break;case il.RUNNING:this.div.classList.add("loadingIcon"),m(this,nF,setTimeout(()=>{this.div.classList.add("loading"),m(this,nF,null)},0));break;case il.INITIAL:case il.FINISHED:this.div.classList.remove("loadingIcon","loading");break}}setPdfPage(l){var U,Z,F,t;this._isStandalone&&(((U=this.pageColors)==null?void 0:U.foreground)==="CanvasText"||((Z=this.pageColors)==null?void 0:Z.background)==="Canvas")&&((F=this._container)==null||F.style.setProperty("--hcm-highlight-filter",l.filterFactory.addHighlightHCMFilter("highlight","CanvasText","Canvas","HighlightText","Highlight")),(t=this._container)==null||t.style.setProperty("--hcm-highlight-selected-filter",l.filterFactory.addHighlightHCMFilter("highlight_selected","CanvasText","Canvas","HighlightText","Highlight"))),this.pdfPage=l,this.pdfPageRotate=l.rotate;const c=(this.rotation+this.pdfPageRotate)%360;this.viewport=l.getViewport({scale:this.scale*zd.PDF_TO_CSS_UNITS,rotation:c}),b(this,UW,dn).call(this),this.reset()}destroy(){var l;this.reset(),(l=this.pdfPage)==null||l.cleanup()}get _textHighlighter(){return Zs(this,"_textHighlighter",new nX({pageIndex:this.id-1,eventBus:this.eventBus,findController:W(this,aF).findController}))}_resetZoomLayer(l=!1){if(!this.zoomLayer)return;const U=this.zoomLayer.firstChild;W(this,ot).delete(U),U.width=0,U.height=0,l&&this.zoomLayer.remove(),this.zoomLayer=null}reset({keepZoomLayer:l=!1,keepAnnotationLayer:U=!1,keepAnnotationEditorLayer:Z=!1,keepXfaLayer:F=!1,keepTextLayer:t=!1}={}){var c,V,Q,a,n;this.cancelRendering({keepAnnotationLayer:U,keepAnnotationEditorLayer:Z,keepXfaLayer:F,keepTextLayer:t}),this.renderingState=il.INITIAL;const s=this.div,R=s.childNodes,N=l&&this.zoomLayer||null,h=U&&((c=this.annotationLayer)==null?void 0:c.div)||null,e=Z&&((V=this.annotationEditorLayer)==null?void 0:V.div)||null,M=F&&((Q=this.xfaLayer)==null?void 0:Q.div)||null,J=t&&((a=this.textLayer)==null?void 0:a.div)||null;for(let G=R.length-1;G>=0;G--){const T=R[G];switch(T){case N:case h:case e:case M:case J:continue}T.remove();const p=W(this,YF).indexOf(T);p>=0&&(W(this,YF)[p]=null)}s.removeAttribute("data-loaded"),h&&this.annotationLayer.hide(),e&&this.annotationEditorLayer.hide(),M&&this.xfaLayer.hide(),J&&this.textLayer.hide(),(n=this.structTreeLayer)==null||n.hide(),N||(this.canvas&&(W(this,ot).delete(this.canvas),this.canvas.width=0,this.canvas.height=0,delete this.canvas),this._resetZoomLayer())}update({scale:l=0,rotation:U=null,optionalContentConfigPromise:Z=null,drawingDelay:F=-1}){var t;this.scale=l||this.scale,typeof U=="number"&&(this.rotation=U),Z instanceof Promise&&(this._optionalContentConfigPromise=Z,Z.then(V=>{Z===this._optionalContentConfigPromise&&(W(this,WZ).initialOptionalContent=V.hasInitialVisibility)})),W(this,WZ).directDrawing=!0;const c=(this.rotation+this.pdfPageRotate)%360;if(this.viewport=this.viewport.clone({scale:this.scale*zd.PDF_TO_CSS_UNITS,rotation:c}),b(this,UW,dn).call(this),this._isStandalone&&((t=this._container)==null||t.style.setProperty("--scale-factor",this.viewport.scale)),this.canvas){let V=!1;if(W(this,ut)){if(this.maxCanvasPixels===0)V=!0;else if(this.maxCanvasPixels>0){const{width:a,height:n}=this.viewport,{sx:s,sy:R}=this.outputScale;V=(Math.floor(a)*s|0)*(Math.floor(n)*R|0)>this.maxCanvasPixels}}const Q=F>=0&&F<1e3;if(Q||V){if(Q&&!V&&this.renderingState!==il.FINISHED&&(this.cancelRendering({keepZoomLayer:!0,keepAnnotationLayer:!0,keepAnnotationEditorLayer:!0,keepXfaLayer:!0,keepTextLayer:!0,cancelExtraDelay:F}),this.renderingState=il.FINISHED,W(this,WZ).directDrawing=!1),this.cssTransform({target:this.canvas,redrawAnnotationLayer:!0,redrawAnnotationEditorLayer:!0,redrawXfaLayer:!0,redrawTextLayer:!Q,hideTextLayer:Q}),Q)return;this.eventBus.dispatch("pagerendered",{source:this,pageNumber:this.id,cssTransform:!0,timestamp:performance.now(),error:W(this,$t)});return}!this.zoomLayer&&!this.canvas.hidden&&(this.zoomLayer=this.canvas.parentNode,this.zoomLayer.style.position="absolute")}this.zoomLayer&&this.cssTransform({target:this.zoomLayer.firstChild}),this.reset({keepZoomLayer:!0,keepAnnotationLayer:!0,keepAnnotationEditorLayer:!0,keepXfaLayer:!0,keepTextLayer:!0})}cancelRendering({keepAnnotationLayer:l=!1,keepAnnotationEditorLayer:U=!1,keepXfaLayer:Z=!1,keepTextLayer:F=!1,cancelExtraDelay:t=0}={}){var c;this.renderTask&&(this.renderTask.cancel(t),this.renderTask=null),this.resume=null,this.textLayer&&(!F||!this.textLayer.div)&&(this.textLayer.cancel(),this.textLayer=null),this.structTreeLayer&&!this.textLayer&&(this.structTreeLayer=null),this.annotationLayer&&(!l||!this.annotationLayer.div)&&(this.annotationLayer.cancel(),this.annotationLayer=null,this._annotationCanvasMap=null),this.annotationEditorLayer&&(!U||!this.annotationEditorLayer.div)&&(this.drawLayer&&(this.drawLayer.cancel(),this.drawLayer=null),this.annotationEditorLayer.cancel(),this.annotationEditorLayer=null),this.xfaLayer&&(!Z||!this.xfaLayer.div)&&(this.xfaLayer.cancel(),this.xfaLayer=null,(c=this._textHighlighter)==null||c.disable())}cssTransform({target:l,redrawAnnotationLayer:U=!1,redrawAnnotationEditorLayer:Z=!1,redrawXfaLayer:F=!1,redrawTextLayer:t=!1,hideTextLayer:c=!1}){var V;if(!l.hasAttribute("zooming")){l.setAttribute("zooming",!0);const{style:a}=l;a.width=a.height=""}const Q=W(this,ot).get(l);if(this.viewport!==Q){const a=this.viewport.rotation-Q.rotation,n=Math.abs(a);let s=1,R=1;if(n===90||n===270){const{width:N,height:h}=this.viewport;s=h/N,R=N/h}l.style.transform=`rotate(${a}deg) scale(${s}, ${R})`}U&&this.annotationLayer&&b(this,Zn,mh).call(this),Z&&this.annotationEditorLayer&&(this.drawLayer&&b(this,tn,Mh).call(this),b(this,Fn,eh).call(this)),F&&this.xfaLayer&&b(this,cn,Jh).call(this),this.textLayer&&(c?(this.textLayer.hide(),(V=this.structTreeLayer)==null||V.hide()):t&&b(this,Wn,Gh).call(this))}get width(){return this.viewport.width}get height(){return this.viewport.height}getPagePoint(l,U){return this.viewport.convertToPdfPoint(l,U)}async draw(){this.renderingState!==il.INITIAL&&(console.error("Must be in new state before drawing"),this.reset());const{div:l,l10n:U,pageColors:Z,pdfPage:F,viewport:t}=this;if(!F)throw this.renderingState=il.FINISHED,new Error("pdfPage is not loaded");this.renderingState=il.RUNNING;const c=document.createElement("div");if(c.classList.add("canvasWrapper"),b(this,bF,l0).call(this,c,"canvasWrapper"),!this.textLayer&&W(this,lW)!==Fd.DISABLE&&!F.isPureXfa&&(this._accessibilityManager||(this._accessibilityManager=new aX),this.textLayer=new sM({pdfPage:F,highlighter:this._textHighlighter,accessibilityManager:this._accessibilityManager,enablePermissions:W(this,lW)===Fd.ENABLE_PERMISSIONS,onAppend:X=>{this.l10n.pause(),b(this,bF,l0).call(this,X,"textLayer"),this.l10n.resume()}})),!this.annotationLayer&&W(this,Bt)!==Id.DISABLE){const{annotationStorage:X,annotationEditorUIManager:B,downloadManager:k,enableScripting:Y,fieldObjectsPromise:o,hasJSActionsPromise:y,linkService:D}=W(this,aF);this._annotationCanvasMap||(this._annotationCanvasMap=new Map),this.annotationLayer=new f2({pdfPage:F,annotationStorage:X,imageResourcesPath:this.imageResourcesPath,renderForms:W(this,Bt)===Id.ENABLE_FORMS,linkService:D,downloadManager:k,enableScripting:Y,hasJSActionsPromise:y,fieldObjectsPromise:o,annotationCanvasMap:this._annotationCanvasMap,accessibilityManager:this._accessibilityManager,annotationEditorUIManager:B,onAppend:I=>{b(this,bF,l0).call(this,I,"annotationLayer")}})}const V=X=>{if(R==null||R(!1),this.renderingQueue&&!this.renderingQueue.isHighestPriority(this)){this.renderingState=il.PAUSED,this.resume=()=>{this.renderingState=il.RUNNING,X()};return}X()},{width:Q,height:a}=t,n=document.createElement("canvas");n.setAttribute("role","presentation"),n.hidden=!0;const s=!!(Z!=null&&Z.background&&Z!=null&&Z.foreground);let R=X=>{(!s||X)&&(n.hidden=!1,R=null)};c.append(n),this.canvas=n;const N=n.getContext("2d",{alpha:!1,willReadFrequently:!W(this,ln)}),h=this.outputScale=new NT;if(this.maxCanvasPixels===0){const X=1/this.scale;h.sx*=X,h.sy*=X,m(this,ut,!0)}else if(this.maxCanvasPixels>0){const X=Q*a,B=Math.sqrt(this.maxCanvasPixels/X);h.sx>B||h.sy>B?(h.sx=B,h.sy=B,m(this,ut,!0)):m(this,ut,!1)}const e=hm(h.sx),M=hm(h.sy);n.width=QQ(Q*h.sx,e[0]),n.height=QQ(a*h.sy,M[0]);const{style:J}=n;J.width=QQ(Q,e[1])+"px",J.height=QQ(a,M[1])+"px",W(this,ot).set(n,t);const G=h.scaled?[h.sx,0,0,h.sy,0,0]:null,T={canvasContext:N,transform:G,viewport:t,annotationMode:W(this,Bt),optionalContentConfigPromise:this._optionalContentConfigPromise,annotationCanvasMap:this._annotationCanvasMap,pageColors:Z},p=this.renderTask=F.render(T);p.onContinue=V;const S=p.promise.then(async()=>{var X;R==null||R(!0),await b(this,Vn,Xh).call(this,p),b(this,Wn,Gh).call(this),this.annotationLayer&&await b(this,Zn,mh).call(this);const{annotationEditorUIManager:B}=W(this,aF);B&&(this.drawLayer||(this.drawLayer=new VX({pageIndex:this.id})),await b(this,tn,Mh).call(this),this.drawLayer.setParent(c),this.annotationEditorLayer||(this.annotationEditorLayer=new cX({uiManager:B,pdfPage:F,l10n:U,accessibilityManager:this._accessibilityManager,annotationLayer:(X=this.annotationLayer)==null?void 0:X.annotationLayer,textLayer:this.textLayer,drawLayer:this.drawLayer.getDrawLayer(),onAppend:k=>{b(this,bF,l0).call(this,k,"annotationEditorLayer")}})),b(this,Fn,eh).call(this))},X=>(X instanceof $h||R==null||R(!0),b(this,Vn,Xh).call(this,p,X)));if(F.isPureXfa){if(!this.xfaLayer){const{annotationStorage:X,linkService:B}=W(this,aF);this.xfaLayer=new iM({pdfPage:F,annotationStorage:X,linkService:B})}b(this,cn,Jh).call(this)}return l.setAttribute("data-loaded",!0),this.eventBus.dispatch("pagerender",{source:this,pageNumber:this.id}),S}setPageLabel(l){this.pageLabel=typeof l=="string"?l:null,this.div.setAttribute("data-l10n-args",JSON.stringify({page:this.pageLabel??this.id})),this.pageLabel!==null?this.div.setAttribute("data-page-label",this.pageLabel):this.div.removeAttribute("data-page-label")}get thumbnailCanvas(){const{directDrawing:l,initialOptionalContent:U,regularAnnotations:Z}=W(this,WZ);return l&&U&&Z?this.canvas:null}}Bt=new WeakMap,ln=new WeakMap,ut=new WeakMap,aF=new WeakMap,nF=new WeakMap,Un=new WeakMap,$t=new WeakMap,$c=new WeakMap,lW=new WeakMap,WZ=new WeakMap,ot=new WeakMap,YF=new WeakMap,bF=new WeakSet,l0=function(d,l){const U=iX.get(l),Z=W(this,YF)[U];if(W(this,YF)[U]=d,Z){Z.replaceWith(d);return}for(let F=U-1;F>=0;F--){const t=W(this,YF)[F];if(t){t.after(d);return}}this.div.prepend(d)},UW=new WeakSet,dn=function(){const{viewport:d}=this;if(this.pdfPage){if(W(this,Un)===d.rotation)return;m(this,Un,d.rotation)}ZS(this.div,d,!0,!1)},yt=new WeakSet,Zc=function(d,l){this.eventBus.dispatch(d,{source:this,pageNumber:this.id,error:l})},Zn=new WeakSet,mh=async function(){let d=null;try{await this.annotationLayer.render(this.viewport,"display")}catch(l){console.error(`#renderAnnotationLayer: "${l}".`),d=l}finally{b(this,yt,Zc).call(this,"annotationlayerrendered",d)}},Fn=new WeakSet,eh=async function(){let d=null;try{await this.annotationEditorLayer.render(this.viewport,"display")}catch(l){console.error(`#renderAnnotationEditorLayer: "${l}".`),d=l}finally{b(this,yt,Zc).call(this,"annotationeditorlayerrendered",d)}},tn=new WeakSet,Mh=async function(){try{await this.drawLayer.render("display")}catch(d){console.error(`#renderDrawLayer: "${d}".`)}},cn=new WeakSet,Jh=async function(){var d;let l=null;try{const U=await this.xfaLayer.render(this.viewport,"display");U!=null&&U.textDivs&&this._textHighlighter&&b(this,Sh,qm).call(this,U.textDivs)}catch(U){console.error(`#renderXfaLayer: "${U}".`),l=U}finally{(d=this.xfaLayer)!=null&&d.div&&(this.l10n.pause(),b(this,bF,l0).call(this,this.xfaLayer.div,"xfaLayer"),this.l10n.resume()),b(this,yt,Zc).call(this,"xfalayerrendered",l)}},Wn=new WeakSet,Gh=async function(){if(!this.textLayer)return;let d=null;try{await this.textLayer.render(this.viewport)}catch(l){if(l instanceof PT)return;console.error(`#renderTextLayer: "${l}".`),d=l}b(this,yt,Zc).call(this,"textlayerrendered",d),b(this,Th,_m).call(this)},Th=new WeakSet,_m=async function(){var d,l,U;if(!this.textLayer)return;this.structTreeLayer||(this.structTreeLayer=new WM);const Z=await(this.structTreeLayer.renderingDone?null:this.pdfPage.getStructTree()),F=(d=this.structTreeLayer)==null?void 0:d.render(Z);F&&(this.l10n.pause(),(l=this.canvas)==null||l.append(F),this.l10n.resume()),(U=this.structTreeLayer)==null||U.show()},Sh=new WeakSet,qm=async function(d){const l=await this.pdfPage.getTextContent(),U=[];for(const Z of l.items)U.push(Z.str);this._textHighlighter.setTextMapping(d,U),this._textHighlighter.enable()},Vn=new WeakSet,Xh=async function(d,l=null){if(d===this.renderTask&&(this.renderTask=null),l instanceof $h){m(this,$t,null);return}if(m(this,$t,l),this.renderingState=il.FINISHED,this._resetZoomLayer(!0),W(this,WZ).regularAnnotations=!d.separateAnnots,this.eventBus.dispatch("pagerendered",{source:this,pageNumber:this.id,cssTransform:!1,timestamp:performance.now(),error:W(this,$t)}),l)throw l};async function RX(d){const l="",U=l.split("#",1)[0];let{info:Z,metadata:F,contentDispositionFilename:t,contentLength:c}=await d.getMetadata();if(!c){const{length:V}=await d.getDownloadInfo();c=V}return{...Z,baseURL:U,filesize:c,filename:t||lS(l),metadata:F==null?void 0:F.getRaw(),authors:F==null?void 0:F.get("dc:creator"),numPages:d.numPages,URL:l}}class NX{constructor(l){this._ready=new Promise((U,Z)=>{import(l).then(F=>{U(F.QuickJSSandbox())}).catch(Z)})}async createSandbox(l){(await this._ready).create(l)}async dispatchEventInSandbox(l){const U=await this._ready;setTimeout(()=>U.dispatchEvent(l),0)}async destroySandbox(){(await this._ready).nukeSandbox()}}var Yd,U0,Qn,s0,i0,as,QU,TZ,zW,ul,CU,Yh,NM,dW,an,nn,ph,Bh,hM,kt,ZW;class hX{constructor({eventBus:l,externalServices:U=null,docProperties:Z=null}){i(this,Yh),i(this,dW),i(this,nn),i(this,Bh),i(this,kt),i(this,Yd,null),i(this,U0,null),i(this,Qn,null),i(this,s0,null),i(this,i0,null),i(this,as,null),i(this,QU,null),i(this,TZ,null),i(this,zW,!1),i(this,ul,null),i(this,CU,null),m(this,i0,l),m(this,as,U),m(this,Qn,Z)}setViewer(l){m(this,TZ,l)}async setDocument(l){var U;if(W(this,QU)&&await b(this,kt,ZW).call(this),m(this,QU,l),!l)return;const[Z,F,t]=await Promise.all([l.getFieldObjects(),l.getCalculationOrderIds(),l.getJSActions()]);if(!Z&&!t){await b(this,kt,ZW).call(this);return}if(l!==W(this,QU))return;try{m(this,ul,b(this,Bh,hM).call(this))}catch(Q){console.error(`setDocument: "${Q.message}".`),await b(this,kt,ZW).call(this);return}const c=W(this,i0);m(this,s0,new AbortController);const{signal:V}=W(this,s0);c._on("updatefromsandbox",Q=>{(Q==null?void 0:Q.source)===window&&b(this,Yh,NM).call(this,Q.detail)},{signal:V}),c._on("dispatcheventinsandbox",Q=>{var a;(a=W(this,ul))==null||a.dispatchEventInSandbox(Q.detail)},{signal:V}),c._on("pagechanging",({pageNumber:Q,previous:a})=>{Q!==a&&(b(this,nn,ph).call(this,a),b(this,dW,an).call(this,Q))},{signal:V}),c._on("pagerendered",({pageNumber:Q})=>{this._pageOpenPending.has(Q)&&Q===W(this,TZ).currentPageNumber&&b(this,dW,an).call(this,Q)},{signal:V}),c._on("pagesdestroy",async()=>{var Q,a;await b(this,nn,ph).call(this,W(this,TZ).currentPageNumber),await((Q=W(this,ul))==null?void 0:Q.dispatchEventInSandbox({id:"doc",name:"WillClose"})),(a=W(this,Yd))==null||a.resolve()},{signal:V});try{const Q=await W(this,Qn).call(this,l);if(l!==W(this,QU))return;await W(this,ul).createSandbox({objects:Z,calculationOrder:F,appInfo:{platform:navigator.platform,language:navigator.language},docInfo:{...Q,actions:t}}),c.dispatch("sandboxcreated",{source:this})}catch(Q){console.error(`setDocument: "${Q.message}".`),await b(this,kt,ZW).call(this);return}await((U=W(this,ul))==null?void 0:U.dispatchEventInSandbox({id:"doc",name:"Open"})),await b(this,dW,an).call(this,W(this,TZ).currentPageNumber,!0),Promise.resolve().then(()=>{l===W(this,QU)&&m(this,zW,!0)})}async dispatchWillSave(){var l;return(l=W(this,ul))==null?void 0:l.dispatchEventInSandbox({id:"doc",name:"WillSave"})}async dispatchDidSave(){var l;return(l=W(this,ul))==null?void 0:l.dispatchEventInSandbox({id:"doc",name:"DidSave"})}async dispatchWillPrint(){var l;if(W(this,ul)){await((l=W(this,CU))==null?void 0:l.promise),m(this,CU,Promise.withResolvers());try{await W(this,ul).dispatchEventInSandbox({id:"doc",name:"WillPrint"})}catch(U){throw W(this,CU).resolve(),m(this,CU,null),U}await W(this,CU).promise}}async dispatchDidPrint(){var l;return(l=W(this,ul))==null?void 0:l.dispatchEventInSandbox({id:"doc",name:"DidPrint"})}get destroyPromise(){var l;return((l=W(this,U0))==null?void 0:l.promise)||null}get ready(){return W(this,zW)}get _pageOpenPending(){return Zs(this,"_pageOpenPending",new Set)}get _visitedPages(){return Zs(this,"_visitedPages",new Map)}}Yd=new WeakMap,U0=new WeakMap,Qn=new WeakMap,s0=new WeakMap,i0=new WeakMap,as=new WeakMap,QU=new WeakMap,TZ=new WeakMap,zW=new WeakMap,ul=new WeakMap,CU=new WeakMap,Yh=new WeakSet,NM=async function(d){var l,U;const Z=W(this,TZ),F=Z.isInPresentationMode||Z.isChangingPresentationMode,{id:t,siblings:c,command:V,value:Q}=d;if(!t){switch(V){case"clear":console.clear();break;case"error":console.error(Q);break;case"layout":if(!F){const n=ST(Q);Z.spreadMode=n.spreadMode}break;case"page-num":Z.currentPageNumber=Q+1;break;case"print":await Z.pagesPromise,W(this,i0).dispatch("print",{source:this});break;case"println":console.log(Q);break;case"zoom":F||(Z.currentScaleValue=Q);break;case"SaveAs":W(this,i0).dispatch("download",{source:this});break;case"FirstPage":Z.currentPageNumber=1;break;case"LastPage":Z.currentPageNumber=Z.pagesCount;break;case"NextPage":Z.nextPage();break;case"PrevPage":Z.previousPage();break;case"ZoomViewIn":F||Z.increaseScale();break;case"ZoomViewOut":F||Z.decreaseScale();break;case"WillPrintFinished":(l=W(this,CU))==null||l.resolve(),m(this,CU,null);break}return}if(F&&d.focus)return;delete d.id,delete d.siblings;const a=c?[t,...c]:[t];for(const n of a){const s=document.querySelector(`[data-element-id="${n}"]`);s?s.dispatchEvent(new CustomEvent("updatefromsandbox",{detail:d})):(U=W(this,QU))==null||U.annotationStorage.setValue(n,d)}},dW=new WeakSet,an=async function(d,l=!1){const U=W(this,QU),Z=this._visitedPages;if(l&&m(this,Yd,Promise.withResolvers()),!W(this,Yd))return;const F=W(this,TZ).getPageView(d-1);if((F==null?void 0:F.renderingState)!==il.FINISHED){this._pageOpenPending.add(d);return}this._pageOpenPending.delete(d);const t=(async()=>{var c,V;const Q=await(Z.has(d)?null:(c=F.pdfPage)==null?void 0:c.getJSActions());U===W(this,QU)&&await((V=W(this,ul))==null?void 0:V.dispatchEventInSandbox({id:"page",name:"PageOpen",pageNumber:d,actions:Q}))})();Z.set(d,t)},nn=new WeakSet,ph=async function(d){var l;const U=W(this,QU),Z=this._visitedPages;if(!W(this,Yd)||this._pageOpenPending.has(d))return;const F=Z.get(d);F&&(Z.set(d,null),await F,U===W(this,QU)&&await((l=W(this,ul))==null?void 0:l.dispatchEventInSandbox({id:"page",name:"PageClose",pageNumber:d})))},Bh=new WeakSet,hM=function(){if(m(this,U0,Promise.withResolvers()),W(this,ul))throw new Error("#initScripting: Scripting already exists.");return W(this,as).createScripting()},kt=new WeakSet,ZW=async function(){var d,l,U,Z;if(!W(this,ul)){m(this,QU,null),(d=W(this,U0))==null||d.resolve();return}W(this,Yd)&&(await Promise.race([W(this,Yd).promise,new Promise(F=>{setTimeout(F,1e3)})]).catch(()=>{}),m(this,Yd,null)),m(this,QU,null);try{await W(this,ul).destroySandbox()}catch{}(l=W(this,CU))==null||l.reject(new Error("Scripting destroyed.")),m(this,CU,null),(U=W(this,s0))==null||U.abort(),m(this,s0,null),this._pageOpenPending.clear(),this._visitedPages.clear(),m(this,ul,null),m(this,zW,!1),(Z=W(this,U0))==null||Z.resolve()};class bX extends hX{constructor(l){l.externalServices||window.addEventListener("updatefromsandbox",U=>{l.eventBus.dispatch("updatefromsandbox",{source:window,detail:U.detail})}),l.externalServices||(l.externalServices={createScripting:()=>new NX(l.sandboxBundleSrc)}),l.docProperties||(l.docProperties=U=>RX(U)),super(l)}}const mX=3e4;class eX{constructor(){this.pdfViewer=null,this.pdfThumbnailViewer=null,this.onIdle=null,this.highestPriorityPage=null,this.idleTimeout=null,this.printing=!1,this.isThumbnailViewEnabled=!1,Object.defineProperty(this,"hasViewer",{value:()=>!!this.pdfViewer})}setViewer(l){this.pdfViewer=l}setThumbnailViewer(l){this.pdfThumbnailViewer=l}isHighestPriority(l){return this.highestPriorityPage===l.renderingId}renderHighestPriority(l){var U;this.idleTimeout&&(clearTimeout(this.idleTimeout),this.idleTimeout=null),!this.pdfViewer.forceRendering(l)&&(this.isThumbnailViewEnabled&&(U=this.pdfThumbnailViewer)!=null&&U.forceRendering()||this.printing||this.onIdle&&(this.idleTimeout=setTimeout(this.onIdle.bind(this),mX)))}getHighestPriority(l,U,Z,F=!1){const t=l.views,c=t.length;if(c===0)return null;for(let s=0;s<c;s++){const R=t[s].view;if(!this.isViewFinished(R))return R}const V=l.first.id,Q=l.last.id;if(Q-V+1>c){const s=l.ids;for(let R=1,N=Q-V;R<N;R++){const h=Z?V+R:Q-R;if(s.has(h))continue;const e=U[h-1];if(!this.isViewFinished(e))return e}}let a=Z?Q:V-2,n=U[a];return n&&!this.isViewFinished(n)||F&&(a+=Z?1:-1,n=U[a],n&&!this.isViewFinished(n))?n:null}isViewFinished(l){return l.renderingState===il.FINISHED}renderView(l){switch(l.renderingState){case il.FINISHED:return!1;case il.PAUSED:this.highestPriorityPage=l.renderingId,l.resume();break;case il.RUNNING:this.highestPriorityPage=l.renderingId;break;case il.INITIAL:this.highestPriorityPage=l.renderingId,l.draw().finally(()=>{this.renderHighestPriority()}).catch(U=>{U instanceof $h||console.error(`renderView: "${U}"`)});break}return!0}}const $m=10,hQ={FORCE_SCROLL_MODE_PAGE:1e4,FORCE_LAZY_PAGE_INIT:5e3,PAUSE_EAGER_PAGE_INIT:250};function le(d){return Object.values(GZ).includes(d)&&d!==GZ.DISABLE}var SZ,Lt,sn,uh;class MX{constructor(l){i(this,sn),i(this,SZ,new Set),i(this,Lt,0),m(this,Lt,l)}push(l){const U=W(this,SZ);U.has(l)&&U.delete(l),U.add(l),U.size>W(this,Lt)&&b(this,sn,uh).call(this)}resize(l,U=null){m(this,Lt,l);const Z=W(this,SZ);if(U){const F=Z.size;let t=1;for(const c of Z)if(U.has(c.id)&&(Z.delete(c),Z.add(c)),++t>F)break}for(;Z.size>W(this,Lt);)b(this,sn,uh).call(this)}has(l){return W(this,SZ).has(l)}[Symbol.iterator](){return W(this,SZ).keys()}}SZ=new WeakMap,Lt=new WeakMap,sn=new WeakSet,uh=function(){const d=W(this,SZ).keys().next().value;d==null||d.destroy(),W(this,SZ).delete(d)};var sF,Rn,Nn,VZ,$l,R0,DW,hn,bn,mn,zt,en,FW,mF,IW,Mn,tW,N0,pF,EW,oh,bM,yh,mM,kh,eM,d0,wW,CW,ns,Lh,Ue,Jn,Hi,zh,de,pd,QZ,Gn,Dh,Ih,MM,Eh,JM,ss,wh,Ch,GM;class TM{constructor(l){i(this,oh),i(this,yh),i(this,kh),i(this,d0),i(this,CW),i(this,Lh),i(this,Jn),i(this,zh),i(this,pd),i(this,Gn),i(this,Ih),i(this,Eh),i(this,ss),i(this,Ch),i(this,sF,null),i(this,Rn,null),i(this,Nn,null),i(this,VZ,GZ.NONE),i(this,$l,null),i(this,R0,Id.ENABLE_FORMS),i(this,DW,null),i(this,hn,!1),i(this,bn,!1),i(this,mn,!1),i(this,zt,null),i(this,en,null),i(this,FW,!1),i(this,mF,null),i(this,IW,!1),i(this,Mn,0),i(this,tW,new ResizeObserver(b(this,Ch,GM).bind(this))),i(this,N0,null),i(this,pF,null),i(this,EW,Fd.ENABLE);var U,Z;const F="4.4.168";if(Bm!==F)throw new Error(`The API version "${Bm}" does not match the Viewer version "${F}".`);if(this.container=l.container,this.viewer=l.viewer||l.container.firstElementChild,((U=this.container)==null?void 0:U.tagName)!=="DIV"||((Z=this.viewer)==null?void 0:Z.tagName)!=="DIV")throw new Error("Invalid `container` and/or `viewer` option.");if(this.container.offsetParent&&getComputedStyle(this.container).position!=="absolute")throw new Error("The `container` must be absolutely positioned.");W(this,tW).observe(this.container),this.eventBus=l.eventBus,this.linkService=l.linkService||new qh,this.downloadManager=l.downloadManager||null,this.findController=l.findController||null,m(this,Rn,l.altTextManager||null),this.findController&&(this.findController.onIsPageVisible=c=>this._getVisiblePages().ids.has(c)),this._scriptingManager=l.scriptingManager||null,m(this,EW,l.textLayerMode??Fd.ENABLE),m(this,R0,l.annotationMode??Id.ENABLE_FORMS),m(this,VZ,l.annotationEditorMode??GZ.NONE),m(this,Nn,l.annotationEditorHighlightColors||null),m(this,bn,l.enableHighlightFloatingButton===!0),this.imageResourcesPath=l.imageResourcesPath||"",this.enablePrintAutoRotate=l.enablePrintAutoRotate||!1,this.removePageBorders=l.removePageBorders||!1,this.maxCanvasPixels=l.maxCanvasPixels,this.l10n=l.l10n,this.l10n||(this.l10n=new Xs),m(this,mn,l.enablePermissions||!1),this.pageColors=l.pageColors||null,m(this,en,l.mlManager||null),m(this,hn,l.enableHWA||!1),this.defaultRenderingQueue=!l.renderingQueue,this.defaultRenderingQueue?(this.renderingQueue=new eX,this.renderingQueue.setViewer(this)):this.renderingQueue=l.renderingQueue;const{abortSignal:t}=l;t==null||t.addEventListener("abort",()=>{W(this,tW).disconnect(),m(this,tW,null)},{once:!0}),this.scroll=hT(this.container,this._scrollUpdate.bind(this),t),this.presentationModeState=n0.UNKNOWN,this._resetView(),this.removePageBorders&&this.viewer.classList.add("removePageBorders"),b(this,ss,wh).call(this),this.eventBus._on("thumbnailrendered",({pageNumber:c,pdfPage:V})=>{const Q=this._pages[c-1];W(this,sF).has(Q)||V==null||V.cleanup()}),l.l10n||this.l10n.translate(this.container)}get pagesCount(){return this._pages.length}getPageView(l){return this._pages[l]}getCachedPageViews(){return new Set(W(this,sF))}get pageViewsReady(){return this._pages.every(l=>l==null?void 0:l.pdfPage)}get renderForms(){return W(this,R0)===Id.ENABLE_FORMS}get enableScripting(){return!!this._scriptingManager}get currentPageNumber(){return this._currentPageNumber}set currentPageNumber(l){if(!Number.isInteger(l))throw new Error("Invalid page number.");this.pdfDocument&&(this._setCurrentPageNumber(l,!0)||console.error(`currentPageNumber: "${l}" is not a valid page.`))}_setCurrentPageNumber(l,U=!1){var Z;if(this._currentPageNumber===l)return U&&b(this,Gn,Dh).call(this),!0;if(!(0<l&&l<=this.pagesCount))return!1;const F=this._currentPageNumber;return this._currentPageNumber=l,this.eventBus.dispatch("pagechanging",{source:this,pageNumber:l,pageLabel:((Z=this._pageLabels)==null?void 0:Z[l-1])??null,previous:F}),U&&b(this,Gn,Dh).call(this),!0}get currentPageLabel(){var l;return((l=this._pageLabels)==null?void 0:l[this._currentPageNumber-1])??null}set currentPageLabel(l){if(!this.pdfDocument)return;let U=l|0;if(this._pageLabels){const Z=this._pageLabels.indexOf(l);Z>=0&&(U=Z+1)}this._setCurrentPageNumber(U,!0)||console.error(`currentPageLabel: "${l}" is not a valid page.`)}get currentScale(){return this._currentScale!==pi?this._currentScale:E2}set currentScale(l){if(isNaN(l))throw new Error("Invalid numeric scale.");this.pdfDocument&&b(this,pd,QZ).call(this,l,{noScroll:!1})}get currentScaleValue(){return this._currentScaleValue}set currentScaleValue(l){this.pdfDocument&&b(this,pd,QZ).call(this,l,{noScroll:!1})}get pagesRotation(){return this._pagesRotation}set pagesRotation(l){if(!r2(l))throw new Error("Invalid pages rotation angle.");if(!this.pdfDocument||(l%=360,l<0&&(l+=360),this._pagesRotation===l))return;this._pagesRotation=l;const U=this._currentPageNumber;this.refresh(!0,{rotation:l}),this._currentScaleValue&&b(this,pd,QZ).call(this,this._currentScaleValue,{noScroll:!0}),this.eventBus.dispatch("rotationchanging",{source:this,pagesRotation:l,pageNumber:U}),this.defaultRenderingQueue&&this.update()}get firstPagePromise(){return this.pdfDocument?this._firstPageCapability.promise:null}get onePageRendered(){return this.pdfDocument?this._onePageRenderedCapability.promise:null}get pagesPromise(){return this.pdfDocument?this._pagesCapability.promise:null}get _layerProperties(){const l=this;return Zs(this,"_layerProperties",{get annotationEditorUIManager(){return W(l,$l)},get annotationStorage(){var U;return(U=l.pdfDocument)==null?void 0:U.annotationStorage},get downloadManager(){return l.downloadManager},get enableScripting(){return!!l._scriptingManager},get fieldObjectsPromise(){var U;return(U=l.pdfDocument)==null?void 0:U.getFieldObjects()},get findController(){return l.findController},get hasJSActionsPromise(){var U;return(U=l.pdfDocument)==null?void 0:U.hasJSActions()},get linkService(){return l.linkService}})}async getAllText(){const l=[],U=[];for(let Z=1,F=this.pdfDocument.numPages;Z<=F;++Z){if(W(this,IW))return null;U.length=0;const t=await this.pdfDocument.getPage(Z),{items:c}=await t.getTextContent();for(const V of c)V.str&&U.push(V.str),V.hasEOL&&U.push(`
|
|
304
304
|
`);l.push(ds(U.join("")))}return l.join(`
|
|
305
|
-
`)}setDocument(l){var U,Z;if(this.pdfDocument&&(this.eventBus.dispatch("pagesdestroy",{source:this}),this._cancelRendering(),this._resetView(),(U=this.findController)==null||U.setDocument(null),(Z=this._scriptingManager)==null||Z.setDocument(null),W(this,$l)&&(W(this,$l).destroy(),m(this,$l,null))),this.pdfDocument=l,!l)return;const F=l.numPages,t=l.getPage(1),c=l.getOptionalContentConfig({intent:"display"}),V=W(this,mn)?l.getPermissions():Promise.resolve(),{eventBus:Q,pageColors:a,viewer:n}=this;m(this,zt,new AbortController);const{signal:s}=W(this,zt);if(F>hQ.FORCE_SCROLL_MODE_PAGE){console.warn("Forcing PAGE-scrolling for performance reasons, given the length of the document.");const h=this._scrollMode=q.PAGE;Q.dispatch("scrollmodechanged",{source:this,mode:h})}this._pagesCapability.promise.then(()=>{Q.dispatch("pagesloaded",{source:this,pagesCount:F})},()=>{});const R=h=>{const e=this._pages[h.pageNumber-1];e&&W(this,sF).push(e)};Q._on("pagerender",R,{signal:s});const N=h=>{h.cssTransform||(this._onePageRenderedCapability.resolve({timestamp:h.timestamp}),Q._off("pagerendered",N))};Q._on("pagerendered",N,{signal:s}),Promise.all([t,V]).then(([h,e])=>{var M;if(l!==this.pdfDocument)return;this._firstPageCapability.resolve(h),this._optionalContentConfigPromise=c;const{annotationEditorMode:J,annotationMode:G,textLayerMode:T}=b(this,oh,bM).call(this,e);if(T!==Fd.DISABLE){const B=m(this,mF,document.createElement("div"));B.id="hiddenCopyElement",n.before(B)}if(J!==GZ.DISABLE){const B=J;l.isPureXfa?console.warn("Warning: XFA-editing is not implemented."):le(B)?(m(this,$l,new AT(this.container,n,W(this,Rn),Q,l,a,W(this,Nn),W(this,bn),W(this,en))),Q.dispatch("annotationeditoruimanager",{source:this,uiManager:W(this,$l)}),B!==GZ.NONE&&W(this,$l).updateMode(B)):console.error(`Invalid AnnotationEditor mode: ${B}`)}const p=this._scrollMode===q.PAGE?null:n,S=this.currentScale,X=h.getViewport({scale:S*zd.PDF_TO_CSS_UNITS});n.style.setProperty("--scale-factor",X.scale),((a==null?void 0:a.foreground)==="CanvasText"||(a==null?void 0:a.background)==="Canvas")&&(n.style.setProperty("--hcm-highlight-filter",l.filterFactory.addHighlightHCMFilter("highlight","CanvasText","Canvas","HighlightText","Highlight")),n.style.setProperty("--hcm-highlight-selected-filter",l.filterFactory.addHighlightHCMFilter("highlight_selected","CanvasText","Canvas","HighlightText","ButtonText")));for(let B=1;B<=F;++B){const k=new RM({container:p,eventBus:Q,id:B,scale:S,defaultViewport:X.clone(),optionalContentConfigPromise:c,renderingQueue:this.renderingQueue,textLayerMode:T,annotationMode:G,imageResourcesPath:this.imageResourcesPath,maxCanvasPixels:this.maxCanvasPixels,pageColors:a,l10n:this.l10n,layerProperties:this._layerProperties,enableHWA:W(this,hn)});this._pages.push(k)}(M=this._pages[0])==null||M.setPdfPage(h),this._scrollMode===q.PAGE?b(this,d0,wW).call(this):this._spreadMode!==Pl.NONE&&this._updateSpreadMode(),b(this,yh,mM).call(this,s).then(async()=>{var B,k;if(l!==this.pdfDocument)return;if((B=this.findController)==null||B.setDocument(l),(k=this._scriptingManager)==null||k.setDocument(l),W(this,mF)&&document.addEventListener("copy",b(this,kh,eM).bind(this,T),{signal:s}),W(this,$l)&&Q.dispatch("annotationeditormodechanged",{source:this,mode:W(this,VZ)}),l.loadingParams.disableAutoFetch||F>hQ.FORCE_LAZY_PAGE_INIT){this._pagesCapability.resolve();return}let Y=F-1;if(Y<=0){this._pagesCapability.resolve();return}for(let o=2;o<=F;++o){const y=l.getPage(o).then(D=>{const I=this._pages[o-1];I.pdfPage||I.setPdfPage(D),--Y===0&&this._pagesCapability.resolve()},D=>{console.error(`Unable to get page ${o} to initialize viewer`,D),--Y===0&&this._pagesCapability.resolve()});o%hQ.PAUSE_EAGER_PAGE_INIT===0&&await y}}),Q.dispatch("pagesinit",{source:this}),l.getMetadata().then(({info:B})=>{l===this.pdfDocument&&B.Language&&(n.lang=B.Language)}),this.defaultRenderingQueue&&this.update()}).catch(h=>{console.error("Unable to initialize viewer",h),this._pagesCapability.reject(h)})}setPageLabels(l){var U;if(this.pdfDocument){l?Array.isArray(l)&&this.pdfDocument.numPages===l.length?this._pageLabels=l:(this._pageLabels=null,console.error("setPageLabels: Invalid page labels.")):this._pageLabels=null;for(let Z=0,F=this._pages.length;Z<F;Z++)this._pages[Z].setPageLabel(((U=this._pageLabels)==null?void 0:U[Z])??null)}}_resetView(){var l,U;this._pages=[],this._currentPageNumber=1,this._currentScale=pi,this._currentScaleValue=null,this._pageLabels=null,m(this,sF,new MX($m)),this._location=null,this._pagesRotation=0,this._optionalContentConfigPromise=null,this._firstPageCapability=Promise.withResolvers(),this._onePageRenderedCapability=Promise.withResolvers(),this._pagesCapability=Promise.withResolvers(),this._scrollMode=q.VERTICAL,this._previousScrollMode=q.UNKNOWN,this._spreadMode=Pl.NONE,m(this,N0,{previousPageNumber:1,scrollDown:!0,pages:[]}),(l=W(this,zt))==null||l.abort(),m(this,zt,null),this.viewer.textContent="",this._updateScrollMode(),this.viewer.removeAttribute("lang"),(U=W(this,mF))==null||U.remove(),m(this,mF,null)}_scrollUpdate(){this.pagesCount!==0&&this.update()}pageLabelToPageNumber(l){if(!this._pageLabels)return null;const U=this._pageLabels.indexOf(l);return U<0?null:U+1}scrollPageIntoView({pageNumber:l,destArray:U=null,allowNegativeOffset:Z=!1,ignoreDestinationZoom:F=!1}){if(!this.pdfDocument)return;const t=Number.isInteger(l)&&this._pages[l-1];if(!t){console.error(`scrollPageIntoView: "${l}" is not a valid pageNumber parameter.`);return}if(this.isInPresentationMode||!U){this._setCurrentPageNumber(l,!0);return}let c=0,V=0,Q=0,a=0,n,s;const R=t.rotation%180!==0,N=(R?t.height:t.width)/t.scale/zd.PDF_TO_CSS_UNITS,h=(R?t.width:t.height)/t.scale/zd.PDF_TO_CSS_UNITS;let e=0;switch(U[1].name){case"XYZ":c=U[2],V=U[3],e=U[4],c=c!==null?c:0,V=V!==null?V:h;break;case"Fit":case"FitB":e="page-fit";break;case"FitH":case"FitBH":V=U[2],e="page-width",V===null&&this._location?(c=this._location.left,V=this._location.top):(typeof V!="number"||V<0)&&(V=h);break;case"FitV":case"FitBV":c=U[2],Q=N,a=h,e="page-height";break;case"FitR":c=U[2],V=U[3],Q=U[4]-c,a=U[5]-V;let T=w2,p=C2;this.removePageBorders&&(T=p=0),n=(this.container.clientWidth-T)/Q/zd.PDF_TO_CSS_UNITS,s=(this.container.clientHeight-p)/a/zd.PDF_TO_CSS_UNITS,e=Math.min(Math.abs(n),Math.abs(s));break;default:console.error(`scrollPageIntoView: "${U[1].name}" is not a valid destination type.`);return}if(F||(e&&e!==this._currentScale?this.currentScaleValue=e:this._currentScale===pi&&(this.currentScaleValue=nT)),e==="page-fit"&&!U[4]){b(this,CW,ns).call(this,t);return}const M=[t.viewport.convertToViewportPoint(c,V),t.viewport.convertToViewportPoint(c+Q,V+a)];let J=Math.min(M[0][0],M[1][0]),G=Math.min(M[0][1],M[1][1]);Z||(J=Math.max(J,0),G=Math.max(G,0)),b(this,CW,ns).call(this,t,{left:J,top:G})}_updateLocation(l){const U=this._currentScale,Z=this._currentScaleValue,F=parseFloat(Z)===U?Math.round(U*1e4)/100:Z,t=l.id,c=this._pages[t-1],V=this.container,Q=c.getPagePoint(V.scrollLeft-l.x,V.scrollTop-l.y),a=Math.round(Q[0]),n=Math.round(Q[1]);let s=`#page=${t}`;this.isInPresentationMode||(s+=`&zoom=${F},${a},${n}`),this._location={pageNumber:t,scale:F,top:n,left:a,rotation:this._pagesRotation,pdfOpenParams:s}}update(){const l=this._getVisiblePages(),U=l.views,Z=U.length;if(Z===0)return;const F=Math.max($m,2*Z+1);W(this,sF).resize(F,l.ids),this.renderingQueue.renderHighestPriority(l);const t=this._spreadMode===Pl.NONE&&(this._scrollMode===q.PAGE||this._scrollMode===q.VERTICAL),c=this._currentPageNumber;let V=!1;for(const Q of U){if(Q.percent<100)break;if(Q.id===c&&t){V=!0;break}}this._setCurrentPageNumber(V?c:U[0].id),this._updateLocation(l.first),this.eventBus.dispatch("updateviewarea",{source:this,location:this._location})}containsElement(l){return this.container.contains(l)}focus(){this.container.focus()}get _isContainerRtl(){return getComputedStyle(this.container).direction==="rtl"}get isInPresentationMode(){return this.presentationModeState===n0.FULLSCREEN}get isChangingPresentationMode(){return this.presentationModeState===n0.CHANGING}get isHorizontalScrollbarEnabled(){return this.isInPresentationMode?!1:this.container.scrollWidth>this.container.clientWidth}get isVerticalScrollbarEnabled(){return this.isInPresentationMode?!1:this.container.scrollHeight>this.container.clientHeight}_getVisiblePages(){const l=this._scrollMode===q.PAGE?W(this,N0).pages:this._pages,U=this._scrollMode===q.HORIZONTAL,Z=U&&this._isContainerRtl;return mT({scrollEl:this.container,views:l,sortByVisibility:!0,horizontal:U,rtl:Z})}cleanup(){for(const l of this._pages)l.renderingState!==il.FINISHED&&l.reset()}_cancelRendering(){for(const l of this._pages)l.cancelRendering()}forceRendering(l){const U=l||this._getVisiblePages(),Z=b(this,Eh,JM).call(this,U),F=this._spreadMode!==Pl.NONE&&this._scrollMode!==q.HORIZONTAL,t=this.renderingQueue.getHighestPriority(U,this._pages,Z,F);return t?(b(this,Ih,MM).call(this,t).then(()=>{this.renderingQueue.renderView(t)}),!0):!1}get hasEqualPageSizes(){const l=this._pages[0];for(let U=1,Z=this._pages.length;U<Z;++U){const F=this._pages[U];if(F.width!==l.width||F.height!==l.height)return!1}return!0}getPagesOverview(){let l;return this._pages.map(U=>{const Z=U.pdfPage.getViewport({scale:1}),F=j2(Z);if(l===void 0)l=F;else if(this.enablePrintAutoRotate&&F!==l)return{width:Z.height,height:Z.width,rotation:(Z.rotation-90)%360};return{width:Z.width,height:Z.height,rotation:Z.rotation}})}get optionalContentConfigPromise(){return this.pdfDocument?this._optionalContentConfigPromise?this._optionalContentConfigPromise:(console.error("optionalContentConfigPromise: Not initialized yet."),this.pdfDocument.getOptionalContentConfig({intent:"display"})):Promise.resolve(null)}set optionalContentConfigPromise(l){if(!(l instanceof Promise))throw new Error(`Invalid optionalContentConfigPromise: ${l}`);this.pdfDocument&&this._optionalContentConfigPromise&&(this._optionalContentConfigPromise=l,this.refresh(!1,{optionalContentConfigPromise:l}),this.eventBus.dispatch("optionalcontentconfigchanged",{source:this,promise:l}))}get scrollMode(){return this._scrollMode}set scrollMode(l){if(this._scrollMode!==l){if(!eT(l))throw new Error(`Invalid scroll mode: ${l}`);this.pagesCount>hQ.FORCE_SCROLL_MODE_PAGE||(this._previousScrollMode=this._scrollMode,this._scrollMode=l,this.eventBus.dispatch("scrollmodechanged",{source:this,mode:l}),this._updateScrollMode(this._currentPageNumber))}}_updateScrollMode(l=null){const U=this._scrollMode,Z=this.viewer;Z.classList.toggle("scrollHorizontal",U===q.HORIZONTAL),Z.classList.toggle("scrollWrapped",U===q.WRAPPED),!(!this.pdfDocument||!l)&&(U===q.PAGE?b(this,d0,wW).call(this):this._previousScrollMode===q.PAGE&&this._updateSpreadMode(),this._currentScaleValue&&isNaN(this._currentScaleValue)&&b(this,pd,QZ).call(this,this._currentScaleValue,{noScroll:!0}),this._setCurrentPageNumber(l,!0),this.update())}get spreadMode(){return this._spreadMode}set spreadMode(l){if(this._spreadMode!==l){if(!MT(l))throw new Error(`Invalid spread mode: ${l}`);this._spreadMode=l,this.eventBus.dispatch("spreadmodechanged",{source:this,mode:l}),this._updateSpreadMode(this._currentPageNumber)}}_updateSpreadMode(l=null){if(!this.pdfDocument)return;const U=this.viewer,Z=this._pages;if(this._scrollMode===q.PAGE)b(this,d0,wW).call(this);else if(U.textContent="",this._spreadMode===Pl.NONE)for(const F of this._pages)U.append(F.div);else{const F=this._spreadMode-1;let t=null;for(let c=0,V=Z.length;c<V;++c)t===null?(t=document.createElement("div"),t.className="spread",U.append(t)):c%2===F&&(t=t.cloneNode(!1),U.append(t)),t.append(Z[c].div)}l&&(this._currentScaleValue&&isNaN(this._currentScaleValue)&&b(this,pd,QZ).call(this,this._currentScaleValue,{noScroll:!0}),this._setCurrentPageNumber(l,!0),this.update())}_getPageAdvance(l,U=!1){switch(this._scrollMode){case q.WRAPPED:{const{views:Z}=this._getVisiblePages(),F=new Map;for(const{id:t,y:c,percent:V,widthPercent:Q}of Z){if(V===0||Q<100)continue;let a=F.get(c);a||F.set(c,a||(a=[])),a.push(t)}for(const t of F.values()){const c=t.indexOf(l);if(c===-1)continue;const V=t.length;if(V===1)break;if(U)for(let Q=c-1,a=0;Q>=a;Q--){const n=t[Q],s=t[Q+1]-1;if(n<s)return l-s}else for(let Q=c+1,a=V;Q<a;Q++){const n=t[Q],s=t[Q-1]+1;if(n>s)return s-l}if(U){const Q=t[0];if(Q<l)return l-Q+1}else{const Q=t[V-1];if(Q>l)return Q-l+1}break}break}case q.HORIZONTAL:break;case q.PAGE:case q.VERTICAL:{if(this._spreadMode===Pl.NONE)break;const Z=this._spreadMode-1;if(U&&l%2!==Z||!U&&l%2===Z)break;const{views:F}=this._getVisiblePages(),t=U?l-1:l+1;for(const{id:c,percent:V,widthPercent:Q}of F)if(c===t){if(V>0&&Q===100)return 2;break}break}}return 1}nextPage(){const l=this._currentPageNumber,U=this.pagesCount;if(l>=U)return!1;const Z=this._getPageAdvance(l,!1)||1;return this.currentPageNumber=Math.min(l+Z,U),!0}previousPage(){const l=this._currentPageNumber;if(l<=1)return!1;const U=this._getPageAdvance(l,!0)||1;return this.currentPageNumber=Math.max(l-U,1),!0}updateScale({drawingDelay:l,scaleFactor:U=null,steps:Z=null,origin:F}){if(Z===null&&U===null)throw new Error("Invalid updateScale options: either `steps` or `scaleFactor` must be provided.");if(!this.pdfDocument)return;let t=this._currentScale;if(U>0&&U!==1)t=Math.round(t*U*100)/100;else if(Z){const c=Z>0?Rm:1/Rm,V=Z>0?Math.ceil:Math.floor;Z=Math.abs(Z);do t=V((t*c).toFixed(2)*10)/10;while(--Z>0)}t=Math.max(sT,Math.min(iT,t)),b(this,pd,QZ).call(this,t,{noScroll:!1,drawingDelay:l,origin:F})}increaseScale(l={}){this.updateScale({...l,steps:l.steps??1})}decreaseScale(l={}){this.updateScale({...l,steps:-(l.steps??1)})}get containerTopLeft(){return W(this,DW)||m(this,DW,[this.container.offsetTop,this.container.offsetLeft])}get annotationEditorMode(){return W(this,$l)?W(this,VZ):GZ.DISABLE}set annotationEditorMode({mode:l,editId:U=null,isFromKeyboard:Z=!1}){if(!W(this,$l))throw new Error("The AnnotationEditor is not enabled.");if(W(this,VZ)!==l){if(!le(l))throw new Error(`Invalid AnnotationEditor mode: ${l}`);this.pdfDocument&&(m(this,VZ,l),this.eventBus.dispatch("annotationeditormodechanged",{source:this,mode:l}),W(this,$l).updateMode(l,U,Z))}}set annotationEditorParams({type:l,value:U}){if(!W(this,$l))throw new Error("The AnnotationEditor is not enabled.");W(this,$l).updateParams(l,U)}refresh(l=!1,U=Object.create(null)){if(this.pdfDocument){for(const Z of this._pages)Z.update(U);W(this,pF)!==null&&(clearTimeout(W(this,pF)),m(this,pF,null)),l||this.update()}}}sF=new WeakMap,Rn=new WeakMap,Nn=new WeakMap,VZ=new WeakMap,$l=new WeakMap,R0=new WeakMap,DW=new WeakMap,hn=new WeakMap,bn=new WeakMap,mn=new WeakMap,zt=new WeakMap,en=new WeakMap,FW=new WeakMap,mF=new WeakMap,IW=new WeakMap,Mn=new WeakMap,tW=new WeakMap,N0=new WeakMap,pF=new WeakMap,EW=new WeakMap,oh=new WeakSet,bM=function(d){const l={annotationEditorMode:W(this,VZ),annotationMode:W(this,R0),textLayerMode:W(this,EW)};return d&&(!d.includes(iQ.COPY)&&W(this,EW)===Fd.ENABLE&&(l.textLayerMode=Fd.ENABLE_PERMISSIONS),d.includes(iQ.MODIFY_CONTENTS)||(l.annotationEditorMode=GZ.DISABLE),!d.includes(iQ.MODIFY_ANNOTATIONS)&&!d.includes(iQ.FILL_INTERACTIVE_FORMS)&&W(this,R0)===Id.ENABLE_FORMS&&(l.annotationMode=Id.ENABLE)),l},yh=new WeakSet,mM=async function(d){if(document.visibilityState==="hidden"||!this.container.offsetParent||this._getVisiblePages().views.length===0)return;const l=Promise.withResolvers();function U(){document.visibilityState==="hidden"&&l.resolve()}document.addEventListener("visibilitychange",U,{signal:d}),await Promise.race([this._onePageRenderedCapability.promise,l.promise]),document.removeEventListener("visibilitychange",U)},kh=new WeakSet,eM=function(d,l){const U=document.getSelection(),{focusNode:Z,anchorNode:F}=U;if(F&&Z&&U.containsNode(W(this,mF))){if(W(this,FW)||d===Fd.ENABLE_PERMISSIONS){l.preventDefault(),l.stopPropagation();return}m(this,FW,!0);const{classList:t}=this.viewer;t.add("copyAll");const c=new AbortController;window.addEventListener("keydown",V=>m(this,IW,V.key==="Escape"),{signal:c.signal}),this.getAllText().then(async V=>{V!==null&&await navigator.clipboard.writeText(V)}).catch(V=>{console.warn(`Something goes wrong when extracting the text: ${V.message}`)}).finally(()=>{m(this,FW,!1),m(this,IW,!1),c.abort(),t.remove("copyAll")}),l.preventDefault(),l.stopPropagation()}},d0=new WeakSet,wW=function(){if(this._scrollMode!==q.PAGE)throw new Error("#ensurePageViewVisible: Invalid scrollMode value.");const d=this._currentPageNumber,l=W(this,N0),U=this.viewer;if(U.textContent="",l.pages.length=0,this._spreadMode===Pl.NONE&&!this.isInPresentationMode){const Z=this._pages[d-1];U.append(Z.div),l.pages.push(Z)}else{const Z=new Set,F=this._spreadMode-1;F===-1?Z.add(d-1):d%2!==F?(Z.add(d-1),Z.add(d)):(Z.add(d-2),Z.add(d-1));const t=document.createElement("div");if(t.className="spread",this.isInPresentationMode){const c=document.createElement("div");c.className="dummyPage",t.append(c)}for(const c of Z){const V=this._pages[c];V&&(t.append(V.div),l.pages.push(V))}U.append(t)}l.scrollDown=d>=l.previousPageNumber,l.previousPageNumber=d},CW=new WeakSet,ns=function(d,l=null){const{div:U,id:Z}=d;if(this._currentPageNumber!==Z&&this._setCurrentPageNumber(Z),this._scrollMode===q.PAGE&&(b(this,d0,wW).call(this),this.update()),!l&&!this.isInPresentationMode){const F=U.offsetLeft+U.clientLeft,t=F+U.clientWidth,{scrollLeft:c,clientWidth:V}=this.container;(this._scrollMode===q.HORIZONTAL||F<c||t>c+V)&&(l={left:0,top:0})}x2(U,l),!this._currentScaleValue&&this._location&&(this._location=null)},Lh=new WeakSet,Ue=function(d){return d===this._currentScale||Math.abs(d-this._currentScale)<1e-15},Jn=new WeakSet,Hi=function(d,l,{noScroll:U=!1,preset:Z=!1,drawingDelay:F=-1,origin:t=null}){if(this._currentScaleValue=l.toString(),b(this,Lh,Ue).call(this,d)){Z&&this.eventBus.dispatch("scalechanging",{source:this,scale:d,presetValue:l});return}this.viewer.style.setProperty("--scale-factor",d*zd.PDF_TO_CSS_UNITS);const c=F>=0&&F<1e3;this.refresh(!0,{scale:d,drawingDelay:c?F:-1}),c&&m(this,pF,setTimeout(()=>{m(this,pF,null),this.refresh()},F));const V=this._currentScale;if(this._currentScale=d,!U){let Q=this._currentPageNumber,a;if(this._location&&!(this.isInPresentationMode||this.isChangingPresentationMode)&&(Q=this._location.pageNumber,a=[null,{name:"XYZ"},this._location.left,this._location.top,null]),this.scrollPageIntoView({pageNumber:Q,destArray:a,allowNegativeOffset:!0}),Array.isArray(t)){const n=d/V-1,[s,R]=this.containerTopLeft;this.container.scrollLeft+=(t[0]-R)*n,this.container.scrollTop+=(t[1]-s)*n}}this.eventBus.dispatch("scalechanging",{source:this,scale:d,presetValue:Z?l:void 0}),this.defaultRenderingQueue&&this.update()},zh=new WeakSet,de=function(){return this._spreadMode!==Pl.NONE&&this._scrollMode!==q.HORIZONTAL?2:1},pd=new WeakSet,QZ=function(d,l){let U=parseFloat(d);if(U>0)l.preset=!1,b(this,Jn,Hi).call(this,U,d,l);else{const Z=this._pages[this._currentPageNumber-1];if(!Z)return;let F=w2,t=C2;this.isInPresentationMode?(F=t=4,this._spreadMode!==Pl.NONE&&(F*=2)):this.removePageBorders?F=t=0:this._scrollMode===q.HORIZONTAL&&([F,t]=[t,F]);const c=(this.container.clientWidth-F)/Z.width*Z.scale/W(this,zh,de),V=(this.container.clientHeight-t)/Z.height*Z.scale;switch(d){case"page-actual":U=1;break;case"page-width":U=c;break;case"page-height":U=V;break;case"page-fit":U=Math.min(c,V);break;case"auto":const Q=j2(Z)?c:Math.min(V,c);U=Math.min(RT,Q);break;default:console.error(`#setScale: "${d}" is an unknown zoom value.`);return}l.preset=!0,b(this,Jn,Hi).call(this,U,d,l)}},Gn=new WeakSet,Dh=function(){const d=this._pages[this._currentPageNumber-1];this.isInPresentationMode&&b(this,pd,QZ).call(this,this._currentScaleValue,{noScroll:!0}),b(this,CW,ns).call(this,d)},Ih=new WeakSet,MM=async function(d){if(d.pdfPage)return d.pdfPage;try{const l=await this.pdfDocument.getPage(d.id);return d.pdfPage||d.setPdfPage(l),l}catch(l){return console.error("Unable to get page for page view",l),null}},Eh=new WeakSet,JM=function(d){var l,U;if(((l=d.first)==null?void 0:l.id)===1)return!0;if(((U=d.last)==null?void 0:U.id)===this.pagesCount)return!1;switch(this._scrollMode){case q.PAGE:return W(this,N0).scrollDown;case q.HORIZONTAL:return this.scroll.right}return this.scroll.down},ss=new WeakSet,wh=function(d=this.container.clientHeight){d!==W(this,Mn)&&(m(this,Mn,d),JT.setProperty("--viewer-container-height",`${d}px`))},Ch=new WeakSet,GM=function(d){for(const l of d)if(l.target===this.container){b(this,ss,wh).call(this,Math.floor(l.borderBoxSize[0].blockSize)),m(this,DW,null);break}};class JX extends TM{_resetView(){super._resetView(),this._scrollMode=q.PAGE,this._spreadMode=Pl.NONE}set scrollMode(l){}_updateScrollMode(){}set spreadMode(l){}_updateSpreadMode(){}}sl.AnnotationLayerBuilder;sl.DownloadManager;sl.EventBus;sl.FindState;sl.GenericL10n;sl.LinkTarget;sl.PDFFindController;sl.PDFHistory;var GX=sl.PDFLinkService;sl.PDFPageView;sl.PDFScriptingManager;sl.PDFSinglePageViewer;sl.PDFViewer;sl.ProgressBar;sl.RenderingStates;sl.ScrollMode;sl.SimpleLinkService;sl.SpreadMode;sl.StructTreeLayerBuilder;sl.TextLayerBuilder;sl.XfaLayerBuilder;sl.parseQueryString;const TX=["id"],SX=["id"],XX=ce("canvas",null,null,-1),YX={key:0,class:"textLayer"},pX={key:1,class:"annotationLayer"},SM=pM({__name:"VuePdfEmbed",props:{annotationLayer:{type:Boolean},height:{},id:{},imageResourcesPath:{},page:{},rotation:{default:0},scale:{default:1},source:{},textLayer:{type:Boolean},width:{}},emits:["internal-link-clicked","loaded","loading-failed","password-requested","progress","rendered","rendering-failed"],setup(d,{expose:l,emit:U}){const Z=d,F=Sn([]),t=BM([]),c=Sn(null);let V=null;const{doc:Q}=I2({onError:J=>{F.value=[],U("loading-failed",J)},onPasswordRequest({callback:J,isWrongPassword:G}){U("password-requested",{callback:J,isWrongPassword:G})},onProgress:J=>{U("progress",J)},source:uM(Z,"source")}),a=oM(()=>{if(!Q.value||!Z.annotationLayer)return null;const J=new GX;return J.setDocument(Q.value),J.setViewer({scrollPageIntoView:({pageNumber:G})=>{U("internal-link-clicked",G)}}),J}),n=async J=>{if(!Q.value)return;const G=await Q.value.getData(),T=await Q.value.getMetadata(),p=J??T.contentDispositionFilename??"";aT(G,p)},s=J=>{let G,T;return Z.height&&!Z.width?(T=Z.height,G=T/J):(G=Z.width??c.value.clientWidth,T=G*J),[G,T]},R=async(J=300,G="",T=!1)=>{var p,S,X;if(!Q.value)return;const B=J/72,k=96/72;let Y,o,y;try{Y=window.document.createElement("div"),Y.style.display="none",window.document.body.appendChild(Y),o=await QT(Y);const D=Z.page&&!T?[Z.page]:[...Array(Q.value.numPages+1).keys()].slice(1);await Promise.all(D.map(async(I,j)=>{const x=await Q.value.getPage(I),u=x.getViewport({scale:1,rotation:0});if(j===0){const Wl=u.width*B/k,ml=u.height*B/k;VT(o,Wl,ml)}const E=window.document.createElement("canvas");E.width=u.width*B,E.height=u.height*B,Y.appendChild(E);const A=E.cloneNode();o.contentWindow.document.body.appendChild(A),await x.render({canvasContext:E.getContext("2d"),intent:"print",transform:[B,0,0,B,0,0],viewport:u}).promise,A.getContext("2d").drawImage(E,0,0)})),G&&(y=window.document.title,window.document.title=G),(p=o.contentWindow)==null||p.focus(),(S=o.contentWindow)==null||S.print()}finally{y&&(window.document.title=y),Yi(Y),(X=Y.parentNode)==null||X.removeChild(Y)}},N=async()=>{if(!(!Q.value||V!=null&&V.isAborted))try{F.value=Z.page?[Z.page]:[...Array(Q.value.numPages+1).keys()].slice(1),t.value=Array(F.value.length).fill(1),await Promise.all(F.value.map(async(J,G)=>{const T=await Q.value.getPage(J);if(V!=null&&V.isAborted)return;const p=((Z.rotation%90===0?Z.rotation:0)+T.rotate)%360,[S,X,B]=Array.from(c.value.getElementsByClassName("vue-pdf-embed__page")[G].children),k=!!(p/90%2),Y=T.view[2]-T.view[0],o=T.view[3]-T.view[1],[y,D]=s(k?Y/o:o/Y),I=`${Math.floor(y)}px`,j=`${Math.floor(D)}px`,x=y/(k?o:Y),u=T.getViewport({scale:x,rotation:p});t.value[G]=x,S.style.display="block",S.style.width=I,S.style.height=j;const E=[h(T,u.clone({scale:u.scale*window.devicePixelRatio*Z.scale}),S)];return Z.textLayer&&E.push(M(T,u.clone({dontFlip:!0}),X)),Z.annotationLayer&&E.push(e(T,u.clone({dontFlip:!0}),B||X)),Promise.all(E)})),V!=null&&V.isAborted||U("rendered")}catch(J){F.value=[],t.value=[],V!=null&&V.isAborted||U("rendering-failed",J)}},h=async(J,G,T)=>{T.width=G.width,T.height=G.height,await J.render({canvasContext:T.getContext("2d"),viewport:G}).promise},e=async(J,G,T)=>{sm(T),new ZT({accessibilityManager:null,annotationCanvasMap:null,annotationEditorUIManager:null,div:T,page:J,viewport:G}).render({annotations:await J.getAnnotations(),div:T,imageResourcesPath:Z.imageResourcesPath,linkService:a.value,page:J,renderForms:!1,viewport:G})},M=async(J,G,T)=>{sm(T),new tT({container:T,textContentSource:await J.getTextContent(),viewport:G}).render()};return Pi(Q,J=>{J&&U("loaded",J)},{immediate:!0}),Pi(()=>[Q.value,Z.annotationLayer,Z.height,Z.imageResourcesPath,Z.page,Z.rotation,Z.scale,Z.textLayer,Z.width],async([J])=>{J&&(V&&(V.isAborted=!0,await V.promise),Yi(c.value),V={isAborted:!1,promise:N()},await V.promise,V=null)},{immediate:!0}),te(()=>{Yi(c.value)}),l({doc:Q,download:n,print:R}),(J,G)=>(fF(),M0("div",{id:J.id,ref_key:"root",ref:c,class:"vue-pdf-embed"},[(fF(!0),M0(yM,null,kM(F.value,(T,p)=>(fF(),M0("div",{key:T},[Zb(J.$slots,"before-page",{page:T}),ce("div",{id:J.id&&`${J.id}-${T}`,class:"vue-pdf-embed__page",style:LM({"--scale-factor":t.value[p],position:"relative"})},[XX,J.textLayer?(fF(),M0("div",YX)):Fb("",!0),J.annotationLayer?(fF(),M0("div",pX)):Fb("",!0)],12,SX),Zb(J.$slots,"after-page",{page:T})]))),128))],8,TX))}});window!=null&&window.Vue&&(window.VuePdfEmbed=SM,window.useVuePdfEmbed=I2);Xi!=null&&Xi.workerSrc||(Xi.workerSrc=WT);const BX={},Fc=Object.freeze(Object.defineProperty({__proto__:null,default:BX},Symbol.toStringTag,{value:"Module"}));var tc={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},uX=/([astvzqmhlc])([^astvzqmhlc]*)/gi,oX=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi;function yX(d){const l=d.match(oX);return l?l.map(Number):[]}function XM(d){const l=[],U=String(d).trim();return U[0]!=="M"&&U[0]!=="m"||U.replace(uX,(Z,F,t)=>{const c=yX(t);let V=F.toLowerCase(),Q=F;if(V==="m"&&c.length>2&&(l.push([Q,...c.splice(0,2)]),V="l",Q=Q==="m"?"l":"L"),c.length<tc[V])return"";for(l.push([Q,...c.splice(0,tc[V])]);c.length>=tc[V]&&c.length&&tc[V];)l.push([Q,...c.splice(0,tc[V])]);return""}),l}function Ze(d,l){const U=d.x*Math.cos(l)-d.y*Math.sin(l),Z=d.y*Math.cos(l)+d.x*Math.sin(l);d.x=U,d.y=Z}function kX(d,l,U){d.x+=l,d.y+=U}function Fe(d,l){d.x*=l,d.y*=l}var Tn=class xh{constructor(l){this.commands=[],l&&l instanceof xh?this.commands.push(...l.commands):l&&(this.commands=XM(l))}addPath(l){l&&l instanceof xh&&this.commands.push(...l.commands)}moveTo(l,U){this.commands.push(["M",l,U])}lineTo(l,U){this.commands.push(["L",l,U])}arc(l,U,Z,F,t,c){this.commands.push(["AC",l,U,Z,F,t,!!c])}arcTo(l,U,Z,F,t){this.commands.push(["AT",l,U,Z,F,t])}ellipse(l,U,Z,F,t,c,V,Q){this.commands.push(["E",l,U,Z,F,t,c,V,!!Q])}closePath(){this.commands.push(["Z"])}bezierCurveTo(l,U,Z,F,t,c){this.commands.push(["C",l,U,Z,F,t,c])}quadraticCurveTo(l,U,Z,F){this.commands.push(["Q",l,U,Z,F])}rect(l,U,Z,F){this.commands.push(["R",l,U,Z,F])}roundRect(l,U,Z,F,t){typeof t>"u"?this.commands.push(["RR",l,U,Z,F,0]):this.commands.push(["RR",l,U,Z,F,t])}};function cW(d,l){let U=0,Z=0,F,t,c,V,Q,a,n,s,R,N,h,e,M,J,G,T,p,S,X,B,k,Y=null,o=null,y=null,D=null,I=null,j=null;d.beginPath();for(let x=0;x<l.length;++x){S=l[x][0],S!=="S"&&S!=="s"&&S!=="C"&&S!=="c"&&(Y=null,o=null),S!=="T"&&S!=="t"&&S!=="Q"&&S!=="q"&&(y=null,D=null);let u;switch(S){case"m":case"M":u=l[x],S==="m"?(U+=u[1],Z+=u[2]):(U=u[1],Z=u[2]),(S==="M"||!I)&&(I={x:U,y:Z}),d.moveTo(U,Z);break;case"l":u=l[x],U+=u[1],Z+=u[2],d.lineTo(U,Z);break;case"L":u=l[x],U=u[1],Z=u[2],d.lineTo(U,Z);break;case"H":u=l[x],U=u[1],d.lineTo(U,Z);break;case"h":u=l[x],U+=u[1],d.lineTo(U,Z);break;case"V":u=l[x],Z=u[1],d.lineTo(U,Z);break;case"v":u=l[x],Z+=u[1],d.lineTo(U,Z);break;case"a":case"A":if(u=l[x],j===null)throw new Error("This should never happen");S==="a"?(U+=u[6],Z+=u[7]):(U=u[6],Z=u[7]),J=u[1],G=u[2],n=u[3]*Math.PI/180,c=!!u[4],V=!!u[5],Q={x:U,y:Z},a={x:(j.x-Q.x)/2,y:(j.y-Q.y)/2},Ze(a,-n),s=a.x*a.x/(J*J)+a.y*a.y/(G*G),s>1&&(s=Math.sqrt(s),J*=s,G*=s),X={x:J*a.y/G,y:-(G*a.x)/J},R=J*J*G*G,N=J*J*a.y*a.y+G*G*a.x*a.x,V!==c?Fe(X,Math.sqrt((R-N)/N)||0):Fe(X,-Math.sqrt((R-N)/N)||0),t=Math.atan2((a.y-X.y)/G,(a.x-X.x)/J),F=Math.atan2(-(a.y+X.y)/G,-(a.x+X.x)/J),Ze(X,n),kX(X,(Q.x+j.x)/2,(Q.y+j.y)/2),d.save(),d.translate(X.x,X.y),d.rotate(n),d.scale(J,G),d.arc(0,0,1,t,F,!V),d.restore();break;case"C":u=l[x],Y=u[3],o=u[4],U=u[5],Z=u[6],d.bezierCurveTo(u[1],u[2],Y,o,U,Z);break;case"c":u=l[x],d.bezierCurveTo(u[1]+U,u[2]+Z,u[3]+U,u[4]+Z,u[5]+U,u[6]+Z),Y=u[3]+U,o=u[4]+Z,U+=u[5],Z+=u[6];break;case"S":u=l[x],(Y===null||o===null)&&(Y=U,o=Z),d.bezierCurveTo(2*U-Y,2*Z-o,u[1],u[2],u[3],u[4]),Y=u[1],o=u[2],U=u[3],Z=u[4];break;case"s":u=l[x],(Y===null||o===null)&&(Y=U,o=Z),d.bezierCurveTo(2*U-Y,2*Z-o,u[1]+U,u[2]+Z,u[3]+U,u[4]+Z),Y=u[1]+U,o=u[2]+Z,U+=u[3],Z+=u[4];break;case"Q":u=l[x],y=u[1],D=u[2],U=u[3],Z=u[4],d.quadraticCurveTo(y,D,U,Z);break;case"q":u=l[x],y=u[1]+U,D=u[2]+Z,U+=u[3],Z+=u[4],d.quadraticCurveTo(y,D,U,Z);break;case"T":u=l[x],(y===null||D===null)&&(y=U,D=Z),y=2*U-y,D=2*Z-D,U=u[1],Z=u[2],d.quadraticCurveTo(y,D,U,Z);break;case"t":u=l[x],(y===null||D===null)&&(y=U,D=Z),y=2*U-y,D=2*Z-D,U+=u[1],Z+=u[2],d.quadraticCurveTo(y,D,U,Z);break;case"z":case"Z":I&&(U=I.x,Z=I.y),I=null,d.closePath();break;case"AC":u=l[x],U=u[1],Z=u[2],M=u[3],t=u[4],F=u[5],B=u[6],d.arc(U,Z,M,t,F,B);break;case"AT":u=l[x],h=u[1],e=u[2],U=u[3],Z=u[4],M=u[5],d.arcTo(h,e,U,Z,M);break;case"E":u=l[x],U=u[1],Z=u[2],J=u[3],G=u[4],n=u[5],t=u[6],F=u[7],B=u[8],d.save(),d.translate(U,Z),d.rotate(n),d.scale(J,G),d.arc(0,0,1,t,F,B),d.restore();break;case"R":u=l[x],U=u[1],Z=u[2],T=u[3],p=u[4],I={x:U,y:Z},d.rect(U,Z,T,p);break;case"RR":u=l[x],U=u[1],Z=u[2],T=u[3],p=u[4],k=u[5],I={x:U,y:Z},d.roundRect(U,Z,T,p,k);break;default:throw new Error(`Invalid path command: ${S}`)}j?(j.x=U,j.y=Z):j={x:U,y:Z}}}function lb(d,l,U,Z,F=0){if(typeof F=="number"&&(F=[F]),Array.isArray(F)){if(F.length===0||F.length>4)throw new RangeError(`Failed to execute 'roundRect' on '${this.constructor.name}': ${F.length} radii provided. Between one and four radii are necessary.`);F.forEach(n=>{if(n<0)throw new RangeError(`Failed to execute 'roundRect' on '${this.constructor.name}': Radius value ${n} is negative.`)})}else return;if(F.length===1&&F[0]===0){this.rect(d,l,U,Z);return}const t=Math.min(U,Z)/2,c=Math.min(t,F[0]);let V=c,Q=c,a=c;F.length===2&&(V=Math.min(t,F[1]),a=V),F.length===3&&(V=Math.min(t,F[1]),a=V,Q=Math.min(t,F[2])),F.length===4&&(V=Math.min(t,F[1]),Q=Math.min(t,F[2]),a=Math.min(t,F[3])),this.moveTo(d,l+Z-a),this.arcTo(d,l,d+c,l,c),this.arcTo(d+U,l,d+U,l+V,V),this.arcTo(d+U,l+Z,d+U-Q,l+Z,Q),this.arcTo(d,l+Z,d,l+Z-a,a),this.moveTo(d,l)}function LX(d){if(!d)return;const l=d.prototype.clip,U=d.prototype.fill,Z=d.prototype.stroke,F=d.prototype.isPointInPath;d.prototype.clip=function(...t){if(t[0]instanceof Tn){const V=t[0],Q=t[1]||"nonzero";return cW(this,V.commands),l.apply(this,[Q])}const c=t[0]||"nonzero";return l.apply(this,[c])},d.prototype.fill=function(...t){if(t[0]instanceof Tn){const V=t[0],Q=t[1]||"nonzero";return cW(this,V.commands),U.apply(this,[Q])}const c=t[0]||"nonzero";return U.apply(this,[c])},d.prototype.stroke=function(t){t&&cW(this,t.commands),Z.apply(this)},d.prototype.isPointInPath=function(...t){if(t[0]instanceof Tn){const c=t[0],V=t[1],Q=t[2],a=t[3]||"nonzero";return cW(this,c.commands),F.apply(this,[V,Q,a])}return F.apply(this,t)}}function zX(d){d&&!d.prototype.roundRect&&(d.prototype.roundRect=lb)}function DX(d){d&&!d.prototype.roundRect&&(d.prototype.roundRect=lb)}const IX=Object.freeze(Object.defineProperty({__proto__:null,Path2D:Tn,applyPath2DToCanvasRenderingContext:LX,applyRoundRectToCanvasRenderingContext2D:zX,applyRoundRectToPath2D:DX,buildPath:cW,parsePath:XM,roundRect:lb},Symbol.toStringTag,{value:"Module"})),EX={name:"PDFDoc",components:{VuePdfEmbed:SM},props:{book:{type:Object,required:!0},page:{type:Number,required:!0},src:{type:String,required:!0}},emits:["load","error","unauthorized"],data(){return{innerHeight:window.innerHeight,innerWidth:window.innerWidth}},computed:{...DM(tb,{scale:d=>d.clientSettings.scale}),bookSettings(){return this.getBookSettings(this.book)},isVertical(){return IM.has(this.bookSettings.readingDirection)},width(){let d=["W","O"].includes(this.bookSettings.fitTo)?this.innerWidth:0;return!this.isVertical&&this.bookSettings.twoPages&&(d=d/2),d*this.scale},height(){let d=["H","S"].includes(this.bookSettings.fitTo)?this.innerHeight:0;return this.isVertical&&(d=d*.8),d*this.scale},classes(){return this.bookSettings.fitToClass}},mounted(){window.addEventListener("resize",this.onResize)},beforeUnmount(){window.removeEventListener("resize",this.onResize)},methods:{...EM(tb,["getBookSettings","routeToPage"]),onResize(){this.innerHeight=window.innerHeight,this.innerWidth=window.innerWidth},onLoad(){this.$emit("load")},onLinkClicked(d){this.routeToPage(d)},onError(d){console.error(d),this.$emit("error")},onUnauthorized(){this.$emit("unauthorized")}}};function wX(d,l,U,Z,F,t){const c=wM("vue-pdf-embed");return fF(),CM(c,{class:xM(["pdfDoc",t.classes]),"image-resources-path":"https://unpkg.com/pdfjs-dist/web/images/",page:U.page,source:U.src,width:t.width,height:t.height,onRendered:t.onLoad,onInternalLinkClicked:t.onLinkClicked,onLoadingFailed:t.onError,onRenderingFailed:t.onError,onPasswordRequested:t.onUnauthorized},null,8,["class","page","source","width","height","onRendered","onInternalLinkClicked","onLoadingFailed","onRenderingFailed","onPasswordRequested"])}const RY=zM(EX,[["render",wX],["__scopeId","data-v-538aa37c"]]);export{RY as default};
|
|
305
|
+
`)}setDocument(l){var U,Z;if(this.pdfDocument&&(this.eventBus.dispatch("pagesdestroy",{source:this}),this._cancelRendering(),this._resetView(),(U=this.findController)==null||U.setDocument(null),(Z=this._scriptingManager)==null||Z.setDocument(null),W(this,$l)&&(W(this,$l).destroy(),m(this,$l,null))),this.pdfDocument=l,!l)return;const F=l.numPages,t=l.getPage(1),c=l.getOptionalContentConfig({intent:"display"}),V=W(this,mn)?l.getPermissions():Promise.resolve(),{eventBus:Q,pageColors:a,viewer:n}=this;m(this,zt,new AbortController);const{signal:s}=W(this,zt);if(F>hQ.FORCE_SCROLL_MODE_PAGE){console.warn("Forcing PAGE-scrolling for performance reasons, given the length of the document.");const h=this._scrollMode=q.PAGE;Q.dispatch("scrollmodechanged",{source:this,mode:h})}this._pagesCapability.promise.then(()=>{Q.dispatch("pagesloaded",{source:this,pagesCount:F})},()=>{});const R=h=>{const e=this._pages[h.pageNumber-1];e&&W(this,sF).push(e)};Q._on("pagerender",R,{signal:s});const N=h=>{h.cssTransform||(this._onePageRenderedCapability.resolve({timestamp:h.timestamp}),Q._off("pagerendered",N))};Q._on("pagerendered",N,{signal:s}),Promise.all([t,V]).then(([h,e])=>{var M;if(l!==this.pdfDocument)return;this._firstPageCapability.resolve(h),this._optionalContentConfigPromise=c;const{annotationEditorMode:J,annotationMode:G,textLayerMode:T}=b(this,oh,bM).call(this,e);if(T!==Fd.DISABLE){const B=m(this,mF,document.createElement("div"));B.id="hiddenCopyElement",n.before(B)}if(J!==GZ.DISABLE){const B=J;l.isPureXfa?console.warn("Warning: XFA-editing is not implemented."):le(B)?(m(this,$l,new AT(this.container,n,W(this,Rn),Q,l,a,W(this,Nn),W(this,bn),W(this,en))),Q.dispatch("annotationeditoruimanager",{source:this,uiManager:W(this,$l)}),B!==GZ.NONE&&W(this,$l).updateMode(B)):console.error(`Invalid AnnotationEditor mode: ${B}`)}const p=this._scrollMode===q.PAGE?null:n,S=this.currentScale,X=h.getViewport({scale:S*zd.PDF_TO_CSS_UNITS});n.style.setProperty("--scale-factor",X.scale),((a==null?void 0:a.foreground)==="CanvasText"||(a==null?void 0:a.background)==="Canvas")&&(n.style.setProperty("--hcm-highlight-filter",l.filterFactory.addHighlightHCMFilter("highlight","CanvasText","Canvas","HighlightText","Highlight")),n.style.setProperty("--hcm-highlight-selected-filter",l.filterFactory.addHighlightHCMFilter("highlight_selected","CanvasText","Canvas","HighlightText","ButtonText")));for(let B=1;B<=F;++B){const k=new RM({container:p,eventBus:Q,id:B,scale:S,defaultViewport:X.clone(),optionalContentConfigPromise:c,renderingQueue:this.renderingQueue,textLayerMode:T,annotationMode:G,imageResourcesPath:this.imageResourcesPath,maxCanvasPixels:this.maxCanvasPixels,pageColors:a,l10n:this.l10n,layerProperties:this._layerProperties,enableHWA:W(this,hn)});this._pages.push(k)}(M=this._pages[0])==null||M.setPdfPage(h),this._scrollMode===q.PAGE?b(this,d0,wW).call(this):this._spreadMode!==Pl.NONE&&this._updateSpreadMode(),b(this,yh,mM).call(this,s).then(async()=>{var B,k;if(l!==this.pdfDocument)return;if((B=this.findController)==null||B.setDocument(l),(k=this._scriptingManager)==null||k.setDocument(l),W(this,mF)&&document.addEventListener("copy",b(this,kh,eM).bind(this,T),{signal:s}),W(this,$l)&&Q.dispatch("annotationeditormodechanged",{source:this,mode:W(this,VZ)}),l.loadingParams.disableAutoFetch||F>hQ.FORCE_LAZY_PAGE_INIT){this._pagesCapability.resolve();return}let Y=F-1;if(Y<=0){this._pagesCapability.resolve();return}for(let o=2;o<=F;++o){const y=l.getPage(o).then(D=>{const I=this._pages[o-1];I.pdfPage||I.setPdfPage(D),--Y===0&&this._pagesCapability.resolve()},D=>{console.error(`Unable to get page ${o} to initialize viewer`,D),--Y===0&&this._pagesCapability.resolve()});o%hQ.PAUSE_EAGER_PAGE_INIT===0&&await y}}),Q.dispatch("pagesinit",{source:this}),l.getMetadata().then(({info:B})=>{l===this.pdfDocument&&B.Language&&(n.lang=B.Language)}),this.defaultRenderingQueue&&this.update()}).catch(h=>{console.error("Unable to initialize viewer",h),this._pagesCapability.reject(h)})}setPageLabels(l){var U;if(this.pdfDocument){l?Array.isArray(l)&&this.pdfDocument.numPages===l.length?this._pageLabels=l:(this._pageLabels=null,console.error("setPageLabels: Invalid page labels.")):this._pageLabels=null;for(let Z=0,F=this._pages.length;Z<F;Z++)this._pages[Z].setPageLabel(((U=this._pageLabels)==null?void 0:U[Z])??null)}}_resetView(){var l,U;this._pages=[],this._currentPageNumber=1,this._currentScale=pi,this._currentScaleValue=null,this._pageLabels=null,m(this,sF,new MX($m)),this._location=null,this._pagesRotation=0,this._optionalContentConfigPromise=null,this._firstPageCapability=Promise.withResolvers(),this._onePageRenderedCapability=Promise.withResolvers(),this._pagesCapability=Promise.withResolvers(),this._scrollMode=q.VERTICAL,this._previousScrollMode=q.UNKNOWN,this._spreadMode=Pl.NONE,m(this,N0,{previousPageNumber:1,scrollDown:!0,pages:[]}),(l=W(this,zt))==null||l.abort(),m(this,zt,null),this.viewer.textContent="",this._updateScrollMode(),this.viewer.removeAttribute("lang"),(U=W(this,mF))==null||U.remove(),m(this,mF,null)}_scrollUpdate(){this.pagesCount!==0&&this.update()}pageLabelToPageNumber(l){if(!this._pageLabels)return null;const U=this._pageLabels.indexOf(l);return U<0?null:U+1}scrollPageIntoView({pageNumber:l,destArray:U=null,allowNegativeOffset:Z=!1,ignoreDestinationZoom:F=!1}){if(!this.pdfDocument)return;const t=Number.isInteger(l)&&this._pages[l-1];if(!t){console.error(`scrollPageIntoView: "${l}" is not a valid pageNumber parameter.`);return}if(this.isInPresentationMode||!U){this._setCurrentPageNumber(l,!0);return}let c=0,V=0,Q=0,a=0,n,s;const R=t.rotation%180!==0,N=(R?t.height:t.width)/t.scale/zd.PDF_TO_CSS_UNITS,h=(R?t.width:t.height)/t.scale/zd.PDF_TO_CSS_UNITS;let e=0;switch(U[1].name){case"XYZ":c=U[2],V=U[3],e=U[4],c=c!==null?c:0,V=V!==null?V:h;break;case"Fit":case"FitB":e="page-fit";break;case"FitH":case"FitBH":V=U[2],e="page-width",V===null&&this._location?(c=this._location.left,V=this._location.top):(typeof V!="number"||V<0)&&(V=h);break;case"FitV":case"FitBV":c=U[2],Q=N,a=h,e="page-height";break;case"FitR":c=U[2],V=U[3],Q=U[4]-c,a=U[5]-V;let T=w2,p=C2;this.removePageBorders&&(T=p=0),n=(this.container.clientWidth-T)/Q/zd.PDF_TO_CSS_UNITS,s=(this.container.clientHeight-p)/a/zd.PDF_TO_CSS_UNITS,e=Math.min(Math.abs(n),Math.abs(s));break;default:console.error(`scrollPageIntoView: "${U[1].name}" is not a valid destination type.`);return}if(F||(e&&e!==this._currentScale?this.currentScaleValue=e:this._currentScale===pi&&(this.currentScaleValue=nT)),e==="page-fit"&&!U[4]){b(this,CW,ns).call(this,t);return}const M=[t.viewport.convertToViewportPoint(c,V),t.viewport.convertToViewportPoint(c+Q,V+a)];let J=Math.min(M[0][0],M[1][0]),G=Math.min(M[0][1],M[1][1]);Z||(J=Math.max(J,0),G=Math.max(G,0)),b(this,CW,ns).call(this,t,{left:J,top:G})}_updateLocation(l){const U=this._currentScale,Z=this._currentScaleValue,F=parseFloat(Z)===U?Math.round(U*1e4)/100:Z,t=l.id,c=this._pages[t-1],V=this.container,Q=c.getPagePoint(V.scrollLeft-l.x,V.scrollTop-l.y),a=Math.round(Q[0]),n=Math.round(Q[1]);let s=`#page=${t}`;this.isInPresentationMode||(s+=`&zoom=${F},${a},${n}`),this._location={pageNumber:t,scale:F,top:n,left:a,rotation:this._pagesRotation,pdfOpenParams:s}}update(){const l=this._getVisiblePages(),U=l.views,Z=U.length;if(Z===0)return;const F=Math.max($m,2*Z+1);W(this,sF).resize(F,l.ids),this.renderingQueue.renderHighestPriority(l);const t=this._spreadMode===Pl.NONE&&(this._scrollMode===q.PAGE||this._scrollMode===q.VERTICAL),c=this._currentPageNumber;let V=!1;for(const Q of U){if(Q.percent<100)break;if(Q.id===c&&t){V=!0;break}}this._setCurrentPageNumber(V?c:U[0].id),this._updateLocation(l.first),this.eventBus.dispatch("updateviewarea",{source:this,location:this._location})}containsElement(l){return this.container.contains(l)}focus(){this.container.focus()}get _isContainerRtl(){return getComputedStyle(this.container).direction==="rtl"}get isInPresentationMode(){return this.presentationModeState===n0.FULLSCREEN}get isChangingPresentationMode(){return this.presentationModeState===n0.CHANGING}get isHorizontalScrollbarEnabled(){return this.isInPresentationMode?!1:this.container.scrollWidth>this.container.clientWidth}get isVerticalScrollbarEnabled(){return this.isInPresentationMode?!1:this.container.scrollHeight>this.container.clientHeight}_getVisiblePages(){const l=this._scrollMode===q.PAGE?W(this,N0).pages:this._pages,U=this._scrollMode===q.HORIZONTAL,Z=U&&this._isContainerRtl;return mT({scrollEl:this.container,views:l,sortByVisibility:!0,horizontal:U,rtl:Z})}cleanup(){for(const l of this._pages)l.renderingState!==il.FINISHED&&l.reset()}_cancelRendering(){for(const l of this._pages)l.cancelRendering()}forceRendering(l){const U=l||this._getVisiblePages(),Z=b(this,Eh,JM).call(this,U),F=this._spreadMode!==Pl.NONE&&this._scrollMode!==q.HORIZONTAL,t=this.renderingQueue.getHighestPriority(U,this._pages,Z,F);return t?(b(this,Ih,MM).call(this,t).then(()=>{this.renderingQueue.renderView(t)}),!0):!1}get hasEqualPageSizes(){const l=this._pages[0];for(let U=1,Z=this._pages.length;U<Z;++U){const F=this._pages[U];if(F.width!==l.width||F.height!==l.height)return!1}return!0}getPagesOverview(){let l;return this._pages.map(U=>{const Z=U.pdfPage.getViewport({scale:1}),F=j2(Z);if(l===void 0)l=F;else if(this.enablePrintAutoRotate&&F!==l)return{width:Z.height,height:Z.width,rotation:(Z.rotation-90)%360};return{width:Z.width,height:Z.height,rotation:Z.rotation}})}get optionalContentConfigPromise(){return this.pdfDocument?this._optionalContentConfigPromise?this._optionalContentConfigPromise:(console.error("optionalContentConfigPromise: Not initialized yet."),this.pdfDocument.getOptionalContentConfig({intent:"display"})):Promise.resolve(null)}set optionalContentConfigPromise(l){if(!(l instanceof Promise))throw new Error(`Invalid optionalContentConfigPromise: ${l}`);this.pdfDocument&&this._optionalContentConfigPromise&&(this._optionalContentConfigPromise=l,this.refresh(!1,{optionalContentConfigPromise:l}),this.eventBus.dispatch("optionalcontentconfigchanged",{source:this,promise:l}))}get scrollMode(){return this._scrollMode}set scrollMode(l){if(this._scrollMode!==l){if(!eT(l))throw new Error(`Invalid scroll mode: ${l}`);this.pagesCount>hQ.FORCE_SCROLL_MODE_PAGE||(this._previousScrollMode=this._scrollMode,this._scrollMode=l,this.eventBus.dispatch("scrollmodechanged",{source:this,mode:l}),this._updateScrollMode(this._currentPageNumber))}}_updateScrollMode(l=null){const U=this._scrollMode,Z=this.viewer;Z.classList.toggle("scrollHorizontal",U===q.HORIZONTAL),Z.classList.toggle("scrollWrapped",U===q.WRAPPED),!(!this.pdfDocument||!l)&&(U===q.PAGE?b(this,d0,wW).call(this):this._previousScrollMode===q.PAGE&&this._updateSpreadMode(),this._currentScaleValue&&isNaN(this._currentScaleValue)&&b(this,pd,QZ).call(this,this._currentScaleValue,{noScroll:!0}),this._setCurrentPageNumber(l,!0),this.update())}get spreadMode(){return this._spreadMode}set spreadMode(l){if(this._spreadMode!==l){if(!MT(l))throw new Error(`Invalid spread mode: ${l}`);this._spreadMode=l,this.eventBus.dispatch("spreadmodechanged",{source:this,mode:l}),this._updateSpreadMode(this._currentPageNumber)}}_updateSpreadMode(l=null){if(!this.pdfDocument)return;const U=this.viewer,Z=this._pages;if(this._scrollMode===q.PAGE)b(this,d0,wW).call(this);else if(U.textContent="",this._spreadMode===Pl.NONE)for(const F of this._pages)U.append(F.div);else{const F=this._spreadMode-1;let t=null;for(let c=0,V=Z.length;c<V;++c)t===null?(t=document.createElement("div"),t.className="spread",U.append(t)):c%2===F&&(t=t.cloneNode(!1),U.append(t)),t.append(Z[c].div)}l&&(this._currentScaleValue&&isNaN(this._currentScaleValue)&&b(this,pd,QZ).call(this,this._currentScaleValue,{noScroll:!0}),this._setCurrentPageNumber(l,!0),this.update())}_getPageAdvance(l,U=!1){switch(this._scrollMode){case q.WRAPPED:{const{views:Z}=this._getVisiblePages(),F=new Map;for(const{id:t,y:c,percent:V,widthPercent:Q}of Z){if(V===0||Q<100)continue;let a=F.get(c);a||F.set(c,a||(a=[])),a.push(t)}for(const t of F.values()){const c=t.indexOf(l);if(c===-1)continue;const V=t.length;if(V===1)break;if(U)for(let Q=c-1,a=0;Q>=a;Q--){const n=t[Q],s=t[Q+1]-1;if(n<s)return l-s}else for(let Q=c+1,a=V;Q<a;Q++){const n=t[Q],s=t[Q-1]+1;if(n>s)return s-l}if(U){const Q=t[0];if(Q<l)return l-Q+1}else{const Q=t[V-1];if(Q>l)return Q-l+1}break}break}case q.HORIZONTAL:break;case q.PAGE:case q.VERTICAL:{if(this._spreadMode===Pl.NONE)break;const Z=this._spreadMode-1;if(U&&l%2!==Z||!U&&l%2===Z)break;const{views:F}=this._getVisiblePages(),t=U?l-1:l+1;for(const{id:c,percent:V,widthPercent:Q}of F)if(c===t){if(V>0&&Q===100)return 2;break}break}}return 1}nextPage(){const l=this._currentPageNumber,U=this.pagesCount;if(l>=U)return!1;const Z=this._getPageAdvance(l,!1)||1;return this.currentPageNumber=Math.min(l+Z,U),!0}previousPage(){const l=this._currentPageNumber;if(l<=1)return!1;const U=this._getPageAdvance(l,!0)||1;return this.currentPageNumber=Math.max(l-U,1),!0}updateScale({drawingDelay:l,scaleFactor:U=null,steps:Z=null,origin:F}){if(Z===null&&U===null)throw new Error("Invalid updateScale options: either `steps` or `scaleFactor` must be provided.");if(!this.pdfDocument)return;let t=this._currentScale;if(U>0&&U!==1)t=Math.round(t*U*100)/100;else if(Z){const c=Z>0?Rm:1/Rm,V=Z>0?Math.ceil:Math.floor;Z=Math.abs(Z);do t=V((t*c).toFixed(2)*10)/10;while(--Z>0)}t=Math.max(sT,Math.min(iT,t)),b(this,pd,QZ).call(this,t,{noScroll:!1,drawingDelay:l,origin:F})}increaseScale(l={}){this.updateScale({...l,steps:l.steps??1})}decreaseScale(l={}){this.updateScale({...l,steps:-(l.steps??1)})}get containerTopLeft(){return W(this,DW)||m(this,DW,[this.container.offsetTop,this.container.offsetLeft])}get annotationEditorMode(){return W(this,$l)?W(this,VZ):GZ.DISABLE}set annotationEditorMode({mode:l,editId:U=null,isFromKeyboard:Z=!1}){if(!W(this,$l))throw new Error("The AnnotationEditor is not enabled.");if(W(this,VZ)!==l){if(!le(l))throw new Error(`Invalid AnnotationEditor mode: ${l}`);this.pdfDocument&&(m(this,VZ,l),this.eventBus.dispatch("annotationeditormodechanged",{source:this,mode:l}),W(this,$l).updateMode(l,U,Z))}}set annotationEditorParams({type:l,value:U}){if(!W(this,$l))throw new Error("The AnnotationEditor is not enabled.");W(this,$l).updateParams(l,U)}refresh(l=!1,U=Object.create(null)){if(this.pdfDocument){for(const Z of this._pages)Z.update(U);W(this,pF)!==null&&(clearTimeout(W(this,pF)),m(this,pF,null)),l||this.update()}}}sF=new WeakMap,Rn=new WeakMap,Nn=new WeakMap,VZ=new WeakMap,$l=new WeakMap,R0=new WeakMap,DW=new WeakMap,hn=new WeakMap,bn=new WeakMap,mn=new WeakMap,zt=new WeakMap,en=new WeakMap,FW=new WeakMap,mF=new WeakMap,IW=new WeakMap,Mn=new WeakMap,tW=new WeakMap,N0=new WeakMap,pF=new WeakMap,EW=new WeakMap,oh=new WeakSet,bM=function(d){const l={annotationEditorMode:W(this,VZ),annotationMode:W(this,R0),textLayerMode:W(this,EW)};return d&&(!d.includes(iQ.COPY)&&W(this,EW)===Fd.ENABLE&&(l.textLayerMode=Fd.ENABLE_PERMISSIONS),d.includes(iQ.MODIFY_CONTENTS)||(l.annotationEditorMode=GZ.DISABLE),!d.includes(iQ.MODIFY_ANNOTATIONS)&&!d.includes(iQ.FILL_INTERACTIVE_FORMS)&&W(this,R0)===Id.ENABLE_FORMS&&(l.annotationMode=Id.ENABLE)),l},yh=new WeakSet,mM=async function(d){if(document.visibilityState==="hidden"||!this.container.offsetParent||this._getVisiblePages().views.length===0)return;const l=Promise.withResolvers();function U(){document.visibilityState==="hidden"&&l.resolve()}document.addEventListener("visibilitychange",U,{signal:d}),await Promise.race([this._onePageRenderedCapability.promise,l.promise]),document.removeEventListener("visibilitychange",U)},kh=new WeakSet,eM=function(d,l){const U=document.getSelection(),{focusNode:Z,anchorNode:F}=U;if(F&&Z&&U.containsNode(W(this,mF))){if(W(this,FW)||d===Fd.ENABLE_PERMISSIONS){l.preventDefault(),l.stopPropagation();return}m(this,FW,!0);const{classList:t}=this.viewer;t.add("copyAll");const c=new AbortController;window.addEventListener("keydown",V=>m(this,IW,V.key==="Escape"),{signal:c.signal}),this.getAllText().then(async V=>{V!==null&&await navigator.clipboard.writeText(V)}).catch(V=>{console.warn(`Something goes wrong when extracting the text: ${V.message}`)}).finally(()=>{m(this,FW,!1),m(this,IW,!1),c.abort(),t.remove("copyAll")}),l.preventDefault(),l.stopPropagation()}},d0=new WeakSet,wW=function(){if(this._scrollMode!==q.PAGE)throw new Error("#ensurePageViewVisible: Invalid scrollMode value.");const d=this._currentPageNumber,l=W(this,N0),U=this.viewer;if(U.textContent="",l.pages.length=0,this._spreadMode===Pl.NONE&&!this.isInPresentationMode){const Z=this._pages[d-1];U.append(Z.div),l.pages.push(Z)}else{const Z=new Set,F=this._spreadMode-1;F===-1?Z.add(d-1):d%2!==F?(Z.add(d-1),Z.add(d)):(Z.add(d-2),Z.add(d-1));const t=document.createElement("div");if(t.className="spread",this.isInPresentationMode){const c=document.createElement("div");c.className="dummyPage",t.append(c)}for(const c of Z){const V=this._pages[c];V&&(t.append(V.div),l.pages.push(V))}U.append(t)}l.scrollDown=d>=l.previousPageNumber,l.previousPageNumber=d},CW=new WeakSet,ns=function(d,l=null){const{div:U,id:Z}=d;if(this._currentPageNumber!==Z&&this._setCurrentPageNumber(Z),this._scrollMode===q.PAGE&&(b(this,d0,wW).call(this),this.update()),!l&&!this.isInPresentationMode){const F=U.offsetLeft+U.clientLeft,t=F+U.clientWidth,{scrollLeft:c,clientWidth:V}=this.container;(this._scrollMode===q.HORIZONTAL||F<c||t>c+V)&&(l={left:0,top:0})}x2(U,l),!this._currentScaleValue&&this._location&&(this._location=null)},Lh=new WeakSet,Ue=function(d){return d===this._currentScale||Math.abs(d-this._currentScale)<1e-15},Jn=new WeakSet,Hi=function(d,l,{noScroll:U=!1,preset:Z=!1,drawingDelay:F=-1,origin:t=null}){if(this._currentScaleValue=l.toString(),b(this,Lh,Ue).call(this,d)){Z&&this.eventBus.dispatch("scalechanging",{source:this,scale:d,presetValue:l});return}this.viewer.style.setProperty("--scale-factor",d*zd.PDF_TO_CSS_UNITS);const c=F>=0&&F<1e3;this.refresh(!0,{scale:d,drawingDelay:c?F:-1}),c&&m(this,pF,setTimeout(()=>{m(this,pF,null),this.refresh()},F));const V=this._currentScale;if(this._currentScale=d,!U){let Q=this._currentPageNumber,a;if(this._location&&!(this.isInPresentationMode||this.isChangingPresentationMode)&&(Q=this._location.pageNumber,a=[null,{name:"XYZ"},this._location.left,this._location.top,null]),this.scrollPageIntoView({pageNumber:Q,destArray:a,allowNegativeOffset:!0}),Array.isArray(t)){const n=d/V-1,[s,R]=this.containerTopLeft;this.container.scrollLeft+=(t[0]-R)*n,this.container.scrollTop+=(t[1]-s)*n}}this.eventBus.dispatch("scalechanging",{source:this,scale:d,presetValue:Z?l:void 0}),this.defaultRenderingQueue&&this.update()},zh=new WeakSet,de=function(){return this._spreadMode!==Pl.NONE&&this._scrollMode!==q.HORIZONTAL?2:1},pd=new WeakSet,QZ=function(d,l){let U=parseFloat(d);if(U>0)l.preset=!1,b(this,Jn,Hi).call(this,U,d,l);else{const Z=this._pages[this._currentPageNumber-1];if(!Z)return;let F=w2,t=C2;this.isInPresentationMode?(F=t=4,this._spreadMode!==Pl.NONE&&(F*=2)):this.removePageBorders?F=t=0:this._scrollMode===q.HORIZONTAL&&([F,t]=[t,F]);const c=(this.container.clientWidth-F)/Z.width*Z.scale/W(this,zh,de),V=(this.container.clientHeight-t)/Z.height*Z.scale;switch(d){case"page-actual":U=1;break;case"page-width":U=c;break;case"page-height":U=V;break;case"page-fit":U=Math.min(c,V);break;case"auto":const Q=j2(Z)?c:Math.min(V,c);U=Math.min(RT,Q);break;default:console.error(`#setScale: "${d}" is an unknown zoom value.`);return}l.preset=!0,b(this,Jn,Hi).call(this,U,d,l)}},Gn=new WeakSet,Dh=function(){const d=this._pages[this._currentPageNumber-1];this.isInPresentationMode&&b(this,pd,QZ).call(this,this._currentScaleValue,{noScroll:!0}),b(this,CW,ns).call(this,d)},Ih=new WeakSet,MM=async function(d){if(d.pdfPage)return d.pdfPage;try{const l=await this.pdfDocument.getPage(d.id);return d.pdfPage||d.setPdfPage(l),l}catch(l){return console.error("Unable to get page for page view",l),null}},Eh=new WeakSet,JM=function(d){var l,U;if(((l=d.first)==null?void 0:l.id)===1)return!0;if(((U=d.last)==null?void 0:U.id)===this.pagesCount)return!1;switch(this._scrollMode){case q.PAGE:return W(this,N0).scrollDown;case q.HORIZONTAL:return this.scroll.right}return this.scroll.down},ss=new WeakSet,wh=function(d=this.container.clientHeight){d!==W(this,Mn)&&(m(this,Mn,d),JT.setProperty("--viewer-container-height",`${d}px`))},Ch=new WeakSet,GM=function(d){for(const l of d)if(l.target===this.container){b(this,ss,wh).call(this,Math.floor(l.borderBoxSize[0].blockSize)),m(this,DW,null);break}};class JX extends TM{_resetView(){super._resetView(),this._scrollMode=q.PAGE,this._spreadMode=Pl.NONE}set scrollMode(l){}_updateScrollMode(){}set spreadMode(l){}_updateSpreadMode(){}}sl.AnnotationLayerBuilder;sl.DownloadManager;sl.EventBus;sl.FindState;sl.GenericL10n;sl.LinkTarget;sl.PDFFindController;sl.PDFHistory;var GX=sl.PDFLinkService;sl.PDFPageView;sl.PDFScriptingManager;sl.PDFSinglePageViewer;sl.PDFViewer;sl.ProgressBar;sl.RenderingStates;sl.ScrollMode;sl.SimpleLinkService;sl.SpreadMode;sl.StructTreeLayerBuilder;sl.TextLayerBuilder;sl.XfaLayerBuilder;sl.parseQueryString;const TX=["id"],SX=["id"],XX=ce("canvas",null,null,-1),YX={key:0,class:"textLayer"},pX={key:1,class:"annotationLayer"},SM=pM({__name:"VuePdfEmbed",props:{annotationLayer:{type:Boolean},height:{},id:{},imageResourcesPath:{},page:{},rotation:{default:0},scale:{default:1},source:{},textLayer:{type:Boolean},width:{}},emits:["internal-link-clicked","loaded","loading-failed","password-requested","progress","rendered","rendering-failed"],setup(d,{expose:l,emit:U}){const Z=d,F=Sn([]),t=BM([]),c=Sn(null);let V=null;const{doc:Q}=I2({onError:J=>{F.value=[],U("loading-failed",J)},onPasswordRequest({callback:J,isWrongPassword:G}){U("password-requested",{callback:J,isWrongPassword:G})},onProgress:J=>{U("progress",J)},source:uM(Z,"source")}),a=oM(()=>{if(!Q.value||!Z.annotationLayer)return null;const J=new GX;return J.setDocument(Q.value),J.setViewer({scrollPageIntoView:({pageNumber:G})=>{U("internal-link-clicked",G)}}),J}),n=async J=>{if(!Q.value)return;const G=await Q.value.getData(),T=await Q.value.getMetadata(),p=J??T.contentDispositionFilename??"";aT(G,p)},s=J=>{let G,T;return Z.height&&!Z.width?(T=Z.height,G=T/J):(G=Z.width??c.value.clientWidth,T=G*J),[G,T]},R=async(J=300,G="",T=!1)=>{var p,S,X;if(!Q.value)return;const B=J/72,k=96/72;let Y,o,y;try{Y=window.document.createElement("div"),Y.style.display="none",window.document.body.appendChild(Y),o=await QT(Y);const D=Z.page&&!T?[Z.page]:[...Array(Q.value.numPages+1).keys()].slice(1);await Promise.all(D.map(async(I,j)=>{const x=await Q.value.getPage(I),u=x.getViewport({scale:1,rotation:0});if(j===0){const Wl=u.width*B/k,ml=u.height*B/k;VT(o,Wl,ml)}const E=window.document.createElement("canvas");E.width=u.width*B,E.height=u.height*B,Y.appendChild(E);const A=E.cloneNode();o.contentWindow.document.body.appendChild(A),await x.render({canvasContext:E.getContext("2d"),intent:"print",transform:[B,0,0,B,0,0],viewport:u}).promise,A.getContext("2d").drawImage(E,0,0)})),G&&(y=window.document.title,window.document.title=G),(p=o.contentWindow)==null||p.focus(),(S=o.contentWindow)==null||S.print()}finally{y&&(window.document.title=y),Yi(Y),(X=Y.parentNode)==null||X.removeChild(Y)}},N=async()=>{if(!(!Q.value||V!=null&&V.isAborted))try{F.value=Z.page?[Z.page]:[...Array(Q.value.numPages+1).keys()].slice(1),t.value=Array(F.value.length).fill(1),await Promise.all(F.value.map(async(J,G)=>{const T=await Q.value.getPage(J);if(V!=null&&V.isAborted)return;const p=((Z.rotation%90===0?Z.rotation:0)+T.rotate)%360,[S,X,B]=Array.from(c.value.getElementsByClassName("vue-pdf-embed__page")[G].children),k=!!(p/90%2),Y=T.view[2]-T.view[0],o=T.view[3]-T.view[1],[y,D]=s(k?Y/o:o/Y),I=`${Math.floor(y)}px`,j=`${Math.floor(D)}px`,x=y/(k?o:Y),u=T.getViewport({scale:x,rotation:p});t.value[G]=x,S.style.display="block",S.style.width=I,S.style.height=j;const E=[h(T,u.clone({scale:u.scale*window.devicePixelRatio*Z.scale}),S)];return Z.textLayer&&E.push(M(T,u.clone({dontFlip:!0}),X)),Z.annotationLayer&&E.push(e(T,u.clone({dontFlip:!0}),B||X)),Promise.all(E)})),V!=null&&V.isAborted||U("rendered")}catch(J){F.value=[],t.value=[],V!=null&&V.isAborted||U("rendering-failed",J)}},h=async(J,G,T)=>{T.width=G.width,T.height=G.height,await J.render({canvasContext:T.getContext("2d"),viewport:G}).promise},e=async(J,G,T)=>{sm(T),new ZT({accessibilityManager:null,annotationCanvasMap:null,annotationEditorUIManager:null,div:T,page:J,viewport:G}).render({annotations:await J.getAnnotations(),div:T,imageResourcesPath:Z.imageResourcesPath,linkService:a.value,page:J,renderForms:!1,viewport:G})},M=async(J,G,T)=>{sm(T),new tT({container:T,textContentSource:await J.getTextContent(),viewport:G}).render()};return Pi(Q,J=>{J&&U("loaded",J)},{immediate:!0}),Pi(()=>[Q.value,Z.annotationLayer,Z.height,Z.imageResourcesPath,Z.page,Z.rotation,Z.scale,Z.textLayer,Z.width],async([J])=>{J&&(V&&(V.isAborted=!0,await V.promise),Yi(c.value),V={isAborted:!1,promise:N()},await V.promise,V=null)},{immediate:!0}),te(()=>{Yi(c.value)}),l({doc:Q,download:n,print:R}),(J,G)=>(fF(),M0("div",{id:J.id,ref_key:"root",ref:c,class:"vue-pdf-embed"},[(fF(!0),M0(yM,null,kM(F.value,(T,p)=>(fF(),M0("div",{key:T},[Zb(J.$slots,"before-page",{page:T}),ce("div",{id:J.id&&`${J.id}-${T}`,class:"vue-pdf-embed__page",style:LM({"--scale-factor":t.value[p],position:"relative"})},[XX,J.textLayer?(fF(),M0("div",YX)):Fb("",!0),J.annotationLayer?(fF(),M0("div",pX)):Fb("",!0)],12,SX),Zb(J.$slots,"after-page",{page:T})]))),128))],8,TX))}});window!=null&&window.Vue&&(window.VuePdfEmbed=SM,window.useVuePdfEmbed=I2);Xi!=null&&Xi.workerSrc||(Xi.workerSrc=WT);const BX={},Fc=Object.freeze(Object.defineProperty({__proto__:null,default:BX},Symbol.toStringTag,{value:"Module"}));var tc={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},uX=/([astvzqmhlc])([^astvzqmhlc]*)/gi,oX=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi;function yX(d){const l=d.match(oX);return l?l.map(Number):[]}function XM(d){const l=[],U=String(d).trim();return U[0]!=="M"&&U[0]!=="m"||U.replace(uX,(Z,F,t)=>{const c=yX(t);let V=F.toLowerCase(),Q=F;if(V==="m"&&c.length>2&&(l.push([Q,...c.splice(0,2)]),V="l",Q=Q==="m"?"l":"L"),c.length<tc[V])return"";for(l.push([Q,...c.splice(0,tc[V])]);c.length>=tc[V]&&c.length&&tc[V];)l.push([Q,...c.splice(0,tc[V])]);return""}),l}function Ze(d,l){const U=d.x*Math.cos(l)-d.y*Math.sin(l),Z=d.y*Math.cos(l)+d.x*Math.sin(l);d.x=U,d.y=Z}function kX(d,l,U){d.x+=l,d.y+=U}function Fe(d,l){d.x*=l,d.y*=l}var Tn=class xh{constructor(l){this.commands=[],l&&l instanceof xh?this.commands.push(...l.commands):l&&(this.commands=XM(l))}addPath(l){l&&l instanceof xh&&this.commands.push(...l.commands)}moveTo(l,U){this.commands.push(["M",l,U])}lineTo(l,U){this.commands.push(["L",l,U])}arc(l,U,Z,F,t,c){this.commands.push(["AC",l,U,Z,F,t,!!c])}arcTo(l,U,Z,F,t){this.commands.push(["AT",l,U,Z,F,t])}ellipse(l,U,Z,F,t,c,V,Q){this.commands.push(["E",l,U,Z,F,t,c,V,!!Q])}closePath(){this.commands.push(["Z"])}bezierCurveTo(l,U,Z,F,t,c){this.commands.push(["C",l,U,Z,F,t,c])}quadraticCurveTo(l,U,Z,F){this.commands.push(["Q",l,U,Z,F])}rect(l,U,Z,F){this.commands.push(["R",l,U,Z,F])}roundRect(l,U,Z,F,t){typeof t>"u"?this.commands.push(["RR",l,U,Z,F,0]):this.commands.push(["RR",l,U,Z,F,t])}};function cW(d,l){let U=0,Z=0,F,t,c,V,Q,a,n,s,R,N,h,e,M,J,G,T,p,S,X,B,k,Y=null,o=null,y=null,D=null,I=null,j=null;d.beginPath();for(let x=0;x<l.length;++x){S=l[x][0],S!=="S"&&S!=="s"&&S!=="C"&&S!=="c"&&(Y=null,o=null),S!=="T"&&S!=="t"&&S!=="Q"&&S!=="q"&&(y=null,D=null);let u;switch(S){case"m":case"M":u=l[x],S==="m"?(U+=u[1],Z+=u[2]):(U=u[1],Z=u[2]),(S==="M"||!I)&&(I={x:U,y:Z}),d.moveTo(U,Z);break;case"l":u=l[x],U+=u[1],Z+=u[2],d.lineTo(U,Z);break;case"L":u=l[x],U=u[1],Z=u[2],d.lineTo(U,Z);break;case"H":u=l[x],U=u[1],d.lineTo(U,Z);break;case"h":u=l[x],U+=u[1],d.lineTo(U,Z);break;case"V":u=l[x],Z=u[1],d.lineTo(U,Z);break;case"v":u=l[x],Z+=u[1],d.lineTo(U,Z);break;case"a":case"A":if(u=l[x],j===null)throw new Error("This should never happen");S==="a"?(U+=u[6],Z+=u[7]):(U=u[6],Z=u[7]),J=u[1],G=u[2],n=u[3]*Math.PI/180,c=!!u[4],V=!!u[5],Q={x:U,y:Z},a={x:(j.x-Q.x)/2,y:(j.y-Q.y)/2},Ze(a,-n),s=a.x*a.x/(J*J)+a.y*a.y/(G*G),s>1&&(s=Math.sqrt(s),J*=s,G*=s),X={x:J*a.y/G,y:-(G*a.x)/J},R=J*J*G*G,N=J*J*a.y*a.y+G*G*a.x*a.x,V!==c?Fe(X,Math.sqrt((R-N)/N)||0):Fe(X,-Math.sqrt((R-N)/N)||0),t=Math.atan2((a.y-X.y)/G,(a.x-X.x)/J),F=Math.atan2(-(a.y+X.y)/G,-(a.x+X.x)/J),Ze(X,n),kX(X,(Q.x+j.x)/2,(Q.y+j.y)/2),d.save(),d.translate(X.x,X.y),d.rotate(n),d.scale(J,G),d.arc(0,0,1,t,F,!V),d.restore();break;case"C":u=l[x],Y=u[3],o=u[4],U=u[5],Z=u[6],d.bezierCurveTo(u[1],u[2],Y,o,U,Z);break;case"c":u=l[x],d.bezierCurveTo(u[1]+U,u[2]+Z,u[3]+U,u[4]+Z,u[5]+U,u[6]+Z),Y=u[3]+U,o=u[4]+Z,U+=u[5],Z+=u[6];break;case"S":u=l[x],(Y===null||o===null)&&(Y=U,o=Z),d.bezierCurveTo(2*U-Y,2*Z-o,u[1],u[2],u[3],u[4]),Y=u[1],o=u[2],U=u[3],Z=u[4];break;case"s":u=l[x],(Y===null||o===null)&&(Y=U,o=Z),d.bezierCurveTo(2*U-Y,2*Z-o,u[1]+U,u[2]+Z,u[3]+U,u[4]+Z),Y=u[1]+U,o=u[2]+Z,U+=u[3],Z+=u[4];break;case"Q":u=l[x],y=u[1],D=u[2],U=u[3],Z=u[4],d.quadraticCurveTo(y,D,U,Z);break;case"q":u=l[x],y=u[1]+U,D=u[2]+Z,U+=u[3],Z+=u[4],d.quadraticCurveTo(y,D,U,Z);break;case"T":u=l[x],(y===null||D===null)&&(y=U,D=Z),y=2*U-y,D=2*Z-D,U=u[1],Z=u[2],d.quadraticCurveTo(y,D,U,Z);break;case"t":u=l[x],(y===null||D===null)&&(y=U,D=Z),y=2*U-y,D=2*Z-D,U+=u[1],Z+=u[2],d.quadraticCurveTo(y,D,U,Z);break;case"z":case"Z":I&&(U=I.x,Z=I.y),I=null,d.closePath();break;case"AC":u=l[x],U=u[1],Z=u[2],M=u[3],t=u[4],F=u[5],B=u[6],d.arc(U,Z,M,t,F,B);break;case"AT":u=l[x],h=u[1],e=u[2],U=u[3],Z=u[4],M=u[5],d.arcTo(h,e,U,Z,M);break;case"E":u=l[x],U=u[1],Z=u[2],J=u[3],G=u[4],n=u[5],t=u[6],F=u[7],B=u[8],d.save(),d.translate(U,Z),d.rotate(n),d.scale(J,G),d.arc(0,0,1,t,F,B),d.restore();break;case"R":u=l[x],U=u[1],Z=u[2],T=u[3],p=u[4],I={x:U,y:Z},d.rect(U,Z,T,p);break;case"RR":u=l[x],U=u[1],Z=u[2],T=u[3],p=u[4],k=u[5],I={x:U,y:Z},d.roundRect(U,Z,T,p,k);break;default:throw new Error(`Invalid path command: ${S}`)}j?(j.x=U,j.y=Z):j={x:U,y:Z}}}function lb(d,l,U,Z,F=0){if(typeof F=="number"&&(F=[F]),Array.isArray(F)){if(F.length===0||F.length>4)throw new RangeError(`Failed to execute 'roundRect' on '${this.constructor.name}': ${F.length} radii provided. Between one and four radii are necessary.`);F.forEach(n=>{if(n<0)throw new RangeError(`Failed to execute 'roundRect' on '${this.constructor.name}': Radius value ${n} is negative.`)})}else return;if(F.length===1&&F[0]===0){this.rect(d,l,U,Z);return}const t=Math.min(U,Z)/2,c=Math.min(t,F[0]);let V=c,Q=c,a=c;F.length===2&&(V=Math.min(t,F[1]),a=V),F.length===3&&(V=Math.min(t,F[1]),a=V,Q=Math.min(t,F[2])),F.length===4&&(V=Math.min(t,F[1]),Q=Math.min(t,F[2]),a=Math.min(t,F[3])),this.moveTo(d,l+Z-a),this.arcTo(d,l,d+c,l,c),this.arcTo(d+U,l,d+U,l+V,V),this.arcTo(d+U,l+Z,d+U-Q,l+Z,Q),this.arcTo(d,l+Z,d,l+Z-a,a),this.moveTo(d,l)}function LX(d){if(!d)return;const l=d.prototype.clip,U=d.prototype.fill,Z=d.prototype.stroke,F=d.prototype.isPointInPath;d.prototype.clip=function(...t){if(t[0]instanceof Tn){const V=t[0],Q=t[1]||"nonzero";return cW(this,V.commands),l.apply(this,[Q])}const c=t[0]||"nonzero";return l.apply(this,[c])},d.prototype.fill=function(...t){if(t[0]instanceof Tn){const V=t[0],Q=t[1]||"nonzero";return cW(this,V.commands),U.apply(this,[Q])}const c=t[0]||"nonzero";return U.apply(this,[c])},d.prototype.stroke=function(t){t&&cW(this,t.commands),Z.apply(this)},d.prototype.isPointInPath=function(...t){if(t[0]instanceof Tn){const c=t[0],V=t[1],Q=t[2],a=t[3]||"nonzero";return cW(this,c.commands),F.apply(this,[V,Q,a])}return F.apply(this,t)}}function zX(d){d&&!d.prototype.roundRect&&(d.prototype.roundRect=lb)}function DX(d){d&&!d.prototype.roundRect&&(d.prototype.roundRect=lb)}const IX=Object.freeze(Object.defineProperty({__proto__:null,Path2D:Tn,applyPath2DToCanvasRenderingContext:LX,applyRoundRectToCanvasRenderingContext2D:zX,applyRoundRectToPath2D:DX,buildPath:cW,parsePath:XM,roundRect:lb},Symbol.toStringTag,{value:"Module"})),EX={name:"PDFDoc",components:{VuePdfEmbed:SM},props:{book:{type:Object,required:!0},page:{type:Number,required:!0},src:{type:String,required:!0}},emits:["load","error","unauthorized"],data(){return{innerHeight:window.innerHeight,innerWidth:window.innerWidth}},computed:{...DM(tb,{scale:d=>d.clientSettings.scale}),bookSettings(){return this.getBookSettings(this.book)},isVertical(){return xM.has(this.bookSettings.readingDirection)},width(){let d=["W","O"].includes(this.bookSettings.fitTo)?this.innerWidth:0;return!this.isVertical&&this.bookSettings.twoPages&&(d=d/2),d*this.scale},height(){let d=["H","S"].includes(this.bookSettings.fitTo)?this.innerHeight:0;return this.isVertical&&(d=d*.8),d*this.scale},classes(){return this.bookSettings.fitToClass}},mounted(){window.addEventListener("resize",this.onResize)},beforeUnmount(){window.removeEventListener("resize",this.onResize)},methods:{...IM(tb,["getBookSettings","routeToPage"]),onResize(){this.innerHeight=window.innerHeight,this.innerWidth=window.innerWidth},onLoad(){this.$emit("load")},onLinkClicked(d){this.routeToPage(d)},onError(d){console.error(d),this.$emit("error")},onUnauthorized(){this.$emit("unauthorized")}}};function wX(d,l,U,Z,F,t){const c=EM("vue-pdf-embed");return fF(),wM(c,{class:CM(["pdfDoc",t.classes]),"image-resources-path":"https://unpkg.com/pdfjs-dist/web/images/",page:U.page,source:U.src,width:t.width,height:t.height,onRendered:t.onLoad,onInternalLinkClicked:t.onLinkClicked,onLoadingFailed:t.onError,onRenderingFailed:t.onError,onPasswordRequested:t.onUnauthorized},null,8,["class","page","source","width","height","onRendered","onInternalLinkClicked","onLoadingFailed","onRenderingFailed","onPasswordRequested"])}const NY=zM(EX,[["render",wX],["__scopeId","data-v-538aa37c"]]);export{NY as default};
|