From 03882d7ff17224d7bea81b89bc632661b1215479 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E5=90=8D=E5=96=9C?= Date: Tue, 29 Oct 2024 16:33:32 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8E=9F=E5=A7=8B=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 26 + README.en.md | 36 + README.md | 8 + babel.config.js | 13 + bin/build.bat | 12 + bin/package.bat | 12 + bin/run-web.bat | 12 + build/index.js | 35 + package.json | 96 + public/favicon.ico | Bin 0 -> 16958 bytes public/html/ie.html | 46 + public/index.html | 209 + public/pdf/build/pdf.js | 16425 ++++ public/pdf/build/pdf.js.map | 1 + public/pdf/build/pdf.sandbox.js | 309 + public/pdf/build/pdf.sandbox.js.map | 1 + public/pdf/build/pdf.worker.js | 74431 ++++++++++++++++ public/pdf/build/pdf.worker.js.map | 1 + public/pdf/web/cmaps/78-EUC-H.bcmap | Bin 0 -> 2404 bytes public/pdf/web/cmaps/78-EUC-V.bcmap | Bin 0 -> 173 bytes public/pdf/web/cmaps/78-H.bcmap | Bin 0 -> 2379 bytes public/pdf/web/cmaps/78-RKSJ-H.bcmap | Bin 0 -> 2398 bytes public/pdf/web/cmaps/78-RKSJ-V.bcmap | Bin 0 -> 173 bytes public/pdf/web/cmaps/78-V.bcmap | Bin 0 -> 169 bytes public/pdf/web/cmaps/78ms-RKSJ-H.bcmap | Bin 0 -> 2651 bytes public/pdf/web/cmaps/78ms-RKSJ-V.bcmap | Bin 0 -> 290 bytes public/pdf/web/cmaps/83pv-RKSJ-H.bcmap | Bin 0 -> 905 bytes public/pdf/web/cmaps/90ms-RKSJ-H.bcmap | Bin 0 -> 721 bytes public/pdf/web/cmaps/90ms-RKSJ-V.bcmap | Bin 0 -> 290 bytes public/pdf/web/cmaps/90msp-RKSJ-H.bcmap | Bin 0 -> 715 bytes public/pdf/web/cmaps/90msp-RKSJ-V.bcmap | Bin 0 -> 291 bytes public/pdf/web/cmaps/90pv-RKSJ-H.bcmap | Bin 0 -> 982 bytes public/pdf/web/cmaps/90pv-RKSJ-V.bcmap | Bin 0 -> 260 bytes public/pdf/web/cmaps/Add-H.bcmap | Bin 0 -> 2419 bytes public/pdf/web/cmaps/Add-RKSJ-H.bcmap | Bin 0 -> 2413 bytes public/pdf/web/cmaps/Add-RKSJ-V.bcmap | Bin 0 -> 287 bytes public/pdf/web/cmaps/Add-V.bcmap | Bin 0 -> 282 bytes public/pdf/web/cmaps/Adobe-CNS1-0.bcmap | Bin 0 -> 317 bytes public/pdf/web/cmaps/Adobe-CNS1-1.bcmap | Bin 0 -> 371 bytes public/pdf/web/cmaps/Adobe-CNS1-2.bcmap | Bin 0 -> 376 bytes public/pdf/web/cmaps/Adobe-CNS1-3.bcmap | Bin 0 -> 401 bytes public/pdf/web/cmaps/Adobe-CNS1-4.bcmap | Bin 0 -> 405 bytes public/pdf/web/cmaps/Adobe-CNS1-5.bcmap | Bin 0 -> 406 bytes public/pdf/web/cmaps/Adobe-CNS1-6.bcmap | Bin 0 -> 406 bytes public/pdf/web/cmaps/Adobe-CNS1-UCS2.bcmap | Bin 0 -> 41193 bytes public/pdf/web/cmaps/Adobe-GB1-0.bcmap | Bin 0 -> 217 bytes public/pdf/web/cmaps/Adobe-GB1-1.bcmap | Bin 0 -> 250 bytes public/pdf/web/cmaps/Adobe-GB1-2.bcmap | Bin 0 -> 465 bytes public/pdf/web/cmaps/Adobe-GB1-3.bcmap | Bin 0 -> 470 bytes public/pdf/web/cmaps/Adobe-GB1-4.bcmap | Bin 0 -> 601 bytes public/pdf/web/cmaps/Adobe-GB1-5.bcmap | Bin 0 -> 625 bytes public/pdf/web/cmaps/Adobe-GB1-UCS2.bcmap | Bin 0 -> 33974 bytes public/pdf/web/cmaps/Adobe-Japan1-0.bcmap | Bin 0 -> 225 bytes public/pdf/web/cmaps/Adobe-Japan1-1.bcmap | Bin 0 -> 226 bytes public/pdf/web/cmaps/Adobe-Japan1-2.bcmap | Bin 0 -> 233 bytes public/pdf/web/cmaps/Adobe-Japan1-3.bcmap | Bin 0 -> 242 bytes public/pdf/web/cmaps/Adobe-Japan1-4.bcmap | Bin 0 -> 337 bytes public/pdf/web/cmaps/Adobe-Japan1-5.bcmap | Bin 0 -> 430 bytes public/pdf/web/cmaps/Adobe-Japan1-6.bcmap | Bin 0 -> 485 bytes public/pdf/web/cmaps/Adobe-Japan1-UCS2.bcmap | Bin 0 -> 40951 bytes public/pdf/web/cmaps/Adobe-Korea1-0.bcmap | Bin 0 -> 241 bytes public/pdf/web/cmaps/Adobe-Korea1-1.bcmap | Bin 0 -> 386 bytes public/pdf/web/cmaps/Adobe-Korea1-2.bcmap | Bin 0 -> 391 bytes public/pdf/web/cmaps/Adobe-Korea1-UCS2.bcmap | Bin 0 -> 23293 bytes public/pdf/web/cmaps/B5-H.bcmap | Bin 0 -> 1086 bytes public/pdf/web/cmaps/B5-V.bcmap | Bin 0 -> 142 bytes public/pdf/web/cmaps/B5pc-H.bcmap | Bin 0 -> 1099 bytes public/pdf/web/cmaps/B5pc-V.bcmap | Bin 0 -> 144 bytes public/pdf/web/cmaps/CNS-EUC-H.bcmap | Bin 0 -> 1780 bytes public/pdf/web/cmaps/CNS-EUC-V.bcmap | Bin 0 -> 1920 bytes public/pdf/web/cmaps/CNS1-H.bcmap | Bin 0 -> 706 bytes public/pdf/web/cmaps/CNS1-V.bcmap | Bin 0 -> 143 bytes public/pdf/web/cmaps/CNS2-H.bcmap | Bin 0 -> 504 bytes public/pdf/web/cmaps/CNS2-V.bcmap | 3 + public/pdf/web/cmaps/ETHK-B5-H.bcmap | Bin 0 -> 4426 bytes public/pdf/web/cmaps/ETHK-B5-V.bcmap | Bin 0 -> 158 bytes public/pdf/web/cmaps/ETen-B5-H.bcmap | Bin 0 -> 1125 bytes public/pdf/web/cmaps/ETen-B5-V.bcmap | Bin 0 -> 158 bytes public/pdf/web/cmaps/ETenms-B5-H.bcmap | 3 + public/pdf/web/cmaps/ETenms-B5-V.bcmap | Bin 0 -> 172 bytes public/pdf/web/cmaps/EUC-H.bcmap | Bin 0 -> 578 bytes public/pdf/web/cmaps/EUC-V.bcmap | Bin 0 -> 170 bytes public/pdf/web/cmaps/Ext-H.bcmap | Bin 0 -> 2536 bytes public/pdf/web/cmaps/Ext-RKSJ-H.bcmap | Bin 0 -> 2542 bytes public/pdf/web/cmaps/Ext-RKSJ-V.bcmap | Bin 0 -> 218 bytes public/pdf/web/cmaps/Ext-V.bcmap | Bin 0 -> 215 bytes public/pdf/web/cmaps/GB-EUC-H.bcmap | Bin 0 -> 549 bytes public/pdf/web/cmaps/GB-EUC-V.bcmap | Bin 0 -> 179 bytes public/pdf/web/cmaps/GB-H.bcmap | 4 + public/pdf/web/cmaps/GB-V.bcmap | Bin 0 -> 175 bytes public/pdf/web/cmaps/GBK-EUC-H.bcmap | Bin 0 -> 14692 bytes public/pdf/web/cmaps/GBK-EUC-V.bcmap | Bin 0 -> 180 bytes public/pdf/web/cmaps/GBK2K-H.bcmap | Bin 0 -> 19662 bytes public/pdf/web/cmaps/GBK2K-V.bcmap | Bin 0 -> 219 bytes public/pdf/web/cmaps/GBKp-EUC-H.bcmap | Bin 0 -> 14686 bytes public/pdf/web/cmaps/GBKp-EUC-V.bcmap | Bin 0 -> 181 bytes public/pdf/web/cmaps/GBT-EUC-H.bcmap | Bin 0 -> 7290 bytes public/pdf/web/cmaps/GBT-EUC-V.bcmap | Bin 0 -> 180 bytes public/pdf/web/cmaps/GBT-H.bcmap | Bin 0 -> 7269 bytes public/pdf/web/cmaps/GBT-V.bcmap | Bin 0 -> 176 bytes public/pdf/web/cmaps/GBTpc-EUC-H.bcmap | Bin 0 -> 7298 bytes public/pdf/web/cmaps/GBTpc-EUC-V.bcmap | Bin 0 -> 182 bytes public/pdf/web/cmaps/GBpc-EUC-H.bcmap | Bin 0 -> 557 bytes public/pdf/web/cmaps/GBpc-EUC-V.bcmap | Bin 0 -> 181 bytes public/pdf/web/cmaps/H.bcmap | Bin 0 -> 553 bytes public/pdf/web/cmaps/HKdla-B5-H.bcmap | Bin 0 -> 2654 bytes public/pdf/web/cmaps/HKdla-B5-V.bcmap | Bin 0 -> 148 bytes public/pdf/web/cmaps/HKdlb-B5-H.bcmap | Bin 0 -> 2414 bytes public/pdf/web/cmaps/HKdlb-B5-V.bcmap | Bin 0 -> 148 bytes public/pdf/web/cmaps/HKgccs-B5-H.bcmap | Bin 0 -> 2292 bytes public/pdf/web/cmaps/HKgccs-B5-V.bcmap | Bin 0 -> 149 bytes public/pdf/web/cmaps/HKm314-B5-H.bcmap | Bin 0 -> 1772 bytes public/pdf/web/cmaps/HKm314-B5-V.bcmap | Bin 0 -> 149 bytes public/pdf/web/cmaps/HKm471-B5-H.bcmap | Bin 0 -> 2171 bytes public/pdf/web/cmaps/HKm471-B5-V.bcmap | Bin 0 -> 149 bytes public/pdf/web/cmaps/HKscs-B5-H.bcmap | Bin 0 -> 4437 bytes public/pdf/web/cmaps/HKscs-B5-V.bcmap | Bin 0 -> 159 bytes public/pdf/web/cmaps/Hankaku.bcmap | Bin 0 -> 132 bytes public/pdf/web/cmaps/Hiragana.bcmap | Bin 0 -> 124 bytes public/pdf/web/cmaps/KSC-EUC-H.bcmap | Bin 0 -> 1848 bytes public/pdf/web/cmaps/KSC-EUC-V.bcmap | Bin 0 -> 164 bytes public/pdf/web/cmaps/KSC-H.bcmap | Bin 0 -> 1831 bytes public/pdf/web/cmaps/KSC-Johab-H.bcmap | Bin 0 -> 16791 bytes public/pdf/web/cmaps/KSC-Johab-V.bcmap | Bin 0 -> 166 bytes public/pdf/web/cmaps/KSC-V.bcmap | Bin 0 -> 160 bytes public/pdf/web/cmaps/KSCms-UHC-H.bcmap | Bin 0 -> 2787 bytes public/pdf/web/cmaps/KSCms-UHC-HW-H.bcmap | Bin 0 -> 2789 bytes public/pdf/web/cmaps/KSCms-UHC-HW-V.bcmap | Bin 0 -> 169 bytes public/pdf/web/cmaps/KSCms-UHC-V.bcmap | Bin 0 -> 166 bytes public/pdf/web/cmaps/KSCpc-EUC-H.bcmap | Bin 0 -> 2024 bytes public/pdf/web/cmaps/KSCpc-EUC-V.bcmap | Bin 0 -> 166 bytes public/pdf/web/cmaps/Katakana.bcmap | Bin 0 -> 100 bytes public/pdf/web/cmaps/LICENSE | 36 + public/pdf/web/cmaps/NWP-H.bcmap | Bin 0 -> 2765 bytes public/pdf/web/cmaps/NWP-V.bcmap | Bin 0 -> 252 bytes public/pdf/web/cmaps/RKSJ-H.bcmap | Bin 0 -> 534 bytes public/pdf/web/cmaps/RKSJ-V.bcmap | Bin 0 -> 170 bytes public/pdf/web/cmaps/Roman.bcmap | Bin 0 -> 96 bytes public/pdf/web/cmaps/UniCNS-UCS2-H.bcmap | Bin 0 -> 48280 bytes public/pdf/web/cmaps/UniCNS-UCS2-V.bcmap | Bin 0 -> 156 bytes public/pdf/web/cmaps/UniCNS-UTF16-H.bcmap | Bin 0 -> 50419 bytes public/pdf/web/cmaps/UniCNS-UTF16-V.bcmap | Bin 0 -> 156 bytes public/pdf/web/cmaps/UniCNS-UTF32-H.bcmap | Bin 0 -> 52679 bytes public/pdf/web/cmaps/UniCNS-UTF32-V.bcmap | Bin 0 -> 160 bytes public/pdf/web/cmaps/UniCNS-UTF8-H.bcmap | Bin 0 -> 53629 bytes public/pdf/web/cmaps/UniCNS-UTF8-V.bcmap | Bin 0 -> 157 bytes public/pdf/web/cmaps/UniGB-UCS2-H.bcmap | Bin 0 -> 43366 bytes public/pdf/web/cmaps/UniGB-UCS2-V.bcmap | Bin 0 -> 193 bytes public/pdf/web/cmaps/UniGB-UTF16-H.bcmap | Bin 0 -> 44086 bytes public/pdf/web/cmaps/UniGB-UTF16-V.bcmap | Bin 0 -> 178 bytes public/pdf/web/cmaps/UniGB-UTF32-H.bcmap | Bin 0 -> 45738 bytes public/pdf/web/cmaps/UniGB-UTF32-V.bcmap | Bin 0 -> 182 bytes public/pdf/web/cmaps/UniGB-UTF8-H.bcmap | Bin 0 -> 46837 bytes public/pdf/web/cmaps/UniGB-UTF8-V.bcmap | Bin 0 -> 181 bytes public/pdf/web/cmaps/UniJIS-UCS2-H.bcmap | Bin 0 -> 25439 bytes public/pdf/web/cmaps/UniJIS-UCS2-HW-H.bcmap | Bin 0 -> 119 bytes public/pdf/web/cmaps/UniJIS-UCS2-HW-V.bcmap | Bin 0 -> 680 bytes public/pdf/web/cmaps/UniJIS-UCS2-V.bcmap | Bin 0 -> 664 bytes public/pdf/web/cmaps/UniJIS-UTF16-H.bcmap | Bin 0 -> 39443 bytes public/pdf/web/cmaps/UniJIS-UTF16-V.bcmap | Bin 0 -> 643 bytes public/pdf/web/cmaps/UniJIS-UTF32-H.bcmap | Bin 0 -> 40539 bytes public/pdf/web/cmaps/UniJIS-UTF32-V.bcmap | Bin 0 -> 677 bytes public/pdf/web/cmaps/UniJIS-UTF8-H.bcmap | Bin 0 -> 41695 bytes public/pdf/web/cmaps/UniJIS-UTF8-V.bcmap | Bin 0 -> 678 bytes public/pdf/web/cmaps/UniJIS2004-UTF16-H.bcmap | Bin 0 -> 39534 bytes public/pdf/web/cmaps/UniJIS2004-UTF16-V.bcmap | Bin 0 -> 647 bytes public/pdf/web/cmaps/UniJIS2004-UTF32-H.bcmap | Bin 0 -> 40630 bytes public/pdf/web/cmaps/UniJIS2004-UTF32-V.bcmap | Bin 0 -> 681 bytes public/pdf/web/cmaps/UniJIS2004-UTF8-H.bcmap | Bin 0 -> 41779 bytes public/pdf/web/cmaps/UniJIS2004-UTF8-V.bcmap | Bin 0 -> 682 bytes .../pdf/web/cmaps/UniJISPro-UCS2-HW-V.bcmap | Bin 0 -> 705 bytes public/pdf/web/cmaps/UniJISPro-UCS2-V.bcmap | Bin 0 -> 689 bytes public/pdf/web/cmaps/UniJISPro-UTF8-V.bcmap | Bin 0 -> 726 bytes .../pdf/web/cmaps/UniJISX0213-UTF32-H.bcmap | Bin 0 -> 40517 bytes .../pdf/web/cmaps/UniJISX0213-UTF32-V.bcmap | Bin 0 -> 684 bytes .../web/cmaps/UniJISX02132004-UTF32-H.bcmap | Bin 0 -> 40608 bytes .../web/cmaps/UniJISX02132004-UTF32-V.bcmap | Bin 0 -> 688 bytes public/pdf/web/cmaps/UniKS-UCS2-H.bcmap | Bin 0 -> 25783 bytes public/pdf/web/cmaps/UniKS-UCS2-V.bcmap | Bin 0 -> 178 bytes public/pdf/web/cmaps/UniKS-UTF16-H.bcmap | Bin 0 -> 26327 bytes public/pdf/web/cmaps/UniKS-UTF16-V.bcmap | Bin 0 -> 164 bytes public/pdf/web/cmaps/UniKS-UTF32-H.bcmap | Bin 0 -> 26451 bytes public/pdf/web/cmaps/UniKS-UTF32-V.bcmap | Bin 0 -> 168 bytes public/pdf/web/cmaps/UniKS-UTF8-H.bcmap | Bin 0 -> 27790 bytes public/pdf/web/cmaps/UniKS-UTF8-V.bcmap | Bin 0 -> 169 bytes public/pdf/web/cmaps/V.bcmap | Bin 0 -> 166 bytes public/pdf/web/cmaps/WP-Symbol.bcmap | Bin 0 -> 179 bytes .../web/compressed.tracemonkey-pldi-09.pdf | Bin 0 -> 1016315 bytes public/pdf/web/debugger.css | 103 + public/pdf/web/debugger.js | 621 + public/pdf/web/images/annotation-check.svg | 11 + public/pdf/web/images/annotation-comment.svg | 16 + public/pdf/web/images/annotation-help.svg | 26 + public/pdf/web/images/annotation-insert.svg | 10 + public/pdf/web/images/annotation-key.svg | 11 + .../web/images/annotation-newparagraph.svg | 11 + public/pdf/web/images/annotation-noicon.svg | 7 + public/pdf/web/images/annotation-note.svg | 42 + .../pdf/web/images/annotation-paragraph.svg | 16 + public/pdf/web/images/findbarButton-next.svg | 4 + .../pdf/web/images/findbarButton-previous.svg | 4 + public/pdf/web/images/loading-dark.svg | 24 + public/pdf/web/images/loading-icon.gif | Bin 0 -> 2545 bytes public/pdf/web/images/loading.svg | 1 + ...ondaryToolbarButton-documentProperties.svg | 15 + .../secondaryToolbarButton-firstPage.svg | 1 + .../secondaryToolbarButton-handTool.svg | 1 + .../secondaryToolbarButton-lastPage.svg | 1 + .../secondaryToolbarButton-rotateCcw.svg | 1 + .../secondaryToolbarButton-rotateCw.svg | 4 + ...econdaryToolbarButton-scrollHorizontal.svg | 1 + .../secondaryToolbarButton-scrollPage.svg | 1 + .../secondaryToolbarButton-scrollVertical.svg | 1 + .../secondaryToolbarButton-scrollWrapped.svg | 1 + .../secondaryToolbarButton-selectTool.svg | 4 + .../secondaryToolbarButton-spreadEven.svg | 1 + .../secondaryToolbarButton-spreadNone.svg | 1 + .../secondaryToolbarButton-spreadOdd.svg | 1 + public/pdf/web/images/shadow.png | Bin 0 -> 269 bytes .../pdf/web/images/toolbarButton-bookmark.svg | 1 + .../toolbarButton-currentOutlineItem.svg | 1 + .../pdf/web/images/toolbarButton-download.svg | 4 + .../web/images/toolbarButton-menuArrow.svg | 1 + .../pdf/web/images/toolbarButton-openFile.svg | 4 + .../pdf/web/images/toolbarButton-pageDown.svg | 7 + .../pdf/web/images/toolbarButton-pageUp.svg | 12 + .../images/toolbarButton-presentationMode.svg | 1 + public/pdf/web/images/toolbarButton-print.svg | 4 + .../pdf/web/images/toolbarButton-search.svg | 4 + .../toolbarButton-secondaryToolbarToggle.svg | 4 + .../images/toolbarButton-sidebarToggle.svg | 4 + .../images/toolbarButton-viewAttachments.svg | 1 + .../web/images/toolbarButton-viewLayers.svg | 1 + .../web/images/toolbarButton-viewOutline.svg | 1 + .../images/toolbarButton-viewThumbnail.svg | 4 + .../pdf/web/images/toolbarButton-zoomIn.svg | 4 + .../pdf/web/images/toolbarButton-zoomOut.svg | 4 + public/pdf/web/images/treeitem-collapsed.svg | 1 + public/pdf/web/images/treeitem-expanded.svg | 1 + public/pdf/web/locale/ach/viewer.properties | 199 + public/pdf/web/locale/af/viewer.properties | 176 + public/pdf/web/locale/an/viewer.properties | 242 + public/pdf/web/locale/ar/viewer.properties | 246 + public/pdf/web/locale/ast/viewer.properties | 207 + public/pdf/web/locale/az/viewer.properties | 242 + public/pdf/web/locale/be/viewer.properties | 251 + public/pdf/web/locale/bg/viewer.properties | 234 + public/pdf/web/locale/bn/viewer.properties | 236 + public/pdf/web/locale/bo/viewer.properties | 237 + public/pdf/web/locale/br/viewer.properties | 246 + public/pdf/web/locale/brx/viewer.properties | 204 + public/pdf/web/locale/bs/viewer.properties | 193 + public/pdf/web/locale/ca/viewer.properties | 250 + public/pdf/web/locale/cak/viewer.properties | 248 + public/pdf/web/locale/ckb/viewer.properties | 233 + public/pdf/web/locale/cs/viewer.properties | 251 + public/pdf/web/locale/cy/viewer.properties | 251 + public/pdf/web/locale/da/viewer.properties | 251 + public/pdf/web/locale/de/viewer.properties | 251 + public/pdf/web/locale/dsb/viewer.properties | 251 + public/pdf/web/locale/el/viewer.properties | 251 + public/pdf/web/locale/en-CA/viewer.properties | 251 + public/pdf/web/locale/en-GB/viewer.properties | 251 + public/pdf/web/locale/en-US/viewer.properties | 251 + public/pdf/web/locale/eo/viewer.properties | 251 + public/pdf/web/locale/es-AR/viewer.properties | 251 + public/pdf/web/locale/es-CL/viewer.properties | 251 + public/pdf/web/locale/es-ES/viewer.properties | 251 + public/pdf/web/locale/es-MX/viewer.properties | 251 + public/pdf/web/locale/et/viewer.properties | 251 + public/pdf/web/locale/eu/viewer.properties | 251 + public/pdf/web/locale/fa/viewer.properties | 215 + public/pdf/web/locale/ff/viewer.properties | 234 + public/pdf/web/locale/fi/viewer.properties | 250 + public/pdf/web/locale/fr/viewer.properties | 251 + public/pdf/web/locale/fy-NL/viewer.properties | 251 + public/pdf/web/locale/ga-IE/viewer.properties | 201 + public/pdf/web/locale/gd/viewer.properties | 248 + public/pdf/web/locale/gl/viewer.properties | 248 + public/pdf/web/locale/gn/viewer.properties | 251 + public/pdf/web/locale/gu-IN/viewer.properties | 234 + public/pdf/web/locale/he/viewer.properties | 250 + public/pdf/web/locale/hi-IN/viewer.properties | 234 + public/pdf/web/locale/hr/viewer.properties | 248 + public/pdf/web/locale/hsb/viewer.properties | 251 + public/pdf/web/locale/hu/viewer.properties | 251 + public/pdf/web/locale/hy-AM/viewer.properties | 238 + public/pdf/web/locale/hye/viewer.properties | 251 + public/pdf/web/locale/ia/viewer.properties | 251 + public/pdf/web/locale/id/viewer.properties | 251 + public/pdf/web/locale/is/viewer.properties | 251 + public/pdf/web/locale/it/viewer.properties | 193 + public/pdf/web/locale/ja/viewer.properties | 251 + public/pdf/web/locale/ka/viewer.properties | 251 + public/pdf/web/locale/kab/viewer.properties | 251 + public/pdf/web/locale/kk/viewer.properties | 251 + public/pdf/web/locale/km/viewer.properties | 209 + public/pdf/web/locale/kn/viewer.properties | 186 + public/pdf/web/locale/ko/viewer.properties | 251 + public/pdf/web/locale/lij/viewer.properties | 234 + public/pdf/web/locale/lo/viewer.properties | 145 + public/pdf/web/locale/locale.properties | 327 + public/pdf/web/locale/lt/viewer.properties | 250 + public/pdf/web/locale/ltg/viewer.properties | 212 + public/pdf/web/locale/lv/viewer.properties | 234 + public/pdf/web/locale/meh/viewer.properties | 111 + public/pdf/web/locale/mk/viewer.properties | 138 + public/pdf/web/locale/mr/viewer.properties | 230 + public/pdf/web/locale/ms/viewer.properties | 234 + public/pdf/web/locale/my/viewer.properties | 190 + public/pdf/web/locale/nb-NO/viewer.properties | 251 + public/pdf/web/locale/ne-NP/viewer.properties | 217 + public/pdf/web/locale/nl/viewer.properties | 251 + public/pdf/web/locale/nn-NO/viewer.properties | 251 + public/pdf/web/locale/oc/viewer.properties | 251 + public/pdf/web/locale/pa-IN/viewer.properties | 251 + public/pdf/web/locale/pl/viewer.properties | 251 + public/pdf/web/locale/pt-BR/viewer.properties | 251 + public/pdf/web/locale/pt-PT/viewer.properties | 251 + public/pdf/web/locale/rm/viewer.properties | 251 + public/pdf/web/locale/ro/viewer.properties | 240 + public/pdf/web/locale/ru/viewer.properties | 251 + public/pdf/web/locale/sat/viewer.properties | 197 + public/pdf/web/locale/sc/viewer.properties | 237 + public/pdf/web/locale/scn/viewer.properties | 101 + public/pdf/web/locale/sco/viewer.properties | 248 + public/pdf/web/locale/si/viewer.properties | 201 + public/pdf/web/locale/sk/viewer.properties | 251 + public/pdf/web/locale/sl/viewer.properties | 251 + public/pdf/web/locale/son/viewer.properties | 172 + public/pdf/web/locale/sq/viewer.properties | 244 + public/pdf/web/locale/sr/viewer.properties | 250 + public/pdf/web/locale/sv-SE/viewer.properties | 251 + public/pdf/web/locale/szl/viewer.properties | 244 + public/pdf/web/locale/ta/viewer.properties | 193 + public/pdf/web/locale/te/viewer.properties | 217 + public/pdf/web/locale/tg/viewer.properties | 164 + public/pdf/web/locale/th/viewer.properties | 251 + public/pdf/web/locale/tl/viewer.properties | 242 + public/pdf/web/locale/tr/viewer.properties | 251 + public/pdf/web/locale/trs/viewer.properties | 206 + public/pdf/web/locale/uk/viewer.properties | 251 + public/pdf/web/locale/ur/viewer.properties | 238 + public/pdf/web/locale/uz/viewer.properties | 162 + public/pdf/web/locale/vi/viewer.properties | 251 + public/pdf/web/locale/wo/viewer.properties | 122 + public/pdf/web/locale/xh/viewer.properties | 176 + public/pdf/web/locale/zh-CN/viewer.properties | 251 + public/pdf/web/locale/zh-TW/viewer.properties | 251 + .../pdf/web/standard_fonts/FoxitDingbats.pfb | Bin 0 -> 29513 bytes public/pdf/web/standard_fonts/FoxitFixed.pfb | Bin 0 -> 17597 bytes .../pdf/web/standard_fonts/FoxitFixedBold.pfb | Bin 0 -> 18055 bytes .../standard_fonts/FoxitFixedBoldItalic.pfb | Bin 0 -> 19151 bytes .../web/standard_fonts/FoxitFixedItalic.pfb | Bin 0 -> 18746 bytes public/pdf/web/standard_fonts/FoxitSans.pfb | Bin 0 -> 15025 bytes .../pdf/web/standard_fonts/FoxitSansBold.pfb | Bin 0 -> 16344 bytes .../standard_fonts/FoxitSansBoldItalic.pfb | Bin 0 -> 16418 bytes .../web/standard_fonts/FoxitSansItalic.pfb | Bin 0 -> 16339 bytes public/pdf/web/standard_fonts/FoxitSerif.pfb | Bin 0 -> 19469 bytes .../pdf/web/standard_fonts/FoxitSerifBold.pfb | Bin 0 -> 19395 bytes .../standard_fonts/FoxitSerifBoldItalic.pfb | Bin 0 -> 20733 bytes .../web/standard_fonts/FoxitSerifItalic.pfb | Bin 0 -> 21227 bytes public/pdf/web/standard_fonts/FoxitSymbol.pfb | Bin 0 -> 16729 bytes public/pdf/web/standard_fonts/LICENSE_FOXIT | 27 + .../pdf/web/standard_fonts/LICENSE_LIBERATION | 102 + .../standard_fonts/LiberationSans-Bold.ttf | Bin 0 -> 137052 bytes .../LiberationSans-BoldItalic.ttf | Bin 0 -> 135124 bytes .../standard_fonts/LiberationSans-Italic.ttf | Bin 0 -> 162036 bytes .../standard_fonts/LiberationSans-Regular.ttf | Bin 0 -> 139512 bytes public/pdf/web/viewer.css | 2685 + public/pdf/web/viewer.html | 416 + public/pdf/web/viewer.js | 15590 ++++ public/pdf/web/viewer.js.map | 1 + public/print-lock.css | 339 + public/robots.txt | 2 + src/App.vue | 19 + src/api/login.js | 59 + src/api/menu.js | 9 + src/api/mes/cal/calendar.js | 9 + src/api/mes/cal/calholiday.js | 44 + src/api/mes/cal/calplan.js | 44 + src/api/mes/cal/planteam.js | 27 + src/api/mes/cal/shift.js | 44 + src/api/mes/cal/team.js | 52 + src/api/mes/cal/teammember.js | 35 + src/api/mes/dv/checkmachinery.js | 44 + src/api/mes/dv/checkplan.js | 44 + src/api/mes/dv/checksubject.js | 44 + src/api/mes/dv/dvsubject.js | 44 + src/api/mes/dv/machinery.js | 44 + src/api/mes/dv/machinerytype.js | 44 + src/api/mes/dv/repair.js | 44 + src/api/mes/dv/repairline.js | 44 + src/api/mes/md/bom.js | 44 + src/api/mes/md/client.js | 44 + src/api/mes/md/itemtype.js | 61 + src/api/mes/md/mdItem.js | 44 + src/api/mes/md/sip.js | 44 + src/api/mes/md/sop.js | 44 + src/api/mes/md/unitmeasure.js | 58 + src/api/mes/md/vendor.js | 44 + src/api/mes/md/workshop.js | 51 + src/api/mes/md/workstation.js | 44 + src/api/mes/md/workstationmachine.js | 44 + src/api/mes/md/workstationtool.js | 44 + src/api/mes/md/workstationworker.js | 44 + src/api/mes/pro/feedback.js | 51 + src/api/mes/pro/process.js | 53 + src/api/mes/pro/processcontent.js | 44 + src/api/mes/pro/proroute.js | 44 + src/api/mes/pro/protask.js | 63 + src/api/mes/pro/routeprocess.js | 54 + src/api/mes/pro/routeproduct.js | 53 + src/api/mes/pro/routeproductbom.js | 44 + src/api/mes/pro/workorder.js | 69 + src/api/mes/pro/workorderbom.js | 44 + src/api/mes/qc/defectrecord.js | 44 + src/api/mes/qc/ipqc.js | 44 + src/api/mes/qc/ipqcline.js | 44 + src/api/mes/qc/iqc.js | 44 + src/api/mes/qc/iqcline.js | 44 + src/api/mes/qc/oqc.js | 44 + src/api/mes/qc/oqcline.js | 44 + src/api/mes/qc/pending.js | 11 + src/api/mes/qc/qcdefect.js | 44 + src/api/mes/qc/qcindex.js | 44 + src/api/mes/qc/qctemplate.js | 44 + src/api/mes/qc/templateindex.js | 44 + src/api/mes/qc/templateproduct.js | 44 + src/api/mes/report/report.js | 19 + src/api/mes/report/ureport.js | 44 + src/api/mes/tm/tool.js | 44 + src/api/mes/tm/tooltype.js | 52 + src/api/mes/wm/area.js | 57 + src/api/mes/wm/barcode.js | 54 + src/api/mes/wm/barcodeconfig.js | 45 + src/api/mes/wm/issueheader.js | 52 + src/api/mes/wm/issueline.js | 44 + src/api/mes/wm/itemconsume.js | 44 + src/api/mes/wm/itemconsumeline.js | 44 + src/api/mes/wm/itemrecpt.js | 62 + src/api/mes/wm/itemrecptline.js | 44 + src/api/mes/wm/location.js | 57 + src/api/mes/wm/oursourcerecptline.js | 44 + src/api/mes/wm/outsourceissue.js | 52 + src/api/mes/wm/outsourceissueline.js | 44 + src/api/mes/wm/outsourcerecpt.js | 53 + src/api/mes/wm/package.js | 53 + src/api/mes/wm/packageline.js | 44 + src/api/mes/wm/productproduce.js | 44 + src/api/mes/wm/productproduceline.js | 44 + src/api/mes/wm/productrecpt.js | 52 + src/api/mes/wm/productrecptline.js | 44 + src/api/mes/wm/productsalse.js | 52 + src/api/mes/wm/productsalseline.js | 44 + src/api/mes/wm/rtissue.js | 51 + src/api/mes/wm/rtissueline.js | 44 + src/api/mes/wm/rtsalse.js | 51 + src/api/mes/wm/rtsalseline.js | 44 + src/api/mes/wm/rtvendor.js | 52 + src/api/mes/wm/rtvendorline.js | 44 + src/api/mes/wm/sn.js | 52 + src/api/mes/wm/stocktaking.js | 52 + src/api/mes/wm/stocktakingline.js | 44 + src/api/mes/wm/stocktakingresult.js | 44 + src/api/mes/wm/transfer.js | 52 + src/api/mes/wm/transferline.js | 44 + src/api/mes/wm/warehouse.js | 64 + src/api/mes/wm/wmstock.js | 57 + src/api/monitor/cache.js | 9 + src/api/monitor/job.js | 71 + src/api/monitor/jobLog.js | 26 + src/api/monitor/logininfor.js | 26 + src/api/monitor/online.js | 18 + src/api/monitor/operlog.js | 26 + src/api/monitor/server.js | 9 + src/api/print/printerconfig.js | 44 + src/api/print/template.js | 53 + src/api/system/autocode/part.js | 45 + src/api/system/autocode/rule.js | 51 + src/api/system/config.js | 60 + src/api/system/dept.js | 68 + src/api/system/dict/data.js | 52 + src/api/system/dict/type.js | 60 + src/api/system/menu.js | 60 + src/api/system/message.js | 44 + src/api/system/notice.js | 44 + src/api/system/post.js | 52 + src/api/system/role.js | 111 + src/api/system/user.js | 127 + src/api/tool/gen.js | 76 + src/assets/401_images/401.gif | Bin 0 -> 164227 bytes src/assets/404_images/404.png | Bin 0 -> 98071 bytes src/assets/404_images/404_cloud.png | Bin 0 -> 4766 bytes src/assets/icons/index.js | 9 + src/assets/icons/svg/404.svg | 1 + src/assets/icons/svg/add.svg | 1 + src/assets/icons/svg/alignBottom.svg | 1 + src/assets/icons/svg/alignCenter.svg | 1 + src/assets/icons/svg/alignLeft.svg | 1 + src/assets/icons/svg/alignRight.svg | 1 + src/assets/icons/svg/alignTop.svg | 1 + src/assets/icons/svg/barcode.svg | 3 + src/assets/icons/svg/bug.svg | 1 + src/assets/icons/svg/build.svg | 1 + src/assets/icons/svg/button.svg | 1 + src/assets/icons/svg/cascader.svg | 1 + src/assets/icons/svg/chart.svg | 1 + src/assets/icons/svg/checkbox.svg | 1 + src/assets/icons/svg/circle.svg | 1 + src/assets/icons/svg/clientcode.svg | 1 + src/assets/icons/svg/clientname.svg | 1 + src/assets/icons/svg/clipboard.svg | 1 + src/assets/icons/svg/code.svg | 1 + src/assets/icons/svg/color.svg | 1 + src/assets/icons/svg/component.svg | 1 + src/assets/icons/svg/dashboard.svg | 1 + src/assets/icons/svg/date-range.svg | 1 + src/assets/icons/svg/date.svg | 1 + src/assets/icons/svg/device.svg | 3 + src/assets/icons/svg/dict.svg | 1 + src/assets/icons/svg/documentation.svg | 1 + src/assets/icons/svg/download.svg | 1 + src/assets/icons/svg/drag.svg | 1 + src/assets/icons/svg/druid.svg | 1 + src/assets/icons/svg/edit.svg | 1 + src/assets/icons/svg/education.svg | 1 + src/assets/icons/svg/email.svg | 1 + src/assets/icons/svg/example.svg | 1 + src/assets/icons/svg/excel.svg | 1 + src/assets/icons/svg/exit-fullscreen.svg | 1 + src/assets/icons/svg/eye-open.svg | 1 + src/assets/icons/svg/eye.svg | 1 + src/assets/icons/svg/fault.svg | 3 + src/assets/icons/svg/form.svg | 1 + src/assets/icons/svg/fullscreen.svg | 1 + src/assets/icons/svg/github.svg | 1 + src/assets/icons/svg/guide.svg | 1 + src/assets/icons/svg/hline.svg | 1 + src/assets/icons/svg/horizontal.svg | 1 + src/assets/icons/svg/icon.svg | 1 + src/assets/icons/svg/input.svg | 1 + src/assets/icons/svg/international.svg | 1 + src/assets/icons/svg/issue.svg | 3 + src/assets/icons/svg/itemcode.svg | 1 + src/assets/icons/svg/itemname.svg | 1 + src/assets/icons/svg/job.svg | 1 + src/assets/icons/svg/language.svg | 1 + src/assets/icons/svg/link.svg | 1 + src/assets/icons/svg/list.svg | 1 + src/assets/icons/svg/lock.svg | 1 + src/assets/icons/svg/log.svg | 1 + src/assets/icons/svg/logininfor.svg | 1 + src/assets/icons/svg/message.svg | 1 + src/assets/icons/svg/money.svg | 1 + src/assets/icons/svg/monitor.svg | 2 + src/assets/icons/svg/nested.svg | 1 + src/assets/icons/svg/number.svg | 1 + src/assets/icons/svg/online.svg | 1 + src/assets/icons/svg/password.svg | 1 + src/assets/icons/svg/pdf.svg | 1 + src/assets/icons/svg/people.svg | 1 + src/assets/icons/svg/peoples.svg | 1 + src/assets/icons/svg/phone.svg | 1 + src/assets/icons/svg/picture.svg | 1 + src/assets/icons/svg/post.svg | 1 + src/assets/icons/svg/qc.svg | 3 + src/assets/icons/svg/qq.svg | 1 + src/assets/icons/svg/qrcode.svg | 1 + src/assets/icons/svg/question.svg | 1 + src/assets/icons/svg/radio.svg | 1 + src/assets/icons/svg/rate.svg | 1 + src/assets/icons/svg/rect.svg | 1 + src/assets/icons/svg/redis.svg | 1 + src/assets/icons/svg/resizeHorizontal.svg | 1 + src/assets/icons/svg/resizeVertical.svg | 1 + src/assets/icons/svg/row.svg | 1 + src/assets/icons/svg/running.svg | 3 + src/assets/icons/svg/search.svg | 1 + src/assets/icons/svg/select.svg | 1 + src/assets/icons/svg/server.svg | 1 + src/assets/icons/svg/shopping.svg | 1 + src/assets/icons/svg/size.svg | 1 + src/assets/icons/svg/skill.svg | 1 + src/assets/icons/svg/slider.svg | 1 + src/assets/icons/svg/star.svg | 1 + src/assets/icons/svg/swagger.svg | 1 + src/assets/icons/svg/switch.svg | 1 + src/assets/icons/svg/system.svg | 2 + src/assets/icons/svg/tab.svg | 1 + src/assets/icons/svg/table.svg | 1 + src/assets/icons/svg/text.svg | 1 + src/assets/icons/svg/textarea.svg | 1 + src/assets/icons/svg/theme.svg | 1 + src/assets/icons/svg/time-range.svg | 1 + src/assets/icons/svg/time.svg | 1 + src/assets/icons/svg/tool.svg | 1 + src/assets/icons/svg/tree-table.svg | 1 + src/assets/icons/svg/tree.svg | 1 + src/assets/icons/svg/upload.svg | 1 + src/assets/icons/svg/user.svg | 1 + src/assets/icons/svg/validCode.svg | 1 + src/assets/icons/svg/vendorcode.svg | 1 + src/assets/icons/svg/vendorname.svg | 1 + src/assets/icons/svg/vline.svg | 1 + src/assets/icons/svg/waitting.svg | 3 + src/assets/icons/svg/warehouse.svg | 3 + src/assets/icons/svg/wechat.svg | 1 + src/assets/icons/svg/workordercode.svg | 1 + src/assets/icons/svg/workordername.svg | 1 + src/assets/icons/svg/zip.svg | 1 + src/assets/icons/svgo.yml | 22 + src/assets/images/accept.png | Bin 0 -> 3035 bytes src/assets/images/dark.svg | 39 + src/assets/images/light.svg | 39 + src/assets/images/login-background.jpg | Bin 0 -> 521275 bytes src/assets/images/prepare.png | Bin 0 -> 2672 bytes src/assets/images/profile.jpg | Bin 0 -> 81131 bytes src/assets/images/reject.png | Bin 0 -> 3180 bytes src/assets/logo/logo.png | Bin 0 -> 30885 bytes src/assets/styles/btn.scss | 99 + src/assets/styles/element-ui.scss | 92 + src/assets/styles/element-variables.scss | 31 + src/assets/styles/index.scss | 191 + src/assets/styles/mixin.scss | 66 + src/assets/styles/ruoyi.scss | 273 + src/assets/styles/sidebar.scss | 227 + src/assets/styles/transition.scss | 48 + src/assets/styles/variables.scss | 54 + src/components/Breadcrumb/index.vue | 74 + src/components/Crontab/day.vue | 161 + src/components/Crontab/hour.vue | 114 + src/components/Crontab/index.vue | 430 + src/components/Crontab/min.vue | 116 + src/components/Crontab/month.vue | 114 + src/components/Crontab/result.vue | 559 + src/components/Crontab/second.vue | 117 + src/components/Crontab/week.vue | 202 + src/components/Crontab/year.vue | 131 + src/components/DictData/index.js | 21 + src/components/DictTag/index.vue | 52 + src/components/Editor/index.vue | 272 + src/components/FileUpload/index.vue | 209 + src/components/Hamburger/index.vue | 44 + src/components/HeaderSearch/index.vue | 190 + src/components/IconSelect/index.vue | 68 + src/components/IconSelect/requireIcons.js | 11 + src/components/ImagePreview/index.vue | 84 + src/components/ImageUpload/index.vue | 212 + src/components/Pagination/index.vue | 114 + src/components/PanThumb/index.vue | 142 + src/components/ParentView/index.vue | 3 + src/components/RightPanel/index.vue | 149 + src/components/RightToolbar/index.vue | 87 + src/components/RuoYi/Doc/index.vue | 21 + src/components/RuoYi/Git/index.vue | 21 + src/components/Screenfull/index.vue | 57 + src/components/SizeSelect/index.vue | 56 + src/components/SvgIcon/index.vue | 61 + .../TaskSelect/taskSelectSingle.vue | 280 + src/components/ThemePicker/index.vue | 173 + src/components/TopNav/index.vue | 181 + src/components/barcodeImg/index.vue | 85 + src/components/calTeamSelect/multi.vue | 132 + src/components/clientSelect/single.vue | 223 + src/components/defectSelect/single.vue | 223 + src/components/dvsubjectSelect/multi.vue | 158 + src/components/iFrame/index.vue | 36 + src/components/iqcSelect/single.vue | 230 + src/components/itemBomSelect/single.vue | 137 + src/components/itemSelect/index.vue | 223 + src/components/itemSelect/single.vue | 238 + src/components/machinerySelect/index.vue | 252 + src/components/machinerySelect/single.vue | 268 + src/components/oqcSelect/single.vue | 241 + src/components/package/single.vue | 247 + src/components/qcindexSelect/single.vue | 187 + src/components/reportSelect/single.vue | 170 + src/components/stockSelect/multi.vue | 261 + src/components/stockSelect/single.vue | 323 + src/components/userSelect/multi.vue | 242 + src/components/userSelect/single.vue | 258 + src/components/vendorSelect/single.vue | 231 + src/components/workorderSelect/single.vue | 217 + .../workstationSelect/simpletableSingle.vue | 240 + src/config/website.js | 9 + src/directive/dialog/drag.js | 64 + src/directive/dialog/dragHeight.js | 34 + src/directive/dialog/dragWidth.js | 30 + src/directive/index.js | 23 + src/directive/module/clipboard.js | 54 + src/directive/permission/hasPermi.js | 28 + src/directive/permission/hasRole.js | 28 + src/layout/components/AppMain.vue | 57 + src/layout/components/InnerLink/index.vue | 27 + src/layout/components/Navbar.vue | 200 + src/layout/components/Settings/index.vue | 257 + src/layout/components/Sidebar/FixiOSBug.js | 25 + src/layout/components/Sidebar/Item.vue | 33 + src/layout/components/Sidebar/Link.vue | 43 + src/layout/components/Sidebar/Logo.vue | 93 + src/layout/components/Sidebar/SidebarItem.vue | 100 + src/layout/components/Sidebar/index.vue | 57 + src/layout/components/TagsView/ScrollPane.vue | 94 + src/layout/components/TagsView/index.vue | 326 + src/layout/components/index.js | 5 + src/layout/index.vue | 111 + src/layout/mixin/ResizeHandler.js | 45 + src/main.js | 92 + src/permission.js | 56 + src/plugins/auth.js | 60 + src/plugins/cache.js | 77 + src/plugins/download.js | 72 + src/plugins/index.js | 20 + src/plugins/modal.js | 83 + src/plugins/tab.js | 67 + src/router/index.js | 276 + src/settings.js | 44 + src/store/getters.js | 18 + src/store/index.js | 23 + src/store/modules/app.js | 66 + src/store/modules/permission.js | 133 + src/store/modules/settings.js | 42 + src/store/modules/tagsView.js | 207 + src/store/modules/user.js | 96 + src/utils/auth.js | 15 + src/utils/calendar.js | 668 + src/utils/dict/Dict.js | 82 + src/utils/dict/DictConverter.js | 17 + src/utils/dict/DictData.js | 13 + src/utils/dict/DictMeta.js | 38 + src/utils/dict/DictOptions.js | 51 + src/utils/dict/index.js | 33 + src/utils/errorCode.js | 6 + src/utils/generator/config.js | 438 + src/utils/generator/css.js | 18 + src/utils/generator/drawingDefault.js | 29 + src/utils/generator/html.js | 359 + src/utils/generator/icon.json | 1 + src/utils/generator/js.js | 236 + src/utils/generator/render.js | 126 + src/utils/index.js | 390 + src/utils/jsencrypt.js | 30 + src/utils/permission.js | 51 + src/utils/request.js | 158 + src/utils/ruoyi.js | 236 + src/utils/scroll-to.js | 58 + src/utils/validate.js | 83 + src/views/components/icons/element-icons.js | 3 + src/views/components/icons/index.vue | 87 + src/views/components/icons/svg-icons.js | 10 + src/views/dashboard/BarChart.vue | 102 + src/views/dashboard/LineChart.vue | 135 + src/views/dashboard/PanelGroup.vue | 182 + src/views/dashboard/PieChart.vue | 79 + src/views/dashboard/RaddarChart.vue | 116 + src/views/dashboard/mixins/resize.js | 56 + src/views/error/401.vue | 88 + src/views/error/404.vue | 233 + src/views/index.vue | 154 + src/views/index_v1.vue | 912 + src/views/login.vue | 222 + src/views/mes/cal/calendar/calendarType.vue | 207 + src/views/mes/cal/calendar/index.vue | 33 + src/views/mes/cal/calendar/person.vue | 221 + src/views/mes/cal/calendar/team.vue | 214 + src/views/mes/cal/holiday/index.vue | 189 + src/views/mes/cal/plan/index.vue | 498 + src/views/mes/cal/plan/shift.vue | 282 + src/views/mes/cal/plan/team.vue | 133 + src/views/mes/cal/team/index.vue | 368 + src/views/mes/cal/team/member.vue | 205 + src/views/mes/dv/checkplan/index.vue | 509 + src/views/mes/dv/checkplan/machinery.vue | 154 + src/views/mes/dv/checkplan/subject.vue | 155 + src/views/mes/dv/machinery/index.vue | 595 + src/views/mes/dv/machinerytype/index.vue | 290 + src/views/mes/dv/repair/index.vue | 501 + src/views/mes/dv/repair/line.vue | 261 + src/views/mes/dv/subject/index.vue | 367 + src/views/mes/md/bom/index.vue | 588 + src/views/mes/md/client/index.vue | 670 + src/views/mes/md/itemtype/index.vue | 321 + .../mes/md/mditem/components/itembom.vue | 273 + src/views/mes/md/mditem/components/sip.vue | 231 + src/views/mes/md/mditem/components/sop.vue | 233 + src/views/mes/md/mditem/index.vue | 726 + src/views/mes/md/unitmeasure/index.vue | 335 + src/views/mes/md/vendor/index.vue | 704 + src/views/mes/md/workshop/index.vue | 372 + .../mes/md/workstation/components/machine.vue | 146 + .../mes/md/workstation/components/tool.vue | 213 + .../mes/md/workstation/components/worker.vue | 217 + src/views/mes/md/workstation/index.vue | 669 + src/views/mes/pro/feedback/index.vue | 639 + src/views/mes/pro/process/content.vue | 290 + src/views/mes/pro/process/index.vue | 377 + src/views/mes/pro/proroute/index.vue | 386 + src/views/mes/pro/proroute/product.vue | 411 + src/views/mes/pro/proroute/routeprocess.vue | 411 + .../mes/pro/proroute/routeproductbom.vue | 300 + src/views/mes/pro/schedule/ganttedit.vue | 166 + src/views/mes/pro/schedule/ganttx.vue | 295 + src/views/mes/pro/schedule/index.vue | 617 + src/views/mes/pro/schedule/proTask.vue | 423 + src/views/mes/pro/workorder/bom/bom.vue | 258 + src/views/mes/pro/workorder/index.vue | 760 + src/views/mes/pro/workorder/items/item.vue | 91 + src/views/mes/qc/defectrecord/index.vue | 213 + src/views/mes/qc/ipqc/index.vue | 700 + src/views/mes/qc/ipqc/line.vue | 187 + src/views/mes/qc/iqc/iqc.vue | 718 + src/views/mes/qc/iqc/iqcline.vue | 178 + src/views/mes/qc/oqc/index.vue | 672 + src/views/mes/qc/oqc/line.vue | 126 + src/views/mes/qc/pendinginspect/index.vue | 176 + src/views/mes/qc/pendinginspect/iqc.vue | 341 + src/views/mes/qc/pendinginspect/oqc.vue | 330 + src/views/mes/qc/pendinginspect/pqc.vue | 373 + src/views/mes/qc/qcdefect/index.vue | 326 + src/views/mes/qc/qcindex/index.vue | 366 + src/views/mes/qc/qctemplate/index.vue | 399 + src/views/mes/qc/qctemplate/templateindex.vue | 352 + .../mes/qc/qctemplate/templateproduct.vue | 352 + src/views/mes/report/designer/index.vue | 26 + src/views/mes/report/index.vue | 267 + src/views/mes/tm/tool/index.vue | 535 + src/views/mes/tm/tooltype/index.vue | 401 + src/views/mes/wm/area/index.vue | 483 + src/views/mes/wm/barcode/batchprint.vue | 170 + src/views/mes/wm/barcode/config.vue | 219 + src/views/mes/wm/barcode/index.vue | 635 + src/views/mes/wm/issue/index.vue | 564 + src/views/mes/wm/issue/line.vue | 376 + src/views/mes/wm/itemconsume/index.vue | 463 + src/views/mes/wm/itemconsume/line.vue | 494 + src/views/mes/wm/itemrecpt/index.vue | 576 + src/views/mes/wm/itemrecpt/line.vue | 452 + src/views/mes/wm/location/index.vue | 388 + src/views/mes/wm/outsourceissue/index.vue | 509 + src/views/mes/wm/outsourceissue/line.vue | 368 + src/views/mes/wm/outsourcerecpt/index.vue | 468 + src/views/mes/wm/outsourcerecpt/line.vue | 442 + src/views/mes/wm/package/index.vue | 556 + src/views/mes/wm/package/line.vue | 349 + src/views/mes/wm/package/subpackge.vue | 209 + src/views/mes/wm/productproduce/index.vue | 462 + src/views/mes/wm/productproduce/line.vue | 480 + src/views/mes/wm/productrecpt/index.vue | 481 + src/views/mes/wm/productrecpt/line.vue | 397 + src/views/mes/wm/productsalse/index.vue | 541 + src/views/mes/wm/productsalse/line.vue | 437 + src/views/mes/wm/rtissue/index.vue | 496 + src/views/mes/wm/rtissue/line.vue | 394 + src/views/mes/wm/rtsalse/index.vue | 561 + src/views/mes/wm/rtsalse/line.vue | 377 + src/views/mes/wm/rtvendor/index.vue | 468 + src/views/mes/wm/rtvendor/line.vue | 357 + src/views/mes/wm/sn/index.vue | 310 + src/views/mes/wm/sn/sn.vue | 235 + src/views/mes/wm/stocktaking/index.vue | 309 + src/views/mes/wm/stocktaking/line.vue | 475 + src/views/mes/wm/stocktaking/result.vue | 351 + src/views/mes/wm/transfer/index.vue | 523 + src/views/mes/wm/transfer/line.vue | 457 + src/views/mes/wm/warehouse/index.vue | 425 + src/views/mes/wm/wmstock/index.vue | 295 + src/views/monitor/cache/index.vue | 146 + src/views/monitor/druid/index.vue | 15 + src/views/monitor/job/index.vue | 515 + src/views/monitor/job/log.vue | 295 + src/views/monitor/logininfor/index.vue | 219 + src/views/monitor/online/index.vue | 122 + src/views/monitor/operlog/index.vue | 305 + src/views/monitor/server/index.vue | 207 + src/views/print/printerconfig/index.vue | 351 + src/views/print/printtemplate/alignBottom.svg | 1 + src/views/print/printtemplate/font-size.js | 38 + src/views/print/printtemplate/index.vue | 1025 + src/views/print/printtemplate/list.vue | 353 + src/views/print/printtemplate/panel.js | 107 + src/views/print/printtemplate/preview.vue | 140 + src/views/print/printtemplate/print-data.js | 52 + src/views/print/printtemplate/printData.js | 52 + src/views/print/printtemplate/scale.js | 31 + .../print/printtemplate/templateedit.vue | 227 + src/views/redirect.vue | 12 + src/views/register.vue | 209 + src/views/system/autocode/index.vue | 335 + src/views/system/autocode/part.vue | 376 + src/views/system/config/index.vue | 343 + src/views/system/dept/index.vue | 338 + src/views/system/dict/data.vue | 399 + src/views/system/dict/index.vue | 346 + src/views/system/menu/index.vue | 453 + src/views/system/message/index.vue | 377 + src/views/system/notice/index.vue | 312 + src/views/system/post/index.vue | 309 + src/views/system/role/authUser.vue | 199 + src/views/system/role/index.vue | 614 + src/views/system/role/selectUser.vue | 138 + src/views/system/user/authRole.vue | 117 + src/views/system/user/index.vue | 672 + src/views/system/user/profile/index.vue | 91 + src/views/system/user/profile/resetPwd.vue | 68 + src/views/system/user/profile/userAvatar.vue | 172 + src/views/system/user/profile/userInfo.vue | 75 + src/views/tool/build/CodeTypeDialog.vue | 106 + src/views/tool/build/DraggableItem.vue | 100 + src/views/tool/build/IconsDialog.vue | 123 + src/views/tool/build/RightPanel.vue | 946 + src/views/tool/build/TreeNodeDialog.vue | 149 + src/views/tool/build/index.vue | 783 + src/views/tool/gen/basicInfoForm.vue | 60 + src/views/tool/gen/editTable.vue | 234 + src/views/tool/gen/genInfoForm.vue | 299 + src/views/tool/gen/importTable.vue | 120 + src/views/tool/gen/index.vue | 335 + src/views/tool/swagger/index.vue | 15 + vue.config.js | 143 + 920 files changed, 215639 insertions(+) create mode 100644 .gitignore create mode 100644 README.en.md create mode 100644 README.md create mode 100644 babel.config.js create mode 100644 bin/build.bat create mode 100644 bin/package.bat create mode 100644 bin/run-web.bat create mode 100644 build/index.js create mode 100644 package.json create mode 100644 public/favicon.ico create mode 100644 public/html/ie.html create mode 100644 public/index.html create mode 100644 public/pdf/build/pdf.js create mode 100644 public/pdf/build/pdf.js.map create mode 100644 public/pdf/build/pdf.sandbox.js create mode 100644 public/pdf/build/pdf.sandbox.js.map create mode 100644 public/pdf/build/pdf.worker.js create mode 100644 public/pdf/build/pdf.worker.js.map create mode 100644 public/pdf/web/cmaps/78-EUC-H.bcmap create mode 100644 public/pdf/web/cmaps/78-EUC-V.bcmap create mode 100644 public/pdf/web/cmaps/78-H.bcmap create mode 100644 public/pdf/web/cmaps/78-RKSJ-H.bcmap create mode 100644 public/pdf/web/cmaps/78-RKSJ-V.bcmap create mode 100644 public/pdf/web/cmaps/78-V.bcmap create mode 100644 public/pdf/web/cmaps/78ms-RKSJ-H.bcmap create mode 100644 public/pdf/web/cmaps/78ms-RKSJ-V.bcmap create mode 100644 public/pdf/web/cmaps/83pv-RKSJ-H.bcmap create mode 100644 public/pdf/web/cmaps/90ms-RKSJ-H.bcmap create mode 100644 public/pdf/web/cmaps/90ms-RKSJ-V.bcmap create mode 100644 public/pdf/web/cmaps/90msp-RKSJ-H.bcmap create mode 100644 public/pdf/web/cmaps/90msp-RKSJ-V.bcmap create mode 100644 public/pdf/web/cmaps/90pv-RKSJ-H.bcmap create mode 100644 public/pdf/web/cmaps/90pv-RKSJ-V.bcmap create mode 100644 public/pdf/web/cmaps/Add-H.bcmap create mode 100644 public/pdf/web/cmaps/Add-RKSJ-H.bcmap create mode 100644 public/pdf/web/cmaps/Add-RKSJ-V.bcmap create mode 100644 public/pdf/web/cmaps/Add-V.bcmap create mode 100644 public/pdf/web/cmaps/Adobe-CNS1-0.bcmap create mode 100644 public/pdf/web/cmaps/Adobe-CNS1-1.bcmap create mode 100644 public/pdf/web/cmaps/Adobe-CNS1-2.bcmap create mode 100644 public/pdf/web/cmaps/Adobe-CNS1-3.bcmap create mode 100644 public/pdf/web/cmaps/Adobe-CNS1-4.bcmap create mode 100644 public/pdf/web/cmaps/Adobe-CNS1-5.bcmap create mode 100644 public/pdf/web/cmaps/Adobe-CNS1-6.bcmap create mode 100644 public/pdf/web/cmaps/Adobe-CNS1-UCS2.bcmap create mode 100644 public/pdf/web/cmaps/Adobe-GB1-0.bcmap create mode 100644 public/pdf/web/cmaps/Adobe-GB1-1.bcmap create mode 100644 public/pdf/web/cmaps/Adobe-GB1-2.bcmap create mode 100644 public/pdf/web/cmaps/Adobe-GB1-3.bcmap create mode 100644 public/pdf/web/cmaps/Adobe-GB1-4.bcmap create mode 100644 public/pdf/web/cmaps/Adobe-GB1-5.bcmap create mode 100644 public/pdf/web/cmaps/Adobe-GB1-UCS2.bcmap create mode 100644 public/pdf/web/cmaps/Adobe-Japan1-0.bcmap create mode 100644 public/pdf/web/cmaps/Adobe-Japan1-1.bcmap create mode 100644 public/pdf/web/cmaps/Adobe-Japan1-2.bcmap create mode 100644 public/pdf/web/cmaps/Adobe-Japan1-3.bcmap create mode 100644 public/pdf/web/cmaps/Adobe-Japan1-4.bcmap create mode 100644 public/pdf/web/cmaps/Adobe-Japan1-5.bcmap create mode 100644 public/pdf/web/cmaps/Adobe-Japan1-6.bcmap create mode 100644 public/pdf/web/cmaps/Adobe-Japan1-UCS2.bcmap create mode 100644 public/pdf/web/cmaps/Adobe-Korea1-0.bcmap create mode 100644 public/pdf/web/cmaps/Adobe-Korea1-1.bcmap create mode 100644 public/pdf/web/cmaps/Adobe-Korea1-2.bcmap create mode 100644 public/pdf/web/cmaps/Adobe-Korea1-UCS2.bcmap create mode 100644 public/pdf/web/cmaps/B5-H.bcmap create mode 100644 public/pdf/web/cmaps/B5-V.bcmap create mode 100644 public/pdf/web/cmaps/B5pc-H.bcmap create mode 100644 public/pdf/web/cmaps/B5pc-V.bcmap create mode 100644 public/pdf/web/cmaps/CNS-EUC-H.bcmap create mode 100644 public/pdf/web/cmaps/CNS-EUC-V.bcmap create mode 100644 public/pdf/web/cmaps/CNS1-H.bcmap create mode 100644 public/pdf/web/cmaps/CNS1-V.bcmap create mode 100644 public/pdf/web/cmaps/CNS2-H.bcmap create mode 100644 public/pdf/web/cmaps/CNS2-V.bcmap create mode 100644 public/pdf/web/cmaps/ETHK-B5-H.bcmap create mode 100644 public/pdf/web/cmaps/ETHK-B5-V.bcmap create mode 100644 public/pdf/web/cmaps/ETen-B5-H.bcmap create mode 100644 public/pdf/web/cmaps/ETen-B5-V.bcmap create mode 100644 public/pdf/web/cmaps/ETenms-B5-H.bcmap create mode 100644 public/pdf/web/cmaps/ETenms-B5-V.bcmap create mode 100644 public/pdf/web/cmaps/EUC-H.bcmap create mode 100644 public/pdf/web/cmaps/EUC-V.bcmap create mode 100644 public/pdf/web/cmaps/Ext-H.bcmap create mode 100644 public/pdf/web/cmaps/Ext-RKSJ-H.bcmap create mode 100644 public/pdf/web/cmaps/Ext-RKSJ-V.bcmap create mode 100644 public/pdf/web/cmaps/Ext-V.bcmap create mode 100644 public/pdf/web/cmaps/GB-EUC-H.bcmap create mode 100644 public/pdf/web/cmaps/GB-EUC-V.bcmap create mode 100644 public/pdf/web/cmaps/GB-H.bcmap create mode 100644 public/pdf/web/cmaps/GB-V.bcmap create mode 100644 public/pdf/web/cmaps/GBK-EUC-H.bcmap create mode 100644 public/pdf/web/cmaps/GBK-EUC-V.bcmap create mode 100644 public/pdf/web/cmaps/GBK2K-H.bcmap create mode 100644 public/pdf/web/cmaps/GBK2K-V.bcmap create mode 100644 public/pdf/web/cmaps/GBKp-EUC-H.bcmap create mode 100644 public/pdf/web/cmaps/GBKp-EUC-V.bcmap create mode 100644 public/pdf/web/cmaps/GBT-EUC-H.bcmap create mode 100644 public/pdf/web/cmaps/GBT-EUC-V.bcmap create mode 100644 public/pdf/web/cmaps/GBT-H.bcmap create mode 100644 public/pdf/web/cmaps/GBT-V.bcmap create mode 100644 public/pdf/web/cmaps/GBTpc-EUC-H.bcmap create mode 100644 public/pdf/web/cmaps/GBTpc-EUC-V.bcmap create mode 100644 public/pdf/web/cmaps/GBpc-EUC-H.bcmap create mode 100644 public/pdf/web/cmaps/GBpc-EUC-V.bcmap create mode 100644 public/pdf/web/cmaps/H.bcmap create mode 100644 public/pdf/web/cmaps/HKdla-B5-H.bcmap create mode 100644 public/pdf/web/cmaps/HKdla-B5-V.bcmap create mode 100644 public/pdf/web/cmaps/HKdlb-B5-H.bcmap create mode 100644 public/pdf/web/cmaps/HKdlb-B5-V.bcmap create mode 100644 public/pdf/web/cmaps/HKgccs-B5-H.bcmap create mode 100644 public/pdf/web/cmaps/HKgccs-B5-V.bcmap create mode 100644 public/pdf/web/cmaps/HKm314-B5-H.bcmap create mode 100644 public/pdf/web/cmaps/HKm314-B5-V.bcmap create mode 100644 public/pdf/web/cmaps/HKm471-B5-H.bcmap create mode 100644 public/pdf/web/cmaps/HKm471-B5-V.bcmap create mode 100644 public/pdf/web/cmaps/HKscs-B5-H.bcmap create mode 100644 public/pdf/web/cmaps/HKscs-B5-V.bcmap create mode 100644 public/pdf/web/cmaps/Hankaku.bcmap create mode 100644 public/pdf/web/cmaps/Hiragana.bcmap create mode 100644 public/pdf/web/cmaps/KSC-EUC-H.bcmap create mode 100644 public/pdf/web/cmaps/KSC-EUC-V.bcmap create mode 100644 public/pdf/web/cmaps/KSC-H.bcmap create mode 100644 public/pdf/web/cmaps/KSC-Johab-H.bcmap create mode 100644 public/pdf/web/cmaps/KSC-Johab-V.bcmap create mode 100644 public/pdf/web/cmaps/KSC-V.bcmap create mode 100644 public/pdf/web/cmaps/KSCms-UHC-H.bcmap create mode 100644 public/pdf/web/cmaps/KSCms-UHC-HW-H.bcmap create mode 100644 public/pdf/web/cmaps/KSCms-UHC-HW-V.bcmap create mode 100644 public/pdf/web/cmaps/KSCms-UHC-V.bcmap create mode 100644 public/pdf/web/cmaps/KSCpc-EUC-H.bcmap create mode 100644 public/pdf/web/cmaps/KSCpc-EUC-V.bcmap create mode 100644 public/pdf/web/cmaps/Katakana.bcmap create mode 100644 public/pdf/web/cmaps/LICENSE create mode 100644 public/pdf/web/cmaps/NWP-H.bcmap create mode 100644 public/pdf/web/cmaps/NWP-V.bcmap create mode 100644 public/pdf/web/cmaps/RKSJ-H.bcmap create mode 100644 public/pdf/web/cmaps/RKSJ-V.bcmap create mode 100644 public/pdf/web/cmaps/Roman.bcmap create mode 100644 public/pdf/web/cmaps/UniCNS-UCS2-H.bcmap create mode 100644 public/pdf/web/cmaps/UniCNS-UCS2-V.bcmap create mode 100644 public/pdf/web/cmaps/UniCNS-UTF16-H.bcmap create mode 100644 public/pdf/web/cmaps/UniCNS-UTF16-V.bcmap create mode 100644 public/pdf/web/cmaps/UniCNS-UTF32-H.bcmap create mode 100644 public/pdf/web/cmaps/UniCNS-UTF32-V.bcmap create mode 100644 public/pdf/web/cmaps/UniCNS-UTF8-H.bcmap create mode 100644 public/pdf/web/cmaps/UniCNS-UTF8-V.bcmap create mode 100644 public/pdf/web/cmaps/UniGB-UCS2-H.bcmap create mode 100644 public/pdf/web/cmaps/UniGB-UCS2-V.bcmap create mode 100644 public/pdf/web/cmaps/UniGB-UTF16-H.bcmap create mode 100644 public/pdf/web/cmaps/UniGB-UTF16-V.bcmap create mode 100644 public/pdf/web/cmaps/UniGB-UTF32-H.bcmap create mode 100644 public/pdf/web/cmaps/UniGB-UTF32-V.bcmap create mode 100644 public/pdf/web/cmaps/UniGB-UTF8-H.bcmap create mode 100644 public/pdf/web/cmaps/UniGB-UTF8-V.bcmap create mode 100644 public/pdf/web/cmaps/UniJIS-UCS2-H.bcmap create mode 100644 public/pdf/web/cmaps/UniJIS-UCS2-HW-H.bcmap create mode 100644 public/pdf/web/cmaps/UniJIS-UCS2-HW-V.bcmap create mode 100644 public/pdf/web/cmaps/UniJIS-UCS2-V.bcmap create mode 100644 public/pdf/web/cmaps/UniJIS-UTF16-H.bcmap create mode 100644 public/pdf/web/cmaps/UniJIS-UTF16-V.bcmap create mode 100644 public/pdf/web/cmaps/UniJIS-UTF32-H.bcmap create mode 100644 public/pdf/web/cmaps/UniJIS-UTF32-V.bcmap create mode 100644 public/pdf/web/cmaps/UniJIS-UTF8-H.bcmap create mode 100644 public/pdf/web/cmaps/UniJIS-UTF8-V.bcmap create mode 100644 public/pdf/web/cmaps/UniJIS2004-UTF16-H.bcmap create mode 100644 public/pdf/web/cmaps/UniJIS2004-UTF16-V.bcmap create mode 100644 public/pdf/web/cmaps/UniJIS2004-UTF32-H.bcmap create mode 100644 public/pdf/web/cmaps/UniJIS2004-UTF32-V.bcmap create mode 100644 public/pdf/web/cmaps/UniJIS2004-UTF8-H.bcmap create mode 100644 public/pdf/web/cmaps/UniJIS2004-UTF8-V.bcmap create mode 100644 public/pdf/web/cmaps/UniJISPro-UCS2-HW-V.bcmap create mode 100644 public/pdf/web/cmaps/UniJISPro-UCS2-V.bcmap create mode 100644 public/pdf/web/cmaps/UniJISPro-UTF8-V.bcmap create mode 100644 public/pdf/web/cmaps/UniJISX0213-UTF32-H.bcmap create mode 100644 public/pdf/web/cmaps/UniJISX0213-UTF32-V.bcmap create mode 100644 public/pdf/web/cmaps/UniJISX02132004-UTF32-H.bcmap create mode 100644 public/pdf/web/cmaps/UniJISX02132004-UTF32-V.bcmap create mode 100644 public/pdf/web/cmaps/UniKS-UCS2-H.bcmap create mode 100644 public/pdf/web/cmaps/UniKS-UCS2-V.bcmap create mode 100644 public/pdf/web/cmaps/UniKS-UTF16-H.bcmap create mode 100644 public/pdf/web/cmaps/UniKS-UTF16-V.bcmap create mode 100644 public/pdf/web/cmaps/UniKS-UTF32-H.bcmap create mode 100644 public/pdf/web/cmaps/UniKS-UTF32-V.bcmap create mode 100644 public/pdf/web/cmaps/UniKS-UTF8-H.bcmap create mode 100644 public/pdf/web/cmaps/UniKS-UTF8-V.bcmap create mode 100644 public/pdf/web/cmaps/V.bcmap create mode 100644 public/pdf/web/cmaps/WP-Symbol.bcmap create mode 100644 public/pdf/web/compressed.tracemonkey-pldi-09.pdf create mode 100644 public/pdf/web/debugger.css create mode 100644 public/pdf/web/debugger.js create mode 100644 public/pdf/web/images/annotation-check.svg create mode 100644 public/pdf/web/images/annotation-comment.svg create mode 100644 public/pdf/web/images/annotation-help.svg create mode 100644 public/pdf/web/images/annotation-insert.svg create mode 100644 public/pdf/web/images/annotation-key.svg create mode 100644 public/pdf/web/images/annotation-newparagraph.svg create mode 100644 public/pdf/web/images/annotation-noicon.svg create mode 100644 public/pdf/web/images/annotation-note.svg create mode 100644 public/pdf/web/images/annotation-paragraph.svg create mode 100644 public/pdf/web/images/findbarButton-next.svg create mode 100644 public/pdf/web/images/findbarButton-previous.svg create mode 100644 public/pdf/web/images/loading-dark.svg create mode 100644 public/pdf/web/images/loading-icon.gif create mode 100644 public/pdf/web/images/loading.svg create mode 100644 public/pdf/web/images/secondaryToolbarButton-documentProperties.svg create mode 100644 public/pdf/web/images/secondaryToolbarButton-firstPage.svg create mode 100644 public/pdf/web/images/secondaryToolbarButton-handTool.svg create mode 100644 public/pdf/web/images/secondaryToolbarButton-lastPage.svg create mode 100644 public/pdf/web/images/secondaryToolbarButton-rotateCcw.svg create mode 100644 public/pdf/web/images/secondaryToolbarButton-rotateCw.svg create mode 100644 public/pdf/web/images/secondaryToolbarButton-scrollHorizontal.svg create mode 100644 public/pdf/web/images/secondaryToolbarButton-scrollPage.svg create mode 100644 public/pdf/web/images/secondaryToolbarButton-scrollVertical.svg create mode 100644 public/pdf/web/images/secondaryToolbarButton-scrollWrapped.svg create mode 100644 public/pdf/web/images/secondaryToolbarButton-selectTool.svg create mode 100644 public/pdf/web/images/secondaryToolbarButton-spreadEven.svg create mode 100644 public/pdf/web/images/secondaryToolbarButton-spreadNone.svg create mode 100644 public/pdf/web/images/secondaryToolbarButton-spreadOdd.svg create mode 100644 public/pdf/web/images/shadow.png create mode 100644 public/pdf/web/images/toolbarButton-bookmark.svg create mode 100644 public/pdf/web/images/toolbarButton-currentOutlineItem.svg create mode 100644 public/pdf/web/images/toolbarButton-download.svg create mode 100644 public/pdf/web/images/toolbarButton-menuArrow.svg create mode 100644 public/pdf/web/images/toolbarButton-openFile.svg create mode 100644 public/pdf/web/images/toolbarButton-pageDown.svg create mode 100644 public/pdf/web/images/toolbarButton-pageUp.svg create mode 100644 public/pdf/web/images/toolbarButton-presentationMode.svg create mode 100644 public/pdf/web/images/toolbarButton-print.svg create mode 100644 public/pdf/web/images/toolbarButton-search.svg create mode 100644 public/pdf/web/images/toolbarButton-secondaryToolbarToggle.svg create mode 100644 public/pdf/web/images/toolbarButton-sidebarToggle.svg create mode 100644 public/pdf/web/images/toolbarButton-viewAttachments.svg create mode 100644 public/pdf/web/images/toolbarButton-viewLayers.svg create mode 100644 public/pdf/web/images/toolbarButton-viewOutline.svg create mode 100644 public/pdf/web/images/toolbarButton-viewThumbnail.svg create mode 100644 public/pdf/web/images/toolbarButton-zoomIn.svg create mode 100644 public/pdf/web/images/toolbarButton-zoomOut.svg create mode 100644 public/pdf/web/images/treeitem-collapsed.svg create mode 100644 public/pdf/web/images/treeitem-expanded.svg create mode 100644 public/pdf/web/locale/ach/viewer.properties create mode 100644 public/pdf/web/locale/af/viewer.properties create mode 100644 public/pdf/web/locale/an/viewer.properties create mode 100644 public/pdf/web/locale/ar/viewer.properties create mode 100644 public/pdf/web/locale/ast/viewer.properties create mode 100644 public/pdf/web/locale/az/viewer.properties create mode 100644 public/pdf/web/locale/be/viewer.properties create mode 100644 public/pdf/web/locale/bg/viewer.properties create mode 100644 public/pdf/web/locale/bn/viewer.properties create mode 100644 public/pdf/web/locale/bo/viewer.properties create mode 100644 public/pdf/web/locale/br/viewer.properties create mode 100644 public/pdf/web/locale/brx/viewer.properties create mode 100644 public/pdf/web/locale/bs/viewer.properties create mode 100644 public/pdf/web/locale/ca/viewer.properties create mode 100644 public/pdf/web/locale/cak/viewer.properties create mode 100644 public/pdf/web/locale/ckb/viewer.properties create mode 100644 public/pdf/web/locale/cs/viewer.properties create mode 100644 public/pdf/web/locale/cy/viewer.properties create mode 100644 public/pdf/web/locale/da/viewer.properties create mode 100644 public/pdf/web/locale/de/viewer.properties create mode 100644 public/pdf/web/locale/dsb/viewer.properties create mode 100644 public/pdf/web/locale/el/viewer.properties create mode 100644 public/pdf/web/locale/en-CA/viewer.properties create mode 100644 public/pdf/web/locale/en-GB/viewer.properties create mode 100644 public/pdf/web/locale/en-US/viewer.properties create mode 100644 public/pdf/web/locale/eo/viewer.properties create mode 100644 public/pdf/web/locale/es-AR/viewer.properties create mode 100644 public/pdf/web/locale/es-CL/viewer.properties create mode 100644 public/pdf/web/locale/es-ES/viewer.properties create mode 100644 public/pdf/web/locale/es-MX/viewer.properties create mode 100644 public/pdf/web/locale/et/viewer.properties create mode 100644 public/pdf/web/locale/eu/viewer.properties create mode 100644 public/pdf/web/locale/fa/viewer.properties create mode 100644 public/pdf/web/locale/ff/viewer.properties create mode 100644 public/pdf/web/locale/fi/viewer.properties create mode 100644 public/pdf/web/locale/fr/viewer.properties create mode 100644 public/pdf/web/locale/fy-NL/viewer.properties create mode 100644 public/pdf/web/locale/ga-IE/viewer.properties create mode 100644 public/pdf/web/locale/gd/viewer.properties create mode 100644 public/pdf/web/locale/gl/viewer.properties create mode 100644 public/pdf/web/locale/gn/viewer.properties create mode 100644 public/pdf/web/locale/gu-IN/viewer.properties create mode 100644 public/pdf/web/locale/he/viewer.properties create mode 100644 public/pdf/web/locale/hi-IN/viewer.properties create mode 100644 public/pdf/web/locale/hr/viewer.properties create mode 100644 public/pdf/web/locale/hsb/viewer.properties create mode 100644 public/pdf/web/locale/hu/viewer.properties create mode 100644 public/pdf/web/locale/hy-AM/viewer.properties create mode 100644 public/pdf/web/locale/hye/viewer.properties create mode 100644 public/pdf/web/locale/ia/viewer.properties create mode 100644 public/pdf/web/locale/id/viewer.properties create mode 100644 public/pdf/web/locale/is/viewer.properties create mode 100644 public/pdf/web/locale/it/viewer.properties create mode 100644 public/pdf/web/locale/ja/viewer.properties create mode 100644 public/pdf/web/locale/ka/viewer.properties create mode 100644 public/pdf/web/locale/kab/viewer.properties create mode 100644 public/pdf/web/locale/kk/viewer.properties create mode 100644 public/pdf/web/locale/km/viewer.properties create mode 100644 public/pdf/web/locale/kn/viewer.properties create mode 100644 public/pdf/web/locale/ko/viewer.properties create mode 100644 public/pdf/web/locale/lij/viewer.properties create mode 100644 public/pdf/web/locale/lo/viewer.properties create mode 100644 public/pdf/web/locale/locale.properties create mode 100644 public/pdf/web/locale/lt/viewer.properties create mode 100644 public/pdf/web/locale/ltg/viewer.properties create mode 100644 public/pdf/web/locale/lv/viewer.properties create mode 100644 public/pdf/web/locale/meh/viewer.properties create mode 100644 public/pdf/web/locale/mk/viewer.properties create mode 100644 public/pdf/web/locale/mr/viewer.properties create mode 100644 public/pdf/web/locale/ms/viewer.properties create mode 100644 public/pdf/web/locale/my/viewer.properties create mode 100644 public/pdf/web/locale/nb-NO/viewer.properties create mode 100644 public/pdf/web/locale/ne-NP/viewer.properties create mode 100644 public/pdf/web/locale/nl/viewer.properties create mode 100644 public/pdf/web/locale/nn-NO/viewer.properties create mode 100644 public/pdf/web/locale/oc/viewer.properties create mode 100644 public/pdf/web/locale/pa-IN/viewer.properties create mode 100644 public/pdf/web/locale/pl/viewer.properties create mode 100644 public/pdf/web/locale/pt-BR/viewer.properties create mode 100644 public/pdf/web/locale/pt-PT/viewer.properties create mode 100644 public/pdf/web/locale/rm/viewer.properties create mode 100644 public/pdf/web/locale/ro/viewer.properties create mode 100644 public/pdf/web/locale/ru/viewer.properties create mode 100644 public/pdf/web/locale/sat/viewer.properties create mode 100644 public/pdf/web/locale/sc/viewer.properties create mode 100644 public/pdf/web/locale/scn/viewer.properties create mode 100644 public/pdf/web/locale/sco/viewer.properties create mode 100644 public/pdf/web/locale/si/viewer.properties create mode 100644 public/pdf/web/locale/sk/viewer.properties create mode 100644 public/pdf/web/locale/sl/viewer.properties create mode 100644 public/pdf/web/locale/son/viewer.properties create mode 100644 public/pdf/web/locale/sq/viewer.properties create mode 100644 public/pdf/web/locale/sr/viewer.properties create mode 100644 public/pdf/web/locale/sv-SE/viewer.properties create mode 100644 public/pdf/web/locale/szl/viewer.properties create mode 100644 public/pdf/web/locale/ta/viewer.properties create mode 100644 public/pdf/web/locale/te/viewer.properties create mode 100644 public/pdf/web/locale/tg/viewer.properties create mode 100644 public/pdf/web/locale/th/viewer.properties create mode 100644 public/pdf/web/locale/tl/viewer.properties create mode 100644 public/pdf/web/locale/tr/viewer.properties create mode 100644 public/pdf/web/locale/trs/viewer.properties create mode 100644 public/pdf/web/locale/uk/viewer.properties create mode 100644 public/pdf/web/locale/ur/viewer.properties create mode 100644 public/pdf/web/locale/uz/viewer.properties create mode 100644 public/pdf/web/locale/vi/viewer.properties create mode 100644 public/pdf/web/locale/wo/viewer.properties create mode 100644 public/pdf/web/locale/xh/viewer.properties create mode 100644 public/pdf/web/locale/zh-CN/viewer.properties create mode 100644 public/pdf/web/locale/zh-TW/viewer.properties create mode 100644 public/pdf/web/standard_fonts/FoxitDingbats.pfb create mode 100644 public/pdf/web/standard_fonts/FoxitFixed.pfb create mode 100644 public/pdf/web/standard_fonts/FoxitFixedBold.pfb create mode 100644 public/pdf/web/standard_fonts/FoxitFixedBoldItalic.pfb create mode 100644 public/pdf/web/standard_fonts/FoxitFixedItalic.pfb create mode 100644 public/pdf/web/standard_fonts/FoxitSans.pfb create mode 100644 public/pdf/web/standard_fonts/FoxitSansBold.pfb create mode 100644 public/pdf/web/standard_fonts/FoxitSansBoldItalic.pfb create mode 100644 public/pdf/web/standard_fonts/FoxitSansItalic.pfb create mode 100644 public/pdf/web/standard_fonts/FoxitSerif.pfb create mode 100644 public/pdf/web/standard_fonts/FoxitSerifBold.pfb create mode 100644 public/pdf/web/standard_fonts/FoxitSerifBoldItalic.pfb create mode 100644 public/pdf/web/standard_fonts/FoxitSerifItalic.pfb create mode 100644 public/pdf/web/standard_fonts/FoxitSymbol.pfb create mode 100644 public/pdf/web/standard_fonts/LICENSE_FOXIT create mode 100644 public/pdf/web/standard_fonts/LICENSE_LIBERATION create mode 100644 public/pdf/web/standard_fonts/LiberationSans-Bold.ttf create mode 100644 public/pdf/web/standard_fonts/LiberationSans-BoldItalic.ttf create mode 100644 public/pdf/web/standard_fonts/LiberationSans-Italic.ttf create mode 100644 public/pdf/web/standard_fonts/LiberationSans-Regular.ttf create mode 100644 public/pdf/web/viewer.css create mode 100644 public/pdf/web/viewer.html create mode 100644 public/pdf/web/viewer.js create mode 100644 public/pdf/web/viewer.js.map create mode 100644 public/print-lock.css create mode 100644 public/robots.txt create mode 100644 src/App.vue create mode 100644 src/api/login.js create mode 100644 src/api/menu.js create mode 100644 src/api/mes/cal/calendar.js create mode 100644 src/api/mes/cal/calholiday.js create mode 100644 src/api/mes/cal/calplan.js create mode 100644 src/api/mes/cal/planteam.js create mode 100644 src/api/mes/cal/shift.js create mode 100644 src/api/mes/cal/team.js create mode 100644 src/api/mes/cal/teammember.js create mode 100644 src/api/mes/dv/checkmachinery.js create mode 100644 src/api/mes/dv/checkplan.js create mode 100644 src/api/mes/dv/checksubject.js create mode 100644 src/api/mes/dv/dvsubject.js create mode 100644 src/api/mes/dv/machinery.js create mode 100644 src/api/mes/dv/machinerytype.js create mode 100644 src/api/mes/dv/repair.js create mode 100644 src/api/mes/dv/repairline.js create mode 100644 src/api/mes/md/bom.js create mode 100644 src/api/mes/md/client.js create mode 100644 src/api/mes/md/itemtype.js create mode 100644 src/api/mes/md/mdItem.js create mode 100644 src/api/mes/md/sip.js create mode 100644 src/api/mes/md/sop.js create mode 100644 src/api/mes/md/unitmeasure.js create mode 100644 src/api/mes/md/vendor.js create mode 100644 src/api/mes/md/workshop.js create mode 100644 src/api/mes/md/workstation.js create mode 100644 src/api/mes/md/workstationmachine.js create mode 100644 src/api/mes/md/workstationtool.js create mode 100644 src/api/mes/md/workstationworker.js create mode 100644 src/api/mes/pro/feedback.js create mode 100644 src/api/mes/pro/process.js create mode 100644 src/api/mes/pro/processcontent.js create mode 100644 src/api/mes/pro/proroute.js create mode 100644 src/api/mes/pro/protask.js create mode 100644 src/api/mes/pro/routeprocess.js create mode 100644 src/api/mes/pro/routeproduct.js create mode 100644 src/api/mes/pro/routeproductbom.js create mode 100644 src/api/mes/pro/workorder.js create mode 100644 src/api/mes/pro/workorderbom.js create mode 100644 src/api/mes/qc/defectrecord.js create mode 100644 src/api/mes/qc/ipqc.js create mode 100644 src/api/mes/qc/ipqcline.js create mode 100644 src/api/mes/qc/iqc.js create mode 100644 src/api/mes/qc/iqcline.js create mode 100644 src/api/mes/qc/oqc.js create mode 100644 src/api/mes/qc/oqcline.js create mode 100644 src/api/mes/qc/pending.js create mode 100644 src/api/mes/qc/qcdefect.js create mode 100644 src/api/mes/qc/qcindex.js create mode 100644 src/api/mes/qc/qctemplate.js create mode 100644 src/api/mes/qc/templateindex.js create mode 100644 src/api/mes/qc/templateproduct.js create mode 100644 src/api/mes/report/report.js create mode 100644 src/api/mes/report/ureport.js create mode 100644 src/api/mes/tm/tool.js create mode 100644 src/api/mes/tm/tooltype.js create mode 100644 src/api/mes/wm/area.js create mode 100644 src/api/mes/wm/barcode.js create mode 100644 src/api/mes/wm/barcodeconfig.js create mode 100644 src/api/mes/wm/issueheader.js create mode 100644 src/api/mes/wm/issueline.js create mode 100644 src/api/mes/wm/itemconsume.js create mode 100644 src/api/mes/wm/itemconsumeline.js create mode 100644 src/api/mes/wm/itemrecpt.js create mode 100644 src/api/mes/wm/itemrecptline.js create mode 100644 src/api/mes/wm/location.js create mode 100644 src/api/mes/wm/oursourcerecptline.js create mode 100644 src/api/mes/wm/outsourceissue.js create mode 100644 src/api/mes/wm/outsourceissueline.js create mode 100644 src/api/mes/wm/outsourcerecpt.js create mode 100644 src/api/mes/wm/package.js create mode 100644 src/api/mes/wm/packageline.js create mode 100644 src/api/mes/wm/productproduce.js create mode 100644 src/api/mes/wm/productproduceline.js create mode 100644 src/api/mes/wm/productrecpt.js create mode 100644 src/api/mes/wm/productrecptline.js create mode 100644 src/api/mes/wm/productsalse.js create mode 100644 src/api/mes/wm/productsalseline.js create mode 100644 src/api/mes/wm/rtissue.js create mode 100644 src/api/mes/wm/rtissueline.js create mode 100644 src/api/mes/wm/rtsalse.js create mode 100644 src/api/mes/wm/rtsalseline.js create mode 100644 src/api/mes/wm/rtvendor.js create mode 100644 src/api/mes/wm/rtvendorline.js create mode 100644 src/api/mes/wm/sn.js create mode 100644 src/api/mes/wm/stocktaking.js create mode 100644 src/api/mes/wm/stocktakingline.js create mode 100644 src/api/mes/wm/stocktakingresult.js create mode 100644 src/api/mes/wm/transfer.js create mode 100644 src/api/mes/wm/transferline.js create mode 100644 src/api/mes/wm/warehouse.js create mode 100644 src/api/mes/wm/wmstock.js create mode 100644 src/api/monitor/cache.js create mode 100644 src/api/monitor/job.js create mode 100644 src/api/monitor/jobLog.js create mode 100644 src/api/monitor/logininfor.js create mode 100644 src/api/monitor/online.js create mode 100644 src/api/monitor/operlog.js create mode 100644 src/api/monitor/server.js create mode 100644 src/api/print/printerconfig.js create mode 100644 src/api/print/template.js create mode 100644 src/api/system/autocode/part.js create mode 100644 src/api/system/autocode/rule.js create mode 100644 src/api/system/config.js create mode 100644 src/api/system/dept.js create mode 100644 src/api/system/dict/data.js create mode 100644 src/api/system/dict/type.js create mode 100644 src/api/system/menu.js create mode 100644 src/api/system/message.js create mode 100644 src/api/system/notice.js create mode 100644 src/api/system/post.js create mode 100644 src/api/system/role.js create mode 100644 src/api/system/user.js create mode 100644 src/api/tool/gen.js create mode 100644 src/assets/401_images/401.gif create mode 100644 src/assets/404_images/404.png create mode 100644 src/assets/404_images/404_cloud.png create mode 100644 src/assets/icons/index.js create mode 100644 src/assets/icons/svg/404.svg create mode 100644 src/assets/icons/svg/add.svg create mode 100644 src/assets/icons/svg/alignBottom.svg create mode 100644 src/assets/icons/svg/alignCenter.svg create mode 100644 src/assets/icons/svg/alignLeft.svg create mode 100644 src/assets/icons/svg/alignRight.svg create mode 100644 src/assets/icons/svg/alignTop.svg create mode 100644 src/assets/icons/svg/barcode.svg create mode 100644 src/assets/icons/svg/bug.svg create mode 100644 src/assets/icons/svg/build.svg create mode 100644 src/assets/icons/svg/button.svg create mode 100644 src/assets/icons/svg/cascader.svg create mode 100644 src/assets/icons/svg/chart.svg create mode 100644 src/assets/icons/svg/checkbox.svg create mode 100644 src/assets/icons/svg/circle.svg create mode 100644 src/assets/icons/svg/clientcode.svg create mode 100644 src/assets/icons/svg/clientname.svg create mode 100644 src/assets/icons/svg/clipboard.svg create mode 100644 src/assets/icons/svg/code.svg create mode 100644 src/assets/icons/svg/color.svg create mode 100644 src/assets/icons/svg/component.svg create mode 100644 src/assets/icons/svg/dashboard.svg create mode 100644 src/assets/icons/svg/date-range.svg create mode 100644 src/assets/icons/svg/date.svg create mode 100644 src/assets/icons/svg/device.svg create mode 100644 src/assets/icons/svg/dict.svg create mode 100644 src/assets/icons/svg/documentation.svg create mode 100644 src/assets/icons/svg/download.svg create mode 100644 src/assets/icons/svg/drag.svg create mode 100644 src/assets/icons/svg/druid.svg create mode 100644 src/assets/icons/svg/edit.svg create mode 100644 src/assets/icons/svg/education.svg create mode 100644 src/assets/icons/svg/email.svg create mode 100644 src/assets/icons/svg/example.svg create mode 100644 src/assets/icons/svg/excel.svg create mode 100644 src/assets/icons/svg/exit-fullscreen.svg create mode 100644 src/assets/icons/svg/eye-open.svg create mode 100644 src/assets/icons/svg/eye.svg create mode 100644 src/assets/icons/svg/fault.svg create mode 100644 src/assets/icons/svg/form.svg create mode 100644 src/assets/icons/svg/fullscreen.svg create mode 100644 src/assets/icons/svg/github.svg create mode 100644 src/assets/icons/svg/guide.svg create mode 100644 src/assets/icons/svg/hline.svg create mode 100644 src/assets/icons/svg/horizontal.svg create mode 100644 src/assets/icons/svg/icon.svg create mode 100644 src/assets/icons/svg/input.svg create mode 100644 src/assets/icons/svg/international.svg create mode 100644 src/assets/icons/svg/issue.svg create mode 100644 src/assets/icons/svg/itemcode.svg create mode 100644 src/assets/icons/svg/itemname.svg create mode 100644 src/assets/icons/svg/job.svg create mode 100644 src/assets/icons/svg/language.svg create mode 100644 src/assets/icons/svg/link.svg create mode 100644 src/assets/icons/svg/list.svg create mode 100644 src/assets/icons/svg/lock.svg create mode 100644 src/assets/icons/svg/log.svg create mode 100644 src/assets/icons/svg/logininfor.svg create mode 100644 src/assets/icons/svg/message.svg create mode 100644 src/assets/icons/svg/money.svg create mode 100644 src/assets/icons/svg/monitor.svg create mode 100644 src/assets/icons/svg/nested.svg create mode 100644 src/assets/icons/svg/number.svg create mode 100644 src/assets/icons/svg/online.svg create mode 100644 src/assets/icons/svg/password.svg create mode 100644 src/assets/icons/svg/pdf.svg create mode 100644 src/assets/icons/svg/people.svg create mode 100644 src/assets/icons/svg/peoples.svg create mode 100644 src/assets/icons/svg/phone.svg create mode 100644 src/assets/icons/svg/picture.svg create mode 100644 src/assets/icons/svg/post.svg create mode 100644 src/assets/icons/svg/qc.svg create mode 100644 src/assets/icons/svg/qq.svg create mode 100644 src/assets/icons/svg/qrcode.svg create mode 100644 src/assets/icons/svg/question.svg create mode 100644 src/assets/icons/svg/radio.svg create mode 100644 src/assets/icons/svg/rate.svg create mode 100644 src/assets/icons/svg/rect.svg create mode 100644 src/assets/icons/svg/redis.svg create mode 100644 src/assets/icons/svg/resizeHorizontal.svg create mode 100644 src/assets/icons/svg/resizeVertical.svg create mode 100644 src/assets/icons/svg/row.svg create mode 100644 src/assets/icons/svg/running.svg create mode 100644 src/assets/icons/svg/search.svg create mode 100644 src/assets/icons/svg/select.svg create mode 100644 src/assets/icons/svg/server.svg create mode 100644 src/assets/icons/svg/shopping.svg create mode 100644 src/assets/icons/svg/size.svg create mode 100644 src/assets/icons/svg/skill.svg create mode 100644 src/assets/icons/svg/slider.svg create mode 100644 src/assets/icons/svg/star.svg create mode 100644 src/assets/icons/svg/swagger.svg create mode 100644 src/assets/icons/svg/switch.svg create mode 100644 src/assets/icons/svg/system.svg create mode 100644 src/assets/icons/svg/tab.svg create mode 100644 src/assets/icons/svg/table.svg create mode 100644 src/assets/icons/svg/text.svg create mode 100644 src/assets/icons/svg/textarea.svg create mode 100644 src/assets/icons/svg/theme.svg create mode 100644 src/assets/icons/svg/time-range.svg create mode 100644 src/assets/icons/svg/time.svg create mode 100644 src/assets/icons/svg/tool.svg create mode 100644 src/assets/icons/svg/tree-table.svg create mode 100644 src/assets/icons/svg/tree.svg create mode 100644 src/assets/icons/svg/upload.svg create mode 100644 src/assets/icons/svg/user.svg create mode 100644 src/assets/icons/svg/validCode.svg create mode 100644 src/assets/icons/svg/vendorcode.svg create mode 100644 src/assets/icons/svg/vendorname.svg create mode 100644 src/assets/icons/svg/vline.svg create mode 100644 src/assets/icons/svg/waitting.svg create mode 100644 src/assets/icons/svg/warehouse.svg create mode 100644 src/assets/icons/svg/wechat.svg create mode 100644 src/assets/icons/svg/workordercode.svg create mode 100644 src/assets/icons/svg/workordername.svg create mode 100644 src/assets/icons/svg/zip.svg create mode 100644 src/assets/icons/svgo.yml create mode 100644 src/assets/images/accept.png create mode 100644 src/assets/images/dark.svg create mode 100644 src/assets/images/light.svg create mode 100644 src/assets/images/login-background.jpg create mode 100644 src/assets/images/prepare.png create mode 100644 src/assets/images/profile.jpg create mode 100644 src/assets/images/reject.png create mode 100644 src/assets/logo/logo.png create mode 100644 src/assets/styles/btn.scss create mode 100644 src/assets/styles/element-ui.scss create mode 100644 src/assets/styles/element-variables.scss create mode 100644 src/assets/styles/index.scss create mode 100644 src/assets/styles/mixin.scss create mode 100644 src/assets/styles/ruoyi.scss create mode 100644 src/assets/styles/sidebar.scss create mode 100644 src/assets/styles/transition.scss create mode 100644 src/assets/styles/variables.scss create mode 100644 src/components/Breadcrumb/index.vue create mode 100644 src/components/Crontab/day.vue create mode 100644 src/components/Crontab/hour.vue create mode 100644 src/components/Crontab/index.vue create mode 100644 src/components/Crontab/min.vue create mode 100644 src/components/Crontab/month.vue create mode 100644 src/components/Crontab/result.vue create mode 100644 src/components/Crontab/second.vue create mode 100644 src/components/Crontab/week.vue create mode 100644 src/components/Crontab/year.vue create mode 100644 src/components/DictData/index.js create mode 100644 src/components/DictTag/index.vue create mode 100644 src/components/Editor/index.vue create mode 100644 src/components/FileUpload/index.vue create mode 100644 src/components/Hamburger/index.vue create mode 100644 src/components/HeaderSearch/index.vue create mode 100644 src/components/IconSelect/index.vue create mode 100644 src/components/IconSelect/requireIcons.js create mode 100644 src/components/ImagePreview/index.vue create mode 100644 src/components/ImageUpload/index.vue create mode 100644 src/components/Pagination/index.vue create mode 100644 src/components/PanThumb/index.vue create mode 100644 src/components/ParentView/index.vue create mode 100644 src/components/RightPanel/index.vue create mode 100644 src/components/RightToolbar/index.vue create mode 100644 src/components/RuoYi/Doc/index.vue create mode 100644 src/components/RuoYi/Git/index.vue create mode 100644 src/components/Screenfull/index.vue create mode 100644 src/components/SizeSelect/index.vue create mode 100644 src/components/SvgIcon/index.vue create mode 100644 src/components/TaskSelect/taskSelectSingle.vue create mode 100644 src/components/ThemePicker/index.vue create mode 100644 src/components/TopNav/index.vue create mode 100644 src/components/barcodeImg/index.vue create mode 100644 src/components/calTeamSelect/multi.vue create mode 100644 src/components/clientSelect/single.vue create mode 100644 src/components/defectSelect/single.vue create mode 100644 src/components/dvsubjectSelect/multi.vue create mode 100644 src/components/iFrame/index.vue create mode 100644 src/components/iqcSelect/single.vue create mode 100644 src/components/itemBomSelect/single.vue create mode 100644 src/components/itemSelect/index.vue create mode 100644 src/components/itemSelect/single.vue create mode 100644 src/components/machinerySelect/index.vue create mode 100644 src/components/machinerySelect/single.vue create mode 100644 src/components/oqcSelect/single.vue create mode 100644 src/components/package/single.vue create mode 100644 src/components/qcindexSelect/single.vue create mode 100644 src/components/reportSelect/single.vue create mode 100644 src/components/stockSelect/multi.vue create mode 100644 src/components/stockSelect/single.vue create mode 100644 src/components/userSelect/multi.vue create mode 100644 src/components/userSelect/single.vue create mode 100644 src/components/vendorSelect/single.vue create mode 100644 src/components/workorderSelect/single.vue create mode 100644 src/components/workstationSelect/simpletableSingle.vue create mode 100644 src/config/website.js create mode 100644 src/directive/dialog/drag.js create mode 100644 src/directive/dialog/dragHeight.js create mode 100644 src/directive/dialog/dragWidth.js create mode 100644 src/directive/index.js create mode 100644 src/directive/module/clipboard.js create mode 100644 src/directive/permission/hasPermi.js create mode 100644 src/directive/permission/hasRole.js create mode 100644 src/layout/components/AppMain.vue create mode 100644 src/layout/components/InnerLink/index.vue create mode 100644 src/layout/components/Navbar.vue create mode 100644 src/layout/components/Settings/index.vue create mode 100644 src/layout/components/Sidebar/FixiOSBug.js create mode 100644 src/layout/components/Sidebar/Item.vue create mode 100644 src/layout/components/Sidebar/Link.vue create mode 100644 src/layout/components/Sidebar/Logo.vue create mode 100644 src/layout/components/Sidebar/SidebarItem.vue create mode 100644 src/layout/components/Sidebar/index.vue create mode 100644 src/layout/components/TagsView/ScrollPane.vue create mode 100644 src/layout/components/TagsView/index.vue create mode 100644 src/layout/components/index.js create mode 100644 src/layout/index.vue create mode 100644 src/layout/mixin/ResizeHandler.js create mode 100644 src/main.js create mode 100644 src/permission.js create mode 100644 src/plugins/auth.js create mode 100644 src/plugins/cache.js create mode 100644 src/plugins/download.js create mode 100644 src/plugins/index.js create mode 100644 src/plugins/modal.js create mode 100644 src/plugins/tab.js create mode 100644 src/router/index.js create mode 100644 src/settings.js create mode 100644 src/store/getters.js create mode 100644 src/store/index.js create mode 100644 src/store/modules/app.js create mode 100644 src/store/modules/permission.js create mode 100644 src/store/modules/settings.js create mode 100644 src/store/modules/tagsView.js create mode 100644 src/store/modules/user.js create mode 100644 src/utils/auth.js create mode 100644 src/utils/calendar.js create mode 100644 src/utils/dict/Dict.js create mode 100644 src/utils/dict/DictConverter.js create mode 100644 src/utils/dict/DictData.js create mode 100644 src/utils/dict/DictMeta.js create mode 100644 src/utils/dict/DictOptions.js create mode 100644 src/utils/dict/index.js create mode 100644 src/utils/errorCode.js create mode 100644 src/utils/generator/config.js create mode 100644 src/utils/generator/css.js create mode 100644 src/utils/generator/drawingDefault.js create mode 100644 src/utils/generator/html.js create mode 100644 src/utils/generator/icon.json create mode 100644 src/utils/generator/js.js create mode 100644 src/utils/generator/render.js create mode 100644 src/utils/index.js create mode 100644 src/utils/jsencrypt.js create mode 100644 src/utils/permission.js create mode 100644 src/utils/request.js create mode 100644 src/utils/ruoyi.js create mode 100644 src/utils/scroll-to.js create mode 100644 src/utils/validate.js create mode 100644 src/views/components/icons/element-icons.js create mode 100644 src/views/components/icons/index.vue create mode 100644 src/views/components/icons/svg-icons.js create mode 100644 src/views/dashboard/BarChart.vue create mode 100644 src/views/dashboard/LineChart.vue create mode 100644 src/views/dashboard/PanelGroup.vue create mode 100644 src/views/dashboard/PieChart.vue create mode 100644 src/views/dashboard/RaddarChart.vue create mode 100644 src/views/dashboard/mixins/resize.js create mode 100644 src/views/error/401.vue create mode 100644 src/views/error/404.vue create mode 100644 src/views/index.vue create mode 100644 src/views/index_v1.vue create mode 100644 src/views/login.vue create mode 100644 src/views/mes/cal/calendar/calendarType.vue create mode 100644 src/views/mes/cal/calendar/index.vue create mode 100644 src/views/mes/cal/calendar/person.vue create mode 100644 src/views/mes/cal/calendar/team.vue create mode 100644 src/views/mes/cal/holiday/index.vue create mode 100644 src/views/mes/cal/plan/index.vue create mode 100644 src/views/mes/cal/plan/shift.vue create mode 100644 src/views/mes/cal/plan/team.vue create mode 100644 src/views/mes/cal/team/index.vue create mode 100644 src/views/mes/cal/team/member.vue create mode 100644 src/views/mes/dv/checkplan/index.vue create mode 100644 src/views/mes/dv/checkplan/machinery.vue create mode 100644 src/views/mes/dv/checkplan/subject.vue create mode 100644 src/views/mes/dv/machinery/index.vue create mode 100644 src/views/mes/dv/machinerytype/index.vue create mode 100644 src/views/mes/dv/repair/index.vue create mode 100644 src/views/mes/dv/repair/line.vue create mode 100644 src/views/mes/dv/subject/index.vue create mode 100644 src/views/mes/md/bom/index.vue create mode 100644 src/views/mes/md/client/index.vue create mode 100644 src/views/mes/md/itemtype/index.vue create mode 100644 src/views/mes/md/mditem/components/itembom.vue create mode 100644 src/views/mes/md/mditem/components/sip.vue create mode 100644 src/views/mes/md/mditem/components/sop.vue create mode 100644 src/views/mes/md/mditem/index.vue create mode 100644 src/views/mes/md/unitmeasure/index.vue create mode 100644 src/views/mes/md/vendor/index.vue create mode 100644 src/views/mes/md/workshop/index.vue create mode 100644 src/views/mes/md/workstation/components/machine.vue create mode 100644 src/views/mes/md/workstation/components/tool.vue create mode 100644 src/views/mes/md/workstation/components/worker.vue create mode 100644 src/views/mes/md/workstation/index.vue create mode 100644 src/views/mes/pro/feedback/index.vue create mode 100644 src/views/mes/pro/process/content.vue create mode 100644 src/views/mes/pro/process/index.vue create mode 100644 src/views/mes/pro/proroute/index.vue create mode 100644 src/views/mes/pro/proroute/product.vue create mode 100644 src/views/mes/pro/proroute/routeprocess.vue create mode 100644 src/views/mes/pro/proroute/routeproductbom.vue create mode 100644 src/views/mes/pro/schedule/ganttedit.vue create mode 100644 src/views/mes/pro/schedule/ganttx.vue create mode 100644 src/views/mes/pro/schedule/index.vue create mode 100644 src/views/mes/pro/schedule/proTask.vue create mode 100644 src/views/mes/pro/workorder/bom/bom.vue create mode 100644 src/views/mes/pro/workorder/index.vue create mode 100644 src/views/mes/pro/workorder/items/item.vue create mode 100644 src/views/mes/qc/defectrecord/index.vue create mode 100644 src/views/mes/qc/ipqc/index.vue create mode 100644 src/views/mes/qc/ipqc/line.vue create mode 100644 src/views/mes/qc/iqc/iqc.vue create mode 100644 src/views/mes/qc/iqc/iqcline.vue create mode 100644 src/views/mes/qc/oqc/index.vue create mode 100644 src/views/mes/qc/oqc/line.vue create mode 100644 src/views/mes/qc/pendinginspect/index.vue create mode 100644 src/views/mes/qc/pendinginspect/iqc.vue create mode 100644 src/views/mes/qc/pendinginspect/oqc.vue create mode 100644 src/views/mes/qc/pendinginspect/pqc.vue create mode 100644 src/views/mes/qc/qcdefect/index.vue create mode 100644 src/views/mes/qc/qcindex/index.vue create mode 100644 src/views/mes/qc/qctemplate/index.vue create mode 100644 src/views/mes/qc/qctemplate/templateindex.vue create mode 100644 src/views/mes/qc/qctemplate/templateproduct.vue create mode 100644 src/views/mes/report/designer/index.vue create mode 100644 src/views/mes/report/index.vue create mode 100644 src/views/mes/tm/tool/index.vue create mode 100644 src/views/mes/tm/tooltype/index.vue create mode 100644 src/views/mes/wm/area/index.vue create mode 100644 src/views/mes/wm/barcode/batchprint.vue create mode 100644 src/views/mes/wm/barcode/config.vue create mode 100644 src/views/mes/wm/barcode/index.vue create mode 100644 src/views/mes/wm/issue/index.vue create mode 100644 src/views/mes/wm/issue/line.vue create mode 100644 src/views/mes/wm/itemconsume/index.vue create mode 100644 src/views/mes/wm/itemconsume/line.vue create mode 100644 src/views/mes/wm/itemrecpt/index.vue create mode 100644 src/views/mes/wm/itemrecpt/line.vue create mode 100644 src/views/mes/wm/location/index.vue create mode 100644 src/views/mes/wm/outsourceissue/index.vue create mode 100644 src/views/mes/wm/outsourceissue/line.vue create mode 100644 src/views/mes/wm/outsourcerecpt/index.vue create mode 100644 src/views/mes/wm/outsourcerecpt/line.vue create mode 100644 src/views/mes/wm/package/index.vue create mode 100644 src/views/mes/wm/package/line.vue create mode 100644 src/views/mes/wm/package/subpackge.vue create mode 100644 src/views/mes/wm/productproduce/index.vue create mode 100644 src/views/mes/wm/productproduce/line.vue create mode 100644 src/views/mes/wm/productrecpt/index.vue create mode 100644 src/views/mes/wm/productrecpt/line.vue create mode 100644 src/views/mes/wm/productsalse/index.vue create mode 100644 src/views/mes/wm/productsalse/line.vue create mode 100644 src/views/mes/wm/rtissue/index.vue create mode 100644 src/views/mes/wm/rtissue/line.vue create mode 100644 src/views/mes/wm/rtsalse/index.vue create mode 100644 src/views/mes/wm/rtsalse/line.vue create mode 100644 src/views/mes/wm/rtvendor/index.vue create mode 100644 src/views/mes/wm/rtvendor/line.vue create mode 100644 src/views/mes/wm/sn/index.vue create mode 100644 src/views/mes/wm/sn/sn.vue create mode 100644 src/views/mes/wm/stocktaking/index.vue create mode 100644 src/views/mes/wm/stocktaking/line.vue create mode 100644 src/views/mes/wm/stocktaking/result.vue create mode 100644 src/views/mes/wm/transfer/index.vue create mode 100644 src/views/mes/wm/transfer/line.vue create mode 100644 src/views/mes/wm/warehouse/index.vue create mode 100644 src/views/mes/wm/wmstock/index.vue create mode 100644 src/views/monitor/cache/index.vue create mode 100644 src/views/monitor/druid/index.vue create mode 100644 src/views/monitor/job/index.vue create mode 100644 src/views/monitor/job/log.vue create mode 100644 src/views/monitor/logininfor/index.vue create mode 100644 src/views/monitor/online/index.vue create mode 100644 src/views/monitor/operlog/index.vue create mode 100644 src/views/monitor/server/index.vue create mode 100644 src/views/print/printerconfig/index.vue create mode 100644 src/views/print/printtemplate/alignBottom.svg create mode 100644 src/views/print/printtemplate/font-size.js create mode 100644 src/views/print/printtemplate/index.vue create mode 100644 src/views/print/printtemplate/list.vue create mode 100644 src/views/print/printtemplate/panel.js create mode 100644 src/views/print/printtemplate/preview.vue create mode 100644 src/views/print/printtemplate/print-data.js create mode 100644 src/views/print/printtemplate/printData.js create mode 100644 src/views/print/printtemplate/scale.js create mode 100644 src/views/print/printtemplate/templateedit.vue create mode 100644 src/views/redirect.vue create mode 100644 src/views/register.vue create mode 100644 src/views/system/autocode/index.vue create mode 100644 src/views/system/autocode/part.vue create mode 100644 src/views/system/config/index.vue create mode 100644 src/views/system/dept/index.vue create mode 100644 src/views/system/dict/data.vue create mode 100644 src/views/system/dict/index.vue create mode 100644 src/views/system/menu/index.vue create mode 100644 src/views/system/message/index.vue create mode 100644 src/views/system/notice/index.vue create mode 100644 src/views/system/post/index.vue create mode 100644 src/views/system/role/authUser.vue create mode 100644 src/views/system/role/index.vue create mode 100644 src/views/system/role/selectUser.vue create mode 100644 src/views/system/user/authRole.vue create mode 100644 src/views/system/user/index.vue create mode 100644 src/views/system/user/profile/index.vue create mode 100644 src/views/system/user/profile/resetPwd.vue create mode 100644 src/views/system/user/profile/userAvatar.vue create mode 100644 src/views/system/user/profile/userInfo.vue create mode 100644 src/views/tool/build/CodeTypeDialog.vue create mode 100644 src/views/tool/build/DraggableItem.vue create mode 100644 src/views/tool/build/IconsDialog.vue create mode 100644 src/views/tool/build/RightPanel.vue create mode 100644 src/views/tool/build/TreeNodeDialog.vue create mode 100644 src/views/tool/build/index.vue create mode 100644 src/views/tool/gen/basicInfoForm.vue create mode 100644 src/views/tool/gen/editTable.vue create mode 100644 src/views/tool/gen/genInfoForm.vue create mode 100644 src/views/tool/gen/importTable.vue create mode 100644 src/views/tool/gen/index.vue create mode 100644 src/views/tool/swagger/index.vue create mode 100644 vue.config.js diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..03d9869 --- /dev/null +++ b/.gitignore @@ -0,0 +1,26 @@ +.DS_Store +node_modules/ +dist/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +**/*.log + +tests/**/coverage/ +tests/e2e/reports +selenium-debug.log + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln +*.local +.editorconfig +.eslintignore +.eslintrc.js +.env.* +package-lock.json +yarn.lock diff --git a/README.en.md b/README.en.md new file mode 100644 index 0000000..40e4fa4 --- /dev/null +++ b/README.en.md @@ -0,0 +1,36 @@ +# ktg-mes-ui + +#### Description +开源、免费MES系统的前端 + +#### Software Architecture +Software architecture description + +#### Installation + +1. xxxx +2. xxxx +3. xxxx + +#### Instructions + +1. xxxx +2. xxxx +3. xxxx + +#### Contribution + +1. Fork the repository +2. Create Feat_xxx branch +3. Commit your code +4. Create Pull Request + + +#### Gitee Feature + +1. You can use Readme\_XXX.md to support different languages, such as Readme\_en.md, Readme\_zh.md +2. Gitee blog [blog.gitee.com](https://blog.gitee.com) +3. Explore open source project [https://gitee.com/explore](https://gitee.com/explore) +4. The most valuable open source project [GVP](https://gitee.com/gvp) +5. The manual of Gitee [https://gitee.com/help](https://gitee.com/help) +6. The most popular members [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) diff --git a/README.md b/README.md new file mode 100644 index 0000000..72c2acb --- /dev/null +++ b/README.md @@ -0,0 +1,8 @@ +# ktg-mes-ui + +#### 介绍 +开源、免费MES系统的前端 + +#### 部署 +·执行npm install 命令(cnpm install)安装所有依赖包。 +·执行npm run dev 运行前端代码。 diff --git a/babel.config.js b/babel.config.js new file mode 100644 index 0000000..b99f001 --- /dev/null +++ b/babel.config.js @@ -0,0 +1,13 @@ +module.exports = { + presets: [ + // https://github.com/vuejs/vue-cli/tree/master/packages/@vue/babel-preset-app + '@vue/cli-plugin-babel/preset' + ], + 'env': { + 'development': { + // babel-plugin-dynamic-import-node plugin only does one thing by converting all import() to require(). + // This plugin can significantly increase the speed of hot updates, when you have a large number of pages. + 'plugins': ['dynamic-import-node'] + } + } +} diff --git a/bin/build.bat b/bin/build.bat new file mode 100644 index 0000000..dda590d --- /dev/null +++ b/bin/build.bat @@ -0,0 +1,12 @@ +@echo off +echo. +echo [Ϣ] Weḅdistļ +echo. + +%~d0 +cd %~dp0 + +cd .. +npm run build:prod + +pause \ No newline at end of file diff --git a/bin/package.bat b/bin/package.bat new file mode 100644 index 0000000..0e5bc0f --- /dev/null +++ b/bin/package.bat @@ -0,0 +1,12 @@ +@echo off +echo. +echo [Ϣ] װWeḅnode_modulesļ +echo. + +%~d0 +cd %~dp0 + +cd .. +npm install --registry=https://registry.npmmirror.com + +pause \ No newline at end of file diff --git a/bin/run-web.bat b/bin/run-web.bat new file mode 100644 index 0000000..d30deae --- /dev/null +++ b/bin/run-web.bat @@ -0,0 +1,12 @@ +@echo off +echo. +echo [Ϣ] ʹ Vue CLI Web ̡ +echo. + +%~d0 +cd %~dp0 + +cd .. +npm run dev + +pause \ No newline at end of file diff --git a/build/index.js b/build/index.js new file mode 100644 index 0000000..0c57de2 --- /dev/null +++ b/build/index.js @@ -0,0 +1,35 @@ +const { run } = require('runjs') +const chalk = require('chalk') +const config = require('../vue.config.js') +const rawArgv = process.argv.slice(2) +const args = rawArgv.join(' ') + +if (process.env.npm_config_preview || rawArgv.includes('--preview')) { + const report = rawArgv.includes('--report') + + run(`vue-cli-service build ${args}`) + + const port = 9526 + const publicPath = config.publicPath + + var connect = require('connect') + var serveStatic = require('serve-static') + const app = connect() + + app.use( + publicPath, + serveStatic('./dist', { + index: ['index.html', '/'] + }) + ) + + app.listen(port, function () { + console.log(chalk.green(`> Preview at http://localhost:${port}${publicPath}`)) + if (report) { + console.log(chalk.green(`> Report at http://localhost:${port}${publicPath}report.html`)) + } + + }) +} else { + run(`vue-cli-service build ${args}`) +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..ac13423 --- /dev/null +++ b/package.json @@ -0,0 +1,96 @@ +{ + "name": "ktg-mes-ui", + "version": "3.8.2", + "description": "苦糖果MES", + "author": "YinJinLu", + "license": "MIT", + "scripts": { + "dev": "vue-cli-service serve", + "build:prod": "vue-cli-service build", + "build:stage": "vue-cli-service build --mode staging", + "preview": "node build/index.js --preview", + "lint": "eslint --ext .js,.vue src" + }, + "husky": { + "hooks": { + "pre-commit": "lint-staged" + } + }, + "lint-staged": { + "src/**/*.{js,vue}": [ + "eslint --fix", + "git add" + ] + }, + "keywords": [ + "vue", + "admin", + "dashboard", + "element-ui", + "boilerplate", + "admin-template", + "management-system" + ], + "repository": { + "type": "git", + "url": "https://gitee.com/kutangguo/ktg-mes-ui.git" + }, + "dependencies": { + "@dhtmlx/trial-vue-gantt": "1.1.0", + "@riophae/vue-treeselect": "0.4.0", + "axios": "0.24.0", + "clipboard": "2.0.8", + "core-js": "^3.21.1", + "dhtmlx-gantt": "^7.1.11", + "echarts": "4.9.0", + "element-ui": "2.15.6", + "file-saver": "2.0.5", + "fuse.js": "6.4.3", + "highlight.js": "9.18.5", + "html2canvas": "^1.4.1", + "js-beautify": "1.13.0", + "js-cookie": "3.0.1", + "jsencrypt": "3.0.0-rc.1", + "nprogress": "0.2.0", + "quill": "1.3.7", + "screenfull": "5.0.2", + "sortablejs": "1.10.2", + "vue": "2.6.12", + "vue-count-to": "1.0.13", + "vue-cropper": "0.5.5", + "vue-meta": "2.4.0", + "vue-plugin-hiprint": "^0.0.54-fix", + "vue-router": "3.4.9", + "vuedraggable": "2.24.3", + "vuex": "3.6.0" + }, + "devDependencies": { + "@vue/cli-plugin-babel": "4.4.6", + "@vue/cli-plugin-eslint": "4.4.6", + "@vue/cli-service": "4.4.6", + "babel-eslint": "10.1.0", + "babel-plugin-dynamic-import-node": "2.3.3", + "chalk": "4.1.0", + "compression-webpack-plugin": "5.0.2", + "connect": "3.6.6", + "eslint": "7.15.0", + "eslint-plugin-vue": "7.2.0", + "less": "^4.2.0", + "less-loader": "^11.1.3", + "lint-staged": "10.5.3", + "runjs": "4.4.2", + "sass": "1.32.13", + "sass-loader": "10.1.1", + "script-ext-html-webpack-plugin": "2.1.5", + "svg-sprite-loader": "5.1.1", + "vue-template-compiler": "2.6.12" + }, + "engines": { + "node": ">=8.9", + "npm": ">= 3.0.0" + }, + "browserslist": [ + "> 1%", + "last 2 versions" + ] +} diff --git a/public/favicon.ico b/public/favicon.ico new file mode 100644 index 0000000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stH^u*wUECA*{B?xeIs zr6uAS7x%*L7xkYn{a1|hPv?Tox=3)$j?>nPvwI+1Lp=i0zusEf<~!oV%<#Pn&*b); zb7&Pr9nbn#VEzo^+VgVQc!R4c`6E-jQ#2Nm?K94w>5alfCmf$1crfAg<~|;j8~Y~N z!^K~2e7^KwFrJG*=AqGwXQ0WLni$Nv0Z^C-wXyp<}N?9~LJumyJb>ghGlh=lOBwgGt<9lEkC@pq`%a6f#|(JMg1pqG9+D zLoRc^vzLd95P}fx8V8Z#5leBZJS0yKVdcd~QDu xI<}4SZDVZf$ZKK3#^O#*+{pB0O8ZPtpT~J@m-e{ + + + + 请升级您的浏览器 + + + + + + +

请升级您的浏览器,以便我们更好的为您提供服务!

+

您正在使用 Internet Explorer 的早期版本(IE11以下版本或使用该内核的浏览器)。这意味着在升级浏览器前,您将无法访问此网站。

+
+

请注意:微软公司对Windows XP 及 Internet Explorer 早期版本的支持已经结束

+

自 2016 年 1 月 12 日起,Microsoft 不再为 IE 11 以下版本提供相应支持和更新。没有关键的浏览器安全更新,您的电脑可能易受有害病毒、间谍软件和其他恶意软件的攻击,它们可以窃取或损害您的业务数据和信息。请参阅 微软对 Internet Explorer 早期版本的支持将于 2016 年 1 月 12 日结束的说明

+
+

您可以选择更先进的浏览器

+

推荐使用以下浏览器的最新版本。如果您的电脑已有以下浏览器的最新版本则直接使用该浏览器访问即可。

+ +
+ + \ No newline at end of file diff --git a/public/index.html b/public/index.html new file mode 100644 index 0000000..ee2e6e4 --- /dev/null +++ b/public/index.html @@ -0,0 +1,209 @@ + + + + + + + + + + <%= webpackConfig.name %> + + + + +
+
+
+
+
+
正在加载系统资源,请耐心等待
+
+
+ + diff --git a/public/pdf/build/pdf.js b/public/pdf/build/pdf.js new file mode 100644 index 0000000..38c3c9b --- /dev/null +++ b/public/pdf/build/pdf.js @@ -0,0 +1,16425 @@ +/** + * @licstart The following is the entire license notice for the + * JavaScript code in this page + * + * Copyright 2022 Mozilla Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * @licend The above is the entire license notice for the + * JavaScript code in this page + */ + +(function webpackUniversalModuleDefinition(root, factory) { + if(typeof exports === 'object' && typeof module === 'object') + module.exports = factory(); + else if(typeof define === 'function' && define.amd) + define("pdfjs-dist/build/pdf", [], factory); + else if(typeof exports === 'object') + exports["pdfjs-dist/build/pdf"] = factory(); + else + root["pdfjs-dist/build/pdf"] = root.pdfjsLib = factory(); +})(this, () => { +return /******/ (() => { // webpackBootstrap +/******/ "use strict"; +/******/ var __webpack_modules__ = ([ +/* 0 */, +/* 1 */ +/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.VerbosityLevel = exports.Util = exports.UnknownErrorException = exports.UnexpectedResponseException = exports.UNSUPPORTED_FEATURES = exports.TextRenderingMode = exports.StreamType = exports.RenderingIntentFlag = exports.PermissionFlag = exports.PasswordResponses = exports.PasswordException = exports.PageActionEventType = exports.OPS = exports.MissingPDFException = exports.InvalidPDFException = exports.ImageKind = exports.IDENTITY_MATRIX = exports.FormatError = exports.FontType = exports.FeatureTest = exports.FONT_IDENTITY_MATRIX = exports.DocumentActionEventType = exports.CMapCompressionType = exports.BaseException = exports.AnnotationType = exports.AnnotationStateModelType = exports.AnnotationReviewState = exports.AnnotationReplyType = exports.AnnotationMode = exports.AnnotationMarkedState = exports.AnnotationFlag = exports.AnnotationFieldFlag = exports.AnnotationBorderStyleType = exports.AnnotationActionEventType = exports.AbortException = void 0; +exports.arrayByteLength = arrayByteLength; +exports.arraysToBytes = arraysToBytes; +exports.assert = assert; +exports.bytesToString = bytesToString; +exports.createPromiseCapability = createPromiseCapability; +exports.createValidAbsoluteUrl = createValidAbsoluteUrl; +exports.escapeString = escapeString; +exports.getModificationDate = getModificationDate; +exports.getVerbosityLevel = getVerbosityLevel; +exports.info = info; +exports.isArrayBuffer = isArrayBuffer; +exports.isArrayEqual = isArrayEqual; +exports.isAscii = isAscii; +exports.objectFromMap = objectFromMap; +exports.objectSize = objectSize; +exports.setVerbosityLevel = setVerbosityLevel; +exports.shadow = shadow; +exports.string32 = string32; +exports.stringToBytes = stringToBytes; +exports.stringToPDFString = stringToPDFString; +exports.stringToUTF16BEString = stringToUTF16BEString; +exports.stringToUTF8String = stringToUTF8String; +exports.unreachable = unreachable; +exports.utf8StringToString = utf8StringToString; +exports.warn = warn; + +__w_pdfjs_require__(2); + +const IDENTITY_MATRIX = [1, 0, 0, 1, 0, 0]; +exports.IDENTITY_MATRIX = IDENTITY_MATRIX; +const FONT_IDENTITY_MATRIX = [0.001, 0, 0, 0.001, 0, 0]; +exports.FONT_IDENTITY_MATRIX = FONT_IDENTITY_MATRIX; +const RenderingIntentFlag = { + ANY: 0x01, + DISPLAY: 0x02, + PRINT: 0x04, + ANNOTATIONS_FORMS: 0x10, + ANNOTATIONS_STORAGE: 0x20, + ANNOTATIONS_DISABLE: 0x40, + OPLIST: 0x100 +}; +exports.RenderingIntentFlag = RenderingIntentFlag; +const AnnotationMode = { + DISABLE: 0, + ENABLE: 1, + ENABLE_FORMS: 2, + ENABLE_STORAGE: 3 +}; +exports.AnnotationMode = AnnotationMode; +const PermissionFlag = { + PRINT: 0x04, + MODIFY_CONTENTS: 0x08, + COPY: 0x10, + MODIFY_ANNOTATIONS: 0x20, + FILL_INTERACTIVE_FORMS: 0x100, + COPY_FOR_ACCESSIBILITY: 0x200, + ASSEMBLE: 0x400, + PRINT_HIGH_QUALITY: 0x800 +}; +exports.PermissionFlag = PermissionFlag; +const TextRenderingMode = { + 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 +}; +exports.TextRenderingMode = TextRenderingMode; +const ImageKind = { + GRAYSCALE_1BPP: 1, + RGB_24BPP: 2, + RGBA_32BPP: 3 +}; +exports.ImageKind = ImageKind; +const AnnotationType = { + 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 +}; +exports.AnnotationType = AnnotationType; +const AnnotationStateModelType = { + MARKED: "Marked", + REVIEW: "Review" +}; +exports.AnnotationStateModelType = AnnotationStateModelType; +const AnnotationMarkedState = { + MARKED: "Marked", + UNMARKED: "Unmarked" +}; +exports.AnnotationMarkedState = AnnotationMarkedState; +const AnnotationReviewState = { + ACCEPTED: "Accepted", + REJECTED: "Rejected", + CANCELLED: "Cancelled", + COMPLETED: "Completed", + NONE: "None" +}; +exports.AnnotationReviewState = AnnotationReviewState; +const AnnotationReplyType = { + GROUP: "Group", + REPLY: "R" +}; +exports.AnnotationReplyType = AnnotationReplyType; +const AnnotationFlag = { + INVISIBLE: 0x01, + HIDDEN: 0x02, + PRINT: 0x04, + NOZOOM: 0x08, + NOROTATE: 0x10, + NOVIEW: 0x20, + READONLY: 0x40, + LOCKED: 0x80, + TOGGLENOVIEW: 0x100, + LOCKEDCONTENTS: 0x200 +}; +exports.AnnotationFlag = AnnotationFlag; +const AnnotationFieldFlag = { + READONLY: 0x0000001, + REQUIRED: 0x0000002, + NOEXPORT: 0x0000004, + MULTILINE: 0x0001000, + PASSWORD: 0x0002000, + NOTOGGLETOOFF: 0x0004000, + RADIO: 0x0008000, + PUSHBUTTON: 0x0010000, + COMBO: 0x0020000, + EDIT: 0x0040000, + SORT: 0x0080000, + FILESELECT: 0x0100000, + MULTISELECT: 0x0200000, + DONOTSPELLCHECK: 0x0400000, + DONOTSCROLL: 0x0800000, + COMB: 0x1000000, + RICHTEXT: 0x2000000, + RADIOSINUNISON: 0x2000000, + COMMITONSELCHANGE: 0x4000000 +}; +exports.AnnotationFieldFlag = AnnotationFieldFlag; +const AnnotationBorderStyleType = { + SOLID: 1, + DASHED: 2, + BEVELED: 3, + INSET: 4, + UNDERLINE: 5 +}; +exports.AnnotationBorderStyleType = AnnotationBorderStyleType; +const AnnotationActionEventType = { + 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" +}; +exports.AnnotationActionEventType = AnnotationActionEventType; +const DocumentActionEventType = { + WC: "WillClose", + WS: "WillSave", + DS: "DidSave", + WP: "WillPrint", + DP: "DidPrint" +}; +exports.DocumentActionEventType = DocumentActionEventType; +const PageActionEventType = { + O: "PageOpen", + C: "PageClose" +}; +exports.PageActionEventType = PageActionEventType; +const StreamType = { + UNKNOWN: "UNKNOWN", + FLATE: "FLATE", + LZW: "LZW", + DCT: "DCT", + JPX: "JPX", + JBIG: "JBIG", + A85: "A85", + AHX: "AHX", + CCF: "CCF", + RLX: "RLX" +}; +exports.StreamType = StreamType; +const FontType = { + UNKNOWN: "UNKNOWN", + TYPE1: "TYPE1", + TYPE1STANDARD: "TYPE1STANDARD", + TYPE1C: "TYPE1C", + CIDFONTTYPE0: "CIDFONTTYPE0", + CIDFONTTYPE0C: "CIDFONTTYPE0C", + TRUETYPE: "TRUETYPE", + CIDFONTTYPE2: "CIDFONTTYPE2", + TYPE3: "TYPE3", + OPENTYPE: "OPENTYPE", + TYPE0: "TYPE0", + MMTYPE1: "MMTYPE1" +}; +exports.FontType = FontType; +const VerbosityLevel = { + ERRORS: 0, + WARNINGS: 1, + INFOS: 5 +}; +exports.VerbosityLevel = VerbosityLevel; +const CMapCompressionType = { + NONE: 0, + BINARY: 1, + STREAM: 2 +}; +exports.CMapCompressionType = CMapCompressionType; +const OPS = { + 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, + beginAnnotations: 78, + endAnnotations: 79, + beginAnnotation: 80, + endAnnotation: 81, + paintJpegXObject: 82, + paintImageMaskXObject: 83, + paintImageMaskXObjectGroup: 84, + paintImageXObject: 85, + paintInlineImageXObject: 86, + paintInlineImageXObjectGroup: 87, + paintImageXObjectRepeat: 88, + paintImageMaskXObjectRepeat: 89, + paintSolidColorImageMask: 90, + constructPath: 91 +}; +exports.OPS = OPS; +const UNSUPPORTED_FEATURES = { + unknown: "unknown", + forms: "forms", + javaScript: "javaScript", + signatures: "signatures", + smask: "smask", + shadingPattern: "shadingPattern", + font: "font", + errorTilingPattern: "errorTilingPattern", + errorExtGState: "errorExtGState", + errorXObject: "errorXObject", + errorFontLoadType3: "errorFontLoadType3", + errorFontState: "errorFontState", + errorFontMissing: "errorFontMissing", + errorFontTranslate: "errorFontTranslate", + errorColorSpace: "errorColorSpace", + errorOperatorList: "errorOperatorList", + errorFontToUnicode: "errorFontToUnicode", + errorFontLoadNative: "errorFontLoadNative", + errorFontBuildPath: "errorFontBuildPath", + errorFontGetPath: "errorFontGetPath", + errorMarkedContent: "errorMarkedContent", + errorContentSubStream: "errorContentSubStream" +}; +exports.UNSUPPORTED_FEATURES = UNSUPPORTED_FEATURES; +const PasswordResponses = { + NEED_PASSWORD: 1, + INCORRECT_PASSWORD: 2 +}; +exports.PasswordResponses = PasswordResponses; +let verbosity = VerbosityLevel.WARNINGS; + +function setVerbosityLevel(level) { + if (Number.isInteger(level)) { + verbosity = level; + } +} + +function getVerbosityLevel() { + return verbosity; +} + +function info(msg) { + if (verbosity >= VerbosityLevel.INFOS) { + console.log(`Info: ${msg}`); + } +} + +function warn(msg) { + if (verbosity >= VerbosityLevel.WARNINGS) { + console.log(`Warning: ${msg}`); + } +} + +function unreachable(msg) { + throw new Error(msg); +} + +function assert(cond, msg) { + if (!cond) { + unreachable(msg); + } +} + +function _isValidProtocol(url) { + if (!url) { + return false; + } + + switch (url.protocol) { + case "http:": + case "https:": + case "ftp:": + case "mailto:": + case "tel:": + return true; + + default: + return false; + } +} + +function createValidAbsoluteUrl(url, baseUrl = null, options = null) { + if (!url) { + return null; + } + + try { + if (options && typeof url === "string") { + if (options.addDefaultProtocol && url.startsWith("www.")) { + const dots = url.match(/\./g); + + if (dots && dots.length >= 2) { + url = `http://${url}`; + } + } + + if (options.tryConvertEncoding) { + try { + url = stringToUTF8String(url); + } catch (ex) {} + } + } + + const absoluteUrl = baseUrl ? new URL(url, baseUrl) : new URL(url); + + if (_isValidProtocol(absoluteUrl)) { + return absoluteUrl; + } + } catch (ex) {} + + return null; +} + +function shadow(obj, prop, value) { + Object.defineProperty(obj, prop, { + value, + enumerable: true, + configurable: true, + writable: false + }); + return value; +} + +const BaseException = function BaseExceptionClosure() { + function BaseException(message, name) { + if (this.constructor === BaseException) { + unreachable("Cannot initialize BaseException."); + } + + this.message = message; + this.name = name; + } + + BaseException.prototype = new Error(); + BaseException.constructor = BaseException; + return BaseException; +}(); + +exports.BaseException = BaseException; + +class PasswordException extends BaseException { + constructor(msg, code) { + super(msg, "PasswordException"); + this.code = code; + } + +} + +exports.PasswordException = PasswordException; + +class UnknownErrorException extends BaseException { + constructor(msg, details) { + super(msg, "UnknownErrorException"); + this.details = details; + } + +} + +exports.UnknownErrorException = UnknownErrorException; + +class InvalidPDFException extends BaseException { + constructor(msg) { + super(msg, "InvalidPDFException"); + } + +} + +exports.InvalidPDFException = InvalidPDFException; + +class MissingPDFException extends BaseException { + constructor(msg) { + super(msg, "MissingPDFException"); + } + +} + +exports.MissingPDFException = MissingPDFException; + +class UnexpectedResponseException extends BaseException { + constructor(msg, status) { + super(msg, "UnexpectedResponseException"); + this.status = status; + } + +} + +exports.UnexpectedResponseException = UnexpectedResponseException; + +class FormatError extends BaseException { + constructor(msg) { + super(msg, "FormatError"); + } + +} + +exports.FormatError = FormatError; + +class AbortException extends BaseException { + constructor(msg) { + super(msg, "AbortException"); + } + +} + +exports.AbortException = AbortException; + +function bytesToString(bytes) { + if (typeof bytes !== "object" || bytes === null || bytes.length === undefined) { + unreachable("Invalid argument for bytesToString"); + } + + const length = bytes.length; + const MAX_ARGUMENT_COUNT = 8192; + + if (length < MAX_ARGUMENT_COUNT) { + return String.fromCharCode.apply(null, bytes); + } + + const strBuf = []; + + for (let i = 0; i < length; i += MAX_ARGUMENT_COUNT) { + const chunkEnd = Math.min(i + MAX_ARGUMENT_COUNT, length); + const chunk = bytes.subarray(i, chunkEnd); + strBuf.push(String.fromCharCode.apply(null, chunk)); + } + + return strBuf.join(""); +} + +function stringToBytes(str) { + if (typeof str !== "string") { + unreachable("Invalid argument for stringToBytes"); + } + + const length = str.length; + const bytes = new Uint8Array(length); + + for (let i = 0; i < length; ++i) { + bytes[i] = str.charCodeAt(i) & 0xff; + } + + return bytes; +} + +function arrayByteLength(arr) { + if (arr.length !== undefined) { + return arr.length; + } + + if (arr.byteLength !== undefined) { + return arr.byteLength; + } + + unreachable("Invalid argument for arrayByteLength"); +} + +function arraysToBytes(arr) { + const length = arr.length; + + if (length === 1 && arr[0] instanceof Uint8Array) { + return arr[0]; + } + + let resultLength = 0; + + for (let i = 0; i < length; i++) { + resultLength += arrayByteLength(arr[i]); + } + + let pos = 0; + const data = new Uint8Array(resultLength); + + for (let i = 0; i < length; i++) { + let item = arr[i]; + + if (!(item instanceof Uint8Array)) { + if (typeof item === "string") { + item = stringToBytes(item); + } else { + item = new Uint8Array(item); + } + } + + const itemLength = item.byteLength; + data.set(item, pos); + pos += itemLength; + } + + return data; +} + +function string32(value) { + return String.fromCharCode(value >> 24 & 0xff, value >> 16 & 0xff, value >> 8 & 0xff, value & 0xff); +} + +function objectSize(obj) { + return Object.keys(obj).length; +} + +function objectFromMap(map) { + const obj = Object.create(null); + + for (const [key, value] of map) { + obj[key] = value; + } + + return obj; +} + +function isLittleEndian() { + const buffer8 = new Uint8Array(4); + buffer8[0] = 1; + const view32 = new Uint32Array(buffer8.buffer, 0, 1); + return view32[0] === 1; +} + +function isEvalSupported() { + try { + new Function(""); + return true; + } catch (e) { + return false; + } +} + +class FeatureTest { + static get isLittleEndian() { + return shadow(this, "isLittleEndian", isLittleEndian()); + } + + static get isEvalSupported() { + return shadow(this, "isEvalSupported", isEvalSupported()); + } + + static get isOffscreenCanvasSupported() { + return shadow(this, "isOffscreenCanvasSupported", typeof OffscreenCanvas !== "undefined"); + } + +} + +exports.FeatureTest = FeatureTest; +const hexNumbers = [...Array(256).keys()].map(n => n.toString(16).padStart(2, "0")); + +class Util { + static makeHexColor(r, g, b) { + return `#${hexNumbers[r]}${hexNumbers[g]}${hexNumbers[b]}`; + } + + static scaleMinMax(transform, minMax) { + let temp; + + if (transform[0]) { + if (transform[0] < 0) { + temp = minMax[0]; + minMax[0] = minMax[1]; + minMax[1] = temp; + } + + minMax[0] *= transform[0]; + minMax[1] *= transform[0]; + + if (transform[3] < 0) { + temp = minMax[2]; + minMax[2] = minMax[3]; + minMax[3] = temp; + } + + minMax[2] *= transform[3]; + minMax[3] *= transform[3]; + } else { + temp = minMax[0]; + minMax[0] = minMax[2]; + minMax[2] = temp; + temp = minMax[1]; + minMax[1] = minMax[3]; + minMax[3] = temp; + + if (transform[1] < 0) { + temp = minMax[2]; + minMax[2] = minMax[3]; + minMax[3] = temp; + } + + minMax[2] *= transform[1]; + minMax[3] *= transform[1]; + + if (transform[2] < 0) { + temp = minMax[0]; + minMax[0] = minMax[1]; + minMax[1] = temp; + } + + minMax[0] *= transform[2]; + minMax[1] *= transform[2]; + } + + minMax[0] += transform[4]; + minMax[1] += transform[4]; + minMax[2] += transform[5]; + minMax[3] += transform[5]; + } + + static transform(m1, m2) { + return [m1[0] * m2[0] + m1[2] * m2[1], m1[1] * m2[0] + m1[3] * m2[1], m1[0] * m2[2] + m1[2] * m2[3], m1[1] * m2[2] + m1[3] * m2[3], m1[0] * m2[4] + m1[2] * m2[5] + m1[4], m1[1] * m2[4] + m1[3] * m2[5] + m1[5]]; + } + + static applyTransform(p, m) { + const xt = p[0] * m[0] + p[1] * m[2] + m[4]; + const yt = p[0] * m[1] + p[1] * m[3] + m[5]; + return [xt, yt]; + } + + static applyInverseTransform(p, m) { + const d = m[0] * m[3] - m[1] * m[2]; + const xt = (p[0] * m[3] - p[1] * m[2] + m[2] * m[5] - m[4] * m[3]) / d; + const yt = (-p[0] * m[1] + p[1] * m[0] + m[4] * m[1] - m[5] * m[0]) / d; + return [xt, yt]; + } + + static getAxialAlignedBoundingBox(r, m) { + const p1 = Util.applyTransform(r, m); + const p2 = Util.applyTransform(r.slice(2, 4), m); + const p3 = Util.applyTransform([r[0], r[3]], m); + const p4 = Util.applyTransform([r[2], r[1]], m); + return [Math.min(p1[0], p2[0], p3[0], p4[0]), Math.min(p1[1], p2[1], p3[1], p4[1]), Math.max(p1[0], p2[0], p3[0], p4[0]), Math.max(p1[1], p2[1], p3[1], p4[1])]; + } + + static inverseTransform(m) { + const d = m[0] * m[3] - m[1] * m[2]; + return [m[3] / d, -m[1] / d, -m[2] / d, m[0] / d, (m[2] * m[5] - m[4] * m[3]) / d, (m[4] * m[1] - m[5] * m[0]) / d]; + } + + static apply3dTransform(m, v) { + return [m[0] * v[0] + m[1] * v[1] + m[2] * v[2], m[3] * v[0] + m[4] * v[1] + m[5] * v[2], m[6] * v[0] + m[7] * v[1] + m[8] * v[2]]; + } + + static singularValueDecompose2dScale(m) { + const transpose = [m[0], m[2], m[1], m[3]]; + const a = m[0] * transpose[0] + m[1] * transpose[2]; + const b = m[0] * transpose[1] + m[1] * transpose[3]; + const c = m[2] * transpose[0] + m[3] * transpose[2]; + const d = m[2] * transpose[1] + m[3] * transpose[3]; + const first = (a + d) / 2; + const second = Math.sqrt((a + d) ** 2 - 4 * (a * d - c * b)) / 2; + const sx = first + second || 1; + const sy = first - second || 1; + return [Math.sqrt(sx), Math.sqrt(sy)]; + } + + static normalizeRect(rect) { + const r = rect.slice(0); + + if (rect[0] > rect[2]) { + r[0] = rect[2]; + r[2] = rect[0]; + } + + if (rect[1] > rect[3]) { + r[1] = rect[3]; + r[3] = rect[1]; + } + + return r; + } + + static intersect(rect1, rect2) { + const xLow = Math.max(Math.min(rect1[0], rect1[2]), Math.min(rect2[0], rect2[2])); + const xHigh = Math.min(Math.max(rect1[0], rect1[2]), Math.max(rect2[0], rect2[2])); + + if (xLow > xHigh) { + return null; + } + + const yLow = Math.max(Math.min(rect1[1], rect1[3]), Math.min(rect2[1], rect2[3])); + const yHigh = Math.min(Math.max(rect1[1], rect1[3]), Math.max(rect2[1], rect2[3])); + + if (yLow > yHigh) { + return null; + } + + return [xLow, yLow, xHigh, yHigh]; + } + + static bezierBoundingBox(x0, y0, x1, y1, x2, y2, x3, y3) { + const tvalues = [], + bounds = [[], []]; + let a, b, c, t, t1, t2, b2ac, sqrtb2ac; + + for (let i = 0; i < 2; ++i) { + if (i === 0) { + b = 6 * x0 - 12 * x1 + 6 * x2; + a = -3 * x0 + 9 * x1 - 9 * x2 + 3 * x3; + c = 3 * x1 - 3 * x0; + } else { + b = 6 * y0 - 12 * y1 + 6 * y2; + a = -3 * y0 + 9 * y1 - 9 * y2 + 3 * y3; + c = 3 * y1 - 3 * y0; + } + + if (Math.abs(a) < 1e-12) { + if (Math.abs(b) < 1e-12) { + continue; + } + + t = -c / b; + + if (0 < t && t < 1) { + tvalues.push(t); + } + + continue; + } + + b2ac = b * b - 4 * c * a; + sqrtb2ac = Math.sqrt(b2ac); + + if (b2ac < 0) { + continue; + } + + t1 = (-b + sqrtb2ac) / (2 * a); + + if (0 < t1 && t1 < 1) { + tvalues.push(t1); + } + + t2 = (-b - sqrtb2ac) / (2 * a); + + if (0 < t2 && t2 < 1) { + tvalues.push(t2); + } + } + + let j = tvalues.length, + mt; + const jlen = j; + + while (j--) { + t = tvalues[j]; + mt = 1 - t; + bounds[0][j] = mt * mt * mt * x0 + 3 * mt * mt * t * x1 + 3 * mt * t * t * x2 + t * t * t * x3; + bounds[1][j] = mt * mt * mt * y0 + 3 * mt * mt * t * y1 + 3 * mt * t * t * y2 + t * t * t * y3; + } + + bounds[0][jlen] = x0; + bounds[1][jlen] = y0; + bounds[0][jlen + 1] = x3; + bounds[1][jlen + 1] = y3; + bounds[0].length = bounds[1].length = jlen + 2; + return [Math.min(...bounds[0]), Math.min(...bounds[1]), Math.max(...bounds[0]), Math.max(...bounds[1])]; + } + +} + +exports.Util = Util; +const PDFStringTranslateTable = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x2d8, 0x2c7, 0x2c6, 0x2d9, 0x2dd, 0x2db, 0x2da, 0x2dc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x2022, 0x2020, 0x2021, 0x2026, 0x2014, 0x2013, 0x192, 0x2044, 0x2039, 0x203a, 0x2212, 0x2030, 0x201e, 0x201c, 0x201d, 0x2018, 0x2019, 0x201a, 0x2122, 0xfb01, 0xfb02, 0x141, 0x152, 0x160, 0x178, 0x17d, 0x131, 0x142, 0x153, 0x161, 0x17e, 0, 0x20ac]; + +function stringToPDFString(str) { + if (str[0] >= "\xEF") { + let encoding; + + if (str[0] === "\xFE" && str[1] === "\xFF") { + encoding = "utf-16be"; + } else if (str[0] === "\xFF" && str[1] === "\xFE") { + encoding = "utf-16le"; + } else if (str[0] === "\xEF" && str[1] === "\xBB" && str[2] === "\xBF") { + encoding = "utf-8"; + } + + if (encoding) { + try { + const decoder = new TextDecoder(encoding, { + fatal: true + }); + const buffer = stringToBytes(str); + return decoder.decode(buffer); + } catch (ex) { + warn(`stringToPDFString: "${ex}".`); + } + } + } + + const strBuf = []; + + for (let i = 0, ii = str.length; i < ii; i++) { + const code = PDFStringTranslateTable[str.charCodeAt(i)]; + strBuf.push(code ? String.fromCharCode(code) : str.charAt(i)); + } + + return strBuf.join(""); +} + +function escapeString(str) { + return str.replace(/([()\\\n\r])/g, match => { + if (match === "\n") { + return "\\n"; + } else if (match === "\r") { + return "\\r"; + } + + return `\\${match}`; + }); +} + +function isAscii(str) { + return /^[\x00-\x7F]*$/.test(str); +} + +function stringToUTF16BEString(str) { + const buf = ["\xFE\xFF"]; + + for (let i = 0, ii = str.length; i < ii; i++) { + const char = str.charCodeAt(i); + buf.push(String.fromCharCode(char >> 8 & 0xff), String.fromCharCode(char & 0xff)); + } + + return buf.join(""); +} + +function stringToUTF8String(str) { + return decodeURIComponent(escape(str)); +} + +function utf8StringToString(str) { + return unescape(encodeURIComponent(str)); +} + +function isArrayBuffer(v) { + return typeof v === "object" && v !== null && v.byteLength !== undefined; +} + +function isArrayEqual(arr1, arr2) { + if (arr1.length !== arr2.length) { + return false; + } + + for (let i = 0, ii = arr1.length; i < ii; i++) { + if (arr1[i] !== arr2[i]) { + return false; + } + } + + return true; +} + +function getModificationDate(date = new Date()) { + const buffer = [date.getUTCFullYear().toString(), (date.getUTCMonth() + 1).toString().padStart(2, "0"), date.getUTCDate().toString().padStart(2, "0"), date.getUTCHours().toString().padStart(2, "0"), date.getUTCMinutes().toString().padStart(2, "0"), date.getUTCSeconds().toString().padStart(2, "0")]; + return buffer.join(""); +} + +function createPromiseCapability() { + const capability = Object.create(null); + let isSettled = false; + Object.defineProperty(capability, "settled", { + get() { + return isSettled; + } + + }); + capability.promise = new Promise(function (resolve, reject) { + capability.resolve = function (data) { + isSettled = true; + resolve(data); + }; + + capability.reject = function (reason) { + isSettled = true; + reject(reason); + }; + }); + return capability; +} + +/***/ }), +/* 2 */ +/***/ ((__unused_webpack_module, __unused_webpack_exports, __w_pdfjs_require__) => { + + + +var _is_node = __w_pdfjs_require__(3); + +; + +/***/ }), +/* 3 */ +/***/ ((__unused_webpack_module, exports) => { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.isNodeJS = void 0; +const isNodeJS = typeof process === "object" && process + "" === "[object process]" && !process.versions.nw && !(process.versions.electron && process.type && process.type !== "browser"); +exports.isNodeJS = isNodeJS; + +/***/ }), +/* 4 */ +/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.build = exports.RenderTask = exports.PDFWorkerUtil = exports.PDFWorker = exports.PDFPageProxy = exports.PDFDocumentProxy = exports.PDFDocumentLoadingTask = exports.PDFDataRangeTransport = exports.LoopbackPort = exports.DefaultStandardFontDataFactory = exports.DefaultCanvasFactory = exports.DefaultCMapReaderFactory = void 0; +exports.getDocument = getDocument; +exports.setPDFNetworkStreamFactory = setPDFNetworkStreamFactory; +exports.version = void 0; + +var _util = __w_pdfjs_require__(1); + +var _display_utils = __w_pdfjs_require__(5); + +var _font_loader = __w_pdfjs_require__(7); + +var _annotation_storage = __w_pdfjs_require__(8); + +var _canvas = __w_pdfjs_require__(10); + +var _worker_options = __w_pdfjs_require__(13); + +var _is_node = __w_pdfjs_require__(3); + +var _message_handler = __w_pdfjs_require__(14); + +var _metadata = __w_pdfjs_require__(15); + +var _optional_content_config = __w_pdfjs_require__(16); + +var _transport_stream = __w_pdfjs_require__(17); + +var _xfa_text = __w_pdfjs_require__(18); + +const DEFAULT_RANGE_CHUNK_SIZE = 65536; +const RENDERING_CANCELLED_TIMEOUT = 100; +let DefaultCanvasFactory = _display_utils.DOMCanvasFactory; +exports.DefaultCanvasFactory = DefaultCanvasFactory; +let DefaultCMapReaderFactory = _display_utils.DOMCMapReaderFactory; +exports.DefaultCMapReaderFactory = DefaultCMapReaderFactory; +let DefaultStandardFontDataFactory = _display_utils.DOMStandardFontDataFactory; +exports.DefaultStandardFontDataFactory = DefaultStandardFontDataFactory; + +if (_is_node.isNodeJS) { + const { + NodeCanvasFactory, + NodeCMapReaderFactory, + NodeStandardFontDataFactory + } = __w_pdfjs_require__(19); + + exports.DefaultCanvasFactory = DefaultCanvasFactory = NodeCanvasFactory; + exports.DefaultCMapReaderFactory = DefaultCMapReaderFactory = NodeCMapReaderFactory; + exports.DefaultStandardFontDataFactory = DefaultStandardFontDataFactory = NodeStandardFontDataFactory; +} + +let createPDFNetworkStream; + +function setPDFNetworkStreamFactory(pdfNetworkStreamFactory) { + createPDFNetworkStream = pdfNetworkStreamFactory; +} + +function getDocument(src) { + const task = new PDFDocumentLoadingTask(); + let source; + + if (typeof src === "string" || src instanceof URL) { + source = { + url: src + }; + } else if ((0, _util.isArrayBuffer)(src)) { + source = { + data: src + }; + } else if (src instanceof PDFDataRangeTransport) { + source = { + range: src + }; + } else { + if (typeof src !== "object") { + throw new Error("Invalid parameter in getDocument, " + "need either string, URL, Uint8Array, or parameter object."); + } + + if (!src.url && !src.data && !src.range) { + throw new Error("Invalid parameter object: need either .data, .range or .url"); + } + + source = src; + } + + const params = Object.create(null); + let rangeTransport = null, + worker = null; + + for (const key in source) { + const value = source[key]; + + switch (key) { + case "url": + if (typeof window !== "undefined") { + try { + params[key] = new URL(value, window.location).href; + continue; + } catch (ex) { + (0, _util.warn)(`Cannot create valid URL: "${ex}".`); + } + } else if (typeof value === "string" || value instanceof URL) { + params[key] = value.toString(); + continue; + } + + throw new Error("Invalid PDF url data: " + "either string or URL-object is expected in the url property."); + + case "range": + rangeTransport = value; + continue; + + case "worker": + worker = value; + continue; + + case "data": + if (_is_node.isNodeJS && typeof Buffer !== "undefined" && value instanceof Buffer) { + params[key] = new Uint8Array(value); + } else if (value instanceof Uint8Array) { + break; + } else if (typeof value === "string") { + params[key] = (0, _util.stringToBytes)(value); + } else if (typeof value === "object" && value !== null && !isNaN(value.length)) { + params[key] = new Uint8Array(value); + } else if ((0, _util.isArrayBuffer)(value)) { + params[key] = new Uint8Array(value); + } else { + throw new Error("Invalid PDF binary data: either typed array, " + "string, or array-like object is expected in the data property."); + } + + continue; + } + + params[key] = value; + } + + params.CMapReaderFactory = params.CMapReaderFactory || DefaultCMapReaderFactory; + params.StandardFontDataFactory = params.StandardFontDataFactory || DefaultStandardFontDataFactory; + params.ignoreErrors = params.stopAtErrors !== true; + params.fontExtraProperties = params.fontExtraProperties === true; + params.pdfBug = params.pdfBug === true; + params.enableXfa = params.enableXfa === true; + + if (!Number.isInteger(params.rangeChunkSize) || params.rangeChunkSize < 1) { + params.rangeChunkSize = DEFAULT_RANGE_CHUNK_SIZE; + } + + if (typeof params.docBaseUrl !== "string" || (0, _display_utils.isDataScheme)(params.docBaseUrl)) { + params.docBaseUrl = null; + } + + if (!Number.isInteger(params.maxImageSize) || params.maxImageSize < -1) { + params.maxImageSize = -1; + } + + if (typeof params.cMapUrl !== "string") { + params.cMapUrl = null; + } + + if (typeof params.standardFontDataUrl !== "string") { + params.standardFontDataUrl = null; + } + + if (typeof params.useWorkerFetch !== "boolean") { + params.useWorkerFetch = params.CMapReaderFactory === _display_utils.DOMCMapReaderFactory && params.StandardFontDataFactory === _display_utils.DOMStandardFontDataFactory; + } + + if (typeof params.isEvalSupported !== "boolean") { + params.isEvalSupported = true; + } + + if (typeof params.disableFontFace !== "boolean") { + params.disableFontFace = _is_node.isNodeJS; + } + + if (typeof params.useSystemFonts !== "boolean") { + params.useSystemFonts = !_is_node.isNodeJS && !params.disableFontFace; + } + + if (typeof params.ownerDocument !== "object" || params.ownerDocument === null) { + params.ownerDocument = globalThis.document; + } + + if (typeof params.disableRange !== "boolean") { + params.disableRange = false; + } + + if (typeof params.disableStream !== "boolean") { + params.disableStream = false; + } + + if (typeof params.disableAutoFetch !== "boolean") { + params.disableAutoFetch = false; + } + + (0, _util.setVerbosityLevel)(params.verbosity); + + if (!worker) { + const workerParams = { + verbosity: params.verbosity, + port: _worker_options.GlobalWorkerOptions.workerPort + }; + worker = workerParams.port ? PDFWorker.fromPort(workerParams) : new PDFWorker(workerParams); + task._worker = worker; + } + + const docId = task.docId; + worker.promise.then(function () { + if (task.destroyed) { + throw new Error("Loading aborted"); + } + + const workerIdPromise = _fetchDocument(worker, params, rangeTransport, docId); + + const networkStreamPromise = new Promise(function (resolve) { + let networkStream; + + if (rangeTransport) { + networkStream = new _transport_stream.PDFDataTransportStream({ + length: params.length, + initialData: params.initialData, + progressiveDone: params.progressiveDone, + contentDispositionFilename: params.contentDispositionFilename, + disableRange: params.disableRange, + disableStream: params.disableStream + }, rangeTransport); + } else if (!params.data) { + networkStream = createPDFNetworkStream({ + url: params.url, + length: params.length, + httpHeaders: params.httpHeaders, + withCredentials: params.withCredentials, + rangeChunkSize: params.rangeChunkSize, + disableRange: params.disableRange, + disableStream: params.disableStream + }); + } + + resolve(networkStream); + }); + return Promise.all([workerIdPromise, networkStreamPromise]).then(function ([workerId, networkStream]) { + if (task.destroyed) { + throw new Error("Loading aborted"); + } + + const messageHandler = new _message_handler.MessageHandler(docId, workerId, worker.port); + const transport = new WorkerTransport(messageHandler, task, networkStream, params); + task._transport = transport; + messageHandler.send("Ready", null); + }); + }).catch(task._capability.reject); + return task; +} + +async function _fetchDocument(worker, source, pdfDataRangeTransport, docId) { + if (worker.destroyed) { + throw new Error("Worker was destroyed"); + } + + if (pdfDataRangeTransport) { + source.length = pdfDataRangeTransport.length; + source.initialData = pdfDataRangeTransport.initialData; + source.progressiveDone = pdfDataRangeTransport.progressiveDone; + source.contentDispositionFilename = pdfDataRangeTransport.contentDispositionFilename; + } + + const workerId = await worker.messageHandler.sendWithPromise("GetDocRequest", { + docId, + apiVersion: '2.14.305', + source: { + data: source.data, + url: source.url, + password: source.password, + disableAutoFetch: source.disableAutoFetch, + rangeChunkSize: source.rangeChunkSize, + length: source.length + }, + maxImageSize: source.maxImageSize, + disableFontFace: source.disableFontFace, + docBaseUrl: source.docBaseUrl, + ignoreErrors: source.ignoreErrors, + isEvalSupported: source.isEvalSupported, + fontExtraProperties: source.fontExtraProperties, + enableXfa: source.enableXfa, + useSystemFonts: source.useSystemFonts, + cMapUrl: source.useWorkerFetch ? source.cMapUrl : null, + standardFontDataUrl: source.useWorkerFetch ? source.standardFontDataUrl : null + }); + + if (worker.destroyed) { + throw new Error("Worker was destroyed"); + } + + return workerId; +} + +class PDFDocumentLoadingTask { + static #docId = 0; + + constructor() { + this._capability = (0, _util.createPromiseCapability)(); + this._transport = null; + this._worker = null; + this.docId = `d${PDFDocumentLoadingTask.#docId++}`; + this.destroyed = false; + this.onPassword = null; + this.onProgress = null; + this.onUnsupportedFeature = null; + } + + get promise() { + return this._capability.promise; + } + + async destroy() { + this.destroyed = true; + await this._transport?.destroy(); + this._transport = null; + + if (this._worker) { + this._worker.destroy(); + + this._worker = null; + } + } + +} + +exports.PDFDocumentLoadingTask = PDFDocumentLoadingTask; + +class PDFDataRangeTransport { + constructor(length, initialData, progressiveDone = false, contentDispositionFilename = null) { + this.length = length; + this.initialData = initialData; + this.progressiveDone = progressiveDone; + this.contentDispositionFilename = contentDispositionFilename; + this._rangeListeners = []; + this._progressListeners = []; + this._progressiveReadListeners = []; + this._progressiveDoneListeners = []; + this._readyCapability = (0, _util.createPromiseCapability)(); + } + + addRangeListener(listener) { + this._rangeListeners.push(listener); + } + + addProgressListener(listener) { + this._progressListeners.push(listener); + } + + addProgressiveReadListener(listener) { + this._progressiveReadListeners.push(listener); + } + + addProgressiveDoneListener(listener) { + this._progressiveDoneListeners.push(listener); + } + + onDataRange(begin, chunk) { + for (const listener of this._rangeListeners) { + listener(begin, chunk); + } + } + + onDataProgress(loaded, total) { + this._readyCapability.promise.then(() => { + for (const listener of this._progressListeners) { + listener(loaded, total); + } + }); + } + + onDataProgressiveRead(chunk) { + this._readyCapability.promise.then(() => { + for (const listener of this._progressiveReadListeners) { + listener(chunk); + } + }); + } + + onDataProgressiveDone() { + this._readyCapability.promise.then(() => { + for (const listener of this._progressiveDoneListeners) { + listener(); + } + }); + } + + transportReady() { + this._readyCapability.resolve(); + } + + requestDataRange(begin, end) { + (0, _util.unreachable)("Abstract method PDFDataRangeTransport.requestDataRange"); + } + + abort() {} + +} + +exports.PDFDataRangeTransport = PDFDataRangeTransport; + +class PDFDocumentProxy { + constructor(pdfInfo, transport) { + this._pdfInfo = pdfInfo; + this._transport = transport; + Object.defineProperty(this, "fingerprint", { + get() { + (0, _display_utils.deprecated)("`PDFDocumentProxy.fingerprint`, " + "please use `PDFDocumentProxy.fingerprints` instead."); + return this.fingerprints[0]; + } + + }); + Object.defineProperty(this, "getStats", { + value: async () => { + (0, _display_utils.deprecated)("`PDFDocumentProxy.getStats`, " + "please use the `PDFDocumentProxy.stats`-getter instead."); + return this.stats || { + streamTypes: {}, + fontTypes: {} + }; + } + }); + } + + get annotationStorage() { + return this._transport.annotationStorage; + } + + get numPages() { + return this._pdfInfo.numPages; + } + + get fingerprints() { + return this._pdfInfo.fingerprints; + } + + get stats() { + return this._transport.stats; + } + + get isPureXfa() { + return !!this._transport._htmlForXfa; + } + + get allXfaHtml() { + return this._transport._htmlForXfa; + } + + getPage(pageNumber) { + return this._transport.getPage(pageNumber); + } + + getPageIndex(ref) { + return this._transport.getPageIndex(ref); + } + + getDestinations() { + return this._transport.getDestinations(); + } + + getDestination(id) { + return this._transport.getDestination(id); + } + + 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(); + } + + getJavaScript() { + return this._transport.getJavaScript(); + } + + 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(); + } + + getDownloadInfo() { + return this._transport.downloadInfoCapability.promise; + } + + cleanup(keepLoadedFonts = false) { + return this._transport.startCleanup(keepLoadedFonts || this.isPureXfa); + } + + destroy() { + return this.loadingTask.destroy(); + } + + get loadingParams() { + return this._transport.loadingParams; + } + + get loadingTask() { + return this._transport.loadingTask; + } + + saveDocument() { + if (this._transport.annotationStorage.size <= 0) { + (0, _display_utils.deprecated)("saveDocument called while `annotationStorage` is empty, " + "please use the getData-method instead."); + } + + return this._transport.saveDocument(); + } + + getFieldObjects() { + return this._transport.getFieldObjects(); + } + + hasJSActions() { + return this._transport.hasJSActions(); + } + + getCalculationOrderIds() { + return this._transport.getCalculationOrderIds(); + } + +} + +exports.PDFDocumentProxy = PDFDocumentProxy; + +class PDFPageProxy { + constructor(pageIndex, pageInfo, transport, ownerDocument, pdfBug = false) { + this._pageIndex = pageIndex; + this._pageInfo = pageInfo; + this._ownerDocument = ownerDocument; + this._transport = transport; + this._stats = pdfBug ? new _display_utils.StatTimer() : null; + this._pdfBug = pdfBug; + this.commonObjs = transport.commonObjs; + this.objs = new PDFObjects(); + this._bitmaps = new Set(); + this.cleanupAfterRender = false; + this.pendingCleanup = false; + this._intentStates = new Map(); + this._annotationPromises = new Map(); + this.destroyed = false; + } + + 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, + rotation = this.rotate, + offsetX = 0, + offsetY = 0, + dontFlip = false + } = {}) { + return new _display_utils.PageViewport({ + viewBox: this.view, + scale, + rotation, + offsetX, + offsetY, + dontFlip + }); + } + + getAnnotations({ + intent = "display" + } = {}) { + const intentArgs = this._transport.getRenderingIntent(intent); + + let promise = this._annotationPromises.get(intentArgs.cacheKey); + + if (!promise) { + promise = this._transport.getAnnotations(this._pageIndex, intentArgs.renderingIntent); + + this._annotationPromises.set(intentArgs.cacheKey, promise); + + promise = promise.then(annotations => { + for (const annotation of annotations) { + if (annotation.titleObj !== undefined) { + Object.defineProperty(annotation, "title", { + get() { + (0, _display_utils.deprecated)("`title`-property on annotation, please use `titleObj` instead."); + return annotation.titleObj.str; + } + + }); + } + + if (annotation.contentsObj !== undefined) { + Object.defineProperty(annotation, "contents", { + get() { + (0, _display_utils.deprecated)("`contents`-property on annotation, please use `contentsObj` instead."); + return annotation.contentsObj.str; + } + + }); + } + } + + return annotations; + }); + } + + return promise; + } + + getJSActions() { + return this._jsActionsPromise ||= this._transport.getPageJSActions(this._pageIndex); + } + + async getXfa() { + return this._transport._htmlForXfa?.children[this._pageIndex] || null; + } + + render({ + canvasContext, + viewport, + intent = "display", + annotationMode = _util.AnnotationMode.ENABLE, + transform = null, + imageLayer = null, + canvasFactory = null, + background = null, + optionalContentConfigPromise = null, + annotationCanvasMap = null, + pageColors = null + }) { + if (arguments[0]?.renderInteractiveForms !== undefined) { + (0, _display_utils.deprecated)("render no longer accepts the `renderInteractiveForms`-option, " + "please use the `annotationMode`-option instead."); + + if (arguments[0].renderInteractiveForms === true && annotationMode === _util.AnnotationMode.ENABLE) { + annotationMode = _util.AnnotationMode.ENABLE_FORMS; + } + } + + if (arguments[0]?.includeAnnotationStorage !== undefined) { + (0, _display_utils.deprecated)("render no longer accepts the `includeAnnotationStorage`-option, " + "please use the `annotationMode`-option instead."); + + if (arguments[0].includeAnnotationStorage === true && annotationMode === _util.AnnotationMode.ENABLE) { + annotationMode = _util.AnnotationMode.ENABLE_STORAGE; + } + } + + if (this._stats) { + this._stats.time("Overall"); + } + + const intentArgs = this._transport.getRenderingIntent(intent, annotationMode); + + this.pendingCleanup = false; + + if (!optionalContentConfigPromise) { + optionalContentConfigPromise = this._transport.getOptionalContentConfig(); + } + + let intentState = this._intentStates.get(intentArgs.cacheKey); + + if (!intentState) { + intentState = Object.create(null); + + this._intentStates.set(intentArgs.cacheKey, intentState); + } + + if (intentState.streamReaderCancelTimeout) { + clearTimeout(intentState.streamReaderCancelTimeout); + intentState.streamReaderCancelTimeout = null; + } + + const canvasFactoryInstance = canvasFactory || new DefaultCanvasFactory({ + ownerDocument: this._ownerDocument + }); + const intentPrint = !!(intentArgs.renderingIntent & _util.RenderingIntentFlag.PRINT); + + if (!intentState.displayReadyCapability) { + intentState.displayReadyCapability = (0, _util.createPromiseCapability)(); + intentState.operatorList = { + fnArray: [], + argsArray: [], + lastChunk: false + }; + + if (this._stats) { + this._stats.time("Page Request"); + } + + this._pumpOperatorList(intentArgs); + } + + const complete = error => { + intentState.renderTasks.delete(internalRenderTask); + + if (this.cleanupAfterRender || intentPrint) { + this.pendingCleanup = true; + } + + this._tryCleanup(); + + if (error) { + internalRenderTask.capability.reject(error); + + this._abortOperatorList({ + intentState, + reason: error instanceof Error ? error : new Error(error) + }); + } else { + internalRenderTask.capability.resolve(); + } + + if (this._stats) { + this._stats.timeEnd("Rendering"); + + this._stats.timeEnd("Overall"); + } + }; + + const internalRenderTask = new InternalRenderTask({ + callback: complete, + params: { + canvasContext, + viewport, + transform, + imageLayer, + background + }, + objs: this.objs, + commonObjs: this.commonObjs, + annotationCanvasMap, + operatorList: intentState.operatorList, + pageIndex: this._pageIndex, + canvasFactory: canvasFactoryInstance, + useRequestAnimationFrame: !intentPrint, + pdfBug: this._pdfBug, + pageColors + }); + (intentState.renderTasks ||= new Set()).add(internalRenderTask); + const renderTask = internalRenderTask.task; + Promise.all([intentState.displayReadyCapability.promise, optionalContentConfigPromise]).then(([transparency, optionalContentConfig]) => { + if (this.pendingCleanup) { + complete(); + return; + } + + if (this._stats) { + this._stats.time("Rendering"); + } + + internalRenderTask.initializeGraphics({ + transparency, + optionalContentConfig + }); + internalRenderTask.operatorListChanged(); + }).catch(complete); + return renderTask; + } + + getOperatorList({ + intent = "display", + annotationMode = _util.AnnotationMode.ENABLE + } = {}) { + function operatorListChanged() { + if (intentState.operatorList.lastChunk) { + intentState.opListReadCapability.resolve(intentState.operatorList); + intentState.renderTasks.delete(opListTask); + } + } + + const intentArgs = this._transport.getRenderingIntent(intent, annotationMode, true); + + let intentState = this._intentStates.get(intentArgs.cacheKey); + + if (!intentState) { + intentState = Object.create(null); + + this._intentStates.set(intentArgs.cacheKey, intentState); + } + + let opListTask; + + if (!intentState.opListReadCapability) { + opListTask = Object.create(null); + opListTask.operatorListChanged = operatorListChanged; + intentState.opListReadCapability = (0, _util.createPromiseCapability)(); + (intentState.renderTasks ||= new Set()).add(opListTask); + intentState.operatorList = { + fnArray: [], + argsArray: [], + lastChunk: false + }; + + if (this._stats) { + this._stats.time("Page Request"); + } + + this._pumpOperatorList(intentArgs); + } + + return intentState.opListReadCapability.promise; + } + + streamTextContent({ + disableCombineTextItems = false, + includeMarkedContent = false + } = {}) { + const TEXT_CONTENT_CHUNK_SIZE = 100; + return this._transport.messageHandler.sendWithStream("GetTextContent", { + pageIndex: this._pageIndex, + combineTextItems: disableCombineTextItems !== true, + includeMarkedContent: includeMarkedContent === true + }, { + highWaterMark: TEXT_CONTENT_CHUNK_SIZE, + + size(textContent) { + return textContent.items.length; + } + + }); + } + + getTextContent(params = {}) { + if (this._transport._htmlForXfa) { + return this.getXfa().then(xfa => { + return _xfa_text.XfaText.textContent(xfa); + }); + } + + const readableStream = this.streamTextContent(params); + return new Promise(function (resolve, reject) { + function pump() { + reader.read().then(function ({ + value, + done + }) { + if (done) { + resolve(textContent); + return; + } + + Object.assign(textContent.styles, value.styles); + textContent.items.push(...value.items); + pump(); + }, reject); + } + + const reader = readableStream.getReader(); + const textContent = { + items: [], + styles: Object.create(null) + }; + pump(); + }); + } + + getStructTree() { + return this._structTreePromise ||= this._transport.getStructTree(this._pageIndex); + } + + _destroy() { + this.destroyed = true; + const waitOn = []; + + for (const intentState of this._intentStates.values()) { + this._abortOperatorList({ + intentState, + reason: new Error("Page was destroyed."), + force: true + }); + + if (intentState.opListReadCapability) { + continue; + } + + for (const internalRenderTask of intentState.renderTasks) { + waitOn.push(internalRenderTask.completed); + internalRenderTask.cancel(); + } + } + + this.objs.clear(); + + for (const bitmap of this._bitmaps) { + bitmap.close(); + } + + this._bitmaps.clear(); + + this._annotationPromises.clear(); + + this._jsActionsPromise = null; + this._structTreePromise = null; + this.pendingCleanup = false; + return Promise.all(waitOn); + } + + cleanup(resetStats = false) { + this.pendingCleanup = true; + return this._tryCleanup(resetStats); + } + + _tryCleanup(resetStats = false) { + if (!this.pendingCleanup) { + return false; + } + + for (const { + renderTasks, + operatorList + } of this._intentStates.values()) { + if (renderTasks.size > 0 || !operatorList.lastChunk) { + return false; + } + } + + this._intentStates.clear(); + + this.objs.clear(); + + this._annotationPromises.clear(); + + this._jsActionsPromise = null; + this._structTreePromise = null; + + if (resetStats && this._stats) { + this._stats = new _display_utils.StatTimer(); + } + + for (const bitmap of this._bitmaps) { + bitmap.close(); + } + + this._bitmaps.clear(); + + this.pendingCleanup = false; + return true; + } + + _startRenderPage(transparency, cacheKey) { + const intentState = this._intentStates.get(cacheKey); + + if (!intentState) { + return; + } + + if (this._stats) { + this._stats.timeEnd("Page Request"); + } + + if (intentState.displayReadyCapability) { + intentState.displayReadyCapability.resolve(transparency); + } + } + + _renderPageChunk(operatorListChunk, intentState) { + for (let i = 0, ii = operatorListChunk.length; i < ii; i++) { + intentState.operatorList.fnArray.push(operatorListChunk.fnArray[i]); + intentState.operatorList.argsArray.push(operatorListChunk.argsArray[i]); + } + + intentState.operatorList.lastChunk = operatorListChunk.lastChunk; + + for (const internalRenderTask of intentState.renderTasks) { + internalRenderTask.operatorListChanged(); + } + + if (operatorListChunk.lastChunk) { + this._tryCleanup(); + } + } + + _pumpOperatorList({ + renderingIntent, + cacheKey + }) { + const readableStream = this._transport.messageHandler.sendWithStream("GetOperatorList", { + pageIndex: this._pageIndex, + intent: renderingIntent, + cacheKey, + annotationStorage: renderingIntent & _util.RenderingIntentFlag.ANNOTATIONS_STORAGE ? this._transport.annotationStorage.serializable : null + }); + + const reader = readableStream.getReader(); + + const intentState = this._intentStates.get(cacheKey); + + intentState.streamReader = reader; + + const pump = () => { + reader.read().then(({ + value, + done + }) => { + if (done) { + intentState.streamReader = null; + return; + } + + if (this._transport.destroyed) { + return; + } + + this._renderPageChunk(value, intentState); + + pump(); + }, reason => { + intentState.streamReader = null; + + if (this._transport.destroyed) { + return; + } + + if (intentState.operatorList) { + intentState.operatorList.lastChunk = true; + + for (const internalRenderTask of intentState.renderTasks) { + internalRenderTask.operatorListChanged(); + } + + this._tryCleanup(); + } + + if (intentState.displayReadyCapability) { + intentState.displayReadyCapability.reject(reason); + } else if (intentState.opListReadCapability) { + intentState.opListReadCapability.reject(reason); + } else { + throw reason; + } + }); + }; + + pump(); + } + + _abortOperatorList({ + intentState, + reason, + force = false + }) { + if (!intentState.streamReader) { + return; + } + + if (!force) { + if (intentState.renderTasks.size > 0) { + return; + } + + if (reason instanceof _display_utils.RenderingCancelledException) { + intentState.streamReaderCancelTimeout = setTimeout(() => { + this._abortOperatorList({ + intentState, + reason, + force: true + }); + + intentState.streamReaderCancelTimeout = null; + }, RENDERING_CANCELLED_TIMEOUT); + return; + } + } + + intentState.streamReader.cancel(new _util.AbortException(reason.message)).catch(() => {}); + intentState.streamReader = null; + + if (this._transport.destroyed) { + return; + } + + for (const [curCacheKey, curIntentState] of this._intentStates) { + if (curIntentState === intentState) { + this._intentStates.delete(curCacheKey); + + break; + } + } + + this.cleanup(); + } + + get stats() { + return this._stats; + } + +} + +exports.PDFPageProxy = PDFPageProxy; + +class LoopbackPort { + constructor() { + this._listeners = []; + this._deferred = Promise.resolve(); + } + + postMessage(obj, transfers) { + const event = { + data: structuredClone(obj, transfers) + }; + + this._deferred.then(() => { + for (const listener of this._listeners) { + listener.call(this, event); + } + }); + } + + addEventListener(name, listener) { + this._listeners.push(listener); + } + + removeEventListener(name, listener) { + const i = this._listeners.indexOf(listener); + + this._listeners.splice(i, 1); + } + + terminate() { + this._listeners.length = 0; + } + +} + +exports.LoopbackPort = LoopbackPort; +const PDFWorkerUtil = { + isWorkerDisabled: false, + fallbackWorkerSrc: null, + fakeWorkerId: 0 +}; +exports.PDFWorkerUtil = PDFWorkerUtil; +{ + if (_is_node.isNodeJS && typeof require === "function") { + PDFWorkerUtil.isWorkerDisabled = true; + PDFWorkerUtil.fallbackWorkerSrc = "./pdf.worker.js"; + } else if (typeof document === "object") { + const pdfjsFilePath = document?.currentScript?.src; + + if (pdfjsFilePath) { + PDFWorkerUtil.fallbackWorkerSrc = pdfjsFilePath.replace(/(\.(?:min\.)?js)(\?.*)?$/i, ".worker$1$2"); + } + } + + PDFWorkerUtil.isSameOrigin = function (baseUrl, otherUrl) { + let base; + + try { + base = new URL(baseUrl); + + if (!base.origin || base.origin === "null") { + return false; + } + } catch (e) { + return false; + } + + const other = new URL(otherUrl, base); + return base.origin === other.origin; + }; + + PDFWorkerUtil.createCDNWrapper = function (url) { + const wrapper = `importScripts("${url}");`; + return URL.createObjectURL(new Blob([wrapper])); + }; +} + +class PDFWorker { + static #workerPorts = new WeakMap(); + + constructor({ + name = null, + port = null, + verbosity = (0, _util.getVerbosityLevel)() + } = {}) { + if (port && PDFWorker.#workerPorts.has(port)) { + throw new Error("Cannot use more than one PDFWorker per port."); + } + + this.name = name; + this.destroyed = false; + this.verbosity = verbosity; + this._readyCapability = (0, _util.createPromiseCapability)(); + this._port = null; + this._webWorker = null; + this._messageHandler = null; + + if (port) { + PDFWorker.#workerPorts.set(port, this); + + this._initializeFromPort(port); + + return; + } + + this._initialize(); + } + + get promise() { + return this._readyCapability.promise; + } + + get port() { + return this._port; + } + + get messageHandler() { + return this._messageHandler; + } + + _initializeFromPort(port) { + this._port = port; + this._messageHandler = new _message_handler.MessageHandler("main", "worker", port); + + this._messageHandler.on("ready", function () {}); + + this._readyCapability.resolve(); + } + + _initialize() { + if (typeof Worker !== "undefined" && !PDFWorkerUtil.isWorkerDisabled && !PDFWorker._mainThreadWorkerMessageHandler) { + let workerSrc = PDFWorker.workerSrc; + + try { + if (!PDFWorkerUtil.isSameOrigin(window.location.href, workerSrc)) { + workerSrc = PDFWorkerUtil.createCDNWrapper(new URL(workerSrc, window.location).href); + } + + const worker = new Worker(workerSrc); + const messageHandler = new _message_handler.MessageHandler("main", "worker", worker); + + const terminateEarly = () => { + worker.removeEventListener("error", onWorkerError); + messageHandler.destroy(); + worker.terminate(); + + if (this.destroyed) { + this._readyCapability.reject(new Error("Worker was destroyed")); + } else { + this._setupFakeWorker(); + } + }; + + const onWorkerError = () => { + if (!this._webWorker) { + terminateEarly(); + } + }; + + worker.addEventListener("error", onWorkerError); + messageHandler.on("test", data => { + worker.removeEventListener("error", onWorkerError); + + if (this.destroyed) { + terminateEarly(); + return; + } + + if (data) { + this._messageHandler = messageHandler; + this._port = worker; + this._webWorker = worker; + + this._readyCapability.resolve(); + + messageHandler.send("configure", { + verbosity: this.verbosity + }); + } else { + this._setupFakeWorker(); + + messageHandler.destroy(); + worker.terminate(); + } + }); + messageHandler.on("ready", data => { + worker.removeEventListener("error", onWorkerError); + + if (this.destroyed) { + terminateEarly(); + return; + } + + try { + sendTest(); + } catch (e) { + this._setupFakeWorker(); + } + }); + + const sendTest = () => { + const testObj = new Uint8Array(); + messageHandler.send("test", testObj, [testObj.buffer]); + }; + + sendTest(); + return; + } catch (e) { + (0, _util.info)("The worker has been disabled."); + } + } + + this._setupFakeWorker(); + } + + _setupFakeWorker() { + if (!PDFWorkerUtil.isWorkerDisabled) { + (0, _util.warn)("Setting up fake worker."); + PDFWorkerUtil.isWorkerDisabled = true; + } + + PDFWorker._setupFakeWorkerGlobal.then(WorkerMessageHandler => { + if (this.destroyed) { + this._readyCapability.reject(new Error("Worker was destroyed")); + + return; + } + + const port = new LoopbackPort(); + this._port = port; + const id = `fake${PDFWorkerUtil.fakeWorkerId++}`; + const workerHandler = new _message_handler.MessageHandler(id + "_worker", id, port); + WorkerMessageHandler.setup(workerHandler, port); + const messageHandler = new _message_handler.MessageHandler(id, id + "_worker", port); + this._messageHandler = messageHandler; + + this._readyCapability.resolve(); + + messageHandler.send("configure", { + verbosity: this.verbosity + }); + }).catch(reason => { + this._readyCapability.reject(new Error(`Setting up fake worker failed: "${reason.message}".`)); + }); + } + + destroy() { + this.destroyed = true; + + if (this._webWorker) { + this._webWorker.terminate(); + + this._webWorker = null; + } + + PDFWorker.#workerPorts.delete(this._port); + this._port = null; + + if (this._messageHandler) { + this._messageHandler.destroy(); + + this._messageHandler = null; + } + } + + static fromPort(params) { + if (!params?.port) { + throw new Error("PDFWorker.fromPort - invalid method signature."); + } + + if (this.#workerPorts.has(params.port)) { + return this.#workerPorts.get(params.port); + } + + return new PDFWorker(params); + } + + static get workerSrc() { + if (_worker_options.GlobalWorkerOptions.workerSrc) { + return _worker_options.GlobalWorkerOptions.workerSrc; + } + + if (PDFWorkerUtil.fallbackWorkerSrc !== null) { + if (!_is_node.isNodeJS) { + (0, _display_utils.deprecated)('No "GlobalWorkerOptions.workerSrc" specified.'); + } + + return PDFWorkerUtil.fallbackWorkerSrc; + } + + throw new Error('No "GlobalWorkerOptions.workerSrc" specified.'); + } + + static get _mainThreadWorkerMessageHandler() { + try { + return globalThis.pdfjsWorker?.WorkerMessageHandler || null; + } catch (ex) { + return null; + } + } + + static get _setupFakeWorkerGlobal() { + const loader = async () => { + const mainWorkerMessageHandler = this._mainThreadWorkerMessageHandler; + + if (mainWorkerMessageHandler) { + return mainWorkerMessageHandler; + } + + if (_is_node.isNodeJS && typeof require === "function") { + const worker = eval("require")(this.workerSrc); + return worker.WorkerMessageHandler; + } + + await (0, _display_utils.loadScript)(this.workerSrc); + return window.pdfjsWorker.WorkerMessageHandler; + }; + + return (0, _util.shadow)(this, "_setupFakeWorkerGlobal", loader()); + } + +} + +exports.PDFWorker = PDFWorker; +{ + PDFWorker.getWorkerSrc = function () { + (0, _display_utils.deprecated)("`PDFWorker.getWorkerSrc()`, please use `PDFWorker.workerSrc` instead."); + return this.workerSrc; + }; +} + +class WorkerTransport { + #docStats = null; + #pageCache = new Map(); + #pagePromises = new Map(); + #metadataPromise = null; + + constructor(messageHandler, loadingTask, networkStream, params) { + this.messageHandler = messageHandler; + this.loadingTask = loadingTask; + this.commonObjs = new PDFObjects(); + this.fontLoader = new _font_loader.FontLoader({ + docId: loadingTask.docId, + onUnsupportedFeature: this._onUnsupportedFeature.bind(this), + ownerDocument: params.ownerDocument, + styleElement: params.styleElement + }); + this._params = params; + + if (!params.useWorkerFetch) { + this.CMapReaderFactory = new params.CMapReaderFactory({ + baseUrl: params.cMapUrl, + isCompressed: params.cMapPacked + }); + this.StandardFontDataFactory = new params.StandardFontDataFactory({ + baseUrl: params.standardFontDataUrl + }); + } + + this.destroyed = false; + this.destroyCapability = null; + this._passwordCapability = null; + this._networkStream = networkStream; + this._fullReader = null; + this._lastProgress = null; + this.downloadInfoCapability = (0, _util.createPromiseCapability)(); + this.setupMessageHandler(); + } + + get annotationStorage() { + return (0, _util.shadow)(this, "annotationStorage", new _annotation_storage.AnnotationStorage()); + } + + get stats() { + return this.#docStats; + } + + getRenderingIntent(intent, annotationMode = _util.AnnotationMode.ENABLE, isOpList = false) { + let renderingIntent = _util.RenderingIntentFlag.DISPLAY; + let annotationHash = ""; + + switch (intent) { + case "any": + renderingIntent = _util.RenderingIntentFlag.ANY; + break; + + case "display": + break; + + case "print": + renderingIntent = _util.RenderingIntentFlag.PRINT; + break; + + default: + (0, _util.warn)(`getRenderingIntent - invalid intent: ${intent}`); + } + + switch (annotationMode) { + case _util.AnnotationMode.DISABLE: + renderingIntent += _util.RenderingIntentFlag.ANNOTATIONS_DISABLE; + break; + + case _util.AnnotationMode.ENABLE: + break; + + case _util.AnnotationMode.ENABLE_FORMS: + renderingIntent += _util.RenderingIntentFlag.ANNOTATIONS_FORMS; + break; + + case _util.AnnotationMode.ENABLE_STORAGE: + renderingIntent += _util.RenderingIntentFlag.ANNOTATIONS_STORAGE; + annotationHash = this.annotationStorage.hash; + break; + + default: + (0, _util.warn)(`getRenderingIntent - invalid annotationMode: ${annotationMode}`); + } + + if (isOpList) { + renderingIntent += _util.RenderingIntentFlag.OPLIST; + } + + return { + renderingIntent, + cacheKey: `${renderingIntent}_${annotationHash}` + }; + } + + destroy() { + if (this.destroyCapability) { + return this.destroyCapability.promise; + } + + this.destroyed = true; + this.destroyCapability = (0, _util.createPromiseCapability)(); + + if (this._passwordCapability) { + this._passwordCapability.reject(new Error("Worker was destroyed during onPassword callback")); + } + + const waitOn = []; + + for (const page of this.#pageCache.values()) { + waitOn.push(page._destroy()); + } + + this.#pageCache.clear(); + this.#pagePromises.clear(); + + if (this.hasOwnProperty("annotationStorage")) { + this.annotationStorage.resetModified(); + } + + const terminated = this.messageHandler.sendWithPromise("Terminate", null); + waitOn.push(terminated); + Promise.all(waitOn).then(() => { + this.commonObjs.clear(); + this.fontLoader.clear(); + this.#metadataPromise = null; + this._getFieldObjectsPromise = null; + this._hasJSActionsPromise = null; + + if (this._networkStream) { + this._networkStream.cancelAllRequests(new _util.AbortException("Worker was terminated.")); + } + + if (this.messageHandler) { + this.messageHandler.destroy(); + this.messageHandler = null; + } + + this.destroyCapability.resolve(); + }, this.destroyCapability.reject); + return this.destroyCapability.promise; + } + + setupMessageHandler() { + const { + messageHandler, + loadingTask + } = this; + messageHandler.on("GetReader", (data, sink) => { + (0, _util.assert)(this._networkStream, "GetReader - no `IPDFStream` instance available."); + this._fullReader = this._networkStream.getFullReader(); + + this._fullReader.onProgress = evt => { + this._lastProgress = { + loaded: evt.loaded, + total: evt.total + }; + }; + + sink.onPull = () => { + this._fullReader.read().then(function ({ + value, + done + }) { + if (done) { + sink.close(); + return; + } + + (0, _util.assert)((0, _util.isArrayBuffer)(value), "GetReader - expected an ArrayBuffer."); + sink.enqueue(new Uint8Array(value), 1, [value]); + }).catch(reason => { + sink.error(reason); + }); + }; + + sink.onCancel = reason => { + this._fullReader.cancel(reason); + + sink.ready.catch(readyReason => { + if (this.destroyed) { + return; + } + + throw readyReason; + }); + }; + }); + messageHandler.on("ReaderHeadersReady", data => { + const headersCapability = (0, _util.createPromiseCapability)(); + const fullReader = this._fullReader; + fullReader.headersReady.then(() => { + if (!fullReader.isStreamingSupported || !fullReader.isRangeSupported) { + if (this._lastProgress) { + loadingTask.onProgress?.(this._lastProgress); + } + + fullReader.onProgress = evt => { + loadingTask.onProgress?.({ + loaded: evt.loaded, + total: evt.total + }); + }; + } + + headersCapability.resolve({ + isStreamingSupported: fullReader.isStreamingSupported, + isRangeSupported: fullReader.isRangeSupported, + contentLength: fullReader.contentLength + }); + }, headersCapability.reject); + return headersCapability.promise; + }); + messageHandler.on("GetRangeReader", (data, sink) => { + (0, _util.assert)(this._networkStream, "GetRangeReader - no `IPDFStream` instance available."); + + const rangeReader = this._networkStream.getRangeReader(data.begin, data.end); + + if (!rangeReader) { + sink.close(); + return; + } + + sink.onPull = () => { + rangeReader.read().then(function ({ + value, + done + }) { + if (done) { + sink.close(); + return; + } + + (0, _util.assert)((0, _util.isArrayBuffer)(value), "GetRangeReader - expected an ArrayBuffer."); + sink.enqueue(new Uint8Array(value), 1, [value]); + }).catch(reason => { + sink.error(reason); + }); + }; + + sink.onCancel = reason => { + rangeReader.cancel(reason); + sink.ready.catch(readyReason => { + if (this.destroyed) { + return; + } + + throw readyReason; + }); + }; + }); + messageHandler.on("GetDoc", ({ + pdfInfo + }) => { + this._numPages = pdfInfo.numPages; + this._htmlForXfa = pdfInfo.htmlForXfa; + delete pdfInfo.htmlForXfa; + + loadingTask._capability.resolve(new PDFDocumentProxy(pdfInfo, this)); + }); + messageHandler.on("DocException", function (ex) { + let reason; + + switch (ex.name) { + case "PasswordException": + reason = new _util.PasswordException(ex.message, ex.code); + break; + + case "InvalidPDFException": + reason = new _util.InvalidPDFException(ex.message); + break; + + case "MissingPDFException": + reason = new _util.MissingPDFException(ex.message); + break; + + case "UnexpectedResponseException": + reason = new _util.UnexpectedResponseException(ex.message, ex.status); + break; + + case "UnknownErrorException": + reason = new _util.UnknownErrorException(ex.message, ex.details); + break; + + default: + (0, _util.unreachable)("DocException - expected a valid Error."); + } + + loadingTask._capability.reject(reason); + }); + messageHandler.on("PasswordRequest", exception => { + this._passwordCapability = (0, _util.createPromiseCapability)(); + + if (loadingTask.onPassword) { + const updatePassword = password => { + if (password instanceof Error) { + this._passwordCapability.reject(password); + } else { + this._passwordCapability.resolve({ + password + }); + } + }; + + try { + loadingTask.onPassword(updatePassword, exception.code); + } catch (ex) { + this._passwordCapability.reject(ex); + } + } else { + this._passwordCapability.reject(new _util.PasswordException(exception.message, exception.code)); + } + + return this._passwordCapability.promise; + }); + messageHandler.on("DataLoaded", data => { + loadingTask.onProgress?.({ + loaded: data.length, + total: data.length + }); + this.downloadInfoCapability.resolve(data); + }); + messageHandler.on("StartRenderPage", data => { + if (this.destroyed) { + return; + } + + const page = this.#pageCache.get(data.pageIndex); + + page._startRenderPage(data.transparency, data.cacheKey); + }); + messageHandler.on("commonobj", ([id, type, exportedData]) => { + if (this.destroyed) { + return; + } + + if (this.commonObjs.has(id)) { + return; + } + + switch (type) { + case "Font": + const params = this._params; + + if ("error" in exportedData) { + const exportedError = exportedData.error; + (0, _util.warn)(`Error during font loading: ${exportedError}`); + this.commonObjs.resolve(id, exportedError); + break; + } + + let fontRegistry = null; + + if (params.pdfBug && globalThis.FontInspector?.enabled) { + fontRegistry = { + registerFont(font, url) { + globalThis.FontInspector.fontAdded(font, url); + } + + }; + } + + const font = new _font_loader.FontFaceObject(exportedData, { + isEvalSupported: params.isEvalSupported, + disableFontFace: params.disableFontFace, + ignoreErrors: params.ignoreErrors, + onUnsupportedFeature: this._onUnsupportedFeature.bind(this), + fontRegistry + }); + this.fontLoader.bind(font).catch(reason => { + return messageHandler.sendWithPromise("FontFallback", { + id + }); + }).finally(() => { + if (!params.fontExtraProperties && font.data) { + font.data = null; + } + + this.commonObjs.resolve(id, font); + }); + break; + + case "FontPath": + case "Image": + this.commonObjs.resolve(id, exportedData); + break; + + default: + throw new Error(`Got unknown common object type ${type}`); + } + }); + messageHandler.on("obj", ([id, pageIndex, type, imageData]) => { + if (this.destroyed) { + return; + } + + const pageProxy = this.#pageCache.get(pageIndex); + + if (pageProxy.objs.has(id)) { + return; + } + + switch (type) { + case "Image": + pageProxy.objs.resolve(id, imageData); + const MAX_IMAGE_SIZE_TO_STORE = 8000000; + + if (imageData) { + let length; + + if (imageData.bitmap) { + const { + bitmap, + width, + height + } = imageData; + length = width * height * 4; + + pageProxy._bitmaps.add(bitmap); + } else { + length = imageData.data?.length || 0; + } + + if (length > MAX_IMAGE_SIZE_TO_STORE) { + pageProxy.cleanupAfterRender = true; + } + } + + break; + + case "Pattern": + pageProxy.objs.resolve(id, imageData); + break; + + default: + throw new Error(`Got unknown object type ${type}`); + } + }); + messageHandler.on("DocProgress", data => { + if (this.destroyed) { + return; + } + + loadingTask.onProgress?.({ + loaded: data.loaded, + total: data.total + }); + }); + messageHandler.on("DocStats", data => { + if (this.destroyed) { + return; + } + + this.#docStats = Object.freeze({ + streamTypes: Object.freeze(data.streamTypes), + fontTypes: Object.freeze(data.fontTypes) + }); + }); + messageHandler.on("UnsupportedFeature", this._onUnsupportedFeature.bind(this)); + messageHandler.on("FetchBuiltInCMap", data => { + if (this.destroyed) { + return Promise.reject(new Error("Worker was destroyed.")); + } + + if (!this.CMapReaderFactory) { + return Promise.reject(new Error("CMapReaderFactory not initialized, see the `useWorkerFetch` parameter.")); + } + + return this.CMapReaderFactory.fetch(data); + }); + messageHandler.on("FetchStandardFontData", data => { + if (this.destroyed) { + return Promise.reject(new Error("Worker was destroyed.")); + } + + if (!this.StandardFontDataFactory) { + return Promise.reject(new Error("StandardFontDataFactory not initialized, see the `useWorkerFetch` parameter.")); + } + + return this.StandardFontDataFactory.fetch(data); + }); + } + + _onUnsupportedFeature({ + featureId + }) { + if (this.destroyed) { + return; + } + + this.loadingTask.onUnsupportedFeature?.(featureId); + } + + getData() { + return this.messageHandler.sendWithPromise("GetData", null); + } + + getPage(pageNumber) { + if (!Number.isInteger(pageNumber) || pageNumber <= 0 || pageNumber > this._numPages) { + return Promise.reject(new Error("Invalid page request.")); + } + + const pageIndex = pageNumber - 1, + cachedPromise = this.#pagePromises.get(pageIndex); + + if (cachedPromise) { + return cachedPromise; + } + + const promise = this.messageHandler.sendWithPromise("GetPage", { + pageIndex + }).then(pageInfo => { + if (this.destroyed) { + throw new Error("Transport destroyed"); + } + + const page = new PDFPageProxy(pageIndex, pageInfo, this, this._params.ownerDocument, this._params.pdfBug); + this.#pageCache.set(pageIndex, page); + return page; + }); + this.#pagePromises.set(pageIndex, promise); + return promise; + } + + getPageIndex(ref) { + if (typeof ref !== "object" || ref === null || !Number.isInteger(ref.num) || ref.num < 0 || !Number.isInteger(ref.gen) || ref.gen < 0) { + return Promise.reject(new Error("Invalid pageIndex request.")); + } + + return this.messageHandler.sendWithPromise("GetPageIndex", { + num: ref.num, + gen: ref.gen + }); + } + + getAnnotations(pageIndex, intent) { + return this.messageHandler.sendWithPromise("GetAnnotations", { + pageIndex, + intent + }); + } + + saveDocument() { + return this.messageHandler.sendWithPromise("SaveDocument", { + isPureXfa: !!this._htmlForXfa, + numPages: this._numPages, + annotationStorage: this.annotationStorage.serializable, + filename: this._fullReader?.filename ?? null + }).finally(() => { + this.annotationStorage.resetModified(); + }); + } + + getFieldObjects() { + return this._getFieldObjectsPromise ||= this.messageHandler.sendWithPromise("GetFieldObjects", null); + } + + hasJSActions() { + return this._hasJSActionsPromise ||= this.messageHandler.sendWithPromise("HasJSActions", null); + } + + getCalculationOrderIds() { + return this.messageHandler.sendWithPromise("GetCalculationOrderIds", null); + } + + getDestinations() { + return this.messageHandler.sendWithPromise("GetDestinations", null); + } + + getDestination(id) { + if (typeof id !== "string") { + return Promise.reject(new Error("Invalid destination request.")); + } + + return this.messageHandler.sendWithPromise("GetDestination", { + id + }); + } + + 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); + } + + getJavaScript() { + return this.messageHandler.sendWithPromise("GetJavaScript", null); + } + + getDocJSActions() { + return this.messageHandler.sendWithPromise("GetDocJSActions", null); + } + + getPageJSActions(pageIndex) { + return this.messageHandler.sendWithPromise("GetPageJSActions", { + pageIndex + }); + } + + getStructTree(pageIndex) { + return this.messageHandler.sendWithPromise("GetStructTree", { + pageIndex + }); + } + + getOutline() { + return this.messageHandler.sendWithPromise("GetOutline", null); + } + + getOptionalContentConfig() { + return this.messageHandler.sendWithPromise("GetOptionalContentConfig", null).then(results => { + return new _optional_content_config.OptionalContentConfig(results); + }); + } + + getPermissions() { + return this.messageHandler.sendWithPromise("GetPermissions", null); + } + + getMetadata() { + return this.#metadataPromise ||= this.messageHandler.sendWithPromise("GetMetadata", null).then(results => { + return { + info: results[0], + metadata: results[1] ? new _metadata.Metadata(results[1]) : null, + contentDispositionFilename: this._fullReader?.filename ?? null, + contentLength: this._fullReader?.contentLength ?? null + }; + }); + } + + getMarkInfo() { + return this.messageHandler.sendWithPromise("GetMarkInfo", null); + } + + async startCleanup(keepLoadedFonts = false) { + await this.messageHandler.sendWithPromise("Cleanup", null); + + if (this.destroyed) { + return; + } + + for (const page of this.#pageCache.values()) { + const cleanupSuccessful = page.cleanup(); + + if (!cleanupSuccessful) { + throw new Error(`startCleanup: Page ${page.pageNumber} is currently rendering.`); + } + } + + this.commonObjs.clear(); + + if (!keepLoadedFonts) { + this.fontLoader.clear(); + } + + this.#metadataPromise = null; + this._getFieldObjectsPromise = null; + this._hasJSActionsPromise = null; + } + + get loadingParams() { + const params = this._params; + return (0, _util.shadow)(this, "loadingParams", { + disableAutoFetch: params.disableAutoFetch, + enableXfa: params.enableXfa + }); + } + +} + +class PDFObjects { + #objs = Object.create(null); + + #ensureObj(objId) { + const obj = this.#objs[objId]; + + if (obj) { + return obj; + } + + return this.#objs[objId] = { + capability: (0, _util.createPromiseCapability)(), + data: null + }; + } + + get(objId, callback = null) { + if (callback) { + const obj = this.#ensureObj(objId); + obj.capability.promise.then(() => callback(obj.data)); + return null; + } + + const obj = this.#objs[objId]; + + if (!obj?.capability.settled) { + throw new Error(`Requesting object that isn't resolved yet ${objId}.`); + } + + return obj.data; + } + + has(objId) { + const obj = this.#objs[objId]; + return obj?.capability.settled || false; + } + + resolve(objId, data = null) { + const obj = this.#ensureObj(objId); + obj.data = data; + obj.capability.resolve(); + } + + clear() { + this.#objs = Object.create(null); + } + +} + +class RenderTask { + constructor(internalRenderTask) { + this._internalRenderTask = internalRenderTask; + this.onContinue = null; + } + + get promise() { + return this._internalRenderTask.capability.promise; + } + + cancel() { + this._internalRenderTask.cancel(); + } + +} + +exports.RenderTask = RenderTask; + +class InternalRenderTask { + static #canvasInUse = new WeakSet(); + + constructor({ + callback, + params, + objs, + commonObjs, + annotationCanvasMap, + operatorList, + pageIndex, + canvasFactory, + useRequestAnimationFrame = false, + pdfBug = false, + pageColors = null + }) { + this.callback = callback; + this.params = params; + this.objs = objs; + this.commonObjs = commonObjs; + this.annotationCanvasMap = annotationCanvasMap; + this.operatorListIdx = null; + this.operatorList = operatorList; + this._pageIndex = pageIndex; + this.canvasFactory = canvasFactory; + this._pdfBug = pdfBug; + this.pageColors = pageColors; + this.running = false; + this.graphicsReadyCallback = null; + this.graphicsReady = false; + this._useRequestAnimationFrame = useRequestAnimationFrame === true && typeof window !== "undefined"; + this.cancelled = false; + this.capability = (0, _util.createPromiseCapability)(); + 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 = params.canvasContext.canvas; + } + + get completed() { + return this.capability.promise.catch(function () {}); + } + + initializeGraphics({ + transparency = false, + optionalContentConfig + }) { + if (this.cancelled) { + return; + } + + if (this._canvas) { + if (InternalRenderTask.#canvasInUse.has(this._canvas)) { + throw new Error("Cannot use the same canvas during multiple render() operations. " + "Use different canvas or ensure previous operations were " + "cancelled or completed."); + } + + InternalRenderTask.#canvasInUse.add(this._canvas); + } + + if (this._pdfBug && globalThis.StepperManager?.enabled) { + this.stepper = globalThis.StepperManager.create(this._pageIndex); + this.stepper.init(this.operatorList); + this.stepper.nextBreakPoint = this.stepper.getNextBreakPoint(); + } + + const { + canvasContext, + viewport, + transform, + imageLayer, + background + } = this.params; + this.gfx = new _canvas.CanvasGraphics(canvasContext, this.commonObjs, this.objs, this.canvasFactory, imageLayer, optionalContentConfig, this.annotationCanvasMap, this.pageColors); + this.gfx.beginDrawing({ + transform, + viewport, + transparency, + background + }); + this.operatorListIdx = 0; + this.graphicsReady = true; + + if (this.graphicsReadyCallback) { + this.graphicsReadyCallback(); + } + } + + cancel(error = null) { + this.running = false; + this.cancelled = true; + + if (this.gfx) { + this.gfx.endDrawing(); + } + + if (this._canvas) { + InternalRenderTask.#canvasInUse.delete(this._canvas); + } + + this.callback(error || new _display_utils.RenderingCancelledException(`Rendering cancelled, page ${this._pageIndex + 1}`, "canvas")); + } + + operatorListChanged() { + if (!this.graphicsReady) { + if (!this.graphicsReadyCallback) { + this.graphicsReadyCallback = this._continueBound; + } + + return; + } + + if (this.stepper) { + this.stepper.updateOperatorList(this.operatorList); + } + + if (this.running) { + return; + } + + this._continue(); + } + + _continue() { + this.running = true; + + if (this.cancelled) { + return; + } + + if (this.task.onContinue) { + this.task.onContinue(this._scheduleNextBound); + } else { + this._scheduleNext(); + } + } + + _scheduleNext() { + if (this._useRequestAnimationFrame) { + window.requestAnimationFrame(() => { + this._nextBound().catch(this._cancelBound); + }); + } else { + Promise.resolve().then(this._nextBound).catch(this._cancelBound); + } + } + + async _next() { + if (this.cancelled) { + return; + } + + this.operatorListIdx = this.gfx.executeOperatorList(this.operatorList, this.operatorListIdx, this._continueBound, this.stepper); + + if (this.operatorListIdx === this.operatorList.argsArray.length) { + this.running = false; + + if (this.operatorList.lastChunk) { + this.gfx.endDrawing(); + + if (this._canvas) { + InternalRenderTask.#canvasInUse.delete(this._canvas); + } + + this.callback(); + } + } + } + +} + +const version = '2.14.305'; +exports.version = version; +const build = 'eaaa8b4ad'; +exports.build = build; + +/***/ }), +/* 5 */ +/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.StatTimer = exports.RenderingCancelledException = exports.PixelsPerInch = exports.PageViewport = exports.PDFDateString = exports.DOMStandardFontDataFactory = exports.DOMSVGFactory = exports.DOMCanvasFactory = exports.DOMCMapReaderFactory = void 0; +exports.deprecated = deprecated; +exports.getFilenameFromUrl = getFilenameFromUrl; +exports.getPdfFilenameFromUrl = getPdfFilenameFromUrl; +exports.getXfaPageViewport = getXfaPageViewport; +exports.isDataScheme = isDataScheme; +exports.isPdfFile = isPdfFile; +exports.isValidFetchUrl = isValidFetchUrl; +exports.loadScript = loadScript; + +var _base_factory = __w_pdfjs_require__(6); + +var _util = __w_pdfjs_require__(1); + +const SVG_NS = "http://www.w3.org/2000/svg"; + +class PixelsPerInch { + static CSS = 96.0; + static PDF = 72.0; + static PDF_TO_CSS_UNITS = this.CSS / this.PDF; +} + +exports.PixelsPerInch = PixelsPerInch; + +class DOMCanvasFactory extends _base_factory.BaseCanvasFactory { + constructor({ + ownerDocument = globalThis.document + } = {}) { + super(); + this._document = ownerDocument; + } + + _createCanvas(width, height) { + const canvas = this._document.createElement("canvas"); + + canvas.width = width; + canvas.height = height; + return canvas; + } + +} + +exports.DOMCanvasFactory = DOMCanvasFactory; + +async function fetchData(url, asTypedArray = false) { + if (isValidFetchUrl(url, document.baseURI)) { + const response = await fetch(url); + + if (!response.ok) { + throw new Error(response.statusText); + } + + return asTypedArray ? new Uint8Array(await response.arrayBuffer()) : (0, _util.stringToBytes)(await response.text()); + } + + return new Promise((resolve, reject) => { + const request = new XMLHttpRequest(); + request.open("GET", url, true); + + if (asTypedArray) { + request.responseType = "arraybuffer"; + } + + request.onreadystatechange = () => { + if (request.readyState !== XMLHttpRequest.DONE) { + return; + } + + if (request.status === 200 || request.status === 0) { + let data; + + if (asTypedArray && request.response) { + data = new Uint8Array(request.response); + } else if (!asTypedArray && request.responseText) { + data = (0, _util.stringToBytes)(request.responseText); + } + + if (data) { + resolve(data); + return; + } + } + + reject(new Error(request.statusText)); + }; + + request.send(null); + }); +} + +class DOMCMapReaderFactory extends _base_factory.BaseCMapReaderFactory { + _fetchData(url, compressionType) { + return fetchData(url, this.isCompressed).then(data => { + return { + cMapData: data, + compressionType + }; + }); + } + +} + +exports.DOMCMapReaderFactory = DOMCMapReaderFactory; + +class DOMStandardFontDataFactory extends _base_factory.BaseStandardFontDataFactory { + _fetchData(url) { + return fetchData(url, true); + } + +} + +exports.DOMStandardFontDataFactory = DOMStandardFontDataFactory; + +class DOMSVGFactory extends _base_factory.BaseSVGFactory { + _createSVG(type) { + return document.createElementNS(SVG_NS, type); + } + +} + +exports.DOMSVGFactory = DOMSVGFactory; + +class PageViewport { + constructor({ + viewBox, + scale, + rotation, + offsetX = 0, + offsetY = 0, + dontFlip = false + }) { + this.viewBox = viewBox; + this.scale = scale; + this.rotation = rotation; + this.offsetX = offsetX; + this.offsetY = offsetY; + const centerX = (viewBox[2] + viewBox[0]) / 2; + const centerY = (viewBox[3] + viewBox[1]) / 2; + let rotateA, rotateB, rotateC, rotateD; + rotation %= 360; + + if (rotation < 0) { + rotation += 360; + } + + switch (rotation) { + case 180: + rotateA = -1; + rotateB = 0; + rotateC = 0; + rotateD = 1; + break; + + case 90: + rotateA = 0; + rotateB = 1; + rotateC = 1; + rotateD = 0; + break; + + case 270: + rotateA = 0; + rotateB = -1; + rotateC = -1; + rotateD = 0; + break; + + case 0: + rotateA = 1; + rotateB = 0; + rotateC = 0; + rotateD = -1; + break; + + default: + throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees."); + } + + if (dontFlip) { + rotateC = -rotateC; + rotateD = -rotateD; + } + + let offsetCanvasX, offsetCanvasY; + let width, height; + + if (rotateA === 0) { + offsetCanvasX = Math.abs(centerY - viewBox[1]) * scale + offsetX; + offsetCanvasY = Math.abs(centerX - viewBox[0]) * scale + offsetY; + width = Math.abs(viewBox[3] - viewBox[1]) * scale; + height = Math.abs(viewBox[2] - viewBox[0]) * scale; + } else { + offsetCanvasX = Math.abs(centerX - viewBox[0]) * scale + offsetX; + offsetCanvasY = Math.abs(centerY - viewBox[1]) * scale + offsetY; + width = Math.abs(viewBox[2] - viewBox[0]) * scale; + height = Math.abs(viewBox[3] - viewBox[1]) * scale; + } + + this.transform = [rotateA * scale, rotateB * scale, rotateC * scale, rotateD * scale, offsetCanvasX - rotateA * scale * centerX - rotateC * scale * centerY, offsetCanvasY - rotateB * scale * centerX - rotateD * scale * centerY]; + this.width = width; + this.height = height; + } + + clone({ + scale = this.scale, + rotation = this.rotation, + offsetX = this.offsetX, + offsetY = this.offsetY, + dontFlip = false + } = {}) { + return new PageViewport({ + viewBox: this.viewBox.slice(), + scale, + rotation, + offsetX, + offsetY, + dontFlip + }); + } + + convertToViewportPoint(x, y) { + return _util.Util.applyTransform([x, y], this.transform); + } + + convertToViewportRectangle(rect) { + const topLeft = _util.Util.applyTransform([rect[0], rect[1]], this.transform); + + const bottomRight = _util.Util.applyTransform([rect[2], rect[3]], this.transform); + + return [topLeft[0], topLeft[1], bottomRight[0], bottomRight[1]]; + } + + convertToPdfPoint(x, y) { + return _util.Util.applyInverseTransform([x, y], this.transform); + } + +} + +exports.PageViewport = PageViewport; + +class RenderingCancelledException extends _util.BaseException { + constructor(msg, type) { + super(msg, "RenderingCancelledException"); + this.type = type; + } + +} + +exports.RenderingCancelledException = RenderingCancelledException; + +function isDataScheme(url) { + const ii = url.length; + let i = 0; + + while (i < ii && url[i].trim() === "") { + i++; + } + + return url.substring(i, i + 5).toLowerCase() === "data:"; +} + +function isPdfFile(filename) { + return typeof filename === "string" && /\.pdf$/i.test(filename); +} + +function getFilenameFromUrl(url) { + const anchor = url.indexOf("#"); + const query = url.indexOf("?"); + const end = Math.min(anchor > 0 ? anchor : url.length, query > 0 ? query : url.length); + return url.substring(url.lastIndexOf("/", end) + 1, end); +} + +function getPdfFilenameFromUrl(url, defaultFilename = "document.pdf") { + if (typeof url !== "string") { + return defaultFilename; + } + + if (isDataScheme(url)) { + (0, _util.warn)('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'); + return defaultFilename; + } + + const reURI = /^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/; + const reFilename = /[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i; + const splitURI = reURI.exec(url); + let suggestedFilename = reFilename.exec(splitURI[1]) || reFilename.exec(splitURI[2]) || reFilename.exec(splitURI[3]); + + if (suggestedFilename) { + suggestedFilename = suggestedFilename[0]; + + if (suggestedFilename.includes("%")) { + try { + suggestedFilename = reFilename.exec(decodeURIComponent(suggestedFilename))[0]; + } catch (ex) {} + } + } + + return suggestedFilename || defaultFilename; +} + +class StatTimer { + constructor() { + this.started = Object.create(null); + this.times = []; + } + + time(name) { + if (name in this.started) { + (0, _util.warn)(`Timer is already running for ${name}`); + } + + this.started[name] = Date.now(); + } + + timeEnd(name) { + if (!(name in this.started)) { + (0, _util.warn)(`Timer has not been started for ${name}`); + } + + this.times.push({ + name, + start: this.started[name], + end: Date.now() + }); + delete this.started[name]; + } + + toString() { + const outBuf = []; + let longest = 0; + + for (const time of this.times) { + const name = time.name; + + if (name.length > longest) { + longest = name.length; + } + } + + for (const time of this.times) { + const duration = time.end - time.start; + outBuf.push(`${time.name.padEnd(longest)} ${duration}ms\n`); + } + + return outBuf.join(""); + } + +} + +exports.StatTimer = StatTimer; + +function isValidFetchUrl(url, baseUrl) { + try { + const { + protocol + } = baseUrl ? new URL(url, baseUrl) : new URL(url); + return protocol === "http:" || protocol === "https:"; + } catch (ex) { + return false; + } +} + +function loadScript(src, removeScriptElement = false) { + return new Promise((resolve, reject) => { + const script = document.createElement("script"); + script.src = src; + + script.onload = function (evt) { + if (removeScriptElement) { + script.remove(); + } + + resolve(evt); + }; + + script.onerror = function () { + reject(new Error(`Cannot load script at: ${script.src}`)); + }; + + (document.head || document.documentElement).appendChild(script); + }); +} + +function deprecated(details) { + console.log("Deprecated API usage: " + details); +} + +let pdfDateStringRegex; + +class PDFDateString { + static toDateObject(input) { + if (!input || typeof input !== "string") { + return null; + } + + if (!pdfDateStringRegex) { + pdfDateStringRegex = new RegExp("^D:" + "(\\d{4})" + "(\\d{2})?" + "(\\d{2})?" + "(\\d{2})?" + "(\\d{2})?" + "(\\d{2})?" + "([Z|+|-])?" + "(\\d{2})?" + "'?" + "(\\d{2})?" + "'?"); + } + + const matches = pdfDateStringRegex.exec(input); + + if (!matches) { + return null; + } + + const year = parseInt(matches[1], 10); + let month = parseInt(matches[2], 10); + month = month >= 1 && month <= 12 ? month - 1 : 0; + let day = parseInt(matches[3], 10); + day = day >= 1 && day <= 31 ? day : 1; + let hour = parseInt(matches[4], 10); + hour = hour >= 0 && hour <= 23 ? hour : 0; + let minute = parseInt(matches[5], 10); + minute = minute >= 0 && minute <= 59 ? minute : 0; + let second = parseInt(matches[6], 10); + second = second >= 0 && second <= 59 ? second : 0; + const universalTimeRelation = matches[7] || "Z"; + let offsetHour = parseInt(matches[8], 10); + offsetHour = offsetHour >= 0 && offsetHour <= 23 ? offsetHour : 0; + let offsetMinute = parseInt(matches[9], 10) || 0; + offsetMinute = offsetMinute >= 0 && offsetMinute <= 59 ? offsetMinute : 0; + + if (universalTimeRelation === "-") { + hour += offsetHour; + minute += offsetMinute; + } else if (universalTimeRelation === "+") { + hour -= offsetHour; + minute -= offsetMinute; + } + + return new Date(Date.UTC(year, month, day, hour, minute, second)); + } + +} + +exports.PDFDateString = PDFDateString; + +function getXfaPageViewport(xfaPage, { + scale = 1, + rotation = 0 +}) { + const { + width, + height + } = xfaPage.attributes.style; + const viewBox = [0, 0, parseInt(width), parseInt(height)]; + return new PageViewport({ + viewBox, + scale, + rotation + }); +} + +/***/ }), +/* 6 */ +/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.BaseStandardFontDataFactory = exports.BaseSVGFactory = exports.BaseCanvasFactory = exports.BaseCMapReaderFactory = void 0; + +var _util = __w_pdfjs_require__(1); + +class BaseCanvasFactory { + constructor() { + if (this.constructor === BaseCanvasFactory) { + (0, _util.unreachable)("Cannot initialize BaseCanvasFactory."); + } + } + + create(width, height) { + if (width <= 0 || height <= 0) { + throw new Error("Invalid canvas size"); + } + + const canvas = this._createCanvas(width, height); + + return { + canvas, + context: canvas.getContext("2d") + }; + } + + reset(canvasAndContext, width, height) { + if (!canvasAndContext.canvas) { + throw new Error("Canvas is not specified"); + } + + if (width <= 0 || height <= 0) { + throw new Error("Invalid canvas size"); + } + + canvasAndContext.canvas.width = width; + canvasAndContext.canvas.height = height; + } + + destroy(canvasAndContext) { + if (!canvasAndContext.canvas) { + throw new Error("Canvas is not specified"); + } + + canvasAndContext.canvas.width = 0; + canvasAndContext.canvas.height = 0; + canvasAndContext.canvas = null; + canvasAndContext.context = null; + } + + _createCanvas(width, height) { + (0, _util.unreachable)("Abstract method `_createCanvas` called."); + } + +} + +exports.BaseCanvasFactory = BaseCanvasFactory; + +class BaseCMapReaderFactory { + constructor({ + baseUrl = null, + isCompressed = false + }) { + if (this.constructor === BaseCMapReaderFactory) { + (0, _util.unreachable)("Cannot initialize BaseCMapReaderFactory."); + } + + this.baseUrl = baseUrl; + this.isCompressed = isCompressed; + } + + async fetch({ + name + }) { + if (!this.baseUrl) { + throw new Error('The CMap "baseUrl" parameter must be specified, ensure that ' + 'the "cMapUrl" and "cMapPacked" API parameters are provided.'); + } + + if (!name) { + throw new Error("CMap name must be specified."); + } + + const url = this.baseUrl + name + (this.isCompressed ? ".bcmap" : ""); + const compressionType = this.isCompressed ? _util.CMapCompressionType.BINARY : _util.CMapCompressionType.NONE; + return this._fetchData(url, compressionType).catch(reason => { + throw new Error(`Unable to load ${this.isCompressed ? "binary " : ""}CMap at: ${url}`); + }); + } + + _fetchData(url, compressionType) { + (0, _util.unreachable)("Abstract method `_fetchData` called."); + } + +} + +exports.BaseCMapReaderFactory = BaseCMapReaderFactory; + +class BaseStandardFontDataFactory { + constructor({ + baseUrl = null + }) { + if (this.constructor === BaseStandardFontDataFactory) { + (0, _util.unreachable)("Cannot initialize BaseStandardFontDataFactory."); + } + + this.baseUrl = baseUrl; + } + + async fetch({ + filename + }) { + if (!this.baseUrl) { + throw new Error('The standard font "baseUrl" parameter must be specified, ensure that ' + 'the "standardFontDataUrl" API parameter is provided.'); + } + + if (!filename) { + throw new Error("Font filename must be specified."); + } + + const url = `${this.baseUrl}${filename}`; + return this._fetchData(url).catch(reason => { + throw new Error(`Unable to load font data at: ${url}`); + }); + } + + _fetchData(url) { + (0, _util.unreachable)("Abstract method `_fetchData` called."); + } + +} + +exports.BaseStandardFontDataFactory = BaseStandardFontDataFactory; + +class BaseSVGFactory { + constructor() { + if (this.constructor === BaseSVGFactory) { + (0, _util.unreachable)("Cannot initialize BaseSVGFactory."); + } + } + + create(width, height) { + if (width <= 0 || height <= 0) { + throw new Error("Invalid SVG dimensions"); + } + + const svg = this._createSVG("svg:svg"); + + svg.setAttribute("version", "1.1"); + svg.setAttribute("width", `${width}px`); + svg.setAttribute("height", `${height}px`); + svg.setAttribute("preserveAspectRatio", "none"); + svg.setAttribute("viewBox", `0 0 ${width} ${height}`); + return svg; + } + + createElement(type) { + if (typeof type !== "string") { + throw new Error("Invalid SVG element type"); + } + + return this._createSVG(type); + } + + _createSVG(type) { + (0, _util.unreachable)("Abstract method `_createSVG` called."); + } + +} + +exports.BaseSVGFactory = BaseSVGFactory; + +/***/ }), +/* 7 */ +/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.FontLoader = exports.FontFaceObject = void 0; + +var _util = __w_pdfjs_require__(1); + +class BaseFontLoader { + constructor({ + docId, + onUnsupportedFeature, + ownerDocument = globalThis.document, + styleElement = null + }) { + if (this.constructor === BaseFontLoader) { + (0, _util.unreachable)("Cannot initialize BaseFontLoader."); + } + + this.docId = docId; + this._onUnsupportedFeature = onUnsupportedFeature; + this._document = ownerDocument; + this.nativeFontFaces = []; + this.styleElement = null; + } + + addNativeFontFace(nativeFontFace) { + this.nativeFontFaces.push(nativeFontFace); + + this._document.fonts.add(nativeFontFace); + } + + insertRule(rule) { + let styleElement = this.styleElement; + + if (!styleElement) { + styleElement = this.styleElement = this._document.createElement("style"); + styleElement.id = `PDFJS_FONT_STYLE_TAG_${this.docId}`; + + this._document.documentElement.getElementsByTagName("head")[0].appendChild(styleElement); + } + + const styleSheet = styleElement.sheet; + styleSheet.insertRule(rule, styleSheet.cssRules.length); + } + + clear() { + for (const nativeFontFace of this.nativeFontFaces) { + this._document.fonts.delete(nativeFontFace); + } + + this.nativeFontFaces.length = 0; + + if (this.styleElement) { + this.styleElement.remove(); + this.styleElement = null; + } + } + + async bind(font) { + if (font.attached || font.missingFile) { + return; + } + + font.attached = true; + + if (this.isFontLoadingAPISupported) { + const nativeFontFace = font.createNativeFontFace(); + + if (nativeFontFace) { + this.addNativeFontFace(nativeFontFace); + + try { + await nativeFontFace.loaded; + } catch (ex) { + this._onUnsupportedFeature({ + featureId: _util.UNSUPPORTED_FEATURES.errorFontLoadNative + }); + + (0, _util.warn)(`Failed to load font '${nativeFontFace.family}': '${ex}'.`); + font.disableFontFace = true; + throw ex; + } + } + + return; + } + + const rule = font.createFontFaceRule(); + + if (rule) { + this.insertRule(rule); + + if (this.isSyncFontLoadingSupported) { + return; + } + + await new Promise(resolve => { + const request = this._queueLoadingCallback(resolve); + + this._prepareFontLoadEvent([rule], [font], request); + }); + } + } + + _queueLoadingCallback(callback) { + (0, _util.unreachable)("Abstract method `_queueLoadingCallback`."); + } + + get isFontLoadingAPISupported() { + const hasFonts = !!this._document?.fonts; + return (0, _util.shadow)(this, "isFontLoadingAPISupported", hasFonts); + } + + get isSyncFontLoadingSupported() { + (0, _util.unreachable)("Abstract method `isSyncFontLoadingSupported`."); + } + + get _loadTestFont() { + (0, _util.unreachable)("Abstract method `_loadTestFont`."); + } + + _prepareFontLoadEvent(rules, fontsToLoad, request) { + (0, _util.unreachable)("Abstract method `_prepareFontLoadEvent`."); + } + +} + +let FontLoader; +exports.FontLoader = FontLoader; +{ + exports.FontLoader = FontLoader = class GenericFontLoader extends BaseFontLoader { + constructor(params) { + super(params); + this.loadingContext = { + requests: [], + nextRequestId: 0 + }; + this.loadTestFontId = 0; + } + + get isSyncFontLoadingSupported() { + let supported = false; + + if (typeof navigator === "undefined") { + supported = true; + } else { + const m = /Mozilla\/5.0.*?rv:(\d+).*? Gecko/.exec(navigator.userAgent); + + if (m?.[1] >= 14) { + supported = true; + } + } + + return (0, _util.shadow)(this, "isSyncFontLoadingSupported", supported); + } + + _queueLoadingCallback(callback) { + function completeRequest() { + (0, _util.assert)(!request.done, "completeRequest() cannot be called twice."); + request.done = true; + + while (context.requests.length > 0 && context.requests[0].done) { + const otherRequest = context.requests.shift(); + setTimeout(otherRequest.callback, 0); + } + } + + const context = this.loadingContext; + const request = { + id: `pdfjs-font-loading-${context.nextRequestId++}`, + done: false, + complete: completeRequest, + callback + }; + context.requests.push(request); + return request; + } + + get _loadTestFont() { + const getLoadTestFont = function () { + return atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQA" + "FQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAA" + "ALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgA" + "AAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1" + "AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD" + "6AAAAAAD6AABAAAA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fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTj" + "FQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA=="); + }; + + return (0, _util.shadow)(this, "_loadTestFont", getLoadTestFont()); + } + + _prepareFontLoadEvent(rules, fonts, request) { + function int32(data, offset) { + return data.charCodeAt(offset) << 24 | data.charCodeAt(offset + 1) << 16 | data.charCodeAt(offset + 2) << 8 | data.charCodeAt(offset + 3) & 0xff; + } + + function spliceString(s, offset, remove, insert) { + const chunk1 = s.substring(0, offset); + const chunk2 = s.substring(offset + remove); + return chunk1 + insert + chunk2; + } + + let i, ii; + + const canvas = this._document.createElement("canvas"); + + canvas.width = 1; + canvas.height = 1; + const ctx = canvas.getContext("2d"); + let called = 0; + + function isFontReady(name, callback) { + called++; + + if (called > 30) { + (0, _util.warn)("Load test font never loaded."); + callback(); + return; + } + + ctx.font = "30px " + name; + ctx.fillText(".", 0, 20); + const imageData = ctx.getImageData(0, 0, 1, 1); + + if (imageData.data[3] > 0) { + callback(); + return; + } + + setTimeout(isFontReady.bind(null, name, callback)); + } + + const loadTestFontId = `lt${Date.now()}${this.loadTestFontId++}`; + let data = this._loadTestFont; + const COMMENT_OFFSET = 976; + data = spliceString(data, COMMENT_OFFSET, loadTestFontId.length, loadTestFontId); + const CFF_CHECKSUM_OFFSET = 16; + const XXXX_VALUE = 0x58585858; + let checksum = int32(data, CFF_CHECKSUM_OFFSET); + + for (i = 0, ii = loadTestFontId.length - 3; i < ii; i += 4) { + checksum = checksum - XXXX_VALUE + int32(loadTestFontId, i) | 0; + } + + if (i < loadTestFontId.length) { + checksum = checksum - XXXX_VALUE + int32(loadTestFontId + "XXX", i) | 0; + } + + data = spliceString(data, CFF_CHECKSUM_OFFSET, 4, (0, _util.string32)(checksum)); + const url = `url(data:font/opentype;base64,${btoa(data)});`; + const rule = `@font-face {font-family:"${loadTestFontId}";src:${url}}`; + this.insertRule(rule); + const names = []; + + for (const font of fonts) { + names.push(font.loadedName); + } + + names.push(loadTestFontId); + + const div = this._document.createElement("div"); + + div.style.visibility = "hidden"; + div.style.width = div.style.height = "10px"; + div.style.position = "absolute"; + div.style.top = div.style.left = "0px"; + + for (const name of names) { + const span = this._document.createElement("span"); + + span.textContent = "Hi"; + span.style.fontFamily = name; + div.appendChild(span); + } + + this._document.body.appendChild(div); + + isFontReady(loadTestFontId, () => { + div.remove(); + request.complete(); + }); + } + + }; +} + +class FontFaceObject { + constructor(translatedData, { + isEvalSupported = true, + disableFontFace = false, + ignoreErrors = false, + onUnsupportedFeature, + fontRegistry = null + }) { + this.compiledGlyphs = Object.create(null); + + for (const i in translatedData) { + this[i] = translatedData[i]; + } + + this.isEvalSupported = isEvalSupported !== false; + this.disableFontFace = disableFontFace === true; + this.ignoreErrors = ignoreErrors === true; + this._onUnsupportedFeature = onUnsupportedFeature; + this.fontRegistry = fontRegistry; + } + + createNativeFontFace() { + if (!this.data || this.disableFontFace) { + return null; + } + + let nativeFontFace; + + if (!this.cssFontInfo) { + nativeFontFace = new FontFace(this.loadedName, this.data, {}); + } else { + const css = { + weight: this.cssFontInfo.fontWeight + }; + + if (this.cssFontInfo.italicAngle) { + css.style = `oblique ${this.cssFontInfo.italicAngle}deg`; + } + + nativeFontFace = new FontFace(this.cssFontInfo.fontFamily, this.data, css); + } + + if (this.fontRegistry) { + this.fontRegistry.registerFont(this); + } + + return nativeFontFace; + } + + createFontFaceRule() { + if (!this.data || this.disableFontFace) { + return null; + } + + const data = (0, _util.bytesToString)(this.data); + const url = `url(data:${this.mimetype};base64,${btoa(data)});`; + let rule; + + if (!this.cssFontInfo) { + rule = `@font-face {font-family:"${this.loadedName}";src:${url}}`; + } else { + let css = `font-weight: ${this.cssFontInfo.fontWeight};`; + + if (this.cssFontInfo.italicAngle) { + css += `font-style: oblique ${this.cssFontInfo.italicAngle}deg;`; + } + + rule = `@font-face {font-family:"${this.cssFontInfo.fontFamily}";${css}src:${url}}`; + } + + if (this.fontRegistry) { + this.fontRegistry.registerFont(this, url); + } + + return rule; + } + + getPathGenerator(objs, character) { + if (this.compiledGlyphs[character] !== undefined) { + return this.compiledGlyphs[character]; + } + + let cmds; + + try { + cmds = objs.get(this.loadedName + "_path_" + character); + } catch (ex) { + if (!this.ignoreErrors) { + throw ex; + } + + this._onUnsupportedFeature({ + featureId: _util.UNSUPPORTED_FEATURES.errorFontGetPath + }); + + (0, _util.warn)(`getPathGenerator - ignoring character: "${ex}".`); + return this.compiledGlyphs[character] = function (c, size) {}; + } + + if (this.isEvalSupported && _util.FeatureTest.isEvalSupported) { + const jsBuf = []; + + for (const current of cmds) { + const args = current.args !== undefined ? current.args.join(",") : ""; + jsBuf.push("c.", current.cmd, "(", args, ");\n"); + } + + return this.compiledGlyphs[character] = new Function("c", "size", jsBuf.join("")); + } + + return this.compiledGlyphs[character] = function (c, size) { + for (const current of cmds) { + if (current.cmd === "scale") { + current.args = [size, -size]; + } + + c[current.cmd].apply(c, current.args); + } + }; + } + +} + +exports.FontFaceObject = FontFaceObject; + +/***/ }), +/* 8 */ +/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.AnnotationStorage = void 0; + +var _murmurhash = __w_pdfjs_require__(9); + +var _util = __w_pdfjs_require__(1); + +class AnnotationStorage { + constructor() { + this._storage = new Map(); + this._modified = false; + this.onSetModified = null; + this.onResetModified = null; + } + + getValue(key, defaultValue) { + const value = this._storage.get(key); + + if (value === undefined) { + return defaultValue; + } + + return Object.assign(defaultValue, value); + } + + getRawValue(key) { + return this._storage.get(key); + } + + setValue(key, value) { + const obj = this._storage.get(key); + + let modified = false; + + if (obj !== undefined) { + for (const [entry, val] of Object.entries(value)) { + if (obj[entry] !== val) { + modified = true; + obj[entry] = val; + } + } + } else { + modified = true; + + this._storage.set(key, value); + } + + if (modified) { + this._setModified(); + } + } + + getAll() { + return this._storage.size > 0 ? (0, _util.objectFromMap)(this._storage) : null; + } + + get size() { + return this._storage.size; + } + + _setModified() { + if (!this._modified) { + this._modified = true; + + if (typeof this.onSetModified === "function") { + this.onSetModified(); + } + } + } + + resetModified() { + if (this._modified) { + this._modified = false; + + if (typeof this.onResetModified === "function") { + this.onResetModified(); + } + } + } + + get serializable() { + return this._storage.size > 0 ? this._storage : null; + } + + get hash() { + const hash = new _murmurhash.MurmurHash3_64(); + + for (const [key, value] of this._storage) { + hash.update(`${key}:${JSON.stringify(value)}`); + } + + return hash.hexdigest(); + } + +} + +exports.AnnotationStorage = AnnotationStorage; + +/***/ }), +/* 9 */ +/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.MurmurHash3_64 = void 0; + +var _util = __w_pdfjs_require__(1); + +const SEED = 0xc3d2e1f0; +const MASK_HIGH = 0xffff0000; +const MASK_LOW = 0xffff; + +class MurmurHash3_64 { + constructor(seed) { + this.h1 = seed ? seed & 0xffffffff : SEED; + this.h2 = seed ? seed & 0xffffffff : SEED; + } + + update(input) { + let data, length; + + if (typeof input === "string") { + data = new Uint8Array(input.length * 2); + length = 0; + + for (let i = 0, ii = input.length; i < ii; i++) { + const code = input.charCodeAt(i); + + if (code <= 0xff) { + data[length++] = code; + } else { + data[length++] = code >>> 8; + data[length++] = code & 0xff; + } + } + } else if ((0, _util.isArrayBuffer)(input)) { + data = input.slice(); + length = data.byteLength; + } else { + throw new Error("Wrong data format in MurmurHash3_64_update. " + "Input must be a string or array."); + } + + const blockCounts = length >> 2; + const tailLength = length - blockCounts * 4; + const dataUint32 = new Uint32Array(data.buffer, 0, blockCounts); + let k1 = 0, + k2 = 0; + let h1 = this.h1, + h2 = this.h2; + const C1 = 0xcc9e2d51, + C2 = 0x1b873593; + const C1_LOW = C1 & MASK_LOW, + C2_LOW = C2 & MASK_LOW; + + for (let i = 0; i < blockCounts; i++) { + if (i & 1) { + k1 = dataUint32[i]; + k1 = k1 * C1 & MASK_HIGH | k1 * C1_LOW & MASK_LOW; + k1 = k1 << 15 | k1 >>> 17; + k1 = k1 * C2 & MASK_HIGH | k1 * C2_LOW & MASK_LOW; + h1 ^= k1; + h1 = h1 << 13 | h1 >>> 19; + h1 = h1 * 5 + 0xe6546b64; + } else { + k2 = dataUint32[i]; + k2 = k2 * C1 & MASK_HIGH | k2 * C1_LOW & MASK_LOW; + k2 = k2 << 15 | k2 >>> 17; + k2 = k2 * C2 & MASK_HIGH | k2 * C2_LOW & MASK_LOW; + h2 ^= k2; + h2 = h2 << 13 | h2 >>> 19; + h2 = h2 * 5 + 0xe6546b64; + } + } + + k1 = 0; + + switch (tailLength) { + case 3: + k1 ^= data[blockCounts * 4 + 2] << 16; + + case 2: + k1 ^= data[blockCounts * 4 + 1] << 8; + + case 1: + k1 ^= data[blockCounts * 4]; + k1 = k1 * C1 & MASK_HIGH | k1 * C1_LOW & MASK_LOW; + k1 = k1 << 15 | k1 >>> 17; + k1 = k1 * C2 & MASK_HIGH | k1 * C2_LOW & MASK_LOW; + + if (blockCounts & 1) { + h1 ^= k1; + } else { + h2 ^= k1; + } + + } + + this.h1 = h1; + this.h2 = h2; + } + + hexdigest() { + let h1 = this.h1, + h2 = this.h2; + h1 ^= h2 >>> 1; + h1 = h1 * 0xed558ccd & MASK_HIGH | h1 * 0x8ccd & MASK_LOW; + h2 = h2 * 0xff51afd7 & MASK_HIGH | ((h2 << 16 | h1 >>> 16) * 0xafd7ed55 & MASK_HIGH) >>> 16; + h1 ^= h2 >>> 1; + h1 = h1 * 0x1a85ec53 & MASK_HIGH | h1 * 0xec53 & MASK_LOW; + h2 = h2 * 0xc4ceb9fe & MASK_HIGH | ((h2 << 16 | h1 >>> 16) * 0xb9fe1a85 & MASK_HIGH) >>> 16; + h1 ^= h2 >>> 1; + const hex1 = (h1 >>> 0).toString(16), + hex2 = (h2 >>> 0).toString(16); + return hex1.padStart(8, "0") + hex2.padStart(8, "0"); + } + +} + +exports.MurmurHash3_64 = MurmurHash3_64; + +/***/ }), +/* 10 */ +/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.CanvasGraphics = void 0; + +var _util = __w_pdfjs_require__(1); + +var _pattern_helper = __w_pdfjs_require__(11); + +var _image_utils = __w_pdfjs_require__(12); + +var _is_node = __w_pdfjs_require__(3); + +var _display_utils = __w_pdfjs_require__(5); + +const MIN_FONT_SIZE = 16; +const MAX_FONT_SIZE = 100; +const MAX_GROUP_SIZE = 4096; +const EXECUTION_TIME = 15; +const EXECUTION_STEPS = 10; +const COMPILE_TYPE3_GLYPHS = true; +const MAX_SIZE_TO_COMPILE = 1000; +const FULL_CHUNK_HEIGHT = 16; +const LINEWIDTH_SCALE_FACTOR = 1.000001; + +function mirrorContextOperations(ctx, destCtx) { + if (ctx._removeMirroring) { + throw new Error("Context is already forwarding operations."); + } + + ctx.__originalSave = ctx.save; + ctx.__originalRestore = ctx.restore; + ctx.__originalRotate = ctx.rotate; + ctx.__originalScale = ctx.scale; + ctx.__originalTranslate = ctx.translate; + ctx.__originalTransform = ctx.transform; + ctx.__originalSetTransform = ctx.setTransform; + ctx.__originalResetTransform = ctx.resetTransform; + ctx.__originalClip = ctx.clip; + ctx.__originalMoveTo = ctx.moveTo; + ctx.__originalLineTo = ctx.lineTo; + ctx.__originalBezierCurveTo = ctx.bezierCurveTo; + ctx.__originalRect = ctx.rect; + ctx.__originalClosePath = ctx.closePath; + ctx.__originalBeginPath = ctx.beginPath; + + ctx._removeMirroring = () => { + ctx.save = ctx.__originalSave; + ctx.restore = ctx.__originalRestore; + ctx.rotate = ctx.__originalRotate; + ctx.scale = ctx.__originalScale; + ctx.translate = ctx.__originalTranslate; + ctx.transform = ctx.__originalTransform; + ctx.setTransform = ctx.__originalSetTransform; + ctx.resetTransform = ctx.__originalResetTransform; + ctx.clip = ctx.__originalClip; + ctx.moveTo = ctx.__originalMoveTo; + ctx.lineTo = ctx.__originalLineTo; + ctx.bezierCurveTo = ctx.__originalBezierCurveTo; + ctx.rect = ctx.__originalRect; + ctx.closePath = ctx.__originalClosePath; + ctx.beginPath = ctx.__originalBeginPath; + delete ctx._removeMirroring; + }; + + ctx.save = function ctxSave() { + destCtx.save(); + + this.__originalSave(); + }; + + ctx.restore = function ctxRestore() { + destCtx.restore(); + + this.__originalRestore(); + }; + + ctx.translate = function ctxTranslate(x, y) { + destCtx.translate(x, y); + + this.__originalTranslate(x, y); + }; + + ctx.scale = function ctxScale(x, y) { + destCtx.scale(x, y); + + this.__originalScale(x, y); + }; + + ctx.transform = function ctxTransform(a, b, c, d, e, f) { + destCtx.transform(a, b, c, d, e, f); + + this.__originalTransform(a, b, c, d, e, f); + }; + + ctx.setTransform = function ctxSetTransform(a, b, c, d, e, f) { + destCtx.setTransform(a, b, c, d, e, f); + + this.__originalSetTransform(a, b, c, d, e, f); + }; + + ctx.resetTransform = function ctxResetTransform() { + destCtx.resetTransform(); + + this.__originalResetTransform(); + }; + + ctx.rotate = function ctxRotate(angle) { + destCtx.rotate(angle); + + this.__originalRotate(angle); + }; + + ctx.clip = function ctxRotate(rule) { + destCtx.clip(rule); + + this.__originalClip(rule); + }; + + ctx.moveTo = function (x, y) { + destCtx.moveTo(x, y); + + this.__originalMoveTo(x, y); + }; + + ctx.lineTo = function (x, y) { + destCtx.lineTo(x, y); + + this.__originalLineTo(x, y); + }; + + ctx.bezierCurveTo = function (cp1x, cp1y, cp2x, cp2y, x, y) { + destCtx.bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y); + + this.__originalBezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y); + }; + + ctx.rect = function (x, y, width, height) { + destCtx.rect(x, y, width, height); + + this.__originalRect(x, y, width, height); + }; + + ctx.closePath = function () { + destCtx.closePath(); + + this.__originalClosePath(); + }; + + ctx.beginPath = function () { + destCtx.beginPath(); + + this.__originalBeginPath(); + }; +} + +function addContextCurrentTransform(ctx) { + if (ctx._transformStack) { + ctx._transformStack = []; + } + + if (ctx.mozCurrentTransform) { + return; + } + + ctx._originalSave = ctx.save; + ctx._originalRestore = ctx.restore; + ctx._originalRotate = ctx.rotate; + ctx._originalScale = ctx.scale; + ctx._originalTranslate = ctx.translate; + ctx._originalTransform = ctx.transform; + ctx._originalSetTransform = ctx.setTransform; + ctx._originalResetTransform = ctx.resetTransform; + ctx._transformMatrix = ctx._transformMatrix || [1, 0, 0, 1, 0, 0]; + ctx._transformStack = []; + + try { + const desc = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(ctx), "lineWidth"); + ctx._setLineWidth = desc.set; + ctx._getLineWidth = desc.get; + Object.defineProperty(ctx, "lineWidth", { + set: function setLineWidth(width) { + this._setLineWidth(width * LINEWIDTH_SCALE_FACTOR); + }, + get: function getLineWidth() { + return this._getLineWidth(); + } + }); + } catch (_) {} + + Object.defineProperty(ctx, "mozCurrentTransform", { + get: function getCurrentTransform() { + return this._transformMatrix; + } + }); + Object.defineProperty(ctx, "mozCurrentTransformInverse", { + get: function getCurrentTransformInverse() { + const [a, b, c, d, e, f] = this._transformMatrix; + const ad_bc = a * d - b * c; + const bc_ad = b * c - a * d; + return [d / ad_bc, b / bc_ad, c / bc_ad, a / ad_bc, (d * e - c * f) / bc_ad, (b * e - a * f) / ad_bc]; + } + }); + + ctx.save = function ctxSave() { + const old = this._transformMatrix; + + this._transformStack.push(old); + + this._transformMatrix = old.slice(0, 6); + + this._originalSave(); + }; + + ctx.restore = function ctxRestore() { + if (this._transformStack.length === 0) { + (0, _util.warn)("Tried to restore a ctx when the stack was already empty."); + } + + const prev = this._transformStack.pop(); + + if (prev) { + this._transformMatrix = prev; + + this._originalRestore(); + } + }; + + ctx.translate = function ctxTranslate(x, y) { + const m = this._transformMatrix; + m[4] = m[0] * x + m[2] * y + m[4]; + m[5] = m[1] * x + m[3] * y + m[5]; + + this._originalTranslate(x, y); + }; + + ctx.scale = function ctxScale(x, y) { + const m = this._transformMatrix; + m[0] *= x; + m[1] *= x; + m[2] *= y; + m[3] *= y; + + this._originalScale(x, y); + }; + + ctx.transform = function ctxTransform(a, b, c, d, e, f) { + const m = this._transformMatrix; + this._transformMatrix = [m[0] * a + m[2] * b, m[1] * a + m[3] * b, m[0] * c + m[2] * d, m[1] * c + m[3] * d, m[0] * e + m[2] * f + m[4], m[1] * e + m[3] * f + m[5]]; + + ctx._originalTransform(a, b, c, d, e, f); + }; + + ctx.setTransform = function ctxSetTransform(a, b, c, d, e, f) { + this._transformMatrix = [a, b, c, d, e, f]; + + ctx._originalSetTransform(a, b, c, d, e, f); + }; + + ctx.resetTransform = function ctxResetTransform() { + this._transformMatrix = [1, 0, 0, 1, 0, 0]; + + ctx._originalResetTransform(); + }; + + ctx.rotate = function ctxRotate(angle) { + const cosValue = Math.cos(angle); + const sinValue = Math.sin(angle); + const m = this._transformMatrix; + this._transformMatrix = [m[0] * cosValue + m[2] * sinValue, m[1] * cosValue + m[3] * sinValue, m[0] * -sinValue + m[2] * cosValue, m[1] * -sinValue + m[3] * cosValue, m[4], m[5]]; + + this._originalRotate(angle); + }; +} + +class CachedCanvases { + constructor(canvasFactory) { + this.canvasFactory = canvasFactory; + this.cache = Object.create(null); + } + + getCanvas(id, width, height, trackTransform) { + let canvasEntry; + + if (this.cache[id] !== undefined) { + canvasEntry = this.cache[id]; + this.canvasFactory.reset(canvasEntry, width, height); + canvasEntry.context.setTransform(1, 0, 0, 1, 0, 0); + } else { + canvasEntry = this.canvasFactory.create(width, height); + this.cache[id] = canvasEntry; + } + + if (trackTransform) { + addContextCurrentTransform(canvasEntry.context); + } + + return canvasEntry; + } + + delete(id) { + delete this.cache[id]; + } + + clear() { + for (const id in this.cache) { + const canvasEntry = this.cache[id]; + this.canvasFactory.destroy(canvasEntry); + delete this.cache[id]; + } + } + +} + +function drawImageAtIntegerCoords(ctx, srcImg, srcX, srcY, srcW, srcH, destX, destY, destW, destH) { + const [a, b, c, d, tx, ty] = ctx.mozCurrentTransform; + + if (b === 0 && c === 0) { + const tlX = destX * a + tx; + const rTlX = Math.round(tlX); + const tlY = destY * d + ty; + const rTlY = Math.round(tlY); + const brX = (destX + destW) * a + tx; + const rWidth = Math.abs(Math.round(brX) - rTlX) || 1; + const brY = (destY + destH) * d + ty; + const rHeight = Math.abs(Math.round(brY) - rTlY) || 1; + ctx.setTransform(Math.sign(a), 0, 0, Math.sign(d), rTlX, rTlY); + ctx.drawImage(srcImg, srcX, srcY, srcW, srcH, 0, 0, rWidth, rHeight); + ctx.setTransform(a, b, c, d, tx, ty); + return [rWidth, rHeight]; + } + + if (a === 0 && d === 0) { + const tlX = destY * c + tx; + const rTlX = Math.round(tlX); + const tlY = destX * b + ty; + const rTlY = Math.round(tlY); + const brX = (destY + destH) * c + tx; + const rWidth = Math.abs(Math.round(brX) - rTlX) || 1; + const brY = (destX + destW) * b + ty; + const rHeight = Math.abs(Math.round(brY) - rTlY) || 1; + ctx.setTransform(0, Math.sign(b), Math.sign(c), 0, rTlX, rTlY); + ctx.drawImage(srcImg, srcX, srcY, srcW, srcH, 0, 0, rHeight, rWidth); + ctx.setTransform(a, b, c, d, tx, ty); + return [rHeight, rWidth]; + } + + ctx.drawImage(srcImg, srcX, srcY, srcW, srcH, destX, destY, destW, destH); + const scaleX = Math.hypot(a, b); + const scaleY = Math.hypot(c, d); + return [scaleX * destW, scaleY * destH]; +} + +function compileType3Glyph(imgData) { + const { + width, + height + } = imgData; + + if (!COMPILE_TYPE3_GLYPHS || width > MAX_SIZE_TO_COMPILE || height > MAX_SIZE_TO_COMPILE) { + return null; + } + + const POINT_TO_PROCESS_LIMIT = 1000; + const POINT_TYPES = new Uint8Array([0, 2, 4, 0, 1, 0, 5, 4, 8, 10, 0, 8, 0, 2, 1, 0]); + const width1 = width + 1; + let points = new Uint8Array(width1 * (height + 1)); + let i, j, j0; + const lineSize = width + 7 & ~7; + let data = new Uint8Array(lineSize * height), + pos = 0; + + for (const elem of imgData.data) { + let mask = 128; + + while (mask > 0) { + data[pos++] = elem & mask ? 0 : 255; + mask >>= 1; + } + } + + let count = 0; + pos = 0; + + if (data[pos] !== 0) { + points[0] = 1; + ++count; + } + + for (j = 1; j < width; j++) { + if (data[pos] !== data[pos + 1]) { + points[j] = data[pos] ? 2 : 1; + ++count; + } + + pos++; + } + + if (data[pos] !== 0) { + points[j] = 2; + ++count; + } + + for (i = 1; i < height; i++) { + pos = i * lineSize; + j0 = i * width1; + + if (data[pos - lineSize] !== data[pos]) { + points[j0] = data[pos] ? 1 : 8; + ++count; + } + + let sum = (data[pos] ? 4 : 0) + (data[pos - lineSize] ? 8 : 0); + + for (j = 1; j < width; j++) { + sum = (sum >> 2) + (data[pos + 1] ? 4 : 0) + (data[pos - lineSize + 1] ? 8 : 0); + + if (POINT_TYPES[sum]) { + points[j0 + j] = POINT_TYPES[sum]; + ++count; + } + + pos++; + } + + if (data[pos - lineSize] !== data[pos]) { + points[j0 + j] = data[pos] ? 2 : 4; + ++count; + } + + if (count > POINT_TO_PROCESS_LIMIT) { + return null; + } + } + + pos = lineSize * (height - 1); + j0 = i * width1; + + if (data[pos] !== 0) { + points[j0] = 8; + ++count; + } + + for (j = 1; j < width; j++) { + if (data[pos] !== data[pos + 1]) { + points[j0 + j] = data[pos] ? 4 : 8; + ++count; + } + + pos++; + } + + if (data[pos] !== 0) { + points[j0 + j] = 4; + ++count; + } + + if (count > POINT_TO_PROCESS_LIMIT) { + return null; + } + + const steps = new Int32Array([0, width1, -1, 0, -width1, 0, 0, 0, 1]); + let path, outlines, coords; + + if (!_is_node.isNodeJS) { + path = new Path2D(); + } else { + outlines = []; + } + + for (i = 0; count && i <= height; i++) { + let p = i * width1; + const end = p + width; + + while (p < end && !points[p]) { + p++; + } + + if (p === end) { + continue; + } + + if (path) { + path.moveTo(p % width1, i); + } else { + coords = [p % width1, i]; + } + + const p0 = p; + let type = points[p]; + + do { + const step = steps[type]; + + do { + p += step; + } while (!points[p]); + + const pp = points[p]; + + if (pp !== 5 && pp !== 10) { + type = pp; + points[p] = 0; + } else { + type = pp & 0x33 * type >> 4; + points[p] &= type >> 2 | type << 2; + } + + if (path) { + path.lineTo(p % width1, p / width1 | 0); + } else { + coords.push(p % width1, p / width1 | 0); + } + + if (!points[p]) { + --count; + } + } while (p0 !== p); + + if (!path) { + outlines.push(coords); + } + + --i; + } + + data = null; + points = null; + + const drawOutline = function (c) { + c.save(); + c.scale(1 / width, -1 / height); + c.translate(0, -height); + + if (path) { + c.fill(path); + } else { + c.beginPath(); + + for (const o of outlines) { + c.moveTo(o[0], o[1]); + + for (let l = 2, ll = o.length; l < ll; l += 2) { + c.lineTo(o[l], o[l + 1]); + } + } + + c.fill(); + } + + c.beginPath(); + c.restore(); + }; + + return drawOutline; +} + +class CanvasExtraState { + constructor(width, height) { + this.alphaIsShape = false; + this.fontSize = 0; + this.fontSizeScale = 1; + this.textMatrix = _util.IDENTITY_MATRIX; + this.textMatrixScale = 1; + this.fontMatrix = _util.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 = _util.TextRenderingMode.FILL; + this.textRise = 0; + this.fillColor = "#000000"; + this.strokeColor = "#000000"; + this.patternFill = false; + this.fillAlpha = 1; + this.strokeAlpha = 1; + this.lineWidth = 1; + this.activeSMask = null; + this.transferMaps = null; + this.startNewPathAndClipBox([0, 0, width, height]); + } + + clone() { + const clone = Object.create(this); + clone.clipBox = this.clipBox.slice(); + return clone; + } + + setCurrentPoint(x, y) { + this.x = x; + this.y = y; + } + + updatePathMinMax(transform, x, y) { + [x, y] = _util.Util.applyTransform([x, y], transform); + this.minX = Math.min(this.minX, x); + this.minY = Math.min(this.minY, y); + this.maxX = Math.max(this.maxX, x); + this.maxY = Math.max(this.maxY, y); + } + + updateRectMinMax(transform, rect) { + const p1 = _util.Util.applyTransform(rect, transform); + + const p2 = _util.Util.applyTransform(rect.slice(2), transform); + + this.minX = Math.min(this.minX, p1[0], p2[0]); + this.minY = Math.min(this.minY, p1[1], p2[1]); + this.maxX = Math.max(this.maxX, p1[0], p2[0]); + this.maxY = Math.max(this.maxY, p1[1], p2[1]); + } + + updateScalingPathMinMax(transform, minMax) { + _util.Util.scaleMinMax(transform, minMax); + + this.minX = Math.min(this.minX, minMax[0]); + this.maxX = Math.max(this.maxX, minMax[1]); + this.minY = Math.min(this.minY, minMax[2]); + this.maxY = Math.max(this.maxY, minMax[3]); + } + + updateCurvePathMinMax(transform, x0, y0, x1, y1, x2, y2, x3, y3, minMax) { + const box = _util.Util.bezierBoundingBox(x0, y0, x1, y1, x2, y2, x3, y3); + + if (minMax) { + minMax[0] = Math.min(minMax[0], box[0], box[2]); + minMax[1] = Math.max(minMax[1], box[0], box[2]); + minMax[2] = Math.min(minMax[2], box[1], box[3]); + minMax[3] = Math.max(minMax[3], box[1], box[3]); + return; + } + + this.updateRectMinMax(transform, box); + } + + getPathBoundingBox(pathType = _pattern_helper.PathType.FILL, transform = null) { + const box = [this.minX, this.minY, this.maxX, this.maxY]; + + if (pathType === _pattern_helper.PathType.STROKE) { + if (!transform) { + (0, _util.unreachable)("Stroke bounding box must include transform."); + } + + const scale = _util.Util.singularValueDecompose2dScale(transform); + + const xStrokePad = scale[0] * this.lineWidth / 2; + const yStrokePad = scale[1] * this.lineWidth / 2; + box[0] -= xStrokePad; + box[1] -= yStrokePad; + box[2] += xStrokePad; + box[3] += yStrokePad; + } + + return box; + } + + updateClipFromPath() { + const intersect = _util.Util.intersect(this.clipBox, this.getPathBoundingBox()); + + this.startNewPathAndClipBox(intersect || [0, 0, 0, 0]); + } + + isEmptyClip() { + return this.minX === Infinity; + } + + startNewPathAndClipBox(box) { + this.clipBox = box; + this.minX = Infinity; + this.minY = Infinity; + this.maxX = 0; + this.maxY = 0; + } + + getClippedPathBoundingBox(pathType = _pattern_helper.PathType.FILL, transform = null) { + return _util.Util.intersect(this.clipBox, this.getPathBoundingBox(pathType, transform)); + } + +} + +function putBinaryImageData(ctx, imgData, transferMaps = null) { + if (typeof ImageData !== "undefined" && imgData instanceof ImageData) { + ctx.putImageData(imgData, 0, 0); + return; + } + + const height = imgData.height, + width = imgData.width; + const partialChunkHeight = height % FULL_CHUNK_HEIGHT; + const fullChunks = (height - partialChunkHeight) / FULL_CHUNK_HEIGHT; + const totalChunks = partialChunkHeight === 0 ? fullChunks : fullChunks + 1; + const chunkImgData = ctx.createImageData(width, FULL_CHUNK_HEIGHT); + let srcPos = 0, + destPos; + const src = imgData.data; + const dest = chunkImgData.data; + let i, j, thisChunkHeight, elemsInThisChunk; + let transferMapRed, transferMapGreen, transferMapBlue, transferMapGray; + + if (transferMaps) { + switch (transferMaps.length) { + case 1: + transferMapRed = transferMaps[0]; + transferMapGreen = transferMaps[0]; + transferMapBlue = transferMaps[0]; + transferMapGray = transferMaps[0]; + break; + + case 4: + transferMapRed = transferMaps[0]; + transferMapGreen = transferMaps[1]; + transferMapBlue = transferMaps[2]; + transferMapGray = transferMaps[3]; + break; + } + } + + if (imgData.kind === _util.ImageKind.GRAYSCALE_1BPP) { + const srcLength = src.byteLength; + const dest32 = new Uint32Array(dest.buffer, 0, dest.byteLength >> 2); + const dest32DataLength = dest32.length; + const fullSrcDiff = width + 7 >> 3; + let white = 0xffffffff; + let black = _util.FeatureTest.isLittleEndian ? 0xff000000 : 0x000000ff; + + if (transferMapGray) { + if (transferMapGray[0] === 0xff && transferMapGray[0xff] === 0) { + [white, black] = [black, white]; + } + } + + for (i = 0; i < totalChunks; i++) { + thisChunkHeight = i < fullChunks ? FULL_CHUNK_HEIGHT : partialChunkHeight; + destPos = 0; + + for (j = 0; j < thisChunkHeight; j++) { + const srcDiff = srcLength - srcPos; + let k = 0; + const kEnd = srcDiff > fullSrcDiff ? width : srcDiff * 8 - 7; + const kEndUnrolled = kEnd & ~7; + let mask = 0; + let srcByte = 0; + + for (; k < kEndUnrolled; k += 8) { + srcByte = src[srcPos++]; + dest32[destPos++] = srcByte & 128 ? white : black; + dest32[destPos++] = srcByte & 64 ? white : black; + dest32[destPos++] = srcByte & 32 ? white : black; + dest32[destPos++] = srcByte & 16 ? white : black; + dest32[destPos++] = srcByte & 8 ? white : black; + dest32[destPos++] = srcByte & 4 ? white : black; + dest32[destPos++] = srcByte & 2 ? white : black; + dest32[destPos++] = srcByte & 1 ? white : black; + } + + for (; k < kEnd; k++) { + if (mask === 0) { + srcByte = src[srcPos++]; + mask = 128; + } + + dest32[destPos++] = srcByte & mask ? white : black; + mask >>= 1; + } + } + + while (destPos < dest32DataLength) { + dest32[destPos++] = 0; + } + + ctx.putImageData(chunkImgData, 0, i * FULL_CHUNK_HEIGHT); + } + } else if (imgData.kind === _util.ImageKind.RGBA_32BPP) { + const hasTransferMaps = !!(transferMapRed || transferMapGreen || transferMapBlue); + j = 0; + elemsInThisChunk = width * FULL_CHUNK_HEIGHT * 4; + + for (i = 0; i < fullChunks; i++) { + dest.set(src.subarray(srcPos, srcPos + elemsInThisChunk)); + srcPos += elemsInThisChunk; + + if (hasTransferMaps) { + for (let k = 0; k < elemsInThisChunk; k += 4) { + if (transferMapRed) { + dest[k + 0] = transferMapRed[dest[k + 0]]; + } + + if (transferMapGreen) { + dest[k + 1] = transferMapGreen[dest[k + 1]]; + } + + if (transferMapBlue) { + dest[k + 2] = transferMapBlue[dest[k + 2]]; + } + } + } + + ctx.putImageData(chunkImgData, 0, j); + j += FULL_CHUNK_HEIGHT; + } + + if (i < totalChunks) { + elemsInThisChunk = width * partialChunkHeight * 4; + dest.set(src.subarray(srcPos, srcPos + elemsInThisChunk)); + + if (hasTransferMaps) { + for (let k = 0; k < elemsInThisChunk; k += 4) { + if (transferMapRed) { + dest[k + 0] = transferMapRed[dest[k + 0]]; + } + + if (transferMapGreen) { + dest[k + 1] = transferMapGreen[dest[k + 1]]; + } + + if (transferMapBlue) { + dest[k + 2] = transferMapBlue[dest[k + 2]]; + } + } + } + + ctx.putImageData(chunkImgData, 0, j); + } + } else if (imgData.kind === _util.ImageKind.RGB_24BPP) { + const hasTransferMaps = !!(transferMapRed || transferMapGreen || transferMapBlue); + thisChunkHeight = FULL_CHUNK_HEIGHT; + elemsInThisChunk = width * thisChunkHeight; + + for (i = 0; i < totalChunks; i++) { + if (i >= fullChunks) { + thisChunkHeight = partialChunkHeight; + elemsInThisChunk = width * thisChunkHeight; + } + + destPos = 0; + + for (j = elemsInThisChunk; j--;) { + dest[destPos++] = src[srcPos++]; + dest[destPos++] = src[srcPos++]; + dest[destPos++] = src[srcPos++]; + dest[destPos++] = 255; + } + + if (hasTransferMaps) { + for (let k = 0; k < destPos; k += 4) { + if (transferMapRed) { + dest[k + 0] = transferMapRed[dest[k + 0]]; + } + + if (transferMapGreen) { + dest[k + 1] = transferMapGreen[dest[k + 1]]; + } + + if (transferMapBlue) { + dest[k + 2] = transferMapBlue[dest[k + 2]]; + } + } + } + + ctx.putImageData(chunkImgData, 0, i * FULL_CHUNK_HEIGHT); + } + } else { + throw new Error(`bad image kind: ${imgData.kind}`); + } +} + +function putBinaryImageMask(ctx, imgData) { + if (imgData.bitmap) { + ctx.drawImage(imgData.bitmap, 0, 0); + return; + } + + const height = imgData.height, + width = imgData.width; + const partialChunkHeight = height % FULL_CHUNK_HEIGHT; + const fullChunks = (height - partialChunkHeight) / FULL_CHUNK_HEIGHT; + const totalChunks = partialChunkHeight === 0 ? fullChunks : fullChunks + 1; + const chunkImgData = ctx.createImageData(width, FULL_CHUNK_HEIGHT); + let srcPos = 0; + const src = imgData.data; + const dest = chunkImgData.data; + + for (let i = 0; i < totalChunks; i++) { + const thisChunkHeight = i < fullChunks ? FULL_CHUNK_HEIGHT : partialChunkHeight; + ({ + srcPos + } = (0, _image_utils.applyMaskImageData)({ + src, + srcPos, + dest, + width, + height: thisChunkHeight + })); + ctx.putImageData(chunkImgData, 0, i * FULL_CHUNK_HEIGHT); + } +} + +function copyCtxState(sourceCtx, destCtx) { + const properties = ["strokeStyle", "fillStyle", "fillRule", "globalAlpha", "lineWidth", "lineCap", "lineJoin", "miterLimit", "globalCompositeOperation", "font"]; + + for (let i = 0, ii = properties.length; i < ii; i++) { + const property = properties[i]; + + if (sourceCtx[property] !== undefined) { + destCtx[property] = sourceCtx[property]; + } + } + + if (sourceCtx.setLineDash !== undefined) { + destCtx.setLineDash(sourceCtx.getLineDash()); + destCtx.lineDashOffset = sourceCtx.lineDashOffset; + } +} + +function resetCtxToDefault(ctx, foregroundColor) { + ctx.strokeStyle = ctx.fillStyle = foregroundColor || "#000000"; + ctx.fillRule = "nonzero"; + ctx.globalAlpha = 1; + ctx.lineWidth = 1; + ctx.lineCap = "butt"; + ctx.lineJoin = "miter"; + ctx.miterLimit = 10; + ctx.globalCompositeOperation = "source-over"; + ctx.font = "10px sans-serif"; + + if (ctx.setLineDash !== undefined) { + ctx.setLineDash([]); + ctx.lineDashOffset = 0; + } +} + +function composeSMaskBackdrop(bytes, r0, g0, b0) { + const length = bytes.length; + + for (let i = 3; i < length; i += 4) { + const alpha = bytes[i]; + + if (alpha === 0) { + bytes[i - 3] = r0; + bytes[i - 2] = g0; + bytes[i - 1] = b0; + } else if (alpha < 255) { + const alpha_ = 255 - alpha; + bytes[i - 3] = bytes[i - 3] * alpha + r0 * alpha_ >> 8; + bytes[i - 2] = bytes[i - 2] * alpha + g0 * alpha_ >> 8; + bytes[i - 1] = bytes[i - 1] * alpha + b0 * alpha_ >> 8; + } + } +} + +function composeSMaskAlpha(maskData, layerData, transferMap) { + const length = maskData.length; + const scale = 1 / 255; + + for (let i = 3; i < length; i += 4) { + const alpha = transferMap ? transferMap[maskData[i]] : maskData[i]; + layerData[i] = layerData[i] * alpha * scale | 0; + } +} + +function composeSMaskLuminosity(maskData, layerData, transferMap) { + const length = maskData.length; + + for (let i = 3; i < length; i += 4) { + const y = maskData[i - 3] * 77 + maskData[i - 2] * 152 + maskData[i - 1] * 28; + layerData[i] = transferMap ? layerData[i] * transferMap[y >> 8] >> 8 : layerData[i] * y >> 16; + } +} + +function genericComposeSMask(maskCtx, layerCtx, width, height, subtype, backdrop, transferMap, layerOffsetX, layerOffsetY, maskOffsetX, maskOffsetY) { + const hasBackdrop = !!backdrop; + const r0 = hasBackdrop ? backdrop[0] : 0; + const g0 = hasBackdrop ? backdrop[1] : 0; + const b0 = hasBackdrop ? backdrop[2] : 0; + let composeFn; + + if (subtype === "Luminosity") { + composeFn = composeSMaskLuminosity; + } else { + composeFn = composeSMaskAlpha; + } + + const PIXELS_TO_PROCESS = 1048576; + const chunkSize = Math.min(height, Math.ceil(PIXELS_TO_PROCESS / width)); + + for (let row = 0; row < height; row += chunkSize) { + const chunkHeight = Math.min(chunkSize, height - row); + const maskData = maskCtx.getImageData(layerOffsetX - maskOffsetX, row + (layerOffsetY - maskOffsetY), width, chunkHeight); + const layerData = layerCtx.getImageData(layerOffsetX, row + layerOffsetY, width, chunkHeight); + + if (hasBackdrop) { + composeSMaskBackdrop(maskData.data, r0, g0, b0); + } + + composeFn(maskData.data, layerData.data, transferMap); + layerCtx.putImageData(layerData, layerOffsetX, row + layerOffsetY); + } +} + +function composeSMask(ctx, smask, layerCtx, layerBox) { + const layerOffsetX = layerBox[0]; + const layerOffsetY = layerBox[1]; + const layerWidth = layerBox[2] - layerOffsetX; + const layerHeight = layerBox[3] - layerOffsetY; + + if (layerWidth === 0 || layerHeight === 0) { + return; + } + + genericComposeSMask(smask.context, layerCtx, layerWidth, layerHeight, smask.subtype, smask.backdrop, smask.transferMap, layerOffsetX, layerOffsetY, smask.offsetX, smask.offsetY); + ctx.save(); + ctx.globalAlpha = 1; + ctx.globalCompositeOperation = "source-over"; + ctx.setTransform(1, 0, 0, 1, 0, 0); + ctx.drawImage(layerCtx.canvas, 0, 0); + ctx.restore(); +} + +function getImageSmoothingEnabled(transform, interpolate) { + const scale = _util.Util.singularValueDecompose2dScale(transform); + + scale[0] = Math.fround(scale[0]); + scale[1] = Math.fround(scale[1]); + const actualScale = Math.fround((globalThis.devicePixelRatio || 1) * _display_utils.PixelsPerInch.PDF_TO_CSS_UNITS); + + if (interpolate !== undefined) { + return interpolate; + } else if (scale[0] <= actualScale || scale[1] <= actualScale) { + return true; + } + + return false; +} + +const LINE_CAP_STYLES = ["butt", "round", "square"]; +const LINE_JOIN_STYLES = ["miter", "round", "bevel"]; +const NORMAL_CLIP = {}; +const EO_CLIP = {}; + +class CanvasGraphics { + constructor(canvasCtx, commonObjs, objs, canvasFactory, imageLayer, optionalContentConfig, annotationCanvasMap, pageColors) { + this.ctx = canvasCtx; + this.current = new CanvasExtraState(this.ctx.canvas.width, this.ctx.canvas.height); + this.stateStack = []; + this.pendingClip = null; + this.pendingEOFill = false; + this.res = null; + this.xobjs = null; + this.commonObjs = commonObjs; + this.objs = objs; + this.canvasFactory = canvasFactory; + this.imageLayer = imageLayer; + 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 = true; + this.markedContentStack = []; + this.optionalContentConfig = optionalContentConfig; + this.cachedCanvases = new CachedCanvases(this.canvasFactory); + this.cachedPatterns = new Map(); + this.annotationCanvasMap = annotationCanvasMap; + this.viewportScale = 1; + this.outputScaleX = 1; + this.outputScaleY = 1; + this.backgroundColor = pageColors?.background || null; + this.foregroundColor = pageColors?.foreground || null; + + if (canvasCtx) { + addContextCurrentTransform(canvasCtx); + } + + this._cachedScaleForStroking = null; + this._cachedGetSinglePixelWidth = null; + this._cachedBitmapsMap = new Map(); + } + + getObject(data, fallback = null) { + if (typeof data === "string") { + return data.startsWith("g_") ? this.commonObjs.get(data) : this.objs.get(data); + } + + return fallback; + } + + beginDrawing({ + transform, + viewport, + transparency = false, + background = null + }) { + const width = this.ctx.canvas.width; + const height = this.ctx.canvas.height; + const defaultBackgroundColor = background || "#ffffff"; + this.ctx.save(); + + if (this.foregroundColor && this.backgroundColor) { + this.ctx.fillStyle = this.foregroundColor; + const fg = this.foregroundColor = this.ctx.fillStyle; + this.ctx.fillStyle = this.backgroundColor; + const bg = this.backgroundColor = this.ctx.fillStyle; + let isValidDefaultBg = true; + let defaultBg = defaultBackgroundColor; + this.ctx.fillStyle = defaultBackgroundColor; + defaultBg = this.ctx.fillStyle; + isValidDefaultBg = typeof defaultBg === "string" && /^#[0-9A-Fa-f]{6}$/.test(defaultBg); + + if (fg === "#000000" && bg === "#ffffff" || fg === bg || !isValidDefaultBg) { + this.foregroundColor = this.backgroundColor = null; + } else { + const cB = parseInt(defaultBg.slice(1), 16); + const rB = (cB && 0xff0000) >> 16; + const gB = (cB && 0x00ff00) >> 8; + const bB = cB && 0x0000ff; + + const newComp = x => { + x /= 255; + return x <= 0.03928 ? x / 12.92 : ((x + 0.055) / 1.055) ** 2.4; + }; + + const lumB = Math.round(0.2126 * newComp(rB) + 0.7152 * newComp(gB) + 0.0722 * newComp(bB)); + + this.selectColor = (r, g, b) => { + const lumC = 0.2126 * newComp(r) + 0.7152 * newComp(g) + 0.0722 * newComp(b); + return Math.round(lumC) === lumB ? bg : fg; + }; + } + } + + this.ctx.fillStyle = this.backgroundColor || defaultBackgroundColor; + this.ctx.fillRect(0, 0, width, height); + this.ctx.restore(); + + if (transparency) { + const transparentCanvas = this.cachedCanvases.getCanvas("transparent", width, height, true); + this.compositeCtx = this.ctx; + this.transparentCanvas = transparentCanvas.canvas; + this.ctx = transparentCanvas.context; + this.ctx.save(); + this.ctx.transform.apply(this.ctx, this.compositeCtx.mozCurrentTransform); + } + + this.ctx.save(); + resetCtxToDefault(this.ctx, this.foregroundColor); + + if (transform) { + this.ctx.transform.apply(this.ctx, transform); + this.outputScaleX = transform[0]; + this.outputScaleY = transform[0]; + } + + this.ctx.transform.apply(this.ctx, viewport.transform); + this.viewportScale = viewport.scale; + this.baseTransform = this.ctx.mozCurrentTransform.slice(); + + if (this.imageLayer) { + this.imageLayer.beginLayout(); + } + } + + executeOperatorList(operatorList, executionStartIdx, continueCallback, stepper) { + const argsArray = operatorList.argsArray; + const fnArray = operatorList.fnArray; + let i = executionStartIdx || 0; + const argsArrayLen = argsArray.length; + + if (argsArrayLen === i) { + return i; + } + + const chunkOperations = argsArrayLen - i > EXECUTION_STEPS && typeof continueCallback === "function"; + const endTime = chunkOperations ? Date.now() + EXECUTION_TIME : 0; + let steps = 0; + const commonObjs = this.commonObjs; + const objs = this.objs; + let fnId; + + while (true) { + if (stepper !== undefined && i === stepper.nextBreakPoint) { + stepper.breakIt(i, continueCallback); + return i; + } + + fnId = fnArray[i]; + + if (fnId !== _util.OPS.dependency) { + this[fnId].apply(this, argsArray[i]); + } else { + for (const depObjId of argsArray[i]) { + const objsPool = depObjId.startsWith("g_") ? commonObjs : objs; + + if (!objsPool.has(depObjId)) { + objsPool.get(depObjId, continueCallback); + return i; + } + } + } + + i++; + + if (i === argsArrayLen) { + return i; + } + + if (chunkOperations && ++steps > EXECUTION_STEPS) { + if (Date.now() > endTime) { + continueCallback(); + return i; + } + + steps = 0; + } + } + } + + endDrawing() { + while (this.stateStack.length || this.inSMaskMode) { + this.restore(); + } + + this.ctx.restore(); + + if (this.transparentCanvas) { + this.ctx = this.compositeCtx; + this.ctx.save(); + this.ctx.setTransform(1, 0, 0, 1, 0, 0); + this.ctx.drawImage(this.transparentCanvas, 0, 0); + this.ctx.restore(); + this.transparentCanvas = null; + } + + this.cachedCanvases.clear(); + this.cachedPatterns.clear(); + + for (const cache of this._cachedBitmapsMap.values()) { + for (const canvas of cache.values()) { + if (typeof HTMLCanvasElement !== "undefined" && canvas instanceof HTMLCanvasElement) { + canvas.width = canvas.height = 0; + } + } + + cache.clear(); + } + + this._cachedBitmapsMap.clear(); + + if (this.imageLayer) { + this.imageLayer.endLayout(); + } + } + + _scaleImage(img, inverseTransform) { + const width = img.width; + const height = img.height; + let widthScale = Math.max(Math.hypot(inverseTransform[0], inverseTransform[1]), 1); + let heightScale = Math.max(Math.hypot(inverseTransform[2], inverseTransform[3]), 1); + let paintWidth = width, + paintHeight = height; + let tmpCanvasId = "prescale1"; + let tmpCanvas, tmpCtx; + + while (widthScale > 2 && paintWidth > 1 || heightScale > 2 && paintHeight > 1) { + let newWidth = paintWidth, + newHeight = paintHeight; + + if (widthScale > 2 && paintWidth > 1) { + newWidth = Math.ceil(paintWidth / 2); + widthScale /= paintWidth / newWidth; + } + + if (heightScale > 2 && paintHeight > 1) { + newHeight = Math.ceil(paintHeight / 2); + heightScale /= paintHeight / newHeight; + } + + tmpCanvas = this.cachedCanvases.getCanvas(tmpCanvasId, newWidth, newHeight, false); + tmpCtx = tmpCanvas.context; + tmpCtx.clearRect(0, 0, newWidth, newHeight); + tmpCtx.drawImage(img, 0, 0, paintWidth, paintHeight, 0, 0, newWidth, newHeight); + img = tmpCanvas.canvas; + paintWidth = newWidth; + paintHeight = newHeight; + tmpCanvasId = tmpCanvasId === "prescale1" ? "prescale2" : "prescale1"; + } + + return { + img, + paintWidth, + paintHeight + }; + } + + _createMaskCanvas(img) { + const ctx = this.ctx; + const { + width, + height + } = img; + const fillColor = this.current.fillColor; + const isPatternFill = this.current.patternFill; + const currentTransform = ctx.mozCurrentTransform; + let cache, cacheKey, scaled, maskCanvas; + + if ((img.bitmap || img.data) && img.count > 1) { + const mainKey = img.bitmap || img.data.buffer; + const withoutTranslation = currentTransform.slice(0, 4); + cacheKey = JSON.stringify(isPatternFill ? withoutTranslation : [withoutTranslation, fillColor]); + cache = this._cachedBitmapsMap.get(mainKey); + + if (!cache) { + cache = new Map(); + + this._cachedBitmapsMap.set(mainKey, cache); + } + + const cachedImage = cache.get(cacheKey); + + if (cachedImage && !isPatternFill) { + const offsetX = Math.round(Math.min(currentTransform[0], currentTransform[2]) + currentTransform[4]); + const offsetY = Math.round(Math.min(currentTransform[1], currentTransform[3]) + currentTransform[5]); + return { + canvas: cachedImage, + offsetX, + offsetY + }; + } + + scaled = cachedImage; + } + + if (!scaled) { + maskCanvas = this.cachedCanvases.getCanvas("maskCanvas", width, height, false); + putBinaryImageMask(maskCanvas.context, img); + } + + let maskToCanvas = _util.Util.transform(currentTransform, [1 / width, 0, 0, -1 / height, 0, 0]); + + maskToCanvas = _util.Util.transform(maskToCanvas, [1, 0, 0, 1, 0, -height]); + + const cord1 = _util.Util.applyTransform([0, 0], maskToCanvas); + + const cord2 = _util.Util.applyTransform([width, height], maskToCanvas); + + const rect = _util.Util.normalizeRect([cord1[0], cord1[1], cord2[0], cord2[1]]); + + const drawnWidth = Math.round(rect[2] - rect[0]) || 1; + const drawnHeight = Math.round(rect[3] - rect[1]) || 1; + const fillCanvas = this.cachedCanvases.getCanvas("fillCanvas", drawnWidth, drawnHeight, true); + const fillCtx = fillCanvas.context; + const offsetX = Math.min(cord1[0], cord2[0]); + const offsetY = Math.min(cord1[1], cord2[1]); + fillCtx.translate(-offsetX, -offsetY); + fillCtx.transform.apply(fillCtx, maskToCanvas); + + if (!scaled) { + scaled = this._scaleImage(maskCanvas.canvas, fillCtx.mozCurrentTransformInverse); + scaled = scaled.img; + + if (cache && isPatternFill) { + cache.set(cacheKey, scaled); + } + } + + fillCtx.imageSmoothingEnabled = getImageSmoothingEnabled(fillCtx.mozCurrentTransform, img.interpolate); + drawImageAtIntegerCoords(fillCtx, scaled, 0, 0, scaled.width, scaled.height, 0, 0, width, height); + fillCtx.globalCompositeOperation = "source-in"; + + const inverse = _util.Util.transform(fillCtx.mozCurrentTransformInverse, [1, 0, 0, 1, -offsetX, -offsetY]); + + fillCtx.fillStyle = isPatternFill ? fillColor.getPattern(ctx, this, inverse, _pattern_helper.PathType.FILL) : fillColor; + fillCtx.fillRect(0, 0, width, height); + + if (cache && !isPatternFill) { + this.cachedCanvases.delete("fillCanvas"); + cache.set(cacheKey, fillCanvas.canvas); + } + + return { + canvas: fillCanvas.canvas, + offsetX: Math.round(offsetX), + offsetY: Math.round(offsetY) + }; + } + + setLineWidth(width) { + if (width !== this.current.lineWidth) { + this._cachedScaleForStroking = null; + } + + this.current.lineWidth = width; + this.ctx.lineWidth = width; + } + + setLineCap(style) { + this.ctx.lineCap = LINE_CAP_STYLES[style]; + } + + setLineJoin(style) { + this.ctx.lineJoin = LINE_JOIN_STYLES[style]; + } + + setMiterLimit(limit) { + this.ctx.miterLimit = limit; + } + + setDash(dashArray, dashPhase) { + const ctx = this.ctx; + + if (ctx.setLineDash !== undefined) { + ctx.setLineDash(dashArray); + ctx.lineDashOffset = dashPhase; + } + } + + setRenderingIntent(intent) {} + + setFlatness(flatness) {} + + setGState(states) { + for (let i = 0, ii = states.length; i < ii; i++) { + const state = states[i]; + const key = state[0]; + const value = state[1]; + + switch (key) { + case "LW": + this.setLineWidth(value); + break; + + case "LC": + this.setLineCap(value); + break; + + case "LJ": + this.setLineJoin(value); + break; + + case "ML": + this.setMiterLimit(value); + break; + + case "D": + this.setDash(value[0], value[1]); + break; + + case "RI": + this.setRenderingIntent(value); + break; + + case "FL": + this.setFlatness(value); + break; + + case "Font": + this.setFont(value[0], value[1]); + break; + + case "CA": + this.current.strokeAlpha = state[1]; + break; + + case "ca": + this.current.fillAlpha = state[1]; + this.ctx.globalAlpha = state[1]; + break; + + case "BM": + this.ctx.globalCompositeOperation = value; + break; + + case "SMask": + this.current.activeSMask = value ? this.tempSMask : null; + this.tempSMask = null; + this.checkSMaskState(); + break; + + case "TR": + this.current.transferMaps = value; + } + } + } + + get inSMaskMode() { + return !!this.suspendedCtx; + } + + checkSMaskState() { + const inSMaskMode = this.inSMaskMode; + + if (this.current.activeSMask && !inSMaskMode) { + this.beginSMaskMode(); + } else if (!this.current.activeSMask && inSMaskMode) { + this.endSMaskMode(); + } + } + + beginSMaskMode() { + if (this.inSMaskMode) { + throw new Error("beginSMaskMode called while already in smask mode"); + } + + const drawnWidth = this.ctx.canvas.width; + const drawnHeight = this.ctx.canvas.height; + const cacheId = "smaskGroupAt" + this.groupLevel; + const scratchCanvas = this.cachedCanvases.getCanvas(cacheId, drawnWidth, drawnHeight, true); + this.suspendedCtx = this.ctx; + this.ctx = scratchCanvas.context; + const ctx = this.ctx; + ctx.setTransform.apply(ctx, this.suspendedCtx.mozCurrentTransform); + copyCtxState(this.suspendedCtx, ctx); + mirrorContextOperations(ctx, 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(); + + copyCtxState(this.ctx, this.suspendedCtx); + this.ctx = this.suspendedCtx; + this.suspendedCtx = null; + } + + compose(dirtyBox) { + if (!this.current.activeSMask) { + return; + } + + if (!dirtyBox) { + dirtyBox = [0, 0, this.ctx.canvas.width, this.ctx.canvas.height]; + } else { + dirtyBox[0] = Math.floor(dirtyBox[0]); + dirtyBox[1] = Math.floor(dirtyBox[1]); + dirtyBox[2] = Math.ceil(dirtyBox[2]); + dirtyBox[3] = Math.ceil(dirtyBox[3]); + } + + const smask = this.current.activeSMask; + const suspendedCtx = this.suspendedCtx; + composeSMask(suspendedCtx, smask, this.ctx, dirtyBox); + 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() { + if (this.inSMaskMode) { + copyCtxState(this.ctx, this.suspendedCtx); + this.suspendedCtx.save(); + } else { + this.ctx.save(); + } + + const old = this.current; + this.stateStack.push(old); + this.current = old.clone(); + } + + restore() { + if (this.stateStack.length === 0 && this.inSMaskMode) { + this.endSMaskMode(); + } + + if (this.stateStack.length !== 0) { + this.current = this.stateStack.pop(); + + if (this.inSMaskMode) { + this.suspendedCtx.restore(); + copyCtxState(this.suspendedCtx, this.ctx); + } else { + this.ctx.restore(); + } + + this.checkSMaskState(); + this.pendingClip = null; + this._cachedScaleForStroking = null; + this._cachedGetSinglePixelWidth = null; + } + } + + transform(a, b, c, d, e, f) { + this.ctx.transform(a, b, c, d, e, f); + this._cachedScaleForStroking = null; + this._cachedGetSinglePixelWidth = null; + } + + constructPath(ops, args, minMax) { + const ctx = this.ctx; + const current = this.current; + let x = current.x, + y = current.y; + let startX, startY; + const currentTransform = ctx.mozCurrentTransform; + const isScalingMatrix = currentTransform[0] === 0 && currentTransform[3] === 0 || currentTransform[1] === 0 && currentTransform[2] === 0; + const minMaxForBezier = isScalingMatrix ? minMax.slice(0) : null; + + for (let i = 0, j = 0, ii = ops.length; i < ii; i++) { + switch (ops[i] | 0) { + case _util.OPS.rectangle: + x = args[j++]; + y = args[j++]; + const width = args[j++]; + const height = args[j++]; + const xw = x + width; + const yh = y + height; + ctx.moveTo(x, y); + + if (width === 0 || height === 0) { + ctx.lineTo(xw, yh); + } else { + ctx.lineTo(xw, y); + ctx.lineTo(xw, yh); + ctx.lineTo(x, yh); + } + + if (!isScalingMatrix) { + current.updateRectMinMax(currentTransform, [x, y, xw, yh]); + } + + ctx.closePath(); + break; + + case _util.OPS.moveTo: + x = args[j++]; + y = args[j++]; + ctx.moveTo(x, y); + + if (!isScalingMatrix) { + current.updatePathMinMax(currentTransform, x, y); + } + + break; + + case _util.OPS.lineTo: + x = args[j++]; + y = args[j++]; + ctx.lineTo(x, y); + + if (!isScalingMatrix) { + current.updatePathMinMax(currentTransform, x, y); + } + + break; + + case _util.OPS.curveTo: + startX = x; + startY = y; + x = args[j + 4]; + y = args[j + 5]; + ctx.bezierCurveTo(args[j], args[j + 1], args[j + 2], args[j + 3], x, y); + current.updateCurvePathMinMax(currentTransform, startX, startY, args[j], args[j + 1], args[j + 2], args[j + 3], x, y, minMaxForBezier); + j += 6; + break; + + case _util.OPS.curveTo2: + startX = x; + startY = y; + ctx.bezierCurveTo(x, y, args[j], args[j + 1], args[j + 2], args[j + 3]); + current.updateCurvePathMinMax(currentTransform, startX, startY, x, y, args[j], args[j + 1], args[j + 2], args[j + 3], minMaxForBezier); + x = args[j + 2]; + y = args[j + 3]; + j += 4; + break; + + case _util.OPS.curveTo3: + startX = x; + startY = y; + x = args[j + 2]; + y = args[j + 3]; + ctx.bezierCurveTo(args[j], args[j + 1], x, y, x, y); + current.updateCurvePathMinMax(currentTransform, startX, startY, args[j], args[j + 1], x, y, x, y, minMaxForBezier); + j += 4; + break; + + case _util.OPS.closePath: + ctx.closePath(); + break; + } + } + + if (isScalingMatrix) { + current.updateScalingPathMinMax(currentTransform, minMaxForBezier); + } + + current.setCurrentPoint(x, y); + } + + closePath() { + this.ctx.closePath(); + } + + stroke(consumePath) { + consumePath = typeof consumePath !== "undefined" ? consumePath : true; + const ctx = this.ctx; + const strokeColor = this.current.strokeColor; + ctx.globalAlpha = this.current.strokeAlpha; + + if (this.contentVisible) { + if (typeof strokeColor === "object" && strokeColor?.getPattern) { + ctx.save(); + ctx.strokeStyle = strokeColor.getPattern(ctx, this, ctx.mozCurrentTransformInverse, _pattern_helper.PathType.STROKE); + this.rescaleAndStroke(false); + ctx.restore(); + } else { + this.rescaleAndStroke(true); + } + } + + if (consumePath) { + this.consumePath(this.current.getClippedPathBoundingBox()); + } + + ctx.globalAlpha = this.current.fillAlpha; + } + + closeStroke() { + this.closePath(); + this.stroke(); + } + + fill(consumePath) { + consumePath = typeof consumePath !== "undefined" ? consumePath : true; + const ctx = this.ctx; + const fillColor = this.current.fillColor; + const isPatternFill = this.current.patternFill; + let needRestore = false; + + if (isPatternFill) { + ctx.save(); + ctx.fillStyle = fillColor.getPattern(ctx, this, ctx.mozCurrentTransformInverse, _pattern_helper.PathType.FILL); + needRestore = true; + } + + const intersect = this.current.getClippedPathBoundingBox(); + + if (this.contentVisible && intersect !== null) { + if (this.pendingEOFill) { + ctx.fill("evenodd"); + this.pendingEOFill = false; + } else { + ctx.fill(); + } + } + + if (needRestore) { + ctx.restore(); + } + + if (consumePath) { + this.consumePath(intersect); + } + } + + eoFill() { + this.pendingEOFill = true; + this.fill(); + } + + fillStroke() { + this.fill(false); + this.stroke(false); + this.consumePath(); + } + + eoFillStroke() { + this.pendingEOFill = true; + this.fillStroke(); + } + + closeFillStroke() { + this.closePath(); + this.fillStroke(); + } + + closeEOFillStroke() { + this.pendingEOFill = true; + this.closePath(); + this.fillStroke(); + } + + endPath() { + this.consumePath(); + } + + clip() { + this.pendingClip = NORMAL_CLIP; + } + + eoClip() { + this.pendingClip = EO_CLIP; + } + + beginText() { + this.current.textMatrix = _util.IDENTITY_MATRIX; + this.current.textMatrixScale = 1; + this.current.x = this.current.lineX = 0; + this.current.y = this.current.lineY = 0; + } + + endText() { + const paths = this.pendingTextPaths; + const ctx = this.ctx; + + if (paths === undefined) { + ctx.beginPath(); + return; + } + + ctx.save(); + ctx.beginPath(); + + for (let i = 0; i < paths.length; i++) { + const path = paths[i]; + ctx.setTransform.apply(ctx, path.transform); + ctx.translate(path.x, path.y); + path.addToPath(ctx, path.fontSize); + } + + ctx.restore(); + ctx.clip(); + ctx.beginPath(); + delete this.pendingTextPaths; + } + + setCharSpacing(spacing) { + this.current.charSpacing = spacing; + } + + setWordSpacing(spacing) { + this.current.wordSpacing = spacing; + } + + setHScale(scale) { + this.current.textHScale = scale / 100; + } + + setLeading(leading) { + this.current.leading = -leading; + } + + setFont(fontRefName, size) { + const fontObj = this.commonObjs.get(fontRefName); + const current = this.current; + + if (!fontObj) { + throw new Error(`Can't find font for ${fontRefName}`); + } + + current.fontMatrix = fontObj.fontMatrix || _util.FONT_IDENTITY_MATRIX; + + if (current.fontMatrix[0] === 0 || current.fontMatrix[3] === 0) { + (0, _util.warn)("Invalid font matrix for font " + fontRefName); + } + + if (size < 0) { + size = -size; + current.fontDirection = -1; + } else { + current.fontDirection = 1; + } + + this.current.font = fontObj; + this.current.fontSize = size; + + if (fontObj.isType3Font) { + return; + } + + const name = fontObj.loadedName || "sans-serif"; + let bold = "normal"; + + if (fontObj.black) { + bold = "900"; + } else if (fontObj.bold) { + bold = "bold"; + } + + const italic = fontObj.italic ? "italic" : "normal"; + const typeface = `"${name}", ${fontObj.fallbackName}`; + let browserFontSize = size; + + if (size < MIN_FONT_SIZE) { + browserFontSize = MIN_FONT_SIZE; + } else if (size > MAX_FONT_SIZE) { + browserFontSize = MAX_FONT_SIZE; + } + + this.current.fontSizeScale = size / browserFontSize; + this.ctx.font = `${italic} ${bold} ${browserFontSize}px ${typeface}`; + } + + setTextRenderingMode(mode) { + this.current.textRenderingMode = mode; + } + + setTextRise(rise) { + this.current.textRise = rise; + } + + moveText(x, y) { + this.current.x = this.current.lineX += x; + this.current.y = this.current.lineY += y; + } + + setLeadingMoveText(x, y) { + this.setLeading(-y); + this.moveText(x, y); + } + + setTextMatrix(a, b, c, d, e, f) { + this.current.textMatrix = [a, b, c, d, e, f]; + this.current.textMatrixScale = Math.hypot(a, b); + this.current.x = this.current.lineX = 0; + this.current.y = this.current.lineY = 0; + } + + nextLine() { + this.moveText(0, this.current.leading); + } + + paintChar(character, x, y, patternTransform) { + const ctx = this.ctx; + const current = this.current; + const font = current.font; + const textRenderingMode = current.textRenderingMode; + const fontSize = current.fontSize / current.fontSizeScale; + const fillStrokeMode = textRenderingMode & _util.TextRenderingMode.FILL_STROKE_MASK; + const isAddToPathSet = !!(textRenderingMode & _util.TextRenderingMode.ADD_TO_PATH_FLAG); + const patternFill = current.patternFill && !font.missingFile; + let addToPath; + + if (font.disableFontFace || isAddToPathSet || patternFill) { + addToPath = font.getPathGenerator(this.commonObjs, character); + } + + if (font.disableFontFace || patternFill) { + ctx.save(); + ctx.translate(x, y); + ctx.beginPath(); + addToPath(ctx, fontSize); + + if (patternTransform) { + ctx.setTransform.apply(ctx, patternTransform); + } + + if (fillStrokeMode === _util.TextRenderingMode.FILL || fillStrokeMode === _util.TextRenderingMode.FILL_STROKE) { + ctx.fill(); + } + + if (fillStrokeMode === _util.TextRenderingMode.STROKE || fillStrokeMode === _util.TextRenderingMode.FILL_STROKE) { + ctx.stroke(); + } + + ctx.restore(); + } else { + if (fillStrokeMode === _util.TextRenderingMode.FILL || fillStrokeMode === _util.TextRenderingMode.FILL_STROKE) { + ctx.fillText(character, x, y); + } + + if (fillStrokeMode === _util.TextRenderingMode.STROKE || fillStrokeMode === _util.TextRenderingMode.FILL_STROKE) { + ctx.strokeText(character, x, y); + } + } + + if (isAddToPathSet) { + const paths = this.pendingTextPaths || (this.pendingTextPaths = []); + paths.push({ + transform: ctx.mozCurrentTransform, + x, + y, + fontSize, + addToPath + }); + } + } + + get isFontSubpixelAAEnabled() { + const { + context: ctx + } = this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled", 10, 10, false); + ctx.scale(1.5, 1); + ctx.fillText("I", 0, 10); + const data = ctx.getImageData(0, 0, 10, 10).data; + let enabled = false; + + for (let i = 3; i < data.length; i += 4) { + if (data[i] > 0 && data[i] < 255) { + enabled = true; + break; + } + } + + return (0, _util.shadow)(this, "isFontSubpixelAAEnabled", enabled); + } + + showText(glyphs) { + const current = this.current; + const font = current.font; + + if (font.isType3Font) { + return this.showType3Text(glyphs); + } + + const fontSize = current.fontSize; + + if (fontSize === 0) { + return undefined; + } + + const ctx = this.ctx; + const fontSizeScale = current.fontSizeScale; + const charSpacing = current.charSpacing; + const wordSpacing = current.wordSpacing; + const fontDirection = current.fontDirection; + const textHScale = current.textHScale * fontDirection; + const glyphsLength = glyphs.length; + const vertical = font.vertical; + const spacingDir = vertical ? 1 : -1; + const defaultVMetrics = font.defaultVMetrics; + const widthAdvanceScale = fontSize * current.fontMatrix[0]; + const simpleFillText = current.textRenderingMode === _util.TextRenderingMode.FILL && !font.disableFontFace && !current.patternFill; + ctx.save(); + ctx.transform.apply(ctx, current.textMatrix); + ctx.translate(current.x, current.y + current.textRise); + + if (fontDirection > 0) { + ctx.scale(textHScale, -1); + } else { + ctx.scale(textHScale, 1); + } + + let patternTransform; + + if (current.patternFill) { + ctx.save(); + const pattern = current.fillColor.getPattern(ctx, this, ctx.mozCurrentTransformInverse, _pattern_helper.PathType.FILL); + patternTransform = ctx.mozCurrentTransform; + ctx.restore(); + ctx.fillStyle = pattern; + } + + let lineWidth = current.lineWidth; + const scale = current.textMatrixScale; + + if (scale === 0 || lineWidth === 0) { + const fillStrokeMode = current.textRenderingMode & _util.TextRenderingMode.FILL_STROKE_MASK; + + if (fillStrokeMode === _util.TextRenderingMode.STROKE || fillStrokeMode === _util.TextRenderingMode.FILL_STROKE) { + lineWidth = this.getSinglePixelWidth(); + } + } else { + lineWidth /= scale; + } + + if (fontSizeScale !== 1.0) { + ctx.scale(fontSizeScale, fontSizeScale); + lineWidth /= fontSizeScale; + } + + ctx.lineWidth = lineWidth; + let x = 0, + i; + + for (i = 0; i < glyphsLength; ++i) { + const glyph = glyphs[i]; + + if (typeof glyph === "number") { + x += spacingDir * glyph * fontSize / 1000; + continue; + } + + let restoreNeeded = false; + const spacing = (glyph.isSpace ? wordSpacing : 0) + charSpacing; + const character = glyph.fontChar; + const accent = glyph.accent; + let scaledX, scaledY; + let width = glyph.width; + + if (vertical) { + const vmetric = glyph.vmetric || defaultVMetrics; + const vx = -(glyph.vmetric ? vmetric[1] : width * 0.5) * widthAdvanceScale; + const vy = vmetric[2] * widthAdvanceScale; + width = vmetric ? -vmetric[0] : width; + scaledX = vx / fontSizeScale; + scaledY = (x + vy) / fontSizeScale; + } else { + scaledX = x / fontSizeScale; + scaledY = 0; + } + + if (font.remeasure && width > 0) { + const measuredWidth = ctx.measureText(character).width * 1000 / fontSize * fontSizeScale; + + if (width < measuredWidth && this.isFontSubpixelAAEnabled) { + const characterScaleX = width / measuredWidth; + restoreNeeded = true; + ctx.save(); + ctx.scale(characterScaleX, 1); + scaledX /= characterScaleX; + } else if (width !== measuredWidth) { + scaledX += (width - measuredWidth) / 2000 * fontSize / fontSizeScale; + } + } + + if (this.contentVisible && (glyph.isInFont || font.missingFile)) { + if (simpleFillText && !accent) { + ctx.fillText(character, scaledX, scaledY); + } else { + this.paintChar(character, scaledX, scaledY, patternTransform); + + if (accent) { + const scaledAccentX = scaledX + fontSize * accent.offset.x / fontSizeScale; + const scaledAccentY = scaledY - fontSize * accent.offset.y / fontSizeScale; + this.paintChar(accent.fontChar, scaledAccentX, scaledAccentY, patternTransform); + } + } + } + + let charWidth; + + if (vertical) { + charWidth = width * widthAdvanceScale - spacing * fontDirection; + } else { + charWidth = width * widthAdvanceScale + spacing * fontDirection; + } + + x += charWidth; + + if (restoreNeeded) { + ctx.restore(); + } + } + + if (vertical) { + current.y -= x; + } else { + current.x += x * textHScale; + } + + ctx.restore(); + this.compose(); + return undefined; + } + + showType3Text(glyphs) { + const ctx = this.ctx; + const current = this.current; + const font = current.font; + const fontSize = current.fontSize; + const fontDirection = current.fontDirection; + const spacingDir = font.vertical ? 1 : -1; + const charSpacing = current.charSpacing; + const wordSpacing = current.wordSpacing; + const textHScale = current.textHScale * fontDirection; + const fontMatrix = current.fontMatrix || _util.FONT_IDENTITY_MATRIX; + const glyphsLength = glyphs.length; + const isTextInvisible = current.textRenderingMode === _util.TextRenderingMode.INVISIBLE; + let i, glyph, width, spacingLength; + + if (isTextInvisible || fontSize === 0) { + return; + } + + this._cachedScaleForStroking = null; + this._cachedGetSinglePixelWidth = null; + ctx.save(); + ctx.transform.apply(ctx, current.textMatrix); + ctx.translate(current.x, current.y); + ctx.scale(textHScale, fontDirection); + + for (i = 0; i < glyphsLength; ++i) { + glyph = glyphs[i]; + + if (typeof glyph === "number") { + spacingLength = spacingDir * glyph * fontSize / 1000; + this.ctx.translate(spacingLength, 0); + current.x += spacingLength * textHScale; + continue; + } + + const spacing = (glyph.isSpace ? wordSpacing : 0) + charSpacing; + const operatorList = font.charProcOperatorList[glyph.operatorListId]; + + if (!operatorList) { + (0, _util.warn)(`Type3 character "${glyph.operatorListId}" is not available.`); + continue; + } + + if (this.contentVisible) { + this.processingType3 = glyph; + this.save(); + ctx.scale(fontSize, fontSize); + ctx.transform.apply(ctx, fontMatrix); + this.executeOperatorList(operatorList); + this.restore(); + } + + const transformed = _util.Util.applyTransform([glyph.width, 0], fontMatrix); + + width = transformed[0] * fontSize + spacing; + ctx.translate(width, 0); + current.x += width * textHScale; + } + + ctx.restore(); + this.processingType3 = null; + } + + setCharWidth(xWidth, yWidth) {} + + setCharWidthAndBounds(xWidth, yWidth, llx, lly, urx, ury) { + this.ctx.rect(llx, lly, urx - llx, ury - lly); + this.ctx.clip(); + this.endPath(); + } + + getColorN_Pattern(IR) { + let pattern; + + if (IR[0] === "TilingPattern") { + const color = IR[1]; + const baseTransform = this.baseTransform || this.ctx.mozCurrentTransform.slice(); + const canvasGraphicsFactory = { + createCanvasGraphics: ctx => { + return new CanvasGraphics(ctx, this.commonObjs, this.objs, this.canvasFactory); + } + }; + pattern = new _pattern_helper.TilingPattern(IR, color, this.ctx, canvasGraphicsFactory, baseTransform); + } else { + pattern = this._getPattern(IR[1], IR[2]); + } + + return pattern; + } + + setStrokeColorN() { + this.current.strokeColor = this.getColorN_Pattern(arguments); + } + + setFillColorN() { + this.current.fillColor = this.getColorN_Pattern(arguments); + this.current.patternFill = true; + } + + setStrokeRGBColor(r, g, b) { + const color = this.selectColor?.(r, g, b) || _util.Util.makeHexColor(r, g, b); + + this.ctx.strokeStyle = color; + this.current.strokeColor = color; + } + + setFillRGBColor(r, g, b) { + const color = this.selectColor?.(r, g, b) || _util.Util.makeHexColor(r, g, b); + + this.ctx.fillStyle = color; + this.current.fillColor = color; + this.current.patternFill = false; + } + + _getPattern(objId, matrix = null) { + let pattern; + + if (this.cachedPatterns.has(objId)) { + pattern = this.cachedPatterns.get(objId); + } else { + pattern = (0, _pattern_helper.getShadingPattern)(this.objs.get(objId)); + this.cachedPatterns.set(objId, pattern); + } + + if (matrix) { + pattern.matrix = matrix; + } + + return pattern; + } + + shadingFill(objId) { + if (!this.contentVisible) { + return; + } + + const ctx = this.ctx; + this.save(); + + const pattern = this._getPattern(objId); + + ctx.fillStyle = pattern.getPattern(ctx, this, ctx.mozCurrentTransformInverse, _pattern_helper.PathType.SHADING); + const inv = ctx.mozCurrentTransformInverse; + + if (inv) { + const canvas = ctx.canvas; + const width = canvas.width; + const height = canvas.height; + + const bl = _util.Util.applyTransform([0, 0], inv); + + const br = _util.Util.applyTransform([0, height], inv); + + const ul = _util.Util.applyTransform([width, 0], inv); + + const ur = _util.Util.applyTransform([width, height], inv); + + const x0 = Math.min(bl[0], br[0], ul[0], ur[0]); + const y0 = Math.min(bl[1], br[1], ul[1], ur[1]); + const x1 = Math.max(bl[0], br[0], ul[0], ur[0]); + const y1 = Math.max(bl[1], br[1], ul[1], ur[1]); + this.ctx.fillRect(x0, y0, x1 - x0, y1 - y0); + } else { + this.ctx.fillRect(-1e10, -1e10, 2e10, 2e10); + } + + this.compose(this.current.getClippedPathBoundingBox()); + this.restore(); + } + + beginInlineImage() { + (0, _util.unreachable)("Should not call beginInlineImage"); + } + + beginImageData() { + (0, _util.unreachable)("Should not call beginImageData"); + } + + paintFormXObjectBegin(matrix, bbox) { + if (!this.contentVisible) { + return; + } + + this.save(); + this.baseTransformStack.push(this.baseTransform); + + if (Array.isArray(matrix) && matrix.length === 6) { + this.transform.apply(this, matrix); + } + + this.baseTransform = this.ctx.mozCurrentTransform; + + if (bbox) { + const width = bbox[2] - bbox[0]; + const height = bbox[3] - bbox[1]; + this.ctx.rect(bbox[0], bbox[1], width, height); + this.current.updateRectMinMax(this.ctx.mozCurrentTransform, bbox); + this.clip(); + this.endPath(); + } + } + + paintFormXObjectEnd() { + if (!this.contentVisible) { + return; + } + + this.restore(); + this.baseTransform = this.baseTransformStack.pop(); + } + + beginGroup(group) { + if (!this.contentVisible) { + return; + } + + this.save(); + + if (this.inSMaskMode) { + this.endSMaskMode(); + this.current.activeSMask = null; + } + + const currentCtx = this.ctx; + + if (!group.isolated) { + (0, _util.info)("TODO: Support non-isolated groups."); + } + + if (group.knockout) { + (0, _util.warn)("Knockout groups not supported."); + } + + const currentTransform = currentCtx.mozCurrentTransform; + + if (group.matrix) { + currentCtx.transform.apply(currentCtx, group.matrix); + } + + if (!group.bbox) { + throw new Error("Bounding box is required."); + } + + let bounds = _util.Util.getAxialAlignedBoundingBox(group.bbox, currentCtx.mozCurrentTransform); + + const canvasBounds = [0, 0, currentCtx.canvas.width, currentCtx.canvas.height]; + bounds = _util.Util.intersect(bounds, canvasBounds) || [0, 0, 0, 0]; + const offsetX = Math.floor(bounds[0]); + const offsetY = Math.floor(bounds[1]); + let drawnWidth = Math.max(Math.ceil(bounds[2]) - offsetX, 1); + let drawnHeight = Math.max(Math.ceil(bounds[3]) - offsetY, 1); + let scaleX = 1, + scaleY = 1; + + if (drawnWidth > MAX_GROUP_SIZE) { + scaleX = drawnWidth / MAX_GROUP_SIZE; + drawnWidth = MAX_GROUP_SIZE; + } + + if (drawnHeight > MAX_GROUP_SIZE) { + scaleY = drawnHeight / MAX_GROUP_SIZE; + drawnHeight = MAX_GROUP_SIZE; + } + + this.current.startNewPathAndClipBox([0, 0, drawnWidth, drawnHeight]); + let cacheId = "groupAt" + this.groupLevel; + + if (group.smask) { + cacheId += "_smask_" + this.smaskCounter++ % 2; + } + + const scratchCanvas = this.cachedCanvases.getCanvas(cacheId, drawnWidth, drawnHeight, true); + const groupCtx = scratchCanvas.context; + groupCtx.scale(1 / scaleX, 1 / scaleY); + groupCtx.translate(-offsetX, -offsetY); + groupCtx.transform.apply(groupCtx, currentTransform); + + if (group.smask) { + this.smaskStack.push({ + canvas: scratchCanvas.canvas, + context: groupCtx, + offsetX, + offsetY, + scaleX, + scaleY, + subtype: group.smask.subtype, + backdrop: group.smask.backdrop, + transferMap: group.smask.transferMap || null, + startTransformInverse: null + }); + } else { + currentCtx.setTransform(1, 0, 0, 1, 0, 0); + currentCtx.translate(offsetX, offsetY); + currentCtx.scale(scaleX, scaleY); + currentCtx.save(); + } + + copyCtxState(currentCtx, groupCtx); + this.ctx = groupCtx; + this.setGState([["BM", "source-over"], ["ca", 1], ["CA", 1]]); + this.groupStack.push(currentCtx); + this.groupLevel++; + } + + endGroup(group) { + if (!this.contentVisible) { + return; + } + + this.groupLevel--; + const groupCtx = this.ctx; + const ctx = this.groupStack.pop(); + this.ctx = ctx; + this.ctx.imageSmoothingEnabled = false; + + if (group.smask) { + this.tempSMask = this.smaskStack.pop(); + this.restore(); + } else { + this.ctx.restore(); + const currentMtx = this.ctx.mozCurrentTransform; + this.restore(); + this.ctx.save(); + this.ctx.setTransform.apply(this.ctx, currentMtx); + + const dirtyBox = _util.Util.getAxialAlignedBoundingBox([0, 0, groupCtx.canvas.width, groupCtx.canvas.height], currentMtx); + + this.ctx.drawImage(groupCtx.canvas, 0, 0); + this.ctx.restore(); + this.compose(dirtyBox); + } + } + + beginAnnotations() { + this.save(); + + if (this.baseTransform) { + this.ctx.setTransform.apply(this.ctx, this.baseTransform); + } + } + + endAnnotations() { + this.restore(); + } + + beginAnnotation(id, rect, transform, matrix, hasOwnCanvas) { + this.save(); + + if (Array.isArray(rect) && rect.length === 4) { + const width = rect[2] - rect[0]; + const height = rect[3] - rect[1]; + + if (hasOwnCanvas && this.annotationCanvasMap) { + transform = transform.slice(); + transform[4] -= rect[0]; + transform[5] -= rect[1]; + rect = rect.slice(); + rect[0] = rect[1] = 0; + rect[2] = width; + rect[3] = height; + + const [scaleX, scaleY] = _util.Util.singularValueDecompose2dScale(this.ctx.mozCurrentTransform); + + const { + viewportScale + } = this; + const canvasWidth = Math.ceil(width * this.outputScaleX * viewportScale); + const canvasHeight = Math.ceil(height * this.outputScaleY * viewportScale); + this.annotationCanvas = this.canvasFactory.create(canvasWidth, canvasHeight); + const { + canvas, + context + } = this.annotationCanvas; + const viewportScaleFactorStr = `var(--zoom-factor) * ${_display_utils.PixelsPerInch.PDF_TO_CSS_UNITS}`; + canvas.style.width = `calc(${width}px * ${viewportScaleFactorStr})`; + canvas.style.height = `calc(${height}px * ${viewportScaleFactorStr})`; + this.annotationCanvasMap.set(id, canvas); + this.annotationCanvas.savedCtx = this.ctx; + this.ctx = context; + this.ctx.setTransform(scaleX, 0, 0, -scaleY, 0, height * scaleY); + addContextCurrentTransform(this.ctx); + resetCtxToDefault(this.ctx, this.foregroundColor); + } else { + resetCtxToDefault(this.ctx, this.foregroundColor); + this.ctx.rect(rect[0], rect[1], width, height); + this.ctx.clip(); + this.endPath(); + } + } + + this.current = new CanvasExtraState(this.ctx.canvas.width, this.ctx.canvas.height); + this.transform.apply(this, transform); + this.transform.apply(this, matrix); + } + + endAnnotation() { + if (this.annotationCanvas) { + this.ctx = this.annotationCanvas.savedCtx; + delete this.annotationCanvas.savedCtx; + delete this.annotationCanvas; + } + + this.restore(); + } + + paintImageMaskXObject(img) { + if (!this.contentVisible) { + return; + } + + const count = img.count; + img = this.getObject(img.data, img); + img.count = count; + const ctx = this.ctx; + const glyph = this.processingType3; + + if (glyph) { + if (glyph.compiled === undefined) { + glyph.compiled = compileType3Glyph(img); + } + + if (glyph.compiled) { + glyph.compiled(ctx); + return; + } + } + + const mask = this._createMaskCanvas(img); + + const maskCanvas = mask.canvas; + ctx.save(); + ctx.setTransform(1, 0, 0, 1, 0, 0); + ctx.drawImage(maskCanvas, mask.offsetX, mask.offsetY); + ctx.restore(); + this.compose(); + } + + paintImageMaskXObjectRepeat(img, scaleX, skewX = 0, skewY = 0, scaleY, positions) { + if (!this.contentVisible) { + return; + } + + img = this.getObject(img.data, img); + const ctx = this.ctx; + ctx.save(); + const currentTransform = ctx.mozCurrentTransform; + ctx.transform(scaleX, skewX, skewY, scaleY, 0, 0); + + const mask = this._createMaskCanvas(img); + + ctx.setTransform(1, 0, 0, 1, 0, 0); + + for (let i = 0, ii = positions.length; i < ii; i += 2) { + const trans = _util.Util.transform(currentTransform, [scaleX, skewX, skewY, scaleY, positions[i], positions[i + 1]]); + + const [x, y] = _util.Util.applyTransform([0, 0], trans); + + ctx.drawImage(mask.canvas, x, y); + } + + ctx.restore(); + this.compose(); + } + + paintImageMaskXObjectGroup(images) { + if (!this.contentVisible) { + return; + } + + const ctx = this.ctx; + const fillColor = this.current.fillColor; + const isPatternFill = this.current.patternFill; + + for (let i = 0, ii = images.length; i < ii; i++) { + const image = images[i]; + const width = image.width, + height = image.height; + const maskCanvas = this.cachedCanvases.getCanvas("maskCanvas", width, height, false); + const maskCtx = maskCanvas.context; + maskCtx.save(); + putBinaryImageMask(maskCtx, image); + maskCtx.globalCompositeOperation = "source-in"; + maskCtx.fillStyle = isPatternFill ? fillColor.getPattern(maskCtx, this, ctx.mozCurrentTransformInverse, _pattern_helper.PathType.FILL) : fillColor; + maskCtx.fillRect(0, 0, width, height); + maskCtx.restore(); + ctx.save(); + ctx.transform.apply(ctx, image.transform); + ctx.scale(1, -1); + drawImageAtIntegerCoords(ctx, maskCanvas.canvas, 0, 0, width, height, 0, -1, 1, 1); + ctx.restore(); + } + + this.compose(); + } + + paintImageXObject(objId) { + if (!this.contentVisible) { + return; + } + + const imgData = this.getObject(objId); + + if (!imgData) { + (0, _util.warn)("Dependent image isn't ready yet"); + return; + } + + this.paintInlineImageXObject(imgData); + } + + paintImageXObjectRepeat(objId, scaleX, scaleY, positions) { + if (!this.contentVisible) { + return; + } + + const imgData = this.getObject(objId); + + if (!imgData) { + (0, _util.warn)("Dependent image isn't ready yet"); + return; + } + + const width = imgData.width; + const height = imgData.height; + const map = []; + + for (let i = 0, ii = positions.length; i < ii; i += 2) { + map.push({ + transform: [scaleX, 0, 0, scaleY, positions[i], positions[i + 1]], + x: 0, + y: 0, + w: width, + h: height + }); + } + + this.paintInlineImageXObjectGroup(imgData, map); + } + + paintInlineImageXObject(imgData) { + if (!this.contentVisible) { + return; + } + + const width = imgData.width; + const height = imgData.height; + const ctx = this.ctx; + this.save(); + ctx.scale(1 / width, -1 / height); + let imgToPaint; + + if (typeof HTMLElement === "function" && imgData instanceof HTMLElement || !imgData.data) { + imgToPaint = imgData; + } else { + const tmpCanvas = this.cachedCanvases.getCanvas("inlineImage", width, height, false); + const tmpCtx = tmpCanvas.context; + putBinaryImageData(tmpCtx, imgData, this.current.transferMaps); + imgToPaint = tmpCanvas.canvas; + } + + const scaled = this._scaleImage(imgToPaint, ctx.mozCurrentTransformInverse); + + ctx.imageSmoothingEnabled = getImageSmoothingEnabled(ctx.mozCurrentTransform, imgData.interpolate); + const [rWidth, rHeight] = drawImageAtIntegerCoords(ctx, scaled.img, 0, 0, scaled.paintWidth, scaled.paintHeight, 0, -height, width, height); + + if (this.imageLayer) { + const position = this.getCanvasPosition(0, -height); + this.imageLayer.appendImage({ + imgData, + left: position[0], + top: position[1], + width: rWidth, + height: rHeight + }); + } + + this.compose(); + this.restore(); + } + + paintInlineImageXObjectGroup(imgData, map) { + if (!this.contentVisible) { + return; + } + + const ctx = this.ctx; + const w = imgData.width; + const h = imgData.height; + const tmpCanvas = this.cachedCanvases.getCanvas("inlineImage", w, h, false); + const tmpCtx = tmpCanvas.context; + putBinaryImageData(tmpCtx, imgData, this.current.transferMaps); + + for (let i = 0, ii = map.length; i < ii; i++) { + const entry = map[i]; + ctx.save(); + ctx.transform.apply(ctx, entry.transform); + ctx.scale(1, -1); + drawImageAtIntegerCoords(ctx, tmpCanvas.canvas, entry.x, entry.y, entry.w, entry.h, 0, -1, 1, 1); + + if (this.imageLayer) { + const position = this.getCanvasPosition(entry.x, entry.y); + this.imageLayer.appendImage({ + imgData, + left: position[0], + top: position[1], + width: w, + height: h + }); + } + + ctx.restore(); + } + + this.compose(); + } + + paintSolidColorImageMask() { + if (!this.contentVisible) { + return; + } + + this.ctx.fillRect(0, 0, 1, 1); + this.compose(); + } + + markPoint(tag) {} + + markPointProps(tag, properties) {} + + beginMarkedContent(tag) { + this.markedContentStack.push({ + visible: true + }); + } + + beginMarkedContentProps(tag, properties) { + if (tag === "OC") { + this.markedContentStack.push({ + visible: this.optionalContentConfig.isVisible(properties) + }); + } else { + this.markedContentStack.push({ + visible: true + }); + } + + this.contentVisible = this.isContentVisible(); + } + + endMarkedContent() { + this.markedContentStack.pop(); + this.contentVisible = this.isContentVisible(); + } + + beginCompat() {} + + endCompat() {} + + consumePath(clipBox) { + const isEmpty = this.current.isEmptyClip(); + + if (this.pendingClip) { + this.current.updateClipFromPath(); + } + + if (!this.pendingClip) { + this.compose(clipBox); + } + + const ctx = this.ctx; + + if (this.pendingClip) { + if (!isEmpty) { + if (this.pendingClip === EO_CLIP) { + ctx.clip("evenodd"); + } else { + ctx.clip(); + } + } + + this.pendingClip = null; + } + + this.current.startNewPathAndClipBox(this.current.clipBox); + ctx.beginPath(); + } + + getSinglePixelWidth() { + if (!this._cachedGetSinglePixelWidth) { + const m = this.ctx.mozCurrentTransform; + + if (m[1] === 0 && m[2] === 0) { + this._cachedGetSinglePixelWidth = 1 / Math.min(Math.abs(m[0]), Math.abs(m[3])); + } else { + const absDet = Math.abs(m[0] * m[3] - m[2] * m[1]); + const normX = Math.hypot(m[0], m[2]); + const normY = Math.hypot(m[1], m[3]); + this._cachedGetSinglePixelWidth = Math.max(normX, normY) / absDet; + } + } + + return this._cachedGetSinglePixelWidth; + } + + getScaleForStroking() { + if (!this._cachedScaleForStroking) { + const { + lineWidth + } = this.current; + const m = this.ctx.mozCurrentTransform; + let scaleX, scaleY; + + if (m[1] === 0 && m[2] === 0) { + const normX = Math.abs(m[0]); + const normY = Math.abs(m[3]); + + if (lineWidth === 0) { + scaleX = 1 / normX; + scaleY = 1 / normY; + } else { + const scaledXLineWidth = normX * lineWidth; + const scaledYLineWidth = normY * lineWidth; + scaleX = scaledXLineWidth < 1 ? 1 / scaledXLineWidth : 1; + scaleY = scaledYLineWidth < 1 ? 1 / scaledYLineWidth : 1; + } + } else { + const absDet = Math.abs(m[0] * m[3] - m[2] * m[1]); + const normX = Math.hypot(m[0], m[1]); + const normY = Math.hypot(m[2], m[3]); + + if (lineWidth === 0) { + scaleX = normY / absDet; + scaleY = normX / absDet; + } else { + const baseArea = lineWidth * absDet; + scaleX = normY > baseArea ? normY / baseArea : 1; + scaleY = normX > baseArea ? normX / baseArea : 1; + } + } + + this._cachedScaleForStroking = [scaleX, scaleY]; + } + + return this._cachedScaleForStroking; + } + + rescaleAndStroke(saveRestore) { + const { + ctx + } = this; + const { + lineWidth + } = this.current; + const [scaleX, scaleY] = this.getScaleForStroking(); + ctx.lineWidth = lineWidth || 1; + + if (scaleX === 1 && scaleY === 1) { + ctx.stroke(); + return; + } + + let savedMatrix, savedDashes, savedDashOffset; + + if (saveRestore) { + savedMatrix = ctx.mozCurrentTransform.slice(); + savedDashes = ctx.getLineDash().slice(); + savedDashOffset = ctx.lineDashOffset; + } + + ctx.scale(scaleX, scaleY); + const scale = Math.max(scaleX, scaleY); + ctx.setLineDash(ctx.getLineDash().map(x => x / scale)); + ctx.lineDashOffset /= scale; + ctx.stroke(); + + if (saveRestore) { + ctx.setTransform(...savedMatrix); + ctx.setLineDash(savedDashes); + ctx.lineDashOffset = savedDashOffset; + } + } + + getCanvasPosition(x, y) { + const transform = this.ctx.mozCurrentTransform; + return [transform[0] * x + transform[2] * y + transform[4], transform[1] * x + transform[3] * y + transform[5]]; + } + + isContentVisible() { + for (let i = this.markedContentStack.length - 1; i >= 0; i--) { + if (!this.markedContentStack[i].visible) { + return false; + } + } + + return true; + } + +} + +exports.CanvasGraphics = CanvasGraphics; + +for (const op in _util.OPS) { + if (CanvasGraphics.prototype[op] !== undefined) { + CanvasGraphics.prototype[_util.OPS[op]] = CanvasGraphics.prototype[op]; + } +} + +/***/ }), +/* 11 */ +/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.TilingPattern = exports.PathType = void 0; +exports.getShadingPattern = getShadingPattern; + +var _util = __w_pdfjs_require__(1); + +var _is_node = __w_pdfjs_require__(3); + +const PathType = { + FILL: "Fill", + STROKE: "Stroke", + SHADING: "Shading" +}; +exports.PathType = PathType; + +function applyBoundingBox(ctx, bbox) { + if (!bbox || _is_node.isNodeJS) { + return; + } + + const width = bbox[2] - bbox[0]; + const height = bbox[3] - bbox[1]; + const region = new Path2D(); + region.rect(bbox[0], bbox[1], width, height); + ctx.clip(region); +} + +class BaseShadingPattern { + constructor() { + if (this.constructor === BaseShadingPattern) { + (0, _util.unreachable)("Cannot initialize BaseShadingPattern."); + } + } + + getPattern() { + (0, _util.unreachable)("Abstract method `getPattern` called."); + } + +} + +class RadialAxialShadingPattern extends BaseShadingPattern { + constructor(IR) { + super(); + this._type = IR[1]; + this._bbox = IR[2]; + this._colorStops = IR[3]; + this._p0 = IR[4]; + this._p1 = IR[5]; + this._r0 = IR[6]; + this._r1 = IR[7]; + this.matrix = null; + } + + _createGradient(ctx) { + let grad; + + if (this._type === "axial") { + grad = ctx.createLinearGradient(this._p0[0], this._p0[1], this._p1[0], this._p1[1]); + } else if (this._type === "radial") { + grad = ctx.createRadialGradient(this._p0[0], this._p0[1], this._r0, this._p1[0], this._p1[1], this._r1); + } + + for (const colorStop of this._colorStops) { + grad.addColorStop(colorStop[0], colorStop[1]); + } + + return grad; + } + + getPattern(ctx, owner, inverse, pathType) { + let pattern; + + if (pathType === PathType.STROKE || pathType === PathType.FILL) { + const ownerBBox = owner.current.getClippedPathBoundingBox(pathType, ctx.mozCurrentTransform) || [0, 0, 0, 0]; + const width = Math.ceil(ownerBBox[2] - ownerBBox[0]) || 1; + const height = Math.ceil(ownerBBox[3] - ownerBBox[1]) || 1; + const tmpCanvas = owner.cachedCanvases.getCanvas("pattern", width, height, true); + const tmpCtx = tmpCanvas.context; + tmpCtx.clearRect(0, 0, tmpCtx.canvas.width, tmpCtx.canvas.height); + tmpCtx.beginPath(); + tmpCtx.rect(0, 0, tmpCtx.canvas.width, tmpCtx.canvas.height); + tmpCtx.translate(-ownerBBox[0], -ownerBBox[1]); + inverse = _util.Util.transform(inverse, [1, 0, 0, 1, ownerBBox[0], ownerBBox[1]]); + tmpCtx.transform.apply(tmpCtx, owner.baseTransform); + + if (this.matrix) { + tmpCtx.transform.apply(tmpCtx, this.matrix); + } + + applyBoundingBox(tmpCtx, this._bbox); + tmpCtx.fillStyle = this._createGradient(tmpCtx); + tmpCtx.fill(); + pattern = ctx.createPattern(tmpCanvas.canvas, "no-repeat"); + const domMatrix = new DOMMatrix(inverse); + + try { + pattern.setTransform(domMatrix); + } catch (ex) { + (0, _util.warn)(`RadialAxialShadingPattern.getPattern: "${ex?.message}".`); + } + } else { + applyBoundingBox(ctx, this._bbox); + pattern = this._createGradient(ctx); + } + + return pattern; + } + +} + +function drawTriangle(data, context, p1, p2, p3, c1, c2, c3) { + const coords = context.coords, + colors = context.colors; + const bytes = data.data, + rowSize = data.width * 4; + let tmp; + + if (coords[p1 + 1] > coords[p2 + 1]) { + tmp = p1; + p1 = p2; + p2 = tmp; + tmp = c1; + c1 = c2; + c2 = tmp; + } + + if (coords[p2 + 1] > coords[p3 + 1]) { + tmp = p2; + p2 = p3; + p3 = tmp; + tmp = c2; + c2 = c3; + c3 = tmp; + } + + if (coords[p1 + 1] > coords[p2 + 1]) { + tmp = p1; + p1 = p2; + p2 = tmp; + tmp = c1; + c1 = c2; + c2 = tmp; + } + + const x1 = (coords[p1] + context.offsetX) * context.scaleX; + const y1 = (coords[p1 + 1] + context.offsetY) * context.scaleY; + const x2 = (coords[p2] + context.offsetX) * context.scaleX; + const y2 = (coords[p2 + 1] + context.offsetY) * context.scaleY; + const x3 = (coords[p3] + context.offsetX) * context.scaleX; + const y3 = (coords[p3 + 1] + context.offsetY) * context.scaleY; + + if (y1 >= y3) { + return; + } + + const c1r = colors[c1], + c1g = colors[c1 + 1], + c1b = colors[c1 + 2]; + const c2r = colors[c2], + c2g = colors[c2 + 1], + c2b = colors[c2 + 2]; + const c3r = colors[c3], + c3g = colors[c3 + 1], + c3b = colors[c3 + 2]; + const minY = Math.round(y1), + maxY = Math.round(y3); + let xa, car, cag, cab; + let xb, cbr, cbg, cbb; + + for (let y = minY; y <= maxY; y++) { + if (y < y2) { + let k; + + if (y < y1) { + k = 0; + } else { + k = (y1 - y) / (y1 - y2); + } + + xa = x1 - (x1 - x2) * k; + car = c1r - (c1r - c2r) * k; + cag = c1g - (c1g - c2g) * k; + cab = c1b - (c1b - c2b) * k; + } else { + let k; + + if (y > y3) { + k = 1; + } else if (y2 === y3) { + k = 0; + } else { + k = (y2 - y) / (y2 - y3); + } + + xa = x2 - (x2 - x3) * k; + car = c2r - (c2r - c3r) * k; + cag = c2g - (c2g - c3g) * k; + cab = c2b - (c2b - c3b) * k; + } + + let k; + + if (y < y1) { + k = 0; + } else if (y > y3) { + k = 1; + } else { + k = (y1 - y) / (y1 - y3); + } + + xb = x1 - (x1 - x3) * k; + cbr = c1r - (c1r - c3r) * k; + cbg = c1g - (c1g - c3g) * k; + cbb = c1b - (c1b - c3b) * k; + const x1_ = Math.round(Math.min(xa, xb)); + const x2_ = Math.round(Math.max(xa, xb)); + let j = rowSize * y + x1_ * 4; + + for (let x = x1_; x <= x2_; x++) { + k = (xa - x) / (xa - xb); + + if (k < 0) { + k = 0; + } else if (k > 1) { + k = 1; + } + + bytes[j++] = car - (car - cbr) * k | 0; + bytes[j++] = cag - (cag - cbg) * k | 0; + bytes[j++] = cab - (cab - cbb) * k | 0; + bytes[j++] = 255; + } + } +} + +function drawFigure(data, figure, context) { + const ps = figure.coords; + const cs = figure.colors; + let i, ii; + + switch (figure.type) { + case "lattice": + const verticesPerRow = figure.verticesPerRow; + const rows = Math.floor(ps.length / verticesPerRow) - 1; + const cols = verticesPerRow - 1; + + for (i = 0; i < rows; i++) { + let q = i * verticesPerRow; + + for (let j = 0; j < cols; j++, q++) { + drawTriangle(data, context, ps[q], ps[q + 1], ps[q + verticesPerRow], cs[q], cs[q + 1], cs[q + verticesPerRow]); + drawTriangle(data, context, ps[q + verticesPerRow + 1], ps[q + 1], ps[q + verticesPerRow], cs[q + verticesPerRow + 1], cs[q + 1], cs[q + verticesPerRow]); + } + } + + break; + + case "triangles": + for (i = 0, ii = ps.length; i < ii; i += 3) { + drawTriangle(data, context, ps[i], ps[i + 1], ps[i + 2], cs[i], cs[i + 1], cs[i + 2]); + } + + break; + + default: + throw new Error("illegal figure"); + } +} + +class MeshShadingPattern extends BaseShadingPattern { + constructor(IR) { + super(); + this._coords = IR[2]; + this._colors = IR[3]; + this._figures = IR[4]; + this._bounds = IR[5]; + this._bbox = IR[7]; + this._background = IR[8]; + this.matrix = null; + } + + _createMeshCanvas(combinedScale, backgroundColor, cachedCanvases) { + const EXPECTED_SCALE = 1.1; + const MAX_PATTERN_SIZE = 3000; + const BORDER_SIZE = 2; + const offsetX = Math.floor(this._bounds[0]); + const offsetY = Math.floor(this._bounds[1]); + const boundsWidth = Math.ceil(this._bounds[2]) - offsetX; + const boundsHeight = Math.ceil(this._bounds[3]) - offsetY; + const width = Math.min(Math.ceil(Math.abs(boundsWidth * combinedScale[0] * EXPECTED_SCALE)), MAX_PATTERN_SIZE); + const height = Math.min(Math.ceil(Math.abs(boundsHeight * combinedScale[1] * EXPECTED_SCALE)), MAX_PATTERN_SIZE); + const scaleX = boundsWidth / width; + const scaleY = boundsHeight / height; + const context = { + coords: this._coords, + colors: this._colors, + offsetX: -offsetX, + offsetY: -offsetY, + scaleX: 1 / scaleX, + scaleY: 1 / scaleY + }; + const paddedWidth = width + BORDER_SIZE * 2; + const paddedHeight = height + BORDER_SIZE * 2; + const tmpCanvas = cachedCanvases.getCanvas("mesh", paddedWidth, paddedHeight, false); + const tmpCtx = tmpCanvas.context; + const data = tmpCtx.createImageData(width, height); + + if (backgroundColor) { + const bytes = data.data; + + for (let i = 0, ii = bytes.length; i < ii; i += 4) { + bytes[i] = backgroundColor[0]; + bytes[i + 1] = backgroundColor[1]; + bytes[i + 2] = backgroundColor[2]; + bytes[i + 3] = 255; + } + } + + for (const figure of this._figures) { + drawFigure(data, figure, context); + } + + tmpCtx.putImageData(data, BORDER_SIZE, BORDER_SIZE); + const canvas = tmpCanvas.canvas; + return { + canvas, + offsetX: offsetX - BORDER_SIZE * scaleX, + offsetY: offsetY - BORDER_SIZE * scaleY, + scaleX, + scaleY + }; + } + + getPattern(ctx, owner, inverse, pathType) { + applyBoundingBox(ctx, this._bbox); + let scale; + + if (pathType === PathType.SHADING) { + scale = _util.Util.singularValueDecompose2dScale(ctx.mozCurrentTransform); + } else { + scale = _util.Util.singularValueDecompose2dScale(owner.baseTransform); + + if (this.matrix) { + const matrixScale = _util.Util.singularValueDecompose2dScale(this.matrix); + + scale = [scale[0] * matrixScale[0], scale[1] * matrixScale[1]]; + } + } + + const temporaryPatternCanvas = this._createMeshCanvas(scale, pathType === PathType.SHADING ? null : this._background, owner.cachedCanvases); + + if (pathType !== PathType.SHADING) { + ctx.setTransform.apply(ctx, owner.baseTransform); + + if (this.matrix) { + ctx.transform.apply(ctx, this.matrix); + } + } + + ctx.translate(temporaryPatternCanvas.offsetX, temporaryPatternCanvas.offsetY); + ctx.scale(temporaryPatternCanvas.scaleX, temporaryPatternCanvas.scaleY); + return ctx.createPattern(temporaryPatternCanvas.canvas, "no-repeat"); + } + +} + +class DummyShadingPattern extends BaseShadingPattern { + getPattern() { + return "hotpink"; + } + +} + +function getShadingPattern(IR) { + switch (IR[0]) { + case "RadialAxial": + return new RadialAxialShadingPattern(IR); + + case "Mesh": + return new MeshShadingPattern(IR); + + case "Dummy": + return new DummyShadingPattern(); + } + + throw new Error(`Unknown IR type: ${IR[0]}`); +} + +const PaintType = { + COLORED: 1, + UNCOLORED: 2 +}; + +class TilingPattern { + static get MAX_PATTERN_SIZE() { + return (0, _util.shadow)(this, "MAX_PATTERN_SIZE", 3000); + } + + constructor(IR, color, ctx, canvasGraphicsFactory, baseTransform) { + this.operatorList = IR[2]; + this.matrix = IR[3] || [1, 0, 0, 1, 0, 0]; + this.bbox = IR[4]; + this.xstep = IR[5]; + this.ystep = IR[6]; + this.paintType = IR[7]; + this.tilingType = IR[8]; + this.color = color; + this.ctx = ctx; + this.canvasGraphicsFactory = canvasGraphicsFactory; + this.baseTransform = baseTransform; + } + + createPatternCanvas(owner) { + const operatorList = this.operatorList; + const bbox = this.bbox; + const xstep = this.xstep; + const ystep = this.ystep; + const paintType = this.paintType; + const tilingType = this.tilingType; + const color = this.color; + const canvasGraphicsFactory = this.canvasGraphicsFactory; + (0, _util.info)("TilingType: " + tilingType); + const x0 = bbox[0], + y0 = bbox[1], + x1 = bbox[2], + y1 = bbox[3]; + + const matrixScale = _util.Util.singularValueDecompose2dScale(this.matrix); + + const curMatrixScale = _util.Util.singularValueDecompose2dScale(this.baseTransform); + + const combinedScale = [matrixScale[0] * curMatrixScale[0], matrixScale[1] * curMatrixScale[1]]; + const dimx = this.getSizeAndScale(xstep, this.ctx.canvas.width, combinedScale[0]); + const dimy = this.getSizeAndScale(ystep, this.ctx.canvas.height, combinedScale[1]); + const tmpCanvas = owner.cachedCanvases.getCanvas("pattern", dimx.size, dimy.size, true); + const tmpCtx = tmpCanvas.context; + const graphics = canvasGraphicsFactory.createCanvasGraphics(tmpCtx); + graphics.groupLevel = owner.groupLevel; + this.setFillAndStrokeStyleToContext(graphics, paintType, color); + let adjustedX0 = x0; + let adjustedY0 = y0; + let adjustedX1 = x1; + let adjustedY1 = y1; + + if (x0 < 0) { + adjustedX0 = 0; + adjustedX1 += Math.abs(x0); + } + + if (y0 < 0) { + adjustedY0 = 0; + adjustedY1 += Math.abs(y0); + } + + tmpCtx.translate(-(dimx.scale * adjustedX0), -(dimy.scale * adjustedY0)); + graphics.transform(dimx.scale, 0, 0, dimy.scale, 0, 0); + tmpCtx.save(); + this.clipBbox(graphics, adjustedX0, adjustedY0, adjustedX1, adjustedY1); + graphics.baseTransform = graphics.ctx.mozCurrentTransform.slice(); + graphics.executeOperatorList(operatorList); + graphics.endDrawing(); + return { + canvas: tmpCanvas.canvas, + scaleX: dimx.scale, + scaleY: dimy.scale, + offsetX: adjustedX0, + offsetY: adjustedY0 + }; + } + + getSizeAndScale(step, realOutputSize, scale) { + step = Math.abs(step); + const maxSize = Math.max(TilingPattern.MAX_PATTERN_SIZE, realOutputSize); + let size = Math.ceil(step * scale); + + if (size >= maxSize) { + size = maxSize; + } else { + scale = size / step; + } + + return { + scale, + size + }; + } + + clipBbox(graphics, x0, y0, x1, y1) { + const bboxWidth = x1 - x0; + const bboxHeight = y1 - y0; + graphics.ctx.rect(x0, y0, bboxWidth, bboxHeight); + graphics.current.updateRectMinMax(graphics.ctx.mozCurrentTransform, [x0, y0, x1, y1]); + graphics.clip(); + graphics.endPath(); + } + + setFillAndStrokeStyleToContext(graphics, paintType, color) { + const context = graphics.ctx, + current = graphics.current; + + switch (paintType) { + case PaintType.COLORED: + const ctx = this.ctx; + context.fillStyle = ctx.fillStyle; + context.strokeStyle = ctx.strokeStyle; + current.fillColor = ctx.fillStyle; + current.strokeColor = ctx.strokeStyle; + break; + + case PaintType.UNCOLORED: + const cssColor = _util.Util.makeHexColor(color[0], color[1], color[2]); + + context.fillStyle = cssColor; + context.strokeStyle = cssColor; + current.fillColor = cssColor; + current.strokeColor = cssColor; + break; + + default: + throw new _util.FormatError(`Unsupported paint type: ${paintType}`); + } + } + + getPattern(ctx, owner, inverse, pathType) { + let matrix = inverse; + + if (pathType !== PathType.SHADING) { + matrix = _util.Util.transform(matrix, owner.baseTransform); + + if (this.matrix) { + matrix = _util.Util.transform(matrix, this.matrix); + } + } + + const temporaryPatternCanvas = this.createPatternCanvas(owner); + let domMatrix = new DOMMatrix(matrix); + domMatrix = domMatrix.translate(temporaryPatternCanvas.offsetX, temporaryPatternCanvas.offsetY); + domMatrix = domMatrix.scale(1 / temporaryPatternCanvas.scaleX, 1 / temporaryPatternCanvas.scaleY); + const pattern = ctx.createPattern(temporaryPatternCanvas.canvas, "repeat"); + + try { + pattern.setTransform(domMatrix); + } catch (ex) { + (0, _util.warn)(`TilingPattern.getPattern: "${ex?.message}".`); + } + + return pattern; + } + +} + +exports.TilingPattern = TilingPattern; + +/***/ }), +/* 12 */ +/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.applyMaskImageData = applyMaskImageData; + +var _util = __w_pdfjs_require__(1); + +function applyMaskImageData({ + src, + srcPos = 0, + dest, + destPos = 0, + width, + height, + inverseDecode = false +}) { + const opaque = _util.FeatureTest.isLittleEndian ? 0xff000000 : 0x000000ff; + const [zeroMapping, oneMapping] = !inverseDecode ? [opaque, 0] : [0, opaque]; + const widthInSource = width >> 3; + const widthRemainder = width & 7; + const srcLength = src.length; + dest = new Uint32Array(dest.buffer); + + for (let i = 0; i < height; i++) { + for (const max = srcPos + widthInSource; srcPos < max; srcPos++) { + const elem = srcPos < srcLength ? src[srcPos] : 255; + dest[destPos++] = elem & 0b10000000 ? oneMapping : zeroMapping; + dest[destPos++] = elem & 0b1000000 ? oneMapping : zeroMapping; + dest[destPos++] = elem & 0b100000 ? oneMapping : zeroMapping; + dest[destPos++] = elem & 0b10000 ? oneMapping : zeroMapping; + dest[destPos++] = elem & 0b1000 ? oneMapping : zeroMapping; + dest[destPos++] = elem & 0b100 ? oneMapping : zeroMapping; + dest[destPos++] = elem & 0b10 ? oneMapping : zeroMapping; + dest[destPos++] = elem & 0b1 ? oneMapping : zeroMapping; + } + + if (widthRemainder === 0) { + continue; + } + + const elem = srcPos < srcLength ? src[srcPos++] : 255; + + for (let j = 0; j < widthRemainder; j++) { + dest[destPos++] = elem & 1 << 7 - j ? oneMapping : zeroMapping; + } + } + + return { + srcPos, + destPos + }; +} + +/***/ }), +/* 13 */ +/***/ ((__unused_webpack_module, exports) => { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.GlobalWorkerOptions = void 0; +const GlobalWorkerOptions = Object.create(null); +exports.GlobalWorkerOptions = GlobalWorkerOptions; +GlobalWorkerOptions.workerPort = GlobalWorkerOptions.workerPort === undefined ? null : GlobalWorkerOptions.workerPort; +GlobalWorkerOptions.workerSrc = GlobalWorkerOptions.workerSrc === undefined ? "" : GlobalWorkerOptions.workerSrc; + +/***/ }), +/* 14 */ +/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.MessageHandler = void 0; + +var _util = __w_pdfjs_require__(1); + +const CallbackKind = { + UNKNOWN: 0, + DATA: 1, + ERROR: 2 +}; +const StreamKind = { + UNKNOWN: 0, + CANCEL: 1, + CANCEL_COMPLETE: 2, + CLOSE: 3, + ENQUEUE: 4, + ERROR: 5, + PULL: 6, + PULL_COMPLETE: 7, + START_COMPLETE: 8 +}; + +function wrapReason(reason) { + if (!(reason instanceof Error || typeof reason === "object" && reason !== null)) { + (0, _util.unreachable)('wrapReason: Expected "reason" to be a (possibly cloned) Error.'); + } + + switch (reason.name) { + case "AbortException": + return new _util.AbortException(reason.message); + + case "MissingPDFException": + return new _util.MissingPDFException(reason.message); + + case "PasswordException": + return new _util.PasswordException(reason.message, reason.code); + + case "UnexpectedResponseException": + return new _util.UnexpectedResponseException(reason.message, reason.status); + + case "UnknownErrorException": + return new _util.UnknownErrorException(reason.message, reason.details); + + default: + return new _util.UnknownErrorException(reason.message, reason.toString()); + } +} + +class MessageHandler { + constructor(sourceName, targetName, comObj) { + this.sourceName = sourceName; + this.targetName = targetName; + this.comObj = comObj; + 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 = event => { + const data = event.data; + + if (data.targetName !== this.sourceName) { + return; + } + + if (data.stream) { + this._processStreamMessage(data); + + return; + } + + if (data.callback) { + const callbackId = data.callbackId; + const capability = this.callbackCapabilities[callbackId]; + + if (!capability) { + throw new Error(`Cannot resolve callback ${callbackId}`); + } + + delete this.callbackCapabilities[callbackId]; + + if (data.callback === CallbackKind.DATA) { + capability.resolve(data.data); + } else if (data.callback === CallbackKind.ERROR) { + capability.reject(wrapReason(data.reason)); + } else { + throw new Error("Unexpected callback case"); + } + + return; + } + + const action = this.actionHandler[data.action]; + + if (!action) { + throw new Error(`Unknown action from worker: ${data.action}`); + } + + if (data.callbackId) { + const cbSourceName = this.sourceName; + const cbTargetName = data.sourceName; + new Promise(function (resolve) { + resolve(action(data.data)); + }).then(function (result) { + comObj.postMessage({ + sourceName: cbSourceName, + targetName: cbTargetName, + callback: CallbackKind.DATA, + callbackId: data.callbackId, + data: result + }); + }, function (reason) { + comObj.postMessage({ + sourceName: cbSourceName, + targetName: cbTargetName, + callback: CallbackKind.ERROR, + callbackId: data.callbackId, + reason: wrapReason(reason) + }); + }); + return; + } + + if (data.streamId) { + this._createStreamSink(data); + + return; + } + + action(data.data); + }; + + comObj.addEventListener("message", this._onComObjOnMessage); + } + + on(actionName, handler) { + const ah = this.actionHandler; + + if (ah[actionName]) { + throw new Error(`There is already an actionName called "${actionName}"`); + } + + ah[actionName] = handler; + } + + send(actionName, data, transfers) { + this.comObj.postMessage({ + sourceName: this.sourceName, + targetName: this.targetName, + action: actionName, + data + }, transfers); + } + + sendWithPromise(actionName, data, transfers) { + const callbackId = this.callbackId++; + const capability = (0, _util.createPromiseCapability)(); + this.callbackCapabilities[callbackId] = capability; + + try { + this.comObj.postMessage({ + sourceName: this.sourceName, + targetName: this.targetName, + action: actionName, + callbackId, + data + }, transfers); + } catch (ex) { + capability.reject(ex); + } + + return capability.promise; + } + + sendWithStream(actionName, data, queueingStrategy, transfers) { + const streamId = this.streamId++, + sourceName = this.sourceName, + targetName = this.targetName, + comObj = this.comObj; + return new ReadableStream({ + start: controller => { + const startCapability = (0, _util.createPromiseCapability)(); + this.streamControllers[streamId] = { + controller, + startCall: startCapability, + pullCall: null, + cancelCall: null, + isClosed: false + }; + comObj.postMessage({ + sourceName, + targetName, + action: actionName, + streamId, + data, + desiredSize: controller.desiredSize + }, transfers); + return startCapability.promise; + }, + pull: controller => { + const pullCapability = (0, _util.createPromiseCapability)(); + this.streamControllers[streamId].pullCall = pullCapability; + comObj.postMessage({ + sourceName, + targetName, + stream: StreamKind.PULL, + streamId, + desiredSize: controller.desiredSize + }); + return pullCapability.promise; + }, + cancel: reason => { + (0, _util.assert)(reason instanceof Error, "cancel must have a valid reason"); + const cancelCapability = (0, _util.createPromiseCapability)(); + this.streamControllers[streamId].cancelCall = cancelCapability; + this.streamControllers[streamId].isClosed = true; + comObj.postMessage({ + sourceName, + targetName, + stream: StreamKind.CANCEL, + streamId, + reason: wrapReason(reason) + }); + return cancelCapability.promise; + } + }, queueingStrategy); + } + + _createStreamSink(data) { + const streamId = data.streamId, + sourceName = this.sourceName, + targetName = data.sourceName, + comObj = this.comObj; + const self = this, + action = this.actionHandler[data.action]; + const streamSink = { + enqueue(chunk, size = 1, transfers) { + if (this.isCancelled) { + return; + } + + const lastDesiredSize = this.desiredSize; + this.desiredSize -= size; + + if (lastDesiredSize > 0 && this.desiredSize <= 0) { + this.sinkCapability = (0, _util.createPromiseCapability)(); + this.ready = this.sinkCapability.promise; + } + + comObj.postMessage({ + sourceName, + targetName, + stream: StreamKind.ENQUEUE, + streamId, + chunk + }, transfers); + }, + + close() { + if (this.isCancelled) { + return; + } + + this.isCancelled = true; + comObj.postMessage({ + sourceName, + targetName, + stream: StreamKind.CLOSE, + streamId + }); + delete self.streamSinks[streamId]; + }, + + error(reason) { + (0, _util.assert)(reason instanceof Error, "error must have a valid reason"); + + if (this.isCancelled) { + return; + } + + this.isCancelled = true; + comObj.postMessage({ + sourceName, + targetName, + stream: StreamKind.ERROR, + streamId, + reason: wrapReason(reason) + }); + }, + + sinkCapability: (0, _util.createPromiseCapability)(), + onPull: null, + onCancel: null, + isCancelled: false, + desiredSize: data.desiredSize, + ready: null + }; + streamSink.sinkCapability.resolve(); + streamSink.ready = streamSink.sinkCapability.promise; + this.streamSinks[streamId] = streamSink; + new Promise(function (resolve) { + resolve(action(data.data, streamSink)); + }).then(function () { + comObj.postMessage({ + sourceName, + targetName, + stream: StreamKind.START_COMPLETE, + streamId, + success: true + }); + }, function (reason) { + comObj.postMessage({ + sourceName, + targetName, + stream: StreamKind.START_COMPLETE, + streamId, + reason: wrapReason(reason) + }); + }); + } + + _processStreamMessage(data) { + const streamId = data.streamId, + sourceName = this.sourceName, + targetName = data.sourceName, + comObj = this.comObj; + const streamController = this.streamControllers[streamId], + streamSink = this.streamSinks[streamId]; + + switch (data.stream) { + case StreamKind.START_COMPLETE: + if (data.success) { + streamController.startCall.resolve(); + } else { + streamController.startCall.reject(wrapReason(data.reason)); + } + + break; + + case StreamKind.PULL_COMPLETE: + if (data.success) { + streamController.pullCall.resolve(); + } else { + streamController.pullCall.reject(wrapReason(data.reason)); + } + + break; + + case StreamKind.PULL: + if (!streamSink) { + comObj.postMessage({ + sourceName, + targetName, + stream: StreamKind.PULL_COMPLETE, + streamId, + success: true + }); + break; + } + + if (streamSink.desiredSize <= 0 && data.desiredSize > 0) { + streamSink.sinkCapability.resolve(); + } + + streamSink.desiredSize = data.desiredSize; + new Promise(function (resolve) { + resolve(streamSink.onPull && streamSink.onPull()); + }).then(function () { + comObj.postMessage({ + sourceName, + targetName, + stream: StreamKind.PULL_COMPLETE, + streamId, + success: true + }); + }, function (reason) { + comObj.postMessage({ + sourceName, + targetName, + stream: StreamKind.PULL_COMPLETE, + streamId, + reason: wrapReason(reason) + }); + }); + break; + + case StreamKind.ENQUEUE: + (0, _util.assert)(streamController, "enqueue should have stream controller"); + + if (streamController.isClosed) { + break; + } + + streamController.controller.enqueue(data.chunk); + break; + + case StreamKind.CLOSE: + (0, _util.assert)(streamController, "close should have stream controller"); + + if (streamController.isClosed) { + break; + } + + streamController.isClosed = true; + streamController.controller.close(); + + this._deleteStreamController(streamController, streamId); + + break; + + case StreamKind.ERROR: + (0, _util.assert)(streamController, "error should have stream controller"); + streamController.controller.error(wrapReason(data.reason)); + + this._deleteStreamController(streamController, streamId); + + break; + + case StreamKind.CANCEL_COMPLETE: + if (data.success) { + streamController.cancelCall.resolve(); + } else { + streamController.cancelCall.reject(wrapReason(data.reason)); + } + + this._deleteStreamController(streamController, streamId); + + break; + + case StreamKind.CANCEL: + if (!streamSink) { + break; + } + + new Promise(function (resolve) { + resolve(streamSink.onCancel && streamSink.onCancel(wrapReason(data.reason))); + }).then(function () { + comObj.postMessage({ + sourceName, + targetName, + stream: StreamKind.CANCEL_COMPLETE, + streamId, + success: true + }); + }, function (reason) { + comObj.postMessage({ + sourceName, + targetName, + stream: StreamKind.CANCEL_COMPLETE, + streamId, + reason: wrapReason(reason) + }); + }); + streamSink.sinkCapability.reject(wrapReason(data.reason)); + streamSink.isCancelled = true; + delete this.streamSinks[streamId]; + break; + + default: + throw new Error("Unexpected stream case"); + } + } + + async _deleteStreamController(streamController, streamId) { + await Promise.allSettled([streamController.startCall && streamController.startCall.promise, streamController.pullCall && streamController.pullCall.promise, streamController.cancelCall && streamController.cancelCall.promise]); + delete this.streamControllers[streamId]; + } + + destroy() { + this.comObj.removeEventListener("message", this._onComObjOnMessage); + } + +} + +exports.MessageHandler = MessageHandler; + +/***/ }), +/* 15 */ +/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.Metadata = void 0; + +var _util = __w_pdfjs_require__(1); + +class Metadata { + #metadataMap; + #data; + + constructor({ + parsedData, + rawData + }) { + this.#metadataMap = parsedData; + this.#data = rawData; + } + + getRaw() { + return this.#data; + } + + get(name) { + return this.#metadataMap.get(name) ?? null; + } + + getAll() { + return (0, _util.objectFromMap)(this.#metadataMap); + } + + has(name) { + return this.#metadataMap.has(name); + } + +} + +exports.Metadata = Metadata; + +/***/ }), +/* 16 */ +/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.OptionalContentConfig = void 0; + +var _util = __w_pdfjs_require__(1); + +class OptionalContentGroup { + constructor(name, intent) { + this.visible = true; + this.name = name; + this.intent = intent; + } + +} + +class OptionalContentConfig { + constructor(data) { + this.name = null; + this.creator = null; + this._order = null; + this._groups = new Map(); + + if (data === null) { + return; + } + + this.name = data.name; + this.creator = data.creator; + this._order = data.order; + + for (const group of data.groups) { + this._groups.set(group.id, new OptionalContentGroup(group.name, group.intent)); + } + + if (data.baseState === "OFF") { + for (const group of this._groups) { + group.visible = false; + } + } + + for (const on of data.on) { + this._groups.get(on).visible = true; + } + + for (const off of data.off) { + this._groups.get(off).visible = false; + } + } + + _evaluateVisibilityExpression(array) { + const length = array.length; + + if (length < 2) { + return true; + } + + const operator = array[0]; + + for (let i = 1; i < length; i++) { + const element = array[i]; + let state; + + if (Array.isArray(element)) { + state = this._evaluateVisibilityExpression(element); + } else if (this._groups.has(element)) { + state = this._groups.get(element).visible; + } else { + (0, _util.warn)(`Optional content group not found: ${element}`); + return true; + } + + switch (operator) { + case "And": + if (!state) { + return false; + } + + break; + + case "Or": + if (state) { + return true; + } + + break; + + case "Not": + return !state; + + default: + return true; + } + } + + return operator === "And"; + } + + isVisible(group) { + if (this._groups.size === 0) { + return true; + } + + if (!group) { + (0, _util.warn)("Optional content group not defined."); + return true; + } + + if (group.type === "OCG") { + if (!this._groups.has(group.id)) { + (0, _util.warn)(`Optional content group not found: ${group.id}`); + return true; + } + + return this._groups.get(group.id).visible; + } else if (group.type === "OCMD") { + if (group.expression) { + return this._evaluateVisibilityExpression(group.expression); + } + + if (!group.policy || group.policy === "AnyOn") { + for (const id of group.ids) { + if (!this._groups.has(id)) { + (0, _util.warn)(`Optional content group not found: ${id}`); + return true; + } + + if (this._groups.get(id).visible) { + return true; + } + } + + return false; + } else if (group.policy === "AllOn") { + for (const id of group.ids) { + if (!this._groups.has(id)) { + (0, _util.warn)(`Optional content group not found: ${id}`); + return true; + } + + if (!this._groups.get(id).visible) { + return false; + } + } + + return true; + } else if (group.policy === "AnyOff") { + for (const id of group.ids) { + if (!this._groups.has(id)) { + (0, _util.warn)(`Optional content group not found: ${id}`); + return true; + } + + if (!this._groups.get(id).visible) { + return true; + } + } + + return false; + } else if (group.policy === "AllOff") { + for (const id of group.ids) { + if (!this._groups.has(id)) { + (0, _util.warn)(`Optional content group not found: ${id}`); + return true; + } + + if (this._groups.get(id).visible) { + return false; + } + } + + return true; + } + + (0, _util.warn)(`Unknown optional content policy ${group.policy}.`); + return true; + } + + (0, _util.warn)(`Unknown group type ${group.type}.`); + return true; + } + + setVisibility(id, visible = true) { + if (!this._groups.has(id)) { + (0, _util.warn)(`Optional content group not found: ${id}`); + return; + } + + this._groups.get(id).visible = !!visible; + } + + getOrder() { + if (!this._groups.size) { + return null; + } + + if (this._order) { + return this._order.slice(); + } + + return Array.from(this._groups.keys()); + } + + getGroups() { + return this._groups.size > 0 ? (0, _util.objectFromMap)(this._groups) : null; + } + + getGroup(id) { + return this._groups.get(id) || null; + } + +} + +exports.OptionalContentConfig = OptionalContentConfig; + +/***/ }), +/* 17 */ +/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.PDFDataTransportStream = void 0; + +var _util = __w_pdfjs_require__(1); + +var _display_utils = __w_pdfjs_require__(5); + +class PDFDataTransportStream { + constructor(params, pdfDataRangeTransport) { + (0, _util.assert)(pdfDataRangeTransport, 'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.'); + this._queuedChunks = []; + this._progressiveDone = params.progressiveDone || false; + this._contentDispositionFilename = params.contentDispositionFilename || null; + const initialData = params.initialData; + + if (initialData?.length > 0) { + const buffer = new Uint8Array(initialData).buffer; + + this._queuedChunks.push(buffer); + } + + this._pdfDataRangeTransport = pdfDataRangeTransport; + this._isStreamingSupported = !params.disableStream; + this._isRangeSupported = !params.disableRange; + this._contentLength = params.length; + this._fullRequestReader = null; + this._rangeReaders = []; + + this._pdfDataRangeTransport.addRangeListener((begin, chunk) => { + this._onReceiveData({ + begin, + chunk + }); + }); + + this._pdfDataRangeTransport.addProgressListener((loaded, total) => { + this._onProgress({ + loaded, + total + }); + }); + + this._pdfDataRangeTransport.addProgressiveReadListener(chunk => { + this._onReceiveData({ + chunk + }); + }); + + this._pdfDataRangeTransport.addProgressiveDoneListener(() => { + this._onProgressiveDone(); + }); + + this._pdfDataRangeTransport.transportReady(); + } + + _onReceiveData(args) { + const buffer = new Uint8Array(args.chunk).buffer; + + if (args.begin === undefined) { + if (this._fullRequestReader) { + this._fullRequestReader._enqueue(buffer); + } else { + this._queuedChunks.push(buffer); + } + } else { + const found = this._rangeReaders.some(function (rangeReader) { + if (rangeReader._begin !== args.begin) { + return false; + } + + rangeReader._enqueue(buffer); + + return true; + }); + + (0, _util.assert)(found, "_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found."); + } + } + + get _progressiveDataLength() { + return this._fullRequestReader?._loaded ?? 0; + } + + _onProgress(evt) { + if (evt.total === undefined) { + const firstReader = this._rangeReaders[0]; + + if (firstReader?.onProgress) { + firstReader.onProgress({ + loaded: evt.loaded + }); + } + } else { + const fullReader = this._fullRequestReader; + + if (fullReader?.onProgress) { + fullReader.onProgress({ + loaded: evt.loaded, + total: evt.total + }); + } + } + } + + _onProgressiveDone() { + if (this._fullRequestReader) { + this._fullRequestReader.progressiveDone(); + } + + this._progressiveDone = true; + } + + _removeRangeReader(reader) { + const i = this._rangeReaders.indexOf(reader); + + if (i >= 0) { + this._rangeReaders.splice(i, 1); + } + } + + getFullReader() { + (0, _util.assert)(!this._fullRequestReader, "PDFDataTransportStream.getFullReader can only be called once."); + const queuedChunks = this._queuedChunks; + this._queuedChunks = null; + return new PDFDataTransportStreamReader(this, queuedChunks, this._progressiveDone, this._contentDispositionFilename); + } + + getRangeReader(begin, end) { + if (end <= this._progressiveDataLength) { + return null; + } + + const reader = new PDFDataTransportStreamRangeReader(this, begin, end); + + this._pdfDataRangeTransport.requestDataRange(begin, end); + + this._rangeReaders.push(reader); + + return reader; + } + + cancelAllRequests(reason) { + if (this._fullRequestReader) { + this._fullRequestReader.cancel(reason); + } + + for (const reader of this._rangeReaders.slice(0)) { + reader.cancel(reason); + } + + this._pdfDataRangeTransport.abort(); + } + +} + +exports.PDFDataTransportStream = PDFDataTransportStream; + +class PDFDataTransportStreamReader { + constructor(stream, queuedChunks, progressiveDone = false, contentDispositionFilename = null) { + this._stream = stream; + this._done = progressiveDone || false; + this._filename = (0, _display_utils.isPdfFile)(contentDispositionFilename) ? contentDispositionFilename : null; + this._queuedChunks = queuedChunks || []; + this._loaded = 0; + + for (const chunk of this._queuedChunks) { + this._loaded += chunk.byteLength; + } + + this._requests = []; + this._headersReady = Promise.resolve(); + stream._fullRequestReader = this; + this.onProgress = null; + } + + _enqueue(chunk) { + if (this._done) { + return; + } + + if (this._requests.length > 0) { + const requestCapability = this._requests.shift(); + + requestCapability.resolve({ + value: chunk, + done: false + }); + } else { + this._queuedChunks.push(chunk); + } + + this._loaded += chunk.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) { + const chunk = this._queuedChunks.shift(); + + return { + value: chunk, + done: false + }; + } + + if (this._done) { + return { + value: undefined, + done: true + }; + } + + const requestCapability = (0, _util.createPromiseCapability)(); + + this._requests.push(requestCapability); + + return requestCapability.promise; + } + + cancel(reason) { + this._done = true; + + for (const requestCapability of this._requests) { + requestCapability.resolve({ + value: undefined, + done: true + }); + } + + this._requests.length = 0; + } + + progressiveDone() { + if (this._done) { + return; + } + + this._done = true; + } + +} + +class PDFDataTransportStreamRangeReader { + constructor(stream, begin, end) { + this._stream = stream; + this._begin = begin; + this._end = end; + this._queuedChunk = null; + this._requests = []; + this._done = false; + this.onProgress = null; + } + + _enqueue(chunk) { + if (this._done) { + return; + } + + if (this._requests.length === 0) { + this._queuedChunk = chunk; + } else { + const requestsCapability = this._requests.shift(); + + requestsCapability.resolve({ + value: chunk, + done: false + }); + + for (const requestCapability of this._requests) { + requestCapability.resolve({ + value: undefined, + done: true + }); + } + + this._requests.length = 0; + } + + this._done = true; + + this._stream._removeRangeReader(this); + } + + get isStreamingSupported() { + return false; + } + + async read() { + if (this._queuedChunk) { + const chunk = this._queuedChunk; + this._queuedChunk = null; + return { + value: chunk, + done: false + }; + } + + if (this._done) { + return { + value: undefined, + done: true + }; + } + + const requestCapability = (0, _util.createPromiseCapability)(); + + this._requests.push(requestCapability); + + return requestCapability.promise; + } + + cancel(reason) { + this._done = true; + + for (const requestCapability of this._requests) { + requestCapability.resolve({ + value: undefined, + done: true + }); + } + + this._requests.length = 0; + + this._stream._removeRangeReader(this); + } + +} + +/***/ }), +/* 18 */ +/***/ ((__unused_webpack_module, exports) => { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.XfaText = void 0; + +class XfaText { + static textContent(xfa) { + const items = []; + const output = { + items, + styles: Object.create(null) + }; + + function walk(node) { + if (!node) { + return; + } + + let str = null; + const name = node.name; + + if (name === "#text") { + str = node.value; + } else if (!XfaText.shouldBuildText(name)) { + return; + } else if (node?.attributes?.textContent) { + str = node.attributes.textContent; + } else if (node.value) { + str = node.value; + } + + if (str !== null) { + items.push({ + str + }); + } + + if (!node.children) { + return; + } + + for (const child of node.children) { + walk(child); + } + } + + walk(xfa); + return output; + } + + static shouldBuildText(name) { + return !(name === "textarea" || name === "input" || name === "option" || name === "select"); + } + +} + +exports.XfaText = XfaText; + +/***/ }), +/* 19 */ +/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.NodeStandardFontDataFactory = exports.NodeCanvasFactory = exports.NodeCMapReaderFactory = void 0; + +var _base_factory = __w_pdfjs_require__(6); + +; + +const fetchData = function (url) { + return new Promise((resolve, reject) => { + const fs = require("fs"); + + fs.readFile(url, (error, data) => { + if (error || !data) { + reject(new Error(error)); + return; + } + + resolve(new Uint8Array(data)); + }); + }); +}; + +class NodeCanvasFactory extends _base_factory.BaseCanvasFactory { + _createCanvas(width, height) { + const Canvas = require("canvas"); + + return Canvas.createCanvas(width, height); + } + +} + +exports.NodeCanvasFactory = NodeCanvasFactory; + +class NodeCMapReaderFactory extends _base_factory.BaseCMapReaderFactory { + _fetchData(url, compressionType) { + return fetchData(url).then(data => { + return { + cMapData: data, + compressionType + }; + }); + } + +} + +exports.NodeCMapReaderFactory = NodeCMapReaderFactory; + +class NodeStandardFontDataFactory extends _base_factory.BaseStandardFontDataFactory { + _fetchData(url) { + return fetchData(url); + } + +} + +exports.NodeStandardFontDataFactory = NodeStandardFontDataFactory; + +/***/ }), +/* 20 */ +/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.AnnotationLayer = void 0; + +var _util = __w_pdfjs_require__(1); + +var _display_utils = __w_pdfjs_require__(5); + +var _annotation_storage = __w_pdfjs_require__(8); + +var _scripting_utils = __w_pdfjs_require__(21); + +var _xfa_layer = __w_pdfjs_require__(22); + +const DEFAULT_TAB_INDEX = 1000; +const GetElementsByNameSet = new WeakSet(); + +function getRectDims(rect) { + return { + width: rect[2] - rect[0], + height: rect[3] - rect[1] + }; +} + +class AnnotationElementFactory { + static create(parameters) { + const subtype = parameters.data.annotationType; + + switch (subtype) { + case _util.AnnotationType.LINK: + return new LinkAnnotationElement(parameters); + + case _util.AnnotationType.TEXT: + return new TextAnnotationElement(parameters); + + case _util.AnnotationType.WIDGET: + const fieldType = parameters.data.fieldType; + + switch (fieldType) { + case "Tx": + return new TextWidgetAnnotationElement(parameters); + + case "Btn": + if (parameters.data.radioButton) { + return new RadioButtonWidgetAnnotationElement(parameters); + } else if (parameters.data.checkBox) { + return new CheckboxWidgetAnnotationElement(parameters); + } + + return new PushButtonWidgetAnnotationElement(parameters); + + case "Ch": + return new ChoiceWidgetAnnotationElement(parameters); + } + + return new WidgetAnnotationElement(parameters); + + case _util.AnnotationType.POPUP: + return new PopupAnnotationElement(parameters); + + case _util.AnnotationType.FREETEXT: + return new FreeTextAnnotationElement(parameters); + + case _util.AnnotationType.LINE: + return new LineAnnotationElement(parameters); + + case _util.AnnotationType.SQUARE: + return new SquareAnnotationElement(parameters); + + case _util.AnnotationType.CIRCLE: + return new CircleAnnotationElement(parameters); + + case _util.AnnotationType.POLYLINE: + return new PolylineAnnotationElement(parameters); + + case _util.AnnotationType.CARET: + return new CaretAnnotationElement(parameters); + + case _util.AnnotationType.INK: + return new InkAnnotationElement(parameters); + + case _util.AnnotationType.POLYGON: + return new PolygonAnnotationElement(parameters); + + case _util.AnnotationType.HIGHLIGHT: + return new HighlightAnnotationElement(parameters); + + case _util.AnnotationType.UNDERLINE: + return new UnderlineAnnotationElement(parameters); + + case _util.AnnotationType.SQUIGGLY: + return new SquigglyAnnotationElement(parameters); + + case _util.AnnotationType.STRIKEOUT: + return new StrikeOutAnnotationElement(parameters); + + case _util.AnnotationType.STAMP: + return new StampAnnotationElement(parameters); + + case _util.AnnotationType.FILEATTACHMENT: + return new FileAttachmentAnnotationElement(parameters); + + default: + return new AnnotationElement(parameters); + } + } + +} + +class AnnotationElement { + constructor(parameters, { + isRenderable = false, + ignoreBorder = false, + createQuadrilaterals = false + } = {}) { + this.isRenderable = isRenderable; + this.data = parameters.data; + this.layer = parameters.layer; + this.page = parameters.page; + this.viewport = parameters.viewport; + this.linkService = parameters.linkService; + this.downloadManager = parameters.downloadManager; + this.imageResourcesPath = parameters.imageResourcesPath; + this.renderForms = parameters.renderForms; + this.svgFactory = parameters.svgFactory; + this.annotationStorage = parameters.annotationStorage; + this.enableScripting = parameters.enableScripting; + this.hasJSActions = parameters.hasJSActions; + this._fieldObjects = parameters.fieldObjects; + this._mouseState = parameters.mouseState; + + if (isRenderable) { + this.container = this._createContainer(ignoreBorder); + } + + if (createQuadrilaterals) { + this.quadrilaterals = this._createQuadrilaterals(ignoreBorder); + } + } + + _createContainer(ignoreBorder = false) { + const data = this.data, + page = this.page, + viewport = this.viewport; + const container = document.createElement("section"); + let { + width, + height + } = getRectDims(data.rect); + container.setAttribute("data-annotation-id", data.id); + + const rect = _util.Util.normalizeRect([data.rect[0], page.view[3] - data.rect[1] + page.view[1], data.rect[2], page.view[3] - data.rect[3] + page.view[1]]); + + if (data.hasOwnCanvas) { + const transform = viewport.transform.slice(); + + const [scaleX, scaleY] = _util.Util.singularValueDecompose2dScale(transform); + + width = Math.ceil(width * scaleX); + height = Math.ceil(height * scaleY); + rect[0] *= scaleX; + rect[1] *= scaleY; + + for (let i = 0; i < 4; i++) { + transform[i] = Math.sign(transform[i]); + } + + container.style.transform = `matrix(${transform.join(",")})`; + } else { + container.style.transform = `matrix(${viewport.transform.join(",")})`; + } + + container.style.transformOrigin = `${-rect[0]}px ${-rect[1]}px`; + + if (!ignoreBorder && data.borderStyle.width > 0) { + container.style.borderWidth = `${data.borderStyle.width}px`; + + if (data.borderStyle.style !== _util.AnnotationBorderStyleType.UNDERLINE) { + width -= 2 * data.borderStyle.width; + height -= 2 * data.borderStyle.width; + } + + const horizontalRadius = data.borderStyle.horizontalCornerRadius; + const verticalRadius = data.borderStyle.verticalCornerRadius; + + if (horizontalRadius > 0 || verticalRadius > 0) { + const radius = `${horizontalRadius}px / ${verticalRadius}px`; + container.style.borderRadius = radius; + } + + switch (data.borderStyle.style) { + case _util.AnnotationBorderStyleType.SOLID: + container.style.borderStyle = "solid"; + break; + + case _util.AnnotationBorderStyleType.DASHED: + container.style.borderStyle = "dashed"; + break; + + case _util.AnnotationBorderStyleType.BEVELED: + (0, _util.warn)("Unimplemented border style: beveled"); + break; + + case _util.AnnotationBorderStyleType.INSET: + (0, _util.warn)("Unimplemented border style: inset"); + break; + + case _util.AnnotationBorderStyleType.UNDERLINE: + container.style.borderBottomStyle = "solid"; + break; + + default: + break; + } + + const borderColor = data.borderColor || data.color || null; + + if (borderColor) { + container.style.borderColor = _util.Util.makeHexColor(data.color[0] | 0, data.color[1] | 0, data.color[2] | 0); + } else { + container.style.borderWidth = 0; + } + } + + container.style.left = `${rect[0]}px`; + container.style.top = `${rect[1]}px`; + + if (data.hasOwnCanvas) { + container.style.width = container.style.height = "auto"; + } else { + container.style.width = `${width}px`; + container.style.height = `${height}px`; + } + + return container; + } + + get _commonActions() { + const setColor = (jsName, styleName, event) => { + const color = event.detail[jsName]; + event.target.style[styleName] = _scripting_utils.ColorConverters[`${color[0]}_HTML`](color.slice(1)); + }; + + return (0, _util.shadow)(this, "_commonActions", { + display: event => { + const hidden = event.detail.display % 2 === 1; + event.target.style.visibility = hidden ? "hidden" : "visible"; + this.annotationStorage.setValue(this.data.id, { + hidden, + print: event.detail.display === 0 || event.detail.display === 3 + }); + }, + print: event => { + this.annotationStorage.setValue(this.data.id, { + print: event.detail.print + }); + }, + hidden: event => { + event.target.style.visibility = event.detail.hidden ? "hidden" : "visible"; + this.annotationStorage.setValue(this.data.id, { + hidden: event.detail.hidden + }); + }, + focus: event => { + setTimeout(() => event.target.focus({ + preventScroll: false + }), 0); + }, + userName: event => { + event.target.title = event.detail.userName; + }, + readonly: event => { + if (event.detail.readonly) { + event.target.setAttribute("readonly", ""); + } else { + event.target.removeAttribute("readonly"); + } + }, + required: event => { + if (event.detail.required) { + event.target.setAttribute("required", ""); + } else { + event.target.removeAttribute("required"); + } + }, + bgColor: event => { + setColor("bgColor", "backgroundColor", event); + }, + fillColor: event => { + setColor("fillColor", "backgroundColor", event); + }, + fgColor: event => { + setColor("fgColor", "color", event); + }, + textColor: event => { + setColor("textColor", "color", event); + }, + borderColor: event => { + setColor("borderColor", "borderColor", event); + }, + strokeColor: event => { + setColor("strokeColor", "borderColor", event); + } + }); + } + + _dispatchEventFromSandbox(actions, jsEvent) { + const commonActions = this._commonActions; + + for (const name of Object.keys(jsEvent.detail)) { + const action = actions[name] || commonActions[name]; + + if (action) { + action(jsEvent); + } + } + } + + _setDefaultPropertiesFromJS(element) { + if (!this.enableScripting) { + return; + } + + const storedData = this.annotationStorage.getRawValue(this.data.id); + + if (!storedData) { + return; + } + + const commonActions = this._commonActions; + + for (const [actionName, detail] of Object.entries(storedData)) { + const action = commonActions[actionName]; + + if (action) { + action({ + detail, + target: element + }); + delete storedData[actionName]; + } + } + } + + _createQuadrilaterals(ignoreBorder = false) { + if (!this.data.quadPoints) { + return null; + } + + const quadrilaterals = []; + const savedRect = this.data.rect; + + for (const quadPoint of this.data.quadPoints) { + this.data.rect = [quadPoint[2].x, quadPoint[2].y, quadPoint[1].x, quadPoint[1].y]; + quadrilaterals.push(this._createContainer(ignoreBorder)); + } + + this.data.rect = savedRect; + return quadrilaterals; + } + + _createPopup(trigger, data) { + let container = this.container; + + if (this.quadrilaterals) { + trigger = trigger || this.quadrilaterals; + container = this.quadrilaterals[0]; + } + + if (!trigger) { + trigger = document.createElement("div"); + trigger.style.height = container.style.height; + trigger.style.width = container.style.width; + container.appendChild(trigger); + } + + const popupElement = new PopupElement({ + container, + trigger, + color: data.color, + titleObj: data.titleObj, + modificationDate: data.modificationDate, + contentsObj: data.contentsObj, + richText: data.richText, + hideWrapper: true + }); + const popup = popupElement.render(); + popup.style.left = container.style.width; + container.appendChild(popup); + } + + _renderQuadrilaterals(className) { + for (const quadrilateral of this.quadrilaterals) { + quadrilateral.className = className; + } + + return this.quadrilaterals; + } + + render() { + (0, _util.unreachable)("Abstract method `AnnotationElement.render` called"); + } + + _getElementsByName(name, skipId = null) { + const fields = []; + + if (this._fieldObjects) { + const fieldObj = this._fieldObjects[name]; + + if (fieldObj) { + for (const { + page, + id, + exportValues + } of fieldObj) { + if (page === -1) { + continue; + } + + if (id === skipId) { + continue; + } + + const exportValue = typeof exportValues === "string" ? exportValues : null; + const domElement = document.getElementById(id); + + if (domElement && !GetElementsByNameSet.has(domElement)) { + (0, _util.warn)(`_getElementsByName - element not allowed: ${id}`); + continue; + } + + fields.push({ + id, + exportValue, + domElement + }); + } + } + + return fields; + } + + for (const domElement of document.getElementsByName(name)) { + const { + id, + exportValue + } = domElement; + + if (id === skipId) { + continue; + } + + if (!GetElementsByNameSet.has(domElement)) { + continue; + } + + fields.push({ + id, + exportValue, + domElement + }); + } + + return fields; + } + + static get platform() { + const platform = typeof navigator !== "undefined" ? navigator.platform : ""; + return (0, _util.shadow)(this, "platform", { + isWin: platform.includes("Win"), + isMac: platform.includes("Mac") + }); + } + +} + +class LinkAnnotationElement extends AnnotationElement { + constructor(parameters, options = null) { + const isRenderable = !!(parameters.data.url || parameters.data.dest || parameters.data.action || parameters.data.isTooltipOnly || parameters.data.resetForm || parameters.data.actions && (parameters.data.actions.Action || parameters.data.actions["Mouse Up"] || parameters.data.actions["Mouse Down"])); + super(parameters, { + isRenderable, + ignoreBorder: !!options?.ignoreBorder, + createQuadrilaterals: true + }); + } + + render() { + const { + data, + linkService + } = this; + const link = document.createElement("a"); + + if (data.url) { + linkService.addLinkAttributes(link, data.url, data.newWindow); + } else if (data.action) { + this._bindNamedAction(link, data.action); + } else if (data.dest) { + this._bindLink(link, data.dest); + } else { + let hasClickAction = false; + + if (data.actions && (data.actions.Action || data.actions["Mouse Up"] || data.actions["Mouse Down"]) && this.enableScripting && this.hasJSActions) { + hasClickAction = true; + + this._bindJSAction(link, data); + } + + if (data.resetForm) { + this._bindResetFormAction(link, data.resetForm); + } else if (!hasClickAction) { + this._bindLink(link, ""); + } + } + + if (this.quadrilaterals) { + return this._renderQuadrilaterals("linkAnnotation").map((quadrilateral, index) => { + const linkElement = index === 0 ? link : link.cloneNode(); + quadrilateral.appendChild(linkElement); + return quadrilateral; + }); + } + + this.container.className = "linkAnnotation"; + this.container.appendChild(link); + return this.container; + } + + _bindLink(link, destination) { + link.href = this.linkService.getDestinationHash(destination); + + link.onclick = () => { + if (destination) { + this.linkService.goToDestination(destination); + } + + return false; + }; + + if (destination || destination === "") { + link.className = "internalLink"; + } + } + + _bindNamedAction(link, action) { + link.href = this.linkService.getAnchorUrl(""); + + link.onclick = () => { + this.linkService.executeNamedAction(action); + return false; + }; + + link.className = "internalLink"; + } + + _bindJSAction(link, data) { + link.href = this.linkService.getAnchorUrl(""); + const map = new Map([["Action", "onclick"], ["Mouse Up", "onmouseup"], ["Mouse Down", "onmousedown"]]); + + for (const name of Object.keys(data.actions)) { + const jsName = map.get(name); + + if (!jsName) { + continue; + } + + link[jsName] = () => { + this.linkService.eventBus?.dispatch("dispatcheventinsandbox", { + source: this, + detail: { + id: data.id, + name + } + }); + return false; + }; + } + + if (!link.onclick) { + link.onclick = () => false; + } + + link.className = "internalLink"; + } + + _bindResetFormAction(link, resetForm) { + const otherClickAction = link.onclick; + + if (!otherClickAction) { + link.href = this.linkService.getAnchorUrl(""); + } + + link.className = "internalLink"; + + if (!this._fieldObjects) { + (0, _util.warn)(`_bindResetFormAction - "resetForm" action not supported, ` + "ensure that the `fieldObjects` parameter is provided."); + + if (!otherClickAction) { + link.onclick = () => false; + } + + return; + } + + link.onclick = () => { + if (otherClickAction) { + otherClickAction(); + } + + const { + fields: resetFormFields, + refs: resetFormRefs, + include + } = resetForm; + const allFields = []; + + if (resetFormFields.length !== 0 || resetFormRefs.length !== 0) { + const fieldIds = new Set(resetFormRefs); + + for (const fieldName of resetFormFields) { + const fields = this._fieldObjects[fieldName] || []; + + for (const { + id + } of fields) { + fieldIds.add(id); + } + } + + for (const fields of Object.values(this._fieldObjects)) { + for (const field of fields) { + if (fieldIds.has(field.id) === include) { + allFields.push(field); + } + } + } + } else { + for (const fields of Object.values(this._fieldObjects)) { + allFields.push(...fields); + } + } + + const storage = this.annotationStorage; + const allIds = []; + + for (const field of allFields) { + const { + id + } = field; + allIds.push(id); + + switch (field.type) { + case "text": + { + const value = field.defaultValue || ""; + storage.setValue(id, { + value + }); + break; + } + + case "checkbox": + case "radiobutton": + { + const value = field.defaultValue === field.exportValues; + storage.setValue(id, { + value + }); + break; + } + + case "combobox": + case "listbox": + { + const value = field.defaultValue || ""; + storage.setValue(id, { + value + }); + break; + } + + default: + continue; + } + + const domElement = document.getElementById(id); + + if (!domElement || !GetElementsByNameSet.has(domElement)) { + continue; + } + + domElement.dispatchEvent(new Event("resetform")); + } + + if (this.enableScripting) { + this.linkService.eventBus?.dispatch("dispatcheventinsandbox", { + source: this, + detail: { + id: "app", + ids: allIds, + name: "ResetForm" + } + }); + } + + return false; + }; + } + +} + +class TextAnnotationElement extends AnnotationElement { + constructor(parameters) { + const isRenderable = !!(parameters.data.hasPopup || parameters.data.titleObj?.str || parameters.data.contentsObj?.str || parameters.data.richText?.str); + super(parameters, { + isRenderable + }); + } + + render() { + this.container.className = "textAnnotation"; + const image = document.createElement("img"); + image.style.height = this.container.style.height; + image.style.width = this.container.style.width; + image.src = this.imageResourcesPath + "annotation-" + this.data.name.toLowerCase() + ".svg"; + image.alt = "[{{type}} Annotation]"; + image.dataset.l10nId = "text_annotation_type"; + image.dataset.l10nArgs = JSON.stringify({ + type: this.data.name + }); + + if (!this.data.hasPopup) { + this._createPopup(image, this.data); + } + + this.container.appendChild(image); + return this.container; + } + +} + +class WidgetAnnotationElement extends AnnotationElement { + render() { + if (this.data.alternativeText) { + this.container.title = this.data.alternativeText; + } + + return this.container; + } + + _getKeyModifier(event) { + const { + isWin, + isMac + } = AnnotationElement.platform; + return isWin && event.ctrlKey || isMac && event.metaKey; + } + + _setEventListener(element, baseName, eventName, valueGetter) { + if (baseName.includes("mouse")) { + element.addEventListener(baseName, event => { + this.linkService.eventBus?.dispatch("dispatcheventinsandbox", { + source: this, + detail: { + id: this.data.id, + name: eventName, + value: valueGetter(event), + shift: event.shiftKey, + modifier: this._getKeyModifier(event) + } + }); + }); + } else { + element.addEventListener(baseName, event => { + this.linkService.eventBus?.dispatch("dispatcheventinsandbox", { + source: this, + detail: { + id: this.data.id, + name: eventName, + value: valueGetter(event) + } + }); + }); + } + } + + _setEventListeners(element, names, getter) { + for (const [baseName, eventName] of names) { + if (eventName === "Action" || this.data.actions?.[eventName]) { + this._setEventListener(element, baseName, eventName, getter); + } + } + } + + _setBackgroundColor(element) { + const color = this.data.backgroundColor || null; + element.style.backgroundColor = color === null ? "transparent" : _util.Util.makeHexColor(color[0], color[1], color[2]); + } + +} + +class TextWidgetAnnotationElement extends WidgetAnnotationElement { + constructor(parameters) { + const isRenderable = parameters.renderForms || !parameters.data.hasAppearance && !!parameters.data.fieldValue; + super(parameters, { + isRenderable + }); + } + + setPropertyOnSiblings(base, key, value, keyInStorage) { + const storage = this.annotationStorage; + + for (const element of this._getElementsByName(base.name, base.id)) { + if (element.domElement) { + element.domElement[key] = value; + } + + storage.setValue(element.id, { + [keyInStorage]: value + }); + } + } + + render() { + const storage = this.annotationStorage; + const id = this.data.id; + this.container.className = "textWidgetAnnotation"; + let element = null; + + if (this.renderForms) { + const storedData = storage.getValue(id, { + value: this.data.fieldValue + }); + const textContent = storedData.formattedValue || storedData.value || ""; + const elementData = { + userValue: null, + formattedValue: null, + valueOnFocus: "" + }; + + if (this.data.multiLine) { + element = document.createElement("textarea"); + element.textContent = textContent; + } else { + element = document.createElement("input"); + element.type = "text"; + element.setAttribute("value", textContent); + } + + GetElementsByNameSet.add(element); + element.disabled = this.data.readOnly; + element.name = this.data.fieldName; + element.tabIndex = DEFAULT_TAB_INDEX; + elementData.userValue = textContent; + element.setAttribute("id", id); + element.addEventListener("input", event => { + storage.setValue(id, { + value: event.target.value + }); + this.setPropertyOnSiblings(element, "value", event.target.value, "value"); + }); + element.addEventListener("resetform", event => { + const defaultValue = this.data.defaultFieldValue ?? ""; + element.value = elementData.userValue = defaultValue; + elementData.formattedValue = null; + }); + + let blurListener = event => { + const { + formattedValue + } = elementData; + + if (formattedValue !== null && formattedValue !== undefined) { + event.target.value = formattedValue; + } + + event.target.scrollLeft = 0; + }; + + if (this.enableScripting && this.hasJSActions) { + element.addEventListener("focus", event => { + if (elementData.userValue) { + event.target.value = elementData.userValue; + } + + elementData.valueOnFocus = event.target.value; + }); + element.addEventListener("updatefromsandbox", jsEvent => { + const actions = { + value(event) { + elementData.userValue = event.detail.value ?? ""; + storage.setValue(id, { + value: elementData.userValue.toString() + }); + event.target.value = elementData.userValue; + }, + + formattedValue(event) { + const { + formattedValue + } = event.detail; + elementData.formattedValue = formattedValue; + + if (formattedValue !== null && formattedValue !== undefined && event.target !== document.activeElement) { + event.target.value = formattedValue; + } + + storage.setValue(id, { + formattedValue + }); + }, + + selRange(event) { + event.target.setSelectionRange(...event.detail.selRange); + } + + }; + + this._dispatchEventFromSandbox(actions, jsEvent); + }); + element.addEventListener("keydown", event => { + let commitKey = -1; + + if (event.key === "Escape") { + commitKey = 0; + } else if (event.key === "Enter") { + commitKey = 2; + } else if (event.key === "Tab") { + commitKey = 3; + } + + if (commitKey === -1) { + return; + } + + const { + value + } = event.target; + + if (elementData.valueOnFocus === value) { + return; + } + + elementData.userValue = value; + this.linkService.eventBus?.dispatch("dispatcheventinsandbox", { + source: this, + detail: { + id, + name: "Keystroke", + value, + willCommit: true, + commitKey, + selStart: event.target.selectionStart, + selEnd: event.target.selectionEnd + } + }); + }); + const _blurListener = blurListener; + blurListener = null; + element.addEventListener("blur", event => { + const { + value + } = event.target; + elementData.userValue = value; + + if (this._mouseState.isDown && elementData.valueOnFocus !== value) { + this.linkService.eventBus?.dispatch("dispatcheventinsandbox", { + source: this, + detail: { + id, + name: "Keystroke", + value, + willCommit: true, + commitKey: 1, + selStart: event.target.selectionStart, + selEnd: event.target.selectionEnd + } + }); + } + + _blurListener(event); + }); + + if (this.data.actions?.Keystroke) { + element.addEventListener("beforeinput", event => { + const { + data, + target + } = event; + const { + value, + selectionStart, + selectionEnd + } = target; + let selStart = selectionStart, + selEnd = selectionEnd; + + switch (event.inputType) { + case "deleteWordBackward": + { + const match = value.substring(0, selectionStart).match(/\w*[^\w]*$/); + + if (match) { + selStart -= match[0].length; + } + + break; + } + + case "deleteWordForward": + { + const match = value.substring(selectionStart).match(/^[^\w]*\w*/); + + if (match) { + selEnd += match[0].length; + } + + break; + } + + case "deleteContentBackward": + if (selectionStart === selectionEnd) { + selStart -= 1; + } + + break; + + case "deleteContentForward": + if (selectionStart === selectionEnd) { + selEnd += 1; + } + + break; + } + + event.preventDefault(); + this.linkService.eventBus?.dispatch("dispatcheventinsandbox", { + source: this, + detail: { + id, + name: "Keystroke", + value, + change: data || "", + willCommit: false, + selStart, + selEnd + } + }); + }); + } + + this._setEventListeners(element, [["focus", "Focus"], ["blur", "Blur"], ["mousedown", "Mouse Down"], ["mouseenter", "Mouse Enter"], ["mouseleave", "Mouse Exit"], ["mouseup", "Mouse Up"]], event => event.target.value); + } + + if (blurListener) { + element.addEventListener("blur", blurListener); + } + + if (this.data.maxLen !== null) { + element.maxLength = this.data.maxLen; + } + + if (this.data.comb) { + const fieldWidth = this.data.rect[2] - this.data.rect[0]; + const combWidth = fieldWidth / this.data.maxLen; + element.classList.add("comb"); + element.style.letterSpacing = `calc(${combWidth}px - 1ch)`; + } + } else { + element = document.createElement("div"); + element.textContent = this.data.fieldValue; + element.style.verticalAlign = "middle"; + element.style.display = "table-cell"; + } + + this._setTextStyle(element); + + this._setBackgroundColor(element); + + this._setDefaultPropertiesFromJS(element); + + this.container.appendChild(element); + return this.container; + } + + _setTextStyle(element) { + const TEXT_ALIGNMENT = ["left", "center", "right"]; + const { + fontSize, + fontColor + } = this.data.defaultAppearanceData; + const style = element.style; + + if (fontSize) { + style.fontSize = `${fontSize}px`; + } + + style.color = _util.Util.makeHexColor(fontColor[0], fontColor[1], fontColor[2]); + + if (this.data.textAlignment !== null) { + style.textAlign = TEXT_ALIGNMENT[this.data.textAlignment]; + } + } + +} + +class CheckboxWidgetAnnotationElement extends WidgetAnnotationElement { + constructor(parameters) { + super(parameters, { + isRenderable: parameters.renderForms + }); + } + + render() { + const storage = this.annotationStorage; + const data = this.data; + const id = data.id; + let value = storage.getValue(id, { + value: data.exportValue === data.fieldValue + }).value; + + if (typeof value === "string") { + value = value !== "Off"; + storage.setValue(id, { + value + }); + } + + this.container.className = "buttonWidgetAnnotation checkBox"; + const element = document.createElement("input"); + GetElementsByNameSet.add(element); + element.disabled = data.readOnly; + element.type = "checkbox"; + element.name = data.fieldName; + + if (value) { + element.setAttribute("checked", true); + } + + element.setAttribute("id", id); + element.setAttribute("exportValue", data.exportValue); + element.tabIndex = DEFAULT_TAB_INDEX; + element.addEventListener("change", event => { + const { + name, + checked + } = event.target; + + for (const checkbox of this._getElementsByName(name, id)) { + const curChecked = checked && checkbox.exportValue === data.exportValue; + + if (checkbox.domElement) { + checkbox.domElement.checked = curChecked; + } + + storage.setValue(checkbox.id, { + value: curChecked + }); + } + + storage.setValue(id, { + value: checked + }); + }); + element.addEventListener("resetform", event => { + const defaultValue = data.defaultFieldValue || "Off"; + event.target.checked = defaultValue === data.exportValue; + }); + + if (this.enableScripting && this.hasJSActions) { + element.addEventListener("updatefromsandbox", jsEvent => { + const actions = { + value(event) { + event.target.checked = event.detail.value !== "Off"; + storage.setValue(id, { + value: event.target.checked + }); + } + + }; + + this._dispatchEventFromSandbox(actions, jsEvent); + }); + + this._setEventListeners(element, [["change", "Validate"], ["change", "Action"], ["focus", "Focus"], ["blur", "Blur"], ["mousedown", "Mouse Down"], ["mouseenter", "Mouse Enter"], ["mouseleave", "Mouse Exit"], ["mouseup", "Mouse Up"]], event => event.target.checked); + } + + this._setBackgroundColor(element); + + this._setDefaultPropertiesFromJS(element); + + this.container.appendChild(element); + return this.container; + } + +} + +class RadioButtonWidgetAnnotationElement extends WidgetAnnotationElement { + constructor(parameters) { + super(parameters, { + isRenderable: parameters.renderForms + }); + } + + render() { + this.container.className = "buttonWidgetAnnotation radioButton"; + const storage = this.annotationStorage; + const data = this.data; + const id = data.id; + let value = storage.getValue(id, { + value: data.fieldValue === data.buttonValue + }).value; + + if (typeof value === "string") { + value = value !== data.buttonValue; + storage.setValue(id, { + value + }); + } + + const element = document.createElement("input"); + GetElementsByNameSet.add(element); + element.disabled = data.readOnly; + element.type = "radio"; + element.name = data.fieldName; + + if (value) { + element.setAttribute("checked", true); + } + + element.setAttribute("id", id); + element.tabIndex = DEFAULT_TAB_INDEX; + element.addEventListener("change", event => { + const { + name, + checked + } = event.target; + + for (const radio of this._getElementsByName(name, id)) { + storage.setValue(radio.id, { + value: false + }); + } + + storage.setValue(id, { + value: checked + }); + }); + element.addEventListener("resetform", event => { + const defaultValue = data.defaultFieldValue; + event.target.checked = defaultValue !== null && defaultValue !== undefined && defaultValue === data.buttonValue; + }); + + if (this.enableScripting && this.hasJSActions) { + const pdfButtonValue = data.buttonValue; + element.addEventListener("updatefromsandbox", jsEvent => { + const actions = { + value: event => { + const checked = pdfButtonValue === event.detail.value; + + for (const radio of this._getElementsByName(event.target.name)) { + const curChecked = checked && radio.id === id; + + if (radio.domElement) { + radio.domElement.checked = curChecked; + } + + storage.setValue(radio.id, { + value: curChecked + }); + } + } + }; + + this._dispatchEventFromSandbox(actions, jsEvent); + }); + + this._setEventListeners(element, [["change", "Validate"], ["change", "Action"], ["focus", "Focus"], ["blur", "Blur"], ["mousedown", "Mouse Down"], ["mouseenter", "Mouse Enter"], ["mouseleave", "Mouse Exit"], ["mouseup", "Mouse Up"]], event => event.target.checked); + } + + this._setBackgroundColor(element); + + this._setDefaultPropertiesFromJS(element); + + this.container.appendChild(element); + return this.container; + } + +} + +class PushButtonWidgetAnnotationElement extends LinkAnnotationElement { + constructor(parameters) { + super(parameters, { + ignoreBorder: parameters.data.hasAppearance + }); + } + + render() { + const container = super.render(); + container.className = "buttonWidgetAnnotation pushButton"; + + if (this.data.alternativeText) { + container.title = this.data.alternativeText; + } + + this._setDefaultPropertiesFromJS(container); + + return container; + } + +} + +class ChoiceWidgetAnnotationElement extends WidgetAnnotationElement { + constructor(parameters) { + super(parameters, { + isRenderable: parameters.renderForms + }); + } + + render() { + this.container.className = "choiceWidgetAnnotation"; + const storage = this.annotationStorage; + const id = this.data.id; + const storedData = storage.getValue(id, { + value: this.data.fieldValue + }); + let { + fontSize + } = this.data.defaultAppearanceData; + + if (!fontSize) { + fontSize = 9; + } + + const fontSizeStyle = `calc(${fontSize}px * var(--zoom-factor))`; + const selectElement = document.createElement("select"); + GetElementsByNameSet.add(selectElement); + selectElement.disabled = this.data.readOnly; + selectElement.name = this.data.fieldName; + selectElement.setAttribute("id", id); + selectElement.tabIndex = DEFAULT_TAB_INDEX; + selectElement.style.fontSize = `${fontSize}px`; + + if (!this.data.combo) { + selectElement.size = this.data.options.length; + + if (this.data.multiSelect) { + selectElement.multiple = true; + } + } + + selectElement.addEventListener("resetform", event => { + const defaultValue = this.data.defaultFieldValue; + + for (const option of selectElement.options) { + option.selected = option.value === defaultValue; + } + }); + + for (const option of this.data.options) { + const optionElement = document.createElement("option"); + optionElement.textContent = option.displayValue; + optionElement.value = option.exportValue; + + if (this.data.combo) { + optionElement.style.fontSize = fontSizeStyle; + } + + if (storedData.value.includes(option.exportValue)) { + optionElement.setAttribute("selected", true); + } + + selectElement.appendChild(optionElement); + } + + const getValue = (event, isExport) => { + const name = isExport ? "value" : "textContent"; + const options = event.target.options; + + if (!event.target.multiple) { + return options.selectedIndex === -1 ? null : options[options.selectedIndex][name]; + } + + return Array.prototype.filter.call(options, option => option.selected).map(option => option[name]); + }; + + const getItems = event => { + const options = event.target.options; + return Array.prototype.map.call(options, option => { + return { + displayValue: option.textContent, + exportValue: option.value + }; + }); + }; + + if (this.enableScripting && this.hasJSActions) { + selectElement.addEventListener("updatefromsandbox", jsEvent => { + const actions = { + value(event) { + const value = event.detail.value; + const values = new Set(Array.isArray(value) ? value : [value]); + + for (const option of selectElement.options) { + option.selected = values.has(option.value); + } + + storage.setValue(id, { + value: getValue(event, true) + }); + }, + + multipleSelection(event) { + selectElement.multiple = true; + }, + + remove(event) { + const options = selectElement.options; + const index = event.detail.remove; + options[index].selected = false; + selectElement.remove(index); + + if (options.length > 0) { + const i = Array.prototype.findIndex.call(options, option => option.selected); + + if (i === -1) { + options[0].selected = true; + } + } + + storage.setValue(id, { + value: getValue(event, true), + items: getItems(event) + }); + }, + + clear(event) { + while (selectElement.length !== 0) { + selectElement.remove(0); + } + + storage.setValue(id, { + value: null, + items: [] + }); + }, + + insert(event) { + const { + index, + displayValue, + exportValue + } = event.detail.insert; + const optionElement = document.createElement("option"); + optionElement.textContent = displayValue; + optionElement.value = exportValue; + selectElement.insertBefore(optionElement, selectElement.children[index]); + storage.setValue(id, { + value: getValue(event, true), + items: getItems(event) + }); + }, + + items(event) { + const { + items + } = event.detail; + + while (selectElement.length !== 0) { + selectElement.remove(0); + } + + for (const item of items) { + const { + displayValue, + exportValue + } = item; + const optionElement = document.createElement("option"); + optionElement.textContent = displayValue; + optionElement.value = exportValue; + selectElement.appendChild(optionElement); + } + + if (selectElement.options.length > 0) { + selectElement.options[0].selected = true; + } + + storage.setValue(id, { + value: getValue(event, true), + items: getItems(event) + }); + }, + + indices(event) { + const indices = new Set(event.detail.indices); + + for (const option of event.target.options) { + option.selected = indices.has(option.index); + } + + storage.setValue(id, { + value: getValue(event, true) + }); + }, + + editable(event) { + event.target.disabled = !event.detail.editable; + } + + }; + + this._dispatchEventFromSandbox(actions, jsEvent); + }); + selectElement.addEventListener("input", event => { + const exportValue = getValue(event, true); + const value = getValue(event, false); + storage.setValue(id, { + value: exportValue + }); + this.linkService.eventBus?.dispatch("dispatcheventinsandbox", { + source: this, + detail: { + id, + name: "Keystroke", + value, + changeEx: exportValue, + willCommit: true, + commitKey: 1, + keyDown: false + } + }); + }); + + this._setEventListeners(selectElement, [["focus", "Focus"], ["blur", "Blur"], ["mousedown", "Mouse Down"], ["mouseenter", "Mouse Enter"], ["mouseleave", "Mouse Exit"], ["mouseup", "Mouse Up"], ["input", "Action"]], event => event.target.checked); + } else { + selectElement.addEventListener("input", function (event) { + storage.setValue(id, { + value: getValue(event, true) + }); + }); + } + + this._setBackgroundColor(selectElement); + + this._setDefaultPropertiesFromJS(selectElement); + + this.container.appendChild(selectElement); + return this.container; + } + +} + +class PopupAnnotationElement extends AnnotationElement { + constructor(parameters) { + const isRenderable = !!(parameters.data.titleObj?.str || parameters.data.contentsObj?.str || parameters.data.richText?.str); + super(parameters, { + isRenderable + }); + } + + render() { + const IGNORE_TYPES = ["Line", "Square", "Circle", "PolyLine", "Polygon", "Ink"]; + this.container.className = "popupAnnotation"; + + if (IGNORE_TYPES.includes(this.data.parentType)) { + return this.container; + } + + const selector = `[data-annotation-id="${this.data.parentId}"]`; + const parentElements = this.layer.querySelectorAll(selector); + + if (parentElements.length === 0) { + return this.container; + } + + const popup = new PopupElement({ + container: this.container, + trigger: Array.from(parentElements), + color: this.data.color, + titleObj: this.data.titleObj, + modificationDate: this.data.modificationDate, + contentsObj: this.data.contentsObj, + richText: this.data.richText + }); + const page = this.page; + + const rect = _util.Util.normalizeRect([this.data.parentRect[0], page.view[3] - this.data.parentRect[1] + page.view[1], this.data.parentRect[2], page.view[3] - this.data.parentRect[3] + page.view[1]]); + + const popupLeft = rect[0] + this.data.parentRect[2] - this.data.parentRect[0]; + const popupTop = rect[1]; + this.container.style.transformOrigin = `${-popupLeft}px ${-popupTop}px`; + this.container.style.left = `${popupLeft}px`; + this.container.style.top = `${popupTop}px`; + this.container.appendChild(popup.render()); + return this.container; + } + +} + +class PopupElement { + constructor(parameters) { + this.container = parameters.container; + this.trigger = parameters.trigger; + this.color = parameters.color; + this.titleObj = parameters.titleObj; + this.modificationDate = parameters.modificationDate; + this.contentsObj = parameters.contentsObj; + this.richText = parameters.richText; + this.hideWrapper = parameters.hideWrapper || false; + this.pinned = false; + } + + render() { + const BACKGROUND_ENLIGHT = 0.7; + const wrapper = document.createElement("div"); + wrapper.className = "popupWrapper"; + this.hideElement = this.hideWrapper ? wrapper : this.container; + this.hideElement.hidden = true; + const popup = document.createElement("div"); + popup.className = "popup"; + const color = this.color; + + if (color) { + const r = BACKGROUND_ENLIGHT * (255 - color[0]) + color[0]; + const g = BACKGROUND_ENLIGHT * (255 - color[1]) + color[1]; + const b = BACKGROUND_ENLIGHT * (255 - color[2]) + color[2]; + popup.style.backgroundColor = _util.Util.makeHexColor(r | 0, g | 0, b | 0); + } + + const title = document.createElement("h1"); + title.dir = this.titleObj.dir; + title.textContent = this.titleObj.str; + popup.appendChild(title); + + const dateObject = _display_utils.PDFDateString.toDateObject(this.modificationDate); + + if (dateObject) { + const modificationDate = document.createElement("span"); + modificationDate.className = "popupDate"; + modificationDate.textContent = "{{date}}, {{time}}"; + modificationDate.dataset.l10nId = "annotation_date_string"; + modificationDate.dataset.l10nArgs = JSON.stringify({ + date: dateObject.toLocaleDateString(), + time: dateObject.toLocaleTimeString() + }); + popup.appendChild(modificationDate); + } + + if (this.richText?.str && (!this.contentsObj?.str || this.contentsObj.str === this.richText.str)) { + _xfa_layer.XfaLayer.render({ + xfaHtml: this.richText.html, + intent: "richText", + div: popup + }); + + popup.lastChild.className = "richText popupContent"; + } else { + const contents = this._formatContents(this.contentsObj); + + popup.appendChild(contents); + } + + if (!Array.isArray(this.trigger)) { + this.trigger = [this.trigger]; + } + + for (const element of this.trigger) { + element.addEventListener("click", this._toggle.bind(this)); + element.addEventListener("mouseover", this._show.bind(this, false)); + element.addEventListener("mouseout", this._hide.bind(this, false)); + } + + popup.addEventListener("click", this._hide.bind(this, true)); + wrapper.appendChild(popup); + return wrapper; + } + + _formatContents({ + str, + dir + }) { + const p = document.createElement("p"); + p.className = "popupContent"; + p.dir = dir; + const lines = str.split(/(?:\r\n?|\n)/); + + for (let i = 0, ii = lines.length; i < ii; ++i) { + const line = lines[i]; + p.appendChild(document.createTextNode(line)); + + if (i < ii - 1) { + p.appendChild(document.createElement("br")); + } + } + + return p; + } + + _toggle() { + if (this.pinned) { + this._hide(true); + } else { + this._show(true); + } + } + + _show(pin = false) { + if (pin) { + this.pinned = true; + } + + if (this.hideElement.hidden) { + this.hideElement.hidden = false; + this.container.style.zIndex += 1; + } + } + + _hide(unpin = true) { + if (unpin) { + this.pinned = false; + } + + if (!this.hideElement.hidden && !this.pinned) { + this.hideElement.hidden = true; + this.container.style.zIndex -= 1; + } + } + +} + +class FreeTextAnnotationElement extends AnnotationElement { + constructor(parameters) { + const isRenderable = !!(parameters.data.hasPopup || parameters.data.titleObj?.str || parameters.data.contentsObj?.str || parameters.data.richText?.str); + super(parameters, { + isRenderable, + ignoreBorder: true + }); + } + + render() { + this.container.className = "freeTextAnnotation"; + + if (!this.data.hasPopup) { + this._createPopup(null, this.data); + } + + return this.container; + } + +} + +class LineAnnotationElement extends AnnotationElement { + constructor(parameters) { + const isRenderable = !!(parameters.data.hasPopup || parameters.data.titleObj?.str || parameters.data.contentsObj?.str || parameters.data.richText?.str); + super(parameters, { + isRenderable, + ignoreBorder: true + }); + } + + render() { + this.container.className = "lineAnnotation"; + const data = this.data; + const { + width, + height + } = getRectDims(data.rect); + const svg = this.svgFactory.create(width, height); + const line = this.svgFactory.createElement("svg:line"); + line.setAttribute("x1", data.rect[2] - data.lineCoordinates[0]); + line.setAttribute("y1", data.rect[3] - data.lineCoordinates[1]); + line.setAttribute("x2", data.rect[2] - data.lineCoordinates[2]); + line.setAttribute("y2", data.rect[3] - data.lineCoordinates[3]); + line.setAttribute("stroke-width", data.borderStyle.width || 1); + line.setAttribute("stroke", "transparent"); + line.setAttribute("fill", "transparent"); + svg.appendChild(line); + this.container.append(svg); + + this._createPopup(line, data); + + return this.container; + } + +} + +class SquareAnnotationElement extends AnnotationElement { + constructor(parameters) { + const isRenderable = !!(parameters.data.hasPopup || parameters.data.titleObj?.str || parameters.data.contentsObj?.str || parameters.data.richText?.str); + super(parameters, { + isRenderable, + ignoreBorder: true + }); + } + + render() { + this.container.className = "squareAnnotation"; + const data = this.data; + const { + width, + height + } = getRectDims(data.rect); + const svg = this.svgFactory.create(width, height); + const borderWidth = data.borderStyle.width; + const square = this.svgFactory.createElement("svg:rect"); + square.setAttribute("x", borderWidth / 2); + square.setAttribute("y", borderWidth / 2); + square.setAttribute("width", width - borderWidth); + square.setAttribute("height", height - borderWidth); + square.setAttribute("stroke-width", borderWidth || 1); + square.setAttribute("stroke", "transparent"); + square.setAttribute("fill", "transparent"); + svg.appendChild(square); + this.container.append(svg); + + this._createPopup(square, data); + + return this.container; + } + +} + +class CircleAnnotationElement extends AnnotationElement { + constructor(parameters) { + const isRenderable = !!(parameters.data.hasPopup || parameters.data.titleObj?.str || parameters.data.contentsObj?.str || parameters.data.richText?.str); + super(parameters, { + isRenderable, + ignoreBorder: true + }); + } + + render() { + this.container.className = "circleAnnotation"; + const data = this.data; + const { + width, + height + } = getRectDims(data.rect); + const svg = this.svgFactory.create(width, height); + const borderWidth = data.borderStyle.width; + const circle = this.svgFactory.createElement("svg:ellipse"); + circle.setAttribute("cx", width / 2); + circle.setAttribute("cy", height / 2); + circle.setAttribute("rx", width / 2 - borderWidth / 2); + circle.setAttribute("ry", height / 2 - borderWidth / 2); + circle.setAttribute("stroke-width", borderWidth || 1); + circle.setAttribute("stroke", "transparent"); + circle.setAttribute("fill", "transparent"); + svg.appendChild(circle); + this.container.append(svg); + + this._createPopup(circle, data); + + return this.container; + } + +} + +class PolylineAnnotationElement extends AnnotationElement { + constructor(parameters) { + const isRenderable = !!(parameters.data.hasPopup || parameters.data.titleObj?.str || parameters.data.contentsObj?.str || parameters.data.richText?.str); + super(parameters, { + isRenderable, + ignoreBorder: true + }); + this.containerClassName = "polylineAnnotation"; + this.svgElementName = "svg:polyline"; + } + + render() { + this.container.className = this.containerClassName; + const data = this.data; + const { + width, + height + } = getRectDims(data.rect); + const svg = this.svgFactory.create(width, height); + let points = []; + + for (const coordinate of data.vertices) { + const x = coordinate.x - data.rect[0]; + const y = data.rect[3] - coordinate.y; + points.push(x + "," + y); + } + + points = points.join(" "); + const polyline = this.svgFactory.createElement(this.svgElementName); + polyline.setAttribute("points", points); + polyline.setAttribute("stroke-width", data.borderStyle.width || 1); + polyline.setAttribute("stroke", "transparent"); + polyline.setAttribute("fill", "transparent"); + svg.appendChild(polyline); + this.container.append(svg); + + this._createPopup(polyline, data); + + return this.container; + } + +} + +class PolygonAnnotationElement extends PolylineAnnotationElement { + constructor(parameters) { + super(parameters); + this.containerClassName = "polygonAnnotation"; + this.svgElementName = "svg:polygon"; + } + +} + +class CaretAnnotationElement extends AnnotationElement { + constructor(parameters) { + const isRenderable = !!(parameters.data.hasPopup || parameters.data.titleObj?.str || parameters.data.contentsObj?.str || parameters.data.richText?.str); + super(parameters, { + isRenderable, + ignoreBorder: true + }); + } + + render() { + this.container.className = "caretAnnotation"; + + if (!this.data.hasPopup) { + this._createPopup(null, this.data); + } + + return this.container; + } + +} + +class InkAnnotationElement extends AnnotationElement { + constructor(parameters) { + const isRenderable = !!(parameters.data.hasPopup || parameters.data.titleObj?.str || parameters.data.contentsObj?.str || parameters.data.richText?.str); + super(parameters, { + isRenderable, + ignoreBorder: true + }); + this.containerClassName = "inkAnnotation"; + this.svgElementName = "svg:polyline"; + } + + render() { + this.container.className = this.containerClassName; + const data = this.data; + const { + width, + height + } = getRectDims(data.rect); + const svg = this.svgFactory.create(width, height); + + for (const inkList of data.inkLists) { + let points = []; + + for (const coordinate of inkList) { + const x = coordinate.x - data.rect[0]; + const y = data.rect[3] - coordinate.y; + points.push(`${x},${y}`); + } + + points = points.join(" "); + const polyline = this.svgFactory.createElement(this.svgElementName); + polyline.setAttribute("points", points); + polyline.setAttribute("stroke-width", data.borderStyle.width || 1); + polyline.setAttribute("stroke", "transparent"); + polyline.setAttribute("fill", "transparent"); + + this._createPopup(polyline, data); + + svg.appendChild(polyline); + } + + this.container.append(svg); + return this.container; + } + +} + +class HighlightAnnotationElement extends AnnotationElement { + constructor(parameters) { + const isRenderable = !!(parameters.data.hasPopup || parameters.data.titleObj?.str || parameters.data.contentsObj?.str || parameters.data.richText?.str); + super(parameters, { + isRenderable, + ignoreBorder: true, + createQuadrilaterals: true + }); + } + + render() { + if (!this.data.hasPopup) { + this._createPopup(null, this.data); + } + + if (this.quadrilaterals) { + return this._renderQuadrilaterals("highlightAnnotation"); + } + + this.container.className = "highlightAnnotation"; + return this.container; + } + +} + +class UnderlineAnnotationElement extends AnnotationElement { + constructor(parameters) { + const isRenderable = !!(parameters.data.hasPopup || parameters.data.titleObj?.str || parameters.data.contentsObj?.str || parameters.data.richText?.str); + super(parameters, { + isRenderable, + ignoreBorder: true, + createQuadrilaterals: true + }); + } + + render() { + if (!this.data.hasPopup) { + this._createPopup(null, this.data); + } + + if (this.quadrilaterals) { + return this._renderQuadrilaterals("underlineAnnotation"); + } + + this.container.className = "underlineAnnotation"; + return this.container; + } + +} + +class SquigglyAnnotationElement extends AnnotationElement { + constructor(parameters) { + const isRenderable = !!(parameters.data.hasPopup || parameters.data.titleObj?.str || parameters.data.contentsObj?.str || parameters.data.richText?.str); + super(parameters, { + isRenderable, + ignoreBorder: true, + createQuadrilaterals: true + }); + } + + render() { + if (!this.data.hasPopup) { + this._createPopup(null, this.data); + } + + if (this.quadrilaterals) { + return this._renderQuadrilaterals("squigglyAnnotation"); + } + + this.container.className = "squigglyAnnotation"; + return this.container; + } + +} + +class StrikeOutAnnotationElement extends AnnotationElement { + constructor(parameters) { + const isRenderable = !!(parameters.data.hasPopup || parameters.data.titleObj?.str || parameters.data.contentsObj?.str || parameters.data.richText?.str); + super(parameters, { + isRenderable, + ignoreBorder: true, + createQuadrilaterals: true + }); + } + + render() { + if (!this.data.hasPopup) { + this._createPopup(null, this.data); + } + + if (this.quadrilaterals) { + return this._renderQuadrilaterals("strikeoutAnnotation"); + } + + this.container.className = "strikeoutAnnotation"; + return this.container; + } + +} + +class StampAnnotationElement extends AnnotationElement { + constructor(parameters) { + const isRenderable = !!(parameters.data.hasPopup || parameters.data.titleObj?.str || parameters.data.contentsObj?.str || parameters.data.richText?.str); + super(parameters, { + isRenderable, + ignoreBorder: true + }); + } + + render() { + this.container.className = "stampAnnotation"; + + if (!this.data.hasPopup) { + this._createPopup(null, this.data); + } + + return this.container; + } + +} + +class FileAttachmentAnnotationElement extends AnnotationElement { + constructor(parameters) { + super(parameters, { + isRenderable: true + }); + const { + filename, + content + } = this.data.file; + this.filename = (0, _display_utils.getFilenameFromUrl)(filename); + this.content = content; + this.linkService.eventBus?.dispatch("fileattachmentannotation", { + source: this, + filename, + content + }); + } + + render() { + this.container.className = "fileAttachmentAnnotation"; + const trigger = document.createElement("div"); + trigger.style.height = this.container.style.height; + trigger.style.width = this.container.style.width; + trigger.addEventListener("dblclick", this._download.bind(this)); + + if (!this.data.hasPopup && (this.data.titleObj?.str || this.data.contentsObj?.str || this.data.richText)) { + this._createPopup(trigger, this.data); + } + + this.container.appendChild(trigger); + return this.container; + } + + _download() { + this.downloadManager?.openOrDownloadData(this.container, this.content, this.filename); + } + +} + +class AnnotationLayer { + static render(parameters) { + const sortedAnnotations = [], + popupAnnotations = []; + + for (const data of parameters.annotations) { + if (!data) { + continue; + } + + const { + width, + height + } = getRectDims(data.rect); + + if (width <= 0 || height <= 0) { + continue; + } + + if (data.annotationType === _util.AnnotationType.POPUP) { + popupAnnotations.push(data); + continue; + } + + sortedAnnotations.push(data); + } + + if (popupAnnotations.length) { + sortedAnnotations.push(...popupAnnotations); + } + + const div = parameters.div; + + for (const data of sortedAnnotations) { + const element = AnnotationElementFactory.create({ + data, + layer: div, + page: parameters.page, + viewport: parameters.viewport, + linkService: parameters.linkService, + downloadManager: parameters.downloadManager, + imageResourcesPath: parameters.imageResourcesPath || "", + renderForms: parameters.renderForms !== false, + svgFactory: new _display_utils.DOMSVGFactory(), + annotationStorage: parameters.annotationStorage || new _annotation_storage.AnnotationStorage(), + enableScripting: parameters.enableScripting, + hasJSActions: parameters.hasJSActions, + fieldObjects: parameters.fieldObjects, + mouseState: parameters.mouseState || { + isDown: false + } + }); + + if (element.isRenderable) { + const rendered = element.render(); + + if (data.hidden) { + rendered.style.visibility = "hidden"; + } + + if (Array.isArray(rendered)) { + for (const renderedElement of rendered) { + div.appendChild(renderedElement); + } + } else { + if (element instanceof PopupAnnotationElement) { + div.prepend(rendered); + } else { + div.appendChild(rendered); + } + } + } + } + + this.#setAnnotationCanvasMap(div, parameters.annotationCanvasMap); + } + + static update(parameters) { + const { + page, + viewport, + annotations, + annotationCanvasMap, + div + } = parameters; + const transform = viewport.transform; + const matrix = `matrix(${transform.join(",")})`; + let scale, ownMatrix; + + for (const data of annotations) { + const elements = div.querySelectorAll(`[data-annotation-id="${data.id}"]`); + + if (elements) { + for (const element of elements) { + if (data.hasOwnCanvas) { + const rect = _util.Util.normalizeRect([data.rect[0], page.view[3] - data.rect[1] + page.view[1], data.rect[2], page.view[3] - data.rect[3] + page.view[1]]); + + if (!ownMatrix) { + scale = Math.abs(transform[0] || transform[1]); + const ownTransform = transform.slice(); + + for (let i = 0; i < 4; i++) { + ownTransform[i] = Math.sign(ownTransform[i]); + } + + ownMatrix = `matrix(${ownTransform.join(",")})`; + } + + const left = rect[0] * scale; + const top = rect[1] * scale; + element.style.left = `${left}px`; + element.style.top = `${top}px`; + element.style.transformOrigin = `${-left}px ${-top}px`; + element.style.transform = ownMatrix; + } else { + element.style.transform = matrix; + } + } + } + } + + this.#setAnnotationCanvasMap(div, annotationCanvasMap); + div.hidden = false; + } + + static #setAnnotationCanvasMap(div, annotationCanvasMap) { + if (!annotationCanvasMap) { + return; + } + + for (const [id, canvas] of annotationCanvasMap) { + const element = div.querySelector(`[data-annotation-id="${id}"]`); + + if (!element) { + continue; + } + + const { + firstChild + } = element; + + if (firstChild.nodeName === "CANVAS") { + element.replaceChild(canvas, firstChild); + } else { + element.insertBefore(canvas, firstChild); + } + } + + annotationCanvasMap.clear(); + } + +} + +exports.AnnotationLayer = AnnotationLayer; + +/***/ }), +/* 21 */ +/***/ ((__unused_webpack_module, exports) => { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.ColorConverters = void 0; + +function makeColorComp(n) { + return Math.floor(Math.max(0, Math.min(1, n)) * 255).toString(16).padStart(2, "0"); +} + +class ColorConverters { + static CMYK_G([c, y, m, k]) { + return ["G", 1 - Math.min(1, 0.3 * c + 0.59 * m + 0.11 * y + k)]; + } + + static G_CMYK([g]) { + return ["CMYK", 0, 0, 0, 1 - g]; + } + + static G_RGB([g]) { + return ["RGB", g, g, g]; + } + + static G_HTML([g]) { + const G = makeColorComp(g); + return `#${G}${G}${G}`; + } + + static RGB_G([r, g, b]) { + return ["G", 0.3 * r + 0.59 * g + 0.11 * b]; + } + + static RGB_HTML([r, g, b]) { + const R = makeColorComp(r); + const G = makeColorComp(g); + const B = makeColorComp(b); + return `#${R}${G}${B}`; + } + + static T_HTML() { + return "#00000000"; + } + + static CMYK_RGB([c, y, m, k]) { + return ["RGB", 1 - Math.min(1, c + k), 1 - Math.min(1, m + k), 1 - Math.min(1, y + k)]; + } + + static CMYK_HTML(components) { + return this.RGB_HTML(this.CMYK_RGB(components)); + } + + static RGB_CMYK([r, g, b]) { + const c = 1 - r; + const m = 1 - g; + const y = 1 - b; + const k = Math.min(c, m, y); + return ["CMYK", c, m, y, k]; + } + +} + +exports.ColorConverters = ColorConverters; + +/***/ }), +/* 22 */ +/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.XfaLayer = void 0; + +var _xfa_text = __w_pdfjs_require__(18); + +class XfaLayer { + static setupStorage(html, id, element, storage, intent) { + const storedData = storage.getValue(id, { + value: null + }); + + switch (element.name) { + case "textarea": + if (storedData.value !== null) { + html.textContent = storedData.value; + } + + if (intent === "print") { + break; + } + + html.addEventListener("input", event => { + storage.setValue(id, { + value: event.target.value + }); + }); + break; + + case "input": + if (element.attributes.type === "radio" || element.attributes.type === "checkbox") { + if (storedData.value === element.attributes.xfaOn) { + html.setAttribute("checked", true); + } else if (storedData.value === element.attributes.xfaOff) { + html.removeAttribute("checked"); + } + + if (intent === "print") { + break; + } + + html.addEventListener("change", event => { + storage.setValue(id, { + value: event.target.checked ? event.target.getAttribute("xfaOn") : event.target.getAttribute("xfaOff") + }); + }); + } else { + if (storedData.value !== null) { + html.setAttribute("value", storedData.value); + } + + if (intent === "print") { + break; + } + + html.addEventListener("input", event => { + storage.setValue(id, { + value: event.target.value + }); + }); + } + + break; + + case "select": + if (storedData.value !== null) { + for (const option of element.children) { + if (option.attributes.value === storedData.value) { + option.attributes.selected = true; + } + } + } + + html.addEventListener("input", event => { + const options = event.target.options; + const value = options.selectedIndex === -1 ? "" : options[options.selectedIndex].value; + storage.setValue(id, { + value + }); + }); + break; + } + } + + static setAttributes({ + html, + element, + storage = null, + intent, + linkService + }) { + const { + attributes + } = element; + const isHTMLAnchorElement = html instanceof HTMLAnchorElement; + + if (attributes.type === "radio") { + attributes.name = `${attributes.name}-${intent}`; + } + + for (const [key, value] of Object.entries(attributes)) { + if (value === null || value === undefined || key === "dataId") { + continue; + } + + if (key !== "style") { + if (key === "textContent") { + html.textContent = value; + } else if (key === "class") { + if (value.length) { + html.setAttribute(key, value.join(" ")); + } + } else { + if (isHTMLAnchorElement && (key === "href" || key === "newWindow")) { + continue; + } + + html.setAttribute(key, value); + } + } else { + Object.assign(html.style, value); + } + } + + if (isHTMLAnchorElement) { + linkService.addLinkAttributes(html, attributes.href, attributes.newWindow); + } + + if (storage && attributes.dataId) { + this.setupStorage(html, attributes.dataId, element, storage); + } + } + + static render(parameters) { + const storage = parameters.annotationStorage; + const linkService = parameters.linkService; + const root = parameters.xfaHtml; + const intent = parameters.intent || "display"; + const rootHtml = document.createElement(root.name); + + if (root.attributes) { + this.setAttributes({ + html: rootHtml, + element: root, + intent, + linkService + }); + } + + const stack = [[root, -1, rootHtml]]; + const rootDiv = parameters.div; + rootDiv.appendChild(rootHtml); + + if (parameters.viewport) { + const transform = `matrix(${parameters.viewport.transform.join(",")})`; + rootDiv.style.transform = transform; + } + + if (intent !== "richText") { + rootDiv.setAttribute("class", "xfaLayer xfaFont"); + } + + const textDivs = []; + + while (stack.length > 0) { + const [parent, i, html] = stack[stack.length - 1]; + + if (i + 1 === parent.children.length) { + stack.pop(); + continue; + } + + const child = parent.children[++stack[stack.length - 1][1]]; + + if (child === null) { + continue; + } + + const { + name + } = child; + + if (name === "#text") { + const node = document.createTextNode(child.value); + textDivs.push(node); + html.appendChild(node); + continue; + } + + let childHtml; + + if (child?.attributes?.xmlns) { + childHtml = document.createElementNS(child.attributes.xmlns, name); + } else { + childHtml = document.createElement(name); + } + + html.appendChild(childHtml); + + if (child.attributes) { + this.setAttributes({ + html: childHtml, + element: child, + storage, + intent, + linkService + }); + } + + if (child.children && child.children.length > 0) { + stack.push([child, -1, childHtml]); + } else if (child.value) { + const node = document.createTextNode(child.value); + + if (_xfa_text.XfaText.shouldBuildText(name)) { + textDivs.push(node); + } + + childHtml.appendChild(node); + } + } + + for (const el of rootDiv.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea")) { + el.setAttribute("readOnly", true); + } + + return { + textDivs + }; + } + + static update(parameters) { + const transform = `matrix(${parameters.viewport.transform.join(",")})`; + parameters.div.style.transform = transform; + parameters.div.hidden = false; + } + +} + +exports.XfaLayer = XfaLayer; + +/***/ }), +/* 23 */ +/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.renderTextLayer = renderTextLayer; + +var _util = __w_pdfjs_require__(1); + +const MAX_TEXT_DIVS_TO_RENDER = 100000; +const DEFAULT_FONT_SIZE = 30; +const DEFAULT_FONT_ASCENT = 0.8; +const ascentCache = new Map(); +const AllWhitespaceRegexp = /^\s+$/g; + +function getAscent(fontFamily, ctx) { + const cachedAscent = ascentCache.get(fontFamily); + + if (cachedAscent) { + return cachedAscent; + } + + ctx.save(); + ctx.font = `${DEFAULT_FONT_SIZE}px ${fontFamily}`; + const metrics = ctx.measureText(""); + let ascent = metrics.fontBoundingBoxAscent; + let descent = Math.abs(metrics.fontBoundingBoxDescent); + + if (ascent) { + ctx.restore(); + const ratio = ascent / (ascent + descent); + ascentCache.set(fontFamily, ratio); + return ratio; + } + + ctx.strokeStyle = "red"; + ctx.clearRect(0, 0, DEFAULT_FONT_SIZE, DEFAULT_FONT_SIZE); + ctx.strokeText("g", 0, 0); + let pixels = ctx.getImageData(0, 0, DEFAULT_FONT_SIZE, DEFAULT_FONT_SIZE).data; + descent = 0; + + for (let i = pixels.length - 1 - 3; i >= 0; i -= 4) { + if (pixels[i] > 0) { + descent = Math.ceil(i / 4 / DEFAULT_FONT_SIZE); + break; + } + } + + ctx.clearRect(0, 0, DEFAULT_FONT_SIZE, DEFAULT_FONT_SIZE); + ctx.strokeText("A", 0, DEFAULT_FONT_SIZE); + pixels = ctx.getImageData(0, 0, DEFAULT_FONT_SIZE, DEFAULT_FONT_SIZE).data; + ascent = 0; + + for (let i = 0, ii = pixels.length; i < ii; i += 4) { + if (pixels[i] > 0) { + ascent = DEFAULT_FONT_SIZE - Math.floor(i / 4 / DEFAULT_FONT_SIZE); + break; + } + } + + ctx.restore(); + + if (ascent) { + const ratio = ascent / (ascent + descent); + ascentCache.set(fontFamily, ratio); + return ratio; + } + + ascentCache.set(fontFamily, DEFAULT_FONT_ASCENT); + return DEFAULT_FONT_ASCENT; +} + +function appendText(task, geom, styles, ctx) { + const textDiv = document.createElement("span"); + const textDivProperties = task._enhanceTextSelection ? { + angle: 0, + canvasWidth: 0, + hasText: geom.str !== "", + hasEOL: geom.hasEOL, + originalTransform: null, + paddingBottom: 0, + paddingLeft: 0, + paddingRight: 0, + paddingTop: 0, + scale: 1 + } : { + angle: 0, + canvasWidth: 0, + hasText: geom.str !== "", + hasEOL: geom.hasEOL + }; + + task._textDivs.push(textDiv); + + const tx = _util.Util.transform(task._viewport.transform, geom.transform); + + let angle = Math.atan2(tx[1], tx[0]); + const style = styles[geom.fontName]; + + if (style.vertical) { + angle += Math.PI / 2; + } + + const fontHeight = Math.hypot(tx[2], tx[3]); + const fontAscent = fontHeight * getAscent(style.fontFamily, ctx); + let left, top; + + if (angle === 0) { + left = tx[4]; + top = tx[5] - fontAscent; + } else { + left = tx[4] + fontAscent * Math.sin(angle); + top = tx[5] - fontAscent * Math.cos(angle); + } + + textDiv.style.left = `${left}px`; + textDiv.style.top = `${top}px`; + textDiv.style.fontSize = `${fontHeight}px`; + textDiv.style.fontFamily = style.fontFamily; + textDiv.setAttribute("role", "presentation"); + textDiv.textContent = geom.str; + textDiv.dir = geom.dir; + + if (task._fontInspectorEnabled) { + textDiv.dataset.fontName = geom.fontName; + } + + if (angle !== 0) { + textDivProperties.angle = angle * (180 / Math.PI); + } + + let shouldScaleText = false; + + if (geom.str.length > 1 || task._enhanceTextSelection && AllWhitespaceRegexp.test(geom.str)) { + shouldScaleText = true; + } else if (geom.str !== " " && geom.transform[0] !== geom.transform[3]) { + const absScaleX = Math.abs(geom.transform[0]), + absScaleY = Math.abs(geom.transform[3]); + + if (absScaleX !== absScaleY && Math.max(absScaleX, absScaleY) / Math.min(absScaleX, absScaleY) > 1.5) { + shouldScaleText = true; + } + } + + if (shouldScaleText) { + if (style.vertical) { + textDivProperties.canvasWidth = geom.height * task._viewport.scale; + } else { + textDivProperties.canvasWidth = geom.width * task._viewport.scale; + } + } + + task._textDivProperties.set(textDiv, textDivProperties); + + if (task._textContentStream) { + task._layoutText(textDiv); + } + + if (task._enhanceTextSelection && textDivProperties.hasText) { + let angleCos = 1, + angleSin = 0; + + if (angle !== 0) { + angleCos = Math.cos(angle); + angleSin = Math.sin(angle); + } + + const divWidth = (style.vertical ? geom.height : geom.width) * task._viewport.scale; + const divHeight = fontHeight; + let m, b; + + if (angle !== 0) { + m = [angleCos, angleSin, -angleSin, angleCos, left, top]; + b = _util.Util.getAxialAlignedBoundingBox([0, 0, divWidth, divHeight], m); + } else { + b = [left, top, left + divWidth, top + divHeight]; + } + + task._bounds.push({ + left: b[0], + top: b[1], + right: b[2], + bottom: b[3], + div: textDiv, + size: [divWidth, divHeight], + m + }); + } +} + +function render(task) { + if (task._canceled) { + return; + } + + const textDivs = task._textDivs; + const capability = task._capability; + const textDivsLength = textDivs.length; + + if (textDivsLength > MAX_TEXT_DIVS_TO_RENDER) { + task._renderingDone = true; + capability.resolve(); + return; + } + + if (!task._textContentStream) { + for (let i = 0; i < textDivsLength; i++) { + task._layoutText(textDivs[i]); + } + } + + task._renderingDone = true; + capability.resolve(); +} + +function findPositiveMin(ts, offset, count) { + let result = 0; + + for (let i = 0; i < count; i++) { + const t = ts[offset++]; + + if (t > 0) { + result = result ? Math.min(t, result) : t; + } + } + + return result; +} + +function expand(task) { + const bounds = task._bounds; + const viewport = task._viewport; + const expanded = expandBounds(viewport.width, viewport.height, bounds); + + for (let i = 0; i < expanded.length; i++) { + const div = bounds[i].div; + + const divProperties = task._textDivProperties.get(div); + + if (divProperties.angle === 0) { + divProperties.paddingLeft = bounds[i].left - expanded[i].left; + divProperties.paddingTop = bounds[i].top - expanded[i].top; + divProperties.paddingRight = expanded[i].right - bounds[i].right; + divProperties.paddingBottom = expanded[i].bottom - bounds[i].bottom; + + task._textDivProperties.set(div, divProperties); + + continue; + } + + const e = expanded[i], + b = bounds[i]; + const m = b.m, + c = m[0], + s = m[1]; + const points = [[0, 0], [0, b.size[1]], [b.size[0], 0], b.size]; + const ts = new Float64Array(64); + + for (let j = 0, jj = points.length; j < jj; j++) { + const t = _util.Util.applyTransform(points[j], m); + + ts[j + 0] = c && (e.left - t[0]) / c; + ts[j + 4] = s && (e.top - t[1]) / s; + ts[j + 8] = c && (e.right - t[0]) / c; + ts[j + 12] = s && (e.bottom - t[1]) / s; + ts[j + 16] = s && (e.left - t[0]) / -s; + ts[j + 20] = c && (e.top - t[1]) / c; + ts[j + 24] = s && (e.right - t[0]) / -s; + ts[j + 28] = c && (e.bottom - t[1]) / c; + ts[j + 32] = c && (e.left - t[0]) / -c; + ts[j + 36] = s && (e.top - t[1]) / -s; + ts[j + 40] = c && (e.right - t[0]) / -c; + ts[j + 44] = s && (e.bottom - t[1]) / -s; + ts[j + 48] = s && (e.left - t[0]) / s; + ts[j + 52] = c && (e.top - t[1]) / -c; + ts[j + 56] = s && (e.right - t[0]) / s; + ts[j + 60] = c && (e.bottom - t[1]) / -c; + } + + const boxScale = 1 + Math.min(Math.abs(c), Math.abs(s)); + divProperties.paddingLeft = findPositiveMin(ts, 32, 16) / boxScale; + divProperties.paddingTop = findPositiveMin(ts, 48, 16) / boxScale; + divProperties.paddingRight = findPositiveMin(ts, 0, 16) / boxScale; + divProperties.paddingBottom = findPositiveMin(ts, 16, 16) / boxScale; + + task._textDivProperties.set(div, divProperties); + } +} + +function expandBounds(width, height, boxes) { + const bounds = boxes.map(function (box, i) { + return { + x1: box.left, + y1: box.top, + x2: box.right, + y2: box.bottom, + index: i, + x1New: undefined, + x2New: undefined + }; + }); + expandBoundsLTR(width, bounds); + const expanded = new Array(boxes.length); + + for (const b of bounds) { + const i = b.index; + expanded[i] = { + left: b.x1New, + top: 0, + right: b.x2New, + bottom: 0 + }; + } + + boxes.map(function (box, i) { + const e = expanded[i], + b = bounds[i]; + b.x1 = box.top; + b.y1 = width - e.right; + b.x2 = box.bottom; + b.y2 = width - e.left; + b.index = i; + b.x1New = undefined; + b.x2New = undefined; + }); + expandBoundsLTR(height, bounds); + + for (const b of bounds) { + const i = b.index; + expanded[i].top = b.x1New; + expanded[i].bottom = b.x2New; + } + + return expanded; +} + +function expandBoundsLTR(width, bounds) { + bounds.sort(function (a, b) { + return a.x1 - b.x1 || a.index - b.index; + }); + const fakeBoundary = { + x1: -Infinity, + y1: -Infinity, + x2: 0, + y2: Infinity, + index: -1, + x1New: 0, + x2New: 0 + }; + const horizon = [{ + start: -Infinity, + end: Infinity, + boundary: fakeBoundary + }]; + + for (const boundary of bounds) { + let i = 0; + + while (i < horizon.length && horizon[i].end <= boundary.y1) { + i++; + } + + let j = horizon.length - 1; + + while (j >= 0 && horizon[j].start >= boundary.y2) { + j--; + } + + let horizonPart, affectedBoundary; + let q, + k, + maxXNew = -Infinity; + + for (q = i; q <= j; q++) { + horizonPart = horizon[q]; + affectedBoundary = horizonPart.boundary; + let xNew; + + if (affectedBoundary.x2 > boundary.x1) { + xNew = affectedBoundary.index > boundary.index ? affectedBoundary.x1New : boundary.x1; + } else if (affectedBoundary.x2New === undefined) { + xNew = (affectedBoundary.x2 + boundary.x1) / 2; + } else { + xNew = affectedBoundary.x2New; + } + + if (xNew > maxXNew) { + maxXNew = xNew; + } + } + + boundary.x1New = maxXNew; + + for (q = i; q <= j; q++) { + horizonPart = horizon[q]; + affectedBoundary = horizonPart.boundary; + + if (affectedBoundary.x2New === undefined) { + if (affectedBoundary.x2 > boundary.x1) { + if (affectedBoundary.index > boundary.index) { + affectedBoundary.x2New = affectedBoundary.x2; + } + } else { + affectedBoundary.x2New = maxXNew; + } + } else if (affectedBoundary.x2New > maxXNew) { + affectedBoundary.x2New = Math.max(maxXNew, affectedBoundary.x2); + } + } + + const changedHorizon = []; + let lastBoundary = null; + + for (q = i; q <= j; q++) { + horizonPart = horizon[q]; + affectedBoundary = horizonPart.boundary; + const useBoundary = affectedBoundary.x2 > boundary.x2 ? affectedBoundary : boundary; + + if (lastBoundary === useBoundary) { + changedHorizon[changedHorizon.length - 1].end = horizonPart.end; + } else { + changedHorizon.push({ + start: horizonPart.start, + end: horizonPart.end, + boundary: useBoundary + }); + lastBoundary = useBoundary; + } + } + + if (horizon[i].start < boundary.y1) { + changedHorizon[0].start = boundary.y1; + changedHorizon.unshift({ + start: horizon[i].start, + end: boundary.y1, + boundary: horizon[i].boundary + }); + } + + if (boundary.y2 < horizon[j].end) { + changedHorizon[changedHorizon.length - 1].end = boundary.y2; + changedHorizon.push({ + start: boundary.y2, + end: horizon[j].end, + boundary: horizon[j].boundary + }); + } + + for (q = i; q <= j; q++) { + horizonPart = horizon[q]; + affectedBoundary = horizonPart.boundary; + + if (affectedBoundary.x2New !== undefined) { + continue; + } + + let used = false; + + for (k = i - 1; !used && k >= 0 && horizon[k].start >= affectedBoundary.y1; k--) { + used = horizon[k].boundary === affectedBoundary; + } + + for (k = j + 1; !used && k < horizon.length && horizon[k].end <= affectedBoundary.y2; k++) { + used = horizon[k].boundary === affectedBoundary; + } + + for (k = 0; !used && k < changedHorizon.length; k++) { + used = changedHorizon[k].boundary === affectedBoundary; + } + + if (!used) { + affectedBoundary.x2New = maxXNew; + } + } + + Array.prototype.splice.apply(horizon, [i, j - i + 1].concat(changedHorizon)); + } + + for (const horizonPart of horizon) { + const affectedBoundary = horizonPart.boundary; + + if (affectedBoundary.x2New === undefined) { + affectedBoundary.x2New = Math.max(width, affectedBoundary.x2); + } + } +} + +class TextLayerRenderTask { + constructor({ + textContent, + textContentStream, + container, + viewport, + textDivs, + textContentItemsStr, + enhanceTextSelection + }) { + this._textContent = textContent; + this._textContentStream = textContentStream; + this._container = container; + this._document = container.ownerDocument; + this._viewport = viewport; + this._textDivs = textDivs || []; + this._textContentItemsStr = textContentItemsStr || []; + this._enhanceTextSelection = !!enhanceTextSelection; + this._fontInspectorEnabled = !!globalThis.FontInspector?.enabled; + this._reader = null; + this._layoutTextLastFontSize = null; + this._layoutTextLastFontFamily = null; + this._layoutTextCtx = null; + this._textDivProperties = new WeakMap(); + this._renderingDone = false; + this._canceled = false; + this._capability = (0, _util.createPromiseCapability)(); + this._renderTimer = null; + this._bounds = []; + + this._capability.promise.finally(() => { + if (!this._enhanceTextSelection) { + this._textDivProperties = null; + } + + if (this._layoutTextCtx) { + this._layoutTextCtx.canvas.width = 0; + this._layoutTextCtx.canvas.height = 0; + this._layoutTextCtx = null; + } + }).catch(() => {}); + } + + get promise() { + return this._capability.promise; + } + + cancel() { + this._canceled = true; + + if (this._reader) { + this._reader.cancel(new _util.AbortException("TextLayer task cancelled.")).catch(() => {}); + + this._reader = null; + } + + if (this._renderTimer !== null) { + clearTimeout(this._renderTimer); + this._renderTimer = null; + } + + this._capability.reject(new Error("TextLayer task cancelled.")); + } + + _processItems(items, styleCache) { + for (let i = 0, len = items.length; i < len; i++) { + if (items[i].str === undefined) { + if (items[i].type === "beginMarkedContentProps" || items[i].type === "beginMarkedContent") { + const parent = this._container; + this._container = document.createElement("span"); + + this._container.classList.add("markedContent"); + + if (items[i].id !== null) { + this._container.setAttribute("id", `${items[i].id}`); + } + + parent.appendChild(this._container); + } else if (items[i].type === "endMarkedContent") { + this._container = this._container.parentNode; + } + + continue; + } + + this._textContentItemsStr.push(items[i].str); + + appendText(this, items[i], styleCache, this._layoutTextCtx); + } + } + + _layoutText(textDiv) { + const textDivProperties = this._textDivProperties.get(textDiv); + + let transform = ""; + + if (textDivProperties.canvasWidth !== 0 && textDivProperties.hasText) { + const { + fontSize, + fontFamily + } = textDiv.style; + + if (fontSize !== this._layoutTextLastFontSize || fontFamily !== this._layoutTextLastFontFamily) { + this._layoutTextCtx.font = `${fontSize} ${fontFamily}`; + this._layoutTextLastFontSize = fontSize; + this._layoutTextLastFontFamily = fontFamily; + } + + const { + width + } = this._layoutTextCtx.measureText(textDiv.textContent); + + if (width > 0) { + const scale = textDivProperties.canvasWidth / width; + + if (this._enhanceTextSelection) { + textDivProperties.scale = scale; + } + + transform = `scaleX(${scale})`; + } + } + + if (textDivProperties.angle !== 0) { + transform = `rotate(${textDivProperties.angle}deg) ${transform}`; + } + + if (transform.length > 0) { + if (this._enhanceTextSelection) { + textDivProperties.originalTransform = transform; + } + + textDiv.style.transform = transform; + } + + if (textDivProperties.hasText) { + this._container.appendChild(textDiv); + } + + if (textDivProperties.hasEOL) { + const br = document.createElement("br"); + br.setAttribute("role", "presentation"); + + this._container.appendChild(br); + } + } + + _render(timeout = 0) { + const capability = (0, _util.createPromiseCapability)(); + let styleCache = Object.create(null); + + const canvas = this._document.createElement("canvas"); + + canvas.height = canvas.width = DEFAULT_FONT_SIZE; + this._layoutTextCtx = canvas.getContext("2d", { + alpha: false + }); + + if (this._textContent) { + const textItems = this._textContent.items; + const textStyles = this._textContent.styles; + + this._processItems(textItems, textStyles); + + capability.resolve(); + } else if (this._textContentStream) { + const pump = () => { + this._reader.read().then(({ + value, + done + }) => { + if (done) { + capability.resolve(); + return; + } + + Object.assign(styleCache, value.styles); + + this._processItems(value.items, styleCache); + + pump(); + }, capability.reject); + }; + + this._reader = this._textContentStream.getReader(); + pump(); + } else { + throw new Error('Neither "textContent" nor "textContentStream" parameters specified.'); + } + + capability.promise.then(() => { + styleCache = null; + + if (!timeout) { + render(this); + } else { + this._renderTimer = setTimeout(() => { + render(this); + this._renderTimer = null; + }, timeout); + } + }, this._capability.reject); + } + + expandTextDivs(expandDivs = false) { + if (!this._enhanceTextSelection || !this._renderingDone) { + return; + } + + if (this._bounds !== null) { + expand(this); + this._bounds = null; + } + + const transformBuf = [], + paddingBuf = []; + + for (let i = 0, ii = this._textDivs.length; i < ii; i++) { + const div = this._textDivs[i]; + + const divProps = this._textDivProperties.get(div); + + if (!divProps.hasText) { + continue; + } + + if (expandDivs) { + transformBuf.length = 0; + paddingBuf.length = 0; + + if (divProps.originalTransform) { + transformBuf.push(divProps.originalTransform); + } + + if (divProps.paddingTop > 0) { + paddingBuf.push(`${divProps.paddingTop}px`); + transformBuf.push(`translateY(${-divProps.paddingTop}px)`); + } else { + paddingBuf.push(0); + } + + if (divProps.paddingRight > 0) { + paddingBuf.push(`${divProps.paddingRight / divProps.scale}px`); + } else { + paddingBuf.push(0); + } + + if (divProps.paddingBottom > 0) { + paddingBuf.push(`${divProps.paddingBottom}px`); + } else { + paddingBuf.push(0); + } + + if (divProps.paddingLeft > 0) { + paddingBuf.push(`${divProps.paddingLeft / divProps.scale}px`); + transformBuf.push(`translateX(${-divProps.paddingLeft / divProps.scale}px)`); + } else { + paddingBuf.push(0); + } + + div.style.padding = paddingBuf.join(" "); + + if (transformBuf.length) { + div.style.transform = transformBuf.join(" "); + } + } else { + div.style.padding = null; + div.style.transform = divProps.originalTransform; + } + } + } + +} + +function renderTextLayer(renderParameters) { + const task = new TextLayerRenderTask({ + textContent: renderParameters.textContent, + textContentStream: renderParameters.textContentStream, + container: renderParameters.container, + viewport: renderParameters.viewport, + textDivs: renderParameters.textDivs, + textContentItemsStr: renderParameters.textContentItemsStr, + enhanceTextSelection: renderParameters.enhanceTextSelection + }); + + task._render(renderParameters.timeout); + + return task; +} + +/***/ }), +/* 24 */ +/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.SVGGraphics = void 0; + +var _util = __w_pdfjs_require__(1); + +var _display_utils = __w_pdfjs_require__(5); + +var _is_node = __w_pdfjs_require__(3); + +let SVGGraphics = class { + constructor() { + (0, _util.unreachable)("Not implemented: SVGGraphics"); + } + +}; +exports.SVGGraphics = SVGGraphics; +{ + const SVG_DEFAULTS = { + fontStyle: "normal", + fontWeight: "normal", + fillColor: "#000000" + }; + const XML_NS = "http://www.w3.org/XML/1998/namespace"; + const XLINK_NS = "http://www.w3.org/1999/xlink"; + const LINE_CAP_STYLES = ["butt", "round", "square"]; + const LINE_JOIN_STYLES = ["miter", "round", "bevel"]; + + const createObjectURL = function (data, contentType = "", forceDataSchema = false) { + if (URL.createObjectURL && typeof Blob !== "undefined" && !forceDataSchema) { + return URL.createObjectURL(new Blob([data], { + type: contentType + })); + } + + const digits = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; + let buffer = `data:${contentType};base64,`; + + for (let i = 0, ii = data.length; i < ii; i += 3) { + const b1 = data[i] & 0xff; + const b2 = data[i + 1] & 0xff; + const b3 = data[i + 2] & 0xff; + const d1 = b1 >> 2, + d2 = (b1 & 3) << 4 | b2 >> 4; + const d3 = i + 1 < ii ? (b2 & 0xf) << 2 | b3 >> 6 : 64; + const d4 = i + 2 < ii ? b3 & 0x3f : 64; + buffer += digits[d1] + digits[d2] + digits[d3] + digits[d4]; + } + + return buffer; + }; + + const convertImgDataToPng = function () { + const PNG_HEADER = new Uint8Array([0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a]); + const CHUNK_WRAPPER_SIZE = 12; + const crcTable = new Int32Array(256); + + for (let i = 0; i < 256; i++) { + let c = i; + + for (let h = 0; h < 8; h++) { + if (c & 1) { + c = 0xedb88320 ^ c >> 1 & 0x7fffffff; + } else { + c = c >> 1 & 0x7fffffff; + } + } + + crcTable[i] = c; + } + + function crc32(data, start, end) { + let crc = -1; + + for (let i = start; i < end; i++) { + const a = (crc ^ data[i]) & 0xff; + const b = crcTable[a]; + crc = crc >>> 8 ^ b; + } + + return crc ^ -1; + } + + function writePngChunk(type, body, data, offset) { + let p = offset; + const len = body.length; + data[p] = len >> 24 & 0xff; + data[p + 1] = len >> 16 & 0xff; + data[p + 2] = len >> 8 & 0xff; + data[p + 3] = len & 0xff; + p += 4; + data[p] = type.charCodeAt(0) & 0xff; + data[p + 1] = type.charCodeAt(1) & 0xff; + data[p + 2] = type.charCodeAt(2) & 0xff; + data[p + 3] = type.charCodeAt(3) & 0xff; + p += 4; + data.set(body, p); + p += body.length; + const crc = crc32(data, offset + 4, p); + data[p] = crc >> 24 & 0xff; + data[p + 1] = crc >> 16 & 0xff; + data[p + 2] = crc >> 8 & 0xff; + data[p + 3] = crc & 0xff; + } + + function adler32(data, start, end) { + let a = 1; + let b = 0; + + for (let i = start; i < end; ++i) { + a = (a + (data[i] & 0xff)) % 65521; + b = (b + a) % 65521; + } + + return b << 16 | a; + } + + function deflateSync(literals) { + if (!_is_node.isNodeJS) { + return deflateSyncUncompressed(literals); + } + + try { + let input; + + if (parseInt(process.versions.node) >= 8) { + input = literals; + } else { + input = Buffer.from(literals); + } + + const output = require("zlib").deflateSync(input, { + level: 9 + }); + + return output instanceof Uint8Array ? output : new Uint8Array(output); + } catch (e) { + (0, _util.warn)("Not compressing PNG because zlib.deflateSync is unavailable: " + e); + } + + return deflateSyncUncompressed(literals); + } + + function deflateSyncUncompressed(literals) { + let len = literals.length; + const maxBlockLength = 0xffff; + const deflateBlocks = Math.ceil(len / maxBlockLength); + const idat = new Uint8Array(2 + len + deflateBlocks * 5 + 4); + let pi = 0; + idat[pi++] = 0x78; + idat[pi++] = 0x9c; + let pos = 0; + + while (len > maxBlockLength) { + idat[pi++] = 0x00; + idat[pi++] = 0xff; + idat[pi++] = 0xff; + idat[pi++] = 0x00; + idat[pi++] = 0x00; + idat.set(literals.subarray(pos, pos + maxBlockLength), pi); + pi += maxBlockLength; + pos += maxBlockLength; + len -= maxBlockLength; + } + + idat[pi++] = 0x01; + idat[pi++] = len & 0xff; + idat[pi++] = len >> 8 & 0xff; + idat[pi++] = ~len & 0xffff & 0xff; + idat[pi++] = (~len & 0xffff) >> 8 & 0xff; + idat.set(literals.subarray(pos), pi); + pi += literals.length - pos; + const adler = adler32(literals, 0, literals.length); + idat[pi++] = adler >> 24 & 0xff; + idat[pi++] = adler >> 16 & 0xff; + idat[pi++] = adler >> 8 & 0xff; + idat[pi++] = adler & 0xff; + return idat; + } + + function encode(imgData, kind, forceDataSchema, isMask) { + const width = imgData.width; + const height = imgData.height; + let bitDepth, colorType, lineSize; + const bytes = imgData.data; + + switch (kind) { + case _util.ImageKind.GRAYSCALE_1BPP: + colorType = 0; + bitDepth = 1; + lineSize = width + 7 >> 3; + break; + + case _util.ImageKind.RGB_24BPP: + colorType = 2; + bitDepth = 8; + lineSize = width * 3; + break; + + case _util.ImageKind.RGBA_32BPP: + colorType = 6; + bitDepth = 8; + lineSize = width * 4; + break; + + default: + throw new Error("invalid format"); + } + + const literals = new Uint8Array((1 + lineSize) * height); + let offsetLiterals = 0, + offsetBytes = 0; + + for (let y = 0; y < height; ++y) { + literals[offsetLiterals++] = 0; + literals.set(bytes.subarray(offsetBytes, offsetBytes + lineSize), offsetLiterals); + offsetBytes += lineSize; + offsetLiterals += lineSize; + } + + if (kind === _util.ImageKind.GRAYSCALE_1BPP && isMask) { + offsetLiterals = 0; + + for (let y = 0; y < height; y++) { + offsetLiterals++; + + for (let i = 0; i < lineSize; i++) { + literals[offsetLiterals++] ^= 0xff; + } + } + } + + const ihdr = new Uint8Array([width >> 24 & 0xff, width >> 16 & 0xff, width >> 8 & 0xff, width & 0xff, height >> 24 & 0xff, height >> 16 & 0xff, height >> 8 & 0xff, height & 0xff, bitDepth, colorType, 0x00, 0x00, 0x00]); + const idat = deflateSync(literals); + const pngLength = PNG_HEADER.length + CHUNK_WRAPPER_SIZE * 3 + ihdr.length + idat.length; + const data = new Uint8Array(pngLength); + let offset = 0; + data.set(PNG_HEADER, offset); + offset += PNG_HEADER.length; + writePngChunk("IHDR", ihdr, data, offset); + offset += CHUNK_WRAPPER_SIZE + ihdr.length; + writePngChunk("IDATA", idat, data, offset); + offset += CHUNK_WRAPPER_SIZE + idat.length; + writePngChunk("IEND", new Uint8Array(0), data, offset); + return createObjectURL(data, "image/png", forceDataSchema); + } + + return function convertImgDataToPng(imgData, forceDataSchema, isMask) { + const kind = imgData.kind === undefined ? _util.ImageKind.GRAYSCALE_1BPP : imgData.kind; + return encode(imgData, kind, forceDataSchema, isMask); + }; + }(); + + class SVGExtraState { + constructor() { + this.fontSizeScale = 1; + this.fontWeight = SVG_DEFAULTS.fontWeight; + this.fontSize = 0; + this.textMatrix = _util.IDENTITY_MATRIX; + this.fontMatrix = _util.FONT_IDENTITY_MATRIX; + this.leading = 0; + this.textRenderingMode = _util.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 = SVG_DEFAULTS.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(x, y) { + this.x = x; + this.y = y; + } + + } + + function opListToTree(opList) { + let opTree = []; + const tmp = []; + + for (const opListElement of opList) { + if (opListElement.fn === "save") { + opTree.push({ + fnId: 92, + fn: "group", + items: [] + }); + tmp.push(opTree); + opTree = opTree[opTree.length - 1].items; + continue; + } + + if (opListElement.fn === "restore") { + opTree = tmp.pop(); + } else { + opTree.push(opListElement); + } + } + + return opTree; + } + + function pf(value) { + if (Number.isInteger(value)) { + return value.toString(); + } + + const s = value.toFixed(10); + let i = s.length - 1; + + if (s[i] !== "0") { + return s; + } + + do { + i--; + } while (s[i] === "0"); + + return s.substring(0, s[i] === "." ? i : i + 1); + } + + function pm(m) { + if (m[4] === 0 && m[5] === 0) { + if (m[1] === 0 && m[2] === 0) { + if (m[0] === 1 && m[3] === 1) { + return ""; + } + + return `scale(${pf(m[0])} ${pf(m[3])})`; + } + + if (m[0] === m[3] && m[1] === -m[2]) { + const a = Math.acos(m[0]) * 180 / Math.PI; + return `rotate(${pf(a)})`; + } + } else { + if (m[0] === 1 && m[1] === 0 && m[2] === 0 && m[3] === 1) { + return `translate(${pf(m[4])} ${pf(m[5])})`; + } + } + + return `matrix(${pf(m[0])} ${pf(m[1])} ${pf(m[2])} ${pf(m[3])} ${pf(m[4])} ` + `${pf(m[5])})`; + } + + let clipCount = 0; + let maskCount = 0; + let shadingCount = 0; + exports.SVGGraphics = SVGGraphics = class { + constructor(commonObjs, objs, forceDataSchema = false) { + this.svgFactory = new _display_utils.DOMSVGFactory(); + this.current = new SVGExtraState(); + this.transformMatrix = _util.IDENTITY_MATRIX; + this.transformStack = []; + this.extraStack = []; + this.commonObjs = commonObjs; + this.objs = objs; + this.pendingClip = null; + this.pendingEOFill = false; + this.embedFonts = false; + this.embeddedFonts = Object.create(null); + this.cssStyle = null; + this.forceDataSchema = !!forceDataSchema; + this._operatorIdMapping = []; + + for (const op in _util.OPS) { + this._operatorIdMapping[_util.OPS[op]] = op; + } + } + + save() { + this.transformStack.push(this.transformMatrix); + const old = this.current; + this.extraStack.push(old); + this.current = old.clone(); + } + + restore() { + this.transformMatrix = this.transformStack.pop(); + this.current = this.extraStack.pop(); + this.pendingClip = null; + this.tgrp = null; + } + + group(items) { + this.save(); + this.executeOpTree(items); + this.restore(); + } + + loadDependencies(operatorList) { + const fnArray = operatorList.fnArray; + const argsArray = operatorList.argsArray; + + for (let i = 0, ii = fnArray.length; i < ii; i++) { + if (fnArray[i] !== _util.OPS.dependency) { + continue; + } + + for (const obj of argsArray[i]) { + const objsPool = obj.startsWith("g_") ? this.commonObjs : this.objs; + const promise = new Promise(resolve => { + objsPool.get(obj, resolve); + }); + this.current.dependencies.push(promise); + } + } + + return Promise.all(this.current.dependencies); + } + + transform(a, b, c, d, e, f) { + const transformMatrix = [a, b, c, d, e, f]; + this.transformMatrix = _util.Util.transform(this.transformMatrix, transformMatrix); + this.tgrp = null; + } + + getSVG(operatorList, viewport) { + this.viewport = viewport; + + const svgElement = this._initialize(viewport); + + return this.loadDependencies(operatorList).then(() => { + this.transformMatrix = _util.IDENTITY_MATRIX; + this.executeOpTree(this.convertOpList(operatorList)); + return svgElement; + }); + } + + convertOpList(operatorList) { + const operatorIdMapping = this._operatorIdMapping; + const argsArray = operatorList.argsArray; + const fnArray = operatorList.fnArray; + const opList = []; + + for (let i = 0, ii = fnArray.length; i < ii; i++) { + const fnId = fnArray[i]; + opList.push({ + fnId, + fn: operatorIdMapping[fnId], + args: argsArray[i] + }); + } + + return opListToTree(opList); + } + + executeOpTree(opTree) { + for (const opTreeElement of opTree) { + const fn = opTreeElement.fn; + const fnId = opTreeElement.fnId; + const args = opTreeElement.args; + + switch (fnId | 0) { + case _util.OPS.beginText: + this.beginText(); + break; + + case _util.OPS.dependency: + break; + + case _util.OPS.setLeading: + this.setLeading(args); + break; + + case _util.OPS.setLeadingMoveText: + this.setLeadingMoveText(args[0], args[1]); + break; + + case _util.OPS.setFont: + this.setFont(args); + break; + + case _util.OPS.showText: + this.showText(args[0]); + break; + + case _util.OPS.showSpacedText: + this.showText(args[0]); + break; + + case _util.OPS.endText: + this.endText(); + break; + + case _util.OPS.moveText: + this.moveText(args[0], args[1]); + break; + + case _util.OPS.setCharSpacing: + this.setCharSpacing(args[0]); + break; + + case _util.OPS.setWordSpacing: + this.setWordSpacing(args[0]); + break; + + case _util.OPS.setHScale: + this.setHScale(args[0]); + break; + + case _util.OPS.setTextMatrix: + this.setTextMatrix(args[0], args[1], args[2], args[3], args[4], args[5]); + break; + + case _util.OPS.setTextRise: + this.setTextRise(args[0]); + break; + + case _util.OPS.setTextRenderingMode: + this.setTextRenderingMode(args[0]); + break; + + case _util.OPS.setLineWidth: + this.setLineWidth(args[0]); + break; + + case _util.OPS.setLineJoin: + this.setLineJoin(args[0]); + break; + + case _util.OPS.setLineCap: + this.setLineCap(args[0]); + break; + + case _util.OPS.setMiterLimit: + this.setMiterLimit(args[0]); + break; + + case _util.OPS.setFillRGBColor: + this.setFillRGBColor(args[0], args[1], args[2]); + break; + + case _util.OPS.setStrokeRGBColor: + this.setStrokeRGBColor(args[0], args[1], args[2]); + break; + + case _util.OPS.setStrokeColorN: + this.setStrokeColorN(args); + break; + + case _util.OPS.setFillColorN: + this.setFillColorN(args); + break; + + case _util.OPS.shadingFill: + this.shadingFill(args[0]); + break; + + case _util.OPS.setDash: + this.setDash(args[0], args[1]); + break; + + case _util.OPS.setRenderingIntent: + this.setRenderingIntent(args[0]); + break; + + case _util.OPS.setFlatness: + this.setFlatness(args[0]); + break; + + case _util.OPS.setGState: + this.setGState(args[0]); + break; + + case _util.OPS.fill: + this.fill(); + break; + + case _util.OPS.eoFill: + this.eoFill(); + break; + + case _util.OPS.stroke: + this.stroke(); + break; + + case _util.OPS.fillStroke: + this.fillStroke(); + break; + + case _util.OPS.eoFillStroke: + this.eoFillStroke(); + break; + + case _util.OPS.clip: + this.clip("nonzero"); + break; + + case _util.OPS.eoClip: + this.clip("evenodd"); + break; + + case _util.OPS.paintSolidColorImageMask: + this.paintSolidColorImageMask(); + break; + + case _util.OPS.paintImageXObject: + this.paintImageXObject(args[0]); + break; + + case _util.OPS.paintInlineImageXObject: + this.paintInlineImageXObject(args[0]); + break; + + case _util.OPS.paintImageMaskXObject: + this.paintImageMaskXObject(args[0]); + break; + + case _util.OPS.paintFormXObjectBegin: + this.paintFormXObjectBegin(args[0], args[1]); + break; + + case _util.OPS.paintFormXObjectEnd: + this.paintFormXObjectEnd(); + break; + + case _util.OPS.closePath: + this.closePath(); + break; + + case _util.OPS.closeStroke: + this.closeStroke(); + break; + + case _util.OPS.closeFillStroke: + this.closeFillStroke(); + break; + + case _util.OPS.closeEOFillStroke: + this.closeEOFillStroke(); + break; + + case _util.OPS.nextLine: + this.nextLine(); + break; + + case _util.OPS.transform: + this.transform(args[0], args[1], args[2], args[3], args[4], args[5]); + break; + + case _util.OPS.constructPath: + this.constructPath(args[0], args[1]); + break; + + case _util.OPS.endPath: + this.endPath(); + break; + + case 92: + this.group(opTreeElement.items); + break; + + default: + (0, _util.warn)(`Unimplemented operator ${fn}`); + break; + } + } + } + + setWordSpacing(wordSpacing) { + this.current.wordSpacing = wordSpacing; + } + + setCharSpacing(charSpacing) { + this.current.charSpacing = charSpacing; + } + + nextLine() { + this.moveText(0, this.current.leading); + } + + setTextMatrix(a, b, c, d, e, f) { + const current = this.current; + current.textMatrix = current.lineMatrix = [a, b, c, d, e, f]; + current.textMatrixScale = Math.hypot(a, b); + current.x = current.lineX = 0; + current.y = current.lineY = 0; + current.xcoords = []; + current.ycoords = []; + current.tspan = this.svgFactory.createElement("svg:tspan"); + current.tspan.setAttributeNS(null, "font-family", current.fontFamily); + current.tspan.setAttributeNS(null, "font-size", `${pf(current.fontSize)}px`); + current.tspan.setAttributeNS(null, "y", pf(-current.y)); + current.txtElement = this.svgFactory.createElement("svg:text"); + current.txtElement.appendChild(current.tspan); + } + + beginText() { + const current = this.current; + current.x = current.lineX = 0; + current.y = current.lineY = 0; + current.textMatrix = _util.IDENTITY_MATRIX; + current.lineMatrix = _util.IDENTITY_MATRIX; + current.textMatrixScale = 1; + current.tspan = this.svgFactory.createElement("svg:tspan"); + current.txtElement = this.svgFactory.createElement("svg:text"); + current.txtgrp = this.svgFactory.createElement("svg:g"); + current.xcoords = []; + current.ycoords = []; + } + + moveText(x, y) { + const current = this.current; + current.x = current.lineX += x; + current.y = current.lineY += y; + current.xcoords = []; + current.ycoords = []; + current.tspan = this.svgFactory.createElement("svg:tspan"); + current.tspan.setAttributeNS(null, "font-family", current.fontFamily); + current.tspan.setAttributeNS(null, "font-size", `${pf(current.fontSize)}px`); + current.tspan.setAttributeNS(null, "y", pf(-current.y)); + } + + showText(glyphs) { + const current = this.current; + const font = current.font; + const fontSize = current.fontSize; + + if (fontSize === 0) { + return; + } + + const fontSizeScale = current.fontSizeScale; + const charSpacing = current.charSpacing; + const wordSpacing = current.wordSpacing; + const fontDirection = current.fontDirection; + const textHScale = current.textHScale * fontDirection; + const vertical = font.vertical; + const spacingDir = vertical ? 1 : -1; + const defaultVMetrics = font.defaultVMetrics; + const widthAdvanceScale = fontSize * current.fontMatrix[0]; + let x = 0; + + for (const glyph of glyphs) { + if (glyph === null) { + x += fontDirection * wordSpacing; + continue; + } else if (typeof glyph === "number") { + x += spacingDir * glyph * fontSize / 1000; + continue; + } + + const spacing = (glyph.isSpace ? wordSpacing : 0) + charSpacing; + const character = glyph.fontChar; + let scaledX, scaledY; + let width = glyph.width; + + if (vertical) { + let vx; + const vmetric = glyph.vmetric || defaultVMetrics; + vx = glyph.vmetric ? vmetric[1] : width * 0.5; + vx = -vx * widthAdvanceScale; + const vy = vmetric[2] * widthAdvanceScale; + width = vmetric ? -vmetric[0] : width; + scaledX = vx / fontSizeScale; + scaledY = (x + vy) / fontSizeScale; + } else { + scaledX = x / fontSizeScale; + scaledY = 0; + } + + if (glyph.isInFont || font.missingFile) { + current.xcoords.push(current.x + scaledX); + + if (vertical) { + current.ycoords.push(-current.y + scaledY); + } + + current.tspan.textContent += character; + } else {} + + let charWidth; + + if (vertical) { + charWidth = width * widthAdvanceScale - spacing * fontDirection; + } else { + charWidth = width * widthAdvanceScale + spacing * fontDirection; + } + + x += charWidth; + } + + current.tspan.setAttributeNS(null, "x", current.xcoords.map(pf).join(" ")); + + if (vertical) { + current.tspan.setAttributeNS(null, "y", current.ycoords.map(pf).join(" ")); + } else { + current.tspan.setAttributeNS(null, "y", pf(-current.y)); + } + + if (vertical) { + current.y -= x; + } else { + current.x += x * textHScale; + } + + current.tspan.setAttributeNS(null, "font-family", current.fontFamily); + current.tspan.setAttributeNS(null, "font-size", `${pf(current.fontSize)}px`); + + if (current.fontStyle !== SVG_DEFAULTS.fontStyle) { + current.tspan.setAttributeNS(null, "font-style", current.fontStyle); + } + + if (current.fontWeight !== SVG_DEFAULTS.fontWeight) { + current.tspan.setAttributeNS(null, "font-weight", current.fontWeight); + } + + const fillStrokeMode = current.textRenderingMode & _util.TextRenderingMode.FILL_STROKE_MASK; + + if (fillStrokeMode === _util.TextRenderingMode.FILL || fillStrokeMode === _util.TextRenderingMode.FILL_STROKE) { + if (current.fillColor !== SVG_DEFAULTS.fillColor) { + current.tspan.setAttributeNS(null, "fill", current.fillColor); + } + + if (current.fillAlpha < 1) { + current.tspan.setAttributeNS(null, "fill-opacity", current.fillAlpha); + } + } else if (current.textRenderingMode === _util.TextRenderingMode.ADD_TO_PATH) { + current.tspan.setAttributeNS(null, "fill", "transparent"); + } else { + current.tspan.setAttributeNS(null, "fill", "none"); + } + + if (fillStrokeMode === _util.TextRenderingMode.STROKE || fillStrokeMode === _util.TextRenderingMode.FILL_STROKE) { + const lineWidthScale = 1 / (current.textMatrixScale || 1); + + this._setStrokeAttributes(current.tspan, lineWidthScale); + } + + let textMatrix = current.textMatrix; + + if (current.textRise !== 0) { + textMatrix = textMatrix.slice(); + textMatrix[5] += current.textRise; + } + + current.txtElement.setAttributeNS(null, "transform", `${pm(textMatrix)} scale(${pf(textHScale)}, -1)`); + current.txtElement.setAttributeNS(XML_NS, "xml:space", "preserve"); + current.txtElement.appendChild(current.tspan); + current.txtgrp.appendChild(current.txtElement); + + this._ensureTransformGroup().appendChild(current.txtElement); + } + + setLeadingMoveText(x, y) { + this.setLeading(-y); + this.moveText(x, y); + } + + addFontStyle(fontObj) { + if (!fontObj.data) { + throw new Error("addFontStyle: No font data available, " + 'ensure that the "fontExtraProperties" API parameter is set.'); + } + + if (!this.cssStyle) { + this.cssStyle = this.svgFactory.createElement("svg:style"); + this.cssStyle.setAttributeNS(null, "type", "text/css"); + this.defs.appendChild(this.cssStyle); + } + + const url = createObjectURL(fontObj.data, fontObj.mimetype, this.forceDataSchema); + this.cssStyle.textContent += `@font-face { font-family: "${fontObj.loadedName}";` + ` src: url(${url}); }\n`; + } + + setFont(details) { + const current = this.current; + const fontObj = this.commonObjs.get(details[0]); + let size = details[1]; + current.font = fontObj; + + if (this.embedFonts && !fontObj.missingFile && !this.embeddedFonts[fontObj.loadedName]) { + this.addFontStyle(fontObj); + this.embeddedFonts[fontObj.loadedName] = fontObj; + } + + current.fontMatrix = fontObj.fontMatrix || _util.FONT_IDENTITY_MATRIX; + let bold = "normal"; + + if (fontObj.black) { + bold = "900"; + } else if (fontObj.bold) { + bold = "bold"; + } + + const italic = fontObj.italic ? "italic" : "normal"; + + if (size < 0) { + size = -size; + current.fontDirection = -1; + } else { + current.fontDirection = 1; + } + + current.fontSize = size; + current.fontFamily = fontObj.loadedName; + current.fontWeight = bold; + current.fontStyle = italic; + current.tspan = this.svgFactory.createElement("svg:tspan"); + current.tspan.setAttributeNS(null, "y", pf(-current.y)); + current.xcoords = []; + current.ycoords = []; + } + + endText() { + const current = this.current; + + if (current.textRenderingMode & _util.TextRenderingMode.ADD_TO_PATH_FLAG && current.txtElement?.hasChildNodes()) { + current.element = current.txtElement; + this.clip("nonzero"); + this.endPath(); + } + } + + setLineWidth(width) { + if (width > 0) { + this.current.lineWidth = width; + } + } + + setLineCap(style) { + this.current.lineCap = LINE_CAP_STYLES[style]; + } + + setLineJoin(style) { + this.current.lineJoin = LINE_JOIN_STYLES[style]; + } + + setMiterLimit(limit) { + this.current.miterLimit = limit; + } + + setStrokeAlpha(strokeAlpha) { + this.current.strokeAlpha = strokeAlpha; + } + + setStrokeRGBColor(r, g, b) { + this.current.strokeColor = _util.Util.makeHexColor(r, g, b); + } + + setFillAlpha(fillAlpha) { + this.current.fillAlpha = fillAlpha; + } + + setFillRGBColor(r, g, b) { + this.current.fillColor = _util.Util.makeHexColor(r, g, b); + this.current.tspan = this.svgFactory.createElement("svg:tspan"); + this.current.xcoords = []; + this.current.ycoords = []; + } + + setStrokeColorN(args) { + this.current.strokeColor = this._makeColorN_Pattern(args); + } + + setFillColorN(args) { + this.current.fillColor = this._makeColorN_Pattern(args); + } + + shadingFill(args) { + const width = this.viewport.width; + const height = this.viewport.height; + + const inv = _util.Util.inverseTransform(this.transformMatrix); + + const bl = _util.Util.applyTransform([0, 0], inv); + + const br = _util.Util.applyTransform([0, height], inv); + + const ul = _util.Util.applyTransform([width, 0], inv); + + const ur = _util.Util.applyTransform([width, height], inv); + + const x0 = Math.min(bl[0], br[0], ul[0], ur[0]); + const y0 = Math.min(bl[1], br[1], ul[1], ur[1]); + const x1 = Math.max(bl[0], br[0], ul[0], ur[0]); + const y1 = Math.max(bl[1], br[1], ul[1], ur[1]); + const rect = this.svgFactory.createElement("svg:rect"); + rect.setAttributeNS(null, "x", x0); + rect.setAttributeNS(null, "y", y0); + rect.setAttributeNS(null, "width", x1 - x0); + rect.setAttributeNS(null, "height", y1 - y0); + rect.setAttributeNS(null, "fill", this._makeShadingPattern(args)); + + if (this.current.fillAlpha < 1) { + rect.setAttributeNS(null, "fill-opacity", this.current.fillAlpha); + } + + this._ensureTransformGroup().appendChild(rect); + } + + _makeColorN_Pattern(args) { + if (args[0] === "TilingPattern") { + return this._makeTilingPattern(args); + } + + return this._makeShadingPattern(args); + } + + _makeTilingPattern(args) { + const color = args[1]; + const operatorList = args[2]; + const matrix = args[3] || _util.IDENTITY_MATRIX; + const [x0, y0, x1, y1] = args[4]; + const xstep = args[5]; + const ystep = args[6]; + const paintType = args[7]; + const tilingId = `shading${shadingCount++}`; + + const [tx0, ty0, tx1, ty1] = _util.Util.normalizeRect([..._util.Util.applyTransform([x0, y0], matrix), ..._util.Util.applyTransform([x1, y1], matrix)]); + + const [xscale, yscale] = _util.Util.singularValueDecompose2dScale(matrix); + + const txstep = xstep * xscale; + const tystep = ystep * yscale; + const tiling = this.svgFactory.createElement("svg:pattern"); + tiling.setAttributeNS(null, "id", tilingId); + tiling.setAttributeNS(null, "patternUnits", "userSpaceOnUse"); + tiling.setAttributeNS(null, "width", txstep); + tiling.setAttributeNS(null, "height", tystep); + tiling.setAttributeNS(null, "x", `${tx0}`); + tiling.setAttributeNS(null, "y", `${ty0}`); + const svg = this.svg; + const transformMatrix = this.transformMatrix; + const fillColor = this.current.fillColor; + const strokeColor = this.current.strokeColor; + const bbox = this.svgFactory.create(tx1 - tx0, ty1 - ty0); + this.svg = bbox; + this.transformMatrix = matrix; + + if (paintType === 2) { + const cssColor = _util.Util.makeHexColor(...color); + + this.current.fillColor = cssColor; + this.current.strokeColor = cssColor; + } + + this.executeOpTree(this.convertOpList(operatorList)); + this.svg = svg; + this.transformMatrix = transformMatrix; + this.current.fillColor = fillColor; + this.current.strokeColor = strokeColor; + tiling.appendChild(bbox.childNodes[0]); + this.defs.appendChild(tiling); + return `url(#${tilingId})`; + } + + _makeShadingPattern(args) { + if (typeof args === "string") { + args = this.objs.get(args); + } + + switch (args[0]) { + case "RadialAxial": + const shadingId = `shading${shadingCount++}`; + const colorStops = args[3]; + let gradient; + + switch (args[1]) { + case "axial": + const point0 = args[4]; + const point1 = args[5]; + gradient = this.svgFactory.createElement("svg:linearGradient"); + gradient.setAttributeNS(null, "id", shadingId); + gradient.setAttributeNS(null, "gradientUnits", "userSpaceOnUse"); + gradient.setAttributeNS(null, "x1", point0[0]); + gradient.setAttributeNS(null, "y1", point0[1]); + gradient.setAttributeNS(null, "x2", point1[0]); + gradient.setAttributeNS(null, "y2", point1[1]); + break; + + case "radial": + const focalPoint = args[4]; + const circlePoint = args[5]; + const focalRadius = args[6]; + const circleRadius = args[7]; + gradient = this.svgFactory.createElement("svg:radialGradient"); + gradient.setAttributeNS(null, "id", shadingId); + gradient.setAttributeNS(null, "gradientUnits", "userSpaceOnUse"); + gradient.setAttributeNS(null, "cx", circlePoint[0]); + gradient.setAttributeNS(null, "cy", circlePoint[1]); + gradient.setAttributeNS(null, "r", circleRadius); + gradient.setAttributeNS(null, "fx", focalPoint[0]); + gradient.setAttributeNS(null, "fy", focalPoint[1]); + gradient.setAttributeNS(null, "fr", focalRadius); + break; + + default: + throw new Error(`Unknown RadialAxial type: ${args[1]}`); + } + + for (const colorStop of colorStops) { + const stop = this.svgFactory.createElement("svg:stop"); + stop.setAttributeNS(null, "offset", colorStop[0]); + stop.setAttributeNS(null, "stop-color", colorStop[1]); + gradient.appendChild(stop); + } + + this.defs.appendChild(gradient); + return `url(#${shadingId})`; + + case "Mesh": + (0, _util.warn)("Unimplemented pattern Mesh"); + return null; + + case "Dummy": + return "hotpink"; + + default: + throw new Error(`Unknown IR type: ${args[0]}`); + } + } + + setDash(dashArray, dashPhase) { + this.current.dashArray = dashArray; + this.current.dashPhase = dashPhase; + } + + constructPath(ops, args) { + const current = this.current; + let x = current.x, + y = current.y; + let d = []; + let j = 0; + + for (const op of ops) { + switch (op | 0) { + case _util.OPS.rectangle: + x = args[j++]; + y = args[j++]; + const width = args[j++]; + const height = args[j++]; + const xw = x + width; + const yh = y + height; + d.push("M", pf(x), pf(y), "L", pf(xw), pf(y), "L", pf(xw), pf(yh), "L", pf(x), pf(yh), "Z"); + break; + + case _util.OPS.moveTo: + x = args[j++]; + y = args[j++]; + d.push("M", pf(x), pf(y)); + break; + + case _util.OPS.lineTo: + x = args[j++]; + y = args[j++]; + d.push("L", pf(x), pf(y)); + break; + + case _util.OPS.curveTo: + x = args[j + 4]; + y = args[j + 5]; + d.push("C", pf(args[j]), pf(args[j + 1]), pf(args[j + 2]), pf(args[j + 3]), pf(x), pf(y)); + j += 6; + break; + + case _util.OPS.curveTo2: + d.push("C", pf(x), pf(y), pf(args[j]), pf(args[j + 1]), pf(args[j + 2]), pf(args[j + 3])); + x = args[j + 2]; + y = args[j + 3]; + j += 4; + break; + + case _util.OPS.curveTo3: + x = args[j + 2]; + y = args[j + 3]; + d.push("C", pf(args[j]), pf(args[j + 1]), pf(x), pf(y), pf(x), pf(y)); + j += 4; + break; + + case _util.OPS.closePath: + d.push("Z"); + break; + } + } + + d = d.join(" "); + + if (current.path && ops.length > 0 && ops[0] !== _util.OPS.rectangle && ops[0] !== _util.OPS.moveTo) { + d = current.path.getAttributeNS(null, "d") + d; + } else { + current.path = this.svgFactory.createElement("svg:path"); + + this._ensureTransformGroup().appendChild(current.path); + } + + current.path.setAttributeNS(null, "d", d); + current.path.setAttributeNS(null, "fill", "none"); + current.element = current.path; + current.setCurrentPoint(x, y); + } + + endPath() { + const current = this.current; + current.path = null; + + if (!this.pendingClip) { + return; + } + + if (!current.element) { + this.pendingClip = null; + return; + } + + const clipId = `clippath${clipCount++}`; + const clipPath = this.svgFactory.createElement("svg:clipPath"); + clipPath.setAttributeNS(null, "id", clipId); + clipPath.setAttributeNS(null, "transform", pm(this.transformMatrix)); + const clipElement = current.element.cloneNode(true); + + if (this.pendingClip === "evenodd") { + clipElement.setAttributeNS(null, "clip-rule", "evenodd"); + } else { + clipElement.setAttributeNS(null, "clip-rule", "nonzero"); + } + + this.pendingClip = null; + clipPath.appendChild(clipElement); + this.defs.appendChild(clipPath); + + if (current.activeClipUrl) { + current.clipGroup = null; + + for (const prev of this.extraStack) { + prev.clipGroup = null; + } + + clipPath.setAttributeNS(null, "clip-path", current.activeClipUrl); + } + + current.activeClipUrl = `url(#${clipId})`; + this.tgrp = null; + } + + clip(type) { + this.pendingClip = type; + } + + closePath() { + const current = this.current; + + if (current.path) { + const d = `${current.path.getAttributeNS(null, "d")}Z`; + current.path.setAttributeNS(null, "d", d); + } + } + + setLeading(leading) { + this.current.leading = -leading; + } + + setTextRise(textRise) { + this.current.textRise = textRise; + } + + setTextRenderingMode(textRenderingMode) { + this.current.textRenderingMode = textRenderingMode; + } + + setHScale(scale) { + this.current.textHScale = scale / 100; + } + + setRenderingIntent(intent) {} + + setFlatness(flatness) {} + + setGState(states) { + for (const [key, value] of states) { + switch (key) { + case "LW": + this.setLineWidth(value); + break; + + case "LC": + this.setLineCap(value); + break; + + case "LJ": + this.setLineJoin(value); + break; + + case "ML": + this.setMiterLimit(value); + break; + + case "D": + this.setDash(value[0], value[1]); + break; + + case "RI": + this.setRenderingIntent(value); + break; + + case "FL": + this.setFlatness(value); + break; + + case "Font": + this.setFont(value); + break; + + case "CA": + this.setStrokeAlpha(value); + break; + + case "ca": + this.setFillAlpha(value); + break; + + default: + (0, _util.warn)(`Unimplemented graphic state operator ${key}`); + break; + } + } + } + + fill() { + const current = this.current; + + if (current.element) { + current.element.setAttributeNS(null, "fill", current.fillColor); + current.element.setAttributeNS(null, "fill-opacity", current.fillAlpha); + this.endPath(); + } + } + + stroke() { + const current = this.current; + + if (current.element) { + this._setStrokeAttributes(current.element); + + current.element.setAttributeNS(null, "fill", "none"); + this.endPath(); + } + } + + _setStrokeAttributes(element, lineWidthScale = 1) { + const current = this.current; + let dashArray = current.dashArray; + + if (lineWidthScale !== 1 && dashArray.length > 0) { + dashArray = dashArray.map(function (value) { + return lineWidthScale * value; + }); + } + + element.setAttributeNS(null, "stroke", current.strokeColor); + element.setAttributeNS(null, "stroke-opacity", current.strokeAlpha); + element.setAttributeNS(null, "stroke-miterlimit", pf(current.miterLimit)); + element.setAttributeNS(null, "stroke-linecap", current.lineCap); + element.setAttributeNS(null, "stroke-linejoin", current.lineJoin); + element.setAttributeNS(null, "stroke-width", pf(lineWidthScale * current.lineWidth) + "px"); + element.setAttributeNS(null, "stroke-dasharray", dashArray.map(pf).join(" ")); + element.setAttributeNS(null, "stroke-dashoffset", pf(lineWidthScale * current.dashPhase) + "px"); + } + + eoFill() { + if (this.current.element) { + this.current.element.setAttributeNS(null, "fill-rule", "evenodd"); + } + + this.fill(); + } + + fillStroke() { + this.stroke(); + this.fill(); + } + + eoFillStroke() { + if (this.current.element) { + this.current.element.setAttributeNS(null, "fill-rule", "evenodd"); + } + + this.fillStroke(); + } + + closeStroke() { + this.closePath(); + this.stroke(); + } + + closeFillStroke() { + this.closePath(); + this.fillStroke(); + } + + closeEOFillStroke() { + this.closePath(); + this.eoFillStroke(); + } + + paintSolidColorImageMask() { + const rect = this.svgFactory.createElement("svg:rect"); + rect.setAttributeNS(null, "x", "0"); + rect.setAttributeNS(null, "y", "0"); + rect.setAttributeNS(null, "width", "1px"); + rect.setAttributeNS(null, "height", "1px"); + rect.setAttributeNS(null, "fill", this.current.fillColor); + + this._ensureTransformGroup().appendChild(rect); + } + + paintImageXObject(objId) { + const imgData = objId.startsWith("g_") ? this.commonObjs.get(objId) : this.objs.get(objId); + + if (!imgData) { + (0, _util.warn)(`Dependent image with object ID ${objId} is not ready yet`); + return; + } + + this.paintInlineImageXObject(imgData); + } + + paintInlineImageXObject(imgData, mask) { + const width = imgData.width; + const height = imgData.height; + const imgSrc = convertImgDataToPng(imgData, this.forceDataSchema, !!mask); + const cliprect = this.svgFactory.createElement("svg:rect"); + cliprect.setAttributeNS(null, "x", "0"); + cliprect.setAttributeNS(null, "y", "0"); + cliprect.setAttributeNS(null, "width", pf(width)); + cliprect.setAttributeNS(null, "height", pf(height)); + this.current.element = cliprect; + this.clip("nonzero"); + const imgEl = this.svgFactory.createElement("svg:image"); + imgEl.setAttributeNS(XLINK_NS, "xlink:href", imgSrc); + imgEl.setAttributeNS(null, "x", "0"); + imgEl.setAttributeNS(null, "y", pf(-height)); + imgEl.setAttributeNS(null, "width", pf(width) + "px"); + imgEl.setAttributeNS(null, "height", pf(height) + "px"); + imgEl.setAttributeNS(null, "transform", `scale(${pf(1 / width)} ${pf(-1 / height)})`); + + if (mask) { + mask.appendChild(imgEl); + } else { + this._ensureTransformGroup().appendChild(imgEl); + } + } + + paintImageMaskXObject(imgData) { + const current = this.current; + const width = imgData.width; + const height = imgData.height; + const fillColor = current.fillColor; + current.maskId = `mask${maskCount++}`; + const mask = this.svgFactory.createElement("svg:mask"); + mask.setAttributeNS(null, "id", current.maskId); + const rect = this.svgFactory.createElement("svg:rect"); + rect.setAttributeNS(null, "x", "0"); + rect.setAttributeNS(null, "y", "0"); + rect.setAttributeNS(null, "width", pf(width)); + rect.setAttributeNS(null, "height", pf(height)); + rect.setAttributeNS(null, "fill", fillColor); + rect.setAttributeNS(null, "mask", `url(#${current.maskId})`); + this.defs.appendChild(mask); + + this._ensureTransformGroup().appendChild(rect); + + this.paintInlineImageXObject(imgData, mask); + } + + paintFormXObjectBegin(matrix, bbox) { + if (Array.isArray(matrix) && matrix.length === 6) { + this.transform(matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5]); + } + + if (bbox) { + const width = bbox[2] - bbox[0]; + const height = bbox[3] - bbox[1]; + const cliprect = this.svgFactory.createElement("svg:rect"); + cliprect.setAttributeNS(null, "x", bbox[0]); + cliprect.setAttributeNS(null, "y", bbox[1]); + cliprect.setAttributeNS(null, "width", pf(width)); + cliprect.setAttributeNS(null, "height", pf(height)); + this.current.element = cliprect; + this.clip("nonzero"); + this.endPath(); + } + } + + paintFormXObjectEnd() {} + + _initialize(viewport) { + const svg = this.svgFactory.create(viewport.width, viewport.height); + const definitions = this.svgFactory.createElement("svg:defs"); + svg.appendChild(definitions); + this.defs = definitions; + const rootGroup = this.svgFactory.createElement("svg:g"); + rootGroup.setAttributeNS(null, "transform", pm(viewport.transform)); + svg.appendChild(rootGroup); + this.svg = rootGroup; + return svg; + } + + _ensureClipGroup() { + if (!this.current.clipGroup) { + const clipGroup = this.svgFactory.createElement("svg:g"); + clipGroup.setAttributeNS(null, "clip-path", this.current.activeClipUrl); + this.svg.appendChild(clipGroup); + this.current.clipGroup = clipGroup; + } + + return this.current.clipGroup; + } + + _ensureTransformGroup() { + if (!this.tgrp) { + this.tgrp = this.svgFactory.createElement("svg:g"); + this.tgrp.setAttributeNS(null, "transform", pm(this.transformMatrix)); + + if (this.current.activeClipUrl) { + this._ensureClipGroup().appendChild(this.tgrp); + } else { + this.svg.appendChild(this.tgrp); + } + } + + return this.tgrp; + } + + }; +} + +/***/ }), +/* 25 */ +/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.PDFNodeStream = void 0; + +var _util = __w_pdfjs_require__(1); + +var _network_utils = __w_pdfjs_require__(26); + +; + +const fs = require("fs"); + +const http = require("http"); + +const https = require("https"); + +const url = require("url"); + +const fileUriRegex = /^file:\/\/\/[a-zA-Z]:\//; + +function parseUrl(sourceUrl) { + const parsedUrl = url.parse(sourceUrl); + + if (parsedUrl.protocol === "file:" || parsedUrl.host) { + return parsedUrl; + } + + if (/^[a-z]:[/\\]/i.test(sourceUrl)) { + return url.parse(`file:///${sourceUrl}`); + } + + if (!parsedUrl.host) { + parsedUrl.protocol = "file:"; + } + + return parsedUrl; +} + +class PDFNodeStream { + constructor(source) { + this.source = source; + this.url = parseUrl(source.url); + this.isHttp = this.url.protocol === "http:" || this.url.protocol === "https:"; + this.isFsUrl = this.url.protocol === "file:"; + this.httpHeaders = this.isHttp && source.httpHeaders || {}; + this._fullRequestReader = null; + this._rangeRequestReaders = []; + } + + get _progressiveDataLength() { + return this._fullRequestReader?._loaded ?? 0; + } + + getFullReader() { + (0, _util.assert)(!this._fullRequestReader, "PDFNodeStream.getFullReader can only be called once."); + this._fullRequestReader = this.isFsUrl ? new PDFNodeStreamFsFullReader(this) : new PDFNodeStreamFullReader(this); + return this._fullRequestReader; + } + + getRangeReader(start, end) { + if (end <= this._progressiveDataLength) { + return null; + } + + const rangeReader = this.isFsUrl ? new PDFNodeStreamFsRangeReader(this, start, end) : new PDFNodeStreamRangeReader(this, start, end); + + this._rangeRequestReaders.push(rangeReader); + + return rangeReader; + } + + cancelAllRequests(reason) { + if (this._fullRequestReader) { + this._fullRequestReader.cancel(reason); + } + + for (const reader of this._rangeRequestReaders.slice(0)) { + reader.cancel(reason); + } + } + +} + +exports.PDFNodeStream = PDFNodeStream; + +class BaseFullReader { + constructor(stream) { + this._url = stream.url; + this._done = false; + this._storedError = null; + this.onProgress = null; + const source = stream.source; + this._contentLength = source.length; + this._loaded = 0; + this._filename = null; + this._disableRange = source.disableRange || false; + this._rangeChunkSize = source.rangeChunkSize; + + if (!this._rangeChunkSize && !this._disableRange) { + this._disableRange = true; + } + + this._isStreamingSupported = !source.disableStream; + this._isRangeSupported = !source.disableRange; + this._readableStream = null; + this._readCapability = (0, _util.createPromiseCapability)(); + this._headersCapability = (0, _util.createPromiseCapability)(); + } + + get headersReady() { + return this._headersCapability.promise; + } + + get filename() { + return this._filename; + } + + get contentLength() { + return this._contentLength; + } + + get isRangeSupported() { + return this._isRangeSupported; + } + + get isStreamingSupported() { + return this._isStreamingSupported; + } + + async read() { + await this._readCapability.promise; + + if (this._done) { + return { + value: undefined, + done: true + }; + } + + if (this._storedError) { + throw this._storedError; + } + + const chunk = this._readableStream.read(); + + if (chunk === null) { + this._readCapability = (0, _util.createPromiseCapability)(); + return this.read(); + } + + this._loaded += chunk.length; + + if (this.onProgress) { + this.onProgress({ + loaded: this._loaded, + total: this._contentLength + }); + } + + const buffer = new Uint8Array(chunk).buffer; + return { + value: buffer, + done: false + }; + } + + cancel(reason) { + if (!this._readableStream) { + this._error(reason); + + return; + } + + this._readableStream.destroy(reason); + } + + _error(reason) { + this._storedError = reason; + + this._readCapability.resolve(); + } + + _setReadableStream(readableStream) { + this._readableStream = readableStream; + readableStream.on("readable", () => { + this._readCapability.resolve(); + }); + readableStream.on("end", () => { + readableStream.destroy(); + this._done = true; + + this._readCapability.resolve(); + }); + readableStream.on("error", reason => { + this._error(reason); + }); + + if (!this._isStreamingSupported && this._isRangeSupported) { + this._error(new _util.AbortException("streaming is disabled")); + } + + if (this._storedError) { + this._readableStream.destroy(this._storedError); + } + } + +} + +class BaseRangeReader { + constructor(stream) { + this._url = stream.url; + this._done = false; + this._storedError = null; + this.onProgress = null; + this._loaded = 0; + this._readableStream = null; + this._readCapability = (0, _util.createPromiseCapability)(); + const source = stream.source; + this._isStreamingSupported = !source.disableStream; + } + + get isStreamingSupported() { + return this._isStreamingSupported; + } + + async read() { + await this._readCapability.promise; + + if (this._done) { + return { + value: undefined, + done: true + }; + } + + if (this._storedError) { + throw this._storedError; + } + + const chunk = this._readableStream.read(); + + if (chunk === null) { + this._readCapability = (0, _util.createPromiseCapability)(); + return this.read(); + } + + this._loaded += chunk.length; + + if (this.onProgress) { + this.onProgress({ + loaded: this._loaded + }); + } + + const buffer = new Uint8Array(chunk).buffer; + return { + value: buffer, + done: false + }; + } + + cancel(reason) { + if (!this._readableStream) { + this._error(reason); + + return; + } + + this._readableStream.destroy(reason); + } + + _error(reason) { + this._storedError = reason; + + this._readCapability.resolve(); + } + + _setReadableStream(readableStream) { + this._readableStream = readableStream; + readableStream.on("readable", () => { + this._readCapability.resolve(); + }); + readableStream.on("end", () => { + readableStream.destroy(); + this._done = true; + + this._readCapability.resolve(); + }); + readableStream.on("error", reason => { + this._error(reason); + }); + + if (this._storedError) { + this._readableStream.destroy(this._storedError); + } + } + +} + +function createRequestOptions(parsedUrl, headers) { + return { + protocol: parsedUrl.protocol, + auth: parsedUrl.auth, + host: parsedUrl.hostname, + port: parsedUrl.port, + path: parsedUrl.path, + method: "GET", + headers + }; +} + +class PDFNodeStreamFullReader extends BaseFullReader { + constructor(stream) { + super(stream); + + const handleResponse = response => { + if (response.statusCode === 404) { + const error = new _util.MissingPDFException(`Missing PDF "${this._url}".`); + this._storedError = error; + + this._headersCapability.reject(error); + + return; + } + + this._headersCapability.resolve(); + + this._setReadableStream(response); + + const getResponseHeader = name => { + return this._readableStream.headers[name.toLowerCase()]; + }; + + const { + allowRangeRequests, + suggestedLength + } = (0, _network_utils.validateRangeRequestCapabilities)({ + getResponseHeader, + isHttp: stream.isHttp, + rangeChunkSize: this._rangeChunkSize, + disableRange: this._disableRange + }); + this._isRangeSupported = allowRangeRequests; + this._contentLength = suggestedLength || this._contentLength; + this._filename = (0, _network_utils.extractFilenameFromHeader)(getResponseHeader); + }; + + this._request = null; + + if (this._url.protocol === "http:") { + this._request = http.request(createRequestOptions(this._url, stream.httpHeaders), handleResponse); + } else { + this._request = https.request(createRequestOptions(this._url, stream.httpHeaders), handleResponse); + } + + this._request.on("error", reason => { + this._storedError = reason; + + this._headersCapability.reject(reason); + }); + + this._request.end(); + } + +} + +class PDFNodeStreamRangeReader extends BaseRangeReader { + constructor(stream, start, end) { + super(stream); + this._httpHeaders = {}; + + for (const property in stream.httpHeaders) { + const value = stream.httpHeaders[property]; + + if (typeof value === "undefined") { + continue; + } + + this._httpHeaders[property] = value; + } + + this._httpHeaders.Range = `bytes=${start}-${end - 1}`; + + const handleResponse = response => { + if (response.statusCode === 404) { + const error = new _util.MissingPDFException(`Missing PDF "${this._url}".`); + this._storedError = error; + return; + } + + this._setReadableStream(response); + }; + + this._request = null; + + if (this._url.protocol === "http:") { + this._request = http.request(createRequestOptions(this._url, this._httpHeaders), handleResponse); + } else { + this._request = https.request(createRequestOptions(this._url, this._httpHeaders), handleResponse); + } + + this._request.on("error", reason => { + this._storedError = reason; + }); + + this._request.end(); + } + +} + +class PDFNodeStreamFsFullReader extends BaseFullReader { + constructor(stream) { + super(stream); + let path = decodeURIComponent(this._url.path); + + if (fileUriRegex.test(this._url.href)) { + path = path.replace(/^\//, ""); + } + + fs.lstat(path, (error, stat) => { + if (error) { + if (error.code === "ENOENT") { + error = new _util.MissingPDFException(`Missing PDF "${path}".`); + } + + this._storedError = error; + + this._headersCapability.reject(error); + + return; + } + + this._contentLength = stat.size; + + this._setReadableStream(fs.createReadStream(path)); + + this._headersCapability.resolve(); + }); + } + +} + +class PDFNodeStreamFsRangeReader extends BaseRangeReader { + constructor(stream, start, end) { + super(stream); + let path = decodeURIComponent(this._url.path); + + if (fileUriRegex.test(this._url.href)) { + path = path.replace(/^\//, ""); + } + + this._setReadableStream(fs.createReadStream(path, { + start, + end: end - 1 + })); + } + +} + +/***/ }), +/* 26 */ +/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.createResponseStatusError = createResponseStatusError; +exports.extractFilenameFromHeader = extractFilenameFromHeader; +exports.validateRangeRequestCapabilities = validateRangeRequestCapabilities; +exports.validateResponseStatus = validateResponseStatus; + +var _util = __w_pdfjs_require__(1); + +var _content_disposition = __w_pdfjs_require__(27); + +var _display_utils = __w_pdfjs_require__(5); + +function validateRangeRequestCapabilities({ + getResponseHeader, + isHttp, + rangeChunkSize, + disableRange +}) { + const returnValues = { + allowRangeRequests: false, + suggestedLength: undefined + }; + const length = parseInt(getResponseHeader("Content-Length"), 10); + + if (!Number.isInteger(length)) { + return returnValues; + } + + returnValues.suggestedLength = length; + + if (length <= 2 * rangeChunkSize) { + return returnValues; + } + + if (disableRange || !isHttp) { + return returnValues; + } + + if (getResponseHeader("Accept-Ranges") !== "bytes") { + return returnValues; + } + + const contentEncoding = getResponseHeader("Content-Encoding") || "identity"; + + if (contentEncoding !== "identity") { + return returnValues; + } + + returnValues.allowRangeRequests = true; + return returnValues; +} + +function extractFilenameFromHeader(getResponseHeader) { + const contentDisposition = getResponseHeader("Content-Disposition"); + + if (contentDisposition) { + let filename = (0, _content_disposition.getFilenameFromContentDispositionHeader)(contentDisposition); + + if (filename.includes("%")) { + try { + filename = decodeURIComponent(filename); + } catch (ex) {} + } + + if ((0, _display_utils.isPdfFile)(filename)) { + return filename; + } + } + + return null; +} + +function createResponseStatusError(status, url) { + if (status === 404 || status === 0 && url.startsWith("file:")) { + return new _util.MissingPDFException('Missing PDF "' + url + '".'); + } + + return new _util.UnexpectedResponseException(`Unexpected server response (${status}) while retrieving PDF "${url}".`, status); +} + +function validateResponseStatus(status) { + return status === 200 || status === 206; +} + +/***/ }), +/* 27 */ +/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.getFilenameFromContentDispositionHeader = getFilenameFromContentDispositionHeader; + +var _util = __w_pdfjs_require__(1); + +function getFilenameFromContentDispositionHeader(contentDisposition) { + let needsEncodingFixup = true; + let tmp = toParamRegExp("filename\\*", "i").exec(contentDisposition); + + if (tmp) { + tmp = tmp[1]; + let filename = rfc2616unquote(tmp); + filename = unescape(filename); + filename = rfc5987decode(filename); + filename = rfc2047decode(filename); + return fixupEncoding(filename); + } + + tmp = rfc2231getparam(contentDisposition); + + if (tmp) { + const filename = rfc2047decode(tmp); + return fixupEncoding(filename); + } + + tmp = toParamRegExp("filename", "i").exec(contentDisposition); + + if (tmp) { + tmp = tmp[1]; + let filename = rfc2616unquote(tmp); + filename = rfc2047decode(filename); + return fixupEncoding(filename); + } + + function toParamRegExp(attributePattern, flags) { + return new RegExp("(?:^|;)\\s*" + attributePattern + "\\s*=\\s*" + "(" + '[^";\\s][^;\\s]*' + "|" + '"(?:[^"\\\\]|\\\\"?)+"?' + ")", flags); + } + + function textdecode(encoding, value) { + if (encoding) { + if (!/^[\x00-\xFF]+$/.test(value)) { + return value; + } + + try { + const decoder = new TextDecoder(encoding, { + fatal: true + }); + const buffer = (0, _util.stringToBytes)(value); + value = decoder.decode(buffer); + needsEncodingFixup = false; + } catch (e) {} + } + + return value; + } + + function fixupEncoding(value) { + if (needsEncodingFixup && /[\x80-\xff]/.test(value)) { + value = textdecode("utf-8", value); + + if (needsEncodingFixup) { + value = textdecode("iso-8859-1", value); + } + } + + return value; + } + + function rfc2231getparam(contentDispositionStr) { + const matches = []; + let match; + const iter = toParamRegExp("filename\\*((?!0\\d)\\d+)(\\*?)", "ig"); + + while ((match = iter.exec(contentDispositionStr)) !== null) { + let [, n, quot, part] = match; + n = parseInt(n, 10); + + if (n in matches) { + if (n === 0) { + break; + } + + continue; + } + + matches[n] = [quot, part]; + } + + const parts = []; + + for (let n = 0; n < matches.length; ++n) { + if (!(n in matches)) { + break; + } + + let [quot, part] = matches[n]; + part = rfc2616unquote(part); + + if (quot) { + part = unescape(part); + + if (n === 0) { + part = rfc5987decode(part); + } + } + + parts.push(part); + } + + return parts.join(""); + } + + function rfc2616unquote(value) { + if (value.startsWith('"')) { + const parts = value.slice(1).split('\\"'); + + for (let i = 0; i < parts.length; ++i) { + const quotindex = parts[i].indexOf('"'); + + if (quotindex !== -1) { + parts[i] = parts[i].slice(0, quotindex); + parts.length = i + 1; + } + + parts[i] = parts[i].replace(/\\(.)/g, "$1"); + } + + value = parts.join('"'); + } + + return value; + } + + function rfc5987decode(extvalue) { + const encodingend = extvalue.indexOf("'"); + + if (encodingend === -1) { + return extvalue; + } + + const encoding = extvalue.slice(0, encodingend); + const langvalue = extvalue.slice(encodingend + 1); + const value = langvalue.replace(/^[^']*'/, ""); + return textdecode(encoding, value); + } + + function rfc2047decode(value) { + if (!value.startsWith("=?") || /[\x00-\x19\x80-\xff]/.test(value)) { + return value; + } + + return value.replace(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g, function (matches, charset, encoding, text) { + if (encoding === "q" || encoding === "Q") { + text = text.replace(/_/g, " "); + text = text.replace(/=([0-9a-fA-F]{2})/g, function (match, hex) { + return String.fromCharCode(parseInt(hex, 16)); + }); + return textdecode(charset, text); + } + + try { + text = atob(text); + } catch (e) {} + + return textdecode(charset, text); + }); + } + + return ""; +} + +/***/ }), +/* 28 */ +/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.PDFNetworkStream = void 0; + +var _util = __w_pdfjs_require__(1); + +var _network_utils = __w_pdfjs_require__(26); + +; +const OK_RESPONSE = 200; +const PARTIAL_CONTENT_RESPONSE = 206; + +function getArrayBuffer(xhr) { + const data = xhr.response; + + if (typeof data !== "string") { + return data; + } + + const array = (0, _util.stringToBytes)(data); + return array.buffer; +} + +class NetworkManager { + constructor(url, args = {}) { + this.url = url; + this.isHttp = /^https?:/i.test(url); + this.httpHeaders = this.isHttp && args.httpHeaders || Object.create(null); + this.withCredentials = args.withCredentials || false; + + this.getXhr = args.getXhr || function NetworkManager_getXhr() { + return new XMLHttpRequest(); + }; + + this.currXhrId = 0; + this.pendingRequests = Object.create(null); + } + + requestRange(begin, end, listeners) { + const args = { + begin, + end + }; + + for (const prop in listeners) { + args[prop] = listeners[prop]; + } + + return this.request(args); + } + + requestFull(listeners) { + return this.request(listeners); + } + + request(args) { + const xhr = this.getXhr(); + const xhrId = this.currXhrId++; + const pendingRequest = this.pendingRequests[xhrId] = { + xhr + }; + xhr.open("GET", this.url); + xhr.withCredentials = this.withCredentials; + + for (const property in this.httpHeaders) { + const value = this.httpHeaders[property]; + + if (typeof value === "undefined") { + continue; + } + + xhr.setRequestHeader(property, value); + } + + if (this.isHttp && "begin" in args && "end" in args) { + xhr.setRequestHeader("Range", `bytes=${args.begin}-${args.end - 1}`); + pendingRequest.expectedStatus = PARTIAL_CONTENT_RESPONSE; + } else { + pendingRequest.expectedStatus = OK_RESPONSE; + } + + xhr.responseType = "arraybuffer"; + + if (args.onError) { + xhr.onerror = function (evt) { + args.onError(xhr.status); + }; + } + + xhr.onreadystatechange = this.onStateChange.bind(this, xhrId); + xhr.onprogress = this.onProgress.bind(this, xhrId); + pendingRequest.onHeadersReceived = args.onHeadersReceived; + pendingRequest.onDone = args.onDone; + pendingRequest.onError = args.onError; + pendingRequest.onProgress = args.onProgress; + xhr.send(null); + return xhrId; + } + + onProgress(xhrId, evt) { + const pendingRequest = this.pendingRequests[xhrId]; + + if (!pendingRequest) { + return; + } + + pendingRequest.onProgress?.(evt); + } + + onStateChange(xhrId, evt) { + const pendingRequest = this.pendingRequests[xhrId]; + + if (!pendingRequest) { + return; + } + + const xhr = pendingRequest.xhr; + + if (xhr.readyState >= 2 && pendingRequest.onHeadersReceived) { + pendingRequest.onHeadersReceived(); + delete pendingRequest.onHeadersReceived; + } + + if (xhr.readyState !== 4) { + return; + } + + if (!(xhrId in this.pendingRequests)) { + return; + } + + delete this.pendingRequests[xhrId]; + + if (xhr.status === 0 && this.isHttp) { + pendingRequest.onError?.(xhr.status); + return; + } + + const xhrStatus = xhr.status || OK_RESPONSE; + const ok_response_on_range_request = xhrStatus === OK_RESPONSE && pendingRequest.expectedStatus === PARTIAL_CONTENT_RESPONSE; + + if (!ok_response_on_range_request && xhrStatus !== pendingRequest.expectedStatus) { + pendingRequest.onError?.(xhr.status); + return; + } + + const chunk = getArrayBuffer(xhr); + + if (xhrStatus === PARTIAL_CONTENT_RESPONSE) { + const rangeHeader = xhr.getResponseHeader("Content-Range"); + const matches = /bytes (\d+)-(\d+)\/(\d+)/.exec(rangeHeader); + pendingRequest.onDone({ + begin: parseInt(matches[1], 10), + chunk + }); + } else if (chunk) { + pendingRequest.onDone({ + begin: 0, + chunk + }); + } else { + pendingRequest.onError?.(xhr.status); + } + } + + getRequestXhr(xhrId) { + return this.pendingRequests[xhrId].xhr; + } + + isPendingRequest(xhrId) { + return xhrId in this.pendingRequests; + } + + abortRequest(xhrId) { + const xhr = this.pendingRequests[xhrId].xhr; + delete this.pendingRequests[xhrId]; + xhr.abort(); + } + +} + +class PDFNetworkStream { + constructor(source) { + this._source = source; + this._manager = new NetworkManager(source.url, { + httpHeaders: source.httpHeaders, + withCredentials: source.withCredentials + }); + this._rangeChunkSize = source.rangeChunkSize; + this._fullRequestReader = null; + this._rangeRequestReaders = []; + } + + _onRangeRequestReaderClosed(reader) { + const i = this._rangeRequestReaders.indexOf(reader); + + if (i >= 0) { + this._rangeRequestReaders.splice(i, 1); + } + } + + getFullReader() { + (0, _util.assert)(!this._fullRequestReader, "PDFNetworkStream.getFullReader can only be called once."); + this._fullRequestReader = new PDFNetworkStreamFullRequestReader(this._manager, this._source); + return this._fullRequestReader; + } + + getRangeReader(begin, end) { + const reader = new PDFNetworkStreamRangeRequestReader(this._manager, begin, end); + reader.onClosed = this._onRangeRequestReaderClosed.bind(this); + + this._rangeRequestReaders.push(reader); + + return reader; + } + + cancelAllRequests(reason) { + this._fullRequestReader?.cancel(reason); + + for (const reader of this._rangeRequestReaders.slice(0)) { + reader.cancel(reason); + } + } + +} + +exports.PDFNetworkStream = PDFNetworkStream; + +class PDFNetworkStreamFullRequestReader { + constructor(manager, source) { + this._manager = manager; + const args = { + onHeadersReceived: this._onHeadersReceived.bind(this), + onDone: this._onDone.bind(this), + onError: this._onError.bind(this), + onProgress: this._onProgress.bind(this) + }; + this._url = source.url; + this._fullRequestId = manager.requestFull(args); + this._headersReceivedCapability = (0, _util.createPromiseCapability)(); + this._disableRange = source.disableRange || false; + this._contentLength = source.length; + this._rangeChunkSize = source.rangeChunkSize; + + if (!this._rangeChunkSize && !this._disableRange) { + this._disableRange = true; + } + + this._isStreamingSupported = false; + this._isRangeSupported = false; + this._cachedChunks = []; + this._requests = []; + this._done = false; + this._storedError = undefined; + this._filename = null; + this.onProgress = null; + } + + _onHeadersReceived() { + const fullRequestXhrId = this._fullRequestId; + + const fullRequestXhr = this._manager.getRequestXhr(fullRequestXhrId); + + const getResponseHeader = name => { + return fullRequestXhr.getResponseHeader(name); + }; + + const { + allowRangeRequests, + suggestedLength + } = (0, _network_utils.validateRangeRequestCapabilities)({ + getResponseHeader, + isHttp: this._manager.isHttp, + rangeChunkSize: this._rangeChunkSize, + disableRange: this._disableRange + }); + + if (allowRangeRequests) { + this._isRangeSupported = true; + } + + this._contentLength = suggestedLength || this._contentLength; + this._filename = (0, _network_utils.extractFilenameFromHeader)(getResponseHeader); + + if (this._isRangeSupported) { + this._manager.abortRequest(fullRequestXhrId); + } + + this._headersReceivedCapability.resolve(); + } + + _onDone(data) { + if (data) { + if (this._requests.length > 0) { + const requestCapability = this._requests.shift(); + + requestCapability.resolve({ + value: data.chunk, + done: false + }); + } else { + this._cachedChunks.push(data.chunk); + } + } + + this._done = true; + + if (this._cachedChunks.length > 0) { + return; + } + + for (const requestCapability of this._requests) { + requestCapability.resolve({ + value: undefined, + done: true + }); + } + + this._requests.length = 0; + } + + _onError(status) { + this._storedError = (0, _network_utils.createResponseStatusError)(status, this._url); + + this._headersReceivedCapability.reject(this._storedError); + + for (const requestCapability of this._requests) { + requestCapability.reject(this._storedError); + } + + this._requests.length = 0; + this._cachedChunks.length = 0; + } + + _onProgress(evt) { + this.onProgress?.({ + loaded: evt.loaded, + total: evt.lengthComputable ? evt.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) { + const chunk = this._cachedChunks.shift(); + + return { + value: chunk, + done: false + }; + } + + if (this._done) { + return { + value: undefined, + done: true + }; + } + + const requestCapability = (0, _util.createPromiseCapability)(); + + this._requests.push(requestCapability); + + return requestCapability.promise; + } + + cancel(reason) { + this._done = true; + + this._headersReceivedCapability.reject(reason); + + for (const requestCapability of this._requests) { + requestCapability.resolve({ + value: undefined, + done: true + }); + } + + this._requests.length = 0; + + if (this._manager.isPendingRequest(this._fullRequestId)) { + this._manager.abortRequest(this._fullRequestId); + } + + this._fullRequestReader = null; + } + +} + +class PDFNetworkStreamRangeRequestReader { + constructor(manager, begin, end) { + this._manager = manager; + const args = { + onDone: this._onDone.bind(this), + onError: this._onError.bind(this), + onProgress: this._onProgress.bind(this) + }; + this._url = manager.url; + this._requestId = manager.requestRange(begin, end, args); + this._requests = []; + this._queuedChunk = null; + this._done = false; + this._storedError = undefined; + this.onProgress = null; + this.onClosed = null; + } + + _close() { + this.onClosed?.(this); + } + + _onDone(data) { + const chunk = data.chunk; + + if (this._requests.length > 0) { + const requestCapability = this._requests.shift(); + + requestCapability.resolve({ + value: chunk, + done: false + }); + } else { + this._queuedChunk = chunk; + } + + this._done = true; + + for (const requestCapability of this._requests) { + requestCapability.resolve({ + value: undefined, + done: true + }); + } + + this._requests.length = 0; + + this._close(); + } + + _onError(status) { + this._storedError = (0, _network_utils.createResponseStatusError)(status, this._url); + + for (const requestCapability of this._requests) { + requestCapability.reject(this._storedError); + } + + this._requests.length = 0; + this._queuedChunk = null; + } + + _onProgress(evt) { + if (!this.isStreamingSupported) { + this.onProgress?.({ + loaded: evt.loaded + }); + } + } + + get isStreamingSupported() { + return false; + } + + async read() { + if (this._storedError) { + throw this._storedError; + } + + if (this._queuedChunk !== null) { + const chunk = this._queuedChunk; + this._queuedChunk = null; + return { + value: chunk, + done: false + }; + } + + if (this._done) { + return { + value: undefined, + done: true + }; + } + + const requestCapability = (0, _util.createPromiseCapability)(); + + this._requests.push(requestCapability); + + return requestCapability.promise; + } + + cancel(reason) { + this._done = true; + + for (const requestCapability of this._requests) { + requestCapability.resolve({ + value: undefined, + done: true + }); + } + + this._requests.length = 0; + + if (this._manager.isPendingRequest(this._requestId)) { + this._manager.abortRequest(this._requestId); + } + + this._close(); + } + +} + +/***/ }), +/* 29 */ +/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.PDFFetchStream = void 0; + +var _util = __w_pdfjs_require__(1); + +var _network_utils = __w_pdfjs_require__(26); + +; + +function createFetchOptions(headers, withCredentials, abortController) { + return { + method: "GET", + headers, + signal: abortController?.signal, + mode: "cors", + credentials: withCredentials ? "include" : "same-origin", + redirect: "follow" + }; +} + +function createHeaders(httpHeaders) { + const headers = new Headers(); + + for (const property in httpHeaders) { + const value = httpHeaders[property]; + + if (typeof value === "undefined") { + continue; + } + + headers.append(property, value); + } + + return headers; +} + +class PDFFetchStream { + constructor(source) { + this.source = source; + this.isHttp = /^https?:/i.test(source.url); + this.httpHeaders = this.isHttp && source.httpHeaders || {}; + this._fullRequestReader = null; + this._rangeRequestReaders = []; + } + + get _progressiveDataLength() { + return this._fullRequestReader?._loaded ?? 0; + } + + getFullReader() { + (0, _util.assert)(!this._fullRequestReader, "PDFFetchStream.getFullReader can only be called once."); + this._fullRequestReader = new PDFFetchStreamReader(this); + return this._fullRequestReader; + } + + getRangeReader(begin, end) { + if (end <= this._progressiveDataLength) { + return null; + } + + const reader = new PDFFetchStreamRangeReader(this, begin, end); + + this._rangeRequestReaders.push(reader); + + return reader; + } + + cancelAllRequests(reason) { + if (this._fullRequestReader) { + this._fullRequestReader.cancel(reason); + } + + for (const reader of this._rangeRequestReaders.slice(0)) { + reader.cancel(reason); + } + } + +} + +exports.PDFFetchStream = PDFFetchStream; + +class PDFFetchStreamReader { + constructor(stream) { + this._stream = stream; + this._reader = null; + this._loaded = 0; + this._filename = null; + const source = stream.source; + this._withCredentials = source.withCredentials || false; + this._contentLength = source.length; + this._headersCapability = (0, _util.createPromiseCapability)(); + this._disableRange = source.disableRange || false; + this._rangeChunkSize = source.rangeChunkSize; + + if (!this._rangeChunkSize && !this._disableRange) { + this._disableRange = true; + } + + if (typeof AbortController !== "undefined") { + this._abortController = new AbortController(); + } + + this._isStreamingSupported = !source.disableStream; + this._isRangeSupported = !source.disableRange; + this._headers = createHeaders(this._stream.httpHeaders); + const url = source.url; + fetch(url, createFetchOptions(this._headers, this._withCredentials, this._abortController)).then(response => { + if (!(0, _network_utils.validateResponseStatus)(response.status)) { + throw (0, _network_utils.createResponseStatusError)(response.status, url); + } + + this._reader = response.body.getReader(); + + this._headersCapability.resolve(); + + const getResponseHeader = name => { + return response.headers.get(name); + }; + + const { + allowRangeRequests, + suggestedLength + } = (0, _network_utils.validateRangeRequestCapabilities)({ + getResponseHeader, + isHttp: this._stream.isHttp, + rangeChunkSize: this._rangeChunkSize, + disableRange: this._disableRange + }); + this._isRangeSupported = allowRangeRequests; + this._contentLength = suggestedLength || this._contentLength; + this._filename = (0, _network_utils.extractFilenameFromHeader)(getResponseHeader); + + if (!this._isStreamingSupported && this._isRangeSupported) { + this.cancel(new _util.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() { + await this._headersCapability.promise; + const { + value, + done + } = await this._reader.read(); + + if (done) { + return { + value, + done + }; + } + + this._loaded += value.byteLength; + + if (this.onProgress) { + this.onProgress({ + loaded: this._loaded, + total: this._contentLength + }); + } + + const buffer = new Uint8Array(value).buffer; + return { + value: buffer, + done: false + }; + } + + cancel(reason) { + if (this._reader) { + this._reader.cancel(reason); + } + + if (this._abortController) { + this._abortController.abort(); + } + } + +} + +class PDFFetchStreamRangeReader { + constructor(stream, begin, end) { + this._stream = stream; + this._reader = null; + this._loaded = 0; + const source = stream.source; + this._withCredentials = source.withCredentials || false; + this._readCapability = (0, _util.createPromiseCapability)(); + this._isStreamingSupported = !source.disableStream; + + if (typeof AbortController !== "undefined") { + this._abortController = new AbortController(); + } + + this._headers = createHeaders(this._stream.httpHeaders); + + this._headers.append("Range", `bytes=${begin}-${end - 1}`); + + const url = source.url; + fetch(url, createFetchOptions(this._headers, this._withCredentials, this._abortController)).then(response => { + if (!(0, _network_utils.validateResponseStatus)(response.status)) { + throw (0, _network_utils.createResponseStatusError)(response.status, url); + } + + this._readCapability.resolve(); + + this._reader = response.body.getReader(); + }).catch(this._readCapability.reject); + this.onProgress = null; + } + + get isStreamingSupported() { + return this._isStreamingSupported; + } + + async read() { + await this._readCapability.promise; + const { + value, + done + } = await this._reader.read(); + + if (done) { + return { + value, + done + }; + } + + this._loaded += value.byteLength; + + if (this.onProgress) { + this.onProgress({ + loaded: this._loaded + }); + } + + const buffer = new Uint8Array(value).buffer; + return { + value: buffer, + done: false + }; + } + + cancel(reason) { + if (this._reader) { + this._reader.cancel(reason); + } + + if (this._abortController) { + this._abortController.abort(); + } + } + +} + +/***/ }) +/******/ ]); +/************************************************************************/ +/******/ // The module cache +/******/ var __webpack_module_cache__ = {}; +/******/ +/******/ // The require function +/******/ function __w_pdfjs_require__(moduleId) { +/******/ // Check if module is in cache +/******/ var cachedModule = __webpack_module_cache__[moduleId]; +/******/ if (cachedModule !== undefined) { +/******/ return cachedModule.exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = __webpack_module_cache__[moduleId] = { +/******/ // no module.id needed +/******/ // no module.loaded needed +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ __webpack_modules__[moduleId](module, module.exports, __w_pdfjs_require__); +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/************************************************************************/ +var __webpack_exports__ = {}; +// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk. +(() => { +var exports = __webpack_exports__; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +Object.defineProperty(exports, "AnnotationLayer", ({ + enumerable: true, + get: function () { + return _annotation_layer.AnnotationLayer; + } +})); +Object.defineProperty(exports, "AnnotationMode", ({ + enumerable: true, + get: function () { + return _util.AnnotationMode; + } +})); +Object.defineProperty(exports, "CMapCompressionType", ({ + enumerable: true, + get: function () { + return _util.CMapCompressionType; + } +})); +Object.defineProperty(exports, "GlobalWorkerOptions", ({ + enumerable: true, + get: function () { + return _worker_options.GlobalWorkerOptions; + } +})); +Object.defineProperty(exports, "InvalidPDFException", ({ + enumerable: true, + get: function () { + return _util.InvalidPDFException; + } +})); +Object.defineProperty(exports, "LoopbackPort", ({ + enumerable: true, + get: function () { + return _api.LoopbackPort; + } +})); +Object.defineProperty(exports, "MissingPDFException", ({ + enumerable: true, + get: function () { + return _util.MissingPDFException; + } +})); +Object.defineProperty(exports, "OPS", ({ + enumerable: true, + get: function () { + return _util.OPS; + } +})); +Object.defineProperty(exports, "PDFDataRangeTransport", ({ + enumerable: true, + get: function () { + return _api.PDFDataRangeTransport; + } +})); +Object.defineProperty(exports, "PDFDateString", ({ + enumerable: true, + get: function () { + return _display_utils.PDFDateString; + } +})); +Object.defineProperty(exports, "PDFWorker", ({ + enumerable: true, + get: function () { + return _api.PDFWorker; + } +})); +Object.defineProperty(exports, "PasswordResponses", ({ + enumerable: true, + get: function () { + return _util.PasswordResponses; + } +})); +Object.defineProperty(exports, "PermissionFlag", ({ + enumerable: true, + get: function () { + return _util.PermissionFlag; + } +})); +Object.defineProperty(exports, "PixelsPerInch", ({ + enumerable: true, + get: function () { + return _display_utils.PixelsPerInch; + } +})); +Object.defineProperty(exports, "RenderingCancelledException", ({ + enumerable: true, + get: function () { + return _display_utils.RenderingCancelledException; + } +})); +Object.defineProperty(exports, "SVGGraphics", ({ + enumerable: true, + get: function () { + return _svg.SVGGraphics; + } +})); +Object.defineProperty(exports, "UNSUPPORTED_FEATURES", ({ + enumerable: true, + get: function () { + return _util.UNSUPPORTED_FEATURES; + } +})); +Object.defineProperty(exports, "UnexpectedResponseException", ({ + enumerable: true, + get: function () { + return _util.UnexpectedResponseException; + } +})); +Object.defineProperty(exports, "Util", ({ + enumerable: true, + get: function () { + return _util.Util; + } +})); +Object.defineProperty(exports, "VerbosityLevel", ({ + enumerable: true, + get: function () { + return _util.VerbosityLevel; + } +})); +Object.defineProperty(exports, "XfaLayer", ({ + enumerable: true, + get: function () { + return _xfa_layer.XfaLayer; + } +})); +Object.defineProperty(exports, "build", ({ + enumerable: true, + get: function () { + return _api.build; + } +})); +Object.defineProperty(exports, "createPromiseCapability", ({ + enumerable: true, + get: function () { + return _util.createPromiseCapability; + } +})); +Object.defineProperty(exports, "createValidAbsoluteUrl", ({ + enumerable: true, + get: function () { + return _util.createValidAbsoluteUrl; + } +})); +Object.defineProperty(exports, "getDocument", ({ + enumerable: true, + get: function () { + return _api.getDocument; + } +})); +Object.defineProperty(exports, "getFilenameFromUrl", ({ + enumerable: true, + get: function () { + return _display_utils.getFilenameFromUrl; + } +})); +Object.defineProperty(exports, "getPdfFilenameFromUrl", ({ + enumerable: true, + get: function () { + return _display_utils.getPdfFilenameFromUrl; + } +})); +Object.defineProperty(exports, "getXfaPageViewport", ({ + enumerable: true, + get: function () { + return _display_utils.getXfaPageViewport; + } +})); +Object.defineProperty(exports, "isPdfFile", ({ + enumerable: true, + get: function () { + return _display_utils.isPdfFile; + } +})); +Object.defineProperty(exports, "loadScript", ({ + enumerable: true, + get: function () { + return _display_utils.loadScript; + } +})); +Object.defineProperty(exports, "renderTextLayer", ({ + enumerable: true, + get: function () { + return _text_layer.renderTextLayer; + } +})); +Object.defineProperty(exports, "shadow", ({ + enumerable: true, + get: function () { + return _util.shadow; + } +})); +Object.defineProperty(exports, "version", ({ + enumerable: true, + get: function () { + return _api.version; + } +})); + +var _util = __w_pdfjs_require__(1); + +var _api = __w_pdfjs_require__(4); + +var _display_utils = __w_pdfjs_require__(5); + +var _annotation_layer = __w_pdfjs_require__(20); + +var _worker_options = __w_pdfjs_require__(13); + +var _is_node = __w_pdfjs_require__(3); + +var _text_layer = __w_pdfjs_require__(23); + +var _svg = __w_pdfjs_require__(24); + +var _xfa_layer = __w_pdfjs_require__(22); + +const pdfjsVersion = '2.14.305'; +const pdfjsBuild = 'eaaa8b4ad'; +{ + if (_is_node.isNodeJS) { + const { + PDFNodeStream + } = __w_pdfjs_require__(25); + + (0, _api.setPDFNetworkStreamFactory)(params => { + return new PDFNodeStream(params); + }); + } else { + const { + PDFNetworkStream + } = __w_pdfjs_require__(28); + + const { + PDFFetchStream + } = __w_pdfjs_require__(29); + + (0, _api.setPDFNetworkStreamFactory)(params => { + if ((0, _display_utils.isValidFetchUrl)(params.url)) { + return new PDFFetchStream(params); + } + + return new PDFNetworkStream(params); + }); + } +} +})(); + +/******/ return __webpack_exports__; +/******/ })() +; +}); +//# sourceMappingURL=pdf.js.map \ No newline at end of file diff --git a/public/pdf/build/pdf.js.map b/public/pdf/build/pdf.js.map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AIb,IAAI,KAAK4iE,gBAAT,EAA2B;MACzB,KAAKA,gBAAL,CAAsBv7D,KAAtB;IALW;EAxDe;;AAAA;;;;;UCxNhC;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACAA;;AAgBA;;AASA;;AAWA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAGA,MAAMy7D,eAC8B,UADpC;AAGA,MAAMC,aAC8B,WADpC;AAgB+C;EAC7C,IAAgC9iE,iBAAhC,EAA0C;IACxC,MAAM;MAAEi7D;IAAF,IAAoBh6D,mBAAOA,CAAC,EAAR,CAA1B;;IAEAE,qCAA2BS,UAAU;MACnC,OAAO,IAAIq5D,aAAJ,CAAkBr5D,MAAlB,CAAP;IADF;EAHF,OAMO;IACL,MAAM;MAAEg/D;IAAF,IAAuB3/D,mBAAOA,CAAC,EAAR,CAA7B;;IACA,MAAM;MAAEqhE;IAAF,IAAqBrhE,mBAAOA,CAAC,EAAR,CAA3B;;IAEAE,qCAA2BS,UAAU;MACnC,IAAI6b,oCAAgB7b,OAAOrO,GAAvBkqB,CAAJ,EAAiC;QAC/B,OAAO,IAAI6kD,cAAJ,CAAmB1gE,MAAnB,CAAP;MAFiC;;MAInC,OAAO,IAAIg/D,gBAAJ,CAAqBh/D,MAArB,CAAP;IAJF;EAX2C;AArF/C","sources":["webpack://pdfjs-dist/build/pdf/webpack/universalModuleDefinition","webpack://pdfjs-dist/build/pdf/src/shared/util.js","webpack://pdfjs-dist/build/pdf/src/shared/compatibility.js","webpack://pdfjs-dist/build/pdf/src/shared/is_node.js","webpack://pdfjs-dist/build/pdf/src/display/api.js","webpack://pdfjs-dist/build/pdf/src/display/display_utils.js","webpack://pdfjs-dist/build/pdf/src/display/base_factory.js","webpack://pdfjs-dist/build/pdf/src/display/font_loader.js","webpack://pdfjs-dist/build/pdf/src/display/annotation_storage.js","webpack://pdfjs-dist/build/pdf/src/shared/murmurhash3.js","webpack://pdfjs-dist/build/pdf/src/display/canvas.js","webpack://pdfjs-dist/build/pdf/src/display/pattern_helper.js","webpack://pdfjs-dist/build/pdf/src/shared/image_utils.js","webpack://pdfjs-dist/build/pdf/src/display/worker_options.js","webpack://pdfjs-dist/build/pdf/src/shared/message_handler.js","webpack://pdfjs-dist/build/pdf/src/display/metadata.js","webpack://pdfjs-dist/build/pdf/src/display/optional_content_config.js","webpack://pdfjs-dist/build/pdf/src/display/transport_stream.js","webpack://pdfjs-dist/build/pdf/src/display/xfa_text.js","webpack://pdfjs-dist/build/pdf/src/display/node_utils.js","webpack://pdfjs-dist/build/pdf/src/display/annotation_layer.js","webpack://pdfjs-dist/build/pdf/src/shared/scripting_utils.js","webpack://pdfjs-dist/build/pdf/src/display/xfa_layer.js","webpack://pdfjs-dist/build/pdf/src/display/text_layer.js","webpack://pdfjs-dist/build/pdf/src/display/svg.js","webpack://pdfjs-dist/build/pdf/src/display/node_stream.js","webpack://pdfjs-dist/build/pdf/src/display/network_utils.js","webpack://pdfjs-dist/build/pdf/src/display/content_disposition.js","webpack://pdfjs-dist/build/pdf/src/display/network.js","webpack://pdfjs-dist/build/pdf/src/display/fetch_stream.js","webpack://pdfjs-dist/build/pdf/webpack/bootstrap","webpack://pdfjs-dist/build/pdf/src/pdf.js"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"pdfjs-dist/build/pdf\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"pdfjs-dist/build/pdf\"] = factory();\n\telse\n\t\troot[\"pdfjs-dist/build/pdf\"] = factory();\n})(this, () => {\nreturn ","/* Copyright 2012 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport \"./compatibility.js\";\n\nconst IDENTITY_MATRIX = [1, 0, 0, 1, 0, 0];\nconst FONT_IDENTITY_MATRIX = [0.001, 0, 0, 0.001, 0, 0];\n\n/**\n * Refer to the `WorkerTransport.getRenderingIntent`-method in the API, to see\n * how these flags are being used:\n * - ANY, DISPLAY, and PRINT are the normal rendering intents, note the\n * `PDFPageProxy.{render, getOperatorList, getAnnotations}`-methods.\n * - ANNOTATIONS_FORMS, ANNOTATIONS_STORAGE, ANNOTATIONS_DISABLE control which\n * annotations are rendered onto the canvas (i.e. by being included in the\n * operatorList), note the `PDFPageProxy.{render, getOperatorList}`-methods\n * and their `annotationMode`-option.\n * - OPLIST is used with the `PDFPageProxy.getOperatorList`-method, note the\n * `OperatorList`-constructor (on the worker-thread).\n */\nconst RenderingIntentFlag = {\n ANY: 0x01,\n DISPLAY: 0x02,\n PRINT: 0x04,\n ANNOTATIONS_FORMS: 0x10,\n ANNOTATIONS_STORAGE: 0x20,\n ANNOTATIONS_DISABLE: 0x40,\n OPLIST: 0x100,\n};\n\nconst AnnotationMode = {\n DISABLE: 0,\n ENABLE: 1,\n ENABLE_FORMS: 2,\n ENABLE_STORAGE: 3,\n};\n\n// Permission flags from Table 22, Section 7.6.3.2 of the PDF specification.\nconst PermissionFlag = {\n PRINT: 0x04,\n MODIFY_CONTENTS: 0x08,\n COPY: 0x10,\n MODIFY_ANNOTATIONS: 0x20,\n FILL_INTERACTIVE_FORMS: 0x100,\n COPY_FOR_ACCESSIBILITY: 0x200,\n ASSEMBLE: 0x400,\n PRINT_HIGH_QUALITY: 0x800,\n};\n\nconst TextRenderingMode = {\n FILL: 0,\n STROKE: 1,\n FILL_STROKE: 2,\n INVISIBLE: 3,\n FILL_ADD_TO_PATH: 4,\n STROKE_ADD_TO_PATH: 5,\n FILL_STROKE_ADD_TO_PATH: 6,\n ADD_TO_PATH: 7,\n FILL_STROKE_MASK: 3,\n ADD_TO_PATH_FLAG: 4,\n};\n\nconst ImageKind = {\n GRAYSCALE_1BPP: 1,\n RGB_24BPP: 2,\n RGBA_32BPP: 3,\n};\n\nconst AnnotationType = {\n TEXT: 1,\n LINK: 2,\n FREETEXT: 3,\n LINE: 4,\n SQUARE: 5,\n CIRCLE: 6,\n POLYGON: 7,\n POLYLINE: 8,\n HIGHLIGHT: 9,\n UNDERLINE: 10,\n SQUIGGLY: 11,\n STRIKEOUT: 12,\n STAMP: 13,\n CARET: 14,\n INK: 15,\n POPUP: 16,\n FILEATTACHMENT: 17,\n SOUND: 18,\n MOVIE: 19,\n WIDGET: 20,\n SCREEN: 21,\n PRINTERMARK: 22,\n TRAPNET: 23,\n WATERMARK: 24,\n THREED: 25,\n REDACT: 26,\n};\n\nconst AnnotationStateModelType = {\n MARKED: \"Marked\",\n REVIEW: \"Review\",\n};\n\nconst AnnotationMarkedState = {\n MARKED: \"Marked\",\n UNMARKED: \"Unmarked\",\n};\n\nconst AnnotationReviewState = {\n ACCEPTED: \"Accepted\",\n REJECTED: \"Rejected\",\n CANCELLED: \"Cancelled\",\n COMPLETED: \"Completed\",\n NONE: \"None\",\n};\n\nconst AnnotationReplyType = {\n GROUP: \"Group\",\n REPLY: \"R\",\n};\n\nconst AnnotationFlag = {\n INVISIBLE: 0x01,\n HIDDEN: 0x02,\n PRINT: 0x04,\n NOZOOM: 0x08,\n NOROTATE: 0x10,\n NOVIEW: 0x20,\n READONLY: 0x40,\n LOCKED: 0x80,\n TOGGLENOVIEW: 0x100,\n LOCKEDCONTENTS: 0x200,\n};\n\nconst AnnotationFieldFlag = {\n READONLY: 0x0000001,\n REQUIRED: 0x0000002,\n NOEXPORT: 0x0000004,\n MULTILINE: 0x0001000,\n PASSWORD: 0x0002000,\n NOTOGGLETOOFF: 0x0004000,\n RADIO: 0x0008000,\n PUSHBUTTON: 0x0010000,\n COMBO: 0x0020000,\n EDIT: 0x0040000,\n SORT: 0x0080000,\n FILESELECT: 0x0100000,\n MULTISELECT: 0x0200000,\n DONOTSPELLCHECK: 0x0400000,\n DONOTSCROLL: 0x0800000,\n COMB: 0x1000000,\n RICHTEXT: 0x2000000,\n RADIOSINUNISON: 0x2000000,\n COMMITONSELCHANGE: 0x4000000,\n};\n\nconst AnnotationBorderStyleType = {\n SOLID: 1,\n DASHED: 2,\n BEVELED: 3,\n INSET: 4,\n UNDERLINE: 5,\n};\n\nconst AnnotationActionEventType = {\n E: \"Mouse Enter\",\n X: \"Mouse Exit\",\n D: \"Mouse Down\",\n U: \"Mouse Up\",\n Fo: \"Focus\",\n Bl: \"Blur\",\n PO: \"PageOpen\",\n PC: \"PageClose\",\n PV: \"PageVisible\",\n PI: \"PageInvisible\",\n K: \"Keystroke\",\n F: \"Format\",\n V: \"Validate\",\n C: \"Calculate\",\n};\n\nconst DocumentActionEventType = {\n WC: \"WillClose\",\n WS: \"WillSave\",\n DS: \"DidSave\",\n WP: \"WillPrint\",\n DP: \"DidPrint\",\n};\n\nconst PageActionEventType = {\n O: \"PageOpen\",\n C: \"PageClose\",\n};\n\nconst StreamType = {\n UNKNOWN: \"UNKNOWN\",\n FLATE: \"FLATE\",\n LZW: \"LZW\",\n DCT: \"DCT\",\n JPX: \"JPX\",\n JBIG: \"JBIG\",\n A85: \"A85\",\n AHX: \"AHX\",\n CCF: \"CCF\",\n RLX: \"RLX\", // PDF short name is 'RL', but telemetry requires three chars.\n};\n\nconst FontType = {\n UNKNOWN: \"UNKNOWN\",\n TYPE1: \"TYPE1\",\n TYPE1STANDARD: \"TYPE1STANDARD\",\n TYPE1C: \"TYPE1C\",\n CIDFONTTYPE0: \"CIDFONTTYPE0\",\n CIDFONTTYPE0C: \"CIDFONTTYPE0C\",\n TRUETYPE: \"TRUETYPE\",\n CIDFONTTYPE2: \"CIDFONTTYPE2\",\n TYPE3: \"TYPE3\",\n OPENTYPE: \"OPENTYPE\",\n TYPE0: \"TYPE0\",\n MMTYPE1: \"MMTYPE1\",\n};\n\nconst VerbosityLevel = {\n ERRORS: 0,\n WARNINGS: 1,\n INFOS: 5,\n};\n\nconst CMapCompressionType = {\n NONE: 0,\n BINARY: 1,\n STREAM: 2,\n};\n\n// All the possible operations for an operator list.\nconst OPS = {\n // Intentionally start from 1 so it is easy to spot bad operators that will be\n // 0's.\n dependency: 1,\n setLineWidth: 2,\n setLineCap: 3,\n setLineJoin: 4,\n setMiterLimit: 5,\n setDash: 6,\n setRenderingIntent: 7,\n setFlatness: 8,\n setGState: 9,\n save: 10,\n restore: 11,\n transform: 12,\n moveTo: 13,\n lineTo: 14,\n curveTo: 15,\n curveTo2: 16,\n curveTo3: 17,\n closePath: 18,\n rectangle: 19,\n stroke: 20,\n closeStroke: 21,\n fill: 22,\n eoFill: 23,\n fillStroke: 24,\n eoFillStroke: 25,\n closeFillStroke: 26,\n closeEOFillStroke: 27,\n endPath: 28,\n clip: 29,\n eoClip: 30,\n beginText: 31,\n endText: 32,\n setCharSpacing: 33,\n setWordSpacing: 34,\n setHScale: 35,\n setLeading: 36,\n setFont: 37,\n setTextRenderingMode: 38,\n setTextRise: 39,\n moveText: 40,\n setLeadingMoveText: 41,\n setTextMatrix: 42,\n nextLine: 43,\n showText: 44,\n showSpacedText: 45,\n nextLineShowText: 46,\n nextLineSetSpacingShowText: 47,\n setCharWidth: 48,\n setCharWidthAndBounds: 49,\n setStrokeColorSpace: 50,\n setFillColorSpace: 51,\n setStrokeColor: 52,\n setStrokeColorN: 53,\n setFillColor: 54,\n setFillColorN: 55,\n setStrokeGray: 56,\n setFillGray: 57,\n setStrokeRGBColor: 58,\n setFillRGBColor: 59,\n setStrokeCMYKColor: 60,\n setFillCMYKColor: 61,\n shadingFill: 62,\n beginInlineImage: 63,\n beginImageData: 64,\n endInlineImage: 65,\n paintXObject: 66,\n markPoint: 67,\n markPointProps: 68,\n beginMarkedContent: 69,\n beginMarkedContentProps: 70,\n endMarkedContent: 71,\n beginCompat: 72,\n endCompat: 73,\n paintFormXObjectBegin: 74,\n paintFormXObjectEnd: 75,\n beginGroup: 76,\n endGroup: 77,\n beginAnnotations: 78,\n endAnnotations: 79,\n beginAnnotation: 80,\n endAnnotation: 81,\n /** @deprecated unused */\n paintJpegXObject: 82,\n paintImageMaskXObject: 83,\n paintImageMaskXObjectGroup: 84,\n paintImageXObject: 85,\n paintInlineImageXObject: 86,\n paintInlineImageXObjectGroup: 87,\n paintImageXObjectRepeat: 88,\n paintImageMaskXObjectRepeat: 89,\n paintSolidColorImageMask: 90,\n constructPath: 91,\n};\n\nconst UNSUPPORTED_FEATURES = {\n /** @deprecated unused */\n unknown: \"unknown\",\n forms: \"forms\",\n javaScript: \"javaScript\",\n signatures: \"signatures\",\n smask: \"smask\",\n shadingPattern: \"shadingPattern\",\n /** @deprecated unused */\n font: \"font\",\n errorTilingPattern: \"errorTilingPattern\",\n errorExtGState: \"errorExtGState\",\n errorXObject: \"errorXObject\",\n errorFontLoadType3: \"errorFontLoadType3\",\n errorFontState: \"errorFontState\",\n errorFontMissing: \"errorFontMissing\",\n errorFontTranslate: \"errorFontTranslate\",\n errorColorSpace: \"errorColorSpace\",\n errorOperatorList: \"errorOperatorList\",\n errorFontToUnicode: \"errorFontToUnicode\",\n errorFontLoadNative: \"errorFontLoadNative\",\n errorFontBuildPath: \"errorFontBuildPath\",\n errorFontGetPath: \"errorFontGetPath\",\n errorMarkedContent: \"errorMarkedContent\",\n errorContentSubStream: \"errorContentSubStream\",\n};\n\nconst PasswordResponses = {\n NEED_PASSWORD: 1,\n INCORRECT_PASSWORD: 2,\n};\n\nlet verbosity = VerbosityLevel.WARNINGS;\n\nfunction setVerbosityLevel(level) {\n if (Number.isInteger(level)) {\n verbosity = level;\n }\n}\n\nfunction getVerbosityLevel() {\n return verbosity;\n}\n\n// A notice for devs. These are good for things that are helpful to devs, such\n// as warning that Workers were disabled, which is important to devs but not\n// end users.\nfunction info(msg) {\n if (verbosity >= VerbosityLevel.INFOS) {\n console.log(`Info: ${msg}`);\n }\n}\n\n// Non-fatal warnings.\nfunction warn(msg) {\n if (verbosity >= VerbosityLevel.WARNINGS) {\n console.log(`Warning: ${msg}`);\n }\n}\n\nfunction unreachable(msg) {\n throw new Error(msg);\n}\n\nfunction assert(cond, msg) {\n if (!cond) {\n unreachable(msg);\n }\n}\n\n// Checks if URLs use one of the allowed protocols, e.g. to avoid XSS.\nfunction _isValidProtocol(url) {\n if (!url) {\n return false;\n }\n switch (url.protocol) {\n case \"http:\":\n case \"https:\":\n case \"ftp:\":\n case \"mailto:\":\n case \"tel:\":\n return true;\n default:\n return false;\n }\n}\n\n/**\n * Attempts to create a valid absolute URL.\n *\n * @param {URL|string} url - An absolute, or relative, URL.\n * @param {URL|string} [baseUrl] - An absolute URL.\n * @param {Object} [options]\n * @returns Either a valid {URL}, or `null` otherwise.\n */\nfunction createValidAbsoluteUrl(url, baseUrl = null, options = null) {\n if (!url) {\n return null;\n }\n try {\n if (options && typeof url === \"string\") {\n // Let URLs beginning with \"www.\" default to using the \"http://\" protocol.\n if (options.addDefaultProtocol && url.startsWith(\"www.\")) {\n const dots = url.match(/\\./g);\n // Avoid accidentally matching a *relative* URL pointing to a file named\n // e.g. \"www.pdf\" or similar.\n if (dots && dots.length >= 2) {\n url = `http://${url}`;\n }\n }\n\n // According to ISO 32000-1:2008, section 12.6.4.7, URIs should be encoded\n // in 7-bit ASCII. Some bad PDFs use UTF-8 encoding; see bug 1122280.\n if (options.tryConvertEncoding) {\n try {\n url = stringToUTF8String(url);\n } catch (ex) {}\n }\n }\n\n const absoluteUrl = baseUrl ? new URL(url, baseUrl) : new URL(url);\n if (_isValidProtocol(absoluteUrl)) {\n return absoluteUrl;\n }\n } catch (ex) {\n /* `new URL()` will throw on incorrect data. */\n }\n return null;\n}\n\nfunction shadow(obj, prop, value) {\n if (\n typeof PDFJSDev === \"undefined\" ||\n PDFJSDev.test(\"!PRODUCTION || TESTING\")\n ) {\n assert(\n prop in obj,\n `shadow: Property \"${prop && prop.toString()}\" not found in object.`\n );\n }\n Object.defineProperty(obj, prop, {\n value,\n enumerable: true,\n configurable: true,\n writable: false,\n });\n return value;\n}\n\n/**\n * @type {any}\n */\nconst BaseException = (function BaseExceptionClosure() {\n // eslint-disable-next-line no-shadow\n function BaseException(message, name) {\n if (this.constructor === BaseException) {\n unreachable(\"Cannot initialize BaseException.\");\n }\n this.message = message;\n this.name = name;\n }\n BaseException.prototype = new Error();\n BaseException.constructor = BaseException;\n\n return BaseException;\n})();\n\nclass PasswordException extends BaseException {\n constructor(msg, code) {\n super(msg, \"PasswordException\");\n this.code = code;\n }\n}\n\nclass UnknownErrorException extends BaseException {\n constructor(msg, details) {\n super(msg, \"UnknownErrorException\");\n this.details = details;\n }\n}\n\nclass InvalidPDFException extends BaseException {\n constructor(msg) {\n super(msg, \"InvalidPDFException\");\n }\n}\n\nclass MissingPDFException extends BaseException {\n constructor(msg) {\n super(msg, \"MissingPDFException\");\n }\n}\n\nclass UnexpectedResponseException extends BaseException {\n constructor(msg, status) {\n super(msg, \"UnexpectedResponseException\");\n this.status = status;\n }\n}\n\n/**\n * Error caused during parsing PDF data.\n */\nclass FormatError extends BaseException {\n constructor(msg) {\n super(msg, \"FormatError\");\n }\n}\n\n/**\n * Error used to indicate task cancellation.\n */\nclass AbortException extends BaseException {\n constructor(msg) {\n super(msg, \"AbortException\");\n }\n}\n\nfunction bytesToString(bytes) {\n if (\n typeof bytes !== \"object\" ||\n bytes === null ||\n bytes.length === undefined\n ) {\n unreachable(\"Invalid argument for bytesToString\");\n }\n const length = bytes.length;\n const MAX_ARGUMENT_COUNT = 8192;\n if (length < MAX_ARGUMENT_COUNT) {\n return String.fromCharCode.apply(null, bytes);\n }\n const strBuf = [];\n for (let i = 0; i < length; i += MAX_ARGUMENT_COUNT) {\n const chunkEnd = Math.min(i + MAX_ARGUMENT_COUNT, length);\n const chunk = bytes.subarray(i, chunkEnd);\n strBuf.push(String.fromCharCode.apply(null, chunk));\n }\n return strBuf.join(\"\");\n}\n\nfunction stringToBytes(str) {\n if (typeof str !== \"string\") {\n unreachable(\"Invalid argument for stringToBytes\");\n }\n const length = str.length;\n const bytes = new Uint8Array(length);\n for (let i = 0; i < length; ++i) {\n bytes[i] = str.charCodeAt(i) & 0xff;\n }\n return bytes;\n}\n\n/**\n * Gets length of the array (Array, Uint8Array, or string) in bytes.\n * @param {Array|Uint8Array|string} arr\n * @returns {number}\n */\n// eslint-disable-next-line consistent-return\nfunction arrayByteLength(arr) {\n if (arr.length !== undefined) {\n return arr.length;\n }\n if (arr.byteLength !== undefined) {\n return arr.byteLength;\n }\n unreachable(\"Invalid argument for arrayByteLength\");\n}\n\n/**\n * Combines array items (arrays) into single Uint8Array object.\n * @param {Array|Uint8Array|string>} arr - the array of the arrays\n * (Array, Uint8Array, or string).\n * @returns {Uint8Array}\n */\nfunction arraysToBytes(arr) {\n const length = arr.length;\n // Shortcut: if first and only item is Uint8Array, return it.\n if (length === 1 && arr[0] instanceof Uint8Array) {\n return arr[0];\n }\n let resultLength = 0;\n for (let i = 0; i < length; i++) {\n resultLength += arrayByteLength(arr[i]);\n }\n let pos = 0;\n const data = new Uint8Array(resultLength);\n for (let i = 0; i < length; i++) {\n let item = arr[i];\n if (!(item instanceof Uint8Array)) {\n if (typeof item === \"string\") {\n item = stringToBytes(item);\n } else {\n item = new Uint8Array(item);\n }\n }\n const itemLength = item.byteLength;\n data.set(item, pos);\n pos += itemLength;\n }\n return data;\n}\n\nfunction string32(value) {\n if (\n typeof PDFJSDev === \"undefined\" ||\n PDFJSDev.test(\"!PRODUCTION || TESTING\")\n ) {\n assert(\n typeof value === \"number\" && Math.abs(value) < 2 ** 32,\n `string32: Unexpected input \"${value}\".`\n );\n }\n return String.fromCharCode(\n (value >> 24) & 0xff,\n (value >> 16) & 0xff,\n (value >> 8) & 0xff,\n value & 0xff\n );\n}\n\nfunction objectSize(obj) {\n return Object.keys(obj).length;\n}\n\n// Ensure that the returned Object has a `null` prototype; hence why\n// `Object.fromEntries(...)` is not used.\nfunction objectFromMap(map) {\n const obj = Object.create(null);\n for (const [key, value] of map) {\n obj[key] = value;\n }\n return obj;\n}\n\n// Checks the endianness of the platform.\nfunction isLittleEndian() {\n const buffer8 = new Uint8Array(4);\n buffer8[0] = 1;\n const view32 = new Uint32Array(buffer8.buffer, 0, 1);\n return view32[0] === 1;\n}\n\n// Checks if it's possible to eval JS expressions.\nfunction isEvalSupported() {\n try {\n new Function(\"\"); // eslint-disable-line no-new, no-new-func\n return true;\n } catch (e) {\n return false;\n }\n}\n\nclass FeatureTest {\n static get isLittleEndian() {\n return shadow(this, \"isLittleEndian\", isLittleEndian());\n }\n\n static get isEvalSupported() {\n return shadow(this, \"isEvalSupported\", isEvalSupported());\n }\n\n static get isOffscreenCanvasSupported() {\n return shadow(\n this,\n \"isOffscreenCanvasSupported\",\n typeof OffscreenCanvas !== \"undefined\"\n );\n }\n}\n\nconst hexNumbers = [...Array(256).keys()].map(n =>\n n.toString(16).padStart(2, \"0\")\n);\n\nclass Util {\n static makeHexColor(r, g, b) {\n return `#${hexNumbers[r]}${hexNumbers[g]}${hexNumbers[b]}`;\n }\n\n // Apply a scaling matrix to some min/max values.\n // If a scaling factor is negative then min and max must be\n // swaped.\n static scaleMinMax(transform, minMax) {\n let temp;\n if (transform[0]) {\n if (transform[0] < 0) {\n temp = minMax[0];\n minMax[0] = minMax[1];\n minMax[1] = temp;\n }\n minMax[0] *= transform[0];\n minMax[1] *= transform[0];\n\n if (transform[3] < 0) {\n temp = minMax[2];\n minMax[2] = minMax[3];\n minMax[3] = temp;\n }\n minMax[2] *= transform[3];\n minMax[3] *= transform[3];\n } else {\n temp = minMax[0];\n minMax[0] = minMax[2];\n minMax[2] = temp;\n temp = minMax[1];\n minMax[1] = minMax[3];\n minMax[3] = temp;\n\n if (transform[1] < 0) {\n temp = minMax[2];\n minMax[2] = minMax[3];\n minMax[3] = temp;\n }\n minMax[2] *= transform[1];\n minMax[3] *= transform[1];\n\n if (transform[2] < 0) {\n temp = minMax[0];\n minMax[0] = minMax[1];\n minMax[1] = temp;\n }\n minMax[0] *= transform[2];\n minMax[1] *= transform[2];\n }\n minMax[0] += transform[4];\n minMax[1] += transform[4];\n minMax[2] += transform[5];\n minMax[3] += transform[5];\n }\n\n // Concatenates two transformation matrices together and returns the result.\n static transform(m1, m2) {\n return [\n m1[0] * m2[0] + m1[2] * m2[1],\n m1[1] * m2[0] + m1[3] * m2[1],\n m1[0] * m2[2] + m1[2] * m2[3],\n m1[1] * m2[2] + m1[3] * m2[3],\n m1[0] * m2[4] + m1[2] * m2[5] + m1[4],\n m1[1] * m2[4] + m1[3] * m2[5] + m1[5],\n ];\n }\n\n // For 2d affine transforms\n static applyTransform(p, m) {\n const xt = p[0] * m[0] + p[1] * m[2] + m[4];\n const yt = p[0] * m[1] + p[1] * m[3] + m[5];\n return [xt, yt];\n }\n\n static applyInverseTransform(p, m) {\n const d = m[0] * m[3] - m[1] * m[2];\n const xt = (p[0] * m[3] - p[1] * m[2] + m[2] * m[5] - m[4] * m[3]) / d;\n const yt = (-p[0] * m[1] + p[1] * m[0] + m[4] * m[1] - m[5] * m[0]) / d;\n return [xt, yt];\n }\n\n // Applies the transform to the rectangle and finds the minimum axially\n // aligned bounding box.\n static getAxialAlignedBoundingBox(r, m) {\n const p1 = Util.applyTransform(r, m);\n const p2 = Util.applyTransform(r.slice(2, 4), m);\n const p3 = Util.applyTransform([r[0], r[3]], m);\n const p4 = Util.applyTransform([r[2], r[1]], m);\n return [\n Math.min(p1[0], p2[0], p3[0], p4[0]),\n Math.min(p1[1], p2[1], p3[1], p4[1]),\n Math.max(p1[0], p2[0], p3[0], p4[0]),\n Math.max(p1[1], p2[1], p3[1], p4[1]),\n ];\n }\n\n static inverseTransform(m) {\n const d = m[0] * m[3] - m[1] * m[2];\n return [\n m[3] / d,\n -m[1] / d,\n -m[2] / d,\n m[0] / d,\n (m[2] * m[5] - m[4] * m[3]) / d,\n (m[4] * m[1] - m[5] * m[0]) / d,\n ];\n }\n\n // Apply a generic 3d matrix M on a 3-vector v:\n // | a b c | | X |\n // | d e f | x | Y |\n // | g h i | | Z |\n // M is assumed to be serialized as [a,b,c,d,e,f,g,h,i],\n // with v as [X,Y,Z]\n static apply3dTransform(m, v) {\n return [\n m[0] * v[0] + m[1] * v[1] + m[2] * v[2],\n m[3] * v[0] + m[4] * v[1] + m[5] * v[2],\n m[6] * v[0] + m[7] * v[1] + m[8] * v[2],\n ];\n }\n\n // This calculation uses Singular Value Decomposition.\n // The SVD can be represented with formula A = USV. We are interested in the\n // matrix S here because it represents the scale values.\n static singularValueDecompose2dScale(m) {\n const transpose = [m[0], m[2], m[1], m[3]];\n\n // Multiply matrix m with its transpose.\n const a = m[0] * transpose[0] + m[1] * transpose[2];\n const b = m[0] * transpose[1] + m[1] * transpose[3];\n const c = m[2] * transpose[0] + m[3] * transpose[2];\n const d = m[2] * transpose[1] + m[3] * transpose[3];\n\n // Solve the second degree polynomial to get roots.\n const first = (a + d) / 2;\n const second = Math.sqrt((a + d) ** 2 - 4 * (a * d - c * b)) / 2;\n const sx = first + second || 1;\n const sy = first - second || 1;\n\n // Scale values are the square roots of the eigenvalues.\n return [Math.sqrt(sx), Math.sqrt(sy)];\n }\n\n // Normalize rectangle rect=[x1, y1, x2, y2] so that (x1,y1) < (x2,y2)\n // For coordinate systems whose origin lies in the bottom-left, this\n // means normalization to (BL,TR) ordering. For systems with origin in the\n // top-left, this means (TL,BR) ordering.\n static normalizeRect(rect) {\n const r = rect.slice(0); // clone rect\n if (rect[0] > rect[2]) {\n r[0] = rect[2];\n r[2] = rect[0];\n }\n if (rect[1] > rect[3]) {\n r[1] = rect[3];\n r[3] = rect[1];\n }\n return r;\n }\n\n // Returns a rectangle [x1, y1, x2, y2] corresponding to the\n // intersection of rect1 and rect2. If no intersection, returns 'null'\n // The rectangle coordinates of rect1, rect2 should be [x1, y1, x2, y2]\n static intersect(rect1, rect2) {\n const xLow = Math.max(\n Math.min(rect1[0], rect1[2]),\n Math.min(rect2[0], rect2[2])\n );\n const xHigh = Math.min(\n Math.max(rect1[0], rect1[2]),\n Math.max(rect2[0], rect2[2])\n );\n if (xLow > xHigh) {\n return null;\n }\n const yLow = Math.max(\n Math.min(rect1[1], rect1[3]),\n Math.min(rect2[1], rect2[3])\n );\n const yHigh = Math.min(\n Math.max(rect1[1], rect1[3]),\n Math.max(rect2[1], rect2[3])\n );\n if (yLow > yHigh) {\n return null;\n }\n\n return [xLow, yLow, xHigh, yHigh];\n }\n\n // From https://github.com/adobe-webplatform/Snap.svg/blob/b365287722a72526000ac4bfcf0ce4cac2faa015/src/path.js#L852\n static bezierBoundingBox(x0, y0, x1, y1, x2, y2, x3, y3) {\n const tvalues = [],\n bounds = [[], []];\n let a, b, c, t, t1, t2, b2ac, sqrtb2ac;\n for (let i = 0; i < 2; ++i) {\n if (i === 0) {\n b = 6 * x0 - 12 * x1 + 6 * x2;\n a = -3 * x0 + 9 * x1 - 9 * x2 + 3 * x3;\n c = 3 * x1 - 3 * x0;\n } else {\n b = 6 * y0 - 12 * y1 + 6 * y2;\n a = -3 * y0 + 9 * y1 - 9 * y2 + 3 * y3;\n c = 3 * y1 - 3 * y0;\n }\n if (Math.abs(a) < 1e-12) {\n if (Math.abs(b) < 1e-12) {\n continue;\n }\n t = -c / b;\n if (0 < t && t < 1) {\n tvalues.push(t);\n }\n continue;\n }\n b2ac = b * b - 4 * c * a;\n sqrtb2ac = Math.sqrt(b2ac);\n if (b2ac < 0) {\n continue;\n }\n t1 = (-b + sqrtb2ac) / (2 * a);\n if (0 < t1 && t1 < 1) {\n tvalues.push(t1);\n }\n t2 = (-b - sqrtb2ac) / (2 * a);\n if (0 < t2 && t2 < 1) {\n tvalues.push(t2);\n }\n }\n\n let j = tvalues.length,\n mt;\n const jlen = j;\n while (j--) {\n t = tvalues[j];\n mt = 1 - t;\n bounds[0][j] =\n mt * mt * mt * x0 +\n 3 * mt * mt * t * x1 +\n 3 * mt * t * t * x2 +\n t * t * t * x3;\n bounds[1][j] =\n mt * mt * mt * y0 +\n 3 * mt * mt * t * y1 +\n 3 * mt * t * t * y2 +\n t * t * t * y3;\n }\n\n bounds[0][jlen] = x0;\n bounds[1][jlen] = y0;\n bounds[0][jlen + 1] = x3;\n bounds[1][jlen + 1] = y3;\n bounds[0].length = bounds[1].length = jlen + 2;\n\n return [\n Math.min(...bounds[0]),\n Math.min(...bounds[1]),\n Math.max(...bounds[0]),\n Math.max(...bounds[1]),\n ];\n }\n}\n\nconst PDFStringTranslateTable = [\n 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x2d8,\n 0x2c7, 0x2c6, 0x2d9, 0x2dd, 0x2db, 0x2da, 0x2dc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n 0, 0, 0, 0, 0, 0, 0, 0, 0x2022, 0x2020, 0x2021, 0x2026, 0x2014, 0x2013, 0x192,\n 0x2044, 0x2039, 0x203a, 0x2212, 0x2030, 0x201e, 0x201c, 0x201d, 0x2018,\n 0x2019, 0x201a, 0x2122, 0xfb01, 0xfb02, 0x141, 0x152, 0x160, 0x178, 0x17d,\n 0x131, 0x142, 0x153, 0x161, 0x17e, 0, 0x20ac,\n];\n\nfunction stringToPDFString(str) {\n if (str[0] >= \"\\xEF\") {\n let encoding;\n if (str[0] === \"\\xFE\" && str[1] === \"\\xFF\") {\n encoding = \"utf-16be\";\n } else if (str[0] === \"\\xFF\" && str[1] === \"\\xFE\") {\n encoding = \"utf-16le\";\n } else if (str[0] === \"\\xEF\" && str[1] === \"\\xBB\" && str[2] === \"\\xBF\") {\n encoding = \"utf-8\";\n }\n\n if (encoding) {\n try {\n const decoder = new TextDecoder(encoding, { fatal: true });\n const buffer = stringToBytes(str);\n return decoder.decode(buffer);\n } catch (ex) {\n warn(`stringToPDFString: \"${ex}\".`);\n }\n }\n }\n // ISO Latin 1\n const strBuf = [];\n for (let i = 0, ii = str.length; i < ii; i++) {\n const code = PDFStringTranslateTable[str.charCodeAt(i)];\n strBuf.push(code ? String.fromCharCode(code) : str.charAt(i));\n }\n return strBuf.join(\"\");\n}\n\nfunction escapeString(str) {\n // replace \"(\", \")\", \"\\n\", \"\\r\" and \"\\\"\n // by \"\\(\", \"\\)\", \"\\\\n\", \"\\\\r\" and \"\\\\\"\n // in order to write it in a PDF file.\n return str.replace(/([()\\\\\\n\\r])/g, match => {\n if (match === \"\\n\") {\n return \"\\\\n\";\n } else if (match === \"\\r\") {\n return \"\\\\r\";\n }\n return `\\\\${match}`;\n });\n}\n\nfunction isAscii(str) {\n return /^[\\x00-\\x7F]*$/.test(str);\n}\n\nfunction stringToUTF16BEString(str) {\n const buf = [\"\\xFE\\xFF\"];\n for (let i = 0, ii = str.length; i < ii; i++) {\n const char = str.charCodeAt(i);\n buf.push(\n String.fromCharCode((char >> 8) & 0xff),\n String.fromCharCode(char & 0xff)\n );\n }\n return buf.join(\"\");\n}\n\nfunction stringToUTF8String(str) {\n return decodeURIComponent(escape(str));\n}\n\nfunction utf8StringToString(str) {\n return unescape(encodeURIComponent(str));\n}\n\nfunction isArrayBuffer(v) {\n return typeof v === \"object\" && v !== null && v.byteLength !== undefined;\n}\n\nfunction isArrayEqual(arr1, arr2) {\n if (arr1.length !== arr2.length) {\n return false;\n }\n for (let i = 0, ii = arr1.length; i < ii; i++) {\n if (arr1[i] !== arr2[i]) {\n return false;\n }\n }\n return true;\n}\n\nfunction getModificationDate(date = new Date()) {\n const buffer = [\n date.getUTCFullYear().toString(),\n (date.getUTCMonth() + 1).toString().padStart(2, \"0\"),\n date.getUTCDate().toString().padStart(2, \"0\"),\n date.getUTCHours().toString().padStart(2, \"0\"),\n date.getUTCMinutes().toString().padStart(2, \"0\"),\n date.getUTCSeconds().toString().padStart(2, \"0\"),\n ];\n\n return buffer.join(\"\");\n}\n\n/**\n * Promise Capability object.\n *\n * @typedef {Object} PromiseCapability\n * @property {Promise} promise - A Promise object.\n * @property {boolean} settled - If the Promise has been fulfilled/rejected.\n * @property {function} resolve - Fulfills the Promise.\n * @property {function} reject - Rejects the Promise.\n */\n\n/**\n * Creates a promise capability object.\n * @alias createPromiseCapability\n *\n * @returns {PromiseCapability}\n */\nfunction createPromiseCapability() {\n const capability = Object.create(null);\n let isSettled = false;\n\n Object.defineProperty(capability, \"settled\", {\n get() {\n return isSettled;\n },\n });\n capability.promise = new Promise(function (resolve, reject) {\n capability.resolve = function (data) {\n isSettled = true;\n resolve(data);\n };\n capability.reject = function (reason) {\n isSettled = true;\n reject(reason);\n };\n });\n return capability;\n}\n\nexport {\n AbortException,\n AnnotationActionEventType,\n AnnotationBorderStyleType,\n AnnotationFieldFlag,\n AnnotationFlag,\n AnnotationMarkedState,\n AnnotationMode,\n AnnotationReplyType,\n AnnotationReviewState,\n AnnotationStateModelType,\n AnnotationType,\n arrayByteLength,\n arraysToBytes,\n assert,\n BaseException,\n bytesToString,\n CMapCompressionType,\n createPromiseCapability,\n createValidAbsoluteUrl,\n DocumentActionEventType,\n escapeString,\n FeatureTest,\n FONT_IDENTITY_MATRIX,\n FontType,\n FormatError,\n getModificationDate,\n getVerbosityLevel,\n IDENTITY_MATRIX,\n ImageKind,\n info,\n InvalidPDFException,\n isArrayBuffer,\n isArrayEqual,\n isAscii,\n MissingPDFException,\n objectFromMap,\n objectSize,\n OPS,\n PageActionEventType,\n PasswordException,\n PasswordResponses,\n PermissionFlag,\n RenderingIntentFlag,\n setVerbosityLevel,\n shadow,\n StreamType,\n string32,\n stringToBytes,\n stringToPDFString,\n stringToUTF16BEString,\n stringToUTF8String,\n TextRenderingMode,\n UnexpectedResponseException,\n UnknownErrorException,\n unreachable,\n UNSUPPORTED_FEATURES,\n utf8StringToString,\n Util,\n VerbosityLevel,\n warn,\n};\n","/* Copyright 2017 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/* globals __non_webpack_require__ */\n\nimport { isNodeJS } from \"./is_node.js\";\n\n// Skip compatibility checks for modern builds and if we already ran the module.\nif (\n (typeof PDFJSDev === \"undefined\" || !PDFJSDev.test(\"SKIP_BABEL\")) &&\n !globalThis._pdfjsCompatibilityChecked\n) {\n globalThis._pdfjsCompatibilityChecked = true;\n\n // Support: Node.js\n (function checkNodeBtoa() {\n if (globalThis.btoa || !isNodeJS) {\n return;\n }\n globalThis.btoa = function (chars) {\n // eslint-disable-next-line no-undef\n return Buffer.from(chars, \"binary\").toString(\"base64\");\n };\n })();\n\n // Support: Node.js\n (function checkNodeAtob() {\n if (globalThis.atob || !isNodeJS) {\n return;\n }\n globalThis.atob = function (input) {\n // eslint-disable-next-line no-undef\n return Buffer.from(input, \"base64\").toString(\"binary\");\n };\n })();\n\n // Support: Node.js\n (function checkDOMMatrix() {\n if (globalThis.DOMMatrix || !isNodeJS) {\n return;\n }\n globalThis.DOMMatrix = __non_webpack_require__(\n \"dommatrix/dist/dommatrix.js\"\n );\n })();\n\n // Provides support for *recent* additions to the Promise specification,\n // however basic Promise support is assumed to be available natively.\n // Support: Firefox<71, Chrome<76, Safari<13, Node.js<12.9.0\n (function checkPromise() {\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"IMAGE_DECODERS\")) {\n // The current image decoders are synchronous, hence `Promise` shouldn't\n // need to be polyfilled for the IMAGE_DECODERS build target.\n return;\n }\n if (globalThis.Promise.allSettled) {\n return;\n }\n globalThis.Promise = require(\"core-js/es/promise/index.js\");\n })();\n\n // Support: Node.js\n (function checkReadableStream() {\n if (globalThis.ReadableStream || !isNodeJS) {\n return;\n }\n globalThis.ReadableStream = __non_webpack_require__(\n \"web-streams-polyfill/dist/ponyfill.js\"\n ).ReadableStream;\n })();\n\n // Support: Firefox<94, Chrome<98, Safari<15.4, Node.js<17.0.0\n (function checkStructuredClone() {\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"IMAGE_DECODERS\")) {\n // The current image decoders are synchronous, hence `structuredClone`\n // shouldn't need to be polyfilled for the IMAGE_DECODERS build target.\n return;\n }\n if (globalThis.structuredClone) {\n return;\n }\n require(\"core-js/web/structured-clone.js\");\n })();\n}\n","/* Copyright 2018 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/* globals process */\n\n// NW.js / Electron is a browser context, but copies some Node.js objects; see\n// http://docs.nwjs.io/en/latest/For%20Users/Advanced/JavaScript%20Contexts%20in%20NW.js/#access-nodejs-and-nwjs-api-in-browser-context\n// https://www.electronjs.org/docs/api/process#processversionselectron-readonly\n// https://www.electronjs.org/docs/api/process#processtype-readonly\nconst isNodeJS =\n (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) &&\n typeof process === \"object\" &&\n process + \"\" === \"[object process]\" &&\n !process.versions.nw &&\n !(process.versions.electron && process.type && process.type !== \"browser\");\n\nexport { isNodeJS };\n","/* Copyright 2012 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * @module pdfjsLib\n */\n\nimport {\n AbortException,\n AnnotationMode,\n assert,\n createPromiseCapability,\n getVerbosityLevel,\n info,\n InvalidPDFException,\n isArrayBuffer,\n MissingPDFException,\n PasswordException,\n RenderingIntentFlag,\n setVerbosityLevel,\n shadow,\n stringToBytes,\n UnexpectedResponseException,\n UnknownErrorException,\n unreachable,\n warn,\n} from \"../shared/util.js\";\nimport {\n deprecated,\n DOMCanvasFactory,\n DOMCMapReaderFactory,\n DOMStandardFontDataFactory,\n isDataScheme,\n loadScript,\n PageViewport,\n RenderingCancelledException,\n StatTimer,\n} from \"./display_utils.js\";\nimport { FontFaceObject, FontLoader } from \"./font_loader.js\";\nimport { AnnotationStorage } from \"./annotation_storage.js\";\nimport { CanvasGraphics } from \"./canvas.js\";\nimport { GlobalWorkerOptions } from \"./worker_options.js\";\nimport { isNodeJS } from \"../shared/is_node.js\";\nimport { MessageHandler } from \"../shared/message_handler.js\";\nimport { Metadata } from \"./metadata.js\";\nimport { OptionalContentConfig } from \"./optional_content_config.js\";\nimport { PDFDataTransportStream } from \"./transport_stream.js\";\nimport { XfaText } from \"./xfa_text.js\";\n\nconst DEFAULT_RANGE_CHUNK_SIZE = 65536; // 2^16 = 65536\nconst RENDERING_CANCELLED_TIMEOUT = 100; // ms\n\nlet DefaultCanvasFactory = DOMCanvasFactory;\nlet DefaultCMapReaderFactory = DOMCMapReaderFactory;\nlet DefaultStandardFontDataFactory = DOMStandardFontDataFactory;\n\nif (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"GENERIC\") && isNodeJS) {\n const {\n NodeCanvasFactory,\n NodeCMapReaderFactory,\n NodeStandardFontDataFactory,\n } = require(\"./node_utils.js\");\n\n DefaultCanvasFactory = NodeCanvasFactory;\n DefaultCMapReaderFactory = NodeCMapReaderFactory;\n DefaultStandardFontDataFactory = NodeStandardFontDataFactory;\n}\n\n/**\n * @typedef {function} IPDFStreamFactory\n * @param {DocumentInitParameters} params - The document initialization\n * parameters. The \"url\" key is always present.\n * @returns {Promise} A promise, which is resolved with an instance of\n * {IPDFStream}.\n * @ignore\n */\n\n/**\n * @type {IPDFStreamFactory}\n * @private\n */\nlet createPDFNetworkStream;\n\n/**\n * Sets the function that instantiates an {IPDFStream} as an alternative PDF\n * data transport.\n *\n * @param {IPDFStreamFactory} pdfNetworkStreamFactory - The factory function\n * that takes document initialization parameters (including a \"url\") and\n * returns a promise which is resolved with an instance of {IPDFStream}.\n * @ignore\n */\nfunction setPDFNetworkStreamFactory(pdfNetworkStreamFactory) {\n createPDFNetworkStream = pdfNetworkStreamFactory;\n}\n\n/**\n * @typedef { Int8Array | Uint8Array | Uint8ClampedArray |\n * Int16Array | Uint16Array |\n * Int32Array | Uint32Array | Float32Array |\n * Float64Array\n * } TypedArray\n */\n\n/**\n * @typedef {Object} RefProxy\n * @property {number} num\n * @property {number} gen\n */\n\n/**\n * Document initialization / loading parameters object.\n *\n * @typedef {Object} DocumentInitParameters\n * @property {string|URL} [url] - The URL of the PDF.\n * @property {TypedArray|Array|string} [data] - Binary PDF data. Use\n * typed arrays (Uint8Array) to improve the memory usage. If PDF data is\n * BASE64-encoded, use `atob()` to convert it to a binary string first.\n * @property {Object} [httpHeaders] - Basic authentication headers.\n * @property {boolean} [withCredentials] - Indicates whether or not\n * cross-site Access-Control requests should be made using credentials such\n * as cookies or authorization headers. The default is `false`.\n * @property {string} [password] - For decrypting password-protected PDFs.\n * @property {TypedArray} [initialData] - A typed array with the first portion\n * or all of the pdf data. Used by the extension since some data is already\n * loaded before the switch to range requests.\n * @property {number} [length] - The PDF file length. It's used for progress\n * reports and range requests operations.\n * @property {PDFDataRangeTransport} [range] - Allows for using a custom range\n * transport implementation.\n * @property {number} [rangeChunkSize] - Specify maximum number of bytes fetched\n * per range request. The default value is {@link DEFAULT_RANGE_CHUNK_SIZE}.\n * @property {PDFWorker} [worker] - The worker that will be used for loading and\n * parsing the PDF data.\n * @property {number} [verbosity] - Controls the logging level; the constants\n * from {@link VerbosityLevel} should be used.\n * @property {string} [docBaseUrl] - The base URL of the document, used when\n * attempting to recover valid absolute URLs for annotations, and outline\n * items, that (incorrectly) only specify relative URLs.\n * @property {string} [cMapUrl] - The URL where the predefined Adobe CMaps are\n * located. Include the trailing slash.\n * @property {boolean} [cMapPacked] - Specifies if the Adobe CMaps are binary\n * packed or not.\n * @property {Object} [CMapReaderFactory] - The factory that will be used when\n * reading built-in CMap files. Providing a custom factory is useful for\n * environments without Fetch API or `XMLHttpRequest` support, such as\n * Node.js. The default value is {DOMCMapReaderFactory}.\n * @property {boolean} [useSystemFonts] - When `true`, fonts that aren't\n * embedded in the PDF document will fallback to a system font.\n * The default value is `true` in web environments and `false` in Node.js;\n * unless `disableFontFace === true` in which case this defaults to `false`\n * regardless of the environment (to prevent completely broken fonts).\n * @property {string} [standardFontDataUrl] - The URL where the standard font\n * files are located. Include the trailing slash.\n * @property {Object} [StandardFontDataFactory] - The factory that will be used\n * when reading the standard font files. Providing a custom factory is useful\n * for environments without Fetch API or `XMLHttpRequest` support, such as\n * Node.js. The default value is {DOMStandardFontDataFactory}.\n * @property {boolean} [useWorkerFetch] - Enable using the Fetch API in the\n * worker-thread when reading CMap and standard font files. When `true`,\n * the `CMapReaderFactory` and `StandardFontDataFactory` options are ignored.\n * The default value is `true` in web environments and `false` in Node.js.\n * @property {boolean} [stopAtErrors] - Reject certain promises, e.g.\n * `getOperatorList`, `getTextContent`, and `RenderTask`, when the associated\n * PDF data cannot be successfully parsed, instead of attempting to recover\n * whatever possible of the data. The default value is `false`.\n * @property {number} [maxImageSize] - The maximum allowed image size in total\n * pixels, i.e. width * height. Images above this value will not be rendered.\n * Use -1 for no limit, which is also the default value.\n * @property {boolean} [isEvalSupported] - Determines if we can evaluate strings\n * as JavaScript. Primarily used to improve performance of font rendering, and\n * when parsing PDF functions. The default value is `true`.\n * @property {boolean} [disableFontFace] - By default fonts are converted to\n * OpenType fonts and loaded via the Font Loading API or `@font-face` rules.\n * If disabled, fonts will be rendered using a built-in font renderer that\n * constructs the glyphs with primitive path commands.\n * The default value is `false` in web environments and `true` in Node.js.\n * @property {boolean} [fontExtraProperties] - Include additional properties,\n * which are unused during rendering of PDF documents, when exporting the\n * parsed font data from the worker-thread. This may be useful for debugging\n * purposes (and backwards compatibility), but note that it will lead to\n * increased memory usage. The default value is `false`.\n * @property {boolean} [enableXfa] - Render Xfa forms if any.\n * The default value is `false`.\n * @property {HTMLDocument} [ownerDocument] - Specify an explicit document\n * context to create elements with and to load resources, such as fonts,\n * into. Defaults to the current document.\n * @property {boolean} [disableRange] - Disable range request loading of PDF\n * files. When enabled, and if the server supports partial content requests,\n * then the PDF will be fetched in chunks. The default value is `false`.\n * @property {boolean} [disableStream] - Disable streaming of PDF file data.\n * By default PDF.js attempts to load PDF files in chunks. The default value\n * is `false`.\n * @property {boolean} [disableAutoFetch] - Disable pre-fetching of PDF file\n * data. When range requests are enabled PDF.js will automatically keep\n * fetching more data even if it isn't needed to display the current page.\n * The default value is `false`.\n *\n * NOTE: It is also necessary to disable streaming, see above, in order for\n * disabling of pre-fetching to work correctly.\n * @property {boolean} [pdfBug] - Enables special hooks for debugging PDF.js\n * (see `web/debugger.js`). The default value is `false`.\n */\n\n/**\n * This is the main entry point for loading a PDF and interacting with it.\n *\n * NOTE: If a URL is used to fetch the PDF data a standard Fetch API call (or\n * XHR as fallback) is used, which means it must follow same origin rules,\n * e.g. no cross-domain requests without CORS.\n *\n * @param {string|URL|TypedArray|PDFDataRangeTransport|DocumentInitParameters}\n * src - Can be a URL where a PDF file is located, a typed array (Uint8Array)\n * already populated with data, or a parameter object.\n * @returns {PDFDocumentLoadingTask}\n */\nfunction getDocument(src) {\n const task = new PDFDocumentLoadingTask();\n\n let source;\n if (typeof src === \"string\" || src instanceof URL) {\n source = { url: src };\n } else if (isArrayBuffer(src)) {\n source = { data: src };\n } else if (src instanceof PDFDataRangeTransport) {\n source = { range: src };\n } else {\n if (typeof src !== \"object\") {\n throw new Error(\n \"Invalid parameter in getDocument, \" +\n \"need either string, URL, Uint8Array, or parameter object.\"\n );\n }\n if (!src.url && !src.data && !src.range) {\n throw new Error(\n \"Invalid parameter object: need either .data, .range or .url\"\n );\n }\n source = src;\n }\n const params = Object.create(null);\n let rangeTransport = null,\n worker = null;\n\n for (const key in source) {\n const value = source[key];\n\n switch (key) {\n case \"url\":\n if (typeof window !== \"undefined\") {\n try {\n // The full path is required in the 'url' field.\n params[key] = new URL(value, window.location).href;\n continue;\n } catch (ex) {\n warn(`Cannot create valid URL: \"${ex}\".`);\n }\n } else if (typeof value === \"string\" || value instanceof URL) {\n params[key] = value.toString(); // Support Node.js environments.\n continue;\n }\n throw new Error(\n \"Invalid PDF url data: \" +\n \"either string or URL-object is expected in the url property.\"\n );\n case \"range\":\n rangeTransport = value;\n continue;\n case \"worker\":\n worker = value;\n continue;\n case \"data\":\n // Converting string or array-like data to Uint8Array.\n if (\n typeof PDFJSDev !== \"undefined\" &&\n PDFJSDev.test(\"GENERIC\") &&\n isNodeJS &&\n typeof Buffer !== \"undefined\" && // eslint-disable-line no-undef\n value instanceof Buffer // eslint-disable-line no-undef\n ) {\n params[key] = new Uint8Array(value);\n } else if (value instanceof Uint8Array) {\n break; // Use the data as-is when it's already a Uint8Array.\n } else if (typeof value === \"string\") {\n params[key] = stringToBytes(value);\n } else if (\n typeof value === \"object\" &&\n value !== null &&\n !isNaN(value.length)\n ) {\n params[key] = new Uint8Array(value);\n } else if (isArrayBuffer(value)) {\n params[key] = new Uint8Array(value);\n } else {\n throw new Error(\n \"Invalid PDF binary data: either typed array, \" +\n \"string, or array-like object is expected in the data property.\"\n );\n }\n continue;\n }\n params[key] = value;\n }\n\n params.CMapReaderFactory =\n params.CMapReaderFactory || DefaultCMapReaderFactory;\n params.StandardFontDataFactory =\n params.StandardFontDataFactory || DefaultStandardFontDataFactory;\n params.ignoreErrors = params.stopAtErrors !== true;\n params.fontExtraProperties = params.fontExtraProperties === true;\n params.pdfBug = params.pdfBug === true;\n params.enableXfa = params.enableXfa === true;\n\n if (!Number.isInteger(params.rangeChunkSize) || params.rangeChunkSize < 1) {\n params.rangeChunkSize = DEFAULT_RANGE_CHUNK_SIZE;\n }\n if (\n typeof params.docBaseUrl !== \"string\" ||\n isDataScheme(params.docBaseUrl)\n ) {\n // Ignore \"data:\"-URLs, since they can't be used to recover valid absolute\n // URLs anyway. We want to avoid sending them to the worker-thread, since\n // they contain the *entire* PDF document and can thus be arbitrarily long.\n params.docBaseUrl = null;\n }\n if (!Number.isInteger(params.maxImageSize) || params.maxImageSize < -1) {\n params.maxImageSize = -1;\n }\n if (typeof params.cMapUrl !== \"string\") {\n params.cMapUrl = null;\n }\n if (typeof params.standardFontDataUrl !== \"string\") {\n params.standardFontDataUrl = null;\n }\n if (typeof params.useWorkerFetch !== \"boolean\") {\n params.useWorkerFetch =\n params.CMapReaderFactory === DOMCMapReaderFactory &&\n params.StandardFontDataFactory === DOMStandardFontDataFactory;\n }\n if (typeof params.isEvalSupported !== \"boolean\") {\n params.isEvalSupported = true;\n }\n if (typeof params.disableFontFace !== \"boolean\") {\n params.disableFontFace = isNodeJS;\n }\n if (typeof params.useSystemFonts !== \"boolean\") {\n params.useSystemFonts = !isNodeJS && !params.disableFontFace;\n }\n if (\n typeof params.ownerDocument !== \"object\" ||\n params.ownerDocument === null\n ) {\n params.ownerDocument = globalThis.document;\n }\n\n if (typeof params.disableRange !== \"boolean\") {\n params.disableRange = false;\n }\n if (typeof params.disableStream !== \"boolean\") {\n params.disableStream = false;\n }\n if (typeof params.disableAutoFetch !== \"boolean\") {\n params.disableAutoFetch = false;\n }\n\n // Set the main-thread verbosity level.\n setVerbosityLevel(params.verbosity);\n\n if (!worker) {\n const workerParams = {\n verbosity: params.verbosity,\n port: GlobalWorkerOptions.workerPort,\n };\n // Worker was not provided -- creating and owning our own. If message port\n // is specified in global worker options, using it.\n worker = workerParams.port\n ? PDFWorker.fromPort(workerParams)\n : new PDFWorker(workerParams);\n task._worker = worker;\n }\n const docId = task.docId;\n worker.promise\n .then(function () {\n if (task.destroyed) {\n throw new Error(\"Loading aborted\");\n }\n\n const workerIdPromise = _fetchDocument(\n worker,\n params,\n rangeTransport,\n docId\n );\n const networkStreamPromise = new Promise(function (resolve) {\n let networkStream;\n if (rangeTransport) {\n networkStream = new PDFDataTransportStream(\n {\n length: params.length,\n initialData: params.initialData,\n progressiveDone: params.progressiveDone,\n contentDispositionFilename: params.contentDispositionFilename,\n disableRange: params.disableRange,\n disableStream: params.disableStream,\n },\n rangeTransport\n );\n } else if (!params.data) {\n networkStream = createPDFNetworkStream({\n url: params.url,\n length: params.length,\n httpHeaders: params.httpHeaders,\n withCredentials: params.withCredentials,\n rangeChunkSize: params.rangeChunkSize,\n disableRange: params.disableRange,\n disableStream: params.disableStream,\n });\n }\n resolve(networkStream);\n });\n\n return Promise.all([workerIdPromise, networkStreamPromise]).then(\n function ([workerId, networkStream]) {\n if (task.destroyed) {\n throw new Error(\"Loading aborted\");\n }\n\n const messageHandler = new MessageHandler(\n docId,\n workerId,\n worker.port\n );\n const transport = new WorkerTransport(\n messageHandler,\n task,\n networkStream,\n params\n );\n task._transport = transport;\n messageHandler.send(\"Ready\", null);\n }\n );\n })\n .catch(task._capability.reject);\n\n return task;\n}\n\n/**\n * Starts fetching of specified PDF document/data.\n *\n * @param {PDFWorker} worker\n * @param {Object} source\n * @param {PDFDataRangeTransport} pdfDataRangeTransport\n * @param {string} docId - Unique document ID, used in `MessageHandler`.\n * @returns {Promise} A promise that is resolved when the worker ID of\n * the `MessageHandler` is known.\n * @private\n */\nasync function _fetchDocument(worker, source, pdfDataRangeTransport, docId) {\n if (worker.destroyed) {\n throw new Error(\"Worker was destroyed\");\n }\n\n if (pdfDataRangeTransport) {\n source.length = pdfDataRangeTransport.length;\n source.initialData = pdfDataRangeTransport.initialData;\n source.progressiveDone = pdfDataRangeTransport.progressiveDone;\n source.contentDispositionFilename =\n pdfDataRangeTransport.contentDispositionFilename;\n }\n const workerId = await worker.messageHandler.sendWithPromise(\n \"GetDocRequest\",\n {\n docId,\n apiVersion:\n typeof PDFJSDev !== \"undefined\" && !PDFJSDev.test(\"TESTING\")\n ? PDFJSDev.eval(\"BUNDLE_VERSION\")\n : null,\n // Only send the required properties, and *not* the entire object.\n source: {\n data: source.data,\n url: source.url,\n password: source.password,\n disableAutoFetch: source.disableAutoFetch,\n rangeChunkSize: source.rangeChunkSize,\n length: source.length,\n },\n maxImageSize: source.maxImageSize,\n disableFontFace: source.disableFontFace,\n docBaseUrl: source.docBaseUrl,\n ignoreErrors: source.ignoreErrors,\n isEvalSupported: source.isEvalSupported,\n fontExtraProperties: source.fontExtraProperties,\n enableXfa: source.enableXfa,\n useSystemFonts: source.useSystemFonts,\n cMapUrl: source.useWorkerFetch ? source.cMapUrl : null,\n standardFontDataUrl: source.useWorkerFetch\n ? source.standardFontDataUrl\n : null,\n }\n );\n\n if (worker.destroyed) {\n throw new Error(\"Worker was destroyed\");\n }\n return workerId;\n}\n\n/**\n * @typedef {Object} OnProgressParameters\n * @property {number} loaded - Currently loaded number of bytes.\n * @property {number} total - Total number of bytes in the PDF file.\n */\n\n/**\n * The loading task controls the operations required to load a PDF document\n * (such as network requests) and provides a way to listen for completion,\n * after which individual pages can be rendered.\n */\nclass PDFDocumentLoadingTask {\n static #docId = 0;\n\n constructor() {\n this._capability = createPromiseCapability();\n this._transport = null;\n this._worker = null;\n\n /**\n * Unique identifier for the document loading task.\n * @type {string}\n */\n this.docId = `d${PDFDocumentLoadingTask.#docId++}`;\n\n /**\n * Whether the loading task is destroyed or not.\n * @type {boolean}\n */\n this.destroyed = false;\n\n /**\n * Callback to request a password if a wrong or no password was provided.\n * The callback receives two parameters: a function that should be called\n * with the new password, and a reason (see {@link PasswordResponses}).\n * @type {function}\n */\n this.onPassword = null;\n\n /**\n * Callback to be able to monitor the loading progress of the PDF file\n * (necessary to implement e.g. a loading bar).\n * The callback receives an {@link OnProgressParameters} argument.\n * @type {function}\n */\n this.onProgress = null;\n\n /**\n * Callback for when an unsupported feature is used in the PDF document.\n * The callback receives an {@link UNSUPPORTED_FEATURES} argument.\n * @type {function}\n */\n this.onUnsupportedFeature = null;\n }\n\n /**\n * Promise for document loading task completion.\n * @type {Promise}\n */\n get promise() {\n return this._capability.promise;\n }\n\n /**\n * Abort all network requests and destroy the worker.\n * @returns {Promise} A promise that is resolved when destruction is\n * completed.\n */\n async destroy() {\n this.destroyed = true;\n await this._transport?.destroy();\n\n this._transport = null;\n if (this._worker) {\n this._worker.destroy();\n this._worker = null;\n }\n }\n}\n\n/**\n * Abstract class to support range requests file loading.\n */\nclass PDFDataRangeTransport {\n /**\n * @param {number} length\n * @param {Uint8Array} initialData\n * @param {boolean} [progressiveDone]\n * @param {string} [contentDispositionFilename]\n */\n constructor(\n length,\n initialData,\n progressiveDone = false,\n contentDispositionFilename = null\n ) {\n this.length = length;\n this.initialData = initialData;\n this.progressiveDone = progressiveDone;\n this.contentDispositionFilename = contentDispositionFilename;\n\n this._rangeListeners = [];\n this._progressListeners = [];\n this._progressiveReadListeners = [];\n this._progressiveDoneListeners = [];\n this._readyCapability = createPromiseCapability();\n }\n\n addRangeListener(listener) {\n this._rangeListeners.push(listener);\n }\n\n addProgressListener(listener) {\n this._progressListeners.push(listener);\n }\n\n addProgressiveReadListener(listener) {\n this._progressiveReadListeners.push(listener);\n }\n\n addProgressiveDoneListener(listener) {\n this._progressiveDoneListeners.push(listener);\n }\n\n onDataRange(begin, chunk) {\n for (const listener of this._rangeListeners) {\n listener(begin, chunk);\n }\n }\n\n onDataProgress(loaded, total) {\n this._readyCapability.promise.then(() => {\n for (const listener of this._progressListeners) {\n listener(loaded, total);\n }\n });\n }\n\n onDataProgressiveRead(chunk) {\n this._readyCapability.promise.then(() => {\n for (const listener of this._progressiveReadListeners) {\n listener(chunk);\n }\n });\n }\n\n onDataProgressiveDone() {\n this._readyCapability.promise.then(() => {\n for (const listener of this._progressiveDoneListeners) {\n listener();\n }\n });\n }\n\n transportReady() {\n this._readyCapability.resolve();\n }\n\n requestDataRange(begin, end) {\n unreachable(\"Abstract method PDFDataRangeTransport.requestDataRange\");\n }\n\n abort() {}\n}\n\n/**\n * Proxy to a `PDFDocument` in the worker thread.\n */\nclass PDFDocumentProxy {\n constructor(pdfInfo, transport) {\n this._pdfInfo = pdfInfo;\n this._transport = transport;\n\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) {\n Object.defineProperty(this, \"fingerprint\", {\n get() {\n deprecated(\n \"`PDFDocumentProxy.fingerprint`, \" +\n \"please use `PDFDocumentProxy.fingerprints` instead.\"\n );\n return this.fingerprints[0];\n },\n });\n\n Object.defineProperty(this, \"getStats\", {\n value: async () => {\n deprecated(\n \"`PDFDocumentProxy.getStats`, \" +\n \"please use the `PDFDocumentProxy.stats`-getter instead.\"\n );\n return this.stats || { streamTypes: {}, fontTypes: {} };\n },\n });\n }\n }\n\n /**\n * @type {AnnotationStorage} Storage for annotation data in forms.\n */\n get annotationStorage() {\n return this._transport.annotationStorage;\n }\n\n /**\n * @type {number} Total number of pages in the PDF file.\n */\n get numPages() {\n return this._pdfInfo.numPages;\n }\n\n /**\n * @type {Array} A (not guaranteed to be) unique ID to\n * identify the PDF document.\n * NOTE: The first element will always be defined for all PDF documents,\n * whereas the second element is only defined for *modified* PDF documents.\n */\n get fingerprints() {\n return this._pdfInfo.fingerprints;\n }\n\n /**\n * @typedef {Object} PDFDocumentStats\n * @property {Object} streamTypes - Used stream types in the\n * document (an item is set to true if specific stream ID was used in the\n * document).\n * @property {Object} fontTypes - Used font types in the\n * document (an item is set to true if specific font ID was used in the\n * document).\n */\n\n /**\n * @type {PDFDocumentStats | null} The current statistics about document\n * structures, or `null` when no statistics exists.\n */\n get stats() {\n return this._transport.stats;\n }\n\n /**\n * @type {boolean} True if only XFA form.\n */\n get isPureXfa() {\n return !!this._transport._htmlForXfa;\n }\n\n /**\n * NOTE: This is (mostly) intended to support printing of XFA forms.\n *\n * @type {Object | null} An object representing a HTML tree structure\n * to render the XFA, or `null` when no XFA form exists.\n */\n get allXfaHtml() {\n return this._transport._htmlForXfa;\n }\n\n /**\n * @param {number} pageNumber - The page number to get. The first page is 1.\n * @returns {Promise} A promise that is resolved with\n * a {@link PDFPageProxy} object.\n */\n getPage(pageNumber) {\n return this._transport.getPage(pageNumber);\n }\n\n /**\n * @param {RefProxy} ref - The page reference.\n * @returns {Promise} A promise that is resolved with the page index,\n * starting from zero, that is associated with the reference.\n */\n getPageIndex(ref) {\n return this._transport.getPageIndex(ref);\n }\n\n /**\n * @returns {Promise>>} A promise that is resolved\n * with a mapping from named destinations to references.\n *\n * This can be slow for large documents. Use `getDestination` instead.\n */\n getDestinations() {\n return this._transport.getDestinations();\n }\n\n /**\n * @param {string} id - The named destination to get.\n * @returns {Promise | null>} A promise that is resolved with all\n * information of the given named destination, or `null` when the named\n * destination is not present in the PDF file.\n */\n getDestination(id) {\n return this._transport.getDestination(id);\n }\n\n /**\n * @returns {Promise | null>} A promise that is resolved with\n * an {Array} containing the page labels that correspond to the page\n * indexes, or `null` when no page labels are present in the PDF file.\n */\n getPageLabels() {\n return this._transport.getPageLabels();\n }\n\n /**\n * @returns {Promise} A promise that is resolved with a {string}\n * containing the page layout name.\n */\n getPageLayout() {\n return this._transport.getPageLayout();\n }\n\n /**\n * @returns {Promise} A promise that is resolved with a {string}\n * containing the page mode name.\n */\n getPageMode() {\n return this._transport.getPageMode();\n }\n\n /**\n * @returns {Promise} A promise that is resolved with an\n * {Object} containing the viewer preferences, or `null` when no viewer\n * preferences are present in the PDF file.\n */\n getViewerPreferences() {\n return this._transport.getViewerPreferences();\n }\n\n /**\n * @returns {Promise} A promise that is resolved with an {Array}\n * containing the destination, or `null` when no open action is present\n * in the PDF.\n */\n getOpenAction() {\n return this._transport.getOpenAction();\n }\n\n /**\n * @returns {Promise} A promise that is resolved with a lookup table\n * for mapping named attachments to their content.\n */\n getAttachments() {\n return this._transport.getAttachments();\n }\n\n /**\n * @returns {Promise | null>} A promise that is resolved with\n * an {Array} of all the JavaScript strings in the name tree, or `null`\n * if no JavaScript exists.\n */\n getJavaScript() {\n return this._transport.getJavaScript();\n }\n\n /**\n * @returns {Promise} A promise that is resolved with\n * an {Object} with the JavaScript actions:\n * - from the name tree (like getJavaScript);\n * - from A or AA entries in the catalog dictionary.\n * , or `null` if no JavaScript exists.\n */\n getJSActions() {\n return this._transport.getDocJSActions();\n }\n\n /**\n * @typedef {Object} OutlineNode\n * @property {string} title\n * @property {boolean} bold\n * @property {boolean} italic\n * @property {Uint8ClampedArray} color - The color in RGB format to use for\n * display purposes.\n * @property {string | Array | null} dest\n * @property {string | null} url\n * @property {string | undefined} unsafeUrl\n * @property {boolean | undefined} newWindow\n * @property {number | undefined} count\n * @property {Array} items\n */\n\n /**\n * @returns {Promise>} A promise that is resolved with an\n * {Array} that is a tree outline (if it has one) of the PDF file.\n */\n getOutline() {\n return this._transport.getOutline();\n }\n\n /**\n * @returns {Promise} A promise that is resolved with\n * an {@link OptionalContentConfig} that contains all the optional content\n * groups (assuming that the document has any).\n */\n getOptionalContentConfig() {\n return this._transport.getOptionalContentConfig();\n }\n\n /**\n * @returns {Promise | null>} A promise that is resolved with\n * an {Array} that contains the permission flags for the PDF document, or\n * `null` when no permissions are present in the PDF file.\n */\n getPermissions() {\n return this._transport.getPermissions();\n }\n\n /**\n * @returns {Promise<{ info: Object, metadata: Metadata }>} A promise that is\n * resolved with an {Object} that has `info` and `metadata` properties.\n * `info` is an {Object} filled with anything available in the information\n * dictionary and similarly `metadata` is a {Metadata} object with\n * information from the metadata section of the PDF.\n */\n getMetadata() {\n return this._transport.getMetadata();\n }\n\n /**\n * @typedef {Object} MarkInfo\n * Properties correspond to Table 321 of the PDF 32000-1:2008 spec.\n * @property {boolean} Marked\n * @property {boolean} UserProperties\n * @property {boolean} Suspects\n */\n\n /**\n * @returns {Promise} A promise that is resolved with\n * a {MarkInfo} object that contains the MarkInfo flags for the PDF\n * document, or `null` when no MarkInfo values are present in the PDF file.\n */\n getMarkInfo() {\n return this._transport.getMarkInfo();\n }\n\n /**\n * @returns {Promise} A promise that is resolved with a\n * {TypedArray} that has the raw data from the PDF.\n */\n getData() {\n return this._transport.getData();\n }\n\n /**\n * @returns {Promise<{ length: number }>} A promise that is resolved when the\n * document's data is loaded. It is resolved with an {Object} that contains\n * the `length` property that indicates size of the PDF data in bytes.\n */\n getDownloadInfo() {\n return this._transport.downloadInfoCapability.promise;\n }\n\n /**\n * Cleans up resources allocated by the document on both the main and worker\n * threads.\n *\n * NOTE: Do not, under any circumstances, call this method when rendering is\n * currently ongoing since that may lead to rendering errors.\n *\n * @param {boolean} [keepLoadedFonts] - Let fonts remain attached to the DOM.\n * NOTE: This will increase persistent memory usage, hence don't use this\n * option unless absolutely necessary. The default value is `false`.\n * @returns {Promise} A promise that is resolved when clean-up has finished.\n */\n cleanup(keepLoadedFonts = false) {\n return this._transport.startCleanup(keepLoadedFonts || this.isPureXfa);\n }\n\n /**\n * Destroys the current document instance and terminates the worker.\n */\n destroy() {\n return this.loadingTask.destroy();\n }\n\n /**\n * @type {DocumentInitParameters} A subset of the current\n * {DocumentInitParameters}, which are needed in the viewer.\n */\n get loadingParams() {\n return this._transport.loadingParams;\n }\n\n /**\n * @type {PDFDocumentLoadingTask} The loadingTask for the current document.\n */\n get loadingTask() {\n return this._transport.loadingTask;\n }\n\n /**\n * @returns {Promise} A promise that is resolved with a\n * {Uint8Array} containing the full data of the saved document.\n */\n saveDocument() {\n if (\n (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) &&\n this._transport.annotationStorage.size <= 0\n ) {\n deprecated(\n \"saveDocument called while `annotationStorage` is empty, \" +\n \"please use the getData-method instead.\"\n );\n }\n return this._transport.saveDocument();\n }\n\n /**\n * @returns {Promise> | null>} A promise that is\n * resolved with an {Object} containing /AcroForm field data for the JS\n * sandbox, or `null` when no field data is present in the PDF file.\n */\n getFieldObjects() {\n return this._transport.getFieldObjects();\n }\n\n /**\n * @returns {Promise} A promise that is resolved with `true`\n * if some /AcroForm fields have JavaScript actions.\n */\n hasJSActions() {\n return this._transport.hasJSActions();\n }\n\n /**\n * @returns {Promise | null>} A promise that is resolved with an\n * {Array} containing IDs of annotations that have a calculation\n * action, or `null` when no such annotations are present in the PDF file.\n */\n getCalculationOrderIds() {\n return this._transport.getCalculationOrderIds();\n }\n}\n\n/**\n * Page getViewport parameters.\n *\n * @typedef {Object} GetViewportParameters\n * @property {number} scale - The desired scale of the viewport.\n * @property {number} [rotation] - The desired rotation, in degrees, of\n * the viewport. If omitted it defaults to the page rotation.\n * @property {number} [offsetX] - The horizontal, i.e. x-axis, offset.\n * The default value is `0`.\n * @property {number} [offsetY] - The vertical, i.e. y-axis, offset.\n * The default value is `0`.\n * @property {boolean} [dontFlip] - If true, the y-axis will not be\n * flipped. The default value is `false`.\n */\n\n/**\n * Page getTextContent parameters.\n *\n * @typedef {Object} getTextContentParameters\n * @property {boolean} disableCombineTextItems - Do not attempt to combine\n * same line {@link TextItem}'s. The default value is `false`.\n * @property {boolean} [includeMarkedContent] - When true include marked\n * content items in the items array of TextContent. The default is `false`.\n */\n\n/**\n * Page text content.\n *\n * @typedef {Object} TextContent\n * @property {Array} items - Array of\n * {@link TextItem} and {@link TextMarkedContent} objects. TextMarkedContent\n * items are included when includeMarkedContent is true.\n * @property {Object} styles - {@link TextStyle} objects,\n * indexed by font name.\n */\n\n/**\n * Page text content part.\n *\n * @typedef {Object} TextItem\n * @property {string} str - Text content.\n * @property {string} dir - Text direction: 'ttb', 'ltr' or 'rtl'.\n * @property {Array} transform - Transformation matrix.\n * @property {number} width - Width in device space.\n * @property {number} height - Height in device space.\n * @property {string} fontName - Font name used by PDF.js for converted font.\n * @property {boolean} hasEOL - Indicating if the text content is followed by a\n * line-break.\n */\n\n/**\n * Page text marked content part.\n *\n * @typedef {Object} TextMarkedContent\n * @property {string} type - Either 'beginMarkedContent',\n * 'beginMarkedContentProps', or 'endMarkedContent'.\n * @property {string} id - The marked content identifier. Only used for type\n * 'beginMarkedContentProps'.\n */\n\n/**\n * Text style.\n *\n * @typedef {Object} TextStyle\n * @property {number} ascent - Font ascent.\n * @property {number} descent - Font descent.\n * @property {boolean} vertical - Whether or not the text is in vertical mode.\n * @property {string} fontFamily - The possible font family.\n */\n\n/**\n * Page annotation parameters.\n *\n * @typedef {Object} GetAnnotationsParameters\n * @property {string} [intent] - Determines the annotations that are fetched,\n * can be 'display' (viewable annotations), 'print' (printable annotations),\n * or 'any' (all annotations). The default value is 'display'.\n */\n\n/**\n * Page render parameters.\n *\n * @typedef {Object} RenderParameters\n * @property {Object} canvasContext - A 2D context of a DOM Canvas object.\n * @property {PageViewport} viewport - Rendering viewport obtained by calling\n * the `PDFPageProxy.getViewport` method.\n * @property {string} [intent] - Rendering intent, can be 'display', 'print',\n * or 'any'. The default value is 'display'.\n * @property {number} [annotationMode] Controls which annotations are rendered\n * onto the canvas, for annotations with appearance-data; the values from\n * {@link AnnotationMode} should be used. The following values are supported:\n * - `AnnotationMode.DISABLE`, which disables all annotations.\n * - `AnnotationMode.ENABLE`, which includes all possible annotations (thus\n * it also depends on the `intent`-option, see above).\n * - `AnnotationMode.ENABLE_FORMS`, which excludes annotations that contain\n * interactive form elements (those will be rendered in the display layer).\n * - `AnnotationMode.ENABLE_STORAGE`, which includes all possible annotations\n * (as above) but where interactive form elements are updated with data\n * from the {@link AnnotationStorage}-instance; useful e.g. for printing.\n * The default value is `AnnotationMode.ENABLE`.\n * @property {Array} [transform] - Additional transform, applied just\n * before viewport transform.\n * @property {Object} [imageLayer] - An object that has `beginLayout`,\n * `endLayout` and `appendImage` functions.\n * @property {Object} [canvasFactory] - The factory instance that will be used\n * when creating canvases. The default value is {new DOMCanvasFactory()}.\n * @property {Object | string} [background] - Background to use for the canvas.\n * Any valid `canvas.fillStyle` can be used: a `DOMString` parsed as CSS\n * value, a `CanvasGradient` object (a linear or radial gradient) or\n * a `CanvasPattern` object (a repetitive image). The default value is\n * 'rgb(255,255,255)'.\n *\n * NOTE: This option may be partially, or completely, ignored when the\n * `pageColors`-option is used.\n * @property {Object} [pageColors] - Overwrites background and foreground colors\n * with user defined ones in order to improve readability in high contrast\n * mode.\n * @property {Promise} [optionalContentConfigPromise] -\n * A promise that should resolve with an {@link OptionalContentConfig}\n * created from `PDFDocumentProxy.getOptionalContentConfig`. If `null`,\n * the configuration will be fetched automatically with the default visibility\n * states set.\n * @property {Map} [annotationCanvasMap] - Map some\n * annotation ids with canvases used to render them.\n */\n\n/**\n * Page getOperatorList parameters.\n *\n * @typedef {Object} GetOperatorListParameters\n * @property {string} [intent] - Rendering intent, can be 'display', 'print',\n * or 'any'. The default value is 'display'.\n * @property {number} [annotationMode] Controls which annotations are included\n * in the operatorList, for annotations with appearance-data; the values from\n * {@link AnnotationMode} should be used. The following values are supported:\n * - `AnnotationMode.DISABLE`, which disables all annotations.\n * - `AnnotationMode.ENABLE`, which includes all possible annotations (thus\n * it also depends on the `intent`-option, see above).\n * - `AnnotationMode.ENABLE_FORMS`, which excludes annotations that contain\n * interactive form elements (those will be rendered in the display layer).\n * - `AnnotationMode.ENABLE_STORAGE`, which includes all possible annotations\n * (as above) but where interactive form elements are updated with data\n * from the {@link AnnotationStorage}-instance; useful e.g. for printing.\n * The default value is `AnnotationMode.ENABLE`.\n */\n\n/**\n * Structure tree node. The root node will have a role \"Root\".\n *\n * @typedef {Object} StructTreeNode\n * @property {Array} children - Array of\n * {@link StructTreeNode} and {@link StructTreeContent} objects.\n * @property {string} role - element's role, already mapped if a role map exists\n * in the PDF.\n */\n\n/**\n * Structure tree content.\n *\n * @typedef {Object} StructTreeContent\n * @property {string} type - either \"content\" for page and stream structure\n * elements or \"object\" for object references.\n * @property {string} id - unique id that will map to the text layer.\n */\n\n/**\n * PDF page operator list.\n *\n * @typedef {Object} PDFOperatorList\n * @property {Array} fnArray - Array containing the operator functions.\n * @property {Array} argsArray - Array containing the arguments of the\n * functions.\n */\n\n/**\n * Proxy to a `PDFPage` in the worker thread.\n */\nclass PDFPageProxy {\n constructor(pageIndex, pageInfo, transport, ownerDocument, pdfBug = false) {\n this._pageIndex = pageIndex;\n this._pageInfo = pageInfo;\n this._ownerDocument = ownerDocument;\n this._transport = transport;\n this._stats = pdfBug ? new StatTimer() : null;\n this._pdfBug = pdfBug;\n /** @type {PDFObjects} */\n this.commonObjs = transport.commonObjs;\n this.objs = new PDFObjects();\n\n this._bitmaps = new Set();\n\n this.cleanupAfterRender = false;\n this.pendingCleanup = false;\n this._intentStates = new Map();\n this._annotationPromises = new Map();\n this.destroyed = false;\n }\n\n /**\n * @type {number} Page number of the page. First page is 1.\n */\n get pageNumber() {\n return this._pageIndex + 1;\n }\n\n /**\n * @type {number} The number of degrees the page is rotated clockwise.\n */\n get rotate() {\n return this._pageInfo.rotate;\n }\n\n /**\n * @type {RefProxy | null} The reference that points to this page.\n */\n get ref() {\n return this._pageInfo.ref;\n }\n\n /**\n * @type {number} The default size of units in 1/72nds of an inch.\n */\n get userUnit() {\n return this._pageInfo.userUnit;\n }\n\n /**\n * @type {Array} An array of the visible portion of the PDF page in\n * user space units [x1, y1, x2, y2].\n */\n get view() {\n return this._pageInfo.view;\n }\n\n /**\n * @param {GetViewportParameters} params - Viewport parameters.\n * @returns {PageViewport} Contains 'width' and 'height' properties\n * along with transforms required for rendering.\n */\n getViewport({\n scale,\n rotation = this.rotate,\n offsetX = 0,\n offsetY = 0,\n dontFlip = false,\n } = {}) {\n return new PageViewport({\n viewBox: this.view,\n scale,\n rotation,\n offsetX,\n offsetY,\n dontFlip,\n });\n }\n\n /**\n * @param {GetAnnotationsParameters} params - Annotation parameters.\n * @returns {Promise>} A promise that is resolved with an\n * {Array} of the annotation objects.\n */\n getAnnotations({ intent = \"display\" } = {}) {\n const intentArgs = this._transport.getRenderingIntent(intent);\n\n let promise = this._annotationPromises.get(intentArgs.cacheKey);\n if (!promise) {\n promise = this._transport.getAnnotations(\n this._pageIndex,\n intentArgs.renderingIntent\n );\n this._annotationPromises.set(intentArgs.cacheKey, promise);\n\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) {\n promise = promise.then(annotations => {\n for (const annotation of annotations) {\n if (annotation.titleObj !== undefined) {\n Object.defineProperty(annotation, \"title\", {\n get() {\n deprecated(\n \"`title`-property on annotation, please use `titleObj` instead.\"\n );\n return annotation.titleObj.str;\n },\n });\n }\n if (annotation.contentsObj !== undefined) {\n Object.defineProperty(annotation, \"contents\", {\n get() {\n deprecated(\n \"`contents`-property on annotation, please use `contentsObj` instead.\"\n );\n return annotation.contentsObj.str;\n },\n });\n }\n }\n return annotations;\n });\n }\n }\n return promise;\n }\n\n /**\n * @returns {Promise} A promise that is resolved with an\n * {Object} with JS actions.\n */\n getJSActions() {\n return (this._jsActionsPromise ||= this._transport.getPageJSActions(\n this._pageIndex\n ));\n }\n\n /**\n * @returns {Promise} A promise that is resolved with\n * an {Object} with a fake DOM object (a tree structure where elements\n * are {Object} with a name, attributes (class, style, ...), value and\n * children, very similar to a HTML DOM tree), or `null` if no XFA exists.\n */\n async getXfa() {\n return this._transport._htmlForXfa?.children[this._pageIndex] || null;\n }\n\n /**\n * Begins the process of rendering a page to the desired context.\n *\n * @param {RenderParameters} params - Page render parameters.\n * @returns {RenderTask} An object that contains a promise that is\n * resolved when the page finishes rendering.\n */\n render({\n canvasContext,\n viewport,\n intent = \"display\",\n annotationMode = AnnotationMode.ENABLE,\n transform = null,\n imageLayer = null,\n canvasFactory = null,\n background = null,\n optionalContentConfigPromise = null,\n annotationCanvasMap = null,\n pageColors = null,\n }) {\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"GENERIC\")) {\n if (arguments[0]?.renderInteractiveForms !== undefined) {\n deprecated(\n \"render no longer accepts the `renderInteractiveForms`-option, \" +\n \"please use the `annotationMode`-option instead.\"\n );\n if (\n arguments[0].renderInteractiveForms === true &&\n annotationMode === AnnotationMode.ENABLE\n ) {\n annotationMode = AnnotationMode.ENABLE_FORMS;\n }\n }\n if (arguments[0]?.includeAnnotationStorage !== undefined) {\n deprecated(\n \"render no longer accepts the `includeAnnotationStorage`-option, \" +\n \"please use the `annotationMode`-option instead.\"\n );\n if (\n arguments[0].includeAnnotationStorage === true &&\n annotationMode === AnnotationMode.ENABLE\n ) {\n annotationMode = AnnotationMode.ENABLE_STORAGE;\n }\n }\n }\n\n if (this._stats) {\n this._stats.time(\"Overall\");\n }\n\n const intentArgs = this._transport.getRenderingIntent(\n intent,\n annotationMode\n );\n // If there was a pending destroy, cancel it so no cleanup happens during\n // this call to render.\n this.pendingCleanup = false;\n\n if (!optionalContentConfigPromise) {\n optionalContentConfigPromise = this._transport.getOptionalContentConfig();\n }\n\n let intentState = this._intentStates.get(intentArgs.cacheKey);\n if (!intentState) {\n intentState = Object.create(null);\n this._intentStates.set(intentArgs.cacheKey, intentState);\n }\n\n // Ensure that a pending `streamReader` cancel timeout is always aborted.\n if (intentState.streamReaderCancelTimeout) {\n clearTimeout(intentState.streamReaderCancelTimeout);\n intentState.streamReaderCancelTimeout = null;\n }\n\n const canvasFactoryInstance =\n canvasFactory ||\n new DefaultCanvasFactory({ ownerDocument: this._ownerDocument });\n const intentPrint = !!(\n intentArgs.renderingIntent & RenderingIntentFlag.PRINT\n );\n\n // If there's no displayReadyCapability yet, then the operatorList\n // was never requested before. Make the request and create the promise.\n if (!intentState.displayReadyCapability) {\n intentState.displayReadyCapability = createPromiseCapability();\n intentState.operatorList = {\n fnArray: [],\n argsArray: [],\n lastChunk: false,\n };\n\n if (this._stats) {\n this._stats.time(\"Page Request\");\n }\n this._pumpOperatorList(intentArgs);\n }\n\n const complete = error => {\n intentState.renderTasks.delete(internalRenderTask);\n\n // Attempt to reduce memory usage during *printing*, by always running\n // cleanup once rendering has finished (regardless of cleanupAfterRender).\n if (this.cleanupAfterRender || intentPrint) {\n this.pendingCleanup = true;\n }\n this._tryCleanup();\n\n if (error) {\n internalRenderTask.capability.reject(error);\n\n this._abortOperatorList({\n intentState,\n reason: error instanceof Error ? error : new Error(error),\n });\n } else {\n internalRenderTask.capability.resolve();\n }\n if (this._stats) {\n this._stats.timeEnd(\"Rendering\");\n this._stats.timeEnd(\"Overall\");\n }\n };\n\n const internalRenderTask = new InternalRenderTask({\n callback: complete,\n // Only include the required properties, and *not* the entire object.\n params: {\n canvasContext,\n viewport,\n transform,\n imageLayer,\n background,\n },\n objs: this.objs,\n commonObjs: this.commonObjs,\n annotationCanvasMap,\n operatorList: intentState.operatorList,\n pageIndex: this._pageIndex,\n canvasFactory: canvasFactoryInstance,\n useRequestAnimationFrame: !intentPrint,\n pdfBug: this._pdfBug,\n pageColors,\n });\n\n (intentState.renderTasks ||= new Set()).add(internalRenderTask);\n const renderTask = internalRenderTask.task;\n\n Promise.all([\n intentState.displayReadyCapability.promise,\n optionalContentConfigPromise,\n ])\n .then(([transparency, optionalContentConfig]) => {\n if (this.pendingCleanup) {\n complete();\n return;\n }\n if (this._stats) {\n this._stats.time(\"Rendering\");\n }\n internalRenderTask.initializeGraphics({\n transparency,\n optionalContentConfig,\n });\n internalRenderTask.operatorListChanged();\n })\n .catch(complete);\n\n return renderTask;\n }\n\n /**\n * @param {GetOperatorListParameters} params - Page getOperatorList\n * parameters.\n * @returns {Promise} A promise resolved with an\n * {@link PDFOperatorList} object that represents the page's operator list.\n */\n getOperatorList({\n intent = \"display\",\n annotationMode = AnnotationMode.ENABLE,\n } = {}) {\n function operatorListChanged() {\n if (intentState.operatorList.lastChunk) {\n intentState.opListReadCapability.resolve(intentState.operatorList);\n\n intentState.renderTasks.delete(opListTask);\n }\n }\n\n const intentArgs = this._transport.getRenderingIntent(\n intent,\n annotationMode,\n /* isOpList = */ true\n );\n let intentState = this._intentStates.get(intentArgs.cacheKey);\n if (!intentState) {\n intentState = Object.create(null);\n this._intentStates.set(intentArgs.cacheKey, intentState);\n }\n let opListTask;\n\n if (!intentState.opListReadCapability) {\n opListTask = Object.create(null);\n opListTask.operatorListChanged = operatorListChanged;\n intentState.opListReadCapability = createPromiseCapability();\n (intentState.renderTasks ||= new Set()).add(opListTask);\n intentState.operatorList = {\n fnArray: [],\n argsArray: [],\n lastChunk: false,\n };\n\n if (this._stats) {\n this._stats.time(\"Page Request\");\n }\n this._pumpOperatorList(intentArgs);\n }\n return intentState.opListReadCapability.promise;\n }\n\n /**\n * NOTE: All occurrences of whitespace will be replaced by\n * standard spaces (0x20).\n *\n * @param {getTextContentParameters} params - getTextContent parameters.\n * @returns {ReadableStream} Stream for reading text content chunks.\n */\n streamTextContent({\n disableCombineTextItems = false,\n includeMarkedContent = false,\n } = {}) {\n const TEXT_CONTENT_CHUNK_SIZE = 100;\n\n return this._transport.messageHandler.sendWithStream(\n \"GetTextContent\",\n {\n pageIndex: this._pageIndex,\n combineTextItems: disableCombineTextItems !== true,\n includeMarkedContent: includeMarkedContent === true,\n },\n {\n highWaterMark: TEXT_CONTENT_CHUNK_SIZE,\n size(textContent) {\n return textContent.items.length;\n },\n }\n );\n }\n\n /**\n * NOTE: All occurrences of whitespace will be replaced by\n * standard spaces (0x20).\n *\n * @param {getTextContentParameters} params - getTextContent parameters.\n * @returns {Promise} A promise that is resolved with a\n * {@link TextContent} object that represents the page's text content.\n */\n getTextContent(params = {}) {\n if (this._transport._htmlForXfa) {\n // TODO: We need to revisit this once the XFA foreground patch lands and\n // only do this for non-foreground XFA.\n return this.getXfa().then(xfa => {\n return XfaText.textContent(xfa);\n });\n }\n const readableStream = this.streamTextContent(params);\n\n return new Promise(function (resolve, reject) {\n function pump() {\n reader.read().then(function ({ value, done }) {\n if (done) {\n resolve(textContent);\n return;\n }\n Object.assign(textContent.styles, value.styles);\n textContent.items.push(...value.items);\n pump();\n }, reject);\n }\n\n const reader = readableStream.getReader();\n const textContent = {\n items: [],\n styles: Object.create(null),\n };\n pump();\n });\n }\n\n /**\n * @returns {Promise} A promise that is resolved with a\n * {@link StructTreeNode} object that represents the page's structure tree,\n * or `null` when no structure tree is present for the current page.\n */\n getStructTree() {\n return (this._structTreePromise ||= this._transport.getStructTree(\n this._pageIndex\n ));\n }\n\n /**\n * Destroys the page object.\n * @private\n */\n _destroy() {\n this.destroyed = true;\n\n const waitOn = [];\n for (const intentState of this._intentStates.values()) {\n this._abortOperatorList({\n intentState,\n reason: new Error(\"Page was destroyed.\"),\n force: true,\n });\n\n if (intentState.opListReadCapability) {\n // Avoid errors below, since the renderTasks are just stubs.\n continue;\n }\n for (const internalRenderTask of intentState.renderTasks) {\n waitOn.push(internalRenderTask.completed);\n internalRenderTask.cancel();\n }\n }\n this.objs.clear();\n for (const bitmap of this._bitmaps) {\n bitmap.close();\n }\n this._bitmaps.clear();\n this._annotationPromises.clear();\n this._jsActionsPromise = null;\n this._structTreePromise = null;\n this.pendingCleanup = false;\n return Promise.all(waitOn);\n }\n\n /**\n * Cleans up resources allocated by the page.\n *\n * @param {boolean} [resetStats] - Reset page stats, if enabled.\n * The default value is `false`.\n * @returns {boolean} Indicates if clean-up was successfully run.\n */\n cleanup(resetStats = false) {\n this.pendingCleanup = true;\n return this._tryCleanup(resetStats);\n }\n\n /**\n * Attempts to clean up if rendering is in a state where that's possible.\n * @private\n */\n _tryCleanup(resetStats = false) {\n if (!this.pendingCleanup) {\n return false;\n }\n for (const { renderTasks, operatorList } of this._intentStates.values()) {\n if (renderTasks.size > 0 || !operatorList.lastChunk) {\n return false;\n }\n }\n\n this._intentStates.clear();\n this.objs.clear();\n this._annotationPromises.clear();\n this._jsActionsPromise = null;\n this._structTreePromise = null;\n if (resetStats && this._stats) {\n this._stats = new StatTimer();\n }\n for (const bitmap of this._bitmaps) {\n bitmap.close();\n }\n this._bitmaps.clear();\n this.pendingCleanup = false;\n return true;\n }\n\n /**\n * @private\n */\n _startRenderPage(transparency, cacheKey) {\n const intentState = this._intentStates.get(cacheKey);\n if (!intentState) {\n return; // Rendering was cancelled.\n }\n if (this._stats) {\n this._stats.timeEnd(\"Page Request\");\n }\n // TODO Refactor RenderPageRequest to separate rendering\n // and operator list logic\n if (intentState.displayReadyCapability) {\n intentState.displayReadyCapability.resolve(transparency);\n }\n }\n\n /**\n * @private\n */\n _renderPageChunk(operatorListChunk, intentState) {\n // Add the new chunk to the current operator list.\n for (let i = 0, ii = operatorListChunk.length; i < ii; i++) {\n intentState.operatorList.fnArray.push(operatorListChunk.fnArray[i]);\n intentState.operatorList.argsArray.push(operatorListChunk.argsArray[i]);\n }\n intentState.operatorList.lastChunk = operatorListChunk.lastChunk;\n\n // Notify all the rendering tasks there are more operators to be consumed.\n for (const internalRenderTask of intentState.renderTasks) {\n internalRenderTask.operatorListChanged();\n }\n\n if (operatorListChunk.lastChunk) {\n this._tryCleanup();\n }\n }\n\n /**\n * @private\n */\n _pumpOperatorList({ renderingIntent, cacheKey }) {\n if (\n typeof PDFJSDev === \"undefined\" ||\n PDFJSDev.test(\"!PRODUCTION || TESTING\")\n ) {\n assert(\n Number.isInteger(renderingIntent) && renderingIntent > 0,\n '_pumpOperatorList: Expected valid \"renderingIntent\" argument.'\n );\n }\n\n const readableStream = this._transport.messageHandler.sendWithStream(\n \"GetOperatorList\",\n {\n pageIndex: this._pageIndex,\n intent: renderingIntent,\n cacheKey,\n annotationStorage:\n renderingIntent & RenderingIntentFlag.ANNOTATIONS_STORAGE\n ? this._transport.annotationStorage.serializable\n : null,\n }\n );\n const reader = readableStream.getReader();\n\n const intentState = this._intentStates.get(cacheKey);\n intentState.streamReader = reader;\n\n const pump = () => {\n reader.read().then(\n ({ value, done }) => {\n if (done) {\n intentState.streamReader = null;\n return;\n }\n if (this._transport.destroyed) {\n return; // Ignore any pending requests if the worker was terminated.\n }\n this._renderPageChunk(value, intentState);\n pump();\n },\n reason => {\n intentState.streamReader = null;\n\n if (this._transport.destroyed) {\n return; // Ignore any pending requests if the worker was terminated.\n }\n if (intentState.operatorList) {\n // Mark operator list as complete.\n intentState.operatorList.lastChunk = true;\n\n for (const internalRenderTask of intentState.renderTasks) {\n internalRenderTask.operatorListChanged();\n }\n this._tryCleanup();\n }\n\n if (intentState.displayReadyCapability) {\n intentState.displayReadyCapability.reject(reason);\n } else if (intentState.opListReadCapability) {\n intentState.opListReadCapability.reject(reason);\n } else {\n throw reason;\n }\n }\n );\n };\n pump();\n }\n\n /**\n * @private\n */\n _abortOperatorList({ intentState, reason, force = false }) {\n if (\n typeof PDFJSDev === \"undefined\" ||\n PDFJSDev.test(\"!PRODUCTION || TESTING\")\n ) {\n assert(\n reason instanceof Error,\n '_abortOperatorList: Expected valid \"reason\" argument.'\n );\n }\n\n if (!intentState.streamReader) {\n return;\n }\n if (!force) {\n // Ensure that an Error occurring in *only* one `InternalRenderTask`, e.g.\n // multiple render() calls on the same canvas, won't break all rendering.\n if (intentState.renderTasks.size > 0) {\n return;\n }\n // Don't immediately abort parsing on the worker-thread when rendering is\n // cancelled, since that will unnecessarily delay re-rendering when (for\n // partially parsed pages) e.g. zooming/rotation occurs in the viewer.\n if (reason instanceof RenderingCancelledException) {\n intentState.streamReaderCancelTimeout = setTimeout(() => {\n this._abortOperatorList({ intentState, reason, force: true });\n intentState.streamReaderCancelTimeout = null;\n }, RENDERING_CANCELLED_TIMEOUT);\n return;\n }\n }\n intentState.streamReader\n .cancel(new AbortException(reason.message))\n .catch(() => {\n // Avoid \"Uncaught promise\" messages in the console.\n });\n intentState.streamReader = null;\n\n if (this._transport.destroyed) {\n return; // Ignore any pending requests if the worker was terminated.\n }\n // Remove the current `intentState`, since a cancelled `getOperatorList`\n // call on the worker-thread cannot be re-started...\n for (const [curCacheKey, curIntentState] of this._intentStates) {\n if (curIntentState === intentState) {\n this._intentStates.delete(curCacheKey);\n break;\n }\n }\n // ... and force clean-up to ensure that any old state is always removed.\n this.cleanup();\n }\n\n /**\n * @type {Object} Returns page stats, if enabled; returns `null` otherwise.\n */\n get stats() {\n return this._stats;\n }\n}\n\nclass LoopbackPort {\n constructor() {\n this._listeners = [];\n this._deferred = Promise.resolve();\n }\n\n postMessage(obj, transfers) {\n const event = {\n data: structuredClone(obj, transfers),\n };\n\n this._deferred.then(() => {\n for (const listener of this._listeners) {\n listener.call(this, event);\n }\n });\n }\n\n addEventListener(name, listener) {\n this._listeners.push(listener);\n }\n\n removeEventListener(name, listener) {\n const i = this._listeners.indexOf(listener);\n this._listeners.splice(i, 1);\n }\n\n terminate() {\n this._listeners.length = 0;\n }\n}\n\n/**\n * @typedef {Object} PDFWorkerParameters\n * @property {string} [name] - The name of the worker.\n * @property {Object} [port] - The `workerPort` object.\n * @property {number} [verbosity] - Controls the logging level;\n * the constants from {@link VerbosityLevel} should be used.\n */\n\nconst PDFWorkerUtil = {\n isWorkerDisabled: false,\n fallbackWorkerSrc: null,\n fakeWorkerId: 0,\n};\nif (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) {\n // eslint-disable-next-line no-undef\n if (isNodeJS && typeof __non_webpack_require__ === \"function\") {\n // Workers aren't supported in Node.js, force-disabling them there.\n PDFWorkerUtil.isWorkerDisabled = true;\n\n PDFWorkerUtil.fallbackWorkerSrc = PDFJSDev.test(\"LIB\")\n ? \"../pdf.worker.js\"\n : \"./pdf.worker.js\";\n } else if (typeof document === \"object\") {\n const pdfjsFilePath = document?.currentScript?.src;\n if (pdfjsFilePath) {\n PDFWorkerUtil.fallbackWorkerSrc = pdfjsFilePath.replace(\n /(\\.(?:min\\.)?js)(\\?.*)?$/i,\n \".worker$1$2\"\n );\n }\n }\n\n // Check if URLs have the same origin. For non-HTTP based URLs, returns false.\n PDFWorkerUtil.isSameOrigin = function (baseUrl, otherUrl) {\n let base;\n try {\n base = new URL(baseUrl);\n if (!base.origin || base.origin === \"null\") {\n return false; // non-HTTP url\n }\n } catch (e) {\n return false;\n }\n\n const other = new URL(otherUrl, base);\n return base.origin === other.origin;\n };\n\n PDFWorkerUtil.createCDNWrapper = function (url) {\n // We will rely on blob URL's property to specify origin.\n // We want this function to fail in case if createObjectURL or Blob do not\n // exist or fail for some reason -- our Worker creation will fail anyway.\n const wrapper = `importScripts(\"${url}\");`;\n return URL.createObjectURL(new Blob([wrapper]));\n };\n}\n\n/**\n * PDF.js web worker abstraction that controls the instantiation of PDF\n * documents. Message handlers are used to pass information from the main\n * thread to the worker thread and vice versa. If the creation of a web\n * worker is not possible, a \"fake\" worker will be used instead.\n *\n * @param {PDFWorkerParameters} params - The worker initialization parameters.\n */\nclass PDFWorker {\n static #workerPorts = new WeakMap();\n\n constructor({\n name = null,\n port = null,\n verbosity = getVerbosityLevel(),\n } = {}) {\n if (port && PDFWorker.#workerPorts.has(port)) {\n throw new Error(\"Cannot use more than one PDFWorker per port.\");\n }\n\n this.name = name;\n this.destroyed = false;\n this.verbosity = verbosity;\n\n this._readyCapability = createPromiseCapability();\n this._port = null;\n this._webWorker = null;\n this._messageHandler = null;\n\n if (port) {\n PDFWorker.#workerPorts.set(port, this);\n this._initializeFromPort(port);\n return;\n }\n this._initialize();\n }\n\n /**\n * Promise for worker initialization completion.\n * @type {Promise}\n */\n get promise() {\n return this._readyCapability.promise;\n }\n\n /**\n * The current `workerPort`, when it exists.\n * @type {Worker}\n */\n get port() {\n return this._port;\n }\n\n /**\n * The current MessageHandler-instance.\n * @type {MessageHandler}\n */\n get messageHandler() {\n return this._messageHandler;\n }\n\n _initializeFromPort(port) {\n this._port = port;\n this._messageHandler = new MessageHandler(\"main\", \"worker\", port);\n this._messageHandler.on(\"ready\", function () {\n // Ignoring \"ready\" event -- MessageHandler should already be initialized\n // and ready to accept messages.\n });\n this._readyCapability.resolve();\n }\n\n _initialize() {\n // If worker support isn't disabled explicit and the browser has worker\n // support, create a new web worker and test if it/the browser fulfills\n // all requirements to run parts of pdf.js in a web worker.\n // Right now, the requirement is, that an Uint8Array is still an\n // Uint8Array as it arrives on the worker. (Chrome added this with v.15.)\n if (\n typeof Worker !== \"undefined\" &&\n !PDFWorkerUtil.isWorkerDisabled &&\n !PDFWorker._mainThreadWorkerMessageHandler\n ) {\n let workerSrc = PDFWorker.workerSrc;\n\n try {\n // Wraps workerSrc path into blob URL, if the former does not belong\n // to the same origin.\n if (\n typeof PDFJSDev !== \"undefined\" &&\n PDFJSDev.test(\"GENERIC\") &&\n !PDFWorkerUtil.isSameOrigin(window.location.href, workerSrc)\n ) {\n workerSrc = PDFWorkerUtil.createCDNWrapper(\n new URL(workerSrc, window.location).href\n );\n }\n\n // Some versions of FF can't create a worker on localhost, see:\n // https://bugzilla.mozilla.org/show_bug.cgi?id=683280\n const worker = new Worker(workerSrc);\n const messageHandler = new MessageHandler(\"main\", \"worker\", worker);\n const terminateEarly = () => {\n worker.removeEventListener(\"error\", onWorkerError);\n messageHandler.destroy();\n worker.terminate();\n if (this.destroyed) {\n this._readyCapability.reject(new Error(\"Worker was destroyed\"));\n } else {\n // Fall back to fake worker if the termination is caused by an\n // error (e.g. NetworkError / SecurityError).\n this._setupFakeWorker();\n }\n };\n\n const onWorkerError = () => {\n if (!this._webWorker) {\n // Worker failed to initialize due to an error. Clean up and fall\n // back to the fake worker.\n terminateEarly();\n }\n };\n worker.addEventListener(\"error\", onWorkerError);\n\n messageHandler.on(\"test\", data => {\n worker.removeEventListener(\"error\", onWorkerError);\n if (this.destroyed) {\n terminateEarly();\n return; // worker was destroyed\n }\n if (data) {\n this._messageHandler = messageHandler;\n this._port = worker;\n this._webWorker = worker;\n\n this._readyCapability.resolve();\n // Send global setting, e.g. verbosity level.\n messageHandler.send(\"configure\", {\n verbosity: this.verbosity,\n });\n } else {\n this._setupFakeWorker();\n messageHandler.destroy();\n worker.terminate();\n }\n });\n\n messageHandler.on(\"ready\", data => {\n worker.removeEventListener(\"error\", onWorkerError);\n if (this.destroyed) {\n terminateEarly();\n return; // worker was destroyed\n }\n try {\n sendTest();\n } catch (e) {\n // We need fallback to a faked worker.\n this._setupFakeWorker();\n }\n });\n\n const sendTest = () => {\n const testObj = new Uint8Array();\n // Ensure that we can use `postMessage` transfers.\n messageHandler.send(\"test\", testObj, [testObj.buffer]);\n };\n\n // It might take time for the worker to initialize. We will try to send\n // the \"test\" message immediately, and once the \"ready\" message arrives.\n // The worker shall process only the first received \"test\" message.\n sendTest();\n return;\n } catch (e) {\n info(\"The worker has been disabled.\");\n }\n }\n // Either workers are disabled, not supported or have thrown an exception.\n // Thus, we fallback to a faked worker.\n this._setupFakeWorker();\n }\n\n _setupFakeWorker() {\n if (!PDFWorkerUtil.isWorkerDisabled) {\n warn(\"Setting up fake worker.\");\n PDFWorkerUtil.isWorkerDisabled = true;\n }\n\n PDFWorker._setupFakeWorkerGlobal\n .then(WorkerMessageHandler => {\n if (this.destroyed) {\n this._readyCapability.reject(new Error(\"Worker was destroyed\"));\n return;\n }\n const port = new LoopbackPort();\n this._port = port;\n\n // All fake workers use the same port, making id unique.\n const id = `fake${PDFWorkerUtil.fakeWorkerId++}`;\n\n // If the main thread is our worker, setup the handling for the\n // messages -- the main thread sends to it self.\n const workerHandler = new MessageHandler(id + \"_worker\", id, port);\n WorkerMessageHandler.setup(workerHandler, port);\n\n const messageHandler = new MessageHandler(id, id + \"_worker\", port);\n this._messageHandler = messageHandler;\n this._readyCapability.resolve();\n // Send global setting, e.g. verbosity level.\n messageHandler.send(\"configure\", {\n verbosity: this.verbosity,\n });\n })\n .catch(reason => {\n this._readyCapability.reject(\n new Error(`Setting up fake worker failed: \"${reason.message}\".`)\n );\n });\n }\n\n /**\n * Destroys the worker instance.\n */\n destroy() {\n this.destroyed = true;\n if (this._webWorker) {\n // We need to terminate only web worker created resource.\n this._webWorker.terminate();\n this._webWorker = null;\n }\n PDFWorker.#workerPorts.delete(this._port);\n this._port = null;\n if (this._messageHandler) {\n this._messageHandler.destroy();\n this._messageHandler = null;\n }\n }\n\n /**\n * @param {PDFWorkerParameters} params - The worker initialization parameters.\n */\n static fromPort(params) {\n if (!params?.port) {\n throw new Error(\"PDFWorker.fromPort - invalid method signature.\");\n }\n if (this.#workerPorts.has(params.port)) {\n return this.#workerPorts.get(params.port);\n }\n return new PDFWorker(params);\n }\n\n /**\n * The current `workerSrc`, when it exists.\n * @type {string}\n */\n static get workerSrc() {\n if (GlobalWorkerOptions.workerSrc) {\n return GlobalWorkerOptions.workerSrc;\n }\n if (PDFWorkerUtil.fallbackWorkerSrc !== null) {\n if (!isNodeJS) {\n deprecated('No \"GlobalWorkerOptions.workerSrc\" specified.');\n }\n return PDFWorkerUtil.fallbackWorkerSrc;\n }\n throw new Error('No \"GlobalWorkerOptions.workerSrc\" specified.');\n }\n\n static get _mainThreadWorkerMessageHandler() {\n try {\n return globalThis.pdfjsWorker?.WorkerMessageHandler || null;\n } catch (ex) {\n return null;\n }\n }\n\n // Loads worker code into the main-thread.\n static get _setupFakeWorkerGlobal() {\n const loader = async () => {\n const mainWorkerMessageHandler = this._mainThreadWorkerMessageHandler;\n\n if (mainWorkerMessageHandler) {\n // The worker was already loaded using e.g. a ` + + + + + + +
+ +
+
+
+
+ + + + +
+
+ +
+ +
+
+
+
+
+ + + +
+
+
+ +
+ + + + +
+
+
+
+ +
+ +
+ +
+ +
+ + +
+
+ + + + + + + + + Current View + + +
+ + +
+
+
+ +
+ +
+ + + +
+
+
+
+
+
+
+
+
+
+ +
+
+
+ + +
+ +
+ +
+ +
+
+ +
+
+ + +
+
+ +
+ File name: +

-

+
+
+ File size: +

-

+
+
+
+ Title: +

-

+
+
+ Author: +

-

+
+
+ Subject: +

-

+
+
+ Keywords: +

-

+
+
+ Creation Date: +

-

+
+
+ Modification Date: +

-

+
+
+ Creator: +

-

+
+
+
+ PDF Producer: +

-

+
+
+ PDF Version: +

-

+
+
+ Page Count: +

-

+
+
+ Page Size: +

-

+
+
+
+ Fast Web View: +

-

+
+
+ +
+
+ +
+ Preparing document for printing… +
+
+ + 0% +
+
+ +
+
+
+ +
+
+ + + + diff --git a/public/pdf/web/viewer.js b/public/pdf/web/viewer.js new file mode 100644 index 0000000..a0d3e46 --- /dev/null +++ b/public/pdf/web/viewer.js @@ -0,0 +1,15590 @@ +/** + * @licstart The following is the entire license notice for the + * JavaScript code in this page + * + * Copyright 2022 Mozilla Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * @licend The above is the entire license notice for the + * JavaScript code in this page + */ + +/******/ (() => { // webpackBootstrap +/******/ "use strict"; +/******/ var __webpack_modules__ = ([ +/* 0 */, +/* 1 */ +/***/ ((__unused_webpack_module, exports) => { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.compatibilityParams = exports.OptionKind = exports.AppOptions = void 0; +const compatibilityParams = Object.create(null); +exports.compatibilityParams = compatibilityParams; +{ + const userAgent = navigator.userAgent || ""; + const platform = navigator.platform || ""; + const maxTouchPoints = navigator.maxTouchPoints || 1; + const isAndroid = /Android/.test(userAgent); + const isIOS = /\b(iPad|iPhone|iPod)(?=;)/.test(userAgent) || platform === "MacIntel" && maxTouchPoints > 1; + + (function checkCanvasSizeLimitation() { + if (isIOS || isAndroid) { + compatibilityParams.maxCanvasPixels = 5242880; + } + })(); +} +const OptionKind = { + VIEWER: 0x02, + API: 0x04, + WORKER: 0x08, + PREFERENCE: 0x80 +}; +exports.OptionKind = OptionKind; +const defaultOptions = { + annotationMode: { + value: 2, + kind: OptionKind.VIEWER + OptionKind.PREFERENCE + }, + cursorToolOnLoad: { + value: 0, + kind: OptionKind.VIEWER + OptionKind.PREFERENCE + }, + defaultUrl: { + value: "compressed.tracemonkey-pldi-09.pdf", + kind: OptionKind.VIEWER + }, + defaultZoomValue: { + value: "", + kind: OptionKind.VIEWER + OptionKind.PREFERENCE + }, + disableHistory: { + value: false, + kind: OptionKind.VIEWER + }, + disablePageLabels: { + value: false, + kind: OptionKind.VIEWER + OptionKind.PREFERENCE + }, + enablePermissions: { + value: false, + kind: OptionKind.VIEWER + OptionKind.PREFERENCE + }, + enablePrintAutoRotate: { + value: true, + kind: OptionKind.VIEWER + OptionKind.PREFERENCE + }, + enableScripting: { + value: true, + kind: OptionKind.VIEWER + OptionKind.PREFERENCE + }, + externalLinkRel: { + value: "noopener noreferrer nofollow", + kind: OptionKind.VIEWER + }, + externalLinkTarget: { + value: 0, + kind: OptionKind.VIEWER + OptionKind.PREFERENCE + }, + historyUpdateUrl: { + value: false, + kind: OptionKind.VIEWER + OptionKind.PREFERENCE + }, + ignoreDestinationZoom: { + value: false, + kind: OptionKind.VIEWER + OptionKind.PREFERENCE + }, + imageResourcesPath: { + value: "./images/", + kind: OptionKind.VIEWER + }, + maxCanvasPixels: { + value: 16777216, + compatibility: compatibilityParams.maxCanvasPixels, + kind: OptionKind.VIEWER + }, + pageColorsBackground: { + value: "Canvas", + kind: OptionKind.VIEWER + OptionKind.PREFERENCE + }, + pageColorsForeground: { + value: "CanvasText", + kind: OptionKind.VIEWER + OptionKind.PREFERENCE + }, + pdfBugEnabled: { + value: false, + kind: OptionKind.VIEWER + OptionKind.PREFERENCE + }, + printResolution: { + value: 150, + kind: OptionKind.VIEWER + }, + renderer: { + value: "canvas", + kind: OptionKind.VIEWER + }, + sidebarViewOnLoad: { + value: -1, + kind: OptionKind.VIEWER + OptionKind.PREFERENCE + }, + scrollModeOnLoad: { + value: -1, + kind: OptionKind.VIEWER + OptionKind.PREFERENCE + }, + spreadModeOnLoad: { + value: -1, + kind: OptionKind.VIEWER + OptionKind.PREFERENCE + }, + textLayerMode: { + value: 1, + kind: OptionKind.VIEWER + OptionKind.PREFERENCE + }, + useOnlyCssZoom: { + value: false, + kind: OptionKind.VIEWER + OptionKind.PREFERENCE + }, + viewerCssTheme: { + value: 0, + kind: OptionKind.VIEWER + OptionKind.PREFERENCE + }, + viewOnLoad: { + value: 0, + kind: OptionKind.VIEWER + OptionKind.PREFERENCE + }, + cMapPacked: { + value: true, + kind: OptionKind.API + }, + cMapUrl: { + value: "../web/cmaps/", + kind: OptionKind.API + }, + disableAutoFetch: { + value: false, + kind: OptionKind.API + OptionKind.PREFERENCE + }, + disableFontFace: { + value: false, + kind: OptionKind.API + OptionKind.PREFERENCE + }, + disableRange: { + value: false, + kind: OptionKind.API + OptionKind.PREFERENCE + }, + disableStream: { + value: false, + kind: OptionKind.API + OptionKind.PREFERENCE + }, + docBaseUrl: { + value: "", + kind: OptionKind.API + }, + enableXfa: { + value: true, + kind: OptionKind.API + OptionKind.PREFERENCE + }, + fontExtraProperties: { + value: false, + kind: OptionKind.API + }, + isEvalSupported: { + value: true, + kind: OptionKind.API + }, + maxImageSize: { + value: -1, + kind: OptionKind.API + }, + pdfBug: { + value: false, + kind: OptionKind.API + }, + standardFontDataUrl: { + value: "../web/standard_fonts/", + kind: OptionKind.API + }, + verbosity: { + value: 1, + kind: OptionKind.API + }, + workerPort: { + value: null, + kind: OptionKind.WORKER + }, + workerSrc: { + value: "../build/pdf.worker.js", + kind: OptionKind.WORKER + } +}; +{ + defaultOptions.disablePreferences = { + value: false, + kind: OptionKind.VIEWER + }; + defaultOptions.locale = { + value: navigator.language || "en-US", + kind: OptionKind.VIEWER + }; + defaultOptions.sandboxBundleSrc = { + value: "../build/pdf.sandbox.js", + kind: OptionKind.VIEWER + }; + defaultOptions.renderer.kind += OptionKind.PREFERENCE; +} +const userOptions = Object.create(null); + +class AppOptions { + constructor() { + throw new Error("Cannot initialize AppOptions."); + } + + static get(name) { + const userOption = userOptions[name]; + + if (userOption !== undefined) { + return userOption; + } + + const defaultOption = defaultOptions[name]; + + if (defaultOption !== undefined) { + return defaultOption.compatibility ?? defaultOption.value; + } + + return undefined; + } + + static getAll(kind = null) { + const options = Object.create(null); + + for (const name in defaultOptions) { + const defaultOption = defaultOptions[name]; + + if (kind) { + if ((kind & defaultOption.kind) === 0) { + continue; + } + + if (kind === OptionKind.PREFERENCE) { + const value = defaultOption.value, + valueType = typeof value; + + if (valueType === "boolean" || valueType === "string" || valueType === "number" && Number.isInteger(value)) { + options[name] = value; + continue; + } + + throw new Error(`Invalid type for preference: ${name}`); + } + } + + const userOption = userOptions[name]; + options[name] = userOption !== undefined ? userOption : defaultOption.compatibility ?? defaultOption.value; + } + + return options; + } + + static set(name, value) { + userOptions[name] = value; + } + + static setAll(options) { + for (const name in options) { + userOptions[name] = options[name]; + } + } + + static remove(name) { + delete userOptions[name]; + } + + static _hasUserOptions() { + return Object.keys(userOptions).length > 0; + } + +} + +exports.AppOptions = AppOptions; + +/***/ }), +/* 2 */ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.PDFViewerApplication = exports.PDFPrintServiceFactory = exports.DefaultExternalServices = void 0; + +var _ui_utils = __webpack_require__(3); + +var _app_options = __webpack_require__(1); + +var _event_utils = __webpack_require__(4); + +var _pdfjsLib = __webpack_require__(5); + +var _pdf_cursor_tools = __webpack_require__(6); + +var _pdf_link_service = __webpack_require__(8); + +var _overlay_manager = __webpack_require__(9); + +var _password_prompt = __webpack_require__(10); + +var _pdf_attachment_viewer = __webpack_require__(11); + +var _pdf_document_properties = __webpack_require__(13); + +var _pdf_find_bar = __webpack_require__(14); + +var _pdf_find_controller = __webpack_require__(15); + +var _pdf_history = __webpack_require__(17); + +var _pdf_layer_viewer = __webpack_require__(18); + +var _pdf_outline_viewer = __webpack_require__(19); + +var _pdf_presentation_mode = __webpack_require__(20); + +var _pdf_rendering_queue = __webpack_require__(21); + +var _pdf_scripting_manager = __webpack_require__(22); + +var _pdf_sidebar = __webpack_require__(23); + +var _pdf_sidebar_resizer = __webpack_require__(24); + +var _pdf_thumbnail_viewer = __webpack_require__(25); + +var _pdf_viewer = __webpack_require__(27); + +var _secondary_toolbar = __webpack_require__(36); + +var _toolbar = __webpack_require__(37); + +var _view_history = __webpack_require__(38); + +const DISABLE_AUTO_FETCH_LOADING_BAR_TIMEOUT = 5000; +const FORCE_PAGES_LOADED_TIMEOUT = 10000; +const WHEEL_ZOOM_DISABLED_TIMEOUT = 1000; +const ViewOnLoad = { + UNKNOWN: -1, + PREVIOUS: 0, + INITIAL: 1 +}; +const ViewerCssTheme = { + AUTOMATIC: 0, + LIGHT: 1, + DARK: 2 +}; +const KNOWN_VERSIONS = ["1.0", "1.1", "1.2", "1.3", "1.4", "1.5", "1.6", "1.7", "1.8", "1.9", "2.0", "2.1", "2.2", "2.3"]; +const KNOWN_GENERATORS = ["acrobat distiller", "acrobat pdfwriter", "adobe livecycle", "adobe pdf library", "adobe photoshop", "ghostscript", "tcpdf", "cairo", "dvipdfm", "dvips", "pdftex", "pdfkit", "itext", "prince", "quarkxpress", "mac os x", "microsoft", "openoffice", "oracle", "luradocument", "pdf-xchange", "antenna house", "aspose.cells", "fpdf"]; + +class DefaultExternalServices { + constructor() { + throw new Error("Cannot initialize DefaultExternalServices."); + } + + static updateFindControlState(data) {} + + static updateFindMatchesCount(data) {} + + static initPassiveLoading(callbacks) {} + + static reportTelemetry(data) {} + + static createDownloadManager(options) { + throw new Error("Not implemented: createDownloadManager"); + } + + static createPreferences() { + throw new Error("Not implemented: createPreferences"); + } + + static createL10n(options) { + throw new Error("Not implemented: createL10n"); + } + + static createScripting(options) { + throw new Error("Not implemented: createScripting"); + } + + static get supportsIntegratedFind() { + return (0, _pdfjsLib.shadow)(this, "supportsIntegratedFind", false); + } + + static get supportsDocumentFonts() { + return (0, _pdfjsLib.shadow)(this, "supportsDocumentFonts", true); + } + + static get supportedMouseWheelZoomModifierKeys() { + return (0, _pdfjsLib.shadow)(this, "supportedMouseWheelZoomModifierKeys", { + ctrlKey: true, + metaKey: true + }); + } + + static get isInAutomation() { + return (0, _pdfjsLib.shadow)(this, "isInAutomation", false); + } + +} + +exports.DefaultExternalServices = DefaultExternalServices; +const PDFViewerApplication = { + initialBookmark: document.location.hash.substring(1), + _initializedCapability: (0, _pdfjsLib.createPromiseCapability)(), + appConfig: null, + pdfDocument: null, + pdfLoadingTask: null, + printService: null, + pdfViewer: null, + pdfThumbnailViewer: null, + pdfRenderingQueue: null, + pdfPresentationMode: null, + pdfDocumentProperties: null, + pdfLinkService: null, + pdfHistory: null, + pdfSidebar: null, + pdfSidebarResizer: null, + pdfOutlineViewer: null, + pdfAttachmentViewer: null, + pdfLayerViewer: null, + pdfCursorTools: null, + pdfScriptingManager: null, + store: null, + downloadManager: null, + overlayManager: null, + preferences: null, + toolbar: null, + secondaryToolbar: null, + eventBus: null, + l10n: null, + isInitialViewSet: false, + downloadComplete: false, + isViewerEmbedded: window.parent !== window, + url: "", + baseUrl: "", + _downloadUrl: "", + externalServices: DefaultExternalServices, + _boundEvents: Object.create(null), + documentInfo: null, + metadata: null, + _contentDispositionFilename: null, + _contentLength: null, + _saveInProgress: false, + _docStats: null, + _wheelUnusedTicks: 0, + _idleCallbacks: new Set(), + _PDFBug: null, + + async initialize(appConfig) { + this.preferences = this.externalServices.createPreferences(); + this.appConfig = appConfig; + await this._readPreferences(); + await this._parseHashParameters(); + + this._forceCssTheme(); + + await this._initializeL10n(); + + if (this.isViewerEmbedded && _app_options.AppOptions.get("externalLinkTarget") === _pdf_link_service.LinkTarget.NONE) { + _app_options.AppOptions.set("externalLinkTarget", _pdf_link_service.LinkTarget.TOP); + } + + await this._initializeViewerComponents(); + this.bindEvents(); + this.bindWindowEvents(); + const appContainer = appConfig.appContainer || document.documentElement; + this.l10n.translate(appContainer).then(() => { + this.eventBus.dispatch("localized", { + source: this + }); + }); + + this._initializedCapability.resolve(); + }, + + async _readPreferences() { + if (_app_options.AppOptions.get("disablePreferences")) { + return; + } + + if (_app_options.AppOptions._hasUserOptions()) { + console.warn("_readPreferences: The Preferences may override manually set AppOptions; " + 'please use the "disablePreferences"-option in order to prevent that.'); + } + + try { + _app_options.AppOptions.setAll(await this.preferences.getAll()); + } catch (reason) { + console.error(`_readPreferences: "${reason?.message}".`); + } + }, + + async _parseHashParameters() { + if (!_app_options.AppOptions.get("pdfBugEnabled")) { + return; + } + + const hash = document.location.hash.substring(1); + + if (!hash) { + return; + } + + const { + mainContainer, + viewerContainer + } = this.appConfig, + params = (0, _ui_utils.parseQueryString)(hash); + + if (params.get("disableworker") === "true") { + try { + await loadFakeWorker(); + } catch (ex) { + console.error(`_parseHashParameters: "${ex.message}".`); + } + } + + if (params.has("disablerange")) { + _app_options.AppOptions.set("disableRange", params.get("disablerange") === "true"); + } + + if (params.has("disablestream")) { + _app_options.AppOptions.set("disableStream", params.get("disablestream") === "true"); + } + + if (params.has("disableautofetch")) { + _app_options.AppOptions.set("disableAutoFetch", params.get("disableautofetch") === "true"); + } + + if (params.has("disablefontface")) { + _app_options.AppOptions.set("disableFontFace", params.get("disablefontface") === "true"); + } + + if (params.has("disablehistory")) { + _app_options.AppOptions.set("disableHistory", params.get("disablehistory") === "true"); + } + + if (params.has("verbosity")) { + _app_options.AppOptions.set("verbosity", params.get("verbosity") | 0); + } + + if (params.has("textlayer")) { + switch (params.get("textlayer")) { + case "off": + _app_options.AppOptions.set("textLayerMode", _ui_utils.TextLayerMode.DISABLE); + + break; + + case "visible": + case "shadow": + case "hover": + viewerContainer.classList.add(`textLayer-${params.get("textlayer")}`); + + try { + await loadPDFBug(this); + + this._PDFBug.loadCSS(); + } catch (ex) { + console.error(`_parseHashParameters: "${ex.message}".`); + } + + break; + } + } + + if (params.has("pdfbug")) { + _app_options.AppOptions.set("pdfBug", true); + + _app_options.AppOptions.set("fontExtraProperties", true); + + const enabled = params.get("pdfbug").split(","); + + try { + await loadPDFBug(this); + + this._PDFBug.init({ + OPS: _pdfjsLib.OPS + }, mainContainer, enabled); + } catch (ex) { + console.error(`_parseHashParameters: "${ex.message}".`); + } + } + + if (params.has("locale")) { + _app_options.AppOptions.set("locale", params.get("locale")); + } + }, + + async _initializeL10n() { + this.l10n = this.externalServices.createL10n({ + locale: _app_options.AppOptions.get("locale") + }); + const dir = await this.l10n.getDirection(); + document.getElementsByTagName("html")[0].dir = dir; + }, + + _forceCssTheme() { + const cssTheme = _app_options.AppOptions.get("viewerCssTheme"); + + if (cssTheme === ViewerCssTheme.AUTOMATIC || !Object.values(ViewerCssTheme).includes(cssTheme)) { + return; + } + + try { + const styleSheet = document.styleSheets[0]; + const cssRules = styleSheet?.cssRules || []; + + for (let i = 0, ii = cssRules.length; i < ii; i++) { + const rule = cssRules[i]; + + if (rule instanceof CSSMediaRule && rule.media?.[0] === "(prefers-color-scheme: dark)") { + if (cssTheme === ViewerCssTheme.LIGHT) { + styleSheet.deleteRule(i); + return; + } + + const darkRules = /^@media \(prefers-color-scheme: dark\) {\n\s*([\w\s-.,:;/\\{}()]+)\n}$/.exec(rule.cssText); + + if (darkRules?.[1]) { + styleSheet.deleteRule(i); + styleSheet.insertRule(darkRules[1], i); + } + + return; + } + } + } catch (reason) { + console.error(`_forceCssTheme: "${reason?.message}".`); + } + }, + + async _initializeViewerComponents() { + const { + appConfig, + externalServices + } = this; + const eventBus = externalServices.isInAutomation ? new _event_utils.AutomationEventBus() : new _event_utils.EventBus(); + this.eventBus = eventBus; + this.overlayManager = new _overlay_manager.OverlayManager(); + const pdfRenderingQueue = new _pdf_rendering_queue.PDFRenderingQueue(); + pdfRenderingQueue.onIdle = this._cleanup.bind(this); + this.pdfRenderingQueue = pdfRenderingQueue; + const pdfLinkService = new _pdf_link_service.PDFLinkService({ + eventBus, + externalLinkTarget: _app_options.AppOptions.get("externalLinkTarget"), + externalLinkRel: _app_options.AppOptions.get("externalLinkRel"), + ignoreDestinationZoom: _app_options.AppOptions.get("ignoreDestinationZoom") + }); + this.pdfLinkService = pdfLinkService; + const downloadManager = externalServices.createDownloadManager(); + this.downloadManager = downloadManager; + const findController = new _pdf_find_controller.PDFFindController({ + linkService: pdfLinkService, + eventBus + }); + this.findController = findController; + const pdfScriptingManager = new _pdf_scripting_manager.PDFScriptingManager({ + eventBus, + sandboxBundleSrc: _app_options.AppOptions.get("sandboxBundleSrc"), + scriptingFactory: externalServices, + docPropertiesLookup: this._scriptingDocProperties.bind(this) + }); + this.pdfScriptingManager = pdfScriptingManager; + const container = appConfig.mainContainer; + const viewer = appConfig.viewerContainer; + this.pdfViewer = new _pdf_viewer.PDFViewer({ + container, + viewer, + eventBus, + renderingQueue: pdfRenderingQueue, + linkService: pdfLinkService, + downloadManager, + findController, + scriptingManager: _app_options.AppOptions.get("enableScripting") && pdfScriptingManager, + renderer: _app_options.AppOptions.get("renderer"), + l10n: this.l10n, + textLayerMode: _app_options.AppOptions.get("textLayerMode"), + annotationMode: _app_options.AppOptions.get("annotationMode"), + imageResourcesPath: _app_options.AppOptions.get("imageResourcesPath"), + enablePrintAutoRotate: _app_options.AppOptions.get("enablePrintAutoRotate"), + useOnlyCssZoom: _app_options.AppOptions.get("useOnlyCssZoom"), + maxCanvasPixels: _app_options.AppOptions.get("maxCanvasPixels"), + enablePermissions: _app_options.AppOptions.get("enablePermissions"), + pageColors: { + background: _app_options.AppOptions.get("pageColorsBackground"), + foreground: _app_options.AppOptions.get("pageColorsForeground") + } + }); + pdfRenderingQueue.setViewer(this.pdfViewer); + pdfLinkService.setViewer(this.pdfViewer); + pdfScriptingManager.setViewer(this.pdfViewer); + this.pdfThumbnailViewer = new _pdf_thumbnail_viewer.PDFThumbnailViewer({ + container: appConfig.sidebar.thumbnailView, + eventBus, + renderingQueue: pdfRenderingQueue, + linkService: pdfLinkService, + l10n: this.l10n + }); + pdfRenderingQueue.setThumbnailViewer(this.pdfThumbnailViewer); + + if (!this.isViewerEmbedded && !_app_options.AppOptions.get("disableHistory")) { + this.pdfHistory = new _pdf_history.PDFHistory({ + linkService: pdfLinkService, + eventBus + }); + pdfLinkService.setHistory(this.pdfHistory); + } + + if (!this.supportsIntegratedFind) { + this.findBar = new _pdf_find_bar.PDFFindBar(appConfig.findBar, eventBus, this.l10n); + } + + this.pdfDocumentProperties = new _pdf_document_properties.PDFDocumentProperties(appConfig.documentProperties, this.overlayManager, eventBus, this.l10n); + this.pdfCursorTools = new _pdf_cursor_tools.PDFCursorTools({ + container, + eventBus, + cursorToolOnLoad: _app_options.AppOptions.get("cursorToolOnLoad") + }); + this.toolbar = new _toolbar.Toolbar(appConfig.toolbar, eventBus, this.l10n); + this.secondaryToolbar = new _secondary_toolbar.SecondaryToolbar(appConfig.secondaryToolbar, eventBus); + + if (this.supportsFullscreen) { + this.pdfPresentationMode = new _pdf_presentation_mode.PDFPresentationMode({ + container, + pdfViewer: this.pdfViewer, + eventBus + }); + } + + this.passwordPrompt = new _password_prompt.PasswordPrompt(appConfig.passwordOverlay, this.overlayManager, this.l10n, this.isViewerEmbedded); + this.pdfOutlineViewer = new _pdf_outline_viewer.PDFOutlineViewer({ + container: appConfig.sidebar.outlineView, + eventBus, + linkService: pdfLinkService + }); + this.pdfAttachmentViewer = new _pdf_attachment_viewer.PDFAttachmentViewer({ + container: appConfig.sidebar.attachmentsView, + eventBus, + downloadManager + }); + this.pdfLayerViewer = new _pdf_layer_viewer.PDFLayerViewer({ + container: appConfig.sidebar.layersView, + eventBus, + l10n: this.l10n + }); + this.pdfSidebar = new _pdf_sidebar.PDFSidebar({ + elements: appConfig.sidebar, + pdfViewer: this.pdfViewer, + pdfThumbnailViewer: this.pdfThumbnailViewer, + eventBus, + l10n: this.l10n + }); + this.pdfSidebar.onToggled = this.forceRendering.bind(this); + this.pdfSidebarResizer = new _pdf_sidebar_resizer.PDFSidebarResizer(appConfig.sidebarResizer, eventBus, this.l10n); + }, + + run(config) { + this.initialize(config).then(webViewerInitialized); + }, + + get initialized() { + return this._initializedCapability.settled; + }, + + get initializedPromise() { + return this._initializedCapability.promise; + }, + + zoomIn(steps) { + if (this.pdfViewer.isInPresentationMode) { + return; + } + + this.pdfViewer.increaseScale(steps); + }, + + zoomOut(steps) { + if (this.pdfViewer.isInPresentationMode) { + return; + } + + this.pdfViewer.decreaseScale(steps); + }, + + zoomReset() { + if (this.pdfViewer.isInPresentationMode) { + return; + } + + this.pdfViewer.currentScaleValue = _ui_utils.DEFAULT_SCALE_VALUE; + }, + + get pagesCount() { + return this.pdfDocument ? this.pdfDocument.numPages : 0; + }, + + get page() { + return this.pdfViewer.currentPageNumber; + }, + + set page(val) { + this.pdfViewer.currentPageNumber = val; + }, + + get supportsPrinting() { + return PDFPrintServiceFactory.instance.supportsPrinting; + }, + + get supportsFullscreen() { + return (0, _pdfjsLib.shadow)(this, "supportsFullscreen", document.fullscreenEnabled); + }, + + get supportsIntegratedFind() { + return this.externalServices.supportsIntegratedFind; + }, + + get supportsDocumentFonts() { + return this.externalServices.supportsDocumentFonts; + }, + + get loadingBar() { + const bar = new _ui_utils.ProgressBar("#loadingBar"); + return (0, _pdfjsLib.shadow)(this, "loadingBar", bar); + }, + + get supportedMouseWheelZoomModifierKeys() { + return this.externalServices.supportedMouseWheelZoomModifierKeys; + }, + + initPassiveLoading() { + throw new Error("Not implemented: initPassiveLoading"); + }, + + setTitleUsingUrl(url = "", downloadUrl = null) { + this.url = url; + this.baseUrl = url.split("#")[0]; + + if (downloadUrl) { + this._downloadUrl = downloadUrl === url ? this.baseUrl : downloadUrl.split("#")[0]; + } + + let title = (0, _pdfjsLib.getPdfFilenameFromUrl)(url, ""); + + if (!title) { + try { + title = decodeURIComponent((0, _pdfjsLib.getFilenameFromUrl)(url)) || url; + } catch (ex) { + title = url; + } + } + + this.setTitle(title); + }, + + setTitle(title) { + if (this.isViewerEmbedded) { + return; + } + + document.title = title; + }, + + get _docFilename() { + return this._contentDispositionFilename || (0, _pdfjsLib.getPdfFilenameFromUrl)(this.url); + }, + + _hideViewBookmark() { + const { + toolbar, + secondaryToolbar + } = this.appConfig; + toolbar.viewBookmark.hidden = true; + secondaryToolbar.viewBookmarkButton.hidden = true; + }, + + _cancelIdleCallbacks() { + if (!this._idleCallbacks.size) { + return; + } + + for (const callback of this._idleCallbacks) { + window.cancelIdleCallback(callback); + } + + this._idleCallbacks.clear(); + }, + + async close() { + this._unblockDocumentLoadEvent(); + + this._hideViewBookmark(); + + const { + container + } = this.appConfig.errorWrapper; + container.hidden = true; + + if (!this.pdfLoadingTask) { + return; + } + + if (this.pdfDocument?.annotationStorage.size > 0 && this._annotationStorageModified) { + try { + await this.save({ + sourceEventType: "save" + }); + } catch (reason) {} + } + + const promises = []; + promises.push(this.pdfLoadingTask.destroy()); + this.pdfLoadingTask = null; + + if (this.pdfDocument) { + this.pdfDocument = null; + this.pdfThumbnailViewer.setDocument(null); + this.pdfViewer.setDocument(null); + this.pdfLinkService.setDocument(null); + this.pdfDocumentProperties.setDocument(null); + } + + this.pdfLinkService.externalLinkEnabled = true; + this.store = null; + this.isInitialViewSet = false; + this.downloadComplete = false; + this.url = ""; + this.baseUrl = ""; + this._downloadUrl = ""; + this.documentInfo = null; + this.metadata = null; + this._contentDispositionFilename = null; + this._contentLength = null; + this._saveInProgress = false; + this._docStats = null; + + this._cancelIdleCallbacks(); + + promises.push(this.pdfScriptingManager.destroyPromise); + this.pdfSidebar.reset(); + this.pdfOutlineViewer.reset(); + this.pdfAttachmentViewer.reset(); + this.pdfLayerViewer.reset(); + this.pdfHistory?.reset(); + this.findBar?.reset(); + this.toolbar.reset(); + this.secondaryToolbar.reset(); + this._PDFBug?.cleanup(); + await Promise.all(promises); + }, + + async open(file, args) { + if (this.pdfLoadingTask) { + await this.close(); + } + + const workerParameters = _app_options.AppOptions.getAll(_app_options.OptionKind.WORKER); + + for (const key in workerParameters) { + _pdfjsLib.GlobalWorkerOptions[key] = workerParameters[key]; + } + + const parameters = Object.create(null); + + if (typeof file === "string") { + this.setTitleUsingUrl(file, file); + parameters.url = file; + } else if (file && "byteLength" in file) { + parameters.data = file; + } else if (file.url && file.originalUrl) { + this.setTitleUsingUrl(file.originalUrl, file.url); + parameters.url = file.url; + } + + const apiParameters = _app_options.AppOptions.getAll(_app_options.OptionKind.API); + + for (const key in apiParameters) { + let value = apiParameters[key]; + + if (key === "docBaseUrl" && !value) {} + + parameters[key] = value; + } + + if (args) { + for (const key in args) { + parameters[key] = args[key]; + } + } + + const loadingTask = (0, _pdfjsLib.getDocument)(parameters); + this.pdfLoadingTask = loadingTask; + + loadingTask.onPassword = (updateCallback, reason) => { + this.pdfLinkService.externalLinkEnabled = false; + this.passwordPrompt.setUpdateCallback(updateCallback, reason); + this.passwordPrompt.open(); + }; + + loadingTask.onProgress = ({ + loaded, + total + }) => { + this.progress(loaded / total); + }; + + loadingTask.onUnsupportedFeature = this.fallback.bind(this); + return loadingTask.promise.then(pdfDocument => { + this.load(pdfDocument); + }, reason => { + if (loadingTask !== this.pdfLoadingTask) { + return undefined; + } + + let key = "loading_error"; + + if (reason instanceof _pdfjsLib.InvalidPDFException) { + key = "invalid_file_error"; + } else if (reason instanceof _pdfjsLib.MissingPDFException) { + key = "missing_file_error"; + } else if (reason instanceof _pdfjsLib.UnexpectedResponseException) { + key = "unexpected_response_error"; + } + + return this.l10n.get(key).then(msg => { + this._documentError(msg, { + message: reason?.message + }); + + throw reason; + }); + }); + }, + + _ensureDownloadComplete() { + if (this.pdfDocument && this.downloadComplete) { + return; + } + + throw new Error("PDF document not downloaded."); + }, + + async download({ + sourceEventType = "download" + } = {}) { + const url = this._downloadUrl, + filename = this._docFilename; + + try { + this._ensureDownloadComplete(); + + const data = await this.pdfDocument.getData(); + const blob = new Blob([data], { + type: "application/pdf" + }); + await this.downloadManager.download(blob, url, filename, sourceEventType); + } catch (reason) { + await this.downloadManager.downloadUrl(url, filename); + } + }, + + async save({ + sourceEventType = "download" + } = {}) { + if (this._saveInProgress) { + return; + } + + this._saveInProgress = true; + await this.pdfScriptingManager.dispatchWillSave(); + const url = this._downloadUrl, + filename = this._docFilename; + + try { + this._ensureDownloadComplete(); + + const data = await this.pdfDocument.saveDocument(); + const blob = new Blob([data], { + type: "application/pdf" + }); + await this.downloadManager.download(blob, url, filename, sourceEventType); + } catch (reason) { + console.error(`Error when saving the document: ${reason.message}`); + await this.download({ + sourceEventType + }); + } finally { + await this.pdfScriptingManager.dispatchDidSave(); + this._saveInProgress = false; + } + }, + + downloadOrSave(options) { + if (this.pdfDocument?.annotationStorage.size > 0) { + this.save(options); + } else { + this.download(options); + } + }, + + fallback(featureId) { + this.externalServices.reportTelemetry({ + type: "unsupportedFeature", + featureId + }); + }, + + _documentError(message, moreInfo = null) { + this._unblockDocumentLoadEvent(); + + this._otherError(message, moreInfo); + + this.eventBus.dispatch("documenterror", { + source: this, + message, + reason: moreInfo?.message ?? null + }); + }, + + _otherError(message, moreInfo = null) { + const moreInfoText = [this.l10n.get("error_version_info", { + version: _pdfjsLib.version || "?", + build: _pdfjsLib.build || "?" + })]; + + if (moreInfo) { + moreInfoText.push(this.l10n.get("error_message", { + message: moreInfo.message + })); + + if (moreInfo.stack) { + moreInfoText.push(this.l10n.get("error_stack", { + stack: moreInfo.stack + })); + } else { + if (moreInfo.filename) { + moreInfoText.push(this.l10n.get("error_file", { + file: moreInfo.filename + })); + } + + if (moreInfo.lineNumber) { + moreInfoText.push(this.l10n.get("error_line", { + line: moreInfo.lineNumber + })); + } + } + } + + const errorWrapperConfig = this.appConfig.errorWrapper; + const errorWrapper = errorWrapperConfig.container; + errorWrapper.hidden = false; + const errorMessage = errorWrapperConfig.errorMessage; + errorMessage.textContent = message; + const closeButton = errorWrapperConfig.closeButton; + + closeButton.onclick = function () { + errorWrapper.hidden = true; + }; + + const errorMoreInfo = errorWrapperConfig.errorMoreInfo; + const moreInfoButton = errorWrapperConfig.moreInfoButton; + const lessInfoButton = errorWrapperConfig.lessInfoButton; + + moreInfoButton.onclick = function () { + errorMoreInfo.hidden = false; + moreInfoButton.hidden = true; + lessInfoButton.hidden = false; + errorMoreInfo.style.height = errorMoreInfo.scrollHeight + "px"; + }; + + lessInfoButton.onclick = function () { + errorMoreInfo.hidden = true; + moreInfoButton.hidden = false; + lessInfoButton.hidden = true; + }; + + moreInfoButton.oncontextmenu = _ui_utils.noContextMenuHandler; + lessInfoButton.oncontextmenu = _ui_utils.noContextMenuHandler; + closeButton.oncontextmenu = _ui_utils.noContextMenuHandler; + moreInfoButton.hidden = false; + lessInfoButton.hidden = true; + Promise.all(moreInfoText).then(parts => { + errorMoreInfo.value = parts.join("\n"); + }); + }, + + progress(level) { + if (this.downloadComplete) { + return; + } + + const percent = Math.round(level * 100); + + if (percent > this.loadingBar.percent || isNaN(percent)) { + this.loadingBar.percent = percent; + const disableAutoFetch = this.pdfDocument ? this.pdfDocument.loadingParams.disableAutoFetch : _app_options.AppOptions.get("disableAutoFetch"); + + if (disableAutoFetch && percent) { + if (this.disableAutoFetchLoadingBarTimeout) { + clearTimeout(this.disableAutoFetchLoadingBarTimeout); + this.disableAutoFetchLoadingBarTimeout = null; + } + + this.loadingBar.show(); + this.disableAutoFetchLoadingBarTimeout = setTimeout(() => { + this.loadingBar.hide(); + this.disableAutoFetchLoadingBarTimeout = null; + }, DISABLE_AUTO_FETCH_LOADING_BAR_TIMEOUT); + } + } + }, + + load(pdfDocument) { + this.pdfDocument = pdfDocument; + pdfDocument.getDownloadInfo().then(({ + length + }) => { + this._contentLength = length; + this.downloadComplete = true; + this.loadingBar.hide(); + firstPagePromise.then(() => { + this.eventBus.dispatch("documentloaded", { + source: this + }); + }); + }); + const pageLayoutPromise = pdfDocument.getPageLayout().catch(function () {}); + const pageModePromise = pdfDocument.getPageMode().catch(function () {}); + const openActionPromise = pdfDocument.getOpenAction().catch(function () {}); + this.toolbar.setPagesCount(pdfDocument.numPages, false); + this.secondaryToolbar.setPagesCount(pdfDocument.numPages); + let baseDocumentUrl; + baseDocumentUrl = null; + this.pdfLinkService.setDocument(pdfDocument, baseDocumentUrl); + this.pdfDocumentProperties.setDocument(pdfDocument, this.url); + const pdfViewer = this.pdfViewer; + pdfViewer.setDocument(pdfDocument); + const { + firstPagePromise, + onePageRendered, + pagesPromise + } = pdfViewer; + const pdfThumbnailViewer = this.pdfThumbnailViewer; + pdfThumbnailViewer.setDocument(pdfDocument); + const storedPromise = (this.store = new _view_history.ViewHistory(pdfDocument.fingerprints[0])).getMultiple({ + page: null, + zoom: _ui_utils.DEFAULT_SCALE_VALUE, + scrollLeft: "0", + scrollTop: "0", + rotation: null, + sidebarView: _ui_utils.SidebarView.UNKNOWN, + scrollMode: _ui_utils.ScrollMode.UNKNOWN, + spreadMode: _ui_utils.SpreadMode.UNKNOWN + }).catch(() => { + return Object.create(null); + }); + firstPagePromise.then(pdfPage => { + this.loadingBar.setWidth(this.appConfig.viewerContainer); + + this._initializeAnnotationStorageCallbacks(pdfDocument); + + Promise.all([_ui_utils.animationStarted, storedPromise, pageLayoutPromise, pageModePromise, openActionPromise]).then(async ([timeStamp, stored, pageLayout, pageMode, openAction]) => { + const viewOnLoad = _app_options.AppOptions.get("viewOnLoad"); + + this._initializePdfHistory({ + fingerprint: pdfDocument.fingerprints[0], + viewOnLoad, + initialDest: openAction?.dest + }); + + const initialBookmark = this.initialBookmark; + + const zoom = _app_options.AppOptions.get("defaultZoomValue"); + + let hash = zoom ? `zoom=${zoom}` : null; + let rotation = null; + + let sidebarView = _app_options.AppOptions.get("sidebarViewOnLoad"); + + let scrollMode = _app_options.AppOptions.get("scrollModeOnLoad"); + + let spreadMode = _app_options.AppOptions.get("spreadModeOnLoad"); + + if (stored.page && viewOnLoad !== ViewOnLoad.INITIAL) { + hash = `page=${stored.page}&zoom=${zoom || stored.zoom},` + `${stored.scrollLeft},${stored.scrollTop}`; + rotation = parseInt(stored.rotation, 10); + + if (sidebarView === _ui_utils.SidebarView.UNKNOWN) { + sidebarView = stored.sidebarView | 0; + } + + if (scrollMode === _ui_utils.ScrollMode.UNKNOWN) { + scrollMode = stored.scrollMode | 0; + } + + if (spreadMode === _ui_utils.SpreadMode.UNKNOWN) { + spreadMode = stored.spreadMode | 0; + } + } + + if (pageMode && sidebarView === _ui_utils.SidebarView.UNKNOWN) { + sidebarView = (0, _ui_utils.apiPageModeToSidebarView)(pageMode); + } + + if (pageLayout && scrollMode === _ui_utils.ScrollMode.UNKNOWN && spreadMode === _ui_utils.SpreadMode.UNKNOWN) { + const modes = (0, _ui_utils.apiPageLayoutToViewerModes)(pageLayout); + spreadMode = modes.spreadMode; + } + + this.setInitialView(hash, { + rotation, + sidebarView, + scrollMode, + spreadMode + }); + this.eventBus.dispatch("documentinit", { + source: this + }); + + if (!this.isViewerEmbedded) { + pdfViewer.focus(); + } + + await Promise.race([pagesPromise, new Promise(resolve => { + setTimeout(resolve, FORCE_PAGES_LOADED_TIMEOUT); + })]); + + if (!initialBookmark && !hash) { + return; + } + + if (pdfViewer.hasEqualPageSizes) { + return; + } + + this.initialBookmark = initialBookmark; + pdfViewer.currentScaleValue = pdfViewer.currentScaleValue; + this.setInitialView(hash); + }).catch(() => { + this.setInitialView(); + }).then(function () { + pdfViewer.update(); + }); + }); + pagesPromise.then(() => { + this._unblockDocumentLoadEvent(); + + this._initializeAutoPrint(pdfDocument, openActionPromise); + }, reason => { + this.l10n.get("loading_error").then(msg => { + this._documentError(msg, { + message: reason?.message + }); + }); + }); + onePageRendered.then(data => { + this.externalServices.reportTelemetry({ + type: "pageInfo", + timestamp: data.timestamp + }); + pdfDocument.getOutline().then(outline => { + if (pdfDocument !== this.pdfDocument) { + return; + } + + this.pdfOutlineViewer.render({ + outline, + pdfDocument + }); + }); + pdfDocument.getAttachments().then(attachments => { + if (pdfDocument !== this.pdfDocument) { + return; + } + + this.pdfAttachmentViewer.render({ + attachments + }); + }); + pdfViewer.optionalContentConfigPromise.then(optionalContentConfig => { + if (pdfDocument !== this.pdfDocument) { + return; + } + + this.pdfLayerViewer.render({ + optionalContentConfig, + pdfDocument + }); + }); + + if ("requestIdleCallback" in window) { + const callback = window.requestIdleCallback(() => { + this._collectTelemetry(pdfDocument); + + this._idleCallbacks.delete(callback); + }, { + timeout: 1000 + }); + + this._idleCallbacks.add(callback); + } + }); + + this._initializePageLabels(pdfDocument); + + this._initializeMetadata(pdfDocument); + }, + + async _scriptingDocProperties(pdfDocument) { + if (!this.documentInfo) { + await new Promise(resolve => { + this.eventBus._on("metadataloaded", resolve, { + once: true + }); + }); + + if (pdfDocument !== this.pdfDocument) { + return null; + } + } + + if (!this._contentLength) { + await new Promise(resolve => { + this.eventBus._on("documentloaded", resolve, { + once: true + }); + }); + + if (pdfDocument !== this.pdfDocument) { + return null; + } + } + + return { ...this.documentInfo, + baseURL: this.baseUrl, + filesize: this._contentLength, + filename: this._docFilename, + metadata: this.metadata?.getRaw(), + authors: this.metadata?.get("dc:creator"), + numPages: this.pagesCount, + URL: this.url + }; + }, + + async _collectTelemetry(pdfDocument) { + const markInfo = await this.pdfDocument.getMarkInfo(); + + if (pdfDocument !== this.pdfDocument) { + return; + } + + const tagged = markInfo?.Marked || false; + this.externalServices.reportTelemetry({ + type: "tagged", + tagged + }); + }, + + async _initializeAutoPrint(pdfDocument, openActionPromise) { + const [openAction, javaScript] = await Promise.all([openActionPromise, !this.pdfViewer.enableScripting ? pdfDocument.getJavaScript() : null]); + + if (pdfDocument !== this.pdfDocument) { + return; + } + + let triggerAutoPrint = false; + + if (openAction?.action === "Print") { + triggerAutoPrint = true; + } + + if (javaScript) { + javaScript.some(js => { + if (!js) { + return false; + } + + console.warn("Warning: JavaScript support is not enabled"); + this.fallback(_pdfjsLib.UNSUPPORTED_FEATURES.javaScript); + return true; + }); + + if (!triggerAutoPrint) { + for (const js of javaScript) { + if (js && _ui_utils.AutoPrintRegExp.test(js)) { + triggerAutoPrint = true; + break; + } + } + } + } + + if (triggerAutoPrint) { + this.triggerPrinting(); + } + }, + + async _initializeMetadata(pdfDocument) { + const { + info, + metadata, + contentDispositionFilename, + contentLength + } = await pdfDocument.getMetadata(); + + if (pdfDocument !== this.pdfDocument) { + return; + } + + this.documentInfo = info; + this.metadata = metadata; + this._contentDispositionFilename ??= contentDispositionFilename; + this._contentLength ??= contentLength; + console.log(`PDF ${pdfDocument.fingerprints[0]} [${info.PDFFormatVersion} ` + `${(info.Producer || "-").trim()} / ${(info.Creator || "-").trim()}] ` + `(PDF.js: ${_pdfjsLib.version || "-"})`); + let pdfTitle = info?.Title; + const metadataTitle = metadata?.get("dc:title"); + + if (metadataTitle) { + if (metadataTitle !== "Untitled" && !/[\uFFF0-\uFFFF]/g.test(metadataTitle)) { + pdfTitle = metadataTitle; + } + } + + if (pdfTitle) { + this.setTitle(`${pdfTitle} - ${contentDispositionFilename || document.title}`); + } else if (contentDispositionFilename) { + this.setTitle(contentDispositionFilename); + } + + if (info.IsXFAPresent && !info.IsAcroFormPresent && !pdfDocument.isPureXfa) { + if (pdfDocument.loadingParams.enableXfa) { + console.warn("Warning: XFA Foreground documents are not supported"); + } else { + console.warn("Warning: XFA support is not enabled"); + } + + this.fallback(_pdfjsLib.UNSUPPORTED_FEATURES.forms); + } else if ((info.IsAcroFormPresent || info.IsXFAPresent) && !this.pdfViewer.renderForms) { + console.warn("Warning: Interactive form support is not enabled"); + this.fallback(_pdfjsLib.UNSUPPORTED_FEATURES.forms); + } + + if (info.IsSignaturesPresent) { + console.warn("Warning: Digital signatures validation is not supported"); + this.fallback(_pdfjsLib.UNSUPPORTED_FEATURES.signatures); + } + + let versionId = "other"; + + if (KNOWN_VERSIONS.includes(info.PDFFormatVersion)) { + versionId = `v${info.PDFFormatVersion.replace(".", "_")}`; + } + + let generatorId = "other"; + + if (info.Producer) { + const producer = info.Producer.toLowerCase(); + KNOWN_GENERATORS.some(function (generator) { + if (!producer.includes(generator)) { + return false; + } + + generatorId = generator.replace(/[ .-]/g, "_"); + return true; + }); + } + + let formType = null; + + if (info.IsXFAPresent) { + formType = "xfa"; + } else if (info.IsAcroFormPresent) { + formType = "acroform"; + } + + this.externalServices.reportTelemetry({ + type: "documentInfo", + version: versionId, + generator: generatorId, + formType + }); + this.eventBus.dispatch("metadataloaded", { + source: this + }); + }, + + async _initializePageLabels(pdfDocument) { + const labels = await pdfDocument.getPageLabels(); + + if (pdfDocument !== this.pdfDocument) { + return; + } + + if (!labels || _app_options.AppOptions.get("disablePageLabels")) { + return; + } + + const numLabels = labels.length; + let standardLabels = 0, + emptyLabels = 0; + + for (let i = 0; i < numLabels; i++) { + const label = labels[i]; + + if (label === (i + 1).toString()) { + standardLabels++; + } else if (label === "") { + emptyLabels++; + } else { + break; + } + } + + if (standardLabels >= numLabels || emptyLabels >= numLabels) { + return; + } + + const { + pdfViewer, + pdfThumbnailViewer, + toolbar + } = this; + pdfViewer.setPageLabels(labels); + pdfThumbnailViewer.setPageLabels(labels); + toolbar.setPagesCount(numLabels, true); + toolbar.setPageNumber(pdfViewer.currentPageNumber, pdfViewer.currentPageLabel); + }, + + _initializePdfHistory({ + fingerprint, + viewOnLoad, + initialDest = null + }) { + if (!this.pdfHistory) { + return; + } + + this.pdfHistory.initialize({ + fingerprint, + resetHistory: viewOnLoad === ViewOnLoad.INITIAL, + updateUrl: _app_options.AppOptions.get("historyUpdateUrl") + }); + + if (this.pdfHistory.initialBookmark) { + this.initialBookmark = this.pdfHistory.initialBookmark; + this.initialRotation = this.pdfHistory.initialRotation; + } + + if (initialDest && !this.initialBookmark && viewOnLoad === ViewOnLoad.UNKNOWN) { + this.initialBookmark = JSON.stringify(initialDest); + this.pdfHistory.push({ + explicitDest: initialDest, + pageNumber: null + }); + } + }, + + _initializeAnnotationStorageCallbacks(pdfDocument) { + if (pdfDocument !== this.pdfDocument) { + return; + } + + const { + annotationStorage + } = pdfDocument; + + annotationStorage.onSetModified = () => { + window.addEventListener("beforeunload", beforeUnload); + this._annotationStorageModified = true; + }; + + annotationStorage.onResetModified = () => { + window.removeEventListener("beforeunload", beforeUnload); + delete this._annotationStorageModified; + }; + }, + + setInitialView(storedHash, { + rotation, + sidebarView, + scrollMode, + spreadMode + } = {}) { + const setRotation = angle => { + if ((0, _ui_utils.isValidRotation)(angle)) { + this.pdfViewer.pagesRotation = angle; + } + }; + + const setViewerModes = (scroll, spread) => { + if ((0, _ui_utils.isValidScrollMode)(scroll)) { + this.pdfViewer.scrollMode = scroll; + } + + if ((0, _ui_utils.isValidSpreadMode)(spread)) { + this.pdfViewer.spreadMode = spread; + } + }; + + this.isInitialViewSet = true; + this.pdfSidebar.setInitialView(sidebarView); + setViewerModes(scrollMode, spreadMode); + + if (this.initialBookmark) { + setRotation(this.initialRotation); + delete this.initialRotation; + this.pdfLinkService.setHash(this.initialBookmark); + this.initialBookmark = null; + } else if (storedHash) { + setRotation(rotation); + this.pdfLinkService.setHash(storedHash); + } + + this.toolbar.setPageNumber(this.pdfViewer.currentPageNumber, this.pdfViewer.currentPageLabel); + this.secondaryToolbar.setPageNumber(this.pdfViewer.currentPageNumber); + + if (!this.pdfViewer.currentScaleValue) { + this.pdfViewer.currentScaleValue = _ui_utils.DEFAULT_SCALE_VALUE; + } + }, + + _cleanup() { + if (!this.pdfDocument) { + return; + } + + this.pdfViewer.cleanup(); + this.pdfThumbnailViewer.cleanup(); + this.pdfDocument.cleanup(this.pdfViewer.renderer === _ui_utils.RendererType.SVG); + }, + + forceRendering() { + this.pdfRenderingQueue.printing = !!this.printService; + this.pdfRenderingQueue.isThumbnailViewEnabled = this.pdfSidebar.isThumbnailViewVisible; + this.pdfRenderingQueue.renderHighestPriority(); + }, + + beforePrint() { + this.pdfScriptingManager.dispatchWillPrint(); + + if (this.printService) { + return; + } + + if (!this.supportsPrinting) { + this.l10n.get("printing_not_supported").then(msg => { + this._otherError(msg); + }); + return; + } + + if (!this.pdfViewer.pageViewsReady) { + this.l10n.get("printing_not_ready").then(msg => { + window.alert(msg); + }); + return; + } + + const pagesOverview = this.pdfViewer.getPagesOverview(); + const printContainer = this.appConfig.printContainer; + + const printResolution = _app_options.AppOptions.get("printResolution"); + + const optionalContentConfigPromise = this.pdfViewer.optionalContentConfigPromise; + const printService = PDFPrintServiceFactory.instance.createPrintService(this.pdfDocument, pagesOverview, printContainer, printResolution, optionalContentConfigPromise, this.l10n); + this.printService = printService; + this.forceRendering(); + printService.layout(); + this.externalServices.reportTelemetry({ + type: "print" + }); + }, + + afterPrint() { + this.pdfScriptingManager.dispatchDidPrint(); + + if (this.printService) { + this.printService.destroy(); + this.printService = null; + this.pdfDocument?.annotationStorage.resetModified(); + } + + this.forceRendering(); + }, + + rotatePages(delta) { + this.pdfViewer.pagesRotation += delta; + }, + + requestPresentationMode() { + this.pdfPresentationMode?.request(); + }, + + triggerPrinting() { + if (!this.supportsPrinting) { + return; + } + + window.print(); + }, + + bindEvents() { + const { + eventBus, + _boundEvents + } = this; + _boundEvents.beforePrint = this.beforePrint.bind(this); + _boundEvents.afterPrint = this.afterPrint.bind(this); + + eventBus._on("resize", webViewerResize); + + eventBus._on("hashchange", webViewerHashchange); + + eventBus._on("beforeprint", _boundEvents.beforePrint); + + eventBus._on("afterprint", _boundEvents.afterPrint); + + eventBus._on("pagerendered", webViewerPageRendered); + + eventBus._on("updateviewarea", webViewerUpdateViewarea); + + eventBus._on("pagechanging", webViewerPageChanging); + + eventBus._on("scalechanging", webViewerScaleChanging); + + eventBus._on("rotationchanging", webViewerRotationChanging); + + eventBus._on("sidebarviewchanged", webViewerSidebarViewChanged); + + eventBus._on("pagemode", webViewerPageMode); + + eventBus._on("namedaction", webViewerNamedAction); + + eventBus._on("presentationmodechanged", webViewerPresentationModeChanged); + + eventBus._on("presentationmode", webViewerPresentationMode); + + eventBus._on("print", webViewerPrint); + + eventBus._on("download", webViewerDownload); + + eventBus._on("save", webViewerSave); + + eventBus._on("firstpage", webViewerFirstPage); + + eventBus._on("lastpage", webViewerLastPage); + + eventBus._on("nextpage", webViewerNextPage); + + eventBus._on("previouspage", webViewerPreviousPage); + + eventBus._on("zoomin", webViewerZoomIn); + + eventBus._on("zoomout", webViewerZoomOut); + + eventBus._on("zoomreset", webViewerZoomReset); + + eventBus._on("pagenumberchanged", webViewerPageNumberChanged); + + eventBus._on("scalechanged", webViewerScaleChanged); + + eventBus._on("rotatecw", webViewerRotateCw); + + eventBus._on("rotateccw", webViewerRotateCcw); + + eventBus._on("optionalcontentconfig", webViewerOptionalContentConfig); + + eventBus._on("switchscrollmode", webViewerSwitchScrollMode); + + eventBus._on("scrollmodechanged", webViewerScrollModeChanged); + + eventBus._on("switchspreadmode", webViewerSwitchSpreadMode); + + eventBus._on("spreadmodechanged", webViewerSpreadModeChanged); + + eventBus._on("documentproperties", webViewerDocumentProperties); + + eventBus._on("findfromurlhash", webViewerFindFromUrlHash); + + eventBus._on("updatefindmatchescount", webViewerUpdateFindMatchesCount); + + eventBus._on("updatefindcontrolstate", webViewerUpdateFindControlState); + + if (_app_options.AppOptions.get("pdfBug")) { + _boundEvents.reportPageStatsPDFBug = reportPageStatsPDFBug; + + eventBus._on("pagerendered", _boundEvents.reportPageStatsPDFBug); + + eventBus._on("pagechanging", _boundEvents.reportPageStatsPDFBug); + } + + eventBus._on("fileinputchange", webViewerFileInputChange); + + eventBus._on("openfile", webViewerOpenFile); + }, + + bindWindowEvents() { + const { + eventBus, + _boundEvents + } = this; + + _boundEvents.windowResize = () => { + eventBus.dispatch("resize", { + source: window + }); + }; + + _boundEvents.windowHashChange = () => { + eventBus.dispatch("hashchange", { + source: window, + hash: document.location.hash.substring(1) + }); + }; + + _boundEvents.windowBeforePrint = () => { + eventBus.dispatch("beforeprint", { + source: window + }); + }; + + _boundEvents.windowAfterPrint = () => { + eventBus.dispatch("afterprint", { + source: window + }); + }; + + _boundEvents.windowUpdateFromSandbox = event => { + eventBus.dispatch("updatefromsandbox", { + source: window, + detail: event.detail + }); + }; + + window.addEventListener("visibilitychange", webViewerVisibilityChange); + window.addEventListener("wheel", webViewerWheel, { + passive: false + }); + window.addEventListener("touchstart", webViewerTouchStart, { + passive: false + }); + window.addEventListener("click", webViewerClick); + window.addEventListener("keydown", webViewerKeyDown); + window.addEventListener("resize", _boundEvents.windowResize); + window.addEventListener("hashchange", _boundEvents.windowHashChange); + window.addEventListener("beforeprint", _boundEvents.windowBeforePrint); + window.addEventListener("afterprint", _boundEvents.windowAfterPrint); + window.addEventListener("updatefromsandbox", _boundEvents.windowUpdateFromSandbox); + }, + + unbindEvents() { + const { + eventBus, + _boundEvents + } = this; + + eventBus._off("resize", webViewerResize); + + eventBus._off("hashchange", webViewerHashchange); + + eventBus._off("beforeprint", _boundEvents.beforePrint); + + eventBus._off("afterprint", _boundEvents.afterPrint); + + eventBus._off("pagerendered", webViewerPageRendered); + + eventBus._off("updateviewarea", webViewerUpdateViewarea); + + eventBus._off("pagechanging", webViewerPageChanging); + + eventBus._off("scalechanging", webViewerScaleChanging); + + eventBus._off("rotationchanging", webViewerRotationChanging); + + eventBus._off("sidebarviewchanged", webViewerSidebarViewChanged); + + eventBus._off("pagemode", webViewerPageMode); + + eventBus._off("namedaction", webViewerNamedAction); + + eventBus._off("presentationmodechanged", webViewerPresentationModeChanged); + + eventBus._off("presentationmode", webViewerPresentationMode); + + eventBus._off("print", webViewerPrint); + + eventBus._off("download", webViewerDownload); + + eventBus._off("save", webViewerSave); + + eventBus._off("firstpage", webViewerFirstPage); + + eventBus._off("lastpage", webViewerLastPage); + + eventBus._off("nextpage", webViewerNextPage); + + eventBus._off("previouspage", webViewerPreviousPage); + + eventBus._off("zoomin", webViewerZoomIn); + + eventBus._off("zoomout", webViewerZoomOut); + + eventBus._off("zoomreset", webViewerZoomReset); + + eventBus._off("pagenumberchanged", webViewerPageNumberChanged); + + eventBus._off("scalechanged", webViewerScaleChanged); + + eventBus._off("rotatecw", webViewerRotateCw); + + eventBus._off("rotateccw", webViewerRotateCcw); + + eventBus._off("optionalcontentconfig", webViewerOptionalContentConfig); + + eventBus._off("switchscrollmode", webViewerSwitchScrollMode); + + eventBus._off("scrollmodechanged", webViewerScrollModeChanged); + + eventBus._off("switchspreadmode", webViewerSwitchSpreadMode); + + eventBus._off("spreadmodechanged", webViewerSpreadModeChanged); + + eventBus._off("documentproperties", webViewerDocumentProperties); + + eventBus._off("findfromurlhash", webViewerFindFromUrlHash); + + eventBus._off("updatefindmatchescount", webViewerUpdateFindMatchesCount); + + eventBus._off("updatefindcontrolstate", webViewerUpdateFindControlState); + + if (_boundEvents.reportPageStatsPDFBug) { + eventBus._off("pagerendered", _boundEvents.reportPageStatsPDFBug); + + eventBus._off("pagechanging", _boundEvents.reportPageStatsPDFBug); + + _boundEvents.reportPageStatsPDFBug = null; + } + + eventBus._off("fileinputchange", webViewerFileInputChange); + + eventBus._off("openfile", webViewerOpenFile); + + _boundEvents.beforePrint = null; + _boundEvents.afterPrint = null; + }, + + unbindWindowEvents() { + const { + _boundEvents + } = this; + window.removeEventListener("visibilitychange", webViewerVisibilityChange); + window.removeEventListener("wheel", webViewerWheel, { + passive: false + }); + window.removeEventListener("touchstart", webViewerTouchStart, { + passive: false + }); + window.removeEventListener("click", webViewerClick); + window.removeEventListener("keydown", webViewerKeyDown); + window.removeEventListener("resize", _boundEvents.windowResize); + window.removeEventListener("hashchange", _boundEvents.windowHashChange); + window.removeEventListener("beforeprint", _boundEvents.windowBeforePrint); + window.removeEventListener("afterprint", _boundEvents.windowAfterPrint); + window.removeEventListener("updatefromsandbox", _boundEvents.windowUpdateFromSandbox); + _boundEvents.windowResize = null; + _boundEvents.windowHashChange = null; + _boundEvents.windowBeforePrint = null; + _boundEvents.windowAfterPrint = null; + _boundEvents.windowUpdateFromSandbox = null; + }, + + accumulateWheelTicks(ticks) { + if (this._wheelUnusedTicks > 0 && ticks < 0 || this._wheelUnusedTicks < 0 && ticks > 0) { + this._wheelUnusedTicks = 0; + } + + this._wheelUnusedTicks += ticks; + const wholeTicks = Math.sign(this._wheelUnusedTicks) * Math.floor(Math.abs(this._wheelUnusedTicks)); + this._wheelUnusedTicks -= wholeTicks; + return wholeTicks; + }, + + _unblockDocumentLoadEvent() { + document.blockUnblockOnload?.(false); + + this._unblockDocumentLoadEvent = () => {}; + }, + + _reportDocumentStatsTelemetry() { + const { + stats + } = this.pdfDocument; + + if (stats !== this._docStats) { + this._docStats = stats; + this.externalServices.reportTelemetry({ + type: "documentStats", + stats + }); + } + }, + + get scriptingReady() { + return this.pdfScriptingManager.ready; + } + +}; +exports.PDFViewerApplication = PDFViewerApplication; +let validateFileURL; +{ + const HOSTED_VIEWER_ORIGINS = ["null", "http://mozilla.github.io", "https://mozilla.github.io"]; + + validateFileURL = function (file) { + if (!file) { + return; + } + + try { + const viewerOrigin = new URL(window.location.href).origin || "null"; + + if (HOSTED_VIEWER_ORIGINS.includes(viewerOrigin)) { + return; + } + + const fileOrigin = new URL(file, window.location.href).origin; + + if (fileOrigin !== viewerOrigin) { + throw new Error("file origin does not match viewer's"); + } + } catch (ex) { + PDFViewerApplication.l10n.get("loading_error").then(msg => { + PDFViewerApplication._documentError(msg, { + message: ex?.message + }); + }); + throw ex; + } + }; +} + +async function loadFakeWorker() { + _pdfjsLib.GlobalWorkerOptions.workerSrc ||= _app_options.AppOptions.get("workerSrc"); + await (0, _pdfjsLib.loadScript)(_pdfjsLib.PDFWorker.workerSrc); +} + +async function loadPDFBug(self) { + const { + debuggerScriptPath + } = self.appConfig; + const { + PDFBug + } = await import(debuggerScriptPath); + self._PDFBug = PDFBug; +} + +function reportPageStatsPDFBug({ + pageNumber +}) { + if (!globalThis.Stats?.enabled) { + return; + } + + const pageView = PDFViewerApplication.pdfViewer.getPageView(pageNumber - 1); + globalThis.Stats.add(pageNumber, pageView?.pdfPage?.stats); +} + +function webViewerInitialized() { + const { + appConfig, + eventBus + } = PDFViewerApplication; + let file; + const queryString = document.location.search.substring(1); + const params = (0, _ui_utils.parseQueryString)(queryString); + file = params.get("file") ?? _app_options.AppOptions.get("defaultUrl"); + validateFileURL(file); + const fileInput = appConfig.openFileInput; + fileInput.value = null; + fileInput.addEventListener("change", function (evt) { + const { + files + } = evt.target; + + if (!files || files.length === 0) { + return; + } + + eventBus.dispatch("fileinputchange", { + source: this, + fileInput: evt.target + }); + }); + appConfig.mainContainer.addEventListener("dragover", function (evt) { + evt.preventDefault(); + evt.dataTransfer.dropEffect = "move"; + }); + appConfig.mainContainer.addEventListener("drop", function (evt) { + evt.preventDefault(); + const { + files + } = evt.dataTransfer; + + if (!files || files.length === 0) { + return; + } + + eventBus.dispatch("fileinputchange", { + source: this, + fileInput: evt.dataTransfer + }); + }); + + if (!PDFViewerApplication.supportsDocumentFonts) { + _app_options.AppOptions.set("disableFontFace", true); + + PDFViewerApplication.l10n.get("web_fonts_disabled").then(msg => { + console.warn(msg); + }); + } + + if (!PDFViewerApplication.supportsPrinting) { + appConfig.toolbar.print.classList.add("hidden"); + appConfig.secondaryToolbar.printButton.classList.add("hidden"); + } + + if (!PDFViewerApplication.supportsFullscreen) { + appConfig.toolbar.presentationModeButton.classList.add("hidden"); + appConfig.secondaryToolbar.presentationModeButton.classList.add("hidden"); + } + + if (PDFViewerApplication.supportsIntegratedFind) { + appConfig.toolbar.viewFind.classList.add("hidden"); + } + + appConfig.mainContainer.addEventListener("transitionend", function (evt) { + if (evt.target === this) { + eventBus.dispatch("resize", { + source: this + }); + } + }, true); + + try { + if (file) { + PDFViewerApplication.open(file); + } else { + PDFViewerApplication._hideViewBookmark(); + } + } catch (reason) { + PDFViewerApplication.l10n.get("loading_error").then(msg => { + PDFViewerApplication._documentError(msg, reason); + }); + } +} + +function webViewerPageRendered({ + pageNumber, + error +}) { + if (pageNumber === PDFViewerApplication.page) { + PDFViewerApplication.toolbar.updateLoadingIndicatorState(false); + } + + if (PDFViewerApplication.pdfSidebar.isThumbnailViewVisible) { + const pageView = PDFViewerApplication.pdfViewer.getPageView(pageNumber - 1); + const thumbnailView = PDFViewerApplication.pdfThumbnailViewer.getThumbnail(pageNumber - 1); + + if (pageView && thumbnailView) { + thumbnailView.setImage(pageView); + } + } + + if (error) { + PDFViewerApplication.l10n.get("rendering_error").then(msg => { + PDFViewerApplication._otherError(msg, error); + }); + } + + PDFViewerApplication._reportDocumentStatsTelemetry(); +} + +function webViewerPageMode({ + mode +}) { + let view; + + switch (mode) { + case "thumbs": + view = _ui_utils.SidebarView.THUMBS; + break; + + case "bookmarks": + case "outline": + view = _ui_utils.SidebarView.OUTLINE; + break; + + case "attachments": + view = _ui_utils.SidebarView.ATTACHMENTS; + break; + + case "layers": + view = _ui_utils.SidebarView.LAYERS; + break; + + case "none": + view = _ui_utils.SidebarView.NONE; + break; + + default: + console.error('Invalid "pagemode" hash parameter: ' + mode); + return; + } + + PDFViewerApplication.pdfSidebar.switchView(view, true); +} + +function webViewerNamedAction(evt) { + switch (evt.action) { + case "GoToPage": + PDFViewerApplication.appConfig.toolbar.pageNumber.select(); + break; + + case "Find": + if (!PDFViewerApplication.supportsIntegratedFind) { + PDFViewerApplication.findBar.toggle(); + } + + break; + + case "Print": + PDFViewerApplication.triggerPrinting(); + break; + + case "SaveAs": + webViewerSave(); + break; + } +} + +function webViewerPresentationModeChanged(evt) { + PDFViewerApplication.pdfViewer.presentationModeState = evt.state; +} + +function webViewerSidebarViewChanged(evt) { + PDFViewerApplication.pdfRenderingQueue.isThumbnailViewEnabled = PDFViewerApplication.pdfSidebar.isThumbnailViewVisible; + + if (PDFViewerApplication.isInitialViewSet) { + PDFViewerApplication.store?.set("sidebarView", evt.view).catch(() => {}); + } +} + +function webViewerUpdateViewarea(evt) { + const location = evt.location; + + if (PDFViewerApplication.isInitialViewSet) { + PDFViewerApplication.store?.setMultiple({ + page: location.pageNumber, + zoom: location.scale, + scrollLeft: location.left, + scrollTop: location.top, + rotation: location.rotation + }).catch(() => {}); + } + + const href = PDFViewerApplication.pdfLinkService.getAnchorUrl(location.pdfOpenParams); + PDFViewerApplication.appConfig.toolbar.viewBookmark.href = href; + PDFViewerApplication.appConfig.secondaryToolbar.viewBookmarkButton.href = href; + const currentPage = PDFViewerApplication.pdfViewer.getPageView(PDFViewerApplication.page - 1); + const loading = currentPage?.renderingState !== _ui_utils.RenderingStates.FINISHED; + PDFViewerApplication.toolbar.updateLoadingIndicatorState(loading); +} + +function webViewerScrollModeChanged(evt) { + if (PDFViewerApplication.isInitialViewSet) { + PDFViewerApplication.store?.set("scrollMode", evt.mode).catch(() => {}); + } +} + +function webViewerSpreadModeChanged(evt) { + if (PDFViewerApplication.isInitialViewSet) { + PDFViewerApplication.store?.set("spreadMode", evt.mode).catch(() => {}); + } +} + +function webViewerResize() { + const { + pdfDocument, + pdfViewer + } = PDFViewerApplication; + pdfViewer.updateContainerHeightCss(); + + if (!pdfDocument) { + return; + } + + const currentScaleValue = pdfViewer.currentScaleValue; + + if (currentScaleValue === "auto" || currentScaleValue === "page-fit" || currentScaleValue === "page-width") { + pdfViewer.currentScaleValue = currentScaleValue; + } + + pdfViewer.update(); +} + +function webViewerHashchange(evt) { + const hash = evt.hash; + + if (!hash) { + return; + } + + if (!PDFViewerApplication.isInitialViewSet) { + PDFViewerApplication.initialBookmark = hash; + } else if (!PDFViewerApplication.pdfHistory?.popStateInProgress) { + PDFViewerApplication.pdfLinkService.setHash(hash); + } +} + +{ + var webViewerFileInputChange = function (evt) { + if (PDFViewerApplication.pdfViewer?.isInPresentationMode) { + return; + } + + const file = evt.fileInput.files[0]; + let url = URL.createObjectURL(file); + + if (file.name) { + url = { + url, + originalUrl: file.name + }; + } + + PDFViewerApplication.open(url); + }; + + var webViewerOpenFile = function (evt) { + const fileInput = PDFViewerApplication.appConfig.openFileInput; + fileInput.click(); + }; +} + +function webViewerPresentationMode() { + PDFViewerApplication.requestPresentationMode(); +} + +function webViewerPrint() { + PDFViewerApplication.triggerPrinting(); +} + +function webViewerDownload() { + PDFViewerApplication.downloadOrSave({ + sourceEventType: "download" + }); +} + +function webViewerSave() { + PDFViewerApplication.downloadOrSave({ + sourceEventType: "save" + }); +} + +function webViewerFirstPage() { + if (PDFViewerApplication.pdfDocument) { + PDFViewerApplication.page = 1; + } +} + +function webViewerLastPage() { + if (PDFViewerApplication.pdfDocument) { + PDFViewerApplication.page = PDFViewerApplication.pagesCount; + } +} + +function webViewerNextPage() { + PDFViewerApplication.pdfViewer.nextPage(); +} + +function webViewerPreviousPage() { + PDFViewerApplication.pdfViewer.previousPage(); +} + +function webViewerZoomIn() { + PDFViewerApplication.zoomIn(); +} + +function webViewerZoomOut() { + PDFViewerApplication.zoomOut(); +} + +function webViewerZoomReset() { + PDFViewerApplication.zoomReset(); +} + +function webViewerPageNumberChanged(evt) { + const pdfViewer = PDFViewerApplication.pdfViewer; + + if (evt.value !== "") { + PDFViewerApplication.pdfLinkService.goToPage(evt.value); + } + + if (evt.value !== pdfViewer.currentPageNumber.toString() && evt.value !== pdfViewer.currentPageLabel) { + PDFViewerApplication.toolbar.setPageNumber(pdfViewer.currentPageNumber, pdfViewer.currentPageLabel); + } +} + +function webViewerScaleChanged(evt) { + PDFViewerApplication.pdfViewer.currentScaleValue = evt.value; +} + +function webViewerRotateCw() { + PDFViewerApplication.rotatePages(90); +} + +function webViewerRotateCcw() { + PDFViewerApplication.rotatePages(-90); +} + +function webViewerOptionalContentConfig(evt) { + PDFViewerApplication.pdfViewer.optionalContentConfigPromise = evt.promise; +} + +function webViewerSwitchScrollMode(evt) { + PDFViewerApplication.pdfViewer.scrollMode = evt.mode; +} + +function webViewerSwitchSpreadMode(evt) { + PDFViewerApplication.pdfViewer.spreadMode = evt.mode; +} + +function webViewerDocumentProperties() { + PDFViewerApplication.pdfDocumentProperties.open(); +} + +function webViewerFindFromUrlHash(evt) { + PDFViewerApplication.eventBus.dispatch("find", { + source: evt.source, + type: "", + query: evt.query, + phraseSearch: evt.phraseSearch, + caseSensitive: false, + entireWord: false, + highlightAll: true, + findPrevious: false, + matchDiacritics: true + }); +} + +function webViewerUpdateFindMatchesCount({ + matchesCount +}) { + if (PDFViewerApplication.supportsIntegratedFind) { + PDFViewerApplication.externalServices.updateFindMatchesCount(matchesCount); + } else { + PDFViewerApplication.findBar.updateResultsCount(matchesCount); + } +} + +function webViewerUpdateFindControlState({ + state, + previous, + matchesCount, + rawQuery +}) { + if (PDFViewerApplication.supportsIntegratedFind) { + PDFViewerApplication.externalServices.updateFindControlState({ + result: state, + findPrevious: previous, + matchesCount, + rawQuery + }); + } else { + PDFViewerApplication.findBar.updateUIState(state, previous, matchesCount); + } +} + +function webViewerScaleChanging(evt) { + PDFViewerApplication.toolbar.setPageScale(evt.presetValue, evt.scale); + PDFViewerApplication.pdfViewer.update(); +} + +function webViewerRotationChanging(evt) { + PDFViewerApplication.pdfThumbnailViewer.pagesRotation = evt.pagesRotation; + PDFViewerApplication.forceRendering(); + PDFViewerApplication.pdfViewer.currentPageNumber = evt.pageNumber; +} + +function webViewerPageChanging({ + pageNumber, + pageLabel +}) { + PDFViewerApplication.toolbar.setPageNumber(pageNumber, pageLabel); + PDFViewerApplication.secondaryToolbar.setPageNumber(pageNumber); + + if (PDFViewerApplication.pdfSidebar.isThumbnailViewVisible) { + PDFViewerApplication.pdfThumbnailViewer.scrollThumbnailIntoView(pageNumber); + } +} + +function webViewerVisibilityChange(evt) { + if (document.visibilityState === "visible") { + setZoomDisabledTimeout(); + } +} + +let zoomDisabledTimeout = null; + +function setZoomDisabledTimeout() { + if (zoomDisabledTimeout) { + clearTimeout(zoomDisabledTimeout); + } + + zoomDisabledTimeout = setTimeout(function () { + zoomDisabledTimeout = null; + }, WHEEL_ZOOM_DISABLED_TIMEOUT); +} + +function webViewerWheel(evt) { + const { + pdfViewer, + supportedMouseWheelZoomModifierKeys + } = PDFViewerApplication; + + if (pdfViewer.isInPresentationMode) { + return; + } + + if (evt.ctrlKey && supportedMouseWheelZoomModifierKeys.ctrlKey || evt.metaKey && supportedMouseWheelZoomModifierKeys.metaKey) { + evt.preventDefault(); + + if (zoomDisabledTimeout || document.visibilityState === "hidden") { + return; + } + + const deltaMode = evt.deltaMode; + const delta = (0, _ui_utils.normalizeWheelEventDirection)(evt); + const previousScale = pdfViewer.currentScale; + let ticks = 0; + + if (deltaMode === WheelEvent.DOM_DELTA_LINE || deltaMode === WheelEvent.DOM_DELTA_PAGE) { + if (Math.abs(delta) >= 1) { + ticks = Math.sign(delta); + } else { + ticks = PDFViewerApplication.accumulateWheelTicks(delta); + } + } else { + const PIXELS_PER_LINE_SCALE = 30; + ticks = PDFViewerApplication.accumulateWheelTicks(delta / PIXELS_PER_LINE_SCALE); + } + + if (ticks < 0) { + PDFViewerApplication.zoomOut(-ticks); + } else if (ticks > 0) { + PDFViewerApplication.zoomIn(ticks); + } + + const currentScale = pdfViewer.currentScale; + + if (previousScale !== currentScale) { + const scaleCorrectionFactor = currentScale / previousScale - 1; + const rect = pdfViewer.container.getBoundingClientRect(); + const dx = evt.clientX - rect.left; + const dy = evt.clientY - rect.top; + pdfViewer.container.scrollLeft += dx * scaleCorrectionFactor; + pdfViewer.container.scrollTop += dy * scaleCorrectionFactor; + } + } else { + setZoomDisabledTimeout(); + } +} + +function webViewerTouchStart(evt) { + if (evt.touches.length > 1) { + evt.preventDefault(); + } +} + +function webViewerClick(evt) { + if (!PDFViewerApplication.secondaryToolbar.isOpen) { + return; + } + + const appConfig = PDFViewerApplication.appConfig; + + if (PDFViewerApplication.pdfViewer.containsElement(evt.target) || appConfig.toolbar.container.contains(evt.target) && evt.target !== appConfig.secondaryToolbar.toggleButton) { + PDFViewerApplication.secondaryToolbar.close(); + } +} + +function webViewerKeyDown(evt) { + if (PDFViewerApplication.overlayManager.active) { + return; + } + + const { + eventBus, + pdfViewer + } = PDFViewerApplication; + const isViewerInPresentationMode = pdfViewer.isInPresentationMode; + let handled = false, + ensureViewerFocused = false; + const cmd = (evt.ctrlKey ? 1 : 0) | (evt.altKey ? 2 : 0) | (evt.shiftKey ? 4 : 0) | (evt.metaKey ? 8 : 0); + + if (cmd === 1 || cmd === 8 || cmd === 5 || cmd === 12) { + switch (evt.keyCode) { + case 70: + if (!PDFViewerApplication.supportsIntegratedFind && !evt.shiftKey) { + PDFViewerApplication.findBar.open(); + handled = true; + } + + break; + + case 71: + if (!PDFViewerApplication.supportsIntegratedFind) { + const { + state + } = PDFViewerApplication.findController; + + if (state) { + const eventState = Object.assign(Object.create(null), state, { + source: window, + type: "again", + findPrevious: cmd === 5 || cmd === 12 + }); + eventBus.dispatch("find", eventState); + } + + handled = true; + } + + break; + + case 61: + case 107: + case 187: + case 171: + if (!isViewerInPresentationMode) { + PDFViewerApplication.zoomIn(); + } + + handled = true; + break; + + case 173: + case 109: + case 189: + if (!isViewerInPresentationMode) { + PDFViewerApplication.zoomOut(); + } + + handled = true; + break; + + case 48: + case 96: + if (!isViewerInPresentationMode) { + setTimeout(function () { + PDFViewerApplication.zoomReset(); + }); + handled = false; + } + + break; + + case 38: + if (isViewerInPresentationMode || PDFViewerApplication.page > 1) { + PDFViewerApplication.page = 1; + handled = true; + ensureViewerFocused = true; + } + + break; + + case 40: + if (isViewerInPresentationMode || PDFViewerApplication.page < PDFViewerApplication.pagesCount) { + PDFViewerApplication.page = PDFViewerApplication.pagesCount; + handled = true; + ensureViewerFocused = true; + } + + break; + } + } + + if (cmd === 1 || cmd === 8) { + switch (evt.keyCode) { + case 83: + eventBus.dispatch("download", { + source: window + }); + handled = true; + break; + + case 79: + { + eventBus.dispatch("openfile", { + source: window + }); + handled = true; + } + break; + } + } + + if (cmd === 3 || cmd === 10) { + switch (evt.keyCode) { + case 80: + PDFViewerApplication.requestPresentationMode(); + handled = true; + break; + + case 71: + PDFViewerApplication.appConfig.toolbar.pageNumber.select(); + handled = true; + break; + } + } + + if (handled) { + if (ensureViewerFocused && !isViewerInPresentationMode) { + pdfViewer.focus(); + } + + evt.preventDefault(); + return; + } + + const curElement = (0, _ui_utils.getActiveOrFocusedElement)(); + const curElementTagName = curElement?.tagName.toUpperCase(); + + if (curElementTagName === "INPUT" || curElementTagName === "TEXTAREA" || curElementTagName === "SELECT" || curElement?.isContentEditable) { + if (evt.keyCode !== 27) { + return; + } + } + + if (cmd === 0) { + let turnPage = 0, + turnOnlyIfPageFit = false; + + switch (evt.keyCode) { + case 38: + case 33: + if (pdfViewer.isVerticalScrollbarEnabled) { + turnOnlyIfPageFit = true; + } + + turnPage = -1; + break; + + case 8: + if (!isViewerInPresentationMode) { + turnOnlyIfPageFit = true; + } + + turnPage = -1; + break; + + case 37: + if (pdfViewer.isHorizontalScrollbarEnabled) { + turnOnlyIfPageFit = true; + } + + case 75: + case 80: + turnPage = -1; + break; + + case 27: + if (PDFViewerApplication.secondaryToolbar.isOpen) { + PDFViewerApplication.secondaryToolbar.close(); + handled = true; + } + + if (!PDFViewerApplication.supportsIntegratedFind && PDFViewerApplication.findBar.opened) { + PDFViewerApplication.findBar.close(); + handled = true; + } + + break; + + case 40: + case 34: + if (pdfViewer.isVerticalScrollbarEnabled) { + turnOnlyIfPageFit = true; + } + + turnPage = 1; + break; + + case 13: + case 32: + if (!isViewerInPresentationMode) { + turnOnlyIfPageFit = true; + } + + turnPage = 1; + break; + + case 39: + if (pdfViewer.isHorizontalScrollbarEnabled) { + turnOnlyIfPageFit = true; + } + + case 74: + case 78: + turnPage = 1; + break; + + case 36: + if (isViewerInPresentationMode || PDFViewerApplication.page > 1) { + PDFViewerApplication.page = 1; + handled = true; + ensureViewerFocused = true; + } + + break; + + case 35: + if (isViewerInPresentationMode || PDFViewerApplication.page < PDFViewerApplication.pagesCount) { + PDFViewerApplication.page = PDFViewerApplication.pagesCount; + handled = true; + ensureViewerFocused = true; + } + + break; + + case 83: + PDFViewerApplication.pdfCursorTools.switchTool(_pdf_cursor_tools.CursorTool.SELECT); + break; + + case 72: + PDFViewerApplication.pdfCursorTools.switchTool(_pdf_cursor_tools.CursorTool.HAND); + break; + + case 82: + PDFViewerApplication.rotatePages(90); + break; + + case 115: + PDFViewerApplication.pdfSidebar.toggle(); + break; + } + + if (turnPage !== 0 && (!turnOnlyIfPageFit || pdfViewer.currentScaleValue === "page-fit")) { + if (turnPage > 0) { + pdfViewer.nextPage(); + } else { + pdfViewer.previousPage(); + } + + handled = true; + } + } + + if (cmd === 4) { + switch (evt.keyCode) { + case 13: + case 32: + if (!isViewerInPresentationMode && pdfViewer.currentScaleValue !== "page-fit") { + break; + } + + pdfViewer.previousPage(); + handled = true; + break; + + case 82: + PDFViewerApplication.rotatePages(-90); + break; + } + } + + if (!handled && !isViewerInPresentationMode) { + if (evt.keyCode >= 33 && evt.keyCode <= 40 || evt.keyCode === 32 && curElementTagName !== "BUTTON") { + ensureViewerFocused = true; + } + } + + if (ensureViewerFocused && !pdfViewer.containsElement(curElement)) { + pdfViewer.focus(); + } + + if (handled) { + evt.preventDefault(); + } +} + +function beforeUnload(evt) { + evt.preventDefault(); + evt.returnValue = ""; + return false; +} + +const PDFPrintServiceFactory = { + instance: { + supportsPrinting: false, + + createPrintService() { + throw new Error("Not implemented: createPrintService"); + } + + } +}; +exports.PDFPrintServiceFactory = PDFPrintServiceFactory; + +/***/ }), +/* 3 */ +/***/ ((__unused_webpack_module, exports) => { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.animationStarted = exports.VERTICAL_PADDING = exports.UNKNOWN_SCALE = exports.TextLayerMode = exports.SpreadMode = exports.SidebarView = exports.ScrollMode = exports.SCROLLBAR_PADDING = exports.RenderingStates = exports.RendererType = exports.ProgressBar = exports.PresentationModeState = exports.OutputScale = exports.MIN_SCALE = exports.MAX_SCALE = exports.MAX_AUTO_SCALE = exports.DEFAULT_SCALE_VALUE = exports.DEFAULT_SCALE_DELTA = exports.DEFAULT_SCALE = exports.AutoPrintRegExp = void 0; +exports.apiPageLayoutToViewerModes = apiPageLayoutToViewerModes; +exports.apiPageModeToSidebarView = apiPageModeToSidebarView; +exports.approximateFraction = approximateFraction; +exports.backtrackBeforeAllVisibleElements = backtrackBeforeAllVisibleElements; +exports.binarySearchFirstItem = binarySearchFirstItem; +exports.getActiveOrFocusedElement = getActiveOrFocusedElement; +exports.getPageSizeInches = getPageSizeInches; +exports.getVisibleElements = getVisibleElements; +exports.isPortraitOrientation = isPortraitOrientation; +exports.isValidRotation = isValidRotation; +exports.isValidScrollMode = isValidScrollMode; +exports.isValidSpreadMode = isValidSpreadMode; +exports.noContextMenuHandler = noContextMenuHandler; +exports.normalizeWheelEventDelta = normalizeWheelEventDelta; +exports.normalizeWheelEventDirection = normalizeWheelEventDirection; +exports.parseQueryString = parseQueryString; +exports.removeNullCharacters = removeNullCharacters; +exports.roundToDivide = roundToDivide; +exports.scrollIntoView = scrollIntoView; +exports.watchScroll = watchScroll; +const DEFAULT_SCALE_VALUE = "auto"; +exports.DEFAULT_SCALE_VALUE = DEFAULT_SCALE_VALUE; +const DEFAULT_SCALE = 1.0; +exports.DEFAULT_SCALE = DEFAULT_SCALE; +const DEFAULT_SCALE_DELTA = 1.1; +exports.DEFAULT_SCALE_DELTA = DEFAULT_SCALE_DELTA; +const MIN_SCALE = 0.1; +exports.MIN_SCALE = MIN_SCALE; +const MAX_SCALE = 10.0; +exports.MAX_SCALE = MAX_SCALE; +const UNKNOWN_SCALE = 0; +exports.UNKNOWN_SCALE = UNKNOWN_SCALE; +const MAX_AUTO_SCALE = 1.25; +exports.MAX_AUTO_SCALE = MAX_AUTO_SCALE; +const SCROLLBAR_PADDING = 40; +exports.SCROLLBAR_PADDING = SCROLLBAR_PADDING; +const VERTICAL_PADDING = 5; +exports.VERTICAL_PADDING = VERTICAL_PADDING; +const RenderingStates = { + INITIAL: 0, + RUNNING: 1, + PAUSED: 2, + FINISHED: 3 +}; +exports.RenderingStates = RenderingStates; +const PresentationModeState = { + UNKNOWN: 0, + NORMAL: 1, + CHANGING: 2, + FULLSCREEN: 3 +}; +exports.PresentationModeState = PresentationModeState; +const SidebarView = { + UNKNOWN: -1, + NONE: 0, + THUMBS: 1, + OUTLINE: 2, + ATTACHMENTS: 3, + LAYERS: 4 +}; +exports.SidebarView = SidebarView; +const RendererType = { + CANVAS: "canvas", + SVG: "svg" +}; +exports.RendererType = RendererType; +const TextLayerMode = { + DISABLE: 0, + ENABLE: 1, + ENABLE_ENHANCE: 2 +}; +exports.TextLayerMode = TextLayerMode; +const ScrollMode = { + UNKNOWN: -1, + VERTICAL: 0, + HORIZONTAL: 1, + WRAPPED: 2, + PAGE: 3 +}; +exports.ScrollMode = ScrollMode; +const SpreadMode = { + UNKNOWN: -1, + NONE: 0, + ODD: 1, + EVEN: 2 +}; +exports.SpreadMode = SpreadMode; +const AutoPrintRegExp = /\bprint\s*\(/; +exports.AutoPrintRegExp = AutoPrintRegExp; + +class OutputScale { + constructor() { + const pixelRatio = window.devicePixelRatio || 1; + this.sx = pixelRatio; + this.sy = pixelRatio; + } + + get scaled() { + return this.sx !== 1 || this.sy !== 1; + } + +} + +exports.OutputScale = OutputScale; + +function scrollIntoView(element, spot, scrollMatches = false) { + let parent = element.offsetParent; + + if (!parent) { + console.error("offsetParent is not set -- cannot scroll"); + return; + } + + let offsetY = element.offsetTop + element.clientTop; + let offsetX = element.offsetLeft + element.clientLeft; + + while (parent.clientHeight === parent.scrollHeight && parent.clientWidth === parent.scrollWidth || scrollMatches && (parent.classList.contains("markedContent") || getComputedStyle(parent).overflow === "hidden")) { + offsetY += parent.offsetTop; + offsetX += parent.offsetLeft; + parent = parent.offsetParent; + + if (!parent) { + return; + } + } + + if (spot) { + if (spot.top !== undefined) { + offsetY += spot.top; + } + + if (spot.left !== undefined) { + offsetX += spot.left; + parent.scrollLeft = offsetX; + } + } + + parent.scrollTop = offsetY; +} + +function watchScroll(viewAreaElement, callback) { + const debounceScroll = function (evt) { + if (rAF) { + return; + } + + rAF = window.requestAnimationFrame(function viewAreaElementScrolled() { + rAF = null; + const currentX = viewAreaElement.scrollLeft; + const lastX = state.lastX; + + if (currentX !== lastX) { + state.right = currentX > lastX; + } + + state.lastX = currentX; + const currentY = viewAreaElement.scrollTop; + const lastY = state.lastY; + + if (currentY !== lastY) { + state.down = currentY > lastY; + } + + state.lastY = currentY; + callback(state); + }); + }; + + const state = { + right: true, + down: true, + lastX: viewAreaElement.scrollLeft, + lastY: viewAreaElement.scrollTop, + _eventHandler: debounceScroll + }; + let rAF = null; + viewAreaElement.addEventListener("scroll", debounceScroll, true); + return state; +} + +function parseQueryString(query) { + const params = new Map(); + + for (const [key, value] of new URLSearchParams(query)) { + params.set(key.toLowerCase(), value); + } + + return params; +} + +const NullCharactersRegExp = /\x00/g; +const InvisibleCharactersRegExp = /[\x01-\x1F]/g; + +function removeNullCharacters(str, replaceInvisible = false) { + if (typeof str !== "string") { + console.error(`The argument must be a string.`); + return str; + } + + if (replaceInvisible) { + str = str.replace(InvisibleCharactersRegExp, " "); + } + + return str.replace(NullCharactersRegExp, ""); +} + +function binarySearchFirstItem(items, condition, start = 0) { + let minIndex = start; + let maxIndex = items.length - 1; + + if (maxIndex < 0 || !condition(items[maxIndex])) { + return items.length; + } + + if (condition(items[minIndex])) { + return minIndex; + } + + while (minIndex < maxIndex) { + const currentIndex = minIndex + maxIndex >> 1; + const currentItem = items[currentIndex]; + + if (condition(currentItem)) { + maxIndex = currentIndex; + } else { + minIndex = currentIndex + 1; + } + } + + return minIndex; +} + +function approximateFraction(x) { + if (Math.floor(x) === x) { + return [x, 1]; + } + + const xinv = 1 / x; + const limit = 8; + + if (xinv > limit) { + return [1, limit]; + } else if (Math.floor(xinv) === xinv) { + return [1, xinv]; + } + + const x_ = x > 1 ? xinv : x; + let a = 0, + b = 1, + c = 1, + d = 1; + + while (true) { + const p = a + c, + q = b + d; + + if (q > limit) { + break; + } + + if (x_ <= p / q) { + c = p; + d = q; + } else { + a = p; + b = q; + } + } + + let result; + + if (x_ - a / b < c / d - x_) { + result = x_ === x ? [a, b] : [b, a]; + } else { + result = x_ === x ? [c, d] : [d, c]; + } + + return result; +} + +function roundToDivide(x, div) { + const r = x % div; + return r === 0 ? x : Math.round(x - r + div); +} + +function getPageSizeInches({ + view, + userUnit, + rotate +}) { + const [x1, y1, x2, y2] = view; + const changeOrientation = rotate % 180 !== 0; + const width = (x2 - x1) / 72 * userUnit; + const height = (y2 - y1) / 72 * userUnit; + return { + width: changeOrientation ? height : width, + height: changeOrientation ? width : height + }; +} + +function backtrackBeforeAllVisibleElements(index, views, top) { + if (index < 2) { + return index; + } + + let elt = views[index].div; + let pageTop = elt.offsetTop + elt.clientTop; + + if (pageTop >= top) { + elt = views[index - 1].div; + pageTop = elt.offsetTop + elt.clientTop; + } + + for (let i = index - 2; i >= 0; --i) { + elt = views[i].div; + + if (elt.offsetTop + elt.clientTop + elt.clientHeight <= pageTop) { + break; + } + + index = i; + } + + return index; +} + +function getVisibleElements({ + scrollEl, + views, + sortByVisibility = false, + horizontal = false, + rtl = false +}) { + const top = scrollEl.scrollTop, + bottom = top + scrollEl.clientHeight; + const left = scrollEl.scrollLeft, + right = left + scrollEl.clientWidth; + + function isElementBottomAfterViewTop(view) { + const element = view.div; + const elementBottom = element.offsetTop + element.clientTop + element.clientHeight; + return elementBottom > top; + } + + function isElementNextAfterViewHorizontally(view) { + const element = view.div; + const elementLeft = element.offsetLeft + element.clientLeft; + const elementRight = elementLeft + element.clientWidth; + return rtl ? elementLeft < right : elementRight > left; + } + + const visible = [], + ids = new Set(), + numViews = views.length; + let firstVisibleElementInd = binarySearchFirstItem(views, horizontal ? isElementNextAfterViewHorizontally : isElementBottomAfterViewTop); + + if (firstVisibleElementInd > 0 && firstVisibleElementInd < numViews && !horizontal) { + firstVisibleElementInd = backtrackBeforeAllVisibleElements(firstVisibleElementInd, views, top); + } + + let lastEdge = horizontal ? right : -1; + + for (let i = firstVisibleElementInd; i < numViews; i++) { + const view = views[i], + element = view.div; + const currentWidth = element.offsetLeft + element.clientLeft; + const currentHeight = element.offsetTop + element.clientTop; + const viewWidth = element.clientWidth, + viewHeight = element.clientHeight; + const viewRight = currentWidth + viewWidth; + const viewBottom = currentHeight + viewHeight; + + if (lastEdge === -1) { + if (viewBottom >= bottom) { + lastEdge = viewBottom; + } + } else if ((horizontal ? currentWidth : currentHeight) > lastEdge) { + break; + } + + if (viewBottom <= top || currentHeight >= bottom || viewRight <= left || currentWidth >= right) { + continue; + } + + const hiddenHeight = Math.max(0, top - currentHeight) + Math.max(0, viewBottom - bottom); + const hiddenWidth = Math.max(0, left - currentWidth) + Math.max(0, viewRight - right); + const fractionHeight = (viewHeight - hiddenHeight) / viewHeight, + fractionWidth = (viewWidth - hiddenWidth) / viewWidth; + const percent = fractionHeight * fractionWidth * 100 | 0; + visible.push({ + id: view.id, + x: currentWidth, + y: currentHeight, + view, + percent, + widthPercent: fractionWidth * 100 | 0 + }); + ids.add(view.id); + } + + const first = visible[0], + last = visible[visible.length - 1]; + + if (sortByVisibility) { + visible.sort(function (a, b) { + const pc = a.percent - b.percent; + + if (Math.abs(pc) > 0.001) { + return -pc; + } + + return a.id - b.id; + }); + } + + return { + first, + last, + views: visible, + ids + }; +} + +function noContextMenuHandler(evt) { + evt.preventDefault(); +} + +function normalizeWheelEventDirection(evt) { + let delta = Math.hypot(evt.deltaX, evt.deltaY); + const angle = Math.atan2(evt.deltaY, evt.deltaX); + + if (-0.25 * Math.PI < angle && angle < 0.75 * Math.PI) { + delta = -delta; + } + + return delta; +} + +function normalizeWheelEventDelta(evt) { + let delta = normalizeWheelEventDirection(evt); + const MOUSE_DOM_DELTA_PIXEL_MODE = 0; + const MOUSE_DOM_DELTA_LINE_MODE = 1; + const MOUSE_PIXELS_PER_LINE = 30; + const MOUSE_LINES_PER_PAGE = 30; + + if (evt.deltaMode === MOUSE_DOM_DELTA_PIXEL_MODE) { + delta /= MOUSE_PIXELS_PER_LINE * MOUSE_LINES_PER_PAGE; + } else if (evt.deltaMode === MOUSE_DOM_DELTA_LINE_MODE) { + delta /= MOUSE_LINES_PER_PAGE; + } + + return delta; +} + +function isValidRotation(angle) { + return Number.isInteger(angle) && angle % 90 === 0; +} + +function isValidScrollMode(mode) { + return Number.isInteger(mode) && Object.values(ScrollMode).includes(mode) && mode !== ScrollMode.UNKNOWN; +} + +function isValidSpreadMode(mode) { + return Number.isInteger(mode) && Object.values(SpreadMode).includes(mode) && mode !== SpreadMode.UNKNOWN; +} + +function isPortraitOrientation(size) { + return size.width <= size.height; +} + +const animationStarted = new Promise(function (resolve) { + window.requestAnimationFrame(resolve); +}); +exports.animationStarted = animationStarted; + +function clamp(v, min, max) { + return Math.min(Math.max(v, min), max); +} + +class ProgressBar { + constructor(id) { + if (arguments.length > 1) { + throw new Error("ProgressBar no longer accepts any additional options, " + "please use CSS rules to modify its appearance instead."); + } + + this.visible = true; + this.div = document.querySelector(id + " .progress"); + this.bar = this.div.parentNode; + this.percent = 0; + } + + #updateBar() { + if (this._indeterminate) { + this.div.classList.add("indeterminate"); + return; + } + + this.div.classList.remove("indeterminate"); + const doc = document.documentElement; + doc.style.setProperty("--progressBar-percent", `${this._percent}%`); + } + + get percent() { + return this._percent; + } + + set percent(val) { + this._indeterminate = isNaN(val); + this._percent = clamp(val, 0, 100); + this.#updateBar(); + } + + setWidth(viewer) { + if (!viewer) { + return; + } + + const container = viewer.parentNode; + const scrollbarWidth = container.offsetWidth - viewer.offsetWidth; + + if (scrollbarWidth > 0) { + const doc = document.documentElement; + doc.style.setProperty("--progressBar-end-offset", `${scrollbarWidth}px`); + } + } + + hide() { + if (!this.visible) { + return; + } + + this.visible = false; + this.bar.classList.add("hidden"); + } + + show() { + if (this.visible) { + return; + } + + this.visible = true; + this.bar.classList.remove("hidden"); + } + +} + +exports.ProgressBar = ProgressBar; + +function getActiveOrFocusedElement() { + let curRoot = document; + let curActiveOrFocused = curRoot.activeElement || curRoot.querySelector(":focus"); + + while (curActiveOrFocused?.shadowRoot) { + curRoot = curActiveOrFocused.shadowRoot; + curActiveOrFocused = curRoot.activeElement || curRoot.querySelector(":focus"); + } + + return curActiveOrFocused; +} + +function apiPageLayoutToViewerModes(layout) { + let scrollMode = ScrollMode.VERTICAL, + spreadMode = SpreadMode.NONE; + + switch (layout) { + case "SinglePage": + scrollMode = ScrollMode.PAGE; + break; + + case "OneColumn": + break; + + case "TwoPageLeft": + scrollMode = ScrollMode.PAGE; + + case "TwoColumnLeft": + spreadMode = SpreadMode.ODD; + break; + + case "TwoPageRight": + scrollMode = ScrollMode.PAGE; + + case "TwoColumnRight": + spreadMode = SpreadMode.EVEN; + break; + } + + return { + scrollMode, + spreadMode + }; +} + +function apiPageModeToSidebarView(mode) { + switch (mode) { + case "UseNone": + return SidebarView.NONE; + + case "UseThumbs": + return SidebarView.THUMBS; + + case "UseOutlines": + return SidebarView.OUTLINE; + + case "UseAttachments": + return SidebarView.ATTACHMENTS; + + case "UseOC": + return SidebarView.LAYERS; + } + + return SidebarView.NONE; +} + +/***/ }), +/* 4 */ +/***/ ((__unused_webpack_module, exports) => { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.WaitOnType = exports.EventBus = exports.AutomationEventBus = void 0; +exports.waitOnEventOrTimeout = waitOnEventOrTimeout; +const WaitOnType = { + EVENT: "event", + TIMEOUT: "timeout" +}; +exports.WaitOnType = WaitOnType; + +function waitOnEventOrTimeout({ + target, + name, + delay = 0 +}) { + return new Promise(function (resolve, reject) { + if (typeof target !== "object" || !(name && typeof name === "string") || !(Number.isInteger(delay) && delay >= 0)) { + throw new Error("waitOnEventOrTimeout - invalid parameters."); + } + + function handler(type) { + if (target instanceof EventBus) { + target._off(name, eventHandler); + } else { + target.removeEventListener(name, eventHandler); + } + + if (timeout) { + clearTimeout(timeout); + } + + resolve(type); + } + + const eventHandler = handler.bind(null, WaitOnType.EVENT); + + if (target instanceof EventBus) { + target._on(name, eventHandler); + } else { + target.addEventListener(name, eventHandler); + } + + const timeoutHandler = handler.bind(null, WaitOnType.TIMEOUT); + const timeout = setTimeout(timeoutHandler, delay); + }); +} + +class EventBus { + constructor() { + this._listeners = Object.create(null); + } + + on(eventName, listener, options = null) { + this._on(eventName, listener, { + external: true, + once: options?.once + }); + } + + off(eventName, listener, options = null) { + this._off(eventName, listener, { + external: true, + once: options?.once + }); + } + + dispatch(eventName, data) { + const eventListeners = this._listeners[eventName]; + + if (!eventListeners || eventListeners.length === 0) { + return; + } + + let externalListeners; + + for (const { + listener, + external, + once + } of eventListeners.slice(0)) { + if (once) { + this._off(eventName, listener); + } + + if (external) { + (externalListeners ||= []).push(listener); + continue; + } + + listener(data); + } + + if (externalListeners) { + for (const listener of externalListeners) { + listener(data); + } + + externalListeners = null; + } + } + + _on(eventName, listener, options = null) { + const eventListeners = this._listeners[eventName] ||= []; + eventListeners.push({ + listener, + external: options?.external === true, + once: options?.once === true + }); + } + + _off(eventName, listener, options = null) { + const eventListeners = this._listeners[eventName]; + + if (!eventListeners) { + return; + } + + for (let i = 0, ii = eventListeners.length; i < ii; i++) { + if (eventListeners[i].listener === listener) { + eventListeners.splice(i, 1); + return; + } + } + } + +} + +exports.EventBus = EventBus; + +class AutomationEventBus extends EventBus { + dispatch(eventName, data) { + throw new Error("Not implemented: AutomationEventBus.dispatch"); + } + +} + +exports.AutomationEventBus = AutomationEventBus; + +/***/ }), +/* 5 */ +/***/ ((module) => { + + + +let pdfjsLib; + +if (typeof window !== "undefined" && window["pdfjs-dist/build/pdf"]) { + pdfjsLib = window["pdfjs-dist/build/pdf"]; +} else { + pdfjsLib = require("../build/pdf.js"); +} + +module.exports = pdfjsLib; + +/***/ }), +/* 6 */ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.PDFCursorTools = exports.CursorTool = void 0; + +var _grab_to_pan = __webpack_require__(7); + +var _ui_utils = __webpack_require__(3); + +const CursorTool = { + SELECT: 0, + HAND: 1, + ZOOM: 2 +}; +exports.CursorTool = CursorTool; + +class PDFCursorTools { + constructor({ + container, + eventBus, + cursorToolOnLoad = CursorTool.SELECT + }) { + this.container = container; + this.eventBus = eventBus; + this.active = CursorTool.SELECT; + this.activeBeforePresentationMode = null; + this.handTool = new _grab_to_pan.GrabToPan({ + element: this.container + }); + this.#addEventListeners(); + Promise.resolve().then(() => { + this.switchTool(cursorToolOnLoad); + }); + } + + get activeTool() { + return this.active; + } + + switchTool(tool) { + if (this.activeBeforePresentationMode !== null) { + return; + } + + if (tool === this.active) { + return; + } + + const disableActiveTool = () => { + switch (this.active) { + case CursorTool.SELECT: + break; + + case CursorTool.HAND: + this.handTool.deactivate(); + break; + + case CursorTool.ZOOM: + } + }; + + switch (tool) { + case CursorTool.SELECT: + disableActiveTool(); + break; + + case CursorTool.HAND: + disableActiveTool(); + this.handTool.activate(); + break; + + case CursorTool.ZOOM: + default: + console.error(`switchTool: "${tool}" is an unsupported value.`); + return; + } + + this.active = tool; + this.#dispatchEvent(); + } + + #dispatchEvent() { + this.eventBus.dispatch("cursortoolchanged", { + source: this, + tool: this.active + }); + } + + #addEventListeners() { + this.eventBus._on("switchcursortool", evt => { + this.switchTool(evt.tool); + }); + + this.eventBus._on("presentationmodechanged", evt => { + switch (evt.state) { + case _ui_utils.PresentationModeState.FULLSCREEN: + { + const previouslyActive = this.active; + this.switchTool(CursorTool.SELECT); + this.activeBeforePresentationMode = previouslyActive; + break; + } + + case _ui_utils.PresentationModeState.NORMAL: + { + const previouslyActive = this.activeBeforePresentationMode; + this.activeBeforePresentationMode = null; + this.switchTool(previouslyActive); + break; + } + } + }); + } + +} + +exports.PDFCursorTools = PDFCursorTools; + +/***/ }), +/* 7 */ +/***/ ((__unused_webpack_module, exports) => { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.GrabToPan = void 0; +const CSS_CLASS_GRAB = "grab-to-pan-grab"; + +class GrabToPan { + constructor(options) { + this.element = options.element; + this.document = options.element.ownerDocument; + + if (typeof options.ignoreTarget === "function") { + this.ignoreTarget = options.ignoreTarget; + } + + this.onActiveChanged = options.onActiveChanged; + this.activate = this.activate.bind(this); + this.deactivate = this.deactivate.bind(this); + this.toggle = this.toggle.bind(this); + this._onMouseDown = this.#onMouseDown.bind(this); + this._onMouseMove = this.#onMouseMove.bind(this); + this._endPan = this.#endPan.bind(this); + const overlay = this.overlay = document.createElement("div"); + overlay.className = "grab-to-pan-grabbing"; + } + + activate() { + if (!this.active) { + this.active = true; + this.element.addEventListener("mousedown", this._onMouseDown, true); + this.element.classList.add(CSS_CLASS_GRAB); + this.onActiveChanged?.(true); + } + } + + deactivate() { + if (this.active) { + this.active = false; + this.element.removeEventListener("mousedown", this._onMouseDown, true); + + this._endPan(); + + this.element.classList.remove(CSS_CLASS_GRAB); + this.onActiveChanged?.(false); + } + } + + toggle() { + if (this.active) { + this.deactivate(); + } else { + this.activate(); + } + } + + ignoreTarget(node) { + return node.matches("a[href], a[href] *, input, textarea, button, button *, select, option"); + } + + #onMouseDown(event) { + if (event.button !== 0 || this.ignoreTarget(event.target)) { + return; + } + + if (event.originalTarget) { + try { + event.originalTarget.tagName; + } catch (e) { + return; + } + } + + this.scrollLeftStart = this.element.scrollLeft; + this.scrollTopStart = this.element.scrollTop; + this.clientXStart = event.clientX; + this.clientYStart = event.clientY; + this.document.addEventListener("mousemove", this._onMouseMove, true); + this.document.addEventListener("mouseup", this._endPan, true); + this.element.addEventListener("scroll", this._endPan, true); + event.preventDefault(); + event.stopPropagation(); + const focusedElement = document.activeElement; + + if (focusedElement && !focusedElement.contains(event.target)) { + focusedElement.blur(); + } + } + + #onMouseMove(event) { + this.element.removeEventListener("scroll", this._endPan, true); + + if (!(event.buttons & 1)) { + this._endPan(); + + return; + } + + const xDiff = event.clientX - this.clientXStart; + const yDiff = event.clientY - this.clientYStart; + const scrollTop = this.scrollTopStart - yDiff; + const scrollLeft = this.scrollLeftStart - xDiff; + + if (this.element.scrollTo) { + this.element.scrollTo({ + top: scrollTop, + left: scrollLeft, + behavior: "instant" + }); + } else { + this.element.scrollTop = scrollTop; + this.element.scrollLeft = scrollLeft; + } + + if (!this.overlay.parentNode) { + document.body.appendChild(this.overlay); + } + } + + #endPan() { + this.element.removeEventListener("scroll", this._endPan, true); + this.document.removeEventListener("mousemove", this._onMouseMove, true); + this.document.removeEventListener("mouseup", this._endPan, true); + this.overlay.remove(); + } + +} + +exports.GrabToPan = GrabToPan; + +/***/ }), +/* 8 */ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.SimpleLinkService = exports.PDFLinkService = exports.LinkTarget = void 0; + +var _ui_utils = __webpack_require__(3); + +const DEFAULT_LINK_REL = "noopener noreferrer nofollow"; +const LinkTarget = { + NONE: 0, + SELF: 1, + BLANK: 2, + PARENT: 3, + TOP: 4 +}; +exports.LinkTarget = LinkTarget; + +function addLinkAttributes(link, { + url, + target, + rel, + enabled = true +} = {}) { + if (!url || typeof url !== "string") { + throw new Error('A valid "url" parameter must provided.'); + } + + const urlNullRemoved = (0, _ui_utils.removeNullCharacters)(url); + + if (enabled) { + link.href = link.title = urlNullRemoved; + } else { + link.href = ""; + link.title = `Disabled: ${urlNullRemoved}`; + + link.onclick = () => { + return false; + }; + } + + let targetStr = ""; + + switch (target) { + case LinkTarget.NONE: + break; + + case LinkTarget.SELF: + targetStr = "_self"; + break; + + case LinkTarget.BLANK: + targetStr = "_blank"; + break; + + case LinkTarget.PARENT: + targetStr = "_parent"; + break; + + case LinkTarget.TOP: + targetStr = "_top"; + break; + } + + link.target = targetStr; + link.rel = typeof rel === "string" ? rel : DEFAULT_LINK_REL; +} + +class PDFLinkService { + #pagesRefCache = new Map(); + + constructor({ + eventBus, + externalLinkTarget = null, + externalLinkRel = null, + ignoreDestinationZoom = false + } = {}) { + this.eventBus = eventBus; + this.externalLinkTarget = externalLinkTarget; + this.externalLinkRel = externalLinkRel; + this.externalLinkEnabled = true; + this._ignoreDestinationZoom = ignoreDestinationZoom; + this.baseUrl = null; + this.pdfDocument = null; + this.pdfViewer = null; + this.pdfHistory = null; + } + + setDocument(pdfDocument, baseUrl = null) { + this.baseUrl = baseUrl; + this.pdfDocument = pdfDocument; + this.#pagesRefCache.clear(); + } + + setViewer(pdfViewer) { + this.pdfViewer = pdfViewer; + } + + setHistory(pdfHistory) { + this.pdfHistory = pdfHistory; + } + + get pagesCount() { + return this.pdfDocument ? this.pdfDocument.numPages : 0; + } + + get page() { + return this.pdfViewer.currentPageNumber; + } + + set page(value) { + this.pdfViewer.currentPageNumber = value; + } + + get rotation() { + return this.pdfViewer.pagesRotation; + } + + set rotation(value) { + this.pdfViewer.pagesRotation = value; + } + + #goToDestinationHelper(rawDest, namedDest = null, explicitDest) { + const destRef = explicitDest[0]; + let pageNumber; + + if (typeof destRef === "object" && destRef !== null) { + pageNumber = this._cachedPageNumber(destRef); + + if (!pageNumber) { + this.pdfDocument.getPageIndex(destRef).then(pageIndex => { + this.cachePageRef(pageIndex + 1, destRef); + this.#goToDestinationHelper(rawDest, namedDest, explicitDest); + }).catch(() => { + console.error(`PDFLinkService.#goToDestinationHelper: "${destRef}" is not ` + `a valid page reference, for dest="${rawDest}".`); + }); + return; + } + } else if (Number.isInteger(destRef)) { + pageNumber = destRef + 1; + } else { + console.error(`PDFLinkService.#goToDestinationHelper: "${destRef}" is not ` + `a valid destination reference, for dest="${rawDest}".`); + return; + } + + if (!pageNumber || pageNumber < 1 || pageNumber > this.pagesCount) { + console.error(`PDFLinkService.#goToDestinationHelper: "${pageNumber}" is not ` + `a valid page number, for dest="${rawDest}".`); + return; + } + + if (this.pdfHistory) { + this.pdfHistory.pushCurrentPosition(); + this.pdfHistory.push({ + namedDest, + explicitDest, + pageNumber + }); + } + + this.pdfViewer.scrollPageIntoView({ + pageNumber, + destArray: explicitDest, + ignoreDestinationZoom: this._ignoreDestinationZoom + }); + } + + async goToDestination(dest) { + if (!this.pdfDocument) { + return; + } + + let namedDest, explicitDest; + + if (typeof dest === "string") { + namedDest = dest; + explicitDest = await this.pdfDocument.getDestination(dest); + } else { + namedDest = null; + explicitDest = await dest; + } + + if (!Array.isArray(explicitDest)) { + console.error(`PDFLinkService.goToDestination: "${explicitDest}" is not ` + `a valid destination array, for dest="${dest}".`); + return; + } + + this.#goToDestinationHelper(dest, namedDest, explicitDest); + } + + goToPage(val) { + if (!this.pdfDocument) { + return; + } + + const pageNumber = typeof val === "string" && this.pdfViewer.pageLabelToPageNumber(val) || val | 0; + + if (!(Number.isInteger(pageNumber) && pageNumber > 0 && pageNumber <= this.pagesCount)) { + console.error(`PDFLinkService.goToPage: "${val}" is not a valid page.`); + return; + } + + if (this.pdfHistory) { + this.pdfHistory.pushCurrentPosition(); + this.pdfHistory.pushPage(pageNumber); + } + + this.pdfViewer.scrollPageIntoView({ + pageNumber + }); + } + + addLinkAttributes(link, url, newWindow = false) { + addLinkAttributes(link, { + url, + target: newWindow ? LinkTarget.BLANK : this.externalLinkTarget, + rel: this.externalLinkRel, + enabled: this.externalLinkEnabled + }); + } + + getDestinationHash(dest) { + if (typeof dest === "string") { + if (dest.length > 0) { + return this.getAnchorUrl("#" + escape(dest)); + } + } else if (Array.isArray(dest)) { + const str = JSON.stringify(dest); + + if (str.length > 0) { + return this.getAnchorUrl("#" + escape(str)); + } + } + + return this.getAnchorUrl(""); + } + + getAnchorUrl(anchor) { + return (this.baseUrl || "") + anchor; + } + + setHash(hash) { + if (!this.pdfDocument) { + return; + } + + let pageNumber, dest; + + if (hash.includes("=")) { + const params = (0, _ui_utils.parseQueryString)(hash); + + if (params.has("search")) { + this.eventBus.dispatch("findfromurlhash", { + source: this, + query: params.get("search").replace(/"/g, ""), + phraseSearch: params.get("phrase") === "true" + }); + } + + if (params.has("page")) { + pageNumber = params.get("page") | 0 || 1; + } + + if (params.has("zoom")) { + const zoomArgs = params.get("zoom").split(","); + const zoomArg = zoomArgs[0]; + const zoomArgNumber = parseFloat(zoomArg); + + if (!zoomArg.includes("Fit")) { + dest = [null, { + name: "XYZ" + }, zoomArgs.length > 1 ? zoomArgs[1] | 0 : null, zoomArgs.length > 2 ? zoomArgs[2] | 0 : null, zoomArgNumber ? zoomArgNumber / 100 : zoomArg]; + } else { + if (zoomArg === "Fit" || zoomArg === "FitB") { + dest = [null, { + name: zoomArg + }]; + } else if (zoomArg === "FitH" || zoomArg === "FitBH" || zoomArg === "FitV" || zoomArg === "FitBV") { + dest = [null, { + name: zoomArg + }, zoomArgs.length > 1 ? zoomArgs[1] | 0 : null]; + } else if (zoomArg === "FitR") { + if (zoomArgs.length !== 5) { + console.error('PDFLinkService.setHash: Not enough parameters for "FitR".'); + } else { + dest = [null, { + name: zoomArg + }, zoomArgs[1] | 0, zoomArgs[2] | 0, zoomArgs[3] | 0, zoomArgs[4] | 0]; + } + } else { + console.error(`PDFLinkService.setHash: "${zoomArg}" is not a valid zoom value.`); + } + } + } + + if (dest) { + this.pdfViewer.scrollPageIntoView({ + pageNumber: pageNumber || this.page, + destArray: dest, + allowNegativeOffset: true + }); + } else if (pageNumber) { + this.page = pageNumber; + } + + if (params.has("pagemode")) { + this.eventBus.dispatch("pagemode", { + source: this, + mode: params.get("pagemode") + }); + } + + if (params.has("nameddest")) { + this.goToDestination(params.get("nameddest")); + } + } else { + dest = unescape(hash); + + try { + dest = JSON.parse(dest); + + if (!Array.isArray(dest)) { + dest = dest.toString(); + } + } catch (ex) {} + + if (typeof dest === "string" || PDFLinkService.#isValidExplicitDestination(dest)) { + this.goToDestination(dest); + return; + } + + console.error(`PDFLinkService.setHash: "${unescape(hash)}" is not a valid destination.`); + } + } + + executeNamedAction(action) { + switch (action) { + case "GoBack": + this.pdfHistory?.back(); + break; + + case "GoForward": + this.pdfHistory?.forward(); + break; + + case "NextPage": + this.pdfViewer.nextPage(); + break; + + case "PrevPage": + this.pdfViewer.previousPage(); + break; + + case "LastPage": + this.page = this.pagesCount; + break; + + case "FirstPage": + this.page = 1; + break; + + default: + break; + } + + this.eventBus.dispatch("namedaction", { + source: this, + action + }); + } + + cachePageRef(pageNum, pageRef) { + if (!pageRef) { + return; + } + + const refStr = pageRef.gen === 0 ? `${pageRef.num}R` : `${pageRef.num}R${pageRef.gen}`; + this.#pagesRefCache.set(refStr, pageNum); + } + + _cachedPageNumber(pageRef) { + if (!pageRef) { + return null; + } + + const refStr = pageRef.gen === 0 ? `${pageRef.num}R` : `${pageRef.num}R${pageRef.gen}`; + return this.#pagesRefCache.get(refStr) || null; + } + + isPageVisible(pageNumber) { + return this.pdfViewer.isPageVisible(pageNumber); + } + + isPageCached(pageNumber) { + return this.pdfViewer.isPageCached(pageNumber); + } + + static #isValidExplicitDestination(dest) { + if (!Array.isArray(dest)) { + return false; + } + + const destLength = dest.length; + + if (destLength < 2) { + return false; + } + + const page = dest[0]; + + if (!(typeof page === "object" && Number.isInteger(page.num) && Number.isInteger(page.gen)) && !(Number.isInteger(page) && page >= 0)) { + return false; + } + + const zoom = dest[1]; + + if (!(typeof zoom === "object" && typeof zoom.name === "string")) { + return false; + } + + let allowNull = true; + + switch (zoom.name) { + case "XYZ": + if (destLength !== 5) { + return false; + } + + break; + + case "Fit": + case "FitB": + return destLength === 2; + + case "FitH": + case "FitBH": + case "FitV": + case "FitBV": + if (destLength !== 3) { + return false; + } + + break; + + case "FitR": + if (destLength !== 6) { + return false; + } + + allowNull = false; + break; + + default: + return false; + } + + for (let i = 2; i < destLength; i++) { + const param = dest[i]; + + if (!(typeof param === "number" || allowNull && param === null)) { + return false; + } + } + + return true; + } + +} + +exports.PDFLinkService = PDFLinkService; + +class SimpleLinkService { + constructor() { + this.externalLinkEnabled = true; + } + + get pagesCount() { + return 0; + } + + get page() { + return 0; + } + + set page(value) {} + + get rotation() { + return 0; + } + + set rotation(value) {} + + async goToDestination(dest) {} + + goToPage(val) {} + + addLinkAttributes(link, url, newWindow = false) { + addLinkAttributes(link, { + url, + enabled: this.externalLinkEnabled + }); + } + + getDestinationHash(dest) { + return "#"; + } + + getAnchorUrl(hash) { + return "#"; + } + + setHash(hash) {} + + executeNamedAction(action) {} + + cachePageRef(pageNum, pageRef) {} + + isPageVisible(pageNumber) { + return true; + } + + isPageCached(pageNumber) { + return true; + } + +} + +exports.SimpleLinkService = SimpleLinkService; + +/***/ }), +/* 9 */ +/***/ ((__unused_webpack_module, exports) => { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.OverlayManager = void 0; + +class OverlayManager { + #overlays = new WeakMap(); + #active = null; + + get active() { + return this.#active; + } + + async register(dialog, canForceClose = false) { + if (typeof dialog !== "object") { + throw new Error("Not enough parameters."); + } else if (this.#overlays.has(dialog)) { + throw new Error("The overlay is already registered."); + } + + this.#overlays.set(dialog, { + canForceClose + }); + dialog.addEventListener("cancel", evt => { + this.#active = null; + }); + } + + async unregister(dialog) { + if (!this.#overlays.has(dialog)) { + throw new Error("The overlay does not exist."); + } else if (this.#active === dialog) { + throw new Error("The overlay cannot be removed while it is active."); + } + + this.#overlays.delete(dialog); + } + + async open(dialog) { + if (!this.#overlays.has(dialog)) { + throw new Error("The overlay does not exist."); + } else if (this.#active) { + if (this.#active === dialog) { + throw new Error("The overlay is already active."); + } else if (this.#overlays.get(dialog).canForceClose) { + await this.close(); + } else { + throw new Error("Another overlay is currently active."); + } + } + + this.#active = dialog; + dialog.showModal(); + } + + async close(dialog = this.#active) { + if (!this.#overlays.has(dialog)) { + throw new Error("The overlay does not exist."); + } else if (!this.#active) { + throw new Error("The overlay is currently not active."); + } else if (this.#active !== dialog) { + throw new Error("Another overlay is currently active."); + } + + dialog.close(); + this.#active = null; + } + +} + +exports.OverlayManager = OverlayManager; + +/***/ }), +/* 10 */ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.PasswordPrompt = void 0; + +var _pdfjsLib = __webpack_require__(5); + +class PasswordPrompt { + #updateCallback = null; + #reason = null; + + constructor(options, overlayManager, l10n, isViewerEmbedded = false) { + this.dialog = options.dialog; + this.label = options.label; + this.input = options.input; + this.submitButton = options.submitButton; + this.cancelButton = options.cancelButton; + this.overlayManager = overlayManager; + this.l10n = l10n; + this._isViewerEmbedded = isViewerEmbedded; + this.submitButton.addEventListener("click", this.#verify.bind(this)); + this.cancelButton.addEventListener("click", this.#cancel.bind(this)); + this.input.addEventListener("keydown", e => { + if (e.keyCode === 13) { + this.#verify(); + } + }); + this.overlayManager.register(this.dialog, true); + this.dialog.addEventListener("close", this.#cancel.bind(this)); + } + + async open() { + await this.overlayManager.open(this.dialog); + const passwordIncorrect = this.#reason === _pdfjsLib.PasswordResponses.INCORRECT_PASSWORD; + + if (!this._isViewerEmbedded || passwordIncorrect) { + this.input.focus(); + } + + this.label.textContent = await this.l10n.get(`password_${passwordIncorrect ? "invalid" : "label"}`); + } + + async close() { + if (this.overlayManager.active === this.dialog) { + this.overlayManager.close(this.dialog); + } + } + + #verify() { + const password = this.input.value; + + if (password?.length > 0) { + this.#invokeCallback(password); + } + } + + #cancel() { + this.#invokeCallback(new Error("PasswordPrompt cancelled.")); + } + + #invokeCallback(password) { + if (!this.#updateCallback) { + return; + } + + this.close(); + this.input.value = ""; + this.#updateCallback(password); + this.#updateCallback = null; + } + + setUpdateCallback(updateCallback, reason) { + this.#updateCallback = updateCallback; + this.#reason = reason; + } + +} + +exports.PasswordPrompt = PasswordPrompt; + +/***/ }), +/* 11 */ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.PDFAttachmentViewer = void 0; + +var _pdfjsLib = __webpack_require__(5); + +var _base_tree_viewer = __webpack_require__(12); + +var _event_utils = __webpack_require__(4); + +class PDFAttachmentViewer extends _base_tree_viewer.BaseTreeViewer { + constructor(options) { + super(options); + this.downloadManager = options.downloadManager; + + this.eventBus._on("fileattachmentannotation", this.#appendAttachment.bind(this)); + } + + reset(keepRenderedCapability = false) { + super.reset(); + this._attachments = null; + + if (!keepRenderedCapability) { + this._renderedCapability = (0, _pdfjsLib.createPromiseCapability)(); + } + + this._pendingDispatchEvent = false; + } + + async _dispatchEvent(attachmentsCount) { + this._renderedCapability.resolve(); + + if (attachmentsCount === 0 && !this._pendingDispatchEvent) { + this._pendingDispatchEvent = true; + await (0, _event_utils.waitOnEventOrTimeout)({ + target: this.eventBus, + name: "annotationlayerrendered", + delay: 1000 + }); + + if (!this._pendingDispatchEvent) { + return; + } + } + + this._pendingDispatchEvent = false; + this.eventBus.dispatch("attachmentsloaded", { + source: this, + attachmentsCount + }); + } + + _bindLink(element, { + content, + filename + }) { + element.onclick = () => { + this.downloadManager.openOrDownloadData(element, content, filename); + return false; + }; + } + + render({ + attachments, + keepRenderedCapability = false + }) { + if (this._attachments) { + this.reset(keepRenderedCapability); + } + + this._attachments = attachments || null; + + if (!attachments) { + this._dispatchEvent(0); + + return; + } + + const names = Object.keys(attachments).sort(function (a, b) { + return a.toLowerCase().localeCompare(b.toLowerCase()); + }); + const fragment = document.createDocumentFragment(); + let attachmentsCount = 0; + + for (const name of names) { + const item = attachments[name]; + const content = item.content, + filename = (0, _pdfjsLib.getFilenameFromUrl)(item.filename); + const div = document.createElement("div"); + div.className = "treeItem"; + const element = document.createElement("a"); + + this._bindLink(element, { + content, + filename + }); + + element.textContent = this._normalizeTextContent(filename); + div.appendChild(element); + fragment.appendChild(div); + attachmentsCount++; + } + + this._finishRendering(fragment, attachmentsCount); + } + + #appendAttachment({ + filename, + content + }) { + const renderedPromise = this._renderedCapability.promise; + renderedPromise.then(() => { + if (renderedPromise !== this._renderedCapability.promise) { + return; + } + + const attachments = this._attachments || Object.create(null); + + for (const name in attachments) { + if (filename === name) { + return; + } + } + + attachments[filename] = { + filename, + content + }; + this.render({ + attachments, + keepRenderedCapability: true + }); + }); + } + +} + +exports.PDFAttachmentViewer = PDFAttachmentViewer; + +/***/ }), +/* 12 */ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.BaseTreeViewer = void 0; + +var _ui_utils = __webpack_require__(3); + +const TREEITEM_OFFSET_TOP = -100; +const TREEITEM_SELECTED_CLASS = "selected"; + +class BaseTreeViewer { + constructor(options) { + if (this.constructor === BaseTreeViewer) { + throw new Error("Cannot initialize BaseTreeViewer."); + } + + this.container = options.container; + this.eventBus = options.eventBus; + this.reset(); + } + + reset() { + this._pdfDocument = null; + this._lastToggleIsShow = true; + this._currentTreeItem = null; + this.container.textContent = ""; + this.container.classList.remove("treeWithDeepNesting"); + } + + _dispatchEvent(count) { + throw new Error("Not implemented: _dispatchEvent"); + } + + _bindLink(element, params) { + throw new Error("Not implemented: _bindLink"); + } + + _normalizeTextContent(str) { + return (0, _ui_utils.removeNullCharacters)(str, true) || "\u2013"; + } + + _addToggleButton(div, hidden = false) { + const toggler = document.createElement("div"); + toggler.className = "treeItemToggler"; + + if (hidden) { + toggler.classList.add("treeItemsHidden"); + } + + toggler.onclick = evt => { + evt.stopPropagation(); + toggler.classList.toggle("treeItemsHidden"); + + if (evt.shiftKey) { + const shouldShowAll = !toggler.classList.contains("treeItemsHidden"); + + this._toggleTreeItem(div, shouldShowAll); + } + }; + + div.insertBefore(toggler, div.firstChild); + } + + _toggleTreeItem(root, show = false) { + this._lastToggleIsShow = show; + + for (const toggler of root.querySelectorAll(".treeItemToggler")) { + toggler.classList.toggle("treeItemsHidden", !show); + } + } + + _toggleAllTreeItems() { + this._toggleTreeItem(this.container, !this._lastToggleIsShow); + } + + _finishRendering(fragment, count, hasAnyNesting = false) { + if (hasAnyNesting) { + this.container.classList.add("treeWithDeepNesting"); + this._lastToggleIsShow = !fragment.querySelector(".treeItemsHidden"); + } + + this.container.appendChild(fragment); + + this._dispatchEvent(count); + } + + render(params) { + throw new Error("Not implemented: render"); + } + + _updateCurrentTreeItem(treeItem = null) { + if (this._currentTreeItem) { + this._currentTreeItem.classList.remove(TREEITEM_SELECTED_CLASS); + + this._currentTreeItem = null; + } + + if (treeItem) { + treeItem.classList.add(TREEITEM_SELECTED_CLASS); + this._currentTreeItem = treeItem; + } + } + + _scrollToCurrentTreeItem(treeItem) { + if (!treeItem) { + return; + } + + let currentNode = treeItem.parentNode; + + while (currentNode && currentNode !== this.container) { + if (currentNode.classList.contains("treeItem")) { + const toggler = currentNode.firstElementChild; + toggler?.classList.remove("treeItemsHidden"); + } + + currentNode = currentNode.parentNode; + } + + this._updateCurrentTreeItem(treeItem); + + this.container.scrollTo(treeItem.offsetLeft, treeItem.offsetTop + TREEITEM_OFFSET_TOP); + } + +} + +exports.BaseTreeViewer = BaseTreeViewer; + +/***/ }), +/* 13 */ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.PDFDocumentProperties = void 0; + +var _pdfjsLib = __webpack_require__(5); + +var _ui_utils = __webpack_require__(3); + +const DEFAULT_FIELD_CONTENT = "-"; +const NON_METRIC_LOCALES = ["en-us", "en-lr", "my"]; +const US_PAGE_NAMES = { + "8.5x11": "Letter", + "8.5x14": "Legal" +}; +const METRIC_PAGE_NAMES = { + "297x420": "A3", + "210x297": "A4" +}; + +function getPageName(size, isPortrait, pageNames) { + const width = isPortrait ? size.width : size.height; + const height = isPortrait ? size.height : size.width; + return pageNames[`${width}x${height}`]; +} + +class PDFDocumentProperties { + #fieldData = null; + + constructor({ + dialog, + fields, + closeButton + }, overlayManager, eventBus, l10n) { + this.dialog = dialog; + this.fields = fields; + this.overlayManager = overlayManager; + this.l10n = l10n; + this.#reset(); + closeButton.addEventListener("click", this.close.bind(this)); + this.overlayManager.register(this.dialog); + + eventBus._on("pagechanging", evt => { + this._currentPageNumber = evt.pageNumber; + }); + + eventBus._on("rotationchanging", evt => { + this._pagesRotation = evt.pagesRotation; + }); + + this._isNonMetricLocale = true; + l10n.getLanguage().then(locale => { + this._isNonMetricLocale = NON_METRIC_LOCALES.includes(locale); + }); + } + + async open() { + await Promise.all([this.overlayManager.open(this.dialog), this._dataAvailableCapability.promise]); + const currentPageNumber = this._currentPageNumber; + const pagesRotation = this._pagesRotation; + + if (this.#fieldData && currentPageNumber === this.#fieldData._currentPageNumber && pagesRotation === this.#fieldData._pagesRotation) { + this.#updateUI(); + return; + } + + const { + info, + contentDispositionFilename, + contentLength + } = await this.pdfDocument.getMetadata(); + const [fileName, fileSize, creationDate, modificationDate, pageSize, isLinearized] = await Promise.all([contentDispositionFilename || (0, _pdfjsLib.getPdfFilenameFromUrl)(this.url), this.#parseFileSize(contentLength), this.#parseDate(info.CreationDate), this.#parseDate(info.ModDate), this.pdfDocument.getPage(currentPageNumber).then(pdfPage => { + return this.#parsePageSize((0, _ui_utils.getPageSizeInches)(pdfPage), pagesRotation); + }), this.#parseLinearization(info.IsLinearized)]); + this.#fieldData = Object.freeze({ + fileName, + fileSize, + title: info.Title, + author: info.Author, + subject: info.Subject, + keywords: info.Keywords, + creationDate, + modificationDate, + creator: info.Creator, + producer: info.Producer, + version: info.PDFFormatVersion, + pageCount: this.pdfDocument.numPages, + pageSize, + linearized: isLinearized, + _currentPageNumber: currentPageNumber, + _pagesRotation: pagesRotation + }); + this.#updateUI(); + const { + length + } = await this.pdfDocument.getDownloadInfo(); + + if (contentLength === length) { + return; + } + + const data = Object.assign(Object.create(null), this.#fieldData); + data.fileSize = await this.#parseFileSize(length); + this.#fieldData = Object.freeze(data); + this.#updateUI(); + } + + async close() { + this.overlayManager.close(this.dialog); + } + + setDocument(pdfDocument, url = null) { + if (this.pdfDocument) { + this.#reset(); + this.#updateUI(true); + } + + if (!pdfDocument) { + return; + } + + this.pdfDocument = pdfDocument; + this.url = url; + + this._dataAvailableCapability.resolve(); + } + + #reset() { + this.pdfDocument = null; + this.url = null; + this.#fieldData = null; + this._dataAvailableCapability = (0, _pdfjsLib.createPromiseCapability)(); + this._currentPageNumber = 1; + this._pagesRotation = 0; + } + + #updateUI(reset = false) { + if (reset || !this.#fieldData) { + for (const id in this.fields) { + this.fields[id].textContent = DEFAULT_FIELD_CONTENT; + } + + return; + } + + if (this.overlayManager.active !== this.dialog) { + return; + } + + for (const id in this.fields) { + const content = this.#fieldData[id]; + this.fields[id].textContent = content || content === 0 ? content : DEFAULT_FIELD_CONTENT; + } + } + + async #parseFileSize(fileSize = 0) { + const kb = fileSize / 1024, + mb = kb / 1024; + + if (!kb) { + return undefined; + } + + return this.l10n.get(`document_properties_${mb >= 1 ? "mb" : "kb"}`, { + size_mb: mb >= 1 && (+mb.toPrecision(3)).toLocaleString(), + size_kb: mb < 1 && (+kb.toPrecision(3)).toLocaleString(), + size_b: fileSize.toLocaleString() + }); + } + + async #parsePageSize(pageSizeInches, pagesRotation) { + if (!pageSizeInches) { + return undefined; + } + + if (pagesRotation % 180 !== 0) { + pageSizeInches = { + width: pageSizeInches.height, + height: pageSizeInches.width + }; + } + + const isPortrait = (0, _ui_utils.isPortraitOrientation)(pageSizeInches); + let sizeInches = { + width: Math.round(pageSizeInches.width * 100) / 100, + height: Math.round(pageSizeInches.height * 100) / 100 + }; + let sizeMillimeters = { + width: Math.round(pageSizeInches.width * 25.4 * 10) / 10, + height: Math.round(pageSizeInches.height * 25.4 * 10) / 10 + }; + let rawName = getPageName(sizeInches, isPortrait, US_PAGE_NAMES) || getPageName(sizeMillimeters, isPortrait, METRIC_PAGE_NAMES); + + if (!rawName && !(Number.isInteger(sizeMillimeters.width) && Number.isInteger(sizeMillimeters.height))) { + const exactMillimeters = { + width: pageSizeInches.width * 25.4, + height: pageSizeInches.height * 25.4 + }; + const intMillimeters = { + width: Math.round(sizeMillimeters.width), + height: Math.round(sizeMillimeters.height) + }; + + if (Math.abs(exactMillimeters.width - intMillimeters.width) < 0.1 && Math.abs(exactMillimeters.height - intMillimeters.height) < 0.1) { + rawName = getPageName(intMillimeters, isPortrait, METRIC_PAGE_NAMES); + + if (rawName) { + sizeInches = { + width: Math.round(intMillimeters.width / 25.4 * 100) / 100, + height: Math.round(intMillimeters.height / 25.4 * 100) / 100 + }; + sizeMillimeters = intMillimeters; + } + } + } + + const [{ + width, + height + }, unit, name, orientation] = await Promise.all([this._isNonMetricLocale ? sizeInches : sizeMillimeters, this.l10n.get(`document_properties_page_size_unit_${this._isNonMetricLocale ? "inches" : "millimeters"}`), rawName && this.l10n.get(`document_properties_page_size_name_${rawName.toLowerCase()}`), this.l10n.get(`document_properties_page_size_orientation_${isPortrait ? "portrait" : "landscape"}`)]); + return this.l10n.get(`document_properties_page_size_dimension_${name ? "name_" : ""}string`, { + width: width.toLocaleString(), + height: height.toLocaleString(), + unit, + name, + orientation + }); + } + + async #parseDate(inputDate) { + const dateObject = _pdfjsLib.PDFDateString.toDateObject(inputDate); + + if (!dateObject) { + return undefined; + } + + return this.l10n.get("document_properties_date_string", { + date: dateObject.toLocaleDateString(), + time: dateObject.toLocaleTimeString() + }); + } + + #parseLinearization(isLinearized) { + return this.l10n.get(`document_properties_linearized_${isLinearized ? "yes" : "no"}`); + } + +} + +exports.PDFDocumentProperties = PDFDocumentProperties; + +/***/ }), +/* 14 */ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.PDFFindBar = void 0; + +var _pdf_find_controller = __webpack_require__(15); + +const MATCHES_COUNT_LIMIT = 1000; + +class PDFFindBar { + constructor(options, eventBus, l10n) { + this.opened = false; + this.bar = options.bar; + this.toggleButton = options.toggleButton; + this.findField = options.findField; + this.highlightAll = options.highlightAllCheckbox; + this.caseSensitive = options.caseSensitiveCheckbox; + this.matchDiacritics = options.matchDiacriticsCheckbox; + this.entireWord = options.entireWordCheckbox; + this.findMsg = options.findMsg; + this.findResultsCount = options.findResultsCount; + this.findPreviousButton = options.findPreviousButton; + this.findNextButton = options.findNextButton; + this.eventBus = eventBus; + this.l10n = l10n; + this.toggleButton.addEventListener("click", () => { + this.toggle(); + }); + this.findField.addEventListener("input", () => { + this.dispatchEvent(""); + }); + this.bar.addEventListener("keydown", e => { + switch (e.keyCode) { + case 13: + if (e.target === this.findField) { + this.dispatchEvent("again", e.shiftKey); + } + + break; + + case 27: + this.close(); + break; + } + }); + this.findPreviousButton.addEventListener("click", () => { + this.dispatchEvent("again", true); + }); + this.findNextButton.addEventListener("click", () => { + this.dispatchEvent("again", false); + }); + this.highlightAll.addEventListener("click", () => { + this.dispatchEvent("highlightallchange"); + }); + this.caseSensitive.addEventListener("click", () => { + this.dispatchEvent("casesensitivitychange"); + }); + this.entireWord.addEventListener("click", () => { + this.dispatchEvent("entirewordchange"); + }); + this.matchDiacritics.addEventListener("click", () => { + this.dispatchEvent("diacriticmatchingchange"); + }); + + this.eventBus._on("resize", this.#adjustWidth.bind(this)); + } + + reset() { + this.updateUIState(); + } + + dispatchEvent(type, findPrev = false) { + this.eventBus.dispatch("find", { + source: this, + type, + query: this.findField.value, + phraseSearch: true, + caseSensitive: this.caseSensitive.checked, + entireWord: this.entireWord.checked, + highlightAll: this.highlightAll.checked, + findPrevious: findPrev, + matchDiacritics: this.matchDiacritics.checked + }); + } + + updateUIState(state, previous, matchesCount) { + let findMsg = Promise.resolve(""); + let status = ""; + + switch (state) { + case _pdf_find_controller.FindState.FOUND: + break; + + case _pdf_find_controller.FindState.PENDING: + status = "pending"; + break; + + case _pdf_find_controller.FindState.NOT_FOUND: + findMsg = this.l10n.get("find_not_found"); + status = "notFound"; + break; + + case _pdf_find_controller.FindState.WRAPPED: + findMsg = this.l10n.get(`find_reached_${previous ? "top" : "bottom"}`); + break; + } + + this.findField.setAttribute("data-status", status); + this.findField.setAttribute("aria-invalid", state === _pdf_find_controller.FindState.NOT_FOUND); + findMsg.then(msg => { + this.findMsg.textContent = msg; + this.#adjustWidth(); + }); + this.updateResultsCount(matchesCount); + } + + updateResultsCount({ + current = 0, + total = 0 + } = {}) { + const limit = MATCHES_COUNT_LIMIT; + let matchCountMsg = Promise.resolve(""); + + if (total > 0) { + if (total > limit) { + let key = "find_match_count_limit"; + matchCountMsg = this.l10n.get(key, { + limit + }); + } else { + let key = "find_match_count"; + matchCountMsg = this.l10n.get(key, { + current, + total + }); + } + } + + matchCountMsg.then(msg => { + this.findResultsCount.textContent = msg; + this.#adjustWidth(); + }); + } + + open() { + if (!this.opened) { + this.opened = true; + this.toggleButton.classList.add("toggled"); + this.toggleButton.setAttribute("aria-expanded", "true"); + this.bar.classList.remove("hidden"); + } + + this.findField.select(); + this.findField.focus(); + this.#adjustWidth(); + } + + close() { + if (!this.opened) { + return; + } + + this.opened = false; + this.toggleButton.classList.remove("toggled"); + this.toggleButton.setAttribute("aria-expanded", "false"); + this.bar.classList.add("hidden"); + this.eventBus.dispatch("findbarclose", { + source: this + }); + } + + toggle() { + if (this.opened) { + this.close(); + } else { + this.open(); + } + } + + #adjustWidth() { + if (!this.opened) { + return; + } + + this.bar.classList.remove("wrapContainers"); + const findbarHeight = this.bar.clientHeight; + const inputContainerHeight = this.bar.firstElementChild.clientHeight; + + if (findbarHeight > inputContainerHeight) { + this.bar.classList.add("wrapContainers"); + } + } + +} + +exports.PDFFindBar = PDFFindBar; + +/***/ }), +/* 15 */ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.PDFFindController = exports.FindState = void 0; + +var _ui_utils = __webpack_require__(3); + +var _pdfjsLib = __webpack_require__(5); + +var _pdf_find_utils = __webpack_require__(16); + +const FindState = { + FOUND: 0, + NOT_FOUND: 1, + WRAPPED: 2, + PENDING: 3 +}; +exports.FindState = FindState; +const FIND_TIMEOUT = 250; +const MATCH_SCROLL_OFFSET_TOP = -50; +const MATCH_SCROLL_OFFSET_LEFT = -400; +const CHARACTERS_TO_NORMALIZE = { + "\u2010": "-", + "\u2018": "'", + "\u2019": "'", + "\u201A": "'", + "\u201B": "'", + "\u201C": '"', + "\u201D": '"', + "\u201E": '"', + "\u201F": '"', + "\u00BC": "1/4", + "\u00BD": "1/2", + "\u00BE": "3/4" +}; +const DIACRITICS_EXCEPTION = new Set([0x3099, 0x309a, 0x094d, 0x09cd, 0x0a4d, 0x0acd, 0x0b4d, 0x0bcd, 0x0c4d, 0x0ccd, 0x0d3b, 0x0d3c, 0x0d4d, 0x0dca, 0x0e3a, 0x0eba, 0x0f84, 0x1039, 0x103a, 0x1714, 0x1734, 0x17d2, 0x1a60, 0x1b44, 0x1baa, 0x1bab, 0x1bf2, 0x1bf3, 0x2d7f, 0xa806, 0xa82c, 0xa8c4, 0xa953, 0xa9c0, 0xaaf6, 0xabed, 0x0c56, 0x0f71, 0x0f72, 0x0f7a, 0x0f7b, 0x0f7c, 0x0f7d, 0x0f80, 0x0f74]); +const DIACRITICS_EXCEPTION_STR = [...DIACRITICS_EXCEPTION.values()].map(x => String.fromCharCode(x)).join(""); +const DIACRITICS_REG_EXP = /\p{M}+/gu; +const SPECIAL_CHARS_REG_EXP = /([.*+?^${}()|[\]\\])|(\p{P})|(\s+)|(\p{M})|(\p{L})/gu; +const NOT_DIACRITIC_FROM_END_REG_EXP = /([^\p{M}])\p{M}*$/u; +const NOT_DIACRITIC_FROM_START_REG_EXP = /^\p{M}*([^\p{M}])/u; +let normalizationRegex = null; + +function normalize(text) { + if (!normalizationRegex) { + const replace = Object.keys(CHARACTERS_TO_NORMALIZE).join(""); + normalizationRegex = new RegExp(`([${replace}])|(\\p{M}+(?:-\\n)?)|(\\S-\\n)|(\\n)`, "gum"); + } + + const rawDiacriticsPositions = []; + let m; + + while ((m = DIACRITICS_REG_EXP.exec(text)) !== null) { + rawDiacriticsPositions.push([m[0].length, m.index]); + } + + let normalized = text.normalize("NFD"); + const positions = [[0, 0]]; + let k = 0; + let shift = 0; + let shiftOrigin = 0; + let eol = 0; + let hasDiacritics = false; + normalized = normalized.replace(normalizationRegex, (match, p1, p2, p3, p4, i) => { + i -= shiftOrigin; + + if (p1) { + const replacement = CHARACTERS_TO_NORMALIZE[match]; + const jj = replacement.length; + + for (let j = 1; j < jj; j++) { + positions.push([i - shift + j, shift - j]); + } + + shift -= jj - 1; + return replacement; + } + + if (p2) { + const hasTrailingDashEOL = p2.endsWith("\n"); + const len = hasTrailingDashEOL ? p2.length - 2 : p2.length; + hasDiacritics = true; + let jj = len; + + if (i + eol === rawDiacriticsPositions[k]?.[1]) { + jj -= rawDiacriticsPositions[k][0]; + ++k; + } + + for (let j = 1; j < jj + 1; j++) { + positions.push([i - 1 - shift + j, shift - j]); + } + + shift -= jj; + shiftOrigin += jj; + + if (hasTrailingDashEOL) { + i += len - 1; + positions.push([i - shift + 1, 1 + shift]); + shift += 1; + shiftOrigin += 1; + eol += 1; + return p2.slice(0, len); + } + + return p2; + } + + if (p3) { + positions.push([i - shift + 1, 1 + shift]); + shift += 1; + shiftOrigin += 1; + eol += 1; + return p3.charAt(0); + } + + positions.push([i - shift + 1, shift - 1]); + shift -= 1; + shiftOrigin += 1; + eol += 1; + return " "; + }); + positions.push([normalized.length, shift]); + return [normalized, positions, hasDiacritics]; +} + +function getOriginalIndex(diffs, pos, len) { + if (!diffs) { + return [pos, len]; + } + + const start = pos; + const end = pos + len; + let i = (0, _ui_utils.binarySearchFirstItem)(diffs, x => x[0] >= start); + + if (diffs[i][0] > start) { + --i; + } + + let j = (0, _ui_utils.binarySearchFirstItem)(diffs, x => x[0] >= end, i); + + if (diffs[j][0] > end) { + --j; + } + + return [start + diffs[i][1], len + diffs[j][1] - diffs[i][1]]; +} + +class PDFFindController { + constructor({ + linkService, + eventBus + }) { + this._linkService = linkService; + this._eventBus = eventBus; + this.#reset(); + + eventBus._on("find", this.#onFind.bind(this)); + + eventBus._on("findbarclose", this.#onFindBarClose.bind(this)); + } + + get highlightMatches() { + return this._highlightMatches; + } + + get pageMatches() { + return this._pageMatches; + } + + get pageMatchesLength() { + return this._pageMatchesLength; + } + + get selected() { + return this._selected; + } + + get state() { + return this._state; + } + + setDocument(pdfDocument) { + if (this._pdfDocument) { + this.#reset(); + } + + if (!pdfDocument) { + return; + } + + this._pdfDocument = pdfDocument; + + this._firstPageCapability.resolve(); + } + + #onFind(state) { + if (!state) { + return; + } + + const pdfDocument = this._pdfDocument; + const { + type + } = state; + + if (this._state === null || this.#shouldDirtyMatch(state)) { + this._dirtyMatch = true; + } + + this._state = state; + + if (type !== "highlightallchange") { + this.#updateUIState(FindState.PENDING); + } + + this._firstPageCapability.promise.then(() => { + if (!this._pdfDocument || pdfDocument && this._pdfDocument !== pdfDocument) { + return; + } + + this.#extractText(); + const findbarClosed = !this._highlightMatches; + const pendingTimeout = !!this._findTimeout; + + if (this._findTimeout) { + clearTimeout(this._findTimeout); + this._findTimeout = null; + } + + if (!type) { + this._findTimeout = setTimeout(() => { + this.#nextMatch(); + this._findTimeout = null; + }, FIND_TIMEOUT); + } else if (this._dirtyMatch) { + this.#nextMatch(); + } else if (type === "again") { + this.#nextMatch(); + + if (findbarClosed && this._state.highlightAll) { + this.#updateAllPages(); + } + } else if (type === "highlightallchange") { + if (pendingTimeout) { + this.#nextMatch(); + } else { + this._highlightMatches = true; + } + + this.#updateAllPages(); + } else { + this.#nextMatch(); + } + }); + } + + scrollMatchIntoView({ + element = null, + selectedLeft = 0, + pageIndex = -1, + matchIndex = -1 + }) { + if (!this._scrollMatches || !element) { + return; + } else if (matchIndex === -1 || matchIndex !== this._selected.matchIdx) { + return; + } else if (pageIndex === -1 || pageIndex !== this._selected.pageIdx) { + return; + } + + this._scrollMatches = false; + const spot = { + top: MATCH_SCROLL_OFFSET_TOP, + left: selectedLeft + MATCH_SCROLL_OFFSET_LEFT + }; + (0, _ui_utils.scrollIntoView)(element, spot, true); + } + + #reset() { + this._highlightMatches = false; + this._scrollMatches = false; + this._pdfDocument = null; + this._pageMatches = []; + this._pageMatchesLength = []; + this._state = null; + this._selected = { + pageIdx: -1, + matchIdx: -1 + }; + this._offset = { + pageIdx: null, + matchIdx: null, + wrapped: false + }; + this._extractTextPromises = []; + this._pageContents = []; + this._pageDiffs = []; + this._hasDiacritics = []; + this._matchesCountTotal = 0; + this._pagesToSearch = null; + this._pendingFindMatches = new Set(); + this._resumePageIdx = null; + this._dirtyMatch = false; + clearTimeout(this._findTimeout); + this._findTimeout = null; + this._firstPageCapability = (0, _pdfjsLib.createPromiseCapability)(); + } + + get #query() { + if (this._state.query !== this._rawQuery) { + this._rawQuery = this._state.query; + [this._normalizedQuery] = normalize(this._state.query); + } + + return this._normalizedQuery; + } + + #shouldDirtyMatch(state) { + if (state.query !== this._state.query) { + return true; + } + + switch (state.type) { + case "again": + const pageNumber = this._selected.pageIdx + 1; + const linkService = this._linkService; + + if (pageNumber >= 1 && pageNumber <= linkService.pagesCount && pageNumber !== linkService.page && !linkService.isPageVisible(pageNumber)) { + return true; + } + + return false; + + case "highlightallchange": + return false; + } + + return true; + } + + #isEntireWord(content, startIdx, length) { + let match = content.slice(0, startIdx).match(NOT_DIACRITIC_FROM_END_REG_EXP); + + if (match) { + const first = content.charCodeAt(startIdx); + const limit = match[1].charCodeAt(0); + + if ((0, _pdf_find_utils.getCharacterType)(first) === (0, _pdf_find_utils.getCharacterType)(limit)) { + return false; + } + } + + match = content.slice(startIdx + length).match(NOT_DIACRITIC_FROM_START_REG_EXP); + + if (match) { + const last = content.charCodeAt(startIdx + length - 1); + const limit = match[1].charCodeAt(0); + + if ((0, _pdf_find_utils.getCharacterType)(last) === (0, _pdf_find_utils.getCharacterType)(limit)) { + return false; + } + } + + return true; + } + + #calculateRegExpMatch(query, entireWord, pageIndex, pageContent) { + const matches = [], + matchesLength = []; + const diffs = this._pageDiffs[pageIndex]; + let match; + + while ((match = query.exec(pageContent)) !== null) { + if (entireWord && !this.#isEntireWord(pageContent, match.index, match[0].length)) { + continue; + } + + const [matchPos, matchLen] = getOriginalIndex(diffs, match.index, match[0].length); + + if (matchLen) { + matches.push(matchPos); + matchesLength.push(matchLen); + } + } + + this._pageMatches[pageIndex] = matches; + this._pageMatchesLength[pageIndex] = matchesLength; + } + + #convertToRegExpString(query, hasDiacritics) { + const { + matchDiacritics + } = this._state; + let isUnicode = false; + query = query.replace(SPECIAL_CHARS_REG_EXP, (match, p1, p2, p3, p4, p5) => { + if (p1) { + return `[ ]*\\${p1}[ ]*`; + } + + if (p2) { + return `[ ]*${p2}[ ]*`; + } + + if (p3) { + return "[ ]+"; + } + + if (matchDiacritics) { + return p4 || p5; + } + + if (p4) { + return DIACRITICS_EXCEPTION.has(p4.charCodeAt(0)) ? p4 : ""; + } + + if (hasDiacritics) { + isUnicode = true; + return `${p5}\\p{M}*`; + } + + return p5; + }); + const trailingSpaces = "[ ]*"; + + if (query.endsWith(trailingSpaces)) { + query = query.slice(0, query.length - trailingSpaces.length); + } + + if (matchDiacritics) { + if (hasDiacritics) { + isUnicode = true; + query = `${query}(?=[${DIACRITICS_EXCEPTION_STR}]|[^\\p{M}]|$)`; + } + } + + return [isUnicode, query]; + } + + #calculateMatch(pageIndex) { + let query = this.#query; + + if (query.length === 0) { + return; + } + + const { + caseSensitive, + entireWord, + phraseSearch + } = this._state; + const pageContent = this._pageContents[pageIndex]; + const hasDiacritics = this._hasDiacritics[pageIndex]; + let isUnicode = false; + + if (phraseSearch) { + [isUnicode, query] = this.#convertToRegExpString(query, hasDiacritics); + } else { + const match = query.match(/\S+/g); + + if (match) { + query = match.sort().reverse().map(q => { + const [isUnicodePart, queryPart] = this.#convertToRegExpString(q, hasDiacritics); + isUnicode ||= isUnicodePart; + return `(${queryPart})`; + }).join("|"); + } + } + + const flags = `g${isUnicode ? "u" : ""}${caseSensitive ? "" : "i"}`; + query = new RegExp(query, flags); + this.#calculateRegExpMatch(query, entireWord, pageIndex, pageContent); + + if (this._state.highlightAll) { + this.#updatePage(pageIndex); + } + + if (this._resumePageIdx === pageIndex) { + this._resumePageIdx = null; + this.#nextPageMatch(); + } + + const pageMatchesCount = this._pageMatches[pageIndex].length; + + if (pageMatchesCount > 0) { + this._matchesCountTotal += pageMatchesCount; + this.#updateUIResultsCount(); + } + } + + #extractText() { + if (this._extractTextPromises.length > 0) { + return; + } + + let promise = Promise.resolve(); + + for (let i = 0, ii = this._linkService.pagesCount; i < ii; i++) { + const extractTextCapability = (0, _pdfjsLib.createPromiseCapability)(); + this._extractTextPromises[i] = extractTextCapability.promise; + promise = promise.then(() => { + return this._pdfDocument.getPage(i + 1).then(pdfPage => { + return pdfPage.getTextContent(); + }).then(textContent => { + const strBuf = []; + + for (const textItem of textContent.items) { + strBuf.push(textItem.str); + + if (textItem.hasEOL) { + strBuf.push("\n"); + } + } + + [this._pageContents[i], this._pageDiffs[i], this._hasDiacritics[i]] = normalize(strBuf.join("")); + extractTextCapability.resolve(); + }, reason => { + console.error(`Unable to get text content for page ${i + 1}`, reason); + this._pageContents[i] = ""; + this._pageDiffs[i] = null; + this._hasDiacritics[i] = false; + extractTextCapability.resolve(); + }); + }); + } + } + + #updatePage(index) { + if (this._scrollMatches && this._selected.pageIdx === index) { + this._linkService.page = index + 1; + } + + this._eventBus.dispatch("updatetextlayermatches", { + source: this, + pageIndex: index + }); + } + + #updateAllPages() { + this._eventBus.dispatch("updatetextlayermatches", { + source: this, + pageIndex: -1 + }); + } + + #nextMatch() { + const previous = this._state.findPrevious; + const currentPageIndex = this._linkService.page - 1; + const numPages = this._linkService.pagesCount; + this._highlightMatches = true; + + if (this._dirtyMatch) { + this._dirtyMatch = false; + this._selected.pageIdx = this._selected.matchIdx = -1; + this._offset.pageIdx = currentPageIndex; + this._offset.matchIdx = null; + this._offset.wrapped = false; + this._resumePageIdx = null; + this._pageMatches.length = 0; + this._pageMatchesLength.length = 0; + this._matchesCountTotal = 0; + this.#updateAllPages(); + + for (let i = 0; i < numPages; i++) { + if (this._pendingFindMatches.has(i)) { + continue; + } + + this._pendingFindMatches.add(i); + + this._extractTextPromises[i].then(() => { + this._pendingFindMatches.delete(i); + + this.#calculateMatch(i); + }); + } + } + + if (this.#query === "") { + this.#updateUIState(FindState.FOUND); + return; + } + + if (this._resumePageIdx) { + return; + } + + const offset = this._offset; + this._pagesToSearch = numPages; + + if (offset.matchIdx !== null) { + const numPageMatches = this._pageMatches[offset.pageIdx].length; + + if (!previous && offset.matchIdx + 1 < numPageMatches || previous && offset.matchIdx > 0) { + offset.matchIdx = previous ? offset.matchIdx - 1 : offset.matchIdx + 1; + this.#updateMatch(true); + return; + } + + this.#advanceOffsetPage(previous); + } + + this.#nextPageMatch(); + } + + #matchesReady(matches) { + const offset = this._offset; + const numMatches = matches.length; + const previous = this._state.findPrevious; + + if (numMatches) { + offset.matchIdx = previous ? numMatches - 1 : 0; + this.#updateMatch(true); + return true; + } + + this.#advanceOffsetPage(previous); + + if (offset.wrapped) { + offset.matchIdx = null; + + if (this._pagesToSearch < 0) { + this.#updateMatch(false); + return true; + } + } + + return false; + } + + #nextPageMatch() { + if (this._resumePageIdx !== null) { + console.error("There can only be one pending page."); + } + + let matches = null; + + do { + const pageIdx = this._offset.pageIdx; + matches = this._pageMatches[pageIdx]; + + if (!matches) { + this._resumePageIdx = pageIdx; + break; + } + } while (!this.#matchesReady(matches)); + } + + #advanceOffsetPage(previous) { + const offset = this._offset; + const numPages = this._linkService.pagesCount; + offset.pageIdx = previous ? offset.pageIdx - 1 : offset.pageIdx + 1; + offset.matchIdx = null; + this._pagesToSearch--; + + if (offset.pageIdx >= numPages || offset.pageIdx < 0) { + offset.pageIdx = previous ? numPages - 1 : 0; + offset.wrapped = true; + } + } + + #updateMatch(found = false) { + let state = FindState.NOT_FOUND; + const wrapped = this._offset.wrapped; + this._offset.wrapped = false; + + if (found) { + const previousPage = this._selected.pageIdx; + this._selected.pageIdx = this._offset.pageIdx; + this._selected.matchIdx = this._offset.matchIdx; + state = wrapped ? FindState.WRAPPED : FindState.FOUND; + + if (previousPage !== -1 && previousPage !== this._selected.pageIdx) { + this.#updatePage(previousPage); + } + } + + this.#updateUIState(state, this._state.findPrevious); + + if (this._selected.pageIdx !== -1) { + this._scrollMatches = true; + this.#updatePage(this._selected.pageIdx); + } + } + + #onFindBarClose(evt) { + const pdfDocument = this._pdfDocument; + + this._firstPageCapability.promise.then(() => { + if (!this._pdfDocument || pdfDocument && this._pdfDocument !== pdfDocument) { + return; + } + + if (this._findTimeout) { + clearTimeout(this._findTimeout); + this._findTimeout = null; + } + + if (this._resumePageIdx) { + this._resumePageIdx = null; + this._dirtyMatch = true; + } + + this.#updateUIState(FindState.FOUND); + this._highlightMatches = false; + this.#updateAllPages(); + }); + } + + #requestMatchesCount() { + const { + pageIdx, + matchIdx + } = this._selected; + let current = 0, + total = this._matchesCountTotal; + + if (matchIdx !== -1) { + for (let i = 0; i < pageIdx; i++) { + current += this._pageMatches[i]?.length || 0; + } + + current += matchIdx + 1; + } + + if (current < 1 || current > total) { + current = total = 0; + } + + return { + current, + total + }; + } + + #updateUIResultsCount() { + this._eventBus.dispatch("updatefindmatchescount", { + source: this, + matchesCount: this.#requestMatchesCount() + }); + } + + #updateUIState(state, previous = false) { + this._eventBus.dispatch("updatefindcontrolstate", { + source: this, + state, + previous, + matchesCount: this.#requestMatchesCount(), + rawQuery: this._state?.query ?? null + }); + } + +} + +exports.PDFFindController = PDFFindController; + +/***/ }), +/* 16 */ +/***/ ((__unused_webpack_module, exports) => { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.CharacterType = void 0; +exports.getCharacterType = getCharacterType; +const CharacterType = { + SPACE: 0, + ALPHA_LETTER: 1, + PUNCT: 2, + HAN_LETTER: 3, + KATAKANA_LETTER: 4, + HIRAGANA_LETTER: 5, + HALFWIDTH_KATAKANA_LETTER: 6, + THAI_LETTER: 7 +}; +exports.CharacterType = CharacterType; + +function isAlphabeticalScript(charCode) { + return charCode < 0x2e80; +} + +function isAscii(charCode) { + return (charCode & 0xff80) === 0; +} + +function isAsciiAlpha(charCode) { + return charCode >= 0x61 && charCode <= 0x7a || charCode >= 0x41 && charCode <= 0x5a; +} + +function isAsciiDigit(charCode) { + return charCode >= 0x30 && charCode <= 0x39; +} + +function isAsciiSpace(charCode) { + return charCode === 0x20 || charCode === 0x09 || charCode === 0x0d || charCode === 0x0a; +} + +function isHan(charCode) { + return charCode >= 0x3400 && charCode <= 0x9fff || charCode >= 0xf900 && charCode <= 0xfaff; +} + +function isKatakana(charCode) { + return charCode >= 0x30a0 && charCode <= 0x30ff; +} + +function isHiragana(charCode) { + return charCode >= 0x3040 && charCode <= 0x309f; +} + +function isHalfwidthKatakana(charCode) { + return charCode >= 0xff60 && charCode <= 0xff9f; +} + +function isThai(charCode) { + return (charCode & 0xff80) === 0x0e00; +} + +function getCharacterType(charCode) { + if (isAlphabeticalScript(charCode)) { + if (isAscii(charCode)) { + if (isAsciiSpace(charCode)) { + return CharacterType.SPACE; + } else if (isAsciiAlpha(charCode) || isAsciiDigit(charCode) || charCode === 0x5f) { + return CharacterType.ALPHA_LETTER; + } + + return CharacterType.PUNCT; + } else if (isThai(charCode)) { + return CharacterType.THAI_LETTER; + } else if (charCode === 0xa0) { + return CharacterType.SPACE; + } + + return CharacterType.ALPHA_LETTER; + } + + if (isHan(charCode)) { + return CharacterType.HAN_LETTER; + } else if (isKatakana(charCode)) { + return CharacterType.KATAKANA_LETTER; + } else if (isHiragana(charCode)) { + return CharacterType.HIRAGANA_LETTER; + } else if (isHalfwidthKatakana(charCode)) { + return CharacterType.HALFWIDTH_KATAKANA_LETTER; + } + + return CharacterType.ALPHA_LETTER; +} + +/***/ }), +/* 17 */ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.PDFHistory = void 0; +exports.isDestArraysEqual = isDestArraysEqual; +exports.isDestHashesEqual = isDestHashesEqual; + +var _ui_utils = __webpack_require__(3); + +var _event_utils = __webpack_require__(4); + +const HASH_CHANGE_TIMEOUT = 1000; +const POSITION_UPDATED_THRESHOLD = 50; +const UPDATE_VIEWAREA_TIMEOUT = 1000; + +function getCurrentHash() { + return document.location.hash; +} + +class PDFHistory { + constructor({ + linkService, + eventBus + }) { + this.linkService = linkService; + this.eventBus = eventBus; + this._initialized = false; + this._fingerprint = ""; + this.reset(); + this._boundEvents = null; + + this.eventBus._on("pagesinit", () => { + this._isPagesLoaded = false; + + this.eventBus._on("pagesloaded", evt => { + this._isPagesLoaded = !!evt.pagesCount; + }, { + once: true + }); + }); + } + + initialize({ + fingerprint, + resetHistory = false, + updateUrl = false + }) { + if (!fingerprint || typeof fingerprint !== "string") { + console.error('PDFHistory.initialize: The "fingerprint" must be a non-empty string.'); + return; + } + + if (this._initialized) { + this.reset(); + } + + const reInitialized = this._fingerprint !== "" && this._fingerprint !== fingerprint; + this._fingerprint = fingerprint; + this._updateUrl = updateUrl === true; + this._initialized = true; + + this._bindEvents(); + + const state = window.history.state; + this._popStateInProgress = false; + this._blockHashChange = 0; + this._currentHash = getCurrentHash(); + this._numPositionUpdates = 0; + this._uid = this._maxUid = 0; + this._destination = null; + this._position = null; + + if (!this._isValidState(state, true) || resetHistory) { + const { + hash, + page, + rotation + } = this._parseCurrentHash(true); + + if (!hash || reInitialized || resetHistory) { + this._pushOrReplaceState(null, true); + + return; + } + + this._pushOrReplaceState({ + hash, + page, + rotation + }, true); + + return; + } + + const destination = state.destination; + + this._updateInternalState(destination, state.uid, true); + + if (destination.rotation !== undefined) { + this._initialRotation = destination.rotation; + } + + if (destination.dest) { + this._initialBookmark = JSON.stringify(destination.dest); + this._destination.page = null; + } else if (destination.hash) { + this._initialBookmark = destination.hash; + } else if (destination.page) { + this._initialBookmark = `page=${destination.page}`; + } + } + + reset() { + if (this._initialized) { + this._pageHide(); + + this._initialized = false; + + this._unbindEvents(); + } + + if (this._updateViewareaTimeout) { + clearTimeout(this._updateViewareaTimeout); + this._updateViewareaTimeout = null; + } + + this._initialBookmark = null; + this._initialRotation = null; + } + + push({ + namedDest = null, + explicitDest, + pageNumber + }) { + if (!this._initialized) { + return; + } + + if (namedDest && typeof namedDest !== "string") { + console.error("PDFHistory.push: " + `"${namedDest}" is not a valid namedDest parameter.`); + return; + } else if (!Array.isArray(explicitDest)) { + console.error("PDFHistory.push: " + `"${explicitDest}" is not a valid explicitDest parameter.`); + return; + } else if (!this._isValidPage(pageNumber)) { + if (pageNumber !== null || this._destination) { + console.error("PDFHistory.push: " + `"${pageNumber}" is not a valid pageNumber parameter.`); + return; + } + } + + const hash = namedDest || JSON.stringify(explicitDest); + + if (!hash) { + return; + } + + let forceReplace = false; + + if (this._destination && (isDestHashesEqual(this._destination.hash, hash) || isDestArraysEqual(this._destination.dest, explicitDest))) { + if (this._destination.page) { + return; + } + + forceReplace = true; + } + + if (this._popStateInProgress && !forceReplace) { + return; + } + + this._pushOrReplaceState({ + dest: explicitDest, + hash, + page: pageNumber, + rotation: this.linkService.rotation + }, forceReplace); + + if (!this._popStateInProgress) { + this._popStateInProgress = true; + Promise.resolve().then(() => { + this._popStateInProgress = false; + }); + } + } + + pushPage(pageNumber) { + if (!this._initialized) { + return; + } + + if (!this._isValidPage(pageNumber)) { + console.error(`PDFHistory.pushPage: "${pageNumber}" is not a valid page number.`); + return; + } + + if (this._destination?.page === pageNumber) { + return; + } + + if (this._popStateInProgress) { + return; + } + + this._pushOrReplaceState({ + dest: null, + hash: `page=${pageNumber}`, + page: pageNumber, + rotation: this.linkService.rotation + }); + + if (!this._popStateInProgress) { + this._popStateInProgress = true; + Promise.resolve().then(() => { + this._popStateInProgress = false; + }); + } + } + + pushCurrentPosition() { + if (!this._initialized || this._popStateInProgress) { + return; + } + + this._tryPushCurrentPosition(); + } + + back() { + if (!this._initialized || this._popStateInProgress) { + return; + } + + const state = window.history.state; + + if (this._isValidState(state) && state.uid > 0) { + window.history.back(); + } + } + + forward() { + if (!this._initialized || this._popStateInProgress) { + return; + } + + const state = window.history.state; + + if (this._isValidState(state) && state.uid < this._maxUid) { + window.history.forward(); + } + } + + get popStateInProgress() { + return this._initialized && (this._popStateInProgress || this._blockHashChange > 0); + } + + get initialBookmark() { + return this._initialized ? this._initialBookmark : null; + } + + get initialRotation() { + return this._initialized ? this._initialRotation : null; + } + + _pushOrReplaceState(destination, forceReplace = false) { + const shouldReplace = forceReplace || !this._destination; + const newState = { + fingerprint: this._fingerprint, + uid: shouldReplace ? this._uid : this._uid + 1, + destination + }; + + this._updateInternalState(destination, newState.uid); + + let newUrl; + + if (this._updateUrl && destination?.hash) { + const baseUrl = document.location.href.split("#")[0]; + + if (!baseUrl.startsWith("file://")) { + newUrl = `${baseUrl}#${destination.hash}`; + } + } + + if (shouldReplace) { + window.history.replaceState(newState, "", newUrl); + } else { + window.history.pushState(newState, "", newUrl); + } + } + + _tryPushCurrentPosition(temporary = false) { + if (!this._position) { + return; + } + + let position = this._position; + + if (temporary) { + position = Object.assign(Object.create(null), this._position); + position.temporary = true; + } + + if (!this._destination) { + this._pushOrReplaceState(position); + + return; + } + + if (this._destination.temporary) { + this._pushOrReplaceState(position, true); + + return; + } + + if (this._destination.hash === position.hash) { + return; + } + + if (!this._destination.page && (POSITION_UPDATED_THRESHOLD <= 0 || this._numPositionUpdates <= POSITION_UPDATED_THRESHOLD)) { + return; + } + + let forceReplace = false; + + if (this._destination.page >= position.first && this._destination.page <= position.page) { + if (this._destination.dest !== undefined || !this._destination.first) { + return; + } + + forceReplace = true; + } + + this._pushOrReplaceState(position, forceReplace); + } + + _isValidPage(val) { + return Number.isInteger(val) && val > 0 && val <= this.linkService.pagesCount; + } + + _isValidState(state, checkReload = false) { + if (!state) { + return false; + } + + if (state.fingerprint !== this._fingerprint) { + if (checkReload) { + if (typeof state.fingerprint !== "string" || state.fingerprint.length !== this._fingerprint.length) { + return false; + } + + const [perfEntry] = performance.getEntriesByType("navigation"); + + if (perfEntry?.type !== "reload") { + return false; + } + } else { + return false; + } + } + + if (!Number.isInteger(state.uid) || state.uid < 0) { + return false; + } + + if (state.destination === null || typeof state.destination !== "object") { + return false; + } + + return true; + } + + _updateInternalState(destination, uid, removeTemporary = false) { + if (this._updateViewareaTimeout) { + clearTimeout(this._updateViewareaTimeout); + this._updateViewareaTimeout = null; + } + + if (removeTemporary && destination?.temporary) { + delete destination.temporary; + } + + this._destination = destination; + this._uid = uid; + this._maxUid = Math.max(this._maxUid, uid); + this._numPositionUpdates = 0; + } + + _parseCurrentHash(checkNameddest = false) { + const hash = unescape(getCurrentHash()).substring(1); + const params = (0, _ui_utils.parseQueryString)(hash); + const nameddest = params.get("nameddest") || ""; + let page = params.get("page") | 0; + + if (!this._isValidPage(page) || checkNameddest && nameddest.length > 0) { + page = null; + } + + return { + hash, + page, + rotation: this.linkService.rotation + }; + } + + _updateViewarea({ + location + }) { + if (this._updateViewareaTimeout) { + clearTimeout(this._updateViewareaTimeout); + this._updateViewareaTimeout = null; + } + + this._position = { + hash: location.pdfOpenParams.substring(1), + page: this.linkService.page, + first: location.pageNumber, + rotation: location.rotation + }; + + if (this._popStateInProgress) { + return; + } + + if (POSITION_UPDATED_THRESHOLD > 0 && this._isPagesLoaded && this._destination && !this._destination.page) { + this._numPositionUpdates++; + } + + if (UPDATE_VIEWAREA_TIMEOUT > 0) { + this._updateViewareaTimeout = setTimeout(() => { + if (!this._popStateInProgress) { + this._tryPushCurrentPosition(true); + } + + this._updateViewareaTimeout = null; + }, UPDATE_VIEWAREA_TIMEOUT); + } + } + + _popState({ + state + }) { + const newHash = getCurrentHash(), + hashChanged = this._currentHash !== newHash; + this._currentHash = newHash; + + if (!state) { + this._uid++; + + const { + hash, + page, + rotation + } = this._parseCurrentHash(); + + this._pushOrReplaceState({ + hash, + page, + rotation + }, true); + + return; + } + + if (!this._isValidState(state)) { + return; + } + + this._popStateInProgress = true; + + if (hashChanged) { + this._blockHashChange++; + (0, _event_utils.waitOnEventOrTimeout)({ + target: window, + name: "hashchange", + delay: HASH_CHANGE_TIMEOUT + }).then(() => { + this._blockHashChange--; + }); + } + + const destination = state.destination; + + this._updateInternalState(destination, state.uid, true); + + if ((0, _ui_utils.isValidRotation)(destination.rotation)) { + this.linkService.rotation = destination.rotation; + } + + if (destination.dest) { + this.linkService.goToDestination(destination.dest); + } else if (destination.hash) { + this.linkService.setHash(destination.hash); + } else if (destination.page) { + this.linkService.page = destination.page; + } + + Promise.resolve().then(() => { + this._popStateInProgress = false; + }); + } + + _pageHide() { + if (!this._destination || this._destination.temporary) { + this._tryPushCurrentPosition(); + } + } + + _bindEvents() { + if (this._boundEvents) { + return; + } + + this._boundEvents = { + updateViewarea: this._updateViewarea.bind(this), + popState: this._popState.bind(this), + pageHide: this._pageHide.bind(this) + }; + + this.eventBus._on("updateviewarea", this._boundEvents.updateViewarea); + + window.addEventListener("popstate", this._boundEvents.popState); + window.addEventListener("pagehide", this._boundEvents.pageHide); + } + + _unbindEvents() { + if (!this._boundEvents) { + return; + } + + this.eventBus._off("updateviewarea", this._boundEvents.updateViewarea); + + window.removeEventListener("popstate", this._boundEvents.popState); + window.removeEventListener("pagehide", this._boundEvents.pageHide); + this._boundEvents = null; + } + +} + +exports.PDFHistory = PDFHistory; + +function isDestHashesEqual(destHash, pushHash) { + if (typeof destHash !== "string" || typeof pushHash !== "string") { + return false; + } + + if (destHash === pushHash) { + return true; + } + + const nameddest = (0, _ui_utils.parseQueryString)(destHash).get("nameddest"); + + if (nameddest === pushHash) { + return true; + } + + return false; +} + +function isDestArraysEqual(firstDest, secondDest) { + function isEntryEqual(first, second) { + if (typeof first !== typeof second) { + return false; + } + + if (Array.isArray(first) || Array.isArray(second)) { + return false; + } + + if (first !== null && typeof first === "object" && second !== null) { + if (Object.keys(first).length !== Object.keys(second).length) { + return false; + } + + for (const key in first) { + if (!isEntryEqual(first[key], second[key])) { + return false; + } + } + + return true; + } + + return first === second || Number.isNaN(first) && Number.isNaN(second); + } + + if (!(Array.isArray(firstDest) && Array.isArray(secondDest))) { + return false; + } + + if (firstDest.length !== secondDest.length) { + return false; + } + + for (let i = 0, ii = firstDest.length; i < ii; i++) { + if (!isEntryEqual(firstDest[i], secondDest[i])) { + return false; + } + } + + return true; +} + +/***/ }), +/* 18 */ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.PDFLayerViewer = void 0; + +var _base_tree_viewer = __webpack_require__(12); + +class PDFLayerViewer extends _base_tree_viewer.BaseTreeViewer { + constructor(options) { + super(options); + this.l10n = options.l10n; + + this.eventBus._on("resetlayers", this._resetLayers.bind(this)); + + this.eventBus._on("togglelayerstree", this._toggleAllTreeItems.bind(this)); + } + + reset() { + super.reset(); + this._optionalContentConfig = null; + } + + _dispatchEvent(layersCount) { + this.eventBus.dispatch("layersloaded", { + source: this, + layersCount + }); + } + + _bindLink(element, { + groupId, + input + }) { + const setVisibility = () => { + this._optionalContentConfig.setVisibility(groupId, input.checked); + + this.eventBus.dispatch("optionalcontentconfig", { + source: this, + promise: Promise.resolve(this._optionalContentConfig) + }); + }; + + element.onclick = evt => { + if (evt.target === input) { + setVisibility(); + return true; + } else if (evt.target !== element) { + return true; + } + + input.checked = !input.checked; + setVisibility(); + return false; + }; + } + + async _setNestedName(element, { + name = null + }) { + if (typeof name === "string") { + element.textContent = this._normalizeTextContent(name); + return; + } + + element.textContent = await this.l10n.get("additional_layers"); + element.style.fontStyle = "italic"; + } + + _addToggleButton(div, { + name = null + }) { + super._addToggleButton(div, name === null); + } + + _toggleAllTreeItems() { + if (!this._optionalContentConfig) { + return; + } + + super._toggleAllTreeItems(); + } + + render({ + optionalContentConfig, + pdfDocument + }) { + if (this._optionalContentConfig) { + this.reset(); + } + + this._optionalContentConfig = optionalContentConfig || null; + this._pdfDocument = pdfDocument || null; + const groups = optionalContentConfig?.getOrder(); + + if (!groups) { + this._dispatchEvent(0); + + return; + } + + const fragment = document.createDocumentFragment(), + queue = [{ + parent: fragment, + groups + }]; + let layersCount = 0, + hasAnyNesting = false; + + while (queue.length > 0) { + const levelData = queue.shift(); + + for (const groupId of levelData.groups) { + const div = document.createElement("div"); + div.className = "treeItem"; + const element = document.createElement("a"); + div.appendChild(element); + + if (typeof groupId === "object") { + hasAnyNesting = true; + + this._addToggleButton(div, groupId); + + this._setNestedName(element, groupId); + + const itemsDiv = document.createElement("div"); + itemsDiv.className = "treeItems"; + div.appendChild(itemsDiv); + queue.push({ + parent: itemsDiv, + groups: groupId.order + }); + } else { + const group = optionalContentConfig.getGroup(groupId); + const input = document.createElement("input"); + + this._bindLink(element, { + groupId, + input + }); + + input.type = "checkbox"; + input.id = groupId; + input.checked = group.visible; + const label = document.createElement("label"); + label.setAttribute("for", groupId); + label.textContent = this._normalizeTextContent(group.name); + element.appendChild(input); + element.appendChild(label); + layersCount++; + } + + levelData.parent.appendChild(div); + } + } + + this._finishRendering(fragment, layersCount, hasAnyNesting); + } + + async _resetLayers() { + if (!this._optionalContentConfig) { + return; + } + + const optionalContentConfig = await this._pdfDocument.getOptionalContentConfig(); + this.eventBus.dispatch("optionalcontentconfig", { + source: this, + promise: Promise.resolve(optionalContentConfig) + }); + this.render({ + optionalContentConfig, + pdfDocument: this._pdfDocument + }); + } + +} + +exports.PDFLayerViewer = PDFLayerViewer; + +/***/ }), +/* 19 */ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.PDFOutlineViewer = void 0; + +var _base_tree_viewer = __webpack_require__(12); + +var _pdfjsLib = __webpack_require__(5); + +var _ui_utils = __webpack_require__(3); + +class PDFOutlineViewer extends _base_tree_viewer.BaseTreeViewer { + constructor(options) { + super(options); + this.linkService = options.linkService; + + this.eventBus._on("toggleoutlinetree", this._toggleAllTreeItems.bind(this)); + + this.eventBus._on("currentoutlineitem", this._currentOutlineItem.bind(this)); + + this.eventBus._on("pagechanging", evt => { + this._currentPageNumber = evt.pageNumber; + }); + + this.eventBus._on("pagesloaded", evt => { + this._isPagesLoaded = !!evt.pagesCount; + + if (this._currentOutlineItemCapability && !this._currentOutlineItemCapability.settled) { + this._currentOutlineItemCapability.resolve(this._isPagesLoaded); + } + }); + + this.eventBus._on("sidebarviewchanged", evt => { + this._sidebarView = evt.view; + }); + } + + reset() { + super.reset(); + this._outline = null; + this._pageNumberToDestHashCapability = null; + this._currentPageNumber = 1; + this._isPagesLoaded = null; + + if (this._currentOutlineItemCapability && !this._currentOutlineItemCapability.settled) { + this._currentOutlineItemCapability.resolve(false); + } + + this._currentOutlineItemCapability = null; + } + + _dispatchEvent(outlineCount) { + this._currentOutlineItemCapability = (0, _pdfjsLib.createPromiseCapability)(); + + if (outlineCount === 0 || this._pdfDocument?.loadingParams.disableAutoFetch) { + this._currentOutlineItemCapability.resolve(false); + } else if (this._isPagesLoaded !== null) { + this._currentOutlineItemCapability.resolve(this._isPagesLoaded); + } + + this.eventBus.dispatch("outlineloaded", { + source: this, + outlineCount, + currentOutlineItemPromise: this._currentOutlineItemCapability.promise + }); + } + + _bindLink(element, { + url, + newWindow, + dest + }) { + const { + linkService + } = this; + + if (url) { + linkService.addLinkAttributes(element, url, newWindow); + return; + } + + element.href = linkService.getDestinationHash(dest); + + element.onclick = evt => { + this._updateCurrentTreeItem(evt.target.parentNode); + + if (dest) { + linkService.goToDestination(dest); + } + + return false; + }; + } + + _setStyles(element, { + bold, + italic + }) { + if (bold) { + element.style.fontWeight = "bold"; + } + + if (italic) { + element.style.fontStyle = "italic"; + } + } + + _addToggleButton(div, { + count, + items + }) { + let hidden = false; + + if (count < 0) { + let totalCount = items.length; + + if (totalCount > 0) { + const queue = [...items]; + + while (queue.length > 0) { + const { + count: nestedCount, + items: nestedItems + } = queue.shift(); + + if (nestedCount > 0 && nestedItems.length > 0) { + totalCount += nestedItems.length; + queue.push(...nestedItems); + } + } + } + + if (Math.abs(count) === totalCount) { + hidden = true; + } + } + + super._addToggleButton(div, hidden); + } + + _toggleAllTreeItems() { + if (!this._outline) { + return; + } + + super._toggleAllTreeItems(); + } + + render({ + outline, + pdfDocument + }) { + if (this._outline) { + this.reset(); + } + + this._outline = outline || null; + this._pdfDocument = pdfDocument || null; + + if (!outline) { + this._dispatchEvent(0); + + return; + } + + const fragment = document.createDocumentFragment(); + const queue = [{ + parent: fragment, + items: outline + }]; + let outlineCount = 0, + hasAnyNesting = false; + + while (queue.length > 0) { + const levelData = queue.shift(); + + for (const item of levelData.items) { + const div = document.createElement("div"); + div.className = "treeItem"; + const element = document.createElement("a"); + + this._bindLink(element, item); + + this._setStyles(element, item); + + element.textContent = this._normalizeTextContent(item.title); + div.appendChild(element); + + if (item.items.length > 0) { + hasAnyNesting = true; + + this._addToggleButton(div, item); + + const itemsDiv = document.createElement("div"); + itemsDiv.className = "treeItems"; + div.appendChild(itemsDiv); + queue.push({ + parent: itemsDiv, + items: item.items + }); + } + + levelData.parent.appendChild(div); + outlineCount++; + } + } + + this._finishRendering(fragment, outlineCount, hasAnyNesting); + } + + async _currentOutlineItem() { + if (!this._isPagesLoaded) { + throw new Error("_currentOutlineItem: All pages have not been loaded."); + } + + if (!this._outline || !this._pdfDocument) { + return; + } + + const pageNumberToDestHash = await this._getPageNumberToDestHash(this._pdfDocument); + + if (!pageNumberToDestHash) { + return; + } + + this._updateCurrentTreeItem(null); + + if (this._sidebarView !== _ui_utils.SidebarView.OUTLINE) { + return; + } + + for (let i = this._currentPageNumber; i > 0; i--) { + const destHash = pageNumberToDestHash.get(i); + + if (!destHash) { + continue; + } + + const linkElement = this.container.querySelector(`a[href="${destHash}"]`); + + if (!linkElement) { + continue; + } + + this._scrollToCurrentTreeItem(linkElement.parentNode); + + break; + } + } + + async _getPageNumberToDestHash(pdfDocument) { + if (this._pageNumberToDestHashCapability) { + return this._pageNumberToDestHashCapability.promise; + } + + this._pageNumberToDestHashCapability = (0, _pdfjsLib.createPromiseCapability)(); + const pageNumberToDestHash = new Map(), + pageNumberNesting = new Map(); + const queue = [{ + nesting: 0, + items: this._outline + }]; + + while (queue.length > 0) { + const levelData = queue.shift(), + currentNesting = levelData.nesting; + + for (const { + dest, + items + } of levelData.items) { + let explicitDest, pageNumber; + + if (typeof dest === "string") { + explicitDest = await pdfDocument.getDestination(dest); + + if (pdfDocument !== this._pdfDocument) { + return null; + } + } else { + explicitDest = dest; + } + + if (Array.isArray(explicitDest)) { + const [destRef] = explicitDest; + + if (typeof destRef === "object" && destRef !== null) { + pageNumber = this.linkService._cachedPageNumber(destRef); + + if (!pageNumber) { + try { + pageNumber = (await pdfDocument.getPageIndex(destRef)) + 1; + + if (pdfDocument !== this._pdfDocument) { + return null; + } + + this.linkService.cachePageRef(pageNumber, destRef); + } catch (ex) {} + } + } else if (Number.isInteger(destRef)) { + pageNumber = destRef + 1; + } + + if (Number.isInteger(pageNumber) && (!pageNumberToDestHash.has(pageNumber) || currentNesting > pageNumberNesting.get(pageNumber))) { + const destHash = this.linkService.getDestinationHash(dest); + pageNumberToDestHash.set(pageNumber, destHash); + pageNumberNesting.set(pageNumber, currentNesting); + } + } + + if (items.length > 0) { + queue.push({ + nesting: currentNesting + 1, + items + }); + } + } + } + + this._pageNumberToDestHashCapability.resolve(pageNumberToDestHash.size > 0 ? pageNumberToDestHash : null); + + return this._pageNumberToDestHashCapability.promise; + } + +} + +exports.PDFOutlineViewer = PDFOutlineViewer; + +/***/ }), +/* 20 */ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.PDFPresentationMode = void 0; + +var _ui_utils = __webpack_require__(3); + +const DELAY_BEFORE_HIDING_CONTROLS = 3000; +const ACTIVE_SELECTOR = "pdfPresentationMode"; +const CONTROLS_SELECTOR = "pdfPresentationModeControls"; +const MOUSE_SCROLL_COOLDOWN_TIME = 50; +const PAGE_SWITCH_THRESHOLD = 0.1; +const SWIPE_MIN_DISTANCE_THRESHOLD = 50; +const SWIPE_ANGLE_THRESHOLD = Math.PI / 6; + +class PDFPresentationMode { + #state = _ui_utils.PresentationModeState.UNKNOWN; + #args = null; + + constructor({ + container, + pdfViewer, + eventBus + }) { + this.container = container; + this.pdfViewer = pdfViewer; + this.eventBus = eventBus; + this.contextMenuOpen = false; + this.mouseScrollTimeStamp = 0; + this.mouseScrollDelta = 0; + this.touchSwipeState = null; + } + + async request() { + const { + container, + pdfViewer + } = this; + + if (this.active || !pdfViewer.pagesCount || !container.requestFullscreen) { + return false; + } + + this.#addFullscreenChangeListeners(); + this.#notifyStateChange(_ui_utils.PresentationModeState.CHANGING); + const promise = container.requestFullscreen(); + this.#args = { + pageNumber: pdfViewer.currentPageNumber, + scaleValue: pdfViewer.currentScaleValue, + scrollMode: pdfViewer.scrollMode, + spreadMode: null + }; + + if (pdfViewer.spreadMode !== _ui_utils.SpreadMode.NONE && !(pdfViewer.pageViewsReady && pdfViewer.hasEqualPageSizes)) { + console.warn("Ignoring Spread modes when entering PresentationMode, " + "since the document may contain varying page sizes."); + this.#args.spreadMode = pdfViewer.spreadMode; + } + + try { + await promise; + return true; + } catch (reason) { + this.#removeFullscreenChangeListeners(); + this.#notifyStateChange(_ui_utils.PresentationModeState.NORMAL); + } + + return false; + } + + get active() { + return this.#state === _ui_utils.PresentationModeState.CHANGING || this.#state === _ui_utils.PresentationModeState.FULLSCREEN; + } + + #mouseWheel(evt) { + if (!this.active) { + return; + } + + evt.preventDefault(); + const delta = (0, _ui_utils.normalizeWheelEventDelta)(evt); + const currentTime = Date.now(); + const storedTime = this.mouseScrollTimeStamp; + + if (currentTime > storedTime && currentTime - storedTime < MOUSE_SCROLL_COOLDOWN_TIME) { + return; + } + + if (this.mouseScrollDelta > 0 && delta < 0 || this.mouseScrollDelta < 0 && delta > 0) { + this.#resetMouseScrollState(); + } + + this.mouseScrollDelta += delta; + + if (Math.abs(this.mouseScrollDelta) >= PAGE_SWITCH_THRESHOLD) { + const totalDelta = this.mouseScrollDelta; + this.#resetMouseScrollState(); + const success = totalDelta > 0 ? this.pdfViewer.previousPage() : this.pdfViewer.nextPage(); + + if (success) { + this.mouseScrollTimeStamp = currentTime; + } + } + } + + #notifyStateChange(state) { + this.#state = state; + this.eventBus.dispatch("presentationmodechanged", { + source: this, + state + }); + } + + #enter() { + this.#notifyStateChange(_ui_utils.PresentationModeState.FULLSCREEN); + this.container.classList.add(ACTIVE_SELECTOR); + setTimeout(() => { + this.pdfViewer.scrollMode = _ui_utils.ScrollMode.PAGE; + + if (this.#args.spreadMode !== null) { + this.pdfViewer.spreadMode = _ui_utils.SpreadMode.NONE; + } + + this.pdfViewer.currentPageNumber = this.#args.pageNumber; + this.pdfViewer.currentScaleValue = "page-fit"; + }, 0); + this.#addWindowListeners(); + this.#showControls(); + this.contextMenuOpen = false; + window.getSelection().removeAllRanges(); + } + + #exit() { + const pageNumber = this.pdfViewer.currentPageNumber; + this.container.classList.remove(ACTIVE_SELECTOR); + setTimeout(() => { + this.#removeFullscreenChangeListeners(); + this.#notifyStateChange(_ui_utils.PresentationModeState.NORMAL); + this.pdfViewer.scrollMode = this.#args.scrollMode; + + if (this.#args.spreadMode !== null) { + this.pdfViewer.spreadMode = this.#args.spreadMode; + } + + this.pdfViewer.currentScaleValue = this.#args.scaleValue; + this.pdfViewer.currentPageNumber = pageNumber; + this.#args = null; + }, 0); + this.#removeWindowListeners(); + this.#hideControls(); + this.#resetMouseScrollState(); + this.contextMenuOpen = false; + } + + #mouseDown(evt) { + if (this.contextMenuOpen) { + this.contextMenuOpen = false; + evt.preventDefault(); + return; + } + + if (evt.button === 0) { + const isInternalLink = evt.target.href && evt.target.classList.contains("internalLink"); + + if (!isInternalLink) { + evt.preventDefault(); + + if (evt.shiftKey) { + this.pdfViewer.previousPage(); + } else { + this.pdfViewer.nextPage(); + } + } + } + } + + #contextMenu() { + this.contextMenuOpen = true; + } + + #showControls() { + if (this.controlsTimeout) { + clearTimeout(this.controlsTimeout); + } else { + this.container.classList.add(CONTROLS_SELECTOR); + } + + this.controlsTimeout = setTimeout(() => { + this.container.classList.remove(CONTROLS_SELECTOR); + delete this.controlsTimeout; + }, DELAY_BEFORE_HIDING_CONTROLS); + } + + #hideControls() { + if (!this.controlsTimeout) { + return; + } + + clearTimeout(this.controlsTimeout); + this.container.classList.remove(CONTROLS_SELECTOR); + delete this.controlsTimeout; + } + + #resetMouseScrollState() { + this.mouseScrollTimeStamp = 0; + this.mouseScrollDelta = 0; + } + + #touchSwipe(evt) { + if (!this.active) { + return; + } + + if (evt.touches.length > 1) { + this.touchSwipeState = null; + return; + } + + switch (evt.type) { + case "touchstart": + this.touchSwipeState = { + startX: evt.touches[0].pageX, + startY: evt.touches[0].pageY, + endX: evt.touches[0].pageX, + endY: evt.touches[0].pageY + }; + break; + + case "touchmove": + if (this.touchSwipeState === null) { + return; + } + + this.touchSwipeState.endX = evt.touches[0].pageX; + this.touchSwipeState.endY = evt.touches[0].pageY; + evt.preventDefault(); + break; + + case "touchend": + if (this.touchSwipeState === null) { + return; + } + + let delta = 0; + const dx = this.touchSwipeState.endX - this.touchSwipeState.startX; + const dy = this.touchSwipeState.endY - this.touchSwipeState.startY; + const absAngle = Math.abs(Math.atan2(dy, dx)); + + if (Math.abs(dx) > SWIPE_MIN_DISTANCE_THRESHOLD && (absAngle <= SWIPE_ANGLE_THRESHOLD || absAngle >= Math.PI - SWIPE_ANGLE_THRESHOLD)) { + delta = dx; + } else if (Math.abs(dy) > SWIPE_MIN_DISTANCE_THRESHOLD && Math.abs(absAngle - Math.PI / 2) <= SWIPE_ANGLE_THRESHOLD) { + delta = dy; + } + + if (delta > 0) { + this.pdfViewer.previousPage(); + } else if (delta < 0) { + this.pdfViewer.nextPage(); + } + + break; + } + } + + #addWindowListeners() { + this.showControlsBind = this.#showControls.bind(this); + this.mouseDownBind = this.#mouseDown.bind(this); + this.mouseWheelBind = this.#mouseWheel.bind(this); + this.resetMouseScrollStateBind = this.#resetMouseScrollState.bind(this); + this.contextMenuBind = this.#contextMenu.bind(this); + this.touchSwipeBind = this.#touchSwipe.bind(this); + window.addEventListener("mousemove", this.showControlsBind); + window.addEventListener("mousedown", this.mouseDownBind); + window.addEventListener("wheel", this.mouseWheelBind, { + passive: false + }); + window.addEventListener("keydown", this.resetMouseScrollStateBind); + window.addEventListener("contextmenu", this.contextMenuBind); + window.addEventListener("touchstart", this.touchSwipeBind); + window.addEventListener("touchmove", this.touchSwipeBind); + window.addEventListener("touchend", this.touchSwipeBind); + } + + #removeWindowListeners() { + window.removeEventListener("mousemove", this.showControlsBind); + window.removeEventListener("mousedown", this.mouseDownBind); + window.removeEventListener("wheel", this.mouseWheelBind, { + passive: false + }); + window.removeEventListener("keydown", this.resetMouseScrollStateBind); + window.removeEventListener("contextmenu", this.contextMenuBind); + window.removeEventListener("touchstart", this.touchSwipeBind); + window.removeEventListener("touchmove", this.touchSwipeBind); + window.removeEventListener("touchend", this.touchSwipeBind); + delete this.showControlsBind; + delete this.mouseDownBind; + delete this.mouseWheelBind; + delete this.resetMouseScrollStateBind; + delete this.contextMenuBind; + delete this.touchSwipeBind; + } + + #fullscreenChange() { + if (document.fullscreenElement) { + this.#enter(); + } else { + this.#exit(); + } + } + + #addFullscreenChangeListeners() { + this.fullscreenChangeBind = this.#fullscreenChange.bind(this); + window.addEventListener("fullscreenchange", this.fullscreenChangeBind); + } + + #removeFullscreenChangeListeners() { + window.removeEventListener("fullscreenchange", this.fullscreenChangeBind); + delete this.fullscreenChangeBind; + } + +} + +exports.PDFPresentationMode = PDFPresentationMode; + +/***/ }), +/* 21 */ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.PDFRenderingQueue = void 0; + +var _pdfjsLib = __webpack_require__(5); + +var _ui_utils = __webpack_require__(3); + +const CLEANUP_TIMEOUT = 30000; + +class PDFRenderingQueue { + constructor() { + this.pdfViewer = null; + this.pdfThumbnailViewer = null; + this.onIdle = null; + this.highestPriorityPage = null; + this.idleTimeout = null; + this.printing = false; + this.isThumbnailViewEnabled = false; + } + + setViewer(pdfViewer) { + this.pdfViewer = pdfViewer; + } + + setThumbnailViewer(pdfThumbnailViewer) { + this.pdfThumbnailViewer = pdfThumbnailViewer; + } + + isHighestPriority(view) { + return this.highestPriorityPage === view.renderingId; + } + + hasViewer() { + return !!this.pdfViewer; + } + + renderHighestPriority(currentlyVisiblePages) { + if (this.idleTimeout) { + clearTimeout(this.idleTimeout); + this.idleTimeout = null; + } + + if (this.pdfViewer.forceRendering(currentlyVisiblePages)) { + return; + } + + if (this.isThumbnailViewEnabled && this.pdfThumbnailViewer?.forceRendering()) { + return; + } + + if (this.printing) { + return; + } + + if (this.onIdle) { + this.idleTimeout = setTimeout(this.onIdle.bind(this), CLEANUP_TIMEOUT); + } + } + + getHighestPriority(visible, views, scrolledDown, preRenderExtra = false) { + const visibleViews = visible.views, + numVisible = visibleViews.length; + + if (numVisible === 0) { + return null; + } + + for (let i = 0; i < numVisible; i++) { + const view = visibleViews[i].view; + + if (!this.isViewFinished(view)) { + return view; + } + } + + const firstId = visible.first.id, + lastId = visible.last.id; + + if (lastId - firstId + 1 > numVisible) { + const visibleIds = visible.ids; + + for (let i = 1, ii = lastId - firstId; i < ii; i++) { + const holeId = scrolledDown ? firstId + i : lastId - i; + + if (visibleIds.has(holeId)) { + continue; + } + + const holeView = views[holeId - 1]; + + if (!this.isViewFinished(holeView)) { + return holeView; + } + } + } + + let preRenderIndex = scrolledDown ? lastId : firstId - 2; + let preRenderView = views[preRenderIndex]; + + if (preRenderView && !this.isViewFinished(preRenderView)) { + return preRenderView; + } + + if (preRenderExtra) { + preRenderIndex += scrolledDown ? 1 : -1; + preRenderView = views[preRenderIndex]; + + if (preRenderView && !this.isViewFinished(preRenderView)) { + return preRenderView; + } + } + + return null; + } + + isViewFinished(view) { + return view.renderingState === _ui_utils.RenderingStates.FINISHED; + } + + renderView(view) { + switch (view.renderingState) { + case _ui_utils.RenderingStates.FINISHED: + return false; + + case _ui_utils.RenderingStates.PAUSED: + this.highestPriorityPage = view.renderingId; + view.resume(); + break; + + case _ui_utils.RenderingStates.RUNNING: + this.highestPriorityPage = view.renderingId; + break; + + case _ui_utils.RenderingStates.INITIAL: + this.highestPriorityPage = view.renderingId; + view.draw().finally(() => { + this.renderHighestPriority(); + }).catch(reason => { + if (reason instanceof _pdfjsLib.RenderingCancelledException) { + return; + } + + console.error(`renderView: "${reason}"`); + }); + break; + } + + return true; + } + +} + +exports.PDFRenderingQueue = PDFRenderingQueue; + +/***/ }), +/* 22 */ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.PDFScriptingManager = void 0; + +var _ui_utils = __webpack_require__(3); + +var _pdfjsLib = __webpack_require__(5); + +class PDFScriptingManager { + constructor({ + eventBus, + sandboxBundleSrc = null, + scriptingFactory = null, + docPropertiesLookup = null + }) { + this._pdfDocument = null; + this._pdfViewer = null; + this._closeCapability = null; + this._destroyCapability = null; + this._scripting = null; + this._mouseState = Object.create(null); + this._ready = false; + this._eventBus = eventBus; + this._sandboxBundleSrc = sandboxBundleSrc; + this._scriptingFactory = scriptingFactory; + this._docPropertiesLookup = docPropertiesLookup; + } + + setViewer(pdfViewer) { + this._pdfViewer = pdfViewer; + } + + async setDocument(pdfDocument) { + if (this._pdfDocument) { + await this._destroyScripting(); + } + + this._pdfDocument = pdfDocument; + + if (!pdfDocument) { + return; + } + + const [objects, calculationOrder, docActions] = await Promise.all([pdfDocument.getFieldObjects(), pdfDocument.getCalculationOrderIds(), pdfDocument.getJSActions()]); + + if (!objects && !docActions) { + await this._destroyScripting(); + return; + } + + if (pdfDocument !== this._pdfDocument) { + return; + } + + try { + this._scripting = this._createScripting(); + } catch (error) { + console.error(`PDFScriptingManager.setDocument: "${error?.message}".`); + await this._destroyScripting(); + return; + } + + this._internalEvents.set("updatefromsandbox", event => { + if (event?.source !== window) { + return; + } + + this._updateFromSandbox(event.detail); + }); + + this._internalEvents.set("dispatcheventinsandbox", event => { + this._scripting?.dispatchEventInSandbox(event.detail); + }); + + this._internalEvents.set("pagechanging", ({ + pageNumber, + previous + }) => { + if (pageNumber === previous) { + return; + } + + this._dispatchPageClose(previous); + + this._dispatchPageOpen(pageNumber); + }); + + this._internalEvents.set("pagerendered", ({ + pageNumber + }) => { + if (!this._pageOpenPending.has(pageNumber)) { + return; + } + + if (pageNumber !== this._pdfViewer.currentPageNumber) { + return; + } + + this._dispatchPageOpen(pageNumber); + }); + + this._internalEvents.set("pagesdestroy", async event => { + await this._dispatchPageClose(this._pdfViewer.currentPageNumber); + await this._scripting?.dispatchEventInSandbox({ + id: "doc", + name: "WillClose" + }); + this._closeCapability?.resolve(); + }); + + this._domEvents.set("mousedown", event => { + this._mouseState.isDown = true; + }); + + this._domEvents.set("mouseup", event => { + this._mouseState.isDown = false; + }); + + for (const [name, listener] of this._internalEvents) { + this._eventBus._on(name, listener); + } + + for (const [name, listener] of this._domEvents) { + window.addEventListener(name, listener, true); + } + + try { + const docProperties = await this._getDocProperties(); + + if (pdfDocument !== this._pdfDocument) { + return; + } + + await this._scripting.createSandbox({ + objects, + calculationOrder, + appInfo: { + platform: navigator.platform, + language: navigator.language + }, + docInfo: { ...docProperties, + actions: docActions + } + }); + + this._eventBus.dispatch("sandboxcreated", { + source: this + }); + } catch (error) { + console.error(`PDFScriptingManager.setDocument: "${error?.message}".`); + await this._destroyScripting(); + return; + } + + await this._scripting?.dispatchEventInSandbox({ + id: "doc", + name: "Open" + }); + await this._dispatchPageOpen(this._pdfViewer.currentPageNumber, true); + Promise.resolve().then(() => { + if (pdfDocument === this._pdfDocument) { + this._ready = true; + } + }); + } + + async dispatchWillSave(detail) { + return this._scripting?.dispatchEventInSandbox({ + id: "doc", + name: "WillSave" + }); + } + + async dispatchDidSave(detail) { + return this._scripting?.dispatchEventInSandbox({ + id: "doc", + name: "DidSave" + }); + } + + async dispatchWillPrint(detail) { + return this._scripting?.dispatchEventInSandbox({ + id: "doc", + name: "WillPrint" + }); + } + + async dispatchDidPrint(detail) { + return this._scripting?.dispatchEventInSandbox({ + id: "doc", + name: "DidPrint" + }); + } + + get mouseState() { + return this._mouseState; + } + + get destroyPromise() { + return this._destroyCapability?.promise || null; + } + + get ready() { + return this._ready; + } + + get _internalEvents() { + return (0, _pdfjsLib.shadow)(this, "_internalEvents", new Map()); + } + + get _domEvents() { + return (0, _pdfjsLib.shadow)(this, "_domEvents", new Map()); + } + + get _pageOpenPending() { + return (0, _pdfjsLib.shadow)(this, "_pageOpenPending", new Set()); + } + + get _visitedPages() { + return (0, _pdfjsLib.shadow)(this, "_visitedPages", new Map()); + } + + async _updateFromSandbox(detail) { + const isInPresentationMode = this._pdfViewer.isInPresentationMode || this._pdfViewer.isChangingPresentationMode; + const { + id, + siblings, + command, + value + } = detail; + + if (!id) { + switch (command) { + case "clear": + console.clear(); + break; + + case "error": + console.error(value); + break; + + case "layout": + if (isInPresentationMode) { + return; + } + + const modes = (0, _ui_utils.apiPageLayoutToViewerModes)(value); + this._pdfViewer.spreadMode = modes.spreadMode; + break; + + case "page-num": + this._pdfViewer.currentPageNumber = value + 1; + break; + + case "print": + await this._pdfViewer.pagesPromise; + + this._eventBus.dispatch("print", { + source: this + }); + + break; + + case "println": + console.log(value); + break; + + case "zoom": + if (isInPresentationMode) { + return; + } + + this._pdfViewer.currentScaleValue = value; + break; + + case "SaveAs": + this._eventBus.dispatch("save", { + source: this + }); + + break; + + case "FirstPage": + this._pdfViewer.currentPageNumber = 1; + break; + + case "LastPage": + this._pdfViewer.currentPageNumber = this._pdfViewer.pagesCount; + break; + + case "NextPage": + this._pdfViewer.nextPage(); + + break; + + case "PrevPage": + this._pdfViewer.previousPage(); + + break; + + case "ZoomViewIn": + if (isInPresentationMode) { + return; + } + + this._pdfViewer.increaseScale(); + + break; + + case "ZoomViewOut": + if (isInPresentationMode) { + return; + } + + this._pdfViewer.decreaseScale(); + + break; + } + + return; + } + + if (isInPresentationMode) { + if (detail.focus) { + return; + } + } + + delete detail.id; + delete detail.siblings; + const ids = siblings ? [id, ...siblings] : [id]; + + for (const elementId of ids) { + const element = document.getElementById(elementId); + + if (element) { + element.dispatchEvent(new CustomEvent("updatefromsandbox", { + detail + })); + } else { + this._pdfDocument?.annotationStorage.setValue(elementId, detail); + } + } + } + + async _dispatchPageOpen(pageNumber, initialize = false) { + const pdfDocument = this._pdfDocument, + visitedPages = this._visitedPages; + + if (initialize) { + this._closeCapability = (0, _pdfjsLib.createPromiseCapability)(); + } + + if (!this._closeCapability) { + return; + } + + const pageView = this._pdfViewer.getPageView(pageNumber - 1); + + if (pageView?.renderingState !== _ui_utils.RenderingStates.FINISHED) { + this._pageOpenPending.add(pageNumber); + + return; + } + + this._pageOpenPending.delete(pageNumber); + + const actionsPromise = (async () => { + const actions = await (!visitedPages.has(pageNumber) ? pageView.pdfPage?.getJSActions() : null); + + if (pdfDocument !== this._pdfDocument) { + return; + } + + await this._scripting?.dispatchEventInSandbox({ + id: "page", + name: "PageOpen", + pageNumber, + actions + }); + })(); + + visitedPages.set(pageNumber, actionsPromise); + } + + async _dispatchPageClose(pageNumber) { + const pdfDocument = this._pdfDocument, + visitedPages = this._visitedPages; + + if (!this._closeCapability) { + return; + } + + if (this._pageOpenPending.has(pageNumber)) { + return; + } + + const actionsPromise = visitedPages.get(pageNumber); + + if (!actionsPromise) { + return; + } + + visitedPages.set(pageNumber, null); + await actionsPromise; + + if (pdfDocument !== this._pdfDocument) { + return; + } + + await this._scripting?.dispatchEventInSandbox({ + id: "page", + name: "PageClose", + pageNumber + }); + } + + async _getDocProperties() { + if (this._docPropertiesLookup) { + return this._docPropertiesLookup(this._pdfDocument); + } + + throw new Error("_getDocProperties: Unable to lookup properties."); + } + + _createScripting() { + this._destroyCapability = (0, _pdfjsLib.createPromiseCapability)(); + + if (this._scripting) { + throw new Error("_createScripting: Scripting already exists."); + } + + if (this._scriptingFactory) { + return this._scriptingFactory.createScripting({ + sandboxBundleSrc: this._sandboxBundleSrc + }); + } + + throw new Error("_createScripting: Cannot create scripting."); + } + + async _destroyScripting() { + if (!this._scripting) { + this._pdfDocument = null; + this._destroyCapability?.resolve(); + return; + } + + if (this._closeCapability) { + await Promise.race([this._closeCapability.promise, new Promise(resolve => { + setTimeout(resolve, 1000); + })]).catch(reason => {}); + this._closeCapability = null; + } + + this._pdfDocument = null; + + try { + await this._scripting.destroySandbox(); + } catch (ex) {} + + for (const [name, listener] of this._internalEvents) { + this._eventBus._off(name, listener); + } + + this._internalEvents.clear(); + + for (const [name, listener] of this._domEvents) { + window.removeEventListener(name, listener, true); + } + + this._domEvents.clear(); + + this._pageOpenPending.clear(); + + this._visitedPages.clear(); + + this._scripting = null; + delete this._mouseState.isDown; + this._ready = false; + this._destroyCapability?.resolve(); + } + +} + +exports.PDFScriptingManager = PDFScriptingManager; + +/***/ }), +/* 23 */ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.PDFSidebar = void 0; + +var _ui_utils = __webpack_require__(3); + +const UI_NOTIFICATION_CLASS = "pdfSidebarNotification"; + +class PDFSidebar { + constructor({ + elements, + pdfViewer, + pdfThumbnailViewer, + eventBus, + l10n + }) { + this.isOpen = false; + this.active = _ui_utils.SidebarView.THUMBS; + this.isInitialViewSet = false; + this.onToggled = null; + this.pdfViewer = pdfViewer; + this.pdfThumbnailViewer = pdfThumbnailViewer; + this.outerContainer = elements.outerContainer; + this.sidebarContainer = elements.sidebarContainer; + this.toggleButton = elements.toggleButton; + this.thumbnailButton = elements.thumbnailButton; + this.outlineButton = elements.outlineButton; + this.attachmentsButton = elements.attachmentsButton; + this.layersButton = elements.layersButton; + this.thumbnailView = elements.thumbnailView; + this.outlineView = elements.outlineView; + this.attachmentsView = elements.attachmentsView; + this.layersView = elements.layersView; + this._outlineOptionsContainer = elements.outlineOptionsContainer; + this._currentOutlineItemButton = elements.currentOutlineItemButton; + this.eventBus = eventBus; + this.l10n = l10n; + + this._addEventListeners(); + } + + reset() { + this.isInitialViewSet = false; + + this._hideUINotification(true); + + this.switchView(_ui_utils.SidebarView.THUMBS); + this.outlineButton.disabled = false; + this.attachmentsButton.disabled = false; + this.layersButton.disabled = false; + this._currentOutlineItemButton.disabled = true; + } + + get visibleView() { + return this.isOpen ? this.active : _ui_utils.SidebarView.NONE; + } + + get isThumbnailViewVisible() { + return this.isOpen && this.active === _ui_utils.SidebarView.THUMBS; + } + + get isOutlineViewVisible() { + return this.isOpen && this.active === _ui_utils.SidebarView.OUTLINE; + } + + get isAttachmentsViewVisible() { + return this.isOpen && this.active === _ui_utils.SidebarView.ATTACHMENTS; + } + + get isLayersViewVisible() { + return this.isOpen && this.active === _ui_utils.SidebarView.LAYERS; + } + + setInitialView(view = _ui_utils.SidebarView.NONE) { + if (this.isInitialViewSet) { + return; + } + + this.isInitialViewSet = true; + + if (view === _ui_utils.SidebarView.NONE || view === _ui_utils.SidebarView.UNKNOWN) { + this._dispatchEvent(); + + return; + } + + if (!this._switchView(view, true)) { + this._dispatchEvent(); + } + } + + switchView(view, forceOpen = false) { + this._switchView(view, forceOpen); + } + + _switchView(view, forceOpen = false) { + const isViewChanged = view !== this.active; + let shouldForceRendering = false; + + switch (view) { + case _ui_utils.SidebarView.NONE: + if (this.isOpen) { + this.close(); + return true; + } + + return false; + + case _ui_utils.SidebarView.THUMBS: + if (this.isOpen && isViewChanged) { + shouldForceRendering = true; + } + + break; + + case _ui_utils.SidebarView.OUTLINE: + if (this.outlineButton.disabled) { + return false; + } + + break; + + case _ui_utils.SidebarView.ATTACHMENTS: + if (this.attachmentsButton.disabled) { + return false; + } + + break; + + case _ui_utils.SidebarView.LAYERS: + if (this.layersButton.disabled) { + return false; + } + + break; + + default: + console.error(`PDFSidebar._switchView: "${view}" is not a valid view.`); + return false; + } + + this.active = view; + const isThumbs = view === _ui_utils.SidebarView.THUMBS, + isOutline = view === _ui_utils.SidebarView.OUTLINE, + isAttachments = view === _ui_utils.SidebarView.ATTACHMENTS, + isLayers = view === _ui_utils.SidebarView.LAYERS; + this.thumbnailButton.classList.toggle("toggled", isThumbs); + this.outlineButton.classList.toggle("toggled", isOutline); + this.attachmentsButton.classList.toggle("toggled", isAttachments); + this.layersButton.classList.toggle("toggled", isLayers); + this.thumbnailButton.setAttribute("aria-checked", isThumbs); + this.outlineButton.setAttribute("aria-checked", isOutline); + this.attachmentsButton.setAttribute("aria-checked", isAttachments); + this.layersButton.setAttribute("aria-checked", isLayers); + this.thumbnailView.classList.toggle("hidden", !isThumbs); + this.outlineView.classList.toggle("hidden", !isOutline); + this.attachmentsView.classList.toggle("hidden", !isAttachments); + this.layersView.classList.toggle("hidden", !isLayers); + + this._outlineOptionsContainer.classList.toggle("hidden", !isOutline); + + if (forceOpen && !this.isOpen) { + this.open(); + return true; + } + + if (shouldForceRendering) { + this._updateThumbnailViewer(); + + this._forceRendering(); + } + + if (isViewChanged) { + this._dispatchEvent(); + } + + return isViewChanged; + } + + open() { + if (this.isOpen) { + return; + } + + this.isOpen = true; + this.toggleButton.classList.add("toggled"); + this.toggleButton.setAttribute("aria-expanded", "true"); + this.outerContainer.classList.add("sidebarMoving", "sidebarOpen"); + + if (this.active === _ui_utils.SidebarView.THUMBS) { + this._updateThumbnailViewer(); + } + + this._forceRendering(); + + this._dispatchEvent(); + + this._hideUINotification(); + } + + close() { + if (!this.isOpen) { + return; + } + + this.isOpen = false; + this.toggleButton.classList.remove("toggled"); + this.toggleButton.setAttribute("aria-expanded", "false"); + this.outerContainer.classList.add("sidebarMoving"); + this.outerContainer.classList.remove("sidebarOpen"); + + this._forceRendering(); + + this._dispatchEvent(); + } + + toggle() { + if (this.isOpen) { + this.close(); + } else { + this.open(); + } + } + + _dispatchEvent() { + this.eventBus.dispatch("sidebarviewchanged", { + source: this, + view: this.visibleView + }); + } + + _forceRendering() { + if (this.onToggled) { + this.onToggled(); + } else { + this.pdfViewer.forceRendering(); + this.pdfThumbnailViewer.forceRendering(); + } + } + + _updateThumbnailViewer() { + const { + pdfViewer, + pdfThumbnailViewer + } = this; + const pagesCount = pdfViewer.pagesCount; + + for (let pageIndex = 0; pageIndex < pagesCount; pageIndex++) { + const pageView = pdfViewer.getPageView(pageIndex); + + if (pageView?.renderingState === _ui_utils.RenderingStates.FINISHED) { + const thumbnailView = pdfThumbnailViewer.getThumbnail(pageIndex); + thumbnailView.setImage(pageView); + } + } + + pdfThumbnailViewer.scrollThumbnailIntoView(pdfViewer.currentPageNumber); + } + + _showUINotification() { + this.l10n.get("toggle_sidebar_notification2.title").then(msg => { + this.toggleButton.title = msg; + }); + + if (!this.isOpen) { + this.toggleButton.classList.add(UI_NOTIFICATION_CLASS); + } + } + + _hideUINotification(reset = false) { + if (this.isOpen || reset) { + this.toggleButton.classList.remove(UI_NOTIFICATION_CLASS); + } + + if (reset) { + this.l10n.get("toggle_sidebar.title").then(msg => { + this.toggleButton.title = msg; + }); + } + } + + _addEventListeners() { + this.sidebarContainer.addEventListener("transitionend", evt => { + if (evt.target === this.sidebarContainer) { + this.outerContainer.classList.remove("sidebarMoving"); + } + }); + this.toggleButton.addEventListener("click", () => { + this.toggle(); + }); + this.thumbnailButton.addEventListener("click", () => { + this.switchView(_ui_utils.SidebarView.THUMBS); + }); + this.outlineButton.addEventListener("click", () => { + this.switchView(_ui_utils.SidebarView.OUTLINE); + }); + this.outlineButton.addEventListener("dblclick", () => { + this.eventBus.dispatch("toggleoutlinetree", { + source: this + }); + }); + this.attachmentsButton.addEventListener("click", () => { + this.switchView(_ui_utils.SidebarView.ATTACHMENTS); + }); + this.layersButton.addEventListener("click", () => { + this.switchView(_ui_utils.SidebarView.LAYERS); + }); + this.layersButton.addEventListener("dblclick", () => { + this.eventBus.dispatch("resetlayers", { + source: this + }); + }); + + this._currentOutlineItemButton.addEventListener("click", () => { + this.eventBus.dispatch("currentoutlineitem", { + source: this + }); + }); + + const onTreeLoaded = (count, button, view) => { + button.disabled = !count; + + if (count) { + this._showUINotification(); + } else if (this.active === view) { + this.switchView(_ui_utils.SidebarView.THUMBS); + } + }; + + this.eventBus._on("outlineloaded", evt => { + onTreeLoaded(evt.outlineCount, this.outlineButton, _ui_utils.SidebarView.OUTLINE); + evt.currentOutlineItemPromise.then(enabled => { + if (!this.isInitialViewSet) { + return; + } + + this._currentOutlineItemButton.disabled = !enabled; + }); + }); + + this.eventBus._on("attachmentsloaded", evt => { + onTreeLoaded(evt.attachmentsCount, this.attachmentsButton, _ui_utils.SidebarView.ATTACHMENTS); + }); + + this.eventBus._on("layersloaded", evt => { + onTreeLoaded(evt.layersCount, this.layersButton, _ui_utils.SidebarView.LAYERS); + }); + + this.eventBus._on("presentationmodechanged", evt => { + if (evt.state === _ui_utils.PresentationModeState.NORMAL && this.isThumbnailViewVisible) { + this._updateThumbnailViewer(); + } + }); + } + +} + +exports.PDFSidebar = PDFSidebar; + +/***/ }), +/* 24 */ +/***/ ((__unused_webpack_module, exports) => { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.PDFSidebarResizer = void 0; +const SIDEBAR_WIDTH_VAR = "--sidebar-width"; +const SIDEBAR_MIN_WIDTH = 200; +const SIDEBAR_RESIZING_CLASS = "sidebarResizing"; + +class PDFSidebarResizer { + constructor(options, eventBus, l10n) { + this.isRTL = false; + this.sidebarOpen = false; + this.doc = document.documentElement; + this._width = null; + this._outerContainerWidth = null; + this._boundEvents = Object.create(null); + this.outerContainer = options.outerContainer; + this.resizer = options.resizer; + this.eventBus = eventBus; + l10n.getDirection().then(dir => { + this.isRTL = dir === "rtl"; + }); + + this._addEventListeners(); + } + + get outerContainerWidth() { + return this._outerContainerWidth ||= this.outerContainer.clientWidth; + } + + _updateWidth(width = 0) { + const maxWidth = Math.floor(this.outerContainerWidth / 2); + + if (width > maxWidth) { + width = maxWidth; + } + + if (width < SIDEBAR_MIN_WIDTH) { + width = SIDEBAR_MIN_WIDTH; + } + + if (width === this._width) { + return false; + } + + this._width = width; + this.doc.style.setProperty(SIDEBAR_WIDTH_VAR, `${width}px`); + return true; + } + + _mouseMove(evt) { + let width = evt.clientX; + + if (this.isRTL) { + width = this.outerContainerWidth - width; + } + + this._updateWidth(width); + } + + _mouseUp(evt) { + this.outerContainer.classList.remove(SIDEBAR_RESIZING_CLASS); + this.eventBus.dispatch("resize", { + source: this + }); + const _boundEvents = this._boundEvents; + window.removeEventListener("mousemove", _boundEvents.mouseMove); + window.removeEventListener("mouseup", _boundEvents.mouseUp); + } + + _addEventListeners() { + const _boundEvents = this._boundEvents; + _boundEvents.mouseMove = this._mouseMove.bind(this); + _boundEvents.mouseUp = this._mouseUp.bind(this); + this.resizer.addEventListener("mousedown", evt => { + if (evt.button !== 0) { + return; + } + + this.outerContainer.classList.add(SIDEBAR_RESIZING_CLASS); + window.addEventListener("mousemove", _boundEvents.mouseMove); + window.addEventListener("mouseup", _boundEvents.mouseUp); + }); + + this.eventBus._on("sidebarviewchanged", evt => { + this.sidebarOpen = !!evt?.view; + }); + + this.eventBus._on("resize", evt => { + if (evt?.source !== window) { + return; + } + + this._outerContainerWidth = null; + + if (!this._width) { + return; + } + + if (!this.sidebarOpen) { + this._updateWidth(this._width); + + return; + } + + this.outerContainer.classList.add(SIDEBAR_RESIZING_CLASS); + + const updated = this._updateWidth(this._width); + + Promise.resolve().then(() => { + this.outerContainer.classList.remove(SIDEBAR_RESIZING_CLASS); + + if (updated) { + this.eventBus.dispatch("resize", { + source: this + }); + } + }); + }); + } + +} + +exports.PDFSidebarResizer = PDFSidebarResizer; + +/***/ }), +/* 25 */ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.PDFThumbnailViewer = void 0; + +var _ui_utils = __webpack_require__(3); + +var _pdf_thumbnail_view = __webpack_require__(26); + +const THUMBNAIL_SCROLL_MARGIN = -19; +const THUMBNAIL_SELECTED_CLASS = "selected"; + +class PDFThumbnailViewer { + constructor({ + container, + eventBus, + linkService, + renderingQueue, + l10n + }) { + this.container = container; + this.linkService = linkService; + this.renderingQueue = renderingQueue; + this.l10n = l10n; + this.scroll = (0, _ui_utils.watchScroll)(this.container, this._scrollUpdated.bind(this)); + + this._resetView(); + + eventBus._on("optionalcontentconfigchanged", () => { + this._setImageDisabled = true; + }); + } + + _scrollUpdated() { + this.renderingQueue.renderHighestPriority(); + } + + getThumbnail(index) { + return this._thumbnails[index]; + } + + _getVisibleThumbs() { + return (0, _ui_utils.getVisibleElements)({ + scrollEl: this.container, + views: this._thumbnails + }); + } + + scrollThumbnailIntoView(pageNumber) { + if (!this.pdfDocument) { + return; + } + + const thumbnailView = this._thumbnails[pageNumber - 1]; + + if (!thumbnailView) { + console.error('scrollThumbnailIntoView: Invalid "pageNumber" parameter.'); + return; + } + + if (pageNumber !== this._currentPageNumber) { + const prevThumbnailView = this._thumbnails[this._currentPageNumber - 1]; + prevThumbnailView.div.classList.remove(THUMBNAIL_SELECTED_CLASS); + thumbnailView.div.classList.add(THUMBNAIL_SELECTED_CLASS); + } + + const { + first, + last, + views + } = this._getVisibleThumbs(); + + if (views.length > 0) { + let shouldScroll = false; + + if (pageNumber <= first.id || pageNumber >= last.id) { + shouldScroll = true; + } else { + for (const { + id, + percent + } of views) { + if (id !== pageNumber) { + continue; + } + + shouldScroll = percent < 100; + break; + } + } + + if (shouldScroll) { + (0, _ui_utils.scrollIntoView)(thumbnailView.div, { + top: THUMBNAIL_SCROLL_MARGIN + }); + } + } + + this._currentPageNumber = pageNumber; + } + + get pagesRotation() { + return this._pagesRotation; + } + + set pagesRotation(rotation) { + if (!(0, _ui_utils.isValidRotation)(rotation)) { + throw new Error("Invalid thumbnails rotation angle."); + } + + if (!this.pdfDocument) { + return; + } + + if (this._pagesRotation === rotation) { + return; + } + + this._pagesRotation = rotation; + const updateArgs = { + rotation + }; + + for (const thumbnail of this._thumbnails) { + thumbnail.update(updateArgs); + } + } + + cleanup() { + for (const thumbnail of this._thumbnails) { + if (thumbnail.renderingState !== _ui_utils.RenderingStates.FINISHED) { + thumbnail.reset(); + } + } + + _pdf_thumbnail_view.TempImageFactory.destroyCanvas(); + } + + _resetView() { + this._thumbnails = []; + this._currentPageNumber = 1; + this._pageLabels = null; + this._pagesRotation = 0; + this._optionalContentConfigPromise = null; + this._setImageDisabled = false; + this.container.textContent = ""; + } + + setDocument(pdfDocument) { + if (this.pdfDocument) { + this._cancelRendering(); + + this._resetView(); + } + + this.pdfDocument = pdfDocument; + + if (!pdfDocument) { + return; + } + + const firstPagePromise = pdfDocument.getPage(1); + const optionalContentConfigPromise = pdfDocument.getOptionalContentConfig(); + firstPagePromise.then(firstPdfPage => { + this._optionalContentConfigPromise = optionalContentConfigPromise; + const pagesCount = pdfDocument.numPages; + const viewport = firstPdfPage.getViewport({ + scale: 1 + }); + + const checkSetImageDisabled = () => { + return this._setImageDisabled; + }; + + for (let pageNum = 1; pageNum <= pagesCount; ++pageNum) { + const thumbnail = new _pdf_thumbnail_view.PDFThumbnailView({ + container: this.container, + id: pageNum, + defaultViewport: viewport.clone(), + optionalContentConfigPromise, + linkService: this.linkService, + renderingQueue: this.renderingQueue, + checkSetImageDisabled, + l10n: this.l10n + }); + + this._thumbnails.push(thumbnail); + } + + const firstThumbnailView = this._thumbnails[0]; + + if (firstThumbnailView) { + firstThumbnailView.setPdfPage(firstPdfPage); + } + + const thumbnailView = this._thumbnails[this._currentPageNumber - 1]; + thumbnailView.div.classList.add(THUMBNAIL_SELECTED_CLASS); + }).catch(reason => { + console.error("Unable to initialize thumbnail viewer", reason); + }); + } + + _cancelRendering() { + for (const thumbnail of this._thumbnails) { + thumbnail.cancelRendering(); + } + } + + setPageLabels(labels) { + if (!this.pdfDocument) { + return; + } + + if (!labels) { + this._pageLabels = null; + } else if (!(Array.isArray(labels) && this.pdfDocument.numPages === labels.length)) { + this._pageLabels = null; + console.error("PDFThumbnailViewer_setPageLabels: Invalid page labels."); + } else { + this._pageLabels = labels; + } + + for (let i = 0, ii = this._thumbnails.length; i < ii; i++) { + this._thumbnails[i].setPageLabel(this._pageLabels?.[i] ?? null); + } + } + + async #ensurePdfPageLoaded(thumbView) { + if (thumbView.pdfPage) { + return thumbView.pdfPage; + } + + try { + const pdfPage = await this.pdfDocument.getPage(thumbView.id); + + if (!thumbView.pdfPage) { + thumbView.setPdfPage(pdfPage); + } + + return pdfPage; + } catch (reason) { + console.error("Unable to get page for thumb view", reason); + return null; + } + } + + #getScrollAhead(visible) { + if (visible.first?.id === 1) { + return true; + } else if (visible.last?.id === this._thumbnails.length) { + return false; + } + + return this.scroll.down; + } + + forceRendering() { + const visibleThumbs = this._getVisibleThumbs(); + + const scrollAhead = this.#getScrollAhead(visibleThumbs); + const thumbView = this.renderingQueue.getHighestPriority(visibleThumbs, this._thumbnails, scrollAhead); + + if (thumbView) { + this.#ensurePdfPageLoaded(thumbView).then(() => { + this.renderingQueue.renderView(thumbView); + }); + return true; + } + + return false; + } + +} + +exports.PDFThumbnailViewer = PDFThumbnailViewer; + +/***/ }), +/* 26 */ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.TempImageFactory = exports.PDFThumbnailView = void 0; + +var _ui_utils = __webpack_require__(3); + +var _pdfjsLib = __webpack_require__(5); + +const DRAW_UPSCALE_FACTOR = 2; +const MAX_NUM_SCALING_STEPS = 3; +const THUMBNAIL_CANVAS_BORDER_WIDTH = 1; +const THUMBNAIL_WIDTH = 98; + +class TempImageFactory { + static #tempCanvas = null; + + static getCanvas(width, height) { + const tempCanvas = this.#tempCanvas ||= document.createElement("canvas"); + tempCanvas.width = width; + tempCanvas.height = height; + const ctx = tempCanvas.getContext("2d", { + alpha: false + }); + ctx.save(); + ctx.fillStyle = "rgb(255, 255, 255)"; + ctx.fillRect(0, 0, width, height); + ctx.restore(); + return [tempCanvas, tempCanvas.getContext("2d")]; + } + + static destroyCanvas() { + const tempCanvas = this.#tempCanvas; + + if (tempCanvas) { + tempCanvas.width = 0; + tempCanvas.height = 0; + } + + this.#tempCanvas = null; + } + +} + +exports.TempImageFactory = TempImageFactory; + +class PDFThumbnailView { + constructor({ + container, + id, + defaultViewport, + optionalContentConfigPromise, + linkService, + renderingQueue, + checkSetImageDisabled, + l10n + }) { + this.id = id; + this.renderingId = "thumbnail" + id; + this.pageLabel = null; + this.pdfPage = null; + this.rotation = 0; + this.viewport = defaultViewport; + this.pdfPageRotate = defaultViewport.rotation; + this._optionalContentConfigPromise = optionalContentConfigPromise || null; + this.linkService = linkService; + this.renderingQueue = renderingQueue; + this.renderTask = null; + this.renderingState = _ui_utils.RenderingStates.INITIAL; + this.resume = null; + + this._checkSetImageDisabled = checkSetImageDisabled || function () { + return false; + }; + + const pageWidth = this.viewport.width, + pageHeight = this.viewport.height, + pageRatio = pageWidth / pageHeight; + this.canvasWidth = THUMBNAIL_WIDTH; + this.canvasHeight = this.canvasWidth / pageRatio | 0; + this.scale = this.canvasWidth / pageWidth; + this.l10n = l10n; + const anchor = document.createElement("a"); + anchor.href = linkService.getAnchorUrl("#page=" + id); + + this._thumbPageTitle.then(msg => { + anchor.title = msg; + }); + + anchor.onclick = function () { + linkService.goToPage(id); + return false; + }; + + this.anchor = anchor; + const div = document.createElement("div"); + div.className = "thumbnail"; + div.setAttribute("data-page-number", this.id); + this.div = div; + const ring = document.createElement("div"); + ring.className = "thumbnailSelectionRing"; + const borderAdjustment = 2 * THUMBNAIL_CANVAS_BORDER_WIDTH; + ring.style.width = this.canvasWidth + borderAdjustment + "px"; + ring.style.height = this.canvasHeight + borderAdjustment + "px"; + this.ring = ring; + div.appendChild(ring); + anchor.appendChild(div); + container.appendChild(anchor); + } + + setPdfPage(pdfPage) { + this.pdfPage = pdfPage; + this.pdfPageRotate = pdfPage.rotate; + const totalRotation = (this.rotation + this.pdfPageRotate) % 360; + this.viewport = pdfPage.getViewport({ + scale: 1, + rotation: totalRotation + }); + this.reset(); + } + + reset() { + this.cancelRendering(); + this.renderingState = _ui_utils.RenderingStates.INITIAL; + const pageWidth = this.viewport.width, + pageHeight = this.viewport.height, + pageRatio = pageWidth / pageHeight; + this.canvasHeight = this.canvasWidth / pageRatio | 0; + this.scale = this.canvasWidth / pageWidth; + this.div.removeAttribute("data-loaded"); + const ring = this.ring; + ring.textContent = ""; + const borderAdjustment = 2 * THUMBNAIL_CANVAS_BORDER_WIDTH; + ring.style.width = this.canvasWidth + borderAdjustment + "px"; + ring.style.height = this.canvasHeight + borderAdjustment + "px"; + + if (this.canvas) { + this.canvas.width = 0; + this.canvas.height = 0; + delete this.canvas; + } + + if (this.image) { + this.image.removeAttribute("src"); + delete this.image; + } + } + + update({ + rotation = null + }) { + if (typeof rotation === "number") { + this.rotation = rotation; + } + + const totalRotation = (this.rotation + this.pdfPageRotate) % 360; + this.viewport = this.viewport.clone({ + scale: 1, + rotation: totalRotation + }); + this.reset(); + } + + cancelRendering() { + if (this.renderTask) { + this.renderTask.cancel(); + this.renderTask = null; + } + + this.resume = null; + } + + _getPageDrawContext(upscaleFactor = 1) { + const canvas = document.createElement("canvas"); + const ctx = canvas.getContext("2d", { + alpha: false + }); + const outputScale = new _ui_utils.OutputScale(); + canvas.width = upscaleFactor * this.canvasWidth * outputScale.sx | 0; + canvas.height = upscaleFactor * this.canvasHeight * outputScale.sy | 0; + const transform = outputScale.scaled ? [outputScale.sx, 0, 0, outputScale.sy, 0, 0] : null; + return { + ctx, + canvas, + transform + }; + } + + _convertCanvasToImage(canvas) { + if (this.renderingState !== _ui_utils.RenderingStates.FINISHED) { + throw new Error("_convertCanvasToImage: Rendering has not finished."); + } + + const reducedCanvas = this._reduceImage(canvas); + + const image = document.createElement("img"); + image.className = "thumbnailImage"; + + this._thumbPageCanvas.then(msg => { + image.setAttribute("aria-label", msg); + }); + + image.style.width = this.canvasWidth + "px"; + image.style.height = this.canvasHeight + "px"; + image.src = reducedCanvas.toDataURL(); + this.image = image; + this.div.setAttribute("data-loaded", true); + this.ring.appendChild(image); + reducedCanvas.width = 0; + reducedCanvas.height = 0; + } + + draw() { + if (this.renderingState !== _ui_utils.RenderingStates.INITIAL) { + console.error("Must be in new state before drawing"); + return Promise.resolve(); + } + + const { + pdfPage + } = this; + + if (!pdfPage) { + this.renderingState = _ui_utils.RenderingStates.FINISHED; + return Promise.reject(new Error("pdfPage is not loaded")); + } + + this.renderingState = _ui_utils.RenderingStates.RUNNING; + + const finishRenderTask = async (error = null) => { + if (renderTask === this.renderTask) { + this.renderTask = null; + } + + if (error instanceof _pdfjsLib.RenderingCancelledException) { + return; + } + + this.renderingState = _ui_utils.RenderingStates.FINISHED; + + this._convertCanvasToImage(canvas); + + if (error) { + throw error; + } + }; + + const { + ctx, + canvas, + transform + } = this._getPageDrawContext(DRAW_UPSCALE_FACTOR); + + const drawViewport = this.viewport.clone({ + scale: DRAW_UPSCALE_FACTOR * this.scale + }); + + const renderContinueCallback = cont => { + if (!this.renderingQueue.isHighestPriority(this)) { + this.renderingState = _ui_utils.RenderingStates.PAUSED; + + this.resume = () => { + this.renderingState = _ui_utils.RenderingStates.RUNNING; + cont(); + }; + + return; + } + + cont(); + }; + + const renderContext = { + canvasContext: ctx, + transform, + viewport: drawViewport, + optionalContentConfigPromise: this._optionalContentConfigPromise + }; + const renderTask = this.renderTask = pdfPage.render(renderContext); + renderTask.onContinue = renderContinueCallback; + const resultPromise = renderTask.promise.then(function () { + return finishRenderTask(null); + }, function (error) { + return finishRenderTask(error); + }); + resultPromise.finally(() => { + canvas.width = 0; + canvas.height = 0; + const pageCached = this.linkService.isPageCached(this.id); + + if (!pageCached) { + this.pdfPage?.cleanup(); + } + }); + return resultPromise; + } + + setImage(pageView) { + if (this._checkSetImageDisabled()) { + return; + } + + if (this.renderingState !== _ui_utils.RenderingStates.INITIAL) { + return; + } + + const { + canvas, + pdfPage + } = pageView; + + if (!canvas) { + return; + } + + if (!this.pdfPage) { + this.setPdfPage(pdfPage); + } + + this.renderingState = _ui_utils.RenderingStates.FINISHED; + + this._convertCanvasToImage(canvas); + } + + _reduceImage(img) { + const { + ctx, + canvas + } = this._getPageDrawContext(); + + if (img.width <= 2 * canvas.width) { + ctx.drawImage(img, 0, 0, img.width, img.height, 0, 0, canvas.width, canvas.height); + return canvas; + } + + let reducedWidth = canvas.width << MAX_NUM_SCALING_STEPS; + let reducedHeight = canvas.height << MAX_NUM_SCALING_STEPS; + const [reducedImage, reducedImageCtx] = TempImageFactory.getCanvas(reducedWidth, reducedHeight); + + while (reducedWidth > img.width || reducedHeight > img.height) { + reducedWidth >>= 1; + reducedHeight >>= 1; + } + + reducedImageCtx.drawImage(img, 0, 0, img.width, img.height, 0, 0, reducedWidth, reducedHeight); + + while (reducedWidth > 2 * canvas.width) { + reducedImageCtx.drawImage(reducedImage, 0, 0, reducedWidth, reducedHeight, 0, 0, reducedWidth >> 1, reducedHeight >> 1); + reducedWidth >>= 1; + reducedHeight >>= 1; + } + + ctx.drawImage(reducedImage, 0, 0, reducedWidth, reducedHeight, 0, 0, canvas.width, canvas.height); + return canvas; + } + + get _thumbPageTitle() { + return this.l10n.get("thumb_page_title", { + page: this.pageLabel ?? this.id + }); + } + + get _thumbPageCanvas() { + return this.l10n.get("thumb_page_canvas", { + page: this.pageLabel ?? this.id + }); + } + + setPageLabel(label) { + this.pageLabel = typeof label === "string" ? label : null; + + this._thumbPageTitle.then(msg => { + this.anchor.title = msg; + }); + + if (this.renderingState !== _ui_utils.RenderingStates.FINISHED) { + return; + } + + this._thumbPageCanvas.then(msg => { + this.image?.setAttribute("aria-label", msg); + }); + } + +} + +exports.PDFThumbnailView = PDFThumbnailView; + +/***/ }), +/* 27 */ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.PDFViewer = exports.PDFSinglePageViewer = void 0; + +var _ui_utils = __webpack_require__(3); + +var _base_viewer = __webpack_require__(28); + +class PDFViewer extends _base_viewer.BaseViewer {} + +exports.PDFViewer = PDFViewer; + +class PDFSinglePageViewer extends _base_viewer.BaseViewer { + _resetView() { + super._resetView(); + + this._scrollMode = _ui_utils.ScrollMode.PAGE; + this._spreadMode = _ui_utils.SpreadMode.NONE; + } + + set scrollMode(mode) {} + + _updateScrollMode() {} + + set spreadMode(mode) {} + + _updateSpreadMode() {} + +} + +exports.PDFSinglePageViewer = PDFSinglePageViewer; + +/***/ }), +/* 28 */ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.PagesCountLimit = exports.PDFPageViewBuffer = exports.BaseViewer = void 0; + +var _pdfjsLib = __webpack_require__(5); + +var _ui_utils = __webpack_require__(3); + +var _annotation_layer_builder = __webpack_require__(29); + +var _l10n_utils = __webpack_require__(30); + +var _pdf_page_view = __webpack_require__(31); + +var _pdf_rendering_queue = __webpack_require__(21); + +var _pdf_link_service = __webpack_require__(8); + +var _struct_tree_layer_builder = __webpack_require__(32); + +var _text_highlighter = __webpack_require__(33); + +var _text_layer_builder = __webpack_require__(34); + +var _xfa_layer_builder = __webpack_require__(35); + +const DEFAULT_CACHE_SIZE = 10; +const ENABLE_PERMISSIONS_CLASS = "enablePermissions"; +const PagesCountLimit = { + FORCE_SCROLL_MODE_PAGE: 15000, + FORCE_LAZY_PAGE_INIT: 7500, + PAUSE_EAGER_PAGE_INIT: 250 +}; +exports.PagesCountLimit = PagesCountLimit; + +class PDFPageViewBuffer { + #buf = new Set(); + #size = 0; + + constructor(size) { + this.#size = size; + } + + push(view) { + const buf = this.#buf; + + if (buf.has(view)) { + buf.delete(view); + } + + buf.add(view); + + if (buf.size > this.#size) { + this.#destroyFirstView(); + } + } + + resize(newSize, idsToKeep = null) { + this.#size = newSize; + const buf = this.#buf; + + if (idsToKeep) { + const ii = buf.size; + let i = 1; + + for (const view of buf) { + if (idsToKeep.has(view.id)) { + buf.delete(view); + buf.add(view); + } + + if (++i > ii) { + break; + } + } + } + + while (buf.size > this.#size) { + this.#destroyFirstView(); + } + } + + has(view) { + return this.#buf.has(view); + } + + [Symbol.iterator]() { + return this.#buf.keys(); + } + + #destroyFirstView() { + const firstView = this.#buf.keys().next().value; + firstView?.destroy(); + this.#buf.delete(firstView); + } + +} + +exports.PDFPageViewBuffer = PDFPageViewBuffer; + +class BaseViewer { + #buffer = null; + #annotationMode = _pdfjsLib.AnnotationMode.ENABLE_FORMS; + #previousAnnotationMode = null; + #enablePermissions = false; + #previousContainerHeight = 0; + #scrollModePageState = null; + #onVisibilityChange = null; + + constructor(options) { + if (this.constructor === BaseViewer) { + throw new Error("Cannot initialize BaseViewer."); + } + + const viewerVersion = '2.14.305'; + + if (_pdfjsLib.version !== viewerVersion) { + throw new Error(`The API version "${_pdfjsLib.version}" does not match the Viewer version "${viewerVersion}".`); + } + + this.container = options.container; + this.viewer = options.viewer || options.container.firstElementChild; + + if (!(this.container?.tagName.toUpperCase() === "DIV" && this.viewer?.tagName.toUpperCase() === "DIV")) { + throw new Error("Invalid `container` and/or `viewer` option."); + } + + if (this.container.offsetParent && getComputedStyle(this.container).position !== "absolute") { + throw new Error("The `container` must be absolutely positioned."); + } + + this.eventBus = options.eventBus; + this.linkService = options.linkService || new _pdf_link_service.SimpleLinkService(); + this.downloadManager = options.downloadManager || null; + this.findController = options.findController || null; + this._scriptingManager = options.scriptingManager || null; + this.removePageBorders = options.removePageBorders || false; + this.textLayerMode = options.textLayerMode ?? _ui_utils.TextLayerMode.ENABLE; + this.#annotationMode = options.annotationMode ?? _pdfjsLib.AnnotationMode.ENABLE_FORMS; + this.imageResourcesPath = options.imageResourcesPath || ""; + this.enablePrintAutoRotate = options.enablePrintAutoRotate || false; + this.renderer = options.renderer || _ui_utils.RendererType.CANVAS; + this.useOnlyCssZoom = options.useOnlyCssZoom || false; + this.maxCanvasPixels = options.maxCanvasPixels; + this.l10n = options.l10n || _l10n_utils.NullL10n; + this.#enablePermissions = options.enablePermissions || false; + this.pageColors = options.pageColors || null; + + if (options.pageColors && (!CSS.supports("color", options.pageColors.background) || !CSS.supports("color", options.pageColors.foreground))) { + if (options.pageColors.background || options.pageColors.foreground) { + console.warn("Ignoring `pageColors`-option, since the browser doesn't support the values used."); + } + + this.pageColors = null; + } + + this.defaultRenderingQueue = !options.renderingQueue; + + if (this.defaultRenderingQueue) { + this.renderingQueue = new _pdf_rendering_queue.PDFRenderingQueue(); + this.renderingQueue.setViewer(this); + } else { + this.renderingQueue = options.renderingQueue; + } + + this._doc = document.documentElement; + this.scroll = (0, _ui_utils.watchScroll)(this.container, this._scrollUpdate.bind(this)); + this.presentationModeState = _ui_utils.PresentationModeState.UNKNOWN; + this._onBeforeDraw = this._onAfterDraw = null; + + this._resetView(); + + if (this.removePageBorders) { + this.viewer.classList.add("removePageBorders"); + } + + this.updateContainerHeightCss(); + Promise.resolve().then(() => { + this.eventBus.dispatch("baseviewerinit", { + source: this + }); + }); + } + + get pagesCount() { + return this._pages.length; + } + + getPageView(index) { + return this._pages[index]; + } + + get pageViewsReady() { + if (!this._pagesCapability.settled) { + return false; + } + + return this._pages.every(function (pageView) { + return pageView?.pdfPage; + }); + } + + get renderForms() { + return this.#annotationMode === _pdfjsLib.AnnotationMode.ENABLE_FORMS; + } + + get enableScripting() { + return !!this._scriptingManager; + } + + get currentPageNumber() { + return this._currentPageNumber; + } + + set currentPageNumber(val) { + if (!Number.isInteger(val)) { + throw new Error("Invalid page number."); + } + + if (!this.pdfDocument) { + return; + } + + if (!this._setCurrentPageNumber(val, true)) { + console.error(`currentPageNumber: "${val}" is not a valid page.`); + } + } + + _setCurrentPageNumber(val, resetCurrentPageView = false) { + if (this._currentPageNumber === val) { + if (resetCurrentPageView) { + this.#resetCurrentPageView(); + } + + return true; + } + + if (!(0 < val && val <= this.pagesCount)) { + return false; + } + + const previous = this._currentPageNumber; + this._currentPageNumber = val; + this.eventBus.dispatch("pagechanging", { + source: this, + pageNumber: val, + pageLabel: this._pageLabels?.[val - 1] ?? null, + previous + }); + + if (resetCurrentPageView) { + this.#resetCurrentPageView(); + } + + return true; + } + + get currentPageLabel() { + return this._pageLabels?.[this._currentPageNumber - 1] ?? null; + } + + set currentPageLabel(val) { + if (!this.pdfDocument) { + return; + } + + let page = val | 0; + + if (this._pageLabels) { + const i = this._pageLabels.indexOf(val); + + if (i >= 0) { + page = i + 1; + } + } + + if (!this._setCurrentPageNumber(page, true)) { + console.error(`currentPageLabel: "${val}" is not a valid page.`); + } + } + + get currentScale() { + return this._currentScale !== _ui_utils.UNKNOWN_SCALE ? this._currentScale : _ui_utils.DEFAULT_SCALE; + } + + set currentScale(val) { + if (isNaN(val)) { + throw new Error("Invalid numeric scale."); + } + + if (!this.pdfDocument) { + return; + } + + this._setScale(val, false); + } + + get currentScaleValue() { + return this._currentScaleValue; + } + + set currentScaleValue(val) { + if (!this.pdfDocument) { + return; + } + + this._setScale(val, false); + } + + get pagesRotation() { + return this._pagesRotation; + } + + set pagesRotation(rotation) { + if (!(0, _ui_utils.isValidRotation)(rotation)) { + throw new Error("Invalid pages rotation angle."); + } + + if (!this.pdfDocument) { + return; + } + + rotation %= 360; + + if (rotation < 0) { + rotation += 360; + } + + if (this._pagesRotation === rotation) { + return; + } + + this._pagesRotation = rotation; + const pageNumber = this._currentPageNumber; + const updateArgs = { + rotation + }; + + for (const pageView of this._pages) { + pageView.update(updateArgs); + } + + if (this._currentScaleValue) { + this._setScale(this._currentScaleValue, true); + } + + this.eventBus.dispatch("rotationchanging", { + source: this, + pagesRotation: rotation, + pageNumber + }); + + if (this.defaultRenderingQueue) { + this.update(); + } + } + + get firstPagePromise() { + return this.pdfDocument ? this._firstPageCapability.promise : null; + } + + get onePageRendered() { + return this.pdfDocument ? this._onePageRenderedCapability.promise : null; + } + + get pagesPromise() { + return this.pdfDocument ? this._pagesCapability.promise : null; + } + + #initializePermissions(permissions) { + if (!permissions) { + return; + } + + if (!permissions.includes(_pdfjsLib.PermissionFlag.COPY)) { + this.viewer.classList.add(ENABLE_PERMISSIONS_CLASS); + } + + if (!permissions.includes(_pdfjsLib.PermissionFlag.MODIFY_ANNOTATIONS) && !permissions.includes(_pdfjsLib.PermissionFlag.FILL_INTERACTIVE_FORMS)) { + if (this.#annotationMode === _pdfjsLib.AnnotationMode.ENABLE_FORMS) { + this.#previousAnnotationMode = this.#annotationMode; + this.#annotationMode = _pdfjsLib.AnnotationMode.ENABLE; + } + } + } + + #onePageRenderedOrForceFetch() { + if (document.visibilityState === "hidden" || !this.container.offsetParent || this._getVisiblePages().views.length === 0) { + return Promise.resolve(); + } + + const visibilityChangePromise = new Promise(resolve => { + this.#onVisibilityChange = () => { + if (document.visibilityState !== "hidden") { + return; + } + + resolve(); + document.removeEventListener("visibilitychange", this.#onVisibilityChange); + this.#onVisibilityChange = null; + }; + + document.addEventListener("visibilitychange", this.#onVisibilityChange); + }); + return Promise.race([this._onePageRenderedCapability.promise, visibilityChangePromise]); + } + + setDocument(pdfDocument) { + if (this.pdfDocument) { + this.eventBus.dispatch("pagesdestroy", { + source: this + }); + + this._cancelRendering(); + + this._resetView(); + + if (this.findController) { + this.findController.setDocument(null); + } + + if (this._scriptingManager) { + this._scriptingManager.setDocument(null); + } + } + + this.pdfDocument = pdfDocument; + + if (!pdfDocument) { + return; + } + + const isPureXfa = pdfDocument.isPureXfa; + const pagesCount = pdfDocument.numPages; + const firstPagePromise = pdfDocument.getPage(1); + const optionalContentConfigPromise = pdfDocument.getOptionalContentConfig(); + const permissionsPromise = this.#enablePermissions ? pdfDocument.getPermissions() : Promise.resolve(); + + if (pagesCount > PagesCountLimit.FORCE_SCROLL_MODE_PAGE) { + console.warn("Forcing PAGE-scrolling for performance reasons, given the length of the document."); + const mode = this._scrollMode = _ui_utils.ScrollMode.PAGE; + this.eventBus.dispatch("scrollmodechanged", { + source: this, + mode + }); + } + + this._pagesCapability.promise.then(() => { + this.eventBus.dispatch("pagesloaded", { + source: this, + pagesCount + }); + }, () => {}); + + this._onBeforeDraw = evt => { + const pageView = this._pages[evt.pageNumber - 1]; + + if (!pageView) { + return; + } + + this.#buffer.push(pageView); + }; + + this.eventBus._on("pagerender", this._onBeforeDraw); + + this._onAfterDraw = evt => { + if (evt.cssTransform || this._onePageRenderedCapability.settled) { + return; + } + + this._onePageRenderedCapability.resolve({ + timestamp: evt.timestamp + }); + + this.eventBus._off("pagerendered", this._onAfterDraw); + + this._onAfterDraw = null; + + if (this.#onVisibilityChange) { + document.removeEventListener("visibilitychange", this.#onVisibilityChange); + this.#onVisibilityChange = null; + } + }; + + this.eventBus._on("pagerendered", this._onAfterDraw); + + Promise.all([firstPagePromise, permissionsPromise]).then(([firstPdfPage, permissions]) => { + if (pdfDocument !== this.pdfDocument) { + return; + } + + this._firstPageCapability.resolve(firstPdfPage); + + this._optionalContentConfigPromise = optionalContentConfigPromise; + this.#initializePermissions(permissions); + const viewerElement = this._scrollMode === _ui_utils.ScrollMode.PAGE ? null : this.viewer; + const scale = this.currentScale; + const viewport = firstPdfPage.getViewport({ + scale: scale * _pdfjsLib.PixelsPerInch.PDF_TO_CSS_UNITS + }); + const textLayerFactory = this.textLayerMode !== _ui_utils.TextLayerMode.DISABLE && !isPureXfa ? this : null; + const annotationLayerFactory = this.#annotationMode !== _pdfjsLib.AnnotationMode.DISABLE ? this : null; + const xfaLayerFactory = isPureXfa ? this : null; + + for (let pageNum = 1; pageNum <= pagesCount; ++pageNum) { + const pageView = new _pdf_page_view.PDFPageView({ + container: viewerElement, + eventBus: this.eventBus, + id: pageNum, + scale, + defaultViewport: viewport.clone(), + optionalContentConfigPromise, + renderingQueue: this.renderingQueue, + textLayerFactory, + textLayerMode: this.textLayerMode, + annotationLayerFactory, + annotationMode: this.#annotationMode, + xfaLayerFactory, + textHighlighterFactory: this, + structTreeLayerFactory: this, + imageResourcesPath: this.imageResourcesPath, + renderer: this.renderer, + useOnlyCssZoom: this.useOnlyCssZoom, + maxCanvasPixels: this.maxCanvasPixels, + pageColors: this.pageColors, + l10n: this.l10n + }); + + this._pages.push(pageView); + } + + const firstPageView = this._pages[0]; + + if (firstPageView) { + firstPageView.setPdfPage(firstPdfPage); + this.linkService.cachePageRef(1, firstPdfPage.ref); + } + + if (this._scrollMode === _ui_utils.ScrollMode.PAGE) { + this.#ensurePageViewVisible(); + } else if (this._spreadMode !== _ui_utils.SpreadMode.NONE) { + this._updateSpreadMode(); + } + + this.#onePageRenderedOrForceFetch().then(async () => { + if (this.findController) { + this.findController.setDocument(pdfDocument); + } + + if (this._scriptingManager) { + this._scriptingManager.setDocument(pdfDocument); + } + + if (pdfDocument.loadingParams.disableAutoFetch || pagesCount > PagesCountLimit.FORCE_LAZY_PAGE_INIT) { + this._pagesCapability.resolve(); + + return; + } + + let getPagesLeft = pagesCount - 1; + + if (getPagesLeft <= 0) { + this._pagesCapability.resolve(); + + return; + } + + for (let pageNum = 2; pageNum <= pagesCount; ++pageNum) { + const promise = pdfDocument.getPage(pageNum).then(pdfPage => { + const pageView = this._pages[pageNum - 1]; + + if (!pageView.pdfPage) { + pageView.setPdfPage(pdfPage); + } + + this.linkService.cachePageRef(pageNum, pdfPage.ref); + + if (--getPagesLeft === 0) { + this._pagesCapability.resolve(); + } + }, reason => { + console.error(`Unable to get page ${pageNum} to initialize viewer`, reason); + + if (--getPagesLeft === 0) { + this._pagesCapability.resolve(); + } + }); + + if (pageNum % PagesCountLimit.PAUSE_EAGER_PAGE_INIT === 0) { + await promise; + } + } + }); + this.eventBus.dispatch("pagesinit", { + source: this + }); + pdfDocument.getMetadata().then(({ + info + }) => { + if (pdfDocument !== this.pdfDocument) { + return; + } + + if (info.Language) { + this.viewer.lang = info.Language; + } + }); + + if (this.defaultRenderingQueue) { + this.update(); + } + }).catch(reason => { + console.error("Unable to initialize viewer", reason); + + this._pagesCapability.reject(reason); + }); + } + + setPageLabels(labels) { + if (!this.pdfDocument) { + return; + } + + if (!labels) { + this._pageLabels = null; + } else if (!(Array.isArray(labels) && this.pdfDocument.numPages === labels.length)) { + this._pageLabels = null; + console.error(`setPageLabels: Invalid page labels.`); + } else { + this._pageLabels = labels; + } + + for (let i = 0, ii = this._pages.length; i < ii; i++) { + this._pages[i].setPageLabel(this._pageLabels?.[i] ?? null); + } + } + + _resetView() { + this._pages = []; + this._currentPageNumber = 1; + this._currentScale = _ui_utils.UNKNOWN_SCALE; + this._currentScaleValue = null; + this._pageLabels = null; + this.#buffer = new PDFPageViewBuffer(DEFAULT_CACHE_SIZE); + this._location = null; + this._pagesRotation = 0; + this._optionalContentConfigPromise = null; + this._firstPageCapability = (0, _pdfjsLib.createPromiseCapability)(); + this._onePageRenderedCapability = (0, _pdfjsLib.createPromiseCapability)(); + this._pagesCapability = (0, _pdfjsLib.createPromiseCapability)(); + this._scrollMode = _ui_utils.ScrollMode.VERTICAL; + this._previousScrollMode = _ui_utils.ScrollMode.UNKNOWN; + this._spreadMode = _ui_utils.SpreadMode.NONE; + this.#scrollModePageState = { + previousPageNumber: 1, + scrollDown: true, + pages: [] + }; + + if (this._onBeforeDraw) { + this.eventBus._off("pagerender", this._onBeforeDraw); + + this._onBeforeDraw = null; + } + + if (this._onAfterDraw) { + this.eventBus._off("pagerendered", this._onAfterDraw); + + this._onAfterDraw = null; + } + + if (this.#onVisibilityChange) { + document.removeEventListener("visibilitychange", this.#onVisibilityChange); + this.#onVisibilityChange = null; + } + + this.viewer.textContent = ""; + + this._updateScrollMode(); + + this.viewer.removeAttribute("lang"); + this.viewer.classList.remove(ENABLE_PERMISSIONS_CLASS); + + if (this.#previousAnnotationMode !== null) { + this.#annotationMode = this.#previousAnnotationMode; + this.#previousAnnotationMode = null; + } + } + + #ensurePageViewVisible() { + if (this._scrollMode !== _ui_utils.ScrollMode.PAGE) { + throw new Error("#ensurePageViewVisible: Invalid scrollMode value."); + } + + const pageNumber = this._currentPageNumber, + state = this.#scrollModePageState, + viewer = this.viewer; + viewer.textContent = ""; + state.pages.length = 0; + + if (this._spreadMode === _ui_utils.SpreadMode.NONE && !this.isInPresentationMode) { + const pageView = this._pages[pageNumber - 1]; + viewer.appendChild(pageView.div); + state.pages.push(pageView); + } else { + const pageIndexSet = new Set(), + parity = this._spreadMode - 1; + + if (parity === -1) { + pageIndexSet.add(pageNumber - 1); + } else if (pageNumber % 2 !== parity) { + pageIndexSet.add(pageNumber - 1); + pageIndexSet.add(pageNumber); + } else { + pageIndexSet.add(pageNumber - 2); + pageIndexSet.add(pageNumber - 1); + } + + const spread = document.createElement("div"); + spread.className = "spread"; + + if (this.isInPresentationMode) { + const dummyPage = document.createElement("div"); + dummyPage.className = "dummyPage"; + spread.appendChild(dummyPage); + } + + for (const i of pageIndexSet) { + const pageView = this._pages[i]; + + if (!pageView) { + continue; + } + + spread.appendChild(pageView.div); + state.pages.push(pageView); + } + + viewer.appendChild(spread); + } + + state.scrollDown = pageNumber >= state.previousPageNumber; + state.previousPageNumber = pageNumber; + } + + _scrollUpdate() { + if (this.pagesCount === 0) { + return; + } + + this.update(); + } + + #scrollIntoView(pageView, pageSpot = null) { + const { + div, + id + } = pageView; + + if (this._scrollMode === _ui_utils.ScrollMode.PAGE) { + this._setCurrentPageNumber(id); + + this.#ensurePageViewVisible(); + this.update(); + } + + if (!pageSpot && !this.isInPresentationMode) { + const left = div.offsetLeft + div.clientLeft, + right = left + div.clientWidth; + const { + scrollLeft, + clientWidth + } = this.container; + + if (this._scrollMode === _ui_utils.ScrollMode.HORIZONTAL || left < scrollLeft || right > scrollLeft + clientWidth) { + pageSpot = { + left: 0, + top: 0 + }; + } + } + + (0, _ui_utils.scrollIntoView)(div, pageSpot); + } + + #isSameScale(newScale) { + return newScale === this._currentScale || Math.abs(newScale - this._currentScale) < 1e-15; + } + + _setScaleUpdatePages(newScale, newValue, noScroll = false, preset = false) { + this._currentScaleValue = newValue.toString(); + + if (this.#isSameScale(newScale)) { + if (preset) { + this.eventBus.dispatch("scalechanging", { + source: this, + scale: newScale, + presetValue: newValue + }); + } + + return; + } + + this._doc.style.setProperty("--zoom-factor", newScale); + + const updateArgs = { + scale: newScale + }; + + for (const pageView of this._pages) { + pageView.update(updateArgs); + } + + this._currentScale = newScale; + + if (!noScroll) { + let page = this._currentPageNumber, + dest; + + if (this._location && !(this.isInPresentationMode || this.isChangingPresentationMode)) { + page = this._location.pageNumber; + dest = [null, { + name: "XYZ" + }, this._location.left, this._location.top, null]; + } + + this.scrollPageIntoView({ + pageNumber: page, + destArray: dest, + allowNegativeOffset: true + }); + } + + this.eventBus.dispatch("scalechanging", { + source: this, + scale: newScale, + presetValue: preset ? newValue : undefined + }); + + if (this.defaultRenderingQueue) { + this.update(); + } + + this.updateContainerHeightCss(); + } + + get _pageWidthScaleFactor() { + if (this._spreadMode !== _ui_utils.SpreadMode.NONE && this._scrollMode !== _ui_utils.ScrollMode.HORIZONTAL) { + return 2; + } + + return 1; + } + + _setScale(value, noScroll = false) { + let scale = parseFloat(value); + + if (scale > 0) { + this._setScaleUpdatePages(scale, value, noScroll, false); + } else { + const currentPage = this._pages[this._currentPageNumber - 1]; + + if (!currentPage) { + return; + } + + let hPadding = _ui_utils.SCROLLBAR_PADDING, + vPadding = _ui_utils.VERTICAL_PADDING; + + if (this.isInPresentationMode) { + hPadding = vPadding = 4; + } else if (this.removePageBorders) { + hPadding = vPadding = 0; + } else if (this._scrollMode === _ui_utils.ScrollMode.HORIZONTAL) { + [hPadding, vPadding] = [vPadding, hPadding]; + } + + const pageWidthScale = (this.container.clientWidth - hPadding) / currentPage.width * currentPage.scale / this._pageWidthScaleFactor; + const pageHeightScale = (this.container.clientHeight - vPadding) / currentPage.height * currentPage.scale; + + switch (value) { + case "page-actual": + scale = 1; + break; + + case "page-width": + scale = pageWidthScale; + break; + + case "page-height": + scale = pageHeightScale; + break; + + case "page-fit": + scale = Math.min(pageWidthScale, pageHeightScale); + break; + + case "auto": + const horizontalScale = (0, _ui_utils.isPortraitOrientation)(currentPage) ? pageWidthScale : Math.min(pageHeightScale, pageWidthScale); + scale = Math.min(_ui_utils.MAX_AUTO_SCALE, horizontalScale); + break; + + default: + console.error(`_setScale: "${value}" is an unknown zoom value.`); + return; + } + + this._setScaleUpdatePages(scale, value, noScroll, true); + } + } + + #resetCurrentPageView() { + const pageView = this._pages[this._currentPageNumber - 1]; + + if (this.isInPresentationMode) { + this._setScale(this._currentScaleValue, true); + } + + this.#scrollIntoView(pageView); + } + + pageLabelToPageNumber(label) { + if (!this._pageLabels) { + return null; + } + + const i = this._pageLabels.indexOf(label); + + if (i < 0) { + return null; + } + + return i + 1; + } + + scrollPageIntoView({ + pageNumber, + destArray = null, + allowNegativeOffset = false, + ignoreDestinationZoom = false + }) { + if (!this.pdfDocument) { + return; + } + + const pageView = Number.isInteger(pageNumber) && this._pages[pageNumber - 1]; + + if (!pageView) { + console.error(`scrollPageIntoView: "${pageNumber}" is not a valid pageNumber parameter.`); + return; + } + + if (this.isInPresentationMode || !destArray) { + this._setCurrentPageNumber(pageNumber, true); + + return; + } + + let x = 0, + y = 0; + let width = 0, + height = 0, + widthScale, + heightScale; + const changeOrientation = pageView.rotation % 180 !== 0; + const pageWidth = (changeOrientation ? pageView.height : pageView.width) / pageView.scale / _pdfjsLib.PixelsPerInch.PDF_TO_CSS_UNITS; + const pageHeight = (changeOrientation ? pageView.width : pageView.height) / pageView.scale / _pdfjsLib.PixelsPerInch.PDF_TO_CSS_UNITS; + let scale = 0; + + switch (destArray[1].name) { + case "XYZ": + x = destArray[2]; + y = destArray[3]; + scale = destArray[4]; + x = x !== null ? x : 0; + y = y !== null ? y : pageHeight; + break; + + case "Fit": + case "FitB": + scale = "page-fit"; + break; + + case "FitH": + case "FitBH": + y = destArray[2]; + scale = "page-width"; + + if (y === null && this._location) { + x = this._location.left; + y = this._location.top; + } else if (typeof y !== "number" || y < 0) { + y = pageHeight; + } + + break; + + case "FitV": + case "FitBV": + x = destArray[2]; + width = pageWidth; + height = pageHeight; + scale = "page-height"; + break; + + case "FitR": + x = destArray[2]; + y = destArray[3]; + width = destArray[4] - x; + height = destArray[5] - y; + const hPadding = this.removePageBorders ? 0 : _ui_utils.SCROLLBAR_PADDING; + const vPadding = this.removePageBorders ? 0 : _ui_utils.VERTICAL_PADDING; + widthScale = (this.container.clientWidth - hPadding) / width / _pdfjsLib.PixelsPerInch.PDF_TO_CSS_UNITS; + heightScale = (this.container.clientHeight - vPadding) / height / _pdfjsLib.PixelsPerInch.PDF_TO_CSS_UNITS; + scale = Math.min(Math.abs(widthScale), Math.abs(heightScale)); + break; + + default: + console.error(`scrollPageIntoView: "${destArray[1].name}" is not a valid destination type.`); + return; + } + + if (!ignoreDestinationZoom) { + if (scale && scale !== this._currentScale) { + this.currentScaleValue = scale; + } else if (this._currentScale === _ui_utils.UNKNOWN_SCALE) { + this.currentScaleValue = _ui_utils.DEFAULT_SCALE_VALUE; + } + } + + if (scale === "page-fit" && !destArray[4]) { + this.#scrollIntoView(pageView); + return; + } + + const boundingRect = [pageView.viewport.convertToViewportPoint(x, y), pageView.viewport.convertToViewportPoint(x + width, y + height)]; + let left = Math.min(boundingRect[0][0], boundingRect[1][0]); + let top = Math.min(boundingRect[0][1], boundingRect[1][1]); + + if (!allowNegativeOffset) { + left = Math.max(left, 0); + top = Math.max(top, 0); + } + + this.#scrollIntoView(pageView, { + left, + top + }); + } + + _updateLocation(firstPage) { + const currentScale = this._currentScale; + const currentScaleValue = this._currentScaleValue; + const normalizedScaleValue = parseFloat(currentScaleValue) === currentScale ? Math.round(currentScale * 10000) / 100 : currentScaleValue; + const pageNumber = firstPage.id; + const currentPageView = this._pages[pageNumber - 1]; + const container = this.container; + const topLeft = currentPageView.getPagePoint(container.scrollLeft - firstPage.x, container.scrollTop - firstPage.y); + const intLeft = Math.round(topLeft[0]); + const intTop = Math.round(topLeft[1]); + let pdfOpenParams = `#page=${pageNumber}`; + + if (!this.isInPresentationMode) { + pdfOpenParams += `&zoom=${normalizedScaleValue},${intLeft},${intTop}`; + } + + this._location = { + pageNumber, + scale: normalizedScaleValue, + top: intTop, + left: intLeft, + rotation: this._pagesRotation, + pdfOpenParams + }; + } + + update() { + const visible = this._getVisiblePages(); + + const visiblePages = visible.views, + numVisiblePages = visiblePages.length; + + if (numVisiblePages === 0) { + return; + } + + const newCacheSize = Math.max(DEFAULT_CACHE_SIZE, 2 * numVisiblePages + 1); + this.#buffer.resize(newCacheSize, visible.ids); + this.renderingQueue.renderHighestPriority(visible); + const isSimpleLayout = this._spreadMode === _ui_utils.SpreadMode.NONE && (this._scrollMode === _ui_utils.ScrollMode.PAGE || this._scrollMode === _ui_utils.ScrollMode.VERTICAL); + const currentId = this._currentPageNumber; + let stillFullyVisible = false; + + for (const page of visiblePages) { + if (page.percent < 100) { + break; + } + + if (page.id === currentId && isSimpleLayout) { + stillFullyVisible = true; + break; + } + } + + this._setCurrentPageNumber(stillFullyVisible ? currentId : visiblePages[0].id); + + this._updateLocation(visible.first); + + this.eventBus.dispatch("updateviewarea", { + source: this, + location: this._location + }); + } + + containsElement(element) { + return this.container.contains(element); + } + + focus() { + this.container.focus(); + } + + get _isContainerRtl() { + return getComputedStyle(this.container).direction === "rtl"; + } + + get isInPresentationMode() { + return this.presentationModeState === _ui_utils.PresentationModeState.FULLSCREEN; + } + + get isChangingPresentationMode() { + return this.presentationModeState === _ui_utils.PresentationModeState.CHANGING; + } + + get isHorizontalScrollbarEnabled() { + return this.isInPresentationMode ? false : this.container.scrollWidth > this.container.clientWidth; + } + + get isVerticalScrollbarEnabled() { + return this.isInPresentationMode ? false : this.container.scrollHeight > this.container.clientHeight; + } + + _getVisiblePages() { + const views = this._scrollMode === _ui_utils.ScrollMode.PAGE ? this.#scrollModePageState.pages : this._pages, + horizontal = this._scrollMode === _ui_utils.ScrollMode.HORIZONTAL, + rtl = horizontal && this._isContainerRtl; + return (0, _ui_utils.getVisibleElements)({ + scrollEl: this.container, + views, + sortByVisibility: true, + horizontal, + rtl + }); + } + + isPageVisible(pageNumber) { + if (!this.pdfDocument) { + return false; + } + + if (!(Number.isInteger(pageNumber) && pageNumber > 0 && pageNumber <= this.pagesCount)) { + console.error(`isPageVisible: "${pageNumber}" is not a valid page.`); + return false; + } + + return this._getVisiblePages().ids.has(pageNumber); + } + + isPageCached(pageNumber) { + if (!this.pdfDocument) { + return false; + } + + if (!(Number.isInteger(pageNumber) && pageNumber > 0 && pageNumber <= this.pagesCount)) { + console.error(`isPageCached: "${pageNumber}" is not a valid page.`); + return false; + } + + const pageView = this._pages[pageNumber - 1]; + return this.#buffer.has(pageView); + } + + cleanup() { + for (const pageView of this._pages) { + if (pageView.renderingState !== _ui_utils.RenderingStates.FINISHED) { + pageView.reset(); + } + } + } + + _cancelRendering() { + for (const pageView of this._pages) { + pageView.cancelRendering(); + } + } + + async #ensurePdfPageLoaded(pageView) { + if (pageView.pdfPage) { + return pageView.pdfPage; + } + + try { + const pdfPage = await this.pdfDocument.getPage(pageView.id); + + if (!pageView.pdfPage) { + pageView.setPdfPage(pdfPage); + } + + if (!this.linkService._cachedPageNumber?.(pdfPage.ref)) { + this.linkService.cachePageRef(pageView.id, pdfPage.ref); + } + + return pdfPage; + } catch (reason) { + console.error("Unable to get page for page view", reason); + return null; + } + } + + #getScrollAhead(visible) { + if (visible.first?.id === 1) { + return true; + } else if (visible.last?.id === this.pagesCount) { + return false; + } + + switch (this._scrollMode) { + case _ui_utils.ScrollMode.PAGE: + return this.#scrollModePageState.scrollDown; + + case _ui_utils.ScrollMode.HORIZONTAL: + return this.scroll.right; + } + + return this.scroll.down; + } + + #toggleLoadingIconSpinner(visibleIds) { + for (const id of visibleIds) { + const pageView = this._pages[id - 1]; + pageView?.toggleLoadingIconSpinner(true); + } + + for (const pageView of this.#buffer) { + if (visibleIds.has(pageView.id)) { + continue; + } + + pageView.toggleLoadingIconSpinner(false); + } + } + + forceRendering(currentlyVisiblePages) { + const visiblePages = currentlyVisiblePages || this._getVisiblePages(); + + const scrollAhead = this.#getScrollAhead(visiblePages); + const preRenderExtra = this._spreadMode !== _ui_utils.SpreadMode.NONE && this._scrollMode !== _ui_utils.ScrollMode.HORIZONTAL; + const pageView = this.renderingQueue.getHighestPriority(visiblePages, this._pages, scrollAhead, preRenderExtra); + this.#toggleLoadingIconSpinner(visiblePages.ids); + + if (pageView) { + this.#ensurePdfPageLoaded(pageView).then(() => { + this.renderingQueue.renderView(pageView); + }); + return true; + } + + return false; + } + + createTextLayerBuilder(textLayerDiv, pageIndex, viewport, enhanceTextSelection = false, eventBus, highlighter) { + return new _text_layer_builder.TextLayerBuilder({ + textLayerDiv, + eventBus, + pageIndex, + viewport, + enhanceTextSelection: this.isInPresentationMode ? false : enhanceTextSelection, + highlighter + }); + } + + createTextHighlighter(pageIndex, eventBus) { + return new _text_highlighter.TextHighlighter({ + eventBus, + pageIndex, + findController: this.isInPresentationMode ? null : this.findController + }); + } + + createAnnotationLayerBuilder(pageDiv, pdfPage, annotationStorage = null, imageResourcesPath = "", renderForms = true, l10n = _l10n_utils.NullL10n, enableScripting = null, hasJSActionsPromise = null, mouseState = null, fieldObjectsPromise = null, annotationCanvasMap = null) { + return new _annotation_layer_builder.AnnotationLayerBuilder({ + pageDiv, + pdfPage, + annotationStorage: annotationStorage || this.pdfDocument?.annotationStorage, + imageResourcesPath, + renderForms, + linkService: this.linkService, + downloadManager: this.downloadManager, + l10n, + enableScripting: enableScripting ?? this.enableScripting, + hasJSActionsPromise: hasJSActionsPromise || this.pdfDocument?.hasJSActions(), + fieldObjectsPromise: fieldObjectsPromise || this.pdfDocument?.getFieldObjects(), + mouseState: mouseState || this._scriptingManager?.mouseState, + annotationCanvasMap + }); + } + + createXfaLayerBuilder(pageDiv, pdfPage, annotationStorage = null) { + return new _xfa_layer_builder.XfaLayerBuilder({ + pageDiv, + pdfPage, + annotationStorage: annotationStorage || this.pdfDocument?.annotationStorage, + linkService: this.linkService + }); + } + + createStructTreeLayerBuilder(pdfPage) { + return new _struct_tree_layer_builder.StructTreeLayerBuilder({ + pdfPage + }); + } + + get hasEqualPageSizes() { + const firstPageView = this._pages[0]; + + for (let i = 1, ii = this._pages.length; i < ii; ++i) { + const pageView = this._pages[i]; + + if (pageView.width !== firstPageView.width || pageView.height !== firstPageView.height) { + return false; + } + } + + return true; + } + + getPagesOverview() { + return this._pages.map(pageView => { + const viewport = pageView.pdfPage.getViewport({ + scale: 1 + }); + + if (!this.enablePrintAutoRotate || (0, _ui_utils.isPortraitOrientation)(viewport)) { + return { + width: viewport.width, + height: viewport.height, + rotation: viewport.rotation + }; + } + + return { + width: viewport.height, + height: viewport.width, + rotation: (viewport.rotation - 90) % 360 + }; + }); + } + + get optionalContentConfigPromise() { + if (!this.pdfDocument) { + return Promise.resolve(null); + } + + if (!this._optionalContentConfigPromise) { + return this.pdfDocument.getOptionalContentConfig(); + } + + return this._optionalContentConfigPromise; + } + + set optionalContentConfigPromise(promise) { + if (!(promise instanceof Promise)) { + throw new Error(`Invalid optionalContentConfigPromise: ${promise}`); + } + + if (!this.pdfDocument) { + return; + } + + if (!this._optionalContentConfigPromise) { + return; + } + + this._optionalContentConfigPromise = promise; + const updateArgs = { + optionalContentConfigPromise: promise + }; + + for (const pageView of this._pages) { + pageView.update(updateArgs); + } + + this.update(); + this.eventBus.dispatch("optionalcontentconfigchanged", { + source: this, + promise + }); + } + + get scrollMode() { + return this._scrollMode; + } + + set scrollMode(mode) { + if (this._scrollMode === mode) { + return; + } + + if (!(0, _ui_utils.isValidScrollMode)(mode)) { + throw new Error(`Invalid scroll mode: ${mode}`); + } + + if (this.pagesCount > PagesCountLimit.FORCE_SCROLL_MODE_PAGE) { + return; + } + + this._previousScrollMode = this._scrollMode; + this._scrollMode = mode; + this.eventBus.dispatch("scrollmodechanged", { + source: this, + mode + }); + + this._updateScrollMode(this._currentPageNumber); + } + + _updateScrollMode(pageNumber = null) { + const scrollMode = this._scrollMode, + viewer = this.viewer; + viewer.classList.toggle("scrollHorizontal", scrollMode === _ui_utils.ScrollMode.HORIZONTAL); + viewer.classList.toggle("scrollWrapped", scrollMode === _ui_utils.ScrollMode.WRAPPED); + + if (!this.pdfDocument || !pageNumber) { + return; + } + + if (scrollMode === _ui_utils.ScrollMode.PAGE) { + this.#ensurePageViewVisible(); + } else if (this._previousScrollMode === _ui_utils.ScrollMode.PAGE) { + this._updateSpreadMode(); + } + + if (this._currentScaleValue && isNaN(this._currentScaleValue)) { + this._setScale(this._currentScaleValue, true); + } + + this._setCurrentPageNumber(pageNumber, true); + + this.update(); + } + + get spreadMode() { + return this._spreadMode; + } + + set spreadMode(mode) { + if (this._spreadMode === mode) { + return; + } + + if (!(0, _ui_utils.isValidSpreadMode)(mode)) { + throw new Error(`Invalid spread mode: ${mode}`); + } + + this._spreadMode = mode; + this.eventBus.dispatch("spreadmodechanged", { + source: this, + mode + }); + + this._updateSpreadMode(this._currentPageNumber); + } + + _updateSpreadMode(pageNumber = null) { + if (!this.pdfDocument) { + return; + } + + const viewer = this.viewer, + pages = this._pages; + + if (this._scrollMode === _ui_utils.ScrollMode.PAGE) { + this.#ensurePageViewVisible(); + } else { + viewer.textContent = ""; + + if (this._spreadMode === _ui_utils.SpreadMode.NONE) { + for (const pageView of this._pages) { + viewer.appendChild(pageView.div); + } + } else { + const parity = this._spreadMode - 1; + let spread = null; + + for (let i = 0, ii = pages.length; i < ii; ++i) { + if (spread === null) { + spread = document.createElement("div"); + spread.className = "spread"; + viewer.appendChild(spread); + } else if (i % 2 === parity) { + spread = spread.cloneNode(false); + viewer.appendChild(spread); + } + + spread.appendChild(pages[i].div); + } + } + } + + if (!pageNumber) { + return; + } + + if (this._currentScaleValue && isNaN(this._currentScaleValue)) { + this._setScale(this._currentScaleValue, true); + } + + this._setCurrentPageNumber(pageNumber, true); + + this.update(); + } + + _getPageAdvance(currentPageNumber, previous = false) { + switch (this._scrollMode) { + case _ui_utils.ScrollMode.WRAPPED: + { + const { + views + } = this._getVisiblePages(), + pageLayout = new Map(); + + for (const { + id, + y, + percent, + widthPercent + } of views) { + if (percent === 0 || widthPercent < 100) { + continue; + } + + let yArray = pageLayout.get(y); + + if (!yArray) { + pageLayout.set(y, yArray ||= []); + } + + yArray.push(id); + } + + for (const yArray of pageLayout.values()) { + const currentIndex = yArray.indexOf(currentPageNumber); + + if (currentIndex === -1) { + continue; + } + + const numPages = yArray.length; + + if (numPages === 1) { + break; + } + + if (previous) { + for (let i = currentIndex - 1, ii = 0; i >= ii; i--) { + const currentId = yArray[i], + expectedId = yArray[i + 1] - 1; + + if (currentId < expectedId) { + return currentPageNumber - expectedId; + } + } + } else { + for (let i = currentIndex + 1, ii = numPages; i < ii; i++) { + const currentId = yArray[i], + expectedId = yArray[i - 1] + 1; + + if (currentId > expectedId) { + return expectedId - currentPageNumber; + } + } + } + + if (previous) { + const firstId = yArray[0]; + + if (firstId < currentPageNumber) { + return currentPageNumber - firstId + 1; + } + } else { + const lastId = yArray[numPages - 1]; + + if (lastId > currentPageNumber) { + return lastId - currentPageNumber + 1; + } + } + + break; + } + + break; + } + + case _ui_utils.ScrollMode.HORIZONTAL: + { + break; + } + + case _ui_utils.ScrollMode.PAGE: + case _ui_utils.ScrollMode.VERTICAL: + { + if (this._spreadMode === _ui_utils.SpreadMode.NONE) { + break; + } + + const parity = this._spreadMode - 1; + + if (previous && currentPageNumber % 2 !== parity) { + break; + } else if (!previous && currentPageNumber % 2 === parity) { + break; + } + + const { + views + } = this._getVisiblePages(), + expectedId = previous ? currentPageNumber - 1 : currentPageNumber + 1; + + for (const { + id, + percent, + widthPercent + } of views) { + if (id !== expectedId) { + continue; + } + + if (percent > 0 && widthPercent === 100) { + return 2; + } + + break; + } + + break; + } + } + + return 1; + } + + nextPage() { + const currentPageNumber = this._currentPageNumber, + pagesCount = this.pagesCount; + + if (currentPageNumber >= pagesCount) { + return false; + } + + const advance = this._getPageAdvance(currentPageNumber, false) || 1; + this.currentPageNumber = Math.min(currentPageNumber + advance, pagesCount); + return true; + } + + previousPage() { + const currentPageNumber = this._currentPageNumber; + + if (currentPageNumber <= 1) { + return false; + } + + const advance = this._getPageAdvance(currentPageNumber, true) || 1; + this.currentPageNumber = Math.max(currentPageNumber - advance, 1); + return true; + } + + increaseScale(steps = 1) { + let newScale = this._currentScale; + + do { + newScale = (newScale * _ui_utils.DEFAULT_SCALE_DELTA).toFixed(2); + newScale = Math.ceil(newScale * 10) / 10; + newScale = Math.min(_ui_utils.MAX_SCALE, newScale); + } while (--steps > 0 && newScale < _ui_utils.MAX_SCALE); + + this.currentScaleValue = newScale; + } + + decreaseScale(steps = 1) { + let newScale = this._currentScale; + + do { + newScale = (newScale / _ui_utils.DEFAULT_SCALE_DELTA).toFixed(2); + newScale = Math.floor(newScale * 10) / 10; + newScale = Math.max(_ui_utils.MIN_SCALE, newScale); + } while (--steps > 0 && newScale > _ui_utils.MIN_SCALE); + + this.currentScaleValue = newScale; + } + + updateContainerHeightCss() { + const height = this.container.clientHeight; + + if (height !== this.#previousContainerHeight) { + this.#previousContainerHeight = height; + + this._doc.style.setProperty("--viewer-container-height", `${height}px`); + } + } + +} + +exports.BaseViewer = BaseViewer; + +/***/ }), +/* 29 */ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.AnnotationLayerBuilder = void 0; + +var _pdfjsLib = __webpack_require__(5); + +var _l10n_utils = __webpack_require__(30); + +class AnnotationLayerBuilder { + constructor({ + pageDiv, + pdfPage, + linkService, + downloadManager, + annotationStorage = null, + imageResourcesPath = "", + renderForms = true, + l10n = _l10n_utils.NullL10n, + enableScripting = false, + hasJSActionsPromise = null, + fieldObjectsPromise = null, + mouseState = null, + annotationCanvasMap = null + }) { + this.pageDiv = pageDiv; + this.pdfPage = pdfPage; + this.linkService = linkService; + this.downloadManager = downloadManager; + this.imageResourcesPath = imageResourcesPath; + this.renderForms = renderForms; + this.l10n = l10n; + this.annotationStorage = annotationStorage; + this.enableScripting = enableScripting; + this._hasJSActionsPromise = hasJSActionsPromise; + this._fieldObjectsPromise = fieldObjectsPromise; + this._mouseState = mouseState; + this._annotationCanvasMap = annotationCanvasMap; + this.div = null; + this._cancelled = false; + } + + async render(viewport, intent = "display") { + const [annotations, hasJSActions = false, fieldObjects = null] = await Promise.all([this.pdfPage.getAnnotations({ + intent + }), this._hasJSActionsPromise, this._fieldObjectsPromise]); + + if (this._cancelled || annotations.length === 0) { + return; + } + + const parameters = { + viewport: viewport.clone({ + dontFlip: true + }), + div: this.div, + annotations, + page: this.pdfPage, + imageResourcesPath: this.imageResourcesPath, + renderForms: this.renderForms, + linkService: this.linkService, + downloadManager: this.downloadManager, + annotationStorage: this.annotationStorage, + enableScripting: this.enableScripting, + hasJSActions, + fieldObjects, + mouseState: this._mouseState, + annotationCanvasMap: this._annotationCanvasMap + }; + + if (this.div) { + _pdfjsLib.AnnotationLayer.update(parameters); + } else { + this.div = document.createElement("div"); + this.div.className = "annotationLayer"; + this.pageDiv.appendChild(this.div); + parameters.div = this.div; + + _pdfjsLib.AnnotationLayer.render(parameters); + + this.l10n.translate(this.div); + } + } + + cancel() { + this._cancelled = true; + } + + hide() { + if (!this.div) { + return; + } + + this.div.hidden = true; + } + +} + +exports.AnnotationLayerBuilder = AnnotationLayerBuilder; + +/***/ }), +/* 30 */ +/***/ ((__unused_webpack_module, exports) => { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.NullL10n = void 0; +exports.fixupLangCode = fixupLangCode; +exports.getL10nFallback = getL10nFallback; +const DEFAULT_L10N_STRINGS = { + 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", + print_progress_percent: "{{progress}}%", + "toggle_sidebar.title": "Toggle Sidebar", + "toggle_sidebar_notification2.title": "Toggle Sidebar (document contains outline/attachments/layers)", + 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", + error_version_info: "PDF.js v{{version}} (build: {{build}})", + error_message: "Message: {{message}}", + error_stack: "Stack: {{stack}}", + error_file: "File: {{file}}", + error_line: "Line: {{line}}", + rendering_error: "An error occurred while rendering the page.", + 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: "Loading…", + 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.", + 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." +}; + +function getL10nFallback(key, args) { + switch (key) { + case "find_match_count": + key = `find_match_count[${args.total === 1 ? "one" : "other"}]`; + break; + + case "find_match_count_limit": + key = `find_match_count_limit[${args.limit === 1 ? "one" : "other"}]`; + break; + } + + return DEFAULT_L10N_STRINGS[key] || ""; +} + +const PARTIAL_LANG_CODES = { + en: "en-US", + es: "es-ES", + fy: "fy-NL", + ga: "ga-IE", + gu: "gu-IN", + hi: "hi-IN", + hy: "hy-AM", + nb: "nb-NO", + ne: "ne-NP", + nn: "nn-NO", + pa: "pa-IN", + pt: "pt-PT", + sv: "sv-SE", + zh: "zh-CN" +}; + +function fixupLangCode(langCode) { + return PARTIAL_LANG_CODES[langCode?.toLowerCase()] || langCode; +} + +function formatL10nValue(text, args) { + if (!args) { + return text; + } + + return text.replace(/\{\{\s*(\w+)\s*\}\}/g, (all, name) => { + return name in args ? args[name] : "{{" + name + "}}"; + }); +} + +const NullL10n = { + async getLanguage() { + return "en-us"; + }, + + async getDirection() { + return "ltr"; + }, + + async get(key, args = null, fallback = getL10nFallback(key, args)) { + return formatL10nValue(fallback, args); + }, + + async translate(element) {} + +}; +exports.NullL10n = NullL10n; + +/***/ }), +/* 31 */ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.PDFPageView = void 0; + +var _pdfjsLib = __webpack_require__(5); + +var _ui_utils = __webpack_require__(3); + +var _app_options = __webpack_require__(1); + +var _l10n_utils = __webpack_require__(30); + +const MAX_CANVAS_PIXELS = _app_options.compatibilityParams.maxCanvasPixels || 16777216; + +class PDFPageView { + #annotationMode = _pdfjsLib.AnnotationMode.ENABLE_FORMS; + + constructor(options) { + const container = options.container; + const defaultViewport = options.defaultViewport; + this.id = options.id; + this.renderingId = "page" + this.id; + this.pdfPage = null; + this.pageLabel = null; + this.rotation = 0; + this.scale = options.scale || _ui_utils.DEFAULT_SCALE; + this.viewport = defaultViewport; + this.pdfPageRotate = defaultViewport.rotation; + this._optionalContentConfigPromise = options.optionalContentConfigPromise || null; + this.hasRestrictedScaling = false; + this.textLayerMode = options.textLayerMode ?? _ui_utils.TextLayerMode.ENABLE; + this.#annotationMode = options.annotationMode ?? _pdfjsLib.AnnotationMode.ENABLE_FORMS; + this.imageResourcesPath = options.imageResourcesPath || ""; + this.useOnlyCssZoom = options.useOnlyCssZoom || false; + this.maxCanvasPixels = options.maxCanvasPixels || MAX_CANVAS_PIXELS; + this.pageColors = options.pageColors || null; + this.eventBus = options.eventBus; + this.renderingQueue = options.renderingQueue; + this.textLayerFactory = options.textLayerFactory; + this.annotationLayerFactory = options.annotationLayerFactory; + this.xfaLayerFactory = options.xfaLayerFactory; + this.textHighlighter = options.textHighlighterFactory?.createTextHighlighter(this.id - 1, this.eventBus); + this.structTreeLayerFactory = options.structTreeLayerFactory; + this.renderer = options.renderer || _ui_utils.RendererType.CANVAS; + this.l10n = options.l10n || _l10n_utils.NullL10n; + this.paintTask = null; + this.paintedViewportMap = new WeakMap(); + this.renderingState = _ui_utils.RenderingStates.INITIAL; + this.resume = null; + this._renderError = null; + this._isStandalone = !this.renderingQueue?.hasViewer(); + this._annotationCanvasMap = null; + this.annotationLayer = null; + this.textLayer = null; + this.zoomLayer = null; + this.xfaLayer = null; + this.structTreeLayer = null; + const div = document.createElement("div"); + div.className = "page"; + div.style.width = Math.floor(this.viewport.width) + "px"; + div.style.height = Math.floor(this.viewport.height) + "px"; + div.setAttribute("data-page-number", this.id); + div.setAttribute("role", "region"); + this.l10n.get("page_landmark", { + page: this.id + }).then(msg => { + div.setAttribute("aria-label", msg); + }); + this.div = div; + container?.appendChild(div); + } + + setPdfPage(pdfPage) { + this.pdfPage = pdfPage; + this.pdfPageRotate = pdfPage.rotate; + const totalRotation = (this.rotation + this.pdfPageRotate) % 360; + this.viewport = pdfPage.getViewport({ + scale: this.scale * _pdfjsLib.PixelsPerInch.PDF_TO_CSS_UNITS, + rotation: totalRotation + }); + this.reset(); + } + + destroy() { + this.reset(); + + if (this.pdfPage) { + this.pdfPage.cleanup(); + } + } + + async _renderAnnotationLayer() { + let error = null; + + try { + await this.annotationLayer.render(this.viewport, "display"); + } catch (ex) { + error = ex; + } finally { + this.eventBus.dispatch("annotationlayerrendered", { + source: this, + pageNumber: this.id, + error + }); + } + } + + async _renderXfaLayer() { + let error = null; + + try { + const result = await this.xfaLayer.render(this.viewport, "display"); + + if (this.textHighlighter) { + this._buildXfaTextContentItems(result.textDivs); + } + } catch (ex) { + error = ex; + } finally { + this.eventBus.dispatch("xfalayerrendered", { + source: this, + pageNumber: this.id, + error + }); + } + } + + async _buildXfaTextContentItems(textDivs) { + const text = await this.pdfPage.getTextContent(); + const items = []; + + for (const item of text.items) { + items.push(item.str); + } + + this.textHighlighter.setTextMapping(textDivs, items); + this.textHighlighter.enable(); + } + + _resetZoomLayer(removeFromDOM = false) { + if (!this.zoomLayer) { + return; + } + + const zoomLayerCanvas = this.zoomLayer.firstChild; + this.paintedViewportMap.delete(zoomLayerCanvas); + zoomLayerCanvas.width = 0; + zoomLayerCanvas.height = 0; + + if (removeFromDOM) { + this.zoomLayer.remove(); + } + + this.zoomLayer = null; + } + + reset({ + keepZoomLayer = false, + keepAnnotationLayer = false, + keepXfaLayer = false + } = {}) { + this.cancelRendering({ + keepAnnotationLayer, + keepXfaLayer + }); + this.renderingState = _ui_utils.RenderingStates.INITIAL; + const div = this.div; + div.style.width = Math.floor(this.viewport.width) + "px"; + div.style.height = Math.floor(this.viewport.height) + "px"; + const childNodes = div.childNodes, + zoomLayerNode = keepZoomLayer && this.zoomLayer || null, + annotationLayerNode = keepAnnotationLayer && this.annotationLayer?.div || null, + xfaLayerNode = keepXfaLayer && this.xfaLayer?.div || null; + + for (let i = childNodes.length - 1; i >= 0; i--) { + const node = childNodes[i]; + + switch (node) { + case zoomLayerNode: + case annotationLayerNode: + case xfaLayerNode: + continue; + } + + node.remove(); + } + + div.removeAttribute("data-loaded"); + + if (annotationLayerNode) { + this.annotationLayer.hide(); + } + + if (xfaLayerNode) { + this.xfaLayer.hide(); + } + + if (!zoomLayerNode) { + if (this.canvas) { + this.paintedViewportMap.delete(this.canvas); + this.canvas.width = 0; + this.canvas.height = 0; + delete this.canvas; + } + + this._resetZoomLayer(); + } + + if (this.svg) { + this.paintedViewportMap.delete(this.svg); + delete this.svg; + } + + this.loadingIconDiv = document.createElement("div"); + this.loadingIconDiv.className = "loadingIcon notVisible"; + + if (this._isStandalone) { + this.toggleLoadingIconSpinner(true); + } + + this.loadingIconDiv.setAttribute("role", "img"); + this.l10n.get("loading").then(msg => { + this.loadingIconDiv?.setAttribute("aria-label", msg); + }); + div.appendChild(this.loadingIconDiv); + } + + update({ + scale = 0, + rotation = null, + optionalContentConfigPromise = null + }) { + this.scale = scale || this.scale; + + if (typeof rotation === "number") { + this.rotation = rotation; + } + + if (optionalContentConfigPromise instanceof Promise) { + this._optionalContentConfigPromise = optionalContentConfigPromise; + } + + const totalRotation = (this.rotation + this.pdfPageRotate) % 360; + this.viewport = this.viewport.clone({ + scale: this.scale * _pdfjsLib.PixelsPerInch.PDF_TO_CSS_UNITS, + rotation: totalRotation + }); + + if (this._isStandalone) { + const { + style + } = document.documentElement; + style.setProperty("--zoom-factor", this.scale); + } + + if (this.svg) { + this.cssTransform({ + target: this.svg, + redrawAnnotationLayer: true, + redrawXfaLayer: true + }); + this.eventBus.dispatch("pagerendered", { + source: this, + pageNumber: this.id, + cssTransform: true, + timestamp: performance.now(), + error: this._renderError + }); + return; + } + + let isScalingRestricted = false; + + if (this.canvas && this.maxCanvasPixels > 0) { + const outputScale = this.outputScale; + + if ((Math.floor(this.viewport.width) * outputScale.sx | 0) * (Math.floor(this.viewport.height) * outputScale.sy | 0) > this.maxCanvasPixels) { + isScalingRestricted = true; + } + } + + if (this.canvas) { + if (this.useOnlyCssZoom || this.hasRestrictedScaling && isScalingRestricted) { + this.cssTransform({ + target: this.canvas, + redrawAnnotationLayer: true, + redrawXfaLayer: true + }); + this.eventBus.dispatch("pagerendered", { + source: this, + pageNumber: this.id, + cssTransform: true, + timestamp: performance.now(), + error: this._renderError + }); + return; + } + + if (!this.zoomLayer && !this.canvas.hidden) { + this.zoomLayer = this.canvas.parentNode; + this.zoomLayer.style.position = "absolute"; + } + } + + if (this.zoomLayer) { + this.cssTransform({ + target: this.zoomLayer.firstChild + }); + } + + this.reset({ + keepZoomLayer: true, + keepAnnotationLayer: true, + keepXfaLayer: true + }); + } + + cancelRendering({ + keepAnnotationLayer = false, + keepXfaLayer = false + } = {}) { + if (this.paintTask) { + this.paintTask.cancel(); + this.paintTask = null; + } + + this.resume = null; + + if (this.textLayer) { + this.textLayer.cancel(); + this.textLayer = null; + } + + if (this.annotationLayer && (!keepAnnotationLayer || !this.annotationLayer.div)) { + this.annotationLayer.cancel(); + this.annotationLayer = null; + this._annotationCanvasMap = null; + } + + if (this.xfaLayer && (!keepXfaLayer || !this.xfaLayer.div)) { + this.xfaLayer.cancel(); + this.xfaLayer = null; + this.textHighlighter?.disable(); + } + + if (this._onTextLayerRendered) { + this.eventBus._off("textlayerrendered", this._onTextLayerRendered); + + this._onTextLayerRendered = null; + } + } + + cssTransform({ + target, + redrawAnnotationLayer = false, + redrawXfaLayer = false + }) { + const width = this.viewport.width; + const height = this.viewport.height; + const div = this.div; + target.style.width = target.parentNode.style.width = div.style.width = Math.floor(width) + "px"; + target.style.height = target.parentNode.style.height = div.style.height = Math.floor(height) + "px"; + const relativeRotation = this.viewport.rotation - this.paintedViewportMap.get(target).rotation; + const absRotation = Math.abs(relativeRotation); + let scaleX = 1, + scaleY = 1; + + if (absRotation === 90 || absRotation === 270) { + scaleX = height / width; + scaleY = width / height; + } + + target.style.transform = `rotate(${relativeRotation}deg) scale(${scaleX}, ${scaleY})`; + + if (this.textLayer) { + const textLayerViewport = this.textLayer.viewport; + const textRelativeRotation = this.viewport.rotation - textLayerViewport.rotation; + const textAbsRotation = Math.abs(textRelativeRotation); + let scale = width / textLayerViewport.width; + + if (textAbsRotation === 90 || textAbsRotation === 270) { + scale = width / textLayerViewport.height; + } + + const textLayerDiv = this.textLayer.textLayerDiv; + let transX, transY; + + switch (textAbsRotation) { + case 0: + transX = transY = 0; + break; + + case 90: + transX = 0; + transY = "-" + textLayerDiv.style.height; + break; + + case 180: + transX = "-" + textLayerDiv.style.width; + transY = "-" + textLayerDiv.style.height; + break; + + case 270: + transX = "-" + textLayerDiv.style.width; + transY = 0; + break; + + default: + console.error("Bad rotation value."); + break; + } + + textLayerDiv.style.transform = `rotate(${textAbsRotation}deg) ` + `scale(${scale}) ` + `translate(${transX}, ${transY})`; + textLayerDiv.style.transformOrigin = "0% 0%"; + } + + if (redrawAnnotationLayer && this.annotationLayer) { + this._renderAnnotationLayer(); + } + + if (redrawXfaLayer && this.xfaLayer) { + this._renderXfaLayer(); + } + } + + get width() { + return this.viewport.width; + } + + get height() { + return this.viewport.height; + } + + getPagePoint(x, y) { + return this.viewport.convertToPdfPoint(x, y); + } + + toggleLoadingIconSpinner(viewVisible = false) { + this.loadingIconDiv?.classList.toggle("notVisible", !viewVisible); + } + + draw() { + if (this.renderingState !== _ui_utils.RenderingStates.INITIAL) { + console.error("Must be in new state before drawing"); + this.reset(); + } + + const { + div, + pdfPage + } = this; + + if (!pdfPage) { + this.renderingState = _ui_utils.RenderingStates.FINISHED; + + if (this.loadingIconDiv) { + this.loadingIconDiv.remove(); + delete this.loadingIconDiv; + } + + return Promise.reject(new Error("pdfPage is not loaded")); + } + + this.renderingState = _ui_utils.RenderingStates.RUNNING; + const canvasWrapper = document.createElement("div"); + canvasWrapper.style.width = div.style.width; + canvasWrapper.style.height = div.style.height; + canvasWrapper.classList.add("canvasWrapper"); + + if (this.annotationLayer?.div) { + div.insertBefore(canvasWrapper, this.annotationLayer.div); + } else { + div.appendChild(canvasWrapper); + } + + let textLayer = null; + + if (this.textLayerMode !== _ui_utils.TextLayerMode.DISABLE && this.textLayerFactory) { + const textLayerDiv = document.createElement("div"); + textLayerDiv.className = "textLayer"; + textLayerDiv.style.width = canvasWrapper.style.width; + textLayerDiv.style.height = canvasWrapper.style.height; + + if (this.annotationLayer?.div) { + div.insertBefore(textLayerDiv, this.annotationLayer.div); + } else { + div.appendChild(textLayerDiv); + } + + textLayer = this.textLayerFactory.createTextLayerBuilder(textLayerDiv, this.id - 1, this.viewport, this.textLayerMode === _ui_utils.TextLayerMode.ENABLE_ENHANCE, this.eventBus, this.textHighlighter); + } + + this.textLayer = textLayer; + + if (this.#annotationMode !== _pdfjsLib.AnnotationMode.DISABLE && this.annotationLayerFactory) { + this._annotationCanvasMap ||= new Map(); + this.annotationLayer ||= this.annotationLayerFactory.createAnnotationLayerBuilder(div, pdfPage, null, this.imageResourcesPath, this.#annotationMode === _pdfjsLib.AnnotationMode.ENABLE_FORMS, this.l10n, null, null, null, null, this._annotationCanvasMap); + } + + if (this.xfaLayer?.div) { + div.appendChild(this.xfaLayer.div); + } + + let renderContinueCallback = null; + + if (this.renderingQueue) { + renderContinueCallback = cont => { + if (!this.renderingQueue.isHighestPriority(this)) { + this.renderingState = _ui_utils.RenderingStates.PAUSED; + + this.resume = () => { + this.renderingState = _ui_utils.RenderingStates.RUNNING; + cont(); + }; + + return; + } + + cont(); + }; + } + + const finishPaintTask = async (error = null) => { + if (paintTask === this.paintTask) { + this.paintTask = null; + } + + if (error instanceof _pdfjsLib.RenderingCancelledException) { + this._renderError = null; + return; + } + + this._renderError = error; + this.renderingState = _ui_utils.RenderingStates.FINISHED; + + if (this.loadingIconDiv) { + this.loadingIconDiv.remove(); + delete this.loadingIconDiv; + } + + this._resetZoomLayer(true); + + this.eventBus.dispatch("pagerendered", { + source: this, + pageNumber: this.id, + cssTransform: false, + timestamp: performance.now(), + error: this._renderError + }); + + if (error) { + throw error; + } + }; + + const paintTask = this.renderer === _ui_utils.RendererType.SVG ? this.paintOnSvg(canvasWrapper) : this.paintOnCanvas(canvasWrapper); + paintTask.onRenderContinue = renderContinueCallback; + this.paintTask = paintTask; + const resultPromise = paintTask.promise.then(() => { + return finishPaintTask(null).then(() => { + if (textLayer) { + const readableStream = pdfPage.streamTextContent({ + includeMarkedContent: true + }); + textLayer.setTextContentStream(readableStream); + textLayer.render(); + } + + if (this.annotationLayer) { + this._renderAnnotationLayer(); + } + }); + }, function (reason) { + return finishPaintTask(reason); + }); + + if (this.xfaLayerFactory) { + if (!this.xfaLayer) { + this.xfaLayer = this.xfaLayerFactory.createXfaLayerBuilder(div, pdfPage, null); + } + + this._renderXfaLayer(); + } + + if (this.structTreeLayerFactory && this.textLayer && this.canvas) { + this._onTextLayerRendered = event => { + if (event.pageNumber !== this.id) { + return; + } + + this.eventBus._off("textlayerrendered", this._onTextLayerRendered); + + this._onTextLayerRendered = null; + + if (!this.canvas) { + return; + } + + this.pdfPage.getStructTree().then(tree => { + if (!tree) { + return; + } + + if (!this.canvas) { + return; + } + + const treeDom = this.structTreeLayer.render(tree); + treeDom.classList.add("structTree"); + this.canvas.appendChild(treeDom); + }); + }; + + this.eventBus._on("textlayerrendered", this._onTextLayerRendered); + + this.structTreeLayer = this.structTreeLayerFactory.createStructTreeLayerBuilder(pdfPage); + } + + div.setAttribute("data-loaded", true); + this.eventBus.dispatch("pagerender", { + source: this, + pageNumber: this.id + }); + return resultPromise; + } + + paintOnCanvas(canvasWrapper) { + const renderCapability = (0, _pdfjsLib.createPromiseCapability)(); + const result = { + promise: renderCapability.promise, + + onRenderContinue(cont) { + cont(); + }, + + cancel() { + renderTask.cancel(); + } + + }; + const viewport = this.viewport; + const canvas = document.createElement("canvas"); + canvas.hidden = true; + let isCanvasHidden = true; + + const showCanvas = function () { + if (isCanvasHidden) { + canvas.hidden = false; + isCanvasHidden = false; + } + }; + + canvasWrapper.appendChild(canvas); + this.canvas = canvas; + const ctx = canvas.getContext("2d", { + alpha: false + }); + const outputScale = this.outputScale = new _ui_utils.OutputScale(); + + if (this.useOnlyCssZoom) { + const actualSizeViewport = viewport.clone({ + scale: _pdfjsLib.PixelsPerInch.PDF_TO_CSS_UNITS + }); + outputScale.sx *= actualSizeViewport.width / viewport.width; + outputScale.sy *= actualSizeViewport.height / viewport.height; + } + + if (this.maxCanvasPixels > 0) { + const pixelsInViewport = viewport.width * viewport.height; + const maxScale = Math.sqrt(this.maxCanvasPixels / pixelsInViewport); + + if (outputScale.sx > maxScale || outputScale.sy > maxScale) { + outputScale.sx = maxScale; + outputScale.sy = maxScale; + this.hasRestrictedScaling = true; + } else { + this.hasRestrictedScaling = false; + } + } + + const sfx = (0, _ui_utils.approximateFraction)(outputScale.sx); + const sfy = (0, _ui_utils.approximateFraction)(outputScale.sy); + canvas.width = (0, _ui_utils.roundToDivide)(viewport.width * outputScale.sx, sfx[0]); + canvas.height = (0, _ui_utils.roundToDivide)(viewport.height * outputScale.sy, sfy[0]); + canvas.style.width = (0, _ui_utils.roundToDivide)(viewport.width, sfx[1]) + "px"; + canvas.style.height = (0, _ui_utils.roundToDivide)(viewport.height, sfy[1]) + "px"; + this.paintedViewportMap.set(canvas, viewport); + const transform = outputScale.scaled ? [outputScale.sx, 0, 0, outputScale.sy, 0, 0] : null; + const renderContext = { + canvasContext: ctx, + transform, + viewport: this.viewport, + annotationMode: this.#annotationMode, + optionalContentConfigPromise: this._optionalContentConfigPromise, + annotationCanvasMap: this._annotationCanvasMap, + pageColors: this.pageColors + }; + const renderTask = this.pdfPage.render(renderContext); + + renderTask.onContinue = function (cont) { + showCanvas(); + + if (result.onRenderContinue) { + result.onRenderContinue(cont); + } else { + cont(); + } + }; + + renderTask.promise.then(function () { + showCanvas(); + renderCapability.resolve(); + }, function (error) { + showCanvas(); + renderCapability.reject(error); + }); + return result; + } + + paintOnSvg(wrapper) { + let cancelled = false; + + const ensureNotCancelled = () => { + if (cancelled) { + throw new _pdfjsLib.RenderingCancelledException(`Rendering cancelled, page ${this.id}`, "svg"); + } + }; + + const pdfPage = this.pdfPage; + const actualSizeViewport = this.viewport.clone({ + scale: _pdfjsLib.PixelsPerInch.PDF_TO_CSS_UNITS + }); + const promise = pdfPage.getOperatorList({ + annotationMode: this.#annotationMode + }).then(opList => { + ensureNotCancelled(); + const svgGfx = new _pdfjsLib.SVGGraphics(pdfPage.commonObjs, pdfPage.objs); + return svgGfx.getSVG(opList, actualSizeViewport).then(svg => { + ensureNotCancelled(); + this.svg = svg; + this.paintedViewportMap.set(svg, actualSizeViewport); + svg.style.width = wrapper.style.width; + svg.style.height = wrapper.style.height; + this.renderingState = _ui_utils.RenderingStates.FINISHED; + wrapper.appendChild(svg); + }); + }); + return { + promise, + + onRenderContinue(cont) { + cont(); + }, + + cancel() { + cancelled = true; + } + + }; + } + + setPageLabel(label) { + this.pageLabel = typeof label === "string" ? label : null; + + if (this.pageLabel !== null) { + this.div.setAttribute("data-page-label", this.pageLabel); + } else { + this.div.removeAttribute("data-page-label"); + } + } + +} + +exports.PDFPageView = PDFPageView; + +/***/ }), +/* 32 */ +/***/ ((__unused_webpack_module, exports) => { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.StructTreeLayerBuilder = void 0; +const PDF_ROLE_TO_HTML_ROLE = { + Document: null, + DocumentFragment: null, + Part: "group", + Sect: "group", + Div: "group", + Aside: "note", + NonStruct: "none", + P: null, + H: "heading", + Title: null, + FENote: "note", + Sub: "group", + Lbl: null, + Span: null, + Em: null, + Strong: null, + Link: "link", + Annot: "note", + Form: "form", + Ruby: null, + RB: null, + RT: null, + RP: null, + Warichu: null, + WT: null, + WP: null, + L: "list", + LI: "listitem", + LBody: null, + Table: "table", + TR: "row", + TH: "columnheader", + TD: "cell", + THead: "columnheader", + TBody: null, + TFoot: null, + Caption: null, + Figure: "figure", + Formula: null, + Artifact: null +}; +const HEADING_PATTERN = /^H(\d+)$/; + +class StructTreeLayerBuilder { + constructor({ + pdfPage + }) { + this.pdfPage = pdfPage; + } + + render(structTree) { + return this._walk(structTree); + } + + _setAttributes(structElement, htmlElement) { + if (structElement.alt !== undefined) { + htmlElement.setAttribute("aria-label", structElement.alt); + } + + if (structElement.id !== undefined) { + htmlElement.setAttribute("aria-owns", structElement.id); + } + + if (structElement.lang !== undefined) { + htmlElement.setAttribute("lang", structElement.lang); + } + } + + _walk(node) { + if (!node) { + return null; + } + + const element = document.createElement("span"); + + if ("role" in node) { + const { + role + } = node; + const match = role.match(HEADING_PATTERN); + + if (match) { + element.setAttribute("role", "heading"); + element.setAttribute("aria-level", match[1]); + } else if (PDF_ROLE_TO_HTML_ROLE[role]) { + element.setAttribute("role", PDF_ROLE_TO_HTML_ROLE[role]); + } + } + + this._setAttributes(node, element); + + if (node.children) { + if (node.children.length === 1 && "id" in node.children[0]) { + this._setAttributes(node.children[0], element); + } else { + for (const kid of node.children) { + element.appendChild(this._walk(kid)); + } + } + } + + return element; + } + +} + +exports.StructTreeLayerBuilder = StructTreeLayerBuilder; + +/***/ }), +/* 33 */ +/***/ ((__unused_webpack_module, exports) => { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.TextHighlighter = void 0; + +class TextHighlighter { + constructor({ + findController, + eventBus, + pageIndex + }) { + this.findController = findController; + this.matches = []; + this.eventBus = eventBus; + this.pageIdx = pageIndex; + this._onUpdateTextLayerMatches = null; + this.textDivs = null; + this.textContentItemsStr = null; + this.enabled = false; + } + + setTextMapping(divs, texts) { + this.textDivs = divs; + this.textContentItemsStr = texts; + } + + enable() { + if (!this.textDivs || !this.textContentItemsStr) { + throw new Error("Text divs and strings have not been set."); + } + + if (this.enabled) { + throw new Error("TextHighlighter is already enabled."); + } + + this.enabled = true; + + if (!this._onUpdateTextLayerMatches) { + this._onUpdateTextLayerMatches = evt => { + if (evt.pageIndex === this.pageIdx || evt.pageIndex === -1) { + this._updateMatches(); + } + }; + + this.eventBus._on("updatetextlayermatches", this._onUpdateTextLayerMatches); + } + + this._updateMatches(); + } + + disable() { + if (!this.enabled) { + return; + } + + this.enabled = false; + + if (this._onUpdateTextLayerMatches) { + this.eventBus._off("updatetextlayermatches", this._onUpdateTextLayerMatches); + + this._onUpdateTextLayerMatches = null; + } + } + + _convertMatches(matches, matchesLength) { + if (!matches) { + return []; + } + + const { + textContentItemsStr + } = this; + let i = 0, + iIndex = 0; + const end = textContentItemsStr.length - 1; + const result = []; + + for (let m = 0, mm = matches.length; m < mm; m++) { + let matchIdx = matches[m]; + + while (i !== end && matchIdx >= iIndex + textContentItemsStr[i].length) { + iIndex += textContentItemsStr[i].length; + i++; + } + + if (i === textContentItemsStr.length) { + console.error("Could not find a matching mapping"); + } + + const match = { + begin: { + divIdx: i, + offset: matchIdx - iIndex + } + }; + matchIdx += matchesLength[m]; + + while (i !== end && matchIdx > iIndex + textContentItemsStr[i].length) { + iIndex += textContentItemsStr[i].length; + i++; + } + + match.end = { + divIdx: i, + offset: matchIdx - iIndex + }; + result.push(match); + } + + return result; + } + + _renderMatches(matches) { + if (matches.length === 0) { + return; + } + + const { + findController, + pageIdx + } = this; + const { + textContentItemsStr, + textDivs + } = this; + const isSelectedPage = pageIdx === findController.selected.pageIdx; + const selectedMatchIdx = findController.selected.matchIdx; + const highlightAll = findController.state.highlightAll; + let prevEnd = null; + const infinity = { + divIdx: -1, + offset: undefined + }; + + function beginText(begin, className) { + const divIdx = begin.divIdx; + textDivs[divIdx].textContent = ""; + return appendTextToDiv(divIdx, 0, begin.offset, className); + } + + function appendTextToDiv(divIdx, fromOffset, toOffset, className) { + let div = textDivs[divIdx]; + + if (div.nodeType === Node.TEXT_NODE) { + const span = document.createElement("span"); + div.parentNode.insertBefore(span, div); + span.appendChild(div); + textDivs[divIdx] = span; + div = span; + } + + const content = textContentItemsStr[divIdx].substring(fromOffset, toOffset); + const node = document.createTextNode(content); + + if (className) { + const span = document.createElement("span"); + span.className = `${className} appended`; + span.appendChild(node); + div.appendChild(span); + return className.includes("selected") ? span.offsetLeft : 0; + } + + div.appendChild(node); + return 0; + } + + let i0 = selectedMatchIdx, + i1 = i0 + 1; + + if (highlightAll) { + i0 = 0; + i1 = matches.length; + } else if (!isSelectedPage) { + return; + } + + for (let i = i0; i < i1; i++) { + const match = matches[i]; + const begin = match.begin; + const end = match.end; + const isSelected = isSelectedPage && i === selectedMatchIdx; + const highlightSuffix = isSelected ? " selected" : ""; + let selectedLeft = 0; + + if (!prevEnd || begin.divIdx !== prevEnd.divIdx) { + if (prevEnd !== null) { + appendTextToDiv(prevEnd.divIdx, prevEnd.offset, infinity.offset); + } + + beginText(begin); + } else { + appendTextToDiv(prevEnd.divIdx, prevEnd.offset, begin.offset); + } + + if (begin.divIdx === end.divIdx) { + selectedLeft = appendTextToDiv(begin.divIdx, begin.offset, end.offset, "highlight" + highlightSuffix); + } else { + selectedLeft = appendTextToDiv(begin.divIdx, begin.offset, infinity.offset, "highlight begin" + highlightSuffix); + + for (let n0 = begin.divIdx + 1, n1 = end.divIdx; n0 < n1; n0++) { + textDivs[n0].className = "highlight middle" + highlightSuffix; + } + + beginText(end, "highlight end" + highlightSuffix); + } + + prevEnd = end; + + if (isSelected) { + findController.scrollMatchIntoView({ + element: textDivs[begin.divIdx], + selectedLeft, + pageIndex: pageIdx, + matchIndex: selectedMatchIdx + }); + } + } + + if (prevEnd) { + appendTextToDiv(prevEnd.divIdx, prevEnd.offset, infinity.offset); + } + } + + _updateMatches() { + if (!this.enabled) { + return; + } + + const { + findController, + matches, + pageIdx + } = this; + const { + textContentItemsStr, + textDivs + } = this; + let clearedUntilDivIdx = -1; + + for (let i = 0, ii = matches.length; i < ii; i++) { + const match = matches[i]; + const begin = Math.max(clearedUntilDivIdx, match.begin.divIdx); + + for (let n = begin, end = match.end.divIdx; n <= end; n++) { + const div = textDivs[n]; + div.textContent = textContentItemsStr[n]; + div.className = ""; + } + + clearedUntilDivIdx = match.end.divIdx + 1; + } + + if (!findController?.highlightMatches) { + return; + } + + const pageMatches = findController.pageMatches[pageIdx] || null; + const pageMatchesLength = findController.pageMatchesLength[pageIdx] || null; + this.matches = this._convertMatches(pageMatches, pageMatchesLength); + + this._renderMatches(this.matches); + } + +} + +exports.TextHighlighter = TextHighlighter; + +/***/ }), +/* 34 */ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.TextLayerBuilder = void 0; + +var _pdfjsLib = __webpack_require__(5); + +const EXPAND_DIVS_TIMEOUT = 300; + +class TextLayerBuilder { + constructor({ + textLayerDiv, + eventBus, + pageIndex, + viewport, + highlighter = null, + enhanceTextSelection = false + }) { + this.textLayerDiv = textLayerDiv; + this.eventBus = eventBus; + this.textContent = null; + this.textContentItemsStr = []; + this.textContentStream = null; + this.renderingDone = false; + this.pageNumber = pageIndex + 1; + this.viewport = viewport; + this.textDivs = []; + this.textLayerRenderTask = null; + this.highlighter = highlighter; + this.enhanceTextSelection = enhanceTextSelection; + + this._bindMouse(); + } + + _finishRendering() { + this.renderingDone = true; + + if (!this.enhanceTextSelection) { + const endOfContent = document.createElement("div"); + endOfContent.className = "endOfContent"; + this.textLayerDiv.appendChild(endOfContent); + } + + this.eventBus.dispatch("textlayerrendered", { + source: this, + pageNumber: this.pageNumber, + numTextDivs: this.textDivs.length + }); + } + + render(timeout = 0) { + if (!(this.textContent || this.textContentStream) || this.renderingDone) { + return; + } + + this.cancel(); + this.textDivs.length = 0; + this.highlighter?.setTextMapping(this.textDivs, this.textContentItemsStr); + const textLayerFrag = document.createDocumentFragment(); + this.textLayerRenderTask = (0, _pdfjsLib.renderTextLayer)({ + textContent: this.textContent, + textContentStream: this.textContentStream, + container: textLayerFrag, + viewport: this.viewport, + textDivs: this.textDivs, + textContentItemsStr: this.textContentItemsStr, + timeout, + enhanceTextSelection: this.enhanceTextSelection + }); + this.textLayerRenderTask.promise.then(() => { + this.textLayerDiv.appendChild(textLayerFrag); + + this._finishRendering(); + + this.highlighter?.enable(); + }, function (reason) {}); + } + + cancel() { + if (this.textLayerRenderTask) { + this.textLayerRenderTask.cancel(); + this.textLayerRenderTask = null; + } + + this.highlighter?.disable(); + } + + setTextContentStream(readableStream) { + this.cancel(); + this.textContentStream = readableStream; + } + + setTextContent(textContent) { + this.cancel(); + this.textContent = textContent; + } + + _bindMouse() { + const div = this.textLayerDiv; + let expandDivsTimer = null; + div.addEventListener("mousedown", evt => { + if (this.enhanceTextSelection && this.textLayerRenderTask) { + this.textLayerRenderTask.expandTextDivs(true); + + if (expandDivsTimer) { + clearTimeout(expandDivsTimer); + expandDivsTimer = null; + } + + return; + } + + const end = div.querySelector(".endOfContent"); + + if (!end) { + return; + } + + let adjustTop = evt.target !== div; + adjustTop = adjustTop && window.getComputedStyle(end).getPropertyValue("-moz-user-select") !== "none"; + + if (adjustTop) { + const divBounds = div.getBoundingClientRect(); + const r = Math.max(0, (evt.pageY - divBounds.top) / divBounds.height); + end.style.top = (r * 100).toFixed(2) + "%"; + } + + end.classList.add("active"); + }); + div.addEventListener("mouseup", () => { + if (this.enhanceTextSelection && this.textLayerRenderTask) { + expandDivsTimer = setTimeout(() => { + if (this.textLayerRenderTask) { + this.textLayerRenderTask.expandTextDivs(false); + } + + expandDivsTimer = null; + }, EXPAND_DIVS_TIMEOUT); + return; + } + + const end = div.querySelector(".endOfContent"); + + if (!end) { + return; + } + + end.style.top = ""; + end.classList.remove("active"); + }); + } + +} + +exports.TextLayerBuilder = TextLayerBuilder; + +/***/ }), +/* 35 */ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.XfaLayerBuilder = void 0; + +var _pdfjsLib = __webpack_require__(5); + +class XfaLayerBuilder { + constructor({ + pageDiv, + pdfPage, + annotationStorage = null, + linkService, + xfaHtml = null + }) { + this.pageDiv = pageDiv; + this.pdfPage = pdfPage; + this.annotationStorage = annotationStorage; + this.linkService = linkService; + this.xfaHtml = xfaHtml; + this.div = null; + this._cancelled = false; + } + + render(viewport, intent = "display") { + if (intent === "print") { + const parameters = { + viewport: viewport.clone({ + dontFlip: true + }), + div: this.div, + xfaHtml: this.xfaHtml, + annotationStorage: this.annotationStorage, + linkService: this.linkService, + intent + }; + const div = document.createElement("div"); + this.pageDiv.appendChild(div); + parameters.div = div; + + const result = _pdfjsLib.XfaLayer.render(parameters); + + return Promise.resolve(result); + } + + return this.pdfPage.getXfa().then(xfaHtml => { + if (this._cancelled || !xfaHtml) { + return { + textDivs: [] + }; + } + + const parameters = { + viewport: viewport.clone({ + dontFlip: true + }), + div: this.div, + xfaHtml, + annotationStorage: this.annotationStorage, + linkService: this.linkService, + intent + }; + + if (this.div) { + return _pdfjsLib.XfaLayer.update(parameters); + } + + this.div = document.createElement("div"); + this.pageDiv.appendChild(this.div); + parameters.div = this.div; + return _pdfjsLib.XfaLayer.render(parameters); + }).catch(error => { + console.error(error); + }); + } + + cancel() { + this._cancelled = true; + } + + hide() { + if (!this.div) { + return; + } + + this.div.hidden = true; + } + +} + +exports.XfaLayerBuilder = XfaLayerBuilder; + +/***/ }), +/* 36 */ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.SecondaryToolbar = void 0; + +var _ui_utils = __webpack_require__(3); + +var _pdf_cursor_tools = __webpack_require__(6); + +var _base_viewer = __webpack_require__(28); + +class SecondaryToolbar { + constructor(options, eventBus) { + this.toolbar = options.toolbar; + this.toggleButton = options.toggleButton; + this.buttons = [{ + element: options.presentationModeButton, + eventName: "presentationmode", + close: true + }, { + element: options.printButton, + eventName: "print", + close: true + }, { + element: options.downloadButton, + eventName: "download", + close: true + }, { + element: options.viewBookmarkButton, + eventName: null, + close: true + }, { + element: options.firstPageButton, + eventName: "firstpage", + close: true + }, { + element: options.lastPageButton, + eventName: "lastpage", + close: true + }, { + element: options.pageRotateCwButton, + eventName: "rotatecw", + close: false + }, { + element: options.pageRotateCcwButton, + eventName: "rotateccw", + close: false + }, { + element: options.cursorSelectToolButton, + eventName: "switchcursortool", + eventDetails: { + tool: _pdf_cursor_tools.CursorTool.SELECT + }, + close: true + }, { + element: options.cursorHandToolButton, + eventName: "switchcursortool", + eventDetails: { + tool: _pdf_cursor_tools.CursorTool.HAND + }, + close: true + }, { + element: options.scrollPageButton, + eventName: "switchscrollmode", + eventDetails: { + mode: _ui_utils.ScrollMode.PAGE + }, + close: true + }, { + element: options.scrollVerticalButton, + eventName: "switchscrollmode", + eventDetails: { + mode: _ui_utils.ScrollMode.VERTICAL + }, + close: true + }, { + element: options.scrollHorizontalButton, + eventName: "switchscrollmode", + eventDetails: { + mode: _ui_utils.ScrollMode.HORIZONTAL + }, + close: true + }, { + element: options.scrollWrappedButton, + eventName: "switchscrollmode", + eventDetails: { + mode: _ui_utils.ScrollMode.WRAPPED + }, + close: true + }, { + element: options.spreadNoneButton, + eventName: "switchspreadmode", + eventDetails: { + mode: _ui_utils.SpreadMode.NONE + }, + close: true + }, { + element: options.spreadOddButton, + eventName: "switchspreadmode", + eventDetails: { + mode: _ui_utils.SpreadMode.ODD + }, + close: true + }, { + element: options.spreadEvenButton, + eventName: "switchspreadmode", + eventDetails: { + mode: _ui_utils.SpreadMode.EVEN + }, + close: true + }, { + element: options.documentPropertiesButton, + eventName: "documentproperties", + close: true + }]; + this.buttons.push({ + element: options.openFileButton, + eventName: "openfile", + close: true + }); + this.items = { + firstPage: options.firstPageButton, + lastPage: options.lastPageButton, + pageRotateCw: options.pageRotateCwButton, + pageRotateCcw: options.pageRotateCcwButton + }; + this.eventBus = eventBus; + this.opened = false; + this.reset(); + this.#bindClickListeners(); + this.#bindCursorToolsListener(options); + this.#bindScrollModeListener(options); + this.#bindSpreadModeListener(options); + } + + get isOpen() { + return this.opened; + } + + setPageNumber(pageNumber) { + this.pageNumber = pageNumber; + this.#updateUIState(); + } + + setPagesCount(pagesCount) { + this.pagesCount = pagesCount; + this.#updateUIState(); + } + + reset() { + this.pageNumber = 0; + this.pagesCount = 0; + this.#updateUIState(); + this.eventBus.dispatch("secondarytoolbarreset", { + source: this + }); + } + + #updateUIState() { + this.items.firstPage.disabled = this.pageNumber <= 1; + this.items.lastPage.disabled = this.pageNumber >= this.pagesCount; + this.items.pageRotateCw.disabled = this.pagesCount === 0; + this.items.pageRotateCcw.disabled = this.pagesCount === 0; + } + + #bindClickListeners() { + this.toggleButton.addEventListener("click", this.toggle.bind(this)); + + for (const { + element, + eventName, + close, + eventDetails + } of this.buttons) { + element.addEventListener("click", evt => { + if (eventName !== null) { + const details = { + source: this + }; + + for (const property in eventDetails) { + details[property] = eventDetails[property]; + } + + this.eventBus.dispatch(eventName, details); + } + + if (close) { + this.close(); + } + }); + } + } + + #bindCursorToolsListener({ + cursorSelectToolButton, + cursorHandToolButton + }) { + this.eventBus._on("cursortoolchanged", function ({ + tool + }) { + const isSelect = tool === _pdf_cursor_tools.CursorTool.SELECT, + isHand = tool === _pdf_cursor_tools.CursorTool.HAND; + cursorSelectToolButton.classList.toggle("toggled", isSelect); + cursorHandToolButton.classList.toggle("toggled", isHand); + cursorSelectToolButton.setAttribute("aria-checked", isSelect); + cursorHandToolButton.setAttribute("aria-checked", isHand); + }); + } + + #bindScrollModeListener({ + scrollPageButton, + scrollVerticalButton, + scrollHorizontalButton, + scrollWrappedButton, + spreadNoneButton, + spreadOddButton, + spreadEvenButton + }) { + const scrollModeChanged = ({ + mode + }) => { + const isPage = mode === _ui_utils.ScrollMode.PAGE, + isVertical = mode === _ui_utils.ScrollMode.VERTICAL, + isHorizontal = mode === _ui_utils.ScrollMode.HORIZONTAL, + isWrapped = mode === _ui_utils.ScrollMode.WRAPPED; + scrollPageButton.classList.toggle("toggled", isPage); + scrollVerticalButton.classList.toggle("toggled", isVertical); + scrollHorizontalButton.classList.toggle("toggled", isHorizontal); + scrollWrappedButton.classList.toggle("toggled", isWrapped); + scrollPageButton.setAttribute("aria-checked", isPage); + scrollVerticalButton.setAttribute("aria-checked", isVertical); + scrollHorizontalButton.setAttribute("aria-checked", isHorizontal); + scrollWrappedButton.setAttribute("aria-checked", isWrapped); + const forceScrollModePage = this.pagesCount > _base_viewer.PagesCountLimit.FORCE_SCROLL_MODE_PAGE; + scrollPageButton.disabled = forceScrollModePage; + scrollVerticalButton.disabled = forceScrollModePage; + scrollHorizontalButton.disabled = forceScrollModePage; + scrollWrappedButton.disabled = forceScrollModePage; + spreadNoneButton.disabled = isHorizontal; + spreadOddButton.disabled = isHorizontal; + spreadEvenButton.disabled = isHorizontal; + }; + + this.eventBus._on("scrollmodechanged", scrollModeChanged); + + this.eventBus._on("secondarytoolbarreset", evt => { + if (evt.source === this) { + scrollModeChanged({ + mode: _ui_utils.ScrollMode.VERTICAL + }); + } + }); + } + + #bindSpreadModeListener({ + spreadNoneButton, + spreadOddButton, + spreadEvenButton + }) { + function spreadModeChanged({ + mode + }) { + const isNone = mode === _ui_utils.SpreadMode.NONE, + isOdd = mode === _ui_utils.SpreadMode.ODD, + isEven = mode === _ui_utils.SpreadMode.EVEN; + spreadNoneButton.classList.toggle("toggled", isNone); + spreadOddButton.classList.toggle("toggled", isOdd); + spreadEvenButton.classList.toggle("toggled", isEven); + spreadNoneButton.setAttribute("aria-checked", isNone); + spreadOddButton.setAttribute("aria-checked", isOdd); + spreadEvenButton.setAttribute("aria-checked", isEven); + } + + this.eventBus._on("spreadmodechanged", spreadModeChanged); + + this.eventBus._on("secondarytoolbarreset", evt => { + if (evt.source === this) { + spreadModeChanged({ + mode: _ui_utils.SpreadMode.NONE + }); + } + }); + } + + open() { + if (this.opened) { + return; + } + + this.opened = true; + this.toggleButton.classList.add("toggled"); + this.toggleButton.setAttribute("aria-expanded", "true"); + this.toolbar.classList.remove("hidden"); + } + + close() { + if (!this.opened) { + return; + } + + this.opened = false; + this.toolbar.classList.add("hidden"); + this.toggleButton.classList.remove("toggled"); + this.toggleButton.setAttribute("aria-expanded", "false"); + } + + toggle() { + if (this.opened) { + this.close(); + } else { + this.open(); + } + } + +} + +exports.SecondaryToolbar = SecondaryToolbar; + +/***/ }), +/* 37 */ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.Toolbar = void 0; + +var _ui_utils = __webpack_require__(3); + +const PAGE_NUMBER_LOADING_INDICATOR = "visiblePageIsLoading"; + +class Toolbar { + constructor(options, eventBus, l10n) { + this.toolbar = options.container; + this.eventBus = eventBus; + this.l10n = l10n; + this.buttons = [{ + element: options.previous, + eventName: "previouspage" + }, { + element: options.next, + eventName: "nextpage" + }, { + element: options.zoomIn, + eventName: "zoomin" + }, { + element: options.zoomOut, + eventName: "zoomout" + }, { + element: options.print, + eventName: "print" + }, { + element: options.presentationModeButton, + eventName: "presentationmode" + }, { + element: options.download, + eventName: "download" + }, { + element: options.viewBookmark, + eventName: null + }]; + this.buttons.push({ + element: options.openFile, + eventName: "openfile" + }); + this.items = { + numPages: options.numPages, + pageNumber: options.pageNumber, + scaleSelect: options.scaleSelect, + customScaleOption: options.customScaleOption, + previous: options.previous, + next: options.next, + zoomIn: options.zoomIn, + zoomOut: options.zoomOut + }; + this._wasLocalized = false; + this.reset(); + + this._bindListeners(); + } + + setPageNumber(pageNumber, pageLabel) { + this.pageNumber = pageNumber; + this.pageLabel = pageLabel; + + this._updateUIState(false); + } + + setPagesCount(pagesCount, hasPageLabels) { + this.pagesCount = pagesCount; + this.hasPageLabels = hasPageLabels; + + this._updateUIState(true); + } + + setPageScale(pageScaleValue, pageScale) { + this.pageScaleValue = (pageScaleValue || pageScale).toString(); + this.pageScale = pageScale; + + this._updateUIState(false); + } + + reset() { + this.pageNumber = 0; + this.pageLabel = null; + this.hasPageLabels = false; + this.pagesCount = 0; + this.pageScaleValue = _ui_utils.DEFAULT_SCALE_VALUE; + this.pageScale = _ui_utils.DEFAULT_SCALE; + + this._updateUIState(true); + + this.updateLoadingIndicatorState(); + } + + _bindListeners() { + const { + pageNumber, + scaleSelect + } = this.items; + const self = this; + + for (const { + element, + eventName + } of this.buttons) { + element.addEventListener("click", evt => { + if (eventName !== null) { + this.eventBus.dispatch(eventName, { + source: this + }); + } + }); + } + + pageNumber.addEventListener("click", function () { + this.select(); + }); + pageNumber.addEventListener("change", function () { + self.eventBus.dispatch("pagenumberchanged", { + source: self, + value: this.value + }); + }); + scaleSelect.addEventListener("change", function () { + if (this.value === "custom") { + return; + } + + self.eventBus.dispatch("scalechanged", { + source: self, + value: this.value + }); + }); + scaleSelect.addEventListener("click", function (evt) { + const target = evt.target; + + if (this.value === self.pageScaleValue && target.tagName.toUpperCase() === "OPTION") { + this.blur(); + } + }); + scaleSelect.oncontextmenu = _ui_utils.noContextMenuHandler; + + this.eventBus._on("localized", () => { + this._wasLocalized = true; + this.#adjustScaleWidth(); + + this._updateUIState(true); + }); + } + + _updateUIState(resetNumPages = false) { + if (!this._wasLocalized) { + return; + } + + const { + pageNumber, + pagesCount, + pageScaleValue, + pageScale, + items + } = this; + + if (resetNumPages) { + if (this.hasPageLabels) { + items.pageNumber.type = "text"; + } else { + items.pageNumber.type = "number"; + this.l10n.get("of_pages", { + pagesCount + }).then(msg => { + items.numPages.textContent = msg; + }); + } + + items.pageNumber.max = pagesCount; + } + + if (this.hasPageLabels) { + items.pageNumber.value = this.pageLabel; + this.l10n.get("page_of_pages", { + pageNumber, + pagesCount + }).then(msg => { + items.numPages.textContent = msg; + }); + } else { + items.pageNumber.value = pageNumber; + } + + items.previous.disabled = pageNumber <= 1; + items.next.disabled = pageNumber >= pagesCount; + items.zoomOut.disabled = pageScale <= _ui_utils.MIN_SCALE; + items.zoomIn.disabled = pageScale >= _ui_utils.MAX_SCALE; + this.l10n.get("page_scale_percent", { + scale: Math.round(pageScale * 10000) / 100 + }).then(msg => { + let predefinedValueFound = false; + + for (const option of items.scaleSelect.options) { + if (option.value !== pageScaleValue) { + option.selected = false; + continue; + } + + option.selected = true; + predefinedValueFound = true; + } + + if (!predefinedValueFound) { + items.customScaleOption.textContent = msg; + items.customScaleOption.selected = true; + } + }); + } + + updateLoadingIndicatorState(loading = false) { + const pageNumberInput = this.items.pageNumber; + pageNumberInput.classList.toggle(PAGE_NUMBER_LOADING_INDICATOR, loading); + } + + async #adjustScaleWidth() { + const { + items, + l10n + } = this; + const predefinedValuesPromise = Promise.all([l10n.get("page_scale_auto"), l10n.get("page_scale_actual"), l10n.get("page_scale_fit"), l10n.get("page_scale_width")]); + await _ui_utils.animationStarted; + const style = getComputedStyle(items.scaleSelect), + scaleSelectContainerWidth = parseInt(style.getPropertyValue("--scale-select-container-width"), 10), + scaleSelectOverflow = parseInt(style.getPropertyValue("--scale-select-overflow"), 10); + const canvas = document.createElement("canvas"); + const ctx = canvas.getContext("2d", { + alpha: false + }); + ctx.font = `${style.fontSize} ${style.fontFamily}`; + let maxWidth = 0; + + for (const predefinedValue of await predefinedValuesPromise) { + const { + width + } = ctx.measureText(predefinedValue); + + if (width > maxWidth) { + maxWidth = width; + } + } + + maxWidth += 2 * scaleSelectOverflow; + + if (maxWidth > scaleSelectContainerWidth) { + const doc = document.documentElement; + doc.style.setProperty("--scale-select-container-width", `${maxWidth}px`); + } + + canvas.width = 0; + canvas.height = 0; + } + +} + +exports.Toolbar = Toolbar; + +/***/ }), +/* 38 */ +/***/ ((__unused_webpack_module, exports) => { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.ViewHistory = void 0; +const DEFAULT_VIEW_HISTORY_CACHE_SIZE = 20; + +class ViewHistory { + constructor(fingerprint, cacheSize = DEFAULT_VIEW_HISTORY_CACHE_SIZE) { + this.fingerprint = fingerprint; + this.cacheSize = cacheSize; + this._initializedPromise = this._readFromStorage().then(databaseStr => { + const database = JSON.parse(databaseStr || "{}"); + let index = -1; + + if (!Array.isArray(database.files)) { + database.files = []; + } else { + while (database.files.length >= this.cacheSize) { + database.files.shift(); + } + + for (let i = 0, ii = database.files.length; i < ii; i++) { + const branch = database.files[i]; + + if (branch.fingerprint === this.fingerprint) { + index = i; + break; + } + } + } + + if (index === -1) { + index = database.files.push({ + fingerprint: this.fingerprint + }) - 1; + } + + this.file = database.files[index]; + this.database = database; + }); + } + + async _writeToStorage() { + const databaseStr = JSON.stringify(this.database); + localStorage.setItem("pdfjs.history", databaseStr); + } + + async _readFromStorage() { + return localStorage.getItem("pdfjs.history"); + } + + async set(name, val) { + await this._initializedPromise; + this.file[name] = val; + return this._writeToStorage(); + } + + async setMultiple(properties) { + await this._initializedPromise; + + for (const name in properties) { + this.file[name] = properties[name]; + } + + return this._writeToStorage(); + } + + async get(name, defaultValue) { + await this._initializedPromise; + const val = this.file[name]; + return val !== undefined ? val : defaultValue; + } + + async getMultiple(properties) { + await this._initializedPromise; + const values = Object.create(null); + + for (const name in properties) { + const val = this.file[name]; + values[name] = val !== undefined ? val : properties[name]; + } + + return values; + } + +} + +exports.ViewHistory = ViewHistory; + +/***/ }), +/* 39 */ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.GenericCom = void 0; + +var _app = __webpack_require__(2); + +var _preferences = __webpack_require__(40); + +var _download_manager = __webpack_require__(41); + +var _genericl10n = __webpack_require__(42); + +var _generic_scripting = __webpack_require__(44); + +; +const GenericCom = {}; +exports.GenericCom = GenericCom; + +class GenericPreferences extends _preferences.BasePreferences { + async _writeToStorage(prefObj) { + localStorage.setItem("pdfjs.preferences", JSON.stringify(prefObj)); + } + + async _readFromStorage(prefObj) { + return JSON.parse(localStorage.getItem("pdfjs.preferences")); + } + +} + +class GenericExternalServices extends _app.DefaultExternalServices { + static createDownloadManager(options) { + return new _download_manager.DownloadManager(); + } + + static createPreferences() { + return new GenericPreferences(); + } + + static createL10n({ + locale = "en-US" + }) { + return new _genericl10n.GenericL10n(locale); + } + + static createScripting({ + sandboxBundleSrc + }) { + return new _generic_scripting.GenericScripting(sandboxBundleSrc); + } + +} + +_app.PDFViewerApplication.externalServices = GenericExternalServices; + +/***/ }), +/* 40 */ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.BasePreferences = void 0; + +var _app_options = __webpack_require__(1); + +class BasePreferences { + #defaults = Object.freeze({ + "annotationMode": 2, + "cursorToolOnLoad": 0, + "defaultZoomValue": "", + "disablePageLabels": false, + "enablePermissions": false, + "enablePrintAutoRotate": true, + "enableScripting": true, + "externalLinkTarget": 0, + "historyUpdateUrl": false, + "ignoreDestinationZoom": false, + "pageColorsBackground": "Canvas", + "pageColorsForeground": "CanvasText", + "pdfBugEnabled": false, + "renderer": "canvas", + "sidebarViewOnLoad": -1, + "scrollModeOnLoad": -1, + "spreadModeOnLoad": -1, + "textLayerMode": 1, + "useOnlyCssZoom": false, + "viewerCssTheme": 0, + "viewOnLoad": 0, + "disableAutoFetch": false, + "disableFontFace": false, + "disableRange": false, + "disableStream": false, + "enableXfa": true + }); + #prefs = Object.create(null); + #initializedPromise = null; + + constructor() { + if (this.constructor === BasePreferences) { + throw new Error("Cannot initialize BasePreferences."); + } + + this.#initializedPromise = this._readFromStorage(this.#defaults).then(prefs => { + for (const name in this.#defaults) { + const prefValue = prefs?.[name]; + + if (typeof prefValue === typeof this.#defaults[name]) { + this.#prefs[name] = prefValue; + } + } + }); + } + + async _writeToStorage(prefObj) { + throw new Error("Not implemented: _writeToStorage"); + } + + async _readFromStorage(prefObj) { + throw new Error("Not implemented: _readFromStorage"); + } + + async reset() { + await this.#initializedPromise; + const prefs = this.#prefs; + this.#prefs = Object.create(null); + return this._writeToStorage(this.#defaults).catch(reason => { + this.#prefs = prefs; + throw reason; + }); + } + + async set(name, value) { + await this.#initializedPromise; + const defaultValue = this.#defaults[name], + prefs = this.#prefs; + + if (defaultValue === undefined) { + throw new Error(`Set preference: "${name}" is undefined.`); + } else if (value === undefined) { + throw new Error("Set preference: no value is specified."); + } + + const valueType = typeof value, + defaultType = typeof defaultValue; + + if (valueType !== defaultType) { + if (valueType === "number" && defaultType === "string") { + value = value.toString(); + } else { + throw new Error(`Set preference: "${value}" is a ${valueType}, expected a ${defaultType}.`); + } + } else { + if (valueType === "number" && !Number.isInteger(value)) { + throw new Error(`Set preference: "${value}" must be an integer.`); + } + } + + this.#prefs[name] = value; + return this._writeToStorage(this.#prefs).catch(reason => { + this.#prefs = prefs; + throw reason; + }); + } + + async get(name) { + await this.#initializedPromise; + const defaultValue = this.#defaults[name]; + + if (defaultValue === undefined) { + throw new Error(`Get preference: "${name}" is undefined.`); + } + + return this.#prefs[name] ?? defaultValue; + } + + async getAll() { + await this.#initializedPromise; + const obj = Object.create(null); + + for (const name in this.#defaults) { + obj[name] = this.#prefs[name] ?? this.#defaults[name]; + } + + return obj; + } + +} + +exports.BasePreferences = BasePreferences; + +/***/ }), +/* 41 */ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.DownloadManager = void 0; + +var _pdfjsLib = __webpack_require__(5); + +; + +function download(blobUrl, filename) { + const a = document.createElement("a"); + + if (!a.click) { + throw new Error('DownloadManager: "a.click()" is not supported.'); + } + + a.href = blobUrl; + a.target = "_parent"; + + if ("download" in a) { + a.download = filename; + } + + (document.body || document.documentElement).appendChild(a); + a.click(); + a.remove(); +} + +class DownloadManager { + constructor() { + this._openBlobUrls = new WeakMap(); + } + + downloadUrl(url, filename) { + if (!(0, _pdfjsLib.createValidAbsoluteUrl)(url, "http://example.com")) { + console.error(`downloadUrl - not a valid URL: ${url}`); + return; + } + + download(url + "#pdfjs.action=download", filename); + } + + downloadData(data, filename, contentType) { + const blobUrl = URL.createObjectURL(new Blob([data], { + type: contentType + })); + download(blobUrl, filename); + } + + openOrDownloadData(element, data, filename) { + const isPdfData = (0, _pdfjsLib.isPdfFile)(filename); + const contentType = isPdfData ? "application/pdf" : ""; + + if (isPdfData) { + let blobUrl = this._openBlobUrls.get(element); + + if (!blobUrl) { + blobUrl = URL.createObjectURL(new Blob([data], { + type: contentType + })); + + this._openBlobUrls.set(element, blobUrl); + } + + let viewerUrl; + viewerUrl = "?file=" + encodeURIComponent(blobUrl + "#" + filename); + + try { + window.open(viewerUrl); + return true; + } catch (ex) { + console.error(`openOrDownloadData: ${ex}`); + URL.revokeObjectURL(blobUrl); + + this._openBlobUrls.delete(element); + } + } + + this.downloadData(data, filename, contentType); + return false; + } + + download(blob, url, filename, sourceEventType = "download") { + const blobUrl = URL.createObjectURL(blob); + download(blobUrl, filename); + } + +} + +exports.DownloadManager = DownloadManager; + +/***/ }), +/* 42 */ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.GenericL10n = void 0; + +__webpack_require__(43); + +var _l10n_utils = __webpack_require__(30); + +const webL10n = document.webL10n; + +class GenericL10n { + constructor(lang) { + this._lang = lang; + this._ready = new Promise((resolve, reject) => { + webL10n.setLanguage((0, _l10n_utils.fixupLangCode)(lang), () => { + resolve(webL10n); + }); + }); + } + + async getLanguage() { + const l10n = await this._ready; + return l10n.getLanguage(); + } + + async getDirection() { + const l10n = await this._ready; + return l10n.getDirection(); + } + + async get(key, args = null, fallback = (0, _l10n_utils.getL10nFallback)(key, args)) { + const l10n = await this._ready; + return l10n.get(key, args, fallback); + } + + async translate(element) { + const l10n = await this._ready; + return l10n.translate(element); + } + +} + +exports.GenericL10n = GenericL10n; + +/***/ }), +/* 43 */ +/***/ (() => { + + + +document.webL10n = function (window, document, undefined) { + var gL10nData = {}; + var gTextData = ''; + var gTextProp = 'textContent'; + var gLanguage = ''; + var gMacros = {}; + var gReadyState = 'loading'; + var gAsyncResourceLoading = true; + + function getL10nResourceLinks() { + return document.querySelectorAll('link[type="application/l10n"]'); + } + + function getL10nDictionary() { + var script = document.querySelector('script[type="application/l10n"]'); + return script ? JSON.parse(script.innerHTML) : null; + } + + function getTranslatableChildren(element) { + return element ? element.querySelectorAll('*[data-l10n-id]') : []; + } + + function getL10nAttributes(element) { + if (!element) return {}; + var l10nId = element.getAttribute('data-l10n-id'); + var l10nArgs = element.getAttribute('data-l10n-args'); + var args = {}; + + if (l10nArgs) { + try { + args = JSON.parse(l10nArgs); + } catch (e) { + console.warn('could not parse arguments for #' + l10nId); + } + } + + return { + id: l10nId, + args: args + }; + } + + function xhrLoadText(url, onSuccess, onFailure) { + onSuccess = onSuccess || function _onSuccess(data) {}; + + onFailure = onFailure || function _onFailure() {}; + + var xhr = new XMLHttpRequest(); + xhr.open('GET', url, gAsyncResourceLoading); + + if (xhr.overrideMimeType) { + xhr.overrideMimeType('text/plain; charset=utf-8'); + } + + xhr.onreadystatechange = function () { + if (xhr.readyState == 4) { + if (xhr.status == 200 || xhr.status === 0) { + onSuccess(xhr.responseText); + } else { + onFailure(); + } + } + }; + + xhr.onerror = onFailure; + xhr.ontimeout = onFailure; + + try { + xhr.send(null); + } catch (e) { + onFailure(); + } + } + + function parseResource(href, lang, successCallback, failureCallback) { + var baseURL = href.replace(/[^\/]*$/, '') || './'; + + function evalString(text) { + if (text.lastIndexOf('\\') < 0) return text; + return text.replace(/\\\\/g, '\\').replace(/\\n/g, '\n').replace(/\\r/g, '\r').replace(/\\t/g, '\t').replace(/\\b/g, '\b').replace(/\\f/g, '\f').replace(/\\{/g, '{').replace(/\\}/g, '}').replace(/\\"/g, '"').replace(/\\'/g, "'"); + } + + function parseProperties(text, parsedPropertiesCallback) { + var dictionary = {}; + var reBlank = /^\s*|\s*$/; + var reComment = /^\s*#|^\s*$/; + var reSection = /^\s*\[(.*)\]\s*$/; + var reImport = /^\s*@import\s+url\((.*)\)\s*$/i; + var reSplit = /^([^=\s]*)\s*=\s*(.+)$/; + + function parseRawLines(rawText, extendedSyntax, parsedRawLinesCallback) { + var entries = rawText.replace(reBlank, '').split(/[\r\n]+/); + var currentLang = '*'; + var genericLang = lang.split('-', 1)[0]; + var skipLang = false; + var match = ''; + + function nextEntry() { + while (true) { + if (!entries.length) { + parsedRawLinesCallback(); + return; + } + + var line = entries.shift(); + if (reComment.test(line)) continue; + + if (extendedSyntax) { + match = reSection.exec(line); + + if (match) { + currentLang = match[1].toLowerCase(); + skipLang = currentLang !== '*' && currentLang !== lang && currentLang !== genericLang; + continue; + } else if (skipLang) { + continue; + } + + match = reImport.exec(line); + + if (match) { + loadImport(baseURL + match[1], nextEntry); + return; + } + } + + var tmp = line.match(reSplit); + + if (tmp && tmp.length == 3) { + dictionary[tmp[1]] = evalString(tmp[2]); + } + } + } + + nextEntry(); + } + + function loadImport(url, callback) { + xhrLoadText(url, function (content) { + parseRawLines(content, false, callback); + }, function () { + console.warn(url + ' not found.'); + callback(); + }); + } + + parseRawLines(text, true, function () { + parsedPropertiesCallback(dictionary); + }); + } + + xhrLoadText(href, function (response) { + gTextData += response; + parseProperties(response, function (data) { + for (var key in data) { + var id, + prop, + index = key.lastIndexOf('.'); + + if (index > 0) { + id = key.substring(0, index); + prop = key.substring(index + 1); + } else { + id = key; + prop = gTextProp; + } + + if (!gL10nData[id]) { + gL10nData[id] = {}; + } + + gL10nData[id][prop] = data[key]; + } + + if (successCallback) { + successCallback(); + } + }); + }, failureCallback); + } + + function loadLocale(lang, callback) { + if (lang) { + lang = lang.toLowerCase(); + } + + callback = callback || function _callback() {}; + + clear(); + gLanguage = lang; + var langLinks = getL10nResourceLinks(); + var langCount = langLinks.length; + + if (langCount === 0) { + var dict = getL10nDictionary(); + + if (dict && dict.locales && dict.default_locale) { + console.log('using the embedded JSON directory, early way out'); + gL10nData = dict.locales[lang]; + + if (!gL10nData) { + var defaultLocale = dict.default_locale.toLowerCase(); + + for (var anyCaseLang in dict.locales) { + anyCaseLang = anyCaseLang.toLowerCase(); + + if (anyCaseLang === lang) { + gL10nData = dict.locales[lang]; + break; + } else if (anyCaseLang === defaultLocale) { + gL10nData = dict.locales[defaultLocale]; + } + } + } + + callback(); + } else { + console.log('no resource to load, early way out'); + } + + gReadyState = 'complete'; + return; + } + + var onResourceLoaded = null; + var gResourceCount = 0; + + onResourceLoaded = function () { + gResourceCount++; + + if (gResourceCount >= langCount) { + callback(); + gReadyState = 'complete'; + } + }; + + function L10nResourceLink(link) { + var href = link.href; + + this.load = function (lang, callback) { + parseResource(href, lang, callback, function () { + console.warn(href + ' not found.'); + console.warn('"' + lang + '" resource not found'); + gLanguage = ''; + callback(); + }); + }; + } + + for (var i = 0; i < langCount; i++) { + var resource = new L10nResourceLink(langLinks[i]); + resource.load(lang, onResourceLoaded); + } + } + + function clear() { + gL10nData = {}; + gTextData = ''; + gLanguage = ''; + } + + function getPluralRules(lang) { + var locales2rules = { + 'af': 3, + 'ak': 4, + 'am': 4, + 'ar': 1, + 'asa': 3, + 'az': 0, + 'be': 11, + 'bem': 3, + 'bez': 3, + 'bg': 3, + 'bh': 4, + 'bm': 0, + 'bn': 3, + 'bo': 0, + 'br': 20, + 'brx': 3, + 'bs': 11, + 'ca': 3, + 'cgg': 3, + 'chr': 3, + 'cs': 12, + 'cy': 17, + 'da': 3, + 'de': 3, + 'dv': 3, + 'dz': 0, + 'ee': 3, + 'el': 3, + 'en': 3, + 'eo': 3, + 'es': 3, + 'et': 3, + 'eu': 3, + 'fa': 0, + 'ff': 5, + 'fi': 3, + 'fil': 4, + 'fo': 3, + 'fr': 5, + 'fur': 3, + 'fy': 3, + 'ga': 8, + 'gd': 24, + 'gl': 3, + 'gsw': 3, + 'gu': 3, + 'guw': 4, + 'gv': 23, + 'ha': 3, + 'haw': 3, + 'he': 2, + 'hi': 4, + 'hr': 11, + 'hu': 0, + 'id': 0, + 'ig': 0, + 'ii': 0, + 'is': 3, + 'it': 3, + 'iu': 7, + 'ja': 0, + 'jmc': 3, + 'jv': 0, + 'ka': 0, + 'kab': 5, + 'kaj': 3, + 'kcg': 3, + 'kde': 0, + 'kea': 0, + 'kk': 3, + 'kl': 3, + 'km': 0, + 'kn': 0, + 'ko': 0, + 'ksb': 3, + 'ksh': 21, + 'ku': 3, + 'kw': 7, + 'lag': 18, + 'lb': 3, + 'lg': 3, + 'ln': 4, + 'lo': 0, + 'lt': 10, + 'lv': 6, + 'mas': 3, + 'mg': 4, + 'mk': 16, + 'ml': 3, + 'mn': 3, + 'mo': 9, + 'mr': 3, + 'ms': 0, + 'mt': 15, + 'my': 0, + 'nah': 3, + 'naq': 7, + 'nb': 3, + 'nd': 3, + 'ne': 3, + 'nl': 3, + 'nn': 3, + 'no': 3, + 'nr': 3, + 'nso': 4, + 'ny': 3, + 'nyn': 3, + 'om': 3, + 'or': 3, + 'pa': 3, + 'pap': 3, + 'pl': 13, + 'ps': 3, + 'pt': 3, + 'rm': 3, + 'ro': 9, + 'rof': 3, + 'ru': 11, + 'rwk': 3, + 'sah': 0, + 'saq': 3, + 'se': 7, + 'seh': 3, + 'ses': 0, + 'sg': 0, + 'sh': 11, + 'shi': 19, + 'sk': 12, + 'sl': 14, + 'sma': 7, + 'smi': 7, + 'smj': 7, + 'smn': 7, + 'sms': 7, + 'sn': 3, + 'so': 3, + 'sq': 3, + 'sr': 11, + 'ss': 3, + 'ssy': 3, + 'st': 3, + 'sv': 3, + 'sw': 3, + 'syr': 3, + 'ta': 3, + 'te': 3, + 'teo': 3, + 'th': 0, + 'ti': 4, + 'tig': 3, + 'tk': 3, + 'tl': 4, + 'tn': 3, + 'to': 0, + 'tr': 0, + 'ts': 3, + 'tzm': 22, + 'uk': 11, + 'ur': 3, + 've': 3, + 'vi': 0, + 'vun': 3, + 'wa': 4, + 'wae': 3, + 'wo': 0, + 'xh': 3, + 'xog': 3, + 'yo': 0, + 'zh': 0, + 'zu': 3 + }; + + function isIn(n, list) { + return list.indexOf(n) !== -1; + } + + function isBetween(n, start, end) { + return start <= n && n <= end; + } + + var pluralRules = { + '0': function (n) { + return 'other'; + }, + '1': function (n) { + if (isBetween(n % 100, 3, 10)) return 'few'; + if (n === 0) return 'zero'; + if (isBetween(n % 100, 11, 99)) return 'many'; + if (n == 2) return 'two'; + if (n == 1) return 'one'; + return 'other'; + }, + '2': function (n) { + if (n !== 0 && n % 10 === 0) return 'many'; + if (n == 2) return 'two'; + if (n == 1) return 'one'; + return 'other'; + }, + '3': function (n) { + if (n == 1) return 'one'; + return 'other'; + }, + '4': function (n) { + if (isBetween(n, 0, 1)) return 'one'; + return 'other'; + }, + '5': function (n) { + if (isBetween(n, 0, 2) && n != 2) return 'one'; + return 'other'; + }, + '6': function (n) { + if (n === 0) return 'zero'; + if (n % 10 == 1 && n % 100 != 11) return 'one'; + return 'other'; + }, + '7': function (n) { + if (n == 2) return 'two'; + if (n == 1) return 'one'; + return 'other'; + }, + '8': function (n) { + if (isBetween(n, 3, 6)) return 'few'; + if (isBetween(n, 7, 10)) return 'many'; + if (n == 2) return 'two'; + if (n == 1) return 'one'; + return 'other'; + }, + '9': function (n) { + if (n === 0 || n != 1 && isBetween(n % 100, 1, 19)) return 'few'; + if (n == 1) return 'one'; + return 'other'; + }, + '10': function (n) { + if (isBetween(n % 10, 2, 9) && !isBetween(n % 100, 11, 19)) return 'few'; + if (n % 10 == 1 && !isBetween(n % 100, 11, 19)) return 'one'; + return 'other'; + }, + '11': function (n) { + if (isBetween(n % 10, 2, 4) && !isBetween(n % 100, 12, 14)) return 'few'; + if (n % 10 === 0 || isBetween(n % 10, 5, 9) || isBetween(n % 100, 11, 14)) return 'many'; + if (n % 10 == 1 && n % 100 != 11) return 'one'; + return 'other'; + }, + '12': function (n) { + if (isBetween(n, 2, 4)) return 'few'; + if (n == 1) return 'one'; + return 'other'; + }, + '13': function (n) { + if (isBetween(n % 10, 2, 4) && !isBetween(n % 100, 12, 14)) return 'few'; + if (n != 1 && isBetween(n % 10, 0, 1) || isBetween(n % 10, 5, 9) || isBetween(n % 100, 12, 14)) return 'many'; + if (n == 1) return 'one'; + return 'other'; + }, + '14': function (n) { + if (isBetween(n % 100, 3, 4)) return 'few'; + if (n % 100 == 2) return 'two'; + if (n % 100 == 1) return 'one'; + return 'other'; + }, + '15': function (n) { + if (n === 0 || isBetween(n % 100, 2, 10)) return 'few'; + if (isBetween(n % 100, 11, 19)) return 'many'; + if (n == 1) return 'one'; + return 'other'; + }, + '16': function (n) { + if (n % 10 == 1 && n != 11) return 'one'; + return 'other'; + }, + '17': function (n) { + if (n == 3) return 'few'; + if (n === 0) return 'zero'; + if (n == 6) return 'many'; + if (n == 2) return 'two'; + if (n == 1) return 'one'; + return 'other'; + }, + '18': function (n) { + if (n === 0) return 'zero'; + if (isBetween(n, 0, 2) && n !== 0 && n != 2) return 'one'; + return 'other'; + }, + '19': function (n) { + if (isBetween(n, 2, 10)) return 'few'; + if (isBetween(n, 0, 1)) return 'one'; + return 'other'; + }, + '20': function (n) { + if ((isBetween(n % 10, 3, 4) || n % 10 == 9) && !(isBetween(n % 100, 10, 19) || isBetween(n % 100, 70, 79) || isBetween(n % 100, 90, 99))) return 'few'; + if (n % 1000000 === 0 && n !== 0) return 'many'; + if (n % 10 == 2 && !isIn(n % 100, [12, 72, 92])) return 'two'; + if (n % 10 == 1 && !isIn(n % 100, [11, 71, 91])) return 'one'; + return 'other'; + }, + '21': function (n) { + if (n === 0) return 'zero'; + if (n == 1) return 'one'; + return 'other'; + }, + '22': function (n) { + if (isBetween(n, 0, 1) || isBetween(n, 11, 99)) return 'one'; + return 'other'; + }, + '23': function (n) { + if (isBetween(n % 10, 1, 2) || n % 20 === 0) return 'one'; + return 'other'; + }, + '24': function (n) { + if (isBetween(n, 3, 10) || isBetween(n, 13, 19)) return 'few'; + if (isIn(n, [2, 12])) return 'two'; + if (isIn(n, [1, 11])) return 'one'; + return 'other'; + } + }; + var index = locales2rules[lang.replace(/-.*$/, '')]; + + if (!(index in pluralRules)) { + console.warn('plural form unknown for [' + lang + ']'); + return function () { + return 'other'; + }; + } + + return pluralRules[index]; + } + + gMacros.plural = function (str, param, key, prop) { + var n = parseFloat(param); + if (isNaN(n)) return str; + if (prop != gTextProp) return str; + + if (!gMacros._pluralRules) { + gMacros._pluralRules = getPluralRules(gLanguage); + } + + var index = '[' + gMacros._pluralRules(n) + ']'; + + if (n === 0 && key + '[zero]' in gL10nData) { + str = gL10nData[key + '[zero]'][prop]; + } else if (n == 1 && key + '[one]' in gL10nData) { + str = gL10nData[key + '[one]'][prop]; + } else if (n == 2 && key + '[two]' in gL10nData) { + str = gL10nData[key + '[two]'][prop]; + } else if (key + index in gL10nData) { + str = gL10nData[key + index][prop]; + } else if (key + '[other]' in gL10nData) { + str = gL10nData[key + '[other]'][prop]; + } + + return str; + }; + + function getL10nData(key, args, fallback) { + var data = gL10nData[key]; + + if (!data) { + console.warn('#' + key + ' is undefined.'); + + if (!fallback) { + return null; + } + + data = fallback; + } + + var rv = {}; + + for (var prop in data) { + var str = data[prop]; + str = substIndexes(str, args, key, prop); + str = substArguments(str, args, key); + rv[prop] = str; + } + + return rv; + } + + function substIndexes(str, args, key, prop) { + var reIndex = /\{\[\s*([a-zA-Z]+)\(([a-zA-Z]+)\)\s*\]\}/; + var reMatch = reIndex.exec(str); + if (!reMatch || !reMatch.length) return str; + var macroName = reMatch[1]; + var paramName = reMatch[2]; + var param; + + if (args && paramName in args) { + param = args[paramName]; + } else if (paramName in gL10nData) { + param = gL10nData[paramName]; + } + + if (macroName in gMacros) { + var macro = gMacros[macroName]; + str = macro(str, param, key, prop); + } + + return str; + } + + function substArguments(str, args, key) { + var reArgs = /\{\{\s*(.+?)\s*\}\}/g; + return str.replace(reArgs, function (matched_text, arg) { + if (args && arg in args) { + return args[arg]; + } + + if (arg in gL10nData) { + return gL10nData[arg]; + } + + console.log('argument {{' + arg + '}} for #' + key + ' is undefined.'); + return matched_text; + }); + } + + function translateElement(element) { + var l10n = getL10nAttributes(element); + if (!l10n.id) return; + var data = getL10nData(l10n.id, l10n.args); + + if (!data) { + console.warn('#' + l10n.id + ' is undefined.'); + return; + } + + if (data[gTextProp]) { + if (getChildElementCount(element) === 0) { + element[gTextProp] = data[gTextProp]; + } else { + var children = element.childNodes; + var found = false; + + for (var i = 0, l = children.length; i < l; i++) { + if (children[i].nodeType === 3 && /\S/.test(children[i].nodeValue)) { + if (found) { + children[i].nodeValue = ''; + } else { + children[i].nodeValue = data[gTextProp]; + found = true; + } + } + } + + if (!found) { + var textNode = document.createTextNode(data[gTextProp]); + element.insertBefore(textNode, element.firstChild); + } + } + + delete data[gTextProp]; + } + + for (var k in data) { + element[k] = data[k]; + } + } + + function getChildElementCount(element) { + if (element.children) { + return element.children.length; + } + + if (typeof element.childElementCount !== 'undefined') { + return element.childElementCount; + } + + var count = 0; + + for (var i = 0; i < element.childNodes.length; i++) { + count += element.nodeType === 1 ? 1 : 0; + } + + return count; + } + + function translateFragment(element) { + element = element || document.documentElement; + var children = getTranslatableChildren(element); + var elementCount = children.length; + + for (var i = 0; i < elementCount; i++) { + translateElement(children[i]); + } + + translateElement(element); + } + + return { + get: function (key, args, fallbackString) { + var index = key.lastIndexOf('.'); + var prop = gTextProp; + + if (index > 0) { + prop = key.substring(index + 1); + key = key.substring(0, index); + } + + var fallback; + + if (fallbackString) { + fallback = {}; + fallback[prop] = fallbackString; + } + + var data = getL10nData(key, args, fallback); + + if (data && prop in data) { + return data[prop]; + } + + return '{{' + key + '}}'; + }, + getData: function () { + return gL10nData; + }, + getText: function () { + return gTextData; + }, + getLanguage: function () { + return gLanguage; + }, + setLanguage: function (lang, callback) { + loadLocale(lang, function () { + if (callback) callback(); + }); + }, + getDirection: function () { + var rtlList = ['ar', 'he', 'fa', 'ps', 'ur']; + var shortCode = gLanguage.split('-', 1)[0]; + return rtlList.indexOf(shortCode) >= 0 ? 'rtl' : 'ltr'; + }, + translate: translateFragment, + getReadyState: function () { + return gReadyState; + }, + ready: function (callback) { + if (!callback) { + return; + } else if (gReadyState == 'complete' || gReadyState == 'interactive') { + window.setTimeout(function () { + callback(); + }); + } else if (document.addEventListener) { + document.addEventListener('localized', function once() { + document.removeEventListener('localized', once); + callback(); + }); + } + } + }; +}(window, document); + +/***/ }), +/* 44 */ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.GenericScripting = void 0; +exports.docPropertiesLookup = docPropertiesLookup; + +var _pdfjsLib = __webpack_require__(5); + +async function docPropertiesLookup(pdfDocument) { + const url = "", + baseUrl = url.split("#")[0]; + let { + info, + metadata, + contentDispositionFilename, + contentLength + } = await pdfDocument.getMetadata(); + + if (!contentLength) { + const { + length + } = await pdfDocument.getDownloadInfo(); + contentLength = length; + } + + return { ...info, + baseURL: baseUrl, + filesize: contentLength, + filename: contentDispositionFilename || (0, _pdfjsLib.getPdfFilenameFromUrl)(url), + metadata: metadata?.getRaw(), + authors: metadata?.get("dc:creator"), + numPages: pdfDocument.numPages, + URL: url + }; +} + +class GenericScripting { + constructor(sandboxBundleSrc) { + this._ready = (0, _pdfjsLib.loadScript)(sandboxBundleSrc, true).then(() => { + return window.pdfjsSandbox.QuickJSSandbox(); + }); + } + + async createSandbox(data) { + const sandbox = await this._ready; + sandbox.create(data); + } + + async dispatchEventInSandbox(event) { + const sandbox = await this._ready; + setTimeout(() => sandbox.dispatchEvent(event), 0); + } + + async destroySandbox() { + const sandbox = await this._ready; + sandbox.nukeSandbox(); + } + +} + +exports.GenericScripting = GenericScripting; + +/***/ }), +/* 45 */ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.PDFPrintService = PDFPrintService; + +var _pdfjsLib = __webpack_require__(5); + +var _app = __webpack_require__(2); + +var _print_utils = __webpack_require__(46); + +let activeService = null; +let dialog = null; +let overlayManager = null; + +function renderPage(activeServiceOnEntry, pdfDocument, pageNumber, size, printResolution, optionalContentConfigPromise) { + const scratchCanvas = activeService.scratchCanvas; + const PRINT_UNITS = printResolution / _pdfjsLib.PixelsPerInch.PDF; + scratchCanvas.width = Math.floor(size.width * PRINT_UNITS); + scratchCanvas.height = Math.floor(size.height * PRINT_UNITS); + const ctx = scratchCanvas.getContext("2d"); + ctx.save(); + ctx.fillStyle = "rgb(255, 255, 255)"; + ctx.fillRect(0, 0, scratchCanvas.width, scratchCanvas.height); + ctx.restore(); + return pdfDocument.getPage(pageNumber).then(function (pdfPage) { + const renderContext = { + canvasContext: ctx, + transform: [PRINT_UNITS, 0, 0, PRINT_UNITS, 0, 0], + viewport: pdfPage.getViewport({ + scale: 1, + rotation: size.rotation + }), + intent: "print", + annotationMode: _pdfjsLib.AnnotationMode.ENABLE_STORAGE, + optionalContentConfigPromise + }; + return pdfPage.render(renderContext).promise; + }); +} + +function PDFPrintService(pdfDocument, pagesOverview, printContainer, printResolution, optionalContentConfigPromise = null, l10n) { + this.pdfDocument = pdfDocument; + this.pagesOverview = pagesOverview; + this.printContainer = printContainer; + this._printResolution = printResolution || 150; + this._optionalContentConfigPromise = optionalContentConfigPromise || pdfDocument.getOptionalContentConfig(); + this.l10n = l10n; + this.currentPage = -1; + this.scratchCanvas = document.createElement("canvas"); +} + +PDFPrintService.prototype = { + layout() { + this.throwIfInactive(); + const body = document.querySelector("body"); + body.setAttribute("data-pdfjsprinting", true); + const hasEqualPageSizes = this.pagesOverview.every(function (size) { + return size.width === this.pagesOverview[0].width && size.height === this.pagesOverview[0].height; + }, this); + + if (!hasEqualPageSizes) { + console.warn("Not all pages have the same size. The printed " + "result may be incorrect!"); + } + + this.pageStyleSheet = document.createElement("style"); + const pageSize = this.pagesOverview[0]; + this.pageStyleSheet.textContent = "@page { size: " + pageSize.width + "pt " + pageSize.height + "pt;}"; + body.appendChild(this.pageStyleSheet); + }, + + destroy() { + if (activeService !== this) { + return; + } + + this.printContainer.textContent = ""; + const body = document.querySelector("body"); + body.removeAttribute("data-pdfjsprinting"); + + if (this.pageStyleSheet) { + this.pageStyleSheet.remove(); + this.pageStyleSheet = null; + } + + this.scratchCanvas.width = this.scratchCanvas.height = 0; + this.scratchCanvas = null; + activeService = null; + ensureOverlay().then(function () { + if (overlayManager.active === dialog) { + overlayManager.close(dialog); + } + }); + }, + + renderPages() { + if (this.pdfDocument.isPureXfa) { + (0, _print_utils.getXfaHtmlForPrinting)(this.printContainer, this.pdfDocument); + return Promise.resolve(); + } + + const pageCount = this.pagesOverview.length; + + const renderNextPage = (resolve, reject) => { + this.throwIfInactive(); + + if (++this.currentPage >= pageCount) { + renderProgress(pageCount, pageCount, this.l10n); + resolve(); + return; + } + + const index = this.currentPage; + renderProgress(index, pageCount, this.l10n); + renderPage(this, this.pdfDocument, index + 1, this.pagesOverview[index], this._printResolution, this._optionalContentConfigPromise).then(this.useRenderedPage.bind(this)).then(function () { + renderNextPage(resolve, reject); + }, reject); + }; + + return new Promise(renderNextPage); + }, + + useRenderedPage() { + this.throwIfInactive(); + const img = document.createElement("img"); + const scratchCanvas = this.scratchCanvas; + + if ("toBlob" in scratchCanvas) { + scratchCanvas.toBlob(function (blob) { + img.src = URL.createObjectURL(blob); + }); + } else { + img.src = scratchCanvas.toDataURL(); + } + + const wrapper = document.createElement("div"); + wrapper.className = "printedPage"; + wrapper.appendChild(img); + this.printContainer.appendChild(wrapper); + return new Promise(function (resolve, reject) { + img.onload = resolve; + img.onerror = reject; + }); + }, + + performPrint() { + this.throwIfInactive(); + return new Promise(resolve => { + setTimeout(() => { + if (!this.active) { + resolve(); + return; + } + + print.call(window); + setTimeout(resolve, 20); + }, 0); + }); + }, + + get active() { + return this === activeService; + }, + + throwIfInactive() { + if (!this.active) { + throw new Error("This print request was cancelled or completed."); + } + } + +}; +const print = window.print; + +window.print = function () { + if (activeService) { + console.warn("Ignored window.print() because of a pending print job."); + return; + } + + ensureOverlay().then(function () { + if (activeService) { + overlayManager.open(dialog); + } + }); + + try { + dispatchEvent("beforeprint"); + } finally { + if (!activeService) { + console.error("Expected print service to be initialized."); + ensureOverlay().then(function () { + if (overlayManager.active === dialog) { + overlayManager.close(dialog); + } + }); + return; + } + + const activeServiceOnEntry = activeService; + activeService.renderPages().then(function () { + return activeServiceOnEntry.performPrint(); + }).catch(function () {}).then(function () { + if (activeServiceOnEntry.active) { + abort(); + } + }); + } +}; + +function dispatchEvent(eventType) { + const event = document.createEvent("CustomEvent"); + event.initCustomEvent(eventType, false, false, "custom"); + window.dispatchEvent(event); +} + +function abort() { + if (activeService) { + activeService.destroy(); + dispatchEvent("afterprint"); + } +} + +function renderProgress(index, total, l10n) { + dialog ||= document.getElementById("printServiceDialog"); + const progress = Math.round(100 * index / total); + const progressBar = dialog.querySelector("progress"); + const progressPerc = dialog.querySelector(".relative-progress"); + progressBar.value = progress; + l10n.get("print_progress_percent", { + progress + }).then(msg => { + progressPerc.textContent = msg; + }); +} + +window.addEventListener("keydown", function (event) { + if (event.keyCode === 80 && (event.ctrlKey || event.metaKey) && !event.altKey && (!event.shiftKey || window.chrome || window.opera)) { + window.print(); + event.preventDefault(); + + if (event.stopImmediatePropagation) { + event.stopImmediatePropagation(); + } else { + event.stopPropagation(); + } + } +}, true); + +if ("onbeforeprint" in window) { + const stopPropagationIfNeeded = function (event) { + if (event.detail !== "custom" && event.stopImmediatePropagation) { + event.stopImmediatePropagation(); + } + }; + + window.addEventListener("beforeprint", stopPropagationIfNeeded); + window.addEventListener("afterprint", stopPropagationIfNeeded); +} + +let overlayPromise; + +function ensureOverlay() { + if (!overlayPromise) { + overlayManager = _app.PDFViewerApplication.overlayManager; + + if (!overlayManager) { + throw new Error("The overlay manager has not yet been initialized."); + } + + dialog ||= document.getElementById("printServiceDialog"); + overlayPromise = overlayManager.register(dialog, true); + document.getElementById("printCancel").onclick = abort; + dialog.addEventListener("close", abort); + } + + return overlayPromise; +} + +_app.PDFPrintServiceFactory.instance = { + supportsPrinting: true, + + createPrintService(pdfDocument, pagesOverview, printContainer, printResolution, optionalContentConfigPromise, l10n) { + if (activeService) { + throw new Error("The print service is created and active."); + } + + activeService = new PDFPrintService(pdfDocument, pagesOverview, printContainer, printResolution, optionalContentConfigPromise, l10n); + return activeService; + } + +}; + +/***/ }), +/* 46 */ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.getXfaHtmlForPrinting = getXfaHtmlForPrinting; + +var _pdfjsLib = __webpack_require__(5); + +var _pdf_link_service = __webpack_require__(8); + +var _xfa_layer_builder = __webpack_require__(35); + +function getXfaHtmlForPrinting(printContainer, pdfDocument) { + const xfaHtml = pdfDocument.allXfaHtml; + const linkService = new _pdf_link_service.SimpleLinkService(); + const scale = Math.round(_pdfjsLib.PixelsPerInch.PDF_TO_CSS_UNITS * 100) / 100; + + for (const xfaPage of xfaHtml.children) { + const page = document.createElement("div"); + page.className = "xfaPrintedPage"; + printContainer.appendChild(page); + const builder = new _xfa_layer_builder.XfaLayerBuilder({ + pageDiv: page, + pdfPage: null, + annotationStorage: pdfDocument.annotationStorage, + linkService, + xfaHtml: xfaPage + }); + const viewport = (0, _pdfjsLib.getXfaPageViewport)(xfaPage, { + scale + }); + builder.render(viewport, "print"); + } +} + +/***/ }) +/******/ ]); +/************************************************************************/ +/******/ // The module cache +/******/ var __webpack_module_cache__ = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ // Check if module is in cache +/******/ var cachedModule = __webpack_module_cache__[moduleId]; +/******/ if (cachedModule !== undefined) { +/******/ return cachedModule.exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = __webpack_module_cache__[moduleId] = { +/******/ // no module.id needed +/******/ // no module.loaded needed +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/************************************************************************/ +var __webpack_exports__ = {}; +// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk. +(() => { +var exports = __webpack_exports__; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +Object.defineProperty(exports, "PDFViewerApplication", ({ + enumerable: true, + get: function () { + return _app.PDFViewerApplication; + } +})); +Object.defineProperty(exports, "PDFViewerApplicationOptions", ({ + enumerable: true, + get: function () { + return _app_options.AppOptions; + } +})); + +var _app_options = __webpack_require__(1); + +var _app = __webpack_require__(2); + +const pdfjsVersion = '2.14.305'; +const pdfjsBuild = 'eaaa8b4ad'; +window.PDFViewerApplication = _app.PDFViewerApplication; +window.PDFViewerApplicationOptions = _app_options.AppOptions; +; +; +{ + __webpack_require__(39); +} +; +{ + __webpack_require__(45); +} + +function getViewerConfiguration() { + let errorWrapper = null; + errorWrapper = { + container: document.getElementById("errorWrapper"), + errorMessage: document.getElementById("errorMessage"), + closeButton: document.getElementById("errorClose"), + errorMoreInfo: document.getElementById("errorMoreInfo"), + moreInfoButton: document.getElementById("errorShowMore"), + lessInfoButton: document.getElementById("errorShowLess") + }; + return { + appContainer: document.body, + mainContainer: document.getElementById("viewerContainer"), + viewerContainer: document.getElementById("viewer"), + toolbar: { + container: document.getElementById("toolbarViewer"), + numPages: document.getElementById("numPages"), + pageNumber: document.getElementById("pageNumber"), + scaleSelect: document.getElementById("scaleSelect"), + customScaleOption: document.getElementById("customScaleOption"), + previous: document.getElementById("previous"), + next: document.getElementById("next"), + zoomIn: document.getElementById("zoomIn"), + zoomOut: document.getElementById("zoomOut"), + viewFind: document.getElementById("viewFind"), + openFile: document.getElementById("openFile"), + print: document.getElementById("print"), + presentationModeButton: document.getElementById("presentationMode"), + download: document.getElementById("download"), + viewBookmark: document.getElementById("viewBookmark") + }, + secondaryToolbar: { + toolbar: document.getElementById("secondaryToolbar"), + toggleButton: document.getElementById("secondaryToolbarToggle"), + presentationModeButton: document.getElementById("secondaryPresentationMode"), + openFileButton: document.getElementById("secondaryOpenFile"), + printButton: document.getElementById("secondaryPrint"), + downloadButton: document.getElementById("secondaryDownload"), + viewBookmarkButton: document.getElementById("secondaryViewBookmark"), + firstPageButton: document.getElementById("firstPage"), + lastPageButton: document.getElementById("lastPage"), + pageRotateCwButton: document.getElementById("pageRotateCw"), + pageRotateCcwButton: document.getElementById("pageRotateCcw"), + cursorSelectToolButton: document.getElementById("cursorSelectTool"), + cursorHandToolButton: document.getElementById("cursorHandTool"), + scrollPageButton: document.getElementById("scrollPage"), + scrollVerticalButton: document.getElementById("scrollVertical"), + scrollHorizontalButton: document.getElementById("scrollHorizontal"), + scrollWrappedButton: document.getElementById("scrollWrapped"), + spreadNoneButton: document.getElementById("spreadNone"), + spreadOddButton: document.getElementById("spreadOdd"), + spreadEvenButton: document.getElementById("spreadEven"), + documentPropertiesButton: document.getElementById("documentProperties") + }, + sidebar: { + outerContainer: document.getElementById("outerContainer"), + sidebarContainer: document.getElementById("sidebarContainer"), + toggleButton: document.getElementById("sidebarToggle"), + thumbnailButton: document.getElementById("viewThumbnail"), + outlineButton: document.getElementById("viewOutline"), + attachmentsButton: document.getElementById("viewAttachments"), + layersButton: document.getElementById("viewLayers"), + thumbnailView: document.getElementById("thumbnailView"), + outlineView: document.getElementById("outlineView"), + attachmentsView: document.getElementById("attachmentsView"), + layersView: document.getElementById("layersView"), + outlineOptionsContainer: document.getElementById("outlineOptionsContainer"), + currentOutlineItemButton: document.getElementById("currentOutlineItem") + }, + sidebarResizer: { + outerContainer: document.getElementById("outerContainer"), + resizer: document.getElementById("sidebarResizer") + }, + findBar: { + bar: document.getElementById("findbar"), + toggleButton: document.getElementById("viewFind"), + findField: document.getElementById("findInput"), + highlightAllCheckbox: document.getElementById("findHighlightAll"), + caseSensitiveCheckbox: document.getElementById("findMatchCase"), + matchDiacriticsCheckbox: document.getElementById("findMatchDiacritics"), + entireWordCheckbox: document.getElementById("findEntireWord"), + findMsg: document.getElementById("findMsg"), + findResultsCount: document.getElementById("findResultsCount"), + findPreviousButton: document.getElementById("findPrevious"), + findNextButton: document.getElementById("findNext") + }, + passwordOverlay: { + dialog: document.getElementById("passwordDialog"), + label: document.getElementById("passwordText"), + input: document.getElementById("password"), + submitButton: document.getElementById("passwordSubmit"), + cancelButton: document.getElementById("passwordCancel") + }, + documentProperties: { + dialog: document.getElementById("documentPropertiesDialog"), + closeButton: document.getElementById("documentPropertiesClose"), + fields: { + fileName: document.getElementById("fileNameField"), + fileSize: document.getElementById("fileSizeField"), + title: document.getElementById("titleField"), + author: document.getElementById("authorField"), + subject: document.getElementById("subjectField"), + keywords: document.getElementById("keywordsField"), + creationDate: document.getElementById("creationDateField"), + modificationDate: document.getElementById("modificationDateField"), + creator: document.getElementById("creatorField"), + producer: document.getElementById("producerField"), + version: document.getElementById("versionField"), + pageCount: document.getElementById("pageCountField"), + pageSize: document.getElementById("pageSizeField"), + linearized: document.getElementById("linearizedField") + } + }, + errorWrapper, + printContainer: document.getElementById("printContainer"), + openFileInput: document.getElementById("fileInput"), + debuggerScriptPath: "./debugger.js" + }; +} + +function webViewerLoad() { + const config = getViewerConfiguration(); + const event = document.createEvent("CustomEvent"); + event.initCustomEvent("webviewerloaded", true, true, { + source: window + }); + + try { + parent.document.dispatchEvent(event); + } catch (ex) { + console.error(`webviewerloaded: ${ex}`); + document.dispatchEvent(event); + } + + _app.PDFViewerApplication.run(config); +} + +document.blockUnblockOnload?.(true); + +if (document.readyState === "interactive" || document.readyState === "complete") { + webViewerLoad(); +} else { + document.addEventListener("DOMContentLoaded", webViewerLoad, true); +} +})(); + +/******/ })() +; +//# sourceMappingURL=viewer.js.map \ No newline at end of file diff --git a/public/pdf/web/viewer.js.map b/public/pdf/web/viewer.js.map new file mode 100644 index 0000000..36ae1c6 --- /dev/null +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IAATve,CAAc,cAAdA,EAA8Bqb,qBAA9Brb;;IACAA,SAASue,IAATve,CAAc,gBAAdA,EAAgCsb,uBAAhCtb;;IACAA,SAASue,IAATve,CAAc,cAAdA,EAA8Bub,qBAA9Bvb;;IACAA,SAASue,IAATve,CAAc,eAAdA,EAA+Bwb,sBAA/Bxb;;IACAA,SAASue,IAATve,CAAc,kBAAdA,EAAkCyb,yBAAlCzb;;IACAA,SAASue,IAATve,CAAc,oBAAdA,EAAoC0b,2BAApC1b;;IACAA,SAASue,IAATve,CAAc,UAAdA,EAA0B2b,iBAA1B3b;;IACAA,SAASue,IAATve,CAAc,aAAdA,EAA6B4b,oBAA7B5b;;IACAA,SAASue,IAATve,CAAc,yBAAdA,EAAyC6b,gCAAzC7b;;IACAA,SAASue,IAATve,CAAc,kBAAdA,EAAkC8b,yBAAlC9b;;IACAA,SAASue,IAATve,CAAc,OAAdA,EAAuB+b,cAAvB/b;;IACAA,SAASue,IAATve,CAAc,UAAdA,EAA0Bgc,iBAA1Bhc;;IACAA,SAASue,IAATve,CAAc,MAAdA,EAAsBic,aAAtBjc;;IACAA,SAASue,IAATve,CAAc,WAAdA,EAA2Bkc,kBAA3Blc;;IACAA,SAASue,IAATve,CAAc,UAAdA,EAA0Bmc,iBAA1Bnc;;IACAA,SAASue,IAATve,CAAc,UAAdA,EAA0Boc,iBAA1Bpc;;IACAA,SAASue,IAATve,CAAc,cAAdA,EAA8Bqc,qBAA9Brc;;IACAA,SAASue,IAATve,CAAc,QAAdA,EAAwBsc,eAAxBtc;;IACAA,SAASue,IAATve,CAAc,SAAdA,EAAyBuc,gBAAzBvc;;IACAA,SAASue,IAATve,CAAc,WAAdA,EAA2Bwc,kBAA3Bxc;;IACAA,SAASue,IAATve,CAAc,mBAAdA,EAAmCyc,0BAAnCzc;;IACAA,SAASue,IAATve,CAAc,cAAdA,EAA8B0c,qBAA9B1c;;IACAA,SAASue,IAATve,CAAc,UAAdA,EAA0B2c,iBAA1B3c;;IACAA,SAAS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EAA6D,IAA7DA;AAnQF","sources":["webpack://pdf.js/web/app_options.js","webpack://pdf.js/web/app.js","webpack://pdf.js/web/ui_utils.js","webpack://pdf.js/web/event_utils.js","webpack://pdf.js/web/pdfjs.js","webpack://pdf.js/web/pdf_cursor_tools.js","webpack://pdf.js/web/grab_to_pan.js","webpack://pdf.js/web/pdf_link_service.js","webpack://pdf.js/web/overlay_manager.js","webpack://pdf.js/web/password_prompt.js","webpack://pdf.js/web/pdf_attachment_viewer.js","webpack://pdf.js/web/base_tree_viewer.js","webpack://pdf.js/web/pdf_document_properties.js","webpack://pdf.js/web/pdf_find_bar.js","webpack://pdf.js/web/pdf_find_controller.js","webpack://pdf.js/web/pdf_find_utils.js","webpack://pdf.js/web/pdf_history.js","webpack://pdf.js/web/pdf_layer_viewer.js","webpack://pdf.js/web/pdf_outline_viewer.js","webpack://pdf.js/web/pdf_presentation_mode.js","webpack://pdf.js/web/pdf_rendering_queue.js","webpack://pdf.js/web/pdf_scripting_manager.js","webpack://pdf.js/web/pdf_sidebar.js","webpack://pdf.js/web/pdf_sidebar_resizer.js","webpack://pdf.js/web/pdf_thumbnail_viewer.js","webpack://pdf.js/web/pdf_thumbnail_view.js","webpack://pdf.js/web/pdf_viewer.js","webpack://pdf.js/web/base_viewer.js","webpack://pdf.js/web/annotation_layer_builder.js","webpack://pdf.js/web/l10n_utils.js","webpack://pdf.js/web/pdf_page_view.js","webpack://pdf.js/web/struct_tree_layer_builder.js","webpack://pdf.js/web/text_highlighter.js","webpack://pdf.js/web/text_layer_builder.js","webpack://pdf.js/web/xfa_layer_builder.js","webpack://pdf.js/web/secondary_toolbar.js","webpack://pdf.js/web/toolbar.js","webpack://pdf.js/web/view_history.js","webpack://pdf.js/web/genericcom.js","webpack://pdf.js/web/preferences.js","webpack://pdf.js/web/download_manager.js","webpack://pdf.js/web/genericl10n.js","webpack://pdf.js/external/webL10n/l10n.js","webpack://pdf.js/web/generic_scripting.js","webpack://pdf.js/web/pdf_print_service.js","webpack://pdf.js/web/print_utils.js","webpack://pdf.js/webpack/bootstrap","webpack://pdf.js/web/viewer.js"],"sourcesContent":["/* Copyright 2018 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nconst compatibilityParams = Object.create(null);\nif (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) {\n if (\n typeof PDFJSDev !== \"undefined\" &&\n PDFJSDev.test(\"LIB\") &&\n typeof navigator === \"undefined\"\n ) {\n globalThis.navigator = Object.create(null);\n }\n const userAgent = navigator.userAgent || \"\";\n const platform = navigator.platform || \"\";\n const maxTouchPoints = navigator.maxTouchPoints || 1;\n\n const isAndroid = /Android/.test(userAgent);\n const isIOS =\n /\\b(iPad|iPhone|iPod)(?=;)/.test(userAgent) ||\n (platform === \"MacIntel\" && maxTouchPoints > 1);\n\n // Limit canvas size to 5 mega-pixels on mobile.\n // Support: Android, iOS\n (function checkCanvasSizeLimitation() {\n if (isIOS || isAndroid) {\n compatibilityParams.maxCanvasPixels = 5242880;\n }\n })();\n}\n\nconst OptionKind = {\n VIEWER: 0x02,\n API: 0x04,\n WORKER: 0x08,\n PREFERENCE: 0x80,\n};\n\n/**\n * NOTE: These options are used to generate the `default_preferences.json` file,\n * see `OptionKind.PREFERENCE`, hence the values below must use only\n * primitive types and cannot rely on any imported types.\n */\nconst defaultOptions = {\n annotationMode: {\n /** @type {number} */\n value: 2,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n cursorToolOnLoad: {\n /** @type {number} */\n value: 0,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n defaultUrl: {\n /** @type {string} */\n value: \"compressed.tracemonkey-pldi-09.pdf\",\n kind: OptionKind.VIEWER,\n },\n defaultZoomValue: {\n /** @type {string} */\n value: \"\",\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n disableHistory: {\n /** @type {boolean} */\n value: false,\n kind: OptionKind.VIEWER,\n },\n disablePageLabels: {\n /** @type {boolean} */\n value: false,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n enablePermissions: {\n /** @type {boolean} */\n value: false,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n enablePrintAutoRotate: {\n /** @type {boolean} */\n value: true,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n enableScripting: {\n /** @type {boolean} */\n value: typeof PDFJSDev === \"undefined\" || !PDFJSDev.test(\"CHROME\"),\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n externalLinkRel: {\n /** @type {string} */\n value: \"noopener noreferrer nofollow\",\n kind: OptionKind.VIEWER,\n },\n externalLinkTarget: {\n /** @type {number} */\n value: 0,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n historyUpdateUrl: {\n /** @type {boolean} */\n value: false,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n ignoreDestinationZoom: {\n /** @type {boolean} */\n value: false,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n imageResourcesPath: {\n /** @type {string} */\n value: \"./images/\",\n kind: OptionKind.VIEWER,\n },\n maxCanvasPixels: {\n /** @type {number} */\n value: 16777216,\n compatibility: compatibilityParams.maxCanvasPixels,\n kind: OptionKind.VIEWER,\n },\n pageColorsBackground: {\n /** @type {string} */\n value: \"Canvas\",\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n pageColorsForeground: {\n /** @type {string} */\n value: \"CanvasText\",\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n pdfBugEnabled: {\n /** @type {boolean} */\n value: typeof PDFJSDev === \"undefined\" || !PDFJSDev.test(\"PRODUCTION\"),\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n printResolution: {\n /** @type {number} */\n value: 150,\n kind: OptionKind.VIEWER,\n },\n renderer: {\n /** @type {string} */\n value: \"canvas\",\n kind: OptionKind.VIEWER,\n },\n sidebarViewOnLoad: {\n /** @type {number} */\n value: -1,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n scrollModeOnLoad: {\n /** @type {number} */\n value: -1,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n spreadModeOnLoad: {\n /** @type {number} */\n value: -1,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n textLayerMode: {\n /** @type {number} */\n value: 1,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n useOnlyCssZoom: {\n /** @type {boolean} */\n value: false,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n viewerCssTheme: {\n /** @type {number} */\n value: typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"CHROME\") ? 2 : 0,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n viewOnLoad: {\n /** @type {boolean} */\n value: 0,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n\n cMapPacked: {\n /** @type {boolean} */\n value: true,\n kind: OptionKind.API,\n },\n cMapUrl: {\n /** @type {string} */\n value:\n typeof PDFJSDev === \"undefined\" || !PDFJSDev.test(\"PRODUCTION\")\n ? \"../external/bcmaps/\"\n : \"../web/cmaps/\",\n kind: OptionKind.API,\n },\n disableAutoFetch: {\n /** @type {boolean} */\n value: false,\n kind: OptionKind.API + OptionKind.PREFERENCE,\n },\n disableFontFace: {\n /** @type {boolean} */\n value: false,\n kind: OptionKind.API + OptionKind.PREFERENCE,\n },\n disableRange: {\n /** @type {boolean} */\n value: false,\n kind: OptionKind.API + OptionKind.PREFERENCE,\n },\n disableStream: {\n /** @type {boolean} */\n value: false,\n kind: OptionKind.API + OptionKind.PREFERENCE,\n },\n docBaseUrl: {\n /** @type {string} */\n value: \"\",\n kind: OptionKind.API,\n },\n enableXfa: {\n /** @type {boolean} */\n value: true,\n kind: OptionKind.API + OptionKind.PREFERENCE,\n },\n fontExtraProperties: {\n /** @type {boolean} */\n value: false,\n kind: OptionKind.API,\n },\n isEvalSupported: {\n /** @type {boolean} */\n value: true,\n kind: OptionKind.API,\n },\n maxImageSize: {\n /** @type {number} */\n value: -1,\n kind: OptionKind.API,\n },\n pdfBug: {\n /** @type {boolean} */\n value: false,\n kind: OptionKind.API,\n },\n standardFontDataUrl: {\n /** @type {string} */\n value:\n typeof PDFJSDev === \"undefined\" || !PDFJSDev.test(\"PRODUCTION\")\n ? \"../external/standard_fonts/\"\n : \"../web/standard_fonts/\",\n kind: OptionKind.API,\n },\n verbosity: {\n /** @type {number} */\n value: 1,\n kind: OptionKind.API,\n },\n\n workerPort: {\n /** @type {Object} */\n value: null,\n kind: OptionKind.WORKER,\n },\n workerSrc: {\n /** @type {string} */\n value:\n typeof PDFJSDev === \"undefined\" || !PDFJSDev.test(\"PRODUCTION\")\n ? \"../src/worker_loader.js\"\n : \"../build/pdf.worker.js\",\n kind: OptionKind.WORKER,\n },\n};\nif (\n typeof PDFJSDev === \"undefined\" ||\n PDFJSDev.test(\"!PRODUCTION || GENERIC\")\n) {\n defaultOptions.disablePreferences = {\n /** @type {boolean} */\n value: typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"TESTING\"),\n kind: OptionKind.VIEWER,\n };\n defaultOptions.locale = {\n /** @type {string} */\n value: navigator.language || \"en-US\",\n kind: OptionKind.VIEWER,\n };\n defaultOptions.sandboxBundleSrc = {\n /** @type {string} */\n value:\n typeof PDFJSDev === \"undefined\" || !PDFJSDev.test(\"PRODUCTION\")\n ? \"../build/dev-sandbox/pdf.sandbox.js\"\n : \"../build/pdf.sandbox.js\",\n kind: OptionKind.VIEWER,\n };\n\n defaultOptions.renderer.kind += OptionKind.PREFERENCE;\n} else if (PDFJSDev.test(\"CHROME\")) {\n defaultOptions.disableTelemetry = {\n /** @type {boolean} */\n value: false,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n };\n defaultOptions.sandboxBundleSrc = {\n /** @type {string} */\n value: \"../build/pdf.sandbox.js\",\n kind: OptionKind.VIEWER,\n };\n}\n\nconst userOptions = Object.create(null);\n\nclass AppOptions {\n constructor() {\n throw new Error(\"Cannot initialize AppOptions.\");\n }\n\n static get(name) {\n const userOption = userOptions[name];\n if (userOption !== undefined) {\n return userOption;\n }\n const defaultOption = defaultOptions[name];\n if (defaultOption !== undefined) {\n return defaultOption.compatibility ?? defaultOption.value;\n }\n return undefined;\n }\n\n static getAll(kind = null) {\n const options = Object.create(null);\n for (const name in defaultOptions) {\n const defaultOption = defaultOptions[name];\n if (kind) {\n if ((kind & defaultOption.kind) === 0) {\n continue;\n }\n if (kind === OptionKind.PREFERENCE) {\n const value = defaultOption.value,\n valueType = typeof value;\n\n if (\n valueType === \"boolean\" ||\n valueType === \"string\" ||\n (valueType === \"number\" && Number.isInteger(value))\n ) {\n options[name] = value;\n continue;\n }\n throw new Error(`Invalid type for preference: ${name}`);\n }\n }\n const userOption = userOptions[name];\n options[name] =\n userOption !== undefined\n ? userOption\n : defaultOption.compatibility ?? defaultOption.value;\n }\n return options;\n }\n\n static set(name, value) {\n userOptions[name] = value;\n }\n\n static setAll(options) {\n for (const name in options) {\n userOptions[name] = options[name];\n }\n }\n\n static remove(name) {\n delete userOptions[name];\n }\n\n /**\n * @ignore\n */\n static _hasUserOptions() {\n return Object.keys(userOptions).length > 0;\n }\n}\n\nexport { AppOptions, compatibilityParams, OptionKind };\n","/* Copyright 2012 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n animationStarted,\n apiPageLayoutToViewerModes,\n apiPageModeToSidebarView,\n AutoPrintRegExp,\n DEFAULT_SCALE_VALUE,\n getActiveOrFocusedElement,\n isValidRotation,\n isValidScrollMode,\n isValidSpreadMode,\n noContextMenuHandler,\n normalizeWheelEventDirection,\n parseQueryString,\n ProgressBar,\n RendererType,\n RenderingStates,\n ScrollMode,\n SidebarView,\n SpreadMode,\n TextLayerMode,\n} from \"./ui_utils.js\";\nimport { AppOptions, OptionKind } from \"./app_options.js\";\nimport { AutomationEventBus, EventBus } from \"./event_utils.js\";\nimport {\n build,\n createPromiseCapability,\n getDocument,\n getFilenameFromUrl,\n getPdfFilenameFromUrl,\n GlobalWorkerOptions,\n InvalidPDFException,\n isPdfFile,\n loadScript,\n MissingPDFException,\n OPS,\n PDFWorker,\n shadow,\n UnexpectedResponseException,\n UNSUPPORTED_FEATURES,\n version,\n} from \"pdfjs-lib\";\nimport { CursorTool, PDFCursorTools } from \"./pdf_cursor_tools.js\";\nimport { LinkTarget, PDFLinkService } from \"./pdf_link_service.js\";\nimport { OverlayManager } from \"./overlay_manager.js\";\nimport { PasswordPrompt } from \"./password_prompt.js\";\nimport { PDFAttachmentViewer } from \"./pdf_attachment_viewer.js\";\nimport { PDFDocumentProperties } from \"./pdf_document_properties.js\";\nimport { PDFFindBar } from \"./pdf_find_bar.js\";\nimport { PDFFindController } from \"./pdf_find_controller.js\";\nimport { PDFHistory } from \"./pdf_history.js\";\nimport { PDFLayerViewer } from \"./pdf_layer_viewer.js\";\nimport { PDFOutlineViewer } from \"./pdf_outline_viewer.js\";\nimport { PDFPresentationMode } from \"./pdf_presentation_mode.js\";\nimport { PDFRenderingQueue } from \"./pdf_rendering_queue.js\";\nimport { PDFScriptingManager } from \"./pdf_scripting_manager.js\";\nimport { PDFSidebar } from \"./pdf_sidebar.js\";\nimport { PDFSidebarResizer } from \"./pdf_sidebar_resizer.js\";\nimport { PDFThumbnailViewer } from \"./pdf_thumbnail_viewer.js\";\nimport { PDFViewer } from \"./pdf_viewer.js\";\nimport { SecondaryToolbar } from \"./secondary_toolbar.js\";\nimport { Toolbar } from \"./toolbar.js\";\nimport { ViewHistory } from \"./view_history.js\";\n\nconst DISABLE_AUTO_FETCH_LOADING_BAR_TIMEOUT = 5000; // ms\nconst FORCE_PAGES_LOADED_TIMEOUT = 10000; // ms\nconst WHEEL_ZOOM_DISABLED_TIMEOUT = 1000; // ms\n\nconst ViewOnLoad = {\n UNKNOWN: -1,\n PREVIOUS: 0, // Default value.\n INITIAL: 1,\n};\n\nconst ViewerCssTheme = {\n AUTOMATIC: 0, // Default value.\n LIGHT: 1,\n DARK: 2,\n};\n\n// Keep these in sync with mozilla-central's Histograms.json.\nconst KNOWN_VERSIONS = [\n \"1.0\",\n \"1.1\",\n \"1.2\",\n \"1.3\",\n \"1.4\",\n \"1.5\",\n \"1.6\",\n \"1.7\",\n \"1.8\",\n \"1.9\",\n \"2.0\",\n \"2.1\",\n \"2.2\",\n \"2.3\",\n];\n// Keep these in sync with mozilla-central's Histograms.json.\nconst KNOWN_GENERATORS = [\n \"acrobat distiller\",\n \"acrobat pdfwriter\",\n \"adobe livecycle\",\n \"adobe pdf library\",\n \"adobe photoshop\",\n \"ghostscript\",\n \"tcpdf\",\n \"cairo\",\n \"dvipdfm\",\n \"dvips\",\n \"pdftex\",\n \"pdfkit\",\n \"itext\",\n \"prince\",\n \"quarkxpress\",\n \"mac os x\",\n \"microsoft\",\n \"openoffice\",\n \"oracle\",\n \"luradocument\",\n \"pdf-xchange\",\n \"antenna house\",\n \"aspose.cells\",\n \"fpdf\",\n];\n\nclass DefaultExternalServices {\n constructor() {\n throw new Error(\"Cannot initialize DefaultExternalServices.\");\n }\n\n static updateFindControlState(data) {}\n\n static updateFindMatchesCount(data) {}\n\n static initPassiveLoading(callbacks) {}\n\n static reportTelemetry(data) {}\n\n static createDownloadManager(options) {\n throw new Error(\"Not implemented: createDownloadManager\");\n }\n\n static createPreferences() {\n throw new Error(\"Not implemented: createPreferences\");\n }\n\n static createL10n(options) {\n throw new Error(\"Not implemented: createL10n\");\n }\n\n static createScripting(options) {\n throw new Error(\"Not implemented: createScripting\");\n }\n\n static get supportsIntegratedFind() {\n return shadow(this, \"supportsIntegratedFind\", false);\n }\n\n static get supportsDocumentFonts() {\n return shadow(this, \"supportsDocumentFonts\", true);\n }\n\n static get supportedMouseWheelZoomModifierKeys() {\n return shadow(this, \"supportedMouseWheelZoomModifierKeys\", {\n ctrlKey: true,\n metaKey: true,\n });\n }\n\n static get isInAutomation() {\n return shadow(this, \"isInAutomation\", false);\n }\n}\n\nconst PDFViewerApplication = {\n initialBookmark: document.location.hash.substring(1),\n _initializedCapability: createPromiseCapability(),\n appConfig: null,\n pdfDocument: null,\n pdfLoadingTask: null,\n printService: null,\n /** @type {PDFViewer} */\n pdfViewer: null,\n /** @type {PDFThumbnailViewer} */\n pdfThumbnailViewer: null,\n /** @type {PDFRenderingQueue} */\n pdfRenderingQueue: null,\n /** @type {PDFPresentationMode} */\n pdfPresentationMode: null,\n /** @type {PDFDocumentProperties} */\n pdfDocumentProperties: null,\n /** @type {PDFLinkService} */\n pdfLinkService: null,\n /** @type {PDFHistory} */\n pdfHistory: null,\n /** @type {PDFSidebar} */\n pdfSidebar: null,\n /** @type {PDFSidebarResizer} */\n pdfSidebarResizer: null,\n /** @type {PDFOutlineViewer} */\n pdfOutlineViewer: null,\n /** @type {PDFAttachmentViewer} */\n pdfAttachmentViewer: null,\n /** @type {PDFLayerViewer} */\n pdfLayerViewer: null,\n /** @type {PDFCursorTools} */\n pdfCursorTools: null,\n /** @type {PDFScriptingManager} */\n pdfScriptingManager: null,\n /** @type {ViewHistory} */\n store: null,\n /** @type {DownloadManager} */\n downloadManager: null,\n /** @type {OverlayManager} */\n overlayManager: null,\n /** @type {Preferences} */\n preferences: null,\n /** @type {Toolbar} */\n toolbar: null,\n /** @type {SecondaryToolbar} */\n secondaryToolbar: null,\n /** @type {EventBus} */\n eventBus: null,\n /** @type {IL10n} */\n l10n: null,\n isInitialViewSet: false,\n downloadComplete: false,\n isViewerEmbedded: window.parent !== window,\n url: \"\",\n baseUrl: \"\",\n _downloadUrl: \"\",\n externalServices: DefaultExternalServices,\n _boundEvents: Object.create(null),\n documentInfo: null,\n metadata: null,\n _contentDispositionFilename: null,\n _contentLength: null,\n _saveInProgress: false,\n _docStats: null,\n _wheelUnusedTicks: 0,\n _idleCallbacks: new Set(),\n _PDFBug: null,\n\n // Called once when the document is loaded.\n async initialize(appConfig) {\n this.preferences = this.externalServices.createPreferences();\n this.appConfig = appConfig;\n\n await this._readPreferences();\n await this._parseHashParameters();\n this._forceCssTheme();\n await this._initializeL10n();\n\n if (\n this.isViewerEmbedded &&\n AppOptions.get(\"externalLinkTarget\") === LinkTarget.NONE\n ) {\n // Prevent external links from \"replacing\" the viewer,\n // when it's embedded in e.g. an + + ); + }, +}; + diff --git a/src/layout/components/Navbar.vue b/src/layout/components/Navbar.vue new file mode 100644 index 0000000..39b3dad --- /dev/null +++ b/src/layout/components/Navbar.vue @@ -0,0 +1,200 @@ + + + + + diff --git a/src/layout/components/Settings/index.vue b/src/layout/components/Settings/index.vue new file mode 100644 index 0000000..59815f1 --- /dev/null +++ b/src/layout/components/Settings/index.vue @@ -0,0 +1,257 @@ + + + + + diff --git a/src/layout/components/Sidebar/FixiOSBug.js b/src/layout/components/Sidebar/FixiOSBug.js new file mode 100644 index 0000000..6823726 --- /dev/null +++ b/src/layout/components/Sidebar/FixiOSBug.js @@ -0,0 +1,25 @@ +export default { + computed: { + device() { + return this.$store.state.app.device + } + }, + mounted() { + // In order to fix the click on menu on the ios device will trigger the mouseleave bug + this.fixBugIniOS() + }, + methods: { + fixBugIniOS() { + const $subMenu = this.$refs.subMenu + if ($subMenu) { + const handleMouseleave = $subMenu.handleMouseleave + $subMenu.handleMouseleave = (e) => { + if (this.device === 'mobile') { + return + } + handleMouseleave(e) + } + } + } + } +} diff --git a/src/layout/components/Sidebar/Item.vue b/src/layout/components/Sidebar/Item.vue new file mode 100644 index 0000000..be3285d --- /dev/null +++ b/src/layout/components/Sidebar/Item.vue @@ -0,0 +1,33 @@ + diff --git a/src/layout/components/Sidebar/Link.vue b/src/layout/components/Sidebar/Link.vue new file mode 100644 index 0000000..8b0bc93 --- /dev/null +++ b/src/layout/components/Sidebar/Link.vue @@ -0,0 +1,43 @@ + + + diff --git a/src/layout/components/Sidebar/Logo.vue b/src/layout/components/Sidebar/Logo.vue new file mode 100644 index 0000000..a01527c --- /dev/null +++ b/src/layout/components/Sidebar/Logo.vue @@ -0,0 +1,93 @@ + + + + + diff --git a/src/layout/components/Sidebar/SidebarItem.vue b/src/layout/components/Sidebar/SidebarItem.vue new file mode 100644 index 0000000..4853fbb --- /dev/null +++ b/src/layout/components/Sidebar/SidebarItem.vue @@ -0,0 +1,100 @@ + + + diff --git a/src/layout/components/Sidebar/index.vue b/src/layout/components/Sidebar/index.vue new file mode 100644 index 0000000..51d0839 --- /dev/null +++ b/src/layout/components/Sidebar/index.vue @@ -0,0 +1,57 @@ + + + diff --git a/src/layout/components/TagsView/ScrollPane.vue b/src/layout/components/TagsView/ScrollPane.vue new file mode 100644 index 0000000..bb753a1 --- /dev/null +++ b/src/layout/components/TagsView/ScrollPane.vue @@ -0,0 +1,94 @@ + + + + + diff --git a/src/layout/components/TagsView/index.vue b/src/layout/components/TagsView/index.vue new file mode 100644 index 0000000..20c4b55 --- /dev/null +++ b/src/layout/components/TagsView/index.vue @@ -0,0 +1,326 @@ + + + + + + + diff --git a/src/layout/components/index.js b/src/layout/components/index.js new file mode 100644 index 0000000..104bd3a --- /dev/null +++ b/src/layout/components/index.js @@ -0,0 +1,5 @@ +export { default as AppMain } from './AppMain' +export { default as Navbar } from './Navbar' +export { default as Settings } from './Settings' +export { default as Sidebar } from './Sidebar/index.vue' +export { default as TagsView } from './TagsView/index.vue' diff --git a/src/layout/index.vue b/src/layout/index.vue new file mode 100644 index 0000000..f048657 --- /dev/null +++ b/src/layout/index.vue @@ -0,0 +1,111 @@ + + + + + diff --git a/src/layout/mixin/ResizeHandler.js b/src/layout/mixin/ResizeHandler.js new file mode 100644 index 0000000..e8d0df8 --- /dev/null +++ b/src/layout/mixin/ResizeHandler.js @@ -0,0 +1,45 @@ +import store from '@/store' + +const { body } = document +const WIDTH = 992 // refer to Bootstrap's responsive design + +export default { + watch: { + $route(route) { + if (this.device === 'mobile' && this.sidebar.opened) { + store.dispatch('app/closeSideBar', { withoutAnimation: false }) + } + } + }, + beforeMount() { + window.addEventListener('resize', this.$_resizeHandler) + }, + beforeDestroy() { + window.removeEventListener('resize', this.$_resizeHandler) + }, + mounted() { + const isMobile = this.$_isMobile() + if (isMobile) { + store.dispatch('app/toggleDevice', 'mobile') + store.dispatch('app/closeSideBar', { withoutAnimation: true }) + } + }, + methods: { + // use $_ for mixins properties + // https://vuejs.org/v2/style-guide/index.html#Private-property-names-essential + $_isMobile() { + const rect = body.getBoundingClientRect() + return rect.width - 1 < WIDTH + }, + $_resizeHandler() { + if (!document.hidden) { + const isMobile = this.$_isMobile() + store.dispatch('app/toggleDevice', isMobile ? 'mobile' : 'desktop') + + if (isMobile) { + store.dispatch('app/closeSideBar', { withoutAnimation: true }) + } + } + } + } +} diff --git a/src/main.js b/src/main.js new file mode 100644 index 0000000..7ba0370 --- /dev/null +++ b/src/main.js @@ -0,0 +1,92 @@ +import Vue from 'vue' + +import Cookies from 'js-cookie' + +import Element from 'element-ui' +import './assets/styles/element-variables.scss' + +import '@/assets/styles/index.scss' // global css +import '@/assets/styles/ruoyi.scss' // ruoyi css +import '../public/print-lock.css' + +import App from './App' +import store from './store' +import router from './router' +import directive from './directive' // directive +import plugins from './plugins' // plugins +import { download } from '@/utils/request' + +import './assets/icons' // icon +import './permission' // permission control +import { getDicts } from "@/api/system/dict/data"; +import { getConfigKey } from "@/api/system/config"; +import { parseTime, resetForm, addDateRange, selectDictLabel, selectDictLabels, handleTree } from "@/utils/ruoyi"; +import { checkPermi } from './utils/permission'; +// 分页组件 +import Pagination from "@/components/Pagination"; +// 自定义表格工具组件 +import RightToolbar from "@/components/RightToolbar" +// 富文本组件 +import Editor from "@/components/Editor" +// 文件上传组件 +import FileUpload from "@/components/FileUpload" +// 图片上传组件 +import ImageUpload from "@/components/ImageUpload" +// 图片预览组件 +import ImagePreview from "@/components/ImagePreview" +// 字典标签组件 +import DictTag from '@/components/DictTag' +// 头部标签组件 +import VueMeta from 'vue-meta' +// 字典数据组件 +import DictData from '@/components/DictData' +import webSite from '@/config/website' +Vue.prototype.website = webSite + +// 全局方法挂载 +Vue.prototype.getDicts = getDicts +Vue.prototype.getConfigKey = getConfigKey +Vue.prototype.parseTime = parseTime +Vue.prototype.resetForm = resetForm +Vue.prototype.addDateRange = addDateRange +Vue.prototype.selectDictLabel = selectDictLabel +Vue.prototype.selectDictLabels = selectDictLabels +Vue.prototype.download = download +Vue.prototype.handleTree = handleTree +Vue.prototype.checkPermission = checkPermi + +// 全局组件挂载 +Vue.component('DictTag', DictTag) +Vue.component('Pagination', Pagination) +Vue.component('RightToolbar', RightToolbar) +Vue.component('Editor', Editor) +Vue.component('FileUpload', FileUpload) +Vue.component('ImageUpload', ImageUpload) +Vue.component('ImagePreview', ImagePreview) + +Vue.use(directive) +Vue.use(plugins) +Vue.use(VueMeta) +DictData.install() + +/** + * If you don't want to use mock-server + * you want to use MockJs for mock api + * you can execute: mockXHR() + * + * Currently MockJs will be used in the production environment, + * please remove it before going online! ! ! + */ + +Vue.use(Element, { + size: Cookies.get('size') || 'medium' // set element-ui default size +}) + +Vue.config.productionTip = false + +new Vue({ + el: '#app', + router, + store, + render: h => h(App) +}) diff --git a/src/permission.js b/src/permission.js new file mode 100644 index 0000000..6bb0a1f --- /dev/null +++ b/src/permission.js @@ -0,0 +1,56 @@ +import router from './router' +import store from './store' +import { Message } from 'element-ui' +import NProgress from 'nprogress' +import 'nprogress/nprogress.css' +import { getToken } from '@/utils/auth' +import { isRelogin } from '@/utils/request' + +NProgress.configure({ showSpinner: false }) + +const whiteList = ['/login', '/auth-redirect', '/bind', '/register'] + +router.beforeEach((to, from, next) => { + NProgress.start() + if (getToken()) { + to.meta.title && store.dispatch('settings/setTitle', to.meta.title) + /* has token*/ + if (to.path === '/login') { + next({ path: '/' }) + NProgress.done() + } else { + if (store.getters.roles.length === 0) { + isRelogin.show = true + // 判断当前用户是否已拉取完user_info信息 + store.dispatch('GetInfo').then(() => { + isRelogin.show = false + store.dispatch('GenerateRoutes').then(accessRoutes => { + // 根据roles权限生成可访问的路由表 + router.addRoutes(accessRoutes) // 动态添加可访问路由表 + next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 + }) + }).catch(err => { + store.dispatch('LogOut').then(() => { + Message.error(err) + next({ path: '/' }) + }) + }) + } else { + next() + } + } + } else { + // 没有token + if (whiteList.indexOf(to.path) !== -1) { + // 在免登录白名单,直接进入 + next() + } else { + next(`/login?redirect=${to.fullPath}`) // 否则全部重定向到登录页 + NProgress.done() + } + } +}) + +router.afterEach(() => { + NProgress.done() +}) diff --git a/src/plugins/auth.js b/src/plugins/auth.js new file mode 100644 index 0000000..6c6bc24 --- /dev/null +++ b/src/plugins/auth.js @@ -0,0 +1,60 @@ +import store from '@/store' + +function authPermission(permission) { + const all_permission = "*:*:*"; + const permissions = store.getters && store.getters.permissions + if (permission && permission.length > 0) { + return permissions.some(v => { + return all_permission === v || v === permission + }) + } else { + return false + } +} + +function authRole(role) { + const super_admin = "admin"; + const roles = store.getters && store.getters.roles + if (role && role.length > 0) { + return roles.some(v => { + return super_admin === v || v === role + }) + } else { + return false + } +} + +export default { + // 验证用户是否具备某权限 + hasPermi(permission) { + return authPermission(permission); + }, + // 验证用户是否含有指定权限,只需包含其中一个 + hasPermiOr(permissions) { + return permissions.some(item => { + return authPermission(item) + }) + }, + // 验证用户是否含有指定权限,必须全部拥有 + hasPermiAnd(permissions) { + return permissions.every(item => { + return authPermission(item) + }) + }, + // 验证用户是否具备某角色 + hasRole(role) { + return authRole(role); + }, + // 验证用户是否含有指定角色,只需包含其中一个 + hasRoleOr(roles) { + return roles.some(item => { + return authRole(item) + }) + }, + // 验证用户是否含有指定角色,必须全部拥有 + hasRoleAnd(roles) { + return roles.every(item => { + return authRole(item) + }) + } +} diff --git a/src/plugins/cache.js b/src/plugins/cache.js new file mode 100644 index 0000000..6b5c00b --- /dev/null +++ b/src/plugins/cache.js @@ -0,0 +1,77 @@ +const sessionCache = { + set (key, value) { + if (!sessionStorage) { + return + } + if (key != null && value != null) { + sessionStorage.setItem(key, value) + } + }, + get (key) { + if (!sessionStorage) { + return null + } + if (key == null) { + return null + } + return sessionStorage.getItem(key) + }, + setJSON (key, jsonValue) { + if (jsonValue != null) { + this.set(key, JSON.stringify(jsonValue)) + } + }, + getJSON (key) { + const value = this.get(key) + if (value != null) { + return JSON.parse(value) + } + }, + remove (key) { + sessionStorage.removeItem(key); + } +} +const localCache = { + set (key, value) { + if (!localStorage) { + return + } + if (key != null && value != null) { + localStorage.setItem(key, value) + } + }, + get (key) { + if (!localStorage) { + return null + } + if (key == null) { + return null + } + return localStorage.getItem(key) + }, + setJSON (key, jsonValue) { + if (jsonValue != null) { + this.set(key, JSON.stringify(jsonValue)) + } + }, + getJSON (key) { + const value = this.get(key) + if (value != null) { + return JSON.parse(value) + } + }, + remove (key) { + localStorage.removeItem(key); + } +} + +export default { + /** + * 会话级缓存 + */ + session: sessionCache, + /** + * 本地缓存 + */ + local: localCache +} diff --git a/src/plugins/download.js b/src/plugins/download.js new file mode 100644 index 0000000..86e2031 --- /dev/null +++ b/src/plugins/download.js @@ -0,0 +1,72 @@ +import axios from 'axios' +import { Message } from 'element-ui' +import { saveAs } from 'file-saver' +import { getToken } from '@/utils/auth' +import errorCode from '@/utils/errorCode' +import { blobValidate } from "@/utils/ruoyi"; + +const baseURL = process.env.VUE_APP_BASE_API + +export default { + name(name, isDelete = true) { + var url = baseURL + "/common/download?fileName=" + encodeURI(name) + "&delete=" + isDelete + axios({ + method: 'get', + url: url, + responseType: 'blob', + headers: { 'Authorization': 'Bearer ' + getToken() } + }).then(async (res) => { + const isLogin = await blobValidate(res.data); + if (isLogin) { + const blob = new Blob([res.data]) + this.saveAs(blob, decodeURI(res.headers['download-filename'])) + } else { + this.printErrMsg(res.data); + } + }) + }, + resource(resource) { + var url = baseURL + "/common/download/resource?resource=" + encodeURI(resource); + axios({ + method: 'get', + url: url, + responseType: 'blob', + headers: { 'Authorization': 'Bearer ' + getToken() } + }).then(async (res) => { + const isLogin = await blobValidate(res.data); + if (isLogin) { + const blob = new Blob([res.data]) + this.saveAs(blob, decodeURI(res.headers['download-filename'])) + } else { + this.printErrMsg(res.data); + } + }) + }, + zip(url, name) { + var url = baseURL + url + axios({ + method: 'get', + url: url, + responseType: 'blob', + headers: { 'Authorization': 'Bearer ' + getToken() } + }).then(async (res) => { + const isLogin = await blobValidate(res.data); + if (isLogin) { + const blob = new Blob([res.data], { type: 'application/zip' }) + this.saveAs(blob, name) + } else { + this.printErrMsg(res.data); + } + }) + }, + saveAs(text, name, opts) { + saveAs(text, name, opts); + }, + async printErrMsg(data) { + const resText = await data.text(); + const rspObj = JSON.parse(resText); + const errMsg = errorCode[rspObj.code] || rspObj.msg || errorCode['default'] + Message.error(errMsg); + } +} + diff --git a/src/plugins/index.js b/src/plugins/index.js new file mode 100644 index 0000000..d000f2d --- /dev/null +++ b/src/plugins/index.js @@ -0,0 +1,20 @@ +import tab from './tab' +import auth from './auth' +import cache from './cache' +import modal from './modal' +import download from './download' + +export default { + install(Vue) { + // 页签操作 + Vue.prototype.$tab = tab + // 认证对象 + Vue.prototype.$auth = auth + // 缓存对象 + Vue.prototype.$cache = cache + // 模态框对象 + Vue.prototype.$modal = modal + // 下载文件 + Vue.prototype.$download = download + } +} diff --git a/src/plugins/modal.js b/src/plugins/modal.js new file mode 100644 index 0000000..b37ca14 --- /dev/null +++ b/src/plugins/modal.js @@ -0,0 +1,83 @@ +import { Message, MessageBox, Notification, Loading } from 'element-ui' + +let loadingInstance; + +export default { + // 消息提示 + msg(content) { + Message.info(content) + }, + // 错误消息 + msgError(content) { + Message.error(content) + }, + // 成功消息 + msgSuccess(content) { + Message.success(content) + }, + // 警告消息 + msgWarning(content) { + Message.warning(content) + }, + // 弹出提示 + alert(content) { + MessageBox.alert(content, "系统提示") + }, + // 错误提示 + alertError(content) { + MessageBox.alert(content, "系统提示", { type: 'error' }) + }, + // 成功提示 + alertSuccess(content) { + MessageBox.alert(content, "系统提示", { type: 'success' }) + }, + // 警告提示 + alertWarning(content) { + MessageBox.alert(content, "系统提示", { type: 'warning' }) + }, + // 通知提示 + notify(content) { + Notification.info(content) + }, + // 错误通知 + notifyError(content) { + Notification.error(content); + }, + // 成功通知 + notifySuccess(content) { + Notification.success(content) + }, + // 警告通知 + notifyWarning(content) { + Notification.warning(content) + }, + // 确认窗体 + confirm(content) { + return MessageBox.confirm(content, "系统提示", { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: "warning", + }) + }, + // 提交内容 + prompt(content) { + return MessageBox.prompt(content, "系统提示", { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: "warning", + }) + }, + // 打开遮罩层 + loading(content) { + loadingInstance = Loading.service({ + lock: true, + text: content, + spinner: "el-icon-loading", + background: "rgba(0, 0, 0, 0.7)", + }) + }, + // 关闭遮罩层 + closeLoading() { + loadingInstance.close(); + } +} diff --git a/src/plugins/tab.js b/src/plugins/tab.js new file mode 100644 index 0000000..f5d7a3e --- /dev/null +++ b/src/plugins/tab.js @@ -0,0 +1,67 @@ +import store from '@/store' +import router from '@/router'; + +export default { + // 刷新当前tab页签 + refreshPage(obj) { + const { path, query, matched } = router.currentRoute; + if (obj === undefined) { + matched.forEach((m) => { + if (m.components && m.components.default && m.components.default.name) { + if (!['Layout', 'ParentView'].includes(m.components.default.name)) { + obj = { name: m.components.default.name, path: path, query: query }; + } + } + }); + } + return store.dispatch('tagsView/delCachedView', obj).then(() => { + const { path, query } = obj + router.replace({ + path: '/redirect' + path, + query: query + }) + }) + }, + // 关闭当前tab页签,打开新页签 + closeOpenPage(obj) { + store.dispatch("tagsView/delView", router.currentRoute); + if (obj !== undefined) { + return router.push(obj); + } + }, + // 关闭指定tab页签 + closePage(obj) { + if (obj === undefined) { + return store.dispatch('tagsView/delView', router.currentRoute).then(({ lastPath }) => { + return router.push(lastPath || '/'); + }); + } + return store.dispatch('tagsView/delView', obj); + }, + // 关闭所有tab页签 + closeAllPage() { + return store.dispatch('tagsView/delAllViews'); + }, + // 关闭左侧tab页签 + closeLeftPage(obj) { + return store.dispatch('tagsView/delLeftTags', obj || router.currentRoute); + }, + // 关闭右侧tab页签 + closeRightPage(obj) { + return store.dispatch('tagsView/delRightTags', obj || router.currentRoute); + }, + // 关闭其他tab页签 + closeOtherPage(obj) { + return store.dispatch('tagsView/delOthersViews', obj || router.currentRoute); + }, + // 添加tab页签 + openPage(title, url) { + var obj = { path: url, meta: { title: title } } + store.dispatch('tagsView/addView', obj); + return router.push(url); + }, + // 修改tab页签 + updatePage(obj) { + return store.dispatch('tagsView/updateVisitedView', obj); + } +} diff --git a/src/router/index.js b/src/router/index.js new file mode 100644 index 0000000..8327082 --- /dev/null +++ b/src/router/index.js @@ -0,0 +1,276 @@ +import Vue from 'vue' +import Router from 'vue-router' + +Vue.use(Router) + +/* Layout */ +import Layout from '@/layout' + +/** + * Note: 路由配置项 + * + * hidden: true // 当设置 true 的时候该路由不会再侧边栏出现 如401,login等页面,或者如一些编辑页面/edit/1 + * alwaysShow: true // 当你一个路由下面的 children 声明的路由大于1个时,自动会变成嵌套的模式--如组件页面 + * // 只有一个时,会将那个子路由当做根路由显示在侧边栏--如引导页面 + * // 若你想不管路由下面的 children 声明的个数都显示你的根路由 + * // 你可以设置 alwaysShow: true,这样它就会忽略之前定义的规则,一直显示根路由 + * redirect: noRedirect // 当设置 noRedirect 的时候该路由在面包屑导航中不可被点击 + * name:'router-name' // 设定路由的名字,一定要填写不然使用时会出现各种问题 + * query: '{"id": 1, "name": "ry"}' // 访问路由的默认传递参数 + * roles: ['admin', 'common'] // 访问路由的角色权限 + * permissions: ['a:a:a', 'b:b:b'] // 访问路由的菜单权限 + * meta : { + noCache: true // 如果设置为true,则不会被 缓存(默认 false) + title: 'title' // 设置该路由在侧边栏和面包屑中展示的名字 + icon: 'svg-name' // 设置该路由的图标,对应路径src/assets/icons/svg + breadcrumb: false // 如果设置为false,则不会在breadcrumb面包屑中显示 + activeMenu: '/system/user' // 当路由设置了该属性,则会高亮相对应的侧边栏。 + } + */ + +// 公共路由 +export const constantRoutes = [ + { + path: '/redirect', + component: Layout, + hidden: true, + children: [ + { + path: '/redirect/:path(.*)', + component: () => import('@/views/redirect') + } + ] + }, + { + path: '/login', + component: () => import('@/views/login'), + hidden: true + }, + { + path: '/register', + component: () => import('@/views/register'), + hidden: true + }, + { + path: '/404', + component: () => import('@/views/error/404'), + hidden: true + }, + { + path: '/401', + component: () => import('@/views/error/401'), + hidden: true + }, + { + path: '', + component: Layout, + redirect: 'index', + children: [ + { + path: 'index', + component: () => import('@/views/index'), + name: 'Index', + meta: { title: '首页', icon: 'dashboard', affix: true } + } + ] + }, + { + path: '/user', + component: Layout, + hidden: true, + redirect: 'noredirect', + children: [ + { + path: 'profile', + component: () => import('@/views/system/user/profile/index'), + name: 'Profile', + meta: { title: '个人中心', icon: 'user' } + } + ] + } +] + +// 动态路由,基于用户权限动态去加载 +export const dynamicRoutes = [ + { + path: '/system/user-auth', + component: Layout, + hidden: true, + permissions: ['system:user:edit'], + children: [ + { + path: 'role/:userId(\\d+)', + component: () => import('@/views/system/user/authRole'), + name: 'AuthRole', + meta: { title: '分配角色', activeMenu: '/system/user' } + } + ] + }, + { + path: '/system/role-auth', + component: Layout, + hidden: true, + permissions: ['system:role:edit'], + children: [ + { + path: 'user/:roleId(\\d+)', + component: () => import('@/views/system/role/authUser'), + name: 'AuthUser', + meta: { title: '分配用户', activeMenu: '/system/role' } + } + ] + }, + { + path: '/system/dict-data', + component: Layout, + hidden: true, + permissions: ['system:dict:list'], + children: [ + { + path: 'index/:dictId(\\d+)', + component: () => import('@/views/system/dict/data'), + name: 'Data', + meta: { title: '字典数据', activeMenu: '/system/dict' } + } + ] + }, + { + path: '/system/autocodePart', + component: Layout, + hidden: true, + permissions: ['system:autocode:part:list'], + children: [ + { + path: 'index/:ruleId(\\d+)', + component: () => import('@/views/system/autocode/part'), + name: 'AutoCode', + meta: { title: '规则组成', activeMenu: '/system/autocode' } + } + ] + }, + { + path: '/mes/wm/location', + component: Layout, + hidden: true, + permissions: ['mes:wm:location:list'], + children: [ + { + path: 'index', + component: () => import('@/views/mes/wm/location/index'), + name: 'locationList', + meta: { title: '库区设置', activeMenu: '/mes/wm/location' } + } + ] + }, + { + path: '/mes/wm/area', + component: Layout, + hidden: true, + permissions: ['mes:wm:area:list'], + children: [ + { + path: 'index', + component: () => import('@/views/mes/wm/area/index'), + name: 'areaList', + meta: { title: '库位设置', activeMenu: '/mes/wm/area' } + } + ] + }, + { + path: '/mes/pro/schedule', + component: Layout, + hidden: true, + permissions: ['mes:pro:protask:edit'], + children: [ + { + path: 'ganttedit', + component: () => import("@/views/mes/pro/schedule/ganttedit"), + name: 'ganttEdit', + meta: {title: '使用甘特图排产',activeMenu: '/mes/pro/schedule'} + } + ] + }, + { + path: '/monitor/job-log', + component: Layout, + hidden: true, + permissions: ['monitor:job:list'], + children: [ + { + path: 'index', + component: () => import('@/views/monitor/job/log'), + name: 'JobLog', + meta: { title: '调度日志', activeMenu: '/monitor/job' } + } + ] + }, + { + path: '/tool/gen-edit', + component: Layout, + hidden: true, + permissions: ['tool:gen:edit'], + children: [ + { + path: 'index/:tableId(\\d+)', + component: () => import('@/views/tool/gen/editTable'), + name: 'GenEdit', + meta: { title: '修改生成配置', activeMenu: '/tool/gen' } + } + ] + }, + { + path: '/mes/qc/pendinginspect/add', + component: Layout, + hidden: true, + permissions: ['mes:qc:pending'], + children: [ + { + path: 'iqc', + component: () => import('@/views/mes/qc/pendinginspect/iqc'), + name: 'iqcadd', + props: true, + meta: {title: '来料检验', activeMenu: '/mes/qc/pendinginspect/iqc'} + }, + { + path: 'pqc', + component: () => import('@/views/mes/qc/pendinginspect/pqc'), + name: 'pqcadd', + props: true, + meta: {title: '过程检验', activeMenu: '/mes/qc/pendinginspect/pqc'} + }, + { + path: 'oqc', + component: () => import('@/views/mes/qc/oqc/index'), + name: 'oqcadd', + props: true, + meta: {title: '出厂检验', activeMenu: '/mes/qc/pendinginspect/oqc'} + } + ] + }, + { + path: '/print/pt', + component: Layout, + hidden: true, + permissions: ['print:template:edit'], + children: [ + { + path: 'edit', + component: () => import("@/views/print/printtemplate/index"), + name: 'printTemplateEdit', + meta: {title: '打印模板编辑',activeMenu: '/print/printtemplate/edit'} + } + ] + } +] + +// 防止连续点击多次路由报错 +let routerPush = Router.prototype.push; +Router.prototype.push = function push(location) { + return routerPush.call(this, location).catch(err => err) +} + +export default new Router({ + mode: 'history', // 去掉url中的# + scrollBehavior: () => ({ y: 0 }), + routes: constantRoutes +}) diff --git a/src/settings.js b/src/settings.js new file mode 100644 index 0000000..6a0b09f --- /dev/null +++ b/src/settings.js @@ -0,0 +1,44 @@ +module.exports = { + /** + * 侧边栏主题 深色主题theme-dark,浅色主题theme-light + */ + sideTheme: 'theme-dark', + + /** + * 是否系统布局配置 + */ + showSettings: false, + + /** + * 是否显示顶部导航 + */ + topNav: false, + + /** + * 是否显示 tagsView + */ + tagsView: true, + + /** + * 是否固定头部 + */ + fixedHeader: false, + + /** + * 是否显示logo + */ + sidebarLogo: true, + + /** + * 是否显示动态标题 + */ + dynamicTitle: false, + + /** + * @type {string | array} 'production' | ['production', 'development'] + * @description Need show err logs component. + * The default is only used in the production env + * If you want to also use it in dev, you can pass ['production', 'development'] + */ + errorLog: 'production' +} diff --git a/src/store/getters.js b/src/store/getters.js new file mode 100644 index 0000000..da6ab39 --- /dev/null +++ b/src/store/getters.js @@ -0,0 +1,18 @@ +const getters = { + sidebar: state => state.app.sidebar, + size: state => state.app.size, + device: state => state.app.device, + visitedViews: state => state.tagsView.visitedViews, + cachedViews: state => state.tagsView.cachedViews, + token: state => state.user.token, + avatar: state => state.user.avatar, + name: state => state.user.name, + introduction: state => state.user.introduction, + roles: state => state.user.roles, + permissions: state => state.user.permissions, + permission_routes: state => state.permission.routes, + topbarRouters:state => state.permission.topbarRouters, + defaultRoutes:state => state.permission.defaultRoutes, + sidebarRouters:state => state.permission.sidebarRouters, +} +export default getters diff --git a/src/store/index.js b/src/store/index.js new file mode 100644 index 0000000..53b8437 --- /dev/null +++ b/src/store/index.js @@ -0,0 +1,23 @@ +import Vue from 'vue' +import Vuex from 'vuex' +import app from './modules/app' +import user from './modules/user' +import tagsView from './modules/tagsView' +import permission from './modules/permission' +import settings from './modules/settings' +import getters from './getters' + +Vue.use(Vuex) + +const store = new Vuex.Store({ + modules: { + app, + user, + tagsView, + permission, + settings + }, + getters +}) + +export default store diff --git a/src/store/modules/app.js b/src/store/modules/app.js new file mode 100644 index 0000000..3e22d1c --- /dev/null +++ b/src/store/modules/app.js @@ -0,0 +1,66 @@ +import Cookies from 'js-cookie' + +const state = { + sidebar: { + opened: Cookies.get('sidebarStatus') ? !!+Cookies.get('sidebarStatus') : true, + withoutAnimation: false, + hide: false + }, + device: 'desktop', + size: Cookies.get('size') || 'medium' +} + +const mutations = { + TOGGLE_SIDEBAR: state => { + if (state.sidebar.hide) { + return false; + } + state.sidebar.opened = !state.sidebar.opened + state.sidebar.withoutAnimation = false + if (state.sidebar.opened) { + Cookies.set('sidebarStatus', 1) + } else { + Cookies.set('sidebarStatus', 0) + } + }, + CLOSE_SIDEBAR: (state, withoutAnimation) => { + Cookies.set('sidebarStatus', 0) + state.sidebar.opened = false + state.sidebar.withoutAnimation = withoutAnimation + }, + TOGGLE_DEVICE: (state, device) => { + state.device = device + }, + SET_SIZE: (state, size) => { + state.size = size + Cookies.set('size', size) + }, + SET_SIDEBAR_HIDE: (state, status) => { + state.sidebar.hide = status + } +} + +const actions = { + toggleSideBar({ commit }) { + commit('TOGGLE_SIDEBAR') + }, + closeSideBar({ commit }, { withoutAnimation }) { + commit('CLOSE_SIDEBAR', withoutAnimation) + }, + toggleDevice({ commit }, device) { + commit('TOGGLE_DEVICE', device) + }, + setSize({ commit }, size) { + commit('SET_SIZE', size) + }, + toggleSideBarHide({ commit }, status) { + commit('SET_SIDEBAR_HIDE', status) + } +} + +export default { + namespaced: true, + state, + mutations, + actions +} diff --git a/src/store/modules/permission.js b/src/store/modules/permission.js new file mode 100644 index 0000000..2287665 --- /dev/null +++ b/src/store/modules/permission.js @@ -0,0 +1,133 @@ +import auth from '@/plugins/auth' +import router, { constantRoutes, dynamicRoutes } from '@/router' +import { getRouters } from '@/api/menu' +import Layout from '@/layout/index' +import ParentView from '@/components/ParentView' +import InnerLink from '@/layout/components/InnerLink' + +const permission = { + state: { + routes: [], + addRoutes: [], + defaultRoutes: [], + topbarRouters: [], + sidebarRouters: [] + }, + mutations: { + SET_ROUTES: (state, routes) => { + state.addRoutes = routes + state.routes = constantRoutes.concat(routes) + }, + SET_DEFAULT_ROUTES: (state, routes) => { + state.defaultRoutes = constantRoutes.concat(routes) + }, + SET_TOPBAR_ROUTES: (state, routes) => { + state.topbarRouters = routes + }, + SET_SIDEBAR_ROUTERS: (state, routes) => { + state.sidebarRouters = routes + }, + }, + actions: { + // 生成路由 + GenerateRoutes({ commit }) { + return new Promise(resolve => { + // 向后端请求路由数据 + getRouters().then(res => { + const sdata = JSON.parse(JSON.stringify(res.data)) + const rdata = JSON.parse(JSON.stringify(res.data)) + const sidebarRoutes = filterAsyncRouter(sdata) + const rewriteRoutes = filterAsyncRouter(rdata, false, true) + const asyncRoutes = filterDynamicRoutes(dynamicRoutes); + rewriteRoutes.push({ path: '*', redirect: '/404', hidden: true }) + router.addRoutes(asyncRoutes); + commit('SET_ROUTES', rewriteRoutes) + commit('SET_SIDEBAR_ROUTERS', constantRoutes.concat(sidebarRoutes)) + commit('SET_DEFAULT_ROUTES', sidebarRoutes) + commit('SET_TOPBAR_ROUTES', sidebarRoutes) + resolve(rewriteRoutes) + }) + }) + } + } +} + +// 遍历后台传来的路由字符串,转换为组件对象 +function filterAsyncRouter(asyncRouterMap, lastRouter = false, type = false) { + return asyncRouterMap.filter(route => { + if (type && route.children) { + route.children = filterChildren(route.children) + } + if (route.component) { + // Layout ParentView 组件特殊处理 + if (route.component === 'Layout') { + route.component = Layout + } else if (route.component === 'ParentView') { + route.component = ParentView + } else if (route.component === 'InnerLink') { + route.component = InnerLink + } else { + route.component = loadView(route.component) + } + } + if (route.children != null && route.children && route.children.length) { + route.children = filterAsyncRouter(route.children, route, type) + } else { + delete route['children'] + delete route['redirect'] + } + return true + }) +} + +function filterChildren(childrenMap, lastRouter = false) { + var children = [] + childrenMap.forEach((el, index) => { + if (el.children && el.children.length) { + if (el.component === 'ParentView' && !lastRouter) { + el.children.forEach(c => { + c.path = el.path + '/' + c.path + if (c.children && c.children.length) { + children = children.concat(filterChildren(c.children, c)) + return + } + children.push(c) + }) + return + } + } + if (lastRouter) { + el.path = lastRouter.path + '/' + el.path + } + children = children.concat(el) + }) + return children +} + +// 动态路由遍历,验证是否具备权限 +export function filterDynamicRoutes(routes) { + const res = [] + routes.forEach(route => { + if (route.permissions) { + if (auth.hasPermiOr(route.permissions)) { + res.push(route) + } + } else if (route.roles) { + if (auth.hasRoleOr(route.roles)) { + res.push(route) + } + } + }) + return res +} + +export const loadView = (view) => { + if (process.env.NODE_ENV === 'development') { + return (resolve) => require([`@/views/${view}`], resolve) + } else { + // 使用 import 实现生产环境的路由懒加载 + return () => import(`@/views/${view}`) + } +} + +export default permission diff --git a/src/store/modules/settings.js b/src/store/modules/settings.js new file mode 100644 index 0000000..2455a1e --- /dev/null +++ b/src/store/modules/settings.js @@ -0,0 +1,42 @@ +import defaultSettings from '@/settings' + +const { sideTheme, showSettings, topNav, tagsView, fixedHeader, sidebarLogo, dynamicTitle } = defaultSettings + +const storageSetting = JSON.parse(localStorage.getItem('layout-setting')) || '' +const state = { + title: '', + theme: storageSetting.theme || '#409EFF', + sideTheme: storageSetting.sideTheme || sideTheme, + showSettings: showSettings, + topNav: storageSetting.topNav === undefined ? topNav : storageSetting.topNav, + tagsView: storageSetting.tagsView === undefined ? tagsView : storageSetting.tagsView, + fixedHeader: storageSetting.fixedHeader === undefined ? fixedHeader : storageSetting.fixedHeader, + sidebarLogo: storageSetting.sidebarLogo === undefined ? sidebarLogo : storageSetting.sidebarLogo, + dynamicTitle: storageSetting.dynamicTitle === undefined ? dynamicTitle : storageSetting.dynamicTitle +} +const mutations = { + CHANGE_SETTING: (state, { key, value }) => { + if (state.hasOwnProperty(key)) { + state[key] = value + } + } +} + +const actions = { + // 修改布局设置 + changeSetting({ commit }, data) { + commit('CHANGE_SETTING', data) + }, + // 设置网页标题 + setTitle({ commit }, title) { + state.title = title + } +} + +export default { + namespaced: true, + state, + mutations, + actions +} + diff --git a/src/store/modules/tagsView.js b/src/store/modules/tagsView.js new file mode 100644 index 0000000..d12c8d8 --- /dev/null +++ b/src/store/modules/tagsView.js @@ -0,0 +1,207 @@ +const state = { + visitedViews: [], + cachedViews: [] +} + +const mutations = { + ADD_VISITED_VIEW: (state, view) => { + if (state.visitedViews.some(v => v.path === view.path)) return + state.visitedViews.push( + Object.assign({}, view, { + title: view.meta.title || 'no-name' + }) + ) + }, + ADD_CACHED_VIEW: (state, view) => { + if (state.cachedViews.includes(view.name)) return + if (view.meta && !view.meta.noCache) { + state.cachedViews.push(view.name) + } + }, + + DEL_VISITED_VIEW: (state, view) => { + for (const [i, v] of state.visitedViews.entries()) { + if (v.path === view.path) { + state.visitedViews.splice(i, 1) + break + } + } + }, + DEL_CACHED_VIEW: (state, view) => { + const index = state.cachedViews.indexOf(view.name) + index > -1 && state.cachedViews.splice(index, 1) + }, + + DEL_OTHERS_VISITED_VIEWS: (state, view) => { + state.visitedViews = state.visitedViews.filter(v => { + return v.meta.affix || v.path === view.path + }) + }, + DEL_OTHERS_CACHED_VIEWS: (state, view) => { + const index = state.cachedViews.indexOf(view.name) + if (index > -1) { + state.cachedViews = state.cachedViews.slice(index, index + 1) + } else { + state.cachedViews = [] + } + }, + + DEL_ALL_VISITED_VIEWS: state => { + // keep affix tags + const affixTags = state.visitedViews.filter(tag => tag.meta.affix) + state.visitedViews = affixTags + }, + DEL_ALL_CACHED_VIEWS: state => { + state.cachedViews = [] + }, + + UPDATE_VISITED_VIEW: (state, view) => { + for (let v of state.visitedViews) { + if (v.path === view.path) { + v = Object.assign(v, view) + break + } + } + }, + + DEL_RIGHT_VIEWS: (state, view) => { + const index = state.visitedViews.findIndex(v => v.path === view.path) + if (index === -1) { + return + } + state.visitedViews = state.visitedViews.filter((item, idx) => { + if (idx <= index || (item.meta && item.meta.affix)) { + return true + } + const i = state.cachedViews.indexOf(item.name) + if (i > -1) { + state.cachedViews.splice(i, 1) + } + return false + }) + }, + + DEL_LEFT_VIEWS: (state, view) => { + const index = state.visitedViews.findIndex(v => v.path === view.path) + if (index === -1) { + return + } + state.visitedViews = state.visitedViews.filter((item, idx) => { + if (idx >= index || (item.meta && item.meta.affix)) { + return true + } + const i = state.cachedViews.indexOf(item.name) + if (i > -1) { + state.cachedViews.splice(i, 1) + } + return false + }) + } +} + +const actions = { + addView({ dispatch }, view) { + dispatch('addVisitedView', view) + dispatch('addCachedView', view) + }, + addVisitedView({ commit }, view) { + commit('ADD_VISITED_VIEW', view) + }, + addCachedView({ commit }, view) { + commit('ADD_CACHED_VIEW', view) + }, + + delView({ dispatch, state }, view) { + return new Promise(resolve => { + dispatch('delVisitedView', view) + dispatch('delCachedView', view) + resolve({ + visitedViews: [...state.visitedViews], + cachedViews: [...state.cachedViews] + }) + }) + }, + delVisitedView({ commit, state }, view) { + return new Promise(resolve => { + commit('DEL_VISITED_VIEW', view) + resolve([...state.visitedViews]) + }) + }, + delCachedView({ commit, state }, view) { + return new Promise(resolve => { + commit('DEL_CACHED_VIEW', view) + resolve([...state.cachedViews]) + }) + }, + + delOthersViews({ dispatch, state }, view) { + return new Promise(resolve => { + dispatch('delOthersVisitedViews', view) + dispatch('delOthersCachedViews', view) + resolve({ + visitedViews: [...state.visitedViews], + cachedViews: [...state.cachedViews] + }) + }) + }, + delOthersVisitedViews({ commit, state }, view) { + return new Promise(resolve => { + commit('DEL_OTHERS_VISITED_VIEWS', view) + resolve([...state.visitedViews]) + }) + }, + delOthersCachedViews({ commit, state }, view) { + return new Promise(resolve => { + commit('DEL_OTHERS_CACHED_VIEWS', view) + resolve([...state.cachedViews]) + }) + }, + + delAllViews({ dispatch, state }, view) { + return new Promise(resolve => { + dispatch('delAllVisitedViews', view) + dispatch('delAllCachedViews', view) + resolve({ + visitedViews: [...state.visitedViews], + cachedViews: [...state.cachedViews] + }) + }) + }, + delAllVisitedViews({ commit, state }) { + return new Promise(resolve => { + commit('DEL_ALL_VISITED_VIEWS') + resolve([...state.visitedViews]) + }) + }, + delAllCachedViews({ commit, state }) { + return new Promise(resolve => { + commit('DEL_ALL_CACHED_VIEWS') + resolve([...state.cachedViews]) + }) + }, + + updateVisitedView({ commit }, view) { + commit('UPDATE_VISITED_VIEW', view) + }, + + delRightTags({ commit }, view) { + return new Promise(resolve => { + commit('DEL_RIGHT_VIEWS', view) + resolve([...state.visitedViews]) + }) + }, + + delLeftTags({ commit }, view) { + return new Promise(resolve => { + commit('DEL_LEFT_VIEWS', view) + resolve([...state.visitedViews]) + }) + }, +} + +export default { + namespaced: true, + state, + mutations, + actions +} diff --git a/src/store/modules/user.js b/src/store/modules/user.js new file mode 100644 index 0000000..ab0a6fe --- /dev/null +++ b/src/store/modules/user.js @@ -0,0 +1,96 @@ +import { login, logout, getInfo } from '@/api/login' +import { getToken, setToken, removeToken } from '@/utils/auth' + +const user = { + state: { + token: getToken(), + name: '', + avatar: '', + roles: [], + permissions: [] + }, + + mutations: { + SET_TOKEN: (state, token) => { + state.token = token + }, + SET_NAME: (state, name) => { + state.name = name + }, + SET_AVATAR: (state, avatar) => { + state.avatar = avatar + }, + SET_ROLES: (state, roles) => { + state.roles = roles + }, + SET_PERMISSIONS: (state, permissions) => { + state.permissions = permissions + } + }, + + actions: { + // 登录 + Login({ commit }, userInfo) { + const username = userInfo.username.trim() + const password = userInfo.password + const code = userInfo.code + const uuid = userInfo.uuid + return new Promise((resolve, reject) => { + login(username, password, code, uuid).then(res => { + setToken(res.token) + commit('SET_TOKEN', res.token) + resolve() + }).catch(error => { + reject(error) + }) + }) + }, + + // 获取用户信息 + GetInfo({ commit, state }) { + return new Promise((resolve, reject) => { + getInfo().then(res => { + const user = res.user + const avatar = (user.avatar == "" || user.avatar == null) ? require("@/assets/images/profile.jpg") : process.env.VUE_APP_BASE_API + user.avatar; + if (res.roles && res.roles.length > 0) { // 验证返回的roles是否是一个非空数组 + commit('SET_ROLES', res.roles) + commit('SET_PERMISSIONS', res.permissions) + } else { + commit('SET_ROLES', ['ROLE_DEFAULT']) + } + commit('SET_NAME', user.userName) + commit('SET_AVATAR', avatar) + resolve(res) + }).catch(error => { + reject(error) + }) + }) + }, + + // 退出系统 + LogOut({ commit, state }) { + return new Promise((resolve, reject) => { + logout(state.token).then(() => { + commit('SET_TOKEN', '') + commit('SET_ROLES', []) + commit('SET_PERMISSIONS', []) + removeToken() + resolve() + }).catch(error => { + reject(error) + }) + }) + }, + + // 前端 登出 + FedLogOut({ commit }) { + return new Promise(resolve => { + commit('SET_TOKEN', '') + removeToken() + resolve() + }) + } + } +} + +export default user diff --git a/src/utils/auth.js b/src/utils/auth.js new file mode 100644 index 0000000..08a43d6 --- /dev/null +++ b/src/utils/auth.js @@ -0,0 +1,15 @@ +import Cookies from 'js-cookie' + +const TokenKey = 'Admin-Token' + +export function getToken() { + return Cookies.get(TokenKey) +} + +export function setToken(token) { + return Cookies.set(TokenKey, token) +} + +export function removeToken() { + return Cookies.remove(TokenKey) +} diff --git a/src/utils/calendar.js b/src/utils/calendar.js new file mode 100644 index 0000000..00af448 --- /dev/null +++ b/src/utils/calendar.js @@ -0,0 +1,668 @@ +/** + * @1900-2100区间内的公历、农历互转 + * @charset UTF-8 + * @Author Jea杨(JJonline@JJonline.Cn) + * @Time 2014-7-21 + * @Time 2016-8-13 Fixed 2033hex、Attribution Annals + * @Time 2016-9-25 Fixed lunar LeapMonth Param Bug + * @Time 2017-7-24 Fixed use getTerm Func Param Error.use solar year,NOT lunar year + * @Version 1.0.3 + * @公历转农历:calendar.solar2lunar(1987,11,01); //[you can ignore params of prefix 0] + * @农历转公历:calendar.lunar2solar(1987,09,10); //[you can ignore params of prefix 0] + */ +const calendar = { + + /** + * 农历1900-2100的润大小信息表 + * @Array Of Property + * @return Hex + */ + lunarInfo: [0x04bd8, 0x04ae0, 0x0a570, 0x054d5, 0x0d260, 0x0d950, 0x16554, 0x056a0, 0x09ad0, 0x055d2,//1900-1909 + 0x04ae0, 0x0a5b6, 0x0a4d0, 0x0d250, 0x1d255, 0x0b540, 0x0d6a0, 0x0ada2, 0x095b0, 0x14977,//1910-1919 + 0x04970, 0x0a4b0, 0x0b4b5, 0x06a50, 0x06d40, 0x1ab54, 0x02b60, 0x09570, 0x052f2, 0x04970,//1920-1929 + 0x06566, 0x0d4a0, 0x0ea50, 0x16a95, 0x05ad0, 0x02b60, 0x186e3, 0x092e0, 0x1c8d7, 0x0c950,//1930-1939 + 0x0d4a0, 0x1d8a6, 0x0b550, 0x056a0, 0x1a5b4, 0x025d0, 0x092d0, 0x0d2b2, 0x0a950, 0x0b557,//1940-1949 + 0x06ca0, 0x0b550, 0x15355, 0x04da0, 0x0a5b0, 0x14573, 0x052b0, 0x0a9a8, 0x0e950, 0x06aa0,//1950-1959 + 0x0aea6, 0x0ab50, 0x04b60, 0x0aae4, 0x0a570, 0x05260, 0x0f263, 0x0d950, 0x05b57, 0x056a0,//1960-1969 + 0x096d0, 0x04dd5, 0x04ad0, 0x0a4d0, 0x0d4d4, 0x0d250, 0x0d558, 0x0b540, 0x0b6a0, 0x195a6,//1970-1979 + 0x095b0, 0x049b0, 0x0a974, 0x0a4b0, 0x0b27a, 0x06a50, 0x06d40, 0x0af46, 0x0ab60, 0x09570,//1980-1989 + 0x04af5, 0x04970, 0x064b0, 0x074a3, 0x0ea50, 0x06b58, 0x05ac0, 0x0ab60, 0x096d5, 0x092e0,//1990-1999 + 0x0c960, 0x0d954, 0x0d4a0, 0x0da50, 0x07552, 0x056a0, 0x0abb7, 0x025d0, 0x092d0, 0x0cab5,//2000-2009 + 0x0a950, 0x0b4a0, 0x0baa4, 0x0ad50, 0x055d9, 0x04ba0, 0x0a5b0, 0x15176, 0x052b0, 0x0a930,//2010-2019 + 0x07954, 0x06aa0, 0x0ad50, 0x05b52, 0x04b60, 0x0a6e6, 0x0a4e0, 0x0d260, 0x0ea65, 0x0d530,//2020-2029 + 0x05aa0, 0x076a3, 0x096d0, 0x04afb, 0x04ad0, 0x0a4d0, 0x1d0b6, 0x0d250, 0x0d520, 0x0dd45,//2030-2039 + 0x0b5a0, 0x056d0, 0x055b2, 0x049b0, 0x0a577, 0x0a4b0, 0x0aa50, 0x1b255, 0x06d20, 0x0ada0,//2040-2049 + /**Add By JJonline@JJonline.Cn**/ + 0x14b63, 0x09370, 0x049f8, 0x04970, 0x064b0, 0x168a6, 0x0ea50, 0x06b20, 0x1a6c4, 0x0aae0,//2050-2059 + 0x092e0, 0x0d2e3, 0x0c960, 0x0d557, 0x0d4a0, 0x0da50, 0x05d55, 0x056a0, 0x0a6d0, 0x055d4,//2060-2069 + 0x052d0, 0x0a9b8, 0x0a950, 0x0b4a0, 0x0b6a6, 0x0ad50, 0x055a0, 0x0aba4, 0x0a5b0, 0x052b0,//2070-2079 + 0x0b273, 0x06930, 0x07337, 0x06aa0, 0x0ad50, 0x14b55, 0x04b60, 0x0a570, 0x054e4, 0x0d160,//2080-2089 + 0x0e968, 0x0d520, 0x0daa0, 0x16aa6, 0x056d0, 0x04ae0, 0x0a9d4, 0x0a2d0, 0x0d150, 0x0f252,//2090-2099 + 0x0d520],//2100 + + /** + * 公历每个月份的天数普通表 + * @Array Of Property + * @return Number + */ + solarMonth: [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], + + /** + * 天干地支之天干速查表 + * @Array Of Property trans["甲","乙","丙","丁","戊","己","庚","辛","壬","癸"] + * @return Cn string + */ + Gan: ["\u7532", "\u4e59", "\u4e19", "\u4e01", "\u620a", "\u5df1", "\u5e9a", "\u8f9b", "\u58ec", "\u7678"], + + /** + * 天干地支之地支速查表 + * @Array Of Property + * @trans["子","丑","寅","卯","辰","巳","午","未","申","酉","戌","亥"] + * @return Cn string + */ + Zhi: ["\u5b50", "\u4e11", "\u5bc5", "\u536f", "\u8fb0", "\u5df3", "\u5348", "\u672a", "\u7533", "\u9149", "\u620c", "\u4ea5"], + + /** + * 天干地支之地支速查表<=>生肖 + * @Array Of Property + * @trans["鼠","牛","虎","兔","龙","蛇","马","羊","猴","鸡","狗","猪"] + * @return Cn string + */ + Animals: ["\u9f20", "\u725b", "\u864e", "\u5154", "\u9f99", "\u86c7", "\u9a6c", "\u7f8a", "\u7334", "\u9e21", "\u72d7", "\u732a"], + + /** + * 阳历节日 + */ + festival: { + '1-1': {title: '元旦节'}, + '2-14': {title: '情人节'}, + '5-1': {title: '劳动节'}, + '5-4': {title: '青年节'}, + '6-1': {title: '儿童节'}, + '9-10': {title: '教师节'}, + '10-1': {title: '国庆节'}, + '12-25': {title: '圣诞节'}, + + '3-8': {title: '妇女节'}, + '3-12': {title: '植树节'}, + '4-1': {title: '愚人节'}, + '5-12': {title: '护士节'}, + '7-1': {title: '建党节'}, + '8-1': {title: '建军节'}, + '12-24': {title: '平安夜'}, + }, + + /** + * 农历节日 + */ + lFestival: { + '12-30': {title: '除夕'}, + '1-1': {title: '春节'}, + '1-15': {title: '元宵节'}, + '2-2': {title: '龙抬头'}, + '5-5': {title: '端午节'}, + '7-7': {title: '七夕节'}, + '7-15': {title: '中元节'}, + '8-15': {title: '中秋节'}, + '9-9': {title: '重阳节'}, + '10-1': {title: '寒衣节'}, + '10-15': {title: '下元节'}, + '12-8': {title: '腊八节'}, + '12-23': {title: '北方小年'}, + '12-24': {title: '南方小年'}, + }, + + /** + * 返回默认定义的阳历节日 + */ + getFestival() { + return this.festival + }, + + /** + * 返回默认定义的内容里节日 + */ + getLunarFestival() { + return this.lFestival + }, + + /** + * + * @param param {Object} 按照festival的格式输入数据,设置阳历节日 + */ + setFestival(param = {}) { + this.festival = param + }, + + /** + * + * @param param {Object} 按照lFestival的格式输入数据,设置农历节日 + */ + setLunarFestival(param = {}) { + this.lFestival = param + }, + + /** + * 24节气速查表 + * @Array Of Property + * @trans["小寒","大寒","立春","雨水","惊蛰","春分","清明","谷雨","立夏","小满","芒种","夏至","小暑","大暑","立秋","处暑","白露","秋分","寒露","霜降","立冬","小雪","大雪","冬至"] + * @return Cn string + */ + solarTerm: ["\u5c0f\u5bd2", "\u5927\u5bd2", "\u7acb\u6625", "\u96e8\u6c34", "\u60ca\u86f0", "\u6625\u5206", "\u6e05\u660e", "\u8c37\u96e8", "\u7acb\u590f", "\u5c0f\u6ee1", "\u8292\u79cd", "\u590f\u81f3", "\u5c0f\u6691", "\u5927\u6691", "\u7acb\u79cb", "\u5904\u6691", "\u767d\u9732", "\u79cb\u5206", "\u5bd2\u9732", "\u971c\u964d", "\u7acb\u51ac", "\u5c0f\u96ea", "\u5927\u96ea", "\u51ac\u81f3"], + + /** + * 1900-2100各年的24节气日期速查表 + * @Array Of Property + * @return 0x string For splice + */ + sTermInfo: ['9778397bd097c36b0b6fc9274c91aa', '97b6b97bd19801ec9210c965cc920e', '97bcf97c3598082c95f8c965cc920f', + '97bd0b06bdb0722c965ce1cfcc920f', 'b027097bd097c36b0b6fc9274c91aa', '97b6b97bd19801ec9210c965cc920e', + '97bcf97c359801ec95f8c965cc920f', '97bd0b06bdb0722c965ce1cfcc920f', 'b027097bd097c36b0b6fc9274c91aa', + '97b6b97bd19801ec9210c965cc920e', '97bcf97c359801ec95f8c965cc920f', '97bd0b06bdb0722c965ce1cfcc920f', + 'b027097bd097c36b0b6fc9274c91aa', '9778397bd19801ec9210c965cc920e', '97b6b97bd19801ec95f8c965cc920f', + '97bd09801d98082c95f8e1cfcc920f', '97bd097bd097c36b0b6fc9210c8dc2', '9778397bd197c36c9210c9274c91aa', + '97b6b97bd19801ec95f8c965cc920e', '97bd09801d98082c95f8e1cfcc920f', '97bd097bd097c36b0b6fc9210c8dc2', + '9778397bd097c36c9210c9274c91aa', '97b6b97bd19801ec95f8c965cc920e', '97bcf97c3598082c95f8e1cfcc920f', + '97bd097bd097c36b0b6fc9210c8dc2', '9778397bd097c36c9210c9274c91aa', '97b6b97bd19801ec9210c965cc920e', + '97bcf97c3598082c95f8c965cc920f', '97bd097bd097c35b0b6fc920fb0722', '9778397bd097c36b0b6fc9274c91aa', + '97b6b97bd19801ec9210c965cc920e', '97bcf97c3598082c95f8c965cc920f', '97bd097bd097c35b0b6fc920fb0722', + '9778397bd097c36b0b6fc9274c91aa', '97b6b97bd19801ec9210c965cc920e', '97bcf97c359801ec95f8c965cc920f', + '97bd097bd097c35b0b6fc920fb0722', '9778397bd097c36b0b6fc9274c91aa', '97b6b97bd19801ec9210c965cc920e', + '97bcf97c359801ec95f8c965cc920f', '97bd097bd097c35b0b6fc920fb0722', '9778397bd097c36b0b6fc9274c91aa', + '97b6b97bd19801ec9210c965cc920e', '97bcf97c359801ec95f8c965cc920f', '97bd097bd07f595b0b6fc920fb0722', + '9778397bd097c36b0b6fc9210c8dc2', '9778397bd19801ec9210c9274c920e', '97b6b97bd19801ec95f8c965cc920f', + '97bd07f5307f595b0b0bc920fb0722', '7f0e397bd097c36b0b6fc9210c8dc2', '9778397bd097c36c9210c9274c920e', + '97b6b97bd19801ec95f8c965cc920f', '97bd07f5307f595b0b0bc920fb0722', '7f0e397bd097c36b0b6fc9210c8dc2', + '9778397bd097c36c9210c9274c91aa', '97b6b97bd19801ec9210c965cc920e', '97bd07f1487f595b0b0bc920fb0722', + '7f0e397bd097c36b0b6fc9210c8dc2', '9778397bd097c36b0b6fc9274c91aa', '97b6b97bd19801ec9210c965cc920e', + '97bcf7f1487f595b0b0bb0b6fb0722', '7f0e397bd097c35b0b6fc920fb0722', '9778397bd097c36b0b6fc9274c91aa', + '97b6b97bd19801ec9210c965cc920e', '97bcf7f1487f595b0b0bb0b6fb0722', '7f0e397bd097c35b0b6fc920fb0722', + '9778397bd097c36b0b6fc9274c91aa', '97b6b97bd19801ec9210c965cc920e', '97bcf7f1487f531b0b0bb0b6fb0722', + '7f0e397bd097c35b0b6fc920fb0722', '9778397bd097c36b0b6fc9274c91aa', '97b6b97bd19801ec9210c965cc920e', + '97bcf7f1487f531b0b0bb0b6fb0722', '7f0e397bd07f595b0b6fc920fb0722', '9778397bd097c36b0b6fc9274c91aa', + '97b6b97bd19801ec9210c9274c920e', '97bcf7f0e47f531b0b0bb0b6fb0722', '7f0e397bd07f595b0b0bc920fb0722', + '9778397bd097c36b0b6fc9210c91aa', '97b6b97bd197c36c9210c9274c920e', '97bcf7f0e47f531b0b0bb0b6fb0722', + '7f0e397bd07f595b0b0bc920fb0722', '9778397bd097c36b0b6fc9210c8dc2', '9778397bd097c36c9210c9274c920e', + '97b6b7f0e47f531b0723b0b6fb0722', '7f0e37f5307f595b0b0bc920fb0722', '7f0e397bd097c36b0b6fc9210c8dc2', + '9778397bd097c36b0b70c9274c91aa', '97b6b7f0e47f531b0723b0b6fb0721', '7f0e37f1487f595b0b0bb0b6fb0722', + '7f0e397bd097c35b0b6fc9210c8dc2', '9778397bd097c36b0b6fc9274c91aa', '97b6b7f0e47f531b0723b0b6fb0721', + '7f0e27f1487f595b0b0bb0b6fb0722', '7f0e397bd097c35b0b6fc920fb0722', '9778397bd097c36b0b6fc9274c91aa', + '97b6b7f0e47f531b0723b0b6fb0721', '7f0e27f1487f531b0b0bb0b6fb0722', '7f0e397bd097c35b0b6fc920fb0722', + '9778397bd097c36b0b6fc9274c91aa', '97b6b7f0e47f531b0723b0b6fb0721', '7f0e27f1487f531b0b0bb0b6fb0722', + '7f0e397bd097c35b0b6fc920fb0722', '9778397bd097c36b0b6fc9274c91aa', '97b6b7f0e47f531b0723b0b6fb0721', + '7f0e27f1487f531b0b0bb0b6fb0722', '7f0e397bd07f595b0b0bc920fb0722', '9778397bd097c36b0b6fc9274c91aa', + '97b6b7f0e47f531b0723b0787b0721', '7f0e27f0e47f531b0b0bb0b6fb0722', '7f0e397bd07f595b0b0bc920fb0722', + '9778397bd097c36b0b6fc9210c91aa', '97b6b7f0e47f149b0723b0787b0721', '7f0e27f0e47f531b0723b0b6fb0722', + '7f0e397bd07f595b0b0bc920fb0722', '9778397bd097c36b0b6fc9210c8dc2', '977837f0e37f149b0723b0787b0721', + '7f07e7f0e47f531b0723b0b6fb0722', '7f0e37f5307f595b0b0bc920fb0722', '7f0e397bd097c35b0b6fc9210c8dc2', + '977837f0e37f14998082b0787b0721', '7f07e7f0e47f531b0723b0b6fb0721', '7f0e37f1487f595b0b0bb0b6fb0722', + '7f0e397bd097c35b0b6fc9210c8dc2', '977837f0e37f14998082b0787b06bd', '7f07e7f0e47f531b0723b0b6fb0721', + '7f0e27f1487f531b0b0bb0b6fb0722', '7f0e397bd097c35b0b6fc920fb0722', '977837f0e37f14998082b0787b06bd', + '7f07e7f0e47f531b0723b0b6fb0721', '7f0e27f1487f531b0b0bb0b6fb0722', '7f0e397bd097c35b0b6fc920fb0722', + '977837f0e37f14998082b0787b06bd', '7f07e7f0e47f531b0723b0b6fb0721', '7f0e27f1487f531b0b0bb0b6fb0722', + '7f0e397bd07f595b0b0bc920fb0722', '977837f0e37f14998082b0787b06bd', '7f07e7f0e47f531b0723b0b6fb0721', + '7f0e27f1487f531b0b0bb0b6fb0722', '7f0e397bd07f595b0b0bc920fb0722', '977837f0e37f14998082b0787b06bd', + '7f07e7f0e47f149b0723b0787b0721', '7f0e27f0e47f531b0b0bb0b6fb0722', '7f0e397bd07f595b0b0bc920fb0722', + '977837f0e37f14998082b0723b06bd', '7f07e7f0e37f149b0723b0787b0721', '7f0e27f0e47f531b0723b0b6fb0722', + '7f0e397bd07f595b0b0bc920fb0722', '977837f0e37f14898082b0723b02d5', '7ec967f0e37f14998082b0787b0721', + '7f07e7f0e47f531b0723b0b6fb0722', '7f0e37f1487f595b0b0bb0b6fb0722', '7f0e37f0e37f14898082b0723b02d5', + '7ec967f0e37f14998082b0787b0721', '7f07e7f0e47f531b0723b0b6fb0722', '7f0e37f1487f531b0b0bb0b6fb0722', + '7f0e37f0e37f14898082b0723b02d5', '7ec967f0e37f14998082b0787b06bd', '7f07e7f0e47f531b0723b0b6fb0721', + '7f0e37f1487f531b0b0bb0b6fb0722', '7f0e37f0e37f14898082b072297c35', '7ec967f0e37f14998082b0787b06bd', + '7f07e7f0e47f531b0723b0b6fb0721', '7f0e27f1487f531b0b0bb0b6fb0722', '7f0e37f0e37f14898082b072297c35', + '7ec967f0e37f14998082b0787b06bd', '7f07e7f0e47f531b0723b0b6fb0721', '7f0e27f1487f531b0b0bb0b6fb0722', + '7f0e37f0e366aa89801eb072297c35', '7ec967f0e37f14998082b0787b06bd', '7f07e7f0e47f149b0723b0787b0721', + '7f0e27f1487f531b0b0bb0b6fb0722', '7f0e37f0e366aa89801eb072297c35', '7ec967f0e37f14998082b0723b06bd', + '7f07e7f0e47f149b0723b0787b0721', '7f0e27f0e47f531b0723b0b6fb0722', '7f0e37f0e366aa89801eb072297c35', + '7ec967f0e37f14998082b0723b06bd', '7f07e7f0e37f14998083b0787b0721', '7f0e27f0e47f531b0723b0b6fb0722', + '7f0e37f0e366aa89801eb072297c35', '7ec967f0e37f14898082b0723b02d5', '7f07e7f0e37f14998082b0787b0721', + '7f07e7f0e47f531b0723b0b6fb0722', '7f0e36665b66aa89801e9808297c35', '665f67f0e37f14898082b0723b02d5', + '7ec967f0e37f14998082b0787b0721', '7f07e7f0e47f531b0723b0b6fb0722', '7f0e36665b66a449801e9808297c35', + '665f67f0e37f14898082b0723b02d5', '7ec967f0e37f14998082b0787b06bd', '7f07e7f0e47f531b0723b0b6fb0721', + '7f0e36665b66a449801e9808297c35', '665f67f0e37f14898082b072297c35', '7ec967f0e37f14998082b0787b06bd', + '7f07e7f0e47f531b0723b0b6fb0721', '7f0e26665b66a449801e9808297c35', '665f67f0e37f1489801eb072297c35', + '7ec967f0e37f14998082b0787b06bd', '7f07e7f0e47f531b0723b0b6fb0721', '7f0e27f1487f531b0b0bb0b6fb0722'], + + /** + * 数字转中文速查表 + * @Array Of Property + * @trans ['日','一','二','三','四','五','六','七','八','九','十'] + * @return Cn string + */ + nStr1: ["\u65e5", "\u4e00", "\u4e8c", "\u4e09", "\u56db", "\u4e94", "\u516d", "\u4e03", "\u516b", "\u4e5d", "\u5341"], + + /** + * 日期转农历称呼速查表 + * @Array Of Property + * @trans ['初','十','廿','卅'] + * @return Cn string + */ + nStr2: ["\u521d", "\u5341", "\u5eff", "\u5345"], + + /** + * 月份转农历称呼速查表 + * @Array Of Property + * @trans ['正','一','二','三','四','五','六','七','八','九','十','冬','腊'] + * @return Cn string + */ + nStr3: ["\u6b63", "\u4e8c", "\u4e09", "\u56db", "\u4e94", "\u516d", "\u4e03", "\u516b", "\u4e5d", "\u5341", "\u51ac", "\u814a"], + + /** + * 返回农历y年一整年的总天数 + * @param y lunar Year + * @return Number + * @eg:var count = calendar.lYearDays(1987) ;//count=387 + */ + lYearDays: function (y) { + let i, sum = 348; + for (i = 0x8000; i > 0x8; i >>= 1) { + sum += (this.lunarInfo[y - 1900] & i) ? 1 : 0; + } + return (sum + this.leapDays(y)); + }, + + /** + * 返回农历y年闰月是哪个月;若y年没有闰月 则返回0 + * @param y lunar Year + * @return Number (0-12) + * @eg:var leapMonth = calendar.leapMonth(1987) ;//leapMonth=6 + */ + leapMonth: function (y) { //闰字编码 \u95f0 + return (this.lunarInfo[y - 1900] & 0xf); + }, + + /** + * 返回农历y年闰月的天数 若该年没有闰月则返回0 + * @param y lunar Year + * @return Number (0、29、30) + * @eg:var leapMonthDay = calendar.leapDays(1987) ;//leapMonthDay=29 + */ + leapDays: function (y) { + if (this.leapMonth(y)) { + return ((this.lunarInfo[y - 1900] & 0x10000) ? 30 : 29); + } + return (0); + }, + + /** + * 返回农历y年m月(非闰月)的总天数,计算m为闰月时的天数请使用leapDays方法 + * @param y lunar Year + * @param m lunar Month + * @return Number (-1、29、30) + * @eg:var MonthDay = calendar.monthDays(1987,9) ;//MonthDay=29 + */ + monthDays: function (y, m) { + if (m > 12 || m < 1) { + return -1 + }//月份参数从1至12,参数错误返回-1 + return ((this.lunarInfo[y - 1900] & (0x10000 >> m)) ? 30 : 29); + }, + + /** + * 返回公历(!)y年m月的天数 + * @param y solar Year + * @param m solar Month + * @return Number (-1、28、29、30、31) + * @eg:var solarMonthDay = calendar.leapDays(1987) ;//solarMonthDay=30 + */ + solarDays: function (y, m) { + if (m > 12 || m < 1) { + return -1 + } //若参数错误 返回-1 + const ms = m - 1; + if (ms === 1) { //2月份的闰平规律测算后确认返回28或29 + return (((y % 4 === 0) && (y % 100 !== 0) || (y % 400 === 0)) ? 29 : 28); + } else { + return (this.solarMonth[ms]); + } + }, + + /** + * 农历年份转换为干支纪年 + * @param lYear 农历年的年份数 + * @return Cn string + */ + toGanZhiYear: function (lYear) { + var ganKey = (lYear - 3) % 10; + var zhiKey = (lYear - 3) % 12; + if (ganKey === 0) ganKey = 10;//如果余数为0则为最后一个天干 + if (zhiKey === 0) zhiKey = 12;//如果余数为0则为最后一个地支 + return this.Gan[ganKey - 1] + this.Zhi[zhiKey - 1]; + + }, + + /** + * 公历月、日判断所属星座 + * @param cMonth [description] + * @param cDay [description] + * @return Cn string + */ + toAstro: function (cMonth, cDay) { + const s = "\u9b54\u7faf\u6c34\u74f6\u53cc\u9c7c\u767d\u7f8a\u91d1\u725b\u53cc\u5b50\u5de8\u87f9\u72ee\u5b50\u5904\u5973\u5929\u79e4\u5929\u874e\u5c04\u624b\u9b54\u7faf"; + const arr = [20, 19, 21, 21, 21, 22, 23, 23, 23, 23, 22, 22]; + return s.substr(cMonth * 2 - (cDay < arr[cMonth - 1] ? 2 : 0), 2) + "\u5ea7";//座 + }, + + /** + * 传入offset偏移量返回干支 + * @param offset 相对甲子的偏移量 + * @return Cn string + */ + toGanZhi: function (offset) { + return this.Gan[offset % 10] + this.Zhi[offset % 12]; + }, + + /** + * 传入公历(!)y年获得该年第n个节气的公历日期 + * @param y y公历年(1900-2100) + * @param n n二十四节气中的第几个节气(1~24);从n=1(小寒)算起 + * @return day Number + * @eg:var _24 = calendar.getTerm(1987,3) ;//_24=4;意即1987年2月4日立春 + */ + getTerm: function (y, n) { + if( y < 1900 || y > 2100 || n < 1 || n > 24) { + return -1; + } + const _table = this.sTermInfo[y - 1900]; + const _calcDay = [] + for (let index = 0; index < _table.length; index += 5) { + const chunk = parseInt('0x' + _table.substr(index, 5)).toString() + _calcDay.push( + chunk[0], + chunk.substr(1, 2), + chunk[3], + chunk.substr(4, 2) + ) + } + return parseInt(_calcDay[n - 1]); + }, + + /** + * 传入农历数字月份返回汉语通俗表示法 + * @param m lunar month + * @return Cn string + * @eg:var cnMonth = calendar.toChinaMonth(12) ;//cnMonth='腊月' + */ + toChinaMonth: function (m) { // 月 => \u6708 + if (m > 12 || m < 1) { + return -1 + } //若参数错误 返回-1 + let s = this.nStr3[m - 1]; + s += "\u6708";//加上月字 + return s; + }, + + /** + * 传入农历日期数字返回汉字表示法 + * @param d lunar day + * @return Cn string + * @eg:var cnDay = calendar.toChinaDay(21) ;//cnMonth='廿一' + */ + toChinaDay: function (d) { //日 => \u65e5 + let s; + switch (d) { + case 10: + s = '\u521d\u5341'; + break; + case 20: + s = '\u4e8c\u5341'; + break; + case 30: + s = '\u4e09\u5341'; + break; + default : + s = this.nStr2[Math.floor(d / 10)]; + s += this.nStr1[d % 10]; + } + return (s); + }, + + /** + * 年份转生肖[!仅能大致转换] => 精确划分生肖分界线是“立春” + * @param y year + * @return Cn string + * @eg:var animal = calendar.getAnimal(1987) ;//animal='兔' + */ + getAnimal: function (y) { + return this.Animals[(y - 4) % 12] + }, + + /** + * 传入阳历年月日获得详细的公历、农历object信息 <=>JSON + * !important! 公历参数区间1900.1.31~2100.12.31 + * @param yPara solar year + * @param mPara solar month + * @param dPara solar day + * @return JSON object + * @eg:console.log(calendar.solar2lunar(1987,11,01)); + */ + solar2lunar: function (yPara, mPara, dPara) { + let y = parseInt(yPara); + let m = parseInt(mPara); + let d = parseInt(dPara); + //年份限定、上限 + if (y < 1900 || y > 2100) { + return -1;// undefined转换为数字变为NaN + } + //公历传参最下限 + if (y === 1900 && m === 1 && d < 31) { + return -1; + } + + //未传参 获得当天 + let objDate; + if (!y) { + objDate = new Date(); + } else { + objDate = new Date(y, parseInt(m) - 1, d); + } + let i, leap = 0, temp = 0; + //修正ymd参数 + y = objDate.getFullYear(); + m = objDate.getMonth() + 1; + d = objDate.getDate(); + let offset = (Date.UTC(objDate.getFullYear(), objDate.getMonth(), objDate.getDate()) - Date.UTC(1900, 0, 31)) / 86400000; + for (i = 1900; i < 2101 && offset > 0; i++) { + temp = this.lYearDays(i); + offset -= temp; + } + if (offset < 0) { + offset += temp; + i--; + } + + //是否今天 + let isTodayObj = new Date(), + isToday = false; + if (isTodayObj.getFullYear() === y && isTodayObj.getMonth() + 1 === m && isTodayObj.getDate() === d) { + isToday = true; + } + //星期几 + let nWeek = objDate.getDay(), + cWeek = this.nStr1[nWeek]; + //数字表示周几顺应天朝周一开始的惯例 + if (nWeek === 0) { + nWeek = 7; + } + //农历年 + const year = i; + leap = this.leapMonth(i); //闰哪个月 + let isLeap = false; + + //效验闰月 + for (i = 1; i < 13 && offset > 0; i++) { + //闰月 + if (leap > 0 && i === (leap + 1) && isLeap === false) { + --i; + isLeap = true; + temp = this.leapDays(year); //计算农历闰月天数 + } else { + temp = this.monthDays(year, i);//计算农历普通月天数 + } + //解除闰月 + if (isLeap === true && i === (leap + 1)) { + isLeap = false; + } + offset -= temp; + } + // 闰月导致数组下标重叠取反 + if (offset === 0 && leap > 0 && i === leap + 1) { + if (isLeap) { + isLeap = false; + } else { + isLeap = true; + --i; + } + } + if (offset < 0) { + offset += temp; + --i; + } + //农历月 + const month = i; + //农历日 + const day = offset + 1; + //天干地支处理 + const sm = m - 1; + const gzY = this.toGanZhiYear(year); + + // 当月的两个节气 + // bugfix-2017-7-24 11:03:38 use lunar Year Param `y` Not `year` + const firstNode = this.getTerm(y, (m * 2 - 1));//返回当月「节」为几日开始 + const secondNode = this.getTerm(y, (m * 2));//返回当月「节」为几日开始 + + // 依据12节气修正干支月 + let gzM = this.toGanZhi((y - 1900) * 12 + m + 11); + if (d >= firstNode) { + gzM = this.toGanZhi((y - 1900) * 12 + m + 12); + } + + //传入的日期的节气与否 + let isTerm = false; + let Term = null; + if (firstNode === d) { + isTerm = true; + Term = this.solarTerm[m * 2 - 2]; + } + if (secondNode === d) { + isTerm = true; + Term = this.solarTerm[m * 2 - 1]; + } + //日柱 当月一日与 1900/1/1 相差天数 + const dayCyclical = Date.UTC(y, sm, 1, 0, 0, 0, 0) / 86400000 + 25567 + 10; + const gzD = this.toGanZhi(dayCyclical + d - 1); + //该日期所属的星座 + const astro = this.toAstro(m, d); + + const solarDate = y + '-' + m + '-' + d; + const lunarDate = year + '-' + month + '-' + day; + + const festival = this.festival; + const lFestival = this.lFestival; + + const festivalDate = m + '-' + d; + let lunarFestivalDate = month + '-' + day; + + // bugfix https://github.com/jjonline/calendar.js/issues/29 + // 农历节日修正:农历12月小月则29号除夕,大月则30号除夕 + // 此处取巧修正:当前为农历12月29号时增加一次判断并且把lunarFestivalDate设置为12-30以正确取得除夕 + // 天朝农历节日遇闰月过前不过后的原则,此处取农历12月天数不考虑闰月 + // 农历润12月在本工具支持的200年区间内仅1574年出现 + if (month === 12 && day === 29 && this.monthDays(year, month) === 29) { + lunarFestivalDate = '12-30'; + } + return { + date: solarDate, + lunarDate: lunarDate, + festival: festival[festivalDate] ? festival[festivalDate].title : null, + lunarFestival: lFestival[lunarFestivalDate] ? lFestival[lunarFestivalDate].title : null, + 'lYear': year, + 'lMonth': month, + 'lDay': day, + 'Animal': this.getAnimal(year), + 'IMonthCn': (isLeap ? "\u95f0" : '') + this.toChinaMonth(month), + 'IDayCn': this.toChinaDay(day), + 'cYear': y, + 'cMonth': m, + 'cDay': d, + 'gzYear': gzY, + 'gzMonth': gzM, + 'gzDay': gzD, + 'isToday': isToday, + 'isLeap': isLeap, + 'nWeek': nWeek, + 'ncWeek': "\u661f\u671f" + cWeek, + 'isTerm': isTerm, + 'Term': Term, + 'astro': astro + }; + }, + + /** + * 传入农历年月日以及传入的月份是否闰月获得详细的公历、农历object信息 <=>JSON + * !important! 参数区间1900.1.31~2100.12.1 + * @param y lunar year + * @param m lunar month + * @param d lunar day + * @param isLeapMonth lunar month is leap or not.[如果是农历闰月第四个参数赋值true即可] + * @return JSON object + * @eg:console.log(calendar.lunar2solar(1987,9,10)); + */ + lunar2solar: function (y, m, d, isLeapMonth) { + y = parseInt(y) + m = parseInt(m) + d = parseInt(d) + isLeapMonth = !!isLeapMonth; + const leapOffset = 0; + const leapMonth = this.leapMonth(y); + const leapDay = this.leapDays(y); + if (isLeapMonth && (leapMonth !== m)) { + return -1; + }//传参要求计算该闰月公历 但该年得出的闰月与传参的月份并不同 + if (y === 2100 && m === 12 && d > 1 || y === 1900 && m === 1 && d < 31) { + return -1; + }//超出了最大极限值 + const day = this.monthDays(y, m); + let _day = day; + //bugFix 2016-9-25 + //if month is leap, _day use leapDays method + if (isLeapMonth) { + _day = this.leapDays(y, m); + } + if (y < 1900 || y > 2100 || d > _day) { + return -1; + }//参数合法性效验 + + //计算农历的时间差 + let offset = 0; + let i; + for (i = 1900; i < y; i++) { + offset += this.lYearDays(i); + } + let leap = 0, isAdd = false; + for (i = 1; i < m; i++) { + leap = this.leapMonth(y); + if (!isAdd) {//处理闰月 + if (leap <= i && leap > 0) { + offset += this.leapDays(y); + isAdd = true; + } + } + offset += this.monthDays(y, i); + } + //转换闰月农历 需补充该年闰月的前一个月的时差 + if (isLeapMonth) { + offset += day; + } + //1900年农历正月一日的公历时间为1900年1月30日0时0分0秒(该时间也是本农历的最开始起始点) + const strap = Date.UTC(1900, 1, 30, 0, 0, 0); + const calObj = new Date((offset + d - 31) * 86400000 + strap); + const cY = calObj.getUTCFullYear(); + const cM = calObj.getUTCMonth() + 1; + const cD = calObj.getUTCDate(); + + return this.solar2lunar(cY, cM, cD); + } +}; + +export default calendar; \ No newline at end of file diff --git a/src/utils/dict/Dict.js b/src/utils/dict/Dict.js new file mode 100644 index 0000000..104bd6e --- /dev/null +++ b/src/utils/dict/Dict.js @@ -0,0 +1,82 @@ +import Vue from 'vue' +import { mergeRecursive } from "@/utils/ruoyi"; +import DictMeta from './DictMeta' +import DictData from './DictData' + +const DEFAULT_DICT_OPTIONS = { + types: [], +} + +/** + * @classdesc 字典 + * @property {Object} label 标签对象,内部属性名为字典类型名称 + * @property {Object} dict 字段数组,内部属性名为字典类型名称 + * @property {Array.} _dictMetas 字典元数据数组 + */ +export default class Dict { + constructor() { + this.owner = null + this.label = {} + this.type = {} + } + + init(options) { + if (options instanceof Array) { + options = { types: options } + } + const opts = mergeRecursive(DEFAULT_DICT_OPTIONS, options) + if (opts.types === undefined) { + throw new Error('need dict types') + } + const ps = [] + this._dictMetas = opts.types.map(t => DictMeta.parse(t)) + this._dictMetas.forEach(dictMeta => { + const type = dictMeta.type + Vue.set(this.label, type, {}) + Vue.set(this.type, type, []) + if (dictMeta.lazy) { + return + } + ps.push(loadDict(this, dictMeta)) + }) + return Promise.all(ps) + } + + /** + * 重新加载字典 + * @param {String} type 字典类型 + */ + reloadDict(type) { + const dictMeta = this._dictMetas.find(e => e.type === type) + if (dictMeta === undefined) { + return Promise.reject(`the dict meta of ${type} was not found`) + } + return loadDict(this, dictMeta) + } +} + +/** + * 加载字典 + * @param {Dict} dict 字典 + * @param {DictMeta} dictMeta 字典元数据 + * @returns {Promise} + */ +function loadDict(dict, dictMeta) { + return dictMeta.request(dictMeta) + .then(response => { + const type = dictMeta.type + let dicts = dictMeta.responseConverter(response, dictMeta) + if (!(dicts instanceof Array)) { + console.error('the return of responseConverter must be Array.') + dicts = [] + } else if (dicts.filter(d => d instanceof DictData).length !== dicts.length) { + console.error('the type of elements in dicts must be DictData') + dicts = [] + } + dict.type[type].splice(0, Number.MAX_SAFE_INTEGER, ...dicts) + dicts.forEach(d => { + Vue.set(dict.label[type], d.value, d.label) + }) + return dicts + }) +} diff --git a/src/utils/dict/DictConverter.js b/src/utils/dict/DictConverter.js new file mode 100644 index 0000000..0cf5df8 --- /dev/null +++ b/src/utils/dict/DictConverter.js @@ -0,0 +1,17 @@ +import DictOptions from './DictOptions' +import DictData from './DictData' + +export default function(dict, dictMeta) { + const label = determineDictField(dict, dictMeta.labelField, ...DictOptions.DEFAULT_LABEL_FIELDS) + const value = determineDictField(dict, dictMeta.valueField, ...DictOptions.DEFAULT_VALUE_FIELDS) + return new DictData(dict[label], dict[value], dict) +} + +/** + * 确定字典字段 + * @param {DictData} dict + * @param {...String} fields + */ +function determineDictField(dict, ...fields) { + return fields.find(f => Object.prototype.hasOwnProperty.call(dict, f)) +} diff --git a/src/utils/dict/DictData.js b/src/utils/dict/DictData.js new file mode 100644 index 0000000..afc763e --- /dev/null +++ b/src/utils/dict/DictData.js @@ -0,0 +1,13 @@ +/** + * @classdesc 字典数据 + * @property {String} label 标签 + * @property {*} value 标签 + * @property {Object} raw 原始数据 + */ +export default class DictData { + constructor(label, value, raw) { + this.label = label + this.value = value + this.raw = raw + } +} diff --git a/src/utils/dict/DictMeta.js b/src/utils/dict/DictMeta.js new file mode 100644 index 0000000..9570c6d --- /dev/null +++ b/src/utils/dict/DictMeta.js @@ -0,0 +1,38 @@ +import { mergeRecursive } from "@/utils/ruoyi"; +import DictOptions from './DictOptions' + +/** + * @classdesc 字典元数据 + * @property {String} type 类型 + * @property {Function} request 请求 + * @property {String} label 标签字段 + * @property {String} value 值字段 + */ +export default class DictMeta { + constructor(options) { + this.type = options.type + this.request = options.request, + this.responseConverter = options.responseConverter + this.labelField = options.labelField + this.valueField = options.valueField + this.lazy = options.lazy === true + } +} + + +/** + * 解析字典元数据 + * @param {Object} options + * @returns {DictMeta} + */ +DictMeta.parse= function(options) { + let opts = null + if (typeof options === 'string') { + opts = DictOptions.metas[options] || {} + opts.type = options + } else if (typeof options === 'object') { + opts = options + } + opts = mergeRecursive(DictOptions.metas['*'], opts) + return new DictMeta(opts) +} diff --git a/src/utils/dict/DictOptions.js b/src/utils/dict/DictOptions.js new file mode 100644 index 0000000..338a94e --- /dev/null +++ b/src/utils/dict/DictOptions.js @@ -0,0 +1,51 @@ +import { mergeRecursive } from "@/utils/ruoyi"; +import dictConverter from './DictConverter' + +export const options = { + metas: { + '*': { + /** + * 字典请求,方法签名为function(dictMeta: DictMeta): Promise + */ + request: (dictMeta) => { + console.log(`load dict ${dictMeta.type}`) + return Promise.resolve([]) + }, + /** + * 字典响应数据转换器,方法签名为function(response: Object, dictMeta: DictMeta): DictData + */ + responseConverter, + labelField: 'label', + valueField: 'value', + }, + }, + /** + * 默认标签字段 + */ + DEFAULT_LABEL_FIELDS: ['label', 'name', 'title'], + /** + * 默认值字段 + */ + DEFAULT_VALUE_FIELDS: ['value', 'id', 'uid', 'key'], +} + +/** + * 映射字典 + * @param {Object} response 字典数据 + * @param {DictMeta} dictMeta 字典元数据 + * @returns {DictData} + */ +function responseConverter(response, dictMeta) { + const dicts = response.content instanceof Array ? response.content : response + if (dicts === undefined) { + console.warn(`no dict data of "${dictMeta.type}" found in the response`) + return [] + } + return dicts.map(d => dictConverter(d, dictMeta)) +} + +export function mergeOptions(src) { + mergeRecursive(options, src) +} + +export default options diff --git a/src/utils/dict/index.js b/src/utils/dict/index.js new file mode 100644 index 0000000..215eb9e --- /dev/null +++ b/src/utils/dict/index.js @@ -0,0 +1,33 @@ +import Dict from './Dict' +import { mergeOptions } from './DictOptions' + +export default function(Vue, options) { + mergeOptions(options) + Vue.mixin({ + data() { + if (this.$options === undefined || this.$options.dicts === undefined || this.$options.dicts === null) { + return {} + } + const dict = new Dict() + dict.owner = this + return { + dict + } + }, + created() { + if (!(this.dict instanceof Dict)) { + return + } + options.onCreated && options.onCreated(this.dict) + this.dict.init(this.$options.dicts).then(() => { + options.onReady && options.onReady(this.dict) + this.$nextTick(() => { + this.$emit('dictReady', this.dict) + if (this.$options.methods && this.$options.methods.onDictReady instanceof Function) { + this.$options.methods.onDictReady.call(this, this.dict) + } + }) + }) + }, + }) +} diff --git a/src/utils/errorCode.js b/src/utils/errorCode.js new file mode 100644 index 0000000..d2111ee --- /dev/null +++ b/src/utils/errorCode.js @@ -0,0 +1,6 @@ +export default { + '401': '认证失败,无法访问系统资源', + '403': '当前操作没有权限', + '404': '访问资源不存在', + 'default': '系统未知错误,请反馈给管理员' +} diff --git a/src/utils/generator/config.js b/src/utils/generator/config.js new file mode 100644 index 0000000..7abf227 --- /dev/null +++ b/src/utils/generator/config.js @@ -0,0 +1,438 @@ +export const formConf = { + formRef: 'elForm', + formModel: 'formData', + size: 'medium', + labelPosition: 'right', + labelWidth: 100, + formRules: 'rules', + gutter: 15, + disabled: false, + span: 24, + formBtns: true +} + +export const inputComponents = [ + { + label: '单行文本', + tag: 'el-input', + tagIcon: 'input', + placeholder: '请输入', + defaultValue: undefined, + span: 24, + labelWidth: null, + style: { width: '100%' }, + clearable: true, + prepend: '', + append: '', + 'prefix-icon': '', + 'suffix-icon': '', + maxlength: null, + 'show-word-limit': false, + readonly: false, + disabled: false, + required: true, + regList: [], + changeTag: true, + document: 'https://element.eleme.cn/#/zh-CN/component/input' + }, + { + label: '多行文本', + tag: 'el-input', + tagIcon: 'textarea', + type: 'textarea', + placeholder: '请输入', + defaultValue: undefined, + span: 24, + labelWidth: null, + autosize: { + minRows: 4, + maxRows: 4 + }, + style: { width: '100%' }, + maxlength: null, + 'show-word-limit': false, + readonly: false, + disabled: false, + required: true, + regList: [], + changeTag: true, + document: 'https://element.eleme.cn/#/zh-CN/component/input' + }, + { + label: '密码', + tag: 'el-input', + tagIcon: 'password', + placeholder: '请输入', + defaultValue: undefined, + span: 24, + 'show-password': true, + labelWidth: null, + style: { width: '100%' }, + clearable: true, + prepend: '', + append: '', + 'prefix-icon': '', + 'suffix-icon': '', + maxlength: null, + 'show-word-limit': false, + readonly: false, + disabled: false, + required: true, + regList: [], + changeTag: true, + document: 'https://element.eleme.cn/#/zh-CN/component/input' + }, + { + label: '计数器', + tag: 'el-input-number', + tagIcon: 'number', + placeholder: '', + defaultValue: undefined, + span: 24, + labelWidth: null, + min: undefined, + max: undefined, + step: undefined, + 'step-strictly': false, + precision: undefined, + 'controls-position': '', + disabled: false, + required: true, + regList: [], + changeTag: true, + document: 'https://element.eleme.cn/#/zh-CN/component/input-number' + } +] + +export const selectComponents = [ + { + label: '下拉选择', + tag: 'el-select', + tagIcon: 'select', + placeholder: '请选择', + defaultValue: undefined, + span: 24, + labelWidth: null, + style: { width: '100%' }, + clearable: true, + disabled: false, + required: true, + filterable: false, + multiple: false, + options: [{ + label: '选项一', + value: 1 + }, { + label: '选项二', + value: 2 + }], + regList: [], + changeTag: true, + document: 'https://element.eleme.cn/#/zh-CN/component/select' + }, + { + label: '级联选择', + tag: 'el-cascader', + tagIcon: 'cascader', + placeholder: '请选择', + defaultValue: [], + span: 24, + labelWidth: null, + style: { width: '100%' }, + props: { + props: { + multiple: false + } + }, + 'show-all-levels': true, + disabled: false, + clearable: true, + filterable: false, + required: true, + options: [{ + id: 1, + value: 1, + label: '选项1', + children: [{ + id: 2, + value: 2, + label: '选项1-1' + }] + }], + dataType: 'dynamic', + labelKey: 'label', + valueKey: 'value', + childrenKey: 'children', + separator: '/', + regList: [], + changeTag: true, + document: 'https://element.eleme.cn/#/zh-CN/component/cascader' + }, + { + label: '单选框组', + tag: 'el-radio-group', + tagIcon: 'radio', + defaultValue: undefined, + span: 24, + labelWidth: null, + style: {}, + optionType: 'default', + border: false, + size: 'medium', + disabled: false, + required: true, + options: [{ + label: '选项一', + value: 1 + }, { + label: '选项二', + value: 2 + }], + regList: [], + changeTag: true, + document: 'https://element.eleme.cn/#/zh-CN/component/radio' + }, + { + label: '多选框组', + tag: 'el-checkbox-group', + tagIcon: 'checkbox', + defaultValue: [], + span: 24, + labelWidth: null, + style: {}, + optionType: 'default', + border: false, + size: 'medium', + disabled: false, + required: true, + options: [{ + label: '选项一', + value: 1 + }, { + label: '选项二', + value: 2 + }], + regList: [], + changeTag: true, + document: 'https://element.eleme.cn/#/zh-CN/component/checkbox' + }, + { + label: '开关', + tag: 'el-switch', + tagIcon: 'switch', + defaultValue: false, + span: 24, + labelWidth: null, + style: {}, + disabled: false, + required: true, + 'active-text': '', + 'inactive-text': '', + 'active-color': null, + 'inactive-color': null, + 'active-value': true, + 'inactive-value': false, + regList: [], + changeTag: true, + document: 'https://element.eleme.cn/#/zh-CN/component/switch' + }, + { + label: '滑块', + tag: 'el-slider', + tagIcon: 'slider', + defaultValue: null, + span: 24, + labelWidth: null, + disabled: false, + required: true, + min: 0, + max: 100, + step: 1, + 'show-stops': false, + range: false, + regList: [], + changeTag: true, + document: 'https://element.eleme.cn/#/zh-CN/component/slider' + }, + { + label: '时间选择', + tag: 'el-time-picker', + tagIcon: 'time', + placeholder: '请选择', + defaultValue: null, + span: 24, + labelWidth: null, + style: { width: '100%' }, + disabled: false, + clearable: true, + required: true, + 'picker-options': { + selectableRange: '00:00:00-23:59:59' + }, + format: 'HH:mm:ss', + 'value-format': 'HH:mm:ss', + regList: [], + changeTag: true, + document: 'https://element.eleme.cn/#/zh-CN/component/time-picker' + }, + { + label: '时间范围', + tag: 'el-time-picker', + tagIcon: 'time-range', + defaultValue: null, + span: 24, + labelWidth: null, + style: { width: '100%' }, + disabled: false, + clearable: true, + required: true, + 'is-range': true, + 'range-separator': '至', + 'start-placeholder': '开始时间', + 'end-placeholder': '结束时间', + format: 'HH:mm:ss', + 'value-format': 'HH:mm:ss', + regList: [], + changeTag: true, + document: 'https://element.eleme.cn/#/zh-CN/component/time-picker' + }, + { + label: '日期选择', + tag: 'el-date-picker', + tagIcon: 'date', + placeholder: '请选择', + defaultValue: null, + type: 'date', + span: 24, + labelWidth: null, + style: { width: '100%' }, + disabled: false, + clearable: true, + required: true, + format: 'yyyy-MM-dd', + 'value-format': 'yyyy-MM-dd', + readonly: false, + regList: [], + changeTag: true, + document: 'https://element.eleme.cn/#/zh-CN/component/date-picker' + }, + { + label: '日期范围', + tag: 'el-date-picker', + tagIcon: 'date-range', + defaultValue: null, + span: 24, + labelWidth: null, + style: { width: '100%' }, + type: 'daterange', + 'range-separator': '至', + 'start-placeholder': '开始日期', + 'end-placeholder': '结束日期', + disabled: false, + clearable: true, + required: true, + format: 'yyyy-MM-dd', + 'value-format': 'yyyy-MM-dd', + readonly: false, + regList: [], + changeTag: true, + document: 'https://element.eleme.cn/#/zh-CN/component/date-picker' + }, + { + label: '评分', + tag: 'el-rate', + tagIcon: 'rate', + defaultValue: 0, + span: 24, + labelWidth: null, + style: {}, + max: 5, + 'allow-half': false, + 'show-text': false, + 'show-score': false, + disabled: false, + required: true, + regList: [], + changeTag: true, + document: 'https://element.eleme.cn/#/zh-CN/component/rate' + }, + { + label: '颜色选择', + tag: 'el-color-picker', + tagIcon: 'color', + defaultValue: null, + labelWidth: null, + 'show-alpha': false, + 'color-format': '', + disabled: false, + required: true, + size: 'medium', + regList: [], + changeTag: true, + document: 'https://element.eleme.cn/#/zh-CN/component/color-picker' + }, + { + label: '上传', + tag: 'el-upload', + tagIcon: 'upload', + action: 'https://jsonplaceholder.typicode.com/posts/', + defaultValue: null, + labelWidth: null, + disabled: false, + required: true, + accept: '', + name: 'file', + 'auto-upload': true, + showTip: false, + buttonText: '点击上传', + fileSize: 2, + sizeUnit: 'MB', + 'list-type': 'text', + multiple: false, + regList: [], + changeTag: true, + document: 'https://element.eleme.cn/#/zh-CN/component/upload' + } +] + +export const layoutComponents = [ + { + layout: 'rowFormItem', + tagIcon: 'row', + type: 'default', + justify: 'start', + align: 'top', + label: '行容器', + layoutTree: true, + children: [], + document: 'https://element.eleme.cn/#/zh-CN/component/layout' + }, + { + layout: 'colFormItem', + label: '按钮', + changeTag: true, + labelWidth: null, + tag: 'el-button', + tagIcon: 'button', + span: 24, + default: '主要按钮', + type: 'primary', + icon: 'el-icon-search', + size: 'medium', + disabled: false, + document: 'https://element.eleme.cn/#/zh-CN/component/button' + } +] + +// 组件rule的触发方式,无触发方式的组件不生成rule +export const trigger = { + 'el-input': 'blur', + 'el-input-number': 'blur', + 'el-select': 'change', + 'el-radio-group': 'change', + 'el-checkbox-group': 'change', + 'el-cascader': 'change', + 'el-time-picker': 'change', + 'el-date-picker': 'change', + 'el-rate': 'change' +} diff --git a/src/utils/generator/css.js b/src/utils/generator/css.js new file mode 100644 index 0000000..c1c62e6 --- /dev/null +++ b/src/utils/generator/css.js @@ -0,0 +1,18 @@ +const styles = { + 'el-rate': '.el-rate{display: inline-block; vertical-align: text-top;}', + 'el-upload': '.el-upload__tip{line-height: 1.2;}' +} + +function addCss(cssList, el) { + const css = styles[el.tag] + css && cssList.indexOf(css) === -1 && cssList.push(css) + if (el.children) { + el.children.forEach(el2 => addCss(cssList, el2)) + } +} + +export function makeUpCss(conf) { + const cssList = [] + conf.fields.forEach(el => addCss(cssList, el)) + return cssList.join('\n') +} diff --git a/src/utils/generator/drawingDefault.js b/src/utils/generator/drawingDefault.js new file mode 100644 index 0000000..09f133c --- /dev/null +++ b/src/utils/generator/drawingDefault.js @@ -0,0 +1,29 @@ +export default [ + { + layout: 'colFormItem', + tagIcon: 'input', + label: '手机号', + vModel: 'mobile', + formId: 6, + tag: 'el-input', + placeholder: '请输入手机号', + defaultValue: '', + span: 24, + style: { width: '100%' }, + clearable: true, + prepend: '', + append: '', + 'prefix-icon': 'el-icon-mobile', + 'suffix-icon': '', + maxlength: 11, + 'show-word-limit': true, + readonly: false, + disabled: false, + required: true, + changeTag: true, + regList: [{ + pattern: '/^1(3|4|5|7|8|9)\\d{9}$/', + message: '手机号格式错误' + }] + } +] diff --git a/src/utils/generator/html.js b/src/utils/generator/html.js new file mode 100644 index 0000000..9bcc536 --- /dev/null +++ b/src/utils/generator/html.js @@ -0,0 +1,359 @@ +/* eslint-disable max-len */ +import { trigger } from './config' + +let confGlobal +let someSpanIsNot24 + +export function dialogWrapper(str) { + return ` + ${str} +
+ 取消 + 确定 +
+
` +} + +export function vueTemplate(str) { + return `` +} + +export function vueScript(str) { + return `` +} + +export function cssStyle(cssStr) { + return `` +} + +function buildFormTemplate(conf, child, type) { + let labelPosition = '' + if (conf.labelPosition !== 'right') { + labelPosition = `label-position="${conf.labelPosition}"` + } + const disabled = conf.disabled ? `:disabled="${conf.disabled}"` : '' + let str = ` + ${child} + ${buildFromBtns(conf, type)} + ` + if (someSpanIsNot24) { + str = ` + ${str} + ` + } + return str +} + +function buildFromBtns(conf, type) { + let str = '' + if (conf.formBtns && type === 'file') { + str = ` + 提交 + 重置 + ` + if (someSpanIsNot24) { + str = ` + ${str} + ` + } + } + return str +} + +// span不为24的用el-col包裹 +function colWrapper(element, str) { + if (someSpanIsNot24 || element.span !== 24) { + return ` + ${str} + ` + } + return str +} + +const layouts = { + colFormItem(element) { + let labelWidth = '' + if (element.labelWidth && element.labelWidth !== confGlobal.labelWidth) { + labelWidth = `label-width="${element.labelWidth}px"` + } + const required = !trigger[element.tag] && element.required ? 'required' : '' + const tagDom = tags[element.tag] ? tags[element.tag](element) : null + let str = ` + ${tagDom} + ` + str = colWrapper(element, str) + return str + }, + rowFormItem(element) { + const type = element.type === 'default' ? '' : `type="${element.type}"` + const justify = element.type === 'default' ? '' : `justify="${element.justify}"` + const align = element.type === 'default' ? '' : `align="${element.align}"` + const gutter = element.gutter ? `gutter="${element.gutter}"` : '' + const children = element.children.map(el => layouts[el.layout](el)) + let str = ` + ${children.join('\n')} + ` + str = colWrapper(element, str) + return str + } +} + +const tags = { + 'el-button': el => { + const { + tag, disabled + } = attrBuilder(el) + const type = el.type ? `type="${el.type}"` : '' + const icon = el.icon ? `icon="${el.icon}"` : '' + const size = el.size ? `size="${el.size}"` : '' + let child = buildElButtonChild(el) + + if (child) child = `\n${child}\n` // 换行 + return `<${el.tag} ${type} ${icon} ${size} ${disabled}>${child}` + }, + 'el-input': el => { + const { + disabled, vModel, clearable, placeholder, width + } = attrBuilder(el) + const maxlength = el.maxlength ? `:maxlength="${el.maxlength}"` : '' + const showWordLimit = el['show-word-limit'] ? 'show-word-limit' : '' + const readonly = el.readonly ? 'readonly' : '' + const prefixIcon = el['prefix-icon'] ? `prefix-icon='${el['prefix-icon']}'` : '' + const suffixIcon = el['suffix-icon'] ? `suffix-icon='${el['suffix-icon']}'` : '' + const showPassword = el['show-password'] ? 'show-password' : '' + const type = el.type ? `type="${el.type}"` : '' + const autosize = el.autosize && el.autosize.minRows + ? `:autosize="{minRows: ${el.autosize.minRows}, maxRows: ${el.autosize.maxRows}}"` + : '' + let child = buildElInputChild(el) + + if (child) child = `\n${child}\n` // 换行 + return `<${el.tag} ${vModel} ${type} ${placeholder} ${maxlength} ${showWordLimit} ${readonly} ${disabled} ${clearable} ${prefixIcon} ${suffixIcon} ${showPassword} ${autosize} ${width}>${child}` + }, + 'el-input-number': el => { + const { disabled, vModel, placeholder } = attrBuilder(el) + const controlsPosition = el['controls-position'] ? `controls-position=${el['controls-position']}` : '' + const min = el.min ? `:min='${el.min}'` : '' + const max = el.max ? `:max='${el.max}'` : '' + const step = el.step ? `:step='${el.step}'` : '' + const stepStrictly = el['step-strictly'] ? 'step-strictly' : '' + const precision = el.precision ? `:precision='${el.precision}'` : '' + + return `<${el.tag} ${vModel} ${placeholder} ${step} ${stepStrictly} ${precision} ${controlsPosition} ${min} ${max} ${disabled}>` + }, + 'el-select': el => { + const { + disabled, vModel, clearable, placeholder, width + } = attrBuilder(el) + const filterable = el.filterable ? 'filterable' : '' + const multiple = el.multiple ? 'multiple' : '' + let child = buildElSelectChild(el) + + if (child) child = `\n${child}\n` // 换行 + return `<${el.tag} ${vModel} ${placeholder} ${disabled} ${multiple} ${filterable} ${clearable} ${width}>${child}` + }, + 'el-radio-group': el => { + const { disabled, vModel } = attrBuilder(el) + const size = `size="${el.size}"` + let child = buildElRadioGroupChild(el) + + if (child) child = `\n${child}\n` // 换行 + return `<${el.tag} ${vModel} ${size} ${disabled}>${child}` + }, + 'el-checkbox-group': el => { + const { disabled, vModel } = attrBuilder(el) + const size = `size="${el.size}"` + const min = el.min ? `:min="${el.min}"` : '' + const max = el.max ? `:max="${el.max}"` : '' + let child = buildElCheckboxGroupChild(el) + + if (child) child = `\n${child}\n` // 换行 + return `<${el.tag} ${vModel} ${min} ${max} ${size} ${disabled}>${child}` + }, + 'el-switch': el => { + const { disabled, vModel } = attrBuilder(el) + const activeText = el['active-text'] ? `active-text="${el['active-text']}"` : '' + const inactiveText = el['inactive-text'] ? `inactive-text="${el['inactive-text']}"` : '' + const activeColor = el['active-color'] ? `active-color="${el['active-color']}"` : '' + const inactiveColor = el['inactive-color'] ? `inactive-color="${el['inactive-color']}"` : '' + const activeValue = el['active-value'] !== true ? `:active-value='${JSON.stringify(el['active-value'])}'` : '' + const inactiveValue = el['inactive-value'] !== false ? `:inactive-value='${JSON.stringify(el['inactive-value'])}'` : '' + + return `<${el.tag} ${vModel} ${activeText} ${inactiveText} ${activeColor} ${inactiveColor} ${activeValue} ${inactiveValue} ${disabled}>` + }, + 'el-cascader': el => { + const { + disabled, vModel, clearable, placeholder, width + } = attrBuilder(el) + const options = el.options ? `:options="${el.vModel}Options"` : '' + const props = el.props ? `:props="${el.vModel}Props"` : '' + const showAllLevels = el['show-all-levels'] ? '' : ':show-all-levels="false"' + const filterable = el.filterable ? 'filterable' : '' + const separator = el.separator === '/' ? '' : `separator="${el.separator}"` + + return `<${el.tag} ${vModel} ${options} ${props} ${width} ${showAllLevels} ${placeholder} ${separator} ${filterable} ${clearable} ${disabled}>` + }, + 'el-slider': el => { + const { disabled, vModel } = attrBuilder(el) + const min = el.min ? `:min='${el.min}'` : '' + const max = el.max ? `:max='${el.max}'` : '' + const step = el.step ? `:step='${el.step}'` : '' + const range = el.range ? 'range' : '' + const showStops = el['show-stops'] ? `:show-stops="${el['show-stops']}"` : '' + + return `<${el.tag} ${min} ${max} ${step} ${vModel} ${range} ${showStops} ${disabled}>` + }, + 'el-time-picker': el => { + const { + disabled, vModel, clearable, placeholder, width + } = attrBuilder(el) + const startPlaceholder = el['start-placeholder'] ? `start-placeholder="${el['start-placeholder']}"` : '' + const endPlaceholder = el['end-placeholder'] ? `end-placeholder="${el['end-placeholder']}"` : '' + const rangeSeparator = el['range-separator'] ? `range-separator="${el['range-separator']}"` : '' + const isRange = el['is-range'] ? 'is-range' : '' + const format = el.format ? `format="${el.format}"` : '' + const valueFormat = el['value-format'] ? `value-format="${el['value-format']}"` : '' + const pickerOptions = el['picker-options'] ? `:picker-options='${JSON.stringify(el['picker-options'])}'` : '' + + return `<${el.tag} ${vModel} ${isRange} ${format} ${valueFormat} ${pickerOptions} ${width} ${placeholder} ${startPlaceholder} ${endPlaceholder} ${rangeSeparator} ${clearable} ${disabled}>` + }, + 'el-date-picker': el => { + const { + disabled, vModel, clearable, placeholder, width + } = attrBuilder(el) + const startPlaceholder = el['start-placeholder'] ? `start-placeholder="${el['start-placeholder']}"` : '' + const endPlaceholder = el['end-placeholder'] ? `end-placeholder="${el['end-placeholder']}"` : '' + const rangeSeparator = el['range-separator'] ? `range-separator="${el['range-separator']}"` : '' + const format = el.format ? `format="${el.format}"` : '' + const valueFormat = el['value-format'] ? `value-format="${el['value-format']}"` : '' + const type = el.type === 'date' ? '' : `type="${el.type}"` + const readonly = el.readonly ? 'readonly' : '' + + return `<${el.tag} ${type} ${vModel} ${format} ${valueFormat} ${width} ${placeholder} ${startPlaceholder} ${endPlaceholder} ${rangeSeparator} ${clearable} ${readonly} ${disabled}>` + }, + 'el-rate': el => { + const { disabled, vModel } = attrBuilder(el) + const max = el.max ? `:max='${el.max}'` : '' + const allowHalf = el['allow-half'] ? 'allow-half' : '' + const showText = el['show-text'] ? 'show-text' : '' + const showScore = el['show-score'] ? 'show-score' : '' + + return `<${el.tag} ${vModel} ${allowHalf} ${showText} ${showScore} ${disabled}>` + }, + 'el-color-picker': el => { + const { disabled, vModel } = attrBuilder(el) + const size = `size="${el.size}"` + const showAlpha = el['show-alpha'] ? 'show-alpha' : '' + const colorFormat = el['color-format'] ? `color-format="${el['color-format']}"` : '' + + return `<${el.tag} ${vModel} ${size} ${showAlpha} ${colorFormat} ${disabled}>` + }, + 'el-upload': el => { + const disabled = el.disabled ? ':disabled=\'true\'' : '' + const action = el.action ? `:action="${el.vModel}Action"` : '' + const multiple = el.multiple ? 'multiple' : '' + const listType = el['list-type'] !== 'text' ? `list-type="${el['list-type']}"` : '' + const accept = el.accept ? `accept="${el.accept}"` : '' + const name = el.name !== 'file' ? `name="${el.name}"` : '' + const autoUpload = el['auto-upload'] === false ? ':auto-upload="false"' : '' + const beforeUpload = `:before-upload="${el.vModel}BeforeUpload"` + const fileList = `:file-list="${el.vModel}fileList"` + const ref = `ref="${el.vModel}"` + let child = buildElUploadChild(el) + + if (child) child = `\n${child}\n` // 换行 + return `<${el.tag} ${ref} ${fileList} ${action} ${autoUpload} ${multiple} ${beforeUpload} ${listType} ${accept} ${name} ${disabled}>${child}` + } +} + +function attrBuilder(el) { + return { + vModel: `v-model="${confGlobal.formModel}.${el.vModel}"`, + clearable: el.clearable ? 'clearable' : '', + placeholder: el.placeholder ? `placeholder="${el.placeholder}"` : '', + width: el.style && el.style.width ? ':style="{width: \'100%\'}"' : '', + disabled: el.disabled ? ':disabled=\'true\'' : '' + } +} + +// el-buttin 子级 +function buildElButtonChild(conf) { + const children = [] + if (conf.default) { + children.push(conf.default) + } + return children.join('\n') +} + +// el-input innerHTML +function buildElInputChild(conf) { + const children = [] + if (conf.prepend) { + children.push(``) + } + if (conf.append) { + children.push(``) + } + return children.join('\n') +} + +function buildElSelectChild(conf) { + const children = [] + if (conf.options && conf.options.length) { + children.push(``) + } + return children.join('\n') +} + +function buildElRadioGroupChild(conf) { + const children = [] + if (conf.options && conf.options.length) { + const tag = conf.optionType === 'button' ? 'el-radio-button' : 'el-radio' + const border = conf.border ? 'border' : '' + children.push(`<${tag} v-for="(item, index) in ${conf.vModel}Options" :key="index" :label="item.value" :disabled="item.disabled" ${border}>{{item.label}}`) + } + return children.join('\n') +} + +function buildElCheckboxGroupChild(conf) { + const children = [] + if (conf.options && conf.options.length) { + const tag = conf.optionType === 'button' ? 'el-checkbox-button' : 'el-checkbox' + const border = conf.border ? 'border' : '' + children.push(`<${tag} v-for="(item, index) in ${conf.vModel}Options" :key="index" :label="item.value" :disabled="item.disabled" ${border}>{{item.label}}`) + } + return children.join('\n') +} + +function buildElUploadChild(conf) { + const list = [] + if (conf['list-type'] === 'picture-card') list.push('') + else list.push(`${conf.buttonText}`) + if (conf.showTip) list.push(`
只能上传不超过 ${conf.fileSize}${conf.sizeUnit} 的${conf.accept}文件
`) + return list.join('\n') +} + +export function makeUpHtml(conf, type) { + const htmlList = [] + confGlobal = conf + someSpanIsNot24 = conf.fields.some(item => item.span !== 24) + conf.fields.forEach(el => { + htmlList.push(layouts[el.layout](el)) + }) + const htmlStr = htmlList.join('\n') + + let temp = buildFormTemplate(conf, htmlStr, type) + if (type === 'dialog') { + temp = dialogWrapper(temp) + } + confGlobal = null + return temp +} diff --git a/src/utils/generator/icon.json b/src/utils/generator/icon.json new file mode 100644 index 0000000..2d9999a --- /dev/null +++ b/src/utils/generator/icon.json @@ -0,0 +1 @@ +["platform-eleme","eleme","delete-solid","delete","s-tools","setting","user-solid","user","phone","phone-outline","more","more-outline","star-on","star-off","s-goods","goods","warning","warning-outline","question","info","remove","circle-plus","success","error","zoom-in","zoom-out","remove-outline","circle-plus-outline","circle-check","circle-close","s-help","help","minus","plus","check","close","picture","picture-outline","picture-outline-round","upload","upload2","download","camera-solid","camera","video-camera-solid","video-camera","message-solid","bell","s-cooperation","s-order","s-platform","s-fold","s-unfold","s-operation","s-promotion","s-home","s-release","s-ticket","s-management","s-open","s-shop","s-marketing","s-flag","s-comment","s-finance","s-claim","s-custom","s-opportunity","s-data","s-check","s-grid","menu","share","d-caret","caret-left","caret-right","caret-bottom","caret-top","bottom-left","bottom-right","back","right","bottom","top","top-left","top-right","arrow-left","arrow-right","arrow-down","arrow-up","d-arrow-left","d-arrow-right","video-pause","video-play","refresh","refresh-right","refresh-left","finished","sort","sort-up","sort-down","rank","loading","view","c-scale-to-original","date","edit","edit-outline","folder","folder-opened","folder-add","folder-remove","folder-delete","folder-checked","tickets","document-remove","document-delete","document-copy","document-checked","document","document-add","printer","paperclip","takeaway-box","search","monitor","attract","mobile","scissors","umbrella","headset","brush","mouse","coordinate","magic-stick","reading","data-line","data-board","pie-chart","data-analysis","collection-tag","film","suitcase","suitcase-1","receiving","collection","files","notebook-1","notebook-2","toilet-paper","office-building","school","table-lamp","house","no-smoking","smoking","shopping-cart-full","shopping-cart-1","shopping-cart-2","shopping-bag-1","shopping-bag-2","sold-out","sell","present","box","bank-card","money","coin","wallet","discount","price-tag","news","guide","male","female","thumb","cpu","link","connection","open","turn-off","set-up","chat-round","chat-line-round","chat-square","chat-dot-round","chat-dot-square","chat-line-square","message","postcard","position","turn-off-microphone","microphone","close-notification","bangzhu","time","odometer","crop","aim","switch-button","full-screen","copy-document","mic","stopwatch","medal-1","medal","trophy","trophy-1","first-aid-kit","discover","place","location","location-outline","location-information","add-location","delete-location","map-location","alarm-clock","timer","watch-1","watch","lock","unlock","key","service","mobile-phone","bicycle","truck","ship","basketball","football","soccer","baseball","wind-power","light-rain","lightning","heavy-rain","sunrise","sunrise-1","sunset","sunny","cloudy","partly-cloudy","cloudy-and-sunny","moon","moon-night","dish","dish-1","food","chicken","fork-spoon","knife-fork","burger","tableware","sugar","dessert","ice-cream","hot-water","water-cup","coffee-cup","cold-drink","goblet","goblet-full","goblet-square","goblet-square-full","refrigerator","grape","watermelon","cherry","apple","pear","orange","coffee","ice-tea","ice-drink","milk-tea","potato-strips","lollipop","ice-cream-square","ice-cream-round"] \ No newline at end of file diff --git a/src/utils/generator/js.js b/src/utils/generator/js.js new file mode 100644 index 0000000..35e3e21 --- /dev/null +++ b/src/utils/generator/js.js @@ -0,0 +1,236 @@ +import { isArray } from 'util' +import { exportDefault, titleCase } from '@/utils/index' +import { trigger } from './config' + +const units = { + KB: '1024', + MB: '1024 / 1024', + GB: '1024 / 1024 / 1024' +} +let confGlobal +const inheritAttrs = { + file: '', + dialog: 'inheritAttrs: false,' +} + + +export function makeUpJs(conf, type) { + confGlobal = conf = JSON.parse(JSON.stringify(conf)) + const dataList = [] + const ruleList = [] + const optionsList = [] + const propsList = [] + const methodList = mixinMethod(type) + const uploadVarList = [] + + conf.fields.forEach(el => { + buildAttributes(el, dataList, ruleList, optionsList, methodList, propsList, uploadVarList) + }) + + const script = buildexport( + conf, + type, + dataList.join('\n'), + ruleList.join('\n'), + optionsList.join('\n'), + uploadVarList.join('\n'), + propsList.join('\n'), + methodList.join('\n') + ) + confGlobal = null + return script +} + +function buildAttributes(el, dataList, ruleList, optionsList, methodList, propsList, uploadVarList) { + buildData(el, dataList) + buildRules(el, ruleList) + + if (el.options && el.options.length) { + buildOptions(el, optionsList) + if (el.dataType === 'dynamic') { + const model = `${el.vModel}Options` + const options = titleCase(model) + buildOptionMethod(`get${options}`, model, methodList) + } + } + + if (el.props && el.props.props) { + buildProps(el, propsList) + } + + if (el.action && el.tag === 'el-upload') { + uploadVarList.push( + `${el.vModel}Action: '${el.action}', + ${el.vModel}fileList: [],` + ) + methodList.push(buildBeforeUpload(el)) + if (!el['auto-upload']) { + methodList.push(buildSubmitUpload(el)) + } + } + + if (el.children) { + el.children.forEach(el2 => { + buildAttributes(el2, dataList, ruleList, optionsList, methodList, propsList, uploadVarList) + }) + } +} + +function mixinMethod(type) { + const list = []; const + minxins = { + file: confGlobal.formBtns ? { + submitForm: `submitForm() { + this.$refs['${confGlobal.formRef}'].validate(valid => { + if(!valid) return + // TODO 提交表单 + }) + },`, + resetForm: `resetForm() { + this.$refs['${confGlobal.formRef}'].resetFields() + },` + } : null, + dialog: { + onOpen: 'onOpen() {},', + onClose: `onClose() { + this.$refs['${confGlobal.formRef}'].resetFields() + },`, + close: `close() { + this.$emit('update:visible', false) + },`, + handleConfirm: `handleConfirm() { + this.$refs['${confGlobal.formRef}'].validate(valid => { + if(!valid) return + this.close() + }) + },` + } + } + + const methods = minxins[type] + if (methods) { + Object.keys(methods).forEach(key => { + list.push(methods[key]) + }) + } + + return list +} + +function buildData(conf, dataList) { + if (conf.vModel === undefined) return + let defaultValue + if (typeof (conf.defaultValue) === 'string' && !conf.multiple) { + defaultValue = `'${conf.defaultValue}'` + } else { + defaultValue = `${JSON.stringify(conf.defaultValue)}` + } + dataList.push(`${conf.vModel}: ${defaultValue},`) +} + +function buildRules(conf, ruleList) { + if (conf.vModel === undefined) return + const rules = [] + if (trigger[conf.tag]) { + if (conf.required) { + const type = isArray(conf.defaultValue) ? 'type: \'array\',' : '' + let message = isArray(conf.defaultValue) ? `请至少选择一个${conf.vModel}` : conf.placeholder + if (message === undefined) message = `${conf.label}不能为空` + rules.push(`{ required: true, ${type} message: '${message}', trigger: '${trigger[conf.tag]}' }`) + } + if (conf.regList && isArray(conf.regList)) { + conf.regList.forEach(item => { + if (item.pattern) { + rules.push(`{ pattern: ${eval(item.pattern)}, message: '${item.message}', trigger: '${trigger[conf.tag]}' }`) + } + }) + } + ruleList.push(`${conf.vModel}: [${rules.join(',')}],`) + } +} + +function buildOptions(conf, optionsList) { + if (conf.vModel === undefined) return + if (conf.dataType === 'dynamic') { conf.options = [] } + const str = `${conf.vModel}Options: ${JSON.stringify(conf.options)},` + optionsList.push(str) +} + +function buildProps(conf, propsList) { + if (conf.dataType === 'dynamic') { + conf.valueKey !== 'value' && (conf.props.props.value = conf.valueKey) + conf.labelKey !== 'label' && (conf.props.props.label = conf.labelKey) + conf.childrenKey !== 'children' && (conf.props.props.children = conf.childrenKey) + } + const str = `${conf.vModel}Props: ${JSON.stringify(conf.props.props)},` + propsList.push(str) +} + +function buildBeforeUpload(conf) { + const unitNum = units[conf.sizeUnit]; let rightSizeCode = ''; let acceptCode = ''; const + returnList = [] + if (conf.fileSize) { + rightSizeCode = `let isRightSize = file.size / ${unitNum} < ${conf.fileSize} + if(!isRightSize){ + this.$message.error('文件大小超过 ${conf.fileSize}${conf.sizeUnit}') + }` + returnList.push('isRightSize') + } + if (conf.accept) { + acceptCode = `let isAccept = new RegExp('${conf.accept}').test(file.type) + if(!isAccept){ + this.$message.error('应该选择${conf.accept}类型的文件') + }` + returnList.push('isAccept') + } + const str = `${conf.vModel}BeforeUpload(file) { + ${rightSizeCode} + ${acceptCode} + return ${returnList.join('&&')} + },` + return returnList.length ? str : '' +} + +function buildSubmitUpload(conf) { + const str = `submitUpload() { + this.$refs['${conf.vModel}'].submit() + },` + return str +} + +function buildOptionMethod(methodName, model, methodList) { + const str = `${methodName}() { + // TODO 发起请求获取数据 + this.${model} + },` + methodList.push(str) +} + +function buildexport(conf, type, data, rules, selectOptions, uploadVar, props, methods) { + const str = `${exportDefault}{ + ${inheritAttrs[type]} + components: {}, + props: [], + data () { + return { + ${conf.formModel}: { + ${data} + }, + ${conf.formRules}: { + ${rules} + }, + ${uploadVar} + ${selectOptions} + ${props} + } + }, + computed: {}, + watch: {}, + created () {}, + mounted () {}, + methods: { + ${methods} + } +}` + return str +} diff --git a/src/utils/generator/render.js b/src/utils/generator/render.js new file mode 100644 index 0000000..e8640f0 --- /dev/null +++ b/src/utils/generator/render.js @@ -0,0 +1,126 @@ +import { makeMap } from '@/utils/index' + +// 参考https://github.com/vuejs/vue/blob/v2.6.10/src/platforms/web/server/util.js +const isAttr = makeMap( + 'accept,accept-charset,accesskey,action,align,alt,async,autocomplete,' + + 'autofocus,autoplay,autosave,bgcolor,border,buffered,challenge,charset,' + + 'checked,cite,class,code,codebase,color,cols,colspan,content,http-equiv,' + + 'name,contenteditable,contextmenu,controls,coords,data,datetime,default,' + + 'defer,dir,dirname,disabled,download,draggable,dropzone,enctype,method,for,' + + 'form,formaction,headers,height,hidden,high,href,hreflang,http-equiv,' + + 'icon,id,ismap,itemprop,keytype,kind,label,lang,language,list,loop,low,' + + 'manifest,max,maxlength,media,method,GET,POST,min,multiple,email,file,' + + 'muted,name,novalidate,open,optimum,pattern,ping,placeholder,poster,' + + 'preload,radiogroup,readonly,rel,required,reversed,rows,rowspan,sandbox,' + + 'scope,scoped,seamless,selected,shape,size,type,text,password,sizes,span,' + + 'spellcheck,src,srcdoc,srclang,srcset,start,step,style,summary,tabindex,' + + 'target,title,type,usemap,value,width,wrap' +) + +function vModel(self, dataObject, defaultValue) { + dataObject.props.value = defaultValue + + dataObject.on.input = val => { + self.$emit('input', val) + } +} + +const componentChild = { + 'el-button': { + default(h, conf, key) { + return conf[key] + }, + }, + 'el-input': { + prepend(h, conf, key) { + return + }, + append(h, conf, key) { + return + } + }, + 'el-select': { + options(h, conf, key) { + const list = [] + conf.options.forEach(item => { + list.push() + }) + return list + } + }, + 'el-radio-group': { + options(h, conf, key) { + const list = [] + conf.options.forEach(item => { + if (conf.optionType === 'button') list.push({item.label}) + else list.push({item.label}) + }) + return list + } + }, + 'el-checkbox-group': { + options(h, conf, key) { + const list = [] + conf.options.forEach(item => { + if (conf.optionType === 'button') { + list.push({item.label}) + } else { + list.push({item.label}) + } + }) + return list + } + }, + 'el-upload': { + 'list-type': (h, conf, key) => { + const list = [] + if (conf['list-type'] === 'picture-card') { + list.push() + } else { + list.push({conf.buttonText}) + } + if (conf.showTip) { + list.push(
只能上传不超过 {conf.fileSize}{conf.sizeUnit} 的{conf.accept}文件
) + } + return list + } + } +} + +export default { + render(h) { + const dataObject = { + attrs: {}, + props: {}, + on: {}, + style: {} + } + const confClone = JSON.parse(JSON.stringify(this.conf)) + const children = [] + + const childObjs = componentChild[confClone.tag] + if (childObjs) { + Object.keys(childObjs).forEach(key => { + const childFunc = childObjs[key] + if (confClone[key]) { + children.push(childFunc(h, confClone, key)) + } + }) + } + + Object.keys(confClone).forEach(key => { + const val = confClone[key] + if (key === 'vModel') { + vModel(this, dataObject, confClone.defaultValue) + } else if (dataObject[key]) { + dataObject[key] = val + } else if (!isAttr(key)) { + dataObject.props[key] = val + } else { + dataObject.attrs[key] = val + } + }) + return h(this.conf.tag, dataObject, children) + }, + props: ['conf'] +} diff --git a/src/utils/index.js b/src/utils/index.js new file mode 100644 index 0000000..4e65504 --- /dev/null +++ b/src/utils/index.js @@ -0,0 +1,390 @@ +import { parseTime } from './ruoyi' + +/** + * 表格时间格式化 + */ +export function formatDate(cellValue) { + if (cellValue == null || cellValue == "") return ""; + var date = new Date(cellValue) + var year = date.getFullYear() + var month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1 + var day = date.getDate() < 10 ? '0' + date.getDate() : date.getDate() + var hours = date.getHours() < 10 ? '0' + date.getHours() : date.getHours() + var minutes = date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes() + var seconds = date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds() + return year + '-' + month + '-' + day + ' ' + hours + ':' + minutes + ':' + seconds +} + +/** + * @param {number} time + * @param {string} option + * @returns {string} + */ +export function formatTime(time, option) { + if (('' + time).length === 10) { + time = parseInt(time) * 1000 + } else { + time = +time + } + const d = new Date(time) + const now = Date.now() + + const diff = (now - d) / 1000 + + if (diff < 30) { + return '刚刚' + } else if (diff < 3600) { + // less 1 hour + return Math.ceil(diff / 60) + '分钟前' + } else if (diff < 3600 * 24) { + return Math.ceil(diff / 3600) + '小时前' + } else if (diff < 3600 * 24 * 2) { + return '1天前' + } + if (option) { + return parseTime(time, option) + } else { + return ( + d.getMonth() + + 1 + + '月' + + d.getDate() + + '日' + + d.getHours() + + '时' + + d.getMinutes() + + '分' + ) + } +} + +/** + * @param {string} url + * @returns {Object} + */ +export function getQueryObject(url) { + url = url == null ? window.location.href : url + const search = url.substring(url.lastIndexOf('?') + 1) + const obj = {} + const reg = /([^?&=]+)=([^?&=]*)/g + search.replace(reg, (rs, $1, $2) => { + const name = decodeURIComponent($1) + let val = decodeURIComponent($2) + val = String(val) + obj[name] = val + return rs + }) + return obj +} + +/** + * @param {string} input value + * @returns {number} output value + */ +export function byteLength(str) { + // returns the byte length of an utf8 string + let s = str.length + for (var i = str.length - 1; i >= 0; i--) { + const code = str.charCodeAt(i) + if (code > 0x7f && code <= 0x7ff) s++ + else if (code > 0x7ff && code <= 0xffff) s += 2 + if (code >= 0xDC00 && code <= 0xDFFF) i-- + } + return s +} + +/** + * @param {Array} actual + * @returns {Array} + */ +export function cleanArray(actual) { + const newArray = [] + for (let i = 0; i < actual.length; i++) { + if (actual[i]) { + newArray.push(actual[i]) + } + } + return newArray +} + +/** + * @param {Object} json + * @returns {Array} + */ +export function param(json) { + if (!json) return '' + return cleanArray( + Object.keys(json).map(key => { + if (json[key] === undefined) return '' + return encodeURIComponent(key) + '=' + encodeURIComponent(json[key]) + }) + ).join('&') +} + +/** + * @param {string} url + * @returns {Object} + */ +export function param2Obj(url) { + const search = decodeURIComponent(url.split('?')[1]).replace(/\+/g, ' ') + if (!search) { + return {} + } + const obj = {} + const searchArr = search.split('&') + searchArr.forEach(v => { + const index = v.indexOf('=') + if (index !== -1) { + const name = v.substring(0, index) + const val = v.substring(index + 1, v.length) + obj[name] = val + } + }) + return obj +} + +/** + * @param {string} val + * @returns {string} + */ +export function html2Text(val) { + const div = document.createElement('div') + div.innerHTML = val + return div.textContent || div.innerText +} + +/** + * Merges two objects, giving the last one precedence + * @param {Object} target + * @param {(Object|Array)} source + * @returns {Object} + */ +export function objectMerge(target, source) { + if (typeof target !== 'object') { + target = {} + } + if (Array.isArray(source)) { + return source.slice() + } + Object.keys(source).forEach(property => { + const sourceProperty = source[property] + if (typeof sourceProperty === 'object') { + target[property] = objectMerge(target[property], sourceProperty) + } else { + target[property] = sourceProperty + } + }) + return target +} + +/** + * @param {HTMLElement} element + * @param {string} className + */ +export function toggleClass(element, className) { + if (!element || !className) { + return + } + let classString = element.className + const nameIndex = classString.indexOf(className) + if (nameIndex === -1) { + classString += '' + className + } else { + classString = + classString.substr(0, nameIndex) + + classString.substr(nameIndex + className.length) + } + element.className = classString +} + +/** + * @param {string} type + * @returns {Date} + */ +export function getTime(type) { + if (type === 'start') { + return new Date().getTime() - 3600 * 1000 * 24 * 90 + } else { + return new Date(new Date().toDateString()) + } +} + +/** + * @param {Function} func + * @param {number} wait + * @param {boolean} immediate + * @return {*} + */ +export function debounce(func, wait, immediate) { + let timeout, args, context, timestamp, result + + const later = function() { + // 据上一次触发时间间隔 + const last = +new Date() - timestamp + + // 上次被包装函数被调用时间间隔 last 小于设定时间间隔 wait + if (last < wait && last > 0) { + timeout = setTimeout(later, wait - last) + } else { + timeout = null + // 如果设定为immediate===true,因为开始边界已经调用过了此处无需调用 + if (!immediate) { + result = func.apply(context, args) + if (!timeout) context = args = null + } + } + } + + return function(...args) { + context = this + timestamp = +new Date() + const callNow = immediate && !timeout + // 如果延时不存在,重新设定延时 + if (!timeout) timeout = setTimeout(later, wait) + if (callNow) { + result = func.apply(context, args) + context = args = null + } + + return result + } +} + +/** + * This is just a simple version of deep copy + * Has a lot of edge cases bug + * If you want to use a perfect deep copy, use lodash's _.cloneDeep + * @param {Object} source + * @returns {Object} + */ +export function deepClone(source) { + if (!source && typeof source !== 'object') { + throw new Error('error arguments', 'deepClone') + } + const targetObj = source.constructor === Array ? [] : {} + Object.keys(source).forEach(keys => { + if (source[keys] && typeof source[keys] === 'object') { + targetObj[keys] = deepClone(source[keys]) + } else { + targetObj[keys] = source[keys] + } + }) + return targetObj +} + +/** + * @param {Array} arr + * @returns {Array} + */ +export function uniqueArr(arr) { + return Array.from(new Set(arr)) +} + +/** + * @returns {string} + */ +export function createUniqueString() { + const timestamp = +new Date() + '' + const randomNum = parseInt((1 + Math.random()) * 65536) + '' + return (+(randomNum + timestamp)).toString(32) +} + +/** + * Check if an element has a class + * @param {HTMLElement} elm + * @param {string} cls + * @returns {boolean} + */ +export function hasClass(ele, cls) { + return !!ele.className.match(new RegExp('(\\s|^)' + cls + '(\\s|$)')) +} + +/** + * Add class to element + * @param {HTMLElement} elm + * @param {string} cls + */ +export function addClass(ele, cls) { + if (!hasClass(ele, cls)) ele.className += ' ' + cls +} + +/** + * Remove class from element + * @param {HTMLElement} elm + * @param {string} cls + */ +export function removeClass(ele, cls) { + if (hasClass(ele, cls)) { + const reg = new RegExp('(\\s|^)' + cls + '(\\s|$)') + ele.className = ele.className.replace(reg, ' ') + } +} + +export function makeMap(str, expectsLowerCase) { + const map = Object.create(null) + const list = str.split(',') + for (let i = 0; i < list.length; i++) { + map[list[i]] = true + } + return expectsLowerCase + ? val => map[val.toLowerCase()] + : val => map[val] +} + +export const exportDefault = 'export default ' + +export const beautifierConf = { + html: { + indent_size: '2', + indent_char: ' ', + max_preserve_newlines: '-1', + preserve_newlines: false, + keep_array_indentation: false, + break_chained_methods: false, + indent_scripts: 'separate', + brace_style: 'end-expand', + space_before_conditional: true, + unescape_strings: false, + jslint_happy: false, + end_with_newline: true, + wrap_line_length: '110', + indent_inner_html: true, + comma_first: false, + e4x: true, + indent_empty_lines: true + }, + js: { + indent_size: '2', + indent_char: ' ', + max_preserve_newlines: '-1', + preserve_newlines: false, + keep_array_indentation: false, + break_chained_methods: false, + indent_scripts: 'normal', + brace_style: 'end-expand', + space_before_conditional: true, + unescape_strings: false, + jslint_happy: true, + end_with_newline: true, + wrap_line_length: '110', + indent_inner_html: true, + comma_first: false, + e4x: true, + indent_empty_lines: true + } +} + +// 首字母大小 +export function titleCase(str) { + return str.replace(/( |^)[a-z]/g, L => L.toUpperCase()) +} + +// 下划转驼峰 +export function camelCase(str) { + return str.replace(/_[a-z]/g, str1 => str1.substr(-1).toUpperCase()) +} + +export function isNumberStr(str) { + return /^[+-]?(0|([1-9]\d*))(\.\d+)?$/g.test(str) +} + diff --git a/src/utils/jsencrypt.js b/src/utils/jsencrypt.js new file mode 100644 index 0000000..78d9523 --- /dev/null +++ b/src/utils/jsencrypt.js @@ -0,0 +1,30 @@ +import JSEncrypt from 'jsencrypt/bin/jsencrypt.min' + +// 密钥对生成 http://web.chacuo.net/netrsakeypair + +const publicKey = 'MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAKoR8mX0rGKLqzcWmOzbfj64K8ZIgOdH\n' + + 'nzkXSOVOZbFu/TJhZ7rFAN+eaGkl3C4buccQd/EjEsj9ir7ijT7h96MCAwEAAQ==' + +const privateKey = 'MIIBVAIBADANBgkqhkiG9w0BAQEFAASCAT4wggE6AgEAAkEAqhHyZfSsYourNxaY\n' + + '7Nt+PrgrxkiA50efORdI5U5lsW79MmFnusUA355oaSXcLhu5xxB38SMSyP2KvuKN\n' + + 'PuH3owIDAQABAkAfoiLyL+Z4lf4Myxk6xUDgLaWGximj20CUf+5BKKnlrK+Ed8gA\n' + + 'kM0HqoTt2UZwA5E2MzS4EI2gjfQhz5X28uqxAiEA3wNFxfrCZlSZHb0gn2zDpWow\n' + + 'cSxQAgiCstxGUoOqlW8CIQDDOerGKH5OmCJ4Z21v+F25WaHYPxCFMvwxpcw99Ecv\n' + + 'DQIgIdhDTIqD2jfYjPTY8Jj3EDGPbH2HHuffvflECt3Ek60CIQCFRlCkHpi7hthh\n' + + 'YhovyloRYsM+IS9h/0BzlEAuO0ktMQIgSPT3aFAgJYwKpqRYKlLDVcflZFCKY7u3\n' + + 'UP8iWi1Qw0Y=' + +// 加密 +export function encrypt(txt) { + const encryptor = new JSEncrypt() + encryptor.setPublicKey(publicKey) // 设置公钥 + return encryptor.encrypt(txt) // 对数据进行加密 +} + +// 解密 +export function decrypt(txt) { + const encryptor = new JSEncrypt() + encryptor.setPrivateKey(privateKey) // 设置私钥 + return encryptor.decrypt(txt) // 对数据进行解密 +} + diff --git a/src/utils/permission.js b/src/utils/permission.js new file mode 100644 index 0000000..1730e33 --- /dev/null +++ b/src/utils/permission.js @@ -0,0 +1,51 @@ +import store from '@/store' + +/** + * 字符权限校验 + * @param {Array} value 校验值 + * @returns {Boolean} + */ +export function checkPermi(value) { + if (value && value instanceof Array && value.length > 0) { + const permissions = store.getters && store.getters.permissions + const permissionDatas = value + const all_permission = "*:*:*"; + + const hasPermission = permissions.some(permission => { + return all_permission === permission || permissionDatas.includes(permission) + }) + + if (!hasPermission) { + return false + } + return true + } else { + console.error(`need roles! Like checkPermi="['system:user:add','system:user:edit']"`) + return false + } +} + +/** + * 角色权限校验 + * @param {Array} value 校验值 + * @returns {Boolean} + */ +export function checkRole(value) { + if (value && value instanceof Array && value.length > 0) { + const roles = store.getters && store.getters.roles + const permissionRoles = value + const super_admin = "admin"; + + const hasRole = roles.some(role => { + return super_admin === role || permissionRoles.includes(role) + }) + + if (!hasRole) { + return false + } + return true + } else { + console.error(`need roles! Like checkRole="['admin','editor']"`) + return false + } +} \ No newline at end of file diff --git a/src/utils/request.js b/src/utils/request.js new file mode 100644 index 0000000..20b613f --- /dev/null +++ b/src/utils/request.js @@ -0,0 +1,158 @@ +import axios from 'axios' +import { Notification, MessageBox, Message, Loading } from 'element-ui' +import store from '@/store' +import { getToken } from '@/utils/auth' +import errorCode from '@/utils/errorCode' +import { tansParams, blobValidate } from "@/utils/ruoyi"; +import cache from '@/plugins/cache' +import { saveAs } from 'file-saver' + +let downloadLoadingInstance; +// 是否显示重新登录 +export let isRelogin = { show: false }; + +axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8' +// 创建axios实例 +const service = axios.create({ + // axios中请求配置有baseURL选项,表示请求URL公共部分 + baseURL: process.env.VUE_APP_BASE_API, + // 超时 + timeout: 30000 +}) + +// request拦截器 +service.interceptors.request.use(config => { + // 是否需要设置 token + const isToken = (config.headers || {}).isToken === false + // 是否需要防止数据重复提交 + const isRepeatSubmit = (config.headers || {}).repeatSubmit === false + if (getToken() && !isToken) { + config.headers['Authorization'] = 'Bearer ' + getToken() // 让每个请求携带自定义token 请根据实际情况自行修改 + } + // get请求映射params参数 + if (config.method === 'get' && config.params) { + let url = config.url + '?' + tansParams(config.params); + url = url.slice(0, -1); + config.params = {}; + config.url = url; + } + if (!isRepeatSubmit && (config.method === 'post' || config.method === 'put')) { + const requestObj = { + url: config.url, + data: typeof config.data === 'object' ? JSON.stringify(config.data) : config.data, + time: new Date().getTime() + } + const sessionObj = cache.session.getJSON('sessionObj') + if (sessionObj === undefined || sessionObj === null || sessionObj === '') { + cache.session.setJSON('sessionObj', requestObj) + } else { + const s_url = sessionObj.url; // 请求地址 + const s_data = sessionObj.data; // 请求数据 + const s_time = sessionObj.time; // 请求时间 + const interval = 1000; // 间隔时间(ms),小于此时间视为重复提交 + if (s_data === requestObj.data && requestObj.time - s_time < interval && s_url === requestObj.url) { + const message = '数据正在处理,请勿重复提交'; + console.warn(`[${s_url}]: ` + message) + return Promise.reject(new Error(message)) + } else { + cache.session.setJSON('sessionObj', requestObj) + } + } + } + return config +}, error => { + console.log(error) + Promise.reject(error) +}) + +// 响应拦截器 +service.interceptors.response.use(res => { + // 未设置状态码则默认成功状态 + const code = res.data.code || 200; + // 获取错误信息 + const msg = errorCode[code] || res.data.msg || errorCode['default'] + // 二进制数据则直接返回 + if(res.request.responseType === 'blob' || res.request.responseType === 'arraybuffer'){ + return res.data + } + if (code === 401) { + if (!isRelogin.show) { + isRelogin.show = true; + MessageBox.confirm('登录状态已过期,您可以继续留在该页面,或者重新登录', '系统提示', { + confirmButtonText: '重新登录', + cancelButtonText: '取消', + type: 'warning' + } + ).then(() => { + isRelogin.show = false; + store.dispatch('LogOut').then(() => { + location.href = '/index'; + }) + }).catch(() => { + isRelogin.show = false; + }); + } + return Promise.reject('无效的会话,或者会话已过期,请重新登录。') + } else if (code === 500) { + Message({ + message: msg, + type: 'error' + }) + return Promise.reject(new Error(msg)) + } else if (code !== 200) { + Notification.error({ + title: msg + }) + return Promise.reject('error') + } else { + return res.data + } + }, + error => { + console.log('err' + error) + let { message } = error; + if (message == "Network Error") { + message = "后端接口连接异常"; + } + else if (message.includes("timeout")) { + message = "系统接口请求超时"; + } + else if (message.includes("Request failed with status code")) { + message = "系统接口" + message.substr(message.length - 3) + "异常"; + } + Message({ + message: message, + type: 'error', + duration: 5 * 1000 + }) + return Promise.reject(error) + } +) + +// 通用下载方法 +export function download(url, params, filename) { + downloadLoadingInstance = Loading.service({ text: "正在下载数据,请稍候", spinner: "el-icon-loading", background: "rgba(0, 0, 0, 0.7)", }) + return service.post(url, params, { + transformRequest: [(params) => { return tansParams(params) }], + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + responseType: 'blob' + }).then(async (data) => { + const isLogin = await blobValidate(data); + if (isLogin) { + const blob = new Blob([data]) + saveAs(blob, filename) + } else { + const resText = await data.text(); + const rspObj = JSON.parse(resText); + const errMsg = errorCode[rspObj.code] || rspObj.msg || errorCode['default'] + Message.error(errMsg); + } + downloadLoadingInstance.close(); + }).catch((r) => { + console.error(r) + Message.error('下载文件出现错误,请联系管理员!') + downloadLoadingInstance.close(); + }) +} + +export default service diff --git a/src/utils/ruoyi.js b/src/utils/ruoyi.js new file mode 100644 index 0000000..7e6eccd --- /dev/null +++ b/src/utils/ruoyi.js @@ -0,0 +1,236 @@ + + +/** + * 通用js方法封装处理 + * Copyright (c) 2019 ruoyi + */ + +// 日期格式化 +export function parseTime(time, pattern) { + if (arguments.length === 0 || !time) { + return null + } + const format = pattern || '{y}-{m}-{d} {h}:{i}:{s}' + let date + if (typeof time === 'object') { + date = time + } else { + if ((typeof time === 'string') && (/^[0-9]+$/.test(time))) { + time = parseInt(time) + } else if (typeof time === 'string') { + time = time.replace(new RegExp(/-/gm), '/').replace('T', ' ').replace(new RegExp(/\.[\d]{3}/gm), ''); + } + if ((typeof time === 'number') && (time.toString().length === 10)) { + time = time * 1000 + } + date = new Date(time) + } + const formatObj = { + y: date.getFullYear(), + m: date.getMonth() + 1, + d: date.getDate(), + h: date.getHours(), + i: date.getMinutes(), + s: date.getSeconds(), + a: date.getDay() + } + const time_str = format.replace(/{(y|m|d|h|i|s|a)+}/g, (result, key) => { + let value = formatObj[key] + // Note: getDay() returns 0 on Sunday + if (key === 'a') { return ['日', '一', '二', '三', '四', '五', '六'][value] } + if (result.length > 0 && value < 10) { + value = '0' + value + } + return value || 0 + }) + return time_str +} + +// 表单重置 +export function resetForm(refName) { + if (this.$refs[refName]) { + this.$refs[refName].resetFields(); + } +} + +// 添加日期范围 +export function addDateRange(params, dateRange, propName) { + let search = params; + search.params = typeof (search.params) === 'object' && search.params !== null && !Array.isArray(search.params) ? search.params : {}; + dateRange = Array.isArray(dateRange) ? dateRange : []; + if (typeof (propName) === 'undefined') { + search.params['beginTime'] = dateRange[0]; + search.params['endTime'] = dateRange[1]; + } else { + search.params['begin' + propName] = dateRange[0]; + search.params['end' + propName] = dateRange[1]; + } + return search; +} + +// 回显数据字典 +export function selectDictLabel(datas, value) { + if (value === undefined) { + return ""; + } + var actions = []; + Object.keys(datas).some((key) => { + if (datas[key].value == ('' + value)) { + actions.push(datas[key].label); + return true; + } + }) + if (actions.length === 0) { + actions.push(value); + } + return actions.join(''); +} + +// 回显数据字典(字符串数组) +export function selectDictLabels(datas, value, separator) { + if (value === undefined) { + return ""; + } + var actions = []; + var currentSeparator = undefined === separator ? "," : separator; + var temp = value.split(currentSeparator); + Object.keys(value.split(currentSeparator)).some((val) => { + var match = false; + Object.keys(datas).some((key) => { + if (datas[key].value == ('' + temp[val])) { + actions.push(datas[key].label + currentSeparator); + match = true; + } + }) + if (!match) { + actions.push(temp[val] + currentSeparator); + } + }) + return actions.join('').substring(0, actions.join('').length - 1); +} + +// 字符串格式化(%s ) +export function sprintf(str) { + var args = arguments, flag = true, i = 1; + str = str.replace(/%s/g, function () { + var arg = args[i++]; + if (typeof arg === 'undefined') { + flag = false; + return ''; + } + return arg; + }); + return flag ? str : ''; +} + +// 转换字符串,undefined,null等转化为"" +export function parseStrEmpty(str) { + if (!str || str == "undefined" || str == "null") { + return ""; + } + return str; +} + +// 数据合并 +export function mergeRecursive(source, target) { + for (var p in target) { + try { + if (target[p].constructor == Object) { + source[p] = mergeRecursive(source[p], target[p]); + } else { + source[p] = target[p]; + } + } catch (e) { + source[p] = target[p]; + } + } + return source; +}; + +/** + * 构造树型结构数据 + * @param {*} data 数据源 + * @param {*} id id字段 默认 'id' + * @param {*} parentId 父节点字段 默认 'parentId' + * @param {*} children 孩子节点字段 默认 'children' + */ +export function handleTree(data, id, parentId, children) { + let config = { + id: id || 'id', + parentId: parentId || 'parentId', + childrenList: children || 'children' + }; + + var childrenListMap = {}; + var nodeIds = {}; + var tree = []; + + for (let d of data) { + let parentId = d[config.parentId]; + if (childrenListMap[parentId] == null) { + childrenListMap[parentId] = []; + } + nodeIds[d[config.id]] = d; + childrenListMap[parentId].push(d); + } + + for (let d of data) { + let parentId = d[config.parentId]; + if (nodeIds[parentId] == null) { + tree.push(d); + } + } + + for (let t of tree) { + adaptToChildrenList(t); + } + + function adaptToChildrenList(o) { + if (childrenListMap[o[config.id]] !== null) { + o[config.childrenList] = childrenListMap[o[config.id]]; + } + if (o[config.childrenList]) { + for (let c of o[config.childrenList]) { + adaptToChildrenList(c); + } + } + } + return tree; +} + +/** +* 参数处理 +* @param {*} params 参数 +*/ +export function tansParams(params) { + let result = '' + for (const propName of Object.keys(params)) { + const value = params[propName]; + var part = encodeURIComponent(propName) + "="; + if (value !== null && typeof (value) !== "undefined") { + if (typeof value === 'object') { + for (const key of Object.keys(value)) { + if (value[key] !== null && typeof (value[key]) !== 'undefined') { + let params = propName + '[' + key + ']'; + var subPart = encodeURIComponent(params) + "="; + result += subPart + encodeURIComponent(value[key]) + "&"; + } + } + } else { + result += part + encodeURIComponent(value) + "&"; + } + } + } + return result +} + +// 验证是否为blob格式 +export async function blobValidate(data) { + try { + const text = await data.text(); + JSON.parse(text); + return false; + } catch (error) { + return true; + } +} \ No newline at end of file diff --git a/src/utils/scroll-to.js b/src/utils/scroll-to.js new file mode 100644 index 0000000..c5d8e04 --- /dev/null +++ b/src/utils/scroll-to.js @@ -0,0 +1,58 @@ +Math.easeInOutQuad = function(t, b, c, d) { + t /= d / 2 + if (t < 1) { + return c / 2 * t * t + b + } + t-- + return -c / 2 * (t * (t - 2) - 1) + b +} + +// requestAnimationFrame for Smart Animating http://goo.gl/sx5sts +var requestAnimFrame = (function() { + return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || function(callback) { window.setTimeout(callback, 1000 / 60) } +})() + +/** + * Because it's so fucking difficult to detect the scrolling element, just move them all + * @param {number} amount + */ +function move(amount) { + document.documentElement.scrollTop = amount + document.body.parentNode.scrollTop = amount + document.body.scrollTop = amount +} + +function position() { + return document.documentElement.scrollTop || document.body.parentNode.scrollTop || document.body.scrollTop +} + +/** + * @param {number} to + * @param {number} duration + * @param {Function} callback + */ +export function scrollTo(to, duration, callback) { + const start = position() + const change = to - start + const increment = 20 + let currentTime = 0 + duration = (typeof (duration) === 'undefined') ? 500 : duration + var animateScroll = function() { + // increment the time + currentTime += increment + // find the value with the quadratic in-out easing function + var val = Math.easeInOutQuad(currentTime, start, change, duration) + // move the document.body + move(val) + // do the animation unless its over + if (currentTime < duration) { + requestAnimFrame(animateScroll) + } else { + if (callback && typeof (callback) === 'function') { + // the animation is done so lets callback + callback() + } + } + } + animateScroll() +} diff --git a/src/utils/validate.js b/src/utils/validate.js new file mode 100644 index 0000000..adfa254 --- /dev/null +++ b/src/utils/validate.js @@ -0,0 +1,83 @@ +/** + * @param {string} path + * @returns {Boolean} + */ +export function isExternal(path) { + return /^(https?:|mailto:|tel:)/.test(path) +} + +/** + * @param {string} str + * @returns {Boolean} + */ +export function validUsername(str) { + const valid_map = ['admin', 'editor'] + return valid_map.indexOf(str.trim()) >= 0 +} + +/** + * @param {string} url + * @returns {Boolean} + */ +export function validURL(url) { + const reg = /^(https?|ftp):\/\/([a-zA-Z0-9.-]+(:[a-zA-Z0-9.&%$-]+)*@)*((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3}|([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+\.(com|edu|gov|int|mil|net|org|biz|arpa|info|name|pro|aero|coop|museum|[a-zA-Z]{2}))(:[0-9]+)*(\/($|[a-zA-Z0-9.,?'\\+&%$#=~_-]+))*$/ + return reg.test(url) +} + +/** + * @param {string} str + * @returns {Boolean} + */ +export function validLowerCase(str) { + const reg = /^[a-z]+$/ + return reg.test(str) +} + +/** + * @param {string} str + * @returns {Boolean} + */ +export function validUpperCase(str) { + const reg = /^[A-Z]+$/ + return reg.test(str) +} + +/** + * @param {string} str + * @returns {Boolean} + */ +export function validAlphabets(str) { + const reg = /^[A-Za-z]+$/ + return reg.test(str) +} + +/** + * @param {string} email + * @returns {Boolean} + */ +export function validEmail(email) { + const reg = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/ + return reg.test(email) +} + +/** + * @param {string} str + * @returns {Boolean} + */ +export function isString(str) { + if (typeof str === 'string' || str instanceof String) { + return true + } + return false +} + +/** + * @param {Array} arg + * @returns {Boolean} + */ +export function isArray(arg) { + if (typeof Array.isArray === 'undefined') { + return Object.prototype.toString.call(arg) === '[object Array]' + } + return Array.isArray(arg) +} diff --git a/src/views/components/icons/element-icons.js b/src/views/components/icons/element-icons.js new file mode 100644 index 0000000..9ea4d63 --- /dev/null +++ b/src/views/components/icons/element-icons.js @@ -0,0 +1,3 @@ +const elementIcons = ['platform-eleme', 'eleme', 'delete-solid', 'delete', 's-tools', 'setting', 'user-solid', 'user', 'phone', 'phone-outline', 'more', 'more-outline', 'star-on', 'star-off', 's-goods', 'goods', 'warning', 'warning-outline', 'question', 'info', 'remove', 'circle-plus', 'success', 'error', 'zoom-in', 'zoom-out', 'remove-outline', 'circle-plus-outline', 'circle-check', 'circle-close', 's-help', 'help', 'minus', 'plus', 'check', 'close', 'picture', 'picture-outline', 'picture-outline-round', 'upload', 'upload2', 'download', 'camera-solid', 'camera', 'video-camera-solid', 'video-camera', 'message-solid', 'bell', 's-cooperation', 's-order', 's-platform', 's-fold', 's-unfold', 's-operation', 's-promotion', 's-home', 's-release', 's-ticket', 's-management', 's-open', 's-shop', 's-marketing', 's-flag', 's-comment', 's-finance', 's-claim', 's-custom', 's-opportunity', 's-data', 's-check', 's-grid', 'menu', 'share', 'd-caret', 'caret-left', 'caret-right', 'caret-bottom', 'caret-top', 'bottom-left', 'bottom-right', 'back', 'right', 'bottom', 'top', 'top-left', 'top-right', 'arrow-left', 'arrow-right', 'arrow-down', 'arrow-up', 'd-arrow-left', 'd-arrow-right', 'video-pause', 'video-play', 'refresh', 'refresh-right', 'refresh-left', 'finished', 'sort', 'sort-up', 'sort-down', 'rank', 'loading', 'view', 'c-scale-to-original', 'date', 'edit', 'edit-outline', 'folder', 'folder-opened', 'folder-add', 'folder-remove', 'folder-delete', 'folder-checked', 'tickets', 'document-remove', 'document-delete', 'document-copy', 'document-checked', 'document', 'document-add', 'printer', 'paperclip', 'takeaway-box', 'search', 'monitor', 'attract', 'mobile', 'scissors', 'umbrella', 'headset', 'brush', 'mouse', 'coordinate', 'magic-stick', 'reading', 'data-line', 'data-board', 'pie-chart', 'data-analysis', 'collection-tag', 'film', 'suitcase', 'suitcase-1', 'receiving', 'collection', 'files', 'notebook-1', 'notebook-2', 'toilet-paper', 'office-building', 'school', 'table-lamp', 'house', 'no-smoking', 'smoking', 'shopping-cart-full', 'shopping-cart-1', 'shopping-cart-2', 'shopping-bag-1', 'shopping-bag-2', 'sold-out', 'sell', 'present', 'box', 'bank-card', 'money', 'coin', 'wallet', 'discount', 'price-tag', 'news', 'guide', 'male', 'female', 'thumb', 'cpu', 'link', 'connection', 'open', 'turn-off', 'set-up', 'chat-round', 'chat-line-round', 'chat-square', 'chat-dot-round', 'chat-dot-square', 'chat-line-square', 'message', 'postcard', 'position', 'turn-off-microphone', 'microphone', 'close-notification', 'bangzhu', 'time', 'odometer', 'crop', 'aim', 'switch-button', 'full-screen', 'copy-document', 'mic', 'stopwatch', 'medal-1', 'medal', 'trophy', 'trophy-1', 'first-aid-kit', 'discover', 'place', 'location', 'location-outline', 'location-information', 'add-location', 'delete-location', 'map-location', 'alarm-clock', 'timer', 'watch-1', 'watch', 'lock', 'unlock', 'key', 'service', 'mobile-phone', 'bicycle', 'truck', 'ship', 'basketball', 'football', 'soccer', 'baseball', 'wind-power', 'light-rain', 'lightning', 'heavy-rain', 'sunrise', 'sunrise-1', 'sunset', 'sunny', 'cloudy', 'partly-cloudy', 'cloudy-and-sunny', 'moon', 'moon-night', 'dish', 'dish-1', 'food', 'chicken', 'fork-spoon', 'knife-fork', 'burger', 'tableware', 'sugar', 'dessert', 'ice-cream', 'hot-water', 'water-cup', 'coffee-cup', 'cold-drink', 'goblet', 'goblet-full', 'goblet-square', 'goblet-square-full', 'refrigerator', 'grape', 'watermelon', 'cherry', 'apple', 'pear', 'orange', 'coffee', 'ice-tea', 'ice-drink', 'milk-tea', 'potato-strips', 'lollipop', 'ice-cream-square', 'ice-cream-round'] + +export default elementIcons diff --git a/src/views/components/icons/index.vue b/src/views/components/icons/index.vue new file mode 100644 index 0000000..d3c9a71 --- /dev/null +++ b/src/views/components/icons/index.vue @@ -0,0 +1,87 @@ + + + + + diff --git a/src/views/components/icons/svg-icons.js b/src/views/components/icons/svg-icons.js new file mode 100644 index 0000000..724cd8e --- /dev/null +++ b/src/views/components/icons/svg-icons.js @@ -0,0 +1,10 @@ +const req = require.context('../../../assets/icons/svg', false, /\.svg$/) +const requireAll = requireContext => requireContext.keys() + +const re = /\.\/(.*)\.svg/ + +const svgIcons = requireAll(req).map(i => { + return i.match(re)[1] +}) + +export default svgIcons diff --git a/src/views/dashboard/BarChart.vue b/src/views/dashboard/BarChart.vue new file mode 100644 index 0000000..be0af34 --- /dev/null +++ b/src/views/dashboard/BarChart.vue @@ -0,0 +1,102 @@ + + + diff --git a/src/views/dashboard/LineChart.vue b/src/views/dashboard/LineChart.vue new file mode 100644 index 0000000..e654168 --- /dev/null +++ b/src/views/dashboard/LineChart.vue @@ -0,0 +1,135 @@ + + + diff --git a/src/views/dashboard/PanelGroup.vue b/src/views/dashboard/PanelGroup.vue new file mode 100644 index 0000000..6e16dd7 --- /dev/null +++ b/src/views/dashboard/PanelGroup.vue @@ -0,0 +1,182 @@ + + + + + diff --git a/src/views/dashboard/PieChart.vue b/src/views/dashboard/PieChart.vue new file mode 100644 index 0000000..4d2ef32 --- /dev/null +++ b/src/views/dashboard/PieChart.vue @@ -0,0 +1,79 @@ + + + diff --git a/src/views/dashboard/RaddarChart.vue b/src/views/dashboard/RaddarChart.vue new file mode 100644 index 0000000..6823af3 --- /dev/null +++ b/src/views/dashboard/RaddarChart.vue @@ -0,0 +1,116 @@ + + + diff --git a/src/views/dashboard/mixins/resize.js b/src/views/dashboard/mixins/resize.js new file mode 100644 index 0000000..b1e76e9 --- /dev/null +++ b/src/views/dashboard/mixins/resize.js @@ -0,0 +1,56 @@ +import { debounce } from '@/utils' + +export default { + data() { + return { + $_sidebarElm: null, + $_resizeHandler: null + } + }, + mounted() { + this.initListener() + }, + activated() { + if (!this.$_resizeHandler) { + // avoid duplication init + this.initListener() + } + + // when keep-alive chart activated, auto resize + this.resize() + }, + beforeDestroy() { + this.destroyListener() + }, + deactivated() { + this.destroyListener() + }, + methods: { + // use $_ for mixins properties + // https://vuejs.org/v2/style-guide/index.html#Private-property-names-essential + $_sidebarResizeHandler(e) { + if (e.propertyName === 'width') { + this.$_resizeHandler() + } + }, + initListener() { + this.$_resizeHandler = debounce(() => { + this.resize() + }, 100) + window.addEventListener('resize', this.$_resizeHandler) + + this.$_sidebarElm = document.getElementsByClassName('sidebar-container')[0] + this.$_sidebarElm && this.$_sidebarElm.addEventListener('transitionend', this.$_sidebarResizeHandler) + }, + destroyListener() { + window.removeEventListener('resize', this.$_resizeHandler) + this.$_resizeHandler = null + + this.$_sidebarElm && this.$_sidebarElm.removeEventListener('transitionend', this.$_sidebarResizeHandler) + }, + resize() { + const { chart } = this + chart && chart.resize() + } + } +} diff --git a/src/views/error/401.vue b/src/views/error/401.vue new file mode 100644 index 0000000..448b6ec --- /dev/null +++ b/src/views/error/401.vue @@ -0,0 +1,88 @@ + + + + + diff --git a/src/views/error/404.vue b/src/views/error/404.vue new file mode 100644 index 0000000..96f075c --- /dev/null +++ b/src/views/error/404.vue @@ -0,0 +1,233 @@ + + + + + diff --git a/src/views/index.vue b/src/views/index.vue new file mode 100644 index 0000000..882f4b0 --- /dev/null +++ b/src/views/index.vue @@ -0,0 +1,154 @@ + + + + + diff --git a/src/views/index_v1.vue b/src/views/index_v1.vue new file mode 100644 index 0000000..a603136 --- /dev/null +++ b/src/views/index_v1.vue @@ -0,0 +1,912 @@ + + + + + + diff --git a/src/views/login.vue b/src/views/login.vue new file mode 100644 index 0000000..0935efa --- /dev/null +++ b/src/views/login.vue @@ -0,0 +1,222 @@ + + + + + diff --git a/src/views/mes/cal/calendar/calendarType.vue b/src/views/mes/cal/calendar/calendarType.vue new file mode 100644 index 0000000..403f4de --- /dev/null +++ b/src/views/mes/cal/calendar/calendarType.vue @@ -0,0 +1,207 @@ + + + + \ No newline at end of file diff --git a/src/views/mes/cal/calendar/index.vue b/src/views/mes/cal/calendar/index.vue new file mode 100644 index 0000000..13619d7 --- /dev/null +++ b/src/views/mes/cal/calendar/index.vue @@ -0,0 +1,33 @@ + + + + + \ No newline at end of file diff --git a/src/views/mes/cal/calendar/person.vue b/src/views/mes/cal/calendar/person.vue new file mode 100644 index 0000000..e68b5c8 --- /dev/null +++ b/src/views/mes/cal/calendar/person.vue @@ -0,0 +1,221 @@ + + + + \ No newline at end of file diff --git a/src/views/mes/cal/calendar/team.vue b/src/views/mes/cal/calendar/team.vue new file mode 100644 index 0000000..257f278 --- /dev/null +++ b/src/views/mes/cal/calendar/team.vue @@ -0,0 +1,214 @@ + + + + \ No newline at end of file diff --git a/src/views/mes/cal/holiday/index.vue b/src/views/mes/cal/holiday/index.vue new file mode 100644 index 0000000..aee1e10 --- /dev/null +++ b/src/views/mes/cal/holiday/index.vue @@ -0,0 +1,189 @@ + + + + + \ No newline at end of file diff --git a/src/views/mes/cal/plan/index.vue b/src/views/mes/cal/plan/index.vue new file mode 100644 index 0000000..2fc18f3 --- /dev/null +++ b/src/views/mes/cal/plan/index.vue @@ -0,0 +1,498 @@ + + + diff --git a/src/views/mes/cal/plan/shift.vue b/src/views/mes/cal/plan/shift.vue new file mode 100644 index 0000000..3fd05a3 --- /dev/null +++ b/src/views/mes/cal/plan/shift.vue @@ -0,0 +1,282 @@ + + + diff --git a/src/views/mes/cal/plan/team.vue b/src/views/mes/cal/plan/team.vue new file mode 100644 index 0000000..1469cfa --- /dev/null +++ b/src/views/mes/cal/plan/team.vue @@ -0,0 +1,133 @@ + + + + + \ No newline at end of file diff --git a/src/views/mes/cal/team/index.vue b/src/views/mes/cal/team/index.vue new file mode 100644 index 0000000..53de664 --- /dev/null +++ b/src/views/mes/cal/team/index.vue @@ -0,0 +1,368 @@ + + + diff --git a/src/views/mes/cal/team/member.vue b/src/views/mes/cal/team/member.vue new file mode 100644 index 0000000..8a0b2c3 --- /dev/null +++ b/src/views/mes/cal/team/member.vue @@ -0,0 +1,205 @@ + + + diff --git a/src/views/mes/dv/checkplan/index.vue b/src/views/mes/dv/checkplan/index.vue new file mode 100644 index 0000000..a0fb0d3 --- /dev/null +++ b/src/views/mes/dv/checkplan/index.vue @@ -0,0 +1,509 @@ + + + diff --git a/src/views/mes/dv/checkplan/machinery.vue b/src/views/mes/dv/checkplan/machinery.vue new file mode 100644 index 0000000..c3ae145 --- /dev/null +++ b/src/views/mes/dv/checkplan/machinery.vue @@ -0,0 +1,154 @@ + + + diff --git a/src/views/mes/dv/checkplan/subject.vue b/src/views/mes/dv/checkplan/subject.vue new file mode 100644 index 0000000..39921c5 --- /dev/null +++ b/src/views/mes/dv/checkplan/subject.vue @@ -0,0 +1,155 @@ + + + diff --git a/src/views/mes/dv/machinery/index.vue b/src/views/mes/dv/machinery/index.vue new file mode 100644 index 0000000..45bed37 --- /dev/null +++ b/src/views/mes/dv/machinery/index.vue @@ -0,0 +1,595 @@ + + + \ No newline at end of file diff --git a/src/views/mes/dv/machinerytype/index.vue b/src/views/mes/dv/machinerytype/index.vue new file mode 100644 index 0000000..1c4d4ad --- /dev/null +++ b/src/views/mes/dv/machinerytype/index.vue @@ -0,0 +1,290 @@ + + + diff --git a/src/views/mes/dv/repair/index.vue b/src/views/mes/dv/repair/index.vue new file mode 100644 index 0000000..cbe6e5e --- /dev/null +++ b/src/views/mes/dv/repair/index.vue @@ -0,0 +1,501 @@ + + + diff --git a/src/views/mes/dv/repair/line.vue b/src/views/mes/dv/repair/line.vue new file mode 100644 index 0000000..980d15b --- /dev/null +++ b/src/views/mes/dv/repair/line.vue @@ -0,0 +1,261 @@ + + + diff --git a/src/views/mes/dv/subject/index.vue b/src/views/mes/dv/subject/index.vue new file mode 100644 index 0000000..c216165 --- /dev/null +++ b/src/views/mes/dv/subject/index.vue @@ -0,0 +1,367 @@ + + + diff --git a/src/views/mes/md/bom/index.vue b/src/views/mes/md/bom/index.vue new file mode 100644 index 0000000..400b4a5 --- /dev/null +++ b/src/views/mes/md/bom/index.vue @@ -0,0 +1,588 @@ + + + \ No newline at end of file diff --git a/src/views/mes/md/client/index.vue b/src/views/mes/md/client/index.vue new file mode 100644 index 0000000..003e499 --- /dev/null +++ b/src/views/mes/md/client/index.vue @@ -0,0 +1,670 @@ + + + diff --git a/src/views/mes/md/itemtype/index.vue b/src/views/mes/md/itemtype/index.vue new file mode 100644 index 0000000..a1a578a --- /dev/null +++ b/src/views/mes/md/itemtype/index.vue @@ -0,0 +1,321 @@ + + + diff --git a/src/views/mes/md/mditem/components/itembom.vue b/src/views/mes/md/mditem/components/itembom.vue new file mode 100644 index 0000000..6402928 --- /dev/null +++ b/src/views/mes/md/mditem/components/itembom.vue @@ -0,0 +1,273 @@ + + + diff --git a/src/views/mes/md/mditem/components/sip.vue b/src/views/mes/md/mditem/components/sip.vue new file mode 100644 index 0000000..ee1a1e5 --- /dev/null +++ b/src/views/mes/md/mditem/components/sip.vue @@ -0,0 +1,231 @@ + + + \ No newline at end of file diff --git a/src/views/mes/md/mditem/components/sop.vue b/src/views/mes/md/mditem/components/sop.vue new file mode 100644 index 0000000..ed48944 --- /dev/null +++ b/src/views/mes/md/mditem/components/sop.vue @@ -0,0 +1,233 @@ + + + \ No newline at end of file diff --git a/src/views/mes/md/mditem/index.vue b/src/views/mes/md/mditem/index.vue new file mode 100644 index 0000000..df553d6 --- /dev/null +++ b/src/views/mes/md/mditem/index.vue @@ -0,0 +1,726 @@ + + + + \ No newline at end of file diff --git a/src/views/mes/md/unitmeasure/index.vue b/src/views/mes/md/unitmeasure/index.vue new file mode 100644 index 0000000..7dcdde3 --- /dev/null +++ b/src/views/mes/md/unitmeasure/index.vue @@ -0,0 +1,335 @@ + + + diff --git a/src/views/mes/md/vendor/index.vue b/src/views/mes/md/vendor/index.vue new file mode 100644 index 0000000..8e52ccf --- /dev/null +++ b/src/views/mes/md/vendor/index.vue @@ -0,0 +1,704 @@ + + + + \ No newline at end of file diff --git a/src/views/mes/md/workshop/index.vue b/src/views/mes/md/workshop/index.vue new file mode 100644 index 0000000..15d2f4f --- /dev/null +++ b/src/views/mes/md/workshop/index.vue @@ -0,0 +1,372 @@ + + + diff --git a/src/views/mes/md/workstation/components/machine.vue b/src/views/mes/md/workstation/components/machine.vue new file mode 100644 index 0000000..6d12b70 --- /dev/null +++ b/src/views/mes/md/workstation/components/machine.vue @@ -0,0 +1,146 @@ + + + diff --git a/src/views/mes/md/workstation/components/tool.vue b/src/views/mes/md/workstation/components/tool.vue new file mode 100644 index 0000000..8e2680e --- /dev/null +++ b/src/views/mes/md/workstation/components/tool.vue @@ -0,0 +1,213 @@ + + + diff --git a/src/views/mes/md/workstation/components/worker.vue b/src/views/mes/md/workstation/components/worker.vue new file mode 100644 index 0000000..d1fd8b3 --- /dev/null +++ b/src/views/mes/md/workstation/components/worker.vue @@ -0,0 +1,217 @@ + + + diff --git a/src/views/mes/md/workstation/index.vue b/src/views/mes/md/workstation/index.vue new file mode 100644 index 0000000..3490dda --- /dev/null +++ b/src/views/mes/md/workstation/index.vue @@ -0,0 +1,669 @@ + + + + \ No newline at end of file diff --git a/src/views/mes/pro/feedback/index.vue b/src/views/mes/pro/feedback/index.vue new file mode 100644 index 0000000..d75427e --- /dev/null +++ b/src/views/mes/pro/feedback/index.vue @@ -0,0 +1,639 @@ + + + diff --git a/src/views/mes/pro/process/content.vue b/src/views/mes/pro/process/content.vue new file mode 100644 index 0000000..59866be --- /dev/null +++ b/src/views/mes/pro/process/content.vue @@ -0,0 +1,290 @@ + + + diff --git a/src/views/mes/pro/process/index.vue b/src/views/mes/pro/process/index.vue new file mode 100644 index 0000000..ecc9649 --- /dev/null +++ b/src/views/mes/pro/process/index.vue @@ -0,0 +1,377 @@ + + + diff --git a/src/views/mes/pro/proroute/index.vue b/src/views/mes/pro/proroute/index.vue new file mode 100644 index 0000000..bc08c9a --- /dev/null +++ b/src/views/mes/pro/proroute/index.vue @@ -0,0 +1,386 @@ + + + diff --git a/src/views/mes/pro/proroute/product.vue b/src/views/mes/pro/proroute/product.vue new file mode 100644 index 0000000..0b01430 --- /dev/null +++ b/src/views/mes/pro/proroute/product.vue @@ -0,0 +1,411 @@ + + + diff --git a/src/views/mes/pro/proroute/routeprocess.vue b/src/views/mes/pro/proroute/routeprocess.vue new file mode 100644 index 0000000..41ecf43 --- /dev/null +++ b/src/views/mes/pro/proroute/routeprocess.vue @@ -0,0 +1,411 @@ + + + diff --git a/src/views/mes/pro/proroute/routeproductbom.vue b/src/views/mes/pro/proroute/routeproductbom.vue new file mode 100644 index 0000000..9bd2c23 --- /dev/null +++ b/src/views/mes/pro/proroute/routeproductbom.vue @@ -0,0 +1,300 @@ + + + diff --git a/src/views/mes/pro/schedule/ganttedit.vue b/src/views/mes/pro/schedule/ganttedit.vue new file mode 100644 index 0000000..d83b1a3 --- /dev/null +++ b/src/views/mes/pro/schedule/ganttedit.vue @@ -0,0 +1,166 @@ + + + + + \ No newline at end of file diff --git a/src/views/mes/pro/schedule/ganttx.vue b/src/views/mes/pro/schedule/ganttx.vue new file mode 100644 index 0000000..15a9541 --- /dev/null +++ b/src/views/mes/pro/schedule/ganttx.vue @@ -0,0 +1,295 @@ + + + + + \ No newline at end of file diff --git a/src/views/mes/pro/schedule/index.vue b/src/views/mes/pro/schedule/index.vue new file mode 100644 index 0000000..91400b9 --- /dev/null +++ b/src/views/mes/pro/schedule/index.vue @@ -0,0 +1,617 @@ + + + + diff --git a/src/views/mes/pro/schedule/proTask.vue b/src/views/mes/pro/schedule/proTask.vue new file mode 100644 index 0000000..bc7ed19 --- /dev/null +++ b/src/views/mes/pro/schedule/proTask.vue @@ -0,0 +1,423 @@ + + + diff --git a/src/views/mes/pro/workorder/bom/bom.vue b/src/views/mes/pro/workorder/bom/bom.vue new file mode 100644 index 0000000..3dacea0 --- /dev/null +++ b/src/views/mes/pro/workorder/bom/bom.vue @@ -0,0 +1,258 @@ + + + diff --git a/src/views/mes/pro/workorder/index.vue b/src/views/mes/pro/workorder/index.vue new file mode 100644 index 0000000..a7bc704 --- /dev/null +++ b/src/views/mes/pro/workorder/index.vue @@ -0,0 +1,760 @@ + + + diff --git a/src/views/mes/pro/workorder/items/item.vue b/src/views/mes/pro/workorder/items/item.vue new file mode 100644 index 0000000..d525731 --- /dev/null +++ b/src/views/mes/pro/workorder/items/item.vue @@ -0,0 +1,91 @@ + + + + \ No newline at end of file diff --git a/src/views/mes/qc/defectrecord/index.vue b/src/views/mes/qc/defectrecord/index.vue new file mode 100644 index 0000000..acf1e7a --- /dev/null +++ b/src/views/mes/qc/defectrecord/index.vue @@ -0,0 +1,213 @@ + + + diff --git a/src/views/mes/qc/ipqc/index.vue b/src/views/mes/qc/ipqc/index.vue new file mode 100644 index 0000000..1bafe55 --- /dev/null +++ b/src/views/mes/qc/ipqc/index.vue @@ -0,0 +1,700 @@ + + + diff --git a/src/views/mes/qc/ipqc/line.vue b/src/views/mes/qc/ipqc/line.vue new file mode 100644 index 0000000..e267f4f --- /dev/null +++ b/src/views/mes/qc/ipqc/line.vue @@ -0,0 +1,187 @@ + + + diff --git a/src/views/mes/qc/iqc/iqc.vue b/src/views/mes/qc/iqc/iqc.vue new file mode 100644 index 0000000..338cfd1 --- /dev/null +++ b/src/views/mes/qc/iqc/iqc.vue @@ -0,0 +1,718 @@ + + + diff --git a/src/views/mes/qc/iqc/iqcline.vue b/src/views/mes/qc/iqc/iqcline.vue new file mode 100644 index 0000000..784338b --- /dev/null +++ b/src/views/mes/qc/iqc/iqcline.vue @@ -0,0 +1,178 @@ + + + diff --git a/src/views/mes/qc/oqc/index.vue b/src/views/mes/qc/oqc/index.vue new file mode 100644 index 0000000..cafb3f1 --- /dev/null +++ b/src/views/mes/qc/oqc/index.vue @@ -0,0 +1,672 @@ + + + diff --git a/src/views/mes/qc/oqc/line.vue b/src/views/mes/qc/oqc/line.vue new file mode 100644 index 0000000..ecfb4a0 --- /dev/null +++ b/src/views/mes/qc/oqc/line.vue @@ -0,0 +1,126 @@ + + + diff --git a/src/views/mes/qc/pendinginspect/index.vue b/src/views/mes/qc/pendinginspect/index.vue new file mode 100644 index 0000000..b363fee --- /dev/null +++ b/src/views/mes/qc/pendinginspect/index.vue @@ -0,0 +1,176 @@ + + + + \ No newline at end of file diff --git a/src/views/mes/qc/pendinginspect/iqc.vue b/src/views/mes/qc/pendinginspect/iqc.vue new file mode 100644 index 0000000..9dc9b36 --- /dev/null +++ b/src/views/mes/qc/pendinginspect/iqc.vue @@ -0,0 +1,341 @@ + + + \ No newline at end of file diff --git a/src/views/mes/qc/pendinginspect/oqc.vue b/src/views/mes/qc/pendinginspect/oqc.vue new file mode 100644 index 0000000..4b0203d --- /dev/null +++ b/src/views/mes/qc/pendinginspect/oqc.vue @@ -0,0 +1,330 @@ + + \ No newline at end of file diff --git a/src/views/mes/qc/pendinginspect/pqc.vue b/src/views/mes/qc/pendinginspect/pqc.vue new file mode 100644 index 0000000..aa96f6d --- /dev/null +++ b/src/views/mes/qc/pendinginspect/pqc.vue @@ -0,0 +1,373 @@ + + \ No newline at end of file diff --git a/src/views/mes/qc/qcdefect/index.vue b/src/views/mes/qc/qcdefect/index.vue new file mode 100644 index 0000000..e5e7378 --- /dev/null +++ b/src/views/mes/qc/qcdefect/index.vue @@ -0,0 +1,326 @@ + + + diff --git a/src/views/mes/qc/qcindex/index.vue b/src/views/mes/qc/qcindex/index.vue new file mode 100644 index 0000000..b0db0d3 --- /dev/null +++ b/src/views/mes/qc/qcindex/index.vue @@ -0,0 +1,366 @@ + + + diff --git a/src/views/mes/qc/qctemplate/index.vue b/src/views/mes/qc/qctemplate/index.vue new file mode 100644 index 0000000..2345e29 --- /dev/null +++ b/src/views/mes/qc/qctemplate/index.vue @@ -0,0 +1,399 @@ + + + diff --git a/src/views/mes/qc/qctemplate/templateindex.vue b/src/views/mes/qc/qctemplate/templateindex.vue new file mode 100644 index 0000000..a737bd8 --- /dev/null +++ b/src/views/mes/qc/qctemplate/templateindex.vue @@ -0,0 +1,352 @@ + + + diff --git a/src/views/mes/qc/qctemplate/templateproduct.vue b/src/views/mes/qc/qctemplate/templateproduct.vue new file mode 100644 index 0000000..919c64b --- /dev/null +++ b/src/views/mes/qc/qctemplate/templateproduct.vue @@ -0,0 +1,352 @@ + + + diff --git a/src/views/mes/report/designer/index.vue b/src/views/mes/report/designer/index.vue new file mode 100644 index 0000000..0f5629a --- /dev/null +++ b/src/views/mes/report/designer/index.vue @@ -0,0 +1,26 @@ +