codex 1.5.16__py3-none-any.whl → 1.5.17__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/static_root/assets/{VCheckbox-B2I5x4E4.e5760ee532b4.js → VCheckbox-CFqm2IhY.60c7775eda9e.js} +1 -1
- codex/static_root/assets/VCheckbox-CFqm2IhY.60c7775eda9e.js.br +0 -0
- codex/static_root/assets/VCheckbox-CFqm2IhY.60c7775eda9e.js.gz +0 -0
- codex/static_root/assets/{VCheckbox-B2I5x4E4.js → VCheckbox-CFqm2IhY.js} +1 -1
- codex/static_root/assets/VCheckbox-CFqm2IhY.js.br +0 -0
- codex/static_root/assets/VCheckbox-CFqm2IhY.js.gz +0 -0
- codex/static_root/assets/{VCheckboxBtn-BVyOdyPP.ff87efeb3f18.js → VCheckboxBtn-BjWW08N8.bee4c9c1c3b4.js} +1 -1
- codex/static_root/assets/VCheckboxBtn-BjWW08N8.bee4c9c1c3b4.js.br +0 -0
- codex/static_root/assets/VCheckboxBtn-BjWW08N8.bee4c9c1c3b4.js.gz +0 -0
- codex/static_root/assets/{VCheckboxBtn-BVyOdyPP.js → VCheckboxBtn-BjWW08N8.js} +1 -1
- codex/static_root/assets/VCheckboxBtn-BjWW08N8.js.br +0 -0
- codex/static_root/assets/VCheckboxBtn-BjWW08N8.js.gz +0 -0
- codex/static_root/assets/{VCombobox-BZB5L26B.8efee843a0e6.js → VCombobox-BiHR4LaF.7487536b173b.js} +1 -1
- codex/static_root/assets/VCombobox-BiHR4LaF.7487536b173b.js.br +0 -0
- codex/static_root/assets/VCombobox-BiHR4LaF.7487536b173b.js.gz +0 -0
- codex/static_root/assets/{VCombobox-BZB5L26B.js → VCombobox-BiHR4LaF.js} +1 -1
- codex/static_root/assets/VCombobox-BiHR4LaF.js.br +0 -0
- codex/static_root/assets/VCombobox-BiHR4LaF.js.gz +0 -0
- codex/static_root/assets/{VDataTableVirtual-DbkXd_aw.3d4697fb57fe.js → VDataTableVirtual--XFLD9jr.ecfcb691279b.js} +1 -1
- codex/static_root/assets/VDataTableVirtual--XFLD9jr.ecfcb691279b.js.br +0 -0
- codex/static_root/assets/VDataTableVirtual--XFLD9jr.ecfcb691279b.js.gz +0 -0
- codex/static_root/assets/{VDataTableVirtual-DbkXd_aw.js → VDataTableVirtual--XFLD9jr.js} +1 -1
- codex/static_root/assets/VDataTableVirtual--XFLD9jr.js.br +0 -0
- codex/static_root/assets/VDataTableVirtual--XFLD9jr.js.gz +0 -0
- codex/static_root/assets/{VExpansionPanel-CyJaSVs6.c257f8312b65.js → VExpansionPanel-CSSnZFhG.bb54c6635f82.js} +1 -1
- codex/static_root/assets/VExpansionPanel-CSSnZFhG.bb54c6635f82.js.br +0 -0
- codex/static_root/assets/VExpansionPanel-CSSnZFhG.bb54c6635f82.js.gz +0 -0
- codex/static_root/assets/{VExpansionPanel-CyJaSVs6.js → VExpansionPanel-CSSnZFhG.js} +1 -1
- codex/static_root/assets/VExpansionPanel-CSSnZFhG.js.br +0 -0
- codex/static_root/assets/VExpansionPanel-CSSnZFhG.js.gz +0 -0
- codex/static_root/assets/{VMain-Bg06hxTl.447b2c0f6da3.js → VMain-BJLquw4_.0d36762696df.js} +1 -1
- codex/static_root/assets/VMain-BJLquw4_.0d36762696df.js.br +0 -0
- codex/static_root/assets/VMain-BJLquw4_.0d36762696df.js.gz +0 -0
- codex/static_root/assets/{VMain-Bg06hxTl.js → VMain-BJLquw4_.js} +1 -1
- codex/static_root/assets/VMain-BJLquw4_.js.br +0 -0
- codex/static_root/assets/VMain-BJLquw4_.js.gz +0 -0
- codex/static_root/assets/{VRadioGroup-CwUj-eML.52d49d81d329.js → VRadioGroup-BrO5lLMK.60b07cdd1b52.js} +1 -1
- codex/static_root/assets/VRadioGroup-BrO5lLMK.60b07cdd1b52.js.br +0 -0
- codex/static_root/assets/VRadioGroup-BrO5lLMK.60b07cdd1b52.js.gz +0 -0
- codex/static_root/assets/{VRadioGroup-CwUj-eML.js → VRadioGroup-BrO5lLMK.js} +1 -1
- codex/static_root/assets/VRadioGroup-BrO5lLMK.js.br +0 -0
- codex/static_root/assets/VRadioGroup-BrO5lLMK.js.gz +0 -0
- codex/static_root/assets/{VSelect-BXzpvIVS.106972540a3b.js → VSelect-CAEbdtAK.6d93a3800567.js} +1 -1
- codex/static_root/assets/VSelect-CAEbdtAK.6d93a3800567.js.br +0 -0
- codex/static_root/assets/VSelect-CAEbdtAK.6d93a3800567.js.gz +0 -0
- codex/static_root/assets/{VSelect-BXzpvIVS.js → VSelect-CAEbdtAK.js} +1 -1
- codex/static_root/assets/VSelect-CAEbdtAK.js.br +0 -0
- codex/static_root/assets/VSelect-CAEbdtAK.js.gz +0 -0
- codex/static_root/assets/{VSelectionControl-CHDbCGsK.95b27566a824.js → VSelectionControl-BoyRbIct.7cfcfa9ae20b.js} +1 -1
- codex/static_root/assets/VSelectionControl-BoyRbIct.7cfcfa9ae20b.js.br +0 -0
- codex/static_root/assets/VSelectionControl-BoyRbIct.7cfcfa9ae20b.js.gz +0 -0
- codex/static_root/assets/{VSelectionControl-CHDbCGsK.js → VSelectionControl-BoyRbIct.js} +1 -1
- codex/static_root/assets/VSelectionControl-BoyRbIct.js.br +0 -0
- codex/static_root/assets/VSelectionControl-BoyRbIct.js.gz +0 -0
- codex/static_root/assets/{VSlideGroup-DPSrOleH.js → VSlideGroup-IIebYuJm.d50fd68270e6.js} +1 -1
- codex/static_root/assets/VSlideGroup-IIebYuJm.d50fd68270e6.js.br +0 -0
- codex/static_root/assets/VSlideGroup-IIebYuJm.d50fd68270e6.js.gz +0 -0
- codex/static_root/assets/{VSlideGroup-DPSrOleH.9b00db003a6f.js → VSlideGroup-IIebYuJm.js} +1 -1
- codex/static_root/assets/VSlideGroup-IIebYuJm.js.br +0 -0
- codex/static_root/assets/VSlideGroup-IIebYuJm.js.gz +0 -0
- codex/static_root/assets/{VTable-DSwq08Hr.6b7314b9912c.js → VTable-XNBBnB2q.b2784736062a.js} +1 -1
- codex/static_root/assets/VTable-XNBBnB2q.b2784736062a.js.br +0 -0
- codex/static_root/assets/VTable-XNBBnB2q.b2784736062a.js.gz +0 -0
- codex/static_root/assets/{VTable-DSwq08Hr.js → VTable-XNBBnB2q.js} +1 -1
- codex/static_root/assets/VTable-XNBBnB2q.js.br +0 -0
- codex/static_root/assets/VTable-XNBBnB2q.js.gz +0 -0
- codex/static_root/assets/{VToolbar-DYWA0GOE.js → VToolbar-CLYsoOKq.acca0b6c0684.js} +2 -2
- codex/static_root/assets/VToolbar-CLYsoOKq.acca0b6c0684.js.br +0 -0
- codex/static_root/assets/VToolbar-CLYsoOKq.acca0b6c0684.js.gz +0 -0
- codex/static_root/assets/{VToolbar-DYWA0GOE.9b35cc96d9db.js → VToolbar-CLYsoOKq.js} +2 -2
- codex/static_root/assets/VToolbar-CLYsoOKq.js.br +0 -0
- codex/static_root/assets/VToolbar-CLYsoOKq.js.gz +0 -0
- codex/static_root/assets/{VWindowItem-D88lIhcX.cdb0241ad44a.js → VWindowItem-CPevuSn_.27817d5bd8e4.js} +1 -1
- codex/static_root/assets/VWindowItem-CPevuSn_.27817d5bd8e4.js.br +0 -0
- codex/static_root/assets/VWindowItem-CPevuSn_.27817d5bd8e4.js.gz +0 -0
- codex/static_root/assets/{VWindowItem-D88lIhcX.js → VWindowItem-CPevuSn_.js} +1 -1
- codex/static_root/assets/VWindowItem-CPevuSn_.js.br +0 -0
- codex/static_root/assets/VWindowItem-CPevuSn_.js.gz +0 -0
- codex/static_root/assets/{admin-DG8I_1o9.e12adb2948d9.js → admin-CzWbM7Nl.95cf937f31ff.js} +1 -1
- codex/static_root/assets/admin-CzWbM7Nl.95cf937f31ff.js.br +0 -0
- codex/static_root/assets/admin-CzWbM7Nl.95cf937f31ff.js.gz +0 -0
- codex/static_root/assets/{admin-DG8I_1o9.js → admin-CzWbM7Nl.js} +1 -1
- codex/static_root/assets/admin-CzWbM7Nl.js.br +0 -0
- codex/static_root/assets/admin-CzWbM7Nl.js.gz +0 -0
- codex/static_root/assets/admin-drawer-panel-B4-04ET4.ff74b52952d0.js +30 -0
- codex/static_root/assets/admin-drawer-panel-B4-04ET4.ff74b52952d0.js.br +0 -0
- codex/static_root/assets/admin-drawer-panel-B4-04ET4.ff74b52952d0.js.gz +0 -0
- codex/static_root/assets/admin-drawer-panel-B4-04ET4.js +30 -0
- codex/static_root/assets/admin-drawer-panel-B4-04ET4.js.br +0 -0
- codex/static_root/assets/admin-drawer-panel-B4-04ET4.js.gz +0 -0
- codex/static_root/assets/browser-BldK4CGS.ce8c71552de0.js +1 -0
- codex/static_root/assets/browser-BldK4CGS.ce8c71552de0.js.br +0 -0
- codex/static_root/assets/browser-BldK4CGS.ce8c71552de0.js.gz +0 -0
- codex/static_root/assets/browser-BldK4CGS.js +1 -0
- codex/static_root/assets/browser-BldK4CGS.js.br +0 -0
- codex/static_root/assets/browser-BldK4CGS.js.gz +0 -0
- codex/static_root/assets/{browser-7I3de1Zm.css → browser-HtKThxA9.69be059a55f4.css} +1 -1
- codex/static_root/assets/browser-HtKThxA9.69be059a55f4.css.br +0 -0
- codex/static_root/assets/browser-HtKThxA9.69be059a55f4.css.gz +0 -0
- codex/static_root/assets/{browser-7I3de1Zm.d1c4491dc518.css → browser-HtKThxA9.css} +1 -1
- codex/static_root/assets/browser-HtKThxA9.css.br +0 -0
- codex/static_root/assets/browser-HtKThxA9.css.gz +0 -0
- codex/static_root/assets/{change-password-dialog-BV_ODH9y.664f48401d8b.js → change-password-dialog-DAvSz_BT.89752c597186.js} +1 -1
- codex/static_root/assets/change-password-dialog-DAvSz_BT.89752c597186.js.br +0 -0
- codex/static_root/assets/change-password-dialog-DAvSz_BT.89752c597186.js.gz +0 -0
- codex/static_root/assets/{change-password-dialog-BV_ODH9y.js → change-password-dialog-DAvSz_BT.js} +1 -1
- codex/static_root/assets/change-password-dialog-DAvSz_BT.js.br +0 -0
- codex/static_root/assets/change-password-dialog-DAvSz_BT.js.gz +0 -0
- codex/static_root/assets/{confirm-dialog-BIpDlSGE.ab6bf1133220.js → confirm-dialog-0mqMQack.a2b39e1d65f7.js} +1 -1
- codex/static_root/assets/confirm-dialog-0mqMQack.a2b39e1d65f7.js.br +0 -0
- codex/static_root/assets/confirm-dialog-0mqMQack.a2b39e1d65f7.js.gz +0 -0
- codex/static_root/assets/{confirm-dialog-BIpDlSGE.js → confirm-dialog-0mqMQack.js} +1 -1
- codex/static_root/assets/confirm-dialog-0mqMQack.js.br +0 -0
- codex/static_root/assets/confirm-dialog-0mqMQack.js.gz +0 -0
- codex/static_root/assets/{confirm-footer-DhN-8qzR.602c25c2dffb.js → confirm-footer-oTUv06_v.99f172061491.js} +1 -1
- codex/static_root/assets/confirm-footer-oTUv06_v.99f172061491.js.br +0 -0
- codex/static_root/assets/confirm-footer-oTUv06_v.99f172061491.js.gz +0 -0
- codex/static_root/assets/{confirm-footer-DhN-8qzR.js → confirm-footer-oTUv06_v.js} +1 -1
- codex/static_root/assets/confirm-footer-oTUv06_v.js.br +0 -0
- codex/static_root/assets/confirm-footer-oTUv06_v.js.gz +0 -0
- codex/static_root/assets/{datetime-column-DOVxqPmv.bbf09a7a5bb3.js → datetime-column-D3I95kw3.26791f31ac02.js} +1 -1
- codex/static_root/assets/datetime-column-D3I95kw3.26791f31ac02.js.br +0 -0
- codex/static_root/assets/datetime-column-D3I95kw3.26791f31ac02.js.gz +0 -0
- codex/static_root/assets/{datetime-column-DOVxqPmv.js → datetime-column-D3I95kw3.js} +1 -1
- codex/static_root/assets/datetime-column-D3I95kw3.js.br +0 -0
- codex/static_root/assets/datetime-column-D3I95kw3.js.gz +0 -0
- codex/static_root/assets/{filter-B7r8rppG.87e2b2153392.js → filter-D95Y3XYa.b69f5d543997.js} +1 -1
- codex/static_root/assets/filter-D95Y3XYa.b69f5d543997.js.br +0 -0
- codex/static_root/assets/filter-D95Y3XYa.b69f5d543997.js.gz +0 -0
- codex/static_root/assets/{filter-B7r8rppG.js → filter-D95Y3XYa.js} +1 -1
- codex/static_root/assets/filter-D95Y3XYa.js.br +0 -0
- codex/static_root/assets/filter-D95Y3XYa.js.gz +0 -0
- codex/static_root/assets/{flag-tab-B8TJncWX.94045964b1c0.js → flag-tab-C9vu256Y.bd43f22c727b.js} +1 -1
- codex/static_root/assets/flag-tab-C9vu256Y.bd43f22c727b.js.br +0 -0
- codex/static_root/assets/flag-tab-C9vu256Y.bd43f22c727b.js.gz +0 -0
- codex/static_root/assets/{flag-tab-B8TJncWX.js → flag-tab-C9vu256Y.js} +1 -1
- codex/static_root/assets/flag-tab-C9vu256Y.js.br +0 -0
- codex/static_root/assets/flag-tab-C9vu256Y.js.gz +0 -0
- codex/static_root/assets/{group-tab-BAqNWSQm.229837adf6e3.js → group-tab-DKqBg4yc.22ea16c1e331.js} +1 -1
- codex/static_root/assets/group-tab-DKqBg4yc.22ea16c1e331.js.br +0 -0
- codex/static_root/assets/group-tab-DKqBg4yc.22ea16c1e331.js.gz +0 -0
- codex/static_root/assets/{group-tab-BAqNWSQm.js → group-tab-DKqBg4yc.js} +1 -1
- codex/static_root/assets/group-tab-DKqBg4yc.js.br +0 -0
- codex/static_root/assets/group-tab-DKqBg4yc.js.gz +0 -0
- codex/static_root/assets/{http-error-DbUTWOaX.6ef2b77638d3.js → http-error-F_AIFiVP.1d3b95f22256.js} +1 -1
- codex/static_root/assets/http-error-F_AIFiVP.1d3b95f22256.js.br +0 -0
- codex/static_root/assets/http-error-F_AIFiVP.1d3b95f22256.js.gz +0 -0
- codex/static_root/assets/{http-error-DbUTWOaX.js → http-error-F_AIFiVP.js} +1 -1
- codex/static_root/assets/http-error-F_AIFiVP.js.br +0 -0
- codex/static_root/assets/http-error-F_AIFiVP.js.gz +0 -0
- codex/static_root/assets/{library-tab-yLNCZsBM.8c8edc0586c0.js → library-tab-CKYjhIWV.a1119d2cb417.js} +1 -1
- codex/static_root/assets/library-tab-CKYjhIWV.a1119d2cb417.js.br +0 -0
- codex/static_root/assets/library-tab-CKYjhIWV.a1119d2cb417.js.gz +0 -0
- codex/static_root/assets/{library-tab-yLNCZsBM.js → library-tab-CKYjhIWV.js} +1 -1
- codex/static_root/assets/library-tab-CKYjhIWV.js.br +0 -0
- codex/static_root/assets/library-tab-CKYjhIWV.js.gz +0 -0
- codex/static_root/assets/main-BJxn-WA7.a04c671bd796.js +32 -0
- codex/static_root/assets/main-BJxn-WA7.a04c671bd796.js.br +0 -0
- codex/static_root/assets/main-BJxn-WA7.a04c671bd796.js.gz +0 -0
- codex/static_root/assets/main-BJxn-WA7.js +32 -0
- codex/static_root/assets/main-BJxn-WA7.js.br +0 -0
- codex/static_root/assets/main-BJxn-WA7.js.gz +0 -0
- codex/static_root/assets/{metadata-dialog-BNbDCJg7.70cacfbc0536.js → metadata-dialog-DNdhw8Y2.21df0d7eff56.js} +1 -1
- codex/static_root/assets/metadata-dialog-DNdhw8Y2.21df0d7eff56.js.br +0 -0
- codex/static_root/assets/metadata-dialog-DNdhw8Y2.21df0d7eff56.js.gz +0 -0
- codex/static_root/assets/{metadata-dialog-BNbDCJg7.js → metadata-dialog-DNdhw8Y2.js} +1 -1
- codex/static_root/assets/metadata-dialog-DNdhw8Y2.js.br +0 -0
- codex/static_root/assets/metadata-dialog-DNdhw8Y2.js.gz +0 -0
- codex/static_root/assets/{pdf-doc-Bo-Cv7Ru.4fa999527280.js → pdf-doc-DQV6XqAo.38b6ebeec5bc.js} +2 -2
- codex/static_root/assets/pdf-doc-DQV6XqAo.38b6ebeec5bc.js.br +0 -0
- codex/static_root/assets/pdf-doc-DQV6XqAo.38b6ebeec5bc.js.gz +0 -0
- codex/static_root/assets/{pdf-doc-Bo-Cv7Ru.js → pdf-doc-DQV6XqAo.js} +2 -2
- codex/static_root/assets/pdf-doc-DQV6XqAo.js.br +0 -0
- codex/static_root/assets/pdf-doc-DQV6XqAo.js.gz +0 -0
- codex/static_root/assets/{reader-CulWOzUB.a66ef578e44e.js → reader-BuAYRwBN.3f834951f509.js} +2 -2
- codex/static_root/assets/reader-BuAYRwBN.3f834951f509.js.br +0 -0
- codex/static_root/assets/reader-BuAYRwBN.3f834951f509.js.gz +0 -0
- codex/static_root/assets/{reader-CulWOzUB.js → reader-BuAYRwBN.js} +2 -2
- codex/static_root/assets/reader-BuAYRwBN.js.br +0 -0
- codex/static_root/assets/reader-BuAYRwBN.js.gz +0 -0
- codex/static_root/assets/{stats-tab-RbFCTTow.eac6ebe9d1fb.js → stats-tab-wzOFMrgw.ffc62bf814ce.js} +1 -1
- codex/static_root/assets/stats-tab-wzOFMrgw.ffc62bf814ce.js.br +0 -0
- codex/static_root/assets/stats-tab-wzOFMrgw.ffc62bf814ce.js.gz +0 -0
- codex/static_root/assets/{stats-tab-RbFCTTow.js → stats-tab-wzOFMrgw.js} +1 -1
- codex/static_root/assets/stats-tab-wzOFMrgw.js.br +0 -0
- codex/static_root/assets/stats-tab-wzOFMrgw.js.gz +0 -0
- codex/static_root/assets/{task-tab-hutxnAPI.a19426fe568a.js → task-tab-UYMTSKl-.c37096a07f51.js} +1 -1
- codex/static_root/assets/task-tab-UYMTSKl-.c37096a07f51.js.br +0 -0
- codex/static_root/assets/task-tab-UYMTSKl-.c37096a07f51.js.gz +0 -0
- codex/static_root/assets/{task-tab-hutxnAPI.js → task-tab-UYMTSKl-.js} +1 -1
- codex/static_root/assets/task-tab-UYMTSKl-.js.br +0 -0
- codex/static_root/assets/task-tab-UYMTSKl-.js.gz +0 -0
- codex/static_root/assets/{user-tab-C8bP33qh.9fa57703c1cc.js → user-tab-ByP2OwxN.255023553b2e.js} +1 -1
- codex/static_root/assets/user-tab-ByP2OwxN.255023553b2e.js.br +0 -0
- codex/static_root/assets/user-tab-ByP2OwxN.255023553b2e.js.gz +0 -0
- codex/static_root/assets/{user-tab-C8bP33qh.js → user-tab-ByP2OwxN.js} +1 -1
- codex/static_root/assets/user-tab-ByP2OwxN.js.br +0 -0
- codex/static_root/assets/user-tab-ByP2OwxN.js.gz +0 -0
- codex/static_root/{manifest.3c8e080861c8.json → manifest.d2fc837c9c53.json} +206 -206
- codex/static_root/manifest.d2fc837c9c53.json.br +0 -0
- codex/static_root/manifest.d2fc837c9c53.json.gz +0 -0
- codex/static_root/manifest.json +206 -206
- codex/static_root/manifest.json.br +0 -0
- codex/static_root/manifest.json.gz +0 -0
- codex/static_root/staticfiles.json +1 -1
- {codex-1.5.16.dist-info → codex-1.5.17.dist-info}/METADATA +1 -1
- {codex-1.5.16.dist-info → codex-1.5.17.dist-info}/RECORD +210 -210
- codex/static_root/assets/VCheckbox-B2I5x4E4.e5760ee532b4.js.br +0 -0
- codex/static_root/assets/VCheckbox-B2I5x4E4.e5760ee532b4.js.gz +0 -0
- codex/static_root/assets/VCheckbox-B2I5x4E4.js.br +0 -0
- codex/static_root/assets/VCheckbox-B2I5x4E4.js.gz +0 -0
- codex/static_root/assets/VCheckboxBtn-BVyOdyPP.ff87efeb3f18.js.br +0 -0
- codex/static_root/assets/VCheckboxBtn-BVyOdyPP.ff87efeb3f18.js.gz +0 -0
- codex/static_root/assets/VCheckboxBtn-BVyOdyPP.js.br +0 -0
- codex/static_root/assets/VCheckboxBtn-BVyOdyPP.js.gz +0 -0
- codex/static_root/assets/VCombobox-BZB5L26B.8efee843a0e6.js.br +0 -0
- codex/static_root/assets/VCombobox-BZB5L26B.8efee843a0e6.js.gz +0 -0
- codex/static_root/assets/VCombobox-BZB5L26B.js.br +0 -0
- codex/static_root/assets/VCombobox-BZB5L26B.js.gz +0 -0
- codex/static_root/assets/VDataTableVirtual-DbkXd_aw.3d4697fb57fe.js.br +0 -0
- codex/static_root/assets/VDataTableVirtual-DbkXd_aw.3d4697fb57fe.js.gz +0 -0
- codex/static_root/assets/VDataTableVirtual-DbkXd_aw.js.br +0 -0
- codex/static_root/assets/VDataTableVirtual-DbkXd_aw.js.gz +0 -0
- codex/static_root/assets/VExpansionPanel-CyJaSVs6.c257f8312b65.js.br +0 -0
- codex/static_root/assets/VExpansionPanel-CyJaSVs6.c257f8312b65.js.gz +0 -0
- codex/static_root/assets/VExpansionPanel-CyJaSVs6.js.br +0 -0
- codex/static_root/assets/VExpansionPanel-CyJaSVs6.js.gz +0 -0
- codex/static_root/assets/VMain-Bg06hxTl.447b2c0f6da3.js.br +0 -0
- codex/static_root/assets/VMain-Bg06hxTl.447b2c0f6da3.js.gz +0 -0
- codex/static_root/assets/VMain-Bg06hxTl.js.br +0 -0
- codex/static_root/assets/VMain-Bg06hxTl.js.gz +0 -0
- codex/static_root/assets/VRadioGroup-CwUj-eML.52d49d81d329.js.br +0 -7
- codex/static_root/assets/VRadioGroup-CwUj-eML.52d49d81d329.js.gz +0 -0
- codex/static_root/assets/VRadioGroup-CwUj-eML.js.br +0 -7
- codex/static_root/assets/VRadioGroup-CwUj-eML.js.gz +0 -0
- codex/static_root/assets/VSelect-BXzpvIVS.106972540a3b.js.br +0 -0
- codex/static_root/assets/VSelect-BXzpvIVS.106972540a3b.js.gz +0 -0
- codex/static_root/assets/VSelect-BXzpvIVS.js.br +0 -0
- codex/static_root/assets/VSelect-BXzpvIVS.js.gz +0 -0
- codex/static_root/assets/VSelectionControl-CHDbCGsK.95b27566a824.js.br +0 -0
- codex/static_root/assets/VSelectionControl-CHDbCGsK.95b27566a824.js.gz +0 -0
- codex/static_root/assets/VSelectionControl-CHDbCGsK.js.br +0 -0
- codex/static_root/assets/VSelectionControl-CHDbCGsK.js.gz +0 -0
- codex/static_root/assets/VSlideGroup-DPSrOleH.9b00db003a6f.js.br +0 -0
- codex/static_root/assets/VSlideGroup-DPSrOleH.9b00db003a6f.js.gz +0 -0
- codex/static_root/assets/VSlideGroup-DPSrOleH.js.br +0 -0
- codex/static_root/assets/VSlideGroup-DPSrOleH.js.gz +0 -0
- codex/static_root/assets/VTable-DSwq08Hr.6b7314b9912c.js.br +0 -0
- codex/static_root/assets/VTable-DSwq08Hr.6b7314b9912c.js.gz +0 -0
- codex/static_root/assets/VTable-DSwq08Hr.js.br +0 -0
- codex/static_root/assets/VTable-DSwq08Hr.js.gz +0 -0
- codex/static_root/assets/VToolbar-DYWA0GOE.9b35cc96d9db.js.br +0 -0
- codex/static_root/assets/VToolbar-DYWA0GOE.9b35cc96d9db.js.gz +0 -0
- codex/static_root/assets/VToolbar-DYWA0GOE.js.br +0 -0
- codex/static_root/assets/VToolbar-DYWA0GOE.js.gz +0 -0
- codex/static_root/assets/VWindowItem-D88lIhcX.cdb0241ad44a.js.br +0 -0
- codex/static_root/assets/VWindowItem-D88lIhcX.cdb0241ad44a.js.gz +0 -0
- codex/static_root/assets/VWindowItem-D88lIhcX.js.br +0 -0
- codex/static_root/assets/VWindowItem-D88lIhcX.js.gz +0 -0
- codex/static_root/assets/admin-DG8I_1o9.e12adb2948d9.js.br +0 -0
- codex/static_root/assets/admin-DG8I_1o9.e12adb2948d9.js.gz +0 -0
- codex/static_root/assets/admin-DG8I_1o9.js.br +0 -0
- codex/static_root/assets/admin-DG8I_1o9.js.gz +0 -0
- codex/static_root/assets/admin-drawer-panel-BFTD31i8.fb78744bdfa0.js +0 -30
- codex/static_root/assets/admin-drawer-panel-BFTD31i8.fb78744bdfa0.js.br +0 -0
- codex/static_root/assets/admin-drawer-panel-BFTD31i8.fb78744bdfa0.js.gz +0 -0
- codex/static_root/assets/admin-drawer-panel-BFTD31i8.js +0 -30
- codex/static_root/assets/admin-drawer-panel-BFTD31i8.js.br +0 -0
- codex/static_root/assets/admin-drawer-panel-BFTD31i8.js.gz +0 -0
- codex/static_root/assets/browser-7I3de1Zm.css.br +0 -0
- codex/static_root/assets/browser-7I3de1Zm.css.gz +0 -0
- codex/static_root/assets/browser-7I3de1Zm.d1c4491dc518.css.br +0 -0
- codex/static_root/assets/browser-7I3de1Zm.d1c4491dc518.css.gz +0 -0
- codex/static_root/assets/browser-D3SvXcAI.f9ddc64681a0.js +0 -1
- codex/static_root/assets/browser-D3SvXcAI.f9ddc64681a0.js.br +0 -0
- codex/static_root/assets/browser-D3SvXcAI.f9ddc64681a0.js.gz +0 -0
- codex/static_root/assets/browser-D3SvXcAI.js +0 -1
- codex/static_root/assets/browser-D3SvXcAI.js.br +0 -0
- codex/static_root/assets/browser-D3SvXcAI.js.gz +0 -0
- codex/static_root/assets/change-password-dialog-BV_ODH9y.664f48401d8b.js.br +0 -0
- codex/static_root/assets/change-password-dialog-BV_ODH9y.664f48401d8b.js.gz +0 -0
- codex/static_root/assets/change-password-dialog-BV_ODH9y.js.br +0 -0
- codex/static_root/assets/change-password-dialog-BV_ODH9y.js.gz +0 -0
- codex/static_root/assets/confirm-dialog-BIpDlSGE.ab6bf1133220.js.br +0 -0
- codex/static_root/assets/confirm-dialog-BIpDlSGE.ab6bf1133220.js.gz +0 -0
- codex/static_root/assets/confirm-dialog-BIpDlSGE.js.br +0 -0
- codex/static_root/assets/confirm-dialog-BIpDlSGE.js.gz +0 -0
- codex/static_root/assets/confirm-footer-DhN-8qzR.602c25c2dffb.js.br +0 -0
- codex/static_root/assets/confirm-footer-DhN-8qzR.602c25c2dffb.js.gz +0 -0
- codex/static_root/assets/confirm-footer-DhN-8qzR.js.br +0 -0
- codex/static_root/assets/confirm-footer-DhN-8qzR.js.gz +0 -0
- codex/static_root/assets/datetime-column-DOVxqPmv.bbf09a7a5bb3.js.br +0 -0
- codex/static_root/assets/datetime-column-DOVxqPmv.bbf09a7a5bb3.js.gz +0 -0
- codex/static_root/assets/datetime-column-DOVxqPmv.js.br +0 -0
- codex/static_root/assets/datetime-column-DOVxqPmv.js.gz +0 -0
- codex/static_root/assets/filter-B7r8rppG.87e2b2153392.js.br +0 -0
- codex/static_root/assets/filter-B7r8rppG.87e2b2153392.js.gz +0 -0
- codex/static_root/assets/filter-B7r8rppG.js.br +0 -0
- codex/static_root/assets/filter-B7r8rppG.js.gz +0 -0
- codex/static_root/assets/flag-tab-B8TJncWX.94045964b1c0.js.br +0 -0
- codex/static_root/assets/flag-tab-B8TJncWX.94045964b1c0.js.gz +0 -0
- codex/static_root/assets/flag-tab-B8TJncWX.js.br +0 -0
- codex/static_root/assets/flag-tab-B8TJncWX.js.gz +0 -0
- codex/static_root/assets/group-tab-BAqNWSQm.229837adf6e3.js.br +0 -0
- codex/static_root/assets/group-tab-BAqNWSQm.229837adf6e3.js.gz +0 -0
- codex/static_root/assets/group-tab-BAqNWSQm.js.br +0 -0
- codex/static_root/assets/group-tab-BAqNWSQm.js.gz +0 -0
- codex/static_root/assets/http-error-DbUTWOaX.6ef2b77638d3.js.br +0 -0
- codex/static_root/assets/http-error-DbUTWOaX.6ef2b77638d3.js.gz +0 -0
- codex/static_root/assets/http-error-DbUTWOaX.js.br +0 -0
- codex/static_root/assets/http-error-DbUTWOaX.js.gz +0 -0
- codex/static_root/assets/library-tab-yLNCZsBM.8c8edc0586c0.js.br +0 -0
- codex/static_root/assets/library-tab-yLNCZsBM.8c8edc0586c0.js.gz +0 -0
- codex/static_root/assets/library-tab-yLNCZsBM.js.br +0 -0
- codex/static_root/assets/library-tab-yLNCZsBM.js.gz +0 -0
- codex/static_root/assets/main-BpWFVT87.170f189b93aa.js +0 -32
- codex/static_root/assets/main-BpWFVT87.170f189b93aa.js.br +0 -0
- codex/static_root/assets/main-BpWFVT87.170f189b93aa.js.gz +0 -0
- codex/static_root/assets/main-BpWFVT87.js +0 -32
- codex/static_root/assets/main-BpWFVT87.js.br +0 -0
- codex/static_root/assets/main-BpWFVT87.js.gz +0 -0
- codex/static_root/assets/metadata-dialog-BNbDCJg7.70cacfbc0536.js.br +0 -0
- codex/static_root/assets/metadata-dialog-BNbDCJg7.70cacfbc0536.js.gz +0 -0
- codex/static_root/assets/metadata-dialog-BNbDCJg7.js.br +0 -0
- codex/static_root/assets/metadata-dialog-BNbDCJg7.js.gz +0 -0
- codex/static_root/assets/pdf-doc-Bo-Cv7Ru.4fa999527280.js.br +0 -0
- codex/static_root/assets/pdf-doc-Bo-Cv7Ru.4fa999527280.js.gz +0 -0
- codex/static_root/assets/pdf-doc-Bo-Cv7Ru.js.br +0 -0
- codex/static_root/assets/pdf-doc-Bo-Cv7Ru.js.gz +0 -0
- codex/static_root/assets/reader-CulWOzUB.a66ef578e44e.js.br +0 -0
- codex/static_root/assets/reader-CulWOzUB.a66ef578e44e.js.gz +0 -0
- codex/static_root/assets/reader-CulWOzUB.js.br +0 -0
- codex/static_root/assets/reader-CulWOzUB.js.gz +0 -0
- codex/static_root/assets/stats-tab-RbFCTTow.eac6ebe9d1fb.js.br +0 -0
- codex/static_root/assets/stats-tab-RbFCTTow.eac6ebe9d1fb.js.gz +0 -0
- codex/static_root/assets/stats-tab-RbFCTTow.js.br +0 -0
- codex/static_root/assets/stats-tab-RbFCTTow.js.gz +0 -0
- codex/static_root/assets/task-tab-hutxnAPI.a19426fe568a.js.br +0 -0
- codex/static_root/assets/task-tab-hutxnAPI.a19426fe568a.js.gz +0 -0
- codex/static_root/assets/task-tab-hutxnAPI.js.br +0 -0
- codex/static_root/assets/task-tab-hutxnAPI.js.gz +0 -0
- codex/static_root/assets/user-tab-C8bP33qh.9fa57703c1cc.js.br +0 -0
- codex/static_root/assets/user-tab-C8bP33qh.9fa57703c1cc.js.gz +0 -0
- codex/static_root/assets/user-tab-C8bP33qh.js.br +0 -0
- codex/static_root/assets/user-tab-C8bP33qh.js.gz +0 -0
- codex/static_root/manifest.3c8e080861c8.json.br +0 -0
- codex/static_root/manifest.3c8e080861c8.json.gz +0 -0
- {codex-1.5.16.dist-info → codex-1.5.17.dist-info}/LICENSE +0 -0
- {codex-1.5.16.dist-info → codex-1.5.17.dist-info}/WHEEL +0 -0
- {codex-1.5.16.dist-info → codex-1.5.17.dist-info}/entry_points.txt +0 -0
codex/static_root/assets/{pdf-doc-Bo-Cv7Ru.4fa999527280.js → pdf-doc-DQV6XqAo.38b6ebeec5bc.js}
RENAMED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
var Ks=Object.defineProperty;var vs=(lt,r,h)=>r in lt?Ks(lt,r,{enumerable:!0,configurable:!0,writable:!0,value:h}):lt[r]=h;var gl=(lt,r,h)=>(vs(lt,typeof r!="symbol"?r+"":r,h),h),Xe=(lt,r,h)=>{if(!r.has(lt))throw TypeError("Cannot "+h)};var bt=(lt,r,h)=>(Xe(lt,r,"read from private field"),h?h.call(lt):r.get(lt)),ll=(lt,r,h)=>{if(r.has(lt))throw TypeError("Cannot add the same private member more than once");r instanceof WeakSet?r.add(lt):r.set(lt,h)},ul=(lt,r,h,M)=>(Xe(lt,r,"write to private field"),M?M.call(lt,h):r.set(lt,h),h);var Al=(lt,r,h,M)=>({set _(p){ul(lt,r,p,h)},get _(){return bt(lt,r,M)}}),nl=(lt,r,h)=>(Xe(lt,r,"access private method"),h);import{s as shallowRef,w as watchEffect,dw as toValue,o as onBeforeUnmount,e as defineComponent,r as ref,au as toRef,h as computed,a as watch,R as openBlock,ay as createElementBlock,al as Fragment,az as renderList,aK as renderSlot,aD as createBaseVNode,aB as createCommentVNode,bk as normalizeStyle,_ as _export_sfc,ax as mapGetters,M as mapState,N as mapActions,Q as resolveComponent,O as createBlock,ab as normalizeClass}from"./admin-drawer-panel-BFTD31i8.js";import{g as getAugmentedNamespace$1}from"./main-BpWFVT87.js";import{u as useReaderStore}from"./VToolbar-DYWA0GOE.js";import"./index-DUjeNg4x.js";import"./confirm-footer-DhN-8qzR.js";import"./change-password-dialog-BV_ODH9y.js";import"./VSlideGroup-DPSrOleH.js";import"./VSelectionControl-CHDbCGsK.js";function commonjsRequire$1(lt){throw new Error('Could not dynamically require "'+lt+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var pdf$1={exports:{}};const __viteBrowserExternal$2={},__viteBrowserExternal$3=Object.freeze(Object.defineProperty({__proto__:null,default:__viteBrowserExternal$2},Symbol.toStringTag,{value:"Module"})),require$$5=getAugmentedNamespace$1(__viteBrowserExternal$3);(function(module,exports){(function(r,h){module.exports=r.pdfjsLib=h()})(globalThis,()=>(()=>{var __webpack_modules__=[,(lt,r)=>{var Vl;Object.defineProperty(r,"__esModule",{value:!0}),r.VerbosityLevel=r.Util=r.UnknownErrorException=r.UnexpectedResponseException=r.TextRenderingMode=r.RenderingIntentFlag=r.PromiseCapability=r.PermissionFlag=r.PasswordResponses=r.PasswordException=r.PageActionEventType=r.OPS=r.MissingPDFException=r.MAX_IMAGE_SIZE_TO_CACHE=r.LINE_FACTOR=r.LINE_DESCENT_FACTOR=r.InvalidPDFException=r.ImageKind=r.IDENTITY_MATRIX=r.FormatError=r.FeatureTest=r.FONT_IDENTITY_MATRIX=r.DocumentActionEventType=r.CMapCompressionType=r.BaseException=r.BASELINE_FACTOR=r.AnnotationType=r.AnnotationReplyType=r.AnnotationPrefix=r.AnnotationMode=r.AnnotationFlag=r.AnnotationFieldFlag=r.AnnotationEditorType=r.AnnotationEditorPrefix=r.AnnotationEditorParamsType=r.AnnotationBorderStyleType=r.AnnotationActionEventType=r.AbortException=void 0,r.assert=Ut,r.bytesToString=Mt,r.createValidAbsoluteUrl=Ht,r.getModificationDate=dl,r.getUuid=Ll,r.getVerbosityLevel=Xt,r.info=zt,r.isArrayBuffer=Ct,r.isArrayEqual=$t,r.isNodeJS=void 0,r.normalizeUnicode=pl,r.objectFromMap=Dt,r.objectSize=Jt,r.setVerbosityLevel=it,r.shadow=Pt,r.string32=gt,r.stringToBytes=Rt,r.stringToPDFString=Ft,r.stringToUTF8String=wt,r.unreachable=Nt,r.utf8StringToString=pt,r.warn=Gt;const h=typeof process=="object"&&process+""=="[object process]"&&!process.versions.nw&&!(process.versions.electron&&process.type&&process.type!=="browser");r.isNodeJS=h;const M=[1,0,0,1,0,0];r.IDENTITY_MATRIX=M;const p=[.001,0,0,.001,0,0];r.FONT_IDENTITY_MATRIX=p;const B=1e7;r.MAX_IMAGE_SIZE_TO_CACHE=B;const Q=1.35;r.LINE_FACTOR=Q;const U=.35;r.LINE_DESCENT_FACTOR=U;const O=U/Q;r.BASELINE_FACTOR=O;const I={ANY:1,DISPLAY:2,PRINT:4,SAVE:8,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,OPLIST:256};r.RenderingIntentFlag=I;const j={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3};r.AnnotationMode=j;const q="pdfjs_internal_editor_";r.AnnotationEditorPrefix=q;const K={DISABLE:-1,NONE:0,FREETEXT:3,STAMP:13,INK:15};r.AnnotationEditorType=K;const f={RESIZE:1,CREATE:2,FREETEXT_SIZE:11,FREETEXT_COLOR:12,FREETEXT_OPACITY:13,INK_COLOR:21,INK_THICKNESS:22,INK_OPACITY:23};r.AnnotationEditorParamsType=f;const S={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048};r.PermissionFlag=S;const k={FILL:0,STROKE:1,FILL_STROKE:2,INVISIBLE:3,FILL_ADD_TO_PATH:4,STROKE_ADD_TO_PATH:5,FILL_STROKE_ADD_TO_PATH:6,ADD_TO_PATH:7,FILL_STROKE_MASK:3,ADD_TO_PATH_FLAG:4};r.TextRenderingMode=k;const T={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3};r.ImageKind=T;const g={TEXT:1,LINK:2,FREETEXT:3,LINE:4,SQUARE:5,CIRCLE:6,POLYGON:7,POLYLINE:8,HIGHLIGHT:9,UNDERLINE:10,SQUIGGLY:11,STRIKEOUT:12,STAMP:13,CARET:14,INK:15,POPUP:16,FILEATTACHMENT:17,SOUND:18,MOVIE:19,WIDGET:20,SCREEN:21,PRINTERMARK:22,TRAPNET:23,WATERMARK:24,THREED:25,REDACT:26};r.AnnotationType=g;const F={GROUP:"Group",REPLY:"R"};r.AnnotationReplyType=F;const J={INVISIBLE:1,HIDDEN:2,PRINT:4,NOZOOM:8,NOROTATE:16,NOVIEW:32,READONLY:64,LOCKED:128,TOGGLENOVIEW:256,LOCKEDCONTENTS:512};r.AnnotationFlag=J;const v={READONLY:1,REQUIRED:2,NOEXPORT:4,MULTILINE:4096,PASSWORD:8192,NOTOGGLETOOFF:16384,RADIO:32768,PUSHBUTTON:65536,COMBO:131072,EDIT:262144,SORT:524288,FILESELECT:1048576,MULTISELECT:2097152,DONOTSPELLCHECK:4194304,DONOTSCROLL:8388608,COMB:16777216,RICHTEXT:33554432,RADIOSINUNISON:33554432,COMMITONSELCHANGE:67108864};r.AnnotationFieldFlag=v;const u={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5};r.AnnotationBorderStyleType=u;const m={E:"Mouse Enter",X:"Mouse Exit",D:"Mouse Down",U:"Mouse Up",Fo:"Focus",Bl:"Blur",PO:"PageOpen",PC:"PageClose",PV:"PageVisible",PI:"PageInvisible",K:"Keystroke",F:"Format",V:"Validate",C:"Calculate"};r.AnnotationActionEventType=m;const _={WC:"WillClose",WS:"WillSave",DS:"DidSave",WP:"WillPrint",DP:"DidPrint"};r.DocumentActionEventType=_;const $={O:"PageOpen",C:"PageClose"};r.PageActionEventType=$;const P={ERRORS:0,WARNINGS:1,INFOS:5};r.VerbosityLevel=P;const Zt={NONE:0,BINARY:1};r.CMapCompressionType=Zt;const dt={dependency:1,setLineWidth:2,setLineCap:3,setLineJoin:4,setMiterLimit:5,setDash:6,setRenderingIntent:7,setFlatness:8,setGState:9,save:10,restore:11,transform:12,moveTo:13,lineTo:14,curveTo:15,curveTo2:16,curveTo3:17,closePath:18,rectangle:19,stroke:20,closeStroke:21,fill:22,eoFill:23,fillStroke:24,eoFillStroke:25,closeFillStroke:26,closeEOFillStroke:27,endPath:28,clip:29,eoClip:30,beginText:31,endText:32,setCharSpacing:33,setWordSpacing:34,setHScale:35,setLeading:36,setFont:37,setTextRenderingMode:38,setTextRise:39,moveText:40,setLeadingMoveText:41,setTextMatrix:42,nextLine:43,showText:44,showSpacedText:45,nextLineShowText:46,nextLineSetSpacingShowText:47,setCharWidth:48,setCharWidthAndBounds:49,setStrokeColorSpace:50,setFillColorSpace:51,setStrokeColor:52,setStrokeColorN:53,setFillColor:54,setFillColorN:55,setStrokeGray:56,setFillGray:57,setStrokeRGBColor:58,setFillRGBColor:59,setStrokeCMYKColor:60,setFillCMYKColor:61,shadingFill:62,beginInlineImage:63,beginImageData:64,endInlineImage:65,paintXObject:66,markPoint:67,markPointProps:68,beginMarkedContent:69,beginMarkedContentProps:70,endMarkedContent:71,beginCompat:72,endCompat:73,paintFormXObjectBegin:74,paintFormXObjectEnd:75,beginGroup:76,endGroup:77,beginAnnotation:80,endAnnotation:81,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,paintSolidColorImageMask:90,constructPath:91};r.OPS=dt;const It={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};r.PasswordResponses=It;let xt=P.WARNINGS;function it(_t){Number.isInteger(_t)&&(xt=_t)}function Xt(){return xt}function zt(_t){xt>=P.INFOS&&console.log(`Info: ${_t}`)}function Gt(_t){xt>=P.WARNINGS&&console.log(`Warning: ${_t}`)}function Nt(_t){throw new Error(_t)}function Ut(_t,ot){_t||Nt(ot)}function Vt(_t){switch(_t==null?void 0:_t.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}function Ht(_t,ot=null,ut=null){if(!_t)return null;try{if(ut&&typeof _t=="string"){if(ut.addDefaultProtocol&&_t.startsWith("www.")){const jt=_t.match(/\./g);(jt==null?void 0:jt.length)>=2&&(_t=`http://${_t}`)}if(ut.tryConvertEncoding)try{_t=wt(_t)}catch{}}const Tt=ot?new URL(_t,ot):new URL(_t);if(Vt(Tt))return Tt}catch{}return null}function Pt(_t,ot,ut,Tt=!1){return Object.defineProperty(_t,ot,{value:ut,enumerable:!Tt,configurable:!0,writable:!1}),ut}const at=function(){function ot(ut,Tt){this.constructor===ot&&Nt("Cannot initialize BaseException."),this.message=ut,this.name=Tt}return ot.prototype=new Error,ot.constructor=ot,ot}();r.BaseException=at;class R extends at{constructor(ot,ut){super(ot,"PasswordException"),this.code=ut}}r.PasswordException=R;class w extends at{constructor(ot,ut){super(ot,"UnknownErrorException"),this.details=ut}}r.UnknownErrorException=w;class X extends at{constructor(ot){super(ot,"InvalidPDFException")}}r.InvalidPDFException=X;class C extends at{constructor(ot){super(ot,"MissingPDFException")}}r.MissingPDFException=C;class H extends at{constructor(ot,ut){super(ot,"UnexpectedResponseException"),this.status=ut}}r.UnexpectedResponseException=H;class st extends at{constructor(ot){super(ot,"FormatError")}}r.FormatError=st;class et extends at{constructor(ot){super(ot,"AbortException")}}r.AbortException=et;function Mt(_t){(typeof _t!="object"||(_t==null?void 0:_t.length)===void 0)&&Nt("Invalid argument for bytesToString");const ot=_t.length,ut=8192;if(ot<ut)return String.fromCharCode.apply(null,_t);const Tt=[];for(let jt=0;jt<ot;jt+=ut){const Ot=Math.min(jt+ut,ot),Lt=_t.subarray(jt,Ot);Tt.push(String.fromCharCode.apply(null,Lt))}return Tt.join("")}function Rt(_t){typeof _t!="string"&&Nt("Invalid argument for stringToBytes");const ot=_t.length,ut=new Uint8Array(ot);for(let Tt=0;Tt<ot;++Tt)ut[Tt]=_t.charCodeAt(Tt)&255;return ut}function gt(_t){return String.fromCharCode(_t>>24&255,_t>>16&255,_t>>8&255,_t&255)}function Jt(_t){return Object.keys(_t).length}function Dt(_t){const ot=Object.create(null);for(const[ut,Tt]of _t)ot[ut]=Tt;return ot}function qt(){const _t=new Uint8Array(4);return _t[0]=1,new Uint32Array(_t.buffer,0,1)[0]===1}function vt(){try{return new Function(""),!0}catch{return!1}}class cl{static get isLittleEndian(){return Pt(this,"isLittleEndian",qt())}static get isEvalSupported(){return Pt(this,"isEvalSupported",vt())}static get isOffscreenCanvasSupported(){return Pt(this,"isOffscreenCanvasSupported",typeof OffscreenCanvas<"u")}static get platform(){return typeof navigator>"u"?Pt(this,"platform",{isWin:!1,isMac:!1}):Pt(this,"platform",{isWin:navigator.platform.includes("Win"),isMac:navigator.platform.includes("Mac")})}static get isCSSRoundSupported(){var ot,ut;return Pt(this,"isCSSRoundSupported",(ut=(ot=globalThis.CSS)==null?void 0:ot.supports)==null?void 0:ut.call(ot,"width: round(1.5px, 1px)"))}}r.FeatureTest=cl;const bl=[...Array(256).keys()].map(_t=>_t.toString(16).padStart(2,"0"));class il{static makeHexColor(ot,ut,Tt){return`#${bl[ot]}${bl[ut]}${bl[Tt]}`}static scaleMinMax(ot,ut){let Tt;ot[0]?(ot[0]<0&&(Tt=ut[0],ut[0]=ut[1],ut[1]=Tt),ut[0]*=ot[0],ut[1]*=ot[0],ot[3]<0&&(Tt=ut[2],ut[2]=ut[3],ut[3]=Tt),ut[2]*=ot[3],ut[3]*=ot[3]):(Tt=ut[0],ut[0]=ut[2],ut[2]=Tt,Tt=ut[1],ut[1]=ut[3],ut[3]=Tt,ot[1]<0&&(Tt=ut[2],ut[2]=ut[3],ut[3]=Tt),ut[2]*=ot[1],ut[3]*=ot[1],ot[2]<0&&(Tt=ut[0],ut[0]=ut[1],ut[1]=Tt),ut[0]*=ot[2],ut[1]*=ot[2]),ut[0]+=ot[4],ut[1]+=ot[4],ut[2]+=ot[5],ut[3]+=ot[5]}static transform(ot,ut){return[ot[0]*ut[0]+ot[2]*ut[1],ot[1]*ut[0]+ot[3]*ut[1],ot[0]*ut[2]+ot[2]*ut[3],ot[1]*ut[2]+ot[3]*ut[3],ot[0]*ut[4]+ot[2]*ut[5]+ot[4],ot[1]*ut[4]+ot[3]*ut[5]+ot[5]]}static applyTransform(ot,ut){const Tt=ot[0]*ut[0]+ot[1]*ut[2]+ut[4],jt=ot[0]*ut[1]+ot[1]*ut[3]+ut[5];return[Tt,jt]}static applyInverseTransform(ot,ut){const Tt=ut[0]*ut[3]-ut[1]*ut[2],jt=(ot[0]*ut[3]-ot[1]*ut[2]+ut[2]*ut[5]-ut[4]*ut[3])/Tt,Ot=(-ot[0]*ut[1]+ot[1]*ut[0]+ut[4]*ut[1]-ut[5]*ut[0])/Tt;return[jt,Ot]}static getAxialAlignedBoundingBox(ot,ut){const Tt=this.applyTransform(ot,ut),jt=this.applyTransform(ot.slice(2,4),ut),Ot=this.applyTransform([ot[0],ot[3]],ut),Lt=this.applyTransform([ot[2],ot[1]],ut);return[Math.min(Tt[0],jt[0],Ot[0],Lt[0]),Math.min(Tt[1],jt[1],Ot[1],Lt[1]),Math.max(Tt[0],jt[0],Ot[0],Lt[0]),Math.max(Tt[1],jt[1],Ot[1],Lt[1])]}static inverseTransform(ot){const ut=ot[0]*ot[3]-ot[1]*ot[2];return[ot[3]/ut,-ot[1]/ut,-ot[2]/ut,ot[0]/ut,(ot[2]*ot[5]-ot[4]*ot[3])/ut,(ot[4]*ot[1]-ot[5]*ot[0])/ut]}static singularValueDecompose2dScale(ot){const ut=[ot[0],ot[2],ot[1],ot[3]],Tt=ot[0]*ut[0]+ot[1]*ut[2],jt=ot[0]*ut[1]+ot[1]*ut[3],Ot=ot[2]*ut[0]+ot[3]*ut[2],Lt=ot[2]*ut[1]+ot[3]*ut[3],yt=(Tt+Lt)/2,Kt=Math.sqrt((Tt+Lt)**2-4*(Tt*Lt-Ot*jt))/2,tl=yt+Kt||1,el=yt-Kt||1;return[Math.sqrt(tl),Math.sqrt(el)]}static normalizeRect(ot){const ut=ot.slice(0);return ot[0]>ot[2]&&(ut[0]=ot[2],ut[2]=ot[0]),ot[1]>ot[3]&&(ut[1]=ot[3],ut[3]=ot[1]),ut}static intersect(ot,ut){const Tt=Math.max(Math.min(ot[0],ot[2]),Math.min(ut[0],ut[2])),jt=Math.min(Math.max(ot[0],ot[2]),Math.max(ut[0],ut[2]));if(Tt>jt)return null;const Ot=Math.max(Math.min(ot[1],ot[3]),Math.min(ut[1],ut[3])),Lt=Math.min(Math.max(ot[1],ot[3]),Math.max(ut[1],ut[3]));return Ot>Lt?null:[Tt,Ot,jt,Lt]}static bezierBoundingBox(ot,ut,Tt,jt,Ot,Lt,yt,Kt){const tl=[],el=[[],[]];let ol,Qt,Ml,hl,Il,Wl,nt,L;for(let kt=0;kt<2;++kt){if(kt===0?(Qt=6*ot-12*Tt+6*Ot,ol=-3*ot+9*Tt-9*Ot+3*yt,Ml=3*Tt-3*ot):(Qt=6*ut-12*jt+6*Lt,ol=-3*ut+9*jt-9*Lt+3*Kt,Ml=3*jt-3*ut),Math.abs(ol)<1e-12){if(Math.abs(Qt)<1e-12)continue;hl=-Ml/Qt,0<hl&&hl<1&&tl.push(hl);continue}nt=Qt*Qt-4*Ml*ol,L=Math.sqrt(nt),!(nt<0)&&(Il=(-Qt+L)/(2*ol),0<Il&&Il<1&&tl.push(Il),Wl=(-Qt-L)/(2*ol),0<Wl&&Wl<1&&tl.push(Wl))}let ct=tl.length,Wt;const Yt=ct;for(;ct--;)hl=tl[ct],Wt=1-hl,el[0][ct]=Wt*Wt*Wt*ot+3*Wt*Wt*hl*Tt+3*Wt*hl*hl*Ot+hl*hl*hl*yt,el[1][ct]=Wt*Wt*Wt*ut+3*Wt*Wt*hl*jt+3*Wt*hl*hl*Lt+hl*hl*hl*Kt;return el[0][Yt]=ot,el[1][Yt]=ut,el[0][Yt+1]=yt,el[1][Yt+1]=Kt,el[0].length=el[1].length=Yt+2,[Math.min(...el[0]),Math.min(...el[1]),Math.max(...el[0]),Math.max(...el[1])]}}r.Util=il;const Bt=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,728,711,710,729,733,731,730,732,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8226,8224,8225,8230,8212,8211,402,8260,8249,8250,8722,8240,8222,8220,8221,8216,8217,8218,8482,64257,64258,321,338,352,376,381,305,322,339,353,382,0,8364];function Ft(_t){if(_t[0]>="ï"){let ut;if(_t[0]==="þ"&&_t[1]==="ÿ"?ut="utf-16be":_t[0]==="ÿ"&&_t[1]==="þ"?ut="utf-16le":_t[0]==="ï"&&_t[1]==="»"&&_t[2]==="¿"&&(ut="utf-8"),ut)try{const Tt=new TextDecoder(ut,{fatal:!0}),jt=Rt(_t);return Tt.decode(jt)}catch(Tt){Gt(`stringToPDFString: "${Tt}".`)}}const ot=[];for(let ut=0,Tt=_t.length;ut<Tt;ut++){const jt=Bt[_t.charCodeAt(ut)];ot.push(jt?String.fromCharCode(jt):_t.charAt(ut))}return ot.join("")}function wt(_t){return decodeURIComponent(escape(_t))}function pt(_t){return unescape(encodeURIComponent(_t))}function Ct(_t){return typeof _t=="object"&&(_t==null?void 0:_t.byteLength)!==void 0}function $t(_t,ot){if(_t.length!==ot.length)return!1;for(let ut=0,Tt=_t.length;ut<Tt;ut++)if(_t[ut]!==ot[ut])return!1;return!0}function dl(_t=new Date){return[_t.getUTCFullYear().toString(),(_t.getUTCMonth()+1).toString().padStart(2,"0"),_t.getUTCDate().toString().padStart(2,"0"),_t.getUTCHours().toString().padStart(2,"0"),_t.getUTCMinutes().toString().padStart(2,"0"),_t.getUTCSeconds().toString().padStart(2,"0")].join("")}class rl{constructor(){ll(this,Vl,!1);this.promise=new Promise((ot,ut)=>{this.resolve=Tt=>{ul(this,Vl,!0),ot(Tt)},this.reject=Tt=>{ul(this,Vl,!0),ut(Tt)}})}get settled(){return bt(this,Vl)}}Vl=new WeakMap,r.PromiseCapability=rl;let Yl=null,Xl=null;function pl(_t){return Yl||(Yl=/([\u00a0\u00b5\u037e\u0eb3\u2000-\u200a\u202f\u2126\ufb00-\ufb04\ufb06\ufb20-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufba1\ufba4-\ufba9\ufbae-\ufbb1\ufbd3-\ufbdc\ufbde-\ufbe7\ufbea-\ufbf8\ufbfc-\ufbfd\ufc00-\ufc5d\ufc64-\ufcf1\ufcf5-\ufd3d\ufd88\ufdf4\ufdfa-\ufdfb\ufe71\ufe77\ufe79\ufe7b\ufe7d]+)|(\ufb05+)/gu,Xl=new Map([["ſt","ſt"]])),_t.replaceAll(Yl,(ot,ut,Tt)=>ut?ut.normalize("NFKC"):Xl.get(Tt))}function Ll(){if(typeof crypto<"u"&&typeof(crypto==null?void 0:crypto.randomUUID)=="function")return crypto.randomUUID();const _t=new Uint8Array(32);if(typeof crypto<"u"&&typeof(crypto==null?void 0:crypto.getRandomValues)=="function")crypto.getRandomValues(_t);else for(let ot=0;ot<32;ot++)_t[ot]=Math.floor(Math.random()*255);return Mt(_t)}const yl="pdfjs_internal_id_";r.AnnotationPrefix=yl},(__unused_webpack_module,exports,__w_pdfjs_require__)=>{var lt,h,M,p,vl,Q,ce,O,I,j,q,K,f,S,k,T,de,F,J,Ye,u,m;Object.defineProperty(exports,"__esModule",{value:!0}),exports.RenderTask=exports.PDFWorkerUtil=exports.PDFWorker=exports.PDFPageProxy=exports.PDFDocumentProxy=exports.PDFDocumentLoadingTask=exports.PDFDataRangeTransport=exports.LoopbackPort=exports.DefaultStandardFontDataFactory=exports.DefaultFilterFactory=exports.DefaultCanvasFactory=exports.DefaultCMapReaderFactory=void 0,Object.defineProperty(exports,"SVGGraphics",{enumerable:!0,get:function(){return _displaySvg.SVGGraphics}}),exports.build=void 0,exports.getDocument=getDocument,exports.version=void 0;var _util=__w_pdfjs_require__(1),_annotation_storage=__w_pdfjs_require__(3),_display_utils=__w_pdfjs_require__(6),_font_loader=__w_pdfjs_require__(9),_displayNode_utils=__w_pdfjs_require__(10),_canvas=__w_pdfjs_require__(11),_worker_options=__w_pdfjs_require__(14),_message_handler=__w_pdfjs_require__(15),_metadata=__w_pdfjs_require__(16),_optional_content_config=__w_pdfjs_require__(17),_transport_stream=__w_pdfjs_require__(18),_displayFetch_stream=__w_pdfjs_require__(19),_displayNetwork=__w_pdfjs_require__(22),_displayNode_stream=__w_pdfjs_require__(23),_displaySvg=__w_pdfjs_require__(24),_xfa_text=__w_pdfjs_require__(25);const DEFAULT_RANGE_CHUNK_SIZE=65536,RENDERING_CANCELLED_TIMEOUT=100,DELAYED_CLEANUP_TIMEOUT=5e3,DefaultCanvasFactory=_util.isNodeJS?_displayNode_utils.NodeCanvasFactory:_display_utils.DOMCanvasFactory;exports.DefaultCanvasFactory=DefaultCanvasFactory;const DefaultCMapReaderFactory=_util.isNodeJS?_displayNode_utils.NodeCMapReaderFactory:_display_utils.DOMCMapReaderFactory;exports.DefaultCMapReaderFactory=DefaultCMapReaderFactory;const DefaultFilterFactory=_util.isNodeJS?_displayNode_utils.NodeFilterFactory:_display_utils.DOMFilterFactory;exports.DefaultFilterFactory=DefaultFilterFactory;const DefaultStandardFontDataFactory=_util.isNodeJS?_displayNode_utils.NodeStandardFontDataFactory:_display_utils.DOMStandardFontDataFactory;exports.DefaultStandardFontDataFactory=DefaultStandardFontDataFactory;function getDocument($){if(typeof $=="string"||$ instanceof URL?$={url:$}:(0,_util.isArrayBuffer)($)&&($={data:$}),typeof $!="object")throw new Error("Invalid parameter in getDocument, need parameter object.");if(!$.url&&!$.data&&!$.range)throw new Error("Invalid parameter object: need either .data, .range or .url");const P=new PDFDocumentLoadingTask,{docId:Zt}=P,dt=$.url?getUrlProp($.url):null,It=$.data?getDataProp($.data):null,xt=$.httpHeaders||null,it=$.withCredentials===!0,Xt=$.password??null,zt=$.range instanceof PDFDataRangeTransport?$.range:null,Gt=Number.isInteger($.rangeChunkSize)&&$.rangeChunkSize>0?$.rangeChunkSize:DEFAULT_RANGE_CHUNK_SIZE;let Nt=$.worker instanceof PDFWorker?$.worker:null;const Ut=$.verbosity,Vt=typeof $.docBaseUrl=="string"&&!(0,_display_utils.isDataScheme)($.docBaseUrl)?$.docBaseUrl:null,Ht=typeof $.cMapUrl=="string"?$.cMapUrl:null,Pt=$.cMapPacked!==!1,at=$.CMapReaderFactory||DefaultCMapReaderFactory,R=typeof $.standardFontDataUrl=="string"?$.standardFontDataUrl:null,w=$.StandardFontDataFactory||DefaultStandardFontDataFactory,X=$.stopAtErrors!==!0,C=Number.isInteger($.maxImageSize)&&$.maxImageSize>-1?$.maxImageSize:-1,H=$.isEvalSupported!==!1,st=typeof $.isOffscreenCanvasSupported=="boolean"?$.isOffscreenCanvasSupported:!_util.isNodeJS,et=Number.isInteger($.canvasMaxAreaInBytes)?$.canvasMaxAreaInBytes:-1,Mt=typeof $.disableFontFace=="boolean"?$.disableFontFace:_util.isNodeJS,Rt=$.fontExtraProperties===!0,gt=$.enableXfa===!0,Jt=$.ownerDocument||globalThis.document,Dt=$.disableRange===!0,qt=$.disableStream===!0,vt=$.disableAutoFetch===!0,cl=$.pdfBug===!0,bl=zt?zt.length:$.length??NaN,il=typeof $.useSystemFonts=="boolean"?$.useSystemFonts:!_util.isNodeJS&&!Mt,Bt=typeof $.useWorkerFetch=="boolean"?$.useWorkerFetch:at===_display_utils.DOMCMapReaderFactory&&w===_display_utils.DOMStandardFontDataFactory&&Ht&&R&&(0,_display_utils.isValidFetchUrl)(Ht,document.baseURI)&&(0,_display_utils.isValidFetchUrl)(R,document.baseURI),Ft=$.canvasFactory||new DefaultCanvasFactory({ownerDocument:Jt}),wt=$.filterFactory||new DefaultFilterFactory({docId:Zt,ownerDocument:Jt}),pt=null;(0,_util.setVerbosityLevel)(Ut);const Ct={canvasFactory:Ft,filterFactory:wt};if(Bt||(Ct.cMapReaderFactory=new at({baseUrl:Ht,isCompressed:Pt}),Ct.standardFontDataFactory=new w({baseUrl:R})),!Nt){const rl={verbosity:Ut,port:_worker_options.GlobalWorkerOptions.workerPort};Nt=rl.port?PDFWorker.fromPort(rl):new PDFWorker(rl),P._worker=Nt}const $t={docId:Zt,apiVersion:"3.11.174",data:It,password:Xt,disableAutoFetch:vt,rangeChunkSize:Gt,length:bl,docBaseUrl:Vt,enableXfa:gt,evaluatorOptions:{maxImageSize:C,disableFontFace:Mt,ignoreErrors:X,isEvalSupported:H,isOffscreenCanvasSupported:st,canvasMaxAreaInBytes:et,fontExtraProperties:Rt,useSystemFonts:il,cMapUrl:Bt?Ht:null,standardFontDataUrl:Bt?R:null}},dl={ignoreErrors:X,isEvalSupported:H,disableFontFace:Mt,fontExtraProperties:Rt,enableXfa:gt,ownerDocument:Jt,disableAutoFetch:vt,pdfBug:cl,styleElement:pt};return Nt.promise.then(function(){if(P.destroyed)throw new Error("Loading aborted");const rl=_fetchDocument(Nt,$t),Yl=new Promise(function(Xl){let pl;zt?pl=new _transport_stream.PDFDataTransportStream({length:bl,initialData:zt.initialData,progressiveDone:zt.progressiveDone,contentDispositionFilename:zt.contentDispositionFilename,disableRange:Dt,disableStream:qt},zt):It||(pl=(yl=>_util.isNodeJS?new _displayNode_stream.PDFNodeStream(yl):(0,_display_utils.isValidFetchUrl)(yl.url)?new _displayFetch_stream.PDFFetchStream(yl):new _displayNetwork.PDFNetworkStream(yl))({url:dt,length:bl,httpHeaders:xt,withCredentials:it,rangeChunkSize:Gt,disableRange:Dt,disableStream:qt})),Xl(pl)});return Promise.all([rl,Yl]).then(function([Xl,pl]){if(P.destroyed)throw new Error("Loading aborted");const Ll=new _message_handler.MessageHandler(Zt,Xl,Nt.port),yl=new WorkerTransport(Ll,P,pl,dl,Ct);P._transport=yl,Ll.send("Ready",null)})}).catch(P._capability.reject),P}async function _fetchDocument($,P){if($.destroyed)throw new Error("Worker was destroyed");const Zt=await $.messageHandler.sendWithPromise("GetDocRequest",P,P.data?[P.data.buffer]:null);if($.destroyed)throw new Error("Worker was destroyed");return Zt}function getUrlProp($){if($ instanceof URL)return $.href;try{return new URL($,window.location).href}catch{if(_util.isNodeJS&&typeof $=="string")return $}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}function getDataProp($){if(_util.isNodeJS&&typeof Buffer<"u"&&$ instanceof Buffer)throw new Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");if($ instanceof Uint8Array&&$.byteLength===$.buffer.byteLength)return $;if(typeof $=="string")return(0,_util.stringToBytes)($);if(typeof $=="object"&&!isNaN($==null?void 0:$.length)||(0,_util.isArrayBuffer)($))return new Uint8Array($);throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")}const r=class r{constructor(){this._capability=new _util.PromiseCapability,this._transport=null,this._worker=null,this.docId=`d${Al(r,lt)._++}`,this.destroyed=!1,this.onPassword=null,this.onProgress=null}get promise(){return this._capability.promise}async destroy(){var P,Zt,dt;this.destroyed=!0;try{(P=this._worker)!=null&&P.port&&(this._worker._pendingDestroy=!0),await((Zt=this._transport)==null?void 0:Zt.destroy())}catch(It){throw(dt=this._worker)!=null&&dt.port&&delete this._worker._pendingDestroy,It}this._transport=null,this._worker&&(this._worker.destroy(),this._worker=null)}};lt=new WeakMap,ll(r,lt,0);let PDFDocumentLoadingTask=r;exports.PDFDocumentLoadingTask=PDFDocumentLoadingTask;class PDFDataRangeTransport{constructor(P,Zt,dt=!1,It=null){this.length=P,this.initialData=Zt,this.progressiveDone=dt,this.contentDispositionFilename=It,this._rangeListeners=[],this._progressListeners=[],this._progressiveReadListeners=[],this._progressiveDoneListeners=[],this._readyCapability=new _util.PromiseCapability}addRangeListener(P){this._rangeListeners.push(P)}addProgressListener(P){this._progressListeners.push(P)}addProgressiveReadListener(P){this._progressiveReadListeners.push(P)}addProgressiveDoneListener(P){this._progressiveDoneListeners.push(P)}onDataRange(P,Zt){for(const dt of this._rangeListeners)dt(P,Zt)}onDataProgress(P,Zt){this._readyCapability.promise.then(()=>{for(const dt of this._progressListeners)dt(P,Zt)})}onDataProgressiveRead(P){this._readyCapability.promise.then(()=>{for(const Zt of this._progressiveReadListeners)Zt(P)})}onDataProgressiveDone(){this._readyCapability.promise.then(()=>{for(const P of this._progressiveDoneListeners)P()})}transportReady(){this._readyCapability.resolve()}requestDataRange(P,Zt){(0,_util.unreachable)("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}}exports.PDFDataRangeTransport=PDFDataRangeTransport;class PDFDocumentProxy{constructor(P,Zt){this._pdfInfo=P,this._transport=Zt,Object.defineProperty(this,"getJavaScript",{value:()=>((0,_display_utils.deprecated)("`PDFDocumentProxy.getJavaScript`, please use `PDFDocumentProxy.getJSActions` instead."),this.getJSActions().then(dt=>{if(!dt)return dt;const It=[];for(const xt in dt)It.push(...dt[xt]);return It}))})}get annotationStorage(){return this._transport.annotationStorage}get filterFactory(){return this._transport.filterFactory}get numPages(){return this._pdfInfo.numPages}get fingerprints(){return this._pdfInfo.fingerprints}get isPureXfa(){return(0,_util.shadow)(this,"isPureXfa",!!this._transport._htmlForXfa)}get allXfaHtml(){return this._transport._htmlForXfa}getPage(P){return this._transport.getPage(P)}getPageIndex(P){return this._transport.getPageIndex(P)}getDestinations(){return this._transport.getDestinations()}getDestination(P){return this._transport.getDestination(P)}getPageLabels(){return this._transport.getPageLabels()}getPageLayout(){return this._transport.getPageLayout()}getPageMode(){return this._transport.getPageMode()}getViewerPreferences(){return this._transport.getViewerPreferences()}getOpenAction(){return this._transport.getOpenAction()}getAttachments(){return this._transport.getAttachments()}getJSActions(){return this._transport.getDocJSActions()}getOutline(){return this._transport.getOutline()}getOptionalContentConfig(){return this._transport.getOptionalContentConfig()}getPermissions(){return this._transport.getPermissions()}getMetadata(){return this._transport.getMetadata()}getMarkInfo(){return this._transport.getMarkInfo()}getData(){return this._transport.getData()}saveDocument(){return this._transport.saveDocument()}getDownloadInfo(){return this._transport.downloadInfoCapability.promise}cleanup(P=!1){return this._transport.startCleanup(P||this.isPureXfa)}destroy(){return this.loadingTask.destroy()}get loadingParams(){return this._transport.loadingParams}get loadingTask(){return this._transport.loadingTask}getFieldObjects(){return this._transport.getFieldObjects()}hasJSActions(){return this._transport.hasJSActions()}getCalculationOrderIds(){return this._transport.getCalculationOrderIds()}}exports.PDFDocumentProxy=PDFDocumentProxy;class PDFPageProxy{constructor(P,Zt,dt,It=!1){ll(this,p);ll(this,Q);ll(this,h,null);ll(this,M,!1);this._pageIndex=P,this._pageInfo=Zt,this._transport=dt,this._stats=It?new _display_utils.StatTimer:null,this._pdfBug=It,this.commonObjs=dt.commonObjs,this.objs=new PDFObjects,this._maybeCleanupAfterRender=!1,this._intentStates=new Map,this.destroyed=!1}get pageNumber(){return this._pageIndex+1}get rotate(){return this._pageInfo.rotate}get ref(){return this._pageInfo.ref}get userUnit(){return this._pageInfo.userUnit}get view(){return this._pageInfo.view}getViewport({scale:P,rotation:Zt=this.rotate,offsetX:dt=0,offsetY:It=0,dontFlip:xt=!1}={}){return new _display_utils.PageViewport({viewBox:this.view,scale:P,rotation:Zt,offsetX:dt,offsetY:It,dontFlip:xt})}getAnnotations({intent:P="display"}={}){const Zt=this._transport.getRenderingIntent(P);return this._transport.getAnnotations(this._pageIndex,Zt.renderingIntent)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get filterFactory(){return this._transport.filterFactory}get isPureXfa(){return(0,_util.shadow)(this,"isPureXfa",!!this._transport._htmlForXfa)}async getXfa(){var P;return((P=this._transport._htmlForXfa)==null?void 0:P.children[this._pageIndex])||null}render({canvasContext:P,viewport:Zt,intent:dt="display",annotationMode:It=_util.AnnotationMode.ENABLE,transform:xt=null,background:it=null,optionalContentConfigPromise:Xt=null,annotationCanvasMap:zt=null,pageColors:Gt=null,printAnnotationStorage:Nt=null}){var w,X;(w=this._stats)==null||w.time("Overall");const Ut=this._transport.getRenderingIntent(dt,It,Nt);ul(this,M,!1),nl(this,Q,ce).call(this),Xt||(Xt=this._transport.getOptionalContentConfig());let Vt=this._intentStates.get(Ut.cacheKey);Vt||(Vt=Object.create(null),this._intentStates.set(Ut.cacheKey,Vt)),Vt.streamReaderCancelTimeout&&(clearTimeout(Vt.streamReaderCancelTimeout),Vt.streamReaderCancelTimeout=null);const Ht=!!(Ut.renderingIntent&_util.RenderingIntentFlag.PRINT);Vt.displayReadyCapability||(Vt.displayReadyCapability=new _util.PromiseCapability,Vt.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},(X=this._stats)==null||X.time("Page Request"),this._pumpOperatorList(Ut));const Pt=C=>{var H,st;Vt.renderTasks.delete(at),(this._maybeCleanupAfterRender||Ht)&&ul(this,M,!0),nl(this,p,vl).call(this,!Ht),C?(at.capability.reject(C),this._abortOperatorList({intentState:Vt,reason:C instanceof Error?C:new Error(C)})):at.capability.resolve(),(H=this._stats)==null||H.timeEnd("Rendering"),(st=this._stats)==null||st.timeEnd("Overall")},at=new InternalRenderTask({callback:Pt,params:{canvasContext:P,viewport:Zt,transform:xt,background:it},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:zt,operatorList:Vt.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!Ht,pdfBug:this._pdfBug,pageColors:Gt});(Vt.renderTasks||(Vt.renderTasks=new Set)).add(at);const R=at.task;return Promise.all([Vt.displayReadyCapability.promise,Xt]).then(([C,H])=>{var st;if(this.destroyed){Pt();return}(st=this._stats)==null||st.time("Rendering"),at.initializeGraphics({transparency:C,optionalContentConfig:H}),at.operatorListChanged()}).catch(Pt),R}getOperatorList({intent:P="display",annotationMode:Zt=_util.AnnotationMode.ENABLE,printAnnotationStorage:dt=null}={}){var zt;function It(){it.operatorList.lastChunk&&(it.opListReadCapability.resolve(it.operatorList),it.renderTasks.delete(Xt))}const xt=this._transport.getRenderingIntent(P,Zt,dt,!0);let it=this._intentStates.get(xt.cacheKey);it||(it=Object.create(null),this._intentStates.set(xt.cacheKey,it));let Xt;return it.opListReadCapability||(Xt=Object.create(null),Xt.operatorListChanged=It,it.opListReadCapability=new _util.PromiseCapability,(it.renderTasks||(it.renderTasks=new Set)).add(Xt),it.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},(zt=this._stats)==null||zt.time("Page Request"),this._pumpOperatorList(xt)),it.opListReadCapability.promise}streamTextContent({includeMarkedContent:P=!1,disableNormalization:Zt=!1}={}){return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,includeMarkedContent:P===!0,disableNormalization:Zt===!0},{highWaterMark:100,size(It){return It.items.length}})}getTextContent(P={}){if(this._transport._htmlForXfa)return this.getXfa().then(dt=>_xfa_text.XfaText.textContent(dt));const Zt=this.streamTextContent(P);return new Promise(function(dt,It){function xt(){it.read().then(function({value:zt,done:Gt}){if(Gt){dt(Xt);return}Object.assign(Xt.styles,zt.styles),Xt.items.push(...zt.items),xt()},It)}const it=Zt.getReader(),Xt={items:[],styles:Object.create(null)};xt()})}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;const P=[];for(const Zt of this._intentStates.values())if(this._abortOperatorList({intentState:Zt,reason:new Error("Page was destroyed."),force:!0}),!Zt.opListReadCapability)for(const dt of Zt.renderTasks)P.push(dt.completed),dt.cancel();return this.objs.clear(),ul(this,M,!1),nl(this,Q,ce).call(this),Promise.all(P)}cleanup(P=!1){ul(this,M,!0);const Zt=nl(this,p,vl).call(this,!1);return P&&Zt&&this._stats&&(this._stats=new _display_utils.StatTimer),Zt}_startRenderPage(P,Zt){var It,xt;const dt=this._intentStates.get(Zt);dt&&((It=this._stats)==null||It.timeEnd("Page Request"),(xt=dt.displayReadyCapability)==null||xt.resolve(P))}_renderPageChunk(P,Zt){for(let dt=0,It=P.length;dt<It;dt++)Zt.operatorList.fnArray.push(P.fnArray[dt]),Zt.operatorList.argsArray.push(P.argsArray[dt]);Zt.operatorList.lastChunk=P.lastChunk,Zt.operatorList.separateAnnots=P.separateAnnots;for(const dt of Zt.renderTasks)dt.operatorListChanged();P.lastChunk&&nl(this,p,vl).call(this,!0)}_pumpOperatorList({renderingIntent:P,cacheKey:Zt,annotationStorageSerializable:dt}){const{map:It,transfers:xt}=dt,Xt=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:P,cacheKey:Zt,annotationStorage:It},xt).getReader(),zt=this._intentStates.get(Zt);zt.streamReader=Xt;const Gt=()=>{Xt.read().then(({value:Nt,done:Ut})=>{if(Ut){zt.streamReader=null;return}this._transport.destroyed||(this._renderPageChunk(Nt,zt),Gt())},Nt=>{if(zt.streamReader=null,!this._transport.destroyed){if(zt.operatorList){zt.operatorList.lastChunk=!0;for(const Ut of zt.renderTasks)Ut.operatorListChanged();nl(this,p,vl).call(this,!0)}if(zt.displayReadyCapability)zt.displayReadyCapability.reject(Nt);else if(zt.opListReadCapability)zt.opListReadCapability.reject(Nt);else throw Nt}})};Gt()}_abortOperatorList({intentState:P,reason:Zt,force:dt=!1}){if(P.streamReader){if(P.streamReaderCancelTimeout&&(clearTimeout(P.streamReaderCancelTimeout),P.streamReaderCancelTimeout=null),!dt){if(P.renderTasks.size>0)return;if(Zt instanceof _display_utils.RenderingCancelledException){let It=RENDERING_CANCELLED_TIMEOUT;Zt.extraDelay>0&&Zt.extraDelay<1e3&&(It+=Zt.extraDelay),P.streamReaderCancelTimeout=setTimeout(()=>{P.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:P,reason:Zt,force:!0})},It);return}}if(P.streamReader.cancel(new _util.AbortException(Zt.message)).catch(()=>{}),P.streamReader=null,!this._transport.destroyed){for(const[It,xt]of this._intentStates)if(xt===P){this._intentStates.delete(It);break}this.cleanup()}}}get stats(){return this._stats}}h=new WeakMap,M=new WeakMap,p=new WeakSet,vl=function(P=!1){if(nl(this,Q,ce).call(this),!bt(this,M)||this.destroyed)return!1;if(P)return ul(this,h,setTimeout(()=>{ul(this,h,null),nl(this,p,vl).call(this,!1)},DELAYED_CLEANUP_TIMEOUT)),!1;for(const{renderTasks:Zt,operatorList:dt}of this._intentStates.values())if(Zt.size>0||!dt.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),ul(this,M,!1),!0},Q=new WeakSet,ce=function(){bt(this,h)&&(clearTimeout(bt(this,h)),ul(this,h,null))},exports.PDFPageProxy=PDFPageProxy;class LoopbackPort{constructor(){ll(this,O,new Set);ll(this,I,Promise.resolve())}postMessage(P,Zt){const dt={data:structuredClone(P,Zt?{transfer:Zt}:null)};bt(this,I).then(()=>{for(const It of bt(this,O))It.call(this,dt)})}addEventListener(P,Zt){bt(this,O).add(Zt)}removeEventListener(P,Zt){bt(this,O).delete(Zt)}terminate(){bt(this,O).clear()}}O=new WeakMap,I=new WeakMap,exports.LoopbackPort=LoopbackPort;const PDFWorkerUtil={isWorkerDisabled:!1,fallbackWorkerSrc:null,fakeWorkerId:0};exports.PDFWorkerUtil=PDFWorkerUtil;{if(_util.isNodeJS&&typeof commonjsRequire$1=="function")PDFWorkerUtil.isWorkerDisabled=!0,PDFWorkerUtil.fallbackWorkerSrc="./pdf.worker.js";else if(typeof document=="object"){const $=(j=document==null?void 0:document.currentScript)==null?void 0:j.src;$&&(PDFWorkerUtil.fallbackWorkerSrc=$.replace(/(\.(?:min\.)?js)(\?.*)?$/i,".worker$1$2"))}PDFWorkerUtil.isSameOrigin=function($,P){let Zt;try{if(Zt=new URL($),!Zt.origin||Zt.origin==="null")return!1}catch{return!1}const dt=new URL(P,Zt);return Zt.origin===dt.origin},PDFWorkerUtil.createCDNWrapper=function($){const P=`importScripts("${$}");`;return URL.createObjectURL(new Blob([P]))}}const _PDFWorker=class _PDFWorker{constructor({name:$=null,port:P=null,verbosity:Zt=(0,_util.getVerbosityLevel)()}={}){var dt;if(this.name=$,this.destroyed=!1,this.verbosity=Zt,this._readyCapability=new _util.PromiseCapability,this._port=null,this._webWorker=null,this._messageHandler=null,P){if((dt=bt(_PDFWorker,q))!=null&&dt.has(P))throw new Error("Cannot use more than one PDFWorker per port.");(bt(_PDFWorker,q)||ul(_PDFWorker,q,new WeakMap)).set(P,this),this._initializeFromPort(P);return}this._initialize()}get promise(){return this._readyCapability.promise}get port(){return this._port}get messageHandler(){return this._messageHandler}_initializeFromPort($){this._port=$,this._messageHandler=new _message_handler.MessageHandler("main","worker",$),this._messageHandler.on("ready",function(){}),this._readyCapability.resolve(),this._messageHandler.send("configure",{verbosity:this.verbosity})}_initialize(){if(!PDFWorkerUtil.isWorkerDisabled&&!_PDFWorker._mainThreadWorkerMessageHandler){let{workerSrc:$}=_PDFWorker;try{PDFWorkerUtil.isSameOrigin(window.location.href,$)||($=PDFWorkerUtil.createCDNWrapper(new URL($,window.location).href));const P=new Worker($),Zt=new _message_handler.MessageHandler("main","worker",P),dt=()=>{P.removeEventListener("error",It),Zt.destroy(),P.terminate(),this.destroyed?this._readyCapability.reject(new Error("Worker was destroyed")):this._setupFakeWorker()},It=()=>{this._webWorker||dt()};P.addEventListener("error",It),Zt.on("test",it=>{if(P.removeEventListener("error",It),this.destroyed){dt();return}it?(this._messageHandler=Zt,this._port=P,this._webWorker=P,this._readyCapability.resolve(),Zt.send("configure",{verbosity:this.verbosity})):(this._setupFakeWorker(),Zt.destroy(),P.terminate())}),Zt.on("ready",it=>{if(P.removeEventListener("error",It),this.destroyed){dt();return}try{xt()}catch{this._setupFakeWorker()}});const xt=()=>{const it=new Uint8Array;Zt.send("test",it,[it.buffer])};xt();return}catch{(0,_util.info)("The worker has been disabled.")}}this._setupFakeWorker()}_setupFakeWorker(){PDFWorkerUtil.isWorkerDisabled||((0,_util.warn)("Setting up fake worker."),PDFWorkerUtil.isWorkerDisabled=!0),_PDFWorker._setupFakeWorkerGlobal.then($=>{if(this.destroyed){this._readyCapability.reject(new Error("Worker was destroyed"));return}const P=new LoopbackPort;this._port=P;const Zt=`fake${PDFWorkerUtil.fakeWorkerId++}`,dt=new _message_handler.MessageHandler(Zt+"_worker",Zt,P);$.setup(dt,P);const It=new _message_handler.MessageHandler(Zt,Zt+"_worker",P);this._messageHandler=It,this._readyCapability.resolve(),It.send("configure",{verbosity:this.verbosity})}).catch($=>{this._readyCapability.reject(new Error(`Setting up fake worker failed: "${$.message}".`))})}destroy(){var $;this.destroyed=!0,this._webWorker&&(this._webWorker.terminate(),this._webWorker=null),($=bt(_PDFWorker,q))==null||$.delete(this._port),this._port=null,this._messageHandler&&(this._messageHandler.destroy(),this._messageHandler=null)}static fromPort($){var Zt;if(!($!=null&&$.port))throw new Error("PDFWorker.fromPort - invalid method signature.");const P=(Zt=bt(this,q))==null?void 0:Zt.get($.port);if(P){if(P._pendingDestroy)throw new Error("PDFWorker.fromPort - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");return P}return new _PDFWorker($)}static get workerSrc(){if(_worker_options.GlobalWorkerOptions.workerSrc)return _worker_options.GlobalWorkerOptions.workerSrc;if(PDFWorkerUtil.fallbackWorkerSrc!==null)return _util.isNodeJS||(0,_display_utils.deprecated)('No "GlobalWorkerOptions.workerSrc" specified.'),PDFWorkerUtil.fallbackWorkerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get _mainThreadWorkerMessageHandler(){var $;try{return(($=globalThis.pdfjsWorker)==null?void 0:$.WorkerMessageHandler)||null}catch{return null}}static get _setupFakeWorkerGlobal(){const loader=async()=>{const mainWorkerMessageHandler=this._mainThreadWorkerMessageHandler;if(mainWorkerMessageHandler)return mainWorkerMessageHandler;if(_util.isNodeJS&&typeof commonjsRequire$1=="function"){const worker=eval("require")(this.workerSrc);return worker.WorkerMessageHandler}return await(0,_display_utils.loadScript)(this.workerSrc),window.pdfjsWorker.WorkerMessageHandler};return(0,_util.shadow)(this,"_setupFakeWorkerGlobal",loader())}};q=new WeakMap,ll(_PDFWorker,q,void 0);let PDFWorker=_PDFWorker;exports.PDFWorker=PDFWorker;class WorkerTransport{constructor(P,Zt,dt,It,xt){ll(this,T);ll(this,K,new Map);ll(this,f,new Map);ll(this,S,new Map);ll(this,k,null);this.messageHandler=P,this.loadingTask=Zt,this.commonObjs=new PDFObjects,this.fontLoader=new _font_loader.FontLoader({ownerDocument:It.ownerDocument,styleElement:It.styleElement}),this._params=It,this.canvasFactory=xt.canvasFactory,this.filterFactory=xt.filterFactory,this.cMapReaderFactory=xt.cMapReaderFactory,this.standardFontDataFactory=xt.standardFontDataFactory,this.destroyed=!1,this.destroyCapability=null,this._networkStream=dt,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=new _util.PromiseCapability,this.setupMessageHandler()}get annotationStorage(){return(0,_util.shadow)(this,"annotationStorage",new _annotation_storage.AnnotationStorage)}getRenderingIntent(P,Zt=_util.AnnotationMode.ENABLE,dt=null,It=!1){let xt=_util.RenderingIntentFlag.DISPLAY,it=_annotation_storage.SerializableEmpty;switch(P){case"any":xt=_util.RenderingIntentFlag.ANY;break;case"display":break;case"print":xt=_util.RenderingIntentFlag.PRINT;break;default:(0,_util.warn)(`getRenderingIntent - invalid intent: ${P}`)}switch(Zt){case _util.AnnotationMode.DISABLE:xt+=_util.RenderingIntentFlag.ANNOTATIONS_DISABLE;break;case _util.AnnotationMode.ENABLE:break;case _util.AnnotationMode.ENABLE_FORMS:xt+=_util.RenderingIntentFlag.ANNOTATIONS_FORMS;break;case _util.AnnotationMode.ENABLE_STORAGE:xt+=_util.RenderingIntentFlag.ANNOTATIONS_STORAGE,it=(xt&_util.RenderingIntentFlag.PRINT&&dt instanceof _annotation_storage.PrintAnnotationStorage?dt:this.annotationStorage).serializable;break;default:(0,_util.warn)(`getRenderingIntent - invalid annotationMode: ${Zt}`)}return It&&(xt+=_util.RenderingIntentFlag.OPLIST),{renderingIntent:xt,cacheKey:`${xt}_${it.hash}`,annotationStorageSerializable:it}}destroy(){var dt;if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=new _util.PromiseCapability,(dt=bt(this,k))==null||dt.reject(new Error("Worker was destroyed during onPassword callback"));const P=[];for(const It of bt(this,f).values())P.push(It._destroy());bt(this,f).clear(),bt(this,S).clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();const Zt=this.messageHandler.sendWithPromise("Terminate",null);return P.push(Zt),Promise.all(P).then(()=>{var It;this.commonObjs.clear(),this.fontLoader.clear(),bt(this,K).clear(),this.filterFactory.destroy(),(It=this._networkStream)==null||It.cancelAllRequests(new _util.AbortException("Worker was terminated.")),this.messageHandler&&(this.messageHandler.destroy(),this.messageHandler=null),this.destroyCapability.resolve()},this.destroyCapability.reject),this.destroyCapability.promise}setupMessageHandler(){const{messageHandler:P,loadingTask:Zt}=this;P.on("GetReader",(dt,It)=>{(0,_util.assert)(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=xt=>{this._lastProgress={loaded:xt.loaded,total:xt.total}},It.onPull=()=>{this._fullReader.read().then(function({value:xt,done:it}){if(it){It.close();return}(0,_util.assert)(xt instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),It.enqueue(new Uint8Array(xt),1,[xt])}).catch(xt=>{It.error(xt)})},It.onCancel=xt=>{this._fullReader.cancel(xt),It.ready.catch(it=>{if(!this.destroyed)throw it})}}),P.on("ReaderHeadersReady",dt=>{const It=new _util.PromiseCapability,xt=this._fullReader;return xt.headersReady.then(()=>{var it;(!xt.isStreamingSupported||!xt.isRangeSupported)&&(this._lastProgress&&((it=Zt.onProgress)==null||it.call(Zt,this._lastProgress)),xt.onProgress=Xt=>{var zt;(zt=Zt.onProgress)==null||zt.call(Zt,{loaded:Xt.loaded,total:Xt.total})}),It.resolve({isStreamingSupported:xt.isStreamingSupported,isRangeSupported:xt.isRangeSupported,contentLength:xt.contentLength})},It.reject),It.promise}),P.on("GetRangeReader",(dt,It)=>{(0,_util.assert)(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const xt=this._networkStream.getRangeReader(dt.begin,dt.end);if(!xt){It.close();return}It.onPull=()=>{xt.read().then(function({value:it,done:Xt}){if(Xt){It.close();return}(0,_util.assert)(it instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),It.enqueue(new Uint8Array(it),1,[it])}).catch(it=>{It.error(it)})},It.onCancel=it=>{xt.cancel(it),It.ready.catch(Xt=>{if(!this.destroyed)throw Xt})}}),P.on("GetDoc",({pdfInfo:dt})=>{this._numPages=dt.numPages,this._htmlForXfa=dt.htmlForXfa,delete dt.htmlForXfa,Zt._capability.resolve(new PDFDocumentProxy(dt,this))}),P.on("DocException",function(dt){let It;switch(dt.name){case"PasswordException":It=new _util.PasswordException(dt.message,dt.code);break;case"InvalidPDFException":It=new _util.InvalidPDFException(dt.message);break;case"MissingPDFException":It=new _util.MissingPDFException(dt.message);break;case"UnexpectedResponseException":It=new _util.UnexpectedResponseException(dt.message,dt.status);break;case"UnknownErrorException":It=new _util.UnknownErrorException(dt.message,dt.details);break;default:(0,_util.unreachable)("DocException - expected a valid Error.")}Zt._capability.reject(It)}),P.on("PasswordRequest",dt=>{if(ul(this,k,new _util.PromiseCapability),Zt.onPassword){const It=xt=>{xt instanceof Error?bt(this,k).reject(xt):bt(this,k).resolve({password:xt})};try{Zt.onPassword(It,dt.code)}catch(xt){bt(this,k).reject(xt)}}else bt(this,k).reject(new _util.PasswordException(dt.message,dt.code));return bt(this,k).promise}),P.on("DataLoaded",dt=>{var It;(It=Zt.onProgress)==null||It.call(Zt,{loaded:dt.length,total:dt.length}),this.downloadInfoCapability.resolve(dt)}),P.on("StartRenderPage",dt=>{if(this.destroyed)return;bt(this,f).get(dt.pageIndex)._startRenderPage(dt.transparency,dt.cacheKey)}),P.on("commonobj",([dt,It,xt])=>{var it;if(!this.destroyed&&!this.commonObjs.has(dt))switch(It){case"Font":const Xt=this._params;if("error"in xt){const Nt=xt.error;(0,_util.warn)(`Error during font loading: ${Nt}`),this.commonObjs.resolve(dt,Nt);break}const zt=Xt.pdfBug&&((it=globalThis.FontInspector)!=null&&it.enabled)?(Nt,Ut)=>globalThis.FontInspector.fontAdded(Nt,Ut):null,Gt=new _font_loader.FontFaceObject(xt,{isEvalSupported:Xt.isEvalSupported,disableFontFace:Xt.disableFontFace,ignoreErrors:Xt.ignoreErrors,inspectFont:zt});this.fontLoader.bind(Gt).catch(Nt=>P.sendWithPromise("FontFallback",{id:dt})).finally(()=>{!Xt.fontExtraProperties&&Gt.data&&(Gt.data=null),this.commonObjs.resolve(dt,Gt)});break;case"FontPath":case"Image":case"Pattern":this.commonObjs.resolve(dt,xt);break;default:throw new Error(`Got unknown common object type ${It}`)}}),P.on("obj",([dt,It,xt,it])=>{var zt;if(this.destroyed)return;const Xt=bt(this,f).get(It);if(!Xt.objs.has(dt))switch(xt){case"Image":if(Xt.objs.resolve(dt,it),it){let Gt;if(it.bitmap){const{width:Nt,height:Ut}=it;Gt=Nt*Ut*4}else Gt=((zt=it.data)==null?void 0:zt.length)||0;Gt>_util.MAX_IMAGE_SIZE_TO_CACHE&&(Xt._maybeCleanupAfterRender=!0)}break;case"Pattern":Xt.objs.resolve(dt,it);break;default:throw new Error(`Got unknown object type ${xt}`)}}),P.on("DocProgress",dt=>{var It;this.destroyed||(It=Zt.onProgress)==null||It.call(Zt,{loaded:dt.loaded,total:dt.total})}),P.on("FetchBuiltInCMap",dt=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.cMapReaderFactory?this.cMapReaderFactory.fetch(dt):Promise.reject(new Error("CMapReaderFactory not initialized, see the `useWorkerFetch` parameter."))),P.on("FetchStandardFontData",dt=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.standardFontDataFactory?this.standardFontDataFactory.fetch(dt):Promise.reject(new Error("StandardFontDataFactory not initialized, see the `useWorkerFetch` parameter.")))}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){var dt;this.annotationStorage.size<=0&&(0,_util.warn)("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");const{map:P,transfers:Zt}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:P,filename:((dt=this._fullReader)==null?void 0:dt.filename)??null},Zt).finally(()=>{this.annotationStorage.resetModified()})}getPage(P){if(!Number.isInteger(P)||P<=0||P>this._numPages)return Promise.reject(new Error("Invalid page request."));const Zt=P-1,dt=bt(this,S).get(Zt);if(dt)return dt;const It=this.messageHandler.sendWithPromise("GetPage",{pageIndex:Zt}).then(xt=>{if(this.destroyed)throw new Error("Transport destroyed");const it=new PDFPageProxy(Zt,xt,this,this._params.pdfBug);return bt(this,f).set(Zt,it),it});return bt(this,S).set(Zt,It),It}getPageIndex(P){return typeof P!="object"||P===null||!Number.isInteger(P.num)||P.num<0||!Number.isInteger(P.gen)||P.gen<0?Promise.reject(new Error("Invalid pageIndex request.")):this.messageHandler.sendWithPromise("GetPageIndex",{num:P.num,gen:P.gen})}getAnnotations(P,Zt){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:P,intent:Zt})}getFieldObjects(){return nl(this,T,de).call(this,"GetFieldObjects")}hasJSActions(){return nl(this,T,de).call(this,"HasJSActions")}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(P){return typeof P!="string"?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:P})}getPageLabels(){return this.messageHandler.sendWithPromise("GetPageLabels",null)}getPageLayout(){return this.messageHandler.sendWithPromise("GetPageLayout",null)}getPageMode(){return this.messageHandler.sendWithPromise("GetPageMode",null)}getViewerPreferences(){return this.messageHandler.sendWithPromise("GetViewerPreferences",null)}getOpenAction(){return this.messageHandler.sendWithPromise("GetOpenAction",null)}getAttachments(){return this.messageHandler.sendWithPromise("GetAttachments",null)}getDocJSActions(){return nl(this,T,de).call(this,"GetDocJSActions")}getPageJSActions(P){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:P})}getStructTree(P){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:P})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(){return this.messageHandler.sendWithPromise("GetOptionalContentConfig",null).then(P=>new _optional_content_config.OptionalContentConfig(P))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){const P="GetMetadata",Zt=bt(this,K).get(P);if(Zt)return Zt;const dt=this.messageHandler.sendWithPromise(P,null).then(It=>{var xt,it;return{info:It[0],metadata:It[1]?new _metadata.Metadata(It[1]):null,contentDispositionFilename:((xt=this._fullReader)==null?void 0:xt.filename)??null,contentLength:((it=this._fullReader)==null?void 0:it.contentLength)??null}});return bt(this,K).set(P,dt),dt}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(P=!1){if(!this.destroyed){await this.messageHandler.sendWithPromise("Cleanup",null);for(const Zt of bt(this,f).values())if(!Zt.cleanup())throw new Error(`startCleanup: Page ${Zt.pageNumber} is currently rendering.`);this.commonObjs.clear(),P||this.fontLoader.clear(),bt(this,K).clear(),this.filterFactory.destroy(!0)}}get loadingParams(){const{disableAutoFetch:P,enableXfa:Zt}=this._params;return(0,_util.shadow)(this,"loadingParams",{disableAutoFetch:P,enableXfa:Zt})}}K=new WeakMap,f=new WeakMap,S=new WeakMap,k=new WeakMap,T=new WeakSet,de=function(P,Zt=null){const dt=bt(this,K).get(P);if(dt)return dt;const It=this.messageHandler.sendWithPromise(P,Zt);return bt(this,K).set(P,It),It};class PDFObjects{constructor(){ll(this,J);ll(this,F,Object.create(null))}get(P,Zt=null){if(Zt){const It=nl(this,J,Ye).call(this,P);return It.capability.promise.then(()=>Zt(It.data)),null}const dt=bt(this,F)[P];if(!(dt!=null&&dt.capability.settled))throw new Error(`Requesting object that isn't resolved yet ${P}.`);return dt.data}has(P){const Zt=bt(this,F)[P];return(Zt==null?void 0:Zt.capability.settled)||!1}resolve(P,Zt=null){const dt=nl(this,J,Ye).call(this,P);dt.data=Zt,dt.capability.resolve()}clear(){var P;for(const Zt in bt(this,F)){const{data:dt}=bt(this,F)[Zt];(P=dt==null?void 0:dt.bitmap)==null||P.close()}ul(this,F,Object.create(null))}}F=new WeakMap,J=new WeakSet,Ye=function(P){var Zt;return(Zt=bt(this,F))[P]||(Zt[P]={capability:new _util.PromiseCapability,data:null})};class RenderTask{constructor(P){ll(this,u,null);ul(this,u,P),this.onContinue=null}get promise(){return bt(this,u).capability.promise}cancel(P=0){bt(this,u).cancel(null,P)}get separateAnnots(){const{separateAnnots:P}=bt(this,u).operatorList;if(!P)return!1;const{annotationCanvasMap:Zt}=bt(this,u);return P.form||P.canvas&&(Zt==null?void 0:Zt.size)>0}}u=new WeakMap,exports.RenderTask=RenderTask;const _=class _{constructor({callback:P,params:Zt,objs:dt,commonObjs:It,annotationCanvasMap:xt,operatorList:it,pageIndex:Xt,canvasFactory:zt,filterFactory:Gt,useRequestAnimationFrame:Nt=!1,pdfBug:Ut=!1,pageColors:Vt=null}){this.callback=P,this.params=Zt,this.objs=dt,this.commonObjs=It,this.annotationCanvasMap=xt,this.operatorListIdx=null,this.operatorList=it,this._pageIndex=Xt,this.canvasFactory=zt,this.filterFactory=Gt,this._pdfBug=Ut,this.pageColors=Vt,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=Nt===!0&&typeof window<"u",this.cancelled=!1,this.capability=new _util.PromiseCapability,this.task=new RenderTask(this),this._cancelBound=this.cancel.bind(this),this._continueBound=this._continue.bind(this),this._scheduleNextBound=this._scheduleNext.bind(this),this._nextBound=this._next.bind(this),this._canvas=Zt.canvasContext.canvas}get completed(){return this.capability.promise.catch(function(){})}initializeGraphics({transparency:P=!1,optionalContentConfig:Zt}){var Xt,zt;if(this.cancelled)return;if(this._canvas){if(bt(_,m).has(this._canvas))throw new Error("Cannot use the same canvas during multiple render() operations. Use different canvas or ensure previous operations were cancelled or completed.");bt(_,m).add(this._canvas)}this._pdfBug&&((Xt=globalThis.StepperManager)!=null&&Xt.enabled)&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());const{canvasContext:dt,viewport:It,transform:xt,background:it}=this.params;this.gfx=new _canvas.CanvasGraphics(dt,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:Zt},this.annotationCanvasMap,this.pageColors),this.gfx.beginDrawing({transform:xt,viewport:It,transparency:P,background:it}),this.operatorListIdx=0,this.graphicsReady=!0,(zt=this.graphicsReadyCallback)==null||zt.call(this)}cancel(P=null,Zt=0){var dt;this.running=!1,this.cancelled=!0,(dt=this.gfx)==null||dt.endDrawing(),bt(_,m).delete(this._canvas),this.callback(P||new _display_utils.RenderingCancelledException(`Rendering cancelled, page ${this._pageIndex+1}`,Zt))}operatorListChanged(){var P;if(!this.graphicsReady){this.graphicsReadyCallback||(this.graphicsReadyCallback=this._continueBound);return}(P=this.stepper)==null||P.updateOperatorList(this.operatorList),!this.running&&this._continue()}_continue(){this.running=!0,!this.cancelled&&(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())}_scheduleNext(){this._useRequestAnimationFrame?window.requestAnimationFrame(()=>{this._nextBound().catch(this._cancelBound)}):Promise.resolve().then(this._nextBound).catch(this._cancelBound)}async _next(){this.cancelled||(this.operatorListIdx=this.gfx.executeOperatorList(this.operatorList,this.operatorListIdx,this._continueBound,this.stepper),this.operatorListIdx===this.operatorList.argsArray.length&&(this.running=!1,this.operatorList.lastChunk&&(this.gfx.endDrawing(),bt(_,m).delete(this._canvas),this.callback())))}};m=new WeakMap,ll(_,m,new WeakSet);let InternalRenderTask=_;const version="3.11.174";exports.version=version;const build="ce8716743";exports.build=build},(lt,r,h)=>{var I,j,q,ss,f;Object.defineProperty(r,"__esModule",{value:!0}),r.SerializableEmpty=r.PrintAnnotationStorage=r.AnnotationStorage=void 0;var M=h(1),p=h(4),B=h(8);const Q=Object.freeze({map:null,hash:"",transfers:void 0});r.SerializableEmpty=Q;class U{constructor(){ll(this,q);ll(this,I,!1);ll(this,j,new Map);this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(k,T){const g=bt(this,j).get(k);return g===void 0?T:Object.assign(T,g)}getRawValue(k){return bt(this,j).get(k)}remove(k){if(bt(this,j).delete(k),bt(this,j).size===0&&this.resetModified(),typeof this.onAnnotationEditor=="function"){for(const T of bt(this,j).values())if(T instanceof p.AnnotationEditor)return;this.onAnnotationEditor(null)}}setValue(k,T){const g=bt(this,j).get(k);let F=!1;if(g!==void 0)for(const[J,v]of Object.entries(T))g[J]!==v&&(F=!0,g[J]=v);else F=!0,bt(this,j).set(k,T);F&&nl(this,q,ss).call(this),T instanceof p.AnnotationEditor&&typeof this.onAnnotationEditor=="function"&&this.onAnnotationEditor(T.constructor._type)}has(k){return bt(this,j).has(k)}getAll(){return bt(this,j).size>0?(0,M.objectFromMap)(bt(this,j)):null}setAll(k){for(const[T,g]of Object.entries(k))this.setValue(T,g)}get size(){return bt(this,j).size}resetModified(){bt(this,I)&&(ul(this,I,!1),typeof this.onResetModified=="function"&&this.onResetModified())}get print(){return new O(this)}get serializable(){if(bt(this,j).size===0)return Q;const k=new Map,T=new B.MurmurHash3_64,g=[],F=Object.create(null);let J=!1;for(const[v,u]of bt(this,j)){const m=u instanceof p.AnnotationEditor?u.serialize(!1,F):u;m&&(k.set(v,m),T.update(`${v}:${JSON.stringify(m)}`),J||(J=!!m.bitmap))}if(J)for(const v of k.values())v.bitmap&&g.push(v.bitmap);return k.size>0?{map:k,hash:T.hexdigest(),transfers:g}:Q}}I=new WeakMap,j=new WeakMap,q=new WeakSet,ss=function(){bt(this,I)||(ul(this,I,!0),typeof this.onSetModified=="function"&&this.onSetModified())},r.AnnotationStorage=U;class O extends U{constructor(T){super();ll(this,f,void 0);const{map:g,hash:F,transfers:J}=T.serializable,v=structuredClone(g,J?{transfer:J}:null);ul(this,f,{map:v,hash:F,transfers:J})}get print(){(0,M.unreachable)("Should not call PrintAnnotationStorage.print")}get serializable(){return bt(this,f)}}f=new WeakMap,r.PrintAnnotationStorage=O},(lt,r,h)=>{var O,I,j,q,K,f,S,k,T,g,F,J,v,u,m,pe,$,ye,Zt,Te,It,Le,it,is,zt,cs,Nt,ds,Vt,Ve,Pt,as;Object.defineProperty(r,"__esModule",{value:!0}),r.AnnotationEditor=void 0;var M=h(5),p=h(1),B=h(6);const R=class R{constructor(X){ll(this,m);ll(this,$);ll(this,It);ll(this,it);ll(this,zt);ll(this,Nt);ll(this,Vt);ll(this,Pt);ll(this,O,"");ll(this,I,!1);ll(this,j,null);ll(this,q,null);ll(this,K,null);ll(this,f,!1);ll(this,S,null);ll(this,k,this.focusin.bind(this));ll(this,T,this.focusout.bind(this));ll(this,g,!1);ll(this,F,!1);ll(this,J,!1);gl(this,"_initialOptions",Object.create(null));gl(this,"_uiManager",null);gl(this,"_focusEventsAllowed",!0);gl(this,"_l10nPromise",null);ll(this,v,!1);ll(this,u,R._zIndex++);this.constructor===R&&(0,p.unreachable)("Cannot initialize AnnotationEditor."),this.parent=X.parent,this.id=X.id,this.width=this.height=null,this.pageIndex=X.parent.pageIndex,this.name=X.name,this.div=null,this._uiManager=X.uiManager,this.annotationElementId=null,this._willKeepAspectRatio=!1,this._initialOptions.isCentered=X.isCentered,this._structTreeParentId=null;const{rotation:C,rawDims:{pageWidth:H,pageHeight:st,pageX:et,pageY:Mt}}=this.parent.viewport;this.rotation=C,this.pageRotation=(360+C-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[H,st],this.pageTranslation=[et,Mt];const[Rt,gt]=this.parentDimensions;this.x=X.x/Rt,this.y=X.y/gt,this.isAttachedToDOM=!1,this.deleted=!1}get editorType(){return Object.getPrototypeOf(this).constructor._type}static get _defaultLineColor(){return(0,p.shadow)(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(X){const C=new U({id:X.parent.getNextId(),parent:X.parent,uiManager:X._uiManager});C.annotationElementId=X.annotationElementId,C.deleted=!0,C._uiManager.addToAnnotationStorage(C)}static initialize(X,C=null){if(R._l10nPromise||(R._l10nPromise=new Map(["editor_alt_text_button_label","editor_alt_text_edit_button_label","editor_alt_text_decorative_tooltip"].map(st=>[st,X.get(st)]))),C!=null&&C.strings)for(const st of C.strings)R._l10nPromise.set(st,X.get(st));if(R._borderLineWidth!==-1)return;const H=getComputedStyle(document.documentElement);R._borderLineWidth=parseFloat(H.getPropertyValue("--outline-width"))||0}static updateDefaultParams(X,C){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(X){return!1}static paste(X,C){(0,p.unreachable)("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return bt(this,v)}set _isDraggable(X){var C;ul(this,v,X),(C=this.div)==null||C.classList.toggle("draggable",X)}center(){const[X,C]=this.pageDimensions;switch(this.parentRotation){case 90:this.x-=this.height*C/(X*2),this.y+=this.width*X/(C*2);break;case 180:this.x+=this.width/2,this.y+=this.height/2;break;case 270:this.x+=this.height*C/(X*2),this.y-=this.width*X/(C*2);break;default:this.x-=this.width/2,this.y-=this.height/2;break}this.fixAndSetPosition()}addCommands(X){this._uiManager.addCommands(X)}get currentLayer(){return this._uiManager.currentLayer}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=bt(this,u)}setParent(X){X!==null&&(this.pageIndex=X.pageIndex,this.pageDimensions=X.pageDimensions),this.parent=X}focusin(X){this._focusEventsAllowed&&(bt(this,g)?ul(this,g,!1):this.parent.setSelected(this))}focusout(X){var H;if(!this._focusEventsAllowed||!this.isAttachedToDOM)return;const C=X.relatedTarget;C!=null&&C.closest(`#${this.id}`)||(X.preventDefault(),(H=this.parent)!=null&&H.isMultipleSelection||this.commitOrRemove())}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}setAt(X,C,H,st){const[et,Mt]=this.parentDimensions;[H,st]=this.screenToPageTranslation(H,st),this.x=(X+H)/et,this.y=(C+st)/Mt,this.fixAndSetPosition()}translate(X,C){nl(this,m,pe).call(this,this.parentDimensions,X,C)}translateInPage(X,C){nl(this,m,pe).call(this,this.pageDimensions,X,C),this.div.scrollIntoView({block:"nearest"})}drag(X,C){const[H,st]=this.parentDimensions;if(this.x+=X/H,this.y+=C/st,this.parent&&(this.x<0||this.x>1||this.y<0||this.y>1)){const{x:Jt,y:Dt}=this.div.getBoundingClientRect();this.parent.findNewParent(this,Jt,Dt)&&(this.x-=Math.floor(this.x),this.y-=Math.floor(this.y))}let{x:et,y:Mt}=this;const[Rt,gt]=nl(this,$,ye).call(this);et+=Rt,Mt+=gt,this.div.style.left=`${(100*et).toFixed(2)}%`,this.div.style.top=`${(100*Mt).toFixed(2)}%`,this.div.scrollIntoView({block:"nearest"})}fixAndSetPosition(){const[X,C]=this.pageDimensions;let{x:H,y:st,width:et,height:Mt}=this;switch(et*=X,Mt*=C,H*=X,st*=C,this.rotation){case 0:H=Math.max(0,Math.min(X-et,H)),st=Math.max(0,Math.min(C-Mt,st));break;case 90:H=Math.max(0,Math.min(X-Mt,H)),st=Math.min(C,Math.max(et,st));break;case 180:H=Math.min(X,Math.max(et,H)),st=Math.min(C,Math.max(Mt,st));break;case 270:H=Math.min(X,Math.max(Mt,H)),st=Math.max(0,Math.min(C-et,st));break}this.x=H/=X,this.y=st/=C;const[Rt,gt]=nl(this,$,ye).call(this);H+=Rt,st+=gt;const{style:Jt}=this.div;Jt.left=`${(100*H).toFixed(2)}%`,Jt.top=`${(100*st).toFixed(2)}%`,this.moveInDOM()}screenToPageTranslation(X,C){var H;return nl(H=R,Zt,Te).call(H,X,C,this.parentRotation)}pageTranslationToScreen(X,C){var H;return nl(H=R,Zt,Te).call(H,X,C,360-this.parentRotation)}get parentScale(){return this._uiManager.viewParameters.realScale}get parentRotation(){return(this._uiManager.viewParameters.rotation+this.pageRotation)%360}get parentDimensions(){const{parentScale:X,pageDimensions:[C,H]}=this,st=C*X,et=H*X;return p.FeatureTest.isCSSRoundSupported?[Math.round(st),Math.round(et)]:[st,et]}setDims(X,C){var et;const[H,st]=this.parentDimensions;this.div.style.width=`${(100*X/H).toFixed(2)}%`,bt(this,f)||(this.div.style.height=`${(100*C/st).toFixed(2)}%`),(et=bt(this,j))==null||et.classList.toggle("small",X<R.SMALL_EDITOR_SIZE||C<R.SMALL_EDITOR_SIZE)}fixDims(){const{style:X}=this.div,{height:C,width:H}=X,st=H.endsWith("%"),et=!bt(this,f)&&C.endsWith("%");if(st&&et)return;const[Mt,Rt]=this.parentDimensions;st||(X.width=`${(100*parseFloat(H)/Mt).toFixed(2)}%`),!bt(this,f)&&!et&&(X.height=`${(100*parseFloat(C)/Rt).toFixed(2)}%`)}getInitialTranslation(){return[0,0]}async addAltTextButton(){if(bt(this,j))return;const X=ul(this,j,document.createElement("button"));X.className="altText";const C=await R._l10nPromise.get("editor_alt_text_button_label");X.textContent=C,X.setAttribute("aria-label",C),X.tabIndex="0",X.addEventListener("contextmenu",B.noContextMenu),X.addEventListener("pointerdown",H=>H.stopPropagation()),X.addEventListener("click",H=>{H.preventDefault(),this._uiManager.editAltText(this)},{capture:!0}),X.addEventListener("keydown",H=>{H.target===X&&H.key==="Enter"&&(H.preventDefault(),this._uiManager.editAltText(this))}),nl(this,Vt,Ve).call(this),this.div.append(X),R.SMALL_EDITOR_SIZE||(R.SMALL_EDITOR_SIZE=Math.min(128,Math.round(X.getBoundingClientRect().width*1.4)))}getClientDimensions(){return this.div.getBoundingClientRect()}get altTextData(){return{altText:bt(this,O),decorative:bt(this,I)}}set altTextData({altText:X,decorative:C}){bt(this,O)===X&&bt(this,I)===C||(ul(this,O,X),ul(this,I,C),nl(this,Vt,Ve).call(this))}render(){this.div=document.createElement("div"),this.div.setAttribute("data-editor-rotation",(360-this.rotation)%360),this.div.className=this.name,this.div.setAttribute("id",this.id),this.div.setAttribute("tabIndex",0),this.setInForeground(),this.div.addEventListener("focusin",bt(this,k)),this.div.addEventListener("focusout",bt(this,T));const[X,C]=this.parentDimensions;this.parentRotation%180!==0&&(this.div.style.maxWidth=`${(100*C/X).toFixed(2)}%`,this.div.style.maxHeight=`${(100*X/C).toFixed(2)}%`);const[H,st]=this.getInitialTranslation();return this.translate(H,st),(0,M.bindEvents)(this,this.div,["pointerdown"]),this.div}pointerdown(X){const{isMac:C}=p.FeatureTest.platform;if(X.button!==0||X.ctrlKey&&C){X.preventDefault();return}ul(this,g,!0),nl(this,Pt,as).call(this,X)}moveInDOM(){var X;(X=this.parent)==null||X.moveEditorInDOM(this)}_setParentAndPosition(X,C,H){X.changeParent(this),this.x=C,this.y=H,this.fixAndSetPosition()}getRect(X,C){const H=this.parentScale,[st,et]=this.pageDimensions,[Mt,Rt]=this.pageTranslation,gt=X/H,Jt=C/H,Dt=this.x*st,qt=this.y*et,vt=this.width*st,cl=this.height*et;switch(this.rotation){case 0:return[Dt+gt+Mt,et-qt-Jt-cl+Rt,Dt+gt+vt+Mt,et-qt-Jt+Rt];case 90:return[Dt+Jt+Mt,et-qt+gt+Rt,Dt+Jt+cl+Mt,et-qt+gt+vt+Rt];case 180:return[Dt-gt-vt+Mt,et-qt+Jt+Rt,Dt-gt+Mt,et-qt+Jt+cl+Rt];case 270:return[Dt-Jt-cl+Mt,et-qt-gt-vt+Rt,Dt-Jt+Mt,et-qt-gt+Rt];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(X,C){const[H,st,et,Mt]=X,Rt=et-H,gt=Mt-st;switch(this.rotation){case 0:return[H,C-Mt,Rt,gt];case 90:return[H,C-st,gt,Rt];case 180:return[et,C-st,Rt,gt];case 270:return[et,C-Mt,gt,Rt];default:throw new Error("Invalid rotation")}}onceAdded(){}isEmpty(){return!1}enableEditMode(){ul(this,J,!0)}disableEditMode(){ul(this,J,!1)}isInEditMode(){return bt(this,J)}shouldGetKeyboardEvents(){return!1}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}rebuild(){var X,C;(X=this.div)==null||X.addEventListener("focusin",bt(this,k)),(C=this.div)==null||C.addEventListener("focusout",bt(this,T))}serialize(X=!1,C=null){(0,p.unreachable)("An editor must be serializable")}static deserialize(X,C,H){const st=new this.prototype.constructor({parent:C,id:C.getNextId(),uiManager:H});st.rotation=X.rotation;const[et,Mt]=st.pageDimensions,[Rt,gt,Jt,Dt]=st.getRectInCurrentCoords(X.rect,Mt);return st.x=Rt/et,st.y=gt/Mt,st.width=Jt/et,st.height=Dt/Mt,st}remove(){var X;this.div.removeEventListener("focusin",bt(this,k)),this.div.removeEventListener("focusout",bt(this,T)),this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),(X=bt(this,j))==null||X.remove(),ul(this,j,null),ul(this,q,null)}get isResizable(){return!1}makeResizable(){this.isResizable&&(nl(this,it,is).call(this),bt(this,S).classList.remove("hidden"))}select(){var X;this.makeResizable(),(X=this.div)==null||X.classList.add("selectedEditor")}unselect(){var X,C,H;(X=bt(this,S))==null||X.classList.add("hidden"),(C=this.div)==null||C.classList.remove("selectedEditor"),(H=this.div)!=null&&H.contains(document.activeElement)&&this._uiManager.currentLayer.div.focus()}updateParams(X,C){}disableEditing(){bt(this,j)&&(bt(this,j).hidden=!0)}enableEditing(){bt(this,j)&&(bt(this,j).hidden=!1)}enterInEditMode(){}get contentDiv(){return this.div}get isEditing(){return bt(this,F)}set isEditing(X){ul(this,F,X),this.parent&&(X?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null))}setAspectRatio(X,C){ul(this,f,!0);const H=X/C,{style:st}=this.div;st.aspectRatio=H,st.height="auto"}static get MIN_SIZE(){return 16}};O=new WeakMap,I=new WeakMap,j=new WeakMap,q=new WeakMap,K=new WeakMap,f=new WeakMap,S=new WeakMap,k=new WeakMap,T=new WeakMap,g=new WeakMap,F=new WeakMap,J=new WeakMap,v=new WeakMap,u=new WeakMap,m=new WeakSet,pe=function([X,C],H,st){[H,st]=this.screenToPageTranslation(H,st),this.x+=H/X,this.y+=st/C,this.fixAndSetPosition()},$=new WeakSet,ye=function(){const[X,C]=this.parentDimensions,{_borderLineWidth:H}=R,st=H/X,et=H/C;switch(this.rotation){case 90:return[-st,et];case 180:return[st,et];case 270:return[st,-et];default:return[-st,-et]}},Zt=new WeakSet,Te=function(X,C,H){switch(H){case 90:return[C,-X];case 180:return[-X,-C];case 270:return[-C,X];default:return[X,C]}},It=new WeakSet,Le=function(X){switch(X){case 90:{const[C,H]=this.pageDimensions;return[0,-C/H,H/C,0]}case 180:return[-1,0,0,-1];case 270:{const[C,H]=this.pageDimensions;return[0,C/H,-H/C,0]}default:return[1,0,0,1]}},it=new WeakSet,is=function(){if(bt(this,S))return;ul(this,S,document.createElement("div")),bt(this,S).classList.add("resizers");const X=["topLeft","topRight","bottomRight","bottomLeft"];this._willKeepAspectRatio||X.push("topMiddle","middleRight","bottomMiddle","middleLeft");for(const C of X){const H=document.createElement("div");bt(this,S).append(H),H.classList.add("resizer",C),H.addEventListener("pointerdown",nl(this,zt,cs).bind(this,C)),H.addEventListener("contextmenu",B.noContextMenu)}this.div.prepend(bt(this,S))},zt=new WeakSet,cs=function(X,C){C.preventDefault();const{isMac:H}=p.FeatureTest.platform;if(C.button!==0||C.ctrlKey&&H)return;const st=nl(this,Nt,ds).bind(this,X),et=this._isDraggable;this._isDraggable=!1;const Mt={passive:!0,capture:!0};window.addEventListener("pointermove",st,Mt);const Rt=this.x,gt=this.y,Jt=this.width,Dt=this.height,qt=this.parent.div.style.cursor,vt=this.div.style.cursor;this.div.style.cursor=this.parent.div.style.cursor=window.getComputedStyle(C.target).cursor;const cl=()=>{this._isDraggable=et,window.removeEventListener("pointerup",cl),window.removeEventListener("blur",cl),window.removeEventListener("pointermove",st,Mt),this.parent.div.style.cursor=qt,this.div.style.cursor=vt;const bl=this.x,il=this.y,Bt=this.width,Ft=this.height;bl===Rt&&il===gt&&Bt===Jt&&Ft===Dt||this.addCommands({cmd:()=>{this.width=Bt,this.height=Ft,this.x=bl,this.y=il;const[wt,pt]=this.parentDimensions;this.setDims(wt*Bt,pt*Ft),this.fixAndSetPosition()},undo:()=>{this.width=Jt,this.height=Dt,this.x=Rt,this.y=gt;const[wt,pt]=this.parentDimensions;this.setDims(wt*Jt,pt*Dt),this.fixAndSetPosition()},mustExec:!0})};window.addEventListener("pointerup",cl),window.addEventListener("blur",cl)},Nt=new WeakSet,ds=function(X,C){const[H,st]=this.parentDimensions,et=this.x,Mt=this.y,Rt=this.width,gt=this.height,Jt=R.MIN_SIZE/H,Dt=R.MIN_SIZE/st,qt=Tt=>Math.round(Tt*1e4)/1e4,vt=nl(this,It,Le).call(this,this.rotation),cl=(Tt,jt)=>[vt[0]*Tt+vt[2]*jt,vt[1]*Tt+vt[3]*jt],bl=nl(this,It,Le).call(this,360-this.rotation),il=(Tt,jt)=>[bl[0]*Tt+bl[2]*jt,bl[1]*Tt+bl[3]*jt];let Bt,Ft,wt=!1,pt=!1;switch(X){case"topLeft":wt=!0,Bt=(Tt,jt)=>[0,0],Ft=(Tt,jt)=>[Tt,jt];break;case"topMiddle":Bt=(Tt,jt)=>[Tt/2,0],Ft=(Tt,jt)=>[Tt/2,jt];break;case"topRight":wt=!0,Bt=(Tt,jt)=>[Tt,0],Ft=(Tt,jt)=>[0,jt];break;case"middleRight":pt=!0,Bt=(Tt,jt)=>[Tt,jt/2],Ft=(Tt,jt)=>[0,jt/2];break;case"bottomRight":wt=!0,Bt=(Tt,jt)=>[Tt,jt],Ft=(Tt,jt)=>[0,0];break;case"bottomMiddle":Bt=(Tt,jt)=>[Tt/2,jt],Ft=(Tt,jt)=>[Tt/2,0];break;case"bottomLeft":wt=!0,Bt=(Tt,jt)=>[0,jt],Ft=(Tt,jt)=>[Tt,0];break;case"middleLeft":pt=!0,Bt=(Tt,jt)=>[0,jt/2],Ft=(Tt,jt)=>[Tt,jt/2];break}const Ct=Bt(Rt,gt),$t=Ft(Rt,gt);let dl=cl(...$t);const rl=qt(et+dl[0]),Yl=qt(Mt+dl[1]);let Xl=1,pl=1,[Ll,yl]=this.screenToPageTranslation(C.movementX,C.movementY);if([Ll,yl]=il(Ll/H,yl/st),wt){const Tt=Math.hypot(Rt,gt);Xl=pl=Math.max(Math.min(Math.hypot($t[0]-Ct[0]-Ll,$t[1]-Ct[1]-yl)/Tt,1/Rt,1/gt),Jt/Rt,Dt/gt)}else pt?Xl=Math.max(Jt,Math.min(1,Math.abs($t[0]-Ct[0]-Ll)))/Rt:pl=Math.max(Dt,Math.min(1,Math.abs($t[1]-Ct[1]-yl)))/gt;const Vl=qt(Rt*Xl),_t=qt(gt*pl);dl=cl(...Ft(Vl,_t));const ot=rl-dl[0],ut=Yl-dl[1];this.width=Vl,this.height=_t,this.x=ot,this.y=ut,this.setDims(H*Vl,st*_t),this.fixAndSetPosition()},Vt=new WeakSet,Ve=async function(){var H;const X=bt(this,j);if(!X)return;if(!bt(this,O)&&!bt(this,I)){X.classList.remove("done"),(H=bt(this,q))==null||H.remove();return}R._l10nPromise.get("editor_alt_text_edit_button_label").then(st=>{X.setAttribute("aria-label",st)});let C=bt(this,q);if(!C){ul(this,q,C=document.createElement("span")),C.className="tooltip",C.setAttribute("role","tooltip");const st=C.id=`alt-text-tooltip-${this.id}`;X.setAttribute("aria-describedby",st);const et=100;X.addEventListener("mouseenter",()=>{ul(this,K,setTimeout(()=>{ul(this,K,null),bt(this,q).classList.add("show"),this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",subtype:this.editorType,data:{action:"alt_text_tooltip"}}})},et))}),X.addEventListener("mouseleave",()=>{var Mt;clearTimeout(bt(this,K)),ul(this,K,null),(Mt=bt(this,q))==null||Mt.classList.remove("show")})}X.classList.add("done"),C.innerText=bt(this,I)?await R._l10nPromise.get("editor_alt_text_decorative_tooltip"):bt(this,O),C.parentNode||X.append(C)},Pt=new WeakSet,as=function(X){if(!this._isDraggable)return;const C=this._uiManager.isSelected(this);this._uiManager.setUpDragSession();let H,st;C&&(H={passive:!0,capture:!0},st=Mt=>{const[Rt,gt]=this.screenToPageTranslation(Mt.movementX,Mt.movementY);this._uiManager.dragSelectedEditors(Rt,gt)},window.addEventListener("pointermove",st,H));const et=()=>{if(window.removeEventListener("pointerup",et),window.removeEventListener("blur",et),C&&window.removeEventListener("pointermove",st,H),ul(this,g,!1),!this._uiManager.endDragSession()){const{isMac:Mt}=p.FeatureTest.platform;X.ctrlKey&&!Mt||X.shiftKey||X.metaKey&&Mt?this.parent.toggleSelected(this):this.parent.setSelected(this)}};window.addEventListener("pointerup",et),window.addEventListener("blur",et)},ll(R,Zt),gl(R,"_borderLineWidth",-1),gl(R,"_colorManager",new M.ColorManager),gl(R,"_zIndex",1),gl(R,"SMALL_EDITOR_SIZE",0);let Q=R;r.AnnotationEditor=Q;class U extends Q{constructor(X){super(X),this.annotationElementId=X.annotationElementId,this.deleted=!0}serialize(){return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex}}}},(lt,r,h)=>{var f,S,k,T,g,Ie,v,u,m,_,$,ns,dt,It,xt,it,Xt,zt,Gt,Nt,Ut,Vt,Ht,Pt,at,R,w,X,C,H,st,et,Mt,Rt,gt,Jt,Dt,qt,vt,cl,bl,il,Bt,Ft,wt,pt,Ct,Zs,dl,ze,Yl,Re,pl,ae,yl,Se,_t,we,ut,Jl,jt,_l,Lt,hs,Kt,bs,el,xe,Qt,ql,hl,ke;Object.defineProperty(r,"__esModule",{value:!0}),r.KeyboardManager=r.CommandManager=r.ColorManager=r.AnnotationEditorUIManager=void 0,r.bindEvents=B,r.opacityToHex=Q;var M=h(1),p=h(6);function B(nt,L,ct){for(const Wt of ct)L.addEventListener(Wt,nt[Wt].bind(nt))}function Q(nt){return Math.round(Math.min(255,Math.max(1,255*nt))).toString(16).padStart(2,"0")}class U{constructor(){ll(this,f,0)}getId(){return`${M.AnnotationEditorPrefix}${Al(this,f)._++}`}}f=new WeakMap;const J=class J{constructor(){ll(this,g);ll(this,S,(0,M.getUuid)());ll(this,k,0);ll(this,T,null)}static get _isSVGFittingCanvas(){const L='data:image/svg+xml;charset=UTF-8,<svg viewBox="0 0 1 1" width="1" height="1" xmlns="http://www.w3.org/2000/svg"><rect width="1" height="1" style="fill:red;"/></svg>',Wt=new OffscreenCanvas(1,3).getContext("2d"),Yt=new Image;Yt.src=L;const kt=Yt.decode().then(()=>(Wt.drawImage(Yt,0,0,1,1,0,0,1,3),new Uint32Array(Wt.getImageData(0,0,1,1).data.buffer)[0]===0));return(0,M.shadow)(this,"_isSVGFittingCanvas",kt)}async getFromFile(L){const{lastModified:ct,name:Wt,size:Yt,type:kt}=L;return nl(this,g,Ie).call(this,`${ct}_${Wt}_${Yt}_${kt}`,L)}async getFromUrl(L){return nl(this,g,Ie).call(this,L,L)}async getFromId(L){bt(this,T)||ul(this,T,new Map);const ct=bt(this,T).get(L);return ct?ct.bitmap?(ct.refCounter+=1,ct):ct.file?this.getFromFile(ct.file):this.getFromUrl(ct.url):null}getSvgUrl(L){const ct=bt(this,T).get(L);return ct!=null&&ct.isSvg?ct.svgUrl:null}deleteId(L){bt(this,T)||ul(this,T,new Map);const ct=bt(this,T).get(L);ct&&(ct.refCounter-=1,ct.refCounter===0&&(ct.bitmap=null))}isValidId(L){return L.startsWith(`image_${bt(this,S)}_`)}};S=new WeakMap,k=new WeakMap,T=new WeakMap,g=new WeakSet,Ie=async function(L,ct){bt(this,T)||ul(this,T,new Map);let Wt=bt(this,T).get(L);if(Wt===null)return null;if(Wt!=null&&Wt.bitmap)return Wt.refCounter+=1,Wt;try{Wt||(Wt={bitmap:null,id:`image_${bt(this,S)}_${Al(this,k)._++}`,refCounter:0,isSvg:!1});let Yt;if(typeof ct=="string"){Wt.url=ct;const kt=await fetch(ct);if(!kt.ok)throw new Error(kt.statusText);Yt=await kt.blob()}else Yt=Wt.file=ct;if(Yt.type==="image/svg+xml"){const kt=J._isSVGFittingCanvas,Et=new FileReader,sl=new Image,ml=new Promise((al,zl)=>{sl.onload=()=>{Wt.bitmap=sl,Wt.isSvg=!0,al()},Et.onload=async()=>{const Gl=Wt.svgUrl=Et.result;sl.src=await kt?`${Gl}#svgView(preserveAspectRatio(none))`:Gl},sl.onerror=Et.onerror=zl});Et.readAsDataURL(Yt),await ml}else Wt.bitmap=await createImageBitmap(Yt);Wt.refCounter=1}catch(Yt){console.error(Yt),Wt=null}return bt(this,T).set(L,Wt),Wt&&bt(this,T).set(Wt.id,Wt),Wt};let O=J;class I{constructor(L=128){ll(this,v,[]);ll(this,u,!1);ll(this,m,void 0);ll(this,_,-1);ul(this,m,L)}add({cmd:L,undo:ct,mustExec:Wt,type:Yt=NaN,overwriteIfSameType:kt=!1,keepUndo:Et=!1}){if(Wt&&L(),bt(this,u))return;const sl={cmd:L,undo:ct,type:Yt};if(bt(this,_)===-1){bt(this,v).length>0&&(bt(this,v).length=0),ul(this,_,0),bt(this,v).push(sl);return}if(kt&&bt(this,v)[bt(this,_)].type===Yt){Et&&(sl.undo=bt(this,v)[bt(this,_)].undo),bt(this,v)[bt(this,_)]=sl;return}const ml=bt(this,_)+1;ml===bt(this,m)?bt(this,v).splice(0,1):(ul(this,_,ml),ml<bt(this,v).length&&bt(this,v).splice(ml)),bt(this,v).push(sl)}undo(){bt(this,_)!==-1&&(ul(this,u,!0),bt(this,v)[bt(this,_)].undo(),ul(this,u,!1),ul(this,_,bt(this,_)-1))}redo(){bt(this,_)<bt(this,v).length-1&&(ul(this,_,bt(this,_)+1),ul(this,u,!0),bt(this,v)[bt(this,_)].cmd(),ul(this,u,!1))}hasSomethingToUndo(){return bt(this,_)!==-1}hasSomethingToRedo(){return bt(this,_)<bt(this,v).length-1}destroy(){ul(this,v,null)}}v=new WeakMap,u=new WeakMap,m=new WeakMap,_=new WeakMap,r.CommandManager=I;class j{constructor(L){ll(this,$);this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;const{isMac:ct}=M.FeatureTest.platform;for(const[Wt,Yt,kt={}]of L)for(const Et of Wt){const sl=Et.startsWith("mac+");ct&&sl?(this.callbacks.set(Et.slice(4),{callback:Yt,options:kt}),this.allKeys.add(Et.split("+").at(-1))):!ct&&!sl&&(this.callbacks.set(Et,{callback:Yt,options:kt}),this.allKeys.add(Et.split("+").at(-1)))}}exec(L,ct){if(!this.allKeys.has(ct.key))return;const Wt=this.callbacks.get(nl(this,$,ns).call(this,ct));if(!Wt)return;const{callback:Yt,options:{bubbles:kt=!1,args:Et=[],checker:sl=null}}=Wt;sl&&!sl(L,ct)||(Yt.bind(L,...Et)(),kt||(ct.stopPropagation(),ct.preventDefault()))}}$=new WeakSet,ns=function(L){L.altKey&&this.buffer.push("alt"),L.ctrlKey&&this.buffer.push("ctrl"),L.metaKey&&this.buffer.push("meta"),L.shiftKey&&this.buffer.push("shift"),this.buffer.push(L.key);const ct=this.buffer.join("+");return this.buffer.length=0,ct},r.KeyboardManager=j;const Zt=class Zt{get _colors(){const L=new Map([["CanvasText",null],["Canvas",null]]);return(0,p.getColorValues)(L),(0,M.shadow)(this,"_colors",L)}convert(L){const ct=(0,p.getRGB)(L);if(!window.matchMedia("(forced-colors: active)").matches)return ct;for(const[Wt,Yt]of this._colors)if(Yt.every((kt,Et)=>kt===ct[Et]))return Zt._colorsMapping.get(Wt);return ct}getHexCode(L){const ct=this._colors.get(L);return ct?M.Util.makeHexColor(...ct):L}};gl(Zt,"_colorsMapping",new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]));let q=Zt;r.ColorManager=q;const Wl=class Wl{constructor(L,ct,Wt,Yt,kt,Et){ll(this,Ct);ll(this,dl);ll(this,Yl);ll(this,pl);ll(this,yl);ll(this,_t);ll(this,ut);ll(this,jt);ll(this,Lt);ll(this,Kt);ll(this,el);ll(this,Qt);ll(this,hl);ll(this,dt,null);ll(this,It,new Map);ll(this,xt,new Map);ll(this,it,null);ll(this,Xt,null);ll(this,zt,new I);ll(this,Gt,0);ll(this,Nt,new Set);ll(this,Ut,null);ll(this,Vt,null);ll(this,Ht,new Set);ll(this,Pt,null);ll(this,at,new U);ll(this,R,!1);ll(this,w,!1);ll(this,X,null);ll(this,C,M.AnnotationEditorType.NONE);ll(this,H,new Set);ll(this,st,null);ll(this,et,this.blur.bind(this));ll(this,Mt,this.focus.bind(this));ll(this,Rt,this.copy.bind(this));ll(this,gt,this.cut.bind(this));ll(this,Jt,this.paste.bind(this));ll(this,Dt,this.keydown.bind(this));ll(this,qt,this.onEditingAction.bind(this));ll(this,vt,this.onPageChanging.bind(this));ll(this,cl,this.onScaleChanging.bind(this));ll(this,bl,this.onRotationChanging.bind(this));ll(this,il,{isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1});ll(this,Bt,[0,0]);ll(this,Ft,null);ll(this,wt,null);ll(this,pt,null);ul(this,wt,L),ul(this,pt,ct),ul(this,it,Wt),this._eventBus=Yt,this._eventBus._on("editingaction",bt(this,qt)),this._eventBus._on("pagechanging",bt(this,vt)),this._eventBus._on("scalechanging",bt(this,cl)),this._eventBus._on("rotationchanging",bt(this,bl)),ul(this,Xt,kt.annotationStorage),ul(this,Pt,kt.filterFactory),ul(this,st,Et),this.viewParameters={realScale:p.PixelsPerInch.PDF_TO_CSS_UNITS,rotation:0}}static get _keyboardManager(){const L=Wl.prototype,ct=kt=>{const{activeElement:Et}=document;return Et&&bt(kt,wt).contains(Et)&&kt.hasSomethingToControl()},Wt=this.TRANSLATE_SMALL,Yt=this.TRANSLATE_BIG;return(0,M.shadow)(this,"_keyboardManager",new j([[["ctrl+a","mac+meta+a"],L.selectAll],[["ctrl+z","mac+meta+z"],L.undo],[["ctrl+y","ctrl+shift+z","mac+meta+shift+z","ctrl+shift+Z","mac+meta+shift+Z"],L.redo],[["Backspace","alt+Backspace","ctrl+Backspace","shift+Backspace","mac+Backspace","mac+alt+Backspace","mac+ctrl+Backspace","Delete","ctrl+Delete","shift+Delete","mac+Delete"],L.delete],[["Escape","mac+Escape"],L.unselectAll],[["ArrowLeft","mac+ArrowLeft"],L.translateSelectedEditors,{args:[-Wt,0],checker:ct}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],L.translateSelectedEditors,{args:[-Yt,0],checker:ct}],[["ArrowRight","mac+ArrowRight"],L.translateSelectedEditors,{args:[Wt,0],checker:ct}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],L.translateSelectedEditors,{args:[Yt,0],checker:ct}],[["ArrowUp","mac+ArrowUp"],L.translateSelectedEditors,{args:[0,-Wt],checker:ct}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],L.translateSelectedEditors,{args:[0,-Yt],checker:ct}],[["ArrowDown","mac+ArrowDown"],L.translateSelectedEditors,{args:[0,Wt],checker:ct}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],L.translateSelectedEditors,{args:[0,Yt],checker:ct}]]))}destroy(){nl(this,pl,ae).call(this),nl(this,dl,ze).call(this),this._eventBus._off("editingaction",bt(this,qt)),this._eventBus._off("pagechanging",bt(this,vt)),this._eventBus._off("scalechanging",bt(this,cl)),this._eventBus._off("rotationchanging",bt(this,bl));for(const L of bt(this,xt).values())L.destroy();bt(this,xt).clear(),bt(this,It).clear(),bt(this,Ht).clear(),ul(this,dt,null),bt(this,H).clear(),bt(this,zt).destroy(),bt(this,it).destroy()}get hcmFilter(){return(0,M.shadow)(this,"hcmFilter",bt(this,st)?bt(this,Pt).addHCMFilter(bt(this,st).foreground,bt(this,st).background):"none")}get direction(){return(0,M.shadow)(this,"direction",getComputedStyle(bt(this,wt)).direction)}editAltText(L){var ct;(ct=bt(this,it))==null||ct.editAltText(this,L)}onPageChanging({pageNumber:L}){ul(this,Gt,L-1)}focusMainContainer(){bt(this,wt).focus()}findParent(L,ct){for(const Wt of bt(this,xt).values()){const{x:Yt,y:kt,width:Et,height:sl}=Wt.div.getBoundingClientRect();if(L>=Yt&&L<=Yt+Et&&ct>=kt&&ct<=kt+sl)return Wt}return null}disableUserSelect(L=!1){bt(this,pt).classList.toggle("noUserSelect",L)}addShouldRescale(L){bt(this,Ht).add(L)}removeShouldRescale(L){bt(this,Ht).delete(L)}onScaleChanging({scale:L}){this.commitOrRemove(),this.viewParameters.realScale=L*p.PixelsPerInch.PDF_TO_CSS_UNITS;for(const ct of bt(this,Ht))ct.onScaleChanging()}onRotationChanging({pagesRotation:L}){this.commitOrRemove(),this.viewParameters.rotation=L}addToAnnotationStorage(L){!L.isEmpty()&&bt(this,Xt)&&!bt(this,Xt).has(L.id)&&bt(this,Xt).setValue(L.id,L)}blur(){if(!this.hasSelection)return;const{activeElement:L}=document;for(const ct of bt(this,H))if(ct.div.contains(L)){ul(this,X,[ct,L]),ct._focusEventsAllowed=!1;break}}focus(){if(!bt(this,X))return;const[L,ct]=bt(this,X);ul(this,X,null),ct.addEventListener("focusin",()=>{L._focusEventsAllowed=!0},{once:!0}),ct.focus()}addEditListeners(){nl(this,Yl,Re).call(this),nl(this,yl,Se).call(this)}removeEditListeners(){nl(this,pl,ae).call(this),nl(this,_t,we).call(this)}copy(L){var Wt;if(L.preventDefault(),(Wt=bt(this,dt))==null||Wt.commitOrRemove(),!this.hasSelection)return;const ct=[];for(const Yt of bt(this,H)){const kt=Yt.serialize(!0);kt&&ct.push(kt)}ct.length!==0&&L.clipboardData.setData("application/pdfjs",JSON.stringify(ct))}cut(L){this.copy(L),this.delete()}paste(L){L.preventDefault();const{clipboardData:ct}=L;for(const kt of ct.items)for(const Et of bt(this,Vt))if(Et.isHandlingMimeForPasting(kt.type)){Et.paste(kt,this.currentLayer);return}let Wt=ct.getData("application/pdfjs");if(!Wt)return;try{Wt=JSON.parse(Wt)}catch(kt){(0,M.warn)(`paste: "${kt.message}".`);return}if(!Array.isArray(Wt))return;this.unselectAll();const Yt=this.currentLayer;try{const kt=[];for(const ml of Wt){const al=Yt.deserialize(ml);if(!al)return;kt.push(al)}const Et=()=>{for(const ml of kt)nl(this,el,xe).call(this,ml);nl(this,hl,ke).call(this,kt)},sl=()=>{for(const ml of kt)ml.remove()};this.addCommands({cmd:Et,undo:sl,mustExec:!0})}catch(kt){(0,M.warn)(`paste: "${kt.message}".`)}}keydown(L){var ct;(ct=this.getActive())!=null&&ct.shouldGetKeyboardEvents()||Wl._keyboardManager.exec(this,L)}onEditingAction(L){["undo","redo","delete","selectAll"].includes(L.name)&&this[L.name]()}setEditingState(L){L?(nl(this,Ct,Zs).call(this),nl(this,Yl,Re).call(this),nl(this,yl,Se).call(this),nl(this,ut,Jl).call(this,{isEditing:bt(this,C)!==M.AnnotationEditorType.NONE,isEmpty:nl(this,Qt,ql).call(this),hasSomethingToUndo:bt(this,zt).hasSomethingToUndo(),hasSomethingToRedo:bt(this,zt).hasSomethingToRedo(),hasSelectedEditor:!1})):(nl(this,dl,ze).call(this),nl(this,pl,ae).call(this),nl(this,_t,we).call(this),nl(this,ut,Jl).call(this,{isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(L){if(!bt(this,Vt)){ul(this,Vt,L);for(const ct of bt(this,Vt))nl(this,jt,_l).call(this,ct.defaultPropertiesToUpdate)}}getId(){return bt(this,at).getId()}get currentLayer(){return bt(this,xt).get(bt(this,Gt))}getLayer(L){return bt(this,xt).get(L)}get currentPageIndex(){return bt(this,Gt)}addLayer(L){bt(this,xt).set(L.pageIndex,L),bt(this,R)?L.enable():L.disable()}removeLayer(L){bt(this,xt).delete(L.pageIndex)}updateMode(L,ct=null){if(bt(this,C)!==L){if(ul(this,C,L),L===M.AnnotationEditorType.NONE){this.setEditingState(!1),nl(this,Kt,bs).call(this);return}this.setEditingState(!0),nl(this,Lt,hs).call(this),this.unselectAll();for(const Wt of bt(this,xt).values())Wt.updateMode(L);if(ct){for(const Wt of bt(this,It).values())if(Wt.annotationElementId===ct){this.setSelected(Wt),Wt.enterInEditMode();break}}}}updateToolbar(L){L!==bt(this,C)&&this._eventBus.dispatch("switchannotationeditormode",{source:this,mode:L})}updateParams(L,ct){if(bt(this,Vt)){if(L===M.AnnotationEditorParamsType.CREATE){this.currentLayer.addNewEditor(L);return}for(const Wt of bt(this,H))Wt.updateParams(L,ct);for(const Wt of bt(this,Vt))Wt.updateDefaultParams(L,ct)}}enableWaiting(L=!1){if(bt(this,w)!==L){ul(this,w,L);for(const ct of bt(this,xt).values())L?ct.disableClick():ct.enableClick(),ct.div.classList.toggle("waiting",L)}}getEditors(L){const ct=[];for(const Wt of bt(this,It).values())Wt.pageIndex===L&&ct.push(Wt);return ct}getEditor(L){return bt(this,It).get(L)}addEditor(L){bt(this,It).set(L.id,L)}removeEditor(L){var ct;bt(this,It).delete(L.id),this.unselect(L),(!L.annotationElementId||!bt(this,Nt).has(L.annotationElementId))&&((ct=bt(this,Xt))==null||ct.remove(L.id))}addDeletedAnnotationElement(L){bt(this,Nt).add(L.annotationElementId),L.deleted=!0}isDeletedAnnotationElement(L){return bt(this,Nt).has(L)}removeDeletedAnnotationElement(L){bt(this,Nt).delete(L.annotationElementId),L.deleted=!1}setActiveEditor(L){bt(this,dt)!==L&&(ul(this,dt,L),L&&nl(this,jt,_l).call(this,L.propertiesToUpdate))}toggleSelected(L){if(bt(this,H).has(L)){bt(this,H).delete(L),L.unselect(),nl(this,ut,Jl).call(this,{hasSelectedEditor:this.hasSelection});return}bt(this,H).add(L),L.select(),nl(this,jt,_l).call(this,L.propertiesToUpdate),nl(this,ut,Jl).call(this,{hasSelectedEditor:!0})}setSelected(L){for(const ct of bt(this,H))ct!==L&&ct.unselect();bt(this,H).clear(),bt(this,H).add(L),L.select(),nl(this,jt,_l).call(this,L.propertiesToUpdate),nl(this,ut,Jl).call(this,{hasSelectedEditor:!0})}isSelected(L){return bt(this,H).has(L)}unselect(L){L.unselect(),bt(this,H).delete(L),nl(this,ut,Jl).call(this,{hasSelectedEditor:this.hasSelection})}get hasSelection(){return bt(this,H).size!==0}undo(){bt(this,zt).undo(),nl(this,ut,Jl).call(this,{hasSomethingToUndo:bt(this,zt).hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:nl(this,Qt,ql).call(this)})}redo(){bt(this,zt).redo(),nl(this,ut,Jl).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:bt(this,zt).hasSomethingToRedo(),isEmpty:nl(this,Qt,ql).call(this)})}addCommands(L){bt(this,zt).add(L),nl(this,ut,Jl).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:nl(this,Qt,ql).call(this)})}delete(){if(this.commitOrRemove(),!this.hasSelection)return;const L=[...bt(this,H)],ct=()=>{for(const Yt of L)Yt.remove()},Wt=()=>{for(const Yt of L)nl(this,el,xe).call(this,Yt)};this.addCommands({cmd:ct,undo:Wt,mustExec:!0})}commitOrRemove(){var L;(L=bt(this,dt))==null||L.commitOrRemove()}hasSomethingToControl(){return bt(this,dt)||this.hasSelection}selectAll(){for(const L of bt(this,H))L.commit();nl(this,hl,ke).call(this,bt(this,It).values())}unselectAll(){if(bt(this,dt)){bt(this,dt).commitOrRemove();return}if(this.hasSelection){for(const L of bt(this,H))L.unselect();bt(this,H).clear(),nl(this,ut,Jl).call(this,{hasSelectedEditor:!1})}}translateSelectedEditors(L,ct,Wt=!1){if(Wt||this.commitOrRemove(),!this.hasSelection)return;bt(this,Bt)[0]+=L,bt(this,Bt)[1]+=ct;const[Yt,kt]=bt(this,Bt),Et=[...bt(this,H)],sl=1e3;bt(this,Ft)&&clearTimeout(bt(this,Ft)),ul(this,Ft,setTimeout(()=>{ul(this,Ft,null),bt(this,Bt)[0]=bt(this,Bt)[1]=0,this.addCommands({cmd:()=>{for(const ml of Et)bt(this,It).has(ml.id)&&ml.translateInPage(Yt,kt)},undo:()=>{for(const ml of Et)bt(this,It).has(ml.id)&&ml.translateInPage(-Yt,-kt)},mustExec:!1})},sl));for(const ml of Et)ml.translateInPage(L,ct)}setUpDragSession(){if(this.hasSelection){this.disableUserSelect(!0),ul(this,Ut,new Map);for(const L of bt(this,H))bt(this,Ut).set(L,{savedX:L.x,savedY:L.y,savedPageIndex:L.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!bt(this,Ut))return!1;this.disableUserSelect(!1);const L=bt(this,Ut);ul(this,Ut,null);let ct=!1;for(const[{x:Yt,y:kt,pageIndex:Et},sl]of L)sl.newX=Yt,sl.newY=kt,sl.newPageIndex=Et,ct||(ct=Yt!==sl.savedX||kt!==sl.savedY||Et!==sl.savedPageIndex);if(!ct)return!1;const Wt=(Yt,kt,Et,sl)=>{if(bt(this,It).has(Yt.id)){const ml=bt(this,xt).get(sl);ml?Yt._setParentAndPosition(ml,kt,Et):(Yt.pageIndex=sl,Yt.x=kt,Yt.y=Et)}};return this.addCommands({cmd:()=>{for(const[Yt,{newX:kt,newY:Et,newPageIndex:sl}]of L)Wt(Yt,kt,Et,sl)},undo:()=>{for(const[Yt,{savedX:kt,savedY:Et,savedPageIndex:sl}]of L)Wt(Yt,kt,Et,sl)},mustExec:!0}),!0}dragSelectedEditors(L,ct){if(bt(this,Ut))for(const Wt of bt(this,Ut).keys())Wt.drag(L,ct)}rebuild(L){if(L.parent===null){const ct=this.getLayer(L.pageIndex);ct?(ct.changeParent(L),ct.addOrRebuild(L)):(this.addEditor(L),this.addToAnnotationStorage(L),L.rebuild())}else L.parent.addOrRebuild(L)}isActive(L){return bt(this,dt)===L}getActive(){return bt(this,dt)}getMode(){return bt(this,C)}get imageManager(){return(0,M.shadow)(this,"imageManager",new O)}};dt=new WeakMap,It=new WeakMap,xt=new WeakMap,it=new WeakMap,Xt=new WeakMap,zt=new WeakMap,Gt=new WeakMap,Nt=new WeakMap,Ut=new WeakMap,Vt=new WeakMap,Ht=new WeakMap,Pt=new WeakMap,at=new WeakMap,R=new WeakMap,w=new WeakMap,X=new WeakMap,C=new WeakMap,H=new WeakMap,st=new WeakMap,et=new WeakMap,Mt=new WeakMap,Rt=new WeakMap,gt=new WeakMap,Jt=new WeakMap,Dt=new WeakMap,qt=new WeakMap,vt=new WeakMap,cl=new WeakMap,bl=new WeakMap,il=new WeakMap,Bt=new WeakMap,Ft=new WeakMap,wt=new WeakMap,pt=new WeakMap,Ct=new WeakSet,Zs=function(){window.addEventListener("focus",bt(this,Mt)),window.addEventListener("blur",bt(this,et))},dl=new WeakSet,ze=function(){window.removeEventListener("focus",bt(this,Mt)),window.removeEventListener("blur",bt(this,et))},Yl=new WeakSet,Re=function(){window.addEventListener("keydown",bt(this,Dt),{capture:!0})},pl=new WeakSet,ae=function(){window.removeEventListener("keydown",bt(this,Dt),{capture:!0})},yl=new WeakSet,Se=function(){document.addEventListener("copy",bt(this,Rt)),document.addEventListener("cut",bt(this,gt)),document.addEventListener("paste",bt(this,Jt))},_t=new WeakSet,we=function(){document.removeEventListener("copy",bt(this,Rt)),document.removeEventListener("cut",bt(this,gt)),document.removeEventListener("paste",bt(this,Jt))},ut=new WeakSet,Jl=function(L){Object.entries(L).some(([Wt,Yt])=>bt(this,il)[Wt]!==Yt)&&this._eventBus.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(bt(this,il),L)})},jt=new WeakSet,_l=function(L){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:L})},Lt=new WeakSet,hs=function(){if(!bt(this,R)){ul(this,R,!0);for(const L of bt(this,xt).values())L.enable()}},Kt=new WeakSet,bs=function(){if(this.unselectAll(),bt(this,R)){ul(this,R,!1);for(const L of bt(this,xt).values())L.disable()}},el=new WeakSet,xe=function(L){const ct=bt(this,xt).get(L.pageIndex);ct?ct.addOrRebuild(L):this.addEditor(L)},Qt=new WeakSet,ql=function(){if(bt(this,It).size===0)return!0;if(bt(this,It).size===1)for(const L of bt(this,It).values())return L.isEmpty();return!1},hl=new WeakSet,ke=function(L){bt(this,H).clear();for(const ct of L)ct.isEmpty()||(bt(this,H).add(ct),ct.select());nl(this,ut,Jl).call(this,{hasSelectedEditor:!0})},gl(Wl,"TRANSLATE_SMALL",1),gl(Wl,"TRANSLATE_BIG",10);let K=Wl;r.AnnotationEditorUIManager=K},(lt,r,h)=>{var Gt,Nt,Ut,Vt,Ht,Pt,at,R,w,X,C,H,Pl,et,Hl,Rt,ge,Jt,ne,qt,Ze,cl,$l,il,te;Object.defineProperty(r,"__esModule",{value:!0}),r.StatTimer=r.RenderingCancelledException=r.PixelsPerInch=r.PageViewport=r.PDFDateString=r.DOMStandardFontDataFactory=r.DOMSVGFactory=r.DOMFilterFactory=r.DOMCanvasFactory=r.DOMCMapReaderFactory=void 0,r.deprecated=_,r.getColorValues=It,r.getCurrentTransform=xt,r.getCurrentTransformInverse=it,r.getFilenameFromUrl=g,r.getPdfFilenameFromUrl=F,r.getRGB=dt,r.getXfaPageViewport=Zt,r.isDataScheme=k,r.isPdfFile=T,r.isValidFetchUrl=v,r.loadScript=m,r.noContextMenu=u,r.setLayerDimensions=Xt;var M=h(7),p=h(1);const B="http://www.w3.org/2000/svg",zt=class zt{};gl(zt,"CSS",96),gl(zt,"PDF",72),gl(zt,"PDF_TO_CSS_UNITS",zt.CSS/zt.PDF);let Q=zt;r.PixelsPerInch=Q;class U extends M.BaseFilterFactory{constructor({docId:pt,ownerDocument:Ct=globalThis.document}={}){super();ll(this,H);ll(this,et);ll(this,Rt);ll(this,Jt);ll(this,qt);ll(this,cl);ll(this,il);ll(this,Gt,void 0);ll(this,Nt,void 0);ll(this,Ut,void 0);ll(this,Vt,void 0);ll(this,Ht,void 0);ll(this,Pt,void 0);ll(this,at,void 0);ll(this,R,void 0);ll(this,w,void 0);ll(this,X,void 0);ll(this,C,0);ul(this,Ut,pt),ul(this,Vt,Ct)}addFilter(pt){if(!pt)return"none";let Ct=bt(this,H,Pl).get(pt);if(Ct)return Ct;let $t,dl,rl,Yl;if(pt.length===1){const yl=pt[0],Vl=new Array(256);for(let _t=0;_t<256;_t++)Vl[_t]=yl[_t]/255;Yl=$t=dl=rl=Vl.join(",")}else{const[yl,Vl,_t]=pt,ot=new Array(256),ut=new Array(256),Tt=new Array(256);for(let jt=0;jt<256;jt++)ot[jt]=yl[jt]/255,ut[jt]=Vl[jt]/255,Tt[jt]=_t[jt]/255;$t=ot.join(","),dl=ut.join(","),rl=Tt.join(","),Yl=`${$t}${dl}${rl}`}if(Ct=bt(this,H,Pl).get(Yl),Ct)return bt(this,H,Pl).set(pt,Ct),Ct;const Xl=`g_${bt(this,Ut)}_transfer_map_${Al(this,C)._++}`,pl=`url(#${Xl})`;bt(this,H,Pl).set(pt,pl),bt(this,H,Pl).set(Yl,pl);const Ll=nl(this,Jt,ne).call(this,Xl);return nl(this,cl,$l).call(this,$t,dl,rl,Ll),pl}addHCMFilter(pt,Ct){var Vl;const $t=`${pt}-${Ct}`;if(bt(this,Pt)===$t)return bt(this,at);if(ul(this,Pt,$t),ul(this,at,"none"),(Vl=bt(this,Ht))==null||Vl.remove(),!pt||!Ct)return bt(this,at);const dl=nl(this,il,te).call(this,pt);pt=p.Util.makeHexColor(...dl);const rl=nl(this,il,te).call(this,Ct);if(Ct=p.Util.makeHexColor(...rl),bt(this,et,Hl).style.color="",pt==="#000000"&&Ct==="#ffffff"||pt===Ct)return bt(this,at);const Yl=new Array(256);for(let _t=0;_t<=255;_t++){const ot=_t/255;Yl[_t]=ot<=.03928?ot/12.92:((ot+.055)/1.055)**2.4}const Xl=Yl.join(","),pl=`g_${bt(this,Ut)}_hcm_filter`,Ll=ul(this,R,nl(this,Jt,ne).call(this,pl));nl(this,cl,$l).call(this,Xl,Xl,Xl,Ll),nl(this,Rt,ge).call(this,Ll);const yl=(_t,ot)=>{const ut=dl[_t]/255,Tt=rl[_t]/255,jt=new Array(ot+1);for(let Ot=0;Ot<=ot;Ot++)jt[Ot]=ut+Ot/ot*(Tt-ut);return jt.join(",")};return nl(this,cl,$l).call(this,yl(0,5),yl(1,5),yl(2,5),Ll),ul(this,at,`url(#${pl})`),bt(this,at)}addHighlightHCMFilter(pt,Ct,$t,dl){var Tt;const rl=`${pt}-${Ct}-${$t}-${dl}`;if(bt(this,w)===rl)return bt(this,X);if(ul(this,w,rl),ul(this,X,"none"),(Tt=bt(this,R))==null||Tt.remove(),!pt||!Ct)return bt(this,X);const[Yl,Xl]=[pt,Ct].map(nl(this,il,te).bind(this));let pl=Math.round(.2126*Yl[0]+.7152*Yl[1]+.0722*Yl[2]),Ll=Math.round(.2126*Xl[0]+.7152*Xl[1]+.0722*Xl[2]),[yl,Vl]=[$t,dl].map(nl(this,il,te).bind(this));Ll<pl&&([pl,Ll,yl,Vl]=[Ll,pl,Vl,yl]),bt(this,et,Hl).style.color="";const _t=(jt,Ot,Lt)=>{const yt=new Array(256),Kt=(Ll-pl)/Lt,tl=jt/255,el=(Ot-jt)/(255*Lt);let ol=0;for(let Qt=0;Qt<=Lt;Qt++){const Ml=Math.round(pl+Qt*Kt),hl=tl+Qt*el;for(let Il=ol;Il<=Ml;Il++)yt[Il]=hl;ol=Ml+1}for(let Qt=ol;Qt<256;Qt++)yt[Qt]=yt[ol-1];return yt.join(",")},ot=`g_${bt(this,Ut)}_hcm_highlight_filter`,ut=ul(this,R,nl(this,Jt,ne).call(this,ot));return nl(this,Rt,ge).call(this,ut),nl(this,cl,$l).call(this,_t(yl[0],Vl[0],5),_t(yl[1],Vl[1],5),_t(yl[2],Vl[2],5),ut),ul(this,X,`url(#${ot})`),bt(this,X)}destroy(pt=!1){pt&&(bt(this,at)||bt(this,X))||(bt(this,Nt)&&(bt(this,Nt).parentNode.parentNode.remove(),ul(this,Nt,null)),bt(this,Gt)&&(bt(this,Gt).clear(),ul(this,Gt,null)),ul(this,C,0))}}Gt=new WeakMap,Nt=new WeakMap,Ut=new WeakMap,Vt=new WeakMap,Ht=new WeakMap,Pt=new WeakMap,at=new WeakMap,R=new WeakMap,w=new WeakMap,X=new WeakMap,C=new WeakMap,H=new WeakSet,Pl=function(){return bt(this,Gt)||ul(this,Gt,new Map)},et=new WeakSet,Hl=function(){if(!bt(this,Nt)){const pt=bt(this,Vt).createElement("div"),{style:Ct}=pt;Ct.visibility="hidden",Ct.contain="strict",Ct.width=Ct.height=0,Ct.position="absolute",Ct.top=Ct.left=0,Ct.zIndex=-1;const $t=bt(this,Vt).createElementNS(B,"svg");$t.setAttribute("width",0),$t.setAttribute("height",0),ul(this,Nt,bt(this,Vt).createElementNS(B,"defs")),pt.append($t),$t.append(bt(this,Nt)),bt(this,Vt).body.append(pt)}return bt(this,Nt)},Rt=new WeakSet,ge=function(pt){const Ct=bt(this,Vt).createElementNS(B,"feColorMatrix");Ct.setAttribute("type","matrix"),Ct.setAttribute("values","0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0 0 0 1 0"),pt.append(Ct)},Jt=new WeakSet,ne=function(pt){const Ct=bt(this,Vt).createElementNS(B,"filter");return Ct.setAttribute("color-interpolation-filters","sRGB"),Ct.setAttribute("id",pt),bt(this,et,Hl).append(Ct),Ct},qt=new WeakSet,Ze=function(pt,Ct,$t){const dl=bt(this,Vt).createElementNS(B,Ct);dl.setAttribute("type","discrete"),dl.setAttribute("tableValues",$t),pt.append(dl)},cl=new WeakSet,$l=function(pt,Ct,$t,dl){const rl=bt(this,Vt).createElementNS(B,"feComponentTransfer");dl.append(rl),nl(this,qt,Ze).call(this,rl,"feFuncR",pt),nl(this,qt,Ze).call(this,rl,"feFuncG",Ct),nl(this,qt,Ze).call(this,rl,"feFuncB",$t)},il=new WeakSet,te=function(pt){return bt(this,et,Hl).style.color=pt,dt(getComputedStyle(bt(this,et,Hl)).getPropertyValue("color"))},r.DOMFilterFactory=U;class O extends M.BaseCanvasFactory{constructor({ownerDocument:wt=globalThis.document}={}){super(),this._document=wt}_createCanvas(wt,pt){const Ct=this._document.createElement("canvas");return Ct.width=wt,Ct.height=pt,Ct}}r.DOMCanvasFactory=O;async function I(Ft,wt=!1){if(v(Ft,document.baseURI)){const pt=await fetch(Ft);if(!pt.ok)throw new Error(pt.statusText);return wt?new Uint8Array(await pt.arrayBuffer()):(0,p.stringToBytes)(await pt.text())}return new Promise((pt,Ct)=>{const $t=new XMLHttpRequest;$t.open("GET",Ft,!0),wt&&($t.responseType="arraybuffer"),$t.onreadystatechange=()=>{if($t.readyState===XMLHttpRequest.DONE){if($t.status===200||$t.status===0){let dl;if(wt&&$t.response?dl=new Uint8Array($t.response):!wt&&$t.responseText&&(dl=(0,p.stringToBytes)($t.responseText)),dl){pt(dl);return}}Ct(new Error($t.statusText))}},$t.send(null)})}class j extends M.BaseCMapReaderFactory{_fetchData(wt,pt){return I(wt,this.isCompressed).then(Ct=>({cMapData:Ct,compressionType:pt}))}}r.DOMCMapReaderFactory=j;class q extends M.BaseStandardFontDataFactory{_fetchData(wt){return I(wt,!0)}}r.DOMStandardFontDataFactory=q;class K extends M.BaseSVGFactory{_createSVG(wt){return document.createElementNS(B,wt)}}r.DOMSVGFactory=K;class f{constructor({viewBox:wt,scale:pt,rotation:Ct,offsetX:$t=0,offsetY:dl=0,dontFlip:rl=!1}){this.viewBox=wt,this.scale=pt,this.rotation=Ct,this.offsetX=$t,this.offsetY=dl;const Yl=(wt[2]+wt[0])/2,Xl=(wt[3]+wt[1])/2;let pl,Ll,yl,Vl;switch(Ct%=360,Ct<0&&(Ct+=360),Ct){case 180:pl=-1,Ll=0,yl=0,Vl=1;break;case 90:pl=0,Ll=1,yl=1,Vl=0;break;case 270:pl=0,Ll=-1,yl=-1,Vl=0;break;case 0:pl=1,Ll=0,yl=0,Vl=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}rl&&(yl=-yl,Vl=-Vl);let _t,ot,ut,Tt;pl===0?(_t=Math.abs(Xl-wt[1])*pt+$t,ot=Math.abs(Yl-wt[0])*pt+dl,ut=(wt[3]-wt[1])*pt,Tt=(wt[2]-wt[0])*pt):(_t=Math.abs(Yl-wt[0])*pt+$t,ot=Math.abs(Xl-wt[1])*pt+dl,ut=(wt[2]-wt[0])*pt,Tt=(wt[3]-wt[1])*pt),this.transform=[pl*pt,Ll*pt,yl*pt,Vl*pt,_t-pl*pt*Yl-yl*pt*Xl,ot-Ll*pt*Yl-Vl*pt*Xl],this.width=ut,this.height=Tt}get rawDims(){const{viewBox:wt}=this;return(0,p.shadow)(this,"rawDims",{pageWidth:wt[2]-wt[0],pageHeight:wt[3]-wt[1],pageX:wt[0],pageY:wt[1]})}clone({scale:wt=this.scale,rotation:pt=this.rotation,offsetX:Ct=this.offsetX,offsetY:$t=this.offsetY,dontFlip:dl=!1}={}){return new f({viewBox:this.viewBox.slice(),scale:wt,rotation:pt,offsetX:Ct,offsetY:$t,dontFlip:dl})}convertToViewportPoint(wt,pt){return p.Util.applyTransform([wt,pt],this.transform)}convertToViewportRectangle(wt){const pt=p.Util.applyTransform([wt[0],wt[1]],this.transform),Ct=p.Util.applyTransform([wt[2],wt[3]],this.transform);return[pt[0],pt[1],Ct[0],Ct[1]]}convertToPdfPoint(wt,pt){return p.Util.applyInverseTransform([wt,pt],this.transform)}}r.PageViewport=f;class S extends p.BaseException{constructor(wt,pt=0){super(wt,"RenderingCancelledException"),this.extraDelay=pt}}r.RenderingCancelledException=S;function k(Ft){const wt=Ft.length;let pt=0;for(;pt<wt&&Ft[pt].trim()==="";)pt++;return Ft.substring(pt,pt+5).toLowerCase()==="data:"}function T(Ft){return typeof Ft=="string"&&/\.pdf$/i.test(Ft)}function g(Ft,wt=!1){return wt||([Ft]=Ft.split(/[#?]/,1)),Ft.substring(Ft.lastIndexOf("/")+1)}function F(Ft,wt="document.pdf"){if(typeof Ft!="string")return wt;if(k(Ft))return(0,p.warn)('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),wt;const pt=/^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/,Ct=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i,$t=pt.exec(Ft);let dl=Ct.exec($t[1])||Ct.exec($t[2])||Ct.exec($t[3]);if(dl&&(dl=dl[0],dl.includes("%")))try{dl=Ct.exec(decodeURIComponent(dl))[0]}catch{}return dl||wt}class J{constructor(){gl(this,"started",Object.create(null));gl(this,"times",[])}time(wt){wt in this.started&&(0,p.warn)(`Timer is already running for ${wt}`),this.started[wt]=Date.now()}timeEnd(wt){wt in this.started||(0,p.warn)(`Timer has not been started for ${wt}`),this.times.push({name:wt,start:this.started[wt],end:Date.now()}),delete this.started[wt]}toString(){const wt=[];let pt=0;for(const{name:Ct}of this.times)pt=Math.max(Ct.length,pt);for(const{name:Ct,start:$t,end:dl}of this.times)wt.push(`${Ct.padEnd(pt)} ${dl-$t}ms
|
|
1
|
+
var Ks=Object.defineProperty;var vs=(lt,r,h)=>r in lt?Ks(lt,r,{enumerable:!0,configurable:!0,writable:!0,value:h}):lt[r]=h;var gl=(lt,r,h)=>(vs(lt,typeof r!="symbol"?r+"":r,h),h),Xe=(lt,r,h)=>{if(!r.has(lt))throw TypeError("Cannot "+h)};var bt=(lt,r,h)=>(Xe(lt,r,"read from private field"),h?h.call(lt):r.get(lt)),ll=(lt,r,h)=>{if(r.has(lt))throw TypeError("Cannot add the same private member more than once");r instanceof WeakSet?r.add(lt):r.set(lt,h)},ul=(lt,r,h,M)=>(Xe(lt,r,"write to private field"),M?M.call(lt,h):r.set(lt,h),h);var Al=(lt,r,h,M)=>({set _(p){ul(lt,r,p,h)},get _(){return bt(lt,r,M)}}),nl=(lt,r,h)=>(Xe(lt,r,"access private method"),h);import{s as shallowRef,w as watchEffect,dw as toValue,o as onBeforeUnmount,e as defineComponent,r as ref,au as toRef,h as computed,a as watch,R as openBlock,ay as createElementBlock,al as Fragment,az as renderList,aK as renderSlot,aD as createBaseVNode,aB as createCommentVNode,bk as normalizeStyle,_ as _export_sfc,ax as mapGetters,M as mapState,N as mapActions,Q as resolveComponent,O as createBlock,ab as normalizeClass}from"./admin-drawer-panel-B4-04ET4.js";import{g as getAugmentedNamespace$1}from"./main-BJxn-WA7.js";import{u as useReaderStore}from"./VToolbar-CLYsoOKq.js";import"./index-DUjeNg4x.js";import"./confirm-footer-oTUv06_v.js";import"./change-password-dialog-DAvSz_BT.js";import"./VSlideGroup-IIebYuJm.js";import"./VSelectionControl-BoyRbIct.js";function commonjsRequire$1(lt){throw new Error('Could not dynamically require "'+lt+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var pdf$1={exports:{}};const __viteBrowserExternal$2={},__viteBrowserExternal$3=Object.freeze(Object.defineProperty({__proto__:null,default:__viteBrowserExternal$2},Symbol.toStringTag,{value:"Module"})),require$$5=getAugmentedNamespace$1(__viteBrowserExternal$3);(function(module,exports){(function(r,h){module.exports=r.pdfjsLib=h()})(globalThis,()=>(()=>{var __webpack_modules__=[,(lt,r)=>{var Vl;Object.defineProperty(r,"__esModule",{value:!0}),r.VerbosityLevel=r.Util=r.UnknownErrorException=r.UnexpectedResponseException=r.TextRenderingMode=r.RenderingIntentFlag=r.PromiseCapability=r.PermissionFlag=r.PasswordResponses=r.PasswordException=r.PageActionEventType=r.OPS=r.MissingPDFException=r.MAX_IMAGE_SIZE_TO_CACHE=r.LINE_FACTOR=r.LINE_DESCENT_FACTOR=r.InvalidPDFException=r.ImageKind=r.IDENTITY_MATRIX=r.FormatError=r.FeatureTest=r.FONT_IDENTITY_MATRIX=r.DocumentActionEventType=r.CMapCompressionType=r.BaseException=r.BASELINE_FACTOR=r.AnnotationType=r.AnnotationReplyType=r.AnnotationPrefix=r.AnnotationMode=r.AnnotationFlag=r.AnnotationFieldFlag=r.AnnotationEditorType=r.AnnotationEditorPrefix=r.AnnotationEditorParamsType=r.AnnotationBorderStyleType=r.AnnotationActionEventType=r.AbortException=void 0,r.assert=Ut,r.bytesToString=Mt,r.createValidAbsoluteUrl=Ht,r.getModificationDate=dl,r.getUuid=Ll,r.getVerbosityLevel=Xt,r.info=zt,r.isArrayBuffer=Ct,r.isArrayEqual=$t,r.isNodeJS=void 0,r.normalizeUnicode=pl,r.objectFromMap=Dt,r.objectSize=Jt,r.setVerbosityLevel=it,r.shadow=Pt,r.string32=gt,r.stringToBytes=Rt,r.stringToPDFString=Ft,r.stringToUTF8String=wt,r.unreachable=Nt,r.utf8StringToString=pt,r.warn=Gt;const h=typeof process=="object"&&process+""=="[object process]"&&!process.versions.nw&&!(process.versions.electron&&process.type&&process.type!=="browser");r.isNodeJS=h;const M=[1,0,0,1,0,0];r.IDENTITY_MATRIX=M;const p=[.001,0,0,.001,0,0];r.FONT_IDENTITY_MATRIX=p;const B=1e7;r.MAX_IMAGE_SIZE_TO_CACHE=B;const Q=1.35;r.LINE_FACTOR=Q;const U=.35;r.LINE_DESCENT_FACTOR=U;const O=U/Q;r.BASELINE_FACTOR=O;const I={ANY:1,DISPLAY:2,PRINT:4,SAVE:8,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,OPLIST:256};r.RenderingIntentFlag=I;const j={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3};r.AnnotationMode=j;const q="pdfjs_internal_editor_";r.AnnotationEditorPrefix=q;const K={DISABLE:-1,NONE:0,FREETEXT:3,STAMP:13,INK:15};r.AnnotationEditorType=K;const f={RESIZE:1,CREATE:2,FREETEXT_SIZE:11,FREETEXT_COLOR:12,FREETEXT_OPACITY:13,INK_COLOR:21,INK_THICKNESS:22,INK_OPACITY:23};r.AnnotationEditorParamsType=f;const S={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048};r.PermissionFlag=S;const k={FILL:0,STROKE:1,FILL_STROKE:2,INVISIBLE:3,FILL_ADD_TO_PATH:4,STROKE_ADD_TO_PATH:5,FILL_STROKE_ADD_TO_PATH:6,ADD_TO_PATH:7,FILL_STROKE_MASK:3,ADD_TO_PATH_FLAG:4};r.TextRenderingMode=k;const T={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3};r.ImageKind=T;const g={TEXT:1,LINK:2,FREETEXT:3,LINE:4,SQUARE:5,CIRCLE:6,POLYGON:7,POLYLINE:8,HIGHLIGHT:9,UNDERLINE:10,SQUIGGLY:11,STRIKEOUT:12,STAMP:13,CARET:14,INK:15,POPUP:16,FILEATTACHMENT:17,SOUND:18,MOVIE:19,WIDGET:20,SCREEN:21,PRINTERMARK:22,TRAPNET:23,WATERMARK:24,THREED:25,REDACT:26};r.AnnotationType=g;const F={GROUP:"Group",REPLY:"R"};r.AnnotationReplyType=F;const J={INVISIBLE:1,HIDDEN:2,PRINT:4,NOZOOM:8,NOROTATE:16,NOVIEW:32,READONLY:64,LOCKED:128,TOGGLENOVIEW:256,LOCKEDCONTENTS:512};r.AnnotationFlag=J;const v={READONLY:1,REQUIRED:2,NOEXPORT:4,MULTILINE:4096,PASSWORD:8192,NOTOGGLETOOFF:16384,RADIO:32768,PUSHBUTTON:65536,COMBO:131072,EDIT:262144,SORT:524288,FILESELECT:1048576,MULTISELECT:2097152,DONOTSPELLCHECK:4194304,DONOTSCROLL:8388608,COMB:16777216,RICHTEXT:33554432,RADIOSINUNISON:33554432,COMMITONSELCHANGE:67108864};r.AnnotationFieldFlag=v;const u={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5};r.AnnotationBorderStyleType=u;const m={E:"Mouse Enter",X:"Mouse Exit",D:"Mouse Down",U:"Mouse Up",Fo:"Focus",Bl:"Blur",PO:"PageOpen",PC:"PageClose",PV:"PageVisible",PI:"PageInvisible",K:"Keystroke",F:"Format",V:"Validate",C:"Calculate"};r.AnnotationActionEventType=m;const _={WC:"WillClose",WS:"WillSave",DS:"DidSave",WP:"WillPrint",DP:"DidPrint"};r.DocumentActionEventType=_;const $={O:"PageOpen",C:"PageClose"};r.PageActionEventType=$;const P={ERRORS:0,WARNINGS:1,INFOS:5};r.VerbosityLevel=P;const Zt={NONE:0,BINARY:1};r.CMapCompressionType=Zt;const dt={dependency:1,setLineWidth:2,setLineCap:3,setLineJoin:4,setMiterLimit:5,setDash:6,setRenderingIntent:7,setFlatness:8,setGState:9,save:10,restore:11,transform:12,moveTo:13,lineTo:14,curveTo:15,curveTo2:16,curveTo3:17,closePath:18,rectangle:19,stroke:20,closeStroke:21,fill:22,eoFill:23,fillStroke:24,eoFillStroke:25,closeFillStroke:26,closeEOFillStroke:27,endPath:28,clip:29,eoClip:30,beginText:31,endText:32,setCharSpacing:33,setWordSpacing:34,setHScale:35,setLeading:36,setFont:37,setTextRenderingMode:38,setTextRise:39,moveText:40,setLeadingMoveText:41,setTextMatrix:42,nextLine:43,showText:44,showSpacedText:45,nextLineShowText:46,nextLineSetSpacingShowText:47,setCharWidth:48,setCharWidthAndBounds:49,setStrokeColorSpace:50,setFillColorSpace:51,setStrokeColor:52,setStrokeColorN:53,setFillColor:54,setFillColorN:55,setStrokeGray:56,setFillGray:57,setStrokeRGBColor:58,setFillRGBColor:59,setStrokeCMYKColor:60,setFillCMYKColor:61,shadingFill:62,beginInlineImage:63,beginImageData:64,endInlineImage:65,paintXObject:66,markPoint:67,markPointProps:68,beginMarkedContent:69,beginMarkedContentProps:70,endMarkedContent:71,beginCompat:72,endCompat:73,paintFormXObjectBegin:74,paintFormXObjectEnd:75,beginGroup:76,endGroup:77,beginAnnotation:80,endAnnotation:81,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,paintSolidColorImageMask:90,constructPath:91};r.OPS=dt;const It={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};r.PasswordResponses=It;let xt=P.WARNINGS;function it(_t){Number.isInteger(_t)&&(xt=_t)}function Xt(){return xt}function zt(_t){xt>=P.INFOS&&console.log(`Info: ${_t}`)}function Gt(_t){xt>=P.WARNINGS&&console.log(`Warning: ${_t}`)}function Nt(_t){throw new Error(_t)}function Ut(_t,ot){_t||Nt(ot)}function Vt(_t){switch(_t==null?void 0:_t.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}function Ht(_t,ot=null,ut=null){if(!_t)return null;try{if(ut&&typeof _t=="string"){if(ut.addDefaultProtocol&&_t.startsWith("www.")){const jt=_t.match(/\./g);(jt==null?void 0:jt.length)>=2&&(_t=`http://${_t}`)}if(ut.tryConvertEncoding)try{_t=wt(_t)}catch{}}const Tt=ot?new URL(_t,ot):new URL(_t);if(Vt(Tt))return Tt}catch{}return null}function Pt(_t,ot,ut,Tt=!1){return Object.defineProperty(_t,ot,{value:ut,enumerable:!Tt,configurable:!0,writable:!1}),ut}const at=function(){function ot(ut,Tt){this.constructor===ot&&Nt("Cannot initialize BaseException."),this.message=ut,this.name=Tt}return ot.prototype=new Error,ot.constructor=ot,ot}();r.BaseException=at;class R extends at{constructor(ot,ut){super(ot,"PasswordException"),this.code=ut}}r.PasswordException=R;class w extends at{constructor(ot,ut){super(ot,"UnknownErrorException"),this.details=ut}}r.UnknownErrorException=w;class X extends at{constructor(ot){super(ot,"InvalidPDFException")}}r.InvalidPDFException=X;class C extends at{constructor(ot){super(ot,"MissingPDFException")}}r.MissingPDFException=C;class H extends at{constructor(ot,ut){super(ot,"UnexpectedResponseException"),this.status=ut}}r.UnexpectedResponseException=H;class st extends at{constructor(ot){super(ot,"FormatError")}}r.FormatError=st;class et extends at{constructor(ot){super(ot,"AbortException")}}r.AbortException=et;function Mt(_t){(typeof _t!="object"||(_t==null?void 0:_t.length)===void 0)&&Nt("Invalid argument for bytesToString");const ot=_t.length,ut=8192;if(ot<ut)return String.fromCharCode.apply(null,_t);const Tt=[];for(let jt=0;jt<ot;jt+=ut){const Ot=Math.min(jt+ut,ot),Lt=_t.subarray(jt,Ot);Tt.push(String.fromCharCode.apply(null,Lt))}return Tt.join("")}function Rt(_t){typeof _t!="string"&&Nt("Invalid argument for stringToBytes");const ot=_t.length,ut=new Uint8Array(ot);for(let Tt=0;Tt<ot;++Tt)ut[Tt]=_t.charCodeAt(Tt)&255;return ut}function gt(_t){return String.fromCharCode(_t>>24&255,_t>>16&255,_t>>8&255,_t&255)}function Jt(_t){return Object.keys(_t).length}function Dt(_t){const ot=Object.create(null);for(const[ut,Tt]of _t)ot[ut]=Tt;return ot}function qt(){const _t=new Uint8Array(4);return _t[0]=1,new Uint32Array(_t.buffer,0,1)[0]===1}function vt(){try{return new Function(""),!0}catch{return!1}}class cl{static get isLittleEndian(){return Pt(this,"isLittleEndian",qt())}static get isEvalSupported(){return Pt(this,"isEvalSupported",vt())}static get isOffscreenCanvasSupported(){return Pt(this,"isOffscreenCanvasSupported",typeof OffscreenCanvas<"u")}static get platform(){return typeof navigator>"u"?Pt(this,"platform",{isWin:!1,isMac:!1}):Pt(this,"platform",{isWin:navigator.platform.includes("Win"),isMac:navigator.platform.includes("Mac")})}static get isCSSRoundSupported(){var ot,ut;return Pt(this,"isCSSRoundSupported",(ut=(ot=globalThis.CSS)==null?void 0:ot.supports)==null?void 0:ut.call(ot,"width: round(1.5px, 1px)"))}}r.FeatureTest=cl;const bl=[...Array(256).keys()].map(_t=>_t.toString(16).padStart(2,"0"));class il{static makeHexColor(ot,ut,Tt){return`#${bl[ot]}${bl[ut]}${bl[Tt]}`}static scaleMinMax(ot,ut){let Tt;ot[0]?(ot[0]<0&&(Tt=ut[0],ut[0]=ut[1],ut[1]=Tt),ut[0]*=ot[0],ut[1]*=ot[0],ot[3]<0&&(Tt=ut[2],ut[2]=ut[3],ut[3]=Tt),ut[2]*=ot[3],ut[3]*=ot[3]):(Tt=ut[0],ut[0]=ut[2],ut[2]=Tt,Tt=ut[1],ut[1]=ut[3],ut[3]=Tt,ot[1]<0&&(Tt=ut[2],ut[2]=ut[3],ut[3]=Tt),ut[2]*=ot[1],ut[3]*=ot[1],ot[2]<0&&(Tt=ut[0],ut[0]=ut[1],ut[1]=Tt),ut[0]*=ot[2],ut[1]*=ot[2]),ut[0]+=ot[4],ut[1]+=ot[4],ut[2]+=ot[5],ut[3]+=ot[5]}static transform(ot,ut){return[ot[0]*ut[0]+ot[2]*ut[1],ot[1]*ut[0]+ot[3]*ut[1],ot[0]*ut[2]+ot[2]*ut[3],ot[1]*ut[2]+ot[3]*ut[3],ot[0]*ut[4]+ot[2]*ut[5]+ot[4],ot[1]*ut[4]+ot[3]*ut[5]+ot[5]]}static applyTransform(ot,ut){const Tt=ot[0]*ut[0]+ot[1]*ut[2]+ut[4],jt=ot[0]*ut[1]+ot[1]*ut[3]+ut[5];return[Tt,jt]}static applyInverseTransform(ot,ut){const Tt=ut[0]*ut[3]-ut[1]*ut[2],jt=(ot[0]*ut[3]-ot[1]*ut[2]+ut[2]*ut[5]-ut[4]*ut[3])/Tt,Ot=(-ot[0]*ut[1]+ot[1]*ut[0]+ut[4]*ut[1]-ut[5]*ut[0])/Tt;return[jt,Ot]}static getAxialAlignedBoundingBox(ot,ut){const Tt=this.applyTransform(ot,ut),jt=this.applyTransform(ot.slice(2,4),ut),Ot=this.applyTransform([ot[0],ot[3]],ut),Lt=this.applyTransform([ot[2],ot[1]],ut);return[Math.min(Tt[0],jt[0],Ot[0],Lt[0]),Math.min(Tt[1],jt[1],Ot[1],Lt[1]),Math.max(Tt[0],jt[0],Ot[0],Lt[0]),Math.max(Tt[1],jt[1],Ot[1],Lt[1])]}static inverseTransform(ot){const ut=ot[0]*ot[3]-ot[1]*ot[2];return[ot[3]/ut,-ot[1]/ut,-ot[2]/ut,ot[0]/ut,(ot[2]*ot[5]-ot[4]*ot[3])/ut,(ot[4]*ot[1]-ot[5]*ot[0])/ut]}static singularValueDecompose2dScale(ot){const ut=[ot[0],ot[2],ot[1],ot[3]],Tt=ot[0]*ut[0]+ot[1]*ut[2],jt=ot[0]*ut[1]+ot[1]*ut[3],Ot=ot[2]*ut[0]+ot[3]*ut[2],Lt=ot[2]*ut[1]+ot[3]*ut[3],yt=(Tt+Lt)/2,Kt=Math.sqrt((Tt+Lt)**2-4*(Tt*Lt-Ot*jt))/2,tl=yt+Kt||1,el=yt-Kt||1;return[Math.sqrt(tl),Math.sqrt(el)]}static normalizeRect(ot){const ut=ot.slice(0);return ot[0]>ot[2]&&(ut[0]=ot[2],ut[2]=ot[0]),ot[1]>ot[3]&&(ut[1]=ot[3],ut[3]=ot[1]),ut}static intersect(ot,ut){const Tt=Math.max(Math.min(ot[0],ot[2]),Math.min(ut[0],ut[2])),jt=Math.min(Math.max(ot[0],ot[2]),Math.max(ut[0],ut[2]));if(Tt>jt)return null;const Ot=Math.max(Math.min(ot[1],ot[3]),Math.min(ut[1],ut[3])),Lt=Math.min(Math.max(ot[1],ot[3]),Math.max(ut[1],ut[3]));return Ot>Lt?null:[Tt,Ot,jt,Lt]}static bezierBoundingBox(ot,ut,Tt,jt,Ot,Lt,yt,Kt){const tl=[],el=[[],[]];let ol,Qt,Ml,hl,Il,Wl,nt,L;for(let kt=0;kt<2;++kt){if(kt===0?(Qt=6*ot-12*Tt+6*Ot,ol=-3*ot+9*Tt-9*Ot+3*yt,Ml=3*Tt-3*ot):(Qt=6*ut-12*jt+6*Lt,ol=-3*ut+9*jt-9*Lt+3*Kt,Ml=3*jt-3*ut),Math.abs(ol)<1e-12){if(Math.abs(Qt)<1e-12)continue;hl=-Ml/Qt,0<hl&&hl<1&&tl.push(hl);continue}nt=Qt*Qt-4*Ml*ol,L=Math.sqrt(nt),!(nt<0)&&(Il=(-Qt+L)/(2*ol),0<Il&&Il<1&&tl.push(Il),Wl=(-Qt-L)/(2*ol),0<Wl&&Wl<1&&tl.push(Wl))}let ct=tl.length,Wt;const Yt=ct;for(;ct--;)hl=tl[ct],Wt=1-hl,el[0][ct]=Wt*Wt*Wt*ot+3*Wt*Wt*hl*Tt+3*Wt*hl*hl*Ot+hl*hl*hl*yt,el[1][ct]=Wt*Wt*Wt*ut+3*Wt*Wt*hl*jt+3*Wt*hl*hl*Lt+hl*hl*hl*Kt;return el[0][Yt]=ot,el[1][Yt]=ut,el[0][Yt+1]=yt,el[1][Yt+1]=Kt,el[0].length=el[1].length=Yt+2,[Math.min(...el[0]),Math.min(...el[1]),Math.max(...el[0]),Math.max(...el[1])]}}r.Util=il;const Bt=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,728,711,710,729,733,731,730,732,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8226,8224,8225,8230,8212,8211,402,8260,8249,8250,8722,8240,8222,8220,8221,8216,8217,8218,8482,64257,64258,321,338,352,376,381,305,322,339,353,382,0,8364];function Ft(_t){if(_t[0]>="ï"){let ut;if(_t[0]==="þ"&&_t[1]==="ÿ"?ut="utf-16be":_t[0]==="ÿ"&&_t[1]==="þ"?ut="utf-16le":_t[0]==="ï"&&_t[1]==="»"&&_t[2]==="¿"&&(ut="utf-8"),ut)try{const Tt=new TextDecoder(ut,{fatal:!0}),jt=Rt(_t);return Tt.decode(jt)}catch(Tt){Gt(`stringToPDFString: "${Tt}".`)}}const ot=[];for(let ut=0,Tt=_t.length;ut<Tt;ut++){const jt=Bt[_t.charCodeAt(ut)];ot.push(jt?String.fromCharCode(jt):_t.charAt(ut))}return ot.join("")}function wt(_t){return decodeURIComponent(escape(_t))}function pt(_t){return unescape(encodeURIComponent(_t))}function Ct(_t){return typeof _t=="object"&&(_t==null?void 0:_t.byteLength)!==void 0}function $t(_t,ot){if(_t.length!==ot.length)return!1;for(let ut=0,Tt=_t.length;ut<Tt;ut++)if(_t[ut]!==ot[ut])return!1;return!0}function dl(_t=new Date){return[_t.getUTCFullYear().toString(),(_t.getUTCMonth()+1).toString().padStart(2,"0"),_t.getUTCDate().toString().padStart(2,"0"),_t.getUTCHours().toString().padStart(2,"0"),_t.getUTCMinutes().toString().padStart(2,"0"),_t.getUTCSeconds().toString().padStart(2,"0")].join("")}class rl{constructor(){ll(this,Vl,!1);this.promise=new Promise((ot,ut)=>{this.resolve=Tt=>{ul(this,Vl,!0),ot(Tt)},this.reject=Tt=>{ul(this,Vl,!0),ut(Tt)}})}get settled(){return bt(this,Vl)}}Vl=new WeakMap,r.PromiseCapability=rl;let Yl=null,Xl=null;function pl(_t){return Yl||(Yl=/([\u00a0\u00b5\u037e\u0eb3\u2000-\u200a\u202f\u2126\ufb00-\ufb04\ufb06\ufb20-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufba1\ufba4-\ufba9\ufbae-\ufbb1\ufbd3-\ufbdc\ufbde-\ufbe7\ufbea-\ufbf8\ufbfc-\ufbfd\ufc00-\ufc5d\ufc64-\ufcf1\ufcf5-\ufd3d\ufd88\ufdf4\ufdfa-\ufdfb\ufe71\ufe77\ufe79\ufe7b\ufe7d]+)|(\ufb05+)/gu,Xl=new Map([["ſt","ſt"]])),_t.replaceAll(Yl,(ot,ut,Tt)=>ut?ut.normalize("NFKC"):Xl.get(Tt))}function Ll(){if(typeof crypto<"u"&&typeof(crypto==null?void 0:crypto.randomUUID)=="function")return crypto.randomUUID();const _t=new Uint8Array(32);if(typeof crypto<"u"&&typeof(crypto==null?void 0:crypto.getRandomValues)=="function")crypto.getRandomValues(_t);else for(let ot=0;ot<32;ot++)_t[ot]=Math.floor(Math.random()*255);return Mt(_t)}const yl="pdfjs_internal_id_";r.AnnotationPrefix=yl},(__unused_webpack_module,exports,__w_pdfjs_require__)=>{var lt,h,M,p,vl,Q,ce,O,I,j,q,K,f,S,k,T,de,F,J,Ye,u,m;Object.defineProperty(exports,"__esModule",{value:!0}),exports.RenderTask=exports.PDFWorkerUtil=exports.PDFWorker=exports.PDFPageProxy=exports.PDFDocumentProxy=exports.PDFDocumentLoadingTask=exports.PDFDataRangeTransport=exports.LoopbackPort=exports.DefaultStandardFontDataFactory=exports.DefaultFilterFactory=exports.DefaultCanvasFactory=exports.DefaultCMapReaderFactory=void 0,Object.defineProperty(exports,"SVGGraphics",{enumerable:!0,get:function(){return _displaySvg.SVGGraphics}}),exports.build=void 0,exports.getDocument=getDocument,exports.version=void 0;var _util=__w_pdfjs_require__(1),_annotation_storage=__w_pdfjs_require__(3),_display_utils=__w_pdfjs_require__(6),_font_loader=__w_pdfjs_require__(9),_displayNode_utils=__w_pdfjs_require__(10),_canvas=__w_pdfjs_require__(11),_worker_options=__w_pdfjs_require__(14),_message_handler=__w_pdfjs_require__(15),_metadata=__w_pdfjs_require__(16),_optional_content_config=__w_pdfjs_require__(17),_transport_stream=__w_pdfjs_require__(18),_displayFetch_stream=__w_pdfjs_require__(19),_displayNetwork=__w_pdfjs_require__(22),_displayNode_stream=__w_pdfjs_require__(23),_displaySvg=__w_pdfjs_require__(24),_xfa_text=__w_pdfjs_require__(25);const DEFAULT_RANGE_CHUNK_SIZE=65536,RENDERING_CANCELLED_TIMEOUT=100,DELAYED_CLEANUP_TIMEOUT=5e3,DefaultCanvasFactory=_util.isNodeJS?_displayNode_utils.NodeCanvasFactory:_display_utils.DOMCanvasFactory;exports.DefaultCanvasFactory=DefaultCanvasFactory;const DefaultCMapReaderFactory=_util.isNodeJS?_displayNode_utils.NodeCMapReaderFactory:_display_utils.DOMCMapReaderFactory;exports.DefaultCMapReaderFactory=DefaultCMapReaderFactory;const DefaultFilterFactory=_util.isNodeJS?_displayNode_utils.NodeFilterFactory:_display_utils.DOMFilterFactory;exports.DefaultFilterFactory=DefaultFilterFactory;const DefaultStandardFontDataFactory=_util.isNodeJS?_displayNode_utils.NodeStandardFontDataFactory:_display_utils.DOMStandardFontDataFactory;exports.DefaultStandardFontDataFactory=DefaultStandardFontDataFactory;function getDocument($){if(typeof $=="string"||$ instanceof URL?$={url:$}:(0,_util.isArrayBuffer)($)&&($={data:$}),typeof $!="object")throw new Error("Invalid parameter in getDocument, need parameter object.");if(!$.url&&!$.data&&!$.range)throw new Error("Invalid parameter object: need either .data, .range or .url");const P=new PDFDocumentLoadingTask,{docId:Zt}=P,dt=$.url?getUrlProp($.url):null,It=$.data?getDataProp($.data):null,xt=$.httpHeaders||null,it=$.withCredentials===!0,Xt=$.password??null,zt=$.range instanceof PDFDataRangeTransport?$.range:null,Gt=Number.isInteger($.rangeChunkSize)&&$.rangeChunkSize>0?$.rangeChunkSize:DEFAULT_RANGE_CHUNK_SIZE;let Nt=$.worker instanceof PDFWorker?$.worker:null;const Ut=$.verbosity,Vt=typeof $.docBaseUrl=="string"&&!(0,_display_utils.isDataScheme)($.docBaseUrl)?$.docBaseUrl:null,Ht=typeof $.cMapUrl=="string"?$.cMapUrl:null,Pt=$.cMapPacked!==!1,at=$.CMapReaderFactory||DefaultCMapReaderFactory,R=typeof $.standardFontDataUrl=="string"?$.standardFontDataUrl:null,w=$.StandardFontDataFactory||DefaultStandardFontDataFactory,X=$.stopAtErrors!==!0,C=Number.isInteger($.maxImageSize)&&$.maxImageSize>-1?$.maxImageSize:-1,H=$.isEvalSupported!==!1,st=typeof $.isOffscreenCanvasSupported=="boolean"?$.isOffscreenCanvasSupported:!_util.isNodeJS,et=Number.isInteger($.canvasMaxAreaInBytes)?$.canvasMaxAreaInBytes:-1,Mt=typeof $.disableFontFace=="boolean"?$.disableFontFace:_util.isNodeJS,Rt=$.fontExtraProperties===!0,gt=$.enableXfa===!0,Jt=$.ownerDocument||globalThis.document,Dt=$.disableRange===!0,qt=$.disableStream===!0,vt=$.disableAutoFetch===!0,cl=$.pdfBug===!0,bl=zt?zt.length:$.length??NaN,il=typeof $.useSystemFonts=="boolean"?$.useSystemFonts:!_util.isNodeJS&&!Mt,Bt=typeof $.useWorkerFetch=="boolean"?$.useWorkerFetch:at===_display_utils.DOMCMapReaderFactory&&w===_display_utils.DOMStandardFontDataFactory&&Ht&&R&&(0,_display_utils.isValidFetchUrl)(Ht,document.baseURI)&&(0,_display_utils.isValidFetchUrl)(R,document.baseURI),Ft=$.canvasFactory||new DefaultCanvasFactory({ownerDocument:Jt}),wt=$.filterFactory||new DefaultFilterFactory({docId:Zt,ownerDocument:Jt}),pt=null;(0,_util.setVerbosityLevel)(Ut);const Ct={canvasFactory:Ft,filterFactory:wt};if(Bt||(Ct.cMapReaderFactory=new at({baseUrl:Ht,isCompressed:Pt}),Ct.standardFontDataFactory=new w({baseUrl:R})),!Nt){const rl={verbosity:Ut,port:_worker_options.GlobalWorkerOptions.workerPort};Nt=rl.port?PDFWorker.fromPort(rl):new PDFWorker(rl),P._worker=Nt}const $t={docId:Zt,apiVersion:"3.11.174",data:It,password:Xt,disableAutoFetch:vt,rangeChunkSize:Gt,length:bl,docBaseUrl:Vt,enableXfa:gt,evaluatorOptions:{maxImageSize:C,disableFontFace:Mt,ignoreErrors:X,isEvalSupported:H,isOffscreenCanvasSupported:st,canvasMaxAreaInBytes:et,fontExtraProperties:Rt,useSystemFonts:il,cMapUrl:Bt?Ht:null,standardFontDataUrl:Bt?R:null}},dl={ignoreErrors:X,isEvalSupported:H,disableFontFace:Mt,fontExtraProperties:Rt,enableXfa:gt,ownerDocument:Jt,disableAutoFetch:vt,pdfBug:cl,styleElement:pt};return Nt.promise.then(function(){if(P.destroyed)throw new Error("Loading aborted");const rl=_fetchDocument(Nt,$t),Yl=new Promise(function(Xl){let pl;zt?pl=new _transport_stream.PDFDataTransportStream({length:bl,initialData:zt.initialData,progressiveDone:zt.progressiveDone,contentDispositionFilename:zt.contentDispositionFilename,disableRange:Dt,disableStream:qt},zt):It||(pl=(yl=>_util.isNodeJS?new _displayNode_stream.PDFNodeStream(yl):(0,_display_utils.isValidFetchUrl)(yl.url)?new _displayFetch_stream.PDFFetchStream(yl):new _displayNetwork.PDFNetworkStream(yl))({url:dt,length:bl,httpHeaders:xt,withCredentials:it,rangeChunkSize:Gt,disableRange:Dt,disableStream:qt})),Xl(pl)});return Promise.all([rl,Yl]).then(function([Xl,pl]){if(P.destroyed)throw new Error("Loading aborted");const Ll=new _message_handler.MessageHandler(Zt,Xl,Nt.port),yl=new WorkerTransport(Ll,P,pl,dl,Ct);P._transport=yl,Ll.send("Ready",null)})}).catch(P._capability.reject),P}async function _fetchDocument($,P){if($.destroyed)throw new Error("Worker was destroyed");const Zt=await $.messageHandler.sendWithPromise("GetDocRequest",P,P.data?[P.data.buffer]:null);if($.destroyed)throw new Error("Worker was destroyed");return Zt}function getUrlProp($){if($ instanceof URL)return $.href;try{return new URL($,window.location).href}catch{if(_util.isNodeJS&&typeof $=="string")return $}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}function getDataProp($){if(_util.isNodeJS&&typeof Buffer<"u"&&$ instanceof Buffer)throw new Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");if($ instanceof Uint8Array&&$.byteLength===$.buffer.byteLength)return $;if(typeof $=="string")return(0,_util.stringToBytes)($);if(typeof $=="object"&&!isNaN($==null?void 0:$.length)||(0,_util.isArrayBuffer)($))return new Uint8Array($);throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")}const r=class r{constructor(){this._capability=new _util.PromiseCapability,this._transport=null,this._worker=null,this.docId=`d${Al(r,lt)._++}`,this.destroyed=!1,this.onPassword=null,this.onProgress=null}get promise(){return this._capability.promise}async destroy(){var P,Zt,dt;this.destroyed=!0;try{(P=this._worker)!=null&&P.port&&(this._worker._pendingDestroy=!0),await((Zt=this._transport)==null?void 0:Zt.destroy())}catch(It){throw(dt=this._worker)!=null&&dt.port&&delete this._worker._pendingDestroy,It}this._transport=null,this._worker&&(this._worker.destroy(),this._worker=null)}};lt=new WeakMap,ll(r,lt,0);let PDFDocumentLoadingTask=r;exports.PDFDocumentLoadingTask=PDFDocumentLoadingTask;class PDFDataRangeTransport{constructor(P,Zt,dt=!1,It=null){this.length=P,this.initialData=Zt,this.progressiveDone=dt,this.contentDispositionFilename=It,this._rangeListeners=[],this._progressListeners=[],this._progressiveReadListeners=[],this._progressiveDoneListeners=[],this._readyCapability=new _util.PromiseCapability}addRangeListener(P){this._rangeListeners.push(P)}addProgressListener(P){this._progressListeners.push(P)}addProgressiveReadListener(P){this._progressiveReadListeners.push(P)}addProgressiveDoneListener(P){this._progressiveDoneListeners.push(P)}onDataRange(P,Zt){for(const dt of this._rangeListeners)dt(P,Zt)}onDataProgress(P,Zt){this._readyCapability.promise.then(()=>{for(const dt of this._progressListeners)dt(P,Zt)})}onDataProgressiveRead(P){this._readyCapability.promise.then(()=>{for(const Zt of this._progressiveReadListeners)Zt(P)})}onDataProgressiveDone(){this._readyCapability.promise.then(()=>{for(const P of this._progressiveDoneListeners)P()})}transportReady(){this._readyCapability.resolve()}requestDataRange(P,Zt){(0,_util.unreachable)("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}}exports.PDFDataRangeTransport=PDFDataRangeTransport;class PDFDocumentProxy{constructor(P,Zt){this._pdfInfo=P,this._transport=Zt,Object.defineProperty(this,"getJavaScript",{value:()=>((0,_display_utils.deprecated)("`PDFDocumentProxy.getJavaScript`, please use `PDFDocumentProxy.getJSActions` instead."),this.getJSActions().then(dt=>{if(!dt)return dt;const It=[];for(const xt in dt)It.push(...dt[xt]);return It}))})}get annotationStorage(){return this._transport.annotationStorage}get filterFactory(){return this._transport.filterFactory}get numPages(){return this._pdfInfo.numPages}get fingerprints(){return this._pdfInfo.fingerprints}get isPureXfa(){return(0,_util.shadow)(this,"isPureXfa",!!this._transport._htmlForXfa)}get allXfaHtml(){return this._transport._htmlForXfa}getPage(P){return this._transport.getPage(P)}getPageIndex(P){return this._transport.getPageIndex(P)}getDestinations(){return this._transport.getDestinations()}getDestination(P){return this._transport.getDestination(P)}getPageLabels(){return this._transport.getPageLabels()}getPageLayout(){return this._transport.getPageLayout()}getPageMode(){return this._transport.getPageMode()}getViewerPreferences(){return this._transport.getViewerPreferences()}getOpenAction(){return this._transport.getOpenAction()}getAttachments(){return this._transport.getAttachments()}getJSActions(){return this._transport.getDocJSActions()}getOutline(){return this._transport.getOutline()}getOptionalContentConfig(){return this._transport.getOptionalContentConfig()}getPermissions(){return this._transport.getPermissions()}getMetadata(){return this._transport.getMetadata()}getMarkInfo(){return this._transport.getMarkInfo()}getData(){return this._transport.getData()}saveDocument(){return this._transport.saveDocument()}getDownloadInfo(){return this._transport.downloadInfoCapability.promise}cleanup(P=!1){return this._transport.startCleanup(P||this.isPureXfa)}destroy(){return this.loadingTask.destroy()}get loadingParams(){return this._transport.loadingParams}get loadingTask(){return this._transport.loadingTask}getFieldObjects(){return this._transport.getFieldObjects()}hasJSActions(){return this._transport.hasJSActions()}getCalculationOrderIds(){return this._transport.getCalculationOrderIds()}}exports.PDFDocumentProxy=PDFDocumentProxy;class PDFPageProxy{constructor(P,Zt,dt,It=!1){ll(this,p);ll(this,Q);ll(this,h,null);ll(this,M,!1);this._pageIndex=P,this._pageInfo=Zt,this._transport=dt,this._stats=It?new _display_utils.StatTimer:null,this._pdfBug=It,this.commonObjs=dt.commonObjs,this.objs=new PDFObjects,this._maybeCleanupAfterRender=!1,this._intentStates=new Map,this.destroyed=!1}get pageNumber(){return this._pageIndex+1}get rotate(){return this._pageInfo.rotate}get ref(){return this._pageInfo.ref}get userUnit(){return this._pageInfo.userUnit}get view(){return this._pageInfo.view}getViewport({scale:P,rotation:Zt=this.rotate,offsetX:dt=0,offsetY:It=0,dontFlip:xt=!1}={}){return new _display_utils.PageViewport({viewBox:this.view,scale:P,rotation:Zt,offsetX:dt,offsetY:It,dontFlip:xt})}getAnnotations({intent:P="display"}={}){const Zt=this._transport.getRenderingIntent(P);return this._transport.getAnnotations(this._pageIndex,Zt.renderingIntent)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get filterFactory(){return this._transport.filterFactory}get isPureXfa(){return(0,_util.shadow)(this,"isPureXfa",!!this._transport._htmlForXfa)}async getXfa(){var P;return((P=this._transport._htmlForXfa)==null?void 0:P.children[this._pageIndex])||null}render({canvasContext:P,viewport:Zt,intent:dt="display",annotationMode:It=_util.AnnotationMode.ENABLE,transform:xt=null,background:it=null,optionalContentConfigPromise:Xt=null,annotationCanvasMap:zt=null,pageColors:Gt=null,printAnnotationStorage:Nt=null}){var w,X;(w=this._stats)==null||w.time("Overall");const Ut=this._transport.getRenderingIntent(dt,It,Nt);ul(this,M,!1),nl(this,Q,ce).call(this),Xt||(Xt=this._transport.getOptionalContentConfig());let Vt=this._intentStates.get(Ut.cacheKey);Vt||(Vt=Object.create(null),this._intentStates.set(Ut.cacheKey,Vt)),Vt.streamReaderCancelTimeout&&(clearTimeout(Vt.streamReaderCancelTimeout),Vt.streamReaderCancelTimeout=null);const Ht=!!(Ut.renderingIntent&_util.RenderingIntentFlag.PRINT);Vt.displayReadyCapability||(Vt.displayReadyCapability=new _util.PromiseCapability,Vt.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},(X=this._stats)==null||X.time("Page Request"),this._pumpOperatorList(Ut));const Pt=C=>{var H,st;Vt.renderTasks.delete(at),(this._maybeCleanupAfterRender||Ht)&&ul(this,M,!0),nl(this,p,vl).call(this,!Ht),C?(at.capability.reject(C),this._abortOperatorList({intentState:Vt,reason:C instanceof Error?C:new Error(C)})):at.capability.resolve(),(H=this._stats)==null||H.timeEnd("Rendering"),(st=this._stats)==null||st.timeEnd("Overall")},at=new InternalRenderTask({callback:Pt,params:{canvasContext:P,viewport:Zt,transform:xt,background:it},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:zt,operatorList:Vt.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!Ht,pdfBug:this._pdfBug,pageColors:Gt});(Vt.renderTasks||(Vt.renderTasks=new Set)).add(at);const R=at.task;return Promise.all([Vt.displayReadyCapability.promise,Xt]).then(([C,H])=>{var st;if(this.destroyed){Pt();return}(st=this._stats)==null||st.time("Rendering"),at.initializeGraphics({transparency:C,optionalContentConfig:H}),at.operatorListChanged()}).catch(Pt),R}getOperatorList({intent:P="display",annotationMode:Zt=_util.AnnotationMode.ENABLE,printAnnotationStorage:dt=null}={}){var zt;function It(){it.operatorList.lastChunk&&(it.opListReadCapability.resolve(it.operatorList),it.renderTasks.delete(Xt))}const xt=this._transport.getRenderingIntent(P,Zt,dt,!0);let it=this._intentStates.get(xt.cacheKey);it||(it=Object.create(null),this._intentStates.set(xt.cacheKey,it));let Xt;return it.opListReadCapability||(Xt=Object.create(null),Xt.operatorListChanged=It,it.opListReadCapability=new _util.PromiseCapability,(it.renderTasks||(it.renderTasks=new Set)).add(Xt),it.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},(zt=this._stats)==null||zt.time("Page Request"),this._pumpOperatorList(xt)),it.opListReadCapability.promise}streamTextContent({includeMarkedContent:P=!1,disableNormalization:Zt=!1}={}){return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,includeMarkedContent:P===!0,disableNormalization:Zt===!0},{highWaterMark:100,size(It){return It.items.length}})}getTextContent(P={}){if(this._transport._htmlForXfa)return this.getXfa().then(dt=>_xfa_text.XfaText.textContent(dt));const Zt=this.streamTextContent(P);return new Promise(function(dt,It){function xt(){it.read().then(function({value:zt,done:Gt}){if(Gt){dt(Xt);return}Object.assign(Xt.styles,zt.styles),Xt.items.push(...zt.items),xt()},It)}const it=Zt.getReader(),Xt={items:[],styles:Object.create(null)};xt()})}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;const P=[];for(const Zt of this._intentStates.values())if(this._abortOperatorList({intentState:Zt,reason:new Error("Page was destroyed."),force:!0}),!Zt.opListReadCapability)for(const dt of Zt.renderTasks)P.push(dt.completed),dt.cancel();return this.objs.clear(),ul(this,M,!1),nl(this,Q,ce).call(this),Promise.all(P)}cleanup(P=!1){ul(this,M,!0);const Zt=nl(this,p,vl).call(this,!1);return P&&Zt&&this._stats&&(this._stats=new _display_utils.StatTimer),Zt}_startRenderPage(P,Zt){var It,xt;const dt=this._intentStates.get(Zt);dt&&((It=this._stats)==null||It.timeEnd("Page Request"),(xt=dt.displayReadyCapability)==null||xt.resolve(P))}_renderPageChunk(P,Zt){for(let dt=0,It=P.length;dt<It;dt++)Zt.operatorList.fnArray.push(P.fnArray[dt]),Zt.operatorList.argsArray.push(P.argsArray[dt]);Zt.operatorList.lastChunk=P.lastChunk,Zt.operatorList.separateAnnots=P.separateAnnots;for(const dt of Zt.renderTasks)dt.operatorListChanged();P.lastChunk&&nl(this,p,vl).call(this,!0)}_pumpOperatorList({renderingIntent:P,cacheKey:Zt,annotationStorageSerializable:dt}){const{map:It,transfers:xt}=dt,Xt=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:P,cacheKey:Zt,annotationStorage:It},xt).getReader(),zt=this._intentStates.get(Zt);zt.streamReader=Xt;const Gt=()=>{Xt.read().then(({value:Nt,done:Ut})=>{if(Ut){zt.streamReader=null;return}this._transport.destroyed||(this._renderPageChunk(Nt,zt),Gt())},Nt=>{if(zt.streamReader=null,!this._transport.destroyed){if(zt.operatorList){zt.operatorList.lastChunk=!0;for(const Ut of zt.renderTasks)Ut.operatorListChanged();nl(this,p,vl).call(this,!0)}if(zt.displayReadyCapability)zt.displayReadyCapability.reject(Nt);else if(zt.opListReadCapability)zt.opListReadCapability.reject(Nt);else throw Nt}})};Gt()}_abortOperatorList({intentState:P,reason:Zt,force:dt=!1}){if(P.streamReader){if(P.streamReaderCancelTimeout&&(clearTimeout(P.streamReaderCancelTimeout),P.streamReaderCancelTimeout=null),!dt){if(P.renderTasks.size>0)return;if(Zt instanceof _display_utils.RenderingCancelledException){let It=RENDERING_CANCELLED_TIMEOUT;Zt.extraDelay>0&&Zt.extraDelay<1e3&&(It+=Zt.extraDelay),P.streamReaderCancelTimeout=setTimeout(()=>{P.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:P,reason:Zt,force:!0})},It);return}}if(P.streamReader.cancel(new _util.AbortException(Zt.message)).catch(()=>{}),P.streamReader=null,!this._transport.destroyed){for(const[It,xt]of this._intentStates)if(xt===P){this._intentStates.delete(It);break}this.cleanup()}}}get stats(){return this._stats}}h=new WeakMap,M=new WeakMap,p=new WeakSet,vl=function(P=!1){if(nl(this,Q,ce).call(this),!bt(this,M)||this.destroyed)return!1;if(P)return ul(this,h,setTimeout(()=>{ul(this,h,null),nl(this,p,vl).call(this,!1)},DELAYED_CLEANUP_TIMEOUT)),!1;for(const{renderTasks:Zt,operatorList:dt}of this._intentStates.values())if(Zt.size>0||!dt.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),ul(this,M,!1),!0},Q=new WeakSet,ce=function(){bt(this,h)&&(clearTimeout(bt(this,h)),ul(this,h,null))},exports.PDFPageProxy=PDFPageProxy;class LoopbackPort{constructor(){ll(this,O,new Set);ll(this,I,Promise.resolve())}postMessage(P,Zt){const dt={data:structuredClone(P,Zt?{transfer:Zt}:null)};bt(this,I).then(()=>{for(const It of bt(this,O))It.call(this,dt)})}addEventListener(P,Zt){bt(this,O).add(Zt)}removeEventListener(P,Zt){bt(this,O).delete(Zt)}terminate(){bt(this,O).clear()}}O=new WeakMap,I=new WeakMap,exports.LoopbackPort=LoopbackPort;const PDFWorkerUtil={isWorkerDisabled:!1,fallbackWorkerSrc:null,fakeWorkerId:0};exports.PDFWorkerUtil=PDFWorkerUtil;{if(_util.isNodeJS&&typeof commonjsRequire$1=="function")PDFWorkerUtil.isWorkerDisabled=!0,PDFWorkerUtil.fallbackWorkerSrc="./pdf.worker.js";else if(typeof document=="object"){const $=(j=document==null?void 0:document.currentScript)==null?void 0:j.src;$&&(PDFWorkerUtil.fallbackWorkerSrc=$.replace(/(\.(?:min\.)?js)(\?.*)?$/i,".worker$1$2"))}PDFWorkerUtil.isSameOrigin=function($,P){let Zt;try{if(Zt=new URL($),!Zt.origin||Zt.origin==="null")return!1}catch{return!1}const dt=new URL(P,Zt);return Zt.origin===dt.origin},PDFWorkerUtil.createCDNWrapper=function($){const P=`importScripts("${$}");`;return URL.createObjectURL(new Blob([P]))}}const _PDFWorker=class _PDFWorker{constructor({name:$=null,port:P=null,verbosity:Zt=(0,_util.getVerbosityLevel)()}={}){var dt;if(this.name=$,this.destroyed=!1,this.verbosity=Zt,this._readyCapability=new _util.PromiseCapability,this._port=null,this._webWorker=null,this._messageHandler=null,P){if((dt=bt(_PDFWorker,q))!=null&&dt.has(P))throw new Error("Cannot use more than one PDFWorker per port.");(bt(_PDFWorker,q)||ul(_PDFWorker,q,new WeakMap)).set(P,this),this._initializeFromPort(P);return}this._initialize()}get promise(){return this._readyCapability.promise}get port(){return this._port}get messageHandler(){return this._messageHandler}_initializeFromPort($){this._port=$,this._messageHandler=new _message_handler.MessageHandler("main","worker",$),this._messageHandler.on("ready",function(){}),this._readyCapability.resolve(),this._messageHandler.send("configure",{verbosity:this.verbosity})}_initialize(){if(!PDFWorkerUtil.isWorkerDisabled&&!_PDFWorker._mainThreadWorkerMessageHandler){let{workerSrc:$}=_PDFWorker;try{PDFWorkerUtil.isSameOrigin(window.location.href,$)||($=PDFWorkerUtil.createCDNWrapper(new URL($,window.location).href));const P=new Worker($),Zt=new _message_handler.MessageHandler("main","worker",P),dt=()=>{P.removeEventListener("error",It),Zt.destroy(),P.terminate(),this.destroyed?this._readyCapability.reject(new Error("Worker was destroyed")):this._setupFakeWorker()},It=()=>{this._webWorker||dt()};P.addEventListener("error",It),Zt.on("test",it=>{if(P.removeEventListener("error",It),this.destroyed){dt();return}it?(this._messageHandler=Zt,this._port=P,this._webWorker=P,this._readyCapability.resolve(),Zt.send("configure",{verbosity:this.verbosity})):(this._setupFakeWorker(),Zt.destroy(),P.terminate())}),Zt.on("ready",it=>{if(P.removeEventListener("error",It),this.destroyed){dt();return}try{xt()}catch{this._setupFakeWorker()}});const xt=()=>{const it=new Uint8Array;Zt.send("test",it,[it.buffer])};xt();return}catch{(0,_util.info)("The worker has been disabled.")}}this._setupFakeWorker()}_setupFakeWorker(){PDFWorkerUtil.isWorkerDisabled||((0,_util.warn)("Setting up fake worker."),PDFWorkerUtil.isWorkerDisabled=!0),_PDFWorker._setupFakeWorkerGlobal.then($=>{if(this.destroyed){this._readyCapability.reject(new Error("Worker was destroyed"));return}const P=new LoopbackPort;this._port=P;const Zt=`fake${PDFWorkerUtil.fakeWorkerId++}`,dt=new _message_handler.MessageHandler(Zt+"_worker",Zt,P);$.setup(dt,P);const It=new _message_handler.MessageHandler(Zt,Zt+"_worker",P);this._messageHandler=It,this._readyCapability.resolve(),It.send("configure",{verbosity:this.verbosity})}).catch($=>{this._readyCapability.reject(new Error(`Setting up fake worker failed: "${$.message}".`))})}destroy(){var $;this.destroyed=!0,this._webWorker&&(this._webWorker.terminate(),this._webWorker=null),($=bt(_PDFWorker,q))==null||$.delete(this._port),this._port=null,this._messageHandler&&(this._messageHandler.destroy(),this._messageHandler=null)}static fromPort($){var Zt;if(!($!=null&&$.port))throw new Error("PDFWorker.fromPort - invalid method signature.");const P=(Zt=bt(this,q))==null?void 0:Zt.get($.port);if(P){if(P._pendingDestroy)throw new Error("PDFWorker.fromPort - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");return P}return new _PDFWorker($)}static get workerSrc(){if(_worker_options.GlobalWorkerOptions.workerSrc)return _worker_options.GlobalWorkerOptions.workerSrc;if(PDFWorkerUtil.fallbackWorkerSrc!==null)return _util.isNodeJS||(0,_display_utils.deprecated)('No "GlobalWorkerOptions.workerSrc" specified.'),PDFWorkerUtil.fallbackWorkerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get _mainThreadWorkerMessageHandler(){var $;try{return(($=globalThis.pdfjsWorker)==null?void 0:$.WorkerMessageHandler)||null}catch{return null}}static get _setupFakeWorkerGlobal(){const loader=async()=>{const mainWorkerMessageHandler=this._mainThreadWorkerMessageHandler;if(mainWorkerMessageHandler)return mainWorkerMessageHandler;if(_util.isNodeJS&&typeof commonjsRequire$1=="function"){const worker=eval("require")(this.workerSrc);return worker.WorkerMessageHandler}return await(0,_display_utils.loadScript)(this.workerSrc),window.pdfjsWorker.WorkerMessageHandler};return(0,_util.shadow)(this,"_setupFakeWorkerGlobal",loader())}};q=new WeakMap,ll(_PDFWorker,q,void 0);let PDFWorker=_PDFWorker;exports.PDFWorker=PDFWorker;class WorkerTransport{constructor(P,Zt,dt,It,xt){ll(this,T);ll(this,K,new Map);ll(this,f,new Map);ll(this,S,new Map);ll(this,k,null);this.messageHandler=P,this.loadingTask=Zt,this.commonObjs=new PDFObjects,this.fontLoader=new _font_loader.FontLoader({ownerDocument:It.ownerDocument,styleElement:It.styleElement}),this._params=It,this.canvasFactory=xt.canvasFactory,this.filterFactory=xt.filterFactory,this.cMapReaderFactory=xt.cMapReaderFactory,this.standardFontDataFactory=xt.standardFontDataFactory,this.destroyed=!1,this.destroyCapability=null,this._networkStream=dt,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=new _util.PromiseCapability,this.setupMessageHandler()}get annotationStorage(){return(0,_util.shadow)(this,"annotationStorage",new _annotation_storage.AnnotationStorage)}getRenderingIntent(P,Zt=_util.AnnotationMode.ENABLE,dt=null,It=!1){let xt=_util.RenderingIntentFlag.DISPLAY,it=_annotation_storage.SerializableEmpty;switch(P){case"any":xt=_util.RenderingIntentFlag.ANY;break;case"display":break;case"print":xt=_util.RenderingIntentFlag.PRINT;break;default:(0,_util.warn)(`getRenderingIntent - invalid intent: ${P}`)}switch(Zt){case _util.AnnotationMode.DISABLE:xt+=_util.RenderingIntentFlag.ANNOTATIONS_DISABLE;break;case _util.AnnotationMode.ENABLE:break;case _util.AnnotationMode.ENABLE_FORMS:xt+=_util.RenderingIntentFlag.ANNOTATIONS_FORMS;break;case _util.AnnotationMode.ENABLE_STORAGE:xt+=_util.RenderingIntentFlag.ANNOTATIONS_STORAGE,it=(xt&_util.RenderingIntentFlag.PRINT&&dt instanceof _annotation_storage.PrintAnnotationStorage?dt:this.annotationStorage).serializable;break;default:(0,_util.warn)(`getRenderingIntent - invalid annotationMode: ${Zt}`)}return It&&(xt+=_util.RenderingIntentFlag.OPLIST),{renderingIntent:xt,cacheKey:`${xt}_${it.hash}`,annotationStorageSerializable:it}}destroy(){var dt;if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=new _util.PromiseCapability,(dt=bt(this,k))==null||dt.reject(new Error("Worker was destroyed during onPassword callback"));const P=[];for(const It of bt(this,f).values())P.push(It._destroy());bt(this,f).clear(),bt(this,S).clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();const Zt=this.messageHandler.sendWithPromise("Terminate",null);return P.push(Zt),Promise.all(P).then(()=>{var It;this.commonObjs.clear(),this.fontLoader.clear(),bt(this,K).clear(),this.filterFactory.destroy(),(It=this._networkStream)==null||It.cancelAllRequests(new _util.AbortException("Worker was terminated.")),this.messageHandler&&(this.messageHandler.destroy(),this.messageHandler=null),this.destroyCapability.resolve()},this.destroyCapability.reject),this.destroyCapability.promise}setupMessageHandler(){const{messageHandler:P,loadingTask:Zt}=this;P.on("GetReader",(dt,It)=>{(0,_util.assert)(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=xt=>{this._lastProgress={loaded:xt.loaded,total:xt.total}},It.onPull=()=>{this._fullReader.read().then(function({value:xt,done:it}){if(it){It.close();return}(0,_util.assert)(xt instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),It.enqueue(new Uint8Array(xt),1,[xt])}).catch(xt=>{It.error(xt)})},It.onCancel=xt=>{this._fullReader.cancel(xt),It.ready.catch(it=>{if(!this.destroyed)throw it})}}),P.on("ReaderHeadersReady",dt=>{const It=new _util.PromiseCapability,xt=this._fullReader;return xt.headersReady.then(()=>{var it;(!xt.isStreamingSupported||!xt.isRangeSupported)&&(this._lastProgress&&((it=Zt.onProgress)==null||it.call(Zt,this._lastProgress)),xt.onProgress=Xt=>{var zt;(zt=Zt.onProgress)==null||zt.call(Zt,{loaded:Xt.loaded,total:Xt.total})}),It.resolve({isStreamingSupported:xt.isStreamingSupported,isRangeSupported:xt.isRangeSupported,contentLength:xt.contentLength})},It.reject),It.promise}),P.on("GetRangeReader",(dt,It)=>{(0,_util.assert)(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const xt=this._networkStream.getRangeReader(dt.begin,dt.end);if(!xt){It.close();return}It.onPull=()=>{xt.read().then(function({value:it,done:Xt}){if(Xt){It.close();return}(0,_util.assert)(it instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),It.enqueue(new Uint8Array(it),1,[it])}).catch(it=>{It.error(it)})},It.onCancel=it=>{xt.cancel(it),It.ready.catch(Xt=>{if(!this.destroyed)throw Xt})}}),P.on("GetDoc",({pdfInfo:dt})=>{this._numPages=dt.numPages,this._htmlForXfa=dt.htmlForXfa,delete dt.htmlForXfa,Zt._capability.resolve(new PDFDocumentProxy(dt,this))}),P.on("DocException",function(dt){let It;switch(dt.name){case"PasswordException":It=new _util.PasswordException(dt.message,dt.code);break;case"InvalidPDFException":It=new _util.InvalidPDFException(dt.message);break;case"MissingPDFException":It=new _util.MissingPDFException(dt.message);break;case"UnexpectedResponseException":It=new _util.UnexpectedResponseException(dt.message,dt.status);break;case"UnknownErrorException":It=new _util.UnknownErrorException(dt.message,dt.details);break;default:(0,_util.unreachable)("DocException - expected a valid Error.")}Zt._capability.reject(It)}),P.on("PasswordRequest",dt=>{if(ul(this,k,new _util.PromiseCapability),Zt.onPassword){const It=xt=>{xt instanceof Error?bt(this,k).reject(xt):bt(this,k).resolve({password:xt})};try{Zt.onPassword(It,dt.code)}catch(xt){bt(this,k).reject(xt)}}else bt(this,k).reject(new _util.PasswordException(dt.message,dt.code));return bt(this,k).promise}),P.on("DataLoaded",dt=>{var It;(It=Zt.onProgress)==null||It.call(Zt,{loaded:dt.length,total:dt.length}),this.downloadInfoCapability.resolve(dt)}),P.on("StartRenderPage",dt=>{if(this.destroyed)return;bt(this,f).get(dt.pageIndex)._startRenderPage(dt.transparency,dt.cacheKey)}),P.on("commonobj",([dt,It,xt])=>{var it;if(!this.destroyed&&!this.commonObjs.has(dt))switch(It){case"Font":const Xt=this._params;if("error"in xt){const Nt=xt.error;(0,_util.warn)(`Error during font loading: ${Nt}`),this.commonObjs.resolve(dt,Nt);break}const zt=Xt.pdfBug&&((it=globalThis.FontInspector)!=null&&it.enabled)?(Nt,Ut)=>globalThis.FontInspector.fontAdded(Nt,Ut):null,Gt=new _font_loader.FontFaceObject(xt,{isEvalSupported:Xt.isEvalSupported,disableFontFace:Xt.disableFontFace,ignoreErrors:Xt.ignoreErrors,inspectFont:zt});this.fontLoader.bind(Gt).catch(Nt=>P.sendWithPromise("FontFallback",{id:dt})).finally(()=>{!Xt.fontExtraProperties&&Gt.data&&(Gt.data=null),this.commonObjs.resolve(dt,Gt)});break;case"FontPath":case"Image":case"Pattern":this.commonObjs.resolve(dt,xt);break;default:throw new Error(`Got unknown common object type ${It}`)}}),P.on("obj",([dt,It,xt,it])=>{var zt;if(this.destroyed)return;const Xt=bt(this,f).get(It);if(!Xt.objs.has(dt))switch(xt){case"Image":if(Xt.objs.resolve(dt,it),it){let Gt;if(it.bitmap){const{width:Nt,height:Ut}=it;Gt=Nt*Ut*4}else Gt=((zt=it.data)==null?void 0:zt.length)||0;Gt>_util.MAX_IMAGE_SIZE_TO_CACHE&&(Xt._maybeCleanupAfterRender=!0)}break;case"Pattern":Xt.objs.resolve(dt,it);break;default:throw new Error(`Got unknown object type ${xt}`)}}),P.on("DocProgress",dt=>{var It;this.destroyed||(It=Zt.onProgress)==null||It.call(Zt,{loaded:dt.loaded,total:dt.total})}),P.on("FetchBuiltInCMap",dt=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.cMapReaderFactory?this.cMapReaderFactory.fetch(dt):Promise.reject(new Error("CMapReaderFactory not initialized, see the `useWorkerFetch` parameter."))),P.on("FetchStandardFontData",dt=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.standardFontDataFactory?this.standardFontDataFactory.fetch(dt):Promise.reject(new Error("StandardFontDataFactory not initialized, see the `useWorkerFetch` parameter.")))}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){var dt;this.annotationStorage.size<=0&&(0,_util.warn)("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");const{map:P,transfers:Zt}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:P,filename:((dt=this._fullReader)==null?void 0:dt.filename)??null},Zt).finally(()=>{this.annotationStorage.resetModified()})}getPage(P){if(!Number.isInteger(P)||P<=0||P>this._numPages)return Promise.reject(new Error("Invalid page request."));const Zt=P-1,dt=bt(this,S).get(Zt);if(dt)return dt;const It=this.messageHandler.sendWithPromise("GetPage",{pageIndex:Zt}).then(xt=>{if(this.destroyed)throw new Error("Transport destroyed");const it=new PDFPageProxy(Zt,xt,this,this._params.pdfBug);return bt(this,f).set(Zt,it),it});return bt(this,S).set(Zt,It),It}getPageIndex(P){return typeof P!="object"||P===null||!Number.isInteger(P.num)||P.num<0||!Number.isInteger(P.gen)||P.gen<0?Promise.reject(new Error("Invalid pageIndex request.")):this.messageHandler.sendWithPromise("GetPageIndex",{num:P.num,gen:P.gen})}getAnnotations(P,Zt){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:P,intent:Zt})}getFieldObjects(){return nl(this,T,de).call(this,"GetFieldObjects")}hasJSActions(){return nl(this,T,de).call(this,"HasJSActions")}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(P){return typeof P!="string"?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:P})}getPageLabels(){return this.messageHandler.sendWithPromise("GetPageLabels",null)}getPageLayout(){return this.messageHandler.sendWithPromise("GetPageLayout",null)}getPageMode(){return this.messageHandler.sendWithPromise("GetPageMode",null)}getViewerPreferences(){return this.messageHandler.sendWithPromise("GetViewerPreferences",null)}getOpenAction(){return this.messageHandler.sendWithPromise("GetOpenAction",null)}getAttachments(){return this.messageHandler.sendWithPromise("GetAttachments",null)}getDocJSActions(){return nl(this,T,de).call(this,"GetDocJSActions")}getPageJSActions(P){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:P})}getStructTree(P){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:P})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(){return this.messageHandler.sendWithPromise("GetOptionalContentConfig",null).then(P=>new _optional_content_config.OptionalContentConfig(P))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){const P="GetMetadata",Zt=bt(this,K).get(P);if(Zt)return Zt;const dt=this.messageHandler.sendWithPromise(P,null).then(It=>{var xt,it;return{info:It[0],metadata:It[1]?new _metadata.Metadata(It[1]):null,contentDispositionFilename:((xt=this._fullReader)==null?void 0:xt.filename)??null,contentLength:((it=this._fullReader)==null?void 0:it.contentLength)??null}});return bt(this,K).set(P,dt),dt}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(P=!1){if(!this.destroyed){await this.messageHandler.sendWithPromise("Cleanup",null);for(const Zt of bt(this,f).values())if(!Zt.cleanup())throw new Error(`startCleanup: Page ${Zt.pageNumber} is currently rendering.`);this.commonObjs.clear(),P||this.fontLoader.clear(),bt(this,K).clear(),this.filterFactory.destroy(!0)}}get loadingParams(){const{disableAutoFetch:P,enableXfa:Zt}=this._params;return(0,_util.shadow)(this,"loadingParams",{disableAutoFetch:P,enableXfa:Zt})}}K=new WeakMap,f=new WeakMap,S=new WeakMap,k=new WeakMap,T=new WeakSet,de=function(P,Zt=null){const dt=bt(this,K).get(P);if(dt)return dt;const It=this.messageHandler.sendWithPromise(P,Zt);return bt(this,K).set(P,It),It};class PDFObjects{constructor(){ll(this,J);ll(this,F,Object.create(null))}get(P,Zt=null){if(Zt){const It=nl(this,J,Ye).call(this,P);return It.capability.promise.then(()=>Zt(It.data)),null}const dt=bt(this,F)[P];if(!(dt!=null&&dt.capability.settled))throw new Error(`Requesting object that isn't resolved yet ${P}.`);return dt.data}has(P){const Zt=bt(this,F)[P];return(Zt==null?void 0:Zt.capability.settled)||!1}resolve(P,Zt=null){const dt=nl(this,J,Ye).call(this,P);dt.data=Zt,dt.capability.resolve()}clear(){var P;for(const Zt in bt(this,F)){const{data:dt}=bt(this,F)[Zt];(P=dt==null?void 0:dt.bitmap)==null||P.close()}ul(this,F,Object.create(null))}}F=new WeakMap,J=new WeakSet,Ye=function(P){var Zt;return(Zt=bt(this,F))[P]||(Zt[P]={capability:new _util.PromiseCapability,data:null})};class RenderTask{constructor(P){ll(this,u,null);ul(this,u,P),this.onContinue=null}get promise(){return bt(this,u).capability.promise}cancel(P=0){bt(this,u).cancel(null,P)}get separateAnnots(){const{separateAnnots:P}=bt(this,u).operatorList;if(!P)return!1;const{annotationCanvasMap:Zt}=bt(this,u);return P.form||P.canvas&&(Zt==null?void 0:Zt.size)>0}}u=new WeakMap,exports.RenderTask=RenderTask;const _=class _{constructor({callback:P,params:Zt,objs:dt,commonObjs:It,annotationCanvasMap:xt,operatorList:it,pageIndex:Xt,canvasFactory:zt,filterFactory:Gt,useRequestAnimationFrame:Nt=!1,pdfBug:Ut=!1,pageColors:Vt=null}){this.callback=P,this.params=Zt,this.objs=dt,this.commonObjs=It,this.annotationCanvasMap=xt,this.operatorListIdx=null,this.operatorList=it,this._pageIndex=Xt,this.canvasFactory=zt,this.filterFactory=Gt,this._pdfBug=Ut,this.pageColors=Vt,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=Nt===!0&&typeof window<"u",this.cancelled=!1,this.capability=new _util.PromiseCapability,this.task=new RenderTask(this),this._cancelBound=this.cancel.bind(this),this._continueBound=this._continue.bind(this),this._scheduleNextBound=this._scheduleNext.bind(this),this._nextBound=this._next.bind(this),this._canvas=Zt.canvasContext.canvas}get completed(){return this.capability.promise.catch(function(){})}initializeGraphics({transparency:P=!1,optionalContentConfig:Zt}){var Xt,zt;if(this.cancelled)return;if(this._canvas){if(bt(_,m).has(this._canvas))throw new Error("Cannot use the same canvas during multiple render() operations. Use different canvas or ensure previous operations were cancelled or completed.");bt(_,m).add(this._canvas)}this._pdfBug&&((Xt=globalThis.StepperManager)!=null&&Xt.enabled)&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());const{canvasContext:dt,viewport:It,transform:xt,background:it}=this.params;this.gfx=new _canvas.CanvasGraphics(dt,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:Zt},this.annotationCanvasMap,this.pageColors),this.gfx.beginDrawing({transform:xt,viewport:It,transparency:P,background:it}),this.operatorListIdx=0,this.graphicsReady=!0,(zt=this.graphicsReadyCallback)==null||zt.call(this)}cancel(P=null,Zt=0){var dt;this.running=!1,this.cancelled=!0,(dt=this.gfx)==null||dt.endDrawing(),bt(_,m).delete(this._canvas),this.callback(P||new _display_utils.RenderingCancelledException(`Rendering cancelled, page ${this._pageIndex+1}`,Zt))}operatorListChanged(){var P;if(!this.graphicsReady){this.graphicsReadyCallback||(this.graphicsReadyCallback=this._continueBound);return}(P=this.stepper)==null||P.updateOperatorList(this.operatorList),!this.running&&this._continue()}_continue(){this.running=!0,!this.cancelled&&(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())}_scheduleNext(){this._useRequestAnimationFrame?window.requestAnimationFrame(()=>{this._nextBound().catch(this._cancelBound)}):Promise.resolve().then(this._nextBound).catch(this._cancelBound)}async _next(){this.cancelled||(this.operatorListIdx=this.gfx.executeOperatorList(this.operatorList,this.operatorListIdx,this._continueBound,this.stepper),this.operatorListIdx===this.operatorList.argsArray.length&&(this.running=!1,this.operatorList.lastChunk&&(this.gfx.endDrawing(),bt(_,m).delete(this._canvas),this.callback())))}};m=new WeakMap,ll(_,m,new WeakSet);let InternalRenderTask=_;const version="3.11.174";exports.version=version;const build="ce8716743";exports.build=build},(lt,r,h)=>{var I,j,q,ss,f;Object.defineProperty(r,"__esModule",{value:!0}),r.SerializableEmpty=r.PrintAnnotationStorage=r.AnnotationStorage=void 0;var M=h(1),p=h(4),B=h(8);const Q=Object.freeze({map:null,hash:"",transfers:void 0});r.SerializableEmpty=Q;class U{constructor(){ll(this,q);ll(this,I,!1);ll(this,j,new Map);this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(k,T){const g=bt(this,j).get(k);return g===void 0?T:Object.assign(T,g)}getRawValue(k){return bt(this,j).get(k)}remove(k){if(bt(this,j).delete(k),bt(this,j).size===0&&this.resetModified(),typeof this.onAnnotationEditor=="function"){for(const T of bt(this,j).values())if(T instanceof p.AnnotationEditor)return;this.onAnnotationEditor(null)}}setValue(k,T){const g=bt(this,j).get(k);let F=!1;if(g!==void 0)for(const[J,v]of Object.entries(T))g[J]!==v&&(F=!0,g[J]=v);else F=!0,bt(this,j).set(k,T);F&&nl(this,q,ss).call(this),T instanceof p.AnnotationEditor&&typeof this.onAnnotationEditor=="function"&&this.onAnnotationEditor(T.constructor._type)}has(k){return bt(this,j).has(k)}getAll(){return bt(this,j).size>0?(0,M.objectFromMap)(bt(this,j)):null}setAll(k){for(const[T,g]of Object.entries(k))this.setValue(T,g)}get size(){return bt(this,j).size}resetModified(){bt(this,I)&&(ul(this,I,!1),typeof this.onResetModified=="function"&&this.onResetModified())}get print(){return new O(this)}get serializable(){if(bt(this,j).size===0)return Q;const k=new Map,T=new B.MurmurHash3_64,g=[],F=Object.create(null);let J=!1;for(const[v,u]of bt(this,j)){const m=u instanceof p.AnnotationEditor?u.serialize(!1,F):u;m&&(k.set(v,m),T.update(`${v}:${JSON.stringify(m)}`),J||(J=!!m.bitmap))}if(J)for(const v of k.values())v.bitmap&&g.push(v.bitmap);return k.size>0?{map:k,hash:T.hexdigest(),transfers:g}:Q}}I=new WeakMap,j=new WeakMap,q=new WeakSet,ss=function(){bt(this,I)||(ul(this,I,!0),typeof this.onSetModified=="function"&&this.onSetModified())},r.AnnotationStorage=U;class O extends U{constructor(T){super();ll(this,f,void 0);const{map:g,hash:F,transfers:J}=T.serializable,v=structuredClone(g,J?{transfer:J}:null);ul(this,f,{map:v,hash:F,transfers:J})}get print(){(0,M.unreachable)("Should not call PrintAnnotationStorage.print")}get serializable(){return bt(this,f)}}f=new WeakMap,r.PrintAnnotationStorage=O},(lt,r,h)=>{var O,I,j,q,K,f,S,k,T,g,F,J,v,u,m,pe,$,ye,Zt,Te,It,Le,it,is,zt,cs,Nt,ds,Vt,Ve,Pt,as;Object.defineProperty(r,"__esModule",{value:!0}),r.AnnotationEditor=void 0;var M=h(5),p=h(1),B=h(6);const R=class R{constructor(X){ll(this,m);ll(this,$);ll(this,It);ll(this,it);ll(this,zt);ll(this,Nt);ll(this,Vt);ll(this,Pt);ll(this,O,"");ll(this,I,!1);ll(this,j,null);ll(this,q,null);ll(this,K,null);ll(this,f,!1);ll(this,S,null);ll(this,k,this.focusin.bind(this));ll(this,T,this.focusout.bind(this));ll(this,g,!1);ll(this,F,!1);ll(this,J,!1);gl(this,"_initialOptions",Object.create(null));gl(this,"_uiManager",null);gl(this,"_focusEventsAllowed",!0);gl(this,"_l10nPromise",null);ll(this,v,!1);ll(this,u,R._zIndex++);this.constructor===R&&(0,p.unreachable)("Cannot initialize AnnotationEditor."),this.parent=X.parent,this.id=X.id,this.width=this.height=null,this.pageIndex=X.parent.pageIndex,this.name=X.name,this.div=null,this._uiManager=X.uiManager,this.annotationElementId=null,this._willKeepAspectRatio=!1,this._initialOptions.isCentered=X.isCentered,this._structTreeParentId=null;const{rotation:C,rawDims:{pageWidth:H,pageHeight:st,pageX:et,pageY:Mt}}=this.parent.viewport;this.rotation=C,this.pageRotation=(360+C-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[H,st],this.pageTranslation=[et,Mt];const[Rt,gt]=this.parentDimensions;this.x=X.x/Rt,this.y=X.y/gt,this.isAttachedToDOM=!1,this.deleted=!1}get editorType(){return Object.getPrototypeOf(this).constructor._type}static get _defaultLineColor(){return(0,p.shadow)(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(X){const C=new U({id:X.parent.getNextId(),parent:X.parent,uiManager:X._uiManager});C.annotationElementId=X.annotationElementId,C.deleted=!0,C._uiManager.addToAnnotationStorage(C)}static initialize(X,C=null){if(R._l10nPromise||(R._l10nPromise=new Map(["editor_alt_text_button_label","editor_alt_text_edit_button_label","editor_alt_text_decorative_tooltip"].map(st=>[st,X.get(st)]))),C!=null&&C.strings)for(const st of C.strings)R._l10nPromise.set(st,X.get(st));if(R._borderLineWidth!==-1)return;const H=getComputedStyle(document.documentElement);R._borderLineWidth=parseFloat(H.getPropertyValue("--outline-width"))||0}static updateDefaultParams(X,C){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(X){return!1}static paste(X,C){(0,p.unreachable)("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return bt(this,v)}set _isDraggable(X){var C;ul(this,v,X),(C=this.div)==null||C.classList.toggle("draggable",X)}center(){const[X,C]=this.pageDimensions;switch(this.parentRotation){case 90:this.x-=this.height*C/(X*2),this.y+=this.width*X/(C*2);break;case 180:this.x+=this.width/2,this.y+=this.height/2;break;case 270:this.x+=this.height*C/(X*2),this.y-=this.width*X/(C*2);break;default:this.x-=this.width/2,this.y-=this.height/2;break}this.fixAndSetPosition()}addCommands(X){this._uiManager.addCommands(X)}get currentLayer(){return this._uiManager.currentLayer}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=bt(this,u)}setParent(X){X!==null&&(this.pageIndex=X.pageIndex,this.pageDimensions=X.pageDimensions),this.parent=X}focusin(X){this._focusEventsAllowed&&(bt(this,g)?ul(this,g,!1):this.parent.setSelected(this))}focusout(X){var H;if(!this._focusEventsAllowed||!this.isAttachedToDOM)return;const C=X.relatedTarget;C!=null&&C.closest(`#${this.id}`)||(X.preventDefault(),(H=this.parent)!=null&&H.isMultipleSelection||this.commitOrRemove())}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}setAt(X,C,H,st){const[et,Mt]=this.parentDimensions;[H,st]=this.screenToPageTranslation(H,st),this.x=(X+H)/et,this.y=(C+st)/Mt,this.fixAndSetPosition()}translate(X,C){nl(this,m,pe).call(this,this.parentDimensions,X,C)}translateInPage(X,C){nl(this,m,pe).call(this,this.pageDimensions,X,C),this.div.scrollIntoView({block:"nearest"})}drag(X,C){const[H,st]=this.parentDimensions;if(this.x+=X/H,this.y+=C/st,this.parent&&(this.x<0||this.x>1||this.y<0||this.y>1)){const{x:Jt,y:Dt}=this.div.getBoundingClientRect();this.parent.findNewParent(this,Jt,Dt)&&(this.x-=Math.floor(this.x),this.y-=Math.floor(this.y))}let{x:et,y:Mt}=this;const[Rt,gt]=nl(this,$,ye).call(this);et+=Rt,Mt+=gt,this.div.style.left=`${(100*et).toFixed(2)}%`,this.div.style.top=`${(100*Mt).toFixed(2)}%`,this.div.scrollIntoView({block:"nearest"})}fixAndSetPosition(){const[X,C]=this.pageDimensions;let{x:H,y:st,width:et,height:Mt}=this;switch(et*=X,Mt*=C,H*=X,st*=C,this.rotation){case 0:H=Math.max(0,Math.min(X-et,H)),st=Math.max(0,Math.min(C-Mt,st));break;case 90:H=Math.max(0,Math.min(X-Mt,H)),st=Math.min(C,Math.max(et,st));break;case 180:H=Math.min(X,Math.max(et,H)),st=Math.min(C,Math.max(Mt,st));break;case 270:H=Math.min(X,Math.max(Mt,H)),st=Math.max(0,Math.min(C-et,st));break}this.x=H/=X,this.y=st/=C;const[Rt,gt]=nl(this,$,ye).call(this);H+=Rt,st+=gt;const{style:Jt}=this.div;Jt.left=`${(100*H).toFixed(2)}%`,Jt.top=`${(100*st).toFixed(2)}%`,this.moveInDOM()}screenToPageTranslation(X,C){var H;return nl(H=R,Zt,Te).call(H,X,C,this.parentRotation)}pageTranslationToScreen(X,C){var H;return nl(H=R,Zt,Te).call(H,X,C,360-this.parentRotation)}get parentScale(){return this._uiManager.viewParameters.realScale}get parentRotation(){return(this._uiManager.viewParameters.rotation+this.pageRotation)%360}get parentDimensions(){const{parentScale:X,pageDimensions:[C,H]}=this,st=C*X,et=H*X;return p.FeatureTest.isCSSRoundSupported?[Math.round(st),Math.round(et)]:[st,et]}setDims(X,C){var et;const[H,st]=this.parentDimensions;this.div.style.width=`${(100*X/H).toFixed(2)}%`,bt(this,f)||(this.div.style.height=`${(100*C/st).toFixed(2)}%`),(et=bt(this,j))==null||et.classList.toggle("small",X<R.SMALL_EDITOR_SIZE||C<R.SMALL_EDITOR_SIZE)}fixDims(){const{style:X}=this.div,{height:C,width:H}=X,st=H.endsWith("%"),et=!bt(this,f)&&C.endsWith("%");if(st&&et)return;const[Mt,Rt]=this.parentDimensions;st||(X.width=`${(100*parseFloat(H)/Mt).toFixed(2)}%`),!bt(this,f)&&!et&&(X.height=`${(100*parseFloat(C)/Rt).toFixed(2)}%`)}getInitialTranslation(){return[0,0]}async addAltTextButton(){if(bt(this,j))return;const X=ul(this,j,document.createElement("button"));X.className="altText";const C=await R._l10nPromise.get("editor_alt_text_button_label");X.textContent=C,X.setAttribute("aria-label",C),X.tabIndex="0",X.addEventListener("contextmenu",B.noContextMenu),X.addEventListener("pointerdown",H=>H.stopPropagation()),X.addEventListener("click",H=>{H.preventDefault(),this._uiManager.editAltText(this)},{capture:!0}),X.addEventListener("keydown",H=>{H.target===X&&H.key==="Enter"&&(H.preventDefault(),this._uiManager.editAltText(this))}),nl(this,Vt,Ve).call(this),this.div.append(X),R.SMALL_EDITOR_SIZE||(R.SMALL_EDITOR_SIZE=Math.min(128,Math.round(X.getBoundingClientRect().width*1.4)))}getClientDimensions(){return this.div.getBoundingClientRect()}get altTextData(){return{altText:bt(this,O),decorative:bt(this,I)}}set altTextData({altText:X,decorative:C}){bt(this,O)===X&&bt(this,I)===C||(ul(this,O,X),ul(this,I,C),nl(this,Vt,Ve).call(this))}render(){this.div=document.createElement("div"),this.div.setAttribute("data-editor-rotation",(360-this.rotation)%360),this.div.className=this.name,this.div.setAttribute("id",this.id),this.div.setAttribute("tabIndex",0),this.setInForeground(),this.div.addEventListener("focusin",bt(this,k)),this.div.addEventListener("focusout",bt(this,T));const[X,C]=this.parentDimensions;this.parentRotation%180!==0&&(this.div.style.maxWidth=`${(100*C/X).toFixed(2)}%`,this.div.style.maxHeight=`${(100*X/C).toFixed(2)}%`);const[H,st]=this.getInitialTranslation();return this.translate(H,st),(0,M.bindEvents)(this,this.div,["pointerdown"]),this.div}pointerdown(X){const{isMac:C}=p.FeatureTest.platform;if(X.button!==0||X.ctrlKey&&C){X.preventDefault();return}ul(this,g,!0),nl(this,Pt,as).call(this,X)}moveInDOM(){var X;(X=this.parent)==null||X.moveEditorInDOM(this)}_setParentAndPosition(X,C,H){X.changeParent(this),this.x=C,this.y=H,this.fixAndSetPosition()}getRect(X,C){const H=this.parentScale,[st,et]=this.pageDimensions,[Mt,Rt]=this.pageTranslation,gt=X/H,Jt=C/H,Dt=this.x*st,qt=this.y*et,vt=this.width*st,cl=this.height*et;switch(this.rotation){case 0:return[Dt+gt+Mt,et-qt-Jt-cl+Rt,Dt+gt+vt+Mt,et-qt-Jt+Rt];case 90:return[Dt+Jt+Mt,et-qt+gt+Rt,Dt+Jt+cl+Mt,et-qt+gt+vt+Rt];case 180:return[Dt-gt-vt+Mt,et-qt+Jt+Rt,Dt-gt+Mt,et-qt+Jt+cl+Rt];case 270:return[Dt-Jt-cl+Mt,et-qt-gt-vt+Rt,Dt-Jt+Mt,et-qt-gt+Rt];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(X,C){const[H,st,et,Mt]=X,Rt=et-H,gt=Mt-st;switch(this.rotation){case 0:return[H,C-Mt,Rt,gt];case 90:return[H,C-st,gt,Rt];case 180:return[et,C-st,Rt,gt];case 270:return[et,C-Mt,gt,Rt];default:throw new Error("Invalid rotation")}}onceAdded(){}isEmpty(){return!1}enableEditMode(){ul(this,J,!0)}disableEditMode(){ul(this,J,!1)}isInEditMode(){return bt(this,J)}shouldGetKeyboardEvents(){return!1}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}rebuild(){var X,C;(X=this.div)==null||X.addEventListener("focusin",bt(this,k)),(C=this.div)==null||C.addEventListener("focusout",bt(this,T))}serialize(X=!1,C=null){(0,p.unreachable)("An editor must be serializable")}static deserialize(X,C,H){const st=new this.prototype.constructor({parent:C,id:C.getNextId(),uiManager:H});st.rotation=X.rotation;const[et,Mt]=st.pageDimensions,[Rt,gt,Jt,Dt]=st.getRectInCurrentCoords(X.rect,Mt);return st.x=Rt/et,st.y=gt/Mt,st.width=Jt/et,st.height=Dt/Mt,st}remove(){var X;this.div.removeEventListener("focusin",bt(this,k)),this.div.removeEventListener("focusout",bt(this,T)),this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),(X=bt(this,j))==null||X.remove(),ul(this,j,null),ul(this,q,null)}get isResizable(){return!1}makeResizable(){this.isResizable&&(nl(this,it,is).call(this),bt(this,S).classList.remove("hidden"))}select(){var X;this.makeResizable(),(X=this.div)==null||X.classList.add("selectedEditor")}unselect(){var X,C,H;(X=bt(this,S))==null||X.classList.add("hidden"),(C=this.div)==null||C.classList.remove("selectedEditor"),(H=this.div)!=null&&H.contains(document.activeElement)&&this._uiManager.currentLayer.div.focus()}updateParams(X,C){}disableEditing(){bt(this,j)&&(bt(this,j).hidden=!0)}enableEditing(){bt(this,j)&&(bt(this,j).hidden=!1)}enterInEditMode(){}get contentDiv(){return this.div}get isEditing(){return bt(this,F)}set isEditing(X){ul(this,F,X),this.parent&&(X?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null))}setAspectRatio(X,C){ul(this,f,!0);const H=X/C,{style:st}=this.div;st.aspectRatio=H,st.height="auto"}static get MIN_SIZE(){return 16}};O=new WeakMap,I=new WeakMap,j=new WeakMap,q=new WeakMap,K=new WeakMap,f=new WeakMap,S=new WeakMap,k=new WeakMap,T=new WeakMap,g=new WeakMap,F=new WeakMap,J=new WeakMap,v=new WeakMap,u=new WeakMap,m=new WeakSet,pe=function([X,C],H,st){[H,st]=this.screenToPageTranslation(H,st),this.x+=H/X,this.y+=st/C,this.fixAndSetPosition()},$=new WeakSet,ye=function(){const[X,C]=this.parentDimensions,{_borderLineWidth:H}=R,st=H/X,et=H/C;switch(this.rotation){case 90:return[-st,et];case 180:return[st,et];case 270:return[st,-et];default:return[-st,-et]}},Zt=new WeakSet,Te=function(X,C,H){switch(H){case 90:return[C,-X];case 180:return[-X,-C];case 270:return[-C,X];default:return[X,C]}},It=new WeakSet,Le=function(X){switch(X){case 90:{const[C,H]=this.pageDimensions;return[0,-C/H,H/C,0]}case 180:return[-1,0,0,-1];case 270:{const[C,H]=this.pageDimensions;return[0,C/H,-H/C,0]}default:return[1,0,0,1]}},it=new WeakSet,is=function(){if(bt(this,S))return;ul(this,S,document.createElement("div")),bt(this,S).classList.add("resizers");const X=["topLeft","topRight","bottomRight","bottomLeft"];this._willKeepAspectRatio||X.push("topMiddle","middleRight","bottomMiddle","middleLeft");for(const C of X){const H=document.createElement("div");bt(this,S).append(H),H.classList.add("resizer",C),H.addEventListener("pointerdown",nl(this,zt,cs).bind(this,C)),H.addEventListener("contextmenu",B.noContextMenu)}this.div.prepend(bt(this,S))},zt=new WeakSet,cs=function(X,C){C.preventDefault();const{isMac:H}=p.FeatureTest.platform;if(C.button!==0||C.ctrlKey&&H)return;const st=nl(this,Nt,ds).bind(this,X),et=this._isDraggable;this._isDraggable=!1;const Mt={passive:!0,capture:!0};window.addEventListener("pointermove",st,Mt);const Rt=this.x,gt=this.y,Jt=this.width,Dt=this.height,qt=this.parent.div.style.cursor,vt=this.div.style.cursor;this.div.style.cursor=this.parent.div.style.cursor=window.getComputedStyle(C.target).cursor;const cl=()=>{this._isDraggable=et,window.removeEventListener("pointerup",cl),window.removeEventListener("blur",cl),window.removeEventListener("pointermove",st,Mt),this.parent.div.style.cursor=qt,this.div.style.cursor=vt;const bl=this.x,il=this.y,Bt=this.width,Ft=this.height;bl===Rt&&il===gt&&Bt===Jt&&Ft===Dt||this.addCommands({cmd:()=>{this.width=Bt,this.height=Ft,this.x=bl,this.y=il;const[wt,pt]=this.parentDimensions;this.setDims(wt*Bt,pt*Ft),this.fixAndSetPosition()},undo:()=>{this.width=Jt,this.height=Dt,this.x=Rt,this.y=gt;const[wt,pt]=this.parentDimensions;this.setDims(wt*Jt,pt*Dt),this.fixAndSetPosition()},mustExec:!0})};window.addEventListener("pointerup",cl),window.addEventListener("blur",cl)},Nt=new WeakSet,ds=function(X,C){const[H,st]=this.parentDimensions,et=this.x,Mt=this.y,Rt=this.width,gt=this.height,Jt=R.MIN_SIZE/H,Dt=R.MIN_SIZE/st,qt=Tt=>Math.round(Tt*1e4)/1e4,vt=nl(this,It,Le).call(this,this.rotation),cl=(Tt,jt)=>[vt[0]*Tt+vt[2]*jt,vt[1]*Tt+vt[3]*jt],bl=nl(this,It,Le).call(this,360-this.rotation),il=(Tt,jt)=>[bl[0]*Tt+bl[2]*jt,bl[1]*Tt+bl[3]*jt];let Bt,Ft,wt=!1,pt=!1;switch(X){case"topLeft":wt=!0,Bt=(Tt,jt)=>[0,0],Ft=(Tt,jt)=>[Tt,jt];break;case"topMiddle":Bt=(Tt,jt)=>[Tt/2,0],Ft=(Tt,jt)=>[Tt/2,jt];break;case"topRight":wt=!0,Bt=(Tt,jt)=>[Tt,0],Ft=(Tt,jt)=>[0,jt];break;case"middleRight":pt=!0,Bt=(Tt,jt)=>[Tt,jt/2],Ft=(Tt,jt)=>[0,jt/2];break;case"bottomRight":wt=!0,Bt=(Tt,jt)=>[Tt,jt],Ft=(Tt,jt)=>[0,0];break;case"bottomMiddle":Bt=(Tt,jt)=>[Tt/2,jt],Ft=(Tt,jt)=>[Tt/2,0];break;case"bottomLeft":wt=!0,Bt=(Tt,jt)=>[0,jt],Ft=(Tt,jt)=>[Tt,0];break;case"middleLeft":pt=!0,Bt=(Tt,jt)=>[0,jt/2],Ft=(Tt,jt)=>[Tt,jt/2];break}const Ct=Bt(Rt,gt),$t=Ft(Rt,gt);let dl=cl(...$t);const rl=qt(et+dl[0]),Yl=qt(Mt+dl[1]);let Xl=1,pl=1,[Ll,yl]=this.screenToPageTranslation(C.movementX,C.movementY);if([Ll,yl]=il(Ll/H,yl/st),wt){const Tt=Math.hypot(Rt,gt);Xl=pl=Math.max(Math.min(Math.hypot($t[0]-Ct[0]-Ll,$t[1]-Ct[1]-yl)/Tt,1/Rt,1/gt),Jt/Rt,Dt/gt)}else pt?Xl=Math.max(Jt,Math.min(1,Math.abs($t[0]-Ct[0]-Ll)))/Rt:pl=Math.max(Dt,Math.min(1,Math.abs($t[1]-Ct[1]-yl)))/gt;const Vl=qt(Rt*Xl),_t=qt(gt*pl);dl=cl(...Ft(Vl,_t));const ot=rl-dl[0],ut=Yl-dl[1];this.width=Vl,this.height=_t,this.x=ot,this.y=ut,this.setDims(H*Vl,st*_t),this.fixAndSetPosition()},Vt=new WeakSet,Ve=async function(){var H;const X=bt(this,j);if(!X)return;if(!bt(this,O)&&!bt(this,I)){X.classList.remove("done"),(H=bt(this,q))==null||H.remove();return}R._l10nPromise.get("editor_alt_text_edit_button_label").then(st=>{X.setAttribute("aria-label",st)});let C=bt(this,q);if(!C){ul(this,q,C=document.createElement("span")),C.className="tooltip",C.setAttribute("role","tooltip");const st=C.id=`alt-text-tooltip-${this.id}`;X.setAttribute("aria-describedby",st);const et=100;X.addEventListener("mouseenter",()=>{ul(this,K,setTimeout(()=>{ul(this,K,null),bt(this,q).classList.add("show"),this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",subtype:this.editorType,data:{action:"alt_text_tooltip"}}})},et))}),X.addEventListener("mouseleave",()=>{var Mt;clearTimeout(bt(this,K)),ul(this,K,null),(Mt=bt(this,q))==null||Mt.classList.remove("show")})}X.classList.add("done"),C.innerText=bt(this,I)?await R._l10nPromise.get("editor_alt_text_decorative_tooltip"):bt(this,O),C.parentNode||X.append(C)},Pt=new WeakSet,as=function(X){if(!this._isDraggable)return;const C=this._uiManager.isSelected(this);this._uiManager.setUpDragSession();let H,st;C&&(H={passive:!0,capture:!0},st=Mt=>{const[Rt,gt]=this.screenToPageTranslation(Mt.movementX,Mt.movementY);this._uiManager.dragSelectedEditors(Rt,gt)},window.addEventListener("pointermove",st,H));const et=()=>{if(window.removeEventListener("pointerup",et),window.removeEventListener("blur",et),C&&window.removeEventListener("pointermove",st,H),ul(this,g,!1),!this._uiManager.endDragSession()){const{isMac:Mt}=p.FeatureTest.platform;X.ctrlKey&&!Mt||X.shiftKey||X.metaKey&&Mt?this.parent.toggleSelected(this):this.parent.setSelected(this)}};window.addEventListener("pointerup",et),window.addEventListener("blur",et)},ll(R,Zt),gl(R,"_borderLineWidth",-1),gl(R,"_colorManager",new M.ColorManager),gl(R,"_zIndex",1),gl(R,"SMALL_EDITOR_SIZE",0);let Q=R;r.AnnotationEditor=Q;class U extends Q{constructor(X){super(X),this.annotationElementId=X.annotationElementId,this.deleted=!0}serialize(){return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex}}}},(lt,r,h)=>{var f,S,k,T,g,Ie,v,u,m,_,$,ns,dt,It,xt,it,Xt,zt,Gt,Nt,Ut,Vt,Ht,Pt,at,R,w,X,C,H,st,et,Mt,Rt,gt,Jt,Dt,qt,vt,cl,bl,il,Bt,Ft,wt,pt,Ct,Zs,dl,ze,Yl,Re,pl,ae,yl,Se,_t,we,ut,Jl,jt,_l,Lt,hs,Kt,bs,el,xe,Qt,ql,hl,ke;Object.defineProperty(r,"__esModule",{value:!0}),r.KeyboardManager=r.CommandManager=r.ColorManager=r.AnnotationEditorUIManager=void 0,r.bindEvents=B,r.opacityToHex=Q;var M=h(1),p=h(6);function B(nt,L,ct){for(const Wt of ct)L.addEventListener(Wt,nt[Wt].bind(nt))}function Q(nt){return Math.round(Math.min(255,Math.max(1,255*nt))).toString(16).padStart(2,"0")}class U{constructor(){ll(this,f,0)}getId(){return`${M.AnnotationEditorPrefix}${Al(this,f)._++}`}}f=new WeakMap;const J=class J{constructor(){ll(this,g);ll(this,S,(0,M.getUuid)());ll(this,k,0);ll(this,T,null)}static get _isSVGFittingCanvas(){const L='data:image/svg+xml;charset=UTF-8,<svg viewBox="0 0 1 1" width="1" height="1" xmlns="http://www.w3.org/2000/svg"><rect width="1" height="1" style="fill:red;"/></svg>',Wt=new OffscreenCanvas(1,3).getContext("2d"),Yt=new Image;Yt.src=L;const kt=Yt.decode().then(()=>(Wt.drawImage(Yt,0,0,1,1,0,0,1,3),new Uint32Array(Wt.getImageData(0,0,1,1).data.buffer)[0]===0));return(0,M.shadow)(this,"_isSVGFittingCanvas",kt)}async getFromFile(L){const{lastModified:ct,name:Wt,size:Yt,type:kt}=L;return nl(this,g,Ie).call(this,`${ct}_${Wt}_${Yt}_${kt}`,L)}async getFromUrl(L){return nl(this,g,Ie).call(this,L,L)}async getFromId(L){bt(this,T)||ul(this,T,new Map);const ct=bt(this,T).get(L);return ct?ct.bitmap?(ct.refCounter+=1,ct):ct.file?this.getFromFile(ct.file):this.getFromUrl(ct.url):null}getSvgUrl(L){const ct=bt(this,T).get(L);return ct!=null&&ct.isSvg?ct.svgUrl:null}deleteId(L){bt(this,T)||ul(this,T,new Map);const ct=bt(this,T).get(L);ct&&(ct.refCounter-=1,ct.refCounter===0&&(ct.bitmap=null))}isValidId(L){return L.startsWith(`image_${bt(this,S)}_`)}};S=new WeakMap,k=new WeakMap,T=new WeakMap,g=new WeakSet,Ie=async function(L,ct){bt(this,T)||ul(this,T,new Map);let Wt=bt(this,T).get(L);if(Wt===null)return null;if(Wt!=null&&Wt.bitmap)return Wt.refCounter+=1,Wt;try{Wt||(Wt={bitmap:null,id:`image_${bt(this,S)}_${Al(this,k)._++}`,refCounter:0,isSvg:!1});let Yt;if(typeof ct=="string"){Wt.url=ct;const kt=await fetch(ct);if(!kt.ok)throw new Error(kt.statusText);Yt=await kt.blob()}else Yt=Wt.file=ct;if(Yt.type==="image/svg+xml"){const kt=J._isSVGFittingCanvas,Et=new FileReader,sl=new Image,ml=new Promise((al,zl)=>{sl.onload=()=>{Wt.bitmap=sl,Wt.isSvg=!0,al()},Et.onload=async()=>{const Gl=Wt.svgUrl=Et.result;sl.src=await kt?`${Gl}#svgView(preserveAspectRatio(none))`:Gl},sl.onerror=Et.onerror=zl});Et.readAsDataURL(Yt),await ml}else Wt.bitmap=await createImageBitmap(Yt);Wt.refCounter=1}catch(Yt){console.error(Yt),Wt=null}return bt(this,T).set(L,Wt),Wt&&bt(this,T).set(Wt.id,Wt),Wt};let O=J;class I{constructor(L=128){ll(this,v,[]);ll(this,u,!1);ll(this,m,void 0);ll(this,_,-1);ul(this,m,L)}add({cmd:L,undo:ct,mustExec:Wt,type:Yt=NaN,overwriteIfSameType:kt=!1,keepUndo:Et=!1}){if(Wt&&L(),bt(this,u))return;const sl={cmd:L,undo:ct,type:Yt};if(bt(this,_)===-1){bt(this,v).length>0&&(bt(this,v).length=0),ul(this,_,0),bt(this,v).push(sl);return}if(kt&&bt(this,v)[bt(this,_)].type===Yt){Et&&(sl.undo=bt(this,v)[bt(this,_)].undo),bt(this,v)[bt(this,_)]=sl;return}const ml=bt(this,_)+1;ml===bt(this,m)?bt(this,v).splice(0,1):(ul(this,_,ml),ml<bt(this,v).length&&bt(this,v).splice(ml)),bt(this,v).push(sl)}undo(){bt(this,_)!==-1&&(ul(this,u,!0),bt(this,v)[bt(this,_)].undo(),ul(this,u,!1),ul(this,_,bt(this,_)-1))}redo(){bt(this,_)<bt(this,v).length-1&&(ul(this,_,bt(this,_)+1),ul(this,u,!0),bt(this,v)[bt(this,_)].cmd(),ul(this,u,!1))}hasSomethingToUndo(){return bt(this,_)!==-1}hasSomethingToRedo(){return bt(this,_)<bt(this,v).length-1}destroy(){ul(this,v,null)}}v=new WeakMap,u=new WeakMap,m=new WeakMap,_=new WeakMap,r.CommandManager=I;class j{constructor(L){ll(this,$);this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;const{isMac:ct}=M.FeatureTest.platform;for(const[Wt,Yt,kt={}]of L)for(const Et of Wt){const sl=Et.startsWith("mac+");ct&&sl?(this.callbacks.set(Et.slice(4),{callback:Yt,options:kt}),this.allKeys.add(Et.split("+").at(-1))):!ct&&!sl&&(this.callbacks.set(Et,{callback:Yt,options:kt}),this.allKeys.add(Et.split("+").at(-1)))}}exec(L,ct){if(!this.allKeys.has(ct.key))return;const Wt=this.callbacks.get(nl(this,$,ns).call(this,ct));if(!Wt)return;const{callback:Yt,options:{bubbles:kt=!1,args:Et=[],checker:sl=null}}=Wt;sl&&!sl(L,ct)||(Yt.bind(L,...Et)(),kt||(ct.stopPropagation(),ct.preventDefault()))}}$=new WeakSet,ns=function(L){L.altKey&&this.buffer.push("alt"),L.ctrlKey&&this.buffer.push("ctrl"),L.metaKey&&this.buffer.push("meta"),L.shiftKey&&this.buffer.push("shift"),this.buffer.push(L.key);const ct=this.buffer.join("+");return this.buffer.length=0,ct},r.KeyboardManager=j;const Zt=class Zt{get _colors(){const L=new Map([["CanvasText",null],["Canvas",null]]);return(0,p.getColorValues)(L),(0,M.shadow)(this,"_colors",L)}convert(L){const ct=(0,p.getRGB)(L);if(!window.matchMedia("(forced-colors: active)").matches)return ct;for(const[Wt,Yt]of this._colors)if(Yt.every((kt,Et)=>kt===ct[Et]))return Zt._colorsMapping.get(Wt);return ct}getHexCode(L){const ct=this._colors.get(L);return ct?M.Util.makeHexColor(...ct):L}};gl(Zt,"_colorsMapping",new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]));let q=Zt;r.ColorManager=q;const Wl=class Wl{constructor(L,ct,Wt,Yt,kt,Et){ll(this,Ct);ll(this,dl);ll(this,Yl);ll(this,pl);ll(this,yl);ll(this,_t);ll(this,ut);ll(this,jt);ll(this,Lt);ll(this,Kt);ll(this,el);ll(this,Qt);ll(this,hl);ll(this,dt,null);ll(this,It,new Map);ll(this,xt,new Map);ll(this,it,null);ll(this,Xt,null);ll(this,zt,new I);ll(this,Gt,0);ll(this,Nt,new Set);ll(this,Ut,null);ll(this,Vt,null);ll(this,Ht,new Set);ll(this,Pt,null);ll(this,at,new U);ll(this,R,!1);ll(this,w,!1);ll(this,X,null);ll(this,C,M.AnnotationEditorType.NONE);ll(this,H,new Set);ll(this,st,null);ll(this,et,this.blur.bind(this));ll(this,Mt,this.focus.bind(this));ll(this,Rt,this.copy.bind(this));ll(this,gt,this.cut.bind(this));ll(this,Jt,this.paste.bind(this));ll(this,Dt,this.keydown.bind(this));ll(this,qt,this.onEditingAction.bind(this));ll(this,vt,this.onPageChanging.bind(this));ll(this,cl,this.onScaleChanging.bind(this));ll(this,bl,this.onRotationChanging.bind(this));ll(this,il,{isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1});ll(this,Bt,[0,0]);ll(this,Ft,null);ll(this,wt,null);ll(this,pt,null);ul(this,wt,L),ul(this,pt,ct),ul(this,it,Wt),this._eventBus=Yt,this._eventBus._on("editingaction",bt(this,qt)),this._eventBus._on("pagechanging",bt(this,vt)),this._eventBus._on("scalechanging",bt(this,cl)),this._eventBus._on("rotationchanging",bt(this,bl)),ul(this,Xt,kt.annotationStorage),ul(this,Pt,kt.filterFactory),ul(this,st,Et),this.viewParameters={realScale:p.PixelsPerInch.PDF_TO_CSS_UNITS,rotation:0}}static get _keyboardManager(){const L=Wl.prototype,ct=kt=>{const{activeElement:Et}=document;return Et&&bt(kt,wt).contains(Et)&&kt.hasSomethingToControl()},Wt=this.TRANSLATE_SMALL,Yt=this.TRANSLATE_BIG;return(0,M.shadow)(this,"_keyboardManager",new j([[["ctrl+a","mac+meta+a"],L.selectAll],[["ctrl+z","mac+meta+z"],L.undo],[["ctrl+y","ctrl+shift+z","mac+meta+shift+z","ctrl+shift+Z","mac+meta+shift+Z"],L.redo],[["Backspace","alt+Backspace","ctrl+Backspace","shift+Backspace","mac+Backspace","mac+alt+Backspace","mac+ctrl+Backspace","Delete","ctrl+Delete","shift+Delete","mac+Delete"],L.delete],[["Escape","mac+Escape"],L.unselectAll],[["ArrowLeft","mac+ArrowLeft"],L.translateSelectedEditors,{args:[-Wt,0],checker:ct}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],L.translateSelectedEditors,{args:[-Yt,0],checker:ct}],[["ArrowRight","mac+ArrowRight"],L.translateSelectedEditors,{args:[Wt,0],checker:ct}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],L.translateSelectedEditors,{args:[Yt,0],checker:ct}],[["ArrowUp","mac+ArrowUp"],L.translateSelectedEditors,{args:[0,-Wt],checker:ct}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],L.translateSelectedEditors,{args:[0,-Yt],checker:ct}],[["ArrowDown","mac+ArrowDown"],L.translateSelectedEditors,{args:[0,Wt],checker:ct}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],L.translateSelectedEditors,{args:[0,Yt],checker:ct}]]))}destroy(){nl(this,pl,ae).call(this),nl(this,dl,ze).call(this),this._eventBus._off("editingaction",bt(this,qt)),this._eventBus._off("pagechanging",bt(this,vt)),this._eventBus._off("scalechanging",bt(this,cl)),this._eventBus._off("rotationchanging",bt(this,bl));for(const L of bt(this,xt).values())L.destroy();bt(this,xt).clear(),bt(this,It).clear(),bt(this,Ht).clear(),ul(this,dt,null),bt(this,H).clear(),bt(this,zt).destroy(),bt(this,it).destroy()}get hcmFilter(){return(0,M.shadow)(this,"hcmFilter",bt(this,st)?bt(this,Pt).addHCMFilter(bt(this,st).foreground,bt(this,st).background):"none")}get direction(){return(0,M.shadow)(this,"direction",getComputedStyle(bt(this,wt)).direction)}editAltText(L){var ct;(ct=bt(this,it))==null||ct.editAltText(this,L)}onPageChanging({pageNumber:L}){ul(this,Gt,L-1)}focusMainContainer(){bt(this,wt).focus()}findParent(L,ct){for(const Wt of bt(this,xt).values()){const{x:Yt,y:kt,width:Et,height:sl}=Wt.div.getBoundingClientRect();if(L>=Yt&&L<=Yt+Et&&ct>=kt&&ct<=kt+sl)return Wt}return null}disableUserSelect(L=!1){bt(this,pt).classList.toggle("noUserSelect",L)}addShouldRescale(L){bt(this,Ht).add(L)}removeShouldRescale(L){bt(this,Ht).delete(L)}onScaleChanging({scale:L}){this.commitOrRemove(),this.viewParameters.realScale=L*p.PixelsPerInch.PDF_TO_CSS_UNITS;for(const ct of bt(this,Ht))ct.onScaleChanging()}onRotationChanging({pagesRotation:L}){this.commitOrRemove(),this.viewParameters.rotation=L}addToAnnotationStorage(L){!L.isEmpty()&&bt(this,Xt)&&!bt(this,Xt).has(L.id)&&bt(this,Xt).setValue(L.id,L)}blur(){if(!this.hasSelection)return;const{activeElement:L}=document;for(const ct of bt(this,H))if(ct.div.contains(L)){ul(this,X,[ct,L]),ct._focusEventsAllowed=!1;break}}focus(){if(!bt(this,X))return;const[L,ct]=bt(this,X);ul(this,X,null),ct.addEventListener("focusin",()=>{L._focusEventsAllowed=!0},{once:!0}),ct.focus()}addEditListeners(){nl(this,Yl,Re).call(this),nl(this,yl,Se).call(this)}removeEditListeners(){nl(this,pl,ae).call(this),nl(this,_t,we).call(this)}copy(L){var Wt;if(L.preventDefault(),(Wt=bt(this,dt))==null||Wt.commitOrRemove(),!this.hasSelection)return;const ct=[];for(const Yt of bt(this,H)){const kt=Yt.serialize(!0);kt&&ct.push(kt)}ct.length!==0&&L.clipboardData.setData("application/pdfjs",JSON.stringify(ct))}cut(L){this.copy(L),this.delete()}paste(L){L.preventDefault();const{clipboardData:ct}=L;for(const kt of ct.items)for(const Et of bt(this,Vt))if(Et.isHandlingMimeForPasting(kt.type)){Et.paste(kt,this.currentLayer);return}let Wt=ct.getData("application/pdfjs");if(!Wt)return;try{Wt=JSON.parse(Wt)}catch(kt){(0,M.warn)(`paste: "${kt.message}".`);return}if(!Array.isArray(Wt))return;this.unselectAll();const Yt=this.currentLayer;try{const kt=[];for(const ml of Wt){const al=Yt.deserialize(ml);if(!al)return;kt.push(al)}const Et=()=>{for(const ml of kt)nl(this,el,xe).call(this,ml);nl(this,hl,ke).call(this,kt)},sl=()=>{for(const ml of kt)ml.remove()};this.addCommands({cmd:Et,undo:sl,mustExec:!0})}catch(kt){(0,M.warn)(`paste: "${kt.message}".`)}}keydown(L){var ct;(ct=this.getActive())!=null&&ct.shouldGetKeyboardEvents()||Wl._keyboardManager.exec(this,L)}onEditingAction(L){["undo","redo","delete","selectAll"].includes(L.name)&&this[L.name]()}setEditingState(L){L?(nl(this,Ct,Zs).call(this),nl(this,Yl,Re).call(this),nl(this,yl,Se).call(this),nl(this,ut,Jl).call(this,{isEditing:bt(this,C)!==M.AnnotationEditorType.NONE,isEmpty:nl(this,Qt,ql).call(this),hasSomethingToUndo:bt(this,zt).hasSomethingToUndo(),hasSomethingToRedo:bt(this,zt).hasSomethingToRedo(),hasSelectedEditor:!1})):(nl(this,dl,ze).call(this),nl(this,pl,ae).call(this),nl(this,_t,we).call(this),nl(this,ut,Jl).call(this,{isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(L){if(!bt(this,Vt)){ul(this,Vt,L);for(const ct of bt(this,Vt))nl(this,jt,_l).call(this,ct.defaultPropertiesToUpdate)}}getId(){return bt(this,at).getId()}get currentLayer(){return bt(this,xt).get(bt(this,Gt))}getLayer(L){return bt(this,xt).get(L)}get currentPageIndex(){return bt(this,Gt)}addLayer(L){bt(this,xt).set(L.pageIndex,L),bt(this,R)?L.enable():L.disable()}removeLayer(L){bt(this,xt).delete(L.pageIndex)}updateMode(L,ct=null){if(bt(this,C)!==L){if(ul(this,C,L),L===M.AnnotationEditorType.NONE){this.setEditingState(!1),nl(this,Kt,bs).call(this);return}this.setEditingState(!0),nl(this,Lt,hs).call(this),this.unselectAll();for(const Wt of bt(this,xt).values())Wt.updateMode(L);if(ct){for(const Wt of bt(this,It).values())if(Wt.annotationElementId===ct){this.setSelected(Wt),Wt.enterInEditMode();break}}}}updateToolbar(L){L!==bt(this,C)&&this._eventBus.dispatch("switchannotationeditormode",{source:this,mode:L})}updateParams(L,ct){if(bt(this,Vt)){if(L===M.AnnotationEditorParamsType.CREATE){this.currentLayer.addNewEditor(L);return}for(const Wt of bt(this,H))Wt.updateParams(L,ct);for(const Wt of bt(this,Vt))Wt.updateDefaultParams(L,ct)}}enableWaiting(L=!1){if(bt(this,w)!==L){ul(this,w,L);for(const ct of bt(this,xt).values())L?ct.disableClick():ct.enableClick(),ct.div.classList.toggle("waiting",L)}}getEditors(L){const ct=[];for(const Wt of bt(this,It).values())Wt.pageIndex===L&&ct.push(Wt);return ct}getEditor(L){return bt(this,It).get(L)}addEditor(L){bt(this,It).set(L.id,L)}removeEditor(L){var ct;bt(this,It).delete(L.id),this.unselect(L),(!L.annotationElementId||!bt(this,Nt).has(L.annotationElementId))&&((ct=bt(this,Xt))==null||ct.remove(L.id))}addDeletedAnnotationElement(L){bt(this,Nt).add(L.annotationElementId),L.deleted=!0}isDeletedAnnotationElement(L){return bt(this,Nt).has(L)}removeDeletedAnnotationElement(L){bt(this,Nt).delete(L.annotationElementId),L.deleted=!1}setActiveEditor(L){bt(this,dt)!==L&&(ul(this,dt,L),L&&nl(this,jt,_l).call(this,L.propertiesToUpdate))}toggleSelected(L){if(bt(this,H).has(L)){bt(this,H).delete(L),L.unselect(),nl(this,ut,Jl).call(this,{hasSelectedEditor:this.hasSelection});return}bt(this,H).add(L),L.select(),nl(this,jt,_l).call(this,L.propertiesToUpdate),nl(this,ut,Jl).call(this,{hasSelectedEditor:!0})}setSelected(L){for(const ct of bt(this,H))ct!==L&&ct.unselect();bt(this,H).clear(),bt(this,H).add(L),L.select(),nl(this,jt,_l).call(this,L.propertiesToUpdate),nl(this,ut,Jl).call(this,{hasSelectedEditor:!0})}isSelected(L){return bt(this,H).has(L)}unselect(L){L.unselect(),bt(this,H).delete(L),nl(this,ut,Jl).call(this,{hasSelectedEditor:this.hasSelection})}get hasSelection(){return bt(this,H).size!==0}undo(){bt(this,zt).undo(),nl(this,ut,Jl).call(this,{hasSomethingToUndo:bt(this,zt).hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:nl(this,Qt,ql).call(this)})}redo(){bt(this,zt).redo(),nl(this,ut,Jl).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:bt(this,zt).hasSomethingToRedo(),isEmpty:nl(this,Qt,ql).call(this)})}addCommands(L){bt(this,zt).add(L),nl(this,ut,Jl).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:nl(this,Qt,ql).call(this)})}delete(){if(this.commitOrRemove(),!this.hasSelection)return;const L=[...bt(this,H)],ct=()=>{for(const Yt of L)Yt.remove()},Wt=()=>{for(const Yt of L)nl(this,el,xe).call(this,Yt)};this.addCommands({cmd:ct,undo:Wt,mustExec:!0})}commitOrRemove(){var L;(L=bt(this,dt))==null||L.commitOrRemove()}hasSomethingToControl(){return bt(this,dt)||this.hasSelection}selectAll(){for(const L of bt(this,H))L.commit();nl(this,hl,ke).call(this,bt(this,It).values())}unselectAll(){if(bt(this,dt)){bt(this,dt).commitOrRemove();return}if(this.hasSelection){for(const L of bt(this,H))L.unselect();bt(this,H).clear(),nl(this,ut,Jl).call(this,{hasSelectedEditor:!1})}}translateSelectedEditors(L,ct,Wt=!1){if(Wt||this.commitOrRemove(),!this.hasSelection)return;bt(this,Bt)[0]+=L,bt(this,Bt)[1]+=ct;const[Yt,kt]=bt(this,Bt),Et=[...bt(this,H)],sl=1e3;bt(this,Ft)&&clearTimeout(bt(this,Ft)),ul(this,Ft,setTimeout(()=>{ul(this,Ft,null),bt(this,Bt)[0]=bt(this,Bt)[1]=0,this.addCommands({cmd:()=>{for(const ml of Et)bt(this,It).has(ml.id)&&ml.translateInPage(Yt,kt)},undo:()=>{for(const ml of Et)bt(this,It).has(ml.id)&&ml.translateInPage(-Yt,-kt)},mustExec:!1})},sl));for(const ml of Et)ml.translateInPage(L,ct)}setUpDragSession(){if(this.hasSelection){this.disableUserSelect(!0),ul(this,Ut,new Map);for(const L of bt(this,H))bt(this,Ut).set(L,{savedX:L.x,savedY:L.y,savedPageIndex:L.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!bt(this,Ut))return!1;this.disableUserSelect(!1);const L=bt(this,Ut);ul(this,Ut,null);let ct=!1;for(const[{x:Yt,y:kt,pageIndex:Et},sl]of L)sl.newX=Yt,sl.newY=kt,sl.newPageIndex=Et,ct||(ct=Yt!==sl.savedX||kt!==sl.savedY||Et!==sl.savedPageIndex);if(!ct)return!1;const Wt=(Yt,kt,Et,sl)=>{if(bt(this,It).has(Yt.id)){const ml=bt(this,xt).get(sl);ml?Yt._setParentAndPosition(ml,kt,Et):(Yt.pageIndex=sl,Yt.x=kt,Yt.y=Et)}};return this.addCommands({cmd:()=>{for(const[Yt,{newX:kt,newY:Et,newPageIndex:sl}]of L)Wt(Yt,kt,Et,sl)},undo:()=>{for(const[Yt,{savedX:kt,savedY:Et,savedPageIndex:sl}]of L)Wt(Yt,kt,Et,sl)},mustExec:!0}),!0}dragSelectedEditors(L,ct){if(bt(this,Ut))for(const Wt of bt(this,Ut).keys())Wt.drag(L,ct)}rebuild(L){if(L.parent===null){const ct=this.getLayer(L.pageIndex);ct?(ct.changeParent(L),ct.addOrRebuild(L)):(this.addEditor(L),this.addToAnnotationStorage(L),L.rebuild())}else L.parent.addOrRebuild(L)}isActive(L){return bt(this,dt)===L}getActive(){return bt(this,dt)}getMode(){return bt(this,C)}get imageManager(){return(0,M.shadow)(this,"imageManager",new O)}};dt=new WeakMap,It=new WeakMap,xt=new WeakMap,it=new WeakMap,Xt=new WeakMap,zt=new WeakMap,Gt=new WeakMap,Nt=new WeakMap,Ut=new WeakMap,Vt=new WeakMap,Ht=new WeakMap,Pt=new WeakMap,at=new WeakMap,R=new WeakMap,w=new WeakMap,X=new WeakMap,C=new WeakMap,H=new WeakMap,st=new WeakMap,et=new WeakMap,Mt=new WeakMap,Rt=new WeakMap,gt=new WeakMap,Jt=new WeakMap,Dt=new WeakMap,qt=new WeakMap,vt=new WeakMap,cl=new WeakMap,bl=new WeakMap,il=new WeakMap,Bt=new WeakMap,Ft=new WeakMap,wt=new WeakMap,pt=new WeakMap,Ct=new WeakSet,Zs=function(){window.addEventListener("focus",bt(this,Mt)),window.addEventListener("blur",bt(this,et))},dl=new WeakSet,ze=function(){window.removeEventListener("focus",bt(this,Mt)),window.removeEventListener("blur",bt(this,et))},Yl=new WeakSet,Re=function(){window.addEventListener("keydown",bt(this,Dt),{capture:!0})},pl=new WeakSet,ae=function(){window.removeEventListener("keydown",bt(this,Dt),{capture:!0})},yl=new WeakSet,Se=function(){document.addEventListener("copy",bt(this,Rt)),document.addEventListener("cut",bt(this,gt)),document.addEventListener("paste",bt(this,Jt))},_t=new WeakSet,we=function(){document.removeEventListener("copy",bt(this,Rt)),document.removeEventListener("cut",bt(this,gt)),document.removeEventListener("paste",bt(this,Jt))},ut=new WeakSet,Jl=function(L){Object.entries(L).some(([Wt,Yt])=>bt(this,il)[Wt]!==Yt)&&this._eventBus.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(bt(this,il),L)})},jt=new WeakSet,_l=function(L){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:L})},Lt=new WeakSet,hs=function(){if(!bt(this,R)){ul(this,R,!0);for(const L of bt(this,xt).values())L.enable()}},Kt=new WeakSet,bs=function(){if(this.unselectAll(),bt(this,R)){ul(this,R,!1);for(const L of bt(this,xt).values())L.disable()}},el=new WeakSet,xe=function(L){const ct=bt(this,xt).get(L.pageIndex);ct?ct.addOrRebuild(L):this.addEditor(L)},Qt=new WeakSet,ql=function(){if(bt(this,It).size===0)return!0;if(bt(this,It).size===1)for(const L of bt(this,It).values())return L.isEmpty();return!1},hl=new WeakSet,ke=function(L){bt(this,H).clear();for(const ct of L)ct.isEmpty()||(bt(this,H).add(ct),ct.select());nl(this,ut,Jl).call(this,{hasSelectedEditor:!0})},gl(Wl,"TRANSLATE_SMALL",1),gl(Wl,"TRANSLATE_BIG",10);let K=Wl;r.AnnotationEditorUIManager=K},(lt,r,h)=>{var Gt,Nt,Ut,Vt,Ht,Pt,at,R,w,X,C,H,Pl,et,Hl,Rt,ge,Jt,ne,qt,Ze,cl,$l,il,te;Object.defineProperty(r,"__esModule",{value:!0}),r.StatTimer=r.RenderingCancelledException=r.PixelsPerInch=r.PageViewport=r.PDFDateString=r.DOMStandardFontDataFactory=r.DOMSVGFactory=r.DOMFilterFactory=r.DOMCanvasFactory=r.DOMCMapReaderFactory=void 0,r.deprecated=_,r.getColorValues=It,r.getCurrentTransform=xt,r.getCurrentTransformInverse=it,r.getFilenameFromUrl=g,r.getPdfFilenameFromUrl=F,r.getRGB=dt,r.getXfaPageViewport=Zt,r.isDataScheme=k,r.isPdfFile=T,r.isValidFetchUrl=v,r.loadScript=m,r.noContextMenu=u,r.setLayerDimensions=Xt;var M=h(7),p=h(1);const B="http://www.w3.org/2000/svg",zt=class zt{};gl(zt,"CSS",96),gl(zt,"PDF",72),gl(zt,"PDF_TO_CSS_UNITS",zt.CSS/zt.PDF);let Q=zt;r.PixelsPerInch=Q;class U extends M.BaseFilterFactory{constructor({docId:pt,ownerDocument:Ct=globalThis.document}={}){super();ll(this,H);ll(this,et);ll(this,Rt);ll(this,Jt);ll(this,qt);ll(this,cl);ll(this,il);ll(this,Gt,void 0);ll(this,Nt,void 0);ll(this,Ut,void 0);ll(this,Vt,void 0);ll(this,Ht,void 0);ll(this,Pt,void 0);ll(this,at,void 0);ll(this,R,void 0);ll(this,w,void 0);ll(this,X,void 0);ll(this,C,0);ul(this,Ut,pt),ul(this,Vt,Ct)}addFilter(pt){if(!pt)return"none";let Ct=bt(this,H,Pl).get(pt);if(Ct)return Ct;let $t,dl,rl,Yl;if(pt.length===1){const yl=pt[0],Vl=new Array(256);for(let _t=0;_t<256;_t++)Vl[_t]=yl[_t]/255;Yl=$t=dl=rl=Vl.join(",")}else{const[yl,Vl,_t]=pt,ot=new Array(256),ut=new Array(256),Tt=new Array(256);for(let jt=0;jt<256;jt++)ot[jt]=yl[jt]/255,ut[jt]=Vl[jt]/255,Tt[jt]=_t[jt]/255;$t=ot.join(","),dl=ut.join(","),rl=Tt.join(","),Yl=`${$t}${dl}${rl}`}if(Ct=bt(this,H,Pl).get(Yl),Ct)return bt(this,H,Pl).set(pt,Ct),Ct;const Xl=`g_${bt(this,Ut)}_transfer_map_${Al(this,C)._++}`,pl=`url(#${Xl})`;bt(this,H,Pl).set(pt,pl),bt(this,H,Pl).set(Yl,pl);const Ll=nl(this,Jt,ne).call(this,Xl);return nl(this,cl,$l).call(this,$t,dl,rl,Ll),pl}addHCMFilter(pt,Ct){var Vl;const $t=`${pt}-${Ct}`;if(bt(this,Pt)===$t)return bt(this,at);if(ul(this,Pt,$t),ul(this,at,"none"),(Vl=bt(this,Ht))==null||Vl.remove(),!pt||!Ct)return bt(this,at);const dl=nl(this,il,te).call(this,pt);pt=p.Util.makeHexColor(...dl);const rl=nl(this,il,te).call(this,Ct);if(Ct=p.Util.makeHexColor(...rl),bt(this,et,Hl).style.color="",pt==="#000000"&&Ct==="#ffffff"||pt===Ct)return bt(this,at);const Yl=new Array(256);for(let _t=0;_t<=255;_t++){const ot=_t/255;Yl[_t]=ot<=.03928?ot/12.92:((ot+.055)/1.055)**2.4}const Xl=Yl.join(","),pl=`g_${bt(this,Ut)}_hcm_filter`,Ll=ul(this,R,nl(this,Jt,ne).call(this,pl));nl(this,cl,$l).call(this,Xl,Xl,Xl,Ll),nl(this,Rt,ge).call(this,Ll);const yl=(_t,ot)=>{const ut=dl[_t]/255,Tt=rl[_t]/255,jt=new Array(ot+1);for(let Ot=0;Ot<=ot;Ot++)jt[Ot]=ut+Ot/ot*(Tt-ut);return jt.join(",")};return nl(this,cl,$l).call(this,yl(0,5),yl(1,5),yl(2,5),Ll),ul(this,at,`url(#${pl})`),bt(this,at)}addHighlightHCMFilter(pt,Ct,$t,dl){var Tt;const rl=`${pt}-${Ct}-${$t}-${dl}`;if(bt(this,w)===rl)return bt(this,X);if(ul(this,w,rl),ul(this,X,"none"),(Tt=bt(this,R))==null||Tt.remove(),!pt||!Ct)return bt(this,X);const[Yl,Xl]=[pt,Ct].map(nl(this,il,te).bind(this));let pl=Math.round(.2126*Yl[0]+.7152*Yl[1]+.0722*Yl[2]),Ll=Math.round(.2126*Xl[0]+.7152*Xl[1]+.0722*Xl[2]),[yl,Vl]=[$t,dl].map(nl(this,il,te).bind(this));Ll<pl&&([pl,Ll,yl,Vl]=[Ll,pl,Vl,yl]),bt(this,et,Hl).style.color="";const _t=(jt,Ot,Lt)=>{const yt=new Array(256),Kt=(Ll-pl)/Lt,tl=jt/255,el=(Ot-jt)/(255*Lt);let ol=0;for(let Qt=0;Qt<=Lt;Qt++){const Ml=Math.round(pl+Qt*Kt),hl=tl+Qt*el;for(let Il=ol;Il<=Ml;Il++)yt[Il]=hl;ol=Ml+1}for(let Qt=ol;Qt<256;Qt++)yt[Qt]=yt[ol-1];return yt.join(",")},ot=`g_${bt(this,Ut)}_hcm_highlight_filter`,ut=ul(this,R,nl(this,Jt,ne).call(this,ot));return nl(this,Rt,ge).call(this,ut),nl(this,cl,$l).call(this,_t(yl[0],Vl[0],5),_t(yl[1],Vl[1],5),_t(yl[2],Vl[2],5),ut),ul(this,X,`url(#${ot})`),bt(this,X)}destroy(pt=!1){pt&&(bt(this,at)||bt(this,X))||(bt(this,Nt)&&(bt(this,Nt).parentNode.parentNode.remove(),ul(this,Nt,null)),bt(this,Gt)&&(bt(this,Gt).clear(),ul(this,Gt,null)),ul(this,C,0))}}Gt=new WeakMap,Nt=new WeakMap,Ut=new WeakMap,Vt=new WeakMap,Ht=new WeakMap,Pt=new WeakMap,at=new WeakMap,R=new WeakMap,w=new WeakMap,X=new WeakMap,C=new WeakMap,H=new WeakSet,Pl=function(){return bt(this,Gt)||ul(this,Gt,new Map)},et=new WeakSet,Hl=function(){if(!bt(this,Nt)){const pt=bt(this,Vt).createElement("div"),{style:Ct}=pt;Ct.visibility="hidden",Ct.contain="strict",Ct.width=Ct.height=0,Ct.position="absolute",Ct.top=Ct.left=0,Ct.zIndex=-1;const $t=bt(this,Vt).createElementNS(B,"svg");$t.setAttribute("width",0),$t.setAttribute("height",0),ul(this,Nt,bt(this,Vt).createElementNS(B,"defs")),pt.append($t),$t.append(bt(this,Nt)),bt(this,Vt).body.append(pt)}return bt(this,Nt)},Rt=new WeakSet,ge=function(pt){const Ct=bt(this,Vt).createElementNS(B,"feColorMatrix");Ct.setAttribute("type","matrix"),Ct.setAttribute("values","0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0 0 0 1 0"),pt.append(Ct)},Jt=new WeakSet,ne=function(pt){const Ct=bt(this,Vt).createElementNS(B,"filter");return Ct.setAttribute("color-interpolation-filters","sRGB"),Ct.setAttribute("id",pt),bt(this,et,Hl).append(Ct),Ct},qt=new WeakSet,Ze=function(pt,Ct,$t){const dl=bt(this,Vt).createElementNS(B,Ct);dl.setAttribute("type","discrete"),dl.setAttribute("tableValues",$t),pt.append(dl)},cl=new WeakSet,$l=function(pt,Ct,$t,dl){const rl=bt(this,Vt).createElementNS(B,"feComponentTransfer");dl.append(rl),nl(this,qt,Ze).call(this,rl,"feFuncR",pt),nl(this,qt,Ze).call(this,rl,"feFuncG",Ct),nl(this,qt,Ze).call(this,rl,"feFuncB",$t)},il=new WeakSet,te=function(pt){return bt(this,et,Hl).style.color=pt,dt(getComputedStyle(bt(this,et,Hl)).getPropertyValue("color"))},r.DOMFilterFactory=U;class O extends M.BaseCanvasFactory{constructor({ownerDocument:wt=globalThis.document}={}){super(),this._document=wt}_createCanvas(wt,pt){const Ct=this._document.createElement("canvas");return Ct.width=wt,Ct.height=pt,Ct}}r.DOMCanvasFactory=O;async function I(Ft,wt=!1){if(v(Ft,document.baseURI)){const pt=await fetch(Ft);if(!pt.ok)throw new Error(pt.statusText);return wt?new Uint8Array(await pt.arrayBuffer()):(0,p.stringToBytes)(await pt.text())}return new Promise((pt,Ct)=>{const $t=new XMLHttpRequest;$t.open("GET",Ft,!0),wt&&($t.responseType="arraybuffer"),$t.onreadystatechange=()=>{if($t.readyState===XMLHttpRequest.DONE){if($t.status===200||$t.status===0){let dl;if(wt&&$t.response?dl=new Uint8Array($t.response):!wt&&$t.responseText&&(dl=(0,p.stringToBytes)($t.responseText)),dl){pt(dl);return}}Ct(new Error($t.statusText))}},$t.send(null)})}class j extends M.BaseCMapReaderFactory{_fetchData(wt,pt){return I(wt,this.isCompressed).then(Ct=>({cMapData:Ct,compressionType:pt}))}}r.DOMCMapReaderFactory=j;class q extends M.BaseStandardFontDataFactory{_fetchData(wt){return I(wt,!0)}}r.DOMStandardFontDataFactory=q;class K extends M.BaseSVGFactory{_createSVG(wt){return document.createElementNS(B,wt)}}r.DOMSVGFactory=K;class f{constructor({viewBox:wt,scale:pt,rotation:Ct,offsetX:$t=0,offsetY:dl=0,dontFlip:rl=!1}){this.viewBox=wt,this.scale=pt,this.rotation=Ct,this.offsetX=$t,this.offsetY=dl;const Yl=(wt[2]+wt[0])/2,Xl=(wt[3]+wt[1])/2;let pl,Ll,yl,Vl;switch(Ct%=360,Ct<0&&(Ct+=360),Ct){case 180:pl=-1,Ll=0,yl=0,Vl=1;break;case 90:pl=0,Ll=1,yl=1,Vl=0;break;case 270:pl=0,Ll=-1,yl=-1,Vl=0;break;case 0:pl=1,Ll=0,yl=0,Vl=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}rl&&(yl=-yl,Vl=-Vl);let _t,ot,ut,Tt;pl===0?(_t=Math.abs(Xl-wt[1])*pt+$t,ot=Math.abs(Yl-wt[0])*pt+dl,ut=(wt[3]-wt[1])*pt,Tt=(wt[2]-wt[0])*pt):(_t=Math.abs(Yl-wt[0])*pt+$t,ot=Math.abs(Xl-wt[1])*pt+dl,ut=(wt[2]-wt[0])*pt,Tt=(wt[3]-wt[1])*pt),this.transform=[pl*pt,Ll*pt,yl*pt,Vl*pt,_t-pl*pt*Yl-yl*pt*Xl,ot-Ll*pt*Yl-Vl*pt*Xl],this.width=ut,this.height=Tt}get rawDims(){const{viewBox:wt}=this;return(0,p.shadow)(this,"rawDims",{pageWidth:wt[2]-wt[0],pageHeight:wt[3]-wt[1],pageX:wt[0],pageY:wt[1]})}clone({scale:wt=this.scale,rotation:pt=this.rotation,offsetX:Ct=this.offsetX,offsetY:$t=this.offsetY,dontFlip:dl=!1}={}){return new f({viewBox:this.viewBox.slice(),scale:wt,rotation:pt,offsetX:Ct,offsetY:$t,dontFlip:dl})}convertToViewportPoint(wt,pt){return p.Util.applyTransform([wt,pt],this.transform)}convertToViewportRectangle(wt){const pt=p.Util.applyTransform([wt[0],wt[1]],this.transform),Ct=p.Util.applyTransform([wt[2],wt[3]],this.transform);return[pt[0],pt[1],Ct[0],Ct[1]]}convertToPdfPoint(wt,pt){return p.Util.applyInverseTransform([wt,pt],this.transform)}}r.PageViewport=f;class S extends p.BaseException{constructor(wt,pt=0){super(wt,"RenderingCancelledException"),this.extraDelay=pt}}r.RenderingCancelledException=S;function k(Ft){const wt=Ft.length;let pt=0;for(;pt<wt&&Ft[pt].trim()==="";)pt++;return Ft.substring(pt,pt+5).toLowerCase()==="data:"}function T(Ft){return typeof Ft=="string"&&/\.pdf$/i.test(Ft)}function g(Ft,wt=!1){return wt||([Ft]=Ft.split(/[#?]/,1)),Ft.substring(Ft.lastIndexOf("/")+1)}function F(Ft,wt="document.pdf"){if(typeof Ft!="string")return wt;if(k(Ft))return(0,p.warn)('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),wt;const pt=/^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/,Ct=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i,$t=pt.exec(Ft);let dl=Ct.exec($t[1])||Ct.exec($t[2])||Ct.exec($t[3]);if(dl&&(dl=dl[0],dl.includes("%")))try{dl=Ct.exec(decodeURIComponent(dl))[0]}catch{}return dl||wt}class J{constructor(){gl(this,"started",Object.create(null));gl(this,"times",[])}time(wt){wt in this.started&&(0,p.warn)(`Timer is already running for ${wt}`),this.started[wt]=Date.now()}timeEnd(wt){wt in this.started||(0,p.warn)(`Timer has not been started for ${wt}`),this.times.push({name:wt,start:this.started[wt],end:Date.now()}),delete this.started[wt]}toString(){const wt=[];let pt=0;for(const{name:Ct}of this.times)pt=Math.max(Ct.length,pt);for(const{name:Ct,start:$t,end:dl}of this.times)wt.push(`${Ct.padEnd(pt)} ${dl-$t}ms
|
|
2
2
|
`);return wt.join("")}}r.StatTimer=J;function v(Ft,wt){try{const{protocol:pt}=wt?new URL(Ft,wt):new URL(Ft);return pt==="http:"||pt==="https:"}catch{return!1}}function u(Ft){Ft.preventDefault()}function m(Ft,wt=!1){return new Promise((pt,Ct)=>{const $t=document.createElement("script");$t.src=Ft,$t.onload=function(dl){wt&&$t.remove(),pt(dl)},$t.onerror=function(){Ct(new Error(`Cannot load script at: ${$t.src}`))},(document.head||document.documentElement).append($t)})}function _(Ft){console.log("Deprecated API usage: "+Ft)}let $;class P{static toDateObject(wt){if(!wt||typeof wt!="string")return null;$||($=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"));const pt=$.exec(wt);if(!pt)return null;const Ct=parseInt(pt[1],10);let $t=parseInt(pt[2],10);$t=$t>=1&&$t<=12?$t-1:0;let dl=parseInt(pt[3],10);dl=dl>=1&&dl<=31?dl:1;let rl=parseInt(pt[4],10);rl=rl>=0&&rl<=23?rl:0;let Yl=parseInt(pt[5],10);Yl=Yl>=0&&Yl<=59?Yl:0;let Xl=parseInt(pt[6],10);Xl=Xl>=0&&Xl<=59?Xl:0;const pl=pt[7]||"Z";let Ll=parseInt(pt[8],10);Ll=Ll>=0&&Ll<=23?Ll:0;let yl=parseInt(pt[9],10)||0;return yl=yl>=0&&yl<=59?yl:0,pl==="-"?(rl+=Ll,Yl+=yl):pl==="+"&&(rl-=Ll,Yl-=yl),new Date(Date.UTC(Ct,$t,dl,rl,Yl,Xl))}}r.PDFDateString=P;function Zt(Ft,{scale:wt=1,rotation:pt=0}){const{width:Ct,height:$t}=Ft.attributes.style,dl=[0,0,parseInt(Ct),parseInt($t)];return new f({viewBox:dl,scale:wt,rotation:pt})}function dt(Ft){if(Ft.startsWith("#")){const wt=parseInt(Ft.slice(1),16);return[(wt&16711680)>>16,(wt&65280)>>8,wt&255]}return Ft.startsWith("rgb(")?Ft.slice(4,-1).split(",").map(wt=>parseInt(wt)):Ft.startsWith("rgba(")?Ft.slice(5,-1).split(",").map(wt=>parseInt(wt)).slice(0,3):((0,p.warn)(`Not a valid color format: "${Ft}"`),[0,0,0])}function It(Ft){const wt=document.createElement("span");wt.style.visibility="hidden",document.body.append(wt);for(const pt of Ft.keys()){wt.style.color=pt;const Ct=window.getComputedStyle(wt).color;Ft.set(pt,dt(Ct))}wt.remove()}function xt(Ft){const{a:wt,b:pt,c:Ct,d:$t,e:dl,f:rl}=Ft.getTransform();return[wt,pt,Ct,$t,dl,rl]}function it(Ft){const{a:wt,b:pt,c:Ct,d:$t,e:dl,f:rl}=Ft.getTransform().invertSelf();return[wt,pt,Ct,$t,dl,rl]}function Xt(Ft,wt,pt=!1,Ct=!0){if(wt instanceof f){const{pageWidth:$t,pageHeight:dl}=wt.rawDims,{style:rl}=Ft,Yl=p.FeatureTest.isCSSRoundSupported,Xl=`var(--scale-factor) * ${$t}px`,pl=`var(--scale-factor) * ${dl}px`,Ll=Yl?`round(${Xl}, 1px)`:`calc(${Xl})`,yl=Yl?`round(${pl}, 1px)`:`calc(${pl})`;!pt||wt.rotation%180===0?(rl.width=Ll,rl.height=yl):(rl.width=yl,rl.height=Ll)}Ct&&Ft.setAttribute("data-main-rotation",wt.rotation)}},(lt,r,h)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BaseStandardFontDataFactory=r.BaseSVGFactory=r.BaseFilterFactory=r.BaseCanvasFactory=r.BaseCMapReaderFactory=void 0;var M=h(1);class p{constructor(){this.constructor===p&&(0,M.unreachable)("Cannot initialize BaseFilterFactory.")}addFilter(j){return"none"}addHCMFilter(j,q){return"none"}addHighlightHCMFilter(j,q,K,f){return"none"}destroy(j=!1){}}r.BaseFilterFactory=p;class B{constructor(){this.constructor===B&&(0,M.unreachable)("Cannot initialize BaseCanvasFactory.")}create(j,q){if(j<=0||q<=0)throw new Error("Invalid canvas size");const K=this._createCanvas(j,q);return{canvas:K,context:K.getContext("2d")}}reset(j,q,K){if(!j.canvas)throw new Error("Canvas is not specified");if(q<=0||K<=0)throw new Error("Invalid canvas size");j.canvas.width=q,j.canvas.height=K}destroy(j){if(!j.canvas)throw new Error("Canvas is not specified");j.canvas.width=0,j.canvas.height=0,j.canvas=null,j.context=null}_createCanvas(j,q){(0,M.unreachable)("Abstract method `_createCanvas` called.")}}r.BaseCanvasFactory=B;class Q{constructor({baseUrl:j=null,isCompressed:q=!0}){this.constructor===Q&&(0,M.unreachable)("Cannot initialize BaseCMapReaderFactory."),this.baseUrl=j,this.isCompressed=q}async fetch({name:j}){if(!this.baseUrl)throw new Error('The CMap "baseUrl" parameter must be specified, ensure that the "cMapUrl" and "cMapPacked" API parameters are provided.');if(!j)throw new Error("CMap name must be specified.");const q=this.baseUrl+j+(this.isCompressed?".bcmap":""),K=this.isCompressed?M.CMapCompressionType.BINARY:M.CMapCompressionType.NONE;return this._fetchData(q,K).catch(f=>{throw new Error(`Unable to load ${this.isCompressed?"binary ":""}CMap at: ${q}`)})}_fetchData(j,q){(0,M.unreachable)("Abstract method `_fetchData` called.")}}r.BaseCMapReaderFactory=Q;class U{constructor({baseUrl:j=null}){this.constructor===U&&(0,M.unreachable)("Cannot initialize BaseStandardFontDataFactory."),this.baseUrl=j}async fetch({filename:j}){if(!this.baseUrl)throw new Error('The standard font "baseUrl" parameter must be specified, ensure that the "standardFontDataUrl" API parameter is provided.');if(!j)throw new Error("Font filename must be specified.");const q=`${this.baseUrl}${j}`;return this._fetchData(q).catch(K=>{throw new Error(`Unable to load font data at: ${q}`)})}_fetchData(j){(0,M.unreachable)("Abstract method `_fetchData` called.")}}r.BaseStandardFontDataFactory=U;class O{constructor(){this.constructor===O&&(0,M.unreachable)("Cannot initialize BaseSVGFactory.")}create(j,q,K=!1){if(j<=0||q<=0)throw new Error("Invalid SVG dimensions");const f=this._createSVG("svg:svg");return f.setAttribute("version","1.1"),K||(f.setAttribute("width",`${j}px`),f.setAttribute("height",`${q}px`)),f.setAttribute("preserveAspectRatio","none"),f.setAttribute("viewBox",`0 0 ${j} ${q}`),f}createElement(j){if(typeof j!="string")throw new Error("Invalid SVG element type");return this._createSVG(j)}_createSVG(j){(0,M.unreachable)("Abstract method `_createSVG` called.")}}r.BaseSVGFactory=O},(lt,r,h)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.MurmurHash3_64=void 0;var M=h(1);const p=3285377520,B=4294901760,Q=65535;class U{constructor(I){this.h1=I?I&4294967295:p,this.h2=I?I&4294967295:p}update(I){let j,q;if(typeof I=="string"){j=new Uint8Array(I.length*2),q=0;for(let _=0,$=I.length;_<$;_++){const P=I.charCodeAt(_);P<=255?j[q++]=P:(j[q++]=P>>>8,j[q++]=P&255)}}else if((0,M.isArrayBuffer)(I))j=I.slice(),q=j.byteLength;else throw new Error("Wrong data format in MurmurHash3_64_update. Input must be a string or array.");const K=q>>2,f=q-K*4,S=new Uint32Array(j.buffer,0,K);let k=0,T=0,g=this.h1,F=this.h2;const J=3432918353,v=461845907,u=J&Q,m=v&Q;for(let _=0;_<K;_++)_&1?(k=S[_],k=k*J&B|k*u&Q,k=k<<15|k>>>17,k=k*v&B|k*m&Q,g^=k,g=g<<13|g>>>19,g=g*5+3864292196):(T=S[_],T=T*J&B|T*u&Q,T=T<<15|T>>>17,T=T*v&B|T*m&Q,F^=T,F=F<<13|F>>>19,F=F*5+3864292196);switch(k=0,f){case 3:k^=j[K*4+2]<<16;case 2:k^=j[K*4+1]<<8;case 1:k^=j[K*4],k=k*J&B|k*u&Q,k=k<<15|k>>>17,k=k*v&B|k*m&Q,K&1?g^=k:F^=k}this.h1=g,this.h2=F}hexdigest(){let I=this.h1,j=this.h2;return I^=j>>>1,I=I*3981806797&B|I*36045&Q,j=j*4283543511&B|((j<<16|I>>>16)*2950163797&B)>>>16,I^=j>>>1,I=I*444984403&B|I*60499&Q,j=j*3301882366&B|((j<<16|I>>>16)*3120437893&B)>>>16,I^=j>>>1,(I>>>0).toString(16).padStart(8,"0")+(j>>>0).toString(16).padStart(8,"0")}}r.MurmurHash3_64=U},(lt,r,h)=>{var Q;Object.defineProperty(r,"__esModule",{value:!0}),r.FontLoader=r.FontFaceObject=void 0;var M=h(1);class p{constructor({ownerDocument:O=globalThis.document,styleElement:I=null}){ll(this,Q,new Set);this._document=O,this.nativeFontFaces=new Set,this.styleElement=null,this.loadingRequests=[],this.loadTestFontId=0}addNativeFontFace(O){this.nativeFontFaces.add(O),this._document.fonts.add(O)}removeNativeFontFace(O){this.nativeFontFaces.delete(O),this._document.fonts.delete(O)}insertRule(O){this.styleElement||(this.styleElement=this._document.createElement("style"),this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement));const I=this.styleElement.sheet;I.insertRule(O,I.cssRules.length)}clear(){for(const O of this.nativeFontFaces)this._document.fonts.delete(O);this.nativeFontFaces.clear(),bt(this,Q).clear(),this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async loadSystemFont(O){if(!(!O||bt(this,Q).has(O.loadedName))){if((0,M.assert)(!this.disableFontFace,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){const{loadedName:I,src:j,style:q}=O,K=new FontFace(I,j,q);this.addNativeFontFace(K);try{await K.load(),bt(this,Q).add(I)}catch{(0,M.warn)(`Cannot load system font: ${O.baseFontName}, installing it could help to improve PDF rendering.`),this.removeNativeFontFace(K)}return}(0,M.unreachable)("Not implemented: loadSystemFont without the Font Loading API.")}}async bind(O){if(O.attached||O.missingFile&&!O.systemFontInfo)return;if(O.attached=!0,O.systemFontInfo){await this.loadSystemFont(O.systemFontInfo);return}if(this.isFontLoadingAPISupported){const j=O.createNativeFontFace();if(j){this.addNativeFontFace(j);try{await j.loaded}catch(q){throw(0,M.warn)(`Failed to load font '${j.family}': '${q}'.`),O.disableFontFace=!0,q}}return}const I=O.createFontFaceRule();if(I){if(this.insertRule(I),this.isSyncFontLoadingSupported)return;await new Promise(j=>{const q=this._queueLoadingCallback(j);this._prepareFontLoadEvent(O,q)})}}get isFontLoadingAPISupported(){var I;const O=!!((I=this._document)!=null&&I.fonts);return(0,M.shadow)(this,"isFontLoadingAPISupported",O)}get isSyncFontLoadingSupported(){let O=!1;return(M.isNodeJS||typeof navigator<"u"&&/Mozilla\/5.0.*?rv:\d+.*? Gecko/.test(navigator.userAgent))&&(O=!0),(0,M.shadow)(this,"isSyncFontLoadingSupported",O)}_queueLoadingCallback(O){function I(){for((0,M.assert)(!q.done,"completeRequest() cannot be called twice."),q.done=!0;j.length>0&&j[0].done;){const K=j.shift();setTimeout(K.callback,0)}}const{loadingRequests:j}=this,q={done:!1,complete:I,callback:O};return j.push(q),q}get _loadTestFont(){const O=atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==");return(0,M.shadow)(this,"_loadTestFont",O)}_prepareFontLoadEvent(O,I){function j(dt,It){return dt.charCodeAt(It)<<24|dt.charCodeAt(It+1)<<16|dt.charCodeAt(It+2)<<8|dt.charCodeAt(It+3)&255}function q(dt,It,xt,it){const Xt=dt.substring(0,It),zt=dt.substring(It+xt);return Xt+it+zt}let K,f;const S=this._document.createElement("canvas");S.width=1,S.height=1;const k=S.getContext("2d");let T=0;function g(dt,It){if(++T>30){(0,M.warn)("Load test font never loaded."),It();return}if(k.font="30px "+dt,k.fillText(".",0,20),k.getImageData(0,0,1,1).data[3]>0){It();return}setTimeout(g.bind(null,dt,It))}const F=`lt${Date.now()}${this.loadTestFontId++}`;let J=this._loadTestFont;J=q(J,976,F.length,F);const u=16,m=1482184792;let _=j(J,u);for(K=0,f=F.length-3;K<f;K+=4)_=_-m+j(F,K)|0;K<F.length&&(_=_-m+j(F+"XXX",K)|0),J=q(J,u,4,(0,M.string32)(_));const $=`url(data:font/opentype;base64,${btoa(J)});`,P=`@font-face {font-family:"${F}";src:${$}}`;this.insertRule(P);const Zt=this._document.createElement("div");Zt.style.visibility="hidden",Zt.style.width=Zt.style.height="10px",Zt.style.position="absolute",Zt.style.top=Zt.style.left="0px";for(const dt of[O.loadedName,F]){const It=this._document.createElement("span");It.textContent="Hi",It.style.fontFamily=dt,Zt.append(It)}this._document.body.append(Zt),g(F,()=>{Zt.remove(),I.complete()})}}Q=new WeakMap,r.FontLoader=p;class B{constructor(O,{isEvalSupported:I=!0,disableFontFace:j=!1,ignoreErrors:q=!1,inspectFont:K=null}){this.compiledGlyphs=Object.create(null);for(const f in O)this[f]=O[f];this.isEvalSupported=I!==!1,this.disableFontFace=j===!0,this.ignoreErrors=q===!0,this._inspectFont=K}createNativeFontFace(){var I;if(!this.data||this.disableFontFace)return null;let O;if(!this.cssFontInfo)O=new FontFace(this.loadedName,this.data,{});else{const j={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(j.style=`oblique ${this.cssFontInfo.italicAngle}deg`),O=new FontFace(this.cssFontInfo.fontFamily,this.data,j)}return(I=this._inspectFont)==null||I.call(this,this),O}createFontFaceRule(){var q;if(!this.data||this.disableFontFace)return null;const O=(0,M.bytesToString)(this.data),I=`url(data:${this.mimetype};base64,${btoa(O)});`;let j;if(!this.cssFontInfo)j=`@font-face {font-family:"${this.loadedName}";src:${I}}`;else{let K=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(K+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`),j=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${K}src:${I}}`}return(q=this._inspectFont)==null||q.call(this,this,I),j}getPathGenerator(O,I){if(this.compiledGlyphs[I]!==void 0)return this.compiledGlyphs[I];let j;try{j=O.get(this.loadedName+"_path_"+I)}catch(q){if(!this.ignoreErrors)throw q;return(0,M.warn)(`getPathGenerator - ignoring character: "${q}".`),this.compiledGlyphs[I]=function(K,f){}}if(this.isEvalSupported&&M.FeatureTest.isEvalSupported){const q=[];for(const K of j){const f=K.args!==void 0?K.args.join(","):"";q.push("c.",K.cmd,"(",f,`);
|
|
3
3
|
`)}return this.compiledGlyphs[I]=new Function("c","size",q.join(""))}return this.compiledGlyphs[I]=function(q,K){for(const f of j)f.cmd==="scale"&&(f.args=[K,-K]),q[f.cmd].apply(q,f.args)}}}r.FontFaceObject=B},(lt,r,h)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.NodeStandardFontDataFactory=r.NodeFilterFactory=r.NodeCanvasFactory=r.NodeCMapReaderFactory=void 0;var M=h(7);h(1);const p=function(I){return new Promise((j,q)=>{require$$5.readFile(I,(f,S)=>{if(f||!S){q(new Error(f));return}j(new Uint8Array(S))})})};class B extends M.BaseFilterFactory{}r.NodeFilterFactory=B;class Q extends M.BaseCanvasFactory{_createCanvas(j,q){return require$$5.createCanvas(j,q)}}r.NodeCanvasFactory=Q;class U extends M.BaseCMapReaderFactory{_fetchData(j,q){return p(j).then(K=>({cMapData:K,compressionType:q}))}}r.NodeCMapReaderFactory=U;class O extends M.BaseStandardFontDataFactory{_fetchData(j){return p(j)}}r.NodeStandardFontDataFactory=O},(lt,r,h)=>{var Nt,De,Vt,je;Object.defineProperty(r,"__esModule",{value:!0}),r.CanvasGraphics=void 0;var M=h(1),p=h(6),B=h(12),Q=h(13);const U=16,O=100,I=4096,j=15,q=10,K=1e3,f=16;function S(at,R){if(at._removeMirroring)throw new Error("Context is already forwarding operations.");at.__originalSave=at.save,at.__originalRestore=at.restore,at.__originalRotate=at.rotate,at.__originalScale=at.scale,at.__originalTranslate=at.translate,at.__originalTransform=at.transform,at.__originalSetTransform=at.setTransform,at.__originalResetTransform=at.resetTransform,at.__originalClip=at.clip,at.__originalMoveTo=at.moveTo,at.__originalLineTo=at.lineTo,at.__originalBezierCurveTo=at.bezierCurveTo,at.__originalRect=at.rect,at.__originalClosePath=at.closePath,at.__originalBeginPath=at.beginPath,at._removeMirroring=()=>{at.save=at.__originalSave,at.restore=at.__originalRestore,at.rotate=at.__originalRotate,at.scale=at.__originalScale,at.translate=at.__originalTranslate,at.transform=at.__originalTransform,at.setTransform=at.__originalSetTransform,at.resetTransform=at.__originalResetTransform,at.clip=at.__originalClip,at.moveTo=at.__originalMoveTo,at.lineTo=at.__originalLineTo,at.bezierCurveTo=at.__originalBezierCurveTo,at.rect=at.__originalRect,at.closePath=at.__originalClosePath,at.beginPath=at.__originalBeginPath,delete at._removeMirroring},at.save=function(){R.save(),this.__originalSave()},at.restore=function(){R.restore(),this.__originalRestore()},at.translate=function(X,C){R.translate(X,C),this.__originalTranslate(X,C)},at.scale=function(X,C){R.scale(X,C),this.__originalScale(X,C)},at.transform=function(X,C,H,st,et,Mt){R.transform(X,C,H,st,et,Mt),this.__originalTransform(X,C,H,st,et,Mt)},at.setTransform=function(X,C,H,st,et,Mt){R.setTransform(X,C,H,st,et,Mt),this.__originalSetTransform(X,C,H,st,et,Mt)},at.resetTransform=function(){R.resetTransform(),this.__originalResetTransform()},at.rotate=function(X){R.rotate(X),this.__originalRotate(X)},at.clip=function(X){R.clip(X),this.__originalClip(X)},at.moveTo=function(w,X){R.moveTo(w,X),this.__originalMoveTo(w,X)},at.lineTo=function(w,X){R.lineTo(w,X),this.__originalLineTo(w,X)},at.bezierCurveTo=function(w,X,C,H,st,et){R.bezierCurveTo(w,X,C,H,st,et),this.__originalBezierCurveTo(w,X,C,H,st,et)},at.rect=function(w,X,C,H){R.rect(w,X,C,H),this.__originalRect(w,X,C,H)},at.closePath=function(){R.closePath(),this.__originalClosePath()},at.beginPath=function(){R.beginPath(),this.__originalBeginPath()}}class k{constructor(R){this.canvasFactory=R,this.cache=Object.create(null)}getCanvas(R,w,X){let C;return this.cache[R]!==void 0?(C=this.cache[R],this.canvasFactory.reset(C,w,X)):(C=this.canvasFactory.create(w,X),this.cache[R]=C),C}delete(R){delete this.cache[R]}clear(){for(const R in this.cache){const w=this.cache[R];this.canvasFactory.destroy(w),delete this.cache[R]}}}function T(at,R,w,X,C,H,st,et,Mt,Rt){const[gt,Jt,Dt,qt,vt,cl]=(0,p.getCurrentTransform)(at);if(Jt===0&&Dt===0){const Bt=st*gt+vt,Ft=Math.round(Bt),wt=et*qt+cl,pt=Math.round(wt),Ct=(st+Mt)*gt+vt,$t=Math.abs(Math.round(Ct)-Ft)||1,dl=(et+Rt)*qt+cl,rl=Math.abs(Math.round(dl)-pt)||1;return at.setTransform(Math.sign(gt),0,0,Math.sign(qt),Ft,pt),at.drawImage(R,w,X,C,H,0,0,$t,rl),at.setTransform(gt,Jt,Dt,qt,vt,cl),[$t,rl]}if(gt===0&&qt===0){const Bt=et*Dt+vt,Ft=Math.round(Bt),wt=st*Jt+cl,pt=Math.round(wt),Ct=(et+Rt)*Dt+vt,$t=Math.abs(Math.round(Ct)-Ft)||1,dl=(st+Mt)*Jt+cl,rl=Math.abs(Math.round(dl)-pt)||1;return at.setTransform(0,Math.sign(Jt),Math.sign(Dt),0,Ft,pt),at.drawImage(R,w,X,C,H,0,0,rl,$t),at.setTransform(gt,Jt,Dt,qt,vt,cl),[rl,$t]}at.drawImage(R,w,X,C,H,st,et,Mt,Rt);const bl=Math.hypot(gt,Jt),il=Math.hypot(Dt,qt);return[bl*Mt,il*Rt]}function g(at){const{width:R,height:w}=at;if(R>K||w>K)return null;const X=1e3,C=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),H=R+1;let st=new Uint8Array(H*(w+1)),et,Mt,Rt;const gt=R+7&-8;let Jt=new Uint8Array(gt*w),Dt=0;for(const il of at.data){let Bt=128;for(;Bt>0;)Jt[Dt++]=il&Bt?0:255,Bt>>=1}let qt=0;for(Dt=0,Jt[Dt]!==0&&(st[0]=1,++qt),Mt=1;Mt<R;Mt++)Jt[Dt]!==Jt[Dt+1]&&(st[Mt]=Jt[Dt]?2:1,++qt),Dt++;for(Jt[Dt]!==0&&(st[Mt]=2,++qt),et=1;et<w;et++){Dt=et*gt,Rt=et*H,Jt[Dt-gt]!==Jt[Dt]&&(st[Rt]=Jt[Dt]?1:8,++qt);let il=(Jt[Dt]?4:0)+(Jt[Dt-gt]?8:0);for(Mt=1;Mt<R;Mt++)il=(il>>2)+(Jt[Dt+1]?4:0)+(Jt[Dt-gt+1]?8:0),C[il]&&(st[Rt+Mt]=C[il],++qt),Dt++;if(Jt[Dt-gt]!==Jt[Dt]&&(st[Rt+Mt]=Jt[Dt]?2:4,++qt),qt>X)return null}for(Dt=gt*(w-1),Rt=et*H,Jt[Dt]!==0&&(st[Rt]=8,++qt),Mt=1;Mt<R;Mt++)Jt[Dt]!==Jt[Dt+1]&&(st[Rt+Mt]=Jt[Dt]?4:8,++qt),Dt++;if(Jt[Dt]!==0&&(st[Rt+Mt]=4,++qt),qt>X)return null;const vt=new Int32Array([0,H,-1,0,-H,0,0,0,1]),cl=new Path2D;for(et=0;qt&&et<=w;et++){let il=et*H;const Bt=il+R;for(;il<Bt&&!st[il];)il++;if(il===Bt)continue;cl.moveTo(il%H,et);const Ft=il;let wt=st[il];do{const pt=vt[wt];do il+=pt;while(!st[il]);const Ct=st[il];Ct!==5&&Ct!==10?(wt=Ct,st[il]=0):(wt=Ct&51*wt>>4,st[il]&=wt>>2|wt<<2),cl.lineTo(il%H,il/H|0),st[il]||--qt}while(Ft!==il);--et}return Jt=null,st=null,function(il){il.save(),il.scale(1/R,-1/w),il.translate(0,-w),il.fill(cl),il.beginPath(),il.restore()}}class F{constructor(R,w){this.alphaIsShape=!1,this.fontSize=0,this.fontSizeScale=1,this.textMatrix=M.IDENTITY_MATRIX,this.textMatrixScale=1,this.fontMatrix=M.FONT_IDENTITY_MATRIX,this.leading=0,this.x=0,this.y=0,this.lineX=0,this.lineY=0,this.charSpacing=0,this.wordSpacing=0,this.textHScale=1,this.textRenderingMode=M.TextRenderingMode.FILL,this.textRise=0,this.fillColor="#000000",this.strokeColor="#000000",this.patternFill=!1,this.fillAlpha=1,this.strokeAlpha=1,this.lineWidth=1,this.activeSMask=null,this.transferMaps="none",this.startNewPathAndClipBox([0,0,R,w])}clone(){const R=Object.create(this);return R.clipBox=this.clipBox.slice(),R}setCurrentPoint(R,w){this.x=R,this.y=w}updatePathMinMax(R,w,X){[w,X]=M.Util.applyTransform([w,X],R),this.minX=Math.min(this.minX,w),this.minY=Math.min(this.minY,X),this.maxX=Math.max(this.maxX,w),this.maxY=Math.max(this.maxY,X)}updateRectMinMax(R,w){const X=M.Util.applyTransform(w,R),C=M.Util.applyTransform(w.slice(2),R);this.minX=Math.min(this.minX,X[0],C[0]),this.minY=Math.min(this.minY,X[1],C[1]),this.maxX=Math.max(this.maxX,X[0],C[0]),this.maxY=Math.max(this.maxY,X[1],C[1])}updateScalingPathMinMax(R,w){M.Util.scaleMinMax(R,w),this.minX=Math.min(this.minX,w[0]),this.maxX=Math.max(this.maxX,w[1]),this.minY=Math.min(this.minY,w[2]),this.maxY=Math.max(this.maxY,w[3])}updateCurvePathMinMax(R,w,X,C,H,st,et,Mt,Rt,gt){const Jt=M.Util.bezierBoundingBox(w,X,C,H,st,et,Mt,Rt);if(gt){gt[0]=Math.min(gt[0],Jt[0],Jt[2]),gt[1]=Math.max(gt[1],Jt[0],Jt[2]),gt[2]=Math.min(gt[2],Jt[1],Jt[3]),gt[3]=Math.max(gt[3],Jt[1],Jt[3]);return}this.updateRectMinMax(R,Jt)}getPathBoundingBox(R=B.PathType.FILL,w=null){const X=[this.minX,this.minY,this.maxX,this.maxY];if(R===B.PathType.STROKE){w||(0,M.unreachable)("Stroke bounding box must include transform.");const C=M.Util.singularValueDecompose2dScale(w),H=C[0]*this.lineWidth/2,st=C[1]*this.lineWidth/2;X[0]-=H,X[1]-=st,X[2]+=H,X[3]+=st}return X}updateClipFromPath(){const R=M.Util.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(R||[0,0,0,0])}isEmptyClip(){return this.minX===1/0}startNewPathAndClipBox(R){this.clipBox=R,this.minX=1/0,this.minY=1/0,this.maxX=0,this.maxY=0}getClippedPathBoundingBox(R=B.PathType.FILL,w=null){return M.Util.intersect(this.clipBox,this.getPathBoundingBox(R,w))}}function J(at,R){if(typeof ImageData<"u"&&R instanceof ImageData){at.putImageData(R,0,0);return}const w=R.height,X=R.width,C=w%f,H=(w-C)/f,st=C===0?H:H+1,et=at.createImageData(X,f);let Mt=0,Rt;const gt=R.data,Jt=et.data;let Dt,qt,vt,cl;if(R.kind===M.ImageKind.GRAYSCALE_1BPP){const bl=gt.byteLength,il=new Uint32Array(Jt.buffer,0,Jt.byteLength>>2),Bt=il.length,Ft=X+7>>3,wt=4294967295,pt=M.FeatureTest.isLittleEndian?4278190080:255;for(Dt=0;Dt<st;Dt++){for(vt=Dt<H?f:C,Rt=0,qt=0;qt<vt;qt++){const Ct=bl-Mt;let $t=0;const dl=Ct>Ft?X:Ct*8-7,rl=dl&-8;let Yl=0,Xl=0;for(;$t<rl;$t+=8)Xl=gt[Mt++],il[Rt++]=Xl&128?wt:pt,il[Rt++]=Xl&64?wt:pt,il[Rt++]=Xl&32?wt:pt,il[Rt++]=Xl&16?wt:pt,il[Rt++]=Xl&8?wt:pt,il[Rt++]=Xl&4?wt:pt,il[Rt++]=Xl&2?wt:pt,il[Rt++]=Xl&1?wt:pt;for(;$t<dl;$t++)Yl===0&&(Xl=gt[Mt++],Yl=128),il[Rt++]=Xl&Yl?wt:pt,Yl>>=1}for(;Rt<Bt;)il[Rt++]=0;at.putImageData(et,0,Dt*f)}}else if(R.kind===M.ImageKind.RGBA_32BPP){for(qt=0,cl=X*f*4,Dt=0;Dt<H;Dt++)Jt.set(gt.subarray(Mt,Mt+cl)),Mt+=cl,at.putImageData(et,0,qt),qt+=f;Dt<st&&(cl=X*C*4,Jt.set(gt.subarray(Mt,Mt+cl)),at.putImageData(et,0,qt))}else if(R.kind===M.ImageKind.RGB_24BPP)for(vt=f,cl=X*vt,Dt=0;Dt<st;Dt++){for(Dt>=H&&(vt=C,cl=X*vt),Rt=0,qt=cl;qt--;)Jt[Rt++]=gt[Mt++],Jt[Rt++]=gt[Mt++],Jt[Rt++]=gt[Mt++],Jt[Rt++]=255;at.putImageData(et,0,Dt*f)}else throw new Error(`bad image kind: ${R.kind}`)}function v(at,R){if(R.bitmap){at.drawImage(R.bitmap,0,0);return}const w=R.height,X=R.width,C=w%f,H=(w-C)/f,st=C===0?H:H+1,et=at.createImageData(X,f);let Mt=0;const Rt=R.data,gt=et.data;for(let Jt=0;Jt<st;Jt++){const Dt=Jt<H?f:C;({srcPos:Mt}=(0,Q.convertBlackAndWhiteToRGBA)({src:Rt,srcPos:Mt,dest:gt,width:X,height:Dt,nonBlackColor:0})),at.putImageData(et,0,Jt*f)}}function u(at,R){const w=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font","filter"];for(const X of w)at[X]!==void 0&&(R[X]=at[X]);at.setLineDash!==void 0&&(R.setLineDash(at.getLineDash()),R.lineDashOffset=at.lineDashOffset)}function m(at){if(at.strokeStyle=at.fillStyle="#000000",at.fillRule="nonzero",at.globalAlpha=1,at.lineWidth=1,at.lineCap="butt",at.lineJoin="miter",at.miterLimit=10,at.globalCompositeOperation="source-over",at.font="10px sans-serif",at.setLineDash!==void 0&&(at.setLineDash([]),at.lineDashOffset=0),!M.isNodeJS){const{filter:R}=at;R!=="none"&&R!==""&&(at.filter="none")}}function _(at,R,w,X){const C=at.length;for(let H=3;H<C;H+=4){const st=at[H];if(st===0)at[H-3]=R,at[H-2]=w,at[H-1]=X;else if(st<255){const et=255-st;at[H-3]=at[H-3]*st+R*et>>8,at[H-2]=at[H-2]*st+w*et>>8,at[H-1]=at[H-1]*st+X*et>>8}}}function $(at,R,w){const X=at.length,C=1/255;for(let H=3;H<X;H+=4){const st=w?w[at[H]]:at[H];R[H]=R[H]*st*C|0}}function P(at,R,w){const X=at.length;for(let C=3;C<X;C+=4){const H=at[C-3]*77+at[C-2]*152+at[C-1]*28;R[C]=w?R[C]*w[H>>8]>>8:R[C]*H>>16}}function Zt(at,R,w,X,C,H,st,et,Mt,Rt,gt){const Jt=!!H,Dt=Jt?H[0]:0,qt=Jt?H[1]:0,vt=Jt?H[2]:0,cl=C==="Luminosity"?P:$,il=Math.min(X,Math.ceil(1048576/w));for(let Bt=0;Bt<X;Bt+=il){const Ft=Math.min(il,X-Bt),wt=at.getImageData(et-Rt,Bt+(Mt-gt),w,Ft),pt=R.getImageData(et,Bt+Mt,w,Ft);Jt&&_(wt.data,Dt,qt,vt),cl(wt.data,pt.data,st),R.putImageData(pt,et,Bt+Mt)}}function dt(at,R,w,X){const C=X[0],H=X[1],st=X[2]-C,et=X[3]-H;st===0||et===0||(Zt(R.context,w,st,et,R.subtype,R.backdrop,R.transferMap,C,H,R.offsetX,R.offsetY),at.save(),at.globalAlpha=1,at.globalCompositeOperation="source-over",at.setTransform(1,0,0,1,0,0),at.drawImage(w.canvas,0,0),at.restore())}function It(at,R){const w=M.Util.singularValueDecompose2dScale(at);w[0]=Math.fround(w[0]),w[1]=Math.fround(w[1]);const X=Math.fround((globalThis.devicePixelRatio||1)*p.PixelsPerInch.PDF_TO_CSS_UNITS);return R!==void 0?R:w[0]<=X||w[1]<=X}const xt=["butt","round","square"],it=["miter","round","bevel"],Xt={},zt={},Pt=class Pt{constructor(R,w,X,C,H,{optionalContentConfig:st,markedContentStack:et=null},Mt,Rt){ll(this,Nt);ll(this,Vt);this.ctx=R,this.current=new F(this.ctx.canvas.width,this.ctx.canvas.height),this.stateStack=[],this.pendingClip=null,this.pendingEOFill=!1,this.res=null,this.xobjs=null,this.commonObjs=w,this.objs=X,this.canvasFactory=C,this.filterFactory=H,this.groupStack=[],this.processingType3=null,this.baseTransform=null,this.baseTransformStack=[],this.groupLevel=0,this.smaskStack=[],this.smaskCounter=0,this.tempSMask=null,this.suspendedCtx=null,this.contentVisible=!0,this.markedContentStack=et||[],this.optionalContentConfig=st,this.cachedCanvases=new k(this.canvasFactory),this.cachedPatterns=new Map,this.annotationCanvasMap=Mt,this.viewportScale=1,this.outputScaleX=1,this.outputScaleY=1,this.pageColors=Rt,this._cachedScaleForStroking=[-1,0],this._cachedGetSinglePixelWidth=null,this._cachedBitmapsMap=new Map}getObject(R,w=null){return typeof R=="string"?R.startsWith("g_")?this.commonObjs.get(R):this.objs.get(R):w}beginDrawing({transform:R,viewport:w,transparency:X=!1,background:C=null}){const H=this.ctx.canvas.width,st=this.ctx.canvas.height,et=this.ctx.fillStyle;if(this.ctx.fillStyle=C||"#ffffff",this.ctx.fillRect(0,0,H,st),this.ctx.fillStyle=et,X){const Mt=this.cachedCanvases.getCanvas("transparent",H,st);this.compositeCtx=this.ctx,this.transparentCanvas=Mt.canvas,this.ctx=Mt.context,this.ctx.save(),this.ctx.transform(...(0,p.getCurrentTransform)(this.compositeCtx))}this.ctx.save(),m(this.ctx),R&&(this.ctx.transform(...R),this.outputScaleX=R[0],this.outputScaleY=R[0]),this.ctx.transform(...w.transform),this.viewportScale=w.scale,this.baseTransform=(0,p.getCurrentTransform)(this.ctx)}executeOperatorList(R,w,X,C){const H=R.argsArray,st=R.fnArray;let et=w||0;const Mt=H.length;if(Mt===et)return et;const Rt=Mt-et>q&&typeof X=="function",gt=Rt?Date.now()+j:0;let Jt=0;const Dt=this.commonObjs,qt=this.objs;let vt;for(;;){if(C!==void 0&&et===C.nextBreakPoint)return C.breakIt(et,X),et;if(vt=st[et],vt!==M.OPS.dependency)this[vt].apply(this,H[et]);else for(const cl of H[et]){const bl=cl.startsWith("g_")?Dt:qt;if(!bl.has(cl))return bl.get(cl,X),et}if(et++,et===Mt)return et;if(Rt&&++Jt>q){if(Date.now()>gt)return X(),et;Jt=0}}}endDrawing(){nl(this,Nt,De).call(this),this.cachedCanvases.clear(),this.cachedPatterns.clear();for(const R of this._cachedBitmapsMap.values()){for(const w of R.values())typeof HTMLCanvasElement<"u"&&w instanceof HTMLCanvasElement&&(w.width=w.height=0);R.clear()}this._cachedBitmapsMap.clear(),nl(this,Vt,je).call(this)}_scaleImage(R,w){const X=R.width,C=R.height;let H=Math.max(Math.hypot(w[0],w[1]),1),st=Math.max(Math.hypot(w[2],w[3]),1),et=X,Mt=C,Rt="prescale1",gt,Jt;for(;H>2&&et>1||st>2&&Mt>1;){let Dt=et,qt=Mt;H>2&&et>1&&(Dt=et>=16384?Math.floor(et/2)-1||1:Math.ceil(et/2),H/=et/Dt),st>2&&Mt>1&&(qt=Mt>=16384?Math.floor(Mt/2)-1||1:Math.ceil(Mt)/2,st/=Mt/qt),gt=this.cachedCanvases.getCanvas(Rt,Dt,qt),Jt=gt.context,Jt.clearRect(0,0,Dt,qt),Jt.drawImage(R,0,0,et,Mt,0,0,Dt,qt),R=gt.canvas,et=Dt,Mt=qt,Rt=Rt==="prescale1"?"prescale2":"prescale1"}return{img:R,paintWidth:et,paintHeight:Mt}}_createMaskCanvas(R){const w=this.ctx,{width:X,height:C}=R,H=this.current.fillColor,st=this.current.patternFill,et=(0,p.getCurrentTransform)(w);let Mt,Rt,gt,Jt;if((R.bitmap||R.data)&&R.count>1){const $t=R.bitmap||R.data.buffer;Rt=JSON.stringify(st?et:[et.slice(0,4),H]),Mt=this._cachedBitmapsMap.get($t),Mt||(Mt=new Map,this._cachedBitmapsMap.set($t,Mt));const dl=Mt.get(Rt);if(dl&&!st){const rl=Math.round(Math.min(et[0],et[2])+et[4]),Yl=Math.round(Math.min(et[1],et[3])+et[5]);return{canvas:dl,offsetX:rl,offsetY:Yl}}gt=dl}gt||(Jt=this.cachedCanvases.getCanvas("maskCanvas",X,C),v(Jt.context,R));let Dt=M.Util.transform(et,[1/X,0,0,-1/C,0,0]);Dt=M.Util.transform(Dt,[1,0,0,1,0,-C]);const qt=M.Util.applyTransform([0,0],Dt),vt=M.Util.applyTransform([X,C],Dt),cl=M.Util.normalizeRect([qt[0],qt[1],vt[0],vt[1]]),bl=Math.round(cl[2]-cl[0])||1,il=Math.round(cl[3]-cl[1])||1,Bt=this.cachedCanvases.getCanvas("fillCanvas",bl,il),Ft=Bt.context,wt=Math.min(qt[0],vt[0]),pt=Math.min(qt[1],vt[1]);Ft.translate(-wt,-pt),Ft.transform(...Dt),gt||(gt=this._scaleImage(Jt.canvas,(0,p.getCurrentTransformInverse)(Ft)),gt=gt.img,Mt&&st&&Mt.set(Rt,gt)),Ft.imageSmoothingEnabled=It((0,p.getCurrentTransform)(Ft),R.interpolate),T(Ft,gt,0,0,gt.width,gt.height,0,0,X,C),Ft.globalCompositeOperation="source-in";const Ct=M.Util.transform((0,p.getCurrentTransformInverse)(Ft),[1,0,0,1,-wt,-pt]);return Ft.fillStyle=st?H.getPattern(w,this,Ct,B.PathType.FILL):H,Ft.fillRect(0,0,X,C),Mt&&!st&&(this.cachedCanvases.delete("fillCanvas"),Mt.set(Rt,Bt.canvas)),{canvas:Bt.canvas,offsetX:Math.round(wt),offsetY:Math.round(pt)}}setLineWidth(R){R!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1),this.current.lineWidth=R,this.ctx.lineWidth=R}setLineCap(R){this.ctx.lineCap=xt[R]}setLineJoin(R){this.ctx.lineJoin=it[R]}setMiterLimit(R){this.ctx.miterLimit=R}setDash(R,w){const X=this.ctx;X.setLineDash!==void 0&&(X.setLineDash(R),X.lineDashOffset=w)}setRenderingIntent(R){}setFlatness(R){}setGState(R){for(const[w,X]of R)switch(w){case"LW":this.setLineWidth(X);break;case"LC":this.setLineCap(X);break;case"LJ":this.setLineJoin(X);break;case"ML":this.setMiterLimit(X);break;case"D":this.setDash(X[0],X[1]);break;case"RI":this.setRenderingIntent(X);break;case"FL":this.setFlatness(X);break;case"Font":this.setFont(X[0],X[1]);break;case"CA":this.current.strokeAlpha=X;break;case"ca":this.current.fillAlpha=X,this.ctx.globalAlpha=X;break;case"BM":this.ctx.globalCompositeOperation=X;break;case"SMask":this.current.activeSMask=X?this.tempSMask:null,this.tempSMask=null,this.checkSMaskState();break;case"TR":this.ctx.filter=this.current.transferMaps=this.filterFactory.addFilter(X);break}}get inSMaskMode(){return!!this.suspendedCtx}checkSMaskState(){const R=this.inSMaskMode;this.current.activeSMask&&!R?this.beginSMaskMode():!this.current.activeSMask&&R&&this.endSMaskMode()}beginSMaskMode(){if(this.inSMaskMode)throw new Error("beginSMaskMode called while already in smask mode");const R=this.ctx.canvas.width,w=this.ctx.canvas.height,X="smaskGroupAt"+this.groupLevel,C=this.cachedCanvases.getCanvas(X,R,w);this.suspendedCtx=this.ctx,this.ctx=C.context;const H=this.ctx;H.setTransform(...(0,p.getCurrentTransform)(this.suspendedCtx)),u(this.suspendedCtx,H),S(H,this.suspendedCtx),this.setGState([["BM","source-over"],["ca",1],["CA",1]])}endSMaskMode(){if(!this.inSMaskMode)throw new Error("endSMaskMode called while not in smask mode");this.ctx._removeMirroring(),u(this.ctx,this.suspendedCtx),this.ctx=this.suspendedCtx,this.suspendedCtx=null}compose(R){if(!this.current.activeSMask)return;R?(R[0]=Math.floor(R[0]),R[1]=Math.floor(R[1]),R[2]=Math.ceil(R[2]),R[3]=Math.ceil(R[3])):R=[0,0,this.ctx.canvas.width,this.ctx.canvas.height];const w=this.current.activeSMask,X=this.suspendedCtx;dt(X,w,this.ctx,R),this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.clearRect(0,0,this.ctx.canvas.width,this.ctx.canvas.height),this.ctx.restore()}save(){this.inSMaskMode?(u(this.ctx,this.suspendedCtx),this.suspendedCtx.save()):this.ctx.save();const R=this.current;this.stateStack.push(R),this.current=R.clone()}restore(){this.stateStack.length===0&&this.inSMaskMode&&this.endSMaskMode(),this.stateStack.length!==0&&(this.current=this.stateStack.pop(),this.inSMaskMode?(this.suspendedCtx.restore(),u(this.suspendedCtx,this.ctx)):this.ctx.restore(),this.checkSMaskState(),this.pendingClip=null,this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null)}transform(R,w,X,C,H,st){this.ctx.transform(R,w,X,C,H,st),this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}constructPath(R,w,X){const C=this.ctx,H=this.current;let st=H.x,et=H.y,Mt,Rt;const gt=(0,p.getCurrentTransform)(C),Jt=gt[0]===0&>[3]===0||gt[1]===0&>[2]===0,Dt=Jt?X.slice(0):null;for(let qt=0,vt=0,cl=R.length;qt<cl;qt++)switch(R[qt]|0){case M.OPS.rectangle:st=w[vt++],et=w[vt++];const bl=w[vt++],il=w[vt++],Bt=st+bl,Ft=et+il;C.moveTo(st,et),bl===0||il===0?C.lineTo(Bt,Ft):(C.lineTo(Bt,et),C.lineTo(Bt,Ft),C.lineTo(st,Ft)),Jt||H.updateRectMinMax(gt,[st,et,Bt,Ft]),C.closePath();break;case M.OPS.moveTo:st=w[vt++],et=w[vt++],C.moveTo(st,et),Jt||H.updatePathMinMax(gt,st,et);break;case M.OPS.lineTo:st=w[vt++],et=w[vt++],C.lineTo(st,et),Jt||H.updatePathMinMax(gt,st,et);break;case M.OPS.curveTo:Mt=st,Rt=et,st=w[vt+4],et=w[vt+5],C.bezierCurveTo(w[vt],w[vt+1],w[vt+2],w[vt+3],st,et),H.updateCurvePathMinMax(gt,Mt,Rt,w[vt],w[vt+1],w[vt+2],w[vt+3],st,et,Dt),vt+=6;break;case M.OPS.curveTo2:Mt=st,Rt=et,C.bezierCurveTo(st,et,w[vt],w[vt+1],w[vt+2],w[vt+3]),H.updateCurvePathMinMax(gt,Mt,Rt,st,et,w[vt],w[vt+1],w[vt+2],w[vt+3],Dt),st=w[vt+2],et=w[vt+3],vt+=4;break;case M.OPS.curveTo3:Mt=st,Rt=et,st=w[vt+2],et=w[vt+3],C.bezierCurveTo(w[vt],w[vt+1],st,et,st,et),H.updateCurvePathMinMax(gt,Mt,Rt,w[vt],w[vt+1],st,et,st,et,Dt),vt+=4;break;case M.OPS.closePath:C.closePath();break}Jt&&H.updateScalingPathMinMax(gt,Dt),H.setCurrentPoint(st,et)}closePath(){this.ctx.closePath()}stroke(R=!0){const w=this.ctx,X=this.current.strokeColor;w.globalAlpha=this.current.strokeAlpha,this.contentVisible&&(typeof X=="object"&&(X!=null&&X.getPattern)?(w.save(),w.strokeStyle=X.getPattern(w,this,(0,p.getCurrentTransformInverse)(w),B.PathType.STROKE),this.rescaleAndStroke(!1),w.restore()):this.rescaleAndStroke(!0)),R&&this.consumePath(this.current.getClippedPathBoundingBox()),w.globalAlpha=this.current.fillAlpha}closeStroke(){this.closePath(),this.stroke()}fill(R=!0){const w=this.ctx,X=this.current.fillColor,C=this.current.patternFill;let H=!1;C&&(w.save(),w.fillStyle=X.getPattern(w,this,(0,p.getCurrentTransformInverse)(w),B.PathType.FILL),H=!0);const st=this.current.getClippedPathBoundingBox();this.contentVisible&&st!==null&&(this.pendingEOFill?(w.fill("evenodd"),this.pendingEOFill=!1):w.fill()),H&&w.restore(),R&&this.consumePath(st)}eoFill(){this.pendingEOFill=!0,this.fill()}fillStroke(){this.fill(!1),this.stroke(!1),this.consumePath()}eoFillStroke(){this.pendingEOFill=!0,this.fillStroke()}closeFillStroke(){this.closePath(),this.fillStroke()}closeEOFillStroke(){this.pendingEOFill=!0,this.closePath(),this.fillStroke()}endPath(){this.consumePath()}clip(){this.pendingClip=Xt}eoClip(){this.pendingClip=zt}beginText(){this.current.textMatrix=M.IDENTITY_MATRIX,this.current.textMatrixScale=1,this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}endText(){const R=this.pendingTextPaths,w=this.ctx;if(R===void 0){w.beginPath();return}w.save(),w.beginPath();for(const X of R)w.setTransform(...X.transform),w.translate(X.x,X.y),X.addToPath(w,X.fontSize);w.restore(),w.clip(),w.beginPath(),delete this.pendingTextPaths}setCharSpacing(R){this.current.charSpacing=R}setWordSpacing(R){this.current.wordSpacing=R}setHScale(R){this.current.textHScale=R/100}setLeading(R){this.current.leading=-R}setFont(R,w){var gt;const X=this.commonObjs.get(R),C=this.current;if(!X)throw new Error(`Can't find font for ${R}`);if(C.fontMatrix=X.fontMatrix||M.FONT_IDENTITY_MATRIX,(C.fontMatrix[0]===0||C.fontMatrix[3]===0)&&(0,M.warn)("Invalid font matrix for font "+R),w<0?(w=-w,C.fontDirection=-1):C.fontDirection=1,this.current.font=X,this.current.fontSize=w,X.isType3Font)return;const H=X.loadedName||"sans-serif",st=((gt=X.systemFontInfo)==null?void 0:gt.css)||`"${H}", ${X.fallbackName}`;let et="normal";X.black?et="900":X.bold&&(et="bold");const Mt=X.italic?"italic":"normal";let Rt=w;w<U?Rt=U:w>O&&(Rt=O),this.current.fontSizeScale=w/Rt,this.ctx.font=`${Mt} ${et} ${Rt}px ${st}`}setTextRenderingMode(R){this.current.textRenderingMode=R}setTextRise(R){this.current.textRise=R}moveText(R,w){this.current.x=this.current.lineX+=R,this.current.y=this.current.lineY+=w}setLeadingMoveText(R,w){this.setLeading(-w),this.moveText(R,w)}setTextMatrix(R,w,X,C,H,st){this.current.textMatrix=[R,w,X,C,H,st],this.current.textMatrixScale=Math.hypot(R,w),this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}nextLine(){this.moveText(0,this.current.leading)}paintChar(R,w,X,C){const H=this.ctx,st=this.current,et=st.font,Mt=st.textRenderingMode,Rt=st.fontSize/st.fontSizeScale,gt=Mt&M.TextRenderingMode.FILL_STROKE_MASK,Jt=!!(Mt&M.TextRenderingMode.ADD_TO_PATH_FLAG),Dt=st.patternFill&&!et.missingFile;let qt;(et.disableFontFace||Jt||Dt)&&(qt=et.getPathGenerator(this.commonObjs,R)),et.disableFontFace||Dt?(H.save(),H.translate(w,X),H.beginPath(),qt(H,Rt),C&&H.setTransform(...C),(gt===M.TextRenderingMode.FILL||gt===M.TextRenderingMode.FILL_STROKE)&&H.fill(),(gt===M.TextRenderingMode.STROKE||gt===M.TextRenderingMode.FILL_STROKE)&&H.stroke(),H.restore()):((gt===M.TextRenderingMode.FILL||gt===M.TextRenderingMode.FILL_STROKE)&&H.fillText(R,w,X),(gt===M.TextRenderingMode.STROKE||gt===M.TextRenderingMode.FILL_STROKE)&&H.strokeText(R,w,X)),Jt&&(this.pendingTextPaths||(this.pendingTextPaths=[])).push({transform:(0,p.getCurrentTransform)(H),x:w,y:X,fontSize:Rt,addToPath:qt})}get isFontSubpixelAAEnabled(){const{context:R}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10);R.scale(1.5,1),R.fillText("I",0,10);const w=R.getImageData(0,0,10,10).data;let X=!1;for(let C=3;C<w.length;C+=4)if(w[C]>0&&w[C]<255){X=!0;break}return(0,M.shadow)(this,"isFontSubpixelAAEnabled",X)}showText(R){const w=this.current,X=w.font;if(X.isType3Font)return this.showType3Text(R);const C=w.fontSize;if(C===0)return;const H=this.ctx,st=w.fontSizeScale,et=w.charSpacing,Mt=w.wordSpacing,Rt=w.fontDirection,gt=w.textHScale*Rt,Jt=R.length,Dt=X.vertical,qt=Dt?1:-1,vt=X.defaultVMetrics,cl=C*w.fontMatrix[0],bl=w.textRenderingMode===M.TextRenderingMode.FILL&&!X.disableFontFace&&!w.patternFill;H.save(),H.transform(...w.textMatrix),H.translate(w.x,w.y+w.textRise),Rt>0?H.scale(gt,-1):H.scale(gt,1);let il;if(w.patternFill){H.save();const Ct=w.fillColor.getPattern(H,this,(0,p.getCurrentTransformInverse)(H),B.PathType.FILL);il=(0,p.getCurrentTransform)(H),H.restore(),H.fillStyle=Ct}let Bt=w.lineWidth;const Ft=w.textMatrixScale;if(Ft===0||Bt===0){const Ct=w.textRenderingMode&M.TextRenderingMode.FILL_STROKE_MASK;(Ct===M.TextRenderingMode.STROKE||Ct===M.TextRenderingMode.FILL_STROKE)&&(Bt=this.getSinglePixelWidth())}else Bt/=Ft;if(st!==1&&(H.scale(st,st),Bt/=st),H.lineWidth=Bt,X.isInvalidPDFjsFont){const Ct=[];let $t=0;for(const dl of R)Ct.push(dl.unicode),$t+=dl.width;H.fillText(Ct.join(""),0,0),w.x+=$t*cl*gt,H.restore(),this.compose();return}let wt=0,pt;for(pt=0;pt<Jt;++pt){const Ct=R[pt];if(typeof Ct=="number"){wt+=qt*Ct*C/1e3;continue}let $t=!1;const dl=(Ct.isSpace?Mt:0)+et,rl=Ct.fontChar,Yl=Ct.accent;let Xl,pl,Ll=Ct.width;if(Dt){const Vl=Ct.vmetric||vt,_t=-(Ct.vmetric?Vl[1]:Ll*.5)*cl,ot=Vl[2]*cl;Ll=Vl?-Vl[0]:Ll,Xl=_t/st,pl=(wt+ot)/st}else Xl=wt/st,pl=0;if(X.remeasure&&Ll>0){const Vl=H.measureText(rl).width*1e3/C*st;if(Ll<Vl&&this.isFontSubpixelAAEnabled){const _t=Ll/Vl;$t=!0,H.save(),H.scale(_t,1),Xl/=_t}else Ll!==Vl&&(Xl+=(Ll-Vl)/2e3*C/st)}if(this.contentVisible&&(Ct.isInFont||X.missingFile)){if(bl&&!Yl)H.fillText(rl,Xl,pl);else if(this.paintChar(rl,Xl,pl,il),Yl){const Vl=Xl+C*Yl.offset.x/st,_t=pl-C*Yl.offset.y/st;this.paintChar(Yl.fontChar,Vl,_t,il)}}const yl=Dt?Ll*cl-dl*Rt:Ll*cl+dl*Rt;wt+=yl,$t&&H.restore()}Dt?w.y-=wt:w.x+=wt*gt,H.restore(),this.compose()}showType3Text(R){const w=this.ctx,X=this.current,C=X.font,H=X.fontSize,st=X.fontDirection,et=C.vertical?1:-1,Mt=X.charSpacing,Rt=X.wordSpacing,gt=X.textHScale*st,Jt=X.fontMatrix||M.FONT_IDENTITY_MATRIX,Dt=R.length,qt=X.textRenderingMode===M.TextRenderingMode.INVISIBLE;let vt,cl,bl,il;if(!(qt||H===0)){for(this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null,w.save(),w.transform(...X.textMatrix),w.translate(X.x,X.y),w.scale(gt,st),vt=0;vt<Dt;++vt){if(cl=R[vt],typeof cl=="number"){il=et*cl*H/1e3,this.ctx.translate(il,0),X.x+=il*gt;continue}const Bt=(cl.isSpace?Rt:0)+Mt,Ft=C.charProcOperatorList[cl.operatorListId];if(!Ft){(0,M.warn)(`Type3 character "${cl.operatorListId}" is not available.`);continue}this.contentVisible&&(this.processingType3=cl,this.save(),w.scale(H,H),w.transform(...Jt),this.executeOperatorList(Ft),this.restore()),bl=M.Util.applyTransform([cl.width,0],Jt)[0]*H+Bt,w.translate(bl,0),X.x+=bl*gt}w.restore(),this.processingType3=null}}setCharWidth(R,w){}setCharWidthAndBounds(R,w,X,C,H,st){this.ctx.rect(X,C,H-X,st-C),this.ctx.clip(),this.endPath()}getColorN_Pattern(R){let w;if(R[0]==="TilingPattern"){const X=R[1],C=this.baseTransform||(0,p.getCurrentTransform)(this.ctx),H={createCanvasGraphics:st=>new Pt(st,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack})};w=new B.TilingPattern(R,X,this.ctx,H,C)}else w=this._getPattern(R[1],R[2]);return w}setStrokeColorN(){this.current.strokeColor=this.getColorN_Pattern(arguments)}setFillColorN(){this.current.fillColor=this.getColorN_Pattern(arguments),this.current.patternFill=!0}setStrokeRGBColor(R,w,X){const C=M.Util.makeHexColor(R,w,X);this.ctx.strokeStyle=C,this.current.strokeColor=C}setFillRGBColor(R,w,X){const C=M.Util.makeHexColor(R,w,X);this.ctx.fillStyle=C,this.current.fillColor=C,this.current.patternFill=!1}_getPattern(R,w=null){let X;return this.cachedPatterns.has(R)?X=this.cachedPatterns.get(R):(X=(0,B.getShadingPattern)(this.getObject(R)),this.cachedPatterns.set(R,X)),w&&(X.matrix=w),X}shadingFill(R){if(!this.contentVisible)return;const w=this.ctx;this.save();const X=this._getPattern(R);w.fillStyle=X.getPattern(w,this,(0,p.getCurrentTransformInverse)(w),B.PathType.SHADING);const C=(0,p.getCurrentTransformInverse)(w);if(C){const{width:H,height:st}=w.canvas,[et,Mt,Rt,gt]=M.Util.getAxialAlignedBoundingBox([0,0,H,st],C);this.ctx.fillRect(et,Mt,Rt-et,gt-Mt)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.compose(this.current.getClippedPathBoundingBox()),this.restore()}beginInlineImage(){(0,M.unreachable)("Should not call beginInlineImage")}beginImageData(){(0,M.unreachable)("Should not call beginImageData")}paintFormXObjectBegin(R,w){if(this.contentVisible&&(this.save(),this.baseTransformStack.push(this.baseTransform),Array.isArray(R)&&R.length===6&&this.transform(...R),this.baseTransform=(0,p.getCurrentTransform)(this.ctx),w)){const X=w[2]-w[0],C=w[3]-w[1];this.ctx.rect(w[0],w[1],X,C),this.current.updateRectMinMax((0,p.getCurrentTransform)(this.ctx),w),this.clip(),this.endPath()}}paintFormXObjectEnd(){this.contentVisible&&(this.restore(),this.baseTransform=this.baseTransformStack.pop())}beginGroup(R){if(!this.contentVisible)return;this.save(),this.inSMaskMode&&(this.endSMaskMode(),this.current.activeSMask=null);const w=this.ctx;R.isolated||(0,M.info)("TODO: Support non-isolated groups."),R.knockout&&(0,M.warn)("Knockout groups not supported.");const X=(0,p.getCurrentTransform)(w);if(R.matrix&&w.transform(...R.matrix),!R.bbox)throw new Error("Bounding box is required.");let C=M.Util.getAxialAlignedBoundingBox(R.bbox,(0,p.getCurrentTransform)(w));const H=[0,0,w.canvas.width,w.canvas.height];C=M.Util.intersect(C,H)||[0,0,0,0];const st=Math.floor(C[0]),et=Math.floor(C[1]);let Mt=Math.max(Math.ceil(C[2])-st,1),Rt=Math.max(Math.ceil(C[3])-et,1),gt=1,Jt=1;Mt>I&&(gt=Mt/I,Mt=I),Rt>I&&(Jt=Rt/I,Rt=I),this.current.startNewPathAndClipBox([0,0,Mt,Rt]);let Dt="groupAt"+this.groupLevel;R.smask&&(Dt+="_smask_"+this.smaskCounter++%2);const qt=this.cachedCanvases.getCanvas(Dt,Mt,Rt),vt=qt.context;vt.scale(1/gt,1/Jt),vt.translate(-st,-et),vt.transform(...X),R.smask?this.smaskStack.push({canvas:qt.canvas,context:vt,offsetX:st,offsetY:et,scaleX:gt,scaleY:Jt,subtype:R.smask.subtype,backdrop:R.smask.backdrop,transferMap:R.smask.transferMap||null,startTransformInverse:null}):(w.setTransform(1,0,0,1,0,0),w.translate(st,et),w.scale(gt,Jt),w.save()),u(w,vt),this.ctx=vt,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(w),this.groupLevel++}endGroup(R){if(!this.contentVisible)return;this.groupLevel--;const w=this.ctx,X=this.groupStack.pop();if(this.ctx=X,this.ctx.imageSmoothingEnabled=!1,R.smask)this.tempSMask=this.smaskStack.pop(),this.restore();else{this.ctx.restore();const C=(0,p.getCurrentTransform)(this.ctx);this.restore(),this.ctx.save(),this.ctx.setTransform(...C);const H=M.Util.getAxialAlignedBoundingBox([0,0,w.canvas.width,w.canvas.height],C);this.ctx.drawImage(w.canvas,0,0),this.ctx.restore(),this.compose(H)}}beginAnnotation(R,w,X,C,H){if(nl(this,Nt,De).call(this),m(this.ctx),this.ctx.save(),this.save(),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),Array.isArray(w)&&w.length===4){const st=w[2]-w[0],et=w[3]-w[1];if(H&&this.annotationCanvasMap){X=X.slice(),X[4]-=w[0],X[5]-=w[1],w=w.slice(),w[0]=w[1]=0,w[2]=st,w[3]=et;const[Mt,Rt]=M.Util.singularValueDecompose2dScale((0,p.getCurrentTransform)(this.ctx)),{viewportScale:gt}=this,Jt=Math.ceil(st*this.outputScaleX*gt),Dt=Math.ceil(et*this.outputScaleY*gt);this.annotationCanvas=this.canvasFactory.create(Jt,Dt);const{canvas:qt,context:vt}=this.annotationCanvas;this.annotationCanvasMap.set(R,qt),this.annotationCanvas.savedCtx=this.ctx,this.ctx=vt,this.ctx.save(),this.ctx.setTransform(Mt,0,0,-Rt,0,et*Rt),m(this.ctx)}else m(this.ctx),this.ctx.rect(w[0],w[1],st,et),this.ctx.clip(),this.endPath()}this.current=new F(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(...X),this.transform(...C)}endAnnotation(){this.annotationCanvas&&(this.ctx.restore(),nl(this,Vt,je).call(this),this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas)}paintImageMaskXObject(R){if(!this.contentVisible)return;const w=R.count;R=this.getObject(R.data,R),R.count=w;const X=this.ctx,C=this.processingType3;if(C&&(C.compiled===void 0&&(C.compiled=g(R)),C.compiled)){C.compiled(X);return}const H=this._createMaskCanvas(R),st=H.canvas;X.save(),X.setTransform(1,0,0,1,0,0),X.drawImage(st,H.offsetX,H.offsetY),X.restore(),this.compose()}paintImageMaskXObjectRepeat(R,w,X=0,C=0,H,st){if(!this.contentVisible)return;R=this.getObject(R.data,R);const et=this.ctx;et.save();const Mt=(0,p.getCurrentTransform)(et);et.transform(w,X,C,H,0,0);const Rt=this._createMaskCanvas(R);et.setTransform(1,0,0,1,Rt.offsetX-Mt[4],Rt.offsetY-Mt[5]);for(let gt=0,Jt=st.length;gt<Jt;gt+=2){const Dt=M.Util.transform(Mt,[w,X,C,H,st[gt],st[gt+1]]),[qt,vt]=M.Util.applyTransform([0,0],Dt);et.drawImage(Rt.canvas,qt,vt)}et.restore(),this.compose()}paintImageMaskXObjectGroup(R){if(!this.contentVisible)return;const w=this.ctx,X=this.current.fillColor,C=this.current.patternFill;for(const H of R){const{data:st,width:et,height:Mt,transform:Rt}=H,gt=this.cachedCanvases.getCanvas("maskCanvas",et,Mt),Jt=gt.context;Jt.save();const Dt=this.getObject(st,H);v(Jt,Dt),Jt.globalCompositeOperation="source-in",Jt.fillStyle=C?X.getPattern(Jt,this,(0,p.getCurrentTransformInverse)(w),B.PathType.FILL):X,Jt.fillRect(0,0,et,Mt),Jt.restore(),w.save(),w.transform(...Rt),w.scale(1,-1),T(w,gt.canvas,0,0,et,Mt,0,-1,1,1),w.restore()}this.compose()}paintImageXObject(R){if(!this.contentVisible)return;const w=this.getObject(R);if(!w){(0,M.warn)("Dependent image isn't ready yet");return}this.paintInlineImageXObject(w)}paintImageXObjectRepeat(R,w,X,C){if(!this.contentVisible)return;const H=this.getObject(R);if(!H){(0,M.warn)("Dependent image isn't ready yet");return}const st=H.width,et=H.height,Mt=[];for(let Rt=0,gt=C.length;Rt<gt;Rt+=2)Mt.push({transform:[w,0,0,X,C[Rt],C[Rt+1]],x:0,y:0,w:st,h:et});this.paintInlineImageXObjectGroup(H,Mt)}applyTransferMapsToCanvas(R){return this.current.transferMaps!=="none"&&(R.filter=this.current.transferMaps,R.drawImage(R.canvas,0,0),R.filter="none"),R.canvas}applyTransferMapsToBitmap(R){if(this.current.transferMaps==="none")return R.bitmap;const{bitmap:w,width:X,height:C}=R,H=this.cachedCanvases.getCanvas("inlineImage",X,C),st=H.context;return st.filter=this.current.transferMaps,st.drawImage(w,0,0),st.filter="none",H.canvas}paintInlineImageXObject(R){if(!this.contentVisible)return;const w=R.width,X=R.height,C=this.ctx;if(this.save(),!M.isNodeJS){const{filter:et}=C;et!=="none"&&et!==""&&(C.filter="none")}C.scale(1/w,-1/X);let H;if(R.bitmap)H=this.applyTransferMapsToBitmap(R);else if(typeof HTMLElement=="function"&&R instanceof HTMLElement||!R.data)H=R;else{const Mt=this.cachedCanvases.getCanvas("inlineImage",w,X).context;J(Mt,R),H=this.applyTransferMapsToCanvas(Mt)}const st=this._scaleImage(H,(0,p.getCurrentTransformInverse)(C));C.imageSmoothingEnabled=It((0,p.getCurrentTransform)(C),R.interpolate),T(C,st.img,0,0,st.paintWidth,st.paintHeight,0,-X,w,X),this.compose(),this.restore()}paintInlineImageXObjectGroup(R,w){if(!this.contentVisible)return;const X=this.ctx;let C;if(R.bitmap)C=R.bitmap;else{const H=R.width,st=R.height,Mt=this.cachedCanvases.getCanvas("inlineImage",H,st).context;J(Mt,R),C=this.applyTransferMapsToCanvas(Mt)}for(const H of w)X.save(),X.transform(...H.transform),X.scale(1,-1),T(X,C,H.x,H.y,H.w,H.h,0,-1,1,1),X.restore();this.compose()}paintSolidColorImageMask(){this.contentVisible&&(this.ctx.fillRect(0,0,1,1),this.compose())}markPoint(R){}markPointProps(R,w){}beginMarkedContent(R){this.markedContentStack.push({visible:!0})}beginMarkedContentProps(R,w){R==="OC"?this.markedContentStack.push({visible:this.optionalContentConfig.isVisible(w)}):this.markedContentStack.push({visible:!0}),this.contentVisible=this.isContentVisible()}endMarkedContent(){this.markedContentStack.pop(),this.contentVisible=this.isContentVisible()}beginCompat(){}endCompat(){}consumePath(R){const w=this.current.isEmptyClip();this.pendingClip&&this.current.updateClipFromPath(),this.pendingClip||this.compose(R);const X=this.ctx;this.pendingClip&&(w||(this.pendingClip===zt?X.clip("evenodd"):X.clip()),this.pendingClip=null),this.current.startNewPathAndClipBox(this.current.clipBox),X.beginPath()}getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){const R=(0,p.getCurrentTransform)(this.ctx);if(R[1]===0&&R[2]===0)this._cachedGetSinglePixelWidth=1/Math.min(Math.abs(R[0]),Math.abs(R[3]));else{const w=Math.abs(R[0]*R[3]-R[2]*R[1]),X=Math.hypot(R[0],R[2]),C=Math.hypot(R[1],R[3]);this._cachedGetSinglePixelWidth=Math.max(X,C)/w}}return this._cachedGetSinglePixelWidth}getScaleForStroking(){if(this._cachedScaleForStroking[0]===-1){const{lineWidth:R}=this.current,{a:w,b:X,c:C,d:H}=this.ctx.getTransform();let st,et;if(X===0&&C===0){const Mt=Math.abs(w),Rt=Math.abs(H);if(Mt===Rt)if(R===0)st=et=1/Mt;else{const gt=Mt*R;st=et=gt<1?1/gt:1}else if(R===0)st=1/Mt,et=1/Rt;else{const gt=Mt*R,Jt=Rt*R;st=gt<1?1/gt:1,et=Jt<1?1/Jt:1}}else{const Mt=Math.abs(w*H-X*C),Rt=Math.hypot(w,X),gt=Math.hypot(C,H);if(R===0)st=gt/Mt,et=Rt/Mt;else{const Jt=R*Mt;st=gt>Jt?gt/Jt:1,et=Rt>Jt?Rt/Jt:1}}this._cachedScaleForStroking[0]=st,this._cachedScaleForStroking[1]=et}return this._cachedScaleForStroking}rescaleAndStroke(R){const{ctx:w}=this,{lineWidth:X}=this.current,[C,H]=this.getScaleForStroking();if(w.lineWidth=X||1,C===1&&H===1){w.stroke();return}const st=w.getLineDash();if(R&&w.save(),w.scale(C,H),st.length>0){const et=Math.max(C,H);w.setLineDash(st.map(Mt=>Mt/et)),w.lineDashOffset/=et}w.stroke(),R&&w.restore()}isContentVisible(){for(let R=this.markedContentStack.length-1;R>=0;R--)if(!this.markedContentStack[R].visible)return!1;return!0}};Nt=new WeakSet,De=function(){for(;this.stateStack.length||this.inSMaskMode;)this.restore();this.ctx.restore(),this.transparentCanvas&&(this.ctx=this.compositeCtx,this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.drawImage(this.transparentCanvas,0,0),this.ctx.restore(),this.transparentCanvas=null)},Vt=new WeakSet,je=function(){if(this.pageColors){const R=this.filterFactory.addHCMFilter(this.pageColors.foreground,this.pageColors.background);if(R!=="none"){const w=this.ctx.filter;this.ctx.filter=R,this.ctx.drawImage(this.ctx.canvas,0,0),this.ctx.filter=w}}};let Gt=Pt;r.CanvasGraphics=Gt;for(const at in M.OPS)Gt.prototype[at]!==void 0&&(Gt.prototype[M.OPS[at]]=Gt.prototype[at])},(lt,r,h)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.TilingPattern=r.PathType=void 0,r.getShadingPattern=f;var M=h(1),p=h(6);const B={FILL:"Fill",STROKE:"Stroke",SHADING:"Shading"};r.PathType=B;function Q(g,F){if(!F)return;const J=F[2]-F[0],v=F[3]-F[1],u=new Path2D;u.rect(F[0],F[1],J,v),g.clip(u)}class U{constructor(){this.constructor===U&&(0,M.unreachable)("Cannot initialize BaseShadingPattern.")}getPattern(){(0,M.unreachable)("Abstract method `getPattern` called.")}}class O extends U{constructor(F){super(),this._type=F[1],this._bbox=F[2],this._colorStops=F[3],this._p0=F[4],this._p1=F[5],this._r0=F[6],this._r1=F[7],this.matrix=null}_createGradient(F){let J;this._type==="axial"?J=F.createLinearGradient(this._p0[0],this._p0[1],this._p1[0],this._p1[1]):this._type==="radial"&&(J=F.createRadialGradient(this._p0[0],this._p0[1],this._r0,this._p1[0],this._p1[1],this._r1));for(const v of this._colorStops)J.addColorStop(v[0],v[1]);return J}getPattern(F,J,v,u){let m;if(u===B.STROKE||u===B.FILL){const _=J.current.getClippedPathBoundingBox(u,(0,p.getCurrentTransform)(F))||[0,0,0,0],$=Math.ceil(_[2]-_[0])||1,P=Math.ceil(_[3]-_[1])||1,Zt=J.cachedCanvases.getCanvas("pattern",$,P,!0),dt=Zt.context;dt.clearRect(0,0,dt.canvas.width,dt.canvas.height),dt.beginPath(),dt.rect(0,0,dt.canvas.width,dt.canvas.height),dt.translate(-_[0],-_[1]),v=M.Util.transform(v,[1,0,0,1,_[0],_[1]]),dt.transform(...J.baseTransform),this.matrix&&dt.transform(...this.matrix),Q(dt,this._bbox),dt.fillStyle=this._createGradient(dt),dt.fill(),m=F.createPattern(Zt.canvas,"no-repeat");const It=new DOMMatrix(v);m.setTransform(It)}else Q(F,this._bbox),m=this._createGradient(F);return m}}function I(g,F,J,v,u,m,_,$){const P=F.coords,Zt=F.colors,dt=g.data,It=g.width*4;let xt;P[J+1]>P[v+1]&&(xt=J,J=v,v=xt,xt=m,m=_,_=xt),P[v+1]>P[u+1]&&(xt=v,v=u,u=xt,xt=_,_=$,$=xt),P[J+1]>P[v+1]&&(xt=J,J=v,v=xt,xt=m,m=_,_=xt);const it=(P[J]+F.offsetX)*F.scaleX,Xt=(P[J+1]+F.offsetY)*F.scaleY,zt=(P[v]+F.offsetX)*F.scaleX,Gt=(P[v+1]+F.offsetY)*F.scaleY,Nt=(P[u]+F.offsetX)*F.scaleX,Ut=(P[u+1]+F.offsetY)*F.scaleY;if(Xt>=Ut)return;const Vt=Zt[m],Ht=Zt[m+1],Pt=Zt[m+2],at=Zt[_],R=Zt[_+1],w=Zt[_+2],X=Zt[$],C=Zt[$+1],H=Zt[$+2],st=Math.round(Xt),et=Math.round(Ut);let Mt,Rt,gt,Jt,Dt,qt,vt,cl;for(let bl=st;bl<=et;bl++){if(bl<Gt){const pt=bl<Xt?0:(Xt-bl)/(Xt-Gt);Mt=it-(it-zt)*pt,Rt=Vt-(Vt-at)*pt,gt=Ht-(Ht-R)*pt,Jt=Pt-(Pt-w)*pt}else{let pt;bl>Ut?pt=1:Gt===Ut?pt=0:pt=(Gt-bl)/(Gt-Ut),Mt=zt-(zt-Nt)*pt,Rt=at-(at-X)*pt,gt=R-(R-C)*pt,Jt=w-(w-H)*pt}let il;bl<Xt?il=0:bl>Ut?il=1:il=(Xt-bl)/(Xt-Ut),Dt=it-(it-Nt)*il,qt=Vt-(Vt-X)*il,vt=Ht-(Ht-C)*il,cl=Pt-(Pt-H)*il;const Bt=Math.round(Math.min(Mt,Dt)),Ft=Math.round(Math.max(Mt,Dt));let wt=It*bl+Bt*4;for(let pt=Bt;pt<=Ft;pt++)il=(Mt-pt)/(Mt-Dt),il<0?il=0:il>1&&(il=1),dt[wt++]=Rt-(Rt-qt)*il|0,dt[wt++]=gt-(gt-vt)*il|0,dt[wt++]=Jt-(Jt-cl)*il|0,dt[wt++]=255}}function j(g,F,J){const v=F.coords,u=F.colors;let m,_;switch(F.type){case"lattice":const $=F.verticesPerRow,P=Math.floor(v.length/$)-1,Zt=$-1;for(m=0;m<P;m++){let dt=m*$;for(let It=0;It<Zt;It++,dt++)I(g,J,v[dt],v[dt+1],v[dt+$],u[dt],u[dt+1],u[dt+$]),I(g,J,v[dt+$+1],v[dt+1],v[dt+$],u[dt+$+1],u[dt+1],u[dt+$])}break;case"triangles":for(m=0,_=v.length;m<_;m+=3)I(g,J,v[m],v[m+1],v[m+2],u[m],u[m+1],u[m+2]);break;default:throw new Error("illegal figure")}}class q extends U{constructor(F){super(),this._coords=F[2],this._colors=F[3],this._figures=F[4],this._bounds=F[5],this._bbox=F[7],this._background=F[8],this.matrix=null}_createMeshCanvas(F,J,v){const $=Math.floor(this._bounds[0]),P=Math.floor(this._bounds[1]),Zt=Math.ceil(this._bounds[2])-$,dt=Math.ceil(this._bounds[3])-P,It=Math.min(Math.ceil(Math.abs(Zt*F[0]*1.1)),3e3),xt=Math.min(Math.ceil(Math.abs(dt*F[1]*1.1)),3e3),it=Zt/It,Xt=dt/xt,zt={coords:this._coords,colors:this._colors,offsetX:-$,offsetY:-P,scaleX:1/it,scaleY:1/Xt},Gt=It+2*2,Nt=xt+2*2,Ut=v.getCanvas("mesh",Gt,Nt,!1),Vt=Ut.context,Ht=Vt.createImageData(It,xt);if(J){const at=Ht.data;for(let R=0,w=at.length;R<w;R+=4)at[R]=J[0],at[R+1]=J[1],at[R+2]=J[2],at[R+3]=255}for(const at of this._figures)j(Ht,at,zt);return Vt.putImageData(Ht,2,2),{canvas:Ut.canvas,offsetX:$-2*it,offsetY:P-2*Xt,scaleX:it,scaleY:Xt}}getPattern(F,J,v,u){Q(F,this._bbox);let m;if(u===B.SHADING)m=M.Util.singularValueDecompose2dScale((0,p.getCurrentTransform)(F));else if(m=M.Util.singularValueDecompose2dScale(J.baseTransform),this.matrix){const $=M.Util.singularValueDecompose2dScale(this.matrix);m=[m[0]*$[0],m[1]*$[1]]}const _=this._createMeshCanvas(m,u===B.SHADING?null:this._background,J.cachedCanvases);return u!==B.SHADING&&(F.setTransform(...J.baseTransform),this.matrix&&F.transform(...this.matrix)),F.translate(_.offsetX,_.offsetY),F.scale(_.scaleX,_.scaleY),F.createPattern(_.canvas,"no-repeat")}}class K extends U{getPattern(){return"hotpink"}}function f(g){switch(g[0]){case"RadialAxial":return new O(g);case"Mesh":return new q(g);case"Dummy":return new K}throw new Error(`Unknown IR type: ${g[0]}`)}const S={COLORED:1,UNCOLORED:2},T=class T{constructor(F,J,v,u,m){this.operatorList=F[2],this.matrix=F[3]||[1,0,0,1,0,0],this.bbox=F[4],this.xstep=F[5],this.ystep=F[6],this.paintType=F[7],this.tilingType=F[8],this.color=J,this.ctx=v,this.canvasGraphicsFactory=u,this.baseTransform=m}createPatternCanvas(F){const J=this.operatorList,v=this.bbox,u=this.xstep,m=this.ystep,_=this.paintType,$=this.tilingType,P=this.color,Zt=this.canvasGraphicsFactory;(0,M.info)("TilingType: "+$);const dt=v[0],It=v[1],xt=v[2],it=v[3],Xt=M.Util.singularValueDecompose2dScale(this.matrix),zt=M.Util.singularValueDecompose2dScale(this.baseTransform),Gt=[Xt[0]*zt[0],Xt[1]*zt[1]],Nt=this.getSizeAndScale(u,this.ctx.canvas.width,Gt[0]),Ut=this.getSizeAndScale(m,this.ctx.canvas.height,Gt[1]),Vt=F.cachedCanvases.getCanvas("pattern",Nt.size,Ut.size,!0),Ht=Vt.context,Pt=Zt.createCanvasGraphics(Ht);Pt.groupLevel=F.groupLevel,this.setFillAndStrokeStyleToContext(Pt,_,P);let at=dt,R=It,w=xt,X=it;return dt<0&&(at=0,w+=Math.abs(dt)),It<0&&(R=0,X+=Math.abs(It)),Ht.translate(-(Nt.scale*at),-(Ut.scale*R)),Pt.transform(Nt.scale,0,0,Ut.scale,0,0),Ht.save(),this.clipBbox(Pt,at,R,w,X),Pt.baseTransform=(0,p.getCurrentTransform)(Pt.ctx),Pt.executeOperatorList(J),Pt.endDrawing(),{canvas:Vt.canvas,scaleX:Nt.scale,scaleY:Ut.scale,offsetX:at,offsetY:R}}getSizeAndScale(F,J,v){F=Math.abs(F);const u=Math.max(T.MAX_PATTERN_SIZE,J);let m=Math.ceil(F*v);return m>=u?m=u:v=m/F,{scale:v,size:m}}clipBbox(F,J,v,u,m){const _=u-J,$=m-v;F.ctx.rect(J,v,_,$),F.current.updateRectMinMax((0,p.getCurrentTransform)(F.ctx),[J,v,u,m]),F.clip(),F.endPath()}setFillAndStrokeStyleToContext(F,J,v){const u=F.ctx,m=F.current;switch(J){case S.COLORED:const _=this.ctx;u.fillStyle=_.fillStyle,u.strokeStyle=_.strokeStyle,m.fillColor=_.fillStyle,m.strokeColor=_.strokeStyle;break;case S.UNCOLORED:const $=M.Util.makeHexColor(v[0],v[1],v[2]);u.fillStyle=$,u.strokeStyle=$,m.fillColor=$,m.strokeColor=$;break;default:throw new M.FormatError(`Unsupported paint type: ${J}`)}}getPattern(F,J,v,u){let m=v;u!==B.SHADING&&(m=M.Util.transform(m,J.baseTransform),this.matrix&&(m=M.Util.transform(m,this.matrix)));const _=this.createPatternCanvas(J);let $=new DOMMatrix(m);$=$.translate(_.offsetX,_.offsetY),$=$.scale(1/_.scaleX,1/_.scaleY);const P=F.createPattern(_.canvas,"repeat");return P.setTransform($),P}};gl(T,"MAX_PATTERN_SIZE",3e3);let k=T;r.TilingPattern=k},(lt,r,h)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.convertBlackAndWhiteToRGBA=B,r.convertToRGBA=p,r.grayToRGBA=U;var M=h(1);function p(O){switch(O.kind){case M.ImageKind.GRAYSCALE_1BPP:return B(O);case M.ImageKind.RGB_24BPP:return Q(O)}return null}function B({src:O,srcPos:I=0,dest:j,width:q,height:K,nonBlackColor:f=4294967295,inverseDecode:S=!1}){const k=M.FeatureTest.isLittleEndian?4278190080:255,[T,g]=S?[f,k]:[k,f],F=q>>3,J=q&7,v=O.length;j=new Uint32Array(j.buffer);let u=0;for(let m=0;m<K;m++){for(const $=I+F;I<$;I++){const P=I<v?O[I]:255;j[u++]=P&128?g:T,j[u++]=P&64?g:T,j[u++]=P&32?g:T,j[u++]=P&16?g:T,j[u++]=P&8?g:T,j[u++]=P&4?g:T,j[u++]=P&2?g:T,j[u++]=P&1?g:T}if(J===0)continue;const _=I<v?O[I++]:255;for(let $=0;$<J;$++)j[u++]=_&1<<7-$?g:T}return{srcPos:I,destPos:u}}function Q({src:O,srcPos:I=0,dest:j,destPos:q=0,width:K,height:f}){let S=0;const k=O.length>>2,T=new Uint32Array(O.buffer,I,k);if(M.FeatureTest.isLittleEndian){for(;S<k-2;S+=3,q+=4){const g=T[S],F=T[S+1],J=T[S+2];j[q]=g|4278190080,j[q+1]=g>>>24|F<<8|4278190080,j[q+2]=F>>>16|J<<16|4278190080,j[q+3]=J>>>8|4278190080}for(let g=S*4,F=O.length;g<F;g+=3)j[q++]=O[g]|O[g+1]<<8|O[g+2]<<16|4278190080}else{for(;S<k-2;S+=3,q+=4){const g=T[S],F=T[S+1],J=T[S+2];j[q]=g|255,j[q+1]=g<<24|F>>>8|255,j[q+2]=F<<16|J>>>16|255,j[q+3]=J<<8|255}for(let g=S*4,F=O.length;g<F;g+=3)j[q++]=O[g]<<24|O[g+1]<<16|O[g+2]<<8|255}return{srcPos:I,destPos:q}}function U(O,I){if(M.FeatureTest.isLittleEndian)for(let j=0,q=O.length;j<q;j++)I[j]=O[j]*65793|4278190080;else for(let j=0,q=O.length;j<q;j++)I[j]=O[j]*16843008|255}},(lt,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.GlobalWorkerOptions=void 0;const h=Object.create(null);r.GlobalWorkerOptions=h,h.workerPort=null,h.workerSrc=""},(lt,r,h)=>{var O,os,j,ms,K,he;Object.defineProperty(r,"__esModule",{value:!0}),r.MessageHandler=void 0;var M=h(1);const p={UNKNOWN:0,DATA:1,ERROR:2},B={UNKNOWN:0,CANCEL:1,CANCEL_COMPLETE:2,CLOSE:3,ENQUEUE:4,ERROR:5,PULL:6,PULL_COMPLETE:7,START_COMPLETE:8};function Q(S){switch(S instanceof Error||typeof S=="object"&&S!==null||(0,M.unreachable)('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),S.name){case"AbortException":return new M.AbortException(S.message);case"MissingPDFException":return new M.MissingPDFException(S.message);case"PasswordException":return new M.PasswordException(S.message,S.code);case"UnexpectedResponseException":return new M.UnexpectedResponseException(S.message,S.status);case"UnknownErrorException":return new M.UnknownErrorException(S.message,S.details);default:return new M.UnknownErrorException(S.message,S.toString())}}class U{constructor(k,T,g){ll(this,O);ll(this,j);ll(this,K);this.sourceName=k,this.targetName=T,this.comObj=g,this.callbackId=1,this.streamId=1,this.streamSinks=Object.create(null),this.streamControllers=Object.create(null),this.callbackCapabilities=Object.create(null),this.actionHandler=Object.create(null),this._onComObjOnMessage=F=>{const J=F.data;if(J.targetName!==this.sourceName)return;if(J.stream){nl(this,j,ms).call(this,J);return}if(J.callback){const u=J.callbackId,m=this.callbackCapabilities[u];if(!m)throw new Error(`Cannot resolve callback ${u}`);if(delete this.callbackCapabilities[u],J.callback===p.DATA)m.resolve(J.data);else if(J.callback===p.ERROR)m.reject(Q(J.reason));else throw new Error("Unexpected callback case");return}const v=this.actionHandler[J.action];if(!v)throw new Error(`Unknown action from worker: ${J.action}`);if(J.callbackId){const u=this.sourceName,m=J.sourceName;new Promise(function(_){_(v(J.data))}).then(function(_){g.postMessage({sourceName:u,targetName:m,callback:p.DATA,callbackId:J.callbackId,data:_})},function(_){g.postMessage({sourceName:u,targetName:m,callback:p.ERROR,callbackId:J.callbackId,reason:Q(_)})});return}if(J.streamId){nl(this,O,os).call(this,J);return}v(J.data)},g.addEventListener("message",this._onComObjOnMessage)}on(k,T){const g=this.actionHandler;if(g[k])throw new Error(`There is already an actionName called "${k}"`);g[k]=T}send(k,T,g){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:k,data:T},g)}sendWithPromise(k,T,g){const F=this.callbackId++,J=new M.PromiseCapability;this.callbackCapabilities[F]=J;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:k,callbackId:F,data:T},g)}catch(v){J.reject(v)}return J.promise}sendWithStream(k,T,g,F){const J=this.streamId++,v=this.sourceName,u=this.targetName,m=this.comObj;return new ReadableStream({start:_=>{const $=new M.PromiseCapability;return this.streamControllers[J]={controller:_,startCall:$,pullCall:null,cancelCall:null,isClosed:!1},m.postMessage({sourceName:v,targetName:u,action:k,streamId:J,data:T,desiredSize:_.desiredSize},F),$.promise},pull:_=>{const $=new M.PromiseCapability;return this.streamControllers[J].pullCall=$,m.postMessage({sourceName:v,targetName:u,stream:B.PULL,streamId:J,desiredSize:_.desiredSize}),$.promise},cancel:_=>{(0,M.assert)(_ instanceof Error,"cancel must have a valid reason");const $=new M.PromiseCapability;return this.streamControllers[J].cancelCall=$,this.streamControllers[J].isClosed=!0,m.postMessage({sourceName:v,targetName:u,stream:B.CANCEL,streamId:J,reason:Q(_)}),$.promise}},g)}destroy(){this.comObj.removeEventListener("message",this._onComObjOnMessage)}}O=new WeakSet,os=function(k){const T=k.streamId,g=this.sourceName,F=k.sourceName,J=this.comObj,v=this,u=this.actionHandler[k.action],m={enqueue(_,$=1,P){if(this.isCancelled)return;const Zt=this.desiredSize;this.desiredSize-=$,Zt>0&&this.desiredSize<=0&&(this.sinkCapability=new M.PromiseCapability,this.ready=this.sinkCapability.promise),J.postMessage({sourceName:g,targetName:F,stream:B.ENQUEUE,streamId:T,chunk:_},P)},close(){this.isCancelled||(this.isCancelled=!0,J.postMessage({sourceName:g,targetName:F,stream:B.CLOSE,streamId:T}),delete v.streamSinks[T])},error(_){(0,M.assert)(_ instanceof Error,"error must have a valid reason"),!this.isCancelled&&(this.isCancelled=!0,J.postMessage({sourceName:g,targetName:F,stream:B.ERROR,streamId:T,reason:Q(_)}))},sinkCapability:new M.PromiseCapability,onPull:null,onCancel:null,isCancelled:!1,desiredSize:k.desiredSize,ready:null};m.sinkCapability.resolve(),m.ready=m.sinkCapability.promise,this.streamSinks[T]=m,new Promise(function(_){_(u(k.data,m))}).then(function(){J.postMessage({sourceName:g,targetName:F,stream:B.START_COMPLETE,streamId:T,success:!0})},function(_){J.postMessage({sourceName:g,targetName:F,stream:B.START_COMPLETE,streamId:T,reason:Q(_)})})},j=new WeakSet,ms=function(k){const T=k.streamId,g=this.sourceName,F=k.sourceName,J=this.comObj,v=this.streamControllers[T],u=this.streamSinks[T];switch(k.stream){case B.START_COMPLETE:k.success?v.startCall.resolve():v.startCall.reject(Q(k.reason));break;case B.PULL_COMPLETE:k.success?v.pullCall.resolve():v.pullCall.reject(Q(k.reason));break;case B.PULL:if(!u){J.postMessage({sourceName:g,targetName:F,stream:B.PULL_COMPLETE,streamId:T,success:!0});break}u.desiredSize<=0&&k.desiredSize>0&&u.sinkCapability.resolve(),u.desiredSize=k.desiredSize,new Promise(function(m){var _;m((_=u.onPull)==null?void 0:_.call(u))}).then(function(){J.postMessage({sourceName:g,targetName:F,stream:B.PULL_COMPLETE,streamId:T,success:!0})},function(m){J.postMessage({sourceName:g,targetName:F,stream:B.PULL_COMPLETE,streamId:T,reason:Q(m)})});break;case B.ENQUEUE:if((0,M.assert)(v,"enqueue should have stream controller"),v.isClosed)break;v.controller.enqueue(k.chunk);break;case B.CLOSE:if((0,M.assert)(v,"close should have stream controller"),v.isClosed)break;v.isClosed=!0,v.controller.close(),nl(this,K,he).call(this,v,T);break;case B.ERROR:(0,M.assert)(v,"error should have stream controller"),v.controller.error(Q(k.reason)),nl(this,K,he).call(this,v,T);break;case B.CANCEL_COMPLETE:k.success?v.cancelCall.resolve():v.cancelCall.reject(Q(k.reason)),nl(this,K,he).call(this,v,T);break;case B.CANCEL:if(!u)break;new Promise(function(m){var _;m((_=u.onCancel)==null?void 0:_.call(u,Q(k.reason)))}).then(function(){J.postMessage({sourceName:g,targetName:F,stream:B.CANCEL_COMPLETE,streamId:T,success:!0})},function(m){J.postMessage({sourceName:g,targetName:F,stream:B.CANCEL_COMPLETE,streamId:T,reason:Q(m)})}),u.sinkCapability.reject(Q(k.reason)),u.isCancelled=!0,delete this.streamSinks[T];break;default:throw new Error("Unexpected stream case")}},K=new WeakSet,he=async function(k,T){var g,F,J;await Promise.allSettled([(g=k.startCall)==null?void 0:g.promise,(F=k.pullCall)==null?void 0:F.promise,(J=k.cancelCall)==null?void 0:J.promise]),delete this.streamControllers[T]},r.MessageHandler=U},(lt,r,h)=>{var B,Q;Object.defineProperty(r,"__esModule",{value:!0}),r.Metadata=void 0;var M=h(1);class p{constructor({parsedData:O,rawData:I}){ll(this,B,void 0);ll(this,Q,void 0);ul(this,B,O),ul(this,Q,I)}getRaw(){return bt(this,Q)}get(O){return bt(this,B).get(O)??null}getAll(){return(0,M.objectFromMap)(bt(this,B))}has(O){return bt(this,B).has(O)}}B=new WeakMap,Q=new WeakMap,r.Metadata=p},(lt,r,h)=>{var O,I,j,q,K,f,Ce;Object.defineProperty(r,"__esModule",{value:!0}),r.OptionalContentConfig=void 0;var M=h(1),p=h(8);const B=Symbol("INTERNAL");class Q{constructor(T,g){ll(this,O,!0);this.name=T,this.intent=g}get visible(){return bt(this,O)}_setVisible(T,g){T!==B&&(0,M.unreachable)("Internal method `_setVisible` called."),ul(this,O,g)}}O=new WeakMap;class U{constructor(T){ll(this,f);ll(this,I,null);ll(this,j,new Map);ll(this,q,null);ll(this,K,null);if(this.name=null,this.creator=null,T!==null){this.name=T.name,this.creator=T.creator,ul(this,K,T.order);for(const g of T.groups)bt(this,j).set(g.id,new Q(g.name,g.intent));if(T.baseState==="OFF")for(const g of bt(this,j).values())g._setVisible(B,!1);for(const g of T.on)bt(this,j).get(g)._setVisible(B,!0);for(const g of T.off)bt(this,j).get(g)._setVisible(B,!1);ul(this,q,this.getHash())}}isVisible(T){if(bt(this,j).size===0)return!0;if(!T)return(0,M.warn)("Optional content group not defined."),!0;if(T.type==="OCG")return bt(this,j).has(T.id)?bt(this,j).get(T.id).visible:((0,M.warn)(`Optional content group not found: ${T.id}`),!0);if(T.type==="OCMD"){if(T.expression)return nl(this,f,Ce).call(this,T.expression);if(!T.policy||T.policy==="AnyOn"){for(const g of T.ids){if(!bt(this,j).has(g))return(0,M.warn)(`Optional content group not found: ${g}`),!0;if(bt(this,j).get(g).visible)return!0}return!1}else if(T.policy==="AllOn"){for(const g of T.ids){if(!bt(this,j).has(g))return(0,M.warn)(`Optional content group not found: ${g}`),!0;if(!bt(this,j).get(g).visible)return!1}return!0}else if(T.policy==="AnyOff"){for(const g of T.ids){if(!bt(this,j).has(g))return(0,M.warn)(`Optional content group not found: ${g}`),!0;if(!bt(this,j).get(g).visible)return!0}return!1}else if(T.policy==="AllOff"){for(const g of T.ids){if(!bt(this,j).has(g))return(0,M.warn)(`Optional content group not found: ${g}`),!0;if(bt(this,j).get(g).visible)return!1}return!0}return(0,M.warn)(`Unknown optional content policy ${T.policy}.`),!0}return(0,M.warn)(`Unknown group type ${T.type}.`),!0}setVisibility(T,g=!0){if(!bt(this,j).has(T)){(0,M.warn)(`Optional content group not found: ${T}`);return}bt(this,j).get(T)._setVisible(B,!!g),ul(this,I,null)}get hasInitialVisibility(){return bt(this,q)===null||this.getHash()===bt(this,q)}getOrder(){return bt(this,j).size?bt(this,K)?bt(this,K).slice():[...bt(this,j).keys()]:null}getGroups(){return bt(this,j).size>0?(0,M.objectFromMap)(bt(this,j)):null}getGroup(T){return bt(this,j).get(T)||null}getHash(){if(bt(this,I)!==null)return bt(this,I);const T=new p.MurmurHash3_64;for(const[g,F]of bt(this,j))T.update(`${g}:${F.visible}`);return ul(this,I,T.hexdigest())}}I=new WeakMap,j=new WeakMap,q=new WeakMap,K=new WeakMap,f=new WeakSet,Ce=function(T){const g=T.length;if(g<2)return!0;const F=T[0];for(let J=1;J<g;J++){const v=T[J];let u;if(Array.isArray(v))u=nl(this,f,Ce).call(this,v);else if(bt(this,j).has(v))u=bt(this,j).get(v).visible;else return(0,M.warn)(`Optional content group not found: ${v}`),!0;switch(F){case"And":if(!u)return!1;break;case"Or":if(u)return!0;break;case"Not":return!u;default:return!0}}return F==="And"},r.OptionalContentConfig=U},(lt,r,h)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.PDFDataTransportStream=void 0;var M=h(1),p=h(6);class B{constructor({length:I,initialData:j,progressiveDone:q=!1,contentDispositionFilename:K=null,disableRange:f=!1,disableStream:S=!1},k){if((0,M.assert)(k,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.'),this._queuedChunks=[],this._progressiveDone=q,this._contentDispositionFilename=K,(j==null?void 0:j.length)>0){const T=j instanceof Uint8Array&&j.byteLength===j.buffer.byteLength?j.buffer:new Uint8Array(j).buffer;this._queuedChunks.push(T)}this._pdfDataRangeTransport=k,this._isStreamingSupported=!S,this._isRangeSupported=!f,this._contentLength=I,this._fullRequestReader=null,this._rangeReaders=[],this._pdfDataRangeTransport.addRangeListener((T,g)=>{this._onReceiveData({begin:T,chunk:g})}),this._pdfDataRangeTransport.addProgressListener((T,g)=>{this._onProgress({loaded:T,total:g})}),this._pdfDataRangeTransport.addProgressiveReadListener(T=>{this._onReceiveData({chunk:T})}),this._pdfDataRangeTransport.addProgressiveDoneListener(()=>{this._onProgressiveDone()}),this._pdfDataRangeTransport.transportReady()}_onReceiveData({begin:I,chunk:j}){const q=j instanceof Uint8Array&&j.byteLength===j.buffer.byteLength?j.buffer:new Uint8Array(j).buffer;if(I===void 0)this._fullRequestReader?this._fullRequestReader._enqueue(q):this._queuedChunks.push(q);else{const K=this._rangeReaders.some(function(f){return f._begin!==I?!1:(f._enqueue(q),!0)});(0,M.assert)(K,"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}get _progressiveDataLength(){var I;return((I=this._fullRequestReader)==null?void 0:I._loaded)??0}_onProgress(I){var j,q,K,f;I.total===void 0?(q=(j=this._rangeReaders[0])==null?void 0:j.onProgress)==null||q.call(j,{loaded:I.loaded}):(f=(K=this._fullRequestReader)==null?void 0:K.onProgress)==null||f.call(K,{loaded:I.loaded,total:I.total})}_onProgressiveDone(){var I;(I=this._fullRequestReader)==null||I.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(I){const j=this._rangeReaders.indexOf(I);j>=0&&this._rangeReaders.splice(j,1)}getFullReader(){(0,M.assert)(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");const I=this._queuedChunks;return this._queuedChunks=null,new Q(this,I,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(I,j){if(j<=this._progressiveDataLength)return null;const q=new U(this,I,j);return this._pdfDataRangeTransport.requestDataRange(I,j),this._rangeReaders.push(q),q}cancelAllRequests(I){var j;(j=this._fullRequestReader)==null||j.cancel(I);for(const q of this._rangeReaders.slice(0))q.cancel(I);this._pdfDataRangeTransport.abort()}}r.PDFDataTransportStream=B;class Q{constructor(I,j,q=!1,K=null){this._stream=I,this._done=q||!1,this._filename=(0,p.isPdfFile)(K)?K:null,this._queuedChunks=j||[],this._loaded=0;for(const f of this._queuedChunks)this._loaded+=f.byteLength;this._requests=[],this._headersReady=Promise.resolve(),I._fullRequestReader=this,this.onProgress=null}_enqueue(I){this._done||(this._requests.length>0?this._requests.shift().resolve({value:I,done:!1}):this._queuedChunks.push(I),this._loaded+=I.byteLength)}get headersReady(){return this._headersReady}get filename(){return this._filename}get isRangeSupported(){return this._stream._isRangeSupported}get isStreamingSupported(){return this._stream._isStreamingSupported}get contentLength(){return this._stream._contentLength}async read(){if(this._queuedChunks.length>0)return{value:this._queuedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};const I=new M.PromiseCapability;return this._requests.push(I),I.promise}cancel(I){this._done=!0;for(const j of this._requests)j.resolve({value:void 0,done:!0});this._requests.length=0}progressiveDone(){this._done||(this._done=!0)}}class U{constructor(I,j,q){this._stream=I,this._begin=j,this._end=q,this._queuedChunk=null,this._requests=[],this._done=!1,this.onProgress=null}_enqueue(I){if(!this._done){if(this._requests.length===0)this._queuedChunk=I;else{this._requests.shift().resolve({value:I,done:!1});for(const q of this._requests)q.resolve({value:void 0,done:!0});this._requests.length=0}this._done=!0,this._stream._removeRangeReader(this)}}get isStreamingSupported(){return!1}async read(){if(this._queuedChunk){const j=this._queuedChunk;return this._queuedChunk=null,{value:j,done:!1}}if(this._done)return{value:void 0,done:!0};const I=new M.PromiseCapability;return this._requests.push(I),I.promise}cancel(I){this._done=!0;for(const j of this._requests)j.resolve({value:void 0,done:!0});this._requests.length=0,this._stream._removeRangeReader(this)}}},(lt,r,h)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.PDFFetchStream=void 0;var M=h(1),p=h(20);function B(q,K,f){return{method:"GET",headers:q,signal:f.signal,mode:"cors",credentials:K?"include":"same-origin",redirect:"follow"}}function Q(q){const K=new Headers;for(const f in q){const S=q[f];S!==void 0&&K.append(f,S)}return K}function U(q){return q instanceof Uint8Array?q.buffer:q instanceof ArrayBuffer?q:((0,M.warn)(`getArrayBuffer - unexpected data format: ${q}`),new Uint8Array(q).buffer)}class O{constructor(K){this.source=K,this.isHttp=/^https?:/i.test(K.url),this.httpHeaders=this.isHttp&&K.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){var K;return((K=this._fullRequestReader)==null?void 0:K._loaded)??0}getFullReader(){return(0,M.assert)(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new I(this),this._fullRequestReader}getRangeReader(K,f){if(f<=this._progressiveDataLength)return null;const S=new j(this,K,f);return this._rangeRequestReaders.push(S),S}cancelAllRequests(K){var f;(f=this._fullRequestReader)==null||f.cancel(K);for(const S of this._rangeRequestReaders.slice(0))S.cancel(K)}}r.PDFFetchStream=O;class I{constructor(K){this._stream=K,this._reader=null,this._loaded=0,this._filename=null;const f=K.source;this._withCredentials=f.withCredentials||!1,this._contentLength=f.length,this._headersCapability=new M.PromiseCapability,this._disableRange=f.disableRange||!1,this._rangeChunkSize=f.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._abortController=new AbortController,this._isStreamingSupported=!f.disableStream,this._isRangeSupported=!f.disableRange,this._headers=Q(this._stream.httpHeaders);const S=f.url;fetch(S,B(this._headers,this._withCredentials,this._abortController)).then(k=>{if(!(0,p.validateResponseStatus)(k.status))throw(0,p.createResponseStatusError)(k.status,S);this._reader=k.body.getReader(),this._headersCapability.resolve();const T=J=>k.headers.get(J),{allowRangeRequests:g,suggestedLength:F}=(0,p.validateRangeRequestCapabilities)({getResponseHeader:T,isHttp:this._stream.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=g,this._contentLength=F||this._contentLength,this._filename=(0,p.extractFilenameFromHeader)(T),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new M.AbortException("Streaming is disabled."))}).catch(this._headersCapability.reject),this.onProgress=null}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){var S;await this._headersCapability.promise;const{value:K,done:f}=await this._reader.read();return f?{value:K,done:f}:(this._loaded+=K.byteLength,(S=this.onProgress)==null||S.call(this,{loaded:this._loaded,total:this._contentLength}),{value:U(K),done:!1})}cancel(K){var f;(f=this._reader)==null||f.cancel(K),this._abortController.abort()}}class j{constructor(K,f,S){this._stream=K,this._reader=null,this._loaded=0;const k=K.source;this._withCredentials=k.withCredentials||!1,this._readCapability=new M.PromiseCapability,this._isStreamingSupported=!k.disableStream,this._abortController=new AbortController,this._headers=Q(this._stream.httpHeaders),this._headers.append("Range",`bytes=${f}-${S-1}`);const T=k.url;fetch(T,B(this._headers,this._withCredentials,this._abortController)).then(g=>{if(!(0,p.validateResponseStatus)(g.status))throw(0,p.createResponseStatusError)(g.status,T);this._readCapability.resolve(),this._reader=g.body.getReader()}).catch(this._readCapability.reject),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){var S;await this._readCapability.promise;const{value:K,done:f}=await this._reader.read();return f?{value:K,done:f}:(this._loaded+=K.byteLength,(S=this.onProgress)==null||S.call(this,{loaded:this._loaded}),{value:U(K),done:!1})}cancel(K){var f;(f=this._reader)==null||f.cancel(K),this._abortController.abort()}}},(lt,r,h)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.createResponseStatusError=O,r.extractFilenameFromHeader=U,r.validateRangeRequestCapabilities=Q,r.validateResponseStatus=I;var M=h(1),p=h(21),B=h(6);function Q({getResponseHeader:j,isHttp:q,rangeChunkSize:K,disableRange:f}){const S={allowRangeRequests:!1,suggestedLength:void 0},k=parseInt(j("Content-Length"),10);return!Number.isInteger(k)||(S.suggestedLength=k,k<=2*K)||f||!q||j("Accept-Ranges")!=="bytes"||(j("Content-Encoding")||"identity")!=="identity"||(S.allowRangeRequests=!0),S}function U(j){const q=j("Content-Disposition");if(q){let K=(0,p.getFilenameFromContentDispositionHeader)(q);if(K.includes("%"))try{K=decodeURIComponent(K)}catch{}if((0,B.isPdfFile)(K))return K}return null}function O(j,q){return j===404||j===0&&q.startsWith("file:")?new M.MissingPDFException('Missing PDF "'+q+'".'):new M.UnexpectedResponseException(`Unexpected server response (${j}) while retrieving PDF "${q}".`,j)}function I(j){return j===200||j===206}},(lt,r,h)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.getFilenameFromContentDispositionHeader=p;var M=h(1);function p(B){let Q=!0,U=O("filename\\*","i").exec(B);if(U){U=U[1];let k=K(U);return k=unescape(k),k=f(k),k=S(k),j(k)}if(U=q(B),U){const k=S(U);return j(k)}if(U=O("filename","i").exec(B),U){U=U[1];let k=K(U);return k=S(k),j(k)}function O(k,T){return new RegExp("(?:^|;)\\s*"+k+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',T)}function I(k,T){if(k){if(!/^[\x00-\xFF]+$/.test(T))return T;try{const g=new TextDecoder(k,{fatal:!0}),F=(0,M.stringToBytes)(T);T=g.decode(F),Q=!1}catch{}}return T}function j(k){return Q&&/[\x80-\xff]/.test(k)&&(k=I("utf-8",k),Q&&(k=I("iso-8859-1",k))),k}function q(k){const T=[];let g;const F=O("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;(g=F.exec(k))!==null;){let[,v,u,m]=g;if(v=parseInt(v,10),v in T){if(v===0)break;continue}T[v]=[u,m]}const J=[];for(let v=0;v<T.length&&v in T;++v){let[u,m]=T[v];m=K(m),u&&(m=unescape(m),v===0&&(m=f(m))),J.push(m)}return J.join("")}function K(k){if(k.startsWith('"')){const T=k.slice(1).split('\\"');for(let g=0;g<T.length;++g){const F=T[g].indexOf('"');F!==-1&&(T[g]=T[g].slice(0,F),T.length=g+1),T[g]=T[g].replaceAll(/\\(.)/g,"$1")}k=T.join('"')}return k}function f(k){const T=k.indexOf("'");if(T===-1)return k;const g=k.slice(0,T),J=k.slice(T+1).replace(/^[^']*'/,"");return I(g,J)}function S(k){return!k.startsWith("=?")||/[\x00-\x19\x80-\xff]/.test(k)?k:k.replaceAll(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,function(T,g,F,J){if(F==="q"||F==="Q")return J=J.replaceAll("_"," "),J=J.replaceAll(/=([0-9a-fA-F]{2})/g,function(v,u){return String.fromCharCode(parseInt(u,16))}),I(g,J);try{J=atob(J)}catch{}return I(g,J)})}return""}},(lt,r,h)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.PDFNetworkStream=void 0;var M=h(1),p=h(20);const B=200,Q=206;function U(K){const f=K.response;return typeof f!="string"?f:(0,M.stringToBytes)(f).buffer}class O{constructor(f,S={}){this.url=f,this.isHttp=/^https?:/i.test(f),this.httpHeaders=this.isHttp&&S.httpHeaders||Object.create(null),this.withCredentials=S.withCredentials||!1,this.currXhrId=0,this.pendingRequests=Object.create(null)}requestRange(f,S,k){const T={begin:f,end:S};for(const g in k)T[g]=k[g];return this.request(T)}requestFull(f){return this.request(f)}request(f){const S=new XMLHttpRequest,k=this.currXhrId++,T=this.pendingRequests[k]={xhr:S};S.open("GET",this.url),S.withCredentials=this.withCredentials;for(const g in this.httpHeaders){const F=this.httpHeaders[g];F!==void 0&&S.setRequestHeader(g,F)}return this.isHttp&&"begin"in f&&"end"in f?(S.setRequestHeader("Range",`bytes=${f.begin}-${f.end-1}`),T.expectedStatus=Q):T.expectedStatus=B,S.responseType="arraybuffer",f.onError&&(S.onerror=function(g){f.onError(S.status)}),S.onreadystatechange=this.onStateChange.bind(this,k),S.onprogress=this.onProgress.bind(this,k),T.onHeadersReceived=f.onHeadersReceived,T.onDone=f.onDone,T.onError=f.onError,T.onProgress=f.onProgress,S.send(null),k}onProgress(f,S){var T;const k=this.pendingRequests[f];k&&((T=k.onProgress)==null||T.call(k,S))}onStateChange(f,S){var v,u,m;const k=this.pendingRequests[f];if(!k)return;const T=k.xhr;if(T.readyState>=2&&k.onHeadersReceived&&(k.onHeadersReceived(),delete k.onHeadersReceived),T.readyState!==4||!(f in this.pendingRequests))return;if(delete this.pendingRequests[f],T.status===0&&this.isHttp){(v=k.onError)==null||v.call(k,T.status);return}const g=T.status||B;if(!(g===B&&k.expectedStatus===Q)&&g!==k.expectedStatus){(u=k.onError)==null||u.call(k,T.status);return}const J=U(T);if(g===Q){const _=T.getResponseHeader("Content-Range"),$=/bytes (\d+)-(\d+)\/(\d+)/.exec(_);k.onDone({begin:parseInt($[1],10),chunk:J})}else J?k.onDone({begin:0,chunk:J}):(m=k.onError)==null||m.call(k,T.status)}getRequestXhr(f){return this.pendingRequests[f].xhr}isPendingRequest(f){return f in this.pendingRequests}abortRequest(f){const S=this.pendingRequests[f].xhr;delete this.pendingRequests[f],S.abort()}}class I{constructor(f){this._source=f,this._manager=new O(f.url,{httpHeaders:f.httpHeaders,withCredentials:f.withCredentials}),this._rangeChunkSize=f.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(f){const S=this._rangeRequestReaders.indexOf(f);S>=0&&this._rangeRequestReaders.splice(S,1)}getFullReader(){return(0,M.assert)(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new j(this._manager,this._source),this._fullRequestReader}getRangeReader(f,S){const k=new q(this._manager,f,S);return k.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(k),k}cancelAllRequests(f){var S;(S=this._fullRequestReader)==null||S.cancel(f);for(const k of this._rangeRequestReaders.slice(0))k.cancel(f)}}r.PDFNetworkStream=I;class j{constructor(f,S){this._manager=f;const k={onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=S.url,this._fullRequestId=f.requestFull(k),this._headersReceivedCapability=new M.PromiseCapability,this._disableRange=S.disableRange||!1,this._contentLength=S.length,this._rangeChunkSize=S.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._isStreamingSupported=!1,this._isRangeSupported=!1,this._cachedChunks=[],this._requests=[],this._done=!1,this._storedError=void 0,this._filename=null,this.onProgress=null}_onHeadersReceived(){const f=this._fullRequestId,S=this._manager.getRequestXhr(f),k=F=>S.getResponseHeader(F),{allowRangeRequests:T,suggestedLength:g}=(0,p.validateRangeRequestCapabilities)({getResponseHeader:k,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});T&&(this._isRangeSupported=!0),this._contentLength=g||this._contentLength,this._filename=(0,p.extractFilenameFromHeader)(k),this._isRangeSupported&&this._manager.abortRequest(f),this._headersReceivedCapability.resolve()}_onDone(f){if(f&&(this._requests.length>0?this._requests.shift().resolve({value:f.chunk,done:!1}):this._cachedChunks.push(f.chunk)),this._done=!0,!(this._cachedChunks.length>0)){for(const S of this._requests)S.resolve({value:void 0,done:!0});this._requests.length=0}}_onError(f){this._storedError=(0,p.createResponseStatusError)(f,this._url),this._headersReceivedCapability.reject(this._storedError);for(const S of this._requests)S.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0}_onProgress(f){var S;(S=this.onProgress)==null||S.call(this,{loaded:f.loaded,total:f.lengthComputable?f.total:this._contentLength})}get filename(){return this._filename}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}get contentLength(){return this._contentLength}get headersReady(){return this._headersReceivedCapability.promise}async read(){if(this._storedError)throw this._storedError;if(this._cachedChunks.length>0)return{value:this._cachedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};const f=new M.PromiseCapability;return this._requests.push(f),f.promise}cancel(f){this._done=!0,this._headersReceivedCapability.reject(f);for(const S of this._requests)S.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId),this._fullRequestReader=null}}class q{constructor(f,S,k){this._manager=f;const T={onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=f.url,this._requestId=f.requestRange(S,k,T),this._requests=[],this._queuedChunk=null,this._done=!1,this._storedError=void 0,this.onProgress=null,this.onClosed=null}_close(){var f;(f=this.onClosed)==null||f.call(this,this)}_onDone(f){const S=f.chunk;this._requests.length>0?this._requests.shift().resolve({value:S,done:!1}):this._queuedChunk=S,this._done=!0;for(const k of this._requests)k.resolve({value:void 0,done:!0});this._requests.length=0,this._close()}_onError(f){this._storedError=(0,p.createResponseStatusError)(f,this._url);for(const S of this._requests)S.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}_onProgress(f){var S;this.isStreamingSupported||(S=this.onProgress)==null||S.call(this,{loaded:f.loaded})}get isStreamingSupported(){return!1}async read(){if(this._storedError)throw this._storedError;if(this._queuedChunk!==null){const S=this._queuedChunk;return this._queuedChunk=null,{value:S,done:!1}}if(this._done)return{value:void 0,done:!0};const f=new M.PromiseCapability;return this._requests.push(f),f.promise}cancel(f){this._done=!0;for(const S of this._requests)S.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId),this._close()}}},(lt,r,h)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.PDFNodeStream=void 0;var M=h(1),p=h(20);const B=/^file:\/\/\/[a-zA-Z]:\//;function Q(k){const T=require$$5,g=T.parse(k);return g.protocol==="file:"||g.host?g:/^[a-z]:[/\\]/i.test(k)?T.parse(`file:///${k}`):(g.host||(g.protocol="file:"),g)}class U{constructor(T){this.source=T,this.url=Q(T.url),this.isHttp=this.url.protocol==="http:"||this.url.protocol==="https:",this.isFsUrl=this.url.protocol==="file:",this.httpHeaders=this.isHttp&&T.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){var T;return((T=this._fullRequestReader)==null?void 0:T._loaded)??0}getFullReader(){return(0,M.assert)(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=this.isFsUrl?new f(this):new q(this),this._fullRequestReader}getRangeReader(T,g){if(g<=this._progressiveDataLength)return null;const F=this.isFsUrl?new S(this,T,g):new K(this,T,g);return this._rangeRequestReaders.push(F),F}cancelAllRequests(T){var g;(g=this._fullRequestReader)==null||g.cancel(T);for(const F of this._rangeRequestReaders.slice(0))F.cancel(T)}}r.PDFNodeStream=U;class O{constructor(T){this._url=T.url,this._done=!1,this._storedError=null,this.onProgress=null;const g=T.source;this._contentLength=g.length,this._loaded=0,this._filename=null,this._disableRange=g.disableRange||!1,this._rangeChunkSize=g.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._isStreamingSupported=!g.disableStream,this._isRangeSupported=!g.disableRange,this._readableStream=null,this._readCapability=new M.PromiseCapability,this._headersCapability=new M.PromiseCapability}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){var F;if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const T=this._readableStream.read();return T===null?(this._readCapability=new M.PromiseCapability,this.read()):(this._loaded+=T.length,(F=this.onProgress)==null||F.call(this,{loaded:this._loaded,total:this._contentLength}),{value:new Uint8Array(T).buffer,done:!1})}cancel(T){if(!this._readableStream){this._error(T);return}this._readableStream.destroy(T)}_error(T){this._storedError=T,this._readCapability.resolve()}_setReadableStream(T){this._readableStream=T,T.on("readable",()=>{this._readCapability.resolve()}),T.on("end",()=>{T.destroy(),this._done=!0,this._readCapability.resolve()}),T.on("error",g=>{this._error(g)}),!this._isStreamingSupported&&this._isRangeSupported&&this._error(new M.AbortException("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class I{constructor(T){this._url=T.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=new M.PromiseCapability;const g=T.source;this._isStreamingSupported=!g.disableStream}get isStreamingSupported(){return this._isStreamingSupported}async read(){var F;if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const T=this._readableStream.read();return T===null?(this._readCapability=new M.PromiseCapability,this.read()):(this._loaded+=T.length,(F=this.onProgress)==null||F.call(this,{loaded:this._loaded}),{value:new Uint8Array(T).buffer,done:!1})}cancel(T){if(!this._readableStream){this._error(T);return}this._readableStream.destroy(T)}_error(T){this._storedError=T,this._readCapability.resolve()}_setReadableStream(T){this._readableStream=T,T.on("readable",()=>{this._readCapability.resolve()}),T.on("end",()=>{T.destroy(),this._done=!0,this._readCapability.resolve()}),T.on("error",g=>{this._error(g)}),this._storedError&&this._readableStream.destroy(this._storedError)}}function j(k,T){return{protocol:k.protocol,auth:k.auth,host:k.hostname,port:k.port,path:k.path,method:"GET",headers:T}}class q extends O{constructor(T){super(T);const g=F=>{if(F.statusCode===404){const m=new M.MissingPDFException(`Missing PDF "${this._url}".`);this._storedError=m,this._headersCapability.reject(m);return}this._headersCapability.resolve(),this._setReadableStream(F);const J=m=>this._readableStream.headers[m.toLowerCase()],{allowRangeRequests:v,suggestedLength:u}=(0,p.validateRangeRequestCapabilities)({getResponseHeader:J,isHttp:T.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=v,this._contentLength=u||this._contentLength,this._filename=(0,p.extractFilenameFromHeader)(J)};if(this._request=null,this._url.protocol==="http:"){const F=require$$5;this._request=F.request(j(this._url,T.httpHeaders),g)}else{const F=require$$5;this._request=F.request(j(this._url,T.httpHeaders),g)}this._request.on("error",F=>{this._storedError=F,this._headersCapability.reject(F)}),this._request.end()}}class K extends I{constructor(T,g,F){super(T),this._httpHeaders={};for(const v in T.httpHeaders){const u=T.httpHeaders[v];u!==void 0&&(this._httpHeaders[v]=u)}this._httpHeaders.Range=`bytes=${g}-${F-1}`;const J=v=>{if(v.statusCode===404){const u=new M.MissingPDFException(`Missing PDF "${this._url}".`);this._storedError=u;return}this._setReadableStream(v)};if(this._request=null,this._url.protocol==="http:"){const v=require$$5;this._request=v.request(j(this._url,this._httpHeaders),J)}else{const v=require$$5;this._request=v.request(j(this._url,this._httpHeaders),J)}this._request.on("error",v=>{this._storedError=v}),this._request.end()}}class f extends O{constructor(T){super(T);let g=decodeURIComponent(this._url.path);B.test(this._url.href)&&(g=g.replace(/^\//,""));const F=require$$5;F.lstat(g,(J,v)=>{if(J){J.code==="ENOENT"&&(J=new M.MissingPDFException(`Missing PDF "${g}".`)),this._storedError=J,this._headersCapability.reject(J);return}this._contentLength=v.size,this._setReadableStream(F.createReadStream(g)),this._headersCapability.resolve()})}}class S extends I{constructor(T,g,F){super(T);let J=decodeURIComponent(this._url.path);B.test(this._url.href)&&(J=J.replace(/^\//,""));const v=require$$5;this._setReadableStream(v.createReadStream(J,{start:g,end:F-1}))}}},(lt,r,h)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.SVGGraphics=void 0;var M=h(6),p=h(1);const B={fontStyle:"normal",fontWeight:"normal",fillColor:"#000000"},Q="http://www.w3.org/XML/1998/namespace",U="http://www.w3.org/1999/xlink",O=["butt","round","square"],I=["miter","round","bevel"],j=function(v,u="",m=!1){if(URL.createObjectURL&&typeof Blob<"u"&&!m)return URL.createObjectURL(new Blob([v],{type:u}));const _="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";let $=`data:${u};base64,`;for(let P=0,Zt=v.length;P<Zt;P+=3){const dt=v[P]&255,It=v[P+1]&255,xt=v[P+2]&255,it=dt>>2,Xt=(dt&3)<<4|It>>4,zt=P+1<Zt?(It&15)<<2|xt>>6:64,Gt=P+2<Zt?xt&63:64;$+=_[it]+_[Xt]+_[zt]+_[Gt]}return $},q=function(){const v=new Uint8Array([137,80,78,71,13,10,26,10]),u=12,m=new Int32Array(256);for(let xt=0;xt<256;xt++){let it=xt;for(let Xt=0;Xt<8;Xt++)it=it&1?3988292384^it>>1&2147483647:it>>1&2147483647;m[xt]=it}function _(xt,it,Xt){let zt=-1;for(let Gt=it;Gt<Xt;Gt++){const Nt=(zt^xt[Gt])&255,Ut=m[Nt];zt=zt>>>8^Ut}return zt^-1}function $(xt,it,Xt,zt){let Gt=zt;const Nt=it.length;Xt[Gt]=Nt>>24&255,Xt[Gt+1]=Nt>>16&255,Xt[Gt+2]=Nt>>8&255,Xt[Gt+3]=Nt&255,Gt+=4,Xt[Gt]=xt.charCodeAt(0)&255,Xt[Gt+1]=xt.charCodeAt(1)&255,Xt[Gt+2]=xt.charCodeAt(2)&255,Xt[Gt+3]=xt.charCodeAt(3)&255,Gt+=4,Xt.set(it,Gt),Gt+=it.length;const Ut=_(Xt,zt+4,Gt);Xt[Gt]=Ut>>24&255,Xt[Gt+1]=Ut>>16&255,Xt[Gt+2]=Ut>>8&255,Xt[Gt+3]=Ut&255}function P(xt,it,Xt){let zt=1,Gt=0;for(let Nt=it;Nt<Xt;++Nt)zt=(zt+(xt[Nt]&255))%65521,Gt=(Gt+zt)%65521;return Gt<<16|zt}function Zt(xt){if(!p.isNodeJS)return dt(xt);try{const it=parseInt(process.versions.node)>=8?xt:Buffer.from(xt),Xt=require$$5.deflateSync(it,{level:9});return Xt instanceof Uint8Array?Xt:new Uint8Array(Xt)}catch(it){(0,p.warn)("Not compressing PNG because zlib.deflateSync is unavailable: "+it)}return dt(xt)}function dt(xt){let it=xt.length;const Xt=65535,zt=Math.ceil(it/Xt),Gt=new Uint8Array(2+it+zt*5+4);let Nt=0;Gt[Nt++]=120,Gt[Nt++]=156;let Ut=0;for(;it>Xt;)Gt[Nt++]=0,Gt[Nt++]=255,Gt[Nt++]=255,Gt[Nt++]=0,Gt[Nt++]=0,Gt.set(xt.subarray(Ut,Ut+Xt),Nt),Nt+=Xt,Ut+=Xt,it-=Xt;Gt[Nt++]=1,Gt[Nt++]=it&255,Gt[Nt++]=it>>8&255,Gt[Nt++]=~it&65535&255,Gt[Nt++]=(~it&65535)>>8&255,Gt.set(xt.subarray(Ut),Nt),Nt+=xt.length-Ut;const Vt=P(xt,0,xt.length);return Gt[Nt++]=Vt>>24&255,Gt[Nt++]=Vt>>16&255,Gt[Nt++]=Vt>>8&255,Gt[Nt++]=Vt&255,Gt}function It(xt,it,Xt,zt){const Gt=xt.width,Nt=xt.height;let Ut,Vt,Ht;const Pt=xt.data;switch(it){case p.ImageKind.GRAYSCALE_1BPP:Vt=0,Ut=1,Ht=Gt+7>>3;break;case p.ImageKind.RGB_24BPP:Vt=2,Ut=8,Ht=Gt*3;break;case p.ImageKind.RGBA_32BPP:Vt=6,Ut=8,Ht=Gt*4;break;default:throw new Error("invalid format")}const at=new Uint8Array((1+Ht)*Nt);let R=0,w=0;for(let Mt=0;Mt<Nt;++Mt)at[R++]=0,at.set(Pt.subarray(w,w+Ht),R),w+=Ht,R+=Ht;if(it===p.ImageKind.GRAYSCALE_1BPP&&zt){R=0;for(let Mt=0;Mt<Nt;Mt++){R++;for(let Rt=0;Rt<Ht;Rt++)at[R++]^=255}}const X=new Uint8Array([Gt>>24&255,Gt>>16&255,Gt>>8&255,Gt&255,Nt>>24&255,Nt>>16&255,Nt>>8&255,Nt&255,Ut,Vt,0,0,0]),C=Zt(at),H=v.length+u*3+X.length+C.length,st=new Uint8Array(H);let et=0;return st.set(v,et),et+=v.length,$("IHDR",X,st,et),et+=u+X.length,$("IDATA",C,st,et),et+=u+C.length,$("IEND",new Uint8Array(0),st,et),j(st,"image/png",Xt)}return function(it,Xt,zt){const Gt=it.kind===void 0?p.ImageKind.GRAYSCALE_1BPP:it.kind;return It(it,Gt,Xt,zt)}}();class K{constructor(){this.fontSizeScale=1,this.fontWeight=B.fontWeight,this.fontSize=0,this.textMatrix=p.IDENTITY_MATRIX,this.fontMatrix=p.FONT_IDENTITY_MATRIX,this.leading=0,this.textRenderingMode=p.TextRenderingMode.FILL,this.textMatrixScale=1,this.x=0,this.y=0,this.lineX=0,this.lineY=0,this.charSpacing=0,this.wordSpacing=0,this.textHScale=1,this.textRise=0,this.fillColor=B.fillColor,this.strokeColor="#000000",this.fillAlpha=1,this.strokeAlpha=1,this.lineWidth=1,this.lineJoin="",this.lineCap="",this.miterLimit=0,this.dashArray=[],this.dashPhase=0,this.dependencies=[],this.activeClipUrl=null,this.clipGroup=null,this.maskId=""}clone(){return Object.create(this)}setCurrentPoint(u,m){this.x=u,this.y=m}}function f(v){let u=[];const m=[];for(const _ of v){if(_.fn==="save"){u.push({fnId:92,fn:"group",items:[]}),m.push(u),u=u.at(-1).items;continue}_.fn==="restore"?u=m.pop():u.push(_)}return u}function S(v){if(Number.isInteger(v))return v.toString();const u=v.toFixed(10);let m=u.length-1;if(u[m]!=="0")return u;do m--;while(u[m]==="0");return u.substring(0,u[m]==="."?m:m+1)}function k(v){if(v[4]===0&&v[5]===0){if(v[1]===0&&v[2]===0)return v[0]===1&&v[3]===1?"":`scale(${S(v[0])} ${S(v[3])})`;if(v[0]===v[3]&&v[1]===-v[2]){const u=Math.acos(v[0])*180/Math.PI;return`rotate(${S(u)})`}}else if(v[0]===1&&v[1]===0&&v[2]===0&&v[3]===1)return`translate(${S(v[4])} ${S(v[5])})`;return`matrix(${S(v[0])} ${S(v[1])} ${S(v[2])} ${S(v[3])} ${S(v[4])} ${S(v[5])})`}let T=0,g=0,F=0;class J{constructor(u,m,_=!1){(0,M.deprecated)("The SVG back-end is no longer maintained and *may* be removed in the future."),this.svgFactory=new M.DOMSVGFactory,this.current=new K,this.transformMatrix=p.IDENTITY_MATRIX,this.transformStack=[],this.extraStack=[],this.commonObjs=u,this.objs=m,this.pendingClip=null,this.pendingEOFill=!1,this.embedFonts=!1,this.embeddedFonts=Object.create(null),this.cssStyle=null,this.forceDataSchema=!!_,this._operatorIdMapping=[];for(const $ in p.OPS)this._operatorIdMapping[p.OPS[$]]=$}getObject(u,m=null){return typeof u=="string"?u.startsWith("g_")?this.commonObjs.get(u):this.objs.get(u):m}save(){this.transformStack.push(this.transformMatrix);const u=this.current;this.extraStack.push(u),this.current=u.clone()}restore(){this.transformMatrix=this.transformStack.pop(),this.current=this.extraStack.pop(),this.pendingClip=null,this.tgrp=null}group(u){this.save(),this.executeOpTree(u),this.restore()}loadDependencies(u){const m=u.fnArray,_=u.argsArray;for(let $=0,P=m.length;$<P;$++)if(m[$]===p.OPS.dependency)for(const Zt of _[$]){const dt=Zt.startsWith("g_")?this.commonObjs:this.objs,It=new Promise(xt=>{dt.get(Zt,xt)});this.current.dependencies.push(It)}return Promise.all(this.current.dependencies)}transform(u,m,_,$,P,Zt){const dt=[u,m,_,$,P,Zt];this.transformMatrix=p.Util.transform(this.transformMatrix,dt),this.tgrp=null}getSVG(u,m){this.viewport=m;const _=this._initialize(m);return this.loadDependencies(u).then(()=>(this.transformMatrix=p.IDENTITY_MATRIX,this.executeOpTree(this.convertOpList(u)),_))}convertOpList(u){const m=this._operatorIdMapping,_=u.argsArray,$=u.fnArray,P=[];for(let Zt=0,dt=$.length;Zt<dt;Zt++){const It=$[Zt];P.push({fnId:It,fn:m[It],args:_[Zt]})}return f(P)}executeOpTree(u){for(const m of u){const _=m.fn,$=m.fnId,P=m.args;switch($|0){case p.OPS.beginText:this.beginText();break;case p.OPS.dependency:break;case p.OPS.setLeading:this.setLeading(P);break;case p.OPS.setLeadingMoveText:this.setLeadingMoveText(P[0],P[1]);break;case p.OPS.setFont:this.setFont(P);break;case p.OPS.showText:this.showText(P[0]);break;case p.OPS.showSpacedText:this.showText(P[0]);break;case p.OPS.endText:this.endText();break;case p.OPS.moveText:this.moveText(P[0],P[1]);break;case p.OPS.setCharSpacing:this.setCharSpacing(P[0]);break;case p.OPS.setWordSpacing:this.setWordSpacing(P[0]);break;case p.OPS.setHScale:this.setHScale(P[0]);break;case p.OPS.setTextMatrix:this.setTextMatrix(P[0],P[1],P[2],P[3],P[4],P[5]);break;case p.OPS.setTextRise:this.setTextRise(P[0]);break;case p.OPS.setTextRenderingMode:this.setTextRenderingMode(P[0]);break;case p.OPS.setLineWidth:this.setLineWidth(P[0]);break;case p.OPS.setLineJoin:this.setLineJoin(P[0]);break;case p.OPS.setLineCap:this.setLineCap(P[0]);break;case p.OPS.setMiterLimit:this.setMiterLimit(P[0]);break;case p.OPS.setFillRGBColor:this.setFillRGBColor(P[0],P[1],P[2]);break;case p.OPS.setStrokeRGBColor:this.setStrokeRGBColor(P[0],P[1],P[2]);break;case p.OPS.setStrokeColorN:this.setStrokeColorN(P);break;case p.OPS.setFillColorN:this.setFillColorN(P);break;case p.OPS.shadingFill:this.shadingFill(P[0]);break;case p.OPS.setDash:this.setDash(P[0],P[1]);break;case p.OPS.setRenderingIntent:this.setRenderingIntent(P[0]);break;case p.OPS.setFlatness:this.setFlatness(P[0]);break;case p.OPS.setGState:this.setGState(P[0]);break;case p.OPS.fill:this.fill();break;case p.OPS.eoFill:this.eoFill();break;case p.OPS.stroke:this.stroke();break;case p.OPS.fillStroke:this.fillStroke();break;case p.OPS.eoFillStroke:this.eoFillStroke();break;case p.OPS.clip:this.clip("nonzero");break;case p.OPS.eoClip:this.clip("evenodd");break;case p.OPS.paintSolidColorImageMask:this.paintSolidColorImageMask();break;case p.OPS.paintImageXObject:this.paintImageXObject(P[0]);break;case p.OPS.paintInlineImageXObject:this.paintInlineImageXObject(P[0]);break;case p.OPS.paintImageMaskXObject:this.paintImageMaskXObject(P[0]);break;case p.OPS.paintFormXObjectBegin:this.paintFormXObjectBegin(P[0],P[1]);break;case p.OPS.paintFormXObjectEnd:this.paintFormXObjectEnd();break;case p.OPS.closePath:this.closePath();break;case p.OPS.closeStroke:this.closeStroke();break;case p.OPS.closeFillStroke:this.closeFillStroke();break;case p.OPS.closeEOFillStroke:this.closeEOFillStroke();break;case p.OPS.nextLine:this.nextLine();break;case p.OPS.transform:this.transform(P[0],P[1],P[2],P[3],P[4],P[5]);break;case p.OPS.constructPath:this.constructPath(P[0],P[1]);break;case p.OPS.endPath:this.endPath();break;case 92:this.group(m.items);break;default:(0,p.warn)(`Unimplemented operator ${_}`);break}}}setWordSpacing(u){this.current.wordSpacing=u}setCharSpacing(u){this.current.charSpacing=u}nextLine(){this.moveText(0,this.current.leading)}setTextMatrix(u,m,_,$,P,Zt){const dt=this.current;dt.textMatrix=dt.lineMatrix=[u,m,_,$,P,Zt],dt.textMatrixScale=Math.hypot(u,m),dt.x=dt.lineX=0,dt.y=dt.lineY=0,dt.xcoords=[],dt.ycoords=[],dt.tspan=this.svgFactory.createElement("svg:tspan"),dt.tspan.setAttributeNS(null,"font-family",dt.fontFamily),dt.tspan.setAttributeNS(null,"font-size",`${S(dt.fontSize)}px`),dt.tspan.setAttributeNS(null,"y",S(-dt.y)),dt.txtElement=this.svgFactory.createElement("svg:text"),dt.txtElement.append(dt.tspan)}beginText(){const u=this.current;u.x=u.lineX=0,u.y=u.lineY=0,u.textMatrix=p.IDENTITY_MATRIX,u.lineMatrix=p.IDENTITY_MATRIX,u.textMatrixScale=1,u.tspan=this.svgFactory.createElement("svg:tspan"),u.txtElement=this.svgFactory.createElement("svg:text"),u.txtgrp=this.svgFactory.createElement("svg:g"),u.xcoords=[],u.ycoords=[]}moveText(u,m){const _=this.current;_.x=_.lineX+=u,_.y=_.lineY+=m,_.xcoords=[],_.ycoords=[],_.tspan=this.svgFactory.createElement("svg:tspan"),_.tspan.setAttributeNS(null,"font-family",_.fontFamily),_.tspan.setAttributeNS(null,"font-size",`${S(_.fontSize)}px`),_.tspan.setAttributeNS(null,"y",S(-_.y))}showText(u){const m=this.current,_=m.font,$=m.fontSize;if($===0)return;const P=m.fontSizeScale,Zt=m.charSpacing,dt=m.wordSpacing,It=m.fontDirection,xt=m.textHScale*It,it=_.vertical,Xt=it?1:-1,zt=_.defaultVMetrics,Gt=$*m.fontMatrix[0];let Nt=0;for(const Ht of u){if(Ht===null){Nt+=It*dt;continue}else if(typeof Ht=="number"){Nt+=Xt*Ht*$/1e3;continue}const Pt=(Ht.isSpace?dt:0)+Zt,at=Ht.fontChar;let R,w,X=Ht.width;if(it){let H;const st=Ht.vmetric||zt;H=Ht.vmetric?st[1]:X*.5,H=-H*Gt;const et=st[2]*Gt;X=st?-st[0]:X,R=H/P,w=(Nt+et)/P}else R=Nt/P,w=0;(Ht.isInFont||_.missingFile)&&(m.xcoords.push(m.x+R),it&&m.ycoords.push(-m.y+w),m.tspan.textContent+=at);const C=it?X*Gt-Pt*It:X*Gt+Pt*It;Nt+=C}m.tspan.setAttributeNS(null,"x",m.xcoords.map(S).join(" ")),it?m.tspan.setAttributeNS(null,"y",m.ycoords.map(S).join(" ")):m.tspan.setAttributeNS(null,"y",S(-m.y)),it?m.y-=Nt:m.x+=Nt*xt,m.tspan.setAttributeNS(null,"font-family",m.fontFamily),m.tspan.setAttributeNS(null,"font-size",`${S(m.fontSize)}px`),m.fontStyle!==B.fontStyle&&m.tspan.setAttributeNS(null,"font-style",m.fontStyle),m.fontWeight!==B.fontWeight&&m.tspan.setAttributeNS(null,"font-weight",m.fontWeight);const Ut=m.textRenderingMode&p.TextRenderingMode.FILL_STROKE_MASK;if(Ut===p.TextRenderingMode.FILL||Ut===p.TextRenderingMode.FILL_STROKE?(m.fillColor!==B.fillColor&&m.tspan.setAttributeNS(null,"fill",m.fillColor),m.fillAlpha<1&&m.tspan.setAttributeNS(null,"fill-opacity",m.fillAlpha)):m.textRenderingMode===p.TextRenderingMode.ADD_TO_PATH?m.tspan.setAttributeNS(null,"fill","transparent"):m.tspan.setAttributeNS(null,"fill","none"),Ut===p.TextRenderingMode.STROKE||Ut===p.TextRenderingMode.FILL_STROKE){const Ht=1/(m.textMatrixScale||1);this._setStrokeAttributes(m.tspan,Ht)}let Vt=m.textMatrix;m.textRise!==0&&(Vt=Vt.slice(),Vt[5]+=m.textRise),m.txtElement.setAttributeNS(null,"transform",`${k(Vt)} scale(${S(xt)}, -1)`),m.txtElement.setAttributeNS(Q,"xml:space","preserve"),m.txtElement.append(m.tspan),m.txtgrp.append(m.txtElement),this._ensureTransformGroup().append(m.txtElement)}setLeadingMoveText(u,m){this.setLeading(-m),this.moveText(u,m)}addFontStyle(u){if(!u.data)throw new Error('addFontStyle: No font data available, ensure that the "fontExtraProperties" API parameter is set.');this.cssStyle||(this.cssStyle=this.svgFactory.createElement("svg:style"),this.cssStyle.setAttributeNS(null,"type","text/css"),this.defs.append(this.cssStyle));const m=j(u.data,u.mimetype,this.forceDataSchema);this.cssStyle.textContent+=`@font-face { font-family: "${u.loadedName}"; src: url(${m}); }
|
|
4
4
|
`}setFont(u){const m=this.current,_=this.commonObjs.get(u[0]);let $=u[1];m.font=_,this.embedFonts&&!_.missingFile&&!this.embeddedFonts[_.loadedName]&&(this.addFontStyle(_),this.embeddedFonts[_.loadedName]=_),m.fontMatrix=_.fontMatrix||p.FONT_IDENTITY_MATRIX;let P="normal";_.black?P="900":_.bold&&(P="bold");const Zt=_.italic?"italic":"normal";$<0?($=-$,m.fontDirection=-1):m.fontDirection=1,m.fontSize=$,m.fontFamily=_.loadedName,m.fontWeight=P,m.fontStyle=Zt,m.tspan=this.svgFactory.createElement("svg:tspan"),m.tspan.setAttributeNS(null,"y",S(-m.y)),m.xcoords=[],m.ycoords=[]}endText(){var m;const u=this.current;u.textRenderingMode&p.TextRenderingMode.ADD_TO_PATH_FLAG&&((m=u.txtElement)!=null&&m.hasChildNodes())&&(u.element=u.txtElement,this.clip("nonzero"),this.endPath())}setLineWidth(u){u>0&&(this.current.lineWidth=u)}setLineCap(u){this.current.lineCap=O[u]}setLineJoin(u){this.current.lineJoin=I[u]}setMiterLimit(u){this.current.miterLimit=u}setStrokeAlpha(u){this.current.strokeAlpha=u}setStrokeRGBColor(u,m,_){this.current.strokeColor=p.Util.makeHexColor(u,m,_)}setFillAlpha(u){this.current.fillAlpha=u}setFillRGBColor(u,m,_){this.current.fillColor=p.Util.makeHexColor(u,m,_),this.current.tspan=this.svgFactory.createElement("svg:tspan"),this.current.xcoords=[],this.current.ycoords=[]}setStrokeColorN(u){this.current.strokeColor=this._makeColorN_Pattern(u)}setFillColorN(u){this.current.fillColor=this._makeColorN_Pattern(u)}shadingFill(u){const{width:m,height:_}=this.viewport,$=p.Util.inverseTransform(this.transformMatrix),[P,Zt,dt,It]=p.Util.getAxialAlignedBoundingBox([0,0,m,_],$),xt=this.svgFactory.createElement("svg:rect");xt.setAttributeNS(null,"x",P),xt.setAttributeNS(null,"y",Zt),xt.setAttributeNS(null,"width",dt-P),xt.setAttributeNS(null,"height",It-Zt),xt.setAttributeNS(null,"fill",this._makeShadingPattern(u)),this.current.fillAlpha<1&&xt.setAttributeNS(null,"fill-opacity",this.current.fillAlpha),this._ensureTransformGroup().append(xt)}_makeColorN_Pattern(u){return u[0]==="TilingPattern"?this._makeTilingPattern(u):this._makeShadingPattern(u)}_makeTilingPattern(u){const m=u[1],_=u[2],$=u[3]||p.IDENTITY_MATRIX,[P,Zt,dt,It]=u[4],xt=u[5],it=u[6],Xt=u[7],zt=`shading${F++}`,[Gt,Nt,Ut,Vt]=p.Util.normalizeRect([...p.Util.applyTransform([P,Zt],$),...p.Util.applyTransform([dt,It],$)]),[Ht,Pt]=p.Util.singularValueDecompose2dScale($),at=xt*Ht,R=it*Pt,w=this.svgFactory.createElement("svg:pattern");w.setAttributeNS(null,"id",zt),w.setAttributeNS(null,"patternUnits","userSpaceOnUse"),w.setAttributeNS(null,"width",at),w.setAttributeNS(null,"height",R),w.setAttributeNS(null,"x",`${Gt}`),w.setAttributeNS(null,"y",`${Nt}`);const X=this.svg,C=this.transformMatrix,H=this.current.fillColor,st=this.current.strokeColor,et=this.svgFactory.create(Ut-Gt,Vt-Nt);if(this.svg=et,this.transformMatrix=$,Xt===2){const Mt=p.Util.makeHexColor(...m);this.current.fillColor=Mt,this.current.strokeColor=Mt}return this.executeOpTree(this.convertOpList(_)),this.svg=X,this.transformMatrix=C,this.current.fillColor=H,this.current.strokeColor=st,w.append(et.childNodes[0]),this.defs.append(w),`url(#${zt})`}_makeShadingPattern(u){switch(typeof u=="string"&&(u=this.objs.get(u)),u[0]){case"RadialAxial":const m=`shading${F++}`,_=u[3];let $;switch(u[1]){case"axial":const P=u[4],Zt=u[5];$=this.svgFactory.createElement("svg:linearGradient"),$.setAttributeNS(null,"id",m),$.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),$.setAttributeNS(null,"x1",P[0]),$.setAttributeNS(null,"y1",P[1]),$.setAttributeNS(null,"x2",Zt[0]),$.setAttributeNS(null,"y2",Zt[1]);break;case"radial":const dt=u[4],It=u[5],xt=u[6],it=u[7];$=this.svgFactory.createElement("svg:radialGradient"),$.setAttributeNS(null,"id",m),$.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),$.setAttributeNS(null,"cx",It[0]),$.setAttributeNS(null,"cy",It[1]),$.setAttributeNS(null,"r",it),$.setAttributeNS(null,"fx",dt[0]),$.setAttributeNS(null,"fy",dt[1]),$.setAttributeNS(null,"fr",xt);break;default:throw new Error(`Unknown RadialAxial type: ${u[1]}`)}for(const P of _){const Zt=this.svgFactory.createElement("svg:stop");Zt.setAttributeNS(null,"offset",P[0]),Zt.setAttributeNS(null,"stop-color",P[1]),$.append(Zt)}return this.defs.append($),`url(#${m})`;case"Mesh":return(0,p.warn)("Unimplemented pattern Mesh"),null;case"Dummy":return"hotpink";default:throw new Error(`Unknown IR type: ${u[0]}`)}}setDash(u,m){this.current.dashArray=u,this.current.dashPhase=m}constructPath(u,m){const _=this.current;let $=_.x,P=_.y,Zt=[],dt=0;for(const It of u)switch(It|0){case p.OPS.rectangle:$=m[dt++],P=m[dt++];const xt=m[dt++],it=m[dt++],Xt=$+xt,zt=P+it;Zt.push("M",S($),S(P),"L",S(Xt),S(P),"L",S(Xt),S(zt),"L",S($),S(zt),"Z");break;case p.OPS.moveTo:$=m[dt++],P=m[dt++],Zt.push("M",S($),S(P));break;case p.OPS.lineTo:$=m[dt++],P=m[dt++],Zt.push("L",S($),S(P));break;case p.OPS.curveTo:$=m[dt+4],P=m[dt+5],Zt.push("C",S(m[dt]),S(m[dt+1]),S(m[dt+2]),S(m[dt+3]),S($),S(P)),dt+=6;break;case p.OPS.curveTo2:Zt.push("C",S($),S(P),S(m[dt]),S(m[dt+1]),S(m[dt+2]),S(m[dt+3])),$=m[dt+2],P=m[dt+3],dt+=4;break;case p.OPS.curveTo3:$=m[dt+2],P=m[dt+3],Zt.push("C",S(m[dt]),S(m[dt+1]),S($),S(P),S($),S(P)),dt+=4;break;case p.OPS.closePath:Zt.push("Z");break}Zt=Zt.join(" "),_.path&&u.length>0&&u[0]!==p.OPS.rectangle&&u[0]!==p.OPS.moveTo?Zt=_.path.getAttributeNS(null,"d")+Zt:(_.path=this.svgFactory.createElement("svg:path"),this._ensureTransformGroup().append(_.path)),_.path.setAttributeNS(null,"d",Zt),_.path.setAttributeNS(null,"fill","none"),_.element=_.path,_.setCurrentPoint($,P)}endPath(){const u=this.current;if(u.path=null,!this.pendingClip)return;if(!u.element){this.pendingClip=null;return}const m=`clippath${T++}`,_=this.svgFactory.createElement("svg:clipPath");_.setAttributeNS(null,"id",m),_.setAttributeNS(null,"transform",k(this.transformMatrix));const $=u.element.cloneNode(!0);if(this.pendingClip==="evenodd"?$.setAttributeNS(null,"clip-rule","evenodd"):$.setAttributeNS(null,"clip-rule","nonzero"),this.pendingClip=null,_.append($),this.defs.append(_),u.activeClipUrl){u.clipGroup=null;for(const P of this.extraStack)P.clipGroup=null;_.setAttributeNS(null,"clip-path",u.activeClipUrl)}u.activeClipUrl=`url(#${m})`,this.tgrp=null}clip(u){this.pendingClip=u}closePath(){const u=this.current;if(u.path){const m=`${u.path.getAttributeNS(null,"d")}Z`;u.path.setAttributeNS(null,"d",m)}}setLeading(u){this.current.leading=-u}setTextRise(u){this.current.textRise=u}setTextRenderingMode(u){this.current.textRenderingMode=u}setHScale(u){this.current.textHScale=u/100}setRenderingIntent(u){}setFlatness(u){}setGState(u){for(const[m,_]of u)switch(m){case"LW":this.setLineWidth(_);break;case"LC":this.setLineCap(_);break;case"LJ":this.setLineJoin(_);break;case"ML":this.setMiterLimit(_);break;case"D":this.setDash(_[0],_[1]);break;case"RI":this.setRenderingIntent(_);break;case"FL":this.setFlatness(_);break;case"Font":this.setFont(_);break;case"CA":this.setStrokeAlpha(_);break;case"ca":this.setFillAlpha(_);break;default:(0,p.warn)(`Unimplemented graphic state operator ${m}`);break}}fill(){const u=this.current;u.element&&(u.element.setAttributeNS(null,"fill",u.fillColor),u.element.setAttributeNS(null,"fill-opacity",u.fillAlpha),this.endPath())}stroke(){const u=this.current;u.element&&(this._setStrokeAttributes(u.element),u.element.setAttributeNS(null,"fill","none"),this.endPath())}_setStrokeAttributes(u,m=1){const _=this.current;let $=_.dashArray;m!==1&&$.length>0&&($=$.map(function(P){return m*P})),u.setAttributeNS(null,"stroke",_.strokeColor),u.setAttributeNS(null,"stroke-opacity",_.strokeAlpha),u.setAttributeNS(null,"stroke-miterlimit",S(_.miterLimit)),u.setAttributeNS(null,"stroke-linecap",_.lineCap),u.setAttributeNS(null,"stroke-linejoin",_.lineJoin),u.setAttributeNS(null,"stroke-width",S(m*_.lineWidth)+"px"),u.setAttributeNS(null,"stroke-dasharray",$.map(S).join(" ")),u.setAttributeNS(null,"stroke-dashoffset",S(m*_.dashPhase)+"px")}eoFill(){var u;(u=this.current.element)==null||u.setAttributeNS(null,"fill-rule","evenodd"),this.fill()}fillStroke(){this.stroke(),this.fill()}eoFillStroke(){var u;(u=this.current.element)==null||u.setAttributeNS(null,"fill-rule","evenodd"),this.fillStroke()}closeStroke(){this.closePath(),this.stroke()}closeFillStroke(){this.closePath(),this.fillStroke()}closeEOFillStroke(){this.closePath(),this.eoFillStroke()}paintSolidColorImageMask(){const u=this.svgFactory.createElement("svg:rect");u.setAttributeNS(null,"x","0"),u.setAttributeNS(null,"y","0"),u.setAttributeNS(null,"width","1px"),u.setAttributeNS(null,"height","1px"),u.setAttributeNS(null,"fill",this.current.fillColor),this._ensureTransformGroup().append(u)}paintImageXObject(u){const m=this.getObject(u);if(!m){(0,p.warn)(`Dependent image with object ID ${u} is not ready yet`);return}this.paintInlineImageXObject(m)}paintInlineImageXObject(u,m){const _=u.width,$=u.height,P=q(u,this.forceDataSchema,!!m),Zt=this.svgFactory.createElement("svg:rect");Zt.setAttributeNS(null,"x","0"),Zt.setAttributeNS(null,"y","0"),Zt.setAttributeNS(null,"width",S(_)),Zt.setAttributeNS(null,"height",S($)),this.current.element=Zt,this.clip("nonzero");const dt=this.svgFactory.createElement("svg:image");dt.setAttributeNS(U,"xlink:href",P),dt.setAttributeNS(null,"x","0"),dt.setAttributeNS(null,"y",S(-$)),dt.setAttributeNS(null,"width",S(_)+"px"),dt.setAttributeNS(null,"height",S($)+"px"),dt.setAttributeNS(null,"transform",`scale(${S(1/_)} ${S(-1/$)})`),m?m.append(dt):this._ensureTransformGroup().append(dt)}paintImageMaskXObject(u){const m=this.getObject(u.data,u);if(m.bitmap){(0,p.warn)("paintImageMaskXObject: ImageBitmap support is not implemented, ensure that the `isOffscreenCanvasSupported` API parameter is disabled.");return}const _=this.current,$=m.width,P=m.height,Zt=_.fillColor;_.maskId=`mask${g++}`;const dt=this.svgFactory.createElement("svg:mask");dt.setAttributeNS(null,"id",_.maskId);const It=this.svgFactory.createElement("svg:rect");It.setAttributeNS(null,"x","0"),It.setAttributeNS(null,"y","0"),It.setAttributeNS(null,"width",S($)),It.setAttributeNS(null,"height",S(P)),It.setAttributeNS(null,"fill",Zt),It.setAttributeNS(null,"mask",`url(#${_.maskId})`),this.defs.append(dt),this._ensureTransformGroup().append(It),this.paintInlineImageXObject(m,dt)}paintFormXObjectBegin(u,m){if(Array.isArray(u)&&u.length===6&&this.transform(u[0],u[1],u[2],u[3],u[4],u[5]),m){const _=m[2]-m[0],$=m[3]-m[1],P=this.svgFactory.createElement("svg:rect");P.setAttributeNS(null,"x",m[0]),P.setAttributeNS(null,"y",m[1]),P.setAttributeNS(null,"width",S(_)),P.setAttributeNS(null,"height",S($)),this.current.element=P,this.clip("nonzero"),this.endPath()}}paintFormXObjectEnd(){}_initialize(u){const m=this.svgFactory.create(u.width,u.height),_=this.svgFactory.createElement("svg:defs");m.append(_),this.defs=_;const $=this.svgFactory.createElement("svg:g");return $.setAttributeNS(null,"transform",k(u.transform)),m.append($),this.svg=$,m}_ensureClipGroup(){if(!this.current.clipGroup){const u=this.svgFactory.createElement("svg:g");u.setAttributeNS(null,"clip-path",this.current.activeClipUrl),this.svg.append(u),this.current.clipGroup=u}return this.current.clipGroup}_ensureTransformGroup(){return this.tgrp||(this.tgrp=this.svgFactory.createElement("svg:g"),this.tgrp.setAttributeNS(null,"transform",k(this.transformMatrix)),this.current.activeClipUrl?this._ensureClipGroup().append(this.tgrp):this.svg.append(this.tgrp)),this.tgrp}}r.SVGGraphics=J},(lt,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.XfaText=void 0;class h{static textContent(p){const B=[],Q={items:B,styles:Object.create(null)};function U(O){var q;if(!O)return;let I=null;const j=O.name;if(j==="#text")I=O.value;else if(h.shouldBuildText(j))(q=O==null?void 0:O.attributes)!=null&&q.textContent?I=O.attributes.textContent:O.value&&(I=O.value);else return;if(I!==null&&B.push({str:I}),!!O.children)for(const K of O.children)U(K)}return U(p),Q}static shouldBuildText(p){return!(p==="textarea"||p==="input"||p==="option"||p==="select")}}r.XfaText=h},(lt,r,h)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.TextLayerRenderTask=void 0,r.renderTextLayer=k,r.updateTextLayer=T;var M=h(1),p=h(6);const B=1e5,Q=30,U=.8,O=new Map;function I(g,F){let J;if(F&&M.FeatureTest.isOffscreenCanvasSupported)J=new OffscreenCanvas(g,g).getContext("2d",{alpha:!1});else{const v=document.createElement("canvas");v.width=v.height=g,J=v.getContext("2d",{alpha:!1})}return J}function j(g,F){const J=O.get(g);if(J)return J;const v=I(Q,F);v.font=`${Q}px ${g}`;const u=v.measureText("");let m=u.fontBoundingBoxAscent,_=Math.abs(u.fontBoundingBoxDescent);if(m){const P=m/(m+_);return O.set(g,P),v.canvas.width=v.canvas.height=0,P}v.strokeStyle="red",v.clearRect(0,0,Q,Q),v.strokeText("g",0,0);let $=v.getImageData(0,0,Q,Q).data;_=0;for(let P=$.length-1-3;P>=0;P-=4)if($[P]>0){_=Math.ceil(P/4/Q);break}v.clearRect(0,0,Q,Q),v.strokeText("A",0,Q),$=v.getImageData(0,0,Q,Q).data,m=0;for(let P=0,Zt=$.length;P<Zt;P+=4)if($[P]>0){m=Q-Math.floor(P/4/Q);break}if(v.canvas.width=v.canvas.height=0,m){const P=m/(m+_);return O.set(g,P),P}return O.set(g,U),U}function q(g,F,J){const v=document.createElement("span"),u={angle:0,canvasWidth:0,hasText:F.str!=="",hasEOL:F.hasEOL,fontSize:0};g._textDivs.push(v);const m=M.Util.transform(g._transform,F.transform);let _=Math.atan2(m[1],m[0]);const $=J[F.fontName];$.vertical&&(_+=Math.PI/2);const P=Math.hypot(m[2],m[3]),Zt=P*j($.fontFamily,g._isOffscreenCanvasSupported);let dt,It;_===0?(dt=m[4],It=m[5]-Zt):(dt=m[4]+Zt*Math.sin(_),It=m[5]-Zt*Math.cos(_));const xt="calc(var(--scale-factor)*",it=v.style;g._container===g._rootContainer?(it.left=`${(100*dt/g._pageWidth).toFixed(2)}%`,it.top=`${(100*It/g._pageHeight).toFixed(2)}%`):(it.left=`${xt}${dt.toFixed(2)}px)`,it.top=`${xt}${It.toFixed(2)}px)`),it.fontSize=`${xt}${P.toFixed(2)}px)`,it.fontFamily=$.fontFamily,u.fontSize=P,v.setAttribute("role","presentation"),v.textContent=F.str,v.dir=F.dir,g._fontInspectorEnabled&&(v.dataset.fontName=F.fontName),_!==0&&(u.angle=_*(180/Math.PI));let Xt=!1;if(F.str.length>1)Xt=!0;else if(F.str!==" "&&F.transform[0]!==F.transform[3]){const zt=Math.abs(F.transform[0]),Gt=Math.abs(F.transform[3]);zt!==Gt&&Math.max(zt,Gt)/Math.min(zt,Gt)>1.5&&(Xt=!0)}Xt&&(u.canvasWidth=$.vertical?F.height:F.width),g._textDivProperties.set(v,u),g._isReadableStream&&g._layoutText(v)}function K(g){const{div:F,scale:J,properties:v,ctx:u,prevFontSize:m,prevFontFamily:_}=g,{style:$}=F;let P="";if(v.canvasWidth!==0&&v.hasText){const{fontFamily:Zt}=$,{canvasWidth:dt,fontSize:It}=v;(m!==It||_!==Zt)&&(u.font=`${It*J}px ${Zt}`,g.prevFontSize=It,g.prevFontFamily=Zt);const{width:xt}=u.measureText(F.textContent);xt>0&&(P=`scaleX(${dt*J/xt})`)}v.angle!==0&&(P=`rotate(${v.angle}deg) ${P}`),P.length>0&&($.transform=P)}function f(g){if(g._canceled)return;const F=g._textDivs,J=g._capability;if(F.length>B){J.resolve();return}if(!g._isReadableStream)for(const u of F)g._layoutText(u);J.resolve()}class S{constructor({textContentSource:F,container:J,viewport:v,textDivs:u,textDivProperties:m,textContentItemsStr:_,isOffscreenCanvasSupported:$}){var xt;this._textContentSource=F,this._isReadableStream=F instanceof ReadableStream,this._container=this._rootContainer=J,this._textDivs=u||[],this._textContentItemsStr=_||[],this._isOffscreenCanvasSupported=$,this._fontInspectorEnabled=!!((xt=globalThis.FontInspector)!=null&&xt.enabled),this._reader=null,this._textDivProperties=m||new WeakMap,this._canceled=!1,this._capability=new M.PromiseCapability,this._layoutTextParams={prevFontSize:null,prevFontFamily:null,div:null,scale:v.scale*(globalThis.devicePixelRatio||1),properties:null,ctx:I(0,$)};const{pageWidth:P,pageHeight:Zt,pageX:dt,pageY:It}=v.rawDims;this._transform=[1,0,0,-1,-dt,It+Zt],this._pageWidth=P,this._pageHeight=Zt,(0,p.setLayerDimensions)(J,v),this._capability.promise.finally(()=>{this._layoutTextParams=null}).catch(()=>{})}get promise(){return this._capability.promise}cancel(){this._canceled=!0,this._reader&&(this._reader.cancel(new M.AbortException("TextLayer task cancelled.")).catch(()=>{}),this._reader=null),this._capability.reject(new M.AbortException("TextLayer task cancelled."))}_processItems(F,J){for(const v of F){if(v.str===void 0){if(v.type==="beginMarkedContentProps"||v.type==="beginMarkedContent"){const u=this._container;this._container=document.createElement("span"),this._container.classList.add("markedContent"),v.id!==null&&this._container.setAttribute("id",`${v.id}`),u.append(this._container)}else v.type==="endMarkedContent"&&(this._container=this._container.parentNode);continue}this._textContentItemsStr.push(v.str),q(this,v,J)}}_layoutText(F){const J=this._layoutTextParams.properties=this._textDivProperties.get(F);if(this._layoutTextParams.div=F,K(this._layoutTextParams),J.hasText&&this._container.append(F),J.hasEOL){const v=document.createElement("br");v.setAttribute("role","presentation"),this._container.append(v)}}_render(){const F=new M.PromiseCapability;let J=Object.create(null);if(this._isReadableStream){const v=()=>{this._reader.read().then(({value:u,done:m})=>{if(m){F.resolve();return}Object.assign(J,u.styles),this._processItems(u.items,J),v()},F.reject)};this._reader=this._textContentSource.getReader(),v()}else if(this._textContentSource){const{items:v,styles:u}=this._textContentSource;this._processItems(v,u),F.resolve()}else throw new Error('No "textContentSource" parameter specified.');F.promise.then(()=>{J=null,f(this)},this._capability.reject)}}r.TextLayerRenderTask=S;function k(g){!g.textContentSource&&(g.textContent||g.textContentStream)&&((0,p.deprecated)("The TextLayerRender `textContent`/`textContentStream` parameters will be removed in the future, please use `textContentSource` instead."),g.textContentSource=g.textContent||g.textContentStream);const{container:F,viewport:J}=g,v=getComputedStyle(F),u=v.getPropertyValue("visibility"),m=parseFloat(v.getPropertyValue("--scale-factor"));u==="visible"&&(!m||Math.abs(m-J.scale)>1e-5)&&console.error("The `--scale-factor` CSS-variable must be set, to the same value as `viewport.scale`, either on the `container`-element itself or higher up in the DOM.");const _=new S(g);return _._render(),_}function T({container:g,viewport:F,textDivs:J,textDivProperties:v,isOffscreenCanvasSupported:u,mustRotate:m=!0,mustRescale:_=!0}){if(m&&(0,p.setLayerDimensions)(g,{rotation:F.rotation}),_){const $=I(0,u),Zt={prevFontSize:null,prevFontFamily:null,div:null,scale:F.scale*(globalThis.devicePixelRatio||1),properties:null,ctx:$};for(const dt of J)Zt.properties=v.get(dt),Zt.div=dt,K(Zt)}}},(lt,r,h)=>{var j,q,K,f,S,k,T,g,F,J,v,Fe,m,be,$,Je,Zt,Oe;Object.defineProperty(r,"__esModule",{value:!0}),r.AnnotationEditorLayer=void 0;var M=h(1),p=h(4),B=h(28),Q=h(33),U=h(6),O=h(34);const It=class It{constructor({uiManager:it,pageIndex:Xt,div:zt,accessibilityManager:Gt,annotationLayer:Nt,viewport:Ut,l10n:Vt}){ll(this,v);ll(this,m);ll(this,$);ll(this,Zt);ll(this,j,void 0);ll(this,q,!1);ll(this,K,null);ll(this,f,this.pointerup.bind(this));ll(this,S,this.pointerdown.bind(this));ll(this,k,new Map);ll(this,T,!1);ll(this,g,!1);ll(this,F,!1);ll(this,J,void 0);const Ht=[B.FreeTextEditor,Q.InkEditor,O.StampEditor];if(!It._initialized){It._initialized=!0;for(const Pt of Ht)Pt.initialize(Vt)}it.registerEditorTypes(Ht),ul(this,J,it),this.pageIndex=Xt,this.div=zt,ul(this,j,Gt),ul(this,K,Nt),this.viewport=Ut,bt(this,J).addLayer(this)}get isEmpty(){return bt(this,k).size===0}updateToolbar(it){bt(this,J).updateToolbar(it)}updateMode(it=bt(this,J).getMode()){nl(this,Zt,Oe).call(this),it===M.AnnotationEditorType.INK?(this.addInkEditorIfNeeded(!1),this.disableClick()):this.enableClick(),it!==M.AnnotationEditorType.NONE&&(this.div.classList.toggle("freeTextEditing",it===M.AnnotationEditorType.FREETEXT),this.div.classList.toggle("inkEditing",it===M.AnnotationEditorType.INK),this.div.classList.toggle("stampEditing",it===M.AnnotationEditorType.STAMP),this.div.hidden=!1)}addInkEditorIfNeeded(it){if(!it&&bt(this,J).getMode()!==M.AnnotationEditorType.INK)return;if(!it){for(const zt of bt(this,k).values())if(zt.isEmpty()){zt.setInBackground();return}}nl(this,m,be).call(this,{offsetX:0,offsetY:0},!1).setInBackground()}setEditingState(it){bt(this,J).setEditingState(it)}addCommands(it){bt(this,J).addCommands(it)}enable(){this.div.style.pointerEvents="auto";const it=new Set;for(const zt of bt(this,k).values())zt.enableEditing(),zt.annotationElementId&&it.add(zt.annotationElementId);if(!bt(this,K))return;const Xt=bt(this,K).getEditableAnnotations();for(const zt of Xt){if(zt.hide(),bt(this,J).isDeletedAnnotationElement(zt.data.id)||it.has(zt.data.id))continue;const Gt=this.deserialize(zt);Gt&&(this.addOrRebuild(Gt),Gt.enableEditing())}}disable(){var Xt;ul(this,F,!0),this.div.style.pointerEvents="none";const it=new Set;for(const zt of bt(this,k).values()){if(zt.disableEditing(),!zt.annotationElementId||zt.serialize()!==null){it.add(zt.annotationElementId);continue}(Xt=this.getEditableAnnotation(zt.annotationElementId))==null||Xt.show(),zt.remove()}if(bt(this,K)){const zt=bt(this,K).getEditableAnnotations();for(const Gt of zt){const{id:Nt}=Gt.data;it.has(Nt)||bt(this,J).isDeletedAnnotationElement(Nt)||Gt.show()}}nl(this,Zt,Oe).call(this),this.isEmpty&&(this.div.hidden=!0),ul(this,F,!1)}getEditableAnnotation(it){var Xt;return((Xt=bt(this,K))==null?void 0:Xt.getEditableAnnotation(it))||null}setActiveEditor(it){bt(this,J).getActive()!==it&&bt(this,J).setActiveEditor(it)}enableClick(){this.div.addEventListener("pointerdown",bt(this,S)),this.div.addEventListener("pointerup",bt(this,f))}disableClick(){this.div.removeEventListener("pointerdown",bt(this,S)),this.div.removeEventListener("pointerup",bt(this,f))}attach(it){bt(this,k).set(it.id,it);const{annotationElementId:Xt}=it;Xt&&bt(this,J).isDeletedAnnotationElement(Xt)&&bt(this,J).removeDeletedAnnotationElement(it)}detach(it){var Xt;bt(this,k).delete(it.id),(Xt=bt(this,j))==null||Xt.removePointerInTextLayer(it.contentDiv),!bt(this,F)&&it.annotationElementId&&bt(this,J).addDeletedAnnotationElement(it)}remove(it){this.detach(it),bt(this,J).removeEditor(it),it.div.contains(document.activeElement)&&setTimeout(()=>{bt(this,J).focusMainContainer()},0),it.div.remove(),it.isAttachedToDOM=!1,bt(this,g)||this.addInkEditorIfNeeded(!1)}changeParent(it){var Xt;it.parent!==this&&(it.annotationElementId&&(bt(this,J).addDeletedAnnotationElement(it.annotationElementId),p.AnnotationEditor.deleteAnnotationElement(it),it.annotationElementId=null),this.attach(it),(Xt=it.parent)==null||Xt.detach(it),it.setParent(this),it.div&&it.isAttachedToDOM&&(it.div.remove(),this.div.append(it.div)))}add(it){if(this.changeParent(it),bt(this,J).addEditor(it),this.attach(it),!it.isAttachedToDOM){const Xt=it.render();this.div.append(Xt),it.isAttachedToDOM=!0}it.fixAndSetPosition(),it.onceAdded(),bt(this,J).addToAnnotationStorage(it)}moveEditorInDOM(it){var zt;if(!it.isAttachedToDOM)return;const{activeElement:Xt}=document;it.div.contains(Xt)&&(it._focusEventsAllowed=!1,setTimeout(()=>{it.div.contains(document.activeElement)?it._focusEventsAllowed=!0:(it.div.addEventListener("focusin",()=>{it._focusEventsAllowed=!0},{once:!0}),Xt.focus())},0)),it._structTreeParentId=(zt=bt(this,j))==null?void 0:zt.moveElementInDOM(this.div,it.div,it.contentDiv,!0)}addOrRebuild(it){it.needsToBeRebuilt()?it.rebuild():this.add(it)}addUndoableEditor(it){const Xt=()=>it._uiManager.rebuild(it),zt=()=>{it.remove()};this.addCommands({cmd:Xt,undo:zt,mustExec:!1})}getNextId(){return bt(this,J).getId()}pasteEditor(it,Xt){bt(this,J).updateToolbar(it),bt(this,J).updateMode(it);const{offsetX:zt,offsetY:Gt}=nl(this,$,Je).call(this),Nt=this.getNextId(),Ut=nl(this,v,Fe).call(this,{parent:this,id:Nt,x:zt,y:Gt,uiManager:bt(this,J),isCentered:!0,...Xt});Ut&&this.add(Ut)}deserialize(it){switch(it.annotationType??it.annotationEditorType){case M.AnnotationEditorType.FREETEXT:return B.FreeTextEditor.deserialize(it,this,bt(this,J));case M.AnnotationEditorType.INK:return Q.InkEditor.deserialize(it,this,bt(this,J));case M.AnnotationEditorType.STAMP:return O.StampEditor.deserialize(it,this,bt(this,J))}return null}addNewEditor(){nl(this,m,be).call(this,nl(this,$,Je).call(this),!0)}setSelected(it){bt(this,J).setSelected(it)}toggleSelected(it){bt(this,J).toggleSelected(it)}isSelected(it){return bt(this,J).isSelected(it)}unselect(it){bt(this,J).unselect(it)}pointerup(it){const{isMac:Xt}=M.FeatureTest.platform;if(!(it.button!==0||it.ctrlKey&&Xt)&&it.target===this.div&&bt(this,T)){if(ul(this,T,!1),!bt(this,q)){ul(this,q,!0);return}if(bt(this,J).getMode()===M.AnnotationEditorType.STAMP){bt(this,J).unselectAll();return}nl(this,m,be).call(this,it,!1)}}pointerdown(it){if(bt(this,T)){ul(this,T,!1);return}const{isMac:Xt}=M.FeatureTest.platform;if(it.button!==0||it.ctrlKey&&Xt||it.target!==this.div)return;ul(this,T,!0);const zt=bt(this,J).getActive();ul(this,q,!zt||zt.isEmpty())}findNewParent(it,Xt,zt){const Gt=bt(this,J).findParent(Xt,zt);return Gt===null||Gt===this?!1:(Gt.changeParent(it),!0)}destroy(){var it,Xt;((it=bt(this,J).getActive())==null?void 0:it.parent)===this&&(bt(this,J).commitOrRemove(),bt(this,J).setActiveEditor(null));for(const zt of bt(this,k).values())(Xt=bt(this,j))==null||Xt.removePointerInTextLayer(zt.contentDiv),zt.setParent(null),zt.isAttachedToDOM=!1,zt.div.remove();this.div=null,bt(this,k).clear(),bt(this,J).removeLayer(this)}render({viewport:it}){this.viewport=it,(0,U.setLayerDimensions)(this.div,it);for(const Xt of bt(this,J).getEditors(this.pageIndex))this.add(Xt);this.updateMode()}update({viewport:it}){bt(this,J).commitOrRemove(),this.viewport=it,(0,U.setLayerDimensions)(this.div,{rotation:it.rotation}),this.updateMode()}get pageDimensions(){const{pageWidth:it,pageHeight:Xt}=this.viewport.rawDims;return[it,Xt]}};j=new WeakMap,q=new WeakMap,K=new WeakMap,f=new WeakMap,S=new WeakMap,k=new WeakMap,T=new WeakMap,g=new WeakMap,F=new WeakMap,J=new WeakMap,v=new WeakSet,Fe=function(it){switch(bt(this,J).getMode()){case M.AnnotationEditorType.FREETEXT:return new B.FreeTextEditor(it);case M.AnnotationEditorType.INK:return new Q.InkEditor(it);case M.AnnotationEditorType.STAMP:return new O.StampEditor(it)}return null},m=new WeakSet,be=function(it,Xt){const zt=this.getNextId(),Gt=nl(this,v,Fe).call(this,{parent:this,id:zt,x:it.offsetX,y:it.offsetY,uiManager:bt(this,J),isCentered:Xt});return Gt&&this.add(Gt),Gt},$=new WeakSet,Je=function(){const{x:it,y:Xt,width:zt,height:Gt}=this.div.getBoundingClientRect(),Nt=Math.max(0,it),Ut=Math.max(0,Xt),Vt=Math.min(window.innerWidth,it+zt),Ht=Math.min(window.innerHeight,Xt+Gt),Pt=(Nt+Vt)/2-it,at=(Ut+Ht)/2-Xt,[R,w]=this.viewport.rotation%180===0?[Pt,at]:[at,Pt];return{offsetX:R,offsetY:w}},Zt=new WeakSet,Oe=function(){ul(this,g,!0);for(const it of bt(this,k).values())it.isEmpty()&&it.remove();ul(this,g,!1)},gl(It,"_initialized",!1);let I=It;r.AnnotationEditorLayer=I},(lt,r,h)=>{var O,I,j,q,K,f,S,k,T,g,us,J,Ws,u,Gs,_,le,P,Ue,dt,Ms,xt,Ee;Object.defineProperty(r,"__esModule",{value:!0}),r.FreeTextEditor=void 0;var M=h(1),p=h(5),B=h(4),Q=h(29);const Xt=class Xt extends B.AnnotationEditor{constructor(Nt){super({...Nt,name:"freeTextEditor"});ll(this,g);ll(this,J);ll(this,u);ll(this,_);ll(this,P);ll(this,dt);ll(this,xt);ll(this,O,this.editorDivBlur.bind(this));ll(this,I,this.editorDivFocus.bind(this));ll(this,j,this.editorDivInput.bind(this));ll(this,q,this.editorDivKeydown.bind(this));ll(this,K,void 0);ll(this,f,"");ll(this,S,`${this.id}-editor`);ll(this,k,void 0);ll(this,T,null);ul(this,K,Nt.color||Xt._defaultColor||B.AnnotationEditor._defaultLineColor),ul(this,k,Nt.fontSize||Xt._defaultFontSize)}static get _keyboardManager(){const Nt=Xt.prototype,Ut=Pt=>Pt.isEmpty(),Vt=p.AnnotationEditorUIManager.TRANSLATE_SMALL,Ht=p.AnnotationEditorUIManager.TRANSLATE_BIG;return(0,M.shadow)(this,"_keyboardManager",new p.KeyboardManager([[["ctrl+s","mac+meta+s","ctrl+p","mac+meta+p"],Nt.commitOrRemove,{bubbles:!0}],[["ctrl+Enter","mac+meta+Enter","Escape","mac+Escape"],Nt.commitOrRemove],[["ArrowLeft","mac+ArrowLeft"],Nt._translateEmpty,{args:[-Vt,0],checker:Ut}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],Nt._translateEmpty,{args:[-Ht,0],checker:Ut}],[["ArrowRight","mac+ArrowRight"],Nt._translateEmpty,{args:[Vt,0],checker:Ut}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],Nt._translateEmpty,{args:[Ht,0],checker:Ut}],[["ArrowUp","mac+ArrowUp"],Nt._translateEmpty,{args:[0,-Vt],checker:Ut}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],Nt._translateEmpty,{args:[0,-Ht],checker:Ut}],[["ArrowDown","mac+ArrowDown"],Nt._translateEmpty,{args:[0,Vt],checker:Ut}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],Nt._translateEmpty,{args:[0,Ht],checker:Ut}]]))}static initialize(Nt){B.AnnotationEditor.initialize(Nt,{strings:["free_text2_default_content","editor_free_text2_aria_label"]});const Ut=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(Ut.getPropertyValue("--freetext-padding"))}static updateDefaultParams(Nt,Ut){switch(Nt){case M.AnnotationEditorParamsType.FREETEXT_SIZE:Xt._defaultFontSize=Ut;break;case M.AnnotationEditorParamsType.FREETEXT_COLOR:Xt._defaultColor=Ut;break}}updateParams(Nt,Ut){switch(Nt){case M.AnnotationEditorParamsType.FREETEXT_SIZE:nl(this,g,us).call(this,Ut);break;case M.AnnotationEditorParamsType.FREETEXT_COLOR:nl(this,J,Ws).call(this,Ut);break}}static get defaultPropertiesToUpdate(){return[[M.AnnotationEditorParamsType.FREETEXT_SIZE,Xt._defaultFontSize],[M.AnnotationEditorParamsType.FREETEXT_COLOR,Xt._defaultColor||B.AnnotationEditor._defaultLineColor]]}get propertiesToUpdate(){return[[M.AnnotationEditorParamsType.FREETEXT_SIZE,bt(this,k)],[M.AnnotationEditorParamsType.FREETEXT_COLOR,bt(this,K)]]}_translateEmpty(Nt,Ut){this._uiManager.translateSelectedEditors(Nt,Ut,!0)}getInitialTranslation(){const Nt=this.parentScale;return[-Xt._internalPadding*Nt,-(Xt._internalPadding+bt(this,k))*Nt]}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(this.isAttachedToDOM||this.parent.add(this)))}enableEditMode(){this.isInEditMode()||(this.parent.setEditingState(!1),this.parent.updateToolbar(M.AnnotationEditorType.FREETEXT),super.enableEditMode(),this.overlayDiv.classList.remove("enabled"),this.editorDiv.contentEditable=!0,this._isDraggable=!1,this.div.removeAttribute("aria-activedescendant"),this.editorDiv.addEventListener("keydown",bt(this,q)),this.editorDiv.addEventListener("focus",bt(this,I)),this.editorDiv.addEventListener("blur",bt(this,O)),this.editorDiv.addEventListener("input",bt(this,j)))}disableEditMode(){this.isInEditMode()&&(this.parent.setEditingState(!0),super.disableEditMode(),this.overlayDiv.classList.add("enabled"),this.editorDiv.contentEditable=!1,this.div.setAttribute("aria-activedescendant",bt(this,S)),this._isDraggable=!0,this.editorDiv.removeEventListener("keydown",bt(this,q)),this.editorDiv.removeEventListener("focus",bt(this,I)),this.editorDiv.removeEventListener("blur",bt(this,O)),this.editorDiv.removeEventListener("input",bt(this,j)),this.div.focus({preventScroll:!0}),this.isEditing=!1,this.parent.div.classList.add("freeTextEditing"))}focusin(Nt){this._focusEventsAllowed&&(super.focusin(Nt),Nt.target!==this.editorDiv&&this.editorDiv.focus())}onceAdded(){var Nt;if(this.width){nl(this,xt,Ee).call(this);return}this.enableEditMode(),this.editorDiv.focus(),(Nt=this._initialOptions)!=null&&Nt.isCentered&&this.center(),this._initialOptions=null}isEmpty(){return!this.editorDiv||this.editorDiv.innerText.trim()===""}remove(){this.isEditing=!1,this.parent&&(this.parent.setEditingState(!0),this.parent.div.classList.add("freeTextEditing")),super.remove()}commit(){if(!this.isInEditMode())return;super.commit(),this.disableEditMode();const Nt=bt(this,f),Ut=ul(this,f,nl(this,u,Gs).call(this).trimEnd());if(Nt===Ut)return;const Vt=Ht=>{if(ul(this,f,Ht),!Ht){this.remove();return}nl(this,P,Ue).call(this),this._uiManager.rebuild(this),nl(this,_,le).call(this)};this.addCommands({cmd:()=>{Vt(Ut)},undo:()=>{Vt(Nt)},mustExec:!1}),nl(this,_,le).call(this)}shouldGetKeyboardEvents(){return this.isInEditMode()}enterInEditMode(){this.enableEditMode(),this.editorDiv.focus()}dblclick(Nt){this.enterInEditMode()}keydown(Nt){Nt.target===this.div&&Nt.key==="Enter"&&(this.enterInEditMode(),Nt.preventDefault())}editorDivKeydown(Nt){Xt._keyboardManager.exec(this,Nt)}editorDivFocus(Nt){this.isEditing=!0}editorDivBlur(Nt){this.isEditing=!1}editorDivInput(Nt){this.parent.div.classList.toggle("freeTextEditing",this.isEmpty())}disableEditing(){this.editorDiv.setAttribute("role","comment"),this.editorDiv.removeAttribute("aria-multiline")}enableEditing(){this.editorDiv.setAttribute("role","textbox"),this.editorDiv.setAttribute("aria-multiline",!0)}render(){if(this.div)return this.div;let Nt,Ut;this.width&&(Nt=this.x,Ut=this.y),super.render(),this.editorDiv=document.createElement("div"),this.editorDiv.className="internal",this.editorDiv.setAttribute("id",bt(this,S)),this.enableEditing(),B.AnnotationEditor._l10nPromise.get("editor_free_text2_aria_label").then(Ht=>{var Pt;return(Pt=this.editorDiv)==null?void 0:Pt.setAttribute("aria-label",Ht)}),B.AnnotationEditor._l10nPromise.get("free_text2_default_content").then(Ht=>{var Pt;return(Pt=this.editorDiv)==null?void 0:Pt.setAttribute("default-content",Ht)}),this.editorDiv.contentEditable=!0;const{style:Vt}=this.editorDiv;if(Vt.fontSize=`calc(${bt(this,k)}px * var(--scale-factor))`,Vt.color=bt(this,K),this.div.append(this.editorDiv),this.overlayDiv=document.createElement("div"),this.overlayDiv.classList.add("overlay","enabled"),this.div.append(this.overlayDiv),(0,p.bindEvents)(this,this.div,["dblclick","keydown"]),this.width){const[Ht,Pt]=this.parentDimensions;if(this.annotationElementId){const{position:at}=bt(this,T);let[R,w]=this.getInitialTranslation();[R,w]=this.pageTranslationToScreen(R,w);const[X,C]=this.pageDimensions,[H,st]=this.pageTranslation;let et,Mt;switch(this.rotation){case 0:et=Nt+(at[0]-H)/X,Mt=Ut+this.height-(at[1]-st)/C;break;case 90:et=Nt+(at[0]-H)/X,Mt=Ut-(at[1]-st)/C,[R,w]=[w,-R];break;case 180:et=Nt-this.width+(at[0]-H)/X,Mt=Ut-(at[1]-st)/C,[R,w]=[-R,-w];break;case 270:et=Nt+(at[0]-H-this.height*C)/X,Mt=Ut+(at[1]-st-this.width*X)/C,[R,w]=[-w,R];break}this.setAt(et*Ht,Mt*Pt,R,w)}else this.setAt(Nt*Ht,Ut*Pt,this.width*Ht,this.height*Pt);nl(this,P,Ue).call(this),this._isDraggable=!0,this.editorDiv.contentEditable=!1}else this._isDraggable=!1,this.editorDiv.contentEditable=!0;return this.div}get contentDiv(){return this.editorDiv}static deserialize(Nt,Ut,Vt){let Ht=null;if(Nt instanceof Q.FreeTextAnnotationElement){const{data:{defaultAppearanceData:{fontSize:at,fontColor:R},rect:w,rotation:X,id:C},textContent:H,textPosition:st,parent:{page:{pageNumber:et}}}=Nt;if(!H||H.length===0)return null;Ht=Nt={annotationType:M.AnnotationEditorType.FREETEXT,color:Array.from(R),fontSize:at,value:H.join(`
|
|
5
5
|
`),position:st,pageIndex:et-1,rect:w,rotation:X,id:C,deleted:!1}}const Pt=super.deserialize(Nt,Ut,Vt);return ul(Pt,k,Nt.fontSize),ul(Pt,K,M.Util.makeHexColor(...Nt.color)),ul(Pt,f,Nt.value),Pt.annotationElementId=Nt.id||null,ul(Pt,T,Ht),Pt}serialize(Nt=!1){if(this.isEmpty())return null;if(this.deleted)return{pageIndex:this.pageIndex,id:this.annotationElementId,deleted:!0};const Ut=Xt._internalPadding*this.parentScale,Vt=this.getRect(Ut,Ut),Ht=B.AnnotationEditor._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:bt(this,K)),Pt={annotationType:M.AnnotationEditorType.FREETEXT,color:Ht,fontSize:bt(this,k),value:bt(this,f),pageIndex:this.pageIndex,rect:Vt,rotation:this.rotation,structTreeParentId:this._structTreeParentId};return Nt?Pt:this.annotationElementId&&!nl(this,dt,Ms).call(this,Pt)?null:(Pt.id=this.annotationElementId,Pt)}};O=new WeakMap,I=new WeakMap,j=new WeakMap,q=new WeakMap,K=new WeakMap,f=new WeakMap,S=new WeakMap,k=new WeakMap,T=new WeakMap,g=new WeakSet,us=function(Nt){const Ut=Ht=>{this.editorDiv.style.fontSize=`calc(${Ht}px * var(--scale-factor))`,this.translate(0,-(Ht-bt(this,k))*this.parentScale),ul(this,k,Ht),nl(this,_,le).call(this)},Vt=bt(this,k);this.addCommands({cmd:()=>{Ut(Nt)},undo:()=>{Ut(Vt)},mustExec:!0,type:M.AnnotationEditorParamsType.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})},J=new WeakSet,Ws=function(Nt){const Ut=bt(this,K);this.addCommands({cmd:()=>{ul(this,K,this.editorDiv.style.color=Nt)},undo:()=>{ul(this,K,this.editorDiv.style.color=Ut)},mustExec:!0,type:M.AnnotationEditorParamsType.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})},u=new WeakSet,Gs=function(){const Nt=this.editorDiv.getElementsByTagName("div");if(Nt.length===0)return this.editorDiv.innerText;const Ut=[];for(const Vt of Nt)Ut.push(Vt.innerText.replace(/\r\n?|\n/,""));return Ut.join(`
|
|
6
6
|
`)},_=new WeakSet,le=function(){const[Nt,Ut]=this.parentDimensions;let Vt;if(this.isAttachedToDOM)Vt=this.div.getBoundingClientRect();else{const{currentLayer:Ht,div:Pt}=this,at=Pt.style.display;Pt.style.display="hidden",Ht.div.append(this.div),Vt=Pt.getBoundingClientRect(),Pt.remove(),Pt.style.display=at}this.rotation%180===this.parentRotation%180?(this.width=Vt.width/Nt,this.height=Vt.height/Ut):(this.width=Vt.height/Nt,this.height=Vt.width/Ut),this.fixAndSetPosition()},P=new WeakSet,Ue=function(){if(this.editorDiv.replaceChildren(),!!bt(this,f))for(const Nt of bt(this,f).split(`
|
|
7
7
|
`)){const Ut=document.createElement("div");Ut.append(Nt?document.createTextNode(Nt):document.createElement("br")),this.editorDiv.append(Ut)}},dt=new WeakSet,Ms=function(Nt){const{value:Ut,fontSize:Vt,color:Ht,rect:Pt,pageIndex:at}=bt(this,T);return Nt.value!==Ut||Nt.fontSize!==Vt||Nt.rect.some((R,w)=>Math.abs(R-Pt[w])>=1)||Nt.color.some((R,w)=>R!==Ht[w])||Nt.pageIndex!==at},xt=new WeakSet,Ee=function(Nt=!1){if(!this.annotationElementId)return;if(nl(this,_,le).call(this),!Nt&&(this.width===0||this.height===0)){setTimeout(()=>nl(this,xt,Ee).call(this,!0),0);return}const Ut=Xt._internalPadding*this.parentScale;bt(this,T).rect=this.getRect(Ut,Ut)},gl(Xt,"_freeTextDefaultContent",""),gl(Xt,"_internalPadding",0),gl(Xt,"_defaultColor",null),gl(Xt,"_defaultFontSize",10),gl(Xt,"_type","freetext");let U=Xt;r.FreeTextEditor=U},(lt,r,h)=>{var w,C,Kl,st,rs,Mt,Rt,gt,Jt,Dt,qt,vt,cl,bl,il,Bt,Ft,wt,pt,Ct,$t,dl,rl,Ns,Xl,oe,Ll,Ke,Vl,ve,ot,ut,Tt,jt,Ot,Lt,yt,Pe,tl,el,ol,Qt,Xs,hl,He;Object.defineProperty(r,"__esModule",{value:!0}),r.StampAnnotationElement=r.InkAnnotationElement=r.FreeTextAnnotationElement=r.AnnotationLayer=void 0;var M=h(1),p=h(6),B=h(3),Q=h(30),U=h(31),O=h(32);const I=1e3,j=9,q=new WeakSet;function K(Wl){return{width:Wl[2]-Wl[0],height:Wl[3]-Wl[1]}}class f{static create(nt){switch(nt.data.annotationType){case M.AnnotationType.LINK:return new k(nt);case M.AnnotationType.TEXT:return new T(nt);case M.AnnotationType.WIDGET:switch(nt.data.fieldType){case"Tx":return new F(nt);case"Btn":return nt.data.radioButton?new u(nt):nt.data.checkBox?new v(nt):new m(nt);case"Ch":return new _(nt);case"Sig":return new J(nt)}return new g(nt);case M.AnnotationType.POPUP:return new $(nt);case M.AnnotationType.FREETEXT:return new Zt(nt);case M.AnnotationType.LINE:return new dt(nt);case M.AnnotationType.SQUARE:return new It(nt);case M.AnnotationType.CIRCLE:return new xt(nt);case M.AnnotationType.POLYLINE:return new it(nt);case M.AnnotationType.CARET:return new zt(nt);case M.AnnotationType.INK:return new Gt(nt);case M.AnnotationType.POLYGON:return new Xt(nt);case M.AnnotationType.HIGHLIGHT:return new Nt(nt);case M.AnnotationType.UNDERLINE:return new Ut(nt);case M.AnnotationType.SQUIGGLY:return new Vt(nt);case M.AnnotationType.STRIKEOUT:return new Ht(nt);case M.AnnotationType.STAMP:return new Pt(nt);case M.AnnotationType.FILEATTACHMENT:return new at(nt);default:return new S(nt)}}}const X=class X{constructor(nt,{isRenderable:L=!1,ignoreBorder:ct=!1,createQuadrilaterals:Wt=!1}={}){ll(this,w,!1);this.isRenderable=L,this.data=nt.data,this.layer=nt.layer,this.linkService=nt.linkService,this.downloadManager=nt.downloadManager,this.imageResourcesPath=nt.imageResourcesPath,this.renderForms=nt.renderForms,this.svgFactory=nt.svgFactory,this.annotationStorage=nt.annotationStorage,this.enableScripting=nt.enableScripting,this.hasJSActions=nt.hasJSActions,this._fieldObjects=nt.fieldObjects,this.parent=nt.parent,L&&(this.container=this._createContainer(ct)),Wt&&this._createQuadrilaterals()}static _hasPopupData({titleObj:nt,contentsObj:L,richText:ct}){return!!(nt!=null&&nt.str||L!=null&&L.str||ct!=null&&ct.str)}get hasPopupData(){return X._hasPopupData(this.data)}_createContainer(nt){const{data:L,parent:{page:ct,viewport:Wt}}=this,Yt=document.createElement("section");Yt.setAttribute("data-annotation-id",L.id),this instanceof g||(Yt.tabIndex=I),Yt.style.zIndex=this.parent.zIndex++,this.data.popupRef&&Yt.setAttribute("aria-haspopup","dialog"),L.noRotate&&Yt.classList.add("norotate");const{pageWidth:kt,pageHeight:Et,pageX:sl,pageY:ml}=Wt.rawDims;if(!L.rect||this instanceof $){const{rotation:Tl}=L;return!L.hasOwnCanvas&&Tl!==0&&this.setRotation(Tl,Yt),Yt}const{width:al,height:zl}=K(L.rect),Gl=M.Util.normalizeRect([L.rect[0],ct.view[3]-L.rect[1]+ct.view[1],L.rect[2],ct.view[3]-L.rect[3]+ct.view[1]]);if(!nt&&L.borderStyle.width>0){Yt.style.borderWidth=`${L.borderStyle.width}px`;const Tl=L.borderStyle.horizontalCornerRadius,Rl=L.borderStyle.verticalCornerRadius;if(Tl>0||Rl>0){const wl=`calc(${Tl}px * var(--scale-factor)) / calc(${Rl}px * var(--scale-factor))`;Yt.style.borderRadius=wl}else if(this instanceof u){const wl=`calc(${al}px * var(--scale-factor)) / calc(${zl}px * var(--scale-factor))`;Yt.style.borderRadius=wl}switch(L.borderStyle.style){case M.AnnotationBorderStyleType.SOLID:Yt.style.borderStyle="solid";break;case M.AnnotationBorderStyleType.DASHED:Yt.style.borderStyle="dashed";break;case M.AnnotationBorderStyleType.BEVELED:(0,M.warn)("Unimplemented border style: beveled");break;case M.AnnotationBorderStyleType.INSET:(0,M.warn)("Unimplemented border style: inset");break;case M.AnnotationBorderStyleType.UNDERLINE:Yt.style.borderBottomStyle="solid";break}const Sl=L.borderColor||null;Sl?(ul(this,w,!0),Yt.style.borderColor=M.Util.makeHexColor(Sl[0]|0,Sl[1]|0,Sl[2]|0)):Yt.style.borderWidth=0}Yt.style.left=`${100*(Gl[0]-sl)/kt}%`,Yt.style.top=`${100*(Gl[1]-ml)/Et}%`;const{rotation:Nl}=L;return L.hasOwnCanvas||Nl===0?(Yt.style.width=`${100*al/kt}%`,Yt.style.height=`${100*zl/Et}%`):this.setRotation(Nl,Yt),Yt}setRotation(nt,L=this.container){if(!this.data.rect)return;const{pageWidth:ct,pageHeight:Wt}=this.parent.viewport.rawDims,{width:Yt,height:kt}=K(this.data.rect);let Et,sl;nt%180===0?(Et=100*Yt/ct,sl=100*kt/Wt):(Et=100*kt/ct,sl=100*Yt/Wt),L.style.width=`${Et}%`,L.style.height=`${sl}%`,L.setAttribute("data-main-rotation",(360-nt)%360)}get _commonActions(){const nt=(L,ct,Wt)=>{const Yt=Wt.detail[L],kt=Yt[0],Et=Yt.slice(1);Wt.target.style[ct]=Q.ColorConverters[`${kt}_HTML`](Et),this.annotationStorage.setValue(this.data.id,{[ct]:Q.ColorConverters[`${kt}_rgb`](Et)})};return(0,M.shadow)(this,"_commonActions",{display:L=>{const{display:ct}=L.detail,Wt=ct%2===1;this.container.style.visibility=Wt?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noView:Wt,noPrint:ct===1||ct===2})},print:L=>{this.annotationStorage.setValue(this.data.id,{noPrint:!L.detail.print})},hidden:L=>{const{hidden:ct}=L.detail;this.container.style.visibility=ct?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noPrint:ct,noView:ct})},focus:L=>{setTimeout(()=>L.target.focus({preventScroll:!1}),0)},userName:L=>{L.target.title=L.detail.userName},readonly:L=>{L.target.disabled=L.detail.readonly},required:L=>{this._setRequired(L.target,L.detail.required)},bgColor:L=>{nt("bgColor","backgroundColor",L)},fillColor:L=>{nt("fillColor","backgroundColor",L)},fgColor:L=>{nt("fgColor","color",L)},textColor:L=>{nt("textColor","color",L)},borderColor:L=>{nt("borderColor","borderColor",L)},strokeColor:L=>{nt("strokeColor","borderColor",L)},rotation:L=>{const ct=L.detail.rotation;this.setRotation(ct),this.annotationStorage.setValue(this.data.id,{rotation:ct})}})}_dispatchEventFromSandbox(nt,L){const ct=this._commonActions;for(const Wt of Object.keys(L.detail)){const Yt=nt[Wt]||ct[Wt];Yt==null||Yt(L)}}_setDefaultPropertiesFromJS(nt){if(!this.enableScripting)return;const L=this.annotationStorage.getRawValue(this.data.id);if(!L)return;const ct=this._commonActions;for(const[Wt,Yt]of Object.entries(L)){const kt=ct[Wt];if(kt){const Et={detail:{[Wt]:Yt},target:nt};kt(Et),delete L[Wt]}}}_createQuadrilaterals(){if(!this.container)return;const{quadPoints:nt}=this.data;if(!nt)return;const[L,ct,Wt,Yt]=this.data.rect;if(nt.length===1){const[,{x:Rl,y:Sl},{x:wl,y:kl}]=nt[0];if(Wt===Rl&&Yt===Sl&&L===wl&&ct===kl)return}const{style:kt}=this.container;let Et;if(bt(this,w)){const{borderColor:Rl,borderWidth:Sl}=kt;kt.borderWidth=0,Et=["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="${Rl}" stroke-width="${Sl}">`],this.container.classList.add("hasBorder")}const sl=Wt-L,ml=Yt-ct,{svgFactory:al}=this,zl=al.createElement("svg");zl.classList.add("quadrilateralsContainer"),zl.setAttribute("width",0),zl.setAttribute("height",0);const Gl=al.createElement("defs");zl.append(Gl);const Nl=al.createElement("clipPath"),Tl=`clippath_${this.data.id}`;Nl.setAttribute("id",Tl),Nl.setAttribute("clipPathUnits","objectBoundingBox"),Gl.append(Nl);for(const[,{x:Rl,y:Sl},{x:wl,y:kl}]of nt){const xl=al.createElement("rect"),Dl=(wl-L)/sl,Cl=(Yt-Sl)/ml,jl=(Rl-wl)/sl,Bl=(Sl-kl)/ml;xl.setAttribute("x",Dl),xl.setAttribute("y",Cl),xl.setAttribute("width",jl),xl.setAttribute("height",Bl),Nl.append(xl),Et==null||Et.push(`<rect vector-effect="non-scaling-stroke" x="${Dl}" y="${Cl}" width="${jl}" height="${Bl}"/>`)}bt(this,w)&&(Et.push("</g></svg>')"),kt.backgroundImage=Et.join("")),this.container.append(zl),this.container.style.clipPath=`url(#${Tl})`}_createPopup(){const{container:nt,data:L}=this;nt.setAttribute("aria-haspopup","dialog");const ct=new $({data:{color:L.color,titleObj:L.titleObj,modificationDate:L.modificationDate,contentsObj:L.contentsObj,richText:L.richText,parentRect:L.rect,borderStyle:0,id:`popup_${L.id}`,rotation:L.rotation},parent:this.parent,elements:[this]});this.parent.div.append(ct.render())}render(){(0,M.unreachable)("Abstract method `AnnotationElement.render` called")}_getElementsByName(nt,L=null){const ct=[];if(this._fieldObjects){const Wt=this._fieldObjects[nt];if(Wt)for(const{page:Yt,id:kt,exportValues:Et}of Wt){if(Yt===-1||kt===L)continue;const sl=typeof Et=="string"?Et:null,ml=document.querySelector(`[data-element-id="${kt}"]`);if(ml&&!q.has(ml)){(0,M.warn)(`_getElementsByName - element not allowed: ${kt}`);continue}ct.push({id:kt,exportValue:sl,domElement:ml})}return ct}for(const Wt of document.getElementsByName(nt)){const{exportValue:Yt}=Wt,kt=Wt.getAttribute("data-element-id");kt!==L&&q.has(Wt)&&ct.push({id:kt,exportValue:Yt,domElement:Wt})}return ct}show(){var nt;this.container&&(this.container.hidden=!1),(nt=this.popup)==null||nt.maybeShow()}hide(){var nt;this.container&&(this.container.hidden=!0),(nt=this.popup)==null||nt.forceHide()}getElementsToTriggerPopup(){return this.container}addHighlightArea(){const nt=this.getElementsToTriggerPopup();if(Array.isArray(nt))for(const L of nt)L.classList.add("highlightArea");else nt.classList.add("highlightArea")}_editOnDoubleClick(){const{annotationEditorType:nt,data:{id:L}}=this;this.container.addEventListener("dblclick",()=>{var ct;(ct=this.linkService.eventBus)==null||ct.dispatch("switchannotationeditormode",{source:this,mode:nt,editId:L})})}};w=new WeakMap;let S=X;class k extends S{constructor(L,ct=null){super(L,{isRenderable:!0,ignoreBorder:!!(ct!=null&&ct.ignoreBorder),createQuadrilaterals:!0});ll(this,C);ll(this,st);this.isTooltipOnly=L.data.isTooltipOnly}render(){const{data:L,linkService:ct}=this,Wt=document.createElement("a");Wt.setAttribute("data-element-id",L.id);let Yt=!1;return L.url?(ct.addLinkAttributes(Wt,L.url,L.newWindow),Yt=!0):L.action?(this._bindNamedAction(Wt,L.action),Yt=!0):L.attachment?(this._bindAttachment(Wt,L.attachment),Yt=!0):L.setOCGState?(nl(this,st,rs).call(this,Wt,L.setOCGState),Yt=!0):L.dest?(this._bindLink(Wt,L.dest),Yt=!0):(L.actions&&(L.actions.Action||L.actions["Mouse Up"]||L.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction(Wt,L),Yt=!0),L.resetForm?(this._bindResetFormAction(Wt,L.resetForm),Yt=!0):this.isTooltipOnly&&!Yt&&(this._bindLink(Wt,""),Yt=!0)),this.container.classList.add("linkAnnotation"),Yt&&this.container.append(Wt),this.container}_bindLink(L,ct){L.href=this.linkService.getDestinationHash(ct),L.onclick=()=>(ct&&this.linkService.goToDestination(ct),!1),(ct||ct==="")&&nl(this,C,Kl).call(this)}_bindNamedAction(L,ct){L.href=this.linkService.getAnchorUrl(""),L.onclick=()=>(this.linkService.executeNamedAction(ct),!1),nl(this,C,Kl).call(this)}_bindAttachment(L,ct){L.href=this.linkService.getAnchorUrl(""),L.onclick=()=>{var Wt;return(Wt=this.downloadManager)==null||Wt.openOrDownloadData(this.container,ct.content,ct.filename),!1},nl(this,C,Kl).call(this)}_bindJSAction(L,ct){L.href=this.linkService.getAnchorUrl("");const Wt=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(const Yt of Object.keys(ct.actions)){const kt=Wt.get(Yt);kt&&(L[kt]=()=>{var Et;return(Et=this.linkService.eventBus)==null||Et.dispatch("dispatcheventinsandbox",{source:this,detail:{id:ct.id,name:Yt}}),!1})}L.onclick||(L.onclick=()=>!1),nl(this,C,Kl).call(this)}_bindResetFormAction(L,ct){const Wt=L.onclick;if(Wt||(L.href=this.linkService.getAnchorUrl("")),nl(this,C,Kl).call(this),!this._fieldObjects){(0,M.warn)('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),Wt||(L.onclick=()=>!1);return}L.onclick=()=>{var zl;Wt==null||Wt();const{fields:Yt,refs:kt,include:Et}=ct,sl=[];if(Yt.length!==0||kt.length!==0){const Gl=new Set(kt);for(const Nl of Yt){const Tl=this._fieldObjects[Nl]||[];for(const{id:Rl}of Tl)Gl.add(Rl)}for(const Nl of Object.values(this._fieldObjects))for(const Tl of Nl)Gl.has(Tl.id)===Et&&sl.push(Tl)}else for(const Gl of Object.values(this._fieldObjects))sl.push(...Gl);const ml=this.annotationStorage,al=[];for(const Gl of sl){const{id:Nl}=Gl;switch(al.push(Nl),Gl.type){case"text":{const Rl=Gl.defaultValue||"";ml.setValue(Nl,{value:Rl});break}case"checkbox":case"radiobutton":{const Rl=Gl.defaultValue===Gl.exportValues;ml.setValue(Nl,{value:Rl});break}case"combobox":case"listbox":{const Rl=Gl.defaultValue||"";ml.setValue(Nl,{value:Rl});break}default:continue}const Tl=document.querySelector(`[data-element-id="${Nl}"]`);if(Tl){if(!q.has(Tl)){(0,M.warn)(`_bindResetFormAction - element not allowed: ${Nl}`);continue}}else continue;Tl.dispatchEvent(new Event("resetform"))}return this.enableScripting&&((zl=this.linkService.eventBus)==null||zl.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:al,name:"ResetForm"}})),!1}}}C=new WeakSet,Kl=function(){this.container.setAttribute("data-internal-link","")},st=new WeakSet,rs=function(L,ct){L.href=this.linkService.getAnchorUrl(""),L.onclick=()=>(this.linkService.executeSetOCGState(ct),!1),nl(this,C,Kl).call(this)};class T extends S{constructor(nt){super(nt,{isRenderable:!0})}render(){this.container.classList.add("textAnnotation");const nt=document.createElement("img");return nt.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg",nt.alt="[{{type}} Annotation]",nt.dataset.l10nId="text_annotation_type",nt.dataset.l10nArgs=JSON.stringify({type:this.data.name}),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.append(nt),this.container}}class g extends S{render(){return this.data.alternativeText&&(this.container.title=this.data.alternativeText),this.container}showElementAndHideCanvas(nt){var L;this.data.hasOwnCanvas&&(((L=nt.previousSibling)==null?void 0:L.nodeName)==="CANVAS"&&(nt.previousSibling.hidden=!0),nt.hidden=!1)}_getKeyModifier(nt){const{isWin:L,isMac:ct}=M.FeatureTest.platform;return L&&nt.ctrlKey||ct&&nt.metaKey}_setEventListener(nt,L,ct,Wt,Yt){ct.includes("mouse")?nt.addEventListener(ct,kt=>{var Et;(Et=this.linkService.eventBus)==null||Et.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:Wt,value:Yt(kt),shift:kt.shiftKey,modifier:this._getKeyModifier(kt)}})}):nt.addEventListener(ct,kt=>{var Et;if(ct==="blur"){if(!L.focused||!kt.relatedTarget)return;L.focused=!1}else if(ct==="focus"){if(L.focused)return;L.focused=!0}Yt&&((Et=this.linkService.eventBus)==null||Et.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:Wt,value:Yt(kt)}}))})}_setEventListeners(nt,L,ct,Wt){var Yt,kt,Et;for(const[sl,ml]of ct)(ml==="Action"||(Yt=this.data.actions)!=null&&Yt[ml])&&((ml==="Focus"||ml==="Blur")&&(L||(L={focused:!1})),this._setEventListener(nt,L,sl,ml,Wt),ml==="Focus"&&!((kt=this.data.actions)!=null&&kt.Blur)?this._setEventListener(nt,L,"blur","Blur",null):ml==="Blur"&&!((Et=this.data.actions)!=null&&Et.Focus)&&this._setEventListener(nt,L,"focus","Focus",null))}_setBackgroundColor(nt){const L=this.data.backgroundColor||null;nt.style.backgroundColor=L===null?"transparent":M.Util.makeHexColor(L[0],L[1],L[2])}_setTextStyle(nt){const L=["left","center","right"],{fontColor:ct}=this.data.defaultAppearanceData,Wt=this.data.defaultAppearanceData.fontSize||j,Yt=nt.style;let kt;const Et=2,sl=ml=>Math.round(10*ml)/10;if(this.data.multiLine){const ml=Math.abs(this.data.rect[3]-this.data.rect[1]-Et),al=Math.round(ml/(M.LINE_FACTOR*Wt))||1,zl=ml/al;kt=Math.min(Wt,sl(zl/M.LINE_FACTOR))}else{const ml=Math.abs(this.data.rect[3]-this.data.rect[1]-Et);kt=Math.min(Wt,sl(ml/M.LINE_FACTOR))}Yt.fontSize=`calc(${kt}px * var(--scale-factor))`,Yt.color=M.Util.makeHexColor(ct[0],ct[1],ct[2]),this.data.textAlignment!==null&&(Yt.textAlign=L[this.data.textAlignment])}_setRequired(nt,L){L?nt.setAttribute("required",!0):nt.removeAttribute("required"),nt.setAttribute("aria-required",L)}}class F extends g{constructor(nt){const L=nt.renderForms||!nt.data.hasAppearance&&!!nt.data.fieldValue;super(nt,{isRenderable:L})}setPropertyOnSiblings(nt,L,ct,Wt){const Yt=this.annotationStorage;for(const kt of this._getElementsByName(nt.name,nt.id))kt.domElement&&(kt.domElement[L]=ct),Yt.setValue(kt.id,{[Wt]:ct})}render(){var Wt,Yt;const nt=this.annotationStorage,L=this.data.id;this.container.classList.add("textWidgetAnnotation");let ct=null;if(this.renderForms){const kt=nt.getValue(L,{value:this.data.fieldValue});let Et=kt.value||"";const sl=nt.getValue(L,{charLimit:this.data.maxLen}).charLimit;sl&&Et.length>sl&&(Et=Et.slice(0,sl));let ml=kt.formattedValue||((Wt=this.data.textContent)==null?void 0:Wt.join(`
|
|
8
|
-
`))||null;ml&&this.data.comb&&(ml=ml.replaceAll(/\s+/g,""));const al={userValue:Et,formattedValue:ml,lastCommittedValue:null,commitKey:1,focused:!1};this.data.multiLine?(ct=document.createElement("textarea"),ct.textContent=ml??Et,this.data.doNotScroll&&(ct.style.overflowY="hidden")):(ct=document.createElement("input"),ct.type="text",ct.setAttribute("value",ml??Et),this.data.doNotScroll&&(ct.style.overflowX="hidden")),this.data.hasOwnCanvas&&(ct.hidden=!0),q.add(ct),ct.setAttribute("data-element-id",L),ct.disabled=this.data.readOnly,ct.name=this.data.fieldName,ct.tabIndex=I,this._setRequired(ct,this.data.required),sl&&(ct.maxLength=sl),ct.addEventListener("input",Gl=>{nt.setValue(L,{value:Gl.target.value}),this.setPropertyOnSiblings(ct,"value",Gl.target.value,"value"),al.formattedValue=null}),ct.addEventListener("resetform",Gl=>{const Nl=this.data.defaultFieldValue??"";ct.value=al.userValue=Nl,al.formattedValue=null});let zl=Gl=>{const{formattedValue:Nl}=al;Nl!=null&&(Gl.target.value=Nl),Gl.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){ct.addEventListener("focus",Nl=>{if(al.focused)return;const{target:Tl}=Nl;al.userValue&&(Tl.value=al.userValue),al.lastCommittedValue=Tl.value,al.commitKey=1,al.focused=!0}),ct.addEventListener("updatefromsandbox",Nl=>{this.showElementAndHideCanvas(Nl.target);const Tl={value(Rl){al.userValue=Rl.detail.value??"",nt.setValue(L,{value:al.userValue.toString()}),Rl.target.value=al.userValue},formattedValue(Rl){const{formattedValue:Sl}=Rl.detail;al.formattedValue=Sl,Sl!=null&&Rl.target!==document.activeElement&&(Rl.target.value=Sl),nt.setValue(L,{formattedValue:Sl})},selRange(Rl){Rl.target.setSelectionRange(...Rl.detail.selRange)},charLimit:Rl=>{var xl;const{charLimit:Sl}=Rl.detail,{target:wl}=Rl;if(Sl===0){wl.removeAttribute("maxLength");return}wl.setAttribute("maxLength",Sl);let kl=al.userValue;!kl||kl.length<=Sl||(kl=kl.slice(0,Sl),wl.value=al.userValue=kl,nt.setValue(L,{value:kl}),(xl=this.linkService.eventBus)==null||xl.dispatch("dispatcheventinsandbox",{source:this,detail:{id:L,name:"Keystroke",value:kl,willCommit:!0,commitKey:1,selStart:wl.selectionStart,selEnd:wl.selectionEnd}}))}};this._dispatchEventFromSandbox(Tl,Nl)}),ct.addEventListener("keydown",Nl=>{var Sl;al.commitKey=1;let Tl=-1;if(Nl.key==="Escape"?Tl=0:Nl.key==="Enter"&&!this.data.multiLine?Tl=2:Nl.key==="Tab"&&(al.commitKey=3),Tl===-1)return;const{value:Rl}=Nl.target;al.lastCommittedValue!==Rl&&(al.lastCommittedValue=Rl,al.userValue=Rl,(Sl=this.linkService.eventBus)==null||Sl.dispatch("dispatcheventinsandbox",{source:this,detail:{id:L,name:"Keystroke",value:Rl,willCommit:!0,commitKey:Tl,selStart:Nl.target.selectionStart,selEnd:Nl.target.selectionEnd}}))});const Gl=zl;zl=null,ct.addEventListener("blur",Nl=>{var Rl;if(!al.focused||!Nl.relatedTarget)return;al.focused=!1;const{value:Tl}=Nl.target;al.userValue=Tl,al.lastCommittedValue!==Tl&&((Rl=this.linkService.eventBus)==null||Rl.dispatch("dispatcheventinsandbox",{source:this,detail:{id:L,name:"Keystroke",value:Tl,willCommit:!0,commitKey:al.commitKey,selStart:Nl.target.selectionStart,selEnd:Nl.target.selectionEnd}})),Gl(Nl)}),(Yt=this.data.actions)!=null&&Yt.Keystroke&&ct.addEventListener("beforeinput",Nl=>{var Cl;al.lastCommittedValue=null;const{data:Tl,target:Rl}=Nl,{value:Sl,selectionStart:wl,selectionEnd:kl}=Rl;let xl=wl,Dl=kl;switch(Nl.inputType){case"deleteWordBackward":{const jl=Sl.substring(0,wl).match(/\w*[^\w]*$/);jl&&(xl-=jl[0].length);break}case"deleteWordForward":{const jl=Sl.substring(wl).match(/^[^\w]*\w*/);jl&&(Dl+=jl[0].length);break}case"deleteContentBackward":wl===kl&&(xl-=1);break;case"deleteContentForward":wl===kl&&(Dl+=1);break}Nl.preventDefault(),(Cl=this.linkService.eventBus)==null||Cl.dispatch("dispatcheventinsandbox",{source:this,detail:{id:L,name:"Keystroke",value:Sl,change:Tl||"",willCommit:!1,selStart:xl,selEnd:Dl}})}),this._setEventListeners(ct,al,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],Nl=>Nl.target.value)}if(zl&&ct.addEventListener("blur",zl),this.data.comb){const Nl=(this.data.rect[2]-this.data.rect[0])/sl;ct.classList.add("comb"),ct.style.letterSpacing=`calc(${Nl}px * var(--scale-factor) - 1ch)`}}else ct=document.createElement("div"),ct.textContent=this.data.fieldValue,ct.style.verticalAlign="middle",ct.style.display="table-cell";return this._setTextStyle(ct),this._setBackgroundColor(ct),this._setDefaultPropertiesFromJS(ct),this.container.append(ct),this.container}}class J extends g{constructor(nt){super(nt,{isRenderable:!!nt.data.hasOwnCanvas})}}class v extends g{constructor(nt){super(nt,{isRenderable:nt.renderForms})}render(){const nt=this.annotationStorage,L=this.data,ct=L.id;let Wt=nt.getValue(ct,{value:L.exportValue===L.fieldValue}).value;typeof Wt=="string"&&(Wt=Wt!=="Off",nt.setValue(ct,{value:Wt})),this.container.classList.add("buttonWidgetAnnotation","checkBox");const Yt=document.createElement("input");return q.add(Yt),Yt.setAttribute("data-element-id",ct),Yt.disabled=L.readOnly,this._setRequired(Yt,this.data.required),Yt.type="checkbox",Yt.name=L.fieldName,Wt&&Yt.setAttribute("checked",!0),Yt.setAttribute("exportValue",L.exportValue),Yt.tabIndex=I,Yt.addEventListener("change",kt=>{const{name:Et,checked:sl}=kt.target;for(const ml of this._getElementsByName(Et,ct)){const al=sl&&ml.exportValue===L.exportValue;ml.domElement&&(ml.domElement.checked=al),nt.setValue(ml.id,{value:al})}nt.setValue(ct,{value:sl})}),Yt.addEventListener("resetform",kt=>{const Et=L.defaultFieldValue||"Off";kt.target.checked=Et===L.exportValue}),this.enableScripting&&this.hasJSActions&&(Yt.addEventListener("updatefromsandbox",kt=>{const Et={value(sl){sl.target.checked=sl.detail.value!=="Off",nt.setValue(ct,{value:sl.target.checked})}};this._dispatchEventFromSandbox(Et,kt)}),this._setEventListeners(Yt,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],kt=>kt.target.checked)),this._setBackgroundColor(Yt),this._setDefaultPropertiesFromJS(Yt),this.container.append(Yt),this.container}}class u extends g{constructor(nt){super(nt,{isRenderable:nt.renderForms})}render(){this.container.classList.add("buttonWidgetAnnotation","radioButton");const nt=this.annotationStorage,L=this.data,ct=L.id;let Wt=nt.getValue(ct,{value:L.fieldValue===L.buttonValue}).value;typeof Wt=="string"&&(Wt=Wt!==L.buttonValue,nt.setValue(ct,{value:Wt}));const Yt=document.createElement("input");if(q.add(Yt),Yt.setAttribute("data-element-id",ct),Yt.disabled=L.readOnly,this._setRequired(Yt,this.data.required),Yt.type="radio",Yt.name=L.fieldName,Wt&&Yt.setAttribute("checked",!0),Yt.tabIndex=I,Yt.addEventListener("change",kt=>{const{name:Et,checked:sl}=kt.target;for(const ml of this._getElementsByName(Et,ct))nt.setValue(ml.id,{value:!1});nt.setValue(ct,{value:sl})}),Yt.addEventListener("resetform",kt=>{const Et=L.defaultFieldValue;kt.target.checked=Et!=null&&Et===L.buttonValue}),this.enableScripting&&this.hasJSActions){const kt=L.buttonValue;Yt.addEventListener("updatefromsandbox",Et=>{const sl={value:ml=>{const al=kt===ml.detail.value;for(const zl of this._getElementsByName(ml.target.name)){const Gl=al&&zl.id===ct;zl.domElement&&(zl.domElement.checked=Gl),nt.setValue(zl.id,{value:Gl})}}};this._dispatchEventFromSandbox(sl,Et)}),this._setEventListeners(Yt,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],Et=>Et.target.checked)}return this._setBackgroundColor(Yt),this._setDefaultPropertiesFromJS(Yt),this.container.append(Yt),this.container}}class m extends k{constructor(nt){super(nt,{ignoreBorder:nt.data.hasAppearance})}render(){const nt=super.render();nt.classList.add("buttonWidgetAnnotation","pushButton"),this.data.alternativeText&&(nt.title=this.data.alternativeText);const L=nt.lastChild;return this.enableScripting&&this.hasJSActions&&L&&(this._setDefaultPropertiesFromJS(L),L.addEventListener("updatefromsandbox",ct=>{this._dispatchEventFromSandbox({},ct)})),nt}}class _ extends g{constructor(nt){super(nt,{isRenderable:nt.renderForms})}render(){this.container.classList.add("choiceWidgetAnnotation");const nt=this.annotationStorage,L=this.data.id,ct=nt.getValue(L,{value:this.data.fieldValue}),Wt=document.createElement("select");q.add(Wt),Wt.setAttribute("data-element-id",L),Wt.disabled=this.data.readOnly,this._setRequired(Wt,this.data.required),Wt.name=this.data.fieldName,Wt.tabIndex=I;let Yt=this.data.combo&&this.data.options.length>0;this.data.combo||(Wt.size=this.data.options.length,this.data.multiSelect&&(Wt.multiple=!0)),Wt.addEventListener("resetform",al=>{const zl=this.data.defaultFieldValue;for(const Gl of Wt.options)Gl.selected=Gl.value===zl});for(const al of this.data.options){const zl=document.createElement("option");zl.textContent=al.displayValue,zl.value=al.exportValue,ct.value.includes(al.exportValue)&&(zl.setAttribute("selected",!0),Yt=!1),Wt.append(zl)}let kt=null;if(Yt){const al=document.createElement("option");al.value=" ",al.setAttribute("hidden",!0),al.setAttribute("selected",!0),Wt.prepend(al),kt=()=>{al.remove(),Wt.removeEventListener("input",kt),kt=null},Wt.addEventListener("input",kt)}const Et=al=>{const zl=al?"value":"textContent",{options:Gl,multiple:Nl}=Wt;return Nl?Array.prototype.filter.call(Gl,Tl=>Tl.selected).map(Tl=>Tl[zl]):Gl.selectedIndex===-1?null:Gl[Gl.selectedIndex][zl]};let sl=Et(!1);const ml=al=>{const zl=al.target.options;return Array.prototype.map.call(zl,Gl=>({displayValue:Gl.textContent,exportValue:Gl.value}))};return this.enableScripting&&this.hasJSActions?(Wt.addEventListener("updatefromsandbox",al=>{const zl={value(Gl){kt==null||kt();const Nl=Gl.detail.value,Tl=new Set(Array.isArray(Nl)?Nl:[Nl]);for(const Rl of Wt.options)Rl.selected=Tl.has(Rl.value);nt.setValue(L,{value:Et(!0)}),sl=Et(!1)},multipleSelection(Gl){Wt.multiple=!0},remove(Gl){const Nl=Wt.options,Tl=Gl.detail.remove;Nl[Tl].selected=!1,Wt.remove(Tl),Nl.length>0&&Array.prototype.findIndex.call(Nl,Sl=>Sl.selected)===-1&&(Nl[0].selected=!0),nt.setValue(L,{value:Et(!0),items:ml(Gl)}),sl=Et(!1)},clear(Gl){for(;Wt.length!==0;)Wt.remove(0);nt.setValue(L,{value:null,items:[]}),sl=Et(!1)},insert(Gl){const{index:Nl,displayValue:Tl,exportValue:Rl}=Gl.detail.insert,Sl=Wt.children[Nl],wl=document.createElement("option");wl.textContent=Tl,wl.value=Rl,Sl?Sl.before(wl):Wt.append(wl),nt.setValue(L,{value:Et(!0),items:ml(Gl)}),sl=Et(!1)},items(Gl){const{items:Nl}=Gl.detail;for(;Wt.length!==0;)Wt.remove(0);for(const Tl of Nl){const{displayValue:Rl,exportValue:Sl}=Tl,wl=document.createElement("option");wl.textContent=Rl,wl.value=Sl,Wt.append(wl)}Wt.options.length>0&&(Wt.options[0].selected=!0),nt.setValue(L,{value:Et(!0),items:ml(Gl)}),sl=Et(!1)},indices(Gl){const Nl=new Set(Gl.detail.indices);for(const Tl of Gl.target.options)Tl.selected=Nl.has(Tl.index);nt.setValue(L,{value:Et(!0)}),sl=Et(!1)},editable(Gl){Gl.target.disabled=!Gl.detail.editable}};this._dispatchEventFromSandbox(zl,al)}),Wt.addEventListener("input",al=>{var Gl;const zl=Et(!0);nt.setValue(L,{value:zl}),al.preventDefault(),(Gl=this.linkService.eventBus)==null||Gl.dispatch("dispatcheventinsandbox",{source:this,detail:{id:L,name:"Keystroke",value:sl,changeEx:zl,willCommit:!1,commitKey:1,keyDown:!1}})}),this._setEventListeners(Wt,null,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"],["input","Action"],["input","Validate"]],al=>al.target.value)):Wt.addEventListener("input",function(al){nt.setValue(L,{value:Et(!0)})}),this.data.combo&&this._setTextStyle(Wt),this._setBackgroundColor(Wt),this._setDefaultPropertiesFromJS(Wt),this.container.append(Wt),this.container}}class $ extends S{constructor(nt){const{data:L,elements:ct}=nt;super(nt,{isRenderable:S._hasPopupData(L)}),this.elements=ct}render(){this.container.classList.add("popupAnnotation");const nt=new P({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}),L=[];for(const ct of this.elements)ct.popup=nt,L.push(ct.data.id),ct.addHighlightArea();return this.container.setAttribute("aria-controls",L.map(ct=>`${M.AnnotationPrefix}${ct}`).join(",")),this.container}}class P{constructor({container:nt,color:L,elements:ct,titleObj:Wt,modificationDate:Yt,contentsObj:kt,richText:Et,parent:sl,rect:ml,parentRect:al,open:zl}){ll(this,rl);ll(this,Xl);ll(this,Ll);ll(this,Vl);ll(this,Mt,null);ll(this,Rt,nl(this,rl,Ns).bind(this));ll(this,gt,nl(this,Vl,ve).bind(this));ll(this,Jt,nl(this,Ll,Ke).bind(this));ll(this,Dt,nl(this,Xl,oe).bind(this));ll(this,qt,null);ll(this,vt,null);ll(this,cl,null);ll(this,bl,null);ll(this,il,null);ll(this,Bt,null);ll(this,Ft,!1);ll(this,wt,null);ll(this,pt,null);ll(this,Ct,null);ll(this,$t,null);ll(this,dl,!1);var Nl;ul(this,vt,nt),ul(this,$t,Wt),ul(this,cl,kt),ul(this,Ct,Et),ul(this,il,sl),ul(this,qt,L),ul(this,pt,ml),ul(this,Bt,al),ul(this,bl,ct);const Gl=p.PDFDateString.toDateObject(Yt);Gl&&ul(this,Mt,sl.l10n.get("annotation_date_string",{date:Gl.toLocaleDateString(),time:Gl.toLocaleTimeString()})),this.trigger=ct.flatMap(Tl=>Tl.getElementsToTriggerPopup());for(const Tl of this.trigger)Tl.addEventListener("click",bt(this,Dt)),Tl.addEventListener("mouseenter",bt(this,Jt)),Tl.addEventListener("mouseleave",bt(this,gt)),Tl.classList.add("popupTriggerArea");for(const Tl of ct)(Nl=Tl.container)==null||Nl.addEventListener("keydown",bt(this,Rt));bt(this,vt).hidden=!0,zl&&nl(this,Xl,oe).call(this)}render(){if(bt(this,wt))return;const{page:{view:nt},viewport:{rawDims:{pageWidth:L,pageHeight:ct,pageX:Wt,pageY:Yt}}}=bt(this,il),kt=ul(this,wt,document.createElement("div"));if(kt.className="popup",bt(this,qt)){const xl=kt.style.outlineColor=M.Util.makeHexColor(...bt(this,qt));CSS.supports("background-color","color-mix(in srgb, red 30%, white)")?kt.style.backgroundColor=`color-mix(in srgb, ${xl} 30%, white)`:kt.style.backgroundColor=M.Util.makeHexColor(...bt(this,qt).map(Cl=>Math.floor(.7*(255-Cl)+Cl)))}const Et=document.createElement("span");Et.className="header";const sl=document.createElement("h1");if(Et.append(sl),{dir:sl.dir,str:sl.textContent}=bt(this,$t),kt.append(Et),bt(this,Mt)){const xl=document.createElement("span");xl.classList.add("popupDate"),bt(this,Mt).then(Dl=>{xl.textContent=Dl}),Et.append(xl)}const ml=bt(this,cl),al=bt(this,Ct);if(al!=null&&al.str&&(!(ml!=null&&ml.str)||ml.str===al.str))O.XfaLayer.render({xfaHtml:al.html,intent:"richText",div:kt}),kt.lastChild.classList.add("richText","popupContent");else{const xl=this._formatContents(ml);kt.append(xl)}let zl=!!bt(this,Bt),Gl=zl?bt(this,Bt):bt(this,pt);for(const xl of bt(this,bl))if(!Gl||M.Util.intersect(xl.data.rect,Gl)!==null){Gl=xl.data.rect,zl=!0;break}const Nl=M.Util.normalizeRect([Gl[0],nt[3]-Gl[1]+nt[1],Gl[2],nt[3]-Gl[3]+nt[1]]),Rl=zl?Gl[2]-Gl[0]+5:0,Sl=Nl[0]+Rl,wl=Nl[1],{style:kl}=bt(this,vt);kl.left=`${100*(Sl-Wt)/L}%`,kl.top=`${100*(wl-Yt)/ct}%`,bt(this,vt).append(kt)}_formatContents({str:nt,dir:L}){const ct=document.createElement("p");ct.classList.add("popupContent"),ct.dir=L;const Wt=nt.split(/(?:\r\n?|\n)/);for(let Yt=0,kt=Wt.length;Yt<kt;++Yt){const Et=Wt[Yt];ct.append(document.createTextNode(Et)),Yt<kt-1&&ct.append(document.createElement("br"))}return ct}forceHide(){ul(this,dl,this.isVisible),bt(this,dl)&&(bt(this,vt).hidden=!0)}maybeShow(){bt(this,dl)&&(ul(this,dl,!1),bt(this,vt).hidden=!1)}get isVisible(){return bt(this,vt).hidden===!1}}Mt=new WeakMap,Rt=new WeakMap,gt=new WeakMap,Jt=new WeakMap,Dt=new WeakMap,qt=new WeakMap,vt=new WeakMap,cl=new WeakMap,bl=new WeakMap,il=new WeakMap,Bt=new WeakMap,Ft=new WeakMap,wt=new WeakMap,pt=new WeakMap,Ct=new WeakMap,$t=new WeakMap,dl=new WeakMap,rl=new WeakSet,Ns=function(nt){nt.altKey||nt.shiftKey||nt.ctrlKey||nt.metaKey||(nt.key==="Enter"||nt.key==="Escape"&&bt(this,Ft))&&nl(this,Xl,oe).call(this)},Xl=new WeakSet,oe=function(){ul(this,Ft,!bt(this,Ft)),bt(this,Ft)?(nl(this,Ll,Ke).call(this),bt(this,vt).addEventListener("click",bt(this,Dt)),bt(this,vt).addEventListener("keydown",bt(this,Rt))):(nl(this,Vl,ve).call(this),bt(this,vt).removeEventListener("click",bt(this,Dt)),bt(this,vt).removeEventListener("keydown",bt(this,Rt)))},Ll=new WeakSet,Ke=function(){bt(this,wt)||this.render(),this.isVisible?bt(this,Ft)&&bt(this,vt).classList.add("focused"):(bt(this,vt).hidden=!1,bt(this,vt).style.zIndex=parseInt(bt(this,vt).style.zIndex)+1e3)},Vl=new WeakSet,ve=function(){bt(this,vt).classList.remove("focused"),!(bt(this,Ft)||!this.isVisible)&&(bt(this,vt).hidden=!0,bt(this,vt).style.zIndex=parseInt(bt(this,vt).style.zIndex)-1e3)};class Zt extends S{constructor(nt){super(nt,{isRenderable:!0,ignoreBorder:!0}),this.textContent=nt.data.textContent,this.textPosition=nt.data.textPosition,this.annotationEditorType=M.AnnotationEditorType.FREETEXT}render(){if(this.container.classList.add("freeTextAnnotation"),this.textContent){const nt=document.createElement("div");nt.classList.add("annotationTextContent"),nt.setAttribute("role","comment");for(const L of this.textContent){const ct=document.createElement("span");ct.textContent=L,nt.append(ct)}this.container.append(nt)}return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this._editOnDoubleClick(),this.container}}r.FreeTextAnnotationElement=Zt;class dt extends S{constructor(L){super(L,{isRenderable:!0,ignoreBorder:!0});ll(this,ot,null)}render(){this.container.classList.add("lineAnnotation");const L=this.data,{width:ct,height:Wt}=K(L.rect),Yt=this.svgFactory.create(ct,Wt,!0),kt=ul(this,ot,this.svgFactory.createElement("svg:line"));return kt.setAttribute("x1",L.rect[2]-L.lineCoordinates[0]),kt.setAttribute("y1",L.rect[3]-L.lineCoordinates[1]),kt.setAttribute("x2",L.rect[2]-L.lineCoordinates[2]),kt.setAttribute("y2",L.rect[3]-L.lineCoordinates[3]),kt.setAttribute("stroke-width",L.borderStyle.width||1),kt.setAttribute("stroke","transparent"),kt.setAttribute("fill","transparent"),Yt.append(kt),this.container.append(Yt),!L.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return bt(this,ot)}addHighlightArea(){this.container.classList.add("highlightArea")}}ot=new WeakMap;class It extends S{constructor(L){super(L,{isRenderable:!0,ignoreBorder:!0});ll(this,ut,null)}render(){this.container.classList.add("squareAnnotation");const L=this.data,{width:ct,height:Wt}=K(L.rect),Yt=this.svgFactory.create(ct,Wt,!0),kt=L.borderStyle.width,Et=ul(this,ut,this.svgFactory.createElement("svg:rect"));return Et.setAttribute("x",kt/2),Et.setAttribute("y",kt/2),Et.setAttribute("width",ct-kt),Et.setAttribute("height",Wt-kt),Et.setAttribute("stroke-width",kt||1),Et.setAttribute("stroke","transparent"),Et.setAttribute("fill","transparent"),Yt.append(Et),this.container.append(Yt),!L.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return bt(this,ut)}addHighlightArea(){this.container.classList.add("highlightArea")}}ut=new WeakMap;class xt extends S{constructor(L){super(L,{isRenderable:!0,ignoreBorder:!0});ll(this,Tt,null)}render(){this.container.classList.add("circleAnnotation");const L=this.data,{width:ct,height:Wt}=K(L.rect),Yt=this.svgFactory.create(ct,Wt,!0),kt=L.borderStyle.width,Et=ul(this,Tt,this.svgFactory.createElement("svg:ellipse"));return Et.setAttribute("cx",ct/2),Et.setAttribute("cy",Wt/2),Et.setAttribute("rx",ct/2-kt/2),Et.setAttribute("ry",Wt/2-kt/2),Et.setAttribute("stroke-width",kt||1),Et.setAttribute("stroke","transparent"),Et.setAttribute("fill","transparent"),Yt.append(Et),this.container.append(Yt),!L.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return bt(this,Tt)}addHighlightArea(){this.container.classList.add("highlightArea")}}Tt=new WeakMap;class it extends S{constructor(L){super(L,{isRenderable:!0,ignoreBorder:!0});ll(this,jt,null);this.containerClassName="polylineAnnotation",this.svgElementName="svg:polyline"}render(){this.container.classList.add(this.containerClassName);const L=this.data,{width:ct,height:Wt}=K(L.rect),Yt=this.svgFactory.create(ct,Wt,!0);let kt=[];for(const sl of L.vertices){const ml=sl.x-L.rect[0],al=L.rect[3]-sl.y;kt.push(ml+","+al)}kt=kt.join(" ");const Et=ul(this,jt,this.svgFactory.createElement(this.svgElementName));return Et.setAttribute("points",kt),Et.setAttribute("stroke-width",L.borderStyle.width||1),Et.setAttribute("stroke","transparent"),Et.setAttribute("fill","transparent"),Yt.append(Et),this.container.append(Yt),!L.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return bt(this,jt)}addHighlightArea(){this.container.classList.add("highlightArea")}}jt=new WeakMap;class Xt extends it{constructor(nt){super(nt),this.containerClassName="polygonAnnotation",this.svgElementName="svg:polygon"}}class zt extends S{constructor(nt){super(nt,{isRenderable:!0,ignoreBorder:!0})}render(){return this.container.classList.add("caretAnnotation"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container}}class Gt extends S{constructor(L){super(L,{isRenderable:!0,ignoreBorder:!0});ll(this,Ot,[]);this.containerClassName="inkAnnotation",this.svgElementName="svg:polyline",this.annotationEditorType=M.AnnotationEditorType.INK}render(){this.container.classList.add(this.containerClassName);const L=this.data,{width:ct,height:Wt}=K(L.rect),Yt=this.svgFactory.create(ct,Wt,!0);for(const kt of L.inkLists){let Et=[];for(const ml of kt){const al=ml.x-L.rect[0],zl=L.rect[3]-ml.y;Et.push(`${al},${zl}`)}Et=Et.join(" ");const sl=this.svgFactory.createElement(this.svgElementName);bt(this,Ot).push(sl),sl.setAttribute("points",Et),sl.setAttribute("stroke-width",L.borderStyle.width||1),sl.setAttribute("stroke","transparent"),sl.setAttribute("fill","transparent"),!L.popupRef&&this.hasPopupData&&this._createPopup(),Yt.append(sl)}return this.container.append(Yt),this.container}getElementsToTriggerPopup(){return bt(this,Ot)}addHighlightArea(){this.container.classList.add("highlightArea")}}Ot=new WeakMap,r.InkAnnotationElement=Gt;class Nt extends S{constructor(nt){super(nt,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("highlightAnnotation"),this.container}}class Ut extends S{constructor(nt){super(nt,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("underlineAnnotation"),this.container}}class Vt extends S{constructor(nt){super(nt,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("squigglyAnnotation"),this.container}}class Ht extends S{constructor(nt){super(nt,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("strikeoutAnnotation"),this.container}}class Pt extends S{constructor(nt){super(nt,{isRenderable:!0,ignoreBorder:!0})}render(){return this.container.classList.add("stampAnnotation"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container}}r.StampAnnotationElement=Pt;class at extends S{constructor(L){var Yt;super(L,{isRenderable:!0});ll(this,yt);ll(this,Lt,null);const{filename:ct,content:Wt}=this.data.file;this.filename=(0,p.getFilenameFromUrl)(ct,!0),this.content=Wt,(Yt=this.linkService.eventBus)==null||Yt.dispatch("fileattachmentannotation",{source:this,filename:ct,content:Wt})}render(){this.container.classList.add("fileAttachmentAnnotation");const{container:L,data:ct}=this;let Wt;ct.hasAppearance||ct.fillAlpha===0?Wt=document.createElement("div"):(Wt=document.createElement("img"),Wt.src=`${this.imageResourcesPath}annotation-${/paperclip/i.test(ct.name)?"paperclip":"pushpin"}.svg`,ct.fillAlpha&&ct.fillAlpha<1&&(Wt.style=`filter: opacity(${Math.round(ct.fillAlpha*100)}%);`)),Wt.addEventListener("dblclick",nl(this,yt,Pe).bind(this)),ul(this,Lt,Wt);const{isMac:Yt}=M.FeatureTest.platform;return L.addEventListener("keydown",kt=>{kt.key==="Enter"&&(Yt?kt.metaKey:kt.ctrlKey)&&nl(this,yt,Pe).call(this)}),!ct.popupRef&&this.hasPopupData?this._createPopup():Wt.classList.add("popupTriggerArea"),L.append(Wt),L}getElementsToTriggerPopup(){return bt(this,Lt)}addHighlightArea(){this.container.classList.add("highlightArea")}}Lt=new WeakMap,yt=new WeakSet,Pe=function(){var L;(L=this.downloadManager)==null||L.openOrDownloadData(this.container,this.content,this.filename)};class R{constructor({div:nt,accessibilityManager:L,annotationCanvasMap:ct,l10n:Wt,page:Yt,viewport:kt}){ll(this,Qt);ll(this,hl);ll(this,tl,null);ll(this,el,null);ll(this,ol,new Map);this.div=nt,ul(this,tl,L),ul(this,el,ct),this.l10n=Wt,this.page=Yt,this.viewport=kt,this.zIndex=0,this.l10n||(this.l10n=U.NullL10n)}async render(nt){const{annotations:L}=nt,ct=this.div;(0,p.setLayerDimensions)(ct,this.viewport);const Wt=new Map,Yt={data:null,layer:ct,linkService:nt.linkService,downloadManager:nt.downloadManager,imageResourcesPath:nt.imageResourcesPath||"",renderForms:nt.renderForms!==!1,svgFactory:new p.DOMSVGFactory,annotationStorage:nt.annotationStorage||new B.AnnotationStorage,enableScripting:nt.enableScripting===!0,hasJSActions:nt.hasJSActions,fieldObjects:nt.fieldObjects,parent:this,elements:null};for(const kt of L){if(kt.noHTML)continue;const Et=kt.annotationType===M.AnnotationType.POPUP;if(Et){const al=Wt.get(kt.id);if(!al)continue;Yt.elements=al}else{const{width:al,height:zl}=K(kt.rect);if(al<=0||zl<=0)continue}Yt.data=kt;const sl=f.create(Yt);if(!sl.isRenderable)continue;if(!Et&&kt.popupRef){const al=Wt.get(kt.popupRef);al?al.push(sl):Wt.set(kt.popupRef,[sl])}sl.annotationEditorType>0&&bt(this,ol).set(sl.data.id,sl);const ml=sl.render();kt.hidden&&(ml.style.visibility="hidden"),nl(this,Qt,Xs).call(this,ml,kt.id)}nl(this,hl,He).call(this),await this.l10n.translate(ct)}update({viewport:nt}){const L=this.div;this.viewport=nt,(0,p.setLayerDimensions)(L,{rotation:nt.rotation}),nl(this,hl,He).call(this),L.hidden=!1}getEditableAnnotations(){return Array.from(bt(this,ol).values())}getEditableAnnotation(nt){return bt(this,ol).get(nt)}}tl=new WeakMap,el=new WeakMap,ol=new WeakMap,Qt=new WeakSet,Xs=function(nt,L){var Wt;const ct=nt.firstChild||nt;ct.id=`${M.AnnotationPrefix}${L}`,this.div.append(nt),(Wt=bt(this,tl))==null||Wt.moveElementInDOM(this.div,nt,ct,!1)},hl=new WeakSet,He=function(){if(!bt(this,el))return;const nt=this.div;for(const[L,ct]of bt(this,el)){const Wt=nt.querySelector(`[data-annotation-id="${L}"]`);if(!Wt)continue;const{firstChild:Yt}=Wt;Yt?Yt.nodeName==="CANVAS"?Yt.replaceWith(ct):Yt.before(ct):Wt.append(ct)}bt(this,el).clear()},r.AnnotationLayer=R},(lt,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ColorConverters=void 0;function h(B){return Math.floor(Math.max(0,Math.min(1,B))*255).toString(16).padStart(2,"0")}function M(B){return Math.max(0,Math.min(255,255*B))}class p{static CMYK_G([Q,U,O,I]){return["G",1-Math.min(1,.3*Q+.59*O+.11*U+I)]}static G_CMYK([Q]){return["CMYK",0,0,0,1-Q]}static G_RGB([Q]){return["RGB",Q,Q,Q]}static G_rgb([Q]){return Q=M(Q),[Q,Q,Q]}static G_HTML([Q]){const U=h(Q);return`#${U}${U}${U}`}static RGB_G([Q,U,O]){return["G",.3*Q+.59*U+.11*O]}static RGB_rgb(Q){return Q.map(M)}static RGB_HTML(Q){return`#${Q.map(h).join("")}`}static T_HTML(){return"#00000000"}static T_rgb(){return[null]}static CMYK_RGB([Q,U,O,I]){return["RGB",1-Math.min(1,Q+I),1-Math.min(1,O+I),1-Math.min(1,U+I)]}static CMYK_rgb([Q,U,O,I]){return[M(1-Math.min(1,Q+I)),M(1-Math.min(1,O+I)),M(1-Math.min(1,U+I))]}static CMYK_HTML(Q){const U=this.CMYK_RGB(Q).slice(1);return this.RGB_HTML(U)}static RGB_CMYK([Q,U,O]){const I=1-Q,j=1-U,q=1-O,K=Math.min(I,j,q);return["CMYK",I,j,q,K]}}r.ColorConverters=p},(lt,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.NullL10n=void 0,r.getL10nFallback=M;const h={of_pages:"of {{pagesCount}}",page_of_pages:"({{pageNumber}} of {{pagesCount}})",document_properties_kb:"{{size_kb}} KB ({{size_b}} bytes)",document_properties_mb:"{{size_mb}} MB ({{size_b}} bytes)",document_properties_date_string:"{{date}}, {{time}}",document_properties_page_size_unit_inches:"in",document_properties_page_size_unit_millimeters:"mm",document_properties_page_size_orientation_portrait:"portrait",document_properties_page_size_orientation_landscape:"landscape",document_properties_page_size_name_a3:"A3",document_properties_page_size_name_a4:"A4",document_properties_page_size_name_letter:"Letter",document_properties_page_size_name_legal:"Legal",document_properties_page_size_dimension_string:"{{width}} × {{height}} {{unit}} ({{orientation}})",document_properties_page_size_dimension_name_string:"{{width}} × {{height}} {{unit}} ({{name}}, {{orientation}})",document_properties_linearized_yes:"Yes",document_properties_linearized_no:"No",additional_layers:"Additional Layers",page_landmark:"Page {{page}}",thumb_page_title:"Page {{page}}",thumb_page_canvas:"Thumbnail of Page {{page}}",find_reached_top:"Reached top of document, continued from bottom",find_reached_bottom:"Reached end of document, continued from top","find_match_count[one]":"{{current}} of {{total}} match","find_match_count[other]":"{{current}} of {{total}} matches","find_match_count_limit[one]":"More than {{limit}} match","find_match_count_limit[other]":"More than {{limit}} matches",find_not_found:"Phrase not found",page_scale_width:"Page Width",page_scale_fit:"Page Fit",page_scale_auto:"Automatic Zoom",page_scale_actual:"Actual Size",page_scale_percent:"{{scale}}%",loading_error:"An error occurred while loading the PDF.",invalid_file_error:"Invalid or corrupted PDF file.",missing_file_error:"Missing PDF file.",unexpected_response_error:"Unexpected server response.",rendering_error:"An error occurred while rendering the page.",annotation_date_string:"{{date}}, {{time}}",printing_not_supported:"Warning: Printing is not fully supported by this browser.",printing_not_ready:"Warning: The PDF is not fully loaded for printing.",web_fonts_disabled:"Web fonts are disabled: unable to use embedded PDF fonts.",free_text2_default_content:"Start typing…",editor_free_text2_aria_label:"Text Editor",editor_ink2_aria_label:"Draw Editor",editor_ink_canvas_aria_label:"User-created image",editor_alt_text_button_label:"Alt text",editor_alt_text_edit_button_label:"Edit alt text",editor_alt_text_decorative_tooltip:"Marked as decorative"};h.print_progress_percent="{{progress}}%";function M(Q,U){switch(Q){case"find_match_count":Q=`find_match_count[${U.total===1?"one":"other"}]`;break;case"find_match_count_limit":Q=`find_match_count_limit[${U.limit===1?"one":"other"}]`;break}return h[Q]||""}function p(Q,U){return U?Q.replaceAll(/\{\{\s*(\w+)\s*\}\}/g,(O,I)=>I in U?U[I]:"{{"+I+"}}"):Q}const B={async getLanguage(){return"en-us"},async getDirection(){return"ltr"},async get(Q,U=null,O=M(Q,U)){return p(O,U)},async translate(Q){}};r.NullL10n=B},(lt,r,h)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.XfaLayer=void 0;var M=h(25);class p{static setupStorage(Q,U,O,I,j){const q=I.getValue(U,{value:null});switch(O.name){case"textarea":if(q.value!==null&&(Q.textContent=q.value),j==="print")break;Q.addEventListener("input",K=>{I.setValue(U,{value:K.target.value})});break;case"input":if(O.attributes.type==="radio"||O.attributes.type==="checkbox"){if(q.value===O.attributes.xfaOn?Q.setAttribute("checked",!0):q.value===O.attributes.xfaOff&&Q.removeAttribute("checked"),j==="print")break;Q.addEventListener("change",K=>{I.setValue(U,{value:K.target.checked?K.target.getAttribute("xfaOn"):K.target.getAttribute("xfaOff")})})}else{if(q.value!==null&&Q.setAttribute("value",q.value),j==="print")break;Q.addEventListener("input",K=>{I.setValue(U,{value:K.target.value})})}break;case"select":if(q.value!==null){Q.setAttribute("value",q.value);for(const K of O.children)K.attributes.value===q.value?K.attributes.selected=!0:K.attributes.hasOwnProperty("selected")&&delete K.attributes.selected}Q.addEventListener("input",K=>{const f=K.target.options,S=f.selectedIndex===-1?"":f[f.selectedIndex].value;I.setValue(U,{value:S})});break}}static setAttributes({html:Q,element:U,storage:O=null,intent:I,linkService:j}){const{attributes:q}=U,K=Q instanceof HTMLAnchorElement;q.type==="radio"&&(q.name=`${q.name}-${I}`);for(const[f,S]of Object.entries(q))if(S!=null)switch(f){case"class":S.length&&Q.setAttribute(f,S.join(" "));break;case"dataId":break;case"id":Q.setAttribute("data-element-id",S);break;case"style":Object.assign(Q.style,S);break;case"textContent":Q.textContent=S;break;default:(!K||f!=="href"&&f!=="newWindow")&&Q.setAttribute(f,S)}K&&j.addLinkAttributes(Q,q.href,q.newWindow),O&&q.dataId&&this.setupStorage(Q,q.dataId,U,O)}static render(Q){var k;const U=Q.annotationStorage,O=Q.linkService,I=Q.xfaHtml,j=Q.intent||"display",q=document.createElement(I.name);I.attributes&&this.setAttributes({html:q,element:I,intent:j,linkService:O});const K=[[I,-1,q]],f=Q.div;if(f.append(q),Q.viewport){const T=`matrix(${Q.viewport.transform.join(",")})`;f.style.transform=T}j!=="richText"&&f.setAttribute("class","xfaLayer xfaFont");const S=[];for(;K.length>0;){const[T,g,F]=K.at(-1);if(g+1===T.children.length){K.pop();continue}const J=T.children[++K.at(-1)[1]];if(J===null)continue;const{name:v}=J;if(v==="#text"){const m=document.createTextNode(J.value);S.push(m),F.append(m);continue}const u=(k=J==null?void 0:J.attributes)!=null&&k.xmlns?document.createElementNS(J.attributes.xmlns,v):document.createElement(v);if(F.append(u),J.attributes&&this.setAttributes({html:u,element:J,storage:U,intent:j,linkService:O}),J.children&&J.children.length>0)K.push([J,-1,u]);else if(J.value){const m=document.createTextNode(J.value);M.XfaText.shouldBuildText(v)&&S.push(m),u.append(m)}}for(const T of f.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))T.setAttribute("readOnly",!0);return{textDivs:S}}static update(Q){const U=`matrix(${Q.viewport.transform.join(",")})`;Q.div.style.transform=U,Q.div.hidden=!1}}r.XfaLayer=p},(lt,r,h)=>{var I,j,q,K,f,S,k,T,g,F,J,v,u,m,_,Ys,P,ps,dt,ys,xt,Ts,Xt,Qe,Gt,Ls,Ut,fe,Ht,Vs,at,Is,w,zs,C,Rs,st,Ss,Mt,El,gt,Be,Dt,me,vt,ue,bl,Ql,Bt,Ae,wt,We,Ct,ws,dl,_e,Yl,xs,pl,ks,yl,qe,_t,Ge,ut,fl;Object.defineProperty(r,"__esModule",{value:!0}),r.InkEditor=void 0;var M=h(1),p=h(4),B=h(29),Q=h(6),U=h(5);const jt=class jt extends p.AnnotationEditor{constructor(yt){super({...yt,name:"inkEditor"});ll(this,_);ll(this,P);ll(this,dt);ll(this,xt);ll(this,Xt);ll(this,Gt);ll(this,Ut);ll(this,Ht);ll(this,at);ll(this,w);ll(this,C);ll(this,st);ll(this,Mt);ll(this,gt);ll(this,Dt);ll(this,vt);ll(this,bl);ll(this,Bt);ll(this,wt);ll(this,pl);ll(this,yl);ll(this,_t);ll(this,ut);ll(this,I,0);ll(this,j,0);ll(this,q,this.canvasPointermove.bind(this));ll(this,K,this.canvasPointerleave.bind(this));ll(this,f,this.canvasPointerup.bind(this));ll(this,S,this.canvasPointerdown.bind(this));ll(this,k,new Path2D);ll(this,T,!1);ll(this,g,!1);ll(this,F,!1);ll(this,J,null);ll(this,v,0);ll(this,u,0);ll(this,m,null);this.color=yt.color||null,this.thickness=yt.thickness||null,this.opacity=yt.opacity||null,this.paths=[],this.bezierPath2D=[],this.allRawPaths=[],this.currentPath=[],this.scaleFactor=1,this.translationX=this.translationY=0,this.x=0,this.y=0,this._willKeepAspectRatio=!0}static initialize(yt){p.AnnotationEditor.initialize(yt,{strings:["editor_ink_canvas_aria_label","editor_ink2_aria_label"]})}static updateDefaultParams(yt,Kt){switch(yt){case M.AnnotationEditorParamsType.INK_THICKNESS:jt._defaultThickness=Kt;break;case M.AnnotationEditorParamsType.INK_COLOR:jt._defaultColor=Kt;break;case M.AnnotationEditorParamsType.INK_OPACITY:jt._defaultOpacity=Kt/100;break}}updateParams(yt,Kt){switch(yt){case M.AnnotationEditorParamsType.INK_THICKNESS:nl(this,_,Ys).call(this,Kt);break;case M.AnnotationEditorParamsType.INK_COLOR:nl(this,P,ps).call(this,Kt);break;case M.AnnotationEditorParamsType.INK_OPACITY:nl(this,dt,ys).call(this,Kt);break}}static get defaultPropertiesToUpdate(){return[[M.AnnotationEditorParamsType.INK_THICKNESS,jt._defaultThickness],[M.AnnotationEditorParamsType.INK_COLOR,jt._defaultColor||p.AnnotationEditor._defaultLineColor],[M.AnnotationEditorParamsType.INK_OPACITY,Math.round(jt._defaultOpacity*100)]]}get propertiesToUpdate(){return[[M.AnnotationEditorParamsType.INK_THICKNESS,this.thickness||jt._defaultThickness],[M.AnnotationEditorParamsType.INK_COLOR,this.color||jt._defaultColor||p.AnnotationEditor._defaultLineColor],[M.AnnotationEditorParamsType.INK_OPACITY,Math.round(100*(this.opacity??jt._defaultOpacity))]]}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(this.canvas||(nl(this,Dt,me).call(this),nl(this,vt,ue).call(this)),this.isAttachedToDOM||(this.parent.add(this),nl(this,bl,Ql).call(this)),nl(this,ut,fl).call(this)))}remove(){this.canvas!==null&&(this.isEmpty()||this.commit(),this.canvas.width=this.canvas.height=0,this.canvas.remove(),this.canvas=null,bt(this,J).disconnect(),ul(this,J,null),super.remove())}setParent(yt){!this.parent&&yt?this._uiManager.removeShouldRescale(this):this.parent&&yt===null&&this._uiManager.addShouldRescale(this),super.setParent(yt)}onScaleChanging(){const[yt,Kt]=this.parentDimensions,tl=this.width*yt,el=this.height*Kt;this.setDimensions(tl,el)}enableEditMode(){bt(this,T)||this.canvas===null||(super.enableEditMode(),this._isDraggable=!1,this.canvas.addEventListener("pointerdown",bt(this,S)))}disableEditMode(){!this.isInEditMode()||this.canvas===null||(super.disableEditMode(),this._isDraggable=!this.isEmpty(),this.div.classList.remove("editing"),this.canvas.removeEventListener("pointerdown",bt(this,S)))}onceAdded(){this._isDraggable=!this.isEmpty()}isEmpty(){return this.paths.length===0||this.paths.length===1&&this.paths[0].length===0}commit(){bt(this,T)||(super.commit(),this.isEditing=!1,this.disableEditMode(),this.setInForeground(),ul(this,T,!0),this.div.classList.add("disabled"),nl(this,ut,fl).call(this,!0),this.makeResizable(),this.parent.addInkEditorIfNeeded(!0),this.moveInDOM(),this.div.focus({preventScroll:!0}))}focusin(yt){this._focusEventsAllowed&&(super.focusin(yt),this.enableEditMode())}canvasPointerdown(yt){yt.button!==0||!this.isInEditMode()||bt(this,T)||(this.setInForeground(),yt.preventDefault(),yt.type!=="mouse"&&this.div.focus(),nl(this,Gt,Ls).call(this,yt.offsetX,yt.offsetY))}canvasPointermove(yt){yt.preventDefault(),nl(this,Ut,fe).call(this,yt.offsetX,yt.offsetY)}canvasPointerup(yt){yt.preventDefault(),nl(this,gt,Be).call(this,yt)}canvasPointerleave(yt){nl(this,gt,Be).call(this,yt)}get isResizable(){return!this.isEmpty()&&bt(this,T)}render(){if(this.div)return this.div;let yt,Kt;this.width&&(yt=this.x,Kt=this.y),super.render(),p.AnnotationEditor._l10nPromise.get("editor_ink2_aria_label").then(Ml=>{var hl;return(hl=this.div)==null?void 0:hl.setAttribute("aria-label",Ml)});const[tl,el,ol,Qt]=nl(this,xt,Ts).call(this);if(this.setAt(tl,el,0,0),this.setDims(ol,Qt),nl(this,Dt,me).call(this),this.width){const[Ml,hl]=this.parentDimensions;this.setAspectRatio(this.width*Ml,this.height*hl),this.setAt(yt*Ml,Kt*hl,this.width*Ml,this.height*hl),ul(this,F,!0),nl(this,bl,Ql).call(this),this.setDims(this.width*Ml,this.height*hl),nl(this,Mt,El).call(this),this.div.classList.add("disabled")}else this.div.classList.add("editing"),this.enableEditMode();return nl(this,vt,ue).call(this),this.div}setDimensions(yt,Kt){const tl=Math.round(yt),el=Math.round(Kt);if(bt(this,v)===tl&&bt(this,u)===el)return;ul(this,v,tl),ul(this,u,el),this.canvas.style.visibility="hidden";const[ol,Qt]=this.parentDimensions;this.width=yt/ol,this.height=Kt/Qt,this.fixAndSetPosition(),bt(this,T)&&nl(this,Bt,Ae).call(this,yt,Kt),nl(this,bl,Ql).call(this),nl(this,Mt,El).call(this),this.canvas.style.visibility="visible",this.fixDims()}static deserialize(yt,Kt,tl){var Yt,kt,Et;if(yt instanceof B.InkAnnotationElement)return null;const el=super.deserialize(yt,Kt,tl);el.thickness=yt.thickness,el.color=M.Util.makeHexColor(...yt.color),el.opacity=yt.opacity;const[ol,Qt]=el.pageDimensions,Ml=el.width*ol,hl=el.height*Qt,Il=el.parentScale,Wl=yt.thickness/2;ul(el,T,!0),ul(el,v,Math.round(Ml)),ul(el,u,Math.round(hl));const{paths:nt,rect:L,rotation:ct}=yt;for(let{bezier:sl}of nt){sl=nl(Yt=jt,Yl,xs).call(Yt,sl,L,ct);const ml=[];el.paths.push(ml);let al=Il*(sl[0]-Wl),zl=Il*(sl[1]-Wl);for(let Nl=2,Tl=sl.length;Nl<Tl;Nl+=6){const Rl=Il*(sl[Nl]-Wl),Sl=Il*(sl[Nl+1]-Wl),wl=Il*(sl[Nl+2]-Wl),kl=Il*(sl[Nl+3]-Wl),xl=Il*(sl[Nl+4]-Wl),Dl=Il*(sl[Nl+5]-Wl);ml.push([[al,zl],[Rl,Sl],[wl,kl],[xl,Dl]]),al=xl,zl=Dl}const Gl=nl(this,Ct,ws).call(this,ml);el.bezierPath2D.push(Gl)}const Wt=nl(kt=el,yl,qe).call(kt);return ul(el,j,Math.max(p.AnnotationEditor.MIN_SIZE,Wt[2]-Wt[0])),ul(el,I,Math.max(p.AnnotationEditor.MIN_SIZE,Wt[3]-Wt[1])),nl(Et=el,Bt,Ae).call(Et,Ml,hl),el}serialize(){if(this.isEmpty())return null;const yt=this.getRect(0,0),Kt=p.AnnotationEditor._colorManager.convert(this.ctx.strokeStyle);return{annotationType:M.AnnotationEditorType.INK,color:Kt,thickness:this.thickness,opacity:this.opacity,paths:nl(this,pl,ks).call(this,this.scaleFactor/this.parentScale,this.translationX,this.translationY,yt),pageIndex:this.pageIndex,rect:yt,rotation:this.rotation,structTreeParentId:this._structTreeParentId}}};I=new WeakMap,j=new WeakMap,q=new WeakMap,K=new WeakMap,f=new WeakMap,S=new WeakMap,k=new WeakMap,T=new WeakMap,g=new WeakMap,F=new WeakMap,J=new WeakMap,v=new WeakMap,u=new WeakMap,m=new WeakMap,_=new WeakSet,Ys=function(yt){const Kt=this.thickness;this.addCommands({cmd:()=>{this.thickness=yt,nl(this,ut,fl).call(this)},undo:()=>{this.thickness=Kt,nl(this,ut,fl).call(this)},mustExec:!0,type:M.AnnotationEditorParamsType.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0})},P=new WeakSet,ps=function(yt){const Kt=this.color;this.addCommands({cmd:()=>{this.color=yt,nl(this,Mt,El).call(this)},undo:()=>{this.color=Kt,nl(this,Mt,El).call(this)},mustExec:!0,type:M.AnnotationEditorParamsType.INK_COLOR,overwriteIfSameType:!0,keepUndo:!0})},dt=new WeakSet,ys=function(yt){yt/=100;const Kt=this.opacity;this.addCommands({cmd:()=>{this.opacity=yt,nl(this,Mt,El).call(this)},undo:()=>{this.opacity=Kt,nl(this,Mt,El).call(this)},mustExec:!0,type:M.AnnotationEditorParamsType.INK_OPACITY,overwriteIfSameType:!0,keepUndo:!0})},xt=new WeakSet,Ts=function(){const{parentRotation:yt,parentDimensions:[Kt,tl]}=this;switch(yt){case 90:return[0,tl,tl,Kt];case 180:return[Kt,tl,Kt,tl];case 270:return[Kt,0,tl,Kt];default:return[0,0,Kt,tl]}},Xt=new WeakSet,Qe=function(){const{ctx:yt,color:Kt,opacity:tl,thickness:el,parentScale:ol,scaleFactor:Qt}=this;yt.lineWidth=el*ol/Qt,yt.lineCap="round",yt.lineJoin="round",yt.miterLimit=10,yt.strokeStyle=`${Kt}${(0,U.opacityToHex)(tl)}`},Gt=new WeakSet,Ls=function(yt,Kt){this.canvas.addEventListener("contextmenu",Q.noContextMenu),this.canvas.addEventListener("pointerleave",bt(this,K)),this.canvas.addEventListener("pointermove",bt(this,q)),this.canvas.addEventListener("pointerup",bt(this,f)),this.canvas.removeEventListener("pointerdown",bt(this,S)),this.isEditing=!0,bt(this,F)||(ul(this,F,!0),nl(this,bl,Ql).call(this),this.thickness||(this.thickness=jt._defaultThickness),this.color||(this.color=jt._defaultColor||p.AnnotationEditor._defaultLineColor),this.opacity??(this.opacity=jt._defaultOpacity)),this.currentPath.push([yt,Kt]),ul(this,g,!1),nl(this,Xt,Qe).call(this),ul(this,m,()=>{nl(this,w,zs).call(this),bt(this,m)&&window.requestAnimationFrame(bt(this,m))}),window.requestAnimationFrame(bt(this,m))},Ut=new WeakSet,fe=function(yt,Kt){const[tl,el]=this.currentPath.at(-1);if(this.currentPath.length>1&&yt===tl&&Kt===el)return;const ol=this.currentPath;let Qt=bt(this,k);if(ol.push([yt,Kt]),ul(this,g,!0),ol.length<=2){Qt.moveTo(...ol[0]),Qt.lineTo(yt,Kt);return}ol.length===3&&(ul(this,k,Qt=new Path2D),Qt.moveTo(...ol[0])),nl(this,C,Rs).call(this,Qt,...ol.at(-3),...ol.at(-2),yt,Kt)},Ht=new WeakSet,Vs=function(){if(this.currentPath.length===0)return;const yt=this.currentPath.at(-1);bt(this,k).lineTo(...yt)},at=new WeakSet,Is=function(yt,Kt){ul(this,m,null),yt=Math.min(Math.max(yt,0),this.canvas.width),Kt=Math.min(Math.max(Kt,0),this.canvas.height),nl(this,Ut,fe).call(this,yt,Kt),nl(this,Ht,Vs).call(this);let tl;if(this.currentPath.length!==1)tl=nl(this,st,Ss).call(this);else{const hl=[yt,Kt];tl=[[hl,hl.slice(),hl.slice(),hl]]}const el=bt(this,k),ol=this.currentPath;this.currentPath=[],ul(this,k,new Path2D);const Qt=()=>{this.allRawPaths.push(ol),this.paths.push(tl),this.bezierPath2D.push(el),this.rebuild()},Ml=()=>{this.allRawPaths.pop(),this.paths.pop(),this.bezierPath2D.pop(),this.paths.length===0?this.remove():(this.canvas||(nl(this,Dt,me).call(this),nl(this,vt,ue).call(this)),nl(this,ut,fl).call(this))};this.addCommands({cmd:Qt,undo:Ml,mustExec:!0})},w=new WeakSet,zs=function(){if(!bt(this,g))return;ul(this,g,!1);const yt=Math.ceil(this.thickness*this.parentScale),Kt=this.currentPath.slice(-3),tl=Kt.map(Qt=>Qt[0]),el=Kt.map(Qt=>Qt[1]);Math.min(...tl)-yt,Math.max(...tl)+yt,Math.min(...el)-yt,Math.max(...el)+yt;const{ctx:ol}=this;ol.save(),ol.clearRect(0,0,this.canvas.width,this.canvas.height);for(const Qt of this.bezierPath2D)ol.stroke(Qt);ol.stroke(bt(this,k)),ol.restore()},C=new WeakSet,Rs=function(yt,Kt,tl,el,ol,Qt,Ml){const hl=(Kt+el)/2,Il=(tl+ol)/2,Wl=(el+Qt)/2,nt=(ol+Ml)/2;yt.bezierCurveTo(hl+2*(el-hl)/3,Il+2*(ol-Il)/3,Wl+2*(el-Wl)/3,nt+2*(ol-nt)/3,Wl,nt)},st=new WeakSet,Ss=function(){const yt=this.currentPath;if(yt.length<=2)return[[yt[0],yt[0],yt.at(-1),yt.at(-1)]];const Kt=[];let tl,[el,ol]=yt[0];for(tl=1;tl<yt.length-2;tl++){const[L,ct]=yt[tl],[Wt,Yt]=yt[tl+1],kt=(L+Wt)/2,Et=(ct+Yt)/2,sl=[el+2*(L-el)/3,ol+2*(ct-ol)/3],ml=[kt+2*(L-kt)/3,Et+2*(ct-Et)/3];Kt.push([[el,ol],sl,ml,[kt,Et]]),[el,ol]=[kt,Et]}const[Qt,Ml]=yt[tl],[hl,Il]=yt[tl+1],Wl=[el+2*(Qt-el)/3,ol+2*(Ml-ol)/3],nt=[hl+2*(Qt-hl)/3,Il+2*(Ml-Il)/3];return Kt.push([[el,ol],Wl,nt,[hl,Il]]),Kt},Mt=new WeakSet,El=function(){if(this.isEmpty()){nl(this,wt,We).call(this);return}nl(this,Xt,Qe).call(this);const{canvas:yt,ctx:Kt}=this;Kt.setTransform(1,0,0,1,0,0),Kt.clearRect(0,0,yt.width,yt.height),nl(this,wt,We).call(this);for(const tl of this.bezierPath2D)Kt.stroke(tl)},gt=new WeakSet,Be=function(yt){this.canvas.removeEventListener("pointerleave",bt(this,K)),this.canvas.removeEventListener("pointermove",bt(this,q)),this.canvas.removeEventListener("pointerup",bt(this,f)),this.canvas.addEventListener("pointerdown",bt(this,S)),setTimeout(()=>{this.canvas.removeEventListener("contextmenu",Q.noContextMenu)},10),nl(this,at,Is).call(this,yt.offsetX,yt.offsetY),this.addToAnnotationStorage(),this.setInBackground()},Dt=new WeakSet,me=function(){this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=0,this.canvas.className="inkEditorCanvas",p.AnnotationEditor._l10nPromise.get("editor_ink_canvas_aria_label").then(yt=>{var Kt;return(Kt=this.canvas)==null?void 0:Kt.setAttribute("aria-label",yt)}),this.div.append(this.canvas),this.ctx=this.canvas.getContext("2d")},vt=new WeakSet,ue=function(){ul(this,J,new ResizeObserver(yt=>{const Kt=yt[0].contentRect;Kt.width&&Kt.height&&this.setDimensions(Kt.width,Kt.height)})),bt(this,J).observe(this.div)},bl=new WeakSet,Ql=function(){if(!bt(this,F))return;const[yt,Kt]=this.parentDimensions;this.canvas.width=Math.ceil(this.width*yt),this.canvas.height=Math.ceil(this.height*Kt),nl(this,wt,We).call(this)},Bt=new WeakSet,Ae=function(yt,Kt){const tl=nl(this,_t,Ge).call(this),el=(yt-tl)/bt(this,j),ol=(Kt-tl)/bt(this,I);this.scaleFactor=Math.min(el,ol)},wt=new WeakSet,We=function(){const yt=nl(this,_t,Ge).call(this)/2;this.ctx.setTransform(this.scaleFactor,0,0,this.scaleFactor,this.translationX*this.scaleFactor+yt,this.translationY*this.scaleFactor+yt)},Ct=new WeakSet,ws=function(yt){const Kt=new Path2D;for(let tl=0,el=yt.length;tl<el;tl++){const[ol,Qt,Ml,hl]=yt[tl];tl===0&&Kt.moveTo(...ol),Kt.bezierCurveTo(Qt[0],Qt[1],Ml[0],Ml[1],hl[0],hl[1])}return Kt},dl=new WeakSet,_e=function(yt,Kt,tl){const[el,ol,Qt,Ml]=Kt;switch(tl){case 0:for(let hl=0,Il=yt.length;hl<Il;hl+=2)yt[hl]+=el,yt[hl+1]=Ml-yt[hl+1];break;case 90:for(let hl=0,Il=yt.length;hl<Il;hl+=2){const Wl=yt[hl];yt[hl]=yt[hl+1]+el,yt[hl+1]=Wl+ol}break;case 180:for(let hl=0,Il=yt.length;hl<Il;hl+=2)yt[hl]=Qt-yt[hl],yt[hl+1]+=ol;break;case 270:for(let hl=0,Il=yt.length;hl<Il;hl+=2){const Wl=yt[hl];yt[hl]=Qt-yt[hl+1],yt[hl+1]=Ml-Wl}break;default:throw new Error("Invalid rotation")}return yt},Yl=new WeakSet,xs=function(yt,Kt,tl){const[el,ol,Qt,Ml]=Kt;switch(tl){case 0:for(let hl=0,Il=yt.length;hl<Il;hl+=2)yt[hl]-=el,yt[hl+1]=Ml-yt[hl+1];break;case 90:for(let hl=0,Il=yt.length;hl<Il;hl+=2){const Wl=yt[hl];yt[hl]=yt[hl+1]-ol,yt[hl+1]=Wl-el}break;case 180:for(let hl=0,Il=yt.length;hl<Il;hl+=2)yt[hl]=Qt-yt[hl],yt[hl+1]-=ol;break;case 270:for(let hl=0,Il=yt.length;hl<Il;hl+=2){const Wl=yt[hl];yt[hl]=Ml-yt[hl+1],yt[hl+1]=Qt-Wl}break;default:throw new Error("Invalid rotation")}return yt},pl=new WeakSet,ks=function(yt,Kt,tl,el){var Il,Wl;const ol=[],Qt=this.thickness/2,Ml=yt*Kt+Qt,hl=yt*tl+Qt;for(const nt of this.paths){const L=[],ct=[];for(let Wt=0,Yt=nt.length;Wt<Yt;Wt++){const[kt,Et,sl,ml]=nt[Wt],al=yt*kt[0]+Ml,zl=yt*kt[1]+hl,Gl=yt*Et[0]+Ml,Nl=yt*Et[1]+hl,Tl=yt*sl[0]+Ml,Rl=yt*sl[1]+hl,Sl=yt*ml[0]+Ml,wl=yt*ml[1]+hl;Wt===0&&(L.push(al,zl),ct.push(al,zl)),L.push(Gl,Nl,Tl,Rl,Sl,wl),ct.push(Gl,Nl),Wt===Yt-1&&ct.push(Sl,wl)}ol.push({bezier:nl(Il=jt,dl,_e).call(Il,L,el,this.rotation),points:nl(Wl=jt,dl,_e).call(Wl,ct,el,this.rotation)})}return ol},yl=new WeakSet,qe=function(){let yt=1/0,Kt=-1/0,tl=1/0,el=-1/0;for(const ol of this.paths)for(const[Qt,Ml,hl,Il]of ol){const Wl=M.Util.bezierBoundingBox(...Qt,...Ml,...hl,...Il);yt=Math.min(yt,Wl[0]),tl=Math.min(tl,Wl[1]),Kt=Math.max(Kt,Wl[2]),el=Math.max(el,Wl[3])}return[yt,tl,Kt,el]},_t=new WeakSet,Ge=function(){return bt(this,T)?Math.ceil(this.thickness*this.parentScale):0},ut=new WeakSet,fl=function(yt=!1){if(this.isEmpty())return;if(!bt(this,T)){nl(this,Mt,El).call(this);return}const Kt=nl(this,yl,qe).call(this),tl=nl(this,_t,Ge).call(this);ul(this,j,Math.max(p.AnnotationEditor.MIN_SIZE,Kt[2]-Kt[0])),ul(this,I,Math.max(p.AnnotationEditor.MIN_SIZE,Kt[3]-Kt[1]));const el=Math.ceil(tl+bt(this,j)*this.scaleFactor),ol=Math.ceil(tl+bt(this,I)*this.scaleFactor),[Qt,Ml]=this.parentDimensions;this.width=el/Qt,this.height=ol/Ml,this.setAspectRatio(el,ol);const hl=this.translationX,Il=this.translationY;this.translationX=-Kt[0],this.translationY=-Kt[1],nl(this,bl,Ql).call(this),nl(this,Mt,El).call(this),ul(this,v,el),ul(this,u,ol),this.setDims(el,ol);const Wl=yt?tl/this.scaleFactor/2:0;this.translate(hl-this.translationX-Wl,Il-this.translationY-Wl)},ll(jt,Ct),ll(jt,dl),ll(jt,Yl),gl(jt,"_defaultColor",null),gl(jt,"_defaultOpacity",1),gl(jt,"_defaultThickness",1),gl(jt,"_type","ink");let O=jt;r.InkEditor=O},(lt,r,h)=>{var O,I,j,q,K,f,S,k,T,g,F,ee,v,se,m,Me,$,$e,Zt,gs,It,Ds,it,ts,zt,re,Nt,js;Object.defineProperty(r,"__esModule",{value:!0}),r.StampEditor=void 0;var M=h(1),p=h(4),B=h(6),Q=h(29);const Vt=class Vt extends p.AnnotationEditor{constructor(at){super({...at,name:"stampEditor"});ll(this,F);ll(this,v);ll(this,m);ll(this,$);ll(this,Zt);ll(this,It);ll(this,it);ll(this,zt);ll(this,Nt);ll(this,O,null);ll(this,I,null);ll(this,j,null);ll(this,q,null);ll(this,K,null);ll(this,f,null);ll(this,S,null);ll(this,k,null);ll(this,T,!1);ll(this,g,!1);ul(this,q,at.bitmapUrl),ul(this,K,at.bitmapFile)}static initialize(at){p.AnnotationEditor.initialize(at)}static get supportedTypes(){const at=["apng","avif","bmp","gif","jpeg","png","svg+xml","webp","x-icon"];return(0,M.shadow)(this,"supportedTypes",at.map(R=>`image/${R}`))}static get supportedTypesStr(){return(0,M.shadow)(this,"supportedTypesStr",this.supportedTypes.join(","))}static isHandlingMimeForPasting(at){return this.supportedTypes.includes(at)}static paste(at,R){R.pasteEditor(M.AnnotationEditorType.STAMP,{bitmapFile:at.getAsFile()})}remove(){var at,R;bt(this,I)&&(ul(this,O,null),this._uiManager.imageManager.deleteId(bt(this,I)),(at=bt(this,f))==null||at.remove(),ul(this,f,null),(R=bt(this,S))==null||R.disconnect(),ul(this,S,null)),super.remove()}rebuild(){if(!this.parent){bt(this,I)&&nl(this,m,Me).call(this);return}super.rebuild(),this.div!==null&&(bt(this,I)&&nl(this,m,Me).call(this),this.isAttachedToDOM||this.parent.add(this))}onceAdded(){this._isDraggable=!0,this.div.focus()}isEmpty(){return!(bt(this,j)||bt(this,O)||bt(this,q)||bt(this,K))}get isResizable(){return!0}render(){if(this.div)return this.div;let at,R;if(this.width&&(at=this.x,R=this.y),super.render(),this.div.hidden=!0,bt(this,O)?nl(this,$,$e).call(this):nl(this,m,Me).call(this),this.width){const[w,X]=this.parentDimensions;this.setAt(at*w,R*X,this.width*w,this.height*X)}return this.div}static deserialize(at,R,w){if(at instanceof Q.StampAnnotationElement)return null;const X=super.deserialize(at,R,w),{rect:C,bitmapUrl:H,bitmapId:st,isSvg:et,accessibilityData:Mt}=at;st&&w.imageManager.isValidId(st)?ul(X,I,st):ul(X,q,H),ul(X,T,et);const[Rt,gt]=X.pageDimensions;return X.width=(C[2]-C[0])/Rt,X.height=(C[3]-C[1])/gt,Mt&&(X.altTextData=Mt),X}serialize(at=!1,R=null){if(this.isEmpty())return null;const w={annotationType:M.AnnotationEditorType.STAMP,bitmapId:bt(this,I),pageIndex:this.pageIndex,rect:this.getRect(0,0),rotation:this.rotation,isSvg:bt(this,T),structTreeParentId:this._structTreeParentId};if(at)return w.bitmapUrl=nl(this,zt,re).call(this,!0),w.accessibilityData=this.altTextData,w;const{decorative:X,altText:C}=this.altTextData;if(!X&&C&&(w.accessibilityData={type:"Figure",alt:C}),R===null)return w;R.stamps||(R.stamps=new Map);const H=bt(this,T)?(w.rect[2]-w.rect[0])*(w.rect[3]-w.rect[1]):null;if(!R.stamps.has(bt(this,I)))R.stamps.set(bt(this,I),{area:H,serialized:w}),w.bitmap=nl(this,zt,re).call(this,!1);else if(bt(this,T)){const st=R.stamps.get(bt(this,I));H>st.area&&(st.area=H,st.serialized.bitmap.close(),st.serialized.bitmap=nl(this,zt,re).call(this,!1))}return w}};O=new WeakMap,I=new WeakMap,j=new WeakMap,q=new WeakMap,K=new WeakMap,f=new WeakMap,S=new WeakMap,k=new WeakMap,T=new WeakMap,g=new WeakMap,F=new WeakSet,ee=function(at,R=!1){if(!at){this.remove();return}ul(this,O,at.bitmap),R||(ul(this,I,at.id),ul(this,T,at.isSvg)),nl(this,$,$e).call(this)},v=new WeakSet,se=function(){ul(this,j,null),this._uiManager.enableWaiting(!1),bt(this,f)&&this.div.focus()},m=new WeakSet,Me=function(){if(bt(this,I)){this._uiManager.enableWaiting(!0),this._uiManager.imageManager.getFromId(bt(this,I)).then(R=>nl(this,F,ee).call(this,R,!0)).finally(()=>nl(this,v,se).call(this));return}if(bt(this,q)){const R=bt(this,q);ul(this,q,null),this._uiManager.enableWaiting(!0),ul(this,j,this._uiManager.imageManager.getFromUrl(R).then(w=>nl(this,F,ee).call(this,w)).finally(()=>nl(this,v,se).call(this)));return}if(bt(this,K)){const R=bt(this,K);ul(this,K,null),this._uiManager.enableWaiting(!0),ul(this,j,this._uiManager.imageManager.getFromFile(R).then(w=>nl(this,F,ee).call(this,w)).finally(()=>nl(this,v,se).call(this)));return}const at=document.createElement("input");at.type="file",at.accept=Vt.supportedTypesStr,ul(this,j,new Promise(R=>{at.addEventListener("change",async()=>{if(!at.files||at.files.length===0)this.remove();else{this._uiManager.enableWaiting(!0);const w=await this._uiManager.imageManager.getFromFile(at.files[0]);nl(this,F,ee).call(this,w)}R()}),at.addEventListener("cancel",()=>{this.remove(),R()})}).finally(()=>nl(this,v,se).call(this))),at.click()},$=new WeakSet,$e=function(){const{div:at}=this;let{width:R,height:w}=bt(this,O);const[X,C]=this.pageDimensions,H=.75;if(this.width)R=this.width*X,w=this.height*C;else if(R>H*X||w>H*C){const Rt=Math.min(H*X/R,H*C/w);R*=Rt,w*=Rt}const[st,et]=this.parentDimensions;this.setDims(R*st/X,w*et/C),this._uiManager.enableWaiting(!1);const Mt=ul(this,f,document.createElement("canvas"));at.append(Mt),at.hidden=!1,nl(this,it,ts).call(this,R,w),nl(this,Nt,js).call(this),bt(this,g)||(this.parent.addUndoableEditor(this),ul(this,g,!0)),this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",subtype:this.editorType,data:{action:"inserted_image"}}}),this.addAltTextButton()},Zt=new WeakSet,gs=function(at,R){var H;const[w,X]=this.parentDimensions;this.width=at/w,this.height=R/X,this.setDims(at,R),(H=this._initialOptions)!=null&&H.isCentered?this.center():this.fixAndSetPosition(),this._initialOptions=null,bt(this,k)!==null&&clearTimeout(bt(this,k)),ul(this,k,setTimeout(()=>{ul(this,k,null),nl(this,it,ts).call(this,at,R)},200))},It=new WeakSet,Ds=function(at,R){const{width:w,height:X}=bt(this,O);let C=w,H=X,st=bt(this,O);for(;C>2*at||H>2*R;){const et=C,Mt=H;C>2*at&&(C=C>=16384?Math.floor(C/2)-1:Math.ceil(C/2)),H>2*R&&(H=H>=16384?Math.floor(H/2)-1:Math.ceil(H/2));const Rt=new OffscreenCanvas(C,H);Rt.getContext("2d").drawImage(st,0,0,et,Mt,0,0,C,H),st=Rt.transferToImageBitmap()}return st},it=new WeakSet,ts=function(at,R){at=Math.ceil(at),R=Math.ceil(R);const w=bt(this,f);if(!w||w.width===at&&w.height===R)return;w.width=at,w.height=R;const X=bt(this,T)?bt(this,O):nl(this,It,Ds).call(this,at,R),C=w.getContext("2d");C.filter=this._uiManager.hcmFilter,C.drawImage(X,0,0,X.width,X.height,0,0,at,R)},zt=new WeakSet,re=function(at){if(at){if(bt(this,T)){const X=this._uiManager.imageManager.getSvgUrl(bt(this,I));if(X)return X}const R=document.createElement("canvas");return{width:R.width,height:R.height}=bt(this,O),R.getContext("2d").drawImage(bt(this,O),0,0),R.toDataURL()}if(bt(this,T)){const[R,w]=this.pageDimensions,X=Math.round(this.width*R*B.PixelsPerInch.PDF_TO_CSS_UNITS),C=Math.round(this.height*w*B.PixelsPerInch.PDF_TO_CSS_UNITS),H=new OffscreenCanvas(X,C);return H.getContext("2d").drawImage(bt(this,O),0,0,bt(this,O).width,bt(this,O).height,0,0,X,C),H.transferToImageBitmap()}return structuredClone(bt(this,O))},Nt=new WeakSet,js=function(){ul(this,S,new ResizeObserver(at=>{const R=at[0].contentRect;R.width&&R.height&&nl(this,Zt,gs).call(this,R.width,R.height)})),bt(this,S).observe(this.div)},gl(Vt,"_type","stamp");let U=Vt;r.StampEditor=U}],__webpack_module_cache__={};function __w_pdfjs_require__(lt){var r=__webpack_module_cache__[lt];if(r!==void 0)return r.exports;var h=__webpack_module_cache__[lt]={exports:{}};return __webpack_modules__[lt](h,h.exports,__w_pdfjs_require__),h.exports}var __webpack_exports__={};return(()=>{var lt=__webpack_exports__;Object.defineProperty(lt,"__esModule",{value:!0}),Object.defineProperty(lt,"AbortException",{enumerable:!0,get:function(){return r.AbortException}}),Object.defineProperty(lt,"AnnotationEditorLayer",{enumerable:!0,get:function(){return B.AnnotationEditorLayer}}),Object.defineProperty(lt,"AnnotationEditorParamsType",{enumerable:!0,get:function(){return r.AnnotationEditorParamsType}}),Object.defineProperty(lt,"AnnotationEditorType",{enumerable:!0,get:function(){return r.AnnotationEditorType}}),Object.defineProperty(lt,"AnnotationEditorUIManager",{enumerable:!0,get:function(){return Q.AnnotationEditorUIManager}}),Object.defineProperty(lt,"AnnotationLayer",{enumerable:!0,get:function(){return U.AnnotationLayer}}),Object.defineProperty(lt,"AnnotationMode",{enumerable:!0,get:function(){return r.AnnotationMode}}),Object.defineProperty(lt,"CMapCompressionType",{enumerable:!0,get:function(){return r.CMapCompressionType}}),Object.defineProperty(lt,"DOMSVGFactory",{enumerable:!0,get:function(){return M.DOMSVGFactory}}),Object.defineProperty(lt,"FeatureTest",{enumerable:!0,get:function(){return r.FeatureTest}}),Object.defineProperty(lt,"GlobalWorkerOptions",{enumerable:!0,get:function(){return O.GlobalWorkerOptions}}),Object.defineProperty(lt,"ImageKind",{enumerable:!0,get:function(){return r.ImageKind}}),Object.defineProperty(lt,"InvalidPDFException",{enumerable:!0,get:function(){return r.InvalidPDFException}}),Object.defineProperty(lt,"MissingPDFException",{enumerable:!0,get:function(){return r.MissingPDFException}}),Object.defineProperty(lt,"OPS",{enumerable:!0,get:function(){return r.OPS}}),Object.defineProperty(lt,"PDFDataRangeTransport",{enumerable:!0,get:function(){return h.PDFDataRangeTransport}}),Object.defineProperty(lt,"PDFDateString",{enumerable:!0,get:function(){return M.PDFDateString}}),Object.defineProperty(lt,"PDFWorker",{enumerable:!0,get:function(){return h.PDFWorker}}),Object.defineProperty(lt,"PasswordResponses",{enumerable:!0,get:function(){return r.PasswordResponses}}),Object.defineProperty(lt,"PermissionFlag",{enumerable:!0,get:function(){return r.PermissionFlag}}),Object.defineProperty(lt,"PixelsPerInch",{enumerable:!0,get:function(){return M.PixelsPerInch}}),Object.defineProperty(lt,"PromiseCapability",{enumerable:!0,get:function(){return r.PromiseCapability}}),Object.defineProperty(lt,"RenderingCancelledException",{enumerable:!0,get:function(){return M.RenderingCancelledException}}),Object.defineProperty(lt,"SVGGraphics",{enumerable:!0,get:function(){return h.SVGGraphics}}),Object.defineProperty(lt,"UnexpectedResponseException",{enumerable:!0,get:function(){return r.UnexpectedResponseException}}),Object.defineProperty(lt,"Util",{enumerable:!0,get:function(){return r.Util}}),Object.defineProperty(lt,"VerbosityLevel",{enumerable:!0,get:function(){return r.VerbosityLevel}}),Object.defineProperty(lt,"XfaLayer",{enumerable:!0,get:function(){return I.XfaLayer}}),Object.defineProperty(lt,"build",{enumerable:!0,get:function(){return h.build}}),Object.defineProperty(lt,"createValidAbsoluteUrl",{enumerable:!0,get:function(){return r.createValidAbsoluteUrl}}),Object.defineProperty(lt,"getDocument",{enumerable:!0,get:function(){return h.getDocument}}),Object.defineProperty(lt,"getFilenameFromUrl",{enumerable:!0,get:function(){return M.getFilenameFromUrl}}),Object.defineProperty(lt,"getPdfFilenameFromUrl",{enumerable:!0,get:function(){return M.getPdfFilenameFromUrl}}),Object.defineProperty(lt,"getXfaPageViewport",{enumerable:!0,get:function(){return M.getXfaPageViewport}}),Object.defineProperty(lt,"isDataScheme",{enumerable:!0,get:function(){return M.isDataScheme}}),Object.defineProperty(lt,"isPdfFile",{enumerable:!0,get:function(){return M.isPdfFile}}),Object.defineProperty(lt,"loadScript",{enumerable:!0,get:function(){return M.loadScript}}),Object.defineProperty(lt,"noContextMenu",{enumerable:!0,get:function(){return M.noContextMenu}}),Object.defineProperty(lt,"normalizeUnicode",{enumerable:!0,get:function(){return r.normalizeUnicode}}),Object.defineProperty(lt,"renderTextLayer",{enumerable:!0,get:function(){return p.renderTextLayer}}),Object.defineProperty(lt,"setLayerDimensions",{enumerable:!0,get:function(){return M.setLayerDimensions}}),Object.defineProperty(lt,"shadow",{enumerable:!0,get:function(){return r.shadow}}),Object.defineProperty(lt,"updateTextLayer",{enumerable:!0,get:function(){return p.updateTextLayer}}),Object.defineProperty(lt,"version",{enumerable:!0,get:function(){return h.version}});var r=__w_pdfjs_require__(1),h=__w_pdfjs_require__(2),M=__w_pdfjs_require__(6),p=__w_pdfjs_require__(26),B=__w_pdfjs_require__(27),Q=__w_pdfjs_require__(5),U=__w_pdfjs_require__(29),O=__w_pdfjs_require__(14),I=__w_pdfjs_require__(32)})(),__webpack_exports__})())})(pdf$1);var pdfExports$1=pdf$1.exports,ZZ=Object.defineProperty,sZ=(lt,r,h)=>r in lt?ZZ(lt,r,{enumerable:!0,configurable:!0,writable:!0,value:h}):lt[r]=h,tt=(lt,r,h)=>(sZ(lt,typeof r!="symbol"?r+"":r,h),h),ft=(lt,r,h)=>{if(!r.has(lt))throw TypeError("Cannot "+h)},t=(lt,r,h)=>(ft(lt,r,"read from private field"),h?h.call(lt):r.get(lt)),E=(lt,r,h)=>{if(r.has(lt))throw TypeError("Cannot add the same private member more than once");r instanceof WeakSet?r.add(lt):r.set(lt,h)},Zl=(lt,r,h,M)=>(ft(lt,r,"write to private field"),M?M.call(lt,h):r.set(lt,h),h),mt=(lt,r,h,M)=>({set _(p){Zl(lt,r,p,h)},get _(){return t(lt,r,M)}}),A=(lt,r,h)=>(ft(lt,r,"access private method"),h),commonjsGlobal=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function getAugmentedNamespace(lt){if(lt.__esModule)return lt;var r=lt.default;if(typeof r=="function"){var h=function M(){return this instanceof M?Reflect.construct(r,arguments,this.constructor):r.apply(this,arguments)};h.prototype=r.prototype}else h={};return Object.defineProperty(h,"__esModule",{value:!0}),Object.keys(lt).forEach(function(M){var p=Object.getOwnPropertyDescriptor(lt,M);Object.defineProperty(h,M,p.get?p:{enumerable:!0,get:function(){return lt[M]}})}),h}function commonjsRequire(lt){throw new Error('Could not dynamically require "'+lt+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var pdf={exports:{}};const __viteBrowserExternal={},__viteBrowserExternal$1=Object.freeze(Object.defineProperty({__proto__:null,default:__viteBrowserExternal},Symbol.toStringTag,{value:"Module"})),require$$6=getAugmentedNamespace(__viteBrowserExternal$1);var path2dPolyfill_esm={},hasRequiredPath2dPolyfill_esm;function requirePath2dPolyfill_esm(){if(hasRequiredPath2dPolyfill_esm)return path2dPolyfill_esm;hasRequiredPath2dPolyfill_esm=1;function lt(S,k,T){if(T||arguments.length===2)for(var g=0,F=k.length,J;g<F;g++)(J||!(g in k))&&(J||(J=Array.prototype.slice.call(k,0,g)),J[g]=k[g]);return S.concat(J||Array.prototype.slice.call(k))}var r={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},h=/([astvzqmhlc])([^astvzqmhlc]*)/gi,M=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi;function p(S){var k=S.match(M);return k?k.map(Number):[]}function B(S){var k=[],T=String(S).trim();return T[0]!=="M"&&T[0]!=="m"||T.replace(h,function(g,F,J){var v=p(J),u=F.toLowerCase(),m=F;if(u==="m"&&v.length>2&&(k.push(lt([m],v.splice(0,2),!0)),u="l",m=m==="m"?"l":"L"),v.length<r[u])return"";for(k.push(lt([m],v.splice(0,r[u]),!0));v.length>=r[u]&&v.length&&r[u];)k.push(lt([m],v.splice(0,r[u]),!0));return""}),k}function Q(S,k){var T=S.x*Math.cos(k)-S.y*Math.sin(k),g=S.y*Math.cos(k)+S.x*Math.sin(k);S.x=T,S.y=g}function U(S,k,T){S.x+=k,S.y+=T}function O(S,k){S.x*=k,S.y*=k}var I=function(){function S(k){var T;this.commands=[],k&&k instanceof S?(T=this.commands).push.apply(T,k.commands):k&&(this.commands=B(k))}return S.prototype.addPath=function(k){var T;k&&k instanceof S&&(T=this.commands).push.apply(T,k.commands)},S.prototype.moveTo=function(k,T){this.commands.push(["M",k,T])},S.prototype.lineTo=function(k,T){this.commands.push(["L",k,T])},S.prototype.arc=function(k,T,g,F,J,v){this.commands.push(["AC",k,T,g,F,J,!!v])},S.prototype.arcTo=function(k,T,g,F,J){this.commands.push(["AT",k,T,g,F,J])},S.prototype.ellipse=function(k,T,g,F,J,v,u,m){this.commands.push(["E",k,T,g,F,J,v,u,!!m])},S.prototype.closePath=function(){this.commands.push(["Z"])},S.prototype.bezierCurveTo=function(k,T,g,F,J,v){this.commands.push(["C",k,T,g,F,J,v])},S.prototype.quadraticCurveTo=function(k,T,g,F){this.commands.push(["Q",k,T,g,F])},S.prototype.rect=function(k,T,g,F){this.commands.push(["R",k,T,g,F])},S.prototype.roundRect=function(k,T,g,F,J){typeof J>"u"?this.commands.push(["RR",k,T,g,F,0]):this.commands.push(["RR",k,T,g,F,J])},S}();function j(S,k){var T=0,g=0,F,J,v,u,m,_,$,P,Zt,dt,It,xt,it,Xt,zt,Gt,Nt,Ut,Vt,Ht,Pt,at=null,R=null,w=null,X=null,C=null,H=null;S.beginPath();for(var st=0;st<k.length;++st){Ut=k[st][0],Ut!=="S"&&Ut!=="s"&&Ut!=="C"&&Ut!=="c"&&(at=null,R=null),Ut!=="T"&&Ut!=="t"&&Ut!=="Q"&&Ut!=="q"&&(w=null,X=null);var et=void 0;switch(Ut){case"m":case"M":et=k[st],Ut==="m"?(T+=et[1],g+=et[2]):(T=et[1],g=et[2]),(Ut==="M"||!C)&&(C={x:T,y:g}),S.moveTo(T,g);break;case"l":et=k[st],T+=et[1],g+=et[2],S.lineTo(T,g);break;case"L":et=k[st],T=et[1],g=et[2],S.lineTo(T,g);break;case"H":et=k[st],T=et[1],S.lineTo(T,g);break;case"h":et=k[st],T+=et[1],S.lineTo(T,g);break;case"V":et=k[st],g=et[1],S.lineTo(T,g);break;case"v":et=k[st],g+=et[1],S.lineTo(T,g);break;case"a":case"A":if(et=k[st],H===null)throw new Error("This should never happen");Ut==="a"?(T+=et[6],g+=et[7]):(T=et[6],g=et[7]),Xt=et[1],zt=et[2],$=et[3]*Math.PI/180,v=!!et[4],u=!!et[5],m={x:T,y:g},_={x:(H.x-m.x)/2,y:(H.y-m.y)/2},Q(_,-$),P=_.x*_.x/(Xt*Xt)+_.y*_.y/(zt*zt),P>1&&(P=Math.sqrt(P),Xt*=P,zt*=P),Vt={x:Xt*_.y/zt,y:-(zt*_.x)/Xt},Zt=Xt*Xt*zt*zt,dt=Xt*Xt*_.y*_.y+zt*zt*_.x*_.x,u!==v?O(Vt,Math.sqrt((Zt-dt)/dt)||0):O(Vt,-Math.sqrt((Zt-dt)/dt)||0),J=Math.atan2((_.y-Vt.y)/zt,(_.x-Vt.x)/Xt),F=Math.atan2(-(_.y+Vt.y)/zt,-(_.x+Vt.x)/Xt),Q(Vt,$),U(Vt,(m.x+H.x)/2,(m.y+H.y)/2),S.save(),S.translate(Vt.x,Vt.y),S.rotate($),S.scale(Xt,zt),S.arc(0,0,1,J,F,!u),S.restore();break;case"C":et=k[st],at=et[3],R=et[4],T=et[5],g=et[6],S.bezierCurveTo(et[1],et[2],at,R,T,g);break;case"c":et=k[st],S.bezierCurveTo(et[1]+T,et[2]+g,et[3]+T,et[4]+g,et[5]+T,et[6]+g),at=et[3]+T,R=et[4]+g,T+=et[5],g+=et[6];break;case"S":et=k[st],(at===null||R===null)&&(at=T,R=g),S.bezierCurveTo(2*T-at,2*g-R,et[1],et[2],et[3],et[4]),at=et[1],R=et[2],T=et[3],g=et[4];break;case"s":et=k[st],(at===null||R===null)&&(at=T,R=g),S.bezierCurveTo(2*T-at,2*g-R,et[1]+T,et[2]+g,et[3]+T,et[4]+g),at=et[1]+T,R=et[2]+g,T+=et[3],g+=et[4];break;case"Q":et=k[st],w=et[1],X=et[2],T=et[3],g=et[4],S.quadraticCurveTo(w,X,T,g);break;case"q":et=k[st],w=et[1]+T,X=et[2]+g,T+=et[3],g+=et[4],S.quadraticCurveTo(w,X,T,g);break;case"T":et=k[st],(w===null||X===null)&&(w=T,X=g),w=2*T-w,X=2*g-X,T=et[1],g=et[2],S.quadraticCurveTo(w,X,T,g);break;case"t":et=k[st],(w===null||X===null)&&(w=T,X=g),w=2*T-w,X=2*g-X,T+=et[1],g+=et[2],S.quadraticCurveTo(w,X,T,g);break;case"z":case"Z":C&&(T=C.x,g=C.y),C=null,S.closePath();break;case"AC":et=k[st],T=et[1],g=et[2],it=et[3],J=et[4],F=et[5],Ht=et[6],S.arc(T,g,it,J,F,Ht);break;case"AT":et=k[st],It=et[1],xt=et[2],T=et[3],g=et[4],it=et[5],S.arcTo(It,xt,T,g,it);break;case"E":et=k[st],T=et[1],g=et[2],Xt=et[3],zt=et[4],$=et[5],J=et[6],F=et[7],Ht=et[8],S.save(),S.translate(T,g),S.rotate($),S.scale(Xt,zt),S.arc(0,0,1,J,F,Ht),S.restore();break;case"R":et=k[st],T=et[1],g=et[2],Gt=et[3],Nt=et[4],C={x:T,y:g},S.rect(T,g,Gt,Nt);break;case"RR":et=k[st],T=et[1],g=et[2],Gt=et[3],Nt=et[4],Pt=et[5],C={x:T,y:g},S.roundRect(T,g,Gt,Nt,Pt);break}H?(H.x=T,H.y=g):H={x:T,y:g}}}function q(S){if(!(!S||!S.CanvasRenderingContext2D||S.Path2D)){var k=S.CanvasRenderingContext2D,T=k.prototype.fill,g=k.prototype.stroke,F=k.prototype.isPointInPath;k.prototype.fill=function(){for(var J=[],v=0;v<arguments.length;v++)J[v]=arguments[v];if(J[0]instanceof I){var u=J[0],m=J[1]||"nonzero";j(this,u.commands),T.apply(this,[m])}else{var m=J[0]||"nonzero";return T.apply(this,[m])}},k.prototype.stroke=function(J){J&&j(this,J.commands),g.apply(this)},k.prototype.isPointInPath=function(){for(var J=[],v=0;v<arguments.length;v++)J[v]=arguments[v];if(J[0]instanceof I){var u=J[0],m=J[1],_=J[2],$=J[3]||"nonzero";return j(this,u.commands),F.apply(this,[m,_,$])}else return F.apply(this,J)},S.Path2D=I}}function K(S,k,T,g,F){var J=this;if(F===void 0&&(F=0),typeof F=="number"&&(F=[F]),Array.isArray(F)){if(F.length===0||F.length>4)throw new RangeError("Failed to execute 'roundRect' on '".concat(this.constructor.name,"': ").concat(F.length," radii provided. Between one and four radii are necessary."));F.forEach(function(P){if(P<0)throw new RangeError("Failed to execute 'roundRect' on '".concat(J.constructor.name,"': Radius value ").concat(P," is negative."))})}else return;if(F.length===1&&F[0]===0)return this.rect(S,k,T,g);var v=Math.min(T,g)/2,u,m,_,$=u=m=_=Math.min(v,F[0]);F.length===2&&(u=_=Math.min(v,F[1])),F.length===3&&(u=_=Math.min(v,F[1]),m=Math.min(v,F[2])),F.length===4&&(u=Math.min(v,F[1]),m=Math.min(v,F[2]),_=Math.min(v,F[3])),this.moveTo(S,k+g-_),this.arcTo(S,k,S+$,k,$),this.arcTo(S+T,k,S+T,k+u,u),this.arcTo(S+T,k+g,S+T-m,k+g,m),this.arcTo(S,k+g,S,k+g-_,_),this.moveTo(S,k)}function f(S){if(!(!S||!S.CanvasRenderingContext2D)){var k=S.CanvasRenderingContext2D,T=S.Path2D;k&&!k.prototype.roundRect&&(k.prototype.roundRect=K),T&&!T.prototype.roundRect&&(T.prototype.roundRect=K)}}return q(window),f(window),path2dPolyfill_esm}(function(module,exports){(function(lt,r){module.exports=lt.pdfjsLib=r()})(globalThis,()=>(()=>{var __webpack_modules__=[,(lt,r,h)=>{var M;Object.defineProperty(r,"__esModule",{value:!0}),r.VerbosityLevel=r.Util=r.UnknownErrorException=r.UnexpectedResponseException=r.TextRenderingMode=r.RenderingIntentFlag=r.PromiseCapability=r.PermissionFlag=r.PasswordResponses=r.PasswordException=r.PageActionEventType=r.OPS=r.MissingPDFException=r.MAX_IMAGE_SIZE_TO_CACHE=r.LINE_FACTOR=r.LINE_DESCENT_FACTOR=r.InvalidPDFException=r.ImageKind=r.IDENTITY_MATRIX=r.FormatError=r.FeatureTest=r.FONT_IDENTITY_MATRIX=r.DocumentActionEventType=r.CMapCompressionType=r.BaseException=r.BASELINE_FACTOR=r.AnnotationType=r.AnnotationReplyType=r.AnnotationPrefix=r.AnnotationMode=r.AnnotationFlag=r.AnnotationFieldFlag=r.AnnotationEditorType=r.AnnotationEditorPrefix=r.AnnotationEditorParamsType=r.AnnotationBorderStyleType=r.AnnotationActionEventType=r.AbortException=void 0,r.assert=Ht,r.bytesToString=gt,r.createValidAbsoluteUrl=at,r.getModificationDate=Yl,r.getUuid=Vl,r.getVerbosityLevel=Gt,r.info=Nt,r.isArrayBuffer=dl,r.isArrayEqual=rl,r.isNodeJS=void 0,r.normalizeUnicode=yl,r.objectFromMap=vt,r.objectSize=qt,r.setVerbosityLevel=zt,r.shadow=R,r.string32=Dt,r.stringToBytes=Jt,r.stringToPDFString=pt,r.stringToUTF8String=Ct,r.unreachable=Vt,r.utf8StringToString=$t,r.warn=Ut,h(2),h(84),h(86),h(87),h(89),h(93),h(101),h(102),h(105),h(107),h(109),h(113),h(116),h(123);const p=typeof process=="object"&&process+""=="[object process]"&&!process.versions.nw&&!(process.versions.electron&&process.type&&process.type!=="browser");r.isNodeJS=p;const B=[1,0,0,1,0,0];r.IDENTITY_MATRIX=B;const Q=[.001,0,0,.001,0,0];r.FONT_IDENTITY_MATRIX=Q;const U=1e7;r.MAX_IMAGE_SIZE_TO_CACHE=U;const O=1.35;r.LINE_FACTOR=O;const I=.35;r.LINE_DESCENT_FACTOR=I;const j=I/O;r.BASELINE_FACTOR=j;const q={ANY:1,DISPLAY:2,PRINT:4,SAVE:8,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,OPLIST:256};r.RenderingIntentFlag=q;const K={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3};r.AnnotationMode=K;const f="pdfjs_internal_editor_";r.AnnotationEditorPrefix=f;const S={DISABLE:-1,NONE:0,FREETEXT:3,STAMP:13,INK:15};r.AnnotationEditorType=S;const k={RESIZE:1,CREATE:2,FREETEXT_SIZE:11,FREETEXT_COLOR:12,FREETEXT_OPACITY:13,INK_COLOR:21,INK_THICKNESS:22,INK_OPACITY:23};r.AnnotationEditorParamsType=k;const T={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048};r.PermissionFlag=T;const g={FILL:0,STROKE:1,FILL_STROKE:2,INVISIBLE:3,FILL_ADD_TO_PATH:4,STROKE_ADD_TO_PATH:5,FILL_STROKE_ADD_TO_PATH:6,ADD_TO_PATH:7,FILL_STROKE_MASK:3,ADD_TO_PATH_FLAG:4};r.TextRenderingMode=g;const F={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3};r.ImageKind=F;const J={TEXT:1,LINK:2,FREETEXT:3,LINE:4,SQUARE:5,CIRCLE:6,POLYGON:7,POLYLINE:8,HIGHLIGHT:9,UNDERLINE:10,SQUIGGLY:11,STRIKEOUT:12,STAMP:13,CARET:14,INK:15,POPUP:16,FILEATTACHMENT:17,SOUND:18,MOVIE:19,WIDGET:20,SCREEN:21,PRINTERMARK:22,TRAPNET:23,WATERMARK:24,THREED:25,REDACT:26};r.AnnotationType=J;const v={GROUP:"Group",REPLY:"R"};r.AnnotationReplyType=v;const u={INVISIBLE:1,HIDDEN:2,PRINT:4,NOZOOM:8,NOROTATE:16,NOVIEW:32,READONLY:64,LOCKED:128,TOGGLENOVIEW:256,LOCKEDCONTENTS:512};r.AnnotationFlag=u;const m={READONLY:1,REQUIRED:2,NOEXPORT:4,MULTILINE:4096,PASSWORD:8192,NOTOGGLETOOFF:16384,RADIO:32768,PUSHBUTTON:65536,COMBO:131072,EDIT:262144,SORT:524288,FILESELECT:1048576,MULTISELECT:2097152,DONOTSPELLCHECK:4194304,DONOTSCROLL:8388608,COMB:16777216,RICHTEXT:33554432,RADIOSINUNISON:33554432,COMMITONSELCHANGE:67108864};r.AnnotationFieldFlag=m;const _={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5};r.AnnotationBorderStyleType=_;const $={E:"Mouse Enter",X:"Mouse Exit",D:"Mouse Down",U:"Mouse Up",Fo:"Focus",Bl:"Blur",PO:"PageOpen",PC:"PageClose",PV:"PageVisible",PI:"PageInvisible",K:"Keystroke",F:"Format",V:"Validate",C:"Calculate"};r.AnnotationActionEventType=$;const P={WC:"WillClose",WS:"WillSave",DS:"DidSave",WP:"WillPrint",DP:"DidPrint"};r.DocumentActionEventType=P;const Zt={O:"PageOpen",C:"PageClose"};r.PageActionEventType=Zt;const dt={ERRORS:0,WARNINGS:1,INFOS:5};r.VerbosityLevel=dt;const It={NONE:0,BINARY:1};r.CMapCompressionType=It;const xt={dependency:1,setLineWidth:2,setLineCap:3,setLineJoin:4,setMiterLimit:5,setDash:6,setRenderingIntent:7,setFlatness:8,setGState:9,save:10,restore:11,transform:12,moveTo:13,lineTo:14,curveTo:15,curveTo2:16,curveTo3:17,closePath:18,rectangle:19,stroke:20,closeStroke:21,fill:22,eoFill:23,fillStroke:24,eoFillStroke:25,closeFillStroke:26,closeEOFillStroke:27,endPath:28,clip:29,eoClip:30,beginText:31,endText:32,setCharSpacing:33,setWordSpacing:34,setHScale:35,setLeading:36,setFont:37,setTextRenderingMode:38,setTextRise:39,moveText:40,setLeadingMoveText:41,setTextMatrix:42,nextLine:43,showText:44,showSpacedText:45,nextLineShowText:46,nextLineSetSpacingShowText:47,setCharWidth:48,setCharWidthAndBounds:49,setStrokeColorSpace:50,setFillColorSpace:51,setStrokeColor:52,setStrokeColorN:53,setFillColor:54,setFillColorN:55,setStrokeGray:56,setFillGray:57,setStrokeRGBColor:58,setFillRGBColor:59,setStrokeCMYKColor:60,setFillCMYKColor:61,shadingFill:62,beginInlineImage:63,beginImageData:64,endInlineImage:65,paintXObject:66,markPoint:67,markPointProps:68,beginMarkedContent:69,beginMarkedContentProps:70,endMarkedContent:71,beginCompat:72,endCompat:73,paintFormXObjectBegin:74,paintFormXObjectEnd:75,beginGroup:76,endGroup:77,beginAnnotation:80,endAnnotation:81,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,paintSolidColorImageMask:90,constructPath:91};r.OPS=xt;const it={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};r.PasswordResponses=it;let Xt=dt.WARNINGS;function zt(ot){Number.isInteger(ot)&&(Xt=ot)}function Gt(){return Xt}function Nt(ot){Xt>=dt.INFOS&&console.log(`Info: ${ot}`)}function Ut(ot){Xt>=dt.WARNINGS&&console.log(`Warning: ${ot}`)}function Vt(ot){throw new Error(ot)}function Ht(ot,ut){ot||Vt(ut)}function Pt(ot){switch(ot==null?void 0:ot.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}function at(ot){let ut=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,Tt=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;if(!ot)return null;try{if(Tt&&typeof ot=="string"){if(Tt.addDefaultProtocol&&ot.startsWith("www.")){const Ot=ot.match(/\./g);(Ot==null?void 0:Ot.length)>=2&&(ot=`http://${ot}`)}if(Tt.tryConvertEncoding)try{ot=Ct(ot)}catch{}}const jt=ut?new URL(ot,ut):new URL(ot);if(Pt(jt))return jt}catch{}return null}function R(ot,ut,Tt){let jt=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;return Object.defineProperty(ot,ut,{value:Tt,enumerable:!jt,configurable:!0,writable:!1}),Tt}const w=function(){function ot(ut,Tt){this.constructor===ot&&Vt("Cannot initialize BaseException."),this.message=ut,this.name=Tt}return ot.prototype=new Error,ot.constructor=ot,ot}();r.BaseException=w;class X extends w{constructor(ut,Tt){super(ut,"PasswordException"),this.code=Tt}}r.PasswordException=X;class C extends w{constructor(ut,Tt){super(ut,"UnknownErrorException"),this.details=Tt}}r.UnknownErrorException=C;class H extends w{constructor(ut){super(ut,"InvalidPDFException")}}r.InvalidPDFException=H;class st extends w{constructor(ut){super(ut,"MissingPDFException")}}r.MissingPDFException=st;class et extends w{constructor(ut,Tt){super(ut,"UnexpectedResponseException"),this.status=Tt}}r.UnexpectedResponseException=et;class Mt extends w{constructor(ut){super(ut,"FormatError")}}r.FormatError=Mt;class Rt extends w{constructor(ut){super(ut,"AbortException")}}r.AbortException=Rt;function gt(ot){(typeof ot!="object"||(ot==null?void 0:ot.length)===void 0)&&Vt("Invalid argument for bytesToString");const ut=ot.length,Tt=8192;if(ut<Tt)return String.fromCharCode.apply(null,ot);const jt=[];for(let Ot=0;Ot<ut;Ot+=Tt){const Lt=Math.min(Ot+Tt,ut),yt=ot.subarray(Ot,Lt);jt.push(String.fromCharCode.apply(null,yt))}return jt.join("")}function Jt(ot){typeof ot!="string"&&Vt("Invalid argument for stringToBytes");const ut=ot.length,Tt=new Uint8Array(ut);for(let jt=0;jt<ut;++jt)Tt[jt]=ot.charCodeAt(jt)&255;return Tt}function Dt(ot){return String.fromCharCode(ot>>24&255,ot>>16&255,ot>>8&255,ot&255)}function qt(ot){return Object.keys(ot).length}function vt(ot){const ut=Object.create(null);for(const[Tt,jt]of ot)ut[Tt]=jt;return ut}function cl(){const ot=new Uint8Array(4);return ot[0]=1,new Uint32Array(ot.buffer,0,1)[0]===1}function bl(){try{return new Function(""),!0}catch{return!1}}class il{static get isLittleEndian(){return R(this,"isLittleEndian",cl())}static get isEvalSupported(){return R(this,"isEvalSupported",bl())}static get isOffscreenCanvasSupported(){return R(this,"isOffscreenCanvasSupported",typeof OffscreenCanvas<"u")}static get platform(){return typeof navigator>"u"?R(this,"platform",{isWin:!1,isMac:!1}):R(this,"platform",{isWin:navigator.platform.includes("Win"),isMac:navigator.platform.includes("Mac")})}static get isCSSRoundSupported(){var ut,Tt;return R(this,"isCSSRoundSupported",(Tt=(ut=globalThis.CSS)==null?void 0:ut.supports)==null?void 0:Tt.call(ut,"width: round(1.5px, 1px)"))}}r.FeatureTest=il;const Bt=[...Array(256).keys()].map(ot=>ot.toString(16).padStart(2,"0"));class Ft{static makeHexColor(ut,Tt,jt){return`#${Bt[ut]}${Bt[Tt]}${Bt[jt]}`}static scaleMinMax(ut,Tt){let jt;ut[0]?(ut[0]<0&&(jt=Tt[0],Tt[0]=Tt[1],Tt[1]=jt),Tt[0]*=ut[0],Tt[1]*=ut[0],ut[3]<0&&(jt=Tt[2],Tt[2]=Tt[3],Tt[3]=jt),Tt[2]*=ut[3],Tt[3]*=ut[3]):(jt=Tt[0],Tt[0]=Tt[2],Tt[2]=jt,jt=Tt[1],Tt[1]=Tt[3],Tt[3]=jt,ut[1]<0&&(jt=Tt[2],Tt[2]=Tt[3],Tt[3]=jt),Tt[2]*=ut[1],Tt[3]*=ut[1],ut[2]<0&&(jt=Tt[0],Tt[0]=Tt[1],Tt[1]=jt),Tt[0]*=ut[2],Tt[1]*=ut[2]),Tt[0]+=ut[4],Tt[1]+=ut[4],Tt[2]+=ut[5],Tt[3]+=ut[5]}static transform(ut,Tt){return[ut[0]*Tt[0]+ut[2]*Tt[1],ut[1]*Tt[0]+ut[3]*Tt[1],ut[0]*Tt[2]+ut[2]*Tt[3],ut[1]*Tt[2]+ut[3]*Tt[3],ut[0]*Tt[4]+ut[2]*Tt[5]+ut[4],ut[1]*Tt[4]+ut[3]*Tt[5]+ut[5]]}static applyTransform(ut,Tt){const jt=ut[0]*Tt[0]+ut[1]*Tt[2]+Tt[4],Ot=ut[0]*Tt[1]+ut[1]*Tt[3]+Tt[5];return[jt,Ot]}static applyInverseTransform(ut,Tt){const jt=Tt[0]*Tt[3]-Tt[1]*Tt[2],Ot=(ut[0]*Tt[3]-ut[1]*Tt[2]+Tt[2]*Tt[5]-Tt[4]*Tt[3])/jt,Lt=(-ut[0]*Tt[1]+ut[1]*Tt[0]+Tt[4]*Tt[1]-Tt[5]*Tt[0])/jt;return[Ot,Lt]}static getAxialAlignedBoundingBox(ut,Tt){const jt=this.applyTransform(ut,Tt),Ot=this.applyTransform(ut.slice(2,4),Tt),Lt=this.applyTransform([ut[0],ut[3]],Tt),yt=this.applyTransform([ut[2],ut[1]],Tt);return[Math.min(jt[0],Ot[0],Lt[0],yt[0]),Math.min(jt[1],Ot[1],Lt[1],yt[1]),Math.max(jt[0],Ot[0],Lt[0],yt[0]),Math.max(jt[1],Ot[1],Lt[1],yt[1])]}static inverseTransform(ut){const Tt=ut[0]*ut[3]-ut[1]*ut[2];return[ut[3]/Tt,-ut[1]/Tt,-ut[2]/Tt,ut[0]/Tt,(ut[2]*ut[5]-ut[4]*ut[3])/Tt,(ut[4]*ut[1]-ut[5]*ut[0])/Tt]}static singularValueDecompose2dScale(ut){const Tt=[ut[0],ut[2],ut[1],ut[3]],jt=ut[0]*Tt[0]+ut[1]*Tt[2],Ot=ut[0]*Tt[1]+ut[1]*Tt[3],Lt=ut[2]*Tt[0]+ut[3]*Tt[2],yt=ut[2]*Tt[1]+ut[3]*Tt[3],Kt=(jt+yt)/2,tl=Math.sqrt((jt+yt)**2-4*(jt*yt-Lt*Ot))/2,el=Kt+tl||1,ol=Kt-tl||1;return[Math.sqrt(el),Math.sqrt(ol)]}static normalizeRect(ut){const Tt=ut.slice(0);return ut[0]>ut[2]&&(Tt[0]=ut[2],Tt[2]=ut[0]),ut[1]>ut[3]&&(Tt[1]=ut[3],Tt[3]=ut[1]),Tt}static intersect(ut,Tt){const jt=Math.max(Math.min(ut[0],ut[2]),Math.min(Tt[0],Tt[2])),Ot=Math.min(Math.max(ut[0],ut[2]),Math.max(Tt[0],Tt[2]));if(jt>Ot)return null;const Lt=Math.max(Math.min(ut[1],ut[3]),Math.min(Tt[1],Tt[3])),yt=Math.min(Math.max(ut[1],ut[3]),Math.max(Tt[1],Tt[3]));return Lt>yt?null:[jt,Lt,Ot,yt]}static bezierBoundingBox(ut,Tt,jt,Ot,Lt,yt,Kt,tl){const el=[],ol=[[],[]];let Qt,Ml,hl,Il,Wl,nt,L,ct;for(let Et=0;Et<2;++Et){if(Et===0?(Ml=6*ut-12*jt+6*Lt,Qt=-3*ut+9*jt-9*Lt+3*Kt,hl=3*jt-3*ut):(Ml=6*Tt-12*Ot+6*yt,Qt=-3*Tt+9*Ot-9*yt+3*tl,hl=3*Ot-3*Tt),Math.abs(Qt)<1e-12){if(Math.abs(Ml)<1e-12)continue;Il=-hl/Ml,0<Il&&Il<1&&el.push(Il);continue}L=Ml*Ml-4*hl*Qt,ct=Math.sqrt(L),!(L<0)&&(Wl=(-Ml+ct)/(2*Qt),0<Wl&&Wl<1&&el.push(Wl),nt=(-Ml-ct)/(2*Qt),0<nt&&nt<1&&el.push(nt))}let Wt=el.length,Yt;const kt=Wt;for(;Wt--;)Il=el[Wt],Yt=1-Il,ol[0][Wt]=Yt*Yt*Yt*ut+3*Yt*Yt*Il*jt+3*Yt*Il*Il*Lt+Il*Il*Il*Kt,ol[1][Wt]=Yt*Yt*Yt*Tt+3*Yt*Yt*Il*Ot+3*Yt*Il*Il*yt+Il*Il*Il*tl;return ol[0][kt]=ut,ol[1][kt]=Tt,ol[0][kt+1]=Kt,ol[1][kt+1]=tl,ol[0].length=ol[1].length=kt+2,[Math.min(...ol[0]),Math.min(...ol[1]),Math.max(...ol[0]),Math.max(...ol[1])]}}r.Util=Ft;const wt=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,728,711,710,729,733,731,730,732,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8226,8224,8225,8230,8212,8211,402,8260,8249,8250,8722,8240,8222,8220,8221,8216,8217,8218,8482,64257,64258,321,338,352,376,381,305,322,339,353,382,0,8364];function pt(ot){if(ot[0]>="ï"){let Tt;if(ot[0]==="þ"&&ot[1]==="ÿ"?Tt="utf-16be":ot[0]==="ÿ"&&ot[1]==="þ"?Tt="utf-16le":ot[0]==="ï"&&ot[1]==="»"&&ot[2]==="¿"&&(Tt="utf-8"),Tt)try{const jt=new TextDecoder(Tt,{fatal:!0}),Ot=Jt(ot);return jt.decode(Ot)}catch(jt){Ut(`stringToPDFString: "${jt}".`)}}const ut=[];for(let Tt=0,jt=ot.length;Tt<jt;Tt++){const Ot=wt[ot.charCodeAt(Tt)];ut.push(Ot?String.fromCharCode(Ot):ot.charAt(Tt))}return ut.join("")}function Ct(ot){return decodeURIComponent(escape(ot))}function $t(ot){return unescape(encodeURIComponent(ot))}function dl(ot){return typeof ot=="object"&&(ot==null?void 0:ot.byteLength)!==void 0}function rl(ot,ut){if(ot.length!==ut.length)return!1;for(let Tt=0,jt=ot.length;Tt<jt;Tt++)if(ot[Tt]!==ut[Tt])return!1;return!0}function Yl(){let ot=arguments.length>0&&arguments[0]!==void 0?arguments[0]:new Date;return[ot.getUTCFullYear().toString(),(ot.getUTCMonth()+1).toString().padStart(2,"0"),ot.getUTCDate().toString().padStart(2,"0"),ot.getUTCHours().toString().padStart(2,"0"),ot.getUTCMinutes().toString().padStart(2,"0"),ot.getUTCSeconds().toString().padStart(2,"0")].join("")}class Xl{constructor(){E(this,M,!1),this.promise=new Promise((ut,Tt)=>{this.resolve=jt=>{Zl(this,M,!0),ut(jt)},this.reject=jt=>{Zl(this,M,!0),Tt(jt)}})}get settled(){return t(this,M)}}M=new WeakMap,r.PromiseCapability=Xl;let pl=null,Ll=null;function yl(ot){return pl||(pl=/([\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,Ll=new Map([["ſt","ſt"]])),ot.replaceAll(pl,(ut,Tt,jt)=>Tt?Tt.normalize("NFKC"):Ll.get(jt))}function Vl(){if(typeof crypto<"u"&&typeof(crypto==null?void 0:crypto.randomUUID)=="function")return crypto.randomUUID();const ot=new Uint8Array(32);if(typeof crypto<"u"&&typeof(crypto==null?void 0:crypto.getRandomValues)=="function")crypto.getRandomValues(ot);else for(let ut=0;ut<32;ut++)ot[ut]=Math.floor(Math.random()*255);return gt(ot)}const _t="pdfjs_internal_id_";r.AnnotationPrefix=_t},(lt,r,h)=>{var M=h(3),p=h(4),B=h(69),Q=h(70),U="WebAssembly",O=p[U],I=Error("e",{cause:7}).cause!==7,j=function(K,f){var S={};S[K]=Q(K,f,I),M({global:!0,constructor:!0,arity:1,forced:I},S)},q=function(K,f){if(O&&O[K]){var S={};S[K]=Q(U+"."+K,f,I),M({target:U,stat:!0,constructor:!0,arity:1,forced:I},S)}};j("Error",function(K){return function(f){return B(K,this,arguments)}}),j("EvalError",function(K){return function(f){return B(K,this,arguments)}}),j("RangeError",function(K){return function(f){return B(K,this,arguments)}}),j("ReferenceError",function(K){return function(f){return B(K,this,arguments)}}),j("SyntaxError",function(K){return function(f){return B(K,this,arguments)}}),j("TypeError",function(K){return function(f){return B(K,this,arguments)}}),j("URIError",function(K){return function(f){return B(K,this,arguments)}}),q("CompileError",function(K){return function(f){return B(K,this,arguments)}}),q("LinkError",function(K){return function(f){return B(K,this,arguments)}}),q("RuntimeError",function(K){return function(f){return B(K,this,arguments)}})},(lt,r,h)=>{var M=h(4),p=h(5).f,B=h(44),Q=h(48),U=h(38),O=h(56),I=h(68);lt.exports=function(j,q){var K=j.target,f=j.global,S=j.stat,k,T,g,F,J,v;if(f?T=M:S?T=M[K]||U(K,{}):T=(M[K]||{}).prototype,T)for(g in q){if(J=q[g],j.dontCallGetSet?(v=p(T,g),F=v&&v.value):F=T[g],k=I(f?g:K+(S?".":"#")+g,j.forced),!k&&F!==void 0){if(typeof J==typeof F)continue;O(J,F)}(j.sham||F&&F.sham)&&B(J,"sham",!0),Q(T,g,J,j)}}},function(lt){var r=function(h){return h&&h.Math===Math&&h};lt.exports=r(typeof globalThis=="object"&&globalThis)||r(typeof window=="object"&&window)||r(typeof self=="object"&&self)||r(typeof commonjsGlobal=="object"&&commonjsGlobal)||function(){return this}()||this||Function("return this")()},(lt,r,h)=>{var M=h(6),p=h(8),B=h(10),Q=h(11),U=h(12),O=h(18),I=h(39),j=h(42),q=Object.getOwnPropertyDescriptor;r.f=M?q:function(K,f){if(K=U(K),f=O(f),j)try{return q(K,f)}catch{}if(I(K,f))return Q(!p(B.f,K,f),K[f])}},(lt,r,h)=>{var M=h(7);lt.exports=!M(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7})},lt=>{lt.exports=function(r){try{return!!r()}catch{return!0}}},(lt,r,h)=>{var M=h(9),p=Function.prototype.call;lt.exports=M?p.bind(p):function(){return p.apply(p,arguments)}},(lt,r,h)=>{var M=h(7);lt.exports=!M(function(){var p=(function(){}).bind();return typeof p!="function"||p.hasOwnProperty("prototype")})},(lt,r)=>{var h={}.propertyIsEnumerable,M=Object.getOwnPropertyDescriptor,p=M&&!h.call({1:2},1);r.f=p?function(B){var Q=M(this,B);return!!Q&&Q.enumerable}:h},lt=>{lt.exports=function(r,h){return{enumerable:!(r&1),configurable:!(r&2),writable:!(r&4),value:h}}},(lt,r,h)=>{var M=h(13),p=h(16);lt.exports=function(B){return M(p(B))}},(lt,r,h)=>{var M=h(14),p=h(7),B=h(15),Q=Object,U=M("".split);lt.exports=p(function(){return!Q("z").propertyIsEnumerable(0)})?function(O){return B(O)==="String"?U(O,""):Q(O)}:Q},(lt,r,h)=>{var M=h(9),p=Function.prototype,B=p.call,Q=M&&p.bind.bind(B,B);lt.exports=M?Q:function(U){return function(){return B.apply(U,arguments)}}},(lt,r,h)=>{var M=h(14),p=M({}.toString),B=M("".slice);lt.exports=function(Q){return B(p(Q),8,-1)}},(lt,r,h)=>{var M=h(17),p=TypeError;lt.exports=function(B){if(M(B))throw p("Can't call method on "+B);return B}},lt=>{lt.exports=function(r){return r==null}},(lt,r,h)=>{var M=h(19),p=h(23);lt.exports=function(B){var Q=M(B,"string");return p(Q)?Q:Q+""}},(lt,r,h)=>{var M=h(8),p=h(20),B=h(23),Q=h(30),U=h(33),O=h(34),I=TypeError,j=O("toPrimitive");lt.exports=function(q,K){if(!p(q)||B(q))return q;var f=Q(q,j),S;if(f){if(K===void 0&&(K="default"),S=M(f,q,K),!p(S)||B(S))return S;throw I("Can't convert object to primitive value")}return K===void 0&&(K="number"),U(q,K)}},(lt,r,h)=>{var M=h(21),p=h(22),B=p.all;lt.exports=p.IS_HTMLDDA?function(Q){return typeof Q=="object"?Q!==null:M(Q)||Q===B}:function(Q){return typeof Q=="object"?Q!==null:M(Q)}},(lt,r,h)=>{var M=h(22),p=M.all;lt.exports=M.IS_HTMLDDA?function(B){return typeof B=="function"||B===p}:function(B){return typeof B=="function"}},lt=>{var r=typeof document=="object"&&document.all,h=typeof r>"u"&&r!==void 0;lt.exports={all:r,IS_HTMLDDA:h}},(lt,r,h)=>{var M=h(24),p=h(21),B=h(25),Q=h(26),U=Object;lt.exports=Q?function(O){return typeof O=="symbol"}:function(O){var I=M("Symbol");return p(I)&&B(I.prototype,U(O))}},(lt,r,h)=>{var M=h(4),p=h(21),B=function(Q){return p(Q)?Q:void 0};lt.exports=function(Q,U){return arguments.length<2?B(M[Q]):M[Q]&&M[Q][U]}},(lt,r,h)=>{var M=h(14);lt.exports=M({}.isPrototypeOf)},(lt,r,h)=>{var M=h(27);lt.exports=M&&!Symbol.sham&&typeof Symbol.iterator=="symbol"},(lt,r,h)=>{var M=h(28),p=h(7),B=h(4),Q=B.String;lt.exports=!!Object.getOwnPropertySymbols&&!p(function(){var U=Symbol("symbol detection");return!Q(U)||!(Object(U)instanceof Symbol)||!Symbol.sham&&M&&M<41})},(lt,r,h)=>{var M=h(4),p=h(29),B=M.process,Q=M.Deno,U=B&&B.versions||Q&&Q.version,O=U&&U.v8,I,j;O&&(I=O.split("."),j=I[0]>0&&I[0]<4?1:+(I[0]+I[1])),!j&&p&&(I=p.match(/Edge\/(\d+)/),(!I||I[1]>=74)&&(I=p.match(/Chrome\/(\d+)/),I&&(j=+I[1]))),lt.exports=j},lt=>{lt.exports=typeof navigator<"u"&&String(navigator.userAgent)||""},(lt,r,h)=>{var M=h(31),p=h(17);lt.exports=function(B,Q){var U=B[Q];return p(U)?void 0:M(U)}},(lt,r,h)=>{var M=h(21),p=h(32),B=TypeError;lt.exports=function(Q){if(M(Q))return Q;throw B(p(Q)+" is not a function")}},lt=>{var r=String;lt.exports=function(h){try{return r(h)}catch{return"Object"}}},(lt,r,h)=>{var M=h(8),p=h(21),B=h(20),Q=TypeError;lt.exports=function(U,O){var I,j;if(O==="string"&&p(I=U.toString)&&!B(j=M(I,U))||p(I=U.valueOf)&&!B(j=M(I,U))||O!=="string"&&p(I=U.toString)&&!B(j=M(I,U)))return j;throw Q("Can't convert object to primitive value")}},(lt,r,h)=>{var M=h(4),p=h(35),B=h(39),Q=h(41),U=h(27),O=h(26),I=M.Symbol,j=p("wks"),q=O?I.for||I:I&&I.withoutSetter||Q;lt.exports=function(K){return B(j,K)||(j[K]=U&&B(I,K)?I[K]:q("Symbol."+K)),j[K]}},(lt,r,h)=>{var M=h(36),p=h(37);(lt.exports=function(B,Q){return p[B]||(p[B]=Q!==void 0?Q:{})})("versions",[]).push({version:"3.32.2",mode:M?"pure":"global",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.32.2/LICENSE",source:"https://github.com/zloirock/core-js"})},lt=>{lt.exports=!1},(lt,r,h)=>{var M=h(4),p=h(38),B="__core-js_shared__",Q=M[B]||p(B,{});lt.exports=Q},(lt,r,h)=>{var M=h(4),p=Object.defineProperty;lt.exports=function(B,Q){try{p(M,B,{value:Q,configurable:!0,writable:!0})}catch{M[B]=Q}return Q}},(lt,r,h)=>{var M=h(14),p=h(40),B=M({}.hasOwnProperty);lt.exports=Object.hasOwn||function(Q,U){return B(p(Q),U)}},(lt,r,h)=>{var M=h(16),p=Object;lt.exports=function(B){return p(M(B))}},(lt,r,h)=>{var M=h(14),p=0,B=Math.random(),Q=M(1 .toString);lt.exports=function(U){return"Symbol("+(U===void 0?"":U)+")_"+Q(++p+B,36)}},(lt,r,h)=>{var M=h(6),p=h(7),B=h(43);lt.exports=!M&&!p(function(){return Object.defineProperty(B("div"),"a",{get:function(){return 7}}).a!==7})},(lt,r,h)=>{var M=h(4),p=h(20),B=M.document,Q=p(B)&&p(B.createElement);lt.exports=function(U){return Q?B.createElement(U):{}}},(lt,r,h)=>{var M=h(6),p=h(45),B=h(11);lt.exports=M?function(Q,U,O){return p.f(Q,U,B(1,O))}:function(Q,U,O){return Q[U]=O,Q}},(lt,r,h)=>{var M=h(6),p=h(42),B=h(46),Q=h(47),U=h(18),O=TypeError,I=Object.defineProperty,j=Object.getOwnPropertyDescriptor,q="enumerable",K="configurable",f="writable";r.f=M?B?function(S,k,T){if(Q(S),k=U(k),Q(T),typeof S=="function"&&k==="prototype"&&"value"in T&&f in T&&!T[f]){var g=j(S,k);g&&g[f]&&(S[k]=T.value,T={configurable:K in T?T[K]:g[K],enumerable:q in T?T[q]:g[q],writable:!1})}return I(S,k,T)}:I:function(S,k,T){if(Q(S),k=U(k),Q(T),p)try{return I(S,k,T)}catch{}if("get"in T||"set"in T)throw O("Accessors not supported");return"value"in T&&(S[k]=T.value),S}},(lt,r,h)=>{var M=h(6),p=h(7);lt.exports=M&&p(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42})},(lt,r,h)=>{var M=h(20),p=String,B=TypeError;lt.exports=function(Q){if(M(Q))return Q;throw B(p(Q)+" is not an object")}},(lt,r,h)=>{var M=h(21),p=h(45),B=h(49),Q=h(38);lt.exports=function(U,O,I,j){j||(j={});var q=j.enumerable,K=j.name!==void 0?j.name:O;if(M(I)&&B(I,K,j),j.global)q?U[O]=I:Q(O,I);else{try{j.unsafe?U[O]&&(q=!0):delete U[O]}catch{}q?U[O]=I:p.f(U,O,{value:I,enumerable:!1,configurable:!j.nonConfigurable,writable:!j.nonWritable})}return U}},(lt,r,h)=>{var M=h(14),p=h(7),B=h(21),Q=h(39),U=h(6),O=h(50).CONFIGURABLE,I=h(51),j=h(52),q=j.enforce,K=j.get,f=String,S=Object.defineProperty,k=M("".slice),T=M("".replace),g=M([].join),F=U&&!p(function(){return S(function(){},"length",{value:8}).length!==8}),J=String(String).split("String"),v=lt.exports=function(u,m,_){k(f(m),0,7)==="Symbol("&&(m="["+T(f(m),/^Symbol\(([^)]*)\)/,"$1")+"]"),_&&_.getter&&(m="get "+m),_&&_.setter&&(m="set "+m),(!Q(u,"name")||O&&u.name!==m)&&(U?S(u,"name",{value:m,configurable:!0}):u.name=m),F&&_&&Q(_,"arity")&&u.length!==_.arity&&S(u,"length",{value:_.arity});try{_&&Q(_,"constructor")&&_.constructor?U&&S(u,"prototype",{writable:!1}):u.prototype&&(u.prototype=void 0)}catch{}var $=q(u);return Q($,"source")||($.source=g(J,typeof m=="string"?m:"")),u};Function.prototype.toString=v(function(){return B(this)&&K(this).source||I(this)},"toString")},(lt,r,h)=>{var M=h(6),p=h(39),B=Function.prototype,Q=M&&Object.getOwnPropertyDescriptor,U=p(B,"name"),O=U&&(function(){}).name==="something",I=U&&(!M||M&&Q(B,"name").configurable);lt.exports={EXISTS:U,PROPER:O,CONFIGURABLE:I}},(lt,r,h)=>{var M=h(14),p=h(21),B=h(37),Q=M(Function.toString);p(B.inspectSource)||(B.inspectSource=function(U){return Q(U)}),lt.exports=B.inspectSource},(lt,r,h)=>{var M=h(53),p=h(4),B=h(20),Q=h(44),U=h(39),O=h(37),I=h(54),j=h(55),q="Object already initialized",K=p.TypeError,f=p.WeakMap,S,k,T,g=function(u){return T(u)?k(u):S(u,{})},F=function(u){return function(m){var _;if(!B(m)||(_=k(m)).type!==u)throw K("Incompatible receiver, "+u+" required");return _}};if(M||O.state){var J=O.state||(O.state=new f);J.get=J.get,J.has=J.has,J.set=J.set,S=function(u,m){if(J.has(u))throw K(q);return m.facade=u,J.set(u,m),m},k=function(u){return J.get(u)||{}},T=function(u){return J.has(u)}}else{var v=I("state");j[v]=!0,S=function(u,m){if(U(u,v))throw K(q);return m.facade=u,Q(u,v,m),m},k=function(u){return U(u,v)?u[v]:{}},T=function(u){return U(u,v)}}lt.exports={set:S,get:k,has:T,enforce:g,getterFor:F}},(lt,r,h)=>{var M=h(4),p=h(21),B=M.WeakMap;lt.exports=p(B)&&/native code/.test(String(B))},(lt,r,h)=>{var M=h(35),p=h(41),B=M("keys");lt.exports=function(Q){return B[Q]||(B[Q]=p(Q))}},lt=>{lt.exports={}},(lt,r,h)=>{var M=h(39),p=h(57),B=h(5),Q=h(45);lt.exports=function(U,O,I){for(var j=p(O),q=Q.f,K=B.f,f=0;f<j.length;f++){var S=j[f];!M(U,S)&&!(I&&M(I,S))&&q(U,S,K(O,S))}}},(lt,r,h)=>{var M=h(24),p=h(14),B=h(58),Q=h(67),U=h(47),O=p([].concat);lt.exports=M("Reflect","ownKeys")||function(I){var j=B.f(U(I)),q=Q.f;return q?O(j,q(I)):j}},(lt,r,h)=>{var M=h(59),p=h(66),B=p.concat("length","prototype");r.f=Object.getOwnPropertyNames||function(Q){return M(Q,B)}},(lt,r,h)=>{var M=h(14),p=h(39),B=h(12),Q=h(60).indexOf,U=h(55),O=M([].push);lt.exports=function(I,j){var q=B(I),K=0,f=[],S;for(S in q)!p(U,S)&&p(q,S)&&O(f,S);for(;j.length>K;)p(q,S=j[K++])&&(~Q(f,S)||O(f,S));return f}},(lt,r,h)=>{var M=h(12),p=h(61),B=h(64),Q=function(U){return function(O,I,j){var q=M(O),K=B(q),f=p(j,K),S;if(U&&I!==I){for(;K>f;)if(S=q[f++],S!==S)return!0}else for(;K>f;f++)if((U||f in q)&&q[f]===I)return U||f||0;return!U&&-1}};lt.exports={includes:Q(!0),indexOf:Q(!1)}},(lt,r,h)=>{var M=h(62),p=Math.max,B=Math.min;lt.exports=function(Q,U){var O=M(Q);return O<0?p(O+U,0):B(O,U)}},(lt,r,h)=>{var M=h(63);lt.exports=function(p){var B=+p;return B!==B||B===0?0:M(B)}},lt=>{var r=Math.ceil,h=Math.floor;lt.exports=Math.trunc||function(M){var p=+M;return(p>0?h:r)(p)}},(lt,r,h)=>{var M=h(65);lt.exports=function(p){return M(p.length)}},(lt,r,h)=>{var M=h(62),p=Math.min;lt.exports=function(B){return B>0?p(M(B),9007199254740991):0}},lt=>{lt.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},(lt,r)=>{r.f=Object.getOwnPropertySymbols},(lt,r,h)=>{var M=h(7),p=h(21),B=/#|\.prototype\./,Q=function(q,K){var f=O[U(q)];return f===j?!0:f===I?!1:p(K)?M(K):!!K},U=Q.normalize=function(q){return String(q).replace(B,".").toLowerCase()},O=Q.data={},I=Q.NATIVE="N",j=Q.POLYFILL="P";lt.exports=Q},(lt,r,h)=>{var M=h(9),p=Function.prototype,B=p.apply,Q=p.call;lt.exports=typeof Reflect=="object"&&Reflect.apply||(M?Q.bind(B):function(){return Q.apply(B,arguments)})},(lt,r,h)=>{var M=h(24),p=h(39),B=h(44),Q=h(25),U=h(71),O=h(56),I=h(74),j=h(75),q=h(76),K=h(80),f=h(81),S=h(6),k=h(36);lt.exports=function(T,g,F,J){var v="stackTraceLimit",u=J?2:1,m=T.split("."),_=m[m.length-1],$=M.apply(null,m);if($){var P=$.prototype;if(!k&&p(P,"cause")&&delete P.cause,!F)return $;var Zt=M("Error"),dt=g(function(It,xt){var it=q(J?xt:It,void 0),Xt=J?new $(It):new $;return it!==void 0&&B(Xt,"message",it),f(Xt,dt,Xt.stack,2),this&&Q(P,this)&&j(Xt,this,dt),arguments.length>u&&K(Xt,arguments[u]),Xt});if(dt.prototype=P,_!=="Error"?U?U(dt,Zt):O(dt,Zt,{name:!0}):S&&v in $&&(I(dt,$,v),I(dt,$,"prepareStackTrace")),O(dt,$),!k)try{P.name!==_&&B(P,"name",_),P.constructor=dt}catch{}return dt}}},(lt,r,h)=>{var M=h(72),p=h(47),B=h(73);lt.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var Q=!1,U={},O;try{O=M(Object.prototype,"__proto__","set"),O(U,[]),Q=U instanceof Array}catch{}return function(I,j){return p(I),B(j),Q?O(I,j):I.__proto__=j,I}}():void 0)},(lt,r,h)=>{var M=h(14),p=h(31);lt.exports=function(B,Q,U){try{return M(p(Object.getOwnPropertyDescriptor(B,Q)[U]))}catch{}}},(lt,r,h)=>{var M=h(21),p=String,B=TypeError;lt.exports=function(Q){if(typeof Q=="object"||M(Q))return Q;throw B("Can't set "+p(Q)+" as a prototype")}},(lt,r,h)=>{var M=h(45).f;lt.exports=function(p,B,Q){Q in p||M(p,Q,{configurable:!0,get:function(){return B[Q]},set:function(U){B[Q]=U}})}},(lt,r,h)=>{var M=h(21),p=h(20),B=h(71);lt.exports=function(Q,U,O){var I,j;return B&&M(I=U.constructor)&&I!==O&&p(j=I.prototype)&&j!==O.prototype&&B(Q,j),Q}},(lt,r,h)=>{var M=h(77);lt.exports=function(p,B){return p===void 0?arguments.length<2?"":B:M(p)}},(lt,r,h)=>{var M=h(78),p=String;lt.exports=function(B){if(M(B)==="Symbol")throw TypeError("Cannot convert a Symbol value to a string");return p(B)}},(lt,r,h)=>{var M=h(79),p=h(21),B=h(15),Q=h(34),U=Q("toStringTag"),O=Object,I=B(function(){return arguments}())==="Arguments",j=function(q,K){try{return q[K]}catch{}};lt.exports=M?B:function(q){var K,f,S;return q===void 0?"Undefined":q===null?"Null":typeof(f=j(K=O(q),U))=="string"?f:I?B(K):(S=B(K))==="Object"&&p(K.callee)?"Arguments":S}},(lt,r,h)=>{var M=h(34),p=M("toStringTag"),B={};B[p]="z",lt.exports=String(B)==="[object z]"},(lt,r,h)=>{var M=h(20),p=h(44);lt.exports=function(B,Q){M(Q)&&"cause"in Q&&p(B,"cause",Q.cause)}},(lt,r,h)=>{var M=h(44),p=h(82),B=h(83),Q=Error.captureStackTrace;lt.exports=function(U,O,I,j){B&&(Q?Q(U,O):M(U,"stack",p(I,j)))}},(lt,r,h)=>{var M=h(14),p=Error,B=M("".replace),Q=function(I){return String(p(I).stack)}("zxcasd"),U=/\n\s*at [^:]*:[^\n]*/,O=U.test(Q);lt.exports=function(I,j){if(O&&typeof I=="string"&&!p.prepareStackTrace)for(;j--;)I=B(I,U,"");return I}},(lt,r,h)=>{var M=h(7),p=h(11);lt.exports=!M(function(){var B=Error("a");return"stack"in B?(Object.defineProperty(B,"stack",p(1,7)),B.stack!==7):!0})},(lt,r,h)=>{var M=h(48),p=h(14),B=h(77),Q=h(85),U=URLSearchParams,O=U.prototype,I=p(O.append),j=p(O.delete),q=p(O.forEach),K=p([].push),f=new U("a=1&a=2&b=3");f.delete("a",1),f.delete("b",void 0),f+""!="a=2"&&M(O,"delete",function(S){var k=arguments.length,T=k<2?void 0:arguments[1];if(k&&T===void 0)return j(this,S);var g=[];q(this,function(P,Zt){K(g,{key:Zt,value:P})}),Q(k,1);for(var F=B(S),J=B(T),v=0,u=0,m=!1,_=g.length,$;v<_;)$=g[v++],m||$.key===F?(m=!0,j(this,$.key)):u++;for(;u<_;)$=g[u++],$.key===F&&$.value===J||I(this,$.key,$.value)},{enumerable:!0,unsafe:!0})},lt=>{var r=TypeError;lt.exports=function(h,M){if(h<M)throw r("Not enough arguments");return h}},(lt,r,h)=>{var M=h(48),p=h(14),B=h(77),Q=h(85),U=URLSearchParams,O=U.prototype,I=p(O.getAll),j=p(O.has),q=new U("a=1");(q.has("a",2)||!q.has("a",void 0))&&M(O,"has",function(K){var f=arguments.length,S=f<2?void 0:arguments[1];if(f&&S===void 0)return j(this,K);var k=I(this,K);Q(f,1);for(var T=B(S),g=0;g<k.length;)if(k[g++]===T)return!0;return!1},{enumerable:!0,unsafe:!0})},(lt,r,h)=>{var M=h(6),p=h(14),B=h(88),Q=URLSearchParams.prototype,U=p(Q.forEach);M&&!("size"in Q)&&B(Q,"size",{get:function(){var O=0;return U(this,function(){O++}),O},configurable:!0,enumerable:!0})},(lt,r,h)=>{var M=h(49),p=h(45);lt.exports=function(B,Q,U){return U.get&&M(U.get,Q,{getter:!0}),U.set&&M(U.set,Q,{setter:!0}),p.f(B,Q,U)}},(lt,r,h)=>{var M=h(3),p=h(40),B=h(64),Q=h(90),U=h(92),O=h(7),I=O(function(){return[].push.call({length:4294967296},1)!==4294967297}),j=function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(K){return K instanceof TypeError}},q=I||!j();M({target:"Array",proto:!0,arity:1,forced:q},{push:function(K){var f=p(this),S=B(f),k=arguments.length;U(S+k);for(var T=0;T<k;T++)f[S]=arguments[T],S++;return Q(f,S),S}})},(lt,r,h)=>{var M=h(6),p=h(91),B=TypeError,Q=Object.getOwnPropertyDescriptor,U=M&&!function(){if(this!==void 0)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(O){return O instanceof TypeError}}();lt.exports=U?function(O,I){if(p(O)&&!Q(O,"length").writable)throw B("Cannot set read only .length");return O.length=I}:function(O,I){return O.length=I}},(lt,r,h)=>{var M=h(15);lt.exports=Array.isArray||function(p){return M(p)==="Array"}},lt=>{var r=TypeError,h=9007199254740991;lt.exports=function(M){if(M>h)throw r("Maximum allowed index exceeded");return M}},(lt,r,h)=>{var M=h(94),p=h(98).findLast,B=M.aTypedArray,Q=M.exportTypedArrayMethod;Q("findLast",function(U){return p(B(this),U,arguments.length>1?arguments[1]:void 0)})},(lt,r,h)=>{var M=h(95),p=h(6),B=h(4),Q=h(21),U=h(20),O=h(39),I=h(78),j=h(32),q=h(44),K=h(48),f=h(88),S=h(25),k=h(96),T=h(71),g=h(34),F=h(41),J=h(52),v=J.enforce,u=J.get,m=B.Int8Array,_=m&&m.prototype,$=B.Uint8ClampedArray,P=$&&$.prototype,Zt=m&&k(m),dt=_&&k(_),It=Object.prototype,xt=B.TypeError,it=g("toStringTag"),Xt=F("TYPED_ARRAY_TAG"),zt="TypedArrayConstructor",Gt=M&&!!T&&I(B.opera)!=="Opera",Nt=!1,Ut,Vt,Ht,Pt={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},at={BigInt64Array:8,BigUint64Array:8},R=function(Mt){if(!U(Mt))return!1;var Rt=I(Mt);return Rt==="DataView"||O(Pt,Rt)||O(at,Rt)},w=function(Mt){var Rt=k(Mt);if(U(Rt)){var gt=u(Rt);return gt&&O(gt,zt)?gt[zt]:w(Rt)}},X=function(Mt){if(!U(Mt))return!1;var Rt=I(Mt);return O(Pt,Rt)||O(at,Rt)},C=function(Mt){if(X(Mt))return Mt;throw xt("Target is not a typed array")},H=function(Mt){if(Q(Mt)&&(!T||S(Zt,Mt)))return Mt;throw xt(j(Mt)+" is not a typed array constructor")},st=function(Mt,Rt,gt,Jt){if(p){if(gt)for(var Dt in Pt){var qt=B[Dt];if(qt&&O(qt.prototype,Mt))try{delete qt.prototype[Mt]}catch{try{qt.prototype[Mt]=Rt}catch{}}}(!dt[Mt]||gt)&&K(dt,Mt,gt?Rt:Gt&&_[Mt]||Rt,Jt)}},et=function(Mt,Rt,gt){var Jt,Dt;if(p){if(T){if(gt){for(Jt in Pt)if(Dt=B[Jt],Dt&&O(Dt,Mt))try{delete Dt[Mt]}catch{}}if(!Zt[Mt]||gt)try{return K(Zt,Mt,gt?Rt:Gt&&Zt[Mt]||Rt)}catch{}else return}for(Jt in Pt)Dt=B[Jt],Dt&&(!Dt[Mt]||gt)&&K(Dt,Mt,Rt)}};for(Ut in Pt)Vt=B[Ut],Ht=Vt&&Vt.prototype,Ht?v(Ht)[zt]=Vt:Gt=!1;for(Ut in at)Vt=B[Ut],Ht=Vt&&Vt.prototype,Ht&&(v(Ht)[zt]=Vt);if((!Gt||!Q(Zt)||Zt===Function.prototype)&&(Zt=function(){throw xt("Incorrect invocation")},Gt))for(Ut in Pt)B[Ut]&&T(B[Ut],Zt);if((!Gt||!dt||dt===It)&&(dt=Zt.prototype,Gt))for(Ut in Pt)B[Ut]&&T(B[Ut].prototype,dt);if(Gt&&k(P)!==dt&&T(P,dt),p&&!O(dt,it)){Nt=!0,f(dt,it,{configurable:!0,get:function(){return U(this)?this[Xt]:void 0}});for(Ut in Pt)B[Ut]&&q(B[Ut],Xt,Ut)}lt.exports={NATIVE_ARRAY_BUFFER_VIEWS:Gt,TYPED_ARRAY_TAG:Nt&&Xt,aTypedArray:C,aTypedArrayConstructor:H,exportTypedArrayMethod:st,exportTypedArrayStaticMethod:et,getTypedArrayConstructor:w,isView:R,isTypedArray:X,TypedArray:Zt,TypedArrayPrototype:dt}},lt=>{lt.exports=typeof ArrayBuffer<"u"&&typeof DataView<"u"},(lt,r,h)=>{var M=h(39),p=h(21),B=h(40),Q=h(54),U=h(97),O=Q("IE_PROTO"),I=Object,j=I.prototype;lt.exports=U?I.getPrototypeOf:function(q){var K=B(q);if(M(K,O))return K[O];var f=K.constructor;return p(f)&&K instanceof f?f.prototype:K instanceof I?j:null}},(lt,r,h)=>{var M=h(7);lt.exports=!M(function(){function p(){}return p.prototype.constructor=null,Object.getPrototypeOf(new p)!==p.prototype})},(lt,r,h)=>{var M=h(99),p=h(13),B=h(40),Q=h(64),U=function(O){var I=O===1;return function(j,q,K){for(var f=B(j),S=p(f),k=M(q,K),T=Q(S),g,F;T-- >0;)if(g=S[T],F=k(g,T,f),F)switch(O){case 0:return g;case 1:return T}return I?-1:void 0}};lt.exports={findLast:U(0),findLastIndex:U(1)}},(lt,r,h)=>{var M=h(100),p=h(31),B=h(9),Q=M(M.bind);lt.exports=function(U,O){return p(U),O===void 0?U:B?Q(U,O):function(){return U.apply(O,arguments)}}},(lt,r,h)=>{var M=h(15),p=h(14);lt.exports=function(B){if(M(B)==="Function")return p(B)}},(lt,r,h)=>{var M=h(94),p=h(98).findLastIndex,B=M.aTypedArray,Q=M.exportTypedArrayMethod;Q("findLastIndex",function(U){return p(B(this),U,arguments.length>1?arguments[1]:void 0)})},(lt,r,h)=>{var M=h(4),p=h(8),B=h(94),Q=h(64),U=h(103),O=h(40),I=h(7),j=M.RangeError,q=M.Int8Array,K=q&&q.prototype,f=K&&K.set,S=B.aTypedArray,k=B.exportTypedArrayMethod,T=!I(function(){var F=new Uint8ClampedArray(2);return p(f,F,{length:1,0:3},1),F[1]!==3}),g=T&&B.NATIVE_ARRAY_BUFFER_VIEWS&&I(function(){var F=new q(2);return F.set(1),F.set("2",1),F[0]!==0||F[1]!==2});k("set",function(F){S(this);var J=U(arguments.length>1?arguments[1]:void 0,1),v=O(F);if(T)return p(f,this,v,J);var u=this.length,m=Q(v),_=0;if(m+J>u)throw j("Wrong length");for(;_<m;)this[J+_]=v[_++]},!T||g)},(lt,r,h)=>{var M=h(104),p=RangeError;lt.exports=function(B,Q){var U=M(B);if(U%Q)throw p("Wrong offset");return U}},(lt,r,h)=>{var M=h(62),p=RangeError;lt.exports=function(B){var Q=M(B);if(Q<0)throw p("The argument can't be less than 0");return Q}},(lt,r,h)=>{var M=h(106),p=h(94),B=p.aTypedArray,Q=p.exportTypedArrayMethod,U=p.getTypedArrayConstructor;Q("toReversed",function(){return M(B(this),U(this))})},(lt,r,h)=>{var M=h(64);lt.exports=function(p,B){for(var Q=M(p),U=new B(Q),O=0;O<Q;O++)U[O]=p[Q-O-1];return U}},(lt,r,h)=>{var M=h(94),p=h(14),B=h(31),Q=h(108),U=M.aTypedArray,O=M.getTypedArrayConstructor,I=M.exportTypedArrayMethod,j=p(M.TypedArrayPrototype.sort);I("toSorted",function(q){q!==void 0&&B(q);var K=U(this),f=Q(O(K),K);return j(f,q)})},(lt,r,h)=>{var M=h(64);lt.exports=function(p,B){for(var Q=0,U=M(B),O=new p(U);U>Q;)O[Q]=B[Q++];return O}},(lt,r,h)=>{var M=h(110),p=h(94),B=h(111),Q=h(62),U=h(112),O=p.aTypedArray,I=p.getTypedArrayConstructor,j=p.exportTypedArrayMethod,q=!!function(){try{new Int8Array(1).with(2,{valueOf:function(){throw 8}})}catch(K){return K===8}}();j("with",function(K,f){var S=O(this),k=Q(K),T=B(S)?U(f):+f;return M(S,I(S),k,T)},!q)},(lt,r,h)=>{var M=h(64),p=h(62),B=RangeError;lt.exports=function(Q,U,O,I){var j=M(Q),q=p(O),K=q<0?j+q:q;if(K>=j||K<0)throw B("Incorrect index");for(var f=new U(j),S=0;S<j;S++)f[S]=S===K?I:Q[S];return f}},(lt,r,h)=>{var M=h(78);lt.exports=function(p){var B=M(p);return B==="BigInt64Array"||B==="BigUint64Array"}},(lt,r,h)=>{var M=h(19),p=TypeError;lt.exports=function(B){var Q=M(B,"number");if(typeof Q=="number")throw p("Can't convert number to bigint");return BigInt(Q)}},(lt,r,h)=>{var M=h(6),p=h(88),B=h(114),Q=ArrayBuffer.prototype;M&&!("detached"in Q)&&p(Q,"detached",{configurable:!0,get:function(){return B(this)}})},(lt,r,h)=>{var M=h(14),p=h(115),B=M(ArrayBuffer.prototype.slice);lt.exports=function(Q){if(p(Q)!==0)return!1;try{return B(Q,0,0),!1}catch{return!0}}},(lt,r,h)=>{var M=h(72),p=h(15),B=TypeError;lt.exports=M(ArrayBuffer.prototype,"byteLength","get")||function(Q){if(p(Q)!=="ArrayBuffer")throw B("ArrayBuffer expected");return Q.byteLength}},(lt,r,h)=>{var M=h(3),p=h(117);p&&M({target:"ArrayBuffer",proto:!0},{transfer:function(){return p(this,arguments.length?arguments[0]:void 0,!0)}})},(lt,r,h)=>{var M=h(4),p=h(14),B=h(72),Q=h(118),U=h(114),O=h(115),I=h(119),j=M.TypeError,q=M.structuredClone,K=M.ArrayBuffer,f=M.DataView,S=Math.min,k=K.prototype,T=f.prototype,g=p(k.slice),F=B(k,"resizable","get"),J=B(k,"maxByteLength","get"),v=p(T.getInt8),u=p(T.setInt8);lt.exports=I&&function(m,_,$){var P=O(m),Zt=_===void 0?P:Q(_),dt=!F||!F(m);if(U(m))throw j("ArrayBuffer is detached");var It=q(m,{transfer:[m]});if(P===Zt&&($||dt))return It;if(P>=Zt&&(!$||dt))return g(It,0,Zt);for(var xt=$&&!dt&&J?{maxByteLength:J(It)}:void 0,it=new K(Zt,xt),Xt=new f(It),zt=new f(it),Gt=S(Zt,P),Nt=0;Nt<Gt;Nt++)u(zt,Nt,v(Xt,Nt));return it}},(lt,r,h)=>{var M=h(62),p=h(65),B=RangeError;lt.exports=function(Q){if(Q===void 0)return 0;var U=M(Q),O=p(U);if(U!==O)throw B("Wrong length or index");return O}},(lt,r,h)=>{var M=h(4),p=h(7),B=h(28),Q=h(120),U=h(121),O=h(122),I=M.structuredClone;lt.exports=!!I&&!p(function(){if(U&&B>92||O&&B>94||Q&&B>97)return!1;var j=new ArrayBuffer(8),q=I(j,{transfer:[j]});return j.byteLength!==0||q.byteLength!==8})},(lt,r,h)=>{var M=h(121),p=h(122);lt.exports=!M&&!p&&typeof window=="object"&&typeof document=="object"},lt=>{lt.exports=typeof Deno=="object"&&Deno&&typeof Deno.version=="object"},(lt,r,h)=>{var M=h(4),p=h(15);lt.exports=p(M.process)==="process"},(lt,r,h)=>{var M=h(3),p=h(117);p&&M({target:"ArrayBuffer",proto:!0},{transferToFixedLength:function(){return p(this,arguments.length?arguments[0]:void 0,!1)}})},(__unused_webpack_module,exports,__w_pdfjs_require__)=>{var D,l,c,n,ht,V,St,Y,e,i,x,o,G,s,b,a,rt,N,W,At,Z,d;Object.defineProperty(exports,"__esModule",{value:!0}),exports.RenderTask=exports.PDFWorkerUtil=exports.PDFWorker=exports.PDFPageProxy=exports.PDFDocumentProxy=exports.PDFDocumentLoadingTask=exports.PDFDataRangeTransport=exports.LoopbackPort=exports.DefaultStandardFontDataFactory=exports.DefaultFilterFactory=exports.DefaultCanvasFactory=exports.DefaultCMapReaderFactory=void 0,Object.defineProperty(exports,"SVGGraphics",{enumerable:!0,get:function(){return _displaySvg.SVGGraphics}}),exports.build=void 0,exports.getDocument=getDocument,exports.version=void 0,__w_pdfjs_require__(84),__w_pdfjs_require__(86),__w_pdfjs_require__(87),__w_pdfjs_require__(2),__w_pdfjs_require__(93),__w_pdfjs_require__(101),__w_pdfjs_require__(102),__w_pdfjs_require__(105),__w_pdfjs_require__(107),__w_pdfjs_require__(109),__w_pdfjs_require__(113),__w_pdfjs_require__(116),__w_pdfjs_require__(123),__w_pdfjs_require__(89),__w_pdfjs_require__(125),__w_pdfjs_require__(136),__w_pdfjs_require__(138),__w_pdfjs_require__(141),__w_pdfjs_require__(143),__w_pdfjs_require__(145),__w_pdfjs_require__(147),__w_pdfjs_require__(149),__w_pdfjs_require__(152);var _util=__w_pdfjs_require__(1),_annotation_storage=__w_pdfjs_require__(163),_display_utils=__w_pdfjs_require__(168),_font_loader=__w_pdfjs_require__(171),_displayNode_utils=__w_pdfjs_require__(172),_canvas=__w_pdfjs_require__(173),_worker_options=__w_pdfjs_require__(176),_message_handler=__w_pdfjs_require__(177),_metadata=__w_pdfjs_require__(178),_optional_content_config=__w_pdfjs_require__(179),_transport_stream=__w_pdfjs_require__(180),_displayFetch_stream=__w_pdfjs_require__(181),_displayNetwork=__w_pdfjs_require__(184),_displayNode_stream=__w_pdfjs_require__(185),_displaySvg=__w_pdfjs_require__(186),_xfa_text=__w_pdfjs_require__(194);const DEFAULT_RANGE_CHUNK_SIZE=65536,RENDERING_CANCELLED_TIMEOUT=100,DELAYED_CLEANUP_TIMEOUT=5e3,DefaultCanvasFactory=_util.isNodeJS?_displayNode_utils.NodeCanvasFactory:_display_utils.DOMCanvasFactory;exports.DefaultCanvasFactory=DefaultCanvasFactory;const DefaultCMapReaderFactory=_util.isNodeJS?_displayNode_utils.NodeCMapReaderFactory:_display_utils.DOMCMapReaderFactory;exports.DefaultCMapReaderFactory=DefaultCMapReaderFactory;const DefaultFilterFactory=_util.isNodeJS?_displayNode_utils.NodeFilterFactory:_display_utils.DOMFilterFactory;exports.DefaultFilterFactory=DefaultFilterFactory;const DefaultStandardFontDataFactory=_util.isNodeJS?_displayNode_utils.NodeStandardFontDataFactory:_display_utils.DOMStandardFontDataFactory;exports.DefaultStandardFontDataFactory=DefaultStandardFontDataFactory;function getDocument(lt){if(typeof lt=="string"||lt instanceof URL?lt={url:lt}:(0,_util.isArrayBuffer)(lt)&&(lt={data:lt}),typeof lt!="object")throw new Error("Invalid parameter in getDocument, need parameter object.");if(!lt.url&&!lt.data&&!lt.range)throw new Error("Invalid parameter object: need either .data, .range or .url");const r=new PDFDocumentLoadingTask,{docId:h}=r,M=lt.url?getUrlProp(lt.url):null,p=lt.data?getDataProp(lt.data):null,B=lt.httpHeaders||null,Q=lt.withCredentials===!0,U=lt.password??null,O=lt.range instanceof PDFDataRangeTransport?lt.range:null,I=Number.isInteger(lt.rangeChunkSize)&<.rangeChunkSize>0?lt.rangeChunkSize:DEFAULT_RANGE_CHUNK_SIZE;let j=lt.worker instanceof PDFWorker?lt.worker:null;const q=lt.verbosity,K=typeof lt.docBaseUrl=="string"&&!(0,_display_utils.isDataScheme)(lt.docBaseUrl)?lt.docBaseUrl:null,f=typeof lt.cMapUrl=="string"?lt.cMapUrl:null,S=lt.cMapPacked!==!1,k=lt.CMapReaderFactory||DefaultCMapReaderFactory,T=typeof lt.standardFontDataUrl=="string"?lt.standardFontDataUrl:null,g=lt.StandardFontDataFactory||DefaultStandardFontDataFactory,F=lt.stopAtErrors!==!0,J=Number.isInteger(lt.maxImageSize)&<.maxImageSize>-1?lt.maxImageSize:-1,v=lt.isEvalSupported!==!1,u=typeof lt.isOffscreenCanvasSupported=="boolean"?lt.isOffscreenCanvasSupported:!_util.isNodeJS,m=Number.isInteger(lt.canvasMaxAreaInBytes)?lt.canvasMaxAreaInBytes:-1,_=typeof lt.disableFontFace=="boolean"?lt.disableFontFace:_util.isNodeJS,$=lt.fontExtraProperties===!0,P=lt.enableXfa===!0,Zt=lt.ownerDocument||globalThis.document,dt=lt.disableRange===!0,It=lt.disableStream===!0,xt=lt.disableAutoFetch===!0,it=lt.pdfBug===!0,Xt=O?O.length:lt.length??NaN,zt=typeof lt.useSystemFonts=="boolean"?lt.useSystemFonts:!_util.isNodeJS&&!_,Gt=typeof lt.useWorkerFetch=="boolean"?lt.useWorkerFetch:k===_display_utils.DOMCMapReaderFactory&&g===_display_utils.DOMStandardFontDataFactory&&f&&T&&(0,_display_utils.isValidFetchUrl)(f,document.baseURI)&&(0,_display_utils.isValidFetchUrl)(T,document.baseURI),Nt=lt.canvasFactory||new DefaultCanvasFactory({ownerDocument:Zt}),Ut=lt.filterFactory||new DefaultFilterFactory({docId:h,ownerDocument:Zt}),Vt=null;(0,_util.setVerbosityLevel)(q);const Ht={canvasFactory:Nt,filterFactory:Ut};if(Gt||(Ht.cMapReaderFactory=new k({baseUrl:f,isCompressed:S}),Ht.standardFontDataFactory=new g({baseUrl:T})),!j){const R={verbosity:q,port:_worker_options.GlobalWorkerOptions.workerPort};j=R.port?PDFWorker.fromPort(R):new PDFWorker(R),r._worker=j}const Pt={docId:h,apiVersion:"3.11.174",data:p,password:U,disableAutoFetch:xt,rangeChunkSize:I,length:Xt,docBaseUrl:K,enableXfa:P,evaluatorOptions:{maxImageSize:J,disableFontFace:_,ignoreErrors:F,isEvalSupported:v,isOffscreenCanvasSupported:u,canvasMaxAreaInBytes:m,fontExtraProperties:$,useSystemFonts:zt,cMapUrl:Gt?f:null,standardFontDataUrl:Gt?T:null}},at={ignoreErrors:F,isEvalSupported:v,disableFontFace:_,fontExtraProperties:$,enableXfa:P,ownerDocument:Zt,disableAutoFetch:xt,pdfBug:it,styleElement:Vt};return j.promise.then(function(){if(r.destroyed)throw new Error("Loading aborted");const R=_fetchDocument(j,Pt),w=new Promise(function(X){let C;O?C=new _transport_stream.PDFDataTransportStream({length:Xt,initialData:O.initialData,progressiveDone:O.progressiveDone,contentDispositionFilename:O.contentDispositionFilename,disableRange:dt,disableStream:It},O):p||(C=(H=>_util.isNodeJS?new _displayNode_stream.PDFNodeStream(H):(0,_display_utils.isValidFetchUrl)(H.url)?new _displayFetch_stream.PDFFetchStream(H):new _displayNetwork.PDFNetworkStream(H))({url:M,length:Xt,httpHeaders:B,withCredentials:Q,rangeChunkSize:I,disableRange:dt,disableStream:It})),X(C)});return Promise.all([R,w]).then(function(X){let[C,H]=X;if(r.destroyed)throw new Error("Loading aborted");const st=new _message_handler.MessageHandler(h,C,j.port),et=new WorkerTransport(st,r,H,at,Ht);r._transport=et,st.send("Ready",null)})}).catch(r._capability.reject),r}async function _fetchDocument(lt,r){if(lt.destroyed)throw new Error("Worker was destroyed");const h=await lt.messageHandler.sendWithPromise("GetDocRequest",r,r.data?[r.data.buffer]:null);if(lt.destroyed)throw new Error("Worker was destroyed");return h}function getUrlProp(lt){if(lt instanceof URL)return lt.href;try{return new URL(lt,window.location).href}catch{if(_util.isNodeJS&&typeof lt=="string")return lt}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}function getDataProp(lt){if(_util.isNodeJS&&typeof Buffer<"u"&< instanceof Buffer)throw new Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");if(lt instanceof Uint8Array&<.byteLength===lt.buffer.byteLength)return lt;if(typeof lt=="string")return(0,_util.stringToBytes)(lt);if(typeof lt=="object"&&!isNaN(lt==null?void 0:lt.length)||(0,_util.isArrayBuffer)(lt))return new Uint8Array(lt);throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")}const y=class Cs{constructor(){this._capability=new _util.PromiseCapability,this._transport=null,this._worker=null,this.docId=`d${mt(Cs,D)._++}`,this.destroyed=!1,this.onPassword=null,this.onProgress=null}get promise(){return this._capability.promise}async destroy(){var r,h,M;this.destroyed=!0;try{(r=this._worker)!=null&&r.port&&(this._worker._pendingDestroy=!0),await((h=this._transport)==null?void 0:h.destroy())}catch(p){throw(M=this._worker)!=null&&M.port&&delete this._worker._pendingDestroy,p}this._transport=null,this._worker&&(this._worker.destroy(),this._worker=null)}};D=new WeakMap,E(y,D,0);let PDFDocumentLoadingTask=y;exports.PDFDocumentLoadingTask=PDFDocumentLoadingTask;class PDFDataRangeTransport{constructor(r,h){let M=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,p=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;this.length=r,this.initialData=h,this.progressiveDone=M,this.contentDispositionFilename=p,this._rangeListeners=[],this._progressListeners=[],this._progressiveReadListeners=[],this._progressiveDoneListeners=[],this._readyCapability=new _util.PromiseCapability}addRangeListener(r){this._rangeListeners.push(r)}addProgressListener(r){this._progressListeners.push(r)}addProgressiveReadListener(r){this._progressiveReadListeners.push(r)}addProgressiveDoneListener(r){this._progressiveDoneListeners.push(r)}onDataRange(r,h){for(const M of this._rangeListeners)M(r,h)}onDataProgress(r,h){this._readyCapability.promise.then(()=>{for(const M of this._progressListeners)M(r,h)})}onDataProgressiveRead(r){this._readyCapability.promise.then(()=>{for(const h of this._progressiveReadListeners)h(r)})}onDataProgressiveDone(){this._readyCapability.promise.then(()=>{for(const r of this._progressiveDoneListeners)r()})}transportReady(){this._readyCapability.resolve()}requestDataRange(r,h){(0,_util.unreachable)("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}}exports.PDFDataRangeTransport=PDFDataRangeTransport;class PDFDocumentProxy{constructor(r,h){this._pdfInfo=r,this._transport=h,Object.defineProperty(this,"getJavaScript",{value:()=>((0,_display_utils.deprecated)("`PDFDocumentProxy.getJavaScript`, please use `PDFDocumentProxy.getJSActions` instead."),this.getJSActions().then(M=>{if(!M)return M;const p=[];for(const B in M)p.push(...M[B]);return p}))})}get annotationStorage(){return this._transport.annotationStorage}get filterFactory(){return this._transport.filterFactory}get numPages(){return this._pdfInfo.numPages}get fingerprints(){return this._pdfInfo.fingerprints}get isPureXfa(){return(0,_util.shadow)(this,"isPureXfa",!!this._transport._htmlForXfa)}get allXfaHtml(){return this._transport._htmlForXfa}getPage(r){return this._transport.getPage(r)}getPageIndex(r){return this._transport.getPageIndex(r)}getDestinations(){return this._transport.getDestinations()}getDestination(r){return this._transport.getDestination(r)}getPageLabels(){return this._transport.getPageLabels()}getPageLayout(){return this._transport.getPageLayout()}getPageMode(){return this._transport.getPageMode()}getViewerPreferences(){return this._transport.getViewerPreferences()}getOpenAction(){return this._transport.getOpenAction()}getAttachments(){return this._transport.getAttachments()}getJSActions(){return this._transport.getDocJSActions()}getOutline(){return this._transport.getOutline()}getOptionalContentConfig(){return this._transport.getOptionalContentConfig()}getPermissions(){return this._transport.getPermissions()}getMetadata(){return this._transport.getMetadata()}getMarkInfo(){return this._transport.getMarkInfo()}getData(){return this._transport.getData()}saveDocument(){return this._transport.saveDocument()}getDownloadInfo(){return this._transport.downloadInfoCapability.promise}cleanup(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return this._transport.startCleanup(r||this.isPureXfa)}destroy(){return this.loadingTask.destroy()}get loadingParams(){return this._transport.loadingParams}get loadingTask(){return this._transport.loadingTask}getFieldObjects(){return this._transport.getFieldObjects()}hasJSActions(){return this._transport.hasJSActions()}getCalculationOrderIds(){return this._transport.getCalculationOrderIds()}}exports.PDFDocumentProxy=PDFDocumentProxy;class PDFPageProxy{constructor(r,h,M){E(this,n),E(this,V),E(this,l,null),E(this,c,!1);let p=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;this._pageIndex=r,this._pageInfo=h,this._transport=M,this._stats=p?new _display_utils.StatTimer:null,this._pdfBug=p,this.commonObjs=M.commonObjs,this.objs=new PDFObjects,this._maybeCleanupAfterRender=!1,this._intentStates=new Map,this.destroyed=!1}get pageNumber(){return this._pageIndex+1}get rotate(){return this._pageInfo.rotate}get ref(){return this._pageInfo.ref}get userUnit(){return this._pageInfo.userUnit}get view(){return this._pageInfo.view}getViewport(){let{scale:r,rotation:h=this.rotate,offsetX:M=0,offsetY:p=0,dontFlip:B=!1}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return new _display_utils.PageViewport({viewBox:this.view,scale:r,rotation:h,offsetX:M,offsetY:p,dontFlip:B})}getAnnotations(){let{intent:r="display"}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const h=this._transport.getRenderingIntent(r);return this._transport.getAnnotations(this._pageIndex,h.renderingIntent)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get filterFactory(){return this._transport.filterFactory}get isPureXfa(){return(0,_util.shadow)(this,"isPureXfa",!!this._transport._htmlForXfa)}async getXfa(){var r;return((r=this._transport._htmlForXfa)==null?void 0:r.children[this._pageIndex])||null}render(r){var h,M;let{canvasContext:p,viewport:B,intent:Q="display",annotationMode:U=_util.AnnotationMode.ENABLE,transform:O=null,background:I=null,optionalContentConfigPromise:j=null,annotationCanvasMap:q=null,pageColors:K=null,printAnnotationStorage:f=null}=r;(h=this._stats)==null||h.time("Overall");const S=this._transport.getRenderingIntent(Q,U,f);Zl(this,c,!1),A(this,V,St).call(this),j||(j=this._transport.getOptionalContentConfig());let k=this._intentStates.get(S.cacheKey);k||(k=Object.create(null),this._intentStates.set(S.cacheKey,k)),k.streamReaderCancelTimeout&&(clearTimeout(k.streamReaderCancelTimeout),k.streamReaderCancelTimeout=null);const T=!!(S.renderingIntent&_util.RenderingIntentFlag.PRINT);k.displayReadyCapability||(k.displayReadyCapability=new _util.PromiseCapability,k.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},(M=this._stats)==null||M.time("Page Request"),this._pumpOperatorList(S));const g=v=>{var u,m;k.renderTasks.delete(F),(this._maybeCleanupAfterRender||T)&&Zl(this,c,!0),A(this,n,ht).call(this,!T),v?(F.capability.reject(v),this._abortOperatorList({intentState:k,reason:v instanceof Error?v:new Error(v)})):F.capability.resolve(),(u=this._stats)==null||u.timeEnd("Rendering"),(m=this._stats)==null||m.timeEnd("Overall")},F=new InternalRenderTask({callback:g,params:{canvasContext:p,viewport:B,transform:O,background:I},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:q,operatorList:k.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!T,pdfBug:this._pdfBug,pageColors:K});(k.renderTasks||(k.renderTasks=new Set)).add(F);const J=F.task;return Promise.all([k.displayReadyCapability.promise,j]).then(v=>{var u;let[m,_]=v;if(this.destroyed){g();return}(u=this._stats)==null||u.time("Rendering"),F.initializeGraphics({transparency:m,optionalContentConfig:_}),F.operatorListChanged()}).catch(g),J}getOperatorList(){var r;let{intent:h="display",annotationMode:M=_util.AnnotationMode.ENABLE,printAnnotationStorage:p=null}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};function B(){U.operatorList.lastChunk&&(U.opListReadCapability.resolve(U.operatorList),U.renderTasks.delete(O))}const Q=this._transport.getRenderingIntent(h,M,p,!0);let U=this._intentStates.get(Q.cacheKey);U||(U=Object.create(null),this._intentStates.set(Q.cacheKey,U));let O;return U.opListReadCapability||(O=Object.create(null),O.operatorListChanged=B,U.opListReadCapability=new _util.PromiseCapability,(U.renderTasks||(U.renderTasks=new Set)).add(O),U.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},(r=this._stats)==null||r.time("Page Request"),this._pumpOperatorList(Q)),U.opListReadCapability.promise}streamTextContent(){let{includeMarkedContent:r=!1,disableNormalization:h=!1}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,includeMarkedContent:r===!0,disableNormalization:h===!0},{highWaterMark:100,size(p){return p.items.length}})}getTextContent(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(this._transport._htmlForXfa)return this.getXfa().then(M=>_xfa_text.XfaText.textContent(M));const h=this.streamTextContent(r);return new Promise(function(M,p){function B(){Q.read().then(function(O){let{value:I,done:j}=O;if(j){M(U);return}Object.assign(U.styles,I.styles),U.items.push(...I.items),B()},p)}const Q=h.getReader(),U={items:[],styles:Object.create(null)};B()})}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;const r=[];for(const h of this._intentStates.values())if(this._abortOperatorList({intentState:h,reason:new Error("Page was destroyed."),force:!0}),!h.opListReadCapability)for(const M of h.renderTasks)r.push(M.completed),M.cancel();return this.objs.clear(),Zl(this,c,!1),A(this,V,St).call(this),Promise.all(r)}cleanup(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;Zl(this,c,!0);const h=A(this,n,ht).call(this,!1);return r&&h&&this._stats&&(this._stats=new _display_utils.StatTimer),h}_startRenderPage(r,h){var M,p;const B=this._intentStates.get(h);B&&((M=this._stats)==null||M.timeEnd("Page Request"),(p=B.displayReadyCapability)==null||p.resolve(r))}_renderPageChunk(r,h){for(let M=0,p=r.length;M<p;M++)h.operatorList.fnArray.push(r.fnArray[M]),h.operatorList.argsArray.push(r.argsArray[M]);h.operatorList.lastChunk=r.lastChunk,h.operatorList.separateAnnots=r.separateAnnots;for(const M of h.renderTasks)M.operatorListChanged();r.lastChunk&&A(this,n,ht).call(this,!0)}_pumpOperatorList(r){let{renderingIntent:h,cacheKey:M,annotationStorageSerializable:p}=r;const{map:B,transfers:Q}=p,U=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:h,cacheKey:M,annotationStorage:B},Q).getReader(),O=this._intentStates.get(M);O.streamReader=U;const I=()=>{U.read().then(j=>{let{value:q,done:K}=j;if(K){O.streamReader=null;return}this._transport.destroyed||(this._renderPageChunk(q,O),I())},j=>{if(O.streamReader=null,!this._transport.destroyed){if(O.operatorList){O.operatorList.lastChunk=!0;for(const q of O.renderTasks)q.operatorListChanged();A(this,n,ht).call(this,!0)}if(O.displayReadyCapability)O.displayReadyCapability.reject(j);else if(O.opListReadCapability)O.opListReadCapability.reject(j);else throw j}})};I()}_abortOperatorList(r){let{intentState:h,reason:M,force:p=!1}=r;if(h.streamReader){if(h.streamReaderCancelTimeout&&(clearTimeout(h.streamReaderCancelTimeout),h.streamReaderCancelTimeout=null),!p){if(h.renderTasks.size>0)return;if(M instanceof _display_utils.RenderingCancelledException){let B=RENDERING_CANCELLED_TIMEOUT;M.extraDelay>0&&M.extraDelay<1e3&&(B+=M.extraDelay),h.streamReaderCancelTimeout=setTimeout(()=>{h.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:h,reason:M,force:!0})},B);return}}if(h.streamReader.cancel(new _util.AbortException(M.message)).catch(()=>{}),h.streamReader=null,!this._transport.destroyed){for(const[B,Q]of this._intentStates)if(Q===h){this._intentStates.delete(B);break}this.cleanup()}}}get stats(){return this._stats}}l=new WeakMap,c=new WeakMap,n=new WeakSet,ht=function(){let lt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(A(this,V,St).call(this),!t(this,c)||this.destroyed)return!1;if(lt)return Zl(this,l,setTimeout(()=>{Zl(this,l,null),A(this,n,ht).call(this,!1)},DELAYED_CLEANUP_TIMEOUT)),!1;for(const{renderTasks:r,operatorList:h}of this._intentStates.values())if(r.size>0||!h.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),Zl(this,c,!1),!0},V=new WeakSet,St=function(){t(this,l)&&(clearTimeout(t(this,l)),Zl(this,l,null))},exports.PDFPageProxy=PDFPageProxy;class LoopbackPort{constructor(){E(this,Y,new Set),E(this,e,Promise.resolve())}postMessage(r,h){const M={data:structuredClone(r,null)};t(this,e).then(()=>{for(const p of t(this,Y))p.call(this,M)})}addEventListener(r,h){t(this,Y).add(h)}removeEventListener(r,h){t(this,Y).delete(h)}terminate(){t(this,Y).clear()}}Y=new WeakMap,e=new WeakMap,exports.LoopbackPort=LoopbackPort;const PDFWorkerUtil={isWorkerDisabled:!1,fallbackWorkerSrc:null,fakeWorkerId:0};exports.PDFWorkerUtil=PDFWorkerUtil;{if(_util.isNodeJS&&typeof commonjsRequire=="function")PDFWorkerUtil.isWorkerDisabled=!0,PDFWorkerUtil.fallbackWorkerSrc="./pdf.worker.js";else if(typeof document=="object"){const lt=(i=document==null?void 0:document.currentScript)==null?void 0:i.src;lt&&(PDFWorkerUtil.fallbackWorkerSrc=lt.replace(/(\.(?:min\.)?js)(\?.*)?$/i,".worker$1$2"))}PDFWorkerUtil.isSameOrigin=function(lt,r){let h;try{if(h=new URL(lt),!h.origin||h.origin==="null")return!1}catch{return!1}const M=new URL(r,h);return h.origin===M.origin},PDFWorkerUtil.createCDNWrapper=function(lt){const r=`importScripts("${lt}");`;return URL.createObjectURL(new Blob([r]))}}const _PDFWorker=class __PDFWorker{constructor(){var lt;let{name:r=null,port:h=null,verbosity:M=(0,_util.getVerbosityLevel)()}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(this.name=r,this.destroyed=!1,this.verbosity=M,this._readyCapability=new _util.PromiseCapability,this._port=null,this._webWorker=null,this._messageHandler=null,h){if((lt=t(__PDFWorker,x))!=null&<.has(h))throw new Error("Cannot use more than one PDFWorker per port.");(t(__PDFWorker,x)||Zl(__PDFWorker,x,new WeakMap)).set(h,this),this._initializeFromPort(h);return}this._initialize()}get promise(){return this._readyCapability.promise}get port(){return this._port}get messageHandler(){return this._messageHandler}_initializeFromPort(lt){this._port=lt,this._messageHandler=new _message_handler.MessageHandler("main","worker",lt),this._messageHandler.on("ready",function(){}),this._readyCapability.resolve(),this._messageHandler.send("configure",{verbosity:this.verbosity})}_initialize(){if(!PDFWorkerUtil.isWorkerDisabled&&!__PDFWorker._mainThreadWorkerMessageHandler){let{workerSrc:lt}=__PDFWorker;try{PDFWorkerUtil.isSameOrigin(window.location.href,lt)||(lt=PDFWorkerUtil.createCDNWrapper(new URL(lt,window.location).href));const r=new Worker(lt),h=new _message_handler.MessageHandler("main","worker",r),M=()=>{r.removeEventListener("error",p),h.destroy(),r.terminate(),this.destroyed?this._readyCapability.reject(new Error("Worker was destroyed")):this._setupFakeWorker()},p=()=>{this._webWorker||M()};r.addEventListener("error",p),h.on("test",Q=>{if(r.removeEventListener("error",p),this.destroyed){M();return}Q?(this._messageHandler=h,this._port=r,this._webWorker=r,this._readyCapability.resolve(),h.send("configure",{verbosity:this.verbosity})):(this._setupFakeWorker(),h.destroy(),r.terminate())}),h.on("ready",Q=>{if(r.removeEventListener("error",p),this.destroyed){M();return}try{B()}catch{this._setupFakeWorker()}});const B=()=>{const Q=new Uint8Array;h.send("test",Q,[Q.buffer])};B();return}catch{(0,_util.info)("The worker has been disabled.")}}this._setupFakeWorker()}_setupFakeWorker(){PDFWorkerUtil.isWorkerDisabled||((0,_util.warn)("Setting up fake worker."),PDFWorkerUtil.isWorkerDisabled=!0),__PDFWorker._setupFakeWorkerGlobal.then(lt=>{if(this.destroyed){this._readyCapability.reject(new Error("Worker was destroyed"));return}const r=new LoopbackPort;this._port=r;const h=`fake${PDFWorkerUtil.fakeWorkerId++}`,M=new _message_handler.MessageHandler(h+"_worker",h,r);lt.setup(M,r);const p=new _message_handler.MessageHandler(h,h+"_worker",r);this._messageHandler=p,this._readyCapability.resolve(),p.send("configure",{verbosity:this.verbosity})}).catch(lt=>{this._readyCapability.reject(new Error(`Setting up fake worker failed: "${lt.message}".`))})}destroy(){var lt;this.destroyed=!0,this._webWorker&&(this._webWorker.terminate(),this._webWorker=null),(lt=t(__PDFWorker,x))==null||lt.delete(this._port),this._port=null,this._messageHandler&&(this._messageHandler.destroy(),this._messageHandler=null)}static fromPort(lt){var r;if(!(lt!=null&<.port))throw new Error("PDFWorker.fromPort - invalid method signature.");const h=(r=t(this,x))==null?void 0:r.get(lt.port);if(h){if(h._pendingDestroy)throw new Error("PDFWorker.fromPort - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");return h}return new __PDFWorker(lt)}static get workerSrc(){if(_worker_options.GlobalWorkerOptions.workerSrc)return _worker_options.GlobalWorkerOptions.workerSrc;if(PDFWorkerUtil.fallbackWorkerSrc!==null)return _util.isNodeJS||(0,_display_utils.deprecated)('No "GlobalWorkerOptions.workerSrc" specified.'),PDFWorkerUtil.fallbackWorkerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get _mainThreadWorkerMessageHandler(){var lt;try{return((lt=globalThis.pdfjsWorker)==null?void 0:lt.WorkerMessageHandler)||null}catch{return null}}static get _setupFakeWorkerGlobal(){const loader=async()=>{const mainWorkerMessageHandler=this._mainThreadWorkerMessageHandler;if(mainWorkerMessageHandler)return mainWorkerMessageHandler;if(_util.isNodeJS&&typeof commonjsRequire=="function"){const worker=eval("require")(this.workerSrc);return worker.WorkerMessageHandler}return await(0,_display_utils.loadScript)(this.workerSrc),window.pdfjsWorker.WorkerMessageHandler};return(0,_util.shadow)(this,"_setupFakeWorkerGlobal",loader())}};x=new WeakMap,E(_PDFWorker,x,void 0);let PDFWorker=_PDFWorker;exports.PDFWorker=PDFWorker;class WorkerTransport{constructor(r,h,M,p,B){E(this,a),E(this,o,new Map),E(this,G,new Map),E(this,s,new Map),E(this,b,null),this.messageHandler=r,this.loadingTask=h,this.commonObjs=new PDFObjects,this.fontLoader=new _font_loader.FontLoader({ownerDocument:p.ownerDocument,styleElement:p.styleElement}),this._params=p,this.canvasFactory=B.canvasFactory,this.filterFactory=B.filterFactory,this.cMapReaderFactory=B.cMapReaderFactory,this.standardFontDataFactory=B.standardFontDataFactory,this.destroyed=!1,this.destroyCapability=null,this._networkStream=M,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=new _util.PromiseCapability,this.setupMessageHandler()}get annotationStorage(){return(0,_util.shadow)(this,"annotationStorage",new _annotation_storage.AnnotationStorage)}getRenderingIntent(r){let h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:_util.AnnotationMode.ENABLE,M=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,p=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,B=_util.RenderingIntentFlag.DISPLAY,Q=_annotation_storage.SerializableEmpty;switch(r){case"any":B=_util.RenderingIntentFlag.ANY;break;case"display":break;case"print":B=_util.RenderingIntentFlag.PRINT;break;default:(0,_util.warn)(`getRenderingIntent - invalid intent: ${r}`)}switch(h){case _util.AnnotationMode.DISABLE:B+=_util.RenderingIntentFlag.ANNOTATIONS_DISABLE;break;case _util.AnnotationMode.ENABLE:break;case _util.AnnotationMode.ENABLE_FORMS:B+=_util.RenderingIntentFlag.ANNOTATIONS_FORMS;break;case _util.AnnotationMode.ENABLE_STORAGE:B+=_util.RenderingIntentFlag.ANNOTATIONS_STORAGE,Q=(B&_util.RenderingIntentFlag.PRINT&&M instanceof _annotation_storage.PrintAnnotationStorage?M:this.annotationStorage).serializable;break;default:(0,_util.warn)(`getRenderingIntent - invalid annotationMode: ${h}`)}return p&&(B+=_util.RenderingIntentFlag.OPLIST),{renderingIntent:B,cacheKey:`${B}_${Q.hash}`,annotationStorageSerializable:Q}}destroy(){var r;if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=new _util.PromiseCapability,(r=t(this,b))==null||r.reject(new Error("Worker was destroyed during onPassword callback"));const h=[];for(const p of t(this,G).values())h.push(p._destroy());t(this,G).clear(),t(this,s).clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();const M=this.messageHandler.sendWithPromise("Terminate",null);return h.push(M),Promise.all(h).then(()=>{var p;this.commonObjs.clear(),this.fontLoader.clear(),t(this,o).clear(),this.filterFactory.destroy(),(p=this._networkStream)==null||p.cancelAllRequests(new _util.AbortException("Worker was terminated.")),this.messageHandler&&(this.messageHandler.destroy(),this.messageHandler=null),this.destroyCapability.resolve()},this.destroyCapability.reject),this.destroyCapability.promise}setupMessageHandler(){const{messageHandler:r,loadingTask:h}=this;r.on("GetReader",(M,p)=>{(0,_util.assert)(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=B=>{this._lastProgress={loaded:B.loaded,total:B.total}},p.onPull=()=>{this._fullReader.read().then(function(B){let{value:Q,done:U}=B;if(U){p.close();return}(0,_util.assert)(Q instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),p.enqueue(new Uint8Array(Q),1,[Q])}).catch(B=>{p.error(B)})},p.onCancel=B=>{this._fullReader.cancel(B),p.ready.catch(Q=>{if(!this.destroyed)throw Q})}}),r.on("ReaderHeadersReady",M=>{const p=new _util.PromiseCapability,B=this._fullReader;return B.headersReady.then(()=>{var Q;(!B.isStreamingSupported||!B.isRangeSupported)&&(this._lastProgress&&((Q=h.onProgress)==null||Q.call(h,this._lastProgress)),B.onProgress=U=>{var O;(O=h.onProgress)==null||O.call(h,{loaded:U.loaded,total:U.total})}),p.resolve({isStreamingSupported:B.isStreamingSupported,isRangeSupported:B.isRangeSupported,contentLength:B.contentLength})},p.reject),p.promise}),r.on("GetRangeReader",(M,p)=>{(0,_util.assert)(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const B=this._networkStream.getRangeReader(M.begin,M.end);if(!B){p.close();return}p.onPull=()=>{B.read().then(function(Q){let{value:U,done:O}=Q;if(O){p.close();return}(0,_util.assert)(U instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),p.enqueue(new Uint8Array(U),1,[U])}).catch(Q=>{p.error(Q)})},p.onCancel=Q=>{B.cancel(Q),p.ready.catch(U=>{if(!this.destroyed)throw U})}}),r.on("GetDoc",M=>{let{pdfInfo:p}=M;this._numPages=p.numPages,this._htmlForXfa=p.htmlForXfa,delete p.htmlForXfa,h._capability.resolve(new PDFDocumentProxy(p,this))}),r.on("DocException",function(M){let p;switch(M.name){case"PasswordException":p=new _util.PasswordException(M.message,M.code);break;case"InvalidPDFException":p=new _util.InvalidPDFException(M.message);break;case"MissingPDFException":p=new _util.MissingPDFException(M.message);break;case"UnexpectedResponseException":p=new _util.UnexpectedResponseException(M.message,M.status);break;case"UnknownErrorException":p=new _util.UnknownErrorException(M.message,M.details);break;default:(0,_util.unreachable)("DocException - expected a valid Error.")}h._capability.reject(p)}),r.on("PasswordRequest",M=>{if(Zl(this,b,new _util.PromiseCapability),h.onPassword){const p=B=>{B instanceof Error?t(this,b).reject(B):t(this,b).resolve({password:B})};try{h.onPassword(p,M.code)}catch(B){t(this,b).reject(B)}}else t(this,b).reject(new _util.PasswordException(M.message,M.code));return t(this,b).promise}),r.on("DataLoaded",M=>{var p;(p=h.onProgress)==null||p.call(h,{loaded:M.length,total:M.length}),this.downloadInfoCapability.resolve(M)}),r.on("StartRenderPage",M=>{this.destroyed||t(this,G).get(M.pageIndex)._startRenderPage(M.transparency,M.cacheKey)}),r.on("commonobj",M=>{var p;let[B,Q,U]=M;if(!this.destroyed&&!this.commonObjs.has(B))switch(Q){case"Font":const O=this._params;if("error"in U){const q=U.error;(0,_util.warn)(`Error during font loading: ${q}`),this.commonObjs.resolve(B,q);break}const I=O.pdfBug&&(p=globalThis.FontInspector)!=null&&p.enabled?(q,K)=>globalThis.FontInspector.fontAdded(q,K):null,j=new _font_loader.FontFaceObject(U,{isEvalSupported:O.isEvalSupported,disableFontFace:O.disableFontFace,ignoreErrors:O.ignoreErrors,inspectFont:I});this.fontLoader.bind(j).catch(q=>r.sendWithPromise("FontFallback",{id:B})).finally(()=>{!O.fontExtraProperties&&j.data&&(j.data=null),this.commonObjs.resolve(B,j)});break;case"FontPath":case"Image":case"Pattern":this.commonObjs.resolve(B,U);break;default:throw new Error(`Got unknown common object type ${Q}`)}}),r.on("obj",M=>{var p;let[B,Q,U,O]=M;if(this.destroyed)return;const I=t(this,G).get(Q);if(!I.objs.has(B))switch(U){case"Image":if(I.objs.resolve(B,O),O){let j;if(O.bitmap){const{width:q,height:K}=O;j=q*K*4}else j=((p=O.data)==null?void 0:p.length)||0;j>_util.MAX_IMAGE_SIZE_TO_CACHE&&(I._maybeCleanupAfterRender=!0)}break;case"Pattern":I.objs.resolve(B,O);break;default:throw new Error(`Got unknown object type ${U}`)}}),r.on("DocProgress",M=>{var p;this.destroyed||(p=h.onProgress)==null||p.call(h,{loaded:M.loaded,total:M.total})}),r.on("FetchBuiltInCMap",M=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.cMapReaderFactory?this.cMapReaderFactory.fetch(M):Promise.reject(new Error("CMapReaderFactory not initialized, see the `useWorkerFetch` parameter."))),r.on("FetchStandardFontData",M=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.standardFontDataFactory?this.standardFontDataFactory.fetch(M):Promise.reject(new Error("StandardFontDataFactory not initialized, see the `useWorkerFetch` parameter.")))}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){var r;this.annotationStorage.size<=0&&(0,_util.warn)("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");const{map:h,transfers:M}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:h,filename:((r=this._fullReader)==null?void 0:r.filename)??null},M).finally(()=>{this.annotationStorage.resetModified()})}getPage(r){if(!Number.isInteger(r)||r<=0||r>this._numPages)return Promise.reject(new Error("Invalid page request."));const h=r-1,M=t(this,s).get(h);if(M)return M;const p=this.messageHandler.sendWithPromise("GetPage",{pageIndex:h}).then(B=>{if(this.destroyed)throw new Error("Transport destroyed");const Q=new PDFPageProxy(h,B,this,this._params.pdfBug);return t(this,G).set(h,Q),Q});return t(this,s).set(h,p),p}getPageIndex(r){return typeof r!="object"||r===null||!Number.isInteger(r.num)||r.num<0||!Number.isInteger(r.gen)||r.gen<0?Promise.reject(new Error("Invalid pageIndex request.")):this.messageHandler.sendWithPromise("GetPageIndex",{num:r.num,gen:r.gen})}getAnnotations(r,h){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:r,intent:h})}getFieldObjects(){return A(this,a,rt).call(this,"GetFieldObjects")}hasJSActions(){return A(this,a,rt).call(this,"HasJSActions")}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(r){return typeof r!="string"?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:r})}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 A(this,a,rt).call(this,"GetDocJSActions")}getPageJSActions(r){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:r})}getStructTree(r){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:r})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(){return this.messageHandler.sendWithPromise("GetOptionalContentConfig",null).then(r=>new _optional_content_config.OptionalContentConfig(r))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){const r="GetMetadata",h=t(this,o).get(r);if(h)return h;const M=this.messageHandler.sendWithPromise(r,null).then(p=>{var B,Q;return{info:p[0],metadata:p[1]?new _metadata.Metadata(p[1]):null,contentDispositionFilename:((B=this._fullReader)==null?void 0:B.filename)??null,contentLength:((Q=this._fullReader)==null?void 0:Q.contentLength)??null}});return t(this,o).set(r,M),M}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(!this.destroyed){await this.messageHandler.sendWithPromise("Cleanup",null);for(const h of t(this,G).values())if(!h.cleanup())throw new Error(`startCleanup: Page ${h.pageNumber} is currently rendering.`);this.commonObjs.clear(),r||this.fontLoader.clear(),t(this,o).clear(),this.filterFactory.destroy(!0)}}get loadingParams(){const{disableAutoFetch:r,enableXfa:h}=this._params;return(0,_util.shadow)(this,"loadingParams",{disableAutoFetch:r,enableXfa:h})}}o=new WeakMap,G=new WeakMap,s=new WeakMap,b=new WeakMap,a=new WeakSet,rt=function(lt){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;const h=t(this,o).get(lt);if(h)return h;const M=this.messageHandler.sendWithPromise(lt,r);return t(this,o).set(lt,M),M};class PDFObjects{constructor(){E(this,W),E(this,N,Object.create(null))}get(r){let h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(h){const p=A(this,W,At).call(this,r);return p.capability.promise.then(()=>h(p.data)),null}const M=t(this,N)[r];if(!(M!=null&&M.capability.settled))throw new Error(`Requesting object that isn't resolved yet ${r}.`);return M.data}has(r){const h=t(this,N)[r];return(h==null?void 0:h.capability.settled)||!1}resolve(r){let h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;const M=A(this,W,At).call(this,r);M.data=h,M.capability.resolve()}clear(){var r;for(const h in t(this,N)){const{data:M}=t(this,N)[h];(r=M==null?void 0:M.bitmap)==null||r.close()}Zl(this,N,Object.create(null))}}N=new WeakMap,W=new WeakSet,At=function(lt){var r;return(r=t(this,N))[lt]||(r[lt]={capability:new _util.PromiseCapability,data:null})};class RenderTask{constructor(r){E(this,Z,null),Zl(this,Z,r),this.onContinue=null}get promise(){return t(this,Z).capability.promise}cancel(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;t(this,Z).cancel(null,r)}get separateAnnots(){const{separateAnnots:r}=t(this,Z).operatorList;if(!r)return!1;const{annotationCanvasMap:h}=t(this,Z);return r.form||r.canvas&&(h==null?void 0:h.size)>0}}Z=new WeakMap,exports.RenderTask=RenderTask;const z=class ie{constructor(r){let{callback:h,params:M,objs:p,commonObjs:B,annotationCanvasMap:Q,operatorList:U,pageIndex:O,canvasFactory:I,filterFactory:j,useRequestAnimationFrame:q=!1,pdfBug:K=!1,pageColors:f=null}=r;this.callback=h,this.params=M,this.objs=p,this.commonObjs=B,this.annotationCanvasMap=Q,this.operatorListIdx=null,this.operatorList=U,this._pageIndex=O,this.canvasFactory=I,this.filterFactory=j,this._pdfBug=K,this.pageColors=f,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=q===!0&&typeof window<"u",this.cancelled=!1,this.capability=new _util.PromiseCapability,this.task=new RenderTask(this),this._cancelBound=this.cancel.bind(this),this._continueBound=this._continue.bind(this),this._scheduleNextBound=this._scheduleNext.bind(this),this._nextBound=this._next.bind(this),this._canvas=M.canvasContext.canvas}get completed(){return this.capability.promise.catch(function(){})}initializeGraphics(r){var h,M;let{transparency:p=!1,optionalContentConfig:B}=r;if(this.cancelled)return;if(this._canvas){if(t(ie,d).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.");t(ie,d).add(this._canvas)}this._pdfBug&&(h=globalThis.StepperManager)!=null&&h.enabled&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());const{canvasContext:Q,viewport:U,transform:O,background:I}=this.params;this.gfx=new _canvas.CanvasGraphics(Q,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:B},this.annotationCanvasMap,this.pageColors),this.gfx.beginDrawing({transform:O,viewport:U,transparency:p,background:I}),this.operatorListIdx=0,this.graphicsReady=!0,(M=this.graphicsReadyCallback)==null||M.call(this)}cancel(){var r;let h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;this.running=!1,this.cancelled=!0,(r=this.gfx)==null||r.endDrawing(),t(ie,d).delete(this._canvas),this.callback(h||new _display_utils.RenderingCancelledException(`Rendering cancelled, page ${this._pageIndex+1}`,M))}operatorListChanged(){var r;if(!this.graphicsReady){this.graphicsReadyCallback||(this.graphicsReadyCallback=this._continueBound);return}(r=this.stepper)==null||r.updateOperatorList(this.operatorList),!this.running&&this._continue()}_continue(){this.running=!0,!this.cancelled&&(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())}_scheduleNext(){this._useRequestAnimationFrame?window.requestAnimationFrame(()=>{this._nextBound().catch(this._cancelBound)}):Promise.resolve().then(this._nextBound).catch(this._cancelBound)}async _next(){this.cancelled||(this.operatorListIdx=this.gfx.executeOperatorList(this.operatorList,this.operatorListIdx,this._continueBound,this.stepper),this.operatorListIdx===this.operatorList.argsArray.length&&(this.running=!1,this.operatorList.lastChunk&&(this.gfx.endDrawing(),t(ie,d).delete(this._canvas),this.callback())))}};d=new WeakMap,E(z,d,new WeakSet);let InternalRenderTask=z;const version="3.11.174";exports.version=version;const build="ce8716743";exports.build=build},(lt,r,h)=>{var M=h(3),p=h(126),B=h(135);M({target:"Set",proto:!0,real:!0,forced:!B("difference")},{difference:p})},(lt,r,h)=>{var M=h(127),p=h(128),B=h(129),Q=h(132),U=h(133),O=h(130),I=h(131),j=p.has,q=p.remove;lt.exports=function(K){var f=M(this),S=U(K),k=B(f);return Q(f)<=S.size?O(f,function(T){S.includes(T)&&q(k,T)}):I(S.getIterator(),function(T){j(f,T)&&q(k,T)}),k}},(lt,r,h)=>{var M=h(128).has;lt.exports=function(p){return M(p),p}},(lt,r,h)=>{var M=h(14),p=Set.prototype;lt.exports={Set,add:M(p.add),has:M(p.has),remove:M(p.delete),proto:p}},(lt,r,h)=>{var M=h(128),p=h(130),B=M.Set,Q=M.add;lt.exports=function(U){var O=new B;return p(U,function(I){Q(O,I)}),O}},(lt,r,h)=>{var M=h(14),p=h(131),B=h(128),Q=B.Set,U=B.proto,O=M(U.forEach),I=M(U.keys),j=I(new Q).next;lt.exports=function(q,K,f){return f?p({iterator:I(q),next:j},K):O(q,K)}},(lt,r,h)=>{var M=h(8);lt.exports=function(p,B,Q){for(var U=Q?p:p.iterator,O=p.next,I,j;!(I=M(O,U)).done;)if(j=B(I.value),j!==void 0)return j}},(lt,r,h)=>{var M=h(72),p=h(128);lt.exports=M(p.proto,"size","get")||function(B){return B.size}},(lt,r,h)=>{var M=h(31),p=h(47),B=h(8),Q=h(62),U=h(134),O="Invalid size",I=RangeError,j=TypeError,q=Math.max,K=function(f,S,k,T){this.set=f,this.size=S,this.has=k,this.keys=T};K.prototype={getIterator:function(){return U(p(B(this.keys,this.set)))},includes:function(f){return B(this.has,this.set,f)}},lt.exports=function(f){p(f);var S=+f.size;if(S!==S)throw j(O);var k=Q(S);if(k<0)throw I(O);return new K(f,q(k,0),M(f.has),M(f.keys))}},lt=>{lt.exports=function(r){return{iterator:r,next:r.next,done:!1}}},(lt,r,h)=>{var M=h(24),p=function(B){return{size:B,has:function(){return!1},keys:function(){return{next:function(){return{done:!0}}}}}};lt.exports=function(B){var Q=M("Set");try{new Q()[B](p(0));try{return new Q()[B](p(-1)),!1}catch{return!0}}catch{return!1}}},(lt,r,h)=>{var M=h(3),p=h(7),B=h(137),Q=h(135),U=!Q("intersection")||p(function(){return Array.from(new Set([1,2,3]).intersection(new Set([3,2])))!=="3,2"});M({target:"Set",proto:!0,real:!0,forced:U},{intersection:B})},(lt,r,h)=>{var M=h(127),p=h(128),B=h(132),Q=h(133),U=h(130),O=h(131),I=p.Set,j=p.add,q=p.has;lt.exports=function(K){var f=M(this),S=Q(K),k=new I;return B(f)>S.size?O(S.getIterator(),function(T){q(f,T)&&j(k,T)}):U(f,function(T){S.includes(T)&&j(k,T)}),k}},(lt,r,h)=>{var M=h(3),p=h(139),B=h(135);M({target:"Set",proto:!0,real:!0,forced:!B("isDisjointFrom")},{isDisjointFrom:p})},(lt,r,h)=>{var M=h(127),p=h(128).has,B=h(132),Q=h(133),U=h(130),O=h(131),I=h(140);lt.exports=function(j){var q=M(this),K=Q(j);if(B(q)<=K.size)return U(q,function(S){if(K.includes(S))return!1},!0)!==!1;var f=K.getIterator();return O(f,function(S){if(p(q,S))return I(f,"normal",!1)})!==!1}},(lt,r,h)=>{var M=h(8),p=h(47),B=h(30);lt.exports=function(Q,U,O){var I,j;p(Q);try{if(I=B(Q,"return"),!I){if(U==="throw")throw O;return O}I=M(I,Q)}catch(q){j=!0,I=q}if(U==="throw")throw O;if(j)throw I;return p(I),O}},(lt,r,h)=>{var M=h(3),p=h(142),B=h(135);M({target:"Set",proto:!0,real:!0,forced:!B("isSubsetOf")},{isSubsetOf:p})},(lt,r,h)=>{var M=h(127),p=h(132),B=h(130),Q=h(133);lt.exports=function(U){var O=M(this),I=Q(U);return p(O)>I.size?!1:B(O,function(j){if(!I.includes(j))return!1},!0)!==!1}},(lt,r,h)=>{var M=h(3),p=h(144),B=h(135);M({target:"Set",proto:!0,real:!0,forced:!B("isSupersetOf")},{isSupersetOf:p})},(lt,r,h)=>{var M=h(127),p=h(128).has,B=h(132),Q=h(133),U=h(131),O=h(140);lt.exports=function(I){var j=M(this),q=Q(I);if(B(j)<q.size)return!1;var K=q.getIterator();return U(K,function(f){if(!p(j,f))return O(K,"normal",!1)})!==!1}},(lt,r,h)=>{var M=h(3),p=h(146),B=h(135);M({target:"Set",proto:!0,real:!0,forced:!B("symmetricDifference")},{symmetricDifference:p})},(lt,r,h)=>{var M=h(127),p=h(128),B=h(129),Q=h(133),U=h(131),O=p.add,I=p.has,j=p.remove;lt.exports=function(q){var K=M(this),f=Q(q).getIterator(),S=B(K);return U(f,function(k){I(K,k)?j(S,k):O(S,k)}),S}},(lt,r,h)=>{var M=h(3),p=h(148),B=h(135);M({target:"Set",proto:!0,real:!0,forced:!B("union")},{union:p})},(lt,r,h)=>{var M=h(127),p=h(128).add,B=h(129),Q=h(133),U=h(131);lt.exports=function(O){var I=M(this),j=Q(O).getIterator(),q=B(I);return U(j,function(K){p(q,K)}),q}},(lt,r,h)=>{var M=h(3),p=h(4),B=h(24),Q=h(11),U=h(45).f,O=h(39),I=h(150),j=h(75),q=h(76),K=h(151),f=h(82),S=h(6),k=h(36),T="DOMException",g=B("Error"),F=B(T),J=function(){I(this,v);var Xt=arguments.length,zt=q(Xt<1?void 0:arguments[0]),Gt=q(Xt<2?void 0:arguments[1],"Error"),Nt=new F(zt,Gt),Ut=g(zt);return Ut.name=T,U(Nt,"stack",Q(1,f(Ut.stack,1))),j(Nt,this,J),Nt},v=J.prototype=F.prototype,u="stack"in g(T),m="stack"in new F(1,2),_=F&&S&&Object.getOwnPropertyDescriptor(p,T),$=!!_&&!(_.writable&&_.configurable),P=u&&!$&&!m;M({global:!0,constructor:!0,forced:k||P},{DOMException:P?J:F});var Zt=B(T),dt=Zt.prototype;if(dt.constructor!==Zt){k||U(dt,"constructor",Q(1,Zt));for(var It in K)if(O(K,It)){var xt=K[It],it=xt.s;O(Zt,it)||U(Zt,it,Q(6,xt.c))}}},(lt,r,h)=>{var M=h(25),p=TypeError;lt.exports=function(B,Q){if(M(Q,B))return B;throw p("Incorrect invocation")}},lt=>{lt.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}}},(lt,r,h)=>{var M=h(36),p=h(3),B=h(4),Q=h(24),U=h(14),O=h(7),I=h(41),j=h(21),q=h(153),K=h(17),f=h(20),S=h(23),k=h(154),T=h(47),g=h(78),F=h(39),J=h(159),v=h(44),u=h(64),m=h(85),_=h(160),$=h(162),P=h(128),Zt=h(83),dt=h(119),It=B.Object,xt=B.Array,it=B.Date,Xt=B.Error,zt=B.EvalError,Gt=B.RangeError,Nt=B.ReferenceError,Ut=B.SyntaxError,Vt=B.TypeError,Ht=B.URIError,Pt=B.PerformanceMark,at=B.WebAssembly,R=at&&at.CompileError||Xt,w=at&&at.LinkError||Xt,X=at&&at.RuntimeError||Xt,C=Q("DOMException"),H=$.Map,st=$.has,et=$.get,Mt=$.set,Rt=P.Set,gt=P.add,Jt=Q("Object","keys"),Dt=U([].push),qt=U((!0).valueOf),vt=U(1 .valueOf),cl=U("".valueOf),bl=U(it.prototype.getTime),il=I("structuredClone"),Bt="DataCloneError",Ft="Transferring",wt=function(Lt){return!O(function(){var yt=new B.Set([7]),Kt=Lt(yt),tl=Lt(It(7));return Kt===yt||!Kt.has(7)||typeof tl!="object"||+tl!=7})&&Lt},pt=function(Lt,yt){return!O(function(){var Kt=new yt,tl=Lt({a:Kt,b:Kt});return!(tl&&tl.a===tl.b&&tl.a instanceof yt&&tl.a.stack===Kt.stack)})},Ct=function(Lt){return!O(function(){var yt=Lt(new B.AggregateError([1],il,{cause:3}));return yt.name!=="AggregateError"||yt.errors[0]!==1||yt.message!==il||yt.cause!==3})},$t=B.structuredClone,dl=M||!pt($t,Xt)||!pt($t,C)||!Ct($t),rl=!$t&&wt(function(Lt){return new Pt(il,{detail:Lt}).detail}),Yl=wt($t)||rl,Xl=function(Lt){throw new C("Uncloneable type: "+Lt,Bt)},pl=function(Lt,yt){throw new C((yt||"Cloning")+" of "+Lt+" cannot be properly polyfilled in this engine",Bt)},Ll=function(Lt,yt){return Yl||pl(yt),Yl(Lt)},yl=function(){var Lt;try{Lt=new B.DataTransfer}catch{try{Lt=new B.ClipboardEvent("").clipboardData}catch{}}return Lt&&Lt.items&&Lt.files?Lt:null},Vl=function(Lt,yt,Kt){if(st(yt,Lt))return et(yt,Lt);var tl=Kt||g(Lt),el,ol,Qt,Ml,hl,Il;if(tl==="SharedArrayBuffer")Yl?el=Yl(Lt):el=Lt;else{var Wl=B.DataView;!Wl&&typeof Lt.slice!="function"&&pl("ArrayBuffer");try{if(typeof Lt.slice=="function"&&!Lt.resizable)el=Lt.slice(0);else for(ol=Lt.byteLength,Qt=("maxByteLength"in Lt)?{maxByteLength:Lt.maxByteLength}:void 0,el=new ArrayBuffer(ol,Qt),Ml=new Wl(Lt),hl=new Wl(el),Il=0;Il<ol;Il++)hl.setUint8(Il,Ml.getUint8(Il))}catch{throw new C("ArrayBuffer is detached",Bt)}}return Mt(yt,Lt,el),el},_t=function(Lt,yt,Kt,tl,el){var ol=B[yt];return f(ol)||pl(yt),new ol(Vl(Lt.buffer,el),Kt,tl)},ot=function(Lt,yt,Kt){this.object=Lt,this.type=yt,this.metadata=Kt},ut=function(Lt,yt,Kt){if(S(Lt)&&Xl("Symbol"),!f(Lt))return Lt;if(yt){if(st(yt,Lt))return et(yt,Lt)}else yt=new H;var tl=g(Lt),el,ol,Qt,Ml,hl,Il,Wl,nt;switch(tl){case"Array":Qt=xt(u(Lt));break;case"Object":Qt={};break;case"Map":Qt=new H;break;case"Set":Qt=new Rt;break;case"RegExp":Qt=new RegExp(Lt.source,_(Lt));break;case"Error":switch(ol=Lt.name,ol){case"AggregateError":Qt=Q("AggregateError")([]);break;case"EvalError":Qt=zt();break;case"RangeError":Qt=Gt();break;case"ReferenceError":Qt=Nt();break;case"SyntaxError":Qt=Ut();break;case"TypeError":Qt=Vt();break;case"URIError":Qt=Ht();break;case"CompileError":Qt=R();break;case"LinkError":Qt=w();break;case"RuntimeError":Qt=X();break;default:Qt=Xt()}break;case"DOMException":Qt=new C(Lt.message,Lt.name);break;case"ArrayBuffer":case"SharedArrayBuffer":Qt=Kt?new ot(Lt,tl):Vl(Lt,yt,tl);break;case"DataView":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float16Array":case"Float32Array":case"Float64Array":case"BigInt64Array":case"BigUint64Array":Il=tl==="DataView"?Lt.byteLength:Lt.length,Qt=Kt?new ot(Lt,tl,{offset:Lt.byteOffset,length:Il}):_t(Lt,tl,Lt.byteOffset,Il,yt);break;case"DOMQuad":try{Qt=new DOMQuad(ut(Lt.p1,yt,Kt),ut(Lt.p2,yt,Kt),ut(Lt.p3,yt,Kt),ut(Lt.p4,yt,Kt))}catch{Qt=Ll(Lt,tl)}break;case"File":if(Yl)try{Qt=Yl(Lt),g(Qt)!==tl&&(Qt=void 0)}catch{}if(!Qt)try{Qt=new File([Lt],Lt.name,Lt)}catch{}Qt||pl(tl);break;case"FileList":if(Ml=yl(),Ml){for(hl=0,Il=u(Lt);hl<Il;hl++)Ml.items.add(ut(Lt[hl],yt,Kt));Qt=Ml.files}else Qt=Ll(Lt,tl);break;case"ImageData":try{Qt=new ImageData(ut(Lt.data,yt,Kt),Lt.width,Lt.height,{colorSpace:Lt.colorSpace})}catch{Qt=Ll(Lt,tl)}break;default:if(Yl)Qt=Yl(Lt);else switch(tl){case"BigInt":Qt=It(Lt.valueOf());break;case"Boolean":Qt=It(qt(Lt));break;case"Number":Qt=It(vt(Lt));break;case"String":Qt=It(cl(Lt));break;case"Date":Qt=new it(bl(Lt));break;case"Blob":try{Qt=Lt.slice(0,Lt.size,Lt.type)}catch{pl(tl)}break;case"DOMPoint":case"DOMPointReadOnly":el=B[tl];try{Qt=el.fromPoint?el.fromPoint(Lt):new el(Lt.x,Lt.y,Lt.z,Lt.w)}catch{pl(tl)}break;case"DOMRect":case"DOMRectReadOnly":el=B[tl];try{Qt=el.fromRect?el.fromRect(Lt):new el(Lt.x,Lt.y,Lt.width,Lt.height)}catch{pl(tl)}break;case"DOMMatrix":case"DOMMatrixReadOnly":el=B[tl];try{Qt=el.fromMatrix?el.fromMatrix(Lt):new el(Lt)}catch{pl(tl)}break;case"AudioData":case"VideoFrame":j(Lt.clone)||pl(tl);try{Qt=Lt.clone()}catch{Xl(tl)}break;case"CropTarget":case"CryptoKey":case"FileSystemDirectoryHandle":case"FileSystemFileHandle":case"FileSystemHandle":case"GPUCompilationInfo":case"GPUCompilationMessage":case"ImageBitmap":case"RTCCertificate":case"WebAssembly.Module":pl(tl);default:Xl(tl)}}switch(Mt(yt,Lt,Qt),tl){case"Array":case"Object":for(Wl=Jt(Lt),hl=0,Il=u(Wl);hl<Il;hl++)nt=Wl[hl],J(Qt,nt,ut(Lt[nt],yt,Kt));break;case"Map":Lt.forEach(function(L,ct){Mt(Qt,ut(ct,yt,Kt),ut(L,yt,Kt))});break;case"Set":Lt.forEach(function(L){gt(Qt,ut(L,yt,Kt))});break;case"Error":v(Qt,"message",ut(Lt.message,yt,Kt)),F(Lt,"cause")&&v(Qt,"cause",ut(Lt.cause,yt,Kt)),ol==="AggregateError"&&(Qt.errors=ut(Lt.errors,yt,Kt));case"DOMException":Zt&&v(Qt,"stack",ut(Lt.stack,yt,Kt))}return Qt},Tt=function(Lt,yt){if(!f(Lt))return Lt;if(st(yt,Lt))return et(yt,Lt);var Kt,tl,el,ol,Qt,Ml,hl,Il;if(Lt instanceof ot)switch(Kt=Lt.type,tl=Lt.object,Kt){case"ArrayBuffer":case"SharedArrayBuffer":Il=Vl(tl,yt,Kt);break;case"DataView":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float16Array":case"Float32Array":case"Float64Array":case"BigInt64Array":case"BigUint64Array":el=Lt.metadata,Il=_t(tl,Kt,el.offset,el.length,yt)}else switch(g(Lt)){case"Array":case"Object":for(Ml=Jt(Lt),ol=0,Qt=u(Ml);ol<Qt;ol++)hl=Ml[ol],Lt[hl]=Tt(Lt[hl],yt);break;case"Map":Il=new H,Lt.forEach(function(Wl,nt){Mt(Il,Tt(nt,yt),Tt(Wl,yt))});break;case"Set":Il=new Rt,Lt.forEach(function(Wl){gt(Il,Tt(Wl,yt))});break;case"Error":Lt.message=Tt(Lt.message,yt),F(Lt,"cause")&&(Lt.cause=Tt(Lt.cause,yt)),Lt.name==="AggregateError"&&(Lt.errors=Tt(Lt.errors,yt));case"DOMException":Zt&&(Lt.stack=Tt(Lt.stack,yt))}return Mt(yt,Lt,Il||Lt),Il||Lt},jt=function(Lt,yt){if(!f(Lt))throw Vt("Transfer option cannot be converted to a sequence");var Kt=[];k(Lt,function(L){Dt(Kt,T(L))});for(var tl=0,el=u(Kt),ol=[],Qt,Ml,hl,Il,Wl,nt;tl<el;){if(Qt=Kt[tl++],Ml=g(Qt),Ml==="ArrayBuffer"){Dt(ol,Qt);continue}if(st(yt,Qt))throw new C("Duplicate transferable",Bt);if(dt)Il=$t(Qt,{transfer:[Qt]});else switch(Ml){case"ImageBitmap":hl=B.OffscreenCanvas,q(hl)||pl(Ml,Ft);try{Wl=new hl(Qt.width,Qt.height),nt=Wl.getContext("bitmaprenderer"),nt.transferFromImageBitmap(Qt),Il=Wl.transferToImageBitmap()}catch{}break;case"AudioData":case"VideoFrame":(!j(Qt.clone)||!j(Qt.close))&&pl(Ml,Ft);try{Il=Qt.clone(),Qt.close()}catch{}break;case"MediaSourceHandle":case"MessagePort":case"OffscreenCanvas":case"ReadableStream":case"TransformStream":case"WritableStream":pl(Ml,Ft)}if(Il===void 0)throw new C("This object cannot be transferred: "+Ml,Bt);Mt(yt,Qt,Il)}return ol},Ot=function(Lt,yt){for(var Kt=0,tl=u(Lt),el,ol;Kt<tl;){if(el=Lt[Kt++],st(yt,el))throw new C("Duplicate transferable",Bt);dt?ol=$t(el,{transfer:[el]}):(j(el.transfer)||pl("ArrayBuffer",Ft),ol=el.transfer()),Mt(yt,el,ol)}};p({global:!0,enumerable:!0,sham:!dt,forced:dl},{structuredClone:function(Lt){var yt=m(arguments.length,1)>1&&!K(arguments[1])?T(arguments[1]):void 0,Kt=yt?yt.transfer:void 0,tl=!1,el,ol;Kt!==void 0&&(el=new H,ol=jt(Kt,el),tl=!!u(ol));var Qt=ut(Lt,el,tl);return tl&&(el=new H,Ot(Kt,el),Qt=Tt(Qt,el)),Qt}})},(lt,r,h)=>{var M=h(14),p=h(7),B=h(21),Q=h(78),U=h(24),O=h(51),I=function(){},j=[],q=U("Reflect","construct"),K=/^\s*(?:class|function)\b/,f=M(K.exec),S=!K.exec(I),k=function(g){if(!B(g))return!1;try{return q(I,j,g),!0}catch{return!1}},T=function(g){if(!B(g))return!1;switch(Q(g)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return S||!!f(K,O(g))}catch{return!0}};T.sham=!0,lt.exports=!q||p(function(){var g;return k(k.call)||!k(Object)||!k(function(){g=!0})||g})?T:k},(lt,r,h)=>{var M=h(99),p=h(8),B=h(47),Q=h(32),U=h(155),O=h(64),I=h(25),j=h(157),q=h(158),K=h(140),f=TypeError,S=function(T,g){this.stopped=T,this.result=g},k=S.prototype;lt.exports=function(T,g,F){var J=F&&F.that,v=!!(F&&F.AS_ENTRIES),u=!!(F&&F.IS_RECORD),m=!!(F&&F.IS_ITERATOR),_=!!(F&&F.INTERRUPTED),$=M(g,J),P,Zt,dt,It,xt,it,Xt,zt=function(Nt){return P&&K(P,"normal",Nt),new S(!0,Nt)},Gt=function(Nt){return v?(B(Nt),_?$(Nt[0],Nt[1],zt):$(Nt[0],Nt[1])):_?$(Nt,zt):$(Nt)};if(u)P=T.iterator;else if(m)P=T;else{if(Zt=q(T),!Zt)throw f(Q(T)+" is not iterable");if(U(Zt)){for(dt=0,It=O(T);It>dt;dt++)if(xt=Gt(T[dt]),xt&&I(k,xt))return xt;return new S(!1)}P=j(T,Zt)}for(it=u?T.next:P.next;!(Xt=p(it,P)).done;){try{xt=Gt(Xt.value)}catch(Nt){K(P,"throw",Nt)}if(typeof xt=="object"&&xt&&I(k,xt))return xt}return new S(!1)}},(lt,r,h)=>{var M=h(34),p=h(156),B=M("iterator"),Q=Array.prototype;lt.exports=function(U){return U!==void 0&&(p.Array===U||Q[B]===U)}},lt=>{lt.exports={}},(lt,r,h)=>{var M=h(8),p=h(31),B=h(47),Q=h(32),U=h(158),O=TypeError;lt.exports=function(I,j){var q=arguments.length<2?U(I):j;if(p(q))return B(M(q,I));throw O(Q(I)+" is not iterable")}},(lt,r,h)=>{var M=h(78),p=h(30),B=h(17),Q=h(156),U=h(34),O=U("iterator");lt.exports=function(I){if(!B(I))return p(I,O)||p(I,"@@iterator")||Q[M(I)]}},(lt,r,h)=>{var M=h(18),p=h(45),B=h(11);lt.exports=function(Q,U,O){var I=M(U);I in Q?p.f(Q,I,B(0,O)):Q[I]=O}},(lt,r,h)=>{var M=h(8),p=h(39),B=h(25),Q=h(161),U=RegExp.prototype;lt.exports=function(O){var I=O.flags;return I===void 0&&!("flags"in U)&&!p(O,"flags")&&B(U,O)?M(Q,O):I}},(lt,r,h)=>{var M=h(47);lt.exports=function(){var p=M(this),B="";return p.hasIndices&&(B+="d"),p.global&&(B+="g"),p.ignoreCase&&(B+="i"),p.multiline&&(B+="m"),p.dotAll&&(B+="s"),p.unicode&&(B+="u"),p.unicodeSets&&(B+="v"),p.sticky&&(B+="y"),B}},(lt,r,h)=>{var M=h(14),p=Map.prototype;lt.exports={Map,set:M(p.set),get:M(p.get),has:M(p.has),remove:M(p.delete),proto:p}},(lt,r,h)=>{var M,p,B,Q,U;Object.defineProperty(r,"__esModule",{value:!0}),r.SerializableEmpty=r.PrintAnnotationStorage=r.AnnotationStorage=void 0,h(89),h(149),h(152);var O=h(1),I=h(164),j=h(170);const q=Object.freeze({map:null,hash:"",transfers:void 0});r.SerializableEmpty=q;class K{constructor(){E(this,B),E(this,M,!1),E(this,p,new Map),this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(k,T){const g=t(this,p).get(k);return g===void 0?T:Object.assign(T,g)}getRawValue(k){return t(this,p).get(k)}remove(k){if(t(this,p).delete(k),t(this,p).size===0&&this.resetModified(),typeof this.onAnnotationEditor=="function"){for(const T of t(this,p).values())if(T instanceof I.AnnotationEditor)return;this.onAnnotationEditor(null)}}setValue(k,T){const g=t(this,p).get(k);let F=!1;if(g!==void 0)for(const[J,v]of Object.entries(T))g[J]!==v&&(F=!0,g[J]=v);else F=!0,t(this,p).set(k,T);F&&A(this,B,Q).call(this),T instanceof I.AnnotationEditor&&typeof this.onAnnotationEditor=="function"&&this.onAnnotationEditor(T.constructor._type)}has(k){return t(this,p).has(k)}getAll(){return t(this,p).size>0?(0,O.objectFromMap)(t(this,p)):null}setAll(k){for(const[T,g]of Object.entries(k))this.setValue(T,g)}get size(){return t(this,p).size}resetModified(){t(this,M)&&(Zl(this,M,!1),typeof this.onResetModified=="function"&&this.onResetModified())}get print(){return new f(this)}get serializable(){if(t(this,p).size===0)return q;const k=new Map,T=new j.MurmurHash3_64,g=[],F=Object.create(null);let J=!1;for(const[v,u]of t(this,p)){const m=u instanceof I.AnnotationEditor?u.serialize(!1,F):u;m&&(k.set(v,m),T.update(`${v}:${JSON.stringify(m)}`),J||(J=!!m.bitmap))}if(J)for(const v of k.values())v.bitmap&&g.push(v.bitmap);return k.size>0?{map:k,hash:T.hexdigest(),transfers:g}:q}}M=new WeakMap,p=new WeakMap,B=new WeakSet,Q=function(){t(this,M)||(Zl(this,M,!0),typeof this.onSetModified=="function"&&this.onSetModified())},r.AnnotationStorage=K;class f extends K{constructor(k){super(),E(this,U,void 0);const{map:T,hash:g,transfers:F}=k.serializable,J=structuredClone(T,null);Zl(this,U,{map:J,hash:g,transfers:F})}get print(){(0,O.unreachable)("Should not call PrintAnnotationStorage.print")}get serializable(){return t(this,U)}}U=new WeakMap,r.PrintAnnotationStorage=f},(lt,r,h)=>{var M,p,B,Q,U,O,I,j,q,K,f,S,k,T,g,F,J,v,u,m,_,$,P,Zt,dt,It,xt,it,Xt,zt,Gt,Nt;Object.defineProperty(r,"__esModule",{value:!0}),r.AnnotationEditor=void 0,h(89),h(2);var Ut=h(165),Vt=h(1),Ht=h(168);const Pt=class Fl{constructor(X){E(this,g),E(this,J),E(this,_),E(this,P),E(this,dt),E(this,xt),E(this,Xt),E(this,Gt),E(this,M,""),E(this,p,!1),E(this,B,null),E(this,Q,null),E(this,U,null),E(this,O,!1),E(this,I,null),E(this,j,this.focusin.bind(this)),E(this,q,this.focusout.bind(this)),E(this,K,!1),E(this,f,!1),E(this,S,!1),tt(this,"_initialOptions",Object.create(null)),tt(this,"_uiManager",null),tt(this,"_focusEventsAllowed",!0),tt(this,"_l10nPromise",null),E(this,k,!1),E(this,T,Fl._zIndex++),this.constructor===Fl&&(0,Vt.unreachable)("Cannot initialize AnnotationEditor."),this.parent=X.parent,this.id=X.id,this.width=this.height=null,this.pageIndex=X.parent.pageIndex,this.name=X.name,this.div=null,this._uiManager=X.uiManager,this.annotationElementId=null,this._willKeepAspectRatio=!1,this._initialOptions.isCentered=X.isCentered,this._structTreeParentId=null;const{rotation:C,rawDims:{pageWidth:H,pageHeight:st,pageX:et,pageY:Mt}}=this.parent.viewport;this.rotation=C,this.pageRotation=(360+C-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[H,st],this.pageTranslation=[et,Mt];const[Rt,gt]=this.parentDimensions;this.x=X.x/Rt,this.y=X.y/gt,this.isAttachedToDOM=!1,this.deleted=!1}get editorType(){return Object.getPrototypeOf(this).constructor._type}static get _defaultLineColor(){return(0,Vt.shadow)(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(X){const C=new R({id:X.parent.getNextId(),parent:X.parent,uiManager:X._uiManager});C.annotationElementId=X.annotationElementId,C.deleted=!0,C._uiManager.addToAnnotationStorage(C)}static initialize(X){let C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(Fl._l10nPromise||(Fl._l10nPromise=new Map(["editor_alt_text_button_label","editor_alt_text_edit_button_label","editor_alt_text_decorative_tooltip"].map(st=>[st,X.get(st)]))),C!=null&&C.strings)for(const st of C.strings)Fl._l10nPromise.set(st,X.get(st));if(Fl._borderLineWidth!==-1)return;const H=getComputedStyle(document.documentElement);Fl._borderLineWidth=parseFloat(H.getPropertyValue("--outline-width"))||0}static updateDefaultParams(X,C){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(X){return!1}static paste(X,C){(0,Vt.unreachable)("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return t(this,k)}set _isDraggable(X){var C;Zl(this,k,X),(C=this.div)==null||C.classList.toggle("draggable",X)}center(){const[X,C]=this.pageDimensions;switch(this.parentRotation){case 90:this.x-=this.height*C/(X*2),this.y+=this.width*X/(C*2);break;case 180:this.x+=this.width/2,this.y+=this.height/2;break;case 270:this.x+=this.height*C/(X*2),this.y-=this.width*X/(C*2);break;default:this.x-=this.width/2,this.y-=this.height/2;break}this.fixAndSetPosition()}addCommands(X){this._uiManager.addCommands(X)}get currentLayer(){return this._uiManager.currentLayer}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=t(this,T)}setParent(X){X!==null&&(this.pageIndex=X.pageIndex,this.pageDimensions=X.pageDimensions),this.parent=X}focusin(X){this._focusEventsAllowed&&(t(this,K)?Zl(this,K,!1):this.parent.setSelected(this))}focusout(X){var C;if(!this._focusEventsAllowed||!this.isAttachedToDOM)return;const H=X.relatedTarget;H!=null&&H.closest(`#${this.id}`)||(X.preventDefault(),(C=this.parent)!=null&&C.isMultipleSelection||this.commitOrRemove())}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}setAt(X,C,H,st){const[et,Mt]=this.parentDimensions;[H,st]=this.screenToPageTranslation(H,st),this.x=(X+H)/et,this.y=(C+st)/Mt,this.fixAndSetPosition()}translate(X,C){A(this,g,F).call(this,this.parentDimensions,X,C)}translateInPage(X,C){A(this,g,F).call(this,this.pageDimensions,X,C),this.div.scrollIntoView({block:"nearest"})}drag(X,C){const[H,st]=this.parentDimensions;if(this.x+=X/H,this.y+=C/st,this.parent&&(this.x<0||this.x>1||this.y<0||this.y>1)){const{x:Jt,y:Dt}=this.div.getBoundingClientRect();this.parent.findNewParent(this,Jt,Dt)&&(this.x-=Math.floor(this.x),this.y-=Math.floor(this.y))}let{x:et,y:Mt}=this;const[Rt,gt]=A(this,J,v).call(this);et+=Rt,Mt+=gt,this.div.style.left=`${(100*et).toFixed(2)}%`,this.div.style.top=`${(100*Mt).toFixed(2)}%`,this.div.scrollIntoView({block:"nearest"})}fixAndSetPosition(){const[X,C]=this.pageDimensions;let{x:H,y:st,width:et,height:Mt}=this;switch(et*=X,Mt*=C,H*=X,st*=C,this.rotation){case 0:H=Math.max(0,Math.min(X-et,H)),st=Math.max(0,Math.min(C-Mt,st));break;case 90:H=Math.max(0,Math.min(X-Mt,H)),st=Math.min(C,Math.max(et,st));break;case 180:H=Math.min(X,Math.max(et,H)),st=Math.min(C,Math.max(Mt,st));break;case 270:H=Math.min(X,Math.max(Mt,H)),st=Math.max(0,Math.min(C-et,st));break}this.x=H/=X,this.y=st/=C;const[Rt,gt]=A(this,J,v).call(this);H+=Rt,st+=gt;const{style:Jt}=this.div;Jt.left=`${(100*H).toFixed(2)}%`,Jt.top=`${(100*st).toFixed(2)}%`,this.moveInDOM()}screenToPageTranslation(X,C){var H;return A(H=Fl,u,m).call(H,X,C,this.parentRotation)}pageTranslationToScreen(X,C){var H;return A(H=Fl,u,m).call(H,X,C,360-this.parentRotation)}get parentScale(){return this._uiManager.viewParameters.realScale}get parentRotation(){return(this._uiManager.viewParameters.rotation+this.pageRotation)%360}get parentDimensions(){const{parentScale:X,pageDimensions:[C,H]}=this,st=C*X,et=H*X;return Vt.FeatureTest.isCSSRoundSupported?[Math.round(st),Math.round(et)]:[st,et]}setDims(X,C){var H;const[st,et]=this.parentDimensions;this.div.style.width=`${(100*X/st).toFixed(2)}%`,t(this,O)||(this.div.style.height=`${(100*C/et).toFixed(2)}%`),(H=t(this,B))==null||H.classList.toggle("small",X<Fl.SMALL_EDITOR_SIZE||C<Fl.SMALL_EDITOR_SIZE)}fixDims(){const{style:X}=this.div,{height:C,width:H}=X,st=H.endsWith("%"),et=!t(this,O)&&C.endsWith("%");if(st&&et)return;const[Mt,Rt]=this.parentDimensions;st||(X.width=`${(100*parseFloat(H)/Mt).toFixed(2)}%`),!t(this,O)&&!et&&(X.height=`${(100*parseFloat(C)/Rt).toFixed(2)}%`)}getInitialTranslation(){return[0,0]}async addAltTextButton(){if(t(this,B))return;const X=Zl(this,B,document.createElement("button"));X.className="altText";const C=await Fl._l10nPromise.get("editor_alt_text_button_label");X.textContent=C,X.setAttribute("aria-label",C),X.tabIndex="0",X.addEventListener("contextmenu",Ht.noContextMenu),X.addEventListener("pointerdown",H=>H.stopPropagation()),X.addEventListener("click",H=>{H.preventDefault(),this._uiManager.editAltText(this)},{capture:!0}),X.addEventListener("keydown",H=>{H.target===X&&H.key==="Enter"&&(H.preventDefault(),this._uiManager.editAltText(this))}),A(this,Xt,zt).call(this),this.div.append(X),Fl.SMALL_EDITOR_SIZE||(Fl.SMALL_EDITOR_SIZE=Math.min(128,Math.round(X.getBoundingClientRect().width*1.4)))}getClientDimensions(){return this.div.getBoundingClientRect()}get altTextData(){return{altText:t(this,M),decorative:t(this,p)}}set altTextData(X){let{altText:C,decorative:H}=X;t(this,M)===C&&t(this,p)===H||(Zl(this,M,C),Zl(this,p,H),A(this,Xt,zt).call(this))}render(){this.div=document.createElement("div"),this.div.setAttribute("data-editor-rotation",(360-this.rotation)%360),this.div.className=this.name,this.div.setAttribute("id",this.id),this.div.setAttribute("tabIndex",0),this.setInForeground(),this.div.addEventListener("focusin",t(this,j)),this.div.addEventListener("focusout",t(this,q));const[X,C]=this.parentDimensions;this.parentRotation%180!==0&&(this.div.style.maxWidth=`${(100*C/X).toFixed(2)}%`,this.div.style.maxHeight=`${(100*X/C).toFixed(2)}%`);const[H,st]=this.getInitialTranslation();return this.translate(H,st),(0,Ut.bindEvents)(this,this.div,["pointerdown"]),this.div}pointerdown(X){const{isMac:C}=Vt.FeatureTest.platform;if(X.button!==0||X.ctrlKey&&C){X.preventDefault();return}Zl(this,K,!0),A(this,Gt,Nt).call(this,X)}moveInDOM(){var X;(X=this.parent)==null||X.moveEditorInDOM(this)}_setParentAndPosition(X,C,H){X.changeParent(this),this.x=C,this.y=H,this.fixAndSetPosition()}getRect(X,C){const H=this.parentScale,[st,et]=this.pageDimensions,[Mt,Rt]=this.pageTranslation,gt=X/H,Jt=C/H,Dt=this.x*st,qt=this.y*et,vt=this.width*st,cl=this.height*et;switch(this.rotation){case 0:return[Dt+gt+Mt,et-qt-Jt-cl+Rt,Dt+gt+vt+Mt,et-qt-Jt+Rt];case 90:return[Dt+Jt+Mt,et-qt+gt+Rt,Dt+Jt+cl+Mt,et-qt+gt+vt+Rt];case 180:return[Dt-gt-vt+Mt,et-qt+Jt+Rt,Dt-gt+Mt,et-qt+Jt+cl+Rt];case 270:return[Dt-Jt-cl+Mt,et-qt-gt-vt+Rt,Dt-Jt+Mt,et-qt-gt+Rt];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(X,C){const[H,st,et,Mt]=X,Rt=et-H,gt=Mt-st;switch(this.rotation){case 0:return[H,C-Mt,Rt,gt];case 90:return[H,C-st,gt,Rt];case 180:return[et,C-st,Rt,gt];case 270:return[et,C-Mt,gt,Rt];default:throw new Error("Invalid rotation")}}onceAdded(){}isEmpty(){return!1}enableEditMode(){Zl(this,S,!0)}disableEditMode(){Zl(this,S,!1)}isInEditMode(){return t(this,S)}shouldGetKeyboardEvents(){return!1}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}rebuild(){var X,C;(X=this.div)==null||X.addEventListener("focusin",t(this,j)),(C=this.div)==null||C.addEventListener("focusout",t(this,q))}serialize(){(0,Vt.unreachable)("An editor must be serializable")}static deserialize(X,C,H){const st=new this.prototype.constructor({parent:C,id:C.getNextId(),uiManager:H});st.rotation=X.rotation;const[et,Mt]=st.pageDimensions,[Rt,gt,Jt,Dt]=st.getRectInCurrentCoords(X.rect,Mt);return st.x=Rt/et,st.y=gt/Mt,st.width=Jt/et,st.height=Dt/Mt,st}remove(){var X;this.div.removeEventListener("focusin",t(this,j)),this.div.removeEventListener("focusout",t(this,q)),this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),(X=t(this,B))==null||X.remove(),Zl(this,B,null),Zl(this,Q,null)}get isResizable(){return!1}makeResizable(){this.isResizable&&(A(this,P,Zt).call(this),t(this,I).classList.remove("hidden"))}select(){var X;this.makeResizable(),(X=this.div)==null||X.classList.add("selectedEditor")}unselect(){var X,C,H;(X=t(this,I))==null||X.classList.add("hidden"),(C=this.div)==null||C.classList.remove("selectedEditor"),(H=this.div)!=null&&H.contains(document.activeElement)&&this._uiManager.currentLayer.div.focus()}updateParams(X,C){}disableEditing(){t(this,B)&&(t(this,B).hidden=!0)}enableEditing(){t(this,B)&&(t(this,B).hidden=!1)}enterInEditMode(){}get contentDiv(){return this.div}get isEditing(){return t(this,f)}set isEditing(X){Zl(this,f,X),this.parent&&(X?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null))}setAspectRatio(X,C){Zl(this,O,!0);const H=X/C,{style:st}=this.div;st.aspectRatio=H,st.height="auto"}static get MIN_SIZE(){return 16}};M=new WeakMap,p=new WeakMap,B=new WeakMap,Q=new WeakMap,U=new WeakMap,O=new WeakMap,I=new WeakMap,j=new WeakMap,q=new WeakMap,K=new WeakMap,f=new WeakMap,S=new WeakMap,k=new WeakMap,T=new WeakMap,g=new WeakSet,F=function(w,X,C){let[H,st]=w;[X,C]=this.screenToPageTranslation(X,C),this.x+=X/H,this.y+=C/st,this.fixAndSetPosition()},J=new WeakSet,v=function(){const[w,X]=this.parentDimensions,{_borderLineWidth:C}=Pt,H=C/w,st=C/X;switch(this.rotation){case 90:return[-H,st];case 180:return[H,st];case 270:return[H,-st];default:return[-H,-st]}},u=new WeakSet,m=function(w,X,C){switch(C){case 90:return[X,-w];case 180:return[-w,-X];case 270:return[-X,w];default:return[w,X]}},_=new WeakSet,$=function(w){switch(w){case 90:{const[X,C]=this.pageDimensions;return[0,-X/C,C/X,0]}case 180:return[-1,0,0,-1];case 270:{const[X,C]=this.pageDimensions;return[0,X/C,-C/X,0]}default:return[1,0,0,1]}},P=new WeakSet,Zt=function(){if(t(this,I))return;Zl(this,I,document.createElement("div")),t(this,I).classList.add("resizers");const w=["topLeft","topRight","bottomRight","bottomLeft"];this._willKeepAspectRatio||w.push("topMiddle","middleRight","bottomMiddle","middleLeft");for(const X of w){const C=document.createElement("div");t(this,I).append(C),C.classList.add("resizer",X),C.addEventListener("pointerdown",A(this,dt,It).bind(this,X)),C.addEventListener("contextmenu",Ht.noContextMenu)}this.div.prepend(t(this,I))},dt=new WeakSet,It=function(w,X){X.preventDefault();const{isMac:C}=Vt.FeatureTest.platform;if(X.button!==0||X.ctrlKey&&C)return;const H=A(this,xt,it).bind(this,w),st=this._isDraggable;this._isDraggable=!1;const et={passive:!0,capture:!0};window.addEventListener("pointermove",H,et);const Mt=this.x,Rt=this.y,gt=this.width,Jt=this.height,Dt=this.parent.div.style.cursor,qt=this.div.style.cursor;this.div.style.cursor=this.parent.div.style.cursor=window.getComputedStyle(X.target).cursor;const vt=()=>{this._isDraggable=st,window.removeEventListener("pointerup",vt),window.removeEventListener("blur",vt),window.removeEventListener("pointermove",H,et),this.parent.div.style.cursor=Dt,this.div.style.cursor=qt;const cl=this.x,bl=this.y,il=this.width,Bt=this.height;cl===Mt&&bl===Rt&&il===gt&&Bt===Jt||this.addCommands({cmd:()=>{this.width=il,this.height=Bt,this.x=cl,this.y=bl;const[Ft,wt]=this.parentDimensions;this.setDims(Ft*il,wt*Bt),this.fixAndSetPosition()},undo:()=>{this.width=gt,this.height=Jt,this.x=Mt,this.y=Rt;const[Ft,wt]=this.parentDimensions;this.setDims(Ft*gt,wt*Jt),this.fixAndSetPosition()},mustExec:!0})};window.addEventListener("pointerup",vt),window.addEventListener("blur",vt)},xt=new WeakSet,it=function(w,X){const[C,H]=this.parentDimensions,st=this.x,et=this.y,Mt=this.width,Rt=this.height,gt=Pt.MIN_SIZE/C,Jt=Pt.MIN_SIZE/H,Dt=ut=>Math.round(ut*1e4)/1e4,qt=A(this,_,$).call(this,this.rotation),vt=(ut,Tt)=>[qt[0]*ut+qt[2]*Tt,qt[1]*ut+qt[3]*Tt],cl=A(this,_,$).call(this,360-this.rotation),bl=(ut,Tt)=>[cl[0]*ut+cl[2]*Tt,cl[1]*ut+cl[3]*Tt];let il,Bt,Ft=!1,wt=!1;switch(w){case"topLeft":Ft=!0,il=(ut,Tt)=>[0,0],Bt=(ut,Tt)=>[ut,Tt];break;case"topMiddle":il=(ut,Tt)=>[ut/2,0],Bt=(ut,Tt)=>[ut/2,Tt];break;case"topRight":Ft=!0,il=(ut,Tt)=>[ut,0],Bt=(ut,Tt)=>[0,Tt];break;case"middleRight":wt=!0,il=(ut,Tt)=>[ut,Tt/2],Bt=(ut,Tt)=>[0,Tt/2];break;case"bottomRight":Ft=!0,il=(ut,Tt)=>[ut,Tt],Bt=(ut,Tt)=>[0,0];break;case"bottomMiddle":il=(ut,Tt)=>[ut/2,Tt],Bt=(ut,Tt)=>[ut/2,0];break;case"bottomLeft":Ft=!0,il=(ut,Tt)=>[0,Tt],Bt=(ut,Tt)=>[ut,0];break;case"middleLeft":wt=!0,il=(ut,Tt)=>[0,Tt/2],Bt=(ut,Tt)=>[ut,Tt/2];break}const pt=il(Mt,Rt),Ct=Bt(Mt,Rt);let $t=vt(...Ct);const dl=Dt(st+$t[0]),rl=Dt(et+$t[1]);let Yl=1,Xl=1,[pl,Ll]=this.screenToPageTranslation(X.movementX,X.movementY);if([pl,Ll]=bl(pl/C,Ll/H),Ft){const ut=Math.hypot(Mt,Rt);Yl=Xl=Math.max(Math.min(Math.hypot(Ct[0]-pt[0]-pl,Ct[1]-pt[1]-Ll)/ut,1/Mt,1/Rt),gt/Mt,Jt/Rt)}else wt?Yl=Math.max(gt,Math.min(1,Math.abs(Ct[0]-pt[0]-pl)))/Mt:Xl=Math.max(Jt,Math.min(1,Math.abs(Ct[1]-pt[1]-Ll)))/Rt;const yl=Dt(Mt*Yl),Vl=Dt(Rt*Xl);$t=vt(...Bt(yl,Vl));const _t=dl-$t[0],ot=rl-$t[1];this.width=yl,this.height=Vl,this.x=_t,this.y=ot,this.setDims(C*yl,H*Vl),this.fixAndSetPosition()},Xt=new WeakSet,zt=async function(){var w;const X=t(this,B);if(!X)return;if(!t(this,M)&&!t(this,p)){X.classList.remove("done"),(w=t(this,Q))==null||w.remove();return}Pt._l10nPromise.get("editor_alt_text_edit_button_label").then(H=>{X.setAttribute("aria-label",H)});let C=t(this,Q);if(!C){Zl(this,Q,C=document.createElement("span")),C.className="tooltip",C.setAttribute("role","tooltip");const H=C.id=`alt-text-tooltip-${this.id}`;X.setAttribute("aria-describedby",H);const st=100;X.addEventListener("mouseenter",()=>{Zl(this,U,setTimeout(()=>{Zl(this,U,null),t(this,Q).classList.add("show"),this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",subtype:this.editorType,data:{action:"alt_text_tooltip"}}})},st))}),X.addEventListener("mouseleave",()=>{var et;clearTimeout(t(this,U)),Zl(this,U,null),(et=t(this,Q))==null||et.classList.remove("show")})}X.classList.add("done"),C.innerText=t(this,p)?await Pt._l10nPromise.get("editor_alt_text_decorative_tooltip"):t(this,M),C.parentNode||X.append(C)},Gt=new WeakSet,Nt=function(w){if(!this._isDraggable)return;const X=this._uiManager.isSelected(this);this._uiManager.setUpDragSession();let C,H;X&&(C={passive:!0,capture:!0},H=et=>{const[Mt,Rt]=this.screenToPageTranslation(et.movementX,et.movementY);this._uiManager.dragSelectedEditors(Mt,Rt)},window.addEventListener("pointermove",H,C));const st=()=>{if(window.removeEventListener("pointerup",st),window.removeEventListener("blur",st),X&&window.removeEventListener("pointermove",H,C),Zl(this,K,!1),!this._uiManager.endDragSession()){const{isMac:et}=Vt.FeatureTest.platform;w.ctrlKey&&!et||w.shiftKey||w.metaKey&&et?this.parent.toggleSelected(this):this.parent.setSelected(this)}};window.addEventListener("pointerup",st),window.addEventListener("blur",st)},E(Pt,u),tt(Pt,"_borderLineWidth",-1),tt(Pt,"_colorManager",new Ut.ColorManager),tt(Pt,"_zIndex",1),tt(Pt,"SMALL_EDITOR_SIZE",0);let at=Pt;r.AnnotationEditor=at;class R extends at{constructor(X){super(X),this.annotationElementId=X.annotationElementId,this.deleted=!0}serialize(){return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex}}}},(lt,r,h)=>{var M,p,B,Q,U,O,I,j,q,K,f,S,k,T,g,F,J,v,u,m,_,$,P,Zt,dt,It,xt,it,Xt,zt,Gt,Nt,Ut,Vt,Ht,Pt,at,R,w,X,C,H,st,et,Mt,Rt,gt,Jt,Dt,qt,vt,cl,bl,il,Bt,Ft,wt,pt,Ct,$t,dl,rl,Yl,Xl,pl,Ll,yl,Vl,_t,ot,ut,Tt;Object.defineProperty(r,"__esModule",{value:!0}),r.KeyboardManager=r.CommandManager=r.ColorManager=r.AnnotationEditorUIManager=void 0,r.bindEvents=Lt,r.opacityToHex=yt,h(93),h(101),h(102),h(105),h(107),h(109),h(113),h(116),h(123),h(2),h(89),h(125),h(136),h(138),h(141),h(143),h(145),h(147),h(166);var jt=h(1),Ot=h(168);function Lt(nt,L,ct){for(const Wt of ct)L.addEventListener(Wt,nt[Wt].bind(nt))}function yt(nt){return Math.round(Math.min(255,Math.max(1,255*nt))).toString(16).padStart(2,"0")}class Kt{constructor(){E(this,M,0)}getId(){return`${jt.AnnotationEditorPrefix}${mt(this,M)._++}`}}M=new WeakMap;const tl=class{constructor(){E(this,U),E(this,p,(0,jt.getUuid)()),E(this,B,0),E(this,Q,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>',ct=new OffscreenCanvas(1,3).getContext("2d"),Wt=new Image;Wt.src=L;const Yt=Wt.decode().then(()=>(ct.drawImage(Wt,0,0,1,1,0,0,1,3),new Uint32Array(ct.getImageData(0,0,1,1).data.buffer)[0]===0));return(0,jt.shadow)(this,"_isSVGFittingCanvas",Yt)}async getFromFile(L){const{lastModified:ct,name:Wt,size:Yt,type:kt}=L;return A(this,U,O).call(this,`${ct}_${Wt}_${Yt}_${kt}`,L)}async getFromUrl(L){return A(this,U,O).call(this,L,L)}async getFromId(L){t(this,Q)||Zl(this,Q,new Map);const ct=t(this,Q).get(L);return ct?ct.bitmap?(ct.refCounter+=1,ct):ct.file?this.getFromFile(ct.file):this.getFromUrl(ct.url):null}getSvgUrl(L){const ct=t(this,Q).get(L);return ct!=null&&ct.isSvg?ct.svgUrl:null}deleteId(L){t(this,Q)||Zl(this,Q,new Map);const ct=t(this,Q).get(L);ct&&(ct.refCounter-=1,ct.refCounter===0&&(ct.bitmap=null))}isValidId(L){return L.startsWith(`image_${t(this,p)}_`)}};p=new WeakMap,B=new WeakMap,Q=new WeakMap,U=new WeakSet,O=async function(nt,L){t(this,Q)||Zl(this,Q,new Map);let ct=t(this,Q).get(nt);if(ct===null)return null;if(ct!=null&&ct.bitmap)return ct.refCounter+=1,ct;try{ct||(ct={bitmap:null,id:`image_${t(this,p)}_${mt(this,B)._++}`,refCounter:0,isSvg:!1});let Wt;if(typeof L=="string"){ct.url=L;const Yt=await fetch(L);if(!Yt.ok)throw new Error(Yt.statusText);Wt=await Yt.blob()}else Wt=ct.file=L;if(Wt.type==="image/svg+xml"){const Yt=tl._isSVGFittingCanvas,kt=new FileReader,Et=new Image,sl=new Promise((ml,al)=>{Et.onload=()=>{ct.bitmap=Et,ct.isSvg=!0,ml()},kt.onload=async()=>{const zl=ct.svgUrl=kt.result;Et.src=await Yt?`${zl}#svgView(preserveAspectRatio(none))`:zl},Et.onerror=kt.onerror=al});kt.readAsDataURL(Wt),await sl}else ct.bitmap=await createImageBitmap(Wt);ct.refCounter=1}catch(Wt){console.error(Wt),ct=null}return t(this,Q).set(nt,ct),ct&&t(this,Q).set(ct.id,ct),ct};let el=tl;class ol{constructor(){E(this,I,[]),E(this,j,!1),E(this,q,void 0),E(this,K,-1);let L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:128;Zl(this,q,L)}add(L){let{cmd:ct,undo:Wt,mustExec:Yt,type:kt=NaN,overwriteIfSameType:Et=!1,keepUndo:sl=!1}=L;if(Yt&&ct(),t(this,j))return;const ml={cmd:ct,undo:Wt,type:kt};if(t(this,K)===-1){t(this,I).length>0&&(t(this,I).length=0),Zl(this,K,0),t(this,I).push(ml);return}if(Et&&t(this,I)[t(this,K)].type===kt){sl&&(ml.undo=t(this,I)[t(this,K)].undo),t(this,I)[t(this,K)]=ml;return}const al=t(this,K)+1;al===t(this,q)?t(this,I).splice(0,1):(Zl(this,K,al),al<t(this,I).length&&t(this,I).splice(al)),t(this,I).push(ml)}undo(){t(this,K)!==-1&&(Zl(this,j,!0),t(this,I)[t(this,K)].undo(),Zl(this,j,!1),Zl(this,K,t(this,K)-1))}redo(){t(this,K)<t(this,I).length-1&&(Zl(this,K,t(this,K)+1),Zl(this,j,!0),t(this,I)[t(this,K)].cmd(),Zl(this,j,!1))}hasSomethingToUndo(){return t(this,K)!==-1}hasSomethingToRedo(){return t(this,K)<t(this,I).length-1}destroy(){Zl(this,I,null)}}I=new WeakMap,j=new WeakMap,q=new WeakMap,K=new WeakMap,r.CommandManager=ol;class Qt{constructor(L){E(this,f),this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;const{isMac:ct}=jt.FeatureTest.platform;for(const[Wt,Yt,kt={}]of L)for(const Et of Wt){const sl=Et.startsWith("mac+");ct&&sl?(this.callbacks.set(Et.slice(4),{callback:Yt,options:kt}),this.allKeys.add(Et.split("+").at(-1))):!ct&&!sl&&(this.callbacks.set(Et,{callback:Yt,options:kt}),this.allKeys.add(Et.split("+").at(-1)))}}exec(L,ct){if(!this.allKeys.has(ct.key))return;const Wt=this.callbacks.get(A(this,f,S).call(this,ct));if(!Wt)return;const{callback:Yt,options:{bubbles:kt=!1,args:Et=[],checker:sl=null}}=Wt;sl&&!sl(L,ct)||(Yt.bind(L,...Et)(),kt||(ct.stopPropagation(),ct.preventDefault()))}}f=new WeakSet,S=function(nt){nt.altKey&&this.buffer.push("alt"),nt.ctrlKey&&this.buffer.push("ctrl"),nt.metaKey&&this.buffer.push("meta"),nt.shiftKey&&this.buffer.push("shift"),this.buffer.push(nt.key);const L=this.buffer.join("+");return this.buffer.length=0,L},r.KeyboardManager=Qt;const Ml=class Fs{get _colors(){const L=new Map([["CanvasText",null],["Canvas",null]]);return(0,Ot.getColorValues)(L),(0,jt.shadow)(this,"_colors",L)}convert(L){const ct=(0,Ot.getRGB)(L);if(!window.matchMedia("(forced-colors: active)").matches)return ct;for(const[Wt,Yt]of this._colors)if(Yt.every((kt,Et)=>kt===ct[Et]))return Fs._colorsMapping.get(Wt);return ct}getHexCode(L){const ct=this._colors.get(L);return ct?jt.Util.makeHexColor(...ct):L}};tt(Ml,"_colorsMapping",new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]));let hl=Ml;r.ColorManager=hl;const Il=class ls{constructor(L,ct,Wt,Yt,kt,Et){E(this,gt),E(this,Dt),E(this,vt),E(this,bl),E(this,Bt),E(this,wt),E(this,Ct),E(this,dl),E(this,Yl),E(this,pl),E(this,yl),E(this,_t),E(this,ut),E(this,k,null),E(this,T,new Map),E(this,g,new Map),E(this,F,null),E(this,J,null),E(this,v,new ol),E(this,u,0),E(this,m,new Set),E(this,_,null),E(this,$,null),E(this,P,new Set),E(this,Zt,null),E(this,dt,new Kt),E(this,It,!1),E(this,xt,!1),E(this,it,null),E(this,Xt,jt.AnnotationEditorType.NONE),E(this,zt,new Set),E(this,Gt,null),E(this,Nt,this.blur.bind(this)),E(this,Ut,this.focus.bind(this)),E(this,Vt,this.copy.bind(this)),E(this,Ht,this.cut.bind(this)),E(this,Pt,this.paste.bind(this)),E(this,at,this.keydown.bind(this)),E(this,R,this.onEditingAction.bind(this)),E(this,w,this.onPageChanging.bind(this)),E(this,X,this.onScaleChanging.bind(this)),E(this,C,this.onRotationChanging.bind(this)),E(this,H,{isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1}),E(this,st,[0,0]),E(this,et,null),E(this,Mt,null),E(this,Rt,null),Zl(this,Mt,L),Zl(this,Rt,ct),Zl(this,F,Wt),this._eventBus=Yt,this._eventBus._on("editingaction",t(this,R)),this._eventBus._on("pagechanging",t(this,w)),this._eventBus._on("scalechanging",t(this,X)),this._eventBus._on("rotationchanging",t(this,C)),Zl(this,J,kt.annotationStorage),Zl(this,Zt,kt.filterFactory),Zl(this,Gt,Et),this.viewParameters={realScale:Ot.PixelsPerInch.PDF_TO_CSS_UNITS,rotation:0}}static get _keyboardManager(){const L=ls.prototype,ct=kt=>{const{activeElement:Et}=document;return Et&&t(kt,Mt).contains(Et)&&kt.hasSomethingToControl()},Wt=this.TRANSLATE_SMALL,Yt=this.TRANSLATE_BIG;return(0,jt.shadow)(this,"_keyboardManager",new Qt([[["ctrl+a","mac+meta+a"],L.selectAll],[["ctrl+z","mac+meta+z"],L.undo],[["ctrl+y","ctrl+shift+z","mac+meta+shift+z","ctrl+shift+Z","mac+meta+shift+Z"],L.redo],[["Backspace","alt+Backspace","ctrl+Backspace","shift+Backspace","mac+Backspace","mac+alt+Backspace","mac+ctrl+Backspace","Delete","ctrl+Delete","shift+Delete","mac+Delete"],L.delete],[["Escape","mac+Escape"],L.unselectAll],[["ArrowLeft","mac+ArrowLeft"],L.translateSelectedEditors,{args:[-Wt,0],checker:ct}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],L.translateSelectedEditors,{args:[-Yt,0],checker:ct}],[["ArrowRight","mac+ArrowRight"],L.translateSelectedEditors,{args:[Wt,0],checker:ct}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],L.translateSelectedEditors,{args:[Yt,0],checker:ct}],[["ArrowUp","mac+ArrowUp"],L.translateSelectedEditors,{args:[0,-Wt],checker:ct}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],L.translateSelectedEditors,{args:[0,-Yt],checker:ct}],[["ArrowDown","mac+ArrowDown"],L.translateSelectedEditors,{args:[0,Wt],checker:ct}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],L.translateSelectedEditors,{args:[0,Yt],checker:ct}]]))}destroy(){A(this,bl,il).call(this),A(this,Dt,qt).call(this),this._eventBus._off("editingaction",t(this,R)),this._eventBus._off("pagechanging",t(this,w)),this._eventBus._off("scalechanging",t(this,X)),this._eventBus._off("rotationchanging",t(this,C));for(const L of t(this,g).values())L.destroy();t(this,g).clear(),t(this,T).clear(),t(this,P).clear(),Zl(this,k,null),t(this,zt).clear(),t(this,v).destroy(),t(this,F).destroy()}get hcmFilter(){return(0,jt.shadow)(this,"hcmFilter",t(this,Gt)?t(this,Zt).addHCMFilter(t(this,Gt).foreground,t(this,Gt).background):"none")}get direction(){return(0,jt.shadow)(this,"direction",getComputedStyle(t(this,Mt)).direction)}editAltText(L){var ct;(ct=t(this,F))==null||ct.editAltText(this,L)}onPageChanging(L){let{pageNumber:ct}=L;Zl(this,u,ct-1)}focusMainContainer(){t(this,Mt).focus()}findParent(L,ct){for(const Wt of t(this,g).values()){const{x:Yt,y:kt,width:Et,height:sl}=Wt.div.getBoundingClientRect();if(L>=Yt&&L<=Yt+Et&&ct>=kt&&ct<=kt+sl)return Wt}return null}disableUserSelect(){let L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;t(this,Rt).classList.toggle("noUserSelect",L)}addShouldRescale(L){t(this,P).add(L)}removeShouldRescale(L){t(this,P).delete(L)}onScaleChanging(L){let{scale:ct}=L;this.commitOrRemove(),this.viewParameters.realScale=ct*Ot.PixelsPerInch.PDF_TO_CSS_UNITS;for(const Wt of t(this,P))Wt.onScaleChanging()}onRotationChanging(L){let{pagesRotation:ct}=L;this.commitOrRemove(),this.viewParameters.rotation=ct}addToAnnotationStorage(L){!L.isEmpty()&&t(this,J)&&!t(this,J).has(L.id)&&t(this,J).setValue(L.id,L)}blur(){if(!this.hasSelection)return;const{activeElement:L}=document;for(const ct of t(this,zt))if(ct.div.contains(L)){Zl(this,it,[ct,L]),ct._focusEventsAllowed=!1;break}}focus(){if(!t(this,it))return;const[L,ct]=t(this,it);Zl(this,it,null),ct.addEventListener("focusin",()=>{L._focusEventsAllowed=!0},{once:!0}),ct.focus()}addEditListeners(){A(this,vt,cl).call(this),A(this,Bt,Ft).call(this)}removeEditListeners(){A(this,bl,il).call(this),A(this,wt,pt).call(this)}copy(L){var ct;if(L.preventDefault(),(ct=t(this,k))==null||ct.commitOrRemove(),!this.hasSelection)return;const Wt=[];for(const Yt of t(this,zt)){const kt=Yt.serialize(!0);kt&&Wt.push(kt)}Wt.length!==0&&L.clipboardData.setData("application/pdfjs",JSON.stringify(Wt))}cut(L){this.copy(L),this.delete()}paste(L){L.preventDefault();const{clipboardData:ct}=L;for(const kt of ct.items)for(const Et of t(this,$))if(Et.isHandlingMimeForPasting(kt.type)){Et.paste(kt,this.currentLayer);return}let Wt=ct.getData("application/pdfjs");if(!Wt)return;try{Wt=JSON.parse(Wt)}catch(kt){(0,jt.warn)(`paste: "${kt.message}".`);return}if(!Array.isArray(Wt))return;this.unselectAll();const Yt=this.currentLayer;try{const kt=[];for(const ml of Wt){const al=Yt.deserialize(ml);if(!al)return;kt.push(al)}const Et=()=>{for(const ml of kt)A(this,yl,Vl).call(this,ml);A(this,ut,Tt).call(this,kt)},sl=()=>{for(const ml of kt)ml.remove()};this.addCommands({cmd:Et,undo:sl,mustExec:!0})}catch(kt){(0,jt.warn)(`paste: "${kt.message}".`)}}keydown(L){var ct;(ct=this.getActive())!=null&&ct.shouldGetKeyboardEvents()||ls._keyboardManager.exec(this,L)}onEditingAction(L){["undo","redo","delete","selectAll"].includes(L.name)&&this[L.name]()}setEditingState(L){L?(A(this,gt,Jt).call(this),A(this,vt,cl).call(this),A(this,Bt,Ft).call(this),A(this,Ct,$t).call(this,{isEditing:t(this,Xt)!==jt.AnnotationEditorType.NONE,isEmpty:A(this,_t,ot).call(this),hasSomethingToUndo:t(this,v).hasSomethingToUndo(),hasSomethingToRedo:t(this,v).hasSomethingToRedo(),hasSelectedEditor:!1})):(A(this,Dt,qt).call(this),A(this,bl,il).call(this),A(this,wt,pt).call(this),A(this,Ct,$t).call(this,{isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(L){if(!t(this,$)){Zl(this,$,L);for(const ct of t(this,$))A(this,dl,rl).call(this,ct.defaultPropertiesToUpdate)}}getId(){return t(this,dt).getId()}get currentLayer(){return t(this,g).get(t(this,u))}getLayer(L){return t(this,g).get(L)}get currentPageIndex(){return t(this,u)}addLayer(L){t(this,g).set(L.pageIndex,L),t(this,It)?L.enable():L.disable()}removeLayer(L){t(this,g).delete(L.pageIndex)}updateMode(L){let ct=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(t(this,Xt)!==L){if(Zl(this,Xt,L),L===jt.AnnotationEditorType.NONE){this.setEditingState(!1),A(this,pl,Ll).call(this);return}this.setEditingState(!0),A(this,Yl,Xl).call(this),this.unselectAll();for(const Wt of t(this,g).values())Wt.updateMode(L);if(ct){for(const Wt of t(this,T).values())if(Wt.annotationElementId===ct){this.setSelected(Wt),Wt.enterInEditMode();break}}}}updateToolbar(L){L!==t(this,Xt)&&this._eventBus.dispatch("switchannotationeditormode",{source:this,mode:L})}updateParams(L,ct){if(t(this,$)){if(L===jt.AnnotationEditorParamsType.CREATE){this.currentLayer.addNewEditor(L);return}for(const Wt of t(this,zt))Wt.updateParams(L,ct);for(const Wt of t(this,$))Wt.updateDefaultParams(L,ct)}}enableWaiting(){let L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(t(this,xt)!==L){Zl(this,xt,L);for(const ct of t(this,g).values())L?ct.disableClick():ct.enableClick(),ct.div.classList.toggle("waiting",L)}}getEditors(L){const ct=[];for(const Wt of t(this,T).values())Wt.pageIndex===L&&ct.push(Wt);return ct}getEditor(L){return t(this,T).get(L)}addEditor(L){t(this,T).set(L.id,L)}removeEditor(L){var ct;t(this,T).delete(L.id),this.unselect(L),(!L.annotationElementId||!t(this,m).has(L.annotationElementId))&&((ct=t(this,J))==null||ct.remove(L.id))}addDeletedAnnotationElement(L){t(this,m).add(L.annotationElementId),L.deleted=!0}isDeletedAnnotationElement(L){return t(this,m).has(L)}removeDeletedAnnotationElement(L){t(this,m).delete(L.annotationElementId),L.deleted=!1}setActiveEditor(L){t(this,k)!==L&&(Zl(this,k,L),L&&A(this,dl,rl).call(this,L.propertiesToUpdate))}toggleSelected(L){if(t(this,zt).has(L)){t(this,zt).delete(L),L.unselect(),A(this,Ct,$t).call(this,{hasSelectedEditor:this.hasSelection});return}t(this,zt).add(L),L.select(),A(this,dl,rl).call(this,L.propertiesToUpdate),A(this,Ct,$t).call(this,{hasSelectedEditor:!0})}setSelected(L){for(const ct of t(this,zt))ct!==L&&ct.unselect();t(this,zt).clear(),t(this,zt).add(L),L.select(),A(this,dl,rl).call(this,L.propertiesToUpdate),A(this,Ct,$t).call(this,{hasSelectedEditor:!0})}isSelected(L){return t(this,zt).has(L)}unselect(L){L.unselect(),t(this,zt).delete(L),A(this,Ct,$t).call(this,{hasSelectedEditor:this.hasSelection})}get hasSelection(){return t(this,zt).size!==0}undo(){t(this,v).undo(),A(this,Ct,$t).call(this,{hasSomethingToUndo:t(this,v).hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:A(this,_t,ot).call(this)})}redo(){t(this,v).redo(),A(this,Ct,$t).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:t(this,v).hasSomethingToRedo(),isEmpty:A(this,_t,ot).call(this)})}addCommands(L){t(this,v).add(L),A(this,Ct,$t).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:A(this,_t,ot).call(this)})}delete(){if(this.commitOrRemove(),!this.hasSelection)return;const L=[...t(this,zt)],ct=()=>{for(const Yt of L)Yt.remove()},Wt=()=>{for(const Yt of L)A(this,yl,Vl).call(this,Yt)};this.addCommands({cmd:ct,undo:Wt,mustExec:!0})}commitOrRemove(){var L;(L=t(this,k))==null||L.commitOrRemove()}hasSomethingToControl(){return t(this,k)||this.hasSelection}selectAll(){for(const L of t(this,zt))L.commit();A(this,ut,Tt).call(this,t(this,T).values())}unselectAll(){if(t(this,k)){t(this,k).commitOrRemove();return}if(this.hasSelection){for(const L of t(this,zt))L.unselect();t(this,zt).clear(),A(this,Ct,$t).call(this,{hasSelectedEditor:!1})}}translateSelectedEditors(L,ct){if(arguments.length>2&&arguments[2]!==void 0&&arguments[2]||this.commitOrRemove(),!this.hasSelection)return;t(this,st)[0]+=L,t(this,st)[1]+=ct;const[Wt,Yt]=t(this,st),kt=[...t(this,zt)];t(this,et)&&clearTimeout(t(this,et)),Zl(this,et,setTimeout(()=>{Zl(this,et,null),t(this,st)[0]=t(this,st)[1]=0,this.addCommands({cmd:()=>{for(const sl of kt)t(this,T).has(sl.id)&&sl.translateInPage(Wt,Yt)},undo:()=>{for(const sl of kt)t(this,T).has(sl.id)&&sl.translateInPage(-Wt,-Yt)},mustExec:!1})},1e3));for(const sl of kt)sl.translateInPage(L,ct)}setUpDragSession(){if(this.hasSelection){this.disableUserSelect(!0),Zl(this,_,new Map);for(const L of t(this,zt))t(this,_).set(L,{savedX:L.x,savedY:L.y,savedPageIndex:L.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!t(this,_))return!1;this.disableUserSelect(!1);const L=t(this,_);Zl(this,_,null);let ct=!1;for(const[{x:Yt,y:kt,pageIndex:Et},sl]of L)sl.newX=Yt,sl.newY=kt,sl.newPageIndex=Et,ct||(ct=Yt!==sl.savedX||kt!==sl.savedY||Et!==sl.savedPageIndex);if(!ct)return!1;const Wt=(Yt,kt,Et,sl)=>{if(t(this,T).has(Yt.id)){const ml=t(this,g).get(sl);ml?Yt._setParentAndPosition(ml,kt,Et):(Yt.pageIndex=sl,Yt.x=kt,Yt.y=Et)}};return this.addCommands({cmd:()=>{for(const[Yt,{newX:kt,newY:Et,newPageIndex:sl}]of L)Wt(Yt,kt,Et,sl)},undo:()=>{for(const[Yt,{savedX:kt,savedY:Et,savedPageIndex:sl}]of L)Wt(Yt,kt,Et,sl)},mustExec:!0}),!0}dragSelectedEditors(L,ct){if(t(this,_))for(const Wt of t(this,_).keys())Wt.drag(L,ct)}rebuild(L){if(L.parent===null){const ct=this.getLayer(L.pageIndex);ct?(ct.changeParent(L),ct.addOrRebuild(L)):(this.addEditor(L),this.addToAnnotationStorage(L),L.rebuild())}else L.parent.addOrRebuild(L)}isActive(L){return t(this,k)===L}getActive(){return t(this,k)}getMode(){return t(this,Xt)}get imageManager(){return(0,jt.shadow)(this,"imageManager",new el)}};k=new WeakMap,T=new WeakMap,g=new WeakMap,F=new WeakMap,J=new WeakMap,v=new WeakMap,u=new WeakMap,m=new WeakMap,_=new WeakMap,$=new WeakMap,P=new WeakMap,Zt=new WeakMap,dt=new WeakMap,It=new WeakMap,xt=new WeakMap,it=new WeakMap,Xt=new WeakMap,zt=new WeakMap,Gt=new WeakMap,Nt=new WeakMap,Ut=new WeakMap,Vt=new WeakMap,Ht=new WeakMap,Pt=new WeakMap,at=new WeakMap,R=new WeakMap,w=new WeakMap,X=new WeakMap,C=new WeakMap,H=new WeakMap,st=new WeakMap,et=new WeakMap,Mt=new WeakMap,Rt=new WeakMap,gt=new WeakSet,Jt=function(){window.addEventListener("focus",t(this,Ut)),window.addEventListener("blur",t(this,Nt))},Dt=new WeakSet,qt=function(){window.removeEventListener("focus",t(this,Ut)),window.removeEventListener("blur",t(this,Nt))},vt=new WeakSet,cl=function(){window.addEventListener("keydown",t(this,at),{capture:!0})},bl=new WeakSet,il=function(){window.removeEventListener("keydown",t(this,at),{capture:!0})},Bt=new WeakSet,Ft=function(){document.addEventListener("copy",t(this,Vt)),document.addEventListener("cut",t(this,Ht)),document.addEventListener("paste",t(this,Pt))},wt=new WeakSet,pt=function(){document.removeEventListener("copy",t(this,Vt)),document.removeEventListener("cut",t(this,Ht)),document.removeEventListener("paste",t(this,Pt))},Ct=new WeakSet,$t=function(nt){Object.entries(nt).some(L=>{let[ct,Wt]=L;return t(this,H)[ct]!==Wt})&&this._eventBus.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(t(this,H),nt)})},dl=new WeakSet,rl=function(nt){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:nt})},Yl=new WeakSet,Xl=function(){if(!t(this,It)){Zl(this,It,!0);for(const nt of t(this,g).values())nt.enable()}},pl=new WeakSet,Ll=function(){if(this.unselectAll(),t(this,It)){Zl(this,It,!1);for(const nt of t(this,g).values())nt.disable()}},yl=new WeakSet,Vl=function(nt){const L=t(this,g).get(nt.pageIndex);L?L.addOrRebuild(nt):this.addEditor(nt)},_t=new WeakSet,ot=function(){if(t(this,T).size===0)return!0;if(t(this,T).size===1)for(const nt of t(this,T).values())return nt.isEmpty();return!1},ut=new WeakSet,Tt=function(nt){t(this,zt).clear();for(const L of nt)L.isEmpty()||(t(this,zt).add(L),L.select());A(this,Ct,$t).call(this,{hasSelectedEditor:!0})},tt(Il,"TRANSLATE_SMALL",1),tt(Il,"TRANSLATE_BIG",10);let Wl=Il;r.AnnotationEditorUIManager=Wl},(lt,r,h)=>{var M=h(3),p=h(6),B=h(4),Q=h(24),U=h(14),O=h(8),I=h(21),j=h(20),q=h(91),K=h(39),f=h(77),S=h(64),k=h(159),T=h(7),g=h(167),F=h(27),J=B.JSON,v=B.Number,u=B.SyntaxError,m=J&&J.parse,_=Q("Object","keys"),$=Object.getOwnPropertyDescriptor,P=U("".charAt),Zt=U("".slice),dt=U(/./.exec),It=U([].push),xt=/^\d$/,it=/^[1-9]$/,Xt=/^(?:-|\d)$/,zt=/^[\t\n\r ]$/,Gt=0,Nt=1,Ut=function(X,C){X=f(X);var H=new at(X,0),st=H.parse(),et=st.value,Mt=H.skip(zt,st.end);if(Mt<X.length)throw u('Unexpected extra character: "'+P(X,Mt)+'" after the parsed data at: '+Mt);return I(C)?Vt({"":et},"",C,st):et},Vt=function(X,C,H,st){var et=X[C],Mt=st&&et===st.value,Rt=Mt&&typeof st.source=="string"?{source:st.source}:{},gt,Jt,Dt,qt,vt;if(j(et)){var cl=q(et),bl=Mt?st.nodes:cl?[]:{};if(cl)for(gt=bl.length,Dt=S(et),qt=0;qt<Dt;qt++)Ht(et,qt,Vt(et,""+qt,H,qt<gt?bl[qt]:void 0));else for(Jt=_(et),Dt=S(Jt),qt=0;qt<Dt;qt++)vt=Jt[qt],Ht(et,vt,Vt(et,vt,H,K(bl,vt)?bl[vt]:void 0))}return O(H,X,C,et,Rt)},Ht=function(X,C,H){if(p){var st=$(X,C);if(st&&!st.configurable)return}H===void 0?delete X[C]:k(X,C,H)},Pt=function(X,C,H,st){this.value=X,this.end=C,this.source=H,this.nodes=st},at=function(X,C){this.source=X,this.index=C};at.prototype={fork:function(X){return new at(this.source,X)},parse:function(){var X=this.source,C=this.skip(zt,this.index),H=this.fork(C),st=P(X,C);if(dt(Xt,st))return H.number();switch(st){case"{":return H.object();case"[":return H.array();case'"':return H.string();case"t":return H.keyword(!0);case"f":return H.keyword(!1);case"n":return H.keyword(null)}throw u('Unexpected character: "'+st+'" at: '+C)},node:function(X,C,H,st,et){return new Pt(C,st,X?null:Zt(this.source,H,st),et)},object:function(){for(var X=this.source,C=this.index+1,H=!1,st={},et={};C<X.length;){if(C=this.until(['"',"}"],C),P(X,C)==="}"&&!H){C++;break}var Mt=this.fork(C).string(),Rt=Mt.value;C=Mt.end,C=this.until([":"],C)+1,C=this.skip(zt,C),Mt=this.fork(C).parse(),k(et,Rt,Mt),k(st,Rt,Mt.value),C=this.until([",","}"],Mt.end);var gt=P(X,C);if(gt===",")H=!0,C++;else if(gt==="}"){C++;break}}return this.node(Nt,st,this.index,C,et)},array:function(){for(var X=this.source,C=this.index+1,H=!1,st=[],et=[];C<X.length;){if(C=this.skip(zt,C),P(X,C)==="]"&&!H){C++;break}var Mt=this.fork(C).parse();if(It(et,Mt),It(st,Mt.value),C=this.until([",","]"],Mt.end),P(X,C)===",")H=!0,C++;else if(P(X,C)==="]"){C++;break}}return this.node(Nt,st,this.index,C,et)},string:function(){var X=this.index,C=g(this.source,this.index+1);return this.node(Gt,C.value,X,C.end)},number:function(){var X=this.source,C=this.index,H=C;if(P(X,H)==="-"&&H++,P(X,H)==="0")H++;else if(dt(it,P(X,H)))H=this.skip(xt,++H);else throw u("Failed to parse number at: "+H);if(P(X,H)==="."&&(H=this.skip(xt,++H)),P(X,H)==="e"||P(X,H)==="E"){H++,(P(X,H)==="+"||P(X,H)==="-")&&H++;var st=H;if(H=this.skip(xt,H),st===H)throw u("Failed to parse number's exponent value at: "+H)}return this.node(Gt,v(Zt(X,C,H)),C,H)},keyword:function(X){var C=""+X,H=this.index,st=H+C.length;if(Zt(this.source,H,st)!==C)throw u("Failed to parse value at: "+H);return this.node(Gt,X,H,st)},skip:function(X,C){for(var H=this.source;C<H.length&&dt(X,P(H,C));C++);return C},until:function(X,C){C=this.skip(zt,C);for(var H=P(this.source,C),st=0;st<X.length;st++)if(X[st]===H)return C;throw u('Unexpected character: "'+H+'" at: '+C)}};var R=T(function(){var X="9007199254740993",C;return m(X,function(H,st,et){C=et.source}),C!==X}),w=F&&!T(function(){return 1/m("-0 ")!==-1/0});M({target:"JSON",stat:!0,forced:R},{parse:function(X,C){return w&&!I(C)?m(X):Ut(X,C)}})},(lt,r,h)=>{var M=h(14),p=h(39),B=SyntaxError,Q=parseInt,U=String.fromCharCode,O=M("".charAt),I=M("".slice),j=M(/./.exec),q={'\\"':'"',"\\\\":"\\","\\/":"/","\\b":"\b","\\f":"\f","\\n":`
|
|
8
|
+
`))||null;ml&&this.data.comb&&(ml=ml.replaceAll(/\s+/g,""));const al={userValue:Et,formattedValue:ml,lastCommittedValue:null,commitKey:1,focused:!1};this.data.multiLine?(ct=document.createElement("textarea"),ct.textContent=ml??Et,this.data.doNotScroll&&(ct.style.overflowY="hidden")):(ct=document.createElement("input"),ct.type="text",ct.setAttribute("value",ml??Et),this.data.doNotScroll&&(ct.style.overflowX="hidden")),this.data.hasOwnCanvas&&(ct.hidden=!0),q.add(ct),ct.setAttribute("data-element-id",L),ct.disabled=this.data.readOnly,ct.name=this.data.fieldName,ct.tabIndex=I,this._setRequired(ct,this.data.required),sl&&(ct.maxLength=sl),ct.addEventListener("input",Gl=>{nt.setValue(L,{value:Gl.target.value}),this.setPropertyOnSiblings(ct,"value",Gl.target.value,"value"),al.formattedValue=null}),ct.addEventListener("resetform",Gl=>{const Nl=this.data.defaultFieldValue??"";ct.value=al.userValue=Nl,al.formattedValue=null});let zl=Gl=>{const{formattedValue:Nl}=al;Nl!=null&&(Gl.target.value=Nl),Gl.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){ct.addEventListener("focus",Nl=>{if(al.focused)return;const{target:Tl}=Nl;al.userValue&&(Tl.value=al.userValue),al.lastCommittedValue=Tl.value,al.commitKey=1,al.focused=!0}),ct.addEventListener("updatefromsandbox",Nl=>{this.showElementAndHideCanvas(Nl.target);const Tl={value(Rl){al.userValue=Rl.detail.value??"",nt.setValue(L,{value:al.userValue.toString()}),Rl.target.value=al.userValue},formattedValue(Rl){const{formattedValue:Sl}=Rl.detail;al.formattedValue=Sl,Sl!=null&&Rl.target!==document.activeElement&&(Rl.target.value=Sl),nt.setValue(L,{formattedValue:Sl})},selRange(Rl){Rl.target.setSelectionRange(...Rl.detail.selRange)},charLimit:Rl=>{var xl;const{charLimit:Sl}=Rl.detail,{target:wl}=Rl;if(Sl===0){wl.removeAttribute("maxLength");return}wl.setAttribute("maxLength",Sl);let kl=al.userValue;!kl||kl.length<=Sl||(kl=kl.slice(0,Sl),wl.value=al.userValue=kl,nt.setValue(L,{value:kl}),(xl=this.linkService.eventBus)==null||xl.dispatch("dispatcheventinsandbox",{source:this,detail:{id:L,name:"Keystroke",value:kl,willCommit:!0,commitKey:1,selStart:wl.selectionStart,selEnd:wl.selectionEnd}}))}};this._dispatchEventFromSandbox(Tl,Nl)}),ct.addEventListener("keydown",Nl=>{var Sl;al.commitKey=1;let Tl=-1;if(Nl.key==="Escape"?Tl=0:Nl.key==="Enter"&&!this.data.multiLine?Tl=2:Nl.key==="Tab"&&(al.commitKey=3),Tl===-1)return;const{value:Rl}=Nl.target;al.lastCommittedValue!==Rl&&(al.lastCommittedValue=Rl,al.userValue=Rl,(Sl=this.linkService.eventBus)==null||Sl.dispatch("dispatcheventinsandbox",{source:this,detail:{id:L,name:"Keystroke",value:Rl,willCommit:!0,commitKey:Tl,selStart:Nl.target.selectionStart,selEnd:Nl.target.selectionEnd}}))});const Gl=zl;zl=null,ct.addEventListener("blur",Nl=>{var Rl;if(!al.focused||!Nl.relatedTarget)return;al.focused=!1;const{value:Tl}=Nl.target;al.userValue=Tl,al.lastCommittedValue!==Tl&&((Rl=this.linkService.eventBus)==null||Rl.dispatch("dispatcheventinsandbox",{source:this,detail:{id:L,name:"Keystroke",value:Tl,willCommit:!0,commitKey:al.commitKey,selStart:Nl.target.selectionStart,selEnd:Nl.target.selectionEnd}})),Gl(Nl)}),(Yt=this.data.actions)!=null&&Yt.Keystroke&&ct.addEventListener("beforeinput",Nl=>{var Cl;al.lastCommittedValue=null;const{data:Tl,target:Rl}=Nl,{value:Sl,selectionStart:wl,selectionEnd:kl}=Rl;let xl=wl,Dl=kl;switch(Nl.inputType){case"deleteWordBackward":{const jl=Sl.substring(0,wl).match(/\w*[^\w]*$/);jl&&(xl-=jl[0].length);break}case"deleteWordForward":{const jl=Sl.substring(wl).match(/^[^\w]*\w*/);jl&&(Dl+=jl[0].length);break}case"deleteContentBackward":wl===kl&&(xl-=1);break;case"deleteContentForward":wl===kl&&(Dl+=1);break}Nl.preventDefault(),(Cl=this.linkService.eventBus)==null||Cl.dispatch("dispatcheventinsandbox",{source:this,detail:{id:L,name:"Keystroke",value:Sl,change:Tl||"",willCommit:!1,selStart:xl,selEnd:Dl}})}),this._setEventListeners(ct,al,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],Nl=>Nl.target.value)}if(zl&&ct.addEventListener("blur",zl),this.data.comb){const Nl=(this.data.rect[2]-this.data.rect[0])/sl;ct.classList.add("comb"),ct.style.letterSpacing=`calc(${Nl}px * var(--scale-factor) - 1ch)`}}else ct=document.createElement("div"),ct.textContent=this.data.fieldValue,ct.style.verticalAlign="middle",ct.style.display="table-cell";return this._setTextStyle(ct),this._setBackgroundColor(ct),this._setDefaultPropertiesFromJS(ct),this.container.append(ct),this.container}}class J extends g{constructor(nt){super(nt,{isRenderable:!!nt.data.hasOwnCanvas})}}class v extends g{constructor(nt){super(nt,{isRenderable:nt.renderForms})}render(){const nt=this.annotationStorage,L=this.data,ct=L.id;let Wt=nt.getValue(ct,{value:L.exportValue===L.fieldValue}).value;typeof Wt=="string"&&(Wt=Wt!=="Off",nt.setValue(ct,{value:Wt})),this.container.classList.add("buttonWidgetAnnotation","checkBox");const Yt=document.createElement("input");return q.add(Yt),Yt.setAttribute("data-element-id",ct),Yt.disabled=L.readOnly,this._setRequired(Yt,this.data.required),Yt.type="checkbox",Yt.name=L.fieldName,Wt&&Yt.setAttribute("checked",!0),Yt.setAttribute("exportValue",L.exportValue),Yt.tabIndex=I,Yt.addEventListener("change",kt=>{const{name:Et,checked:sl}=kt.target;for(const ml of this._getElementsByName(Et,ct)){const al=sl&&ml.exportValue===L.exportValue;ml.domElement&&(ml.domElement.checked=al),nt.setValue(ml.id,{value:al})}nt.setValue(ct,{value:sl})}),Yt.addEventListener("resetform",kt=>{const Et=L.defaultFieldValue||"Off";kt.target.checked=Et===L.exportValue}),this.enableScripting&&this.hasJSActions&&(Yt.addEventListener("updatefromsandbox",kt=>{const Et={value(sl){sl.target.checked=sl.detail.value!=="Off",nt.setValue(ct,{value:sl.target.checked})}};this._dispatchEventFromSandbox(Et,kt)}),this._setEventListeners(Yt,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],kt=>kt.target.checked)),this._setBackgroundColor(Yt),this._setDefaultPropertiesFromJS(Yt),this.container.append(Yt),this.container}}class u extends g{constructor(nt){super(nt,{isRenderable:nt.renderForms})}render(){this.container.classList.add("buttonWidgetAnnotation","radioButton");const nt=this.annotationStorage,L=this.data,ct=L.id;let Wt=nt.getValue(ct,{value:L.fieldValue===L.buttonValue}).value;typeof Wt=="string"&&(Wt=Wt!==L.buttonValue,nt.setValue(ct,{value:Wt}));const Yt=document.createElement("input");if(q.add(Yt),Yt.setAttribute("data-element-id",ct),Yt.disabled=L.readOnly,this._setRequired(Yt,this.data.required),Yt.type="radio",Yt.name=L.fieldName,Wt&&Yt.setAttribute("checked",!0),Yt.tabIndex=I,Yt.addEventListener("change",kt=>{const{name:Et,checked:sl}=kt.target;for(const ml of this._getElementsByName(Et,ct))nt.setValue(ml.id,{value:!1});nt.setValue(ct,{value:sl})}),Yt.addEventListener("resetform",kt=>{const Et=L.defaultFieldValue;kt.target.checked=Et!=null&&Et===L.buttonValue}),this.enableScripting&&this.hasJSActions){const kt=L.buttonValue;Yt.addEventListener("updatefromsandbox",Et=>{const sl={value:ml=>{const al=kt===ml.detail.value;for(const zl of this._getElementsByName(ml.target.name)){const Gl=al&&zl.id===ct;zl.domElement&&(zl.domElement.checked=Gl),nt.setValue(zl.id,{value:Gl})}}};this._dispatchEventFromSandbox(sl,Et)}),this._setEventListeners(Yt,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],Et=>Et.target.checked)}return this._setBackgroundColor(Yt),this._setDefaultPropertiesFromJS(Yt),this.container.append(Yt),this.container}}class m extends k{constructor(nt){super(nt,{ignoreBorder:nt.data.hasAppearance})}render(){const nt=super.render();nt.classList.add("buttonWidgetAnnotation","pushButton"),this.data.alternativeText&&(nt.title=this.data.alternativeText);const L=nt.lastChild;return this.enableScripting&&this.hasJSActions&&L&&(this._setDefaultPropertiesFromJS(L),L.addEventListener("updatefromsandbox",ct=>{this._dispatchEventFromSandbox({},ct)})),nt}}class _ extends g{constructor(nt){super(nt,{isRenderable:nt.renderForms})}render(){this.container.classList.add("choiceWidgetAnnotation");const nt=this.annotationStorage,L=this.data.id,ct=nt.getValue(L,{value:this.data.fieldValue}),Wt=document.createElement("select");q.add(Wt),Wt.setAttribute("data-element-id",L),Wt.disabled=this.data.readOnly,this._setRequired(Wt,this.data.required),Wt.name=this.data.fieldName,Wt.tabIndex=I;let Yt=this.data.combo&&this.data.options.length>0;this.data.combo||(Wt.size=this.data.options.length,this.data.multiSelect&&(Wt.multiple=!0)),Wt.addEventListener("resetform",al=>{const zl=this.data.defaultFieldValue;for(const Gl of Wt.options)Gl.selected=Gl.value===zl});for(const al of this.data.options){const zl=document.createElement("option");zl.textContent=al.displayValue,zl.value=al.exportValue,ct.value.includes(al.exportValue)&&(zl.setAttribute("selected",!0),Yt=!1),Wt.append(zl)}let kt=null;if(Yt){const al=document.createElement("option");al.value=" ",al.setAttribute("hidden",!0),al.setAttribute("selected",!0),Wt.prepend(al),kt=()=>{al.remove(),Wt.removeEventListener("input",kt),kt=null},Wt.addEventListener("input",kt)}const Et=al=>{const zl=al?"value":"textContent",{options:Gl,multiple:Nl}=Wt;return Nl?Array.prototype.filter.call(Gl,Tl=>Tl.selected).map(Tl=>Tl[zl]):Gl.selectedIndex===-1?null:Gl[Gl.selectedIndex][zl]};let sl=Et(!1);const ml=al=>{const zl=al.target.options;return Array.prototype.map.call(zl,Gl=>({displayValue:Gl.textContent,exportValue:Gl.value}))};return this.enableScripting&&this.hasJSActions?(Wt.addEventListener("updatefromsandbox",al=>{const zl={value(Gl){kt==null||kt();const Nl=Gl.detail.value,Tl=new Set(Array.isArray(Nl)?Nl:[Nl]);for(const Rl of Wt.options)Rl.selected=Tl.has(Rl.value);nt.setValue(L,{value:Et(!0)}),sl=Et(!1)},multipleSelection(Gl){Wt.multiple=!0},remove(Gl){const Nl=Wt.options,Tl=Gl.detail.remove;Nl[Tl].selected=!1,Wt.remove(Tl),Nl.length>0&&Array.prototype.findIndex.call(Nl,Sl=>Sl.selected)===-1&&(Nl[0].selected=!0),nt.setValue(L,{value:Et(!0),items:ml(Gl)}),sl=Et(!1)},clear(Gl){for(;Wt.length!==0;)Wt.remove(0);nt.setValue(L,{value:null,items:[]}),sl=Et(!1)},insert(Gl){const{index:Nl,displayValue:Tl,exportValue:Rl}=Gl.detail.insert,Sl=Wt.children[Nl],wl=document.createElement("option");wl.textContent=Tl,wl.value=Rl,Sl?Sl.before(wl):Wt.append(wl),nt.setValue(L,{value:Et(!0),items:ml(Gl)}),sl=Et(!1)},items(Gl){const{items:Nl}=Gl.detail;for(;Wt.length!==0;)Wt.remove(0);for(const Tl of Nl){const{displayValue:Rl,exportValue:Sl}=Tl,wl=document.createElement("option");wl.textContent=Rl,wl.value=Sl,Wt.append(wl)}Wt.options.length>0&&(Wt.options[0].selected=!0),nt.setValue(L,{value:Et(!0),items:ml(Gl)}),sl=Et(!1)},indices(Gl){const Nl=new Set(Gl.detail.indices);for(const Tl of Gl.target.options)Tl.selected=Nl.has(Tl.index);nt.setValue(L,{value:Et(!0)}),sl=Et(!1)},editable(Gl){Gl.target.disabled=!Gl.detail.editable}};this._dispatchEventFromSandbox(zl,al)}),Wt.addEventListener("input",al=>{var Gl;const zl=Et(!0);nt.setValue(L,{value:zl}),al.preventDefault(),(Gl=this.linkService.eventBus)==null||Gl.dispatch("dispatcheventinsandbox",{source:this,detail:{id:L,name:"Keystroke",value:sl,changeEx:zl,willCommit:!1,commitKey:1,keyDown:!1}})}),this._setEventListeners(Wt,null,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"],["input","Action"],["input","Validate"]],al=>al.target.value)):Wt.addEventListener("input",function(al){nt.setValue(L,{value:Et(!0)})}),this.data.combo&&this._setTextStyle(Wt),this._setBackgroundColor(Wt),this._setDefaultPropertiesFromJS(Wt),this.container.append(Wt),this.container}}class $ extends S{constructor(nt){const{data:L,elements:ct}=nt;super(nt,{isRenderable:S._hasPopupData(L)}),this.elements=ct}render(){this.container.classList.add("popupAnnotation");const nt=new P({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}),L=[];for(const ct of this.elements)ct.popup=nt,L.push(ct.data.id),ct.addHighlightArea();return this.container.setAttribute("aria-controls",L.map(ct=>`${M.AnnotationPrefix}${ct}`).join(",")),this.container}}class P{constructor({container:nt,color:L,elements:ct,titleObj:Wt,modificationDate:Yt,contentsObj:kt,richText:Et,parent:sl,rect:ml,parentRect:al,open:zl}){ll(this,rl);ll(this,Xl);ll(this,Ll);ll(this,Vl);ll(this,Mt,null);ll(this,Rt,nl(this,rl,Ns).bind(this));ll(this,gt,nl(this,Vl,ve).bind(this));ll(this,Jt,nl(this,Ll,Ke).bind(this));ll(this,Dt,nl(this,Xl,oe).bind(this));ll(this,qt,null);ll(this,vt,null);ll(this,cl,null);ll(this,bl,null);ll(this,il,null);ll(this,Bt,null);ll(this,Ft,!1);ll(this,wt,null);ll(this,pt,null);ll(this,Ct,null);ll(this,$t,null);ll(this,dl,!1);var Nl;ul(this,vt,nt),ul(this,$t,Wt),ul(this,cl,kt),ul(this,Ct,Et),ul(this,il,sl),ul(this,qt,L),ul(this,pt,ml),ul(this,Bt,al),ul(this,bl,ct);const Gl=p.PDFDateString.toDateObject(Yt);Gl&&ul(this,Mt,sl.l10n.get("annotation_date_string",{date:Gl.toLocaleDateString(),time:Gl.toLocaleTimeString()})),this.trigger=ct.flatMap(Tl=>Tl.getElementsToTriggerPopup());for(const Tl of this.trigger)Tl.addEventListener("click",bt(this,Dt)),Tl.addEventListener("mouseenter",bt(this,Jt)),Tl.addEventListener("mouseleave",bt(this,gt)),Tl.classList.add("popupTriggerArea");for(const Tl of ct)(Nl=Tl.container)==null||Nl.addEventListener("keydown",bt(this,Rt));bt(this,vt).hidden=!0,zl&&nl(this,Xl,oe).call(this)}render(){if(bt(this,wt))return;const{page:{view:nt},viewport:{rawDims:{pageWidth:L,pageHeight:ct,pageX:Wt,pageY:Yt}}}=bt(this,il),kt=ul(this,wt,document.createElement("div"));if(kt.className="popup",bt(this,qt)){const xl=kt.style.outlineColor=M.Util.makeHexColor(...bt(this,qt));CSS.supports("background-color","color-mix(in srgb, red 30%, white)")?kt.style.backgroundColor=`color-mix(in srgb, ${xl} 30%, white)`:kt.style.backgroundColor=M.Util.makeHexColor(...bt(this,qt).map(Cl=>Math.floor(.7*(255-Cl)+Cl)))}const Et=document.createElement("span");Et.className="header";const sl=document.createElement("h1");if(Et.append(sl),{dir:sl.dir,str:sl.textContent}=bt(this,$t),kt.append(Et),bt(this,Mt)){const xl=document.createElement("span");xl.classList.add("popupDate"),bt(this,Mt).then(Dl=>{xl.textContent=Dl}),Et.append(xl)}const ml=bt(this,cl),al=bt(this,Ct);if(al!=null&&al.str&&(!(ml!=null&&ml.str)||ml.str===al.str))O.XfaLayer.render({xfaHtml:al.html,intent:"richText",div:kt}),kt.lastChild.classList.add("richText","popupContent");else{const xl=this._formatContents(ml);kt.append(xl)}let zl=!!bt(this,Bt),Gl=zl?bt(this,Bt):bt(this,pt);for(const xl of bt(this,bl))if(!Gl||M.Util.intersect(xl.data.rect,Gl)!==null){Gl=xl.data.rect,zl=!0;break}const Nl=M.Util.normalizeRect([Gl[0],nt[3]-Gl[1]+nt[1],Gl[2],nt[3]-Gl[3]+nt[1]]),Rl=zl?Gl[2]-Gl[0]+5:0,Sl=Nl[0]+Rl,wl=Nl[1],{style:kl}=bt(this,vt);kl.left=`${100*(Sl-Wt)/L}%`,kl.top=`${100*(wl-Yt)/ct}%`,bt(this,vt).append(kt)}_formatContents({str:nt,dir:L}){const ct=document.createElement("p");ct.classList.add("popupContent"),ct.dir=L;const Wt=nt.split(/(?:\r\n?|\n)/);for(let Yt=0,kt=Wt.length;Yt<kt;++Yt){const Et=Wt[Yt];ct.append(document.createTextNode(Et)),Yt<kt-1&&ct.append(document.createElement("br"))}return ct}forceHide(){ul(this,dl,this.isVisible),bt(this,dl)&&(bt(this,vt).hidden=!0)}maybeShow(){bt(this,dl)&&(ul(this,dl,!1),bt(this,vt).hidden=!1)}get isVisible(){return bt(this,vt).hidden===!1}}Mt=new WeakMap,Rt=new WeakMap,gt=new WeakMap,Jt=new WeakMap,Dt=new WeakMap,qt=new WeakMap,vt=new WeakMap,cl=new WeakMap,bl=new WeakMap,il=new WeakMap,Bt=new WeakMap,Ft=new WeakMap,wt=new WeakMap,pt=new WeakMap,Ct=new WeakMap,$t=new WeakMap,dl=new WeakMap,rl=new WeakSet,Ns=function(nt){nt.altKey||nt.shiftKey||nt.ctrlKey||nt.metaKey||(nt.key==="Enter"||nt.key==="Escape"&&bt(this,Ft))&&nl(this,Xl,oe).call(this)},Xl=new WeakSet,oe=function(){ul(this,Ft,!bt(this,Ft)),bt(this,Ft)?(nl(this,Ll,Ke).call(this),bt(this,vt).addEventListener("click",bt(this,Dt)),bt(this,vt).addEventListener("keydown",bt(this,Rt))):(nl(this,Vl,ve).call(this),bt(this,vt).removeEventListener("click",bt(this,Dt)),bt(this,vt).removeEventListener("keydown",bt(this,Rt)))},Ll=new WeakSet,Ke=function(){bt(this,wt)||this.render(),this.isVisible?bt(this,Ft)&&bt(this,vt).classList.add("focused"):(bt(this,vt).hidden=!1,bt(this,vt).style.zIndex=parseInt(bt(this,vt).style.zIndex)+1e3)},Vl=new WeakSet,ve=function(){bt(this,vt).classList.remove("focused"),!(bt(this,Ft)||!this.isVisible)&&(bt(this,vt).hidden=!0,bt(this,vt).style.zIndex=parseInt(bt(this,vt).style.zIndex)-1e3)};class Zt extends S{constructor(nt){super(nt,{isRenderable:!0,ignoreBorder:!0}),this.textContent=nt.data.textContent,this.textPosition=nt.data.textPosition,this.annotationEditorType=M.AnnotationEditorType.FREETEXT}render(){if(this.container.classList.add("freeTextAnnotation"),this.textContent){const nt=document.createElement("div");nt.classList.add("annotationTextContent"),nt.setAttribute("role","comment");for(const L of this.textContent){const ct=document.createElement("span");ct.textContent=L,nt.append(ct)}this.container.append(nt)}return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this._editOnDoubleClick(),this.container}}r.FreeTextAnnotationElement=Zt;class dt extends S{constructor(L){super(L,{isRenderable:!0,ignoreBorder:!0});ll(this,ot,null)}render(){this.container.classList.add("lineAnnotation");const L=this.data,{width:ct,height:Wt}=K(L.rect),Yt=this.svgFactory.create(ct,Wt,!0),kt=ul(this,ot,this.svgFactory.createElement("svg:line"));return kt.setAttribute("x1",L.rect[2]-L.lineCoordinates[0]),kt.setAttribute("y1",L.rect[3]-L.lineCoordinates[1]),kt.setAttribute("x2",L.rect[2]-L.lineCoordinates[2]),kt.setAttribute("y2",L.rect[3]-L.lineCoordinates[3]),kt.setAttribute("stroke-width",L.borderStyle.width||1),kt.setAttribute("stroke","transparent"),kt.setAttribute("fill","transparent"),Yt.append(kt),this.container.append(Yt),!L.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return bt(this,ot)}addHighlightArea(){this.container.classList.add("highlightArea")}}ot=new WeakMap;class It extends S{constructor(L){super(L,{isRenderable:!0,ignoreBorder:!0});ll(this,ut,null)}render(){this.container.classList.add("squareAnnotation");const L=this.data,{width:ct,height:Wt}=K(L.rect),Yt=this.svgFactory.create(ct,Wt,!0),kt=L.borderStyle.width,Et=ul(this,ut,this.svgFactory.createElement("svg:rect"));return Et.setAttribute("x",kt/2),Et.setAttribute("y",kt/2),Et.setAttribute("width",ct-kt),Et.setAttribute("height",Wt-kt),Et.setAttribute("stroke-width",kt||1),Et.setAttribute("stroke","transparent"),Et.setAttribute("fill","transparent"),Yt.append(Et),this.container.append(Yt),!L.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return bt(this,ut)}addHighlightArea(){this.container.classList.add("highlightArea")}}ut=new WeakMap;class xt extends S{constructor(L){super(L,{isRenderable:!0,ignoreBorder:!0});ll(this,Tt,null)}render(){this.container.classList.add("circleAnnotation");const L=this.data,{width:ct,height:Wt}=K(L.rect),Yt=this.svgFactory.create(ct,Wt,!0),kt=L.borderStyle.width,Et=ul(this,Tt,this.svgFactory.createElement("svg:ellipse"));return Et.setAttribute("cx",ct/2),Et.setAttribute("cy",Wt/2),Et.setAttribute("rx",ct/2-kt/2),Et.setAttribute("ry",Wt/2-kt/2),Et.setAttribute("stroke-width",kt||1),Et.setAttribute("stroke","transparent"),Et.setAttribute("fill","transparent"),Yt.append(Et),this.container.append(Yt),!L.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return bt(this,Tt)}addHighlightArea(){this.container.classList.add("highlightArea")}}Tt=new WeakMap;class it extends S{constructor(L){super(L,{isRenderable:!0,ignoreBorder:!0});ll(this,jt,null);this.containerClassName="polylineAnnotation",this.svgElementName="svg:polyline"}render(){this.container.classList.add(this.containerClassName);const L=this.data,{width:ct,height:Wt}=K(L.rect),Yt=this.svgFactory.create(ct,Wt,!0);let kt=[];for(const sl of L.vertices){const ml=sl.x-L.rect[0],al=L.rect[3]-sl.y;kt.push(ml+","+al)}kt=kt.join(" ");const Et=ul(this,jt,this.svgFactory.createElement(this.svgElementName));return Et.setAttribute("points",kt),Et.setAttribute("stroke-width",L.borderStyle.width||1),Et.setAttribute("stroke","transparent"),Et.setAttribute("fill","transparent"),Yt.append(Et),this.container.append(Yt),!L.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return bt(this,jt)}addHighlightArea(){this.container.classList.add("highlightArea")}}jt=new WeakMap;class Xt extends it{constructor(nt){super(nt),this.containerClassName="polygonAnnotation",this.svgElementName="svg:polygon"}}class zt extends S{constructor(nt){super(nt,{isRenderable:!0,ignoreBorder:!0})}render(){return this.container.classList.add("caretAnnotation"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container}}class Gt extends S{constructor(L){super(L,{isRenderable:!0,ignoreBorder:!0});ll(this,Ot,[]);this.containerClassName="inkAnnotation",this.svgElementName="svg:polyline",this.annotationEditorType=M.AnnotationEditorType.INK}render(){this.container.classList.add(this.containerClassName);const L=this.data,{width:ct,height:Wt}=K(L.rect),Yt=this.svgFactory.create(ct,Wt,!0);for(const kt of L.inkLists){let Et=[];for(const ml of kt){const al=ml.x-L.rect[0],zl=L.rect[3]-ml.y;Et.push(`${al},${zl}`)}Et=Et.join(" ");const sl=this.svgFactory.createElement(this.svgElementName);bt(this,Ot).push(sl),sl.setAttribute("points",Et),sl.setAttribute("stroke-width",L.borderStyle.width||1),sl.setAttribute("stroke","transparent"),sl.setAttribute("fill","transparent"),!L.popupRef&&this.hasPopupData&&this._createPopup(),Yt.append(sl)}return this.container.append(Yt),this.container}getElementsToTriggerPopup(){return bt(this,Ot)}addHighlightArea(){this.container.classList.add("highlightArea")}}Ot=new WeakMap,r.InkAnnotationElement=Gt;class Nt extends S{constructor(nt){super(nt,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("highlightAnnotation"),this.container}}class Ut extends S{constructor(nt){super(nt,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("underlineAnnotation"),this.container}}class Vt extends S{constructor(nt){super(nt,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("squigglyAnnotation"),this.container}}class Ht extends S{constructor(nt){super(nt,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("strikeoutAnnotation"),this.container}}class Pt extends S{constructor(nt){super(nt,{isRenderable:!0,ignoreBorder:!0})}render(){return this.container.classList.add("stampAnnotation"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container}}r.StampAnnotationElement=Pt;class at extends S{constructor(L){var Yt;super(L,{isRenderable:!0});ll(this,yt);ll(this,Lt,null);const{filename:ct,content:Wt}=this.data.file;this.filename=(0,p.getFilenameFromUrl)(ct,!0),this.content=Wt,(Yt=this.linkService.eventBus)==null||Yt.dispatch("fileattachmentannotation",{source:this,filename:ct,content:Wt})}render(){this.container.classList.add("fileAttachmentAnnotation");const{container:L,data:ct}=this;let Wt;ct.hasAppearance||ct.fillAlpha===0?Wt=document.createElement("div"):(Wt=document.createElement("img"),Wt.src=`${this.imageResourcesPath}annotation-${/paperclip/i.test(ct.name)?"paperclip":"pushpin"}.svg`,ct.fillAlpha&&ct.fillAlpha<1&&(Wt.style=`filter: opacity(${Math.round(ct.fillAlpha*100)}%);`)),Wt.addEventListener("dblclick",nl(this,yt,Pe).bind(this)),ul(this,Lt,Wt);const{isMac:Yt}=M.FeatureTest.platform;return L.addEventListener("keydown",kt=>{kt.key==="Enter"&&(Yt?kt.metaKey:kt.ctrlKey)&&nl(this,yt,Pe).call(this)}),!ct.popupRef&&this.hasPopupData?this._createPopup():Wt.classList.add("popupTriggerArea"),L.append(Wt),L}getElementsToTriggerPopup(){return bt(this,Lt)}addHighlightArea(){this.container.classList.add("highlightArea")}}Lt=new WeakMap,yt=new WeakSet,Pe=function(){var L;(L=this.downloadManager)==null||L.openOrDownloadData(this.container,this.content,this.filename)};class R{constructor({div:nt,accessibilityManager:L,annotationCanvasMap:ct,l10n:Wt,page:Yt,viewport:kt}){ll(this,Qt);ll(this,hl);ll(this,tl,null);ll(this,el,null);ll(this,ol,new Map);this.div=nt,ul(this,tl,L),ul(this,el,ct),this.l10n=Wt,this.page=Yt,this.viewport=kt,this.zIndex=0,this.l10n||(this.l10n=U.NullL10n)}async render(nt){const{annotations:L}=nt,ct=this.div;(0,p.setLayerDimensions)(ct,this.viewport);const Wt=new Map,Yt={data:null,layer:ct,linkService:nt.linkService,downloadManager:nt.downloadManager,imageResourcesPath:nt.imageResourcesPath||"",renderForms:nt.renderForms!==!1,svgFactory:new p.DOMSVGFactory,annotationStorage:nt.annotationStorage||new B.AnnotationStorage,enableScripting:nt.enableScripting===!0,hasJSActions:nt.hasJSActions,fieldObjects:nt.fieldObjects,parent:this,elements:null};for(const kt of L){if(kt.noHTML)continue;const Et=kt.annotationType===M.AnnotationType.POPUP;if(Et){const al=Wt.get(kt.id);if(!al)continue;Yt.elements=al}else{const{width:al,height:zl}=K(kt.rect);if(al<=0||zl<=0)continue}Yt.data=kt;const sl=f.create(Yt);if(!sl.isRenderable)continue;if(!Et&&kt.popupRef){const al=Wt.get(kt.popupRef);al?al.push(sl):Wt.set(kt.popupRef,[sl])}sl.annotationEditorType>0&&bt(this,ol).set(sl.data.id,sl);const ml=sl.render();kt.hidden&&(ml.style.visibility="hidden"),nl(this,Qt,Xs).call(this,ml,kt.id)}nl(this,hl,He).call(this),await this.l10n.translate(ct)}update({viewport:nt}){const L=this.div;this.viewport=nt,(0,p.setLayerDimensions)(L,{rotation:nt.rotation}),nl(this,hl,He).call(this),L.hidden=!1}getEditableAnnotations(){return Array.from(bt(this,ol).values())}getEditableAnnotation(nt){return bt(this,ol).get(nt)}}tl=new WeakMap,el=new WeakMap,ol=new WeakMap,Qt=new WeakSet,Xs=function(nt,L){var Wt;const ct=nt.firstChild||nt;ct.id=`${M.AnnotationPrefix}${L}`,this.div.append(nt),(Wt=bt(this,tl))==null||Wt.moveElementInDOM(this.div,nt,ct,!1)},hl=new WeakSet,He=function(){if(!bt(this,el))return;const nt=this.div;for(const[L,ct]of bt(this,el)){const Wt=nt.querySelector(`[data-annotation-id="${L}"]`);if(!Wt)continue;const{firstChild:Yt}=Wt;Yt?Yt.nodeName==="CANVAS"?Yt.replaceWith(ct):Yt.before(ct):Wt.append(ct)}bt(this,el).clear()},r.AnnotationLayer=R},(lt,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ColorConverters=void 0;function h(B){return Math.floor(Math.max(0,Math.min(1,B))*255).toString(16).padStart(2,"0")}function M(B){return Math.max(0,Math.min(255,255*B))}class p{static CMYK_G([Q,U,O,I]){return["G",1-Math.min(1,.3*Q+.59*O+.11*U+I)]}static G_CMYK([Q]){return["CMYK",0,0,0,1-Q]}static G_RGB([Q]){return["RGB",Q,Q,Q]}static G_rgb([Q]){return Q=M(Q),[Q,Q,Q]}static G_HTML([Q]){const U=h(Q);return`#${U}${U}${U}`}static RGB_G([Q,U,O]){return["G",.3*Q+.59*U+.11*O]}static RGB_rgb(Q){return Q.map(M)}static RGB_HTML(Q){return`#${Q.map(h).join("")}`}static T_HTML(){return"#00000000"}static T_rgb(){return[null]}static CMYK_RGB([Q,U,O,I]){return["RGB",1-Math.min(1,Q+I),1-Math.min(1,O+I),1-Math.min(1,U+I)]}static CMYK_rgb([Q,U,O,I]){return[M(1-Math.min(1,Q+I)),M(1-Math.min(1,O+I)),M(1-Math.min(1,U+I))]}static CMYK_HTML(Q){const U=this.CMYK_RGB(Q).slice(1);return this.RGB_HTML(U)}static RGB_CMYK([Q,U,O]){const I=1-Q,j=1-U,q=1-O,K=Math.min(I,j,q);return["CMYK",I,j,q,K]}}r.ColorConverters=p},(lt,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.NullL10n=void 0,r.getL10nFallback=M;const h={of_pages:"of {{pagesCount}}",page_of_pages:"({{pageNumber}} of {{pagesCount}})",document_properties_kb:"{{size_kb}} KB ({{size_b}} bytes)",document_properties_mb:"{{size_mb}} MB ({{size_b}} bytes)",document_properties_date_string:"{{date}}, {{time}}",document_properties_page_size_unit_inches:"in",document_properties_page_size_unit_millimeters:"mm",document_properties_page_size_orientation_portrait:"portrait",document_properties_page_size_orientation_landscape:"landscape",document_properties_page_size_name_a3:"A3",document_properties_page_size_name_a4:"A4",document_properties_page_size_name_letter:"Letter",document_properties_page_size_name_legal:"Legal",document_properties_page_size_dimension_string:"{{width}} × {{height}} {{unit}} ({{orientation}})",document_properties_page_size_dimension_name_string:"{{width}} × {{height}} {{unit}} ({{name}}, {{orientation}})",document_properties_linearized_yes:"Yes",document_properties_linearized_no:"No",additional_layers:"Additional Layers",page_landmark:"Page {{page}}",thumb_page_title:"Page {{page}}",thumb_page_canvas:"Thumbnail of Page {{page}}",find_reached_top:"Reached top of document, continued from bottom",find_reached_bottom:"Reached end of document, continued from top","find_match_count[one]":"{{current}} of {{total}} match","find_match_count[other]":"{{current}} of {{total}} matches","find_match_count_limit[one]":"More than {{limit}} match","find_match_count_limit[other]":"More than {{limit}} matches",find_not_found:"Phrase not found",page_scale_width:"Page Width",page_scale_fit:"Page Fit",page_scale_auto:"Automatic Zoom",page_scale_actual:"Actual Size",page_scale_percent:"{{scale}}%",loading_error:"An error occurred while loading the PDF.",invalid_file_error:"Invalid or corrupted PDF file.",missing_file_error:"Missing PDF file.",unexpected_response_error:"Unexpected server response.",rendering_error:"An error occurred while rendering the page.",annotation_date_string:"{{date}}, {{time}}",printing_not_supported:"Warning: Printing is not fully supported by this browser.",printing_not_ready:"Warning: The PDF is not fully loaded for printing.",web_fonts_disabled:"Web fonts are disabled: unable to use embedded PDF fonts.",free_text2_default_content:"Start typing…",editor_free_text2_aria_label:"Text Editor",editor_ink2_aria_label:"Draw Editor",editor_ink_canvas_aria_label:"User-created image",editor_alt_text_button_label:"Alt text",editor_alt_text_edit_button_label:"Edit alt text",editor_alt_text_decorative_tooltip:"Marked as decorative"};h.print_progress_percent="{{progress}}%";function M(Q,U){switch(Q){case"find_match_count":Q=`find_match_count[${U.total===1?"one":"other"}]`;break;case"find_match_count_limit":Q=`find_match_count_limit[${U.limit===1?"one":"other"}]`;break}return h[Q]||""}function p(Q,U){return U?Q.replaceAll(/\{\{\s*(\w+)\s*\}\}/g,(O,I)=>I in U?U[I]:"{{"+I+"}}"):Q}const B={async getLanguage(){return"en-us"},async getDirection(){return"ltr"},async get(Q,U=null,O=M(Q,U)){return p(O,U)},async translate(Q){}};r.NullL10n=B},(lt,r,h)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.XfaLayer=void 0;var M=h(25);class p{static setupStorage(Q,U,O,I,j){const q=I.getValue(U,{value:null});switch(O.name){case"textarea":if(q.value!==null&&(Q.textContent=q.value),j==="print")break;Q.addEventListener("input",K=>{I.setValue(U,{value:K.target.value})});break;case"input":if(O.attributes.type==="radio"||O.attributes.type==="checkbox"){if(q.value===O.attributes.xfaOn?Q.setAttribute("checked",!0):q.value===O.attributes.xfaOff&&Q.removeAttribute("checked"),j==="print")break;Q.addEventListener("change",K=>{I.setValue(U,{value:K.target.checked?K.target.getAttribute("xfaOn"):K.target.getAttribute("xfaOff")})})}else{if(q.value!==null&&Q.setAttribute("value",q.value),j==="print")break;Q.addEventListener("input",K=>{I.setValue(U,{value:K.target.value})})}break;case"select":if(q.value!==null){Q.setAttribute("value",q.value);for(const K of O.children)K.attributes.value===q.value?K.attributes.selected=!0:K.attributes.hasOwnProperty("selected")&&delete K.attributes.selected}Q.addEventListener("input",K=>{const f=K.target.options,S=f.selectedIndex===-1?"":f[f.selectedIndex].value;I.setValue(U,{value:S})});break}}static setAttributes({html:Q,element:U,storage:O=null,intent:I,linkService:j}){const{attributes:q}=U,K=Q instanceof HTMLAnchorElement;q.type==="radio"&&(q.name=`${q.name}-${I}`);for(const[f,S]of Object.entries(q))if(S!=null)switch(f){case"class":S.length&&Q.setAttribute(f,S.join(" "));break;case"dataId":break;case"id":Q.setAttribute("data-element-id",S);break;case"style":Object.assign(Q.style,S);break;case"textContent":Q.textContent=S;break;default:(!K||f!=="href"&&f!=="newWindow")&&Q.setAttribute(f,S)}K&&j.addLinkAttributes(Q,q.href,q.newWindow),O&&q.dataId&&this.setupStorage(Q,q.dataId,U,O)}static render(Q){var k;const U=Q.annotationStorage,O=Q.linkService,I=Q.xfaHtml,j=Q.intent||"display",q=document.createElement(I.name);I.attributes&&this.setAttributes({html:q,element:I,intent:j,linkService:O});const K=[[I,-1,q]],f=Q.div;if(f.append(q),Q.viewport){const T=`matrix(${Q.viewport.transform.join(",")})`;f.style.transform=T}j!=="richText"&&f.setAttribute("class","xfaLayer xfaFont");const S=[];for(;K.length>0;){const[T,g,F]=K.at(-1);if(g+1===T.children.length){K.pop();continue}const J=T.children[++K.at(-1)[1]];if(J===null)continue;const{name:v}=J;if(v==="#text"){const m=document.createTextNode(J.value);S.push(m),F.append(m);continue}const u=(k=J==null?void 0:J.attributes)!=null&&k.xmlns?document.createElementNS(J.attributes.xmlns,v):document.createElement(v);if(F.append(u),J.attributes&&this.setAttributes({html:u,element:J,storage:U,intent:j,linkService:O}),J.children&&J.children.length>0)K.push([J,-1,u]);else if(J.value){const m=document.createTextNode(J.value);M.XfaText.shouldBuildText(v)&&S.push(m),u.append(m)}}for(const T of f.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))T.setAttribute("readOnly",!0);return{textDivs:S}}static update(Q){const U=`matrix(${Q.viewport.transform.join(",")})`;Q.div.style.transform=U,Q.div.hidden=!1}}r.XfaLayer=p},(lt,r,h)=>{var I,j,q,K,f,S,k,T,g,F,J,v,u,m,_,Ys,P,ps,dt,ys,xt,Ts,Xt,Qe,Gt,Ls,Ut,fe,Ht,Vs,at,Is,w,zs,C,Rs,st,Ss,Mt,El,gt,Be,Dt,me,vt,ue,bl,Ql,Bt,Ae,wt,We,Ct,ws,dl,_e,Yl,xs,pl,ks,yl,qe,_t,Ge,ut,fl;Object.defineProperty(r,"__esModule",{value:!0}),r.InkEditor=void 0;var M=h(1),p=h(4),B=h(29),Q=h(6),U=h(5);const jt=class jt extends p.AnnotationEditor{constructor(yt){super({...yt,name:"inkEditor"});ll(this,_);ll(this,P);ll(this,dt);ll(this,xt);ll(this,Xt);ll(this,Gt);ll(this,Ut);ll(this,Ht);ll(this,at);ll(this,w);ll(this,C);ll(this,st);ll(this,Mt);ll(this,gt);ll(this,Dt);ll(this,vt);ll(this,bl);ll(this,Bt);ll(this,wt);ll(this,pl);ll(this,yl);ll(this,_t);ll(this,ut);ll(this,I,0);ll(this,j,0);ll(this,q,this.canvasPointermove.bind(this));ll(this,K,this.canvasPointerleave.bind(this));ll(this,f,this.canvasPointerup.bind(this));ll(this,S,this.canvasPointerdown.bind(this));ll(this,k,new Path2D);ll(this,T,!1);ll(this,g,!1);ll(this,F,!1);ll(this,J,null);ll(this,v,0);ll(this,u,0);ll(this,m,null);this.color=yt.color||null,this.thickness=yt.thickness||null,this.opacity=yt.opacity||null,this.paths=[],this.bezierPath2D=[],this.allRawPaths=[],this.currentPath=[],this.scaleFactor=1,this.translationX=this.translationY=0,this.x=0,this.y=0,this._willKeepAspectRatio=!0}static initialize(yt){p.AnnotationEditor.initialize(yt,{strings:["editor_ink_canvas_aria_label","editor_ink2_aria_label"]})}static updateDefaultParams(yt,Kt){switch(yt){case M.AnnotationEditorParamsType.INK_THICKNESS:jt._defaultThickness=Kt;break;case M.AnnotationEditorParamsType.INK_COLOR:jt._defaultColor=Kt;break;case M.AnnotationEditorParamsType.INK_OPACITY:jt._defaultOpacity=Kt/100;break}}updateParams(yt,Kt){switch(yt){case M.AnnotationEditorParamsType.INK_THICKNESS:nl(this,_,Ys).call(this,Kt);break;case M.AnnotationEditorParamsType.INK_COLOR:nl(this,P,ps).call(this,Kt);break;case M.AnnotationEditorParamsType.INK_OPACITY:nl(this,dt,ys).call(this,Kt);break}}static get defaultPropertiesToUpdate(){return[[M.AnnotationEditorParamsType.INK_THICKNESS,jt._defaultThickness],[M.AnnotationEditorParamsType.INK_COLOR,jt._defaultColor||p.AnnotationEditor._defaultLineColor],[M.AnnotationEditorParamsType.INK_OPACITY,Math.round(jt._defaultOpacity*100)]]}get propertiesToUpdate(){return[[M.AnnotationEditorParamsType.INK_THICKNESS,this.thickness||jt._defaultThickness],[M.AnnotationEditorParamsType.INK_COLOR,this.color||jt._defaultColor||p.AnnotationEditor._defaultLineColor],[M.AnnotationEditorParamsType.INK_OPACITY,Math.round(100*(this.opacity??jt._defaultOpacity))]]}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(this.canvas||(nl(this,Dt,me).call(this),nl(this,vt,ue).call(this)),this.isAttachedToDOM||(this.parent.add(this),nl(this,bl,Ql).call(this)),nl(this,ut,fl).call(this)))}remove(){this.canvas!==null&&(this.isEmpty()||this.commit(),this.canvas.width=this.canvas.height=0,this.canvas.remove(),this.canvas=null,bt(this,J).disconnect(),ul(this,J,null),super.remove())}setParent(yt){!this.parent&&yt?this._uiManager.removeShouldRescale(this):this.parent&&yt===null&&this._uiManager.addShouldRescale(this),super.setParent(yt)}onScaleChanging(){const[yt,Kt]=this.parentDimensions,tl=this.width*yt,el=this.height*Kt;this.setDimensions(tl,el)}enableEditMode(){bt(this,T)||this.canvas===null||(super.enableEditMode(),this._isDraggable=!1,this.canvas.addEventListener("pointerdown",bt(this,S)))}disableEditMode(){!this.isInEditMode()||this.canvas===null||(super.disableEditMode(),this._isDraggable=!this.isEmpty(),this.div.classList.remove("editing"),this.canvas.removeEventListener("pointerdown",bt(this,S)))}onceAdded(){this._isDraggable=!this.isEmpty()}isEmpty(){return this.paths.length===0||this.paths.length===1&&this.paths[0].length===0}commit(){bt(this,T)||(super.commit(),this.isEditing=!1,this.disableEditMode(),this.setInForeground(),ul(this,T,!0),this.div.classList.add("disabled"),nl(this,ut,fl).call(this,!0),this.makeResizable(),this.parent.addInkEditorIfNeeded(!0),this.moveInDOM(),this.div.focus({preventScroll:!0}))}focusin(yt){this._focusEventsAllowed&&(super.focusin(yt),this.enableEditMode())}canvasPointerdown(yt){yt.button!==0||!this.isInEditMode()||bt(this,T)||(this.setInForeground(),yt.preventDefault(),yt.type!=="mouse"&&this.div.focus(),nl(this,Gt,Ls).call(this,yt.offsetX,yt.offsetY))}canvasPointermove(yt){yt.preventDefault(),nl(this,Ut,fe).call(this,yt.offsetX,yt.offsetY)}canvasPointerup(yt){yt.preventDefault(),nl(this,gt,Be).call(this,yt)}canvasPointerleave(yt){nl(this,gt,Be).call(this,yt)}get isResizable(){return!this.isEmpty()&&bt(this,T)}render(){if(this.div)return this.div;let yt,Kt;this.width&&(yt=this.x,Kt=this.y),super.render(),p.AnnotationEditor._l10nPromise.get("editor_ink2_aria_label").then(Ml=>{var hl;return(hl=this.div)==null?void 0:hl.setAttribute("aria-label",Ml)});const[tl,el,ol,Qt]=nl(this,xt,Ts).call(this);if(this.setAt(tl,el,0,0),this.setDims(ol,Qt),nl(this,Dt,me).call(this),this.width){const[Ml,hl]=this.parentDimensions;this.setAspectRatio(this.width*Ml,this.height*hl),this.setAt(yt*Ml,Kt*hl,this.width*Ml,this.height*hl),ul(this,F,!0),nl(this,bl,Ql).call(this),this.setDims(this.width*Ml,this.height*hl),nl(this,Mt,El).call(this),this.div.classList.add("disabled")}else this.div.classList.add("editing"),this.enableEditMode();return nl(this,vt,ue).call(this),this.div}setDimensions(yt,Kt){const tl=Math.round(yt),el=Math.round(Kt);if(bt(this,v)===tl&&bt(this,u)===el)return;ul(this,v,tl),ul(this,u,el),this.canvas.style.visibility="hidden";const[ol,Qt]=this.parentDimensions;this.width=yt/ol,this.height=Kt/Qt,this.fixAndSetPosition(),bt(this,T)&&nl(this,Bt,Ae).call(this,yt,Kt),nl(this,bl,Ql).call(this),nl(this,Mt,El).call(this),this.canvas.style.visibility="visible",this.fixDims()}static deserialize(yt,Kt,tl){var Yt,kt,Et;if(yt instanceof B.InkAnnotationElement)return null;const el=super.deserialize(yt,Kt,tl);el.thickness=yt.thickness,el.color=M.Util.makeHexColor(...yt.color),el.opacity=yt.opacity;const[ol,Qt]=el.pageDimensions,Ml=el.width*ol,hl=el.height*Qt,Il=el.parentScale,Wl=yt.thickness/2;ul(el,T,!0),ul(el,v,Math.round(Ml)),ul(el,u,Math.round(hl));const{paths:nt,rect:L,rotation:ct}=yt;for(let{bezier:sl}of nt){sl=nl(Yt=jt,Yl,xs).call(Yt,sl,L,ct);const ml=[];el.paths.push(ml);let al=Il*(sl[0]-Wl),zl=Il*(sl[1]-Wl);for(let Nl=2,Tl=sl.length;Nl<Tl;Nl+=6){const Rl=Il*(sl[Nl]-Wl),Sl=Il*(sl[Nl+1]-Wl),wl=Il*(sl[Nl+2]-Wl),kl=Il*(sl[Nl+3]-Wl),xl=Il*(sl[Nl+4]-Wl),Dl=Il*(sl[Nl+5]-Wl);ml.push([[al,zl],[Rl,Sl],[wl,kl],[xl,Dl]]),al=xl,zl=Dl}const Gl=nl(this,Ct,ws).call(this,ml);el.bezierPath2D.push(Gl)}const Wt=nl(kt=el,yl,qe).call(kt);return ul(el,j,Math.max(p.AnnotationEditor.MIN_SIZE,Wt[2]-Wt[0])),ul(el,I,Math.max(p.AnnotationEditor.MIN_SIZE,Wt[3]-Wt[1])),nl(Et=el,Bt,Ae).call(Et,Ml,hl),el}serialize(){if(this.isEmpty())return null;const yt=this.getRect(0,0),Kt=p.AnnotationEditor._colorManager.convert(this.ctx.strokeStyle);return{annotationType:M.AnnotationEditorType.INK,color:Kt,thickness:this.thickness,opacity:this.opacity,paths:nl(this,pl,ks).call(this,this.scaleFactor/this.parentScale,this.translationX,this.translationY,yt),pageIndex:this.pageIndex,rect:yt,rotation:this.rotation,structTreeParentId:this._structTreeParentId}}};I=new WeakMap,j=new WeakMap,q=new WeakMap,K=new WeakMap,f=new WeakMap,S=new WeakMap,k=new WeakMap,T=new WeakMap,g=new WeakMap,F=new WeakMap,J=new WeakMap,v=new WeakMap,u=new WeakMap,m=new WeakMap,_=new WeakSet,Ys=function(yt){const Kt=this.thickness;this.addCommands({cmd:()=>{this.thickness=yt,nl(this,ut,fl).call(this)},undo:()=>{this.thickness=Kt,nl(this,ut,fl).call(this)},mustExec:!0,type:M.AnnotationEditorParamsType.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0})},P=new WeakSet,ps=function(yt){const Kt=this.color;this.addCommands({cmd:()=>{this.color=yt,nl(this,Mt,El).call(this)},undo:()=>{this.color=Kt,nl(this,Mt,El).call(this)},mustExec:!0,type:M.AnnotationEditorParamsType.INK_COLOR,overwriteIfSameType:!0,keepUndo:!0})},dt=new WeakSet,ys=function(yt){yt/=100;const Kt=this.opacity;this.addCommands({cmd:()=>{this.opacity=yt,nl(this,Mt,El).call(this)},undo:()=>{this.opacity=Kt,nl(this,Mt,El).call(this)},mustExec:!0,type:M.AnnotationEditorParamsType.INK_OPACITY,overwriteIfSameType:!0,keepUndo:!0})},xt=new WeakSet,Ts=function(){const{parentRotation:yt,parentDimensions:[Kt,tl]}=this;switch(yt){case 90:return[0,tl,tl,Kt];case 180:return[Kt,tl,Kt,tl];case 270:return[Kt,0,tl,Kt];default:return[0,0,Kt,tl]}},Xt=new WeakSet,Qe=function(){const{ctx:yt,color:Kt,opacity:tl,thickness:el,parentScale:ol,scaleFactor:Qt}=this;yt.lineWidth=el*ol/Qt,yt.lineCap="round",yt.lineJoin="round",yt.miterLimit=10,yt.strokeStyle=`${Kt}${(0,U.opacityToHex)(tl)}`},Gt=new WeakSet,Ls=function(yt,Kt){this.canvas.addEventListener("contextmenu",Q.noContextMenu),this.canvas.addEventListener("pointerleave",bt(this,K)),this.canvas.addEventListener("pointermove",bt(this,q)),this.canvas.addEventListener("pointerup",bt(this,f)),this.canvas.removeEventListener("pointerdown",bt(this,S)),this.isEditing=!0,bt(this,F)||(ul(this,F,!0),nl(this,bl,Ql).call(this),this.thickness||(this.thickness=jt._defaultThickness),this.color||(this.color=jt._defaultColor||p.AnnotationEditor._defaultLineColor),this.opacity??(this.opacity=jt._defaultOpacity)),this.currentPath.push([yt,Kt]),ul(this,g,!1),nl(this,Xt,Qe).call(this),ul(this,m,()=>{nl(this,w,zs).call(this),bt(this,m)&&window.requestAnimationFrame(bt(this,m))}),window.requestAnimationFrame(bt(this,m))},Ut=new WeakSet,fe=function(yt,Kt){const[tl,el]=this.currentPath.at(-1);if(this.currentPath.length>1&&yt===tl&&Kt===el)return;const ol=this.currentPath;let Qt=bt(this,k);if(ol.push([yt,Kt]),ul(this,g,!0),ol.length<=2){Qt.moveTo(...ol[0]),Qt.lineTo(yt,Kt);return}ol.length===3&&(ul(this,k,Qt=new Path2D),Qt.moveTo(...ol[0])),nl(this,C,Rs).call(this,Qt,...ol.at(-3),...ol.at(-2),yt,Kt)},Ht=new WeakSet,Vs=function(){if(this.currentPath.length===0)return;const yt=this.currentPath.at(-1);bt(this,k).lineTo(...yt)},at=new WeakSet,Is=function(yt,Kt){ul(this,m,null),yt=Math.min(Math.max(yt,0),this.canvas.width),Kt=Math.min(Math.max(Kt,0),this.canvas.height),nl(this,Ut,fe).call(this,yt,Kt),nl(this,Ht,Vs).call(this);let tl;if(this.currentPath.length!==1)tl=nl(this,st,Ss).call(this);else{const hl=[yt,Kt];tl=[[hl,hl.slice(),hl.slice(),hl]]}const el=bt(this,k),ol=this.currentPath;this.currentPath=[],ul(this,k,new Path2D);const Qt=()=>{this.allRawPaths.push(ol),this.paths.push(tl),this.bezierPath2D.push(el),this.rebuild()},Ml=()=>{this.allRawPaths.pop(),this.paths.pop(),this.bezierPath2D.pop(),this.paths.length===0?this.remove():(this.canvas||(nl(this,Dt,me).call(this),nl(this,vt,ue).call(this)),nl(this,ut,fl).call(this))};this.addCommands({cmd:Qt,undo:Ml,mustExec:!0})},w=new WeakSet,zs=function(){if(!bt(this,g))return;ul(this,g,!1);const yt=Math.ceil(this.thickness*this.parentScale),Kt=this.currentPath.slice(-3),tl=Kt.map(Qt=>Qt[0]),el=Kt.map(Qt=>Qt[1]);Math.min(...tl)-yt,Math.max(...tl)+yt,Math.min(...el)-yt,Math.max(...el)+yt;const{ctx:ol}=this;ol.save(),ol.clearRect(0,0,this.canvas.width,this.canvas.height);for(const Qt of this.bezierPath2D)ol.stroke(Qt);ol.stroke(bt(this,k)),ol.restore()},C=new WeakSet,Rs=function(yt,Kt,tl,el,ol,Qt,Ml){const hl=(Kt+el)/2,Il=(tl+ol)/2,Wl=(el+Qt)/2,nt=(ol+Ml)/2;yt.bezierCurveTo(hl+2*(el-hl)/3,Il+2*(ol-Il)/3,Wl+2*(el-Wl)/3,nt+2*(ol-nt)/3,Wl,nt)},st=new WeakSet,Ss=function(){const yt=this.currentPath;if(yt.length<=2)return[[yt[0],yt[0],yt.at(-1),yt.at(-1)]];const Kt=[];let tl,[el,ol]=yt[0];for(tl=1;tl<yt.length-2;tl++){const[L,ct]=yt[tl],[Wt,Yt]=yt[tl+1],kt=(L+Wt)/2,Et=(ct+Yt)/2,sl=[el+2*(L-el)/3,ol+2*(ct-ol)/3],ml=[kt+2*(L-kt)/3,Et+2*(ct-Et)/3];Kt.push([[el,ol],sl,ml,[kt,Et]]),[el,ol]=[kt,Et]}const[Qt,Ml]=yt[tl],[hl,Il]=yt[tl+1],Wl=[el+2*(Qt-el)/3,ol+2*(Ml-ol)/3],nt=[hl+2*(Qt-hl)/3,Il+2*(Ml-Il)/3];return Kt.push([[el,ol],Wl,nt,[hl,Il]]),Kt},Mt=new WeakSet,El=function(){if(this.isEmpty()){nl(this,wt,We).call(this);return}nl(this,Xt,Qe).call(this);const{canvas:yt,ctx:Kt}=this;Kt.setTransform(1,0,0,1,0,0),Kt.clearRect(0,0,yt.width,yt.height),nl(this,wt,We).call(this);for(const tl of this.bezierPath2D)Kt.stroke(tl)},gt=new WeakSet,Be=function(yt){this.canvas.removeEventListener("pointerleave",bt(this,K)),this.canvas.removeEventListener("pointermove",bt(this,q)),this.canvas.removeEventListener("pointerup",bt(this,f)),this.canvas.addEventListener("pointerdown",bt(this,S)),setTimeout(()=>{this.canvas.removeEventListener("contextmenu",Q.noContextMenu)},10),nl(this,at,Is).call(this,yt.offsetX,yt.offsetY),this.addToAnnotationStorage(),this.setInBackground()},Dt=new WeakSet,me=function(){this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=0,this.canvas.className="inkEditorCanvas",p.AnnotationEditor._l10nPromise.get("editor_ink_canvas_aria_label").then(yt=>{var Kt;return(Kt=this.canvas)==null?void 0:Kt.setAttribute("aria-label",yt)}),this.div.append(this.canvas),this.ctx=this.canvas.getContext("2d")},vt=new WeakSet,ue=function(){ul(this,J,new ResizeObserver(yt=>{const Kt=yt[0].contentRect;Kt.width&&Kt.height&&this.setDimensions(Kt.width,Kt.height)})),bt(this,J).observe(this.div)},bl=new WeakSet,Ql=function(){if(!bt(this,F))return;const[yt,Kt]=this.parentDimensions;this.canvas.width=Math.ceil(this.width*yt),this.canvas.height=Math.ceil(this.height*Kt),nl(this,wt,We).call(this)},Bt=new WeakSet,Ae=function(yt,Kt){const tl=nl(this,_t,Ge).call(this),el=(yt-tl)/bt(this,j),ol=(Kt-tl)/bt(this,I);this.scaleFactor=Math.min(el,ol)},wt=new WeakSet,We=function(){const yt=nl(this,_t,Ge).call(this)/2;this.ctx.setTransform(this.scaleFactor,0,0,this.scaleFactor,this.translationX*this.scaleFactor+yt,this.translationY*this.scaleFactor+yt)},Ct=new WeakSet,ws=function(yt){const Kt=new Path2D;for(let tl=0,el=yt.length;tl<el;tl++){const[ol,Qt,Ml,hl]=yt[tl];tl===0&&Kt.moveTo(...ol),Kt.bezierCurveTo(Qt[0],Qt[1],Ml[0],Ml[1],hl[0],hl[1])}return Kt},dl=new WeakSet,_e=function(yt,Kt,tl){const[el,ol,Qt,Ml]=Kt;switch(tl){case 0:for(let hl=0,Il=yt.length;hl<Il;hl+=2)yt[hl]+=el,yt[hl+1]=Ml-yt[hl+1];break;case 90:for(let hl=0,Il=yt.length;hl<Il;hl+=2){const Wl=yt[hl];yt[hl]=yt[hl+1]+el,yt[hl+1]=Wl+ol}break;case 180:for(let hl=0,Il=yt.length;hl<Il;hl+=2)yt[hl]=Qt-yt[hl],yt[hl+1]+=ol;break;case 270:for(let hl=0,Il=yt.length;hl<Il;hl+=2){const Wl=yt[hl];yt[hl]=Qt-yt[hl+1],yt[hl+1]=Ml-Wl}break;default:throw new Error("Invalid rotation")}return yt},Yl=new WeakSet,xs=function(yt,Kt,tl){const[el,ol,Qt,Ml]=Kt;switch(tl){case 0:for(let hl=0,Il=yt.length;hl<Il;hl+=2)yt[hl]-=el,yt[hl+1]=Ml-yt[hl+1];break;case 90:for(let hl=0,Il=yt.length;hl<Il;hl+=2){const Wl=yt[hl];yt[hl]=yt[hl+1]-ol,yt[hl+1]=Wl-el}break;case 180:for(let hl=0,Il=yt.length;hl<Il;hl+=2)yt[hl]=Qt-yt[hl],yt[hl+1]-=ol;break;case 270:for(let hl=0,Il=yt.length;hl<Il;hl+=2){const Wl=yt[hl];yt[hl]=Ml-yt[hl+1],yt[hl+1]=Qt-Wl}break;default:throw new Error("Invalid rotation")}return yt},pl=new WeakSet,ks=function(yt,Kt,tl,el){var Il,Wl;const ol=[],Qt=this.thickness/2,Ml=yt*Kt+Qt,hl=yt*tl+Qt;for(const nt of this.paths){const L=[],ct=[];for(let Wt=0,Yt=nt.length;Wt<Yt;Wt++){const[kt,Et,sl,ml]=nt[Wt],al=yt*kt[0]+Ml,zl=yt*kt[1]+hl,Gl=yt*Et[0]+Ml,Nl=yt*Et[1]+hl,Tl=yt*sl[0]+Ml,Rl=yt*sl[1]+hl,Sl=yt*ml[0]+Ml,wl=yt*ml[1]+hl;Wt===0&&(L.push(al,zl),ct.push(al,zl)),L.push(Gl,Nl,Tl,Rl,Sl,wl),ct.push(Gl,Nl),Wt===Yt-1&&ct.push(Sl,wl)}ol.push({bezier:nl(Il=jt,dl,_e).call(Il,L,el,this.rotation),points:nl(Wl=jt,dl,_e).call(Wl,ct,el,this.rotation)})}return ol},yl=new WeakSet,qe=function(){let yt=1/0,Kt=-1/0,tl=1/0,el=-1/0;for(const ol of this.paths)for(const[Qt,Ml,hl,Il]of ol){const Wl=M.Util.bezierBoundingBox(...Qt,...Ml,...hl,...Il);yt=Math.min(yt,Wl[0]),tl=Math.min(tl,Wl[1]),Kt=Math.max(Kt,Wl[2]),el=Math.max(el,Wl[3])}return[yt,tl,Kt,el]},_t=new WeakSet,Ge=function(){return bt(this,T)?Math.ceil(this.thickness*this.parentScale):0},ut=new WeakSet,fl=function(yt=!1){if(this.isEmpty())return;if(!bt(this,T)){nl(this,Mt,El).call(this);return}const Kt=nl(this,yl,qe).call(this),tl=nl(this,_t,Ge).call(this);ul(this,j,Math.max(p.AnnotationEditor.MIN_SIZE,Kt[2]-Kt[0])),ul(this,I,Math.max(p.AnnotationEditor.MIN_SIZE,Kt[3]-Kt[1]));const el=Math.ceil(tl+bt(this,j)*this.scaleFactor),ol=Math.ceil(tl+bt(this,I)*this.scaleFactor),[Qt,Ml]=this.parentDimensions;this.width=el/Qt,this.height=ol/Ml,this.setAspectRatio(el,ol);const hl=this.translationX,Il=this.translationY;this.translationX=-Kt[0],this.translationY=-Kt[1],nl(this,bl,Ql).call(this),nl(this,Mt,El).call(this),ul(this,v,el),ul(this,u,ol),this.setDims(el,ol);const Wl=yt?tl/this.scaleFactor/2:0;this.translate(hl-this.translationX-Wl,Il-this.translationY-Wl)},ll(jt,Ct),ll(jt,dl),ll(jt,Yl),gl(jt,"_defaultColor",null),gl(jt,"_defaultOpacity",1),gl(jt,"_defaultThickness",1),gl(jt,"_type","ink");let O=jt;r.InkEditor=O},(lt,r,h)=>{var O,I,j,q,K,f,S,k,T,g,F,ee,v,se,m,Me,$,$e,Zt,gs,It,Ds,it,ts,zt,re,Nt,js;Object.defineProperty(r,"__esModule",{value:!0}),r.StampEditor=void 0;var M=h(1),p=h(4),B=h(6),Q=h(29);const Vt=class Vt extends p.AnnotationEditor{constructor(at){super({...at,name:"stampEditor"});ll(this,F);ll(this,v);ll(this,m);ll(this,$);ll(this,Zt);ll(this,It);ll(this,it);ll(this,zt);ll(this,Nt);ll(this,O,null);ll(this,I,null);ll(this,j,null);ll(this,q,null);ll(this,K,null);ll(this,f,null);ll(this,S,null);ll(this,k,null);ll(this,T,!1);ll(this,g,!1);ul(this,q,at.bitmapUrl),ul(this,K,at.bitmapFile)}static initialize(at){p.AnnotationEditor.initialize(at)}static get supportedTypes(){const at=["apng","avif","bmp","gif","jpeg","png","svg+xml","webp","x-icon"];return(0,M.shadow)(this,"supportedTypes",at.map(R=>`image/${R}`))}static get supportedTypesStr(){return(0,M.shadow)(this,"supportedTypesStr",this.supportedTypes.join(","))}static isHandlingMimeForPasting(at){return this.supportedTypes.includes(at)}static paste(at,R){R.pasteEditor(M.AnnotationEditorType.STAMP,{bitmapFile:at.getAsFile()})}remove(){var at,R;bt(this,I)&&(ul(this,O,null),this._uiManager.imageManager.deleteId(bt(this,I)),(at=bt(this,f))==null||at.remove(),ul(this,f,null),(R=bt(this,S))==null||R.disconnect(),ul(this,S,null)),super.remove()}rebuild(){if(!this.parent){bt(this,I)&&nl(this,m,Me).call(this);return}super.rebuild(),this.div!==null&&(bt(this,I)&&nl(this,m,Me).call(this),this.isAttachedToDOM||this.parent.add(this))}onceAdded(){this._isDraggable=!0,this.div.focus()}isEmpty(){return!(bt(this,j)||bt(this,O)||bt(this,q)||bt(this,K))}get isResizable(){return!0}render(){if(this.div)return this.div;let at,R;if(this.width&&(at=this.x,R=this.y),super.render(),this.div.hidden=!0,bt(this,O)?nl(this,$,$e).call(this):nl(this,m,Me).call(this),this.width){const[w,X]=this.parentDimensions;this.setAt(at*w,R*X,this.width*w,this.height*X)}return this.div}static deserialize(at,R,w){if(at instanceof Q.StampAnnotationElement)return null;const X=super.deserialize(at,R,w),{rect:C,bitmapUrl:H,bitmapId:st,isSvg:et,accessibilityData:Mt}=at;st&&w.imageManager.isValidId(st)?ul(X,I,st):ul(X,q,H),ul(X,T,et);const[Rt,gt]=X.pageDimensions;return X.width=(C[2]-C[0])/Rt,X.height=(C[3]-C[1])/gt,Mt&&(X.altTextData=Mt),X}serialize(at=!1,R=null){if(this.isEmpty())return null;const w={annotationType:M.AnnotationEditorType.STAMP,bitmapId:bt(this,I),pageIndex:this.pageIndex,rect:this.getRect(0,0),rotation:this.rotation,isSvg:bt(this,T),structTreeParentId:this._structTreeParentId};if(at)return w.bitmapUrl=nl(this,zt,re).call(this,!0),w.accessibilityData=this.altTextData,w;const{decorative:X,altText:C}=this.altTextData;if(!X&&C&&(w.accessibilityData={type:"Figure",alt:C}),R===null)return w;R.stamps||(R.stamps=new Map);const H=bt(this,T)?(w.rect[2]-w.rect[0])*(w.rect[3]-w.rect[1]):null;if(!R.stamps.has(bt(this,I)))R.stamps.set(bt(this,I),{area:H,serialized:w}),w.bitmap=nl(this,zt,re).call(this,!1);else if(bt(this,T)){const st=R.stamps.get(bt(this,I));H>st.area&&(st.area=H,st.serialized.bitmap.close(),st.serialized.bitmap=nl(this,zt,re).call(this,!1))}return w}};O=new WeakMap,I=new WeakMap,j=new WeakMap,q=new WeakMap,K=new WeakMap,f=new WeakMap,S=new WeakMap,k=new WeakMap,T=new WeakMap,g=new WeakMap,F=new WeakSet,ee=function(at,R=!1){if(!at){this.remove();return}ul(this,O,at.bitmap),R||(ul(this,I,at.id),ul(this,T,at.isSvg)),nl(this,$,$e).call(this)},v=new WeakSet,se=function(){ul(this,j,null),this._uiManager.enableWaiting(!1),bt(this,f)&&this.div.focus()},m=new WeakSet,Me=function(){if(bt(this,I)){this._uiManager.enableWaiting(!0),this._uiManager.imageManager.getFromId(bt(this,I)).then(R=>nl(this,F,ee).call(this,R,!0)).finally(()=>nl(this,v,se).call(this));return}if(bt(this,q)){const R=bt(this,q);ul(this,q,null),this._uiManager.enableWaiting(!0),ul(this,j,this._uiManager.imageManager.getFromUrl(R).then(w=>nl(this,F,ee).call(this,w)).finally(()=>nl(this,v,se).call(this)));return}if(bt(this,K)){const R=bt(this,K);ul(this,K,null),this._uiManager.enableWaiting(!0),ul(this,j,this._uiManager.imageManager.getFromFile(R).then(w=>nl(this,F,ee).call(this,w)).finally(()=>nl(this,v,se).call(this)));return}const at=document.createElement("input");at.type="file",at.accept=Vt.supportedTypesStr,ul(this,j,new Promise(R=>{at.addEventListener("change",async()=>{if(!at.files||at.files.length===0)this.remove();else{this._uiManager.enableWaiting(!0);const w=await this._uiManager.imageManager.getFromFile(at.files[0]);nl(this,F,ee).call(this,w)}R()}),at.addEventListener("cancel",()=>{this.remove(),R()})}).finally(()=>nl(this,v,se).call(this))),at.click()},$=new WeakSet,$e=function(){const{div:at}=this;let{width:R,height:w}=bt(this,O);const[X,C]=this.pageDimensions,H=.75;if(this.width)R=this.width*X,w=this.height*C;else if(R>H*X||w>H*C){const Rt=Math.min(H*X/R,H*C/w);R*=Rt,w*=Rt}const[st,et]=this.parentDimensions;this.setDims(R*st/X,w*et/C),this._uiManager.enableWaiting(!1);const Mt=ul(this,f,document.createElement("canvas"));at.append(Mt),at.hidden=!1,nl(this,it,ts).call(this,R,w),nl(this,Nt,js).call(this),bt(this,g)||(this.parent.addUndoableEditor(this),ul(this,g,!0)),this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",subtype:this.editorType,data:{action:"inserted_image"}}}),this.addAltTextButton()},Zt=new WeakSet,gs=function(at,R){var H;const[w,X]=this.parentDimensions;this.width=at/w,this.height=R/X,this.setDims(at,R),(H=this._initialOptions)!=null&&H.isCentered?this.center():this.fixAndSetPosition(),this._initialOptions=null,bt(this,k)!==null&&clearTimeout(bt(this,k)),ul(this,k,setTimeout(()=>{ul(this,k,null),nl(this,it,ts).call(this,at,R)},200))},It=new WeakSet,Ds=function(at,R){const{width:w,height:X}=bt(this,O);let C=w,H=X,st=bt(this,O);for(;C>2*at||H>2*R;){const et=C,Mt=H;C>2*at&&(C=C>=16384?Math.floor(C/2)-1:Math.ceil(C/2)),H>2*R&&(H=H>=16384?Math.floor(H/2)-1:Math.ceil(H/2));const Rt=new OffscreenCanvas(C,H);Rt.getContext("2d").drawImage(st,0,0,et,Mt,0,0,C,H),st=Rt.transferToImageBitmap()}return st},it=new WeakSet,ts=function(at,R){at=Math.ceil(at),R=Math.ceil(R);const w=bt(this,f);if(!w||w.width===at&&w.height===R)return;w.width=at,w.height=R;const X=bt(this,T)?bt(this,O):nl(this,It,Ds).call(this,at,R),C=w.getContext("2d");C.filter=this._uiManager.hcmFilter,C.drawImage(X,0,0,X.width,X.height,0,0,at,R)},zt=new WeakSet,re=function(at){if(at){if(bt(this,T)){const X=this._uiManager.imageManager.getSvgUrl(bt(this,I));if(X)return X}const R=document.createElement("canvas");return{width:R.width,height:R.height}=bt(this,O),R.getContext("2d").drawImage(bt(this,O),0,0),R.toDataURL()}if(bt(this,T)){const[R,w]=this.pageDimensions,X=Math.round(this.width*R*B.PixelsPerInch.PDF_TO_CSS_UNITS),C=Math.round(this.height*w*B.PixelsPerInch.PDF_TO_CSS_UNITS),H=new OffscreenCanvas(X,C);return H.getContext("2d").drawImage(bt(this,O),0,0,bt(this,O).width,bt(this,O).height,0,0,X,C),H.transferToImageBitmap()}return structuredClone(bt(this,O))},Nt=new WeakSet,js=function(){ul(this,S,new ResizeObserver(at=>{const R=at[0].contentRect;R.width&&R.height&&nl(this,Zt,gs).call(this,R.width,R.height)})),bt(this,S).observe(this.div)},gl(Vt,"_type","stamp");let U=Vt;r.StampEditor=U}],__webpack_module_cache__={};function __w_pdfjs_require__(lt){var r=__webpack_module_cache__[lt];if(r!==void 0)return r.exports;var h=__webpack_module_cache__[lt]={exports:{}};return __webpack_modules__[lt](h,h.exports,__w_pdfjs_require__),h.exports}var __webpack_exports__={};return(()=>{var lt=__webpack_exports__;Object.defineProperty(lt,"__esModule",{value:!0}),Object.defineProperty(lt,"AbortException",{enumerable:!0,get:function(){return r.AbortException}}),Object.defineProperty(lt,"AnnotationEditorLayer",{enumerable:!0,get:function(){return B.AnnotationEditorLayer}}),Object.defineProperty(lt,"AnnotationEditorParamsType",{enumerable:!0,get:function(){return r.AnnotationEditorParamsType}}),Object.defineProperty(lt,"AnnotationEditorType",{enumerable:!0,get:function(){return r.AnnotationEditorType}}),Object.defineProperty(lt,"AnnotationEditorUIManager",{enumerable:!0,get:function(){return Q.AnnotationEditorUIManager}}),Object.defineProperty(lt,"AnnotationLayer",{enumerable:!0,get:function(){return U.AnnotationLayer}}),Object.defineProperty(lt,"AnnotationMode",{enumerable:!0,get:function(){return r.AnnotationMode}}),Object.defineProperty(lt,"CMapCompressionType",{enumerable:!0,get:function(){return r.CMapCompressionType}}),Object.defineProperty(lt,"DOMSVGFactory",{enumerable:!0,get:function(){return M.DOMSVGFactory}}),Object.defineProperty(lt,"FeatureTest",{enumerable:!0,get:function(){return r.FeatureTest}}),Object.defineProperty(lt,"GlobalWorkerOptions",{enumerable:!0,get:function(){return O.GlobalWorkerOptions}}),Object.defineProperty(lt,"ImageKind",{enumerable:!0,get:function(){return r.ImageKind}}),Object.defineProperty(lt,"InvalidPDFException",{enumerable:!0,get:function(){return r.InvalidPDFException}}),Object.defineProperty(lt,"MissingPDFException",{enumerable:!0,get:function(){return r.MissingPDFException}}),Object.defineProperty(lt,"OPS",{enumerable:!0,get:function(){return r.OPS}}),Object.defineProperty(lt,"PDFDataRangeTransport",{enumerable:!0,get:function(){return h.PDFDataRangeTransport}}),Object.defineProperty(lt,"PDFDateString",{enumerable:!0,get:function(){return M.PDFDateString}}),Object.defineProperty(lt,"PDFWorker",{enumerable:!0,get:function(){return h.PDFWorker}}),Object.defineProperty(lt,"PasswordResponses",{enumerable:!0,get:function(){return r.PasswordResponses}}),Object.defineProperty(lt,"PermissionFlag",{enumerable:!0,get:function(){return r.PermissionFlag}}),Object.defineProperty(lt,"PixelsPerInch",{enumerable:!0,get:function(){return M.PixelsPerInch}}),Object.defineProperty(lt,"PromiseCapability",{enumerable:!0,get:function(){return r.PromiseCapability}}),Object.defineProperty(lt,"RenderingCancelledException",{enumerable:!0,get:function(){return M.RenderingCancelledException}}),Object.defineProperty(lt,"SVGGraphics",{enumerable:!0,get:function(){return h.SVGGraphics}}),Object.defineProperty(lt,"UnexpectedResponseException",{enumerable:!0,get:function(){return r.UnexpectedResponseException}}),Object.defineProperty(lt,"Util",{enumerable:!0,get:function(){return r.Util}}),Object.defineProperty(lt,"VerbosityLevel",{enumerable:!0,get:function(){return r.VerbosityLevel}}),Object.defineProperty(lt,"XfaLayer",{enumerable:!0,get:function(){return I.XfaLayer}}),Object.defineProperty(lt,"build",{enumerable:!0,get:function(){return h.build}}),Object.defineProperty(lt,"createValidAbsoluteUrl",{enumerable:!0,get:function(){return r.createValidAbsoluteUrl}}),Object.defineProperty(lt,"getDocument",{enumerable:!0,get:function(){return h.getDocument}}),Object.defineProperty(lt,"getFilenameFromUrl",{enumerable:!0,get:function(){return M.getFilenameFromUrl}}),Object.defineProperty(lt,"getPdfFilenameFromUrl",{enumerable:!0,get:function(){return M.getPdfFilenameFromUrl}}),Object.defineProperty(lt,"getXfaPageViewport",{enumerable:!0,get:function(){return M.getXfaPageViewport}}),Object.defineProperty(lt,"isDataScheme",{enumerable:!0,get:function(){return M.isDataScheme}}),Object.defineProperty(lt,"isPdfFile",{enumerable:!0,get:function(){return M.isPdfFile}}),Object.defineProperty(lt,"loadScript",{enumerable:!0,get:function(){return M.loadScript}}),Object.defineProperty(lt,"noContextMenu",{enumerable:!0,get:function(){return M.noContextMenu}}),Object.defineProperty(lt,"normalizeUnicode",{enumerable:!0,get:function(){return r.normalizeUnicode}}),Object.defineProperty(lt,"renderTextLayer",{enumerable:!0,get:function(){return p.renderTextLayer}}),Object.defineProperty(lt,"setLayerDimensions",{enumerable:!0,get:function(){return M.setLayerDimensions}}),Object.defineProperty(lt,"shadow",{enumerable:!0,get:function(){return r.shadow}}),Object.defineProperty(lt,"updateTextLayer",{enumerable:!0,get:function(){return p.updateTextLayer}}),Object.defineProperty(lt,"version",{enumerable:!0,get:function(){return h.version}});var r=__w_pdfjs_require__(1),h=__w_pdfjs_require__(2),M=__w_pdfjs_require__(6),p=__w_pdfjs_require__(26),B=__w_pdfjs_require__(27),Q=__w_pdfjs_require__(5),U=__w_pdfjs_require__(29),O=__w_pdfjs_require__(14),I=__w_pdfjs_require__(32)})(),__webpack_exports__})())})(pdf$1);var pdfExports$1=pdf$1.exports,ZZ=Object.defineProperty,sZ=(lt,r,h)=>r in lt?ZZ(lt,r,{enumerable:!0,configurable:!0,writable:!0,value:h}):lt[r]=h,tt=(lt,r,h)=>(sZ(lt,typeof r!="symbol"?r+"":r,h),h),ft=(lt,r,h)=>{if(!r.has(lt))throw TypeError("Cannot "+h)},t=(lt,r,h)=>(ft(lt,r,"read from private field"),h?h.call(lt):r.get(lt)),E=(lt,r,h)=>{if(r.has(lt))throw TypeError("Cannot add the same private member more than once");r instanceof WeakSet?r.add(lt):r.set(lt,h)},Zl=(lt,r,h,M)=>(ft(lt,r,"write to private field"),r.set(lt,h),h),mt=(lt,r,h,M)=>({set _(p){Zl(lt,r,p)},get _(){return t(lt,r,M)}}),A=(lt,r,h)=>(ft(lt,r,"access private method"),h),commonjsGlobal=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function getAugmentedNamespace(lt){if(lt.__esModule)return lt;var r=lt.default;if(typeof r=="function"){var h=function M(){return this instanceof M?Reflect.construct(r,arguments,this.constructor):r.apply(this,arguments)};h.prototype=r.prototype}else h={};return Object.defineProperty(h,"__esModule",{value:!0}),Object.keys(lt).forEach(function(M){var p=Object.getOwnPropertyDescriptor(lt,M);Object.defineProperty(h,M,p.get?p:{enumerable:!0,get:function(){return lt[M]}})}),h}function commonjsRequire(lt){throw new Error('Could not dynamically require "'+lt+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var pdf={exports:{}};const __viteBrowserExternal={},__viteBrowserExternal$1=Object.freeze(Object.defineProperty({__proto__:null,default:__viteBrowserExternal},Symbol.toStringTag,{value:"Module"})),require$$6=getAugmentedNamespace(__viteBrowserExternal$1);var path2dPolyfill_esm={},hasRequiredPath2dPolyfill_esm;function requirePath2dPolyfill_esm(){if(hasRequiredPath2dPolyfill_esm)return path2dPolyfill_esm;hasRequiredPath2dPolyfill_esm=1;function lt(S,k,T){for(var g=0,F=k.length,J;g<F;g++)(J||!(g in k))&&(J||(J=Array.prototype.slice.call(k,0,g)),J[g]=k[g]);return S.concat(J||Array.prototype.slice.call(k))}var r={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},h=/([astvzqmhlc])([^astvzqmhlc]*)/gi,M=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi;function p(S){var k=S.match(M);return k?k.map(Number):[]}function B(S){var k=[],T=String(S).trim();return T[0]!=="M"&&T[0]!=="m"||T.replace(h,function(g,F,J){var v=p(J),u=F.toLowerCase(),m=F;if(u==="m"&&v.length>2&&(k.push(lt([m],v.splice(0,2))),u="l",m=m==="m"?"l":"L"),v.length<r[u])return"";for(k.push(lt([m],v.splice(0,r[u])));v.length>=r[u]&&v.length&&r[u];)k.push(lt([m],v.splice(0,r[u])));return""}),k}function Q(S,k){var T=S.x*Math.cos(k)-S.y*Math.sin(k),g=S.y*Math.cos(k)+S.x*Math.sin(k);S.x=T,S.y=g}function U(S,k,T){S.x+=k,S.y+=T}function O(S,k){S.x*=k,S.y*=k}var I=function(){function S(k){var T;this.commands=[],k&&k instanceof S?(T=this.commands).push.apply(T,k.commands):k&&(this.commands=B(k))}return S.prototype.addPath=function(k){var T;k&&k instanceof S&&(T=this.commands).push.apply(T,k.commands)},S.prototype.moveTo=function(k,T){this.commands.push(["M",k,T])},S.prototype.lineTo=function(k,T){this.commands.push(["L",k,T])},S.prototype.arc=function(k,T,g,F,J,v){this.commands.push(["AC",k,T,g,F,J,!!v])},S.prototype.arcTo=function(k,T,g,F,J){this.commands.push(["AT",k,T,g,F,J])},S.prototype.ellipse=function(k,T,g,F,J,v,u,m){this.commands.push(["E",k,T,g,F,J,v,u,!!m])},S.prototype.closePath=function(){this.commands.push(["Z"])},S.prototype.bezierCurveTo=function(k,T,g,F,J,v){this.commands.push(["C",k,T,g,F,J,v])},S.prototype.quadraticCurveTo=function(k,T,g,F){this.commands.push(["Q",k,T,g,F])},S.prototype.rect=function(k,T,g,F){this.commands.push(["R",k,T,g,F])},S.prototype.roundRect=function(k,T,g,F,J){typeof J>"u"?this.commands.push(["RR",k,T,g,F,0]):this.commands.push(["RR",k,T,g,F,J])},S}();function j(S,k){var T=0,g=0,F,J,v,u,m,_,$,P,Zt,dt,It,xt,it,Xt,zt,Gt,Nt,Ut,Vt,Ht,Pt,at=null,R=null,w=null,X=null,C=null,H=null;S.beginPath();for(var st=0;st<k.length;++st){Ut=k[st][0],Ut!=="S"&&Ut!=="s"&&Ut!=="C"&&Ut!=="c"&&(at=null,R=null),Ut!=="T"&&Ut!=="t"&&Ut!=="Q"&&Ut!=="q"&&(w=null,X=null);var et=void 0;switch(Ut){case"m":case"M":et=k[st],Ut==="m"?(T+=et[1],g+=et[2]):(T=et[1],g=et[2]),(Ut==="M"||!C)&&(C={x:T,y:g}),S.moveTo(T,g);break;case"l":et=k[st],T+=et[1],g+=et[2],S.lineTo(T,g);break;case"L":et=k[st],T=et[1],g=et[2],S.lineTo(T,g);break;case"H":et=k[st],T=et[1],S.lineTo(T,g);break;case"h":et=k[st],T+=et[1],S.lineTo(T,g);break;case"V":et=k[st],g=et[1],S.lineTo(T,g);break;case"v":et=k[st],g+=et[1],S.lineTo(T,g);break;case"a":case"A":if(et=k[st],H===null)throw new Error("This should never happen");Ut==="a"?(T+=et[6],g+=et[7]):(T=et[6],g=et[7]),Xt=et[1],zt=et[2],$=et[3]*Math.PI/180,v=!!et[4],u=!!et[5],m={x:T,y:g},_={x:(H.x-m.x)/2,y:(H.y-m.y)/2},Q(_,-$),P=_.x*_.x/(Xt*Xt)+_.y*_.y/(zt*zt),P>1&&(P=Math.sqrt(P),Xt*=P,zt*=P),Vt={x:Xt*_.y/zt,y:-(zt*_.x)/Xt},Zt=Xt*Xt*zt*zt,dt=Xt*Xt*_.y*_.y+zt*zt*_.x*_.x,u!==v?O(Vt,Math.sqrt((Zt-dt)/dt)||0):O(Vt,-Math.sqrt((Zt-dt)/dt)||0),J=Math.atan2((_.y-Vt.y)/zt,(_.x-Vt.x)/Xt),F=Math.atan2(-(_.y+Vt.y)/zt,-(_.x+Vt.x)/Xt),Q(Vt,$),U(Vt,(m.x+H.x)/2,(m.y+H.y)/2),S.save(),S.translate(Vt.x,Vt.y),S.rotate($),S.scale(Xt,zt),S.arc(0,0,1,J,F,!u),S.restore();break;case"C":et=k[st],at=et[3],R=et[4],T=et[5],g=et[6],S.bezierCurveTo(et[1],et[2],at,R,T,g);break;case"c":et=k[st],S.bezierCurveTo(et[1]+T,et[2]+g,et[3]+T,et[4]+g,et[5]+T,et[6]+g),at=et[3]+T,R=et[4]+g,T+=et[5],g+=et[6];break;case"S":et=k[st],(at===null||R===null)&&(at=T,R=g),S.bezierCurveTo(2*T-at,2*g-R,et[1],et[2],et[3],et[4]),at=et[1],R=et[2],T=et[3],g=et[4];break;case"s":et=k[st],(at===null||R===null)&&(at=T,R=g),S.bezierCurveTo(2*T-at,2*g-R,et[1]+T,et[2]+g,et[3]+T,et[4]+g),at=et[1]+T,R=et[2]+g,T+=et[3],g+=et[4];break;case"Q":et=k[st],w=et[1],X=et[2],T=et[3],g=et[4],S.quadraticCurveTo(w,X,T,g);break;case"q":et=k[st],w=et[1]+T,X=et[2]+g,T+=et[3],g+=et[4],S.quadraticCurveTo(w,X,T,g);break;case"T":et=k[st],(w===null||X===null)&&(w=T,X=g),w=2*T-w,X=2*g-X,T=et[1],g=et[2],S.quadraticCurveTo(w,X,T,g);break;case"t":et=k[st],(w===null||X===null)&&(w=T,X=g),w=2*T-w,X=2*g-X,T+=et[1],g+=et[2],S.quadraticCurveTo(w,X,T,g);break;case"z":case"Z":C&&(T=C.x,g=C.y),C=null,S.closePath();break;case"AC":et=k[st],T=et[1],g=et[2],it=et[3],J=et[4],F=et[5],Ht=et[6],S.arc(T,g,it,J,F,Ht);break;case"AT":et=k[st],It=et[1],xt=et[2],T=et[3],g=et[4],it=et[5],S.arcTo(It,xt,T,g,it);break;case"E":et=k[st],T=et[1],g=et[2],Xt=et[3],zt=et[4],$=et[5],J=et[6],F=et[7],Ht=et[8],S.save(),S.translate(T,g),S.rotate($),S.scale(Xt,zt),S.arc(0,0,1,J,F,Ht),S.restore();break;case"R":et=k[st],T=et[1],g=et[2],Gt=et[3],Nt=et[4],C={x:T,y:g},S.rect(T,g,Gt,Nt);break;case"RR":et=k[st],T=et[1],g=et[2],Gt=et[3],Nt=et[4],Pt=et[5],C={x:T,y:g},S.roundRect(T,g,Gt,Nt,Pt);break}H?(H.x=T,H.y=g):H={x:T,y:g}}}function q(S){if(!(!S||!S.CanvasRenderingContext2D||S.Path2D)){var k=S.CanvasRenderingContext2D,T=k.prototype.fill,g=k.prototype.stroke,F=k.prototype.isPointInPath;k.prototype.fill=function(){for(var J=[],v=0;v<arguments.length;v++)J[v]=arguments[v];if(J[0]instanceof I){var u=J[0],m=J[1]||"nonzero";j(this,u.commands),T.apply(this,[m])}else{var m=J[0]||"nonzero";return T.apply(this,[m])}},k.prototype.stroke=function(J){J&&j(this,J.commands),g.apply(this)},k.prototype.isPointInPath=function(){for(var J=[],v=0;v<arguments.length;v++)J[v]=arguments[v];if(J[0]instanceof I){var u=J[0],m=J[1],_=J[2],$=J[3]||"nonzero";return j(this,u.commands),F.apply(this,[m,_,$])}else return F.apply(this,J)},S.Path2D=I}}function K(S,k,T,g,F){var J=this;if(F===void 0&&(F=0),typeof F=="number"&&(F=[F]),Array.isArray(F)){if(F.length===0||F.length>4)throw new RangeError("Failed to execute 'roundRect' on '".concat(this.constructor.name,"': ").concat(F.length," radii provided. Between one and four radii are necessary."));F.forEach(function(P){if(P<0)throw new RangeError("Failed to execute 'roundRect' on '".concat(J.constructor.name,"': Radius value ").concat(P," is negative."))})}else return;if(F.length===1&&F[0]===0)return this.rect(S,k,T,g);var v=Math.min(T,g)/2,u,m,_,$=u=m=_=Math.min(v,F[0]);F.length===2&&(u=_=Math.min(v,F[1])),F.length===3&&(u=_=Math.min(v,F[1]),m=Math.min(v,F[2])),F.length===4&&(u=Math.min(v,F[1]),m=Math.min(v,F[2]),_=Math.min(v,F[3])),this.moveTo(S,k+g-_),this.arcTo(S,k,S+$,k,$),this.arcTo(S+T,k,S+T,k+u,u),this.arcTo(S+T,k+g,S+T-m,k+g,m),this.arcTo(S,k+g,S,k+g-_,_),this.moveTo(S,k)}function f(S){if(!(!S||!S.CanvasRenderingContext2D)){var k=S.CanvasRenderingContext2D,T=S.Path2D;k&&!k.prototype.roundRect&&(k.prototype.roundRect=K),T&&!T.prototype.roundRect&&(T.prototype.roundRect=K)}}return q(window),f(window),path2dPolyfill_esm}(function(module,exports){(function(lt,r){module.exports=lt.pdfjsLib=r()})(globalThis,()=>(()=>{var __webpack_modules__=[,(lt,r,h)=>{var M;Object.defineProperty(r,"__esModule",{value:!0}),r.VerbosityLevel=r.Util=r.UnknownErrorException=r.UnexpectedResponseException=r.TextRenderingMode=r.RenderingIntentFlag=r.PromiseCapability=r.PermissionFlag=r.PasswordResponses=r.PasswordException=r.PageActionEventType=r.OPS=r.MissingPDFException=r.MAX_IMAGE_SIZE_TO_CACHE=r.LINE_FACTOR=r.LINE_DESCENT_FACTOR=r.InvalidPDFException=r.ImageKind=r.IDENTITY_MATRIX=r.FormatError=r.FeatureTest=r.FONT_IDENTITY_MATRIX=r.DocumentActionEventType=r.CMapCompressionType=r.BaseException=r.BASELINE_FACTOR=r.AnnotationType=r.AnnotationReplyType=r.AnnotationPrefix=r.AnnotationMode=r.AnnotationFlag=r.AnnotationFieldFlag=r.AnnotationEditorType=r.AnnotationEditorPrefix=r.AnnotationEditorParamsType=r.AnnotationBorderStyleType=r.AnnotationActionEventType=r.AbortException=void 0,r.assert=Ht,r.bytesToString=gt,r.createValidAbsoluteUrl=at,r.getModificationDate=Yl,r.getUuid=Vl,r.getVerbosityLevel=Gt,r.info=Nt,r.isArrayBuffer=dl,r.isArrayEqual=rl,r.isNodeJS=void 0,r.normalizeUnicode=yl,r.objectFromMap=vt,r.objectSize=qt,r.setVerbosityLevel=zt,r.shadow=R,r.string32=Dt,r.stringToBytes=Jt,r.stringToPDFString=pt,r.stringToUTF8String=Ct,r.unreachable=Vt,r.utf8StringToString=$t,r.warn=Ut,h(2),h(84),h(86),h(87),h(89),h(93),h(101),h(102),h(105),h(107),h(109),h(113),h(116),h(123);const p=typeof process=="object"&&process+""=="[object process]"&&!process.versions.nw&&!(process.versions.electron&&process.type&&process.type!=="browser");r.isNodeJS=p;const B=[1,0,0,1,0,0];r.IDENTITY_MATRIX=B;const Q=[.001,0,0,.001,0,0];r.FONT_IDENTITY_MATRIX=Q;const U=1e7;r.MAX_IMAGE_SIZE_TO_CACHE=U;const O=1.35;r.LINE_FACTOR=O;const I=.35;r.LINE_DESCENT_FACTOR=I;const j=I/O;r.BASELINE_FACTOR=j;const q={ANY:1,DISPLAY:2,PRINT:4,SAVE:8,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,OPLIST:256};r.RenderingIntentFlag=q;const K={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3};r.AnnotationMode=K;const f="pdfjs_internal_editor_";r.AnnotationEditorPrefix=f;const S={DISABLE:-1,NONE:0,FREETEXT:3,STAMP:13,INK:15};r.AnnotationEditorType=S;const k={RESIZE:1,CREATE:2,FREETEXT_SIZE:11,FREETEXT_COLOR:12,FREETEXT_OPACITY:13,INK_COLOR:21,INK_THICKNESS:22,INK_OPACITY:23};r.AnnotationEditorParamsType=k;const T={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048};r.PermissionFlag=T;const g={FILL:0,STROKE:1,FILL_STROKE:2,INVISIBLE:3,FILL_ADD_TO_PATH:4,STROKE_ADD_TO_PATH:5,FILL_STROKE_ADD_TO_PATH:6,ADD_TO_PATH:7,FILL_STROKE_MASK:3,ADD_TO_PATH_FLAG:4};r.TextRenderingMode=g;const F={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3};r.ImageKind=F;const J={TEXT:1,LINK:2,FREETEXT:3,LINE:4,SQUARE:5,CIRCLE:6,POLYGON:7,POLYLINE:8,HIGHLIGHT:9,UNDERLINE:10,SQUIGGLY:11,STRIKEOUT:12,STAMP:13,CARET:14,INK:15,POPUP:16,FILEATTACHMENT:17,SOUND:18,MOVIE:19,WIDGET:20,SCREEN:21,PRINTERMARK:22,TRAPNET:23,WATERMARK:24,THREED:25,REDACT:26};r.AnnotationType=J;const v={GROUP:"Group",REPLY:"R"};r.AnnotationReplyType=v;const u={INVISIBLE:1,HIDDEN:2,PRINT:4,NOZOOM:8,NOROTATE:16,NOVIEW:32,READONLY:64,LOCKED:128,TOGGLENOVIEW:256,LOCKEDCONTENTS:512};r.AnnotationFlag=u;const m={READONLY:1,REQUIRED:2,NOEXPORT:4,MULTILINE:4096,PASSWORD:8192,NOTOGGLETOOFF:16384,RADIO:32768,PUSHBUTTON:65536,COMBO:131072,EDIT:262144,SORT:524288,FILESELECT:1048576,MULTISELECT:2097152,DONOTSPELLCHECK:4194304,DONOTSCROLL:8388608,COMB:16777216,RICHTEXT:33554432,RADIOSINUNISON:33554432,COMMITONSELCHANGE:67108864};r.AnnotationFieldFlag=m;const _={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5};r.AnnotationBorderStyleType=_;const $={E:"Mouse Enter",X:"Mouse Exit",D:"Mouse Down",U:"Mouse Up",Fo:"Focus",Bl:"Blur",PO:"PageOpen",PC:"PageClose",PV:"PageVisible",PI:"PageInvisible",K:"Keystroke",F:"Format",V:"Validate",C:"Calculate"};r.AnnotationActionEventType=$;const P={WC:"WillClose",WS:"WillSave",DS:"DidSave",WP:"WillPrint",DP:"DidPrint"};r.DocumentActionEventType=P;const Zt={O:"PageOpen",C:"PageClose"};r.PageActionEventType=Zt;const dt={ERRORS:0,WARNINGS:1,INFOS:5};r.VerbosityLevel=dt;const It={NONE:0,BINARY:1};r.CMapCompressionType=It;const xt={dependency:1,setLineWidth:2,setLineCap:3,setLineJoin:4,setMiterLimit:5,setDash:6,setRenderingIntent:7,setFlatness:8,setGState:9,save:10,restore:11,transform:12,moveTo:13,lineTo:14,curveTo:15,curveTo2:16,curveTo3:17,closePath:18,rectangle:19,stroke:20,closeStroke:21,fill:22,eoFill:23,fillStroke:24,eoFillStroke:25,closeFillStroke:26,closeEOFillStroke:27,endPath:28,clip:29,eoClip:30,beginText:31,endText:32,setCharSpacing:33,setWordSpacing:34,setHScale:35,setLeading:36,setFont:37,setTextRenderingMode:38,setTextRise:39,moveText:40,setLeadingMoveText:41,setTextMatrix:42,nextLine:43,showText:44,showSpacedText:45,nextLineShowText:46,nextLineSetSpacingShowText:47,setCharWidth:48,setCharWidthAndBounds:49,setStrokeColorSpace:50,setFillColorSpace:51,setStrokeColor:52,setStrokeColorN:53,setFillColor:54,setFillColorN:55,setStrokeGray:56,setFillGray:57,setStrokeRGBColor:58,setFillRGBColor:59,setStrokeCMYKColor:60,setFillCMYKColor:61,shadingFill:62,beginInlineImage:63,beginImageData:64,endInlineImage:65,paintXObject:66,markPoint:67,markPointProps:68,beginMarkedContent:69,beginMarkedContentProps:70,endMarkedContent:71,beginCompat:72,endCompat:73,paintFormXObjectBegin:74,paintFormXObjectEnd:75,beginGroup:76,endGroup:77,beginAnnotation:80,endAnnotation:81,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,paintSolidColorImageMask:90,constructPath:91};r.OPS=xt;const it={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};r.PasswordResponses=it;let Xt=dt.WARNINGS;function zt(ot){Number.isInteger(ot)&&(Xt=ot)}function Gt(){return Xt}function Nt(ot){Xt>=dt.INFOS&&console.log(`Info: ${ot}`)}function Ut(ot){Xt>=dt.WARNINGS&&console.log(`Warning: ${ot}`)}function Vt(ot){throw new Error(ot)}function Ht(ot,ut){ot||Vt(ut)}function Pt(ot){switch(ot==null?void 0:ot.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}function at(ot){let ut=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,Tt=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;if(!ot)return null;try{if(Tt&&typeof ot=="string"){if(Tt.addDefaultProtocol&&ot.startsWith("www.")){const Ot=ot.match(/\./g);(Ot==null?void 0:Ot.length)>=2&&(ot=`http://${ot}`)}if(Tt.tryConvertEncoding)try{ot=Ct(ot)}catch{}}const jt=ut?new URL(ot,ut):new URL(ot);if(Pt(jt))return jt}catch{}return null}function R(ot,ut,Tt){let jt=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;return Object.defineProperty(ot,ut,{value:Tt,enumerable:!jt,configurable:!0,writable:!1}),Tt}const w=function(){function ot(ut,Tt){this.constructor===ot&&Vt("Cannot initialize BaseException."),this.message=ut,this.name=Tt}return ot.prototype=new Error,ot.constructor=ot,ot}();r.BaseException=w;class X extends w{constructor(ut,Tt){super(ut,"PasswordException"),this.code=Tt}}r.PasswordException=X;class C extends w{constructor(ut,Tt){super(ut,"UnknownErrorException"),this.details=Tt}}r.UnknownErrorException=C;class H extends w{constructor(ut){super(ut,"InvalidPDFException")}}r.InvalidPDFException=H;class st extends w{constructor(ut){super(ut,"MissingPDFException")}}r.MissingPDFException=st;class et extends w{constructor(ut,Tt){super(ut,"UnexpectedResponseException"),this.status=Tt}}r.UnexpectedResponseException=et;class Mt extends w{constructor(ut){super(ut,"FormatError")}}r.FormatError=Mt;class Rt extends w{constructor(ut){super(ut,"AbortException")}}r.AbortException=Rt;function gt(ot){(typeof ot!="object"||(ot==null?void 0:ot.length)===void 0)&&Vt("Invalid argument for bytesToString");const ut=ot.length,Tt=8192;if(ut<Tt)return String.fromCharCode.apply(null,ot);const jt=[];for(let Ot=0;Ot<ut;Ot+=Tt){const Lt=Math.min(Ot+Tt,ut),yt=ot.subarray(Ot,Lt);jt.push(String.fromCharCode.apply(null,yt))}return jt.join("")}function Jt(ot){typeof ot!="string"&&Vt("Invalid argument for stringToBytes");const ut=ot.length,Tt=new Uint8Array(ut);for(let jt=0;jt<ut;++jt)Tt[jt]=ot.charCodeAt(jt)&255;return Tt}function Dt(ot){return String.fromCharCode(ot>>24&255,ot>>16&255,ot>>8&255,ot&255)}function qt(ot){return Object.keys(ot).length}function vt(ot){const ut=Object.create(null);for(const[Tt,jt]of ot)ut[Tt]=jt;return ut}function cl(){const ot=new Uint8Array(4);return ot[0]=1,new Uint32Array(ot.buffer,0,1)[0]===1}function bl(){try{return new Function(""),!0}catch{return!1}}class il{static get isLittleEndian(){return R(this,"isLittleEndian",cl())}static get isEvalSupported(){return R(this,"isEvalSupported",bl())}static get isOffscreenCanvasSupported(){return R(this,"isOffscreenCanvasSupported",typeof OffscreenCanvas<"u")}static get platform(){return typeof navigator>"u"?R(this,"platform",{isWin:!1,isMac:!1}):R(this,"platform",{isWin:navigator.platform.includes("Win"),isMac:navigator.platform.includes("Mac")})}static get isCSSRoundSupported(){var ut,Tt;return R(this,"isCSSRoundSupported",(Tt=(ut=globalThis.CSS)==null?void 0:ut.supports)==null?void 0:Tt.call(ut,"width: round(1.5px, 1px)"))}}r.FeatureTest=il;const Bt=[...Array(256).keys()].map(ot=>ot.toString(16).padStart(2,"0"));class Ft{static makeHexColor(ut,Tt,jt){return`#${Bt[ut]}${Bt[Tt]}${Bt[jt]}`}static scaleMinMax(ut,Tt){let jt;ut[0]?(ut[0]<0&&(jt=Tt[0],Tt[0]=Tt[1],Tt[1]=jt),Tt[0]*=ut[0],Tt[1]*=ut[0],ut[3]<0&&(jt=Tt[2],Tt[2]=Tt[3],Tt[3]=jt),Tt[2]*=ut[3],Tt[3]*=ut[3]):(jt=Tt[0],Tt[0]=Tt[2],Tt[2]=jt,jt=Tt[1],Tt[1]=Tt[3],Tt[3]=jt,ut[1]<0&&(jt=Tt[2],Tt[2]=Tt[3],Tt[3]=jt),Tt[2]*=ut[1],Tt[3]*=ut[1],ut[2]<0&&(jt=Tt[0],Tt[0]=Tt[1],Tt[1]=jt),Tt[0]*=ut[2],Tt[1]*=ut[2]),Tt[0]+=ut[4],Tt[1]+=ut[4],Tt[2]+=ut[5],Tt[3]+=ut[5]}static transform(ut,Tt){return[ut[0]*Tt[0]+ut[2]*Tt[1],ut[1]*Tt[0]+ut[3]*Tt[1],ut[0]*Tt[2]+ut[2]*Tt[3],ut[1]*Tt[2]+ut[3]*Tt[3],ut[0]*Tt[4]+ut[2]*Tt[5]+ut[4],ut[1]*Tt[4]+ut[3]*Tt[5]+ut[5]]}static applyTransform(ut,Tt){const jt=ut[0]*Tt[0]+ut[1]*Tt[2]+Tt[4],Ot=ut[0]*Tt[1]+ut[1]*Tt[3]+Tt[5];return[jt,Ot]}static applyInverseTransform(ut,Tt){const jt=Tt[0]*Tt[3]-Tt[1]*Tt[2],Ot=(ut[0]*Tt[3]-ut[1]*Tt[2]+Tt[2]*Tt[5]-Tt[4]*Tt[3])/jt,Lt=(-ut[0]*Tt[1]+ut[1]*Tt[0]+Tt[4]*Tt[1]-Tt[5]*Tt[0])/jt;return[Ot,Lt]}static getAxialAlignedBoundingBox(ut,Tt){const jt=this.applyTransform(ut,Tt),Ot=this.applyTransform(ut.slice(2,4),Tt),Lt=this.applyTransform([ut[0],ut[3]],Tt),yt=this.applyTransform([ut[2],ut[1]],Tt);return[Math.min(jt[0],Ot[0],Lt[0],yt[0]),Math.min(jt[1],Ot[1],Lt[1],yt[1]),Math.max(jt[0],Ot[0],Lt[0],yt[0]),Math.max(jt[1],Ot[1],Lt[1],yt[1])]}static inverseTransform(ut){const Tt=ut[0]*ut[3]-ut[1]*ut[2];return[ut[3]/Tt,-ut[1]/Tt,-ut[2]/Tt,ut[0]/Tt,(ut[2]*ut[5]-ut[4]*ut[3])/Tt,(ut[4]*ut[1]-ut[5]*ut[0])/Tt]}static singularValueDecompose2dScale(ut){const Tt=[ut[0],ut[2],ut[1],ut[3]],jt=ut[0]*Tt[0]+ut[1]*Tt[2],Ot=ut[0]*Tt[1]+ut[1]*Tt[3],Lt=ut[2]*Tt[0]+ut[3]*Tt[2],yt=ut[2]*Tt[1]+ut[3]*Tt[3],Kt=(jt+yt)/2,tl=Math.sqrt((jt+yt)**2-4*(jt*yt-Lt*Ot))/2,el=Kt+tl||1,ol=Kt-tl||1;return[Math.sqrt(el),Math.sqrt(ol)]}static normalizeRect(ut){const Tt=ut.slice(0);return ut[0]>ut[2]&&(Tt[0]=ut[2],Tt[2]=ut[0]),ut[1]>ut[3]&&(Tt[1]=ut[3],Tt[3]=ut[1]),Tt}static intersect(ut,Tt){const jt=Math.max(Math.min(ut[0],ut[2]),Math.min(Tt[0],Tt[2])),Ot=Math.min(Math.max(ut[0],ut[2]),Math.max(Tt[0],Tt[2]));if(jt>Ot)return null;const Lt=Math.max(Math.min(ut[1],ut[3]),Math.min(Tt[1],Tt[3])),yt=Math.min(Math.max(ut[1],ut[3]),Math.max(Tt[1],Tt[3]));return Lt>yt?null:[jt,Lt,Ot,yt]}static bezierBoundingBox(ut,Tt,jt,Ot,Lt,yt,Kt,tl){const el=[],ol=[[],[]];let Qt,Ml,hl,Il,Wl,nt,L,ct;for(let Et=0;Et<2;++Et){if(Et===0?(Ml=6*ut-12*jt+6*Lt,Qt=-3*ut+9*jt-9*Lt+3*Kt,hl=3*jt-3*ut):(Ml=6*Tt-12*Ot+6*yt,Qt=-3*Tt+9*Ot-9*yt+3*tl,hl=3*Ot-3*Tt),Math.abs(Qt)<1e-12){if(Math.abs(Ml)<1e-12)continue;Il=-hl/Ml,0<Il&&Il<1&&el.push(Il);continue}L=Ml*Ml-4*hl*Qt,ct=Math.sqrt(L),!(L<0)&&(Wl=(-Ml+ct)/(2*Qt),0<Wl&&Wl<1&&el.push(Wl),nt=(-Ml-ct)/(2*Qt),0<nt&&nt<1&&el.push(nt))}let Wt=el.length,Yt;const kt=Wt;for(;Wt--;)Il=el[Wt],Yt=1-Il,ol[0][Wt]=Yt*Yt*Yt*ut+3*Yt*Yt*Il*jt+3*Yt*Il*Il*Lt+Il*Il*Il*Kt,ol[1][Wt]=Yt*Yt*Yt*Tt+3*Yt*Yt*Il*Ot+3*Yt*Il*Il*yt+Il*Il*Il*tl;return ol[0][kt]=ut,ol[1][kt]=Tt,ol[0][kt+1]=Kt,ol[1][kt+1]=tl,ol[0].length=ol[1].length=kt+2,[Math.min(...ol[0]),Math.min(...ol[1]),Math.max(...ol[0]),Math.max(...ol[1])]}}r.Util=Ft;const wt=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,728,711,710,729,733,731,730,732,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8226,8224,8225,8230,8212,8211,402,8260,8249,8250,8722,8240,8222,8220,8221,8216,8217,8218,8482,64257,64258,321,338,352,376,381,305,322,339,353,382,0,8364];function pt(ot){if(ot[0]>="ï"){let Tt;if(ot[0]==="þ"&&ot[1]==="ÿ"?Tt="utf-16be":ot[0]==="ÿ"&&ot[1]==="þ"?Tt="utf-16le":ot[0]==="ï"&&ot[1]==="»"&&ot[2]==="¿"&&(Tt="utf-8"),Tt)try{const jt=new TextDecoder(Tt,{fatal:!0}),Ot=Jt(ot);return jt.decode(Ot)}catch(jt){Ut(`stringToPDFString: "${jt}".`)}}const ut=[];for(let Tt=0,jt=ot.length;Tt<jt;Tt++){const Ot=wt[ot.charCodeAt(Tt)];ut.push(Ot?String.fromCharCode(Ot):ot.charAt(Tt))}return ut.join("")}function Ct(ot){return decodeURIComponent(escape(ot))}function $t(ot){return unescape(encodeURIComponent(ot))}function dl(ot){return typeof ot=="object"&&(ot==null?void 0:ot.byteLength)!==void 0}function rl(ot,ut){if(ot.length!==ut.length)return!1;for(let Tt=0,jt=ot.length;Tt<jt;Tt++)if(ot[Tt]!==ut[Tt])return!1;return!0}function Yl(){let ot=arguments.length>0&&arguments[0]!==void 0?arguments[0]:new Date;return[ot.getUTCFullYear().toString(),(ot.getUTCMonth()+1).toString().padStart(2,"0"),ot.getUTCDate().toString().padStart(2,"0"),ot.getUTCHours().toString().padStart(2,"0"),ot.getUTCMinutes().toString().padStart(2,"0"),ot.getUTCSeconds().toString().padStart(2,"0")].join("")}class Xl{constructor(){E(this,M,!1),this.promise=new Promise((ut,Tt)=>{this.resolve=jt=>{Zl(this,M,!0),ut(jt)},this.reject=jt=>{Zl(this,M,!0),Tt(jt)}})}get settled(){return t(this,M)}}M=new WeakMap,r.PromiseCapability=Xl;let pl=null,Ll=null;function yl(ot){return pl||(pl=/([\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,Ll=new Map([["ſt","ſt"]])),ot.replaceAll(pl,(ut,Tt,jt)=>Tt?Tt.normalize("NFKC"):Ll.get(jt))}function Vl(){if(typeof crypto<"u"&&typeof(crypto==null?void 0:crypto.randomUUID)=="function")return crypto.randomUUID();const ot=new Uint8Array(32);if(typeof crypto<"u"&&typeof(crypto==null?void 0:crypto.getRandomValues)=="function")crypto.getRandomValues(ot);else for(let ut=0;ut<32;ut++)ot[ut]=Math.floor(Math.random()*255);return gt(ot)}const _t="pdfjs_internal_id_";r.AnnotationPrefix=_t},(lt,r,h)=>{var M=h(3),p=h(4),B=h(69),Q=h(70),U="WebAssembly",O=p[U],I=Error("e",{cause:7}).cause!==7,j=function(K,f){var S={};S[K]=Q(K,f,I),M({global:!0,constructor:!0,arity:1,forced:I},S)},q=function(K,f){if(O&&O[K]){var S={};S[K]=Q(U+"."+K,f,I),M({target:U,stat:!0,constructor:!0,arity:1,forced:I},S)}};j("Error",function(K){return function(f){return B(K,this,arguments)}}),j("EvalError",function(K){return function(f){return B(K,this,arguments)}}),j("RangeError",function(K){return function(f){return B(K,this,arguments)}}),j("ReferenceError",function(K){return function(f){return B(K,this,arguments)}}),j("SyntaxError",function(K){return function(f){return B(K,this,arguments)}}),j("TypeError",function(K){return function(f){return B(K,this,arguments)}}),j("URIError",function(K){return function(f){return B(K,this,arguments)}}),q("CompileError",function(K){return function(f){return B(K,this,arguments)}}),q("LinkError",function(K){return function(f){return B(K,this,arguments)}}),q("RuntimeError",function(K){return function(f){return B(K,this,arguments)}})},(lt,r,h)=>{var M=h(4),p=h(5).f,B=h(44),Q=h(48),U=h(38),O=h(56),I=h(68);lt.exports=function(j,q){var K=j.target,f=j.global,S=j.stat,k,T,g,F,J,v;if(f?T=M:S?T=M[K]||U(K,{}):T=(M[K]||{}).prototype,T)for(g in q){if(J=q[g],j.dontCallGetSet?(v=p(T,g),F=v&&v.value):F=T[g],k=I(f?g:K+(S?".":"#")+g,j.forced),!k&&F!==void 0){if(typeof J==typeof F)continue;O(J,F)}(j.sham||F&&F.sham)&&B(J,"sham",!0),Q(T,g,J,j)}}},function(lt){var r=function(h){return h&&h.Math===Math&&h};lt.exports=r(typeof globalThis=="object"&&globalThis)||r(typeof window=="object"&&window)||r(typeof self=="object"&&self)||r(typeof commonjsGlobal=="object"&&commonjsGlobal)||function(){return this}()||this||Function("return this")()},(lt,r,h)=>{var M=h(6),p=h(8),B=h(10),Q=h(11),U=h(12),O=h(18),I=h(39),j=h(42),q=Object.getOwnPropertyDescriptor;r.f=M?q:function(K,f){if(K=U(K),f=O(f),j)try{return q(K,f)}catch{}if(I(K,f))return Q(!p(B.f,K,f),K[f])}},(lt,r,h)=>{var M=h(7);lt.exports=!M(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7})},lt=>{lt.exports=function(r){try{return!!r()}catch{return!0}}},(lt,r,h)=>{var M=h(9),p=Function.prototype.call;lt.exports=M?p.bind(p):function(){return p.apply(p,arguments)}},(lt,r,h)=>{var M=h(7);lt.exports=!M(function(){var p=(function(){}).bind();return typeof p!="function"||p.hasOwnProperty("prototype")})},(lt,r)=>{var h={}.propertyIsEnumerable,M=Object.getOwnPropertyDescriptor,p=M&&!h.call({1:2},1);r.f=p?function(B){var Q=M(this,B);return!!Q&&Q.enumerable}:h},lt=>{lt.exports=function(r,h){return{enumerable:!(r&1),configurable:!(r&2),writable:!(r&4),value:h}}},(lt,r,h)=>{var M=h(13),p=h(16);lt.exports=function(B){return M(p(B))}},(lt,r,h)=>{var M=h(14),p=h(7),B=h(15),Q=Object,U=M("".split);lt.exports=p(function(){return!Q("z").propertyIsEnumerable(0)})?function(O){return B(O)==="String"?U(O,""):Q(O)}:Q},(lt,r,h)=>{var M=h(9),p=Function.prototype,B=p.call,Q=M&&p.bind.bind(B,B);lt.exports=M?Q:function(U){return function(){return B.apply(U,arguments)}}},(lt,r,h)=>{var M=h(14),p=M({}.toString),B=M("".slice);lt.exports=function(Q){return B(p(Q),8,-1)}},(lt,r,h)=>{var M=h(17),p=TypeError;lt.exports=function(B){if(M(B))throw p("Can't call method on "+B);return B}},lt=>{lt.exports=function(r){return r==null}},(lt,r,h)=>{var M=h(19),p=h(23);lt.exports=function(B){var Q=M(B,"string");return p(Q)?Q:Q+""}},(lt,r,h)=>{var M=h(8),p=h(20),B=h(23),Q=h(30),U=h(33),O=h(34),I=TypeError,j=O("toPrimitive");lt.exports=function(q,K){if(!p(q)||B(q))return q;var f=Q(q,j),S;if(f){if(K===void 0&&(K="default"),S=M(f,q,K),!p(S)||B(S))return S;throw I("Can't convert object to primitive value")}return K===void 0&&(K="number"),U(q,K)}},(lt,r,h)=>{var M=h(21),p=h(22),B=p.all;lt.exports=p.IS_HTMLDDA?function(Q){return typeof Q=="object"?Q!==null:M(Q)||Q===B}:function(Q){return typeof Q=="object"?Q!==null:M(Q)}},(lt,r,h)=>{var M=h(22),p=M.all;lt.exports=M.IS_HTMLDDA?function(B){return typeof B=="function"||B===p}:function(B){return typeof B=="function"}},lt=>{var r=typeof document=="object"&&document.all,h=typeof r>"u"&&r!==void 0;lt.exports={all:r,IS_HTMLDDA:h}},(lt,r,h)=>{var M=h(24),p=h(21),B=h(25),Q=h(26),U=Object;lt.exports=Q?function(O){return typeof O=="symbol"}:function(O){var I=M("Symbol");return p(I)&&B(I.prototype,U(O))}},(lt,r,h)=>{var M=h(4),p=h(21),B=function(Q){return p(Q)?Q:void 0};lt.exports=function(Q,U){return arguments.length<2?B(M[Q]):M[Q]&&M[Q][U]}},(lt,r,h)=>{var M=h(14);lt.exports=M({}.isPrototypeOf)},(lt,r,h)=>{var M=h(27);lt.exports=M&&!Symbol.sham&&typeof Symbol.iterator=="symbol"},(lt,r,h)=>{var M=h(28),p=h(7),B=h(4),Q=B.String;lt.exports=!!Object.getOwnPropertySymbols&&!p(function(){var U=Symbol("symbol detection");return!Q(U)||!(Object(U)instanceof Symbol)||!Symbol.sham&&M&&M<41})},(lt,r,h)=>{var M=h(4),p=h(29),B=M.process,Q=M.Deno,U=B&&B.versions||Q&&Q.version,O=U&&U.v8,I,j;O&&(I=O.split("."),j=I[0]>0&&I[0]<4?1:+(I[0]+I[1])),!j&&p&&(I=p.match(/Edge\/(\d+)/),(!I||I[1]>=74)&&(I=p.match(/Chrome\/(\d+)/),I&&(j=+I[1]))),lt.exports=j},lt=>{lt.exports=typeof navigator<"u"&&String(navigator.userAgent)||""},(lt,r,h)=>{var M=h(31),p=h(17);lt.exports=function(B,Q){var U=B[Q];return p(U)?void 0:M(U)}},(lt,r,h)=>{var M=h(21),p=h(32),B=TypeError;lt.exports=function(Q){if(M(Q))return Q;throw B(p(Q)+" is not a function")}},lt=>{var r=String;lt.exports=function(h){try{return r(h)}catch{return"Object"}}},(lt,r,h)=>{var M=h(8),p=h(21),B=h(20),Q=TypeError;lt.exports=function(U,O){var I,j;if(O==="string"&&p(I=U.toString)&&!B(j=M(I,U))||p(I=U.valueOf)&&!B(j=M(I,U))||O!=="string"&&p(I=U.toString)&&!B(j=M(I,U)))return j;throw Q("Can't convert object to primitive value")}},(lt,r,h)=>{var M=h(4),p=h(35),B=h(39),Q=h(41),U=h(27),O=h(26),I=M.Symbol,j=p("wks"),q=O?I.for||I:I&&I.withoutSetter||Q;lt.exports=function(K){return B(j,K)||(j[K]=U&&B(I,K)?I[K]:q("Symbol."+K)),j[K]}},(lt,r,h)=>{var M=h(36),p=h(37);(lt.exports=function(B,Q){return p[B]||(p[B]=Q!==void 0?Q:{})})("versions",[]).push({version:"3.32.2",mode:M?"pure":"global",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.32.2/LICENSE",source:"https://github.com/zloirock/core-js"})},lt=>{lt.exports=!1},(lt,r,h)=>{var M=h(4),p=h(38),B="__core-js_shared__",Q=M[B]||p(B,{});lt.exports=Q},(lt,r,h)=>{var M=h(4),p=Object.defineProperty;lt.exports=function(B,Q){try{p(M,B,{value:Q,configurable:!0,writable:!0})}catch{M[B]=Q}return Q}},(lt,r,h)=>{var M=h(14),p=h(40),B=M({}.hasOwnProperty);lt.exports=Object.hasOwn||function(Q,U){return B(p(Q),U)}},(lt,r,h)=>{var M=h(16),p=Object;lt.exports=function(B){return p(M(B))}},(lt,r,h)=>{var M=h(14),p=0,B=Math.random(),Q=M(1 .toString);lt.exports=function(U){return"Symbol("+(U===void 0?"":U)+")_"+Q(++p+B,36)}},(lt,r,h)=>{var M=h(6),p=h(7),B=h(43);lt.exports=!M&&!p(function(){return Object.defineProperty(B("div"),"a",{get:function(){return 7}}).a!==7})},(lt,r,h)=>{var M=h(4),p=h(20),B=M.document,Q=p(B)&&p(B.createElement);lt.exports=function(U){return Q?B.createElement(U):{}}},(lt,r,h)=>{var M=h(6),p=h(45),B=h(11);lt.exports=M?function(Q,U,O){return p.f(Q,U,B(1,O))}:function(Q,U,O){return Q[U]=O,Q}},(lt,r,h)=>{var M=h(6),p=h(42),B=h(46),Q=h(47),U=h(18),O=TypeError,I=Object.defineProperty,j=Object.getOwnPropertyDescriptor,q="enumerable",K="configurable",f="writable";r.f=M?B?function(S,k,T){if(Q(S),k=U(k),Q(T),typeof S=="function"&&k==="prototype"&&"value"in T&&f in T&&!T[f]){var g=j(S,k);g&&g[f]&&(S[k]=T.value,T={configurable:K in T?T[K]:g[K],enumerable:q in T?T[q]:g[q],writable:!1})}return I(S,k,T)}:I:function(S,k,T){if(Q(S),k=U(k),Q(T),p)try{return I(S,k,T)}catch{}if("get"in T||"set"in T)throw O("Accessors not supported");return"value"in T&&(S[k]=T.value),S}},(lt,r,h)=>{var M=h(6),p=h(7);lt.exports=M&&p(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42})},(lt,r,h)=>{var M=h(20),p=String,B=TypeError;lt.exports=function(Q){if(M(Q))return Q;throw B(p(Q)+" is not an object")}},(lt,r,h)=>{var M=h(21),p=h(45),B=h(49),Q=h(38);lt.exports=function(U,O,I,j){j||(j={});var q=j.enumerable,K=j.name!==void 0?j.name:O;if(M(I)&&B(I,K,j),j.global)q?U[O]=I:Q(O,I);else{try{j.unsafe?U[O]&&(q=!0):delete U[O]}catch{}q?U[O]=I:p.f(U,O,{value:I,enumerable:!1,configurable:!j.nonConfigurable,writable:!j.nonWritable})}return U}},(lt,r,h)=>{var M=h(14),p=h(7),B=h(21),Q=h(39),U=h(6),O=h(50).CONFIGURABLE,I=h(51),j=h(52),q=j.enforce,K=j.get,f=String,S=Object.defineProperty,k=M("".slice),T=M("".replace),g=M([].join),F=U&&!p(function(){return S(function(){},"length",{value:8}).length!==8}),J=String(String).split("String"),v=lt.exports=function(u,m,_){k(f(m),0,7)==="Symbol("&&(m="["+T(f(m),/^Symbol\(([^)]*)\)/,"$1")+"]"),_&&_.getter&&(m="get "+m),_&&_.setter&&(m="set "+m),(!Q(u,"name")||O&&u.name!==m)&&(U?S(u,"name",{value:m,configurable:!0}):u.name=m),F&&_&&Q(_,"arity")&&u.length!==_.arity&&S(u,"length",{value:_.arity});try{_&&Q(_,"constructor")&&_.constructor?U&&S(u,"prototype",{writable:!1}):u.prototype&&(u.prototype=void 0)}catch{}var $=q(u);return Q($,"source")||($.source=g(J,typeof m=="string"?m:"")),u};Function.prototype.toString=v(function(){return B(this)&&K(this).source||I(this)},"toString")},(lt,r,h)=>{var M=h(6),p=h(39),B=Function.prototype,Q=M&&Object.getOwnPropertyDescriptor,U=p(B,"name"),O=U&&(function(){}).name==="something",I=U&&(!M||M&&Q(B,"name").configurable);lt.exports={EXISTS:U,PROPER:O,CONFIGURABLE:I}},(lt,r,h)=>{var M=h(14),p=h(21),B=h(37),Q=M(Function.toString);p(B.inspectSource)||(B.inspectSource=function(U){return Q(U)}),lt.exports=B.inspectSource},(lt,r,h)=>{var M=h(53),p=h(4),B=h(20),Q=h(44),U=h(39),O=h(37),I=h(54),j=h(55),q="Object already initialized",K=p.TypeError,f=p.WeakMap,S,k,T,g=function(u){return T(u)?k(u):S(u,{})},F=function(u){return function(m){var _;if(!B(m)||(_=k(m)).type!==u)throw K("Incompatible receiver, "+u+" required");return _}};if(M||O.state){var J=O.state||(O.state=new f);J.get=J.get,J.has=J.has,J.set=J.set,S=function(u,m){if(J.has(u))throw K(q);return m.facade=u,J.set(u,m),m},k=function(u){return J.get(u)||{}},T=function(u){return J.has(u)}}else{var v=I("state");j[v]=!0,S=function(u,m){if(U(u,v))throw K(q);return m.facade=u,Q(u,v,m),m},k=function(u){return U(u,v)?u[v]:{}},T=function(u){return U(u,v)}}lt.exports={set:S,get:k,has:T,enforce:g,getterFor:F}},(lt,r,h)=>{var M=h(4),p=h(21),B=M.WeakMap;lt.exports=p(B)&&/native code/.test(String(B))},(lt,r,h)=>{var M=h(35),p=h(41),B=M("keys");lt.exports=function(Q){return B[Q]||(B[Q]=p(Q))}},lt=>{lt.exports={}},(lt,r,h)=>{var M=h(39),p=h(57),B=h(5),Q=h(45);lt.exports=function(U,O,I){for(var j=p(O),q=Q.f,K=B.f,f=0;f<j.length;f++){var S=j[f];!M(U,S)&&!(I&&M(I,S))&&q(U,S,K(O,S))}}},(lt,r,h)=>{var M=h(24),p=h(14),B=h(58),Q=h(67),U=h(47),O=p([].concat);lt.exports=M("Reflect","ownKeys")||function(I){var j=B.f(U(I)),q=Q.f;return q?O(j,q(I)):j}},(lt,r,h)=>{var M=h(59),p=h(66),B=p.concat("length","prototype");r.f=Object.getOwnPropertyNames||function(Q){return M(Q,B)}},(lt,r,h)=>{var M=h(14),p=h(39),B=h(12),Q=h(60).indexOf,U=h(55),O=M([].push);lt.exports=function(I,j){var q=B(I),K=0,f=[],S;for(S in q)!p(U,S)&&p(q,S)&&O(f,S);for(;j.length>K;)p(q,S=j[K++])&&(~Q(f,S)||O(f,S));return f}},(lt,r,h)=>{var M=h(12),p=h(61),B=h(64),Q=function(U){return function(O,I,j){var q=M(O),K=B(q),f=p(j,K),S;if(U&&I!==I){for(;K>f;)if(S=q[f++],S!==S)return!0}else for(;K>f;f++)if((U||f in q)&&q[f]===I)return U||f||0;return!U&&-1}};lt.exports={includes:Q(!0),indexOf:Q(!1)}},(lt,r,h)=>{var M=h(62),p=Math.max,B=Math.min;lt.exports=function(Q,U){var O=M(Q);return O<0?p(O+U,0):B(O,U)}},(lt,r,h)=>{var M=h(63);lt.exports=function(p){var B=+p;return B!==B||B===0?0:M(B)}},lt=>{var r=Math.ceil,h=Math.floor;lt.exports=Math.trunc||function(M){var p=+M;return(p>0?h:r)(p)}},(lt,r,h)=>{var M=h(65);lt.exports=function(p){return M(p.length)}},(lt,r,h)=>{var M=h(62),p=Math.min;lt.exports=function(B){return B>0?p(M(B),9007199254740991):0}},lt=>{lt.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},(lt,r)=>{r.f=Object.getOwnPropertySymbols},(lt,r,h)=>{var M=h(7),p=h(21),B=/#|\.prototype\./,Q=function(q,K){var f=O[U(q)];return f===j?!0:f===I?!1:p(K)?M(K):!!K},U=Q.normalize=function(q){return String(q).replace(B,".").toLowerCase()},O=Q.data={},I=Q.NATIVE="N",j=Q.POLYFILL="P";lt.exports=Q},(lt,r,h)=>{var M=h(9),p=Function.prototype,B=p.apply,Q=p.call;lt.exports=typeof Reflect=="object"&&Reflect.apply||(M?Q.bind(B):function(){return Q.apply(B,arguments)})},(lt,r,h)=>{var M=h(24),p=h(39),B=h(44),Q=h(25),U=h(71),O=h(56),I=h(74),j=h(75),q=h(76),K=h(80),f=h(81),S=h(6),k=h(36);lt.exports=function(T,g,F,J){var v="stackTraceLimit",u=J?2:1,m=T.split("."),_=m[m.length-1],$=M.apply(null,m);if($){var P=$.prototype;if(!k&&p(P,"cause")&&delete P.cause,!F)return $;var Zt=M("Error"),dt=g(function(It,xt){var it=q(J?xt:It,void 0),Xt=J?new $(It):new $;return it!==void 0&&B(Xt,"message",it),f(Xt,dt,Xt.stack,2),this&&Q(P,this)&&j(Xt,this,dt),arguments.length>u&&K(Xt,arguments[u]),Xt});if(dt.prototype=P,_!=="Error"?U?U(dt,Zt):O(dt,Zt,{name:!0}):S&&v in $&&(I(dt,$,v),I(dt,$,"prepareStackTrace")),O(dt,$),!k)try{P.name!==_&&B(P,"name",_),P.constructor=dt}catch{}return dt}}},(lt,r,h)=>{var M=h(72),p=h(47),B=h(73);lt.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var Q=!1,U={},O;try{O=M(Object.prototype,"__proto__","set"),O(U,[]),Q=U instanceof Array}catch{}return function(I,j){return p(I),B(j),Q?O(I,j):I.__proto__=j,I}}():void 0)},(lt,r,h)=>{var M=h(14),p=h(31);lt.exports=function(B,Q,U){try{return M(p(Object.getOwnPropertyDescriptor(B,Q)[U]))}catch{}}},(lt,r,h)=>{var M=h(21),p=String,B=TypeError;lt.exports=function(Q){if(typeof Q=="object"||M(Q))return Q;throw B("Can't set "+p(Q)+" as a prototype")}},(lt,r,h)=>{var M=h(45).f;lt.exports=function(p,B,Q){Q in p||M(p,Q,{configurable:!0,get:function(){return B[Q]},set:function(U){B[Q]=U}})}},(lt,r,h)=>{var M=h(21),p=h(20),B=h(71);lt.exports=function(Q,U,O){var I,j;return B&&M(I=U.constructor)&&I!==O&&p(j=I.prototype)&&j!==O.prototype&&B(Q,j),Q}},(lt,r,h)=>{var M=h(77);lt.exports=function(p,B){return p===void 0?arguments.length<2?"":B:M(p)}},(lt,r,h)=>{var M=h(78),p=String;lt.exports=function(B){if(M(B)==="Symbol")throw TypeError("Cannot convert a Symbol value to a string");return p(B)}},(lt,r,h)=>{var M=h(79),p=h(21),B=h(15),Q=h(34),U=Q("toStringTag"),O=Object,I=B(function(){return arguments}())==="Arguments",j=function(q,K){try{return q[K]}catch{}};lt.exports=M?B:function(q){var K,f,S;return q===void 0?"Undefined":q===null?"Null":typeof(f=j(K=O(q),U))=="string"?f:I?B(K):(S=B(K))==="Object"&&p(K.callee)?"Arguments":S}},(lt,r,h)=>{var M=h(34),p=M("toStringTag"),B={};B[p]="z",lt.exports=String(B)==="[object z]"},(lt,r,h)=>{var M=h(20),p=h(44);lt.exports=function(B,Q){M(Q)&&"cause"in Q&&p(B,"cause",Q.cause)}},(lt,r,h)=>{var M=h(44),p=h(82),B=h(83),Q=Error.captureStackTrace;lt.exports=function(U,O,I,j){B&&(Q?Q(U,O):M(U,"stack",p(I,j)))}},(lt,r,h)=>{var M=h(14),p=Error,B=M("".replace),Q=function(I){return String(p(I).stack)}("zxcasd"),U=/\n\s*at [^:]*:[^\n]*/,O=U.test(Q);lt.exports=function(I,j){if(O&&typeof I=="string"&&!p.prepareStackTrace)for(;j--;)I=B(I,U,"");return I}},(lt,r,h)=>{var M=h(7),p=h(11);lt.exports=!M(function(){var B=Error("a");return"stack"in B?(Object.defineProperty(B,"stack",p(1,7)),B.stack!==7):!0})},(lt,r,h)=>{var M=h(48),p=h(14),B=h(77),Q=h(85),U=URLSearchParams,O=U.prototype,I=p(O.append),j=p(O.delete),q=p(O.forEach),K=p([].push),f=new U("a=1&a=2&b=3");f.delete("a",1),f.delete("b",void 0),f+""!="a=2"&&M(O,"delete",function(S){var k=arguments.length,T=k<2?void 0:arguments[1];if(k&&T===void 0)return j(this,S);var g=[];q(this,function(P,Zt){K(g,{key:Zt,value:P})}),Q(k,1);for(var F=B(S),J=B(T),v=0,u=0,m=!1,_=g.length,$;v<_;)$=g[v++],m||$.key===F?(m=!0,j(this,$.key)):u++;for(;u<_;)$=g[u++],$.key===F&&$.value===J||I(this,$.key,$.value)},{enumerable:!0,unsafe:!0})},lt=>{var r=TypeError;lt.exports=function(h,M){if(h<M)throw r("Not enough arguments");return h}},(lt,r,h)=>{var M=h(48),p=h(14),B=h(77),Q=h(85),U=URLSearchParams,O=U.prototype,I=p(O.getAll),j=p(O.has),q=new U("a=1");(q.has("a",2)||!q.has("a",void 0))&&M(O,"has",function(K){var f=arguments.length,S=f<2?void 0:arguments[1];if(f&&S===void 0)return j(this,K);var k=I(this,K);Q(f,1);for(var T=B(S),g=0;g<k.length;)if(k[g++]===T)return!0;return!1},{enumerable:!0,unsafe:!0})},(lt,r,h)=>{var M=h(6),p=h(14),B=h(88),Q=URLSearchParams.prototype,U=p(Q.forEach);M&&!("size"in Q)&&B(Q,"size",{get:function(){var O=0;return U(this,function(){O++}),O},configurable:!0,enumerable:!0})},(lt,r,h)=>{var M=h(49),p=h(45);lt.exports=function(B,Q,U){return U.get&&M(U.get,Q,{getter:!0}),U.set&&M(U.set,Q,{setter:!0}),p.f(B,Q,U)}},(lt,r,h)=>{var M=h(3),p=h(40),B=h(64),Q=h(90),U=h(92),O=h(7),I=O(function(){return[].push.call({length:4294967296},1)!==4294967297}),j=function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(K){return K instanceof TypeError}},q=I||!j();M({target:"Array",proto:!0,arity:1,forced:q},{push:function(K){var f=p(this),S=B(f),k=arguments.length;U(S+k);for(var T=0;T<k;T++)f[S]=arguments[T],S++;return Q(f,S),S}})},(lt,r,h)=>{var M=h(6),p=h(91),B=TypeError,Q=Object.getOwnPropertyDescriptor,U=M&&!function(){if(this!==void 0)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(O){return O instanceof TypeError}}();lt.exports=U?function(O,I){if(p(O)&&!Q(O,"length").writable)throw B("Cannot set read only .length");return O.length=I}:function(O,I){return O.length=I}},(lt,r,h)=>{var M=h(15);lt.exports=Array.isArray||function(p){return M(p)==="Array"}},lt=>{var r=TypeError,h=9007199254740991;lt.exports=function(M){if(M>h)throw r("Maximum allowed index exceeded");return M}},(lt,r,h)=>{var M=h(94),p=h(98).findLast,B=M.aTypedArray,Q=M.exportTypedArrayMethod;Q("findLast",function(U){return p(B(this),U,arguments.length>1?arguments[1]:void 0)})},(lt,r,h)=>{var M=h(95),p=h(6),B=h(4),Q=h(21),U=h(20),O=h(39),I=h(78),j=h(32),q=h(44),K=h(48),f=h(88),S=h(25),k=h(96),T=h(71),g=h(34),F=h(41),J=h(52),v=J.enforce,u=J.get,m=B.Int8Array,_=m&&m.prototype,$=B.Uint8ClampedArray,P=$&&$.prototype,Zt=m&&k(m),dt=_&&k(_),It=Object.prototype,xt=B.TypeError,it=g("toStringTag"),Xt=F("TYPED_ARRAY_TAG"),zt="TypedArrayConstructor",Gt=M&&!!T&&I(B.opera)!=="Opera",Nt=!1,Ut,Vt,Ht,Pt={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},at={BigInt64Array:8,BigUint64Array:8},R=function(Mt){if(!U(Mt))return!1;var Rt=I(Mt);return Rt==="DataView"||O(Pt,Rt)||O(at,Rt)},w=function(Mt){var Rt=k(Mt);if(U(Rt)){var gt=u(Rt);return gt&&O(gt,zt)?gt[zt]:w(Rt)}},X=function(Mt){if(!U(Mt))return!1;var Rt=I(Mt);return O(Pt,Rt)||O(at,Rt)},C=function(Mt){if(X(Mt))return Mt;throw xt("Target is not a typed array")},H=function(Mt){if(Q(Mt)&&(!T||S(Zt,Mt)))return Mt;throw xt(j(Mt)+" is not a typed array constructor")},st=function(Mt,Rt,gt,Jt){if(p){if(gt)for(var Dt in Pt){var qt=B[Dt];if(qt&&O(qt.prototype,Mt))try{delete qt.prototype[Mt]}catch{try{qt.prototype[Mt]=Rt}catch{}}}(!dt[Mt]||gt)&&K(dt,Mt,gt?Rt:Gt&&_[Mt]||Rt,Jt)}},et=function(Mt,Rt,gt){var Jt,Dt;if(p){if(T){if(gt){for(Jt in Pt)if(Dt=B[Jt],Dt&&O(Dt,Mt))try{delete Dt[Mt]}catch{}}if(!Zt[Mt]||gt)try{return K(Zt,Mt,gt?Rt:Gt&&Zt[Mt]||Rt)}catch{}else return}for(Jt in Pt)Dt=B[Jt],Dt&&(!Dt[Mt]||gt)&&K(Dt,Mt,Rt)}};for(Ut in Pt)Vt=B[Ut],Ht=Vt&&Vt.prototype,Ht?v(Ht)[zt]=Vt:Gt=!1;for(Ut in at)Vt=B[Ut],Ht=Vt&&Vt.prototype,Ht&&(v(Ht)[zt]=Vt);if((!Gt||!Q(Zt)||Zt===Function.prototype)&&(Zt=function(){throw xt("Incorrect invocation")},Gt))for(Ut in Pt)B[Ut]&&T(B[Ut],Zt);if((!Gt||!dt||dt===It)&&(dt=Zt.prototype,Gt))for(Ut in Pt)B[Ut]&&T(B[Ut].prototype,dt);if(Gt&&k(P)!==dt&&T(P,dt),p&&!O(dt,it)){Nt=!0,f(dt,it,{configurable:!0,get:function(){return U(this)?this[Xt]:void 0}});for(Ut in Pt)B[Ut]&&q(B[Ut],Xt,Ut)}lt.exports={NATIVE_ARRAY_BUFFER_VIEWS:Gt,TYPED_ARRAY_TAG:Nt&&Xt,aTypedArray:C,aTypedArrayConstructor:H,exportTypedArrayMethod:st,exportTypedArrayStaticMethod:et,getTypedArrayConstructor:w,isView:R,isTypedArray:X,TypedArray:Zt,TypedArrayPrototype:dt}},lt=>{lt.exports=typeof ArrayBuffer<"u"&&typeof DataView<"u"},(lt,r,h)=>{var M=h(39),p=h(21),B=h(40),Q=h(54),U=h(97),O=Q("IE_PROTO"),I=Object,j=I.prototype;lt.exports=U?I.getPrototypeOf:function(q){var K=B(q);if(M(K,O))return K[O];var f=K.constructor;return p(f)&&K instanceof f?f.prototype:K instanceof I?j:null}},(lt,r,h)=>{var M=h(7);lt.exports=!M(function(){function p(){}return p.prototype.constructor=null,Object.getPrototypeOf(new p)!==p.prototype})},(lt,r,h)=>{var M=h(99),p=h(13),B=h(40),Q=h(64),U=function(O){var I=O===1;return function(j,q,K){for(var f=B(j),S=p(f),k=M(q,K),T=Q(S),g,F;T-- >0;)if(g=S[T],F=k(g,T,f),F)switch(O){case 0:return g;case 1:return T}return I?-1:void 0}};lt.exports={findLast:U(0),findLastIndex:U(1)}},(lt,r,h)=>{var M=h(100),p=h(31),B=h(9),Q=M(M.bind);lt.exports=function(U,O){return p(U),O===void 0?U:B?Q(U,O):function(){return U.apply(O,arguments)}}},(lt,r,h)=>{var M=h(15),p=h(14);lt.exports=function(B){if(M(B)==="Function")return p(B)}},(lt,r,h)=>{var M=h(94),p=h(98).findLastIndex,B=M.aTypedArray,Q=M.exportTypedArrayMethod;Q("findLastIndex",function(U){return p(B(this),U,arguments.length>1?arguments[1]:void 0)})},(lt,r,h)=>{var M=h(4),p=h(8),B=h(94),Q=h(64),U=h(103),O=h(40),I=h(7),j=M.RangeError,q=M.Int8Array,K=q&&q.prototype,f=K&&K.set,S=B.aTypedArray,k=B.exportTypedArrayMethod,T=!I(function(){var F=new Uint8ClampedArray(2);return p(f,F,{length:1,0:3},1),F[1]!==3}),g=T&&B.NATIVE_ARRAY_BUFFER_VIEWS&&I(function(){var F=new q(2);return F.set(1),F.set("2",1),F[0]!==0||F[1]!==2});k("set",function(F){S(this);var J=U(arguments.length>1?arguments[1]:void 0,1),v=O(F);if(T)return p(f,this,v,J);var u=this.length,m=Q(v),_=0;if(m+J>u)throw j("Wrong length");for(;_<m;)this[J+_]=v[_++]},!T||g)},(lt,r,h)=>{var M=h(104),p=RangeError;lt.exports=function(B,Q){var U=M(B);if(U%Q)throw p("Wrong offset");return U}},(lt,r,h)=>{var M=h(62),p=RangeError;lt.exports=function(B){var Q=M(B);if(Q<0)throw p("The argument can't be less than 0");return Q}},(lt,r,h)=>{var M=h(106),p=h(94),B=p.aTypedArray,Q=p.exportTypedArrayMethod,U=p.getTypedArrayConstructor;Q("toReversed",function(){return M(B(this),U(this))})},(lt,r,h)=>{var M=h(64);lt.exports=function(p,B){for(var Q=M(p),U=new B(Q),O=0;O<Q;O++)U[O]=p[Q-O-1];return U}},(lt,r,h)=>{var M=h(94),p=h(14),B=h(31),Q=h(108),U=M.aTypedArray,O=M.getTypedArrayConstructor,I=M.exportTypedArrayMethod,j=p(M.TypedArrayPrototype.sort);I("toSorted",function(q){q!==void 0&&B(q);var K=U(this),f=Q(O(K),K);return j(f,q)})},(lt,r,h)=>{var M=h(64);lt.exports=function(p,B){for(var Q=0,U=M(B),O=new p(U);U>Q;)O[Q]=B[Q++];return O}},(lt,r,h)=>{var M=h(110),p=h(94),B=h(111),Q=h(62),U=h(112),O=p.aTypedArray,I=p.getTypedArrayConstructor,j=p.exportTypedArrayMethod,q=!!function(){try{new Int8Array(1).with(2,{valueOf:function(){throw 8}})}catch(K){return K===8}}();j("with",function(K,f){var S=O(this),k=Q(K),T=B(S)?U(f):+f;return M(S,I(S),k,T)},!q)},(lt,r,h)=>{var M=h(64),p=h(62),B=RangeError;lt.exports=function(Q,U,O,I){var j=M(Q),q=p(O),K=q<0?j+q:q;if(K>=j||K<0)throw B("Incorrect index");for(var f=new U(j),S=0;S<j;S++)f[S]=S===K?I:Q[S];return f}},(lt,r,h)=>{var M=h(78);lt.exports=function(p){var B=M(p);return B==="BigInt64Array"||B==="BigUint64Array"}},(lt,r,h)=>{var M=h(19),p=TypeError;lt.exports=function(B){var Q=M(B,"number");if(typeof Q=="number")throw p("Can't convert number to bigint");return BigInt(Q)}},(lt,r,h)=>{var M=h(6),p=h(88),B=h(114),Q=ArrayBuffer.prototype;M&&!("detached"in Q)&&p(Q,"detached",{configurable:!0,get:function(){return B(this)}})},(lt,r,h)=>{var M=h(14),p=h(115),B=M(ArrayBuffer.prototype.slice);lt.exports=function(Q){if(p(Q)!==0)return!1;try{return B(Q,0,0),!1}catch{return!0}}},(lt,r,h)=>{var M=h(72),p=h(15),B=TypeError;lt.exports=M(ArrayBuffer.prototype,"byteLength","get")||function(Q){if(p(Q)!=="ArrayBuffer")throw B("ArrayBuffer expected");return Q.byteLength}},(lt,r,h)=>{var M=h(3),p=h(117);p&&M({target:"ArrayBuffer",proto:!0},{transfer:function(){return p(this,arguments.length?arguments[0]:void 0,!0)}})},(lt,r,h)=>{var M=h(4),p=h(14),B=h(72),Q=h(118),U=h(114),O=h(115),I=h(119),j=M.TypeError,q=M.structuredClone,K=M.ArrayBuffer,f=M.DataView,S=Math.min,k=K.prototype,T=f.prototype,g=p(k.slice),F=B(k,"resizable","get"),J=B(k,"maxByteLength","get"),v=p(T.getInt8),u=p(T.setInt8);lt.exports=I&&function(m,_,$){var P=O(m),Zt=_===void 0?P:Q(_),dt=!F||!F(m);if(U(m))throw j("ArrayBuffer is detached");var It=q(m,{transfer:[m]});if(P===Zt&&($||dt))return It;if(P>=Zt&&(!$||dt))return g(It,0,Zt);for(var xt=$&&!dt&&J?{maxByteLength:J(It)}:void 0,it=new K(Zt,xt),Xt=new f(It),zt=new f(it),Gt=S(Zt,P),Nt=0;Nt<Gt;Nt++)u(zt,Nt,v(Xt,Nt));return it}},(lt,r,h)=>{var M=h(62),p=h(65),B=RangeError;lt.exports=function(Q){if(Q===void 0)return 0;var U=M(Q),O=p(U);if(U!==O)throw B("Wrong length or index");return O}},(lt,r,h)=>{var M=h(4),p=h(7),B=h(28),Q=h(120),U=h(121),O=h(122),I=M.structuredClone;lt.exports=!!I&&!p(function(){if(U&&B>92||O&&B>94||Q&&B>97)return!1;var j=new ArrayBuffer(8),q=I(j,{transfer:[j]});return j.byteLength!==0||q.byteLength!==8})},(lt,r,h)=>{var M=h(121),p=h(122);lt.exports=!M&&!p&&typeof window=="object"&&typeof document=="object"},lt=>{lt.exports=typeof Deno=="object"&&Deno&&typeof Deno.version=="object"},(lt,r,h)=>{var M=h(4),p=h(15);lt.exports=p(M.process)==="process"},(lt,r,h)=>{var M=h(3),p=h(117);p&&M({target:"ArrayBuffer",proto:!0},{transferToFixedLength:function(){return p(this,arguments.length?arguments[0]:void 0,!1)}})},(__unused_webpack_module,exports,__w_pdfjs_require__)=>{var D,l,c,n,ht,V,St,Y,e,i,x,o,G,s,b,a,rt,N,W,At,Z,d;Object.defineProperty(exports,"__esModule",{value:!0}),exports.RenderTask=exports.PDFWorkerUtil=exports.PDFWorker=exports.PDFPageProxy=exports.PDFDocumentProxy=exports.PDFDocumentLoadingTask=exports.PDFDataRangeTransport=exports.LoopbackPort=exports.DefaultStandardFontDataFactory=exports.DefaultFilterFactory=exports.DefaultCanvasFactory=exports.DefaultCMapReaderFactory=void 0,Object.defineProperty(exports,"SVGGraphics",{enumerable:!0,get:function(){return _displaySvg.SVGGraphics}}),exports.build=void 0,exports.getDocument=getDocument,exports.version=void 0,__w_pdfjs_require__(84),__w_pdfjs_require__(86),__w_pdfjs_require__(87),__w_pdfjs_require__(2),__w_pdfjs_require__(93),__w_pdfjs_require__(101),__w_pdfjs_require__(102),__w_pdfjs_require__(105),__w_pdfjs_require__(107),__w_pdfjs_require__(109),__w_pdfjs_require__(113),__w_pdfjs_require__(116),__w_pdfjs_require__(123),__w_pdfjs_require__(89),__w_pdfjs_require__(125),__w_pdfjs_require__(136),__w_pdfjs_require__(138),__w_pdfjs_require__(141),__w_pdfjs_require__(143),__w_pdfjs_require__(145),__w_pdfjs_require__(147),__w_pdfjs_require__(149),__w_pdfjs_require__(152);var _util=__w_pdfjs_require__(1),_annotation_storage=__w_pdfjs_require__(163),_display_utils=__w_pdfjs_require__(168),_font_loader=__w_pdfjs_require__(171),_displayNode_utils=__w_pdfjs_require__(172),_canvas=__w_pdfjs_require__(173),_worker_options=__w_pdfjs_require__(176),_message_handler=__w_pdfjs_require__(177),_metadata=__w_pdfjs_require__(178),_optional_content_config=__w_pdfjs_require__(179),_transport_stream=__w_pdfjs_require__(180),_displayFetch_stream=__w_pdfjs_require__(181),_displayNetwork=__w_pdfjs_require__(184),_displayNode_stream=__w_pdfjs_require__(185),_displaySvg=__w_pdfjs_require__(186),_xfa_text=__w_pdfjs_require__(194);const DEFAULT_RANGE_CHUNK_SIZE=65536,RENDERING_CANCELLED_TIMEOUT=100,DELAYED_CLEANUP_TIMEOUT=5e3,DefaultCanvasFactory=_util.isNodeJS?_displayNode_utils.NodeCanvasFactory:_display_utils.DOMCanvasFactory;exports.DefaultCanvasFactory=DefaultCanvasFactory;const DefaultCMapReaderFactory=_util.isNodeJS?_displayNode_utils.NodeCMapReaderFactory:_display_utils.DOMCMapReaderFactory;exports.DefaultCMapReaderFactory=DefaultCMapReaderFactory;const DefaultFilterFactory=_util.isNodeJS?_displayNode_utils.NodeFilterFactory:_display_utils.DOMFilterFactory;exports.DefaultFilterFactory=DefaultFilterFactory;const DefaultStandardFontDataFactory=_util.isNodeJS?_displayNode_utils.NodeStandardFontDataFactory:_display_utils.DOMStandardFontDataFactory;exports.DefaultStandardFontDataFactory=DefaultStandardFontDataFactory;function getDocument(lt){if(typeof lt=="string"||lt instanceof URL?lt={url:lt}:(0,_util.isArrayBuffer)(lt)&&(lt={data:lt}),typeof lt!="object")throw new Error("Invalid parameter in getDocument, need parameter object.");if(!lt.url&&!lt.data&&!lt.range)throw new Error("Invalid parameter object: need either .data, .range or .url");const r=new PDFDocumentLoadingTask,{docId:h}=r,M=lt.url?getUrlProp(lt.url):null,p=lt.data?getDataProp(lt.data):null,B=lt.httpHeaders||null,Q=lt.withCredentials===!0,U=lt.password??null,O=lt.range instanceof PDFDataRangeTransport?lt.range:null,I=Number.isInteger(lt.rangeChunkSize)&<.rangeChunkSize>0?lt.rangeChunkSize:DEFAULT_RANGE_CHUNK_SIZE;let j=lt.worker instanceof PDFWorker?lt.worker:null;const q=lt.verbosity,K=typeof lt.docBaseUrl=="string"&&!(0,_display_utils.isDataScheme)(lt.docBaseUrl)?lt.docBaseUrl:null,f=typeof lt.cMapUrl=="string"?lt.cMapUrl:null,S=lt.cMapPacked!==!1,k=lt.CMapReaderFactory||DefaultCMapReaderFactory,T=typeof lt.standardFontDataUrl=="string"?lt.standardFontDataUrl:null,g=lt.StandardFontDataFactory||DefaultStandardFontDataFactory,F=lt.stopAtErrors!==!0,J=Number.isInteger(lt.maxImageSize)&<.maxImageSize>-1?lt.maxImageSize:-1,v=lt.isEvalSupported!==!1,u=typeof lt.isOffscreenCanvasSupported=="boolean"?lt.isOffscreenCanvasSupported:!_util.isNodeJS,m=Number.isInteger(lt.canvasMaxAreaInBytes)?lt.canvasMaxAreaInBytes:-1,_=typeof lt.disableFontFace=="boolean"?lt.disableFontFace:_util.isNodeJS,$=lt.fontExtraProperties===!0,P=lt.enableXfa===!0,Zt=lt.ownerDocument||globalThis.document,dt=lt.disableRange===!0,It=lt.disableStream===!0,xt=lt.disableAutoFetch===!0,it=lt.pdfBug===!0,Xt=O?O.length:lt.length??NaN,zt=typeof lt.useSystemFonts=="boolean"?lt.useSystemFonts:!_util.isNodeJS&&!_,Gt=typeof lt.useWorkerFetch=="boolean"?lt.useWorkerFetch:k===_display_utils.DOMCMapReaderFactory&&g===_display_utils.DOMStandardFontDataFactory&&f&&T&&(0,_display_utils.isValidFetchUrl)(f,document.baseURI)&&(0,_display_utils.isValidFetchUrl)(T,document.baseURI),Nt=lt.canvasFactory||new DefaultCanvasFactory({ownerDocument:Zt}),Ut=lt.filterFactory||new DefaultFilterFactory({docId:h,ownerDocument:Zt}),Vt=null;(0,_util.setVerbosityLevel)(q);const Ht={canvasFactory:Nt,filterFactory:Ut};if(Gt||(Ht.cMapReaderFactory=new k({baseUrl:f,isCompressed:S}),Ht.standardFontDataFactory=new g({baseUrl:T})),!j){const R={verbosity:q,port:_worker_options.GlobalWorkerOptions.workerPort};j=R.port?PDFWorker.fromPort(R):new PDFWorker(R),r._worker=j}const Pt={docId:h,apiVersion:"3.11.174",data:p,password:U,disableAutoFetch:xt,rangeChunkSize:I,length:Xt,docBaseUrl:K,enableXfa:P,evaluatorOptions:{maxImageSize:J,disableFontFace:_,ignoreErrors:F,isEvalSupported:v,isOffscreenCanvasSupported:u,canvasMaxAreaInBytes:m,fontExtraProperties:$,useSystemFonts:zt,cMapUrl:Gt?f:null,standardFontDataUrl:Gt?T:null}},at={ignoreErrors:F,isEvalSupported:v,disableFontFace:_,fontExtraProperties:$,enableXfa:P,ownerDocument:Zt,disableAutoFetch:xt,pdfBug:it,styleElement:Vt};return j.promise.then(function(){if(r.destroyed)throw new Error("Loading aborted");const R=_fetchDocument(j,Pt),w=new Promise(function(X){let C;O?C=new _transport_stream.PDFDataTransportStream({length:Xt,initialData:O.initialData,progressiveDone:O.progressiveDone,contentDispositionFilename:O.contentDispositionFilename,disableRange:dt,disableStream:It},O):p||(C=(H=>_util.isNodeJS?new _displayNode_stream.PDFNodeStream(H):(0,_display_utils.isValidFetchUrl)(H.url)?new _displayFetch_stream.PDFFetchStream(H):new _displayNetwork.PDFNetworkStream(H))({url:M,length:Xt,httpHeaders:B,withCredentials:Q,rangeChunkSize:I,disableRange:dt,disableStream:It})),X(C)});return Promise.all([R,w]).then(function(X){let[C,H]=X;if(r.destroyed)throw new Error("Loading aborted");const st=new _message_handler.MessageHandler(h,C,j.port),et=new WorkerTransport(st,r,H,at,Ht);r._transport=et,st.send("Ready",null)})}).catch(r._capability.reject),r}async function _fetchDocument(lt,r){if(lt.destroyed)throw new Error("Worker was destroyed");const h=await lt.messageHandler.sendWithPromise("GetDocRequest",r,r.data?[r.data.buffer]:null);if(lt.destroyed)throw new Error("Worker was destroyed");return h}function getUrlProp(lt){if(lt instanceof URL)return lt.href;try{return new URL(lt,window.location).href}catch{if(_util.isNodeJS&&typeof lt=="string")return lt}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}function getDataProp(lt){if(_util.isNodeJS&&typeof Buffer<"u"&< instanceof Buffer)throw new Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");if(lt instanceof Uint8Array&<.byteLength===lt.buffer.byteLength)return lt;if(typeof lt=="string")return(0,_util.stringToBytes)(lt);if(typeof lt=="object"&&!isNaN(lt==null?void 0:lt.length)||(0,_util.isArrayBuffer)(lt))return new Uint8Array(lt);throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")}const y=class Cs{constructor(){this._capability=new _util.PromiseCapability,this._transport=null,this._worker=null,this.docId=`d${mt(Cs,D)._++}`,this.destroyed=!1,this.onPassword=null,this.onProgress=null}get promise(){return this._capability.promise}async destroy(){var r,h,M;this.destroyed=!0;try{(r=this._worker)!=null&&r.port&&(this._worker._pendingDestroy=!0),await((h=this._transport)==null?void 0:h.destroy())}catch(p){throw(M=this._worker)!=null&&M.port&&delete this._worker._pendingDestroy,p}this._transport=null,this._worker&&(this._worker.destroy(),this._worker=null)}};D=new WeakMap,E(y,D,0);let PDFDocumentLoadingTask=y;exports.PDFDocumentLoadingTask=PDFDocumentLoadingTask;class PDFDataRangeTransport{constructor(r,h){let M=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,p=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;this.length=r,this.initialData=h,this.progressiveDone=M,this.contentDispositionFilename=p,this._rangeListeners=[],this._progressListeners=[],this._progressiveReadListeners=[],this._progressiveDoneListeners=[],this._readyCapability=new _util.PromiseCapability}addRangeListener(r){this._rangeListeners.push(r)}addProgressListener(r){this._progressListeners.push(r)}addProgressiveReadListener(r){this._progressiveReadListeners.push(r)}addProgressiveDoneListener(r){this._progressiveDoneListeners.push(r)}onDataRange(r,h){for(const M of this._rangeListeners)M(r,h)}onDataProgress(r,h){this._readyCapability.promise.then(()=>{for(const M of this._progressListeners)M(r,h)})}onDataProgressiveRead(r){this._readyCapability.promise.then(()=>{for(const h of this._progressiveReadListeners)h(r)})}onDataProgressiveDone(){this._readyCapability.promise.then(()=>{for(const r of this._progressiveDoneListeners)r()})}transportReady(){this._readyCapability.resolve()}requestDataRange(r,h){(0,_util.unreachable)("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}}exports.PDFDataRangeTransport=PDFDataRangeTransport;class PDFDocumentProxy{constructor(r,h){this._pdfInfo=r,this._transport=h,Object.defineProperty(this,"getJavaScript",{value:()=>((0,_display_utils.deprecated)("`PDFDocumentProxy.getJavaScript`, please use `PDFDocumentProxy.getJSActions` instead."),this.getJSActions().then(M=>{if(!M)return M;const p=[];for(const B in M)p.push(...M[B]);return p}))})}get annotationStorage(){return this._transport.annotationStorage}get filterFactory(){return this._transport.filterFactory}get numPages(){return this._pdfInfo.numPages}get fingerprints(){return this._pdfInfo.fingerprints}get isPureXfa(){return(0,_util.shadow)(this,"isPureXfa",!!this._transport._htmlForXfa)}get allXfaHtml(){return this._transport._htmlForXfa}getPage(r){return this._transport.getPage(r)}getPageIndex(r){return this._transport.getPageIndex(r)}getDestinations(){return this._transport.getDestinations()}getDestination(r){return this._transport.getDestination(r)}getPageLabels(){return this._transport.getPageLabels()}getPageLayout(){return this._transport.getPageLayout()}getPageMode(){return this._transport.getPageMode()}getViewerPreferences(){return this._transport.getViewerPreferences()}getOpenAction(){return this._transport.getOpenAction()}getAttachments(){return this._transport.getAttachments()}getJSActions(){return this._transport.getDocJSActions()}getOutline(){return this._transport.getOutline()}getOptionalContentConfig(){return this._transport.getOptionalContentConfig()}getPermissions(){return this._transport.getPermissions()}getMetadata(){return this._transport.getMetadata()}getMarkInfo(){return this._transport.getMarkInfo()}getData(){return this._transport.getData()}saveDocument(){return this._transport.saveDocument()}getDownloadInfo(){return this._transport.downloadInfoCapability.promise}cleanup(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return this._transport.startCleanup(r||this.isPureXfa)}destroy(){return this.loadingTask.destroy()}get loadingParams(){return this._transport.loadingParams}get loadingTask(){return this._transport.loadingTask}getFieldObjects(){return this._transport.getFieldObjects()}hasJSActions(){return this._transport.hasJSActions()}getCalculationOrderIds(){return this._transport.getCalculationOrderIds()}}exports.PDFDocumentProxy=PDFDocumentProxy;class PDFPageProxy{constructor(r,h,M){E(this,n),E(this,V),E(this,l,null),E(this,c,!1);let p=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;this._pageIndex=r,this._pageInfo=h,this._transport=M,this._stats=p?new _display_utils.StatTimer:null,this._pdfBug=p,this.commonObjs=M.commonObjs,this.objs=new PDFObjects,this._maybeCleanupAfterRender=!1,this._intentStates=new Map,this.destroyed=!1}get pageNumber(){return this._pageIndex+1}get rotate(){return this._pageInfo.rotate}get ref(){return this._pageInfo.ref}get userUnit(){return this._pageInfo.userUnit}get view(){return this._pageInfo.view}getViewport(){let{scale:r,rotation:h=this.rotate,offsetX:M=0,offsetY:p=0,dontFlip:B=!1}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return new _display_utils.PageViewport({viewBox:this.view,scale:r,rotation:h,offsetX:M,offsetY:p,dontFlip:B})}getAnnotations(){let{intent:r="display"}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const h=this._transport.getRenderingIntent(r);return this._transport.getAnnotations(this._pageIndex,h.renderingIntent)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get filterFactory(){return this._transport.filterFactory}get isPureXfa(){return(0,_util.shadow)(this,"isPureXfa",!!this._transport._htmlForXfa)}async getXfa(){var r;return((r=this._transport._htmlForXfa)==null?void 0:r.children[this._pageIndex])||null}render(r){var h,M;let{canvasContext:p,viewport:B,intent:Q="display",annotationMode:U=_util.AnnotationMode.ENABLE,transform:O=null,background:I=null,optionalContentConfigPromise:j=null,annotationCanvasMap:q=null,pageColors:K=null,printAnnotationStorage:f=null}=r;(h=this._stats)==null||h.time("Overall");const S=this._transport.getRenderingIntent(Q,U,f);Zl(this,c,!1),A(this,V,St).call(this),j||(j=this._transport.getOptionalContentConfig());let k=this._intentStates.get(S.cacheKey);k||(k=Object.create(null),this._intentStates.set(S.cacheKey,k)),k.streamReaderCancelTimeout&&(clearTimeout(k.streamReaderCancelTimeout),k.streamReaderCancelTimeout=null);const T=!!(S.renderingIntent&_util.RenderingIntentFlag.PRINT);k.displayReadyCapability||(k.displayReadyCapability=new _util.PromiseCapability,k.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},(M=this._stats)==null||M.time("Page Request"),this._pumpOperatorList(S));const g=v=>{var u,m;k.renderTasks.delete(F),(this._maybeCleanupAfterRender||T)&&Zl(this,c,!0),A(this,n,ht).call(this,!T),v?(F.capability.reject(v),this._abortOperatorList({intentState:k,reason:v instanceof Error?v:new Error(v)})):F.capability.resolve(),(u=this._stats)==null||u.timeEnd("Rendering"),(m=this._stats)==null||m.timeEnd("Overall")},F=new InternalRenderTask({callback:g,params:{canvasContext:p,viewport:B,transform:O,background:I},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:q,operatorList:k.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!T,pdfBug:this._pdfBug,pageColors:K});(k.renderTasks||(k.renderTasks=new Set)).add(F);const J=F.task;return Promise.all([k.displayReadyCapability.promise,j]).then(v=>{var u;let[m,_]=v;if(this.destroyed){g();return}(u=this._stats)==null||u.time("Rendering"),F.initializeGraphics({transparency:m,optionalContentConfig:_}),F.operatorListChanged()}).catch(g),J}getOperatorList(){var r;let{intent:h="display",annotationMode:M=_util.AnnotationMode.ENABLE,printAnnotationStorage:p=null}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};function B(){U.operatorList.lastChunk&&(U.opListReadCapability.resolve(U.operatorList),U.renderTasks.delete(O))}const Q=this._transport.getRenderingIntent(h,M,p,!0);let U=this._intentStates.get(Q.cacheKey);U||(U=Object.create(null),this._intentStates.set(Q.cacheKey,U));let O;return U.opListReadCapability||(O=Object.create(null),O.operatorListChanged=B,U.opListReadCapability=new _util.PromiseCapability,(U.renderTasks||(U.renderTasks=new Set)).add(O),U.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},(r=this._stats)==null||r.time("Page Request"),this._pumpOperatorList(Q)),U.opListReadCapability.promise}streamTextContent(){let{includeMarkedContent:r=!1,disableNormalization:h=!1}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,includeMarkedContent:r===!0,disableNormalization:h===!0},{highWaterMark:100,size(p){return p.items.length}})}getTextContent(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(this._transport._htmlForXfa)return this.getXfa().then(M=>_xfa_text.XfaText.textContent(M));const h=this.streamTextContent(r);return new Promise(function(M,p){function B(){Q.read().then(function(O){let{value:I,done:j}=O;if(j){M(U);return}Object.assign(U.styles,I.styles),U.items.push(...I.items),B()},p)}const Q=h.getReader(),U={items:[],styles:Object.create(null)};B()})}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;const r=[];for(const h of this._intentStates.values())if(this._abortOperatorList({intentState:h,reason:new Error("Page was destroyed."),force:!0}),!h.opListReadCapability)for(const M of h.renderTasks)r.push(M.completed),M.cancel();return this.objs.clear(),Zl(this,c,!1),A(this,V,St).call(this),Promise.all(r)}cleanup(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;Zl(this,c,!0);const h=A(this,n,ht).call(this,!1);return r&&h&&this._stats&&(this._stats=new _display_utils.StatTimer),h}_startRenderPage(r,h){var M,p;const B=this._intentStates.get(h);B&&((M=this._stats)==null||M.timeEnd("Page Request"),(p=B.displayReadyCapability)==null||p.resolve(r))}_renderPageChunk(r,h){for(let M=0,p=r.length;M<p;M++)h.operatorList.fnArray.push(r.fnArray[M]),h.operatorList.argsArray.push(r.argsArray[M]);h.operatorList.lastChunk=r.lastChunk,h.operatorList.separateAnnots=r.separateAnnots;for(const M of h.renderTasks)M.operatorListChanged();r.lastChunk&&A(this,n,ht).call(this,!0)}_pumpOperatorList(r){let{renderingIntent:h,cacheKey:M,annotationStorageSerializable:p}=r;const{map:B,transfers:Q}=p,U=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:h,cacheKey:M,annotationStorage:B},Q).getReader(),O=this._intentStates.get(M);O.streamReader=U;const I=()=>{U.read().then(j=>{let{value:q,done:K}=j;if(K){O.streamReader=null;return}this._transport.destroyed||(this._renderPageChunk(q,O),I())},j=>{if(O.streamReader=null,!this._transport.destroyed){if(O.operatorList){O.operatorList.lastChunk=!0;for(const q of O.renderTasks)q.operatorListChanged();A(this,n,ht).call(this,!0)}if(O.displayReadyCapability)O.displayReadyCapability.reject(j);else if(O.opListReadCapability)O.opListReadCapability.reject(j);else throw j}})};I()}_abortOperatorList(r){let{intentState:h,reason:M,force:p=!1}=r;if(h.streamReader){if(h.streamReaderCancelTimeout&&(clearTimeout(h.streamReaderCancelTimeout),h.streamReaderCancelTimeout=null),!p){if(h.renderTasks.size>0)return;if(M instanceof _display_utils.RenderingCancelledException){let B=RENDERING_CANCELLED_TIMEOUT;M.extraDelay>0&&M.extraDelay<1e3&&(B+=M.extraDelay),h.streamReaderCancelTimeout=setTimeout(()=>{h.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:h,reason:M,force:!0})},B);return}}if(h.streamReader.cancel(new _util.AbortException(M.message)).catch(()=>{}),h.streamReader=null,!this._transport.destroyed){for(const[B,Q]of this._intentStates)if(Q===h){this._intentStates.delete(B);break}this.cleanup()}}}get stats(){return this._stats}}l=new WeakMap,c=new WeakMap,n=new WeakSet,ht=function(){let lt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(A(this,V,St).call(this),!t(this,c)||this.destroyed)return!1;if(lt)return Zl(this,l,setTimeout(()=>{Zl(this,l,null),A(this,n,ht).call(this,!1)},DELAYED_CLEANUP_TIMEOUT)),!1;for(const{renderTasks:r,operatorList:h}of this._intentStates.values())if(r.size>0||!h.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),Zl(this,c,!1),!0},V=new WeakSet,St=function(){t(this,l)&&(clearTimeout(t(this,l)),Zl(this,l,null))},exports.PDFPageProxy=PDFPageProxy;class LoopbackPort{constructor(){E(this,Y,new Set),E(this,e,Promise.resolve())}postMessage(r,h){const M={data:structuredClone(r,null)};t(this,e).then(()=>{for(const p of t(this,Y))p.call(this,M)})}addEventListener(r,h){t(this,Y).add(h)}removeEventListener(r,h){t(this,Y).delete(h)}terminate(){t(this,Y).clear()}}Y=new WeakMap,e=new WeakMap,exports.LoopbackPort=LoopbackPort;const PDFWorkerUtil={isWorkerDisabled:!1,fallbackWorkerSrc:null,fakeWorkerId:0};exports.PDFWorkerUtil=PDFWorkerUtil;{if(_util.isNodeJS&&typeof commonjsRequire=="function")PDFWorkerUtil.isWorkerDisabled=!0,PDFWorkerUtil.fallbackWorkerSrc="./pdf.worker.js";else if(typeof document=="object"){const lt=(i=document==null?void 0:document.currentScript)==null?void 0:i.src;lt&&(PDFWorkerUtil.fallbackWorkerSrc=lt.replace(/(\.(?:min\.)?js)(\?.*)?$/i,".worker$1$2"))}PDFWorkerUtil.isSameOrigin=function(lt,r){let h;try{if(h=new URL(lt),!h.origin||h.origin==="null")return!1}catch{return!1}const M=new URL(r,h);return h.origin===M.origin},PDFWorkerUtil.createCDNWrapper=function(lt){const r=`importScripts("${lt}");`;return URL.createObjectURL(new Blob([r]))}}const _PDFWorker=class __PDFWorker{constructor(){var lt;let{name:r=null,port:h=null,verbosity:M=(0,_util.getVerbosityLevel)()}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(this.name=r,this.destroyed=!1,this.verbosity=M,this._readyCapability=new _util.PromiseCapability,this._port=null,this._webWorker=null,this._messageHandler=null,h){if((lt=t(__PDFWorker,x))!=null&<.has(h))throw new Error("Cannot use more than one PDFWorker per port.");(t(__PDFWorker,x)||Zl(__PDFWorker,x,new WeakMap)).set(h,this),this._initializeFromPort(h);return}this._initialize()}get promise(){return this._readyCapability.promise}get port(){return this._port}get messageHandler(){return this._messageHandler}_initializeFromPort(lt){this._port=lt,this._messageHandler=new _message_handler.MessageHandler("main","worker",lt),this._messageHandler.on("ready",function(){}),this._readyCapability.resolve(),this._messageHandler.send("configure",{verbosity:this.verbosity})}_initialize(){if(!PDFWorkerUtil.isWorkerDisabled&&!__PDFWorker._mainThreadWorkerMessageHandler){let{workerSrc:lt}=__PDFWorker;try{PDFWorkerUtil.isSameOrigin(window.location.href,lt)||(lt=PDFWorkerUtil.createCDNWrapper(new URL(lt,window.location).href));const r=new Worker(lt),h=new _message_handler.MessageHandler("main","worker",r),M=()=>{r.removeEventListener("error",p),h.destroy(),r.terminate(),this.destroyed?this._readyCapability.reject(new Error("Worker was destroyed")):this._setupFakeWorker()},p=()=>{this._webWorker||M()};r.addEventListener("error",p),h.on("test",Q=>{if(r.removeEventListener("error",p),this.destroyed){M();return}Q?(this._messageHandler=h,this._port=r,this._webWorker=r,this._readyCapability.resolve(),h.send("configure",{verbosity:this.verbosity})):(this._setupFakeWorker(),h.destroy(),r.terminate())}),h.on("ready",Q=>{if(r.removeEventListener("error",p),this.destroyed){M();return}try{B()}catch{this._setupFakeWorker()}});const B=()=>{const Q=new Uint8Array;h.send("test",Q,[Q.buffer])};B();return}catch{(0,_util.info)("The worker has been disabled.")}}this._setupFakeWorker()}_setupFakeWorker(){PDFWorkerUtil.isWorkerDisabled||((0,_util.warn)("Setting up fake worker."),PDFWorkerUtil.isWorkerDisabled=!0),__PDFWorker._setupFakeWorkerGlobal.then(lt=>{if(this.destroyed){this._readyCapability.reject(new Error("Worker was destroyed"));return}const r=new LoopbackPort;this._port=r;const h=`fake${PDFWorkerUtil.fakeWorkerId++}`,M=new _message_handler.MessageHandler(h+"_worker",h,r);lt.setup(M,r);const p=new _message_handler.MessageHandler(h,h+"_worker",r);this._messageHandler=p,this._readyCapability.resolve(),p.send("configure",{verbosity:this.verbosity})}).catch(lt=>{this._readyCapability.reject(new Error(`Setting up fake worker failed: "${lt.message}".`))})}destroy(){var lt;this.destroyed=!0,this._webWorker&&(this._webWorker.terminate(),this._webWorker=null),(lt=t(__PDFWorker,x))==null||lt.delete(this._port),this._port=null,this._messageHandler&&(this._messageHandler.destroy(),this._messageHandler=null)}static fromPort(lt){var r;if(!(lt!=null&<.port))throw new Error("PDFWorker.fromPort - invalid method signature.");const h=(r=t(this,x))==null?void 0:r.get(lt.port);if(h){if(h._pendingDestroy)throw new Error("PDFWorker.fromPort - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");return h}return new __PDFWorker(lt)}static get workerSrc(){if(_worker_options.GlobalWorkerOptions.workerSrc)return _worker_options.GlobalWorkerOptions.workerSrc;if(PDFWorkerUtil.fallbackWorkerSrc!==null)return _util.isNodeJS||(0,_display_utils.deprecated)('No "GlobalWorkerOptions.workerSrc" specified.'),PDFWorkerUtil.fallbackWorkerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get _mainThreadWorkerMessageHandler(){var lt;try{return((lt=globalThis.pdfjsWorker)==null?void 0:lt.WorkerMessageHandler)||null}catch{return null}}static get _setupFakeWorkerGlobal(){const loader=async()=>{const mainWorkerMessageHandler=this._mainThreadWorkerMessageHandler;if(mainWorkerMessageHandler)return mainWorkerMessageHandler;if(_util.isNodeJS&&typeof commonjsRequire=="function"){const worker=eval("require")(this.workerSrc);return worker.WorkerMessageHandler}return await(0,_display_utils.loadScript)(this.workerSrc),window.pdfjsWorker.WorkerMessageHandler};return(0,_util.shadow)(this,"_setupFakeWorkerGlobal",loader())}};x=new WeakMap,E(_PDFWorker,x,void 0);let PDFWorker=_PDFWorker;exports.PDFWorker=PDFWorker;class WorkerTransport{constructor(r,h,M,p,B){E(this,a),E(this,o,new Map),E(this,G,new Map),E(this,s,new Map),E(this,b,null),this.messageHandler=r,this.loadingTask=h,this.commonObjs=new PDFObjects,this.fontLoader=new _font_loader.FontLoader({ownerDocument:p.ownerDocument,styleElement:p.styleElement}),this._params=p,this.canvasFactory=B.canvasFactory,this.filterFactory=B.filterFactory,this.cMapReaderFactory=B.cMapReaderFactory,this.standardFontDataFactory=B.standardFontDataFactory,this.destroyed=!1,this.destroyCapability=null,this._networkStream=M,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=new _util.PromiseCapability,this.setupMessageHandler()}get annotationStorage(){return(0,_util.shadow)(this,"annotationStorage",new _annotation_storage.AnnotationStorage)}getRenderingIntent(r){let h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:_util.AnnotationMode.ENABLE,M=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,p=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,B=_util.RenderingIntentFlag.DISPLAY,Q=_annotation_storage.SerializableEmpty;switch(r){case"any":B=_util.RenderingIntentFlag.ANY;break;case"display":break;case"print":B=_util.RenderingIntentFlag.PRINT;break;default:(0,_util.warn)(`getRenderingIntent - invalid intent: ${r}`)}switch(h){case _util.AnnotationMode.DISABLE:B+=_util.RenderingIntentFlag.ANNOTATIONS_DISABLE;break;case _util.AnnotationMode.ENABLE:break;case _util.AnnotationMode.ENABLE_FORMS:B+=_util.RenderingIntentFlag.ANNOTATIONS_FORMS;break;case _util.AnnotationMode.ENABLE_STORAGE:B+=_util.RenderingIntentFlag.ANNOTATIONS_STORAGE,Q=(B&_util.RenderingIntentFlag.PRINT&&M instanceof _annotation_storage.PrintAnnotationStorage?M:this.annotationStorage).serializable;break;default:(0,_util.warn)(`getRenderingIntent - invalid annotationMode: ${h}`)}return p&&(B+=_util.RenderingIntentFlag.OPLIST),{renderingIntent:B,cacheKey:`${B}_${Q.hash}`,annotationStorageSerializable:Q}}destroy(){var r;if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=new _util.PromiseCapability,(r=t(this,b))==null||r.reject(new Error("Worker was destroyed during onPassword callback"));const h=[];for(const p of t(this,G).values())h.push(p._destroy());t(this,G).clear(),t(this,s).clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();const M=this.messageHandler.sendWithPromise("Terminate",null);return h.push(M),Promise.all(h).then(()=>{var p;this.commonObjs.clear(),this.fontLoader.clear(),t(this,o).clear(),this.filterFactory.destroy(),(p=this._networkStream)==null||p.cancelAllRequests(new _util.AbortException("Worker was terminated.")),this.messageHandler&&(this.messageHandler.destroy(),this.messageHandler=null),this.destroyCapability.resolve()},this.destroyCapability.reject),this.destroyCapability.promise}setupMessageHandler(){const{messageHandler:r,loadingTask:h}=this;r.on("GetReader",(M,p)=>{(0,_util.assert)(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=B=>{this._lastProgress={loaded:B.loaded,total:B.total}},p.onPull=()=>{this._fullReader.read().then(function(B){let{value:Q,done:U}=B;if(U){p.close();return}(0,_util.assert)(Q instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),p.enqueue(new Uint8Array(Q),1,[Q])}).catch(B=>{p.error(B)})},p.onCancel=B=>{this._fullReader.cancel(B),p.ready.catch(Q=>{if(!this.destroyed)throw Q})}}),r.on("ReaderHeadersReady",M=>{const p=new _util.PromiseCapability,B=this._fullReader;return B.headersReady.then(()=>{var Q;(!B.isStreamingSupported||!B.isRangeSupported)&&(this._lastProgress&&((Q=h.onProgress)==null||Q.call(h,this._lastProgress)),B.onProgress=U=>{var O;(O=h.onProgress)==null||O.call(h,{loaded:U.loaded,total:U.total})}),p.resolve({isStreamingSupported:B.isStreamingSupported,isRangeSupported:B.isRangeSupported,contentLength:B.contentLength})},p.reject),p.promise}),r.on("GetRangeReader",(M,p)=>{(0,_util.assert)(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const B=this._networkStream.getRangeReader(M.begin,M.end);if(!B){p.close();return}p.onPull=()=>{B.read().then(function(Q){let{value:U,done:O}=Q;if(O){p.close();return}(0,_util.assert)(U instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),p.enqueue(new Uint8Array(U),1,[U])}).catch(Q=>{p.error(Q)})},p.onCancel=Q=>{B.cancel(Q),p.ready.catch(U=>{if(!this.destroyed)throw U})}}),r.on("GetDoc",M=>{let{pdfInfo:p}=M;this._numPages=p.numPages,this._htmlForXfa=p.htmlForXfa,delete p.htmlForXfa,h._capability.resolve(new PDFDocumentProxy(p,this))}),r.on("DocException",function(M){let p;switch(M.name){case"PasswordException":p=new _util.PasswordException(M.message,M.code);break;case"InvalidPDFException":p=new _util.InvalidPDFException(M.message);break;case"MissingPDFException":p=new _util.MissingPDFException(M.message);break;case"UnexpectedResponseException":p=new _util.UnexpectedResponseException(M.message,M.status);break;case"UnknownErrorException":p=new _util.UnknownErrorException(M.message,M.details);break;default:(0,_util.unreachable)("DocException - expected a valid Error.")}h._capability.reject(p)}),r.on("PasswordRequest",M=>{if(Zl(this,b,new _util.PromiseCapability),h.onPassword){const p=B=>{B instanceof Error?t(this,b).reject(B):t(this,b).resolve({password:B})};try{h.onPassword(p,M.code)}catch(B){t(this,b).reject(B)}}else t(this,b).reject(new _util.PasswordException(M.message,M.code));return t(this,b).promise}),r.on("DataLoaded",M=>{var p;(p=h.onProgress)==null||p.call(h,{loaded:M.length,total:M.length}),this.downloadInfoCapability.resolve(M)}),r.on("StartRenderPage",M=>{this.destroyed||t(this,G).get(M.pageIndex)._startRenderPage(M.transparency,M.cacheKey)}),r.on("commonobj",M=>{var p;let[B,Q,U]=M;if(!this.destroyed&&!this.commonObjs.has(B))switch(Q){case"Font":const O=this._params;if("error"in U){const q=U.error;(0,_util.warn)(`Error during font loading: ${q}`),this.commonObjs.resolve(B,q);break}const I=O.pdfBug&&(p=globalThis.FontInspector)!=null&&p.enabled?(q,K)=>globalThis.FontInspector.fontAdded(q,K):null,j=new _font_loader.FontFaceObject(U,{isEvalSupported:O.isEvalSupported,disableFontFace:O.disableFontFace,ignoreErrors:O.ignoreErrors,inspectFont:I});this.fontLoader.bind(j).catch(q=>r.sendWithPromise("FontFallback",{id:B})).finally(()=>{!O.fontExtraProperties&&j.data&&(j.data=null),this.commonObjs.resolve(B,j)});break;case"FontPath":case"Image":case"Pattern":this.commonObjs.resolve(B,U);break;default:throw new Error(`Got unknown common object type ${Q}`)}}),r.on("obj",M=>{var p;let[B,Q,U,O]=M;if(this.destroyed)return;const I=t(this,G).get(Q);if(!I.objs.has(B))switch(U){case"Image":if(I.objs.resolve(B,O),O){let j;if(O.bitmap){const{width:q,height:K}=O;j=q*K*4}else j=((p=O.data)==null?void 0:p.length)||0;j>_util.MAX_IMAGE_SIZE_TO_CACHE&&(I._maybeCleanupAfterRender=!0)}break;case"Pattern":I.objs.resolve(B,O);break;default:throw new Error(`Got unknown object type ${U}`)}}),r.on("DocProgress",M=>{var p;this.destroyed||(p=h.onProgress)==null||p.call(h,{loaded:M.loaded,total:M.total})}),r.on("FetchBuiltInCMap",M=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.cMapReaderFactory?this.cMapReaderFactory.fetch(M):Promise.reject(new Error("CMapReaderFactory not initialized, see the `useWorkerFetch` parameter."))),r.on("FetchStandardFontData",M=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.standardFontDataFactory?this.standardFontDataFactory.fetch(M):Promise.reject(new Error("StandardFontDataFactory not initialized, see the `useWorkerFetch` parameter.")))}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){var r;this.annotationStorage.size<=0&&(0,_util.warn)("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");const{map:h,transfers:M}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:h,filename:((r=this._fullReader)==null?void 0:r.filename)??null},M).finally(()=>{this.annotationStorage.resetModified()})}getPage(r){if(!Number.isInteger(r)||r<=0||r>this._numPages)return Promise.reject(new Error("Invalid page request."));const h=r-1,M=t(this,s).get(h);if(M)return M;const p=this.messageHandler.sendWithPromise("GetPage",{pageIndex:h}).then(B=>{if(this.destroyed)throw new Error("Transport destroyed");const Q=new PDFPageProxy(h,B,this,this._params.pdfBug);return t(this,G).set(h,Q),Q});return t(this,s).set(h,p),p}getPageIndex(r){return typeof r!="object"||r===null||!Number.isInteger(r.num)||r.num<0||!Number.isInteger(r.gen)||r.gen<0?Promise.reject(new Error("Invalid pageIndex request.")):this.messageHandler.sendWithPromise("GetPageIndex",{num:r.num,gen:r.gen})}getAnnotations(r,h){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:r,intent:h})}getFieldObjects(){return A(this,a,rt).call(this,"GetFieldObjects")}hasJSActions(){return A(this,a,rt).call(this,"HasJSActions")}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(r){return typeof r!="string"?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:r})}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 A(this,a,rt).call(this,"GetDocJSActions")}getPageJSActions(r){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:r})}getStructTree(r){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:r})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(){return this.messageHandler.sendWithPromise("GetOptionalContentConfig",null).then(r=>new _optional_content_config.OptionalContentConfig(r))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){const r="GetMetadata",h=t(this,o).get(r);if(h)return h;const M=this.messageHandler.sendWithPromise(r,null).then(p=>{var B,Q;return{info:p[0],metadata:p[1]?new _metadata.Metadata(p[1]):null,contentDispositionFilename:((B=this._fullReader)==null?void 0:B.filename)??null,contentLength:((Q=this._fullReader)==null?void 0:Q.contentLength)??null}});return t(this,o).set(r,M),M}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(!this.destroyed){await this.messageHandler.sendWithPromise("Cleanup",null);for(const h of t(this,G).values())if(!h.cleanup())throw new Error(`startCleanup: Page ${h.pageNumber} is currently rendering.`);this.commonObjs.clear(),r||this.fontLoader.clear(),t(this,o).clear(),this.filterFactory.destroy(!0)}}get loadingParams(){const{disableAutoFetch:r,enableXfa:h}=this._params;return(0,_util.shadow)(this,"loadingParams",{disableAutoFetch:r,enableXfa:h})}}o=new WeakMap,G=new WeakMap,s=new WeakMap,b=new WeakMap,a=new WeakSet,rt=function(lt){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;const h=t(this,o).get(lt);if(h)return h;const M=this.messageHandler.sendWithPromise(lt,r);return t(this,o).set(lt,M),M};class PDFObjects{constructor(){E(this,W),E(this,N,Object.create(null))}get(r){let h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(h){const p=A(this,W,At).call(this,r);return p.capability.promise.then(()=>h(p.data)),null}const M=t(this,N)[r];if(!(M!=null&&M.capability.settled))throw new Error(`Requesting object that isn't resolved yet ${r}.`);return M.data}has(r){const h=t(this,N)[r];return(h==null?void 0:h.capability.settled)||!1}resolve(r){let h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;const M=A(this,W,At).call(this,r);M.data=h,M.capability.resolve()}clear(){var r;for(const h in t(this,N)){const{data:M}=t(this,N)[h];(r=M==null?void 0:M.bitmap)==null||r.close()}Zl(this,N,Object.create(null))}}N=new WeakMap,W=new WeakSet,At=function(lt){var r;return(r=t(this,N))[lt]||(r[lt]={capability:new _util.PromiseCapability,data:null})};class RenderTask{constructor(r){E(this,Z,null),Zl(this,Z,r),this.onContinue=null}get promise(){return t(this,Z).capability.promise}cancel(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;t(this,Z).cancel(null,r)}get separateAnnots(){const{separateAnnots:r}=t(this,Z).operatorList;if(!r)return!1;const{annotationCanvasMap:h}=t(this,Z);return r.form||r.canvas&&(h==null?void 0:h.size)>0}}Z=new WeakMap,exports.RenderTask=RenderTask;const z=class ie{constructor(r){let{callback:h,params:M,objs:p,commonObjs:B,annotationCanvasMap:Q,operatorList:U,pageIndex:O,canvasFactory:I,filterFactory:j,useRequestAnimationFrame:q=!1,pdfBug:K=!1,pageColors:f=null}=r;this.callback=h,this.params=M,this.objs=p,this.commonObjs=B,this.annotationCanvasMap=Q,this.operatorListIdx=null,this.operatorList=U,this._pageIndex=O,this.canvasFactory=I,this.filterFactory=j,this._pdfBug=K,this.pageColors=f,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=q===!0&&typeof window<"u",this.cancelled=!1,this.capability=new _util.PromiseCapability,this.task=new RenderTask(this),this._cancelBound=this.cancel.bind(this),this._continueBound=this._continue.bind(this),this._scheduleNextBound=this._scheduleNext.bind(this),this._nextBound=this._next.bind(this),this._canvas=M.canvasContext.canvas}get completed(){return this.capability.promise.catch(function(){})}initializeGraphics(r){var h,M;let{transparency:p=!1,optionalContentConfig:B}=r;if(this.cancelled)return;if(this._canvas){if(t(ie,d).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.");t(ie,d).add(this._canvas)}this._pdfBug&&(h=globalThis.StepperManager)!=null&&h.enabled&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());const{canvasContext:Q,viewport:U,transform:O,background:I}=this.params;this.gfx=new _canvas.CanvasGraphics(Q,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:B},this.annotationCanvasMap,this.pageColors),this.gfx.beginDrawing({transform:O,viewport:U,transparency:p,background:I}),this.operatorListIdx=0,this.graphicsReady=!0,(M=this.graphicsReadyCallback)==null||M.call(this)}cancel(){var r;let h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;this.running=!1,this.cancelled=!0,(r=this.gfx)==null||r.endDrawing(),t(ie,d).delete(this._canvas),this.callback(h||new _display_utils.RenderingCancelledException(`Rendering cancelled, page ${this._pageIndex+1}`,M))}operatorListChanged(){var r;if(!this.graphicsReady){this.graphicsReadyCallback||(this.graphicsReadyCallback=this._continueBound);return}(r=this.stepper)==null||r.updateOperatorList(this.operatorList),!this.running&&this._continue()}_continue(){this.running=!0,!this.cancelled&&(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())}_scheduleNext(){this._useRequestAnimationFrame?window.requestAnimationFrame(()=>{this._nextBound().catch(this._cancelBound)}):Promise.resolve().then(this._nextBound).catch(this._cancelBound)}async _next(){this.cancelled||(this.operatorListIdx=this.gfx.executeOperatorList(this.operatorList,this.operatorListIdx,this._continueBound,this.stepper),this.operatorListIdx===this.operatorList.argsArray.length&&(this.running=!1,this.operatorList.lastChunk&&(this.gfx.endDrawing(),t(ie,d).delete(this._canvas),this.callback())))}};d=new WeakMap,E(z,d,new WeakSet);let InternalRenderTask=z;const version="3.11.174";exports.version=version;const build="ce8716743";exports.build=build},(lt,r,h)=>{var M=h(3),p=h(126),B=h(135);M({target:"Set",proto:!0,real:!0,forced:!B("difference")},{difference:p})},(lt,r,h)=>{var M=h(127),p=h(128),B=h(129),Q=h(132),U=h(133),O=h(130),I=h(131),j=p.has,q=p.remove;lt.exports=function(K){var f=M(this),S=U(K),k=B(f);return Q(f)<=S.size?O(f,function(T){S.includes(T)&&q(k,T)}):I(S.getIterator(),function(T){j(f,T)&&q(k,T)}),k}},(lt,r,h)=>{var M=h(128).has;lt.exports=function(p){return M(p),p}},(lt,r,h)=>{var M=h(14),p=Set.prototype;lt.exports={Set,add:M(p.add),has:M(p.has),remove:M(p.delete),proto:p}},(lt,r,h)=>{var M=h(128),p=h(130),B=M.Set,Q=M.add;lt.exports=function(U){var O=new B;return p(U,function(I){Q(O,I)}),O}},(lt,r,h)=>{var M=h(14),p=h(131),B=h(128),Q=B.Set,U=B.proto,O=M(U.forEach),I=M(U.keys),j=I(new Q).next;lt.exports=function(q,K,f){return f?p({iterator:I(q),next:j},K):O(q,K)}},(lt,r,h)=>{var M=h(8);lt.exports=function(p,B,Q){for(var U=Q?p:p.iterator,O=p.next,I,j;!(I=M(O,U)).done;)if(j=B(I.value),j!==void 0)return j}},(lt,r,h)=>{var M=h(72),p=h(128);lt.exports=M(p.proto,"size","get")||function(B){return B.size}},(lt,r,h)=>{var M=h(31),p=h(47),B=h(8),Q=h(62),U=h(134),O="Invalid size",I=RangeError,j=TypeError,q=Math.max,K=function(f,S,k,T){this.set=f,this.size=S,this.has=k,this.keys=T};K.prototype={getIterator:function(){return U(p(B(this.keys,this.set)))},includes:function(f){return B(this.has,this.set,f)}},lt.exports=function(f){p(f);var S=+f.size;if(S!==S)throw j(O);var k=Q(S);if(k<0)throw I(O);return new K(f,q(k,0),M(f.has),M(f.keys))}},lt=>{lt.exports=function(r){return{iterator:r,next:r.next,done:!1}}},(lt,r,h)=>{var M=h(24),p=function(B){return{size:B,has:function(){return!1},keys:function(){return{next:function(){return{done:!0}}}}}};lt.exports=function(B){var Q=M("Set");try{new Q()[B](p(0));try{return new Q()[B](p(-1)),!1}catch{return!0}}catch{return!1}}},(lt,r,h)=>{var M=h(3),p=h(7),B=h(137),Q=h(135),U=!Q("intersection")||p(function(){return Array.from(new Set([1,2,3]).intersection(new Set([3,2])))!=="3,2"});M({target:"Set",proto:!0,real:!0,forced:U},{intersection:B})},(lt,r,h)=>{var M=h(127),p=h(128),B=h(132),Q=h(133),U=h(130),O=h(131),I=p.Set,j=p.add,q=p.has;lt.exports=function(K){var f=M(this),S=Q(K),k=new I;return B(f)>S.size?O(S.getIterator(),function(T){q(f,T)&&j(k,T)}):U(f,function(T){S.includes(T)&&j(k,T)}),k}},(lt,r,h)=>{var M=h(3),p=h(139),B=h(135);M({target:"Set",proto:!0,real:!0,forced:!B("isDisjointFrom")},{isDisjointFrom:p})},(lt,r,h)=>{var M=h(127),p=h(128).has,B=h(132),Q=h(133),U=h(130),O=h(131),I=h(140);lt.exports=function(j){var q=M(this),K=Q(j);if(B(q)<=K.size)return U(q,function(S){if(K.includes(S))return!1},!0)!==!1;var f=K.getIterator();return O(f,function(S){if(p(q,S))return I(f,"normal",!1)})!==!1}},(lt,r,h)=>{var M=h(8),p=h(47),B=h(30);lt.exports=function(Q,U,O){var I,j;p(Q);try{if(I=B(Q,"return"),!I){if(U==="throw")throw O;return O}I=M(I,Q)}catch(q){j=!0,I=q}if(U==="throw")throw O;if(j)throw I;return p(I),O}},(lt,r,h)=>{var M=h(3),p=h(142),B=h(135);M({target:"Set",proto:!0,real:!0,forced:!B("isSubsetOf")},{isSubsetOf:p})},(lt,r,h)=>{var M=h(127),p=h(132),B=h(130),Q=h(133);lt.exports=function(U){var O=M(this),I=Q(U);return p(O)>I.size?!1:B(O,function(j){if(!I.includes(j))return!1},!0)!==!1}},(lt,r,h)=>{var M=h(3),p=h(144),B=h(135);M({target:"Set",proto:!0,real:!0,forced:!B("isSupersetOf")},{isSupersetOf:p})},(lt,r,h)=>{var M=h(127),p=h(128).has,B=h(132),Q=h(133),U=h(131),O=h(140);lt.exports=function(I){var j=M(this),q=Q(I);if(B(j)<q.size)return!1;var K=q.getIterator();return U(K,function(f){if(!p(j,f))return O(K,"normal",!1)})!==!1}},(lt,r,h)=>{var M=h(3),p=h(146),B=h(135);M({target:"Set",proto:!0,real:!0,forced:!B("symmetricDifference")},{symmetricDifference:p})},(lt,r,h)=>{var M=h(127),p=h(128),B=h(129),Q=h(133),U=h(131),O=p.add,I=p.has,j=p.remove;lt.exports=function(q){var K=M(this),f=Q(q).getIterator(),S=B(K);return U(f,function(k){I(K,k)?j(S,k):O(S,k)}),S}},(lt,r,h)=>{var M=h(3),p=h(148),B=h(135);M({target:"Set",proto:!0,real:!0,forced:!B("union")},{union:p})},(lt,r,h)=>{var M=h(127),p=h(128).add,B=h(129),Q=h(133),U=h(131);lt.exports=function(O){var I=M(this),j=Q(O).getIterator(),q=B(I);return U(j,function(K){p(q,K)}),q}},(lt,r,h)=>{var M=h(3),p=h(4),B=h(24),Q=h(11),U=h(45).f,O=h(39),I=h(150),j=h(75),q=h(76),K=h(151),f=h(82),S=h(6),k=h(36),T="DOMException",g=B("Error"),F=B(T),J=function(){I(this,v);var Xt=arguments.length,zt=q(Xt<1?void 0:arguments[0]),Gt=q(Xt<2?void 0:arguments[1],"Error"),Nt=new F(zt,Gt),Ut=g(zt);return Ut.name=T,U(Nt,"stack",Q(1,f(Ut.stack,1))),j(Nt,this,J),Nt},v=J.prototype=F.prototype,u="stack"in g(T),m="stack"in new F(1,2),_=F&&S&&Object.getOwnPropertyDescriptor(p,T),$=!!_&&!(_.writable&&_.configurable),P=u&&!$&&!m;M({global:!0,constructor:!0,forced:k||P},{DOMException:P?J:F});var Zt=B(T),dt=Zt.prototype;if(dt.constructor!==Zt){k||U(dt,"constructor",Q(1,Zt));for(var It in K)if(O(K,It)){var xt=K[It],it=xt.s;O(Zt,it)||U(Zt,it,Q(6,xt.c))}}},(lt,r,h)=>{var M=h(25),p=TypeError;lt.exports=function(B,Q){if(M(Q,B))return B;throw p("Incorrect invocation")}},lt=>{lt.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}}},(lt,r,h)=>{var M=h(36),p=h(3),B=h(4),Q=h(24),U=h(14),O=h(7),I=h(41),j=h(21),q=h(153),K=h(17),f=h(20),S=h(23),k=h(154),T=h(47),g=h(78),F=h(39),J=h(159),v=h(44),u=h(64),m=h(85),_=h(160),$=h(162),P=h(128),Zt=h(83),dt=h(119),It=B.Object,xt=B.Array,it=B.Date,Xt=B.Error,zt=B.EvalError,Gt=B.RangeError,Nt=B.ReferenceError,Ut=B.SyntaxError,Vt=B.TypeError,Ht=B.URIError,Pt=B.PerformanceMark,at=B.WebAssembly,R=at&&at.CompileError||Xt,w=at&&at.LinkError||Xt,X=at&&at.RuntimeError||Xt,C=Q("DOMException"),H=$.Map,st=$.has,et=$.get,Mt=$.set,Rt=P.Set,gt=P.add,Jt=Q("Object","keys"),Dt=U([].push),qt=U((!0).valueOf),vt=U(1 .valueOf),cl=U("".valueOf),bl=U(it.prototype.getTime),il=I("structuredClone"),Bt="DataCloneError",Ft="Transferring",wt=function(Lt){return!O(function(){var yt=new B.Set([7]),Kt=Lt(yt),tl=Lt(It(7));return Kt===yt||!Kt.has(7)||typeof tl!="object"||+tl!=7})&&Lt},pt=function(Lt,yt){return!O(function(){var Kt=new yt,tl=Lt({a:Kt,b:Kt});return!(tl&&tl.a===tl.b&&tl.a instanceof yt&&tl.a.stack===Kt.stack)})},Ct=function(Lt){return!O(function(){var yt=Lt(new B.AggregateError([1],il,{cause:3}));return yt.name!=="AggregateError"||yt.errors[0]!==1||yt.message!==il||yt.cause!==3})},$t=B.structuredClone,dl=M||!pt($t,Xt)||!pt($t,C)||!Ct($t),rl=!$t&&wt(function(Lt){return new Pt(il,{detail:Lt}).detail}),Yl=wt($t)||rl,Xl=function(Lt){throw new C("Uncloneable type: "+Lt,Bt)},pl=function(Lt,yt){throw new C((yt||"Cloning")+" of "+Lt+" cannot be properly polyfilled in this engine",Bt)},Ll=function(Lt,yt){return Yl||pl(yt),Yl(Lt)},yl=function(){var Lt;try{Lt=new B.DataTransfer}catch{try{Lt=new B.ClipboardEvent("").clipboardData}catch{}}return Lt&&Lt.items&&Lt.files?Lt:null},Vl=function(Lt,yt,Kt){if(st(yt,Lt))return et(yt,Lt);var tl=Kt||g(Lt),el,ol,Qt,Ml,hl,Il;if(tl==="SharedArrayBuffer")Yl?el=Yl(Lt):el=Lt;else{var Wl=B.DataView;!Wl&&typeof Lt.slice!="function"&&pl("ArrayBuffer");try{if(typeof Lt.slice=="function"&&!Lt.resizable)el=Lt.slice(0);else for(ol=Lt.byteLength,Qt=("maxByteLength"in Lt)?{maxByteLength:Lt.maxByteLength}:void 0,el=new ArrayBuffer(ol,Qt),Ml=new Wl(Lt),hl=new Wl(el),Il=0;Il<ol;Il++)hl.setUint8(Il,Ml.getUint8(Il))}catch{throw new C("ArrayBuffer is detached",Bt)}}return Mt(yt,Lt,el),el},_t=function(Lt,yt,Kt,tl,el){var ol=B[yt];return f(ol)||pl(yt),new ol(Vl(Lt.buffer,el),Kt,tl)},ot=function(Lt,yt,Kt){this.object=Lt,this.type=yt,this.metadata=Kt},ut=function(Lt,yt,Kt){if(S(Lt)&&Xl("Symbol"),!f(Lt))return Lt;if(yt){if(st(yt,Lt))return et(yt,Lt)}else yt=new H;var tl=g(Lt),el,ol,Qt,Ml,hl,Il,Wl,nt;switch(tl){case"Array":Qt=xt(u(Lt));break;case"Object":Qt={};break;case"Map":Qt=new H;break;case"Set":Qt=new Rt;break;case"RegExp":Qt=new RegExp(Lt.source,_(Lt));break;case"Error":switch(ol=Lt.name,ol){case"AggregateError":Qt=Q("AggregateError")([]);break;case"EvalError":Qt=zt();break;case"RangeError":Qt=Gt();break;case"ReferenceError":Qt=Nt();break;case"SyntaxError":Qt=Ut();break;case"TypeError":Qt=Vt();break;case"URIError":Qt=Ht();break;case"CompileError":Qt=R();break;case"LinkError":Qt=w();break;case"RuntimeError":Qt=X();break;default:Qt=Xt()}break;case"DOMException":Qt=new C(Lt.message,Lt.name);break;case"ArrayBuffer":case"SharedArrayBuffer":Qt=Kt?new ot(Lt,tl):Vl(Lt,yt,tl);break;case"DataView":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float16Array":case"Float32Array":case"Float64Array":case"BigInt64Array":case"BigUint64Array":Il=tl==="DataView"?Lt.byteLength:Lt.length,Qt=Kt?new ot(Lt,tl,{offset:Lt.byteOffset,length:Il}):_t(Lt,tl,Lt.byteOffset,Il,yt);break;case"DOMQuad":try{Qt=new DOMQuad(ut(Lt.p1,yt,Kt),ut(Lt.p2,yt,Kt),ut(Lt.p3,yt,Kt),ut(Lt.p4,yt,Kt))}catch{Qt=Ll(Lt,tl)}break;case"File":if(Yl)try{Qt=Yl(Lt),g(Qt)!==tl&&(Qt=void 0)}catch{}if(!Qt)try{Qt=new File([Lt],Lt.name,Lt)}catch{}Qt||pl(tl);break;case"FileList":if(Ml=yl(),Ml){for(hl=0,Il=u(Lt);hl<Il;hl++)Ml.items.add(ut(Lt[hl],yt,Kt));Qt=Ml.files}else Qt=Ll(Lt,tl);break;case"ImageData":try{Qt=new ImageData(ut(Lt.data,yt,Kt),Lt.width,Lt.height,{colorSpace:Lt.colorSpace})}catch{Qt=Ll(Lt,tl)}break;default:if(Yl)Qt=Yl(Lt);else switch(tl){case"BigInt":Qt=It(Lt.valueOf());break;case"Boolean":Qt=It(qt(Lt));break;case"Number":Qt=It(vt(Lt));break;case"String":Qt=It(cl(Lt));break;case"Date":Qt=new it(bl(Lt));break;case"Blob":try{Qt=Lt.slice(0,Lt.size,Lt.type)}catch{pl(tl)}break;case"DOMPoint":case"DOMPointReadOnly":el=B[tl];try{Qt=el.fromPoint?el.fromPoint(Lt):new el(Lt.x,Lt.y,Lt.z,Lt.w)}catch{pl(tl)}break;case"DOMRect":case"DOMRectReadOnly":el=B[tl];try{Qt=el.fromRect?el.fromRect(Lt):new el(Lt.x,Lt.y,Lt.width,Lt.height)}catch{pl(tl)}break;case"DOMMatrix":case"DOMMatrixReadOnly":el=B[tl];try{Qt=el.fromMatrix?el.fromMatrix(Lt):new el(Lt)}catch{pl(tl)}break;case"AudioData":case"VideoFrame":j(Lt.clone)||pl(tl);try{Qt=Lt.clone()}catch{Xl(tl)}break;case"CropTarget":case"CryptoKey":case"FileSystemDirectoryHandle":case"FileSystemFileHandle":case"FileSystemHandle":case"GPUCompilationInfo":case"GPUCompilationMessage":case"ImageBitmap":case"RTCCertificate":case"WebAssembly.Module":pl(tl);default:Xl(tl)}}switch(Mt(yt,Lt,Qt),tl){case"Array":case"Object":for(Wl=Jt(Lt),hl=0,Il=u(Wl);hl<Il;hl++)nt=Wl[hl],J(Qt,nt,ut(Lt[nt],yt,Kt));break;case"Map":Lt.forEach(function(L,ct){Mt(Qt,ut(ct,yt,Kt),ut(L,yt,Kt))});break;case"Set":Lt.forEach(function(L){gt(Qt,ut(L,yt,Kt))});break;case"Error":v(Qt,"message",ut(Lt.message,yt,Kt)),F(Lt,"cause")&&v(Qt,"cause",ut(Lt.cause,yt,Kt)),ol==="AggregateError"&&(Qt.errors=ut(Lt.errors,yt,Kt));case"DOMException":Zt&&v(Qt,"stack",ut(Lt.stack,yt,Kt))}return Qt},Tt=function(Lt,yt){if(!f(Lt))return Lt;if(st(yt,Lt))return et(yt,Lt);var Kt,tl,el,ol,Qt,Ml,hl,Il;if(Lt instanceof ot)switch(Kt=Lt.type,tl=Lt.object,Kt){case"ArrayBuffer":case"SharedArrayBuffer":Il=Vl(tl,yt,Kt);break;case"DataView":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float16Array":case"Float32Array":case"Float64Array":case"BigInt64Array":case"BigUint64Array":el=Lt.metadata,Il=_t(tl,Kt,el.offset,el.length,yt)}else switch(g(Lt)){case"Array":case"Object":for(Ml=Jt(Lt),ol=0,Qt=u(Ml);ol<Qt;ol++)hl=Ml[ol],Lt[hl]=Tt(Lt[hl],yt);break;case"Map":Il=new H,Lt.forEach(function(Wl,nt){Mt(Il,Tt(nt,yt),Tt(Wl,yt))});break;case"Set":Il=new Rt,Lt.forEach(function(Wl){gt(Il,Tt(Wl,yt))});break;case"Error":Lt.message=Tt(Lt.message,yt),F(Lt,"cause")&&(Lt.cause=Tt(Lt.cause,yt)),Lt.name==="AggregateError"&&(Lt.errors=Tt(Lt.errors,yt));case"DOMException":Zt&&(Lt.stack=Tt(Lt.stack,yt))}return Mt(yt,Lt,Il||Lt),Il||Lt},jt=function(Lt,yt){if(!f(Lt))throw Vt("Transfer option cannot be converted to a sequence");var Kt=[];k(Lt,function(L){Dt(Kt,T(L))});for(var tl=0,el=u(Kt),ol=[],Qt,Ml,hl,Il,Wl,nt;tl<el;){if(Qt=Kt[tl++],Ml=g(Qt),Ml==="ArrayBuffer"){Dt(ol,Qt);continue}if(st(yt,Qt))throw new C("Duplicate transferable",Bt);if(dt)Il=$t(Qt,{transfer:[Qt]});else switch(Ml){case"ImageBitmap":hl=B.OffscreenCanvas,q(hl)||pl(Ml,Ft);try{Wl=new hl(Qt.width,Qt.height),nt=Wl.getContext("bitmaprenderer"),nt.transferFromImageBitmap(Qt),Il=Wl.transferToImageBitmap()}catch{}break;case"AudioData":case"VideoFrame":(!j(Qt.clone)||!j(Qt.close))&&pl(Ml,Ft);try{Il=Qt.clone(),Qt.close()}catch{}break;case"MediaSourceHandle":case"MessagePort":case"OffscreenCanvas":case"ReadableStream":case"TransformStream":case"WritableStream":pl(Ml,Ft)}if(Il===void 0)throw new C("This object cannot be transferred: "+Ml,Bt);Mt(yt,Qt,Il)}return ol},Ot=function(Lt,yt){for(var Kt=0,tl=u(Lt),el,ol;Kt<tl;){if(el=Lt[Kt++],st(yt,el))throw new C("Duplicate transferable",Bt);dt?ol=$t(el,{transfer:[el]}):(j(el.transfer)||pl("ArrayBuffer",Ft),ol=el.transfer()),Mt(yt,el,ol)}};p({global:!0,enumerable:!0,sham:!dt,forced:dl},{structuredClone:function(Lt){var yt=m(arguments.length,1)>1&&!K(arguments[1])?T(arguments[1]):void 0,Kt=yt?yt.transfer:void 0,tl=!1,el,ol;Kt!==void 0&&(el=new H,ol=jt(Kt,el),tl=!!u(ol));var Qt=ut(Lt,el,tl);return tl&&(el=new H,Ot(Kt,el),Qt=Tt(Qt,el)),Qt}})},(lt,r,h)=>{var M=h(14),p=h(7),B=h(21),Q=h(78),U=h(24),O=h(51),I=function(){},j=[],q=U("Reflect","construct"),K=/^\s*(?:class|function)\b/,f=M(K.exec),S=!K.exec(I),k=function(g){if(!B(g))return!1;try{return q(I,j,g),!0}catch{return!1}},T=function(g){if(!B(g))return!1;switch(Q(g)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return S||!!f(K,O(g))}catch{return!0}};T.sham=!0,lt.exports=!q||p(function(){var g;return k(k.call)||!k(Object)||!k(function(){g=!0})||g})?T:k},(lt,r,h)=>{var M=h(99),p=h(8),B=h(47),Q=h(32),U=h(155),O=h(64),I=h(25),j=h(157),q=h(158),K=h(140),f=TypeError,S=function(T,g){this.stopped=T,this.result=g},k=S.prototype;lt.exports=function(T,g,F){var J=F&&F.that,v=!!(F&&F.AS_ENTRIES),u=!!(F&&F.IS_RECORD),m=!!(F&&F.IS_ITERATOR),_=!!(F&&F.INTERRUPTED),$=M(g,J),P,Zt,dt,It,xt,it,Xt,zt=function(Nt){return P&&K(P,"normal",Nt),new S(!0,Nt)},Gt=function(Nt){return v?(B(Nt),_?$(Nt[0],Nt[1],zt):$(Nt[0],Nt[1])):_?$(Nt,zt):$(Nt)};if(u)P=T.iterator;else if(m)P=T;else{if(Zt=q(T),!Zt)throw f(Q(T)+" is not iterable");if(U(Zt)){for(dt=0,It=O(T);It>dt;dt++)if(xt=Gt(T[dt]),xt&&I(k,xt))return xt;return new S(!1)}P=j(T,Zt)}for(it=u?T.next:P.next;!(Xt=p(it,P)).done;){try{xt=Gt(Xt.value)}catch(Nt){K(P,"throw",Nt)}if(typeof xt=="object"&&xt&&I(k,xt))return xt}return new S(!1)}},(lt,r,h)=>{var M=h(34),p=h(156),B=M("iterator"),Q=Array.prototype;lt.exports=function(U){return U!==void 0&&(p.Array===U||Q[B]===U)}},lt=>{lt.exports={}},(lt,r,h)=>{var M=h(8),p=h(31),B=h(47),Q=h(32),U=h(158),O=TypeError;lt.exports=function(I,j){var q=arguments.length<2?U(I):j;if(p(q))return B(M(q,I));throw O(Q(I)+" is not iterable")}},(lt,r,h)=>{var M=h(78),p=h(30),B=h(17),Q=h(156),U=h(34),O=U("iterator");lt.exports=function(I){if(!B(I))return p(I,O)||p(I,"@@iterator")||Q[M(I)]}},(lt,r,h)=>{var M=h(18),p=h(45),B=h(11);lt.exports=function(Q,U,O){var I=M(U);I in Q?p.f(Q,I,B(0,O)):Q[I]=O}},(lt,r,h)=>{var M=h(8),p=h(39),B=h(25),Q=h(161),U=RegExp.prototype;lt.exports=function(O){var I=O.flags;return I===void 0&&!("flags"in U)&&!p(O,"flags")&&B(U,O)?M(Q,O):I}},(lt,r,h)=>{var M=h(47);lt.exports=function(){var p=M(this),B="";return p.hasIndices&&(B+="d"),p.global&&(B+="g"),p.ignoreCase&&(B+="i"),p.multiline&&(B+="m"),p.dotAll&&(B+="s"),p.unicode&&(B+="u"),p.unicodeSets&&(B+="v"),p.sticky&&(B+="y"),B}},(lt,r,h)=>{var M=h(14),p=Map.prototype;lt.exports={Map,set:M(p.set),get:M(p.get),has:M(p.has),remove:M(p.delete),proto:p}},(lt,r,h)=>{var M,p,B,Q,U;Object.defineProperty(r,"__esModule",{value:!0}),r.SerializableEmpty=r.PrintAnnotationStorage=r.AnnotationStorage=void 0,h(89),h(149),h(152);var O=h(1),I=h(164),j=h(170);const q=Object.freeze({map:null,hash:"",transfers:void 0});r.SerializableEmpty=q;class K{constructor(){E(this,B),E(this,M,!1),E(this,p,new Map),this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(k,T){const g=t(this,p).get(k);return g===void 0?T:Object.assign(T,g)}getRawValue(k){return t(this,p).get(k)}remove(k){if(t(this,p).delete(k),t(this,p).size===0&&this.resetModified(),typeof this.onAnnotationEditor=="function"){for(const T of t(this,p).values())if(T instanceof I.AnnotationEditor)return;this.onAnnotationEditor(null)}}setValue(k,T){const g=t(this,p).get(k);let F=!1;if(g!==void 0)for(const[J,v]of Object.entries(T))g[J]!==v&&(F=!0,g[J]=v);else F=!0,t(this,p).set(k,T);F&&A(this,B,Q).call(this),T instanceof I.AnnotationEditor&&typeof this.onAnnotationEditor=="function"&&this.onAnnotationEditor(T.constructor._type)}has(k){return t(this,p).has(k)}getAll(){return t(this,p).size>0?(0,O.objectFromMap)(t(this,p)):null}setAll(k){for(const[T,g]of Object.entries(k))this.setValue(T,g)}get size(){return t(this,p).size}resetModified(){t(this,M)&&(Zl(this,M,!1),typeof this.onResetModified=="function"&&this.onResetModified())}get print(){return new f(this)}get serializable(){if(t(this,p).size===0)return q;const k=new Map,T=new j.MurmurHash3_64,g=[],F=Object.create(null);let J=!1;for(const[v,u]of t(this,p)){const m=u instanceof I.AnnotationEditor?u.serialize(!1,F):u;m&&(k.set(v,m),T.update(`${v}:${JSON.stringify(m)}`),J||(J=!!m.bitmap))}if(J)for(const v of k.values())v.bitmap&&g.push(v.bitmap);return k.size>0?{map:k,hash:T.hexdigest(),transfers:g}:q}}M=new WeakMap,p=new WeakMap,B=new WeakSet,Q=function(){t(this,M)||(Zl(this,M,!0),typeof this.onSetModified=="function"&&this.onSetModified())},r.AnnotationStorage=K;class f extends K{constructor(k){super(),E(this,U,void 0);const{map:T,hash:g,transfers:F}=k.serializable,J=structuredClone(T,null);Zl(this,U,{map:J,hash:g,transfers:F})}get print(){(0,O.unreachable)("Should not call PrintAnnotationStorage.print")}get serializable(){return t(this,U)}}U=new WeakMap,r.PrintAnnotationStorage=f},(lt,r,h)=>{var M,p,B,Q,U,O,I,j,q,K,f,S,k,T,g,F,J,v,u,m,_,$,P,Zt,dt,It,xt,it,Xt,zt,Gt,Nt;Object.defineProperty(r,"__esModule",{value:!0}),r.AnnotationEditor=void 0,h(89),h(2);var Ut=h(165),Vt=h(1),Ht=h(168);const Pt=class Fl{constructor(X){E(this,g),E(this,J),E(this,_),E(this,P),E(this,dt),E(this,xt),E(this,Xt),E(this,Gt),E(this,M,""),E(this,p,!1),E(this,B,null),E(this,Q,null),E(this,U,null),E(this,O,!1),E(this,I,null),E(this,j,this.focusin.bind(this)),E(this,q,this.focusout.bind(this)),E(this,K,!1),E(this,f,!1),E(this,S,!1),tt(this,"_initialOptions",Object.create(null)),tt(this,"_uiManager",null),tt(this,"_focusEventsAllowed",!0),tt(this,"_l10nPromise",null),E(this,k,!1),E(this,T,Fl._zIndex++),this.constructor===Fl&&(0,Vt.unreachable)("Cannot initialize AnnotationEditor."),this.parent=X.parent,this.id=X.id,this.width=this.height=null,this.pageIndex=X.parent.pageIndex,this.name=X.name,this.div=null,this._uiManager=X.uiManager,this.annotationElementId=null,this._willKeepAspectRatio=!1,this._initialOptions.isCentered=X.isCentered,this._structTreeParentId=null;const{rotation:C,rawDims:{pageWidth:H,pageHeight:st,pageX:et,pageY:Mt}}=this.parent.viewport;this.rotation=C,this.pageRotation=(360+C-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[H,st],this.pageTranslation=[et,Mt];const[Rt,gt]=this.parentDimensions;this.x=X.x/Rt,this.y=X.y/gt,this.isAttachedToDOM=!1,this.deleted=!1}get editorType(){return Object.getPrototypeOf(this).constructor._type}static get _defaultLineColor(){return(0,Vt.shadow)(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(X){const C=new R({id:X.parent.getNextId(),parent:X.parent,uiManager:X._uiManager});C.annotationElementId=X.annotationElementId,C.deleted=!0,C._uiManager.addToAnnotationStorage(C)}static initialize(X){let C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(Fl._l10nPromise||(Fl._l10nPromise=new Map(["editor_alt_text_button_label","editor_alt_text_edit_button_label","editor_alt_text_decorative_tooltip"].map(st=>[st,X.get(st)]))),C!=null&&C.strings)for(const st of C.strings)Fl._l10nPromise.set(st,X.get(st));if(Fl._borderLineWidth!==-1)return;const H=getComputedStyle(document.documentElement);Fl._borderLineWidth=parseFloat(H.getPropertyValue("--outline-width"))||0}static updateDefaultParams(X,C){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(X){return!1}static paste(X,C){(0,Vt.unreachable)("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return t(this,k)}set _isDraggable(X){var C;Zl(this,k,X),(C=this.div)==null||C.classList.toggle("draggable",X)}center(){const[X,C]=this.pageDimensions;switch(this.parentRotation){case 90:this.x-=this.height*C/(X*2),this.y+=this.width*X/(C*2);break;case 180:this.x+=this.width/2,this.y+=this.height/2;break;case 270:this.x+=this.height*C/(X*2),this.y-=this.width*X/(C*2);break;default:this.x-=this.width/2,this.y-=this.height/2;break}this.fixAndSetPosition()}addCommands(X){this._uiManager.addCommands(X)}get currentLayer(){return this._uiManager.currentLayer}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=t(this,T)}setParent(X){X!==null&&(this.pageIndex=X.pageIndex,this.pageDimensions=X.pageDimensions),this.parent=X}focusin(X){this._focusEventsAllowed&&(t(this,K)?Zl(this,K,!1):this.parent.setSelected(this))}focusout(X){var C;if(!this._focusEventsAllowed||!this.isAttachedToDOM)return;const H=X.relatedTarget;H!=null&&H.closest(`#${this.id}`)||(X.preventDefault(),(C=this.parent)!=null&&C.isMultipleSelection||this.commitOrRemove())}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}setAt(X,C,H,st){const[et,Mt]=this.parentDimensions;[H,st]=this.screenToPageTranslation(H,st),this.x=(X+H)/et,this.y=(C+st)/Mt,this.fixAndSetPosition()}translate(X,C){A(this,g,F).call(this,this.parentDimensions,X,C)}translateInPage(X,C){A(this,g,F).call(this,this.pageDimensions,X,C),this.div.scrollIntoView({block:"nearest"})}drag(X,C){const[H,st]=this.parentDimensions;if(this.x+=X/H,this.y+=C/st,this.parent&&(this.x<0||this.x>1||this.y<0||this.y>1)){const{x:Jt,y:Dt}=this.div.getBoundingClientRect();this.parent.findNewParent(this,Jt,Dt)&&(this.x-=Math.floor(this.x),this.y-=Math.floor(this.y))}let{x:et,y:Mt}=this;const[Rt,gt]=A(this,J,v).call(this);et+=Rt,Mt+=gt,this.div.style.left=`${(100*et).toFixed(2)}%`,this.div.style.top=`${(100*Mt).toFixed(2)}%`,this.div.scrollIntoView({block:"nearest"})}fixAndSetPosition(){const[X,C]=this.pageDimensions;let{x:H,y:st,width:et,height:Mt}=this;switch(et*=X,Mt*=C,H*=X,st*=C,this.rotation){case 0:H=Math.max(0,Math.min(X-et,H)),st=Math.max(0,Math.min(C-Mt,st));break;case 90:H=Math.max(0,Math.min(X-Mt,H)),st=Math.min(C,Math.max(et,st));break;case 180:H=Math.min(X,Math.max(et,H)),st=Math.min(C,Math.max(Mt,st));break;case 270:H=Math.min(X,Math.max(Mt,H)),st=Math.max(0,Math.min(C-et,st));break}this.x=H/=X,this.y=st/=C;const[Rt,gt]=A(this,J,v).call(this);H+=Rt,st+=gt;const{style:Jt}=this.div;Jt.left=`${(100*H).toFixed(2)}%`,Jt.top=`${(100*st).toFixed(2)}%`,this.moveInDOM()}screenToPageTranslation(X,C){var H;return A(H=Fl,u,m).call(H,X,C,this.parentRotation)}pageTranslationToScreen(X,C){var H;return A(H=Fl,u,m).call(H,X,C,360-this.parentRotation)}get parentScale(){return this._uiManager.viewParameters.realScale}get parentRotation(){return(this._uiManager.viewParameters.rotation+this.pageRotation)%360}get parentDimensions(){const{parentScale:X,pageDimensions:[C,H]}=this,st=C*X,et=H*X;return Vt.FeatureTest.isCSSRoundSupported?[Math.round(st),Math.round(et)]:[st,et]}setDims(X,C){var H;const[st,et]=this.parentDimensions;this.div.style.width=`${(100*X/st).toFixed(2)}%`,t(this,O)||(this.div.style.height=`${(100*C/et).toFixed(2)}%`),(H=t(this,B))==null||H.classList.toggle("small",X<Fl.SMALL_EDITOR_SIZE||C<Fl.SMALL_EDITOR_SIZE)}fixDims(){const{style:X}=this.div,{height:C,width:H}=X,st=H.endsWith("%"),et=!t(this,O)&&C.endsWith("%");if(st&&et)return;const[Mt,Rt]=this.parentDimensions;st||(X.width=`${(100*parseFloat(H)/Mt).toFixed(2)}%`),!t(this,O)&&!et&&(X.height=`${(100*parseFloat(C)/Rt).toFixed(2)}%`)}getInitialTranslation(){return[0,0]}async addAltTextButton(){if(t(this,B))return;const X=Zl(this,B,document.createElement("button"));X.className="altText";const C=await Fl._l10nPromise.get("editor_alt_text_button_label");X.textContent=C,X.setAttribute("aria-label",C),X.tabIndex="0",X.addEventListener("contextmenu",Ht.noContextMenu),X.addEventListener("pointerdown",H=>H.stopPropagation()),X.addEventListener("click",H=>{H.preventDefault(),this._uiManager.editAltText(this)},{capture:!0}),X.addEventListener("keydown",H=>{H.target===X&&H.key==="Enter"&&(H.preventDefault(),this._uiManager.editAltText(this))}),A(this,Xt,zt).call(this),this.div.append(X),Fl.SMALL_EDITOR_SIZE||(Fl.SMALL_EDITOR_SIZE=Math.min(128,Math.round(X.getBoundingClientRect().width*1.4)))}getClientDimensions(){return this.div.getBoundingClientRect()}get altTextData(){return{altText:t(this,M),decorative:t(this,p)}}set altTextData(X){let{altText:C,decorative:H}=X;t(this,M)===C&&t(this,p)===H||(Zl(this,M,C),Zl(this,p,H),A(this,Xt,zt).call(this))}render(){this.div=document.createElement("div"),this.div.setAttribute("data-editor-rotation",(360-this.rotation)%360),this.div.className=this.name,this.div.setAttribute("id",this.id),this.div.setAttribute("tabIndex",0),this.setInForeground(),this.div.addEventListener("focusin",t(this,j)),this.div.addEventListener("focusout",t(this,q));const[X,C]=this.parentDimensions;this.parentRotation%180!==0&&(this.div.style.maxWidth=`${(100*C/X).toFixed(2)}%`,this.div.style.maxHeight=`${(100*X/C).toFixed(2)}%`);const[H,st]=this.getInitialTranslation();return this.translate(H,st),(0,Ut.bindEvents)(this,this.div,["pointerdown"]),this.div}pointerdown(X){const{isMac:C}=Vt.FeatureTest.platform;if(X.button!==0||X.ctrlKey&&C){X.preventDefault();return}Zl(this,K,!0),A(this,Gt,Nt).call(this,X)}moveInDOM(){var X;(X=this.parent)==null||X.moveEditorInDOM(this)}_setParentAndPosition(X,C,H){X.changeParent(this),this.x=C,this.y=H,this.fixAndSetPosition()}getRect(X,C){const H=this.parentScale,[st,et]=this.pageDimensions,[Mt,Rt]=this.pageTranslation,gt=X/H,Jt=C/H,Dt=this.x*st,qt=this.y*et,vt=this.width*st,cl=this.height*et;switch(this.rotation){case 0:return[Dt+gt+Mt,et-qt-Jt-cl+Rt,Dt+gt+vt+Mt,et-qt-Jt+Rt];case 90:return[Dt+Jt+Mt,et-qt+gt+Rt,Dt+Jt+cl+Mt,et-qt+gt+vt+Rt];case 180:return[Dt-gt-vt+Mt,et-qt+Jt+Rt,Dt-gt+Mt,et-qt+Jt+cl+Rt];case 270:return[Dt-Jt-cl+Mt,et-qt-gt-vt+Rt,Dt-Jt+Mt,et-qt-gt+Rt];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(X,C){const[H,st,et,Mt]=X,Rt=et-H,gt=Mt-st;switch(this.rotation){case 0:return[H,C-Mt,Rt,gt];case 90:return[H,C-st,gt,Rt];case 180:return[et,C-st,Rt,gt];case 270:return[et,C-Mt,gt,Rt];default:throw new Error("Invalid rotation")}}onceAdded(){}isEmpty(){return!1}enableEditMode(){Zl(this,S,!0)}disableEditMode(){Zl(this,S,!1)}isInEditMode(){return t(this,S)}shouldGetKeyboardEvents(){return!1}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}rebuild(){var X,C;(X=this.div)==null||X.addEventListener("focusin",t(this,j)),(C=this.div)==null||C.addEventListener("focusout",t(this,q))}serialize(){(0,Vt.unreachable)("An editor must be serializable")}static deserialize(X,C,H){const st=new this.prototype.constructor({parent:C,id:C.getNextId(),uiManager:H});st.rotation=X.rotation;const[et,Mt]=st.pageDimensions,[Rt,gt,Jt,Dt]=st.getRectInCurrentCoords(X.rect,Mt);return st.x=Rt/et,st.y=gt/Mt,st.width=Jt/et,st.height=Dt/Mt,st}remove(){var X;this.div.removeEventListener("focusin",t(this,j)),this.div.removeEventListener("focusout",t(this,q)),this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),(X=t(this,B))==null||X.remove(),Zl(this,B,null),Zl(this,Q,null)}get isResizable(){return!1}makeResizable(){this.isResizable&&(A(this,P,Zt).call(this),t(this,I).classList.remove("hidden"))}select(){var X;this.makeResizable(),(X=this.div)==null||X.classList.add("selectedEditor")}unselect(){var X,C,H;(X=t(this,I))==null||X.classList.add("hidden"),(C=this.div)==null||C.classList.remove("selectedEditor"),(H=this.div)!=null&&H.contains(document.activeElement)&&this._uiManager.currentLayer.div.focus()}updateParams(X,C){}disableEditing(){t(this,B)&&(t(this,B).hidden=!0)}enableEditing(){t(this,B)&&(t(this,B).hidden=!1)}enterInEditMode(){}get contentDiv(){return this.div}get isEditing(){return t(this,f)}set isEditing(X){Zl(this,f,X),this.parent&&(X?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null))}setAspectRatio(X,C){Zl(this,O,!0);const H=X/C,{style:st}=this.div;st.aspectRatio=H,st.height="auto"}static get MIN_SIZE(){return 16}};M=new WeakMap,p=new WeakMap,B=new WeakMap,Q=new WeakMap,U=new WeakMap,O=new WeakMap,I=new WeakMap,j=new WeakMap,q=new WeakMap,K=new WeakMap,f=new WeakMap,S=new WeakMap,k=new WeakMap,T=new WeakMap,g=new WeakSet,F=function(w,X,C){let[H,st]=w;[X,C]=this.screenToPageTranslation(X,C),this.x+=X/H,this.y+=C/st,this.fixAndSetPosition()},J=new WeakSet,v=function(){const[w,X]=this.parentDimensions,{_borderLineWidth:C}=Pt,H=C/w,st=C/X;switch(this.rotation){case 90:return[-H,st];case 180:return[H,st];case 270:return[H,-st];default:return[-H,-st]}},u=new WeakSet,m=function(w,X,C){switch(C){case 90:return[X,-w];case 180:return[-w,-X];case 270:return[-X,w];default:return[w,X]}},_=new WeakSet,$=function(w){switch(w){case 90:{const[X,C]=this.pageDimensions;return[0,-X/C,C/X,0]}case 180:return[-1,0,0,-1];case 270:{const[X,C]=this.pageDimensions;return[0,X/C,-C/X,0]}default:return[1,0,0,1]}},P=new WeakSet,Zt=function(){if(t(this,I))return;Zl(this,I,document.createElement("div")),t(this,I).classList.add("resizers");const w=["topLeft","topRight","bottomRight","bottomLeft"];this._willKeepAspectRatio||w.push("topMiddle","middleRight","bottomMiddle","middleLeft");for(const X of w){const C=document.createElement("div");t(this,I).append(C),C.classList.add("resizer",X),C.addEventListener("pointerdown",A(this,dt,It).bind(this,X)),C.addEventListener("contextmenu",Ht.noContextMenu)}this.div.prepend(t(this,I))},dt=new WeakSet,It=function(w,X){X.preventDefault();const{isMac:C}=Vt.FeatureTest.platform;if(X.button!==0||X.ctrlKey&&C)return;const H=A(this,xt,it).bind(this,w),st=this._isDraggable;this._isDraggable=!1;const et={passive:!0,capture:!0};window.addEventListener("pointermove",H,et);const Mt=this.x,Rt=this.y,gt=this.width,Jt=this.height,Dt=this.parent.div.style.cursor,qt=this.div.style.cursor;this.div.style.cursor=this.parent.div.style.cursor=window.getComputedStyle(X.target).cursor;const vt=()=>{this._isDraggable=st,window.removeEventListener("pointerup",vt),window.removeEventListener("blur",vt),window.removeEventListener("pointermove",H,et),this.parent.div.style.cursor=Dt,this.div.style.cursor=qt;const cl=this.x,bl=this.y,il=this.width,Bt=this.height;cl===Mt&&bl===Rt&&il===gt&&Bt===Jt||this.addCommands({cmd:()=>{this.width=il,this.height=Bt,this.x=cl,this.y=bl;const[Ft,wt]=this.parentDimensions;this.setDims(Ft*il,wt*Bt),this.fixAndSetPosition()},undo:()=>{this.width=gt,this.height=Jt,this.x=Mt,this.y=Rt;const[Ft,wt]=this.parentDimensions;this.setDims(Ft*gt,wt*Jt),this.fixAndSetPosition()},mustExec:!0})};window.addEventListener("pointerup",vt),window.addEventListener("blur",vt)},xt=new WeakSet,it=function(w,X){const[C,H]=this.parentDimensions,st=this.x,et=this.y,Mt=this.width,Rt=this.height,gt=Pt.MIN_SIZE/C,Jt=Pt.MIN_SIZE/H,Dt=ut=>Math.round(ut*1e4)/1e4,qt=A(this,_,$).call(this,this.rotation),vt=(ut,Tt)=>[qt[0]*ut+qt[2]*Tt,qt[1]*ut+qt[3]*Tt],cl=A(this,_,$).call(this,360-this.rotation),bl=(ut,Tt)=>[cl[0]*ut+cl[2]*Tt,cl[1]*ut+cl[3]*Tt];let il,Bt,Ft=!1,wt=!1;switch(w){case"topLeft":Ft=!0,il=(ut,Tt)=>[0,0],Bt=(ut,Tt)=>[ut,Tt];break;case"topMiddle":il=(ut,Tt)=>[ut/2,0],Bt=(ut,Tt)=>[ut/2,Tt];break;case"topRight":Ft=!0,il=(ut,Tt)=>[ut,0],Bt=(ut,Tt)=>[0,Tt];break;case"middleRight":wt=!0,il=(ut,Tt)=>[ut,Tt/2],Bt=(ut,Tt)=>[0,Tt/2];break;case"bottomRight":Ft=!0,il=(ut,Tt)=>[ut,Tt],Bt=(ut,Tt)=>[0,0];break;case"bottomMiddle":il=(ut,Tt)=>[ut/2,Tt],Bt=(ut,Tt)=>[ut/2,0];break;case"bottomLeft":Ft=!0,il=(ut,Tt)=>[0,Tt],Bt=(ut,Tt)=>[ut,0];break;case"middleLeft":wt=!0,il=(ut,Tt)=>[0,Tt/2],Bt=(ut,Tt)=>[ut,Tt/2];break}const pt=il(Mt,Rt),Ct=Bt(Mt,Rt);let $t=vt(...Ct);const dl=Dt(st+$t[0]),rl=Dt(et+$t[1]);let Yl=1,Xl=1,[pl,Ll]=this.screenToPageTranslation(X.movementX,X.movementY);if([pl,Ll]=bl(pl/C,Ll/H),Ft){const ut=Math.hypot(Mt,Rt);Yl=Xl=Math.max(Math.min(Math.hypot(Ct[0]-pt[0]-pl,Ct[1]-pt[1]-Ll)/ut,1/Mt,1/Rt),gt/Mt,Jt/Rt)}else wt?Yl=Math.max(gt,Math.min(1,Math.abs(Ct[0]-pt[0]-pl)))/Mt:Xl=Math.max(Jt,Math.min(1,Math.abs(Ct[1]-pt[1]-Ll)))/Rt;const yl=Dt(Mt*Yl),Vl=Dt(Rt*Xl);$t=vt(...Bt(yl,Vl));const _t=dl-$t[0],ot=rl-$t[1];this.width=yl,this.height=Vl,this.x=_t,this.y=ot,this.setDims(C*yl,H*Vl),this.fixAndSetPosition()},Xt=new WeakSet,zt=async function(){var w;const X=t(this,B);if(!X)return;if(!t(this,M)&&!t(this,p)){X.classList.remove("done"),(w=t(this,Q))==null||w.remove();return}Pt._l10nPromise.get("editor_alt_text_edit_button_label").then(H=>{X.setAttribute("aria-label",H)});let C=t(this,Q);if(!C){Zl(this,Q,C=document.createElement("span")),C.className="tooltip",C.setAttribute("role","tooltip");const H=C.id=`alt-text-tooltip-${this.id}`;X.setAttribute("aria-describedby",H);const st=100;X.addEventListener("mouseenter",()=>{Zl(this,U,setTimeout(()=>{Zl(this,U,null),t(this,Q).classList.add("show"),this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",subtype:this.editorType,data:{action:"alt_text_tooltip"}}})},st))}),X.addEventListener("mouseleave",()=>{var et;clearTimeout(t(this,U)),Zl(this,U,null),(et=t(this,Q))==null||et.classList.remove("show")})}X.classList.add("done"),C.innerText=t(this,p)?await Pt._l10nPromise.get("editor_alt_text_decorative_tooltip"):t(this,M),C.parentNode||X.append(C)},Gt=new WeakSet,Nt=function(w){if(!this._isDraggable)return;const X=this._uiManager.isSelected(this);this._uiManager.setUpDragSession();let C,H;X&&(C={passive:!0,capture:!0},H=et=>{const[Mt,Rt]=this.screenToPageTranslation(et.movementX,et.movementY);this._uiManager.dragSelectedEditors(Mt,Rt)},window.addEventListener("pointermove",H,C));const st=()=>{if(window.removeEventListener("pointerup",st),window.removeEventListener("blur",st),X&&window.removeEventListener("pointermove",H,C),Zl(this,K,!1),!this._uiManager.endDragSession()){const{isMac:et}=Vt.FeatureTest.platform;w.ctrlKey&&!et||w.shiftKey||w.metaKey&&et?this.parent.toggleSelected(this):this.parent.setSelected(this)}};window.addEventListener("pointerup",st),window.addEventListener("blur",st)},E(Pt,u),tt(Pt,"_borderLineWidth",-1),tt(Pt,"_colorManager",new Ut.ColorManager),tt(Pt,"_zIndex",1),tt(Pt,"SMALL_EDITOR_SIZE",0);let at=Pt;r.AnnotationEditor=at;class R extends at{constructor(X){super(X),this.annotationElementId=X.annotationElementId,this.deleted=!0}serialize(){return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex}}}},(lt,r,h)=>{var M,p,B,Q,U,O,I,j,q,K,f,S,k,T,g,F,J,v,u,m,_,$,P,Zt,dt,It,xt,it,Xt,zt,Gt,Nt,Ut,Vt,Ht,Pt,at,R,w,X,C,H,st,et,Mt,Rt,gt,Jt,Dt,qt,vt,cl,bl,il,Bt,Ft,wt,pt,Ct,$t,dl,rl,Yl,Xl,pl,Ll,yl,Vl,_t,ot,ut,Tt;Object.defineProperty(r,"__esModule",{value:!0}),r.KeyboardManager=r.CommandManager=r.ColorManager=r.AnnotationEditorUIManager=void 0,r.bindEvents=Lt,r.opacityToHex=yt,h(93),h(101),h(102),h(105),h(107),h(109),h(113),h(116),h(123),h(2),h(89),h(125),h(136),h(138),h(141),h(143),h(145),h(147),h(166);var jt=h(1),Ot=h(168);function Lt(nt,L,ct){for(const Wt of ct)L.addEventListener(Wt,nt[Wt].bind(nt))}function yt(nt){return Math.round(Math.min(255,Math.max(1,255*nt))).toString(16).padStart(2,"0")}class Kt{constructor(){E(this,M,0)}getId(){return`${jt.AnnotationEditorPrefix}${mt(this,M)._++}`}}M=new WeakMap;const tl=class{constructor(){E(this,U),E(this,p,(0,jt.getUuid)()),E(this,B,0),E(this,Q,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>',ct=new OffscreenCanvas(1,3).getContext("2d"),Wt=new Image;Wt.src=L;const Yt=Wt.decode().then(()=>(ct.drawImage(Wt,0,0,1,1,0,0,1,3),new Uint32Array(ct.getImageData(0,0,1,1).data.buffer)[0]===0));return(0,jt.shadow)(this,"_isSVGFittingCanvas",Yt)}async getFromFile(L){const{lastModified:ct,name:Wt,size:Yt,type:kt}=L;return A(this,U,O).call(this,`${ct}_${Wt}_${Yt}_${kt}`,L)}async getFromUrl(L){return A(this,U,O).call(this,L,L)}async getFromId(L){t(this,Q)||Zl(this,Q,new Map);const ct=t(this,Q).get(L);return ct?ct.bitmap?(ct.refCounter+=1,ct):ct.file?this.getFromFile(ct.file):this.getFromUrl(ct.url):null}getSvgUrl(L){const ct=t(this,Q).get(L);return ct!=null&&ct.isSvg?ct.svgUrl:null}deleteId(L){t(this,Q)||Zl(this,Q,new Map);const ct=t(this,Q).get(L);ct&&(ct.refCounter-=1,ct.refCounter===0&&(ct.bitmap=null))}isValidId(L){return L.startsWith(`image_${t(this,p)}_`)}};p=new WeakMap,B=new WeakMap,Q=new WeakMap,U=new WeakSet,O=async function(nt,L){t(this,Q)||Zl(this,Q,new Map);let ct=t(this,Q).get(nt);if(ct===null)return null;if(ct!=null&&ct.bitmap)return ct.refCounter+=1,ct;try{ct||(ct={bitmap:null,id:`image_${t(this,p)}_${mt(this,B)._++}`,refCounter:0,isSvg:!1});let Wt;if(typeof L=="string"){ct.url=L;const Yt=await fetch(L);if(!Yt.ok)throw new Error(Yt.statusText);Wt=await Yt.blob()}else Wt=ct.file=L;if(Wt.type==="image/svg+xml"){const Yt=tl._isSVGFittingCanvas,kt=new FileReader,Et=new Image,sl=new Promise((ml,al)=>{Et.onload=()=>{ct.bitmap=Et,ct.isSvg=!0,ml()},kt.onload=async()=>{const zl=ct.svgUrl=kt.result;Et.src=await Yt?`${zl}#svgView(preserveAspectRatio(none))`:zl},Et.onerror=kt.onerror=al});kt.readAsDataURL(Wt),await sl}else ct.bitmap=await createImageBitmap(Wt);ct.refCounter=1}catch(Wt){console.error(Wt),ct=null}return t(this,Q).set(nt,ct),ct&&t(this,Q).set(ct.id,ct),ct};let el=tl;class ol{constructor(){E(this,I,[]),E(this,j,!1),E(this,q,void 0),E(this,K,-1);let L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:128;Zl(this,q,L)}add(L){let{cmd:ct,undo:Wt,mustExec:Yt,type:kt=NaN,overwriteIfSameType:Et=!1,keepUndo:sl=!1}=L;if(Yt&&ct(),t(this,j))return;const ml={cmd:ct,undo:Wt,type:kt};if(t(this,K)===-1){t(this,I).length>0&&(t(this,I).length=0),Zl(this,K,0),t(this,I).push(ml);return}if(Et&&t(this,I)[t(this,K)].type===kt){sl&&(ml.undo=t(this,I)[t(this,K)].undo),t(this,I)[t(this,K)]=ml;return}const al=t(this,K)+1;al===t(this,q)?t(this,I).splice(0,1):(Zl(this,K,al),al<t(this,I).length&&t(this,I).splice(al)),t(this,I).push(ml)}undo(){t(this,K)!==-1&&(Zl(this,j,!0),t(this,I)[t(this,K)].undo(),Zl(this,j,!1),Zl(this,K,t(this,K)-1))}redo(){t(this,K)<t(this,I).length-1&&(Zl(this,K,t(this,K)+1),Zl(this,j,!0),t(this,I)[t(this,K)].cmd(),Zl(this,j,!1))}hasSomethingToUndo(){return t(this,K)!==-1}hasSomethingToRedo(){return t(this,K)<t(this,I).length-1}destroy(){Zl(this,I,null)}}I=new WeakMap,j=new WeakMap,q=new WeakMap,K=new WeakMap,r.CommandManager=ol;class Qt{constructor(L){E(this,f),this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;const{isMac:ct}=jt.FeatureTest.platform;for(const[Wt,Yt,kt={}]of L)for(const Et of Wt){const sl=Et.startsWith("mac+");ct&&sl?(this.callbacks.set(Et.slice(4),{callback:Yt,options:kt}),this.allKeys.add(Et.split("+").at(-1))):!ct&&!sl&&(this.callbacks.set(Et,{callback:Yt,options:kt}),this.allKeys.add(Et.split("+").at(-1)))}}exec(L,ct){if(!this.allKeys.has(ct.key))return;const Wt=this.callbacks.get(A(this,f,S).call(this,ct));if(!Wt)return;const{callback:Yt,options:{bubbles:kt=!1,args:Et=[],checker:sl=null}}=Wt;sl&&!sl(L,ct)||(Yt.bind(L,...Et)(),kt||(ct.stopPropagation(),ct.preventDefault()))}}f=new WeakSet,S=function(nt){nt.altKey&&this.buffer.push("alt"),nt.ctrlKey&&this.buffer.push("ctrl"),nt.metaKey&&this.buffer.push("meta"),nt.shiftKey&&this.buffer.push("shift"),this.buffer.push(nt.key);const L=this.buffer.join("+");return this.buffer.length=0,L},r.KeyboardManager=Qt;const Ml=class Fs{get _colors(){const L=new Map([["CanvasText",null],["Canvas",null]]);return(0,Ot.getColorValues)(L),(0,jt.shadow)(this,"_colors",L)}convert(L){const ct=(0,Ot.getRGB)(L);if(!window.matchMedia("(forced-colors: active)").matches)return ct;for(const[Wt,Yt]of this._colors)if(Yt.every((kt,Et)=>kt===ct[Et]))return Fs._colorsMapping.get(Wt);return ct}getHexCode(L){const ct=this._colors.get(L);return ct?jt.Util.makeHexColor(...ct):L}};tt(Ml,"_colorsMapping",new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]));let hl=Ml;r.ColorManager=hl;const Il=class ls{constructor(L,ct,Wt,Yt,kt,Et){E(this,gt),E(this,Dt),E(this,vt),E(this,bl),E(this,Bt),E(this,wt),E(this,Ct),E(this,dl),E(this,Yl),E(this,pl),E(this,yl),E(this,_t),E(this,ut),E(this,k,null),E(this,T,new Map),E(this,g,new Map),E(this,F,null),E(this,J,null),E(this,v,new ol),E(this,u,0),E(this,m,new Set),E(this,_,null),E(this,$,null),E(this,P,new Set),E(this,Zt,null),E(this,dt,new Kt),E(this,It,!1),E(this,xt,!1),E(this,it,null),E(this,Xt,jt.AnnotationEditorType.NONE),E(this,zt,new Set),E(this,Gt,null),E(this,Nt,this.blur.bind(this)),E(this,Ut,this.focus.bind(this)),E(this,Vt,this.copy.bind(this)),E(this,Ht,this.cut.bind(this)),E(this,Pt,this.paste.bind(this)),E(this,at,this.keydown.bind(this)),E(this,R,this.onEditingAction.bind(this)),E(this,w,this.onPageChanging.bind(this)),E(this,X,this.onScaleChanging.bind(this)),E(this,C,this.onRotationChanging.bind(this)),E(this,H,{isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1}),E(this,st,[0,0]),E(this,et,null),E(this,Mt,null),E(this,Rt,null),Zl(this,Mt,L),Zl(this,Rt,ct),Zl(this,F,Wt),this._eventBus=Yt,this._eventBus._on("editingaction",t(this,R)),this._eventBus._on("pagechanging",t(this,w)),this._eventBus._on("scalechanging",t(this,X)),this._eventBus._on("rotationchanging",t(this,C)),Zl(this,J,kt.annotationStorage),Zl(this,Zt,kt.filterFactory),Zl(this,Gt,Et),this.viewParameters={realScale:Ot.PixelsPerInch.PDF_TO_CSS_UNITS,rotation:0}}static get _keyboardManager(){const L=ls.prototype,ct=kt=>{const{activeElement:Et}=document;return Et&&t(kt,Mt).contains(Et)&&kt.hasSomethingToControl()},Wt=this.TRANSLATE_SMALL,Yt=this.TRANSLATE_BIG;return(0,jt.shadow)(this,"_keyboardManager",new Qt([[["ctrl+a","mac+meta+a"],L.selectAll],[["ctrl+z","mac+meta+z"],L.undo],[["ctrl+y","ctrl+shift+z","mac+meta+shift+z","ctrl+shift+Z","mac+meta+shift+Z"],L.redo],[["Backspace","alt+Backspace","ctrl+Backspace","shift+Backspace","mac+Backspace","mac+alt+Backspace","mac+ctrl+Backspace","Delete","ctrl+Delete","shift+Delete","mac+Delete"],L.delete],[["Escape","mac+Escape"],L.unselectAll],[["ArrowLeft","mac+ArrowLeft"],L.translateSelectedEditors,{args:[-Wt,0],checker:ct}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],L.translateSelectedEditors,{args:[-Yt,0],checker:ct}],[["ArrowRight","mac+ArrowRight"],L.translateSelectedEditors,{args:[Wt,0],checker:ct}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],L.translateSelectedEditors,{args:[Yt,0],checker:ct}],[["ArrowUp","mac+ArrowUp"],L.translateSelectedEditors,{args:[0,-Wt],checker:ct}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],L.translateSelectedEditors,{args:[0,-Yt],checker:ct}],[["ArrowDown","mac+ArrowDown"],L.translateSelectedEditors,{args:[0,Wt],checker:ct}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],L.translateSelectedEditors,{args:[0,Yt],checker:ct}]]))}destroy(){A(this,bl,il).call(this),A(this,Dt,qt).call(this),this._eventBus._off("editingaction",t(this,R)),this._eventBus._off("pagechanging",t(this,w)),this._eventBus._off("scalechanging",t(this,X)),this._eventBus._off("rotationchanging",t(this,C));for(const L of t(this,g).values())L.destroy();t(this,g).clear(),t(this,T).clear(),t(this,P).clear(),Zl(this,k,null),t(this,zt).clear(),t(this,v).destroy(),t(this,F).destroy()}get hcmFilter(){return(0,jt.shadow)(this,"hcmFilter",t(this,Gt)?t(this,Zt).addHCMFilter(t(this,Gt).foreground,t(this,Gt).background):"none")}get direction(){return(0,jt.shadow)(this,"direction",getComputedStyle(t(this,Mt)).direction)}editAltText(L){var ct;(ct=t(this,F))==null||ct.editAltText(this,L)}onPageChanging(L){let{pageNumber:ct}=L;Zl(this,u,ct-1)}focusMainContainer(){t(this,Mt).focus()}findParent(L,ct){for(const Wt of t(this,g).values()){const{x:Yt,y:kt,width:Et,height:sl}=Wt.div.getBoundingClientRect();if(L>=Yt&&L<=Yt+Et&&ct>=kt&&ct<=kt+sl)return Wt}return null}disableUserSelect(){let L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;t(this,Rt).classList.toggle("noUserSelect",L)}addShouldRescale(L){t(this,P).add(L)}removeShouldRescale(L){t(this,P).delete(L)}onScaleChanging(L){let{scale:ct}=L;this.commitOrRemove(),this.viewParameters.realScale=ct*Ot.PixelsPerInch.PDF_TO_CSS_UNITS;for(const Wt of t(this,P))Wt.onScaleChanging()}onRotationChanging(L){let{pagesRotation:ct}=L;this.commitOrRemove(),this.viewParameters.rotation=ct}addToAnnotationStorage(L){!L.isEmpty()&&t(this,J)&&!t(this,J).has(L.id)&&t(this,J).setValue(L.id,L)}blur(){if(!this.hasSelection)return;const{activeElement:L}=document;for(const ct of t(this,zt))if(ct.div.contains(L)){Zl(this,it,[ct,L]),ct._focusEventsAllowed=!1;break}}focus(){if(!t(this,it))return;const[L,ct]=t(this,it);Zl(this,it,null),ct.addEventListener("focusin",()=>{L._focusEventsAllowed=!0},{once:!0}),ct.focus()}addEditListeners(){A(this,vt,cl).call(this),A(this,Bt,Ft).call(this)}removeEditListeners(){A(this,bl,il).call(this),A(this,wt,pt).call(this)}copy(L){var ct;if(L.preventDefault(),(ct=t(this,k))==null||ct.commitOrRemove(),!this.hasSelection)return;const Wt=[];for(const Yt of t(this,zt)){const kt=Yt.serialize(!0);kt&&Wt.push(kt)}Wt.length!==0&&L.clipboardData.setData("application/pdfjs",JSON.stringify(Wt))}cut(L){this.copy(L),this.delete()}paste(L){L.preventDefault();const{clipboardData:ct}=L;for(const kt of ct.items)for(const Et of t(this,$))if(Et.isHandlingMimeForPasting(kt.type)){Et.paste(kt,this.currentLayer);return}let Wt=ct.getData("application/pdfjs");if(!Wt)return;try{Wt=JSON.parse(Wt)}catch(kt){(0,jt.warn)(`paste: "${kt.message}".`);return}if(!Array.isArray(Wt))return;this.unselectAll();const Yt=this.currentLayer;try{const kt=[];for(const ml of Wt){const al=Yt.deserialize(ml);if(!al)return;kt.push(al)}const Et=()=>{for(const ml of kt)A(this,yl,Vl).call(this,ml);A(this,ut,Tt).call(this,kt)},sl=()=>{for(const ml of kt)ml.remove()};this.addCommands({cmd:Et,undo:sl,mustExec:!0})}catch(kt){(0,jt.warn)(`paste: "${kt.message}".`)}}keydown(L){var ct;(ct=this.getActive())!=null&&ct.shouldGetKeyboardEvents()||ls._keyboardManager.exec(this,L)}onEditingAction(L){["undo","redo","delete","selectAll"].includes(L.name)&&this[L.name]()}setEditingState(L){L?(A(this,gt,Jt).call(this),A(this,vt,cl).call(this),A(this,Bt,Ft).call(this),A(this,Ct,$t).call(this,{isEditing:t(this,Xt)!==jt.AnnotationEditorType.NONE,isEmpty:A(this,_t,ot).call(this),hasSomethingToUndo:t(this,v).hasSomethingToUndo(),hasSomethingToRedo:t(this,v).hasSomethingToRedo(),hasSelectedEditor:!1})):(A(this,Dt,qt).call(this),A(this,bl,il).call(this),A(this,wt,pt).call(this),A(this,Ct,$t).call(this,{isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(L){if(!t(this,$)){Zl(this,$,L);for(const ct of t(this,$))A(this,dl,rl).call(this,ct.defaultPropertiesToUpdate)}}getId(){return t(this,dt).getId()}get currentLayer(){return t(this,g).get(t(this,u))}getLayer(L){return t(this,g).get(L)}get currentPageIndex(){return t(this,u)}addLayer(L){t(this,g).set(L.pageIndex,L),t(this,It)?L.enable():L.disable()}removeLayer(L){t(this,g).delete(L.pageIndex)}updateMode(L){let ct=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(t(this,Xt)!==L){if(Zl(this,Xt,L),L===jt.AnnotationEditorType.NONE){this.setEditingState(!1),A(this,pl,Ll).call(this);return}this.setEditingState(!0),A(this,Yl,Xl).call(this),this.unselectAll();for(const Wt of t(this,g).values())Wt.updateMode(L);if(ct){for(const Wt of t(this,T).values())if(Wt.annotationElementId===ct){this.setSelected(Wt),Wt.enterInEditMode();break}}}}updateToolbar(L){L!==t(this,Xt)&&this._eventBus.dispatch("switchannotationeditormode",{source:this,mode:L})}updateParams(L,ct){if(t(this,$)){if(L===jt.AnnotationEditorParamsType.CREATE){this.currentLayer.addNewEditor(L);return}for(const Wt of t(this,zt))Wt.updateParams(L,ct);for(const Wt of t(this,$))Wt.updateDefaultParams(L,ct)}}enableWaiting(){let L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(t(this,xt)!==L){Zl(this,xt,L);for(const ct of t(this,g).values())L?ct.disableClick():ct.enableClick(),ct.div.classList.toggle("waiting",L)}}getEditors(L){const ct=[];for(const Wt of t(this,T).values())Wt.pageIndex===L&&ct.push(Wt);return ct}getEditor(L){return t(this,T).get(L)}addEditor(L){t(this,T).set(L.id,L)}removeEditor(L){var ct;t(this,T).delete(L.id),this.unselect(L),(!L.annotationElementId||!t(this,m).has(L.annotationElementId))&&((ct=t(this,J))==null||ct.remove(L.id))}addDeletedAnnotationElement(L){t(this,m).add(L.annotationElementId),L.deleted=!0}isDeletedAnnotationElement(L){return t(this,m).has(L)}removeDeletedAnnotationElement(L){t(this,m).delete(L.annotationElementId),L.deleted=!1}setActiveEditor(L){t(this,k)!==L&&(Zl(this,k,L),L&&A(this,dl,rl).call(this,L.propertiesToUpdate))}toggleSelected(L){if(t(this,zt).has(L)){t(this,zt).delete(L),L.unselect(),A(this,Ct,$t).call(this,{hasSelectedEditor:this.hasSelection});return}t(this,zt).add(L),L.select(),A(this,dl,rl).call(this,L.propertiesToUpdate),A(this,Ct,$t).call(this,{hasSelectedEditor:!0})}setSelected(L){for(const ct of t(this,zt))ct!==L&&ct.unselect();t(this,zt).clear(),t(this,zt).add(L),L.select(),A(this,dl,rl).call(this,L.propertiesToUpdate),A(this,Ct,$t).call(this,{hasSelectedEditor:!0})}isSelected(L){return t(this,zt).has(L)}unselect(L){L.unselect(),t(this,zt).delete(L),A(this,Ct,$t).call(this,{hasSelectedEditor:this.hasSelection})}get hasSelection(){return t(this,zt).size!==0}undo(){t(this,v).undo(),A(this,Ct,$t).call(this,{hasSomethingToUndo:t(this,v).hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:A(this,_t,ot).call(this)})}redo(){t(this,v).redo(),A(this,Ct,$t).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:t(this,v).hasSomethingToRedo(),isEmpty:A(this,_t,ot).call(this)})}addCommands(L){t(this,v).add(L),A(this,Ct,$t).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:A(this,_t,ot).call(this)})}delete(){if(this.commitOrRemove(),!this.hasSelection)return;const L=[...t(this,zt)],ct=()=>{for(const Yt of L)Yt.remove()},Wt=()=>{for(const Yt of L)A(this,yl,Vl).call(this,Yt)};this.addCommands({cmd:ct,undo:Wt,mustExec:!0})}commitOrRemove(){var L;(L=t(this,k))==null||L.commitOrRemove()}hasSomethingToControl(){return t(this,k)||this.hasSelection}selectAll(){for(const L of t(this,zt))L.commit();A(this,ut,Tt).call(this,t(this,T).values())}unselectAll(){if(t(this,k)){t(this,k).commitOrRemove();return}if(this.hasSelection){for(const L of t(this,zt))L.unselect();t(this,zt).clear(),A(this,Ct,$t).call(this,{hasSelectedEditor:!1})}}translateSelectedEditors(L,ct){if(arguments.length>2&&arguments[2]!==void 0&&arguments[2]||this.commitOrRemove(),!this.hasSelection)return;t(this,st)[0]+=L,t(this,st)[1]+=ct;const[Wt,Yt]=t(this,st),kt=[...t(this,zt)];t(this,et)&&clearTimeout(t(this,et)),Zl(this,et,setTimeout(()=>{Zl(this,et,null),t(this,st)[0]=t(this,st)[1]=0,this.addCommands({cmd:()=>{for(const sl of kt)t(this,T).has(sl.id)&&sl.translateInPage(Wt,Yt)},undo:()=>{for(const sl of kt)t(this,T).has(sl.id)&&sl.translateInPage(-Wt,-Yt)},mustExec:!1})},1e3));for(const sl of kt)sl.translateInPage(L,ct)}setUpDragSession(){if(this.hasSelection){this.disableUserSelect(!0),Zl(this,_,new Map);for(const L of t(this,zt))t(this,_).set(L,{savedX:L.x,savedY:L.y,savedPageIndex:L.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!t(this,_))return!1;this.disableUserSelect(!1);const L=t(this,_);Zl(this,_,null);let ct=!1;for(const[{x:Yt,y:kt,pageIndex:Et},sl]of L)sl.newX=Yt,sl.newY=kt,sl.newPageIndex=Et,ct||(ct=Yt!==sl.savedX||kt!==sl.savedY||Et!==sl.savedPageIndex);if(!ct)return!1;const Wt=(Yt,kt,Et,sl)=>{if(t(this,T).has(Yt.id)){const ml=t(this,g).get(sl);ml?Yt._setParentAndPosition(ml,kt,Et):(Yt.pageIndex=sl,Yt.x=kt,Yt.y=Et)}};return this.addCommands({cmd:()=>{for(const[Yt,{newX:kt,newY:Et,newPageIndex:sl}]of L)Wt(Yt,kt,Et,sl)},undo:()=>{for(const[Yt,{savedX:kt,savedY:Et,savedPageIndex:sl}]of L)Wt(Yt,kt,Et,sl)},mustExec:!0}),!0}dragSelectedEditors(L,ct){if(t(this,_))for(const Wt of t(this,_).keys())Wt.drag(L,ct)}rebuild(L){if(L.parent===null){const ct=this.getLayer(L.pageIndex);ct?(ct.changeParent(L),ct.addOrRebuild(L)):(this.addEditor(L),this.addToAnnotationStorage(L),L.rebuild())}else L.parent.addOrRebuild(L)}isActive(L){return t(this,k)===L}getActive(){return t(this,k)}getMode(){return t(this,Xt)}get imageManager(){return(0,jt.shadow)(this,"imageManager",new el)}};k=new WeakMap,T=new WeakMap,g=new WeakMap,F=new WeakMap,J=new WeakMap,v=new WeakMap,u=new WeakMap,m=new WeakMap,_=new WeakMap,$=new WeakMap,P=new WeakMap,Zt=new WeakMap,dt=new WeakMap,It=new WeakMap,xt=new WeakMap,it=new WeakMap,Xt=new WeakMap,zt=new WeakMap,Gt=new WeakMap,Nt=new WeakMap,Ut=new WeakMap,Vt=new WeakMap,Ht=new WeakMap,Pt=new WeakMap,at=new WeakMap,R=new WeakMap,w=new WeakMap,X=new WeakMap,C=new WeakMap,H=new WeakMap,st=new WeakMap,et=new WeakMap,Mt=new WeakMap,Rt=new WeakMap,gt=new WeakSet,Jt=function(){window.addEventListener("focus",t(this,Ut)),window.addEventListener("blur",t(this,Nt))},Dt=new WeakSet,qt=function(){window.removeEventListener("focus",t(this,Ut)),window.removeEventListener("blur",t(this,Nt))},vt=new WeakSet,cl=function(){window.addEventListener("keydown",t(this,at),{capture:!0})},bl=new WeakSet,il=function(){window.removeEventListener("keydown",t(this,at),{capture:!0})},Bt=new WeakSet,Ft=function(){document.addEventListener("copy",t(this,Vt)),document.addEventListener("cut",t(this,Ht)),document.addEventListener("paste",t(this,Pt))},wt=new WeakSet,pt=function(){document.removeEventListener("copy",t(this,Vt)),document.removeEventListener("cut",t(this,Ht)),document.removeEventListener("paste",t(this,Pt))},Ct=new WeakSet,$t=function(nt){Object.entries(nt).some(L=>{let[ct,Wt]=L;return t(this,H)[ct]!==Wt})&&this._eventBus.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(t(this,H),nt)})},dl=new WeakSet,rl=function(nt){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:nt})},Yl=new WeakSet,Xl=function(){if(!t(this,It)){Zl(this,It,!0);for(const nt of t(this,g).values())nt.enable()}},pl=new WeakSet,Ll=function(){if(this.unselectAll(),t(this,It)){Zl(this,It,!1);for(const nt of t(this,g).values())nt.disable()}},yl=new WeakSet,Vl=function(nt){const L=t(this,g).get(nt.pageIndex);L?L.addOrRebuild(nt):this.addEditor(nt)},_t=new WeakSet,ot=function(){if(t(this,T).size===0)return!0;if(t(this,T).size===1)for(const nt of t(this,T).values())return nt.isEmpty();return!1},ut=new WeakSet,Tt=function(nt){t(this,zt).clear();for(const L of nt)L.isEmpty()||(t(this,zt).add(L),L.select());A(this,Ct,$t).call(this,{hasSelectedEditor:!0})},tt(Il,"TRANSLATE_SMALL",1),tt(Il,"TRANSLATE_BIG",10);let Wl=Il;r.AnnotationEditorUIManager=Wl},(lt,r,h)=>{var M=h(3),p=h(6),B=h(4),Q=h(24),U=h(14),O=h(8),I=h(21),j=h(20),q=h(91),K=h(39),f=h(77),S=h(64),k=h(159),T=h(7),g=h(167),F=h(27),J=B.JSON,v=B.Number,u=B.SyntaxError,m=J&&J.parse,_=Q("Object","keys"),$=Object.getOwnPropertyDescriptor,P=U("".charAt),Zt=U("".slice),dt=U(/./.exec),It=U([].push),xt=/^\d$/,it=/^[1-9]$/,Xt=/^(?:-|\d)$/,zt=/^[\t\n\r ]$/,Gt=0,Nt=1,Ut=function(X,C){X=f(X);var H=new at(X,0),st=H.parse(),et=st.value,Mt=H.skip(zt,st.end);if(Mt<X.length)throw u('Unexpected extra character: "'+P(X,Mt)+'" after the parsed data at: '+Mt);return I(C)?Vt({"":et},"",C,st):et},Vt=function(X,C,H,st){var et=X[C],Mt=st&&et===st.value,Rt=Mt&&typeof st.source=="string"?{source:st.source}:{},gt,Jt,Dt,qt,vt;if(j(et)){var cl=q(et),bl=Mt?st.nodes:cl?[]:{};if(cl)for(gt=bl.length,Dt=S(et),qt=0;qt<Dt;qt++)Ht(et,qt,Vt(et,""+qt,H,qt<gt?bl[qt]:void 0));else for(Jt=_(et),Dt=S(Jt),qt=0;qt<Dt;qt++)vt=Jt[qt],Ht(et,vt,Vt(et,vt,H,K(bl,vt)?bl[vt]:void 0))}return O(H,X,C,et,Rt)},Ht=function(X,C,H){if(p){var st=$(X,C);if(st&&!st.configurable)return}H===void 0?delete X[C]:k(X,C,H)},Pt=function(X,C,H,st){this.value=X,this.end=C,this.source=H,this.nodes=st},at=function(X,C){this.source=X,this.index=C};at.prototype={fork:function(X){return new at(this.source,X)},parse:function(){var X=this.source,C=this.skip(zt,this.index),H=this.fork(C),st=P(X,C);if(dt(Xt,st))return H.number();switch(st){case"{":return H.object();case"[":return H.array();case'"':return H.string();case"t":return H.keyword(!0);case"f":return H.keyword(!1);case"n":return H.keyword(null)}throw u('Unexpected character: "'+st+'" at: '+C)},node:function(X,C,H,st,et){return new Pt(C,st,X?null:Zt(this.source,H,st),et)},object:function(){for(var X=this.source,C=this.index+1,H=!1,st={},et={};C<X.length;){if(C=this.until(['"',"}"],C),P(X,C)==="}"&&!H){C++;break}var Mt=this.fork(C).string(),Rt=Mt.value;C=Mt.end,C=this.until([":"],C)+1,C=this.skip(zt,C),Mt=this.fork(C).parse(),k(et,Rt,Mt),k(st,Rt,Mt.value),C=this.until([",","}"],Mt.end);var gt=P(X,C);if(gt===",")H=!0,C++;else if(gt==="}"){C++;break}}return this.node(Nt,st,this.index,C,et)},array:function(){for(var X=this.source,C=this.index+1,H=!1,st=[],et=[];C<X.length;){if(C=this.skip(zt,C),P(X,C)==="]"&&!H){C++;break}var Mt=this.fork(C).parse();if(It(et,Mt),It(st,Mt.value),C=this.until([",","]"],Mt.end),P(X,C)===",")H=!0,C++;else if(P(X,C)==="]"){C++;break}}return this.node(Nt,st,this.index,C,et)},string:function(){var X=this.index,C=g(this.source,this.index+1);return this.node(Gt,C.value,X,C.end)},number:function(){var X=this.source,C=this.index,H=C;if(P(X,H)==="-"&&H++,P(X,H)==="0")H++;else if(dt(it,P(X,H)))H=this.skip(xt,++H);else throw u("Failed to parse number at: "+H);if(P(X,H)==="."&&(H=this.skip(xt,++H)),P(X,H)==="e"||P(X,H)==="E"){H++,(P(X,H)==="+"||P(X,H)==="-")&&H++;var st=H;if(H=this.skip(xt,H),st===H)throw u("Failed to parse number's exponent value at: "+H)}return this.node(Gt,v(Zt(X,C,H)),C,H)},keyword:function(X){var C=""+X,H=this.index,st=H+C.length;if(Zt(this.source,H,st)!==C)throw u("Failed to parse value at: "+H);return this.node(Gt,X,H,st)},skip:function(X,C){for(var H=this.source;C<H.length&&dt(X,P(H,C));C++);return C},until:function(X,C){C=this.skip(zt,C);for(var H=P(this.source,C),st=0;st<X.length;st++)if(X[st]===H)return C;throw u('Unexpected character: "'+H+'" at: '+C)}};var R=T(function(){var X="9007199254740993",C;return m(X,function(H,st,et){C=et.source}),C!==X}),w=F&&!T(function(){return 1/m("-0 ")!==-1/0});M({target:"JSON",stat:!0,forced:R},{parse:function(X,C){return w&&!I(C)?m(X):Ut(X,C)}})},(lt,r,h)=>{var M=h(14),p=h(39),B=SyntaxError,Q=parseInt,U=String.fromCharCode,O=M("".charAt),I=M("".slice),j=M(/./.exec),q={'\\"':'"',"\\\\":"\\","\\/":"/","\\b":"\b","\\f":"\f","\\n":`
|
|
9
9
|
`,"\\r":"\r","\\t":" "},K=/^[\da-f]{4}$/i,f=/^[\u0000-\u001F]$/;lt.exports=function(S,k){for(var T=!0,g="";k<S.length;){var F=O(S,k);if(F==="\\"){var J=I(S,k,k+2);if(p(q,J))g+=q[J],k+=2;else if(J==="\\u"){k+=2;var v=I(S,k,k+4);if(!j(K,v))throw B("Bad Unicode escape at: "+k);g+=U(Q(v,16)),k+=4}else throw B('Unknown escape sequence: "'+J+'"')}else if(F==='"'){T=!1,k++;break}else{if(j(f,F))throw B("Bad control character in string literal at: "+k);g+=F,k++}}if(T)throw B("Unterminated string at: "+k);return{value:g,end:k}}},(lt,r,h)=>{var M,p,B,Q,U,O,I,j,q,K,f,S,k,T,g,F,J,v,u,m,_,$,P,Zt,dt;Object.defineProperty(r,"__esModule",{value:!0}),r.StatTimer=r.RenderingCancelledException=r.PixelsPerInch=r.PageViewport=r.PDFDateString=r.DOMStandardFontDataFactory=r.DOMSVGFactory=r.DOMFilterFactory=r.DOMCanvasFactory=r.DOMCMapReaderFactory=void 0,r.deprecated=gt,r.getColorValues=cl,r.getCurrentTransform=bl,r.getCurrentTransformInverse=il,r.getFilenameFromUrl=C,r.getPdfFilenameFromUrl=H,r.getRGB=vt,r.getXfaPageViewport=qt,r.isDataScheme=w,r.isPdfFile=X,r.isValidFetchUrl=et,r.loadScript=Rt,r.noContextMenu=Mt,r.setLayerDimensions=Bt,h(2),h(93),h(101),h(102),h(105),h(107),h(109),h(113),h(116),h(123),h(89),h(84),h(86),h(87);var It=h(169),xt=h(1);const it="http://www.w3.org/2000/svg",Xt=class{};tt(Xt,"CSS",96),tt(Xt,"PDF",72),tt(Xt,"PDF_TO_CSS_UNITS",Xt.CSS/Xt.PDF);let zt=Xt;r.PixelsPerInch=zt;class Gt extends It.BaseFilterFactory{constructor(){let{docId:wt,ownerDocument:pt=globalThis.document}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};super(),E(this,S),E(this,T),E(this,F),E(this,v),E(this,m),E(this,$),E(this,Zt),E(this,M,void 0),E(this,p,void 0),E(this,B,void 0),E(this,Q,void 0),E(this,U,void 0),E(this,O,void 0),E(this,I,void 0),E(this,j,void 0),E(this,q,void 0),E(this,K,void 0),E(this,f,0),Zl(this,B,wt),Zl(this,Q,pt)}addFilter(wt){if(!wt)return"none";let pt=t(this,S,k).get(wt);if(pt)return pt;let Ct,$t,dl,rl;if(wt.length===1){const Ll=wt[0],yl=new Array(256);for(let Vl=0;Vl<256;Vl++)yl[Vl]=Ll[Vl]/255;rl=Ct=$t=dl=yl.join(",")}else{const[Ll,yl,Vl]=wt,_t=new Array(256),ot=new Array(256),ut=new Array(256);for(let Tt=0;Tt<256;Tt++)_t[Tt]=Ll[Tt]/255,ot[Tt]=yl[Tt]/255,ut[Tt]=Vl[Tt]/255;Ct=_t.join(","),$t=ot.join(","),dl=ut.join(","),rl=`${Ct}${$t}${dl}`}if(pt=t(this,S,k).get(rl),pt)return t(this,S,k).set(wt,pt),pt;const Yl=`g_${t(this,B)}_transfer_map_${mt(this,f)._++}`,Xl=`url(#${Yl})`;t(this,S,k).set(wt,Xl),t(this,S,k).set(rl,Xl);const pl=A(this,v,u).call(this,Yl);return A(this,$,P).call(this,Ct,$t,dl,pl),Xl}addHCMFilter(wt,pt){var Ct;const $t=`${wt}-${pt}`;if(t(this,O)===$t)return t(this,I);if(Zl(this,O,$t),Zl(this,I,"none"),(Ct=t(this,U))==null||Ct.remove(),!wt||!pt)return t(this,I);const dl=A(this,Zt,dt).call(this,wt);wt=xt.Util.makeHexColor(...dl);const rl=A(this,Zt,dt).call(this,pt);if(pt=xt.Util.makeHexColor(...rl),t(this,T,g).style.color="",wt==="#000000"&&pt==="#ffffff"||wt===pt)return t(this,I);const Yl=new Array(256);for(let Vl=0;Vl<=255;Vl++){const _t=Vl/255;Yl[Vl]=_t<=.03928?_t/12.92:((_t+.055)/1.055)**2.4}const Xl=Yl.join(","),pl=`g_${t(this,B)}_hcm_filter`,Ll=Zl(this,j,A(this,v,u).call(this,pl));A(this,$,P).call(this,Xl,Xl,Xl,Ll),A(this,F,J).call(this,Ll);const yl=(Vl,_t)=>{const ot=dl[Vl]/255,ut=rl[Vl]/255,Tt=new Array(_t+1);for(let jt=0;jt<=_t;jt++)Tt[jt]=ot+jt/_t*(ut-ot);return Tt.join(",")};return A(this,$,P).call(this,yl(0,5),yl(1,5),yl(2,5),Ll),Zl(this,I,`url(#${pl})`),t(this,I)}addHighlightHCMFilter(wt,pt,Ct,$t){var dl;const rl=`${wt}-${pt}-${Ct}-${$t}`;if(t(this,q)===rl)return t(this,K);if(Zl(this,q,rl),Zl(this,K,"none"),(dl=t(this,j))==null||dl.remove(),!wt||!pt)return t(this,K);const[Yl,Xl]=[wt,pt].map(A(this,Zt,dt).bind(this));let pl=Math.round(.2126*Yl[0]+.7152*Yl[1]+.0722*Yl[2]),Ll=Math.round(.2126*Xl[0]+.7152*Xl[1]+.0722*Xl[2]),[yl,Vl]=[Ct,$t].map(A(this,Zt,dt).bind(this));Ll<pl&&([pl,Ll,yl,Vl]=[Ll,pl,Vl,yl]),t(this,T,g).style.color="";const _t=(Tt,jt,Ot)=>{const Lt=new Array(256),yt=(Ll-pl)/Ot,Kt=Tt/255,tl=(jt-Tt)/(255*Ot);let el=0;for(let ol=0;ol<=Ot;ol++){const Qt=Math.round(pl+ol*yt),Ml=Kt+ol*tl;for(let hl=el;hl<=Qt;hl++)Lt[hl]=Ml;el=Qt+1}for(let ol=el;ol<256;ol++)Lt[ol]=Lt[el-1];return Lt.join(",")},ot=`g_${t(this,B)}_hcm_highlight_filter`,ut=Zl(this,j,A(this,v,u).call(this,ot));return A(this,F,J).call(this,ut),A(this,$,P).call(this,_t(yl[0],Vl[0],5),_t(yl[1],Vl[1],5),_t(yl[2],Vl[2],5),ut),Zl(this,K,`url(#${ot})`),t(this,K)}destroy(){arguments.length>0&&arguments[0]!==void 0&&arguments[0]&&(t(this,I)||t(this,K))||(t(this,p)&&(t(this,p).parentNode.parentNode.remove(),Zl(this,p,null)),t(this,M)&&(t(this,M).clear(),Zl(this,M,null)),Zl(this,f,0))}}M=new WeakMap,p=new WeakMap,B=new WeakMap,Q=new WeakMap,U=new WeakMap,O=new WeakMap,I=new WeakMap,j=new WeakMap,q=new WeakMap,K=new WeakMap,f=new WeakMap,S=new WeakSet,k=function(){return t(this,M)||Zl(this,M,new Map)},T=new WeakSet,g=function(){if(!t(this,p)){const Ft=t(this,Q).createElement("div"),{style:wt}=Ft;wt.visibility="hidden",wt.contain="strict",wt.width=wt.height=0,wt.position="absolute",wt.top=wt.left=0,wt.zIndex=-1;const pt=t(this,Q).createElementNS(it,"svg");pt.setAttribute("width",0),pt.setAttribute("height",0),Zl(this,p,t(this,Q).createElementNS(it,"defs")),Ft.append(pt),pt.append(t(this,p)),t(this,Q).body.append(Ft)}return t(this,p)},F=new WeakSet,J=function(Ft){const wt=t(this,Q).createElementNS(it,"feColorMatrix");wt.setAttribute("type","matrix"),wt.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"),Ft.append(wt)},v=new WeakSet,u=function(Ft){const wt=t(this,Q).createElementNS(it,"filter");return wt.setAttribute("color-interpolation-filters","sRGB"),wt.setAttribute("id",Ft),t(this,T,g).append(wt),wt},m=new WeakSet,_=function(Ft,wt,pt){const Ct=t(this,Q).createElementNS(it,wt);Ct.setAttribute("type","discrete"),Ct.setAttribute("tableValues",pt),Ft.append(Ct)},$=new WeakSet,P=function(Ft,wt,pt,Ct){const $t=t(this,Q).createElementNS(it,"feComponentTransfer");Ct.append($t),A(this,m,_).call(this,$t,"feFuncR",Ft),A(this,m,_).call(this,$t,"feFuncG",wt),A(this,m,_).call(this,$t,"feFuncB",pt)},Zt=new WeakSet,dt=function(Ft){return t(this,T,g).style.color=Ft,vt(getComputedStyle(t(this,T,g)).getPropertyValue("color"))},r.DOMFilterFactory=Gt;class Nt extends It.BaseCanvasFactory{constructor(){let{ownerDocument:wt=globalThis.document}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};super(),this._document=wt}_createCanvas(wt,pt){const Ct=this._document.createElement("canvas");return Ct.width=wt,Ct.height=pt,Ct}}r.DOMCanvasFactory=Nt;async function Ut(Ft){let wt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(et(Ft,document.baseURI)){const pt=await fetch(Ft);if(!pt.ok)throw new Error(pt.statusText);return wt?new Uint8Array(await pt.arrayBuffer()):(0,xt.stringToBytes)(await pt.text())}return new Promise((pt,Ct)=>{const $t=new XMLHttpRequest;$t.open("GET",Ft,!0),wt&&($t.responseType="arraybuffer"),$t.onreadystatechange=()=>{if($t.readyState===XMLHttpRequest.DONE){if($t.status===200||$t.status===0){let dl;if(wt&&$t.response?dl=new Uint8Array($t.response):!wt&&$t.responseText&&(dl=(0,xt.stringToBytes)($t.responseText)),dl){pt(dl);return}}Ct(new Error($t.statusText))}},$t.send(null)})}class Vt extends It.BaseCMapReaderFactory{_fetchData(wt,pt){return Ut(wt,this.isCompressed).then(Ct=>({cMapData:Ct,compressionType:pt}))}}r.DOMCMapReaderFactory=Vt;class Ht extends It.BaseStandardFontDataFactory{_fetchData(wt){return Ut(wt,!0)}}r.DOMStandardFontDataFactory=Ht;class Pt extends It.BaseSVGFactory{_createSVG(wt){return document.createElementNS(it,wt)}}r.DOMSVGFactory=Pt;class at{constructor(wt){let{viewBox:pt,scale:Ct,rotation:$t,offsetX:dl=0,offsetY:rl=0,dontFlip:Yl=!1}=wt;this.viewBox=pt,this.scale=Ct,this.rotation=$t,this.offsetX=dl,this.offsetY=rl;const Xl=(pt[2]+pt[0])/2,pl=(pt[3]+pt[1])/2;let Ll,yl,Vl,_t;switch($t%=360,$t<0&&($t+=360),$t){case 180:Ll=-1,yl=0,Vl=0,_t=1;break;case 90:Ll=0,yl=1,Vl=1,_t=0;break;case 270:Ll=0,yl=-1,Vl=-1,_t=0;break;case 0:Ll=1,yl=0,Vl=0,_t=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}Yl&&(Vl=-Vl,_t=-_t);let ot,ut,Tt,jt;Ll===0?(ot=Math.abs(pl-pt[1])*Ct+dl,ut=Math.abs(Xl-pt[0])*Ct+rl,Tt=(pt[3]-pt[1])*Ct,jt=(pt[2]-pt[0])*Ct):(ot=Math.abs(Xl-pt[0])*Ct+dl,ut=Math.abs(pl-pt[1])*Ct+rl,Tt=(pt[2]-pt[0])*Ct,jt=(pt[3]-pt[1])*Ct),this.transform=[Ll*Ct,yl*Ct,Vl*Ct,_t*Ct,ot-Ll*Ct*Xl-Vl*Ct*pl,ut-yl*Ct*Xl-_t*Ct*pl],this.width=Tt,this.height=jt}get rawDims(){const{viewBox:wt}=this;return(0,xt.shadow)(this,"rawDims",{pageWidth:wt[2]-wt[0],pageHeight:wt[3]-wt[1],pageX:wt[0],pageY:wt[1]})}clone(){let{scale:wt=this.scale,rotation:pt=this.rotation,offsetX:Ct=this.offsetX,offsetY:$t=this.offsetY,dontFlip:dl=!1}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return new at({viewBox:this.viewBox.slice(),scale:wt,rotation:pt,offsetX:Ct,offsetY:$t,dontFlip:dl})}convertToViewportPoint(wt,pt){return xt.Util.applyTransform([wt,pt],this.transform)}convertToViewportRectangle(wt){const pt=xt.Util.applyTransform([wt[0],wt[1]],this.transform),Ct=xt.Util.applyTransform([wt[2],wt[3]],this.transform);return[pt[0],pt[1],Ct[0],Ct[1]]}convertToPdfPoint(wt,pt){return xt.Util.applyInverseTransform([wt,pt],this.transform)}}r.PageViewport=at;class R extends xt.BaseException{constructor(wt){let pt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;super(wt,"RenderingCancelledException"),this.extraDelay=pt}}r.RenderingCancelledException=R;function w(Ft){const wt=Ft.length;let pt=0;for(;pt<wt&&Ft[pt].trim()==="";)pt++;return Ft.substring(pt,pt+5).toLowerCase()==="data:"}function X(Ft){return typeof Ft=="string"&&/\.pdf$/i.test(Ft)}function C(Ft){return arguments.length>1&&arguments[1]!==void 0&&arguments[1]||([Ft]=Ft.split(/[#?]/,1)),Ft.substring(Ft.lastIndexOf("/")+1)}function H(Ft){let wt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"document.pdf";if(typeof Ft!="string")return wt;if(w(Ft))return(0,xt.warn)('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),wt;const pt=/^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/,Ct=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i,$t=pt.exec(Ft);let dl=Ct.exec($t[1])||Ct.exec($t[2])||Ct.exec($t[3]);if(dl&&(dl=dl[0],dl.includes("%")))try{dl=Ct.exec(decodeURIComponent(dl))[0]}catch{}return dl||wt}class st{constructor(){tt(this,"started",Object.create(null)),tt(this,"times",[])}time(wt){wt in this.started&&(0,xt.warn)(`Timer is already running for ${wt}`),this.started[wt]=Date.now()}timeEnd(wt){wt in this.started||(0,xt.warn)(`Timer has not been started for ${wt}`),this.times.push({name:wt,start:this.started[wt],end:Date.now()}),delete this.started[wt]}toString(){const wt=[];let pt=0;for(const{name:Ct}of this.times)pt=Math.max(Ct.length,pt);for(const{name:Ct,start:$t,end:dl}of this.times)wt.push(`${Ct.padEnd(pt)} ${dl-$t}ms
|
|
10
10
|
`);return wt.join("")}}r.StatTimer=st;function et(Ft,wt){try{const{protocol:pt}=wt?new URL(Ft,wt):new URL(Ft);return pt==="http:"||pt==="https:"}catch{return!1}}function Mt(Ft){Ft.preventDefault()}function Rt(Ft){let wt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return new Promise((pt,Ct)=>{const $t=document.createElement("script");$t.src=Ft,$t.onload=function(dl){wt&&$t.remove(),pt(dl)},$t.onerror=function(){Ct(new Error(`Cannot load script at: ${$t.src}`))},(document.head||document.documentElement).append($t)})}function gt(Ft){console.log("Deprecated API usage: "+Ft)}let Jt;class Dt{static toDateObject(wt){if(!wt||typeof wt!="string")return null;Jt||(Jt=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"));const pt=Jt.exec(wt);if(!pt)return null;const Ct=parseInt(pt[1],10);let $t=parseInt(pt[2],10);$t=$t>=1&&$t<=12?$t-1:0;let dl=parseInt(pt[3],10);dl=dl>=1&&dl<=31?dl:1;let rl=parseInt(pt[4],10);rl=rl>=0&&rl<=23?rl:0;let Yl=parseInt(pt[5],10);Yl=Yl>=0&&Yl<=59?Yl:0;let Xl=parseInt(pt[6],10);Xl=Xl>=0&&Xl<=59?Xl:0;const pl=pt[7]||"Z";let Ll=parseInt(pt[8],10);Ll=Ll>=0&&Ll<=23?Ll:0;let yl=parseInt(pt[9],10)||0;return yl=yl>=0&&yl<=59?yl:0,pl==="-"?(rl+=Ll,Yl+=yl):pl==="+"&&(rl-=Ll,Yl-=yl),new Date(Date.UTC(Ct,$t,dl,rl,Yl,Xl))}}r.PDFDateString=Dt;function qt(Ft,wt){let{scale:pt=1,rotation:Ct=0}=wt;const{width:$t,height:dl}=Ft.attributes.style,rl=[0,0,parseInt($t),parseInt(dl)];return new at({viewBox:rl,scale:pt,rotation:Ct})}function vt(Ft){if(Ft.startsWith("#")){const wt=parseInt(Ft.slice(1),16);return[(wt&16711680)>>16,(wt&65280)>>8,wt&255]}return Ft.startsWith("rgb(")?Ft.slice(4,-1).split(",").map(wt=>parseInt(wt)):Ft.startsWith("rgba(")?Ft.slice(5,-1).split(",").map(wt=>parseInt(wt)).slice(0,3):((0,xt.warn)(`Not a valid color format: "${Ft}"`),[0,0,0])}function cl(Ft){const wt=document.createElement("span");wt.style.visibility="hidden",document.body.append(wt);for(const pt of Ft.keys()){wt.style.color=pt;const Ct=window.getComputedStyle(wt).color;Ft.set(pt,vt(Ct))}wt.remove()}function bl(Ft){const{a:wt,b:pt,c:Ct,d:$t,e:dl,f:rl}=Ft.getTransform();return[wt,pt,Ct,$t,dl,rl]}function il(Ft){const{a:wt,b:pt,c:Ct,d:$t,e:dl,f:rl}=Ft.getTransform().invertSelf();return[wt,pt,Ct,$t,dl,rl]}function Bt(Ft,wt){let pt=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,Ct=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0;if(wt instanceof at){const{pageWidth:$t,pageHeight:dl}=wt.rawDims,{style:rl}=Ft,Yl=xt.FeatureTest.isCSSRoundSupported,Xl=`var(--scale-factor) * ${$t}px`,pl=`var(--scale-factor) * ${dl}px`,Ll=Yl?`round(${Xl}, 1px)`:`calc(${Xl})`,yl=Yl?`round(${pl}, 1px)`:`calc(${pl})`;!pt||wt.rotation%180===0?(rl.width=Ll,rl.height=yl):(rl.width=yl,rl.height=Ll)}Ct&&Ft.setAttribute("data-main-rotation",wt.rotation)}},(lt,r,h)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BaseStandardFontDataFactory=r.BaseSVGFactory=r.BaseFilterFactory=r.BaseCanvasFactory=r.BaseCMapReaderFactory=void 0,h(2);var M=h(1);class p{constructor(){this.constructor===p&&(0,M.unreachable)("Cannot initialize BaseFilterFactory.")}addFilter(j){return"none"}addHCMFilter(j,q){return"none"}addHighlightHCMFilter(j,q,K,f){return"none"}destroy(){}}r.BaseFilterFactory=p;class B{constructor(){this.constructor===B&&(0,M.unreachable)("Cannot initialize BaseCanvasFactory.")}create(j,q){if(j<=0||q<=0)throw new Error("Invalid canvas size");const K=this._createCanvas(j,q);return{canvas:K,context:K.getContext("2d")}}reset(j,q,K){if(!j.canvas)throw new Error("Canvas is not specified");if(q<=0||K<=0)throw new Error("Invalid canvas size");j.canvas.width=q,j.canvas.height=K}destroy(j){if(!j.canvas)throw new Error("Canvas is not specified");j.canvas.width=0,j.canvas.height=0,j.canvas=null,j.context=null}_createCanvas(j,q){(0,M.unreachable)("Abstract method `_createCanvas` called.")}}r.BaseCanvasFactory=B;class Q{constructor(j){let{baseUrl:q=null,isCompressed:K=!0}=j;this.constructor===Q&&(0,M.unreachable)("Cannot initialize BaseCMapReaderFactory."),this.baseUrl=q,this.isCompressed=K}async fetch(j){let{name:q}=j;if(!this.baseUrl)throw new Error('The CMap "baseUrl" parameter must be specified, ensure that the "cMapUrl" and "cMapPacked" API parameters are provided.');if(!q)throw new Error("CMap name must be specified.");const K=this.baseUrl+q+(this.isCompressed?".bcmap":""),f=this.isCompressed?M.CMapCompressionType.BINARY:M.CMapCompressionType.NONE;return this._fetchData(K,f).catch(S=>{throw new Error(`Unable to load ${this.isCompressed?"binary ":""}CMap at: ${K}`)})}_fetchData(j,q){(0,M.unreachable)("Abstract method `_fetchData` called.")}}r.BaseCMapReaderFactory=Q;class U{constructor(j){let{baseUrl:q=null}=j;this.constructor===U&&(0,M.unreachable)("Cannot initialize BaseStandardFontDataFactory."),this.baseUrl=q}async fetch(j){let{filename:q}=j;if(!this.baseUrl)throw new Error('The standard font "baseUrl" parameter must be specified, ensure that the "standardFontDataUrl" API parameter is provided.');if(!q)throw new Error("Font filename must be specified.");const K=`${this.baseUrl}${q}`;return this._fetchData(K).catch(f=>{throw new Error(`Unable to load font data at: ${K}`)})}_fetchData(j){(0,M.unreachable)("Abstract method `_fetchData` called.")}}r.BaseStandardFontDataFactory=U;class O{constructor(){this.constructor===O&&(0,M.unreachable)("Cannot initialize BaseSVGFactory.")}create(j,q){let K=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(j<=0||q<=0)throw new Error("Invalid SVG dimensions");const f=this._createSVG("svg:svg");return f.setAttribute("version","1.1"),K||(f.setAttribute("width",`${j}px`),f.setAttribute("height",`${q}px`)),f.setAttribute("preserveAspectRatio","none"),f.setAttribute("viewBox",`0 0 ${j} ${q}`),f}createElement(j){if(typeof j!="string")throw new Error("Invalid SVG element type");return this._createSVG(j)}_createSVG(j){(0,M.unreachable)("Abstract method `_createSVG` called.")}}r.BaseSVGFactory=O},(lt,r,h)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.MurmurHash3_64=void 0,h(93),h(101),h(102),h(105),h(107),h(109),h(113),h(116),h(123),h(2);var M=h(1);const p=3285377520,B=4294901760,Q=65535;class U{constructor(I){this.h1=I?I&4294967295:p,this.h2=I?I&4294967295:p}update(I){let j,q;if(typeof I=="string"){j=new Uint8Array(I.length*2),q=0;for(let _=0,$=I.length;_<$;_++){const P=I.charCodeAt(_);P<=255?j[q++]=P:(j[q++]=P>>>8,j[q++]=P&255)}}else if((0,M.isArrayBuffer)(I))j=I.slice(),q=j.byteLength;else throw new Error("Wrong data format in MurmurHash3_64_update. Input must be a string or array.");const K=q>>2,f=q-K*4,S=new Uint32Array(j.buffer,0,K);let k=0,T=0,g=this.h1,F=this.h2;const J=3432918353,v=461845907,u=J&Q,m=v&Q;for(let _=0;_<K;_++)_&1?(k=S[_],k=k*J&B|k*u&Q,k=k<<15|k>>>17,k=k*v&B|k*m&Q,g^=k,g=g<<13|g>>>19,g=g*5+3864292196):(T=S[_],T=T*J&B|T*u&Q,T=T<<15|T>>>17,T=T*v&B|T*m&Q,F^=T,F=F<<13|F>>>19,F=F*5+3864292196);switch(k=0,f){case 3:k^=j[K*4+2]<<16;case 2:k^=j[K*4+1]<<8;case 1:k^=j[K*4],k=k*J&B|k*u&Q,k=k<<15|k>>>17,k=k*v&B|k*m&Q,K&1?g^=k:F^=k}this.h1=g,this.h2=F}hexdigest(){let I=this.h1,j=this.h2;return I^=j>>>1,I=I*3981806797&B|I*36045&Q,j=j*4283543511&B|((j<<16|I>>>16)*2950163797&B)>>>16,I^=j>>>1,I=I*444984403&B|I*60499&Q,j=j*3301882366&B|((j<<16|I>>>16)*3120437893&B)>>>16,I^=j>>>1,(I>>>0).toString(16).padStart(8,"0")+(j>>>0).toString(16).padStart(8,"0")}}r.MurmurHash3_64=U},(lt,r,h)=>{var M;Object.defineProperty(r,"__esModule",{value:!0}),r.FontLoader=r.FontFaceObject=void 0,h(125),h(136),h(138),h(141),h(143),h(145),h(147),h(89),h(149);var p=h(1);class B{constructor(O){E(this,M,new Set);let{ownerDocument:I=globalThis.document,styleElement:j=null}=O;this._document=I,this.nativeFontFaces=new Set,this.styleElement=null,this.loadingRequests=[],this.loadTestFontId=0}addNativeFontFace(O){this.nativeFontFaces.add(O),this._document.fonts.add(O)}removeNativeFontFace(O){this.nativeFontFaces.delete(O),this._document.fonts.delete(O)}insertRule(O){this.styleElement||(this.styleElement=this._document.createElement("style"),this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement));const I=this.styleElement.sheet;I.insertRule(O,I.cssRules.length)}clear(){for(const O of this.nativeFontFaces)this._document.fonts.delete(O);this.nativeFontFaces.clear(),t(this,M).clear(),this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async loadSystemFont(O){if(!(!O||t(this,M).has(O.loadedName))){if((0,p.assert)(!this.disableFontFace,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){const{loadedName:I,src:j,style:q}=O,K=new FontFace(I,j,q);this.addNativeFontFace(K);try{await K.load(),t(this,M).add(I)}catch{(0,p.warn)(`Cannot load system font: ${O.baseFontName}, installing it could help to improve PDF rendering.`),this.removeNativeFontFace(K)}return}(0,p.unreachable)("Not implemented: loadSystemFont without the Font Loading API.")}}async bind(O){if(O.attached||O.missingFile&&!O.systemFontInfo)return;if(O.attached=!0,O.systemFontInfo){await this.loadSystemFont(O.systemFontInfo);return}if(this.isFontLoadingAPISupported){const j=O.createNativeFontFace();if(j){this.addNativeFontFace(j);try{await j.loaded}catch(q){throw(0,p.warn)(`Failed to load font '${j.family}': '${q}'.`),O.disableFontFace=!0,q}}return}const I=O.createFontFaceRule();if(I){if(this.insertRule(I),this.isSyncFontLoadingSupported)return;await new Promise(j=>{const q=this._queueLoadingCallback(j);this._prepareFontLoadEvent(O,q)})}}get isFontLoadingAPISupported(){var O;const I=!!((O=this._document)!=null&&O.fonts);return(0,p.shadow)(this,"isFontLoadingAPISupported",I)}get isSyncFontLoadingSupported(){let O=!1;return(p.isNodeJS||typeof navigator<"u"&&/Mozilla\/5.0.*?rv:\d+.*? Gecko/.test(navigator.userAgent))&&(O=!0),(0,p.shadow)(this,"isSyncFontLoadingSupported",O)}_queueLoadingCallback(O){function I(){for((0,p.assert)(!q.done,"completeRequest() cannot be called twice."),q.done=!0;j.length>0&&j[0].done;){const K=j.shift();setTimeout(K.callback,0)}}const{loadingRequests:j}=this,q={done:!1,complete:I,callback:O};return j.push(q),q}get _loadTestFont(){const O=atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==");return(0,p.shadow)(this,"_loadTestFont",O)}_prepareFontLoadEvent(O,I){function j(Zt,dt){return Zt.charCodeAt(dt)<<24|Zt.charCodeAt(dt+1)<<16|Zt.charCodeAt(dt+2)<<8|Zt.charCodeAt(dt+3)&255}function q(Zt,dt,It,xt){const it=Zt.substring(0,dt),Xt=Zt.substring(dt+It);return it+xt+Xt}let K,f;const S=this._document.createElement("canvas");S.width=1,S.height=1;const k=S.getContext("2d");let T=0;function g(Zt,dt){if(++T>30){(0,p.warn)("Load test font never loaded."),dt();return}if(k.font="30px "+Zt,k.fillText(".",0,20),k.getImageData(0,0,1,1).data[3]>0){dt();return}setTimeout(g.bind(null,Zt,dt))}const F=`lt${Date.now()}${this.loadTestFontId++}`;let J=this._loadTestFont;J=q(J,976,F.length,F);const v=16,u=1482184792;let m=j(J,v);for(K=0,f=F.length-3;K<f;K+=4)m=m-u+j(F,K)|0;K<F.length&&(m=m-u+j(F+"XXX",K)|0),J=q(J,v,4,(0,p.string32)(m));const _=`url(data:font/opentype;base64,${btoa(J)});`,$=`@font-face {font-family:"${F}";src:${_}}`;this.insertRule($);const P=this._document.createElement("div");P.style.visibility="hidden",P.style.width=P.style.height="10px",P.style.position="absolute",P.style.top=P.style.left="0px";for(const Zt of[O.loadedName,F]){const dt=this._document.createElement("span");dt.textContent="Hi",dt.style.fontFamily=Zt,P.append(dt)}this._document.body.append(P),g(F,()=>{P.remove(),I.complete()})}}M=new WeakMap,r.FontLoader=B;class Q{constructor(O,I){let{isEvalSupported:j=!0,disableFontFace:q=!1,ignoreErrors:K=!1,inspectFont:f=null}=I;this.compiledGlyphs=Object.create(null);for(const S in O)this[S]=O[S];this.isEvalSupported=j!==!1,this.disableFontFace=q===!0,this.ignoreErrors=K===!0,this._inspectFont=f}createNativeFontFace(){var O;if(!this.data||this.disableFontFace)return null;let I;if(!this.cssFontInfo)I=new FontFace(this.loadedName,this.data,{});else{const j={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(j.style=`oblique ${this.cssFontInfo.italicAngle}deg`),I=new FontFace(this.cssFontInfo.fontFamily,this.data,j)}return(O=this._inspectFont)==null||O.call(this,this),I}createFontFaceRule(){var O;if(!this.data||this.disableFontFace)return null;const I=(0,p.bytesToString)(this.data),j=`url(data:${this.mimetype};base64,${btoa(I)});`;let q;if(!this.cssFontInfo)q=`@font-face {font-family:"${this.loadedName}";src:${j}}`;else{let K=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(K+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`),q=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${K}src:${j}}`}return(O=this._inspectFont)==null||O.call(this,this,j),q}getPathGenerator(O,I){if(this.compiledGlyphs[I]!==void 0)return this.compiledGlyphs[I];let j;try{j=O.get(this.loadedName+"_path_"+I)}catch(q){if(!this.ignoreErrors)throw q;return(0,p.warn)(`getPathGenerator - ignoring character: "${q}".`),this.compiledGlyphs[I]=function(K,f){}}if(this.isEvalSupported&&p.FeatureTest.isEvalSupported){const q=[];for(const K of j){const f=K.args!==void 0?K.args.join(","):"";q.push("c.",K.cmd,"(",f,`);
|
|
11
11
|
`)}return this.compiledGlyphs[I]=new Function("c","size",q.join(""))}return this.compiledGlyphs[I]=function(q,K){for(const f of j)f.cmd==="scale"&&(f.args=[K,-K]),q[f.cmd].apply(q,f.args)}}}r.FontFaceObject=Q},(lt,r,h)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.NodeStandardFontDataFactory=r.NodeFilterFactory=r.NodeCanvasFactory=r.NodeCMapReaderFactory=void 0,h(2),h(93),h(101),h(102),h(105),h(107),h(109),h(113),h(116),h(123);var M=h(169),p=h(1);(function(){if(!(globalThis.DOMMatrix||!p.isNodeJS))try{globalThis.DOMMatrix=require$$6.DOMMatrix}catch(j){(0,p.warn)(`Cannot polyfill \`DOMMatrix\`, rendering may be broken: "${j}".`)}})(),function(){if(!(globalThis.Path2D||!p.isNodeJS))try{const{CanvasRenderingContext2D:j}=require$$6,{polyfillPath2D:q}=requirePath2dPolyfill_esm();globalThis.CanvasRenderingContext2D=j,q(globalThis)}catch(j){(0,p.warn)(`Cannot polyfill \`Path2D\`, rendering may be broken: "${j}".`)}}();const B=function(j){return new Promise((q,K)=>{require$$6.readFile(j,(f,S)=>{if(f||!S){K(new Error(f));return}q(new Uint8Array(S))})})};class Q extends M.BaseFilterFactory{}r.NodeFilterFactory=Q;class U extends M.BaseCanvasFactory{_createCanvas(q,K){return require$$6.createCanvas(q,K)}}r.NodeCanvasFactory=U;class O extends M.BaseCMapReaderFactory{_fetchData(q,K){return B(q).then(f=>({cMapData:f,compressionType:K}))}}r.NodeCMapReaderFactory=O;class I extends M.BaseStandardFontDataFactory{_fetchData(q){return B(q)}}r.NodeStandardFontDataFactory=I},(lt,r,h)=>{var M,p,B,Q;Object.defineProperty(r,"__esModule",{value:!0}),r.CanvasGraphics=void 0,h(2),h(93),h(101),h(102),h(105),h(107),h(109),h(113),h(116),h(123),h(89);var U=h(1),O=h(168),I=h(174),j=h(175);const q=16,K=100,f=4096,S=15,k=10,T=1e3,g=16;function F(at,R){if(at._removeMirroring)throw new Error("Context is already forwarding operations.");at.__originalSave=at.save,at.__originalRestore=at.restore,at.__originalRotate=at.rotate,at.__originalScale=at.scale,at.__originalTranslate=at.translate,at.__originalTransform=at.transform,at.__originalSetTransform=at.setTransform,at.__originalResetTransform=at.resetTransform,at.__originalClip=at.clip,at.__originalMoveTo=at.moveTo,at.__originalLineTo=at.lineTo,at.__originalBezierCurveTo=at.bezierCurveTo,at.__originalRect=at.rect,at.__originalClosePath=at.closePath,at.__originalBeginPath=at.beginPath,at._removeMirroring=()=>{at.save=at.__originalSave,at.restore=at.__originalRestore,at.rotate=at.__originalRotate,at.scale=at.__originalScale,at.translate=at.__originalTranslate,at.transform=at.__originalTransform,at.setTransform=at.__originalSetTransform,at.resetTransform=at.__originalResetTransform,at.clip=at.__originalClip,at.moveTo=at.__originalMoveTo,at.lineTo=at.__originalLineTo,at.bezierCurveTo=at.__originalBezierCurveTo,at.rect=at.__originalRect,at.closePath=at.__originalClosePath,at.beginPath=at.__originalBeginPath,delete at._removeMirroring},at.save=function(){R.save(),this.__originalSave()},at.restore=function(){R.restore(),this.__originalRestore()},at.translate=function(w,X){R.translate(w,X),this.__originalTranslate(w,X)},at.scale=function(w,X){R.scale(w,X),this.__originalScale(w,X)},at.transform=function(w,X,C,H,st,et){R.transform(w,X,C,H,st,et),this.__originalTransform(w,X,C,H,st,et)},at.setTransform=function(w,X,C,H,st,et){R.setTransform(w,X,C,H,st,et),this.__originalSetTransform(w,X,C,H,st,et)},at.resetTransform=function(){R.resetTransform(),this.__originalResetTransform()},at.rotate=function(w){R.rotate(w),this.__originalRotate(w)},at.clip=function(w){R.clip(w),this.__originalClip(w)},at.moveTo=function(w,X){R.moveTo(w,X),this.__originalMoveTo(w,X)},at.lineTo=function(w,X){R.lineTo(w,X),this.__originalLineTo(w,X)},at.bezierCurveTo=function(w,X,C,H,st,et){R.bezierCurveTo(w,X,C,H,st,et),this.__originalBezierCurveTo(w,X,C,H,st,et)},at.rect=function(w,X,C,H){R.rect(w,X,C,H),this.__originalRect(w,X,C,H)},at.closePath=function(){R.closePath(),this.__originalClosePath()},at.beginPath=function(){R.beginPath(),this.__originalBeginPath()}}class J{constructor(R){this.canvasFactory=R,this.cache=Object.create(null)}getCanvas(R,w,X){let C;return this.cache[R]!==void 0?(C=this.cache[R],this.canvasFactory.reset(C,w,X)):(C=this.canvasFactory.create(w,X),this.cache[R]=C),C}delete(R){delete this.cache[R]}clear(){for(const R in this.cache){const w=this.cache[R];this.canvasFactory.destroy(w),delete this.cache[R]}}}function v(at,R,w,X,C,H,st,et,Mt,Rt){const[gt,Jt,Dt,qt,vt,cl]=(0,O.getCurrentTransform)(at);if(Jt===0&&Dt===0){const Bt=st*gt+vt,Ft=Math.round(Bt),wt=et*qt+cl,pt=Math.round(wt),Ct=(st+Mt)*gt+vt,$t=Math.abs(Math.round(Ct)-Ft)||1,dl=(et+Rt)*qt+cl,rl=Math.abs(Math.round(dl)-pt)||1;return at.setTransform(Math.sign(gt),0,0,Math.sign(qt),Ft,pt),at.drawImage(R,w,X,C,H,0,0,$t,rl),at.setTransform(gt,Jt,Dt,qt,vt,cl),[$t,rl]}if(gt===0&&qt===0){const Bt=et*Dt+vt,Ft=Math.round(Bt),wt=st*Jt+cl,pt=Math.round(wt),Ct=(et+Rt)*Dt+vt,$t=Math.abs(Math.round(Ct)-Ft)||1,dl=(st+Mt)*Jt+cl,rl=Math.abs(Math.round(dl)-pt)||1;return at.setTransform(0,Math.sign(Jt),Math.sign(Dt),0,Ft,pt),at.drawImage(R,w,X,C,H,0,0,rl,$t),at.setTransform(gt,Jt,Dt,qt,vt,cl),[rl,$t]}at.drawImage(R,w,X,C,H,st,et,Mt,Rt);const bl=Math.hypot(gt,Jt),il=Math.hypot(Dt,qt);return[bl*Mt,il*Rt]}function u(at){const{width:R,height:w}=at;if(R>T||w>T)return null;const X=1e3,C=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),H=R+1;let st=new Uint8Array(H*(w+1)),et,Mt,Rt;const gt=R+7&-8;let Jt=new Uint8Array(gt*w),Dt=0;for(const bl of at.data){let il=128;for(;il>0;)Jt[Dt++]=bl&il?0:255,il>>=1}let qt=0;for(Dt=0,Jt[Dt]!==0&&(st[0]=1,++qt),Mt=1;Mt<R;Mt++)Jt[Dt]!==Jt[Dt+1]&&(st[Mt]=Jt[Dt]?2:1,++qt),Dt++;for(Jt[Dt]!==0&&(st[Mt]=2,++qt),et=1;et<w;et++){Dt=et*gt,Rt=et*H,Jt[Dt-gt]!==Jt[Dt]&&(st[Rt]=Jt[Dt]?1:8,++qt);let bl=(Jt[Dt]?4:0)+(Jt[Dt-gt]?8:0);for(Mt=1;Mt<R;Mt++)bl=(bl>>2)+(Jt[Dt+1]?4:0)+(Jt[Dt-gt+1]?8:0),C[bl]&&(st[Rt+Mt]=C[bl],++qt),Dt++;if(Jt[Dt-gt]!==Jt[Dt]&&(st[Rt+Mt]=Jt[Dt]?2:4,++qt),qt>X)return null}for(Dt=gt*(w-1),Rt=et*H,Jt[Dt]!==0&&(st[Rt]=8,++qt),Mt=1;Mt<R;Mt++)Jt[Dt]!==Jt[Dt+1]&&(st[Rt+Mt]=Jt[Dt]?4:8,++qt),Dt++;if(Jt[Dt]!==0&&(st[Rt+Mt]=4,++qt),qt>X)return null;const vt=new Int32Array([0,H,-1,0,-H,0,0,0,1]),cl=new Path2D;for(et=0;qt&&et<=w;et++){let bl=et*H;const il=bl+R;for(;bl<il&&!st[bl];)bl++;if(bl===il)continue;cl.moveTo(bl%H,et);const Bt=bl;let Ft=st[bl];do{const wt=vt[Ft];do bl+=wt;while(!st[bl]);const pt=st[bl];pt!==5&&pt!==10?(Ft=pt,st[bl]=0):(Ft=pt&51*Ft>>4,st[bl]&=Ft>>2|Ft<<2),cl.lineTo(bl%H,bl/H|0),st[bl]||--qt}while(Bt!==bl);--et}return Jt=null,st=null,function(bl){bl.save(),bl.scale(1/R,-1/w),bl.translate(0,-w),bl.fill(cl),bl.beginPath(),bl.restore()}}class m{constructor(R,w){this.alphaIsShape=!1,this.fontSize=0,this.fontSizeScale=1,this.textMatrix=U.IDENTITY_MATRIX,this.textMatrixScale=1,this.fontMatrix=U.FONT_IDENTITY_MATRIX,this.leading=0,this.x=0,this.y=0,this.lineX=0,this.lineY=0,this.charSpacing=0,this.wordSpacing=0,this.textHScale=1,this.textRenderingMode=U.TextRenderingMode.FILL,this.textRise=0,this.fillColor="#000000",this.strokeColor="#000000",this.patternFill=!1,this.fillAlpha=1,this.strokeAlpha=1,this.lineWidth=1,this.activeSMask=null,this.transferMaps="none",this.startNewPathAndClipBox([0,0,R,w])}clone(){const R=Object.create(this);return R.clipBox=this.clipBox.slice(),R}setCurrentPoint(R,w){this.x=R,this.y=w}updatePathMinMax(R,w,X){[w,X]=U.Util.applyTransform([w,X],R),this.minX=Math.min(this.minX,w),this.minY=Math.min(this.minY,X),this.maxX=Math.max(this.maxX,w),this.maxY=Math.max(this.maxY,X)}updateRectMinMax(R,w){const X=U.Util.applyTransform(w,R),C=U.Util.applyTransform(w.slice(2),R);this.minX=Math.min(this.minX,X[0],C[0]),this.minY=Math.min(this.minY,X[1],C[1]),this.maxX=Math.max(this.maxX,X[0],C[0]),this.maxY=Math.max(this.maxY,X[1],C[1])}updateScalingPathMinMax(R,w){U.Util.scaleMinMax(R,w),this.minX=Math.min(this.minX,w[0]),this.maxX=Math.max(this.maxX,w[1]),this.minY=Math.min(this.minY,w[2]),this.maxY=Math.max(this.maxY,w[3])}updateCurvePathMinMax(R,w,X,C,H,st,et,Mt,Rt,gt){const Jt=U.Util.bezierBoundingBox(w,X,C,H,st,et,Mt,Rt);if(gt){gt[0]=Math.min(gt[0],Jt[0],Jt[2]),gt[1]=Math.max(gt[1],Jt[0],Jt[2]),gt[2]=Math.min(gt[2],Jt[1],Jt[3]),gt[3]=Math.max(gt[3],Jt[1],Jt[3]);return}this.updateRectMinMax(R,Jt)}getPathBoundingBox(){let R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:I.PathType.FILL,w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;const X=[this.minX,this.minY,this.maxX,this.maxY];if(R===I.PathType.STROKE){w||(0,U.unreachable)("Stroke bounding box must include transform.");const C=U.Util.singularValueDecompose2dScale(w),H=C[0]*this.lineWidth/2,st=C[1]*this.lineWidth/2;X[0]-=H,X[1]-=st,X[2]+=H,X[3]+=st}return X}updateClipFromPath(){const R=U.Util.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(R||[0,0,0,0])}isEmptyClip(){return this.minX===1/0}startNewPathAndClipBox(R){this.clipBox=R,this.minX=1/0,this.minY=1/0,this.maxX=0,this.maxY=0}getClippedPathBoundingBox(){let R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:I.PathType.FILL,w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return U.Util.intersect(this.clipBox,this.getPathBoundingBox(R,w))}}function _(at,R){if(typeof ImageData<"u"&&R instanceof ImageData){at.putImageData(R,0,0);return}const w=R.height,X=R.width,C=w%g,H=(w-C)/g,st=C===0?H:H+1,et=at.createImageData(X,g);let Mt=0,Rt;const gt=R.data,Jt=et.data;let Dt,qt,vt,cl;if(R.kind===U.ImageKind.GRAYSCALE_1BPP){const bl=gt.byteLength,il=new Uint32Array(Jt.buffer,0,Jt.byteLength>>2),Bt=il.length,Ft=X+7>>3,wt=4294967295,pt=U.FeatureTest.isLittleEndian?4278190080:255;for(Dt=0;Dt<st;Dt++){for(vt=Dt<H?g:C,Rt=0,qt=0;qt<vt;qt++){const Ct=bl-Mt;let $t=0;const dl=Ct>Ft?X:Ct*8-7,rl=dl&-8;let Yl=0,Xl=0;for(;$t<rl;$t+=8)Xl=gt[Mt++],il[Rt++]=Xl&128?wt:pt,il[Rt++]=Xl&64?wt:pt,il[Rt++]=Xl&32?wt:pt,il[Rt++]=Xl&16?wt:pt,il[Rt++]=Xl&8?wt:pt,il[Rt++]=Xl&4?wt:pt,il[Rt++]=Xl&2?wt:pt,il[Rt++]=Xl&1?wt:pt;for(;$t<dl;$t++)Yl===0&&(Xl=gt[Mt++],Yl=128),il[Rt++]=Xl&Yl?wt:pt,Yl>>=1}for(;Rt<Bt;)il[Rt++]=0;at.putImageData(et,0,Dt*g)}}else if(R.kind===U.ImageKind.RGBA_32BPP){for(qt=0,cl=X*g*4,Dt=0;Dt<H;Dt++)Jt.set(gt.subarray(Mt,Mt+cl)),Mt+=cl,at.putImageData(et,0,qt),qt+=g;Dt<st&&(cl=X*C*4,Jt.set(gt.subarray(Mt,Mt+cl)),at.putImageData(et,0,qt))}else if(R.kind===U.ImageKind.RGB_24BPP)for(vt=g,cl=X*vt,Dt=0;Dt<st;Dt++){for(Dt>=H&&(vt=C,cl=X*vt),Rt=0,qt=cl;qt--;)Jt[Rt++]=gt[Mt++],Jt[Rt++]=gt[Mt++],Jt[Rt++]=gt[Mt++],Jt[Rt++]=255;at.putImageData(et,0,Dt*g)}else throw new Error(`bad image kind: ${R.kind}`)}function $(at,R){if(R.bitmap){at.drawImage(R.bitmap,0,0);return}const w=R.height,X=R.width,C=w%g,H=(w-C)/g,st=C===0?H:H+1,et=at.createImageData(X,g);let Mt=0;const Rt=R.data,gt=et.data;for(let Jt=0;Jt<st;Jt++){const Dt=Jt<H?g:C;({srcPos:Mt}=(0,j.convertBlackAndWhiteToRGBA)({src:Rt,srcPos:Mt,dest:gt,width:X,height:Dt,nonBlackColor:0})),at.putImageData(et,0,Jt*g)}}function P(at,R){const w=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font","filter"];for(const X of w)at[X]!==void 0&&(R[X]=at[X]);at.setLineDash!==void 0&&(R.setLineDash(at.getLineDash()),R.lineDashOffset=at.lineDashOffset)}function Zt(at){if(at.strokeStyle=at.fillStyle="#000000",at.fillRule="nonzero",at.globalAlpha=1,at.lineWidth=1,at.lineCap="butt",at.lineJoin="miter",at.miterLimit=10,at.globalCompositeOperation="source-over",at.font="10px sans-serif",at.setLineDash!==void 0&&(at.setLineDash([]),at.lineDashOffset=0),!U.isNodeJS){const{filter:R}=at;R!=="none"&&R!==""&&(at.filter="none")}}function dt(at,R,w,X){const C=at.length;for(let H=3;H<C;H+=4){const st=at[H];if(st===0)at[H-3]=R,at[H-2]=w,at[H-1]=X;else if(st<255){const et=255-st;at[H-3]=at[H-3]*st+R*et>>8,at[H-2]=at[H-2]*st+w*et>>8,at[H-1]=at[H-1]*st+X*et>>8}}}function It(at,R,w){const X=at.length,C=1/255;for(let H=3;H<X;H+=4){const st=w?w[at[H]]:at[H];R[H]=R[H]*st*C|0}}function xt(at,R,w){const X=at.length;for(let C=3;C<X;C+=4){const H=at[C-3]*77+at[C-2]*152+at[C-1]*28;R[C]=w?R[C]*w[H>>8]>>8:R[C]*H>>16}}function it(at,R,w,X,C,H,st,et,Mt,Rt,gt){const Jt=!!H,Dt=Jt?H[0]:0,qt=Jt?H[1]:0,vt=Jt?H[2]:0,cl=C==="Luminosity"?xt:It,bl=Math.min(X,Math.ceil(1048576/w));for(let il=0;il<X;il+=bl){const Bt=Math.min(bl,X-il),Ft=at.getImageData(et-Rt,il+(Mt-gt),w,Bt),wt=R.getImageData(et,il+Mt,w,Bt);Jt&&dt(Ft.data,Dt,qt,vt),cl(Ft.data,wt.data,st),R.putImageData(wt,et,il+Mt)}}function Xt(at,R,w,X){const C=X[0],H=X[1],st=X[2]-C,et=X[3]-H;st===0||et===0||(it(R.context,w,st,et,R.subtype,R.backdrop,R.transferMap,C,H,R.offsetX,R.offsetY),at.save(),at.globalAlpha=1,at.globalCompositeOperation="source-over",at.setTransform(1,0,0,1,0,0),at.drawImage(w.canvas,0,0),at.restore())}function zt(at,R){const w=U.Util.singularValueDecompose2dScale(at);w[0]=Math.fround(w[0]),w[1]=Math.fround(w[1]);const X=Math.fround((globalThis.devicePixelRatio||1)*O.PixelsPerInch.PDF_TO_CSS_UNITS);return R!==void 0?R:w[0]<=X||w[1]<=X}const Gt=["butt","round","square"],Nt=["miter","round","bevel"],Ut={},Vt={},Ht=class Js{constructor(R,w,X,C,H,st,et,Mt){E(this,M),E(this,B);let{optionalContentConfig:Rt,markedContentStack:gt=null}=st;this.ctx=R,this.current=new m(this.ctx.canvas.width,this.ctx.canvas.height),this.stateStack=[],this.pendingClip=null,this.pendingEOFill=!1,this.res=null,this.xobjs=null,this.commonObjs=w,this.objs=X,this.canvasFactory=C,this.filterFactory=H,this.groupStack=[],this.processingType3=null,this.baseTransform=null,this.baseTransformStack=[],this.groupLevel=0,this.smaskStack=[],this.smaskCounter=0,this.tempSMask=null,this.suspendedCtx=null,this.contentVisible=!0,this.markedContentStack=gt||[],this.optionalContentConfig=Rt,this.cachedCanvases=new J(this.canvasFactory),this.cachedPatterns=new Map,this.annotationCanvasMap=et,this.viewportScale=1,this.outputScaleX=1,this.outputScaleY=1,this.pageColors=Mt,this._cachedScaleForStroking=[-1,0],this._cachedGetSinglePixelWidth=null,this._cachedBitmapsMap=new Map}getObject(R){let w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return typeof R=="string"?R.startsWith("g_")?this.commonObjs.get(R):this.objs.get(R):w}beginDrawing(R){let{transform:w,viewport:X,transparency:C=!1,background:H=null}=R;const st=this.ctx.canvas.width,et=this.ctx.canvas.height,Mt=this.ctx.fillStyle;if(this.ctx.fillStyle=H||"#ffffff",this.ctx.fillRect(0,0,st,et),this.ctx.fillStyle=Mt,C){const Rt=this.cachedCanvases.getCanvas("transparent",st,et);this.compositeCtx=this.ctx,this.transparentCanvas=Rt.canvas,this.ctx=Rt.context,this.ctx.save(),this.ctx.transform(...(0,O.getCurrentTransform)(this.compositeCtx))}this.ctx.save(),Zt(this.ctx),w&&(this.ctx.transform(...w),this.outputScaleX=w[0],this.outputScaleY=w[0]),this.ctx.transform(...X.transform),this.viewportScale=X.scale,this.baseTransform=(0,O.getCurrentTransform)(this.ctx)}executeOperatorList(R,w,X,C){const H=R.argsArray,st=R.fnArray;let et=w||0;const Mt=H.length;if(Mt===et)return et;const Rt=Mt-et>k&&typeof X=="function",gt=Rt?Date.now()+S:0;let Jt=0;const Dt=this.commonObjs,qt=this.objs;let vt;for(;;){if(C!==void 0&&et===C.nextBreakPoint)return C.breakIt(et,X),et;if(vt=st[et],vt!==U.OPS.dependency)this[vt].apply(this,H[et]);else for(const cl of H[et]){const bl=cl.startsWith("g_")?Dt:qt;if(!bl.has(cl))return bl.get(cl,X),et}if(et++,et===Mt)return et;if(Rt&&++Jt>k){if(Date.now()>gt)return X(),et;Jt=0}}}endDrawing(){A(this,M,p).call(this),this.cachedCanvases.clear(),this.cachedPatterns.clear();for(const R of this._cachedBitmapsMap.values()){for(const w of R.values())typeof HTMLCanvasElement<"u"&&w instanceof HTMLCanvasElement&&(w.width=w.height=0);R.clear()}this._cachedBitmapsMap.clear(),A(this,B,Q).call(this)}_scaleImage(R,w){const X=R.width,C=R.height;let H=Math.max(Math.hypot(w[0],w[1]),1),st=Math.max(Math.hypot(w[2],w[3]),1),et=X,Mt=C,Rt="prescale1",gt,Jt;for(;H>2&&et>1||st>2&&Mt>1;){let Dt=et,qt=Mt;H>2&&et>1&&(Dt=et>=16384?Math.floor(et/2)-1||1:Math.ceil(et/2),H/=et/Dt),st>2&&Mt>1&&(qt=Mt>=16384?Math.floor(Mt/2)-1||1:Math.ceil(Mt)/2,st/=Mt/qt),gt=this.cachedCanvases.getCanvas(Rt,Dt,qt),Jt=gt.context,Jt.clearRect(0,0,Dt,qt),Jt.drawImage(R,0,0,et,Mt,0,0,Dt,qt),R=gt.canvas,et=Dt,Mt=qt,Rt=Rt==="prescale1"?"prescale2":"prescale1"}return{img:R,paintWidth:et,paintHeight:Mt}}_createMaskCanvas(R){const w=this.ctx,{width:X,height:C}=R,H=this.current.fillColor,st=this.current.patternFill,et=(0,O.getCurrentTransform)(w);let Mt,Rt,gt,Jt;if((R.bitmap||R.data)&&R.count>1){const $t=R.bitmap||R.data.buffer;Rt=JSON.stringify(st?et:[et.slice(0,4),H]),Mt=this._cachedBitmapsMap.get($t),Mt||(Mt=new Map,this._cachedBitmapsMap.set($t,Mt));const dl=Mt.get(Rt);if(dl&&!st){const rl=Math.round(Math.min(et[0],et[2])+et[4]),Yl=Math.round(Math.min(et[1],et[3])+et[5]);return{canvas:dl,offsetX:rl,offsetY:Yl}}gt=dl}gt||(Jt=this.cachedCanvases.getCanvas("maskCanvas",X,C),$(Jt.context,R));let Dt=U.Util.transform(et,[1/X,0,0,-1/C,0,0]);Dt=U.Util.transform(Dt,[1,0,0,1,0,-C]);const qt=U.Util.applyTransform([0,0],Dt),vt=U.Util.applyTransform([X,C],Dt),cl=U.Util.normalizeRect([qt[0],qt[1],vt[0],vt[1]]),bl=Math.round(cl[2]-cl[0])||1,il=Math.round(cl[3]-cl[1])||1,Bt=this.cachedCanvases.getCanvas("fillCanvas",bl,il),Ft=Bt.context,wt=Math.min(qt[0],vt[0]),pt=Math.min(qt[1],vt[1]);Ft.translate(-wt,-pt),Ft.transform(...Dt),gt||(gt=this._scaleImage(Jt.canvas,(0,O.getCurrentTransformInverse)(Ft)),gt=gt.img,Mt&&st&&Mt.set(Rt,gt)),Ft.imageSmoothingEnabled=zt((0,O.getCurrentTransform)(Ft),R.interpolate),v(Ft,gt,0,0,gt.width,gt.height,0,0,X,C),Ft.globalCompositeOperation="source-in";const Ct=U.Util.transform((0,O.getCurrentTransformInverse)(Ft),[1,0,0,1,-wt,-pt]);return Ft.fillStyle=st?H.getPattern(w,this,Ct,I.PathType.FILL):H,Ft.fillRect(0,0,X,C),Mt&&!st&&(this.cachedCanvases.delete("fillCanvas"),Mt.set(Rt,Bt.canvas)),{canvas:Bt.canvas,offsetX:Math.round(wt),offsetY:Math.round(pt)}}setLineWidth(R){R!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1),this.current.lineWidth=R,this.ctx.lineWidth=R}setLineCap(R){this.ctx.lineCap=Gt[R]}setLineJoin(R){this.ctx.lineJoin=Nt[R]}setMiterLimit(R){this.ctx.miterLimit=R}setDash(R,w){const X=this.ctx;X.setLineDash!==void 0&&(X.setLineDash(R),X.lineDashOffset=w)}setRenderingIntent(R){}setFlatness(R){}setGState(R){for(const[w,X]of R)switch(w){case"LW":this.setLineWidth(X);break;case"LC":this.setLineCap(X);break;case"LJ":this.setLineJoin(X);break;case"ML":this.setMiterLimit(X);break;case"D":this.setDash(X[0],X[1]);break;case"RI":this.setRenderingIntent(X);break;case"FL":this.setFlatness(X);break;case"Font":this.setFont(X[0],X[1]);break;case"CA":this.current.strokeAlpha=X;break;case"ca":this.current.fillAlpha=X,this.ctx.globalAlpha=X;break;case"BM":this.ctx.globalCompositeOperation=X;break;case"SMask":this.current.activeSMask=X?this.tempSMask:null,this.tempSMask=null,this.checkSMaskState();break;case"TR":this.ctx.filter=this.current.transferMaps=this.filterFactory.addFilter(X);break}}get inSMaskMode(){return!!this.suspendedCtx}checkSMaskState(){const R=this.inSMaskMode;this.current.activeSMask&&!R?this.beginSMaskMode():!this.current.activeSMask&&R&&this.endSMaskMode()}beginSMaskMode(){if(this.inSMaskMode)throw new Error("beginSMaskMode called while already in smask mode");const R=this.ctx.canvas.width,w=this.ctx.canvas.height,X="smaskGroupAt"+this.groupLevel,C=this.cachedCanvases.getCanvas(X,R,w);this.suspendedCtx=this.ctx,this.ctx=C.context;const H=this.ctx;H.setTransform(...(0,O.getCurrentTransform)(this.suspendedCtx)),P(this.suspendedCtx,H),F(H,this.suspendedCtx),this.setGState([["BM","source-over"],["ca",1],["CA",1]])}endSMaskMode(){if(!this.inSMaskMode)throw new Error("endSMaskMode called while not in smask mode");this.ctx._removeMirroring(),P(this.ctx,this.suspendedCtx),this.ctx=this.suspendedCtx,this.suspendedCtx=null}compose(R){if(!this.current.activeSMask)return;R?(R[0]=Math.floor(R[0]),R[1]=Math.floor(R[1]),R[2]=Math.ceil(R[2]),R[3]=Math.ceil(R[3])):R=[0,0,this.ctx.canvas.width,this.ctx.canvas.height];const w=this.current.activeSMask,X=this.suspendedCtx;Xt(X,w,this.ctx,R),this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.clearRect(0,0,this.ctx.canvas.width,this.ctx.canvas.height),this.ctx.restore()}save(){this.inSMaskMode?(P(this.ctx,this.suspendedCtx),this.suspendedCtx.save()):this.ctx.save();const R=this.current;this.stateStack.push(R),this.current=R.clone()}restore(){this.stateStack.length===0&&this.inSMaskMode&&this.endSMaskMode(),this.stateStack.length!==0&&(this.current=this.stateStack.pop(),this.inSMaskMode?(this.suspendedCtx.restore(),P(this.suspendedCtx,this.ctx)):this.ctx.restore(),this.checkSMaskState(),this.pendingClip=null,this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null)}transform(R,w,X,C,H,st){this.ctx.transform(R,w,X,C,H,st),this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}constructPath(R,w,X){const C=this.ctx,H=this.current;let st=H.x,et=H.y,Mt,Rt;const gt=(0,O.getCurrentTransform)(C),Jt=gt[0]===0&>[3]===0||gt[1]===0&>[2]===0,Dt=Jt?X.slice(0):null;for(let qt=0,vt=0,cl=R.length;qt<cl;qt++)switch(R[qt]|0){case U.OPS.rectangle:st=w[vt++],et=w[vt++];const bl=w[vt++],il=w[vt++],Bt=st+bl,Ft=et+il;C.moveTo(st,et),bl===0||il===0?C.lineTo(Bt,Ft):(C.lineTo(Bt,et),C.lineTo(Bt,Ft),C.lineTo(st,Ft)),Jt||H.updateRectMinMax(gt,[st,et,Bt,Ft]),C.closePath();break;case U.OPS.moveTo:st=w[vt++],et=w[vt++],C.moveTo(st,et),Jt||H.updatePathMinMax(gt,st,et);break;case U.OPS.lineTo:st=w[vt++],et=w[vt++],C.lineTo(st,et),Jt||H.updatePathMinMax(gt,st,et);break;case U.OPS.curveTo:Mt=st,Rt=et,st=w[vt+4],et=w[vt+5],C.bezierCurveTo(w[vt],w[vt+1],w[vt+2],w[vt+3],st,et),H.updateCurvePathMinMax(gt,Mt,Rt,w[vt],w[vt+1],w[vt+2],w[vt+3],st,et,Dt),vt+=6;break;case U.OPS.curveTo2:Mt=st,Rt=et,C.bezierCurveTo(st,et,w[vt],w[vt+1],w[vt+2],w[vt+3]),H.updateCurvePathMinMax(gt,Mt,Rt,st,et,w[vt],w[vt+1],w[vt+2],w[vt+3],Dt),st=w[vt+2],et=w[vt+3],vt+=4;break;case U.OPS.curveTo3:Mt=st,Rt=et,st=w[vt+2],et=w[vt+3],C.bezierCurveTo(w[vt],w[vt+1],st,et,st,et),H.updateCurvePathMinMax(gt,Mt,Rt,w[vt],w[vt+1],st,et,st,et,Dt),vt+=4;break;case U.OPS.closePath:C.closePath();break}Jt&&H.updateScalingPathMinMax(gt,Dt),H.setCurrentPoint(st,et)}closePath(){this.ctx.closePath()}stroke(){let R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;const w=this.ctx,X=this.current.strokeColor;w.globalAlpha=this.current.strokeAlpha,this.contentVisible&&(typeof X=="object"&&X!=null&&X.getPattern?(w.save(),w.strokeStyle=X.getPattern(w,this,(0,O.getCurrentTransformInverse)(w),I.PathType.STROKE),this.rescaleAndStroke(!1),w.restore()):this.rescaleAndStroke(!0)),R&&this.consumePath(this.current.getClippedPathBoundingBox()),w.globalAlpha=this.current.fillAlpha}closeStroke(){this.closePath(),this.stroke()}fill(){let R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;const w=this.ctx,X=this.current.fillColor,C=this.current.patternFill;let H=!1;C&&(w.save(),w.fillStyle=X.getPattern(w,this,(0,O.getCurrentTransformInverse)(w),I.PathType.FILL),H=!0);const st=this.current.getClippedPathBoundingBox();this.contentVisible&&st!==null&&(this.pendingEOFill?(w.fill("evenodd"),this.pendingEOFill=!1):w.fill()),H&&w.restore(),R&&this.consumePath(st)}eoFill(){this.pendingEOFill=!0,this.fill()}fillStroke(){this.fill(!1),this.stroke(!1),this.consumePath()}eoFillStroke(){this.pendingEOFill=!0,this.fillStroke()}closeFillStroke(){this.closePath(),this.fillStroke()}closeEOFillStroke(){this.pendingEOFill=!0,this.closePath(),this.fillStroke()}endPath(){this.consumePath()}clip(){this.pendingClip=Ut}eoClip(){this.pendingClip=Vt}beginText(){this.current.textMatrix=U.IDENTITY_MATRIX,this.current.textMatrixScale=1,this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}endText(){const R=this.pendingTextPaths,w=this.ctx;if(R===void 0){w.beginPath();return}w.save(),w.beginPath();for(const X of R)w.setTransform(...X.transform),w.translate(X.x,X.y),X.addToPath(w,X.fontSize);w.restore(),w.clip(),w.beginPath(),delete this.pendingTextPaths}setCharSpacing(R){this.current.charSpacing=R}setWordSpacing(R){this.current.wordSpacing=R}setHScale(R){this.current.textHScale=R/100}setLeading(R){this.current.leading=-R}setFont(R,w){var X;const C=this.commonObjs.get(R),H=this.current;if(!C)throw new Error(`Can't find font for ${R}`);if(H.fontMatrix=C.fontMatrix||U.FONT_IDENTITY_MATRIX,(H.fontMatrix[0]===0||H.fontMatrix[3]===0)&&(0,U.warn)("Invalid font matrix for font "+R),w<0?(w=-w,H.fontDirection=-1):H.fontDirection=1,this.current.font=C,this.current.fontSize=w,C.isType3Font)return;const st=C.loadedName||"sans-serif",et=((X=C.systemFontInfo)==null?void 0:X.css)||`"${st}", ${C.fallbackName}`;let Mt="normal";C.black?Mt="900":C.bold&&(Mt="bold");const Rt=C.italic?"italic":"normal";let gt=w;w<q?gt=q:w>K&&(gt=K),this.current.fontSizeScale=w/gt,this.ctx.font=`${Rt} ${Mt} ${gt}px ${et}`}setTextRenderingMode(R){this.current.textRenderingMode=R}setTextRise(R){this.current.textRise=R}moveText(R,w){this.current.x=this.current.lineX+=R,this.current.y=this.current.lineY+=w}setLeadingMoveText(R,w){this.setLeading(-w),this.moveText(R,w)}setTextMatrix(R,w,X,C,H,st){this.current.textMatrix=[R,w,X,C,H,st],this.current.textMatrixScale=Math.hypot(R,w),this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}nextLine(){this.moveText(0,this.current.leading)}paintChar(R,w,X,C){const H=this.ctx,st=this.current,et=st.font,Mt=st.textRenderingMode,Rt=st.fontSize/st.fontSizeScale,gt=Mt&U.TextRenderingMode.FILL_STROKE_MASK,Jt=!!(Mt&U.TextRenderingMode.ADD_TO_PATH_FLAG),Dt=st.patternFill&&!et.missingFile;let qt;(et.disableFontFace||Jt||Dt)&&(qt=et.getPathGenerator(this.commonObjs,R)),et.disableFontFace||Dt?(H.save(),H.translate(w,X),H.beginPath(),qt(H,Rt),C&&H.setTransform(...C),(gt===U.TextRenderingMode.FILL||gt===U.TextRenderingMode.FILL_STROKE)&&H.fill(),(gt===U.TextRenderingMode.STROKE||gt===U.TextRenderingMode.FILL_STROKE)&&H.stroke(),H.restore()):((gt===U.TextRenderingMode.FILL||gt===U.TextRenderingMode.FILL_STROKE)&&H.fillText(R,w,X),(gt===U.TextRenderingMode.STROKE||gt===U.TextRenderingMode.FILL_STROKE)&&H.strokeText(R,w,X)),Jt&&(this.pendingTextPaths||(this.pendingTextPaths=[])).push({transform:(0,O.getCurrentTransform)(H),x:w,y:X,fontSize:Rt,addToPath:qt})}get isFontSubpixelAAEnabled(){const{context:R}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10);R.scale(1.5,1),R.fillText("I",0,10);const w=R.getImageData(0,0,10,10).data;let X=!1;for(let C=3;C<w.length;C+=4)if(w[C]>0&&w[C]<255){X=!0;break}return(0,U.shadow)(this,"isFontSubpixelAAEnabled",X)}showText(R){const w=this.current,X=w.font;if(X.isType3Font)return this.showType3Text(R);const C=w.fontSize;if(C===0)return;const H=this.ctx,st=w.fontSizeScale,et=w.charSpacing,Mt=w.wordSpacing,Rt=w.fontDirection,gt=w.textHScale*Rt,Jt=R.length,Dt=X.vertical,qt=Dt?1:-1,vt=X.defaultVMetrics,cl=C*w.fontMatrix[0],bl=w.textRenderingMode===U.TextRenderingMode.FILL&&!X.disableFontFace&&!w.patternFill;H.save(),H.transform(...w.textMatrix),H.translate(w.x,w.y+w.textRise),Rt>0?H.scale(gt,-1):H.scale(gt,1);let il;if(w.patternFill){H.save();const Ct=w.fillColor.getPattern(H,this,(0,O.getCurrentTransformInverse)(H),I.PathType.FILL);il=(0,O.getCurrentTransform)(H),H.restore(),H.fillStyle=Ct}let Bt=w.lineWidth;const Ft=w.textMatrixScale;if(Ft===0||Bt===0){const Ct=w.textRenderingMode&U.TextRenderingMode.FILL_STROKE_MASK;(Ct===U.TextRenderingMode.STROKE||Ct===U.TextRenderingMode.FILL_STROKE)&&(Bt=this.getSinglePixelWidth())}else Bt/=Ft;if(st!==1&&(H.scale(st,st),Bt/=st),H.lineWidth=Bt,X.isInvalidPDFjsFont){const Ct=[];let $t=0;for(const dl of R)Ct.push(dl.unicode),$t+=dl.width;H.fillText(Ct.join(""),0,0),w.x+=$t*cl*gt,H.restore(),this.compose();return}let wt=0,pt;for(pt=0;pt<Jt;++pt){const Ct=R[pt];if(typeof Ct=="number"){wt+=qt*Ct*C/1e3;continue}let $t=!1;const dl=(Ct.isSpace?Mt:0)+et,rl=Ct.fontChar,Yl=Ct.accent;let Xl,pl,Ll=Ct.width;if(Dt){const Vl=Ct.vmetric||vt,_t=-(Ct.vmetric?Vl[1]:Ll*.5)*cl,ot=Vl[2]*cl;Ll=Vl?-Vl[0]:Ll,Xl=_t/st,pl=(wt+ot)/st}else Xl=wt/st,pl=0;if(X.remeasure&&Ll>0){const Vl=H.measureText(rl).width*1e3/C*st;if(Ll<Vl&&this.isFontSubpixelAAEnabled){const _t=Ll/Vl;$t=!0,H.save(),H.scale(_t,1),Xl/=_t}else Ll!==Vl&&(Xl+=(Ll-Vl)/2e3*C/st)}if(this.contentVisible&&(Ct.isInFont||X.missingFile)){if(bl&&!Yl)H.fillText(rl,Xl,pl);else if(this.paintChar(rl,Xl,pl,il),Yl){const Vl=Xl+C*Yl.offset.x/st,_t=pl-C*Yl.offset.y/st;this.paintChar(Yl.fontChar,Vl,_t,il)}}const yl=Dt?Ll*cl-dl*Rt:Ll*cl+dl*Rt;wt+=yl,$t&&H.restore()}Dt?w.y-=wt:w.x+=wt*gt,H.restore(),this.compose()}showType3Text(R){const w=this.ctx,X=this.current,C=X.font,H=X.fontSize,st=X.fontDirection,et=C.vertical?1:-1,Mt=X.charSpacing,Rt=X.wordSpacing,gt=X.textHScale*st,Jt=X.fontMatrix||U.FONT_IDENTITY_MATRIX,Dt=R.length,qt=X.textRenderingMode===U.TextRenderingMode.INVISIBLE;let vt,cl,bl,il;if(!(qt||H===0)){for(this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null,w.save(),w.transform(...X.textMatrix),w.translate(X.x,X.y),w.scale(gt,st),vt=0;vt<Dt;++vt){if(cl=R[vt],typeof cl=="number"){il=et*cl*H/1e3,this.ctx.translate(il,0),X.x+=il*gt;continue}const Bt=(cl.isSpace?Rt:0)+Mt,Ft=C.charProcOperatorList[cl.operatorListId];if(!Ft){(0,U.warn)(`Type3 character "${cl.operatorListId}" is not available.`);continue}this.contentVisible&&(this.processingType3=cl,this.save(),w.scale(H,H),w.transform(...Jt),this.executeOperatorList(Ft),this.restore()),bl=U.Util.applyTransform([cl.width,0],Jt)[0]*H+Bt,w.translate(bl,0),X.x+=bl*gt}w.restore(),this.processingType3=null}}setCharWidth(R,w){}setCharWidthAndBounds(R,w,X,C,H,st){this.ctx.rect(X,C,H-X,st-C),this.ctx.clip(),this.endPath()}getColorN_Pattern(R){let w;if(R[0]==="TilingPattern"){const X=R[1],C=this.baseTransform||(0,O.getCurrentTransform)(this.ctx),H={createCanvasGraphics:st=>new Js(st,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack})};w=new I.TilingPattern(R,X,this.ctx,H,C)}else w=this._getPattern(R[1],R[2]);return w}setStrokeColorN(){this.current.strokeColor=this.getColorN_Pattern(arguments)}setFillColorN(){this.current.fillColor=this.getColorN_Pattern(arguments),this.current.patternFill=!0}setStrokeRGBColor(R,w,X){const C=U.Util.makeHexColor(R,w,X);this.ctx.strokeStyle=C,this.current.strokeColor=C}setFillRGBColor(R,w,X){const C=U.Util.makeHexColor(R,w,X);this.ctx.fillStyle=C,this.current.fillColor=C,this.current.patternFill=!1}_getPattern(R){let w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,X;return this.cachedPatterns.has(R)?X=this.cachedPatterns.get(R):(X=(0,I.getShadingPattern)(this.getObject(R)),this.cachedPatterns.set(R,X)),w&&(X.matrix=w),X}shadingFill(R){if(!this.contentVisible)return;const w=this.ctx;this.save();const X=this._getPattern(R);w.fillStyle=X.getPattern(w,this,(0,O.getCurrentTransformInverse)(w),I.PathType.SHADING);const C=(0,O.getCurrentTransformInverse)(w);if(C){const{width:H,height:st}=w.canvas,[et,Mt,Rt,gt]=U.Util.getAxialAlignedBoundingBox([0,0,H,st],C);this.ctx.fillRect(et,Mt,Rt-et,gt-Mt)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.compose(this.current.getClippedPathBoundingBox()),this.restore()}beginInlineImage(){(0,U.unreachable)("Should not call beginInlineImage")}beginImageData(){(0,U.unreachable)("Should not call beginImageData")}paintFormXObjectBegin(R,w){if(this.contentVisible&&(this.save(),this.baseTransformStack.push(this.baseTransform),Array.isArray(R)&&R.length===6&&this.transform(...R),this.baseTransform=(0,O.getCurrentTransform)(this.ctx),w)){const X=w[2]-w[0],C=w[3]-w[1];this.ctx.rect(w[0],w[1],X,C),this.current.updateRectMinMax((0,O.getCurrentTransform)(this.ctx),w),this.clip(),this.endPath()}}paintFormXObjectEnd(){this.contentVisible&&(this.restore(),this.baseTransform=this.baseTransformStack.pop())}beginGroup(R){if(!this.contentVisible)return;this.save(),this.inSMaskMode&&(this.endSMaskMode(),this.current.activeSMask=null);const w=this.ctx;R.isolated||(0,U.info)("TODO: Support non-isolated groups."),R.knockout&&(0,U.warn)("Knockout groups not supported.");const X=(0,O.getCurrentTransform)(w);if(R.matrix&&w.transform(...R.matrix),!R.bbox)throw new Error("Bounding box is required.");let C=U.Util.getAxialAlignedBoundingBox(R.bbox,(0,O.getCurrentTransform)(w));const H=[0,0,w.canvas.width,w.canvas.height];C=U.Util.intersect(C,H)||[0,0,0,0];const st=Math.floor(C[0]),et=Math.floor(C[1]);let Mt=Math.max(Math.ceil(C[2])-st,1),Rt=Math.max(Math.ceil(C[3])-et,1),gt=1,Jt=1;Mt>f&&(gt=Mt/f,Mt=f),Rt>f&&(Jt=Rt/f,Rt=f),this.current.startNewPathAndClipBox([0,0,Mt,Rt]);let Dt="groupAt"+this.groupLevel;R.smask&&(Dt+="_smask_"+this.smaskCounter++%2);const qt=this.cachedCanvases.getCanvas(Dt,Mt,Rt),vt=qt.context;vt.scale(1/gt,1/Jt),vt.translate(-st,-et),vt.transform(...X),R.smask?this.smaskStack.push({canvas:qt.canvas,context:vt,offsetX:st,offsetY:et,scaleX:gt,scaleY:Jt,subtype:R.smask.subtype,backdrop:R.smask.backdrop,transferMap:R.smask.transferMap||null,startTransformInverse:null}):(w.setTransform(1,0,0,1,0,0),w.translate(st,et),w.scale(gt,Jt),w.save()),P(w,vt),this.ctx=vt,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(w),this.groupLevel++}endGroup(R){if(!this.contentVisible)return;this.groupLevel--;const w=this.ctx,X=this.groupStack.pop();if(this.ctx=X,this.ctx.imageSmoothingEnabled=!1,R.smask)this.tempSMask=this.smaskStack.pop(),this.restore();else{this.ctx.restore();const C=(0,O.getCurrentTransform)(this.ctx);this.restore(),this.ctx.save(),this.ctx.setTransform(...C);const H=U.Util.getAxialAlignedBoundingBox([0,0,w.canvas.width,w.canvas.height],C);this.ctx.drawImage(w.canvas,0,0),this.ctx.restore(),this.compose(H)}}beginAnnotation(R,w,X,C,H){if(A(this,M,p).call(this),Zt(this.ctx),this.ctx.save(),this.save(),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),Array.isArray(w)&&w.length===4){const st=w[2]-w[0],et=w[3]-w[1];if(H&&this.annotationCanvasMap){X=X.slice(),X[4]-=w[0],X[5]-=w[1],w=w.slice(),w[0]=w[1]=0,w[2]=st,w[3]=et;const[Mt,Rt]=U.Util.singularValueDecompose2dScale((0,O.getCurrentTransform)(this.ctx)),{viewportScale:gt}=this,Jt=Math.ceil(st*this.outputScaleX*gt),Dt=Math.ceil(et*this.outputScaleY*gt);this.annotationCanvas=this.canvasFactory.create(Jt,Dt);const{canvas:qt,context:vt}=this.annotationCanvas;this.annotationCanvasMap.set(R,qt),this.annotationCanvas.savedCtx=this.ctx,this.ctx=vt,this.ctx.save(),this.ctx.setTransform(Mt,0,0,-Rt,0,et*Rt),Zt(this.ctx)}else Zt(this.ctx),this.ctx.rect(w[0],w[1],st,et),this.ctx.clip(),this.endPath()}this.current=new m(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(...X),this.transform(...C)}endAnnotation(){this.annotationCanvas&&(this.ctx.restore(),A(this,B,Q).call(this),this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas)}paintImageMaskXObject(R){if(!this.contentVisible)return;const w=R.count;R=this.getObject(R.data,R),R.count=w;const X=this.ctx,C=this.processingType3;if(C&&(C.compiled===void 0&&(C.compiled=u(R)),C.compiled)){C.compiled(X);return}const H=this._createMaskCanvas(R),st=H.canvas;X.save(),X.setTransform(1,0,0,1,0,0),X.drawImage(st,H.offsetX,H.offsetY),X.restore(),this.compose()}paintImageMaskXObjectRepeat(R,w){let X=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,C=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,H=arguments.length>4?arguments[4]:void 0,st=arguments.length>5?arguments[5]:void 0;if(!this.contentVisible)return;R=this.getObject(R.data,R);const et=this.ctx;et.save();const Mt=(0,O.getCurrentTransform)(et);et.transform(w,X,C,H,0,0);const Rt=this._createMaskCanvas(R);et.setTransform(1,0,0,1,Rt.offsetX-Mt[4],Rt.offsetY-Mt[5]);for(let gt=0,Jt=st.length;gt<Jt;gt+=2){const Dt=U.Util.transform(Mt,[w,X,C,H,st[gt],st[gt+1]]),[qt,vt]=U.Util.applyTransform([0,0],Dt);et.drawImage(Rt.canvas,qt,vt)}et.restore(),this.compose()}paintImageMaskXObjectGroup(R){if(!this.contentVisible)return;const w=this.ctx,X=this.current.fillColor,C=this.current.patternFill;for(const H of R){const{data:st,width:et,height:Mt,transform:Rt}=H,gt=this.cachedCanvases.getCanvas("maskCanvas",et,Mt),Jt=gt.context;Jt.save();const Dt=this.getObject(st,H);$(Jt,Dt),Jt.globalCompositeOperation="source-in",Jt.fillStyle=C?X.getPattern(Jt,this,(0,O.getCurrentTransformInverse)(w),I.PathType.FILL):X,Jt.fillRect(0,0,et,Mt),Jt.restore(),w.save(),w.transform(...Rt),w.scale(1,-1),v(w,gt.canvas,0,0,et,Mt,0,-1,1,1),w.restore()}this.compose()}paintImageXObject(R){if(!this.contentVisible)return;const w=this.getObject(R);if(!w){(0,U.warn)("Dependent image isn't ready yet");return}this.paintInlineImageXObject(w)}paintImageXObjectRepeat(R,w,X,C){if(!this.contentVisible)return;const H=this.getObject(R);if(!H){(0,U.warn)("Dependent image isn't ready yet");return}const st=H.width,et=H.height,Mt=[];for(let Rt=0,gt=C.length;Rt<gt;Rt+=2)Mt.push({transform:[w,0,0,X,C[Rt],C[Rt+1]],x:0,y:0,w:st,h:et});this.paintInlineImageXObjectGroup(H,Mt)}applyTransferMapsToCanvas(R){return this.current.transferMaps!=="none"&&(R.filter=this.current.transferMaps,R.drawImage(R.canvas,0,0),R.filter="none"),R.canvas}applyTransferMapsToBitmap(R){if(this.current.transferMaps==="none")return R.bitmap;const{bitmap:w,width:X,height:C}=R,H=this.cachedCanvases.getCanvas("inlineImage",X,C),st=H.context;return st.filter=this.current.transferMaps,st.drawImage(w,0,0),st.filter="none",H.canvas}paintInlineImageXObject(R){if(!this.contentVisible)return;const w=R.width,X=R.height,C=this.ctx;if(this.save(),!U.isNodeJS){const{filter:et}=C;et!=="none"&&et!==""&&(C.filter="none")}C.scale(1/w,-1/X);let H;if(R.bitmap)H=this.applyTransferMapsToBitmap(R);else if(typeof HTMLElement=="function"&&R instanceof HTMLElement||!R.data)H=R;else{const et=this.cachedCanvases.getCanvas("inlineImage",w,X).context;_(et,R),H=this.applyTransferMapsToCanvas(et)}const st=this._scaleImage(H,(0,O.getCurrentTransformInverse)(C));C.imageSmoothingEnabled=zt((0,O.getCurrentTransform)(C),R.interpolate),v(C,st.img,0,0,st.paintWidth,st.paintHeight,0,-X,w,X),this.compose(),this.restore()}paintInlineImageXObjectGroup(R,w){if(!this.contentVisible)return;const X=this.ctx;let C;if(R.bitmap)C=R.bitmap;else{const H=R.width,st=R.height,et=this.cachedCanvases.getCanvas("inlineImage",H,st).context;_(et,R),C=this.applyTransferMapsToCanvas(et)}for(const H of w)X.save(),X.transform(...H.transform),X.scale(1,-1),v(X,C,H.x,H.y,H.w,H.h,0,-1,1,1),X.restore();this.compose()}paintSolidColorImageMask(){this.contentVisible&&(this.ctx.fillRect(0,0,1,1),this.compose())}markPoint(R){}markPointProps(R,w){}beginMarkedContent(R){this.markedContentStack.push({visible:!0})}beginMarkedContentProps(R,w){R==="OC"?this.markedContentStack.push({visible:this.optionalContentConfig.isVisible(w)}):this.markedContentStack.push({visible:!0}),this.contentVisible=this.isContentVisible()}endMarkedContent(){this.markedContentStack.pop(),this.contentVisible=this.isContentVisible()}beginCompat(){}endCompat(){}consumePath(R){const w=this.current.isEmptyClip();this.pendingClip&&this.current.updateClipFromPath(),this.pendingClip||this.compose(R);const X=this.ctx;this.pendingClip&&(w||(this.pendingClip===Vt?X.clip("evenodd"):X.clip()),this.pendingClip=null),this.current.startNewPathAndClipBox(this.current.clipBox),X.beginPath()}getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){const R=(0,O.getCurrentTransform)(this.ctx);if(R[1]===0&&R[2]===0)this._cachedGetSinglePixelWidth=1/Math.min(Math.abs(R[0]),Math.abs(R[3]));else{const w=Math.abs(R[0]*R[3]-R[2]*R[1]),X=Math.hypot(R[0],R[2]),C=Math.hypot(R[1],R[3]);this._cachedGetSinglePixelWidth=Math.max(X,C)/w}}return this._cachedGetSinglePixelWidth}getScaleForStroking(){if(this._cachedScaleForStroking[0]===-1){const{lineWidth:R}=this.current,{a:w,b:X,c:C,d:H}=this.ctx.getTransform();let st,et;if(X===0&&C===0){const Mt=Math.abs(w),Rt=Math.abs(H);if(Mt===Rt)if(R===0)st=et=1/Mt;else{const gt=Mt*R;st=et=gt<1?1/gt:1}else if(R===0)st=1/Mt,et=1/Rt;else{const gt=Mt*R,Jt=Rt*R;st=gt<1?1/gt:1,et=Jt<1?1/Jt:1}}else{const Mt=Math.abs(w*H-X*C),Rt=Math.hypot(w,X),gt=Math.hypot(C,H);if(R===0)st=gt/Mt,et=Rt/Mt;else{const Jt=R*Mt;st=gt>Jt?gt/Jt:1,et=Rt>Jt?Rt/Jt:1}}this._cachedScaleForStroking[0]=st,this._cachedScaleForStroking[1]=et}return this._cachedScaleForStroking}rescaleAndStroke(R){const{ctx:w}=this,{lineWidth:X}=this.current,[C,H]=this.getScaleForStroking();if(w.lineWidth=X||1,C===1&&H===1){w.stroke();return}const st=w.getLineDash();if(R&&w.save(),w.scale(C,H),st.length>0){const et=Math.max(C,H);w.setLineDash(st.map(Mt=>Mt/et)),w.lineDashOffset/=et}w.stroke(),R&&w.restore()}isContentVisible(){for(let R=this.markedContentStack.length-1;R>=0;R--)if(!this.markedContentStack[R].visible)return!1;return!0}};M=new WeakSet,p=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)},B=new WeakSet,Q=function(){if(this.pageColors){const at=this.filterFactory.addHCMFilter(this.pageColors.foreground,this.pageColors.background);if(at!=="none"){const R=this.ctx.filter;this.ctx.filter=at,this.ctx.drawImage(this.ctx.canvas,0,0),this.ctx.filter=R}}};let Pt=Ht;r.CanvasGraphics=Pt;for(const at in U.OPS)Pt.prototype[at]!==void 0&&(Pt.prototype[U.OPS[at]]=Pt.prototype[at])},(lt,r,h)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.TilingPattern=r.PathType=void 0,r.getShadingPattern=f,h(2);var M=h(1),p=h(168);const B={FILL:"Fill",STROKE:"Stroke",SHADING:"Shading"};r.PathType=B;function Q(g,F){if(!F)return;const J=F[2]-F[0],v=F[3]-F[1],u=new Path2D;u.rect(F[0],F[1],J,v),g.clip(u)}class U{constructor(){this.constructor===U&&(0,M.unreachable)("Cannot initialize BaseShadingPattern.")}getPattern(){(0,M.unreachable)("Abstract method `getPattern` called.")}}class O extends U{constructor(F){super(),this._type=F[1],this._bbox=F[2],this._colorStops=F[3],this._p0=F[4],this._p1=F[5],this._r0=F[6],this._r1=F[7],this.matrix=null}_createGradient(F){let J;this._type==="axial"?J=F.createLinearGradient(this._p0[0],this._p0[1],this._p1[0],this._p1[1]):this._type==="radial"&&(J=F.createRadialGradient(this._p0[0],this._p0[1],this._r0,this._p1[0],this._p1[1],this._r1));for(const v of this._colorStops)J.addColorStop(v[0],v[1]);return J}getPattern(F,J,v,u){let m;if(u===B.STROKE||u===B.FILL){const _=J.current.getClippedPathBoundingBox(u,(0,p.getCurrentTransform)(F))||[0,0,0,0],$=Math.ceil(_[2]-_[0])||1,P=Math.ceil(_[3]-_[1])||1,Zt=J.cachedCanvases.getCanvas("pattern",$,P,!0),dt=Zt.context;dt.clearRect(0,0,dt.canvas.width,dt.canvas.height),dt.beginPath(),dt.rect(0,0,dt.canvas.width,dt.canvas.height),dt.translate(-_[0],-_[1]),v=M.Util.transform(v,[1,0,0,1,_[0],_[1]]),dt.transform(...J.baseTransform),this.matrix&&dt.transform(...this.matrix),Q(dt,this._bbox),dt.fillStyle=this._createGradient(dt),dt.fill(),m=F.createPattern(Zt.canvas,"no-repeat");const It=new DOMMatrix(v);m.setTransform(It)}else Q(F,this._bbox),m=this._createGradient(F);return m}}function I(g,F,J,v,u,m,_,$){const P=F.coords,Zt=F.colors,dt=g.data,It=g.width*4;let xt;P[J+1]>P[v+1]&&(xt=J,J=v,v=xt,xt=m,m=_,_=xt),P[v+1]>P[u+1]&&(xt=v,v=u,u=xt,xt=_,_=$,$=xt),P[J+1]>P[v+1]&&(xt=J,J=v,v=xt,xt=m,m=_,_=xt);const it=(P[J]+F.offsetX)*F.scaleX,Xt=(P[J+1]+F.offsetY)*F.scaleY,zt=(P[v]+F.offsetX)*F.scaleX,Gt=(P[v+1]+F.offsetY)*F.scaleY,Nt=(P[u]+F.offsetX)*F.scaleX,Ut=(P[u+1]+F.offsetY)*F.scaleY;if(Xt>=Ut)return;const Vt=Zt[m],Ht=Zt[m+1],Pt=Zt[m+2],at=Zt[_],R=Zt[_+1],w=Zt[_+2],X=Zt[$],C=Zt[$+1],H=Zt[$+2],st=Math.round(Xt),et=Math.round(Ut);let Mt,Rt,gt,Jt,Dt,qt,vt,cl;for(let bl=st;bl<=et;bl++){if(bl<Gt){const pt=bl<Xt?0:(Xt-bl)/(Xt-Gt);Mt=it-(it-zt)*pt,Rt=Vt-(Vt-at)*pt,gt=Ht-(Ht-R)*pt,Jt=Pt-(Pt-w)*pt}else{let pt;bl>Ut?pt=1:Gt===Ut?pt=0:pt=(Gt-bl)/(Gt-Ut),Mt=zt-(zt-Nt)*pt,Rt=at-(at-X)*pt,gt=R-(R-C)*pt,Jt=w-(w-H)*pt}let il;bl<Xt?il=0:bl>Ut?il=1:il=(Xt-bl)/(Xt-Ut),Dt=it-(it-Nt)*il,qt=Vt-(Vt-X)*il,vt=Ht-(Ht-C)*il,cl=Pt-(Pt-H)*il;const Bt=Math.round(Math.min(Mt,Dt)),Ft=Math.round(Math.max(Mt,Dt));let wt=It*bl+Bt*4;for(let pt=Bt;pt<=Ft;pt++)il=(Mt-pt)/(Mt-Dt),il<0?il=0:il>1&&(il=1),dt[wt++]=Rt-(Rt-qt)*il|0,dt[wt++]=gt-(gt-vt)*il|0,dt[wt++]=Jt-(Jt-cl)*il|0,dt[wt++]=255}}function j(g,F,J){const v=F.coords,u=F.colors;let m,_;switch(F.type){case"lattice":const $=F.verticesPerRow,P=Math.floor(v.length/$)-1,Zt=$-1;for(m=0;m<P;m++){let dt=m*$;for(let It=0;It<Zt;It++,dt++)I(g,J,v[dt],v[dt+1],v[dt+$],u[dt],u[dt+1],u[dt+$]),I(g,J,v[dt+$+1],v[dt+1],v[dt+$],u[dt+$+1],u[dt+1],u[dt+$])}break;case"triangles":for(m=0,_=v.length;m<_;m+=3)I(g,J,v[m],v[m+1],v[m+2],u[m],u[m+1],u[m+2]);break;default:throw new Error("illegal figure")}}class q extends U{constructor(F){super(),this._coords=F[2],this._colors=F[3],this._figures=F[4],this._bounds=F[5],this._bbox=F[7],this._background=F[8],this.matrix=null}_createMeshCanvas(F,J,v){const u=Math.floor(this._bounds[0]),m=Math.floor(this._bounds[1]),_=Math.ceil(this._bounds[2])-u,$=Math.ceil(this._bounds[3])-m,P=Math.min(Math.ceil(Math.abs(_*F[0]*1.1)),3e3),Zt=Math.min(Math.ceil(Math.abs($*F[1]*1.1)),3e3),dt=_/P,It=$/Zt,xt={coords:this._coords,colors:this._colors,offsetX:-u,offsetY:-m,scaleX:1/dt,scaleY:1/It},it=P+2*2,Xt=Zt+2*2,zt=v.getCanvas("mesh",it,Xt,!1),Gt=zt.context,Nt=Gt.createImageData(P,Zt);if(J){const Ut=Nt.data;for(let Vt=0,Ht=Ut.length;Vt<Ht;Vt+=4)Ut[Vt]=J[0],Ut[Vt+1]=J[1],Ut[Vt+2]=J[2],Ut[Vt+3]=255}for(const Ut of this._figures)j(Nt,Ut,xt);return Gt.putImageData(Nt,2,2),{canvas:zt.canvas,offsetX:u-2*dt,offsetY:m-2*It,scaleX:dt,scaleY:It}}getPattern(F,J,v,u){Q(F,this._bbox);let m;if(u===B.SHADING)m=M.Util.singularValueDecompose2dScale((0,p.getCurrentTransform)(F));else if(m=M.Util.singularValueDecompose2dScale(J.baseTransform),this.matrix){const $=M.Util.singularValueDecompose2dScale(this.matrix);m=[m[0]*$[0],m[1]*$[1]]}const _=this._createMeshCanvas(m,u===B.SHADING?null:this._background,J.cachedCanvases);return u!==B.SHADING&&(F.setTransform(...J.baseTransform),this.matrix&&F.transform(...this.matrix)),F.translate(_.offsetX,_.offsetY),F.scale(_.scaleX,_.scaleY),F.createPattern(_.canvas,"no-repeat")}}class K extends U{getPattern(){return"hotpink"}}function f(g){switch(g[0]){case"RadialAxial":return new O(g);case"Mesh":return new q(g);case"Dummy":return new K}throw new Error(`Unknown IR type: ${g[0]}`)}const S={COLORED:1,UNCOLORED:2},k=class Os{constructor(F,J,v,u,m){this.operatorList=F[2],this.matrix=F[3]||[1,0,0,1,0,0],this.bbox=F[4],this.xstep=F[5],this.ystep=F[6],this.paintType=F[7],this.tilingType=F[8],this.color=J,this.ctx=v,this.canvasGraphicsFactory=u,this.baseTransform=m}createPatternCanvas(F){const J=this.operatorList,v=this.bbox,u=this.xstep,m=this.ystep,_=this.paintType,$=this.tilingType,P=this.color,Zt=this.canvasGraphicsFactory;(0,M.info)("TilingType: "+$);const dt=v[0],It=v[1],xt=v[2],it=v[3],Xt=M.Util.singularValueDecompose2dScale(this.matrix),zt=M.Util.singularValueDecompose2dScale(this.baseTransform),Gt=[Xt[0]*zt[0],Xt[1]*zt[1]],Nt=this.getSizeAndScale(u,this.ctx.canvas.width,Gt[0]),Ut=this.getSizeAndScale(m,this.ctx.canvas.height,Gt[1]),Vt=F.cachedCanvases.getCanvas("pattern",Nt.size,Ut.size,!0),Ht=Vt.context,Pt=Zt.createCanvasGraphics(Ht);Pt.groupLevel=F.groupLevel,this.setFillAndStrokeStyleToContext(Pt,_,P);let at=dt,R=It,w=xt,X=it;return dt<0&&(at=0,w+=Math.abs(dt)),It<0&&(R=0,X+=Math.abs(It)),Ht.translate(-(Nt.scale*at),-(Ut.scale*R)),Pt.transform(Nt.scale,0,0,Ut.scale,0,0),Ht.save(),this.clipBbox(Pt,at,R,w,X),Pt.baseTransform=(0,p.getCurrentTransform)(Pt.ctx),Pt.executeOperatorList(J),Pt.endDrawing(),{canvas:Vt.canvas,scaleX:Nt.scale,scaleY:Ut.scale,offsetX:at,offsetY:R}}getSizeAndScale(F,J,v){F=Math.abs(F);const u=Math.max(Os.MAX_PATTERN_SIZE,J);let m=Math.ceil(F*v);return m>=u?m=u:v=m/F,{scale:v,size:m}}clipBbox(F,J,v,u,m){const _=u-J,$=m-v;F.ctx.rect(J,v,_,$),F.current.updateRectMinMax((0,p.getCurrentTransform)(F.ctx),[J,v,u,m]),F.clip(),F.endPath()}setFillAndStrokeStyleToContext(F,J,v){const u=F.ctx,m=F.current;switch(J){case S.COLORED:const _=this.ctx;u.fillStyle=_.fillStyle,u.strokeStyle=_.strokeStyle,m.fillColor=_.fillStyle,m.strokeColor=_.strokeStyle;break;case S.UNCOLORED:const $=M.Util.makeHexColor(v[0],v[1],v[2]);u.fillStyle=$,u.strokeStyle=$,m.fillColor=$,m.strokeColor=$;break;default:throw new M.FormatError(`Unsupported paint type: ${J}`)}}getPattern(F,J,v,u){let m=v;u!==B.SHADING&&(m=M.Util.transform(m,J.baseTransform),this.matrix&&(m=M.Util.transform(m,this.matrix)));const _=this.createPatternCanvas(J);let $=new DOMMatrix(m);$=$.translate(_.offsetX,_.offsetY),$=$.scale(1/_.scaleX,1/_.scaleY);const P=F.createPattern(_.canvas,"repeat");return P.setTransform($),P}};tt(k,"MAX_PATTERN_SIZE",3e3);let T=k;r.TilingPattern=T},(lt,r,h)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.convertBlackAndWhiteToRGBA=B,r.convertToRGBA=p,r.grayToRGBA=U,h(93),h(101),h(102),h(105),h(107),h(109),h(113),h(116),h(123);var M=h(1);function p(O){switch(O.kind){case M.ImageKind.GRAYSCALE_1BPP:return B(O);case M.ImageKind.RGB_24BPP:return Q(O)}return null}function B(O){let{src:I,srcPos:j=0,dest:q,width:K,height:f,nonBlackColor:S=4294967295,inverseDecode:k=!1}=O;const T=M.FeatureTest.isLittleEndian?4278190080:255,[g,F]=k?[S,T]:[T,S],J=K>>3,v=K&7,u=I.length;q=new Uint32Array(q.buffer);let m=0;for(let _=0;_<f;_++){for(const P=j+J;j<P;j++){const Zt=j<u?I[j]:255;q[m++]=Zt&128?F:g,q[m++]=Zt&64?F:g,q[m++]=Zt&32?F:g,q[m++]=Zt&16?F:g,q[m++]=Zt&8?F:g,q[m++]=Zt&4?F:g,q[m++]=Zt&2?F:g,q[m++]=Zt&1?F:g}if(v===0)continue;const $=j<u?I[j++]:255;for(let P=0;P<v;P++)q[m++]=$&1<<7-P?F:g}return{srcPos:j,destPos:m}}function Q(O){let{src:I,srcPos:j=0,dest:q,destPos:K=0,width:f,height:S}=O,k=0;const T=I.length>>2,g=new Uint32Array(I.buffer,j,T);if(M.FeatureTest.isLittleEndian){for(;k<T-2;k+=3,K+=4){const F=g[k],J=g[k+1],v=g[k+2];q[K]=F|4278190080,q[K+1]=F>>>24|J<<8|4278190080,q[K+2]=J>>>16|v<<16|4278190080,q[K+3]=v>>>8|4278190080}for(let F=k*4,J=I.length;F<J;F+=3)q[K++]=I[F]|I[F+1]<<8|I[F+2]<<16|4278190080}else{for(;k<T-2;k+=3,K+=4){const F=g[k],J=g[k+1],v=g[k+2];q[K]=F|255,q[K+1]=F<<24|J>>>8|255,q[K+2]=J<<16|v>>>16|255,q[K+3]=v<<8|255}for(let F=k*4,J=I.length;F<J;F+=3)q[K++]=I[F]<<24|I[F+1]<<16|I[F+2]<<8|255}return{srcPos:j,destPos:K}}function U(O,I){if(M.FeatureTest.isLittleEndian)for(let j=0,q=O.length;j<q;j++)I[j]=O[j]*65793|4278190080;else for(let j=0,q=O.length;j<q;j++)I[j]=O[j]*16843008|255}},(lt,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.GlobalWorkerOptions=void 0;const h=Object.create(null);r.GlobalWorkerOptions=h,h.workerPort=null,h.workerSrc=""},(lt,r,h)=>{var M,p,B,Q,U,O;Object.defineProperty(r,"__esModule",{value:!0}),r.MessageHandler=void 0,h(2);var I=h(1);const j={UNKNOWN:0,DATA:1,ERROR:2},q={UNKNOWN:0,CANCEL:1,CANCEL_COMPLETE:2,CLOSE:3,ENQUEUE:4,ERROR:5,PULL:6,PULL_COMPLETE:7,START_COMPLETE:8};function K(S){switch(S instanceof Error||typeof S=="object"&&S!==null||(0,I.unreachable)('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),S.name){case"AbortException":return new I.AbortException(S.message);case"MissingPDFException":return new I.MissingPDFException(S.message);case"PasswordException":return new I.PasswordException(S.message,S.code);case"UnexpectedResponseException":return new I.UnexpectedResponseException(S.message,S.status);case"UnknownErrorException":return new I.UnknownErrorException(S.message,S.details);default:return new I.UnknownErrorException(S.message,S.toString())}}class f{constructor(k,T,g){E(this,M),E(this,B),E(this,U),this.sourceName=k,this.targetName=T,this.comObj=g,this.callbackId=1,this.streamId=1,this.streamSinks=Object.create(null),this.streamControllers=Object.create(null),this.callbackCapabilities=Object.create(null),this.actionHandler=Object.create(null),this._onComObjOnMessage=F=>{const J=F.data;if(J.targetName!==this.sourceName)return;if(J.stream){A(this,B,Q).call(this,J);return}if(J.callback){const u=J.callbackId,m=this.callbackCapabilities[u];if(!m)throw new Error(`Cannot resolve callback ${u}`);if(delete this.callbackCapabilities[u],J.callback===j.DATA)m.resolve(J.data);else if(J.callback===j.ERROR)m.reject(K(J.reason));else throw new Error("Unexpected callback case");return}const v=this.actionHandler[J.action];if(!v)throw new Error(`Unknown action from worker: ${J.action}`);if(J.callbackId){const u=this.sourceName,m=J.sourceName;new Promise(function(_){_(v(J.data))}).then(function(_){g.postMessage({sourceName:u,targetName:m,callback:j.DATA,callbackId:J.callbackId,data:_})},function(_){g.postMessage({sourceName:u,targetName:m,callback:j.ERROR,callbackId:J.callbackId,reason:K(_)})});return}if(J.streamId){A(this,M,p).call(this,J);return}v(J.data)},g.addEventListener("message",this._onComObjOnMessage)}on(k,T){const g=this.actionHandler;if(g[k])throw new Error(`There is already an actionName called "${k}"`);g[k]=T}send(k,T,g){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:k,data:T},g)}sendWithPromise(k,T,g){const F=this.callbackId++,J=new I.PromiseCapability;this.callbackCapabilities[F]=J;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:k,callbackId:F,data:T},g)}catch(v){J.reject(v)}return J.promise}sendWithStream(k,T,g,F){const J=this.streamId++,v=this.sourceName,u=this.targetName,m=this.comObj;return new ReadableStream({start:_=>{const $=new I.PromiseCapability;return this.streamControllers[J]={controller:_,startCall:$,pullCall:null,cancelCall:null,isClosed:!1},m.postMessage({sourceName:v,targetName:u,action:k,streamId:J,data:T,desiredSize:_.desiredSize},F),$.promise},pull:_=>{const $=new I.PromiseCapability;return this.streamControllers[J].pullCall=$,m.postMessage({sourceName:v,targetName:u,stream:q.PULL,streamId:J,desiredSize:_.desiredSize}),$.promise},cancel:_=>{(0,I.assert)(_ instanceof Error,"cancel must have a valid reason");const $=new I.PromiseCapability;return this.streamControllers[J].cancelCall=$,this.streamControllers[J].isClosed=!0,m.postMessage({sourceName:v,targetName:u,stream:q.CANCEL,streamId:J,reason:K(_)}),$.promise}},g)}destroy(){this.comObj.removeEventListener("message",this._onComObjOnMessage)}}M=new WeakSet,p=function(S){const k=S.streamId,T=this.sourceName,g=S.sourceName,F=this.comObj,J=this,v=this.actionHandler[S.action],u={enqueue(m){let _=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,$=arguments.length>2?arguments[2]:void 0;if(this.isCancelled)return;const P=this.desiredSize;this.desiredSize-=_,P>0&&this.desiredSize<=0&&(this.sinkCapability=new I.PromiseCapability,this.ready=this.sinkCapability.promise),F.postMessage({sourceName:T,targetName:g,stream:q.ENQUEUE,streamId:k,chunk:m},$)},close(){this.isCancelled||(this.isCancelled=!0,F.postMessage({sourceName:T,targetName:g,stream:q.CLOSE,streamId:k}),delete J.streamSinks[k])},error(m){(0,I.assert)(m instanceof Error,"error must have a valid reason"),!this.isCancelled&&(this.isCancelled=!0,F.postMessage({sourceName:T,targetName:g,stream:q.ERROR,streamId:k,reason:K(m)}))},sinkCapability:new I.PromiseCapability,onPull:null,onCancel:null,isCancelled:!1,desiredSize:S.desiredSize,ready:null};u.sinkCapability.resolve(),u.ready=u.sinkCapability.promise,this.streamSinks[k]=u,new Promise(function(m){m(v(S.data,u))}).then(function(){F.postMessage({sourceName:T,targetName:g,stream:q.START_COMPLETE,streamId:k,success:!0})},function(m){F.postMessage({sourceName:T,targetName:g,stream:q.START_COMPLETE,streamId:k,reason:K(m)})})},B=new WeakSet,Q=function(S){const k=S.streamId,T=this.sourceName,g=S.sourceName,F=this.comObj,J=this.streamControllers[k],v=this.streamSinks[k];switch(S.stream){case q.START_COMPLETE:S.success?J.startCall.resolve():J.startCall.reject(K(S.reason));break;case q.PULL_COMPLETE:S.success?J.pullCall.resolve():J.pullCall.reject(K(S.reason));break;case q.PULL:if(!v){F.postMessage({sourceName:T,targetName:g,stream:q.PULL_COMPLETE,streamId:k,success:!0});break}v.desiredSize<=0&&S.desiredSize>0&&v.sinkCapability.resolve(),v.desiredSize=S.desiredSize,new Promise(function(u){var m;u((m=v.onPull)==null?void 0:m.call(v))}).then(function(){F.postMessage({sourceName:T,targetName:g,stream:q.PULL_COMPLETE,streamId:k,success:!0})},function(u){F.postMessage({sourceName:T,targetName:g,stream:q.PULL_COMPLETE,streamId:k,reason:K(u)})});break;case q.ENQUEUE:if((0,I.assert)(J,"enqueue should have stream controller"),J.isClosed)break;J.controller.enqueue(S.chunk);break;case q.CLOSE:if((0,I.assert)(J,"close should have stream controller"),J.isClosed)break;J.isClosed=!0,J.controller.close(),A(this,U,O).call(this,J,k);break;case q.ERROR:(0,I.assert)(J,"error should have stream controller"),J.controller.error(K(S.reason)),A(this,U,O).call(this,J,k);break;case q.CANCEL_COMPLETE:S.success?J.cancelCall.resolve():J.cancelCall.reject(K(S.reason)),A(this,U,O).call(this,J,k);break;case q.CANCEL:if(!v)break;new Promise(function(u){var m;u((m=v.onCancel)==null?void 0:m.call(v,K(S.reason)))}).then(function(){F.postMessage({sourceName:T,targetName:g,stream:q.CANCEL_COMPLETE,streamId:k,success:!0})},function(u){F.postMessage({sourceName:T,targetName:g,stream:q.CANCEL_COMPLETE,streamId:k,reason:K(u)})}),v.sinkCapability.reject(K(S.reason)),v.isCancelled=!0,delete this.streamSinks[k];break;default:throw new Error("Unexpected stream case")}},U=new WeakSet,O=async function(S,k){var T,g,F;await Promise.allSettled([(T=S.startCall)==null?void 0:T.promise,(g=S.pullCall)==null?void 0:g.promise,(F=S.cancelCall)==null?void 0:F.promise]),delete this.streamControllers[k]},r.MessageHandler=f},(lt,r,h)=>{var M,p;Object.defineProperty(r,"__esModule",{value:!0}),r.Metadata=void 0;var B=h(1);class Q{constructor(O){E(this,M,void 0),E(this,p,void 0);let{parsedData:I,rawData:j}=O;Zl(this,M,I),Zl(this,p,j)}getRaw(){return t(this,p)}get(O){return t(this,M).get(O)??null}getAll(){return(0,B.objectFromMap)(t(this,M))}has(O){return t(this,M).has(O)}}M=new WeakMap,p=new WeakMap,r.Metadata=Q},(lt,r,h)=>{var M,p,B,Q,U,O,I;Object.defineProperty(r,"__esModule",{value:!0}),r.OptionalContentConfig=void 0;var j=h(1),q=h(170);const K=Symbol("INTERNAL");class f{constructor(T,g){E(this,M,!0),this.name=T,this.intent=g}get visible(){return t(this,M)}_setVisible(T,g){T!==K&&(0,j.unreachable)("Internal method `_setVisible` called."),Zl(this,M,g)}}M=new WeakMap;class S{constructor(T){if(E(this,O),E(this,p,null),E(this,B,new Map),E(this,Q,null),E(this,U,null),this.name=null,this.creator=null,T!==null){this.name=T.name,this.creator=T.creator,Zl(this,U,T.order);for(const g of T.groups)t(this,B).set(g.id,new f(g.name,g.intent));if(T.baseState==="OFF")for(const g of t(this,B).values())g._setVisible(K,!1);for(const g of T.on)t(this,B).get(g)._setVisible(K,!0);for(const g of T.off)t(this,B).get(g)._setVisible(K,!1);Zl(this,Q,this.getHash())}}isVisible(T){if(t(this,B).size===0)return!0;if(!T)return(0,j.warn)("Optional content group not defined."),!0;if(T.type==="OCG")return t(this,B).has(T.id)?t(this,B).get(T.id).visible:((0,j.warn)(`Optional content group not found: ${T.id}`),!0);if(T.type==="OCMD"){if(T.expression)return A(this,O,I).call(this,T.expression);if(!T.policy||T.policy==="AnyOn"){for(const g of T.ids){if(!t(this,B).has(g))return(0,j.warn)(`Optional content group not found: ${g}`),!0;if(t(this,B).get(g).visible)return!0}return!1}else if(T.policy==="AllOn"){for(const g of T.ids){if(!t(this,B).has(g))return(0,j.warn)(`Optional content group not found: ${g}`),!0;if(!t(this,B).get(g).visible)return!1}return!0}else if(T.policy==="AnyOff"){for(const g of T.ids){if(!t(this,B).has(g))return(0,j.warn)(`Optional content group not found: ${g}`),!0;if(!t(this,B).get(g).visible)return!0}return!1}else if(T.policy==="AllOff"){for(const g of T.ids){if(!t(this,B).has(g))return(0,j.warn)(`Optional content group not found: ${g}`),!0;if(t(this,B).get(g).visible)return!1}return!0}return(0,j.warn)(`Unknown optional content policy ${T.policy}.`),!0}return(0,j.warn)(`Unknown group type ${T.type}.`),!0}setVisibility(T){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(!t(this,B).has(T)){(0,j.warn)(`Optional content group not found: ${T}`);return}t(this,B).get(T)._setVisible(K,!!g),Zl(this,p,null)}get hasInitialVisibility(){return t(this,Q)===null||this.getHash()===t(this,Q)}getOrder(){return t(this,B).size?t(this,U)?t(this,U).slice():[...t(this,B).keys()]:null}getGroups(){return t(this,B).size>0?(0,j.objectFromMap)(t(this,B)):null}getGroup(T){return t(this,B).get(T)||null}getHash(){if(t(this,p)!==null)return t(this,p);const T=new q.MurmurHash3_64;for(const[g,F]of t(this,B))T.update(`${g}:${F.visible}`);return Zl(this,p,T.hexdigest())}}p=new WeakMap,B=new WeakMap,Q=new WeakMap,U=new WeakMap,O=new WeakSet,I=function(k){const T=k.length;if(T<2)return!0;const g=k[0];for(let F=1;F<T;F++){const J=k[F];let v;if(Array.isArray(J))v=A(this,O,I).call(this,J);else if(t(this,B).has(J))v=t(this,B).get(J).visible;else return(0,j.warn)(`Optional content group not found: ${J}`),!0;switch(g){case"And":if(!v)return!1;break;case"Or":if(v)return!0;break;case"Not":return!v;default:return!0}}return g==="And"},r.OptionalContentConfig=S},(lt,r,h)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.PDFDataTransportStream=void 0,h(93),h(101),h(102),h(105),h(107),h(109),h(113),h(116),h(123),h(89);var M=h(1),p=h(168);class B{constructor(I,j){let{length:q,initialData:K,progressiveDone:f=!1,contentDispositionFilename:S=null,disableRange:k=!1,disableStream:T=!1}=I;if((0,M.assert)(j,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.'),this._queuedChunks=[],this._progressiveDone=f,this._contentDispositionFilename=S,(K==null?void 0:K.length)>0){const g=K instanceof Uint8Array&&K.byteLength===K.buffer.byteLength?K.buffer:new Uint8Array(K).buffer;this._queuedChunks.push(g)}this._pdfDataRangeTransport=j,this._isStreamingSupported=!T,this._isRangeSupported=!k,this._contentLength=q,this._fullRequestReader=null,this._rangeReaders=[],this._pdfDataRangeTransport.addRangeListener((g,F)=>{this._onReceiveData({begin:g,chunk:F})}),this._pdfDataRangeTransport.addProgressListener((g,F)=>{this._onProgress({loaded:g,total:F})}),this._pdfDataRangeTransport.addProgressiveReadListener(g=>{this._onReceiveData({chunk:g})}),this._pdfDataRangeTransport.addProgressiveDoneListener(()=>{this._onProgressiveDone()}),this._pdfDataRangeTransport.transportReady()}_onReceiveData(I){let{begin:j,chunk:q}=I;const K=q instanceof Uint8Array&&q.byteLength===q.buffer.byteLength?q.buffer:new Uint8Array(q).buffer;if(j===void 0)this._fullRequestReader?this._fullRequestReader._enqueue(K):this._queuedChunks.push(K);else{const f=this._rangeReaders.some(function(S){return S._begin!==j?!1:(S._enqueue(K),!0)});(0,M.assert)(f,"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}get _progressiveDataLength(){var I;return((I=this._fullRequestReader)==null?void 0:I._loaded)??0}_onProgress(I){var j,q,K,f;I.total===void 0?(q=(j=this._rangeReaders[0])==null?void 0:j.onProgress)==null||q.call(j,{loaded:I.loaded}):(f=(K=this._fullRequestReader)==null?void 0:K.onProgress)==null||f.call(K,{loaded:I.loaded,total:I.total})}_onProgressiveDone(){var I;(I=this._fullRequestReader)==null||I.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(I){const j=this._rangeReaders.indexOf(I);j>=0&&this._rangeReaders.splice(j,1)}getFullReader(){(0,M.assert)(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");const I=this._queuedChunks;return this._queuedChunks=null,new Q(this,I,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(I,j){if(j<=this._progressiveDataLength)return null;const q=new U(this,I,j);return this._pdfDataRangeTransport.requestDataRange(I,j),this._rangeReaders.push(q),q}cancelAllRequests(I){var j;(j=this._fullRequestReader)==null||j.cancel(I);for(const q of this._rangeReaders.slice(0))q.cancel(I);this._pdfDataRangeTransport.abort()}}r.PDFDataTransportStream=B;class Q{constructor(I,j){let q=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,K=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;this._stream=I,this._done=q||!1,this._filename=(0,p.isPdfFile)(K)?K:null,this._queuedChunks=j||[],this._loaded=0;for(const f of this._queuedChunks)this._loaded+=f.byteLength;this._requests=[],this._headersReady=Promise.resolve(),I._fullRequestReader=this,this.onProgress=null}_enqueue(I){this._done||(this._requests.length>0?this._requests.shift().resolve({value:I,done:!1}):this._queuedChunks.push(I),this._loaded+=I.byteLength)}get headersReady(){return this._headersReady}get filename(){return this._filename}get isRangeSupported(){return this._stream._isRangeSupported}get isStreamingSupported(){return this._stream._isStreamingSupported}get contentLength(){return this._stream._contentLength}async read(){if(this._queuedChunks.length>0)return{value:this._queuedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};const I=new M.PromiseCapability;return this._requests.push(I),I.promise}cancel(I){this._done=!0;for(const j of this._requests)j.resolve({value:void 0,done:!0});this._requests.length=0}progressiveDone(){this._done||(this._done=!0)}}class U{constructor(I,j,q){this._stream=I,this._begin=j,this._end=q,this._queuedChunk=null,this._requests=[],this._done=!1,this.onProgress=null}_enqueue(I){if(!this._done){if(this._requests.length===0)this._queuedChunk=I;else{this._requests.shift().resolve({value:I,done:!1});for(const j of this._requests)j.resolve({value:void 0,done:!0});this._requests.length=0}this._done=!0,this._stream._removeRangeReader(this)}}get isStreamingSupported(){return!1}async read(){if(this._queuedChunk){const j=this._queuedChunk;return this._queuedChunk=null,{value:j,done:!1}}if(this._done)return{value:void 0,done:!0};const I=new M.PromiseCapability;return this._requests.push(I),I.promise}cancel(I){this._done=!0;for(const j of this._requests)j.resolve({value:void 0,done:!0});this._requests.length=0,this._stream._removeRangeReader(this)}}},(lt,r,h)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.PDFFetchStream=void 0,h(93),h(101),h(102),h(105),h(107),h(109),h(113),h(116),h(123),h(89);var M=h(1),p=h(182);function B(q,K,f){return{method:"GET",headers:q,signal:f.signal,mode:"cors",credentials:K?"include":"same-origin",redirect:"follow"}}function Q(q){const K=new Headers;for(const f in q){const S=q[f];S!==void 0&&K.append(f,S)}return K}function U(q){return q instanceof Uint8Array?q.buffer:q instanceof ArrayBuffer?q:((0,M.warn)(`getArrayBuffer - unexpected data format: ${q}`),new Uint8Array(q).buffer)}class O{constructor(K){this.source=K,this.isHttp=/^https?:/i.test(K.url),this.httpHeaders=this.isHttp&&K.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){var K;return((K=this._fullRequestReader)==null?void 0:K._loaded)??0}getFullReader(){return(0,M.assert)(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new I(this),this._fullRequestReader}getRangeReader(K,f){if(f<=this._progressiveDataLength)return null;const S=new j(this,K,f);return this._rangeRequestReaders.push(S),S}cancelAllRequests(K){var f;(f=this._fullRequestReader)==null||f.cancel(K);for(const S of this._rangeRequestReaders.slice(0))S.cancel(K)}}r.PDFFetchStream=O;class I{constructor(K){this._stream=K,this._reader=null,this._loaded=0,this._filename=null;const f=K.source;this._withCredentials=f.withCredentials||!1,this._contentLength=f.length,this._headersCapability=new M.PromiseCapability,this._disableRange=f.disableRange||!1,this._rangeChunkSize=f.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._abortController=new AbortController,this._isStreamingSupported=!f.disableStream,this._isRangeSupported=!f.disableRange,this._headers=Q(this._stream.httpHeaders);const S=f.url;fetch(S,B(this._headers,this._withCredentials,this._abortController)).then(k=>{if(!(0,p.validateResponseStatus)(k.status))throw(0,p.createResponseStatusError)(k.status,S);this._reader=k.body.getReader(),this._headersCapability.resolve();const T=J=>k.headers.get(J),{allowRangeRequests:g,suggestedLength:F}=(0,p.validateRangeRequestCapabilities)({getResponseHeader:T,isHttp:this._stream.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=g,this._contentLength=F||this._contentLength,this._filename=(0,p.extractFilenameFromHeader)(T),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new M.AbortException("Streaming is disabled."))}).catch(this._headersCapability.reject),this.onProgress=null}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){var K;await this._headersCapability.promise;const{value:f,done:S}=await this._reader.read();return S?{value:f,done:S}:(this._loaded+=f.byteLength,(K=this.onProgress)==null||K.call(this,{loaded:this._loaded,total:this._contentLength}),{value:U(f),done:!1})}cancel(K){var f;(f=this._reader)==null||f.cancel(K),this._abortController.abort()}}class j{constructor(K,f,S){this._stream=K,this._reader=null,this._loaded=0;const k=K.source;this._withCredentials=k.withCredentials||!1,this._readCapability=new M.PromiseCapability,this._isStreamingSupported=!k.disableStream,this._abortController=new AbortController,this._headers=Q(this._stream.httpHeaders),this._headers.append("Range",`bytes=${f}-${S-1}`);const T=k.url;fetch(T,B(this._headers,this._withCredentials,this._abortController)).then(g=>{if(!(0,p.validateResponseStatus)(g.status))throw(0,p.createResponseStatusError)(g.status,T);this._readCapability.resolve(),this._reader=g.body.getReader()}).catch(this._readCapability.reject),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){var K;await this._readCapability.promise;const{value:f,done:S}=await this._reader.read();return S?{value:f,done:S}:(this._loaded+=f.byteLength,(K=this.onProgress)==null||K.call(this,{loaded:this._loaded}),{value:U(f),done:!1})}cancel(K){var f;(f=this._reader)==null||f.cancel(K),this._abortController.abort()}}},(lt,r,h)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.createResponseStatusError=O,r.extractFilenameFromHeader=U,r.validateRangeRequestCapabilities=Q,r.validateResponseStatus=I;var M=h(1),p=h(183),B=h(168);function Q(j){let{getResponseHeader:q,isHttp:K,rangeChunkSize:f,disableRange:S}=j;const k={allowRangeRequests:!1,suggestedLength:void 0},T=parseInt(q("Content-Length"),10);return!Number.isInteger(T)||(k.suggestedLength=T,T<=2*f)||S||!K||q("Accept-Ranges")!=="bytes"||(q("Content-Encoding")||"identity")!=="identity"||(k.allowRangeRequests=!0),k}function U(j){const q=j("Content-Disposition");if(q){let K=(0,p.getFilenameFromContentDispositionHeader)(q);if(K.includes("%"))try{K=decodeURIComponent(K)}catch{}if((0,B.isPdfFile)(K))return K}return null}function O(j,q){return j===404||j===0&&q.startsWith("file:")?new M.MissingPDFException('Missing PDF "'+q+'".'):new M.UnexpectedResponseException(`Unexpected server response (${j}) while retrieving PDF "${q}".`,j)}function I(j){return j===200||j===206}},(lt,r,h)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.getFilenameFromContentDispositionHeader=p,h(89),h(149);var M=h(1);function p(B){let Q=!0,U=O("filename\\*","i").exec(B);if(U){U=U[1];let k=K(U);return k=unescape(k),k=f(k),k=S(k),j(k)}if(U=q(B),U){const k=S(U);return j(k)}if(U=O("filename","i").exec(B),U){U=U[1];let k=K(U);return k=S(k),j(k)}function O(k,T){return new RegExp("(?:^|;)\\s*"+k+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',T)}function I(k,T){if(k){if(!/^[\x00-\xFF]+$/.test(T))return T;try{const g=new TextDecoder(k,{fatal:!0}),F=(0,M.stringToBytes)(T);T=g.decode(F),Q=!1}catch{}}return T}function j(k){return Q&&/[\x80-\xff]/.test(k)&&(k=I("utf-8",k),Q&&(k=I("iso-8859-1",k))),k}function q(k){const T=[];let g;const F=O("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;(g=F.exec(k))!==null;){let[,v,u,m]=g;if(v=parseInt(v,10),v in T){if(v===0)break;continue}T[v]=[u,m]}const J=[];for(let v=0;v<T.length&&v in T;++v){let[u,m]=T[v];m=K(m),u&&(m=unescape(m),v===0&&(m=f(m))),J.push(m)}return J.join("")}function K(k){if(k.startsWith('"')){const T=k.slice(1).split('\\"');for(let g=0;g<T.length;++g){const F=T[g].indexOf('"');F!==-1&&(T[g]=T[g].slice(0,F),T.length=g+1),T[g]=T[g].replaceAll(/\\(.)/g,"$1")}k=T.join('"')}return k}function f(k){const T=k.indexOf("'");if(T===-1)return k;const g=k.slice(0,T),F=k.slice(T+1).replace(/^[^']*'/,"");return I(g,F)}function S(k){return!k.startsWith("=?")||/[\x00-\x19\x80-\xff]/.test(k)?k:k.replaceAll(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,function(T,g,F,J){if(F==="q"||F==="Q")return J=J.replaceAll("_"," "),J=J.replaceAll(/=([0-9a-fA-F]{2})/g,function(v,u){return String.fromCharCode(parseInt(u,16))}),I(g,J);try{J=atob(J)}catch{}return I(g,J)})}return""}},(lt,r,h)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.PDFNetworkStream=void 0,h(89);var M=h(1),p=h(182);const B=200,Q=206;function U(K){const f=K.response;return typeof f!="string"?f:(0,M.stringToBytes)(f).buffer}class O{constructor(f){let S=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.url=f,this.isHttp=/^https?:/i.test(f),this.httpHeaders=this.isHttp&&S.httpHeaders||Object.create(null),this.withCredentials=S.withCredentials||!1,this.currXhrId=0,this.pendingRequests=Object.create(null)}requestRange(f,S,k){const T={begin:f,end:S};for(const g in k)T[g]=k[g];return this.request(T)}requestFull(f){return this.request(f)}request(f){const S=new XMLHttpRequest,k=this.currXhrId++,T=this.pendingRequests[k]={xhr:S};S.open("GET",this.url),S.withCredentials=this.withCredentials;for(const g in this.httpHeaders){const F=this.httpHeaders[g];F!==void 0&&S.setRequestHeader(g,F)}return this.isHttp&&"begin"in f&&"end"in f?(S.setRequestHeader("Range",`bytes=${f.begin}-${f.end-1}`),T.expectedStatus=Q):T.expectedStatus=B,S.responseType="arraybuffer",f.onError&&(S.onerror=function(g){f.onError(S.status)}),S.onreadystatechange=this.onStateChange.bind(this,k),S.onprogress=this.onProgress.bind(this,k),T.onHeadersReceived=f.onHeadersReceived,T.onDone=f.onDone,T.onError=f.onError,T.onProgress=f.onProgress,S.send(null),k}onProgress(f,S){var k;const T=this.pendingRequests[f];T&&((k=T.onProgress)==null||k.call(T,S))}onStateChange(f,S){var k,T,g;const F=this.pendingRequests[f];if(!F)return;const J=F.xhr;if(J.readyState>=2&&F.onHeadersReceived&&(F.onHeadersReceived(),delete F.onHeadersReceived),J.readyState!==4||!(f in this.pendingRequests))return;if(delete this.pendingRequests[f],J.status===0&&this.isHttp){(k=F.onError)==null||k.call(F,J.status);return}const v=J.status||B;if(!(v===B&&F.expectedStatus===Q)&&v!==F.expectedStatus){(T=F.onError)==null||T.call(F,J.status);return}const u=U(J);if(v===Q){const m=J.getResponseHeader("Content-Range"),_=/bytes (\d+)-(\d+)\/(\d+)/.exec(m);F.onDone({begin:parseInt(_[1],10),chunk:u})}else u?F.onDone({begin:0,chunk:u}):(g=F.onError)==null||g.call(F,J.status)}getRequestXhr(f){return this.pendingRequests[f].xhr}isPendingRequest(f){return f in this.pendingRequests}abortRequest(f){const S=this.pendingRequests[f].xhr;delete this.pendingRequests[f],S.abort()}}class I{constructor(f){this._source=f,this._manager=new O(f.url,{httpHeaders:f.httpHeaders,withCredentials:f.withCredentials}),this._rangeChunkSize=f.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(f){const S=this._rangeRequestReaders.indexOf(f);S>=0&&this._rangeRequestReaders.splice(S,1)}getFullReader(){return(0,M.assert)(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new j(this._manager,this._source),this._fullRequestReader}getRangeReader(f,S){const k=new q(this._manager,f,S);return k.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(k),k}cancelAllRequests(f){var S;(S=this._fullRequestReader)==null||S.cancel(f);for(const k of this._rangeRequestReaders.slice(0))k.cancel(f)}}r.PDFNetworkStream=I;class j{constructor(f,S){this._manager=f;const k={onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=S.url,this._fullRequestId=f.requestFull(k),this._headersReceivedCapability=new M.PromiseCapability,this._disableRange=S.disableRange||!1,this._contentLength=S.length,this._rangeChunkSize=S.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._isStreamingSupported=!1,this._isRangeSupported=!1,this._cachedChunks=[],this._requests=[],this._done=!1,this._storedError=void 0,this._filename=null,this.onProgress=null}_onHeadersReceived(){const f=this._fullRequestId,S=this._manager.getRequestXhr(f),k=F=>S.getResponseHeader(F),{allowRangeRequests:T,suggestedLength:g}=(0,p.validateRangeRequestCapabilities)({getResponseHeader:k,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});T&&(this._isRangeSupported=!0),this._contentLength=g||this._contentLength,this._filename=(0,p.extractFilenameFromHeader)(k),this._isRangeSupported&&this._manager.abortRequest(f),this._headersReceivedCapability.resolve()}_onDone(f){if(f&&(this._requests.length>0?this._requests.shift().resolve({value:f.chunk,done:!1}):this._cachedChunks.push(f.chunk)),this._done=!0,!(this._cachedChunks.length>0)){for(const S of this._requests)S.resolve({value:void 0,done:!0});this._requests.length=0}}_onError(f){this._storedError=(0,p.createResponseStatusError)(f,this._url),this._headersReceivedCapability.reject(this._storedError);for(const S of this._requests)S.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0}_onProgress(f){var S;(S=this.onProgress)==null||S.call(this,{loaded:f.loaded,total:f.lengthComputable?f.total:this._contentLength})}get filename(){return this._filename}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}get contentLength(){return this._contentLength}get headersReady(){return this._headersReceivedCapability.promise}async read(){if(this._storedError)throw this._storedError;if(this._cachedChunks.length>0)return{value:this._cachedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};const f=new M.PromiseCapability;return this._requests.push(f),f.promise}cancel(f){this._done=!0,this._headersReceivedCapability.reject(f);for(const S of this._requests)S.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId),this._fullRequestReader=null}}class q{constructor(f,S,k){this._manager=f;const T={onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=f.url,this._requestId=f.requestRange(S,k,T),this._requests=[],this._queuedChunk=null,this._done=!1,this._storedError=void 0,this.onProgress=null,this.onClosed=null}_close(){var f;(f=this.onClosed)==null||f.call(this,this)}_onDone(f){const S=f.chunk;this._requests.length>0?this._requests.shift().resolve({value:S,done:!1}):this._queuedChunk=S,this._done=!0;for(const k of this._requests)k.resolve({value:void 0,done:!0});this._requests.length=0,this._close()}_onError(f){this._storedError=(0,p.createResponseStatusError)(f,this._url);for(const S of this._requests)S.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}_onProgress(f){var S;this.isStreamingSupported||(S=this.onProgress)==null||S.call(this,{loaded:f.loaded})}get isStreamingSupported(){return!1}async read(){if(this._storedError)throw this._storedError;if(this._queuedChunk!==null){const S=this._queuedChunk;return this._queuedChunk=null,{value:S,done:!1}}if(this._done)return{value:void 0,done:!0};const f=new M.PromiseCapability;return this._requests.push(f),f.promise}cancel(f){this._done=!0;for(const S of this._requests)S.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId),this._close()}}},(lt,r,h)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.PDFNodeStream=void 0,h(89),h(93),h(101),h(102),h(105),h(107),h(109),h(113),h(116),h(123);var M=h(1),p=h(182);const B=/^file:\/\/\/[a-zA-Z]:\//;function Q(k){const T=require$$6,g=T.parse(k);return g.protocol==="file:"||g.host?g:/^[a-z]:[/\\]/i.test(k)?T.parse(`file:///${k}`):(g.host||(g.protocol="file:"),g)}class U{constructor(T){this.source=T,this.url=Q(T.url),this.isHttp=this.url.protocol==="http:"||this.url.protocol==="https:",this.isFsUrl=this.url.protocol==="file:",this.httpHeaders=this.isHttp&&T.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){var T;return((T=this._fullRequestReader)==null?void 0:T._loaded)??0}getFullReader(){return(0,M.assert)(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=this.isFsUrl?new f(this):new q(this),this._fullRequestReader}getRangeReader(T,g){if(g<=this._progressiveDataLength)return null;const F=this.isFsUrl?new S(this,T,g):new K(this,T,g);return this._rangeRequestReaders.push(F),F}cancelAllRequests(T){var g;(g=this._fullRequestReader)==null||g.cancel(T);for(const F of this._rangeRequestReaders.slice(0))F.cancel(T)}}r.PDFNodeStream=U;class O{constructor(T){this._url=T.url,this._done=!1,this._storedError=null,this.onProgress=null;const g=T.source;this._contentLength=g.length,this._loaded=0,this._filename=null,this._disableRange=g.disableRange||!1,this._rangeChunkSize=g.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._isStreamingSupported=!g.disableStream,this._isRangeSupported=!g.disableRange,this._readableStream=null,this._readCapability=new M.PromiseCapability,this._headersCapability=new M.PromiseCapability}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){var T;if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const g=this._readableStream.read();return g===null?(this._readCapability=new M.PromiseCapability,this.read()):(this._loaded+=g.length,(T=this.onProgress)==null||T.call(this,{loaded:this._loaded,total:this._contentLength}),{value:new Uint8Array(g).buffer,done:!1})}cancel(T){if(!this._readableStream){this._error(T);return}this._readableStream.destroy(T)}_error(T){this._storedError=T,this._readCapability.resolve()}_setReadableStream(T){this._readableStream=T,T.on("readable",()=>{this._readCapability.resolve()}),T.on("end",()=>{T.destroy(),this._done=!0,this._readCapability.resolve()}),T.on("error",g=>{this._error(g)}),!this._isStreamingSupported&&this._isRangeSupported&&this._error(new M.AbortException("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class I{constructor(T){this._url=T.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=new M.PromiseCapability;const g=T.source;this._isStreamingSupported=!g.disableStream}get isStreamingSupported(){return this._isStreamingSupported}async read(){var T;if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const g=this._readableStream.read();return g===null?(this._readCapability=new M.PromiseCapability,this.read()):(this._loaded+=g.length,(T=this.onProgress)==null||T.call(this,{loaded:this._loaded}),{value:new Uint8Array(g).buffer,done:!1})}cancel(T){if(!this._readableStream){this._error(T);return}this._readableStream.destroy(T)}_error(T){this._storedError=T,this._readCapability.resolve()}_setReadableStream(T){this._readableStream=T,T.on("readable",()=>{this._readCapability.resolve()}),T.on("end",()=>{T.destroy(),this._done=!0,this._readCapability.resolve()}),T.on("error",g=>{this._error(g)}),this._storedError&&this._readableStream.destroy(this._storedError)}}function j(k,T){return{protocol:k.protocol,auth:k.auth,host:k.hostname,port:k.port,path:k.path,method:"GET",headers:T}}class q extends O{constructor(T){super(T);const g=F=>{if(F.statusCode===404){const m=new M.MissingPDFException(`Missing PDF "${this._url}".`);this._storedError=m,this._headersCapability.reject(m);return}this._headersCapability.resolve(),this._setReadableStream(F);const J=m=>this._readableStream.headers[m.toLowerCase()],{allowRangeRequests:v,suggestedLength:u}=(0,p.validateRangeRequestCapabilities)({getResponseHeader:J,isHttp:T.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=v,this._contentLength=u||this._contentLength,this._filename=(0,p.extractFilenameFromHeader)(J)};if(this._request=null,this._url.protocol==="http:"){const F=require$$6;this._request=F.request(j(this._url,T.httpHeaders),g)}else{const F=require$$6;this._request=F.request(j(this._url,T.httpHeaders),g)}this._request.on("error",F=>{this._storedError=F,this._headersCapability.reject(F)}),this._request.end()}}class K extends I{constructor(T,g,F){super(T),this._httpHeaders={};for(const v in T.httpHeaders){const u=T.httpHeaders[v];u!==void 0&&(this._httpHeaders[v]=u)}this._httpHeaders.Range=`bytes=${g}-${F-1}`;const J=v=>{if(v.statusCode===404){const u=new M.MissingPDFException(`Missing PDF "${this._url}".`);this._storedError=u;return}this._setReadableStream(v)};if(this._request=null,this._url.protocol==="http:"){const v=require$$6;this._request=v.request(j(this._url,this._httpHeaders),J)}else{const v=require$$6;this._request=v.request(j(this._url,this._httpHeaders),J)}this._request.on("error",v=>{this._storedError=v}),this._request.end()}}class f extends O{constructor(T){super(T);let g=decodeURIComponent(this._url.path);B.test(this._url.href)&&(g=g.replace(/^\//,""));const F=require$$6;F.lstat(g,(J,v)=>{if(J){J.code==="ENOENT"&&(J=new M.MissingPDFException(`Missing PDF "${g}".`)),this._storedError=J,this._headersCapability.reject(J);return}this._contentLength=v.size,this._setReadableStream(F.createReadStream(g)),this._headersCapability.resolve()})}}class S extends I{constructor(T,g,F){super(T);let J=decodeURIComponent(this._url.path);B.test(this._url.href)&&(J=J.replace(/^\//,""));const v=require$$6;this._setReadableStream(v.createReadStream(J,{start:g,end:F-1}))}}},(lt,r,h)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.SVGGraphics=void 0,h(84),h(86),h(87),h(93),h(101),h(102),h(105),h(107),h(109),h(113),h(116),h(123),h(2),h(89),h(187);var M=h(168),p=h(1);const B={fontStyle:"normal",fontWeight:"normal",fillColor:"#000000"},Q="http://www.w3.org/XML/1998/namespace",U="http://www.w3.org/1999/xlink",O=["butt","round","square"],I=["miter","round","bevel"],j=function(v){let u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",m=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(URL.createObjectURL&&typeof Blob<"u"&&!m)return URL.createObjectURL(new Blob([v],{type:u}));const _="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";let $=`data:${u};base64,`;for(let P=0,Zt=v.length;P<Zt;P+=3){const dt=v[P]&255,It=v[P+1]&255,xt=v[P+2]&255,it=dt>>2,Xt=(dt&3)<<4|It>>4,zt=P+1<Zt?(It&15)<<2|xt>>6:64,Gt=P+2<Zt?xt&63:64;$+=_[it]+_[Xt]+_[zt]+_[Gt]}return $},q=function(){const v=new Uint8Array([137,80,78,71,13,10,26,10]),u=12,m=new Int32Array(256);for(let xt=0;xt<256;xt++){let it=xt;for(let Xt=0;Xt<8;Xt++)it=it&1?3988292384^it>>1&2147483647:it>>1&2147483647;m[xt]=it}function _(xt,it,Xt){let zt=-1;for(let Gt=it;Gt<Xt;Gt++){const Nt=(zt^xt[Gt])&255,Ut=m[Nt];zt=zt>>>8^Ut}return zt^-1}function $(xt,it,Xt,zt){let Gt=zt;const Nt=it.length;Xt[Gt]=Nt>>24&255,Xt[Gt+1]=Nt>>16&255,Xt[Gt+2]=Nt>>8&255,Xt[Gt+3]=Nt&255,Gt+=4,Xt[Gt]=xt.charCodeAt(0)&255,Xt[Gt+1]=xt.charCodeAt(1)&255,Xt[Gt+2]=xt.charCodeAt(2)&255,Xt[Gt+3]=xt.charCodeAt(3)&255,Gt+=4,Xt.set(it,Gt),Gt+=it.length;const Ut=_(Xt,zt+4,Gt);Xt[Gt]=Ut>>24&255,Xt[Gt+1]=Ut>>16&255,Xt[Gt+2]=Ut>>8&255,Xt[Gt+3]=Ut&255}function P(xt,it,Xt){let zt=1,Gt=0;for(let Nt=it;Nt<Xt;++Nt)zt=(zt+(xt[Nt]&255))%65521,Gt=(Gt+zt)%65521;return Gt<<16|zt}function Zt(xt){if(!p.isNodeJS)return dt(xt);try{const it=parseInt(process.versions.node)>=8?xt:Buffer.from(xt),Xt=require$$6.deflateSync(it,{level:9});return Xt instanceof Uint8Array?Xt:new Uint8Array(Xt)}catch(it){(0,p.warn)("Not compressing PNG because zlib.deflateSync is unavailable: "+it)}return dt(xt)}function dt(xt){let it=xt.length;const Xt=65535,zt=Math.ceil(it/Xt),Gt=new Uint8Array(2+it+zt*5+4);let Nt=0;Gt[Nt++]=120,Gt[Nt++]=156;let Ut=0;for(;it>Xt;)Gt[Nt++]=0,Gt[Nt++]=255,Gt[Nt++]=255,Gt[Nt++]=0,Gt[Nt++]=0,Gt.set(xt.subarray(Ut,Ut+Xt),Nt),Nt+=Xt,Ut+=Xt,it-=Xt;Gt[Nt++]=1,Gt[Nt++]=it&255,Gt[Nt++]=it>>8&255,Gt[Nt++]=~it&65535&255,Gt[Nt++]=(~it&65535)>>8&255,Gt.set(xt.subarray(Ut),Nt),Nt+=xt.length-Ut;const Vt=P(xt,0,xt.length);return Gt[Nt++]=Vt>>24&255,Gt[Nt++]=Vt>>16&255,Gt[Nt++]=Vt>>8&255,Gt[Nt++]=Vt&255,Gt}function It(xt,it,Xt,zt){const Gt=xt.width,Nt=xt.height;let Ut,Vt,Ht;const Pt=xt.data;switch(it){case p.ImageKind.GRAYSCALE_1BPP:Vt=0,Ut=1,Ht=Gt+7>>3;break;case p.ImageKind.RGB_24BPP:Vt=2,Ut=8,Ht=Gt*3;break;case p.ImageKind.RGBA_32BPP:Vt=6,Ut=8,Ht=Gt*4;break;default:throw new Error("invalid format")}const at=new Uint8Array((1+Ht)*Nt);let R=0,w=0;for(let Mt=0;Mt<Nt;++Mt)at[R++]=0,at.set(Pt.subarray(w,w+Ht),R),w+=Ht,R+=Ht;if(it===p.ImageKind.GRAYSCALE_1BPP&&zt){R=0;for(let Mt=0;Mt<Nt;Mt++){R++;for(let Rt=0;Rt<Ht;Rt++)at[R++]^=255}}const X=new Uint8Array([Gt>>24&255,Gt>>16&255,Gt>>8&255,Gt&255,Nt>>24&255,Nt>>16&255,Nt>>8&255,Nt&255,Ut,Vt,0,0,0]),C=Zt(at),H=v.length+u*3+X.length+C.length,st=new Uint8Array(H);let et=0;return st.set(v,et),et+=v.length,$("IHDR",X,st,et),et+=u+X.length,$("IDATA",C,st,et),et+=u+C.length,$("IEND",new Uint8Array(0),st,et),j(st,"image/png",Xt)}return function(xt,it,Xt){const zt=xt.kind===void 0?p.ImageKind.GRAYSCALE_1BPP:xt.kind;return It(xt,zt,it,Xt)}}();class K{constructor(){this.fontSizeScale=1,this.fontWeight=B.fontWeight,this.fontSize=0,this.textMatrix=p.IDENTITY_MATRIX,this.fontMatrix=p.FONT_IDENTITY_MATRIX,this.leading=0,this.textRenderingMode=p.TextRenderingMode.FILL,this.textMatrixScale=1,this.x=0,this.y=0,this.lineX=0,this.lineY=0,this.charSpacing=0,this.wordSpacing=0,this.textHScale=1,this.textRise=0,this.fillColor=B.fillColor,this.strokeColor="#000000",this.fillAlpha=1,this.strokeAlpha=1,this.lineWidth=1,this.lineJoin="",this.lineCap="",this.miterLimit=0,this.dashArray=[],this.dashPhase=0,this.dependencies=[],this.activeClipUrl=null,this.clipGroup=null,this.maskId=""}clone(){return Object.create(this)}setCurrentPoint(u,m){this.x=u,this.y=m}}function f(v){let u=[];const m=[];for(const _ of v){if(_.fn==="save"){u.push({fnId:92,fn:"group",items:[]}),m.push(u),u=u.at(-1).items;continue}_.fn==="restore"?u=m.pop():u.push(_)}return u}function S(v){if(Number.isInteger(v))return v.toString();const u=v.toFixed(10);let m=u.length-1;if(u[m]!=="0")return u;do m--;while(u[m]==="0");return u.substring(0,u[m]==="."?m:m+1)}function k(v){if(v[4]===0&&v[5]===0){if(v[1]===0&&v[2]===0)return v[0]===1&&v[3]===1?"":`scale(${S(v[0])} ${S(v[3])})`;if(v[0]===v[3]&&v[1]===-v[2]){const u=Math.acos(v[0])*180/Math.PI;return`rotate(${S(u)})`}}else if(v[0]===1&&v[1]===0&&v[2]===0&&v[3]===1)return`translate(${S(v[4])} ${S(v[5])})`;return`matrix(${S(v[0])} ${S(v[1])} ${S(v[2])} ${S(v[3])} ${S(v[4])} ${S(v[5])})`}let T=0,g=0,F=0;class J{constructor(u,m){let _=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;(0,M.deprecated)("The SVG back-end is no longer maintained and *may* be removed in the future."),this.svgFactory=new M.DOMSVGFactory,this.current=new K,this.transformMatrix=p.IDENTITY_MATRIX,this.transformStack=[],this.extraStack=[],this.commonObjs=u,this.objs=m,this.pendingClip=null,this.pendingEOFill=!1,this.embedFonts=!1,this.embeddedFonts=Object.create(null),this.cssStyle=null,this.forceDataSchema=!!_,this._operatorIdMapping=[];for(const $ in p.OPS)this._operatorIdMapping[p.OPS[$]]=$}getObject(u){let m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return typeof u=="string"?u.startsWith("g_")?this.commonObjs.get(u):this.objs.get(u):m}save(){this.transformStack.push(this.transformMatrix);const u=this.current;this.extraStack.push(u),this.current=u.clone()}restore(){this.transformMatrix=this.transformStack.pop(),this.current=this.extraStack.pop(),this.pendingClip=null,this.tgrp=null}group(u){this.save(),this.executeOpTree(u),this.restore()}loadDependencies(u){const m=u.fnArray,_=u.argsArray;for(let $=0,P=m.length;$<P;$++)if(m[$]===p.OPS.dependency)for(const Zt of _[$]){const dt=Zt.startsWith("g_")?this.commonObjs:this.objs,It=new Promise(xt=>{dt.get(Zt,xt)});this.current.dependencies.push(It)}return Promise.all(this.current.dependencies)}transform(u,m,_,$,P,Zt){const dt=[u,m,_,$,P,Zt];this.transformMatrix=p.Util.transform(this.transformMatrix,dt),this.tgrp=null}getSVG(u,m){this.viewport=m;const _=this._initialize(m);return this.loadDependencies(u).then(()=>(this.transformMatrix=p.IDENTITY_MATRIX,this.executeOpTree(this.convertOpList(u)),_))}convertOpList(u){const m=this._operatorIdMapping,_=u.argsArray,$=u.fnArray,P=[];for(let Zt=0,dt=$.length;Zt<dt;Zt++){const It=$[Zt];P.push({fnId:It,fn:m[It],args:_[Zt]})}return f(P)}executeOpTree(u){for(const m of u){const _=m.fn,$=m.fnId,P=m.args;switch($|0){case p.OPS.beginText:this.beginText();break;case p.OPS.dependency:break;case p.OPS.setLeading:this.setLeading(P);break;case p.OPS.setLeadingMoveText:this.setLeadingMoveText(P[0],P[1]);break;case p.OPS.setFont:this.setFont(P);break;case p.OPS.showText:this.showText(P[0]);break;case p.OPS.showSpacedText:this.showText(P[0]);break;case p.OPS.endText:this.endText();break;case p.OPS.moveText:this.moveText(P[0],P[1]);break;case p.OPS.setCharSpacing:this.setCharSpacing(P[0]);break;case p.OPS.setWordSpacing:this.setWordSpacing(P[0]);break;case p.OPS.setHScale:this.setHScale(P[0]);break;case p.OPS.setTextMatrix:this.setTextMatrix(P[0],P[1],P[2],P[3],P[4],P[5]);break;case p.OPS.setTextRise:this.setTextRise(P[0]);break;case p.OPS.setTextRenderingMode:this.setTextRenderingMode(P[0]);break;case p.OPS.setLineWidth:this.setLineWidth(P[0]);break;case p.OPS.setLineJoin:this.setLineJoin(P[0]);break;case p.OPS.setLineCap:this.setLineCap(P[0]);break;case p.OPS.setMiterLimit:this.setMiterLimit(P[0]);break;case p.OPS.setFillRGBColor:this.setFillRGBColor(P[0],P[1],P[2]);break;case p.OPS.setStrokeRGBColor:this.setStrokeRGBColor(P[0],P[1],P[2]);break;case p.OPS.setStrokeColorN:this.setStrokeColorN(P);break;case p.OPS.setFillColorN:this.setFillColorN(P);break;case p.OPS.shadingFill:this.shadingFill(P[0]);break;case p.OPS.setDash:this.setDash(P[0],P[1]);break;case p.OPS.setRenderingIntent:this.setRenderingIntent(P[0]);break;case p.OPS.setFlatness:this.setFlatness(P[0]);break;case p.OPS.setGState:this.setGState(P[0]);break;case p.OPS.fill:this.fill();break;case p.OPS.eoFill:this.eoFill();break;case p.OPS.stroke:this.stroke();break;case p.OPS.fillStroke:this.fillStroke();break;case p.OPS.eoFillStroke:this.eoFillStroke();break;case p.OPS.clip:this.clip("nonzero");break;case p.OPS.eoClip:this.clip("evenodd");break;case p.OPS.paintSolidColorImageMask:this.paintSolidColorImageMask();break;case p.OPS.paintImageXObject:this.paintImageXObject(P[0]);break;case p.OPS.paintInlineImageXObject:this.paintInlineImageXObject(P[0]);break;case p.OPS.paintImageMaskXObject:this.paintImageMaskXObject(P[0]);break;case p.OPS.paintFormXObjectBegin:this.paintFormXObjectBegin(P[0],P[1]);break;case p.OPS.paintFormXObjectEnd:this.paintFormXObjectEnd();break;case p.OPS.closePath:this.closePath();break;case p.OPS.closeStroke:this.closeStroke();break;case p.OPS.closeFillStroke:this.closeFillStroke();break;case p.OPS.closeEOFillStroke:this.closeEOFillStroke();break;case p.OPS.nextLine:this.nextLine();break;case p.OPS.transform:this.transform(P[0],P[1],P[2],P[3],P[4],P[5]);break;case p.OPS.constructPath:this.constructPath(P[0],P[1]);break;case p.OPS.endPath:this.endPath();break;case 92:this.group(m.items);break;default:(0,p.warn)(`Unimplemented operator ${_}`);break}}}setWordSpacing(u){this.current.wordSpacing=u}setCharSpacing(u){this.current.charSpacing=u}nextLine(){this.moveText(0,this.current.leading)}setTextMatrix(u,m,_,$,P,Zt){const dt=this.current;dt.textMatrix=dt.lineMatrix=[u,m,_,$,P,Zt],dt.textMatrixScale=Math.hypot(u,m),dt.x=dt.lineX=0,dt.y=dt.lineY=0,dt.xcoords=[],dt.ycoords=[],dt.tspan=this.svgFactory.createElement("svg:tspan"),dt.tspan.setAttributeNS(null,"font-family",dt.fontFamily),dt.tspan.setAttributeNS(null,"font-size",`${S(dt.fontSize)}px`),dt.tspan.setAttributeNS(null,"y",S(-dt.y)),dt.txtElement=this.svgFactory.createElement("svg:text"),dt.txtElement.append(dt.tspan)}beginText(){const u=this.current;u.x=u.lineX=0,u.y=u.lineY=0,u.textMatrix=p.IDENTITY_MATRIX,u.lineMatrix=p.IDENTITY_MATRIX,u.textMatrixScale=1,u.tspan=this.svgFactory.createElement("svg:tspan"),u.txtElement=this.svgFactory.createElement("svg:text"),u.txtgrp=this.svgFactory.createElement("svg:g"),u.xcoords=[],u.ycoords=[]}moveText(u,m){const _=this.current;_.x=_.lineX+=u,_.y=_.lineY+=m,_.xcoords=[],_.ycoords=[],_.tspan=this.svgFactory.createElement("svg:tspan"),_.tspan.setAttributeNS(null,"font-family",_.fontFamily),_.tspan.setAttributeNS(null,"font-size",`${S(_.fontSize)}px`),_.tspan.setAttributeNS(null,"y",S(-_.y))}showText(u){const m=this.current,_=m.font,$=m.fontSize;if($===0)return;const P=m.fontSizeScale,Zt=m.charSpacing,dt=m.wordSpacing,It=m.fontDirection,xt=m.textHScale*It,it=_.vertical,Xt=it?1:-1,zt=_.defaultVMetrics,Gt=$*m.fontMatrix[0];let Nt=0;for(const Ht of u){if(Ht===null){Nt+=It*dt;continue}else if(typeof Ht=="number"){Nt+=Xt*Ht*$/1e3;continue}const Pt=(Ht.isSpace?dt:0)+Zt,at=Ht.fontChar;let R,w,X=Ht.width;if(it){let H;const st=Ht.vmetric||zt;H=Ht.vmetric?st[1]:X*.5,H=-H*Gt;const et=st[2]*Gt;X=st?-st[0]:X,R=H/P,w=(Nt+et)/P}else R=Nt/P,w=0;(Ht.isInFont||_.missingFile)&&(m.xcoords.push(m.x+R),it&&m.ycoords.push(-m.y+w),m.tspan.textContent+=at);const C=it?X*Gt-Pt*It:X*Gt+Pt*It;Nt+=C}m.tspan.setAttributeNS(null,"x",m.xcoords.map(S).join(" ")),it?m.tspan.setAttributeNS(null,"y",m.ycoords.map(S).join(" ")):m.tspan.setAttributeNS(null,"y",S(-m.y)),it?m.y-=Nt:m.x+=Nt*xt,m.tspan.setAttributeNS(null,"font-family",m.fontFamily),m.tspan.setAttributeNS(null,"font-size",`${S(m.fontSize)}px`),m.fontStyle!==B.fontStyle&&m.tspan.setAttributeNS(null,"font-style",m.fontStyle),m.fontWeight!==B.fontWeight&&m.tspan.setAttributeNS(null,"font-weight",m.fontWeight);const Ut=m.textRenderingMode&p.TextRenderingMode.FILL_STROKE_MASK;if(Ut===p.TextRenderingMode.FILL||Ut===p.TextRenderingMode.FILL_STROKE?(m.fillColor!==B.fillColor&&m.tspan.setAttributeNS(null,"fill",m.fillColor),m.fillAlpha<1&&m.tspan.setAttributeNS(null,"fill-opacity",m.fillAlpha)):m.textRenderingMode===p.TextRenderingMode.ADD_TO_PATH?m.tspan.setAttributeNS(null,"fill","transparent"):m.tspan.setAttributeNS(null,"fill","none"),Ut===p.TextRenderingMode.STROKE||Ut===p.TextRenderingMode.FILL_STROKE){const Ht=1/(m.textMatrixScale||1);this._setStrokeAttributes(m.tspan,Ht)}let Vt=m.textMatrix;m.textRise!==0&&(Vt=Vt.slice(),Vt[5]+=m.textRise),m.txtElement.setAttributeNS(null,"transform",`${k(Vt)} scale(${S(xt)}, -1)`),m.txtElement.setAttributeNS(Q,"xml:space","preserve"),m.txtElement.append(m.tspan),m.txtgrp.append(m.txtElement),this._ensureTransformGroup().append(m.txtElement)}setLeadingMoveText(u,m){this.setLeading(-m),this.moveText(u,m)}addFontStyle(u){if(!u.data)throw new Error('addFontStyle: No font data available, ensure that the "fontExtraProperties" API parameter is set.');this.cssStyle||(this.cssStyle=this.svgFactory.createElement("svg:style"),this.cssStyle.setAttributeNS(null,"type","text/css"),this.defs.append(this.cssStyle));const m=j(u.data,u.mimetype,this.forceDataSchema);this.cssStyle.textContent+=`@font-face { font-family: "${u.loadedName}"; src: url(${m}); }
|